@docx-editor.dev/core 2.16.1 → 2.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +0,0 @@
1
- import {Ge as Ge$1,za,Ba,zb,Ob,wb,xb,Na,xa,tc,U,fa,Ca,Ea,sc}from'./chunk-RXPOTTQQ.js';var L=8,Re={color:"painted",background:"painted",spanClassName:"painted",avatarUrl:"card-only"},we=Object.keys(Re),mt=we.filter(t=>Re[t]==="painted"),vt=new Set(["http","https","data","blob"]),St=/^([a-zA-Z][a-zA-Z0-9+.-]*):/;function Rt(t){let e=t.replace(/[\u0000-\u0020\u007f]/g,"");if(e.length===0)return;let n=St.exec(e);if(n)return !vt.has(n[1].toLowerCase())||/^data:/i.test(e)&&!/^data:image\/(?!svg)/i.test(e)?void 0:e;let o=r=>e[r]==="/"||e[r]==="\\";return o(0)&&o(1)?void 0:e}function wt(t){if(typeof t=="string")return t.length>0?{color:t}:null;if(t===null||typeof t!="object")return null;let e={},n=Object.prototype.hasOwnProperty;for(let o of we){if(!n.call(t,o))continue;let r=t[o];if(!(typeof r!="string"||r.length===0)){if(o==="avatarUrl"){let a=Rt(r);a!==void 0&&(e.avatarUrl=a);continue}e[o]=r;}}return Object.keys(e).length>0?e:null}function j(t){return `var(--doc-review-author-${t%L})`}function ke(t){let e=new Map;if(t===void 0||t==="kind"||t==="author")return e;for(let[n,o]of Object.entries(t.authors)){let r=wt(o);r&&e.set(n,r);}return e}function Un(t,e){let n=ke(e);return [...t].map(([o,r])=>{let a=n.get(o);return {author:o,slot:r,color:a?.color??j(r),...a?{style:a}:{}}})}var kt=128;function _(t,e,n=kt){let o=e.length<n?e.length:n,r=t;for(let a=0;a<o;a+=1)r=Math.imul(r^e.charCodeAt(a),16777619);return Math.imul(r^e.length,16777619)}function At(t,e,n){let o=_(2166136261,n);for(let r of t.keys())o=_(o,r);for(let[r,a]of e){o=_(o,r);for(let i of mt)o=_(o,a[i]??"",1/0);}return `${t.size}.${e.size}.${(o>>>0).toString(36)}`}function Ae(t){return t===null?"kind":t.key}var Y=new WeakMap;function Ee(t,e,n){if(t==="kind")return null;let o=Y.get(e);if(o&&o.option===t&&o.authorSlots===n)return o.context;let r=ke(t),a=t===void 0||t==="author"?"author":t.others??"author";if(r.size===0&&a==="kind")return Y.set(e,{option:t,authorSlots:n,context:null}),null;let i=n??Pt(e),s=new Map;for(let[d,c]of r){if(!c.spanClassName)continue;let y=c.spanClassName.split(/\s+/).filter(u=>u.length>0);y.length>0&&s.set(d,y);}let l={authorSlots:i,styles:r,classTokens:s,others:a,key:At(i,r,a)};return Y.set(e,{option:t,authorSlots:n,context:l}),l}var ve=new WeakMap;function Et(t){let e=ve.get(t);if(e)return e;let n=[],o=new Set,r=a=>{a===""||o.has(a)||(o.add(a),n.push(a));};for(let a of za(t)){for(let s of a.lines)for(let l of s.spans){let d=l.revisions;if(d!==void 0)for(let c=0;c<d.length;c+=1)r(d[c].author);for(let c of l.props){if(c.localName!=="rPrChange"&&c.localName!=="pPrChange")continue;let y=c.attributes?.author;r(y??"");break}}for(let s of a.lines){let l=s.drawings;if(l!==void 0)for(let d=0;d<l.length;d+=1){let c=l[d].revisions;if(c!==void 0)for(let y=0;y<c.length;y+=1)r(c[y].author);}}let i=a.markRevisions;if(i)for(let s=0;s<i.length;s+=1)r(i[s].author);}return ve.set(t,n),n}var Se=new WeakMap;function Pt(t){let e=Se.get(t);if(e)return e;let n=new Map,o=r=>{for(let a of Et(r))n.has(a)||n.set(a,n.size);};for(let r of t.pages){o(r.fragments),r.header&&o(r.header.fragments),r.footer&&o(r.footer.fragments);for(let a of [r.footnotes,r.endnotes])if(a){a.separator&&o(a.separator.fragments);for(let i of a.notes)o(i.fragments);}for(let a of [r.anchoredDrawings,r.header?.anchoredDrawings,r.footer?.anchoredDrawings])if(a)for(let i of a){let s=i.revisions;if(s!==void 0)for(let l=0;l<s.length;l+=1){let d=s[l].author;d!==""&&!n.has(d)&&n.set(d,n.size);}i.textboxStory&&o(i.textboxStory.fragments);}}return Se.set(t,n),n}function Lt(t,e){let n=null;for(let o of e)o===""||t.has(o)||(n===null&&(n=new Map(t)),n.has(o)||n.set(o,n.size));return n??t}function _n(){let t=new Map,e=0;return {resolve(n,o){let r=Lt(n,o);for(let a of r.keys())t.has(a)||(t.set(a,e),e+=1);return new Map([...r.keys()].map(a=>[a,t.get(a)]).sort((a,i)=>a[1]-i[1]))}}}function C(t,e,n){if(t===void 0||t.length===0)return null;let o=t[t.length-1],r=t.some(s=>s.kind==="delete"||s.kind==="moveFrom"),a=o.kind,i=a==="delete"||a==="moveFrom"?"line-through":a==="insert"||a==="moveTo"?"underline":null;return {attribution:o,line:r&&i==="underline"?"line-through":i,decorationStyle:a==="moveFrom"||a==="moveTo"?"double":a==="insert"?"dashed":"solid",color:r?"var(--doc-revision-deletion)":"var(--doc-revision-insertion)",authorColor:n?.get(o.author)?.color??j(e?.get(o.author)??0),deleted:r}}function Pe(t,e,n,o){let r=t.createElement("span"),a=e.spans[e.spans.length-1];r.className="docx-line-break-mark",r.dataset.docxMarker="",r.setAttribute("aria-hidden","true"),r.contentEditable="false",r.textContent="\u21B5",r.style.position="absolute",r.style.pointerEvents="none",r.style.userSelect="none",r.style.left=`${((a?a.box.x+a.box.width:e.contentX)-e.contentX)*n}px`,r.style.top=`${e.leading*n}px`,r.style.marginLeft=`${2*n}px`,r.style.fontSize=`${(a?.style.fontSizePt??e.box.height)*n}px`,r.style.lineHeight=`${Math.max(0,e.box.height-e.leading-(e.trailingSpacing??0))*n}px`,r.style.color="var(--doc-revision-format)";let i=C(a?.revisions,o?.authorSlots,o?.styles);if(i){let{attribution:s}=i,l=o?.styles.get(s.author),d=o&&(l?.color!==void 0||o.others==="author");if(r.style.color=d?i.authorColor:i.color,r.dataset.revisionKind=s.kind,r.dataset.revisionId=s.id,r.dataset.reviewAuthor=s.author,o){r.dataset.reviewAuthorSlot=String((o.authorSlots.get(s.author)??0)%L);for(let c of o.classTokens.get(s.author)??[])r.classList.add(c);}i.line&&(r.style.textDecorationLine=i.line,r.style.textDecorationStyle=i.decorationStyle,r.style.textDecorationColor=r.style.color);}return r}function Le(t,e,n,o){let r=wb(e);if(!r){let d=t.createElement("span");return d.className="docx-paragraph-mark",d.setAttribute("aria-hidden","true"),d.contentEditable="false",d.textContent="\xB6",d.style.position="absolute",d.style.pointerEvents="none",d.style.marginLeft=`${2*n}px`,d.style.color="var(--doc-revision-format)",d}let a=t.createElement("span");a.className=`docx-paragraph-mark docx-revision-pmark docx-revision-pmark-${r.kind}`,a.setAttribute("aria-hidden","true"),a.contentEditable="false",a.dataset.revisionKind=r.kind,a.dataset.revisionId=r.id,r.author!==""&&(a.dataset.reviewAuthor=r.author),a.dataset.revisionIds=e.map(d=>d.id).join(" "),a.dataset.revisionKinds=e.map(d=>d.kind).join(" "),a.textContent="\xB6",a.style.position="absolute",a.style.pointerEvents="none",a.style.marginLeft=`${2*n}px`;let i=xb(r),s=o?.styles.get(r.author),l=o?(o.authorSlots.get(r.author)??0)%L:0;if(o){a.dataset.reviewAuthorSlot=String(l);let d=o.classTokens.get(r.author);if(d)for(let c=0;c<d.length;c+=1)a.classList.add(d[c]);}return a.style.color=s?.color??(o?.others==="author"?j(l):i?"var(--doc-revision-deletion)":"var(--doc-revision-insertion)"),i&&(a.style.textDecorationLine="line-through"),a}function Z(t,e,n=false){let o=n?null:zb(e.props.filter(a=>a.localName==="pPrChange")),r=o??e.markFormatRevision;r&&($t(t,r,o?"pPrChange":"rPrChange"),t.dataset.paragraphId=e.paragraphId,t.dataset.reviewStart=String(e.range.start),t.dataset.reviewEnd=String(e.range.end));}function $t(t,e,n){t.dataset.revisionKind="format",t.dataset.revisionId=e.id,t.dataset.formattingKind=n,e.author&&(t.dataset.reviewAuthor=e.author),e.date!==void 0&&(t.dataset.revisionDate=e.date);}function $e(t,e,n,o,r,a){for(let i of [n.footnotes,n.endnotes])i&&e.append(Mt(t,n,i,o,r,a));}function Mt(t,e,n,o,r,a){let i=t.createElement("div");if(i.className="docx-notes",i.dataset.docxNotes=n.kind,i.dataset.docxNotesPlacement=n.placement,i.style.position="absolute",i.style.left=`${(n.box.x-e.box.x)*o.scale}px`,i.style.top=`${(n.box.y-e.box.y)*o.scale}px`,i.style.width=`${n.box.width*o.scale}px`,i.style.height=`${n.box.height*o.scale}px`,n.separator){let s=t.createElement("div");s.className="docx-note-separator",s.dataset.docxNoteSeparator=n.separator.kind,s.setAttribute("contenteditable","false"),s.setAttribute("aria-hidden","true"),s.style.position="absolute",s.style.left=`${(n.separator.box.x-n.box.x)*o.scale}px`,s.style.top=`${(n.separator.box.y-n.box.y)*o.scale}px`,s.style.width=`${n.separator.box.width*o.scale}px`,s.style.height=`${Math.max(n.separator.box.height,.75)*o.scale}px`;let l=n.separator.ruleStyle;if(l||n.separator.synthetic||n.separator.fragments.length===0)Tt(s,t,l??"single",o.scale);else for(let d of n.separator.fragments)s.append(d.kind==="table"?a(t,d,o):r(t,d,o));i.append(s);}for(let s of n.notes){let l=t.createElement("div");l.className="docx-note",l.dataset.docxNote=s.noteKind,l.dataset.docxNoteId=String(s.noteId),l.dataset.docxNoteScope=s.scopeId,s.mark!==null&&(l.dataset.docxNoteMark=s.mark),s.continuation&&(l.dataset.docxNoteContinuation=""),l.setAttribute("role","doc-footnote"),l.style.position="absolute",l.style.left=`${(s.box.x-n.box.x)*o.scale}px`,l.style.top=`${(s.box.y-n.box.y)*o.scale}px`,l.style.width=`${s.box.width*o.scale}px`,l.style.height=`${s.box.height*o.scale}px`;for(let d of s.fragments)l.append(d.kind==="table"?a(t,d,o):r(t,d,o));i.append(l);}return i}function Tt(t,e,n,o){t.dataset.docxNoteRule=n;let r=Math.max(1,o*.75);if(n==="single"){t.style.borderTop=`${r}px solid currentColor`,t.style.opacity="0.85";return}t.style.opacity="0.85";let a=Math.max(1,o*1.25);for(let i of [0,r+a]){let s=e.createElement("div");s.setAttribute("aria-hidden","true"),s.style.position="absolute",s.style.left="0",s.style.right="0",s.style.top=`${i}px`,s.style.height="0",s.style.borderTop=`${r}px solid currentColor`,t.append(s);}}function G(t,e,n){return !!n.activeHeaderFooterRId&&!!t.rId&&n.activeHeaderFooterRId===t.rId&&(n.activeHeaderFooterPageIndex===void 0||n.activeHeaderFooterPageIndex===e)}function J(t,e,n){return n?t.kind==="footer"?Math.max(t.box.height,e.box.y+e.box.height-t.box.y):Math.max(t.box.height,e.contentBox.y-t.box.y):t.box.height}function Me(t,e){for(let{record:n,element:o,materialized:r}of t){if(!r)continue;let a=o.querySelector(":scope > .docx-page-content");a&&(e.activeHeaderFooterRId?a.setAttribute("contenteditable","false"):a.removeAttribute("contenteditable"));for(let i of o.querySelectorAll(":scope > .docx-hf:not(.docx-hf--placeholder)")){let s=Dt(n,i);if(!s)continue;let l=G(s,n.index,e);Ht(i,n,s,l,e.scale);}for(let i of o.querySelectorAll(":scope > [data-docx-hf-front]")){let s=Te(n,i.dataset.docxHfFront);De(i,!!s&&G(s,n.index,e));}}}function Dt(t,e){return Te(t,e.dataset.docxHf)}function Te(t,e){if(e==="header")return t.header;if(e==="footer")return t.footer}function Ht(t,e,n,o,r){o?(t.dataset.docxHfActive="",t.setAttribute("contenteditable","true")):(delete t.dataset.docxHfActive,t.setAttribute("contenteditable","false")),t.style.height=`${J(n,e,o)*r}px`,De(t,o);}function De(t,e){let n=t.querySelectorAll(t instanceof Element&&t.classList.contains("docx-drawing-layer")?":scope > *":":scope > .docx-drawing-layer > *");for(let o of n){o.style.pointerEvents=e?"auto":"none";for(let r of o.querySelectorAll(".docx-drawing"))r.style.pointerEvents=e?"auto":"none";}}var Ct=0;function He(t,e,n,o){if(o===void 0||!Number.isFinite(o)||o<0||o>1)return;let r="http://www.w3.org/2000/svg",a=(y,u)=>{let h=t.createElementNS(r,y);for(let[p,f]of Object.entries(u))h.setAttribute(p,f);return h},i=`docx-bilevel-${++Ct}`,s=a("svg",{width:"0",height:"0","aria-hidden":"true"});s.style.position="absolute",s.style.pointerEvents="none";let l=a("filter",{id:i,"color-interpolation-filters":"sRGB"});l.append(a("feColorMatrix",{type:"saturate",values:"0"}));let d=a("feComponentTransfer",{}),c=Array.from({length:256},(y,u)=>u/255>=o?1:0).join(" ");for(let y of ["R","G","B"])d.append(a(`feFunc${y}`,{type:"discrete",tableValues:c}));l.append(d),s.append(l),e.append(s),n.style.filter=`${n.style.filter} url(#${i})`.trim();}var It=new Map([["image/svg+xml","SVG"],["image/tiff","TIFF"],["image/x-emf","EMF"],["image/x-wmf","WMF"]]),Ft="Unknown",W=new WeakMap,ee=new WeakMap,Bt=256;function Fe(t,e){let n=W.get(t);if(n)return n;let o=new Map,r=new Map;return n=Object.freeze({urlForReady(a,i){let s=o.get(a.resourceKey);if(s)return s;let l;try{l=e.create(a,i);}catch(d){if(d instanceof Error&&d.message.startsWith("PaintImageUrlSource:"))return null;throw d}return o.set(a.resourceKey,l),l},imageFor(a,i,s){let l=r.get(a);if(l&&l.resourceKey===i)return l.element;let d=s.createElement("img");return r.size<Bt&&r.set(a,{element:d,resourceKey:i,...l?.readyElement?{readyElement:l.readyElement}:{}}),d},imageForPending(a){return r.get(a)?.element??null},readyElementFor(a){return r.get(a)?.readyElement??null},rememberReadyElement(a,i){let s=r.get(a);s&&r.set(a,{...s,readyElement:i});},reconcile(a,i){for(let[s,l]of o)a.has(s)||(e.revoke(l),o.delete(s));for(let[s,l]of r)i.has(s)||(l.element.removeAttribute("src"),r.delete(s));},revokeAll(){for(let a of o.values())e.revoke(a);o.clear();for(let a of r.values())a.element.removeAttribute("src");r.clear();}}),W.set(t,n),n}function te(t,e){return `${e.paintInstance??""}|${t.drawingNodeId}`}function ro(t){W.get(t)?.revokeAll(),W.delete(t);}function w(t){return Number.isFinite(t)?String(t):"0"}function Be(t,e){if(t.length<3||e.width<=0||e.height<=0)return null;let n=[];for(let o of t){if(!Number.isFinite(o.x)||!Number.isFinite(o.y))return null;let r=(o.x-e.x)/e.width*100,a=(o.y-e.y)/e.height*100;n.push(`${w(r)}% ${w(a)}%`);}return `polygon(${n.join(", ")})`}function Ne(t){let e=t.geometry.contentBounds;return sc({transform:t.transform,contentWidth:e.width,contentHeight:e.height})}function Oe(t){let{effects:e}=t,n=[];if(e.grayscale&&n.push("grayscale(1)"),e.brightness!==0&&Number.isFinite(e.brightness)){let o=1+e.brightness/100;Number.isFinite(o)&&n.push(`brightness(${w(Math.max(0,o))})`);}if(e.contrast!==0&&Number.isFinite(e.contrast)){let o=1+e.contrast/100;Number.isFinite(o)&&n.push(`contrast(${w(Math.max(0,o))})`);}return n.length>0?n.join(" "):void 0}function Ke(t,e){let{crop:n}=t,o=Math.max(0,Math.min(1,n.left)),r=Math.max(0,Math.min(1,n.top)),a=Math.max(0,Math.min(1,n.right)),i=Math.max(0,Math.min(1,n.bottom)),s=Math.max(1e-4,1-o-a),l=Math.max(1e-4,1-r-i);return Object.freeze({width:`${w(1/s*100)}%`,height:`${w(1/l*100)}%`,left:`${w(-o/s*100)}%`,top:`${w(-r/l*100)}%`})}function Nt(t,e){let{resource:n}=t;switch(n.kind){case "external":return e.externalResource;case "missing":return e.missingResource;case "pending":return e.pendingResource;case "unrenderable":switch(n.reason){case "unsupported-format":return e.unsupportedFormat(It.get(n.mime)??Ft);case "non-picture-graphic":return e.nonPictureGraphic(t.placeholderGraphicKind??"graphic");case "signature-mismatch":return e.contentMismatch;case "decode-failed":return e.decodeFailed;case "resource-limit":return e.resourceLimit;default:return e.invalidResource}default:return e.invalidResource}}function D(t,e,n){let{accessibility:o}=e;o.hidden||(t.setAttribute("role",n?"link":"img"),o.label?t.setAttribute("aria-label",o.label):n||t.setAttribute("aria-hidden","true"));}function O(t,e,n,o){let r=o?.x??0,a=o?.y??0;t.style.position="absolute",t.style.left=`${(e.x-r)*n}px`,t.style.top=`${(e.y-a)*n}px`,t.style.width=`${e.width*n}px`,t.style.height=`${e.height*n}px`,t.style.boxSizing="border-box",t.style.overflow="hidden",t.style.pointerEvents="auto";}function Ot(t,e,n,o,r){let a=t.paintBounds,i=t.geometry.contentBounds,s=Ke(t);return [o,n.scale,r?.x??0,r?.y??0,a.x,a.y,a.width,a.height,i.x,i.y,i.width,i.height,Be(t.geometry.clipPolygon??[],a)??"",Oe(t)??"",t.effects.bilevel??"",Ne(t)??"",s.width,s.height,s.left,s.top,n.inertLinks?"":t.hyperlinkHref??"",t.accessibility.label??""].join("|")}function N(t,e,n,o){let r=t.createElement("div");r.className="docx-drawing docx-drawing-placeholder",r.dataset.drawingNodeId=e.drawingNodeId,O(r,e.paintBounds,n.scale,o);let a=t.createElement("div");a.className="docx-drawing-placeholder-card";let i=t.createElement("span");return i.className="docx-drawing-placeholder-label",i.textContent=Nt(e,n.strings),a.append(i),r.append(a),e.hyperlinkHref&&!n.inertLinks?(r.dataset.docxDrawingLink=e.drawingNodeId,r.dataset.docxDrawingLinkKind="external",r.dataset.docxDrawingLinkHref=e.hyperlinkHref,r.setAttribute("tabindex","-1"),D(r,e,true)):D(r,e,false),r}function Kt(t,e,n,o,r,a){let i=e.resource;if(i.kind!=="ready")return N(t,e,n,a);let s=te(e,n),l=r?.readyElementFor?.(s)??t.createElement("div"),d=Ot(e,i,n,o,a);if(ee.get(l)===d)return l;l.className="docx-drawing docx-drawing-ready",l.style.cssText="",l.dataset.drawingNodeId=e.drawingNodeId,delete l.dataset.docxDrawingLink,delete l.dataset.docxDrawingLinkKind,delete l.dataset.docxDrawingLinkHref,l.removeAttribute("aria-hidden"),l.removeAttribute("aria-label"),l.removeAttribute("role"),l.removeAttribute("tabindex"),O(l,e.paintBounds,n.scale,a);let c=Be(e.geometry.clipPolygon??[],e.paintBounds);c&&(l.style.clipPath=c);let y=t.createElement("div");y.className="docx-drawing-image-frame",y.style.position="absolute";let u=e.geometry.contentBounds,h=e.paintBounds;y.style.left=`${(u.x-h.x)*n.scale}px`,y.style.top=`${(u.y-h.y)*n.scale}px`,y.style.width=`${u.width*n.scale}px`,y.style.height=`${u.height*n.scale}px`;let p=Oe(e);p&&(y.style.filter=p);let f=t.createElement("div");f.className="docx-drawing-transform-stage",f.style.position="relative",f.style.width="100%",f.style.height="100%";let k=Ne(e);k&&(f.style.transform=k,f.style.transformOrigin="0 0");let R=t.createElement("div");R.className="docx-drawing-crop-viewport",R.style.position="relative",R.style.width="100%",R.style.height="100%",R.style.overflow="hidden";let S=r?.imageFor?.(s,i.resourceKey,t)??t.createElement("img");S.className="docx-drawing-image",S.setAttribute("draggable","false"),S.getAttribute("src")!==o&&S.setAttribute("src",o),S.setAttribute("alt","");let P=Ke(e);return S.style.position="absolute",S.style.width=P.width,S.style.height=P.height,S.style.left=P.left,S.style.top=P.top,S.style.maxWidth="none",S.style.maxHeight="none",R.append(S),f.append(R),y.append(f),l.replaceChildren(y),He(t,l,y,e.effects.bilevel),e.hyperlinkHref&&!n.inertLinks?(l.dataset.docxDrawingLink=e.drawingNodeId,l.dataset.docxDrawingLinkKind="external",l.dataset.docxDrawingLinkHref=e.hyperlinkHref,l.setAttribute("tabindex","-1"),D(l,e,true)):D(l,e,false),r?.rememberReadyElement?.(s,l),ee.set(l,d),l}var Q="http://www.w3.org/2000/svg";function zt(t,e,n,o){let r=e.vectorShape,a=t.createElement("div");a.className="docx-drawing docx-drawing-shape",a.dataset.drawingNodeId=e.drawingNodeId,O(a,e.paintBounds,n.scale,o);let i=e.geometry.contentBounds,s=e.paintBounds,l=t.createElement("div");l.className="docx-drawing-image-frame",l.style.position="absolute",l.style.left=`${(i.x-s.x)*n.scale}px`,l.style.top=`${(i.y-s.y)*n.scale}px`,l.style.width=`${i.width*n.scale}px`,l.style.height=`${i.height*n.scale}px`;let d=t.createElementNS(Q,"svg");d.setAttribute("viewBox",`0 0 ${w(Math.max(1,r.extentEmu.cx))} ${w(Math.max(1,r.extentEmu.cy))}`),d.setAttribute("preserveAspectRatio","none"),d.setAttribute("width","100%"),d.setAttribute("height","100%"),d.style.display="block",d.style.overflow="visible";for(let c of r.components){let y=t.createElementNS(Q,"path"),u=c.subpathsEmu.map((h,p)=>`M${h.map(f=>`${w(f.x)} ${w(f.y)}`).join("L")}${c.subpathsClosed?.[p]===false?"":"Z"}`).join("");if(y.setAttribute("d",u),y.setAttribute("fill",c.fillHex!==null?`#${c.fillHex}`:"none"),y.setAttribute("fill-rule","evenodd"),c.fillAlpha<1&&y.setAttribute("fill-opacity",w(Math.max(0,c.fillAlpha))),c.strokeHex!==null&&(y.setAttribute("stroke",`#${c.strokeHex}`),y.setAttribute("stroke-width",w(Math.max(1,c.strokeWidthEmu))),c.strokeAlpha<1&&y.setAttribute("stroke-opacity",w(Math.max(0,c.strokeAlpha)))),d.append(y),c.strokeHex!==null)for(let h of c.arrowheadsEmu??[]){let p=t.createElementNS(Q,"path");p.setAttribute("d",`M${h.map(f=>`${w(f.x)} ${w(f.y)}`).join("L")}Z`),p.setAttribute("fill",`#${c.strokeHex}`),p.setAttribute("fill-opacity",w(Math.max(0,Math.min(1,c.strokeAlpha)))),p.setAttribute("data-docx-line-end","triangle"),d.append(p);}}return l.append(d),a.append(l),e.hyperlinkHref&&!n.inertLinks?(a.dataset.docxDrawingLink=e.drawingNodeId,a.dataset.docxDrawingLinkKind="external",a.dataset.docxDrawingLinkHref=e.hyperlinkHref,a.setAttribute("tabindex","-1"),D(a,e,true)):D(a,e,false),a}function Ut(t,e,n,o,r){let a=o.scale,i=t.createElement("div");i.className="docx-drawing docx-drawing-textbox",i.dataset.drawingNodeId=e.drawingNodeId,i.setAttribute("contenteditable","false"),O(i,e.paintBounds,o.scale,r),i.style.overflow="hidden";let s=(e.x-e.paintBounds.x)*a,l=(e.y-e.paintBounds.y)*a;if(n.fillHex!==null||n.strokeHex!==null){let c=t.createElement("div");c.className="docx-drawing-textbox-box",c.style.position="absolute",c.style.left=`${s}px`,c.style.top=`${l}px`,c.style.width=`${e.width*a}px`,c.style.height=`${e.height*a}px`,c.style.boxSizing="border-box",n.fillHex!==null&&(c.style.backgroundColor=`#${n.fillHex}`),n.strokeHex!==null&&(c.style.border=`${Math.max(n.strokeWidthPt*a,.5)}px solid #${n.strokeHex}`),i.append(c);}let d=t.createElement("div");d.className="docx-drawing-textbox-content",d.style.position="absolute",d.style.left=`${s+n.contentOffset.x*a}px`,d.style.top=`${l+n.contentOffset.y*a}px`,d.style.width=`${n.contentWidth*a}px`,d.style.height=`${Math.max(0,n.contentHeight)*a}px`,d.style.overflow="hidden";for(let c of n.fragments)d.append(o.paintStoryFragment(t,c));for(let c of d.querySelectorAll("[data-paragraph-id]"))delete c.dataset.paragraphId;return i.append(d),D(i,e,false),i}function _t(t,e,n){let o=n.revisionStyles,r=C(e.revisions,o?.authorSlots,o?.styles);if(!r){if(t.dataset.revisionKind===void 0)return;t.classList.remove("docx-drawing--revision","docx-drawing--revision-insertion","docx-drawing--revision-deletion"),delete t.dataset.revisionKind,delete t.dataset.revisionId,delete t.dataset.reviewAuthor,delete t.dataset.revisionDate,delete t.dataset.reviewAuthorSlot,t.style.outlineColor="";return}let{attribution:a}=r;t.classList.add("docx-drawing--revision",r.deleted?"docx-drawing--revision-deletion":"docx-drawing--revision-insertion"),t.classList.remove(r.deleted?"docx-drawing--revision-insertion":"docx-drawing--revision-deletion"),t.dataset.revisionKind=a.kind,t.dataset.revisionId=a.id,a.author!==""?t.dataset.reviewAuthor=a.author:delete t.dataset.reviewAuthor,a.date!==void 0?t.dataset.revisionDate=a.date:delete t.dataset.revisionDate;let i=o?.styles.get(a.author),s=o!==void 0&&(i?.color!==void 0||o.others==="author");o?t.dataset.reviewAuthorSlot=String((o.authorSlots.get(a.author)??0)%L):delete t.dataset.reviewAuthorSlot,t.style.outlineColor=s?r.authorColor:"";}function ze(t,e,n,o,r){let a=jt(t,e,n,o,r);return a&&_t(a,e,n),a}function jt(t,e,n,o,r){if(e.accessibility.hidden||e.paintBounds.width<=0||e.paintBounds.height<=0)return null;if(e.kind==="anchoredDrawing"&&e.textboxStory!==void 0&&n.paintStoryFragment!==void 0)return Ut(t,e,e.textboxStory,n,r);if(e.vectorShape&&e.vectorShape.subpathsEmu.length>0)return zt(t,e,n,r);let{resource:a}=e;if(a.kind==="ready"){if(!n.imageUrlPort||!o)return N(t,e,n,r);let i=o.urlForReady(a.validatedHandle,a.mime);return i?Kt(t,e,n,i,o,r):N(t,e,n,r)}if(a.kind==="pending"){let i=o?.readyElementFor?.(te(e,n))??o?.imageForPending?.(te(e,n))?.closest(".docx-drawing-ready");return i?(ee.delete(i),i.dataset.drawingNodeId=e.drawingNodeId,O(i,e.paintBounds,n.scale,r),i):N(t,e,n,r)}return N(t,e,n,r)}function Ue(t,e,n,o,r){let a=[];for(let i of e.drawings??[]){let s=ze(t,i,n,o,r);s&&a.push(s);}return Object.freeze(a)}function _e(t,e,n,o,r,a){let i=[];for(let s of e){if(tc(s)!==n)continue;let l=ze(t,s,o,r,a);l&&(l.dataset.drawingLayer=n,i.push(l));}return Object.freeze(i)}function Gt(t,e){Ca(t,({host:n})=>Ea(n,e));}var Ce=new WeakMap;function Wt(t){let e=Ce.get(t);if(e)return e;let n=[],o=[];Gt(t,a=>{a.resource.kind==="ready"&&n.push(a.resource.resourceKey),o.push(`p${t.index}|${a.drawingNodeId}`);});let r=Object.freeze({resourceKeys:Object.freeze(n),elementKeys:Object.freeze(o)});return Ce.set(t,r),r}var Ie=new WeakMap;function je(t){let e=Ie.get(t);if(e)return e;let n=new Set,o=new Set;for(let a of t.pages){let i=Wt(a);for(let s of i.resourceKeys)n.add(s);for(let s of i.elementKeys)o.add(s);}let r=Object.freeze({resourceKeys:n,elementKeys:o});return Ie.set(t,r),r}function Ge(t){return je(t).resourceKeys}function We(t){return je(t).elementKeys}function Ve(t){return [t.missingResource,t.externalResource,t.invalidResource,t.contentMismatch,t.decodeFailed,t.resourceLimit,t.pendingResource,t.unsupportedFormat("probe"),t.nonPictureGraphic("probe")].join("\0")}var ne=Object.freeze({unsupportedFormat:t=>`Unsupported image format (${t})`,nonPictureGraphic:t=>`Unsupported graphic (${t})`,missingResource:"Image missing",externalResource:"External image not loaded",invalidResource:"Invalid image",contentMismatch:"Image content does not match its type",decodeFailed:"Image could not be decoded",resourceLimit:"Image exceeds size limits",pendingResource:"Loading image"});function ao(t){return Object.freeze({unsupportedFormat:e=>t("image.unsupportedFormat",{format:e}),nonPictureGraphic:e=>t("image.nonPictureGraphic",{kind:e}),missingResource:t("image.missingResource"),externalResource:t("image.externalResource"),invalidResource:t("image.invalidResource"),contentMismatch:t("image.contentMismatch"),decodeFailed:t("image.decodeFailed"),resourceLimit:t("image.resourceLimit"),pendingResource:t("image.pendingResource")})}function Vt(t,e,n){t.style.position="absolute",t.style.left=`${e.x*n}px`,t.style.top=`${e.y*n}px`,t.style.width=`${e.width*n}px`,t.style.height=`${e.height*n}px`;}function qe(t,e,n,o){let r=t.createElement("span");return r.className=e,r.setAttribute("aria-hidden","true"),r.style.position="absolute",r.style.display="block",r.style.left=`${n.x*o}px`,r.style.top=`${n.y*o}px`,r.style.width=`${n.width*o}px`,r.style.height=`${n.height*o}px`,r.style.backgroundColor="currentColor",r.style.pointerEvents="none",r}function E(t,e,n,o,r=0,a=0,i=[]){let s=r+n.box.x,l=a+n.box.y,d=[...i,n.kind];switch(n.kind){case "text":case "fallback":{let c=t.createElement("span");c.className=["docx-equation-node",...d.map(y=>`docx-equation-${y}`)].join(" "),Vt(c,{x:s,y:l,width:n.box.width,height:n.box.height},o),c.textContent=n.text,c.style.display="block",c.style.fontSize=`${n.fontSizePt*o}px`,c.style.lineHeight=`${n.box.height*o}px`,c.style.whiteSpace="pre",e.append(c);break}case "row":for(let c of n.items)E(t,e,c,o,s,l,d);break;case "fraction":E(t,e,n.numerator,o,s,l,d),e.append(qe(t,"docx-equation-fraction-bar",{...n.bar,x:s+n.bar.x,y:l+n.bar.y},o)),E(t,e,n.denominator,o,s,l,d);break;case "radical":E(t,e,n.sign,o,s,l,d),n.degree&&E(t,e,n.degree,o,s,l,d),e.append(qe(t,"docx-equation-radical-bar",{...n.bar,x:s+n.bar.x,y:l+n.bar.y},o)),E(t,e,n.radicand,o,s,l,d);break;case "script":E(t,e,n.base,o,s,l,d),n.subscript&&E(t,e,n.subscript,o,s,l,d),n.superscript&&E(t,e,n.superscript,o,s,l,d);break;case "nary":E(t,e,n.operator,o,s,l,d),n.lowerLimit&&E(t,e,n.lowerLimit,o,s,l,d),n.upperLimit&&E(t,e,n.upperLimit,o,s,l,d),E(t,e,n.body,o,s,l,d);break}}function Xe(t,e,n,o){let r=n.geometry;e.className="layout-run docx-equation",e.dataset.docxEquation=n.sourceNodeId,e.setAttribute("contenteditable","false"),e.setAttribute("role","math"),n.fallbackText&&e.setAttribute("aria-label",n.fallbackText),e.style.position="relative",e.style.display="inline-block",e.style.width=`${r.box.width*o}px`,e.style.height=`${r.box.height*o}px`,e.style.lineHeight="0",e.style.pointerEvents="auto",e.style.userSelect="none",e.style.verticalAlign=`${-(r.box.height-r.baseline)*o}px`;let a=t.createDocumentFragment();E(t,a,r,o),e.append(a);}function Ye(t,e,n,o){let r=n.lineEndWhitespace===true;if((n.style.horizontalScalePercent!==100||n.text===" "||r)&&(e.style.width=`${n.box.width*o}px`),!r||(e.style.clipPath="inset(-1em 0)",n.style.horizontalScalePercent===100))return e;let a=t.createElement("span");return a.dataset.docxClippedFill="",a.style.display="inline-block",a.style.transform=e.style.transform,a.style.transformOrigin=e.style.transformOrigin,a.style.textDecorationLine=e.style.textDecorationLine,a.style.textDecorationStyle=e.style.textDecorationStyle,a.style.textDecorationColor=e.style.textDecorationColor,a.style.textDecorationThickness=e.style.textDecorationThickness,e.style.removeProperty("transform"),e.style.removeProperty("transform-origin"),e.style.removeProperty("text-decoration-line"),e.style.removeProperty("text-decoration-style"),e.style.removeProperty("text-decoration-color"),e.style.removeProperty("text-decoration-thickness"),e.append(a),a}function Ze(t,e,n){let o=e.textOutline;if(!o||!Number.isFinite(n)||n<=0||!Number.isFinite(o.widthPt)||o.widthPt<=0||o.widthPt>1584||!/^[0-9a-f]{6}$/i.test(o.color))return;let r=o.widthPt*n;Number.isFinite(r)&&(t.setProperty("-webkit-text-stroke-width",`${r}px`),t.setProperty("-webkit-text-stroke-color",`#${o.color}`));}var qt=/^[0-9A-Fa-f]{6}$/;function Xt(t){switch(t){case "dashed":return "dashed";case "dotted":return "dotted";case "double":case "triple":return "solid";default:return "solid"}}function Je(t){return t&&qt.test(t)?t:"000000"}function oe(t,e){let n=t.createElement("div");return n.className=e,n.setAttribute("aria-hidden","true"),n.setAttribute("contenteditable","false"),n.style.position="absolute",n.style.left="0",n.style.top="0",n.style.right="0",n.style.bottom="0",n.style.overflow="visible",n.style.pointerEvents="none",n.style.boxSizing="border-box",n}function V(t,e,n,o){if(!n)return;let r=`#${Je(n.color)}`,a=`${Math.max(0,n.widthPt*o)}px`;if(t.style[`border${e}Width`]=a,t.style[`border${e}Color`]=r,n.style==="double"||n.style==="triple"){t.style[`border${e}Style`]="none";return}t.style[`border${e}Style`]=Xt(n.style);}function re(t,e,n,o,r){let a=t.createElement("div");a.className=r,a.dataset.edge=n.side,a.dataset.stroke=n.role,a.style.position="absolute",a.style.left=`${n.x*o}px`,a.style.top=`${n.y*o}px`,a.style.width=`${n.width*o}px`,a.style.height=`${n.height*o}px`,a.style.pointerEvents="none",a.style.backgroundColor=`#${Je(n.color)}`,n.cssStyle!=="solid"&&(a.dataset.cssStyle=n.cssStyle),e.append(a);}function Yt(t){let e=new Set;for(let n of t)e.add(`${n.side}\0${n.role}`);return e}function Zt(t,e,n,o){let r=Yt(n),a=u=>r.has(`${u}\0middle`),i=oe(t,"docx-table-border-double"),s=oe(t,"docx-table-border-triple"),l=oe(t,"docx-table-border-edge"),d=false,c=false,y=false;for(let u of n){if(u.role==="edge"){y=true,re(t,l,u,o,"docx-table-border-edge-stroke");continue}if(a(u.side)){c=true,re(t,s,u,o,"docx-table-border-triple-stroke");continue}(u.role==="outer"||u.role==="inner")&&(d=true,re(t,i,u,o,"docx-table-border-double-stroke"));}d&&e.append(i),c&&e.append(s),y&&e.append(l);}function Qe(t,e,n,o){V(e,"Top",n?.top,o),V(e,"Right",n?.right,o),V(e,"Bottom",n?.bottom,o),V(e,"Left",n?.left,o),n?.strokes&&n.strokes.length>0&&Zt(t,e,n.strokes,o);}function et(t,e,n,o){if(e.textDirection!=="btLr")return o;let r=t.createElement("div");return r.className="docx-table-cell-content-btlr",r.style.position="absolute",r.style.left="0",r.style.top="0",r.style.width=`${e.box.height*n}px`,r.style.height=`${e.box.width*n}px`,r.style.transformOrigin="0 0",r.style.transform=`translateY(${e.box.height*n}px) rotate(-90deg)`,o.append(r),r}var ae="when-selected",tt=new WeakMap,nt=0;function Jt(t){let e=tt.get(t);return e||(nt+=1,e=`alias${nt}`,tt.set(t,e)),e}function yt(t){return {...t,drawingStrings:t.drawingStrings??ne,urlRegistry:t.urlRegistry??null}}function Qt(t){let e={...t,inertLinks:true};return Object.freeze({scale:t.scale,strings:t.drawingStrings,...t.imageUrlPort?{imageUrlPort:t.imageUrlPort}:{},...t.inertLinks?{inertLinks:true}:{},...t.paintInstance?{paintInstance:t.paintInstance}:{},...t.revisionStyles?{revisionStyles:t.revisionStyles}:{},paintStoryFragment:(n,o)=>o.kind==="table"?F(n,o,e):I(n,o,e)})}function ut(t){return Object.freeze({ctx:Qt(t),urlRegistry:t.urlRegistry})}function ot(t,e,n,o,r,a){X(t,e,Ba(n),o,r,a);}function X(t,e,n,o,r,a,i=true,s){if(n.length===0)return;let l=ut(o),d=t.createElement("div");d.className=a==="behind"?"docx-drawing-layer docx-drawing-layer-behind":"docx-drawing-layer docx-drawing-layer-front",d.style.position="absolute",d.style.inset="0",d.style.pointerEvents="none",s&&(d.dataset.docxHfFront=s);for(let c of _e(t,n,a,l.ctx,l.urlRegistry,r)){if(c.style.pointerEvents=i?"auto":"none",!i)for(let y of c.querySelectorAll(".docx-drawing"))y.style.pointerEvents="none";d.append(c);}d.childElementCount>0&&e.append(d);}function pt(t){return t.horizontalFrame==="page"||t.verticalFrame==="page"}function ht(t,e,n){let o=e.paintBounds,r=xa(e,t.box,n),a=r.x-e.x,i=r.y-e.y,s=l=>Object.freeze({x:l.x+a,y:l.y+i,width:l.width,height:l.height});return Object.freeze({...e,x:e.x+a,y:e.y+i,paintBounds:s(o),hitBounds:s(e.hitBounds),geometry:Object.freeze({...e.geometry,contentBounds:s(e.geometry.contentBounds),paintBounds:s(e.geometry.paintBounds),...e.geometry.clipPolygon?{clipPolygon:Object.freeze(e.geometry.clipPolygon.map(l=>Object.freeze({x:l.x+a,y:l.y+i})))}:{}})})}function en(t,e,n,o,r,a){let i=o.map(l=>ht(n,l,a)),s=t.createElement("div");s.className="docx-hf-behind-layer",s.dataset.docxHfBehind=n.kind,s.setAttribute("contenteditable","false"),s.style.position="absolute",s.style.inset="0",s.style.overflow="hidden",s.style.pointerEvents="none",X(t,s,i,r,a,"behind",false),s.childElementCount>0&&e.append(s);}function tn(t,e,n,o,r,a,i,s=false){let l=o.filter(pt).map(d=>ht(n,d,a));X(t,e,l,r,a,i,s,n.kind);}var B=/^[0-9A-Fa-f]{6}$/,rt=/^[\p{L}\p{N}\p{M} \-.+_]{1,64}$/u,nn=new Map(Object.entries({single:"solid",words:"solid",thick:"solid",double:"double",dotted:"dotted",dottedHeavy:"dotted",dash:"dashed",dashedHeavy:"dashed",dashLong:"dashed",dashLongHeavy:"dashed",dotDash:"dashed",dashDotHeavy:"dashed",dotDotDash:"dashed",dashDotDotHeavy:"dashed",wave:"wavy",wavyHeavy:"wavy",wavyDouble:"wavy"})),on=new Map(Object.entries({black:"#000000",blue:"#0000ff",cyan:"#00ffff",darkBlue:"#000080",darkCyan:"#008080",darkGray:"#808080",darkGreen:"#008000",darkMagenta:"#800080",darkRed:"#800000",darkYellow:"#808000",green:"#00ff00",lightGray:"#c0c0c0",magenta:"#ff00ff",red:"#ff0000",yellow:"#ffff00",white:"#ffffff"}));function rn(t){return t.doubleStrike?"double":t.strike?"single":"none"}function an(t){return t==="thick"||t.endsWith("Heavy")}function ft(t){if(!t.underline)return null;let e=t.underline.color&&B.test(t.underline.color)?t.underline.color:null;return {cssStyle:nn.get(t.underline.variant)??"solid",color:e,heavy:an(t.underline.variant)}}function gt(t,e,n,o){t.textDecorationLine=e,t.textDecorationStyle=n,o.color&&(t.textDecorationColor=`#${o.color}`),o.heavy&&(t.textDecorationThickness=`max(${2*o.scale}px, 0.12em)`);}function at(t,e,n){e!=="none"&&gt(t,"line-through",e==="double"?"double":"solid",{scale:n});}function it(t,e,n){gt(t,"underline",e.cssStyle,{color:e.color,heavy:e.heavy,scale:n});}function sn(t,e,n){let o=e.color?`#${e.color}`:"currentColor";t.borderBottomWidth=`${(e.heavy?2:1)*n}px`,t.borderBottomStyle=e.cssStyle==="wavy"?"solid":e.cssStyle,t.borderBottomColor=o;}function q(t,e,n){let o=t.style,r=n.scale;Ze(o,e,r);let a=e.verticalAlign==="baseline"?1:.75;o.fontSize=`${e.fontSizePt*a*r}px`,e.bold&&(o.fontWeight="bold"),e.italic&&(o.fontStyle="italic");let i=e.fontFamily&&rt.test(e.fontFamily)?e.fontFamily:n.defaultFontFamily&&rt.test(n.defaultFontFamily)?n.defaultFontFamily:null;if(i){let d=n.fontAlias?.(i);o.fontFamily=d?`"${d}", "${i}", ${Ge$1}`:`"${i}", ${Ge$1}`;}e.color&&B.test(e.color)&&(o.color=`#${e.color}`);let s=e.highlight?on.get(e.highlight):void 0;s?(o.backgroundColor=s,t.dataset.highlight=e.highlight??""):e.shading&&B.test(e.shading)&&(o.backgroundColor=`#${e.shading}`),e.caps&&(o.textTransform="uppercase"),e.smallCaps&&(o.fontVariant="small-caps");let l=U(e);l!==0&&(o.position="relative",o.top=`${-l*r}px`),e.characterSpacingPt!==0&&(o.letterSpacing=`${e.characterSpacingPt*r}px`),e.horizontalScalePercent!==100&&(o.transformOrigin="left",o.transform=`scaleX(${e.horizontalScalePercent/100})`);}function xt(t,e,n,o,r){let a=n===" "?null:ft(o),i=rn(o),s=e;if(a&&i!=="none"){let l=t.createElement("span");l.dataset.docxDeco="underline",it(l.style,a,r);let d=t.createElement("span");d.dataset.docxDeco="strike",at(d.style,i,r),l.append(d),e.append(l),s=d;}else a?it(e.style,a,r):i!=="none"&&at(e.style,i,r);s.textContent=n;}function M(t,e,n,o){let r=t.createElement(e);return r.style.position="absolute",r.style.left=`${n.x*o}px`,r.style.top=`${n.y*o}px`,r.style.width=`${n.width*o}px`,r.style.height=`${n.height*o}px`,r}function ln(t,e,n){let o=e.fieldAtom;!o||(t.dataset.fieldAtom=o.formField?"form":"field",!(o.formField?n.shadeFormFields!==false:(n.fieldShading??ae)!=="never"))||(t.classList.add("docx-field-atom"),(o.formField||(n.fieldShading??ae)==="always")&&t.classList.add("docx-field-atom--shaded"));}function st(t,e,n){let o=zb(e.props),r=n.revisionStyles,a=C(e.revisions,r?.authorSlots,r?.styles);if(!(!a&&!o)){if(a){let{attribution:i}=a;t.classList.add("docx-revision",`docx-revision-${i.kind}`),t.dataset.revisionKind=i.kind,t.dataset.revisionId=i.id,i.author!==""&&(t.dataset.reviewAuthor=i.author),i.date!==void 0&&(t.dataset.revisionDate=i.date);let s=r?.styles.get(i.author);if(r){t.dataset.reviewAuthorSlot=String((r.authorSlots.get(i.author)??0)%L);let c=r.classTokens.get(i.author);if(c)for(let y=0;y<c.length;y+=1)t.classList.add(c[y]);}let d=r!==void 0&&(s?.color!==void 0||r.others==="author")?a.authorColor:a.color;t.style.color=d,t.style.backgroundColor=s?.background??(a.deleted?"var(--doc-revision-deletion-wash)":"var(--doc-revision-insertion-wash)"),a.line&&(t.style.textDecorationLine=a.line,t.style.textDecorationStyle=a.decorationStyle,t.style.textDecorationColor=d);return}if(t.classList.add("docx-revision","docx-revision-format"),t.dataset.revisionKind="format",t.dataset.formattingKind="rPrChange",t.dataset.revisionId=o.id,o.author!==""&&(t.dataset.reviewAuthor=o.author),o.date!==void 0&&(t.dataset.revisionDate=o.date),r){let i=r.styles.get(o.author);t.dataset.reviewAuthorSlot=String((r.authorSlots.get(o.author)??0)%L);let s=r.classTokens.get(o.author);if(s)for(let l=0;l<s.length;l+=1)t.classList.add(s[l]);i?.color!==void 0&&(t.style.color=i.color),i?.background!==void 0&&(t.style.backgroundColor=i.background);}}}function dn(t,e,n){let o=[],r=e.lines[e.lines.length-1];for(let i of e.lines){let s=[...i.spans.flatMap(u=>u.revisions??[]),...(i.drawings??[]).flatMap(u=>u.revisions??[]),...i.anchorRevisions??[],...i===r?e.markRevisions??[]:[]];if(s.length===0)continue;let l=s.some(u=>u.kind==="delete"||u.kind==="moveFrom"),d=i.box.y-e.box.y,c=d+i.box.height,y=o[o.length-1];if(y&&y.deleted===l&&d<=y.bottom+.5){y.bottom=Math.max(y.bottom,c);continue}o.push({top:d,bottom:c,deleted:l});}if(o.length===0)return null;let a=t.createElement("div");a.className="docx-change-bars",a.setAttribute("aria-hidden","true"),a.style.position="absolute",a.style.inset="0",a.style.pointerEvents="none";for(let i of o){let s=t.createElement("div");s.className=`docx-change-bar docx-change-bar-${i.deleted?"deletion":"insertion"}`,s.style.position="absolute",s.style.top=`${i.top*n}px`,s.style.height=`${(i.bottom-i.top)*n}px`,s.style.left=`${(-e.box.x-cn)*n}px`,s.style.width=`${yn*n}px`,s.style.pointerEvents="none",s.style.backgroundColor=i.deleted?"var(--doc-revision-deletion)":"var(--doc-revision-insertion)",a.append(s);}return a}var cn=7.5,yn=1.5;function un(t,e,n,o,r){let a=t.createElement("span"),i=fa(e.style,e.fontSlot);if(e.equation)return a.dataset.paragraphId=e.range.paragraphId,a.dataset.start=String(e.range.start),a.dataset.end=String(e.range.end),q(a,i,n),Xe(t,a,e.equation,n.scale),st(a,e,n),a;a.className="layout-run layout-run-text",a.style.display="inline-block",a.style.verticalAlign="baseline",a.style.boxSizing="border-box",a.style.height=`${o*n.scale}px`,a.style.paddingTop=`${r*n.scale}px`,a.style.lineHeight=`${(o-r)*n.scale}px`,e.range.end>e.range.start?(a.dataset.paragraphId=e.range.paragraphId,a.dataset.start=String(e.range.start),a.dataset.end=String(e.range.end)):(a.setAttribute("aria-hidden","true"),a.contentEditable="false"),q(a,i,n),ln(a,e,n),st(a,e,n);let s=Ye(t,a,e,n.scale);if(e.text===" "){a.style.overflow="hidden",a.style.verticalAlign="top";let l=ft(e.style);l&&e.tabLeader!=="underscore"&&(a.dataset.docxTabUnderline="",sn(a.style,l,n.scale));}return xt(t,s,e.text,e.style,n.scale),e.projected&&(a.dataset.docxField="",a.setAttribute("contenteditable","false"),e.noteNav?(a.style.userSelect="none",e.noteNav.direction==="to-note"?(a.dataset.docxNoteRef="",a.dataset.docxNoteScope=e.noteNav.scopeId,e.text.length>0&&a.setAttribute("aria-description",e.text)):(a.dataset.docxNoteMarkBack="",a.dataset.docxNoteScope=e.noteNav.scopeId)):(a.style.pointerEvents="none",a.style.userSelect="none")),a}function lt(t,e,n){let o=t.createElement("a");return o.className="docx-hyperlink",o.dataset.docxLink=e.id,o.dataset.docxLinkKind=e.kind,o.setAttribute("tabindex","-1"),!n.inertLinks&&e.href&&(o.setAttribute("href",e.href),e.kind==="external"&&o.setAttribute("rel","noopener noreferrer")),e.tooltip&&o.setAttribute("title",e.tooltip),o.style.display="inline-block",o.style.verticalAlign="baseline",o.style.textDecoration="none",o.style.color="inherit",o}function pn(t,e,n){let o=n.scale,r=t.createElement("div");r.className="docx-line layout-line",r.dataset.lineId=e.id,r.dataset.paragraphId=e.range.paragraphId,r.style.position="absolute",r.style.top=`${e.box.y*o}px`,r.style.left=`${e.contentX*o}px`,r.style.height=`${e.box.height*o}px`,r.style.fontSize="0",r.style.whiteSpace="pre",r.style.overflow="visible";let a=e.leading??0,i=Math.min(Math.max(a,...e.spans.map(v=>v.box.height+a),e.spans.length===0?e.box.height-(e.trailingSpacing??0):0),e.box.height),s=Math.max(0,e.box.height-i);r.style.boxSizing="border-box",r.style.paddingBottom=`${s*o}px`,r.style.lineHeight=`${(e.box.height-s)*o}px`;let l=null,d=null,c=null,y=new Map;for(let[v,b]of Na(e).entries())y.set(b.paragraphId,v);let u=v=>y.get(v)??0,h=[...e.drawings??[]].sort((v,b)=>u(v.paragraphId)-u(b.paragraphId)||v.start-b.start),p=0,f=(v,b)=>{for(;p<h.length&&(u(h[p].paragraphId)<u(v)||u(h[p].paragraphId)===u(v)&&h[p].start<b);){let x=h[p],g=Math.max(0,x.advanceEnd-x.advanceStart),m=t.createElement("span");m.className="docx-inline-drawing-advance",m.dataset.docxMarker="",m.setAttribute("contenteditable","false"),m.setAttribute("aria-hidden","true"),m.style.display="inline-block",m.style.width=`${g*o}px`,m.style.height=`${x.baselineOffset*o}px`,m.style.lineHeight="0",m.style.pointerEvents="none",m.style.verticalAlign="baseline",r.append(m),p+=1,l=null,d=null;}},k=v=>{let b=v.wrapAdvanceBefore??0;if(b<=.001)return;let x=t.createElement("span");x.className="docx-wrap-advance",x.dataset.docxMarker="",x.setAttribute("contenteditable","false"),x.setAttribute("aria-hidden","true"),x.style.display="inline-block",x.style.width=`${b*o}px`,x.style.height="0",x.style.lineHeight="0",x.style.pointerEvents="none",x.style.verticalAlign="baseline",r.append(x),l=null,d=null;},R=0,S=false;for(let[v,b]of e.spans.entries()){f(b.range.paragraphId,b.range.start),k(b);let x=Math.min(b.box.height+a,e.box.height),g=un(t,b,n,x,a);R>0&&!S&&(g.style.marginLeft=`${R*o}px`);let m=e.spans[v+1],T=hn(e,v+1,u);S=T>0&&m!==void 0&&gn(b,m),S&&(g.style.wordSpacing=`${T*o}px`),R=T;let A=b.link;if(!A){l=null,d=null,c=null,r.append(g);continue}if(b.fieldAtom){l!==null&&d===A.id&&c===b.range.start||(l=lt(t,A,n),d=A.id,c=b.range.start,r.append(l)),l.append(g);continue}(!l||d!==A.id||c!==null)&&(l=lt(t,A,n),d=A.id,c=null,r.append(l)),l.append(g);}if(f(Na(e)[Na(e).length-1]?.paragraphId??e.range.paragraphId,Number.POSITIVE_INFINITY),e.spans.length===0){let v=t.createElement("br");v.style.lineHeight=`${e.box.height*o}px`,r.append(v);}let P=Object.freeze({x:e.contentX,y:e.box.y,width:e.box.width,height:e.box.height});n.showParagraphMarks&&e.manualBreakAfter&&r.append(Pe(t,e,o,n.revisionStyles));let $=ut(yt(n));if(e.drawings&&e.drawings.length>0)for(let v of Ue(t,e,$.ctx,$.urlRegistry,P))r.append(v);return r}function hn(t,e,n){if(e<=0||e>=t.spans.length)return 0;let o=t.spans[e-1],r=t.spans[e],a=n(o.range.paragraphId),i=n(r.range.paragraphId);if(t.drawings?.some(d=>{let c=n(d.paragraphId),y=c>a||c===a&&d.start>=o.range.start,u=c<i||c===i&&d.start<r.range.start;return y&&u}))return 0;let l=r.box.x-(o.box.x+o.box.width)-(r.wrapAdvanceBefore??0);return l>.001?l:0}var fn=/[\t\n\r \u00A0\u1361\u{10100}-\u{10102}\u{1039F}\u{1091F}]/u;function gn(t,e){return !t.text.endsWith(" ")||t.style.horizontalScalePercent!==100||!xn(t,e)||(e.wrapAdvanceBefore??0)>.001?false:!fn.test(t.text.slice(0,-1))}function xn(t,e){return !t.link&&!e.link?true:!t.link||!e.link||t.link.id!==e.link.id||!!t.fieldAtom!=!!e.fieldAtom?false:!t.fieldAtom||t.range.start===e.range.start}function I(t,e,n){let o=n.scale,r=M(t,"div",e.box,o);r.className="docx-paragraph-fragment layout-paragraph",e.clipToBox&&(r.style.overflow="hidden"),r.dataset.paragraphId=e.paragraphId,r.dataset.fragmentIndex=String(e.fragmentIndex),Z(r,e),n.readOnlyParagraphIds?.has(e.paragraphId)&&(r.classList.add("docx-generated-region"),r.dataset.docxReadOnly="",r.setAttribute("contenteditable","false"),r.setAttribute("aria-readonly","true")),n.emptyTocPlaceholderIds?.has(e.paragraphId)&&(r.classList.add("docx-toc-empty-placeholder"),r.dataset.docxTocEmpty=""),e.shading&&B.test(e.shading)&&e.shadingBox&&r.append(Sn(t,e,o)),e.marker&&r.append(bn(t,e,n));for(let i of e.lines)for(let s of i.spans){if(!s.tabLeader)continue;let l=vn(t,e,i,s,n);l&&r.append(l);}let a=dn(t,e,o);if(a&&r.append(a),n.showParagraphMarks&&e.paragraphEnd||e.markRevisions&&e.markRevisions.length>0){let i=Le(t,e.markRevisions??[],o,n.revisionStyles),s=e.lines[e.lines.length-1];if(s){let l=s.spans[s.spans.length-1];i.style.top=`${(s.box.y-e.box.y)*o}px`,i.style.left=`${((l?l.box.x+l.box.width:s.contentX)-e.box.x)*o}px`,r.append(i);}}for(let i of e.lines){let s=pn(t,i,n);e.markFormatRevision&&i===e.lines[e.lines.length-1]&&Z(s,e,true),s.style.top=`${(i.box.y-e.box.y)*o}px`,s.style.left=`${(i.contentX-e.box.x)*o}px`,r.append(s);}if(e.borders)for(let i of e.borders)r.append(dt(t,e,i,o));else e.bottomBorder&&r.append(dt(t,e,{side:"bottom",edge:e.bottomBorder.edge,box:e.bottomBorder.box},o));return r}function bn(t,e,n){let o=e.marker,r=n.scale,a=e.lines[0]?.leading??0,i=M(t,"span",o.box,r);i.className="docx-list-marker",i.dataset.docxMarker="",i.setAttribute("contenteditable","false"),i.setAttribute("aria-hidden","true"),i.style.left=`${(o.box.x-e.box.x)*r}px`,i.style.top=`${(o.box.y-e.box.y)*r}px`,i.style.display="block",i.style.overflow="visible",i.style.whiteSpace="pre";let s=e.lines[0],l=s?Math.max(a,...s.spans.map(u=>u.box.height+a),s.spans.length===0?s.box.height-(s.trailingSpacing??0):0):o.box.height,d=Math.min(l,o.box.height),c=Math.max(0,o.box.height-d);i.style.fontSize="0",i.style.boxSizing="border-box",i.style.paddingBottom=`${c*r}px`,i.style.lineHeight=`${d*r}px`;let y=t.createElement("span");return y.style.display="inline-block",y.style.verticalAlign="baseline",y.style.boxSizing="border-box",y.style.height=`${d*r}px`,y.style.paddingTop=`${a*r}px`,y.style.lineHeight=`${(d-a)*r}px`,q(y,o.style,n),xt(t,y,o.text,o.style,r),i.append(y),i}var mn=512;function vn(t,e,n,o,r){let a=o.tabLeader?Ob.get(o.tabLeader):void 0;if(!a||o.box.width<=0)return null;let i=r.scale,s=t.createElement("div");s.className="docx-tab-leader",s.dataset.docxTabLeader="",s.setAttribute("contenteditable","false"),s.setAttribute("aria-hidden","true"),s.style.position="absolute",o.tabLeader==="underscore"&&(s.style.zIndex="1"),s.style.left=`${(o.box.x-e.box.x)*i}px`,s.style.top=`${(n.box.y-e.box.y)*i}px`,s.style.width=`${o.box.width*i}px`,s.style.height=`${n.box.height*i}px`,s.style.overflow="hidden",s.style.whiteSpace="pre",s.style.pointerEvents="none",s.style.userSelect="none";let l=n.leading??0,d=Math.min(o.box.height+l,n.box.height),c=Math.max(0,n.box.height-d);s.style.fontSize="0",s.style.boxSizing="border-box",s.style.paddingBottom=`${c*i}px`,s.style.lineHeight=`${(n.box.height-c)*i}px`;let y=t.createElement("span");y.style.display="inline-block",y.style.verticalAlign="baseline",q(y,o.style,r),y.style.boxSizing="border-box",y.style.height=`${d*i}px`,y.style.paddingTop=`${l*i}px`,y.style.lineHeight=`${(d-l)*i}px`,o.tabLeader==="heavy"&&(y.style.fontWeight="bold");let u=o.tabLeaderAdvancePt&&o.tabLeaderAdvancePt>0?o.tabLeaderAdvancePt:Math.max(.5,o.style.fontSizePt*.2),h=Math.min(mn,Math.max(1,Math.floor(o.box.width/u)+2));return y.textContent=a.repeat(h),y.style.letterSpacing="0",s.append(y),s}function Sn(t,e,n){let o=e.shadingBox,r=M(t,"div",o,n);return r.className="docx-paragraph-shading",r.setAttribute("aria-hidden","true"),r.style.left=`${(o.x-e.box.x)*n}px`,r.style.top=`${(o.y-e.box.y)*n}px`,r.style.backgroundColor=`#${e.shading}`,r}function dt(t,e,n,o){let r=M(t,"div",n.box,o);r.className=`docx-paragraph-border docx-paragraph-border-${n.side}`,r.setAttribute("aria-hidden","true");let a=(n.box.x-e.box.x)*o,i=(n.box.y-e.box.y)*o,s=n.side==="left"||n.side==="right"||n.side==="bar",l=(s?n.box.width:n.box.height)*o,c=Rn(n.edge.val)?l:Math.max(1,l);r.style.left=`${n.side==="right"?a-(c-l):a}px`,r.style.top=`${n.side==="bottom"?i-(c-l):i}px`,s?r.style.width=`${c}px`:r.style.height=`${c}px`;let y=n.edge.color&&B.test(n.edge.color)?n.edge.color:"000000";return r.style.backgroundColor=`#${y}`,wn(r,n.edge.val,y,s,c,o),r}function Rn(t){return t==="double"||t==="triple"||t==="doubleWave"||t.startsWith("thinThick")||t.startsWith("thickThin")}function wn(t,e,n,o,r,a){switch(e){case "dashed":case "dashSmallGap":case "dotDash":case "dotDotDash":case "dashDotStroked":{let i=Math.max(4,4*a);t.style.backgroundImage=`linear-gradient(to ${o?"bottom":"right"}, #${n} 60%, transparent 60%)`,t.style.backgroundSize=o?`100% ${i}px`:`${i}px 100%`;return}case "dotted":{let i=Math.max(3,3*a);t.style.backgroundImage=`linear-gradient(to ${o?"bottom":"right"}, #${n} 35%, transparent 35%)`,t.style.backgroundSize=o?`100% ${i}px`:`${i}px 100%`;return}case "double":case "doubleWave":case "triple":case "thinThickSmallGap":case "thickThinSmallGap":case "thinThickThinSmallGap":case "thinThickMediumGap":case "thickThinMediumGap":case "thinThickThinMediumGap":case "thinThickLargeGap":case "thickThinLargeGap":case "thinThickThinLargeGap":{let i=Math.max(1,r/3);t.style.backgroundColor="transparent",o?(t.style.borderLeft=`${i}px solid #${n}`,t.style.borderRight=`${i}px solid #${n}`):(t.style.borderTop=`${i}px solid #${n}`,t.style.borderBottom=`${i}px solid #${n}`),t.style.boxSizing="border-box";return}case "threeDEmboss":case "ridge":{t.style.backgroundColor="transparent";let i=o?"borderLeft":"borderTop";t.style[i]=`${Math.max(1,r)}px ridge #${n}`,o?t.style.width="0px":t.style.height="0px";return}case "threeDEngrave":case "groove":{t.style.backgroundColor="transparent";let i=o?"borderLeft":"borderTop";t.style[i]=`${Math.max(1,r)}px groove #${n}`,o?t.style.width="0px":t.style.height="0px";return}case "inset":{t.style.backgroundColor="transparent";let i=o?"borderLeft":"borderTop";t.style[i]=`${Math.max(1,r)}px inset #${n}`,o?t.style.width="0px":t.style.height="0px";return}case "outset":{t.style.backgroundColor="transparent";let i=o?"borderLeft":"borderTop";t.style[i]=`${Math.max(1,r)}px outset #${n}`,o?t.style.width="0px":t.style.height="0px";return}default:return}}function kn(t,e,n,o){let r=o.scale,a=M(t,"div",e.box,r);if(a.className="docx-table-cell",a.style.left=`${(e.box.x-n.x)*r}px`,a.style.top=`${(e.box.y-n.y)*r}px`,a.style.boxSizing="border-box",a.style.overflow="visible",a.dataset.cellId=e.id,a.dataset.gridColumn=String(e.gridColumn),a.dataset.gridSpan=String(e.gridSpan),e.rowSpan&&e.rowSpan>1&&(a.dataset.rowSpan=String(e.rowSpan)),e.paintInert||e.vMergeContinue)return a.dataset.vMergeContinue="true",a.style.border="none",a.style.backgroundColor="transparent",a;a.style.border="none",Qe(t,a,e.borders,r),e.shading&&B.test(e.shading)&&(a.style.backgroundColor=`#${e.shading}`);let i=et(t,e,r,a);for(let s of e.blocks){let l=s.kind==="table"?F(t,s,o):I(t,s,o);l.style.left=`${(s.box.x-e.box.x)*r}px`,l.style.top=`${(s.box.y-e.box.y)*r}px`,i.append(l);}return a}function F(t,e,n){let o=n.scale,r=M(t,"div",e.box,o);r.className="docx-table-fragment layout-table",r.dataset.tableId=e.tableId,r.dataset.fragmentIndex=String(e.fragmentIndex),r.style.overflow="visible";for(let a of e.rows){let i=M(t,"div",a.box,o);i.className="docx-table-row",a.revisionKind&&(i.classList.add("docx-table-row--revision",a.revisionKind==="insert"?"layout-revision-ins":"layout-revision-del"),i.dataset.revisionKind=a.revisionKind,a.revisionId!==void 0&&(i.dataset.revisionId=a.revisionId),a.revisionAuthor!==void 0&&(i.dataset.reviewAuthor=a.revisionAuthor),a.revisionDate!==void 0&&(i.dataset.revisionDate=a.revisionDate)),i.dataset.rowId=a.id,a.isHeaderRepeat&&(i.dataset.headerRepeat="true"),i.style.left=`${(a.box.x-e.box.x)*o}px`,i.style.top=`${(a.box.y-e.box.y)*o}px`,i.style.overflow="visible";for(let s of a.cells)i.append(kn(t,s,a.box,n));r.append(i);}return r}function An(t,e,n,o,r){let a={...n,paintInstance:`p${e.index}`},i=M(t,"div",e.box,a.scale);if(i.className="docx-page",i.style.fontFamily=Ge$1,i.dataset.pageIndex=String(e.index),a.ariaHidden&&(i.setAttribute("aria-hidden","true"),i.setAttribute("role","presentation")),i.dataset.materialized=String(o),!o)return i;let s=Object.freeze({x:e.box.x,y:e.box.y,width:e.box.width,height:e.box.height}),l=Object.freeze({x:-(e.contentBox.x-e.box.x),y:-(e.contentBox.y-e.box.y),width:e.box.width,height:e.box.height});ot(t,i,e,a,l,"behind");for(let y of [e.header,e.footer])y?.anchoredDrawings?.length&&en(t,i,y,y.anchoredDrawings,a,{x:e.box.x,y:e.box.y,width:e.box.width,height:e.box.height});let d=t.createElement("div");d.className="docx-page-content",d.style.position="absolute",d.style.left=`${(e.contentBox.x-e.box.x)*a.scale}px`,d.style.top=`${(e.contentBox.y-e.box.y)*a.scale}px`,d.style.width=`${e.contentBox.width*a.scale}px`,d.style.height=`${e.contentBox.height*a.scale}px`,a.activeHeaderFooterRId&&d.setAttribute("contenteditable","false");for(let y of e.columnSeparators??[]){let u=t.createElement("div");u.className="docx-column-separator",u.setAttribute("contenteditable","false"),u.style.position="absolute",u.style.left=`${y.x*a.scale}px`,u.style.top=`${y.y*a.scale}px`,u.style.width=`${y.width*a.scale}px`,u.style.height=`${y.height*a.scale}px`,u.style.backgroundColor="currentColor",u.style.pointerEvents="none",d.append(u);}let c=r?new Map:null;for(let y of e.fragments){let u=y.kind==="table"?F(t,y,a):I(t,y,a);c?.set(y,u),d.append(u);}r&&c&&(r.content=d,r.blocks=c),i.append(d),ot(t,i,e,a,l,"inFront"),$e(t,i,e,a,I,F);for(let y of ["header","footer"]){if(e[y])continue;let u=t.createElement("div");u.className="docx-hf docx-hf--placeholder",u.dataset.docxHf=y,u.setAttribute("contenteditable","false");let h=y==="header"?e.contentBox.y-e.box.y:e.box.y+e.box.height-(e.contentBox.y+e.contentBox.height),p=Math.min(h,En);if(p<=0)continue;let f=Math.max(0,Math.min(Pn,h-p)),k=y==="header"?f:e.box.height-f-p;u.style.position="absolute",u.style.left=`${(e.contentBox.x-e.box.x)*a.scale}px`,u.style.top=`${k*a.scale}px`,u.style.width=`${e.contentBox.width*a.scale}px`,u.style.height=`${p*a.scale}px`,i.append(u);}for(let y of [e.header,e.footer]){if(!y)continue;let u=y.anchoredDrawings??[],h=G(y,e.index,a),p=t.createElement("div");p.className="docx-hf",p.dataset.docxHf=y.kind,y.rId&&(p.dataset.docxRId=y.rId),h?(p.dataset.docxHfActive="",p.setAttribute("contenteditable","true")):p.setAttribute("contenteditable","false"),p.style.position="absolute",p.style.left=`${(y.box.x-e.box.x)*a.scale}px`,p.style.top=`${(y.box.y-e.box.y)*a.scale}px`,p.style.width=`${y.box.width*a.scale}px`;let f=J(y,e,h);p.style.height=`${f*a.scale}px`,p.style.overflow="visible";let k=(e.box.x-y.box.x)*a.scale,R=(e.box.y-y.box.y)*a.scale,S=k+e.box.width*a.scale,P=R+e.box.height*a.scale;p.style.clipPath=`polygon(${k}px ${R}px, ${S}px ${R}px, ${S}px ${P}px, ${k}px ${P}px)`;let $=Object.freeze({x:0,y:0,width:y.box.width,height:y.box.height}),v=u.filter(g=>!pt(g)),b={...a,inertLinks:true};for(let g of y.fragments)p.append(g.kind==="table"?F(t,g,b):I(t,g,b));X(t,p,v,yt(a),$,"inFront",h),i.append(p);let x=t.createElement("div");x.className="docx-hf-edit-hint",x.dataset.docxHfHint=y.kind,x.setAttribute("contenteditable","false"),x.style.position="absolute",x.style.left=p.style.left,x.style.width=p.style.width,x.style.top=y.kind==="header"?`${(y.box.y+y.box.height-e.box.y)*a.scale}px`:`${(y.box.y-e.box.y)*a.scale}px`,y.kind==="footer"&&(x.style.transform="translateY(-100%)"),i.append(x),tn(t,i,y,u,a,s,"inFront",h);}return Mn(t,i,e,a),i}var En=30,Pn=36,Ln=16,$n=new Set(["dropdown","comboBox","date","checkbox"]);function Mn(t,e,n,o){let r=o.contentControlChrome,a=r?.suppressedIds,i=(n.contentControls??[]).filter(u=>a?.has(u.id)!==true),s=[...i,...(r?.additionalBoundaries??[]).filter(u=>a?.has(u.id)!==true&&!i.some(h=>h.id===u.id))];if(s.length===0)return;let l=r?.showAll===true,d=r?.activeIds,c=r?.hoverIds,y=r?.tocControlIds;for(let u of s){let h=y?.has(u.id)===true,p=!h&&d?.has(u.id)===true,f=c?.has(u.id)===true;e.append(Tn(t,n,u,o.scale,p,f,l||p||h&&f,r?.checkedIds?.has(u.id),h,r?.readOnly===true));}}function Tn(t,e,n,o,r,a,i,s,l,d){let c=t.createElement("div");c.className="docx-content-control-chrome",c.dataset.docxContentControl=n.id,c.dataset.docxMarker="",c.dataset.controlType=n.controlType,c.dataset.lock=n.effectiveLock,n.bound&&(c.dataset.bound=""),n.placeholder&&(c.dataset.placeholder=""),l&&(c.dataset.docxToc=""),d&&(c.dataset.readOnly=""),r&&(c.dataset.active=""),a&&(c.dataset.hover=""),i&&(c.dataset.boundaryVisible=""),c.setAttribute("contenteditable","false"),c.setAttribute("role","group"),n.alias&&(c.dataset.alias=n.alias),n.tag&&(c.dataset.tag=n.tag),n.alias&&c.setAttribute("aria-label",n.alias),c.style.position="absolute",c.style.inset="0",c.style.pointerEvents="none",c.style.zIndex="2";let y=e.contentBox.x-e.box.x,u=e.contentBox.y-e.box.y;for(let p of n.fragments){if(p.pageIndex!==e.index)continue;let f=t.createElement("div");f.className="docx-content-control-boundary",f.dataset.docxMarker="",f.setAttribute("contenteditable","false"),f.setAttribute("aria-hidden","true"),f.style.position="absolute",f.style.left=`${(y+p.box.x)*o}px`,f.style.top=`${(u+p.box.y)*o}px`,f.style.width=`${Math.max(p.box.width,1)*o}px`,f.style.height=`${Math.max(p.box.height,1)*o}px`,f.style.pointerEvents="none",c.append(f);}let h=n.fragments.find(p=>p.pageIndex===e.index);if(h&&n.alias){let p=t.createElement("div");p.className="docx-content-control-label",p.dataset.docxMarker="",p.setAttribute("contenteditable","false"),p.setAttribute("aria-hidden","true"),p.textContent=n.alias,p.style.position="absolute",p.style.left=`${(y+h.box.x)*o}px`,p.style.top=`${Math.max(0,(u+h.box.y)*o-Ln)}px`,p.style.pointerEvents="none",c.append(p);}if(h&&$n.has(n.controlType)){let p=t.createElement("button");p.type="button",p.className="docx-content-control-widget",p.dataset.docxMarker="",p.dataset.docxCcWidget=n.controlType,p.dataset.docxCcId=n.id,p.setAttribute("contenteditable","false"),p.setAttribute("tabindex","-1"),n.controlType==="checkbox"?p.setAttribute("role","checkbox"):n.controlType==="dropdown"||n.controlType==="comboBox"?p.setAttribute("role","listbox"):n.controlType==="date"&&p.setAttribute("role","button"),n.alias&&(p.dataset.name=n.alias),n.alias&&p.setAttribute("aria-label",n.alias),n.controlType==="checkbox"&&(p.setAttribute("data-checked",s?"true":"false"),p.setAttribute("aria-checked",s?"true":"false"));let f=n.effectiveLock==="contentLocked"||n.effectiveLock==="sdtContentLocked";(d||f||n.bound)&&(p.disabled=true,p.dataset.disabledReason=d?"readOnly":n.bound?"bound":"locked",p.setAttribute("aria-disabled","true")),p.style.position="absolute",p.style.left=`${(y+h.box.x+h.box.width)*o-18}px`,p.style.top=`${(u+h.box.y)*o}px`,p.style.width="16px",p.style.height="16px",p.style.pointerEvents="auto",p.style.padding="0",p.style.margin="0",p.style.cursor=p.disabled?"not-allowed":"pointer",c.append(p);}return c}var ie=new WeakMap;function To(t){ie.delete(t);}function Dn(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function Hn(t,e){let n=Object.keys(t);if(n.length!==Object.keys(e).length)return false;for(let o of n){let r=t[o],a=e[o];if(r!==a)return false}return true}function Cn(t,e){if(t.length!==e.length)return false;for(let n=0;n<t.length;n+=1)if(t[n]!==e[n])return false;return true}function In(t,e){if(t===e)return false;let n=new Set([...Object.keys(t),...Object.keys(e)]);for(let o of n){if(o==="fragments")continue;let r=t[o],a=e[o];if(r!==a&&!(Array.isArray(r)&&Array.isArray(a)&&Cn(r,a))&&!(typeof r=="object"&&typeof a=="object"&&r!==null&&a!==null&&!Array.isArray(r)&&!Array.isArray(a)&&Hn(r,a)))return false}return true}var ct="docx-column-separator";function Fn(t,e,n,o){let r=e.content,a=e.blocks;if(!r||!a||r.parentElement!==e.element)return null;let i={...o,paintInstance:`p${n.index}`},s=new Map,l=[];for(let u of n.fragments){let h=a.get(u)??(u.kind==="table"?F(t,u,i):I(t,u,i));s.set(u,h),l.push(h);}let d=new Set(l),c=r.firstChild;for(;c;){let u=c.nextSibling,h=c;!d.has(h)&&h.classList?.contains(ct)!==true&&c.remove(),c=u;}let y=r.firstChild;for(;y&&y.classList?.contains(ct);)y=y.nextSibling;for(let u of l){if(u===y){y=y.nextSibling;continue}r.insertBefore(u,y);}return {record:n,materialized:true,element:e.element,content:r,blocks:s}}function Bn(t,e,n,o){let r=t.element;return !t.materialized&&Dn(t.record.box,e.box)&&r.style.left===`${e.box.x*n}px`&&r.style.top===`${e.box.y*n}px`&&r.style.width===`${e.box.width*n}px`&&r.style.height===`${e.box.height*n}px`&&r.getAttribute("aria-hidden")===(o?"true":null)}function Nn(t,e,n={}){On(t,e,n);}function On(t,e,n,o){t.classList.toggle("docx-show-paragraph-marks",n.showParagraphMarks??false);let r=n.contentControlChrome,a=r?`${r.showAll===true?"1":"0"}:${r.activeIds?[...r.activeIds].sort().join(","):""}:${r.checkedIds?[...r.checkedIds].sort().join(","):""}:${r.tocControlIds?[...r.tocControlIds].sort().join(","):""}:${r.suppressedIds?[...r.suppressedIds].sort().join(","):""}:${r.readOnly===true?"ro":""}`:"",i=n.drawingStrings??ne,s=n.imageUrlPort!==void 0?Fe(t,n.imageUrlPort):null,l=r?.additionalBoundaries?r.additionalBoundaries.flatMap(g=>g.fragments.map(m=>`${g.id}:${m.pageIndex}:${m.box.x}:${m.box.y}:${m.box.width}:${m.box.height}`)).sort().join(","):"",d=n.readOnlyParagraphIds?[...n.readOnlyParagraphIds].sort().join(","):"",c=n.emptyTocPlaceholderIds?[...n.emptyTocPlaceholderIds].sort().join(","):"",y=r?.tocControlIds?[...r.tocControlIds].sort().join(","):"",u=Ee(n.revisionStyles,e,o),h={scale:n.scale??96/72,ariaHidden:n.ariaHidden??true,drawingStrings:i,urlRegistry:s,...n.fontAlias?{fontAlias:n.fontAlias}:{},...n.readOnlyParagraphIds?{readOnlyParagraphIds:n.readOnlyParagraphIds}:{},...n.emptyTocPlaceholderIds?{emptyTocPlaceholderIds:n.emptyTocPlaceholderIds}:{},...n.defaultFontFamily?{defaultFontFamily:n.defaultFontFamily}:{},...n.fieldShading?{fieldShading:n.fieldShading}:{},showParagraphMarks:n.showParagraphMarks??false,...n.shadeFormFields!==void 0?{shadeFormFields:n.shadeFormFields}:{},...u?{revisionStyles:u}:{},...n.imageUrlPort?{imageUrlPort:n.imageUrlPort}:{},...n.activeHeaderFooterRId?{activeHeaderFooterRId:n.activeHeaderFooterRId}:{},...n.activeHeaderFooterPageIndex!==void 0?{activeHeaderFooterPageIndex:n.activeHeaderFooterPageIndex}:{},...r?{contentControlChrome:r}:{}},p=t.ownerDocument,f=`${h.scale}|${h.ariaHidden}|${h.fontAlias?Jt(h.fontAlias):""}|${h.defaultFontFamily??""}|cc:${a}:${l}|toc:${y}|ro:${d}|tocEmpty:${c}|${n.imageUrlPort?"url":""}|${Ve(i)}|rev:${Ae(u)}|marks:${n.showParagraphMarks??false}`,k=ie.get(t),R=k?.parameters===f,S=R?new Map(k.pages.map(g=>[g.record,g])):null,P=k?new Map(k.pages.map(g=>[g.record.index,g])):null,$=e.pages.map(g=>{let m=n.materialize?.has(g.index)??true,T=S?.get(g);if(T&&T.materialized===m)return T;let A=P?.get(g.index);if(!m&&A&&Bn(A,g,h.scale,h.ariaHidden))return {record:g,materialized:false,element:A.element};if(R&&m&&A?.materialized&&In(A.record,g)){let se=Fn(p,A,g,h);if(se)return se}let H={},bt=An(p,g,h,m,H);return {record:g,materialized:m,element:bt,...H.content?{content:H.content}:{},...H.blocks?{blocks:H.blocks}:{}}});ie.set(t,{parameters:f,pages:$}),t.dataset.revision=String(e.revision),s&&s.reconcile(Ge(e),We(e));let v=new Set($.map(g=>g.element)),b=t.firstChild;for(;b;){let g=b.nextSibling;v.has(b)||b.remove(),b=g;}let x=t.firstChild;for(let g of $){if(g.element===x){x=x.nextSibling;continue}t.insertBefore(g.element,x);}Me($,h);}function Kn(t,e,n,o){let r=t.ownerDocument,a=o.scale,i=[];for(let s of n){let l=e.pages[s.pageIndex];if(!l)continue;let d=r.createElement("div");d.className=s.className??o.className??"docx-cell-selection-rect",d.style.position="absolute";let c=o.pageOffsetX?.get(s.pageIndex)??0;d.style.left=`${(l.contentBox.x+s.x+c)*a}px`,d.style.top=`${(l.contentBox.y+s.y)*a}px`,d.style.width=`${s.width*a}px`,d.style.height=`${s.height*a}px`,s.reviewAuthor&&(d.dataset.reviewAuthor=s.reviewAuthor.author,d.dataset.reviewAuthorSlot=String(s.reviewAuthor.slot%L),d.style.setProperty("--doc-review-author-current",s.reviewAuthor.color)),i.push(d);}t.replaceChildren(...i);}
2
- export{j as a,ke as b,Un as c,Pt as d,_n as e,ro as f,Ve as g,ne as h,ao as i,ae as j,on as k,To as l,Nn as m,On as n,Kn as o};