@quoreadmin/ui 0.26.22 → 0.26.24
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.
- package/dist/index.js +12 -6
- package/dist/index.umd.cjs +2 -2
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/index.umd.cjs
CHANGED
|
@@ -128,7 +128,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
128
128
|
`),position:m,pageIndex:y-1,rect:d.slice(0),rotation:f,id:h,deleted:!1}}const s=super.deserialize(t,r,i);return E(s,cr,t.fontSize),E(s,ii,se.makeHexColor(...t.color)),E(s,lr,x(a=Qe,o1,Bv).call(a,t.value)),s.annotationElementId=t.id||null,E(s,Ou,o),s}serialize(t=!1){if(this.isEmpty())return null;if(this.deleted)return{pageIndex:this.pageIndex,id:this.annotationElementId,deleted:!0};const r=Qe._internalPadding*this.parentScale,i=this.getRect(r,r),o=je._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:g(this,ii)),s={annotationType:Te.FREETEXT,color:o,fontSize:g(this,cr),value:x(this,py,VN).call(this),pageIndex:this.pageIndex,rect:i,rotation:this.rotation,structTreeParentId:this._structTreeParentId};return t?s:this.annotationElementId&&!x(this,my,jN).call(this,s)?null:(s.id=this.annotationElementId,s)}renderAnnotationElement(t){const r=super.renderAnnotationElement(t);if(this.deleted)return r;const{style:i}=r;i.fontSize=`calc(${g(this,cr)}px * var(--scale-factor))`,i.color=g(this,ii),r.replaceChildren();for(const s of g(this,lr).split(`
|
|
129
129
|
`)){const a=document.createElement("div");a.append(s?document.createTextNode(s):document.createElement("br")),r.append(a)}const o=Qe._internalPadding*this.parentScale;return t.updateEdited({rect:this.getRect(o,o),popupContent:g(this,lr)}),r}resetAnnotationElement(t){super.resetAnnotationElement(t),t.resetEdited()}};ii=new WeakMap,lr=new WeakMap,i1=new WeakMap,f0=new WeakMap,cr=new WeakMap,Ou=new WeakMap,dy=new WeakSet,RN=function(t){const r=o=>{this.editorDiv.style.fontSize=`calc(${o}px * var(--scale-factor))`,this.translate(0,-(o-g(this,cr))*this.parentScale),E(this,cr,o),x(this,Du,f5).call(this)},i=g(this,cr);this.addCommands({cmd:r.bind(this,t),undo:r.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:he.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})},fy=new WeakSet,$N=function(t){const r=o=>{E(this,ii,this.editorDiv.style.color=o)},i=g(this,ii);this.addCommands({cmd:r.bind(this,t),undo:r.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:he.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})},hy=new WeakSet,FN=function(){var r;const t=[];this.editorDiv.normalize();for(const i of this.editorDiv.childNodes)t.push(x(r=Qe,Nu,h5).call(r,i));return t.join(`
|
|
130
130
|
`)},Du=new WeakSet,f5=function(){const[t,r]=this.parentDimensions;let i;if(this.isAttachedToDOM)i=this.div.getBoundingClientRect();else{const{currentLayer:o,div:s}=this,a=s.style.display,c=s.classList.contains("hidden");s.classList.remove("hidden"),s.style.display="hidden",o.div.append(this.div),i=s.getBoundingClientRect(),s.remove(),s.style.display=a,s.classList.toggle("hidden",c)}this.rotation%180==this.parentRotation%180?(this.width=i.width/t,this.height=i.height/r):(this.width=i.height/t,this.height=i.width/r),this.fixAndSetPosition()},Nu=new WeakSet,h5=function(t){return(t.nodeType===Node.TEXT_NODE?t.nodeValue:t.innerText).replaceAll(pm,"")},Pu=new WeakSet,p5=function(){if(this.editorDiv.replaceChildren(),g(this,lr))for(const t of g(this,lr).split(`
|
|
131
|
-
`)){const r=document.createElement("div");r.append(t?document.createTextNode(t):document.createElement("br")),this.editorDiv.append(r)}},py=new WeakSet,VN=function(){return g(this,lr).replaceAll(" "," ")},o1=new WeakSet,Bv=function(t){return t.replaceAll(" "," ")},my=new WeakSet,jN=function(t){const{value:r,fontSize:i,color:o,pageIndex:s}=g(this,Ou);return this._hasBeenMoved||t.value!==r||t.fontSize!==i||t.color.some((a,c)=>a!==o[c])||t.pageIndex!==s},M(Qe,Nu),M(Qe,o1),pe(Qe,"_freeTextDefaultContent",""),pe(Qe,"_internalPadding",0),pe(Qe,"_defaultColor",null),pe(Qe,"_defaultFontSize",10),pe(Qe,"_type","freetext"),pe(Qe,"_editorType",Te.FREETEXT);let q4=Qe;class rE{constructor(e,t=0,r=0,i=!0){M(this,gy);M(this,_u);M(this,yy);M(this,by);M(this,a1);M(this,s1,void 0);M(this,pa,[]);M(this,oi,[]);let o=1/0,s=-1/0,a=1/0,c=-1/0;const u=10**-4;for(const{x:b,y:w,width:v,height:k}of e){const C=Math.floor((b-t)/u)*u,T=Math.ceil((b+v+t)/u)*u,S=Math.floor((w-t)/u)*u,A=Math.ceil((w+k+t)/u)*u,O=[C,S,A,!0],I=[T,S,A,!1];g(this,pa).push(O,I),o=Math.min(o,C),s=Math.max(s,T),a=Math.min(a,S),c=Math.max(c,A)}const d=s-o+2*r,f=c-a+2*r,h=o-r,p=a-r,m=g(this,pa).at(i?-1:-2),y=[m[0],m[2]];for(const b of g(this,pa)){const[w,v,k]=b;b[0]=(w-h)/d,b[1]=(v-p)/f,b[2]=(k-p)/f}E(this,s1,{x:h,y:p,width:d,height:f,lastPoint:y})}getOutlines(){g(this,pa).sort((t,r)=>t[0]-r[0]||t[1]-r[1]||t[2]-r[2]);const e=[];for(const t of g(this,pa))t[3]?(e.push(...x(this,a1,Rv).call(this,t)),x(this,yy,HN).call(this,t)):(x(this,by,UN).call(this,t),e.push(...x(this,a1,Rv).call(this,t)));return x(this,gy,zN).call(this,e)}}s1=new WeakMap,pa=new WeakMap,oi=new WeakMap,gy=new WeakSet,zN=function(e){const t=[],r=new Set;for(const s of e){const[a,c,u]=s;t.push([a,c,s],[a,u,s])}t.sort((s,a)=>s[1]-a[1]||s[0]-a[0]);for(let s=0,a=t.length;s<a;s+=2){const c=t[s][2],u=t[s+1][2];c.push(u),u.push(c),r.add(c),r.add(u)}const i=[];let o;for(;r.size>0;){const s=r.values().next().value;let[a,c,u,d,f]=s;r.delete(s);let h=a,p=c;for(o=[a,u],i.push(o);;){let m;if(r.has(d))m=d;else{if(!r.has(f))break;m=f}r.delete(m),[a,c,u,d,f]=m,h!==a&&(o.push(h,p,a,p===c?c:u),h=a),p=p===c?u:c}o.push(h,p)}return new cW(i,g(this,s1))},_u=new WeakSet,m5=function(e){const t=g(this,oi);let r=0,i=t.length-1;for(;r<=i;){const o=r+i>>1,s=t[o][0];if(s===e)return o;s<e?r=o+1:i=o-1}return i+1},yy=new WeakSet,HN=function([,e,t]){const r=x(this,_u,m5).call(this,e);g(this,oi).splice(r,0,[e,t])},by=new WeakSet,UN=function([,e,t]){const r=x(this,_u,m5).call(this,e);for(let i=r;i<g(this,oi).length;i++){const[o,s]=g(this,oi)[i];if(o!==e)break;if(o===e&&s===t){g(this,oi).splice(i,1);return}}for(let i=r-1;i>=0;i--){const[o,s]=g(this,oi)[i];if(o!==e)break;if(o===e&&s===t){g(this,oi).splice(i,1);return}}},a1=new WeakSet,Rv=function(e){const[t,r,i]=e,o=[[t,r,i]],s=x(this,_u,m5).call(this,i);for(let a=0;a<s;a++){const[c,u]=g(this,oi)[a];for(let d=0,f=o.length;d<f;d++){const[,h,p]=o[d];if(!(u<=h||p<=c))if(h>=c)if(p>u)o[d][1]=u;else{if(f===1)return[];o.splice(d,1),d--,f--}else o[d][2]=c,p>u&&o.push([t,u,p])}}return o};class iE{toSVGPath(){throw new Error("Abstract method `toSVGPath` must be implemented.")}get box(){throw new Error("Abstract getter `box` must be implemented.")}serialize(e,t){throw new Error("Abstract method `serialize` must be implemented.")}get free(){return this instanceof G4}}class cW extends iE{constructor(t,r){super();M(this,l1,void 0);M(this,Lu,void 0);E(this,Lu,t),E(this,l1,r)}toSVGPath(){const t=[];for(const r of g(this,Lu)){let[i,o]=r;t.push(`M${i} ${o}`);for(let s=2;s<r.length;s+=2){const a=r[s],c=r[s+1];a===i?(t.push(`V${c}`),o=c):c===o&&(t.push(`H${a}`),i=a)}t.push("Z")}return t.join(" ")}serialize([t,r,i,o],s){const a=[],c=i-t,u=o-r;for(const d of g(this,Lu)){const f=new Array(d.length);for(let h=0;h<d.length;h+=2)f[h]=t+d[h]*c,f[h+1]=o-d[h+1]*u;a.push(f)}return a}get box(){return g(this,l1)}}l1=new WeakMap,Lu=new WeakMap;const Fo=class Fo{constructor({x:e,y:t},r,i,o,s,a=0){M(this,f1);M(this,Hi,void 0);M(this,$o,[]);M(this,Bu,void 0);M(this,Ru,void 0);M(this,Ui,[]);M(this,xe,new Float64Array(18));M(this,h0,void 0);M(this,p0,void 0);M(this,c1,void 0);M(this,u1,void 0);M(this,$u,void 0);M(this,Fu,void 0);M(this,ma,[]);E(this,Hi,r),E(this,Fu,o*i),E(this,Ru,s),g(this,xe).set([NaN,NaN,NaN,NaN,e,t],6),E(this,Bu,a),E(this,u1,g(Fo,d1)*i),E(this,c1,g(Fo,vy)*i),E(this,$u,i),g(this,ma).push(e,t)}get free(){return!0}isEmpty(){return isNaN(g(this,xe)[8])}add({x:e,y:t}){var A;E(this,h0,e),E(this,p0,t);const[r,i,o,s]=g(this,Hi);let[a,c,u,d]=g(this,xe).subarray(8,12);const f=e-u,h=t-d,p=Math.hypot(f,h);if(p<g(this,c1))return!1;const m=p-g(this,u1),y=m/p,b=y*f,w=y*h;let v=a,k=c;a=u,c=d,u+=b,d+=w,(A=g(this,ma))==null||A.push(e,t);const C=b/m,T=-w/m*g(this,Fu),S=C*g(this,Fu);return g(this,xe).set(g(this,xe).subarray(2,8),0),g(this,xe).set([u+T,d+S],4),g(this,xe).set(g(this,xe).subarray(14,18),12),g(this,xe).set([u-T,d-S],16),isNaN(g(this,xe)[6])?(g(this,Ui).length===0&&(g(this,xe).set([a+T,c+S],2),g(this,Ui).push(NaN,NaN,NaN,NaN,(a+T-r)/o,(c+S-i)/s),g(this,xe).set([a-T,c-S],14),g(this,$o).push(NaN,NaN,NaN,NaN,(a-T-r)/o,(c-S-i)/s)),g(this,xe).set([v,k,a,c,u,d],6),!this.isEmpty()):(g(this,xe).set([v,k,a,c,u,d],6),Math.abs(Math.atan2(k-c,v-a)-Math.atan2(w,b))<Math.PI/2?([a,c,u,d]=g(this,xe).subarray(2,6),g(this,Ui).push(NaN,NaN,NaN,NaN,((a+u)/2-r)/o,((c+d)/2-i)/s),[a,c,v,k]=g(this,xe).subarray(14,18),g(this,$o).push(NaN,NaN,NaN,NaN,((v+a)/2-r)/o,((k+c)/2-i)/s),!0):([v,k,a,c,u,d]=g(this,xe).subarray(0,6),g(this,Ui).push(((v+5*a)/6-r)/o,((k+5*c)/6-i)/s,((5*a+u)/6-r)/o,((5*c+d)/6-i)/s,((a+u)/2-r)/o,((c+d)/2-i)/s),[u,d,a,c,v,k]=g(this,xe).subarray(12,18),g(this,$o).push(((v+5*a)/6-r)/o,((k+5*c)/6-i)/s,((5*a+u)/6-r)/o,((5*c+d)/6-i)/s,((a+u)/2-r)/o,((c+d)/2-i)/s),!0))}toSVGPath(){if(this.isEmpty())return"";const e=g(this,Ui),t=g(this,$o),r=g(this,xe).subarray(4,6),i=g(this,xe).subarray(16,18),[o,s,a,c]=g(this,Hi),[u,d,f,h]=x(this,f1,$v).call(this);if(isNaN(g(this,xe)[6])&&!this.isEmpty())return`M${(g(this,xe)[2]-o)/a} ${(g(this,xe)[3]-s)/c} L${(g(this,xe)[4]-o)/a} ${(g(this,xe)[5]-s)/c} L${u} ${d} L${f} ${h} L${(g(this,xe)[16]-o)/a} ${(g(this,xe)[17]-s)/c} L${(g(this,xe)[14]-o)/a} ${(g(this,xe)[15]-s)/c} Z`;const p=[];p.push(`M${e[4]} ${e[5]}`);for(let m=6;m<e.length;m+=6)isNaN(e[m])?p.push(`L${e[m+4]} ${e[m+5]}`):p.push(`C${e[m]} ${e[m+1]} ${e[m+2]} ${e[m+3]} ${e[m+4]} ${e[m+5]}`);p.push(`L${(r[0]-o)/a} ${(r[1]-s)/c} L${u} ${d} L${f} ${h} L${(i[0]-o)/a} ${(i[1]-s)/c}`);for(let m=t.length-6;m>=6;m-=6)isNaN(t[m])?p.push(`L${t[m+4]} ${t[m+5]}`):p.push(`C${t[m]} ${t[m+1]} ${t[m+2]} ${t[m+3]} ${t[m+4]} ${t[m+5]}`);return p.push(`L${t[4]} ${t[5]} Z`),p.join(" ")}getOutlines(){var w;const e=g(this,Ui),t=g(this,$o),r=g(this,xe),i=r.subarray(4,6),o=r.subarray(16,18),[s,a,c,u]=g(this,Hi),d=new Float64Array((((w=g(this,ma))==null?void 0:w.length)??0)+2);for(let v=0,k=d.length-2;v<k;v+=2)d[v]=(g(this,ma)[v]-s)/c,d[v+1]=(g(this,ma)[v+1]-a)/u;d[d.length-2]=(g(this,h0)-s)/c,d[d.length-1]=(g(this,p0)-a)/u;const[f,h,p,m]=x(this,f1,$v).call(this);if(isNaN(r[6])&&!this.isEmpty()){const v=new Float64Array(36);return v.set([NaN,NaN,NaN,NaN,(r[2]-s)/c,(r[3]-a)/u,NaN,NaN,NaN,NaN,(r[4]-s)/c,(r[5]-a)/u,NaN,NaN,NaN,NaN,f,h,NaN,NaN,NaN,NaN,p,m,NaN,NaN,NaN,NaN,(r[16]-s)/c,(r[17]-a)/u,NaN,NaN,NaN,NaN,(r[14]-s)/c,(r[15]-a)/u],0),new G4(v,d,g(this,Hi),g(this,$u),g(this,Bu),g(this,Ru))}const y=new Float64Array(g(this,Ui).length+24+g(this,$o).length);let b=e.length;for(let v=0;v<b;v+=2)isNaN(e[v])?y[v]=y[v+1]=NaN:(y[v]=e[v],y[v+1]=e[v+1]);y.set([NaN,NaN,NaN,NaN,(i[0]-s)/c,(i[1]-a)/u,NaN,NaN,NaN,NaN,f,h,NaN,NaN,NaN,NaN,p,m,NaN,NaN,NaN,NaN,(o[0]-s)/c,(o[1]-a)/u],b),b+=24;for(let v=t.length-6;v>=6;v-=6)for(let k=0;k<6;k+=2)isNaN(t[v+k])?(y[b]=y[b+1]=NaN,b+=2):(y[b]=t[v+k],y[b+1]=t[v+k+1],b+=2);return y.set([NaN,NaN,NaN,NaN,t[4],t[5]],b),new G4(y,d,g(this,Hi),g(this,$u),g(this,Bu),g(this,Ru))}};Hi=new WeakMap,$o=new WeakMap,Bu=new WeakMap,Ru=new WeakMap,Ui=new WeakMap,xe=new WeakMap,h0=new WeakMap,p0=new WeakMap,c1=new WeakMap,u1=new WeakMap,$u=new WeakMap,Fu=new WeakMap,ma=new WeakMap,d1=new WeakMap,wy=new WeakMap,vy=new WeakMap,f1=new WeakSet,$v=function(){const e=g(this,xe).subarray(4,6),t=g(this,xe).subarray(16,18),[r,i,o,s]=g(this,Hi);return[(g(this,h0)+(e[0]-t[0])/2-r)/o,(g(this,p0)+(e[1]-t[1])/2-i)/s,(g(this,h0)+(t[0]-e[0])/2-r)/o,(g(this,p0)+(t[1]-e[1])/2-i)/s]},M(Fo,d1,8),M(Fo,wy,2),M(Fo,vy,g(Fo,d1)+g(Fo,wy));let mm=Fo;class G4 extends iE{constructor(t,r,i,o,s,a){super();M(this,g0);M(this,y0);M(this,Cy);M(this,Vu,void 0);M(this,m0,null);M(this,Vo,void 0);M(this,h1,void 0);M(this,ur,void 0);M(this,p1,void 0);M(this,bt,void 0);E(this,bt,t),E(this,ur,r),E(this,Vu,i),E(this,p1,o),E(this,Vo,s),E(this,h1,a),x(this,Cy,ZN).call(this,a);const{x:c,y:u,width:d,height:f}=g(this,m0);for(let h=0,p=t.length;h<p;h+=2)t[h]=(t[h]-c)/d,t[h+1]=(t[h+1]-u)/f;for(let h=0,p=r.length;h<p;h+=2)r[h]=(r[h]-c)/d,r[h+1]=(r[h+1]-u)/f}toSVGPath(){const t=[`M${g(this,bt)[4]} ${g(this,bt)[5]}`];for(let r=6,i=g(this,bt).length;r<i;r+=6)isNaN(g(this,bt)[r])?t.push(`L${g(this,bt)[r+4]} ${g(this,bt)[r+5]}`):t.push(`C${g(this,bt)[r]} ${g(this,bt)[r+1]} ${g(this,bt)[r+2]} ${g(this,bt)[r+3]} ${g(this,bt)[r+4]} ${g(this,bt)[r+5]}`);return t.push("Z"),t.join(" ")}serialize([t,r,i,o],s){const a=i-t,c=o-r;let u,d;switch(s){case 0:u=x(this,g0,ep).call(this,g(this,bt),t,o,a,-c),d=x(this,g0,ep).call(this,g(this,ur),t,o,a,-c);break;case 90:u=x(this,y0,tp).call(this,g(this,bt),t,r,a,c),d=x(this,y0,tp).call(this,g(this,ur),t,r,a,c);break;case 180:u=x(this,g0,ep).call(this,g(this,bt),i,r,-a,c),d=x(this,g0,ep).call(this,g(this,ur),i,r,-a,c);break;case 270:u=x(this,y0,tp).call(this,g(this,bt),i,o,-a,-c),d=x(this,y0,tp).call(this,g(this,ur),i,o,-a,-c)}return{outline:Array.from(u),points:[Array.from(d)]}}get box(){return g(this,m0)}getNewOutline(t,r){const{x:i,y:o,width:s,height:a}=g(this,m0),[c,u,d,f]=g(this,Vu),h=s*d,p=a*f,m=i*d+c,y=o*f+u,b=new mm({x:g(this,ur)[0]*h+m,y:g(this,ur)[1]*p+y},g(this,Vu),g(this,p1),t,g(this,h1),r??g(this,Vo));for(let w=2;w<g(this,ur).length;w+=2)b.add({x:g(this,ur)[w]*h+m,y:g(this,ur)[w+1]*p+y});return b.getOutlines()}}Vu=new WeakMap,m0=new WeakMap,Vo=new WeakMap,h1=new WeakMap,ur=new WeakMap,p1=new WeakMap,bt=new WeakMap,g0=new WeakSet,ep=function(t,r,i,o,s){const a=new Float64Array(t.length);for(let c=0,u=t.length;c<u;c+=2)a[c]=r+t[c]*o,a[c+1]=i+t[c+1]*s;return a},y0=new WeakSet,tp=function(t,r,i,o,s){const a=new Float64Array(t.length);for(let c=0,u=t.length;c<u;c+=2)a[c]=r+t[c+1]*o,a[c+1]=i+t[c]*s;return a},Cy=new WeakSet,ZN=function(t){const r=g(this,bt);let i=r[4],o=r[5],s=i,a=o,c=i,u=o,d=i,f=o;const h=t?Math.max:Math.min;for(let w=6,v=r.length;w<v;w+=6){if(isNaN(r[w]))s=Math.min(s,r[w+4]),a=Math.min(a,r[w+5]),c=Math.max(c,r[w+4]),u=Math.max(u,r[w+5]),f<r[w+5]?(d=r[w+4],f=r[w+5]):f===r[w+5]&&(d=h(d,r[w+4]));else{const k=se.bezierBoundingBox(i,o,...r.slice(w,w+6));s=Math.min(s,k[0]),a=Math.min(a,k[1]),c=Math.max(c,k[2]),u=Math.max(u,k[3]),f<k[3]?(d=k[2],f=k[3]):f===k[3]&&(d=h(d,k[2]))}i=r[w+4],o=r[w+5]}const p=s-g(this,Vo),m=a-g(this,Vo),y=c-s+2*g(this,Vo),b=u-a+2*g(this,Vo);E(this,m0,{x:p,y:m,width:y,height:b,lastPoint:[d,f]})};const zo=class zo{constructor({editor:e=null,uiManager:t=null}){M(this,v1);M(this,C1);M(this,ky);M(this,jo);M(this,Sy);M(this,Zi);M(this,m1,x(this,ky,WN).bind(this));M(this,g1,x(this,Sy,KN).bind(this));M(this,si,null);M(this,b0,null);M(this,ju,void 0);M(this,Dt,null);M(this,y1,!1);M(this,zu,!1);M(this,b1,null);M(this,w1,void 0);M(this,ai,null);M(this,Hu,void 0);var r;e?(E(this,zu,!1),E(this,Hu,he.HIGHLIGHT_COLOR),E(this,b1,e)):(E(this,zu,!0),E(this,Hu,he.HIGHLIGHT_DEFAULT_COLOR)),E(this,ai,(e==null?void 0:e._uiManager)||t),E(this,w1,g(this,ai)._eventBus),E(this,ju,(e==null?void 0:e.color)||((r=g(this,ai))==null?void 0:r.highlightColors.values().next().value)||"#FFFF98")}static get _keyboardManager(){return Ie(this,"_keyboardManager",new u2([[["Escape","mac+Escape"],zo.prototype._hideDropdownFromKeyboard],[[" ","mac+ "],zo.prototype._colorSelectFromKeyboard],[["ArrowDown","ArrowRight","mac+ArrowDown","mac+ArrowRight"],zo.prototype._moveToNext],[["ArrowUp","ArrowLeft","mac+ArrowUp","mac+ArrowLeft"],zo.prototype._moveToPrevious],[["Home","mac+Home"],zo.prototype._moveToBeginning],[["End","mac+End"],zo.prototype._moveToEnd]]))}renderButton(){const e=E(this,si,document.createElement("button"));e.className="colorPicker",e.tabIndex="0",e.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-button"),e.setAttribute("aria-haspopup",!0);const t=g(this,ai)._signal;e.addEventListener("click",x(this,jo,R0).bind(this),{signal:t}),e.addEventListener("keydown",g(this,m1),{signal:t});const r=E(this,b0,document.createElement("span"));return r.className="swatch",r.setAttribute("aria-hidden",!0),r.style.backgroundColor=g(this,ju),e.append(r),e}renderMainDropdown(){const e=E(this,Dt,x(this,v1,Fv).call(this));return e.setAttribute("aria-orientation","horizontal"),e.setAttribute("aria-labelledby","highlightColorPickerLabel"),e}_colorSelectFromKeyboard(e){if(e.target===g(this,si)){x(this,jo,R0).call(this,e);return}const t=e.target.getAttribute("data-color");t&&x(this,C1,Vv).call(this,t,e)}_moveToNext(e){var t,r;g(this,Zi,Oa)?e.target!==g(this,si)?(t=e.target.nextSibling)==null||t.focus():(r=g(this,Dt).firstChild)==null||r.focus():x(this,jo,R0).call(this,e)}_moveToPrevious(e){var t,r;e.target!==((t=g(this,Dt))==null?void 0:t.firstChild)&&e.target!==g(this,si)?(g(this,Zi,Oa)||x(this,jo,R0).call(this,e),(r=e.target.previousSibling)==null||r.focus()):g(this,Zi,Oa)&&this._hideDropdownFromKeyboard()}_moveToBeginning(e){var t;g(this,Zi,Oa)?(t=g(this,Dt).firstChild)==null||t.focus():x(this,jo,R0).call(this,e)}_moveToEnd(e){var t;g(this,Zi,Oa)?(t=g(this,Dt).lastChild)==null||t.focus():x(this,jo,R0).call(this,e)}hideDropdown(){var e;(e=g(this,Dt))==null||e.classList.add("hidden"),window.removeEventListener("pointerdown",g(this,g1))}_hideDropdownFromKeyboard(){var e;g(this,zu)||(g(this,Zi,Oa)?(this.hideDropdown(),g(this,si).focus({preventScroll:!0,focusVisible:g(this,y1)})):(e=g(this,b1))==null||e.unselect())}updateColor(e){if(g(this,b0)&&(g(this,b0).style.backgroundColor=e),!g(this,Dt))return;const t=g(this,ai).highlightColors.values();for(const r of g(this,Dt).children)r.setAttribute("aria-selected",t.next().value===e)}destroy(){var e,t;(e=g(this,si))==null||e.remove(),E(this,si,null),E(this,b0,null),(t=g(this,Dt))==null||t.remove(),E(this,Dt,null)}};m1=new WeakMap,g1=new WeakMap,si=new WeakMap,b0=new WeakMap,ju=new WeakMap,Dt=new WeakMap,y1=new WeakMap,zu=new WeakMap,b1=new WeakMap,w1=new WeakMap,ai=new WeakMap,Hu=new WeakMap,v1=new WeakSet,Fv=function(){const e=document.createElement("div"),t=g(this,ai)._signal;e.addEventListener("contextmenu",br,{signal:t}),e.className="dropdown",e.role="listbox",e.setAttribute("aria-multiselectable",!1),e.setAttribute("aria-orientation","vertical"),e.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-dropdown");for(const[r,i]of g(this,ai).highlightColors){const o=document.createElement("button");o.tabIndex="0",o.role="option",o.setAttribute("data-color",i),o.title=r,o.setAttribute("data-l10n-id",`pdfjs-editor-colorpicker-${r}`);const s=document.createElement("span");o.append(s),s.className="swatch",s.style.backgroundColor=i,o.setAttribute("aria-selected",i===g(this,ju)),o.addEventListener("click",x(this,C1,Vv).bind(this,i),{signal:t}),e.append(o)}return e.addEventListener("keydown",g(this,m1),{signal:t}),e},C1=new WeakSet,Vv=function(e,t){t.stopPropagation(),g(this,w1).dispatch("switchannotationeditorparams",{source:this,type:g(this,Hu),value:e})},ky=new WeakSet,WN=function(e){zo._keyboardManager.exec(this,e)},jo=new WeakSet,R0=function(e){if(g(this,Zi,Oa)){this.hideDropdown();return}if(E(this,y1,e.detail===0),window.addEventListener("pointerdown",g(this,g1),{signal:g(this,ai)._signal}),g(this,Dt)){g(this,Dt).classList.remove("hidden");return}const t=E(this,Dt,x(this,v1,Fv).call(this));g(this,si).append(t)},Sy=new WeakSet,KN=function(e){var t;(t=g(this,Dt))!=null&&t.contains(e.target)||this.hideDropdown()},Zi=new WeakSet,Oa=function(){return g(this,Dt)&&!g(this,Dt).classList.contains("hidden")};let gm=zo;const _e=class _e extends je{constructor(t){super({...t,name:"highlightEditor"});M(this,A1);M(this,T1);M(this,My);M(this,Ey);M(this,Ay);M(this,x1);M(this,k0);M(this,Ty);M(this,qu);M(this,S0);M(this,xy);M(this,Iy);M(this,Uu,null);M(this,k1,0);M(this,ga,void 0);M(this,w0,null);M(this,Zu,null);M(this,_r,null);M(this,S1,null);M(this,M1,0);M(this,v0,null);M(this,li,null);M(this,En,null);M(this,dr,!1);M(this,Wu,null);M(this,C0,void 0);M(this,Nt,null);M(this,Ku,"");M(this,Wi,void 0);M(this,E1,"");this.color=t.color||_e._defaultColor,E(this,Wi,t.thickness||_e._defaultThickness),E(this,C0,t.opacity||_e._defaultOpacity),E(this,ga,t.boxes||null),E(this,E1,t.methodOfCreation||""),E(this,Ku,t.text||""),this._isDraggable=!1,t.highlightId>-1?(E(this,dr,!0),x(this,T1,zv).call(this,t),x(this,k0,np).call(this)):(E(this,Uu,t.anchorNode),E(this,k1,t.anchorOffset),E(this,S1,t.focusNode),E(this,M1,t.focusOffset),x(this,A1,jv).call(this),x(this,k0,np).call(this),this.rotate(this.rotation))}static get _keyboardManager(){const t=_e.prototype;return Ie(this,"_keyboardManager",new u2([[["ArrowLeft","mac+ArrowLeft"],t._moveCaret,{args:[0]}],[["ArrowRight","mac+ArrowRight"],t._moveCaret,{args:[1]}],[["ArrowUp","mac+ArrowUp"],t._moveCaret,{args:[2]}],[["ArrowDown","mac+ArrowDown"],t._moveCaret,{args:[3]}]]))}get telemetryInitialData(){return{action:"added",type:g(this,dr)?"free_highlight":"highlight",color:this._uiManager.highlightColorNames.get(this.color),thickness:g(this,Wi),methodOfCreation:g(this,E1)}}get telemetryFinalData(){return{type:"highlight",color:this._uiManager.highlightColorNames.get(this.color)}}static computeTelemetryFinalData(t){return{numberOfColors:t.get("color").size}}static initialize(t,r){var i;je.initialize(t,r),_e._defaultColor||(_e._defaultColor=((i=r.highlightColors)==null?void 0:i.values().next().value)||"#fff066")}static updateDefaultParams(t,r){switch(t){case he.HIGHLIGHT_DEFAULT_COLOR:_e._defaultColor=r;break;case he.HIGHLIGHT_THICKNESS:_e._defaultThickness=r}}translateInPage(t,r){}get toolbarPosition(){return g(this,Wu)}updateParams(t,r){switch(t){case he.HIGHLIGHT_COLOR:x(this,My,qN).call(this,r);break;case he.HIGHLIGHT_THICKNESS:x(this,Ey,GN).call(this,r)}}static get defaultPropertiesToUpdate(){return[[he.HIGHLIGHT_DEFAULT_COLOR,_e._defaultColor],[he.HIGHLIGHT_THICKNESS,_e._defaultThickness]]}get propertiesToUpdate(){return[[he.HIGHLIGHT_COLOR,this.color||_e._defaultColor],[he.HIGHLIGHT_THICKNESS,g(this,Wi)||_e._defaultThickness],[he.HIGHLIGHT_FREE,g(this,dr)]]}async addEditToolbar(){const t=await super.addEditToolbar();return t?(this._uiManager.highlightColors&&(E(this,Zu,new gm({editor:this})),t.addColorPicker(g(this,Zu))),t):null}disableEditing(){super.disableEditing(),this.div.classList.toggle("disabled",!0)}enableEditing(){super.enableEditing(),this.div.classList.toggle("disabled",!1)}fixAndSetPosition(){return super.fixAndSetPosition(x(this,S0,rp).call(this))}getBaseTranslation(){return[0,0]}getRect(t,r){return super.getRect(t,r,x(this,S0,rp).call(this))}onceAdded(){this.parent.addUndoableEditor(this),this.div.focus()}remove(){x(this,x1,Hv).call(this),this._reportTelemetry({action:"deleted"}),super.remove()}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(x(this,k0,np).call(this),this.isAttachedToDOM||this.parent.add(this)))}setParent(t){var i;let r=!1;this.parent&&!t?x(this,x1,Hv).call(this):t&&(x(this,k0,np).call(this,t),r=!this.parent&&((i=this.div)==null?void 0:i.classList.contains("selectedEditor"))),super.setParent(t),this.show(this._isVisible),r&&this.select()}rotate(t){var o,s,a;const{drawLayer:r}=this.parent;let i;g(this,dr)?(t=(t-this.rotation+360)%360,i=x(o=_e,ya,md).call(o,g(this,li).box,t)):i=x(s=_e,ya,md).call(s,this,t),r.rotate(g(this,En),t),r.rotate(g(this,Nt),t),r.updateBox(g(this,En),i),r.updateBox(g(this,Nt),x(a=_e,ya,md).call(a,g(this,_r).box,t))}render(){if(this.div)return this.div;const t=super.render();g(this,Ku)&&(t.setAttribute("aria-label",g(this,Ku)),t.setAttribute("role","mark")),g(this,dr)?t.classList.add("free"):this.div.addEventListener("keydown",x(this,Ty,QN).bind(this),{signal:this._uiManager._signal});const r=E(this,v0,document.createElement("div"));t.append(r),r.setAttribute("aria-hidden","true"),r.className="internal",r.style.clipPath=g(this,w0);const[i,o]=this.parentDimensions;return this.setDims(this.width*i,this.height*o),am(this,g(this,v0),["pointerover","pointerleave"]),this.enableEditing(),t}pointerover(){this.parent.drawLayer.addClass(g(this,Nt),"hovered")}pointerleave(){this.parent.drawLayer.removeClass(g(this,Nt),"hovered")}_moveCaret(t){switch(this.parent.unselect(this),t){case 0:case 2:x(this,qu,g5).call(this,!0);break;case 1:case 3:x(this,qu,g5).call(this,!1)}}select(){var t,r;super.select(),g(this,Nt)&&((t=this.parent)==null||t.drawLayer.removeClass(g(this,Nt),"hovered"),(r=this.parent)==null||r.drawLayer.addClass(g(this,Nt),"selected"))}unselect(){var t;super.unselect(),g(this,Nt)&&((t=this.parent)==null||t.drawLayer.removeClass(g(this,Nt),"selected"),g(this,dr)||x(this,qu,g5).call(this,!1))}get _mustFixPosition(){return!g(this,dr)}show(t=this._isVisible){super.show(t),this.parent&&(this.parent.drawLayer.show(g(this,En),t),this.parent.drawLayer.show(g(this,Nt),t))}static startHighlighting(t,r,{target:i,x:o,y:s}){const{x:a,y:c,width:u,height:d}=i.getBoundingClientRect(),f=new AbortController,h=t.combinedSignal(f),p=m=>{f.abort(),x(this,Dy,tP).call(this,t,m)};window.addEventListener("blur",p,{signal:h}),window.addEventListener("pointerup",p,{signal:h}),window.addEventListener("pointerdown",m=>{m.preventDefault(),m.stopPropagation()},{capture:!0,passive:!1,signal:h}),window.addEventListener("contextmenu",br,{signal:h}),i.addEventListener("pointermove",x(this,Oy,eP).bind(this,t),{signal:h}),this._freeHighlight=new mm({x:o,y:s},[a,c,u,d],t.scale,this._defaultThickness/2,r,.001),{id:this._freeHighlightId,clipPathId:this._freeHighlightClipId}=t.drawLayer.highlight(this._freeHighlight,this._defaultColor,this._defaultOpacity,!0)}static deserialize(t,r,i){var y;const o=super.deserialize(t,r,i),{rect:[s,a,c,u],color:d,quadPoints:f}=t;o.color=se.makeHexColor(...d),E(o,C0,t.opacity);const[h,p]=o.pageDimensions;o.width=(c-s)/h,o.height=(u-a)/p;const m=E(o,ga,[]);for(let b=0;b<f.length;b+=8)m.push({x:(f[4]-c)/h,y:(u-(1-f[b+5]))/p,width:(f[b+2]-f[b])/h,height:(f[b+5]-f[b+1])/p});return x(y=o,A1,jv).call(y),o}serialize(t=!1){if(this.isEmpty()||t)return null;const r=this.getRect(0,0),i=je._colorManager.convert(this.color);return{annotationType:Te.HIGHLIGHT,color:i,opacity:g(this,C0),thickness:g(this,Wi),quadPoints:x(this,xy,XN).call(this),outlines:x(this,Iy,JN).call(this,r),pageIndex:this.pageIndex,rect:r,rotation:x(this,S0,rp).call(this),structTreeParentId:this._structTreeParentId}}static canCreateNewEmptyEditor(){return!1}};Uu=new WeakMap,k1=new WeakMap,ga=new WeakMap,w0=new WeakMap,Zu=new WeakMap,_r=new WeakMap,S1=new WeakMap,M1=new WeakMap,v0=new WeakMap,li=new WeakMap,En=new WeakMap,dr=new WeakMap,Wu=new WeakMap,C0=new WeakMap,Nt=new WeakMap,Ku=new WeakMap,Wi=new WeakMap,E1=new WeakMap,A1=new WeakSet,jv=function(){const t=new rE(g(this,ga),.001);E(this,li,t.getOutlines()),{x:this.x,y:this.y,width:this.width,height:this.height}=g(this,li).box;const r=new rE(g(this,ga),.0025,.001,this._uiManager.direction==="ltr");E(this,_r,r.getOutlines());const{lastPoint:i}=g(this,_r).box;E(this,Wu,[(i[0]-this.x)/this.width,(i[1]-this.y)/this.height])},T1=new WeakSet,zv=function({highlightOutlines:t,highlightId:r,clipPathId:i}){var d,f;if(E(this,li,t),E(this,_r,t.getNewOutline(g(this,Wi)/2+1.5,.0025)),r>=0)E(this,En,r),E(this,w0,i),this.parent.drawLayer.finalizeLine(r,t),E(this,Nt,this.parent.drawLayer.highlightOutline(g(this,_r)));else if(this.parent){const h=this.parent.viewport.rotation;this.parent.drawLayer.updateLine(g(this,En),t),this.parent.drawLayer.updateBox(g(this,En),x(d=_e,ya,md).call(d,g(this,li).box,(h-this.rotation+360)%360)),this.parent.drawLayer.updateLine(g(this,Nt),g(this,_r)),this.parent.drawLayer.updateBox(g(this,Nt),x(f=_e,ya,md).call(f,g(this,_r).box,h))}const{x:o,y:s,width:a,height:c}=t.box;switch(this.rotation){case 0:this.x=o,this.y=s,this.width=a,this.height=c;break;case 90:{const[h,p]=this.parentDimensions;this.x=s,this.y=1-o,this.width=a*p/h,this.height=c*h/p;break}case 180:this.x=1-o,this.y=1-s,this.width=a,this.height=c;break;case 270:{const[h,p]=this.parentDimensions;this.x=1-s,this.y=o,this.width=a*p/h,this.height=c*h/p;break}}const{lastPoint:u}=g(this,_r).box;E(this,Wu,[(u[0]-o)/a,(u[1]-s)/c])},My=new WeakSet,qN=function(t){const r=o=>{var s,a;this.color=o,(s=this.parent)==null||s.drawLayer.changeColor(g(this,En),o),(a=g(this,Zu))==null||a.updateColor(o)},i=this.color;this.addCommands({cmd:r.bind(this,t),undo:r.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:he.HIGHLIGHT_COLOR,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"color_changed",color:this._uiManager.highlightColorNames.get(t)},!0)},Ey=new WeakSet,GN=function(t){const r=g(this,Wi),i=o=>{E(this,Wi,o),x(this,Ay,YN).call(this,o)};this.addCommands({cmd:i.bind(this,t),undo:i.bind(this,r),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:he.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"thickness_changed",thickness:t},!0)},Ay=new WeakSet,YN=function(t){if(!g(this,dr))return;x(this,T1,zv).call(this,{highlightOutlines:g(this,li).getNewOutline(t/2)}),this.fixAndSetPosition();const[r,i]=this.parentDimensions;this.setDims(this.width*r,this.height*i)},x1=new WeakSet,Hv=function(){g(this,En)!==null&&this.parent&&(this.parent.drawLayer.remove(g(this,En)),E(this,En,null),this.parent.drawLayer.remove(g(this,Nt)),E(this,Nt,null))},k0=new WeakSet,np=function(t=this.parent){g(this,En)===null&&({id:qn(this,En)._,clipPathId:qn(this,w0)._}=t.drawLayer.highlight(g(this,li),this.color,g(this,C0)),E(this,Nt,t.drawLayer.highlightOutline(g(this,_r))),g(this,v0)&&(g(this,v0).style.clipPath=g(this,w0)))},ya=new WeakSet,md=function({x:t,y:r,width:i,height:o},s){switch(s){case 90:return{x:1-r-o,y:t,width:o,height:i};case 180:return{x:1-t-i,y:1-r-o,width:i,height:o};case 270:return{x:r,y:1-t-i,width:o,height:i}}return{x:t,y:r,width:i,height:o}},Ty=new WeakSet,QN=function(t){_e._keyboardManager.exec(this,t)},qu=new WeakSet,g5=function(t){if(!g(this,Uu))return;const r=window.getSelection();t?r.setPosition(g(this,Uu),g(this,k1)):r.setPosition(g(this,S1),g(this,M1))},S0=new WeakSet,rp=function(){return g(this,dr)?this.rotation:0},xy=new WeakSet,XN=function(){if(g(this,dr))return null;const[t,r]=this.pageDimensions,[i,o]=this.pageTranslation,s=g(this,ga),a=new Float32Array(8*s.length);let c=0;for(const{x:u,y:d,width:f,height:h}of s){const p=u*t+i,m=(1-d-h)*r+o;a[c]=a[c+4]=p,a[c+1]=a[c+3]=m,a[c+2]=a[c+6]=p+f*t,a[c+5]=a[c+7]=m+h*r,c+=8}return a},Iy=new WeakSet,JN=function(t){return g(this,li).serialize(t,x(this,S0,rp).call(this))},Oy=new WeakSet,eP=function(t,r){this._freeHighlight.add(r)&&t.drawLayer.updatePath(this._freeHighlightId,this._freeHighlight)},Dy=new WeakSet,tP=function(t,r){this._freeHighlight.isEmpty()?t.drawLayer.removeFreeHighlight(this._freeHighlightId):t.createAndAddNewEditor(r,!1,{highlightId:this._freeHighlightId,highlightOutlines:this._freeHighlight.getOutlines(),clipPathId:this._freeHighlightClipId,methodOfCreation:"main_toolbar"}),this._freeHighlightId=-1,this._freeHighlight=null,this._freeHighlightClipId=""},M(_e,ya),M(_e,Oy),M(_e,Dy),pe(_e,"_defaultColor",null),pe(_e,"_defaultOpacity",1),pe(_e,"_defaultThickness",12),pe(_e,"_l10nPromise"),pe(_e,"_type","highlight"),pe(_e,"_editorType",Te.HIGHLIGHT),pe(_e,"_freeHighlightId",-1),pe(_e,"_freeHighlight",null),pe(_e,"_freeHighlightClipId","");let ym=_e;const Je=class Je extends je{constructor(t){super({...t,name:"inkEditor"});M(this,Ny);M(this,Py);M(this,_y);M(this,Ly);M(this,I1);M(this,By);M(this,O1);M(this,Ry);M(this,$y);M(this,Fy);M(this,Vy);M(this,jy);M(this,Zo);M(this,D1);M(this,N1);M(this,P1);M(this,Yu);M(this,Qu);M(this,wa);M(this,_1);M(this,Xu);M(this,Uy);M(this,B1);M(this,Ju);M(this,D0);M(this,M0,0);M(this,E0,0);M(this,Ki,null);M(this,Ho,new Path2D);M(this,Lr,!1);M(this,A0,null);M(this,T0,!1);M(this,x0,!1);M(this,Uo,null);M(this,Gu,null);M(this,I0,0);M(this,O0,0);M(this,ba,null);this.color=t.color||null,this.thickness=t.thickness||null,this.opacity=t.opacity||null,this.paths=[],this.bezierPath2D=[],this.allRawPaths=[],this.currentPath=[],this.scaleFactor=1,this.translationX=this.translationY=0,this.x=0,this.y=0,this._willKeepAspectRatio=!0}static initialize(t,r){je.initialize(t,r)}static updateDefaultParams(t,r){switch(t){case he.INK_THICKNESS:Je._defaultThickness=r;break;case he.INK_COLOR:Je._defaultColor=r;break;case he.INK_OPACITY:Je._defaultOpacity=r/100}}updateParams(t,r){switch(t){case he.INK_THICKNESS:x(this,Ny,nP).call(this,r);break;case he.INK_COLOR:x(this,Py,rP).call(this,r);break;case he.INK_OPACITY:x(this,_y,iP).call(this,r)}}static get defaultPropertiesToUpdate(){return[[he.INK_THICKNESS,Je._defaultThickness],[he.INK_COLOR,Je._defaultColor||je._defaultLineColor],[he.INK_OPACITY,Math.round(100*Je._defaultOpacity)]]}get propertiesToUpdate(){return[[he.INK_THICKNESS,this.thickness||Je._defaultThickness],[he.INK_COLOR,this.color||Je._defaultColor||je._defaultLineColor],[he.INK_OPACITY,Math.round(100*(this.opacity??Je._defaultOpacity))]]}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(this.canvas||(x(this,Yu,y5).call(this),x(this,Qu,b5).call(this)),this.isAttachedToDOM||(this.parent.add(this),x(this,wa,gd).call(this)),x(this,D0,ip).call(this)))}remove(){var t;this.canvas!==null&&(this.isEmpty()||this.commit(),this.canvas.width=this.canvas.height=0,this.canvas.remove(),this.canvas=null,g(this,Ki)&&(clearTimeout(g(this,Ki)),E(this,Ki,null)),(t=g(this,Uo))==null||t.disconnect(),E(this,Uo,null),super.remove())}setParent(t){!this.parent&&t?this._uiManager.removeShouldRescale(this):this.parent&&t===null&&this._uiManager.addShouldRescale(this),super.setParent(t)}onScaleChanging(){const[t,r]=this.parentDimensions,i=this.width*t,o=this.height*r;this.setDimensions(i,o)}enableEditMode(){!g(this,Lr)&&this.canvas!==null&&(super.enableEditMode(),this._isDraggable=!1,x(this,D1,Wv).call(this))}disableEditMode(){this.isInEditMode()&&this.canvas!==null&&(super.disableEditMode(),this._isDraggable=!this.isEmpty(),this.div.classList.remove("editing"),x(this,N1,Kv).call(this))}onceAdded(){this._isDraggable=!this.isEmpty()}isEmpty(){return this.paths.length===0||this.paths.length===1&&this.paths[0].length===0}commit(){g(this,Lr)||(super.commit(),this.isEditing=!1,this.disableEditMode(),this.setInForeground(),E(this,Lr,!0),this.div.classList.add("disabled"),x(this,D0,ip).call(this,!0),this.select(),this.parent.addInkEditorIfNeeded(!0),this.moveInDOM(),this.div.focus({preventScroll:!0}))}focusin(t){this._focusEventsAllowed&&(super.focusin(t),this.enableEditMode())}canvasPointerdown(t){t.button===0&&this.isInEditMode()&&!g(this,Lr)&&(this.setInForeground(),t.preventDefault(),this.div.contains(document.activeElement)||this.div.focus({preventScroll:!0}),x(this,By,sP).call(this,t.offsetX,t.offsetY))}canvasPointermove(t){t.preventDefault(),x(this,O1,Zv).call(this,t.offsetX,t.offsetY)}canvasPointerup(t){t.preventDefault(),x(this,P1,qv).call(this,t)}canvasPointerleave(t){x(this,P1,qv).call(this,t)}get isResizable(){return!this.isEmpty()&&g(this,Lr)}render(){if(this.div)return this.div;let t,r;this.width&&(t=this.x,r=this.y),super.render(),this.div.setAttribute("data-l10n-id","pdfjs-ink");const[i,o,s,a]=x(this,Ly,oP).call(this);if(this.setAt(i,o,0,0),this.setDims(s,a),x(this,Yu,y5).call(this),this.width){const[c,u]=this.parentDimensions;this.setAspectRatio(this.width*c,this.height*u),this.setAt(t*c,r*u,this.width*c,this.height*u),E(this,x0,!0),x(this,wa,gd).call(this),this.setDims(this.width*c,this.height*u),x(this,Zo,$0).call(this),this.div.classList.add("disabled")}else this.div.classList.add("editing"),this.enableEditMode();return x(this,Qu,b5).call(this),this.div}setDimensions(t,r){const i=Math.round(t),o=Math.round(r);if(g(this,I0)===i&&g(this,O0)===o)return;E(this,I0,i),E(this,O0,o),this.canvas.style.visibility="hidden";const[s,a]=this.parentDimensions;this.width=t/s,this.height=r/a,this.fixAndSetPosition(),g(this,Lr)&&x(this,_1,Gv).call(this,t,r),x(this,wa,gd).call(this),x(this,Zo,$0).call(this),this.canvas.style.visibility="visible",this.fixDims()}static deserialize(t,r,i){var b,w,v;if(t instanceof tE)return null;const o=super.deserialize(t,r,i);o.thickness=t.thickness,o.color=se.makeHexColor(...t.color),o.opacity=t.opacity;const[s,a]=o.pageDimensions,c=o.width*s,u=o.height*a,d=o.parentScale,f=t.thickness/2;E(o,Lr,!0),E(o,I0,Math.round(c)),E(o,O0,Math.round(u));const{paths:h,rect:p,rotation:m}=t;for(let{bezier:k}of h){k=x(b=Je,Hy,hP).call(b,k,p,m);const C=[];o.paths.push(C);let T=d*(k[0]-f),S=d*(k[1]-f);for(let O=2,I=k.length;O<I;O+=6){const P=d*(k[O]-f),D=d*(k[O+1]-f),_=d*(k[O+2]-f),B=d*(k[O+3]-f),F=d*(k[O+4]-f),R=d*(k[O+5]-f);C.push([[T,S],[P,D],[_,B],[F,R]]),T=F,S=R}const A=x(this,zy,fP).call(this,C);o.bezierPath2D.push(A)}const y=x(w=o,B1,Qv).call(w);return E(o,E0,Math.max(je.MIN_SIZE,y[2]-y[0])),E(o,M0,Math.max(je.MIN_SIZE,y[3]-y[1])),x(v=o,_1,Gv).call(v,c,u),o}serialize(){if(this.isEmpty())return null;const t=this.getRect(0,0),r=je._colorManager.convert(this.ctx.strokeStyle);return{annotationType:Te.INK,color:r,thickness:this.thickness,opacity:this.opacity,paths:x(this,Uy,pP).call(this,this.scaleFactor/this.parentScale,this.translationX,this.translationY,t),pageIndex:this.pageIndex,rect:t,rotation:this.rotation,structTreeParentId:this._structTreeParentId}}};M0=new WeakMap,E0=new WeakMap,Ki=new WeakMap,Ho=new WeakMap,Lr=new WeakMap,A0=new WeakMap,T0=new WeakMap,x0=new WeakMap,Uo=new WeakMap,Gu=new WeakMap,I0=new WeakMap,O0=new WeakMap,ba=new WeakMap,Ny=new WeakSet,nP=function(t){const r=o=>{this.thickness=o,x(this,D0,ip).call(this)},i=this.thickness;this.addCommands({cmd:r.bind(this,t),undo:r.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:he.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0})},Py=new WeakSet,rP=function(t){const r=o=>{this.color=o,x(this,Zo,$0).call(this)},i=this.color;this.addCommands({cmd:r.bind(this,t),undo:r.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:he.INK_COLOR,overwriteIfSameType:!0,keepUndo:!0})},_y=new WeakSet,iP=function(t){const r=o=>{this.opacity=o,x(this,Zo,$0).call(this)};t/=100;const i=this.opacity;this.addCommands({cmd:r.bind(this,t),undo:r.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:he.INK_OPACITY,overwriteIfSameType:!0,keepUndo:!0})},Ly=new WeakSet,oP=function(){const{parentRotation:t,parentDimensions:[r,i]}=this;switch(t){case 90:return[0,i,i,r];case 180:return[r,i,r,i];case 270:return[r,0,i,r];default:return[0,0,r,i]}},I1=new WeakSet,Uv=function(){const{ctx:t,color:r,opacity:i,thickness:o,parentScale:s,scaleFactor:a}=this;t.lineWidth=o*s/a,t.lineCap="round",t.lineJoin="round",t.miterLimit=10,t.strokeStyle=`${r}${function(u){return Math.round(Math.min(255,Math.max(1,255*u))).toString(16).padStart(2,"0")}(i)}`},By=new WeakSet,sP=function(t,r){this.canvas.addEventListener("contextmenu",br,{signal:this._uiManager._signal}),x(this,N1,Kv).call(this),E(this,A0,new AbortController);const i=this._uiManager.combinedSignal(g(this,A0));this.canvas.addEventListener("pointerleave",this.canvasPointerleave.bind(this),{signal:i}),this.canvas.addEventListener("pointermove",this.canvasPointermove.bind(this),{signal:i}),this.canvas.addEventListener("pointerup",this.canvasPointerup.bind(this),{signal:i}),this.isEditing=!0,g(this,x0)||(E(this,x0,!0),x(this,wa,gd).call(this),this.thickness||(this.thickness=Je._defaultThickness),this.color||(this.color=Je._defaultColor||je._defaultLineColor),this.opacity??(this.opacity=Je._defaultOpacity)),this.currentPath.push([t,r]),E(this,T0,!1),x(this,I1,Uv).call(this),E(this,ba,()=>{x(this,Fy,cP).call(this),g(this,ba)&&window.requestAnimationFrame(g(this,ba))}),window.requestAnimationFrame(g(this,ba))},O1=new WeakSet,Zv=function(t,r){const[i,o]=this.currentPath.at(-1);if(this.currentPath.length>1&&t===i&&r===o)return;const s=this.currentPath;let a=g(this,Ho);s.push([t,r]),E(this,T0,!0),s.length<=2?(a.moveTo(...s[0]),a.lineTo(t,r)):(s.length===3&&(E(this,Ho,a=new Path2D),a.moveTo(...s[0])),x(this,Vy,uP).call(this,a,...s.at(-3),...s.at(-2),t,r))},Ry=new WeakSet,aP=function(){if(this.currentPath.length===0)return;const t=this.currentPath.at(-1);g(this,Ho).lineTo(...t)},$y=new WeakSet,lP=function(t,r){E(this,ba,null),t=Math.min(Math.max(t,0),this.canvas.width),r=Math.min(Math.max(r,0),this.canvas.height),x(this,O1,Zv).call(this,t,r),x(this,Ry,aP).call(this);let i;if(this.currentPath.length!==1)i=x(this,jy,dP).call(this);else{const a=[t,r];i=[[a,a.slice(),a.slice(),a]]}const o=g(this,Ho),s=this.currentPath;this.currentPath=[],E(this,Ho,new Path2D),this.addCommands({cmd:()=>{this.allRawPaths.push(s),this.paths.push(i),this.bezierPath2D.push(o),this._uiManager.rebuild(this)},undo:()=>{this.allRawPaths.pop(),this.paths.pop(),this.bezierPath2D.pop(),this.paths.length===0?this.remove():(this.canvas||(x(this,Yu,y5).call(this),x(this,Qu,b5).call(this)),x(this,D0,ip).call(this))},mustExec:!0})},Fy=new WeakSet,cP=function(){if(!g(this,T0))return;E(this,T0,!1),Math.ceil(this.thickness*this.parentScale);const t=this.currentPath.slice(-3),r=t.map(s=>s[0]),i=t.map(s=>s[1]),{ctx:o}=(Math.min(...r),Math.max(...r),Math.min(...i),Math.max(...i),this);o.save(),o.clearRect(0,0,this.canvas.width,this.canvas.height);for(const s of this.bezierPath2D)o.stroke(s);o.stroke(g(this,Ho)),o.restore()},Vy=new WeakSet,uP=function(t,r,i,o,s,a,c){const u=(r+o)/2,d=(i+s)/2,f=(o+a)/2,h=(s+c)/2;t.bezierCurveTo(u+2*(o-u)/3,d+2*(s-d)/3,f+2*(o-f)/3,h+2*(s-h)/3,f,h)},jy=new WeakSet,dP=function(){const t=this.currentPath;if(t.length<=2)return[[t[0],t[0],t.at(-1),t.at(-1)]];const r=[];let i,[o,s]=t[0];for(i=1;i<t.length-2;i++){const[p,m]=t[i],[y,b]=t[i+1],w=(p+y)/2,v=(m+b)/2,k=[o+2*(p-o)/3,s+2*(m-s)/3],C=[w+2*(p-w)/3,v+2*(m-v)/3];r.push([[o,s],k,C,[w,v]]),[o,s]=[w,v]}const[a,c]=t[i],[u,d]=t[i+1],f=[o+2*(a-o)/3,s+2*(c-s)/3],h=[u+2*(a-u)/3,d+2*(c-d)/3];return r.push([[o,s],f,h,[u,d]]),r},Zo=new WeakSet,$0=function(){if(this.isEmpty()){x(this,Xu,w5).call(this);return}x(this,I1,Uv).call(this);const{canvas:t,ctx:r}=this;r.setTransform(1,0,0,1,0,0),r.clearRect(0,0,t.width,t.height),x(this,Xu,w5).call(this);for(const i of this.bezierPath2D)r.stroke(i)},D1=new WeakSet,Wv=function(){if(g(this,Gu))return;E(this,Gu,new AbortController);const t=this._uiManager.combinedSignal(g(this,Gu));this.canvas.addEventListener("pointerdown",this.canvasPointerdown.bind(this),{signal:t})},N1=new WeakSet,Kv=function(){var t;(t=this.pointerdownAC)==null||t.abort(),this.pointerdownAC=null},P1=new WeakSet,qv=function(t){var r;(r=g(this,A0))==null||r.abort(),E(this,A0,null),x(this,D1,Wv).call(this),g(this,Ki)&&clearTimeout(g(this,Ki)),E(this,Ki,setTimeout(()=>{E(this,Ki,null),this.canvas.removeEventListener("contextmenu",br)},10)),x(this,$y,lP).call(this,t.offsetX,t.offsetY),this.addToAnnotationStorage(),this.setInBackground()},Yu=new WeakSet,y5=function(){this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=0,this.canvas.className="inkEditorCanvas",this.canvas.setAttribute("data-l10n-id","pdfjs-ink-canvas"),this.div.append(this.canvas),this.ctx=this.canvas.getContext("2d")},Qu=new WeakSet,b5=function(){E(this,Uo,new ResizeObserver(t=>{const r=t[0].contentRect;r.width&&r.height&&this.setDimensions(r.width,r.height)})),g(this,Uo).observe(this.div),this._uiManager._signal.addEventListener("abort",()=>{var t;(t=g(this,Uo))==null||t.disconnect(),E(this,Uo,null)},{once:!0})},wa=new WeakSet,gd=function(){if(!g(this,x0))return;const[t,r]=this.parentDimensions;this.canvas.width=Math.ceil(this.width*t),this.canvas.height=Math.ceil(this.height*r),x(this,Xu,w5).call(this)},_1=new WeakSet,Gv=function(t,r){const i=x(this,Ju,v5).call(this),o=(t-i)/g(this,E0),s=(r-i)/g(this,M0);this.scaleFactor=Math.min(o,s)},Xu=new WeakSet,w5=function(){const t=x(this,Ju,v5).call(this)/2;this.ctx.setTransform(this.scaleFactor,0,0,this.scaleFactor,this.translationX*this.scaleFactor+t,this.translationY*this.scaleFactor+t)},zy=new WeakSet,fP=function(t){const r=new Path2D;for(let i=0,o=t.length;i<o;i++){const[s,a,c,u]=t[i];i===0&&r.moveTo(...s),r.bezierCurveTo(a[0],a[1],c[0],c[1],u[0],u[1])}return r},L1=new WeakSet,Yv=function(t,r,i){const[o,s,a,c]=r;switch(i){case 0:for(let u=0,d=t.length;u<d;u+=2)t[u]+=o,t[u+1]=c-t[u+1];break;case 90:for(let u=0,d=t.length;u<d;u+=2){const f=t[u];t[u]=t[u+1]+o,t[u+1]=f+s}break;case 180:for(let u=0,d=t.length;u<d;u+=2)t[u]=a-t[u],t[u+1]+=s;break;case 270:for(let u=0,d=t.length;u<d;u+=2){const f=t[u];t[u]=a-t[u+1],t[u+1]=c-f}break;default:throw new Error("Invalid rotation")}return t},Hy=new WeakSet,hP=function(t,r,i){const[o,s,a,c]=r;switch(i){case 0:for(let u=0,d=t.length;u<d;u+=2)t[u]-=o,t[u+1]=c-t[u+1];break;case 90:for(let u=0,d=t.length;u<d;u+=2){const f=t[u];t[u]=t[u+1]-s,t[u+1]=f-o}break;case 180:for(let u=0,d=t.length;u<d;u+=2)t[u]=a-t[u],t[u+1]-=s;break;case 270:for(let u=0,d=t.length;u<d;u+=2){const f=t[u];t[u]=c-t[u+1],t[u+1]=a-f}break;default:throw new Error("Invalid rotation")}return t},Uy=new WeakSet,pP=function(t,r,i,o){var d,f;const s=[],a=this.thickness/2,c=t*r+a,u=t*i+a;for(const h of this.paths){const p=[],m=[];for(let y=0,b=h.length;y<b;y++){const[w,v,k,C]=h[y];if(w[0]===C[0]&&w[1]===C[1]&&b===1){const B=t*w[0]+c,F=t*w[1]+u;p.push(B,F),m.push(B,F);break}const T=t*w[0]+c,S=t*w[1]+u,A=t*v[0]+c,O=t*v[1]+u,I=t*k[0]+c,P=t*k[1]+u,D=t*C[0]+c,_=t*C[1]+u;y===0&&(p.push(T,S),m.push(T,S)),p.push(A,O,I,P,D,_),m.push(A,O),y===b-1&&m.push(D,_)}s.push({bezier:x(d=Je,L1,Yv).call(d,p,o,this.rotation),points:x(f=Je,L1,Yv).call(f,m,o,this.rotation)})}return s},B1=new WeakSet,Qv=function(){let t=1/0,r=-1/0,i=1/0,o=-1/0;for(const s of this.paths)for(const[a,c,u,d]of s){const f=se.bezierBoundingBox(...a,...c,...u,...d);t=Math.min(t,f[0]),i=Math.min(i,f[1]),r=Math.max(r,f[2]),o=Math.max(o,f[3])}return[t,i,r,o]},Ju=new WeakSet,v5=function(){return g(this,Lr)?Math.ceil(this.thickness*this.parentScale):0},D0=new WeakSet,ip=function(t=!1){if(this.isEmpty())return;if(!g(this,Lr)){x(this,Zo,$0).call(this);return}const r=x(this,B1,Qv).call(this),i=x(this,Ju,v5).call(this);E(this,E0,Math.max(je.MIN_SIZE,r[2]-r[0])),E(this,M0,Math.max(je.MIN_SIZE,r[3]-r[1]));const o=Math.ceil(i+g(this,E0)*this.scaleFactor),s=Math.ceil(i+g(this,M0)*this.scaleFactor),[a,c]=this.parentDimensions;this.width=o/a,this.height=s/c,this.setAspectRatio(o,s);const u=this.translationX,d=this.translationY;this.translationX=-r[0],this.translationY=-r[1],x(this,wa,gd).call(this),x(this,Zo,$0).call(this),E(this,I0,o),E(this,O0,s),this.setDims(o,s);const f=t?i/this.scaleFactor/2:0;this.translate(u-this.translationX-f,d-this.translationY-f)},M(Je,zy),M(Je,L1),M(Je,Hy),pe(Je,"_defaultColor",null),pe(Je,"_defaultOpacity",1),pe(Je,"_defaultThickness",1),pe(Je,"_type","ink"),pe(Je,"_editorType",Te.INK);let Y4=Je;const j1=class j1 extends je{constructor(t){super({...t,name:"stampEditor"});M(this,N0);M(this,P0);M(this,td);M(this,$1);M(this,Zy);M(this,F1);M(this,V1);M(this,nd);M(this,Wy);M(this,wt,null);M(this,rn,null);M(this,va,null);M(this,Wo,null);M(this,Ca,null);M(this,ed,"");M(this,qi,null);M(this,Ko,null);M(this,Gi,null);M(this,Br,!1);M(this,R1,!1);E(this,Wo,t.bitmapUrl),E(this,Ca,t.bitmapFile)}static initialize(t,r){je.initialize(t,r)}static get supportedTypes(){return Ie(this,"supportedTypes",["apng","avif","bmp","gif","jpeg","png","svg+xml","webp","x-icon"].map(t=>`image/${t}`))}static get supportedTypesStr(){return Ie(this,"supportedTypesStr",this.supportedTypes.join(","))}static isHandlingMimeForPasting(t){return this.supportedTypes.includes(t)}static paste(t,r){r.pasteEditor(Te.STAMP,{bitmapFile:t.getAsFile()})}altTextFinish(){this._uiManager.useNewAltTextFlow&&(this.div.hidden=!1),super.altTextFinish()}get telemetryFinalData(){var t;return{type:"stamp",hasAltText:!!((t=this.altTextData)!=null&&t.altText)}}static computeTelemetryFinalData(t){const r=t.get("hasAltText");return{hasAltText:r.get(!0)??0,hasNoAltText:r.get(!1)??0}}async mlGuessAltText(t=null,r=!0){if(this.hasAltTextData())return null;const{mlManager:i}=this._uiManager;if(!i)throw new Error("No ML.");if(!await i.isEnabledFor("altText"))throw new Error("ML isn't enabled for alt text.");const{data:o,width:s,height:a}=t||this.copyCanvas(null,!0).imageData,c=await i.guess({name:"altText",request:{data:o,width:s,height:a,channels:o.length/(s*a)}});if(!c)throw new Error("No response from the AI service.");if(c.error)throw new Error("Error from the AI service.");if(c.cancel)return null;if(!c.output)throw new Error("No valid response from the AI service.");const u=c.output;return await this.setGuessedAltText(u),r&&!this.hasAltTextData()&&(this.altTextData={alt:u,decorative:!1}),u}remove(){var t,r;g(this,rn)&&(E(this,wt,null),this._uiManager.imageManager.deleteId(g(this,rn)),(t=g(this,qi))==null||t.remove(),E(this,qi,null),(r=g(this,Ko))==null||r.disconnect(),E(this,Ko,null),g(this,Gi)&&(clearTimeout(g(this,Gi)),E(this,Gi,null))),super.remove()}rebuild(){this.parent?(super.rebuild(),this.div!==null&&(g(this,rn)&&g(this,qi)===null&&x(this,td,C5).call(this),this.isAttachedToDOM||this.parent.add(this))):g(this,rn)&&x(this,td,C5).call(this)}onceAdded(){this._isDraggable=!0,this.div.focus()}isEmpty(){return!(g(this,va)||g(this,wt)||g(this,Wo)||g(this,Ca)||g(this,rn))}get isResizable(){return!0}render(){if(this.div)return this.div;let t,r;if(this.width&&(t=this.x,r=this.y),super.render(),this.div.hidden=!0,this.addAltTextButton(),g(this,wt)?x(this,$1,Xv).call(this):x(this,td,C5).call(this),this.width){const[i,o]=this.parentDimensions;this.setAt(t*i,r*o,this.width*i,this.height*o)}return this.div}copyCanvas(t,r=!1){var b;t||(t=224);const{width:i,height:o}=g(this,wt),s=document.createElement("canvas");let a=g(this,wt),c=i,u=o;if(i>t||o>t){const w=Math.min(t/i,t/o);c=Math.floor(i*w),u=Math.floor(o*w),g(this,Br)||(a=x(this,F1,Jv).call(this,c,u))}s.width=c,s.height=u;const d=s.getContext("2d");d.filter=this._uiManager.hcmFilter;let f="white",h="#cfcfd8";this._uiManager.hcmFilter!=="none"?h="black":(b=window.matchMedia)!=null&&b.call(window,"(prefers-color-scheme: dark)").matches&&(f="#8f8f9d",h="#42414d");const p=15,m=new OffscreenCanvas(30,30),y=m.getContext("2d");if(y.fillStyle=f,y.fillRect(0,0,30,30),y.fillStyle=h,y.fillRect(0,0,p,p),y.fillRect(p,p,p,p),d.fillStyle=d.createPattern(m,"repeat"),d.fillRect(0,0,c,u),r){const w=new OffscreenCanvas(c,u),v=w.getContext("2d",{willReadFrequently:!0});v.drawImage(a,0,0,a.width,a.height,0,0,c,u);const k=v.getImageData(0,0,c,u).data;return d.drawImage(w,0,0),{canvas:s,imageData:{width:c,height:u,data:k}}}return d.drawImage(a,0,0,a.width,a.height,0,0,c,u),{canvas:s,imageData:null}}getImageForAltText(){return g(this,qi)}static deserialize(t,r,i){if(t instanceof nE)return null;const o=super.deserialize(t,r,i),{rect:s,bitmapUrl:a,bitmapId:c,isSvg:u,accessibilityData:d}=t;c&&i.imageManager.isValidId(c)?E(o,rn,c):E(o,Wo,a),E(o,Br,u);const[f,h]=o.pageDimensions;return o.width=(s[2]-s[0])/f,o.height=(s[3]-s[1])/h,d&&(o.altTextData=d),o}serialize(t=!1,r=null){if(this.isEmpty())return null;const i={annotationType:Te.STAMP,bitmapId:g(this,rn),pageIndex:this.pageIndex,rect:this.getRect(0,0),rotation:this.rotation,isSvg:g(this,Br),structTreeParentId:this._structTreeParentId};if(t)return i.bitmapUrl=x(this,nd,k5).call(this,!0),i.accessibilityData=this.serializeAltText(!0),i;const{decorative:o,altText:s}=this.serializeAltText(!1);if(!o&&s&&(i.accessibilityData={type:"Figure",alt:s}),r===null)return i;r.stamps||(r.stamps=new Map);const a=g(this,Br)?(i.rect[2]-i.rect[0])*(i.rect[3]-i.rect[1]):null;if(r.stamps.has(g(this,rn))){if(g(this,Br)){const c=r.stamps.get(g(this,rn));a>c.area&&(c.area=a,c.serialized.bitmap.close(),c.serialized.bitmap=x(this,nd,k5).call(this,!1))}}else r.stamps.set(g(this,rn),{area:a,serialized:i}),i.bitmap=x(this,nd,k5).call(this,!1);return i}};wt=new WeakMap,rn=new WeakMap,va=new WeakMap,Wo=new WeakMap,Ca=new WeakMap,ed=new WeakMap,qi=new WeakMap,Ko=new WeakMap,Gi=new WeakMap,Br=new WeakMap,R1=new WeakMap,N0=new WeakSet,op=function(t,r=!1){t?(E(this,wt,t.bitmap),r||(E(this,rn,t.id),E(this,Br,t.isSvg)),t.file&&E(this,ed,t.file.name),x(this,$1,Xv).call(this)):this.remove()},P0=new WeakSet,sp=function(){if(E(this,va,null),this._uiManager.enableWaiting(!1),g(this,qi))if(this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&g(this,wt))this._editToolbar.hide(),this._uiManager.editAltText(this,!0);else{if(!this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&g(this,wt)){this._reportTelemetry({action:"pdfjs.image.image_added",data:{alt_text_modal:!1,alt_text_type:"empty"}});try{this.mlGuessAltText()}catch{}}this.div.focus()}},td=new WeakSet,C5=function(){if(g(this,rn)){this._uiManager.enableWaiting(!0),this._uiManager.imageManager.getFromId(g(this,rn)).then(i=>x(this,N0,op).call(this,i,!0)).finally(()=>x(this,P0,sp).call(this));return}if(g(this,Wo)){const i=g(this,Wo);E(this,Wo,null),this._uiManager.enableWaiting(!0),E(this,va,this._uiManager.imageManager.getFromUrl(i).then(o=>x(this,N0,op).call(this,o)).finally(()=>x(this,P0,sp).call(this)));return}if(g(this,Ca)){const i=g(this,Ca);E(this,Ca,null),this._uiManager.enableWaiting(!0),E(this,va,this._uiManager.imageManager.getFromFile(i).then(o=>x(this,N0,op).call(this,o)).finally(()=>x(this,P0,sp).call(this)));return}const t=document.createElement("input");t.type="file",t.accept=j1.supportedTypesStr;const r=this._uiManager._signal;E(this,va,new Promise(i=>{t.addEventListener("change",async()=>{if(t.files&&t.files.length!==0){this._uiManager.enableWaiting(!0);const o=await this._uiManager.imageManager.getFromFile(t.files[0]);this._reportTelemetry({action:"pdfjs.image.image_selected",data:{alt_text_modal:this._uiManager.useNewAltTextFlow}}),x(this,N0,op).call(this,o)}else this.remove();i()},{signal:r}),t.addEventListener("cancel",()=>{this.remove(),i()},{signal:r})}).finally(()=>x(this,P0,sp).call(this))),t.click()},$1=new WeakSet,Xv=function(){const{div:t}=this;let{width:r,height:i}=g(this,wt);const[o,s]=this.pageDimensions,a=.75;if(this.width)r=this.width*o,i=this.height*s;else if(r>a*o||i>a*s){const f=Math.min(a*o/r,a*s/i);r*=f,i*=f}const[c,u]=this.parentDimensions;this.setDims(r*c/o,i*u/s),this._uiManager.enableWaiting(!1);const d=E(this,qi,document.createElement("canvas"));t.append(d),this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow||(t.hidden=!1),x(this,V1,e8).call(this,r,i),x(this,Wy,gP).call(this),g(this,R1)||(this.parent.addUndoableEditor(this),E(this,R1,!0)),this._reportTelemetry({action:"inserted_image"}),g(this,ed)&&d.setAttribute("aria-label",g(this,ed))},Zy=new WeakSet,mP=function(t,r){var s;const[i,o]=this.parentDimensions;this.width=t/i,this.height=r/o,this.setDims(t,r),(s=this._initialOptions)!=null&&s.isCentered?this.center():this.fixAndSetPosition(),this._initialOptions=null,g(this,Gi)!==null&&clearTimeout(g(this,Gi)),E(this,Gi,setTimeout(()=>{E(this,Gi,null),x(this,V1,e8).call(this,t,r)},200))},F1=new WeakSet,Jv=function(t,r){const{width:i,height:o}=g(this,wt);let s=i,a=o,c=g(this,wt);for(;s>2*t||a>2*r;){const u=s,d=a;s>2*t&&(s=s>=16384?Math.floor(s/2)-1:Math.ceil(s/2)),a>2*r&&(a=a>=16384?Math.floor(a/2)-1:Math.ceil(a/2));const f=new OffscreenCanvas(s,a);f.getContext("2d").drawImage(c,0,0,u,d,0,0,s,a),c=f.transferToImageBitmap()}return c},V1=new WeakSet,e8=function(t,r){t=Math.ceil(t),r=Math.ceil(r);const i=g(this,qi);if(!i||i.width===t&&i.height===r)return;i.width=t,i.height=r;const o=g(this,Br)?g(this,wt):x(this,F1,Jv).call(this,t,r),s=i.getContext("2d");s.filter=this._uiManager.hcmFilter,s.drawImage(o,0,0,o.width,o.height,0,0,t,r)},nd=new WeakSet,k5=function(t){if(t){if(g(this,Br)){const i=this._uiManager.imageManager.getSvgUrl(g(this,rn));if(i)return i}const r=document.createElement("canvas");return{width:r.width,height:r.height}=g(this,wt),r.getContext("2d").drawImage(g(this,wt),0,0),r.toDataURL()}if(g(this,Br)){const[r,i]=this.pageDimensions,o=Math.round(this.width*r*hs.PDF_TO_CSS_UNITS),s=Math.round(this.height*i*hs.PDF_TO_CSS_UNITS),a=new OffscreenCanvas(o,s);return a.getContext("2d").drawImage(g(this,wt),0,0,g(this,wt).width,g(this,wt).height,0,0,o,s),a.transferToImageBitmap()}return structuredClone(g(this,wt))},Wy=new WeakSet,gP=function(){this._uiManager._signal&&(E(this,Ko,new ResizeObserver(t=>{const r=t[0].contentRect;r.width&&r.height&&x(this,Zy,mP).call(this,r.width,r.height)})),g(this,Ko).observe(this.div),this._uiManager._signal.addEventListener("abort",()=>{var t;(t=g(this,Ko))==null||t.disconnect(),E(this,Ko,null)},{once:!0}))},pe(j1,"_type","stamp"),pe(j1,"_editorType",Te.STAMP);let Q4=j1;const ci=class ci{constructor({uiManager:e,pageIndex:t,div:r,accessibilityManager:i,annotationLayer:o,drawLayer:s,textLayer:a,viewport:c,l10n:u}){M(this,Ky);M(this,z1);M(this,H1);M(this,U1);M(this,sd);M(this,_0,void 0);M(this,rd,!1);M(this,Yi,null);M(this,ka,null);M(this,qo,null);M(this,fr,new Map);M(this,Sa,!1);M(this,id,!1);M(this,od,!1);M(this,An,null);M(this,Go,null);M(this,le,void 0);const d=[...g(ci,Ma).values()];if(!ci._initialized){ci._initialized=!0;for(const f of d)f.initialize(u,e)}e.registerEditorTypes(d),E(this,le,e),this.pageIndex=t,this.div=r,E(this,_0,i),E(this,Yi,o),this.viewport=c,E(this,An,a),this.drawLayer=s,g(this,le).addLayer(this)}get isEmpty(){return g(this,fr).size===0}get isInvisible(){return this.isEmpty&&g(this,le).getMode()===Te.NONE}updateToolbar(e){g(this,le).updateToolbar(e)}updateMode(e=g(this,le).getMode()){switch(x(this,sd,S5).call(this),e){case Te.NONE:this.disableTextSelection(),this.togglePointerEvents(!1),this.toggleAnnotationLayerPointerEvents(!0),this.disableClick();return;case Te.INK:this.addInkEditorIfNeeded(!1),this.disableTextSelection(),this.togglePointerEvents(!0),this.disableClick();break;case Te.HIGHLIGHT:this.enableTextSelection(),this.togglePointerEvents(!1),this.disableClick();break;default:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick()}this.toggleAnnotationLayerPointerEvents(!1);const{classList:t}=this.div;for(const r of g(ci,Ma).values())t.toggle(`${r._type}Editing`,e===r._editorType);this.div.hidden=!1}hasTextLayer(e){var t;return e===((t=g(this,An))==null?void 0:t.div)}addInkEditorIfNeeded(e){if(g(this,le).getMode()===Te.INK){if(!e){for(const t of g(this,fr).values())if(t.isEmpty()){t.setInBackground();return}}this.createAndAddNewEditor({offsetX:0,offsetY:0},!1).setInBackground()}}setEditingState(e){g(this,le).setEditingState(e)}addCommands(e){g(this,le).addCommands(e)}toggleDrawing(e=!1){this.div.classList.toggle("drawing",!e)}togglePointerEvents(e=!1){this.div.classList.toggle("disabled",!e)}toggleAnnotationLayerPointerEvents(e=!1){var t;(t=g(this,Yi))==null||t.div.classList.toggle("disabled",!e)}enable(){this.div.tabIndex=0,this.togglePointerEvents(!0);const e=new Set;for(const r of g(this,fr).values())r.enableEditing(),r.show(!0),r.annotationElementId&&(g(this,le).removeChangedExistingAnnotation(r),e.add(r.annotationElementId));if(!g(this,Yi))return;const t=g(this,Yi).getEditableAnnotations();for(const r of t){if(r.hide(),g(this,le).isDeletedAnnotationElement(r.data.id)||e.has(r.data.id))continue;const i=this.deserialize(r);i&&(this.addOrRebuild(i),i.enableEditing())}}disable(){var i;E(this,od,!0),this.div.tabIndex=-1,this.togglePointerEvents(!1);const e=new Map,t=new Map;for(const o of g(this,fr).values())o.disableEditing(),o.annotationElementId&&(o.serialize()===null?(t.set(o.annotationElementId,o),(i=this.getEditableAnnotation(o.annotationElementId))==null||i.show(),o.remove()):e.set(o.annotationElementId,o));if(g(this,Yi)){const o=g(this,Yi).getEditableAnnotations();for(const s of o){const{id:a}=s.data;if(g(this,le).isDeletedAnnotationElement(a))continue;let c=t.get(a);c?(c.resetAnnotationElement(s),c.show(!1),s.show()):(c=e.get(a),c&&(g(this,le).addChangedExistingAnnotation(c),c.renderAnnotationElement(s),c.show(!1)),s.show())}}x(this,sd,S5).call(this),this.isEmpty&&(this.div.hidden=!0);const{classList:r}=this.div;for(const o of g(ci,Ma).values())r.remove(`${o._type}Editing`);this.disableTextSelection(),this.toggleAnnotationLayerPointerEvents(!0),E(this,od,!1)}getEditableAnnotation(e){var t;return((t=g(this,Yi))==null?void 0:t.getEditableAnnotation(e))||null}setActiveEditor(e){g(this,le).getActive()!==e&&g(this,le).setActiveEditor(e)}enableTextSelection(){var e;if(this.div.tabIndex=-1,(e=g(this,An))!=null&&e.div&&!g(this,Go)){E(this,Go,new AbortController);const t=g(this,le).combinedSignal(g(this,Go));g(this,An).div.addEventListener("pointerdown",x(this,Ky,yP).bind(this),{signal:t}),g(this,An).div.classList.add("highlighting")}}disableTextSelection(){var e;this.div.tabIndex=0,(e=g(this,An))!=null&&e.div&&g(this,Go)&&(g(this,Go).abort(),E(this,Go,null),g(this,An).div.classList.remove("highlighting"))}enableClick(){if(g(this,ka))return;E(this,ka,new AbortController);const e=g(this,le).combinedSignal(g(this,ka));this.div.addEventListener("pointerdown",this.pointerdown.bind(this),{signal:e}),this.div.addEventListener("pointerup",this.pointerup.bind(this),{signal:e})}disableClick(){var e;(e=g(this,ka))==null||e.abort(),E(this,ka,null)}attach(e){g(this,fr).set(e.id,e);const{annotationElementId:t}=e;t&&g(this,le).isDeletedAnnotationElement(t)&&g(this,le).removeDeletedAnnotationElement(e)}detach(e){var t;g(this,fr).delete(e.id),(t=g(this,_0))==null||t.removePointerInTextLayer(e.contentDiv),!g(this,od)&&e.annotationElementId&&g(this,le).addDeletedAnnotationElement(e)}remove(e){this.detach(e),g(this,le).removeEditor(e),e.div.remove(),e.isAttachedToDOM=!1,g(this,id)||this.addInkEditorIfNeeded(!1)}changeParent(e){var t;e.parent!==this&&(e.parent&&e.annotationElementId&&(g(this,le).addDeletedAnnotationElement(e.annotationElementId),je.deleteAnnotationElement(e),e.annotationElementId=null),this.attach(e),(t=e.parent)==null||t.detach(e),e.setParent(this),e.div&&e.isAttachedToDOM&&(e.div.remove(),this.div.append(e.div)))}add(e){if(e.parent!==this||!e.isAttachedToDOM){if(this.changeParent(e),g(this,le).addEditor(e),this.attach(e),!e.isAttachedToDOM){const t=e.render();this.div.append(t),e.isAttachedToDOM=!0}e.fixAndSetPosition(),e.onceAdded(),g(this,le).addToAnnotationStorage(e),e._reportTelemetry(e.telemetryInitialData)}}moveEditorInDOM(e){var r;if(!e.isAttachedToDOM)return;const{activeElement:t}=document;e.div.contains(t)&&!g(this,qo)&&(e._focusEventsAllowed=!1,E(this,qo,setTimeout(()=>{E(this,qo,null),e.div.contains(document.activeElement)?e._focusEventsAllowed=!0:(e.div.addEventListener("focusin",()=>{e._focusEventsAllowed=!0},{once:!0,signal:g(this,le)._signal}),t.focus())},0))),e._structTreeParentId=(r=g(this,_0))==null?void 0:r.moveElementInDOM(this.div,e.div,e.contentDiv,!0)}addOrRebuild(e){e.needsToBeRebuilt()?(e.parent||(e.parent=this),e.rebuild(),e.show()):this.add(e)}addUndoableEditor(e){this.addCommands({cmd:()=>e._uiManager.rebuild(e),undo:()=>{e.remove()},mustExec:!1})}getNextId(){return g(this,le).getId()}combinedSignal(e){return g(this,le).combinedSignal(e)}canCreateNewEmptyEditor(){var e;return(e=g(this,z1,t8))==null?void 0:e.canCreateNewEmptyEditor()}pasteEditor(e,t){g(this,le).updateToolbar(e),g(this,le).updateMode(e);const{offsetX:r,offsetY:i}=x(this,U1,r8).call(this),o=this.getNextId(),s=x(this,H1,n8).call(this,{parent:this,id:o,x:r,y:i,uiManager:g(this,le),isCentered:!0,...t});s&&this.add(s)}deserialize(e){var t;return((t=g(ci,Ma).get(e.annotationType??e.annotationEditorType))==null?void 0:t.deserialize(e,this,g(this,le)))||null}createAndAddNewEditor(e,t,r={}){const i=this.getNextId(),o=x(this,H1,n8).call(this,{parent:this,id:i,x:e.offsetX,y:e.offsetY,uiManager:g(this,le),isCentered:t,...r});return o&&this.add(o),o}addNewEditor(){this.createAndAddNewEditor(x(this,U1,r8).call(this),!0)}setSelected(e){g(this,le).setSelected(e)}toggleSelected(e){g(this,le).toggleSelected(e)}isSelected(e){return g(this,le).isSelected(e)}unselect(e){g(this,le).unselect(e)}pointerup(e){const{isMac:t}=Bn.platform;!(e.button!==0||e.ctrlKey&&t)&&e.target===this.div&&g(this,Sa)&&(E(this,Sa,!1),g(this,rd)?g(this,le).getMode()!==Te.STAMP?this.createAndAddNewEditor(e,!1):g(this,le).unselectAll():E(this,rd,!0))}pointerdown(e){if(g(this,le).getMode()===Te.HIGHLIGHT&&this.enableTextSelection(),g(this,Sa)){E(this,Sa,!1);return}const{isMac:t}=Bn.platform;if(e.button!==0||e.ctrlKey&&t||e.target!==this.div)return;E(this,Sa,!0);const r=g(this,le).getActive();E(this,rd,!r||r.isEmpty())}findNewParent(e,t,r){const i=g(this,le).findParent(t,r);return i===null||i===this?!1:(i.changeParent(e),!0)}destroy(){var e,t;((e=g(this,le).getActive())==null?void 0:e.parent)===this&&(g(this,le).commitOrRemove(),g(this,le).setActiveEditor(null)),g(this,qo)&&(clearTimeout(g(this,qo)),E(this,qo,null));for(const r of g(this,fr).values())(t=g(this,_0))==null||t.removePointerInTextLayer(r.contentDiv),r.setParent(null),r.isAttachedToDOM=!1,r.div.remove();this.div=null,g(this,fr).clear(),g(this,le).removeLayer(this)}render({viewport:e}){this.viewport=e,qa(this.div,e);for(const t of g(this,le).getEditors(this.pageIndex))this.add(t),t.rebuild();this.updateMode()}update({viewport:e}){g(this,le).commitOrRemove(),x(this,sd,S5).call(this);const t=this.viewport.rotation,r=e.rotation;if(this.viewport=e,qa(this.div,{rotation:r}),t!==r)for(const i of g(this,fr).values())i.rotate(r);this.addInkEditorIfNeeded(!1)}get pageDimensions(){const{pageWidth:e,pageHeight:t}=this.viewport.rawDims;return[e,t]}get scale(){return g(this,le).viewParameters.realScale}};_0=new WeakMap,rd=new WeakMap,Yi=new WeakMap,ka=new WeakMap,qo=new WeakMap,fr=new WeakMap,Sa=new WeakMap,id=new WeakMap,od=new WeakMap,An=new WeakMap,Go=new WeakMap,le=new WeakMap,Ma=new WeakMap,Ky=new WeakSet,yP=function(e){g(this,le).unselectAll();const{target:t}=e;if(t===g(this,An).div||t.classList.contains("endOfContent")&&g(this,An).div.contains(t)){const{isMac:r}=Bn.platform;if(e.button!==0||e.ctrlKey&&r)return;g(this,le).showAllEditors("highlight",!0,!0),g(this,An).div.classList.add("free"),this.toggleDrawing(),ym.startHighlighting(this,g(this,le).direction==="ltr",e),g(this,An).div.addEventListener("pointerup",()=>{g(this,An).div.classList.remove("free"),this.toggleDrawing(!0)},{once:!0,signal:g(this,le)._signal}),e.preventDefault()}},z1=new WeakSet,t8=function(){return g(ci,Ma).get(g(this,le).getMode())},H1=new WeakSet,n8=function(e){const t=g(this,z1,t8);return t?new t.prototype.constructor(e):null},U1=new WeakSet,r8=function(){const{x:e,y:t,width:r,height:i}=this.div.getBoundingClientRect(),o=Math.max(0,e),s=Math.max(0,t),a=(o+Math.min(window.innerWidth,e+r))/2-e,c=(s+Math.min(window.innerHeight,t+i))/2-t,[u,d]=this.viewport.rotation%180==0?[a,c]:[c,a];return{offsetX:u,offsetY:d}},sd=new WeakSet,S5=function(){E(this,id,!0);for(const e of g(this,fr).values())e.isEmpty()&&e.remove();E(this,id,!1)},pe(ci,"_initialized",!1),M(ci,Ma,new Map([q4,Y4,Q4,ym].map(e=>[e._editorType,e])));let X4=ci;const on=class on{constructor({pageIndex:e}){M(this,K1);M(this,qy);M(this,Qi,null);M(this,Z1,0);M(this,Pt,new Map);M(this,Ea,new Map);this.pageIndex=e}setParent(e){if(g(this,Qi)){if(g(this,Qi)!==e){if(g(this,Pt).size>0)for(const t of g(this,Pt).values())t.remove(),e.append(t);E(this,Qi,e)}}else E(this,Qi,e)}static get _svgFactory(){return Ie(this,"_svgFactory",new A4)}highlight(e,t,r,i=!1){const o=qn(this,Z1)._++,s=x(this,K1,o8).call(this,e.box);s.classList.add("highlight"),e.free&&s.classList.add("free");const a=on._svgFactory.createElement("defs");s.append(a);const c=on._svgFactory.createElement("path");a.append(c);const u=`path_p${this.pageIndex}_${o}`;c.setAttribute("id",u),c.setAttribute("d",e.toSVGPath()),i&&g(this,Ea).set(o,c);const d=x(this,qy,bP).call(this,a,u),f=on._svgFactory.createElement("use");return s.append(f),s.setAttribute("fill",t),s.setAttribute("fill-opacity",r),f.setAttribute("href",`#${u}`),g(this,Pt).set(o,s),{id:o,clipPathId:`url(#${d})`}}highlightOutline(e){const t=qn(this,Z1)._++,r=x(this,K1,o8).call(this,e.box);r.classList.add("highlightOutline");const i=on._svgFactory.createElement("defs");r.append(i);const o=on._svgFactory.createElement("path");i.append(o);const s=`path_p${this.pageIndex}_${t}`;o.setAttribute("id",s),o.setAttribute("d",e.toSVGPath()),o.setAttribute("vector-effect","non-scaling-stroke");let a;if(e.free){r.classList.add("free");const d=on._svgFactory.createElement("mask");i.append(d),a=`mask_p${this.pageIndex}_${t}`,d.setAttribute("id",a),d.setAttribute("maskUnits","objectBoundingBox");const f=on._svgFactory.createElement("rect");d.append(f),f.setAttribute("width","1"),f.setAttribute("height","1"),f.setAttribute("fill","white");const h=on._svgFactory.createElement("use");d.append(h),h.setAttribute("href",`#${s}`),h.setAttribute("stroke","none"),h.setAttribute("fill","black"),h.setAttribute("fill-rule","nonzero"),h.classList.add("mask")}const c=on._svgFactory.createElement("use");r.append(c),c.setAttribute("href",`#${s}`),a&&c.setAttribute("mask",`url(#${a})`);const u=c.cloneNode();return r.append(u),c.classList.add("mainOutline"),u.classList.add("secondaryOutline"),g(this,Pt).set(t,r),t}finalizeLine(e,t){const r=g(this,Ea).get(e);g(this,Ea).delete(e),this.updateBox(e,t.box),r.setAttribute("d",t.toSVGPath())}updateLine(e,t){g(this,Pt).get(e).firstChild.firstChild.setAttribute("d",t.toSVGPath())}removeFreeHighlight(e){this.remove(e),g(this,Ea).delete(e)}updatePath(e,t){g(this,Ea).get(e).setAttribute("d",t.toSVGPath())}updateBox(e,t){var r;x(r=on,W1,i8).call(r,g(this,Pt).get(e),t)}show(e,t){g(this,Pt).get(e).classList.toggle("hidden",!t)}rotate(e,t){g(this,Pt).get(e).setAttribute("data-main-rotation",t)}changeColor(e,t){g(this,Pt).get(e).setAttribute("fill",t)}changeOpacity(e,t){g(this,Pt).get(e).setAttribute("fill-opacity",t)}addClass(e,t){g(this,Pt).get(e).classList.add(t)}removeClass(e,t){g(this,Pt).get(e).classList.remove(t)}remove(e){g(this,Qi)!==null&&(g(this,Pt).get(e).remove(),g(this,Pt).delete(e))}destroy(){E(this,Qi,null);for(const e of g(this,Pt).values())e.remove();g(this,Pt).clear()}};Qi=new WeakMap,Z1=new WeakMap,Pt=new WeakMap,Ea=new WeakMap,W1=new WeakSet,i8=function(e,{x:t=0,y:r=0,width:i=1,height:o=1}={}){const{style:s}=e;s.top=100*r+"%",s.left=100*t+"%",s.width=100*i+"%",s.height=100*o+"%"},K1=new WeakSet,o8=function(e){var r;const t=on._svgFactory.create(1,1,!0);return g(this,Qi).append(t),t.setAttribute("aria-hidden",!0),x(r=on,W1,i8).call(r,t,e),t},qy=new WeakSet,bP=function(e,t){const r=on._svgFactory.createElement("clipPath");e.append(r);const i=`clip_${t}`;r.setAttribute("id",i),r.setAttribute("clipPathUnits","objectBoundingBox");const o=on._svgFactory.createElement("use");return r.append(o),o.setAttribute("href",`#${t}`),o.classList.add("clip"),i},M(on,W1);let J4=on;ge.AbortException,ge.AnnotationEditorLayer,ge.AnnotationEditorParamsType,ge.AnnotationEditorType,ge.AnnotationEditorUIManager,ge.AnnotationLayer,ge.AnnotationMode,ge.CMapCompressionType,ge.ColorPicker,ge.DOMSVGFactory,ge.DrawLayer,ge.FeatureTest;var uW=ge.GlobalWorkerOptions;ge.ImageKind,ge.InvalidPDFException,ge.MissingPDFException,ge.OPS,ge.PDFDataRangeTransport,ge.PDFDateString,ge.PDFWorker,ge.PasswordResponses,ge.PermissionFlag,ge.PixelsPerInch,ge.RenderingCancelledException,ge.TextLayer,ge.UnexpectedResponseException,ge.Util,ge.VerbosityLevel,ge.XfaLayer,ge.build,ge.createValidAbsoluteUrl,ge.fetchData;var dW=ge.getDocument;ge.getFilenameFromUrl,ge.getPdfFilenameFromUrl,ge.getXfaPageViewport,ge.isDataScheme,ge.isPdfFile,ge.noContextMenu,ge.normalizeUnicode,ge.setLayerDimensions,ge.shadow;var fW=ge.version;const hW=l.defineComponent({name:"QModal",components:{QIcon:z0},props:{id:{type:String,default:"q-modal"},closeButtonClass:{type:String,default:""},containerClass:{type:String,default:"h-fit min-h-fit"},dismissible:{type:Boolean,default:!0},dismissibleOverlay:{type:Boolean,default:!0},dismissText:{type:String,default:""},overlay:{type:String,default:"white-transparent"},size:{type:String,default:"md"},showCancelLink:{type:Boolean,default:!1},hasBuildingBg:{type:Boolean,default:!1}},emits:["close"],setup(n,{emit:e}){l.provide("size",n.size);const t=()=>{n.dismissible&&e("close")};return l.onUnmounted(()=>{document.body.classList.remove("scroll-disabled")}),l.onMounted(()=>{document.body.classList.add("scroll-disabled")}),{onCloseModal:t}}});function pW(n,e,t,r,i,o){const s=l.resolveComponent("q-icon");return l.openBlock(),l.createElementBlock("div",{ref:"currentModal",class:l.normalizeClass(["q-modal",n.overlay]),onKeydown:e[3]||(e[3]=l.withKeys((...a)=>n.onCloseModal&&n.onCloseModal(...a),["escape"]))},[l.createElementVNode("div",l.mergeProps({class:"overlay"},{[l.toHandlerKey(n.dismissibleOverlay&&"click")]:e[0]||(e[0]=(...a)=>n.onCloseModal&&n.onCloseModal(...a))}),null,16),l.createElementVNode("div",{class:l.normalizeClass(["modal-container flex flex-col relative","modal-"+n.size,n.containerClass,{"building-background":n.hasBuildingBg}])},[n.dismissible?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass(["modal-close-button",n.closeButtonClass]),onClick:e[1]||(e[1]=(...a)=>n.onCloseModal&&n.onCloseModal(...a))},[l.createVNode(s,{icon:"close",type:"line",color:"gray-40"})],2)):l.createCommentVNode("",!0),l.renderSlot(n.$slots,"default",{},void 0,!0),n.showCancelLink?(l.openBlock(),l.createElementBlock("a",{key:1,class:"modal-close-link",href:"#",onClick:e[2]||(e[2]=l.withModifiers(a=>n.$emit("close"),["prevent"]))},l.toDisplayString(n.$t("HC_CANCEL")),1)):l.createCommentVNode("",!0)],2)],34)}const e6=ye(hW,[["render",pW],["__scopeId","data-v-8867a052"]]),mW=l.defineComponent({name:"QErrorModal",components:{QModal:e6},props:{toggle:{type:Boolean,default:!1,required:!0}},emits:["update:toggle"],setup(n,{emit:e}){return{toggleModal:l.computed({get:()=>n.toggle,set:r=>{e("update:toggle",r)}}),mq:_n}}}),gW={class:"flex flex-col gap-2 text-center"},yW={class:"text-lg font-bold text-inkwell-30 leading-6"},bW={class:"text-inkwell-0 mb-2 md:mb-6"};function wW(n,e,t,r,i,o){const s=l.resolveComponent("q-icon"),a=l.resolveComponent("q-button"),c=l.resolveComponent("q-modal-content"),u=l.resolveComponent("q-modal");return l.openBlock(),l.createBlock(l.Transition,{name:n.mq.md?"fade":"slide-up"},{default:l.withCtx(()=>[n.toggleModal?(l.openBlock(),l.createBlock(u,{key:0,id:"error-modal",dismissible:!1,overlay:n.mq.md?"white-transparent":"black-transparent",class:"!z-[170]","footer-class":"mt-2 md:mt-6",onClose:e[1]||(e[1]=d=>n.toggleModal=!1)},{default:l.withCtx(()=>[l.createVNode(c,null,{body:l.withCtx(()=>[l.createElementVNode("div",gW,[l.createVNode(s,{icon:"exclamation-circle",type:"outline",size:"xl",color:"red-30",class:"shrink-0 self-center mb-8"}),l.createElementVNode("h2",yW,[l.renderSlot(n.$slots,"headline",{},()=>[l.createTextVNode(l.toDisplayString(n.$t("HC_ERROR")),1)],!0)]),l.createElementVNode("p",bW,[l.renderSlot(n.$slots,"subtext",{},()=>[l.createTextVNode(l.toDisplayString(n.$t("HC_SORRY_UNEXPECTED_EXIT_MODAL")),1)],!0)])])]),footer:l.withCtx(()=>[l.createVNode(a,{class:l.normalizeClass([n.mq.md?"mx-3":"w-full"]),size:"lg",status:"secondary",onClick:e[0]||(e[0]=d=>n.toggleModal=!1)},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(n.$t("HC_EXIT")),1)]),_:1},8,["class"])]),_:3})]),_:3},8,["overlay"])):l.createCommentVNode("",!0)]),_:3},8,["name"])}const oE=ye(mW,[["render",wW],["__scopeId","data-v-72f5c09d"]]);uW.workerSrc=`https://cdn.jsdelivr.net/npm/pdfjs-dist@${fW}/legacy/build/pdf.worker.min.mjs`;const vW=l.defineComponent({name:"PdfViewer",components:{QErrorModal:oE},props:{url:{type:String,required:!0}},emits:["pdf-error"],setup(n,{emit:e}){let t=null;const r=2,i=16,o=l.ref([]),s=l.ref(!0),a=l.ref(!1),c=l.ref(0),u=async()=>{try{if(t=await dW(n.url).promise,!t)throw new Error("pdfDoc is null or undefined");c.value=t.numPages,s.value=!1,await l.nextTick(),o.value=Array.from(document.querySelectorAll(".pdf-pages canvas")),await d()}catch(h){a.value=!0,console.log(h),s.value=!1,e("pdf-error",!0)}},d=async()=>{try{for(let h=1;h<=c.value;h++)await f(h)}catch(h){console.log(h),a.value=!0,e("pdf-error",!0)}},f=async h=>{try{const p=await(t==null?void 0:t.getPage(h));if(!p)throw new Error(`Page ${h} does not exist in the PDF document`);const y=p.getViewport({scale:1}),b=o.value[h-1];if(!b)throw new Error(`Canvas for page ${h} does not exist`);const w=b.getContext("2d");if(!w)throw new Error(`Context for page ${h} does not exist`);b.height=y==null?void 0:y.height,b.width=y==null?void 0:y.width;const v={canvasContext:w,viewport:y};await(p==null?void 0:p.render(v))}catch(p){console.log(p),a.value=!0,e("pdf-error",!0)}};return l.onMounted(()=>{u()}),{skeletonColumns:r,skeletonRows:i,canvasRefs:o,loadingMeta:s,showErrorModal:a,totalPages:c,loadPDF:u,renderPage:f}}}),CW={class:"q-pdf-viewer"},kW={key:0},SW={key:1,class:"pdf-pages"};function MW(n,e,t,r,i,o){const s=l.resolveComponent("q-error-modal");return l.openBlock(),l.createElementBlock(l.Fragment,null,[l.createElementVNode("div",CW,[n.loadingMeta?(l.openBlock(),l.createElementBlock("div",kW,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(n.skeletonRows,a=>(l.openBlock(),l.createElementBlock("div",{key:a,class:"flex items-center p-4"},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(n.skeletonColumns,c=>(l.openBlock(),l.createElementBlock("div",{key:c,class:l.normalizeClass(["h-[1.5rem] border-white w-11/12",(a-1)%2?"bg-gray-10":"bg-gray-30",(a-1)%4||c===1?"animate-shimmer":"!hidden"])},null,2))),128))]))),128))])):(l.openBlock(),l.createElementBlock("div",SW,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(n.totalPages,a=>(l.openBlock(),l.createElementBlock("canvas",{key:a,class:"w-full"}))),128))]))]),n.showErrorModal?(l.openBlock(),l.createBlock(s,{key:0,toggle:n.showErrorModal,"onUpdate:toggle":[e[0]||(e[0]=a=>n.showErrorModal=a),e[1]||(e[1]=a=>n.showErrorModal=!1)]},null,8,["toggle"])):l.createCommentVNode("",!0)],64)}const sE=ye(vW,[["render",MW],["__scopeId","data-v-da5da0f5"]]),EW=l.defineComponent({name:"QTooltip",props:{id:{type:String,default:"tooltip"},color:{type:String,default:"inkwell-30"},disabled:{type:Boolean,default:!1},noWrap:{type:Boolean,default:!0},position:{type:String,default:"bottom"},relative:{type:Boolean,default:!1},tooltipClasses:{type:[String,Array,Object],default:""}}}),AW=["aria-describedby"],TW=["id"];function xW(n,e,t,r,i,o){return l.openBlock(),l.createElementBlock("div",{class:"tooltip-container","aria-describedby":n.id},[l.renderSlot(n.$slots,"trigger",{},void 0,!0),l.createElementVNode("div",{id:n.id,class:l.normalizeClass(["tooltip",n.color?"bg-"+n.color+" border-"+n.color:"",n.position,n.noWrap?"no-wrap":"",n.relative?"relative":"",n.disabled?"!hidden":"",n.tooltipClasses]),role:"tooltip"},[l.renderSlot(n.$slots,"content",{},void 0,!0)],10,TW)],8,AW)}const t6=ye(EW,[["render",xW],["__scopeId","data-v-ca6ae8fe"]]),aE=()=>{const n=l.ref(""),e=navigator.userAgent;return e.match("/Android|webOS|iPhone|iPod|BlackBerry/i")?n.value="mobile":e.match("/iPad|Tablet/i")||navigator.maxTouchPoints&&navigator.maxTouchPoints>=0&&!window.matchMedia("(pointer:fine)").matches?n.value="tablet":n.value="desktop",{deviceType:n}},IW=l.defineComponent({name:"ImageGallery",components:{Galleria:rM,QBadge:Da,QBottomSheet:G9,QMenu:m4,QPdfViewer:sE,QTooltip:t6},props:{files:{type:Array,default:()=>[]},thumbnailsVisible:{type:Number,default:4},showOnHover:{type:Boolean,default:!0},showThumbnails:{type:Boolean,default:!0},showRemove:{type:[Boolean,Number],default:!1},baseZIndex:{type:Number,default:1e3},wrap:{type:Boolean,default:!0},processing:{type:Boolean,default:!1}},emits:["update:model-value","update:activeIndex","click:file"],setup(n,{emit:e}){const{t}=us(),{deviceType:r}=aE(),i=[{text:t("HC_CANCEL")}],o=l.ref(null),s=l.computed(()=>{var Q;return(Q=o.value)==null?void 0:Q.offsetWidth}),a=l.ref(null),c=l.ref([]),u=l.ref(!1),d=l.ref(null),f=l.ref("0"),h=l.ref(1),p=l.ref(_n.md?1:.9),m=l.ref(0),y=l.ref(null),b=l.ref(),w=l.ref(!1),v=l.ref(!1),k=l.computed(()=>{if(y.value)return y.value&&"original"in y.value?{name:y.value.original.name,url:y.value.original.url,type:y.value.mimetype,extension:V(y.value.original.url)}:{name:y.value.name,url:URL.createObjectURL(y.value),type:y.value.type,extension:V(y.value.name)}}),C=l.computed(()=>[`z-[${n.baseZIndex+1}]`]),T=l.computed(()=>n.files.filter(Q=>Q.type.startsWith("image")&&!Q.type.includes("tif"))),S=l.computed(()=>["rounded-lg relative mx-auto object-cover grow-1 max-h-[74vh]",{animated:!N}]),A=l.computed(()=>["flex items-center gap-3",n.wrap?"flex-wrap":"flex-nowrap overflow-x-auto shrink-0",{"flex-nowrap overflow-x-auto":r.value!=="desktop"}]),O=l.computed(()=>[{text:t("HC_DELETE_ATTACHMENT"),classes:"!text-red-20",event:F}]),I=Q=>{const Z=Q instanceof File?URL.createObjectURL(Q):Q.original.url;r.value==="desktop"?window.open(Z,"_blank"):window.open(Z,"_self")},P=Q=>{r.value==="desktop"?I(Q):(y.value=Q,v.value=!0)},D=Q=>{Q.event(),u.value=!1},_=(Q,Z)=>{var z;const H=((z=Z.type)==null?void 0:z.includes("image"))&&!Z.type.includes("tif");!u.value&&H?B(Q,Z):!u.value&&!H&&P(Z)},B=(Q,Z)=>{const H=K=>"original"in K&&"original"in Z?K.original.url===(Z==null?void 0:Z.original.url):Z instanceof File?K.name===(Z==null?void 0:Z.name):!1,z=T.value.findIndex(H);m.value=z!==-1?z:Q,w.value=!0},F=(Q=null)=>{u.value=!1,e("update:model-value",Q||d.value)},R=Q=>{const{keyCode:Z}=Q;if(w.value)switch(Z){case 37:m.value=m.value?m.value-1:T.value.length-1,e("update:activeIndex",m.value);break;case 39:m.value=m.value<T.value.length-1?m.value+1:0,e("update:activeIndex",m.value);break;case 27:w.value=!1;break}},{isSwiping:N,lengthX:W}=iL(a,{passive:!1,onSwipe(){const Q=Math.abs(W.value);s.value&&(h.value=1.1-Q/s.value,f.value=W.value<0?`${Q/4}px`:`-${Q/4}px`)},onSwipeEnd(){const Q=m.value<=0,Z=m.value>=T.value.length-1,H=Math.abs(W.value);s.value&&H/s.value>=.5?(W.value<0?m.value=Q?T.value.length-1:m.value-1:m.value=Z?0:m.value+1,f.value="0",h.value=1):(f.value="0",h.value=1)}}),V=Q=>Q.substring(Q.lastIndexOf(".")),Y=(Q,Z)=>{Q.preventDefault(),d.value=n.files[Z],u.value=!0},ue=()=>{u.value=!1,d.value=null},de=()=>{r.value!=="desktop"&&c.value.forEach(Q=>{X_(Q,Z=>{const H=c.value.indexOf(Q);Y(Z,H)},{modifiers:{prevent:!0}})})};return l.onMounted(()=>{window.addEventListener("keyup",R),de()}),l.onUpdated(()=>{de()}),{menuActions:i,linkActions:O,deviceType:r,container:o,containerWidth:s,featuredPhoto:a,longPressRef:c,longPressedHook:u,isSwiping:N,lengthX:W,left:f,opacity:h,scale:p,showCarousel:w,showFileViewer:v,active:m,activeAttachment:y,hoveredIndex:b,closeIconClasses:C,itemClasses:S,images:T,normalizedAttachment:k,thumbnailContainerClasses:A,downloadDocument:I,getExtension:V,onAttachmentClick:P,onClickMenuLink:D,onClickThumbnail:_,onOpenCarousel:B,onRemoveFile:F,onKeyboardNavigation:R,onLongPressCallbackHook:Y,resetHook:ue,mq:_n}}}),OW=n=>(l.pushScopeId("data-v-ff7403d4"),n=n(),l.popScopeId(),n),DW={class:"q-image-gallery flex",ref:"container"},NW={ref:"featuredPhoto",class:"featured-image h-[80vh] overflow-hidden flex max-w-screen relative md:h-full w-screen items-center"},PW=["src","alt"],_W=["src","alt"],LW=["onMouseover","onClick"],BW=["src","alt"],RW={key:1,class:"bg-gray-00 cursor-pointer p-3 h-16 max-w-[14rem] rounded-lg border border-gray-20 flex items-center"},$W={class:"grow text-ellipsis overflow-hidden"},FW={class:"text-inkwell-30 bold leading-normal text-nowrap text-ellipsis text-sm overflow-hidden -mt-1"},VW={class:"uppercase text-xxs"},jW={key:2,class:"image-overlay absolute top-0 left-0 w-full h-full cursor-pointer"},zW={key:0,class:"absolute top-0 left-0 z-1 w-full h-full cursor-pointer bg-black/50 rounded-lg flex items-center justify-center"},HW=[OW(()=>l.createElementVNode("svg",{class:"animate-spin fill-white",width:"20",height:"20",viewBox:"0 0 24 24"},[l.createElementVNode("path",{d:"M2 12a1 1 0 0 1 2 0 8 8 0 1 0 8-8 1 1 0 0 1 0-2c5.523 0 10 4.477 10 10s-4.477 10-10 10S2 17.523 2 12z"})],-1))],UW={key:1,width:"100%",height:"auto",controls:"",class:"bg-black"},ZW=["src"],WW={class:"flex items-center flex-col p-12"},KW=["src"],qW=["data","type"],GW={class:"flex items-center flex-col p-12"};function YW(n,e,t,r,i,o){const s=l.resolveComponent("q-icon"),a=l.resolveComponent("Galleria"),c=l.resolveComponent("q-badge"),u=l.resolveComponent("q-tooltip"),d=l.resolveComponent("q-menu"),f=l.resolveComponent("q-pdf-viewer"),h=l.resolveComponent("q-bottom-sheet");return l.openBlock(),l.createElementBlock("div",DW,[l.createVNode(a,{activeIndex:n.active,"onUpdate:activeIndex":e[0]||(e[0]=p=>n.active=p),visible:n.showCarousel,"onUpdate:visible":e[1]||(e[1]=p=>n.showCarousel=p),value:n.images,numVisible:n.thumbnailsVisible,circular:!0,fullScreen:!0,showItemNavigators:n.mq.md,showThumbnailNavigators:!0,showThumbnails:n.showThumbnails&&n.mq.md,showIndicators:!n.mq.md,containerStyle:[{height:"100vh"}],"base-z-index":n.baseZIndex},{closeicon:l.withCtx(()=>[l.createVNode(s,{class:l.normalizeClass(n.closeIconClasses),icon:"times-circle",type:"outline",size:"lg",color:"white"},null,8,["class"])]),item:l.withCtx(({item:p})=>[l.createElementVNode("div",NW,[l.createElementVNode("img",{src:(p==null?void 0:p.itemImageSrc)||(p==null?void 0:p.objectURL)||(p==null?void 0:p.original.url),alt:p==null?void 0:p.alt,class:l.normalizeClass(n.itemClasses),style:l.normalizeStyle([{left:n.left,opacity:n.opacity},`transform: scale(${n.scale})`])},null,14,PW)],512)]),thumbnail:l.withCtx(({item:p})=>[l.createElementVNode("img",{src:p.thumbnailImageSrc||(p==null?void 0:p.objectURL)||(p==null?void 0:p.thumbnail.url),alt:p.alt,class:"rounded-lg block min-h-24 min-w-24 max-w-24 max-h-24 object-cover"},null,8,_W)]),previousitemicon:l.withCtx(()=>[l.createVNode(s,{icon:"chevron-circle-left",type:"outline",size:"md",color:"white"})]),nextitemicon:l.withCtx(()=>[l.createVNode(s,{icon:"chevron-circle-right",type:"outline",size:"md",color:"white"})]),previousthumbnailicon:l.withCtx(()=>[n.images.length>n.thumbnailsVisible?(l.openBlock(),l.createBlock(s,{key:0,icon:"chevron-left",type:"line",size:"sm",color:"white"})):l.createCommentVNode("",!0)]),nextthumbnailicon:l.withCtx(()=>[n.images.length>n.thumbnailsVisible?(l.openBlock(),l.createBlock(s,{key:0,icon:"chevron-right",type:"line",size:"sm",color:"white"})):l.createCommentVNode("",!0)]),_:1},8,["activeIndex","visible","value","numVisible","showItemNavigators","showThumbnails","showIndicators","base-z-index"]),n.files?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass(n.thumbnailContainerClasses)},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(n.files,(p,m)=>{var y;return l.openBlock(),l.createElementBlock("div",{ref_for:!0,ref:"longPressRef",key:p.name||((y=p.original)==null?void 0:y.name)||m,class:l.normalizeClass(["p-0 relative rounded-lg",{"shrink-0":n.deviceType!=="desktop"}]),onMouseover:b=>n.hoveredIndex=m,onMouseleave:e[2]||(e[2]=b=>n.hoveredIndex=null),onClick:b=>n.onClickThumbnail(m,p)},[l.createVNode(u,{position:"top"},{trigger:l.withCtx(()=>[p.type&&p.type.includes("image")&&!p.type.includes("tif")?(l.openBlock(),l.createElementBlock("img",{key:0,src:(p==null?void 0:p.thumbnailImageSrc)||(p==null?void 0:p.objectURL)||(p==null?void 0:p.thumbnail.url),alt:p==null?void 0:p.alt,class:"rounded-lg cursor-pointer w-16 h-16 object-cover bg-gray-0 border-gray-20 border"},null,8,BW)):(l.openBlock(),l.createElementBlock("div",RW,[l.createVNode(s,{icon:"file-document",size:"xl",color:"white",class:"mr-3 shrink-0 p-2 bg-green-20 rounded-lg h-full"}),l.createElementVNode("div",$W,[l.createElementVNode("div",FW,l.toDisplayString(p.name||p.original.name),1),l.createElementVNode("div",VW,l.toDisplayString((p.name||p.original.name).match(/([^.]+$)/)[0]),1)])])),n.deviceType!=="desktop"?(l.openBlock(),l.createElementBlock("div",jW)):l.createCommentVNode("",!0),n.showRemove&&n.showOnHover&&n.hoveredIndex===m&&n.deviceType==="desktop"&&!n.processing?(l.openBlock(),l.createBlock(c,{key:3,color:"inkwell-30",shape:"circle",class:"cursor-pointer absolute -top-2 -right-2 shadow-solid z-10",onClick:l.withModifiers(b=>n.onRemoveFile(p),["stop"])},{icon:l.withCtx(()=>[l.createVNode(s,{icon:"close",size:"xs",type:"line",color:"white"})]),_:2},1032,["onClick"])):l.createCommentVNode("",!0)]),content:l.withCtx(()=>{var b;return[l.createTextVNode(l.toDisplayString(p.name||((b=p.original)==null?void 0:b.name)),1)]}),_:2},1024),l.createVNode(l.Transition,{name:"fade"},{default:l.withCtx(()=>[n.processing?(l.openBlock(),l.createElementBlock("div",zW,HW)):l.createCommentVNode("",!0)]),_:1})],42,LW)}),128)),l.createVNode(l.Transition,{name:"fade"},{default:l.withCtx(()=>[n.longPressedHook?(l.openBlock(),l.createBlock(d,{key:0,modelValue:n.longPressedHook,"onUpdate:modelValue":e[3]||(e[3]=p=>n.longPressedHook=p),actions:n.menuActions,links:n.linkActions,"links-background":"light-gray","onClick:link":n.onClickMenuLink,"onClick:action":e[4]||(e[4]=p=>n.longPressedHook=!1)},null,8,["modelValue","actions","links","onClick:link"])):l.createCommentVNode("",!0)]),_:1})],2)):l.createCommentVNode("",!0),l.createVNode(l.Transition,{name:"slide-up-fade"},{default:l.withCtx(()=>[n.showFileViewer&&n.normalizedAttachment&&n.activeAttachment?(l.openBlock(),l.createBlock(h,{key:0,modelValue:n.showFileViewer,"onUpdate:modelValue":e[6]||(e[6]=p=>n.showFileViewer=p),"show-close-button":!1,"content-class":"p-0","header-class":"border-b border-solid border-gray-20","title-class":"min-w-0 truncate"},{header:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(n.normalizedAttachment.name),1)]),headerAction:l.withCtx(()=>[!n.normalizedAttachment.type.includes("video")&&n.normalizedAttachment.type!=="audio/mpeg"&&n.normalizedAttachment.type!=="application/pdf"?(l.openBlock(),l.createBlock(s,{key:0,icon:"arrow-to-bottom",type:"line",size:"md",color:"inkwell-40",class:"shrink-0 cursor-pointer",onClick:e[5]||(e[5]=p=>n.downloadDocument(n.activeAttachment))})):l.createCommentVNode("",!0)]),default:l.withCtx(()=>[n.normalizedAttachment.type==="application/pdf"?(l.openBlock(),l.createBlock(f,{key:0,url:n.normalizedAttachment.url},null,8,["url"])):n.normalizedAttachment.type.includes("video")?(l.openBlock(),l.createElementBlock("video",UW,[l.createElementVNode("source",{src:n.normalizedAttachment.url},null,8,ZW),l.createElementVNode("div",WW,[l.createVNode(s,{icon:"file-document",size:"xl",color:"inkwell-30"}),l.createTextVNode(" "+l.toDisplayString(n.normalizedAttachment.extension),1)])])):n.normalizedAttachment.type==="audio/mpeg"?(l.openBlock(),l.createElementBlock("audio",{key:2,controls:"",src:n.normalizedAttachment.url,class:"mx-auto my-6"},null,8,KW)):(l.openBlock(),l.createElementBlock("object",{key:3,data:n.normalizedAttachment.url,type:n.normalizedAttachment.type,class:"w-full h-auto"},[l.createElementVNode("div",GW,[l.createVNode(s,{icon:"file-document",size:"xl",color:"inkwell-30"}),l.createTextVNode(" "+l.toDisplayString(n.normalizedAttachment.extension),1)])],8,qW))]),_:1},8,["modelValue"])):l.createCommentVNode("",!0)]),_:1})],512)}const n6=ye(IW,[["render",YW],["__scopeId","data-v-ff7403d4"]]),QW=l.defineComponent({name:"QWarningModal",components:{QModal:e6},props:{toggle:{type:Boolean,default:!1,required:!0},action:{type:Function,default:()=>{}},processing:{type:Boolean,default:!1}},emits:["update:toggle","update:action"],setup(n,{emit:e}){return{toggleModal:l.computed({get:()=>n.toggle,set:r=>{e("update:toggle",r)}}),mq:_n}}}),XW={key:0,class:"flex flex-col gap-2 text-center"},JW={class:"text-lg font-bold text-inkwell-30 leading-6"},eK={class:"text-inkwell-0 mb-6"},tK={key:1,class:"flex flex-col gap-2 text-center"},nK={class:"text-[1.25rem] font-bold text-center text-inkwell-30"},rK={class:"text-sm text-center text-inkwell-0 mb-2"},iK={class:"flex flex-col items-center justify-center gap-3 md:gap-2"};function oK(n,e,t,r,i,o){const s=l.resolveComponent("q-button"),a=l.resolveComponent("q-modal-content"),c=l.resolveComponent("q-modal");return l.openBlock(),l.createBlock(l.Transition,{name:n.mq.md?"fade":"slide-up"},{default:l.withCtx(()=>[n.toggleModal?(l.openBlock(),l.createBlock(c,{key:0,class:"warning-modal !z-[170]",dismissible:!1,overlay:n.mq.md?"white-transparent":"black-transparent","container-class":"h-fit min-h-fit","footer-class":"mt-2 md:mt-6",onClose:e[1]||(e[1]=u=>n.toggleModal=!1)},{default:l.withCtx(()=>[l.createVNode(a,null,{body:l.withCtx(()=>[n.mq.md?(l.openBlock(),l.createElementBlock("div",XW,[l.createElementVNode("h2",JW,[l.renderSlot(n.$slots,"desktopHeader",{},void 0,!0)]),l.createElementVNode("p",eK,[l.renderSlot(n.$slots,"desktopMessage",{},void 0,!0)])])):(l.openBlock(),l.createElementBlock("div",tK,[l.createElementVNode("h2",nK,[l.renderSlot(n.$slots,"mobileHeader",{},void 0,!0)]),l.createElementVNode("p",rK,[l.renderSlot(n.$slots,"mobileMessage",{},void 0,!0)])]))]),footer:l.withCtx(()=>[l.createElementVNode("div",iK,[l.createVNode(s,{disabled:n.processing,loading:n.processing,class:l.normalizeClass([n.mq.md?"mx-2":"w-full"]),size:"lg",status:"danger",onClick:n.action},{default:l.withCtx(()=>[l.renderSlot(n.$slots,"buttonText",{},void 0,!0)]),_:3},8,["disabled","loading","class","onClick"]),l.createVNode(s,{class:l.normalizeClass([n.mq.md?"mx-2":"w-full"]),disabled:n.processing,status:n.mq.md?"link-secondary":"secondary",size:"lg",onClick:e[0]||(e[0]=u=>n.toggleModal=!1)},{default:l.withCtx(()=>[l.renderSlot(n.$slots,"cancelText",{},()=>[l.createTextVNode(l.toDisplayString(n.$t("HC_CANCEL")),1)],!0)]),_:3},8,["class","disabled","status"])])]),_:3})]),_:3},8,["overlay"])):l.createCommentVNode("",!0)]),_:3},8,["name"])}const lE=ye(QW,[["render",oK],["__scopeId","data-v-a8bfc627"]]),sK=l.defineComponent({name:"QPopover",props:{align:{type:String,default:"left"},hasCaret:{type:Boolean,default:!0},modelValue:{type:Boolean,default:!1},position:{type:String,default:"bottom"},reposition:{type:Boolean,default:!0},size:{type:String,default:"md"},trigger:{type:String,default:"click"}},emits:["update:modelValue"],setup(n,{emit:e}){const t=l.ref(!1),r=l.ref(""),i=l.ref(null),o=l.computed(()=>t.value===!0&&n.reposition===!0?a(n.align):n.align),s=l.computed(()=>t.value===!0&&n.reposition===!0?c(n.position):n.position),a=b=>{if(!i.value||u(i.value.children[1]))return b;const w=i.value.children[0].getBoundingClientRect(),v=i.value.children[1].getBoundingClientRect();if(b==="left"||b==="right"||b==="center"){const k=w.left;return window.innerWidth-k<v.width?"right":"left"}else{const k=w.top;return window.innerHeight-k<v.height?"bottom":"top"}},c=b=>{if(!i.value||u(i.value.children[1]))return b;const w=i.value.children[0].getBoundingClientRect(),v=i.value.children[1].getBoundingClientRect();if(b==="top"||b==="bottom"){const k=w.top;return window.innerHeight-k<v.height?"top":"bottom"}else{const k=w.left;return window.innerWidth-k<v.width?"left":"right"}},u=b=>{const w=b.getBoundingClientRect();return w?w.top>=0&&w.left>=0&&w.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&w.right<=(window.innerWidth||document.documentElement.clientWidth):!1},d=()=>{(n.trigger==="click"||n.trigger==="both")&&e("update:modelValue",!n.modelValue)},f=()=>{n.trigger!=="click"&&e("update:modelValue",!1)},h=()=>{n.trigger!=="click"&&e("update:modelValue",!0)},p=()=>{var w;const b=(w=i.value)==null?void 0:w.children[0];if(b){const v=b.clientWidth,k=b.clientHeight;switch(o.value){case"left":r.value=`margin-left: ${v/2-10}px;`;break;case"right":r.value=`margin-right: ${v/2-10}px;`;break;case"top":r.value=`margin-top: ${k/2-10}px;`;break;case"bottom":r.value=`margin-bottom: ${k/2-10}px;`;break}}};F5(i,()=>{e("update:modelValue",!1)});function m(){t.value=!1}function y(){var b;t.value=!0,!u((b=i.value)==null?void 0:b.children[1])&&n.reposition===!0&&p()}return{entered:t,offsetStyle:r,popover:i,alignment:o,positioning:s,getAlignment:a,getPositioning:c,isElementInView:u,onAfterLeave:m,onClick:d,onClickOutside:F5,onEnter:y,onMouseLeave:f,onMouseOver:h}}});function aK(n,e,t,r,i,o){return l.openBlock(),l.createElementBlock("div",{ref:"popover",class:"popover-container",onMouseleave:e[0]||(e[0]=(...s)=>n.onMouseLeave&&n.onMouseLeave(...s))},[l.renderSlot(n.$slots,"trigger",{onClick:n.onClick,onMouseOver:n.onMouseOver},void 0,!0),l.createVNode(l.Transition,{name:"fade",onEnter:n.onEnter,onAfterLeave:n.onAfterLeave},{default:l.withCtx(()=>[n.modelValue?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass(["popover","popover-"+n.alignment,"popover-"+n.size,"popover-on-"+n.positioning,{"has-caret":n.hasCaret}]),style:l.normalizeStyle(n.offsetStyle)},[l.renderSlot(n.$slots,"content",{},void 0,!0)],6)):l.createCommentVNode("",!0)]),_:3},8,["onEnter","onAfterLeave"])],544)}const cE=ye(sK,[["render",aK],["__scopeId","data-v-86f2575d"]]);function Qt(n){this.content=n}Qt.prototype={constructor:Qt,find:function(n){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===n)return e;return-1},get:function(n){var e=this.find(n);return e==-1?void 0:this.content[e+1]},update:function(n,e,t){var r=t&&t!=n?this.remove(t):this,i=r.find(n),o=r.content.slice();return i==-1?o.push(t||n,e):(o[i+1]=e,t&&(o[i]=t)),new Qt(o)},remove:function(n){var e=this.find(n);if(e==-1)return this;var t=this.content.slice();return t.splice(e,2),new Qt(t)},addToStart:function(n,e){return new Qt([n,e].concat(this.remove(n).content))},addToEnd:function(n,e){var t=this.remove(n).content.slice();return t.push(n,e),new Qt(t)},addBefore:function(n,e,t){var r=this.remove(e),i=r.content.slice(),o=r.find(n);return i.splice(o==-1?i.length:o,0,e,t),new Qt(i)},forEach:function(n){for(var e=0;e<this.content.length;e+=2)n(this.content[e],this.content[e+1])},prepend:function(n){return n=Qt.from(n),n.size?new Qt(n.content.concat(this.subtract(n).content)):this},append:function(n){return n=Qt.from(n),n.size?new Qt(this.subtract(n).content.concat(n.content)):this},subtract:function(n){var e=this;n=Qt.from(n);for(var t=0;t<n.content.length;t+=2)e=e.remove(n.content[t]);return e},toObject:function(){var n={};return this.forEach(function(e,t){n[e]=t}),n},get size(){return this.content.length>>1}},Qt.from=function(n){if(n instanceof Qt)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new Qt(e)};function uE(n,e,t){for(let r=0;;r++){if(r==n.childCount||r==e.childCount)return n.childCount==e.childCount?null:t;let i=n.child(r),o=e.child(r);if(i==o){t+=i.nodeSize;continue}if(!i.sameMarkup(o))return t;if(i.isText&&i.text!=o.text){for(let s=0;i.text[s]==o.text[s];s++)t++;return t}if(i.content.size||o.content.size){let s=uE(i.content,o.content,t+1);if(s!=null)return s}t+=i.nodeSize}}function dE(n,e,t,r){for(let i=n.childCount,o=e.childCount;;){if(i==0||o==0)return i==o?null:{a:t,b:r};let s=n.child(--i),a=e.child(--o),c=s.nodeSize;if(s==a){t-=c,r-=c;continue}if(!s.sameMarkup(a))return{a:t,b:r};if(s.isText&&s.text!=a.text){let u=0,d=Math.min(s.text.length,a.text.length);for(;u<d&&s.text[s.text.length-u-1]==a.text[a.text.length-u-1];)u++,t--,r--;return{a:t,b:r}}if(s.content.size||a.content.size){let u=dE(s.content,a.content,t-1,r-1);if(u)return u}t-=c,r-=c}}class G{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,t,r,i=0,o){for(let s=0,a=0;a<t;s++){let c=this.content[s],u=a+c.nodeSize;if(u>e&&r(c,i+a,o||null,s)!==!1&&c.content.size){let d=a+1;c.nodesBetween(Math.max(0,e-d),Math.min(c.content.size,t-d),r,i+d)}a=u}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,r,i){let o="",s=!0;return this.nodesBetween(e,t,(a,c)=>{let u=a.isText?a.text.slice(Math.max(e,c)-c,t-c):a.isLeaf?i?typeof i=="function"?i(a):i:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&u||a.isTextblock)&&r&&(s?s=!1:o+=r),o+=u},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,r=e.firstChild,i=this.content.slice(),o=0;for(t.isText&&t.sameMarkup(r)&&(i[i.length-1]=t.withText(t.text+r.text),o=1);o<e.content.length;o++)i.push(e.content[o]);return new G(i,this.size+e.size)}cut(e,t=this.size){if(e==0&&t==this.size)return this;let r=[],i=0;if(t>e)for(let o=0,s=0;s<t;o++){let a=this.content[o],c=s+a.nodeSize;c>e&&((s<e||c>t)&&(a.isText?a=a.cut(Math.max(0,e-s),Math.min(a.text.length,t-s)):a=a.cut(Math.max(0,e-s-1),Math.min(a.content.size,t-s-1))),r.push(a),i+=a.nodeSize),s=c}return new G(r,i)}cutByIndex(e,t){return e==t?G.empty:e==0&&t==this.content.length?this:new G(this.content.slice(e,t))}replaceChild(e,t){let r=this.content[e];if(r==t)return this;let i=this.content.slice(),o=this.size+t.nodeSize-r.nodeSize;return i[e]=t,new G(i,o)}addToStart(e){return new G([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new G(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,r=0;t<this.content.length;t++){let i=this.content[t];e(i,r,t),r+=i.nodeSize}}findDiffStart(e,t=0){return uE(this,e,t)}findDiffEnd(e,t=this.size,r=e.size){return dE(this,e,t,r)}findIndex(e,t=-1){if(e==0)return bm(0,e);if(e==this.size)return bm(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,i=0;;r++){let o=this.child(r),s=i+o.nodeSize;if(s>=e)return s==e||t>0?bm(r+1,s):bm(r,i);i=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return G.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new G(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return G.empty;let t,r=0;for(let i=0;i<e.length;i++){let o=e[i];r+=o.nodeSize,i&&o.isText&&e[i-1].sameMarkup(o)?(t||(t=e.slice(0,i)),t[t.length-1]=o.withText(t[t.length-1].text+o.text)):t&&t.push(o)}return new G(t||e,r)}static from(e){if(!e)return G.empty;if(e instanceof G)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new G([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}G.empty=new G([],0);const r6={index:0,offset:0};function bm(n,e){return r6.index=n,r6.offset=e,r6}function wm(n,e){if(n===e)return!0;if(!(n&&typeof n=="object")||!(e&&typeof e=="object"))return!1;let t=Array.isArray(n);if(Array.isArray(e)!=t)return!1;if(t){if(n.length!=e.length)return!1;for(let r=0;r<n.length;r++)if(!wm(n[r],e[r]))return!1}else{for(let r in n)if(!(r in e)||!wm(n[r],e[r]))return!1;for(let r in e)if(!(r in n))return!1}return!0}let We=class s8{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,r=!1;for(let i=0;i<e.length;i++){let o=e[i];if(this.eq(o))return e;if(this.type.excludes(o.type))t||(t=e.slice(0,i));else{if(o.type.excludes(this.type))return e;!r&&o.type.rank>this.type.rank&&(t||(t=e.slice(0,i)),t.push(this),r=!0),t&&t.push(o)}}return t||(t=e.slice()),r||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&wm(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[t.type];if(!r)throw new RangeError(`There is no mark type ${t.type} in this schema`);return r.create(t.attrs)}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(t[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return s8.none;if(e instanceof s8)return[e];let t=e.slice();return t.sort((r,i)=>r.type.rank-i.type.rank),t}};We.none=[];class vm extends Error{}class te{constructor(e,t,r){this.content=e,this.openStart=t,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let r=hE(this.content,e+this.openStart,t);return r&&new te(r,this.openStart,this.openEnd)}removeBetween(e,t){return new te(fE(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return te.empty;let r=t.openStart||0,i=t.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new te(G.fromJSON(e,t.content),r,i)}static maxOpen(e,t=!0){let r=0,i=0;for(let o=e.firstChild;o&&!o.isLeaf&&(t||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=e.lastChild;o&&!o.isLeaf&&(t||!o.type.spec.isolating);o=o.lastChild)i++;return new te(e,r,i)}}te.empty=new te(G.empty,0,0);function fE(n,e,t){let{index:r,offset:i}=n.findIndex(e),o=n.maybeChild(r),{index:s,offset:a}=n.findIndex(t);if(i==e||o.isText){if(a!=t&&!n.child(s).isText)throw new RangeError("Removing non-flat range");return n.cut(0,e).append(n.cut(t))}if(r!=s)throw new RangeError("Removing non-flat range");return n.replaceChild(r,o.copy(fE(o.content,e-i-1,t-i-1)))}function hE(n,e,t,r){let{index:i,offset:o}=n.findIndex(e),s=n.maybeChild(i);if(o==e||s.isText)return r&&!r.canReplace(i,i,t)?null:n.cut(0,e).append(t).append(n.cut(e));let a=hE(s.content,e-o-1,t);return a&&n.replaceChild(i,s.copy(a))}function lK(n,e,t){if(t.openStart>n.depth)throw new vm("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new vm("Inconsistent open depths");return pE(n,e,t,0)}function pE(n,e,t,r){let i=n.index(r),o=n.node(r);if(i==e.index(r)&&r<n.depth-t.openStart){let s=pE(n,e,t,r+1);return o.copy(o.content.replaceChild(i,s))}else if(t.content.size)if(!t.openStart&&!t.openEnd&&n.depth==r&&e.depth==r){let s=n.parent,a=s.content;return el(s,a.cut(0,n.parentOffset).append(t.content).append(a.cut(e.parentOffset)))}else{let{start:s,end:a}=cK(t,n);return el(o,gE(n,s,a,e,r))}else return el(o,Cm(n,e,r))}function mE(n,e){if(!e.type.compatibleContent(n.type))throw new vm("Cannot join "+e.type.name+" onto "+n.type.name)}function i6(n,e,t){let r=n.node(t);return mE(r,e.node(t)),r}function Ja(n,e){let t=e.length-1;t>=0&&n.isText&&n.sameMarkup(e[t])?e[t]=n.withText(e[t].text+n.text):e.push(n)}function w2(n,e,t,r){let i=(e||n).node(t),o=0,s=e?e.index(t):i.childCount;n&&(o=n.index(t),n.depth>t?o++:n.textOffset&&(Ja(n.nodeAfter,r),o++));for(let a=o;a<s;a++)Ja(i.child(a),r);e&&e.depth==t&&e.textOffset&&Ja(e.nodeBefore,r)}function el(n,e){return n.type.checkContent(e),n.copy(e)}function gE(n,e,t,r,i){let o=n.depth>i&&i6(n,e,i+1),s=r.depth>i&&i6(t,r,i+1),a=[];return w2(null,n,i,a),o&&s&&e.index(i)==t.index(i)?(mE(o,s),Ja(el(o,gE(n,e,t,r,i+1)),a)):(o&&Ja(el(o,Cm(n,e,i+1)),a),w2(e,t,i,a),s&&Ja(el(s,Cm(t,r,i+1)),a)),w2(r,null,i,a),new G(a)}function Cm(n,e,t){let r=[];if(w2(null,n,t,r),n.depth>t){let i=i6(n,e,t+1);Ja(el(i,Cm(n,e,t+1)),r)}return w2(e,null,t,r),new G(r)}function cK(n,e){let t=e.depth-n.openStart,i=e.node(t).copy(n.content);for(let o=t-1;o>=0;o--)i=e.node(o).copy(G.from(i));return{start:i.resolveNoCache(n.openStart+t),end:i.resolveNoCache(i.content.size-n.openEnd-t)}}class v2{constructor(e,t,r){this.pos=e,this.path=t,this.parentOffset=r,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(t);return r?e.child(t).cut(r):i}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let r=this.path[t*3],i=t==0?0:this.path[t*3-1]+1;for(let o=0;o<e;o++)i+=r.child(o).nodeSize;return i}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return We.none;if(this.textOffset)return e.child(t).marks;let r=e.maybeChild(t-1),i=e.maybeChild(t);if(!r){let a=r;r=i,i=a}let o=r.marks;for(var s=0;s<o.length;s++)o[s].type.spec.inclusive===!1&&(!i||!o[s].isInSet(i.marks))&&(o=o[s--].removeFromSet(o));return o}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let r=t.marks,i=e.parent.maybeChild(e.index());for(var o=0;o<r.length;o++)r[o].type.spec.inclusive===!1&&(!i||!r[o].isInSet(i.marks))&&(r=r[o--].removeFromSet(r));return r}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!t||t(this.node(r))))return new km(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let r=[],i=0,o=t;for(let s=e;;){let{index:a,offset:c}=s.content.findIndex(o),u=o-c;if(r.push(s,a,i+c),!u||(s=s.child(a),s.isText))break;o=u-1,i+=c+1}return new v2(t,r,o)}static resolveCached(e,t){for(let i=0;i<o6.length;i++){let o=o6[i];if(o.pos==t&&o.doc==e)return o}let r=o6[s6]=v2.resolve(e,t);return s6=(s6+1)%uK,r}}let o6=[],s6=0,uK=12;class km{constructor(e,t,r){this.$from=e,this.$to=t,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const dK=Object.create(null);let tl=class a8{constructor(e,t,r,i=We.none){this.type=e,this.attrs=t,this.marks=i,this.content=r||G.empty}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,r,i=0){this.content.nodesBetween(e,t,r,i,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,t,r,i){return this.content.textBetween(e,t,r,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,r){return this.type==e&&wm(this.attrs,t||e.defaultAttrs||dK)&&We.sameSet(this.marks,r||We.none)}copy(e=null){return e==this.content?this:new a8(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new a8(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,r=!1){if(e==t)return te.empty;let i=this.resolve(e),o=this.resolve(t),s=r?0:i.sharedDepth(t),a=i.start(s),u=i.node(s).content.cut(i.pos-a,o.pos-a);return new te(u,i.depth-s,o.depth-s)}replace(e,t,r){return lK(this.resolve(e),this.resolve(t),r)}nodeAt(e){for(let t=this;;){let{index:r,offset:i}=t.content.findIndex(e);if(t=t.maybeChild(r),!t)return null;if(i==e||t.isText)return t;e-=i+1}}childAfter(e){let{index:t,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(t),index:t,offset:r};let i=this.content.child(t-1);return{node:i,index:t-1,offset:r-i.nodeSize}}resolve(e){return v2.resolveCached(this,e)}resolveNoCache(e){return v2.resolve(this,e)}rangeHasMark(e,t,r){let i=!1;return t>e&&this.nodesBetween(e,t,o=>(r.isInSet(o.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),yE(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,r=G.empty,i=0,o=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,i,o),a=s&&s.matchFragment(this.content,t);if(!a||!a.validEnd)return!1;for(let c=i;c<o;c++)if(!this.type.allowsMarks(r.child(c).marks))return!1;return!0}canReplaceWith(e,t,r,i){if(i&&!this.type.allowsMarks(i))return!1;let o=this.contentMatchAt(e).matchType(r),s=o&&o.matchFragment(this.content,t);return s?s.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content);let e=We.none;for(let t=0;t<this.marks.length;t++)e=this.marks[t].addToSet(e);if(!We.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let r=null;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,r)}let i=G.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,i,r)}};tl.prototype.text=void 0;class Sm extends tl{constructor(e,t,r,i){if(super(e,t,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):yE(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Sm(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Sm(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function yE(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}class nl{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let r=new fK(e,t);if(r.next==null)return nl.empty;let i=bE(r);r.next&&r.err("Unexpected trailing text");let o=wK(bK(i));return vK(o,r),o}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,r=e.childCount){let i=this;for(let o=t;i&&o<r;o++)i=i.matchType(e.child(o).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let r=0;r<e.next.length;r++)if(this.next[t].type==e.next[r].type)return!0;return!1}fillBefore(e,t=!1,r=0){let i=[this];function o(s,a){let c=s.matchFragment(e,r);if(c&&(!t||c.validEnd))return G.from(a.map(u=>u.createAndFill()));for(let u=0;u<s.next.length;u++){let{type:d,next:f}=s.next[u];if(!(d.isText||d.hasRequiredAttrs())&&i.indexOf(f)==-1){i.push(f);let h=o(f,a.concat(d));if(h)return h}}return null}return o(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),o=i.match;if(o.matchType(e)){let s=[];for(let a=i;a.type;a=a.via)s.push(a.type);return s.reverse()}for(let s=0;s<o.next.length;s++){let{type:a,next:c}=o.next[s];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in t)&&(!i.type||c.validEnd)&&(r.push({match:a.contentMatch,type:a,via:i}),t[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(r){e.push(r);for(let i=0;i<r.next.length;i++)e.indexOf(r.next[i].next)==-1&&t(r.next[i].next)}return t(this),e.map((r,i)=>{let o=i+(r.validEnd?"*":" ")+" ";for(let s=0;s<r.next.length;s++)o+=(s?", ":"")+r.next[s].type.name+"->"+e.indexOf(r.next[s].next);return o}).join(`
|
|
131
|
+
`)){const r=document.createElement("div");r.append(t?document.createTextNode(t):document.createElement("br")),this.editorDiv.append(r)}},py=new WeakSet,VN=function(){return g(this,lr).replaceAll(" "," ")},o1=new WeakSet,Bv=function(t){return t.replaceAll(" "," ")},my=new WeakSet,jN=function(t){const{value:r,fontSize:i,color:o,pageIndex:s}=g(this,Ou);return this._hasBeenMoved||t.value!==r||t.fontSize!==i||t.color.some((a,c)=>a!==o[c])||t.pageIndex!==s},M(Qe,Nu),M(Qe,o1),pe(Qe,"_freeTextDefaultContent",""),pe(Qe,"_internalPadding",0),pe(Qe,"_defaultColor",null),pe(Qe,"_defaultFontSize",10),pe(Qe,"_type","freetext"),pe(Qe,"_editorType",Te.FREETEXT);let q4=Qe;class rE{constructor(e,t=0,r=0,i=!0){M(this,gy);M(this,_u);M(this,yy);M(this,by);M(this,a1);M(this,s1,void 0);M(this,pa,[]);M(this,oi,[]);let o=1/0,s=-1/0,a=1/0,c=-1/0;const u=10**-4;for(const{x:b,y:w,width:v,height:k}of e){const C=Math.floor((b-t)/u)*u,T=Math.ceil((b+v+t)/u)*u,S=Math.floor((w-t)/u)*u,A=Math.ceil((w+k+t)/u)*u,O=[C,S,A,!0],I=[T,S,A,!1];g(this,pa).push(O,I),o=Math.min(o,C),s=Math.max(s,T),a=Math.min(a,S),c=Math.max(c,A)}const d=s-o+2*r,f=c-a+2*r,h=o-r,p=a-r,m=g(this,pa).at(i?-1:-2),y=[m[0],m[2]];for(const b of g(this,pa)){const[w,v,k]=b;b[0]=(w-h)/d,b[1]=(v-p)/f,b[2]=(k-p)/f}E(this,s1,{x:h,y:p,width:d,height:f,lastPoint:y})}getOutlines(){g(this,pa).sort((t,r)=>t[0]-r[0]||t[1]-r[1]||t[2]-r[2]);const e=[];for(const t of g(this,pa))t[3]?(e.push(...x(this,a1,Rv).call(this,t)),x(this,yy,HN).call(this,t)):(x(this,by,UN).call(this,t),e.push(...x(this,a1,Rv).call(this,t)));return x(this,gy,zN).call(this,e)}}s1=new WeakMap,pa=new WeakMap,oi=new WeakMap,gy=new WeakSet,zN=function(e){const t=[],r=new Set;for(const s of e){const[a,c,u]=s;t.push([a,c,s],[a,u,s])}t.sort((s,a)=>s[1]-a[1]||s[0]-a[0]);for(let s=0,a=t.length;s<a;s+=2){const c=t[s][2],u=t[s+1][2];c.push(u),u.push(c),r.add(c),r.add(u)}const i=[];let o;for(;r.size>0;){const s=r.values().next().value;let[a,c,u,d,f]=s;r.delete(s);let h=a,p=c;for(o=[a,u],i.push(o);;){let m;if(r.has(d))m=d;else{if(!r.has(f))break;m=f}r.delete(m),[a,c,u,d,f]=m,h!==a&&(o.push(h,p,a,p===c?c:u),h=a),p=p===c?u:c}o.push(h,p)}return new cW(i,g(this,s1))},_u=new WeakSet,m5=function(e){const t=g(this,oi);let r=0,i=t.length-1;for(;r<=i;){const o=r+i>>1,s=t[o][0];if(s===e)return o;s<e?r=o+1:i=o-1}return i+1},yy=new WeakSet,HN=function([,e,t]){const r=x(this,_u,m5).call(this,e);g(this,oi).splice(r,0,[e,t])},by=new WeakSet,UN=function([,e,t]){const r=x(this,_u,m5).call(this,e);for(let i=r;i<g(this,oi).length;i++){const[o,s]=g(this,oi)[i];if(o!==e)break;if(o===e&&s===t){g(this,oi).splice(i,1);return}}for(let i=r-1;i>=0;i--){const[o,s]=g(this,oi)[i];if(o!==e)break;if(o===e&&s===t){g(this,oi).splice(i,1);return}}},a1=new WeakSet,Rv=function(e){const[t,r,i]=e,o=[[t,r,i]],s=x(this,_u,m5).call(this,i);for(let a=0;a<s;a++){const[c,u]=g(this,oi)[a];for(let d=0,f=o.length;d<f;d++){const[,h,p]=o[d];if(!(u<=h||p<=c))if(h>=c)if(p>u)o[d][1]=u;else{if(f===1)return[];o.splice(d,1),d--,f--}else o[d][2]=c,p>u&&o.push([t,u,p])}}return o};class iE{toSVGPath(){throw new Error("Abstract method `toSVGPath` must be implemented.")}get box(){throw new Error("Abstract getter `box` must be implemented.")}serialize(e,t){throw new Error("Abstract method `serialize` must be implemented.")}get free(){return this instanceof G4}}class cW extends iE{constructor(t,r){super();M(this,l1,void 0);M(this,Lu,void 0);E(this,Lu,t),E(this,l1,r)}toSVGPath(){const t=[];for(const r of g(this,Lu)){let[i,o]=r;t.push(`M${i} ${o}`);for(let s=2;s<r.length;s+=2){const a=r[s],c=r[s+1];a===i?(t.push(`V${c}`),o=c):c===o&&(t.push(`H${a}`),i=a)}t.push("Z")}return t.join(" ")}serialize([t,r,i,o],s){const a=[],c=i-t,u=o-r;for(const d of g(this,Lu)){const f=new Array(d.length);for(let h=0;h<d.length;h+=2)f[h]=t+d[h]*c,f[h+1]=o-d[h+1]*u;a.push(f)}return a}get box(){return g(this,l1)}}l1=new WeakMap,Lu=new WeakMap;const Fo=class Fo{constructor({x:e,y:t},r,i,o,s,a=0){M(this,f1);M(this,Hi,void 0);M(this,$o,[]);M(this,Bu,void 0);M(this,Ru,void 0);M(this,Ui,[]);M(this,xe,new Float64Array(18));M(this,h0,void 0);M(this,p0,void 0);M(this,c1,void 0);M(this,u1,void 0);M(this,$u,void 0);M(this,Fu,void 0);M(this,ma,[]);E(this,Hi,r),E(this,Fu,o*i),E(this,Ru,s),g(this,xe).set([NaN,NaN,NaN,NaN,e,t],6),E(this,Bu,a),E(this,u1,g(Fo,d1)*i),E(this,c1,g(Fo,vy)*i),E(this,$u,i),g(this,ma).push(e,t)}get free(){return!0}isEmpty(){return isNaN(g(this,xe)[8])}add({x:e,y:t}){var A;E(this,h0,e),E(this,p0,t);const[r,i,o,s]=g(this,Hi);let[a,c,u,d]=g(this,xe).subarray(8,12);const f=e-u,h=t-d,p=Math.hypot(f,h);if(p<g(this,c1))return!1;const m=p-g(this,u1),y=m/p,b=y*f,w=y*h;let v=a,k=c;a=u,c=d,u+=b,d+=w,(A=g(this,ma))==null||A.push(e,t);const C=b/m,T=-w/m*g(this,Fu),S=C*g(this,Fu);return g(this,xe).set(g(this,xe).subarray(2,8),0),g(this,xe).set([u+T,d+S],4),g(this,xe).set(g(this,xe).subarray(14,18),12),g(this,xe).set([u-T,d-S],16),isNaN(g(this,xe)[6])?(g(this,Ui).length===0&&(g(this,xe).set([a+T,c+S],2),g(this,Ui).push(NaN,NaN,NaN,NaN,(a+T-r)/o,(c+S-i)/s),g(this,xe).set([a-T,c-S],14),g(this,$o).push(NaN,NaN,NaN,NaN,(a-T-r)/o,(c-S-i)/s)),g(this,xe).set([v,k,a,c,u,d],6),!this.isEmpty()):(g(this,xe).set([v,k,a,c,u,d],6),Math.abs(Math.atan2(k-c,v-a)-Math.atan2(w,b))<Math.PI/2?([a,c,u,d]=g(this,xe).subarray(2,6),g(this,Ui).push(NaN,NaN,NaN,NaN,((a+u)/2-r)/o,((c+d)/2-i)/s),[a,c,v,k]=g(this,xe).subarray(14,18),g(this,$o).push(NaN,NaN,NaN,NaN,((v+a)/2-r)/o,((k+c)/2-i)/s),!0):([v,k,a,c,u,d]=g(this,xe).subarray(0,6),g(this,Ui).push(((v+5*a)/6-r)/o,((k+5*c)/6-i)/s,((5*a+u)/6-r)/o,((5*c+d)/6-i)/s,((a+u)/2-r)/o,((c+d)/2-i)/s),[u,d,a,c,v,k]=g(this,xe).subarray(12,18),g(this,$o).push(((v+5*a)/6-r)/o,((k+5*c)/6-i)/s,((5*a+u)/6-r)/o,((5*c+d)/6-i)/s,((a+u)/2-r)/o,((c+d)/2-i)/s),!0))}toSVGPath(){if(this.isEmpty())return"";const e=g(this,Ui),t=g(this,$o),r=g(this,xe).subarray(4,6),i=g(this,xe).subarray(16,18),[o,s,a,c]=g(this,Hi),[u,d,f,h]=x(this,f1,$v).call(this);if(isNaN(g(this,xe)[6])&&!this.isEmpty())return`M${(g(this,xe)[2]-o)/a} ${(g(this,xe)[3]-s)/c} L${(g(this,xe)[4]-o)/a} ${(g(this,xe)[5]-s)/c} L${u} ${d} L${f} ${h} L${(g(this,xe)[16]-o)/a} ${(g(this,xe)[17]-s)/c} L${(g(this,xe)[14]-o)/a} ${(g(this,xe)[15]-s)/c} Z`;const p=[];p.push(`M${e[4]} ${e[5]}`);for(let m=6;m<e.length;m+=6)isNaN(e[m])?p.push(`L${e[m+4]} ${e[m+5]}`):p.push(`C${e[m]} ${e[m+1]} ${e[m+2]} ${e[m+3]} ${e[m+4]} ${e[m+5]}`);p.push(`L${(r[0]-o)/a} ${(r[1]-s)/c} L${u} ${d} L${f} ${h} L${(i[0]-o)/a} ${(i[1]-s)/c}`);for(let m=t.length-6;m>=6;m-=6)isNaN(t[m])?p.push(`L${t[m+4]} ${t[m+5]}`):p.push(`C${t[m]} ${t[m+1]} ${t[m+2]} ${t[m+3]} ${t[m+4]} ${t[m+5]}`);return p.push(`L${t[4]} ${t[5]} Z`),p.join(" ")}getOutlines(){var w;const e=g(this,Ui),t=g(this,$o),r=g(this,xe),i=r.subarray(4,6),o=r.subarray(16,18),[s,a,c,u]=g(this,Hi),d=new Float64Array((((w=g(this,ma))==null?void 0:w.length)??0)+2);for(let v=0,k=d.length-2;v<k;v+=2)d[v]=(g(this,ma)[v]-s)/c,d[v+1]=(g(this,ma)[v+1]-a)/u;d[d.length-2]=(g(this,h0)-s)/c,d[d.length-1]=(g(this,p0)-a)/u;const[f,h,p,m]=x(this,f1,$v).call(this);if(isNaN(r[6])&&!this.isEmpty()){const v=new Float64Array(36);return v.set([NaN,NaN,NaN,NaN,(r[2]-s)/c,(r[3]-a)/u,NaN,NaN,NaN,NaN,(r[4]-s)/c,(r[5]-a)/u,NaN,NaN,NaN,NaN,f,h,NaN,NaN,NaN,NaN,p,m,NaN,NaN,NaN,NaN,(r[16]-s)/c,(r[17]-a)/u,NaN,NaN,NaN,NaN,(r[14]-s)/c,(r[15]-a)/u],0),new G4(v,d,g(this,Hi),g(this,$u),g(this,Bu),g(this,Ru))}const y=new Float64Array(g(this,Ui).length+24+g(this,$o).length);let b=e.length;for(let v=0;v<b;v+=2)isNaN(e[v])?y[v]=y[v+1]=NaN:(y[v]=e[v],y[v+1]=e[v+1]);y.set([NaN,NaN,NaN,NaN,(i[0]-s)/c,(i[1]-a)/u,NaN,NaN,NaN,NaN,f,h,NaN,NaN,NaN,NaN,p,m,NaN,NaN,NaN,NaN,(o[0]-s)/c,(o[1]-a)/u],b),b+=24;for(let v=t.length-6;v>=6;v-=6)for(let k=0;k<6;k+=2)isNaN(t[v+k])?(y[b]=y[b+1]=NaN,b+=2):(y[b]=t[v+k],y[b+1]=t[v+k+1],b+=2);return y.set([NaN,NaN,NaN,NaN,t[4],t[5]],b),new G4(y,d,g(this,Hi),g(this,$u),g(this,Bu),g(this,Ru))}};Hi=new WeakMap,$o=new WeakMap,Bu=new WeakMap,Ru=new WeakMap,Ui=new WeakMap,xe=new WeakMap,h0=new WeakMap,p0=new WeakMap,c1=new WeakMap,u1=new WeakMap,$u=new WeakMap,Fu=new WeakMap,ma=new WeakMap,d1=new WeakMap,wy=new WeakMap,vy=new WeakMap,f1=new WeakSet,$v=function(){const e=g(this,xe).subarray(4,6),t=g(this,xe).subarray(16,18),[r,i,o,s]=g(this,Hi);return[(g(this,h0)+(e[0]-t[0])/2-r)/o,(g(this,p0)+(e[1]-t[1])/2-i)/s,(g(this,h0)+(t[0]-e[0])/2-r)/o,(g(this,p0)+(t[1]-e[1])/2-i)/s]},M(Fo,d1,8),M(Fo,wy,2),M(Fo,vy,g(Fo,d1)+g(Fo,wy));let mm=Fo;class G4 extends iE{constructor(t,r,i,o,s,a){super();M(this,g0);M(this,y0);M(this,Cy);M(this,Vu,void 0);M(this,m0,null);M(this,Vo,void 0);M(this,h1,void 0);M(this,ur,void 0);M(this,p1,void 0);M(this,bt,void 0);E(this,bt,t),E(this,ur,r),E(this,Vu,i),E(this,p1,o),E(this,Vo,s),E(this,h1,a),x(this,Cy,ZN).call(this,a);const{x:c,y:u,width:d,height:f}=g(this,m0);for(let h=0,p=t.length;h<p;h+=2)t[h]=(t[h]-c)/d,t[h+1]=(t[h+1]-u)/f;for(let h=0,p=r.length;h<p;h+=2)r[h]=(r[h]-c)/d,r[h+1]=(r[h+1]-u)/f}toSVGPath(){const t=[`M${g(this,bt)[4]} ${g(this,bt)[5]}`];for(let r=6,i=g(this,bt).length;r<i;r+=6)isNaN(g(this,bt)[r])?t.push(`L${g(this,bt)[r+4]} ${g(this,bt)[r+5]}`):t.push(`C${g(this,bt)[r]} ${g(this,bt)[r+1]} ${g(this,bt)[r+2]} ${g(this,bt)[r+3]} ${g(this,bt)[r+4]} ${g(this,bt)[r+5]}`);return t.push("Z"),t.join(" ")}serialize([t,r,i,o],s){const a=i-t,c=o-r;let u,d;switch(s){case 0:u=x(this,g0,ep).call(this,g(this,bt),t,o,a,-c),d=x(this,g0,ep).call(this,g(this,ur),t,o,a,-c);break;case 90:u=x(this,y0,tp).call(this,g(this,bt),t,r,a,c),d=x(this,y0,tp).call(this,g(this,ur),t,r,a,c);break;case 180:u=x(this,g0,ep).call(this,g(this,bt),i,r,-a,c),d=x(this,g0,ep).call(this,g(this,ur),i,r,-a,c);break;case 270:u=x(this,y0,tp).call(this,g(this,bt),i,o,-a,-c),d=x(this,y0,tp).call(this,g(this,ur),i,o,-a,-c)}return{outline:Array.from(u),points:[Array.from(d)]}}get box(){return g(this,m0)}getNewOutline(t,r){const{x:i,y:o,width:s,height:a}=g(this,m0),[c,u,d,f]=g(this,Vu),h=s*d,p=a*f,m=i*d+c,y=o*f+u,b=new mm({x:g(this,ur)[0]*h+m,y:g(this,ur)[1]*p+y},g(this,Vu),g(this,p1),t,g(this,h1),r??g(this,Vo));for(let w=2;w<g(this,ur).length;w+=2)b.add({x:g(this,ur)[w]*h+m,y:g(this,ur)[w+1]*p+y});return b.getOutlines()}}Vu=new WeakMap,m0=new WeakMap,Vo=new WeakMap,h1=new WeakMap,ur=new WeakMap,p1=new WeakMap,bt=new WeakMap,g0=new WeakSet,ep=function(t,r,i,o,s){const a=new Float64Array(t.length);for(let c=0,u=t.length;c<u;c+=2)a[c]=r+t[c]*o,a[c+1]=i+t[c+1]*s;return a},y0=new WeakSet,tp=function(t,r,i,o,s){const a=new Float64Array(t.length);for(let c=0,u=t.length;c<u;c+=2)a[c]=r+t[c+1]*o,a[c+1]=i+t[c]*s;return a},Cy=new WeakSet,ZN=function(t){const r=g(this,bt);let i=r[4],o=r[5],s=i,a=o,c=i,u=o,d=i,f=o;const h=t?Math.max:Math.min;for(let w=6,v=r.length;w<v;w+=6){if(isNaN(r[w]))s=Math.min(s,r[w+4]),a=Math.min(a,r[w+5]),c=Math.max(c,r[w+4]),u=Math.max(u,r[w+5]),f<r[w+5]?(d=r[w+4],f=r[w+5]):f===r[w+5]&&(d=h(d,r[w+4]));else{const k=se.bezierBoundingBox(i,o,...r.slice(w,w+6));s=Math.min(s,k[0]),a=Math.min(a,k[1]),c=Math.max(c,k[2]),u=Math.max(u,k[3]),f<k[3]?(d=k[2],f=k[3]):f===k[3]&&(d=h(d,k[2]))}i=r[w+4],o=r[w+5]}const p=s-g(this,Vo),m=a-g(this,Vo),y=c-s+2*g(this,Vo),b=u-a+2*g(this,Vo);E(this,m0,{x:p,y:m,width:y,height:b,lastPoint:[d,f]})};const zo=class zo{constructor({editor:e=null,uiManager:t=null}){M(this,v1);M(this,C1);M(this,ky);M(this,jo);M(this,Sy);M(this,Zi);M(this,m1,x(this,ky,WN).bind(this));M(this,g1,x(this,Sy,KN).bind(this));M(this,si,null);M(this,b0,null);M(this,ju,void 0);M(this,Dt,null);M(this,y1,!1);M(this,zu,!1);M(this,b1,null);M(this,w1,void 0);M(this,ai,null);M(this,Hu,void 0);var r;e?(E(this,zu,!1),E(this,Hu,he.HIGHLIGHT_COLOR),E(this,b1,e)):(E(this,zu,!0),E(this,Hu,he.HIGHLIGHT_DEFAULT_COLOR)),E(this,ai,(e==null?void 0:e._uiManager)||t),E(this,w1,g(this,ai)._eventBus),E(this,ju,(e==null?void 0:e.color)||((r=g(this,ai))==null?void 0:r.highlightColors.values().next().value)||"#FFFF98")}static get _keyboardManager(){return Ie(this,"_keyboardManager",new u2([[["Escape","mac+Escape"],zo.prototype._hideDropdownFromKeyboard],[[" ","mac+ "],zo.prototype._colorSelectFromKeyboard],[["ArrowDown","ArrowRight","mac+ArrowDown","mac+ArrowRight"],zo.prototype._moveToNext],[["ArrowUp","ArrowLeft","mac+ArrowUp","mac+ArrowLeft"],zo.prototype._moveToPrevious],[["Home","mac+Home"],zo.prototype._moveToBeginning],[["End","mac+End"],zo.prototype._moveToEnd]]))}renderButton(){const e=E(this,si,document.createElement("button"));e.className="colorPicker",e.tabIndex="0",e.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-button"),e.setAttribute("aria-haspopup",!0);const t=g(this,ai)._signal;e.addEventListener("click",x(this,jo,R0).bind(this),{signal:t}),e.addEventListener("keydown",g(this,m1),{signal:t});const r=E(this,b0,document.createElement("span"));return r.className="swatch",r.setAttribute("aria-hidden",!0),r.style.backgroundColor=g(this,ju),e.append(r),e}renderMainDropdown(){const e=E(this,Dt,x(this,v1,Fv).call(this));return e.setAttribute("aria-orientation","horizontal"),e.setAttribute("aria-labelledby","highlightColorPickerLabel"),e}_colorSelectFromKeyboard(e){if(e.target===g(this,si)){x(this,jo,R0).call(this,e);return}const t=e.target.getAttribute("data-color");t&&x(this,C1,Vv).call(this,t,e)}_moveToNext(e){var t,r;g(this,Zi,Oa)?e.target!==g(this,si)?(t=e.target.nextSibling)==null||t.focus():(r=g(this,Dt).firstChild)==null||r.focus():x(this,jo,R0).call(this,e)}_moveToPrevious(e){var t,r;e.target!==((t=g(this,Dt))==null?void 0:t.firstChild)&&e.target!==g(this,si)?(g(this,Zi,Oa)||x(this,jo,R0).call(this,e),(r=e.target.previousSibling)==null||r.focus()):g(this,Zi,Oa)&&this._hideDropdownFromKeyboard()}_moveToBeginning(e){var t;g(this,Zi,Oa)?(t=g(this,Dt).firstChild)==null||t.focus():x(this,jo,R0).call(this,e)}_moveToEnd(e){var t;g(this,Zi,Oa)?(t=g(this,Dt).lastChild)==null||t.focus():x(this,jo,R0).call(this,e)}hideDropdown(){var e;(e=g(this,Dt))==null||e.classList.add("hidden"),window.removeEventListener("pointerdown",g(this,g1))}_hideDropdownFromKeyboard(){var e;g(this,zu)||(g(this,Zi,Oa)?(this.hideDropdown(),g(this,si).focus({preventScroll:!0,focusVisible:g(this,y1)})):(e=g(this,b1))==null||e.unselect())}updateColor(e){if(g(this,b0)&&(g(this,b0).style.backgroundColor=e),!g(this,Dt))return;const t=g(this,ai).highlightColors.values();for(const r of g(this,Dt).children)r.setAttribute("aria-selected",t.next().value===e)}destroy(){var e,t;(e=g(this,si))==null||e.remove(),E(this,si,null),E(this,b0,null),(t=g(this,Dt))==null||t.remove(),E(this,Dt,null)}};m1=new WeakMap,g1=new WeakMap,si=new WeakMap,b0=new WeakMap,ju=new WeakMap,Dt=new WeakMap,y1=new WeakMap,zu=new WeakMap,b1=new WeakMap,w1=new WeakMap,ai=new WeakMap,Hu=new WeakMap,v1=new WeakSet,Fv=function(){const e=document.createElement("div"),t=g(this,ai)._signal;e.addEventListener("contextmenu",br,{signal:t}),e.className="dropdown",e.role="listbox",e.setAttribute("aria-multiselectable",!1),e.setAttribute("aria-orientation","vertical"),e.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-dropdown");for(const[r,i]of g(this,ai).highlightColors){const o=document.createElement("button");o.tabIndex="0",o.role="option",o.setAttribute("data-color",i),o.title=r,o.setAttribute("data-l10n-id",`pdfjs-editor-colorpicker-${r}`);const s=document.createElement("span");o.append(s),s.className="swatch",s.style.backgroundColor=i,o.setAttribute("aria-selected",i===g(this,ju)),o.addEventListener("click",x(this,C1,Vv).bind(this,i),{signal:t}),e.append(o)}return e.addEventListener("keydown",g(this,m1),{signal:t}),e},C1=new WeakSet,Vv=function(e,t){t.stopPropagation(),g(this,w1).dispatch("switchannotationeditorparams",{source:this,type:g(this,Hu),value:e})},ky=new WeakSet,WN=function(e){zo._keyboardManager.exec(this,e)},jo=new WeakSet,R0=function(e){if(g(this,Zi,Oa)){this.hideDropdown();return}if(E(this,y1,e.detail===0),window.addEventListener("pointerdown",g(this,g1),{signal:g(this,ai)._signal}),g(this,Dt)){g(this,Dt).classList.remove("hidden");return}const t=E(this,Dt,x(this,v1,Fv).call(this));g(this,si).append(t)},Sy=new WeakSet,KN=function(e){var t;(t=g(this,Dt))!=null&&t.contains(e.target)||this.hideDropdown()},Zi=new WeakSet,Oa=function(){return g(this,Dt)&&!g(this,Dt).classList.contains("hidden")};let gm=zo;const _e=class _e extends je{constructor(t){super({...t,name:"highlightEditor"});M(this,A1);M(this,T1);M(this,My);M(this,Ey);M(this,Ay);M(this,x1);M(this,k0);M(this,Ty);M(this,qu);M(this,S0);M(this,xy);M(this,Iy);M(this,Uu,null);M(this,k1,0);M(this,ga,void 0);M(this,w0,null);M(this,Zu,null);M(this,_r,null);M(this,S1,null);M(this,M1,0);M(this,v0,null);M(this,li,null);M(this,En,null);M(this,dr,!1);M(this,Wu,null);M(this,C0,void 0);M(this,Nt,null);M(this,Ku,"");M(this,Wi,void 0);M(this,E1,"");this.color=t.color||_e._defaultColor,E(this,Wi,t.thickness||_e._defaultThickness),E(this,C0,t.opacity||_e._defaultOpacity),E(this,ga,t.boxes||null),E(this,E1,t.methodOfCreation||""),E(this,Ku,t.text||""),this._isDraggable=!1,t.highlightId>-1?(E(this,dr,!0),x(this,T1,zv).call(this,t),x(this,k0,np).call(this)):(E(this,Uu,t.anchorNode),E(this,k1,t.anchorOffset),E(this,S1,t.focusNode),E(this,M1,t.focusOffset),x(this,A1,jv).call(this),x(this,k0,np).call(this),this.rotate(this.rotation))}static get _keyboardManager(){const t=_e.prototype;return Ie(this,"_keyboardManager",new u2([[["ArrowLeft","mac+ArrowLeft"],t._moveCaret,{args:[0]}],[["ArrowRight","mac+ArrowRight"],t._moveCaret,{args:[1]}],[["ArrowUp","mac+ArrowUp"],t._moveCaret,{args:[2]}],[["ArrowDown","mac+ArrowDown"],t._moveCaret,{args:[3]}]]))}get telemetryInitialData(){return{action:"added",type:g(this,dr)?"free_highlight":"highlight",color:this._uiManager.highlightColorNames.get(this.color),thickness:g(this,Wi),methodOfCreation:g(this,E1)}}get telemetryFinalData(){return{type:"highlight",color:this._uiManager.highlightColorNames.get(this.color)}}static computeTelemetryFinalData(t){return{numberOfColors:t.get("color").size}}static initialize(t,r){var i;je.initialize(t,r),_e._defaultColor||(_e._defaultColor=((i=r.highlightColors)==null?void 0:i.values().next().value)||"#fff066")}static updateDefaultParams(t,r){switch(t){case he.HIGHLIGHT_DEFAULT_COLOR:_e._defaultColor=r;break;case he.HIGHLIGHT_THICKNESS:_e._defaultThickness=r}}translateInPage(t,r){}get toolbarPosition(){return g(this,Wu)}updateParams(t,r){switch(t){case he.HIGHLIGHT_COLOR:x(this,My,qN).call(this,r);break;case he.HIGHLIGHT_THICKNESS:x(this,Ey,GN).call(this,r)}}static get defaultPropertiesToUpdate(){return[[he.HIGHLIGHT_DEFAULT_COLOR,_e._defaultColor],[he.HIGHLIGHT_THICKNESS,_e._defaultThickness]]}get propertiesToUpdate(){return[[he.HIGHLIGHT_COLOR,this.color||_e._defaultColor],[he.HIGHLIGHT_THICKNESS,g(this,Wi)||_e._defaultThickness],[he.HIGHLIGHT_FREE,g(this,dr)]]}async addEditToolbar(){const t=await super.addEditToolbar();return t?(this._uiManager.highlightColors&&(E(this,Zu,new gm({editor:this})),t.addColorPicker(g(this,Zu))),t):null}disableEditing(){super.disableEditing(),this.div.classList.toggle("disabled",!0)}enableEditing(){super.enableEditing(),this.div.classList.toggle("disabled",!1)}fixAndSetPosition(){return super.fixAndSetPosition(x(this,S0,rp).call(this))}getBaseTranslation(){return[0,0]}getRect(t,r){return super.getRect(t,r,x(this,S0,rp).call(this))}onceAdded(){this.parent.addUndoableEditor(this),this.div.focus()}remove(){x(this,x1,Hv).call(this),this._reportTelemetry({action:"deleted"}),super.remove()}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(x(this,k0,np).call(this),this.isAttachedToDOM||this.parent.add(this)))}setParent(t){var i;let r=!1;this.parent&&!t?x(this,x1,Hv).call(this):t&&(x(this,k0,np).call(this,t),r=!this.parent&&((i=this.div)==null?void 0:i.classList.contains("selectedEditor"))),super.setParent(t),this.show(this._isVisible),r&&this.select()}rotate(t){var o,s,a;const{drawLayer:r}=this.parent;let i;g(this,dr)?(t=(t-this.rotation+360)%360,i=x(o=_e,ya,md).call(o,g(this,li).box,t)):i=x(s=_e,ya,md).call(s,this,t),r.rotate(g(this,En),t),r.rotate(g(this,Nt),t),r.updateBox(g(this,En),i),r.updateBox(g(this,Nt),x(a=_e,ya,md).call(a,g(this,_r).box,t))}render(){if(this.div)return this.div;const t=super.render();g(this,Ku)&&(t.setAttribute("aria-label",g(this,Ku)),t.setAttribute("role","mark")),g(this,dr)?t.classList.add("free"):this.div.addEventListener("keydown",x(this,Ty,QN).bind(this),{signal:this._uiManager._signal});const r=E(this,v0,document.createElement("div"));t.append(r),r.setAttribute("aria-hidden","true"),r.className="internal",r.style.clipPath=g(this,w0);const[i,o]=this.parentDimensions;return this.setDims(this.width*i,this.height*o),am(this,g(this,v0),["pointerover","pointerleave"]),this.enableEditing(),t}pointerover(){this.parent.drawLayer.addClass(g(this,Nt),"hovered")}pointerleave(){this.parent.drawLayer.removeClass(g(this,Nt),"hovered")}_moveCaret(t){switch(this.parent.unselect(this),t){case 0:case 2:x(this,qu,g5).call(this,!0);break;case 1:case 3:x(this,qu,g5).call(this,!1)}}select(){var t,r;super.select(),g(this,Nt)&&((t=this.parent)==null||t.drawLayer.removeClass(g(this,Nt),"hovered"),(r=this.parent)==null||r.drawLayer.addClass(g(this,Nt),"selected"))}unselect(){var t;super.unselect(),g(this,Nt)&&((t=this.parent)==null||t.drawLayer.removeClass(g(this,Nt),"selected"),g(this,dr)||x(this,qu,g5).call(this,!1))}get _mustFixPosition(){return!g(this,dr)}show(t=this._isVisible){super.show(t),this.parent&&(this.parent.drawLayer.show(g(this,En),t),this.parent.drawLayer.show(g(this,Nt),t))}static startHighlighting(t,r,{target:i,x:o,y:s}){const{x:a,y:c,width:u,height:d}=i.getBoundingClientRect(),f=new AbortController,h=t.combinedSignal(f),p=m=>{f.abort(),x(this,Dy,tP).call(this,t,m)};window.addEventListener("blur",p,{signal:h}),window.addEventListener("pointerup",p,{signal:h}),window.addEventListener("pointerdown",m=>{m.preventDefault(),m.stopPropagation()},{capture:!0,passive:!1,signal:h}),window.addEventListener("contextmenu",br,{signal:h}),i.addEventListener("pointermove",x(this,Oy,eP).bind(this,t),{signal:h}),this._freeHighlight=new mm({x:o,y:s},[a,c,u,d],t.scale,this._defaultThickness/2,r,.001),{id:this._freeHighlightId,clipPathId:this._freeHighlightClipId}=t.drawLayer.highlight(this._freeHighlight,this._defaultColor,this._defaultOpacity,!0)}static deserialize(t,r,i){var y;const o=super.deserialize(t,r,i),{rect:[s,a,c,u],color:d,quadPoints:f}=t;o.color=se.makeHexColor(...d),E(o,C0,t.opacity);const[h,p]=o.pageDimensions;o.width=(c-s)/h,o.height=(u-a)/p;const m=E(o,ga,[]);for(let b=0;b<f.length;b+=8)m.push({x:(f[4]-c)/h,y:(u-(1-f[b+5]))/p,width:(f[b+2]-f[b])/h,height:(f[b+5]-f[b+1])/p});return x(y=o,A1,jv).call(y),o}serialize(t=!1){if(this.isEmpty()||t)return null;const r=this.getRect(0,0),i=je._colorManager.convert(this.color);return{annotationType:Te.HIGHLIGHT,color:i,opacity:g(this,C0),thickness:g(this,Wi),quadPoints:x(this,xy,XN).call(this),outlines:x(this,Iy,JN).call(this,r),pageIndex:this.pageIndex,rect:r,rotation:x(this,S0,rp).call(this),structTreeParentId:this._structTreeParentId}}static canCreateNewEmptyEditor(){return!1}};Uu=new WeakMap,k1=new WeakMap,ga=new WeakMap,w0=new WeakMap,Zu=new WeakMap,_r=new WeakMap,S1=new WeakMap,M1=new WeakMap,v0=new WeakMap,li=new WeakMap,En=new WeakMap,dr=new WeakMap,Wu=new WeakMap,C0=new WeakMap,Nt=new WeakMap,Ku=new WeakMap,Wi=new WeakMap,E1=new WeakMap,A1=new WeakSet,jv=function(){const t=new rE(g(this,ga),.001);E(this,li,t.getOutlines()),{x:this.x,y:this.y,width:this.width,height:this.height}=g(this,li).box;const r=new rE(g(this,ga),.0025,.001,this._uiManager.direction==="ltr");E(this,_r,r.getOutlines());const{lastPoint:i}=g(this,_r).box;E(this,Wu,[(i[0]-this.x)/this.width,(i[1]-this.y)/this.height])},T1=new WeakSet,zv=function({highlightOutlines:t,highlightId:r,clipPathId:i}){var d,f;if(E(this,li,t),E(this,_r,t.getNewOutline(g(this,Wi)/2+1.5,.0025)),r>=0)E(this,En,r),E(this,w0,i),this.parent.drawLayer.finalizeLine(r,t),E(this,Nt,this.parent.drawLayer.highlightOutline(g(this,_r)));else if(this.parent){const h=this.parent.viewport.rotation;this.parent.drawLayer.updateLine(g(this,En),t),this.parent.drawLayer.updateBox(g(this,En),x(d=_e,ya,md).call(d,g(this,li).box,(h-this.rotation+360)%360)),this.parent.drawLayer.updateLine(g(this,Nt),g(this,_r)),this.parent.drawLayer.updateBox(g(this,Nt),x(f=_e,ya,md).call(f,g(this,_r).box,h))}const{x:o,y:s,width:a,height:c}=t.box;switch(this.rotation){case 0:this.x=o,this.y=s,this.width=a,this.height=c;break;case 90:{const[h,p]=this.parentDimensions;this.x=s,this.y=1-o,this.width=a*p/h,this.height=c*h/p;break}case 180:this.x=1-o,this.y=1-s,this.width=a,this.height=c;break;case 270:{const[h,p]=this.parentDimensions;this.x=1-s,this.y=o,this.width=a*p/h,this.height=c*h/p;break}}const{lastPoint:u}=g(this,_r).box;E(this,Wu,[(u[0]-o)/a,(u[1]-s)/c])},My=new WeakSet,qN=function(t){const r=o=>{var s,a;this.color=o,(s=this.parent)==null||s.drawLayer.changeColor(g(this,En),o),(a=g(this,Zu))==null||a.updateColor(o)},i=this.color;this.addCommands({cmd:r.bind(this,t),undo:r.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:he.HIGHLIGHT_COLOR,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"color_changed",color:this._uiManager.highlightColorNames.get(t)},!0)},Ey=new WeakSet,GN=function(t){const r=g(this,Wi),i=o=>{E(this,Wi,o),x(this,Ay,YN).call(this,o)};this.addCommands({cmd:i.bind(this,t),undo:i.bind(this,r),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:he.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"thickness_changed",thickness:t},!0)},Ay=new WeakSet,YN=function(t){if(!g(this,dr))return;x(this,T1,zv).call(this,{highlightOutlines:g(this,li).getNewOutline(t/2)}),this.fixAndSetPosition();const[r,i]=this.parentDimensions;this.setDims(this.width*r,this.height*i)},x1=new WeakSet,Hv=function(){g(this,En)!==null&&this.parent&&(this.parent.drawLayer.remove(g(this,En)),E(this,En,null),this.parent.drawLayer.remove(g(this,Nt)),E(this,Nt,null))},k0=new WeakSet,np=function(t=this.parent){g(this,En)===null&&({id:qn(this,En)._,clipPathId:qn(this,w0)._}=t.drawLayer.highlight(g(this,li),this.color,g(this,C0)),E(this,Nt,t.drawLayer.highlightOutline(g(this,_r))),g(this,v0)&&(g(this,v0).style.clipPath=g(this,w0)))},ya=new WeakSet,md=function({x:t,y:r,width:i,height:o},s){switch(s){case 90:return{x:1-r-o,y:t,width:o,height:i};case 180:return{x:1-t-i,y:1-r-o,width:i,height:o};case 270:return{x:r,y:1-t-i,width:o,height:i}}return{x:t,y:r,width:i,height:o}},Ty=new WeakSet,QN=function(t){_e._keyboardManager.exec(this,t)},qu=new WeakSet,g5=function(t){if(!g(this,Uu))return;const r=window.getSelection();t?r.setPosition(g(this,Uu),g(this,k1)):r.setPosition(g(this,S1),g(this,M1))},S0=new WeakSet,rp=function(){return g(this,dr)?this.rotation:0},xy=new WeakSet,XN=function(){if(g(this,dr))return null;const[t,r]=this.pageDimensions,[i,o]=this.pageTranslation,s=g(this,ga),a=new Float32Array(8*s.length);let c=0;for(const{x:u,y:d,width:f,height:h}of s){const p=u*t+i,m=(1-d-h)*r+o;a[c]=a[c+4]=p,a[c+1]=a[c+3]=m,a[c+2]=a[c+6]=p+f*t,a[c+5]=a[c+7]=m+h*r,c+=8}return a},Iy=new WeakSet,JN=function(t){return g(this,li).serialize(t,x(this,S0,rp).call(this))},Oy=new WeakSet,eP=function(t,r){this._freeHighlight.add(r)&&t.drawLayer.updatePath(this._freeHighlightId,this._freeHighlight)},Dy=new WeakSet,tP=function(t,r){this._freeHighlight.isEmpty()?t.drawLayer.removeFreeHighlight(this._freeHighlightId):t.createAndAddNewEditor(r,!1,{highlightId:this._freeHighlightId,highlightOutlines:this._freeHighlight.getOutlines(),clipPathId:this._freeHighlightClipId,methodOfCreation:"main_toolbar"}),this._freeHighlightId=-1,this._freeHighlight=null,this._freeHighlightClipId=""},M(_e,ya),M(_e,Oy),M(_e,Dy),pe(_e,"_defaultColor",null),pe(_e,"_defaultOpacity",1),pe(_e,"_defaultThickness",12),pe(_e,"_l10nPromise"),pe(_e,"_type","highlight"),pe(_e,"_editorType",Te.HIGHLIGHT),pe(_e,"_freeHighlightId",-1),pe(_e,"_freeHighlight",null),pe(_e,"_freeHighlightClipId","");let ym=_e;const Je=class Je extends je{constructor(t){super({...t,name:"inkEditor"});M(this,Ny);M(this,Py);M(this,_y);M(this,Ly);M(this,I1);M(this,By);M(this,O1);M(this,Ry);M(this,$y);M(this,Fy);M(this,Vy);M(this,jy);M(this,Zo);M(this,D1);M(this,N1);M(this,P1);M(this,Yu);M(this,Qu);M(this,wa);M(this,_1);M(this,Xu);M(this,Uy);M(this,B1);M(this,Ju);M(this,D0);M(this,M0,0);M(this,E0,0);M(this,Ki,null);M(this,Ho,new Path2D);M(this,Lr,!1);M(this,A0,null);M(this,T0,!1);M(this,x0,!1);M(this,Uo,null);M(this,Gu,null);M(this,I0,0);M(this,O0,0);M(this,ba,null);this.color=t.color||null,this.thickness=t.thickness||null,this.opacity=t.opacity||null,this.paths=[],this.bezierPath2D=[],this.allRawPaths=[],this.currentPath=[],this.scaleFactor=1,this.translationX=this.translationY=0,this.x=0,this.y=0,this._willKeepAspectRatio=!0}static initialize(t,r){je.initialize(t,r)}static updateDefaultParams(t,r){switch(t){case he.INK_THICKNESS:Je._defaultThickness=r;break;case he.INK_COLOR:Je._defaultColor=r;break;case he.INK_OPACITY:Je._defaultOpacity=r/100}}updateParams(t,r){switch(t){case he.INK_THICKNESS:x(this,Ny,nP).call(this,r);break;case he.INK_COLOR:x(this,Py,rP).call(this,r);break;case he.INK_OPACITY:x(this,_y,iP).call(this,r)}}static get defaultPropertiesToUpdate(){return[[he.INK_THICKNESS,Je._defaultThickness],[he.INK_COLOR,Je._defaultColor||je._defaultLineColor],[he.INK_OPACITY,Math.round(100*Je._defaultOpacity)]]}get propertiesToUpdate(){return[[he.INK_THICKNESS,this.thickness||Je._defaultThickness],[he.INK_COLOR,this.color||Je._defaultColor||je._defaultLineColor],[he.INK_OPACITY,Math.round(100*(this.opacity??Je._defaultOpacity))]]}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(this.canvas||(x(this,Yu,y5).call(this),x(this,Qu,b5).call(this)),this.isAttachedToDOM||(this.parent.add(this),x(this,wa,gd).call(this)),x(this,D0,ip).call(this)))}remove(){var t;this.canvas!==null&&(this.isEmpty()||this.commit(),this.canvas.width=this.canvas.height=0,this.canvas.remove(),this.canvas=null,g(this,Ki)&&(clearTimeout(g(this,Ki)),E(this,Ki,null)),(t=g(this,Uo))==null||t.disconnect(),E(this,Uo,null),super.remove())}setParent(t){!this.parent&&t?this._uiManager.removeShouldRescale(this):this.parent&&t===null&&this._uiManager.addShouldRescale(this),super.setParent(t)}onScaleChanging(){const[t,r]=this.parentDimensions,i=this.width*t,o=this.height*r;this.setDimensions(i,o)}enableEditMode(){!g(this,Lr)&&this.canvas!==null&&(super.enableEditMode(),this._isDraggable=!1,x(this,D1,Wv).call(this))}disableEditMode(){this.isInEditMode()&&this.canvas!==null&&(super.disableEditMode(),this._isDraggable=!this.isEmpty(),this.div.classList.remove("editing"),x(this,N1,Kv).call(this))}onceAdded(){this._isDraggable=!this.isEmpty()}isEmpty(){return this.paths.length===0||this.paths.length===1&&this.paths[0].length===0}commit(){g(this,Lr)||(super.commit(),this.isEditing=!1,this.disableEditMode(),this.setInForeground(),E(this,Lr,!0),this.div.classList.add("disabled"),x(this,D0,ip).call(this,!0),this.select(),this.parent.addInkEditorIfNeeded(!0),this.moveInDOM(),this.div.focus({preventScroll:!0}))}focusin(t){this._focusEventsAllowed&&(super.focusin(t),this.enableEditMode())}canvasPointerdown(t){t.button===0&&this.isInEditMode()&&!g(this,Lr)&&(this.setInForeground(),t.preventDefault(),this.div.contains(document.activeElement)||this.div.focus({preventScroll:!0}),x(this,By,sP).call(this,t.offsetX,t.offsetY))}canvasPointermove(t){t.preventDefault(),x(this,O1,Zv).call(this,t.offsetX,t.offsetY)}canvasPointerup(t){t.preventDefault(),x(this,P1,qv).call(this,t)}canvasPointerleave(t){x(this,P1,qv).call(this,t)}get isResizable(){return!this.isEmpty()&&g(this,Lr)}render(){if(this.div)return this.div;let t,r;this.width&&(t=this.x,r=this.y),super.render(),this.div.setAttribute("data-l10n-id","pdfjs-ink");const[i,o,s,a]=x(this,Ly,oP).call(this);if(this.setAt(i,o,0,0),this.setDims(s,a),x(this,Yu,y5).call(this),this.width){const[c,u]=this.parentDimensions;this.setAspectRatio(this.width*c,this.height*u),this.setAt(t*c,r*u,this.width*c,this.height*u),E(this,x0,!0),x(this,wa,gd).call(this),this.setDims(this.width*c,this.height*u),x(this,Zo,$0).call(this),this.div.classList.add("disabled")}else this.div.classList.add("editing"),this.enableEditMode();return x(this,Qu,b5).call(this),this.div}setDimensions(t,r){const i=Math.round(t),o=Math.round(r);if(g(this,I0)===i&&g(this,O0)===o)return;E(this,I0,i),E(this,O0,o),this.canvas.style.visibility="hidden";const[s,a]=this.parentDimensions;this.width=t/s,this.height=r/a,this.fixAndSetPosition(),g(this,Lr)&&x(this,_1,Gv).call(this,t,r),x(this,wa,gd).call(this),x(this,Zo,$0).call(this),this.canvas.style.visibility="visible",this.fixDims()}static deserialize(t,r,i){var b,w,v;if(t instanceof tE)return null;const o=super.deserialize(t,r,i);o.thickness=t.thickness,o.color=se.makeHexColor(...t.color),o.opacity=t.opacity;const[s,a]=o.pageDimensions,c=o.width*s,u=o.height*a,d=o.parentScale,f=t.thickness/2;E(o,Lr,!0),E(o,I0,Math.round(c)),E(o,O0,Math.round(u));const{paths:h,rect:p,rotation:m}=t;for(let{bezier:k}of h){k=x(b=Je,Hy,hP).call(b,k,p,m);const C=[];o.paths.push(C);let T=d*(k[0]-f),S=d*(k[1]-f);for(let O=2,I=k.length;O<I;O+=6){const P=d*(k[O]-f),D=d*(k[O+1]-f),_=d*(k[O+2]-f),B=d*(k[O+3]-f),F=d*(k[O+4]-f),R=d*(k[O+5]-f);C.push([[T,S],[P,D],[_,B],[F,R]]),T=F,S=R}const A=x(this,zy,fP).call(this,C);o.bezierPath2D.push(A)}const y=x(w=o,B1,Qv).call(w);return E(o,E0,Math.max(je.MIN_SIZE,y[2]-y[0])),E(o,M0,Math.max(je.MIN_SIZE,y[3]-y[1])),x(v=o,_1,Gv).call(v,c,u),o}serialize(){if(this.isEmpty())return null;const t=this.getRect(0,0),r=je._colorManager.convert(this.ctx.strokeStyle);return{annotationType:Te.INK,color:r,thickness:this.thickness,opacity:this.opacity,paths:x(this,Uy,pP).call(this,this.scaleFactor/this.parentScale,this.translationX,this.translationY,t),pageIndex:this.pageIndex,rect:t,rotation:this.rotation,structTreeParentId:this._structTreeParentId}}};M0=new WeakMap,E0=new WeakMap,Ki=new WeakMap,Ho=new WeakMap,Lr=new WeakMap,A0=new WeakMap,T0=new WeakMap,x0=new WeakMap,Uo=new WeakMap,Gu=new WeakMap,I0=new WeakMap,O0=new WeakMap,ba=new WeakMap,Ny=new WeakSet,nP=function(t){const r=o=>{this.thickness=o,x(this,D0,ip).call(this)},i=this.thickness;this.addCommands({cmd:r.bind(this,t),undo:r.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:he.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0})},Py=new WeakSet,rP=function(t){const r=o=>{this.color=o,x(this,Zo,$0).call(this)},i=this.color;this.addCommands({cmd:r.bind(this,t),undo:r.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:he.INK_COLOR,overwriteIfSameType:!0,keepUndo:!0})},_y=new WeakSet,iP=function(t){const r=o=>{this.opacity=o,x(this,Zo,$0).call(this)};t/=100;const i=this.opacity;this.addCommands({cmd:r.bind(this,t),undo:r.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:he.INK_OPACITY,overwriteIfSameType:!0,keepUndo:!0})},Ly=new WeakSet,oP=function(){const{parentRotation:t,parentDimensions:[r,i]}=this;switch(t){case 90:return[0,i,i,r];case 180:return[r,i,r,i];case 270:return[r,0,i,r];default:return[0,0,r,i]}},I1=new WeakSet,Uv=function(){const{ctx:t,color:r,opacity:i,thickness:o,parentScale:s,scaleFactor:a}=this;t.lineWidth=o*s/a,t.lineCap="round",t.lineJoin="round",t.miterLimit=10,t.strokeStyle=`${r}${function(u){return Math.round(Math.min(255,Math.max(1,255*u))).toString(16).padStart(2,"0")}(i)}`},By=new WeakSet,sP=function(t,r){this.canvas.addEventListener("contextmenu",br,{signal:this._uiManager._signal}),x(this,N1,Kv).call(this),E(this,A0,new AbortController);const i=this._uiManager.combinedSignal(g(this,A0));this.canvas.addEventListener("pointerleave",this.canvasPointerleave.bind(this),{signal:i}),this.canvas.addEventListener("pointermove",this.canvasPointermove.bind(this),{signal:i}),this.canvas.addEventListener("pointerup",this.canvasPointerup.bind(this),{signal:i}),this.isEditing=!0,g(this,x0)||(E(this,x0,!0),x(this,wa,gd).call(this),this.thickness||(this.thickness=Je._defaultThickness),this.color||(this.color=Je._defaultColor||je._defaultLineColor),this.opacity??(this.opacity=Je._defaultOpacity)),this.currentPath.push([t,r]),E(this,T0,!1),x(this,I1,Uv).call(this),E(this,ba,()=>{x(this,Fy,cP).call(this),g(this,ba)&&window.requestAnimationFrame(g(this,ba))}),window.requestAnimationFrame(g(this,ba))},O1=new WeakSet,Zv=function(t,r){const[i,o]=this.currentPath.at(-1);if(this.currentPath.length>1&&t===i&&r===o)return;const s=this.currentPath;let a=g(this,Ho);s.push([t,r]),E(this,T0,!0),s.length<=2?(a.moveTo(...s[0]),a.lineTo(t,r)):(s.length===3&&(E(this,Ho,a=new Path2D),a.moveTo(...s[0])),x(this,Vy,uP).call(this,a,...s.at(-3),...s.at(-2),t,r))},Ry=new WeakSet,aP=function(){if(this.currentPath.length===0)return;const t=this.currentPath.at(-1);g(this,Ho).lineTo(...t)},$y=new WeakSet,lP=function(t,r){E(this,ba,null),t=Math.min(Math.max(t,0),this.canvas.width),r=Math.min(Math.max(r,0),this.canvas.height),x(this,O1,Zv).call(this,t,r),x(this,Ry,aP).call(this);let i;if(this.currentPath.length!==1)i=x(this,jy,dP).call(this);else{const a=[t,r];i=[[a,a.slice(),a.slice(),a]]}const o=g(this,Ho),s=this.currentPath;this.currentPath=[],E(this,Ho,new Path2D),this.addCommands({cmd:()=>{this.allRawPaths.push(s),this.paths.push(i),this.bezierPath2D.push(o),this._uiManager.rebuild(this)},undo:()=>{this.allRawPaths.pop(),this.paths.pop(),this.bezierPath2D.pop(),this.paths.length===0?this.remove():(this.canvas||(x(this,Yu,y5).call(this),x(this,Qu,b5).call(this)),x(this,D0,ip).call(this))},mustExec:!0})},Fy=new WeakSet,cP=function(){if(!g(this,T0))return;E(this,T0,!1),Math.ceil(this.thickness*this.parentScale);const t=this.currentPath.slice(-3),r=t.map(s=>s[0]),i=t.map(s=>s[1]),{ctx:o}=(Math.min(...r),Math.max(...r),Math.min(...i),Math.max(...i),this);o.save(),o.clearRect(0,0,this.canvas.width,this.canvas.height);for(const s of this.bezierPath2D)o.stroke(s);o.stroke(g(this,Ho)),o.restore()},Vy=new WeakSet,uP=function(t,r,i,o,s,a,c){const u=(r+o)/2,d=(i+s)/2,f=(o+a)/2,h=(s+c)/2;t.bezierCurveTo(u+2*(o-u)/3,d+2*(s-d)/3,f+2*(o-f)/3,h+2*(s-h)/3,f,h)},jy=new WeakSet,dP=function(){const t=this.currentPath;if(t.length<=2)return[[t[0],t[0],t.at(-1),t.at(-1)]];const r=[];let i,[o,s]=t[0];for(i=1;i<t.length-2;i++){const[p,m]=t[i],[y,b]=t[i+1],w=(p+y)/2,v=(m+b)/2,k=[o+2*(p-o)/3,s+2*(m-s)/3],C=[w+2*(p-w)/3,v+2*(m-v)/3];r.push([[o,s],k,C,[w,v]]),[o,s]=[w,v]}const[a,c]=t[i],[u,d]=t[i+1],f=[o+2*(a-o)/3,s+2*(c-s)/3],h=[u+2*(a-u)/3,d+2*(c-d)/3];return r.push([[o,s],f,h,[u,d]]),r},Zo=new WeakSet,$0=function(){if(this.isEmpty()){x(this,Xu,w5).call(this);return}x(this,I1,Uv).call(this);const{canvas:t,ctx:r}=this;r.setTransform(1,0,0,1,0,0),r.clearRect(0,0,t.width,t.height),x(this,Xu,w5).call(this);for(const i of this.bezierPath2D)r.stroke(i)},D1=new WeakSet,Wv=function(){if(g(this,Gu))return;E(this,Gu,new AbortController);const t=this._uiManager.combinedSignal(g(this,Gu));this.canvas.addEventListener("pointerdown",this.canvasPointerdown.bind(this),{signal:t})},N1=new WeakSet,Kv=function(){var t;(t=this.pointerdownAC)==null||t.abort(),this.pointerdownAC=null},P1=new WeakSet,qv=function(t){var r;(r=g(this,A0))==null||r.abort(),E(this,A0,null),x(this,D1,Wv).call(this),g(this,Ki)&&clearTimeout(g(this,Ki)),E(this,Ki,setTimeout(()=>{E(this,Ki,null),this.canvas.removeEventListener("contextmenu",br)},10)),x(this,$y,lP).call(this,t.offsetX,t.offsetY),this.addToAnnotationStorage(),this.setInBackground()},Yu=new WeakSet,y5=function(){this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=0,this.canvas.className="inkEditorCanvas",this.canvas.setAttribute("data-l10n-id","pdfjs-ink-canvas"),this.div.append(this.canvas),this.ctx=this.canvas.getContext("2d")},Qu=new WeakSet,b5=function(){E(this,Uo,new ResizeObserver(t=>{const r=t[0].contentRect;r.width&&r.height&&this.setDimensions(r.width,r.height)})),g(this,Uo).observe(this.div),this._uiManager._signal.addEventListener("abort",()=>{var t;(t=g(this,Uo))==null||t.disconnect(),E(this,Uo,null)},{once:!0})},wa=new WeakSet,gd=function(){if(!g(this,x0))return;const[t,r]=this.parentDimensions;this.canvas.width=Math.ceil(this.width*t),this.canvas.height=Math.ceil(this.height*r),x(this,Xu,w5).call(this)},_1=new WeakSet,Gv=function(t,r){const i=x(this,Ju,v5).call(this),o=(t-i)/g(this,E0),s=(r-i)/g(this,M0);this.scaleFactor=Math.min(o,s)},Xu=new WeakSet,w5=function(){const t=x(this,Ju,v5).call(this)/2;this.ctx.setTransform(this.scaleFactor,0,0,this.scaleFactor,this.translationX*this.scaleFactor+t,this.translationY*this.scaleFactor+t)},zy=new WeakSet,fP=function(t){const r=new Path2D;for(let i=0,o=t.length;i<o;i++){const[s,a,c,u]=t[i];i===0&&r.moveTo(...s),r.bezierCurveTo(a[0],a[1],c[0],c[1],u[0],u[1])}return r},L1=new WeakSet,Yv=function(t,r,i){const[o,s,a,c]=r;switch(i){case 0:for(let u=0,d=t.length;u<d;u+=2)t[u]+=o,t[u+1]=c-t[u+1];break;case 90:for(let u=0,d=t.length;u<d;u+=2){const f=t[u];t[u]=t[u+1]+o,t[u+1]=f+s}break;case 180:for(let u=0,d=t.length;u<d;u+=2)t[u]=a-t[u],t[u+1]+=s;break;case 270:for(let u=0,d=t.length;u<d;u+=2){const f=t[u];t[u]=a-t[u+1],t[u+1]=c-f}break;default:throw new Error("Invalid rotation")}return t},Hy=new WeakSet,hP=function(t,r,i){const[o,s,a,c]=r;switch(i){case 0:for(let u=0,d=t.length;u<d;u+=2)t[u]-=o,t[u+1]=c-t[u+1];break;case 90:for(let u=0,d=t.length;u<d;u+=2){const f=t[u];t[u]=t[u+1]-s,t[u+1]=f-o}break;case 180:for(let u=0,d=t.length;u<d;u+=2)t[u]=a-t[u],t[u+1]-=s;break;case 270:for(let u=0,d=t.length;u<d;u+=2){const f=t[u];t[u]=c-t[u+1],t[u+1]=a-f}break;default:throw new Error("Invalid rotation")}return t},Uy=new WeakSet,pP=function(t,r,i,o){var d,f;const s=[],a=this.thickness/2,c=t*r+a,u=t*i+a;for(const h of this.paths){const p=[],m=[];for(let y=0,b=h.length;y<b;y++){const[w,v,k,C]=h[y];if(w[0]===C[0]&&w[1]===C[1]&&b===1){const B=t*w[0]+c,F=t*w[1]+u;p.push(B,F),m.push(B,F);break}const T=t*w[0]+c,S=t*w[1]+u,A=t*v[0]+c,O=t*v[1]+u,I=t*k[0]+c,P=t*k[1]+u,D=t*C[0]+c,_=t*C[1]+u;y===0&&(p.push(T,S),m.push(T,S)),p.push(A,O,I,P,D,_),m.push(A,O),y===b-1&&m.push(D,_)}s.push({bezier:x(d=Je,L1,Yv).call(d,p,o,this.rotation),points:x(f=Je,L1,Yv).call(f,m,o,this.rotation)})}return s},B1=new WeakSet,Qv=function(){let t=1/0,r=-1/0,i=1/0,o=-1/0;for(const s of this.paths)for(const[a,c,u,d]of s){const f=se.bezierBoundingBox(...a,...c,...u,...d);t=Math.min(t,f[0]),i=Math.min(i,f[1]),r=Math.max(r,f[2]),o=Math.max(o,f[3])}return[t,i,r,o]},Ju=new WeakSet,v5=function(){return g(this,Lr)?Math.ceil(this.thickness*this.parentScale):0},D0=new WeakSet,ip=function(t=!1){if(this.isEmpty())return;if(!g(this,Lr)){x(this,Zo,$0).call(this);return}const r=x(this,B1,Qv).call(this),i=x(this,Ju,v5).call(this);E(this,E0,Math.max(je.MIN_SIZE,r[2]-r[0])),E(this,M0,Math.max(je.MIN_SIZE,r[3]-r[1]));const o=Math.ceil(i+g(this,E0)*this.scaleFactor),s=Math.ceil(i+g(this,M0)*this.scaleFactor),[a,c]=this.parentDimensions;this.width=o/a,this.height=s/c,this.setAspectRatio(o,s);const u=this.translationX,d=this.translationY;this.translationX=-r[0],this.translationY=-r[1],x(this,wa,gd).call(this),x(this,Zo,$0).call(this),E(this,I0,o),E(this,O0,s),this.setDims(o,s);const f=t?i/this.scaleFactor/2:0;this.translate(u-this.translationX-f,d-this.translationY-f)},M(Je,zy),M(Je,L1),M(Je,Hy),pe(Je,"_defaultColor",null),pe(Je,"_defaultOpacity",1),pe(Je,"_defaultThickness",1),pe(Je,"_type","ink"),pe(Je,"_editorType",Te.INK);let Y4=Je;const j1=class j1 extends je{constructor(t){super({...t,name:"stampEditor"});M(this,N0);M(this,P0);M(this,td);M(this,$1);M(this,Zy);M(this,F1);M(this,V1);M(this,nd);M(this,Wy);M(this,wt,null);M(this,rn,null);M(this,va,null);M(this,Wo,null);M(this,Ca,null);M(this,ed,"");M(this,qi,null);M(this,Ko,null);M(this,Gi,null);M(this,Br,!1);M(this,R1,!1);E(this,Wo,t.bitmapUrl),E(this,Ca,t.bitmapFile)}static initialize(t,r){je.initialize(t,r)}static get supportedTypes(){return Ie(this,"supportedTypes",["apng","avif","bmp","gif","jpeg","png","svg+xml","webp","x-icon"].map(t=>`image/${t}`))}static get supportedTypesStr(){return Ie(this,"supportedTypesStr",this.supportedTypes.join(","))}static isHandlingMimeForPasting(t){return this.supportedTypes.includes(t)}static paste(t,r){r.pasteEditor(Te.STAMP,{bitmapFile:t.getAsFile()})}altTextFinish(){this._uiManager.useNewAltTextFlow&&(this.div.hidden=!1),super.altTextFinish()}get telemetryFinalData(){var t;return{type:"stamp",hasAltText:!!((t=this.altTextData)!=null&&t.altText)}}static computeTelemetryFinalData(t){const r=t.get("hasAltText");return{hasAltText:r.get(!0)??0,hasNoAltText:r.get(!1)??0}}async mlGuessAltText(t=null,r=!0){if(this.hasAltTextData())return null;const{mlManager:i}=this._uiManager;if(!i)throw new Error("No ML.");if(!await i.isEnabledFor("altText"))throw new Error("ML isn't enabled for alt text.");const{data:o,width:s,height:a}=t||this.copyCanvas(null,!0).imageData,c=await i.guess({name:"altText",request:{data:o,width:s,height:a,channels:o.length/(s*a)}});if(!c)throw new Error("No response from the AI service.");if(c.error)throw new Error("Error from the AI service.");if(c.cancel)return null;if(!c.output)throw new Error("No valid response from the AI service.");const u=c.output;return await this.setGuessedAltText(u),r&&!this.hasAltTextData()&&(this.altTextData={alt:u,decorative:!1}),u}remove(){var t,r;g(this,rn)&&(E(this,wt,null),this._uiManager.imageManager.deleteId(g(this,rn)),(t=g(this,qi))==null||t.remove(),E(this,qi,null),(r=g(this,Ko))==null||r.disconnect(),E(this,Ko,null),g(this,Gi)&&(clearTimeout(g(this,Gi)),E(this,Gi,null))),super.remove()}rebuild(){this.parent?(super.rebuild(),this.div!==null&&(g(this,rn)&&g(this,qi)===null&&x(this,td,C5).call(this),this.isAttachedToDOM||this.parent.add(this))):g(this,rn)&&x(this,td,C5).call(this)}onceAdded(){this._isDraggable=!0,this.div.focus()}isEmpty(){return!(g(this,va)||g(this,wt)||g(this,Wo)||g(this,Ca)||g(this,rn))}get isResizable(){return!0}render(){if(this.div)return this.div;let t,r;if(this.width&&(t=this.x,r=this.y),super.render(),this.div.hidden=!0,this.addAltTextButton(),g(this,wt)?x(this,$1,Xv).call(this):x(this,td,C5).call(this),this.width){const[i,o]=this.parentDimensions;this.setAt(t*i,r*o,this.width*i,this.height*o)}return this.div}copyCanvas(t,r=!1){var b;t||(t=224);const{width:i,height:o}=g(this,wt),s=document.createElement("canvas");let a=g(this,wt),c=i,u=o;if(i>t||o>t){const w=Math.min(t/i,t/o);c=Math.floor(i*w),u=Math.floor(o*w),g(this,Br)||(a=x(this,F1,Jv).call(this,c,u))}s.width=c,s.height=u;const d=s.getContext("2d");d.filter=this._uiManager.hcmFilter;let f="white",h="#cfcfd8";this._uiManager.hcmFilter!=="none"?h="black":(b=window.matchMedia)!=null&&b.call(window,"(prefers-color-scheme: dark)").matches&&(f="#8f8f9d",h="#42414d");const p=15,m=new OffscreenCanvas(30,30),y=m.getContext("2d");if(y.fillStyle=f,y.fillRect(0,0,30,30),y.fillStyle=h,y.fillRect(0,0,p,p),y.fillRect(p,p,p,p),d.fillStyle=d.createPattern(m,"repeat"),d.fillRect(0,0,c,u),r){const w=new OffscreenCanvas(c,u),v=w.getContext("2d",{willReadFrequently:!0});v.drawImage(a,0,0,a.width,a.height,0,0,c,u);const k=v.getImageData(0,0,c,u).data;return d.drawImage(w,0,0),{canvas:s,imageData:{width:c,height:u,data:k}}}return d.drawImage(a,0,0,a.width,a.height,0,0,c,u),{canvas:s,imageData:null}}getImageForAltText(){return g(this,qi)}static deserialize(t,r,i){if(t instanceof nE)return null;const o=super.deserialize(t,r,i),{rect:s,bitmapUrl:a,bitmapId:c,isSvg:u,accessibilityData:d}=t;c&&i.imageManager.isValidId(c)?E(o,rn,c):E(o,Wo,a),E(o,Br,u);const[f,h]=o.pageDimensions;return o.width=(s[2]-s[0])/f,o.height=(s[3]-s[1])/h,d&&(o.altTextData=d),o}serialize(t=!1,r=null){if(this.isEmpty())return null;const i={annotationType:Te.STAMP,bitmapId:g(this,rn),pageIndex:this.pageIndex,rect:this.getRect(0,0),rotation:this.rotation,isSvg:g(this,Br),structTreeParentId:this._structTreeParentId};if(t)return i.bitmapUrl=x(this,nd,k5).call(this,!0),i.accessibilityData=this.serializeAltText(!0),i;const{decorative:o,altText:s}=this.serializeAltText(!1);if(!o&&s&&(i.accessibilityData={type:"Figure",alt:s}),r===null)return i;r.stamps||(r.stamps=new Map);const a=g(this,Br)?(i.rect[2]-i.rect[0])*(i.rect[3]-i.rect[1]):null;if(r.stamps.has(g(this,rn))){if(g(this,Br)){const c=r.stamps.get(g(this,rn));a>c.area&&(c.area=a,c.serialized.bitmap.close(),c.serialized.bitmap=x(this,nd,k5).call(this,!1))}}else r.stamps.set(g(this,rn),{area:a,serialized:i}),i.bitmap=x(this,nd,k5).call(this,!1);return i}};wt=new WeakMap,rn=new WeakMap,va=new WeakMap,Wo=new WeakMap,Ca=new WeakMap,ed=new WeakMap,qi=new WeakMap,Ko=new WeakMap,Gi=new WeakMap,Br=new WeakMap,R1=new WeakMap,N0=new WeakSet,op=function(t,r=!1){t?(E(this,wt,t.bitmap),r||(E(this,rn,t.id),E(this,Br,t.isSvg)),t.file&&E(this,ed,t.file.name),x(this,$1,Xv).call(this)):this.remove()},P0=new WeakSet,sp=function(){if(E(this,va,null),this._uiManager.enableWaiting(!1),g(this,qi))if(this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&g(this,wt))this._editToolbar.hide(),this._uiManager.editAltText(this,!0);else{if(!this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&g(this,wt)){this._reportTelemetry({action:"pdfjs.image.image_added",data:{alt_text_modal:!1,alt_text_type:"empty"}});try{this.mlGuessAltText()}catch{}}this.div.focus()}},td=new WeakSet,C5=function(){if(g(this,rn)){this._uiManager.enableWaiting(!0),this._uiManager.imageManager.getFromId(g(this,rn)).then(i=>x(this,N0,op).call(this,i,!0)).finally(()=>x(this,P0,sp).call(this));return}if(g(this,Wo)){const i=g(this,Wo);E(this,Wo,null),this._uiManager.enableWaiting(!0),E(this,va,this._uiManager.imageManager.getFromUrl(i).then(o=>x(this,N0,op).call(this,o)).finally(()=>x(this,P0,sp).call(this)));return}if(g(this,Ca)){const i=g(this,Ca);E(this,Ca,null),this._uiManager.enableWaiting(!0),E(this,va,this._uiManager.imageManager.getFromFile(i).then(o=>x(this,N0,op).call(this,o)).finally(()=>x(this,P0,sp).call(this)));return}const t=document.createElement("input");t.type="file",t.accept=j1.supportedTypesStr;const r=this._uiManager._signal;E(this,va,new Promise(i=>{t.addEventListener("change",async()=>{if(t.files&&t.files.length!==0){this._uiManager.enableWaiting(!0);const o=await this._uiManager.imageManager.getFromFile(t.files[0]);this._reportTelemetry({action:"pdfjs.image.image_selected",data:{alt_text_modal:this._uiManager.useNewAltTextFlow}}),x(this,N0,op).call(this,o)}else this.remove();i()},{signal:r}),t.addEventListener("cancel",()=>{this.remove(),i()},{signal:r})}).finally(()=>x(this,P0,sp).call(this))),t.click()},$1=new WeakSet,Xv=function(){const{div:t}=this;let{width:r,height:i}=g(this,wt);const[o,s]=this.pageDimensions,a=.75;if(this.width)r=this.width*o,i=this.height*s;else if(r>a*o||i>a*s){const f=Math.min(a*o/r,a*s/i);r*=f,i*=f}const[c,u]=this.parentDimensions;this.setDims(r*c/o,i*u/s),this._uiManager.enableWaiting(!1);const d=E(this,qi,document.createElement("canvas"));t.append(d),this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow||(t.hidden=!1),x(this,V1,e8).call(this,r,i),x(this,Wy,gP).call(this),g(this,R1)||(this.parent.addUndoableEditor(this),E(this,R1,!0)),this._reportTelemetry({action:"inserted_image"}),g(this,ed)&&d.setAttribute("aria-label",g(this,ed))},Zy=new WeakSet,mP=function(t,r){var s;const[i,o]=this.parentDimensions;this.width=t/i,this.height=r/o,this.setDims(t,r),(s=this._initialOptions)!=null&&s.isCentered?this.center():this.fixAndSetPosition(),this._initialOptions=null,g(this,Gi)!==null&&clearTimeout(g(this,Gi)),E(this,Gi,setTimeout(()=>{E(this,Gi,null),x(this,V1,e8).call(this,t,r)},200))},F1=new WeakSet,Jv=function(t,r){const{width:i,height:o}=g(this,wt);let s=i,a=o,c=g(this,wt);for(;s>2*t||a>2*r;){const u=s,d=a;s>2*t&&(s=s>=16384?Math.floor(s/2)-1:Math.ceil(s/2)),a>2*r&&(a=a>=16384?Math.floor(a/2)-1:Math.ceil(a/2));const f=new OffscreenCanvas(s,a);f.getContext("2d").drawImage(c,0,0,u,d,0,0,s,a),c=f.transferToImageBitmap()}return c},V1=new WeakSet,e8=function(t,r){t=Math.ceil(t),r=Math.ceil(r);const i=g(this,qi);if(!i||i.width===t&&i.height===r)return;i.width=t,i.height=r;const o=g(this,Br)?g(this,wt):x(this,F1,Jv).call(this,t,r),s=i.getContext("2d");s.filter=this._uiManager.hcmFilter,s.drawImage(o,0,0,o.width,o.height,0,0,t,r)},nd=new WeakSet,k5=function(t){if(t){if(g(this,Br)){const i=this._uiManager.imageManager.getSvgUrl(g(this,rn));if(i)return i}const r=document.createElement("canvas");return{width:r.width,height:r.height}=g(this,wt),r.getContext("2d").drawImage(g(this,wt),0,0),r.toDataURL()}if(g(this,Br)){const[r,i]=this.pageDimensions,o=Math.round(this.width*r*hs.PDF_TO_CSS_UNITS),s=Math.round(this.height*i*hs.PDF_TO_CSS_UNITS),a=new OffscreenCanvas(o,s);return a.getContext("2d").drawImage(g(this,wt),0,0,g(this,wt).width,g(this,wt).height,0,0,o,s),a.transferToImageBitmap()}return structuredClone(g(this,wt))},Wy=new WeakSet,gP=function(){this._uiManager._signal&&(E(this,Ko,new ResizeObserver(t=>{const r=t[0].contentRect;r.width&&r.height&&x(this,Zy,mP).call(this,r.width,r.height)})),g(this,Ko).observe(this.div),this._uiManager._signal.addEventListener("abort",()=>{var t;(t=g(this,Ko))==null||t.disconnect(),E(this,Ko,null)},{once:!0}))},pe(j1,"_type","stamp"),pe(j1,"_editorType",Te.STAMP);let Q4=j1;const ci=class ci{constructor({uiManager:e,pageIndex:t,div:r,accessibilityManager:i,annotationLayer:o,drawLayer:s,textLayer:a,viewport:c,l10n:u}){M(this,Ky);M(this,z1);M(this,H1);M(this,U1);M(this,sd);M(this,_0,void 0);M(this,rd,!1);M(this,Yi,null);M(this,ka,null);M(this,qo,null);M(this,fr,new Map);M(this,Sa,!1);M(this,id,!1);M(this,od,!1);M(this,An,null);M(this,Go,null);M(this,le,void 0);const d=[...g(ci,Ma).values()];if(!ci._initialized){ci._initialized=!0;for(const f of d)f.initialize(u,e)}e.registerEditorTypes(d),E(this,le,e),this.pageIndex=t,this.div=r,E(this,_0,i),E(this,Yi,o),this.viewport=c,E(this,An,a),this.drawLayer=s,g(this,le).addLayer(this)}get isEmpty(){return g(this,fr).size===0}get isInvisible(){return this.isEmpty&&g(this,le).getMode()===Te.NONE}updateToolbar(e){g(this,le).updateToolbar(e)}updateMode(e=g(this,le).getMode()){switch(x(this,sd,S5).call(this),e){case Te.NONE:this.disableTextSelection(),this.togglePointerEvents(!1),this.toggleAnnotationLayerPointerEvents(!0),this.disableClick();return;case Te.INK:this.addInkEditorIfNeeded(!1),this.disableTextSelection(),this.togglePointerEvents(!0),this.disableClick();break;case Te.HIGHLIGHT:this.enableTextSelection(),this.togglePointerEvents(!1),this.disableClick();break;default:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick()}this.toggleAnnotationLayerPointerEvents(!1);const{classList:t}=this.div;for(const r of g(ci,Ma).values())t.toggle(`${r._type}Editing`,e===r._editorType);this.div.hidden=!1}hasTextLayer(e){var t;return e===((t=g(this,An))==null?void 0:t.div)}addInkEditorIfNeeded(e){if(g(this,le).getMode()===Te.INK){if(!e){for(const t of g(this,fr).values())if(t.isEmpty()){t.setInBackground();return}}this.createAndAddNewEditor({offsetX:0,offsetY:0},!1).setInBackground()}}setEditingState(e){g(this,le).setEditingState(e)}addCommands(e){g(this,le).addCommands(e)}toggleDrawing(e=!1){this.div.classList.toggle("drawing",!e)}togglePointerEvents(e=!1){this.div.classList.toggle("disabled",!e)}toggleAnnotationLayerPointerEvents(e=!1){var t;(t=g(this,Yi))==null||t.div.classList.toggle("disabled",!e)}enable(){this.div.tabIndex=0,this.togglePointerEvents(!0);const e=new Set;for(const r of g(this,fr).values())r.enableEditing(),r.show(!0),r.annotationElementId&&(g(this,le).removeChangedExistingAnnotation(r),e.add(r.annotationElementId));if(!g(this,Yi))return;const t=g(this,Yi).getEditableAnnotations();for(const r of t){if(r.hide(),g(this,le).isDeletedAnnotationElement(r.data.id)||e.has(r.data.id))continue;const i=this.deserialize(r);i&&(this.addOrRebuild(i),i.enableEditing())}}disable(){var i;E(this,od,!0),this.div.tabIndex=-1,this.togglePointerEvents(!1);const e=new Map,t=new Map;for(const o of g(this,fr).values())o.disableEditing(),o.annotationElementId&&(o.serialize()===null?(t.set(o.annotationElementId,o),(i=this.getEditableAnnotation(o.annotationElementId))==null||i.show(),o.remove()):e.set(o.annotationElementId,o));if(g(this,Yi)){const o=g(this,Yi).getEditableAnnotations();for(const s of o){const{id:a}=s.data;if(g(this,le).isDeletedAnnotationElement(a))continue;let c=t.get(a);c?(c.resetAnnotationElement(s),c.show(!1),s.show()):(c=e.get(a),c&&(g(this,le).addChangedExistingAnnotation(c),c.renderAnnotationElement(s),c.show(!1)),s.show())}}x(this,sd,S5).call(this),this.isEmpty&&(this.div.hidden=!0);const{classList:r}=this.div;for(const o of g(ci,Ma).values())r.remove(`${o._type}Editing`);this.disableTextSelection(),this.toggleAnnotationLayerPointerEvents(!0),E(this,od,!1)}getEditableAnnotation(e){var t;return((t=g(this,Yi))==null?void 0:t.getEditableAnnotation(e))||null}setActiveEditor(e){g(this,le).getActive()!==e&&g(this,le).setActiveEditor(e)}enableTextSelection(){var e;if(this.div.tabIndex=-1,(e=g(this,An))!=null&&e.div&&!g(this,Go)){E(this,Go,new AbortController);const t=g(this,le).combinedSignal(g(this,Go));g(this,An).div.addEventListener("pointerdown",x(this,Ky,yP).bind(this),{signal:t}),g(this,An).div.classList.add("highlighting")}}disableTextSelection(){var e;this.div.tabIndex=0,(e=g(this,An))!=null&&e.div&&g(this,Go)&&(g(this,Go).abort(),E(this,Go,null),g(this,An).div.classList.remove("highlighting"))}enableClick(){if(g(this,ka))return;E(this,ka,new AbortController);const e=g(this,le).combinedSignal(g(this,ka));this.div.addEventListener("pointerdown",this.pointerdown.bind(this),{signal:e}),this.div.addEventListener("pointerup",this.pointerup.bind(this),{signal:e})}disableClick(){var e;(e=g(this,ka))==null||e.abort(),E(this,ka,null)}attach(e){g(this,fr).set(e.id,e);const{annotationElementId:t}=e;t&&g(this,le).isDeletedAnnotationElement(t)&&g(this,le).removeDeletedAnnotationElement(e)}detach(e){var t;g(this,fr).delete(e.id),(t=g(this,_0))==null||t.removePointerInTextLayer(e.contentDiv),!g(this,od)&&e.annotationElementId&&g(this,le).addDeletedAnnotationElement(e)}remove(e){this.detach(e),g(this,le).removeEditor(e),e.div.remove(),e.isAttachedToDOM=!1,g(this,id)||this.addInkEditorIfNeeded(!1)}changeParent(e){var t;e.parent!==this&&(e.parent&&e.annotationElementId&&(g(this,le).addDeletedAnnotationElement(e.annotationElementId),je.deleteAnnotationElement(e),e.annotationElementId=null),this.attach(e),(t=e.parent)==null||t.detach(e),e.setParent(this),e.div&&e.isAttachedToDOM&&(e.div.remove(),this.div.append(e.div)))}add(e){if(e.parent!==this||!e.isAttachedToDOM){if(this.changeParent(e),g(this,le).addEditor(e),this.attach(e),!e.isAttachedToDOM){const t=e.render();this.div.append(t),e.isAttachedToDOM=!0}e.fixAndSetPosition(),e.onceAdded(),g(this,le).addToAnnotationStorage(e),e._reportTelemetry(e.telemetryInitialData)}}moveEditorInDOM(e){var r;if(!e.isAttachedToDOM)return;const{activeElement:t}=document;e.div.contains(t)&&!g(this,qo)&&(e._focusEventsAllowed=!1,E(this,qo,setTimeout(()=>{E(this,qo,null),e.div.contains(document.activeElement)?e._focusEventsAllowed=!0:(e.div.addEventListener("focusin",()=>{e._focusEventsAllowed=!0},{once:!0,signal:g(this,le)._signal}),t.focus())},0))),e._structTreeParentId=(r=g(this,_0))==null?void 0:r.moveElementInDOM(this.div,e.div,e.contentDiv,!0)}addOrRebuild(e){e.needsToBeRebuilt()?(e.parent||(e.parent=this),e.rebuild(),e.show()):this.add(e)}addUndoableEditor(e){this.addCommands({cmd:()=>e._uiManager.rebuild(e),undo:()=>{e.remove()},mustExec:!1})}getNextId(){return g(this,le).getId()}combinedSignal(e){return g(this,le).combinedSignal(e)}canCreateNewEmptyEditor(){var e;return(e=g(this,z1,t8))==null?void 0:e.canCreateNewEmptyEditor()}pasteEditor(e,t){g(this,le).updateToolbar(e),g(this,le).updateMode(e);const{offsetX:r,offsetY:i}=x(this,U1,r8).call(this),o=this.getNextId(),s=x(this,H1,n8).call(this,{parent:this,id:o,x:r,y:i,uiManager:g(this,le),isCentered:!0,...t});s&&this.add(s)}deserialize(e){var t;return((t=g(ci,Ma).get(e.annotationType??e.annotationEditorType))==null?void 0:t.deserialize(e,this,g(this,le)))||null}createAndAddNewEditor(e,t,r={}){const i=this.getNextId(),o=x(this,H1,n8).call(this,{parent:this,id:i,x:e.offsetX,y:e.offsetY,uiManager:g(this,le),isCentered:t,...r});return o&&this.add(o),o}addNewEditor(){this.createAndAddNewEditor(x(this,U1,r8).call(this),!0)}setSelected(e){g(this,le).setSelected(e)}toggleSelected(e){g(this,le).toggleSelected(e)}isSelected(e){return g(this,le).isSelected(e)}unselect(e){g(this,le).unselect(e)}pointerup(e){const{isMac:t}=Bn.platform;!(e.button!==0||e.ctrlKey&&t)&&e.target===this.div&&g(this,Sa)&&(E(this,Sa,!1),g(this,rd)?g(this,le).getMode()!==Te.STAMP?this.createAndAddNewEditor(e,!1):g(this,le).unselectAll():E(this,rd,!0))}pointerdown(e){if(g(this,le).getMode()===Te.HIGHLIGHT&&this.enableTextSelection(),g(this,Sa)){E(this,Sa,!1);return}const{isMac:t}=Bn.platform;if(e.button!==0||e.ctrlKey&&t||e.target!==this.div)return;E(this,Sa,!0);const r=g(this,le).getActive();E(this,rd,!r||r.isEmpty())}findNewParent(e,t,r){const i=g(this,le).findParent(t,r);return i===null||i===this?!1:(i.changeParent(e),!0)}destroy(){var e,t;((e=g(this,le).getActive())==null?void 0:e.parent)===this&&(g(this,le).commitOrRemove(),g(this,le).setActiveEditor(null)),g(this,qo)&&(clearTimeout(g(this,qo)),E(this,qo,null));for(const r of g(this,fr).values())(t=g(this,_0))==null||t.removePointerInTextLayer(r.contentDiv),r.setParent(null),r.isAttachedToDOM=!1,r.div.remove();this.div=null,g(this,fr).clear(),g(this,le).removeLayer(this)}render({viewport:e}){this.viewport=e,qa(this.div,e);for(const t of g(this,le).getEditors(this.pageIndex))this.add(t),t.rebuild();this.updateMode()}update({viewport:e}){g(this,le).commitOrRemove(),x(this,sd,S5).call(this);const t=this.viewport.rotation,r=e.rotation;if(this.viewport=e,qa(this.div,{rotation:r}),t!==r)for(const i of g(this,fr).values())i.rotate(r);this.addInkEditorIfNeeded(!1)}get pageDimensions(){const{pageWidth:e,pageHeight:t}=this.viewport.rawDims;return[e,t]}get scale(){return g(this,le).viewParameters.realScale}};_0=new WeakMap,rd=new WeakMap,Yi=new WeakMap,ka=new WeakMap,qo=new WeakMap,fr=new WeakMap,Sa=new WeakMap,id=new WeakMap,od=new WeakMap,An=new WeakMap,Go=new WeakMap,le=new WeakMap,Ma=new WeakMap,Ky=new WeakSet,yP=function(e){g(this,le).unselectAll();const{target:t}=e;if(t===g(this,An).div||t.classList.contains("endOfContent")&&g(this,An).div.contains(t)){const{isMac:r}=Bn.platform;if(e.button!==0||e.ctrlKey&&r)return;g(this,le).showAllEditors("highlight",!0,!0),g(this,An).div.classList.add("free"),this.toggleDrawing(),ym.startHighlighting(this,g(this,le).direction==="ltr",e),g(this,An).div.addEventListener("pointerup",()=>{g(this,An).div.classList.remove("free"),this.toggleDrawing(!0)},{once:!0,signal:g(this,le)._signal}),e.preventDefault()}},z1=new WeakSet,t8=function(){return g(ci,Ma).get(g(this,le).getMode())},H1=new WeakSet,n8=function(e){const t=g(this,z1,t8);return t?new t.prototype.constructor(e):null},U1=new WeakSet,r8=function(){const{x:e,y:t,width:r,height:i}=this.div.getBoundingClientRect(),o=Math.max(0,e),s=Math.max(0,t),a=(o+Math.min(window.innerWidth,e+r))/2-e,c=(s+Math.min(window.innerHeight,t+i))/2-t,[u,d]=this.viewport.rotation%180==0?[a,c]:[c,a];return{offsetX:u,offsetY:d}},sd=new WeakSet,S5=function(){E(this,id,!0);for(const e of g(this,fr).values())e.isEmpty()&&e.remove();E(this,id,!1)},pe(ci,"_initialized",!1),M(ci,Ma,new Map([q4,Y4,Q4,ym].map(e=>[e._editorType,e])));let X4=ci;const on=class on{constructor({pageIndex:e}){M(this,K1);M(this,qy);M(this,Qi,null);M(this,Z1,0);M(this,Pt,new Map);M(this,Ea,new Map);this.pageIndex=e}setParent(e){if(g(this,Qi)){if(g(this,Qi)!==e){if(g(this,Pt).size>0)for(const t of g(this,Pt).values())t.remove(),e.append(t);E(this,Qi,e)}}else E(this,Qi,e)}static get _svgFactory(){return Ie(this,"_svgFactory",new A4)}highlight(e,t,r,i=!1){const o=qn(this,Z1)._++,s=x(this,K1,o8).call(this,e.box);s.classList.add("highlight"),e.free&&s.classList.add("free");const a=on._svgFactory.createElement("defs");s.append(a);const c=on._svgFactory.createElement("path");a.append(c);const u=`path_p${this.pageIndex}_${o}`;c.setAttribute("id",u),c.setAttribute("d",e.toSVGPath()),i&&g(this,Ea).set(o,c);const d=x(this,qy,bP).call(this,a,u),f=on._svgFactory.createElement("use");return s.append(f),s.setAttribute("fill",t),s.setAttribute("fill-opacity",r),f.setAttribute("href",`#${u}`),g(this,Pt).set(o,s),{id:o,clipPathId:`url(#${d})`}}highlightOutline(e){const t=qn(this,Z1)._++,r=x(this,K1,o8).call(this,e.box);r.classList.add("highlightOutline");const i=on._svgFactory.createElement("defs");r.append(i);const o=on._svgFactory.createElement("path");i.append(o);const s=`path_p${this.pageIndex}_${t}`;o.setAttribute("id",s),o.setAttribute("d",e.toSVGPath()),o.setAttribute("vector-effect","non-scaling-stroke");let a;if(e.free){r.classList.add("free");const d=on._svgFactory.createElement("mask");i.append(d),a=`mask_p${this.pageIndex}_${t}`,d.setAttribute("id",a),d.setAttribute("maskUnits","objectBoundingBox");const f=on._svgFactory.createElement("rect");d.append(f),f.setAttribute("width","1"),f.setAttribute("height","1"),f.setAttribute("fill","white");const h=on._svgFactory.createElement("use");d.append(h),h.setAttribute("href",`#${s}`),h.setAttribute("stroke","none"),h.setAttribute("fill","black"),h.setAttribute("fill-rule","nonzero"),h.classList.add("mask")}const c=on._svgFactory.createElement("use");r.append(c),c.setAttribute("href",`#${s}`),a&&c.setAttribute("mask",`url(#${a})`);const u=c.cloneNode();return r.append(u),c.classList.add("mainOutline"),u.classList.add("secondaryOutline"),g(this,Pt).set(t,r),t}finalizeLine(e,t){const r=g(this,Ea).get(e);g(this,Ea).delete(e),this.updateBox(e,t.box),r.setAttribute("d",t.toSVGPath())}updateLine(e,t){g(this,Pt).get(e).firstChild.firstChild.setAttribute("d",t.toSVGPath())}removeFreeHighlight(e){this.remove(e),g(this,Ea).delete(e)}updatePath(e,t){g(this,Ea).get(e).setAttribute("d",t.toSVGPath())}updateBox(e,t){var r;x(r=on,W1,i8).call(r,g(this,Pt).get(e),t)}show(e,t){g(this,Pt).get(e).classList.toggle("hidden",!t)}rotate(e,t){g(this,Pt).get(e).setAttribute("data-main-rotation",t)}changeColor(e,t){g(this,Pt).get(e).setAttribute("fill",t)}changeOpacity(e,t){g(this,Pt).get(e).setAttribute("fill-opacity",t)}addClass(e,t){g(this,Pt).get(e).classList.add(t)}removeClass(e,t){g(this,Pt).get(e).classList.remove(t)}remove(e){g(this,Qi)!==null&&(g(this,Pt).get(e).remove(),g(this,Pt).delete(e))}destroy(){E(this,Qi,null);for(const e of g(this,Pt).values())e.remove();g(this,Pt).clear()}};Qi=new WeakMap,Z1=new WeakMap,Pt=new WeakMap,Ea=new WeakMap,W1=new WeakSet,i8=function(e,{x:t=0,y:r=0,width:i=1,height:o=1}={}){const{style:s}=e;s.top=100*r+"%",s.left=100*t+"%",s.width=100*i+"%",s.height=100*o+"%"},K1=new WeakSet,o8=function(e){var r;const t=on._svgFactory.create(1,1,!0);return g(this,Qi).append(t),t.setAttribute("aria-hidden",!0),x(r=on,W1,i8).call(r,t,e),t},qy=new WeakSet,bP=function(e,t){const r=on._svgFactory.createElement("clipPath");e.append(r);const i=`clip_${t}`;r.setAttribute("id",i),r.setAttribute("clipPathUnits","objectBoundingBox");const o=on._svgFactory.createElement("use");return r.append(o),o.setAttribute("href",`#${t}`),o.classList.add("clip"),i},M(on,W1);let J4=on;ge.AbortException,ge.AnnotationEditorLayer,ge.AnnotationEditorParamsType,ge.AnnotationEditorType,ge.AnnotationEditorUIManager,ge.AnnotationLayer,ge.AnnotationMode,ge.CMapCompressionType,ge.ColorPicker,ge.DOMSVGFactory,ge.DrawLayer,ge.FeatureTest;var uW=ge.GlobalWorkerOptions;ge.ImageKind,ge.InvalidPDFException,ge.MissingPDFException,ge.OPS,ge.PDFDataRangeTransport,ge.PDFDateString,ge.PDFWorker,ge.PasswordResponses,ge.PermissionFlag,ge.PixelsPerInch,ge.RenderingCancelledException,ge.TextLayer,ge.UnexpectedResponseException,ge.Util,ge.VerbosityLevel,ge.XfaLayer,ge.build,ge.createValidAbsoluteUrl,ge.fetchData;var dW=ge.getDocument;ge.getFilenameFromUrl,ge.getPdfFilenameFromUrl,ge.getXfaPageViewport,ge.isDataScheme,ge.isPdfFile,ge.noContextMenu,ge.normalizeUnicode,ge.setLayerDimensions,ge.shadow;var fW=ge.version;const hW=l.defineComponent({name:"QModal",components:{QIcon:z0},props:{id:{type:String,default:"q-modal"},closeButtonClass:{type:String,default:""},containerClass:{type:String,default:"h-fit min-h-fit"},dismissible:{type:Boolean,default:!0},dismissibleOverlay:{type:Boolean,default:!0},dismissText:{type:String,default:""},overlay:{type:String,default:"white-transparent"},size:{type:String,default:"md"},showCancelLink:{type:Boolean,default:!1},hasBuildingBg:{type:Boolean,default:!1}},emits:["close"],setup(n,{emit:e}){l.provide("size",n.size);const t=()=>{n.dismissible&&e("close")};return l.onUnmounted(()=>{document.body.classList.remove("scroll-disabled")}),l.onMounted(()=>{document.body.classList.add("scroll-disabled")}),{onCloseModal:t}}});function pW(n,e,t,r,i,o){const s=l.resolveComponent("q-icon");return l.openBlock(),l.createElementBlock("div",{ref:"currentModal",class:l.normalizeClass(["q-modal",n.overlay]),onKeydown:e[3]||(e[3]=l.withKeys((...a)=>n.onCloseModal&&n.onCloseModal(...a),["escape"]))},[l.createElementVNode("div",l.mergeProps({class:"overlay"},{[l.toHandlerKey(n.dismissibleOverlay&&"click")]:e[0]||(e[0]=(...a)=>n.onCloseModal&&n.onCloseModal(...a))}),null,16),l.createElementVNode("div",{class:l.normalizeClass(["modal-container flex flex-col relative","modal-"+n.size,n.containerClass,{"building-background":n.hasBuildingBg}])},[n.dismissible?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass(["modal-close-button",n.closeButtonClass]),onClick:e[1]||(e[1]=(...a)=>n.onCloseModal&&n.onCloseModal(...a))},[l.createVNode(s,{icon:"close",type:"line",color:"gray-40"})],2)):l.createCommentVNode("",!0),l.renderSlot(n.$slots,"default",{},void 0,!0),n.showCancelLink?(l.openBlock(),l.createElementBlock("a",{key:1,class:"modal-close-link",href:"#",onClick:e[2]||(e[2]=l.withModifiers(a=>n.$emit("close"),["prevent"]))},l.toDisplayString(n.$t("HC_CANCEL")),1)):l.createCommentVNode("",!0)],2)],34)}const e6=ye(hW,[["render",pW],["__scopeId","data-v-8867a052"]]),mW=l.defineComponent({name:"QErrorModal",components:{QModal:e6},props:{toggle:{type:Boolean,default:!1,required:!0}},emits:["update:toggle"],setup(n,{emit:e}){return{toggleModal:l.computed({get:()=>n.toggle,set:r=>{e("update:toggle",r)}}),mq:_n}}}),gW={class:"flex flex-col gap-2 text-center"},yW={class:"text-lg font-bold text-inkwell-30 leading-6"},bW={class:"text-inkwell-0 mb-2 md:mb-6"};function wW(n,e,t,r,i,o){const s=l.resolveComponent("q-icon"),a=l.resolveComponent("q-button"),c=l.resolveComponent("q-modal-content"),u=l.resolveComponent("q-modal");return l.openBlock(),l.createBlock(l.Transition,{name:n.mq.md?"fade":"slide-up"},{default:l.withCtx(()=>[n.toggleModal?(l.openBlock(),l.createBlock(u,{key:0,id:"error-modal",dismissible:!1,overlay:n.mq.md?"white-transparent":"black-transparent",class:"!z-[170]","footer-class":"mt-2 md:mt-6",onClose:e[1]||(e[1]=d=>n.toggleModal=!1)},{default:l.withCtx(()=>[l.createVNode(c,null,{body:l.withCtx(()=>[l.createElementVNode("div",gW,[l.createVNode(s,{icon:"exclamation-circle",type:"outline",size:"xl",color:"red-30",class:"shrink-0 self-center mb-8"}),l.createElementVNode("h2",yW,[l.renderSlot(n.$slots,"headline",{},()=>[l.createTextVNode(l.toDisplayString(n.$t("HC_ERROR")),1)],!0)]),l.createElementVNode("p",bW,[l.renderSlot(n.$slots,"subtext",{},()=>[l.createTextVNode(l.toDisplayString(n.$t("HC_SORRY_UNEXPECTED_EXIT_MODAL")),1)],!0)])])]),footer:l.withCtx(()=>[l.createVNode(a,{class:l.normalizeClass([n.mq.md?"mx-3":"w-full"]),size:"lg",status:"secondary",onClick:e[0]||(e[0]=d=>n.toggleModal=!1)},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(n.$t("HC_EXIT")),1)]),_:1},8,["class"])]),_:3})]),_:3},8,["overlay"])):l.createCommentVNode("",!0)]),_:3},8,["name"])}const oE=ye(mW,[["render",wW],["__scopeId","data-v-72f5c09d"]]);uW.workerSrc=`https://cdn.jsdelivr.net/npm/pdfjs-dist@${fW}/legacy/build/pdf.worker.min.mjs`;const vW=l.defineComponent({name:"PdfViewer",components:{QErrorModal:oE},props:{url:{type:String,required:!0}},emits:["pdf-error"],setup(n,{emit:e}){let t=null;const r=2,i=16,o=l.ref([]),s=l.ref(!0),a=l.ref(!1),c=l.ref(0),u=async()=>{try{if(t=await dW(n.url).promise,!t)throw new Error("pdfDoc is null or undefined");c.value=t.numPages,s.value=!1,await l.nextTick(),o.value=Array.from(document.querySelectorAll(".pdf-pages canvas")),await d()}catch(h){a.value=!0,console.log(h),s.value=!1,e("pdf-error",!0)}},d=async()=>{try{for(let h=1;h<=c.value;h++)await f(h)}catch(h){console.log(h),a.value=!0,e("pdf-error",!0)}},f=async h=>{try{const p=await(t==null?void 0:t.getPage(h));if(!p)throw new Error(`Page ${h} does not exist in the PDF document`);const y=p.getViewport({scale:1}),b=o.value[h-1];if(!b)throw new Error(`Canvas for page ${h} does not exist`);const w=b.getContext("2d");if(!w)throw new Error(`Context for page ${h} does not exist`);b.height=y==null?void 0:y.height,b.width=y==null?void 0:y.width;const v={canvasContext:w,viewport:y};await(p==null?void 0:p.render(v))}catch(p){console.log(p),a.value=!0,e("pdf-error",!0)}};return l.onMounted(()=>{u()}),{skeletonColumns:r,skeletonRows:i,canvasRefs:o,loadingMeta:s,showErrorModal:a,totalPages:c,loadPDF:u,renderPage:f}}}),CW={class:"q-pdf-viewer"},kW={key:0},SW={key:1,class:"pdf-pages"};function MW(n,e,t,r,i,o){const s=l.resolveComponent("q-error-modal");return l.openBlock(),l.createElementBlock(l.Fragment,null,[l.createElementVNode("div",CW,[n.loadingMeta?(l.openBlock(),l.createElementBlock("div",kW,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(n.skeletonRows,a=>(l.openBlock(),l.createElementBlock("div",{key:a,class:"flex items-center p-4"},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(n.skeletonColumns,c=>(l.openBlock(),l.createElementBlock("div",{key:c,class:l.normalizeClass(["h-[1.5rem] border-white w-11/12",(a-1)%2?"bg-gray-10":"bg-gray-30",(a-1)%4||c===1?"animate-shimmer":"!hidden"])},null,2))),128))]))),128))])):(l.openBlock(),l.createElementBlock("div",SW,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(n.totalPages,a=>(l.openBlock(),l.createElementBlock("canvas",{key:a,class:"w-full"}))),128))]))]),n.showErrorModal?(l.openBlock(),l.createBlock(s,{key:0,toggle:n.showErrorModal,"onUpdate:toggle":[e[0]||(e[0]=a=>n.showErrorModal=a),e[1]||(e[1]=a=>n.showErrorModal=!1)]},null,8,["toggle"])):l.createCommentVNode("",!0)],64)}const sE=ye(vW,[["render",MW],["__scopeId","data-v-da5da0f5"]]),EW=l.defineComponent({name:"QTooltip",props:{id:{type:String,default:"tooltip"},color:{type:String,default:"inkwell-30"},disabled:{type:Boolean,default:!1},noWrap:{type:Boolean,default:!0},position:{type:String,default:"bottom"},relative:{type:Boolean,default:!1},tooltipClasses:{type:[String,Array,Object],default:""}}}),AW=["aria-describedby"],TW=["id"];function xW(n,e,t,r,i,o){return l.openBlock(),l.createElementBlock("div",{class:"tooltip-container","aria-describedby":n.id},[l.renderSlot(n.$slots,"trigger",{},void 0,!0),l.createElementVNode("div",{id:n.id,class:l.normalizeClass(["tooltip",n.color?"bg-"+n.color+" border-"+n.color:"",n.position,n.noWrap?"no-wrap":"",n.relative?"relative":"",n.disabled?"!hidden":"",n.tooltipClasses]),role:"tooltip"},[l.renderSlot(n.$slots,"content",{},void 0,!0)],10,TW)],8,AW)}const t6=ye(EW,[["render",xW],["__scopeId","data-v-ca6ae8fe"]]),aE=()=>{const n=l.ref(""),e=navigator.userAgent;return e.match("/Android|webOS|iPhone|iPod|BlackBerry/i")?n.value="mobile":e.match("/iPad|Tablet/i")||navigator.maxTouchPoints&&navigator.maxTouchPoints>=0&&!window.matchMedia("(pointer:fine)").matches?n.value="tablet":n.value="desktop",{deviceType:n}},IW=l.defineComponent({name:"ImageGallery",components:{Galleria:rM,QBadge:Da,QBottomSheet:G9,QMenu:m4,QPdfViewer:sE,QTooltip:t6},props:{files:{type:Array,default:()=>[]},thumbnailsVisible:{type:Number,default:4},showOnHover:{type:Boolean,default:!0},showThumbnails:{type:Boolean,default:!0},showRemove:{type:[Boolean,Number],default:!1},baseZIndex:{type:Number,default:1e3},wrap:{type:Boolean,default:!0},processing:{type:Boolean,default:!1}},emits:["update:model-value","update:activeIndex","click:file"],setup(n,{emit:e}){const{t}=us(),{deviceType:r}=aE(),i=[{text:t("HC_CANCEL")}],o=l.ref(null),s=l.computed(()=>{var Q;return(Q=o.value)==null?void 0:Q.offsetWidth}),a=l.ref(null),c=l.ref([]),u=l.ref(!1),d=l.ref(null),f=l.ref("0"),h=l.ref(1),p=l.ref(_n.md?1:.9),m=l.ref(0),y=l.ref(null),b=l.ref(),w=l.ref(!1),v=l.ref(!1),k=l.computed(()=>{if(y.value)return y.value&&"original"in y.value?{name:y.value.original.name,url:y.value.original.url,type:y.value.mimetype,extension:V(y.value.original.url)}:{name:y.value.name,url:URL.createObjectURL(y.value),type:y.value.type,extension:V(y.value.name)}}),C=l.computed(()=>[`z-[${n.baseZIndex+1}]`]),T=l.computed(()=>n.files.filter(Q=>Q.type.startsWith("image")&&!Q.type.includes("tif"))),S=l.computed(()=>["rounded-lg relative mx-auto object-cover grow-1 max-h-[74vh]",{animated:!N}]),A=l.computed(()=>["flex items-center gap-3",n.wrap?"flex-wrap":"flex-nowrap overflow-x-auto shrink-0",{"flex-nowrap overflow-x-auto":r.value!=="desktop"}]),O=l.computed(()=>[{text:t("HC_DELETE_ATTACHMENT"),classes:"!text-red-20",event:F}]),I=Q=>{const Z=Q instanceof File?URL.createObjectURL(Q):Q.original.url;r.value==="desktop"?window.open(Z,"_blank"):window.open(Z,"_self")},P=Q=>{r.value==="desktop"?I(Q):(y.value=Q,v.value=!0)},D=Q=>{Q.event(),u.value=!1},_=(Q,Z)=>{var z;const H=((z=Z.type)==null?void 0:z.includes("image"))&&!Z.type.includes("tif");!u.value&&H?B(Q,Z):!u.value&&!H&&P(Z)},B=(Q,Z)=>{const H=K=>"original"in K&&"original"in Z?K.original.url===(Z==null?void 0:Z.original.url):Z instanceof File?K.name===(Z==null?void 0:Z.name):!1,z=T.value.findIndex(H);m.value=z!==-1?z:Q,w.value=!0},F=(Q=null)=>{u.value=!1,e("update:model-value",Q||d.value)},R=Q=>{const{keyCode:Z}=Q;if(w.value)switch(Z){case 37:m.value=m.value?m.value-1:T.value.length-1,e("update:activeIndex",m.value);break;case 39:m.value=m.value<T.value.length-1?m.value+1:0,e("update:activeIndex",m.value);break;case 27:w.value=!1;break}},{isSwiping:N,lengthX:W}=iL(a,{passive:!1,onSwipe(){const Q=Math.abs(W.value);s.value&&(h.value=1.1-Q/s.value,f.value=W.value<0?`${Q/4}px`:`-${Q/4}px`)},onSwipeEnd(){const Q=m.value<=0,Z=m.value>=T.value.length-1,H=Math.abs(W.value);s.value&&H/s.value>=.5?(W.value<0?m.value=Q?T.value.length-1:m.value-1:m.value=Z?0:m.value+1,f.value="0",h.value=1):(f.value="0",h.value=1)}}),V=Q=>Q.substring(Q.lastIndexOf(".")),Y=(Q,Z)=>{Q.preventDefault(),d.value=n.files[Z],u.value=!0},ue=()=>{u.value=!1,d.value=null},de=()=>{r.value!=="desktop"&&c.value.forEach(Q=>{X_(Q,Z=>{const H=c.value.indexOf(Q);Y(Z,H)},{modifiers:{prevent:!0}})})};return l.onMounted(()=>{window.addEventListener("keyup",R),de()}),l.onUpdated(()=>{de()}),{menuActions:i,linkActions:O,deviceType:r,container:o,containerWidth:s,featuredPhoto:a,longPressRef:c,longPressedHook:u,isSwiping:N,lengthX:W,left:f,opacity:h,scale:p,showCarousel:w,showFileViewer:v,active:m,activeAttachment:y,hoveredIndex:b,closeIconClasses:C,itemClasses:S,images:T,normalizedAttachment:k,thumbnailContainerClasses:A,downloadDocument:I,getExtension:V,onAttachmentClick:P,onClickMenuLink:D,onClickThumbnail:_,onOpenCarousel:B,onRemoveFile:F,onKeyboardNavigation:R,onLongPressCallbackHook:Y,resetHook:ue,mq:_n}}}),OW=n=>(l.pushScopeId("data-v-ba426870"),n=n(),l.popScopeId(),n),DW={class:"q-image-gallery flex",ref:"container"},NW={ref:"featuredPhoto",class:"featured-image h-[80vh] overflow-hidden flex max-w-screen relative md:h-full w-screen items-center"},PW=["src","alt"],_W=["src","alt"],LW=["onMouseover","onClick"],BW=["src","alt"],RW={key:1,class:"bg-gray-00 cursor-pointer p-3 h-16 max-w-[14rem] rounded-lg border border-gray-20 flex items-center"},$W={class:"grow text-ellipsis overflow-hidden"},FW={class:"text-inkwell-30 bold leading-normal text-nowrap text-ellipsis text-sm overflow-hidden -mt-1"},VW={class:"uppercase text-xxs"},jW={key:2,class:"image-overlay absolute top-0 left-0 w-full h-full cursor-pointer"},zW={key:0,class:"absolute top-0 left-0 z-1 w-full h-full cursor-pointer bg-black/50 rounded-lg flex items-center justify-center"},HW=[OW(()=>l.createElementVNode("svg",{class:"animate-spin fill-white",width:"20",height:"20",viewBox:"0 0 24 24"},[l.createElementVNode("path",{d:"M2 12a1 1 0 0 1 2 0 8 8 0 1 0 8-8 1 1 0 0 1 0-2c5.523 0 10 4.477 10 10s-4.477 10-10 10S2 17.523 2 12z"})],-1))],UW={key:1,width:"100%",height:"auto",controls:"",class:"bg-black"},ZW=["src"],WW={class:"flex items-center flex-col p-12"},KW=["src"],qW=["data","type"],GW={class:"flex items-center flex-col p-12"};function YW(n,e,t,r,i,o){const s=l.resolveComponent("q-icon"),a=l.resolveComponent("Galleria"),c=l.resolveComponent("q-badge"),u=l.resolveComponent("q-tooltip"),d=l.resolveComponent("q-menu"),f=l.resolveComponent("q-pdf-viewer"),h=l.resolveComponent("q-bottom-sheet");return l.openBlock(),l.createElementBlock("div",DW,[l.createVNode(a,{activeIndex:n.active,"onUpdate:activeIndex":e[0]||(e[0]=p=>n.active=p),visible:n.showCarousel,"onUpdate:visible":e[1]||(e[1]=p=>n.showCarousel=p),value:n.images,numVisible:n.thumbnailsVisible,circular:!0,fullScreen:!0,showItemNavigators:n.mq.md,showThumbnailNavigators:!0,showThumbnails:n.showThumbnails&&n.mq.md,showIndicators:!n.mq.md,containerStyle:[{height:"100vh"}],"base-z-index":n.baseZIndex},{closeicon:l.withCtx(()=>[l.createVNode(s,{class:l.normalizeClass(n.closeIconClasses),icon:"times-circle",type:"outline",size:"lg",color:"white"},null,8,["class"])]),item:l.withCtx(({item:p})=>[l.createElementVNode("div",NW,[l.createElementVNode("img",{src:(p==null?void 0:p.itemImageSrc)||(p==null?void 0:p.objectURL)||(p==null?void 0:p.original.url),alt:p==null?void 0:p.alt,class:l.normalizeClass(n.itemClasses),style:l.normalizeStyle([{left:n.left,opacity:n.opacity},`transform: scale(${n.scale})`])},null,14,PW)],512)]),thumbnail:l.withCtx(({item:p})=>[l.createElementVNode("img",{src:(p==null?void 0:p.objectURL)||(p==null?void 0:p.original.url),alt:p.alt,class:"rounded-lg block min-h-24 min-w-24 max-w-24 max-h-24 object-cover"},null,8,_W)]),previousitemicon:l.withCtx(()=>[l.createVNode(s,{icon:"chevron-circle-left",type:"outline",size:"md",color:"white"})]),nextitemicon:l.withCtx(()=>[l.createVNode(s,{icon:"chevron-circle-right",type:"outline",size:"md",color:"white"})]),previousthumbnailicon:l.withCtx(()=>[n.images.length>n.thumbnailsVisible?(l.openBlock(),l.createBlock(s,{key:0,icon:"chevron-left",type:"line",size:"sm",color:"white"})):l.createCommentVNode("",!0)]),nextthumbnailicon:l.withCtx(()=>[n.images.length>n.thumbnailsVisible?(l.openBlock(),l.createBlock(s,{key:0,icon:"chevron-right",type:"line",size:"sm",color:"white"})):l.createCommentVNode("",!0)]),_:1},8,["activeIndex","visible","value","numVisible","showItemNavigators","showThumbnails","showIndicators","base-z-index"]),n.files?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass(n.thumbnailContainerClasses)},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(n.files,(p,m)=>{var y;return l.openBlock(),l.createElementBlock("div",{ref_for:!0,ref:"longPressRef",key:p.name||((y=p.original)==null?void 0:y.name)||m,class:l.normalizeClass(["p-0 relative rounded-lg",{"shrink-0":n.deviceType!=="desktop"}]),onMouseover:b=>n.hoveredIndex=m,onMouseleave:e[2]||(e[2]=b=>n.hoveredIndex=null),onClick:b=>n.onClickThumbnail(m,p)},[l.createVNode(u,{position:"top"},{trigger:l.withCtx(()=>[p.type&&p.type.includes("image")&&!p.type.includes("tif")?(l.openBlock(),l.createElementBlock("img",{key:0,src:(p==null?void 0:p.objectURL)||(p==null?void 0:p.original.url),alt:p==null?void 0:p.alt,class:"rounded-lg cursor-pointer w-16 h-16 object-cover bg-gray-0 border-gray-20 border"},null,8,BW)):(l.openBlock(),l.createElementBlock("div",RW,[l.createVNode(s,{icon:"file-document",size:"xl",color:"white",class:"mr-3 shrink-0 p-2 bg-green-20 rounded-lg h-full"}),l.createElementVNode("div",$W,[l.createElementVNode("div",FW,l.toDisplayString(p.name||p.original.name),1),l.createElementVNode("div",VW,l.toDisplayString((p.name||p.original.name).match(/([^.]+$)/)[0]),1)])])),n.deviceType!=="desktop"?(l.openBlock(),l.createElementBlock("div",jW)):l.createCommentVNode("",!0),n.showRemove&&n.showOnHover&&n.hoveredIndex===m&&n.deviceType==="desktop"&&!n.processing?(l.openBlock(),l.createBlock(c,{key:3,color:"inkwell-30",shape:"circle",class:"cursor-pointer absolute -top-2 -right-2 shadow-solid z-10",onClick:l.withModifiers(b=>n.onRemoveFile(p),["stop"])},{icon:l.withCtx(()=>[l.createVNode(s,{icon:"close",size:"xs",type:"line",color:"white"})]),_:2},1032,["onClick"])):l.createCommentVNode("",!0)]),content:l.withCtx(()=>{var b;return[l.createTextVNode(l.toDisplayString(p.name||((b=p.original)==null?void 0:b.name)),1)]}),_:2},1024),l.createVNode(l.Transition,{name:"fade"},{default:l.withCtx(()=>[n.processing?(l.openBlock(),l.createElementBlock("div",zW,HW)):l.createCommentVNode("",!0)]),_:1})],42,LW)}),128)),l.createVNode(l.Transition,{name:"fade"},{default:l.withCtx(()=>[n.longPressedHook?(l.openBlock(),l.createBlock(d,{key:0,modelValue:n.longPressedHook,"onUpdate:modelValue":e[3]||(e[3]=p=>n.longPressedHook=p),actions:n.menuActions,links:n.linkActions,"links-background":"light-gray","onClick:link":n.onClickMenuLink,"onClick:action":e[4]||(e[4]=p=>n.longPressedHook=!1)},null,8,["modelValue","actions","links","onClick:link"])):l.createCommentVNode("",!0)]),_:1})],2)):l.createCommentVNode("",!0),l.createVNode(l.Transition,{name:"slide-up-fade"},{default:l.withCtx(()=>[n.showFileViewer&&n.normalizedAttachment&&n.activeAttachment?(l.openBlock(),l.createBlock(h,{key:0,modelValue:n.showFileViewer,"onUpdate:modelValue":e[6]||(e[6]=p=>n.showFileViewer=p),"show-close-button":!1,"content-class":"p-0","header-class":"border-b border-solid border-gray-20","title-class":"min-w-0 truncate"},{header:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(n.normalizedAttachment.name),1)]),headerAction:l.withCtx(()=>[!n.normalizedAttachment.type.includes("video")&&n.normalizedAttachment.type!=="audio/mpeg"&&n.normalizedAttachment.type!=="application/pdf"?(l.openBlock(),l.createBlock(s,{key:0,icon:"arrow-to-bottom",type:"line",size:"md",color:"inkwell-40",class:"shrink-0 cursor-pointer",onClick:e[5]||(e[5]=p=>n.downloadDocument(n.activeAttachment))})):l.createCommentVNode("",!0)]),default:l.withCtx(()=>[n.normalizedAttachment.type==="application/pdf"?(l.openBlock(),l.createBlock(f,{key:0,url:n.normalizedAttachment.url},null,8,["url"])):n.normalizedAttachment.type.includes("video")?(l.openBlock(),l.createElementBlock("video",UW,[l.createElementVNode("source",{src:n.normalizedAttachment.url},null,8,ZW),l.createElementVNode("div",WW,[l.createVNode(s,{icon:"file-document",size:"xl",color:"inkwell-30"}),l.createTextVNode(" "+l.toDisplayString(n.normalizedAttachment.extension),1)])])):n.normalizedAttachment.type==="audio/mpeg"?(l.openBlock(),l.createElementBlock("audio",{key:2,controls:"",src:n.normalizedAttachment.url,class:"mx-auto my-6"},null,8,KW)):(l.openBlock(),l.createElementBlock("object",{key:3,data:n.normalizedAttachment.url,type:n.normalizedAttachment.type,class:"w-full h-auto"},[l.createElementVNode("div",GW,[l.createVNode(s,{icon:"file-document",size:"xl",color:"inkwell-30"}),l.createTextVNode(" "+l.toDisplayString(n.normalizedAttachment.extension),1)])],8,qW))]),_:1},8,["modelValue"])):l.createCommentVNode("",!0)]),_:1})],512)}const n6=ye(IW,[["render",YW],["__scopeId","data-v-ba426870"]]),QW=l.defineComponent({name:"QWarningModal",components:{QModal:e6},props:{toggle:{type:Boolean,default:!1,required:!0},action:{type:Function,default:()=>{}},processing:{type:Boolean,default:!1}},emits:["update:toggle","update:action"],setup(n,{emit:e}){return{toggleModal:l.computed({get:()=>n.toggle,set:r=>{e("update:toggle",r)}}),mq:_n}}}),XW={key:0,class:"flex flex-col gap-2 text-center"},JW={class:"text-lg font-bold text-inkwell-30 leading-6"},eK={class:"text-inkwell-0 mb-6"},tK={key:1,class:"flex flex-col gap-2 text-center"},nK={class:"text-[1.25rem] font-bold text-center text-inkwell-30"},rK={class:"text-sm text-center text-inkwell-0 mb-2"},iK={class:"flex flex-col items-center justify-center gap-3 md:gap-2"};function oK(n,e,t,r,i,o){const s=l.resolveComponent("q-button"),a=l.resolveComponent("q-modal-content"),c=l.resolveComponent("q-modal");return l.openBlock(),l.createBlock(l.Transition,{name:n.mq.md?"fade":"slide-up"},{default:l.withCtx(()=>[n.toggleModal?(l.openBlock(),l.createBlock(c,{key:0,class:"warning-modal !z-[170]",dismissible:!1,overlay:n.mq.md?"white-transparent":"black-transparent","container-class":"h-fit min-h-fit","footer-class":"mt-2 md:mt-6",onClose:e[1]||(e[1]=u=>n.toggleModal=!1)},{default:l.withCtx(()=>[l.createVNode(a,null,{body:l.withCtx(()=>[n.mq.md?(l.openBlock(),l.createElementBlock("div",XW,[l.createElementVNode("h2",JW,[l.renderSlot(n.$slots,"desktopHeader",{},void 0,!0)]),l.createElementVNode("p",eK,[l.renderSlot(n.$slots,"desktopMessage",{},void 0,!0)])])):(l.openBlock(),l.createElementBlock("div",tK,[l.createElementVNode("h2",nK,[l.renderSlot(n.$slots,"mobileHeader",{},void 0,!0)]),l.createElementVNode("p",rK,[l.renderSlot(n.$slots,"mobileMessage",{},void 0,!0)])]))]),footer:l.withCtx(()=>[l.createElementVNode("div",iK,[l.createVNode(s,{disabled:n.processing,loading:n.processing,class:l.normalizeClass([n.mq.md?"mx-2":"w-full"]),size:"lg",status:"danger",onClick:n.action},{default:l.withCtx(()=>[l.renderSlot(n.$slots,"buttonText",{},void 0,!0)]),_:3},8,["disabled","loading","class","onClick"]),l.createVNode(s,{class:l.normalizeClass([n.mq.md?"mx-2":"w-full"]),disabled:n.processing,status:n.mq.md?"link-secondary":"secondary",size:"lg",onClick:e[0]||(e[0]=u=>n.toggleModal=!1)},{default:l.withCtx(()=>[l.renderSlot(n.$slots,"cancelText",{},()=>[l.createTextVNode(l.toDisplayString(n.$t("HC_CANCEL")),1)],!0)]),_:3},8,["class","disabled","status"])])]),_:3})]),_:3},8,["overlay"])):l.createCommentVNode("",!0)]),_:3},8,["name"])}const lE=ye(QW,[["render",oK],["__scopeId","data-v-a8bfc627"]]),sK=l.defineComponent({name:"QPopover",props:{align:{type:String,default:"left"},hasCaret:{type:Boolean,default:!0},modelValue:{type:Boolean,default:!1},position:{type:String,default:"bottom"},reposition:{type:Boolean,default:!0},size:{type:String,default:"md"},trigger:{type:String,default:"click"}},emits:["update:modelValue"],setup(n,{emit:e}){const t=l.ref(!1),r=l.ref(""),i=l.ref(null),o=l.computed(()=>t.value===!0&&n.reposition===!0?a(n.align):n.align),s=l.computed(()=>t.value===!0&&n.reposition===!0?c(n.position):n.position),a=b=>{if(!i.value||u(i.value.children[1]))return b;const w=i.value.children[0].getBoundingClientRect(),v=i.value.children[1].getBoundingClientRect();if(b==="left"||b==="right"||b==="center"){const k=w.left;return window.innerWidth-k<v.width?"right":"left"}else{const k=w.top;return window.innerHeight-k<v.height?"bottom":"top"}},c=b=>{if(!i.value||u(i.value.children[1]))return b;const w=i.value.children[0].getBoundingClientRect(),v=i.value.children[1].getBoundingClientRect();if(b==="top"||b==="bottom"){const k=w.top;return window.innerHeight-k<v.height?"top":"bottom"}else{const k=w.left;return window.innerWidth-k<v.width?"left":"right"}},u=b=>{const w=b.getBoundingClientRect();return w?w.top>=0&&w.left>=0&&w.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&w.right<=(window.innerWidth||document.documentElement.clientWidth):!1},d=()=>{(n.trigger==="click"||n.trigger==="both")&&e("update:modelValue",!n.modelValue)},f=()=>{n.trigger!=="click"&&e("update:modelValue",!1)},h=()=>{n.trigger!=="click"&&e("update:modelValue",!0)},p=()=>{var w;const b=(w=i.value)==null?void 0:w.children[0];if(b){const v=b.clientWidth,k=b.clientHeight;switch(o.value){case"left":r.value=`margin-left: ${v/2-10}px;`;break;case"right":r.value=`margin-right: ${v/2-10}px;`;break;case"top":r.value=`margin-top: ${k/2-10}px;`;break;case"bottom":r.value=`margin-bottom: ${k/2-10}px;`;break}}};F5(i,()=>{e("update:modelValue",!1)});function m(){t.value=!1}function y(){var b;t.value=!0,!u((b=i.value)==null?void 0:b.children[1])&&n.reposition===!0&&p()}return{entered:t,offsetStyle:r,popover:i,alignment:o,positioning:s,getAlignment:a,getPositioning:c,isElementInView:u,onAfterLeave:m,onClick:d,onClickOutside:F5,onEnter:y,onMouseLeave:f,onMouseOver:h}}});function aK(n,e,t,r,i,o){return l.openBlock(),l.createElementBlock("div",{ref:"popover",class:"popover-container",onMouseleave:e[0]||(e[0]=(...s)=>n.onMouseLeave&&n.onMouseLeave(...s))},[l.renderSlot(n.$slots,"trigger",{onClick:n.onClick,onMouseOver:n.onMouseOver},void 0,!0),l.createVNode(l.Transition,{name:"fade",onEnter:n.onEnter,onAfterLeave:n.onAfterLeave},{default:l.withCtx(()=>[n.modelValue?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass(["popover","popover-"+n.alignment,"popover-"+n.size,"popover-on-"+n.positioning,{"has-caret":n.hasCaret}]),style:l.normalizeStyle(n.offsetStyle)},[l.renderSlot(n.$slots,"content",{},void 0,!0)],6)):l.createCommentVNode("",!0)]),_:3},8,["onEnter","onAfterLeave"])],544)}const cE=ye(sK,[["render",aK],["__scopeId","data-v-86f2575d"]]);function Qt(n){this.content=n}Qt.prototype={constructor:Qt,find:function(n){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===n)return e;return-1},get:function(n){var e=this.find(n);return e==-1?void 0:this.content[e+1]},update:function(n,e,t){var r=t&&t!=n?this.remove(t):this,i=r.find(n),o=r.content.slice();return i==-1?o.push(t||n,e):(o[i+1]=e,t&&(o[i]=t)),new Qt(o)},remove:function(n){var e=this.find(n);if(e==-1)return this;var t=this.content.slice();return t.splice(e,2),new Qt(t)},addToStart:function(n,e){return new Qt([n,e].concat(this.remove(n).content))},addToEnd:function(n,e){var t=this.remove(n).content.slice();return t.push(n,e),new Qt(t)},addBefore:function(n,e,t){var r=this.remove(e),i=r.content.slice(),o=r.find(n);return i.splice(o==-1?i.length:o,0,e,t),new Qt(i)},forEach:function(n){for(var e=0;e<this.content.length;e+=2)n(this.content[e],this.content[e+1])},prepend:function(n){return n=Qt.from(n),n.size?new Qt(n.content.concat(this.subtract(n).content)):this},append:function(n){return n=Qt.from(n),n.size?new Qt(this.subtract(n).content.concat(n.content)):this},subtract:function(n){var e=this;n=Qt.from(n);for(var t=0;t<n.content.length;t+=2)e=e.remove(n.content[t]);return e},toObject:function(){var n={};return this.forEach(function(e,t){n[e]=t}),n},get size(){return this.content.length>>1}},Qt.from=function(n){if(n instanceof Qt)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new Qt(e)};function uE(n,e,t){for(let r=0;;r++){if(r==n.childCount||r==e.childCount)return n.childCount==e.childCount?null:t;let i=n.child(r),o=e.child(r);if(i==o){t+=i.nodeSize;continue}if(!i.sameMarkup(o))return t;if(i.isText&&i.text!=o.text){for(let s=0;i.text[s]==o.text[s];s++)t++;return t}if(i.content.size||o.content.size){let s=uE(i.content,o.content,t+1);if(s!=null)return s}t+=i.nodeSize}}function dE(n,e,t,r){for(let i=n.childCount,o=e.childCount;;){if(i==0||o==0)return i==o?null:{a:t,b:r};let s=n.child(--i),a=e.child(--o),c=s.nodeSize;if(s==a){t-=c,r-=c;continue}if(!s.sameMarkup(a))return{a:t,b:r};if(s.isText&&s.text!=a.text){let u=0,d=Math.min(s.text.length,a.text.length);for(;u<d&&s.text[s.text.length-u-1]==a.text[a.text.length-u-1];)u++,t--,r--;return{a:t,b:r}}if(s.content.size||a.content.size){let u=dE(s.content,a.content,t-1,r-1);if(u)return u}t-=c,r-=c}}class G{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,t,r,i=0,o){for(let s=0,a=0;a<t;s++){let c=this.content[s],u=a+c.nodeSize;if(u>e&&r(c,i+a,o||null,s)!==!1&&c.content.size){let d=a+1;c.nodesBetween(Math.max(0,e-d),Math.min(c.content.size,t-d),r,i+d)}a=u}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,r,i){let o="",s=!0;return this.nodesBetween(e,t,(a,c)=>{let u=a.isText?a.text.slice(Math.max(e,c)-c,t-c):a.isLeaf?i?typeof i=="function"?i(a):i:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&u||a.isTextblock)&&r&&(s?s=!1:o+=r),o+=u},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,r=e.firstChild,i=this.content.slice(),o=0;for(t.isText&&t.sameMarkup(r)&&(i[i.length-1]=t.withText(t.text+r.text),o=1);o<e.content.length;o++)i.push(e.content[o]);return new G(i,this.size+e.size)}cut(e,t=this.size){if(e==0&&t==this.size)return this;let r=[],i=0;if(t>e)for(let o=0,s=0;s<t;o++){let a=this.content[o],c=s+a.nodeSize;c>e&&((s<e||c>t)&&(a.isText?a=a.cut(Math.max(0,e-s),Math.min(a.text.length,t-s)):a=a.cut(Math.max(0,e-s-1),Math.min(a.content.size,t-s-1))),r.push(a),i+=a.nodeSize),s=c}return new G(r,i)}cutByIndex(e,t){return e==t?G.empty:e==0&&t==this.content.length?this:new G(this.content.slice(e,t))}replaceChild(e,t){let r=this.content[e];if(r==t)return this;let i=this.content.slice(),o=this.size+t.nodeSize-r.nodeSize;return i[e]=t,new G(i,o)}addToStart(e){return new G([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new G(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,r=0;t<this.content.length;t++){let i=this.content[t];e(i,r,t),r+=i.nodeSize}}findDiffStart(e,t=0){return uE(this,e,t)}findDiffEnd(e,t=this.size,r=e.size){return dE(this,e,t,r)}findIndex(e,t=-1){if(e==0)return bm(0,e);if(e==this.size)return bm(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,i=0;;r++){let o=this.child(r),s=i+o.nodeSize;if(s>=e)return s==e||t>0?bm(r+1,s):bm(r,i);i=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return G.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new G(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return G.empty;let t,r=0;for(let i=0;i<e.length;i++){let o=e[i];r+=o.nodeSize,i&&o.isText&&e[i-1].sameMarkup(o)?(t||(t=e.slice(0,i)),t[t.length-1]=o.withText(t[t.length-1].text+o.text)):t&&t.push(o)}return new G(t||e,r)}static from(e){if(!e)return G.empty;if(e instanceof G)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new G([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}G.empty=new G([],0);const r6={index:0,offset:0};function bm(n,e){return r6.index=n,r6.offset=e,r6}function wm(n,e){if(n===e)return!0;if(!(n&&typeof n=="object")||!(e&&typeof e=="object"))return!1;let t=Array.isArray(n);if(Array.isArray(e)!=t)return!1;if(t){if(n.length!=e.length)return!1;for(let r=0;r<n.length;r++)if(!wm(n[r],e[r]))return!1}else{for(let r in n)if(!(r in e)||!wm(n[r],e[r]))return!1;for(let r in e)if(!(r in n))return!1}return!0}let We=class s8{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,r=!1;for(let i=0;i<e.length;i++){let o=e[i];if(this.eq(o))return e;if(this.type.excludes(o.type))t||(t=e.slice(0,i));else{if(o.type.excludes(this.type))return e;!r&&o.type.rank>this.type.rank&&(t||(t=e.slice(0,i)),t.push(this),r=!0),t&&t.push(o)}}return t||(t=e.slice()),r||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&wm(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[t.type];if(!r)throw new RangeError(`There is no mark type ${t.type} in this schema`);return r.create(t.attrs)}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(t[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return s8.none;if(e instanceof s8)return[e];let t=e.slice();return t.sort((r,i)=>r.type.rank-i.type.rank),t}};We.none=[];class vm extends Error{}class te{constructor(e,t,r){this.content=e,this.openStart=t,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let r=hE(this.content,e+this.openStart,t);return r&&new te(r,this.openStart,this.openEnd)}removeBetween(e,t){return new te(fE(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return te.empty;let r=t.openStart||0,i=t.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new te(G.fromJSON(e,t.content),r,i)}static maxOpen(e,t=!0){let r=0,i=0;for(let o=e.firstChild;o&&!o.isLeaf&&(t||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=e.lastChild;o&&!o.isLeaf&&(t||!o.type.spec.isolating);o=o.lastChild)i++;return new te(e,r,i)}}te.empty=new te(G.empty,0,0);function fE(n,e,t){let{index:r,offset:i}=n.findIndex(e),o=n.maybeChild(r),{index:s,offset:a}=n.findIndex(t);if(i==e||o.isText){if(a!=t&&!n.child(s).isText)throw new RangeError("Removing non-flat range");return n.cut(0,e).append(n.cut(t))}if(r!=s)throw new RangeError("Removing non-flat range");return n.replaceChild(r,o.copy(fE(o.content,e-i-1,t-i-1)))}function hE(n,e,t,r){let{index:i,offset:o}=n.findIndex(e),s=n.maybeChild(i);if(o==e||s.isText)return r&&!r.canReplace(i,i,t)?null:n.cut(0,e).append(t).append(n.cut(e));let a=hE(s.content,e-o-1,t);return a&&n.replaceChild(i,s.copy(a))}function lK(n,e,t){if(t.openStart>n.depth)throw new vm("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new vm("Inconsistent open depths");return pE(n,e,t,0)}function pE(n,e,t,r){let i=n.index(r),o=n.node(r);if(i==e.index(r)&&r<n.depth-t.openStart){let s=pE(n,e,t,r+1);return o.copy(o.content.replaceChild(i,s))}else if(t.content.size)if(!t.openStart&&!t.openEnd&&n.depth==r&&e.depth==r){let s=n.parent,a=s.content;return el(s,a.cut(0,n.parentOffset).append(t.content).append(a.cut(e.parentOffset)))}else{let{start:s,end:a}=cK(t,n);return el(o,gE(n,s,a,e,r))}else return el(o,Cm(n,e,r))}function mE(n,e){if(!e.type.compatibleContent(n.type))throw new vm("Cannot join "+e.type.name+" onto "+n.type.name)}function i6(n,e,t){let r=n.node(t);return mE(r,e.node(t)),r}function Ja(n,e){let t=e.length-1;t>=0&&n.isText&&n.sameMarkup(e[t])?e[t]=n.withText(e[t].text+n.text):e.push(n)}function w2(n,e,t,r){let i=(e||n).node(t),o=0,s=e?e.index(t):i.childCount;n&&(o=n.index(t),n.depth>t?o++:n.textOffset&&(Ja(n.nodeAfter,r),o++));for(let a=o;a<s;a++)Ja(i.child(a),r);e&&e.depth==t&&e.textOffset&&Ja(e.nodeBefore,r)}function el(n,e){return n.type.checkContent(e),n.copy(e)}function gE(n,e,t,r,i){let o=n.depth>i&&i6(n,e,i+1),s=r.depth>i&&i6(t,r,i+1),a=[];return w2(null,n,i,a),o&&s&&e.index(i)==t.index(i)?(mE(o,s),Ja(el(o,gE(n,e,t,r,i+1)),a)):(o&&Ja(el(o,Cm(n,e,i+1)),a),w2(e,t,i,a),s&&Ja(el(s,Cm(t,r,i+1)),a)),w2(r,null,i,a),new G(a)}function Cm(n,e,t){let r=[];if(w2(null,n,t,r),n.depth>t){let i=i6(n,e,t+1);Ja(el(i,Cm(n,e,t+1)),r)}return w2(e,null,t,r),new G(r)}function cK(n,e){let t=e.depth-n.openStart,i=e.node(t).copy(n.content);for(let o=t-1;o>=0;o--)i=e.node(o).copy(G.from(i));return{start:i.resolveNoCache(n.openStart+t),end:i.resolveNoCache(i.content.size-n.openEnd-t)}}class v2{constructor(e,t,r){this.pos=e,this.path=t,this.parentOffset=r,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(t);return r?e.child(t).cut(r):i}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let r=this.path[t*3],i=t==0?0:this.path[t*3-1]+1;for(let o=0;o<e;o++)i+=r.child(o).nodeSize;return i}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return We.none;if(this.textOffset)return e.child(t).marks;let r=e.maybeChild(t-1),i=e.maybeChild(t);if(!r){let a=r;r=i,i=a}let o=r.marks;for(var s=0;s<o.length;s++)o[s].type.spec.inclusive===!1&&(!i||!o[s].isInSet(i.marks))&&(o=o[s--].removeFromSet(o));return o}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let r=t.marks,i=e.parent.maybeChild(e.index());for(var o=0;o<r.length;o++)r[o].type.spec.inclusive===!1&&(!i||!r[o].isInSet(i.marks))&&(r=r[o--].removeFromSet(r));return r}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!t||t(this.node(r))))return new km(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let r=[],i=0,o=t;for(let s=e;;){let{index:a,offset:c}=s.content.findIndex(o),u=o-c;if(r.push(s,a,i+c),!u||(s=s.child(a),s.isText))break;o=u-1,i+=c+1}return new v2(t,r,o)}static resolveCached(e,t){for(let i=0;i<o6.length;i++){let o=o6[i];if(o.pos==t&&o.doc==e)return o}let r=o6[s6]=v2.resolve(e,t);return s6=(s6+1)%uK,r}}let o6=[],s6=0,uK=12;class km{constructor(e,t,r){this.$from=e,this.$to=t,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const dK=Object.create(null);let tl=class a8{constructor(e,t,r,i=We.none){this.type=e,this.attrs=t,this.marks=i,this.content=r||G.empty}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,r,i=0){this.content.nodesBetween(e,t,r,i,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,t,r,i){return this.content.textBetween(e,t,r,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,r){return this.type==e&&wm(this.attrs,t||e.defaultAttrs||dK)&&We.sameSet(this.marks,r||We.none)}copy(e=null){return e==this.content?this:new a8(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new a8(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,r=!1){if(e==t)return te.empty;let i=this.resolve(e),o=this.resolve(t),s=r?0:i.sharedDepth(t),a=i.start(s),u=i.node(s).content.cut(i.pos-a,o.pos-a);return new te(u,i.depth-s,o.depth-s)}replace(e,t,r){return lK(this.resolve(e),this.resolve(t),r)}nodeAt(e){for(let t=this;;){let{index:r,offset:i}=t.content.findIndex(e);if(t=t.maybeChild(r),!t)return null;if(i==e||t.isText)return t;e-=i+1}}childAfter(e){let{index:t,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(t),index:t,offset:r};let i=this.content.child(t-1);return{node:i,index:t-1,offset:r-i.nodeSize}}resolve(e){return v2.resolveCached(this,e)}resolveNoCache(e){return v2.resolve(this,e)}rangeHasMark(e,t,r){let i=!1;return t>e&&this.nodesBetween(e,t,o=>(r.isInSet(o.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),yE(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,r=G.empty,i=0,o=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,i,o),a=s&&s.matchFragment(this.content,t);if(!a||!a.validEnd)return!1;for(let c=i;c<o;c++)if(!this.type.allowsMarks(r.child(c).marks))return!1;return!0}canReplaceWith(e,t,r,i){if(i&&!this.type.allowsMarks(i))return!1;let o=this.contentMatchAt(e).matchType(r),s=o&&o.matchFragment(this.content,t);return s?s.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content);let e=We.none;for(let t=0;t<this.marks.length;t++)e=this.marks[t].addToSet(e);if(!We.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let r=null;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,r)}let i=G.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,i,r)}};tl.prototype.text=void 0;class Sm extends tl{constructor(e,t,r,i){if(super(e,t,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):yE(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Sm(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Sm(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function yE(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}class nl{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let r=new fK(e,t);if(r.next==null)return nl.empty;let i=bE(r);r.next&&r.err("Unexpected trailing text");let o=wK(bK(i));return vK(o,r),o}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,r=e.childCount){let i=this;for(let o=t;i&&o<r;o++)i=i.matchType(e.child(o).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let r=0;r<e.next.length;r++)if(this.next[t].type==e.next[r].type)return!0;return!1}fillBefore(e,t=!1,r=0){let i=[this];function o(s,a){let c=s.matchFragment(e,r);if(c&&(!t||c.validEnd))return G.from(a.map(u=>u.createAndFill()));for(let u=0;u<s.next.length;u++){let{type:d,next:f}=s.next[u];if(!(d.isText||d.hasRequiredAttrs())&&i.indexOf(f)==-1){i.push(f);let h=o(f,a.concat(d));if(h)return h}}return null}return o(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),o=i.match;if(o.matchType(e)){let s=[];for(let a=i;a.type;a=a.via)s.push(a.type);return s.reverse()}for(let s=0;s<o.next.length;s++){let{type:a,next:c}=o.next[s];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in t)&&(!i.type||c.validEnd)&&(r.push({match:a.contentMatch,type:a,via:i}),t[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(r){e.push(r);for(let i=0;i<r.next.length;i++)e.indexOf(r.next[i].next)==-1&&t(r.next[i].next)}return t(this),e.map((r,i)=>{let o=i+(r.validEnd?"*":" ")+" ";for(let s=0;s<r.next.length;s++)o+=(s?", ":"")+r.next[s].type.name+"->"+e.indexOf(r.next[s].next);return o}).join(`
|
|
132
132
|
`)}}nl.empty=new nl(!0);class fK{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function bE(n){let e=[];do e.push(hK(n));while(n.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function hK(n){let e=[];do e.push(pK(n));while(n.next&&n.next!=")"&&n.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function pK(n){let e=yK(n);for(;;)if(n.eat("+"))e={type:"plus",expr:e};else if(n.eat("*"))e={type:"star",expr:e};else if(n.eat("?"))e={type:"opt",expr:e};else if(n.eat("{"))e=mK(n,e);else break;return e}function wE(n){/\D/.test(n.next)&&n.err("Expected number, got '"+n.next+"'");let e=Number(n.next);return n.pos++,e}function mK(n,e){let t=wE(n),r=t;return n.eat(",")&&(n.next!="}"?r=wE(n):r=-1),n.eat("}")||n.err("Unclosed braced range"),{type:"range",min:t,max:r,expr:e}}function gK(n,e){let t=n.nodeTypes,r=t[e];if(r)return[r];let i=[];for(let o in t){let s=t[o];s.groups.indexOf(e)>-1&&i.push(s)}return i.length==0&&n.err("No node type or group '"+e+"' found"),i}function yK(n){if(n.eat("(")){let e=bE(n);return n.eat(")")||n.err("Missing closing paren"),e}else if(/\W/.test(n.next))n.err("Unexpected token '"+n.next+"'");else{let e=gK(n,n.next).map(t=>(n.inline==null?n.inline=t.isInline:n.inline!=t.isInline&&n.err("Mixing inline and block content"),{type:"name",value:t}));return n.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function bK(n){let e=[[]];return i(o(n,0),t()),e;function t(){return e.push([])-1}function r(s,a,c){let u={term:c,to:a};return e[s].push(u),u}function i(s,a){s.forEach(c=>c.to=a)}function o(s,a){if(s.type=="choice")return s.exprs.reduce((c,u)=>c.concat(o(u,a)),[]);if(s.type=="seq")for(let c=0;;c++){let u=o(s.exprs[c],a);if(c==s.exprs.length-1)return u;i(u,a=t())}else if(s.type=="star"){let c=t();return r(a,c),i(o(s.expr,c),c),[r(c)]}else if(s.type=="plus"){let c=t();return i(o(s.expr,a),c),i(o(s.expr,c),c),[r(c)]}else{if(s.type=="opt")return[r(a)].concat(o(s.expr,a));if(s.type=="range"){let c=a;for(let u=0;u<s.min;u++){let d=t();i(o(s.expr,c),d),c=d}if(s.max==-1)i(o(s.expr,c),c);else for(let u=s.min;u<s.max;u++){let d=t();r(c,d),i(o(s.expr,c),d),c=d}return[r(c)]}else{if(s.type=="name")return[r(a,void 0,s.value)];throw new Error("Unknown expr type")}}}}function vE(n,e){return e-n}function CE(n,e){let t=[];return r(e),t.sort(vE);function r(i){let o=n[i];if(o.length==1&&!o[0].term)return r(o[0].to);t.push(i);for(let s=0;s<o.length;s++){let{term:a,to:c}=o[s];!a&&t.indexOf(c)==-1&&r(c)}}}function wK(n){let e=Object.create(null);return t(CE(n,0));function t(r){let i=[];r.forEach(s=>{n[s].forEach(({term:a,to:c})=>{if(!a)return;let u;for(let d=0;d<i.length;d++)i[d][0]==a&&(u=i[d][1]);CE(n,c).forEach(d=>{u||i.push([a,u=[]]),u.indexOf(d)==-1&&u.push(d)})})});let o=e[r.join(",")]=new nl(r.indexOf(n.length-1)>-1);for(let s=0;s<i.length;s++){let a=i[s][1].sort(vE);o.next.push({type:i[s][0],next:e[a.join(",")]||t(a)})}return o}}function vK(n,e){for(let t=0,r=[n];t<r.length;t++){let i=r[t],o=!i.validEnd,s=[];for(let a=0;a<i.next.length;a++){let{type:c,next:u}=i.next[a];s.push(c.name),o&&!(c.isText||c.hasRequiredAttrs())&&(o=!1),r.indexOf(u)==-1&&r.push(u)}o&&e.err("Only non-generatable nodes ("+s.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function kE(n){let e=Object.create(null);for(let t in n){let r=n[t];if(!r.hasDefault)return null;e[t]=r.default}return e}function SE(n,e){let t=Object.create(null);for(let r in n){let i=e&&e[r];if(i===void 0){let o=n[r];if(o.hasDefault)i=o.default;else throw new RangeError("No value supplied for attribute "+r)}t[r]=i}return t}function ME(n){let e=Object.create(null);if(n)for(let t in n)e[t]=new CK(n[t]);return e}let EE=class wP{constructor(e,t,r){this.name=e,this.schema=t,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=ME(r.attrs),this.defaultAttrs=kE(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==nl.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:SE(this.attrs,e)}create(e=null,t,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new tl(this,this.computeAttrs(e),G.from(t),We.setFrom(r))}createChecked(e=null,t,r){return t=G.from(t),this.checkContent(t),new tl(this,this.computeAttrs(e),t,We.setFrom(r))}createAndFill(e=null,t,r){if(e=this.computeAttrs(e),t=G.from(t),t.size){let s=this.contentMatch.fillBefore(t);if(!s)return null;t=s.append(t)}let i=this.contentMatch.matchFragment(t),o=i&&i.fillBefore(G.empty,!0);return o?new tl(this,e,t.append(o),We.setFrom(r)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let t;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?t&&t.push(e[r]):t||(t=e.slice(0,r));return t?t.length?t:We.none:e}static compile(e,t){let r=Object.create(null);e.forEach((o,s)=>r[o]=new wP(o,t,s));let i=t.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let o in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};class CK{constructor(e){this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default}get isRequired(){return!this.hasDefault}}class Mm{constructor(e,t,r,i){this.name=e,this.rank=t,this.schema=r,this.spec=i,this.attrs=ME(i.attrs),this.excluded=null;let o=kE(this.attrs);this.instance=o?new We(this,o):null}create(e=null){return!e&&this.instance?this.instance:new We(this,SE(this.attrs,e))}static compile(e,t){let r=Object.create(null),i=0;return e.forEach((o,s)=>r[o]=new Mm(o,i++,t,s)),r}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}excludes(e){return this.excluded.indexOf(e)>-1}}class kK{constructor(e){this.cached=Object.create(null);let t=this.spec={};for(let i in e)t[i]=e[i];t.nodes=Qt.from(e.nodes),t.marks=Qt.from(e.marks||{}),this.nodes=EE.compile(this.spec.nodes,this),this.marks=Mm.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let o=this.nodes[i],s=o.spec.content||"",a=o.spec.marks;o.contentMatch=r[s]||(r[s]=nl.parse(s,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.markSet=a=="_"?null:a?AE(this,a.split(" ")):a==""||!o.inlineContent?[]:null}for(let i in this.marks){let o=this.marks[i],s=o.spec.excludes;o.excluded=s==null?[o]:s==""?[]:AE(this,s.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,r,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof EE){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(t,r,i)}text(e,t){let r=this.nodes.text;return new Sm(r,r.defaultAttrs,e,We.setFrom(t))}mark(e,t){return typeof e=="string"&&(e=this.marks[e]),e.create(t)}nodeFromJSON(e){return tl.fromJSON(this,e)}markFromJSON(e){return We.fromJSON(this,e)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function AE(n,e){let t=[];for(let r=0;r<e.length;r++){let i=e[r],o=n.marks[i],s=o;if(o)t.push(o);else for(let a in n.marks){let c=n.marks[a];(i=="_"||c.spec.group&&c.spec.group.split(" ").indexOf(i)>-1)&&t.push(s=c)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return t}class rc{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[],t.forEach(r=>{r.tag?this.tags.push(r):r.style&&this.styles.push(r)}),this.normalizeLists=!this.tags.some(r=>{if(!/^(ul|ol)\b/.test(r.tag)||!r.node)return!1;let i=e.nodes[r.node];return i.contentMatch.matchType(i)})}parse(e,t={}){let r=new OE(this,t,!1);return r.addAll(e,t.from,t.to),r.finish()}parseSlice(e,t={}){let r=new OE(this,t,!0);return r.addAll(e,t.from,t.to),te.maxOpen(r.finish())}matchTag(e,t,r){for(let i=r?this.tags.indexOf(r)+1:0;i<this.tags.length;i++){let o=this.tags[i];if(EK(e,o.tag)&&(o.namespace===void 0||e.namespaceURI==o.namespace)&&(!o.context||t.matchesContext(o.context))){if(o.getAttrs){let s=o.getAttrs(e);if(s===!1)continue;o.attrs=s||void 0}return o}}}matchStyle(e,t,r,i){for(let o=i?this.styles.indexOf(i)+1:0;o<this.styles.length;o++){let s=this.styles[o],a=s.style;if(!(a.indexOf(e)!=0||s.context&&!r.matchesContext(s.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=t))){if(s.getAttrs){let c=s.getAttrs(t);if(c===!1)continue;s.attrs=c||void 0}return s}}}static schemaRules(e){let t=[];function r(i){let o=i.priority==null?50:i.priority,s=0;for(;s<t.length;s++){let a=t[s];if((a.priority==null?50:a.priority)<o)break}t.splice(s,0,i)}for(let i in e.marks){let o=e.marks[i].spec.parseDOM;o&&o.forEach(s=>{r(s=DE(s)),s.mark||s.ignore||s.clearMark||(s.mark=i)})}for(let i in e.nodes){let o=e.nodes[i].spec.parseDOM;o&&o.forEach(s=>{r(s=DE(s)),s.node||s.ignore||s.mark||(s.node=i)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new rc(e,rc.schemaRules(e)))}}const TE={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},SK={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},xE={ol:!0,ul:!0},Em=1,Am=2,C2=4;function IE(n,e,t){return e!=null?(e?Em:0)|(e==="full"?Am:0):n&&n.whitespace=="pre"?Em|Am:t&~C2}class Tm{constructor(e,t,r,i,o,s,a){this.type=e,this.attrs=t,this.marks=r,this.pendingMarks=i,this.solid=o,this.options=a,this.content=[],this.activeMarks=We.none,this.stashMarks=[],this.match=s||(a&C2?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(G.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(e.type))?(this.match=r,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&Em)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let o=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=o.withText(o.text.slice(0,o.text.length-i[0].length))}}let t=G.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(G.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}popFromStashMark(e){for(let t=this.stashMarks.length-1;t>=0;t--)if(e.eq(this.stashMarks[t]))return this.stashMarks.splice(t,1)[0]}applyPending(e){for(let t=0,r=this.pendingMarks;t<r.length;t++){let i=r[t];(this.type?this.type.allowsMarkType(i.type):TK(i.type,e))&&!i.isInSet(this.activeMarks)&&(this.activeMarks=i.addToSet(this.activeMarks),this.pendingMarks=i.removeFromSet(this.pendingMarks))}}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!TE.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class OE{constructor(e,t,r){this.parser=e,this.options=t,this.isOpen=r,this.open=0;let i=t.topNode,o,s=IE(null,t.preserveWhitespace,0)|(r?C2:0);i?o=new Tm(i.type,i.attrs,We.none,We.none,!0,t.topMatch||i.type.contentMatch,s):r?o=new Tm(null,null,We.none,We.none,!0,null,s):o=new Tm(e.schema.topNodeType,null,We.none,We.none,!0,null,s),this.nodes=[o],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e){e.nodeType==3?this.addTextNode(e):e.nodeType==1&&this.addElement(e)}withStyleRules(e,t){let r=e.getAttribute("style");if(!r)return t();let i=this.readStyles(AK(r));if(!i)return;let[o,s]=i,a=this.top;for(let c=0;c<s.length;c++)this.removePendingMark(s[c],a);for(let c=0;c<o.length;c++)this.addPendingMark(o[c]);t();for(let c=0;c<o.length;c++)this.removePendingMark(o[c],a);for(let c=0;c<s.length;c++)this.addPendingMark(s[c])}addTextNode(e){let t=e.nodeValue,r=this.top;if(r.options&Am||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(t)){if(r.options&Em)r.options&Am?t=t.replace(/\r\n?/g,`
|
|
133
133
|
`):t=t.replace(/\r?\n|\r/g," ");else if(t=t.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(t)&&this.open==this.nodes.length-1){let i=r.content[r.content.length-1],o=e.previousSibling;(!i||o&&o.nodeName=="BR"||i.isText&&/[ \t\r\n\u000c]$/.test(i.text))&&(t=t.slice(1))}t&&this.insertNode(this.parser.schema.text(t)),this.findInText(e)}else this.findInside(e)}addElement(e,t){let r=e.nodeName.toLowerCase(),i;xE.hasOwnProperty(r)&&this.parser.normalizeLists&&MK(e);let o=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(i=this.parser.matchTag(e,this,t));if(o?o.ignore:SK.hasOwnProperty(r))this.findInside(e),this.ignoreFallback(e);else if(!o||o.skip||o.closeParent){o&&o.closeParent?this.open=Math.max(0,this.open-1):o&&o.skip.nodeType&&(e=o.skip);let s,a=this.top,c=this.needsBlock;if(TE.hasOwnProperty(r))a.content.length&&a.content[0].isInline&&this.open&&(this.open--,a=this.top),s=!0,a.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e);return}o&&o.skip?this.addAll(e):this.withStyleRules(e,()=>this.addAll(e)),s&&this.sync(a),this.needsBlock=c}else this.withStyleRules(e,()=>{this.addElementByRule(e,o,o.consuming===!1?i:void 0)})}leafFallback(e){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
|
|
134
134
|
`))}ignoreFallback(e){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"))}readStyles(e){let t=We.none,r=We.none;for(let i=0;i<e.length;i+=2)for(let o=void 0;;){let s=this.parser.matchStyle(e[i],e[i+1],this,o);if(!s)break;if(s.ignore)return null;if(s.clearMark?this.top.pendingMarks.concat(this.top.activeMarks).forEach(a=>{s.clearMark(a)&&(r=a.addToSet(r))}):t=this.parser.schema.marks[s.mark].create(s.attrs).addToSet(t),s.consuming===!1)o=s;else break}return[t,r]}addElementByRule(e,t,r){let i,o,s;t.node?(o=this.parser.schema.nodes[t.node],o.isLeaf?this.insertNode(o.create(t.attrs))||this.leafFallback(e):i=this.enter(o,t.attrs||null,t.preserveWhitespace)):(s=this.parser.schema.marks[t.mark].create(t.attrs),this.addPendingMark(s));let a=this.top;if(o&&o.isLeaf)this.findInside(e);else if(r)this.addElement(e,r);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(c=>this.insertNode(c));else{let c=e;typeof t.contentElement=="string"?c=e.querySelector(t.contentElement):typeof t.contentElement=="function"?c=t.contentElement(e):t.contentElement&&(c=t.contentElement),this.findAround(e,c,!0),this.addAll(c)}i&&this.sync(a)&&this.open--,s&&this.removePendingMark(s,a)}addAll(e,t,r){let i=t||0;for(let o=t?e.childNodes[t]:e.firstChild,s=r==null?null:e.childNodes[r];o!=s;o=o.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(o);this.findAtPoint(e,i)}findPlace(e){let t,r;for(let i=this.open;i>=0;i--){let o=this.nodes[i],s=o.findWrapping(e);if(s&&(!t||t.length>s.length)&&(t=s,r=o,!s.length)||o.solid)break}if(!t)return!1;this.sync(r);for(let i=0;i<t.length;i++)this.enterInner(t[i],null,!1);return!0}insertNode(e){if(e.isInline&&this.needsBlock&&!this.top.type){let t=this.textblockFromContext();t&&this.enterInner(t)}if(this.findPlace(e)){this.closeExtra();let t=this.top;t.applyPending(e.type),t.match&&(t.match=t.match.matchType(e.type));let r=t.activeMarks;for(let i=0;i<e.marks.length;i++)(!t.type||t.type.allowsMarkType(e.marks[i].type))&&(r=e.marks[i].addToSet(r));return t.content.push(e.mark(r)),!0}return!1}enter(e,t,r){let i=this.findPlace(e.create(t));return i&&this.enterInner(e,t,!0,r),i}enterInner(e,t=null,r=!1,i){this.closeExtra();let o=this.top;o.applyPending(e),o.match=o.match&&o.match.matchType(e);let s=IE(e,i,o.options);o.options&C2&&o.content.length==0&&(s|=C2),this.nodes.push(new Tm(e,t,o.activeMarks,o.pendingMarks,r,null,s)),this.open++}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(e){for(let t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let r=this.nodes[t].content;for(let i=r.length-1;i>=0;i--)e+=r[i].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==t&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].pos==null&&e.nodeType==1&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,r){if(e!=t&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&e.nodeType==1&&e.contains(this.find[i].node)&&t.compareDocumentPosition(this.find[i].node)&(r?2:4)&&(this.find[i].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),o=-(r?r.depth+1:0)+(i?0:1),s=(a,c)=>{for(;a>=0;a--){let u=t[a];if(u==""){if(a==t.length-1||a==0)continue;for(;c>=o;c--)if(s(a-1,c))return!0;return!1}else{let d=c>0||c==0&&i?this.nodes[c].type:r&&c>=o?r.node(c-o).type:null;if(!d||d.name!=u&&d.groups.indexOf(u)==-1)return!1;c--}}return!0};return s(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let r=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let t in this.parser.schema.nodes){let r=this.parser.schema.nodes[t];if(r.isTextblock&&r.defaultAttrs)return r}}addPendingMark(e){let t=xK(e,this.top.pendingMarks);t&&this.top.stashMarks.push(t),this.top.pendingMarks=e.addToSet(this.top.pendingMarks)}removePendingMark(e,t){for(let r=this.open;r>=0;r--){let i=this.nodes[r];if(i.pendingMarks.lastIndexOf(e)>-1)i.pendingMarks=e.removeFromSet(i.pendingMarks);else{i.activeMarks=e.removeFromSet(i.activeMarks);let s=i.popFromStashMark(e);s&&i.type&&i.type.allowsMarkType(s.type)&&(i.activeMarks=s.addToSet(i.activeMarks))}if(i==t)break}}}function MK(n){for(let e=n.firstChild,t=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&xE.hasOwnProperty(r)&&t?(t.appendChild(e),e=t):r=="li"?t=e:r&&(t=null)}}function EK(n,e){return(n.matches||n.msMatchesSelector||n.webkitMatchesSelector||n.mozMatchesSelector).call(n,e)}function AK(n){let e=/\s*([\w-]+)\s*:\s*([^;]+)/g,t,r=[];for(;t=e.exec(n);)r.push(t[1],t[2].trim());return r}function DE(n){let e={};for(let t in n)e[t]=n[t];return e}function TK(n,e){let t=e.schema.nodes;for(let r in t){let i=t[r];if(!i.allowsMarkType(n))continue;let o=[],s=a=>{o.push(a);for(let c=0;c<a.edgeCount;c++){let{type:u,next:d}=a.edge(c);if(u==e||o.indexOf(d)<0&&s(d))return!0}};if(s(i.contentMatch))return!0}}function xK(n,e){for(let t=0;t<e.length;t++)if(n.eq(e[t]))return e[t]}class pi{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},r){r||(r=a6(t).createDocumentFragment());let i=r,o=[];return e.forEach(s=>{if(o.length||s.marks.length){let a=0,c=0;for(;a<o.length&&c<s.marks.length;){let u=s.marks[c];if(!this.marks[u.type.name]){c++;continue}if(!u.eq(o[a][0])||u.type.spec.spanning===!1)break;a++,c++}for(;a<o.length;)i=o.pop()[1];for(;c<s.marks.length;){let u=s.marks[c++],d=this.serializeMark(u,s.isInline,t);d&&(o.push([u,i]),i.appendChild(d.dom),i=d.contentDOM||d.dom)}}i.appendChild(this.serializeNodeInner(s,t))}),r}serializeNodeInner(e,t){let{dom:r,contentDOM:i}=pi.renderSpec(a6(t),this.nodes[e.type.name](e));if(i){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,i)}return r}serializeNode(e,t={}){let r=this.serializeNodeInner(e,t);for(let i=e.marks.length-1;i>=0;i--){let o=this.serializeMark(e.marks[i],e.isInline,t);o&&((o.contentDOM||o.dom).appendChild(r),r=o.dom)}return r}serializeMark(e,t,r={}){let i=this.marks[e.type.name];return i&&pi.renderSpec(a6(r),i(e,t))}static renderSpec(e,t,r=null){if(typeof t=="string")return{dom:e.createTextNode(t)};if(t.nodeType!=null)return{dom:t};if(t.dom&&t.dom.nodeType!=null)return t;let i=t[0],o=i.indexOf(" ");o>0&&(r=i.slice(0,o),i=i.slice(o+1));let s,a=r?e.createElementNS(r,i):e.createElement(i),c=t[1],u=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){u=2;for(let d in c)if(c[d]!=null){let f=d.indexOf(" ");f>0?a.setAttributeNS(d.slice(0,f),d.slice(f+1),c[d]):a.setAttribute(d,c[d])}}for(let d=u;d<t.length;d++){let f=t[d];if(f===0){if(d<t.length-1||d>u)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}else{let{dom:h,contentDOM:p}=pi.renderSpec(e,f,r);if(a.appendChild(h),p){if(s)throw new RangeError("Multiple content holes");s=p}}}return{dom:a,contentDOM:s}}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new pi(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=NE(e.nodes);return t.text||(t.text=r=>r.text),t}static marksFromSchema(e){return NE(e.marks)}}function NE(n){let e={};for(let t in n){let r=n[t].spec.toDOM;r&&(e[t]=r)}return e}function a6(n){return n.document||window.document}const PE=65535,_E=Math.pow(2,16);function IK(n,e){return n+e*_E}function LE(n){return n&PE}function OK(n){return(n-(n&PE))/_E}const BE=1,RE=2,xm=4,$E=8;class l6{constructor(e,t,r){this.pos=e,this.delInfo=t,this.recover=r}get deleted(){return(this.delInfo&$E)>0}get deletedBefore(){return(this.delInfo&(BE|xm))>0}get deletedAfter(){return(this.delInfo&(RE|xm))>0}get deletedAcross(){return(this.delInfo&xm)>0}}class Jn{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&Jn.empty)return Jn.empty}recover(e){let t=0,r=LE(e);if(!this.inverted)for(let i=0;i<r;i++)t+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[r*3]+t+OK(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,r){let i=0,o=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let c=this.ranges[a]-(this.inverted?i:0);if(c>e)break;let u=this.ranges[a+o],d=this.ranges[a+s],f=c+u;if(e<=f){let h=u?e==c?-1:e==f?1:t:t,p=c+i+(h<0?0:d);if(r)return p;let m=e==(t<0?c:f)?null:IK(a/3,e-c),y=e==c?RE:e==f?BE:xm;return(t<0?e!=c:e!=f)&&(y|=$E),new l6(p,y,m)}i+=d-u}return r?e+i:new l6(e+i,0,null)}touches(e,t){let r=0,i=LE(t),o=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let c=this.ranges[a]-(this.inverted?r:0);if(c>e)break;let u=this.ranges[a+o],d=c+u;if(e<=d&&a==i*3)return!0;r+=this.ranges[a+s]-u}return!1}forEach(e){let t=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i<this.ranges.length;i+=3){let s=this.ranges[i],a=s-(this.inverted?o:0),c=s+(this.inverted?0:o),u=this.ranges[i+t],d=this.ranges[i+r];e(a,a+u,c,c+d),o+=d-u}}invert(){return new Jn(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?Jn.empty:new Jn(e<0?[0,-e,0]:[0,0,e])}}Jn.empty=new Jn([]);class ic{constructor(e=[],t,r=0,i=e.length){this.maps=e,this.mirror=t,this.from=r,this.to=i}slice(e=0,t=this.maps.length){return new ic(this.maps,this.mirror,e,t)}copy(){return new ic(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(e,t){this.to=this.maps.push(e),t!=null&&this.setMirror(this.maps.length-1,t)}appendMapping(e){for(let t=0,r=this.maps.length;t<e.maps.length;t++){let i=e.getMirror(t);this.appendMap(e.maps[t],i!=null&&i<t?r+i:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,r=this.maps.length+e.maps.length;t>=0;t--){let i=e.getMirror(t);this.appendMap(e.maps[t].invert(),i!=null&&i>t?r-i-1:void 0)}}invert(){let e=new ic;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let r=this.from;r<this.to;r++)e=this.maps[r].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,r){let i=0;for(let o=this.from;o<this.to;o++){let s=this.maps[o],a=s.mapResult(e,t);if(a.recover!=null){let c=this.getMirror(o);if(c!=null&&c>o&&c<this.to){o=c,e=this.maps[c].recover(a.recover);continue}}i|=a.delInfo,e=a.pos}return r?e:new l6(e,i,null)}}const c6=Object.create(null);class un{getMap(){return Jn.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=c6[t.stepType];if(!r)throw new RangeError(`No step type ${t.stepType} defined`);return r.fromJSON(e,t)}static jsonID(e,t){if(e in c6)throw new RangeError("Duplicate use of step JSON ID "+e);return c6[e]=t,t.prototype.jsonID=e,t}}class Mt{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new Mt(e,null)}static fail(e){return new Mt(null,e)}static fromReplace(e,t,r,i){try{return Mt.ok(e.replace(t,r,i))}catch(o){if(o instanceof vm)return Mt.fail(o.message);throw o}}}function u6(n,e,t){let r=[];for(let i=0;i<n.childCount;i++){let o=n.child(i);o.content.size&&(o=o.copy(u6(o.content,e,o))),o.isInline&&(o=e(o,t,i)),r.push(o)}return G.fromArray(r)}class ys extends un{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=e.resolve(this.from),i=r.node(r.sharedDepth(this.to)),o=new te(u6(t.content,(s,a)=>!s.isAtom||!a.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),i),t.openStart,t.openEnd);return Mt.fromReplace(e,this.from,this.to,o)}invert(){return new mi(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new ys(t.pos,r.pos,this.mark)}merge(e){return e instanceof ys&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new ys(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new ys(t.from,t.to,e.markFromJSON(t.mark))}}un.jsonID("addMark",ys);class mi extends un{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=new te(u6(t.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),t.openStart,t.openEnd);return Mt.fromReplace(e,this.from,this.to,r)}invert(){return new ys(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new mi(t.pos,r.pos,this.mark)}merge(e){return e instanceof mi&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new mi(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new mi(t.from,t.to,e.markFromJSON(t.mark))}}un.jsonID("removeMark",mi);class bs extends un{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Mt.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return Mt.fromReplace(e,this.pos,this.pos+1,new te(G.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let r=this.mark.addToSet(t.marks);if(r.length==t.marks.length){for(let i=0;i<t.marks.length;i++)if(!t.marks[i].isInSet(r))return new bs(this.pos,t.marks[i]);return new bs(this.pos,this.mark)}}return new oc(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new bs(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new bs(t.pos,e.markFromJSON(t.mark))}}un.jsonID("addNodeMark",bs);class oc extends un{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Mt.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return Mt.fromReplace(e,this.pos,this.pos+1,new te(G.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new bs(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new oc(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new oc(t.pos,e.markFromJSON(t.mark))}}un.jsonID("removeNodeMark",oc);class Lt extends un{constructor(e,t,r,i=!1){super(),this.from=e,this.to=t,this.slice=r,this.structure=i}apply(e){return this.structure&&d6(e,this.from,this.to)?Mt.fail("Structure replace would overwrite content"):Mt.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Jn([this.from,this.to-this.from,this.slice.size])}invert(e){return new Lt(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deletedAcross&&r.deletedAcross?null:new Lt(t.pos,Math.max(t.pos,r.pos),this.slice)}merge(e){if(!(e instanceof Lt)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let t=this.slice.size+e.slice.size==0?te.empty:new te(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new Lt(this.from,this.to+(e.to-e.from),t,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let t=this.slice.size+e.slice.size==0?te.empty:new te(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new Lt(e.from,this.to,t,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new Lt(t.from,t.to,te.fromJSON(e,t.slice),!!t.structure)}}un.jsonID("replace",Lt);class Bt extends un{constructor(e,t,r,i,o,s,a=!1){super(),this.from=e,this.to=t,this.gapFrom=r,this.gapTo=i,this.slice=o,this.insert=s,this.structure=a}apply(e){if(this.structure&&(d6(e,this.from,this.gapFrom)||d6(e,this.gapTo,this.to)))return Mt.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return Mt.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,t.content);return r?Mt.fromReplace(e,this.from,this.to,r):Mt.fail("Content does not fit in gap")}getMap(){return new Jn([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new Bt(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),i=e.map(this.gapFrom,-1),o=e.map(this.gapTo,1);return t.deletedAcross&&r.deletedAcross||i<t.pos||o>r.pos?null:new Bt(t.pos,r.pos,i,o,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number"||typeof t.gapFrom!="number"||typeof t.gapTo!="number"||typeof t.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Bt(t.from,t.to,t.gapFrom,t.gapTo,te.fromJSON(e,t.slice),t.insert,!!t.structure)}}un.jsonID("replaceAround",Bt);function d6(n,e,t){let r=n.resolve(e),i=t-e,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let s=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,i--}}return!1}function DK(n,e,t,r){let i=[],o=[],s,a;n.doc.nodesBetween(e,t,(c,u,d)=>{if(!c.isInline)return;let f=c.marks;if(!r.isInSet(f)&&d.type.allowsMarkType(r.type)){let h=Math.max(u,e),p=Math.min(u+c.nodeSize,t),m=r.addToSet(f);for(let y=0;y<f.length;y++)f[y].isInSet(m)||(s&&s.to==h&&s.mark.eq(f[y])?s.to=p:i.push(s=new mi(h,p,f[y])));a&&a.to==h?a.to=p:o.push(a=new ys(h,p,r))}}),i.forEach(c=>n.step(c)),o.forEach(c=>n.step(c))}function NK(n,e,t,r){let i=[],o=0;n.doc.nodesBetween(e,t,(s,a)=>{if(!s.isInline)return;o++;let c=null;if(r instanceof Mm){let u=s.marks,d;for(;d=r.isInSet(u);)(c||(c=[])).push(d),u=d.removeFromSet(u)}else r?r.isInSet(s.marks)&&(c=[r]):c=s.marks;if(c&&c.length){let u=Math.min(a+s.nodeSize,t);for(let d=0;d<c.length;d++){let f=c[d],h;for(let p=0;p<i.length;p++){let m=i[p];m.step==o-1&&f.eq(i[p].style)&&(h=m)}h?(h.to=u,h.step=o):i.push({style:f,from:Math.max(a,e),to:u,step:o})}}}),i.forEach(s=>n.step(new mi(s.from,s.to,s.style)))}function PK(n,e,t,r=t.contentMatch){let i=n.doc.nodeAt(e),o=[],s=e+1;for(let a=0;a<i.childCount;a++){let c=i.child(a),u=s+c.nodeSize,d=r.matchType(c.type);if(!d)o.push(new Lt(s,u,te.empty));else{r=d;for(let f=0;f<c.marks.length;f++)t.allowsMarkType(c.marks[f].type)||n.step(new mi(s,u,c.marks[f]));if(c.isText&&!t.spec.code){let f,h=/\r?\n|\r/g,p;for(;f=h.exec(c.text);)p||(p=new te(G.from(t.schema.text(" ",t.allowedMarks(c.marks))),0,0)),o.push(new Lt(s+f.index,s+f.index+f[0].length,p))}}s=u}if(!r.validEnd){let a=r.fillBefore(G.empty,!0);n.replace(s,s,new te(a,0,0))}for(let a=o.length-1;a>=0;a--)n.step(o[a])}function _K(n,e,t){return(e==0||n.canReplace(e,n.childCount))&&(t==n.childCount||n.canReplace(0,t))}function sc(n){let t=n.parent.content.cutByIndex(n.startIndex,n.endIndex);for(let r=n.depth;;--r){let i=n.$from.node(r),o=n.$from.index(r),s=n.$to.indexAfter(r);if(r<n.depth&&i.canReplace(o,s,t))return r;if(r==0||i.type.spec.isolating||!_K(i,o,s))break}return null}function LK(n,e,t){let{$from:r,$to:i,depth:o}=e,s=r.before(o+1),a=i.after(o+1),c=s,u=a,d=G.empty,f=0;for(let m=o,y=!1;m>t;m--)y||r.index(m)>0?(y=!0,d=G.from(r.node(m).copy(d)),f++):c--;let h=G.empty,p=0;for(let m=o,y=!1;m>t;m--)y||i.after(m+1)<i.end(m)?(y=!0,h=G.from(i.node(m).copy(h)),p++):u++;n.step(new Bt(c,u,s,a,new te(d.append(h),f,p),d.size-f,!0))}function f6(n,e,t=null,r=n){let i=BK(n,e),o=i&&RK(r,e);return o?i.map(FE).concat({type:e,attrs:t}).concat(o.map(FE)):null}function FE(n){return{type:n,attrs:null}}function BK(n,e){let{parent:t,startIndex:r,endIndex:i}=n,o=t.contentMatchAt(r).findWrapping(e);if(!o)return null;let s=o.length?o[0]:e;return t.canReplaceWith(r,i,s)?o:null}function RK(n,e){let{parent:t,startIndex:r,endIndex:i}=n,o=t.child(r),s=e.contentMatch.findWrapping(o.type);if(!s)return null;let c=(s.length?s[s.length-1]:e).contentMatch;for(let u=r;c&&u<i;u++)c=c.matchType(t.child(u).type);return!c||!c.validEnd?null:s}function $K(n,e,t){let r=G.empty;for(let s=t.length-1;s>=0;s--){if(r.size){let a=t[s].type.contentMatch.matchFragment(r);if(!a||!a.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=G.from(t[s].type.create(t[s].attrs,r))}let i=e.start,o=e.end;n.step(new Bt(i,o,i,o,new te(r,0,0),t.length,!0))}function FK(n,e,t,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=n.steps.length;n.doc.nodesBetween(e,t,(s,a)=>{if(s.isTextblock&&!s.hasMarkup(r,i)&&VK(n.doc,n.mapping.slice(o).map(a),r)){n.clearIncompatible(n.mapping.slice(o).map(a,1),r);let c=n.mapping.slice(o),u=c.map(a,1),d=c.map(a+s.nodeSize,1);return n.step(new Bt(u,d,u+1,d-1,new te(G.from(r.create(i,null,s.marks)),0,0),1,!0)),!1}})}function VK(n,e,t){let r=n.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,t)}function jK(n,e,t,r,i){let o=n.doc.nodeAt(e);if(!o)throw new RangeError("No node at given position");t||(t=o.type);let s=t.create(r,null,i||o.marks);if(o.isLeaf)return n.replaceWith(e,e+o.nodeSize,s);if(!t.validContent(o.content))throw new RangeError("Invalid content for node type "+t.name);n.step(new Bt(e,e+o.nodeSize,e+1,e+o.nodeSize-1,new te(G.from(s),0,0),1,!0))}function ac(n,e,t=1,r){let i=n.resolve(e),o=i.depth-t,s=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!s.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let u=i.depth-1,d=t-2;u>o;u--,d--){let f=i.node(u),h=i.index(u);if(f.type.spec.isolating)return!1;let p=f.content.cutByIndex(h,f.childCount),m=r&&r[d+1];m&&(p=p.replaceChild(0,m.type.create(m.attrs)));let y=r&&r[d]||f;if(!f.canReplace(h+1,f.childCount)||!y.type.validContent(p))return!1}let a=i.indexAfter(o),c=r&&r[0];return i.node(o).canReplaceWith(a,a,c?c.type:i.node(o+1).type)}function zK(n,e,t=1,r){let i=n.doc.resolve(e),o=G.empty,s=G.empty;for(let a=i.depth,c=i.depth-t,u=t-1;a>c;a--,u--){o=G.from(i.node(a).copy(o));let d=r&&r[u];s=G.from(d?d.type.create(d.attrs,s):i.node(a).copy(s))}n.step(new Lt(e,e,new te(o.append(s),t,t),!0))}function ws(n,e){let t=n.resolve(e),r=t.index();return VE(t.nodeBefore,t.nodeAfter)&&t.parent.canReplace(r,r+1)}function VE(n,e){return!!(n&&e&&!n.isLeaf&&n.canAppend(e))}function Im(n,e,t=-1){let r=n.resolve(e);for(let i=r.depth;;i--){let o,s,a=r.index(i);if(i==r.depth?(o=r.nodeBefore,s=r.nodeAfter):t>0?(o=r.node(i+1),a++,s=r.node(i).maybeChild(a)):(o=r.node(i).maybeChild(a-1),s=r.node(i+1)),o&&!o.isTextblock&&VE(o,s)&&r.node(i).canReplace(a,a+1))return e;if(i==0)break;e=t<0?r.before(i):r.after(i)}}function HK(n,e,t){let r=new Lt(e-t,e+t,te.empty,!0);n.step(r)}function UK(n,e,t){let r=n.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),t))return e;if(r.parentOffset==0)for(let i=r.depth-1;i>=0;i--){let o=r.index(i);if(r.node(i).canReplaceWith(o,o,t))return r.before(i+1);if(o>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let o=r.indexAfter(i);if(r.node(i).canReplaceWith(o,o,t))return r.after(i+1);if(o<r.node(i).childCount)return null}return null}function jE(n,e,t){let r=n.resolve(e);if(!t.content.size)return e;let i=t.content;for(let o=0;o<t.openStart;o++)i=i.firstChild.content;for(let o=1;o<=(t.openStart==0&&t.size?2:1);o++)for(let s=r.depth;s>=0;s--){let a=s==r.depth?0:r.pos<=(r.start(s+1)+r.end(s+1))/2?-1:1,c=r.index(s)+(a>0?1:0),u=r.node(s),d=!1;if(o==1)d=u.canReplace(c,c,i);else{let f=u.contentMatchAt(c).findWrapping(i.firstChild.type);d=f&&u.canReplaceWith(c,c,f[0])}if(d)return a==0?r.pos:a<0?r.before(s+1):r.after(s+1)}return null}function Om(n,e,t=e,r=te.empty){if(e==t&&!r.size)return null;let i=n.resolve(e),o=n.resolve(t);return zE(i,o,r)?new Lt(e,t,r):new ZK(i,o,r).fit()}function zE(n,e,t){return!t.openStart&&!t.openEnd&&n.start()==e.start()&&n.parent.canReplace(n.index(),e.index(),t.content)}class ZK{constructor(e,t,r){this.$from=e,this.$to=t,this.unplaced=r,this.frontier=[],this.placed=G.empty;for(let i=0;i<=e.depth;i++){let o=e.node(i);this.frontier.push({type:o.type,match:o.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=G.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let u=this.findFittable();u?this.placeNodes(u):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(e<0?this.$to:r.doc.resolve(e));if(!i)return null;let o=this.placed,s=r.depth,a=i.depth;for(;s&&a&&o.childCount==1;)o=o.firstChild.content,s--,a--;let c=new te(o,s,a);return e>-1?new Bt(r.pos,e,this.$to.pos,this.$to.end(),c,t):c.size||r.pos!=this.$to.pos?new Lt(r.pos,i.pos,c):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,r=0,i=this.unplaced.openEnd;r<e;r++){let o=t.firstChild;if(t.childCount>1&&(i=0),o.type.spec.isolating&&i<=r){e=r;break}t=o.content}for(let t=1;t<=2;t++)for(let r=t==1?e:this.unplaced.openStart;r>=0;r--){let i,o=null;r?(o=h6(this.unplaced.content,r-1).firstChild,i=o.content):i=this.unplaced.content;let s=i.firstChild;for(let a=this.depth;a>=0;a--){let{type:c,match:u}=this.frontier[a],d,f=null;if(t==1&&(s?u.matchType(s.type)||(f=u.fillBefore(G.from(s),!1)):o&&c.compatibleContent(o.type)))return{sliceDepth:r,frontierDepth:a,parent:o,inject:f};if(t==2&&s&&(d=u.findWrapping(s.type)))return{sliceDepth:r,frontierDepth:a,parent:o,wrap:d};if(o&&u.matchType(o.type))break}}}openMore(){let{content:e,openStart:t,openEnd:r}=this.unplaced,i=h6(e,t);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new te(e,t+1,Math.max(r,i.size+t>=e.size-r?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:r}=this.unplaced,i=h6(e,t);if(i.childCount<=1&&t>0){let o=e.size-t<=t+i.size;this.unplaced=new te(k2(e,t-1,1),t-1,o?t-1:r)}else this.unplaced=new te(k2(e,t,1),t,r)}placeNodes({sliceDepth:e,frontierDepth:t,parent:r,inject:i,wrap:o}){for(;this.depth>t;)this.closeFrontierNode();if(o)for(let y=0;y<o.length;y++)this.openFrontierNode(o[y]);let s=this.unplaced,a=r?r.content:s.content,c=s.openStart-e,u=0,d=[],{match:f,type:h}=this.frontier[t];if(i){for(let y=0;y<i.childCount;y++)d.push(i.child(y));f=f.matchFragment(i)}let p=a.size+e-(s.content.size-s.openEnd);for(;u<a.childCount;){let y=a.child(u),b=f.matchType(y.type);if(!b)break;u++,(u>1||c==0||y.content.size)&&(f=b,d.push(HE(y.mark(h.allowedMarks(y.marks)),u==1?c:0,u==a.childCount?p:-1)))}let m=u==a.childCount;m||(p=-1),this.placed=S2(this.placed,t,G.from(d)),this.frontier[t].match=f,m&&p<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let y=0,b=a;y<p;y++){let w=b.lastChild;this.frontier.push({type:w.type,match:w.contentMatchAt(w.childCount)}),b=w.content}this.unplaced=m?e==0?te.empty:new te(k2(s.content,e-1,1),e-1,p<0?s.openEnd:e-1):new te(k2(s.content,e,u),s.openStart,s.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],t;if(!e.type.isTextblock||!p6(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(t=this.findCloseLevel(this.$to))&&t.depth==this.depth)return-1;let{depth:r}=this.$to,i=this.$to.after(r);for(;r>1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(e){e:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:r,type:i}=this.frontier[t],o=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),s=p6(e,t,i,r,o);if(s){for(let a=t-1;a>=0;a--){let{match:c,type:u}=this.frontier[a],d=p6(e,a,u,c,!0);if(!d||d.childCount)continue e}return{depth:t,fit:s,move:o?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=S2(this.placed,t.depth,t.fit)),e=t.move;for(let r=t.depth+1;r<=e.depth;r++){let i=e.node(r),o=i.type.contentMatch.fillBefore(i.content,!0,e.index(r));this.openFrontierNode(i.type,i.attrs,o)}return e}openFrontierNode(e,t=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=S2(this.placed,this.depth,G.from(e.create(t,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(G.empty,!0);t.childCount&&(this.placed=S2(this.placed,this.frontier.length,t))}}function k2(n,e,t){return e==0?n.cutByIndex(t,n.childCount):n.replaceChild(0,n.firstChild.copy(k2(n.firstChild.content,e-1,t)))}function S2(n,e,t){return e==0?n.append(t):n.replaceChild(n.childCount-1,n.lastChild.copy(S2(n.lastChild.content,e-1,t)))}function h6(n,e){for(let t=0;t<e;t++)n=n.firstChild.content;return n}function HE(n,e,t){if(e<=0)return n;let r=n.content;return e>1&&(r=r.replaceChild(0,HE(r.firstChild,e-1,r.childCount==1?t-1:0))),e>0&&(r=n.type.contentMatch.fillBefore(r).append(r),t<=0&&(r=r.append(n.type.contentMatch.matchFragment(r).fillBefore(G.empty,!0)))),n.copy(r)}function p6(n,e,t,r,i){let o=n.node(e),s=i?n.indexAfter(e):n.index(e);if(s==o.childCount&&!t.compatibleContent(o.type))return null;let a=r.fillBefore(o.content,!0,s);return a&&!WK(t,o.content,s)?a:null}function WK(n,e,t){for(let r=t;r<e.childCount;r++)if(!n.allowsMarks(e.child(r).marks))return!0;return!1}function KK(n){return n.spec.defining||n.spec.definingForContent}function qK(n,e,t,r){if(!r.size)return n.deleteRange(e,t);let i=n.doc.resolve(e),o=n.doc.resolve(t);if(zE(i,o,r))return n.step(new Lt(e,t,r));let s=ZE(i,n.doc.resolve(t));s[s.length-1]==0&&s.pop();let a=-(i.depth+1);s.unshift(a);for(let h=i.depth,p=i.pos-1;h>0;h--,p--){let m=i.node(h).type.spec;if(m.defining||m.definingAsContext||m.isolating)break;s.indexOf(h)>-1?a=h:i.before(h)==p&&s.splice(1,0,-h)}let c=s.indexOf(a),u=[],d=r.openStart;for(let h=r.content,p=0;;p++){let m=h.firstChild;if(u.push(m),p==r.openStart)break;h=m.content}for(let h=d-1;h>=0;h--){let p=u[h],m=KK(p.type);if(m&&!p.sameMarkup(i.node(Math.abs(a)-1)))d=h;else if(m||!p.type.isTextblock)break}for(let h=r.openStart;h>=0;h--){let p=(h+d+1)%(r.openStart+1),m=u[p];if(m)for(let y=0;y<s.length;y++){let b=s[(y+c)%s.length],w=!0;b<0&&(w=!1,b=-b);let v=i.node(b-1),k=i.index(b-1);if(v.canReplaceWith(k,k,m.type,m.marks))return n.replace(i.before(b),w?o.after(b):t,new te(UE(r.content,0,r.openStart,p),p,r.openEnd))}}let f=n.steps.length;for(let h=s.length-1;h>=0&&(n.replace(e,t,r),!(n.steps.length>f));h--){let p=s[h];p<0||(e=i.before(p),t=o.after(p))}}function UE(n,e,t,r,i){if(e<t){let o=n.firstChild;n=n.replaceChild(0,o.copy(UE(o.content,e+1,t,r,o)))}if(e>r){let o=i.contentMatchAt(0),s=o.fillBefore(n).append(n);n=s.append(o.matchFragment(s).fillBefore(G.empty,!0))}return n}function GK(n,e,t,r){if(!r.isInline&&e==t&&n.doc.resolve(e).parent.content.size){let i=UK(n.doc,e,r.type);i!=null&&(e=t=i)}n.replaceRange(e,t,new te(G.from(r),0,0))}function YK(n,e,t){let r=n.doc.resolve(e),i=n.doc.resolve(t),o=ZE(r,i);for(let s=0;s<o.length;s++){let a=o[s],c=s==o.length-1;if(c&&a==0||r.node(a).type.contentMatch.validEnd)return n.delete(r.start(a),i.end(a));if(a>0&&(c||r.node(a-1).canReplace(r.index(a-1),i.indexAfter(a-1))))return n.delete(r.before(a),i.after(a))}for(let s=1;s<=r.depth&&s<=i.depth;s++)if(e-r.start(s)==r.depth-s&&t>r.end(s)&&i.end(s)-t!=i.depth-s)return n.delete(r.before(s),t);n.delete(e,t)}function ZE(n,e){let t=[],r=Math.min(n.depth,e.depth);for(let i=r;i>=0;i--){let o=n.start(i);if(o<n.pos-(n.depth-i)||e.end(i)>e.pos+(e.depth-i)||n.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(o==e.start(i)||i==n.depth&&i==e.depth&&n.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==o-1)&&t.push(i)}return t}class lc extends un{constructor(e,t,r){super(),this.pos=e,this.attr=t,this.value=r}apply(e){let t=e.nodeAt(this.pos);if(!t)return Mt.fail("No node at attribute step's position");let r=Object.create(null);for(let o in t.attrs)r[o]=t.attrs[o];r[this.attr]=this.value;let i=t.type.create(r,null,t.marks);return Mt.fromReplace(e,this.pos,this.pos+1,new te(G.from(i),0,t.isLeaf?0:1))}getMap(){return Jn.empty}invert(e){return new lc(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new lc(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.pos!="number"||typeof t.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new lc(t.pos,t.attr,t.value)}}un.jsonID("attr",lc);class M2 extends un{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let i in e.attrs)t[i]=e.attrs[i];t[this.attr]=this.value;let r=e.type.create(t,e.content,e.marks);return Mt.ok(r)}getMap(){return Jn.empty}invert(e){return new M2(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new M2(t.attr,t.value)}}un.jsonID("docAttr",M2);let cc=class extends Error{};cc=function n(e){let t=Error.call(this,e);return t.__proto__=n.prototype,t},cc.prototype=Object.create(Error.prototype),cc.prototype.constructor=cc,cc.prototype.name="TransformError";class WE{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new ic}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new cc(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,r=te.empty){let i=Om(this.doc,e,t,r);return i&&this.step(i),this}replaceWith(e,t,r){return this.replace(e,t,new te(G.from(r),0,0))}delete(e,t){return this.replace(e,t,te.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,r){return qK(this,e,t,r),this}replaceRangeWith(e,t,r){return GK(this,e,t,r),this}deleteRange(e,t){return YK(this,e,t),this}lift(e,t){return LK(this,e,t),this}join(e,t=1){return HK(this,e,t),this}wrap(e,t){return $K(this,e,t),this}setBlockType(e,t=e,r,i=null){return FK(this,e,t,r,i),this}setNodeMarkup(e,t,r=null,i){return jK(this,e,t,r,i),this}setNodeAttribute(e,t,r){return this.step(new lc(e,t,r)),this}setDocAttribute(e,t){return this.step(new M2(e,t)),this}addNodeMark(e,t){return this.step(new bs(e,t)),this}removeNodeMark(e,t){if(!(t instanceof We)){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(t=t.isInSet(r.marks),!t)return this}return this.step(new oc(e,t)),this}split(e,t=1,r){return zK(this,e,t,r),this}addMark(e,t,r){return DK(this,e,t,r),this}removeMark(e,t,r){return NK(this,e,t,r),this}clearIncompatible(e,t,r){return PK(this,e,t,r),this}}const m6=Object.create(null);class ke{constructor(e,t,r){this.$anchor=e,this.$head=t,this.ranges=r||[new QK(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=te.empty){let r=t.content.lastChild,i=null;for(let a=0;a<t.openEnd;a++)i=r,r=r.lastChild;let o=e.steps.length,s=this.ranges;for(let a=0;a<s.length;a++){let{$from:c,$to:u}=s[a],d=e.mapping.slice(o);e.replaceRange(d.map(c.pos),d.map(u.pos),a?te.empty:t),a==0&&GE(e,o,(r?r.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(e,t){let r=e.steps.length,i=this.ranges;for(let o=0;o<i.length;o++){let{$from:s,$to:a}=i[o],c=e.mapping.slice(r),u=c.map(s.pos),d=c.map(a.pos);o?e.deleteRange(u,d):(e.replaceRangeWith(u,d,t),GE(e,r,t.isInline?-1:1))}}static findFrom(e,t,r=!1){let i=e.parent.inlineContent?new we(e):uc(e.node(0),e.parent,e.pos,e.index(),t,r);if(i)return i;for(let o=e.depth-1;o>=0;o--){let s=t<0?uc(e.node(0),e.node(o),e.before(o+1),e.index(o),t,r):uc(e.node(0),e.node(o),e.after(o+1),e.index(o)+1,t,r);if(s)return s}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new Wr(e.node(0))}static atStart(e){return uc(e,e,0,0,1)||new Wr(e)}static atEnd(e){return uc(e,e,e.content.size,e.childCount,-1)||new Wr(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=m6[t.type];if(!r)throw new RangeError(`No selection type ${t.type} defined`);return r.fromJSON(e,t)}static jsonID(e,t){if(e in m6)throw new RangeError("Duplicate use of selection JSON ID "+e);return m6[e]=t,t.prototype.jsonID=e,t}getBookmark(){return we.between(this.$anchor,this.$head).getBookmark()}}ke.prototype.visible=!0;class QK{constructor(e,t){this.$from=e,this.$to=t}}let KE=!1;function qE(n){!KE&&!n.parent.inlineContent&&(KE=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+n.parent.type.name+")"))}class we extends ke{constructor(e,t=e){qE(e),qE(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let r=e.resolve(t.map(this.head));if(!r.parent.inlineContent)return ke.near(r);let i=e.resolve(t.map(this.anchor));return new we(i.parent.inlineContent?i:r,r)}replace(e,t=te.empty){if(super.replace(e,t),t==te.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof we&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Dm(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if(typeof t.anchor!="number"||typeof t.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new we(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,r=t){let i=e.resolve(t);return new this(i,r==t?i:e.resolve(r))}static between(e,t,r){let i=e.pos-t.pos;if((!r||i)&&(r=i>=0?1:-1),!t.parent.inlineContent){let o=ke.findFrom(t,r,!0)||ke.findFrom(t,-r,!0);if(o)t=o.$head;else return ke.near(t,r)}return e.parent.inlineContent||(i==0?e=t:(e=(ke.findFrom(e,-r,!0)||ke.findFrom(e,r,!0)).$anchor,e.pos<t.pos!=i<0&&(e=t))),new we(e,t)}}ke.jsonID("text",we);class Dm{constructor(e,t){this.anchor=e,this.head=t}map(e){return new Dm(e.map(this.anchor),e.map(this.head))}resolve(e){return we.between(e.resolve(this.anchor),e.resolve(this.head))}}class ce extends ke{constructor(e){let t=e.nodeAfter,r=e.node(0).resolve(e.pos+t.nodeSize);super(e,r),this.node=t}map(e,t){let{deleted:r,pos:i}=t.mapResult(this.anchor),o=e.resolve(i);return r?ke.near(o):new ce(o)}content(){return new te(G.from(this.node),0,0)}eq(e){return e instanceof ce&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new g6(this.anchor)}static fromJSON(e,t){if(typeof t.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new ce(e.resolve(t.anchor))}static create(e,t){return new ce(e.resolve(t))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}ce.prototype.visible=!1,ke.jsonID("node",ce);class g6{constructor(e){this.anchor=e}map(e){let{deleted:t,pos:r}=e.mapResult(this.anchor);return t?new Dm(r,r):new g6(r)}resolve(e){let t=e.resolve(this.anchor),r=t.nodeAfter;return r&&ce.isSelectable(r)?new ce(t):ke.near(t)}}class Wr extends ke{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=te.empty){if(t==te.empty){e.delete(0,e.doc.content.size);let r=ke.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,t)}toJSON(){return{type:"all"}}static fromJSON(e){return new Wr(e)}map(e){return new Wr(e)}eq(e){return e instanceof Wr}getBookmark(){return XK}}ke.jsonID("all",Wr);const XK={map(){return this},resolve(n){return new Wr(n)}};function uc(n,e,t,r,i,o=!1){if(e.inlineContent)return we.create(n,t);for(let s=r-(i>0?0:1);i>0?s<e.childCount:s>=0;s+=i){let a=e.child(s);if(a.isAtom){if(!o&&ce.isSelectable(a))return ce.create(n,t-(i<0?a.nodeSize:0))}else{let c=uc(n,a,t+i,i<0?a.childCount:0,i,o);if(c)return c}t+=a.nodeSize*i}return null}function GE(n,e,t){let r=n.steps.length-1;if(r<e)return;let i=n.steps[r];if(!(i instanceof Lt||i instanceof Bt))return;let o=n.mapping.maps[r],s;o.forEach((a,c,u,d)=>{s==null&&(s=d)}),n.setSelection(ke.near(n.doc.resolve(s),t))}const YE=1,Nm=2,QE=4;class JK extends WE{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|YE)&~Nm,this.storedMarks=null,this}get selectionSet(){return(this.updated&YE)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=Nm,this}ensureMarks(e){return We.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&Nm)>0}addStep(e,t){super.addStep(e,t),this.updated=this.updated&~Nm,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let r=this.selection;return t&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||We.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,r){let i=this.doc.type.schema;if(t==null)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();{if(r==null&&(r=t),r=r??t,!e)return this.deleteRange(t,r);let o=this.storedMarks;if(!o){let s=this.doc.resolve(t);o=r==t?s.marks():s.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(t,r,i.text(e,o)),this.selection.empty||this.setSelection(ke.near(this.selection.$to)),this}}setMeta(e,t){return this.meta[typeof e=="string"?e:e.key]=t,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=QE,this}get scrolledIntoView(){return(this.updated&QE)>0}}function XE(n,e){return!e||!n?n:n.bind(e)}class E2{constructor(e,t,r){this.name=e,this.init=XE(t.init,r),this.apply=XE(t.apply,r)}}const eq=[new E2("doc",{init(n){return n.doc||n.schema.topNodeType.createAndFill()},apply(n){return n.doc}}),new E2("selection",{init(n,e){return n.selection||ke.atStart(e.doc)},apply(n){return n.selection}}),new E2("storedMarks",{init(n){return n.storedMarks||null},apply(n,e,t,r){return r.selection.$cursor?n.storedMarks:null}}),new E2("scrollToSelection",{init(){return 0},apply(n,e){return n.scrolledIntoView?e+1:e}})];class y6{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=eq.slice(),t&&t.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new E2(r.key,r.spec.state,r))})}}class dc{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=t){let i=this.config.plugins[r];if(i.spec.filterTransaction&&!i.spec.filterTransaction.call(i,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let t=[e],r=this.applyInner(e),i=null;for(;;){let o=!1;for(let s=0;s<this.config.plugins.length;s++){let a=this.config.plugins[s];if(a.spec.appendTransaction){let c=i?i[s].n:0,u=i?i[s].state:this,d=c<t.length&&a.spec.appendTransaction.call(a,c?t.slice(c):t,u,r);if(d&&r.filterTransaction(d,s)){if(d.setMeta("appendedTransaction",e),!i){i=[];for(let f=0;f<this.config.plugins.length;f++)i.push(f<s?{state:r,n:t.length}:{state:this,n:0})}t.push(d),r=r.applyInner(d),o=!0}i&&(i[s]={state:r,n:t.length})}}if(!o)return{state:r,transactions:t}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let t=new dc(this.config),r=this.config.fields;for(let i=0;i<r.length;i++){let o=r[i];t[o.name]=o.apply(e,this[o.name],this,t)}return t}get tr(){return new JK(this)}static create(e){let t=new y6(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new dc(t);for(let i=0;i<t.fields.length;i++)r[t.fields[i].name]=t.fields[i].init(e,r);return r}reconfigure(e){let t=new y6(this.schema,e.plugins),r=t.fields,i=new dc(t);for(let o=0;o<r.length;o++){let s=r[o].name;i[s]=this.hasOwnProperty(s)?this[s]:r[o].init(e,i)}return i}toJSON(e){let t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map(r=>r.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=e[r],o=i.spec.state;o&&o.toJSON&&(t[r]=o.toJSON.call(i,this[i.key]))}return t}static fromJSON(e,t,r){if(!t)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let i=new y6(e.schema,e.plugins),o=new dc(i);return i.fields.forEach(s=>{if(s.name=="doc")o.doc=tl.fromJSON(e.schema,t.doc);else if(s.name=="selection")o.selection=ke.fromJSON(o.doc,t.selection);else if(s.name=="storedMarks")t.storedMarks&&(o.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let a in r){let c=r[a],u=c.spec.state;if(c.key==s.name&&u&&u.fromJSON&&Object.prototype.hasOwnProperty.call(t,a)){o[s.name]=u.fromJSON.call(c,e,t[a],o);return}}o[s.name]=s.init(e,o)}}),o}}function JE(n,e,t){for(let r in n){let i=n[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=JE(i,e,{})),t[r]=i}return t}class Rt{constructor(e){this.spec=e,this.props={},e.props&&JE(e.props,this,this.props),this.key=e.key?e.key.key:eA("plugin")}getState(e){return e[this.key]}}const b6=Object.create(null);function eA(n){return n in b6?n+"$"+ ++b6[n]:(b6[n]=0,n+"$")}class $n{constructor(e="key"){this.key=eA(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const vn=function(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e},A2=function(n){let e=n.assignedSlot||n.parentNode;return e&&e.nodeType==11?e.host:e};let tA=null;const fo=function(n,e,t){let r=tA||(tA=document.createRange());return r.setEnd(n,t??n.nodeValue.length),r.setStart(n,e||0),r},rl=function(n,e,t,r){return t&&(nA(n,e,t,r,-1)||nA(n,e,t,r,1))},tq=/^(img|br|input|textarea|hr)$/i;function nA(n,e,t,r,i){for(;;){if(n==t&&e==r)return!0;if(e==(i<0?0:gi(n))){let o=n.parentNode;if(!o||o.nodeType!=1||w6(n)||tq.test(n.nodeName)||n.contentEditable=="false")return!1;e=vn(n)+(i<0?0:1),n=o}else if(n.nodeType==1){if(n=n.childNodes[e+(i<0?-1:0)],n.contentEditable=="false")return!1;e=i<0?gi(n):0}else return!1}}function gi(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function nq(n,e,t){for(let r=e==0,i=e==gi(n);r||i;){if(n==t)return!0;let o=vn(n);if(n=n.parentNode,!n)return!1;r=r&&o==0,i=i&&o==gi(n)}}function w6(n){let e;for(let t=n;t&&!(e=t.pmViewDesc);t=t.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==n||e.contentDOM==n)}const Pm=function(n){return n.focusNode&&rl(n.focusNode,n.focusOffset,n.anchorNode,n.anchorOffset)};function il(n,e){let t=document.createEvent("Event");return t.initEvent("keydown",!0,!0),t.keyCode=n,t.key=t.code=e,t}function rq(n){let e=n.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function iq(n,e,t){if(n.caretPositionFromPoint)try{let r=n.caretPositionFromPoint(e,t);if(r)return{node:r.offsetNode,offset:r.offset}}catch{}if(n.caretRangeFromPoint){let r=n.caretRangeFromPoint(e,t);if(r)return{node:r.startContainer,offset:r.startOffset}}}const yi=typeof navigator<"u"?navigator:null,rA=typeof document<"u"?document:null,vs=yi&&yi.userAgent||"",v6=/Edge\/(\d+)/.exec(vs),iA=/MSIE \d/.exec(vs),C6=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(vs),Fn=!!(iA||C6||v6),Cs=iA?document.documentMode:C6?+C6[1]:v6?+v6[1]:0,Kr=!Fn&&/gecko\/(\d+)/i.test(vs);Kr&&+(/Firefox\/(\d+)/.exec(vs)||[0,0])[1];const k6=!Fn&&/Chrome\/(\d+)/.exec(vs),dn=!!k6,oq=k6?+k6[1]:0,Cn=!Fn&&!!yi&&/Apple Computer/.test(yi.vendor),fc=Cn&&(/Mobile\/\w+/.test(vs)||!!yi&&yi.maxTouchPoints>2),vr=fc||(yi?/Mac/.test(yi.platform):!1),sq=yi?/Win/.test(yi.platform):!1,qr=/Android \d/.test(vs),T2=!!rA&&"webkitFontSmoothing"in rA.documentElement.style,aq=T2?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function lq(n){return{left:0,right:n.documentElement.clientWidth,top:0,bottom:n.documentElement.clientHeight}}function ho(n,e){return typeof n=="number"?n:n[e]}function cq(n){let e=n.getBoundingClientRect(),t=e.width/n.offsetWidth||1,r=e.height/n.offsetHeight||1;return{left:e.left,right:e.left+n.clientWidth*t,top:e.top,bottom:e.top+n.clientHeight*r}}function oA(n,e,t){let r=n.someProp("scrollThreshold")||0,i=n.someProp("scrollMargin")||5,o=n.dom.ownerDocument;for(let s=t||n.dom;s;s=A2(s)){if(s.nodeType!=1)continue;let a=s,c=a==o.body,u=c?lq(o):cq(a),d=0,f=0;if(e.top<u.top+ho(r,"top")?f=-(u.top-e.top+ho(i,"top")):e.bottom>u.bottom-ho(r,"bottom")&&(f=e.bottom-e.top>u.bottom-u.top?e.top+ho(i,"top")-u.top:e.bottom-u.bottom+ho(i,"bottom")),e.left<u.left+ho(r,"left")?d=-(u.left-e.left+ho(i,"left")):e.right>u.right-ho(r,"right")&&(d=e.right-u.right+ho(i,"right")),d||f)if(c)o.defaultView.scrollBy(d,f);else{let h=a.scrollLeft,p=a.scrollTop;f&&(a.scrollTop+=f),d&&(a.scrollLeft+=d);let m=a.scrollLeft-h,y=a.scrollTop-p;e={left:e.left-m,top:e.top-y,right:e.right-m,bottom:e.bottom-y}}if(c||/^(fixed|sticky)$/.test(getComputedStyle(s).position))break}}function uq(n){let e=n.dom.getBoundingClientRect(),t=Math.max(0,e.top),r,i;for(let o=(e.left+e.right)/2,s=t+1;s<Math.min(innerHeight,e.bottom);s+=5){let a=n.root.elementFromPoint(o,s);if(!a||a==n.dom||!n.dom.contains(a))continue;let c=a.getBoundingClientRect();if(c.top>=t-20){r=a,i=c.top;break}}return{refDOM:r,refTop:i,stack:sA(n.dom)}}function sA(n){let e=[],t=n.ownerDocument;for(let r=n;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),n!=t);r=A2(r));return e}function dq({refDOM:n,refTop:e,stack:t}){let r=n?n.getBoundingClientRect().top:0;aA(t,r==0?0:r-e)}function aA(n,e){for(let t=0;t<n.length;t++){let{dom:r,top:i,left:o}=n[t];r.scrollTop!=i+e&&(r.scrollTop=i+e),r.scrollLeft!=o&&(r.scrollLeft=o)}}let hc=null;function fq(n){if(n.setActive)return n.setActive();if(hc)return n.focus(hc);let e=sA(n);n.focus(hc==null?{get preventScroll(){return hc={preventScroll:!0},!0}}:void 0),hc||(hc=!1,aA(e,0))}function lA(n,e){let t,r=2e8,i,o=0,s=e.top,a=e.top,c,u;for(let d=n.firstChild,f=0;d;d=d.nextSibling,f++){let h;if(d.nodeType==1)h=d.getClientRects();else if(d.nodeType==3)h=fo(d).getClientRects();else continue;for(let p=0;p<h.length;p++){let m=h[p];if(m.top<=s&&m.bottom>=a){s=Math.max(m.bottom,s),a=Math.min(m.top,a);let y=m.left>e.left?m.left-e.left:m.right<e.left?e.left-m.right:0;if(y<r){t=d,r=y,i=y&&t.nodeType==3?{left:m.right<e.left?m.right:m.left,top:e.top}:e,d.nodeType==1&&y&&(o=f+(e.left>=(m.left+m.right)/2?1:0));continue}}else m.top>e.top&&!c&&m.left<=e.left&&m.right>=e.left&&(c=d,u={left:Math.max(m.left,Math.min(m.right,e.left)),top:m.top});!t&&(e.left>=m.right&&e.top>=m.top||e.left>=m.left&&e.top>=m.bottom)&&(o=f+1)}}return!t&&c&&(t=c,i=u,r=0),t&&t.nodeType==3?hq(t,i):!t||r&&t.nodeType==1?{node:n,offset:o}:lA(t,i)}function hq(n,e){let t=n.nodeValue.length,r=document.createRange();for(let i=0;i<t;i++){r.setEnd(n,i+1),r.setStart(n,i);let o=ks(r,1);if(o.top!=o.bottom&&S6(e,o))return{node:n,offset:i+(e.left>=(o.left+o.right)/2?1:0)}}return{node:n,offset:0}}function S6(n,e){return n.left>=e.left-1&&n.left<=e.right+1&&n.top>=e.top-1&&n.top<=e.bottom+1}function pq(n,e){let t=n.parentNode;return t&&/^li$/i.test(t.nodeName)&&e.left<n.getBoundingClientRect().left?t:n}function mq(n,e,t){let{node:r,offset:i}=lA(e,t),o=-1;if(r.nodeType==1&&!r.firstChild){let s=r.getBoundingClientRect();o=s.left!=s.right&&t.left>(s.left+s.right)/2?1:-1}return n.docView.posFromDOM(r,i,o)}function gq(n,e,t,r){let i=-1;for(let o=e,s=!1;o!=n.dom;){let a=n.docView.nearestDesc(o,!0);if(!a)return null;if(a.dom.nodeType==1&&(a.node.isBlock&&a.parent&&!s||!a.contentDOM)){let c=a.dom.getBoundingClientRect();if(a.node.isBlock&&a.parent&&!s&&(s=!0,c.left>r.left||c.top>r.top?i=a.posBefore:(c.right<r.left||c.bottom<r.top)&&(i=a.posAfter)),!a.contentDOM&&i<0&&!a.node.isText)return(a.node.isBlock?r.top<(c.top+c.bottom)/2:r.left<(c.left+c.right)/2)?a.posBefore:a.posAfter}o=a.dom.parentNode}return i>-1?i:n.docView.posFromDOM(e,t,-1)}function cA(n,e,t){let r=n.childNodes.length;if(r&&t.top<t.bottom)for(let i=Math.max(0,Math.min(r-1,Math.floor(r*(e.top-t.top)/(t.bottom-t.top))-2)),o=i;;){let s=n.childNodes[o];if(s.nodeType==1){let a=s.getClientRects();for(let c=0;c<a.length;c++){let u=a[c];if(S6(e,u))return cA(s,e,u)}}if((o=(o+1)%r)==i)break}return n}function yq(n,e){let t=n.dom.ownerDocument,r,i=0,o=iq(t,e.left,e.top);o&&({node:r,offset:i}=o);let s=(n.root.elementFromPoint?n.root:t).elementFromPoint(e.left,e.top),a;if(!s||!n.dom.contains(s.nodeType!=1?s.parentNode:s)){let u=n.dom.getBoundingClientRect();if(!S6(e,u)||(s=cA(n.dom,e,u),!s))return null}if(Cn)for(let u=s;r&&u;u=A2(u))u.draggable&&(r=void 0);if(s=pq(s,e),r){if(Kr&&r.nodeType==1&&(i=Math.min(i,r.childNodes.length),i<r.childNodes.length)){let d=r.childNodes[i],f;d.nodeName=="IMG"&&(f=d.getBoundingClientRect()).right<=e.left&&f.bottom>e.top&&i++}let u;T2&&i&&r.nodeType==1&&(u=r.childNodes[i-1]).nodeType==1&&u.contentEditable=="false"&&u.getBoundingClientRect().top>=e.top&&i--,r==n.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?a=n.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!="BR")&&(a=gq(n,r,i,e))}a==null&&(a=mq(n,s,e));let c=n.docView.nearestDesc(s,!0);return{pos:a,inside:c?c.posAtStart-c.border:-1}}function uA(n){return n.top<n.bottom||n.left<n.right}function ks(n,e){let t=n.getClientRects();if(t.length){let r=t[e<0?0:t.length-1];if(uA(r))return r}return Array.prototype.find.call(t,uA)||n.getBoundingClientRect()}const bq=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function dA(n,e,t){let{node:r,offset:i,atom:o}=n.docView.domFromPos(e,t<0?-1:1),s=T2||Kr;if(r.nodeType==3)if(s&&(bq.test(r.nodeValue)||(t<0?!i:i==r.nodeValue.length))){let c=ks(fo(r,i,i),t);if(Kr&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let u=ks(fo(r,i-1,i-1),-1);if(u.top==c.top){let d=ks(fo(r,i,i+1),-1);if(d.top!=c.top)return x2(d,d.left<u.left)}}return c}else{let c=i,u=i,d=t<0?1:-1;return t<0&&!i?(u++,d=-1):t>=0&&i==r.nodeValue.length?(c--,d=1):t<0?c--:u++,x2(ks(fo(r,c,u),d),d<0)}if(!n.state.doc.resolve(e-(o||0)).parent.inlineContent){if(o==null&&i&&(t<0||i==gi(r))){let c=r.childNodes[i-1];if(c.nodeType==1)return M6(c.getBoundingClientRect(),!1)}if(o==null&&i<gi(r)){let c=r.childNodes[i];if(c.nodeType==1)return M6(c.getBoundingClientRect(),!0)}return M6(r.getBoundingClientRect(),t>=0)}if(o==null&&i&&(t<0||i==gi(r))){let c=r.childNodes[i-1],u=c.nodeType==3?fo(c,gi(c)-(s?0:1)):c.nodeType==1&&(c.nodeName!="BR"||!c.nextSibling)?c:null;if(u)return x2(ks(u,1),!1)}if(o==null&&i<gi(r)){let c=r.childNodes[i];for(;c.pmViewDesc&&c.pmViewDesc.ignoreForCoords;)c=c.nextSibling;let u=c?c.nodeType==3?fo(c,0,s?0:1):c.nodeType==1?c:null:null;if(u)return x2(ks(u,-1),!0)}return x2(ks(r.nodeType==3?fo(r):r,-t),t>=0)}function x2(n,e){if(n.width==0)return n;let t=e?n.left:n.right;return{top:n.top,bottom:n.bottom,left:t,right:t}}function M6(n,e){if(n.height==0)return n;let t=e?n.top:n.bottom;return{top:t,bottom:t,left:n.left,right:n.right}}function fA(n,e,t){let r=n.state,i=n.root.activeElement;r!=e&&n.updateState(e),i!=n.dom&&n.focus();try{return t()}finally{r!=e&&n.updateState(r),i!=n.dom&&i&&i.focus()}}function wq(n,e,t){let r=e.selection,i=t=="up"?r.$from:r.$to;return fA(n,e,()=>{let{node:o}=n.docView.domFromPos(i.pos,t=="up"?-1:1);for(;;){let a=n.docView.nearestDesc(o,!0);if(!a)break;if(a.node.isBlock){o=a.contentDOM||a.dom;break}o=a.dom.parentNode}let s=dA(n,i.pos,1);for(let a=o.firstChild;a;a=a.nextSibling){let c;if(a.nodeType==1)c=a.getClientRects();else if(a.nodeType==3)c=fo(a,0,a.nodeValue.length).getClientRects();else continue;for(let u=0;u<c.length;u++){let d=c[u];if(d.bottom>d.top+1&&(t=="up"?s.top-d.top>(d.bottom-s.top)*2:d.bottom-s.bottom>(s.bottom-d.top)*2))return!1}}return!0})}const vq=/[\u0590-\u08ac]/;function Cq(n,e,t){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,o=!i,s=i==r.parent.content.size,a=n.domSelection();return!vq.test(r.parent.textContent)||!a.modify?t=="left"||t=="backward"?o:s:fA(n,e,()=>{let{focusNode:c,focusOffset:u,anchorNode:d,anchorOffset:f}=n.domSelectionRange(),h=a.caretBidiLevel;a.modify("move",t,"character");let p=r.depth?n.docView.domAfterPos(r.before()):n.dom,{focusNode:m,focusOffset:y}=n.domSelectionRange(),b=m&&!p.contains(m.nodeType==1?m:m.parentNode)||c==m&&u==y;try{a.collapse(d,f),c&&(c!=d||u!=f)&&a.extend&&a.extend(c,u)}catch{}return h!=null&&(a.caretBidiLevel=h),b})}let hA=null,pA=null,mA=!1;function kq(n,e,t){return hA==e&&pA==t?mA:(hA=e,pA=t,mA=t=="up"||t=="down"?wq(n,e,t):Cq(n,e,t))}const Cr=0,gA=1,ol=2,bi=3;class I2{constructor(e,t,r,i){this.parent=e,this.children=t,this.dom=r,this.contentDOM=i,this.dirty=Cr,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,r){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;t<this.children.length;t++)e+=this.children[t].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let t=0,r=this.posAtStart;;t++){let i=this.children[t];if(i==e)return r;r+=i.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,t,r){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(r<0){let o,s;if(e==this.contentDOM)o=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;o=e.previousSibling}for(;o&&!((s=o.pmViewDesc)&&s.parent==this);)o=o.previousSibling;return o?this.posBeforeChild(s)+s.size:this.posAtStart}else{let o,s;if(e==this.contentDOM)o=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;o=e.nextSibling}for(;o&&!((s=o.pmViewDesc)&&s.parent==this);)o=o.nextSibling;return o?this.posBeforeChild(s):this.posAtEnd}let i;if(e==this.dom&&this.contentDOM)i=t>vn(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(t==0)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!1;break}if(o.previousSibling)break}if(i==null&&t==e.childNodes.length)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!0;break}if(o.nextSibling)break}}return i??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let r=!0,i=e;i;i=i.parentNode){let o=this.getDesc(i),s;if(o&&(!t||o.node))if(r&&(s=o.nodeDOM)&&!(s.nodeType==1?s.contains(e.nodeType==1?e:e.parentNode):s==e))r=!1;else return o}}getDesc(e){let t=e.pmViewDesc;for(let r=t;r;r=r.parent)if(r==this)return t}posFromDOM(e,t,r){for(let i=e;i;i=i.parentNode){let o=this.getDesc(i);if(o)return o.localPosFromDOM(e,t,r)}return-1}descAt(e){for(let t=0,r=0;t<this.children.length;t++){let i=this.children[t],o=r+i.size;if(r==e&&o!=r){for(;!i.border&&i.children.length;)i=i.children[0];return i}if(e<o)return i.descAt(e-r-i.border);r=o}}domFromPos(e,t){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let r=0,i=0;for(let o=0;r<this.children.length;r++){let s=this.children[r],a=o+s.size;if(a>e||s instanceof wA){i=e-o;break}o=a}if(i)return this.children[r].domFromPos(i-this.children[r].border,t);for(let o;r&&!(o=this.children[r-1]).size&&o instanceof yA&&o.side>=0;r--);if(t<=0){let o,s=!0;for(;o=r?this.children[r-1]:null,!(!o||o.dom.parentNode==this.contentDOM);r--,s=!1);return o&&t&&s&&!o.border&&!o.domAtom?o.domFromPos(o.size,t):{node:this.contentDOM,offset:o?vn(o.dom)+1:0}}else{let o,s=!0;for(;o=r<this.children.length?this.children[r]:null,!(!o||o.dom.parentNode==this.contentDOM);r++,s=!1);return o&&s&&!o.border&&!o.domAtom?o.domFromPos(0,t):{node:this.contentDOM,offset:o?vn(o.dom):this.contentDOM.childNodes.length}}}parseRange(e,t,r=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let i=-1,o=-1;for(let s=r,a=0;;a++){let c=this.children[a],u=s+c.size;if(i==-1&&e<=u){let d=s+c.border;if(e>=d&&t<=u-c.border&&c.node&&c.contentDOM&&this.contentDOM.contains(c.contentDOM))return c.parseRange(e,t,d);e=s;for(let f=a;f>0;f--){let h=this.children[f-1];if(h.size&&h.dom.parentNode==this.contentDOM&&!h.emptyChildAt(1)){i=vn(h.dom)+1;break}e-=h.size}i==-1&&(i=0)}if(i>-1&&(u>t||a==this.children.length-1)){t=u;for(let d=a+1;d<this.children.length;d++){let f=this.children[d];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(-1)){o=vn(f.dom);break}t+=f.size}o==-1&&(o=this.contentDOM.childNodes.length);break}s=u}return{node:this.contentDOM,from:e,to:t,fromOffset:i,toOffset:o}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let t=this.children[e<0?0:this.children.length-1];return t.size==0||t.emptyChildAt(e)}domAfterPos(e){let{node:t,offset:r}=this.domFromPos(e,0);if(t.nodeType!=1||r==t.childNodes.length)throw new RangeError("No node after pos "+e);return t.childNodes[r]}setSelection(e,t,r,i=!1){let o=Math.min(e,t),s=Math.max(e,t);for(let h=0,p=0;h<this.children.length;h++){let m=this.children[h],y=p+m.size;if(o>p&&s<y)return m.setSelection(e-p-m.border,t-p-m.border,r,i);p=y}let a=this.domFromPos(e,e?-1:1),c=t==e?a:this.domFromPos(t,t?-1:1),u=r.getSelection(),d=!1;if((Kr||Cn)&&e==t){let{node:h,offset:p}=a;if(h.nodeType==3){if(d=!!(p&&h.nodeValue[p-1]==`
|
|
@@ -248,7 +248,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
248
248
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,s=!1,a;return{s:function(){t=t.call(n)},n:function(){var u=t.next();return o=u.done,u},e:function(u){s=!0,a=u},f:function(){try{!o&&t.return!=null&&t.return()}finally{if(s)throw a}}}}function DI(n,e){if(n){if(typeof n=="string")return mw(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);if(t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set")return Array.from(n);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return mw(n,e)}}function mw(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=new Array(e);t<e;t++)r[t]=n[t];return r}var NI={name:"FileUpload",extends:wie,inheritAttrs:!1,emits:["select","uploader","before-upload","progress","upload","error","before-send","clear","remove","remove-uploaded-file"],duplicateIEEvent:!1,data:function(){return{uploadedFileCount:0,files:[],messages:[],focused:!1,progress:null,uploadedFiles:[]}},methods:{onFileSelect:function(e){if(e.type!=="drop"&&this.isIE11()&&this.duplicateIEEvent){this.duplicateIEEvent=!1;return}this.messages=[],this.files=this.files||[];var t=e.dataTransfer?e.dataTransfer.files:e.target.files,r=Gg(t),i;try{for(r.s();!(i=r.n()).done;){var o=i.value;this.isFileSelected(o)||this.validate(o)&&(this.isImage(o)&&(o.objectURL=window.URL.createObjectURL(o)),this.files.push(o))}}catch(s){r.e(s)}finally{r.f()}this.$emit("select",{originalEvent:e,files:this.files}),this.fileLimit&&this.checkFileLimit(),this.auto&&this.hasFiles&&!this.isFileLimitExceeded()&&this.upload(),e.type!=="drop"&&this.isIE11()?this.clearIEInput():this.clearInputElement()},choose:function(){this.$refs.fileInput.click()},upload:function(){var e=this;if(this.customUpload)this.fileLimit&&(this.uploadedFileCount+=this.files.length),this.$emit("uploader",{files:this.files}),this.clear();else{var t=new XMLHttpRequest,r=new FormData;this.$emit("before-upload",{xhr:t,formData:r});var i=Gg(this.files),o;try{for(i.s();!(o=i.n()).done;){var s=o.value;r.append(this.name,s,s.name)}}catch(a){i.e(a)}finally{i.f()}t.upload.addEventListener("progress",function(a){a.lengthComputable&&(e.progress=Math.round(a.loaded*100/a.total)),e.$emit("progress",{originalEvent:a,progress:e.progress})}),t.onreadystatechange=function(){if(t.readyState===4){var a;e.progress=0,t.status>=200&&t.status<300?(e.fileLimit&&(e.uploadedFileCount+=e.files.length),e.$emit("upload",{xhr:t,files:e.files})):e.$emit("error",{xhr:t,files:e.files}),(a=e.uploadedFiles).push.apply(a,pw(e.files)),e.clear()}},t.open("POST",this.url,!0),this.$emit("before-send",{xhr:t,formData:r}),t.withCredentials=this.withCredentials,t.send(r)}},clear:function(){this.files=[],this.messages=null,this.$emit("clear"),this.isAdvanced&&this.clearInputElement()},onFocus:function(){this.focused=!0},onBlur:function(){this.focused=!1},isFileSelected:function(e){if(this.files&&this.files.length){var t=Gg(this.files),r;try{for(t.s();!(r=t.n()).done;){var i=r.value;if(i.name+i.type+i.size===e.name+e.type+e.size)return!0}}catch(o){t.e(o)}finally{t.f()}}return!1},isIE11:function(){return!!window.MSInputMethodContext&&!!document.documentMode},validate:function(e){return this.accept&&!this.isFileTypeValid(e)?(this.messages.push(this.invalidFileTypeMessage.replace("{0}",e.name).replace("{1}",this.accept)),!1):this.maxFileSize&&e.size>this.maxFileSize?(this.messages.push(this.invalidFileSizeMessage.replace("{0}",e.name).replace("{1}",this.formatSize(this.maxFileSize))),!1):!0},isFileTypeValid:function(e){var t=this.accept.split(",").map(function(a){return a.trim()}),r=Gg(t),i;try{for(r.s();!(i=r.n()).done;){var o=i.value,s=this.isWildcard(o)?this.getTypeClass(e.type)===this.getTypeClass(o):e.type==o||this.getFileExtension(e).toLowerCase()===o.toLowerCase();if(s)return!0}}catch(a){r.e(a)}finally{r.f()}return!1},getTypeClass:function(e){return e.substring(0,e.indexOf("/"))},isWildcard:function(e){return e.indexOf("*")!==-1},getFileExtension:function(e){return"."+e.name.split(".").pop()},isImage:function(e){return/^image\//.test(e.type)},onDragEnter:function(e){this.disabled||(e.stopPropagation(),e.preventDefault())},onDragOver:function(e){this.disabled||(!this.isUnstyled&&L.addClass(this.$refs.content,"p-fileupload-highlight"),this.$refs.content.setAttribute("data-p-highlight",!0),e.stopPropagation(),e.preventDefault())},onDragLeave:function(){this.disabled||(!this.isUnstyled&&L.removeClass(this.$refs.content,"p-fileupload-highlight"),this.$refs.content.setAttribute("data-p-highlight",!1))},onDrop:function(e){if(!this.disabled){!this.isUnstyled&&L.removeClass(this.$refs.content,"p-fileupload-highlight"),this.$refs.content.setAttribute("data-p-highlight",!1),e.stopPropagation(),e.preventDefault();var t=e.dataTransfer?e.dataTransfer.files:e.target.files,r=this.multiple||t&&t.length===1;r&&this.onFileSelect(e)}},onBasicUploaderClick:function(e){this.hasFiles?this.upload():e.button===0&&this.$refs.fileInput.click()},remove:function(e){this.clearInputElement();var t=this.files.splice(e,1)[0];this.files=pw(this.files),this.$emit("remove",{file:t,files:this.files})},removeUploadedFile:function(e){var t=this.uploadedFiles.splice(e,1)[0];this.uploadedFiles=pw(this.uploadedFiles),this.$emit("remove-uploaded-file",{file:t,files:this.uploadedFiles})},clearInputElement:function(){this.$refs.fileInput.value=""},clearIEInput:function(){this.$refs.fileInput&&(this.duplicateIEEvent=!0,this.$refs.fileInput.value="")},formatSize:function(e){var t,r=1024,i=3,o=((t=this.$primevue.config.locale)===null||t===void 0?void 0:t.fileSizeTypes)||["B","KB","MB","GB","TB","PB","EB","ZB","YB"];if(e===0)return"0 ".concat(o[0]);var s=Math.floor(Math.log(e)/Math.log(r)),a=parseFloat((e/Math.pow(r,s)).toFixed(i));return"".concat(a," ").concat(o[s])},isFileLimitExceeded:function(){return this.fileLimit&&this.fileLimit<=this.files.length+this.uploadedFileCount&&this.focused&&(this.focused=!1),this.fileLimit&&this.fileLimit<this.files.length+this.uploadedFileCount},checkFileLimit:function(){this.isFileLimitExceeded()&&this.messages.push(this.invalidFileLimitMessage.replace("{0}",this.fileLimit.toString()))},onMessageClose:function(){this.messages=null}},computed:{isAdvanced:function(){return this.mode==="advanced"},isBasic:function(){return this.mode==="basic"},chooseButtonClass:function(){return[this.cx("chooseButton"),this.class]},basicChooseButtonLabel:function(){return this.auto?this.chooseButtonLabel:this.hasFiles?this.files.map(function(e){return e.name}).join(", "):this.chooseButtonLabel},hasFiles:function(){return this.files&&this.files.length>0},hasUploadedFiles:function(){return this.uploadedFiles&&this.uploadedFiles.length>0},chooseDisabled:function(){return this.disabled||this.fileLimit&&this.fileLimit<=this.files.length+this.uploadedFileCount},uploadDisabled:function(){return this.disabled||!this.hasFiles||this.fileLimit&&this.fileLimit<this.files.length},cancelDisabled:function(){return this.disabled||!this.hasFiles},chooseButtonLabel:function(){return this.chooseLabel||this.$primevue.config.locale.choose},uploadButtonLabel:function(){return this.uploadLabel||this.$primevue.config.locale.upload},cancelButtonLabel:function(){return this.cancelLabel||this.$primevue.config.locale.cancel},completedLabel:function(){return this.$primevue.config.locale.completed},pendingLabel:function(){return this.$primevue.config.locale.pending}},components:{FileUploadButton:df,FileUploadProgressBar:II,FileUploadMessage:TI,FileContent:OI,PlusIcon:uw,UploadIcon:AI,TimesIcon:Za},directives:{ripple:Nn}},Eie=["multiple","accept","disabled"],Aie=["accept","disabled","multiple"];function Tie(n,e,t,r,i,o){var s=l.resolveComponent("FileUploadButton"),a=l.resolveComponent("FileUploadProgressBar"),c=l.resolveComponent("FileUploadMessage"),u=l.resolveComponent("FileContent"),d=l.resolveDirective("ripple");return o.isAdvanced?(l.openBlock(),l.createElementBlock("div",l.mergeProps({key:0,class:n.cx("root")},n.ptmi("root")),[l.createElementVNode("input",l.mergeProps({ref:"fileInput",type:"file",onChange:e[0]||(e[0]=function(){return o.onFileSelect&&o.onFileSelect.apply(o,arguments)}),multiple:n.multiple,accept:n.accept,disabled:o.chooseDisabled},n.ptm("input")),null,16,Eie),l.createElementVNode("div",l.mergeProps({class:n.cx("buttonbar")},n.ptm("buttonbar")),[l.renderSlot(n.$slots,"header",{files:i.files,uploadedFiles:i.uploadedFiles,chooseCallback:o.choose,uploadCallback:o.upload,clearCallback:o.clear},function(){return[l.withDirectives((l.openBlock(),l.createElementBlock("span",l.mergeProps({class:o.chooseButtonClass,style:n.style,onClick:e[1]||(e[1]=function(){return o.choose&&o.choose.apply(o,arguments)}),onKeydown:e[2]||(e[2]=l.withKeys(function(){return o.choose&&o.choose.apply(o,arguments)},["enter"])),onFocus:e[3]||(e[3]=function(){return o.onFocus&&o.onFocus.apply(o,arguments)}),onBlur:e[4]||(e[4]=function(){return o.onBlur&&o.onBlur.apply(o,arguments)}),tabindex:"0"},n.ptm("chooseButton")),[l.renderSlot(n.$slots,"chooseicon",{class:l.normalizeClass(n.cx("chooseIcon"))},function(){return[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(n.chooseIcon?"span":"PlusIcon"),l.mergeProps({class:[n.cx("chooseIcon"),n.chooseIcon],"aria-hidden":"true"},n.ptm("chooseIcon")),null,16,["class"]))]}),l.createElementVNode("span",l.mergeProps({class:n.cx("chooseButtonLabel")},n.ptm("chooseButtonLabel")),l.toDisplayString(o.chooseButtonLabel),17)],16)),[[d]]),n.showUploadButton?(l.openBlock(),l.createBlock(s,{key:0,label:o.uploadButtonLabel,onClick:o.upload,disabled:o.uploadDisabled,unstyled:n.unstyled,pt:n.ptm("uploadButton")},{icon:l.withCtx(function(f){return[l.renderSlot(n.$slots,"uploadicon",{},function(){return[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(n.uploadIcon?"span":"UploadIcon"),l.mergeProps({class:[f.class,n.uploadIcon],"aria-hidden":"true"},n.ptm("uploadButton").icon,{"data-pc-section":"uploadbuttonicon"}),null,16,["class"]))]})]}),_:3},8,["label","onClick","disabled","unstyled","pt"])):l.createCommentVNode("",!0),n.showCancelButton?(l.openBlock(),l.createBlock(s,{key:1,label:o.cancelButtonLabel,onClick:o.clear,disabled:o.cancelDisabled,unstyled:n.unstyled,pt:n.ptm("cancelButton")},{icon:l.withCtx(function(f){return[l.renderSlot(n.$slots,"cancelicon",{},function(){return[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(n.cancelIcon?"span":"TimesIcon"),l.mergeProps({class:[f.class,n.cancelIcon],"aria-hidden":"true"},n.ptm("cancelButton").icon,{"data-pc-section":"cancelbuttonicon"}),null,16,["class"]))]})]}),_:3},8,["label","onClick","disabled","unstyled","pt"])):l.createCommentVNode("",!0)]})],16),l.createElementVNode("div",l.mergeProps({ref:"content",class:n.cx("content"),onDragenter:e[5]||(e[5]=function(){return o.onDragEnter&&o.onDragEnter.apply(o,arguments)}),onDragover:e[6]||(e[6]=function(){return o.onDragOver&&o.onDragOver.apply(o,arguments)}),onDragleave:e[7]||(e[7]=function(){return o.onDragLeave&&o.onDragLeave.apply(o,arguments)}),onDrop:e[8]||(e[8]=function(){return o.onDrop&&o.onDrop.apply(o,arguments)})},n.ptm("content"),{"data-p-highlight":!1}),[l.renderSlot(n.$slots,"content",{files:i.files,uploadedFiles:i.uploadedFiles,removeUploadedFileCallback:o.removeUploadedFile,removeFileCallback:o.remove,progress:i.progress,messages:i.messages},function(){return[o.hasFiles?(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[l.createVNode(a,{value:i.progress,showValue:!1,unstyled:n.unstyled,pt:n.ptm("progressbar")},null,8,["value","unstyled","pt"]),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(i.messages,function(f){return l.openBlock(),l.createBlock(c,{key:f,severity:"error",onClose:o.onMessageClose,unstyled:n.unstyled,pt:n.ptm("message")},{default:l.withCtx(function(){return[l.createTextVNode(l.toDisplayString(f),1)]}),_:2},1032,["onClose","unstyled","pt"])}),128)),l.createVNode(u,{files:i.files,onRemove:o.remove,badgeValue:o.pendingLabel,previewWidth:n.previewWidth,templates:n.$slots,unstyled:n.unstyled,pt:n.pt},null,8,["files","onRemove","badgeValue","previewWidth","templates","unstyled","pt"])],64)):l.createCommentVNode("",!0),l.createVNode(u,{files:i.uploadedFiles,onRemove:o.removeUploadedFile,badgeValue:o.completedLabel,badgeSeverity:"success",previewWidth:n.previewWidth,templates:n.$slots,unstyled:n.unstyled,pt:n.pt},null,8,["files","onRemove","badgeValue","previewWidth","templates","unstyled","pt"])]}),n.$slots.empty&&!o.hasFiles&&!o.hasUploadedFiles?(l.openBlock(),l.createElementBlock("div",l.mergeProps({key:0,class:n.cx("empty")},n.ptm("empty")),[l.renderSlot(n.$slots,"empty")],16)):l.createCommentVNode("",!0)],16)],16)):o.isBasic?(l.openBlock(),l.createElementBlock("div",l.mergeProps({key:1,class:n.cx("root")},n.ptmi("root")),[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(i.messages,function(f){return l.openBlock(),l.createBlock(c,{key:f,severity:"error",onClose:o.onMessageClose,unstyled:n.unstyled,pt:n.ptm("messages")},{default:l.withCtx(function(){return[l.createTextVNode(l.toDisplayString(f),1)]}),_:2},1032,["onClose","unstyled","pt"])}),128)),l.withDirectives((l.openBlock(),l.createElementBlock("span",l.mergeProps({class:o.chooseButtonClass,style:n.style,onMouseup:e[12]||(e[12]=function(){return o.onBasicUploaderClick&&o.onBasicUploaderClick.apply(o,arguments)}),onKeydown:e[13]||(e[13]=l.withKeys(function(){return o.choose&&o.choose.apply(o,arguments)},["enter"])),onFocus:e[14]||(e[14]=function(){return o.onFocus&&o.onFocus.apply(o,arguments)}),onBlur:e[15]||(e[15]=function(){return o.onBlur&&o.onBlur.apply(o,arguments)}),tabindex:"0"},n.ptm("chooseButton")),[!o.hasFiles||n.auto?l.renderSlot(n.$slots,"uploadicon",{key:0,class:l.normalizeClass(n.cx("uploadIcon"))},function(){return[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(n.uploadIcon?"span":"UploadIcon"),l.mergeProps({class:[n.cx("uploadIcon"),n.uploadIcon],"aria-hidden":"true"},n.ptm("uploadIcon")),null,16,["class"]))]}):l.renderSlot(n.$slots,"chooseicon",{key:1,class:l.normalizeClass(n.cx("chooseIcon"))},function(){return[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(n.chooseIcon?"span":"PlusIcon"),l.mergeProps({class:[n.cx("chooseIcon"),n.chooseIcon],"aria-hidden":"true"},n.ptm("chooseIcon")),null,16,["class"]))]}),l.createElementVNode("span",l.mergeProps({class:n.cx("label")},n.ptm("label")),l.toDisplayString(o.basicChooseButtonLabel),17),o.hasFiles?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock("input",l.mergeProps({key:2,ref:"fileInput",type:"file",accept:n.accept,disabled:n.disabled,multiple:n.multiple,onChange:e[9]||(e[9]=function(){return o.onFileSelect&&o.onFileSelect.apply(o,arguments)}),onFocus:e[10]||(e[10]=function(){return o.onFocus&&o.onFocus.apply(o,arguments)}),onBlur:e[11]||(e[11]=function(){return o.onBlur&&o.onBlur.apply(o,arguments)})},n.ptm("input")),null,16,Aie))],16)),[[d]])],16)):l.createCommentVNode("",!0)}NI.render=Tie;const xie=l.defineComponent({name:"QFileUpload",components:{FileUpload:NI,QBadge:Da,QImageGallery:n6},props:{name:{type:Array,default:null},files:{type:Array,default:()=>[]},url:{type:String,default:""},multiple:{type:Boolean,default:!0},filesAllowed:{type:String,default:"image/*,.pdf"},maxFileSize:{type:Number,default:8388608},autoUpload:{type:Boolean,default:!1},customUpload:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},processing:{type:Boolean,default:!1}},emits:["file-list","upload-error","uploading"],setup(n,{emit:e}){const t=l.ref(null),r=l.ref(),i=()=>{t.value&&t.value.clear()},o=h=>{e("upload-error",h)},s=()=>{t.value&&t.value.upload()},a=h=>{e("uploading",h)},c=h=>{const p=f.value,m=p.findIndex(y=>JSON.stringify(y)===JSON.stringify(h));m!==-1&&(p.splice(m,1),e("file-list",p))},u=h=>{e("file-list",h.files)},{isOverDropZone:d}=tL(r),f=l.computed(()=>n.files);return{fileUpload:t,dropZoneRef:r,allFiles:f,isOverDropZone:d,clear:i,onUpload:s,onUploadError:o,onUploading:a,onRemoveFile:c,onSelectedFiles:u,mq:_n}}}),Iie={class:"file-upload-container w-full"},Oie={ref:"dropZoneRef",class:"flex flex-col relative"},Die={class:"mt-2 mb-0 text-inkwell-0 text-sm"},Nie={key:1,class:"image-gallery-container"};function Pie(n,e,t,r,i,o){const s=l.resolveComponent("q-icon"),a=l.resolveComponent("q-image-gallery"),c=l.resolveComponent("FileUpload",!0);return l.openBlock(),l.createElementBlock("div",Iie,[l.createVNode(c,{ref:"fileUpload",name:n.name,url:n.url,multiple:n.multiple,accept:n.filesAllowed,invalidFileSizeMessage:n.$t("HC_ATTACHMENTS_MUST_BE_LESS_THAN_X_MB",{size:n.maxFileSize/1024/1024}),maxFileSize:n.maxFileSize,auto:n.autoUpload,"custom-upload":n.customUpload,disabled:n.disabled,onError:e[0]||(e[0]=u=>n.onUploadError(u)),onUpload:n.onUpload,onUploader:e[1]||(e[1]=u=>n.onUploading(u)),onSelect:n.onSelectedFiles,pt:{root:{class:"flex flex-col"},content:"!py-0 !px-0 !border-none !rounded-lg",buttonbar:{class:"order-last hidden"}},ptOptions:{mergeProps:!0}},{content:l.withCtx(u=>{var d,f,h;return[l.createElementVNode("div",Oie,[n.isOverDropZone&&n.mq.md?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass(["flex flex-col items-center justify-center","bg-gray-0 border border-blue-20 border-dashed","rounded-lg h-[calc(100%+2px)] w-[calc(100%+2px)] -m-px","absolute top-0 left-0 z-30",{"cursor-pointer":!n.disabled,"border-red-30":u.messages&&u.messages.length>0}]),style:l.normalizeStyle(`
|
|
249
249
|
height: ${(((f=(d=n.dropZoneRef)==null?void 0:d.closest(".editor-container"))==null?void 0:f.clientHeight)||0)+2}px;
|
|
250
250
|
top: ${(h=n.dropZoneRef)!=null&&h.closest(".show-formatting-menu")?-36:0}px;
|
|
251
|
-
`)},[l.createVNode(s,{icon:"paperclip",size:"lg",type:"line",color:"gray-40"}),l.createElementVNode("div",Die,l.toDisplayString(n.$t("HC_CLICK_DRAG_FILES_HERE")),1)],6)):l.createCommentVNode("",!0),l.renderSlot(n.$slots,"default"),n.allFiles.length?(l.openBlock(),l.createElementBlock("div",Nie,[l.createVNode(a,{files:n.allFiles,"show-remove":!0,processing:n.processing,class:"px-4 mt-2 mb-2","onUpdate:modelValue":n.onRemoveFile},null,8,["files","processing","onUpdate:modelValue"])])):l.createCommentVNode("",!0),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(u.messages,p=>(l.openBlock(),l.createElementBlock("p",{class:"text-red-30 mt-2 text-sm leading-5 px-4",key:p},l.toDisplayString(p),1))),128))],512)]}),_:3},8,["name","url","multiple","accept","invalidFileSizeMessage","maxFileSize","auto","custom-upload","disabled","onUpload","onSelect"])])}const PI=ye(xie,[["render",Pie]]),_ie=l.defineComponent({components:{EditorContent:IJ,EmojiPicker:Qte,QFileUpload:PI},props:{modelValue:{type:String,default:""},attachments:{type:Object,default:()=>[]},allowEmojis:{type:Boolean,default:!1},allowAttachments:{type:Boolean,default:!1},allowFormatting:{type:Boolean,default:!1},filesAllowed:{type:String,default:"image/*,.pdf"},isStacked:{type:Boolean,default:!0},isStandalone:{type:Boolean,default:!1},placeholder:{type:String,default:""},processing:{type:Boolean,default:!1}},emits:["update:model-value","update:attachments"],setup(n,{emit:e}){const t=l.ref(),r=l.ref(!1),i=l.ref(""),o=l.ref(),s=l.ref(),a=l.ref(!1),c=l.ref(!1),u=l.ref(!1),d=l.ref([]),f=l.ref(),h=l.ref(),p=l.computed(()=>P.value.getAttributes("textStyle").color||"#121517"),m=l.computed(()=>n.attachments),b=q8(eL).greaterOrEqual("md"),w=()=>{const D=window.prompt("URL");P.value.chain().focus().extendMarkRange("link").setLink({href:D||""}).run()},v=D=>{P.value.chain().focus().setColor(D).run(),C()},k=()=>{a.value=!a.value},C=()=>{a.value=!1},T=()=>{var D,_;(_=(D=f.value)==null?void 0:D.fileUpload)==null||_.choose()},S=D=>{P.value.chain().focus().insertContent(D).run(),o.value.$el.click()},A=D=>{P.value.chain().focus().insertContent(D.i).run(),r.value=!1},O=D=>{d.value=D,I()},I=()=>{let D="";P.value.isEmpty||(D=n.allowFormatting?P.value.getHTML():P.value.getText()),d.value!==n.attachments&&e("update:attachments",d.value),e("update:model-value",D)},P=l.ref(OJ({extensions:[Yne.configure({heading:{levels:[1,2]}}),Qne,Xne,Jne,kre.configure({openOnClick:!1}),Sre.configure({placeholder:n.placeholder})],content:n.modelValue,onUpdate:I}));return l.watch(()=>n.modelValue,D=>{P.value&&!D&&P.value.commands.clearContent()}),l.onBeforeUnmount(()=>{var D;(D=P.value)==null||D.destroy()}),F5(t,()=>{r.value=!1}),{colors:Yk.theme.colors,colorExclusions:["success","success-light","error","error-light","warning","warning-light","info","info-light","transparent","current","green-quore","blue-sky","blue-quore","complaint","recurring","workorder"],editor:P,editorRef:h,emojiPickerElement:t,showEmojiPicker:r,emojiSearch:i,invoker:o,multiUploader:s,showColorMenu:a,focused:u,files:m,showFormatOptions:c,uploadedfiles:d,fileUploadRef:f,setColor:p,mdAndLarger:b,setLink:w,selectColor:v,showColors:k,onClickOutColors:C,attachFiles:T,appendEmoji:S,onSelectEmoji:A,onSelectFiles:O}}}),Lie={key:0,class:"menu flex items-center justify-between !pb-0"},Bie={class:"toolbar flex items-center md:gap-x-4"},Rie={class:"flex items-center gap-x-1"},$ie={key:2,class:"rounded-t-lg grow"},Fie={class:"menu flex items-center justify-between"},Vie={class:"toolbar flex items-center md:gap-x-4"},jie={name:"fade-zoom",class:"flex items-center items-center"},zie={class:"flex items-center px-2 shrink-0"};function Hie(n,e,t,r,i,o){const s=l.resolveComponent("q-icon"),a=l.resolveComponent("editor-content"),c=l.resolveComponent("q-file-upload"),u=l.resolveComponent("emoji-picker");return n.editor?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass(["editor-container rounded-lg",{"has-placeholder":!!n.placeholder,"is-focused":n.focused,"is-stacked":n.isStacked,"is-standalone":n.isStandalone,"show-formatting-menu":n.showFormatOptions}]),onFocusin:e[10]||(e[10]=d=>n.focused=!n.focused),onFocusout:e[11]||(e[11]=d=>n.focused=!n.focused)},[l.createElementVNode("div",{class:l.normalizeClass(["wysiwyg-layout",{flex:!n.isStacked}])},[n.showFormatOptions?(l.openBlock(),l.createElementBlock("div",Lie,[l.createElementVNode("div",Bie,[l.createElementVNode("div",Rie,[l.createVNode(s,{icon:"bold",size:"lg",color:"inkwell-0",class:l.normalizeClass({"is-active":n.editor.isActive("bold")}),onClick:e[0]||(e[0]=d=>n.editor.chain().focus().toggleBold().run())},null,8,["class"]),l.createVNode(s,{icon:"italic",size:"lg",color:"inkwell-0",class:l.normalizeClass({"is-active":n.editor.isActive("italic")}),onClick:e[1]||(e[1]=d=>n.editor.chain().focus().toggleItalic().run())},null,8,["class"]),l.createVNode(s,{icon:"underline",size:"lg",color:"inkwell-0",class:l.normalizeClass({"is-active":n.editor.isActive("underline")}),onClick:e[2]||(e[2]=d=>n.editor.chain().focus().toggleUnderline().run())},null,8,["class"]),l.createVNode(s,{icon:"strikethrough",size:"lg",color:"inkwell-0",class:l.normalizeClass({"is-active":n.editor.isActive("strike")}),onClick:e[3]||(e[3]=d=>n.editor.chain().focus().toggleStrike().run())},null,8,["class"]),l.createVNode(s,{icon:"link",size:"lg",color:"inkwell-0",class:l.normalizeClass({"is-active":n.editor.isActive("link")}),onClick:n.setLink},null,8,["class","onClick"]),n.editor.isActive("link")?(l.openBlock(),l.createBlock(s,{key:0,icon:"link",size:"lg",color:"inkwell-0",class:l.normalizeClass({"is-active":n.editor.isActive("link")}),onClick:e[4]||(e[4]=d=>n.editor.chain().focus().unsetLink().run())},null,8,["class"])):l.createCommentVNode("",!0),l.createVNode(s,{icon:"list",size:"lg",color:"inkwell-0",class:l.normalizeClass({"is-active":n.editor.isActive("bulletList")}),onClick:e[5]||(e[5]=d=>n.editor.chain().focus().toggleBulletList().run())},null,8,["class"]),l.createVNode(s,{icon:"numberlist",size:"lg",color:"inkwell-0",class:l.normalizeClass({"is-active":n.editor.isActive("orderedList")}),onClick:e[6]||(e[6]=d=>n.editor.chain().focus().toggleOrderedList().run())},null,8,["class"])])])])):l.createCommentVNode("",!0),n.allowAttachments?(l.openBlock(),l.createBlock(c,{key:1,ref:"fileUploadRef",files:n.files,"files-allowed":n.filesAllowed,processing:n.processing,class:"rounded-t-lg grow",onFileList:n.onSelectFiles},{default:l.withCtx(()=>[l.createVNode(a,{ref:"editorRef",editor:n.editor,class:"grow"},null,8,["editor"])]),_:1},8,["files","files-allowed","processing","onFileList"])):(l.openBlock(),l.createElementBlock("div",$ie,[l.createVNode(a,{ref:"editorRef",editor:n.editor,class:"grow"},null,8,["editor"])])),n.showEmojiPicker?(l.openBlock(),l.createBlock(u,{key:3,ref:"emojiPickerElement",class:"absolute top-2 left-2 z-[9999]",onSelect:n.onSelectEmoji},null,8,["onSelect"])):l.createCommentVNode("",!0),l.createElementVNode("div",Fie,[l.createElementVNode("div",Vie,[l.createElementVNode("div",jie,[l.createVNode(l.TransitionGroup,{name:"fade-zoom"},{default:l.withCtx(()=>[n.allowFormatting&&n.showFormatOptions?(l.openBlock(),l.createBlock(s,{icon:"close",key:"close",size:"lg",type:"",color:"inkwell-0",class:"md:!hidden bg-gray-7 !p-2 !rounded-full",onClick:e[7]||(e[7]=d=>n.showFormatOptions=!n.showFormatOptions)})):l.createCommentVNode("",!0),n.allowEmojis&&(!n.showFormatOptions||n.mdAndLarger)?(l.openBlock(),l.createBlock(s,{icon:"face-smile",key:"face-smile",size:"lg",type:"outline",color:"inkwell-0",class:l.normalizeClass({"is-active":n.showEmojiPicker}),onClick:e[8]||(e[8]=d=>n.showEmojiPicker=!n.showEmojiPicker)},null,8,["class"])):l.createCommentVNode("",!0),n.allowAttachments&&(!n.showFormatOptions||n.mdAndLarger)?(l.openBlock(),l.createBlock(s,{icon:"paperclip",key:"paperclip",size:"lg",type:"line",color:"inkwell-0",onClick:n.attachFiles},null,8,["onClick"])):l.createCommentVNode("",!0),n.allowFormatting&&(!n.showFormatOptions||n.mdAndLarger)?(l.openBlock(),l.createBlock(s,{icon:"text-format",key:"text-format",size:"lg",type:"outline",color:"inkwell-0",class:l.normalizeClass({"is-active":n.showFormatOptions}),onClick:e[9]||(e[9]=d=>n.showFormatOptions=!n.showFormatOptions)},null,8,["class"])):l.createCommentVNode("",!0)]),_:1})])]),l.createElementVNode("div",zie,[l.renderSlot(n.$slots,"action",{},void 0,!0)])])],2)],34)):l.createCommentVNode("",!0)}const gw=ye(_ie,[["render",Hie],["__scopeId","data-v-a13db2b5"]]),Uie={id:{type:[Number,String],default:null},attachments:{type:Array,default:[]},attachmentClickEvent:{type:Function,default:()=>{}},attachmentRemoveEvent:{type:Function,default:()=>{}},canCopyLink:{type:Boolean,default:!1},canDelete:{type:[Boolean,Number],default:!1},canEdit:{type:[Boolean,Number],default:!1},canPin:{type:Boolean,default:!1},user:{type:Object,default:null},comment:{type:String,default:""},dateUtc:{type:String,default:null},dateLocal:{type:String,default:""},onUpdateComment:{type:Function,default:()=>{}},pinned:{type:Boolean,default:!1},processing:{type:Boolean,default:!1},showAvatar:{type:Boolean,default:!0},showRemoveButton:{type:Object,default:()=>{}}},Zie=l.defineComponent({name:"QComment",components:{QAvatar:u8,QImageGallery:n6,QMenu:m4,QPopover:cE,QWarningModal:lE,QWysiwyg:gw},props:Uie,emits:["update:model-value"],setup(n){const{t:e}=us(),t=[{text:e("HC_CANCEL")}],r=l.ref(null),i=l.ref(!1),o=l.ref(""),s=l.ref(!1),a=l.ref(!1),c=l.ref(!1),u=l.ref(""),d=l.ref(),f=l.computed(()=>{const D=[];return n.canCopyLink&&D.push({text:e("HC_COPY_LINK"),classes:"!text-blue-20 md:!text-inkwell-0",event:b}),n.canPin&&D.push({text:e(n.pinned?"HC_UNPIN_COMMENT":"HC_PIN_COMMENT"),classes:"!text-blue-20 md:!text-inkwell-0",event:I}),n.canEdit&&D.push({text:e("HC_EDIT_COMMENT"),classes:"!text-blue-20 md:!text-inkwell-0",event:S}),n.canDelete&&D.push({text:e("HC_DELETE_COMMENT"),classes:"!text-red-20",event:k}),D}),h=l.computed(()=>n.user.firstName+" "+n.user.lastName.substring(0,1)),p=l.computed(()=>rt.fromISO(n.dateUtc).toLocaleString(rt.DATETIME_MED)),m=l.computed(()=>n.user.name.split(" ").map(D=>D.trim().charAt(0)).join("").toUpperCase()),y=()=>{i.value=!1,o.value=""},b=()=>{navigator.clipboard.writeText(`${window.location.href}#comment-${n.id}`),s.value=!1},w=D=>{r.value=D,u.value="attachment",c.value=!0,s.value=!1},v=async()=>{r.value&&await n.onUpdateComment({event:"delete-attachment",value:r.value.id}),c.value=!1},k=()=>{u.value="comment",c.value=!0,s.value=!1},C=async()=>{await n.onUpdateComment({event:"delete-comment",value:n.id}),c.value=!1},T=()=>{u.value==="comment"?C():v()},S=async()=>{var _,B;i.value=!0,o.value=n.comment,await l.nextTick(),(B=(_=d.value)==null?void 0:_.editor)==null||B.chain().focus("end").run(),s.value=!1;const D=document.getElementById(`comment-${n.id}`);D&&!_n.md&&D.scrollIntoView({block:"center",behavior:"smooth"})},A=()=>{s.value=!s.value},O=D=>{D.event()},I=async()=>{s.value=!1,await n.onUpdateComment({event:"update-pin",value:!n.pinned})},P=async()=>{await n.onUpdateComment({event:"update-comment",value:o.value})};return l.watch(()=>n.processing,D=>{var _,B,F;D||(i.value=!1,o.value="",c.value=!1,d.value&&d.value.allowAttachments&&((F=(B=(_=d.value)==null?void 0:_.fileUploadRef)==null?void 0:B.fileUpload)==null||F.clear(),d.value.uploadedfiles=[]))}),{menuActions:t,activeAttachment:r,editMode:i,editText:o,showControls:s,warningAction:a,warningModal:c,warningType:u,wysiwygRef:d,allowedActions:f,displayName:h,formatDate:p,userInitials:m,onClickCancel:y,onClickCopyLink:b,onClickDeleteAttachment:w,onClickDeleteAttachmentConfirm:v,onClickDeleteComment:k,onClickDeleteCommentConfirm:C,onClickDeleteConfirm:T,onClickEditComment:S,onClickMenu:A,onClickMobileMenuLink:O,onClickSave:P,mq:_n}}}),Wie=["id"],Kie={class:"flex items-start mb-1"},qie={class:"grow"},Gie={class:"w-full block text-sm leading-4 font-bold"},Yie={class:"text-inkwell-0 text-xs leading-4 block"},Qie={class:"w-full py-1"},Xie=["onClick"],Jie={key:2},eoe={key:1,class:"pl-[3rem]"},toe={class:"h-8 flex items-center"},noe={key:2};function roe(n,e,t,r,i,o){const s=l.resolveComponent("q-avatar"),a=l.resolveComponent("q-icon"),c=l.resolveComponent("q-popover"),u=l.resolveComponent("q-menu"),d=l.resolveComponent("q-button"),f=l.resolveComponent("q-wysiwyg"),h=l.resolveComponent("q-image-gallery"),p=l.resolveComponent("q-warning-modal");return n.comment||n.attachments.length?(l.openBlock(),l.createElementBlock("div",{key:0,id:`comment-${n.id}`,class:l.normalizeClass(["comment-container flex flex-col mb-3 py-2",{"-mx-2 px-2 rounded-lg bg-yellow-0":n.pinned}])},[l.createElementVNode("div",Kie,[n.showAvatar?(l.openBlock(),l.createBlock(s,{key:0,src:n.user.profileImg,text:n.userInitials,class:"mr-4"},null,8,["src","text"])):l.createCommentVNode("",!0),l.createElementVNode("div",qie,[l.createElementVNode("span",Gie,l.toDisplayString(n.user.name),1),l.createElementVNode("span",Yie,l.toDisplayString(n.dateLocal||n.formatDate),1)]),n.allowedActions.length&&n.mq.md?(l.openBlock(),l.createBlock(c,{key:1,modelValue:n.showControls,"onUpdate:modelValue":e[0]||(e[0]=m=>n.showControls=m),align:"right",position:"bottom",size:"sm"},{trigger:l.withCtx(()=>[l.createVNode(a,{icon:"ellipsis-h",type:"fill",class:l.normalizeClass(["shrink-0 cursor-pointer",n.showControls&&"!text-blue-20"]),color:"gray-40",onClick:n.onClickMenu},null,8,["class","onClick"])]),content:l.withCtx(()=>[l.createElementVNode("ul",Qie,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(n.allowedActions,(m,y)=>(l.openBlock(),l.createElementBlock("li",{key:y,class:l.normalizeClass(m.classes),onClick:b=>m.event(b)},l.toDisplayString(m.text),11,Xie))),128))])]),_:1},8,["modelValue"])):l.createCommentVNode("",!0),n.allowedActions.length&&!n.mq.md?(l.openBlock(),l.createElementBlock("div",Jie,[l.createVNode(a,{icon:"ellipsis-h",type:"fill",class:"shrink-0 cursor-pointer",color:"gray-40",onClick:n.onClickMenu},null,8,["onClick"]),l.createVNode(l.Transition,{name:"fade"},{default:l.withCtx(()=>[n.showControls?(l.openBlock(),l.createBlock(u,{key:0,modelValue:n.showControls,"onUpdate:modelValue":e[1]||(e[1]=m=>n.showControls=m),actions:n.menuActions,links:n.allowedActions,"links-background":"light-gray","onClick:link":n.onClickMobileMenuLink,"onClick:action":n.onClickMenu},null,8,["modelValue","actions","links","onClick:link","onClick:action"])):l.createCommentVNode("",!0)]),_:1})])):l.createCommentVNode("",!0)]),n.editMode?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass(["leading-normal text-sm",{"ml-12":n.showAvatar}])},[l.createElementVNode("p",null,l.toDisplayString(n.comment),1)],2)),n.editMode?(l.openBlock(),l.createElementBlock("div",eoe,[l.createVNode(f,{ref:"wysiwygRef",modelValue:n.editText,"onUpdate:modelValue":e[2]||(e[2]=m=>n.editText=m),"is-stacked":!0},{action:l.withCtx(()=>[l.createElementVNode("div",toe,[l.createVNode(d,{disabled:n.processing,status:"link",class:"!text-gray-40 mr-4 hover:!text-inkwell-0 hover:!no-underline",onClick:n.onClickCancel},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(n.$t("HC_CANCEL")),1)]),_:1},8,["disabled","onClick"]),l.createVNode(d,{disabled:n.processing,loading:n.processing,class:"text-xs hover:!text-blue-40 hover:!no-underline",status:"link",onClick:n.onClickSave},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(n.$t("HC_SAVE")),1)]),_:1},8,["disabled","loading","onClick"])])]),_:1},8,["modelValue"])])):(l.openBlock(),l.createElementBlock("div",noe,[n.attachments.length?(l.openBlock(),l.createBlock(h,{key:0,class:l.normalizeClass(["mt-3",{"ml-12":n.showAvatar}]),files:n.attachments,"show-remove":n.canDelete,"onClick:file":n.attachmentClickEvent,"onUpdate:modelValue":n.onClickDeleteAttachment},null,8,["class","files","show-remove","onClick:file","onUpdate:modelValue"])):l.createCommentVNode("",!0)])),l.createVNode(p,{id:"warning-modal",action:n.onClickDeleteConfirm,"onUpdate:action":e[3]||(e[3]=m=>n.onClickDeleteConfirm=m),toggle:n.warningModal,"onUpdate:toggle":[e[4]||(e[4]=m=>n.warningModal=m),e[5]||(e[5]=m=>n.warningModal=!1)],processing:n.processing},{desktopHeader:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(n.$t(n.warningType==="comment"?"HC_WARNING_CONFIRM_DELETE_COMMENT":"HC_ARE_YOU_SURE_DELETE_ATTACHMENT")),1)]),desktopMessage:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(n.$t(n.warningType==="comment"?"HC_CLICK_DELETE_COMMENT_NO_LONGER_SEE":"HC_CLICK_DELETE_ATTACHMENT_NO_LONGER_SEE")),1)]),mobileHeader:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(n.$t(n.warningType==="comment"?"HC_DELETE_COMMENT":"HC_ARE_YOU_SURE_DELETE_ATTACHMENT")),1)]),mobileMessage:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(n.$t(n.warningType==="comment"?"HC_WARNING_CONFIRM_DELETE_COMMENT":"HC_CLICK_DELETE_ATTACHMENT_NO_LONGER_SEE")),1)]),buttonText:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(n.$t(n.warningType==="comment"?"HC_DELETE_COMMENT":"HC_DELETE_ATTACHMENT")),1)]),_:1},8,["action","toggle","processing"])],10,Wie)):l.createCommentVNode("",!0)}const _I=ye(Zie,[["render",roe],["__scopeId","data-v-c6c6f953"]]),ioe=l.defineComponent({name:"QCommentSection",components:{QComment:_I,QWysiwyg:gw},props:{comments:{type:Array,default:()=>[]},allowAttachments:{type:Boolean,default:!1},allowEmojis:{type:Boolean,default:!1},allowFormatting:{type:Boolean,default:!1},addCommentEvent:{type:Function,default:()=>{}},filesAllowed:{type:String,default:"image/*,.pdf"},updateCommentEvent:{type:Function,default:()=>{}},placeholder:{type:String,default:""},processing:{type:Boolean,default:!1},showRemoveButton:{type:Object,default:()=>{}}},setup(n){const{t:e}=us(),t=l.ref([]),r=l.ref(""),i=l.ref(n.placeholder||e("HC_ADD_A_COMMENT")),o=l.ref(),s=async()=>{await n.addCommentEvent({text:r.value,attachments:t.value})},a=async(c,u)=>{await n.updateCommentEvent({comment:c,...u})};return l.watch(()=>n.processing,c=>{var u,d;c||(t.value=[],r.value="",o.value&&o.value.allowAttachments&&((d=(u=o.value.fileUploadRef)==null?void 0:u.fileUpload)==null||d.clear(),o.value.uploadedfiles=[]))}),{files:t,placeholderText:i,textareaValue:r,wysiwygRef:o,onClickPost:s,onUpdateComment:a}}}),ooe={class:"comment-section"},soe={key:0,class:"comments"},aoe={key:1,class:"no-comments text-center mb-6 mt-4"},loe={class:"text-md mb-2 leading-6 font-bold text-inkwell-30"},coe={class:"text-sm text-inkwell-0"};function uoe(n,e,t,r,i,o){const s=l.resolveComponent("q-comment"),a=l.resolveComponent("q-button"),c=l.resolveComponent("q-wysiwyg");return l.openBlock(),l.createElementBlock("div",ooe,[n.comments&&n.comments.length?(l.openBlock(),l.createElementBlock("div",soe,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(n.comments,(u,d)=>(l.openBlock(),l.createBlock(s,l.mergeProps(u,{key:d,"on-update-comment":f=>n.onUpdateComment(u,f)}),null,16,["on-update-comment"]))),128))])):(l.openBlock(),l.createElementBlock("div",aoe,[l.createElementVNode("h4",loe,l.toDisplayString(n.$t("HC_NO_COMMENTS_YET")),1),l.createElementVNode("p",coe,l.toDisplayString(n.$t("HC_START_THE_CONVERSATION")),1)])),l.renderSlot(n.$slots,"default",{},()=>[l.createVNode(c,{ref:"wysiwygRef",modelValue:n.textareaValue,"onUpdate:modelValue":[e[0]||(e[0]=u=>n.textareaValue=u),e[2]||(e[2]=u=>n.textareaValue=u)],attachments:n.files,"is-stacked":!0,"allow-attachments":n.allowAttachments,"allow-emojis":n.allowEmojis,"allow-formatting":n.allowFormatting,"files-allowed":n.filesAllowed,placeholder:n.placeholderText,processing:n.processing,"onUpdate:attachments":e[1]||(e[1]=u=>n.files=u)},{action:l.withCtx(()=>[l.createVNode(a,{loading:n.processing,disabled:n.processing||!n.files.length&&!n.textareaValue,status:"link",class:"hover:text-blue-40 hover:no-underline",onClick:n.onClickPost},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(n.$t("HC_POST")),1)]),_:1},8,["loading","disabled","onClick"])]),_:1},8,["modelValue","attachments","allow-attachments","allow-emojis","allow-formatting","files-allowed","placeholder","processing"])],!0)])}const doe=ye(ioe,[["render",uoe],["__scopeId","data-v-82ce0d39"]]),foe=l.defineComponent({name:"QCounter",props:{modelValue:{type:Number,default:0},min:{type:Number,default:0},max:{type:Number,default:100},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(n,{emit:e}){return{updateCount:r=>{let o=n.modelValue+r;return o>n.max?o=n.max:o<n.min&&(o=n.min),e("update:modelValue",o),o}}}}),hoe={class:"counter flex items-center"},poe={class:"grow text-center"};function moe(n,e,t,r,i,o){const s=l.resolveComponent("q-icon");return l.openBlock(),l.createElementBlock("div",hoe,[l.createVNode(s,l.mergeProps({icon:"minus-circle",type:"outline",size:"sm",color:"inkwell-30",class:"cursor-pointer mr-1"},{[l.toHandlerKey(!n.disabled&&"click")]:e[0]||(e[0]=a=>n.updateCount(-1))}),null,16),l.createElementVNode("span",poe,l.toDisplayString(n.modelValue),1),l.createVNode(s,l.mergeProps({icon:"circle-plus",type:"outline",size:"sm",color:"inkwell-30",class:"cursor-pointer ml-1"},{[l.toHandlerKey(!n.disabled&&"click")]:e[1]||(e[1]=a=>n.updateCount(1))}),null,16)])}const goe=ye(foe,[["render",moe]]);function LI(n){return n instanceof Date||Object.prototype.toString.call(n)==="[object Date]"}function Yg(n){return LI(n)?new Date(n.getTime()):n==null?new Date(NaN):new Date(n)}function yoe(n){return LI(n)&&!isNaN(n.getTime())}function BI(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;if(!(e>=0&&e<=6))throw new RangeError("weekStartsOn must be between 0 and 6");var t=Yg(n),r=t.getDay(),i=(r+7-e)%7;return t.setDate(t.getDate()-i),t.setHours(0,0,0,0),t}function RI(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=e.firstDayOfWeek,r=t===void 0?0:t,i=e.firstWeekContainsDate,o=i===void 0?1:i;if(!(o>=1&&o<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7");for(var s=Yg(n),a=s.getFullYear(),c=new Date(0),u=a+1;u>=a-1&&(c.setFullYear(u,0,o),c.setHours(0,0,0,0),c=BI(c,r),!(s.getTime()>=c.getTime()));u--);return c}function yw(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=e.firstDayOfWeek,r=t===void 0?0:t,i=e.firstWeekContainsDate,o=i===void 0?1:i,s=Yg(n),a=BI(s,r),c=RI(s,{firstDayOfWeek:r,firstWeekContainsDate:o}),u=a.getTime()-c.getTime();return Math.round(u/(7*24*3600*1e3))+1}var bw={months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],weekdaysMin:["Su","Mo","Tu","We","Th","Fr","Sa"],firstDayOfWeek:0,firstWeekContainsDate:1},boe=/\[([^\]]+)]|YYYY|YY?|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|m{1,2}|s{1,2}|Z{1,2}|S{1,3}|w{1,2}|x|X|a|A/g;function or(n){for(var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2,t="".concat(Math.abs(n)),r=n<0?"-":"";t.length<e;)t="0".concat(t);return r+t}function $I(n){return Math.round(n.getTimezoneOffset()/15)*15}function FI(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",t=n>0?"-":"+",r=Math.abs(n),i=Math.floor(r/60),o=r%60;return t+or(i,2)+e+or(o,2)}var VI=function(e,t,r){var i=e<12?"AM":"PM";return r?i.toLocaleLowerCase():i},hf={Y:function(e){var t=e.getFullYear();return t<=9999?"".concat(t):"+".concat(t)},YY:function(e){return or(e.getFullYear(),4).substr(2)},YYYY:function(e){return or(e.getFullYear(),4)},M:function(e){return e.getMonth()+1},MM:function(e){return or(e.getMonth()+1,2)},MMM:function(e,t){return t.monthsShort[e.getMonth()]},MMMM:function(e,t){return t.months[e.getMonth()]},D:function(e){return e.getDate()},DD:function(e){return or(e.getDate(),2)},H:function(e){return e.getHours()},HH:function(e){return or(e.getHours(),2)},h:function(e){var t=e.getHours();return t===0?12:t>12?t%12:t},hh:function(){var e=hf.h.apply(hf,arguments);return or(e,2)},m:function(e){return e.getMinutes()},mm:function(e){return or(e.getMinutes(),2)},s:function(e){return e.getSeconds()},ss:function(e){return or(e.getSeconds(),2)},S:function(e){return Math.floor(e.getMilliseconds()/100)},SS:function(e){return or(Math.floor(e.getMilliseconds()/10),2)},SSS:function(e){return or(e.getMilliseconds(),3)},d:function(e){return e.getDay()},dd:function(e,t){return t.weekdaysMin[e.getDay()]},ddd:function(e,t){return t.weekdaysShort[e.getDay()]},dddd:function(e,t){return t.weekdays[e.getDay()]},A:function(e,t){var r=t.meridiem||VI;return r(e.getHours(),e.getMinutes(),!1)},a:function(e,t){var r=t.meridiem||VI;return r(e.getHours(),e.getMinutes(),!0)},Z:function(e){return FI($I(e),":")},ZZ:function(e){return FI($I(e))},X:function(e){return Math.floor(e.getTime()/1e3)},x:function(e){return e.getTime()},w:function(e,t){return yw(e,{firstDayOfWeek:t.firstDayOfWeek,firstWeekContainsDate:t.firstWeekContainsDate})},ww:function(e,t){return or(hf.w(e,t),2)}};function ww(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=e?String(e):"YYYY-MM-DDTHH:mm:ss.SSSZ",i=Yg(n);if(!yoe(i))return"Invalid Date";var o=t.locale||bw;return r.replace(boe,function(s,a){return a||(typeof hf[s]=="function"?"".concat(hf[s](i,o)):s)})}function jI(n){return Coe(n)||voe(n)||woe()}function woe(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function voe(n){if(Symbol.iterator in Object(n)||Object.prototype.toString.call(n)==="[object Arguments]")return Array.from(n)}function Coe(n){if(Array.isArray(n)){for(var e=0,t=new Array(n.length);e<n.length;e++)t[e]=n[e];return t}}function zI(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function koe(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?zI(t,!0).forEach(function(r){Vs(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):zI(t).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Soe(n,e){return Aoe(n)||Eoe(n,e)||Moe()}function Moe(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}function Eoe(n,e){if(Symbol.iterator in Object(n)||Object.prototype.toString.call(n)==="[object Arguments]"){var t=[],r=!0,i=!1,o=void 0;try{for(var s=n[Symbol.iterator](),a;!(r=(a=s.next()).done)&&(t.push(a.value),!(e&&t.length===e));r=!0);}catch(c){i=!0,o=c}finally{try{!r&&s.return!=null&&s.return()}finally{if(i)throw o}}return t}}function Aoe(n){if(Array.isArray(n))return n}function Vs(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}var Toe=/(\[[^\[]*\])|(MM?M?M?|Do|DD?|ddd?d?|w[o|w]?|YYYY|YY|a|A|hh?|HH?|mm?|ss?|S{1,3}|x|X|ZZ?|.)/g,HI=/\d/,js=/\d\d/,xoe=/\d{3}/,Ioe=/\d{4}/,Bc=/\d\d?/,Ooe=/[+-]\d\d:?\d\d/,UI=/[+-]?\d+/,Doe=/[+-]?\d+(\.\d{1,3})?/,vw="year",Qg="month",ZI="day",WI="hour",KI="minute",qI="second",Cw="millisecond",GI={},Ke=function(e,t,r){var i=Array.isArray(e)?e:[e],o;typeof r=="string"?o=function(a){var c=parseInt(a,10);return Vs({},r,c)}:o=r,i.forEach(function(s){GI[s]=[t,o]})},Noe=function(e){return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&")},pf=function(e){return function(t){var r=t[e];if(!Array.isArray(r))throw new Error("Locale[".concat(e,"] need an array"));return new RegExp(r.map(Noe).join("|"))}},mf=function(e,t){return function(r,i){var o=i[e];if(!Array.isArray(o))throw new Error("Locale[".concat(e,"] need an array"));var s=o.indexOf(r);if(s<0)throw new Error("Invalid Word");return Vs({},t,s)}};Ke("Y",UI,vw),Ke("YY",js,function(n){var e=new Date().getFullYear(),t=Math.floor(e/100),r=parseInt(n,10);return r=(r>68?t-1:t)*100+r,Vs({},vw,r)}),Ke("YYYY",Ioe,vw),Ke("M",Bc,function(n){return Vs({},Qg,parseInt(n,10)-1)}),Ke("MM",js,function(n){return Vs({},Qg,parseInt(n,10)-1)}),Ke("MMM",pf("monthsShort"),mf("monthsShort",Qg)),Ke("MMMM",pf("months"),mf("months",Qg)),Ke("D",Bc,ZI),Ke("DD",js,ZI),Ke(["H","h"],Bc,WI),Ke(["HH","hh"],js,WI),Ke("m",Bc,KI),Ke("mm",js,KI),Ke("s",Bc,qI),Ke("ss",js,qI),Ke("S",HI,function(n){return Vs({},Cw,parseInt(n,10)*100)}),Ke("SS",js,function(n){return Vs({},Cw,parseInt(n,10)*10)}),Ke("SSS",xoe,Cw);function Poe(n){return n.meridiemParse||/[ap]\.?m?\.?/i}function _oe(n){return"".concat(n).toLowerCase().charAt(0)==="p"}Ke(["A","a"],Poe,function(n,e){var t=typeof e.isPM=="function"?e.isPM(n):_oe(n);return{isPM:t}});function Loe(n){var e=n.match(/([+-]|\d\d)/g)||["-","0","0"],t=Soe(e,3),r=t[0],i=t[1],o=t[2],s=parseInt(i,10)*60+parseInt(o,10);return s===0?0:r==="+"?-s:+s}Ke(["Z","ZZ"],Ooe,function(n){return{offset:Loe(n)}}),Ke("x",UI,function(n){return{date:new Date(parseInt(n,10))}}),Ke("X",Doe,function(n){return{date:new Date(parseFloat(n)*1e3)}}),Ke("d",HI,"weekday"),Ke("dd",pf("weekdaysMin"),mf("weekdaysMin","weekday")),Ke("ddd",pf("weekdaysShort"),mf("weekdaysShort","weekday")),Ke("dddd",pf("weekdays"),mf("weekdays","weekday")),Ke("w",Bc,"week"),Ke("ww",js,"week");function Boe(n,e){if(n!==void 0&&e!==void 0){if(e){if(n<12)return n+12}else if(n===12)return 0}return n}function Roe(n){for(var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:new Date,t=[0,0,1,0,0,0,0],r=[e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()],i=!0,o=0;o<7;o++)n[o]===void 0?t[o]=i?r[o]:t[o]:(t[o]=n[o],i=!1);return t}function $oe(n,e,t,r,i,o,s){var a;return n<100&&n>=0?(a=new Date(n+400,e,t,r,i,o,s),isFinite(a.getFullYear())&&a.setFullYear(n)):a=new Date(n,e,t,r,i,o,s),a}function Foe(){for(var n,e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var i=t[0];return i<100&&i>=0?(t[0]+=400,n=new Date(Date.UTC.apply(Date,t)),isFinite(n.getUTCFullYear())&&n.setUTCFullYear(i)):n=new Date(Date.UTC.apply(Date,t)),n}function Voe(n,e,t){var r=e.match(Toe);if(!r)throw new Error;for(var i=r.length,o={},s=0;s<i;s+=1){var a=r[s],c=GI[a];if(c){var d=typeof c[0]=="function"?c[0](t):c[0],f=c[1],h=(d.exec(n)||[])[0],p=f(h,t);o=koe({},o,{},p),n=n.replace(h,"")}else{var u=a.replace(/^\[|\]$/g,"");if(n.indexOf(u)===0)n=n.substr(u.length);else throw new Error("not match")}}return o}function joe(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};try{var r=t.locale,i=r===void 0?bw:r,o=t.backupDate,s=o===void 0?new Date:o,a=Voe(n,e,i),c=a.year,u=a.month,d=a.day,f=a.hour,h=a.minute,p=a.second,m=a.millisecond,y=a.isPM,b=a.date,w=a.offset,v=a.weekday,k=a.week;if(b)return b;var C=[c,u,d,f,h,p,m];if(C[3]=Boe(C[3],y),k!==void 0&&u===void 0&&d===void 0){var T=RI(c===void 0?s:new Date(c,3),{firstDayOfWeek:i.firstDayOfWeek,firstWeekContainsDate:i.firstWeekContainsDate});return new Date(T.getTime()+(k-1)*7*24*3600*1e3)}var S,A=Roe(C,s);return w!==void 0?(A[6]+=w*60*1e3,S=Foe.apply(void 0,jI(A))):S=$oe.apply(void 0,jI(A)),v!==void 0&&S.getDay()!==v?new Date(NaN):S}catch{return new Date(NaN)}}var zoe=Object.defineProperty,Hoe=Object.defineProperties,Uoe=Object.getOwnPropertyDescriptors,Xg=Object.getOwnPropertySymbols,YI=Object.prototype.hasOwnProperty,QI=Object.prototype.propertyIsEnumerable,XI=(n,e,t)=>e in n?zoe(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Vt=(n,e)=>{for(var t in e||(e={}))YI.call(e,t)&&XI(n,t,e[t]);if(Xg)for(var t of Xg(e))QI.call(e,t)&&XI(n,t,e[t]);return n},Or=(n,e)=>Hoe(n,Uoe(e)),Zoe=(n,e)=>{var t={};for(var r in n)YI.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&Xg)for(var r of Xg(n))e.indexOf(r)<0&&QI.call(n,r)&&(t[r]=n[r]);return t};const Woe={formatLocale:bw,yearFormat:"YYYY",monthFormat:"MMM",monthBeforeYear:!0};let gf="en";const Rc={};Rc[gf]=Woe;function JI(n,e,t=!1){if(typeof n!="string")return Rc[gf];let r=gf;return Rc[n]&&(r=n),e&&(Rc[n]=e,r=n),t||(gf=r),Rc[n]||Rc[gf]}function kw(n){return JI(n,void 0,!0)}function Sw(n,e){if(!Array.isArray(n))return[];const t=[],r=n.length;let i=0;for(e=e||r;i<r;)t.push(n.slice(i,i+=e));return t}function eO(n){return Array.isArray(n)?n[n.length-1]:void 0}function zs(n){return Object.prototype.toString.call(n)==="[object Object]"}function wo(n,e){const t={};return zs(n)&&(Array.isArray(e)||(e=[e]),e.forEach(r=>{Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])})),t}function tO(n,e){if(!zs(n))return{};let t=n;return zs(e)&&Object.keys(e).forEach(r=>{let i=e[r];const o=n[r];zs(i)&&zs(o)&&(i=tO(o,i)),t=Or(Vt({},t),{[r]:i})}),t}function Mw(n){const e=parseInt(String(n),10);return e<10?`0${e}`:`${e}`}function Koe(n){const e=/-(\w)/g;return n.replace(e,(t,r)=>r?r.toUpperCase():"")}const nO="datepicker_locale",rO="datepicker_prefixClass",iO="datepicker_getWeek";function Ew(){return l.inject(nO,l.shallowRef(kw()))}function qoe(n){const e=l.computed(()=>zs(n.value)?tO(kw(),n.value):kw(n.value));return l.provide(nO,e),e}function Goe(n){l.provide(rO,n)}function Mn(){return l.inject(rO,"mx")}function Yoe(n){l.provide(iO,n)}function Qoe(){return l.inject(iO,yw)}function Xoe(n){const e=n.style.display,t=n.style.visibility;n.style.display="block",n.style.visibility="hidden";const r=window.getComputedStyle(n),i=n.offsetWidth+parseInt(r.marginLeft,10)+parseInt(r.marginRight,10),o=n.offsetHeight+parseInt(r.marginTop,10)+parseInt(r.marginBottom,10);return n.style.display=e,n.style.visibility=t,{width:i,height:o}}function Joe(n,e,t,r){let i=0,o=0,s=0,a=0;const c=n.getBoundingClientRect(),u=document.documentElement.clientWidth,d=document.documentElement.clientHeight;return r&&(s=window.pageXOffset+c.left,a=window.pageYOffset+c.top),u-c.left<e&&c.right<e?i=s-c.left+1:c.left+c.width/2<=u/2?i=s:i=s+c.width-e,c.top<=t&&d-c.bottom<=t?o=a+d-c.top-t:c.top+c.height/2<=d/2?o=a+c.height:o=a-t,{left:`${i}px`,top:`${o}px`}}function Aw(n,e=document.body){if(!n||n===e)return null;const t=(o,s)=>getComputedStyle(o,null).getPropertyValue(s);return/(auto|scroll)/.test(t(n,"overflow")+t(n,"overflow-y")+t(n,"overflow-x"))?n:Aw(n.parentElement,e)}let Jg;function ese(){if(typeof window>"u")return 0;if(Jg!==void 0)return Jg;const n=document.createElement("div");n.style.visibility="hidden",n.style.overflow="scroll",n.style.width="100px",n.style.position="absolute",n.style.top="-9999px",document.body.appendChild(n);const e=document.createElement("div");return e.style.width="100%",n.appendChild(e),Jg=n.offsetWidth-e.offsetWidth,n.parentNode.removeChild(n),Jg}const oO="ontouchend"in document?"touchstart":"mousedown";function tse(n){let e=!1;return function(...r){e||(e=!0,requestAnimationFrame(()=>{e=!1,n.apply(this,r)}))}}function vo(n,e){return{setup:n,name:n.name,props:e}}function Co(n,e){return new Proxy(n,{get(r,i){const o=r[i];return o!==void 0?o:e[i]}})}const Hs=()=>n=>n,nse=(n,e)=>{const t={};for(const r in n)if(Object.prototype.hasOwnProperty.call(n,r)){const i=Koe(r);let o=n[r];e.indexOf(i)!==-1&&o===""&&(o=!0),t[i]=o}return t};function rse(n,{slots:e}){const t=Co(n,{appendToBody:!0}),r=Mn(),i=l.ref(null),o=l.ref({left:"",top:""}),s=()=>{if(!t.visible||!i.value)return;const c=t.getRelativeElement();if(!c)return;const{width:u,height:d}=Xoe(i.value);o.value=Joe(c,u,d,t.appendToBody)};l.watchEffect(s,{flush:"post"}),l.watchEffect(c=>{const u=t.getRelativeElement();if(!u)return;const d=Aw(u)||window,f=tse(s);d.addEventListener("scroll",f),window.addEventListener("resize",f),c(()=>{d.removeEventListener("scroll",f),window.removeEventListener("resize",f)})},{flush:"post"});const a=c=>{if(!t.visible)return;const u=c.target,d=i.value,f=t.getRelativeElement();d&&!d.contains(u)&&f&&!f.contains(u)&&t.onClickOutside(c)};return l.watchEffect(c=>{document.addEventListener(oO,a),c(()=>{document.removeEventListener(oO,a)})}),()=>l.createVNode(l.Teleport,{to:"body",disabled:!t.appendToBody},{default:()=>[l.createVNode(l.Transition,{name:`${r}-zoom-in-down`},{default:()=>{var c;return[t.visible&&l.createVNode("div",{ref:i,class:`${r}-datepicker-main ${r}-datepicker-popup ${t.className}`,style:[Vt({position:"absolute"},o.value),t.style||{}]},[(c=e.default)==null?void 0:c.call(e)])]}})]})}const ise=Hs()(["style","className","visible","appendToBody","onClickOutside","getRelativeElement"]);var ose=vo(rse,ise);const sse={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",width:"1em",height:"1em"},ase=[l.createElementVNode("path",{d:"M940.218 107.055H730.764v-60.51H665.6v60.51H363.055v-60.51H297.89v60.51H83.78c-18.617 0-32.581 13.963-32.581 32.581v805.237c0 18.618 13.964 32.582 32.582 32.582h861.09c18.619 0 32.583-13.964 32.583-32.582V139.636c-4.655-18.618-18.619-32.581-37.237-32.581zm-642.327 65.163v60.51h65.164v-60.51h307.2v60.51h65.163v-60.51h176.873v204.8H116.364v-204.8H297.89zM116.364 912.291V442.18H912.29v470.11H116.364z"},null,-1)];function sO(n,e){return l.openBlock(),l.createElementBlock("svg",sse,ase)}const lse={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",width:"1em",height:"1em"},cse=[l.createElementVNode("path",{d:"M810.005 274.005 572.011 512l237.994 237.995-60.01 60.01L512 572.011 274.005 810.005l-60.01-60.01L451.989 512 213.995 274.005l60.01-60.01L512 451.989l237.995-237.994z"},null,-1)];function use(n,e){return l.openBlock(),l.createElementBlock("svg",lse,cse)}const dse={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"1em",height:"1em"},fse=[l.createElementVNode("path",{d:"M0 0h24v24H0z",fill:"none"},null,-1),l.createElementVNode("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"},null,-1),l.createElementVNode("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"},null,-1)];function hse(n,e){return l.openBlock(),l.createElementBlock("svg",dse,fse)}function bl(n,e=0,t=1,r=0,i=0,o=0,s=0){const a=new Date(n,e,t,r,i,o,s);return n<100&&n>=0&&a.setFullYear(n),a}function ko(n){return n instanceof Date&&!isNaN(n.getTime())}function wl(n){return Array.isArray(n)&&n.length===2&&n.every(ko)&&n[0]<=n[1]}function pse(n){return Array.isArray(n)&&n.every(ko)}function e3(...n){if(n[0]!==void 0&&n[0]!==null){const t=new Date(n[0]);if(ko(t))return t}const e=n.slice(1);return e.length?e3(...e):new Date}function mse(n){const e=new Date(n);return e.setMonth(0,1),e.setHours(0,0,0,0),e}function aO(n){const e=new Date(n);return e.setDate(1),e.setHours(0,0,0,0),e}function Us(n){const e=new Date(n);return e.setHours(0,0,0,0),e}function gse({firstDayOfWeek:n,year:e,month:t}){const r=[],i=bl(e,t,0),o=i.getDate(),s=o-(i.getDay()+7-n)%7;for(let d=s;d<=o;d++)r.push(bl(e,t,d-o));i.setMonth(t+1,0);const a=i.getDate();for(let d=1;d<=a;d++)r.push(bl(e,t,d));const c=o-s+1,u=6*7-c-a;for(let d=1;d<=u;d++)r.push(bl(e,t,a+d));return r}function t3(n,e){const t=new Date(n),r=typeof e=="function"?e(t.getMonth()):Number(e),i=t.getFullYear(),o=bl(i,r+1,0).getDate(),s=t.getDate();return t.setMonth(r,Math.min(s,o)),t}function $c(n,e){const t=new Date(n),r=typeof e=="function"?e(t.getFullYear()):e;return t.setFullYear(r),t}function yse(n,e){const t=new Date(e),r=new Date(n),i=t.getFullYear()-r.getFullYear(),o=t.getMonth()-r.getMonth();return i*12+o}function n3(n,e){const t=new Date(n),r=new Date(e);return t.setHours(r.getHours(),r.getMinutes(),r.getSeconds()),t}function bse(n,{slots:e}){const t=Co(n,{editable:!0,disabled:!1,clearable:!0,range:!1,multiple:!1}),r=Mn(),i=l.ref(null),o=l.computed(()=>t.separator||(t.range?" ~ ":",")),s=p=>t.range?wl(p):t.multiple?pse(p):ko(p),a=p=>Array.isArray(p)?p.some(m=>t.disabledDate(m)):t.disabledDate(p),c=l.computed(()=>i.value!==null?i.value:typeof t.renderInputText=="function"?t.renderInputText(t.value):s(t.value)?Array.isArray(t.value)?t.value.map(p=>t.formatDate(p)).join(o.value):t.formatDate(t.value):""),u=p=>{var m;p&&p.stopPropagation(),t.onChange(t.range?[null,null]:null),(m=t.onClear)==null||m.call(t)},d=()=>{var p;if(!t.editable||i.value===null)return;const m=i.value.trim();if(i.value=null,m===""){u();return}let y;if(t.range){let b=m.split(o.value);b.length!==2&&(b=m.split(o.value.trim())),y=b.map(w=>t.parseDate(w.trim()))}else t.multiple?y=m.split(o.value).map(b=>t.parseDate(b.trim())):y=t.parseDate(m);s(y)&&!a(y)?t.onChange(y):(p=t.onInputError)==null||p.call(t,m)},f=p=>{i.value=typeof p=="string"?p:p.target.value},h=p=>{const{keyCode:m}=p;m===9?t.onBlur():m===13&&d()};return()=>{var p,m,y;const b=!t.disabled&&t.clearable&&c.value,w=Or(Vt({name:"date",type:"text",autocomplete:"off",value:c.value,class:t.inputClass||`${r}-input`,readonly:!t.editable,disabled:t.disabled,placeholder:t.placeholder},t.inputAttr),{onFocus:t.onFocus,onKeydown:h,onInput:f,onChange:d});return l.createVNode("div",{class:`${r}-input-wrapper`,onClick:t.onClick},[((p=e.input)==null?void 0:p.call(e,w))||l.createVNode("input",w,null),b?l.createVNode("i",{class:`${r}-icon-clear`,onClick:u},[((m=e["icon-clear"])==null?void 0:m.call(e))||l.createVNode(use,null,null)]):null,l.createVNode("i",{class:`${r}-icon-calendar`},[((y=e["icon-calendar"])==null?void 0:y.call(e))||l.createVNode(sO,null,null)])])}}const Tw=Hs()(["placeholder","editable","disabled","clearable","inputClass","inputAttr","range","multiple","separator","renderInputText","onInputError","onClear"]),wse=Hs()(["value","formatDate","parseDate","disabledDate","onChange","onFocus","onBlur","onClick",...Tw]);var vse=vo(bse,wse);function Cse(n,{slots:e}){var t;const r=Co(n,{prefixClass:"mx",valueType:"date",format:"YYYY-MM-DD",type:"date",disabledDate:()=>!1,disabledTime:()=>!1,confirmText:"OK"});Goe(r.prefixClass),Yoe(((t=r.formatter)==null?void 0:t.getWeek)||yw);const i=qoe(l.toRef(n,"lang")),o=l.ref(),s=()=>o.value,a=l.ref(!1),c=l.computed(()=>!r.disabled&&(typeof r.open=="boolean"?r.open:a.value)),u=()=>{var S,A;r.disabled||c.value||(a.value=!0,(S=r["onUpdate:open"])==null||S.call(r,!0),(A=r.onOpen)==null||A.call(r))},d=()=>{var S,A;c.value&&(a.value=!1,(S=r["onUpdate:open"])==null||S.call(r,!1),(A=r.onClose)==null||A.call(r))},f=(S,A)=>(A=A||r.format,zs(r.formatter)&&typeof r.formatter.stringify=="function"?r.formatter.stringify(S,A):ww(S,A,{locale:i.value.formatLocale})),h=(S,A)=>{if(A=A||r.format,zs(r.formatter)&&typeof r.formatter.parse=="function")return r.formatter.parse(S,A);const O=new Date;return joe(S,A,{locale:i.value.formatLocale,backupDate:O})},p=S=>{switch(r.valueType){case"date":return S instanceof Date?new Date(S.getTime()):new Date(NaN);case"timestamp":return typeof S=="number"?new Date(S):new Date(NaN);case"format":return typeof S=="string"?h(S):new Date(NaN);default:return typeof S=="string"?h(S,r.valueType):new Date(NaN)}},m=S=>{if(!ko(S))return null;switch(r.valueType){case"date":return S;case"timestamp":return S.getTime();case"format":return f(S);default:return f(S,r.valueType)}},y=l.computed(()=>{const S=r.value;return r.range?(Array.isArray(S)?S.slice(0,2):[null,null]).map(p):r.multiple?(Array.isArray(S)?S:[]).map(p):p(S)}),b=(S,A,O=!0)=>{var I,P;const D=Array.isArray(S)?S.map(m):m(S);return(I=r["onUpdate:value"])==null||I.call(r,D),(P=r.onChange)==null||P.call(r,D,A),O&&d(),D},w=l.ref(new Date);l.watchEffect(()=>{c.value&&(w.value=y.value)});const v=(S,A)=>{r.confirm?w.value=S:b(S,A,!r.multiple&&(A===r.type||A==="time"))},k=()=>{var S;const A=b(w.value);(S=r.onConfirm)==null||S.call(r,A)},C=S=>r.disabledDate(S)||r.disabledTime(S),T=S=>{var A;const{prefixClass:O}=r;return l.createVNode("div",{class:`${O}-datepicker-sidebar`},[(A=e.sidebar)==null?void 0:A.call(e,S),(r.shortcuts||[]).map((I,P)=>l.createVNode("button",{key:P,"data-index":P,type:"button",class:`${O}-btn ${O}-btn-text ${O}-btn-shortcut`,onClick:()=>{var D;const _=(D=I.onClick)==null?void 0:D.call(I);_&&b(_)}},[I.text]))])};return()=>{var S,A;const{prefixClass:O,disabled:I,confirm:P,range:D,popupClass:_,popupStyle:B,appendToBody:F}=r,R={value:w.value,"onUpdate:value":v,emit:b},N=e.header&&l.createVNode("div",{class:`${O}-datepicker-header`},[e.header(R)]),W=(e.footer||P)&&l.createVNode("div",{class:`${O}-datepicker-footer`},[(S=e.footer)==null?void 0:S.call(e,R),P&&l.createVNode("button",{type:"button",class:`${O}-btn ${O}-datepicker-btn-confirm`,onClick:k},[r.confirmText])]),V=(A=e.content)==null?void 0:A.call(e,R),Y=(e.sidebar||r.shortcuts)&&T(R);return l.createVNode("div",{ref:o,class:{[`${O}-datepicker`]:!0,[`${O}-datepicker-range`]:D,disabled:I}},[l.createVNode(vse,Or(Vt({},wo(r,Tw)),{value:y.value,formatDate:f,parseDate:h,disabledDate:C,onChange:b,onClick:u,onFocus:u,onBlur:d}),wo(e,["icon-calendar","icon-clear","input"])),l.createVNode(ose,{className:_,style:B,visible:c.value,appendToBody:F,getRelativeElement:s,onClickOutside:d},{default:()=>[Y,l.createVNode("div",{class:`${O}-datepicker-content`},[N,V,W])]})])}}const kse=[...Hs()(["value","valueType","type","format","formatter","lang","prefixClass","appendToBody","open","popupClass","popupStyle","confirm","confirmText","shortcuts","disabledDate","disabledTime","onOpen","onClose","onConfirm","onChange","onUpdate:open","onUpdate:value"]),...Tw];var lO=vo(Cse,kse);function r3(n){var e=n,{value:t}=e,r=Zoe(e,["value"]);const i=Mn();return l.createVNode("button",Or(Vt({},r),{type:"button",class:`${i}-btn ${i}-btn-text ${i}-btn-icon-${t}`}),[l.createVNode("i",{class:`${i}-icon-${t}`},null)])}function xw({type:n,calendar:e,onUpdateCalendar:t},{slots:r}){var i;const o=Mn(),s=()=>{t(t3(e,h=>h-1))},a=()=>{t(t3(e,h=>h+1))},c=()=>{t($c(e,h=>h-1))},u=()=>{t($c(e,h=>h+1))},d=()=>{t($c(e,h=>h-10))},f=()=>{t($c(e,h=>h+10))};return l.createVNode("div",{class:`${o}-calendar-header`},[l.createVNode(r3,{value:"double-left",onClick:n==="year"?d:c},null),n==="date"&&l.createVNode(r3,{value:"left",onClick:s},null),l.createVNode(r3,{value:"double-right",onClick:n==="year"?f:u},null),n==="date"&&l.createVNode(r3,{value:"right",onClick:a},null),l.createVNode("span",{class:`${o}-calendar-header-label`},[(i=r.default)==null?void 0:i.call(r)])])}function Sse({calendar:n,isWeekMode:e,showWeekNumber:t,titleFormat:r,getWeekActive:i,getCellClasses:o,onSelect:s,onUpdatePanel:a,onUpdateCalendar:c,onDateMouseEnter:u,onDateMouseLeave:d}){const f=Mn(),h=Qoe(),p=Ew().value,{yearFormat:m,monthBeforeYear:y,monthFormat:b="MMM",formatLocale:w}=p,v=w.firstDayOfWeek||0;let k=p.days||w.weekdaysMin;k=k.concat(k).slice(v,v+7);const C=n.getFullYear(),T=n.getMonth(),S=Sw(gse({firstDayOfWeek:v,year:C,month:T}),7),A=(R,N)=>ww(R,N,{locale:p.formatLocale}),O=R=>{a(R)},I=R=>{const N=R.getAttribute("data-index"),[W,V]=N.split(",").map(ue=>parseInt(ue,10)),Y=S[W][V];return new Date(Y)},P=R=>{s(I(R.currentTarget))},D=R=>{u&&u(I(R.currentTarget))},_=R=>{d&&d(I(R.currentTarget))},B=l.createVNode("button",{type:"button",class:`${f}-btn ${f}-btn-text ${f}-btn-current-year`,onClick:()=>O("year")},[A(n,m)]),F=l.createVNode("button",{type:"button",class:`${f}-btn ${f}-btn-text ${f}-btn-current-month`,onClick:()=>O("month")},[A(n,b)]);return t=typeof t=="boolean"?t:e,l.createVNode("div",{class:[`${f}-calendar ${f}-calendar-panel-date`,{[`${f}-calendar-week-mode`]:e}]},[l.createVNode(xw,{type:"date",calendar:n,onUpdateCalendar:c},{default:()=>[y?[F,B]:[B,F]]}),l.createVNode("div",{class:`${f}-calendar-content`},[l.createVNode("table",{class:`${f}-table ${f}-table-date`},[l.createVNode("thead",null,[l.createVNode("tr",null,[t&&l.createVNode("th",{class:`${f}-week-number-header`},null),k.map(R=>l.createVNode("th",{key:R},[R]))])]),l.createVNode("tbody",null,[S.map((R,N)=>l.createVNode("tr",{key:N,class:[`${f}-date-row`,{[`${f}-active-week`]:i(R)}]},[t&&l.createVNode("td",{class:`${f}-week-number`,"data-index":`${N},0`,onClick:P},[l.createVNode("div",null,[h(R[0])])]),R.map((W,V)=>l.createVNode("td",{key:V,class:["cell",o(W)],title:A(W,r),"data-index":`${N},${V}`,onClick:P,onMouseenter:D,onMouseleave:_},[l.createVNode("div",null,[W.getDate()])]))]))])])])])}function Mse({calendar:n,getCellClasses:e,onSelect:t,onUpdateCalendar:r,onUpdatePanel:i}){const o=Mn(),s=Ew().value,a=s.months||s.formatLocale.monthsShort,c=d=>bl(n.getFullYear(),d),u=d=>{const h=d.currentTarget.getAttribute("data-month");t(c(parseInt(h,10)))};return l.createVNode("div",{class:`${o}-calendar ${o}-calendar-panel-month`},[l.createVNode(xw,{type:"month",calendar:n,onUpdateCalendar:r},{default:()=>[l.createVNode("button",{type:"button",class:`${o}-btn ${o}-btn-text ${o}-btn-current-year`,onClick:()=>i("year")},[n.getFullYear()])]}),l.createVNode("div",{class:`${o}-calendar-content`},[l.createVNode("table",{class:`${o}-table ${o}-table-month`},[Sw(a,3).map((d,f)=>l.createVNode("tr",{key:f},[d.map((h,p)=>{const m=f*3+p;return l.createVNode("td",{key:p,class:["cell",e(c(m))],"data-month":m,onClick:u},[l.createVNode("div",null,[h])])})]))])])])}const Ese=n=>{const e=Math.floor(n.getFullYear()/10)*10,t=[];for(let r=0;r<10;r++)t.push(e+r);return Sw(t,2)};function Ase({calendar:n,getCellClasses:e=()=>[],getYearPanel:t=Ese,onSelect:r,onUpdateCalendar:i}){const o=Mn(),s=f=>bl(f,0),a=f=>{const p=f.currentTarget.getAttribute("data-year");r(s(parseInt(p,10)))},c=t(new Date(n)),u=c[0][0],d=eO(eO(c));return l.createVNode("div",{class:`${o}-calendar ${o}-calendar-panel-year`},[l.createVNode(xw,{type:"year",calendar:n,onUpdateCalendar:i},{default:()=>[l.createVNode("span",null,[u]),l.createVNode("span",{class:`${o}-calendar-decade-separator`},null),l.createVNode("span",null,[d])]}),l.createVNode("div",{class:`${o}-calendar-content`},[l.createVNode("table",{class:`${o}-table ${o}-table-year`},[c.map((f,h)=>l.createVNode("tr",{key:h},[f.map((p,m)=>l.createVNode("td",{key:m,class:["cell",e(s(p))],"data-year":p,onClick:a},[l.createVNode("div",null,[p])]))]))])])])}function Tse(n){const e=Co(n,{defaultValue:Us(new Date),type:"date",disabledDate:()=>!1,getClasses:()=>[],titleFormat:"YYYY-MM-DD"}),t=l.computed(()=>(Array.isArray(e.value)?e.value:[e.value]).filter(ko).map(v=>e.type==="year"?mse(v):e.type==="month"?aO(v):Us(v))),r=l.ref(new Date);l.watchEffect(()=>{let w=e.calendar;if(!ko(w)){const{length:v}=t.value;w=e3(v>0?t.value[v-1]:e.defaultValue)}r.value=aO(w)});const i=w=>{var v;r.value=w,(v=e.onCalendarChange)==null||v.call(e,w)},o=l.ref("date");l.watchEffect(()=>{const w=["date","month","year"],v=Math.max(w.indexOf(e.type),w.indexOf(e.defaultPanel));o.value=v!==-1?w[v]:"date"});const s=w=>{var v;const k=o.value;o.value=w,(v=e.onPanelChange)==null||v.call(e,w,k)},a=w=>e.disabledDate(new Date(w),t.value),c=(w,v)=>{var k,C,T;if(!a(w))if((k=e.onPick)==null||k.call(e,w),e.multiple===!0){const S=t.value.filter(A=>A.getTime()!==w.getTime());S.length===t.value.length&&S.push(w),(C=e["onUpdate:value"])==null||C.call(e,S,v)}else(T=e["onUpdate:value"])==null||T.call(e,w,v)},u=w=>{c(w,e.type==="week"?"week":"date")},d=w=>{if(e.type==="year")c(w,"year");else if(i(w),s("month"),e.partialUpdate&&t.value.length===1){const v=$c(t.value[0],w.getFullYear());c(v,"year")}},f=w=>{if(e.type==="month")c(w,"month");else if(i(w),s("date"),e.partialUpdate&&t.value.length===1){const v=t3($c(t.value[0],w.getFullYear()),w.getMonth());c(v,"month")}},h=(w,v=[])=>(a(w)?v.push("disabled"):t.value.some(k=>k.getTime()===w.getTime())&&v.push("active"),v.concat(e.getClasses(w,t.value,v.join(" ")))),p=w=>{const v=w.getMonth()!==r.value.getMonth(),k=[];return w.getTime()===new Date().setHours(0,0,0,0)&&k.push("today"),v&&k.push("not-current-month"),h(w,k)},m=w=>e.type!=="month"?r.value.getMonth()===w.getMonth()?"active":"":h(w),y=w=>e.type!=="year"?r.value.getFullYear()===w.getFullYear()?"active":"":h(w),b=w=>{if(e.type!=="week")return!1;const v=w[0].getTime(),k=w[6].getTime();return t.value.some(C=>{const T=C.getTime();return T>=v&&T<=k})};return()=>o.value==="year"?l.createVNode(Ase,{calendar:r.value,getCellClasses:y,getYearPanel:e.getYearPanel,onSelect:d,onUpdateCalendar:i},null):o.value==="month"?l.createVNode(Mse,{calendar:r.value,getCellClasses:m,onSelect:f,onUpdatePanel:s,onUpdateCalendar:i},null):l.createVNode(Sse,{isWeekMode:e.type==="week",showWeekNumber:e.showWeekNumber,titleFormat:e.titleFormat,calendar:r.value,getCellClasses:p,getWeekActive:b,onSelect:u,onUpdatePanel:s,onUpdateCalendar:i,onDateMouseEnter:e.onDateMouseEnter,onDateMouseLeave:e.onDateMouseLeave},null)}const i3=Hs()(["type","value","defaultValue","defaultPanel","disabledDate","getClasses","calendar","multiple","partialUpdate","showWeekNumber","titleFormat","getYearPanel","onDateMouseEnter","onDateMouseLeave","onCalendarChange","onPanelChange","onUpdate:value","onPick"]);var o3=vo(Tse,i3);const cO=(n,e)=>{const t=n.getTime();let[r,i]=e.map(o=>o.getTime());return r>i&&([r,i]=[i,r]),t>r&&t<i};function xse(n){const e=Co(n,{defaultValue:new Date,type:"date"}),t=Mn(),r=l.computed(()=>{let b=Array.isArray(e.defaultValue)?e.defaultValue:[e.defaultValue,e.defaultValue];return b=b.map(w=>Us(w)),wl(b)?b:[new Date,new Date].map(w=>Us(w))}),i=l.ref([new Date(NaN),new Date(NaN)]);l.watchEffect(()=>{wl(e.value)&&(i.value=e.value)});const o=(b,w)=>{var v;const[k,C]=i.value;ko(k)&&!ko(C)?(k.getTime()>b.getTime()?i.value=[b,k]:i.value=[k,b],(v=e["onUpdate:value"])==null||v.call(e,i.value,w)):i.value=[b,new Date(NaN)]},s=l.ref([new Date,new Date]),a=l.computed(()=>wl(e.calendar)?e.calendar:s.value),c=l.computed(()=>e.type==="year"?10*12:e.type==="month"?1*12:1),u=(b,w)=>{var v;const k=yse(b[0],b[1]),C=c.value-k;if(C>0){const T=w===1?0:1;b[T]=t3(b[T],S=>S+(T===0?-C:C))}s.value=b,(v=e.onCalendarChange)==null||v.call(e,b,w)},d=b=>{u([b,a.value[1]],0)},f=b=>{u([a.value[0],b],1)};l.watchEffect(()=>{const b=wl(e.value)?e.value:r.value;u(b.slice(0,2))});const h=l.ref(null),p=b=>h.value=b,m=()=>h.value=null,y=(b,w,v)=>{const k=e.getClasses?e.getClasses(b,w,v):[],C=Array.isArray(k)?k:[k];return/disabled|active/.test(v)?C:(w.length===2&&cO(b,w)&&C.push("in-range"),w.length===1&&h.value&&cO(b,[w[0],h.value])?C.concat("hover-in-range"):C)};return()=>{const b=a.value.map((w,v)=>{const k=Or(Vt({},e),{calendar:w,value:i.value,defaultValue:r.value[v],getClasses:y,partialUpdate:!1,multiple:!1,"onUpdate:value":o,onCalendarChange:v===0?d:f,onDateMouseLeave:m,onDateMouseEnter:p});return l.createVNode(o3,k,null)});return l.createVNode("div",{class:`${t}-calendar-range`},[b])}}const Iw=i3;var Ow=vo(xse,Iw);const uO=l.defineComponent({setup(n,{slots:e}){const t=Mn(),r=l.ref(),i=l.ref(""),o=l.ref(""),s=()=>{if(!r.value)return;const m=r.value,y=m.clientHeight*100/m.scrollHeight;i.value=y<100?`${y}%`:""};l.onMounted(s);const a=ese(),c=m=>{const y=m.currentTarget,{scrollHeight:b,scrollTop:w}=y;o.value=`${w*100/b}%`};let u=!1,d=0;const f=m=>{m.stopImmediatePropagation();const y=m.currentTarget,{offsetTop:b}=y;u=!0,d=m.clientY-b},h=m=>{if(!u||!r.value)return;const{clientY:y}=m,{scrollHeight:b,clientHeight:w}=r.value,k=(y-d)*b/w;r.value.scrollTop=k},p=()=>{u=!1};return l.onMounted(()=>{document.addEventListener("mousemove",h),document.addEventListener("mouseup",p)}),l.onUnmounted(()=>{document.addEventListener("mousemove",h),document.addEventListener("mouseup",p)}),()=>{var m;return l.createVNode("div",{class:`${t}-scrollbar`,style:{position:"relative",overflow:"hidden"}},[l.createVNode("div",{ref:r,class:`${t}-scrollbar-wrap`,style:{marginRight:`-${a}px`},onScroll:c},[(m=e.default)==null?void 0:m.call(e)]),l.createVNode("div",{class:`${t}-scrollbar-track`},[l.createVNode("div",{class:`${t}-scrollbar-thumb`,style:{height:i.value,top:o.value},onMousedown:f},null)])])}}});function Ise({options:n,getClasses:e,onSelect:t}){const r=Mn(),i=o=>{const s=o.target,a=o.currentTarget;if(s.tagName.toUpperCase()!=="LI")return;const c=a.getAttribute("data-type"),u=parseInt(a.getAttribute("data-index"),10),d=parseInt(s.getAttribute("data-index"),10),f=n[u].list[d].value;t(f,c)};return l.createVNode("div",{class:`${r}-time-columns`},[n.map((o,s)=>l.createVNode(uO,{key:o.type,class:`${r}-time-column`},{default:()=>[l.createVNode("ul",{class:`${r}-time-list`,"data-index":s,"data-type":o.type,onClick:i},[o.list.map((a,c)=>l.createVNode("li",{key:a.text,"data-index":c,class:[`${r}-time-item`,e(a.value,o.type)]},[a.text]))])]}))])}function Ose(n){return typeof n=="function"||Object.prototype.toString.call(n)==="[object Object]"&&!l.isVNode(n)}function Dse(n){let e;const t=Mn();return l.createVNode(uO,null,Ose(e=n.options.map(r=>l.createVNode("div",{key:r.text,class:[`${t}-time-option`,n.getClasses(r.value,"time")],onClick:()=>n.onSelect(r.value,"time")},[r.text])))?e:{default:()=>[e]})}function Dw({length:n,step:e=1,options:t}){if(Array.isArray(t))return t.filter(i=>i>=0&&i<n);e<=0&&(e=1);const r=[];for(let i=0;i<n;i+=e)r.push(i);return r}function Nse(n,e){let{showHour:t,showMinute:r,showSecond:i,use12h:o}=e;const s=e.format||"HH:mm:ss";t=typeof t=="boolean"?t:/[HhKk]/.test(s),r=typeof r=="boolean"?r:/m/.test(s),i=typeof i=="boolean"?i:/s/.test(s),o=typeof o=="boolean"?o:/a/i.test(s);const a=[],c=o&&n.getHours()>=12;return t&&a.push({type:"hour",list:Dw({length:o?12:24,step:e.hourStep,options:e.hourOptions}).map(u=>{const d=u===0&&o?"12":Mw(u),f=new Date(n);return f.setHours(c?u+12:u),{value:f,text:d}})}),r&&a.push({type:"minute",list:Dw({length:60,step:e.minuteStep,options:e.minuteOptions}).map(u=>{const d=new Date(n);return d.setMinutes(u),{value:d,text:Mw(u)}})}),i&&a.push({type:"second",list:Dw({length:60,step:e.secondStep,options:e.secondOptions}).map(u=>{const d=new Date(n);return d.setSeconds(u),{value:d,text:Mw(u)}})}),o&&a.push({type:"ampm",list:["AM","PM"].map((u,d)=>{const f=new Date(n);return f.setHours(f.getHours()%12+d*12),{text:u,value:f}})}),a}function Nw(n=""){const e=n.split(":");if(e.length>=2){const t=parseInt(e[0],10),r=parseInt(e[1],10);return{hours:t,minutes:r}}return null}function Pse({date:n,option:e,format:t,formatDate:r}){const i=[];if(typeof e=="function")return e()||[];const o=Nw(e.start),s=Nw(e.end),a=Nw(e.step),c=e.format||t;if(o&&s&&a){const u=o.minutes+o.hours*60,d=s.minutes+s.hours*60,f=a.minutes+a.hours*60,h=Math.floor((d-u)/f);for(let p=0;p<=h;p++){const m=u+p*f,y=Math.floor(m/60),b=m%60,w=new Date(n);w.setHours(y,b,0),i.push({value:w,text:r(w,c)})}}return i}const dO=(n,e,t=0)=>{if(t<=0){requestAnimationFrame(()=>{n.scrollTop=e});return}const i=(e-n.scrollTop)/t*10;requestAnimationFrame(()=>{const o=n.scrollTop+i;if(o>=e){n.scrollTop=e;return}n.scrollTop=o,dO(n,e,t-10)})};function _se(n){const e=Co(n,{defaultValue:Us(new Date),format:"HH:mm:ss",timeTitleFormat:"YYYY-MM-DD",disabledTime:()=>!1,scrollDuration:100}),t=Mn(),r=Ew(),i=(y,b)=>ww(y,b,{locale:r.value.formatLocale}),o=l.ref(new Date);l.watchEffect(()=>{o.value=e3(e.value,e.defaultValue)});const s=y=>Array.isArray(y)?y.every(b=>e.disabledTime(new Date(b))):e.disabledTime(new Date(y)),a=y=>{const b=new Date(y);return s([b.getTime(),b.setMinutes(0,0,0),b.setMinutes(59,59,999)])},c=y=>{const b=new Date(y);return s([b.getTime(),b.setSeconds(0,0),b.setSeconds(59,999)])},u=y=>{const b=new Date(y),w=b.getHours()<12?0:12,v=w+11;return s([b.getTime(),b.setHours(w,0,0,0),b.setHours(v,59,59,999)])},d=(y,b)=>b==="hour"?a(y):b==="minute"?c(y):b==="ampm"?u(y):s(y),f=(y,b)=>{var w;if(!d(y,b)){const v=new Date(y);o.value=v,s(v)||(w=e["onUpdate:value"])==null||w.call(e,v,b)}},h=(y,b)=>d(y,b)?"disabled":y.getTime()===o.value.getTime()?"active":"",p=l.ref(),m=y=>{if(!p.value)return;const b=p.value.querySelectorAll(".active");for(let w=0;w<b.length;w++){const v=b[w],k=Aw(v,p.value);if(k){const C=v.offsetTop;dO(k,C,y)}}};return l.onMounted(()=>m(0)),l.watch(o,()=>m(e.scrollDuration),{flush:"post"}),()=>{let y;return e.timePickerOptions?y=l.createVNode(Dse,{onSelect:f,getClasses:h,options:Pse({date:o.value,format:e.format,option:e.timePickerOptions,formatDate:i})},null):y=l.createVNode(Ise,{options:Nse(o.value,e),onSelect:f,getClasses:h},null),l.createVNode("div",{class:`${t}-time`,ref:p},[e.showTimeHeader&&l.createVNode("div",{class:`${t}-time-header`},[l.createVNode("button",{type:"button",class:`${t}-btn ${t}-btn-text ${t}-time-header-title`,onClick:e.onClickTitle},[i(o.value,e.timeTitleFormat)])]),l.createVNode("div",{class:`${t}-time-content`},[y])])}}const s3=Hs()(["value","defaultValue","format","timeTitleFormat","showTimeHeader","disabledTime","timePickerOptions","hourOptions","minuteOptions","secondOptions","hourStep","minuteStep","secondStep","showHour","showMinute","showSecond","use12h","scrollDuration","onClickTitle","onUpdate:value"]);var yf=vo(_se,s3);function Lse(n){const e=Co(n,{defaultValue:Us(new Date),disabledTime:()=>!1}),t=Mn(),r=l.ref([new Date(NaN),new Date(NaN)]);l.watchEffect(()=>{wl(e.value)?r.value=e.value:r.value=[new Date(NaN),new Date(NaN)]});const i=(u,d)=>{var f;(f=e["onUpdate:value"])==null||f.call(e,r.value,u==="time"?"time-range":u,d)},o=(u,d)=>{r.value[0]=u,r.value[1].getTime()>=u.getTime()||(r.value[1]=u),i(d,0)},s=(u,d)=>{r.value[1]=u,r.value[0].getTime()<=u.getTime()||(r.value[0]=u),i(d,1)},a=u=>e.disabledTime(u,0),c=u=>u.getTime()<r.value[0].getTime()||e.disabledTime(u,1);return()=>{const u=Array.isArray(e.defaultValue)?e.defaultValue:[e.defaultValue,e.defaultValue];return l.createVNode("div",{class:`${t}-time-range`},[l.createVNode(yf,Or(Vt({},e),{"onUpdate:value":o,value:r.value[0],defaultValue:u[0],disabledTime:a}),null),l.createVNode(yf,Or(Vt({},e),{"onUpdate:value":s,value:r.value[1],defaultValue:u[1],disabledTime:c}),null)])}}const Pw=s3;var _w=vo(Lse,Pw);function fO(n){const e=l.ref(!1),t=()=>{var o;e.value=!1,(o=n.onShowTimePanelChange)==null||o.call(n,!1)},r=()=>{var o;e.value=!0,(o=n.onShowTimePanelChange)==null||o.call(n,!0)};return{timeVisible:l.computed(()=>typeof n.showTimePanel=="boolean"?n.showTimePanel:e.value),openTimePanel:r,closeTimePanel:t}}function Bse(n){const e=Co(n,{disabledTime:()=>!1,defaultValue:Us(new Date)}),t=l.ref(e.value);l.watchEffect(()=>{t.value=e.value});const{openTimePanel:r,closeTimePanel:i,timeVisible:o}=fO(e),s=(a,c)=>{var u;c==="date"&&r();let d=n3(a,e3(e.value,e.defaultValue));if(e.disabledTime(new Date(d))&&(d=n3(a,e.defaultValue),e.disabledTime(new Date(d)))){t.value=d;return}(u=e["onUpdate:value"])==null||u.call(e,d,c)};return()=>{const a=Mn(),c=Or(Vt({},wo(e,i3)),{multiple:!1,type:"date",value:t.value,"onUpdate:value":s}),u=Or(Vt({},wo(e,s3)),{showTimeHeader:!0,value:t.value,"onUpdate:value":e["onUpdate:value"],onClickTitle:i});return l.createVNode("div",{class:`${a}-date-time`},[l.createVNode(o3,c,null),o.value&&l.createVNode(yf,u,null)])}}const hO=Hs()(["showTimePanel","onShowTimePanelChange"]),Rse=[...hO,...i3,...s3];var pO=vo(Bse,Rse);function $se(n){const e=Co(n,{defaultValue:Us(new Date),disabledTime:()=>!1}),t=l.ref(e.value);l.watchEffect(()=>{t.value=e.value});const{openTimePanel:r,closeTimePanel:i,timeVisible:o}=fO(e),s=(a,c)=>{var u;c==="date"&&r();const d=Array.isArray(e.defaultValue)?e.defaultValue:[e.defaultValue,e.defaultValue];let f=a.map((h,p)=>{const m=wl(e.value)?e.value[p]:d[p];return n3(h,m)});if(f[1].getTime()<f[0].getTime()&&(f=[f[0],f[0]]),f.some(e.disabledTime)&&(f=a.map((h,p)=>n3(h,d[p])),f.some(e.disabledTime))){t.value=f;return}(u=e["onUpdate:value"])==null||u.call(e,f,c)};return()=>{const a=Mn(),c=Or(Vt({},wo(e,Iw)),{type:"date",value:t.value,"onUpdate:value":s}),u=Or(Vt({},wo(e,Pw)),{showTimeHeader:!0,value:t.value,"onUpdate:value":e["onUpdate:value"],onClickTitle:i});return l.createVNode("div",{class:`${a}-date-time-range`},[l.createVNode(Ow,c,null),o.value&&l.createVNode(_w,u,null)])}}const Fse=[...hO,...Pw,...Iw];var mO=vo($se,Fse);const Vse=Hs()(["range","open","appendToBody","clearable","confirm","disabled","editable","multiple","partialUpdate","showHour","showMinute","showSecond","showTimeHeader","showTimePanel","showWeekNumber","use12h"]),gO={date:"YYYY-MM-DD",datetime:"YYYY-MM-DD HH:mm:ss",year:"YYYY",month:"YYYY-MM",time:"HH:mm:ss",week:"w"};function yO(n,{slots:e}){const t=n.type||"date",r=n.format||gO[t]||gO.date,i=Or(Vt({},nse(n,Vse)),{type:t,format:r});return l.createVNode(lO,wo(i,lO.props),Vt({content:o=>{if(i.range){const s=t==="time"?_w:t==="datetime"?mO:Ow;return l.h(s,wo(Vt(Vt({},i),o),s.props))}else{const s=t==="time"?yf:t==="datetime"?pO:o3;return l.h(s,wo(Vt(Vt({},i),o),s.props))}},"icon-calendar":()=>t==="time"?l.createVNode(hse,null,null):l.createVNode(sO,null,null)},e))}var Fc=Object.assign(yO,{locale:JI,install:n=>{n.component("DatePicker",yO)}},{Calendar:o3,CalendarRange:Ow,TimePanel:yf,TimeRange:_w,DateTime:pO,DateTimeRange:mO}),jse={months:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"],monthsShort:["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"],weekdays:["domingo","lunes","martes","miércoles","jueves","viernes","sábado"],weekdaysShort:["dom","lun","mar","mié","jue","vie","sáb"],weekdaysMin:["do","lu","ma","mi","ju","vi","sá"],firstDayOfWeek:1,firstWeekContainsDate:1};const zse={formatLocale:jse,yearFormat:"YYYY",monthFormat:"MMM",monthBeforeYear:!0};Fc.locale("es",zse);var Hse={months:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],monthsShort:["Jan","Feb","März","Apr","Mai","Juni","Juli","Aug","Sep","Okt","Nov","Dez"],weekdays:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],weekdaysShort:["So.","Mo.","Di.","Mi.","Do.","Fr.","Sa."],weekdaysMin:["So","Mo","Di","Mi","Do","Fr","Sa"],firstDayOfWeek:1,firstWeekContainsDate:4};const Use={formatLocale:Hse,yearFormat:"YYYY",monthFormat:"MMM",monthBeforeYear:!0};Fc.locale("de",Use);var Zse={months:["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre"],monthsShort:["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc."],weekdays:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],weekdaysShort:["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],weekdaysMin:["di","lu","ma","me","je","ve","sa"],firstDayOfWeek:1,firstWeekContainsDate:1};const Wse={formatLocale:Zse,yearFormat:"YYYY",monthFormat:"MMM",monthBeforeYear:!0};Fc.locale("fr",Wse);var Kse={months:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],monthsShort:["Jan","Fev","Mar","Abr","Mai","Jun","Jul","Ago","Set","Out","Nov","Dez"],weekdays:["Domingo","Segunda-feira","Terça-feira","Quarta-feira","Quinta-feira","Sexta-feira","Sábado"],weekdaysShort:["Dom","Seg","Ter","Qua","Qui","Sex","Sáb"],weekdaysMin:["Do","2ª","3ª","4ª","5ª","6ª","Sá"],firstDayOfWeek:1,firstWeekContainsDate:4};const qse={formatLocale:Kse,yearFormat:"YYYY",monthFormat:"MMM",monthBeforeYear:!0};Fc.locale("pt",qse);var Gse={months:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthsShort:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],weekdays:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],weekdaysShort:["周日","周一","周二","周三","周四","周五","周六"],weekdaysMin:["日","一","二","三","四","五","六"],firstDayOfWeek:1,firstWeekContainsDate:4,meridiemParse:/上午|下午/,meridiem:function(e){return e<12?"上午":"下午"},isPM:function(e){return e==="下午"}};const Yse={formatLocale:Gse,yearFormat:"YYYY年",monthFormat:"MMM",monthBeforeYear:!1};Fc.locale("zh-cn",Yse);const Qse=l.defineComponent({name:"QDatePicker",components:{DatePicker:Fc},props:{id:{type:String,default:""},modelValue:{type:[Date,String,Array],default:""},clearable:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},disabledDate:{type:Function,default:()=>{}},disabledBeforeToday:{type:Boolean,default:!1},disabledAfterToday:{type:Boolean,default:!1},format:{type:String,default:""},locale:{type:String,default:"en"},placeholder:{type:String,default:""},range:{type:Boolean,default:!1},size:{type:String,default:"lg"},type:{type:String,default:"date"}},emits:["update:modelValue"],setup(n){const e=l.ref("bottom"),t=l.ref(),r=l.ref(!1),i=l.ref(n.modelValue||""),o=l.computed(()=>n.disabledAfterToday?s:n.disabledBeforeToday?a:n.disabledDate),s=u=>u>new Date,a=u=>{const d=new Date;return d.setHours(0,0,0,0),u<d},c=()=>{const u=document.querySelector(".mx-datepicker-main");u&&(e.value=parseInt(u.style.top)<0?"top":"bottom")};return l.watch(r,async u=>{u?window.addEventListener("scroll",c):window.removeEventListener("scroll",c),await l.nextTick(),c()}),{calendarPosition:e,datePicker:t,isOpen:r,value:i,disabledDates:o,disableDatesAfterToday:s,disableDatesBeforeToday:a,getCalendarPosition:c}}}),Xse={class:"q-date-picker"};function Jse(n,e,t,r,i,o){const s=l.resolveComponent("q-icon"),a=l.resolveComponent("date-picker",!0);return l.openBlock(),l.createElementBlock("div",Xse,[l.createVNode(a,{id:n.id,value:n.value,"onUpdate:value":e[0]||(e[0]=c=>n.value=c),"append-to-body":!1,class:l.normalizeClass([`date-picker-${n.size}`,`date-picker-on-${n.calendarPosition}`,{open:n.isOpen}]),clearable:n.clearable,disabled:n.disabled,"disabled-date":n.disabledDates,format:n.format,lang:n.locale,placeholder:n.placeholder,range:n.range,type:n.type,ref:"datePicker",onChange:e[1]||(e[1]=c=>n.$emit("update:modelValue",c)),onClose:e[2]||(e[2]=c=>n.isOpen=!1),onOpen:e[3]||(e[3]=c=>n.isOpen=!0)},{"icon-clear":l.withCtx(()=>[l.createVNode(s,{icon:"close",type:"",color:"inkwell-0",size:"sm"})]),"icon-calendar":l.withCtx(()=>[l.createVNode(s,{icon:"calendar",color:"inkwell-0"})]),_:1},8,["id","value","class","clearable","disabled","disabled-date","format","lang","placeholder","range","type"])])}const eae=ye(Qse,[["render",Jse],["__scopeId","data-v-70cc2c82"]]),tae=l.defineComponent({name:"QDivider",props:{borderStyle:{type:String,default:"solid"},borderColor:{type:String,default:"gray-20"},textClass:{type:String,default:""}},emits:["update:modelValue"],setup(n,{slots:e}){return{hasSlotContent:l.computed(()=>!!e.default)}}}),nae={class:"divider relative flex items-center w-full"};function rae(n,e,t,r,i,o){return l.openBlock(),l.createElementBlock("div",nae,[l.createElementVNode("div",{class:l.normalizeClass(["flex-grow border-t",["border-"+n.borderStyle,"border-"+n.borderColor]])},null,2),n.hasSlotContent?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass(["flex-shrink flex items-center px-4 text-center",n.textClass])},[l.renderSlot(n.$slots,"default")],2)):l.createCommentVNode("",!0),l.createElementVNode("div",{class:l.normalizeClass(["flex-grow border-t",["border-"+n.borderStyle,"border-"+n.borderColor]])},null,2)])}const iae=ye(tae,[["render",rae]]),oae=l.defineComponent({name:"QIcon",props:{},setup(){}}),sae={class:"footer-actions"};function aae(n,e,t,r,i,o){return l.openBlock(),l.createElementBlock("div",sae,[l.renderSlot(n.$slots,"default",{},void 0,!0)])}const lae=ye(oae,[["render",aae],["__scopeId","data-v-ca1eb5be"]]),cae=l.defineComponent({name:"QFormGroup",props:{labelFor:{type:String,required:!0},required:{type:Boolean,default:!1},status:{type:String,default:""}},setup(){return{}}}),uae={class:"form-group"},dae=["for"],fae={class:"label-text"},hae={key:0,class:"required"};function pae(n,e,t,r,i,o){const s=l.resolveComponent("q-icon");return l.openBlock(),l.createElementBlock("div",uae,[l.createElementVNode("label",{for:n.labelFor},[l.createElementVNode("div",fae,[l.renderSlot(n.$slots,"label",{},void 0,!0)]),n.required?(l.openBlock(),l.createElementBlock("div",hae," *"+l.toDisplayString(n.$t("HC_REQUIRED")),1)):l.createCommentVNode("",!0)],8,dae),l.renderSlot(n.$slots,"default",{},void 0,!0),l.createElementVNode("div",{class:l.normalizeClass(["message",{"text-red-30":n.status==="error"},{"text-green-20":n.status==="success"}])},[n.status==="error"?(l.openBlock(),l.createBlock(s,{key:0,class:"message-icon",color:"red-30",icon:"exclamation-circle",type:"fill"})):l.createCommentVNode("",!0),l.renderSlot(n.$slots,"message",{},void 0,!0)],2)])}const mae=ye(cae,[["render",pae],["__scopeId","data-v-f2d32e20"]]),Lw=(n,e,t,r,i,o=[])=>{if(e||t&&t.length){let s=!0;n=n.filter(a=>{if(t&&t.length){const c=[];t.forEach(d=>{let f=d.selected;if(!f)return;const h=d.key;Array.isArray(f)||(f=[f]);let p=!1;f.forEach(m=>{const y=m&&m.key?m.key:h,b=m&&y;let w,v="",k=null;b&&(w=y.split(/\./),v=w[0],k=w[1]||null,!k&&(typeof m.value!="boolean"&&a[v]!==m.value||typeof m.value=="boolean"&&typeof a[v]!="boolean"&&!!a[v]!==m.value||typeof m.value=="boolean"&&typeof a[v]=="boolean"&&a[v]!==m.value)||k&&(typeof m.value!="boolean"&&a[v][k]!==m.value||typeof m.value=="boolean"&&typeof a[v][k]!="boolean"&&!!a[v][k]!==m.value||typeof m.value=="boolean"&&typeof a[v][k]=="boolean"&&a[v][k]!==m.value)||(p=!0))}),c.push(p)});const u=c.filter(d=>!!d).length;if(c.length>0&&u!==c.length)return!1}if(e){if(typeof a=="string")return String(a).toLocaleLowerCase().includes(e.toLocaleLowerCase());s=Object.keys(a).some(c=>o.includes(c)?!1:typeof a[c]=="object"&&a[c]?Object.keys(a[c]).some(u=>o.includes(u)?!1:String(a[c][u]).toLocaleLowerCase().includes(e.toLocaleLowerCase())):String(a[c]).toLocaleLowerCase().includes(e.toLocaleLowerCase()))}return s})}return r&&(n=n.sort((s,a)=>{if(s===null||s==="")return 1;if(a===null||a==="")return-1;if(r.includes(".")){const c=r.split(".")[0],u=r.split(".")[1];if(s[c]===null||s[c]==="")return 1;if(a[c]===null||a[c]==="")return-1;s=s[c][u],a=a[c][u]}else s=s[r],a=a[r];return typeof s=="string"&&typeof a=="string"&&(s=s.toLowerCase(),a=a.toLowerCase()),typeof s!="string"&&typeof a!="string"&&(s=parseInt(s),a=parseInt(a)),(s===a?0:s>a?1:-1)*i})),n},gae=l.defineComponent({name:"QGrid",components:{QBadge:Da},props:{id:{type:String,default:""},columns:{type:Number,default:4},exclude:{type:Array,default:()=>[]},filters:{type:Array,default:()=>[]},filtersAction:{type:Function,default:()=>{}},filtersCount:{type:Number,default:0},gridData:{type:Array,default:()=>[]},hasSearch:{type:Boolean,default:!0},loading:{type:Boolean,default:!1},noResultMessage:{type:String,default:""},searchPlaceholder:{type:String,default:""},skeletonRows:{type:Number,default:6},statusClasses:{type:Object}},emits:["select-grid-item","filters-updated"],setup(n,{emit:e}){const{t}=us(),r=l.ref(""),i=l.computed(()=>{const f=n.filters,h=Lw(n.gridData,r.value,f,void 0,void 0,n.exclude);return e("filters-updated",h),h}),o=l.computed(()=>n.columns?`q-grid-cols-${n.columns}`:""),s=l.computed(()=>i.value.length%n.columns===0),a=l.computed(()=>n.noResultMessage||t("HC_NO_RESULTS_FOUND")),c=l.computed(()=>{const f=[],h={};return[...Array(n.skeletonRows*n.columns)].forEach(()=>{f.push(h)}),f});return{searchBy:r,filteredGridData:i,gridColumnCount:o,lastRowWillBeFilled:s,noResultsText:a,skeletonData:c,getCellClasses:f=>{const h=i.value.length?i.value:c.value,p=Math.ceil(h.length/n.columns),m=Math.floor(f/n.columns),y=m===0,b=m===p-1,w=f===h.length-1,v=m===p-2,k=f+n.columns>=h.length;return{"!border-t-[0.09375rem]":y,"!border-b-[0.09375rem]":b||k&&v,"!border-l-[0.09375rem]":f%n.columns===0,"!border-r-[0.09375rem]":f%n.columns===n.columns-1||w,"!rounded-tl-md":y&&f%n.columns===0,"!rounded-tr-md":y&&(f%n.columns===n.columns-1||w),"!rounded-bl-md":b&&f%n.columns===0,"!rounded-br-md":w||v&&h.length%n.columns!==0&&f%n.columns===n.columns-1}},selectGridItem:f=>{i.value.find(h=>{h.active&&(h.active=!1)}),f.active=!0,e("select-grid-item",f)},mq:_n}}}),yae=["id"],bae={key:0,class:"grid-filters"},wae={class:"grid-search"},vae={for:"grid-search",class:"search-label"},Cae={key:0,class:"grid-filter-actions"},kae={class:"relative flex"},Sae={class:"grid-wrapper"},Mae=["onClick"],Eae={key:1,class:"no-grid-result"};function Aae(n,e,t,r,i,o){const s=l.resolveComponent("q-icon"),a=l.resolveComponent("q-input"),c=l.resolveComponent("q-badge");return l.openBlock(),l.createElementBlock("div",{id:n.id,class:l.normalizeClass(["grid-container h-full w-full",{"is-loading":n.loading}])},[n.hasSearch?l.renderSlot(n.$slots,"search-and-filters",{key:0},()=>[l.createElementVNode("div",{class:l.normalizeClass(["search-and-filters !pr-0",{"bg-gray-30 animate-shimmer":n.loading}])},[n.loading?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock("div",bae,[l.createElementVNode("div",wae,[n.hasSearch?l.renderSlot(n.$slots,"grid-search",{key:0},()=>[l.createElementVNode("label",vae,[l.createVNode(a,{id:"grid-search",modelValue:n.searchBy,"onUpdate:modelValue":e[0]||(e[0]=u=>n.searchBy=u),"hide-clear":!!n.mq.md,placeholder:n.searchPlaceholder||n.$t("HC_SEARCH"),class:"text-base placeholder-inkwell-0","control-class":"!border-0","icon-position":"left"},{default:l.withCtx(()=>[l.createVNode(s,{color:"inkwell-0",icon:"search",size:"md",type:"",class:"cursor-default"})]),_:1},8,["modelValue","hide-clear","placeholder"])])],!0):l.createCommentVNode("",!0)]),Object.keys(n.filters).length?(l.openBlock(),l.createElementBlock("div",Cae,[l.renderSlot(n.$slots,"filters",{},()=>[l.createElementVNode("div",kae,[l.createVNode(s,{class:"filters-icon",color:"inkwell-0",icon:"filter",size:"md",onClick:n.filtersAction},null,8,["onClick"]),n.filtersCount?(l.openBlock(),l.createBlock(c,{key:0,class:"filters-count",color:n.mq.md?"white":"gray-0"},{text:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(n.filtersCount),1)]),_:1},8,["color"])):l.createCommentVNode("",!0)])],!0)])):l.createCommentVNode("",!0)]))],2)],!0):l.createCommentVNode("",!0),l.createElementVNode("div",Sae,[n.filteredGridData.length||n.loading?(l.openBlock(),l.createElementBlock("ul",{key:0,class:l.normalizeClass(["grid mb-4 md:mb-0",n.gridColumnCount])},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(n.loading?n.skeletonData:n.filteredGridData,(u,d)=>(l.openBlock(),l.createElementBlock("li",{key:u.id,class:l.normalizeClass(["cursor-pointer truncate","cell",n.statusClasses&&n.statusClasses[u.status],u.active==!0?"active":"",n.mq.md&&n.getCellClasses(d),{"bg-gray-10 animate-shimmer":n.loading}]),onClick:l.withModifiers(f=>n.selectGridItem(u),["prevent"])},l.toDisplayString(u.name),11,Mae))),128))],2)):(l.openBlock(),l.createElementBlock("p",Eae,l.toDisplayString(n.noResultsText),1))])],10,yae)}const Tae=ye(gae,[["render",Aae],["__scopeId","data-v-cfe195f6"]]),xae=l.defineComponent({name:"QIconActionGroup",components:{QButton:Y9,QIcon:z0},props:{modelValue:{type:String,default:null},isActionable:{type:Boolean,default:!0},isChecklist:{type:Boolean,default:!1},options:{type:Array,default:()=>[]},showStatus:{type:Boolean,default:!1},toggle:{type:Boolean,default:!0}},emits:["update:modelValue"],setup(n,{emit:e}){const t=l.ref(null),r=l.computed(()=>n.isChecklist?n.options.filter(o=>o.state==="pass"):n.options);return{selectedOption:t,filteredOptions:r,onButtonClick:o=>{t.value=o;const a=o.state===n.modelValue&&n.toggle?"default":o.state;e("update:modelValue",a)},mq:_n}}}),Iae=["value"],Oae={key:1},Dae={class:"flex justify-center actions absolute z-0 right-0 inset-y-0 cursor-pointer"},Nae={class:"flex items-center justify-center"};function Pae(n,e,t,r,i,o){const s=l.resolveComponent("q-icon"),a=l.resolveComponent("q-button");return n.mq.lg?(l.openBlock(),l.createElementBlock("div",{key:0,value:n.modelValue,class:l.normalizeClass(["flex text-right gap-4 justify-end mr-4 py-4",n.isActionable?"":"pointer-events-none"])},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(n.filteredOptions,c=>(l.openBlock(),l.createElementBlock("div",{key:c.state},[l.createVNode(a,l.mergeProps({class:[c.state===n.modelValue?c.activeClass:c.idleClass,c.btnClasses],loading:c.loading,"is-fab":"",size:"sm"},{[l.toHandlerKey(n.isActionable&&!c.loading&&"click")]:u=>n.onButtonClick(c)}),{default:l.withCtx(()=>[l.createVNode(s,{icon:c.icon,class:l.normalizeClass(c.iconClasses||"!p-[0.3rem]"),type:c.iconType||"line",size:"sm",color:"white"},null,8,["icon","class","type"])]),_:2},1040,["class","loading"])]))),128))],10,Iae)):(l.openBlock(),l.createElementBlock("div",Oae,[l.createVNode(l.Transition,{name:"fade"},{default:l.withCtx(()=>[n.selectedOption&&n.showStatus?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass(["status w-2 h-full absolute right-0 inset-y-0 z-20",n.selectedOption.activeClass])},null,2)):l.createCommentVNode("",!0)]),_:1}),l.createElementVNode("div",Dae,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(n.filteredOptions,c=>(l.openBlock(),l.createElementBlock("div",l.mergeProps({key:c.state,class:`flex items-center justify-center w-14 h-full ${c.activeClass}`},{[l.toHandlerKey(n.isActionable&&!c.loading&&"click")]:u=>n.onButtonClick(c)}),[l.createVNode(s,{icon:c.icon,type:c.iconType||"line",size:"lg",color:"white"},null,8,["icon","type"])],16))),128))]),l.createVNode(l.Transition,{name:"fade"},{default:l.withCtx(()=>{var c,u,d,f;return[(c=n.selectedOption)!=null&&c.loading?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass(["absolute flex items-center justify-center inset-0 text-white z-10",(u=n.selectedOption)==null?void 0:u.activeClass])},[l.createElementVNode("div",Nae,[l.createVNode(s,{icon:(d=n.selectedOption)==null?void 0:d.icon,type:((f=n.selectedOption)==null?void 0:f.iconType)||"line",size:"lg",color:"white"},null,8,["icon","type"])])],2)):l.createCommentVNode("",!0)]}),_:1})]))}const _ae=ye(xae,[["render",Pae],["__scopeId","data-v-80f2446a"]]),bO="eye",wO="eye-slash",Lae=l.defineComponent({name:"QInput",inheritAttrs:!1,props:{modelValue:{type:[Number,Object,String],default:""},type:{type:String,default:"text",validator:n=>["email","number","password","phone","search","text"].includes(n)},placeholder:{type:String,default:""},maxlength:{type:Number,default:null},size:{type:String,default:"md"},status:{type:String,default:""},controlClass:{type:String,default:""},inputClass:{type:String,default:""},disabled:{type:Boolean,default:!1},autocomplete:{type:String,default:"off"},hideClear:{type:Boolean,default:!1},iconPosition:{type:String,default:"right"}},emits:["update:model-value","update-type"],setup(n,{emit:e}){const t=l.useSlots(),r=l.ref(null),i=l.ref(!1),o=l.ref(n.type==="password"?bO:""),s=l.computed(()=>!!n.disabled),a=l.computed(()=>{const m=o.value;return!!n.modelValue&&!s.value&&(d.value&&n.iconPosition==="left"||!m)}),c=l.computed(()=>["control flex items-center",{focused:!!i.value},{disabled:s.value},{[`has-icon-${n.iconPosition}`]:!!n.iconPosition},n.controlClass,{["size-"+n.size]:n.size}]),u=l.computed(()=>["input",{[n.status]:n.status&&!s.value},{[n.inputClass]:!!n.inputClass},{populated:!!n.modelValue}]),d=l.computed(()=>!!(t!=null&&t.default)),f=()=>{const m=n.type==="password",y=n.type==="text"&&o.value===wO;(m||y)&&h()},h=()=>{const m=n.type==="text"?"password":"text";o.value=m==="text"?wO:bO,e("update-type",m)};return{currentInput:r,focused:i,icon:o,rootClasses:c,inputClasses:u,isDisabled:s,showClearIcon:a,isSlotAvailable:d,onClickIcon:f,togglePasswordVisibility:h,updateValue:m=>{e("update:model-value",m.target.value)},mq:_n}}}),Bae=["id","type","disabled","autocomplete","maxlength","value","placeholder"];function Rae(n,e,t,r,i,o){const s=l.resolveComponent("q-icon");return l.openBlock(),l.createElementBlock("div",{ref:"currentInput",class:l.normalizeClass(n.rootClasses)},[l.createElementVNode("input",l.mergeProps({id:String(n.$attrs.id),ref:String(n.$attrs.id),type:n.type,disabled:n.isDisabled,class:n.inputClasses,autocomplete:n.autocomplete,maxlength:n.maxlength,value:n.modelValue,placeholder:n.placeholder},n.$attrs,{onInput:e[0]||(e[0]=a=>n.updateValue(a)),onFocusin:e[1]||(e[1]=a=>n.focused=!n.focused),onFocusout:e[2]||(e[2]=a=>n.focused=!n.focused),onBlur:e[3]||(e[3]=a=>n.focused=!0)}),null,16,Bae),n.isSlotAvailable||n.icon?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass(["flex",{"order-first pr-2":n.iconPosition==="left"}])},[l.renderSlot(n.$slots,"default",l.normalizeProps(l.guardReactiveProps({icon:n.icon,onClickIcon:n.onClickIcon})),()=>[l.createVNode(s,{icon:n.icon,size:"md",class:"cursor-pointer",onClick:n.onClickIcon},null,8,["icon","onClick"])],!0)],2)):l.createCommentVNode("",!0),n.showClearIcon&&!n.hideClear?(l.openBlock(),l.createElementBlock("div",{key:1,class:"close cursor-pointer flex order-3",onClick:e[4]||(e[4]=a=>n.$emit("update:model-value","")),onMousedown:e[5]||(e[5]=l.withModifiers(()=>{},["prevent"]))},[n.mq.md?(l.openBlock(),l.createBlock(s,{key:0,icon:"close",size:"sm",type:"line"})):(l.openBlock(),l.createBlock(s,{key:1,icon:"delete-circle",color:"inkwell-0",size:"md",type:"fill"}))],32)):l.createCommentVNode("",!0)],2)}const $ae=ye(Lae,[["render",Rae],["__scopeId","data-v-320db1d7"]]),Fae=l.defineComponent({name:"QList",components:{QBadge:Da},props:{id:{type:String,default:""},data:{type:Array,default:()=>[]},hideSearch:{type:Boolean,default:!1},exclude:{type:Array,default:()=>[]},filters:{type:Array,default:()=>[]},filtersCount:{type:Number,default:0},hasSearch:{type:Boolean,default:!0},loading:{type:Boolean,default:!1},noResultMessage:{type:String,default:""},searchText:{type:String,default:""},searchPlaceholder:{type:String,default:""},skeletonRows:{type:Number,default:6},type:{type:String,default:"row"}},emits:["filters-action","filters-updated","click:list-item"],setup(n,{emit:e}){const{y:t}=sL(),{y:r}=rL(window,{behavior:"smooth"}),i=l.ref(0),o=l.ref("down"),s=l.ref(0),a=l.ref(!1),c=l.ref(!0),u=l.ref(_n.md?!1:n.hideSearch),d=l.ref(!u.value),f={type:"keyframe",ease:"linear",duration:0,delay:0},h=l.ref(null),p=l.ref(null),m=l.ref(""),{motionProperties:y}=fb(h),{push:b}=lb(),w=l.computed(()=>{const I=Lw(n.data,v.value,n.filters,void 0,void 0,n.exclude);return e("filters-updated",I),I}),v=l.computed(()=>n.searchText||m.value),k=l.computed(()=>t.value<=0?70:t.value>70?0:70-t.value),C=I=>{!I.dragging&&t.value<=24&&t.value>=0&&(r.value=0),!I.dragging&&t.value>24&&t.value<70&&(r.value=70),!(t.value>0)&&(a.value?S(I):T(I))};u.value&&x8(C,{domTarget:h,filterTaps:!0,useTouch:!0,delay:100});const T=I=>{I.tap||I.axis==="x"||(a.value=!0)},S=I=>{if(I.tap||I.axis==="x")return;const P=I.direction[1],D=P>=0,_=P<=0&&t.value<=0;!d.value&&(D||_)&&A(!_,"drag"),a.value=!1},A=async(I,P)=>{if(d.value=I,await l.nextTick(),c.value&&o.value==="up"&&t.value<=0||P==="drag"){const D=k.value?k.value:0;b("y",D,y,f),c.value=!1}},O=()=>{const I=Math.max(0,t.value)>i.value?"down":"up";I!==o.value&&(o.value=I),t.value<70&&A(!0,"scroll"),i.value=Math.max(0,t.value)};return l.onMounted(()=>{u.value&&(s.value=h.value.offsetTop-16,window.addEventListener("scroll",O))}),l.onUnmounted(()=>{u.value&&window.removeEventListener("scroll",O)}),{defaultSearchTop:s,isDragging:a,isSearchVisible:d,hiddenSearch:u,listRef:h,prevScrollY:i,scrollY:t,scrollToY:r,searchRef:p,searchValue:m,direction:o,filteredData:w,searchBy:v,searchHeight:k,onScroll:O,toggleSearch:A,mq:_n}}}),a3=n=>(l.pushScopeId("data-v-7f414e39"),n=n(),l.popScopeId(),n),Vae=["id"],jae={key:0},zae={key:0,class:"list-filters"},Hae={class:"relative flex"},Uae={key:1,class:"search-and-filters loading-state"},Zae=[a3(()=>l.createElementVNode("div",{class:"loading-search animate-shimmer bg-gray-10"},null,-1)),a3(()=>l.createElementVNode("div",{class:"loading-filters animate-shimmer bg-gray-30"},null,-1))],Wae={ref:"listRef",class:"outer-list-wrapper select-none"},Kae={key:0},qae={key:0,class:"list-wrapper"},Gae=["onClick"],Yae={key:1,class:"list ordered-list"},Qae=["onClick"],Xae={key:1,class:"no-results"},Jae={key:1,class:"list-wrapper"},ele={class:"list loading-list"},tle=[a3(()=>l.createElementVNode("div",{class:"animate-shimmer bg-gray-30 loading-top mb-3"},null,-1)),a3(()=>l.createElementVNode("div",{class:"animate-shimmer bg-gray-10 loading-bottom"},null,-1))];function nle(n,e,t,r,i,o){const s=l.resolveComponent("q-icon"),a=l.resolveComponent("q-input"),c=l.resolveComponent("q-badge");return l.openBlock(),l.createElementBlock("div",{id:n.id,class:"q-list"},[n.hasSearch||n.filters.length?l.renderSlot(n.$slots,"search-and-filters",{key:0},()=>[l.createElementVNode("div",{ref:"searchRef",class:l.normalizeClass(["search-and-filter-wrapper",{"fixed right-0 left-0 top-0 pt-4 pl-4 pr-4 z-10 bg-white overflow-hidden":n.hiddenSearch},{"is-shown border-b border-gray-20":n.hiddenSearch&&n.isSearchVisible},{"!hidden h-px":n.hiddenSearch&&n.searchHeight<=16}]),style:l.normalizeStyle([n.hiddenSearch&&n.searchHeight>=0?`height: ${n.searchHeight}px;`:"",`top: ${n.defaultSearchTop}px;`])},[n.loading?(l.openBlock(),l.createElementBlock("div",Uae,Zae)):(l.openBlock(),l.createElementBlock("div",jae,[l.createElementVNode("div",{class:"search-and-filters",style:l.normalizeStyle(n.hiddenSearch&&n.searchHeight>=0?`height: ${n.searchHeight-32}px;`:"")},[l.createElementVNode("div",{class:"list-search",style:l.normalizeStyle(n.hiddenSearch&&n.searchHeight-32<38?"opacity: "+(n.searchHeight-56)/14+";":n.hiddenSearch&&n.searchHeight-32<24?"opacity; 0;":"")},[n.hasSearch?l.renderSlot(n.$slots,"list-search",{key:0},()=>[l.createElementVNode("label",{for:"list-search",class:l.normalizeClass(["search-label",{"!hidden":n.hiddenSearch&&n.searchHeight-32<=0}])},[l.createVNode(a,{id:"list-search",modelValue:n.searchValue,"onUpdate:modelValue":e[0]||(e[0]=u=>n.searchValue=u),"hide-clear":!!n.mq.md,placeholder:n.searchPlaceholder||n.$t("HC_SEARCH"),class:"text-base placeholder-inkwell-0","control-class":"!border-0 !pl-2 !pr-1.5 md:!px-3","icon-position":"left",size:"xs"},{default:l.withCtx(()=>[l.createVNode(s,{color:"inkwell-0",icon:"search",size:"md",type:"",class:"cursor-default"})]),_:1},8,["modelValue","hide-clear","placeholder"])],2)],!0):l.createCommentVNode("",!0)],4),n.filters.length&&n.type==="row"?(l.openBlock(),l.createElementBlock("div",zae,[l.renderSlot(n.$slots,"list-filters",{},()=>[l.createElementVNode("div",Hae,[l.createVNode(s,{class:"filters-icon",color:"inkwell-0",icon:"filter",size:"md",onClick:e[1]||(e[1]=u=>n.$emit("filters-action"))}),n.filtersCount?(l.openBlock(),l.createBlock(c,{key:0,class:"filters-count",color:"gray-0"},{text:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(n.filtersCount),1)]),_:1})):l.createCommentVNode("",!0)])],!0)])):l.createCommentVNode("",!0)],4)])),l.renderSlot(n.$slots,"search-separator",{},()=>[l.createElementVNode("hr",{class:l.normalizeClass(["search-separator",{"!mb-0 hidden":n.hiddenSearch}])},null,2)],!0)],6)],!0):l.createCommentVNode("",!0),l.createElementVNode("div",Wae,[n.loading?(l.openBlock(),l.createElementBlock("div",Jae,[l.createElementVNode("ul",ele,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(n.skeletonRows,u=>(l.openBlock(),l.createElementBlock("li",{key:u,class:"list-item"},tle))),128))])])):(l.openBlock(),l.createElementBlock("div",Kae,[n.filteredData.length?(l.openBlock(),l.createElementBlock("div",qae,[n.type!=="ordered"?(l.openBlock(),l.createElementBlock("ul",{key:0,class:l.normalizeClass(["list",`${n.type}-list`])},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(n.filteredData,(u,d)=>(l.openBlock(),l.createElementBlock("li",{key:d,class:"list-item",onClick:f=>n.$emit("click:list-item",u)},[l.renderSlot(n.$slots,"list-item",l.normalizeProps(l.guardReactiveProps({item:u})),()=>[l.createTextVNode(l.toDisplayString(u),1)],!0)],8,Gae))),128))],2)):(l.openBlock(),l.createElementBlock("ol",Yae,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(n.filteredData,(u,d)=>(l.openBlock(),l.createElementBlock("li",{key:d,class:"list-item",onClick:f=>n.$emit("click:list-item",u)},[l.renderSlot(n.$slots,"list-item",l.normalizeProps(l.guardReactiveProps({item:u})),()=>[l.createTextVNode(l.toDisplayString(u),1)],!0)],8,Qae))),128))]))])):(l.openBlock(),l.createElementBlock("div",Xae,[l.renderSlot(n.$slots,"no-results",{},()=>[l.createElementVNode("p",null,l.toDisplayString(n.noResultMessage||n.$t("HC_NO_RESULTS_FOUND")),1)],!0)]))]))],512)],8,Vae)}const rle=ye(Fae,[["render",nle],["__scopeId","data-v-7f414e39"]]),ile=l.defineComponent({name:"QModalContent",props:{useFlex:{type:Boolean,default:!1},contentClass:{type:String,default:""},footerClass:{type:String,default:""}},setup(n,{slots:e}){const t=l.inject("size"),r=l.computed(()=>!!e.header),i=l.computed(()=>!!e.footer);return{modalSize:t,hasHeader:r,hasFooter:i}}}),ole={key:0,class:"modal-title mb-2"},sle={class:"text-lg pb-4 font-bold leading-6"};function ale(n,e,t,r,i,o){return l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["modal-content",n.useFlex?"flex flex-col min-h-full":"","modal-"+n.modalSize])},[n.hasHeader?(l.openBlock(),l.createElementBlock("div",ole,[l.createElementVNode("h2",sle,[l.renderSlot(n.$slots,"header",{},void 0,!0)])])):l.createCommentVNode("",!0),l.createElementVNode("div",{class:l.normalizeClass(["modal-body",n.useFlex?"flex-grow":"",n.contentClass])},[l.renderSlot(n.$slots,"body",{},void 0,!0)],2),n.hasFooter?(l.openBlock(),l.createElementBlock("div",{key:1,class:l.normalizeClass(["modal-actions",n.footerClass])},[l.renderSlot(n.$slots,"footer",{},void 0,!0)],2)):l.createCommentVNode("",!0)],2)}const lle=ye(ile,[["render",ale],["__scopeId","data-v-01edcc7b"]]),cle=l.defineComponent({name:"QPageHeading",props:{backgroundColor:{type:String,default:"green-20"},color:{type:String,default:"white"},fixedTopOffset:{type:Number,default:0}},setup(n){const e=l.ref(!1),t=l.ref(),r=l.ref(),i=()=>{if(r.value){const o=r.value.offsetTop-n.fixedTopOffset;e.value=!!n.fixedTopOffset&&r.value&&window.scrollY>=o,t.value.style.top=e.value?`${n.fixedTopOffset}px`:"",t.value.style.width=e.value?`${r.value.clientWidth}px`:""}};return l.onMounted(()=>{window.addEventListener("resize",i),window.addEventListener("scroll",i)}),{isFixed:e,pageHeading:t,pageHeadingContainer:r,determineFixed:i}}}),ule={class:"flex-grow mb-0"};function dle(n,e,t,r,i,o){return l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["page-heading-container",{"pt-[3.5rem]":n.isFixed}]),ref:"pageHeadingContainer"},[l.createElementVNode("div",{class:l.normalizeClass(["page-heading flex items-center text-left",`background-${n.backgroundColor}`,`text-${n.color}`,{fixed:n.isFixed}]),ref:"pageHeading"},[l.createElementVNode("h1",ule,[l.renderSlot(n.$slots,"default",{},void 0,!0)]),l.renderSlot(n.$slots,"actions",{},void 0,!0)],2)],2)}const fle=ye(cle,[["render",dle],["__scopeId","data-v-99e0d86b"]]),hle=l.defineComponent({name:"QPageNavigation",props:{fixedTopOffset:{type:Number,default:0}},setup(){return{}}}),ple={class:"navigation-links"};function mle(n,e,t,r,i,o){return l.openBlock(),l.createElementBlock("div",{id:"page-navigation",style:l.normalizeStyle(`top: ${n.fixedTopOffset}px;`)},[l.createElementVNode("div",ple,[l.renderSlot(n.$slots,"default",{},void 0,!0)])],4)}const gle=ye(hle,[["render",mle],["__scopeId","data-v-bddbe9bd"]]);function Bw(n){return n===0?!1:Array.isArray(n)&&n.length===0?!0:!n}function yle(n){return(...e)=>!n(...e)}function ble(n,e){return n===void 0&&(n="undefined"),n===null&&(n="null"),n===!1&&(n="false"),n.toString().toLowerCase().indexOf(e.trim())!==-1}function vO(n,e,t,r){return e?n.filter(i=>ble(r(i,t),e)).sort((i,o)=>r(i,t).length-r(o,t).length):n}function wle(n){return n.filter(e=>!e.$isLabel)}function Rw(n,e){return t=>t.reduce((r,i)=>i[n]&&i[n].length?(r.push({$groupLabel:i[e],$isLabel:!0}),r.concat(i[n])):r,[])}function vle(n,e,t,r,i){return o=>o.map(s=>{if(!s[t])return console.warn("Options passed to vue-multiselect do not contain groups, despite the config."),[];const a=vO(s[t],n,e,i);return a.length?{[r]:s[r],[t]:a}:[]})}const CO=(...n)=>e=>n.reduce((t,r)=>r(t),e);var Cle={data(){return{search:"",isOpen:!1,preferredOpenDirection:"below",optimizedHeight:this.maxHeight}},props:{internalSearch:{type:Boolean,default:!0},options:{type:Array,required:!0},multiple:{type:Boolean,default:!1},trackBy:{type:String},label:{type:String},searchable:{type:Boolean,default:!0},clearOnSelect:{type:Boolean,default:!0},hideSelected:{type:Boolean,default:!1},placeholder:{type:String,default:"Select option"},allowEmpty:{type:Boolean,default:!0},resetAfter:{type:Boolean,default:!1},closeOnSelect:{type:Boolean,default:!0},customLabel:{type:Function,default(n,e){return Bw(n)?"":e?n[e]:n}},taggable:{type:Boolean,default:!1},tagPlaceholder:{type:String,default:"Press enter to create a tag"},tagPosition:{type:String,default:"top"},max:{type:[Number,Boolean],default:!1},id:{default:null},optionsLimit:{type:Number,default:1e3},groupValues:{type:String},groupLabel:{type:String},groupSelect:{type:Boolean,default:!1},blockKeys:{type:Array,default(){return[]}},preserveSearch:{type:Boolean,default:!1},preselectFirst:{type:Boolean,default:!1},preventAutofocus:{type:Boolean,default:!1}},mounted(){!this.multiple&&this.max&&console.warn("[Vue-Multiselect warn]: Max prop should not be used when prop Multiple equals false."),this.preselectFirst&&!this.internalValue.length&&this.options.length&&this.select(this.filteredOptions[0])},computed:{internalValue(){return this.modelValue||this.modelValue===0?Array.isArray(this.modelValue)?this.modelValue:[this.modelValue]:[]},filteredOptions(){const n=this.search||"",e=n.toLowerCase().trim();let t=this.options.concat();return this.internalSearch?t=this.groupValues?this.filterAndFlat(t,e,this.label):vO(t,e,this.label,this.customLabel):t=this.groupValues?Rw(this.groupValues,this.groupLabel)(t):t,t=this.hideSelected?t.filter(yle(this.isSelected)):t,this.taggable&&e.length&&!this.isExistingOption(e)&&(this.tagPosition==="bottom"?t.push({isTag:!0,label:n}):t.unshift({isTag:!0,label:n})),t.slice(0,this.optionsLimit)},valueKeys(){return this.trackBy?this.internalValue.map(n=>n[this.trackBy]):this.internalValue},optionKeys(){return(this.groupValues?this.flatAndStrip(this.options):this.options).map(e=>this.customLabel(e,this.label).toString().toLowerCase())},currentOptionLabel(){return this.multiple?this.searchable?"":this.placeholder:this.internalValue.length?this.getOptionLabel(this.internalValue[0]):this.searchable?"":this.placeholder}},watch:{internalValue:{handler(){this.resetAfter&&this.internalValue.length&&(this.search="",this.$emit("update:modelValue",this.multiple?[]:null))},deep:!0},search(){this.$emit("search-change",this.search)}},emits:["open","search-change","close","select","update:modelValue","remove","tag"],methods:{getValue(){return this.multiple?this.internalValue:this.internalValue.length===0?null:this.internalValue[0]},filterAndFlat(n,e,t){return CO(vle(e,t,this.groupValues,this.groupLabel,this.customLabel),Rw(this.groupValues,this.groupLabel))(n)},flatAndStrip(n){return CO(Rw(this.groupValues,this.groupLabel),wle)(n)},updateSearch(n){this.search=n},isExistingOption(n){return this.options?this.optionKeys.indexOf(n)>-1:!1},isSelected(n){const e=this.trackBy?n[this.trackBy]:n;return this.valueKeys.indexOf(e)>-1},isOptionDisabled(n){return!!n.$isDisabled},getOptionLabel(n){if(Bw(n))return"";if(n.isTag)return n.label;if(n.$isLabel)return n.$groupLabel;const e=this.customLabel(n,this.label);return Bw(e)?"":e},select(n,e){if(n.$isLabel&&this.groupSelect){this.selectGroup(n);return}if(!(this.blockKeys.indexOf(e)!==-1||this.disabled||n.$isDisabled||n.$isLabel)&&!(this.max&&this.multiple&&this.internalValue.length===this.max)&&!(e==="Tab"&&!this.pointerDirty)){if(n.isTag)this.$emit("tag",n.label,this.id),this.search="",this.closeOnSelect&&!this.multiple&&this.deactivate();else{if(this.isSelected(n)){e!=="Tab"&&this.removeElement(n);return}this.multiple?this.$emit("update:modelValue",this.internalValue.concat([n])):this.$emit("update:modelValue",n),this.$emit("select",n,this.id),this.clearOnSelect&&(this.search="")}this.closeOnSelect&&this.deactivate()}},selectGroup(n){const e=this.options.find(t=>t[this.groupLabel]===n.$groupLabel);if(e){if(this.wholeGroupSelected(e)){this.$emit("remove",e[this.groupValues],this.id);const t=this.internalValue.filter(r=>e[this.groupValues].indexOf(r)===-1);this.$emit("update:modelValue",t)}else{let t=e[this.groupValues].filter(r=>!(this.isOptionDisabled(r)||this.isSelected(r)));this.max&&t.splice(this.max-this.internalValue.length),this.$emit("select",t,this.id),this.$emit("update:modelValue",this.internalValue.concat(t))}this.closeOnSelect&&this.deactivate()}},wholeGroupSelected(n){return n[this.groupValues].every(e=>this.isSelected(e)||this.isOptionDisabled(e))},wholeGroupDisabled(n){return n[this.groupValues].every(this.isOptionDisabled)},removeElement(n,e=!0){if(this.disabled||n.$isDisabled)return;if(!this.allowEmpty&&this.internalValue.length<=1){this.deactivate();return}const t=typeof n=="object"?this.valueKeys.indexOf(n[this.trackBy]):this.valueKeys.indexOf(n);if(this.multiple){const r=this.internalValue.slice(0,t).concat(this.internalValue.slice(t+1));this.$emit("update:modelValue",r)}else this.$emit("update:modelValue",null);this.$emit("remove",n,this.id),this.closeOnSelect&&e&&this.deactivate()},removeLastElement(){this.blockKeys.indexOf("Delete")===-1&&this.search.length===0&&Array.isArray(this.internalValue)&&this.internalValue.length&&this.removeElement(this.internalValue[this.internalValue.length-1],!1)},activate(){this.isOpen||this.disabled||(this.adjustPosition(),this.groupValues&&this.pointer===0&&this.filteredOptions.length&&(this.pointer=1),this.isOpen=!0,this.searchable?(this.preserveSearch||(this.search=""),this.preventAutofocus||this.$nextTick(()=>this.$refs.search&&this.$refs.search.focus())):this.preventAutofocus||typeof this.$el<"u"&&this.$el.focus(),this.$emit("open",this.id))},deactivate(){this.isOpen&&(this.isOpen=!1,this.searchable?this.$refs.search!==null&&typeof this.$refs.search<"u"&&this.$refs.search.blur():typeof this.$el<"u"&&this.$el.blur(),this.preserveSearch||(this.search=""),this.$emit("close",this.getValue(),this.id))},toggle(){this.isOpen?this.deactivate():this.activate()},adjustPosition(){if(typeof window>"u")return;const n=this.$el.getBoundingClientRect().top,e=window.innerHeight-this.$el.getBoundingClientRect().bottom;e>this.maxHeight||e>n||this.openDirection==="below"||this.openDirection==="bottom"?(this.preferredOpenDirection="below",this.optimizedHeight=Math.min(e-40,this.maxHeight)):(this.preferredOpenDirection="above",this.optimizedHeight=Math.min(n-40,this.maxHeight))}}},kle={data(){return{pointer:0,pointerDirty:!1}},props:{showPointer:{type:Boolean,default:!0},optionHeight:{type:Number,default:40}},computed:{pointerPosition(){return this.pointer*this.optionHeight},visibleElements(){return this.optimizedHeight/this.optionHeight}},watch:{filteredOptions(){this.pointerAdjust()},isOpen(){this.pointerDirty=!1},pointer(){this.$refs.search&&this.$refs.search.setAttribute("aria-activedescendant",this.id+"-"+this.pointer.toString())}},methods:{optionHighlight(n,e){return{"multiselect__option--highlight":n===this.pointer&&this.showPointer,"multiselect__option--selected":this.isSelected(e)}},groupHighlight(n,e){if(!this.groupSelect)return["multiselect__option--disabled",{"multiselect__option--group":e.$isLabel}];const t=this.options.find(r=>r[this.groupLabel]===e.$groupLabel);return t&&!this.wholeGroupDisabled(t)?["multiselect__option--group",{"multiselect__option--highlight":n===this.pointer&&this.showPointer},{"multiselect__option--group-selected":this.wholeGroupSelected(t)}]:"multiselect__option--disabled"},addPointerElement({key:n}="Enter"){this.filteredOptions.length>0&&this.select(this.filteredOptions[this.pointer],n),this.pointerReset()},pointerForward(){this.pointer<this.filteredOptions.length-1&&(this.pointer++,this.$refs.list.scrollTop<=this.pointerPosition-(this.visibleElements-1)*this.optionHeight&&(this.$refs.list.scrollTop=this.pointerPosition-(this.visibleElements-1)*this.optionHeight),this.filteredOptions[this.pointer]&&this.filteredOptions[this.pointer].$isLabel&&!this.groupSelect&&this.pointerForward()),this.pointerDirty=!0},pointerBackward(){this.pointer>0?(this.pointer--,this.$refs.list.scrollTop>=this.pointerPosition&&(this.$refs.list.scrollTop=this.pointerPosition),this.filteredOptions[this.pointer]&&this.filteredOptions[this.pointer].$isLabel&&!this.groupSelect&&this.pointerBackward()):this.filteredOptions[this.pointer]&&this.filteredOptions[0].$isLabel&&!this.groupSelect&&this.pointerForward(),this.pointerDirty=!0},pointerReset(){this.closeOnSelect&&(this.pointer=0,this.$refs.list&&(this.$refs.list.scrollTop=0))},pointerAdjust(){this.pointer>=this.filteredOptions.length-1&&(this.pointer=this.filteredOptions.length?this.filteredOptions.length-1:0),this.filteredOptions.length>0&&this.filteredOptions[this.pointer].$isLabel&&!this.groupSelect&&this.pointerForward()},pointerSet(n){this.pointer=n,this.pointerDirty=!0}}},kO={name:"vue-multiselect",mixins:[Cle,kle],compatConfig:{MODE:3,ATTR_ENUMERATED_COERCION:!1},props:{name:{type:String,default:""},modelValue:{type:null,default(){return[]}},selectLabel:{type:String,default:"Press enter to select"},selectGroupLabel:{type:String,default:"Press enter to select group"},selectedLabel:{type:String,default:"Selected"},deselectLabel:{type:String,default:"Press enter to remove"},deselectGroupLabel:{type:String,default:"Press enter to deselect group"},showLabels:{type:Boolean,default:!0},limit:{type:Number,default:99999},maxHeight:{type:Number,default:300},limitText:{type:Function,default:n=>`and ${n} more`},loading:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},openDirection:{type:String,default:""},showNoOptions:{type:Boolean,default:!0},showNoResults:{type:Boolean,default:!0},tabindex:{type:Number,default:0}},computed:{hasOptionGroup(){return this.groupValues&&this.groupLabel&&this.groupSelect},isSingleLabelVisible(){return(this.singleValue||this.singleValue===0)&&(!this.isOpen||!this.searchable)&&!this.visibleValues.length},isPlaceholderVisible(){return!this.internalValue.length&&(!this.searchable||!this.isOpen)},visibleValues(){return this.multiple?this.internalValue.slice(0,this.limit):[]},singleValue(){return this.internalValue[0]},deselectLabelText(){return this.showLabels?this.deselectLabel:""},deselectGroupLabelText(){return this.showLabels?this.deselectGroupLabel:""},selectLabelText(){return this.showLabels?this.selectLabel:""},selectGroupLabelText(){return this.showLabels?this.selectGroupLabel:""},selectedLabelText(){return this.showLabels?this.selectedLabel:""},inputStyle(){return this.searchable||this.multiple&&this.modelValue&&this.modelValue.length?this.isOpen?{width:"100%"}:{width:"0",position:"absolute",padding:"0"}:""},contentStyle(){return this.options.length?{display:"inline-block"}:{display:"block"}},isAbove(){return this.openDirection==="above"||this.openDirection==="top"?!0:this.openDirection==="below"||this.openDirection==="bottom"?!1:this.preferredOpenDirection==="above"},showSearchInput(){return this.searchable&&(this.hasSingleSelectedSlot&&(this.visibleSingleValue||this.visibleSingleValue===0)?this.isOpen:!0)}}};const Sle={ref:"tags",class:"multiselect__tags"},Mle={class:"multiselect__tags-wrap"},Ele={class:"multiselect__spinner"},Ale={key:0},Tle={class:"multiselect__option"},xle={class:"multiselect__option"},Ile=l.createTextVNode("No elements found. Consider changing the search query."),Ole={class:"multiselect__option"},Dle=l.createTextVNode("List is empty.");function Nle(n,e,t,r,i,o){return l.openBlock(),l.createBlock("div",{tabindex:n.searchable?-1:t.tabindex,class:[{"multiselect--active":n.isOpen,"multiselect--disabled":t.disabled,"multiselect--above":o.isAbove,"multiselect--has-options-group":o.hasOptionGroup},"multiselect"],onFocus:e[14]||(e[14]=s=>n.activate()),onBlur:e[15]||(e[15]=s=>n.searchable?!1:n.deactivate()),onKeydown:[e[16]||(e[16]=l.withKeys(l.withModifiers(s=>n.pointerForward(),["self","prevent"]),["down"])),e[17]||(e[17]=l.withKeys(l.withModifiers(s=>n.pointerBackward(),["self","prevent"]),["up"]))],onKeypress:e[18]||(e[18]=l.withKeys(l.withModifiers(s=>n.addPointerElement(s),["stop","self"]),["enter","tab"])),onKeyup:e[19]||(e[19]=l.withKeys(s=>n.deactivate(),["esc"])),role:"combobox","aria-owns":"listbox-"+n.id},[l.renderSlot(n.$slots,"caret",{toggle:n.toggle},()=>[l.createVNode("div",{onMousedown:e[1]||(e[1]=l.withModifiers(s=>n.toggle(),["prevent","stop"])),class:"multiselect__select"},null,32)]),l.renderSlot(n.$slots,"clear",{search:n.search}),l.createVNode("div",Sle,[l.renderSlot(n.$slots,"selection",{search:n.search,remove:n.removeElement,values:o.visibleValues,isOpen:n.isOpen},()=>[l.withDirectives(l.createVNode("div",Mle,[(l.openBlock(!0),l.createBlock(l.Fragment,null,l.renderList(o.visibleValues,(s,a)=>l.renderSlot(n.$slots,"tag",{option:s,search:n.search,remove:n.removeElement},()=>[(l.openBlock(),l.createBlock("span",{class:"multiselect__tag",key:a},[l.createVNode("span",{textContent:l.toDisplayString(n.getOptionLabel(s))},null,8,["textContent"]),l.createVNode("i",{tabindex:"1",onKeypress:l.withKeys(l.withModifiers(c=>n.removeElement(s),["prevent"]),["enter"]),onMousedown:l.withModifiers(c=>n.removeElement(s),["prevent"]),class:"multiselect__tag-icon"},null,40,["onKeypress","onMousedown"])]))])),256))],512),[[l.vShow,o.visibleValues.length>0]]),n.internalValue&&n.internalValue.length>t.limit?l.renderSlot(n.$slots,"limit",{key:0},()=>[l.createVNode("strong",{class:"multiselect__strong",textContent:l.toDisplayString(t.limitText(n.internalValue.length-t.limit))},null,8,["textContent"])]):l.createCommentVNode("v-if",!0)]),l.createVNode(l.Transition,{name:"multiselect__loading"},{default:l.withCtx(()=>[l.renderSlot(n.$slots,"loading",{},()=>[l.withDirectives(l.createVNode("div",Ele,null,512),[[l.vShow,t.loading]])])]),_:3}),n.searchable?(l.openBlock(),l.createBlock("input",{key:0,ref:"search",name:t.name,id:n.id,type:"text",autocomplete:"off",spellcheck:!1,placeholder:n.placeholder,style:o.inputStyle,value:n.search,disabled:t.disabled,tabindex:t.tabindex,onInput:e[2]||(e[2]=s=>n.updateSearch(s.target.value)),onFocus:e[3]||(e[3]=l.withModifiers(s=>n.activate(),["prevent"])),onBlur:e[4]||(e[4]=l.withModifiers(s=>n.deactivate(),["prevent"])),onKeyup:e[5]||(e[5]=l.withKeys(s=>n.deactivate(),["esc"])),onKeydown:[e[6]||(e[6]=l.withKeys(l.withModifiers(s=>n.pointerForward(),["prevent"]),["down"])),e[7]||(e[7]=l.withKeys(l.withModifiers(s=>n.pointerBackward(),["prevent"]),["up"])),e[9]||(e[9]=l.withKeys(l.withModifiers(s=>n.removeLastElement(),["stop"]),["delete"]))],onKeypress:e[8]||(e[8]=l.withKeys(l.withModifiers(s=>n.addPointerElement(s),["prevent","stop","self"]),["enter"])),class:"multiselect__input","aria-controls":"listbox-"+n.id},null,44,["name","id","placeholder","value","disabled","tabindex","aria-controls"])):l.createCommentVNode("v-if",!0),o.isSingleLabelVisible?(l.openBlock(),l.createBlock("span",{key:1,class:"multiselect__single",onMousedown:e[10]||(e[10]=l.withModifiers((...s)=>n.toggle&&n.toggle(...s),["prevent"]))},[l.renderSlot(n.$slots,"singleLabel",{option:o.singleValue},()=>[l.createTextVNode(l.toDisplayString(n.currentOptionLabel),1)])],32)):l.createCommentVNode("v-if",!0),o.isPlaceholderVisible?(l.openBlock(),l.createBlock("span",{key:2,class:"multiselect__placeholder",onMousedown:e[11]||(e[11]=l.withModifiers((...s)=>n.toggle&&n.toggle(...s),["prevent"]))},[l.renderSlot(n.$slots,"placeholder",{},()=>[l.createTextVNode(l.toDisplayString(n.placeholder),1)])],32)):l.createCommentVNode("v-if",!0)],512),l.createVNode(l.Transition,{name:"multiselect"},{default:l.withCtx(()=>[l.withDirectives(l.createVNode("div",{class:"multiselect__content-wrapper",onFocus:e[12]||(e[12]=(...s)=>n.activate&&n.activate(...s)),tabindex:"-1",onMousedown:e[13]||(e[13]=l.withModifiers(()=>{},["prevent"])),style:{maxHeight:n.optimizedHeight+"px"},ref:"list"},[l.createVNode("ul",{class:"multiselect__content",style:o.contentStyle,role:"listbox",id:"listbox-"+n.id},[l.renderSlot(n.$slots,"beforeList"),n.multiple&&n.max===n.internalValue.length?(l.openBlock(),l.createBlock("li",Ale,[l.createVNode("span",Tle,[l.renderSlot(n.$slots,"maxElements",{},()=>[l.createTextVNode("Maximum of "+l.toDisplayString(n.max)+" options selected. First remove a selected option to select another.",1)])])])):l.createCommentVNode("v-if",!0),!n.max||n.internalValue.length<n.max?(l.openBlock(!0),l.createBlock(l.Fragment,{key:1},l.renderList(n.filteredOptions,(s,a)=>(l.openBlock(),l.createBlock("li",{class:"multiselect__element",key:a,id:n.id+"-"+a,role:s&&(s.$isLabel||s.$isDisabled)?null:"option"},[s&&(s.$isLabel||s.$isDisabled)?l.createCommentVNode("v-if",!0):(l.openBlock(),l.createBlock("span",{key:0,class:[n.optionHighlight(a,s),"multiselect__option"],onClick:l.withModifiers(c=>n.select(s),["stop"]),onMouseenter:l.withModifiers(c=>n.pointerSet(a),["self"]),"data-select":s&&s.isTag?n.tagPlaceholder:o.selectLabelText,"data-selected":o.selectedLabelText,"data-deselect":o.deselectLabelText},[l.renderSlot(n.$slots,"option",{option:s,search:n.search,index:a},()=>[l.createVNode("span",null,l.toDisplayString(n.getOptionLabel(s)),1)])],42,["onClick","onMouseenter","data-select","data-selected","data-deselect"])),s&&(s.$isLabel||s.$isDisabled)?(l.openBlock(),l.createBlock("span",{key:1,"data-select":n.groupSelect&&o.selectGroupLabelText,"data-deselect":n.groupSelect&&o.deselectGroupLabelText,class:[n.groupHighlight(a,s),"multiselect__option"],onMouseenter:l.withModifiers(c=>n.groupSelect&&n.pointerSet(a),["self"]),onMousedown:l.withModifiers(c=>n.selectGroup(s),["prevent"])},[l.renderSlot(n.$slots,"option",{option:s,search:n.search,index:a},()=>[l.createVNode("span",null,l.toDisplayString(n.getOptionLabel(s)),1)])],42,["data-select","data-deselect","onMouseenter","onMousedown"])):l.createCommentVNode("v-if",!0)],8,["id","role"]))),128)):l.createCommentVNode("v-if",!0),l.withDirectives(l.createVNode("li",null,[l.createVNode("span",xle,[l.renderSlot(n.$slots,"noResult",{search:n.search},()=>[Ile])])],512),[[l.vShow,t.showNoResults&&n.filteredOptions.length===0&&n.search&&!t.loading]]),l.withDirectives(l.createVNode("li",null,[l.createVNode("span",Ole,[l.renderSlot(n.$slots,"noOptions",{},()=>[Dle])])],512),[[l.vShow,t.showNoOptions&&(n.options.length===0||o.hasOptionGroup===!0&&n.filteredOptions.length===0)&&!n.search&&!t.loading]]),l.renderSlot(n.$slots,"afterList")],12,["id"])],36),[[l.vShow,n.isOpen]])]),_:3})],42,["tabindex","aria-owns"])}kO.render=Nle;const Ple=l.defineComponent({name:"QSelect",components:{QBadge:Da,VueMultiselect:kO},props:{id:{type:String,default:""},options:{type:[Array,Object],required:!0},modelValue:{type:[String,Number,Array,Object],default:""},trackBy:{type:String,default:"id"},label:{type:String,default:"label"},placeholder:{type:String,default:""},multiple:{type:Boolean,default:!1},taggable:{type:Boolean,default:!1},searchable:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},groupValues:{type:String,default:""},groupLabel:{type:String,default:""},groupSelectable:{type:Boolean,default:!0},hasCheckboxes:{type:Boolean,default:!1},size:{type:String,default:"lg"},info:{type:String,default:""},allowEmpty:{type:Boolean,default:!0},noResultMessage:{type:String,default:""},selectionControl:{type:Boolean,default:!1},showExpanded:{type:Boolean,default:!1},showPlaceholderImage:{type:Boolean,default:!0},showSelectAll:{type:Boolean,default:!1},tagPlaceholder:{type:String,default:""},expand:{type:Boolean,default:!1},showSelectedCount:{type:Boolean,default:!1},truncateTag:{type:Boolean,default:!1},limitShown:{type:Number,default:null},validationMethod:{type:Function,default:()=>!0},showOptionDescription:{type:Boolean,default:!1},showTags:{type:Boolean,default:!1},openDirection:{type:String,default:"bottom"},useAddTagsOnly:{type:Boolean,default:!1}},emits:["update:model-value"],setup(n,{slots:e,emit:t}){const{t:r}=us(),i=l.ref(null),o=l.ref(null),s=l.ref(n.modelValue),a=l.ref(""),c=l.computed(()=>n.options.length+n.options.reduce((S,A)=>A.libs?S+A.libs.length:0,0)),u=l.computed(()=>!!e.action),d=l.computed(()=>n.noResultMessage||r("HC_PRESS_ENTER_TO_CREATE_A_TAG")),f=l.computed(()=>n.tagPlaceholder||r("HC_PRESS_ENTER_TO_CREATE_A_TAG")),h=l.computed(()=>c.value===s.value.length?r("HC_ALL"):s.value.length>1?r("HC_MULTIPLE_SELECTED"):s.value[0].label||s.value[0].name||""),p=l.computed(()=>n.taggable||n.showTags),m=S=>{t("update:model-value",S)},y=S=>{a.value=S},b=async S=>{const A={label:S,name:S,added:!0};if(!n.validationMethod(A)){await l.nextTick(),i.value.search=S;return}},w=()=>{s.value=[],t("update:model-value",s.value)},v=S=>{typeof S=="number"&&S>=0?s.value.splice(S,1):s.value=[],l.nextTick(()=>{t("update:model-value",s.value)})},k=S=>{n.multiple&&s.value&&S.length===s.value.length&&l.nextTick(()=>{s.value=[],t("update:model-value",s.value)})},C=async()=>{if(o.value&&n.searchable){await l.nextTick();const S=o.value.querySelector(".multiselect__content-wrapper"),A=o.value.querySelector(".multiselect__input");A.style.width=S.clientWidth+"px"}},T=async()=>{if(!i.value)return;const S=i.value;s.value=[],n.groupValues?S.filteredOptions.forEach(A=>{s.value.push(A)}):s.value=S.filteredOptions,t("update:model-value",s.value)};return l.watch(()=>n.modelValue,S=>{s.value=S}),{currentSelect:i,search:a,selected:s,hasAction:u,noResultsText:d,noTagFound:f,selectedCount:c,selectedText:h,useTags:p,addTag:b,clearAll:w,onOpen:C,onRemove:k,onUpdateValue:m,removeElement:v,searchChange:y,selectAll:T}}}),_le=["id"],Lle=["onMousedown"],Ble={key:1,class:"searchable-placeholder"},Rle={class:"flex gap-2 px-4 py-3"},$le={key:0,class:"tag-container"},Fle={key:0},Vle={class:l.normalizeClass(["tag-name text-sm leading-normal pr-2 capitalize"])},jle={key:1},zle=["onClick"],Hle={key:0,class:"text-blue-20 text-xs count"},Ule={key:0,class:"text-inkwell-10 text-right truncate font-normal"},Zle={key:1,class:"text-blue-20 text-xs ml-2"},Wle={class:"text-inkwell-40"},Kle={class:"text-inkwell-10 text-right truncate"},qle={key:1,class:"option-selected text-gray-40"},Gle={key:3,class:"flex w-full justify-between"},Yle={class:"text-inkwell-40 pl-1 text-base font-medium"},Qle=["title"],Xle={key:2,class:"option-description text-xs pt-0.5 truncate"};function Jle(n,e,t,r,i,o){const s=l.resolveComponent("q-icon"),a=l.resolveComponent("q-button"),c=l.resolveComponent("q-badge"),u=l.resolveComponent("vue-multiselect");return l.openBlock(),l.createElementBlock("div",{id:n.id+"-containers",class:"control custom-select",ref:"currentContainer"},[l.createVNode(u,{id:n.id,ref:"currentSelect",modelValue:n.selected,"onUpdate:modelValue":[e[1]||(e[1]=d=>n.selected=d),e[4]||(e[4]=d=>n.onUpdateValue(d))],options:n.options,searchable:n.searchable,multiple:n.multiple,taggable:n.taggable||n.useAddTagsOnly,label:n.label,"track-by":n.trackBy,"group-values":n.groupValues,"group-label":n.groupLabel,"group-select":n.groupSelectable,class:l.normalizeClass([{"has-checkboxes":n.hasCheckboxes},{"selection-control":n.selectionControl},{"select-multiple":!!n.multiple},{"select-taggable":!!n.taggable||!!n.showTags||!!n.useAddTagsOnly},{"select-expand":n.expand},{"select-show-count":!!n.showSelectedCount},{"select-search":!!n.search},{"select-searchable":n.searchable},n.searchable?"cursor-text":"cursor-default","q-select rounded","select-"+n.size]),disabled:n.disabled,"allow-empty":n.allowEmpty,"clear-on-select":!0,"close-on-select":!n.hasCheckboxes&&!n.multiple,"show-tags":n.showTags,"tag-placeholder":n.noTagFound,placeholder:n.placeholder,"preserve-search":!0,"reset-after":!1,"max-height":280,"open-direction":n.openDirection,"select-label":"","deselect-label":"","selected-label":"","select-group-label":"","deselect-group-label":"",onOpen:n.onOpen,onRemove:e[2]||(e[2]=d=>n.onRemove(d)),onTag:n.addTag,onSearchChange:e[3]||(e[3]=d=>n.searchChange(d))},l.createSlots({caret:l.withCtx(({toggle:d})=>[l.createElementVNode("div",{class:l.normalizeClass(["h-full w-full","absolute left-0 top-0","z-[1] cursor-pointer","flex justify-end"]),onMousedown:l.withModifiers(d,["prevent"])},[l.createVNode(s,{icon:"chevron-down",type:"line"})],40,Lle),n.searchable?(l.openBlock(),l.createBlock(s,{key:0,class:"search-icon",color:n.selectionControl?"inkwell-0":"gray-40",icon:"search",type:""},null,8,["color"])):l.createCommentVNode("",!0),n.searchable&&(n.multiple&&!n.selected.length||!n.multiple&&!n.selected)&&!n.selectionControl?(l.openBlock(),l.createElementBlock("div",Ble,l.toDisplayString(n.placeholder),1)):l.createCommentVNode("",!0)]),noResult:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(n.noResultsText),1)]),singleLabel:l.withCtx(({option:d})=>[d.icon?(l.openBlock(),l.createBlock(s,{key:0,icon:d.icon},null,8,["icon"])):l.createCommentVNode("",!0),d&&n.showPlaceholderImage?l.renderSlot(n.$slots,"optionPrefix",l.normalizeProps(l.mergeProps({key:1},d)),void 0,!0):l.createCommentVNode("",!0),n.selectionControl?l.renderSlot(n.$slots,"controlPlaceholder",{key:2},()=>[l.createTextVNode(l.toDisplayString(n.placeholder),1)],!0):l.createCommentVNode("",!0),l.createElementVNode("span",{class:l.normalizeClass(["option-name",{"text-inkwell-10 text-right truncate":n.selectionControl}])},l.toDisplayString(d.label||d.name||d),3)]),selection:l.withCtx(({values:d,isOpen:f})=>{var h,p,m,y;return[n.useTags?(l.openBlock(),l.createElementBlock("div",$le,[n.groupValues&&n.options[0][n.groupValues].length===d.length?(l.openBlock(),l.createElementBlock("div",Fle,[l.createElementVNode("div",{class:l.normalizeClass(["multiselect__tag inline-flex items-center justify-center rounded me-2 z-[1]",{"tag-gray":!!n.showTags}])},[l.createElementVNode("span",Vle,l.toDisplayString(n.groupLabel),1),l.createElementVNode("span",{class:"tag-remove cursor-pointer shrink",tabindex:"1",onMousedown:e[0]||(e[0]=l.withModifiers(b=>n.removeElement(n.options[0][n.groupValues]),["prevent","stop"]))},[l.createVNode(s,{icon:"close",color:"white",class:l.normalizeClass(["tag-close flex rounded-full p-1",n.showTags?"bg-inkwell-30":"bg-blue-40"]),type:"line"},null,8,["class"])],32)],2)])):(l.openBlock(),l.createElementBlock("div",jle,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(!n.expand&&n.limitShown?d.slice(0,n.limitShown):d,(b,w)=>(l.openBlock(),l.createElementBlock("div",{key:w,class:l.normalizeClass(["multiselect__tag !inline-flex items-center justify-center rounded mr-2 z-[1]",{"tag-added":b.added},{"tag-gray":!!n.showTags},b.tagClass?b.tagClass:""])},[b.icon?(l.openBlock(),l.createBlock(s,{key:0,icon:b.icon,class:"tag-icon"},null,8,["icon"])):l.createCommentVNode("",!0),l.createElementVNode("span",{class:l.normalizeClass(["tag-name text-sm leading-normal pr-2",{"tag-truncate":n.truncateTag}])},l.toDisplayString(b.label||b.name),3),l.createElementVNode("span",{class:"tag-remove cursor-pointer shrink",tabindex:"1",onClick:v=>n.removeElement(w)},[l.createVNode(s,{icon:"close-thick",color:"white",size:"sm",class:l.normalizeClass(["!p-[0.3rem] tag-close flex rounded-full p-1",b.closeTagClass?b.closeTagClass:n.showTags?"bg-inkwell-30":n.taggable&&b.added?"bg-green-40":"bg-blue-40"]),type:"line"},null,8,["class"])],8,zle)],2))),128)),!n.expand&&n.showSelectedCount&&n.multiple&&d.length>n.limitShown?(l.openBlock(),l.createElementBlock("span",Hle," + "+l.toDisplayString(d.length-n.limitShown)+" more... ",1)):l.createCommentVNode("",!0)]))])):l.createCommentVNode("",!0),!n.showTags&&!n.taggable&&n.multiple&&d.length?(l.openBlock(),l.createElementBlock("div",{key:1,class:l.normalizeClass(["multiselect__single flex w-full",n.selectionControl?"whitespace-nowrap justify-between":"items-center"])},[l.createElementVNode("span",{class:l.normalizeClass(["option-selected",{capitalize:n.groupValues&&n.options[0][n.groupValues].length===d.length}])},l.toDisplayString(n.selectionControl?n.placeholder:n.groupValues&&n.options[0][n.groupValues].length===d.length?n.groupLabel:d[0].label),3),n.selectionControl?(l.openBlock(),l.createElementBlock("span",Ule,l.toDisplayString(n.selectedText),1)):l.createCommentVNode("",!0),n.limitShown&&n.limitShown<d.length&&(!n.groupValues&&d.length!==n.limitShown||n.groupValues&&n.options[0][n.groupValues].length!==d.length)?(l.openBlock(),l.createElementBlock("span",Zle," + "+l.toDisplayString(d.length-n.limitShown)+" more... ",1)):l.createCommentVNode("",!0)],2)):f&&!n.useTags&&!n.multiple?(l.openBlock(),l.createElementBlock("div",{key:2,class:l.normalizeClass(["multiselect__single flex w-full",n.selectionControl?"justify-between":"items-center"])},[n.selectionControl?(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[l.createElementVNode("span",Wle,l.toDisplayString(n.placeholder||""),1),l.createElementVNode("span",Kle,l.toDisplayString(((h=n.selected)==null?void 0:h.label)||((p=n.selected)==null?void 0:p.name)||""),1)],64)):(l.openBlock(),l.createElementBlock("span",qle,l.toDisplayString(((m=n.selected)==null?void 0:m.label)||((y=n.selected)==null?void 0:y.name)||""),1))],2)):f&&!n.useTags&&n.multiple&&n.selectionControl?(l.openBlock(),l.createElementBlock("div",Gle,[l.createElementVNode("span",Yle,l.toDisplayString(n.placeholder||""),1)])):l.createCommentVNode("",!0)]}),option:l.withCtx(({option:d,search:f})=>[l.createElementVNode("div",{class:l.normalizeClass(["flex items-center w-full",{"option-search":d.label===f},{"option-disabled":d.isDisabled}]),title:d.label?d.label:""},[n.multiple&&n.hasCheckboxes?(l.openBlock(),l.createBlock(c,{key:0,"has-icon":!0,class:"selected-checkbox mr-2",shape:"square"},{icon:l.withCtx(()=>[l.createVNode(s,{icon:"check",color:"white",type:"line"})]),_:1})):l.createCommentVNode("",!0),l.createElementVNode("div",{class:l.normalizeClass(["option-icon-name flex items-center",!d.$groupLabel&&n.groupLabel?"pl-0":""])},[d.icon?(l.openBlock(),l.createBlock(s,{key:0,icon:d.icon,class:"mr-1"},null,8,["icon"])):l.createCommentVNode("",!0),d?l.renderSlot(n.$slots,"optionPrefix",l.normalizeProps(l.mergeProps({key:1},d)),void 0,!0):l.createCommentVNode("",!0),l.createElementVNode("div",{class:l.normalizeClass(["option-name",[d.optionClass?d.optionClass:""]])},l.toDisplayString(d.$groupLabel||d.label||d.name||d),3),d.description&&n.showOptionDescription?(l.openBlock(),l.createElementBlock("div",Xle,l.toDisplayString(d.description),1)):l.createCommentVNode("",!0),n.multiple&&n.hasCheckboxes?l.createCommentVNode("",!0):(l.openBlock(),l.createBlock(s,{key:3,icon:"check",size:"sm",type:"line",color:"inkwell-30",class:"selected-icon"}))],2)],10,Qle)]),_:2},[n.showSelectAll?{name:"beforeList",fn:l.withCtx(()=>[l.createElementVNode("div",Rle,[l.createVNode(a,{disabled:n.selectedCount===n.selected.length,"no-min-width":!0,class:"!text-sm !font-normal !leading-4",status:"link",onClick:n.selectAll},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(n.$t("HC_SELECT_ALL")),1)]),_:1},8,["disabled","onClick"]),l.createVNode(a,{disabled:!n.selected.length,"no-min-width":!0,class:"!text-sm !font-normal !leading-4",status:"link",onClick:n.clearAll},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(n.$t("HC_CLEAR_ALL")),1)]),_:1},8,["disabled","onClick"])])]),key:"0"}:void 0]),1032,["id","modelValue","options","searchable","multiple","taggable","label","track-by","group-values","group-label","group-select","class","disabled","allow-empty","close-on-select","show-tags","tag-placeholder","placeholder","open-direction","onOpen","onTag"])],8,_le)}const e0e=ye(Ple,[["render",Jle],["__scopeId","data-v-3962fdc6"]]);var It={STARTS_WITH:"startsWith",CONTAINS:"contains",NOT_CONTAINS:"notContains",ENDS_WITH:"endsWith",EQUALS:"equals",NOT_EQUALS:"notEquals",IN:"in",LESS_THAN:"lt",LESS_THAN_OR_EQUAL_TO:"lte",GREATER_THAN:"gt",GREATER_THAN_OR_EQUAL_TO:"gte",BETWEEN:"between",DATE_IS:"dateIs",DATE_IS_NOT:"dateIsNot",DATE_BEFORE:"dateBefore",DATE_AFTER:"dateAfter"},l3={AND:"and",OR:"or"};function SO(n,e){var t=typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(!t){if(Array.isArray(n)||(t=t0e(n))||e&&n&&typeof n.length=="number"){t&&(n=t);var r=0,i=function(){};return{s:i,n:function(){return r>=n.length?{done:!0}:{done:!1,value:n[r++]}},e:function(u){throw u},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
251
|
+
`)},[l.createVNode(s,{icon:"paperclip",size:"lg",type:"line",color:"gray-40"}),l.createElementVNode("div",Die,l.toDisplayString(n.$t("HC_CLICK_DRAG_FILES_HERE")),1)],6)):l.createCommentVNode("",!0),l.renderSlot(n.$slots,"default"),n.allFiles.length?(l.openBlock(),l.createElementBlock("div",Nie,[l.createVNode(a,{files:n.allFiles,"show-remove":!0,processing:n.processing,class:"px-4 mt-2 mb-2","onUpdate:modelValue":n.onRemoveFile},null,8,["files","processing","onUpdate:modelValue"])])):l.createCommentVNode("",!0),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(u.messages,p=>(l.openBlock(),l.createElementBlock("p",{class:"text-red-30 mt-2 text-sm leading-5 px-4",key:p},l.toDisplayString(p),1))),128))],512)]}),_:3},8,["name","url","multiple","accept","invalidFileSizeMessage","maxFileSize","auto","custom-upload","disabled","onUpload","onSelect"])])}const PI=ye(xie,[["render",Pie]]),_ie=l.defineComponent({components:{EditorContent:IJ,EmojiPicker:Qte,QFileUpload:PI},props:{modelValue:{type:String,default:""},attachments:{type:Object,default:()=>[]},allowEmojis:{type:Boolean,default:!1},allowAttachments:{type:Boolean,default:!1},allowFormatting:{type:Boolean,default:!1},filesAllowed:{type:String,default:"image/*,.pdf"},isStacked:{type:Boolean,default:!0},isStandalone:{type:Boolean,default:!1},placeholder:{type:String,default:""},processing:{type:Boolean,default:!1}},emits:["update:model-value","update:attachments"],setup(n,{emit:e}){const t=l.ref(),r=l.ref(!1),i=l.ref(""),o=l.ref(),s=l.ref(),a=l.ref(!1),c=l.ref(!1),u=l.ref(!1),d=l.ref([]),f=l.ref(),h=l.ref(),p=l.computed(()=>P.value.getAttributes("textStyle").color||"#121517"),m=l.computed(()=>n.attachments),b=q8(eL).greaterOrEqual("md"),w=()=>{const D=window.prompt("URL");P.value.chain().focus().extendMarkRange("link").setLink({href:D||""}).run()},v=D=>{P.value.chain().focus().setColor(D).run(),C()},k=()=>{a.value=!a.value},C=()=>{a.value=!1},T=()=>{var D,_;(_=(D=f.value)==null?void 0:D.fileUpload)==null||_.choose()},S=D=>{P.value.chain().focus().insertContent(D).run(),o.value.$el.click()},A=D=>{P.value.chain().focus().insertContent(D.i).run(),r.value=!1},O=D=>{d.value=D,I()},I=()=>{let D="";P.value.isEmpty||(D=n.allowFormatting?P.value.getHTML():P.value.getText()),d.value!==n.attachments&&e("update:attachments",d.value),e("update:model-value",D)},P=l.ref(OJ({extensions:[Yne.configure({heading:{levels:[1,2]}}),Qne,Xne,Jne,kre.configure({openOnClick:!1}),Sre.configure({placeholder:n.placeholder})],content:n.modelValue,onUpdate:I}));return l.watch(()=>n.modelValue,D=>{P.value&&!D&&P.value.commands.clearContent()}),l.onBeforeUnmount(()=>{var D;(D=P.value)==null||D.destroy()}),F5(t,()=>{r.value=!1}),{colors:Yk.theme.colors,colorExclusions:["success","success-light","error","error-light","warning","warning-light","info","info-light","transparent","current","green-quore","blue-sky","blue-quore","complaint","recurring","workorder"],editor:P,editorRef:h,emojiPickerElement:t,showEmojiPicker:r,emojiSearch:i,invoker:o,multiUploader:s,showColorMenu:a,focused:u,files:m,showFormatOptions:c,uploadedfiles:d,fileUploadRef:f,setColor:p,mdAndLarger:b,setLink:w,selectColor:v,showColors:k,onClickOutColors:C,attachFiles:T,appendEmoji:S,onSelectEmoji:A,onSelectFiles:O}}}),Lie={key:0,class:"menu flex items-center justify-between !pb-0"},Bie={class:"toolbar flex items-center md:gap-x-4"},Rie={class:"flex items-center gap-x-1"},$ie={key:2,class:"rounded-t-lg grow"},Fie={class:"menu flex items-center justify-between"},Vie={class:"toolbar flex items-center md:gap-x-4"},jie={name:"fade-zoom",class:"flex items-center items-center"},zie={class:"flex items-center px-2 shrink-0"};function Hie(n,e,t,r,i,o){const s=l.resolveComponent("q-icon"),a=l.resolveComponent("editor-content"),c=l.resolveComponent("q-file-upload"),u=l.resolveComponent("emoji-picker");return n.editor?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass(["editor-container rounded-lg",{"has-placeholder":!!n.placeholder,"is-focused":n.focused,"is-stacked":n.isStacked,"is-standalone":n.isStandalone,"show-formatting-menu":n.showFormatOptions}]),onFocusin:e[10]||(e[10]=d=>n.focused=!n.focused),onFocusout:e[11]||(e[11]=d=>n.focused=!n.focused)},[l.createElementVNode("div",{class:l.normalizeClass(["wysiwyg-layout",{flex:!n.isStacked}])},[n.showFormatOptions?(l.openBlock(),l.createElementBlock("div",Lie,[l.createElementVNode("div",Bie,[l.createElementVNode("div",Rie,[l.createVNode(s,{icon:"bold",size:"lg",color:"inkwell-0",class:l.normalizeClass({"is-active":n.editor.isActive("bold")}),onClick:e[0]||(e[0]=d=>n.editor.chain().focus().toggleBold().run())},null,8,["class"]),l.createVNode(s,{icon:"italic",size:"lg",color:"inkwell-0",class:l.normalizeClass({"is-active":n.editor.isActive("italic")}),onClick:e[1]||(e[1]=d=>n.editor.chain().focus().toggleItalic().run())},null,8,["class"]),l.createVNode(s,{icon:"underline",size:"lg",color:"inkwell-0",class:l.normalizeClass({"is-active":n.editor.isActive("underline")}),onClick:e[2]||(e[2]=d=>n.editor.chain().focus().toggleUnderline().run())},null,8,["class"]),l.createVNode(s,{icon:"strikethrough",size:"lg",color:"inkwell-0",class:l.normalizeClass({"is-active":n.editor.isActive("strike")}),onClick:e[3]||(e[3]=d=>n.editor.chain().focus().toggleStrike().run())},null,8,["class"]),l.createVNode(s,{icon:"link",size:"lg",color:"inkwell-0",class:l.normalizeClass({"is-active":n.editor.isActive("link")}),onClick:n.setLink},null,8,["class","onClick"]),n.editor.isActive("link")?(l.openBlock(),l.createBlock(s,{key:0,icon:"link",size:"lg",color:"inkwell-0",class:l.normalizeClass({"is-active":n.editor.isActive("link")}),onClick:e[4]||(e[4]=d=>n.editor.chain().focus().unsetLink().run())},null,8,["class"])):l.createCommentVNode("",!0),l.createVNode(s,{icon:"list",size:"lg",color:"inkwell-0",class:l.normalizeClass({"is-active":n.editor.isActive("bulletList")}),onClick:e[5]||(e[5]=d=>n.editor.chain().focus().toggleBulletList().run())},null,8,["class"]),l.createVNode(s,{icon:"numberlist",size:"lg",color:"inkwell-0",class:l.normalizeClass({"is-active":n.editor.isActive("orderedList")}),onClick:e[6]||(e[6]=d=>n.editor.chain().focus().toggleOrderedList().run())},null,8,["class"])])])])):l.createCommentVNode("",!0),n.allowAttachments?(l.openBlock(),l.createBlock(c,{key:1,ref:"fileUploadRef",files:n.files,"files-allowed":n.filesAllowed,processing:n.processing,class:"rounded-t-lg grow",onFileList:n.onSelectFiles},{default:l.withCtx(()=>[l.createVNode(a,{ref:"editorRef",editor:n.editor,class:"grow"},null,8,["editor"])]),_:1},8,["files","files-allowed","processing","onFileList"])):(l.openBlock(),l.createElementBlock("div",$ie,[l.createVNode(a,{ref:"editorRef",editor:n.editor,class:"grow"},null,8,["editor"])])),n.showEmojiPicker?(l.openBlock(),l.createBlock(u,{key:3,ref:"emojiPickerElement",class:"absolute top-2 left-2 z-[9999]",onSelect:n.onSelectEmoji},null,8,["onSelect"])):l.createCommentVNode("",!0),l.createElementVNode("div",Fie,[l.createElementVNode("div",Vie,[l.createElementVNode("div",jie,[l.createVNode(l.TransitionGroup,{name:"fade-zoom"},{default:l.withCtx(()=>[n.allowFormatting&&n.showFormatOptions?(l.openBlock(),l.createBlock(s,{icon:"close",key:"close",size:"lg",type:"",color:"inkwell-0",class:"md:!hidden bg-gray-7 !p-2 !rounded-full",onClick:e[7]||(e[7]=d=>n.showFormatOptions=!n.showFormatOptions)})):l.createCommentVNode("",!0),n.allowEmojis&&(!n.showFormatOptions||n.mdAndLarger)?(l.openBlock(),l.createBlock(s,{icon:"face-smile",key:"face-smile",size:"lg",type:"outline",color:"inkwell-0",class:l.normalizeClass({"is-active":n.showEmojiPicker}),onClick:e[8]||(e[8]=d=>n.showEmojiPicker=!n.showEmojiPicker)},null,8,["class"])):l.createCommentVNode("",!0),n.allowAttachments&&(!n.showFormatOptions||n.mdAndLarger)?(l.openBlock(),l.createBlock(s,{icon:"paperclip",key:"paperclip",size:"lg",type:"line",color:"inkwell-0",onClick:n.attachFiles},null,8,["onClick"])):l.createCommentVNode("",!0),n.allowFormatting&&(!n.showFormatOptions||n.mdAndLarger)?(l.openBlock(),l.createBlock(s,{icon:"text-format",key:"text-format",size:"lg",type:"outline",color:"inkwell-0",class:l.normalizeClass({"is-active":n.showFormatOptions}),onClick:e[9]||(e[9]=d=>n.showFormatOptions=!n.showFormatOptions)},null,8,["class"])):l.createCommentVNode("",!0)]),_:1})])]),l.createElementVNode("div",zie,[l.renderSlot(n.$slots,"action",{},void 0,!0)])])],2)],34)):l.createCommentVNode("",!0)}const gw=ye(_ie,[["render",Hie],["__scopeId","data-v-a13db2b5"]]),Uie={id:{type:[Number,String],default:null},attachments:{type:Array,default:[]},attachmentClickEvent:{type:Function,default:()=>{}},attachmentRemoveEvent:{type:Function,default:()=>{}},canCopyLink:{type:Boolean,default:!1},canDelete:{type:[Boolean,Number],default:!1},canEdit:{type:[Boolean,Number],default:!1},canPin:{type:Boolean,default:!1},user:{type:Object,default:null},comment:{type:String,default:""},dateUtc:{type:String,default:null},dateLocal:{type:String,default:""},onUpdateComment:{type:Function,default:()=>{}},pinned:{type:Boolean,default:!1},processing:{type:Boolean,default:!1},showAvatar:{type:Boolean,default:!0},showRemoveButton:{type:Object,default:()=>{}}},Zie=l.defineComponent({name:"QComment",components:{QAvatar:u8,QImageGallery:n6,QMenu:m4,QPopover:cE,QWarningModal:lE,QWysiwyg:gw},props:Uie,emits:["update:model-value"],setup(n){const{t:e}=us(),t=[{text:e("HC_CANCEL")}],r=l.ref(null),i=l.ref(!1),o=l.ref(""),s=l.ref(!1),a=l.ref(!1),c=l.ref(!1),u=l.ref(""),d=l.ref(),f=l.computed(()=>{const D=[];return n.canCopyLink&&D.push({text:e("HC_COPY_LINK"),classes:"!text-blue-20 md:!text-inkwell-0",event:b}),n.canPin&&D.push({text:e(n.pinned?"HC_UNPIN_COMMENT":"HC_PIN_COMMENT"),classes:"!text-blue-20 md:!text-inkwell-0",event:I}),n.canEdit&&D.push({text:e("HC_EDIT_COMMENT"),classes:"!text-blue-20 md:!text-inkwell-0",event:S}),n.canDelete&&D.push({text:e("HC_DELETE_COMMENT"),classes:"!text-red-20",event:k}),D}),h=l.computed(()=>n.user.firstName+" "+n.user.lastName.substring(0,1)),p=l.computed(()=>rt.fromISO(n.dateUtc).toLocaleString(rt.DATETIME_MED)),m=l.computed(()=>n.user.name.split(" ").map(D=>D.trim().charAt(0)).join("").toUpperCase()),y=()=>{i.value=!1,o.value=""},b=()=>{navigator.clipboard.writeText(`${window.location.href}#comment-${n.id}`),s.value=!1},w=D=>{r.value=D,u.value="attachment",c.value=!0,s.value=!1},v=async()=>{r.value&&await n.onUpdateComment({event:"delete-attachment",value:r.value.id}),c.value=!1},k=()=>{u.value="comment",c.value=!0,s.value=!1},C=async()=>{await n.onUpdateComment({event:"delete-comment",value:n.id}),c.value=!1},T=()=>{u.value==="comment"?C():v()},S=async()=>{var _,B;i.value=!0,o.value=n.comment,await l.nextTick(),(B=(_=d.value)==null?void 0:_.editor)==null||B.chain().focus("end").run(),s.value=!1;const D=document.getElementById(`comment-${n.id}`);D&&!_n.md&&D.scrollIntoView({block:"center",behavior:"smooth"})},A=()=>{s.value=!s.value},O=D=>{D.event()},I=async()=>{s.value=!1,await n.onUpdateComment({event:"update-pin",value:!n.pinned})},P=async()=>{await n.onUpdateComment({event:"update-comment",value:o.value})};return l.watch(()=>n.processing,D=>{var _,B,F;D||(i.value=!1,o.value="",c.value=!1,d.value&&d.value.allowAttachments&&((F=(B=(_=d.value)==null?void 0:_.fileUploadRef)==null?void 0:B.fileUpload)==null||F.clear(),d.value.uploadedfiles=[]))}),{menuActions:t,activeAttachment:r,editMode:i,editText:o,showControls:s,warningAction:a,warningModal:c,warningType:u,wysiwygRef:d,allowedActions:f,displayName:h,formatDate:p,userInitials:m,onClickCancel:y,onClickCopyLink:b,onClickDeleteAttachment:w,onClickDeleteAttachmentConfirm:v,onClickDeleteComment:k,onClickDeleteCommentConfirm:C,onClickDeleteConfirm:T,onClickEditComment:S,onClickMenu:A,onClickMobileMenuLink:O,onClickSave:P,mq:_n}}}),Wie=["id"],Kie={class:"flex items-start mb-1"},qie={class:"grow"},Gie={class:"w-full block text-sm leading-4 font-bold"},Yie={class:"text-inkwell-0 text-xs leading-4 block"},Qie={class:"w-full py-1"},Xie=["onClick"],Jie={key:2},eoe={key:1,class:"pl-[3rem]"},toe={class:"h-8 flex items-center"},noe={key:2};function roe(n,e,t,r,i,o){const s=l.resolveComponent("q-avatar"),a=l.resolveComponent("q-icon"),c=l.resolveComponent("q-popover"),u=l.resolveComponent("q-menu"),d=l.resolveComponent("q-button"),f=l.resolveComponent("q-wysiwyg"),h=l.resolveComponent("q-image-gallery"),p=l.resolveComponent("q-warning-modal");return n.comment||n.attachments.length?(l.openBlock(),l.createElementBlock("div",{key:0,id:`comment-${n.id}`,class:l.normalizeClass(["comment-container flex flex-col mb-3 py-2",{"-mx-2 px-2 rounded-lg bg-yellow-0":n.pinned}])},[l.createElementVNode("div",Kie,[n.showAvatar?(l.openBlock(),l.createBlock(s,{key:0,src:n.user.profileImg,text:n.userInitials,class:"mr-4"},null,8,["src","text"])):l.createCommentVNode("",!0),l.createElementVNode("div",qie,[l.createElementVNode("span",Gie,l.toDisplayString(n.user.name),1),l.createElementVNode("span",Yie,l.toDisplayString(n.dateLocal||n.formatDate),1)]),n.allowedActions.length&&n.mq.md?(l.openBlock(),l.createBlock(c,{key:1,modelValue:n.showControls,"onUpdate:modelValue":e[0]||(e[0]=m=>n.showControls=m),align:"right",position:"bottom",size:"sm"},{trigger:l.withCtx(()=>[l.createVNode(a,{icon:"ellipsis-h",type:"fill",class:l.normalizeClass(["shrink-0 cursor-pointer",n.showControls&&"!text-blue-20"]),color:"gray-40",onClick:n.onClickMenu},null,8,["class","onClick"])]),content:l.withCtx(()=>[l.createElementVNode("ul",Qie,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(n.allowedActions,(m,y)=>(l.openBlock(),l.createElementBlock("li",{key:y,class:l.normalizeClass(m.classes),onClick:b=>m.event(b)},l.toDisplayString(m.text),11,Xie))),128))])]),_:1},8,["modelValue"])):l.createCommentVNode("",!0),n.allowedActions.length&&!n.mq.md?(l.openBlock(),l.createElementBlock("div",Jie,[l.createVNode(a,{icon:"ellipsis-h",type:"fill",class:"shrink-0 cursor-pointer",color:"gray-40",onClick:n.onClickMenu},null,8,["onClick"]),l.createVNode(l.Transition,{name:"fade"},{default:l.withCtx(()=>[n.showControls?(l.openBlock(),l.createBlock(u,{key:0,modelValue:n.showControls,"onUpdate:modelValue":e[1]||(e[1]=m=>n.showControls=m),actions:n.menuActions,links:n.allowedActions,"links-background":"light-gray","onClick:link":n.onClickMobileMenuLink,"onClick:action":n.onClickMenu},null,8,["modelValue","actions","links","onClick:link","onClick:action"])):l.createCommentVNode("",!0)]),_:1})])):l.createCommentVNode("",!0)]),n.editMode?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass(["leading-normal text-sm",{"ml-12":n.showAvatar}])},[l.createElementVNode("p",null,l.toDisplayString(n.comment),1)],2)),n.editMode?(l.openBlock(),l.createElementBlock("div",eoe,[l.createVNode(f,{ref:"wysiwygRef",modelValue:n.editText,"onUpdate:modelValue":e[2]||(e[2]=m=>n.editText=m),"is-stacked":!0},{action:l.withCtx(()=>[l.createElementVNode("div",toe,[l.createVNode(d,{disabled:n.processing,status:"link",class:"!text-gray-40 mr-4 hover:!text-inkwell-0 hover:!no-underline",onClick:n.onClickCancel},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(n.$t("HC_CANCEL")),1)]),_:1},8,["disabled","onClick"]),l.createVNode(d,{disabled:n.processing,loading:n.processing,class:"text-xs hover:!text-blue-40 hover:!no-underline",status:"link",onClick:n.onClickSave},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(n.$t("HC_SAVE")),1)]),_:1},8,["disabled","loading","onClick"])])]),_:1},8,["modelValue"])])):(l.openBlock(),l.createElementBlock("div",noe,[n.attachments.length?(l.openBlock(),l.createBlock(h,{key:0,class:l.normalizeClass(["mt-3",{"ml-12":n.showAvatar}]),files:n.attachments,"show-remove":n.canDelete,"onClick:file":n.attachmentClickEvent,"onUpdate:modelValue":n.onClickDeleteAttachment},null,8,["class","files","show-remove","onClick:file","onUpdate:modelValue"])):l.createCommentVNode("",!0)])),l.createVNode(p,{id:"warning-modal",action:n.onClickDeleteConfirm,"onUpdate:action":e[3]||(e[3]=m=>n.onClickDeleteConfirm=m),toggle:n.warningModal,"onUpdate:toggle":[e[4]||(e[4]=m=>n.warningModal=m),e[5]||(e[5]=m=>n.warningModal=!1)],processing:n.processing},{desktopHeader:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(n.$t(n.warningType==="comment"?"HC_WARNING_CONFIRM_DELETE_COMMENT":"HC_ARE_YOU_SURE_DELETE_ATTACHMENT")),1)]),desktopMessage:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(n.$t(n.warningType==="comment"?"HC_CLICK_DELETE_COMMENT_NO_LONGER_SEE":"HC_CLICK_DELETE_ATTACHMENT_NO_LONGER_SEE")),1)]),mobileHeader:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(n.$t(n.warningType==="comment"?"HC_DELETE_COMMENT":"HC_ARE_YOU_SURE_DELETE_ATTACHMENT")),1)]),mobileMessage:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(n.$t(n.warningType==="comment"?"HC_WARNING_CONFIRM_DELETE_COMMENT":"HC_CLICK_DELETE_ATTACHMENT_NO_LONGER_SEE")),1)]),buttonText:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(n.$t(n.warningType==="comment"?"HC_DELETE_COMMENT":"HC_DELETE_ATTACHMENT")),1)]),_:1},8,["action","toggle","processing"])],10,Wie)):l.createCommentVNode("",!0)}const _I=ye(Zie,[["render",roe],["__scopeId","data-v-c6c6f953"]]),ioe=l.defineComponent({name:"QCommentSection",components:{QComment:_I,QWysiwyg:gw},props:{comments:{type:Array,default:()=>[]},allowAttachments:{type:Boolean,default:!1},allowEmojis:{type:Boolean,default:!1},allowFormatting:{type:Boolean,default:!1},addCommentEvent:{type:Function,default:()=>{}},filesAllowed:{type:String,default:"image/*,.pdf"},updateCommentEvent:{type:Function,default:()=>{}},placeholder:{type:String,default:""},processing:{type:Boolean,default:!1},showRemoveButton:{type:Object,default:()=>{}}},setup(n){const{t:e}=us(),t=l.ref([]),r=l.ref(""),i=l.ref(n.placeholder||e("HC_ADD_A_COMMENT")),o=l.ref(),s=async()=>{await n.addCommentEvent({text:r.value,attachments:t.value})},a=async(c,u)=>{await n.updateCommentEvent({comment:c,...u})};return l.watch(()=>n.processing,c=>{var u,d;c||(t.value=[],r.value="",o.value&&o.value.allowAttachments&&((d=(u=o.value.fileUploadRef)==null?void 0:u.fileUpload)==null||d.clear(),o.value.uploadedfiles=[]))}),{files:t,placeholderText:i,textareaValue:r,wysiwygRef:o,onClickPost:s,onUpdateComment:a}}}),ooe={class:"comment-section"},soe={key:0,class:"comments"},aoe={key:1,class:"no-comments text-center mb-6 mt-4"},loe={class:"text-md mb-2 leading-6 font-bold text-inkwell-30"},coe={class:"text-sm text-inkwell-0"};function uoe(n,e,t,r,i,o){const s=l.resolveComponent("q-comment"),a=l.resolveComponent("q-button"),c=l.resolveComponent("q-wysiwyg");return l.openBlock(),l.createElementBlock("div",ooe,[n.comments&&n.comments.length?(l.openBlock(),l.createElementBlock("div",soe,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(n.comments,(u,d)=>(l.openBlock(),l.createBlock(s,l.mergeProps(u,{key:d,"on-update-comment":f=>n.onUpdateComment(u,f)}),null,16,["on-update-comment"]))),128))])):(l.openBlock(),l.createElementBlock("div",aoe,[l.createElementVNode("h4",loe,l.toDisplayString(n.$t("HC_NO_COMMENTS_YET")),1),l.createElementVNode("p",coe,l.toDisplayString(n.$t("HC_START_THE_CONVERSATION")),1)])),l.renderSlot(n.$slots,"default",{},()=>[l.createVNode(c,{ref:"wysiwygRef",modelValue:n.textareaValue,"onUpdate:modelValue":[e[0]||(e[0]=u=>n.textareaValue=u),e[2]||(e[2]=u=>n.textareaValue=u)],attachments:n.files,"is-stacked":!0,"allow-attachments":n.allowAttachments,"allow-emojis":n.allowEmojis,"allow-formatting":n.allowFormatting,"files-allowed":n.filesAllowed,placeholder:n.placeholderText,processing:n.processing,"onUpdate:attachments":e[1]||(e[1]=u=>n.files=u)},{action:l.withCtx(()=>[l.createVNode(a,{loading:n.processing,disabled:n.processing||!n.files.length&&!n.textareaValue,status:"link",class:"hover:text-blue-40 hover:no-underline",onClick:n.onClickPost},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(n.$t("HC_POST")),1)]),_:1},8,["loading","disabled","onClick"])]),_:1},8,["modelValue","attachments","allow-attachments","allow-emojis","allow-formatting","files-allowed","placeholder","processing"])],!0)])}const doe=ye(ioe,[["render",uoe],["__scopeId","data-v-82ce0d39"]]),foe=l.defineComponent({name:"QCounter",props:{modelValue:{type:Number,default:0},min:{type:Number,default:0},max:{type:Number,default:100},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(n,{emit:e}){return{updateCount:r=>{let o=n.modelValue+r;return o>n.max?o=n.max:o<n.min&&(o=n.min),e("update:modelValue",o),o}}}}),hoe={class:"counter flex items-center"},poe={class:"grow text-center"};function moe(n,e,t,r,i,o){const s=l.resolveComponent("q-icon");return l.openBlock(),l.createElementBlock("div",hoe,[l.createVNode(s,l.mergeProps({icon:"minus-circle",type:"outline",size:"sm",color:"inkwell-30",class:"cursor-pointer mr-1"},{[l.toHandlerKey(!n.disabled&&"click")]:e[0]||(e[0]=a=>n.updateCount(-1))}),null,16),l.createElementVNode("span",poe,l.toDisplayString(n.modelValue),1),l.createVNode(s,l.mergeProps({icon:"circle-plus",type:"outline",size:"sm",color:"inkwell-30",class:"cursor-pointer ml-1"},{[l.toHandlerKey(!n.disabled&&"click")]:e[1]||(e[1]=a=>n.updateCount(1))}),null,16)])}const goe=ye(foe,[["render",moe]]);function LI(n){return n instanceof Date||Object.prototype.toString.call(n)==="[object Date]"}function Yg(n){return LI(n)?new Date(n.getTime()):n==null?new Date(NaN):new Date(n)}function yoe(n){return LI(n)&&!isNaN(n.getTime())}function BI(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;if(!(e>=0&&e<=6))throw new RangeError("weekStartsOn must be between 0 and 6");var t=Yg(n),r=t.getDay(),i=(r+7-e)%7;return t.setDate(t.getDate()-i),t.setHours(0,0,0,0),t}function RI(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=e.firstDayOfWeek,r=t===void 0?0:t,i=e.firstWeekContainsDate,o=i===void 0?1:i;if(!(o>=1&&o<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7");for(var s=Yg(n),a=s.getFullYear(),c=new Date(0),u=a+1;u>=a-1&&(c.setFullYear(u,0,o),c.setHours(0,0,0,0),c=BI(c,r),!(s.getTime()>=c.getTime()));u--);return c}function yw(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=e.firstDayOfWeek,r=t===void 0?0:t,i=e.firstWeekContainsDate,o=i===void 0?1:i,s=Yg(n),a=BI(s,r),c=RI(s,{firstDayOfWeek:r,firstWeekContainsDate:o}),u=a.getTime()-c.getTime();return Math.round(u/(7*24*3600*1e3))+1}var bw={months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],weekdaysMin:["Su","Mo","Tu","We","Th","Fr","Sa"],firstDayOfWeek:0,firstWeekContainsDate:1},boe=/\[([^\]]+)]|YYYY|YY?|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|m{1,2}|s{1,2}|Z{1,2}|S{1,3}|w{1,2}|x|X|a|A/g;function or(n){for(var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2,t="".concat(Math.abs(n)),r=n<0?"-":"";t.length<e;)t="0".concat(t);return r+t}function $I(n){return Math.round(n.getTimezoneOffset()/15)*15}function FI(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",t=n>0?"-":"+",r=Math.abs(n),i=Math.floor(r/60),o=r%60;return t+or(i,2)+e+or(o,2)}var VI=function(e,t,r){var i=e<12?"AM":"PM";return r?i.toLocaleLowerCase():i},hf={Y:function(e){var t=e.getFullYear();return t<=9999?"".concat(t):"+".concat(t)},YY:function(e){return or(e.getFullYear(),4).substr(2)},YYYY:function(e){return or(e.getFullYear(),4)},M:function(e){return e.getMonth()+1},MM:function(e){return or(e.getMonth()+1,2)},MMM:function(e,t){return t.monthsShort[e.getMonth()]},MMMM:function(e,t){return t.months[e.getMonth()]},D:function(e){return e.getDate()},DD:function(e){return or(e.getDate(),2)},H:function(e){return e.getHours()},HH:function(e){return or(e.getHours(),2)},h:function(e){var t=e.getHours();return t===0?12:t>12?t%12:t},hh:function(){var e=hf.h.apply(hf,arguments);return or(e,2)},m:function(e){return e.getMinutes()},mm:function(e){return or(e.getMinutes(),2)},s:function(e){return e.getSeconds()},ss:function(e){return or(e.getSeconds(),2)},S:function(e){return Math.floor(e.getMilliseconds()/100)},SS:function(e){return or(Math.floor(e.getMilliseconds()/10),2)},SSS:function(e){return or(e.getMilliseconds(),3)},d:function(e){return e.getDay()},dd:function(e,t){return t.weekdaysMin[e.getDay()]},ddd:function(e,t){return t.weekdaysShort[e.getDay()]},dddd:function(e,t){return t.weekdays[e.getDay()]},A:function(e,t){var r=t.meridiem||VI;return r(e.getHours(),e.getMinutes(),!1)},a:function(e,t){var r=t.meridiem||VI;return r(e.getHours(),e.getMinutes(),!0)},Z:function(e){return FI($I(e),":")},ZZ:function(e){return FI($I(e))},X:function(e){return Math.floor(e.getTime()/1e3)},x:function(e){return e.getTime()},w:function(e,t){return yw(e,{firstDayOfWeek:t.firstDayOfWeek,firstWeekContainsDate:t.firstWeekContainsDate})},ww:function(e,t){return or(hf.w(e,t),2)}};function ww(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=e?String(e):"YYYY-MM-DDTHH:mm:ss.SSSZ",i=Yg(n);if(!yoe(i))return"Invalid Date";var o=t.locale||bw;return r.replace(boe,function(s,a){return a||(typeof hf[s]=="function"?"".concat(hf[s](i,o)):s)})}function jI(n){return Coe(n)||voe(n)||woe()}function woe(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function voe(n){if(Symbol.iterator in Object(n)||Object.prototype.toString.call(n)==="[object Arguments]")return Array.from(n)}function Coe(n){if(Array.isArray(n)){for(var e=0,t=new Array(n.length);e<n.length;e++)t[e]=n[e];return t}}function zI(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function koe(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?zI(t,!0).forEach(function(r){Vs(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):zI(t).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Soe(n,e){return Aoe(n)||Eoe(n,e)||Moe()}function Moe(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}function Eoe(n,e){if(Symbol.iterator in Object(n)||Object.prototype.toString.call(n)==="[object Arguments]"){var t=[],r=!0,i=!1,o=void 0;try{for(var s=n[Symbol.iterator](),a;!(r=(a=s.next()).done)&&(t.push(a.value),!(e&&t.length===e));r=!0);}catch(c){i=!0,o=c}finally{try{!r&&s.return!=null&&s.return()}finally{if(i)throw o}}return t}}function Aoe(n){if(Array.isArray(n))return n}function Vs(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}var Toe=/(\[[^\[]*\])|(MM?M?M?|Do|DD?|ddd?d?|w[o|w]?|YYYY|YY|a|A|hh?|HH?|mm?|ss?|S{1,3}|x|X|ZZ?|.)/g,HI=/\d/,js=/\d\d/,xoe=/\d{3}/,Ioe=/\d{4}/,Bc=/\d\d?/,Ooe=/[+-]\d\d:?\d\d/,UI=/[+-]?\d+/,Doe=/[+-]?\d+(\.\d{1,3})?/,vw="year",Qg="month",ZI="day",WI="hour",KI="minute",qI="second",Cw="millisecond",GI={},Ke=function(e,t,r){var i=Array.isArray(e)?e:[e],o;typeof r=="string"?o=function(a){var c=parseInt(a,10);return Vs({},r,c)}:o=r,i.forEach(function(s){GI[s]=[t,o]})},Noe=function(e){return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&")},pf=function(e){return function(t){var r=t[e];if(!Array.isArray(r))throw new Error("Locale[".concat(e,"] need an array"));return new RegExp(r.map(Noe).join("|"))}},mf=function(e,t){return function(r,i){var o=i[e];if(!Array.isArray(o))throw new Error("Locale[".concat(e,"] need an array"));var s=o.indexOf(r);if(s<0)throw new Error("Invalid Word");return Vs({},t,s)}};Ke("Y",UI,vw),Ke("YY",js,function(n){var e=new Date().getFullYear(),t=Math.floor(e/100),r=parseInt(n,10);return r=(r>68?t-1:t)*100+r,Vs({},vw,r)}),Ke("YYYY",Ioe,vw),Ke("M",Bc,function(n){return Vs({},Qg,parseInt(n,10)-1)}),Ke("MM",js,function(n){return Vs({},Qg,parseInt(n,10)-1)}),Ke("MMM",pf("monthsShort"),mf("monthsShort",Qg)),Ke("MMMM",pf("months"),mf("months",Qg)),Ke("D",Bc,ZI),Ke("DD",js,ZI),Ke(["H","h"],Bc,WI),Ke(["HH","hh"],js,WI),Ke("m",Bc,KI),Ke("mm",js,KI),Ke("s",Bc,qI),Ke("ss",js,qI),Ke("S",HI,function(n){return Vs({},Cw,parseInt(n,10)*100)}),Ke("SS",js,function(n){return Vs({},Cw,parseInt(n,10)*10)}),Ke("SSS",xoe,Cw);function Poe(n){return n.meridiemParse||/[ap]\.?m?\.?/i}function _oe(n){return"".concat(n).toLowerCase().charAt(0)==="p"}Ke(["A","a"],Poe,function(n,e){var t=typeof e.isPM=="function"?e.isPM(n):_oe(n);return{isPM:t}});function Loe(n){var e=n.match(/([+-]|\d\d)/g)||["-","0","0"],t=Soe(e,3),r=t[0],i=t[1],o=t[2],s=parseInt(i,10)*60+parseInt(o,10);return s===0?0:r==="+"?-s:+s}Ke(["Z","ZZ"],Ooe,function(n){return{offset:Loe(n)}}),Ke("x",UI,function(n){return{date:new Date(parseInt(n,10))}}),Ke("X",Doe,function(n){return{date:new Date(parseFloat(n)*1e3)}}),Ke("d",HI,"weekday"),Ke("dd",pf("weekdaysMin"),mf("weekdaysMin","weekday")),Ke("ddd",pf("weekdaysShort"),mf("weekdaysShort","weekday")),Ke("dddd",pf("weekdays"),mf("weekdays","weekday")),Ke("w",Bc,"week"),Ke("ww",js,"week");function Boe(n,e){if(n!==void 0&&e!==void 0){if(e){if(n<12)return n+12}else if(n===12)return 0}return n}function Roe(n){for(var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:new Date,t=[0,0,1,0,0,0,0],r=[e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()],i=!0,o=0;o<7;o++)n[o]===void 0?t[o]=i?r[o]:t[o]:(t[o]=n[o],i=!1);return t}function $oe(n,e,t,r,i,o,s){var a;return n<100&&n>=0?(a=new Date(n+400,e,t,r,i,o,s),isFinite(a.getFullYear())&&a.setFullYear(n)):a=new Date(n,e,t,r,i,o,s),a}function Foe(){for(var n,e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var i=t[0];return i<100&&i>=0?(t[0]+=400,n=new Date(Date.UTC.apply(Date,t)),isFinite(n.getUTCFullYear())&&n.setUTCFullYear(i)):n=new Date(Date.UTC.apply(Date,t)),n}function Voe(n,e,t){var r=e.match(Toe);if(!r)throw new Error;for(var i=r.length,o={},s=0;s<i;s+=1){var a=r[s],c=GI[a];if(c){var d=typeof c[0]=="function"?c[0](t):c[0],f=c[1],h=(d.exec(n)||[])[0],p=f(h,t);o=koe({},o,{},p),n=n.replace(h,"")}else{var u=a.replace(/^\[|\]$/g,"");if(n.indexOf(u)===0)n=n.substr(u.length);else throw new Error("not match")}}return o}function joe(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};try{var r=t.locale,i=r===void 0?bw:r,o=t.backupDate,s=o===void 0?new Date:o,a=Voe(n,e,i),c=a.year,u=a.month,d=a.day,f=a.hour,h=a.minute,p=a.second,m=a.millisecond,y=a.isPM,b=a.date,w=a.offset,v=a.weekday,k=a.week;if(b)return b;var C=[c,u,d,f,h,p,m];if(C[3]=Boe(C[3],y),k!==void 0&&u===void 0&&d===void 0){var T=RI(c===void 0?s:new Date(c,3),{firstDayOfWeek:i.firstDayOfWeek,firstWeekContainsDate:i.firstWeekContainsDate});return new Date(T.getTime()+(k-1)*7*24*3600*1e3)}var S,A=Roe(C,s);return w!==void 0?(A[6]+=w*60*1e3,S=Foe.apply(void 0,jI(A))):S=$oe.apply(void 0,jI(A)),v!==void 0&&S.getDay()!==v?new Date(NaN):S}catch{return new Date(NaN)}}var zoe=Object.defineProperty,Hoe=Object.defineProperties,Uoe=Object.getOwnPropertyDescriptors,Xg=Object.getOwnPropertySymbols,YI=Object.prototype.hasOwnProperty,QI=Object.prototype.propertyIsEnumerable,XI=(n,e,t)=>e in n?zoe(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Vt=(n,e)=>{for(var t in e||(e={}))YI.call(e,t)&&XI(n,t,e[t]);if(Xg)for(var t of Xg(e))QI.call(e,t)&&XI(n,t,e[t]);return n},Or=(n,e)=>Hoe(n,Uoe(e)),Zoe=(n,e)=>{var t={};for(var r in n)YI.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&Xg)for(var r of Xg(n))e.indexOf(r)<0&&QI.call(n,r)&&(t[r]=n[r]);return t};const Woe={formatLocale:bw,yearFormat:"YYYY",monthFormat:"MMM",monthBeforeYear:!0};let gf="en";const Rc={};Rc[gf]=Woe;function JI(n,e,t=!1){if(typeof n!="string")return Rc[gf];let r=gf;return Rc[n]&&(r=n),e&&(Rc[n]=e,r=n),t||(gf=r),Rc[n]||Rc[gf]}function kw(n){return JI(n,void 0,!0)}function Sw(n,e){if(!Array.isArray(n))return[];const t=[],r=n.length;let i=0;for(e=e||r;i<r;)t.push(n.slice(i,i+=e));return t}function eO(n){return Array.isArray(n)?n[n.length-1]:void 0}function zs(n){return Object.prototype.toString.call(n)==="[object Object]"}function wo(n,e){const t={};return zs(n)&&(Array.isArray(e)||(e=[e]),e.forEach(r=>{Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])})),t}function tO(n,e){if(!zs(n))return{};let t=n;return zs(e)&&Object.keys(e).forEach(r=>{let i=e[r];const o=n[r];zs(i)&&zs(o)&&(i=tO(o,i)),t=Or(Vt({},t),{[r]:i})}),t}function Mw(n){const e=parseInt(String(n),10);return e<10?`0${e}`:`${e}`}function Koe(n){const e=/-(\w)/g;return n.replace(e,(t,r)=>r?r.toUpperCase():"")}const nO="datepicker_locale",rO="datepicker_prefixClass",iO="datepicker_getWeek";function Ew(){return l.inject(nO,l.shallowRef(kw()))}function qoe(n){const e=l.computed(()=>zs(n.value)?tO(kw(),n.value):kw(n.value));return l.provide(nO,e),e}function Goe(n){l.provide(rO,n)}function Mn(){return l.inject(rO,"mx")}function Yoe(n){l.provide(iO,n)}function Qoe(){return l.inject(iO,yw)}function Xoe(n){const e=n.style.display,t=n.style.visibility;n.style.display="block",n.style.visibility="hidden";const r=window.getComputedStyle(n),i=n.offsetWidth+parseInt(r.marginLeft,10)+parseInt(r.marginRight,10),o=n.offsetHeight+parseInt(r.marginTop,10)+parseInt(r.marginBottom,10);return n.style.display=e,n.style.visibility=t,{width:i,height:o}}function Joe(n,e,t,r){let i=0,o=0,s=0,a=0;const c=n.getBoundingClientRect(),u=document.documentElement.clientWidth,d=document.documentElement.clientHeight;return r&&(s=window.pageXOffset+c.left,a=window.pageYOffset+c.top),u-c.left<e&&c.right<e?i=s-c.left+1:c.left+c.width/2<=u/2?i=s:i=s+c.width-e,c.top<=t&&d-c.bottom<=t?o=a+d-c.top-t:c.top+c.height/2<=d/2?o=a+c.height:o=a-t,{left:`${i}px`,top:`${o}px`}}function Aw(n,e=document.body){if(!n||n===e)return null;const t=(o,s)=>getComputedStyle(o,null).getPropertyValue(s);return/(auto|scroll)/.test(t(n,"overflow")+t(n,"overflow-y")+t(n,"overflow-x"))?n:Aw(n.parentElement,e)}let Jg;function ese(){if(typeof window>"u")return 0;if(Jg!==void 0)return Jg;const n=document.createElement("div");n.style.visibility="hidden",n.style.overflow="scroll",n.style.width="100px",n.style.position="absolute",n.style.top="-9999px",document.body.appendChild(n);const e=document.createElement("div");return e.style.width="100%",n.appendChild(e),Jg=n.offsetWidth-e.offsetWidth,n.parentNode.removeChild(n),Jg}const oO="ontouchend"in document?"touchstart":"mousedown";function tse(n){let e=!1;return function(...r){e||(e=!0,requestAnimationFrame(()=>{e=!1,n.apply(this,r)}))}}function vo(n,e){return{setup:n,name:n.name,props:e}}function Co(n,e){return new Proxy(n,{get(r,i){const o=r[i];return o!==void 0?o:e[i]}})}const Hs=()=>n=>n,nse=(n,e)=>{const t={};for(const r in n)if(Object.prototype.hasOwnProperty.call(n,r)){const i=Koe(r);let o=n[r];e.indexOf(i)!==-1&&o===""&&(o=!0),t[i]=o}return t};function rse(n,{slots:e}){const t=Co(n,{appendToBody:!0}),r=Mn(),i=l.ref(null),o=l.ref({left:"",top:""}),s=()=>{if(!t.visible||!i.value)return;const c=t.getRelativeElement();if(!c)return;const{width:u,height:d}=Xoe(i.value);o.value=Joe(c,u,d,t.appendToBody)};l.watchEffect(s,{flush:"post"}),l.watchEffect(c=>{const u=t.getRelativeElement();if(!u)return;const d=Aw(u)||window,f=tse(s);d.addEventListener("scroll",f),window.addEventListener("resize",f),c(()=>{d.removeEventListener("scroll",f),window.removeEventListener("resize",f)})},{flush:"post"});const a=c=>{if(!t.visible)return;const u=c.target,d=i.value,f=t.getRelativeElement();d&&!d.contains(u)&&f&&!f.contains(u)&&t.onClickOutside(c)};return l.watchEffect(c=>{document.addEventListener(oO,a),c(()=>{document.removeEventListener(oO,a)})}),()=>l.createVNode(l.Teleport,{to:"body",disabled:!t.appendToBody},{default:()=>[l.createVNode(l.Transition,{name:`${r}-zoom-in-down`},{default:()=>{var c;return[t.visible&&l.createVNode("div",{ref:i,class:`${r}-datepicker-main ${r}-datepicker-popup ${t.className}`,style:[Vt({position:"absolute"},o.value),t.style||{}]},[(c=e.default)==null?void 0:c.call(e)])]}})]})}const ise=Hs()(["style","className","visible","appendToBody","onClickOutside","getRelativeElement"]);var ose=vo(rse,ise);const sse={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",width:"1em",height:"1em"},ase=[l.createElementVNode("path",{d:"M940.218 107.055H730.764v-60.51H665.6v60.51H363.055v-60.51H297.89v60.51H83.78c-18.617 0-32.581 13.963-32.581 32.581v805.237c0 18.618 13.964 32.582 32.582 32.582h861.09c18.619 0 32.583-13.964 32.583-32.582V139.636c-4.655-18.618-18.619-32.581-37.237-32.581zm-642.327 65.163v60.51h65.164v-60.51h307.2v60.51h65.163v-60.51h176.873v204.8H116.364v-204.8H297.89zM116.364 912.291V442.18H912.29v470.11H116.364z"},null,-1)];function sO(n,e){return l.openBlock(),l.createElementBlock("svg",sse,ase)}const lse={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",width:"1em",height:"1em"},cse=[l.createElementVNode("path",{d:"M810.005 274.005 572.011 512l237.994 237.995-60.01 60.01L512 572.011 274.005 810.005l-60.01-60.01L451.989 512 213.995 274.005l60.01-60.01L512 451.989l237.995-237.994z"},null,-1)];function use(n,e){return l.openBlock(),l.createElementBlock("svg",lse,cse)}const dse={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"1em",height:"1em"},fse=[l.createElementVNode("path",{d:"M0 0h24v24H0z",fill:"none"},null,-1),l.createElementVNode("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"},null,-1),l.createElementVNode("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"},null,-1)];function hse(n,e){return l.openBlock(),l.createElementBlock("svg",dse,fse)}function bl(n,e=0,t=1,r=0,i=0,o=0,s=0){const a=new Date(n,e,t,r,i,o,s);return n<100&&n>=0&&a.setFullYear(n),a}function ko(n){return n instanceof Date&&!isNaN(n.getTime())}function wl(n){return Array.isArray(n)&&n.length===2&&n.every(ko)&&n[0]<=n[1]}function pse(n){return Array.isArray(n)&&n.every(ko)}function e3(...n){if(n[0]!==void 0&&n[0]!==null){const t=new Date(n[0]);if(ko(t))return t}const e=n.slice(1);return e.length?e3(...e):new Date}function mse(n){const e=new Date(n);return e.setMonth(0,1),e.setHours(0,0,0,0),e}function aO(n){const e=new Date(n);return e.setDate(1),e.setHours(0,0,0,0),e}function Us(n){const e=new Date(n);return e.setHours(0,0,0,0),e}function gse({firstDayOfWeek:n,year:e,month:t}){const r=[],i=bl(e,t,0),o=i.getDate(),s=o-(i.getDay()+7-n)%7;for(let d=s;d<=o;d++)r.push(bl(e,t,d-o));i.setMonth(t+1,0);const a=i.getDate();for(let d=1;d<=a;d++)r.push(bl(e,t,d));const c=o-s+1,u=6*7-c-a;for(let d=1;d<=u;d++)r.push(bl(e,t,a+d));return r}function t3(n,e){const t=new Date(n),r=typeof e=="function"?e(t.getMonth()):Number(e),i=t.getFullYear(),o=bl(i,r+1,0).getDate(),s=t.getDate();return t.setMonth(r,Math.min(s,o)),t}function $c(n,e){const t=new Date(n),r=typeof e=="function"?e(t.getFullYear()):e;return t.setFullYear(r),t}function yse(n,e){const t=new Date(e),r=new Date(n),i=t.getFullYear()-r.getFullYear(),o=t.getMonth()-r.getMonth();return i*12+o}function n3(n,e){const t=new Date(n),r=new Date(e);return t.setHours(r.getHours(),r.getMinutes(),r.getSeconds()),t}function bse(n,{slots:e}){const t=Co(n,{editable:!0,disabled:!1,clearable:!0,range:!1,multiple:!1}),r=Mn(),i=l.ref(null),o=l.computed(()=>t.separator||(t.range?" ~ ":",")),s=p=>t.range?wl(p):t.multiple?pse(p):ko(p),a=p=>Array.isArray(p)?p.some(m=>t.disabledDate(m)):t.disabledDate(p),c=l.computed(()=>i.value!==null?i.value:typeof t.renderInputText=="function"?t.renderInputText(t.value):s(t.value)?Array.isArray(t.value)?t.value.map(p=>t.formatDate(p)).join(o.value):t.formatDate(t.value):""),u=p=>{var m;p&&p.stopPropagation(),t.onChange(t.range?[null,null]:null),(m=t.onClear)==null||m.call(t)},d=()=>{var p;if(!t.editable||i.value===null)return;const m=i.value.trim();if(i.value=null,m===""){u();return}let y;if(t.range){let b=m.split(o.value);b.length!==2&&(b=m.split(o.value.trim())),y=b.map(w=>t.parseDate(w.trim()))}else t.multiple?y=m.split(o.value).map(b=>t.parseDate(b.trim())):y=t.parseDate(m);s(y)&&!a(y)?t.onChange(y):(p=t.onInputError)==null||p.call(t,m)},f=p=>{i.value=typeof p=="string"?p:p.target.value},h=p=>{const{keyCode:m}=p;m===9?t.onBlur():m===13&&d()};return()=>{var p,m,y;const b=!t.disabled&&t.clearable&&c.value,w=Or(Vt({name:"date",type:"text",autocomplete:"off",value:c.value,class:t.inputClass||`${r}-input`,readonly:!t.editable,disabled:t.disabled,placeholder:t.placeholder},t.inputAttr),{onFocus:t.onFocus,onKeydown:h,onInput:f,onChange:d});return l.createVNode("div",{class:`${r}-input-wrapper`,onClick:t.onClick},[((p=e.input)==null?void 0:p.call(e,w))||l.createVNode("input",w,null),b?l.createVNode("i",{class:`${r}-icon-clear`,onClick:u},[((m=e["icon-clear"])==null?void 0:m.call(e))||l.createVNode(use,null,null)]):null,l.createVNode("i",{class:`${r}-icon-calendar`},[((y=e["icon-calendar"])==null?void 0:y.call(e))||l.createVNode(sO,null,null)])])}}const Tw=Hs()(["placeholder","editable","disabled","clearable","inputClass","inputAttr","range","multiple","separator","renderInputText","onInputError","onClear"]),wse=Hs()(["value","formatDate","parseDate","disabledDate","onChange","onFocus","onBlur","onClick",...Tw]);var vse=vo(bse,wse);function Cse(n,{slots:e}){var t;const r=Co(n,{prefixClass:"mx",valueType:"date",format:"YYYY-MM-DD",type:"date",disabledDate:()=>!1,disabledTime:()=>!1,confirmText:"OK"});Goe(r.prefixClass),Yoe(((t=r.formatter)==null?void 0:t.getWeek)||yw);const i=qoe(l.toRef(n,"lang")),o=l.ref(),s=()=>o.value,a=l.ref(!1),c=l.computed(()=>!r.disabled&&(typeof r.open=="boolean"?r.open:a.value)),u=()=>{var S,A;r.disabled||c.value||(a.value=!0,(S=r["onUpdate:open"])==null||S.call(r,!0),(A=r.onOpen)==null||A.call(r))},d=()=>{var S,A;c.value&&(a.value=!1,(S=r["onUpdate:open"])==null||S.call(r,!1),(A=r.onClose)==null||A.call(r))},f=(S,A)=>(A=A||r.format,zs(r.formatter)&&typeof r.formatter.stringify=="function"?r.formatter.stringify(S,A):ww(S,A,{locale:i.value.formatLocale})),h=(S,A)=>{if(A=A||r.format,zs(r.formatter)&&typeof r.formatter.parse=="function")return r.formatter.parse(S,A);const O=new Date;return joe(S,A,{locale:i.value.formatLocale,backupDate:O})},p=S=>{switch(r.valueType){case"date":return S instanceof Date?new Date(S.getTime()):new Date(NaN);case"timestamp":return typeof S=="number"?new Date(S):new Date(NaN);case"format":return typeof S=="string"?h(S):new Date(NaN);default:return typeof S=="string"?h(S,r.valueType):new Date(NaN)}},m=S=>{if(!ko(S))return null;switch(r.valueType){case"date":return S;case"timestamp":return S.getTime();case"format":return f(S);default:return f(S,r.valueType)}},y=l.computed(()=>{const S=r.value;return r.range?(Array.isArray(S)?S.slice(0,2):[null,null]).map(p):r.multiple?(Array.isArray(S)?S:[]).map(p):p(S)}),b=(S,A,O=!0)=>{var I,P;const D=Array.isArray(S)?S.map(m):m(S);return(I=r["onUpdate:value"])==null||I.call(r,D),(P=r.onChange)==null||P.call(r,D,A),O&&d(),D},w=l.ref(new Date);l.watchEffect(()=>{c.value&&(w.value=y.value)});const v=(S,A)=>{r.confirm?w.value=S:b(S,A,!r.multiple&&(A===r.type||A==="time"))},k=()=>{var S;const A=b(w.value);(S=r.onConfirm)==null||S.call(r,A)},C=S=>r.disabledDate(S)||r.disabledTime(S),T=S=>{var A;const{prefixClass:O}=r;return l.createVNode("div",{class:`${O}-datepicker-sidebar`},[(A=e.sidebar)==null?void 0:A.call(e,S),(r.shortcuts||[]).map((I,P)=>l.createVNode("button",{key:P,"data-index":P,type:"button",class:`${O}-btn ${O}-btn-text ${O}-btn-shortcut`,onClick:()=>{var D;const _=(D=I.onClick)==null?void 0:D.call(I);_&&b(_)}},[I.text]))])};return()=>{var S,A;const{prefixClass:O,disabled:I,confirm:P,range:D,popupClass:_,popupStyle:B,appendToBody:F}=r,R={value:w.value,"onUpdate:value":v,emit:b},N=e.header&&l.createVNode("div",{class:`${O}-datepicker-header`},[e.header(R)]),W=(e.footer||P)&&l.createVNode("div",{class:`${O}-datepicker-footer`},[(S=e.footer)==null?void 0:S.call(e,R),P&&l.createVNode("button",{type:"button",class:`${O}-btn ${O}-datepicker-btn-confirm`,onClick:k},[r.confirmText])]),V=(A=e.content)==null?void 0:A.call(e,R),Y=(e.sidebar||r.shortcuts)&&T(R);return l.createVNode("div",{ref:o,class:{[`${O}-datepicker`]:!0,[`${O}-datepicker-range`]:D,disabled:I}},[l.createVNode(vse,Or(Vt({},wo(r,Tw)),{value:y.value,formatDate:f,parseDate:h,disabledDate:C,onChange:b,onClick:u,onFocus:u,onBlur:d}),wo(e,["icon-calendar","icon-clear","input"])),l.createVNode(ose,{className:_,style:B,visible:c.value,appendToBody:F,getRelativeElement:s,onClickOutside:d},{default:()=>[Y,l.createVNode("div",{class:`${O}-datepicker-content`},[N,V,W])]})])}}const kse=[...Hs()(["value","valueType","type","format","formatter","lang","prefixClass","appendToBody","open","popupClass","popupStyle","confirm","confirmText","shortcuts","disabledDate","disabledTime","onOpen","onClose","onConfirm","onChange","onUpdate:open","onUpdate:value"]),...Tw];var lO=vo(Cse,kse);function r3(n){var e=n,{value:t}=e,r=Zoe(e,["value"]);const i=Mn();return l.createVNode("button",Or(Vt({},r),{type:"button",class:`${i}-btn ${i}-btn-text ${i}-btn-icon-${t}`}),[l.createVNode("i",{class:`${i}-icon-${t}`},null)])}function xw({type:n,calendar:e,onUpdateCalendar:t},{slots:r}){var i;const o=Mn(),s=()=>{t(t3(e,h=>h-1))},a=()=>{t(t3(e,h=>h+1))},c=()=>{t($c(e,h=>h-1))},u=()=>{t($c(e,h=>h+1))},d=()=>{t($c(e,h=>h-10))},f=()=>{t($c(e,h=>h+10))};return l.createVNode("div",{class:`${o}-calendar-header`},[l.createVNode(r3,{value:"double-left",onClick:n==="year"?d:c},null),n==="date"&&l.createVNode(r3,{value:"left",onClick:s},null),l.createVNode(r3,{value:"double-right",onClick:n==="year"?f:u},null),n==="date"&&l.createVNode(r3,{value:"right",onClick:a},null),l.createVNode("span",{class:`${o}-calendar-header-label`},[(i=r.default)==null?void 0:i.call(r)])])}function Sse({calendar:n,isWeekMode:e,showWeekNumber:t,titleFormat:r,getWeekActive:i,getCellClasses:o,onSelect:s,onUpdatePanel:a,onUpdateCalendar:c,onDateMouseEnter:u,onDateMouseLeave:d}){const f=Mn(),h=Qoe(),p=Ew().value,{yearFormat:m,monthBeforeYear:y,monthFormat:b="MMM",formatLocale:w}=p,v=w.firstDayOfWeek||0;let k=p.days||w.weekdaysMin;k=k.concat(k).slice(v,v+7);const C=n.getFullYear(),T=n.getMonth(),S=Sw(gse({firstDayOfWeek:v,year:C,month:T}),7),A=(R,N)=>ww(R,N,{locale:p.formatLocale}),O=R=>{a(R)},I=R=>{const N=R.getAttribute("data-index"),[W,V]=N.split(",").map(ue=>parseInt(ue,10)),Y=S[W][V];return new Date(Y)},P=R=>{s(I(R.currentTarget))},D=R=>{u&&u(I(R.currentTarget))},_=R=>{d&&d(I(R.currentTarget))},B=l.createVNode("button",{type:"button",class:`${f}-btn ${f}-btn-text ${f}-btn-current-year`,onClick:()=>O("year")},[A(n,m)]),F=l.createVNode("button",{type:"button",class:`${f}-btn ${f}-btn-text ${f}-btn-current-month`,onClick:()=>O("month")},[A(n,b)]);return t=typeof t=="boolean"?t:e,l.createVNode("div",{class:[`${f}-calendar ${f}-calendar-panel-date`,{[`${f}-calendar-week-mode`]:e}]},[l.createVNode(xw,{type:"date",calendar:n,onUpdateCalendar:c},{default:()=>[y?[F,B]:[B,F]]}),l.createVNode("div",{class:`${f}-calendar-content`},[l.createVNode("table",{class:`${f}-table ${f}-table-date`},[l.createVNode("thead",null,[l.createVNode("tr",null,[t&&l.createVNode("th",{class:`${f}-week-number-header`},null),k.map(R=>l.createVNode("th",{key:R},[R]))])]),l.createVNode("tbody",null,[S.map((R,N)=>l.createVNode("tr",{key:N,class:[`${f}-date-row`,{[`${f}-active-week`]:i(R)}]},[t&&l.createVNode("td",{class:`${f}-week-number`,"data-index":`${N},0`,onClick:P},[l.createVNode("div",null,[h(R[0])])]),R.map((W,V)=>l.createVNode("td",{key:V,class:["cell",o(W)],title:A(W,r),"data-index":`${N},${V}`,onClick:P,onMouseenter:D,onMouseleave:_},[l.createVNode("div",null,[W.getDate()])]))]))])])])])}function Mse({calendar:n,getCellClasses:e,onSelect:t,onUpdateCalendar:r,onUpdatePanel:i}){const o=Mn(),s=Ew().value,a=s.months||s.formatLocale.monthsShort,c=d=>bl(n.getFullYear(),d),u=d=>{const h=d.currentTarget.getAttribute("data-month");t(c(parseInt(h,10)))};return l.createVNode("div",{class:`${o}-calendar ${o}-calendar-panel-month`},[l.createVNode(xw,{type:"month",calendar:n,onUpdateCalendar:r},{default:()=>[l.createVNode("button",{type:"button",class:`${o}-btn ${o}-btn-text ${o}-btn-current-year`,onClick:()=>i("year")},[n.getFullYear()])]}),l.createVNode("div",{class:`${o}-calendar-content`},[l.createVNode("table",{class:`${o}-table ${o}-table-month`},[Sw(a,3).map((d,f)=>l.createVNode("tr",{key:f},[d.map((h,p)=>{const m=f*3+p;return l.createVNode("td",{key:p,class:["cell",e(c(m))],"data-month":m,onClick:u},[l.createVNode("div",null,[h])])})]))])])])}const Ese=n=>{const e=Math.floor(n.getFullYear()/10)*10,t=[];for(let r=0;r<10;r++)t.push(e+r);return Sw(t,2)};function Ase({calendar:n,getCellClasses:e=()=>[],getYearPanel:t=Ese,onSelect:r,onUpdateCalendar:i}){const o=Mn(),s=f=>bl(f,0),a=f=>{const p=f.currentTarget.getAttribute("data-year");r(s(parseInt(p,10)))},c=t(new Date(n)),u=c[0][0],d=eO(eO(c));return l.createVNode("div",{class:`${o}-calendar ${o}-calendar-panel-year`},[l.createVNode(xw,{type:"year",calendar:n,onUpdateCalendar:i},{default:()=>[l.createVNode("span",null,[u]),l.createVNode("span",{class:`${o}-calendar-decade-separator`},null),l.createVNode("span",null,[d])]}),l.createVNode("div",{class:`${o}-calendar-content`},[l.createVNode("table",{class:`${o}-table ${o}-table-year`},[c.map((f,h)=>l.createVNode("tr",{key:h},[f.map((p,m)=>l.createVNode("td",{key:m,class:["cell",e(s(p))],"data-year":p,onClick:a},[l.createVNode("div",null,[p])]))]))])])])}function Tse(n){const e=Co(n,{defaultValue:Us(new Date),type:"date",disabledDate:()=>!1,getClasses:()=>[],titleFormat:"YYYY-MM-DD"}),t=l.computed(()=>(Array.isArray(e.value)?e.value:[e.value]).filter(ko).map(v=>e.type==="year"?mse(v):e.type==="month"?aO(v):Us(v))),r=l.ref(new Date);l.watchEffect(()=>{let w=e.calendar;if(!ko(w)){const{length:v}=t.value;w=e3(v>0?t.value[v-1]:e.defaultValue)}r.value=aO(w)});const i=w=>{var v;r.value=w,(v=e.onCalendarChange)==null||v.call(e,w)},o=l.ref("date");l.watchEffect(()=>{const w=["date","month","year"],v=Math.max(w.indexOf(e.type),w.indexOf(e.defaultPanel));o.value=v!==-1?w[v]:"date"});const s=w=>{var v;const k=o.value;o.value=w,(v=e.onPanelChange)==null||v.call(e,w,k)},a=w=>e.disabledDate(new Date(w),t.value),c=(w,v)=>{var k,C,T;if(!a(w))if((k=e.onPick)==null||k.call(e,w),e.multiple===!0){const S=t.value.filter(A=>A.getTime()!==w.getTime());S.length===t.value.length&&S.push(w),(C=e["onUpdate:value"])==null||C.call(e,S,v)}else(T=e["onUpdate:value"])==null||T.call(e,w,v)},u=w=>{c(w,e.type==="week"?"week":"date")},d=w=>{if(e.type==="year")c(w,"year");else if(i(w),s("month"),e.partialUpdate&&t.value.length===1){const v=$c(t.value[0],w.getFullYear());c(v,"year")}},f=w=>{if(e.type==="month")c(w,"month");else if(i(w),s("date"),e.partialUpdate&&t.value.length===1){const v=t3($c(t.value[0],w.getFullYear()),w.getMonth());c(v,"month")}},h=(w,v=[])=>(a(w)?v.push("disabled"):t.value.some(k=>k.getTime()===w.getTime())&&v.push("active"),v.concat(e.getClasses(w,t.value,v.join(" ")))),p=w=>{const v=w.getMonth()!==r.value.getMonth(),k=[];return w.getTime()===new Date().setHours(0,0,0,0)&&k.push("today"),v&&k.push("not-current-month"),h(w,k)},m=w=>e.type!=="month"?r.value.getMonth()===w.getMonth()?"active":"":h(w),y=w=>e.type!=="year"?r.value.getFullYear()===w.getFullYear()?"active":"":h(w),b=w=>{if(e.type!=="week")return!1;const v=w[0].getTime(),k=w[6].getTime();return t.value.some(C=>{const T=C.getTime();return T>=v&&T<=k})};return()=>o.value==="year"?l.createVNode(Ase,{calendar:r.value,getCellClasses:y,getYearPanel:e.getYearPanel,onSelect:d,onUpdateCalendar:i},null):o.value==="month"?l.createVNode(Mse,{calendar:r.value,getCellClasses:m,onSelect:f,onUpdatePanel:s,onUpdateCalendar:i},null):l.createVNode(Sse,{isWeekMode:e.type==="week",showWeekNumber:e.showWeekNumber,titleFormat:e.titleFormat,calendar:r.value,getCellClasses:p,getWeekActive:b,onSelect:u,onUpdatePanel:s,onUpdateCalendar:i,onDateMouseEnter:e.onDateMouseEnter,onDateMouseLeave:e.onDateMouseLeave},null)}const i3=Hs()(["type","value","defaultValue","defaultPanel","disabledDate","getClasses","calendar","multiple","partialUpdate","showWeekNumber","titleFormat","getYearPanel","onDateMouseEnter","onDateMouseLeave","onCalendarChange","onPanelChange","onUpdate:value","onPick"]);var o3=vo(Tse,i3);const cO=(n,e)=>{const t=n.getTime();let[r,i]=e.map(o=>o.getTime());return r>i&&([r,i]=[i,r]),t>r&&t<i};function xse(n){const e=Co(n,{defaultValue:new Date,type:"date"}),t=Mn(),r=l.computed(()=>{let b=Array.isArray(e.defaultValue)?e.defaultValue:[e.defaultValue,e.defaultValue];return b=b.map(w=>Us(w)),wl(b)?b:[new Date,new Date].map(w=>Us(w))}),i=l.ref([new Date(NaN),new Date(NaN)]);l.watchEffect(()=>{wl(e.value)&&(i.value=e.value)});const o=(b,w)=>{var v;const[k,C]=i.value;ko(k)&&!ko(C)?(k.getTime()>b.getTime()?i.value=[b,k]:i.value=[k,b],(v=e["onUpdate:value"])==null||v.call(e,i.value,w)):i.value=[b,new Date(NaN)]},s=l.ref([new Date,new Date]),a=l.computed(()=>wl(e.calendar)?e.calendar:s.value),c=l.computed(()=>e.type==="year"?10*12:e.type==="month"?1*12:1),u=(b,w)=>{var v;const k=yse(b[0],b[1]),C=c.value-k;if(C>0){const T=w===1?0:1;b[T]=t3(b[T],S=>S+(T===0?-C:C))}s.value=b,(v=e.onCalendarChange)==null||v.call(e,b,w)},d=b=>{u([b,a.value[1]],0)},f=b=>{u([a.value[0],b],1)};l.watchEffect(()=>{const b=wl(e.value)?e.value:r.value;u(b.slice(0,2))});const h=l.ref(null),p=b=>h.value=b,m=()=>h.value=null,y=(b,w,v)=>{const k=e.getClasses?e.getClasses(b,w,v):[],C=Array.isArray(k)?k:[k];return/disabled|active/.test(v)?C:(w.length===2&&cO(b,w)&&C.push("in-range"),w.length===1&&h.value&&cO(b,[w[0],h.value])?C.concat("hover-in-range"):C)};return()=>{const b=a.value.map((w,v)=>{const k=Or(Vt({},e),{calendar:w,value:i.value,defaultValue:r.value[v],getClasses:y,partialUpdate:!1,multiple:!1,"onUpdate:value":o,onCalendarChange:v===0?d:f,onDateMouseLeave:m,onDateMouseEnter:p});return l.createVNode(o3,k,null)});return l.createVNode("div",{class:`${t}-calendar-range`},[b])}}const Iw=i3;var Ow=vo(xse,Iw);const uO=l.defineComponent({setup(n,{slots:e}){const t=Mn(),r=l.ref(),i=l.ref(""),o=l.ref(""),s=()=>{if(!r.value)return;const m=r.value,y=m.clientHeight*100/m.scrollHeight;i.value=y<100?`${y}%`:""};l.onMounted(s);const a=ese(),c=m=>{const y=m.currentTarget,{scrollHeight:b,scrollTop:w}=y;o.value=`${w*100/b}%`};let u=!1,d=0;const f=m=>{m.stopImmediatePropagation();const y=m.currentTarget,{offsetTop:b}=y;u=!0,d=m.clientY-b},h=m=>{if(!u||!r.value)return;const{clientY:y}=m,{scrollHeight:b,clientHeight:w}=r.value,k=(y-d)*b/w;r.value.scrollTop=k},p=()=>{u=!1};return l.onMounted(()=>{document.addEventListener("mousemove",h),document.addEventListener("mouseup",p)}),l.onUnmounted(()=>{document.addEventListener("mousemove",h),document.addEventListener("mouseup",p)}),()=>{var m;return l.createVNode("div",{class:`${t}-scrollbar`,style:{position:"relative",overflow:"hidden"}},[l.createVNode("div",{ref:r,class:`${t}-scrollbar-wrap`,style:{marginRight:`-${a}px`},onScroll:c},[(m=e.default)==null?void 0:m.call(e)]),l.createVNode("div",{class:`${t}-scrollbar-track`},[l.createVNode("div",{class:`${t}-scrollbar-thumb`,style:{height:i.value,top:o.value},onMousedown:f},null)])])}}});function Ise({options:n,getClasses:e,onSelect:t}){const r=Mn(),i=o=>{const s=o.target,a=o.currentTarget;if(s.tagName.toUpperCase()!=="LI")return;const c=a.getAttribute("data-type"),u=parseInt(a.getAttribute("data-index"),10),d=parseInt(s.getAttribute("data-index"),10),f=n[u].list[d].value;t(f,c)};return l.createVNode("div",{class:`${r}-time-columns`},[n.map((o,s)=>l.createVNode(uO,{key:o.type,class:`${r}-time-column`},{default:()=>[l.createVNode("ul",{class:`${r}-time-list`,"data-index":s,"data-type":o.type,onClick:i},[o.list.map((a,c)=>l.createVNode("li",{key:a.text,"data-index":c,class:[`${r}-time-item`,e(a.value,o.type)]},[a.text]))])]}))])}function Ose(n){return typeof n=="function"||Object.prototype.toString.call(n)==="[object Object]"&&!l.isVNode(n)}function Dse(n){let e;const t=Mn();return l.createVNode(uO,null,Ose(e=n.options.map(r=>l.createVNode("div",{key:r.text,class:[`${t}-time-option`,n.getClasses(r.value,"time")],onClick:()=>n.onSelect(r.value,"time")},[r.text])))?e:{default:()=>[e]})}function Dw({length:n,step:e=1,options:t}){if(Array.isArray(t))return t.filter(i=>i>=0&&i<n);e<=0&&(e=1);const r=[];for(let i=0;i<n;i+=e)r.push(i);return r}function Nse(n,e){let{showHour:t,showMinute:r,showSecond:i,use12h:o}=e;const s=e.format||"HH:mm:ss";t=typeof t=="boolean"?t:/[HhKk]/.test(s),r=typeof r=="boolean"?r:/m/.test(s),i=typeof i=="boolean"?i:/s/.test(s),o=typeof o=="boolean"?o:/a/i.test(s);const a=[],c=o&&n.getHours()>=12;return t&&a.push({type:"hour",list:Dw({length:o?12:24,step:e.hourStep,options:e.hourOptions}).map(u=>{const d=u===0&&o?"12":Mw(u),f=new Date(n);return f.setHours(c?u+12:u),{value:f,text:d}})}),r&&a.push({type:"minute",list:Dw({length:60,step:e.minuteStep,options:e.minuteOptions}).map(u=>{const d=new Date(n);return d.setMinutes(u),{value:d,text:Mw(u)}})}),i&&a.push({type:"second",list:Dw({length:60,step:e.secondStep,options:e.secondOptions}).map(u=>{const d=new Date(n);return d.setSeconds(u),{value:d,text:Mw(u)}})}),o&&a.push({type:"ampm",list:["AM","PM"].map((u,d)=>{const f=new Date(n);return f.setHours(f.getHours()%12+d*12),{text:u,value:f}})}),a}function Nw(n=""){const e=n.split(":");if(e.length>=2){const t=parseInt(e[0],10),r=parseInt(e[1],10);return{hours:t,minutes:r}}return null}function Pse({date:n,option:e,format:t,formatDate:r}){const i=[];if(typeof e=="function")return e()||[];const o=Nw(e.start),s=Nw(e.end),a=Nw(e.step),c=e.format||t;if(o&&s&&a){const u=o.minutes+o.hours*60,d=s.minutes+s.hours*60,f=a.minutes+a.hours*60,h=Math.floor((d-u)/f);for(let p=0;p<=h;p++){const m=u+p*f,y=Math.floor(m/60),b=m%60,w=new Date(n);w.setHours(y,b,0),i.push({value:w,text:r(w,c)})}}return i}const dO=(n,e,t=0)=>{if(t<=0){requestAnimationFrame(()=>{n.scrollTop=e});return}const i=(e-n.scrollTop)/t*10;requestAnimationFrame(()=>{const o=n.scrollTop+i;if(o>=e){n.scrollTop=e;return}n.scrollTop=o,dO(n,e,t-10)})};function _se(n){const e=Co(n,{defaultValue:Us(new Date),format:"HH:mm:ss",timeTitleFormat:"YYYY-MM-DD",disabledTime:()=>!1,scrollDuration:100}),t=Mn(),r=Ew(),i=(y,b)=>ww(y,b,{locale:r.value.formatLocale}),o=l.ref(new Date);l.watchEffect(()=>{o.value=e3(e.value,e.defaultValue)});const s=y=>Array.isArray(y)?y.every(b=>e.disabledTime(new Date(b))):e.disabledTime(new Date(y)),a=y=>{const b=new Date(y);return s([b.getTime(),b.setMinutes(0,0,0),b.setMinutes(59,59,999)])},c=y=>{const b=new Date(y);return s([b.getTime(),b.setSeconds(0,0),b.setSeconds(59,999)])},u=y=>{const b=new Date(y),w=b.getHours()<12?0:12,v=w+11;return s([b.getTime(),b.setHours(w,0,0,0),b.setHours(v,59,59,999)])},d=(y,b)=>b==="hour"?a(y):b==="minute"?c(y):b==="ampm"?u(y):s(y),f=(y,b)=>{var w;if(!d(y,b)){const v=new Date(y);o.value=v,s(v)||(w=e["onUpdate:value"])==null||w.call(e,v,b)}},h=(y,b)=>d(y,b)?"disabled":y.getTime()===o.value.getTime()?"active":"",p=l.ref(),m=y=>{if(!p.value)return;const b=p.value.querySelectorAll(".active");for(let w=0;w<b.length;w++){const v=b[w],k=Aw(v,p.value);if(k){const C=v.offsetTop;dO(k,C,y)}}};return l.onMounted(()=>m(0)),l.watch(o,()=>m(e.scrollDuration),{flush:"post"}),()=>{let y;return e.timePickerOptions?y=l.createVNode(Dse,{onSelect:f,getClasses:h,options:Pse({date:o.value,format:e.format,option:e.timePickerOptions,formatDate:i})},null):y=l.createVNode(Ise,{options:Nse(o.value,e),onSelect:f,getClasses:h},null),l.createVNode("div",{class:`${t}-time`,ref:p},[e.showTimeHeader&&l.createVNode("div",{class:`${t}-time-header`},[l.createVNode("button",{type:"button",class:`${t}-btn ${t}-btn-text ${t}-time-header-title`,onClick:e.onClickTitle},[i(o.value,e.timeTitleFormat)])]),l.createVNode("div",{class:`${t}-time-content`},[y])])}}const s3=Hs()(["value","defaultValue","format","timeTitleFormat","showTimeHeader","disabledTime","timePickerOptions","hourOptions","minuteOptions","secondOptions","hourStep","minuteStep","secondStep","showHour","showMinute","showSecond","use12h","scrollDuration","onClickTitle","onUpdate:value"]);var yf=vo(_se,s3);function Lse(n){const e=Co(n,{defaultValue:Us(new Date),disabledTime:()=>!1}),t=Mn(),r=l.ref([new Date(NaN),new Date(NaN)]);l.watchEffect(()=>{wl(e.value)?r.value=e.value:r.value=[new Date(NaN),new Date(NaN)]});const i=(u,d)=>{var f;(f=e["onUpdate:value"])==null||f.call(e,r.value,u==="time"?"time-range":u,d)},o=(u,d)=>{r.value[0]=u,r.value[1].getTime()>=u.getTime()||(r.value[1]=u),i(d,0)},s=(u,d)=>{r.value[1]=u,r.value[0].getTime()<=u.getTime()||(r.value[0]=u),i(d,1)},a=u=>e.disabledTime(u,0),c=u=>u.getTime()<r.value[0].getTime()||e.disabledTime(u,1);return()=>{const u=Array.isArray(e.defaultValue)?e.defaultValue:[e.defaultValue,e.defaultValue];return l.createVNode("div",{class:`${t}-time-range`},[l.createVNode(yf,Or(Vt({},e),{"onUpdate:value":o,value:r.value[0],defaultValue:u[0],disabledTime:a}),null),l.createVNode(yf,Or(Vt({},e),{"onUpdate:value":s,value:r.value[1],defaultValue:u[1],disabledTime:c}),null)])}}const Pw=s3;var _w=vo(Lse,Pw);function fO(n){const e=l.ref(!1),t=()=>{var o;e.value=!1,(o=n.onShowTimePanelChange)==null||o.call(n,!1)},r=()=>{var o;e.value=!0,(o=n.onShowTimePanelChange)==null||o.call(n,!0)};return{timeVisible:l.computed(()=>typeof n.showTimePanel=="boolean"?n.showTimePanel:e.value),openTimePanel:r,closeTimePanel:t}}function Bse(n){const e=Co(n,{disabledTime:()=>!1,defaultValue:Us(new Date)}),t=l.ref(e.value);l.watchEffect(()=>{t.value=e.value});const{openTimePanel:r,closeTimePanel:i,timeVisible:o}=fO(e),s=(a,c)=>{var u;c==="date"&&r();let d=n3(a,e3(e.value,e.defaultValue));if(e.disabledTime(new Date(d))&&(d=n3(a,e.defaultValue),e.disabledTime(new Date(d)))){t.value=d;return}(u=e["onUpdate:value"])==null||u.call(e,d,c)};return()=>{const a=Mn(),c=Or(Vt({},wo(e,i3)),{multiple:!1,type:"date",value:t.value,"onUpdate:value":s}),u=Or(Vt({},wo(e,s3)),{showTimeHeader:!0,value:t.value,"onUpdate:value":e["onUpdate:value"],onClickTitle:i});return l.createVNode("div",{class:`${a}-date-time`},[l.createVNode(o3,c,null),o.value&&l.createVNode(yf,u,null)])}}const hO=Hs()(["showTimePanel","onShowTimePanelChange"]),Rse=[...hO,...i3,...s3];var pO=vo(Bse,Rse);function $se(n){const e=Co(n,{defaultValue:Us(new Date),disabledTime:()=>!1}),t=l.ref(e.value);l.watchEffect(()=>{t.value=e.value});const{openTimePanel:r,closeTimePanel:i,timeVisible:o}=fO(e),s=(a,c)=>{var u;c==="date"&&r();const d=Array.isArray(e.defaultValue)?e.defaultValue:[e.defaultValue,e.defaultValue];let f=a.map((h,p)=>{const m=wl(e.value)?e.value[p]:d[p];return n3(h,m)});if(f[1].getTime()<f[0].getTime()&&(f=[f[0],f[0]]),f.some(e.disabledTime)&&(f=a.map((h,p)=>n3(h,d[p])),f.some(e.disabledTime))){t.value=f;return}(u=e["onUpdate:value"])==null||u.call(e,f,c)};return()=>{const a=Mn(),c=Or(Vt({},wo(e,Iw)),{type:"date",value:t.value,"onUpdate:value":s}),u=Or(Vt({},wo(e,Pw)),{showTimeHeader:!0,value:t.value,"onUpdate:value":e["onUpdate:value"],onClickTitle:i});return l.createVNode("div",{class:`${a}-date-time-range`},[l.createVNode(Ow,c,null),o.value&&l.createVNode(_w,u,null)])}}const Fse=[...hO,...Pw,...Iw];var mO=vo($se,Fse);const Vse=Hs()(["range","open","appendToBody","clearable","confirm","disabled","editable","multiple","partialUpdate","showHour","showMinute","showSecond","showTimeHeader","showTimePanel","showWeekNumber","use12h"]),gO={date:"YYYY-MM-DD",datetime:"YYYY-MM-DD HH:mm:ss",year:"YYYY",month:"YYYY-MM",time:"HH:mm:ss",week:"w"};function yO(n,{slots:e}){const t=n.type||"date",r=n.format||gO[t]||gO.date,i=Or(Vt({},nse(n,Vse)),{type:t,format:r});return l.createVNode(lO,wo(i,lO.props),Vt({content:o=>{if(i.range){const s=t==="time"?_w:t==="datetime"?mO:Ow;return l.h(s,wo(Vt(Vt({},i),o),s.props))}else{const s=t==="time"?yf:t==="datetime"?pO:o3;return l.h(s,wo(Vt(Vt({},i),o),s.props))}},"icon-calendar":()=>t==="time"?l.createVNode(hse,null,null):l.createVNode(sO,null,null)},e))}var Fc=Object.assign(yO,{locale:JI,install:n=>{n.component("DatePicker",yO)}},{Calendar:o3,CalendarRange:Ow,TimePanel:yf,TimeRange:_w,DateTime:pO,DateTimeRange:mO}),jse={months:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"],monthsShort:["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"],weekdays:["domingo","lunes","martes","miércoles","jueves","viernes","sábado"],weekdaysShort:["dom","lun","mar","mié","jue","vie","sáb"],weekdaysMin:["do","lu","ma","mi","ju","vi","sá"],firstDayOfWeek:1,firstWeekContainsDate:1};const zse={formatLocale:jse,yearFormat:"YYYY",monthFormat:"MMM",monthBeforeYear:!0};Fc.locale("es",zse);var Hse={months:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],monthsShort:["Jan","Feb","März","Apr","Mai","Juni","Juli","Aug","Sep","Okt","Nov","Dez"],weekdays:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],weekdaysShort:["So.","Mo.","Di.","Mi.","Do.","Fr.","Sa."],weekdaysMin:["So","Mo","Di","Mi","Do","Fr","Sa"],firstDayOfWeek:1,firstWeekContainsDate:4};const Use={formatLocale:Hse,yearFormat:"YYYY",monthFormat:"MMM",monthBeforeYear:!0};Fc.locale("de",Use);var Zse={months:["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre"],monthsShort:["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc."],weekdays:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],weekdaysShort:["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],weekdaysMin:["di","lu","ma","me","je","ve","sa"],firstDayOfWeek:1,firstWeekContainsDate:1};const Wse={formatLocale:Zse,yearFormat:"YYYY",monthFormat:"MMM",monthBeforeYear:!0};Fc.locale("fr",Wse);var Kse={months:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],monthsShort:["Jan","Fev","Mar","Abr","Mai","Jun","Jul","Ago","Set","Out","Nov","Dez"],weekdays:["Domingo","Segunda-feira","Terça-feira","Quarta-feira","Quinta-feira","Sexta-feira","Sábado"],weekdaysShort:["Dom","Seg","Ter","Qua","Qui","Sex","Sáb"],weekdaysMin:["Do","2ª","3ª","4ª","5ª","6ª","Sá"],firstDayOfWeek:1,firstWeekContainsDate:4};const qse={formatLocale:Kse,yearFormat:"YYYY",monthFormat:"MMM",monthBeforeYear:!0};Fc.locale("pt",qse);var Gse={months:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthsShort:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],weekdays:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],weekdaysShort:["周日","周一","周二","周三","周四","周五","周六"],weekdaysMin:["日","一","二","三","四","五","六"],firstDayOfWeek:1,firstWeekContainsDate:4,meridiemParse:/上午|下午/,meridiem:function(e){return e<12?"上午":"下午"},isPM:function(e){return e==="下午"}};const Yse={formatLocale:Gse,yearFormat:"YYYY年",monthFormat:"MMM",monthBeforeYear:!1};Fc.locale("zh-cn",Yse);const Qse=l.defineComponent({name:"QDatePicker",components:{DatePicker:Fc},props:{id:{type:String,default:""},modelValue:{type:[Date,String,Array],default:""},clearable:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},disabledDate:{type:Function,default:()=>{}},disabledBeforeToday:{type:Boolean,default:!1},disabledAfterToday:{type:Boolean,default:!1},format:{type:String,default:""},locale:{type:String,default:"en"},placeholder:{type:String,default:""},range:{type:Boolean,default:!1},size:{type:String,default:"lg"},type:{type:String,default:"date"}},emits:["update:modelValue"],setup(n){const e=l.ref("bottom"),t=l.ref(),r=l.ref(!1),i=l.ref(n.modelValue||""),o=l.computed(()=>n.disabledAfterToday?s:n.disabledBeforeToday?a:n.disabledDate),s=u=>u>new Date,a=u=>{const d=new Date;return d.setHours(0,0,0,0),u<d},c=()=>{const u=document.querySelector(".mx-datepicker-main");u&&(e.value=parseInt(u.style.top)<0?"top":"bottom")};return l.watch(r,async u=>{u?window.addEventListener("scroll",c):window.removeEventListener("scroll",c),await l.nextTick(),c()}),{calendarPosition:e,datePicker:t,isOpen:r,value:i,disabledDates:o,disableDatesAfterToday:s,disableDatesBeforeToday:a,getCalendarPosition:c}}}),Xse={class:"q-date-picker"};function Jse(n,e,t,r,i,o){const s=l.resolveComponent("q-icon"),a=l.resolveComponent("date-picker",!0);return l.openBlock(),l.createElementBlock("div",Xse,[l.createVNode(a,{id:n.id,value:n.value,"onUpdate:value":e[0]||(e[0]=c=>n.value=c),"append-to-body":!1,class:l.normalizeClass([`date-picker-${n.size}`,`date-picker-on-${n.calendarPosition}`,{open:n.isOpen}]),clearable:n.clearable,disabled:n.disabled,"disabled-date":n.disabledDates,format:n.format,lang:n.locale,placeholder:n.placeholder,range:n.range,type:n.type,ref:"datePicker",onChange:e[1]||(e[1]=c=>n.$emit("update:modelValue",c)),onClose:e[2]||(e[2]=c=>n.isOpen=!1),onOpen:e[3]||(e[3]=c=>n.isOpen=!0)},{"icon-clear":l.withCtx(()=>[l.createVNode(s,{icon:"close",type:"",color:"inkwell-0",size:"sm"})]),"icon-calendar":l.withCtx(()=>[l.createVNode(s,{icon:"calendar",color:"inkwell-0"})]),_:1},8,["id","value","class","clearable","disabled","disabled-date","format","lang","placeholder","range","type"])])}const eae=ye(Qse,[["render",Jse],["__scopeId","data-v-70cc2c82"]]),tae=l.defineComponent({name:"QDivider",props:{borderStyle:{type:String,default:"solid"},borderColor:{type:String,default:"gray-20"},textClass:{type:String,default:""}},emits:["update:modelValue"],setup(n,{slots:e}){return{hasSlotContent:l.computed(()=>!!e.default)}}}),nae={class:"divider relative flex items-center w-full"};function rae(n,e,t,r,i,o){return l.openBlock(),l.createElementBlock("div",nae,[l.createElementVNode("div",{class:l.normalizeClass(["flex-grow border-t",["border-"+n.borderStyle,"border-"+n.borderColor]])},null,2),n.hasSlotContent?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass(["flex-shrink flex items-center px-4 text-center",n.textClass])},[l.renderSlot(n.$slots,"default")],2)):l.createCommentVNode("",!0),l.createElementVNode("div",{class:l.normalizeClass(["flex-grow border-t",["border-"+n.borderStyle,"border-"+n.borderColor]])},null,2)])}const iae=ye(tae,[["render",rae]]),oae=l.defineComponent({name:"QIcon",props:{},setup(){}}),sae={class:"footer-actions"};function aae(n,e,t,r,i,o){return l.openBlock(),l.createElementBlock("div",sae,[l.renderSlot(n.$slots,"default",{},void 0,!0)])}const lae=ye(oae,[["render",aae],["__scopeId","data-v-ca1eb5be"]]),cae=l.defineComponent({name:"QFormGroup",props:{labelFor:{type:String,required:!0},required:{type:Boolean,default:!1},status:{type:String,default:""}},setup(){return{}}}),uae={class:"form-group"},dae=["for"],fae={class:"label-text"},hae={key:0,class:"required"};function pae(n,e,t,r,i,o){const s=l.resolveComponent("q-icon");return l.openBlock(),l.createElementBlock("div",uae,[l.createElementVNode("label",{for:n.labelFor},[l.createElementVNode("div",fae,[l.renderSlot(n.$slots,"label",{},void 0,!0)]),n.required?(l.openBlock(),l.createElementBlock("div",hae," *"+l.toDisplayString(n.$t("HC_REQUIRED")),1)):l.createCommentVNode("",!0)],8,dae),l.renderSlot(n.$slots,"default",{},void 0,!0),l.createElementVNode("div",{class:l.normalizeClass(["message",{"text-red-30":n.status==="error"},{"text-green-20":n.status==="success"}])},[n.status==="error"?(l.openBlock(),l.createBlock(s,{key:0,class:"message-icon",color:"red-30",icon:"exclamation-circle",type:"fill"})):l.createCommentVNode("",!0),l.renderSlot(n.$slots,"message",{},void 0,!0)],2)])}const mae=ye(cae,[["render",pae],["__scopeId","data-v-f2d32e20"]]),Lw=(n,e,t,r,i,o=[])=>{if(e||t&&t.length){let s=!0;n=n.filter(a=>{if(t&&t.length){const c=[];t.forEach(d=>{let f=d.selected;if(!f)return;const h=d.key;Array.isArray(f)||(f=[f]);let p=!1;f.forEach(m=>{const y=m&&m.key?m.key:h,b=m&&y;let w,v="",k=null;b&&(w=y.split(/\./),v=w[0],k=w[1]||null,!k&&(typeof m.value!="boolean"&&a[v]!==m.value||typeof m.value=="boolean"&&typeof a[v]!="boolean"&&!!a[v]!==m.value||typeof m.value=="boolean"&&typeof a[v]=="boolean"&&a[v]!==m.value)||k&&(typeof m.value!="boolean"&&a[v][k]!==m.value||typeof m.value=="boolean"&&typeof a[v][k]!="boolean"&&!!a[v][k]!==m.value||typeof m.value=="boolean"&&typeof a[v][k]=="boolean"&&a[v][k]!==m.value)||(p=!0))}),c.push(p)});const u=c.filter(d=>!!d).length;if(c.length>0&&u!==c.length)return!1}if(e){if(typeof a=="string")return String(a).toLocaleLowerCase().includes(e.toLocaleLowerCase());s=Object.keys(a).some(c=>o.includes(c)?!1:typeof a[c]=="object"&&a[c]?Object.keys(a[c]).some(u=>o.includes(u)?!1:String(a[c][u]).toLocaleLowerCase().includes(e.toLocaleLowerCase())):String(a[c]).toLocaleLowerCase().includes(e.toLocaleLowerCase()))}return s})}return r&&(n=n.sort((s,a)=>{if(s===null||s==="")return 1;if(a===null||a==="")return-1;if(r.includes(".")){const c=r.split(".")[0],u=r.split(".")[1];if(s[c]===null||s[c]==="")return 1;if(a[c]===null||a[c]==="")return-1;s=s[c][u],a=a[c][u]}else s=s[r],a=a[r];return typeof s=="string"&&typeof a=="string"&&(s=s.toLowerCase(),a=a.toLowerCase()),typeof s!="string"&&typeof a!="string"&&(s=parseInt(s),a=parseInt(a)),(s===a?0:s>a?1:-1)*i})),n},gae=l.defineComponent({name:"QGrid",components:{QBadge:Da},props:{id:{type:String,default:""},columns:{type:Number,default:4},exclude:{type:Array,default:()=>[]},filters:{type:Array,default:()=>[]},filtersAction:{type:Function,default:()=>{}},filtersCount:{type:Number,default:0},gridData:{type:Array,default:()=>[]},hasSearch:{type:Boolean,default:!0},loading:{type:Boolean,default:!1},noResultMessage:{type:String,default:""},searchPlaceholder:{type:String,default:""},skeletonRows:{type:Number,default:6},statusClasses:{type:Object}},emits:["select-grid-item","filters-updated"],setup(n,{emit:e}){const{t}=us(),r=l.ref(""),i=l.computed(()=>{const f=n.filters,h=Lw(n.gridData,r.value,f,void 0,void 0,n.exclude);return e("filters-updated",h),h}),o=l.computed(()=>n.columns?`q-grid-cols-${n.columns}`:""),s=l.computed(()=>i.value.length%n.columns===0),a=l.computed(()=>n.noResultMessage||t("HC_NO_RESULTS_FOUND")),c=l.computed(()=>{const f=[],h={};return[...Array(n.skeletonRows*n.columns)].forEach(()=>{f.push(h)}),f});return{searchBy:r,filteredGridData:i,gridColumnCount:o,lastRowWillBeFilled:s,noResultsText:a,skeletonData:c,getCellClasses:f=>{const h=i.value.length?i.value:c.value,p=Math.ceil(h.length/n.columns),m=Math.floor(f/n.columns),y=m===0,b=m===p-1,w=f===h.length-1,v=m===p-2,k=f+n.columns>=h.length;return{"!border-t-[0.09375rem]":y,"!border-b-[0.09375rem]":b||k&&v,"!border-l-[0.09375rem]":f%n.columns===0,"!border-r-[0.09375rem]":f%n.columns===n.columns-1||w,"!rounded-tl-md":y&&f%n.columns===0,"!rounded-tr-md":y&&(f%n.columns===n.columns-1||w),"!rounded-bl-md":b&&f%n.columns===0,"!rounded-br-md":w||v&&h.length%n.columns!==0&&f%n.columns===n.columns-1}},selectGridItem:f=>{i.value.find(h=>{h.active&&(h.active=!1)}),f.active=!0,e("select-grid-item",f)},mq:_n}}}),yae=["id"],bae={key:0,class:"grid-filters"},wae={class:"grid-search"},vae={for:"grid-search",class:"search-label"},Cae={key:0,class:"grid-filter-actions"},kae={class:"relative flex"},Sae={class:"grid-wrapper"},Mae=["onClick"],Eae={key:1,class:"no-grid-result"};function Aae(n,e,t,r,i,o){const s=l.resolveComponent("q-icon"),a=l.resolveComponent("q-input"),c=l.resolveComponent("q-badge");return l.openBlock(),l.createElementBlock("div",{id:n.id,class:l.normalizeClass(["grid-container h-full w-full",{"is-loading":n.loading}])},[n.hasSearch?l.renderSlot(n.$slots,"search-and-filters",{key:0},()=>[l.createElementVNode("div",{class:l.normalizeClass(["search-and-filters !pr-0",{"bg-gray-30 animate-shimmer":n.loading}])},[n.loading?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock("div",bae,[l.createElementVNode("div",wae,[n.hasSearch?l.renderSlot(n.$slots,"grid-search",{key:0},()=>[l.createElementVNode("label",vae,[l.createVNode(a,{id:"grid-search",modelValue:n.searchBy,"onUpdate:modelValue":e[0]||(e[0]=u=>n.searchBy=u),"hide-clear":!!n.mq.md,placeholder:n.searchPlaceholder||n.$t("HC_SEARCH"),class:"text-base placeholder-inkwell-0","control-class":"!border-0","icon-position":"left"},{default:l.withCtx(()=>[l.createVNode(s,{color:"inkwell-0",icon:"search",size:"md",type:"",class:"cursor-default"})]),_:1},8,["modelValue","hide-clear","placeholder"])])],!0):l.createCommentVNode("",!0)]),Object.keys(n.filters).length?(l.openBlock(),l.createElementBlock("div",Cae,[l.renderSlot(n.$slots,"filters",{},()=>[l.createElementVNode("div",kae,[l.createVNode(s,{class:"filters-icon",color:"inkwell-0",icon:"filter",size:"md",onClick:n.filtersAction},null,8,["onClick"]),n.filtersCount?(l.openBlock(),l.createBlock(c,{key:0,class:"filters-count",color:n.mq.md?"white":"gray-0"},{text:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(n.filtersCount),1)]),_:1},8,["color"])):l.createCommentVNode("",!0)])],!0)])):l.createCommentVNode("",!0)]))],2)],!0):l.createCommentVNode("",!0),l.createElementVNode("div",Sae,[n.filteredGridData.length||n.loading?(l.openBlock(),l.createElementBlock("ul",{key:0,class:l.normalizeClass(["grid mb-4 md:mb-0",n.gridColumnCount])},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(n.loading?n.skeletonData:n.filteredGridData,(u,d)=>(l.openBlock(),l.createElementBlock("li",{key:u.id,class:l.normalizeClass(["cursor-pointer truncate","cell",n.statusClasses&&n.statusClasses[u.status],u.active==!0?"active":"",n.mq.md&&n.getCellClasses(d),{"bg-gray-10 animate-shimmer":n.loading}]),onClick:l.withModifiers(f=>n.selectGridItem(u),["prevent"])},l.toDisplayString(u.name),11,Mae))),128))],2)):(l.openBlock(),l.createElementBlock("p",Eae,l.toDisplayString(n.noResultsText),1))])],10,yae)}const Tae=ye(gae,[["render",Aae],["__scopeId","data-v-cfe195f6"]]),xae=l.defineComponent({name:"QIconActionGroup",components:{QButton:Y9,QIcon:z0},props:{modelValue:{type:String,default:null},isActionable:{type:Boolean,default:!0},isChecklist:{type:Boolean,default:!1},options:{type:Array,default:()=>[]},showStatus:{type:Boolean,default:!1},toggle:{type:Boolean,default:!0}},emits:["update:modelValue"],setup(n,{emit:e}){const t=l.ref(null),r=l.computed(()=>n.isChecklist?n.options.filter(o=>o.state==="pass"):n.options);return{selectedOption:t,filteredOptions:r,onButtonClick:o=>{t.value=o;const a=o.state===n.modelValue&&n.toggle?"default":o.state;e("update:modelValue",a)},mq:_n}}}),Iae=["value"],Oae={key:1},Dae={class:"flex justify-center actions absolute z-0 right-0 inset-y-0 cursor-pointer"},Nae={class:"flex items-center justify-center"};function Pae(n,e,t,r,i,o){const s=l.resolveComponent("q-icon"),a=l.resolveComponent("q-button");return n.mq.lg?(l.openBlock(),l.createElementBlock("div",{key:0,value:n.modelValue,class:l.normalizeClass(["flex text-right gap-4 justify-end mr-4 py-4",n.isActionable?"":"pointer-events-none"])},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(n.filteredOptions,c=>(l.openBlock(),l.createElementBlock("div",{key:c.state},[l.createVNode(a,l.mergeProps({class:[c.state===n.modelValue?c.activeClass:c.idleClass,c.btnClasses],loading:c.loading,"is-fab":"",size:"sm"},{[l.toHandlerKey(n.isActionable&&!c.loading&&"click")]:u=>n.onButtonClick(c)}),{default:l.withCtx(()=>[l.createVNode(s,{icon:c.icon,class:l.normalizeClass(c.iconClasses||"!p-[0.3rem]"),type:c.iconType||"line",size:"sm",color:"white"},null,8,["icon","class","type"])]),_:2},1040,["class","loading"])]))),128))],10,Iae)):(l.openBlock(),l.createElementBlock("div",Oae,[l.createVNode(l.Transition,{name:"fade"},{default:l.withCtx(()=>[n.selectedOption&&n.showStatus?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass(["status w-2 h-full absolute right-0 inset-y-0 z-20",n.selectedOption.activeClass])},null,2)):l.createCommentVNode("",!0)]),_:1}),l.createElementVNode("div",Dae,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(n.filteredOptions,c=>(l.openBlock(),l.createElementBlock("div",l.mergeProps({key:c.state,class:`flex items-center justify-center w-14 h-full ${c.activeClass}`},{[l.toHandlerKey(n.isActionable&&!c.loading&&"click")]:u=>n.onButtonClick(c)}),[l.createVNode(s,{icon:c.icon,type:c.iconType||"line",size:"lg",color:"white"},null,8,["icon","type"])],16))),128))]),l.createVNode(l.Transition,{name:"fade"},{default:l.withCtx(()=>{var c,u,d,f;return[(c=n.selectedOption)!=null&&c.loading?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass(["absolute flex items-center justify-center inset-0 text-white z-10",(u=n.selectedOption)==null?void 0:u.activeClass])},[l.createElementVNode("div",Nae,[l.createVNode(s,{icon:(d=n.selectedOption)==null?void 0:d.icon,type:((f=n.selectedOption)==null?void 0:f.iconType)||"line",size:"lg",color:"white"},null,8,["icon","type"])])],2)):l.createCommentVNode("",!0)]}),_:1})]))}const _ae=ye(xae,[["render",Pae],["__scopeId","data-v-80f2446a"]]),bO="eye",wO="eye-slash",Lae=l.defineComponent({name:"QInput",inheritAttrs:!1,props:{modelValue:{type:[Number,Object,String],default:""},type:{type:String,default:"text",validator:n=>["email","number","password","phone","search","text"].includes(n)},placeholder:{type:String,default:""},maxlength:{type:Number,default:null},size:{type:String,default:"md"},status:{type:String,default:""},controlClass:{type:String,default:""},inputClass:{type:String,default:""},disabled:{type:Boolean,default:!1},autocomplete:{type:String,default:"off"},hideClear:{type:Boolean,default:!1},iconPosition:{type:String,default:"right"}},emits:["update:model-value","update-type"],setup(n,{emit:e}){const t=l.useSlots(),r=l.ref(null),i=l.ref(!1),o=l.ref(n.type==="password"?bO:""),s=l.computed(()=>!!n.disabled),a=l.computed(()=>{const m=o.value;return!!n.modelValue&&!s.value&&(d.value&&n.iconPosition==="left"||!m)}),c=l.computed(()=>["control flex items-center",{focused:!!i.value},{disabled:s.value},{[`has-icon-${n.iconPosition}`]:!!n.iconPosition},n.controlClass,{["size-"+n.size]:n.size}]),u=l.computed(()=>["input",{[n.status]:n.status&&!s.value},{[n.inputClass]:!!n.inputClass},{populated:!!n.modelValue}]),d=l.computed(()=>!!(t!=null&&t.default)),f=()=>{const m=n.type==="password",y=n.type==="text"&&o.value===wO;(m||y)&&h()},h=()=>{const m=n.type==="text"?"password":"text";o.value=m==="text"?wO:bO,e("update-type",m)};return{currentInput:r,focused:i,icon:o,rootClasses:c,inputClasses:u,isDisabled:s,showClearIcon:a,isSlotAvailable:d,onClickIcon:f,togglePasswordVisibility:h,updateValue:m=>{e("update:model-value",m.target.value)},mq:_n}}}),Bae=["id","type","disabled","autocomplete","maxlength","value","placeholder"];function Rae(n,e,t,r,i,o){const s=l.resolveComponent("q-icon");return l.openBlock(),l.createElementBlock("div",{ref:"currentInput",class:l.normalizeClass(n.rootClasses)},[l.createElementVNode("input",l.mergeProps({id:String(n.$attrs.id),ref:String(n.$attrs.id),type:n.type,disabled:n.isDisabled,class:n.inputClasses,autocomplete:n.autocomplete,maxlength:n.maxlength,value:n.modelValue,placeholder:n.placeholder},n.$attrs,{onInput:e[0]||(e[0]=a=>n.updateValue(a)),onFocusin:e[1]||(e[1]=a=>n.focused=!n.focused),onFocusout:e[2]||(e[2]=a=>n.focused=!n.focused),onBlur:e[3]||(e[3]=a=>n.focused=!0)}),null,16,Bae),n.isSlotAvailable||n.icon?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass(["flex",{"order-first pr-2":n.iconPosition==="left"}])},[l.renderSlot(n.$slots,"default",l.normalizeProps(l.guardReactiveProps({icon:n.icon,onClickIcon:n.onClickIcon})),()=>[l.createVNode(s,{icon:n.icon,size:"md",class:"cursor-pointer",onClick:n.onClickIcon},null,8,["icon","onClick"])],!0)],2)):l.createCommentVNode("",!0),n.showClearIcon&&!n.hideClear?(l.openBlock(),l.createElementBlock("div",{key:1,class:"close cursor-pointer flex order-3",onClick:e[4]||(e[4]=a=>n.$emit("update:model-value","")),onMousedown:e[5]||(e[5]=l.withModifiers(()=>{},["prevent"]))},[n.mq.md?(l.openBlock(),l.createBlock(s,{key:0,icon:"close",size:"sm",type:"line"})):(l.openBlock(),l.createBlock(s,{key:1,icon:"delete-circle",color:"inkwell-0",size:"md",type:"fill"}))],32)):l.createCommentVNode("",!0)],2)}const $ae=ye(Lae,[["render",Rae],["__scopeId","data-v-320db1d7"]]),Fae=l.defineComponent({name:"QList",components:{QBadge:Da},props:{id:{type:String,default:""},data:{type:Array,default:()=>[]},hideSearch:{type:Boolean,default:!1},exclude:{type:Array,default:()=>[]},filters:{type:Array,default:()=>[]},filtersCount:{type:Number,default:0},hasSearch:{type:Boolean,default:!0},loading:{type:Boolean,default:!1},noResultMessage:{type:String,default:""},searchText:{type:String,default:""},searchPlaceholder:{type:String,default:""},skeletonRows:{type:Number,default:6},type:{type:String,default:"row"}},emits:["filters-action","filters-updated","click:list-item"],setup(n,{emit:e}){const{y:t}=sL(),{y:r}=rL(window,{behavior:"smooth"}),i=l.ref(0),o=l.ref("down"),s=l.ref(0),a=l.ref(!1),c=l.ref(!0),u=l.ref(_n.md?!1:n.hideSearch),d=l.ref(!u.value),f={type:"keyframe",ease:"linear",duration:0,delay:0},h=l.ref(null),p=l.ref(null),m=l.ref(""),{motionProperties:y}=fb(h),{push:b}=lb(),w=l.computed(()=>{const I=Lw(n.data,v.value,n.filters,void 0,void 0,n.exclude);return e("filters-updated",I),I}),v=l.computed(()=>n.searchText||m.value),k=l.computed(()=>t.value<=0?70:t.value>70?0:70-t.value),C=I=>{!I.dragging&&t.value<=24&&t.value>=0&&(r.value=0),!I.dragging&&t.value>24&&t.value<70&&(r.value=70),!(t.value>0)&&(a.value?S(I):T(I))};u.value&&x8(C,{domTarget:h,filterTaps:!0,useTouch:!0,delay:100});const T=I=>{I.tap||I.axis==="x"||(a.value=!0)},S=I=>{if(I.tap||I.axis==="x")return;const P=I.direction[1],D=P>=0,_=P<=0&&t.value<=0;!d.value&&(D||_)&&A(!_,"drag"),a.value=!1},A=async(I,P)=>{if(d.value=I,await l.nextTick(),c.value&&o.value==="up"&&t.value<=0||P==="drag"){const D=k.value?k.value:0;b("y",D,y,f),c.value=!1}},O=()=>{const I=Math.max(0,t.value)>i.value?"down":"up";I!==o.value&&(o.value=I),t.value<70&&A(!0,"scroll"),i.value=Math.max(0,t.value)};return l.onMounted(()=>{u.value&&(s.value=h.value.offsetTop-16,window.addEventListener("scroll",O))}),l.onUnmounted(()=>{u.value&&window.removeEventListener("scroll",O)}),{defaultSearchTop:s,isDragging:a,isSearchVisible:d,hiddenSearch:u,listRef:h,prevScrollY:i,scrollY:t,scrollToY:r,searchRef:p,searchValue:m,direction:o,filteredData:w,searchBy:v,searchHeight:k,onScroll:O,toggleSearch:A,mq:_n}}}),a3=n=>(l.pushScopeId("data-v-7f414e39"),n=n(),l.popScopeId(),n),Vae=["id"],jae={key:0},zae={key:0,class:"list-filters"},Hae={class:"relative flex"},Uae={key:1,class:"search-and-filters loading-state"},Zae=[a3(()=>l.createElementVNode("div",{class:"loading-search animate-shimmer bg-gray-10"},null,-1)),a3(()=>l.createElementVNode("div",{class:"loading-filters animate-shimmer bg-gray-30"},null,-1))],Wae={ref:"listRef",class:"outer-list-wrapper select-none"},Kae={key:0},qae={key:0,class:"list-wrapper"},Gae=["onClick"],Yae={key:1,class:"list ordered-list"},Qae=["onClick"],Xae={key:1,class:"no-results"},Jae={key:1,class:"list-wrapper"},ele={class:"list loading-list"},tle=[a3(()=>l.createElementVNode("div",{class:"animate-shimmer bg-gray-30 loading-top mb-3"},null,-1)),a3(()=>l.createElementVNode("div",{class:"animate-shimmer bg-gray-10 loading-bottom"},null,-1))];function nle(n,e,t,r,i,o){const s=l.resolveComponent("q-icon"),a=l.resolveComponent("q-input"),c=l.resolveComponent("q-badge");return l.openBlock(),l.createElementBlock("div",{id:n.id,class:"q-list"},[n.hasSearch||n.filters.length?l.renderSlot(n.$slots,"search-and-filters",{key:0},()=>[l.createElementVNode("div",{ref:"searchRef",class:l.normalizeClass(["search-and-filter-wrapper",{"fixed right-0 left-0 top-0 pt-4 pl-4 pr-4 z-10 bg-white overflow-hidden":n.hiddenSearch},{"is-shown border-b border-gray-20":n.hiddenSearch&&n.isSearchVisible},{"!hidden h-px":n.hiddenSearch&&n.searchHeight<=16}]),style:l.normalizeStyle([n.hiddenSearch&&n.searchHeight>=0?`height: ${n.searchHeight}px;`:"",`top: ${n.defaultSearchTop}px;`])},[n.loading?(l.openBlock(),l.createElementBlock("div",Uae,Zae)):(l.openBlock(),l.createElementBlock("div",jae,[l.createElementVNode("div",{class:"search-and-filters",style:l.normalizeStyle(n.hiddenSearch&&n.searchHeight>=0?`height: ${n.searchHeight-32}px;`:"")},[l.createElementVNode("div",{class:"list-search",style:l.normalizeStyle(n.hiddenSearch&&n.searchHeight-32<38?"opacity: "+(n.searchHeight-56)/14+";":n.hiddenSearch&&n.searchHeight-32<24?"opacity; 0;":"")},[n.hasSearch?l.renderSlot(n.$slots,"list-search",{key:0},()=>[l.createElementVNode("label",{for:"list-search",class:l.normalizeClass(["search-label",{"!hidden":n.hiddenSearch&&n.searchHeight-32<=0}])},[l.createVNode(a,{id:"list-search",modelValue:n.searchValue,"onUpdate:modelValue":e[0]||(e[0]=u=>n.searchValue=u),"hide-clear":!!n.mq.md,placeholder:n.searchPlaceholder||n.$t("HC_SEARCH"),class:"text-base placeholder-inkwell-0","control-class":"!border-0 !pl-2 !pr-1.5 md:!px-3","icon-position":"left",size:"xs"},{default:l.withCtx(()=>[l.createVNode(s,{color:"inkwell-0",icon:"search",size:"md",type:"",class:"cursor-default"})]),_:1},8,["modelValue","hide-clear","placeholder"])],2)],!0):l.createCommentVNode("",!0)],4),n.filters.length&&n.type==="row"?(l.openBlock(),l.createElementBlock("div",zae,[l.renderSlot(n.$slots,"list-filters",{},()=>[l.createElementVNode("div",Hae,[l.createVNode(s,{class:"filters-icon",color:"inkwell-0",icon:"filter",size:"md",onClick:e[1]||(e[1]=u=>n.$emit("filters-action"))}),n.filtersCount?(l.openBlock(),l.createBlock(c,{key:0,class:"filters-count",color:"gray-0"},{text:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(n.filtersCount),1)]),_:1})):l.createCommentVNode("",!0)])],!0)])):l.createCommentVNode("",!0)],4)])),l.renderSlot(n.$slots,"search-separator",{},()=>[l.createElementVNode("hr",{class:l.normalizeClass(["search-separator",{"!mb-0 hidden":n.hiddenSearch}])},null,2)],!0)],6)],!0):l.createCommentVNode("",!0),l.createElementVNode("div",Wae,[n.loading?(l.openBlock(),l.createElementBlock("div",Jae,[l.createElementVNode("ul",ele,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(n.skeletonRows,u=>(l.openBlock(),l.createElementBlock("li",{key:u,class:"list-item"},tle))),128))])])):(l.openBlock(),l.createElementBlock("div",Kae,[n.filteredData.length?(l.openBlock(),l.createElementBlock("div",qae,[n.type!=="ordered"?(l.openBlock(),l.createElementBlock("ul",{key:0,class:l.normalizeClass(["list",`${n.type}-list`])},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(n.filteredData,(u,d)=>(l.openBlock(),l.createElementBlock("li",{key:d,class:"list-item",onClick:f=>n.$emit("click:list-item",u)},[l.renderSlot(n.$slots,"list-item",l.normalizeProps(l.guardReactiveProps({item:u})),()=>[l.createTextVNode(l.toDisplayString(u),1)],!0)],8,Gae))),128))],2)):(l.openBlock(),l.createElementBlock("ol",Yae,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(n.filteredData,(u,d)=>(l.openBlock(),l.createElementBlock("li",{key:d,class:"list-item",onClick:f=>n.$emit("click:list-item",u)},[l.renderSlot(n.$slots,"list-item",l.normalizeProps(l.guardReactiveProps({item:u})),()=>[l.createTextVNode(l.toDisplayString(u),1)],!0)],8,Qae))),128))]))])):(l.openBlock(),l.createElementBlock("div",Xae,[l.renderSlot(n.$slots,"no-results",{},()=>[l.createElementVNode("p",null,l.toDisplayString(n.noResultMessage||n.$t("HC_NO_RESULTS_FOUND")),1)],!0)]))]))],512)],8,Vae)}const rle=ye(Fae,[["render",nle],["__scopeId","data-v-7f414e39"]]),ile=l.defineComponent({name:"QModalContent",props:{useFlex:{type:Boolean,default:!1},contentClass:{type:String,default:""},footerClass:{type:String,default:""}},setup(n,{slots:e}){const t=l.inject("size"),r=l.computed(()=>!!e.header),i=l.computed(()=>!!e.footer);return{modalSize:t,hasHeader:r,hasFooter:i}}}),ole={key:0,class:"modal-title mb-2"},sle={class:"text-lg pb-4 font-bold leading-6"};function ale(n,e,t,r,i,o){return l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["modal-content",n.useFlex?"flex flex-col min-h-full":"","modal-"+n.modalSize])},[n.hasHeader?(l.openBlock(),l.createElementBlock("div",ole,[l.createElementVNode("h2",sle,[l.renderSlot(n.$slots,"header",{},void 0,!0)])])):l.createCommentVNode("",!0),l.createElementVNode("div",{class:l.normalizeClass(["modal-body",n.useFlex?"flex-grow":"",n.contentClass])},[l.renderSlot(n.$slots,"body",{},void 0,!0)],2),n.hasFooter?(l.openBlock(),l.createElementBlock("div",{key:1,class:l.normalizeClass(["modal-actions",n.footerClass])},[l.renderSlot(n.$slots,"footer",{},void 0,!0)],2)):l.createCommentVNode("",!0)],2)}const lle=ye(ile,[["render",ale],["__scopeId","data-v-01edcc7b"]]),cle=l.defineComponent({name:"QPageHeading",props:{backgroundColor:{type:String,default:"green-20"},color:{type:String,default:"white"},fixedTopOffset:{type:Number,default:0}},setup(n){const e=l.ref(!1),t=l.ref(),r=l.ref(),i=()=>{if(r.value){const o=r.value.offsetTop-n.fixedTopOffset;e.value=!!n.fixedTopOffset&&r.value&&window.scrollY>=o,t.value.style.top=e.value?`${n.fixedTopOffset}px`:"",t.value.style.width=e.value?`${r.value.clientWidth}px`:""}};return l.onMounted(()=>{window.addEventListener("resize",i),window.addEventListener("scroll",i)}),{isFixed:e,pageHeading:t,pageHeadingContainer:r,determineFixed:i}}}),ule={class:"flex-grow mb-0"};function dle(n,e,t,r,i,o){return l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["page-heading-container",{"pt-[3.5rem]":n.isFixed}]),ref:"pageHeadingContainer"},[l.createElementVNode("div",{class:l.normalizeClass(["page-heading flex items-center text-left",`background-${n.backgroundColor}`,`text-${n.color}`,{fixed:n.isFixed}]),ref:"pageHeading"},[l.createElementVNode("h1",ule,[l.renderSlot(n.$slots,"default",{},void 0,!0)]),l.renderSlot(n.$slots,"actions",{},void 0,!0)],2)],2)}const fle=ye(cle,[["render",dle],["__scopeId","data-v-99e0d86b"]]),hle=l.defineComponent({name:"QPageNavigation",props:{fixedTopOffset:{type:Number,default:0}},setup(){return{}}}),ple={class:"navigation-links"};function mle(n,e,t,r,i,o){return l.openBlock(),l.createElementBlock("div",{id:"page-navigation",style:l.normalizeStyle(`top: ${n.fixedTopOffset}px;`)},[l.createElementVNode("div",ple,[l.renderSlot(n.$slots,"default",{},void 0,!0)])],4)}const gle=ye(hle,[["render",mle],["__scopeId","data-v-bddbe9bd"]]);function Bw(n){return n===0?!1:Array.isArray(n)&&n.length===0?!0:!n}function yle(n){return(...e)=>!n(...e)}function ble(n,e){return n===void 0&&(n="undefined"),n===null&&(n="null"),n===!1&&(n="false"),n.toString().toLowerCase().indexOf(e.trim())!==-1}function vO(n,e,t,r){return e?n.filter(i=>ble(r(i,t),e)).sort((i,o)=>r(i,t).length-r(o,t).length):n}function wle(n){return n.filter(e=>!e.$isLabel)}function Rw(n,e){return t=>t.reduce((r,i)=>i[n]&&i[n].length?(r.push({$groupLabel:i[e],$isLabel:!0}),r.concat(i[n])):r,[])}function vle(n,e,t,r,i){return o=>o.map(s=>{if(!s[t])return console.warn("Options passed to vue-multiselect do not contain groups, despite the config."),[];const a=vO(s[t],n,e,i);return a.length?{[r]:s[r],[t]:a}:[]})}const CO=(...n)=>e=>n.reduce((t,r)=>r(t),e);var Cle={data(){return{search:"",isOpen:!1,preferredOpenDirection:"below",optimizedHeight:this.maxHeight}},props:{internalSearch:{type:Boolean,default:!0},options:{type:Array,required:!0},multiple:{type:Boolean,default:!1},trackBy:{type:String},label:{type:String},searchable:{type:Boolean,default:!0},clearOnSelect:{type:Boolean,default:!0},hideSelected:{type:Boolean,default:!1},placeholder:{type:String,default:"Select option"},allowEmpty:{type:Boolean,default:!0},resetAfter:{type:Boolean,default:!1},closeOnSelect:{type:Boolean,default:!0},customLabel:{type:Function,default(n,e){return Bw(n)?"":e?n[e]:n}},taggable:{type:Boolean,default:!1},tagPlaceholder:{type:String,default:"Press enter to create a tag"},tagPosition:{type:String,default:"top"},max:{type:[Number,Boolean],default:!1},id:{default:null},optionsLimit:{type:Number,default:1e3},groupValues:{type:String},groupLabel:{type:String},groupSelect:{type:Boolean,default:!1},blockKeys:{type:Array,default(){return[]}},preserveSearch:{type:Boolean,default:!1},preselectFirst:{type:Boolean,default:!1},preventAutofocus:{type:Boolean,default:!1}},mounted(){!this.multiple&&this.max&&console.warn("[Vue-Multiselect warn]: Max prop should not be used when prop Multiple equals false."),this.preselectFirst&&!this.internalValue.length&&this.options.length&&this.select(this.filteredOptions[0])},computed:{internalValue(){return this.modelValue||this.modelValue===0?Array.isArray(this.modelValue)?this.modelValue:[this.modelValue]:[]},filteredOptions(){const n=this.search||"",e=n.toLowerCase().trim();let t=this.options.concat();return this.internalSearch?t=this.groupValues?this.filterAndFlat(t,e,this.label):vO(t,e,this.label,this.customLabel):t=this.groupValues?Rw(this.groupValues,this.groupLabel)(t):t,t=this.hideSelected?t.filter(yle(this.isSelected)):t,this.taggable&&e.length&&!this.isExistingOption(e)&&(this.tagPosition==="bottom"?t.push({isTag:!0,label:n}):t.unshift({isTag:!0,label:n})),t.slice(0,this.optionsLimit)},valueKeys(){return this.trackBy?this.internalValue.map(n=>n[this.trackBy]):this.internalValue},optionKeys(){return(this.groupValues?this.flatAndStrip(this.options):this.options).map(e=>this.customLabel(e,this.label).toString().toLowerCase())},currentOptionLabel(){return this.multiple?this.searchable?"":this.placeholder:this.internalValue.length?this.getOptionLabel(this.internalValue[0]):this.searchable?"":this.placeholder}},watch:{internalValue:{handler(){this.resetAfter&&this.internalValue.length&&(this.search="",this.$emit("update:modelValue",this.multiple?[]:null))},deep:!0},search(){this.$emit("search-change",this.search)}},emits:["open","search-change","close","select","update:modelValue","remove","tag"],methods:{getValue(){return this.multiple?this.internalValue:this.internalValue.length===0?null:this.internalValue[0]},filterAndFlat(n,e,t){return CO(vle(e,t,this.groupValues,this.groupLabel,this.customLabel),Rw(this.groupValues,this.groupLabel))(n)},flatAndStrip(n){return CO(Rw(this.groupValues,this.groupLabel),wle)(n)},updateSearch(n){this.search=n},isExistingOption(n){return this.options?this.optionKeys.indexOf(n)>-1:!1},isSelected(n){const e=this.trackBy?n[this.trackBy]:n;return this.valueKeys.indexOf(e)>-1},isOptionDisabled(n){return!!n.$isDisabled},getOptionLabel(n){if(Bw(n))return"";if(n.isTag)return n.label;if(n.$isLabel)return n.$groupLabel;const e=this.customLabel(n,this.label);return Bw(e)?"":e},select(n,e){if(n.$isLabel&&this.groupSelect){this.selectGroup(n);return}if(!(this.blockKeys.indexOf(e)!==-1||this.disabled||n.$isDisabled||n.$isLabel)&&!(this.max&&this.multiple&&this.internalValue.length===this.max)&&!(e==="Tab"&&!this.pointerDirty)){if(n.isTag)this.$emit("tag",n.label,this.id),this.search="",this.closeOnSelect&&!this.multiple&&this.deactivate();else{if(this.isSelected(n)){e!=="Tab"&&this.removeElement(n);return}this.multiple?this.$emit("update:modelValue",this.internalValue.concat([n])):this.$emit("update:modelValue",n),this.$emit("select",n,this.id),this.clearOnSelect&&(this.search="")}this.closeOnSelect&&this.deactivate()}},selectGroup(n){const e=this.options.find(t=>t[this.groupLabel]===n.$groupLabel);if(e){if(this.wholeGroupSelected(e)){this.$emit("remove",e[this.groupValues],this.id);const t=this.internalValue.filter(r=>e[this.groupValues].indexOf(r)===-1);this.$emit("update:modelValue",t)}else{let t=e[this.groupValues].filter(r=>!(this.isOptionDisabled(r)||this.isSelected(r)));this.max&&t.splice(this.max-this.internalValue.length),this.$emit("select",t,this.id),this.$emit("update:modelValue",this.internalValue.concat(t))}this.closeOnSelect&&this.deactivate()}},wholeGroupSelected(n){return n[this.groupValues].every(e=>this.isSelected(e)||this.isOptionDisabled(e))},wholeGroupDisabled(n){return n[this.groupValues].every(this.isOptionDisabled)},removeElement(n,e=!0){if(this.disabled||n.$isDisabled)return;if(!this.allowEmpty&&this.internalValue.length<=1){this.deactivate();return}const t=typeof n=="object"?this.valueKeys.indexOf(n[this.trackBy]):this.valueKeys.indexOf(n);if(this.multiple){const r=this.internalValue.slice(0,t).concat(this.internalValue.slice(t+1));this.$emit("update:modelValue",r)}else this.$emit("update:modelValue",null);this.$emit("remove",n,this.id),this.closeOnSelect&&e&&this.deactivate()},removeLastElement(){this.blockKeys.indexOf("Delete")===-1&&this.search.length===0&&Array.isArray(this.internalValue)&&this.internalValue.length&&this.removeElement(this.internalValue[this.internalValue.length-1],!1)},activate(){this.isOpen||this.disabled||(this.adjustPosition(),this.groupValues&&this.pointer===0&&this.filteredOptions.length&&(this.pointer=1),this.isOpen=!0,this.searchable?(this.preserveSearch||(this.search=""),this.preventAutofocus||this.$nextTick(()=>this.$refs.search&&this.$refs.search.focus())):this.preventAutofocus||typeof this.$el<"u"&&this.$el.focus(),this.$emit("open",this.id))},deactivate(){this.isOpen&&(this.isOpen=!1,this.searchable?this.$refs.search!==null&&typeof this.$refs.search<"u"&&this.$refs.search.blur():typeof this.$el<"u"&&this.$el.blur(),this.preserveSearch||(this.search=""),this.$emit("close",this.getValue(),this.id))},toggle(){this.isOpen?this.deactivate():this.activate()},adjustPosition(){if(typeof window>"u")return;const n=this.$el.getBoundingClientRect().top,e=window.innerHeight-this.$el.getBoundingClientRect().bottom;e>this.maxHeight||e>n||this.openDirection==="below"||this.openDirection==="bottom"?(this.preferredOpenDirection="below",this.optimizedHeight=Math.min(e-40,this.maxHeight)):(this.preferredOpenDirection="above",this.optimizedHeight=Math.min(n-40,this.maxHeight))}}},kle={data(){return{pointer:0,pointerDirty:!1}},props:{showPointer:{type:Boolean,default:!0},optionHeight:{type:Number,default:40}},computed:{pointerPosition(){return this.pointer*this.optionHeight},visibleElements(){return this.optimizedHeight/this.optionHeight}},watch:{filteredOptions(){this.pointerAdjust()},isOpen(){this.pointerDirty=!1},pointer(){this.$refs.search&&this.$refs.search.setAttribute("aria-activedescendant",this.id+"-"+this.pointer.toString())}},methods:{optionHighlight(n,e){return{"multiselect__option--highlight":n===this.pointer&&this.showPointer,"multiselect__option--selected":this.isSelected(e)}},groupHighlight(n,e){if(!this.groupSelect)return["multiselect__option--disabled",{"multiselect__option--group":e.$isLabel}];const t=this.options.find(r=>r[this.groupLabel]===e.$groupLabel);return t&&!this.wholeGroupDisabled(t)?["multiselect__option--group",{"multiselect__option--highlight":n===this.pointer&&this.showPointer},{"multiselect__option--group-selected":this.wholeGroupSelected(t)}]:"multiselect__option--disabled"},addPointerElement({key:n}="Enter"){this.filteredOptions.length>0&&this.select(this.filteredOptions[this.pointer],n),this.pointerReset()},pointerForward(){this.pointer<this.filteredOptions.length-1&&(this.pointer++,this.$refs.list.scrollTop<=this.pointerPosition-(this.visibleElements-1)*this.optionHeight&&(this.$refs.list.scrollTop=this.pointerPosition-(this.visibleElements-1)*this.optionHeight),this.filteredOptions[this.pointer]&&this.filteredOptions[this.pointer].$isLabel&&!this.groupSelect&&this.pointerForward()),this.pointerDirty=!0},pointerBackward(){this.pointer>0?(this.pointer--,this.$refs.list.scrollTop>=this.pointerPosition&&(this.$refs.list.scrollTop=this.pointerPosition),this.filteredOptions[this.pointer]&&this.filteredOptions[this.pointer].$isLabel&&!this.groupSelect&&this.pointerBackward()):this.filteredOptions[this.pointer]&&this.filteredOptions[0].$isLabel&&!this.groupSelect&&this.pointerForward(),this.pointerDirty=!0},pointerReset(){this.closeOnSelect&&(this.pointer=0,this.$refs.list&&(this.$refs.list.scrollTop=0))},pointerAdjust(){this.pointer>=this.filteredOptions.length-1&&(this.pointer=this.filteredOptions.length?this.filteredOptions.length-1:0),this.filteredOptions.length>0&&this.filteredOptions[this.pointer].$isLabel&&!this.groupSelect&&this.pointerForward()},pointerSet(n){this.pointer=n,this.pointerDirty=!0}}},kO={name:"vue-multiselect",mixins:[Cle,kle],compatConfig:{MODE:3,ATTR_ENUMERATED_COERCION:!1},props:{name:{type:String,default:""},modelValue:{type:null,default(){return[]}},selectLabel:{type:String,default:"Press enter to select"},selectGroupLabel:{type:String,default:"Press enter to select group"},selectedLabel:{type:String,default:"Selected"},deselectLabel:{type:String,default:"Press enter to remove"},deselectGroupLabel:{type:String,default:"Press enter to deselect group"},showLabels:{type:Boolean,default:!0},limit:{type:Number,default:99999},maxHeight:{type:Number,default:300},limitText:{type:Function,default:n=>`and ${n} more`},loading:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},openDirection:{type:String,default:""},showNoOptions:{type:Boolean,default:!0},showNoResults:{type:Boolean,default:!0},tabindex:{type:Number,default:0}},computed:{hasOptionGroup(){return this.groupValues&&this.groupLabel&&this.groupSelect},isSingleLabelVisible(){return(this.singleValue||this.singleValue===0)&&(!this.isOpen||!this.searchable)&&!this.visibleValues.length},isPlaceholderVisible(){return!this.internalValue.length&&(!this.searchable||!this.isOpen)},visibleValues(){return this.multiple?this.internalValue.slice(0,this.limit):[]},singleValue(){return this.internalValue[0]},deselectLabelText(){return this.showLabels?this.deselectLabel:""},deselectGroupLabelText(){return this.showLabels?this.deselectGroupLabel:""},selectLabelText(){return this.showLabels?this.selectLabel:""},selectGroupLabelText(){return this.showLabels?this.selectGroupLabel:""},selectedLabelText(){return this.showLabels?this.selectedLabel:""},inputStyle(){return this.searchable||this.multiple&&this.modelValue&&this.modelValue.length?this.isOpen?{width:"100%"}:{width:"0",position:"absolute",padding:"0"}:""},contentStyle(){return this.options.length?{display:"inline-block"}:{display:"block"}},isAbove(){return this.openDirection==="above"||this.openDirection==="top"?!0:this.openDirection==="below"||this.openDirection==="bottom"?!1:this.preferredOpenDirection==="above"},showSearchInput(){return this.searchable&&(this.hasSingleSelectedSlot&&(this.visibleSingleValue||this.visibleSingleValue===0)?this.isOpen:!0)}}};const Sle={ref:"tags",class:"multiselect__tags"},Mle={class:"multiselect__tags-wrap"},Ele={class:"multiselect__spinner"},Ale={key:0},Tle={class:"multiselect__option"},xle={class:"multiselect__option"},Ile=l.createTextVNode("No elements found. Consider changing the search query."),Ole={class:"multiselect__option"},Dle=l.createTextVNode("List is empty.");function Nle(n,e,t,r,i,o){return l.openBlock(),l.createBlock("div",{tabindex:n.searchable?-1:t.tabindex,class:[{"multiselect--active":n.isOpen,"multiselect--disabled":t.disabled,"multiselect--above":o.isAbove,"multiselect--has-options-group":o.hasOptionGroup},"multiselect"],onFocus:e[14]||(e[14]=s=>n.activate()),onBlur:e[15]||(e[15]=s=>n.searchable?!1:n.deactivate()),onKeydown:[e[16]||(e[16]=l.withKeys(l.withModifiers(s=>n.pointerForward(),["self","prevent"]),["down"])),e[17]||(e[17]=l.withKeys(l.withModifiers(s=>n.pointerBackward(),["self","prevent"]),["up"]))],onKeypress:e[18]||(e[18]=l.withKeys(l.withModifiers(s=>n.addPointerElement(s),["stop","self"]),["enter","tab"])),onKeyup:e[19]||(e[19]=l.withKeys(s=>n.deactivate(),["esc"])),role:"combobox","aria-owns":"listbox-"+n.id},[l.renderSlot(n.$slots,"caret",{toggle:n.toggle},()=>[l.createVNode("div",{onMousedown:e[1]||(e[1]=l.withModifiers(s=>n.toggle(),["prevent","stop"])),class:"multiselect__select"},null,32)]),l.renderSlot(n.$slots,"clear",{search:n.search}),l.createVNode("div",Sle,[l.renderSlot(n.$slots,"selection",{search:n.search,remove:n.removeElement,values:o.visibleValues,isOpen:n.isOpen},()=>[l.withDirectives(l.createVNode("div",Mle,[(l.openBlock(!0),l.createBlock(l.Fragment,null,l.renderList(o.visibleValues,(s,a)=>l.renderSlot(n.$slots,"tag",{option:s,search:n.search,remove:n.removeElement},()=>[(l.openBlock(),l.createBlock("span",{class:"multiselect__tag",key:a},[l.createVNode("span",{textContent:l.toDisplayString(n.getOptionLabel(s))},null,8,["textContent"]),l.createVNode("i",{tabindex:"1",onKeypress:l.withKeys(l.withModifiers(c=>n.removeElement(s),["prevent"]),["enter"]),onMousedown:l.withModifiers(c=>n.removeElement(s),["prevent"]),class:"multiselect__tag-icon"},null,40,["onKeypress","onMousedown"])]))])),256))],512),[[l.vShow,o.visibleValues.length>0]]),n.internalValue&&n.internalValue.length>t.limit?l.renderSlot(n.$slots,"limit",{key:0},()=>[l.createVNode("strong",{class:"multiselect__strong",textContent:l.toDisplayString(t.limitText(n.internalValue.length-t.limit))},null,8,["textContent"])]):l.createCommentVNode("v-if",!0)]),l.createVNode(l.Transition,{name:"multiselect__loading"},{default:l.withCtx(()=>[l.renderSlot(n.$slots,"loading",{},()=>[l.withDirectives(l.createVNode("div",Ele,null,512),[[l.vShow,t.loading]])])]),_:3}),n.searchable?(l.openBlock(),l.createBlock("input",{key:0,ref:"search",name:t.name,id:n.id,type:"text",autocomplete:"off",spellcheck:!1,placeholder:n.placeholder,style:o.inputStyle,value:n.search,disabled:t.disabled,tabindex:t.tabindex,onInput:e[2]||(e[2]=s=>n.updateSearch(s.target.value)),onFocus:e[3]||(e[3]=l.withModifiers(s=>n.activate(),["prevent"])),onBlur:e[4]||(e[4]=l.withModifiers(s=>n.deactivate(),["prevent"])),onKeyup:e[5]||(e[5]=l.withKeys(s=>n.deactivate(),["esc"])),onKeydown:[e[6]||(e[6]=l.withKeys(l.withModifiers(s=>n.pointerForward(),["prevent"]),["down"])),e[7]||(e[7]=l.withKeys(l.withModifiers(s=>n.pointerBackward(),["prevent"]),["up"])),e[9]||(e[9]=l.withKeys(l.withModifiers(s=>n.removeLastElement(),["stop"]),["delete"]))],onKeypress:e[8]||(e[8]=l.withKeys(l.withModifiers(s=>n.addPointerElement(s),["prevent","stop","self"]),["enter"])),class:"multiselect__input","aria-controls":"listbox-"+n.id},null,44,["name","id","placeholder","value","disabled","tabindex","aria-controls"])):l.createCommentVNode("v-if",!0),o.isSingleLabelVisible?(l.openBlock(),l.createBlock("span",{key:1,class:"multiselect__single",onMousedown:e[10]||(e[10]=l.withModifiers((...s)=>n.toggle&&n.toggle(...s),["prevent"]))},[l.renderSlot(n.$slots,"singleLabel",{option:o.singleValue},()=>[l.createTextVNode(l.toDisplayString(n.currentOptionLabel),1)])],32)):l.createCommentVNode("v-if",!0),o.isPlaceholderVisible?(l.openBlock(),l.createBlock("span",{key:2,class:"multiselect__placeholder",onMousedown:e[11]||(e[11]=l.withModifiers((...s)=>n.toggle&&n.toggle(...s),["prevent"]))},[l.renderSlot(n.$slots,"placeholder",{},()=>[l.createTextVNode(l.toDisplayString(n.placeholder),1)])],32)):l.createCommentVNode("v-if",!0)],512),l.createVNode(l.Transition,{name:"multiselect"},{default:l.withCtx(()=>[l.withDirectives(l.createVNode("div",{class:"multiselect__content-wrapper",onFocus:e[12]||(e[12]=(...s)=>n.activate&&n.activate(...s)),tabindex:"-1",onMousedown:e[13]||(e[13]=l.withModifiers(()=>{},["prevent"])),style:{maxHeight:n.optimizedHeight+"px"},ref:"list"},[l.createVNode("ul",{class:"multiselect__content",style:o.contentStyle,role:"listbox",id:"listbox-"+n.id},[l.renderSlot(n.$slots,"beforeList"),n.multiple&&n.max===n.internalValue.length?(l.openBlock(),l.createBlock("li",Ale,[l.createVNode("span",Tle,[l.renderSlot(n.$slots,"maxElements",{},()=>[l.createTextVNode("Maximum of "+l.toDisplayString(n.max)+" options selected. First remove a selected option to select another.",1)])])])):l.createCommentVNode("v-if",!0),!n.max||n.internalValue.length<n.max?(l.openBlock(!0),l.createBlock(l.Fragment,{key:1},l.renderList(n.filteredOptions,(s,a)=>(l.openBlock(),l.createBlock("li",{class:"multiselect__element",key:a,id:n.id+"-"+a,role:s&&(s.$isLabel||s.$isDisabled)?null:"option"},[s&&(s.$isLabel||s.$isDisabled)?l.createCommentVNode("v-if",!0):(l.openBlock(),l.createBlock("span",{key:0,class:[n.optionHighlight(a,s),"multiselect__option"],onClick:l.withModifiers(c=>n.select(s),["stop"]),onMouseenter:l.withModifiers(c=>n.pointerSet(a),["self"]),"data-select":s&&s.isTag?n.tagPlaceholder:o.selectLabelText,"data-selected":o.selectedLabelText,"data-deselect":o.deselectLabelText},[l.renderSlot(n.$slots,"option",{option:s,search:n.search,index:a},()=>[l.createVNode("span",null,l.toDisplayString(n.getOptionLabel(s)),1)])],42,["onClick","onMouseenter","data-select","data-selected","data-deselect"])),s&&(s.$isLabel||s.$isDisabled)?(l.openBlock(),l.createBlock("span",{key:1,"data-select":n.groupSelect&&o.selectGroupLabelText,"data-deselect":n.groupSelect&&o.deselectGroupLabelText,class:[n.groupHighlight(a,s),"multiselect__option"],onMouseenter:l.withModifiers(c=>n.groupSelect&&n.pointerSet(a),["self"]),onMousedown:l.withModifiers(c=>n.selectGroup(s),["prevent"])},[l.renderSlot(n.$slots,"option",{option:s,search:n.search,index:a},()=>[l.createVNode("span",null,l.toDisplayString(n.getOptionLabel(s)),1)])],42,["data-select","data-deselect","onMouseenter","onMousedown"])):l.createCommentVNode("v-if",!0)],8,["id","role"]))),128)):l.createCommentVNode("v-if",!0),l.withDirectives(l.createVNode("li",null,[l.createVNode("span",xle,[l.renderSlot(n.$slots,"noResult",{search:n.search},()=>[Ile])])],512),[[l.vShow,t.showNoResults&&n.filteredOptions.length===0&&n.search&&!t.loading]]),l.withDirectives(l.createVNode("li",null,[l.createVNode("span",Ole,[l.renderSlot(n.$slots,"noOptions",{},()=>[Dle])])],512),[[l.vShow,t.showNoOptions&&(n.options.length===0||o.hasOptionGroup===!0&&n.filteredOptions.length===0)&&!n.search&&!t.loading]]),l.renderSlot(n.$slots,"afterList")],12,["id"])],36),[[l.vShow,n.isOpen]])]),_:3})],42,["tabindex","aria-owns"])}kO.render=Nle;const Ple=l.defineComponent({name:"QSelect",components:{QBadge:Da,VueMultiselect:kO},props:{id:{type:String,default:""},options:{type:[Array,Object],required:!0},modelValue:{type:[String,Number,Array,Object],default:""},trackBy:{type:String,default:"id"},label:{type:String,default:"label"},placeholder:{type:String,default:""},multiple:{type:Boolean,default:!1},taggable:{type:Boolean,default:!1},searchable:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},groupValues:{type:String,default:""},groupLabel:{type:String,default:""},groupSelectable:{type:Boolean,default:!0},hasCheckboxes:{type:Boolean,default:!1},size:{type:String,default:"lg"},info:{type:String,default:""},allowEmpty:{type:Boolean,default:!0},blockKeys:{type:Array,default:()=>["Delete"]},noResultMessage:{type:String,default:""},selectionControl:{type:Boolean,default:!1},showExpanded:{type:Boolean,default:!1},showPlaceholderImage:{type:Boolean,default:!0},showSelectAll:{type:Boolean,default:!1},tagPlaceholder:{type:String,default:""},expand:{type:Boolean,default:!1},showSelectedCount:{type:Boolean,default:!1},truncateTag:{type:Boolean,default:!1},limitShown:{type:Number,default:null},validationMethod:{type:Function,default:()=>!0},showOptionDescription:{type:Boolean,default:!1},showTags:{type:Boolean,default:!1},openDirection:{type:String,default:"bottom"},useAddTagsOnly:{type:Boolean,default:!1}},emits:["update:model-value"],setup(n,{slots:e,emit:t}){const{t:r}=us(),i=l.ref(null),o=l.ref(null),s=l.ref(n.modelValue),a=l.ref(""),c=l.computed(()=>n.options.length+n.options.reduce((S,A)=>A.libs?S+A.libs.length:0,0)),u=l.computed(()=>!!e.action),d=l.computed(()=>n.noResultMessage||r("HC_PRESS_ENTER_TO_CREATE_A_TAG")),f=l.computed(()=>n.tagPlaceholder||r("HC_PRESS_ENTER_TO_CREATE_A_TAG")),h=l.computed(()=>c.value===s.value.length?r("HC_ALL"):s.value.length>1?r("HC_MULTIPLE_SELECTED"):s.value[0].label||s.value[0].name||""),p=l.computed(()=>n.taggable||n.showTags),m=S=>{t("update:model-value",S)},y=S=>{a.value=S},b=async S=>{const A={label:S,name:S,added:!0};if(!n.validationMethod(A)){await l.nextTick(),i.value.search=S;return}},w=()=>{s.value=[],t("update:model-value",s.value)},v=S=>{typeof S=="number"&&S>=0?s.value.splice(S,1):s.value=[],l.nextTick(()=>{t("update:model-value",s.value)})},k=S=>{n.multiple&&s.value&&S.length===s.value.length&&l.nextTick(()=>{s.value=[],t("update:model-value",s.value)})},C=async()=>{if(o.value&&n.searchable){await l.nextTick();const S=o.value.querySelector(".multiselect__content-wrapper"),A=o.value.querySelector(".multiselect__input");A.style.width=S.clientWidth+"px"}},T=async()=>{if(!i.value)return;const S=i.value;s.value=[],n.groupValues?S.filteredOptions.forEach(A=>{s.value.push(A)}):s.value=S.filteredOptions,t("update:model-value",s.value)};return l.watch(()=>n.modelValue,S=>{s.value=S}),{currentSelect:i,search:a,selected:s,hasAction:u,noResultsText:d,noTagFound:f,selectedCount:c,selectedText:h,useTags:p,addTag:b,clearAll:w,onOpen:C,onRemove:k,onUpdateValue:m,removeElement:v,searchChange:y,selectAll:T}}}),_le=["id"],Lle=["onMousedown"],Ble={key:1,class:"searchable-placeholder"},Rle={class:"flex gap-2 px-4 py-3"},$le={key:0,class:"tag-container"},Fle={key:0},Vle={class:l.normalizeClass(["tag-name text-sm leading-normal pr-2 capitalize"])},jle={key:1},zle=["onClick"],Hle={key:0,class:"text-blue-20 text-xs count"},Ule={key:0,class:"text-inkwell-10 text-right truncate font-normal"},Zle={key:1,class:"text-blue-20 text-xs ml-2"},Wle={class:"text-inkwell-40"},Kle={class:"text-inkwell-10 text-right truncate"},qle={key:1,class:"option-selected text-gray-40"},Gle={key:3,class:"flex w-full justify-between"},Yle={class:"text-inkwell-40 pl-1 text-base font-medium"},Qle=["title"],Xle={key:2,class:"option-description text-xs pt-0.5 truncate"};function Jle(n,e,t,r,i,o){const s=l.resolveComponent("q-icon"),a=l.resolveComponent("q-button"),c=l.resolveComponent("q-badge"),u=l.resolveComponent("vue-multiselect");return l.openBlock(),l.createElementBlock("div",{id:n.id+"-containers",class:"control custom-select",ref:"currentContainer"},[l.createVNode(u,{id:n.id,ref:"currentSelect",modelValue:n.selected,"onUpdate:modelValue":[e[1]||(e[1]=d=>n.selected=d),e[4]||(e[4]=d=>n.onUpdateValue(d))],options:n.options,searchable:n.searchable,multiple:n.multiple,taggable:n.taggable||n.useAddTagsOnly,label:n.label,"track-by":n.trackBy,"group-values":n.groupValues,"group-label":n.groupLabel,"group-select":n.groupSelectable,"block-keys":n.blockKeys,class:l.normalizeClass([{"has-checkboxes":n.hasCheckboxes},{"selection-control":n.selectionControl},{"select-multiple":!!n.multiple},{"select-taggable":!!n.taggable||!!n.showTags||!!n.useAddTagsOnly},{"select-expand":n.expand},{"select-show-count":!!n.showSelectedCount},{"select-search":!!n.search},{"select-searchable":n.searchable},n.searchable?"cursor-text":"cursor-default","q-select rounded","select-"+n.size]),disabled:n.disabled,"allow-empty":n.allowEmpty,"clear-on-select":!0,"close-on-select":!n.hasCheckboxes&&!n.multiple,"show-tags":n.showTags,"tag-placeholder":n.noTagFound,placeholder:n.placeholder,"preserve-search":!0,"reset-after":!1,"max-height":280,"open-direction":n.openDirection,"select-label":"","deselect-label":"","selected-label":"","select-group-label":"","deselect-group-label":"",onOpen:n.onOpen,onRemove:e[2]||(e[2]=d=>n.onRemove(d)),onTag:n.addTag,onSearchChange:e[3]||(e[3]=d=>n.searchChange(d))},l.createSlots({caret:l.withCtx(({toggle:d})=>[l.createElementVNode("div",{class:l.normalizeClass(["h-full w-full","absolute left-0 top-0","z-[1] cursor-pointer","flex justify-end"]),onMousedown:l.withModifiers(d,["prevent"])},[l.createVNode(s,{icon:"chevron-down",type:"line"})],40,Lle),n.searchable?(l.openBlock(),l.createBlock(s,{key:0,class:"search-icon",color:n.selectionControl?"inkwell-0":"gray-40",icon:"search",type:""},null,8,["color"])):l.createCommentVNode("",!0),n.searchable&&(n.multiple&&!n.selected.length||!n.multiple&&!n.selected)&&!n.selectionControl?(l.openBlock(),l.createElementBlock("div",Ble,l.toDisplayString(n.placeholder),1)):l.createCommentVNode("",!0)]),noResult:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(n.noResultsText),1)]),singleLabel:l.withCtx(({option:d})=>[d.icon?(l.openBlock(),l.createBlock(s,{key:0,icon:d.icon},null,8,["icon"])):l.createCommentVNode("",!0),d&&n.showPlaceholderImage?l.renderSlot(n.$slots,"optionPrefix",l.normalizeProps(l.mergeProps({key:1},d)),void 0,!0):l.createCommentVNode("",!0),n.selectionControl?l.renderSlot(n.$slots,"controlPlaceholder",{key:2},()=>[l.createTextVNode(l.toDisplayString(n.placeholder),1)],!0):l.createCommentVNode("",!0),l.createElementVNode("span",{class:l.normalizeClass(["option-name",{"text-inkwell-10 text-right truncate":n.selectionControl}])},l.toDisplayString(d.label||d.name||d),3)]),selection:l.withCtx(({values:d,isOpen:f})=>{var h,p,m,y;return[n.useTags?(l.openBlock(),l.createElementBlock("div",$le,[n.groupValues&&n.options[0][n.groupValues].length===d.length?(l.openBlock(),l.createElementBlock("div",Fle,[l.createElementVNode("div",{class:l.normalizeClass(["multiselect__tag inline-flex items-center justify-center rounded me-2 z-[1]",{"tag-gray":!!n.showTags}])},[l.createElementVNode("span",Vle,l.toDisplayString(n.groupLabel),1),l.createElementVNode("span",{class:"tag-remove cursor-pointer shrink",tabindex:"1",onMousedown:e[0]||(e[0]=l.withModifiers(b=>n.removeElement(n.options[0][n.groupValues]),["prevent","stop"]))},[l.createVNode(s,{icon:"close",color:"white",class:l.normalizeClass(["tag-close flex rounded-full p-1",n.showTags?"bg-inkwell-30":"bg-blue-40"]),type:"line"},null,8,["class"])],32)],2)])):(l.openBlock(),l.createElementBlock("div",jle,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(!n.expand&&n.limitShown?d.slice(0,n.limitShown):d,(b,w)=>(l.openBlock(),l.createElementBlock("div",{key:w,class:l.normalizeClass(["multiselect__tag !inline-flex items-center justify-center rounded mr-2 z-[1]",{"tag-added":b.added},{"tag-gray":!!n.showTags},b.tagClass?b.tagClass:""])},[b.icon?(l.openBlock(),l.createBlock(s,{key:0,icon:b.icon,class:"tag-icon"},null,8,["icon"])):l.createCommentVNode("",!0),l.createElementVNode("span",{class:l.normalizeClass(["tag-name text-sm leading-normal pr-2",{"tag-truncate":n.truncateTag}])},l.toDisplayString(b.label||b.name),3),l.createElementVNode("span",{class:"tag-remove cursor-pointer shrink",tabindex:"1",onClick:v=>n.removeElement(w)},[l.createVNode(s,{icon:"close-thick",color:"white",size:"sm",class:l.normalizeClass(["!p-[0.3rem] tag-close flex rounded-full p-1",b.closeTagClass?b.closeTagClass:n.showTags?"bg-inkwell-30":n.taggable&&b.added?"bg-green-40":"bg-blue-40"]),type:"line"},null,8,["class"])],8,zle)],2))),128)),!n.expand&&n.showSelectedCount&&n.multiple&&d.length>n.limitShown?(l.openBlock(),l.createElementBlock("span",Hle," + "+l.toDisplayString(d.length-n.limitShown)+" more... ",1)):l.createCommentVNode("",!0)]))])):l.createCommentVNode("",!0),!n.showTags&&!n.taggable&&n.multiple&&d.length?(l.openBlock(),l.createElementBlock("div",{key:1,class:l.normalizeClass(["multiselect__single flex w-full",n.selectionControl?"whitespace-nowrap justify-between":"items-center"])},[l.createElementVNode("span",{class:l.normalizeClass(["option-selected",{capitalize:n.groupValues&&n.options[0][n.groupValues].length===d.length}])},l.toDisplayString(n.selectionControl?n.placeholder:n.groupValues&&n.options[0][n.groupValues].length===d.length?n.groupLabel:d[0].label),3),n.selectionControl?(l.openBlock(),l.createElementBlock("span",Ule,l.toDisplayString(n.selectedText),1)):l.createCommentVNode("",!0),n.limitShown&&n.limitShown<d.length&&(!n.groupValues&&d.length!==n.limitShown||n.groupValues&&n.options[0][n.groupValues].length!==d.length)?(l.openBlock(),l.createElementBlock("span",Zle," + "+l.toDisplayString(d.length-n.limitShown)+" more... ",1)):l.createCommentVNode("",!0)],2)):f&&!n.useTags&&!n.multiple?(l.openBlock(),l.createElementBlock("div",{key:2,class:l.normalizeClass(["multiselect__single flex w-full",n.selectionControl?"justify-between":"items-center"])},[n.selectionControl?(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[l.createElementVNode("span",Wle,l.toDisplayString(n.placeholder||""),1),l.createElementVNode("span",Kle,l.toDisplayString(((h=n.selected)==null?void 0:h.label)||((p=n.selected)==null?void 0:p.name)||""),1)],64)):(l.openBlock(),l.createElementBlock("span",qle,l.toDisplayString(((m=n.selected)==null?void 0:m.label)||((y=n.selected)==null?void 0:y.name)||""),1))],2)):f&&!n.useTags&&n.multiple&&n.selectionControl?(l.openBlock(),l.createElementBlock("div",Gle,[l.createElementVNode("span",Yle,l.toDisplayString(n.placeholder||""),1)])):l.createCommentVNode("",!0)]}),option:l.withCtx(({option:d,search:f})=>[l.createElementVNode("div",{class:l.normalizeClass(["flex items-center w-full",{"option-search":d.label===f},{"option-disabled":d.isDisabled}]),title:d.label?d.label:""},[n.multiple&&n.hasCheckboxes?(l.openBlock(),l.createBlock(c,{key:0,"has-icon":!0,class:"selected-checkbox mr-2",shape:"square"},{icon:l.withCtx(()=>[l.createVNode(s,{icon:"check",color:"white",type:"line"})]),_:1})):l.createCommentVNode("",!0),l.createElementVNode("div",{class:l.normalizeClass(["option-icon-name flex items-center",!d.$groupLabel&&n.groupLabel?"pl-0":""])},[d.icon?(l.openBlock(),l.createBlock(s,{key:0,icon:d.icon,class:"mr-1"},null,8,["icon"])):l.createCommentVNode("",!0),d?l.renderSlot(n.$slots,"optionPrefix",l.normalizeProps(l.mergeProps({key:1},d)),void 0,!0):l.createCommentVNode("",!0),l.createElementVNode("div",{class:l.normalizeClass(["option-name",[d.optionClass?d.optionClass:""]])},l.toDisplayString(d.$groupLabel||d.label||d.name||d),3),d.description&&n.showOptionDescription?(l.openBlock(),l.createElementBlock("div",Xle,l.toDisplayString(d.description),1)):l.createCommentVNode("",!0),n.multiple&&n.hasCheckboxes?l.createCommentVNode("",!0):(l.openBlock(),l.createBlock(s,{key:3,icon:"check",size:"sm",type:"line",color:"inkwell-30",class:"selected-icon"}))],2)],10,Qle)]),_:2},[n.showSelectAll?{name:"beforeList",fn:l.withCtx(()=>[l.createElementVNode("div",Rle,[l.createVNode(a,{disabled:n.selectedCount===n.selected.length,"no-min-width":!0,class:"!text-sm !font-normal !leading-4",status:"link",onClick:n.selectAll},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(n.$t("HC_SELECT_ALL")),1)]),_:1},8,["disabled","onClick"]),l.createVNode(a,{disabled:!n.selected.length,"no-min-width":!0,class:"!text-sm !font-normal !leading-4",status:"link",onClick:n.clearAll},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(n.$t("HC_CLEAR_ALL")),1)]),_:1},8,["disabled","onClick"])])]),key:"0"}:void 0]),1032,["id","modelValue","options","searchable","multiple","taggable","label","track-by","group-values","group-label","group-select","block-keys","class","disabled","allow-empty","close-on-select","show-tags","tag-placeholder","placeholder","open-direction","onOpen","onTag"])],8,_le)}const e0e=ye(Ple,[["render",Jle],["__scopeId","data-v-19be4f40"]]);var It={STARTS_WITH:"startsWith",CONTAINS:"contains",NOT_CONTAINS:"notContains",ENDS_WITH:"endsWith",EQUALS:"equals",NOT_EQUALS:"notEquals",IN:"in",LESS_THAN:"lt",LESS_THAN_OR_EQUAL_TO:"lte",GREATER_THAN:"gt",GREATER_THAN_OR_EQUAL_TO:"gte",BETWEEN:"between",DATE_IS:"dateIs",DATE_IS_NOT:"dateIsNot",DATE_BEFORE:"dateBefore",DATE_AFTER:"dateAfter"},l3={AND:"and",OR:"or"};function SO(n,e){var t=typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(!t){if(Array.isArray(n)||(t=t0e(n))||e&&n&&typeof n.length=="number"){t&&(n=t);var r=0,i=function(){};return{s:i,n:function(){return r>=n.length?{done:!0}:{done:!1,value:n[r++]}},e:function(u){throw u},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
252
252
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,s=!1,a;return{s:function(){t=t.call(n)},n:function(){var u=t.next();return o=u.done,u},e:function(u){s=!0,a=u},f:function(){try{!o&&t.return!=null&&t.return()}finally{if(s)throw a}}}}function t0e(n,e){if(n){if(typeof n=="string")return MO(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);if(t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set")return Array.from(n);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return MO(n,e)}}function MO(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=new Array(e);t<e;t++)r[t]=n[t];return r}var $w={filter:function(e,t,r,i,o){var s=[];if(!e)return s;var a=SO(e),c;try{for(a.s();!(c=a.n()).done;){var u=c.value;if(typeof u=="string"){if(this.filters[i](u,r,o)){s.push(u);continue}}else{var d=SO(t),f;try{for(d.s();!(f=d.n()).done;){var h=f.value,p=$.resolveFieldData(u,h);if(this.filters[i](p,r,o)){s.push(u);break}}}catch(m){d.e(m)}finally{d.f()}}}}catch(m){a.e(m)}finally{a.f()}return s},filters:{startsWith:function(e,t,r){if(t==null||t==="")return!0;if(e==null)return!1;var i=$.removeAccents(t.toString()).toLocaleLowerCase(r),o=$.removeAccents(e.toString()).toLocaleLowerCase(r);return o.slice(0,i.length)===i},contains:function(e,t,r){if(t==null||t==="")return!0;if(e==null)return!1;var i=$.removeAccents(t.toString()).toLocaleLowerCase(r),o=$.removeAccents(e.toString()).toLocaleLowerCase(r);return o.indexOf(i)!==-1},notContains:function(e,t,r){if(t==null||t==="")return!0;if(e==null)return!1;var i=$.removeAccents(t.toString()).toLocaleLowerCase(r),o=$.removeAccents(e.toString()).toLocaleLowerCase(r);return o.indexOf(i)===-1},endsWith:function(e,t,r){if(t==null||t==="")return!0;if(e==null)return!1;var i=$.removeAccents(t.toString()).toLocaleLowerCase(r),o=$.removeAccents(e.toString()).toLocaleLowerCase(r);return o.indexOf(i,o.length-i.length)!==-1},equals:function(e,t,r){return t==null||t===""?!0:e==null?!1:e.getTime&&t.getTime?e.getTime()===t.getTime():$.removeAccents(e.toString()).toLocaleLowerCase(r)==$.removeAccents(t.toString()).toLocaleLowerCase(r)},notEquals:function(e,t,r){return t==null||t===""?!1:e==null?!0:e.getTime&&t.getTime?e.getTime()!==t.getTime():$.removeAccents(e.toString()).toLocaleLowerCase(r)!=$.removeAccents(t.toString()).toLocaleLowerCase(r)},in:function(e,t){if(t==null||t.length===0)return!0;for(var r=0;r<t.length;r++)if($.equals(e,t[r]))return!0;return!1},between:function(e,t){return t==null||t[0]==null||t[1]==null?!0:e==null?!1:e.getTime?t[0].getTime()<=e.getTime()&&e.getTime()<=t[1].getTime():t[0]<=e&&e<=t[1]},lt:function(e,t){return t==null?!0:e==null?!1:e.getTime&&t.getTime?e.getTime()<t.getTime():e<t},lte:function(e,t){return t==null?!0:e==null?!1:e.getTime&&t.getTime?e.getTime()<=t.getTime():e<=t},gt:function(e,t){return t==null?!0:e==null?!1:e.getTime&&t.getTime?e.getTime()>t.getTime():e>t},gte:function(e,t){return t==null?!0:e==null?!1:e.getTime&&t.getTime?e.getTime()>=t.getTime():e>=t},dateIs:function(e,t){return t==null?!0:e==null?!1:e.toDateString()===t.toDateString()},dateIsNot:function(e,t){return t==null?!0:e==null?!1:e.toDateString()!==t.toDateString()},dateBefore:function(e,t){return t==null?!0:e==null?!1:e.getTime()<t.getTime()},dateAfter:function(e,t){return t==null?!0:e==null?!1:e.getTime()>t.getTime()}},register:function(e,t){this.filters[e]=t}},EO={name:"ArrowDownIcon",extends:Ve},n0e=l.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M6.99994 14C6.91097 14.0004 6.82281 13.983 6.74064 13.9489C6.65843 13.9148 6.58387 13.8646 6.52133 13.8013L1.10198 8.38193C0.982318 8.25351 0.917175 8.08367 0.920272 7.90817C0.923368 7.73267 0.994462 7.56523 1.11858 7.44111C1.24269 7.317 1.41014 7.2459 1.58563 7.2428C1.76113 7.23971 1.93098 7.30485 2.0594 7.42451L6.32263 11.6877V0.677419C6.32263 0.497756 6.394 0.325452 6.52104 0.198411C6.64808 0.0713706 6.82039 0 7.00005 0C7.17971 0 7.35202 0.0713706 7.47906 0.198411C7.6061 0.325452 7.67747 0.497756 7.67747 0.677419V11.6877L11.9407 7.42451C12.0691 7.30485 12.2389 7.23971 12.4144 7.2428C12.5899 7.2459 12.7574 7.317 12.8815 7.44111C13.0056 7.56523 13.0767 7.73267 13.0798 7.90817C13.0829 8.08367 13.0178 8.25351 12.8981 8.38193L7.47875 13.8013C7.41621 13.8646 7.34164 13.9148 7.25944 13.9489C7.17727 13.983 7.08912 14.0004 7.00015 14C7.00012 14 7.00009 14 7.00005 14C7.00001 14 6.99998 14 6.99994 14Z",fill:"currentColor"},null,-1),r0e=[n0e];function i0e(n,e,t,r,i,o){return l.openBlock(),l.createElementBlock("svg",l.mergeProps({width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n.pti()),r0e,16)}EO.render=i0e;var AO={name:"ArrowUpIcon",extends:Ve},o0e=l.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M6.51551 13.799C6.64205 13.9255 6.813 13.9977 6.99193 14C7.17087 13.9977 7.34182 13.9255 7.46835 13.799C7.59489 13.6725 7.66701 13.5015 7.66935 13.3226V2.31233L11.9326 6.57554C11.9951 6.63887 12.0697 6.68907 12.1519 6.72319C12.2341 6.75731 12.3223 6.77467 12.4113 6.77425C12.5003 6.77467 12.5885 6.75731 12.6707 6.72319C12.7529 6.68907 12.8274 6.63887 12.89 6.57554C13.0168 6.44853 13.0881 6.27635 13.0881 6.09683C13.0881 5.91732 13.0168 5.74514 12.89 5.61812L7.48846 0.216594C7.48274 0.210436 7.4769 0.204374 7.47094 0.198411C7.3439 0.0713707 7.1716 0 6.99193 0C6.81227 0 6.63997 0.0713707 6.51293 0.198411C6.50704 0.204296 6.50128 0.210278 6.49563 0.216354L1.09386 5.61812C0.974201 5.74654 0.909057 5.91639 0.912154 6.09189C0.91525 6.26738 0.986345 6.43483 1.11046 6.55894C1.23457 6.68306 1.40202 6.75415 1.57752 6.75725C1.75302 6.76035 1.92286 6.6952 2.05128 6.57554L6.31451 2.31231V13.3226C6.31685 13.5015 6.38898 13.6725 6.51551 13.799Z",fill:"currentColor"},null,-1),s0e=[o0e];function a0e(n,e,t,r,i,o){return l.openBlock(),l.createElementBlock("svg",l.mergeProps({width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n.pti()),s0e,16)}AO.render=a0e;function bf(n){"@babel/helpers - typeof";return bf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},bf(n)}function l0e(n,e,t){return e=c0e(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function c0e(n){var e=u0e(n,"string");return bf(e)=="symbol"?e:String(e)}function u0e(n,e){if(bf(n)!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(bf(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var d0e={paginator:function(e){var t=e.instance,r=e.key;return["p-paginator p-component",l0e({"p-paginator-default":!t.hasBreakpoints()},"p-paginator-".concat(r),t.hasBreakpoints())]},start:"p-paginator-left-content",end:"p-paginator-right-content",firstPageButton:function(e){var t=e.instance;return["p-paginator-first p-paginator-element p-link",{"p-disabled":t.$attrs.disabled}]},firstPageIcon:"p-paginator-icon",previousPageButton:function(e){var t=e.instance;return["p-paginator-prev p-paginator-element p-link",{"p-disabled":t.$attrs.disabled}]},previousPageIcon:"p-paginator-icon",nextPageButton:function(e){var t=e.instance;return["p-paginator-next p-paginator-element p-link",{"p-disabled":t.$attrs.disabled}]},nextPageIcon:"p-paginator-icon",lastPageButton:function(e){var t=e.instance;return["p-paginator-last p-paginator-element p-link",{"p-disabled":t.$attrs.disabled}]},lastPageIcon:"p-paginator-icon",pages:"p-paginator-pages",pageButton:function(e){var t=e.props,r=e.pageLink;return["p-paginator-page p-paginator-element p-link",{"p-highlight":r-1===t.page}]},current:"p-paginator-current",rowPerPageDropdown:"p-paginator-rpp-options",jumpToPageDropdown:"p-paginator-page-options",jumpToPageInput:"p-paginator-page-input"},f0e=mt.extend({name:"paginator",classes:d0e}),TO={name:"AngleDoubleLeftIcon",extends:Ve},h0e=l.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M5.71602 11.164C5.80782 11.2021 5.9063 11.2215 6.00569 11.221C6.20216 11.2301 6.39427 11.1612 6.54025 11.0294C6.68191 10.8875 6.76148 10.6953 6.76148 10.4948C6.76148 10.2943 6.68191 10.1021 6.54025 9.96024L3.51441 6.9344L6.54025 3.90855C6.624 3.76126 6.65587 3.59011 6.63076 3.42254C6.60564 3.25498 6.525 3.10069 6.40175 2.98442C6.2785 2.86815 6.11978 2.79662 5.95104 2.7813C5.78229 2.76598 5.61329 2.80776 5.47112 2.89994L1.97123 6.39983C1.82957 6.54167 1.75 6.73393 1.75 6.9344C1.75 7.13486 1.82957 7.32712 1.97123 7.46896L5.47112 10.9991C5.54096 11.0698 5.62422 11.1259 5.71602 11.164ZM11.0488 10.9689C11.1775 11.1156 11.3585 11.2061 11.5531 11.221C11.7477 11.2061 11.9288 11.1156 12.0574 10.9689C12.1815 10.8302 12.25 10.6506 12.25 10.4645C12.25 10.2785 12.1815 10.0989 12.0574 9.96024L9.03158 6.93439L12.0574 3.90855C12.1248 3.76739 12.1468 3.60881 12.1204 3.45463C12.0939 3.30045 12.0203 3.15826 11.9097 3.04765C11.7991 2.93703 11.6569 2.86343 11.5027 2.83698C11.3486 2.81053 11.19 2.83252 11.0488 2.89994L7.51865 6.36957C7.37699 6.51141 7.29742 6.70367 7.29742 6.90414C7.29742 7.1046 7.37699 7.29686 7.51865 7.4387L11.0488 10.9689Z",fill:"currentColor"},null,-1),p0e=[h0e];function m0e(n,e,t,r,i,o){return l.openBlock(),l.createElementBlock("svg",l.mergeProps({width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n.pti()),p0e,16)}TO.render=m0e;var xO={name:"BlankIcon",extends:Ve},g0e=l.createElementVNode("rect",{width:"1",height:"1",fill:"currentColor","fill-opacity":"0"},null,-1),y0e=[g0e];function b0e(n,e,t,r,i,o){return l.openBlock(),l.createElementBlock("svg",l.mergeProps({width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n.pti()),y0e,16)}xO.render=b0e;var IO={name:"SearchIcon",extends:Ve},w0e=l.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2.67602 11.0265C3.6661 11.688 4.83011 12.0411 6.02086 12.0411C6.81149 12.0411 7.59438 11.8854 8.32483 11.5828C8.87005 11.357 9.37808 11.0526 9.83317 10.6803L12.9769 13.8241C13.0323 13.8801 13.0983 13.9245 13.171 13.9548C13.2438 13.985 13.3219 14.0003 13.4007 14C13.4795 14.0003 13.5575 13.985 13.6303 13.9548C13.7031 13.9245 13.7691 13.8801 13.8244 13.8241C13.9367 13.7116 13.9998 13.5592 13.9998 13.4003C13.9998 13.2414 13.9367 13.089 13.8244 12.9765L10.6807 9.8328C11.053 9.37773 11.3573 8.86972 11.5831 8.32452C11.8857 7.59408 12.0414 6.81119 12.0414 6.02056C12.0414 4.8298 11.6883 3.66579 11.0268 2.67572C10.3652 1.68564 9.42494 0.913972 8.32483 0.45829C7.22472 0.00260857 6.01418 -0.116618 4.84631 0.115686C3.67844 0.34799 2.60568 0.921393 1.76369 1.76338C0.921698 2.60537 0.348296 3.67813 0.115991 4.84601C-0.116313 6.01388 0.00291375 7.22441 0.458595 8.32452C0.914277 9.42464 1.68595 10.3649 2.67602 11.0265ZM3.35565 2.0158C4.14456 1.48867 5.07206 1.20731 6.02086 1.20731C7.29317 1.20731 8.51338 1.71274 9.41304 2.6124C10.3127 3.51206 10.8181 4.73226 10.8181 6.00457C10.8181 6.95337 10.5368 7.88088 10.0096 8.66978C9.48251 9.45868 8.73328 10.0736 7.85669 10.4367C6.98011 10.7997 6.01554 10.8947 5.08496 10.7096C4.15439 10.5245 3.2996 10.0676 2.62869 9.39674C1.95778 8.72583 1.50089 7.87104 1.31579 6.94046C1.13068 6.00989 1.22568 5.04532 1.58878 4.16874C1.95187 3.29215 2.56675 2.54292 3.35565 2.0158Z",fill:"currentColor"},null,-1),v0e=[w0e];function C0e(n,e,t,r,i,o){return l.openBlock(),l.createElementBlock("svg",l.mergeProps({width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n.pti()),v0e,16)}IO.render=C0e;var Zs=RR(),k0e=`
|
|
253
253
|
@layer primevue {
|
|
254
254
|
.p-virtualscroller {
|