@qaecy/cue-ui 0.0.1 → 0.0.3

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.
Files changed (44) hide show
  1. package/README.md +107 -22
  2. package/card/3rdpartylicenses.txt +443 -0
  3. package/card/index.html +40 -0
  4. package/card/main.js +1 -0
  5. package/card/polyfills.js +1 -0
  6. package/card/poppins-latin-400-normal.woff +0 -0
  7. package/card/poppins-latin-400-normal.woff2 +0 -0
  8. package/card/poppins-latin-ext-400-normal.woff +0 -0
  9. package/card/poppins-latin-ext-400-normal.woff2 +0 -0
  10. package/card/runtime.js +1 -0
  11. package/card/styles.css +1 -0
  12. package/document-list/3rdpartylicenses.txt +723 -0
  13. package/document-list/index.html +549 -0
  14. package/document-list/main.js +1 -0
  15. package/document-list/polyfills.js +1 -0
  16. package/document-list/poppins-latin-400-normal.woff +0 -0
  17. package/document-list/poppins-latin-400-normal.woff2 +0 -0
  18. package/document-list/poppins-latin-ext-400-normal.woff +0 -0
  19. package/document-list/poppins-latin-ext-400-normal.woff2 +0 -0
  20. package/document-list/runtime.js +1 -0
  21. package/document-list/styles.css +1 -0
  22. package/document-viewer/236.js +1 -0
  23. package/document-viewer/336.js +1 -0
  24. package/document-viewer/3rdpartylicenses.txt +50 -68
  25. package/document-viewer/560.js +1 -1
  26. package/document-viewer/741.js +1 -0
  27. package/document-viewer/{160.js → 781.js} +1 -1
  28. package/document-viewer/83.js +1 -1
  29. package/document-viewer/885.js +1 -0
  30. package/document-viewer/common.js +1 -1
  31. package/document-viewer/index.html +595 -29
  32. package/document-viewer/main.js +1 -1
  33. package/logo/index.html +86 -1
  34. package/logo/main.js +1 -1
  35. package/package.json +10 -2
  36. package/project-documents/main.js +1 -1
  37. package/document-viewer/130.js +0 -1
  38. package/document-viewer/241.js +0 -1
  39. package/document-viewer/266.js +0 -1
  40. package/document-viewer/315.js +0 -1
  41. package/document-viewer/734.js +0 -1
  42. package/document-viewer/829.js +0 -1
  43. package/document-viewer/843.js +0 -1
  44. package/document-viewer/888.js +0 -1
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[83],{6117(Vr,yi,F){F.d(yi,{W:()=>Ei});var wt=F(7705),ee=F(7023),x=F(5547);const R=["contextMenuDirective"],_=[[["","trigger",""]],[["","menu",""]],[["","menu",""]]],Q=["[trigger]","[menu]","[menu]"];function It(Ot,xi){1&Ot&&x.SdG(0,1)}function wi(Ot,xi){1&Ot&&x.SdG(0,2)}let Ei=(()=>{class Ot{contextMenuData=(0,wt.hFB)({});trigger=(0,wt.hFB)("leftclick");positioning=(0,wt.hFB)(void 0);contextEnabled=(0,wt.hFB)(!0);menuClosed=(0,wt.CGW)();contextMenuDirective=(0,wt.ebz)("contextMenuDirective",{read:ee.Q});onMenuClose(){this.menuClosed.emit()}closeMenu(){const Et=this.contextMenuDirective();Et&&Et.closeContextMenu()}static \u0275fac=function(Vt){return new(Vt||Ot)};static \u0275cmp=x.VBU({type:Ot,selectors:[["cue-menu"]],viewQuery:function(Vt,jt){1&Vt&&x.wEZ(jt.contextMenuDirective,R,5,ee.Q),2&Vt&&x.NyB()},inputs:{contextMenuData:[1,"contextMenuData"],trigger:[1,"trigger"],positioning:[1,"positioning"],contextEnabled:[1,"contextEnabled"]},outputs:{menuClosed:"menuClosed"},ngContentSelectors:Q,decls:7,vars:5,consts:[["contextMenuDirective",""],["menuTemplate",""],[3,"contextMenuClose","cueContextMenu","contextMenuData","cueContextEnabled","trigger","positioning"]],template:function(Vt,jt){if(1&Vt&&(x.NAR(_),x.j41(0,"div",2,0),x.bIt("contextMenuClose",function(){return jt.onMenuClose()}),x.SdG(2),x.k0s(),x.DNE(3,It,1,0,"ng-template",null,1,x.C5r)(5,wi,1,0,"ng-template",null,1,x.C5r)),2&Vt){const Ue=x.sdS(4);x.Y8G("cueContextMenu",Ue)("contextMenuData",jt.contextMenuData)("cueContextEnabled",jt.contextEnabled())("trigger",jt.trigger())("positioning",jt.positioning())}},dependencies:[ee.Q],styles:["[_nghost-%COMP%]{display:block}"]})}return Ot})()},4311(Vr,yi,F){F.d(yi,{PDFViewer:()=>kd});var wt={};F.r(wt),F.d(wt,{AbortException:()=>tl,AnnotationEditorLayer:()=>el,AnnotationEditorParamsType:()=>il,AnnotationEditorType:()=>Cs,AnnotationEditorUIManager:()=>nl,AnnotationLayer:()=>sl,AnnotationMode:()=>rl,ColorPicker:()=>al,DOMSVGFactory:()=>ol,DrawLayer:()=>ll,FeatureTest:()=>hl,GlobalWorkerOptions:()=>Ss,ImageKind:()=>cl,InvalidPDFException:()=>dl,MissingPDFException:()=>ul,OPS:()=>fl,OutputScale:()=>pl,PDFDataRangeTransport:()=>gl,PDFDateString:()=>ml,PDFWorker:()=>bl,PasswordResponses:()=>_l,PermissionFlag:()=>vl,PixelsPerInch:()=>Al,RenderingCancelledException:()=>yl,TextLayer:()=>wl,UnexpectedResponseException:()=>El,Util:()=>xl,VerbosityLevel:()=>Ps,XfaLayer:()=>Cl,build:()=>Sl,createValidAbsoluteUrl:()=>Pl,fetchData:()=>Tl,getDocument:()=>Ts,getFilenameFromUrl:()=>Ml,getPdfFilenameFromUrl:()=>Ll,getXfaPageViewport:()=>Rl,isDataScheme:()=>Il,isPdfFile:()=>kl,noContextMenu:()=>Dl,normalizeUnicode:()=>Ol,setLayerDimensions:()=>Fl,shadow:()=>Nl,version:()=>oi});var ee={};F.r(ee),F.d(ee,{AnnotationLayerBuilder:()=>Xc,DownloadManager:()=>Yc,EventBus:()=>Kc,FindState:()=>qc,GenericL10n:()=>Er,LinkTarget:()=>Ae,PDFFindController:()=>xr,PDFHistory:()=>Qc,PDFLinkService:()=>Cr,PDFPageView:()=>Zc,PDFScriptingManager:()=>Jc,PDFSinglePageViewer:()=>Sr,PDFViewer:()=>Pr,ProgressBar:()=>td,RenderingStates:()=>ed,ScrollMode:()=>id,SimpleLinkService:()=>nd,SpreadMode:()=>sd,StructTreeLayerBuilder:()=>rd,TextLayerBuilder:()=>ad,XfaLayerBuilder:()=>od,parseQueryString:()=>ld});var x=F(467),R=F(5802),_=F(5547),Q=F(7705),It=F(2271),wi=F(8750),Ei=F(4226),Ot=F(1397),xi=F(7441),Et=F(8071),Vt=F(6450);const jt=["addListener","removeListener"],Ue=["addEventListener","removeEventListener"],jr=["on","off"];function Z(o,t,e,i){if((0,Et.T)(e)&&(i=e,e=void 0),i)return Z(o,t,e).pipe((0,Vt.I)(i));const[n,s]=function Wr(o){return(0,Et.T)(o.addEventListener)&&(0,Et.T)(o.removeEventListener)}(o)?Ue.map(r=>a=>o[r](t,a,e)):function Hr(o){return(0,Et.T)(o.addListener)&&(0,Et.T)(o.removeListener)}(o)?jt.map(Sn(o,t)):function zr(o){return(0,Et.T)(o.on)&&(0,Et.T)(o.off)}(o)?jr.map(Sn(o,t)):[];if(!n&&(0,xi.X)(o))return(0,Ot.Z)(r=>Z(r,t,e))((0,wi.Tg)(o));if(!n)throw new TypeError("Invalid event target");return new Ei.c(r=>{const a=(...l)=>r.next(1<l.length?l:l[0]);return n(a),()=>s(a)})}function Sn(o,t){return e=>i=>o[e](t,i)}var Ur=F(1413),Pn=F(6648),J=F(6977),Gr=F(3236),$r=F(9974),Xr=F(4360),Kr=F(5964),we={d:(o,t)=>{for(var e in t)we.o(t,e)&&!we.o(o,e)&&Object.defineProperty(o,e,{enumerable:!0,get:t[e]})},o:(o,t)=>Object.prototype.hasOwnProperty.call(o,t)},N=globalThis.pdfjsLib={};we.d(N,{AbortException:()=>ne,AnnotationEditorLayer:()=>Jo,AnnotationEditorParamsType:()=>D,AnnotationEditorType:()=>B,AnnotationEditorUIManager:()=>Te,AnnotationLayer:()=>qo,AnnotationMode:()=>qt,ColorPicker:()=>Mt,DOMSVGFactory:()=>Zi,DrawLayer:()=>gt,FeatureTest:()=>bt,GlobalWorkerOptions:()=>Le,ImageKind:()=>$e,InvalidPDFException:()=>Mn,MissingPDFException:()=>ie,OPS:()=>kt,OutputScale:()=>Oi,PDFDataRangeTransport:()=>ds,PDFDateString:()=>Dn,PDFWorker:()=>ct,PasswordResponses:()=>Jr,PermissionFlag:()=>Zr,PixelsPerInch:()=>ue,RenderingCancelledException:()=>Ii,TextLayer:()=>vt,UnexpectedResponseException:()=>qe,Util:()=>I,VerbosityLevel:()=>Xe,XfaLayer:()=>gs,build:()=>Lo,createValidAbsoluteUrl:()=>na,fetchData:()=>Ze,getDocument:()=>yo,getFilenameFromUrl:()=>fa,getPdfFilenameFromUrl:()=>pa,getXfaPageViewport:()=>ga,isDataScheme:()=>Je,isPdfFile:()=>ki,noContextMenu:()=>Pt,normalizeUnicode:()=>ca,setLayerDimensions:()=>se,shadow:()=>U,version:()=>Mo});const ft=!("object"!=typeof process||process+""!="[object process]"||process.versions.nw||process.versions.electron&&process.type&&"browser"!==process.type),Tn=[1,0,0,1,0,0],Ci=[.001,0,0,.001,0,0],qt={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},B={DISABLE:-1,NONE:0,FREETEXT:3,HIGHLIGHT:9,STAMP:13,INK:15},D={RESIZE:1,CREATE:2,FREETEXT_SIZE:11,FREETEXT_COLOR:12,FREETEXT_OPACITY:13,INK_COLOR:21,INK_THICKNESS:22,INK_OPACITY:23,HIGHLIGHT_COLOR:31,HIGHLIGHT_DEFAULT_COLOR:32,HIGHLIGHT_THICKNESS:33,HIGHLIGHT_FREE:34,HIGHLIGHT_SHOW_ALL:35},Zr={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},$e={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},Xe={ERRORS:0,WARNINGS:1,INFOS:5},kt={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotation:80,endAnnotation:81,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91,setStrokeTransparent:92,setFillTransparent:93},Jr={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};let Ye=Xe.WARNINGS;function ea(){return Ye}function Ke(o){Ye>=Xe.INFOS&&console.log(`Info: ${o}`)}function V(o){Ye>=Xe.WARNINGS&&console.log(`Warning: ${o}`)}function X(o){throw new Error(o)}function lt(o,t){o||X(t)}function na(o,t=null,e=null){if(!o)return null;try{if(e&&"string"==typeof o&&(e.addDefaultProtocol&&o.startsWith("www.")&&o.match(/\./g)?.length>=2&&(o=`http://${o}`),e.tryConvertEncoding))try{o=function ha(o){return decodeURIComponent(escape(o))}(o)}catch{}const i=t?new URL(o,t):new URL(o);if(function ia(o){switch(o?.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}(i))return i}catch{}return null}function U(o,t,e,i=!1){return Object.defineProperty(o,t,{value:e,enumerable:!i,configurable:!0,writable:!1}),e}const Qt=function(){function t(e,i){this.message=e,this.name=i}return t.prototype=new Error,t.constructor=t,t}();class Si extends Qt{constructor(t,e){super(t,"PasswordException"),this.code=e}}class Pi extends Qt{constructor(t,e){super(t,"UnknownErrorException"),this.details=e}}class Mn extends Qt{constructor(t){super(t,"InvalidPDFException")}}class ie extends Qt{constructor(t){super(t,"MissingPDFException")}}class qe extends Qt{constructor(t,e){super(t,"UnexpectedResponseException"),this.status=e}}class sa extends Qt{constructor(t){super(t,"FormatError")}}class ne extends Qt{constructor(t){super(t,"AbortException")}}function Ln(o){("object"!=typeof o||void 0===o?.length)&&X("Invalid argument for bytesToString");const t=o.length,e=8192;if(t<e)return String.fromCharCode.apply(null,o);const i=[];for(let n=0;n<t;n+=e){const s=Math.min(n+e,t),r=o.subarray(n,s);i.push(String.fromCharCode.apply(null,r))}return i.join("")}function de(o){"string"!=typeof o&&X("Invalid argument for stringToBytes");const t=o.length,e=new Uint8Array(t);for(let i=0;i<t;++i)e[i]=255&o.charCodeAt(i);return e}function Ti(o){const t=Object.create(null);for(const[e,i]of o)t[e]=i;return t}class bt{static get isLittleEndian(){return U(this,"isLittleEndian",function aa(){const o=new Uint8Array(4);return o[0]=1,1===new Uint32Array(o.buffer,0,1)[0]}())}static get isEvalSupported(){return U(this,"isEvalSupported",function oa(){try{return new Function(""),!0}catch{return!1}}())}static get isOffscreenCanvasSupported(){return U(this,"isOffscreenCanvasSupported",typeof OffscreenCanvas<"u")}static get platform(){return typeof navigator<"u"&&"string"==typeof navigator?.platform?U(this,"platform",{isMac:navigator.platform.includes("Mac"),isWindows:navigator.platform.includes("Win"),isFirefox:"string"==typeof navigator?.userAgent&&navigator.userAgent.includes("Firefox")}):U(this,"platform",{isMac:!1,isWindows:!1,isFirefox:!1})}static get isCSSRoundSupported(){return U(this,"isCSSRoundSupported",globalThis.CSS?.supports?.("width: round(1.5px, 1px)"))}}const Qe=Array.from(Array(256).keys(),o=>o.toString(16).padStart(2,"0"));class I{static makeHexColor(t,e,i){return`#${Qe[t]}${Qe[e]}${Qe[i]}`}static scaleMinMax(t,e){let i;t[0]?(t[0]<0&&(i=e[0],e[0]=e[2],e[2]=i),e[0]*=t[0],e[2]*=t[0],t[3]<0&&(i=e[1],e[1]=e[3],e[3]=i),e[1]*=t[3],e[3]*=t[3]):(i=e[0],e[0]=e[1],e[1]=i,i=e[2],e[2]=e[3],e[3]=i,t[1]<0&&(i=e[1],e[1]=e[3],e[3]=i),e[1]*=t[1],e[3]*=t[1],t[2]<0&&(i=e[0],e[0]=e[2],e[2]=i),e[0]*=t[2],e[2]*=t[2]),e[0]+=t[4],e[1]+=t[5],e[2]+=t[4],e[3]+=t[5]}static transform(t,e){return[t[0]*e[0]+t[2]*e[1],t[1]*e[0]+t[3]*e[1],t[0]*e[2]+t[2]*e[3],t[1]*e[2]+t[3]*e[3],t[0]*e[4]+t[2]*e[5]+t[4],t[1]*e[4]+t[3]*e[5]+t[5]]}static applyTransform(t,e){return[t[0]*e[0]+t[1]*e[2]+e[4],t[0]*e[1]+t[1]*e[3]+e[5]]}static applyInverseTransform(t,e){const i=e[0]*e[3]-e[1]*e[2];return[(t[0]*e[3]-t[1]*e[2]+e[2]*e[5]-e[4]*e[3])/i,(-t[0]*e[1]+t[1]*e[0]+e[4]*e[1]-e[5]*e[0])/i]}static getAxialAlignedBoundingBox(t,e){const i=this.applyTransform(t,e),n=this.applyTransform(t.slice(2,4),e),s=this.applyTransform([t[0],t[3]],e),r=this.applyTransform([t[2],t[1]],e);return[Math.min(i[0],n[0],s[0],r[0]),Math.min(i[1],n[1],s[1],r[1]),Math.max(i[0],n[0],s[0],r[0]),Math.max(i[1],n[1],s[1],r[1])]}static inverseTransform(t){const e=t[0]*t[3]-t[1]*t[2];return[t[3]/e,-t[1]/e,-t[2]/e,t[0]/e,(t[2]*t[5]-t[4]*t[3])/e,(t[4]*t[1]-t[5]*t[0])/e]}static singularValueDecompose2dScale(t){const e=[t[0],t[2],t[1],t[3]],i=t[0]*e[0]+t[1]*e[2],r=t[2]*e[1]+t[3]*e[3],a=(i+r)/2,l=Math.sqrt((i+r)**2-4*(i*r-(t[2]*e[0]+t[3]*e[2])*(t[0]*e[1]+t[1]*e[3])))/2,c=a-l||1;return[Math.sqrt(a+l||1),Math.sqrt(c)]}static normalizeRect(t){const e=t.slice(0);return t[0]>t[2]&&(e[0]=t[2],e[2]=t[0]),t[1]>t[3]&&(e[1]=t[3],e[3]=t[1]),e}static intersect(t,e){const i=Math.max(Math.min(t[0],t[2]),Math.min(e[0],e[2])),n=Math.min(Math.max(t[0],t[2]),Math.max(e[0],e[2]));if(i>n)return null;const s=Math.max(Math.min(t[1],t[3]),Math.min(e[1],e[3])),r=Math.min(Math.max(t[1],t[3]),Math.max(e[1],e[3]));return s>r?null:[i,s,n,r]}static#t(t,e,i,n,s,r,a,l,h,c){if(h<=0||h>=1)return;const d=1-h,u=h*h,f=u*h,p=d*(d*(d*t+3*h*e)+3*u*i)+f*n,g=d*(d*(d*s+3*h*r)+3*u*a)+f*l;c[0]=Math.min(c[0],p),c[1]=Math.min(c[1],g),c[2]=Math.max(c[2],p),c[3]=Math.max(c[3],g)}static#e(t,e,i,n,s,r,a,l,h,c,d,u){if(Math.abs(h)<1e-12)return void(Math.abs(c)>=1e-12&&this.#t(t,e,i,n,s,r,a,l,-d/c,u));const f=c**2-4*d*h;if(f<0)return;const p=Math.sqrt(f),g=2*h;this.#t(t,e,i,n,s,r,a,l,(-c+p)/g,u),this.#t(t,e,i,n,s,r,a,l,(-c-p)/g,u)}static bezierBoundingBox(t,e,i,n,s,r,a,l,h){return h?(h[0]=Math.min(h[0],t,a),h[1]=Math.min(h[1],e,l),h[2]=Math.max(h[2],t,a),h[3]=Math.max(h[3],e,l)):h=[Math.min(t,a),Math.min(e,l),Math.max(t,a),Math.max(e,l)],this.#e(t,i,s,a,e,n,r,l,3*(3*(i-s)-t+a),6*(t-2*i+s),3*(i-t),h),this.#e(t,i,s,a,e,n,r,l,3*(3*(n-r)-e+l),6*(e-2*n+r),3*(n-e),h),h}}let Mi=null,Rn=null;function ca(o){return Mi||(Mi=/([\u00a0\u00b5\u037e\u0eb3\u2000-\u200a\u202f\u2126\ufb00-\ufb04\ufb06\ufb20-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufba1\ufba4-\ufba9\ufbae-\ufbb1\ufbd3-\ufbdc\ufbde-\ufbe7\ufbea-\ufbf8\ufbfc-\ufbfd\ufc00-\ufc5d\ufc64-\ufcf1\ufcf5-\ufd3d\ufd88\ufdf4\ufdfa-\ufdfb\ufe71\ufe77\ufe79\ufe7b\ufe7d]+)|(\ufb05+)/gu,Rn=new Map([["\ufb05","\u017ft"]])),o.replaceAll(Mi,(t,e,i)=>e?e.normalize("NFKC"):Rn.get(i))}const Li="pdfjs_internal_id_",zt="http://www.w3.org/2000/svg";class ue{static CSS=96;static PDF=72;static PDF_TO_CSS_UNITS=this.CSS/this.PDF}function Ze(o){return Ri.apply(this,arguments)}function Ri(){return(Ri=(0,x.A)(function*(o,t="text"){if(Ce(o,document.baseURI)){const e=yield fetch(o);if(!e.ok)throw new Error(e.statusText);switch(t){case"arraybuffer":return e.arrayBuffer();case"blob":return e.blob();case"json":return e.json()}return e.text()}return new Promise((e,i)=>{const n=new XMLHttpRequest;n.open("GET",o,!0),n.responseType=t,n.onreadystatechange=()=>{if(n.readyState===XMLHttpRequest.DONE){if(200===n.status||0===n.status){switch(t){case"arraybuffer":case"blob":case"json":return void e(n.response)}return void e(n.responseText)}i(new Error(n.statusText))}},n.send(null)})})).apply(this,arguments)}class xe{constructor({viewBox:t,scale:e,rotation:i,offsetX:n=0,offsetY:s=0,dontFlip:r=!1}){this.viewBox=t,this.scale=e,this.rotation=i,this.offsetX=n,this.offsetY=s;const a=(t[2]+t[0])/2,l=(t[3]+t[1])/2;let h,c,d,u,f,p,g,b;switch((i%=360)<0&&(i+=360),i){case 180:h=-1,c=0,d=0,u=1;break;case 90:h=0,c=1,d=1,u=0;break;case 270:h=0,c=-1,d=-1,u=0;break;case 0:h=1,c=0,d=0,u=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}r&&(d=-d,u=-u),0===h?(f=Math.abs(l-t[1])*e+n,p=Math.abs(a-t[0])*e+s,g=(t[3]-t[1])*e,b=(t[2]-t[0])*e):(f=Math.abs(a-t[0])*e+n,p=Math.abs(l-t[1])*e+s,g=(t[2]-t[0])*e,b=(t[3]-t[1])*e),this.transform=[h*e,c*e,d*e,u*e,f-h*e*a-d*e*l,p-c*e*a-u*e*l],this.width=g,this.height=b}get rawDims(){const{viewBox:t}=this;return U(this,"rawDims",{pageWidth:t[2]-t[0],pageHeight:t[3]-t[1],pageX:t[0],pageY:t[1]})}clone({scale:t=this.scale,rotation:e=this.rotation,offsetX:i=this.offsetX,offsetY:n=this.offsetY,dontFlip:s=!1}={}){return new xe({viewBox:this.viewBox.slice(),scale:t,rotation:e,offsetX:i,offsetY:n,dontFlip:s})}convertToViewportPoint(t,e){return I.applyTransform([t,e],this.transform)}convertToViewportRectangle(t){const e=I.applyTransform([t[0],t[1]],this.transform),i=I.applyTransform([t[2],t[3]],this.transform);return[e[0],e[1],i[0],i[1]]}convertToPdfPoint(t,e){return I.applyInverseTransform([t,e],this.transform)}}class Ii extends Qt{constructor(t,e=0){super(t,"RenderingCancelledException"),this.extraDelay=e}}function Je(o){const t=o.length;let e=0;for(;e<t&&""===o[e].trim();)e++;return"data:"===o.substring(e,e+5).toLowerCase()}function ki(o){return"string"==typeof o&&/\.pdf$/i.test(o)}function fa(o){return[o]=o.split(/[#?]/,1),o.substring(o.lastIndexOf("/")+1)}function pa(o,t="document.pdf"){if("string"!=typeof o)return t;if(Je(o))return V('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),t;const i=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i,n=/^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/.exec(o);let s=i.exec(n[1])||i.exec(n[2])||i.exec(n[3]);if(s&&(s=s[0],s.includes("%")))try{s=i.exec(decodeURIComponent(s))[0]}catch{}return s||t}class In{started=Object.create(null);times=[];time(t){t in this.started&&V(`Timer is already running for ${t}`),this.started[t]=Date.now()}timeEnd(t){t in this.started||V(`Timer has not been started for ${t}`),this.times.push({name:t,start:this.started[t],end:Date.now()}),delete this.started[t]}toString(){const t=[];let e=0;for(const{name:i}of this.times)e=Math.max(i.length,e);for(const{name:i,start:n,end:s}of this.times)t.push(`${i.padEnd(e)} ${s-n}ms\n`);return t.join("")}}function Ce(o,t){try{const{protocol:e}=t?new URL(o,t):new URL(o);return"http:"===e||"https:"===e}catch{return!1}}function Pt(o){o.preventDefault()}function kn(o){console.log("Deprecated API usage: "+o)}class Dn{static#t;static toDateObject(t){if(!t||"string"!=typeof t)return null;this.#t||=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?");const e=this.#t.exec(t);if(!e)return null;const i=parseInt(e[1],10);let n=parseInt(e[2],10);n=n>=1&&n<=12?n-1:0;let s=parseInt(e[3],10);s=s>=1&&s<=31?s:1;let r=parseInt(e[4],10);r=r>=0&&r<=23?r:0;let a=parseInt(e[5],10);a=a>=0&&a<=59?a:0;let l=parseInt(e[6],10);l=l>=0&&l<=59?l:0;const h=e[7]||"Z";let c=parseInt(e[8],10);c=c>=0&&c<=23?c:0;let d=parseInt(e[9],10)||0;return d=d>=0&&d<=59?d:0,"-"===h?(r+=c,a+=d):"+"===h&&(r-=c,a-=d),new Date(Date.UTC(i,n,s,r,a,l))}}function ga(o,{scale:t=1,rotation:e=0}){const{width:i,height:n}=o.attributes.style,s=[0,0,parseInt(i),parseInt(n)];return new xe({viewBox:s,scale:t,rotation:e})}function Di(o){if(o.startsWith("#")){const t=parseInt(o.slice(1),16);return[(16711680&t)>>16,(65280&t)>>8,255&t]}return o.startsWith("rgb(")?o.slice(4,-1).split(",").map(t=>parseInt(t)):o.startsWith("rgba(")?o.slice(5,-1).split(",").map(t=>parseInt(t)).slice(0,3):(V(`Not a valid color format: "${o}"`),[0,0,0])}function K(o){const{a:t,b:e,c:i,d:n,e:s,f:r}=o.getTransform();return[t,e,i,n,s,r]}function Wt(o){const{a:t,b:e,c:i,d:n,e:s,f:r}=o.getTransform().invertSelf();return[t,e,i,n,s,r]}function se(o,t,e=!1,i=!0){if(t instanceof xe){const{pageWidth:n,pageHeight:s}=t.rawDims,{style:r}=o,a=bt.isCSSRoundSupported,l=`var(--scale-factor) * ${n}px`,h=`var(--scale-factor) * ${s}px`,c=a?`round(down, ${l}, var(--scale-round-x, 1px))`:`calc(${l})`,d=a?`round(down, ${h}, var(--scale-round-y, 1px))`:`calc(${h})`;e&&t.rotation%180!=0?(r.width=d,r.height=c):(r.width=c,r.height=d)}i&&o.setAttribute("data-main-rotation",t.rotation)}class Oi{constructor(){const t=window.devicePixelRatio||1;this.sx=t,this.sy=t}get scaled(){return 1!==this.sx||1!==this.sy}get symmetric(){return this.sx===this.sy}}class Se{#t=null;#e=null;#i;#n=null;#s=null;static#r=null;constructor(t){this.#i=t,Se.#r||=Object.freeze({freetext:"pdfjs-editor-remove-freetext-button",highlight:"pdfjs-editor-remove-highlight-button",ink:"pdfjs-editor-remove-ink-button",stamp:"pdfjs-editor-remove-stamp-button"})}render(){const t=this.#t=document.createElement("div");t.classList.add("editToolbar","hidden"),t.setAttribute("role","toolbar");const e=this.#i._uiManager._signal;t.addEventListener("contextmenu",Pt,{signal:e}),t.addEventListener("pointerdown",Se.#l,{signal:e});const i=this.#n=document.createElement("div");i.className="buttons",t.append(i);const n=this.#i.toolbarPosition;if(n){const{style:s}=t,r="ltr"===this.#i._uiManager.direction?1-n[0]:n[0];s.insetInlineEnd=100*r+"%",s.top=`calc(${100*n[1]}% + var(--editor-toolbar-vert-offset))`}return this.#d(),t}get div(){return this.#t}static#l(t){t.stopPropagation()}#h(t){this.#i._focusEventsAllowed=!1,t.preventDefault(),t.stopPropagation()}#c(t){this.#i._focusEventsAllowed=!0,t.preventDefault(),t.stopPropagation()}#o(t){const e=this.#i._uiManager._signal;t.addEventListener("focusin",this.#h.bind(this),{capture:!0,signal:e}),t.addEventListener("focusout",this.#c.bind(this),{capture:!0,signal:e}),t.addEventListener("contextmenu",Pt,{signal:e})}hide(){this.#t.classList.add("hidden"),this.#e?.hideDropdown()}show(){this.#t.classList.remove("hidden"),this.#s?.shown()}#d(){const{editorType:t,_uiManager:e}=this.#i,i=document.createElement("button");i.className="delete",i.tabIndex=0,i.setAttribute("data-l10n-id",Se.#r[t]),this.#o(i),i.addEventListener("click",n=>{e.delete()},{signal:e._signal}),this.#n.append(i)}get#a(){const t=document.createElement("div");return t.className="divider",t}addAltText(t){var e=this;return(0,x.A)(function*(){const i=yield t.render();e.#o(i),e.#n.prepend(i,e.#a),e.#s=t})()}addColorPicker(t){this.#e=t;const e=t.renderButton();this.#o(e),this.#n.prepend(e,this.#a)}remove(){this.#t.remove(),this.#e?.destroy(),this.#e=null}}class ba{#t=null;#e=null;#i;constructor(t){this.#i=t}#n(){const t=this.#e=document.createElement("div");t.className="editToolbar",t.setAttribute("role","toolbar"),t.addEventListener("contextmenu",Pt,{signal:this.#i._signal});const e=this.#t=document.createElement("div");return e.className="buttons",t.append(e),this.#r(),t}#s(t,e){let i=0,n=0;for(const s of t){const r=s.y+s.height;if(r<i)continue;const a=s.x+(e?s.width:0);r>i?(n=a,i=r):e?a>n&&(n=a):a<n&&(n=a)}return[e?1-n:n,i]}show(t,e,i){const[n,s]=this.#s(e,i),{style:r}=this.#e||=this.#n();t.append(this.#e),r.insetInlineEnd=100*n+"%",r.top=`calc(${100*s}% + var(--editor-toolbar-vert-offset))`}hide(){this.#e.remove()}#r(){const t=document.createElement("button");t.className="highlightButton",t.tabIndex=0,t.setAttribute("data-l10n-id","pdfjs-highlight-floating-button1");const e=document.createElement("span");t.append(e),e.className="visuallyHidden",e.setAttribute("data-l10n-id","pdfjs-highlight-floating-button-label");const i=this.#i._signal;t.addEventListener("contextmenu",Pt,{signal:i}),t.addEventListener("click",()=>{this.#i.highlightSelection("floating_button")},{signal:i}),this.#t.append(t)}}function ti(o,t,e){for(const i of e)t.addEventListener(i,o[i].bind(o))}class va{#t=0;get id(){return"pdfjs_internal_editor_"+this.#t++}}class Fi{#t=function da(){if(typeof crypto<"u"&&"function"==typeof crypto?.randomUUID)return crypto.randomUUID();const o=new Uint8Array(32);if(typeof crypto<"u"&&"function"==typeof crypto?.getRandomValues)crypto.getRandomValues(o);else for(let t=0;t<32;t++)o[t]=Math.floor(255*Math.random());return Ln(o)}();#e=0;#i=null;static get _isSVGFittingCanvas(){const i=new OffscreenCanvas(1,3).getContext("2d",{willReadFrequently:!0}),n=new Image;return n.src='data:image/svg+xml;charset=UTF-8,<svg viewBox="0 0 1 1" width="1" height="1" xmlns="http://www.w3.org/2000/svg"><rect width="1" height="1" style="fill:red;"/></svg>',U(this,"_isSVGFittingCanvas",n.decode().then(()=>(i.drawImage(n,0,0,1,1,0,0,1,3),0===new Uint32Array(i.getImageData(0,0,1,1).data.buffer)[0])))}#n(t,e){var i=this;return(0,x.A)(function*(){i.#i||=new Map;let n=i.#i.get(t);if(null===n)return null;if(n?.bitmap)return n.refCounter+=1,n;try{let s;if(n||={bitmap:null,id:`image_${i.#t}_${i.#e++}`,refCounter:0,isSvg:!1},"string"==typeof e?(n.url=e,s=yield Ze(e,"blob")):e instanceof File?s=n.file=e:e instanceof Blob&&(s=e),"image/svg+xml"===s.type){const r=Fi._isSVGFittingCanvas,a=new FileReader,l=new Image,h=new Promise((c,d)=>{l.onload=()=>{n.bitmap=l,n.isSvg=!0,c()},a.onload=(0,x.A)(function*(){const u=n.svgUrl=a.result;l.src=(yield r)?`${u}#svgView(preserveAspectRatio(none))`:u}),l.onerror=a.onerror=d});a.readAsDataURL(s),yield h}else n.bitmap=yield createImageBitmap(s);n.refCounter=1}catch(s){console.error(s),n=null}return i.#i.set(t,n),n&&i.#i.set(n.id,n),n})()}getFromFile(t){var e=this;return(0,x.A)(function*(){const{lastModified:i,name:n,size:s,type:r}=t;return e.#n(`${i}_${n}_${s}_${r}`,t)})()}getFromUrl(t){var e=this;return(0,x.A)(function*(){return e.#n(t,t)})()}getFromBlob(t,e){var i=this;return(0,x.A)(function*(){const n=yield e;return i.#n(t,n)})()}getFromId(t){var e=this;return(0,x.A)(function*(){e.#i||=new Map;const i=e.#i.get(t);if(!i)return null;if(i.bitmap)return i.refCounter+=1,i;if(i.file)return e.getFromFile(i.file);if(i.blobPromise){const{blobPromise:n}=i;return delete i.blobPromise,e.getFromBlob(i.id,n)}return e.getFromUrl(i.url)})()}getFromCanvas(t,e){this.#i||=new Map;let i=this.#i.get(t);if(i?.bitmap)return i.refCounter+=1,i;const n=new OffscreenCanvas(e.width,e.height);return n.getContext("2d").drawImage(e,0,0),i={bitmap:n.transferToImageBitmap(),id:`image_${this.#t}_${this.#e++}`,refCounter:1,isSvg:!1},this.#i.set(t,i),this.#i.set(i.id,i),i}getSvgUrl(t){const e=this.#i.get(t);return e?.isSvg?e.svgUrl:null}deleteId(t){this.#i||=new Map;const e=this.#i.get(t);if(!e||(e.refCounter-=1,0!==e.refCounter))return;const{bitmap:i}=e;if(!e.url&&!e.file){const n=new OffscreenCanvas(i.width,i.height);n.getContext("bitmaprenderer").transferFromImageBitmap(i),e.blobPromise=n.convertToBlob()}i.close?.(),e.bitmap=null}isValidId(t){return t.startsWith(`image_${this.#t}_`)}}class Aa{#t=[];#e=!1;#i;#n=-1;constructor(t=128){this.#i=t}add({cmd:t,undo:e,post:i,mustExec:n,type:s=NaN,overwriteIfSameType:r=!1,keepUndo:a=!1}){if(n&&t(),this.#e)return;const l={cmd:t,undo:e,post:i,type:s};if(-1===this.#n)return this.#t.length>0&&(this.#t.length=0),this.#n=0,void this.#t.push(l);if(r&&this.#t[this.#n].type===s)return a&&(l.undo=this.#t[this.#n].undo),void(this.#t[this.#n]=l);const h=this.#n+1;h===this.#i?this.#t.splice(0,1):(this.#n=h,h<this.#t.length&&this.#t.splice(h)),this.#t.push(l)}undo(){if(-1===this.#n)return;this.#e=!0;const{undo:t,post:e}=this.#t[this.#n];t(),e?.(),this.#e=!1,this.#n-=1}redo(){if(this.#n<this.#t.length-1){this.#n+=1,this.#e=!0;const{cmd:t,post:e}=this.#t[this.#n];t(),e?.(),this.#e=!1}}hasSomethingToUndo(){return-1!==this.#n}hasSomethingToRedo(){return this.#n<this.#t.length-1}destroy(){this.#t=null}}class Pe{constructor(t){this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:e}=bt.platform;for(const[i,n,s={}]of t)for(const r of i){const a=r.startsWith("mac+");e&&a?(this.callbacks.set(r.slice(4),{callback:n,options:s}),this.allKeys.add(r.split("+").at(-1))):!e&&!a&&(this.callbacks.set(r,{callback:n,options:s}),this.allKeys.add(r.split("+").at(-1)))}}#t(t){t.altKey&&this.buffer.push("alt"),t.ctrlKey&&this.buffer.push("ctrl"),t.metaKey&&this.buffer.push("meta"),t.shiftKey&&this.buffer.push("shift"),this.buffer.push(t.key);const e=this.buffer.join("+");return this.buffer.length=0,e}exec(t,e){if(!this.allKeys.has(e.key))return;const i=this.callbacks.get(this.#t(e));if(!i)return;const{callback:n,options:{bubbles:s=!1,args:r=[],checker:a=null}}=i;a&&!a(t,e)||(n.bind(t,...r,e)(),s||(e.stopPropagation(),e.preventDefault()))}}class Ni{static _colorsMapping=new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]);get _colors(){const t=new Map([["CanvasText",null],["Canvas",null]]);return function ma(o){const t=document.createElement("span");t.style.visibility="hidden",document.body.append(t);for(const e of o.keys()){t.style.color=e;const i=window.getComputedStyle(t).color;o.set(e,Di(i))}t.remove()}(t),U(this,"_colors",t)}convert(t){const e=Di(t);if(!window.matchMedia("(forced-colors: active)").matches)return e;for(const[i,n]of this._colors)if(n.every((s,r)=>s===e[r]))return Ni._colorsMapping.get(i);return e}getHexCode(t){const e=this._colors.get(t);return e?I.makeHexColor(...e):t}}let Te=(()=>{class o{#t=new AbortController;#e=null;#i=new Map;#n=new Map;#s=null;#r=null;#l=null;#h=new Aa;#c=null;#o=0;#d=new Set;#a=null;#u=null;#p=new Set;#f=!1;#g=!1;#b=!1;#m=null;#_=null;#A=null;#E=null;#y=!1;#w=null;#L=new va;#P=!1;#x=!1;#T=null;#S=null;#R=null;#k=null;#C=B.NONE;#v=new Set;#M=null;#I=null;#N=null;#H={isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1,hasSelectedText:!1};#j=[0,0];#F=null;#B=null;#V=null;#D=null;static TRANSLATE_SMALL=1;static TRANSLATE_BIG=10;static get _keyboardManager(){const e=o.prototype,i=a=>a.#B.contains(document.activeElement)&&"BUTTON"!==document.activeElement.tagName&&a.hasSomethingToControl(),n=(a,{target:l})=>{if(l instanceof HTMLInputElement){const{type:h}=l;return"text"!==h&&"number"!==h}return!0},s=this.TRANSLATE_SMALL,r=this.TRANSLATE_BIG;return U(this,"_keyboardManager",new Pe([[["ctrl+a","mac+meta+a"],e.selectAll,{checker:n}],[["ctrl+z","mac+meta+z"],e.undo,{checker:n}],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],e.redo,{checker:n}],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete","mac+Delete"],e.delete,{checker:n}],[["Enter","mac+Enter"],e.addNewEditorFromKeyboard,{checker:(a,{target:l})=>!(l instanceof HTMLButtonElement)&&a.#B.contains(l)&&!a.isEnterHandled}],[[" ","mac+ "],e.addNewEditorFromKeyboard,{checker:(a,{target:l})=>!(l instanceof HTMLButtonElement)&&a.#B.contains(document.activeElement)}],[["Escape","mac+Escape"],e.unselectAll],[["ArrowLeft","mac+ArrowLeft"],e.translateSelectedEditors,{args:[-s,0],checker:i}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],e.translateSelectedEditors,{args:[-r,0],checker:i}],[["ArrowRight","mac+ArrowRight"],e.translateSelectedEditors,{args:[s,0],checker:i}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],e.translateSelectedEditors,{args:[r,0],checker:i}],[["ArrowUp","mac+ArrowUp"],e.translateSelectedEditors,{args:[0,-s],checker:i}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],e.translateSelectedEditors,{args:[0,-r],checker:i}],[["ArrowDown","mac+ArrowDown"],e.translateSelectedEditors,{args:[0,s],checker:i}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],e.translateSelectedEditors,{args:[0,r],checker:i}]]))}constructor(e,i,n,s,r,a,l,h,c,d,u){const f=this._signal=this.#t.signal;this.#B=e,this.#V=i,this.#s=n,this._eventBus=s,s._on("editingaction",this.onEditingAction.bind(this),{signal:f}),s._on("pagechanging",this.onPageChanging.bind(this),{signal:f}),s._on("scalechanging",this.onScaleChanging.bind(this),{signal:f}),s._on("rotationchanging",this.onRotationChanging.bind(this),{signal:f}),s._on("setpreference",this.onSetPreference.bind(this),{signal:f}),s._on("switchannotationeditorparams",p=>this.updateParams(p.type,p.value),{signal:f}),this.#tt(),this.#st(),this.#X(),this.#r=r.annotationStorage,this.#m=r.filterFactory,this.#I=a,this.#E=l||null,this.#f=h,this.#g=c,this.#b=d,this.#k=u||null,this.viewParameters={realScale:ue.PDF_TO_CSS_UNITS,rotation:0},this.isShiftKeyDown=!1}destroy(){this.#D?.resolve(),this.#D=null,this.#t?.abort(),this.#t=null,this._signal=null;for(const e of this.#n.values())e.destroy();this.#n.clear(),this.#i.clear(),this.#p.clear(),this.#e=null,this.#v.clear(),this.#h.destroy(),this.#s?.destroy(),this.#w?.hide(),this.#w=null,this.#_&&(clearTimeout(this.#_),this.#_=null),this.#F&&(clearTimeout(this.#F),this.#F=null)}combinedSignal(e){return AbortSignal.any([this._signal,e.signal])}get mlManager(){return this.#k}get useNewAltTextFlow(){return this.#g}get useNewAltTextWhenAddingImage(){return this.#b}get hcmFilter(){return U(this,"hcmFilter",this.#I?this.#m.addHCMFilter(this.#I.foreground,this.#I.background):"none")}get direction(){return U(this,"direction",getComputedStyle(this.#B).direction)}get highlightColors(){return U(this,"highlightColors",this.#E?new Map(this.#E.split(",").map(e=>e.split("=").map(i=>i.trim()))):null)}get highlightColorNames(){return U(this,"highlightColorNames",this.highlightColors?new Map(Array.from(this.highlightColors,e=>e.reverse())):null)}setMainHighlightColorPicker(e){this.#R=e}editAltText(e,i=!1){this.#s?.editAltText(this,e,i)}switchToMode(e,i){this._eventBus.on("annotationeditormodechanged",i,{once:!0,signal:this._signal}),this._eventBus.dispatch("showannotationeditorui",{source:this,mode:e})}setPreference(e,i){this._eventBus.dispatch("setpreference",{source:this,name:e,value:i})}onSetPreference({name:e,value:i}){"enableNewAltTextWhenAddingImage"===e&&(this.#b=i)}onPageChanging({pageNumber:e}){this.#o=e-1}focusMainContainer(){this.#B.focus()}findParent(e,i){for(const n of this.#n.values()){const{x:s,y:r,width:a,height:l}=n.div.getBoundingClientRect();if(e>=s&&e<=s+a&&i>=r&&i<=r+l)return n}return null}disableUserSelect(e=!1){this.#V.classList.toggle("noUserSelect",e)}addShouldRescale(e){this.#p.add(e)}removeShouldRescale(e){this.#p.delete(e)}onScaleChanging({scale:e}){this.commitOrRemove(),this.viewParameters.realScale=e*ue.PDF_TO_CSS_UNITS;for(const i of this.#p)i.onScaleChanging()}onRotationChanging({pagesRotation:e}){this.commitOrRemove(),this.viewParameters.rotation=e}#U({anchorNode:e}){return e.nodeType===Node.TEXT_NODE?e.parentElement:e}#$(e){const{currentLayer:i}=this;if(i.hasTextLayer(e))return i;for(const n of this.#n.values())if(n.hasTextLayer(e))return n;return null}highlightSelection(e=""){const i=document.getSelection();if(!i||i.isCollapsed)return;const{anchorNode:n,anchorOffset:s,focusNode:r,focusOffset:a}=i,l=i.toString(),c=this.#U(i).closest(".textLayer"),d=this.getSelectionBoxes(c);if(!d)return;i.empty();const u=this.#$(c),f=this.#C===B.NONE,p=()=>{u?.createAndAddNewEditor({x:0,y:0},!1,{methodOfCreation:e,boxes:d,anchorNode:n,anchorOffset:s,focusNode:r,focusOffset:a,text:l}),f&&this.showAllEditors("highlight",!0,!0)};f?this.switchToMode(B.HIGHLIGHT,p):p()}#Z(){const e=document.getSelection();if(!e||e.isCollapsed)return;const n=this.#U(e).closest(".textLayer"),s=this.getSelectionBoxes(n);s&&(this.#w||=new ba(this),this.#w.show(n,s,"ltr"===this.direction))}addToAnnotationStorage(e){!e.isEmpty()&&this.#r&&!this.#r.has(e.id)&&this.#r.setValue(e.id,e)}#J(){const e=document.getSelection();if(!e||e.isCollapsed)return void(this.#M&&(this.#w?.hide(),this.#M=null,this.#O({hasSelectedText:!1})));const{anchorNode:i}=e;if(i===this.#M)return;const s=this.#U(e).closest(".textLayer");if(s){if(this.#w?.hide(),this.#M=i,this.#O({hasSelectedText:!0}),(this.#C===B.HIGHLIGHT||this.#C===B.NONE)&&(this.#C===B.HIGHLIGHT&&this.showAllEditors("highlight",!0,!0),this.#y=this.isShiftKeyDown,!this.isShiftKeyDown)){const r=this.#C===B.HIGHLIGHT?this.#$(s):null;r?.toggleDrawing();const a=new AbortController,l=this.combinedSignal(a),h=c=>{"pointerup"===c.type&&0!==c.button||(a.abort(),r?.toggleDrawing(!0),"pointerup"===c.type&&this.#G("main_toolbar"))};window.addEventListener("pointerup",h,{signal:l}),window.addEventListener("blur",h,{signal:l})}}else this.#M&&(this.#w?.hide(),this.#M=null,this.#O({hasSelectedText:!1}))}#G(e=""){this.#C===B.HIGHLIGHT?this.highlightSelection(e):this.#f&&this.#Z()}#tt(){document.addEventListener("selectionchange",this.#J.bind(this),{signal:this._signal})}#et(){if(this.#A)return;this.#A=new AbortController;const e=this.combinedSignal(this.#A);window.addEventListener("focus",this.focus.bind(this),{signal:e}),window.addEventListener("blur",this.blur.bind(this),{signal:e})}#it(){this.#A?.abort(),this.#A=null}blur(){if(this.isShiftKeyDown=!1,this.#y&&(this.#y=!1,this.#G("main_toolbar")),!this.hasSelection)return;const{activeElement:e}=document;for(const i of this.#v)if(i.div.contains(e)){this.#S=[i,e],i._focusEventsAllowed=!1;break}}focus(){if(!this.#S)return;const[e,i]=this.#S;this.#S=null,i.addEventListener("focusin",()=>{e._focusEventsAllowed=!0},{once:!0,signal:this._signal}),i.focus()}#X(){if(this.#T)return;this.#T=new AbortController;const e=this.combinedSignal(this.#T);window.addEventListener("keydown",this.keydown.bind(this),{signal:e}),window.addEventListener("keyup",this.keyup.bind(this),{signal:e})}#nt(){this.#T?.abort(),this.#T=null}#Y(){if(this.#c)return;this.#c=new AbortController;const e=this.combinedSignal(this.#c);document.addEventListener("copy",this.copy.bind(this),{signal:e}),document.addEventListener("cut",this.cut.bind(this),{signal:e}),document.addEventListener("paste",this.paste.bind(this),{signal:e})}#K(){this.#c?.abort(),this.#c=null}#st(){const e=this._signal;document.addEventListener("dragover",this.dragOver.bind(this),{signal:e}),document.addEventListener("drop",this.drop.bind(this),{signal:e})}addEditListeners(){this.#X(),this.#Y()}removeEditListeners(){this.#nt(),this.#K()}dragOver(e){for(const{type:i}of e.dataTransfer.items)for(const n of this.#u)if(n.isHandlingMimeForPasting(i))return e.dataTransfer.dropEffect="copy",void e.preventDefault()}drop(e){for(const i of e.dataTransfer.items)for(const n of this.#u)if(n.isHandlingMimeForPasting(i.type))return n.paste(i,this.currentLayer),void e.preventDefault()}copy(e){if(e.preventDefault(),this.#e?.commitOrRemove(),!this.hasSelection)return;const i=[];for(const n of this.#v){const s=n.serialize(!0);s&&i.push(s)}0!==i.length&&e.clipboardData.setData("application/pdfjs",JSON.stringify(i))}cut(e){this.copy(e),this.delete()}paste(e){var i=this;return(0,x.A)(function*(){e.preventDefault();const{clipboardData:n}=e;for(const a of n.items)for(const l of i.#u)if(l.isHandlingMimeForPasting(a.type))return void l.paste(a,i.currentLayer);let s=n.getData("application/pdfjs");if(!s)return;try{s=JSON.parse(s)}catch(a){return void V(`paste: "${a.message}".`)}if(!Array.isArray(s))return;i.unselectAll();const r=i.currentLayer;try{const a=[];for(const c of s){const d=yield r.deserialize(c);if(!d)return;a.push(d)}const l=()=>{for(const c of a)i.#q(c);i.#Q(a)};i.addCommands({cmd:l,undo:()=>{for(const c of a)c.remove()},mustExec:!0})}catch(a){V(`paste: "${a.message}".`)}})()}keydown(e){!this.isShiftKeyDown&&"Shift"===e.key&&(this.isShiftKeyDown=!0),this.#C!==B.NONE&&!this.isEditorHandlingKeyboard&&o._keyboardManager.exec(this,e)}keyup(e){this.isShiftKeyDown&&"Shift"===e.key&&(this.isShiftKeyDown=!1,this.#y&&(this.#y=!1,this.#G("main_toolbar")))}onEditingAction({name:e}){switch(e){case"undo":case"redo":case"delete":case"selectAll":this[e]();break;case"highlightSelection":this.highlightSelection("context_menu")}}#O(e){Object.entries(e).some(([n,s])=>this.#H[n]!==s)&&(this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(this.#H,e)}),this.#C===B.HIGHLIGHT&&!1===e.hasSelectedEditor&&this.#z([[D.HIGHLIGHT_FREE,!0]]))}#z(e){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:e})}setEditingState(e){e?(this.#et(),this.#Y(),this.#O({isEditing:this.#C!==B.NONE,isEmpty:this.#W(),hasSomethingToUndo:this.#h.hasSomethingToUndo(),hasSomethingToRedo:this.#h.hasSomethingToRedo(),hasSelectedEditor:!1})):(this.#it(),this.#K(),this.#O({isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(e){if(!this.#u){this.#u=e;for(const i of this.#u)this.#z(i.defaultPropertiesToUpdate)}}getId(){return this.#L.id}get currentLayer(){return this.#n.get(this.#o)}getLayer(e){return this.#n.get(e)}get currentPageIndex(){return this.#o}addLayer(e){this.#n.set(e.pageIndex,e),this.#P?e.enable():e.disable()}removeLayer(e){this.#n.delete(e.pageIndex)}updateMode(e){var i=this;return(0,x.A)(function*(n,s=null,r=!1){if(i.#C!==n&&(!i.#D||(yield i.#D.promise,i.#D))){if(i.#D=Promise.withResolvers(),i.#C=n,n===B.NONE)return i.setEditingState(!1),i.#at(),void i.#D.resolve();i.setEditingState(!0),yield i.#rt(),i.unselectAll();for(const a of i.#n.values())a.updateMode(n);if(!s)return r&&i.addNewEditorFromKeyboard(),void i.#D.resolve();for(const a of i.#i.values())a.annotationElementId===s?(i.setSelected(a),a.enterInEditMode()):a.unselect();i.#D.resolve()}}).apply(this,arguments)}addNewEditorFromKeyboard(){this.currentLayer.canCreateNewEmptyEditor()&&this.currentLayer.addNewEditor()}updateToolbar(e){e!==this.#C&&this._eventBus.dispatch("switchannotationeditormode",{source:this,mode:e})}updateParams(e,i){if(this.#u){switch(e){case D.CREATE:return void this.currentLayer.addNewEditor();case D.HIGHLIGHT_DEFAULT_COLOR:this.#R?.updateColor(i);break;case D.HIGHLIGHT_SHOW_ALL:this._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:{type:"highlight",action:"toggle_visibility"}}}),(this.#N||=new Map).set(e,i),this.showAllEditors("highlight",i)}for(const n of this.#v)n.updateParams(e,i);for(const n of this.#u)n.updateDefaultParams(e,i)}}showAllEditors(e,i,n=!1){for(const r of this.#i.values())r.editorType===e&&r.show(i);(this.#N?.get(D.HIGHLIGHT_SHOW_ALL)??!0)!==i&&this.#z([[D.HIGHLIGHT_SHOW_ALL,i]])}enableWaiting(e=!1){if(this.#x!==e){this.#x=e;for(const i of this.#n.values())e?i.disableClick():i.enableClick(),i.div.classList.toggle("waiting",e)}}#rt(){var e=this;return(0,x.A)(function*(){if(!e.#P){e.#P=!0;const i=[];for(const n of e.#n.values())i.push(n.enable());yield Promise.all(i);for(const n of e.#i.values())n.enable()}})()}#at(){if(this.unselectAll(),this.#P){this.#P=!1;for(const e of this.#n.values())e.disable();for(const e of this.#i.values())e.disable()}}getEditors(e){const i=[];for(const n of this.#i.values())n.pageIndex===e&&i.push(n);return i}getEditor(e){return this.#i.get(e)}addEditor(e){this.#i.set(e.id,e)}removeEditor(e){e.div.contains(document.activeElement)&&(this.#_&&clearTimeout(this.#_),this.#_=setTimeout(()=>{this.focusMainContainer(),this.#_=null},0)),this.#i.delete(e.id),this.unselect(e),(!e.annotationElementId||!this.#d.has(e.annotationElementId))&&this.#r?.remove(e.id)}addDeletedAnnotationElement(e){this.#d.add(e.annotationElementId),this.addChangedExistingAnnotation(e),e.deleted=!0}isDeletedAnnotationElement(e){return this.#d.has(e)}removeDeletedAnnotationElement(e){this.#d.delete(e.annotationElementId),this.removeChangedExistingAnnotation(e),e.deleted=!1}#q(e){const i=this.#n.get(e.pageIndex);i?i.addOrRebuild(e):(this.addEditor(e),this.addToAnnotationStorage(e))}setActiveEditor(e){this.#e!==e&&(this.#e=e,e&&this.#z(e.propertiesToUpdate))}get#ot(){let e=null;for(e of this.#v);return e}updateUI(e){this.#ot===e&&this.#z(e.propertiesToUpdate)}toggleSelected(e){if(this.#v.has(e))return this.#v.delete(e),e.unselect(),void this.#O({hasSelectedEditor:this.hasSelection});this.#v.add(e),e.select(),this.#z(e.propertiesToUpdate),this.#O({hasSelectedEditor:!0})}setSelected(e){for(const i of this.#v)i!==e&&i.unselect();this.#v.clear(),this.#v.add(e),e.select(),this.#z(e.propertiesToUpdate),this.#O({hasSelectedEditor:!0})}isSelected(e){return this.#v.has(e)}get firstSelectedEditor(){return this.#v.values().next().value}unselect(e){e.unselect(),this.#v.delete(e),this.#O({hasSelectedEditor:this.hasSelection})}get hasSelection(){return 0!==this.#v.size}get isEnterHandled(){return 1===this.#v.size&&this.firstSelectedEditor.isEnterHandled}undo(){this.#h.undo(),this.#O({hasSomethingToUndo:this.#h.hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:this.#W()})}redo(){this.#h.redo(),this.#O({hasSomethingToUndo:!0,hasSomethingToRedo:this.#h.hasSomethingToRedo(),isEmpty:this.#W()})}addCommands(e){this.#h.add(e),this.#O({hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:this.#W()})}#W(){if(0===this.#i.size)return!0;if(1===this.#i.size)for(const e of this.#i.values())return e.isEmpty();return!1}delete(){if(this.commitOrRemove(),!this.hasSelection)return;const e=[...this.#v];this.addCommands({cmd:()=>{for(const s of e)s.remove()},undo:()=>{for(const s of e)this.#q(s)},mustExec:!0})}commitOrRemove(){this.#e?.commitOrRemove()}hasSomethingToControl(){return this.#e||this.hasSelection}#Q(e){for(const i of this.#v)i.unselect();this.#v.clear();for(const i of e)i.isEmpty()||(this.#v.add(i),i.select());this.#O({hasSelectedEditor:this.hasSelection})}selectAll(){for(const e of this.#v)e.commit();this.#Q(this.#i.values())}unselectAll(){if((!this.#e||(this.#e.commitOrRemove(),this.#C===B.NONE))&&this.hasSelection){for(const e of this.#v)e.unselect();this.#v.clear(),this.#O({hasSelectedEditor:!1})}}translateSelectedEditors(e,i,n=!1){if(n||this.commitOrRemove(),!this.hasSelection)return;this.#j[0]+=e,this.#j[1]+=i;const[s,r]=this.#j,a=[...this.#v];this.#F&&clearTimeout(this.#F),this.#F=setTimeout(()=>{this.#F=null,this.#j[0]=this.#j[1]=0,this.addCommands({cmd:()=>{for(const h of a)this.#i.has(h.id)&&h.translateInPage(s,r)},undo:()=>{for(const h of a)this.#i.has(h.id)&&h.translateInPage(-s,-r)},mustExec:!1})},1e3);for(const h of a)h.translateInPage(e,i)}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),this.#a=new Map;for(const e of this.#v)this.#a.set(e,{savedX:e.x,savedY:e.y,savedPageIndex:e.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!this.#a)return!1;this.disableUserSelect(!1);const e=this.#a;this.#a=null;let i=!1;for(const[{x:s,y:r,pageIndex:a},l]of e)l.newX=s,l.newY=r,l.newPageIndex=a,i||=s!==l.savedX||r!==l.savedY||a!==l.savedPageIndex;if(!i)return!1;const n=(s,r,a,l)=>{if(this.#i.has(s.id)){const h=this.#n.get(l);h?s._setParentAndPosition(h,r,a):(s.pageIndex=l,s.x=r,s.y=a)}};return this.addCommands({cmd:()=>{for(const[s,{newX:r,newY:a,newPageIndex:l}]of e)n(s,r,a,l)},undo:()=>{for(const[s,{savedX:r,savedY:a,savedPageIndex:l}]of e)n(s,r,a,l)},mustExec:!0}),!0}dragSelectedEditors(e,i){if(this.#a)for(const n of this.#a.keys())n.drag(e,i)}rebuild(e){if(null===e.parent){const i=this.getLayer(e.pageIndex);i?(i.changeParent(e),i.addOrRebuild(e)):(this.addEditor(e),this.addToAnnotationStorage(e),e.rebuild())}else e.parent.addOrRebuild(e)}get isEditorHandlingKeyboard(){return this.getActive()?.shouldGetKeyboardEvents()||1===this.#v.size&&this.firstSelectedEditor.shouldGetKeyboardEvents()}isActive(e){return this.#e===e}getActive(){return this.#e}getMode(){return this.#C}get imageManager(){return U(this,"imageManager",new Fi)}getSelectionBoxes(e){if(!e)return null;const i=document.getSelection();for(let c=0,d=i.rangeCount;c<d;c++)if(!e.contains(i.getRangeAt(c).commonAncestorContainer))return null;const{x:n,y:s,width:r,height:a}=e.getBoundingClientRect();let l;switch(e.getAttribute("data-main-rotation")){case"90":l=(c,d,u,f)=>({x:(d-s)/a,y:1-(c+u-n)/r,width:f/a,height:u/r});break;case"180":l=(c,d,u,f)=>({x:1-(c+u-n)/r,y:1-(d+f-s)/a,width:u/r,height:f/a});break;case"270":l=(c,d,u,f)=>({x:1-(d+f-s)/a,y:(c-n)/r,width:f/a,height:u/r});break;default:l=(c,d,u,f)=>({x:(c-n)/r,y:(d-s)/a,width:u/r,height:f/a})}const h=[];for(let c=0,d=i.rangeCount;c<d;c++){const u=i.getRangeAt(c);if(!u.collapsed)for(const{x:f,y:p,width:g,height:b}of u.getClientRects())0===g||0===b||h.push(l(f,p,g,b))}return 0===h.length?null:h}addChangedExistingAnnotation({annotationElementId:e,id:i}){(this.#l||=new Map).set(e,i)}removeChangedExistingAnnotation({annotationElementId:e}){this.#l?.delete(e)}renderAnnotationElement(e){const i=this.#l?.get(e.data.id);if(!i)return;const n=this.#r.getRawValue(i);n&&(this.#C===B.NONE&&!n.hasBeenModified||n.renderAnnotationElement(e))}}return o})(),On=(()=>{class o{#t=null;#e=!1;#i=null;#n=null;#s=null;#r=null;#l=!1;#h=null;#c=null;#o=null;#d=null;#a=!1;static#u=null;static _l10n=null;constructor(e){this.#c=e,this.#a=e._uiManager.useNewAltTextFlow,o.#u||=Object.freeze({added:"pdfjs-editor-new-alt-text-added-button","added-label":"pdfjs-editor-new-alt-text-added-button-label",missing:"pdfjs-editor-new-alt-text-missing-button","missing-label":"pdfjs-editor-new-alt-text-missing-button-label",review:"pdfjs-editor-new-alt-text-to-review-button","review-label":"pdfjs-editor-new-alt-text-to-review-button-label"})}static initialize(e){o._l10n??=e}render(){var e=this;return(0,x.A)(function*(){const i=e.#i=document.createElement("button");i.className="altText",i.tabIndex="0";const n=e.#n=document.createElement("span");i.append(n),e.#a?(i.classList.add("new"),i.setAttribute("data-l10n-id",o.#u.missing),n.setAttribute("data-l10n-id",o.#u["missing-label"])):(i.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button"),n.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button-label"));const s=e.#c._uiManager._signal;i.addEventListener("contextmenu",Pt,{signal:s}),i.addEventListener("pointerdown",a=>a.stopPropagation(),{signal:s});const r=a=>{a.preventDefault(),e.#c._uiManager.editAltText(e.#c),e.#a&&e.#c._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_clicked",data:{label:e.#p}})};return i.addEventListener("click",r,{capture:!0,signal:s}),i.addEventListener("keydown",a=>{a.target===i&&"Enter"===a.key&&(e.#l=!0,r(a))},{signal:s}),yield e.#f(),i})()}get#p(){return(this.#t?"added":null===this.#t&&this.guessedText&&"review")||"missing"}finish(){this.#i&&(this.#i.focus({focusVisible:this.#l}),this.#l=!1)}isEmpty(){return this.#a?null===this.#t:!this.#t&&!this.#e}hasData(){return this.#a?null!==this.#t||!!this.#o:this.isEmpty()}get guessedText(){return this.#o}setGuessedText(e){var i=this;return(0,x.A)(function*(){null===i.#t&&(i.#o=e,i.#d=yield o._l10n.get("pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer",{generatedAltText:e}),i.#f())})()}toggleAltTextBadge(e=!1){if(!this.#a||this.#t)return this.#h?.remove(),void(this.#h=null);if(!this.#h){const i=this.#h=document.createElement("div");i.className="noAltTextBadge",this.#c.div.append(i)}this.#h.classList.toggle("hidden",!e)}serialize(e){let i=this.#t;return!e&&this.#o===i&&(i=this.#d),{altText:i,decorative:this.#e,guessedText:this.#o,textWithDisclaimer:this.#d}}get data(){return{altText:this.#t,decorative:this.#e}}set data({altText:e,decorative:i,guessedText:n,textWithDisclaimer:s,cancel:r=!1}){n&&(this.#o=n,this.#d=s),(this.#t!==e||this.#e!==i)&&(r||(this.#t=e,this.#e=i),this.#f())}toggle(e=!1){this.#i&&(!e&&this.#r&&(clearTimeout(this.#r),this.#r=null),this.#i.disabled=!e)}shown(){this.#c._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_displayed",data:{label:this.#p}})}destroy(){this.#i?.remove(),this.#i=null,this.#n=null,this.#s=null,this.#h?.remove(),this.#h=null}#f(){var e=this;return(0,x.A)(function*(){const i=e.#i;if(!i)return;if(e.#a){if(i.classList.toggle("done",!!e.#t),i.setAttribute("data-l10n-id",o.#u[e.#p]),e.#n?.setAttribute("data-l10n-id",o.#u[`${e.#p}-label`]),!e.#t)return void e.#s?.remove()}else{if(!e.#t&&!e.#e)return i.classList.remove("done"),void e.#s?.remove();i.classList.add("done"),i.setAttribute("data-l10n-id","pdfjs-editor-alt-text-edit-button")}let n=e.#s;if(!n){e.#s=n=document.createElement("span"),n.className="tooltip",n.setAttribute("role","tooltip"),n.id=`alt-text-tooltip-${e.#c.id}`;const r=100,a=e.#c._uiManager._signal;a.addEventListener("abort",()=>{clearTimeout(e.#r),e.#r=null},{once:!0}),i.addEventListener("mouseenter",()=>{e.#r=setTimeout(()=>{e.#r=null,e.#s.classList.add("show"),e.#c._reportTelemetry({action:"alt_text_tooltip"})},r)},{signal:a}),i.addEventListener("mouseleave",()=>{e.#r&&(clearTimeout(e.#r),e.#r=null),e.#s?.classList.remove("show")},{signal:a})}e.#e?n.setAttribute("data-l10n-id","pdfjs-editor-alt-text-decorative-tooltip"):(n.removeAttribute("data-l10n-id"),n.textContent=e.#t),n.parentNode||i.append(n),e.#c.getImageForAltText()?.setAttribute("aria-describedby",n.id)})()}}return o})();class O{#t=null;#e=null;#i=null;#n=!1;#s=!1;#r=null;#l=null;#h=null;#c="";#o=!1;#d=null;#a=!1;#u=!1;#p=!1;#f=null;#g=0;#b=0;#m=null;_editToolbar=null;_initialOptions=Object.create(null);_initialData=null;_isVisible=!0;_uiManager=null;_focusEventsAllowed=!0;static _l10n=null;static _l10nResizer=null;#_=!1;#A=O._zIndex++;static _borderLineWidth=-1;static _colorManager=new Ni;static _zIndex=1;static _telemetryTimeout=1e3;static get _resizerKeyboardManager(){const t=O.prototype._resizeWithKeyboard,e=Te.TRANSLATE_SMALL,i=Te.TRANSLATE_BIG;return U(this,"_resizerKeyboardManager",new Pe([[["ArrowLeft","mac+ArrowLeft"],t,{args:[-e,0]}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t,{args:[-i,0]}],[["ArrowRight","mac+ArrowRight"],t,{args:[e,0]}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t,{args:[i,0]}],[["ArrowUp","mac+ArrowUp"],t,{args:[0,-e]}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t,{args:[0,-i]}],[["ArrowDown","mac+ArrowDown"],t,{args:[0,e]}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t,{args:[0,i]}],[["Escape","mac+Escape"],O.prototype._stopResizingWithKeyboard]]))}constructor(t){this.parent=t.parent,this.id=t.id,this.width=this.height=null,this.pageIndex=t.parent.pageIndex,this.name=t.name,this.div=null,this._uiManager=t.uiManager,this.annotationElementId=null,this._willKeepAspectRatio=!1,this._initialOptions.isCentered=t.isCentered,this._structTreeParentId=null;const{rotation:e,rawDims:{pageWidth:i,pageHeight:n,pageX:s,pageY:r}}=this.parent.viewport;this.rotation=e,this.pageRotation=(360+e-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[i,n],this.pageTranslation=[s,r];const[a,l]=this.parentDimensions;this.x=t.x/a,this.y=t.y/l,this.isAttachedToDOM=!1,this.deleted=!1}get editorType(){return Object.getPrototypeOf(this).constructor._type}static get _defaultLineColor(){return U(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(t){const e=new ya({id:t.parent.getNextId(),parent:t.parent,uiManager:t._uiManager});e.annotationElementId=t.annotationElementId,e.deleted=!0,e._uiManager.addToAnnotationStorage(e)}static initialize(t,e){if(O._l10n??=t,O._l10nResizer||=Object.freeze({topLeft:"pdfjs-editor-resizer-top-left",topMiddle:"pdfjs-editor-resizer-top-middle",topRight:"pdfjs-editor-resizer-top-right",middleRight:"pdfjs-editor-resizer-middle-right",bottomRight:"pdfjs-editor-resizer-bottom-right",bottomMiddle:"pdfjs-editor-resizer-bottom-middle",bottomLeft:"pdfjs-editor-resizer-bottom-left",middleLeft:"pdfjs-editor-resizer-middle-left"}),-1!==O._borderLineWidth)return;const i=getComputedStyle(document.documentElement);O._borderLineWidth=parseFloat(i.getPropertyValue("--outline-width"))||0}static updateDefaultParams(t,e){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(t){return!1}static paste(t,e){X("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return this.#_}set _isDraggable(t){this.#_=t,this.div?.classList.toggle("draggable",t)}get isEnterHandled(){return!0}center(){const[t,e]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*e/(2*t),this.y+=this.width*t/(2*e);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*e/(2*t),this.y-=this.width*t/(2*e);break;default:this.x-=this.width/2,this.y-=this.height/2}this.fixAndSetPosition()}addCommands(t){this._uiManager.addCommands(t)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=this.#A}setParent(t){null!==t?(this.pageIndex=t.pageIndex,this.pageDimensions=t.pageDimensions):this.#N(),this.parent=t}focusin(t){this._focusEventsAllowed&&(this.#o?this.#o=!1:this.parent.setSelected(this))}focusout(t){!this._focusEventsAllowed||!this.isAttachedToDOM||t.relatedTarget?.closest(`#${this.id}`)||(t.preventDefault(),this.parent?.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(t,e,i,n){const[s,r]=this.parentDimensions;[i,n]=this.screenToPageTranslation(i,n),this.x=(t+i)/s,this.y=(e+n)/r,this.fixAndSetPosition()}#E([t,e],i,n){[i,n]=this.screenToPageTranslation(i,n),this.x+=i/t,this.y+=n/e,this.fixAndSetPosition()}translate(t,e){this.#E(this.parentDimensions,t,e)}translateInPage(t,e){this.#d||=[this.x,this.y],this.#E(this.pageDimensions,t,e),this.div.scrollIntoView({block:"nearest"})}drag(t,e){this.#d||=[this.x,this.y];const[i,n]=this.parentDimensions;if(this.x+=t/i,this.y+=e/n,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){const{x:h,y:c}=this.div.getBoundingClientRect();this.parent.findNewParent(this,h,c)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:s,y:r}=this;const[a,l]=this.getBaseTranslation();s+=a,r+=l,this.div.style.left=`${(100*s).toFixed(2)}%`,this.div.style.top=`${(100*r).toFixed(2)}%`,this.div.scrollIntoView({block:"nearest"})}get _hasBeenMoved(){return!!this.#d&&(this.#d[0]!==this.x||this.#d[1]!==this.y)}getBaseTranslation(){const[t,e]=this.parentDimensions,{_borderLineWidth:i}=O,n=i/t,s=i/e;switch(this.rotation){case 90:return[-n,s];case 180:return[n,s];case 270:return[n,-s];default:return[-n,-s]}}get _mustFixPosition(){return!0}fixAndSetPosition(t=this.rotation){const[e,i]=this.pageDimensions;let{x:n,y:s,width:r,height:a}=this;if(r*=e,a*=i,n*=e,s*=i,this._mustFixPosition)switch(t){case 0:n=Math.max(0,Math.min(e-r,n)),s=Math.max(0,Math.min(i-a,s));break;case 90:n=Math.max(0,Math.min(e-a,n)),s=Math.min(i,Math.max(r,s));break;case 180:n=Math.min(e,Math.max(r,n)),s=Math.min(i,Math.max(a,s));break;case 270:n=Math.min(e,Math.max(a,n)),s=Math.max(0,Math.min(i-r,s))}this.x=n/=e,this.y=s/=i;const[l,h]=this.getBaseTranslation();n+=l,s+=h;const{style:c}=this.div;c.left=`${(100*n).toFixed(2)}%`,c.top=`${(100*s).toFixed(2)}%`,this.moveInDOM()}static#y(t,e,i){switch(i){case 90:return[e,-t];case 180:return[-t,-e];case 270:return[-e,t];default:return[t,e]}}screenToPageTranslation(t,e){return O.#y(t,e,this.parentRotation)}pageTranslationToScreen(t,e){return O.#y(t,e,360-this.parentRotation)}#w(t){switch(t){case 90:{const[e,i]=this.pageDimensions;return[0,-e/i,i/e,0]}case 180:return[-1,0,0,-1];case 270:{const[e,i]=this.pageDimensions;return[0,e/i,-i/e,0]}default:return[1,0,0,1]}}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){const{parentScale:t,pageDimensions:[e,i]}=this;return[e*t,i*t]}setDims(t,e){const[i,n]=this.parentDimensions;this.div.style.width=`${(100*t/i).toFixed(2)}%`,this.#s||(this.div.style.height=`${(100*e/n).toFixed(2)}%`)}fixDims(){const{style:t}=this.div,{height:e,width:i}=t,n=i.endsWith("%"),s=!this.#s&&e.endsWith("%");if(n&&s)return;const[r,a]=this.parentDimensions;n||(t.width=`${(100*parseFloat(i)/r).toFixed(2)}%`),!this.#s&&!s&&(t.height=`${(100*parseFloat(e)/a).toFixed(2)}%`)}getInitialTranslation(){return[0,0]}#L(){if(this.#r)return;this.#r=document.createElement("div"),this.#r.classList.add("resizers");const t=this._willKeepAspectRatio?["topLeft","topRight","bottomRight","bottomLeft"]:["topLeft","topMiddle","topRight","middleRight","bottomRight","bottomMiddle","bottomLeft","middleLeft"],e=this._uiManager._signal;for(const i of t){const n=document.createElement("div");this.#r.append(n),n.classList.add("resizer",i),n.setAttribute("data-resizer-name",i),n.addEventListener("pointerdown",this.#P.bind(this,i),{signal:e}),n.addEventListener("contextmenu",Pt,{signal:e}),n.tabIndex=-1}this.div.prepend(this.#r)}#P(t,e){e.preventDefault();const{isMac:i}=bt.platform;if(0!==e.button||e.ctrlKey&&i)return;this.#i?.toggle(!1);const n=this._isDraggable;this._isDraggable=!1;const s=new AbortController,r=this._uiManager.combinedSignal(s);this.parent.togglePointerEvents(!1),window.addEventListener("pointermove",this.#T.bind(this,t),{passive:!0,capture:!0,signal:r}),window.addEventListener("contextmenu",Pt,{signal:r});const a=this.x,l=this.y,h=this.width,c=this.height,d=this.parent.div.style.cursor,u=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(e.target).cursor;const f=()=>{s.abort(),this.parent.togglePointerEvents(!0),this.#i?.toggle(!0),this._isDraggable=n,this.parent.div.style.cursor=d,this.div.style.cursor=u,this.#x(a,l,h,c)};window.addEventListener("pointerup",f,{signal:r}),window.addEventListener("blur",f,{signal:r})}#x(t,e,i,n){const s=this.x,r=this.y,a=this.width,l=this.height;s===t&&r===e&&a===i&&l===n||this.addCommands({cmd:()=>{this.width=a,this.height=l,this.x=s,this.y=r;const[h,c]=this.parentDimensions;this.setDims(h*a,c*l),this.fixAndSetPosition()},undo:()=>{this.width=i,this.height=n,this.x=t,this.y=e;const[h,c]=this.parentDimensions;this.setDims(h*i,c*n),this.fixAndSetPosition()},mustExec:!0})}#T(t,e){const[i,n]=this.parentDimensions,s=this.x,r=this.y,a=this.width,l=this.height,h=O.MIN_SIZE/i,c=O.MIN_SIZE/n,d=k=>Math.round(1e4*k)/1e4,u=this.#w(this.rotation),f=(k,j)=>[u[0]*k+u[2]*j,u[1]*k+u[3]*j],p=this.#w(360-this.rotation);let b,m,v=!1,A=!1;switch(t){case"topLeft":v=!0,b=(k,j)=>[0,0],m=(k,j)=>[k,j];break;case"topMiddle":b=(k,j)=>[k/2,0],m=(k,j)=>[k/2,j];break;case"topRight":v=!0,b=(k,j)=>[k,0],m=(k,j)=>[0,j];break;case"middleRight":A=!0,b=(k,j)=>[k,j/2],m=(k,j)=>[0,j/2];break;case"bottomRight":v=!0,b=(k,j)=>[k,j],m=(k,j)=>[0,0];break;case"bottomMiddle":b=(k,j)=>[k/2,j],m=(k,j)=>[k/2,0];break;case"bottomLeft":v=!0,b=(k,j)=>[0,j],m=(k,j)=>[k,0];break;case"middleLeft":A=!0,b=(k,j)=>[0,j/2],m=(k,j)=>[k,j/2]}const w=b(a,l),E=m(a,l);let C=f(...E);const M=d(s+C[0]),T=d(r+C[1]);let y=1,S=1,[L,z]=this.screenToPageTranslation(e.movementX,e.movementY);if([L,z]=[p[0]*(k=L/i)+p[2]*(j=z/n),p[1]*k+p[3]*j],v){const k=Math.hypot(a,l);y=S=Math.max(Math.min(Math.hypot(E[0]-w[0]-L,E[1]-w[1]-z)/k,1/a,1/l),h/a,c/l)}else A?y=Math.max(h,Math.min(1,Math.abs(E[0]-w[0]-L)))/a:S=Math.max(c,Math.min(1,Math.abs(E[1]-w[1]-z)))/l;var k,j;const H=d(a*y),W=d(l*S);C=f(...m(H,W));const $=M-C[0],et=T-C[1];this.width=H,this.height=W,this.x=$,this.y=et,this.setDims(i*H,n*W),this.fixAndSetPosition()}altTextFinish(){this.#i?.finish()}addEditToolbar(){var t=this;return(0,x.A)(function*(){return t._editToolbar||t.#u||(t._editToolbar=new Se(t),t.div.append(t._editToolbar.render()),t.#i&&(yield t._editToolbar.addAltText(t.#i))),t._editToolbar})()}removeEditToolbar(){this._editToolbar&&(this._editToolbar.remove(),this._editToolbar=null,this.#i?.destroy())}addContainer(t){const e=this._editToolbar?.div;e?e.before(t):this.div.append(t)}getClientDimensions(){return this.div.getBoundingClientRect()}addAltTextButton(){var t=this;return(0,x.A)(function*(){t.#i||(On.initialize(O._l10n),t.#i=new On(t),t.#t&&(t.#i.data=t.#t,t.#t=null),yield t.addEditToolbar())})()}get altTextData(){return this.#i?.data}set altTextData(t){this.#i&&(this.#i.data=t)}get guessedAltText(){return this.#i?.guessedText}setGuessedAltText(t){var e=this;return(0,x.A)(function*(){yield e.#i?.setGuessedText(t)})()}serializeAltText(t){return this.#i?.serialize(t)}hasAltText(){return!!this.#i&&!this.#i.isEmpty()}hasAltTextData(){return this.#i?.hasData()??!1}render(){this.div=document.createElement("div"),this.div.setAttribute("data-editor-rotation",(360-this.rotation)%360),this.div.className=this.name,this.div.setAttribute("id",this.id),this.div.tabIndex=this.#n?-1:0,this._isVisible||this.div.classList.add("hidden"),this.setInForeground(),this.#k();const[t,e]=this.parentDimensions;this.parentRotation%180!=0&&(this.div.style.maxWidth=`${(100*e/t).toFixed(2)}%`,this.div.style.maxHeight=`${(100*t/e).toFixed(2)}%`);const[i,n]=this.getInitialTranslation();return this.translate(i,n),ti(this,this.div,["pointerdown"]),this.div}pointerdown(t){const{isMac:e}=bt.platform;0!==t.button||t.ctrlKey&&e?t.preventDefault():(this.#o=!0,this._isDraggable?this.#R(t):this.#S(t))}get isSelected(){return this._uiManager.isSelected(this)}#S(t){const{isMac:e}=bt.platform;t.ctrlKey&&!e||t.shiftKey||t.metaKey&&e?this.parent.toggleSelected(this):this.parent.setSelected(this)}#R(t){const{isSelected:e}=this;this._uiManager.setUpDragSession();const i=new AbortController,n=this._uiManager.combinedSignal(i);e&&(this.div.classList.add("moving"),this.#g=t.clientX,this.#b=t.clientY,window.addEventListener("pointermove",a=>{const{clientX:l,clientY:h}=a,[c,d]=this.screenToPageTranslation(l-this.#g,h-this.#b);this.#g=l,this.#b=h,this._uiManager.dragSelectedEditors(c,d)},{passive:!0,capture:!0,signal:n}));const s=()=>{i.abort(),e&&this.div.classList.remove("moving"),this.#o=!1,this._uiManager.endDragSession()||this.#S(t)};window.addEventListener("pointerup",s,{signal:n}),window.addEventListener("blur",s,{signal:n})}moveInDOM(){this.#f&&clearTimeout(this.#f),this.#f=setTimeout(()=>{this.#f=null,this.parent?.moveEditorInDOM(this)},0)}_setParentAndPosition(t,e,i){t.changeParent(this),this.x=e,this.y=i,this.fixAndSetPosition()}getRect(t,e,i=this.rotation){const n=this.parentScale,[s,r]=this.pageDimensions,[a,l]=this.pageTranslation,h=t/n,c=e/n,d=this.x*s,u=this.y*r,f=this.width*s,p=this.height*r;switch(i){case 0:return[d+h+a,r-u-c-p+l,d+h+f+a,r-u-c+l];case 90:return[d+c+a,r-u+h+l,d+c+p+a,r-u+h+f+l];case 180:return[d-h-f+a,r-u+c+l,d-h+a,r-u+c+p+l];case 270:return[d-c-p+a,r-u-h-f+l,d-c+a,r-u-h+l];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(t,e){const[i,n,s,r]=t,a=s-i,l=r-n;switch(this.rotation){case 0:return[i,e-r,a,l];case 90:return[i,e-n,l,a];case 180:return[s,e-n,a,l];case 270:return[s,e-r,l,a];default:throw new Error("Invalid rotation")}}onceAdded(){}isEmpty(){return!1}enableEditMode(){this.#u=!0}disableEditMode(){this.#u=!1}isInEditMode(){return this.#u}shouldGetKeyboardEvents(){return this.#p}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}#k(){if(this.#h||!this.div)return;this.#h=new AbortController;const t=this._uiManager.combinedSignal(this.#h);this.div.addEventListener("focusin",this.focusin.bind(this),{signal:t}),this.div.addEventListener("focusout",this.focusout.bind(this),{signal:t})}rebuild(){this.#k()}rotate(t){}serializeDeleted(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex,popupRef:this._initialData?.popupRef||""}}serialize(t=!1,e=null){X("An editor must be serializable")}static deserialize(t,e,i){var n=this;return(0,x.A)(function*(){const s=new n.prototype.constructor({parent:e,id:e.getNextId(),uiManager:i});s.rotation=t.rotation,s.#t=t.accessibilityData;const[r,a]=s.pageDimensions,[l,h,c,d]=s.getRectInCurrentCoords(t.rect,a);return s.x=l/r,s.y=h/a,s.width=c/r,s.height=d/a,s})()}get hasBeenModified(){return!!this.annotationElementId&&(this.deleted||null!==this.serialize())}remove(){if(this.#h?.abort(),this.#h=null,this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),this.#f&&(clearTimeout(this.#f),this.#f=null),this.#N(),this.removeEditToolbar(),this.#m){for(const t of this.#m.values())clearTimeout(t);this.#m=null}this.parent=null}get isResizable(){return!1}makeResizable(){this.isResizable&&(this.#L(),this.#r.classList.remove("hidden"),ti(this,this.div,["keydown"]))}get toolbarPosition(){return null}keydown(t){if(!this.isResizable||t.target!==this.div||"Enter"!==t.key)return;this._uiManager.setSelected(this),this.#l={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height};const e=this.#r.children;if(!this.#e){this.#e=Array.from(e);const r=this.#C.bind(this),a=this.#v.bind(this),l=this._uiManager._signal;for(const h of this.#e){const c=h.getAttribute("data-resizer-name");h.setAttribute("role","spinbutton"),h.addEventListener("keydown",r,{signal:l}),h.addEventListener("blur",a,{signal:l}),h.addEventListener("focus",this.#M.bind(this,c),{signal:l}),h.setAttribute("data-l10n-id",O._l10nResizer[c])}}const i=this.#e[0];let n=0;for(const r of e){if(r===i)break;n++}const s=(360-this.rotation+this.parentRotation)%360/90*(this.#e.length/4);if(s!==n){if(s<n)for(let a=0;a<n-s;a++)this.#r.append(this.#r.firstChild);else if(s>n)for(let a=0;a<s-n;a++)this.#r.firstChild.before(this.#r.lastChild);let r=0;for(const a of e){const h=this.#e[r++].getAttribute("data-resizer-name");a.setAttribute("data-l10n-id",O._l10nResizer[h])}}this.#I(0),this.#p=!0,this.#r.firstChild.focus({focusVisible:!0}),t.preventDefault(),t.stopImmediatePropagation()}#C(t){O._resizerKeyboardManager.exec(this,t)}#v(t){this.#p&&t.relatedTarget?.parentNode!==this.#r&&this.#N()}#M(t){this.#c=this.#p?t:""}#I(t){if(this.#e)for(const e of this.#e)e.tabIndex=t}_resizeWithKeyboard(t,e){this.#p&&this.#T(this.#c,{movementX:t,movementY:e})}#N(){if(this.#p=!1,this.#I(-1),this.#l){const{savedX:t,savedY:e,savedWidth:i,savedHeight:n}=this.#l;this.#x(t,e,i,n),this.#l=null}}_stopResizingWithKeyboard(){this.#N(),this.div.focus()}select(){this.makeResizable(),this.div?.classList.add("selectedEditor"),this._editToolbar?(this._editToolbar?.show(),this.#i?.toggleAltTextBadge(!1)):this.addEditToolbar().then(()=>{this.div?.classList.contains("selectedEditor")&&this._editToolbar?.show()})}unselect(){this.#r?.classList.add("hidden"),this.div?.classList.remove("selectedEditor"),this.div?.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus({preventScroll:!0}),this._editToolbar?.hide(),this.#i?.toggleAltTextBadge(!0)}updateParams(t,e){}disableEditing(){}enableEditing(){}enterInEditMode(){}getImageForAltText(){return null}get contentDiv(){return this.div}get isEditing(){return this.#a}set isEditing(t){this.#a=t,this.parent&&(t?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}setAspectRatio(t,e){this.#s=!0;const i=t/e,{style:n}=this.div;n.aspectRatio=i,n.height="auto"}static get MIN_SIZE(){return 16}static canCreateNewEmptyEditor(){return!0}get telemetryInitialData(){return{action:"added"}}get telemetryFinalData(){return null}_reportTelemetry(t,e=!1){if(e){this.#m||=new Map;const{action:i}=t;let n=this.#m.get(i);return n&&clearTimeout(n),n=setTimeout(()=>{this._reportTelemetry(t),this.#m.delete(i),0===this.#m.size&&(this.#m=null)},O._telemetryTimeout),void this.#m.set(i,n)}t.type||=this.editorType,this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:t}})}show(t=this._isVisible){this.div.classList.toggle("hidden",!t),this._isVisible=t}enable(){this.div&&(this.div.tabIndex=0),this.#n=!1}disable(){this.div&&(this.div.tabIndex=-1),this.#n=!0}renderAnnotationElement(t){let e=t.container.querySelector(".annotationContent");if(e){if("CANVAS"===e.nodeName){const i=e;e=document.createElement("div"),e.classList.add("annotationContent",this.editorType),i.before(e)}}else e=document.createElement("div"),e.classList.add("annotationContent",this.editorType),t.container.prepend(e);return e}resetAnnotationElement(t){const{firstChild:e}=t.container;"DIV"===e?.nodeName&&e.classList.contains("annotationContent")&&e.remove()}}class ya extends O{constructor(t){super(t),this.annotationElementId=t.annotationElementId,this.deleted=!0}serialize(){return this.serializeDeleted()}}const Fn=3285377520,Tt=4294901760,Ft=65535;class Nn{constructor(t){this.h1=t?4294967295&t:Fn,this.h2=t?4294967295&t:Fn}update(t){let e,i;if("string"==typeof t){e=new Uint8Array(2*t.length),i=0;for(let g=0,b=t.length;g<b;g++){const m=t.charCodeAt(g);m<=255?e[i++]=m:(e[i++]=m>>>8,e[i++]=255&m)}}else{if(!ArrayBuffer.isView(t))throw new Error("Invalid data format, must be a string or TypedArray.");e=t.slice(),i=e.byteLength}const n=i>>2,s=i-4*n,r=new Uint32Array(e.buffer,0,n);let a=0,l=0,h=this.h1,c=this.h2;const d=3432918353,u=461845907,f=d&Ft,p=u&Ft;for(let g=0;g<n;g++)1&g?(a=r[g],a=a*d&Tt|a*f&Ft,a=a<<15|a>>>17,a=a*u&Tt|a*p&Ft,h^=a,h=h<<13|h>>>19,h=5*h+3864292196):(l=r[g],l=l*d&Tt|l*f&Ft,l=l<<15|l>>>17,l=l*u&Tt|l*p&Ft,c^=l,c=c<<13|c>>>19,c=5*c+3864292196);switch(a=0,s){case 3:a^=e[4*n+2]<<16;case 2:a^=e[4*n+1]<<8;case 1:a^=e[4*n],a=a*d&Tt|a*f&Ft,a=a<<15|a>>>17,a=a*u&Tt|a*p&Ft,1&n?h^=a:c^=a}this.h1=h,this.h2=c}hexdigest(){let t=this.h1,e=this.h2;return t^=e>>>1,t=3981806797*t&Tt|36045*t&Ft,e=4283543511*e&Tt|(2950163797*(e<<16|t>>>16)&Tt)>>>16,t^=e>>>1,t=444984403*t&Tt|60499*t&Ft,e=3301882366*e&Tt|(3120437893*(e<<16|t>>>16)&Tt)>>>16,t^=e>>>1,(t>>>0).toString(16).padStart(8,"0")+(e>>>0).toString(16).padStart(8,"0")}}const Bi=Object.freeze({map:null,hash:"",transfer:void 0});class Vi{#t=!1;#e=null;#i=new Map;constructor(){this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(t,e){const i=this.#i.get(t);return void 0===i?e:Object.assign(e,i)}getRawValue(t){return this.#i.get(t)}remove(t){if(this.#i.delete(t),0===this.#i.size&&this.resetModified(),"function"==typeof this.onAnnotationEditor){for(const e of this.#i.values())if(e instanceof O)return;this.onAnnotationEditor(null)}}setValue(t,e){const i=this.#i.get(t);let n=!1;if(void 0!==i)for(const[s,r]of Object.entries(e))i[s]!==r&&(n=!0,i[s]=r);else n=!0,this.#i.set(t,e);n&&this.#n(),e instanceof O&&"function"==typeof this.onAnnotationEditor&&this.onAnnotationEditor(e.constructor._type)}has(t){return this.#i.has(t)}getAll(){return this.#i.size>0?Ti(this.#i):null}setAll(t){for(const[e,i]of Object.entries(t))this.setValue(e,i)}get size(){return this.#i.size}#n(){this.#t||(this.#t=!0,"function"==typeof this.onSetModified&&this.onSetModified())}resetModified(){this.#t&&(this.#t=!1,"function"==typeof this.onResetModified&&this.onResetModified())}get print(){return new Bn(this)}get serializable(){if(0===this.#i.size)return Bi;const t=new Map,e=new Nn,i=[],n=Object.create(null);let s=!1;for(const[r,a]of this.#i){const l=a instanceof O?a.serialize(!1,n):a;l&&(t.set(r,l),e.update(`${r}:${JSON.stringify(l)}`),s||=!!l.bitmap)}if(s)for(const r of t.values())r.bitmap&&i.push(r.bitmap);return t.size>0?{map:t,hash:e.hexdigest(),transfer:i}:Bi}get editorStats(){let t=null;const e=new Map;for(const i of this.#i.values()){if(!(i instanceof O))continue;const n=i.telemetryFinalData;if(!n)continue;const{type:s}=n;e.has(s)||e.set(s,Object.getPrototypeOf(i).constructor),t||=Object.create(null);const r=t[s]||=new Map;for(const[a,l]of Object.entries(n)){if("type"===a)continue;let h=r.get(a);h||(h=new Map,r.set(a,h));const c=h.get(l)??0;h.set(l,c+1)}}for(const[i,n]of e)t[i]=n.computeTelemetryFinalData(t[i]);return t}resetModifiedIds(){this.#e=null}get modifiedIds(){if(this.#e)return this.#e;const t=[];for(const e of this.#i.values())!(e instanceof O)||!e.annotationElementId||!e.serialize()||t.push(e.annotationElementId);return this.#e={ids:new Set(t),hash:t.join(",")}}}class Bn extends Vi{#t;constructor(t){super();const{map:e,hash:i,transfer:n}=t.serializable,s=structuredClone(e,n?{transfer:n}:null);this.#t={map:s,hash:i,transfer:n}}get print(){X("Should not call PrintAnnotationStorage.print")}get serializable(){return this.#t}get modifiedIds(){return U(this,"modifiedIds",{ids:new Set,hash:""})}}class wa{#t=new Set;constructor({ownerDocument:t=globalThis.document,styleElement:e=null}){this._document=t,this.nativeFontFaces=new Set,this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(t){this.nativeFontFaces.add(t),this._document.fonts.add(t)}removeNativeFontFace(t){this.nativeFontFaces.delete(t),this._document.fonts.delete(t)}insertRule(t){this.styleElement||(this.styleElement=this._document.createElement("style"),this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));const e=this.styleElement.sheet;e.insertRule(t,e.cssRules.length)}clear(){for(const t of this.nativeFontFaces)this._document.fonts.delete(t);this.nativeFontFaces.clear(),this.#t.clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}loadSystemFont(t){var e=this;return(0,x.A)(function*({systemFontInfo:i,_inspectFont:n}){if(i&&!e.#t.has(i.loadedName)){if(lt(!e.disableFontFace,"loadSystemFont shouldn't be called when `disableFontFace` is set."),e.isFontLoadingAPISupported){const{loadedName:s,src:r,style:a}=i,l=new FontFace(s,r,a);e.addNativeFontFace(l);try{yield l.load(),e.#t.add(s),n?.(i)}catch{V(`Cannot load system font: ${i.baseFontName}, installing it could help to improve PDF rendering.`),e.removeNativeFontFace(l)}return}X("Not implemented: loadSystemFont without the Font Loading API.")}}).apply(this,arguments)}bind(t){var e=this;return(0,x.A)(function*(){if(t.attached||t.missingFile&&!t.systemFontInfo)return;if(t.attached=!0,t.systemFontInfo)return void(yield e.loadSystemFont(t));if(e.isFontLoadingAPISupported){const n=t.createNativeFontFace();if(n){e.addNativeFontFace(n);try{yield n.loaded}catch(s){throw V(`Failed to load font '${n.family}': '${s}'.`),t.disableFontFace=!0,s}}return}const i=t.createFontFaceRule();if(i){if(e.insertRule(i),e.isSyncFontLoadingSupported)return;yield new Promise(n=>{const s=e._queueLoadingCallback(n);e._prepareFontLoadEvent(t,s)})}})()}get isFontLoadingAPISupported(){return U(this,"isFontLoadingAPISupported",!!this._document?.fonts)}get isSyncFontLoadingSupported(){let t=!1;return(ft||typeof navigator<"u"&&"string"==typeof navigator?.userAgent&&/Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent))&&(t=!0),U(this,"isSyncFontLoadingSupported",t)}_queueLoadingCallback(t){const{loadingRequests:i}=this,n={done:!1,complete:function e(){for(lt(!n.done,"completeRequest() cannot be called twice."),n.done=!0;i.length>0&&i[0].done;){const s=i.shift();setTimeout(s.callback,0)}},callback:t};return i.push(n),n}get _loadTestFont(){return U(this,"_loadTestFont",atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA=="))}_prepareFontLoadEvent(t,e){function i(w,E){return w.charCodeAt(E)<<24|w.charCodeAt(E+1)<<16|w.charCodeAt(E+2)<<8|255&w.charCodeAt(E+3)}function n(w,E,C,M){return w.substring(0,E)+M+w.substring(E+C)}let s,r;const a=this._document.createElement("canvas");a.width=1,a.height=1;const l=a.getContext("2d");let h=0;const d=`lt${Date.now()}${this.loadTestFontId++}`;let u=this._loadTestFont;u=n(u,976,d.length,d);const g=1482184792;let b=i(u,16);for(s=0,r=d.length-3;s<r;s+=4)b=b-g+i(d,s)|0;s<d.length&&(b=b-g+i(d+"XXX",s)|0),u=n(u,16,4,function ra(o){return String.fromCharCode(o>>24&255,o>>16&255,o>>8&255,255&o)}(b));const m=`url(data:font/opentype;base64,${btoa(u)});`;this.insertRule(`@font-face {font-family:"${d}";src:${m}}`);const A=this._document.createElement("div");A.style.visibility="hidden",A.style.width=A.style.height="10px",A.style.position="absolute",A.style.top=A.style.left="0px";for(const w of[t.loadedName,d]){const E=this._document.createElement("span");E.textContent="Hi",E.style.fontFamily=w,A.append(E)}this._document.body.append(A),function c(w,E){if(++h>30)return V("Load test font never loaded."),void E();l.font="30px "+w,l.fillText(".",0,20),l.getImageData(0,0,1,1).data[3]>0?E():setTimeout(c.bind(null,w,E))}(d,()=>{A.remove(),e.complete()})}}class Ea{constructor(t,{disableFontFace:e=!1,inspectFont:i=null}){this.compiledGlyphs=Object.create(null);for(const n in t)this[n]=t[n];this.disableFontFace=!0===e,this._inspectFont=i}createNativeFontFace(){if(!this.data||this.disableFontFace)return null;let t;if(this.cssFontInfo){const e={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(e.style=`oblique ${this.cssFontInfo.italicAngle}deg`),t=new FontFace(this.cssFontInfo.fontFamily,this.data,e)}else t=new FontFace(this.loadedName,this.data,{});return this._inspectFont?.(this),t}createFontFaceRule(){if(!this.data||this.disableFontFace)return null;const t=`url(data:${this.mimetype};base64,${function ua(o){return Uint8Array.prototype.toBase64?o.toBase64():btoa(Ln(o))}(this.data)});`;let e;if(this.cssFontInfo){let i=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(i+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),e=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${i}src:${t}}`}else e=`@font-face {font-family:"${this.loadedName}";src:${t}}`;return this._inspectFont?.(this,t),e}getPathGenerator(t,e){if(void 0!==this.compiledGlyphs[e])return this.compiledGlyphs[e];let i;try{i=t.get(this.loadedName+"_path_"+e)}catch(s){V(`getPathGenerator - ignoring character: "${s}".`)}if(!Array.isArray(i)||0===i.length)return this.compiledGlyphs[e]=function(s,r){};const n=[];for(let s=0,r=i.length;s<r;)switch(i[s++]){case 0:{const[a,l,h,c,d,u]=i.slice(s,s+6);n.push(f=>f.bezierCurveTo(a,l,h,c,d,u)),s+=6}break;case 1:{const[a,l]=i.slice(s,s+2);n.push(h=>h.moveTo(a,l)),s+=2}break;case 2:{const[a,l]=i.slice(s,s+2);n.push(h=>h.lineTo(a,l)),s+=2}break;case 3:{const[a,l,h,c]=i.slice(s,s+4);n.push(d=>d.quadraticCurveTo(a,l,h,c)),s+=4}break;case 4:n.push(a=>a.restore());break;case 5:n.push(a=>a.save());break;case 6:lt(2===n.length,"Scale command is only valid at the third position.");break;case 7:{const[a,l,h,c,d,u]=i.slice(s,s+6);n.push(f=>f.transform(a,l,h,c,d,u)),s+=6}break;case 8:{const[a,l]=i.slice(s,s+2);n.push(h=>h.translate(a,l)),s+=2}}return this.compiledGlyphs[e]=function(r,a){n[0](r),n[1](r),r.scale(a,-a);for(let l=2,h=n.length;l<h;l++)n[l](r)}}}class Vn{#t=!1;constructor({enableHWA:t=!1}){this.#t=t}create(t,e){if(t<=0||e<=0)throw new Error("Invalid canvas size");const i=this._createCanvas(t,e);return{canvas:i,context:i.getContext("2d",{willReadFrequently:!this.#t})}}reset(t,e,i){if(!t.canvas)throw new Error("Canvas is not specified");if(e<=0||i<=0)throw new Error("Invalid canvas size");t.canvas.width=e,t.canvas.height=i}destroy(t){if(!t.canvas)throw new Error("Canvas is not specified");t.canvas.width=0,t.canvas.height=0,t.canvas=null,t.context=null}_createCanvas(t,e){X("Abstract method `_createCanvas` called.")}}class jn{constructor({baseUrl:t=null,isCompressed:e=!0}){this.baseUrl=t,this.isCompressed=e}fetch(t){var e=this;return(0,x.A)(function*({name:i}){if(!e.baseUrl)throw new Error("Ensure that the `cMapUrl` and `cMapPacked` API parameters are provided.");if(!i)throw new Error("CMap name must be specified.");const n=e.baseUrl+i+(e.isCompressed?".bcmap":"");return e._fetch(n).then(s=>({cMapData:s,isCompressed:e.isCompressed})).catch(s=>{throw new Error(`Unable to load ${e.isCompressed?"binary ":""}CMap at: ${n}`)})}).apply(this,arguments)}_fetch(t){return(0,x.A)(function*(){X("Abstract method `_fetch` called.")})()}}class Hn extends jn{_fetch(t){var e=this;return(0,x.A)(function*(){const i=yield Ze(t,e.isCompressed?"arraybuffer":"text");return i instanceof ArrayBuffer?new Uint8Array(i):de(i)})()}}class zn{addFilter(t){return"none"}addHCMFilter(t,e){return"none"}addAlphaFilter(t){return"none"}addLuminosityFilter(t){return"none"}addHighlightHCMFilter(t,e,i,n,s){return"none"}destroy(t=!1){}}class Wn{constructor({baseUrl:t=null}){this.baseUrl=t}fetch(t){var e=this;return(0,x.A)(function*({filename:i}){if(!e.baseUrl)throw new Error("Ensure that the `standardFontDataUrl` API parameter is provided.");if(!i)throw new Error("Font filename must be specified.");const n=`${e.baseUrl}${i}`;return e._fetch(n).catch(s=>{throw new Error(`Unable to load font data at: ${n}`)})}).apply(this,arguments)}_fetch(t){return(0,x.A)(function*(){X("Abstract method `_fetch` called.")})()}}class Un extends Wn{_fetch(t){return(0,x.A)(function*(){const e=yield Ze(t,"arraybuffer");return new Uint8Array(e)})()}}if(ft){var ji=Promise.withResolvers(),Hi=null;(function(){var t=(0,x.A)(function*(){const e=yield import("fs"),i=yield import("http"),n=yield import("https"),s=yield import("url");return new Map(Object.entries({fs:e,http:i,https:n,url:s,canvas:void 0,path2d:void 0}))});return function(){return t.apply(this,arguments)}})()().then(t=>{Hi=t,ji.resolve()},t=>{V(`loadPackages: ${t}`),Hi=new Map,ji.resolve()})}class Zt{static get promise(){return ji.promise}static get(t){return Hi?.get(t)}}function Gn(o){return zi.apply(this,arguments)}function zi(){return(zi=(0,x.A)(function*(o){const e=yield Zt.get("fs").promises.readFile(o);return new Uint8Array(e)})).apply(this,arguments)}function Wi(o,t){if(!t)return;const e=t[2]-t[0],i=t[3]-t[1],n=new Path2D;n.rect(t[0],t[1],e,i),o.clip(n)}class Ui{getPattern(){X("Abstract method `getPattern` called.")}}class La extends Ui{constructor(t){super(),this._type=t[1],this._bbox=t[2],this._colorStops=t[3],this._p0=t[4],this._p1=t[5],this._r0=t[6],this._r1=t[7],this.matrix=null}_createGradient(t){let e;"axial"===this._type?e=t.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):"radial"===this._type&&(e=t.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));for(const i of this._colorStops)e.addColorStop(i[0],i[1]);return e}getPattern(t,e,i,n){let s;if("Stroke"===n||"Fill"===n){const r=e.current.getClippedPathBoundingBox(n,K(t))||[0,0,0,0],a=Math.ceil(r[2]-r[0])||1,l=Math.ceil(r[3]-r[1])||1,h=e.cachedCanvases.getCanvas("pattern",a,l),c=h.context;c.clearRect(0,0,c.canvas.width,c.canvas.height),c.beginPath(),c.rect(0,0,c.canvas.width,c.canvas.height),c.translate(-r[0],-r[1]),i=I.transform(i,[1,0,0,1,r[0],r[1]]),c.transform(...e.baseTransform),this.matrix&&c.transform(...this.matrix),Wi(c,this._bbox),c.fillStyle=this._createGradient(c),c.fill(),s=t.createPattern(h.canvas,"no-repeat");const d=new DOMMatrix(i);s.setTransform(d)}else Wi(t,this._bbox),s=this._createGradient(t);return s}}function Gi(o,t,e,i,n,s,r,a){const l=t.coords,h=t.colors,c=o.data,d=4*o.width;let u;l[e+1]>l[i+1]&&(u=e,e=i,i=u,u=s,s=r,r=u),l[i+1]>l[n+1]&&(u=i,i=n,n=u,u=r,r=a,a=u),l[e+1]>l[i+1]&&(u=e,e=i,i=u,u=s,s=r,r=u);const f=(l[e]+t.offsetX)*t.scaleX,p=(l[e+1]+t.offsetY)*t.scaleY,g=(l[i]+t.offsetX)*t.scaleX,b=(l[i+1]+t.offsetY)*t.scaleY,m=(l[n]+t.offsetX)*t.scaleX,v=(l[n+1]+t.offsetY)*t.scaleY;if(p>=v)return;const A=h[s],w=h[s+1],E=h[s+2],C=h[r],M=h[r+1],T=h[r+2],y=h[a],S=h[a+1],L=h[a+2],z=Math.round(p),H=Math.round(v);let W,$,et,k,j,te,ce,Lt;for(let dt=z;dt<=H;dt++){if(dt<b){const Y=dt<p?0:(p-dt)/(p-b);W=f-(f-g)*Y,$=A-(A-C)*Y,et=w-(w-M)*Y,k=E-(E-T)*Y}else{let Y;Y=dt>v?1:b===v?0:(b-dt)/(b-v),W=g-(g-m)*Y,$=C-(C-y)*Y,et=M-(M-S)*Y,k=T-(T-L)*Y}let at;at=dt<p?0:dt>v?1:(p-dt)/(p-v),j=f-(f-m)*at,te=A-(A-y)*at,ce=w-(w-S)*at,Lt=E-(E-L)*at;const ye=Math.round(Math.min(W,j)),We=Math.round(Math.max(W,j));let Rt=d*dt+4*ye;for(let Y=ye;Y<=We;Y++)at=(W-Y)/(W-j),at<0?at=0:at>1&&(at=1),c[Rt++]=$-($-te)*at|0,c[Rt++]=et-(et-ce)*at|0,c[Rt++]=k-(k-Lt)*at|0,c[Rt++]=255}}function Ra(o,t,e){const i=t.coords,n=t.colors;let s,r;switch(t.type){case"lattice":const a=t.verticesPerRow,l=Math.floor(i.length/a)-1,h=a-1;for(s=0;s<l;s++){let c=s*a;for(let d=0;d<h;d++,c++)Gi(o,e,i[c],i[c+1],i[c+a],n[c],n[c+1],n[c+a]),Gi(o,e,i[c+a+1],i[c+1],i[c+a],n[c+a+1],n[c+1],n[c+a])}break;case"triangles":for(s=0,r=i.length;s<r;s+=3)Gi(o,e,i[s],i[s+1],i[s+2],n[s],n[s+1],n[s+2]);break;default:throw new Error("illegal figure")}}class Ia extends Ui{constructor(t){super(),this._coords=t[2],this._colors=t[3],this._figures=t[4],this._bounds=t[5],this._bbox=t[7],this._background=t[8],this.matrix=null}_createMeshCanvas(t,e,i){const a=Math.floor(this._bounds[0]),l=Math.floor(this._bounds[1]),h=Math.ceil(this._bounds[2])-a,c=Math.ceil(this._bounds[3])-l,d=Math.min(Math.ceil(Math.abs(h*t[0]*1.1)),3e3),u=Math.min(Math.ceil(Math.abs(c*t[1]*1.1)),3e3),f=h/d,p=c/u,g={coords:this._coords,colors:this._colors,offsetX:-a,offsetY:-l,scaleX:1/f,scaleY:1/p},v=i.getCanvas("mesh",d+4,u+4),A=v.context,w=A.createImageData(d,u);if(e){const C=w.data;for(let M=0,T=C.length;M<T;M+=4)C[M]=e[0],C[M+1]=e[1],C[M+2]=e[2],C[M+3]=255}for(const C of this._figures)Ra(w,C,g);return A.putImageData(w,2,2),{canvas:v.canvas,offsetX:a-2*f,offsetY:l-2*p,scaleX:f,scaleY:p}}getPattern(t,e,i,n){let s;if(Wi(t,this._bbox),"Shading"===n)s=I.singularValueDecompose2dScale(K(t));else if(s=I.singularValueDecompose2dScale(e.baseTransform),this.matrix){const a=I.singularValueDecompose2dScale(this.matrix);s=[s[0]*a[0],s[1]*a[1]]}const r=this._createMeshCanvas(s,"Shading"===n?null:this._background,e.cachedCanvases);return"Shading"!==n&&(t.setTransform(...e.baseTransform),this.matrix&&t.transform(...this.matrix)),t.translate(r.offsetX,r.offsetY),t.scale(r.scaleX,r.scaleY),t.createPattern(r.canvas,"no-repeat")}}class ka extends Ui{getPattern(){return"hotpink"}}let Oa=(()=>{class o{static MAX_PATTERN_SIZE=3e3;constructor(e,i,n,s,r){this.operatorList=e[2],this.matrix=e[3],this.bbox=e[4],this.xstep=e[5],this.ystep=e[6],this.paintType=e[7],this.tilingType=e[8],this.color=i,this.ctx=n,this.canvasGraphicsFactory=s,this.baseTransform=r}createPatternCanvas(e){const{bbox:i,operatorList:n,paintType:s,tilingType:r,color:a,canvasGraphicsFactory:l}=this;let{xstep:h,ystep:c}=this;h=Math.abs(h),c=Math.abs(c),Ke("TilingType: "+r);const d=i[0],u=i[1],f=i[2],p=i[3],g=f-d,b=p-u,m=I.singularValueDecompose2dScale(this.matrix),v=I.singularValueDecompose2dScale(this.baseTransform),A=m[0]*v[0],w=m[1]*v[1];let E=g,C=b,M=!1,T=!1;const y=Math.ceil(h*A),S=Math.ceil(c*w);y>=Math.ceil(g*A)?E=h:M=!0,S>=Math.ceil(b*w)?C=c:T=!0;const H=this.getSizeAndScale(E,this.ctx.canvas.width,A),W=this.getSizeAndScale(C,this.ctx.canvas.height,w),$=e.cachedCanvases.getCanvas("pattern",H.size,W.size),et=$.context,k=l.createCanvasGraphics(et);if(k.groupLevel=e.groupLevel,this.setFillAndStrokeStyleToContext(k,s,a),et.translate(-H.scale*d,-W.scale*u),k.transform(H.scale,0,0,W.scale,0,0),et.save(),this.clipBbox(k,d,u,f,p),k.baseTransform=K(k.ctx),k.executeOperatorList(n),k.endDrawing(),et.restore(),M||T){const j=$.canvas;M&&(E=h),T&&(C=c);const te=this.getSizeAndScale(E,this.ctx.canvas.width,A),ce=this.getSizeAndScale(C,this.ctx.canvas.height,w),Lt=te.size,dt=ce.size,at=e.cachedCanvases.getCanvas("pattern-workaround",Lt,dt),ye=at.context,We=M?Math.floor(g/h):0,Rt=T?Math.floor(b/c):0;for(let Y=0;Y<=We;Y++)for(let Kt=0;Kt<=Rt;Kt++)ye.drawImage(j,Lt*Y,dt*Kt,Lt,dt,0,0,Lt,dt);return{canvas:at.canvas,scaleX:te.scale,scaleY:ce.scale,offsetX:d,offsetY:u}}return{canvas:$.canvas,scaleX:H.scale,scaleY:W.scale,offsetX:d,offsetY:u}}getSizeAndScale(e,i,n){const s=Math.max(o.MAX_PATTERN_SIZE,i);let r=Math.ceil(e*n);return r>=s?r=s:n=r/e,{scale:n,size:r}}clipBbox(e,i,n,s,r){e.ctx.rect(i,n,s-i,r-n),e.current.updateRectMinMax(K(e.ctx),[i,n,s,r]),e.clip(),e.endPath()}setFillAndStrokeStyleToContext(e,i,n){const s=e.ctx,r=e.current;switch(i){case 1:const a=this.ctx;s.fillStyle=a.fillStyle,s.strokeStyle=a.strokeStyle,r.fillColor=a.fillStyle,r.strokeColor=a.strokeStyle;break;case 2:const l=I.makeHexColor(n[0],n[1],n[2]);s.fillStyle=l,s.strokeStyle=l,r.fillColor=l,r.strokeColor=l;break;default:throw new sa(`Unsupported paint type: ${i}`)}}getPattern(e,i,n,s){let r=n;"Shading"!==s&&(r=I.transform(r,i.baseTransform),this.matrix&&(r=I.transform(r,this.matrix)));const a=this.createPatternCanvas(i);let l=new DOMMatrix(r);l=l.translate(a.offsetX,a.offsetY),l=l.scale(1/a.scaleX,1/a.scaleY);const h=e.createPattern(a.canvas,"repeat");return h.setTransform(l),h}}return o})();function Xn({src:o,srcPos:t=0,dest:e,width:i,height:n,nonBlackColor:s=4294967295,inverseDecode:r=!1}){const a=bt.isLittleEndian?4278190080:255,[l,h]=r?[s,a]:[a,s],c=i>>3,d=7&i,u=o.length;e=new Uint32Array(e.buffer);let f=0;for(let p=0;p<n;p++){for(const b=t+c;t<b;t++){const m=t<u?o[t]:255;e[f++]=128&m?h:l,e[f++]=64&m?h:l,e[f++]=32&m?h:l,e[f++]=16&m?h:l,e[f++]=8&m?h:l,e[f++]=4&m?h:l,e[f++]=2&m?h:l,e[f++]=1&m?h:l}if(0===d)continue;const g=t<u?o[t++]:255;for(let b=0;b<d;b++)e[f++]=g&1<<7-b?h:l}return{srcPos:t,destPos:f}}class Va{constructor(t){this.canvasFactory=t,this.cache=Object.create(null)}getCanvas(t,e,i){let n;return void 0!==this.cache[t]?(n=this.cache[t],this.canvasFactory.reset(n,e,i)):(n=this.canvasFactory.create(e,i),this.cache[t]=n),n}delete(t){delete this.cache[t]}clear(){for(const t in this.cache)this.canvasFactory.destroy(this.cache[t]),delete this.cache[t]}}function ei(o,t,e,i,n,s,r,a,l,h){const[c,d,u,f,p,g]=K(o);if(0===d&&0===u){const A=Math.round(r*c+p),E=Math.round(a*f+g),M=Math.abs(Math.round((r+l)*c+p)-A)||1,y=Math.abs(Math.round((a+h)*f+g)-E)||1;return o.setTransform(Math.sign(c),0,0,Math.sign(f),A,E),o.drawImage(t,e,i,n,s,0,0,M,y),o.setTransform(c,d,u,f,p,g),[M,y]}if(0===c&&0===f){const A=Math.round(a*u+p),E=Math.round(r*d+g),M=Math.abs(Math.round((a+h)*u+p)-A)||1,y=Math.abs(Math.round((r+l)*d+g)-E)||1;return o.setTransform(0,Math.sign(d),Math.sign(u),0,A,E),o.drawImage(t,e,i,n,s,0,0,y,M),o.setTransform(c,d,u,f,p,g),[y,M]}return o.drawImage(t,e,i,n,s,r,a,l,h),[Math.hypot(c,d)*l,Math.hypot(u,f)*h]}class Zn{constructor(t,e){this.alphaIsShape=!1,this.fontSize=0,this.fontSizeScale=1,this.textMatrix=Tn,this.textMatrixScale=1,this.fontMatrix=Ci,this.leading=0,this.x=0,this.y=0,this.lineX=0,this.lineY=0,this.charSpacing=0,this.wordSpacing=0,this.textHScale=1,this.textRenderingMode=0,this.textRise=0,this.fillColor="#000000",this.strokeColor="#000000",this.patternFill=!1,this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.activeSMask=null,this.transferMaps="none",this.startNewPathAndClipBox([0,0,t,e])}clone(){const t=Object.create(this);return t.clipBox=this.clipBox.slice(),t}setCurrentPoint(t,e){this.x=t,this.y=e}updatePathMinMax(t,e,i){[e,i]=I.applyTransform([e,i],t),this.minX=Math.min(this.minX,e),this.minY=Math.min(this.minY,i),this.maxX=Math.max(this.maxX,e),this.maxY=Math.max(this.maxY,i)}updateRectMinMax(t,e){const i=I.applyTransform(e,t),n=I.applyTransform(e.slice(2),t),s=I.applyTransform([e[0],e[3]],t),r=I.applyTransform([e[2],e[1]],t);this.minX=Math.min(this.minX,i[0],n[0],s[0],r[0]),this.minY=Math.min(this.minY,i[1],n[1],s[1],r[1]),this.maxX=Math.max(this.maxX,i[0],n[0],s[0],r[0]),this.maxY=Math.max(this.maxY,i[1],n[1],s[1],r[1])}updateScalingPathMinMax(t,e){I.scaleMinMax(t,e),this.minX=Math.min(this.minX,e[0]),this.minY=Math.min(this.minY,e[1]),this.maxX=Math.max(this.maxX,e[2]),this.maxY=Math.max(this.maxY,e[3])}updateCurvePathMinMax(t,e,i,n,s,r,a,l,h,c){const d=I.bezierBoundingBox(e,i,n,s,r,a,l,h,c);c||this.updateRectMinMax(t,d)}getPathBoundingBox(t="Fill",e=null){const i=[this.minX,this.minY,this.maxX,this.maxY];if("Stroke"===t){e||X("Stroke bounding box must include transform.");const n=I.singularValueDecompose2dScale(e),s=n[0]*this.lineWidth/2,r=n[1]*this.lineWidth/2;i[0]-=s,i[1]-=r,i[2]+=s,i[3]+=r}return i}updateClipFromPath(){const t=I.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(t||[0,0,0,0])}isEmptyClip(){return this.minX===1/0}startNewPathAndClipBox(t){this.clipBox=t,this.minX=1/0,this.minY=1/0,this.maxX=0,this.maxY=0}getClippedPathBoundingBox(t="Fill",e=null){return I.intersect(this.clipBox,this.getPathBoundingBox(t,e))}}function Jn(o,t){if(typeof ImageData<"u"&&t instanceof ImageData)return void o.putImageData(t,0,0);const e=t.height,i=t.width,n=e%16,s=(e-n)/16,r=0===n?s:s+1,a=o.createImageData(i,16);let h,l=0;const c=t.data,d=a.data;let u,f,p,g;if(t.kind===$e.GRAYSCALE_1BPP){const b=c.byteLength,m=new Uint32Array(d.buffer,0,d.byteLength>>2),v=m.length,A=i+7>>3,w=4294967295,E=bt.isLittleEndian?4278190080:255;for(u=0;u<r;u++){for(p=u<s?16:n,h=0,f=0;f<p;f++){const C=b-l;let M=0;const T=C>A?i:8*C-7,y=-8&T;let S=0,L=0;for(;M<y;M+=8)L=c[l++],m[h++]=128&L?w:E,m[h++]=64&L?w:E,m[h++]=32&L?w:E,m[h++]=16&L?w:E,m[h++]=8&L?w:E,m[h++]=4&L?w:E,m[h++]=2&L?w:E,m[h++]=1&L?w:E;for(;M<T;M++)0===S&&(L=c[l++],S=128),m[h++]=L&S?w:E,S>>=1}for(;h<v;)m[h++]=0;o.putImageData(a,0,16*u)}}else if(t.kind===$e.RGBA_32BPP){for(f=0,g=16*i*4,u=0;u<s;u++)d.set(c.subarray(l,l+g)),l+=g,o.putImageData(a,0,f),f+=16;u<r&&(g=i*n*4,d.set(c.subarray(l,l+g)),o.putImageData(a,0,f))}else{if(t.kind!==$e.RGB_24BPP)throw new Error(`bad image kind: ${t.kind}`);for(p=16,g=i*p,u=0;u<r;u++){for(u>=s&&(p=n,g=i*p),h=0,f=g;f--;)d[h++]=c[l++],d[h++]=c[l++],d[h++]=c[l++],d[h++]=255;o.putImageData(a,0,16*u)}}}function ts(o,t){if(t.bitmap)return void o.drawImage(t.bitmap,0,0);const e=t.height,i=t.width,n=e%16,s=(e-n)/16,r=0===n?s:s+1,a=o.createImageData(i,16);let l=0;const h=t.data,c=a.data;for(let d=0;d<r;d++){const u=d<s?16:n;({srcPos:l}=Xn({src:h,srcPos:l,dest:c,width:i,height:u,nonBlackColor:0})),o.putImageData(a,0,16*d)}}function Me(o,t){const e=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font","filter"];for(const i of e)void 0!==o[i]&&(t[i]=o[i]);void 0!==o.setLineDash&&(t.setLineDash(o.getLineDash()),t.lineDashOffset=o.lineDashOffset)}function ii(o){if(o.strokeStyle=o.fillStyle="#000000",o.fillRule="nonzero",o.globalAlpha=1,o.lineWidth=1,o.lineCap="butt",o.lineJoin="miter",o.miterLimit=10,o.globalCompositeOperation="source-over",o.font="10px sans-serif",void 0!==o.setLineDash&&(o.setLineDash([]),o.lineDashOffset=0),!ft){const{filter:t}=o;"none"!==t&&""!==t&&(o.filter="none")}}function es(o,t){if(t)return!0;const e=I.singularValueDecompose2dScale(o);e[0]=Math.fround(e[0]),e[1]=Math.fround(e[1]);const i=Math.fround((globalThis.devicePixelRatio||1)*ue.PDF_TO_CSS_UNITS);return e[0]<=i&&e[1]<=i}const Ha=["butt","round","square"],za=["miter","round","bevel"],Wa={},is={};class fe{constructor(t,e,i,n,s,{optionalContentConfig:r,markedContentStack:a=null},l,h){this.ctx=t,this.current=new Zn(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=e,this.objs=i,this.canvasFactory=n,this.filterFactory=s,this.groupStack=[],this.processingType3=null,this.baseTransform=null,this.baseTransformStack=[],this.groupLevel=0,this.smaskStack=[],this.smaskCounter=0,this.tempSMask=null,this.suspendedCtx=null,this.contentVisible=!0,this.markedContentStack=a||[],this.optionalContentConfig=r,this.cachedCanvases=new Va(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=l,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.pageColors=h,this._cachedScaleForStroking=[-1,0],this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map}getObject(t,e=null){return"string"==typeof t?t.startsWith("g_")?this.commonObjs.get(t):this.objs.get(t):e}beginDrawing({transform:t,viewport:e,transparency:i=!1,background:n=null}){const s=this.ctx.canvas.width,r=this.ctx.canvas.height,a=this.ctx.fillStyle;if(this.ctx.fillStyle=n||"#ffffff",this.ctx.fillRect(0,0,s,r),this.ctx.fillStyle=a,i){const l=this.cachedCanvases.getCanvas("transparent",s,r);this.compositeCtx=this.ctx,this.transparentCanvas=l.canvas,this.ctx=l.context,this.ctx.save(),this.ctx.transform(...K(this.compositeCtx))}this.ctx.save(),ii(this.ctx),t&&(this.ctx.transform(...t),this.outputScaleX=t[0],this.outputScaleY=t[0]),this.ctx.transform(...e.transform),this.viewportScale=e.scale,this.baseTransform=K(this.ctx)}executeOperatorList(t,e,i,n){const s=t.argsArray,r=t.fnArray;let a=e||0;const l=s.length;if(l===a)return a;const h=l-a>10&&"function"==typeof i,c=h?Date.now()+15:0;let d=0;const u=this.commonObjs,f=this.objs;let p;for(;;){if(void 0!==n&&a===n.nextBreakPoint)return n.breakIt(a,i),a;if(p=r[a],p!==kt.dependency)this[p].apply(this,s[a]);else for(const g of s[a]){const b=g.startsWith("g_")?u:f;if(!b.has(g))return b.get(g,i),a}if(a++,a===l)return a;if(h&&++d>10){if(Date.now()>c)return i(),a;d=0}}}#t(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();this.current.activeSMask=null,this.ctx.restore(),this.transparentCanvas&&(this.ctx=this.compositeCtx,this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.drawImage(this.transparentCanvas,0,0),this.ctx.restore(),this.transparentCanvas=null)}endDrawing(){this.#t(),this.cachedCanvases.clear(),this.cachedPatterns.clear();for(const t of this._cachedBitmapsMap.values()){for(const e of t.values())typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement&&(e.width=e.height=0);t.clear()}this._cachedBitmapsMap.clear(),this.#e()}#e(){if(this.pageColors){const t=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if("none"!==t){const e=this.ctx.filter;this.ctx.filter=t,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=e}}}_scaleImage(t,e){const i=t.width??t.displayWidth,n=t.height??t.displayHeight;let c,d,s=Math.max(Math.hypot(e[0],e[1]),1),r=Math.max(Math.hypot(e[2],e[3]),1),a=i,l=n,h="prescale1";for(;s>2&&a>1||r>2&&l>1;){let u=a,f=l;s>2&&a>1&&(u=a>=16384?Math.floor(a/2)-1||1:Math.ceil(a/2),s/=a/u),r>2&&l>1&&(f=l>=16384?Math.floor(l/2)-1||1:Math.ceil(l)/2,r/=l/f),c=this.cachedCanvases.getCanvas(h,u,f),d=c.context,d.clearRect(0,0,u,f),d.drawImage(t,0,0,a,l,0,0,u,f),t=c.canvas,a=u,l=f,h="prescale1"===h?"prescale2":"prescale1"}return{img:t,paintWidth:a,paintHeight:l}}_createMaskCanvas(t){const e=this.ctx,{width:i,height:n}=t,s=this.current.fillColor,r=this.current.patternFill,a=K(e);let l,h,c,d;if((t.bitmap||t.data)&&t.count>1){const T=t.bitmap||t.data.buffer;h=JSON.stringify(r?a:[a.slice(0,4),s]),l=this._cachedBitmapsMap.get(T),l||(l=new Map,this._cachedBitmapsMap.set(T,l));const y=l.get(h);if(y&&!r)return{canvas:y,offsetX:Math.round(Math.min(a[0],a[2])+a[4]),offsetY:Math.round(Math.min(a[1],a[3])+a[5])};c=y}c||(d=this.cachedCanvases.getCanvas("maskCanvas",i,n),ts(d.context,t));let u=I.transform(a,[1/i,0,0,-1/n,0,0]);u=I.transform(u,[1,0,0,1,0,-n]);const[f,p,g,b]=I.getAxialAlignedBoundingBox([0,0,i,n],u),m=Math.round(g-f)||1,v=Math.round(b-p)||1,A=this.cachedCanvases.getCanvas("fillCanvas",m,v),w=A.context,E=f,C=p;w.translate(-E,-C),w.transform(...u),c||(c=this._scaleImage(d.canvas,Wt(w)),c=c.img,l&&r&&l.set(h,c)),w.imageSmoothingEnabled=es(K(w),t.interpolate),ei(w,c,0,0,c.width,c.height,0,0,i,n),w.globalCompositeOperation="source-in";const M=I.transform(Wt(w),[1,0,0,1,-E,-C]);return w.fillStyle=r?s.getPattern(e,this,M,"Fill"):s,w.fillRect(0,0,i,n),l&&!r&&(this.cachedCanvases.delete("fillCanvas"),l.set(h,A.canvas)),{canvas:A.canvas,offsetX:Math.round(E),offsetY:Math.round(C)}}setLineWidth(t){t!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=t,this.ctx.lineWidth=t}setLineCap(t){this.ctx.lineCap=Ha[t]}setLineJoin(t){this.ctx.lineJoin=za[t]}setMiterLimit(t){this.ctx.miterLimit=t}setDash(t,e){const i=this.ctx;void 0!==i.setLineDash&&(i.setLineDash(t),i.lineDashOffset=e)}setRenderingIntent(t){}setFlatness(t){}setGState(t){for(const[e,i]of t)switch(e){case"LW":this.setLineWidth(i);break;case"LC":this.setLineCap(i);break;case"LJ":this.setLineJoin(i);break;case"ML":this.setMiterLimit(i);break;case"D":this.setDash(i[0],i[1]);break;case"RI":this.setRenderingIntent(i);break;case"FL":this.setFlatness(i);break;case"Font":this.setFont(i[0],i[1]);break;case"CA":this.current.strokeAlpha=i;break;case"ca":this.current.fillAlpha=i,this.ctx.globalAlpha=i;break;case"BM":this.ctx.globalCompositeOperation=i;break;case"SMask":this.current.activeSMask=i?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(i)}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){const t=this.inSMaskMode;this.current.activeSMask&&!t?this.beginSMaskMode():!this.current.activeSMask&&t&&this.endSMaskMode()}beginSMaskMode(){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");const n=this.cachedCanvases.getCanvas("smaskGroupAt"+this.groupLevel,this.ctx.canvas.width,this.ctx.canvas.height);this.suspendedCtx=this.ctx,this.ctx=n.context;const s=this.ctx;s.setTransform(...K(this.suspendedCtx)),Me(this.suspendedCtx,s),function Ba(o,t){if(o._removeMirroring)throw new Error("Context is already forwarding operations.");o.__originalSave=o.save,o.__originalRestore=o.restore,o.__originalRotate=o.rotate,o.__originalScale=o.scale,o.__originalTranslate=o.translate,o.__originalTransform=o.transform,o.__originalSetTransform=o.setTransform,o.__originalResetTransform=o.resetTransform,o.__originalClip=o.clip,o.__originalMoveTo=o.moveTo,o.__originalLineTo=o.lineTo,o.__originalBezierCurveTo=o.bezierCurveTo,o.__originalRect=o.rect,o.__originalClosePath=o.closePath,o.__originalBeginPath=o.beginPath,o._removeMirroring=()=>{o.save=o.__originalSave,o.restore=o.__originalRestore,o.rotate=o.__originalRotate,o.scale=o.__originalScale,o.translate=o.__originalTranslate,o.transform=o.__originalTransform,o.setTransform=o.__originalSetTransform,o.resetTransform=o.__originalResetTransform,o.clip=o.__originalClip,o.moveTo=o.__originalMoveTo,o.lineTo=o.__originalLineTo,o.bezierCurveTo=o.__originalBezierCurveTo,o.rect=o.__originalRect,o.closePath=o.__originalClosePath,o.beginPath=o.__originalBeginPath,delete o._removeMirroring},o.save=function(){t.save(),this.__originalSave()},o.restore=function(){t.restore(),this.__originalRestore()},o.translate=function(i,n){t.translate(i,n),this.__originalTranslate(i,n)},o.scale=function(i,n){t.scale(i,n),this.__originalScale(i,n)},o.transform=function(i,n,s,r,a,l){t.transform(i,n,s,r,a,l),this.__originalTransform(i,n,s,r,a,l)},o.setTransform=function(i,n,s,r,a,l){t.setTransform(i,n,s,r,a,l),this.__originalSetTransform(i,n,s,r,a,l)},o.resetTransform=function(){t.resetTransform(),this.__originalResetTransform()},o.rotate=function(i){t.rotate(i),this.__originalRotate(i)},o.clip=function(i){t.clip(i),this.__originalClip(i)},o.moveTo=function(e,i){t.moveTo(e,i),this.__originalMoveTo(e,i)},o.lineTo=function(e,i){t.lineTo(e,i),this.__originalLineTo(e,i)},o.bezierCurveTo=function(e,i,n,s,r,a){t.bezierCurveTo(e,i,n,s,r,a),this.__originalBezierCurveTo(e,i,n,s,r,a)},o.rect=function(e,i,n,s){t.rect(e,i,n,s),this.__originalRect(e,i,n,s)},o.closePath=function(){t.closePath(),this.__originalClosePath()},o.beginPath=function(){t.beginPath(),this.__originalBeginPath()}}(s,this.suspendedCtx),this.setGState([["BM","source-over"],["ca",1],["CA",1]])}endSMaskMode(){if(!this.inSMaskMode)throw new Error("endSMaskMode called while not in smask mode");this.ctx._removeMirroring(),Me(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(t){this.current.activeSMask&&(t?(t[0]=Math.floor(t[0]),t[1]=Math.floor(t[1]),t[2]=Math.ceil(t[2]),t[3]=Math.ceil(t[3])):t=[0,0,this.ctx.canvas.width,this.ctx.canvas.height],this.composeSMask(this.suspendedCtx,this.current.activeSMask,this.ctx,t),this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.clearRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height),this.ctx.restore())}composeSMask(t,e,i,n){const s=n[0],r=n[1],a=n[2]-s,l=n[3]-r;0===a||0===l||(this.genericComposeSMask(e.context,i,a,l,e.subtype,e.backdrop,e.transferMap,s,r,e.offsetX,e.offsetY),t.save(),t.globalAlpha=1,t.globalCompositeOperation="source-over",t.setTransform(1,0,0,1,0,0),t.drawImage(i.canvas,0,0),t.restore())}genericComposeSMask(t,e,i,n,s,r,a,l,h,c,d){let u=t.canvas,f=l-c,p=h-d;if(r){const b=I.makeHexColor(...r);if(f<0||p<0||f+i>u.width||p+n>u.height){const m=this.cachedCanvases.getCanvas("maskExtension",i,n),v=m.context;v.drawImage(u,-f,-p),v.globalCompositeOperation="destination-atop",v.fillStyle=b,v.fillRect(0,0,i,n),v.globalCompositeOperation="source-over",u=m.canvas,f=p=0}else{t.save(),t.globalAlpha=1,t.setTransform(1,0,0,1,0,0);const m=new Path2D;m.rect(f,p,i,n),t.clip(m),t.globalCompositeOperation="destination-atop",t.fillStyle=b,t.fillRect(f,p,i,n),t.restore()}}e.save(),e.globalAlpha=1,e.setTransform(1,0,0,1,0,0),"Alpha"===s&&a?e.filter=this.filterFactory.addAlphaFilter(a):"Luminosity"===s&&(e.filter=this.filterFactory.addLuminosityFilter(a));const g=new Path2D;g.rect(l,h,i,n),e.clip(g),e.globalCompositeOperation="destination-in",e.drawImage(u,f,p,i,n,l,h,i,n),e.restore()}save(){this.inSMaskMode?(Me(this.ctx,this.suspendedCtx),this.suspendedCtx.save()):this.ctx.save();const t=this.current;this.stateStack.push(t),this.current=t.clone()}restore(){0===this.stateStack.length&&this.inSMaskMode&&this.endSMaskMode(),0!==this.stateStack.length&&(this.current=this.stateStack.pop(),this.inSMaskMode?(this.suspendedCtx.restore(),Me(this.suspendedCtx,this.ctx)):this.ctx.restore(),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null)}transform(t,e,i,n,s,r){this.ctx.transform(t,e,i,n,s,r),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(t,e,i){const n=this.ctx,s=this.current;let l,h,r=s.x,a=s.y;const c=K(n),d=0===c[0]&&0===c[3]||0===c[1]&&0===c[2],u=d?i.slice(0):null;for(let f=0,p=0,g=t.length;f<g;f++)switch(0|t[f]){case kt.rectangle:r=e[p++],a=e[p++];const b=e[p++],m=e[p++],v=r+b,A=a+m;n.moveTo(r,a),0===b||0===m?n.lineTo(v,A):(n.lineTo(v,a),n.lineTo(v,A),n.lineTo(r,A)),d||s.updateRectMinMax(c,[r,a,v,A]),n.closePath();break;case kt.moveTo:r=e[p++],a=e[p++],n.moveTo(r,a),d||s.updatePathMinMax(c,r,a);break;case kt.lineTo:r=e[p++],a=e[p++],n.lineTo(r,a),d||s.updatePathMinMax(c,r,a);break;case kt.curveTo:l=r,h=a,r=e[p+4],a=e[p+5],n.bezierCurveTo(e[p],e[p+1],e[p+2],e[p+3],r,a),s.updateCurvePathMinMax(c,l,h,e[p],e[p+1],e[p+2],e[p+3],r,a,u),p+=6;break;case kt.curveTo2:l=r,h=a,n.bezierCurveTo(r,a,e[p],e[p+1],e[p+2],e[p+3]),s.updateCurvePathMinMax(c,l,h,r,a,e[p],e[p+1],e[p+2],e[p+3],u),r=e[p+2],a=e[p+3],p+=4;break;case kt.curveTo3:l=r,h=a,r=e[p+2],a=e[p+3],n.bezierCurveTo(e[p],e[p+1],r,a,r,a),s.updateCurvePathMinMax(c,l,h,e[p],e[p+1],r,a,r,a,u),p+=4;break;case kt.closePath:n.closePath()}d&&s.updateScalingPathMinMax(c,u),s.setCurrentPoint(r,a)}closePath(){this.ctx.closePath()}stroke(t=!0){const e=this.ctx,i=this.current.strokeColor;e.globalAlpha=this.current.strokeAlpha,this.contentVisible&&("object"==typeof i&&i?.getPattern?(e.save(),e.strokeStyle=i.getPattern(e,this,Wt(e),"Stroke"),this.rescaleAndStroke(!1),e.restore()):this.rescaleAndStroke(!0)),t&&this.consumePath(this.current.getClippedPathBoundingBox()),e.globalAlpha=this.current.fillAlpha}closeStroke(){this.closePath(),this.stroke()}fill(t=!0){const e=this.ctx,i=this.current.fillColor;let s=!1;this.current.patternFill&&(e.save(),e.fillStyle=i.getPattern(e,this,Wt(e),"Fill"),s=!0);const r=this.current.getClippedPathBoundingBox();this.contentVisible&&null!==r&&(this.pendingEOFill?(e.fill("evenodd"),this.pendingEOFill=!1):e.fill()),s&&e.restore(),t&&this.consumePath(r)}eoFill(){this.pendingEOFill=!0,this.fill()}fillStroke(){this.fill(!1),this.stroke(!1),this.consumePath()}eoFillStroke(){this.pendingEOFill=!0,this.fillStroke()}closeFillStroke(){this.closePath(),this.fillStroke()}closeEOFillStroke(){this.pendingEOFill=!0,this.closePath(),this.fillStroke()}endPath(){this.consumePath()}clip(){this.pendingClip=Wa}eoClip(){this.pendingClip=is}beginText(){this.current.textMatrix=Tn,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}endText(){const t=this.pendingTextPaths,e=this.ctx;if(void 0!==t){e.save(),e.beginPath();for(const i of t)e.setTransform(...i.transform),e.translate(i.x,i.y),i.addToPath(e,i.fontSize);e.restore(),e.clip(),e.beginPath(),delete this.pendingTextPaths}else e.beginPath()}setCharSpacing(t){this.current.charSpacing=t}setWordSpacing(t){this.current.wordSpacing=t}setHScale(t){this.current.textHScale=t/100}setLeading(t){this.current.leading=-t}setFont(t,e){const i=this.commonObjs.get(t),n=this.current;if(!i)throw new Error(`Can't find font for ${t}`);if(n.fontMatrix=i.fontMatrix||Ci,(0===n.fontMatrix[0]||0===n.fontMatrix[3])&&V("Invalid font matrix for font "+t),e<0?(e=-e,n.fontDirection=-1):n.fontDirection=1,this.current.font=i,this.current.fontSize=e,i.isType3Font)return;const s=i.loadedName||"sans-serif",r=i.systemFontInfo?.css||`"${s}", ${i.fallbackName}`;let a="normal";i.black?a="900":i.bold&&(a="bold");const l=i.italic?"italic":"normal";let h=e;e<16?h=16:e>100&&(h=100),this.current.fontSizeScale=e/h,this.ctx.font=`${l} ${a} ${h}px ${r}`}setTextRenderingMode(t){this.current.textRenderingMode=t}setTextRise(t){this.current.textRise=t}moveText(t,e){this.current.x=this.current.lineX+=t,this.current.y=this.current.lineY+=e}setLeadingMoveText(t,e){this.setLeading(-e),this.moveText(t,e)}setTextMatrix(t,e,i,n,s,r){this.current.textMatrix=[t,e,i,n,s,r],this.current.textMatrixScale=Math.hypot(t,e),this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}nextLine(){this.moveText(0,this.current.leading)}paintChar(t,e,i,n){const s=this.ctx,r=this.current,a=r.font,l=r.textRenderingMode,h=r.fontSize/r.fontSizeScale,c=3&l,d=!!(4&l),u=r.patternFill&&!a.missingFile;let f;(a.disableFontFace||d||u)&&(f=a.getPathGenerator(this.commonObjs,t)),a.disableFontFace||u?(s.save(),s.translate(e,i),s.beginPath(),f(s,h),n&&s.setTransform(...n),(0===c||2===c)&&s.fill(),(1===c||2===c)&&s.stroke(),s.restore()):((0===c||2===c)&&s.fillText(t,e,i),(1===c||2===c)&&s.strokeText(t,e,i)),d&&(this.pendingTextPaths||=[]).push({transform:K(s),x:e,y:i,fontSize:h,addToPath:f})}get isFontSubpixelAAEnabled(){const{context:t}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);t.scale(1.5,1),t.fillText("I",0,10);const e=t.getImageData(0,0,10,10).data;let i=!1;for(let n=3;n<e.length;n+=4)if(e[n]>0&&e[n]<255){i=!0;break}return U(this,"isFontSubpixelAAEnabled",i)}showText(t){const e=this.current,i=e.font;if(i.isType3Font)return this.showType3Text(t);const n=e.fontSize;if(0===n)return;const s=this.ctx,r=e.fontSizeScale,a=e.charSpacing,l=e.wordSpacing,h=e.fontDirection,c=e.textHScale*h,d=t.length,u=i.vertical,f=u?1:-1,p=i.defaultVMetrics,g=n*e.fontMatrix[0],b=0===e.textRenderingMode&&!i.disableFontFace&&!e.patternFill;let m;if(s.save(),s.transform(...e.textMatrix),s.translate(e.x,e.y+e.textRise),s.scale(c,h>0?-1:1),e.patternFill){s.save();const C=e.fillColor.getPattern(s,this,Wt(s),"Fill");m=K(s),s.restore(),s.fillStyle=C}let v=e.lineWidth;const A=e.textMatrixScale;if(0===A||0===v){const C=3&e.textRenderingMode;(1===C||2===C)&&(v=this.getSinglePixelWidth())}else v/=A;if(1!==r&&(s.scale(r,r),v/=r),s.lineWidth=v,i.isInvalidPDFjsFont){const C=[];let M=0;for(const T of t)C.push(T.unicode),M+=T.width;return s.fillText(C.join(""),0,0),e.x+=M*g*c,s.restore(),void this.compose()}let E,w=0;for(E=0;E<d;++E){const C=t[E];if("number"==typeof C){w+=f*C*n/1e3;continue}let M=!1;const T=(C.isSpace?l:0)+a,y=C.fontChar,S=C.accent;let L,z,H=C.width;if(u){const $=C.vmetric||p,et=-(C.vmetric?$[1]:.5*H)*g;H=$?-$[0]:H,L=et/r,z=(w+$[2]*g)/r}else L=w/r,z=0;if(i.remeasure&&H>0){const $=1e3*s.measureText(y).width/n*r;if(H<$&&this.isFontSubpixelAAEnabled){const et=H/$;M=!0,s.save(),s.scale(et,1),L/=et}else H!==$&&(L+=(H-$)/2e3*n/r)}this.contentVisible&&(C.isInFont||i.missingFile)&&(b&&!S?s.fillText(y,L,z):(this.paintChar(y,L,z,m),S&&this.paintChar(S.fontChar,L+n*S.offset.x/r,z-n*S.offset.y/r,m))),w+=u?H*g-T*h:H*g+T*h,M&&s.restore()}u?e.y-=w:e.x+=w*c,s.restore(),this.compose()}showType3Text(t){const e=this.ctx,i=this.current,n=i.font,s=i.fontSize,r=i.fontDirection,a=n.vertical?1:-1,l=i.charSpacing,h=i.wordSpacing,c=i.textHScale*r,d=i.fontMatrix||Ci,u=t.length;let p,g,b,m;if(3!==i.textRenderingMode&&0!==s){for(this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,e.save(),e.transform(...i.textMatrix),e.translate(i.x,i.y),e.scale(c,r),p=0;p<u;++p){if(g=t[p],"number"==typeof g){m=a*g*s/1e3,this.ctx.translate(m,0),i.x+=m*c;continue}const v=(g.isSpace?h:0)+l,A=n.charProcOperatorList[g.operatorListId];A?(this.contentVisible&&(this.processingType3=g,this.save(),e.scale(s,s),e.transform(...d),this.executeOperatorList(A),this.restore()),b=I.applyTransform([g.width,0],d)[0]*s+v,e.translate(b,0),i.x+=b*c):V(`Type3 character "${g.operatorListId}" is not available.`)}e.restore(),this.processingType3=null}}setCharWidth(t,e){}setCharWidthAndBounds(t,e,i,n,s,r){this.ctx.rect(i,n,s-i,r-n),this.ctx.clip(),this.endPath()}getColorN_Pattern(t){let e;if("TilingPattern"===t[0]){const i=t[1],n=this.baseTransform||K(this.ctx);e=new Oa(t,i,this.ctx,{createCanvasGraphics:r=>new fe(r,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack})},n)}else e=this._getPattern(t[1],t[2]);return e}setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments)}setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0}setStrokeRGBColor(t,e,i){this.ctx.strokeStyle=this.current.strokeColor=I.makeHexColor(t,e,i)}setStrokeTransparent(){this.ctx.strokeStyle=this.current.strokeColor="transparent"}setFillRGBColor(t,e,i){this.ctx.fillStyle=this.current.fillColor=I.makeHexColor(t,e,i),this.current.patternFill=!1}setFillTransparent(){this.ctx.fillStyle=this.current.fillColor="transparent",this.current.patternFill=!1}_getPattern(t,e=null){let i;return this.cachedPatterns.has(t)?i=this.cachedPatterns.get(t):(i=function Da(o){switch(o[0]){case"RadialAxial":return new La(o);case"Mesh":return new Ia(o);case"Dummy":return new ka}throw new Error(`Unknown IR type: ${o[0]}`)}(this.getObject(t)),this.cachedPatterns.set(t,i)),e&&(i.matrix=e),i}shadingFill(t){if(!this.contentVisible)return;const e=this.ctx;this.save();const i=this._getPattern(t);e.fillStyle=i.getPattern(e,this,Wt(e),"Shading");const n=Wt(e);if(n){const{width:s,height:r}=e.canvas,[a,l,h,c]=I.getAxialAlignedBoundingBox([0,0,s,r],n);this.ctx.fillRect(a,l,h-a,c-l)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox()),this.restore()}beginInlineImage(){X("Should not call beginInlineImage")}beginImageData(){X("Should not call beginImageData")}paintFormXObjectBegin(t,e){this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),t&&this.transform(...t),this.baseTransform=K(this.ctx),e)&&(this.ctx.rect(e[0],e[1],e[2]-e[0],e[3]-e[1]),this.current.updateRectMinMax(K(this.ctx),e),this.clip(),this.endPath())}paintFormXObjectEnd(){this.contentVisible&&(this.restore(),this.baseTransform=this.baseTransformStack.pop())}beginGroup(t){if(!this.contentVisible)return;this.save(),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);const e=this.ctx;t.isolated||Ke("TODO: Support non-isolated groups."),t.knockout&&V("Knockout groups not supported.");const i=K(e);if(t.matrix&&e.transform(...t.matrix),!t.bbox)throw new Error("Bounding box is required.");let n=I.getAxialAlignedBoundingBox(t.bbox,K(e));n=I.intersect(n,[0,0,e.canvas.width,e.canvas.height])||[0,0,0,0];const r=Math.floor(n[0]),a=Math.floor(n[1]),l=Math.max(Math.ceil(n[2])-r,1),h=Math.max(Math.ceil(n[3])-a,1);this.current.startNewPathAndClipBox([0,0,l,h]);let c="groupAt"+this.groupLevel;t.smask&&(c+="_smask_"+this.smaskCounter++%2);const d=this.cachedCanvases.getCanvas(c,l,h),u=d.context;u.translate(-r,-a),u.transform(...i),t.smask?this.smaskStack.push({canvas:d.canvas,context:u,offsetX:r,offsetY:a,subtype:t.smask.subtype,backdrop:t.smask.backdrop,transferMap:t.smask.transferMap||null,startTransformInverse:null}):(e.setTransform(1,0,0,1,0,0),e.translate(r,a),e.save()),Me(e,u),this.ctx=u,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(e),this.groupLevel++}endGroup(t){if(!this.contentVisible)return;this.groupLevel--;const e=this.ctx,i=this.groupStack.pop();if(this.ctx=i,this.ctx.imageSmoothingEnabled=!1,t.smask)this.tempSMask=this.smaskStack.pop(),this.restore();else{this.ctx.restore();const n=K(this.ctx);this.restore(),this.ctx.save(),this.ctx.setTransform(...n);const s=I.getAxialAlignedBoundingBox([0,0,e.canvas.width,e.canvas.height],n);this.ctx.drawImage(e.canvas,0,0),this.ctx.restore(),this.compose(s)}}beginAnnotation(t,e,i,n,s){if(this.#t(),ii(this.ctx),this.ctx.save(),this.save(),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),e){const r=e[2]-e[0],a=e[3]-e[1];if(s&&this.annotationCanvasMap){(i=i.slice())[4]-=e[0],i[5]-=e[1],(e=e.slice())[0]=e[1]=0,e[2]=r,e[3]=a;const[l,h]=I.singularValueDecompose2dScale(K(this.ctx)),{viewportScale:c}=this,d=Math.ceil(r*this.outputScaleX*c),u=Math.ceil(a*this.outputScaleY*c);this.annotationCanvas=this.canvasFactory.create(d,u);const{canvas:f,context:p}=this.annotationCanvas;this.annotationCanvasMap.set(t,f),this.annotationCanvas.savedCtx=this.ctx,this.ctx=p,this.ctx.save(),this.ctx.setTransform(l,0,0,-h,0,a*h),ii(this.ctx)}else ii(this.ctx),this.endPath(),this.ctx.rect(e[0],e[1],r,a),this.ctx.clip(),this.ctx.beginPath()}this.current=new Zn(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(...i),this.transform(...n)}endAnnotation(){this.annotationCanvas&&(this.ctx.restore(),this.#e(),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(t){if(!this.contentVisible)return;const e=t.count;(t=this.getObject(t.data,t)).count=e;const i=this.ctx,n=this.processingType3;if(n&&(void 0===n.compiled&&(n.compiled=function ja(o){const{width:t,height:e}=o;if(t>1e3||e>1e3)return null;const n=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),s=t+1;let a,l,h,r=new Uint8Array(s*(e+1));const c=t+7&-8;let d=new Uint8Array(c*e),u=0;for(const m of o.data){let v=128;for(;v>0;)d[u++]=m&v?0:255,v>>=1}let f=0;for(u=0,0!==d[u]&&(r[0]=1,++f),l=1;l<t;l++)d[u]!==d[u+1]&&(r[l]=d[u]?2:1,++f),u++;for(0!==d[u]&&(r[l]=2,++f),a=1;a<e;a++){u=a*c,h=a*s,d[u-c]!==d[u]&&(r[h]=d[u]?1:8,++f);let m=(d[u]?4:0)+(d[u-c]?8:0);for(l=1;l<t;l++)m=(m>>2)+(d[u+1]?4:0)+(d[u-c+1]?8:0),n[m]&&(r[h+l]=n[m],++f),u++;if(d[u-c]!==d[u]&&(r[h+l]=d[u]?2:4,++f),f>1e3)return null}for(u=c*(e-1),h=a*s,0!==d[u]&&(r[h]=8,++f),l=1;l<t;l++)d[u]!==d[u+1]&&(r[h+l]=d[u]?4:8,++f),u++;if(0!==d[u]&&(r[h+l]=4,++f),f>1e3)return null;const p=new Int32Array([0,s,-1,0,-s,0,0,0,1]),g=new Path2D;for(a=0;f&&a<=e;a++){let m=a*s;const v=m+t;for(;m<v&&!r[m];)m++;if(m===v)continue;g.moveTo(m%s,a);const A=m;let w=r[m];do{const E=p[w];do{m+=E}while(!r[m]);const C=r[m];5!==C&&10!==C?(w=C,r[m]=0):(w=C&51*w>>4,r[m]&=w>>2|w<<2),g.lineTo(m%s,m/s|0),r[m]||--f}while(A!==m);--a}return d=null,r=null,function(m){m.save(),m.scale(1/t,-1/e),m.translate(0,-e),m.fill(g),m.beginPath(),m.restore()}}(t)),n.compiled))return void n.compiled(i);const s=this._createMaskCanvas(t),r=s.canvas;i.save(),i.setTransform(1,0,0,1,0,0),i.drawImage(r,s.offsetX,s.offsetY),i.restore(),this.compose()}paintImageMaskXObjectRepeat(t,e,i=0,n=0,s,r){if(!this.contentVisible)return;t=this.getObject(t.data,t);const a=this.ctx;a.save();const l=K(a);a.transform(e,i,n,s,0,0);const h=this._createMaskCanvas(t);a.setTransform(1,0,0,1,h.offsetX-l[4],h.offsetY-l[5]);for(let c=0,d=r.length;c<d;c+=2){const u=I.transform(l,[e,i,n,s,r[c],r[c+1]]),[f,p]=I.applyTransform([0,0],u);a.drawImage(h.canvas,f,p)}a.restore(),this.compose()}paintImageMaskXObjectGroup(t){if(!this.contentVisible)return;const e=this.ctx,i=this.current.fillColor,n=this.current.patternFill;for(const s of t){const{data:r,width:a,height:l,transform:h}=s,c=this.cachedCanvases.getCanvas("maskCanvas",a,l),d=c.context;d.save(),ts(d,this.getObject(r,s)),d.globalCompositeOperation="source-in",d.fillStyle=n?i.getPattern(d,this,Wt(e),"Fill"):i,d.fillRect(0,0,a,l),d.restore(),e.save(),e.transform(...h),e.scale(1,-1),ei(e,c.canvas,0,0,a,l,0,-1,1,1),e.restore()}this.compose()}paintImageXObject(t){if(!this.contentVisible)return;const e=this.getObject(t);e?this.paintInlineImageXObject(e):V("Dependent image isn't ready yet")}paintImageXObjectRepeat(t,e,i,n){if(!this.contentVisible)return;const s=this.getObject(t);if(!s)return void V("Dependent image isn't ready yet");const r=s.width,a=s.height,l=[];for(let h=0,c=n.length;h<c;h+=2)l.push({transform:[e,0,0,i,n[h],n[h+1]],x:0,y:0,w:r,h:a});this.paintInlineImageXObjectGroup(s,l)}applyTransferMapsToCanvas(t){return"none"!==this.current.transferMaps&&(t.filter=this.current.transferMaps,t.drawImage(t.canvas,0,0),t.filter="none"),t.canvas}applyTransferMapsToBitmap(t){if("none"===this.current.transferMaps)return t.bitmap;const{bitmap:e,width:i,height:n}=t,s=this.cachedCanvases.getCanvas("inlineImage",i,n),r=s.context;return r.filter=this.current.transferMaps,r.drawImage(e,0,0),r.filter="none",s.canvas}paintInlineImageXObject(t){if(!this.contentVisible)return;const e=t.width,i=t.height,n=this.ctx;if(this.save(),!ft){const{filter:a}=n;"none"!==a&&""!==a&&(n.filter="none")}let s;if(n.scale(1/e,-1/i),t.bitmap)s=this.applyTransferMapsToBitmap(t);else if("function"==typeof HTMLElement&&t instanceof HTMLElement||!t.data)s=t;else{const l=this.cachedCanvases.getCanvas("inlineImage",e,i).context;Jn(l,t),s=this.applyTransferMapsToCanvas(l)}const r=this._scaleImage(s,Wt(n));n.imageSmoothingEnabled=es(K(n),t.interpolate),ei(n,r.img,0,0,r.paintWidth,r.paintHeight,0,-i,e,i),this.compose(),this.restore()}paintInlineImageXObjectGroup(t,e){if(!this.contentVisible)return;const i=this.ctx;let n;if(t.bitmap)n=t.bitmap;else{const l=this.cachedCanvases.getCanvas("inlineImage",t.width,t.height).context;Jn(l,t),n=this.applyTransferMapsToCanvas(l)}for(const s of e)i.save(),i.transform(...s.transform),i.scale(1,-1),ei(i,n,s.x,s.y,s.w,s.h,0,-1,1,1),i.restore();this.compose()}paintSolidColorImageMask(){this.contentVisible&&(this.ctx.fillRect(0,0,1,1),this.compose())}markPoint(t){}markPointProps(t,e){}beginMarkedContent(t){this.markedContentStack.push({visible:!0})}beginMarkedContentProps(t,e){this.markedContentStack.push("OC"===t?{visible:this.optionalContentConfig.isVisible(e)}:{visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(){this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(){}endCompat(){}consumePath(t){const e=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(t);const i=this.ctx;this.pendingClip&&(e||(this.pendingClip===is?i.clip("evenodd"):i.clip()),this.pendingClip=null),this.current.startNewPathAndClipBox(this.current.clipBox),i.beginPath()}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){const t=K(this.ctx);if(0===t[1]&&0===t[2])this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(t[0]),Math.abs(t[3]));else{const e=Math.abs(t[0]*t[3]-t[2]*t[1]),i=Math.hypot(t[0],t[2]),n=Math.hypot(t[1],t[3]);this._cachedGetSinglePixelWidth=Math.max(i,n)/e}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(-1===this._cachedScaleForStroking[0]){const{lineWidth:t}=this.current,{a:e,b:i,c:n,d:s}=this.ctx.getTransform();let r,a;if(0===i&&0===n){const l=Math.abs(e),h=Math.abs(s);if(l===h)if(0===t)r=a=1/l;else{const c=l*t;r=a=c<1?1/c:1}else if(0===t)r=1/l,a=1/h;else{const c=l*t,d=h*t;r=c<1?1/c:1,a=d<1?1/d:1}}else{const l=Math.abs(e*s-i*n),h=Math.hypot(e,i),c=Math.hypot(n,s);if(0===t)r=c/l,a=h/l;else{const d=t*l;r=c>d?c/d:1,a=h>d?h/d:1}}this._cachedScaleForStroking[0]=r,this._cachedScaleForStroking[1]=a}return this._cachedScaleForStroking}rescaleAndStroke(t){const{ctx:e}=this,{lineWidth:i}=this.current,[n,s]=this.getScaleForStroking();if(e.lineWidth=i||1,1===n&&1===s)return void e.stroke();const r=e.getLineDash();if(t&&e.save(),e.scale(n,s),r.length>0){const a=Math.max(n,s);e.setLineDash(r.map(l=>l/a)),e.lineDashOffset/=a}e.stroke(),t&&e.restore()}isContentVisible(){for(let t=this.markedContentStack.length-1;t>=0;t--)if(!this.markedContentStack[t].visible)return!1;return!0}}for(const o in kt)void 0!==fe.prototype[o]&&(fe.prototype[kt[o]]=fe.prototype[o]);class Le{static#t=null;static#e="";static get workerPort(){return this.#t}static set workerPort(t){if(!(typeof Worker<"u"&&t instanceof Worker)&&null!==t)throw new Error("Invalid `workerPort` type.");this.#t=t}static get workerSrc(){return this.#e}static set workerSrc(t){if("string"!=typeof t)throw new Error("Invalid `workerSrc` type.");this.#e=t}}function Ct(o){switch(o instanceof Error||"object"==typeof o&&null!==o||X('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),o.name){case"AbortException":return new ne(o.message);case"MissingPDFException":return new ie(o.message);case"PasswordException":return new Si(o.message,o.code);case"UnexpectedResponseException":return new qe(o.message,o.status);case"UnknownErrorException":return new Pi(o.message,o.details);default:return new Pi(o.message,o.toString())}}class Re{#t=new AbortController;constructor(t,e,i){this.sourceName=t,this.targetName=e,this.comObj=i,this.callbackId=1,this.streamId=1,this.streamSinks=Object.create(null),this.streamControllers=Object.create(null),this.callbackCapabilities=Object.create(null),this.actionHandler=Object.create(null),i.addEventListener("message",this.#e.bind(this),{signal:this.#t.signal})}#e({data:t}){if(t.targetName!==this.sourceName)return;if(t.stream)return void this.#n(t);if(t.callback){const i=t.callbackId,n=this.callbackCapabilities[i];if(!n)throw new Error(`Cannot resolve callback ${i}`);if(delete this.callbackCapabilities[i],1===t.callback)n.resolve(t.data);else{if(2!==t.callback)throw new Error("Unexpected callback case");n.reject(Ct(t.reason))}return}const e=this.actionHandler[t.action];if(!e)throw new Error(`Unknown action from worker: ${t.action}`);if(t.callbackId){const i=this.sourceName,n=t.sourceName,s=this.comObj;return void new Promise(function(r){r(e(t.data))}).then(function(r){s.postMessage({sourceName:i,targetName:n,callback:1,callbackId:t.callbackId,data:r})},function(r){s.postMessage({sourceName:i,targetName:n,callback:2,callbackId:t.callbackId,reason:Ct(r)})})}t.streamId?this.#i(t):e(t.data)}on(t,e){const i=this.actionHandler;if(i[t])throw new Error(`There is already an actionName called "${t}"`);i[t]=e}send(t,e,i){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,data:e},i)}sendWithPromise(t,e,i){const n=this.callbackId++,s=Promise.withResolvers();this.callbackCapabilities[n]=s;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,callbackId:n,data:e},i)}catch(r){s.reject(r)}return s.promise}sendWithStream(t,e,i,n){const s=this.streamId++,r=this.sourceName,a=this.targetName,l=this.comObj;return new ReadableStream({start:h=>{const c=Promise.withResolvers();return this.streamControllers[s]={controller:h,startCall:c,pullCall:null,cancelCall:null,isClosed:!1},l.postMessage({sourceName:r,targetName:a,action:t,streamId:s,data:e,desiredSize:h.desiredSize},n),c.promise},pull:h=>{const c=Promise.withResolvers();return this.streamControllers[s].pullCall=c,l.postMessage({sourceName:r,targetName:a,stream:6,streamId:s,desiredSize:h.desiredSize}),c.promise},cancel:h=>{lt(h instanceof Error,"cancel must have a valid reason");const c=Promise.withResolvers();return this.streamControllers[s].cancelCall=c,this.streamControllers[s].isClosed=!0,l.postMessage({sourceName:r,targetName:a,stream:1,streamId:s,reason:Ct(h)}),c.promise}},i)}#i(t){const e=t.streamId,i=this.sourceName,n=t.sourceName,s=this.comObj,r=this,a=this.actionHandler[t.action],l={enqueue(h,c=1,d){if(this.isCancelled)return;const u=this.desiredSize;this.desiredSize-=c,u>0&&this.desiredSize<=0&&(this.sinkCapability=Promise.withResolvers(),this.ready=this.sinkCapability.promise),s.postMessage({sourceName:i,targetName:n,stream:4,streamId:e,chunk:h},d)},close(){this.isCancelled||(this.isCancelled=!0,s.postMessage({sourceName:i,targetName:n,stream:3,streamId:e}),delete r.streamSinks[e])},error(h){lt(h instanceof Error,"error must have a valid reason"),!this.isCancelled&&(this.isCancelled=!0,s.postMessage({sourceName:i,targetName:n,stream:5,streamId:e,reason:Ct(h)}))},sinkCapability:Promise.withResolvers(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:t.desiredSize,ready:null};l.sinkCapability.resolve(),l.ready=l.sinkCapability.promise,this.streamSinks[e]=l,new Promise(function(h){h(a(t.data,l))}).then(function(){s.postMessage({sourceName:i,targetName:n,stream:8,streamId:e,success:!0})},function(h){s.postMessage({sourceName:i,targetName:n,stream:8,streamId:e,reason:Ct(h)})})}#n(t){const e=t.streamId,i=this.sourceName,n=t.sourceName,s=this.comObj,r=this.streamControllers[e],a=this.streamSinks[e];switch(t.stream){case 8:t.success?r.startCall.resolve():r.startCall.reject(Ct(t.reason));break;case 7:t.success?r.pullCall.resolve():r.pullCall.reject(Ct(t.reason));break;case 6:if(!a){s.postMessage({sourceName:i,targetName:n,stream:7,streamId:e,success:!0});break}a.desiredSize<=0&&t.desiredSize>0&&a.sinkCapability.resolve(),a.desiredSize=t.desiredSize,new Promise(function(l){l(a.onPull?.())}).then(function(){s.postMessage({sourceName:i,targetName:n,stream:7,streamId:e,success:!0})},function(l){s.postMessage({sourceName:i,targetName:n,stream:7,streamId:e,reason:Ct(l)})});break;case 4:if(lt(r,"enqueue should have stream controller"),r.isClosed)break;r.controller.enqueue(t.chunk);break;case 3:if(lt(r,"close should have stream controller"),r.isClosed)break;r.isClosed=!0,r.controller.close(),this.#s(r,e);break;case 5:lt(r,"error should have stream controller"),r.controller.error(Ct(t.reason)),this.#s(r,e);break;case 2:t.success?r.cancelCall.resolve():r.cancelCall.reject(Ct(t.reason)),this.#s(r,e);break;case 1:if(!a)break;new Promise(function(l){l(a.onCancel?.(Ct(t.reason)))}).then(function(){s.postMessage({sourceName:i,targetName:n,stream:2,streamId:e,success:!0})},function(l){s.postMessage({sourceName:i,targetName:n,stream:2,streamId:e,reason:Ct(l)})}),a.sinkCapability.reject(Ct(t.reason)),a.isCancelled=!0,delete this.streamSinks[e];break;default:throw new Error("Unexpected stream case")}}#s(t,e){var i=this;return(0,x.A)(function*(){yield Promise.allSettled([t.startCall?.promise,t.pullCall?.promise,t.cancelCall?.promise]),delete i.streamControllers[e]})()}destroy(){this.#t?.abort(),this.#t=null}}class Ua{#t;#e;constructor({parsedData:t,rawData:e}){this.#t=t,this.#e=e}getRaw(){return this.#e}get(t){return this.#t.get(t)??null}getAll(){return Ti(this.#t)}has(t){return this.#t.has(t)}}const pe=Symbol("INTERNAL");class Ga{#t=!1;#e=!1;#i=!1;#n=!0;constructor(t,{name:e,intent:i,usage:n,rbGroups:s}){this.#t=!!(2&t),this.#e=!!(4&t),this.name=e,this.intent=i,this.usage=n,this.rbGroups=s}get visible(){if(this.#i)return this.#n;if(!this.#n)return!1;const{print:t,view:e}=this.usage;return this.#t?"OFF"!==e?.viewState:!this.#e||"OFF"!==t?.printState}_setVisible(t,e,i=!1){t!==pe&&X("Internal method `_setVisible` called."),this.#i=i,this.#n=e}}class $a{#t=null;#e=new Map;#i=null;#n=null;constructor(t,e=2){if(this.renderingIntent=e,this.name=null,this.creator=null,null!==t){this.name=t.name,this.creator=t.creator,this.#n=t.order;for(const i of t.groups)this.#e.set(i.id,new Ga(e,i));if("OFF"===t.baseState)for(const i of this.#e.values())i._setVisible(pe,!1);for(const i of t.on)this.#e.get(i)._setVisible(pe,!0);for(const i of t.off)this.#e.get(i)._setVisible(pe,!1);this.#i=this.getHash()}}#s(t){const e=t.length;if(e<2)return!0;const i=t[0];for(let n=1;n<e;n++){const s=t[n];let r;if(Array.isArray(s))r=this.#s(s);else{if(!this.#e.has(s))return V(`Optional content group not found: ${s}`),!0;r=this.#e.get(s).visible}switch(i){case"And":if(!r)return!1;break;case"Or":if(r)return!0;break;case"Not":return!r;default:return!0}}return"And"===i}isVisible(t){if(0===this.#e.size)return!0;if(!t)return Ke("Optional content group not defined."),!0;if("OCG"===t.type)return this.#e.has(t.id)?this.#e.get(t.id).visible:(V(`Optional content group not found: ${t.id}`),!0);if("OCMD"===t.type){if(t.expression)return this.#s(t.expression);if(!t.policy||"AnyOn"===t.policy){for(const e of t.ids){if(!this.#e.has(e))return V(`Optional content group not found: ${e}`),!0;if(this.#e.get(e).visible)return!0}return!1}if("AllOn"===t.policy){for(const e of t.ids){if(!this.#e.has(e))return V(`Optional content group not found: ${e}`),!0;if(!this.#e.get(e).visible)return!1}return!0}if("AnyOff"===t.policy){for(const e of t.ids){if(!this.#e.has(e))return V(`Optional content group not found: ${e}`),!0;if(!this.#e.get(e).visible)return!0}return!1}if("AllOff"===t.policy){for(const e of t.ids){if(!this.#e.has(e))return V(`Optional content group not found: ${e}`),!0;if(this.#e.get(e).visible)return!1}return!0}return V(`Unknown optional content policy ${t.policy}.`),!0}return V(`Unknown group type ${t.type}.`),!0}setVisibility(t,e=!0,i=!0){const n=this.#e.get(t);if(n){if(i&&e&&n.rbGroups.length)for(const s of n.rbGroups)for(const r of s)r!==t&&this.#e.get(r)?._setVisible(pe,!1,!0);n._setVisible(pe,!!e,!0),this.#t=null}else V(`Optional content group not found: ${t}`)}setOCGState({state:t,preserveRB:e}){let i;for(const n of t){switch(n){case"ON":case"OFF":case"Toggle":i=n;continue}const s=this.#e.get(n);if(s)switch(i){case"ON":this.setVisibility(n,!0,e);break;case"OFF":this.setVisibility(n,!1,e);break;case"Toggle":this.setVisibility(n,!s.visible,e)}}this.#t=null}get hasInitialVisibility(){return null===this.#i||this.getHash()===this.#i}getOrder(){return this.#e.size?this.#n?this.#n.slice():[...this.#e.keys()]:null}getGroups(){return this.#e.size>0?Ti(this.#e):null}getGroup(t){return this.#e.get(t)||null}getHash(){if(null!==this.#t)return this.#t;const t=new Nn;for(const[e,i]of this.#e)t.update(`${e}:${i.visible}`);return this.#t=t.hexdigest()}}class Xa{constructor(t,{disableRange:e=!1,disableStream:i=!1}){lt(t,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.');const{length:n,initialData:s,progressiveDone:r,contentDispositionFilename:a}=t;if(this._queuedChunks=[],this._progressiveDone=r,this._contentDispositionFilename=a,s?.length>0){const l=s instanceof Uint8Array&&s.byteLength===s.buffer.byteLength?s.buffer:new Uint8Array(s).buffer;this._queuedChunks.push(l)}this._pdfDataRangeTransport=t,this._isStreamingSupported=!i,this._isRangeSupported=!e,this._contentLength=n,this._fullRequestReader=null,this._rangeReaders=[],t.addRangeListener((l,h)=>{this._onReceiveData({begin:l,chunk:h})}),t.addProgressListener((l,h)=>{this._onProgress({loaded:l,total:h})}),t.addProgressiveReadListener(l=>{this._onReceiveData({chunk:l})}),t.addProgressiveDoneListener(()=>{this._onProgressiveDone()}),t.transportReady()}_onReceiveData({begin:t,chunk:e}){const i=e instanceof Uint8Array&&e.byteLength===e.buffer.byteLength?e.buffer:new Uint8Array(e).buffer;void 0===t?this._fullRequestReader?this._fullRequestReader._enqueue(i):this._queuedChunks.push(i):lt(this._rangeReaders.some(function(s){return s._begin===t&&(s._enqueue(i),!0)}),"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}_onProgress(t){void 0===t.total?this._rangeReaders[0]?.onProgress?.({loaded:t.loaded}):this._fullRequestReader?.onProgress?.({loaded:t.loaded,total:t.total})}_onProgressiveDone(){this._fullRequestReader?.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(t){const e=this._rangeReaders.indexOf(t);e>=0&&this._rangeReaders.splice(e,1)}getFullReader(){lt(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const t=this._queuedChunks;return this._queuedChunks=null,new Ya(this,t,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const i=new Ka(this,t,e);return this._pdfDataRangeTransport.requestDataRange(t,e),this._rangeReaders.push(i),i}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const e of this._rangeReaders.slice(0))e.cancel(t);this._pdfDataRangeTransport.abort()}}class Ya{constructor(t,e,i=!1,n=null){this._stream=t,this._done=i||!1,this._filename=ki(n)?n:null,this._queuedChunks=e||[],this._loaded=0;for(const s of this._queuedChunks)this._loaded+=s.byteLength;this._requests=[],this._headersReady=Promise.resolve(),t._fullRequestReader=this,this.onProgress=null}_enqueue(t){this._done||(this._requests.length>0?this._requests.shift().resolve({value:t,done:!1}):this._queuedChunks.push(t),this._loaded+=t.byteLength)}get headersReady(){return this._headersReady}get filename(){return this._filename}get isRangeSupported(){return this._stream._isRangeSupported}get isStreamingSupported(){return this._stream._isStreamingSupported}get contentLength(){return this._stream._contentLength}read(){var t=this;return(0,x.A)(function*(){if(t._queuedChunks.length>0)return{value:t._queuedChunks.shift(),done:!1};if(t._done)return{value:void 0,done:!0};const e=Promise.withResolvers();return t._requests.push(e),e.promise})()}cancel(t){this._done=!0;for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class Ka{constructor(t,e,i){this._stream=t,this._begin=e,this._end=i,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(t){if(!this._done){if(0===this._requests.length)this._queuedChunk=t;else{this._requests.shift().resolve({value:t,done:!1});for(const i of this._requests)i.resolve({value:void 0,done:!0});this._requests.length=0}this._done=!0,this._stream._removeRangeReader(this)}}get isStreamingSupported(){return!1}read(){var t=this;return(0,x.A)(function*(){if(t._queuedChunk){const i=t._queuedChunk;return t._queuedChunk=null,{value:i,done:!1}}if(t._done)return{value:void 0,done:!0};const e=Promise.withResolvers();return t._requests.push(e),e.promise})()}cancel(t){this._done=!0;for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}}function $i(o,t){const e=new Headers;if(!o||!t||"object"!=typeof t)return e;for(const i in t){const n=t[i];void 0!==n&&e.append(i,n)}return e}function Xi({responseHeaders:o,isHttp:t,rangeChunkSize:e,disableRange:i}){const n={allowRangeRequests:!1,suggestedLength:void 0},s=parseInt(o.get("Content-Length"),10);return!Number.isInteger(s)||(n.suggestedLength=s,s<=2*e)||i||!t||"bytes"!==o.get("Accept-Ranges")||"identity"!==(o.get("Content-Encoding")||"identity")||(n.allowRangeRequests=!0),n}function Yi(o){const t=o.get("Content-Disposition");if(t){let e=function qa(o){let t=!0,e=i("filename\\*","i").exec(o);if(e){e=e[1];let c=a(e);return c=unescape(c),c=l(c),c=h(c),s(c)}if(e=function r(c){const d=[];let u;const f=i("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;null!==(u=f.exec(c));){let[,g,b,m]=u;if(g=parseInt(g,10),g in d){if(0===g)break}else d[g]=[b,m]}const p=[];for(let g=0;g<d.length&&g in d;++g){let[b,m]=d[g];m=a(m),b&&(m=unescape(m),0===g&&(m=l(m))),p.push(m)}return p.join("")}(o),e)return s(h(e));if(e=i("filename","i").exec(o),e){e=e[1];let c=a(e);return c=h(c),s(c)}function i(c,d){return new RegExp("(?:^|;)\\s*"+c+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',d)}function n(c,d){if(c){if(!/^[\x00-\xFF]+$/.test(d))return d;try{const u=new TextDecoder(c,{fatal:!0}),f=de(d);d=u.decode(f),t=!1}catch{}}return d}function s(c){return t&&/[\x80-\xff]/.test(c)&&(c=n("utf-8",c),t&&(c=n("iso-8859-1",c))),c}function a(c){if(c.startsWith('"')){const d=c.slice(1).split('\\"');for(let u=0;u<d.length;++u){const f=d[u].indexOf('"');-1!==f&&(d[u]=d[u].slice(0,f),d.length=u+1),d[u]=d[u].replaceAll(/\\(.)/g,"$1")}c=d.join('"')}return c}function l(c){const d=c.indexOf("'");return-1===d?c:n(c.slice(0,d),c.slice(d+1).replace(/^[^']*'/,""))}function h(c){return!c.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(c)?c:c.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,function(d,u,f,p){if("q"===f||"Q"===f)return n(u,p=(p=p.replaceAll("_"," ")).replaceAll(/=([0-9a-fA-F]{2})/g,function(g,b){return String.fromCharCode(parseInt(b,16))}));try{p=atob(p)}catch{}return n(u,p)})}return""}(t);if(e.includes("%"))try{e=decodeURIComponent(e)}catch{}if(ki(e))return e}return null}function si(o,t){return 404===o||0===o&&t.startsWith("file:")?new ie('Missing PDF "'+t+'".'):new qe(`Unexpected server response (${o}) while retrieving PDF "${t}".`,o)}function ns(o){return 200===o||206===o}function ss(o,t,e){return{method:"GET",headers:o,signal:e.signal,mode:"cors",credentials:t?"include":"same-origin",redirect:"follow"}}function rs(o){return o instanceof Uint8Array?o.buffer:o instanceof ArrayBuffer?o:(V(`getArrayBuffer - unexpected data format: ${o}`),new Uint8Array(o).buffer)}class as{constructor(t){this.source=t,this.isHttp=/^https?:/i.test(t.url),this.headers=$i(this.isHttp,t.httpHeaders),this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return lt(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new Qa(this),this._fullRequestReader}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const i=new Za(this,t,e);return this._rangeRequestReaders.push(i),i}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const e of this._rangeRequestReaders.slice(0))e.cancel(t)}}class Qa{constructor(t){this._stream=t,this._reader=null,this._loaded=0,this._filename=null;const e=t.source;this._withCredentials=e.withCredentials||!1,this._contentLength=e.length,this._headersCapability=Promise.withResolvers(),this._disableRange=e.disableRange||!1,this._rangeChunkSize=e.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._abortController=new AbortController,this._isStreamingSupported=!e.disableStream,this._isRangeSupported=!e.disableRange;const i=new Headers(t.headers),n=e.url;fetch(n,ss(i,this._withCredentials,this._abortController)).then(s=>{if(!ns(s.status))throw si(s.status,n);this._reader=s.body.getReader(),this._headersCapability.resolve();const r=s.headers,{allowRangeRequests:a,suggestedLength:l}=Xi({responseHeaders:r,isHttp:t.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=a,this._contentLength=l||this._contentLength,this._filename=Yi(r),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new ne("Streaming is disabled."))}).catch(this._headersCapability.reject),this.onProgress=null}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}read(){var t=this;return(0,x.A)(function*(){yield t._headersCapability.promise;const{value:e,done:i}=yield t._reader.read();return i?{value:e,done:i}:(t._loaded+=e.byteLength,t.onProgress?.({loaded:t._loaded,total:t._contentLength}),{value:rs(e),done:!1})})()}cancel(t){this._reader?.cancel(t),this._abortController.abort()}}class Za{constructor(t,e,i){this._stream=t,this._reader=null,this._loaded=0;const n=t.source;this._withCredentials=n.withCredentials||!1,this._readCapability=Promise.withResolvers(),this._isStreamingSupported=!n.disableStream,this._abortController=new AbortController;const s=new Headers(t.headers);s.append("Range",`bytes=${e}-${i-1}`);const r=n.url;fetch(r,ss(s,this._withCredentials,this._abortController)).then(a=>{if(!ns(a.status))throw si(a.status,r);this._readCapability.resolve(),this._reader=a.body.getReader()}).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}read(){var t=this;return(0,x.A)(function*(){yield t._readCapability.promise;const{value:e,done:i}=yield t._reader.read();return i?{value:e,done:i}:(t._loaded+=e.byteLength,t.onProgress?.({loaded:t._loaded}),{value:rs(e),done:!1})})()}cancel(t){this._reader?.cancel(t),this._abortController.abort()}}class to{constructor({url:t,httpHeaders:e,withCredentials:i}){this.url=t,this.isHttp=/^https?:/i.test(t),this.headers=$i(this.isHttp,e),this.withCredentials=i||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}requestRange(t,e,i){const n={begin:t,end:e};for(const s in i)n[s]=i[s];return this.request(n)}requestFull(t){return this.request(t)}request(t){const e=new XMLHttpRequest,i=this.currXhrId++,n=this.pendingRequests[i]={xhr:e};e.open("GET",this.url),e.withCredentials=this.withCredentials;for(const[s,r]of this.headers)e.setRequestHeader(s,r);return this.isHttp&&"begin"in t&&"end"in t?(e.setRequestHeader("Range",`bytes=${t.begin}-${t.end-1}`),n.expectedStatus=206):n.expectedStatus=200,e.responseType="arraybuffer",t.onError&&(e.onerror=function(s){t.onError(e.status)}),e.onreadystatechange=this.onStateChange.bind(this,i),e.onprogress=this.onProgress.bind(this,i),n.onHeadersReceived=t.onHeadersReceived,n.onDone=t.onDone,n.onError=t.onError,n.onProgress=t.onProgress,e.send(null),i}onProgress(t,e){const i=this.pendingRequests[t];i&&i.onProgress?.(e)}onStateChange(t,e){const i=this.pendingRequests[t];if(!i)return;const n=i.xhr;if(n.readyState>=2&&i.onHeadersReceived&&(i.onHeadersReceived(),delete i.onHeadersReceived),4!==n.readyState||!(t in this.pendingRequests))return;if(delete this.pendingRequests[t],0===n.status&&this.isHttp)return void i.onError?.(n.status);const s=n.status||200;if((200!==s||206!==i.expectedStatus)&&s!==i.expectedStatus)return void i.onError?.(n.status);const a=function Ja(o){const t=o.response;return"string"!=typeof t?t:de(t).buffer}(n);if(206===s){const l=n.getResponseHeader("Content-Range"),h=/bytes (\d+)-(\d+)\/(\d+)/.exec(l);i.onDone({begin:parseInt(h[1],10),chunk:a})}else a?i.onDone({begin:0,chunk:a}):i.onError?.(n.status)}getRequestXhr(t){return this.pendingRequests[t].xhr}isPendingRequest(t){return t in this.pendingRequests}abortRequest(t){const e=this.pendingRequests[t].xhr;delete this.pendingRequests[t],e.abort()}}class eo{constructor(t){this._source=t,this._manager=new to(t),this._rangeChunkSize=t.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(t){const e=this._rangeRequestReaders.indexOf(t);e>=0&&this._rangeRequestReaders.splice(e,1)}getFullReader(){return lt(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new io(this._manager,this._source),this._fullRequestReader}getRangeReader(t,e){const i=new no(this._manager,t,e);return i.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(i),i}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const e of this._rangeRequestReaders.slice(0))e.cancel(t)}}class io{constructor(t,e){this._manager=t;const i={onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=e.url,this._fullRequestId=t.requestFull(i),this._headersCapability=Promise.withResolvers(),this._disableRange=e.disableRange||!1,this._contentLength=e.length,this._rangeChunkSize=e.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!1,this._isRangeSupported=!1,this._cachedChunks=[],this._requests=[],this._done=!1,this._storedError=void 0,this._filename=null,this.onProgress=null}_onHeadersReceived(){const t=this._fullRequestId,e=this._manager.getRequestXhr(t),i=new Headers(e.getAllResponseHeaders().trim().split(/[\r\n]+/).map(r=>{const[a,...l]=r.split(": ");return[a,l.join(": ")]})),{allowRangeRequests:n,suggestedLength:s}=Xi({responseHeaders:i,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});n&&(this._isRangeSupported=!0),this._contentLength=s||this._contentLength,this._filename=Yi(i),this._isRangeSupported&&this._manager.abortRequest(t),this._headersCapability.resolve()}_onDone(t){if(t&&(this._requests.length>0?this._requests.shift().resolve({value:t.chunk,done:!1}):this._cachedChunks.push(t.chunk)),this._done=!0,!(this._cachedChunks.length>0)){for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(t){this._storedError=si(t,this._url),this._headersCapability.reject(this._storedError);for(const e of this._requests)e.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(t){this.onProgress?.({loaded:t.loaded,total:t.lengthComputable?t.total:this._contentLength})}get filename(){return this._filename}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}get contentLength(){return this._contentLength}get headersReady(){return this._headersCapability.promise}read(){var t=this;return(0,x.A)(function*(){if(t._storedError)throw t._storedError;if(t._cachedChunks.length>0)return{value:t._cachedChunks.shift(),done:!1};if(t._done)return{value:void 0,done:!0};const e=Promise.withResolvers();return t._requests.push(e),e.promise})()}cancel(t){this._done=!0,this._headersCapability.reject(t);for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}}class no{constructor(t,e,i){this._manager=t;const n={onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=t.url,this._requestId=t.requestRange(e,i,n),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_close(){this.onClosed?.(this)}_onDone(t){const e=t.chunk;this._requests.length>0?this._requests.shift().resolve({value:e,done:!1}):this._queuedChunk=e,this._done=!0;for(const i of this._requests)i.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(t){this._storedError=si(t,this._url);for(const e of this._requests)e.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(t){this.isStreamingSupported||this.onProgress?.({loaded:t.loaded})}get isStreamingSupported(){return!1}read(){var t=this;return(0,x.A)(function*(){if(t._storedError)throw t._storedError;if(null!==t._queuedChunk){const i=t._queuedChunk;return t._queuedChunk=null,{value:i,done:!1}}if(t._done)return{value:void 0,done:!0};const e=Promise.withResolvers();return t._requests.push(e),e.promise})()}cancel(t){this._done=!0;for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}}const so=/^[a-z][a-z0-9\-+.]+:/i;function os(o,t,e){return"http:"===o.protocol?Zt.get("http").request(o,{headers:t},e):Zt.get("https").request(o,{headers:t},e)}class ao{constructor(t){this.source=t,this.url=function ro(o){if(so.test(o))return new URL(o);const t=Zt.get("url");return new URL(t.pathToFileURL(o))}(t.url),this.isHttp="http:"===this.url.protocol||"https:"===this.url.protocol,this.isFsUrl="file:"===this.url.protocol,this.headers=$i(this.isHttp,t.httpHeaders),this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return lt(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=this.isFsUrl?new ho(this):new oo(this),this._fullRequestReader}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const i=this.isFsUrl?new co(this,t,e):new lo(this,t,e);return this._rangeRequestReaders.push(i),i}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const e of this._rangeRequestReaders.slice(0))e.cancel(t)}}class ls{constructor(t){this._url=t.url,this._done=!1,this._storedError=null,this.onProgress=null;const e=t.source;this._contentLength=e.length,this._loaded=0,this._filename=null,this._disableRange=e.disableRange||!1,this._rangeChunkSize=e.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!e.disableStream,this._isRangeSupported=!e.disableRange,this._readableStream=null,this._readCapability=Promise.withResolvers(),this._headersCapability=Promise.withResolvers()}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}read(){var t=this;return(0,x.A)(function*(){if(yield t._readCapability.promise,t._done)return{value:void 0,done:!0};if(t._storedError)throw t._storedError;const e=t._readableStream.read();return null===e?(t._readCapability=Promise.withResolvers(),t.read()):(t._loaded+=e.length,t.onProgress?.({loaded:t._loaded,total:t._contentLength}),{value:new Uint8Array(e).buffer,done:!1})})()}cancel(t){this._readableStream?this._readableStream.destroy(t):this._error(t)}_error(t){this._storedError=t,this._readCapability.resolve()}_setReadableStream(t){this._readableStream=t,t.on("readable",()=>{this._readCapability.resolve()}),t.on("end",()=>{t.destroy(),this._done=!0,this._readCapability.resolve()}),t.on("error",e=>{this._error(e)}),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new ne("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class hs{constructor(t){this._url=t.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=Promise.withResolvers(),this._isStreamingSupported=!t.source.disableStream}get isStreamingSupported(){return this._isStreamingSupported}read(){var t=this;return(0,x.A)(function*(){if(yield t._readCapability.promise,t._done)return{value:void 0,done:!0};if(t._storedError)throw t._storedError;const e=t._readableStream.read();return null===e?(t._readCapability=Promise.withResolvers(),t.read()):(t._loaded+=e.length,t.onProgress?.({loaded:t._loaded}),{value:new Uint8Array(e).buffer,done:!1})})()}cancel(t){this._readableStream?this._readableStream.destroy(t):this._error(t)}_error(t){this._storedError=t,this._readCapability.resolve()}_setReadableStream(t){this._readableStream=t,t.on("readable",()=>{this._readCapability.resolve()}),t.on("end",()=>{t.destroy(),this._done=!0,this._readCapability.resolve()}),t.on("error",e=>{this._error(e)}),this._storedError&&this._readableStream.destroy(this._storedError)}}class oo extends ls{constructor(t){super(t);const e=Object.fromEntries(t.headers);this._request=os(this._url,e,n=>{if(404===n.statusCode){const l=new ie(`Missing PDF "${this._url}".`);return this._storedError=l,void this._headersCapability.reject(l)}this._headersCapability.resolve(),this._setReadableStream(n);const s=new Headers(this._readableStream.headers),{allowRangeRequests:r,suggestedLength:a}=Xi({responseHeaders:s,isHttp:t.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=r,this._contentLength=a||this._contentLength,this._filename=Yi(s)}),this._request.on("error",n=>{this._storedError=n,this._headersCapability.reject(n)}),this._request.end()}}class lo extends hs{constructor(t,e,i){super(t);const n=Object.fromEntries(t.headers);n.Range=`bytes=${e}-${i-1}`,this._request=os(this._url,n,r=>{if(404===r.statusCode){const a=new ie(`Missing PDF "${this._url}".`);return void(this._storedError=a)}this._setReadableStream(r)}),this._request.on("error",r=>{this._storedError=r}),this._request.end()}}class ho extends ls{constructor(t){super(t);const e=Zt.get("fs");e.promises.lstat(this._url).then(i=>{this._contentLength=i.size,this._setReadableStream(e.createReadStream(this._url)),this._headersCapability.resolve()},i=>{"ENOENT"===i.code&&(i=new ie(`Missing PDF "${this._url}".`)),this._storedError=i,this._headersCapability.reject(i)})}}class co extends hs{constructor(t,e,i){super(t);const n=Zt.get("fs");this._setReadableStream(n.createReadStream(this._url,{start:e,end:i-1}))}}class vt{#t=Promise.withResolvers();#e=null;#i=!1;#n=!!globalThis.FontInspector?.enabled;#s=null;#r=null;#l=0;#h=0;#c=null;#o=null;#d=0;#a=0;#u=Object.create(null);#p=[];#f=null;#g=[];#b=new WeakMap;#m=null;static#_=new Map;static#A=new Map;static#E=new WeakMap;static#y=null;static#w=new Set;constructor({textContentSource:t,container:e,viewport:i}){if(t instanceof ReadableStream)this.#f=t;else{if("object"!=typeof t)throw new Error('No "textContentSource" parameter specified.');this.#f=new ReadableStream({start(l){l.enqueue(t),l.close()}})}this.#e=this.#o=e,this.#a=i.scale*(globalThis.devicePixelRatio||1),this.#d=i.rotation,this.#r={div:null,properties:null,ctx:null};const{pageWidth:n,pageHeight:s,pageX:r,pageY:a}=i.rawDims;this.#m=[1,0,0,-1,-r,a+s],this.#h=n,this.#l=s,vt.#R(),se(e,i),this.#t.promise.finally(()=>{vt.#w.delete(this),this.#r=null,this.#u=null}).catch(()=>{})}static get fontFamilyMap(){const{isWindows:t,isFirefox:e}=bt.platform;return U(this,"fontFamilyMap",new Map([["sans-serif",(t&&e?"Calibri, ":"")+"sans-serif"],["monospace",(t&&e?"Lucida Console, ":"")+"monospace"]]))}render(){const t=()=>{this.#c.read().then(({value:e,done:i})=>{i?this.#t.resolve():(this.#s??=e.lang,Object.assign(this.#u,e.styles),this.#L(e.items),t())},this.#t.reject)};return this.#c=this.#f.getReader(),vt.#w.add(this),t(),this.#t.promise}update({viewport:t,onBefore:e=null}){const i=t.scale*(globalThis.devicePixelRatio||1),n=t.rotation;if(n!==this.#d&&(e?.(),this.#d=n,se(this.#o,{rotation:n})),i!==this.#a){e?.(),this.#a=i;const s={div:null,properties:null,ctx:vt.#T(this.#s)};for(const r of this.#g)s.properties=this.#b.get(r),s.div=r,this.#x(s)}}cancel(){const t=new ne("TextLayer task cancelled.");this.#c?.cancel(t).catch(()=>{}),this.#c=null,this.#t.reject(t)}get textDivs(){return this.#g}get textContentItemsStr(){return this.#p}#L(t){if(this.#i)return;this.#r.ctx??=vt.#T(this.#s);const e=this.#g,i=this.#p;for(const n of t){if(e.length>1e5)return V("Ignoring additional textDivs for performance reasons."),void(this.#i=!0);if(void 0!==n.str)i.push(n.str),this.#P(n);else if("beginMarkedContentProps"===n.type||"beginMarkedContent"===n.type){const s=this.#e;this.#e=document.createElement("span"),this.#e.classList.add("markedContent"),null!==n.id&&this.#e.setAttribute("id",`${n.id}`),s.append(this.#e)}else"endMarkedContent"===n.type&&(this.#e=this.#e.parentNode)}}#P(t){const e=document.createElement("span"),i={angle:0,canvasWidth:0,hasText:""!==t.str,hasEOL:t.hasEOL,fontSize:0};this.#g.push(e);const n=I.transform(this.#m,t.transform);let s=Math.atan2(n[1],n[0]);const r=this.#u[t.fontName];r.vertical&&(s+=Math.PI/2);let a=this.#n&&r.fontSubstitution||r.fontFamily;a=vt.fontFamilyMap.get(a)||a;const l=Math.hypot(n[2],n[3]),h=l*vt.#k(a,this.#s);let c,d;0===s?(c=n[4],d=n[5]-h):(c=n[4]+h*Math.sin(s),d=n[5]-h*Math.cos(s));const u="calc(var(--scale-factor)*",f=e.style;this.#e===this.#o?(f.left=`${(100*c/this.#h).toFixed(2)}%`,f.top=`${(100*d/this.#l).toFixed(2)}%`):(f.left=`${u}${c.toFixed(2)}px)`,f.top=`${u}${d.toFixed(2)}px)`),f.fontSize=`${u}${(vt.#y*l).toFixed(2)}px)`,f.fontFamily=a,i.fontSize=l,e.setAttribute("role","presentation"),e.textContent=t.str,e.dir=t.dir,this.#n&&(e.dataset.fontName=r.fontSubstitutionLoadedName||t.fontName),0!==s&&(i.angle=s*(180/Math.PI));let p=!1;if(t.str.length>1)p=!0;else if(" "!==t.str&&t.transform[0]!==t.transform[3]){const g=Math.abs(t.transform[0]),b=Math.abs(t.transform[3]);g!==b&&Math.max(g,b)/Math.min(g,b)>1.5&&(p=!0)}if(p&&(i.canvasWidth=r.vertical?t.height:t.width),this.#b.set(e,i),this.#r.div=e,this.#r.properties=i,this.#x(this.#r),i.hasText&&this.#e.append(e),i.hasEOL){const g=document.createElement("br");g.setAttribute("role","presentation"),this.#e.append(g)}}#x(t){const{div:e,properties:i,ctx:n}=t,{style:s}=e;let r="";if(vt.#y>1&&(r=`scale(${1/vt.#y})`),0!==i.canvasWidth&&i.hasText){const{fontFamily:a}=s,{canvasWidth:l,fontSize:h}=i;vt.#S(n,h*this.#a,a);const{width:c}=n.measureText(e.textContent);c>0&&(r=`scaleX(${l*this.#a/c}) ${r}`)}0!==i.angle&&(r=`rotate(${i.angle}deg) ${r}`),r.length>0&&(s.transform=r)}static cleanup(){if(!(this.#w.size>0)){this.#_.clear();for(const{canvas:t}of this.#A.values())t.remove();this.#A.clear()}}static#T(t=null){let e=this.#A.get(t||="");if(!e){const i=document.createElement("canvas");i.className="hiddenCanvasElement",i.lang=t,document.body.append(i),e=i.getContext("2d",{alpha:!1,willReadFrequently:!0}),this.#A.set(t,e),this.#E.set(e,{size:0,family:""})}return e}static#S(t,e,i){const n=this.#E.get(t);e===n.size&&i===n.family||(t.font=`${e}px ${i}`,n.size=e,n.family=i)}static#R(){if(null!==this.#y)return;const t=document.createElement("div");t.style.opacity=0,t.style.lineHeight=1,t.style.fontSize="1px",t.style.position="absolute",t.textContent="X",document.body.append(t),this.#y=t.getBoundingClientRect().height,t.remove()}static#k(t,e){const i=this.#_.get(t);if(i)return i;const n=this.#T(e);n.canvas.width=n.canvas.height=30,this.#S(n,30,t);const s=n.measureText("");let r=s.fontBoundingBoxAscent,a=Math.abs(s.fontBoundingBoxDescent);if(r){const c=r/(r+a);return this.#_.set(t,c),n.canvas.width=n.canvas.height=0,c}n.strokeStyle="red",n.clearRect(0,0,30,30),n.strokeText("g",0,0);let l=n.getImageData(0,0,30,30).data;a=0;for(let c=l.length-1-3;c>=0;c-=4)if(l[c]>0){a=Math.ceil(c/4/30);break}n.clearRect(0,0,30,30),n.strokeText("A",0,30),l=n.getImageData(0,0,30,30).data,r=0;for(let c=0,d=l.length;c<d;c+=4)if(l[c]>0){r=30-Math.floor(c/4/30);break}n.canvas.width=n.canvas.height=0;const h=r?r/(r+a):.8;return this.#_.set(t,h),h}}class Ie{static textContent(t){const e=[],i={items:e,styles:Object.create(null)};return function n(s){if(!s)return;let r=null;const a=s.name;if("#text"===a)r=s.value;else{if(!Ie.shouldBuildText(a))return;s?.attributes?.textContent?r=s.attributes.textContent:s.value&&(r=s.value)}if(null!==r&&e.push({str:r}),s.children)for(const l of s.children)n(l)}(t),i}static shouldBuildText(t){return!("textarea"===t||"input"===t||"option"===t||"select"===t)}}const bo=ft?class Pa extends Vn{_createCanvas(t,e){return Zt.get("canvas").createCanvas(t,e)}}:class xa extends Vn{constructor({ownerDocument:t=globalThis.document,enableHWA:e=!1}){super({enableHWA:e}),this._document=t}_createCanvas(t,e){const i=this._document.createElement("canvas");return i.width=t,i.height=e,i}},_o=ft?class Ta extends jn{_fetch(t){return(0,x.A)(function*(){return Gn(t)})()}}:Hn,vo=ft?class Sa extends zn{}:class Ca extends zn{#t;#e;#i;#n;#s;#r;#l=0;constructor({docId:t,ownerDocument:e=globalThis.document}){super(),this.#n=t,this.#s=e}get#h(){return this.#e||=new Map}get#c(){return this.#r||=new Map}get#o(){if(!this.#i){const t=this.#s.createElement("div"),{style:e}=t;e.visibility="hidden",e.contain="strict",e.width=e.height=0,e.position="absolute",e.top=e.left=0,e.zIndex=-1;const i=this.#s.createElementNS(zt,"svg");i.setAttribute("width",0),i.setAttribute("height",0),this.#i=this.#s.createElementNS(zt,"defs"),t.append(i),i.append(this.#i),this.#s.body.append(t)}return this.#i}#d(t){if(1===t.length){const l=t[0],h=new Array(256);for(let d=0;d<256;d++)h[d]=l[d]/255;const c=h.join(",");return[c,c,c]}const[e,i,n]=t,s=new Array(256),r=new Array(256),a=new Array(256);for(let l=0;l<256;l++)s[l]=e[l]/255,r[l]=i[l]/255,a[l]=n[l]/255;return[s.join(","),r.join(","),a.join(",")]}#a(t){if(void 0===this.#t){this.#t="";const e=this.#s.URL;e!==this.#s.baseURI&&(Je(e)?V('#createUrl: ignore "data:"-URL for performance reasons.'):this.#t=e.split("#",1)[0])}return`url(${this.#t}#${t})`}addFilter(t){if(!t)return"none";let e=this.#h.get(t);if(e)return e;const[i,n,s]=this.#d(t),r=1===t.length?i:`${i}${n}${s}`;if(e=this.#h.get(r),e)return this.#h.set(t,e),e;const a=`g_${this.#n}_transfer_map_${this.#l++}`,l=this.#a(a);this.#h.set(t,l),this.#h.set(r,l);const h=this.#f(a);return this.#b(i,n,s,h),l}addHCMFilter(t,e){const i=`${t}-${e}`,n="base";let s=this.#c.get(n);if(s?.key===i||(s?(s.filter?.remove(),s.key=i,s.url="none",s.filter=null):(s={key:i,url:"none",filter:null},this.#c.set(n,s)),!t||!e))return s.url;const r=this.#_(t);t=I.makeHexColor(...r);const a=this.#_(e);if(e=I.makeHexColor(...a),this.#o.style.color="","#000000"===t&&"#ffffff"===e||t===e)return s.url;const l=new Array(256);for(let f=0;f<=255;f++){const p=f/255;l[f]=p<=.03928?p/12.92:((p+.055)/1.055)**2.4}const h=l.join(","),c=`g_${this.#n}_hcm_filter`,d=s.filter=this.#f(c);this.#b(h,h,h,d),this.#p(d);const u=(f,p)=>{const g=r[f]/255,b=a[f]/255,m=new Array(p+1);for(let v=0;v<=p;v++)m[v]=g+v/p*(b-g);return m.join(",")};return this.#b(u(0,5),u(1,5),u(2,5),d),s.url=this.#a(c),s.url}addAlphaFilter(t){let e=this.#h.get(t);if(e)return e;const[i]=this.#d([t]),n=`alpha_${i}`;if(e=this.#h.get(n),e)return this.#h.set(t,e),e;const s=`g_${this.#n}_alpha_map_${this.#l++}`,r=this.#a(s);this.#h.set(t,r),this.#h.set(n,r);const a=this.#f(s);return this.#m(i,a),r}addLuminosityFilter(t){let i,n,e=this.#h.get(t||"luminosity");if(e)return e;if(t?([i]=this.#d([t]),n=`luminosity_${i}`):n="luminosity",e=this.#h.get(n),e)return this.#h.set(t,e),e;const s=`g_${this.#n}_luminosity_map_${this.#l++}`,r=this.#a(s);this.#h.set(t,r),this.#h.set(n,r);const a=this.#f(s);return this.#u(a),t&&this.#m(i,a),r}addHighlightHCMFilter(t,e,i,n,s){const r=`${e}-${i}-${n}-${s}`;let a=this.#c.get(t);if(a?.key===r||(a?(a.filter?.remove(),a.key=r,a.url="none",a.filter=null):(a={key:r,url:"none",filter:null},this.#c.set(t,a)),!e||!i))return a.url;const[l,h]=[e,i].map(this.#_.bind(this));let c=Math.round(.2126*l[0]+.7152*l[1]+.0722*l[2]),d=Math.round(.2126*h[0]+.7152*h[1]+.0722*h[2]),[u,f]=[n,s].map(this.#_.bind(this));d<c&&([c,d,u,f]=[d,c,f,u]),this.#o.style.color="";const p=(m,v,A)=>{const w=new Array(256),E=(d-c)/A,C=m/255,M=(v-m)/(255*A);let T=0;for(let y=0;y<=A;y++){const S=Math.round(c+y*E),L=C+y*M;for(let z=T;z<=S;z++)w[z]=L;T=S+1}for(let y=T;y<256;y++)w[y]=w[T-1];return w.join(",")},g=`g_${this.#n}_hcm_${t}_filter`,b=a.filter=this.#f(g);return this.#p(b),this.#b(p(u[0],f[0],5),p(u[1],f[1],5),p(u[2],f[2],5),b),a.url=this.#a(g),a.url}destroy(t=!1){t&&0!==this.#c.size||(this.#i&&(this.#i.parentNode.parentNode.remove(),this.#i=null),this.#e&&(this.#e.clear(),this.#e=null),this.#l=0)}#u(t){const e=this.#s.createElementNS(zt,"feColorMatrix");e.setAttribute("type","matrix"),e.setAttribute("values","0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.3 0.59 0.11 0 0"),t.append(e)}#p(t){const e=this.#s.createElementNS(zt,"feColorMatrix");e.setAttribute("type","matrix"),e.setAttribute("values","0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0 0 0 1 0"),t.append(e)}#f(t){const e=this.#s.createElementNS(zt,"filter");return e.setAttribute("color-interpolation-filters","sRGB"),e.setAttribute("id",t),this.#o.append(e),e}#g(t,e,i){const n=this.#s.createElementNS(zt,e);n.setAttribute("type","discrete"),n.setAttribute("tableValues",i),t.append(n)}#b(t,e,i,n){const s=this.#s.createElementNS(zt,"feComponentTransfer");n.append(s),this.#g(s,"feFuncR",t),this.#g(s,"feFuncG",e),this.#g(s,"feFuncB",i)}#m(t,e){const i=this.#s.createElementNS(zt,"feComponentTransfer");e.append(i),this.#g(i,"feFuncA",t)}#_(t){return this.#o.style.color=t,Di(getComputedStyle(this.#o).getPropertyValue("color"))}},Ao=ft?class Ma extends Wn{_fetch(t){return(0,x.A)(function*(){return Gn(t)})()}}:Un;function yo(o={}){"string"==typeof o||o instanceof URL?o={url:o}:(o instanceof ArrayBuffer||ArrayBuffer.isView(o))&&(o={data:o});const t=new Qi,{docId:e}=t,i=o.url?function wo(o){if(o instanceof URL)return o.href;try{return new URL(o,window.location).href}catch{if(ft&&"string"==typeof o)return o}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}(o.url):null,n=o.data?function Eo(o){if(ft&&typeof Buffer<"u"&&o instanceof Buffer)throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if(o instanceof Uint8Array&&o.byteLength===o.buffer.byteLength)return o;if("string"==typeof o)return de(o);if(o instanceof ArrayBuffer||ArrayBuffer.isView(o)||"object"==typeof o&&!isNaN(o?.length))return new Uint8Array(o);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}(o.data):null,s=o.httpHeaders||null,r=!0===o.withCredentials,a=o.password??null,l=o.range instanceof ds?o.range:null,h=Number.isInteger(o.rangeChunkSize)&&o.rangeChunkSize>0?o.rangeChunkSize:65536;let c=o.worker instanceof ct?o.worker:null;const d=o.verbosity,u="string"!=typeof o.docBaseUrl||Je(o.docBaseUrl)?null:o.docBaseUrl,f="string"==typeof o.cMapUrl?o.cMapUrl:null,p=!1!==o.cMapPacked,g=o.CMapReaderFactory||_o,b="string"==typeof o.standardFontDataUrl?o.standardFontDataUrl:null,m=o.StandardFontDataFactory||Ao,v=!0!==o.stopAtErrors,A=Number.isInteger(o.maxImageSize)&&o.maxImageSize>-1?o.maxImageSize:-1,w=!1!==o.isEvalSupported,E="boolean"==typeof o.isOffscreenCanvasSupported?o.isOffscreenCanvasSupported:!ft,C="boolean"==typeof o.isChrome?o.isChrome:!bt.platform.isFirefox&&typeof window<"u"&&!!window?.chrome,M=Number.isInteger(o.canvasMaxAreaInBytes)?o.canvasMaxAreaInBytes:-1,T="boolean"==typeof o.disableFontFace?o.disableFontFace:ft,y=!0===o.fontExtraProperties,S=!0===o.enableXfa,L=o.ownerDocument||globalThis.document,z=!0===o.disableRange,H=!0===o.disableStream,W=!0===o.disableAutoFetch,$=!0===o.pdfBug,et=o.CanvasFactory||bo,k=o.FilterFactory||vo,j=!0===o.enableHWA,te=l?l.length:o.length??NaN,ce="boolean"==typeof o.useSystemFonts?o.useSystemFonts:!ft&&!T,Lt="boolean"==typeof o.useWorkerFetch?o.useWorkerFetch:g===Hn&&m===Un&&f&&b&&Ce(f,document.baseURI)&&Ce(b,document.baseURI);o.canvasFactory&&kn("`canvasFactory`-instance option, please use `CanvasFactory` instead."),o.filterFactory&&kn("`filterFactory`-instance option, please use `FilterFactory` instead."),function ta(o){Number.isInteger(o)&&(Ye=o)}(d);const at={canvasFactory:new et({ownerDocument:L,enableHWA:j}),filterFactory:new k({docId:e,ownerDocument:L}),cMapReaderFactory:Lt?null:new g({baseUrl:f,isCompressed:p}),standardFontDataFactory:Lt?null:new m({baseUrl:b})};if(!c){const Rt={verbosity:d,port:Le.workerPort};c=Rt.port?ct.fromPort(Rt):new ct(Rt),t._worker=c}const ye={docId:e,apiVersion:"4.8.69",data:n,password:a,disableAutoFetch:W,rangeChunkSize:h,length:te,docBaseUrl:u,enableXfa:S,evaluatorOptions:{maxImageSize:A,disableFontFace:T,ignoreErrors:v,isEvalSupported:w,isOffscreenCanvasSupported:E,isChrome:C,canvasMaxAreaInBytes:M,fontExtraProperties:y,useSystemFonts:ce,cMapUrl:Lt?f:null,standardFontDataUrl:Lt?b:null}},We={disableFontFace:T,fontExtraProperties:y,ownerDocument:L,pdfBug:$,styleElement:null,loadingParams:{disableAutoFetch:W,enableXfa:S}};return c.promise.then(function(){if(t.destroyed)throw new Error("Loading aborted");if(c.destroyed)throw new Error("Worker was destroyed");const Rt=c.messageHandler.sendWithPromise("GetDocRequest",ye,n?[n.buffer]:null);let Y;if(l)Y=new Xa(l,{disableRange:z,disableStream:H});else if(!n){if(!i)throw new Error("getDocument - no `url` parameter provided.");let Kt;Kt=ft?typeof fetch<"u"&&typeof Response<"u"&&"body"in Response.prototype&&Ce(i)?as:ao:Ce(i)?as:eo,Y=new Kt({url:i,length:te,httpHeaders:s,withCredentials:r,rangeChunkSize:h,disableRange:z,disableStream:H})}return Rt.then(Kt=>{if(t.destroyed)throw new Error("Loading aborted");if(c.destroyed)throw new Error("Worker was destroyed");const Cn=new Re(e,Kt,c.port),Dd=new Po(Cn,t,Y,We,at);t._transport=Dd,Cn.send("Ready",null)})}).catch(t._capability.reject),t}function cs(o){return"object"==typeof o&&Number.isInteger(o?.num)&&o.num>=0&&Number.isInteger(o?.gen)&&o.gen>=0}class Qi{static#t=0;constructor(){this._capability=Promise.withResolvers(),this._transport=null,this._worker=null,this.docId="d"+Qi.#t++,this.destroyed=!1,this.onPassword=null,this.onProgress=null}get promise(){return this._capability.promise}destroy(){var t=this;return(0,x.A)(function*(){t.destroyed=!0;try{t._worker?.port&&(t._worker._pendingDestroy=!0),yield t._transport?.destroy()}catch(e){throw t._worker?.port&&delete t._worker._pendingDestroy,e}t._transport=null,t._worker&&(t._worker.destroy(),t._worker=null)})()}}class ds{constructor(t,e,i=!1,n=null){this.length=t,this.initialData=e,this.progressiveDone=i,this.contentDispositionFilename=n,this._rangeListeners=[],this._progressListeners=[],this._progressiveReadListeners=[],this._progressiveDoneListeners=[],this._readyCapability=Promise.withResolvers()}addRangeListener(t){this._rangeListeners.push(t)}addProgressListener(t){this._progressListeners.push(t)}addProgressiveReadListener(t){this._progressiveReadListeners.push(t)}addProgressiveDoneListener(t){this._progressiveDoneListeners.push(t)}onDataRange(t,e){for(const i of this._rangeListeners)i(t,e)}onDataProgress(t,e){this._readyCapability.promise.then(()=>{for(const i of this._progressListeners)i(t,e)})}onDataProgressiveRead(t){this._readyCapability.promise.then(()=>{for(const e of this._progressiveReadListeners)e(t)})}onDataProgressiveDone(){this._readyCapability.promise.then(()=>{for(const t of this._progressiveDoneListeners)t()})}transportReady(){this._readyCapability.resolve()}requestDataRange(t,e){X("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}class xo{constructor(t,e){this._pdfInfo=t,this._transport=e}get annotationStorage(){return this._transport.annotationStorage}get canvasFactory(){return this._transport.canvasFactory}get filterFactory(){return this._transport.filterFactory}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return U(this,"isPureXfa",!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}getPage(t){return this._transport.getPage(t)}getPageIndex(t){return this._transport.getPageIndex(t)}getDestinations(){return this._transport.getDestinations()}getDestination(t){return this._transport.getDestination(t)}getPageLabels(){return this._transport.getPageLabels()}getPageLayout(){return this._transport.getPageLayout()}getPageMode(){return this._transport.getPageMode()}getViewerPreferences(){return this._transport.getViewerPreferences()}getOpenAction(){return this._transport.getOpenAction()}getAttachments(){return this._transport.getAttachments()}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig({intent:t="display"}={}){const{renderingIntent:e}=this._transport.getRenderingIntent(t);return this._transport.getOptionalContentConfig(e)}getPermissions(){return this._transport.getPermissions()}getMetadata(){return this._transport.getMetadata()}getMarkInfo(){return this._transport.getMarkInfo()}getData(){return this._transport.getData()}saveDocument(){return this._transport.saveDocument()}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}cleanup(t=!1){return this._transport.startCleanup(t||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}cachedPageNumber(t){return this._transport.cachedPageNumber(t)}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}getFieldObjects(){return this._transport.getFieldObjects()}hasJSActions(){return this._transport.hasJSActions()}getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}}class Co{#t=null;#e=!1;constructor(t,e,i,n=!1){this._pageIndex=t,this._pageInfo=e,this._transport=i,this._stats=n?new In:null,this._pdfBug=n,this.commonObjs=i.commonObjs,this.objs=new us,this._maybeCleanupAfterRender=!1,this._intentStates=new Map,this.destroyed=!1}get pageNumber(){return this._pageIndex+1}get rotate(){return this._pageInfo.rotate}get ref(){return this._pageInfo.ref}get userUnit(){return this._pageInfo.userUnit}get view(){return this._pageInfo.view}getViewport({scale:t,rotation:e=this.rotate,offsetX:i=0,offsetY:n=0,dontFlip:s=!1}={}){return new xe({viewBox:this.view,scale:t,rotation:e,offsetX:i,offsetY:n,dontFlip:s})}getAnnotations({intent:t="display"}={}){const{renderingIntent:e}=this._transport.getRenderingIntent(t);return this._transport.getAnnotations(this._pageIndex,e)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return U(this,"isPureXfa",!!this._transport._htmlForXfa)}getXfa(){var t=this;return(0,x.A)(function*(){return t._transport._htmlForXfa?.children[t._pageIndex]||null})()}render({canvasContext:t,viewport:e,intent:i="display",annotationMode:n=qt.ENABLE,transform:s=null,background:r=null,optionalContentConfigPromise:a=null,annotationCanvasMap:l=null,pageColors:h=null,printAnnotationStorage:c=null,isEditing:d=!1}){this._stats?.time("Overall");const u=this._transport.getRenderingIntent(i,n,c,d),{renderingIntent:f,cacheKey:p}=u;this.#e=!1,this.#n(),a||=this._transport.getOptionalContentConfig(f);let g=this._intentStates.get(p);g||(g=Object.create(null),this._intentStates.set(p,g)),g.streamReaderCancelTimeout&&(clearTimeout(g.streamReaderCancelTimeout),g.streamReaderCancelTimeout=null);const b=!!(4&f);g.displayReadyCapability||(g.displayReadyCapability=Promise.withResolvers(),g.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(u));const m=w=>{g.renderTasks.delete(v),(this._maybeCleanupAfterRender||b)&&(this.#e=!0),this.#i(!b),w?(v.capability.reject(w),this._abortOperatorList({intentState:g,reason:w instanceof Error?w:new Error(w)})):v.capability.resolve(),this._stats&&(this._stats.timeEnd("Rendering"),this._stats.timeEnd("Overall"),globalThis.Stats?.enabled&&globalThis.Stats.add(this.pageNumber,this._stats))},v=new ge({callback:m,params:{canvasContext:t,viewport:e,transform:s,background:r},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:l,operatorList:g.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!b,pdfBug:this._pdfBug,pageColors:h});(g.renderTasks||=new Set).add(v);const A=v.task;return Promise.all([g.displayReadyCapability.promise,a]).then(([w,E])=>{if(this.destroyed)m();else{if(this._stats?.time("Rendering"),!(E.renderingIntent&f))throw new Error("Must use the same `intent`-argument when calling the `PDFPageProxy.render` and `PDFDocumentProxy.getOptionalContentConfig` methods.");v.initializeGraphics({transparency:w,optionalContentConfig:E}),v.operatorListChanged()}}).catch(m),A}getOperatorList({intent:t="display",annotationMode:e=qt.ENABLE,printAnnotationStorage:i=null,isEditing:n=!1}={}){const r=this._transport.getRenderingIntent(t,e,i,n,!0);let l,a=this._intentStates.get(r.cacheKey);return a||(a=Object.create(null),this._intentStates.set(r.cacheKey,a)),a.opListReadCapability||(l=Object.create(null),l.operatorListChanged=function s(){a.operatorList.lastChunk&&(a.opListReadCapability.resolve(a.operatorList),a.renderTasks.delete(l))},a.opListReadCapability=Promise.withResolvers(),(a.renderTasks||=new Set).add(l),a.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(r)),a.opListReadCapability.promise}streamTextContent({includeMarkedContent:t=!1,disableNormalization:e=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:!0===t,disableNormalization:!0===e},{highWaterMark:100,size:n=>n.items.length})}getTextContent(t={}){if(this._transport._htmlForXfa)return this.getXfa().then(i=>Ie.textContent(i));const e=this.streamTextContent(t);return new Promise(function(i,n){const r=e.getReader(),a={items:[],styles:Object.create(null),lang:null};!function s(){r.read().then(function({value:l,done:h}){h?i(a):(a.lang??=l.lang,Object.assign(a.styles,l.styles),a.items.push(...l.items),s())},n)}()})}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const t=[];for(const e of this._intentStates.values())if(this._abortOperatorList({intentState:e,reason:new Error("Page was destroyed."),force:!0}),!e.opListReadCapability)for(const i of e.renderTasks)t.push(i.completed),i.cancel();return this.objs.clear(),this.#e=!1,this.#n(),Promise.all(t)}cleanup(t=!1){this.#e=!0;const e=this.#i(!1);return t&&e&&(this._stats&&=new In),e}#i(t=!1){if(this.#n(),!this.#e||this.destroyed)return!1;if(t)return this.#t=setTimeout(()=>{this.#t=null,this.#i(!1)},5e3),!1;for(const{renderTasks:e,operatorList:i}of this._intentStates.values())if(e.size>0||!i.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),this.#e=!1,!0}#n(){this.#t&&(clearTimeout(this.#t),this.#t=null)}_startRenderPage(t,e){const i=this._intentStates.get(e);i&&(this._stats?.timeEnd("Page Request"),i.displayReadyCapability?.resolve(t))}_renderPageChunk(t,e){for(let i=0,n=t.length;i<n;i++)e.operatorList.fnArray.push(t.fnArray[i]),e.operatorList.argsArray.push(t.argsArray[i]);e.operatorList.lastChunk=t.lastChunk,e.operatorList.separateAnnots=t.separateAnnots;for(const i of e.renderTasks)i.operatorListChanged();t.lastChunk&&this.#i(!0)}_pumpOperatorList({renderingIntent:t,cacheKey:e,annotationStorageSerializable:i,modifiedIds:n}){const{map:s,transfer:r}=i,l=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:t,cacheKey:e,annotationStorage:s,modifiedIds:n},r).getReader(),h=this._intentStates.get(e);h.streamReader=l;const c=()=>{l.read().then(({value:d,done:u})=>{u?h.streamReader=null:this._transport.destroyed||(this._renderPageChunk(d,h),c())},d=>{if(h.streamReader=null,!this._transport.destroyed){if(h.operatorList){h.operatorList.lastChunk=!0;for(const u of h.renderTasks)u.operatorListChanged();this.#i(!0)}if(h.displayReadyCapability)h.displayReadyCapability.reject(d);else{if(!h.opListReadCapability)throw d;h.opListReadCapability.reject(d)}}})};c()}_abortOperatorList({intentState:t,reason:e,force:i=!1}){if(t.streamReader){if(t.streamReaderCancelTimeout&&(clearTimeout(t.streamReaderCancelTimeout),t.streamReaderCancelTimeout=null),!i){if(t.renderTasks.size>0)return;if(e instanceof Ii){let n=100;return e.extraDelay>0&&e.extraDelay<1e3&&(n+=e.extraDelay),void(t.streamReaderCancelTimeout=setTimeout(()=>{t.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:t,reason:e,force:!0})},n))}}if(t.streamReader.cancel(new ne(e.message)).catch(()=>{}),t.streamReader=null,!this._transport.destroyed){for(const[n,s]of this._intentStates)if(s===t){this._intentStates.delete(n);break}this.cleanup()}}}get stats(){return this._stats}}class So{#t=new Map;#e=Promise.resolve();postMessage(t,e){const i={data:structuredClone(t,e?{transfer:e}:null)};this.#e.then(()=>{for(const[n]of this.#t)n.call(this,i)})}addEventListener(t,e,i=null){let n=null;if(i?.signal instanceof AbortSignal){const{signal:s}=i;if(s.aborted)return void V("LoopbackPort - cannot use an `aborted` signal.");const r=()=>this.removeEventListener(t,e);n=()=>s.removeEventListener("abort",r),s.addEventListener("abort",r)}this.#t.set(e,n)}removeEventListener(t,e){this.#t.get(e)?.(),this.#t.delete(e)}terminate(){for(const[,t]of this.#t)t?.();this.#t.clear()}}class ct{static#t=0;static#e=!1;static#i;static{ft&&(this.#e=!0,Le.workerSrc||="./pdf.worker.mjs"),this._isSameOrigin=(t,e)=>{let i;try{if(i=new URL(t),!i.origin||"null"===i.origin)return!1}catch{return!1}const n=new URL(e,i);return i.origin===n.origin},this._createCDNWrapper=t=>URL.createObjectURL(new Blob([`await import("${t}");`],{type:"text/javascript"}))}constructor({name:t=null,port:e=null,verbosity:i=ea()}={}){if(this.name=t,this.destroyed=!1,this.verbosity=i,this._readyCapability=Promise.withResolvers(),this._port=null,this._webWorker=null,this._messageHandler=null,e){if(ct.#i?.has(e))throw new Error("Cannot use more than one PDFWorker per port.");return(ct.#i||=new WeakMap).set(e,this),void this._initializeFromPort(e)}this._initialize()}get promise(){return ft?Promise.all([Zt.promise,this._readyCapability.promise]):this._readyCapability.promise}#n(){this._readyCapability.resolve(),this._messageHandler.send("configure",{verbosity:this.verbosity})}get port(){return this._port}get messageHandler(){return this._messageHandler}_initializeFromPort(t){this._port=t,this._messageHandler=new Re("main","worker",t),this._messageHandler.on("ready",function(){}),this.#n()}_initialize(){if(ct.#e||ct.#s)return void this._setupFakeWorker();let{workerSrc:t}=ct;try{ct._isSameOrigin(window.location.href,t)||(t=ct._createCDNWrapper(new URL(t,window.location).href));const e=new Worker(t,{type:"module"}),i=new Re("main","worker",e),n=()=>{s.abort(),i.destroy(),e.terminate(),this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()},s=new AbortController;e.addEventListener("error",()=>{this._webWorker||n()},{signal:s.signal}),i.on("test",a=>{s.abort(),!this.destroyed&&a?(this._messageHandler=i,this._port=e,this._webWorker=e,this.#n()):n()}),i.on("ready",a=>{if(s.abort(),this.destroyed)n();else try{r()}catch{this._setupFakeWorker()}});const r=()=>{const a=new Uint8Array;i.send("test",a,[a.buffer])};return void r()}catch{Ke("The worker has been disabled.")}this._setupFakeWorker()}_setupFakeWorker(){ct.#e||(V("Setting up fake worker."),ct.#e=!0),ct._setupFakeWorkerGlobal.then(t=>{if(this.destroyed)return void this._readyCapability.reject(new Error("Worker was destroyed"));const e=new So;this._port=e;const i="fake"+ct.#t++,n=new Re(i+"_worker",i,e);t.setup(n,e),this._messageHandler=new Re(i,i+"_worker",e),this.#n()}).catch(t=>{this._readyCapability.reject(new Error(`Setting up fake worker failed: "${t.message}".`))})}destroy(){this.destroyed=!0,this._webWorker&&(this._webWorker.terminate(),this._webWorker=null),ct.#i?.delete(this._port),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}static fromPort(t){if(!t?.port)throw new Error("PDFWorker.fromPort - invalid method signature.");const e=this.#i?.get(t.port);if(e){if(e._pendingDestroy)throw new Error("PDFWorker.fromPort - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return e}return new ct(t)}static get workerSrc(){if(Le.workerSrc)return Le.workerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get#s(){try{return globalThis.pdfjsWorker?.WorkerMessageHandler||null}catch{return null}}static get _setupFakeWorkerGlobal(){var t=this;return U(this,"_setupFakeWorkerGlobal",function(){var i=(0,x.A)(function*(){return t.#s?t.#s:(yield import(t.workerSrc)).WorkerMessageHandler});return function(){return i.apply(this,arguments)}}()())}}class Po{#t=new Map;#e=new Map;#i=new Map;#n=new Map;#s=null;constructor(t,e,i,n,s){this.messageHandler=t,this.loadingTask=e,this.commonObjs=new us,this.fontLoader=new wa({ownerDocument:n.ownerDocument,styleElement:n.styleElement}),this.loadingParams=n.loadingParams,this._params=n,this.canvasFactory=s.canvasFactory,this.filterFactory=s.filterFactory,this.cMapReaderFactory=s.cMapReaderFactory,this.standardFontDataFactory=s.standardFontDataFactory,this.destroyed=!1,this.destroyCapability=null,this._networkStream=i,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=Promise.withResolvers(),this.setupMessageHandler()}#r(t,e=null){const i=this.#t.get(t);if(i)return i;const n=this.messageHandler.sendWithPromise(t,e);return this.#t.set(t,n),n}get annotationStorage(){return U(this,"annotationStorage",new Vi)}getRenderingIntent(t,e=qt.ENABLE,i=null,n=!1,s=!1){let r=2,a=Bi;switch(t){case"any":r=1;break;case"display":break;case"print":r=4;break;default:V(`getRenderingIntent - invalid intent: ${t}`)}const l=4&r&&i instanceof Bn?i:this.annotationStorage;switch(e){case qt.DISABLE:r+=64;break;case qt.ENABLE:break;case qt.ENABLE_FORMS:r+=16;break;case qt.ENABLE_STORAGE:r+=32,a=l.serializable;break;default:V(`getRenderingIntent - invalid annotationMode: ${e}`)}n&&(r+=128),s&&(r+=256);const{ids:h,hash:c}=l.modifiedIds;return{renderingIntent:r,cacheKey:[r,a.hash,c].join("_"),annotationStorageSerializable:a,modifiedIds:h}}destroy(){if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=Promise.withResolvers(),this.#s?.reject(new Error("Worker was destroyed during onPassword callback"));const t=[];for(const i of this.#e.values())t.push(i._destroy());this.#e.clear(),this.#i.clear(),this.#n.clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const e=this.messageHandler.sendWithPromise("Terminate",null);return t.push(e),Promise.all(t).then(()=>{this.commonObjs.clear(),this.fontLoader.clear(),this.#t.clear(),this.filterFactory.destroy(),vt.cleanup(),this._networkStream?.cancelAllRequests(new ne("Worker was terminated.")),this.messageHandler&&(this.messageHandler.destroy(),this.messageHandler=null),this.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){var t=this;const{messageHandler:e,loadingTask:i}=this;e.on("GetReader",(n,s)=>{lt(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=r=>{this._lastProgress={loaded:r.loaded,total:r.total}},s.onPull=()=>{this._fullReader.read().then(function({value:r,done:a}){a?s.close():(lt(r instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),s.enqueue(new Uint8Array(r),1,[r]))}).catch(r=>{s.error(r)})},s.onCancel=r=>{this._fullReader.cancel(r),s.ready.catch(a=>{if(!this.destroyed)throw a})}}),e.on("ReaderHeadersReady",function(){var n=(0,x.A)(function*(s){yield t._fullReader.headersReady;const{isStreamingSupported:r,isRangeSupported:a,contentLength:l}=t._fullReader;return(!r||!a)&&(t._lastProgress&&i.onProgress?.(t._lastProgress),t._fullReader.onProgress=h=>{i.onProgress?.({loaded:h.loaded,total:h.total})}),{isStreamingSupported:r,isRangeSupported:a,contentLength:l}});return function(s){return n.apply(this,arguments)}}()),e.on("GetRangeReader",(n,s)=>{lt(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const r=this._networkStream.getRangeReader(n.begin,n.end);r?(s.onPull=()=>{r.read().then(function({value:a,done:l}){l?s.close():(lt(a instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),s.enqueue(new Uint8Array(a),1,[a]))}).catch(a=>{s.error(a)})},s.onCancel=a=>{r.cancel(a),s.ready.catch(l=>{if(!this.destroyed)throw l})}):s.close()}),e.on("GetDoc",({pdfInfo:n})=>{this._numPages=n.numPages,this._htmlForXfa=n.htmlForXfa,delete n.htmlForXfa,i._capability.resolve(new xo(n,this))}),e.on("DocException",function(n){let s;switch(n.name){case"PasswordException":s=new Si(n.message,n.code);break;case"InvalidPDFException":s=new Mn(n.message);break;case"MissingPDFException":s=new ie(n.message);break;case"UnexpectedResponseException":s=new qe(n.message,n.status);break;case"UnknownErrorException":s=new Pi(n.message,n.details);break;default:X("DocException - expected a valid Error.")}i._capability.reject(s)}),e.on("PasswordRequest",n=>{if(this.#s=Promise.withResolvers(),i.onPassword){const s=r=>{r instanceof Error?this.#s.reject(r):this.#s.resolve({password:r})};try{i.onPassword(s,n.code)}catch(r){this.#s.reject(r)}}else this.#s.reject(new Si(n.message,n.code));return this.#s.promise}),e.on("DataLoaded",n=>{i.onProgress?.({loaded:n.length,total:n.length}),this.downloadInfoCapability.resolve(n)}),e.on("StartRenderPage",n=>{this.destroyed||this.#e.get(n.pageIndex)._startRenderPage(n.transparency,n.cacheKey)}),e.on("commonobj",([n,s,r])=>{if(this.destroyed||this.commonObjs.has(n))return null;switch(s){case"Font":const{disableFontFace:a,fontExtraProperties:l,pdfBug:h}=this._params;if("error"in r){const f=r.error;V(`Error during font loading: ${f}`),this.commonObjs.resolve(n,f);break}const c=h&&globalThis.FontInspector?.enabled?(f,p)=>globalThis.FontInspector.fontAdded(f,p):null,d=new Ea(r,{disableFontFace:a,inspectFont:c});this.fontLoader.bind(d).catch(()=>e.sendWithPromise("FontFallback",{id:n})).finally(()=>{!l&&d.data&&(d.data=null),this.commonObjs.resolve(n,d)});break;case"CopyLocalImage":const{imageRef:u}=r;lt(u,"The imageRef must be defined.");for(const f of this.#e.values())for(const[,p]of f.objs)if(p?.ref===u)return p.dataLen?(this.commonObjs.resolve(n,structuredClone(p)),p.dataLen):null;break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(n,r);break;default:throw new Error(`Got unknown common object type ${s}`)}return null}),e.on("obj",([n,s,r,a])=>{if(this.destroyed)return;const l=this.#e.get(s);if(!l.objs.has(n)){if(0===l._intentStates.size)return void a?.bitmap?.close();switch(r){case"Image":l.objs.resolve(n,a),a?.dataLen>1e7&&(l._maybeCleanupAfterRender=!0);break;case"Pattern":l.objs.resolve(n,a);break;default:throw new Error(`Got unknown object type ${r}`)}}}),e.on("DocProgress",n=>{this.destroyed||i.onProgress?.({loaded:n.loaded,total:n.total})}),e.on("FetchBuiltInCMap",function(){var n=(0,x.A)(function*(s){if(t.destroyed)throw new Error("Worker was destroyed.");if(!t.cMapReaderFactory)throw new Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter.");return t.cMapReaderFactory.fetch(s)});return function(s){return n.apply(this,arguments)}}()),e.on("FetchStandardFontData",function(){var n=(0,x.A)(function*(s){if(t.destroyed)throw new Error("Worker was destroyed.");if(!t.standardFontDataFactory)throw new Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter.");return t.standardFontDataFactory.fetch(s)});return function(s){return n.apply(this,arguments)}}())}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){this.annotationStorage.size<=0&&V("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");const{map:t,transfer:e}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:t,filename:this._fullReader?.filename??null},e).finally(()=>{this.annotationStorage.resetModified()})}getPage(t){if(!Number.isInteger(t)||t<=0||t>this._numPages)return Promise.reject(new Error("Invalid page request."));const e=t-1,i=this.#i.get(e);if(i)return i;const n=this.messageHandler.sendWithPromise("GetPage",{pageIndex:e}).then(s=>{if(this.destroyed)throw new Error("Transport destroyed");s.refStr&&this.#n.set(s.refStr,t);const r=new Co(e,s,this,this._params.pdfBug);return this.#e.set(e,r),r});return this.#i.set(e,n),n}getPageIndex(t){return cs(t)?this.messageHandler.sendWithPromise("GetPageIndex",{num:t.num,gen:t.gen}):Promise.reject(new Error("Invalid pageIndex request."))}getAnnotations(t,e){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:t,intent:e})}getFieldObjects(){return this.#r("GetFieldObjects")}hasJSActions(){return this.#r("HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(t){return"string"!=typeof t?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:t})}getPageLabels(){return this.messageHandler.sendWithPromise("GetPageLabels",null)}getPageLayout(){return this.messageHandler.sendWithPromise("GetPageLayout",null)}getPageMode(){return this.messageHandler.sendWithPromise("GetPageMode",null)}getViewerPreferences(){return this.messageHandler.sendWithPromise("GetViewerPreferences",null)}getOpenAction(){return this.messageHandler.sendWithPromise("GetOpenAction",null)}getAttachments(){return this.messageHandler.sendWithPromise("GetAttachments",null)}getDocJSActions(){return this.#r("GetDocJSActions")}getPageJSActions(t){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:t})}getStructTree(t){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:t})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(t){return this.#r("GetOptionalContentConfig").then(e=>new $a(e,t))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const t="GetMetadata",e=this.#t.get(t);if(e)return e;const i=this.messageHandler.sendWithPromise(t,null).then(n=>({info:n[0],metadata:n[1]?new Ua(n[1]):null,contentDispositionFilename:this._fullReader?.filename??null,contentLength:this._fullReader?.contentLength??null}));return this.#t.set(t,i),i}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}startCleanup(){var t=this;return(0,x.A)(function*(e=!1){if(!t.destroyed){yield t.messageHandler.sendWithPromise("Cleanup",null);for(const i of t.#e.values())if(!i.cleanup())throw new Error(`startCleanup: Page ${i.pageNumber} is currently rendering.`);t.commonObjs.clear(),e||t.fontLoader.clear(),t.#t.clear(),t.filterFactory.destroy(!0),vt.cleanup()}}).apply(this,arguments)}cachedPageNumber(t){return cs(t)?this.#n.get(0===t.gen?`${t.num}R`:`${t.num}R${t.gen}`)??null:null}}const ri=Symbol("INITIAL_DATA");class us{#t=Object.create(null);#e(t){return this.#t[t]||={...Promise.withResolvers(),data:ri}}get(t,e=null){if(e){const n=this.#e(t);return n.promise.then(()=>e(n.data)),null}const i=this.#t[t];if(!i||i.data===ri)throw new Error(`Requesting object that isn't resolved yet ${t}.`);return i.data}has(t){const e=this.#t[t];return!!e&&e.data!==ri}resolve(t,e=null){const i=this.#e(t);i.data=e,i.resolve()}clear(){for(const t in this.#t){const{data:e}=this.#t[t];e?.bitmap?.close()}this.#t=Object.create(null)}*[Symbol.iterator](){for(const t in this.#t){const{data:e}=this.#t[t];e!==ri&&(yield[t,e])}}}class To{#t=null;constructor(t){this.#t=t,this.onContinue=null}get promise(){return this.#t.capability.promise}cancel(t=0){this.#t.cancel(null,t)}get separateAnnots(){const{separateAnnots:t}=this.#t.operatorList;if(!t)return!1;const{annotationCanvasMap:e}=this.#t;return t.form||t.canvas&&e?.size>0}}class ge{#t=null;static#e=new WeakSet;constructor({callback:t,params:e,objs:i,commonObjs:n,annotationCanvasMap:s,operatorList:r,pageIndex:a,canvasFactory:l,filterFactory:h,useRequestAnimationFrame:c=!1,pdfBug:d=!1,pageColors:u=null}){this.callback=t,this.params=e,this.objs=i,this.commonObjs=n,this.annotationCanvasMap=s,this.operatorListIdx=null,this.operatorList=r,this._pageIndex=a,this.canvasFactory=l,this.filterFactory=h,this._pdfBug=d,this.pageColors=u,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=!0===c&&typeof window<"u",this.cancelled=!1,this.capability=Promise.withResolvers(),this.task=new To(this),this._cancelBound=this.cancel.bind(this),this._continueBound=this._continue.bind(this),this._scheduleNextBound=this._scheduleNext.bind(this),this._nextBound=this._next.bind(this),this._canvas=e.canvasContext.canvas}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics({transparency:t=!1,optionalContentConfig:e}){if(this.cancelled)return;if(this._canvas){if(ge.#e.has(this._canvas))throw new Error("Cannot use the same canvas during multiple render() operations. Use different canvas or ensure previous operations were cancelled or completed.");ge.#e.add(this._canvas)}this._pdfBug&&globalThis.StepperManager?.enabled&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{canvasContext:i,viewport:n,transform:s,background:r}=this.params;this.gfx=new fe(i,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:e},this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:s,viewport:n,transparency:t,background:r}),this.operatorListIdx=0,this.graphicsReady=!0,this.graphicsReadyCallback?.()}cancel(t=null,e=0){this.running=!1,this.cancelled=!0,this.gfx?.endDrawing(),this.#t&&(window.cancelAnimationFrame(this.#t),this.#t=null),ge.#e.delete(this._canvas),this.callback(t||new Ii(`Rendering cancelled, page ${this._pageIndex+1}`,e))}operatorListChanged(){this.graphicsReady?(this.stepper?.updateOperatorList(this.operatorList),!this.running&&this._continue()):this.graphicsReadyCallback||=this._continueBound}_continue(){this.running=!0,!this.cancelled&&(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?this.#t=window.requestAnimationFrame(()=>{this.#t=null,this._nextBound().catch(this._cancelBound)}):Promise.resolve().then(this._nextBound).catch(this._cancelBound)}_next(){var t=this;return(0,x.A)(function*(){t.cancelled||(t.operatorListIdx=t.gfx.executeOperatorList(t.operatorList,t.operatorListIdx,t._continueBound,t.stepper),t.operatorListIdx===t.operatorList.argsArray.length&&(t.running=!1,t.operatorList.lastChunk&&(t.gfx.endDrawing(),ge.#e.delete(t._canvas),t.callback())))})()}}const Mo="4.8.69",Lo="3634dab10";function fs(o){return Math.floor(255*Math.max(0,Math.min(1,o))).toString(16).padStart(2,"0")}function ke(o){return Math.max(0,Math.min(255,255*o))}class ps{static CMYK_G([t,e,i,n]){return["G",1-Math.min(1,.3*t+.59*i+.11*e+n)]}static G_CMYK([t]){return["CMYK",0,0,0,1-t]}static G_RGB([t]){return["RGB",t,t,t]}static G_rgb([t]){return[t=ke(t),t,t]}static G_HTML([t]){const e=fs(t);return`#${e}${e}${e}`}static RGB_G([t,e,i]){return["G",.3*t+.59*e+.11*i]}static RGB_rgb(t){return t.map(ke)}static RGB_HTML(t){return`#${t.map(fs).join("")}`}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB([t,e,i,n]){return["RGB",1-Math.min(1,t+n),1-Math.min(1,i+n),1-Math.min(1,e+n)]}static CMYK_rgb([t,e,i,n]){return[ke(1-Math.min(1,t+n)),ke(1-Math.min(1,i+n)),ke(1-Math.min(1,e+n))]}static CMYK_HTML(t){const e=this.CMYK_RGB(t).slice(1);return this.RGB_HTML(e)}static RGB_CMYK([t,e,i]){const n=1-t,s=1-e,r=1-i;return["CMYK",n,s,r,Math.min(n,s,r)]}}class Ro{create(t,e,i=!1){if(t<=0||e<=0)throw new Error("Invalid SVG dimensions");const n=this._createSVG("svg:svg");return n.setAttribute("version","1.1"),i||(n.setAttribute("width",`${t}px`),n.setAttribute("height",`${e}px`)),n.setAttribute("preserveAspectRatio","none"),n.setAttribute("viewBox",`0 0 ${t} ${e}`),n}createElement(t){if("string"!=typeof t)throw new Error("Invalid SVG element type");return this._createSVG(t)}_createSVG(t){X("Abstract method `_createSVG` called.")}}class Zi extends Ro{_createSVG(t){return document.createElementNS(zt,t)}}class gs{static setupStorage(t,e,i,n,s){const r=n.getValue(e,{value:null});switch(i.name){case"textarea":if(null!==r.value&&(t.textContent=r.value),"print"===s)break;t.addEventListener("input",a=>{n.setValue(e,{value:a.target.value})});break;case"input":if("radio"===i.attributes.type||"checkbox"===i.attributes.type){if(r.value===i.attributes.xfaOn?t.setAttribute("checked",!0):r.value===i.attributes.xfaOff&&t.removeAttribute("checked"),"print"===s)break;t.addEventListener("change",a=>{n.setValue(e,{value:a.target.getAttribute(a.target.checked?"xfaOn":"xfaOff")})})}else{if(null!==r.value&&t.setAttribute("value",r.value),"print"===s)break;t.addEventListener("input",a=>{n.setValue(e,{value:a.target.value})})}break;case"select":if(null!==r.value){t.setAttribute("value",r.value);for(const a of i.children)a.attributes.value===r.value?a.attributes.selected=!0:a.attributes.hasOwnProperty("selected")&&delete a.attributes.selected}t.addEventListener("input",a=>{const l=a.target.options;n.setValue(e,{value:-1===l.selectedIndex?"":l[l.selectedIndex].value})})}}static setAttributes({html:t,element:e,storage:i=null,intent:n,linkService:s}){const{attributes:r}=e,a=t instanceof HTMLAnchorElement;"radio"===r.type&&(r.name=`${r.name}-${n}`);for(const[l,h]of Object.entries(r))if(null!=h)switch(l){case"class":h.length&&t.setAttribute(l,h.join(" "));break;case"dataId":break;case"id":t.setAttribute("data-element-id",h);break;case"style":Object.assign(t.style,h);break;case"textContent":t.textContent=h;break;default:(!a||"href"!==l&&"newWindow"!==l)&&t.setAttribute(l,h)}a&&s.addLinkAttributes(t,r.href,r.newWindow),i&&r.dataId&&this.setupStorage(t,r.dataId,e,i)}static render(t){const e=t.annotationStorage,i=t.linkService,n=t.xfaHtml,s=t.intent||"display",r=document.createElement(n.name);n.attributes&&this.setAttributes({html:r,element:n,intent:s,linkService:i});const a="richText"!==s,l=t.div;if(l.append(r),t.viewport){const d=`matrix(${t.viewport.transform.join(",")})`;l.style.transform=d}a&&l.setAttribute("class","xfaLayer xfaFont");const h=[];if(0===n.children.length){if(n.value){const d=document.createTextNode(n.value);r.append(d),a&&Ie.shouldBuildText(n.name)&&h.push(d)}return{textDivs:h}}const c=[[n,-1,r]];for(;c.length>0;){const[d,u,f]=c.at(-1);if(u+1===d.children.length){c.pop();continue}const p=d.children[++c.at(-1)[1]];if(null===p)continue;const{name:g}=p;if("#text"===g){const m=document.createTextNode(p.value);h.push(m),f.append(m);continue}const b=p?.attributes?.xmlns?document.createElementNS(p.attributes.xmlns,g):document.createElement(g);if(f.append(b),p.attributes&&this.setAttributes({html:b,element:p,storage:e,intent:s,linkService:i}),p.children?.length>0)c.push([p,-1,b]);else if(p.value){const m=document.createTextNode(p.value);a&&Ie.shouldBuildText(g)&&h.push(m),b.append(m)}}for(const d of l.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))d.setAttribute("readOnly",!0);return{textDivs:h}}static update(t){const e=`matrix(${t.viewport.transform.join(",")})`;t.div.style.transform=e,t.div.hidden=!1}}const De=1e3,re=new WeakSet;function Ut(o){return{width:o[2]-o[0],height:o[3]-o[1]}}class ko{static create(t){switch(t.data.annotationType){case 2:return new ms(t);case 1:return new Do(t);case 20:switch(t.data.fieldType){case"Tx":return new Oo(t);case"Btn":return t.data.radioButton?new bs(t):t.data.checkBox?new No(t):new Bo(t);case"Ch":return new Vo(t);case"Sig":return new Fo(t)}return new ae(t);case 16:return new Ji(t);case 3:return new _s(t);case 4:return new Ho(t);case 5:return new zo(t);case 6:return new Wo(t);case 8:return new vs(t);case 14:return new Go(t);case 15:return new tn(t);case 7:return new Uo(t);case 9:return new As(t);case 10:return new $o(t);case 11:return new Xo(t);case 12:return new Yo(t);case 13:return new ys(t);case 17:return new Ko(t);default:return new it(t)}}}class it{#t=null;#e=!1;#i=null;constructor(t,{isRenderable:e=!1,ignoreBorder:i=!1,createQuadrilaterals:n=!1}={}){this.isRenderable=e,this.data=t.data,this.layer=t.layer,this.linkService=t.linkService,this.downloadManager=t.downloadManager,this.imageResourcesPath=t.imageResourcesPath,this.renderForms=t.renderForms,this.svgFactory=t.svgFactory,this.annotationStorage=t.annotationStorage,this.enableScripting=t.enableScripting,this.hasJSActions=t.hasJSActions,this._fieldObjects=t.fieldObjects,this.parent=t.parent,e&&(this.container=this._createContainer(i)),n&&this._createQuadrilaterals()}static _hasPopupData({titleObj:t,contentsObj:e,richText:i}){return!!(t?.str||e?.str||i?.str)}get _isEditable(){return this.data.isEditable}get hasPopupData(){return it._hasPopupData(this.data)}updateEdited(t){if(!this.container)return;this.#t||={rect:this.data.rect.slice(0)};const{rect:e}=t;e&&this.#n(e),this.#i?.popup.updateEdited(t)}resetEdited(){this.#t&&(this.#n(this.#t.rect),this.#i?.popup.resetEdited(),this.#t=null)}#n(t){const{container:{style:e},data:{rect:i,rotation:n},parent:{viewport:{rawDims:{pageWidth:s,pageHeight:r,pageX:a,pageY:l}}}}=this;i?.splice(0,4,...t);const{width:h,height:c}=Ut(t);e.left=100*(t[0]-a)/s+"%",e.top=100*(r-t[3]+l)/r+"%",0===n?(e.width=100*h/s+"%",e.height=100*c/r+"%"):this.setRotation(n)}_createContainer(t){const{data:e,parent:{page:i,viewport:n}}=this,s=document.createElement("section");s.setAttribute("data-annotation-id",e.id),this instanceof ae||(s.tabIndex=De);const{style:r}=s;if(r.zIndex=this.parent.zIndex++,e.alternativeText&&(s.title=e.alternativeText),e.noRotate&&s.classList.add("norotate"),!e.rect||this instanceof Ji){const{rotation:g}=e;return!e.hasOwnCanvas&&0!==g&&this.setRotation(g,s),s}const{width:a,height:l}=Ut(e.rect);if(!t&&e.borderStyle.width>0){r.borderWidth=`${e.borderStyle.width}px`;const g=e.borderStyle.horizontalCornerRadius,b=e.borderStyle.verticalCornerRadius;switch(g>0||b>0?r.borderRadius=`calc(${g}px * var(--scale-factor)) / calc(${b}px * var(--scale-factor))`:this instanceof bs&&(r.borderRadius=`calc(${a}px * var(--scale-factor)) / calc(${l}px * var(--scale-factor))`),e.borderStyle.style){case 1:r.borderStyle="solid";break;case 2:r.borderStyle="dashed";break;case 3:V("Unimplemented border style: beveled");break;case 4:V("Unimplemented border style: inset");break;case 5:r.borderBottomStyle="solid"}const m=e.borderColor||null;m?(this.#e=!0,r.borderColor=I.makeHexColor(0|m[0],0|m[1],0|m[2])):r.borderWidth=0}const h=I.normalizeRect([e.rect[0],i.view[3]-e.rect[1]+i.view[1],e.rect[2],i.view[3]-e.rect[3]+i.view[1]]),{pageWidth:c,pageHeight:d,pageX:u,pageY:f}=n.rawDims;r.left=100*(h[0]-u)/c+"%",r.top=100*(h[1]-f)/d+"%";const{rotation:p}=e;return e.hasOwnCanvas||0===p?(r.width=100*a/c+"%",r.height=100*l/d+"%"):this.setRotation(p,s),s}setRotation(t,e=this.container){if(!this.data.rect)return;const{pageWidth:i,pageHeight:n}=this.parent.viewport.rawDims,{width:s,height:r}=Ut(this.data.rect);let a,l;t%180==0?(a=100*s/i,l=100*r/n):(a=100*r/i,l=100*s/n),e.style.width=`${a}%`,e.style.height=`${l}%`,e.setAttribute("data-main-rotation",(360-t)%360)}get _commonActions(){const t=(e,i,n)=>{const s=n.detail[e],r=s[0],a=s.slice(1);n.target.style[i]=ps[`${r}_HTML`](a),this.annotationStorage.setValue(this.data.id,{[i]:ps[`${r}_rgb`](a)})};return U(this,"_commonActions",{display:e=>{const{display:i}=e.detail,n=i%2==1;this.container.style.visibility=n?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noView:n,noPrint:1===i||2===i})},print:e=>{this.annotationStorage.setValue(this.data.id,{noPrint:!e.detail.print})},hidden:e=>{const{hidden:i}=e.detail;this.container.style.visibility=i?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noPrint:i,noView:i})},focus:e=>{setTimeout(()=>e.target.focus({preventScroll:!1}),0)},userName:e=>{e.target.title=e.detail.userName},readonly:e=>{e.target.disabled=e.detail.readonly},required:e=>{this._setRequired(e.target,e.detail.required)},bgColor:e=>{t("bgColor","backgroundColor",e)},fillColor:e=>{t("fillColor","backgroundColor",e)},fgColor:e=>{t("fgColor","color",e)},textColor:e=>{t("textColor","color",e)},borderColor:e=>{t("borderColor","borderColor",e)},strokeColor:e=>{t("strokeColor","borderColor",e)},rotation:e=>{const i=e.detail.rotation;this.setRotation(i),this.annotationStorage.setValue(this.data.id,{rotation:i})}})}_dispatchEventFromSandbox(t,e){const i=this._commonActions;for(const n of Object.keys(e.detail))(t[n]||i[n])?.(e)}_setDefaultPropertiesFromJS(t){if(!this.enableScripting)return;const e=this.annotationStorage.getRawValue(this.data.id);if(!e)return;const i=this._commonActions;for(const[n,s]of Object.entries(e)){const r=i[n];r&&(r({detail:{[n]:s},target:t}),delete e[n])}}_createQuadrilaterals(){if(!this.container)return;const{quadPoints:t}=this.data;if(!t)return;const[e,i,n,s]=this.data.rect.map(g=>Math.fround(g));if(8===t.length){const[g,b,m,v]=t.subarray(2,6);if(n===g&&s===b&&e===m&&i===v)return}const{style:r}=this.container;let a;if(this.#e){const{borderColor:g,borderWidth:b}=r;r.borderWidth=0,a=["url('data:image/svg+xml;utf8,",'<svg xmlns="http://www.w3.org/2000/svg"',' preserveAspectRatio="none" viewBox="0 0 1 1">',`<g fill="transparent" stroke="${g}" stroke-width="${b}">`],this.container.classList.add("hasBorder")}const l=n-e,h=s-i,{svgFactory:c}=this,d=c.createElement("svg");d.classList.add("quadrilateralsContainer"),d.setAttribute("width",0),d.setAttribute("height",0);const u=c.createElement("defs");d.append(u);const f=c.createElement("clipPath"),p=`clippath_${this.data.id}`;f.setAttribute("id",p),f.setAttribute("clipPathUnits","objectBoundingBox"),u.append(f);for(let g=2,b=t.length;g<b;g+=8){const m=t[g],v=t[g+1],A=t[g+2],w=t[g+3],E=c.createElement("rect"),C=(A-e)/l,M=(s-v)/h,T=(m-A)/l,y=(v-w)/h;E.setAttribute("x",C),E.setAttribute("y",M),E.setAttribute("width",T),E.setAttribute("height",y),f.append(E),a?.push(`<rect vector-effect="non-scaling-stroke" x="${C}" y="${M}" width="${T}" height="${y}"/>`)}this.#e&&(a.push("</g></svg>')"),r.backgroundImage=a.join("")),this.container.append(d),this.container.style.clipPath=`url(#${p})`}_createPopup(){const{data:t}=this,e=this.#i=new Ji({data:{color:t.color,titleObj:t.titleObj,modificationDate:t.modificationDate,contentsObj:t.contentsObj,richText:t.richText,parentRect:t.rect,borderStyle:0,id:`popup_${t.id}`,rotation:t.rotation},parent:this.parent,elements:[this]});this.parent.div.append(e.render())}render(){X("Abstract method `AnnotationElement.render` called")}_getElementsByName(t,e=null){const i=[];if(this._fieldObjects){const n=this._fieldObjects[t];if(n)for(const{page:s,id:r,exportValues:a}of n){if(-1===s||r===e)continue;const l="string"==typeof a?a:null,h=document.querySelector(`[data-element-id="${r}"]`);!h||re.has(h)?i.push({id:r,exportValue:l,domElement:h}):V(`_getElementsByName - element not allowed: ${r}`)}return i}for(const n of document.getElementsByName(t)){const{exportValue:s}=n,r=n.getAttribute("data-element-id");r!==e&&re.has(n)&&i.push({id:r,exportValue:s,domElement:n})}return i}show(){this.container&&(this.container.hidden=!1),this.popup?.maybeShow()}hide(){this.container&&(this.container.hidden=!0),this.popup?.forceHide()}getElementsToTriggerPopup(){return this.container}addHighlightArea(){const t=this.getElementsToTriggerPopup();if(Array.isArray(t))for(const e of t)e.classList.add("highlightArea");else t.classList.add("highlightArea")}_editOnDoubleClick(){if(!this._isEditable)return;const{annotationEditorType:t,data:{id:e}}=this;this.container.addEventListener("dblclick",()=>{this.linkService.eventBus?.dispatch("switchannotationeditormode",{source:this,mode:t,editId:e})})}}class ms extends it{constructor(t,e=null){super(t,{isRenderable:!0,ignoreBorder:!!e?.ignoreBorder,createQuadrilaterals:!0}),this.isTooltipOnly=t.data.isTooltipOnly}render(){const{data:t,linkService:e}=this,i=document.createElement("a");i.setAttribute("data-element-id",t.id);let n=!1;return t.url?(e.addLinkAttributes(i,t.url,t.newWindow),n=!0):t.action?(this._bindNamedAction(i,t.action),n=!0):t.attachment?(this.#e(i,t.attachment,t.attachmentDest),n=!0):t.setOCGState?(this.#i(i,t.setOCGState),n=!0):t.dest?(this._bindLink(i,t.dest),n=!0):(t.actions&&(t.actions.Action||t.actions["Mouse Up"]||t.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(i,t),n=!0),t.resetForm?(this._bindResetFormAction(i,t.resetForm),n=!0):this.isTooltipOnly&&!n&&(this._bindLink(i,""),n=!0)),this.container.classList.add("linkAnnotation"),n&&this.container.append(i),this.container}#t(){this.container.setAttribute("data-internal-link","")}_bindLink(t,e){t.href=this.linkService.getDestinationHash(e),t.onclick=()=>(e&&this.linkService.goToDestination(e),!1),(e||""===e)&&this.#t()}_bindNamedAction(t,e){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeNamedAction(e),!1),this.#t()}#e(t,e,i=null){t.href=this.linkService.getAnchorUrl(""),e.description&&(t.title=e.description),t.onclick=()=>(this.downloadManager?.openOrDownloadData(e.content,e.filename,i),!1),this.#t()}#i(t,e){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeSetOCGState(e),!1),this.#t()}_bindJSAction(t,e){t.href=this.linkService.getAnchorUrl("");const i=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const n of Object.keys(e.actions)){const s=i.get(n);s&&(t[s]=()=>(this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e.id,name:n}}),!1))}t.onclick||(t.onclick=()=>!1),this.#t()}_bindResetFormAction(t,e){const i=t.onclick;if(i||(t.href=this.linkService.getAnchorUrl("")),this.#t(),!this._fieldObjects)return V('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),void(i||(t.onclick=()=>!1));t.onclick=()=>{i?.();const{fields:n,refs:s,include:r}=e,a=[];if(0!==n.length||0!==s.length){const c=new Set(s);for(const d of n){const u=this._fieldObjects[d]||[];for(const{id:f}of u)c.add(f)}for(const d of Object.values(this._fieldObjects))for(const u of d)c.has(u.id)===r&&a.push(u)}else for(const c of Object.values(this._fieldObjects))a.push(...c);const l=this.annotationStorage,h=[];for(const c of a){const{id:d}=c;switch(h.push(d),c.type){case"text":case"combobox":case"listbox":l.setValue(d,{value:c.defaultValue||""});break;case"checkbox":case"radiobutton":l.setValue(d,{value:c.defaultValue===c.exportValues});break;default:continue}const u=document.querySelector(`[data-element-id="${d}"]`);u&&(re.has(u)?u.dispatchEvent(new Event("resetform")):V(`_bindResetFormAction - element not allowed: ${d}`))}return this.enableScripting&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:h,name:"ResetForm"}}),!1}}}class Do extends it{constructor(t){super(t,{isRenderable:!0})}render(){this.container.classList.add("textAnnotation");const t=document.createElement("img");return t.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",t.setAttribute("data-l10n-id","pdfjs-text-annotation-type"),t.setAttribute("data-l10n-args",JSON.stringify({type:this.data.name})),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.append(t),this.container}}class ae extends it{render(){return this.container}showElementAndHideCanvas(t){this.data.hasOwnCanvas&&("CANVAS"===t.previousSibling?.nodeName&&(t.previousSibling.hidden=!0),t.hidden=!1)}_getKeyModifier(t){return bt.platform.isMac?t.metaKey:t.ctrlKey}_setEventListener(t,e,i,n,s){i.includes("mouse")?t.addEventListener(i,r=>{this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:n,value:s(r),shift:r.shiftKey,modifier:this._getKeyModifier(r)}})}):t.addEventListener(i,r=>{if("blur"===i){if(!e.focused||!r.relatedTarget)return;e.focused=!1}else if("focus"===i){if(e.focused)return;e.focused=!0}s&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:n,value:s(r)}})})}_setEventListeners(t,e,i,n){for(const[s,r]of i)("Action"===r||this.data.actions?.[r])&&(("Focus"===r||"Blur"===r)&&(e||={focused:!1}),this._setEventListener(t,e,s,r,n),"Focus"!==r||this.data.actions?.Blur?"Blur"===r&&!this.data.actions?.Focus&&this._setEventListener(t,e,"focus","Focus",null):this._setEventListener(t,e,"blur","Blur",null))}_setBackgroundColor(t){const e=this.data.backgroundColor||null;t.style.backgroundColor=null===e?"transparent":I.makeHexColor(e[0],e[1],e[2])}_setTextStyle(t){const{fontColor:i}=this.data.defaultAppearanceData,n=this.data.defaultAppearanceData.fontSize||9,s=t.style;let r;const l=h=>Math.round(10*h)/10;if(this.data.multiLine){const h=Math.abs(this.data.rect[3]-this.data.rect[1]-2),c=Math.round(h/(1.35*n))||1;r=Math.min(n,l(h/c/1.35))}else{const h=Math.abs(this.data.rect[3]-this.data.rect[1]-2);r=Math.min(n,l(h/1.35))}s.fontSize=`calc(${r}px * var(--scale-factor))`,s.color=I.makeHexColor(i[0],i[1],i[2]),null!==this.data.textAlignment&&(s.textAlign=["left","center","right"][this.data.textAlignment])}_setRequired(t,e){e?t.setAttribute("required",!0):t.removeAttribute("required"),t.setAttribute("aria-required",e)}}class Oo extends ae{constructor(t){super(t,{isRenderable:t.renderForms||t.data.hasOwnCanvas||!t.data.hasAppearance&&!!t.data.fieldValue})}setPropertyOnSiblings(t,e,i,n){const s=this.annotationStorage;for(const r of this._getElementsByName(t.name,t.id))r.domElement&&(r.domElement[e]=i),s.setValue(r.id,{[n]:i})}render(){const t=this.annotationStorage,e=this.data.id;this.container.classList.add("textWidgetAnnotation");let i=null;if(this.renderForms){const n=t.getValue(e,{value:this.data.fieldValue});let s=n.value||"";const r=t.getValue(e,{charLimit:this.data.maxLen}).charLimit;r&&s.length>r&&(s=s.slice(0,r));let a=n.formattedValue||this.data.textContent?.join("\n")||null;a&&this.data.comb&&(a=a.replaceAll(/\s+/g,""));const l={userValue:s,formattedValue:a,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?(i=document.createElement("textarea"),i.textContent=a??s,this.data.doNotScroll&&(i.style.overflowY="hidden")):(i=document.createElement("input"),i.type="text",i.setAttribute("value",a??s),this.data.doNotScroll&&(i.style.overflowX="hidden")),this.data.hasOwnCanvas&&(i.hidden=!0),re.add(i),i.setAttribute("data-element-id",e),i.disabled=this.data.readOnly,i.name=this.data.fieldName,i.tabIndex=De,this._setRequired(i,this.data.required),r&&(i.maxLength=r),i.addEventListener("input",c=>{t.setValue(e,{value:c.target.value}),this.setPropertyOnSiblings(i,"value",c.target.value,"value"),l.formattedValue=null}),i.addEventListener("resetform",c=>{i.value=l.userValue=this.data.defaultFieldValue??"",l.formattedValue=null});let h=c=>{const{formattedValue:d}=l;null!=d&&(c.target.value=d),c.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){i.addEventListener("focus",d=>{if(l.focused)return;const{target:u}=d;l.userValue&&(u.value=l.userValue),l.lastCommittedValue=u.value,l.commitKey=1,this.data.actions?.Focus||(l.focused=!0)}),i.addEventListener("updatefromsandbox",d=>{this.showElementAndHideCanvas(d.target),this._dispatchEventFromSandbox({value(f){l.userValue=f.detail.value??"",t.setValue(e,{value:l.userValue.toString()}),f.target.value=l.userValue},formattedValue(f){const{formattedValue:p}=f.detail;l.formattedValue=p,null!=p&&f.target!==document.activeElement&&(f.target.value=p),t.setValue(e,{formattedValue:p})},selRange(f){f.target.setSelectionRange(...f.detail.selRange)},charLimit:f=>{const{charLimit:p}=f.detail,{target:g}=f;if(0===p)return void g.removeAttribute("maxLength");g.setAttribute("maxLength",p);let b=l.userValue;!b||b.length<=p||(b=b.slice(0,p),g.value=l.userValue=b,t.setValue(e,{value:b}),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:b,willCommit:!0,commitKey:1,selStart:g.selectionStart,selEnd:g.selectionEnd}}))}},d)}),i.addEventListener("keydown",d=>{l.commitKey=1;let u=-1;if("Escape"===d.key?u=0:"Enter"!==d.key||this.data.multiLine?"Tab"===d.key&&(l.commitKey=3):u=2,-1===u)return;const{value:f}=d.target;l.lastCommittedValue!==f&&(l.lastCommittedValue=f,l.userValue=f,this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:f,willCommit:!0,commitKey:u,selStart:d.target.selectionStart,selEnd:d.target.selectionEnd}}))});const c=h;h=null,i.addEventListener("blur",d=>{if(!l.focused||!d.relatedTarget)return;this.data.actions?.Blur||(l.focused=!1);const{value:u}=d.target;l.userValue=u,l.lastCommittedValue!==u&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:u,willCommit:!0,commitKey:l.commitKey,selStart:d.target.selectionStart,selEnd:d.target.selectionEnd}}),c(d)}),this.data.actions?.Keystroke&&i.addEventListener("beforeinput",d=>{l.lastCommittedValue=null;const{data:u,target:f}=d,{value:p,selectionStart:g,selectionEnd:b}=f;let m=g,v=b;switch(d.inputType){case"deleteWordBackward":{const A=p.substring(0,g).match(/\w*[^\w]*$/);A&&(m-=A[0].length);break}case"deleteWordForward":{const A=p.substring(g).match(/^[^\w]*\w*/);A&&(v+=A[0].length);break}case"deleteContentBackward":g===b&&(m-=1);break;case"deleteContentForward":g===b&&(v+=1)}d.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:p,change:u||"",willCommit:!1,selStart:m,selEnd:v}})}),this._setEventListeners(i,l,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],d=>d.target.value)}if(h&&i.addEventListener("blur",h),this.data.comb){const d=(this.data.rect[2]-this.data.rect[0])/r;i.classList.add("comb"),i.style.letterSpacing=`calc(${d}px * var(--scale-factor) - 1ch)`}}else i=document.createElement("div"),i.textContent=this.data.fieldValue,i.style.verticalAlign="middle",i.style.display="table-cell",this.data.hasOwnCanvas&&(i.hidden=!0);return this._setTextStyle(i),this._setBackgroundColor(i),this._setDefaultPropertiesFromJS(i),this.container.append(i),this.container}}class Fo extends ae{constructor(t){super(t,{isRenderable:!!t.data.hasOwnCanvas})}}class No extends ae{constructor(t){super(t,{isRenderable:t.renderForms})}render(){const t=this.annotationStorage,e=this.data,i=e.id;let n=t.getValue(i,{value:e.exportValue===e.fieldValue}).value;"string"==typeof n&&(n="Off"!==n,t.setValue(i,{value:n})),this.container.classList.add("buttonWidgetAnnotation","checkBox");const s=document.createElement("input");return re.add(s),s.setAttribute("data-element-id",i),s.disabled=e.readOnly,this._setRequired(s,this.data.required),s.type="checkbox",s.name=e.fieldName,n&&s.setAttribute("checked",!0),s.setAttribute("exportValue",e.exportValue),s.tabIndex=De,s.addEventListener("change",r=>{const{name:a,checked:l}=r.target;for(const h of this._getElementsByName(a,i)){const c=l&&h.exportValue===e.exportValue;h.domElement&&(h.domElement.checked=c),t.setValue(h.id,{value:c})}t.setValue(i,{value:l})}),s.addEventListener("resetform",r=>{r.target.checked=(e.defaultFieldValue||"Off")===e.exportValue}),this.enableScripting&&this.hasJSActions&&(s.addEventListener("updatefromsandbox",r=>{this._dispatchEventFromSandbox({value(l){l.target.checked="Off"!==l.detail.value,t.setValue(i,{value:l.target.checked})}},r)}),this._setEventListeners(s,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],r=>r.target.checked)),this._setBackgroundColor(s),this._setDefaultPropertiesFromJS(s),this.container.append(s),this.container}}class bs extends ae{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.classList.add("buttonWidgetAnnotation","radioButton");const t=this.annotationStorage,e=this.data,i=e.id;let n=t.getValue(i,{value:e.fieldValue===e.buttonValue}).value;if("string"==typeof n&&(n=n!==e.buttonValue,t.setValue(i,{value:n})),n)for(const r of this._getElementsByName(e.fieldName,i))t.setValue(r.id,{value:!1});const s=document.createElement("input");if(re.add(s),s.setAttribute("data-element-id",i),s.disabled=e.readOnly,this._setRequired(s,this.data.required),s.type="radio",s.name=e.fieldName,n&&s.setAttribute("checked",!0),s.tabIndex=De,s.addEventListener("change",r=>{const{name:a,checked:l}=r.target;for(const h of this._getElementsByName(a,i))t.setValue(h.id,{value:!1});t.setValue(i,{value:l})}),s.addEventListener("resetform",r=>{const a=e.defaultFieldValue;r.target.checked=null!=a&&a===e.buttonValue}),this.enableScripting&&this.hasJSActions){const r=e.buttonValue;s.addEventListener("updatefromsandbox",a=>{this._dispatchEventFromSandbox({value:h=>{const c=r===h.detail.value;for(const d of this._getElementsByName(h.target.name)){const u=c&&d.id===i;d.domElement&&(d.domElement.checked=u),t.setValue(d.id,{value:u})}}},a)}),this._setEventListeners(s,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],a=>a.target.checked)}return this._setBackgroundColor(s),this._setDefaultPropertiesFromJS(s),this.container.append(s),this.container}}class Bo extends ms{constructor(t){super(t,{ignoreBorder:t.data.hasAppearance})}render(){const t=super.render();t.classList.add("buttonWidgetAnnotation","pushButton");const e=t.lastChild;return this.enableScripting&&this.hasJSActions&&e&&(this._setDefaultPropertiesFromJS(e),e.addEventListener("updatefromsandbox",i=>{this._dispatchEventFromSandbox({},i)})),t}}class Vo extends ae{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.classList.add("choiceWidgetAnnotation");const t=this.annotationStorage,e=this.data.id,i=t.getValue(e,{value:this.data.fieldValue}),n=document.createElement("select");re.add(n),n.setAttribute("data-element-id",e),n.disabled=this.data.readOnly,this._setRequired(n,this.data.required),n.name=this.data.fieldName,n.tabIndex=De;let s=this.data.combo&&this.data.options.length>0;this.data.combo||(n.size=this.data.options.length,this.data.multiSelect&&(n.multiple=!0)),n.addEventListener("resetform",c=>{const d=this.data.defaultFieldValue;for(const u of n.options)u.selected=u.value===d});for(const c of this.data.options){const d=document.createElement("option");d.textContent=c.displayValue,d.value=c.exportValue,i.value.includes(c.exportValue)&&(d.setAttribute("selected",!0),s=!1),n.append(d)}let r=null;if(s){const c=document.createElement("option");c.value=" ",c.setAttribute("hidden",!0),c.setAttribute("selected",!0),n.prepend(c),r=()=>{c.remove(),n.removeEventListener("input",r),r=null},n.addEventListener("input",r)}const a=c=>{const d=c?"value":"textContent",{options:u,multiple:f}=n;return f?Array.prototype.filter.call(u,p=>p.selected).map(p=>p[d]):-1===u.selectedIndex?null:u[u.selectedIndex][d]};let l=a(!1);const h=c=>Array.prototype.map.call(c.target.options,u=>({displayValue:u.textContent,exportValue:u.value}));return this.enableScripting&&this.hasJSActions?(n.addEventListener("updatefromsandbox",c=>{this._dispatchEventFromSandbox({value(u){r?.();const f=u.detail.value,p=new Set(Array.isArray(f)?f:[f]);for(const g of n.options)g.selected=p.has(g.value);t.setValue(e,{value:a(!0)}),l=a(!1)},multipleSelection(u){n.multiple=!0},remove(u){const f=n.options,p=u.detail.remove;f[p].selected=!1,n.remove(p),f.length>0&&-1===Array.prototype.findIndex.call(f,b=>b.selected)&&(f[0].selected=!0),t.setValue(e,{value:a(!0),items:h(u)}),l=a(!1)},clear(u){for(;0!==n.length;)n.remove(0);t.setValue(e,{value:null,items:[]}),l=a(!1)},insert(u){const{index:f,displayValue:p,exportValue:g}=u.detail.insert,b=n.children[f],m=document.createElement("option");m.textContent=p,m.value=g,b?b.before(m):n.append(m),t.setValue(e,{value:a(!0),items:h(u)}),l=a(!1)},items(u){const{items:f}=u.detail;for(;0!==n.length;)n.remove(0);for(const p of f){const{displayValue:g,exportValue:b}=p,m=document.createElement("option");m.textContent=g,m.value=b,n.append(m)}n.options.length>0&&(n.options[0].selected=!0),t.setValue(e,{value:a(!0),items:h(u)}),l=a(!1)},indices(u){const f=new Set(u.detail.indices);for(const p of u.target.options)p.selected=f.has(p.index);t.setValue(e,{value:a(!0)}),l=a(!1)},editable(u){u.target.disabled=!u.detail.editable}},c)}),n.addEventListener("input",c=>{const d=a(!0),u=a(!1);t.setValue(e,{value:d}),c.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:l,change:u,changeEx:d,willCommit:!1,commitKey:1,keyDown:!1}})}),this._setEventListeners(n,null,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"],["input","Validate"]],c=>c.target.value)):n.addEventListener("input",function(c){t.setValue(e,{value:a(!0)})}),this.data.combo&&this._setTextStyle(n),this._setBackgroundColor(n),this._setDefaultPropertiesFromJS(n),this.container.append(n),this.container}}class Ji extends it{constructor(t){const{data:e,elements:i}=t;super(t,{isRenderable:it._hasPopupData(e)}),this.elements=i,this.popup=null}render(){this.container.classList.add("popupAnnotation");const t=this.popup=new jo({container:this.container,color:this.data.color,titleObj:this.data.titleObj,modificationDate:this.data.modificationDate,contentsObj:this.data.contentsObj,richText:this.data.richText,rect:this.data.rect,parentRect:this.data.parentRect||null,parent:this.parent,elements:this.elements,open:this.data.open}),e=[];for(const i of this.elements)i.popup=t,i.container.ariaHasPopup="dialog",e.push(i.data.id),i.addHighlightArea();return this.container.setAttribute("aria-controls",e.map(i=>`${Li}${i}`).join(",")),this.container}}class jo{#t=this.#L.bind(this);#e=this.#S.bind(this);#i=this.#T.bind(this);#n=this.#x.bind(this);#s=null;#r=null;#l=null;#h=null;#c=null;#o=null;#d=null;#a=!1;#u=null;#p=null;#f=null;#g=null;#b=null;#m=null;#_=!1;constructor({container:t,color:e,elements:i,titleObj:n,modificationDate:s,contentsObj:r,richText:a,parent:l,rect:h,parentRect:c,open:d}){this.#r=t,this.#b=n,this.#l=r,this.#g=a,this.#o=l,this.#s=e,this.#f=h,this.#d=c,this.#c=i,this.#h=Dn.toDateObject(s),this.trigger=i.flatMap(u=>u.getElementsToTriggerPopup());for(const u of this.trigger)u.addEventListener("click",this.#n),u.addEventListener("mouseenter",this.#i),u.addEventListener("mouseleave",this.#e),u.classList.add("popupTriggerArea");for(const u of i)u.container?.addEventListener("keydown",this.#t);this.#r.hidden=!0,d&&this.#x()}render(){if(this.#u)return;const t=this.#u=document.createElement("div");if(t.className="popup",this.#s){const s=t.style.outlineColor=I.makeHexColor(...this.#s);t.style.backgroundColor=CSS.supports("background-color","color-mix(in srgb, red 30%, white)")?`color-mix(in srgb, ${s} 30%, white)`:I.makeHexColor(...this.#s.map(a=>Math.floor(.7*(255-a)+a)))}const e=document.createElement("span");e.className="header";const i=document.createElement("h1");if(e.append(i),({dir:i.dir,str:i.textContent}=this.#b),t.append(e),this.#h){const s=document.createElement("span");s.classList.add("popupDate"),s.setAttribute("data-l10n-id","pdfjs-annotation-date-time-string"),s.setAttribute("data-l10n-args",JSON.stringify({dateObj:this.#h.valueOf()})),e.append(s)}const n=this.#A;if(n)gs.render({xfaHtml:n,intent:"richText",div:t}),t.lastChild.classList.add("richText","popupContent");else{const s=this._formatContents(this.#l);t.append(s)}this.#r.append(t)}get#A(){const t=this.#g,e=this.#l;return t?.str&&(!e?.str||e.str===t.str)&&this.#g.html||null}get#E(){return this.#A?.attributes?.style?.fontSize||0}get#y(){return this.#A?.attributes?.style?.color||null}#w(t){const e=[],i={str:t,html:{name:"div",attributes:{dir:"auto"},children:[{name:"p",children:e}]}},n={style:{color:this.#y,fontSize:this.#E?`calc(${this.#E}px * var(--scale-factor))`:""}};for(const s of t.split("\n"))e.push({name:"span",value:s,attributes:n});return i}_formatContents({str:t,dir:e}){const i=document.createElement("p");i.classList.add("popupContent"),i.dir=e;const n=t.split(/(?:\r\n?|\n)/);for(let s=0,r=n.length;s<r;++s)i.append(document.createTextNode(n[s])),s<r-1&&i.append(document.createElement("br"));return i}#L(t){t.altKey||t.shiftKey||t.ctrlKey||t.metaKey||("Enter"===t.key||"Escape"===t.key&&this.#a)&&this.#x()}updateEdited({rect:t,popupContent:e}){this.#m||={contentsObj:this.#l,richText:this.#g},t&&(this.#p=null),e&&(this.#g=this.#w(e),this.#l=null),this.#u?.remove(),this.#u=null}resetEdited(){this.#m&&(({contentsObj:this.#l,richText:this.#g}=this.#m),this.#m=null,this.#u?.remove(),this.#u=null,this.#p=null)}#P(){if(null!==this.#p)return;const{page:{view:t},viewport:{rawDims:{pageWidth:e,pageHeight:i,pageX:n,pageY:s}}}=this.#o;let r=!!this.#d,a=r?this.#d:this.#f;for(const p of this.#c)if(!a||null!==I.intersect(p.data.rect,a)){a=p.data.rect,r=!0;break}const l=I.normalizeRect([a[0],t[3]-a[1]+t[1],a[2],t[3]-a[3]+t[1]]);this.#p=[100*(l[0]+(r?a[2]-a[0]+5:0)-n)/e,100*(l[1]-s)/i];const{style:f}=this.#r;f.left=`${this.#p[0]}%`,f.top=`${this.#p[1]}%`}#x(){this.#a=!this.#a,this.#a?(this.#T(),this.#r.addEventListener("click",this.#n),this.#r.addEventListener("keydown",this.#t)):(this.#S(),this.#r.removeEventListener("click",this.#n),this.#r.removeEventListener("keydown",this.#t))}#T(){this.#u||this.render(),this.isVisible?this.#a&&this.#r.classList.add("focused"):(this.#P(),this.#r.hidden=!1,this.#r.style.zIndex=parseInt(this.#r.style.zIndex)+1e3)}#S(){this.#r.classList.remove("focused"),!this.#a&&this.isVisible&&(this.#r.hidden=!0,this.#r.style.zIndex=parseInt(this.#r.style.zIndex)-1e3)}forceHide(){this.#_=this.isVisible,this.#_&&(this.#r.hidden=!0)}maybeShow(){this.#_&&(this.#u||this.#T(),this.#_=!1,this.#r.hidden=!1)}get isVisible(){return!1===this.#r.hidden}}class _s extends it{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.textContent=t.data.textContent,this.textPosition=t.data.textPosition,this.annotationEditorType=B.FREETEXT}render(){if(this.container.classList.add("freeTextAnnotation"),this.textContent){const t=document.createElement("div");t.classList.add("annotationTextContent"),t.setAttribute("role","comment");for(const e of this.textContent){const i=document.createElement("span");i.textContent=e,t.append(i)}this.container.append(t)}return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this._editOnDoubleClick(),this.container}}class Ho extends it{#t=null;constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("lineAnnotation");const t=this.data,{width:e,height:i}=Ut(t.rect),n=this.svgFactory.create(e,i,!0),s=this.#t=this.svgFactory.createElement("svg:line");return s.setAttribute("x1",t.rect[2]-t.lineCoordinates[0]),s.setAttribute("y1",t.rect[3]-t.lineCoordinates[1]),s.setAttribute("x2",t.rect[2]-t.lineCoordinates[2]),s.setAttribute("y2",t.rect[3]-t.lineCoordinates[3]),s.setAttribute("stroke-width",t.borderStyle.width||1),s.setAttribute("stroke","transparent"),s.setAttribute("fill","transparent"),n.append(s),this.container.append(n),!t.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#t}addHighlightArea(){this.container.classList.add("highlightArea")}}class zo extends it{#t=null;constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("squareAnnotation");const t=this.data,{width:e,height:i}=Ut(t.rect),n=this.svgFactory.create(e,i,!0),s=t.borderStyle.width,r=this.#t=this.svgFactory.createElement("svg:rect");return r.setAttribute("x",s/2),r.setAttribute("y",s/2),r.setAttribute("width",e-s),r.setAttribute("height",i-s),r.setAttribute("stroke-width",s||1),r.setAttribute("stroke","transparent"),r.setAttribute("fill","transparent"),n.append(r),this.container.append(n),!t.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#t}addHighlightArea(){this.container.classList.add("highlightArea")}}class Wo extends it{#t=null;constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("circleAnnotation");const t=this.data,{width:e,height:i}=Ut(t.rect),n=this.svgFactory.create(e,i,!0),s=t.borderStyle.width,r=this.#t=this.svgFactory.createElement("svg:ellipse");return r.setAttribute("cx",e/2),r.setAttribute("cy",i/2),r.setAttribute("rx",e/2-s/2),r.setAttribute("ry",i/2-s/2),r.setAttribute("stroke-width",s||1),r.setAttribute("stroke","transparent"),r.setAttribute("fill","transparent"),n.append(r),this.container.append(n),!t.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#t}addHighlightArea(){this.container.classList.add("highlightArea")}}class vs extends it{#t=null;constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.containerClassName="polylineAnnotation",this.svgElementName="svg:polyline"}render(){this.container.classList.add(this.containerClassName);const{data:{rect:t,vertices:e,borderStyle:i,popupRef:n}}=this;if(!e)return this.container;const{width:s,height:r}=Ut(t),a=this.svgFactory.create(s,r,!0);let l=[];for(let c=0,d=e.length;c<d;c+=2)l.push(`${e[c]-t[0]},${t[3]-e[c+1]}`);l=l.join(" ");const h=this.#t=this.svgFactory.createElement(this.svgElementName);return h.setAttribute("points",l),h.setAttribute("stroke-width",i.width||1),h.setAttribute("stroke","transparent"),h.setAttribute("fill","transparent"),a.append(h),this.container.append(a),!n&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#t}addHighlightArea(){this.container.classList.add("highlightArea")}}class Uo extends vs{constructor(t){super(t),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}}class Go extends it{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("caretAnnotation"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container}}class tn extends it{#t=[];constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline",this.annotationEditorType="InkHighlight"===this.data.it?B.HIGHLIGHT:B.INK}render(){this.container.classList.add(this.containerClassName);const{data:{rect:t,inkLists:e,borderStyle:i,popupRef:n}}=this,{width:s,height:r}=Ut(t),a=this.svgFactory.create(s,r,!0);for(const l of e){let h=[];for(let d=0,u=l.length;d<u;d+=2)h.push(`${l[d]-t[0]},${t[3]-l[d+1]}`);h=h.join(" ");const c=this.svgFactory.createElement(this.svgElementName);this.#t.push(c),c.setAttribute("points",h),c.setAttribute("stroke-width",i.width||1),c.setAttribute("stroke","transparent"),c.setAttribute("fill","transparent"),a.append(c)}return!n&&this.hasPopupData&&this._createPopup(),this.container.append(a),this._editOnDoubleClick(),this.container}getElementsToTriggerPopup(){return this.#t}addHighlightArea(){this.container.classList.add("highlightArea")}}class As extends it{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0}),this.annotationEditorType=B.HIGHLIGHT}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("highlightAnnotation"),this._editOnDoubleClick(),this.container}}class $o extends it{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("underlineAnnotation"),this.container}}class Xo extends it{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("squigglyAnnotation"),this.container}}class Yo extends it{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("strikeoutAnnotation"),this.container}}class ys extends it{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.annotationEditorType=B.STAMP}render(){return this.container.classList.add("stampAnnotation"),this.container.setAttribute("role","img"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this._editOnDoubleClick(),this.container}}class Ko extends it{#t=null;constructor(t){super(t,{isRenderable:!0});const{file:e}=this.data;this.filename=e.filename,this.content=e.content,this.linkService.eventBus?.dispatch("fileattachmentannotation",{source:this,...e})}render(){this.container.classList.add("fileAttachmentAnnotation");const{container:t,data:e}=this;let i;e.hasAppearance||0===e.fillAlpha?i=document.createElement("div"):(i=document.createElement("img"),i.src=`${this.imageResourcesPath}annotation-${/paperclip/i.test(e.name)?"paperclip":"pushpin"}.svg`,e.fillAlpha&&e.fillAlpha<1&&(i.style=`filter: opacity(${Math.round(100*e.fillAlpha)}%);`)),i.addEventListener("dblclick",this.#e.bind(this)),this.#t=i;const{isMac:n}=bt.platform;return t.addEventListener("keydown",s=>{"Enter"===s.key&&(n?s.metaKey:s.ctrlKey)&&this.#e()}),!e.popupRef&&this.hasPopupData?this._createPopup():i.classList.add("popupTriggerArea"),t.append(i),t}getElementsToTriggerPopup(){return this.#t}addHighlightArea(){this.container.classList.add("highlightArea")}#e(){this.downloadManager?.openOrDownloadData(this.content,this.filename)}}class qo{#t=null;#e=null;#i=new Map;#n=null;constructor({div:t,accessibilityManager:e,annotationCanvasMap:i,annotationEditorUIManager:n,page:s,viewport:r,structTreeLayer:a}){this.div=t,this.#t=e,this.#e=i,this.#n=a||null,this.page=s,this.viewport=r,this.zIndex=0,this._annotationEditorUIManager=n}hasEditableAnnotations(){return this.#i.size>0}#s(t,e){var i=this;return(0,x.A)(function*(){const n=t.firstChild||t,s=n.id=`${Li}${e}`,r=yield i.#n?.getAriaAttributes(s);if(r)for(const[a,l]of r)n.setAttribute(a,l);i.div.append(t),i.#t?.moveElementInDOM(i.div,t,n,!1)})()}render(t){var e=this;return(0,x.A)(function*(){const{annotations:i}=t,n=e.div;se(n,e.viewport);const s=new Map,r={data:null,layer:n,linkService:t.linkService,downloadManager:t.downloadManager,imageResourcesPath:t.imageResourcesPath||"",renderForms:!1!==t.renderForms,svgFactory:new Zi,annotationStorage:t.annotationStorage||new Vi,enableScripting:!0===t.enableScripting,hasJSActions:t.hasJSActions,fieldObjects:t.fieldObjects,parent:e,elements:null};for(const a of i){if(a.noHTML)continue;const l=16===a.annotationType;if(l){const d=s.get(a.id);if(!d)continue;r.elements=d}else{const{width:d,height:u}=Ut(a.rect);if(d<=0||u<=0)continue}r.data=a;const h=ko.create(r);if(!h.isRenderable)continue;if(!l&&a.popupRef){const d=s.get(a.popupRef);d?d.push(h):s.set(a.popupRef,[h])}const c=h.render();a.hidden&&(c.style.visibility="hidden"),yield e.#s(c,a.id),h._isEditable&&(e.#i.set(h.data.id,h),e._annotationEditorUIManager?.renderAnnotationElement(h))}e.#r()})()}update({viewport:t}){const e=this.div;this.viewport=t,se(e,{rotation:t.rotation}),this.#r(),e.hidden=!1}#r(){if(!this.#e)return;const t=this.div;for(const[e,i]of this.#e){const n=t.querySelector(`[data-annotation-id="${e}"]`);if(!n)continue;i.className="annotationContent";const{firstChild:s}=n;s?"CANVAS"===s.nodeName?s.replaceWith(i):s.classList.contains("annotationContent")?s.after(i):s.before(i):n.append(i)}this.#e.clear()}getEditableAnnotations(){return Array.from(this.#i.values())}getEditableAnnotation(t){return this.#i.get(t)}}const ai=/\r\n?|\n/g;class ht extends O{#t;#e="";#i=`${this.id}-editor`;#n=null;#s;static _freeTextDefaultContent="";static _internalPadding=0;static _defaultColor=null;static _defaultFontSize=10;static get _keyboardManager(){const t=ht.prototype,e=s=>s.isEmpty(),i=Te.TRANSLATE_SMALL,n=Te.TRANSLATE_BIG;return U(this,"_keyboardManager",new Pe([[["ctrl+s","mac+meta+s","ctrl+p","mac+meta+p"],t.commitOrRemove,{bubbles:!0}],[["ctrl+Enter","mac+meta+Enter","Escape","mac+Escape"],t.commitOrRemove],[["ArrowLeft","mac+ArrowLeft"],t._translateEmpty,{args:[-i,0],checker:e}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t._translateEmpty,{args:[-n,0],checker:e}],[["ArrowRight","mac+ArrowRight"],t._translateEmpty,{args:[i,0],checker:e}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t._translateEmpty,{args:[n,0],checker:e}],[["ArrowUp","mac+ArrowUp"],t._translateEmpty,{args:[0,-i],checker:e}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t._translateEmpty,{args:[0,-n],checker:e}],[["ArrowDown","mac+ArrowDown"],t._translateEmpty,{args:[0,i],checker:e}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t._translateEmpty,{args:[0,n],checker:e}]]))}static _type="freetext";static _editorType=B.FREETEXT;constructor(t){super({...t,name:"freeTextEditor"}),this.#t=t.color||ht._defaultColor||O._defaultLineColor,this.#s=t.fontSize||ht._defaultFontSize}static initialize(t,e){O.initialize(t,e);const i=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(i.getPropertyValue("--freetext-padding"))}static updateDefaultParams(t,e){switch(t){case D.FREETEXT_SIZE:ht._defaultFontSize=e;break;case D.FREETEXT_COLOR:ht._defaultColor=e}}updateParams(t,e){switch(t){case D.FREETEXT_SIZE:this.#r(e);break;case D.FREETEXT_COLOR:this.#l(e)}}static get defaultPropertiesToUpdate(){return[[D.FREETEXT_SIZE,ht._defaultFontSize],[D.FREETEXT_COLOR,ht._defaultColor||O._defaultLineColor]]}get propertiesToUpdate(){return[[D.FREETEXT_SIZE,this.#s],[D.FREETEXT_COLOR,this.#t]]}#r(t){const e=n=>{this.editorDiv.style.fontSize=`calc(${n}px * var(--scale-factor))`,this.translate(0,-(n-this.#s)*this.parentScale),this.#s=n,this.#c()},i=this.#s;this.addCommands({cmd:e.bind(this,t),undo:e.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:D.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})}#l(t){const e=n=>{this.#t=this.editorDiv.style.color=n},i=this.#t;this.addCommands({cmd:e.bind(this,t),undo:e.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:D.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})}_translateEmpty(t,e){this._uiManager.translateSelectedEditors(t,e,!0)}getInitialTranslation(){const t=this.parentScale;return[-ht._internalPadding*t,-(ht._internalPadding+this.#s)*t]}rebuild(){this.parent&&(super.rebuild(),null!==this.div&&(this.isAttachedToDOM||this.parent.add(this)))}enableEditMode(){if(this.isInEditMode())return;this.parent.setEditingState(!1),this.parent.updateToolbar(B.FREETEXT),super.enableEditMode(),this.overlayDiv.classList.remove("enabled"),this.editorDiv.contentEditable=!0,this._isDraggable=!1,this.div.removeAttribute("aria-activedescendant"),this.#n=new AbortController;const t=this._uiManager.combinedSignal(this.#n);this.editorDiv.addEventListener("keydown",this.editorDivKeydown.bind(this),{signal:t}),this.editorDiv.addEventListener("focus",this.editorDivFocus.bind(this),{signal:t}),this.editorDiv.addEventListener("blur",this.editorDivBlur.bind(this),{signal:t}),this.editorDiv.addEventListener("input",this.editorDivInput.bind(this),{signal:t}),this.editorDiv.addEventListener("paste",this.editorDivPaste.bind(this),{signal:t})}disableEditMode(){this.isInEditMode()&&(this.parent.setEditingState(!0),super.disableEditMode(),this.overlayDiv.classList.add("enabled"),this.editorDiv.contentEditable=!1,this.div.setAttribute("aria-activedescendant",this.#i),this._isDraggable=!0,this.#n?.abort(),this.#n=null,this.div.focus({preventScroll:!0}),this.isEditing=!1,this.parent.div.classList.add("freetextEditing"))}focusin(t){this._focusEventsAllowed&&(super.focusin(t),t.target!==this.editorDiv&&this.editorDiv.focus())}onceAdded(){this.width||(this.enableEditMode(),this.editorDiv.focus(),this._initialOptions?.isCentered&&this.center(),this._initialOptions=null)}isEmpty(){return!this.editorDiv||""===this.editorDiv.innerText.trim()}remove(){this.isEditing=!1,this.parent&&(this.parent.setEditingState(!0),this.parent.div.classList.add("freetextEditing")),super.remove()}#h(){const t=[];this.editorDiv.normalize();let e=null;for(const i of this.editorDiv.childNodes)e?.nodeType===Node.TEXT_NODE&&"BR"===i.nodeName||(t.push(ht.#o(i)),e=i);return t.join("\n")}#c(){const[t,e]=this.parentDimensions;let i;if(this.isAttachedToDOM)i=this.div.getBoundingClientRect();else{const{currentLayer:n,div:s}=this,r=s.style.display,a=s.classList.contains("hidden");s.classList.remove("hidden"),s.style.display="hidden",n.div.append(this.div),i=s.getBoundingClientRect(),s.remove(),s.style.display=r,s.classList.toggle("hidden",a)}this.rotation%180==this.parentRotation%180?(this.width=i.width/t,this.height=i.height/e):(this.width=i.height/t,this.height=i.width/e),this.fixAndSetPosition()}commit(){if(!this.isInEditMode())return;super.commit(),this.disableEditMode();const t=this.#e,e=this.#e=this.#h().trimEnd();if(t===e)return;const i=n=>{this.#e=n,n?(this.#d(),this._uiManager.rebuild(this),this.#c()):this.remove()};this.addCommands({cmd:()=>{i(e)},undo:()=>{i(t)},mustExec:!1}),this.#c()}shouldGetKeyboardEvents(){return this.isInEditMode()}enterInEditMode(){this.enableEditMode(),this.editorDiv.focus()}dblclick(t){this.enterInEditMode()}keydown(t){t.target===this.div&&"Enter"===t.key&&(this.enterInEditMode(),t.preventDefault())}editorDivKeydown(t){ht._keyboardManager.exec(this,t)}editorDivFocus(t){this.isEditing=!0}editorDivBlur(t){this.isEditing=!1}editorDivInput(t){this.parent.div.classList.toggle("freetextEditing",this.isEmpty())}disableEditing(){this.editorDiv.setAttribute("role","comment"),this.editorDiv.removeAttribute("aria-multiline")}enableEditing(){this.editorDiv.setAttribute("role","textbox"),this.editorDiv.setAttribute("aria-multiline",!0)}render(){if(this.div)return this.div;let t,e;this.width&&(t=this.x,e=this.y),super.render(),this.editorDiv=document.createElement("div"),this.editorDiv.className="internal",this.editorDiv.setAttribute("id",this.#i),this.editorDiv.setAttribute("data-l10n-id","pdfjs-free-text2"),this.editorDiv.setAttribute("data-l10n-attrs","default-content"),this.enableEditing(),this.editorDiv.contentEditable=!0;const{style:i}=this.editorDiv;if(i.fontSize=`calc(${this.#s}px * var(--scale-factor))`,i.color=this.#t,this.div.append(this.editorDiv),this.overlayDiv=document.createElement("div"),this.overlayDiv.classList.add("overlay","enabled"),this.div.append(this.overlayDiv),ti(this,this.div,["dblclick","keydown"]),this.width){const[n,s]=this.parentDimensions;if(this.annotationElementId){const{position:r}=this._initialData;let[a,l]=this.getInitialTranslation();[a,l]=this.pageTranslationToScreen(a,l);const[h,c]=this.pageDimensions,[d,u]=this.pageTranslation;let f,p;switch(this.rotation){case 0:f=t+(r[0]-d)/h,p=e+this.height-(r[1]-u)/c;break;case 90:f=t+(r[0]-d)/h,p=e-(r[1]-u)/c,[a,l]=[l,-a];break;case 180:f=t-this.width+(r[0]-d)/h,p=e-(r[1]-u)/c,[a,l]=[-a,-l];break;case 270:f=t+(r[0]-d-this.height*c)/h,p=e+(r[1]-u-this.width*h)/c,[a,l]=[-l,a]}this.setAt(f*n,p*s,a,l)}else this.setAt(t*n,e*s,this.width*n,this.height*s);this.#d(),this._isDraggable=!0,this.editorDiv.contentEditable=!1}else this._isDraggable=!1,this.editorDiv.contentEditable=!0;return this.div}static#o(t){return(t.nodeType===Node.TEXT_NODE?t.nodeValue:t.innerText).replaceAll(ai,"")}editorDivPaste(t){const e=t.clipboardData||window.clipboardData,{types:i}=e;if(1===i.length&&"text/plain"===i[0])return;t.preventDefault();const n=ht.#u(e.getData("text")||"").replaceAll(ai,"\n");if(!n)return;const s=window.getSelection();if(!s.rangeCount)return;this.editorDiv.normalize(),s.deleteFromDocument();const r=s.getRangeAt(0);if(!n.includes("\n"))return r.insertNode(document.createTextNode(n)),this.editorDiv.normalize(),void s.collapseToStart();const{startContainer:a,startOffset:l}=r,h=[],c=[];if(a.nodeType===Node.TEXT_NODE){const f=a.parentElement;if(c.push(a.nodeValue.slice(l).replaceAll(ai,"")),f!==this.editorDiv){let p=h;for(const g of this.editorDiv.childNodes)g!==f?p.push(ht.#o(g)):p=c}h.push(a.nodeValue.slice(0,l).replaceAll(ai,""))}else if(a===this.editorDiv){let f=h,p=0;for(const g of this.editorDiv.childNodes)p++===l&&(f=c),f.push(ht.#o(g))}this.#e=`${h.join("\n")}${n}${c.join("\n")}`,this.#d();const d=new Range;let u=h.reduce((f,p)=>f+p.length,0);for(const{firstChild:f}of this.editorDiv.childNodes)if(f.nodeType===Node.TEXT_NODE){const p=f.nodeValue.length;if(u<=p){d.setStart(f,u),d.setEnd(f,u);break}u-=p}s.removeAllRanges(),s.addRange(d)}#d(){if(this.editorDiv.replaceChildren(),this.#e)for(const t of this.#e.split("\n")){const e=document.createElement("div");e.append(t?document.createTextNode(t):document.createElement("br")),this.editorDiv.append(e)}}#a(){return this.#e.replaceAll("\xa0"," ")}static#u(t){return t.replaceAll(" ","\xa0")}get contentDiv(){return this.editorDiv}static deserialize(t,e,i){var n=()=>super.deserialize,s=this;return(0,x.A)(function*(){let r=null;if(t instanceof _s){const{data:{defaultAppearanceData:{fontSize:l,fontColor:h},rect:c,rotation:d,id:u,popupRef:f},textContent:p,textPosition:g,parent:{page:{pageNumber:b}}}=t;if(!p||0===p.length)return null;r=t={annotationType:B.FREETEXT,color:Array.from(h),fontSize:l,value:p.join("\n"),position:g,pageIndex:b-1,rect:c.slice(0),rotation:d,id:u,deleted:!1,popupRef:f}}const a=yield n().call(s,t,e,i);return a.#s=t.fontSize,a.#t=I.makeHexColor(...t.color),a.#e=ht.#u(t.value),a.annotationElementId=t.id||null,a._initialData=r,a})()}serialize(t=!1){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const e=ht._internalPadding*this.parentScale,i=this.getRect(e,e),n=O._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:this.#t),s={annotationType:B.FREETEXT,color:n,fontSize:this.#s,value:this.#a(),pageIndex:this.pageIndex,rect:i,rotation:this.rotation,structTreeParentId:this._structTreeParentId};return t?s:this.annotationElementId&&!this.#p(s)?null:(s.id=this.annotationElementId,s)}#p(t){const{value:e,fontSize:i,color:n,pageIndex:s}=this._initialData;return this._hasBeenMoved||t.value!==e||t.fontSize!==i||t.color.some((r,a)=>r!==n[a])||t.pageIndex!==s}renderAnnotationElement(t){const e=super.renderAnnotationElement(t);if(this.deleted)return e;const{style:i}=e;i.fontSize=`calc(${this.#s}px * var(--scale-factor))`,i.color=this.#t,e.replaceChildren();for(const s of this.#e.split("\n")){const r=document.createElement("div");r.append(s?document.createTextNode(s):document.createElement("br")),e.append(r)}const n=ht._internalPadding*this.parentScale;return t.updateEdited({rect:this.getRect(n,n),popupContent:this.#e}),e}resetAnnotationElement(t){super.resetAnnotationElement(t),t.resetEdited()}}class ws{toSVGPath(){X("Abstract method `toSVGPath` must be implemented.")}get box(){X("Abstract getter `box` must be implemented.")}serialize(t,e){X("Abstract method `serialize` must be implemented.")}get classNamesForDrawing(){X("Abstract getter `classNamesForDrawing` must be implemented.")}get classNamesForOutlining(){X("Abstract getter `classNamesForOutlining` must be implemented.")}get mustRemoveSelfIntersections(){return!1}}class oe{#t;#e=[];#i;#n;#s=[];#r=new Float64Array(18);#l;#h;#c;#o;#d;#a;#u=[];static#p=8;static#f=2;static#g=oe.#p+oe.#f;constructor({x:t,y:e},i,n,s,r,a=0){this.#t=i,this.#a=s*n,this.#n=r,this.#r.set([NaN,NaN,NaN,NaN,t,e],6),this.#i=a,this.#o=oe.#p*n,this.#c=oe.#g*n,this.#d=n,this.#u.push(t,e)}isEmpty(){return isNaN(this.#r[8])}#b(){const t=this.#r.subarray(4,6),e=this.#r.subarray(16,18),[i,n,s,r]=this.#t;return[(this.#l+(t[0]-e[0])/2-i)/s,(this.#h+(t[1]-e[1])/2-n)/r,(this.#l+(e[0]-t[0])/2-i)/s,(this.#h+(e[1]-t[1])/2-n)/r]}add({x:t,y:e}){this.#l=t,this.#h=e;const[i,n,s,r]=this.#t;let[a,l,h,c]=this.#r.subarray(8,12);const d=t-h,u=e-c,f=Math.hypot(d,u);if(f<this.#c)return!1;const p=f-this.#o,g=p/f,b=g*d,m=g*u;let v=a,A=l;a=h,l=c,h+=b,c+=m,this.#u?.push(t,e);const C=-m/p*this.#a,M=b/p*this.#a;return this.#r.set(this.#r.subarray(2,8),0),this.#r.set([h+C,c+M],4),this.#r.set(this.#r.subarray(14,18),12),this.#r.set([h-C,c-M],16),isNaN(this.#r[6])?(0===this.#s.length&&(this.#r.set([a+C,l+M],2),this.#s.push(NaN,NaN,NaN,NaN,(a+C-i)/s,(l+M-n)/r),this.#r.set([a-C,l-M],14),this.#e.push(NaN,NaN,NaN,NaN,(a-C-i)/s,(l-M-n)/r)),this.#r.set([v,A,a,l,h,c],6),!this.isEmpty()):(this.#r.set([v,A,a,l,h,c],6),Math.abs(Math.atan2(A-l,v-a)-Math.atan2(m,b))<Math.PI/2?([a,l,h,c]=this.#r.subarray(2,6),this.#s.push(NaN,NaN,NaN,NaN,((a+h)/2-i)/s,((l+c)/2-n)/r),[a,l,v,A]=this.#r.subarray(14,18),this.#e.push(NaN,NaN,NaN,NaN,((v+a)/2-i)/s,((A+l)/2-n)/r),!0):([v,A,a,l,h,c]=this.#r.subarray(0,6),this.#s.push(((v+5*a)/6-i)/s,((A+5*l)/6-n)/r,((5*a+h)/6-i)/s,((5*l+c)/6-n)/r,((a+h)/2-i)/s,((l+c)/2-n)/r),[h,c,a,l,v,A]=this.#r.subarray(12,18),this.#e.push(((v+5*a)/6-i)/s,((A+5*l)/6-n)/r,((5*a+h)/6-i)/s,((5*l+c)/6-n)/r,((a+h)/2-i)/s,((l+c)/2-n)/r),!0))}toSVGPath(){if(this.isEmpty())return"";const t=this.#s,e=this.#e;if(isNaN(this.#r[6])&&!this.isEmpty())return this.#m();const i=[];i.push(`M${t[4]} ${t[5]}`);for(let n=6;n<t.length;n+=6)isNaN(t[n])?i.push(`L${t[n+4]} ${t[n+5]}`):i.push(`C${t[n]} ${t[n+1]} ${t[n+2]} ${t[n+3]} ${t[n+4]} ${t[n+5]}`);this.#A(i);for(let n=e.length-6;n>=6;n-=6)isNaN(e[n])?i.push(`L${e[n+4]} ${e[n+5]}`):i.push(`C${e[n]} ${e[n+1]} ${e[n+2]} ${e[n+3]} ${e[n+4]} ${e[n+5]}`);return this.#_(i),i.join(" ")}#m(){const[t,e,i,n]=this.#t,[s,r,a,l]=this.#b();return`M${(this.#r[2]-t)/i} ${(this.#r[3]-e)/n} L${(this.#r[4]-t)/i} ${(this.#r[5]-e)/n} L${s} ${r} L${a} ${l} L${(this.#r[16]-t)/i} ${(this.#r[17]-e)/n} L${(this.#r[14]-t)/i} ${(this.#r[15]-e)/n} Z`}#_(t){const e=this.#e;t.push(`L${e[4]} ${e[5]} Z`)}#A(t){const[e,i,n,s]=this.#t,r=this.#r.subarray(4,6),a=this.#r.subarray(16,18),[l,h,c,d]=this.#b();t.push(`L${(r[0]-e)/n} ${(r[1]-i)/s} L${l} ${h} L${c} ${d} L${(a[0]-e)/n} ${(a[1]-i)/s}`)}newFreeDrawOutline(t,e,i,n,s,r){return new Es(t,e,i,n,s,r)}getOutlines(){const t=this.#s,e=this.#e,i=this.#r,[n,s,r,a]=this.#t,l=new Float64Array((this.#u?.length??0)+2);for(let d=0,u=l.length-2;d<u;d+=2)l[d]=(this.#u[d]-n)/r,l[d+1]=(this.#u[d+1]-s)/a;if(l[l.length-2]=(this.#l-n)/r,l[l.length-1]=(this.#h-s)/a,isNaN(i[6])&&!this.isEmpty())return this.#E(l);const h=new Float64Array(this.#s.length+24+this.#e.length);let c=t.length;for(let d=0;d<c;d+=2)isNaN(t[d])?h[d]=h[d+1]=NaN:(h[d]=t[d],h[d+1]=t[d+1]);c=this.#w(h,c);for(let d=e.length-6;d>=6;d-=6)for(let u=0;u<6;u+=2)isNaN(e[d+u])?(h[c]=h[c+1]=NaN,c+=2):(h[c]=e[d+u],h[c+1]=e[d+u+1],c+=2);return this.#y(h,c),this.newFreeDrawOutline(h,l,this.#t,this.#d,this.#i,this.#n)}#E(t){const e=this.#r,[i,n,s,r]=this.#t,[a,l,h,c]=this.#b(),d=new Float64Array(36);return d.set([NaN,NaN,NaN,NaN,(e[2]-i)/s,(e[3]-n)/r,NaN,NaN,NaN,NaN,(e[4]-i)/s,(e[5]-n)/r,NaN,NaN,NaN,NaN,a,l,NaN,NaN,NaN,NaN,h,c,NaN,NaN,NaN,NaN,(e[16]-i)/s,(e[17]-n)/r,NaN,NaN,NaN,NaN,(e[14]-i)/s,(e[15]-n)/r],0),this.newFreeDrawOutline(d,t,this.#t,this.#d,this.#i,this.#n)}#y(t,e){const i=this.#e;return t.set([NaN,NaN,NaN,NaN,i[4],i[5]],e),e+6}#w(t,e){const i=this.#r.subarray(4,6),n=this.#r.subarray(16,18),[s,r,a,l]=this.#t,[h,c,d,u]=this.#b();return t.set([NaN,NaN,NaN,NaN,(i[0]-s)/a,(i[1]-r)/l,NaN,NaN,NaN,NaN,h,c,NaN,NaN,NaN,NaN,d,u,NaN,NaN,NaN,NaN,(n[0]-s)/a,(n[1]-r)/l],e),e+24}}class Es extends ws{#t;#e=null;#i;#n;#s;#r;#l;constructor(t,e,i,n,s,r){super(),this.#l=t,this.#s=e,this.#t=i,this.#r=n,this.#i=s,this.#n=r,this.#o(r);const{x:a,y:l,width:h,height:c}=this.#e;for(let d=0,u=t.length;d<u;d+=2)t[d]=(t[d]-a)/h,t[d+1]=(t[d+1]-l)/c;for(let d=0,u=e.length;d<u;d+=2)e[d]=(e[d]-a)/h,e[d+1]=(e[d+1]-l)/c}toSVGPath(){const t=[`M${this.#l[4]} ${this.#l[5]}`];for(let e=6,i=this.#l.length;e<i;e+=6)isNaN(this.#l[e])?t.push(`L${this.#l[e+4]} ${this.#l[e+5]}`):t.push(`C${this.#l[e]} ${this.#l[e+1]} ${this.#l[e+2]} ${this.#l[e+3]} ${this.#l[e+4]} ${this.#l[e+5]}`);return t.push("Z"),t.join(" ")}serialize([t,e,i,n],s){const r=i-t,a=n-e;let l,h;switch(s){case 0:l=this.#h(this.#l,t,n,r,-a),h=this.#h(this.#s,t,n,r,-a);break;case 90:l=this.#c(this.#l,t,e,r,a),h=this.#c(this.#s,t,e,r,a);break;case 180:l=this.#h(this.#l,i,e,-r,a),h=this.#h(this.#s,i,e,-r,a);break;case 270:l=this.#c(this.#l,i,n,-r,-a),h=this.#c(this.#s,i,n,-r,-a)}return{outline:Array.from(l),points:[Array.from(h)]}}#h(t,e,i,n,s){const r=new Float64Array(t.length);for(let a=0,l=t.length;a<l;a+=2)r[a]=e+t[a]*n,r[a+1]=i+t[a+1]*s;return r}#c(t,e,i,n,s){const r=new Float64Array(t.length);for(let a=0,l=t.length;a<l;a+=2)r[a]=e+t[a+1]*n,r[a+1]=i+t[a]*s;return r}#o(t){const e=this.#l;let i=e[4],n=e[5],s=i,r=n,a=i,l=n,h=i,c=n;const d=t?Math.max:Math.min;for(let b=6,m=e.length;b<m;b+=6){if(isNaN(e[b]))s=Math.min(s,e[b+4]),r=Math.min(r,e[b+5]),a=Math.max(a,e[b+4]),l=Math.max(l,e[b+5]),c<e[b+5]?(h=e[b+4],c=e[b+5]):c===e[b+5]&&(h=d(h,e[b+4]));else{const v=I.bezierBoundingBox(i,n,...e.slice(b,b+6));s=Math.min(s,v[0]),r=Math.min(r,v[1]),a=Math.max(a,v[2]),l=Math.max(l,v[3]),c<v[3]?(h=v[2],c=v[3]):c===v[3]&&(h=d(h,v[2]))}i=e[b+4],n=e[b+5]}const u=s-this.#i,f=r-this.#i,p=a-s+2*this.#i,g=l-r+2*this.#i;this.#e={x:u,y:f,width:p,height:g,lastPoint:[h,c]}}get box(){return this.#e}newOutliner(t,e,i,n,s,r=0){return new oe(t,e,i,n,s,r)}getNewOutline(t,e){const{x:i,y:n,width:s,height:r}=this.#e,[a,l,h,c]=this.#t,d=s*h,u=r*c,f=i*h+a,p=n*c+l,g=this.newOutliner({x:this.#s[0]*d+f,y:this.#s[1]*u+p},this.#t,this.#r,t,this.#n,e??this.#i);for(let b=2;b<this.#s.length;b+=2)g.add({x:this.#s[b]*d+f,y:this.#s[b+1]*u+p});return g.getOutlines()}get mustRemoveSelfIntersections(){return!0}}class xs{#t;#e=[];#i=[];constructor(t,e=0,i=0,n=!0){let s=1/0,r=-1/0,a=1/0,l=-1/0;const c=10**-4;for(const{x:m,y:v,width:A,height:w}of t){const E=Math.floor((m-e)/c)*c,C=Math.ceil((m+A+e)/c)*c,M=Math.floor((v-e)/c)*c,T=Math.ceil((v+w+e)/c)*c;this.#e.push([E,M,T,!0],[C,M,T,!1]),s=Math.min(s,E),r=Math.max(r,C),a=Math.min(a,M),l=Math.max(l,T)}const d=r-s+2*i,u=l-a+2*i,f=s-i,p=a-i,g=this.#e.at(n?-1:-2),b=[g[0],g[2]];for(const m of this.#e){const[v,A,w]=m;m[0]=(v-f)/d,m[1]=(A-p)/u,m[2]=(w-p)/u}this.#t={x:f,y:p,width:d,height:u,lastPoint:b}}getOutlines(){this.#e.sort((e,i)=>e[0]-i[0]||e[1]-i[1]||e[2]-i[2]);const t=[];for(const e of this.#e)e[3]?(t.push(...this.#h(e)),this.#r(e)):(this.#l(e),t.push(...this.#h(e)));return this.#n(t)}#n(t){const e=[],i=new Set;for(const r of t){const[a,l,h]=r;e.push([a,l,r],[a,h,r])}e.sort((r,a)=>r[1]-a[1]||r[0]-a[0]);for(let r=0,a=e.length;r<a;r+=2){const l=e[r][2],h=e[r+1][2];l.push(h),h.push(l),i.add(l),i.add(h)}const n=[];let s;for(;i.size>0;){const r=i.values().next().value;let[a,l,h,c,d]=r;i.delete(r);let u=a,f=l;for(s=[a,h],n.push(s);;){let p;if(i.has(c))p=c;else{if(!i.has(d))break;p=d}i.delete(p),[a,l,h,c,d]=p,u!==a&&(s.push(u,f,a,f===l?l:h),u=a),f=f===l?h:l}s.push(u,f)}return new Qo(n,this.#t)}#s(t){const e=this.#i;let i=0,n=e.length-1;for(;i<=n;){const s=i+n>>1,r=e[s][0];if(r===t)return s;r<t?i=s+1:n=s-1}return n+1}#r([,t,e]){const i=this.#s(t);this.#i.splice(i,0,[t,e])}#l([,t,e]){const i=this.#s(t);for(let n=i;n<this.#i.length;n++){const[s,r]=this.#i[n];if(s!==t)break;if(s===t&&r===e)return void this.#i.splice(n,1)}for(let n=i-1;n>=0;n--){const[s,r]=this.#i[n];if(s!==t)break;if(s===t&&r===e)return void this.#i.splice(n,1)}}#h(t){const[e,i,n]=t,s=[[e,i,n]],r=this.#s(n);for(let a=0;a<r;a++){const[l,h]=this.#i[a];for(let c=0,d=s.length;c<d;c++){const[,u,f]=s[c];if(!(h<=u||f<=l)){if(u>=l){if(f>h)s[c][1]=h;else{if(1===d)return[];s.splice(c,1),c--,d--}continue}s[c][2]=l,f>h&&s.push([e,h,f])}}}return s}}class Qo extends ws{#t;#e;constructor(t,e){super(),this.#e=t,this.#t=e}toSVGPath(){const t=[];for(const e of this.#e){let[i,n]=e;t.push(`M${i} ${n}`);for(let s=2;s<e.length;s+=2){const r=e[s],a=e[s+1];r===i?(t.push(`V${a}`),n=a):a===n&&(t.push(`H${r}`),i=r)}t.push("Z")}return t.join(" ")}serialize([t,e,i,n],s){const r=[],a=i-t,l=n-e;for(const h of this.#e){const c=new Array(h.length);for(let d=0;d<h.length;d+=2)c[d]=t+h[d]*a,c[d+1]=n-h[d+1]*l;r.push(c)}return r}get box(){return this.#t}get classNamesForDrawing(){return["highlight"]}get classNamesForOutlining(){return["highlightOutline"]}}class en extends oe{newFreeDrawOutline(t,e,i,n,s,r){return new Zo(t,e,i,n,s,r)}get classNamesForDrawing(){return["highlight","free"]}}class Zo extends Es{get classNamesForDrawing(){return["highlight","free"]}get classNamesForOutlining(){return["highlightOutline","free"]}newOutliner(t,e,i,n,s,r=0){return new en(t,e,i,n,s,r)}}class Mt{#t=null;#e=null;#i;#n=null;#s=!1;#r=!1;#l=null;#h;#c=null;#o=null;#d;static#a=null;static get _keyboardManager(){return U(this,"_keyboardManager",new Pe([[["Escape","mac+Escape"],Mt.prototype._hideDropdownFromKeyboard],[[" ","mac+ "],Mt.prototype._colorSelectFromKeyboard],[["ArrowDown","ArrowRight","mac+ArrowDown","mac+ArrowRight"],Mt.prototype._moveToNext],[["ArrowUp","ArrowLeft","mac+ArrowUp","mac+ArrowLeft"],Mt.prototype._moveToPrevious],[["Home","mac+Home"],Mt.prototype._moveToBeginning],[["End","mac+End"],Mt.prototype._moveToEnd]]))}constructor({editor:t=null,uiManager:e=null}){t?(this.#r=!1,this.#d=D.HIGHLIGHT_COLOR,this.#l=t):(this.#r=!0,this.#d=D.HIGHLIGHT_DEFAULT_COLOR),this.#o=t?._uiManager||e,this.#h=this.#o._eventBus,this.#i=t?.color||this.#o?.highlightColors.values().next().value||"#FFFF98",Mt.#a||=Object.freeze({blue:"pdfjs-editor-colorpicker-blue",green:"pdfjs-editor-colorpicker-green",pink:"pdfjs-editor-colorpicker-pink",red:"pdfjs-editor-colorpicker-red",yellow:"pdfjs-editor-colorpicker-yellow"})}renderButton(){const t=this.#t=document.createElement("button");t.className="colorPicker",t.tabIndex="0",t.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-button"),t.setAttribute("aria-haspopup",!0);const e=this.#o._signal;t.addEventListener("click",this.#g.bind(this),{signal:e}),t.addEventListener("keydown",this.#f.bind(this),{signal:e});const i=this.#e=document.createElement("span");return i.className="swatch",i.setAttribute("aria-hidden",!0),i.style.backgroundColor=this.#i,t.append(i),t}renderMainDropdown(){const t=this.#n=this.#u();return t.setAttribute("aria-orientation","horizontal"),t.setAttribute("aria-labelledby","highlightColorPickerLabel"),t}#u(){const t=document.createElement("div"),e=this.#o._signal;t.addEventListener("contextmenu",Pt,{signal:e}),t.className="dropdown",t.role="listbox",t.setAttribute("aria-multiselectable",!1),t.setAttribute("aria-orientation","vertical"),t.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-dropdown");for(const[i,n]of this.#o.highlightColors){const s=document.createElement("button");s.tabIndex="0",s.role="option",s.setAttribute("data-color",n),s.title=i,s.setAttribute("data-l10n-id",Mt.#a[i]);const r=document.createElement("span");s.append(r),r.className="swatch",r.style.backgroundColor=n,s.setAttribute("aria-selected",n===this.#i),s.addEventListener("click",this.#p.bind(this,n),{signal:e}),t.append(s)}return t.addEventListener("keydown",this.#f.bind(this),{signal:e}),t}#p(t,e){e.stopPropagation(),this.#h.dispatch("switchannotationeditorparams",{source:this,type:this.#d,value:t})}_colorSelectFromKeyboard(t){if(t.target===this.#t)return void this.#g(t);const e=t.target.getAttribute("data-color");e&&this.#p(e,t)}_moveToNext(t){this.#m?t.target!==this.#t?t.target.nextSibling?.focus():this.#n.firstChild?.focus():this.#g(t)}_moveToPrevious(t){t.target!==this.#n?.firstChild&&t.target!==this.#t?(this.#m||this.#g(t),t.target.previousSibling?.focus()):this.#m&&this._hideDropdownFromKeyboard()}_moveToBeginning(t){this.#m?this.#n.firstChild?.focus():this.#g(t)}_moveToEnd(t){this.#m?this.#n.lastChild?.focus():this.#g(t)}#f(t){Mt._keyboardManager.exec(this,t)}#g(t){if(this.#m)return void this.hideDropdown();if(this.#s=0===t.detail,this.#c||(this.#c=new AbortController,window.addEventListener("pointerdown",this.#b.bind(this),{signal:this.#o.combinedSignal(this.#c)})),this.#n)return void this.#n.classList.remove("hidden");const e=this.#n=this.#u();this.#t.append(e)}#b(t){this.#n?.contains(t.target)||this.hideDropdown()}hideDropdown(){this.#n?.classList.add("hidden"),this.#c?.abort(),this.#c=null}get#m(){return this.#n&&!this.#n.classList.contains("hidden")}_hideDropdownFromKeyboard(){if(!this.#r){if(!this.#m)return void this.#l?.unselect();this.hideDropdown(),this.#t.focus({preventScroll:!0,focusVisible:this.#s})}}updateColor(t){if(this.#e&&(this.#e.style.backgroundColor=t),!this.#n)return;const e=this.#o.highlightColors.values();for(const i of this.#n.children)i.setAttribute("aria-selected",e.next().value===t)}destroy(){this.#t?.remove(),this.#t=null,this.#e=null,this.#n?.remove(),this.#n=null}}class nt extends O{#t=null;#e=0;#i;#n=null;#s=null;#r=null;#l=null;#h=0;#c=null;#o=null;#d=null;#a=!1;#u=null;#p;#f=null;#g="";#b;#m="";static _defaultColor=null;static _defaultOpacity=1;static _defaultThickness=12;static _type="highlight";static _editorType=B.HIGHLIGHT;static _freeHighlightId=-1;static _freeHighlight=null;static _freeHighlightClipId="";static get _keyboardManager(){const t=nt.prototype;return U(this,"_keyboardManager",new Pe([[["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]}]]))}constructor(t){super({...t,name:"highlightEditor"}),this.color=t.color||nt._defaultColor,this.#b=t.thickness||nt._defaultThickness,this.#p=t.opacity||nt._defaultOpacity,this.#i=t.boxes||null,this.#m=t.methodOfCreation||"",this.#g=t.text||"",this._isDraggable=!1,t.highlightId>-1?(this.#a=!0,this.#A(t),this.#P()):this.#i&&(this.#t=t.anchorNode,this.#e=t.anchorOffset,this.#l=t.focusNode,this.#h=t.focusOffset,this.#_(),this.#P(),this.rotate(this.rotation))}get telemetryInitialData(){return{action:"added",type:this.#a?"free_highlight":"highlight",color:this._uiManager.highlightColorNames.get(this.color),thickness:this.#b,methodOfCreation:this.#m}}get telemetryFinalData(){return{type:"highlight",color:this._uiManager.highlightColorNames.get(this.color)}}static computeTelemetryFinalData(t){return{numberOfColors:t.get("color").size}}#_(){const t=new xs(this.#i,.001);this.#o=t.getOutlines(),({x:this.x,y:this.y,width:this.width,height:this.height}=this.#o.box);const e=new xs(this.#i,.0025,.001,"ltr"===this._uiManager.direction);this.#r=e.getOutlines();const{lastPoint:i}=this.#r.box;this.#u=[(i[0]-this.x)/this.width,(i[1]-this.y)/this.height]}#A({highlightOutlines:t,highlightId:e,clipPathId:i}){if(this.#o=t,this.#r=t.getNewOutline(this.#b/2+1.5,.0025),e>=0)this.#d=e,this.#n=i,this.parent.drawLayer.finalizeLine(e,t),this.#f=this.parent.drawLayer.drawOutline(this.#r);else if(this.parent){const c=this.parent.viewport.rotation;this.parent.drawLayer.updateLine(this.#d,t),this.parent.drawLayer.updateBox(this.#d,nt.#x(this.#o.box,(c-this.rotation+360)%360)),this.parent.drawLayer.updateLine(this.#f,this.#r),this.parent.drawLayer.updateBox(this.#f,nt.#x(this.#r.box,c))}const{x:s,y:r,width:a,height:l}=t.box;switch(this.rotation){case 0:this.x=s,this.y=r,this.width=a,this.height=l;break;case 90:{const[c,d]=this.parentDimensions;this.x=r,this.y=1-s,this.width=a*d/c,this.height=l*c/d;break}case 180:this.x=1-s,this.y=1-r,this.width=a,this.height=l;break;case 270:{const[c,d]=this.parentDimensions;this.x=1-r,this.y=s,this.width=a*d/c,this.height=l*c/d;break}}const{lastPoint:h}=this.#r.box;this.#u=[(h[0]-s)/a,(h[1]-r)/l]}static initialize(t,e){O.initialize(t,e),nt._defaultColor||=e.highlightColors?.values().next().value||"#fff066"}static updateDefaultParams(t,e){switch(t){case D.HIGHLIGHT_DEFAULT_COLOR:nt._defaultColor=e;break;case D.HIGHLIGHT_THICKNESS:nt._defaultThickness=e}}translateInPage(t,e){}get toolbarPosition(){return this.#u}updateParams(t,e){switch(t){case D.HIGHLIGHT_COLOR:this.#E(e);break;case D.HIGHLIGHT_THICKNESS:this.#y(e)}}static get defaultPropertiesToUpdate(){return[[D.HIGHLIGHT_DEFAULT_COLOR,nt._defaultColor],[D.HIGHLIGHT_THICKNESS,nt._defaultThickness]]}get propertiesToUpdate(){return[[D.HIGHLIGHT_COLOR,this.color||nt._defaultColor],[D.HIGHLIGHT_THICKNESS,this.#b||nt._defaultThickness],[D.HIGHLIGHT_FREE,this.#a]]}#E(t){const e=(s,r)=>{this.color=s,this.parent?.drawLayer.changeColor(this.#d,s),this.#s?.updateColor(s),this.#p=r,this.parent?.drawLayer.changeOpacity(this.#d,r)},i=this.color,n=this.#p;this.addCommands({cmd:e.bind(this,t,nt._defaultOpacity),undo:e.bind(this,i,n),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:D.HIGHLIGHT_COLOR,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"color_changed",color:this._uiManager.highlightColorNames.get(t)},!0)}#y(t){const e=this.#b,i=n=>{this.#b=n,this.#w(n)};this.addCommands({cmd:i.bind(this,t),undo:i.bind(this,e),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:D.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"thickness_changed",thickness:t},!0)}addEditToolbar(){var t=()=>super.addEditToolbar,e=this;return(0,x.A)(function*(){const i=yield t().call(e);return i?(e._uiManager.highlightColors&&(e.#s=new Mt({editor:e}),i.addColorPicker(e.#s)),i):null})()}disableEditing(){super.disableEditing(),this.div.classList.toggle("disabled",!0)}enableEditing(){super.enableEditing(),this.div.classList.toggle("disabled",!1)}fixAndSetPosition(){return super.fixAndSetPosition(this.#R())}getBaseTranslation(){return[0,0]}getRect(t,e){return super.getRect(t,e,this.#R())}onceAdded(){this.annotationElementId||this.parent.addUndoableEditor(this),this.div.focus()}remove(){this.#L(),this._reportTelemetry({action:"deleted"}),super.remove()}rebuild(){this.parent&&(super.rebuild(),null!==this.div&&(this.#P(),this.isAttachedToDOM||this.parent.add(this)))}setParent(t){let e=!1;this.parent&&!t?this.#L():t&&(this.#P(t),e=!this.parent&&this.div?.classList.contains("selectedEditor")),super.setParent(t),this.show(this._isVisible),e&&this.select()}#w(t){if(!this.#a)return;this.#A({highlightOutlines:this.#o.getNewOutline(t/2)}),this.fixAndSetPosition();const[e,i]=this.parentDimensions;this.setDims(this.width*e,this.height*i)}#L(){null===this.#d||!this.parent||(this.parent.drawLayer.remove(this.#d),this.#d=null,this.parent.drawLayer.remove(this.#f),this.#f=null)}#P(t=this.parent){null===this.#d&&(({id:this.#d,clipPathId:this.#n}=t.drawLayer.draw(this.#o,this.color,this.#p)),this.#f=t.drawLayer.drawOutline(this.#r),this.#c&&(this.#c.style.clipPath=this.#n))}static#x({x:t,y:e,width:i,height:n},s){switch(s){case 90:return{x:1-e-n,y:t,width:n,height:i};case 180:return{x:1-t-i,y:1-e-n,width:i,height:n};case 270:return{x:e,y:1-t-i,width:n,height:i}}return{x:t,y:e,width:i,height:n}}rotate(t){const{drawLayer:e}=this.parent;let i;i=this.#a?nt.#x(this.#o.box,t=(t-this.rotation+360)%360):nt.#x(this,t),e.rotate(this.#d,t),e.rotate(this.#f,t),e.updateBox(this.#d,i),e.updateBox(this.#f,nt.#x(this.#r.box,t))}render(){if(this.div)return this.div;const t=super.render();this.#g&&(t.setAttribute("aria-label",this.#g),t.setAttribute("role","mark")),this.#a?t.classList.add("free"):this.div.addEventListener("keydown",this.#T.bind(this),{signal:this._uiManager._signal});const e=this.#c=document.createElement("div");t.append(e),e.setAttribute("aria-hidden","true"),e.className="internal",e.style.clipPath=this.#n;const[i,n]=this.parentDimensions;return this.setDims(this.width*i,this.height*n),ti(this,this.#c,["pointerover","pointerleave"]),this.enableEditing(),t}pointerover(){this.isSelected||this.parent.drawLayer.addClass(this.#f,"hovered")}pointerleave(){this.isSelected||this.parent.drawLayer.removeClass(this.#f,"hovered")}#T(t){nt._keyboardManager.exec(this,t)}_moveCaret(t){switch(this.parent.unselect(this),t){case 0:case 2:this.#S(!0);break;case 1:case 3:this.#S(!1)}}#S(t){if(!this.#t)return;const e=window.getSelection();t?e.setPosition(this.#t,this.#e):e.setPosition(this.#l,this.#h)}select(){super.select(),this.#f&&(this.parent?.drawLayer.removeClass(this.#f,"hovered"),this.parent?.drawLayer.addClass(this.#f,"selected"))}unselect(){super.unselect(),this.#f&&(this.parent?.drawLayer.removeClass(this.#f,"selected"),this.#a||this.#S(!1))}get _mustFixPosition(){return!this.#a}show(t=this._isVisible){super.show(t),this.parent&&(this.parent.drawLayer.show(this.#d,t),this.parent.drawLayer.show(this.#f,t))}#R(){return this.#a?this.rotation:0}#k(){if(this.#a)return null;const[t,e]=this.pageDimensions,[i,n]=this.pageTranslation,s=this.#i,r=new Float32Array(8*s.length);let a=0;for(const{x:l,y:h,width:c,height:d}of s){const u=l*t+i,f=(1-h-d)*e+n;r[a]=r[a+4]=u,r[a+1]=r[a+3]=f,r[a+2]=r[a+6]=u+c*t,r[a+5]=r[a+7]=f+d*e,a+=8}return r}#C(t){return this.#o.serialize(t,this.#R())}static startHighlighting(t,e,{target:i,x:n,y:s}){const{x:r,y:a,width:l,height:h}=i.getBoundingClientRect(),c=new AbortController,d=t.combinedSignal(c),f=p=>{c.abort(),this.#M(t,p)};window.addEventListener("blur",f,{signal:d}),window.addEventListener("pointerup",f,{signal:d}),window.addEventListener("pointerdown",p=>{p.preventDefault(),p.stopPropagation()},{capture:!0,passive:!1,signal:d}),window.addEventListener("contextmenu",Pt,{signal:d}),i.addEventListener("pointermove",this.#v.bind(this,t),{signal:d}),this._freeHighlight=new en({x:n,y:s},[r,a,l,h],t.scale,this._defaultThickness/2,e,.001),({id:this._freeHighlightId,clipPathId:this._freeHighlightClipId}=t.drawLayer.draw(this._freeHighlight,this._defaultColor,this._defaultOpacity,!0))}static#v(t,e){this._freeHighlight.add(e)&&t.drawLayer.updatePath(this._freeHighlightId,this._freeHighlight)}static#M(t,e){this._freeHighlight.isEmpty()?t.drawLayer.remove(this._freeHighlightId):t.createAndAddNewEditor(e,!1,{highlightId:this._freeHighlightId,highlightOutlines:this._freeHighlight.getOutlines(),clipPathId:this._freeHighlightClipId,methodOfCreation:"main_toolbar"}),this._freeHighlightId=-1,this._freeHighlight=null,this._freeHighlightClipId=""}static deserialize(t,e,i){var n=()=>super.deserialize,s=this;return(0,x.A)(function*(){let r=null;if(t instanceof As){const{data:{quadPoints:b,rect:m,rotation:v,id:A,color:w,opacity:E,popupRef:C},parent:{page:{pageNumber:M}}}=t;r=t={annotationType:B.HIGHLIGHT,color:Array.from(w),opacity:E,quadPoints:b,boxes:null,pageIndex:M-1,rect:m.slice(0),rotation:v,id:A,deleted:!1,popupRef:C}}else if(t instanceof tn){const{data:{inkLists:b,rect:m,rotation:v,id:A,color:w,borderStyle:{rawWidth:E},popupRef:C},parent:{page:{pageNumber:M}}}=t;r=t={annotationType:B.HIGHLIGHT,color:Array.from(w),thickness:E,inkLists:b,boxes:null,pageIndex:M-1,rect:m.slice(0),rotation:v,id:A,deleted:!1,popupRef:C}}const{color:a,quadPoints:l,inkLists:h,opacity:c}=t,d=yield n().call(s,t,e,i);d.color=I.makeHexColor(...a),d.#p=c||1,h&&(d.#b=t.thickness),d.annotationElementId=t.id||null,d._initialData=r;const[u,f]=d.pageDimensions,[p,g]=d.pageTranslation;if(l){const b=d.#i=[];for(let m=0;m<l.length;m+=8)b.push({x:(l[m]-p)/u,y:1-(l[m+1]-g)/f,width:(l[m+2]-l[m])/u,height:(l[m+1]-l[m+5])/f});d.#_(),d.#P(),d.rotate(d.rotation)}else if(h){d.#a=!0;const b=h[0],m={x:b[0]-p,y:f-(b[1]-g)},v=new en(m,[0,0,u,f],1,d.#b/2,!0,.001);for(let E=0,C=b.length;E<C;E+=2)m.x=b[E]-p,m.y=f-(b[E+1]-g),v.add(m);const{id:A,clipPathId:w}=e.drawLayer.draw(v,d.color,d._defaultOpacity,!0);d.#A({highlightOutlines:v.getOutlines(),highlightId:A,clipPathId:w}),d.#P()}return d})()}serialize(t=!1){if(this.isEmpty()||t)return null;if(this.deleted)return this.serializeDeleted();const e=this.getRect(0,0),i=O._colorManager.convert(this.color),n={annotationType:B.HIGHLIGHT,color:i,opacity:this.#p,thickness:this.#b,quadPoints:this.#k(),outlines:this.#C(e),pageIndex:this.pageIndex,rect:e,rotation:this.#R(),structTreeParentId:this._structTreeParentId};return this.annotationElementId&&!this.#I(n)?null:(n.id=this.annotationElementId,n)}#I(t){const{color:e}=this._initialData;return t.color.some((i,n)=>i!==e[n])}renderAnnotationElement(t){return t.updateEdited({rect:this.getRect(0,0)}),null}static canCreateNewEmptyEditor(){return!1}}class ut extends O{#t=0;#e=0;#i=null;#n=new Path2D;#s=!1;#r=null;#l=!1;#h=!1;#c=null;#o=null;#d=0;#a=0;#u=null;static _defaultColor=null;static _defaultOpacity=1;static _defaultThickness=1;static _type="ink";static _editorType=B.INK;constructor(t){super({...t,name:"inkEditor"}),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,e){O.initialize(t,e)}static updateDefaultParams(t,e){switch(t){case D.INK_THICKNESS:ut._defaultThickness=e;break;case D.INK_COLOR:ut._defaultColor=e;break;case D.INK_OPACITY:ut._defaultOpacity=e/100}}updateParams(t,e){switch(t){case D.INK_THICKNESS:this.#p(e);break;case D.INK_COLOR:this.#f(e);break;case D.INK_OPACITY:this.#g(e)}}static get defaultPropertiesToUpdate(){return[[D.INK_THICKNESS,ut._defaultThickness],[D.INK_COLOR,ut._defaultColor||O._defaultLineColor],[D.INK_OPACITY,Math.round(100*ut._defaultOpacity)]]}get propertiesToUpdate(){return[[D.INK_THICKNESS,this.thickness||ut._defaultThickness],[D.INK_COLOR,this.color||ut._defaultColor||O._defaultLineColor],[D.INK_OPACITY,Math.round(100*(this.opacity??ut._defaultOpacity))]]}#p(t){const e=n=>{this.thickness=n,this.#D()},i=this.thickness;this.addCommands({cmd:e.bind(this,t),undo:e.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:D.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0})}#f(t){const e=n=>{this.color=n,this.#x()},i=this.color;this.addCommands({cmd:e.bind(this,t),undo:e.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:D.INK_COLOR,overwriteIfSameType:!0,keepUndo:!0})}#g(t){const e=n=>{this.opacity=n,this.#x()},i=this.opacity;this.addCommands({cmd:e.bind(this,t/=100),undo:e.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:D.INK_OPACITY,overwriteIfSameType:!0,keepUndo:!0})}rebuild(){this.parent&&(super.rebuild(),null!==this.div&&(this.canvas||(this.#k(),this.#C()),this.isAttachedToDOM||(this.parent.add(this),this.#v()),this.#D()))}remove(){null!==this.canvas&&(this.isEmpty()||this.commit(),this.canvas.width=this.canvas.height=0,this.canvas.remove(),this.canvas=null,this.#i&&(clearTimeout(this.#i),this.#i=null),this.#c?.disconnect(),this.#c=null,super.remove())}setParent(t){!this.parent&&t?this._uiManager.removeShouldRescale(this):this.parent&&null===t&&this._uiManager.addShouldRescale(this),super.setParent(t)}onScaleChanging(){const[t,e]=this.parentDimensions;this.setDimensions(this.width*t,this.height*e)}enableEditMode(){this.#s||null===this.canvas||(super.enableEditMode(),this._isDraggable=!1,this.#T())}disableEditMode(){!this.isInEditMode()||null===this.canvas||(super.disableEditMode(),this._isDraggable=!this.isEmpty(),this.div.classList.remove("editing"),this.#S())}onceAdded(){this._isDraggable=!this.isEmpty()}isEmpty(){return 0===this.paths.length||1===this.paths.length&&0===this.paths[0].length}#b(){const{parentRotation:t,parentDimensions:[e,i]}=this;switch(t){case 90:return[0,i,i,e];case 180:return[e,i,e,i];case 270:return[e,0,i,e];default:return[0,0,e,i]}}#m(){const{ctx:t,color:e,opacity:i,thickness:n,parentScale:s,scaleFactor:r}=this;t.lineWidth=n*s/r,t.lineCap="round",t.lineJoin="round",t.miterLimit=10,t.strokeStyle=`${e}${function _a(o){return Math.round(Math.min(255,Math.max(1,255*o))).toString(16).padStart(2,"0")}(i)}`}#_(t,e){this.canvas.addEventListener("contextmenu",Pt,{signal:this._uiManager._signal}),this.#S(),this.#r=new AbortController;const i=this._uiManager.combinedSignal(this.#r);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,this.#h||(this.#h=!0,this.#v(),this.thickness||=ut._defaultThickness,this.color||=ut._defaultColor||O._defaultLineColor,this.opacity??=ut._defaultOpacity),this.currentPath.push([t,e]),this.#l=!1,this.#m(),this.#u=()=>{this.#w(),this.#u&&window.requestAnimationFrame(this.#u)},window.requestAnimationFrame(this.#u)}#A(t,e){const[i,n]=this.currentPath.at(-1);if(this.currentPath.length>1&&t===i&&e===n)return;const s=this.currentPath;let r=this.#n;if(s.push([t,e]),this.#l=!0,s.length<=2)return r.moveTo(...s[0]),void r.lineTo(t,e);3===s.length&&(this.#n=r=new Path2D,r.moveTo(...s[0])),this.#L(r,...s.at(-3),...s.at(-2),t,e)}#E(){if(0===this.currentPath.length)return;const t=this.currentPath.at(-1);this.#n.lineTo(...t)}#y(t,e){let i;if(this.#u=null,t=Math.min(Math.max(t,0),this.canvas.width),e=Math.min(Math.max(e,0),this.canvas.height),this.#A(t,e),this.#E(),1!==this.currentPath.length)i=this.#P();else{const l=[t,e];i=[[l,l.slice(),l.slice(),l]]}const n=this.#n,s=this.currentPath;this.currentPath=[],this.#n=new Path2D,this.addCommands({cmd:()=>{this.allRawPaths.push(s),this.paths.push(i),this.bezierPath2D.push(n),this._uiManager.rebuild(this)},undo:()=>{this.allRawPaths.pop(),this.paths.pop(),this.bezierPath2D.pop(),0===this.paths.length?this.remove():(this.canvas||(this.#k(),this.#C()),this.#D())},mustExec:!0})}#w(){if(!this.#l)return;this.#l=!1;Math.ceil(this.thickness*this.parentScale);const e=this.currentPath.slice(-3),i=e.map(c=>c[0]),n=e.map(c=>c[1]),{ctx:h}=(Math.min(...i),Math.max(...i),Math.min(...n),Math.max(...n),this);h.save(),h.clearRect(0,0,this.canvas.width,this.canvas.height);for(const c of this.bezierPath2D)h.stroke(c);h.stroke(this.#n),h.restore()}#L(t,e,i,n,s,r,a){const l=(e+n)/2,h=(i+s)/2,c=(n+r)/2,d=(s+a)/2;t.bezierCurveTo(l+2*(n-l)/3,h+2*(s-h)/3,c+2*(n-c)/3,d+2*(s-d)/3,c,d)}#P(){const t=this.currentPath;if(t.length<=2)return[[t[0],t[0],t.at(-1),t.at(-1)]];const e=[];let i,[n,s]=t[0];for(i=1;i<t.length-2;i++){const[u,f]=t[i],[p,g]=t[i+1],b=(u+p)/2,m=(f+g)/2;e.push([[n,s],[n+2*(u-n)/3,s+2*(f-s)/3],[b+2*(u-b)/3,m+2*(f-m)/3],[b,m]]),[n,s]=[b,m]}const[r,a]=t[i],[l,h]=t[i+1];return e.push([[n,s],[n+2*(r-n)/3,s+2*(a-s)/3],[l+2*(r-l)/3,h+2*(a-h)/3],[l,h]]),e}#x(){if(this.isEmpty())return void this.#I();this.#m();const{canvas:t,ctx:e}=this;e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,t.width,t.height),this.#I();for(const i of this.bezierPath2D)e.stroke(i)}commit(){this.#s||(super.commit(),this.isEditing=!1,this.disableEditMode(),this.setInForeground(),this.#s=!0,this.div.classList.add("disabled"),this.#D(!0),this.select(),this.parent.addInkEditorIfNeeded(!0),this.moveInDOM(),this.div.focus({preventScroll:!0}))}focusin(t){this._focusEventsAllowed&&(super.focusin(t),this.enableEditMode())}#T(){if(this.#o)return;this.#o=new AbortController;const t=this._uiManager.combinedSignal(this.#o);this.canvas.addEventListener("pointerdown",this.canvasPointerdown.bind(this),{signal:t})}#S(){this.pointerdownAC?.abort(),this.pointerdownAC=null}canvasPointerdown(t){0!==t.button||!this.isInEditMode()||this.#s||(this.setInForeground(),t.preventDefault(),this.div.contains(document.activeElement)||this.div.focus({preventScroll:!0}),this.#_(t.offsetX,t.offsetY))}canvasPointermove(t){t.preventDefault(),this.#A(t.offsetX,t.offsetY)}canvasPointerup(t){t.preventDefault(),this.#R(t)}canvasPointerleave(t){this.#R(t)}#R(t){this.#r?.abort(),this.#r=null,this.#T(),this.#i&&clearTimeout(this.#i),this.#i=setTimeout(()=>{this.#i=null,this.canvas.removeEventListener("contextmenu",Pt)},10),this.#y(t.offsetX,t.offsetY),this.addToAnnotationStorage(),this.setInBackground()}#k(){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")}#C(){this.#c=new ResizeObserver(t=>{const e=t[0].contentRect;e.width&&e.height&&this.setDimensions(e.width,e.height)}),this.#c.observe(this.div),this._uiManager._signal.addEventListener("abort",()=>{this.#c?.disconnect(),this.#c=null},{once:!0})}get isResizable(){return!this.isEmpty()&&this.#s}render(){if(this.div)return this.div;let t,e;this.width&&(t=this.x,e=this.y),super.render(),this.div.setAttribute("data-l10n-id","pdfjs-ink");const[i,n,s,r]=this.#b();if(this.setAt(i,n,0,0),this.setDims(s,r),this.#k(),this.width){const[a,l]=this.parentDimensions;this.setAspectRatio(this.width*a,this.height*l),this.setAt(t*a,e*l,this.width*a,this.height*l),this.#h=!0,this.#v(),this.setDims(this.width*a,this.height*l),this.#x(),this.div.classList.add("disabled")}else this.div.classList.add("editing"),this.enableEditMode();return this.#C(),this.div}#v(){if(!this.#h)return;const[t,e]=this.parentDimensions;this.canvas.width=Math.ceil(this.width*t),this.canvas.height=Math.ceil(this.height*e),this.#I()}setDimensions(t,e){const i=Math.round(t),n=Math.round(e);if(this.#d===i&&this.#a===n)return;this.#d=i,this.#a=n,this.canvas.style.visibility="hidden";const[s,r]=this.parentDimensions;this.width=t/s,this.height=e/r,this.fixAndSetPosition(),this.#s&&this.#M(t,e),this.#v(),this.#x(),this.canvas.style.visibility="visible",this.fixDims()}#M(t,e){const i=this.#V(),n=(t-i)/this.#e,s=(e-i)/this.#t;this.scaleFactor=Math.min(n,s)}#I(){const t=this.#V()/2;this.ctx.setTransform(this.scaleFactor,0,0,this.scaleFactor,this.translationX*this.scaleFactor+t,this.translationY*this.scaleFactor+t)}static#N(t){const e=new Path2D;for(let i=0,n=t.length;i<n;i++){const[s,r,a,l]=t[i];0===i&&e.moveTo(...s),e.bezierCurveTo(r[0],r[1],a[0],a[1],l[0],l[1])}return e}static#H(t,e,i){const[n,s,r,a]=e;switch(i){case 0:for(let l=0,h=t.length;l<h;l+=2)t[l]+=n,t[l+1]=a-t[l+1];break;case 90:for(let l=0,h=t.length;l<h;l+=2){const c=t[l];t[l]=t[l+1]+n,t[l+1]=c+s}break;case 180:for(let l=0,h=t.length;l<h;l+=2)t[l]=r-t[l],t[l+1]+=s;break;case 270:for(let l=0,h=t.length;l<h;l+=2){const c=t[l];t[l]=r-t[l+1],t[l+1]=a-c}break;default:throw new Error("Invalid rotation")}return t}static#j(t,e,i){const[n,s,r,a]=e;switch(i){case 0:for(let l=0,h=t.length;l<h;l+=2)t[l]-=n,t[l+1]=a-t[l+1];break;case 90:for(let l=0,h=t.length;l<h;l+=2){const c=t[l];t[l]=t[l+1]-s,t[l+1]=c-n}break;case 180:for(let l=0,h=t.length;l<h;l+=2)t[l]=r-t[l],t[l+1]-=s;break;case 270:for(let l=0,h=t.length;l<h;l+=2){const c=t[l];t[l]=a-t[l+1],t[l+1]=r-c}break;default:throw new Error("Invalid rotation")}return t}#F(t,e,i,n){const s=[],r=this.thickness/2,a=t*e+r,l=t*i+r;for(const h of this.paths){const c=[],d=[];for(let u=0,f=h.length;u<f;u++){const[p,g,b,m]=h[u];if(p[0]===m[0]&&p[1]===m[1]&&1===f){const S=t*p[0]+a,L=t*p[1]+l;c.push(S,L),d.push(S,L);break}const v=t*p[0]+a,A=t*p[1]+l,w=t*g[0]+a,E=t*g[1]+l,C=t*b[0]+a,M=t*b[1]+l,T=t*m[0]+a,y=t*m[1]+l;0===u&&(c.push(v,A),d.push(v,A)),c.push(w,E,C,M,T,y),d.push(w,E),u===f-1&&d.push(T,y)}s.push({bezier:ut.#H(c,n,this.rotation),points:ut.#H(d,n,this.rotation)})}return s}#B(){let t=1/0,e=-1/0,i=1/0,n=-1/0;for(const s of this.paths)for(const[r,a,l,h]of s){const c=I.bezierBoundingBox(...r,...a,...l,...h);t=Math.min(t,c[0]),i=Math.min(i,c[1]),e=Math.max(e,c[2]),n=Math.max(n,c[3])}return[t,i,e,n]}#V(){return this.#s?Math.ceil(this.thickness*this.parentScale):0}#D(t=!1){if(this.isEmpty())return;if(!this.#s)return void this.#x();const e=this.#B(),i=this.#V();this.#e=Math.max(O.MIN_SIZE,e[2]-e[0]),this.#t=Math.max(O.MIN_SIZE,e[3]-e[1]);const n=Math.ceil(i+this.#e*this.scaleFactor),s=Math.ceil(i+this.#t*this.scaleFactor),[r,a]=this.parentDimensions;this.width=n/r,this.height=s/a,this.setAspectRatio(n,s);const l=this.translationX,h=this.translationY;this.translationX=-e[0],this.translationY=-e[1],this.#v(),this.#x(),this.#d=n,this.#a=s,this.setDims(n,s);const c=t?i/this.scaleFactor/2:0;this.translate(l-this.translationX-c,h-this.translationY-c)}static deserialize(t,e,i){var n=()=>super.deserialize,s=this;return(0,x.A)(function*(){if(t instanceof tn)return null;const r=yield n().call(s,t,e,i);r.thickness=t.thickness,r.color=I.makeHexColor(...t.color),r.opacity=t.opacity;const[a,l]=r.pageDimensions,h=r.width*a,c=r.height*l,d=r.parentScale,u=t.thickness/2;r.#s=!0,r.#d=Math.round(h),r.#a=Math.round(c);const{paths:f,rect:p,rotation:g}=t;for(let{bezier:m}of f){m=ut.#j(m,p,g);const v=[];r.paths.push(v);let A=d*(m[0]-u),w=d*(m[1]-u);for(let C=2,M=m.length;C<M;C+=6){const z=d*(m[C+4]-u),H=d*(m[C+5]-u);v.push([[A,w],[d*(m[C]-u),d*(m[C+1]-u)],[d*(m[C+2]-u),d*(m[C+3]-u)],[z,H]]),A=z,w=H}const E=s.#N(v);r.bezierPath2D.push(E)}const b=r.#B();return r.#e=Math.max(O.MIN_SIZE,b[2]-b[0]),r.#t=Math.max(O.MIN_SIZE,b[3]-b[1]),r.#M(h,c),r})()}serialize(){if(this.isEmpty())return null;const t=this.getRect(0,0),e=O._colorManager.convert(this.ctx.strokeStyle);return{annotationType:B.INK,color:e,thickness:this.thickness,opacity:this.opacity,paths:this.#F(this.scaleFactor/this.parentScale,this.translationX,this.translationY,t),pageIndex:this.pageIndex,rect:t,rotation:this.rotation,structTreeParentId:this._structTreeParentId}}}class nn extends O{#t=null;#e=null;#i=null;#n=null;#s=null;#r="";#l=null;#h=null;#c=null;#o=!1;#d=!1;static _type="stamp";static _editorType=B.STAMP;constructor(t){super({...t,name:"stampEditor"}),this.#n=t.bitmapUrl,this.#s=t.bitmapFile}static initialize(t,e){O.initialize(t,e)}static get supportedTypes(){return U(this,"supportedTypes",["apng","avif","bmp","gif","jpeg","png","svg+xml","webp","x-icon"].map(e=>`image/${e}`))}static get supportedTypesStr(){return U(this,"supportedTypesStr",this.supportedTypes.join(","))}static isHandlingMimeForPasting(t){return this.supportedTypes.includes(t)}static paste(t,e){e.pasteEditor(B.STAMP,{bitmapFile:t.getAsFile()})}altTextFinish(){this._uiManager.useNewAltTextFlow&&(this.div.hidden=!1),super.altTextFinish()}get telemetryFinalData(){return{type:"stamp",hasAltText:!!this.altTextData?.altText}}static computeTelemetryFinalData(t){const e=t.get("hasAltText");return{hasAltText:e.get(!0)??0,hasNoAltText:e.get(!1)??0}}#a(t,e=!1){t?(this.#t=t.bitmap,e||(this.#e=t.id,this.#o=t.isSvg),t.file&&(this.#r=t.file.name),this.#f()):this.remove()}#u(){if(this.#i=null,this._uiManager.enableWaiting(!1),this.#l){if(this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&this.#t)return this._editToolbar.hide(),void this._uiManager.editAltText(this,!0);if(!this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&this.#t){this._reportTelemetry({action:"pdfjs.image.image_added",data:{alt_text_modal:!1,alt_text_type:"empty"}});try{this.mlGuessAltText()}catch{}}this.div.focus()}}mlGuessAltText(){var t=this;return(0,x.A)(function*(e=null,i=!0){if(t.hasAltTextData())return null;const{mlManager:n}=t._uiManager;if(!n)throw new Error("No ML.");if(!(yield n.isEnabledFor("altText")))throw new Error("ML isn't enabled for alt text.");const{data:s,width:r,height:a}=e||t.copyCanvas(null,null,!0).imageData,l=yield n.guess({name:"altText",request:{data:s,width:r,height:a,channels:s.length/(r*a)}});if(!l)throw new Error("No response from the AI service.");if(l.error)throw new Error("Error from the AI service.");if(l.cancel)return null;if(!l.output)throw new Error("No valid response from the AI service.");const h=l.output;return yield t.setGuessedAltText(h),i&&!t.hasAltTextData()&&(t.altTextData={alt:h,decorative:!1}),h}).apply(this,arguments)}#p(){var t=this;if(this.#e)return this._uiManager.enableWaiting(!0),void this._uiManager.imageManager.getFromId(this.#e).then(n=>this.#a(n,!0)).finally(()=>this.#u());if(this.#n){const n=this.#n;return this.#n=null,this._uiManager.enableWaiting(!0),void(this.#i=this._uiManager.imageManager.getFromUrl(n).then(s=>this.#a(s)).finally(()=>this.#u()))}if(this.#s){const n=this.#s;return this.#s=null,this._uiManager.enableWaiting(!0),void(this.#i=this._uiManager.imageManager.getFromFile(n).then(s=>this.#a(s)).finally(()=>this.#u()))}const e=document.createElement("input");e.type="file",e.accept=nn.supportedTypesStr;const i=this._uiManager._signal;this.#i=new Promise(n=>{e.addEventListener("change",(0,x.A)(function*(){if(e.files&&0!==e.files.length){t._uiManager.enableWaiting(!0);const s=yield t._uiManager.imageManager.getFromFile(e.files[0]);t._reportTelemetry({action:"pdfjs.image.image_selected",data:{alt_text_modal:t._uiManager.useNewAltTextFlow}}),t.#a(s)}else t.remove();n()}),{signal:i}),e.addEventListener("cancel",()=>{this.remove(),n()},{signal:i})}).finally(()=>this.#u()),e.click()}remove(){this.#e&&(this.#t=null,this._uiManager.imageManager.deleteId(this.#e),this.#l?.remove(),this.#l=null,this.#h?.disconnect(),this.#h=null,this.#c&&(clearTimeout(this.#c),this.#c=null)),super.remove()}rebuild(){this.parent?(super.rebuild(),null!==this.div&&(this.#e&&null===this.#l&&this.#p(),this.isAttachedToDOM||this.parent.add(this))):this.#e&&this.#p()}onceAdded(){this._isDraggable=!0,this.div.focus()}isEmpty(){return!(this.#i||this.#t||this.#n||this.#s||this.#e)}get isResizable(){return!0}render(){if(this.div)return this.div;let t,e;if(this.width&&(t=this.x,e=this.y),super.render(),this.div.hidden=!0,this.div.setAttribute("role","figure"),this.addAltTextButton(),this.#t?this.#f():this.#p(),this.width&&!this.annotationElementId){const[i,n]=this.parentDimensions;this.setAt(t*i,e*n,this.width*i,this.height*n)}return this.div}#f(){const{div:t}=this;let{width:e,height:i}=this.#t;const[n,s]=this.pageDimensions,r=.75;if(this.width)e=this.width*n,i=this.height*s;else if(e>r*n||i>r*s){const c=Math.min(r*n/e,r*s/i);e*=c,i*=c}const[a,l]=this.parentDimensions;this.setDims(e*a/n,i*l/s),this._uiManager.enableWaiting(!1);const h=this.#l=document.createElement("canvas");h.setAttribute("role","img"),this.addContainer(h),(!this._uiManager.useNewAltTextWhenAddingImage||!this._uiManager.useNewAltTextFlow||this.annotationElementId)&&(t.hidden=!1),this.#m(e,i),this.#A(),this.#d||(this.parent.addUndoableEditor(this),this.#d=!0),this._reportTelemetry({action:"inserted_image"}),this.#r&&h.setAttribute("aria-label",this.#r)}copyCanvas(t,e,i=!1){t||(t=224);const{width:n,height:s}=this.#t,r=new Oi;let a=this.#t,l=n,h=s,c=null;if(e){if(n>e||s>e){const C=Math.min(e/n,e/s);l=Math.floor(n*C),h=Math.floor(s*C)}c=document.createElement("canvas");const u=c.width=Math.ceil(l*r.sx),f=c.height=Math.ceil(h*r.sy);this.#o||(a=this.#b(u,f));const p=c.getContext("2d");p.filter=this._uiManager.hcmFilter;let g="white",b="#cfcfd8";"none"!==this._uiManager.hcmFilter?b="black":window.matchMedia?.("(prefers-color-scheme: dark)").matches&&(g="#8f8f9d",b="#42414d");const m=15,v=m*r.sx,A=m*r.sy,w=new OffscreenCanvas(2*v,2*A),E=w.getContext("2d");E.fillStyle=g,E.fillRect(0,0,2*v,2*A),E.fillStyle=b,E.fillRect(0,0,v,A),E.fillRect(v,A,v,A),p.fillStyle=p.createPattern(w,"repeat"),p.fillRect(0,0,u,f),p.drawImage(a,0,0,a.width,a.height,0,0,u,f)}let d=null;if(i){let u,f;if(r.symmetric&&a.width<t&&a.height<t)u=a.width,f=a.height;else if(a=this.#t,n>t||s>t){const b=Math.min(t/n,t/s);u=Math.floor(n*b),f=Math.floor(s*b),this.#o||(a=this.#b(u,f))}const g=new OffscreenCanvas(u,f).getContext("2d",{willReadFrequently:!0});g.drawImage(a,0,0,a.width,a.height,0,0,u,f),d={width:u,height:f,data:g.getImageData(0,0,u,f).data}}return{canvas:c,width:l,height:h,imageData:d}}#g(t,e){const[i,n]=this.parentDimensions;this.width=t/i,this.height=e/n,this._initialOptions?.isCentered?this.center():this.fixAndSetPosition(),this._initialOptions=null,null!==this.#c&&clearTimeout(this.#c),this.#c=setTimeout(()=>{this.#c=null,this.#m(t,e)},200)}#b(t,e){const{width:i,height:n}=this.#t;let s=i,r=n,a=this.#t;for(;s>2*t||r>2*e;){const l=s,h=r;s>2*t&&(s=s>=16384?Math.floor(s/2)-1:Math.ceil(s/2)),r>2*e&&(r=r>=16384?Math.floor(r/2)-1:Math.ceil(r/2));const c=new OffscreenCanvas(s,r);c.getContext("2d").drawImage(a,0,0,l,h,0,0,s,r),a=c.transferToImageBitmap()}return a}#m(t,e){const i=new Oi,n=Math.ceil(t*i.sx),s=Math.ceil(e*i.sy),r=this.#l;if(!r||r.width===n&&r.height===s)return;r.width=n,r.height=s;const a=this.#o?this.#t:this.#b(n,s),l=r.getContext("2d");l.filter=this._uiManager.hcmFilter,l.drawImage(a,0,0,a.width,a.height,0,0,n,s)}getImageForAltText(){return this.#l}#_(t){if(t){if(this.#o){const n=this._uiManager.imageManager.getSvgUrl(this.#e);if(n)return n}const e=document.createElement("canvas");return({width:e.width,height:e.height}=this.#t),e.getContext("2d").drawImage(this.#t,0,0),e.toDataURL()}if(this.#o){const[e,i]=this.pageDimensions,n=Math.round(this.width*e*ue.PDF_TO_CSS_UNITS),s=Math.round(this.height*i*ue.PDF_TO_CSS_UNITS),r=new OffscreenCanvas(n,s);return r.getContext("2d").drawImage(this.#t,0,0,this.#t.width,this.#t.height,0,0,n,s),r.transferToImageBitmap()}return structuredClone(this.#t)}#A(){this._uiManager._signal&&(this.#h=new ResizeObserver(t=>{const e=t[0].contentRect;e.width&&e.height&&this.#g(e.width,e.height)}),this.#h.observe(this.div),this._uiManager._signal.addEventListener("abort",()=>{this.#h?.disconnect(),this.#h=null},{once:!0}))}static deserialize(t,e,i){var n=()=>super.deserialize,s=this;return(0,x.A)(function*(){let r=null;if(t instanceof ys){const{data:{rect:b,rotation:m,id:v,structParent:A,popupRef:w},container:E,parent:{page:{pageNumber:C}}}=t,M=E.querySelector("canvas"),T=i.imageManager.getFromCanvas(E.id,M);M.remove();const y=(yield e._structTree.getAriaAttributes(`${Li}${v}`))?.get("aria-label")||"";r=t={annotationType:B.STAMP,bitmapId:T.id,bitmap:T.bitmap,pageIndex:C-1,rect:b.slice(0),rotation:m,id:v,deleted:!1,accessibilityData:{decorative:!1,altText:y},isSvg:!1,structParent:A,popupRef:w}}const a=yield n().call(s,t,e,i),{rect:l,bitmap:h,bitmapUrl:c,bitmapId:d,isSvg:u,accessibilityData:f}=t;d&&i.imageManager.isValidId(d)?(a.#e=d,h&&(a.#t=h)):a.#n=c,a.#o=u;const[p,g]=a.pageDimensions;return a.width=(l[2]-l[0])/p,a.height=(l[3]-l[1])/g,a.annotationElementId=t.id||null,f&&(a.altTextData=f),a._initialData=r,a.#d=!!r,a})()}serialize(t=!1,e=null){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const i={annotationType:B.STAMP,bitmapId:this.#e,pageIndex:this.pageIndex,rect:this.getRect(0,0),rotation:this.rotation,isSvg:this.#o,structTreeParentId:this._structTreeParentId};if(t)return i.bitmapUrl=this.#_(!0),i.accessibilityData=this.serializeAltText(!0),i;const{decorative:n,altText:s}=this.serializeAltText(!1);if(!n&&s&&(i.accessibilityData={type:"Figure",alt:s}),this.annotationElementId){const a=this.#E(i);if(a.isSame)return null;a.isSameAltText?delete i.accessibilityData:i.accessibilityData.structParent=this._initialData.structParent??-1}if(i.id=this.annotationElementId,null===e)return i;e.stamps||=new Map;const r=this.#o?(i.rect[2]-i.rect[0])*(i.rect[3]-i.rect[1]):null;if(e.stamps.has(this.#e)){if(this.#o){const a=e.stamps.get(this.#e);r>a.area&&(a.area=r,a.serialized.bitmap.close(),a.serialized.bitmap=this.#_(!1))}}else e.stamps.set(this.#e,{area:r,serialized:i}),i.bitmap=this.#_(!1);return i}#E(t){const{rect:e,pageIndex:i,accessibilityData:{altText:n}}=this._initialData,s=t.rect.every((l,h)=>Math.abs(l-e[h])<1),r=t.pageIndex===i,a=(t.accessibilityData?.alt||"")===n;return{isSame:s&&r&&a,isSameAltText:a}}renderAnnotationElement(t){return t.updateEdited({rect:this.getRect(0,0)}),null}}let Jo=(()=>{class o{#t;#e=!1;#i=null;#n=null;#s=null;#r=new Map;#l=!1;#h=!1;#c=!1;#o=null;#d=null;#a;static _initialized=!1;static#u=new Map([ht,ut,nn,nt].map(e=>[e._editorType,e]));constructor({uiManager:e,pageIndex:i,div:n,structTreeLayer:s,accessibilityManager:r,annotationLayer:a,drawLayer:l,textLayer:h,viewport:c,l10n:d}){const u=[...o.#u.values()];if(!o._initialized){o._initialized=!0;for(const f of u)f.initialize(d,e)}e.registerEditorTypes(u),this.#a=e,this.pageIndex=i,this.div=n,this.#t=r,this.#i=a,this.viewport=c,this.#o=h,this.drawLayer=l,this._structTree=s,this.#a.addLayer(this)}get isEmpty(){return 0===this.#r.size}get isInvisible(){return this.isEmpty&&this.#a.getMode()===B.NONE}updateToolbar(e){this.#a.updateToolbar(e)}updateMode(e=this.#a.getMode()){switch(this.#m(),e){case B.NONE:return this.disableTextSelection(),this.togglePointerEvents(!1),this.toggleAnnotationLayerPointerEvents(!0),void this.disableClick();case B.INK:this.addInkEditorIfNeeded(!1),this.disableTextSelection(),this.togglePointerEvents(!0),this.disableClick();break;case B.HIGHLIGHT:this.enableTextSelection(),this.togglePointerEvents(!1),this.disableClick();break;default:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick()}this.toggleAnnotationLayerPointerEvents(!1);const{classList:i}=this.div;for(const n of o.#u.values())i.toggle(`${n._type}Editing`,e===n._editorType);this.div.hidden=!1}hasTextLayer(e){return e===this.#o?.div}addInkEditorIfNeeded(e){if(this.#a.getMode()===B.INK){if(!e)for(const n of this.#r.values())if(n.isEmpty())return void n.setInBackground();this.createAndAddNewEditor({offsetX:0,offsetY:0},!1).setInBackground()}}setEditingState(e){this.#a.setEditingState(e)}addCommands(e){this.#a.addCommands(e)}toggleDrawing(e=!1){this.div.classList.toggle("drawing",!e)}togglePointerEvents(e=!1){this.div.classList.toggle("disabled",!e)}toggleAnnotationLayerPointerEvents(e=!1){this.#i?.div.classList.toggle("disabled",!e)}enable(){var e=this;return(0,x.A)(function*(){e.div.tabIndex=0,e.togglePointerEvents(!0);const i=new Set;for(const s of e.#r.values())s.enableEditing(),s.show(!0),s.annotationElementId&&(e.#a.removeChangedExistingAnnotation(s),i.add(s.annotationElementId));if(!e.#i)return;const n=e.#i.getEditableAnnotations();for(const s of n){if(s.hide(),e.#a.isDeletedAnnotationElement(s.data.id)||i.has(s.data.id))continue;const r=yield e.deserialize(s);r&&(e.addOrRebuild(r),r.enableEditing())}})()}disable(){this.#c=!0,this.div.tabIndex=-1,this.togglePointerEvents(!1);const e=new Map,i=new Map;for(const s of this.#r.values())if(s.disableEditing(),s.annotationElementId){if(null!==s.serialize()){e.set(s.annotationElementId,s);continue}i.set(s.annotationElementId,s),this.getEditableAnnotation(s.annotationElementId)?.show(),s.remove()}if(this.#i){const s=this.#i.getEditableAnnotations();for(const r of s){const{id:a}=r.data;if(this.#a.isDeletedAnnotationElement(a))continue;let l=i.get(a);l?(l.resetAnnotationElement(r),l.show(!1),r.show()):(l=e.get(a),l&&(this.#a.addChangedExistingAnnotation(l),l.renderAnnotationElement(r)&&l.show(!1)),r.show())}}this.#m(),this.isEmpty&&(this.div.hidden=!0);const{classList:n}=this.div;for(const s of o.#u.values())n.remove(`${s._type}Editing`);this.disableTextSelection(),this.toggleAnnotationLayerPointerEvents(!0),this.#c=!1}getEditableAnnotation(e){return this.#i?.getEditableAnnotation(e)||null}setActiveEditor(e){this.#a.getActive()!==e&&this.#a.setActiveEditor(e)}enableTextSelection(){if(this.div.tabIndex=-1,this.#o?.div&&!this.#d){this.#d=new AbortController;const e=this.#a.combinedSignal(this.#d);this.#o.div.addEventListener("pointerdown",this.#p.bind(this),{signal:e}),this.#o.div.classList.add("highlighting")}}disableTextSelection(){this.div.tabIndex=0,this.#o?.div&&this.#d&&(this.#d.abort(),this.#d=null,this.#o.div.classList.remove("highlighting"))}#p(e){this.#a.unselectAll();const{target:i}=e;if(i===this.#o.div||("img"===i.getAttribute("role")||i.classList.contains("endOfContent"))&&this.#o.div.contains(i)){const{isMac:n}=bt.platform;if(0!==e.button||e.ctrlKey&&n)return;this.#a.showAllEditors("highlight",!0,!0),this.#o.div.classList.add("free"),this.toggleDrawing(),nt.startHighlighting(this,"ltr"===this.#a.direction,{target:this.#o.div,x:e.x,y:e.y}),this.#o.div.addEventListener("pointerup",()=>{this.#o.div.classList.remove("free"),this.toggleDrawing(!0)},{once:!0,signal:this.#a._signal}),e.preventDefault()}}enableClick(){if(this.#n)return;this.#n=new AbortController;const e=this.#a.combinedSignal(this.#n);this.div.addEventListener("pointerdown",this.pointerdown.bind(this),{signal:e}),this.div.addEventListener("pointerup",this.pointerup.bind(this),{signal:e})}disableClick(){this.#n?.abort(),this.#n=null}attach(e){this.#r.set(e.id,e);const{annotationElementId:i}=e;i&&this.#a.isDeletedAnnotationElement(i)&&this.#a.removeDeletedAnnotationElement(e)}detach(e){this.#r.delete(e.id),this.#t?.removePointerInTextLayer(e.contentDiv),!this.#c&&e.annotationElementId&&this.#a.addDeletedAnnotationElement(e)}remove(e){this.detach(e),this.#a.removeEditor(e),e.div.remove(),e.isAttachedToDOM=!1,this.#h||this.addInkEditorIfNeeded(!1)}changeParent(e){e.parent!==this&&(e.parent&&e.annotationElementId&&(this.#a.addDeletedAnnotationElement(e.annotationElementId),O.deleteAnnotationElement(e),e.annotationElementId=null),this.attach(e),e.parent?.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),this.#a.addEditor(e),this.attach(e),!e.isAttachedToDOM){const i=e.render();this.div.append(i),e.isAttachedToDOM=!0}e.fixAndSetPosition(),e.onceAdded(),this.#a.addToAnnotationStorage(e),e._reportTelemetry(e.telemetryInitialData)}}moveEditorInDOM(e){if(!e.isAttachedToDOM)return;const{activeElement:i}=document;e.div.contains(i)&&!this.#s&&(e._focusEventsAllowed=!1,this.#s=setTimeout(()=>{this.#s=null,e.div.contains(document.activeElement)?e._focusEventsAllowed=!0:(e.div.addEventListener("focusin",()=>{e._focusEventsAllowed=!0},{once:!0,signal:this.#a._signal}),i.focus())},0)),e._structTreeParentId=this.#t?.moveElementInDOM(this.div,e.div,e.contentDiv,!0)}addOrRebuild(e){e.needsToBeRebuilt()?(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 this.#a.getId()}get#f(){return o.#u.get(this.#a.getMode())}combinedSignal(e){return this.#a.combinedSignal(e)}#g(e){const i=this.#f;return i?new i.prototype.constructor(e):null}canCreateNewEmptyEditor(){return this.#f?.canCreateNewEmptyEditor()}pasteEditor(e,i){this.#a.updateToolbar(e),this.#a.updateMode(e);const{offsetX:n,offsetY:s}=this.#b(),r=this.getNextId(),a=this.#g({parent:this,id:r,x:n,y:s,uiManager:this.#a,isCentered:!0,...i});a&&this.add(a)}deserialize(e){var i=this;return(0,x.A)(function*(){return(yield o.#u.get(e.annotationType??e.annotationEditorType)?.deserialize(e,i,i.#a))||null})()}createAndAddNewEditor(e,i,n={}){const s=this.getNextId(),r=this.#g({parent:this,id:s,x:e.offsetX,y:e.offsetY,uiManager:this.#a,isCentered:i,...n});return r&&this.add(r),r}#b(){const{x:e,y:i,width:n,height:s}=this.div.getBoundingClientRect(),r=Math.max(0,e),a=Math.max(0,i),c=(r+Math.min(window.innerWidth,e+n))/2-e,d=(a+Math.min(window.innerHeight,i+s))/2-i,[u,f]=this.viewport.rotation%180==0?[c,d]:[d,c];return{offsetX:u,offsetY:f}}addNewEditor(){this.createAndAddNewEditor(this.#b(),!0)}setSelected(e){this.#a.setSelected(e)}toggleSelected(e){this.#a.toggleSelected(e)}unselect(e){this.#a.unselect(e)}pointerup(e){const{isMac:i}=bt.platform;if(!(0!==e.button||e.ctrlKey&&i)&&e.target===this.div&&this.#l){if(this.#l=!1,!this.#e)return void(this.#e=!0);if(this.#a.getMode()===B.STAMP)return void this.#a.unselectAll();this.createAndAddNewEditor(e,!1)}}pointerdown(e){if(this.#a.getMode()===B.HIGHLIGHT&&this.enableTextSelection(),this.#l)return void(this.#l=!1);const{isMac:i}=bt.platform;if(0!==e.button||e.ctrlKey&&i||e.target!==this.div)return;this.#l=!0;const n=this.#a.getActive();this.#e=!n||n.isEmpty()}findNewParent(e,i,n){const s=this.#a.findParent(i,n);return null!==s&&s!==this&&(s.changeParent(e),!0)}destroy(){this.#a.getActive()?.parent===this&&(this.#a.commitOrRemove(),this.#a.setActiveEditor(null)),this.#s&&(clearTimeout(this.#s),this.#s=null);for(const e of this.#r.values())this.#t?.removePointerInTextLayer(e.contentDiv),e.setParent(null),e.isAttachedToDOM=!1,e.div.remove();this.div=null,this.#r.clear(),this.#a.removeLayer(this)}#m(){this.#h=!0;for(const e of this.#r.values())e.isEmpty()&&e.remove();this.#h=!1}render({viewport:e}){this.viewport=e,se(this.div,e);for(const i of this.#a.getEditors(this.pageIndex))this.add(i),i.rebuild();this.updateMode()}update({viewport:e}){this.#a.commitOrRemove(),this.#m();const i=this.viewport.rotation,n=e.rotation;if(this.viewport=e,se(this.div,{rotation:n}),i!==n)for(const s of this.#r.values())s.rotate(n);this.addInkEditorIfNeeded(!1)}get pageDimensions(){const{pageWidth:e,pageHeight:i}=this.viewport.rawDims;return[e,i]}get scale(){return this.#a.viewParameters.realScale}}return o})();class gt{#t=null;#e=0;#i=new Map;#n=new Map;constructor({pageIndex:t}){this.pageIndex=t}setParent(t){if(this.#t){if(this.#t!==t){if(this.#i.size>0)for(const e of this.#i.values())e.remove(),t.append(e);this.#t=t}}else this.#t=t}static get _svgFactory(){return U(this,"_svgFactory",new Zi)}static#s(t,{x:e=0,y:i=0,width:n=1,height:s=1}={}){const{style:r}=t;r.top=100*i+"%",r.left=100*e+"%",r.width=100*n+"%",r.height=100*s+"%"}#r(t){const e=gt._svgFactory.create(1,1,!0);return this.#t.append(e),e.setAttribute("aria-hidden",!0),gt.#s(e,t),e}#l(t,e){const i=gt._svgFactory.createElement("clipPath");t.append(i);const n=`clip_${e}`;i.setAttribute("id",n),i.setAttribute("clipPathUnits","objectBoundingBox");const s=gt._svgFactory.createElement("use");return i.append(s),s.setAttribute("href",`#${e}`),s.classList.add("clip"),n}draw(t,e,i,n=!1){const s=this.#e++,r=this.#r(t.box);r.classList.add(...t.classNamesForDrawing);const a=gt._svgFactory.createElement("defs");r.append(a);const l=gt._svgFactory.createElement("path");a.append(l);const h=`path_p${this.pageIndex}_${s}`;l.setAttribute("id",h),l.setAttribute("d",t.toSVGPath()),n&&this.#n.set(s,l);const c=this.#l(a,h),d=gt._svgFactory.createElement("use");return r.append(d),r.setAttribute("fill",e),r.setAttribute("fill-opacity",i),d.setAttribute("href",`#${h}`),this.#i.set(s,r),{id:s,clipPathId:`url(#${c})`}}drawOutline(t){const e=this.#e++,i=this.#r(t.box);i.classList.add(...t.classNamesForOutlining);const n=gt._svgFactory.createElement("defs");i.append(n);const s=gt._svgFactory.createElement("path");n.append(s);const r=`path_p${this.pageIndex}_${e}`;let a;if(s.setAttribute("id",r),s.setAttribute("d",t.toSVGPath()),s.setAttribute("vector-effect","non-scaling-stroke"),t.mustRemoveSelfIntersections){const c=gt._svgFactory.createElement("mask");n.append(c),a=`mask_p${this.pageIndex}_${e}`,c.setAttribute("id",a),c.setAttribute("maskUnits","objectBoundingBox");const d=gt._svgFactory.createElement("rect");c.append(d),d.setAttribute("width","1"),d.setAttribute("height","1"),d.setAttribute("fill","white");const u=gt._svgFactory.createElement("use");c.append(u),u.setAttribute("href",`#${r}`),u.setAttribute("stroke","none"),u.setAttribute("fill","black"),u.setAttribute("fill-rule","nonzero"),u.classList.add("mask")}const l=gt._svgFactory.createElement("use");i.append(l),l.setAttribute("href",`#${r}`),a&&l.setAttribute("mask",`url(#${a})`);const h=l.cloneNode();return i.append(h),l.classList.add("mainOutline"),h.classList.add("secondaryOutline"),this.#i.set(e,i),e}finalizeLine(t,e){const i=this.#n.get(t);this.#n.delete(t),this.updateBox(t,e.box),i.setAttribute("d",e.toSVGPath())}updateLine(t,e){this.#i.get(t).firstChild.firstChild.setAttribute("d",e.toSVGPath())}updatePath(t,e){this.#n.get(t).setAttribute("d",e.toSVGPath())}updateBox(t,e){gt.#s(this.#i.get(t),e)}show(t,e){this.#i.get(t).classList.toggle("hidden",!e)}rotate(t,e){this.#i.get(t).setAttribute("data-main-rotation",e)}changeColor(t,e){this.#i.get(t).setAttribute("fill",e)}changeOpacity(t,e){this.#i.get(t).setAttribute("fill-opacity",e)}addClass(t,e){this.#i.get(t).classList.add(e)}removeClass(t,e){this.#i.get(t).classList.remove(e)}getSVGRoot(t){return this.#i.get(t)}remove(t){this.#n.delete(t),null!==this.#t&&(this.#i.get(t).remove(),this.#i.delete(t))}destroy(){this.#t=null;for(const t of this.#i.values())t.remove();this.#i.clear(),this.#n.clear()}}var tl=N.AbortException,el=N.AnnotationEditorLayer,il=N.AnnotationEditorParamsType,Cs=N.AnnotationEditorType,nl=N.AnnotationEditorUIManager,sl=N.AnnotationLayer,rl=N.AnnotationMode,al=N.ColorPicker,ol=N.DOMSVGFactory,ll=N.DrawLayer,hl=N.FeatureTest,Ss=N.GlobalWorkerOptions,cl=N.ImageKind,dl=N.InvalidPDFException,ul=N.MissingPDFException,fl=N.OPS,pl=N.OutputScale,gl=N.PDFDataRangeTransport,ml=N.PDFDateString,bl=N.PDFWorker,_l=N.PasswordResponses,vl=N.PermissionFlag,Al=N.PixelsPerInch,yl=N.RenderingCancelledException,wl=N.TextLayer,El=N.UnexpectedResponseException,xl=N.Util,Ps=N.VerbosityLevel,Cl=N.XfaLayer,Sl=N.build,Pl=N.createValidAbsoluteUrl,Tl=N.fetchData,Ts=N.getDocument,Ml=N.getFilenameFromUrl,Ll=N.getPdfFilenameFromUrl,Rl=N.getXfaPageViewport,Il=N.isDataScheme,kl=N.isPdfFile,Dl=N.noContextMenu,Ol=N.normalizeUnicode,Fl=N.setLayerDimensions,Nl=N.shadow,oi=N.version,Bl=F(7106);function Ms(o){return new Bl.A(o,0)}var Ls=F(600);function li(o){function t(e){if(Object(e)!==e)return Promise.reject(new TypeError(e+" is not an object."));var i=e.done;return Promise.resolve(e.value).then(function(n){return{value:n,done:i}})}return(li=function(i){this.s=i,this.n=i.next}).prototype={s:null,n:null,next:function(){return t(this.n.apply(this.s,arguments))},return:function(i){var n=this.s.return;return void 0===n?Promise.resolve({value:i,done:!0}):t(n.apply(this.s,arguments))},throw:function(i){var n=this.s.return;return void 0===n?Promise.reject(i):t(n.apply(this.s,arguments))}},new li(o)}var Oe={d:(o,t)=>{for(var e in t)Oe.o(t,e)&&!Oe.o(o,e)&&Object.defineProperty(o,e,{enumerable:!0,get:t[e]})},o:(o,t)=>Object.prototype.hasOwnProperty.call(o,t)},q=globalThis.pdfjsViewer={};Oe.d(q,{AnnotationLayerBuilder:()=>Ys,DownloadManager:()=>Oh,EventBus:()=>un,FindState:()=>Jt,GenericL10n:()=>Yt,LinkTarget:()=>le,PDFFindController:()=>yh,PDFHistory:()=>Mc,PDFLinkService:()=>fi,PDFPageView:()=>vr,PDFScriptingManager:()=>zc,PDFSinglePageViewer:()=>$c,PDFViewer:()=>wr,ProgressBar:()=>Zl,RenderingStates:()=>tt,ScrollMode:()=>G,SimpleLinkService:()=>ln,SpreadMode:()=>mt,StructTreeLayerBuilder:()=>br,TextLayerBuilder:()=>ve,XfaLayerBuilder:()=>_r,parseQueryString:()=>hi});const tt={INITIAL:0,RUNNING:1,PAUSED:2,FINISHED:3},G={UNKNOWN:-1,VERTICAL:0,HORIZONTAL:1,WRAPPED:2,PAGE:3},mt={UNKNOWN:-1,NONE:0,ODD:1,EVEN:2};function Os(o,t,e=!1){let i=o.offsetParent;if(!i)return void console.error("offsetParent is not set -- cannot scroll");let n=o.offsetTop+o.clientTop,s=o.offsetLeft+o.clientLeft;for(;i.clientHeight===i.scrollHeight&&i.clientWidth===i.scrollWidth||e&&(i.classList.contains("markedContent")||"hidden"===getComputedStyle(i).overflow);)if(n+=i.offsetTop,s+=i.offsetLeft,i=i.offsetParent,!i)return;t&&(void 0!==t.top&&(n+=t.top),void 0!==t.left&&(s+=t.left,i.scrollLeft=s)),i.scrollTop=n}function hi(o){const t=new Map;for(const[e,i]of new URLSearchParams(o))t.set(e.toLowerCase(),i);return t}const Fs=/[\x00-\x1F]/g;function Fe(o,t=!1){return Fs.test(o)?t?o.replaceAll(Fs,e=>"\0"===e?"":" "):o.replaceAll("\0",""):o}function Ne(o,t,e=0){let i=e,n=o.length-1;if(n<0||!t(o[n]))return o.length;if(t(o[i]))return i;for(;i<n;){const s=i+n>>1;t(o[s])?n=s:i=s+1}return i}function Ns(o){if(Math.floor(o)===o)return[o,1];const t=1/o;if(t>8)return[1,8];if(Math.floor(t)===t)return[1,t];const i=o>1?t:o;let l,n=0,s=1,r=1,a=1;for(;;){const h=n+r,c=s+a;if(c>8)break;i<=h/c?(r=h,a=c):(n=h,s=c)}return l=i-n/s<r/a-i?i===o?[n,s]:[s,n]:i===o?[r,a]:[a,r],l}function ci(o,t){return o-o%t}function Bs(o){return Number.isInteger(o)&&o%90==0}function Vs(o){return o.width<=o.height}new Promise(function(o){window.requestAnimationFrame(o)});const ql=document.documentElement.style;class Zl{#t=null;#e=null;#i=0;#n=null;#s=!0;constructor(t){this.#t=t.classList,this.#n=t.style}get percent(){return this.#i}set percent(t){this.#i=function Ql(o,t,e){return Math.min(Math.max(o,t),e)}(t,0,100),isNaN(t)?this.#t.add("indeterminate"):(this.#t.remove("indeterminate"),this.#n.setProperty("--progressBar-percent",`${this.#i}%`))}setWidth(t){if(!t)return;const i=t.parentNode.offsetWidth-t.offsetWidth;i>0&&this.#n.setProperty("--progressBar-end-offset",`${i}px`)}setDisableAutoFetch(t=5e3){100===this.#i||isNaN(this.#i)||(this.#e&&clearTimeout(this.#e),this.show(),this.#e=setTimeout(()=>{this.#e=null,this.hide()},t))}hide(){this.#s&&(this.#s=!1,this.#t.add("hidden"))}show(){this.#s||(this.#s=!0,this.#t.remove("hidden"))}}const di=function(){const o=document.createElement("div");return o.style.width="round(down, calc(1.6666666666666665 * 792px), 1px)","calc(1320px)"===o.style.width?Math.fround:t=>t}();function ui(o){return function th(o){return o<11904}(o)?function eh(o){return!(65408&o)}(o)?function sh(o){return 32===o||9===o||13===o||10===o}(o)?0:function ih(o){return o>=97&&o<=122||o>=65&&o<=90}(o)||function nh(o){return o>=48&&o<=57}(o)||95===o?1:2:function hh(o){return 3584==(65408&o)}(o)?7:160===o?0:1:function rh(o){return o>=13312&&o<=40959||o>=63744&&o<=64255}(o)?3:function ah(o){return o>=12448&&o<=12543}(o)?4:function oh(o){return o>=12352&&o<=12447}(o)?5:function lh(o){return o>=65376&&o<=65439}(o)?6:1}let js;const Jt={FOUND:0,NOT_FOUND:1,WRAPPED:2,PENDING:3},Hs={"\u2010":"-","\u2018":"'","\u2019":"'","\u201a":"'","\u201b":"'","\u201c":'"',"\u201d":'"',"\u201e":'"',"\u201f":'"',"\xbc":"1/4","\xbd":"1/2","\xbe":"3/4"},zs=new Set([12441,12442,2381,2509,2637,2765,2893,3021,3149,3277,3387,3388,3405,3530,3642,3770,3972,4153,4154,5908,5940,6098,6752,6980,7082,7083,7154,7155,11647,43014,43052,43204,43347,43456,43766,44013,3158,3953,3954,3962,3963,3964,3965,3968,3956]);let Ws;const ph=new RegExp("\\p{M}+","gu"),gh=new RegExp("([.*+?^${}()|[\\]\\\\])|(\\p{P})|(\\s+)|(\\p{M})|(\\p{L})","gu"),mh=new RegExp("([^\\p{M}])\\p{M}*$","u"),bh=new RegExp("^\\p{M}*([^\\p{M}])","u"),_h=/[\uAC00-\uD7AF\uFA6C\uFACF-\uFAD1\uFAD5-\uFAD7]+/g,Us=new Map,Gs=new Map;let rn=null,an=null;function on(o){const t=[];let e,i;for(;null!==(e=_h.exec(o));){let{index:f}=e;for(const p of e[0]){let g=Us.get(p);g||(g=p.normalize("NFD").length,Us.set(p,g)),t.push([g,f++])}}if(0===t.length&&rn)i=rn;else if(t.length>0&&an)i=an;else{const v=`([${Object.keys(Hs).join("")}])|([${function ch(){return js||="\xa0\xa8\xaa\xaf\xb2-\xb5\xb8-\xba\xbc-\xbe\u0132-\u0133\u013f-\u0140\u0149\u017f\u01c4-\u01cc\u01f1-\u01f3\u02b0-\u02b8\u02d8-\u02dd\u02e0-\u02e4\u0374\u037a\u037e\u0384-\u0385\u0387\u03d0-\u03d6\u03f0-\u03f2\u03f4-\u03f5\u03f9\u0587\u0675-\u0678\u0958-\u095f\u09dc-\u09dd\u09df\u0a33\u0a36\u0a59-\u0a5b\u0a5e\u0b5c-\u0b5d\u0e33\u0eb3\u0edc-\u0edd\u0f0c\u0f43\u0f4d\u0f52\u0f57\u0f5c\u0f69\u10fc\u1d2c-\u1d2e\u1d30-\u1d3a\u1d3c-\u1d4d\u1d4f-\u1d6a\u1d78\u1d9b-\u1dbf\u1e9a-\u1e9b\u1f71\u1f73\u1f75\u1f77\u1f79\u1f7b\u1f7d\u1fbb\u1fbd-\u1fc1\u1fc9\u1fcb\u1fcd-\u1fcf\u1fd3\u1fdb\u1fdd-\u1fdf\u1fe3\u1feb\u1fed-\u1fef\u1ff9\u1ffb\u1ffd-\u1ffe\u2000-\u200a\u2011\u2017\u2024-\u2026\u202f\u2033-\u2034\u2036-\u2037\u203c\u203e\u2047-\u2049\u2057\u205f\u2070-\u2071\u2074-\u208e\u2090-\u209c\u20a8\u2100-\u2103\u2105-\u2107\u2109-\u2113\u2115-\u2116\u2119-\u211d\u2120-\u2122\u2124\u2126\u2128\u212a-\u212d\u212f-\u2131\u2133-\u2139\u213b-\u2140\u2145-\u2149\u2150-\u217f\u2189\u222c-\u222d\u222f-\u2230\u2329-\u232a\u2460-\u24ea\u2a0c\u2a74-\u2a76\u2adc\u2c7c-\u2c7d\u2d6f\u2e9f\u2ef3\u2f00-\u2fd5\u3000\u3036\u3038-\u303a\u309b-\u309c\u309f\u30ff\u3131-\u318e\u3192-\u319f\u3200-\u321e\u3220-\u3247\u3250-\u327e\u3280-\u33ff\ua69c-\ua69d\ua770\ua7f2-\ua7f4\ua7f8-\ua7f9\uab5c-\uab5f\uab69\uf900-\ufa0d\ufa10\ufa12\ufa15-\ufa1e\ufa20\ufa22\ufa25-\ufa26\ufa2a-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfc\ufe10-\ufe19\ufe30-\ufe44\ufe47-\ufe52\ufe54-\ufe66\ufe68-\ufe6b\ufe70-\ufe72\ufe74\ufe76-\ufefc\uff01-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc\uffe0-\uffe6",js}()}])|((?:\u3099|\u309a)\\n)|(\\p{M}+(?:-\\n)?)|(\\p{Ll}-\\n\\p{Lu})|(\\S-\\n)|((?:\\p{Ideographic}|[\u3040-\u30ff])\\n)|(\\n)`;i=0===t.length?rn=new RegExp(v+"|(\\u0000)","gum"):an=new RegExp(v+"|([\\u1100-\\u1112\\ud7a4-\\ud7af\\ud84a\\ud84c\\ud850\\ud854\\ud857\\ud85f])","gum")}const n=[];for(;null!==(e=ph.exec(o));)n.push([e[0].length,e.index]);let s=o.normalize("NFD");const r=[[0,0]];let a=0,l=0,h=0,c=0,d=0,u=!1;return s=s.replace(i,(f,p,g,b,m,v,A,w,E,C,M)=>{if(M-=c,p){const T=Hs[p],y=T.length;for(let S=1;S<y;S++)r.push([M-h+S,h-S]);return h-=y-1,T}if(g){let T=Gs.get(g);T||(T=g.normalize("NFKC"),Gs.set(g,T));const y=T.length;for(let S=1;S<y;S++)r.push([M-h+S,h-S]);return h-=y-1,T}if(b)return u=!0,M+d===n[a]?.[1]?++a:(r.push([M-1-h+1,h-1]),h-=1,c+=1),r.push([M-h+1,h]),c+=1,d+=1,b.charAt(0);if(m){const T=m.endsWith("\n"),y=T?m.length-2:m.length;u=!0;let S=y;M+d===n[a]?.[1]&&(S-=n[a][0],++a);for(let L=1;L<=S;L++)r.push([M-1-h+L,h-L]);return h-=S,c+=S,T?(r.push([(M+=y-1)-h+1,1+h]),h+=1,c+=1,d+=1,m.slice(0,y)):m}if(v)return r.push([M-h+3,1+h]),h+=1,c+=1,d+=1,v.replace("\n","");if(A)return r.push([M-h+(A.length-2),1+h]),h+=1,c+=1,d+=1,A.slice(0,-2);if(w)return r.push([M-h+(w.length-1),h]),c+=1,d+=1,w.slice(0,-1);if(E)return r.push([M-h+1,h-1]),h-=1,c+=1,d+=1," ";if(M+d===t[l]?.[1]){const T=t[l][0]-1;++l;for(let y=1;y<=T;y++)r.push([M-(h-y),h-y]);h-=T,c+=T}return C}),r.push([s.length,h]),[s,r,u]}class yh{#t=null;#e=!0;#i=0;constructor({linkService:t,eventBus:e,updateMatchesCountOnProgress:i=!0}){this._linkService=t,this._eventBus=e,this.#e=i,this.onIsPageVisible=null,this.#s(),e._on("find",this.#n.bind(this)),e._on("findbarclose",this.#_.bind(this))}get highlightMatches(){return this._highlightMatches}get pageMatches(){return this._pageMatches}get pageMatchesLength(){return this._pageMatchesLength}get selected(){return this._selected}get state(){return this.#t}setDocument(t){this._pdfDocument&&this.#s(),t&&(this._pdfDocument=t,this._firstPageCapability.resolve())}#n(t){if(!t)return;const e=this._pdfDocument,{type:i}=t;(null===this.#t||this.#l(t))&&(this._dirtyMatch=!0),this.#t=t,"highlightallchange"!==i&&this.#y(Jt.PENDING),this._firstPageCapability.promise.then(()=>{if(!this._pdfDocument||e&&this._pdfDocument!==e)return;this.#d();const n=!this._highlightMatches,s=!!this._findTimeout;this._findTimeout&&(clearTimeout(this._findTimeout),this._findTimeout=null),i?this._dirtyMatch?this.#p():"again"===i?(this.#p(),n&&this.#t.highlightAll&&this.#u()):"highlightallchange"===i?(s?this.#p():this._highlightMatches=!0,this.#u()):this.#p():this._findTimeout=setTimeout(()=>{this.#p(),this._findTimeout=null},250)})}scrollMatchIntoView({element:t=null,selectedLeft:e=0,pageIndex:i=-1,matchIndex:n=-1}){this._scrollMatches&&t&&-1!==n&&n===this._selected.matchIdx&&-1!==i&&i===this._selected.pageIdx&&(this._scrollMatches=!1,Os(t,{top:-50,left:e+-400},!0))}#s(){this._highlightMatches=!1,this._scrollMatches=!1,this._pdfDocument=null,this._pageMatches=[],this._pageMatchesLength=[],this.#i=0,this.#t=null,this._selected={pageIdx:-1,matchIdx:-1},this._offset={pageIdx:null,matchIdx:null,wrapped:!1},this._extractTextPromises=[],this._pageContents=[],this._pageDiffs=[],this._hasDiacritics=[],this._matchesCountTotal=0,this._pagesToSearch=null,this._pendingFindMatches=new Set,this._resumePageIdx=null,this._dirtyMatch=!1,clearTimeout(this._findTimeout),this._findTimeout=null,this._firstPageCapability=Promise.withResolvers()}get#r(){const{query:t}=this.#t;return"string"==typeof t?(t!==this._rawQuery&&(this._rawQuery=t,[this._normalizedQuery]=on(t)),this._normalizedQuery):(t||[]).filter(e=>!!e).map(e=>on(e)[0])}#l(t){const e=t.query,i=this.#t.query,n=typeof e;if(n!==typeof i)return!0;if("string"===n){if(e!==i)return!0}else if(JSON.stringify(e)!==JSON.stringify(i))return!0;switch(t.type){case"again":const r=this._selected.pageIdx+1,a=this._linkService;return r>=1&&r<=a.pagesCount&&r!==a.page&&!(this.onIsPageVisible?.(r)??1);case"highlightallchange":return!1}return!0}#h(t,e,i){let n=t.slice(0,e).match(mh);if(n){const s=t.charCodeAt(e),r=n[1].charCodeAt(0);if(ui(s)===ui(r))return!1}if(n=t.slice(e+i).match(bh),n){const s=t.charCodeAt(e+i-1),r=n[1].charCodeAt(0);if(ui(s)===ui(r))return!1}return!0}#c(t,e){const{matchDiacritics:i}=this.#t;let n=!1;return(t=t.replaceAll(gh,(r,a,l,h,c,d)=>a?`[ ]*\\${a}[ ]*`:l?`[ ]*${l}[ ]*`:h?"[ ]+":i?c||d:c?zs.has(c.charCodeAt(0))?c:"":e?(n=!0,`${d}\\p{M}*`):d)).endsWith("[ ]*")&&(t=t.slice(0,t.length-4)),i&&e&&(Ws||=String.fromCharCode(...zs),n=!0,t=`${t}(?=[${Ws}]|[^\\p{M}]|$)`),[n,t]}#o(t){const e=this.#r;if(0===e.length)return;const n=this.match(e,this._pageContents[t],t),s=this._pageMatches[t]=[],r=this._pageMatchesLength[t]=[],a=this._pageDiffs[t];n?.forEach(({index:h,length:c})=>{const[d,u]=function Ah(o,t,e){if(!o)return[t,e];const i=t,n=t+e-1;let s=Ne(o,c=>c[0]>=i);o[s][0]>i&&--s;let r=Ne(o,c=>c[0]>=n,s);o[r][0]>n&&--r;const a=i+o[s][1];return[a,n+o[r][1]+1-a]}(a,h,c);u&&(s.push(d),r.push(u))}),this.#t.highlightAll&&this.#a(t),this._resumePageIdx===t&&(this._resumePageIdx=null,this.#g());const l=s.length;this._matchesCountTotal+=l,this.#e?l>0&&this.#E():++this.#i===this._linkService.pagesCount&&this.#E()}match(t,e,i){const n=this._hasDiacritics[i];let s=!1;if("string"==typeof t?[s,t]=this.#c(t,n):t=t.sort().reverse().map(d=>{const[u,f]=this.#c(d,n);return s||=u,`(${f})`}).join("|"),!t)return;const{caseSensitive:r,entireWord:a}=this.#t;t=new RegExp(t,`g${s?"u":""}${r?"":"i"}`);const h=[];let c;for(;null!==(c=t.exec(e));)a&&!this.#h(e,c.index,c[0].length)||h.push({index:c.index,length:c[0].length});return h}#d(){if(this._extractTextPromises.length>0)return;let t=Promise.resolve();const e={disableNormalization:!0};for(let i=0,n=this._linkService.pagesCount;i<n;i++){const{promise:s,resolve:r}=Promise.withResolvers();this._extractTextPromises[i]=s,t=t.then(()=>this._pdfDocument.getPage(i+1).then(a=>a.getTextContent(e)).then(a=>{const l=[];for(const h of a.items)l.push(h.str),h.hasEOL&&l.push("\n");[this._pageContents[i],this._pageDiffs[i],this._hasDiacritics[i]]=on(l.join("")),r()},a=>{console.error(`Unable to get text content for page ${i+1}`,a),this._pageContents[i]="",this._pageDiffs[i]=null,this._hasDiacritics[i]=!1,r()}))}}#a(t){this._scrollMatches&&this._selected.pageIdx===t&&(this._linkService.page=t+1),this._eventBus.dispatch("updatetextlayermatches",{source:this,pageIndex:t})}#u(){this._eventBus.dispatch("updatetextlayermatches",{source:this,pageIndex:-1})}#p(){const t=this.#t.findPrevious,e=this._linkService.page-1,i=this._linkService.pagesCount;if(this._highlightMatches=!0,this._dirtyMatch){this._dirtyMatch=!1,this._selected.pageIdx=this._selected.matchIdx=-1,this._offset.pageIdx=e,this._offset.matchIdx=null,this._offset.wrapped=!1,this._resumePageIdx=null,this._pageMatches.length=0,this._pageMatchesLength.length=0,this.#i=0,this._matchesCountTotal=0,this.#u();for(let r=0;r<i;r++)this._pendingFindMatches.has(r)||(this._pendingFindMatches.add(r),this._extractTextPromises[r].then(()=>{this._pendingFindMatches.delete(r),this.#o(r)}))}if(0===this.#r.length)return void this.#y(Jt.FOUND);if(this._resumePageIdx)return;const s=this._offset;if(this._pagesToSearch=i,null!==s.matchIdx){if(!t&&s.matchIdx+1<this._pageMatches[s.pageIdx].length||t&&s.matchIdx>0)return s.matchIdx=t?s.matchIdx-1:s.matchIdx+1,void this.#m(!0);this.#b(t)}this.#g()}#f(t){const e=this._offset,i=t.length,n=this.#t.findPrevious;return i?(e.matchIdx=n?i-1:0,this.#m(!0),!0):(this.#b(n),!!(e.wrapped&&(e.matchIdx=null,this._pagesToSearch<0))&&(this.#m(!1),!0))}#g(){null!==this._resumePageIdx&&console.error("There can only be one pending page.");let t=null;do{const e=this._offset.pageIdx;if(t=this._pageMatches[e],!t){this._resumePageIdx=e;break}}while(!this.#f(t))}#b(t){const e=this._offset,i=this._linkService.pagesCount;e.pageIdx=t?e.pageIdx-1:e.pageIdx+1,e.matchIdx=null,this._pagesToSearch--,(e.pageIdx>=i||e.pageIdx<0)&&(e.pageIdx=t?i-1:0,e.wrapped=!0)}#m(t=!1){let e=Jt.NOT_FOUND;const i=this._offset.wrapped;if(this._offset.wrapped=!1,t){const n=this._selected.pageIdx;this._selected.pageIdx=this._offset.pageIdx,this._selected.matchIdx=this._offset.matchIdx,e=i?Jt.WRAPPED:Jt.FOUND,-1!==n&&n!==this._selected.pageIdx&&this.#a(n)}this.#y(e,this.#t.findPrevious),-1!==this._selected.pageIdx&&(this._scrollMatches=!0,this.#a(this._selected.pageIdx))}#_(t){const e=this._pdfDocument;this._firstPageCapability.promise.then(()=>{!this._pdfDocument||e&&this._pdfDocument!==e||(this._findTimeout&&(clearTimeout(this._findTimeout),this._findTimeout=null),this._resumePageIdx&&(this._resumePageIdx=null,this._dirtyMatch=!0),this.#y(Jt.FOUND),this._highlightMatches=!1,this.#u())})}#A(){const{pageIdx:t,matchIdx:e}=this._selected;let i=0,n=this._matchesCountTotal;if(-1!==e){for(let s=0;s<t;s++)i+=this._pageMatches[s]?.length||0;i+=e+1}return(i<1||i>n)&&(i=n=0),{current:i,total:n}}#E(){this._eventBus.dispatch("updatefindmatchescount",{source:this,matchesCount:this.#A()})}#y(t,e=!1){!this.#e&&(this.#i!==this._linkService.pagesCount||t===Jt.PENDING)||this._eventBus.dispatch("updatefindcontrolstate",{source:this,state:t,previous:e,entireWord:this.#t?.entireWord??null,matchesCount:this.#A(),rawQuery:this.#t?.query??null})}}const le={NONE:0,SELF:1,BLANK:2,PARENT:3,TOP:4};class fi{externalLinkEnabled=!0;constructor({eventBus:t,externalLinkTarget:e=null,externalLinkRel:i=null,ignoreDestinationZoom:n=!1}={}){this.eventBus=t,this.externalLinkTarget=e,this.externalLinkRel=i,this._ignoreDestinationZoom=n,this.baseUrl=null,this.pdfDocument=null,this.pdfViewer=null,this.pdfHistory=null}setDocument(t,e=null){this.baseUrl=e,this.pdfDocument=t}setViewer(t){this.pdfViewer=t}setHistory(t){this.pdfHistory=t}get pagesCount(){return this.pdfDocument?this.pdfDocument.numPages:0}get page(){return this.pdfDocument?this.pdfViewer.currentPageNumber:1}set page(t){this.pdfDocument&&(this.pdfViewer.currentPageNumber=t)}get rotation(){return this.pdfDocument?this.pdfViewer.pagesRotation:0}set rotation(t){this.pdfDocument&&(this.pdfViewer.pagesRotation=t)}get isInPresentationMode(){return!!this.pdfDocument&&this.pdfViewer.isInPresentationMode}goToDestination(t){var e=this;return(0,x.A)(function*(){if(!e.pdfDocument)return;let i,n,s;if("string"==typeof t?(i=t,n=yield e.pdfDocument.getDestination(t)):(i=null,n=yield t),!Array.isArray(n))return void console.error(`goToDestination: "${n}" is not a valid destination array, for dest="${t}".`);const[r]=n;if(r&&"object"==typeof r){if(s=e.pdfDocument.cachedPageNumber(r),!s)try{s=(yield e.pdfDocument.getPageIndex(r))+1}catch{return void console.error(`goToDestination: "${r}" is not a valid page reference, for dest="${t}".`)}}else Number.isInteger(r)&&(s=r+1);!s||s<1||s>e.pagesCount?console.error(`goToDestination: "${s}" is not a valid page number, for dest="${t}".`):(e.pdfHistory&&(e.pdfHistory.pushCurrentPosition(),e.pdfHistory.push({namedDest:i,explicitDest:n,pageNumber:s})),e.pdfViewer.scrollPageIntoView({pageNumber:s,destArray:n,ignoreDestinationZoom:e._ignoreDestinationZoom}))})()}goToPage(t){if(!this.pdfDocument)return;const e="string"==typeof t&&this.pdfViewer.pageLabelToPageNumber(t)||0|t;Number.isInteger(e)&&e>0&&e<=this.pagesCount?(this.pdfHistory&&(this.pdfHistory.pushCurrentPosition(),this.pdfHistory.pushPage(e)),this.pdfViewer.scrollPageIntoView({pageNumber:e})):console.error(`PDFLinkService.goToPage: "${t}" is not a valid page.`)}addLinkAttributes(t,e,i=!1){if(!e||"string"!=typeof e)throw new Error('A valid "url" parameter must provided.');const n=i?le.BLANK:this.externalLinkTarget,s=this.externalLinkRel;this.externalLinkEnabled?t.href=t.title=e:(t.href="",t.title=`Disabled: ${e}`,t.onclick=()=>!1);let r="";switch(n){case le.NONE:break;case le.SELF:r="_self";break;case le.BLANK:r="_blank";break;case le.PARENT:r="_parent";break;case le.TOP:r="_top"}t.target=r,t.rel="string"==typeof s?s:"noopener noreferrer nofollow"}getDestinationHash(t){if("string"==typeof t){if(t.length>0)return this.getAnchorUrl("#"+escape(t))}else if(Array.isArray(t)){const e=JSON.stringify(t);if(e.length>0)return this.getAnchorUrl("#"+escape(e))}return this.getAnchorUrl("")}getAnchorUrl(t){return this.baseUrl?this.baseUrl+t:t}setHash(t){if(!this.pdfDocument)return;let e,i;if(t.includes("=")){const n=hi(t);if(n.has("search")){const s=n.get("search").replaceAll('"',""),r="true"===n.get("phrase");this.eventBus.dispatch("findfromurlhash",{source:this,query:r?s:s.match(/\S+/g)})}if(n.has("page")&&(e=0|n.get("page")||1),n.has("zoom")){const s=n.get("zoom").split(","),r=s[0],a=parseFloat(r);r.includes("Fit")?"Fit"===r||"FitB"===r?i=[null,{name:r}]:"FitH"===r||"FitBH"===r||"FitV"===r||"FitBV"===r?i=[null,{name:r},s.length>1?0|s[1]:null]:"FitR"===r?5!==s.length?console.error('PDFLinkService.setHash: Not enough parameters for "FitR".'):i=[null,{name:r},0|s[1],0|s[2],0|s[3],0|s[4]]:console.error(`PDFLinkService.setHash: "${r}" is not a valid zoom value.`):i=[null,{name:"XYZ"},s.length>1?0|s[1]:null,s.length>2?0|s[2]:null,a?a/100:r]}return i?this.pdfViewer.scrollPageIntoView({pageNumber:e||this.page,destArray:i,allowNegativeOffset:!0}):e&&(this.page=e),n.has("pagemode")&&this.eventBus.dispatch("pagemode",{source:this,mode:n.get("pagemode")}),void(n.has("nameddest")&&this.goToDestination(n.get("nameddest")))}i=unescape(t);try{i=JSON.parse(i),Array.isArray(i)||(i=i.toString())}catch{}"string"==typeof i||fi.#t(i)?this.goToDestination(i):console.error(`PDFLinkService.setHash: "${unescape(t)}" is not a valid destination.`)}executeNamedAction(t){if(this.pdfDocument){switch(t){case"GoBack":this.pdfHistory?.back();break;case"GoForward":this.pdfHistory?.forward();break;case"NextPage":this.pdfViewer.nextPage();break;case"PrevPage":this.pdfViewer.previousPage();break;case"LastPage":this.page=this.pagesCount;break;case"FirstPage":this.page=1}this.eventBus.dispatch("namedaction",{source:this,action:t})}}executeSetOCGState(t){var e=this;return(0,x.A)(function*(){if(!e.pdfDocument)return;const i=e.pdfDocument,n=yield e.pdfViewer.optionalContentConfigPromise;i===e.pdfDocument&&(n.setOCGState(t),e.pdfViewer.optionalContentConfigPromise=Promise.resolve(n))})()}static#t(t){if(!Array.isArray(t)||t.length<2)return!1;const[e,i,...n]=t;if(("object"!=typeof e||!Number.isInteger(e?.num)||!Number.isInteger(e?.gen))&&!Number.isInteger(e)||"object"!=typeof i||"string"!=typeof i?.name)return!1;const s=n.length;let r=!0;switch(i.name){case"XYZ":if(s<2||s>3)return!1;break;case"Fit":case"FitB":return 0===s;case"FitH":case"FitBH":case"FitV":case"FitBV":if(s>1)return!1;break;case"FitR":if(4!==s)return!1;r=!1;break;default:return!1}for(const a of n)if(!("number"==typeof a||r&&null===a))return!1;return!0}}class ln extends fi{setDocument(t,e=null){}}const{AbortException:Eh,AnnotationEditorLayer:xh,AnnotationEditorType:St,AnnotationEditorUIManager:Ch,AnnotationLayer:Sh,AnnotationMode:Gt,createValidAbsoluteUrl:Ph,DrawLayer:Th,fetchData:$s,getPdfFilenameFromUrl:Mh,isPdfFile:Lh,normalizeUnicode:Rh,OutputScale:Ih,PermissionFlag:pi,PixelsPerInch:$t,RenderingCancelledException:hn,setLayerDimensions:kh,shadow:gi,TextLayer:Dh,version:Xs,XfaLayer:cn}=globalThis.pdfjsLib;class Ys{#t=null;#e=null;constructor({pdfPage:t,linkService:e,downloadManager:i,annotationStorage:n=null,imageResourcesPath:s="",renderForms:r=!0,enableScripting:a=!1,hasJSActionsPromise:l=null,fieldObjectsPromise:h=null,annotationCanvasMap:c=null,accessibilityManager:d=null,annotationEditorUIManager:u=null,onAppend:f=null}){this.pdfPage=t,this.linkService=e,this.downloadManager=i,this.imageResourcesPath=s,this.renderForms=r,this.annotationStorage=n,this.enableScripting=a,this._hasJSActionsPromise=l||Promise.resolve(!1),this._fieldObjectsPromise=h||Promise.resolve(null),this._annotationCanvasMap=c,this._accessibilityManager=d,this._annotationEditorUIManager=u,this.#t=f,this.annotationLayer=null,this.div=null,this._cancelled=!1,this._eventBus=e.eventBus}render(t,e){var i=this;return(0,x.A)(function*(n,s,r="display"){if(i.div){if(i._cancelled||!i.annotationLayer)return;return void i.annotationLayer.update({viewport:n.clone({dontFlip:!0})})}const[a,l,h]=yield Promise.all([i.pdfPage.getAnnotations({intent:r}),i._hasJSActionsPromise,i._fieldObjectsPromise]);if(i._cancelled)return;const c=i.div=document.createElement("div");c.className="annotationLayer",i.#t?.(c),0!==a.length?(i.annotationLayer=new Sh({div:c,accessibilityManager:i._accessibilityManager,annotationCanvasMap:i._annotationCanvasMap,annotationEditorUIManager:i._annotationEditorUIManager,page:i.pdfPage,viewport:n.clone({dontFlip:!0}),structTreeLayer:s?.structTreeLayer||null}),yield i.annotationLayer.render({annotations:a,imageResourcesPath:i.imageResourcesPath,renderForms:i.renderForms,linkService:i.linkService,downloadManager:i.downloadManager,annotationStorage:i.annotationStorage,enableScripting:i.enableScripting,hasJSActions:l,fieldObjects:h}),i.linkService.isInPresentationMode&&i.#i(3),i.#e||(i.#e=new AbortController,i._eventBus?._on("presentationmodechanged",d=>{i.#i(d.state)},{signal:i.#e.signal}))):i.hide()}).apply(this,arguments)}cancel(){this._cancelled=!0,this.#e?.abort(),this.#e=null}hide(){this.div&&(this.div.hidden=!0)}hasEditableAnnotations(){return!!this.annotationLayer?.hasEditableAnnotations()}#i(t){if(!this.div)return;let e=!1;switch(t){case 3:e=!0;break;case 1:break;default:return}for(const i of this.div.childNodes)i.hasAttribute("data-internal-link")||(i.inert=e)}}function Ks(o,t){const e=document.createElement("a");if(!e.click)throw new Error('DownloadManager: "a.click()" is not supported.');e.href=o,e.target="_parent","download"in e&&(e.download=t),(document.body||document.documentElement).append(e),e.click(),e.remove()}class Oh{#t=new WeakMap;downloadData(t,e,i){Ks(URL.createObjectURL(new Blob([t],{type:i})),e)}openOrDownloadData(t,e,i=null){const s=Lh(e)?"application/pdf":"";return this.downloadData(t,e,s),!1}download(t,e,i){let n;if(t)n=URL.createObjectURL(new Blob([t],{type:"application/pdf"}));else{if(!Ph(e,"http://example.com"))return void console.error(`download - not a valid URL: ${e}`);n=e+"#pdfjs.action=download"}Ks(n,i)}}function dn(){return(dn=(0,x.A)(function*({target:o,name:t,delay:e=0}){if("object"!=typeof o||!t||"string"!=typeof t||!(Number.isInteger(e)&&e>=0))throw new Error("waitOnEventOrTimeout - invalid parameters.");const{promise:i,resolve:n}=Promise.withResolvers(),s=new AbortController;function r(h){s.abort(),clearTimeout(l),n(h)}o[o instanceof un?"_on":"addEventListener"](t,r.bind(null,"event"),{signal:s.signal});const l=setTimeout(r.bind(null,"timeout"),e);return i})).apply(this,arguments)}class un{#t=Object.create(null);on(t,e,i=null){this._on(t,e,{external:!0,once:i?.once,signal:i?.signal})}off(t,e,i=null){this._off(t,e)}dispatch(t,e){const i=this.#t[t];if(!i||0===i.length)return;let n;for(const{listener:s,external:r,once:a}of i.slice(0))a&&this._off(t,s),r?(n||=[]).push(s):s(e);if(n){for(const s of n)s(e);n=null}}_on(t,e,i=null){let n=null;if(i?.signal instanceof AbortSignal){const{signal:r}=i;if(r.aborted)return void console.error("Cannot use an `aborted` signal.");const a=()=>this._off(t,e);n=()=>r.removeEventListener("abort",a),r.addEventListener("abort",a)}(this.#t[t]||=[]).push({listener:e,external:!0===i?.external,once:!0===i?.once,rmAbort:n})}_off(t,e,i=null){const n=this.#t[t];if(n)for(let s=0,r=n.length;s<r;s++){const a=n[s];if(a.listener===e)return a.rmAbort?.(),void n.splice(s,1)}}}class mi{constructor(t){this.value=t}valueOf(){return this.value}}class rt extends mi{constructor(t="???"){super(t)}toString(t){return`{${this.value}}`}}class Xt extends mi{constructor(t,e={}){super(t),this.opts=e}toString(t){try{return t.memoizeIntlObject(Intl.NumberFormat,this.opts).format(this.value)}catch(e){return t.reportError(e),this.value.toString(10)}}}class Be extends mi{constructor(t,e={}){super(t),this.opts=e}toString(t){try{return t.memoizeIntlObject(Intl.DateTimeFormat,this.opts).format(this.value)}catch(e){return t.reportError(e),new Date(this.value).toISOString()}}}function Vh(o,t,e){return e===t||e instanceof Xt&&t instanceof Xt&&e.value===t.value||t instanceof Xt&&"string"==typeof e&&e===o.memoizeIntlObject(Intl.PluralRules,t.opts).select(t.value)}function Zs(o,t,e){return t[e]?_e(o,t[e].value):(o.reportError(new RangeError("No default")),new rt)}function fn(o,t){const e=[],i=Object.create(null);for(const n of t)"narg"===n.type?i[n.name]=Ve(o,n.value):e.push(Ve(o,n));return{positional:e,named:i}}function Ve(o,t){switch(t.type){case"str":return t.value;case"num":return new Xt(t.value,{minimumFractionDigits:t.precision});case"var":return function jh(o,{name:t}){let e;if(o.params){if(!Object.prototype.hasOwnProperty.call(o.params,t))return new rt(`$${t}`);e=o.params[t]}else{if(!o.args||!Object.prototype.hasOwnProperty.call(o.args,t))return o.reportError(new ReferenceError(`Unknown variable: $${t}`)),new rt(`$${t}`);e=o.args[t]}if(e instanceof mi)return e;switch(typeof e){case"string":return e;case"number":return new Xt(e);case"object":if(e instanceof Date)return new Be(e.getTime());default:return o.reportError(new TypeError(`Variable type not supported: $${t}, ${typeof e}`)),new rt(`$${t}`)}}(o,t);case"mesg":return function Hh(o,{name:t,attr:e}){const i=o.bundle._messages.get(t);if(!i)return o.reportError(new ReferenceError(`Unknown message: ${t}`)),new rt(t);if(e){const n=i.attributes[e];return n?_e(o,n):(o.reportError(new ReferenceError(`Unknown attribute: ${e}`)),new rt(`${t}.${e}`))}return i.value?_e(o,i.value):(o.reportError(new ReferenceError(`No value: ${t}`)),new rt(t))}(o,t);case"term":return function zh(o,{name:t,attr:e,args:i}){const n=`-${t}`,s=o.bundle._terms.get(n);if(!s)return o.reportError(new ReferenceError(`Unknown term: ${n}`)),new rt(n);if(e){const a=s.attributes[e];if(a){o.params=fn(o,i).named;const l=_e(o,a);return o.params=null,l}return o.reportError(new ReferenceError(`Unknown attribute: ${e}`)),new rt(`${n}.${e}`)}o.params=fn(o,i).named;const r=_e(o,s.value);return o.params=null,r}(o,t);case"func":return function Wh(o,{name:t,args:e}){let i=o.bundle._functions[t];if(!i)return o.reportError(new ReferenceError(`Unknown function: ${t}()`)),new rt(`${t}()`);if("function"!=typeof i)return o.reportError(new TypeError(`Function ${t}() is not callable`)),new rt(`${t}()`);try{let n=fn(o,e);return i(n.positional,n.named)}catch(n){return o.reportError(n),new rt(`${t}()`)}}(o,t);case"select":return function Uh(o,{selector:t,variants:e,star:i}){let n=Ve(o,t);if(n instanceof rt)return Zs(o,e,i);for(const s of e)if(Vh(o,n,Ve(o,s.key)))return _e(o,s.value);return Zs(o,e,i)}(o,t);default:return new rt}}function Js(o,t){if(o.dirty.has(t))return o.reportError(new RangeError("Cyclic reference")),new rt;o.dirty.add(t);const e=[],i=o.bundle._useIsolating&&t.length>1;for(const n of t)if("string"!=typeof n){if(o.placeables++,o.placeables>100)throw o.dirty.delete(t),new RangeError(`Too many placeables expanded: ${o.placeables}, max allowed is 100`);i&&e.push("\u2068"),e.push(Ve(o,n).toString(o)),i&&e.push("\u2069")}else e.push(o.bundle._transform(n));return o.dirty.delete(t),e.join("")}function _e(o,t){return"string"==typeof t?o.bundle._transform(t):Js(o,t)}class Gh{constructor(t,e,i){this.dirty=new WeakSet,this.params=null,this.placeables=0,this.bundle=t,this.errors=e,this.args=i}reportError(t){if(!(this.errors&&t instanceof Error))throw t;this.errors.push(t)}memoizeIntlObject(t,e){let i=this.bundle._intls.get(t);i||(i={},this.bundle._intls.set(t,i));let n=JSON.stringify(e);return i[n]||(i[n]=new t(this.bundle.locales,e)),i[n]}}function bi(o,t){const e=Object.create(null);for(const[i,n]of Object.entries(o))t.includes(i)&&(e[i]=n.valueOf());return e}const tr=["unitDisplay","currencyDisplay","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits"];function $h(o,t){let e=o[0];if(e instanceof rt)return new rt(`NUMBER(${e.valueOf()})`);if(e instanceof Xt)return new Xt(e.valueOf(),{...e.opts,...bi(t,tr)});if(e instanceof Be)return new Xt(e.valueOf(),{...bi(t,tr)});throw new TypeError("Invalid argument to NUMBER")}const er=["dateStyle","timeStyle","fractionalSecondDigits","dayPeriod","hour12","weekday","era","year","month","day","hour","minute","second","timeZoneName"];function Xh(o,t){let e=o[0];if(e instanceof rt)return new rt(`DATETIME(${e.valueOf()})`);if(e instanceof Be)return new Be(e.valueOf(),{...e.opts,...bi(t,er)});if(e instanceof Xt)return new Be(e.valueOf(),{...bi(t,er)});throw new TypeError("Invalid argument to DATETIME")}const ir=new Map;class Kh{constructor(t,{functions:e,useIsolating:i=!0,transform:n=s=>s}={}){this._terms=new Map,this._messages=new Map,this.locales=Array.isArray(t)?t:[t],this._functions={NUMBER:$h,DATETIME:Xh,...e},this._useIsolating=i,this._transform=n,this._intls=function Yh(o){const t=Array.isArray(o)?o.join(" "):o;let e=ir.get(t);return void 0===e&&(e=new Map,ir.set(t,e)),e}(t)}hasMessage(t){return this._messages.has(t)}getMessage(t){return this._messages.get(t)}addResource(t,{allowOverrides:e=!1}={}){const i=[];for(let n=0;n<t.body.length;n++){let s=t.body[n];if(s.id.startsWith("-")){if(!1===e&&this._terms.has(s.id)){i.push(new Error(`Attempt to override an existing term: "${s.id}"`));continue}this._terms.set(s.id,s)}else{if(!1===e&&this._messages.has(s.id)){i.push(new Error(`Attempt to override an existing message: "${s.id}"`));continue}this._messages.set(s.id,s)}}return i}formatPattern(t,e=null,i=null){if("string"==typeof t)return this._transform(t);let n=new Gh(this,i,e);try{return Js(n,t).toString(n)}catch(s){if(n.errors&&s instanceof Error)return n.errors.push(s),(new rt).toString(n);throw s}}}const pn=/^(-?[a-zA-Z][\w-]*) *= */gm,nr=/\.([a-zA-Z][\w-]*) *= */y,qh=/\*?\[/y,gn=/(-?[0-9]+(?:\.([0-9]+))?)/y,Qh=/([a-zA-Z][\w-]*)/y,sr=/([$-])?([a-zA-Z][\w-]*)(?:\.([a-zA-Z][\w-]*))?/y,Zh=/^[A-Z][A-Z0-9_-]*$/,_i=/([^{}\n\r]+)/y,Jh=/([^\\"\n\r]*)/y,rr=/\\([\\"])/y,ar=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{6})/y,tc=/^\n+/,or=/ +$/,ec=/ *\r?\n/g,ic=/( *)$/,nc=/{\s*/y,lr=/\s*}/y,sc=/\[\s*/y,rc=/\s*] */y,ac=/\s*\(\s*/y,oc=/\s*->\s*/y,lc=/\s*:\s*/y,hc=/\s*,?\s*/y,cc=/\s+/y;class dc{constructor(t){this.body=[],pn.lastIndex=0;let e=0;for(;;){let y=pn.exec(t);if(null===y)break;e=pn.lastIndex;try{this.body.push(l(y[1]))}catch(S){if(S instanceof SyntaxError)continue;throw S}}function i(y){return y.lastIndex=e,y.test(t)}function n(y,S){if(t[e]===y)return e++,!0;if(S)throw new S(`Expected ${y}`);return!1}function s(y,S){if(i(y))return e=y.lastIndex,!0;if(S)throw new S(`Expected ${y.toString()}`);return!1}function r(y){y.lastIndex=e;let S=y.exec(t);if(null===S)throw new SyntaxError(`Expected ${y.toString()}`);return e=y.lastIndex,S}function a(y){return r(y)[1]}function l(y){let S=c(),L=function h(){let y=Object.create(null);for(;i(nr);){let S=a(nr),L=c();if(null===L)throw new SyntaxError("Expected attribute value");y[S]=L}return y}();if(null===S&&0===Object.keys(L).length)throw new SyntaxError("Expected message value or attributes");return{id:y,value:S,attributes:L}}function c(){let y;if(i(_i)&&(y=a(_i)),"{"===t[e]||"}"===t[e])return d(y?[y]:[],1/0);let S=C();return S?y?d([y,S],S.length):(S.value=M(S.value,tc),d([S],S.length)):y?M(y,or):null}function d(y=[],S){for(;;){if(i(_i)){y.push(a(_i));continue}if("{"===t[e]){y.push(u());continue}if("}"===t[e])throw new SyntaxError("Unbalanced closing brace");let W=C();if(!W)break;y.push(W),S=Math.min(S,W.length)}let L=y.length-1,z=y[L];"string"==typeof z&&(y[L]=M(z,or));let H=[];for(let W of y)W instanceof hr&&(W=W.value.slice(0,W.value.length-S)),W&&H.push(W);return H}function u(){s(nc,SyntaxError);let y=f();if(s(lr))return y;if(s(oc)){let S=function b(){let L,y=[],S=0;for(;i(qh);){n("*")&&(L=S);let z=m(),H=c();if(null===H)throw new SyntaxError("Expected variant value");y[S++]={key:z,value:H}}if(0===S)return null;if(void 0===L)throw new SyntaxError("Expected default variant");return{variants:y,star:L}}();return s(lr,SyntaxError),{type:"select",selector:y,...S}}throw new SyntaxError("Unclosed placeable")}function f(){if("{"===t[e])return u();if(i(sr)){let[,y,S,L=null]=r(sr);if("$"===y)return{type:"var",name:S};if(s(ac)){let z=function p(){let y=[];for(;;){switch(t[e]){case")":return e++,y;case void 0:throw new SyntaxError("Unclosed argument list")}y.push(g()),s(hc)}}();if("-"===y)return{type:"term",name:S,attr:L,args:z};if(Zh.test(S))return{type:"func",name:S,args:z};throw new SyntaxError("Function names must be all upper-case")}return"-"===y?{type:"term",name:S,attr:L,args:[]}:{type:"mesg",name:S,attr:L}}return v()}function g(){let y=f();return"mesg"!==y.type?y:s(lc)?{type:"narg",name:y.name,value:v()}:y}function m(){let y;return s(sc,SyntaxError),y=i(gn)?A():{type:"str",value:a(Qh)},s(rc,SyntaxError),y}function v(){if(i(gn))return A();if('"'===t[e])return function w(){n('"',SyntaxError);let y="";for(;;){if(y+=a(Jh),"\\"!==t[e]){if(n('"'))return{type:"str",value:y};throw new SyntaxError("Unclosed string literal")}y+=E()}}();throw new SyntaxError("Invalid expression")}function A(){let[,y,S=""]=r(gn),L=S.length;return{type:"num",value:parseFloat(y),precision:L}}function E(){if(i(rr))return a(rr);if(i(ar)){let[,y,S]=r(ar),L=parseInt(y||S,16);return L<=55295||57344<=L?String.fromCodePoint(L):"\ufffd"}throw new SyntaxError("Unknown escape sequence")}function C(){let y=e;switch(s(cc),t[e]){case".":case"[":case"*":case"}":case void 0:return!1;case"{":return T(t.slice(y,e))}return" "===t[e-1]&&T(t.slice(y,e))}function M(y,S){return y.replace(S,"")}function T(y){let S=y.replace(ec,"\n"),L=ic.exec(y)[1].length;return new hr(S,L)}}}class hr{constructor(t,e){this.value=t,this.length=e}}const uc=/<|&#?\w+;/,fc={"http://www.w3.org/1999/xhtml":["em","strong","small","s","cite","q","dfn","abbr","data","time","code","var","samp","kbd","sub","sup","i","b","u","mark","bdi","bdo","span","br","wbr"]},pc={"http://www.w3.org/1999/xhtml":{global:["title","aria-label","aria-valuetext"],a:["download"],area:["download","alt"],input:["alt","placeholder"],menuitem:["label"],menu:["label"],optgroup:["label"],option:["label"],track:["label"],img:["alt"],textarea:["placeholder"],th:["abbr"]},"http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul":{global:["accesskey","aria-label","aria-valuetext","label","title","tooltiptext"],description:["value"],key:["key","keycode"],label:["value"],textbox:["placeholder","value"]}};function gc(o,t){const{value:e}=t;if("string"==typeof e)if("title"===o.localName&&"http://www.w3.org/1999/xhtml"===o.namespaceURI)o.textContent=e;else if(uc.test(e)){const i=o.ownerDocument.createElementNS("http://www.w3.org/1999/xhtml","template");i.innerHTML=e,function mc(o,t){for(const e of o.childNodes)if(e.nodeType!==e.TEXT_NODE){if(e.hasAttribute("data-l10n-name")){const i=_c(t,e);o.replaceChild(i,e);continue}if(Ac(e)){const i=vc(e);o.replaceChild(i,e);continue}console.warn(`An element of forbidden type "${e.localName}" was found in the translation. Only safe text-level elements and elements with data-l10n-name are allowed.`),o.replaceChild(mn(e),e)}t.textContent="",t.appendChild(o)}(i.content,o)}else o.textContent=e;cr(t,o)}function bc(o,t){if(!o)return!1;for(let e of o)if(e.name===t)return!0;return!1}function cr(o,t){const e=t.hasAttribute("data-l10n-attrs")?t.getAttribute("data-l10n-attrs").split(",").map(i=>i.trim()):null;for(const i of Array.from(t.attributes))dr(i.name,t,e)&&!bc(o.attributes,i.name)&&t.removeAttribute(i.name);if(o.attributes)for(const i of Array.from(o.attributes))dr(i.name,t,e)&&t.getAttribute(i.name)!==i.value&&t.setAttribute(i.name,i.value)}function _c(o,t){const e=t.getAttribute("data-l10n-name"),i=o.querySelector(`[data-l10n-name="${e}"]`);return i?i.localName!==t.localName?(console.warn(`An element named "${e}" was found in the translation but its type ${t.localName} didn't match the element found in the source (${i.localName}).`),mn(t)):(o.removeChild(i),ur(t,i.cloneNode(!1))):(console.warn(`An element named "${e}" wasn't found in the source.`),mn(t))}function vc(o){const t=o.ownerDocument.createElement(o.localName);return ur(o,t)}function mn(o){return o.ownerDocument.createTextNode(o.textContent)}function Ac(o){const t=fc[o.namespaceURI];return t&&t.includes(o.localName)}function dr(o,t,e=null){if(e&&e.includes(o))return!0;const i=pc[t.namespaceURI];if(!i)return!1;const n=o.toLowerCase(),s=t.localName;if(i.global.includes(n))return!0;if(!i[s])return!1;if(i[s].includes(n))return!0;if("http://www.w3.org/1999/xhtml"===t.namespaceURI&&"input"===s&&"value"===n){const r=t.type.toLowerCase();if("submit"===r||"button"===r||"reset"===r)return!0}return!1}function ur(o,t){return t.textContent=o.textContent,cr(o,t),t}class fr extends Array{static from(t){return t instanceof this?t:new this(t)}}Symbol;class yc extends fr{constructor(t){if(super(),Symbol.asyncIterator in Object(t))this.iterator=t[Symbol.asyncIterator]();else{if(!(Symbol.iterator in Object(t)))throw new TypeError("Argument must implement the iteration protocol.");this.iterator=t[Symbol.iterator]()}}[Symbol.asyncIterator](){const t=this;let e=0;return{next:()=>(0,x.A)(function*(){return t.length<=e&&t.push(t.iterator.next()),t[e++]})()}}touchNext(){var t=this;return(0,x.A)(function*(e=1){let i=0;for(;i++<e;){const n=t[t.length-1];if(n&&(yield n).done)break;t.push(t.iterator.next())}return t[t.length-1]}).apply(this,arguments)}}class wc{constructor(t=[],e){this.resourceIds=t,this.generateBundles=e,this.onChange(!0)}addResourceIds(t,e=!1){return this.resourceIds.push(...t),this.onChange(e),this.resourceIds.length}removeResourceIds(t){return this.resourceIds=this.resourceIds.filter(e=>!t.includes(e)),this.onChange(),this.resourceIds.length}formatWithFallback(t,e){var i=this;return(0,x.A)(function*(){const n=[];let s=!1;var l,r=!1,a=!1;try{for(var c,h=function Vl(o){var t,e,i,n=2;for(typeof Symbol<"u"&&(e=Symbol.asyncIterator,i=Symbol.iterator);n--;){if(e&&null!=(t=o[e]))return t.call(o);if(i&&null!=(t=o[i]))return new li(t.call(o));e="@@asyncIterator",i="@@iterator"}throw new TypeError("Object is not async iterable")}(i.bundles);r=!(c=yield h.next()).done;r=!1){const d=c.value;{s=!0;const u=Cc(e,d,t,n);if(0===u.size)break;if(typeof console<"u"){const f=d.locales[0],p=Array.from(u).join(", ");console.warn(`[fluent] Missing translations in ${f}: ${p}`)}}}}catch(d){a=!0,l=d}finally{try{r&&null!=h.return&&(yield h.return())}finally{if(a)throw l}}return!s&&typeof console<"u"&&console.warn(`[fluent] Request for keys failed because no resource bundles got generated.\n keys: ${JSON.stringify(t)}.\n resourceIds: ${JSON.stringify(i.resourceIds)}.`),n})()}formatMessages(t){return this.formatWithFallback(t,xc)}formatValues(t){return this.formatWithFallback(t,Ec)}formatValue(t,e){var i=this;return(0,x.A)(function*(){const[n]=yield i.formatValues([{id:t,args:e}]);return n})()}handleEvent(){this.onChange()}onChange(t=!1){this.bundles=yc.from(this.generateBundles(this.resourceIds)),t&&this.bundles.touchNext(2)}}function Ec(o,t,e,i){return e.value?o.formatPattern(e.value,i,t):null}function xc(o,t,e,i){const n={value:null,attributes:null};e.value&&(n.value=o.formatPattern(e.value,i,t));let s=Object.keys(e.attributes);if(s.length>0){n.attributes=new Array(s.length);for(let[r,a]of s.entries()){let l=o.formatPattern(e.attributes[a],i,t);n.attributes[r]={name:a,value:l}}}return n}function Cc(o,t,e,i){const n=[],s=new Set;return e.forEach(({id:r,args:a},l)=>{if(void 0!==i[l])return;let h=t.getMessage(r);if(h){if(n.length=0,i[l]=o(t,n,h,a),n.length>0&&typeof console<"u"){const c=t.locales[0],d=n.join(", ");console.warn(`[fluent][resolver] errors in ${c}/${r}: ${d}.`)}}else s.add(r)}),s}const he="data-l10n-id",je="data-l10n-args",Sc=`[${he}]`;class Pc extends wc{constructor(t,e){super(t,e),this.roots=new Set,this.pendingrAF=null,this.pendingElements=new Set,this.windowElement=null,this.mutationObserver=null,this.observerConfig={attributes:!0,characterData:!1,childList:!0,subtree:!0,attributeFilter:[he,je]}}onChange(t=!1){super.onChange(t),this.roots&&this.translateRoots()}setAttributes(t,e,i){return t.setAttribute(he,e),i?t.setAttribute(je,JSON.stringify(i)):t.removeAttribute(je),t}getAttributes(t){return{id:t.getAttribute(he),args:JSON.parse(t.getAttribute(je)||null)}}connectRoot(t){for(const e of this.roots)if(e===t||e.contains(t)||t.contains(e))throw new Error("Cannot add a root that overlaps with existing root.");if(this.windowElement){if(this.windowElement!==t.ownerDocument.defaultView)throw new Error("Cannot connect a root:\n DOMLocalization already has a root from a different window.")}else this.windowElement=t.ownerDocument.defaultView,this.mutationObserver=new this.windowElement.MutationObserver(e=>this.translateMutations(e));this.roots.add(t),this.mutationObserver.observe(t,this.observerConfig)}disconnectRoot(t){return this.roots.delete(t),this.pauseObserving(),0===this.roots.size?(this.mutationObserver=null,this.windowElement&&this.pendingrAF&&this.windowElement.cancelAnimationFrame(this.pendingrAF),this.windowElement=null,this.pendingrAF=null,this.pendingElements.clear(),!0):(this.resumeObserving(),!1)}translateRoots(){const t=Array.from(this.roots);return Promise.all(t.map(e=>this.translateFragment(e)))}pauseObserving(){this.mutationObserver&&(this.translateMutations(this.mutationObserver.takeRecords()),this.mutationObserver.disconnect())}resumeObserving(){if(this.mutationObserver)for(const t of this.roots)this.mutationObserver.observe(t,this.observerConfig)}translateMutations(t){for(const e of t)switch(e.type){case"attributes":e.target.hasAttribute("data-l10n-id")&&this.pendingElements.add(e.target);break;case"childList":for(const i of e.addedNodes)if(i.nodeType===i.ELEMENT_NODE)if(i.childElementCount)for(const n of this.getTranslatables(i))this.pendingElements.add(n);else i.hasAttribute(he)&&this.pendingElements.add(i)}this.pendingElements.size>0&&null===this.pendingrAF&&(this.pendingrAF=this.windowElement.requestAnimationFrame(()=>{this.translateElements(Array.from(this.pendingElements)),this.pendingElements.clear(),this.pendingrAF=null}))}translateFragment(t){return this.translateElements(this.getTranslatables(t))}translateElements(t){var e=this;return(0,x.A)(function*(){if(!t.length)return;const i=t.map(e.getKeysForElement),n=yield e.formatMessages(i);return e.applyTranslations(t,n)})()}applyTranslations(t,e){this.pauseObserving();for(let i=0;i<t.length;i++)void 0!==e[i]&&gc(t[i],e[i]);this.resumeObserving()}getTranslatables(t){const e=Array.from(t.querySelectorAll(Sc));return"function"==typeof t.hasAttribute&&t.hasAttribute(he)&&e.push(t),e}getKeysForElement(t){return{id:t.getAttribute(he),args:JSON.parse(t.getAttribute(je)||null)}}}class vi{#t;#e;#i;#n;constructor({lang:t,isRTL:e},i=null){this.#i=vi.#s(t),this.#n=i,this.#t=e??vi.#r(this.#i)?"rtl":"ltr"}_setL10n(t){this.#n=t}getLanguage(){return this.#i}getDirection(){return this.#t}get(t){var e=this;return(0,x.A)(function*(i,n=null,s){return Array.isArray(i)?(i=i.map(l=>({id:l})),(yield e.#n.formatMessages(i)).map(l=>l.value)):(yield e.#n.formatMessages([{id:i,args:n}]))[0]?.value||s}).apply(this,arguments)}translate(t){var e=this;return(0,x.A)(function*(){(e.#e||=new Set).add(t);try{e.#n.connectRoot(t),yield e.#n.translateRoots()}catch{}})()}translateOnce(t){var e=this;return(0,x.A)(function*(){try{yield e.#n.translateElements([t])}catch(i){console.error(`translateOnce: "${i}".`)}})()}destroy(){var t=this;return(0,x.A)(function*(){if(t.#e){for(const e of t.#e)t.#n.disconnectRoot(e);t.#e.clear(),t.#e=null}t.#n.pauseObserving()})()}pause(){this.#n.pauseObserving()}resume(){this.#n.resumeObserving()}static#s(t){return{en:"en-us",es:"es-es",fy:"fy-nl",ga:"ga-ie",gu:"gu-in",hi:"hi-in",hy:"hy-am",nb:"nb-no",ne:"ne-np",nn:"nn-no",pa:"pa-in",pt:"pt-pt",sv:"sv-se",zh:"zh-cn"}[t=t?.toLowerCase()||"en-us"]||t}static#r(t){const e=t.split("-",1)[0];return["ar","he","fa","ps","ur"].includes(e)}}function pr(o,t){const e=new dc(t),i=new Kh(o),n=i.addResource(e);return n.length&&console.error("L10n errors",n),i}class Yt extends vi{constructor(t){super({lang:t});const e=t?Yt.#t.bind(Yt,"en-us",this.getLanguage()):Yt.#n.bind(Yt,this.getLanguage());this._setL10n(new Pc([],e))}static#t(t,e){var i=this;return(0,Ls.A)(function*(){const{baseURL:n,paths:s}=yield Ms(i.#i()),r=[e];if(t!==e){const a=e.split("-",1)[0];a!==e&&r.push(a),r.push(t)}for(const a of r){const l=yield Ms(i.#e(a,n,s));l?yield l:"en-us"===a&&(yield i.#s(a))}})()}static#e(t,e,i){return(0,x.A)(function*(){const n=i[t];if(!n)return null;const s=new URL(n,e),r=yield $s(s,"text");return pr(t,r)})()}static#i(){return(0,x.A)(function*(){try{const{href:t}=document.querySelector('link[type="application/l10n"]'),e=yield $s(t,"json");return{baseURL:t.replace(/[^/]*$/,"")||"./",paths:e}}catch{}return{baseURL:"./",paths:Object.create(null)}})()}static#n(t){var e=this;return(0,Ls.A)(function*(){yield e.#s(t)})()}static#s(t){return(0,x.A)(function*(){return pr(t,'pdfjs-previous-button =\n .title = Previous Page\npdfjs-previous-button-label = Previous\npdfjs-next-button =\n .title = Next Page\npdfjs-next-button-label = Next\npdfjs-page-input =\n .title = Page\npdfjs-of-pages = of { $pagesCount }\npdfjs-page-of-pages = ({ $pageNumber } of { $pagesCount })\npdfjs-zoom-out-button =\n .title = Zoom Out\npdfjs-zoom-out-button-label = Zoom Out\npdfjs-zoom-in-button =\n .title = Zoom In\npdfjs-zoom-in-button-label = Zoom In\npdfjs-zoom-select =\n .title = Zoom\npdfjs-presentation-mode-button =\n .title = Switch to Presentation Mode\npdfjs-presentation-mode-button-label = Presentation Mode\npdfjs-open-file-button =\n .title = Open File\npdfjs-open-file-button-label = Open\npdfjs-print-button =\n .title = Print\npdfjs-print-button-label = Print\npdfjs-save-button =\n .title = Save\npdfjs-save-button-label = Save\npdfjs-download-button =\n .title = Download\npdfjs-download-button-label = Download\npdfjs-bookmark-button =\n .title = Current Page (View URL from Current Page)\npdfjs-bookmark-button-label = Current Page\npdfjs-tools-button =\n .title = Tools\npdfjs-tools-button-label = Tools\npdfjs-first-page-button =\n .title = Go to First Page\npdfjs-first-page-button-label = Go to First Page\npdfjs-last-page-button =\n .title = Go to Last Page\npdfjs-last-page-button-label = Go to Last Page\npdfjs-page-rotate-cw-button =\n .title = Rotate Clockwise\npdfjs-page-rotate-cw-button-label = Rotate Clockwise\npdfjs-page-rotate-ccw-button =\n .title = Rotate Counterclockwise\npdfjs-page-rotate-ccw-button-label = Rotate Counterclockwise\npdfjs-cursor-text-select-tool-button =\n .title = Enable Text Selection Tool\npdfjs-cursor-text-select-tool-button-label = Text Selection Tool\npdfjs-cursor-hand-tool-button =\n .title = Enable Hand Tool\npdfjs-cursor-hand-tool-button-label = Hand Tool\npdfjs-scroll-page-button =\n .title = Use Page Scrolling\npdfjs-scroll-page-button-label = Page Scrolling\npdfjs-scroll-vertical-button =\n .title = Use Vertical Scrolling\npdfjs-scroll-vertical-button-label = Vertical Scrolling\npdfjs-scroll-horizontal-button =\n .title = Use Horizontal Scrolling\npdfjs-scroll-horizontal-button-label = Horizontal Scrolling\npdfjs-scroll-wrapped-button =\n .title = Use Wrapped Scrolling\npdfjs-scroll-wrapped-button-label = Wrapped Scrolling\npdfjs-spread-none-button =\n .title = Do not join page spreads\npdfjs-spread-none-button-label = No Spreads\npdfjs-spread-odd-button =\n .title = Join page spreads starting with odd-numbered pages\npdfjs-spread-odd-button-label = Odd Spreads\npdfjs-spread-even-button =\n .title = Join page spreads starting with even-numbered pages\npdfjs-spread-even-button-label = Even Spreads\npdfjs-document-properties-button =\n .title = Document Properties\u2026\npdfjs-document-properties-button-label = Document Properties\u2026\npdfjs-document-properties-file-name = File name:\npdfjs-document-properties-file-size = File size:\npdfjs-document-properties-size-kb = { NUMBER($kb, maximumSignificantDigits: 3) } KB ({ $b } bytes)\npdfjs-document-properties-size-mb = { NUMBER($mb, maximumSignificantDigits: 3) } MB ({ $b } bytes)\npdfjs-document-properties-title = Title:\npdfjs-document-properties-author = Author:\npdfjs-document-properties-subject = Subject:\npdfjs-document-properties-keywords = Keywords:\npdfjs-document-properties-creation-date = Creation Date:\npdfjs-document-properties-modification-date = Modification Date:\npdfjs-document-properties-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") }\npdfjs-document-properties-creator = Creator:\npdfjs-document-properties-producer = PDF Producer:\npdfjs-document-properties-version = PDF Version:\npdfjs-document-properties-page-count = Page Count:\npdfjs-document-properties-page-size = Page Size:\npdfjs-document-properties-page-size-unit-inches = in\npdfjs-document-properties-page-size-unit-millimeters = mm\npdfjs-document-properties-page-size-orientation-portrait = portrait\npdfjs-document-properties-page-size-orientation-landscape = landscape\npdfjs-document-properties-page-size-name-a-three = A3\npdfjs-document-properties-page-size-name-a-four = A4\npdfjs-document-properties-page-size-name-letter = Letter\npdfjs-document-properties-page-size-name-legal = Legal\npdfjs-document-properties-page-size-dimension-string = { $width } \xd7 { $height } { $unit } ({ $orientation })\npdfjs-document-properties-page-size-dimension-name-string = { $width } \xd7 { $height } { $unit } ({ $name }, { $orientation })\npdfjs-document-properties-linearized = Fast Web View:\npdfjs-document-properties-linearized-yes = Yes\npdfjs-document-properties-linearized-no = No\npdfjs-document-properties-close-button = Close\npdfjs-print-progress-message = Preparing document for printing\u2026\npdfjs-print-progress-percent = { $progress }%\npdfjs-print-progress-close-button = Cancel\npdfjs-printing-not-supported = Warning: Printing is not fully supported by this browser.\npdfjs-printing-not-ready = Warning: The PDF is not fully loaded for printing.\npdfjs-toggle-sidebar-button =\n .title = Toggle Sidebar\npdfjs-toggle-sidebar-notification-button =\n .title = Toggle Sidebar (document contains outline/attachments/layers)\npdfjs-toggle-sidebar-button-label = Toggle Sidebar\npdfjs-document-outline-button =\n .title = Show Document Outline (double-click to expand/collapse all items)\npdfjs-document-outline-button-label = Document Outline\npdfjs-attachments-button =\n .title = Show Attachments\npdfjs-attachments-button-label = Attachments\npdfjs-layers-button =\n .title = Show Layers (double-click to reset all layers to the default state)\npdfjs-layers-button-label = Layers\npdfjs-thumbs-button =\n .title = Show Thumbnails\npdfjs-thumbs-button-label = Thumbnails\npdfjs-current-outline-item-button =\n .title = Find Current Outline Item\npdfjs-current-outline-item-button-label = Current Outline Item\npdfjs-findbar-button =\n .title = Find in Document\npdfjs-findbar-button-label = Find\npdfjs-additional-layers = Additional Layers\npdfjs-thumb-page-title =\n .title = Page { $page }\npdfjs-thumb-page-canvas =\n .aria-label = Thumbnail of Page { $page }\npdfjs-find-input =\n .title = Find\n .placeholder = Find in document\u2026\npdfjs-find-previous-button =\n .title = Find the previous occurrence of the phrase\npdfjs-find-previous-button-label = Previous\npdfjs-find-next-button =\n .title = Find the next occurrence of the phrase\npdfjs-find-next-button-label = Next\npdfjs-find-highlight-checkbox = Highlight All\npdfjs-find-match-case-checkbox-label = Match Case\npdfjs-find-match-diacritics-checkbox-label = Match Diacritics\npdfjs-find-entire-word-checkbox-label = Whole Words\npdfjs-find-reached-top = Reached top of document, continued from bottom\npdfjs-find-reached-bottom = Reached end of document, continued from top\npdfjs-find-match-count =\n { $total ->\n [one] { $current } of { $total } match\n *[other] { $current } of { $total } matches\n }\npdfjs-find-match-count-limit =\n { $limit ->\n [one] More than { $limit } match\n *[other] More than { $limit } matches\n }\npdfjs-find-not-found = Phrase not found\npdfjs-page-scale-width = Page Width\npdfjs-page-scale-fit = Page Fit\npdfjs-page-scale-auto = Automatic Zoom\npdfjs-page-scale-actual = Actual Size\npdfjs-page-scale-percent = { $scale }%\npdfjs-page-landmark =\n .aria-label = Page { $page }\npdfjs-loading-error = An error occurred while loading the PDF.\npdfjs-invalid-file-error = Invalid or corrupted PDF file.\npdfjs-missing-file-error = Missing PDF file.\npdfjs-unexpected-response-error = Unexpected server response.\npdfjs-rendering-error = An error occurred while rendering the page.\npdfjs-annotation-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") }\npdfjs-text-annotation-type =\n .alt = [{ $type } Annotation]\npdfjs-password-label = Enter the password to open this PDF file.\npdfjs-password-invalid = Invalid password. Please try again.\npdfjs-password-ok-button = OK\npdfjs-password-cancel-button = Cancel\npdfjs-web-fonts-disabled = Web fonts are disabled: unable to use embedded PDF fonts.\npdfjs-editor-free-text-button =\n .title = Text\npdfjs-editor-free-text-button-label = Text\npdfjs-editor-ink-button =\n .title = Draw\npdfjs-editor-ink-button-label = Draw\npdfjs-editor-stamp-button =\n .title = Add or edit images\npdfjs-editor-stamp-button-label = Add or edit images\npdfjs-editor-highlight-button =\n .title = Highlight\npdfjs-editor-highlight-button-label = Highlight\npdfjs-highlight-floating-button1 =\n .title = Highlight\n .aria-label = Highlight\npdfjs-highlight-floating-button-label = Highlight\npdfjs-editor-remove-ink-button =\n .title = Remove drawing\npdfjs-editor-remove-freetext-button =\n .title = Remove text\npdfjs-editor-remove-stamp-button =\n .title = Remove image\npdfjs-editor-remove-highlight-button =\n .title = Remove highlight\npdfjs-editor-free-text-color-input = Color\npdfjs-editor-free-text-size-input = Size\npdfjs-editor-ink-color-input = Color\npdfjs-editor-ink-thickness-input = Thickness\npdfjs-editor-ink-opacity-input = Opacity\npdfjs-editor-stamp-add-image-button =\n .title = Add image\npdfjs-editor-stamp-add-image-button-label = Add image\npdfjs-editor-free-highlight-thickness-input = Thickness\npdfjs-editor-free-highlight-thickness-title =\n .title = Change thickness when highlighting items other than text\npdfjs-free-text2 =\n .aria-label = Text Editor\n .default-content = Start typing\u2026\npdfjs-ink =\n .aria-label = Draw Editor\npdfjs-ink-canvas =\n .aria-label = User-created image\npdfjs-editor-alt-text-button =\n .aria-label = Alt text\npdfjs-editor-alt-text-button-label = Alt text\npdfjs-editor-alt-text-edit-button =\n .aria-label = Edit alt text\npdfjs-editor-alt-text-dialog-label = Choose an option\npdfjs-editor-alt-text-dialog-description = Alt text (alternative text) helps when people can\u2019t see the image or when it doesn\u2019t load.\npdfjs-editor-alt-text-add-description-label = Add a description\npdfjs-editor-alt-text-add-description-description = Aim for 1-2 sentences that describe the subject, setting, or actions.\npdfjs-editor-alt-text-mark-decorative-label = Mark as decorative\npdfjs-editor-alt-text-mark-decorative-description = This is used for ornamental images, like borders or watermarks.\npdfjs-editor-alt-text-cancel-button = Cancel\npdfjs-editor-alt-text-save-button = Save\npdfjs-editor-alt-text-decorative-tooltip = Marked as decorative\npdfjs-editor-alt-text-textarea =\n .placeholder = For example, \u201cA young man sits down at a table to eat a meal\u201d\npdfjs-editor-resizer-top-left =\n .aria-label = Top left corner \u2014 resize\npdfjs-editor-resizer-top-middle =\n .aria-label = Top middle \u2014 resize\npdfjs-editor-resizer-top-right =\n .aria-label = Top right corner \u2014 resize\npdfjs-editor-resizer-middle-right =\n .aria-label = Middle right \u2014 resize\npdfjs-editor-resizer-bottom-right =\n .aria-label = Bottom right corner \u2014 resize\npdfjs-editor-resizer-bottom-middle =\n .aria-label = Bottom middle \u2014 resize\npdfjs-editor-resizer-bottom-left =\n .aria-label = Bottom left corner \u2014 resize\npdfjs-editor-resizer-middle-left =\n .aria-label = Middle left \u2014 resize\npdfjs-editor-highlight-colorpicker-label = Highlight color\npdfjs-editor-colorpicker-button =\n .title = Change color\npdfjs-editor-colorpicker-dropdown =\n .aria-label = Color choices\npdfjs-editor-colorpicker-yellow =\n .title = Yellow\npdfjs-editor-colorpicker-green =\n .title = Green\npdfjs-editor-colorpicker-blue =\n .title = Blue\npdfjs-editor-colorpicker-pink =\n .title = Pink\npdfjs-editor-colorpicker-red =\n .title = Red\npdfjs-editor-highlight-show-all-button-label = Show all\npdfjs-editor-highlight-show-all-button =\n .title = Show all\npdfjs-editor-new-alt-text-dialog-edit-label = Edit alt text (image description)\npdfjs-editor-new-alt-text-dialog-add-label = Add alt text (image description)\npdfjs-editor-new-alt-text-textarea =\n .placeholder = Write your description here\u2026\npdfjs-editor-new-alt-text-description = Short description for people who can\u2019t see the image or when the image doesn\u2019t load.\npdfjs-editor-new-alt-text-disclaimer1 = This alt text was created automatically and may be inaccurate.\npdfjs-editor-new-alt-text-disclaimer-learn-more-url = Learn more\npdfjs-editor-new-alt-text-create-automatically-button-label = Create alt text automatically\npdfjs-editor-new-alt-text-not-now-button = Not now\npdfjs-editor-new-alt-text-error-title = Couldn\u2019t create alt text automatically\npdfjs-editor-new-alt-text-error-description = Please write your own alt text or try again later.\npdfjs-editor-new-alt-text-error-close-button = Close\npdfjs-editor-new-alt-text-ai-model-downloading-progress = Downloading alt text AI model ({ $downloadedSize } of { $totalSize } MB)\n .aria-valuetext = Downloading alt text AI model ({ $downloadedSize } of { $totalSize } MB)\npdfjs-editor-new-alt-text-added-button =\n .aria-label = Alt text added\npdfjs-editor-new-alt-text-added-button-label = Alt text added\npdfjs-editor-new-alt-text-missing-button =\n .aria-label = Missing alt text\npdfjs-editor-new-alt-text-missing-button-label = Missing alt text\npdfjs-editor-new-alt-text-to-review-button =\n .aria-label = Review alt text\npdfjs-editor-new-alt-text-to-review-button-label = Review alt text\npdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer = Created automatically: { $generatedAltText }\npdfjs-image-alt-text-settings-button =\n .title = Image alt text settings\npdfjs-image-alt-text-settings-button-label = Image alt text settings\npdfjs-editor-alt-text-settings-dialog-label = Image alt text settings\npdfjs-editor-alt-text-settings-automatic-title = Automatic alt text\npdfjs-editor-alt-text-settings-create-model-button-label = Create alt text automatically\npdfjs-editor-alt-text-settings-create-model-description = Suggests descriptions to help people who can\u2019t see the image or when the image doesn\u2019t load.\npdfjs-editor-alt-text-settings-download-model-label = Alt text AI model ({ $totalSize } MB)\npdfjs-editor-alt-text-settings-ai-model-description = Runs locally on your device so your data stays private. Required for automatic alt text.\npdfjs-editor-alt-text-settings-delete-model-button = Delete\npdfjs-editor-alt-text-settings-download-model-button = Download\npdfjs-editor-alt-text-settings-downloading-model-button = Downloading\u2026\npdfjs-editor-alt-text-settings-editor-title = Alt text editor\npdfjs-editor-alt-text-settings-show-dialog-button-label = Show alt text editor right away when adding an image\npdfjs-editor-alt-text-settings-show-dialog-description = Helps you make sure all your images have alt text.\npdfjs-editor-alt-text-settings-close-button = Close')})()}}function _n(){return document.location.hash}class Mc{#t=null;constructor({linkService:t,eventBus:e}){this.linkService=t,this.eventBus=e,this._initialized=!1,this._fingerprint="",this.reset(),this.eventBus._on("pagesinit",()=>{this._isPagesLoaded=!1,this.eventBus._on("pagesloaded",i=>{this._isPagesLoaded=!!i.pagesCount},{once:!0})})}initialize({fingerprint:t,resetHistory:e=!1,updateUrl:i=!1}){if(!t||"string"!=typeof t)return void console.error('PDFHistory.initialize: The "fingerprint" must be a non-empty string.');this._initialized&&this.reset();const n=""!==this._fingerprint&&this._fingerprint!==t;this._fingerprint=t,this._updateUrl=!0===i,this._initialized=!0,this.#d();const s=window.history.state;if(this._popStateInProgress=!1,this._blockHashChange=0,this._currentHash=_n(),this._numPositionUpdates=0,this._uid=this._maxUid=0,this._destination=null,this._position=null,!this.#s(s,!0)||e){const{hash:a,page:l,rotation:h}=this.#l(!0);return!a||n||e?void this.#e(null,!0):void this.#e({hash:a,page:l,rotation:h},!0)}const r=s.destination;this.#r(r,s.uid,!0),void 0!==r.rotation&&(this._initialRotation=r.rotation),r.dest?(this._initialBookmark=JSON.stringify(r.dest),this._destination.page=null):r.hash?this._initialBookmark=r.hash:r.page&&(this._initialBookmark=`page=${r.page}`)}reset(){this._initialized&&(this.#o(),this._initialized=!1,this.#a()),this._updateViewareaTimeout&&(clearTimeout(this._updateViewareaTimeout),this._updateViewareaTimeout=null),this._initialBookmark=null,this._initialRotation=null}push({namedDest:t=null,explicitDest:e,pageNumber:i}){if(!this._initialized)return;if(t&&"string"!=typeof t)return void console.error(`PDFHistory.push: "${t}" is not a valid namedDest parameter.`);if(!Array.isArray(e))return void console.error(`PDFHistory.push: "${e}" is not a valid explicitDest parameter.`);if(!this.#n(i)&&(null!==i||this._destination))return void console.error(`PDFHistory.push: "${i}" is not a valid pageNumber parameter.`);const n=t||JSON.stringify(e);if(!n)return;let s=!1;if(this._destination&&(function Lc(o,t){return"string"==typeof o&&"string"==typeof t&&(o===t||hi(o).get("nameddest")===t)}(this._destination.hash,n)||function Rc(o,t){function e(i,n){if(typeof i!=typeof n||Array.isArray(i)||Array.isArray(n))return!1;if(null!==i&&"object"==typeof i&&null!==n){if(Object.keys(i).length!==Object.keys(n).length)return!1;for(const s in i)if(!e(i[s],n[s]))return!1;return!0}return i===n||Number.isNaN(i)&&Number.isNaN(n)}if(!Array.isArray(o)||!Array.isArray(t)||o.length!==t.length)return!1;for(let i=0,n=o.length;i<n;i++)if(!e(o[i],t[i]))return!1;return!0}(this._destination.dest,e))){if(this._destination.page)return;s=!0}this._popStateInProgress&&!s||(this.#e({dest:e,hash:n,page:i,rotation:this.linkService.rotation},s),this._popStateInProgress||(this._popStateInProgress=!0,Promise.resolve().then(()=>{this._popStateInProgress=!1})))}pushPage(t){if(this._initialized){if(!this.#n(t))return void console.error(`PDFHistory.pushPage: "${t}" is not a valid page number.`);this._destination?.page!==t&&(this._popStateInProgress||(this.#e({dest:null,hash:`page=${t}`,page:t,rotation:this.linkService.rotation}),this._popStateInProgress||(this._popStateInProgress=!0,Promise.resolve().then(()=>{this._popStateInProgress=!1}))))}}pushCurrentPosition(){!this._initialized||this._popStateInProgress||this.#i()}back(){if(!this._initialized||this._popStateInProgress)return;const t=window.history.state;this.#s(t)&&t.uid>0&&window.history.back()}forward(){if(!this._initialized||this._popStateInProgress)return;const t=window.history.state;this.#s(t)&&t.uid<this._maxUid&&window.history.forward()}get popStateInProgress(){return this._initialized&&(this._popStateInProgress||this._blockHashChange>0)}get initialBookmark(){return this._initialized?this._initialBookmark:null}get initialRotation(){return this._initialized?this._initialRotation:null}#e(t,e=!1){const i=e||!this._destination,n={fingerprint:this._fingerprint,uid:i?this._uid:this._uid+1,destination:t};let s;if(this.#r(t,n.uid),this._updateUrl&&t?.hash){const r=document.location.href.split("#",1)[0];r.startsWith("file://")||(s=`${r}#${t.hash}`)}i?window.history.replaceState(n,"",s):window.history.pushState(n,"",s)}#i(t=!1){if(!this._position)return;let e=this._position;if(t&&(e=Object.assign(Object.create(null),this._position),e.temporary=!0),!this._destination)return void this.#e(e);if(this._destination.temporary)return void this.#e(e,!0);if(this._destination.hash===e.hash||!this._destination.page&&this._numPositionUpdates<=50)return;let i=!1;if(this._destination.page>=e.first&&this._destination.page<=e.page){if(void 0!==this._destination.dest||!this._destination.first)return;i=!0}this.#e(e,i)}#n(t){return Number.isInteger(t)&&t>0&&t<=this.linkService.pagesCount}#s(t,e=!1){if(!t)return!1;if(t.fingerprint!==this._fingerprint){if(!e)return!1;{if("string"!=typeof t.fingerprint||t.fingerprint.length!==this._fingerprint.length)return!1;const[i]=performance.getEntriesByType("navigation");if("reload"!==i?.type)return!1}}return!(!Number.isInteger(t.uid)||t.uid<0||null===t.destination||"object"!=typeof t.destination)}#r(t,e,i=!1){this._updateViewareaTimeout&&(clearTimeout(this._updateViewareaTimeout),this._updateViewareaTimeout=null),i&&t?.temporary&&delete t.temporary,this._destination=t,this._uid=e,this._maxUid=Math.max(this._maxUid,e),this._numPositionUpdates=0}#l(t=!1){const e=unescape(_n()).substring(1),i=hi(e),n=i.get("nameddest")||"";let s=0|i.get("page");return(!this.#n(s)||t&&n.length>0)&&(s=null),{hash:e,page:s,rotation:this.linkService.rotation}}#h({location:t}){this._updateViewareaTimeout&&(clearTimeout(this._updateViewareaTimeout),this._updateViewareaTimeout=null),this._position={hash:t.pdfOpenParams.substring(1),page:this.linkService.page,first:t.pageNumber,rotation:t.rotation},!this._popStateInProgress&&(this._isPagesLoaded&&this._destination&&!this._destination.page&&this._numPositionUpdates++,this._updateViewareaTimeout=setTimeout(()=>{this._popStateInProgress||this.#i(!0),this._updateViewareaTimeout=null},1e3))}#c({state:t}){const e=_n(),i=this._currentHash!==e;if(this._currentHash=e,!t){this._uid++;const{hash:s,page:r,rotation:a}=this.#l();return void this.#e({hash:s,page:r,rotation:a},!0)}if(!this.#s(t))return;this._popStateInProgress=!0,i&&(this._blockHashChange++,function Fh(o){return dn.apply(this,arguments)}({target:window,name:"hashchange",delay:1e3}).then(()=>{this._blockHashChange--}));const n=t.destination;this.#r(n,t.uid,!0),Bs(n.rotation)&&(this.linkService.rotation=n.rotation),n.dest?this.linkService.goToDestination(n.dest):n.hash?this.linkService.setHash(n.hash):n.page&&(this.linkService.page=n.page),Promise.resolve().then(()=>{this._popStateInProgress=!1})}#o(){(!this._destination||this._destination.temporary)&&this.#i()}#d(){if(this.#t)return;this.#t=new AbortController;const{signal:t}=this.#t;this.eventBus._on("updateviewarea",this.#h.bind(this),{signal:t}),window.addEventListener("popstate",this.#c.bind(this),{signal:t}),window.addEventListener("pagehide",this.#o.bind(this),{signal:t})}#a(){this.#t?.abort(),this.#t=null}}class Ic{#t=null;#e=null;#i=null;#n=null;#s=null;#r;constructor(t){this.pdfPage=t.pdfPage,this.accessibilityManager=t.accessibilityManager,this.l10n=t.l10n,this.l10n||=new Yt,this.annotationEditorLayer=null,this.div=null,this._cancelled=!1,this.#r=t.uiManager,this.#t=t.annotationLayer||null,this.#s=t.textLayer||null,this.#e=t.drawLayer||null,this.#i=t.onAppend||null,this.#n=t.structTreeLayer||null}render(t){var e=this;return(0,x.A)(function*(i,n="display"){if("display"!==n||e._cancelled)return;const s=i.clone({dontFlip:!0});if(e.div)return e.annotationEditorLayer.update({viewport:s}),void e.show();const r=e.div=document.createElement("div");r.className="annotationEditorLayer",r.hidden=!0,r.dir=e.#r.direction,e.#i?.(r),e.annotationEditorLayer=new xh({uiManager:e.#r,div:r,structTreeLayer:e.#n,accessibilityManager:e.accessibilityManager,pageIndex:e.pdfPage.pageNumber-1,l10n:e.l10n,viewport:s,annotationLayer:e.#t,textLayer:e.#s,drawLayer:e.#e}),e.annotationEditorLayer.render({viewport:s,div:r,annotations:null,intent:n}),e.show()}).apply(this,arguments)}cancel(){this._cancelled=!0,this.div&&this.annotationEditorLayer.destroy()}hide(){this.div&&(this.div.hidden=!0)}show(){!this.div||this.annotationEditorLayer.isInvisible||(this.div.hidden=!1)}}{var vn=new Map;const o=navigator.userAgent||"",t=navigator.platform||"",e=navigator.maxTouchPoints||1,i=/Android/.test(o);(/\b(iPad|iPhone|iPod)(?=;)/.test(o)||"MacIntel"===t&&e>1||i)&&vn.set("maxCanvasPixels",5242880),i&&vn.set("useSystemFonts",!1)}const An={BOOLEAN:1,NUMBER:2,OBJECT:4,STRING:8,UNDEFINED:16},Bt={allowedGlobalEvents:{value:null,kind:1},canvasMaxAreaInBytes:{value:-1,kind:5},isInAutomation:{value:!1,kind:1},localeProperties:{value:{lang:navigator.language||"en-US"},kind:1},nimbusDataStr:{value:"",kind:1},supportsCaretBrowsingMode:{value:!1,kind:1},supportsDocumentFonts:{value:!0,kind:1},supportsIntegratedFind:{value:!1,kind:1},supportsMouseWheelZoomCtrlKey:{value:!0,kind:1},supportsMouseWheelZoomMetaKey:{value:!0,kind:1},supportsPinchToZoom:{value:!0,kind:1},toolbarDensity:{value:0,kind:17},altTextLearnMoreUrl:{value:"",kind:130},annotationEditorMode:{value:0,kind:130},annotationMode:{value:2,kind:130},cursorToolOnLoad:{value:0,kind:130},debuggerSrc:{value:"./debugger.mjs",kind:2},defaultZoomDelay:{value:400,kind:130},defaultZoomValue:{value:"",kind:130},disableHistory:{value:!1,kind:2},disablePageLabels:{value:!1,kind:130},enableAltText:{value:!1,kind:130},enableAltTextModelDownload:{value:!0,kind:146},enableGuessAltText:{value:!0,kind:146},enableHighlightFloatingButton:{value:!1,kind:130},enableNewAltTextWhenAddingImage:{value:!0,kind:130},enablePermissions:{value:!1,kind:130},enablePrintAutoRotate:{value:!0,kind:130},enableScripting:{value:!0,kind:130},enableUpdatedAddImage:{value:!1,kind:130},externalLinkRel:{value:"noopener noreferrer nofollow",kind:2},externalLinkTarget:{value:0,kind:130},highlightEditorColors:{value:"yellow=#FFFF98,green=#53FFBC,blue=#80EBFF,pink=#FFCBE6,red=#FF4F5F",kind:130},historyUpdateUrl:{value:!1,kind:130},ignoreDestinationZoom:{value:!1,kind:130},imageResourcesPath:{value:"./images/",kind:2},maxCanvasPixels:{value:2**25,kind:2},forcePageColors:{value:!1,kind:130},pageColorsBackground:{value:"Canvas",kind:130},pageColorsForeground:{value:"CanvasText",kind:130},pdfBugEnabled:{value:!1,kind:130},printResolution:{value:150,kind:2},sidebarViewOnLoad:{value:-1,kind:130},scrollModeOnLoad:{value:-1,kind:130},spreadModeOnLoad:{value:-1,kind:130},textLayerMode:{value:1,kind:130},viewOnLoad:{value:0,kind:130},cMapPacked:{value:!0,kind:4},cMapUrl:{value:"../web/cmaps/",kind:4},disableAutoFetch:{value:!1,kind:132},disableFontFace:{value:!1,kind:132},disableRange:{value:!1,kind:132},disableStream:{value:!1,kind:132},docBaseUrl:{value:"",kind:4},enableHWA:{value:!0,kind:134},enableXfa:{value:!0,kind:132},fontExtraProperties:{value:!1,kind:4},isEvalSupported:{value:!0,kind:4},isOffscreenCanvasSupported:{value:!0,kind:4},maxImageSize:{value:-1,kind:4},pdfBug:{value:!1,kind:4},standardFontDataUrl:{value:"../web/standard_fonts/",kind:4},useSystemFonts:{value:void 0,kind:4,type:An.BOOLEAN+An.UNDEFINED},verbosity:{value:1,kind:4},workerPort:{value:null,kind:8},workerSrc:{value:"../build/pdf.worker.mjs",kind:8},defaultUrl:{value:"compressed.tracemonkey-pldi-09.pdf",kind:2},sandboxBundleSrc:{value:"../build/pdf.sandbox.mjs",kind:2},viewerCssTheme:{value:0,kind:130},enableFakeMLManager:{value:!0,kind:2},disablePreferences:{value:!1,kind:2}};class kc{static eventBus;static#t=new Map;static{for(const t in Bt)this.#t.set(t,Bt[t].value);for(const[t,e]of vn)this.#t.set(t,e);this._hasInvokedSet=!1,this._checkDisablePreferences=()=>!!this.get("disablePreferences")||(this._hasInvokedSet&&console.warn('The Preferences may override manually set AppOptions; please use the "disablePreferences"-option to prevent that.'),!1)}static get(t){return this.#t.get(t)}static getAll(t=null,e=!1){const i=Object.create(null);for(const n in Bt){const s=Bt[n];t&&!(t&s.kind)||(i[n]=e?s.value:this.#t.get(n))}return i}static set(t,e){this.setAll({[t]:e})}static setAll(t,e=!1){let i;this._hasInvokedSet||=!0;for(const n in t){const s=Bt[n],r=t[n];if(!s||!(typeof r==typeof s.value||An[(typeof r).toUpperCase()]&s.type))continue;const{kind:a}=s;e&&!(1&a||128&a)||(this.eventBus&&16&a&&(i||=new Map).set(n,r),this.#t.set(n,r))}if(i)for(const[n,s]of i)this.eventBus.dispatch(n.toLowerCase(),{source:this,value:s})}}class Dc{#t=null;constructor(t){this.pageIndex=t.pageIndex}render(){var t=this;return(0,x.A)(function*(e="display"){"display"!==e||t.#t||t._cancelled||(t.#t=new Th({pageIndex:t.pageIndex}))}).apply(this,arguments)}cancel(){this._cancelled=!0,this.#t&&(this.#t.destroy(),this.#t=null)}setParent(t){this.#t?.setParent(t)}getDrawLayer(){return this.#t}}const mr={Document:null,DocumentFragment:null,Part:"group",Sect:"group",Div:"group",Aside:"note",NonStruct:"none",P:null,H:"heading",Title:null,FENote:"note",Sub:"group",Lbl:null,Span:null,Em:null,Strong:null,Link:"link",Annot:"note",Form:"form",Ruby:null,RB:null,RT:null,RP:null,Warichu:null,WT:null,WP:null,L:"list",LI:"listitem",LBody:null,Table:"table",TR:"row",TH:"columnheader",TD:"cell",THead:"columnheader",TBody:null,TFoot:null,Caption:null,Figure:"figure",Formula:null,Artifact:null},Oc=/^H(\d+)$/;class br{#t;#e=null;#i;#n=new Map;#s;#r=null;constructor(t,e){this.#t=t.getStructTree(),this.#s=e}render(){var t=this;return(0,x.A)(function*(){if(t.#i)return t.#i;const{promise:e,resolve:i,reject:n}=Promise.withResolvers();t.#i=e;try{t.#e=t.#c(yield t.#t)}catch(s){n(s)}return t.#t=null,t.#e?.classList.add("structTree"),i(t.#e),e})()}getAriaAttributes(t){var e=this;return(0,x.A)(function*(){try{return yield e.render(),e.#n.get(t)}catch{}return null})()}hide(){this.#e&&!this.#e.hidden&&(this.#e.hidden=!0)}show(){this.#e?.hidden&&(this.#e.hidden=!1)}#l(t,e){const{alt:i,id:n,lang:s}=t;if(void 0!==i){let r=!1;const a=Fe(i);for(const l of t.children)if("annotation"===l.type){let h=this.#n.get(l.id);h||(h=new Map,this.#n.set(l.id,h)),h.set("aria-label",a),r=!0}r||e.setAttribute("aria-label",a)}void 0!==n&&e.setAttribute("aria-owns",n),void 0!==s&&e.setAttribute("lang",Fe(s,!0))}#h(t,e){const{alt:i,bbox:n,children:s}=t,r=s?.[0];if(!this.#s||!i||!n||"content"!==r?.type)return!1;const{id:a}=r;if(!a)return!1;e.setAttribute("aria-owns",a);const l=document.createElement("span");(this.#r||=new Map).set(a,l),l.setAttribute("role","img"),l.setAttribute("aria-label",Fe(i));const{pageHeight:h,pageX:c,pageY:d}=this.#s,u="calc(var(--scale-factor)*",{style:f}=l;return f.width=`${u}${n[2]-n[0]}px)`,f.height=`${u}${n[3]-n[1]}px)`,f.left=`${u}${n[0]-c}px)`,f.top=`${u}${h-n[3]+d}px)`,!0}addElementsToTextLayer(){if(this.#r){for(const[t,e]of this.#r)document.getElementById(t)?.append(e);this.#r.clear(),this.#r=null}}#c(t){if(!t)return null;const e=document.createElement("span");if("role"in t){const{role:i}=t,n=i.match(Oc);if(n?(e.setAttribute("role","heading"),e.setAttribute("aria-level",n[1])):mr[i]&&e.setAttribute("role",mr[i]),"Figure"===i&&this.#h(t,e))return e}if(this.#l(t,e),t.children)if(1===t.children.length&&"id"in t.children[0])this.#l(t.children[0],e);else for(const i of t.children)e.append(this.#c(i));return e}}class He{#t=!1;#e=null;#i=new Map;#n=new Map;setTextMapping(t){this.#e=t}static#s(t,e){const i=t.getBoundingClientRect(),n=e.getBoundingClientRect();if(0===i.width&&0===i.height)return 1;if(0===n.width&&0===n.height)return-1;const a=i.y+i.height/2,c=n.y+n.height/2;return a<=n.y&&c>=i.y+i.height?-1:c<=i.y&&a>=n.y+n.height?1:i.x+i.width/2-(n.x+n.width/2)}enable(){if(this.#t)throw new Error("TextAccessibilityManager is already enabled.");if(!this.#e)throw new Error("Text divs and strings have not been set.");if(this.#t=!0,this.#e=this.#e.slice(),this.#e.sort(He.#s),this.#i.size>0){const t=this.#e;for(const[e,i]of this.#i)document.getElementById(e)?this.#r(e,t[i]):this.#i.delete(e)}for(const[t,e]of this.#n)this.addPointerInTextLayer(t,e);this.#n.clear()}disable(){this.#t&&(this.#n.clear(),this.#e=null,this.#t=!1)}removePointerInTextLayer(t){if(!this.#t)return void this.#n.delete(t);const e=this.#e;if(!e||0===e.length)return;const{id:i}=t,n=this.#i.get(i);if(void 0===n)return;const s=e[n];this.#i.delete(i);let r=s.getAttribute("aria-owns");r?.includes(i)&&(r=r.split(" ").filter(a=>a!==i).join(" "),r?s.setAttribute("aria-owns",r):(s.removeAttribute("aria-owns"),s.setAttribute("role","presentation")))}#r(t,e){const i=e.getAttribute("aria-owns");i?.includes(t)||e.setAttribute("aria-owns",i?`${i} ${t}`:t),e.removeAttribute("role")}addPointerInTextLayer(t,e){const{id:i}=t;if(!i)return null;if(!this.#t)return this.#n.set(t,e),null;e&&this.removePointerInTextLayer(t);const n=this.#e;if(!n||0===n.length)return null;const s=Ne(n,h=>He.#s(t,h)<0),r=Math.max(0,s-1),a=n[r];this.#r(i,a),this.#i.set(i,r);const l=a.parentNode;return l?.classList.contains("markedContent")?l.id:null}moveElementInDOM(t,e,i,n){const s=this.addPointerInTextLayer(i,n);if(!t.hasChildNodes())return t.append(e),s;const r=Array.from(t.childNodes).filter(h=>h!==e);if(0===r.length)return s;const a=i||e,l=Ne(r,h=>He.#s(a,h)<0);return 0===l?r[0].before(e):r[l-1].after(e),s}}class Fc{#t=null;constructor({findController:t,eventBus:e,pageIndex:i}){this.findController=t,this.matches=[],this.eventBus=e,this.pageIdx=i,this.textDivs=null,this.textContentItemsStr=null,this.enabled=!1}setTextMapping(t,e){this.textDivs=t,this.textContentItemsStr=e}enable(){if(!this.textDivs||!this.textContentItemsStr)throw new Error("Text divs and strings have not been set.");if(this.enabled)throw new Error("TextHighlighter is already enabled.");this.enabled=!0,this.#t||(this.#t=new AbortController,this.eventBus._on("updatetextlayermatches",t=>{(t.pageIndex===this.pageIdx||-1===t.pageIndex)&&this._updateMatches()},{signal:this.#t.signal})),this._updateMatches()}disable(){this.enabled&&(this.enabled=!1,this.#t?.abort(),this.#t=null,this._updateMatches(!0))}_convertMatches(t,e){if(!t)return[];const{textContentItemsStr:i}=this;let n=0,s=0;const r=i.length-1,a=[];for(let l=0,h=t.length;l<h;l++){let c=t[l];for(;n!==r&&c>=s+i[n].length;)s+=i[n].length,n++;n===i.length&&console.error("Could not find a matching mapping");const d={begin:{divIdx:n,offset:c-s}};for(c+=e[l];n!==r&&c>s+i[n].length;)s+=i[n].length,n++;d.end={divIdx:n,offset:c-s},a.push(d)}return a}_renderMatches(t){if(0===t.length)return;const{findController:e,pageIdx:i}=this,{textContentItemsStr:n,textDivs:s}=this,r=i===e.selected.pageIdx,a=e.selected.matchIdx;let h=null;function d(m,v){const A=m.divIdx;return s[A].textContent="",u(A,0,m.offset,v)}function u(m,v,A,w){let E=s[m];if(E.nodeType===Node.TEXT_NODE){const T=document.createElement("span");E.before(T),T.append(E),s[m]=T,E=T}const C=n[m].substring(v,A),M=document.createTextNode(C);if(w){const T=document.createElement("span");return T.className=`${w} appended`,T.append(M),E.append(T),w.includes("selected")?T.offsetLeft:0}return E.append(M),0}let f=a,p=f+1;if(e.state.highlightAll)f=0,p=t.length;else if(!r)return;let g=-1,b=-1;for(let m=f;m<p;m++){const v=t[m],A=v.begin;if(A.divIdx===g&&A.offset===b)continue;g=A.divIdx,b=A.offset;const w=v.end,E=r&&m===a,C=E?" selected":"";let M=0;if(h&&A.divIdx===h.divIdx?u(h.divIdx,h.offset,A.offset):(null!==h&&u(h.divIdx,h.offset,void 0),d(A)),A.divIdx===w.divIdx)M=u(A.divIdx,A.offset,w.offset,"highlight"+C);else{M=u(A.divIdx,A.offset,void 0,"highlight begin"+C);for(let T=A.divIdx+1,y=w.divIdx;T<y;T++)s[T].className="highlight middle"+C;d(w,"highlight end"+C)}h=w,E&&e.scrollMatchIntoView({element:s[A.divIdx],selectedLeft:M,pageIndex:i,matchIndex:a})}h&&u(h.divIdx,h.offset,void 0)}_updateMatches(t=!1){if(!this.enabled&&!t)return;const{findController:e,matches:i,pageIdx:n}=this,{textContentItemsStr:s,textDivs:r}=this;let a=-1;for(const c of i){for(let u=Math.max(a,c.begin.divIdx),f=c.end.divIdx;u<=f;u++){const p=r[u];p.textContent=s[u],p.className=""}a=c.end.divIdx+1}e?.highlightMatches&&!t&&(this.matches=this._convertMatches(e.pageMatches[n]||null,e.pageMatchesLength[n]||null),this._renderMatches(this.matches))}}class ve{#t=!1;#e=null;#i=!1;#n=null;static#s=new Map;static#r=null;constructor({pdfPage:t,highlighter:e=null,accessibilityManager:i=null,enablePermissions:n=!1,onAppend:s=null}){this.pdfPage=t,this.highlighter=e,this.accessibilityManager=i,this.#t=!0===n,this.#e=s,this.div=document.createElement("div"),this.div.tabIndex=0,this.div.className="textLayer"}render(t){var e=this;return(0,x.A)(function*(i,n=null){if(e.#i&&e.#n)return e.#n.update({viewport:i,onBefore:e.hide.bind(e)}),void e.show();e.cancel(),e.#n=new Dh({textContentSource:e.pdfPage.streamTextContent(n||{includeMarkedContent:!0,disableNormalization:!0}),container:e.div,viewport:i});const{textDivs:s,textContentItemsStr:r}=e.#n;e.highlighter?.setTextMapping(s,r),e.accessibilityManager?.setTextMapping(s),yield e.#n.render(),e.#i=!0;const a=document.createElement("div");a.className="endOfContent",e.div.append(a),e.#l(a),e.#e?.(e.div),e.highlighter?.enable(),e.accessibilityManager?.enable()}).apply(this,arguments)}hide(){!this.div.hidden&&this.#i&&(this.highlighter?.disable(),this.div.hidden=!0)}show(){this.div.hidden&&this.#i&&(this.div.hidden=!1,this.highlighter?.enable())}cancel(){this.#n?.cancel(),this.#n=null,this.highlighter?.disable(),this.accessibilityManager?.disable(),ve.#h(this.div)}#l(t){const{div:e}=this;e.addEventListener("mousedown",()=>{e.classList.add("selecting")}),e.addEventListener("copy",i=>{if(!this.#t){const n=document.getSelection();i.clipboardData.setData("text/plain",Fe(Rh(n.toString())))}i.preventDefault(),i.stopPropagation()}),ve.#s.set(e,t),ve.#c()}static#h(t){this.#s.delete(t),0===this.#s.size&&(this.#r?.abort(),this.#r=null)}static#c(){if(this.#r)return;this.#r=new AbortController;const{signal:t}=this.#r,e=(r,a)=>{a.append(r),r.style.width="",r.style.height="",a.classList.remove("selecting")};let i=!1;var n,s;document.addEventListener("pointerdown",()=>{i=!0},{signal:t}),document.addEventListener("pointerup",()=>{i=!1,this.#s.forEach(e)},{signal:t}),window.addEventListener("blur",()=>{i=!1,this.#s.forEach(e)},{signal:t}),document.addEventListener("keyup",()=>{i||this.#s.forEach(e)},{signal:t}),document.addEventListener("selectionchange",()=>{const r=document.getSelection();if(0===r.rangeCount)return void this.#s.forEach(e);const a=new Set;for(let f=0;f<r.rangeCount;f++){const p=r.getRangeAt(f);for(const g of this.#s.keys())!a.has(g)&&p.intersectsNode(g)&&a.add(g)}for(const[f,p]of this.#s)a.has(f)?f.classList.add("selecting"):e(p,f);if(n??="none"===getComputedStyle(this.#s.values().next().value).getPropertyValue("-moz-user-select"),n)return;const l=r.getRangeAt(0),h=s&&(0===l.compareBoundaryPoints(Range.END_TO_END,s)||0===l.compareBoundaryPoints(Range.START_TO_END,s));let c=h?l.startContainer:l.endContainer;c.nodeType===Node.TEXT_NODE&&(c=c.parentNode);const d=c.parentElement?.closest(".textLayer"),u=this.#s.get(d);u&&(u.style.width=d.style.width,u.style.height=d.style.height,c.parentElement.insertBefore(u,h?c:c.nextSibling)),s=l.cloneRange()},{signal:t})}}class _r{constructor({pdfPage:t,annotationStorage:e=null,linkService:i,xfaHtml:n=null}){this.pdfPage=t,this.annotationStorage=e,this.linkService=i,this.xfaHtml=n,this.div=null,this._cancelled=!1}render(t){var e=this;return(0,x.A)(function*(i,n="display"){if("print"===n){const a={viewport:i.clone({dontFlip:!0}),div:e.div,xfaHtml:e.xfaHtml,annotationStorage:e.annotationStorage,linkService:e.linkService,intent:n};return e.div=document.createElement("div"),a.div=e.div,cn.render(a)}const s=yield e.pdfPage.getXfa();if(e._cancelled||!s)return{textDivs:[]};const r={viewport:i.clone({dontFlip:!0}),div:e.div,xfaHtml:s,annotationStorage:e.annotationStorage,linkService:e.linkService,intent:n};return e.div?cn.update(r):(e.div=document.createElement("div"),r.div=e.div,cn.render(r))}).apply(this,arguments)}cancel(){this._cancelled=!0}hide(){this.div&&(this.div.hidden=!0)}}const Nc={annotationEditorUIManager:null,annotationStorage:null,downloadManager:null,enableScripting:!1,fieldObjectsPromise:null,findController:null,hasJSActionsPromise:null,get linkService(){return new ln}},Bc=new Map([["canvasWrapper",0],["textLayer",1],["annotationLayer",2],["annotationEditorLayer",3],["xfaLayer",3]]);class vr{#t=Gt.ENABLE_FORMS;#e=!1;#i=!1;#n=!1;#s=null;#r=null;#l=null;#h=1;#c=1;#o=null;#d=tt.INITIAL;#a=1;#u={directDrawing:!0,initialOptionalContent:!0,regularAnnotations:!0};#p=new WeakMap;#f=[null,null,null,null];constructor(t){const e=t.container,i=t.defaultViewport;this.id=t.id,this.renderingId="page"+this.id,this.#s=t.layerProperties||Nc,this.pdfPage=null,this.pageLabel=null,this.rotation=0,this.scale=t.scale||1,this.viewport=i,this.pdfPageRotate=i.rotation,this._optionalContentConfigPromise=t.optionalContentConfigPromise||null,this.#a=t.textLayerMode??1,this.#t=t.annotationMode??Gt.ENABLE_FORMS,this.imageResourcesPath=t.imageResourcesPath||"",this.maxCanvasPixels=t.maxCanvasPixels??kc.get("maxCanvasPixels"),this.pageColors=t.pageColors||null,this.#e=t.enableHWA||!1,this.eventBus=t.eventBus,this.renderingQueue=t.renderingQueue,this.l10n=t.l10n,this.l10n||=new Yt,this.renderTask=null,this.resume=null,this._isStandalone=!this.renderingQueue?.hasViewer(),this._container=e,this._annotationCanvasMap=null,this.annotationLayer=null,this.annotationEditorLayer=null,this.textLayer=null,this.zoomLayer=null,this.xfaLayer=null,this.structTreeLayer=null,this.drawLayer=null;const n=document.createElement("div");if(n.className="page",n.setAttribute("data-page-number",this.id),n.setAttribute("role","region"),n.setAttribute("data-l10n-id","pdfjs-page-landmark"),n.setAttribute("data-l10n-args",JSON.stringify({page:this.id})),this.div=n,this.#b(),e?.append(n),this._isStandalone){e?.style.setProperty("--scale-factor",this.scale*$t.PDF_TO_CSS_UNITS),this.pageColors?.background&&e?.style.setProperty("--page-bg-color",this.pageColors.background);const{optionalContentConfigPromise:s}=t;s&&s.then(r=>{s===this._optionalContentConfigPromise&&(this.#u.initialOptionalContent=r.hasInitialVisibility)}),t.l10n||this.l10n.translate(this.div)}}#g(t,e){const i=Bc.get(e),n=this.#f[i];if(this.#f[i]=t,n)n.replaceWith(t);else{for(let s=i-1;s>=0;s--){const r=this.#f[s];if(r)return void r.after(t)}this.div.prepend(t)}}get renderingState(){return this.#d}set renderingState(t){if(t!==this.#d)switch(this.#d=t,this.#r&&(clearTimeout(this.#r),this.#r=null),t){case tt.PAUSED:this.div.classList.remove("loading");break;case tt.RUNNING:this.div.classList.add("loadingIcon"),this.#r=setTimeout(()=>{this.div.classList.add("loading"),this.#r=null},0);break;case tt.INITIAL:case tt.FINISHED:this.div.classList.remove("loadingIcon","loading")}}#b(){const{viewport:t}=this;if(this.pdfPage){if(this.#l===t.rotation)return;this.#l=t.rotation}kh(this.div,t,!0,!1)}setPdfPage(t){this._isStandalone&&("CanvasText"===this.pageColors?.foreground||"Canvas"===this.pageColors?.background)&&(this._container?.style.setProperty("--hcm-highlight-filter",t.filterFactory.addHighlightHCMFilter("highlight","CanvasText","Canvas","HighlightText","Highlight")),this._container?.style.setProperty("--hcm-highlight-selected-filter",t.filterFactory.addHighlightHCMFilter("highlight_selected","CanvasText","Canvas","HighlightText","Highlight"))),this.pdfPage=t,this.pdfPageRotate=t.rotate,this.viewport=t.getViewport({scale:this.scale*$t.PDF_TO_CSS_UNITS,rotation:(this.rotation+this.pdfPageRotate)%360}),this.#b(),this.reset()}destroy(){this.reset(),this.pdfPage?.cleanup()}hasEditableAnnotations(){return!!this.annotationLayer?.hasEditableAnnotations()}get _textHighlighter(){return gi(this,"_textHighlighter",new Fc({pageIndex:this.id-1,eventBus:this.eventBus,findController:this.#s.findController}))}#m(t,e){this.eventBus.dispatch(t,{source:this,pageNumber:this.id,error:e})}#_(){var t=this;return(0,x.A)(function*(){let e=null;try{yield t.annotationLayer.render(t.viewport,{structTreeLayer:t.structTreeLayer},"display")}catch(i){console.error(`#renderAnnotationLayer: "${i}".`),e=i}finally{t.#m("annotationlayerrendered",e)}})()}#A(){var t=this;return(0,x.A)(function*(){let e=null;try{yield t.annotationEditorLayer.render(t.viewport,"display")}catch(i){console.error(`#renderAnnotationEditorLayer: "${i}".`),e=i}finally{t.#m("annotationeditorlayerrendered",e)}})()}#E(){var t=this;return(0,x.A)(function*(){try{yield t.drawLayer.render("display")}catch(e){console.error(`#renderDrawLayer: "${e}".`)}})()}#y(){var t=this;return(0,x.A)(function*(){let e=null;try{const i=yield t.xfaLayer.render(t.viewport,"display");i?.textDivs&&t._textHighlighter&&t.#P(i.textDivs)}catch(i){console.error(`#renderXfaLayer: "${i}".`),e=i}finally{t.xfaLayer?.div&&(t.l10n.pause(),t.#g(t.xfaLayer.div,"xfaLayer"),t.l10n.resume()),t.#m("xfalayerrendered",e)}})()}#w(){var t=this;return(0,x.A)(function*(){if(!t.textLayer)return;let e=null;try{yield t.textLayer.render(t.viewport)}catch(i){if(i instanceof Eh)return;console.error(`#renderTextLayer: "${i}".`),e=i}t.#m("textlayerrendered",e),t.#L()})()}#L(){var t=this;return(0,x.A)(function*(){if(!t.textLayer)return;const e=yield t.structTreeLayer?.render();e&&(t.l10n.pause(),t.structTreeLayer?.addElementsToTextLayer(),t.canvas&&e.parentNode!==t.canvas&&t.canvas.append(e),t.l10n.resume()),t.structTreeLayer?.show()})()}#P(t){var e=this;return(0,x.A)(function*(){const i=yield e.pdfPage.getTextContent(),n=[];for(const s of i.items)n.push(s.str);e._textHighlighter.setTextMapping(t,n),e._textHighlighter.enable()})()}_resetZoomLayer(t=!1){if(!this.zoomLayer)return;const e=this.zoomLayer.firstChild;this.#p.delete(e),e.width=0,e.height=0,t&&this.zoomLayer.remove(),this.zoomLayer=null}reset({keepZoomLayer:t=!1,keepAnnotationLayer:e=!1,keepAnnotationEditorLayer:i=!1,keepXfaLayer:n=!1,keepTextLayer:s=!1}={}){this.cancelRendering({keepAnnotationLayer:e,keepAnnotationEditorLayer:i,keepXfaLayer:n,keepTextLayer:s}),this.renderingState=tt.INITIAL;const r=this.div,a=r.childNodes,l=t&&this.zoomLayer||null,h=e&&this.annotationLayer?.div||null,c=i&&this.annotationEditorLayer?.div||null,d=n&&this.xfaLayer?.div||null,u=s&&this.textLayer?.div||null;for(let f=a.length-1;f>=0;f--){const p=a[f];switch(p){case l:case h:case c:case d:case u:continue}p.remove();const g=this.#f.indexOf(p);g>=0&&(this.#f[g]=null)}r.removeAttribute("data-loaded"),h&&this.annotationLayer.hide(),c&&this.annotationEditorLayer.hide(),d&&this.xfaLayer.hide(),u&&this.textLayer.hide(),this.structTreeLayer?.hide(),l||(this.canvas&&(this.#p.delete(this.canvas),this.canvas.width=0,this.canvas.height=0,delete this.canvas),this._resetZoomLayer())}toggleEditingMode(t){this.hasEditableAnnotations()&&(this.#n=t,this.reset({keepZoomLayer:!0,keepAnnotationLayer:!0,keepAnnotationEditorLayer:!0,keepXfaLayer:!0,keepTextLayer:!0}))}update({scale:t=0,rotation:e=null,optionalContentConfigPromise:i=null,drawingDelay:n=-1}){if(this.scale=t||this.scale,"number"==typeof e&&(this.rotation=e),i instanceof Promise&&(this._optionalContentConfigPromise=i,i.then(r=>{i===this._optionalContentConfigPromise&&(this.#u.initialOptionalContent=r.hasInitialVisibility)})),this.#u.directDrawing=!0,this.viewport=this.viewport.clone({scale:this.scale*$t.PDF_TO_CSS_UNITS,rotation:(this.rotation+this.pdfPageRotate)%360}),this.#b(),this._isStandalone&&this._container?.style.setProperty("--scale-factor",this.viewport.scale),this.canvas){let r=!1;if(this.#i)if(0===this.maxCanvasPixels)r=!0;else if(this.maxCanvasPixels>0){const{width:l,height:h}=this.viewport,{sx:c,sy:d}=this.outputScale;r=(Math.floor(l)*c|0)*(Math.floor(h)*d|0)>this.maxCanvasPixels}const a=n>=0&&n<1e3;if(a||r){if(a&&!r&&this.renderingState!==tt.FINISHED&&(this.cancelRendering({keepZoomLayer:!0,keepAnnotationLayer:!0,keepAnnotationEditorLayer:!0,keepXfaLayer:!0,keepTextLayer:!0,cancelExtraDelay:n}),this.renderingState=tt.FINISHED,this.#u.directDrawing=!1),this.cssTransform({target:this.canvas,redrawAnnotationLayer:!0,redrawAnnotationEditorLayer:!0,redrawXfaLayer:!0,redrawTextLayer:!a,hideTextLayer:a}),a)return;return void this.eventBus.dispatch("pagerendered",{source:this,pageNumber:this.id,cssTransform:!0,timestamp:performance.now(),error:this.#o})}!this.zoomLayer&&!this.canvas.hidden&&(this.zoomLayer=this.canvas.parentNode,this.zoomLayer.style.position="absolute")}this.zoomLayer&&this.cssTransform({target:this.zoomLayer.firstChild}),this.reset({keepZoomLayer:!0,keepAnnotationLayer:!0,keepAnnotationEditorLayer:!0,keepXfaLayer:!0,keepTextLayer:!0})}cancelRendering({keepAnnotationLayer:t=!1,keepAnnotationEditorLayer:e=!1,keepXfaLayer:i=!1,keepTextLayer:n=!1,cancelExtraDelay:s=0}={}){this.renderTask&&(this.renderTask.cancel(s),this.renderTask=null),this.resume=null,this.textLayer&&(!n||!this.textLayer.div)&&(this.textLayer.cancel(),this.textLayer=null),this.annotationLayer&&(!t||!this.annotationLayer.div)&&(this.annotationLayer.cancel(),this.annotationLayer=null,this._annotationCanvasMap=null),this.structTreeLayer&&!this.textLayer&&(this.structTreeLayer=null),this.annotationEditorLayer&&(!e||!this.annotationEditorLayer.div)&&(this.drawLayer&&(this.drawLayer.cancel(),this.drawLayer=null),this.annotationEditorLayer.cancel(),this.annotationEditorLayer=null),this.xfaLayer&&(!i||!this.xfaLayer.div)&&(this.xfaLayer.cancel(),this.xfaLayer=null,this._textHighlighter?.disable())}cssTransform({target:t,redrawAnnotationLayer:e=!1,redrawAnnotationEditorLayer:i=!1,redrawXfaLayer:n=!1,redrawTextLayer:s=!1,hideTextLayer:r=!1}){if(!t.hasAttribute("zooming")){t.setAttribute("zooming",!0);const{style:l}=t;l.width=l.height=""}const a=this.#p.get(t);if(this.viewport!==a){const l=this.viewport.rotation-a.rotation,h=Math.abs(l);let c=1,d=1;if(90===h||270===h){const{width:u,height:f}=this.viewport;c=f/u,d=u/f}t.style.transform=`rotate(${l}deg) scale(${c}, ${d})`}e&&this.annotationLayer&&this.#_(),i&&this.annotationEditorLayer&&(this.drawLayer&&this.#E(),this.#A()),n&&this.xfaLayer&&this.#y(),this.textLayer&&(r?(this.textLayer.hide(),this.structTreeLayer?.hide()):s&&this.#w())}get width(){return this.viewport.width}get height(){return this.viewport.height}getPagePoint(t,e){return this.viewport.convertToPdfPoint(t,e)}#x(t){var e=this;return(0,x.A)(function*(i,n=null){if(i===e.renderTask&&(e.renderTask=null),n instanceof hn)e.#o=null;else if(e.#o=n,e.renderingState=tt.FINISHED,e._resetZoomLayer(!0),e.#u.regularAnnotations=!i.separateAnnots,e.eventBus.dispatch("pagerendered",{source:e,pageNumber:e.id,cssTransform:!1,timestamp:performance.now(),error:e.#o}),n)throw n}).apply(this,arguments)}draw(){var t=this;return(0,x.A)(function*(){t.renderingState!==tt.INITIAL&&(console.error("Must be in new state before drawing"),t.reset());const{div:e,l10n:i,pageColors:n,pdfPage:s,viewport:r}=t;if(!s)throw t.renderingState=tt.FINISHED,new Error("pdfPage is not loaded");t.renderingState=tt.RUNNING;const a=document.createElement("div");if(a.classList.add("canvasWrapper"),t.#g(a,"canvasWrapper"),!t.textLayer&&0!==t.#a&&!s.isPureXfa&&(t._accessibilityManager||=new He,t.textLayer=new ve({pdfPage:s,highlighter:t._textHighlighter,accessibilityManager:t._accessibilityManager,enablePermissions:2===t.#a,onAppend:S=>{t.l10n.pause(),t.#g(S,"textLayer"),t.l10n.resume()}})),!t.annotationLayer&&t.#t!==Gt.DISABLE){const{annotationStorage:S,annotationEditorUIManager:L,downloadManager:z,enableScripting:H,fieldObjectsPromise:W,hasJSActionsPromise:$,linkService:et}=t.#s;t._annotationCanvasMap||=new Map,t.annotationLayer=new Ys({pdfPage:s,annotationStorage:S,imageResourcesPath:t.imageResourcesPath,renderForms:t.#t===Gt.ENABLE_FORMS,linkService:et,downloadManager:z,enableScripting:H,hasJSActionsPromise:$,fieldObjectsPromise:W,annotationCanvasMap:t._annotationCanvasMap,accessibilityManager:t._accessibilityManager,annotationEditorUIManager:L,onAppend:k=>{t.#g(k,"annotationLayer")}})}const{width:h,height:c}=r,d=document.createElement("canvas");d.setAttribute("role","presentation"),d.hidden=!0;const u=!(!n?.background||!n?.foreground);let f=S=>{(!u||S)&&(d.hidden=!1,f=null)};a.append(d),t.canvas=d;const p=d.getContext("2d",{alpha:!1,willReadFrequently:!t.#e}),g=t.outputScale=new Ih;if(0===t.maxCanvasPixels){const S=1/t.scale;g.sx*=S,g.sy*=S,t.#i=!0}else if(t.maxCanvasPixels>0){const L=Math.sqrt(t.maxCanvasPixels/(h*c));g.sx>L||g.sy>L?(g.sx=L,g.sy=L,t.#i=!0):t.#i=!1}const b=Ns(g.sx),m=Ns(g.sy),v=d.width=ci(di(h*g.sx),b[0]),A=d.height=ci(di(c*g.sy),m[0]),w=ci(di(h),b[1]),E=ci(di(c),m[1]);g.sx=v/w,g.sy=A/E,t.#h!==b[1]&&(e.style.setProperty("--scale-round-x",`${b[1]}px`),t.#h=b[1]),t.#c!==m[1]&&(e.style.setProperty("--scale-round-y",`${m[1]}px`),t.#c=m[1]),t.#p.set(d,r);const M={canvasContext:p,transform:g.scaled?[g.sx,0,0,g.sy,0,0]:null,viewport:r,annotationMode:t.#t,optionalContentConfigPromise:t._optionalContentConfigPromise,annotationCanvasMap:t._annotationCanvasMap,pageColors:n,isEditing:t.#n},T=t.renderTask=s.render(M);T.onContinue=S=>{if(f?.(!1),t.renderingQueue&&!t.renderingQueue.isHighestPriority(t))return t.renderingState=tt.PAUSED,void(t.resume=()=>{t.renderingState=tt.RUNNING,S()});S()};const y=T.promise.then((0,x.A)(function*(){f?.(!0),yield t.#x(T),t.structTreeLayer||=new br(s,r.rawDims),t.#w(),t.annotationLayer&&(yield t.#_());const{annotationEditorUIManager:S}=t.#s;S&&(t.drawLayer||=new Dc({pageIndex:t.id}),yield t.#E(),t.drawLayer.setParent(a),t.annotationEditorLayer||=new Ic({uiManager:S,pdfPage:s,l10n:i,structTreeLayer:t.structTreeLayer,accessibilityManager:t._accessibilityManager,annotationLayer:t.annotationLayer?.annotationLayer,textLayer:t.textLayer,drawLayer:t.drawLayer.getDrawLayer(),onAppend:L=>{t.#g(L,"annotationEditorLayer")}}),t.#A())}),S=>(S instanceof hn||f?.(!0),t.#x(T,S)));if(s.isPureXfa){if(!t.xfaLayer){const{annotationStorage:S,linkService:L}=t.#s;t.xfaLayer=new _r({pdfPage:s,annotationStorage:S,linkService:L})}t.#y()}return e.setAttribute("data-loaded",!0),t.eventBus.dispatch("pagerender",{source:t,pageNumber:t.id}),y})()}setPageLabel(t){this.pageLabel="string"==typeof t?t:null,this.div.setAttribute("data-l10n-args",JSON.stringify({page:this.pageLabel??this.id})),null!==this.pageLabel?this.div.setAttribute("data-page-label",this.pageLabel):this.div.removeAttribute("data-page-label")}get thumbnailCanvas(){const{directDrawing:t,initialOptionalContent:e,regularAnnotations:i}=this.#u;return t&&e&&i?this.canvas:null}}function yn(){return(yn=(0,x.A)(function*(o){const e="".split("#",1)[0];let{info:i,metadata:n,contentDispositionFilename:s,contentLength:r}=yield o.getMetadata();if(!r){const{length:a}=yield o.getDownloadInfo();r=a}return{...i,baseURL:e,filesize:r,filename:s||Mh(""),metadata:n?.getRaw(),authors:n?.get("dc:creator"),numPages:o.numPages,URL:""}})).apply(this,arguments)}class jc{constructor(t){this._ready=new Promise((e,i)=>{import(t).then(s=>{e(s.QuickJSSandbox())}).catch(i)})}createSandbox(t){var e=this;return(0,x.A)(function*(){(yield e._ready).create(t)})()}dispatchEventInSandbox(t){var e=this;return(0,x.A)(function*(){const i=yield e._ready;setTimeout(()=>i.dispatchEvent(t),0)})()}destroySandbox(){var t=this;return(0,x.A)(function*(){(yield t._ready).nukeSandbox()})()}}class Hc{#t=null;#e=null;#i=null;#n=null;#s=null;#r=null;#l=null;#h=null;#c=!1;#o=null;#d=null;constructor({eventBus:t,externalServices:e=null,docProperties:i=null}){this.#s=t,this.#r=e,this.#i=i}setViewer(t){this.#h=t}setDocument(t){var e=this;return(0,x.A)(function*(){if(e.#l&&(yield e.#g()),e.#l=t,!t)return;const[i,n,s]=yield Promise.all([t.getFieldObjects(),t.getCalculationOrderIds(),t.getJSActions()]);if(!i&&!s)return void(yield e.#g());if(t!==e.#l)return;try{e.#o=e.#f()}catch(l){return console.error(`setDocument: "${l.message}".`),void(yield e.#g())}const r=e.#s;e.#n=new AbortController;const{signal:a}=e.#n;r._on("updatefromsandbox",l=>{l?.source===window&&e.#a(l.detail)},{signal:a}),r._on("dispatcheventinsandbox",l=>{e.#o?.dispatchEventInSandbox(l.detail)},{signal:a}),r._on("pagechanging",({pageNumber:l,previous:h})=>{l!==h&&(e.#p(h),e.#u(l))},{signal:a}),r._on("pagerendered",({pageNumber:l})=>{e._pageOpenPending.has(l)&&l===e.#h.currentPageNumber&&e.#u(l)},{signal:a}),r._on("pagesdestroy",(0,x.A)(function*(){yield e.#p(e.#h.currentPageNumber),yield e.#o?.dispatchEventInSandbox({id:"doc",name:"WillClose"}),e.#t?.resolve()}),{signal:a});try{const l=yield e.#i(t);if(t!==e.#l)return;yield e.#o.createSandbox({objects:i,calculationOrder:n,appInfo:{platform:navigator.platform,language:navigator.language},docInfo:{...l,actions:s}}),r.dispatch("sandboxcreated",{source:e})}catch(l){return console.error(`setDocument: "${l.message}".`),void(yield e.#g())}yield e.#o?.dispatchEventInSandbox({id:"doc",name:"Open"}),yield e.#u(e.#h.currentPageNumber,!0),Promise.resolve().then(()=>{t===e.#l&&(e.#c=!0)})})()}dispatchWillSave(){var t=this;return(0,x.A)(function*(){return t.#o?.dispatchEventInSandbox({id:"doc",name:"WillSave"})})()}dispatchDidSave(){var t=this;return(0,x.A)(function*(){return t.#o?.dispatchEventInSandbox({id:"doc",name:"DidSave"})})()}dispatchWillPrint(){var t=this;return(0,x.A)(function*(){if(t.#o){yield t.#d?.promise,t.#d=Promise.withResolvers();try{yield t.#o.dispatchEventInSandbox({id:"doc",name:"WillPrint"})}catch(e){throw t.#d.resolve(),t.#d=null,e}yield t.#d.promise}})()}dispatchDidPrint(){var t=this;return(0,x.A)(function*(){return t.#o?.dispatchEventInSandbox({id:"doc",name:"DidPrint"})})()}get destroyPromise(){return this.#e?.promise||null}get ready(){return this.#c}get _pageOpenPending(){return gi(this,"_pageOpenPending",new Set)}get _visitedPages(){return gi(this,"_visitedPages",new Map)}#a(t){var e=this;return(0,x.A)(function*(){const i=e.#h,n=i.isInPresentationMode||i.isChangingPresentationMode,{id:s,siblings:r,command:a,value:l}=t;if(!s){switch(a){case"clear":console.clear();break;case"error":console.error(l);break;case"layout":if(!n){const c=function Jl(o){let t=G.VERTICAL,e=mt.NONE;switch(o){case"SinglePage":t=G.PAGE;break;case"OneColumn":break;case"TwoPageLeft":t=G.PAGE;case"TwoColumnLeft":e=mt.ODD;break;case"TwoPageRight":t=G.PAGE;case"TwoColumnRight":e=mt.EVEN}return{scrollMode:t,spreadMode:e}}(l);i.spreadMode=c.spreadMode}break;case"page-num":i.currentPageNumber=l+1;break;case"print":yield i.pagesPromise,e.#s.dispatch("print",{source:e});break;case"println":console.log(l);break;case"zoom":n||(i.currentScaleValue=l);break;case"SaveAs":e.#s.dispatch("download",{source:e});break;case"FirstPage":i.currentPageNumber=1;break;case"LastPage":i.currentPageNumber=i.pagesCount;break;case"NextPage":i.nextPage();break;case"PrevPage":i.previousPage();break;case"ZoomViewIn":n||i.increaseScale();break;case"ZoomViewOut":n||i.decreaseScale();break;case"WillPrintFinished":e.#d?.resolve(),e.#d=null}return}if(n&&t.focus)return;delete t.id,delete t.siblings;const h=r?[s,...r]:[s];for(const c of h){const d=document.querySelector(`[data-element-id="${c}"]`);d?d.dispatchEvent(new CustomEvent("updatefromsandbox",{detail:t})):e.#l?.annotationStorage.setValue(c,t)}})()}#u(t){var e=this;return(0,x.A)(function*(i,n=!1){const s=e.#l,r=e._visitedPages;if(n&&(e.#t=Promise.withResolvers()),!e.#t)return;const a=e.#h.getPageView(i-1);if(a?.renderingState!==tt.FINISHED)return void e._pageOpenPending.add(i);e._pageOpenPending.delete(i);const l=(0,x.A)(function*(){const h=yield r.has(i)?null:a.pdfPage?.getJSActions();s===e.#l&&(yield e.#o?.dispatchEventInSandbox({id:"page",name:"PageOpen",pageNumber:i,actions:h}))})();r.set(i,l)}).apply(this,arguments)}#p(t){var e=this;return(0,x.A)(function*(){const i=e.#l,n=e._visitedPages;if(!e.#t||e._pageOpenPending.has(t))return;const s=n.get(t);s&&(n.set(t,null),yield s,i===e.#l&&(yield e.#o?.dispatchEventInSandbox({id:"page",name:"PageClose",pageNumber:t})))})()}#f(){if(this.#e=Promise.withResolvers(),this.#o)throw new Error("#initScripting: Scripting already exists.");return this.#r.createScripting()}#g(){var t=this;return(0,x.A)(function*(){if(!t.#o)return t.#l=null,void t.#e?.resolve();t.#t&&(yield Promise.race([t.#t.promise,new Promise(e=>{setTimeout(e,1e3)})]).catch(()=>{}),t.#t=null),t.#l=null;try{yield t.#o.destroySandbox()}catch{}t.#d?.reject(new Error("Scripting destroyed.")),t.#d=null,t.#n?.abort(),t.#n=null,t._pageOpenPending.clear(),t._visitedPages.clear(),t.#o=null,t.#c=!1,t.#e?.resolve()})()}}class zc extends Hc{constructor(t){t.externalServices||window.addEventListener("updatefromsandbox",e=>{t.eventBus.dispatch("updatefromsandbox",{source:window,detail:e.detail})}),t.externalServices||={createScripting:()=>new jc(t.sandboxBundleSrc)},t.docProperties||=e=>function Vc(o){return yn.apply(this,arguments)}(e),super(t)}}class Uc{constructor(){this.pdfViewer=null,this.pdfThumbnailViewer=null,this.onIdle=null,this.highestPriorityPage=null,this.idleTimeout=null,this.printing=!1,this.isThumbnailViewEnabled=!1,Object.defineProperty(this,"hasViewer",{value:()=>!!this.pdfViewer})}setViewer(t){this.pdfViewer=t}setThumbnailViewer(t){this.pdfThumbnailViewer=t}isHighestPriority(t){return this.highestPriorityPage===t.renderingId}renderHighestPriority(t){this.idleTimeout&&(clearTimeout(this.idleTimeout),this.idleTimeout=null),!this.pdfViewer.forceRendering(t)&&(this.isThumbnailViewEnabled&&this.pdfThumbnailViewer?.forceRendering()||this.printing||this.onIdle&&(this.idleTimeout=setTimeout(this.onIdle.bind(this),3e4)))}getHighestPriority(t,e,i,n=!1){const s=t.views,r=s.length;if(0===r)return null;for(let d=0;d<r;d++){const u=s[d].view;if(!this.isViewFinished(u))return u}const a=t.first.id,l=t.last.id;if(l-a+1>r){const d=t.ids;for(let u=1,f=l-a;u<f;u++){const p=i?a+u:l-u;if(d.has(p))continue;const g=e[p-1];if(!this.isViewFinished(g))return g}}let h=i?l:a-2,c=e[h];return c&&!this.isViewFinished(c)||n&&(h+=i?1:-1,c=e[h],c&&!this.isViewFinished(c))?c:null}isViewFinished(t){return t.renderingState===tt.FINISHED}renderView(t){switch(t.renderingState){case tt.FINISHED:return!1;case tt.PAUSED:this.highestPriorityPage=t.renderingId,t.resume();break;case tt.RUNNING:this.highestPriorityPage=t.renderingId;break;case tt.INITIAL:this.highestPriorityPage=t.renderingId,t.draw().finally(()=>{this.renderHighestPriority()}).catch(e=>{e instanceof hn||console.error(`renderView: "${e}"`)})}return!0}}function yr(o){return Object.values(St).includes(o)&&o!==St.DISABLE}class Gc{#t=new Set;#e=0;constructor(t){this.#e=t}push(t){const e=this.#t;e.has(t)&&e.delete(t),e.add(t),e.size>this.#e&&this.#i()}resize(t,e=null){this.#e=t;const i=this.#t;if(e){const n=i.size;let s=1;for(const r of i)if(e.has(r.id)&&(i.delete(r),i.add(r)),++s>n)break}for(;i.size>this.#e;)this.#i()}has(t){return this.#t.has(t)}[Symbol.iterator](){return this.#t.keys()}#i(){const t=this.#t.keys().next().value;t?.destroy(),this.#t.delete(t)}}class wr{#t=null;#e=null;#i=null;#n=St.NONE;#s=null;#r=Gt.ENABLE_FORMS;#l=null;#h=!1;#c=!1;#o=!1;#d=!1;#a=!1;#u=null;#p=null;#f=null;#g=null;#b=!1;#m=null;#_=!1;#A=0;#E=new ResizeObserver(this.#B.bind(this));#y=null;#w=null;#L=1;constructor(t){const e="4.8.69";if(Xs!==e)throw new Error(`The API version "${Xs}" does not match the Viewer version "${e}".`);if(this.container=t.container,this.viewer=t.viewer||t.container.firstElementChild,"DIV"!==this.container?.tagName||"DIV"!==this.viewer?.tagName)throw new Error("Invalid `container` and/or `viewer` option.");if(this.container.offsetParent&&"absolute"!==getComputedStyle(this.container).position)throw new Error("The `container` must be absolutely positioned.");this.#E.observe(this.container),this.eventBus=t.eventBus,this.linkService=t.linkService||new ln,this.downloadManager=t.downloadManager||null,this.findController=t.findController||null,this.#e=t.altTextManager||null,this.findController&&(this.findController.onIsPageVisible=n=>this._getVisiblePages().ids.has(n)),this._scriptingManager=t.scriptingManager||null,this.#L=t.textLayerMode??1,this.#r=t.annotationMode??Gt.ENABLE_FORMS,this.#n=t.annotationEditorMode??St.NONE,this.#i=t.annotationEditorHighlightColors||null,this.#c=!0===t.enableHighlightFloatingButton,this.#d=!0===t.enableUpdatedAddImage,this.#a=!0===t.enableNewAltTextWhenAddingImage,this.imageResourcesPath=t.imageResourcesPath||"",this.enablePrintAutoRotate=t.enablePrintAutoRotate||!1,this.removePageBorders=t.removePageBorders||!1,this.maxCanvasPixels=t.maxCanvasPixels,this.l10n=t.l10n,this.l10n||=new Yt,this.#o=t.enablePermissions||!1,this.pageColors=t.pageColors||null,this.#p=t.mlManager||null,this.#h=t.enableHWA||!1,this.defaultRenderingQueue=!t.renderingQueue,this.defaultRenderingQueue?(this.renderingQueue=new Uc,this.renderingQueue.setViewer(this)):this.renderingQueue=t.renderingQueue;const{abortSignal:i}=t;i?.addEventListener("abort",()=>{this.#E.disconnect(),this.#E=null},{once:!0}),this.scroll=function Ul(o,t,e){const i=function(r){s||(s=window.requestAnimationFrame(function(){s=null;const l=o.scrollLeft,h=n.lastX;l!==h&&(n.right=l>h),n.lastX=l;const c=o.scrollTop,d=n.lastY;c!==d&&(n.down=c>d),n.lastY=c,t(n)}))},n={right:!0,down:!0,lastX:o.scrollLeft,lastY:o.scrollTop,_eventHandler:i};let s=null;return o.addEventListener("scroll",i,{useCapture:!0,signal:e}),e?.addEventListener("abort",()=>window.cancelAnimationFrame(s),{once:!0}),n}(this.container,this._scrollUpdate.bind(this),i),this.presentationModeState=0,this._resetView(),this.removePageBorders&&this.viewer.classList.add("removePageBorders"),this.#F(),this.eventBus._on("thumbnailrendered",({pageNumber:n,pdfPage:s})=>{this.#t.has(this._pages[n-1])||s?.cleanup()}),t.l10n||this.l10n.translate(this.container)}get pagesCount(){return this._pages.length}getPageView(t){return this._pages[t]}getCachedPageViews(){return new Set(this.#t)}get pageViewsReady(){return this._pages.every(t=>t?.pdfPage)}get renderForms(){return this.#r===Gt.ENABLE_FORMS}get enableScripting(){return!!this._scriptingManager}get currentPageNumber(){return this._currentPageNumber}set currentPageNumber(t){if(!Number.isInteger(t))throw new Error("Invalid page number.");this.pdfDocument&&(this._setCurrentPageNumber(t,!0)||console.error(`currentPageNumber: "${t}" is not a valid page.`))}_setCurrentPageNumber(t,e=!1){if(this._currentPageNumber===t)return e&&this.#I(),!0;if(!(0<t&&t<=this.pagesCount))return!1;const i=this._currentPageNumber;return this._currentPageNumber=t,this.eventBus.dispatch("pagechanging",{source:this,pageNumber:t,pageLabel:this._pageLabels?.[t-1]??null,previous:i}),e&&this.#I(),!0}get currentPageLabel(){return this._pageLabels?.[this._currentPageNumber-1]??null}set currentPageLabel(t){if(!this.pdfDocument)return;let e=0|t;if(this._pageLabels){const i=this._pageLabels.indexOf(t);i>=0&&(e=i+1)}this._setCurrentPageNumber(e,!0)||console.error(`currentPageLabel: "${t}" is not a valid page.`)}get currentScale(){return 0!==this._currentScale?this._currentScale:1}set currentScale(t){if(isNaN(t))throw new Error("Invalid numeric scale.");this.pdfDocument&&this.#M(t,{noScroll:!1})}get currentScaleValue(){return this._currentScaleValue}set currentScaleValue(t){this.pdfDocument&&this.#M(t,{noScroll:!1})}get pagesRotation(){return this._pagesRotation}set pagesRotation(t){if(!Bs(t))throw new Error("Invalid pages rotation angle.");if(!this.pdfDocument||((t%=360)<0&&(t+=360),this._pagesRotation===t))return;this._pagesRotation=t;const e=this._currentPageNumber;this.refresh(!0,{rotation:t}),this._currentScaleValue&&this.#M(this._currentScaleValue,{noScroll:!0}),this.eventBus.dispatch("rotationchanging",{source:this,pagesRotation:t,pageNumber:e}),this.defaultRenderingQueue&&this.update()}get firstPagePromise(){return this.pdfDocument?this._firstPageCapability.promise:null}get onePageRendered(){return this.pdfDocument?this._onePageRenderedCapability.promise:null}get pagesPromise(){return this.pdfDocument?this._pagesCapability.promise:null}get _layerProperties(){const t=this;return gi(this,"_layerProperties",{get annotationEditorUIManager(){return t.#s},get annotationStorage(){return t.pdfDocument?.annotationStorage},get downloadManager(){return t.downloadManager},get enableScripting(){return!!t._scriptingManager},get fieldObjectsPromise(){return t.pdfDocument?.getFieldObjects()},get findController(){return t.findController},get hasJSActionsPromise(){return t.pdfDocument?.hasJSActions()},get linkService(){return t.linkService}})}#P(t){const e={annotationEditorMode:this.#n,annotationMode:this.#r,textLayerMode:this.#L};return t&&(!t.includes(pi.COPY)&&1===this.#L&&(e.textLayerMode=2),t.includes(pi.MODIFY_CONTENTS)||(e.annotationEditorMode=St.DISABLE),!t.includes(pi.MODIFY_ANNOTATIONS)&&!t.includes(pi.FILL_INTERACTIVE_FORMS)&&this.#r===Gt.ENABLE_FORMS&&(e.annotationMode=Gt.ENABLE)),e}#x(t){var e=this;return(0,x.A)(function*(){if("hidden"===document.visibilityState||!e.container.offsetParent||0===e._getVisiblePages().views.length)return;const i=Promise.withResolvers(),n=new AbortController;document.addEventListener("visibilitychange",()=>{"hidden"===document.visibilityState&&i.resolve()},{signal:"function"==typeof AbortSignal.any?AbortSignal.any([t,n.signal]):t}),yield Promise.race([e._onePageRenderedCapability.promise,i.promise]),n.abort()})()}getAllText(){var t=this;return(0,x.A)(function*(){const e=[],i=[];for(let n=1,s=t.pdfDocument.numPages;n<=s;++n){if(t.#_)return null;i.length=0;const r=yield t.pdfDocument.getPage(n),{items:a}=yield r.getTextContent();for(const l of a)l.str&&i.push(l.str),l.hasEOL&&i.push("\n");e.push(Fe(i.join("")))}return e.join("\n")})()}#T(t,e){const i=document.getSelection(),{focusNode:n,anchorNode:s}=i;if(s&&n&&i.containsNode(this.#m)){if(this.#b||2===t)return e.preventDefault(),void e.stopPropagation();this.#b=!0;const{classList:r}=this.viewer;r.add("copyAll");const a=new AbortController;window.addEventListener("keydown",l=>this.#_="Escape"===l.key,{signal:a.signal}),this.getAllText().then(function(){var l=(0,x.A)(function*(h){null!==h&&(yield navigator.clipboard.writeText(h))});return function(h){return l.apply(this,arguments)}}()).catch(l=>{console.warn(`Something goes wrong when extracting the text: ${l.message}`)}).finally(()=>{this.#b=!1,this.#_=!1,a.abort(),r.remove("copyAll")}),e.preventDefault(),e.stopPropagation()}}setDocument(t){var e=this;if(this.pdfDocument&&(this.eventBus.dispatch("pagesdestroy",{source:this}),this._cancelRendering(),this._resetView(),this.findController?.setDocument(null),this._scriptingManager?.setDocument(null),this.#s?.destroy(),this.#s=null),this.pdfDocument=t,!t)return;const i=t.numPages,n=t.getPage(1),s=t.getOptionalContentConfig({intent:"display"}),r=this.#o?t.getPermissions():Promise.resolve(),{eventBus:a,pageColors:l,viewer:h}=this;this.#u=new AbortController;const{signal:c}=this.#u;if(i>1e4){console.warn("Forcing PAGE-scrolling for performance reasons, given the length of the document.");const f=this._scrollMode=G.PAGE;a.dispatch("scrollmodechanged",{source:this,mode:f})}this._pagesCapability.promise.then(()=>{a.dispatch("pagesloaded",{source:this,pagesCount:i})},()=>{}),a._on("pagerender",f=>{const p=this._pages[f.pageNumber-1];p&&this.#t.push(p)},{signal:c});const u=f=>{f.cssTransform||(this._onePageRenderedCapability.resolve({timestamp:f.timestamp}),a._off("pagerendered",u))};a._on("pagerendered",u,{signal:c}),Promise.all([n,r]).then(([f,p])=>{if(t!==this.pdfDocument)return;this._firstPageCapability.resolve(f),this._optionalContentConfigPromise=s;const{annotationEditorMode:g,annotationMode:b,textLayerMode:m}=this.#P(p);if(0!==m){const E=this.#m=document.createElement("div");E.id="hiddenCopyElement",h.before(E)}if("function"==typeof AbortSignal.any&&g!==St.DISABLE){const E=g;t.isPureXfa?console.warn("Warning: XFA-editing is not implemented."):yr(E)?(this.#s=new Ch(this.container,h,this.#e,a,t,l,this.#i,this.#c,this.#d,this.#a,this.#p),a.dispatch("annotationeditoruimanager",{source:this,uiManager:this.#s}),E!==St.NONE&&(E===St.STAMP&&this.#p?.loadModel("altText"),this.#s.updateMode(E))):console.error(`Invalid AnnotationEditor mode: ${E}`)}const v=this._scrollMode===G.PAGE?null:h,A=this.currentScale,w=f.getViewport({scale:A*$t.PDF_TO_CSS_UNITS});h.style.setProperty("--scale-factor",w.scale),l?.background&&h.style.setProperty("--page-bg-color",l.background),("CanvasText"===l?.foreground||"Canvas"===l?.background)&&(h.style.setProperty("--hcm-highlight-filter",t.filterFactory.addHighlightHCMFilter("highlight","CanvasText","Canvas","HighlightText","Highlight")),h.style.setProperty("--hcm-highlight-selected-filter",t.filterFactory.addHighlightHCMFilter("highlight_selected","CanvasText","Canvas","HighlightText","ButtonText")));for(let E=1;E<=i;++E){const C=new vr({container:v,eventBus:a,id:E,scale:A,defaultViewport:w.clone(),optionalContentConfigPromise:s,renderingQueue:this.renderingQueue,textLayerMode:m,annotationMode:b,imageResourcesPath:this.imageResourcesPath,maxCanvasPixels:this.maxCanvasPixels,pageColors:l,l10n:this.l10n,layerProperties:this._layerProperties,enableHWA:this.#h});this._pages.push(C)}this._pages[0]?.setPdfPage(f),this._scrollMode===G.PAGE?this.#S():this._spreadMode!==mt.NONE&&this._updateSpreadMode(),this.#x(c).then((0,x.A)(function*(){if(t!==e.pdfDocument)return;if(e.findController?.setDocument(t),e._scriptingManager?.setDocument(t),e.#m&&document.addEventListener("copy",e.#T.bind(e,m),{signal:c}),e.#s&&a.dispatch("annotationeditormodechanged",{source:e,mode:e.#n}),t.loadingParams.disableAutoFetch||i>5e3)return void e._pagesCapability.resolve();let E=i-1;if(E<=0)e._pagesCapability.resolve();else for(let C=2;C<=i;++C){const M=t.getPage(C).then(T=>{const y=e._pages[C-1];y.pdfPage||y.setPdfPage(T),0===--E&&e._pagesCapability.resolve()},T=>{console.error(`Unable to get page ${C} to initialize viewer`,T),0===--E&&e._pagesCapability.resolve()});C%250==0&&(yield M)}})),a.dispatch("pagesinit",{source:this}),t.getMetadata().then(({info:E})=>{t===this.pdfDocument&&E.Language&&(h.lang=E.Language)}),this.defaultRenderingQueue&&this.update()}).catch(f=>{console.error("Unable to initialize viewer",f),this._pagesCapability.reject(f)})}setPageLabels(t){if(this.pdfDocument){t?Array.isArray(t)&&this.pdfDocument.numPages===t.length?this._pageLabels=t:(this._pageLabels=null,console.error("setPageLabels: Invalid page labels.")):this._pageLabels=null;for(let e=0,i=this._pages.length;e<i;e++)this._pages[e].setPageLabel(this._pageLabels?.[e]??null)}}_resetView(){this._pages=[],this._currentPageNumber=1,this._currentScale=0,this._currentScaleValue=null,this._pageLabels=null,this.#t=new Gc(10),this._location=null,this._pagesRotation=0,this._optionalContentConfigPromise=null,this._firstPageCapability=Promise.withResolvers(),this._onePageRenderedCapability=Promise.withResolvers(),this._pagesCapability=Promise.withResolvers(),this._scrollMode=G.VERTICAL,this._previousScrollMode=G.UNKNOWN,this._spreadMode=mt.NONE,this.#y={previousPageNumber:1,scrollDown:!0,pages:[]},this.#u?.abort(),this.#u=null,this.viewer.textContent="",this._updateScrollMode(),this.viewer.removeAttribute("lang"),this.#m?.remove(),this.#m=null,this.#V()}#S(){if(this._scrollMode!==G.PAGE)throw new Error("#ensurePageViewVisible: Invalid scrollMode value.");const t=this._currentPageNumber,e=this.#y,i=this.viewer;if(i.textContent="",e.pages.length=0,this._spreadMode!==mt.NONE||this.isInPresentationMode){const n=new Set,s=this._spreadMode-1;-1===s?n.add(t-1):t%2!==s?(n.add(t-1),n.add(t)):(n.add(t-2),n.add(t-1));const r=document.createElement("div");if(r.className="spread",this.isInPresentationMode){const a=document.createElement("div");a.className="dummyPage",r.append(a)}for(const a of n){const l=this._pages[a];l&&(r.append(l.div),e.pages.push(l))}i.append(r)}else{const n=this._pages[t-1];i.append(n.div),e.pages.push(n)}e.scrollDown=t>=e.previousPageNumber,e.previousPageNumber=t}_scrollUpdate(){0!==this.pagesCount&&this.update()}#R(t,e=null){const{div:i,id:n}=t;if(this._currentPageNumber!==n&&this._setCurrentPageNumber(n),this._scrollMode===G.PAGE&&(this.#S(),this.update()),!e&&!this.isInPresentationMode){const s=i.offsetLeft+i.clientLeft,r=s+i.clientWidth,{scrollLeft:a,clientWidth:l}=this.container;(this._scrollMode===G.HORIZONTAL||s<a||r>a+l)&&(e={left:0,top:0})}Os(i,e),!this._currentScaleValue&&this._location&&(this._location=null)}#k(t){return t===this._currentScale||Math.abs(t-this._currentScale)<1e-15}#C(t,e,{noScroll:i=!1,preset:n=!1,drawingDelay:s=-1,origin:r=null}){if(this._currentScaleValue=e.toString(),this.#k(t))return void(n&&this.eventBus.dispatch("scalechanging",{source:this,scale:t,presetValue:e}));this.viewer.style.setProperty("--scale-factor",t*$t.PDF_TO_CSS_UNITS);const a=s>=0&&s<1e3;this.refresh(!0,{scale:t,drawingDelay:a?s:-1}),a&&(this.#w=setTimeout(()=>{this.#w=null,this.refresh()},s));const l=this._currentScale;if(this._currentScale=t,!i){let c,h=this._currentPageNumber;if(this._location&&!(this.isInPresentationMode||this.isChangingPresentationMode)&&(h=this._location.pageNumber,c=[null,{name:"XYZ"},this._location.left,this._location.top,null]),this.scrollPageIntoView({pageNumber:h,destArray:c,allowNegativeOffset:!0}),Array.isArray(r)){const d=t/l-1,[u,f]=this.containerTopLeft;this.container.scrollLeft+=(r[0]-f)*d,this.container.scrollTop+=(r[1]-u)*d}}this.eventBus.dispatch("scalechanging",{source:this,scale:t,presetValue:n?e:void 0}),this.defaultRenderingQueue&&this.update()}get#v(){return this._spreadMode!==mt.NONE&&this._scrollMode!==G.HORIZONTAL?2:1}#M(t,e){let i=parseFloat(t);if(i>0)e.preset=!1,this.#C(i,t,e);else{const n=this._pages[this._currentPageNumber-1];if(!n)return;let s=40,r=5;this.isInPresentationMode?(s=r=4,this._spreadMode!==mt.NONE&&(s*=2)):this.removePageBorders?s=r=0:this._scrollMode===G.HORIZONTAL&&([s,r]=[r,s]);const a=(this.container.clientWidth-s)/n.width*n.scale/this.#v,l=(this.container.clientHeight-r)/n.height*n.scale;switch(t){case"page-actual":i=1;break;case"page-width":i=a;break;case"page-height":i=l;break;case"page-fit":i=Math.min(a,l);break;case"auto":const h=Vs(n)?a:Math.min(l,a);i=Math.min(1.25,h);break;default:return void console.error(`#setScale: "${t}" is an unknown zoom value.`)}e.preset=!0,this.#C(i,t,e)}}#I(){const t=this._pages[this._currentPageNumber-1];this.isInPresentationMode&&this.#M(this._currentScaleValue,{noScroll:!0}),this.#R(t)}pageLabelToPageNumber(t){if(!this._pageLabels)return null;const e=this._pageLabels.indexOf(t);return e<0?null:e+1}scrollPageIntoView({pageNumber:t,destArray:e=null,allowNegativeOffset:i=!1,ignoreDestinationZoom:n=!1}){if(!this.pdfDocument)return;const s=Number.isInteger(t)&&this._pages[t-1];if(!s)return void console.error(`scrollPageIntoView: "${t}" is not a valid pageNumber parameter.`);if(this.isInPresentationMode||!e)return void this._setCurrentPageNumber(t,!0);let c,d,r=0,a=0,l=0,h=0;const u=s.rotation%180!=0,f=(u?s.height:s.width)/s.scale/$t.PDF_TO_CSS_UNITS,p=(u?s.width:s.height)/s.scale/$t.PDF_TO_CSS_UNITS;let g=0;switch(e[1].name){case"XYZ":r=e[2],a=e[3],g=e[4],r=null!==r?r:0,a=null!==a?a:p;break;case"Fit":case"FitB":g="page-fit";break;case"FitH":case"FitBH":a=e[2],g="page-width",null===a&&this._location?(r=this._location.left,a=this._location.top):("number"!=typeof a||a<0)&&(a=p);break;case"FitV":case"FitBV":r=e[2],l=f,h=p,g="page-height";break;case"FitR":r=e[2],a=e[3],l=e[4]-r,h=e[5]-a;let A=40,w=5;this.removePageBorders&&(A=w=0),c=(this.container.clientWidth-A)/l/$t.PDF_TO_CSS_UNITS,d=(this.container.clientHeight-w)/h/$t.PDF_TO_CSS_UNITS,g=Math.min(Math.abs(c),Math.abs(d));break;default:return void console.error(`scrollPageIntoView: "${e[1].name}" is not a valid destination type.`)}if(n||(g&&g!==this._currentScale?this.currentScaleValue=g:0===this._currentScale&&(this.currentScaleValue="auto")),"page-fit"===g&&!e[4])return void this.#R(s);const b=[s.viewport.convertToViewportPoint(r,a),s.viewport.convertToViewportPoint(r+l,a+h)];let m=Math.min(b[0][0],b[1][0]),v=Math.min(b[0][1],b[1][1]);i||(m=Math.max(m,0),v=Math.max(v,0)),this.#R(s,{left:m,top:v})}_updateLocation(t){const e=this._currentScale,i=this._currentScaleValue,n=parseFloat(i)===e?Math.round(1e4*e)/100:i,s=t.id,a=this.container,l=this._pages[s-1].getPagePoint(a.scrollLeft-t.x,a.scrollTop-t.y),h=Math.round(l[0]),c=Math.round(l[1]);let d=`#page=${s}`;this.isInPresentationMode||(d+=`&zoom=${n},${h},${c}`),this._location={pageNumber:s,scale:n,top:c,left:h,rotation:this._pagesRotation,pdfOpenParams:d}}update(){const t=this._getVisiblePages(),e=t.views,i=e.length;if(0===i)return;const n=Math.max(10,2*i+1);this.#t.resize(n,t.ids),this.renderingQueue.renderHighestPriority(t);const s=this._spreadMode===mt.NONE&&(this._scrollMode===G.PAGE||this._scrollMode===G.VERTICAL),r=this._currentPageNumber;let a=!1;for(const l of e){if(l.percent<100)break;if(l.id===r&&s){a=!0;break}}this._setCurrentPageNumber(a?r:e[0].id),this._updateLocation(t.first),this.eventBus.dispatch("updateviewarea",{source:this,location:this._location})}#N(){const t=this._getVisiblePages(),e=[],{ids:i,views:n}=t;for(const s of n){const{view:r}=s;r.hasEditableAnnotations()?e.push(s):i.delete(r.id)}return 0===e.length?null:(this.renderingQueue.renderHighestPriority({first:e[0],last:e.at(-1),views:e,ids:i}),i)}containsElement(t){return this.container.contains(t)}focus(){this.container.focus()}get _isContainerRtl(){return"rtl"===getComputedStyle(this.container).direction}get isInPresentationMode(){return 3===this.presentationModeState}get isChangingPresentationMode(){return 2===this.presentationModeState}get isHorizontalScrollbarEnabled(){return!this.isInPresentationMode&&this.container.scrollWidth>this.container.clientWidth}get isVerticalScrollbarEnabled(){return!this.isInPresentationMode&&this.container.scrollHeight>this.container.clientHeight}_getVisiblePages(){const t=this._scrollMode===G.PAGE?this.#y.pages:this._pages,e=this._scrollMode===G.HORIZONTAL;return function $l({scrollEl:o,views:t,sortByVisibility:e=!1,horizontal:i=!1,rtl:n=!1}){const s=o.scrollTop,r=s+o.clientHeight,a=o.scrollLeft,l=a+o.clientWidth,d=[],u=new Set,f=t.length;let p=Ne(t,i?function c(v){const A=v.div,w=A.offsetLeft+A.clientLeft;return n?w<l:w+A.clientWidth>a}:function h(v){const A=v.div;return A.offsetTop+A.clientTop+A.clientHeight>s});p>0&&p<f&&!i&&(p=function Gl(o,t,e){if(o<2)return o;let i=t[o].div,n=i.offsetTop+i.clientTop;n>=e&&(i=t[o-1].div,n=i.offsetTop+i.clientTop);for(let s=o-2;s>=0&&(i=t[s].div,!(i.offsetTop+i.clientTop+i.clientHeight<=n));--s)o=s;return o}(p,t,s));let g=i?l:-1;for(let v=p;v<f;v++){const A=t[v],w=A.div,E=w.offsetLeft+w.clientLeft,C=w.offsetTop+w.clientTop,M=w.clientWidth,T=w.clientHeight,y=E+M,S=C+T;if(-1===g)S>=r&&(g=S);else if((i?E:C)>g)break;if(S<=s||C>=r||y<=a||E>=l)continue;const L=Math.max(0,s-C)+Math.max(0,S-r),W=(M-(Math.max(0,a-E)+Math.max(0,y-l)))/M;d.push({id:A.id,x:E,y:C,view:A,percent:(T-L)/T*W*100|0,widthPercent:100*W|0}),u.add(A.id)}const b=d[0],m=d.at(-1);return e&&d.sort(function(v,A){const w=v.percent-A.percent;return Math.abs(w)>.001?-w:v.id-A.id}),{first:b,last:m,views:d,ids:u}}({scrollEl:this.container,views:t,sortByVisibility:!0,horizontal:e,rtl:e&&this._isContainerRtl})}cleanup(){for(const t of this._pages)t.renderingState!==tt.FINISHED&&t.reset()}_cancelRendering(){for(const t of this._pages)t.cancelRendering()}#H(t){var e=this;return(0,x.A)(function*(){if(t.pdfPage)return t.pdfPage;try{const i=yield e.pdfDocument.getPage(t.id);return t.pdfPage||t.setPdfPage(i),i}catch(i){return console.error("Unable to get page for page view",i),null}})()}#j(t){if(1===t.first?.id)return!0;if(t.last?.id===this.pagesCount)return!1;switch(this._scrollMode){case G.PAGE:return this.#y.scrollDown;case G.HORIZONTAL:return this.scroll.right}return this.scroll.down}forceRendering(t){const e=t||this._getVisiblePages(),i=this.#j(e),s=this.renderingQueue.getHighestPriority(e,this._pages,i,this._spreadMode!==mt.NONE&&this._scrollMode!==G.HORIZONTAL);return!!s&&(this.#H(s).then(()=>{this.renderingQueue.renderView(s)}),!0)}get hasEqualPageSizes(){const t=this._pages[0];for(let e=1,i=this._pages.length;e<i;++e){const n=this._pages[e];if(n.width!==t.width||n.height!==t.height)return!1}return!0}getPagesOverview(){let t;return this._pages.map(e=>{const i=e.pdfPage.getViewport({scale:1}),n=Vs(i);if(void 0===t)t=n;else if(this.enablePrintAutoRotate&&n!==t)return{width:i.height,height:i.width,rotation:(i.rotation-90)%360};return{width:i.width,height:i.height,rotation:i.rotation}})}get optionalContentConfigPromise(){return this.pdfDocument?this._optionalContentConfigPromise?this._optionalContentConfigPromise:(console.error("optionalContentConfigPromise: Not initialized yet."),this.pdfDocument.getOptionalContentConfig({intent:"display"})):Promise.resolve(null)}set optionalContentConfigPromise(t){if(!(t instanceof Promise))throw new Error(`Invalid optionalContentConfigPromise: ${t}`);this.pdfDocument&&this._optionalContentConfigPromise&&(this._optionalContentConfigPromise=t,this.refresh(!1,{optionalContentConfigPromise:t}),this.eventBus.dispatch("optionalcontentconfigchanged",{source:this,promise:t}))}get scrollMode(){return this._scrollMode}set scrollMode(t){if(this._scrollMode!==t){if(!function Yl(o){return Number.isInteger(o)&&Object.values(G).includes(o)&&o!==G.UNKNOWN}(t))throw new Error(`Invalid scroll mode: ${t}`);this.pagesCount>1e4||(this._previousScrollMode=this._scrollMode,this._scrollMode=t,this.eventBus.dispatch("scrollmodechanged",{source:this,mode:t}),this._updateScrollMode(this._currentPageNumber))}}_updateScrollMode(t=null){const e=this._scrollMode,i=this.viewer;i.classList.toggle("scrollHorizontal",e===G.HORIZONTAL),i.classList.toggle("scrollWrapped",e===G.WRAPPED),this.pdfDocument&&t&&(e===G.PAGE?this.#S():this._previousScrollMode===G.PAGE&&this._updateSpreadMode(),this._currentScaleValue&&isNaN(this._currentScaleValue)&&this.#M(this._currentScaleValue,{noScroll:!0}),this._setCurrentPageNumber(t,!0),this.update())}get spreadMode(){return this._spreadMode}set spreadMode(t){if(this._spreadMode!==t){if(!function Kl(o){return Number.isInteger(o)&&Object.values(mt).includes(o)&&o!==mt.UNKNOWN}(t))throw new Error(`Invalid spread mode: ${t}`);this._spreadMode=t,this.eventBus.dispatch("spreadmodechanged",{source:this,mode:t}),this._updateSpreadMode(this._currentPageNumber)}}_updateSpreadMode(t=null){if(!this.pdfDocument)return;const e=this.viewer,i=this._pages;if(this._scrollMode===G.PAGE)this.#S();else if(e.textContent="",this._spreadMode===mt.NONE)for(const n of this._pages)e.append(n.div);else{const n=this._spreadMode-1;let s=null;for(let r=0,a=i.length;r<a;++r)null===s?(s=document.createElement("div"),s.className="spread",e.append(s)):r%2===n&&(s=s.cloneNode(!1),e.append(s)),s.append(i[r].div)}t&&(this._currentScaleValue&&isNaN(this._currentScaleValue)&&this.#M(this._currentScaleValue,{noScroll:!0}),this._setCurrentPageNumber(t,!0),this.update())}_getPageAdvance(t,e=!1){switch(this._scrollMode){case G.WRAPPED:{const{views:i}=this._getVisiblePages(),n=new Map;for(const{id:s,y:r,percent:a,widthPercent:l}of i){if(0===a||l<100)continue;let h=n.get(r);h||n.set(r,h||=[]),h.push(s)}for(const s of n.values()){const r=s.indexOf(t);if(-1===r)continue;const a=s.length;if(1===a)break;if(e)for(let l=r-1,h=0;l>=h;l--){const d=s[l+1]-1;if(s[l]<d)return t-d}else for(let l=r+1,h=a;l<h;l++){const d=s[l-1]+1;if(s[l]>d)return d-t}if(e){const l=s[0];if(l<t)return t-l+1}else{const l=s[a-1];if(l>t)return l-t+1}break}break}case G.HORIZONTAL:break;case G.PAGE:case G.VERTICAL:{if(this._spreadMode===mt.NONE)break;const i=this._spreadMode-1;if(e&&t%2!==i)break;if(!e&&t%2===i)break;const{views:n}=this._getVisiblePages(),s=e?t-1:t+1;for(const{id:r,percent:a,widthPercent:l}of n)if(r===s){if(a>0&&100===l)return 2;break}break}}return 1}nextPage(){const t=this._currentPageNumber,e=this.pagesCount;if(t>=e)return!1;const i=this._getPageAdvance(t,!1)||1;return this.currentPageNumber=Math.min(t+i,e),!0}previousPage(){const t=this._currentPageNumber;if(t<=1)return!1;const e=this._getPageAdvance(t,!0)||1;return this.currentPageNumber=Math.max(t-e,1),!0}updateScale({drawingDelay:t,scaleFactor:e=null,steps:i=null,origin:n}){if(null===i&&null===e)throw new Error("Invalid updateScale options: either `steps` or `scaleFactor` must be provided.");if(!this.pdfDocument)return;let s=this._currentScale;if(e>0&&1!==e)s=Math.round(s*e*100)/100;else if(i){const r=i>0?1.1:1/1.1,a=i>0?Math.ceil:Math.floor;i=Math.abs(i);do{s=a(10*(s*r).toFixed(2))/10}while(--i>0)}s=Math.max(.1,Math.min(10,s)),this.#M(s,{noScroll:!1,drawingDelay:t,origin:n})}increaseScale(t={}){this.updateScale({...t,steps:t.steps??1})}decreaseScale(t={}){this.updateScale({...t,steps:-(t.steps??1)})}#F(t=this.container.clientHeight){t!==this.#A&&(this.#A=t,ql.setProperty("--viewer-container-height",`${t}px`))}#B(t){for(const e of t)if(e.target===this.container){this.#F(Math.floor(e.borderBoxSize[0].blockSize)),this.#l=null;break}}get containerTopLeft(){return this.#l||=[this.container.offsetTop,this.container.offsetLeft]}#V(){this.#f?.abort(),this.#f=null,null!==this.#g&&(clearTimeout(this.#g),this.#g=null)}get annotationEditorMode(){return this.#s?this.#n:St.DISABLE}set annotationEditorMode({mode:t,editId:e=null,isFromKeyboard:i=!1}){if(!this.#s)throw new Error("The AnnotationEditor is not enabled.");if(this.#n===t)return;if(!yr(t))throw new Error(`Invalid AnnotationEditor mode: ${t}`);if(!this.pdfDocument)return;t===St.STAMP&&this.#p?.loadModel("altText");const{eventBus:n}=this,s=()=>{this.#V(),this.#n=t,this.#s.updateMode(t,e,i),n.dispatch("annotationeditormodechanged",{source:this,mode:t})};if(t===St.NONE||this.#n===St.NONE){const r=t!==St.NONE;r||this.pdfDocument.annotationStorage.resetModifiedIds();for(const l of this._pages)l.toggleEditingMode(r);const a=this.#N();if(r&&a){this.#V(),this.#f=new AbortController;const l=AbortSignal.any([this.#u.signal,this.#f.signal]);return void n._on("pagerendered",({pageNumber:h})=>{a.delete(h),0===a.size&&(this.#g=setTimeout(s,0))},{signal:l})}}s()}refresh(t=!1,e=Object.create(null)){if(this.pdfDocument){for(const i of this._pages)i.update(e);null!==this.#w&&(clearTimeout(this.#w),this.#w=null),t||this.update()}}}class $c extends wr{_resetView(){super._resetView(),this._scrollMode=G.PAGE,this._spreadMode=mt.NONE}set scrollMode(t){}_updateScrollMode(){}set spreadMode(t){}_updateSpreadMode(){}}var Xc=q.AnnotationLayerBuilder,Yc=q.DownloadManager,Kc=q.EventBus,qc=q.FindState,Er=q.GenericL10n,Ae=q.LinkTarget,xr=q.PDFFindController,Qc=q.PDFHistory,Cr=q.PDFLinkService,Zc=q.PDFPageView,Jc=q.PDFScriptingManager,Sr=q.PDFSinglePageViewer,Pr=q.PDFViewer,td=q.ProgressBar,ed=q.RenderingStates,id=q.ScrollMode,nd=q.SimpleLinkService,sd=q.SpreadMode,rd=q.StructTreeLayerBuilder,ad=q.TextLayerBuilder,od=q.XfaLayerBuilder,ld=q.parseQueryString;const hd=["pdfViewerContainer"];function wn(o,t,e){o[t]=e}function ze(){return typeof window>"u"}ze()||wn(wt,"verbosity",Ps.INFOS),typeof Promise.withResolvers>"u"&&window&&(window.Promise.withResolvers=()=>{let o,t;return{promise:new Promise((i,n)=>{o=i,t=n}),resolve:o,reject:t}});var En=function(o){return o[o.DISABLED=0]="DISABLED",o[o.ENABLED=1]="ENABLED",o[o.ENHANCED=2]="ENHANCED",o}(En||{});let ud=(()=>{class o{element;ngZone;static CSS_UNITS=96/72;static BORDER_WIDTH=9;pdfViewerContainer;eventBus;pdfLinkService;pdfFindController;pdfViewer;isVisible=!1;_cMapsUrl=`https://unpkg.com/pdfjs-dist@${oi}/cmaps/`;_imageResourcesPath=`https://unpkg.com/pdfjs-dist@${oi}/web/images/`;_renderText=!0;_renderTextMode=En.ENABLED;_stickToPage=!1;_originalSize=!0;_pdf;_page=1;_zoom=1;_zoomScale="page-width";_rotation=0;_showAll=!0;_canAutoResize=!0;_fitToPage=!1;_externalLinkTarget="blank";_showBorders=!1;lastLoaded;_latestScrolledPage;pageScrollTimeout=null;isInitialized=!1;loadingTask;destroy$=new Ur.B;afterLoadComplete=new R.bkB;pageRendered=new R.bkB;pageInitialized=new R.bkB;textLayerRendered=new R.bkB;onError=new R.bkB;onProgress=new R.bkB;pageChange=new R.bkB(!0);src;set cMapsUrl(e){this._cMapsUrl=e}set page(e){const i=e=parseInt(e,10)||1;this._pdf&&(e=this.getValidPageNumber(e)),this._page=e,i!==e&&this.pageChange.emit(e)}set renderText(e){this._renderText=e}set renderTextMode(e){this._renderTextMode=e}set originalSize(e){this._originalSize=e}set showAll(e){this._showAll=e}set stickToPage(e){this._stickToPage=e}set zoom(e){e<=0||(this._zoom=e)}get zoom(){return this._zoom}set zoomScale(e){this._zoomScale=e}get zoomScale(){return this._zoomScale}set rotation(e){"number"==typeof e&&e%90==0?this._rotation=e:console.warn("Invalid pages rotation angle.")}set externalLinkTarget(e){this._externalLinkTarget=e}set autoresize(e){this._canAutoResize=!!e}set fitToPage(e){this._fitToPage=!!e}set showBorders(e){this._showBorders=!!e}static getLinkTarget(e){switch(e){case"blank":return Ae.BLANK;case"none":return Ae.NONE;case"self":return Ae.SELF;case"parent":return Ae.PARENT;case"top":return Ae.TOP}return null}constructor(e,i){if(this.element=e,this.ngZone=i,ze())return;let n;const s=oi;n=window[`pdfWorkerSrc${s}`]||(window.hasOwnProperty("pdfWorkerSrc")&&"string"==typeof window.pdfWorkerSrc&&window.pdfWorkerSrc?window.pdfWorkerSrc:`https://cdn.jsdelivr.net/npm/pdfjs-dist@${s}/legacy/build/pdf.worker.min.mjs`),wn(Ss,"workerSrc",n)}ngAfterViewChecked(){if(this.isInitialized)return;const e=this.pdfViewerContainer.nativeElement.offsetParent;!0!==this.isVisible||null!=e?!1===this.isVisible&&null!=e&&(this.isVisible=!0,setTimeout(()=>{this.initialize(),this.ngOnChanges({src:this.src})})):this.isVisible=!1}ngOnInit(){this.initialize(),this.setupResizeListener()}ngOnDestroy(){this.clear(),this.destroy$.next(),this.loadingTask=null}ngOnChanges(e){if(!ze()&&this.isVisible)if("src"in e)this.loadPDF();else if(this._pdf){if(("renderText"in e||"showAll"in e)&&(this.setupViewer(),this.resetPdfDocument()),"page"in e){const{page:i}=e;if(i.currentValue===this._latestScrolledPage)return;this.pdfViewer.scrollPageIntoView({pageNumber:this._page})}this.update()}}updateSize(){(0,Pn.H)(this._pdf.getPage(this.pdfViewer.currentPageNumber)).pipe((0,J.Q)(this.destroy$)).subscribe({next:e=>{const i=this._rotation+e.rotate,n=e.getViewport({scale:this._zoom,rotation:i}).width*o.CSS_UNITS;let s=this._zoom,r=!0;if(!this._originalSize||this._fitToPage&&n>this.pdfViewerContainer.nativeElement.clientWidth){const a=e.getViewport({scale:1,rotation:i});s=this.getScale(a.width,a.height),r=!this._stickToPage}this.pdfViewer.currentScale=s,r&&this.pdfViewer.scrollPageIntoView({pageNumber:e.pageNumber,ignoreDestinationZoom:!0})}})}clear(){this.loadingTask&&!this.loadingTask.destroyed&&this.loadingTask.destroy(),this._pdf&&(this._latestScrolledPage=0,this._pdf.destroy(),this._pdf=void 0),this.pdfViewer&&this.pdfViewer.setDocument(null),this.pdfLinkService&&this.pdfLinkService.setDocument(null,null),this.pdfFindController&&this.pdfFindController.setDocument(null)}getPDFLinkServiceConfig(){const e=o.getLinkTarget(this._externalLinkTarget);return e?{externalLinkTarget:e}:{}}initEventBus(){this.eventBus=function cd(o,t){const e=new o.EventBus;return function dd(o,t){Z(o,"documentload").pipe((0,J.Q)(t)).subscribe(()=>{const e=document.createEvent("CustomEvent");e.initCustomEvent("documentload",!0,!0,{}),window.dispatchEvent(e)}),Z(o,"pagerendered").pipe((0,J.Q)(t)).subscribe(({pageNumber:e,cssTransform:i,source:n})=>{const s=document.createEvent("CustomEvent");s.initCustomEvent("pagerendered",!0,!0,{pageNumber:e,cssTransform:i}),n.div.dispatchEvent(s)}),Z(o,"textlayerrendered").pipe((0,J.Q)(t)).subscribe(({pageNumber:e,source:i})=>{const n=document.createEvent("CustomEvent");n.initCustomEvent("textlayerrendered",!0,!0,{pageNumber:e}),i.textLayerDiv?.dispatchEvent(n)}),Z(o,"pagechanging").pipe((0,J.Q)(t)).subscribe(({pageNumber:e,source:i})=>{const n=document.createEvent("UIEvents");n.initEvent("pagechanging",!0,!0),n.pageNumber=e,i.container.dispatchEvent(n)}),Z(o,"pagesinit").pipe((0,J.Q)(t)).subscribe(({source:e})=>{const i=document.createEvent("CustomEvent");i.initCustomEvent("pagesinit",!0,!0,null),e.container.dispatchEvent(i)}),Z(o,"pagesloaded").pipe((0,J.Q)(t)).subscribe(({pagesCount:e,source:i})=>{const n=document.createEvent("CustomEvent");n.initCustomEvent("pagesloaded",!0,!0,{pagesCount:e}),i.container.dispatchEvent(n)}),Z(o,"scalechange").pipe((0,J.Q)(t)).subscribe(({scale:e,presetValue:i,source:n})=>{const s=document.createEvent("UIEvents");s.initEvent("scalechange",!0,!0),s.scale=e,s.presetValue=i,n.container.dispatchEvent(s)}),Z(o,"updateviewarea").pipe((0,J.Q)(t)).subscribe(({location:e,source:i})=>{const n=document.createEvent("UIEvents");n.initEvent("updateviewarea",!0,!0),n.location=e,i.container.dispatchEvent(n)}),Z(o,"find").pipe((0,J.Q)(t)).subscribe(({source:e,type:i,query:n,phraseSearch:s,caseSensitive:r,highlightAll:a,findPrevious:l})=>{if(e===window)return;const h=document.createEvent("CustomEvent");h.initCustomEvent("find"+i,!0,!0,{query:n,phraseSearch:s,caseSensitive:r,highlightAll:a,findPrevious:l}),window.dispatchEvent(h)}),Z(o,"attachmentsloaded").pipe((0,J.Q)(t)).subscribe(({attachmentsCount:e,source:i})=>{const n=document.createEvent("CustomEvent");n.initCustomEvent("attachmentsloaded",!0,!0,{attachmentsCount:e}),i.container.dispatchEvent(n)}),Z(o,"sidebarviewchanged").pipe((0,J.Q)(t)).subscribe(({view:e,source:i})=>{const n=document.createEvent("CustomEvent");n.initCustomEvent("sidebarviewchanged",!0,!0,{view:e}),i.outerContainer.dispatchEvent(n)}),Z(o,"pagemode").pipe((0,J.Q)(t)).subscribe(({mode:e,source:i})=>{const n=document.createEvent("CustomEvent");n.initCustomEvent("pagemode",!0,!0,{mode:e}),i.pdfViewer.container.dispatchEvent(n)}),Z(o,"namedaction").pipe((0,J.Q)(t)).subscribe(({action:e,source:i})=>{const n=document.createEvent("CustomEvent");n.initCustomEvent("namedaction",!0,!0,{action:e}),i.pdfViewer.container.dispatchEvent(n)}),Z(o,"presentationmodechanged").pipe((0,J.Q)(t)).subscribe(({active:e,switchInProgress:i})=>{const n=document.createEvent("CustomEvent");n.initCustomEvent("presentationmodechanged",!0,!0,{active:e,switchInProgress:i}),window.dispatchEvent(n)}),Z(o,"outlineloaded").pipe((0,J.Q)(t)).subscribe(({outlineCount:e,source:i})=>{const n=document.createEvent("CustomEvent");n.initCustomEvent("outlineloaded",!0,!0,{outlineCount:e}),i.container.dispatchEvent(n)})}(e,t),e}(ee,this.destroy$),Z(this.eventBus,"pagerendered").pipe((0,J.Q)(this.destroy$)).subscribe(e=>{this.pageRendered.emit(e)}),Z(this.eventBus,"pagesinit").pipe((0,J.Q)(this.destroy$)).subscribe(e=>{this.pageInitialized.emit(e)}),Z(this.eventBus,"pagechanging").pipe((0,J.Q)(this.destroy$)).subscribe(({pageNumber:e})=>{this.pageScrollTimeout&&clearTimeout(this.pageScrollTimeout),this.pageScrollTimeout=window.setTimeout(()=>{this._latestScrolledPage=e,this.pageChange.emit(e)},100)}),Z(this.eventBus,"textlayerrendered").pipe((0,J.Q)(this.destroy$)).subscribe(e=>{this.textLayerRendered.emit(e)})}initPDFServices(){this.pdfLinkService=new Cr({eventBus:this.eventBus,...this.getPDFLinkServiceConfig()}),this.pdfFindController=new xr({eventBus:this.eventBus,linkService:this.pdfLinkService})}getPDFOptions(){return{eventBus:this.eventBus,container:this.element.nativeElement.querySelector("div"),removePageBorders:!this._showBorders,linkService:this.pdfLinkService,textLayerMode:this._renderText?this._renderTextMode:En.DISABLED,findController:this.pdfFindController,l10n:new Er("en"),imageResourcesPath:this._imageResourcesPath,annotationEditorMode:Cs.DISABLE}}setupViewer(){this.pdfViewer&&this.pdfViewer.setDocument(null),wn(wt,"disableTextLayer",!this._renderText),this.initPDFServices(),this.pdfViewer=this._showAll?new Pr(this.getPDFOptions()):new Sr(this.getPDFOptions()),this.pdfLinkService.setViewer(this.pdfViewer),this.pdfViewer._currentPageNumber=this._page}getValidPageNumber(e){return e<1?1:e>this._pdf.numPages?this._pdf.numPages:e}getDocumentParams(){const e=typeof this.src;if(!this._cMapsUrl)return this.src;const i={cMapUrl:this._cMapsUrl,cMapPacked:!0,enableXfa:!0,isEvalSupported:!1};return"string"===e?i.url=this.src:"object"===e&&(void 0!==this.src.byteLength?i.data=this.src:Object.assign(i,this.src)),i}loadPDF(){if(!this.src)return;if(this.lastLoaded===this.src)return void this.update();this.clear(),this.setupViewer(),this.loadingTask=Ts(this.getDocumentParams()),this.loadingTask.onProgress=i=>{this.onProgress.emit(i)};const e=this.src;(0,Pn.H)(this.loadingTask.promise).pipe((0,J.Q)(this.destroy$)).subscribe({next:i=>{this._pdf=i,this.lastLoaded=e,this.afterLoadComplete.emit(i),this.resetPdfDocument(),this.update()},error:i=>{this.lastLoaded=null,this.onError.emit(i)}})}update(){this.page=this._page,this.render()}render(){if(this._page=this.getValidPageNumber(this._page),(0!==this._rotation||this.pdfViewer.pagesRotation!==this._rotation)&&this.pdfViewer.firstPagePromise?.then(()=>this.pdfViewer.pagesRotation=this._rotation),this._stickToPage&&setTimeout(()=>{this.pdfViewer.currentPageNumber=this._page}),this.pdfViewer._pages?.length)this.updateSize();else{const e=this.pageInitialized.subscribe(()=>{this.updateSize(),e.unsubscribe()})}}getScale(e,i){const n=this._showBorders?2*o.BORDER_WIDTH:0,s=this.pdfViewerContainer.nativeElement.clientWidth-n,r=this.pdfViewerContainer.nativeElement.clientHeight-n;if(0===r||0===i||0===s||0===e)return 1;let a=1;switch(this._zoomScale){case"page-fit":a=Math.min(r/i,s/e);break;case"page-height":a=r/i;break;default:a=s/e}return this._zoom*a/o.CSS_UNITS}resetPdfDocument(){this.pdfLinkService.setDocument(this._pdf,null),this.pdfFindController.setDocument(this._pdf),this.pdfViewer.setDocument(this._pdf)}initialize(){ze()||!this.isVisible||(this.isInitialized=!0,this.initEventBus(),this.setupViewer())}setupResizeListener(){ze()||this.ngZone.runOutsideAngular(()=>{Z(window,"resize").pipe(function Yr(o,t=Gr.E){return(0,$r.N)((e,i)=>{let n=null,s=null,r=null;const a=()=>{if(n){n.unsubscribe(),n=null;const h=s;s=null,i.next(h)}};function l(){const h=r+o,c=t.now();if(c<h)return n=this.schedule(void 0,h-c),void i.add(n);a()}e.subscribe((0,Xr._)(i,h=>{s=h,r=t.now(),n||(n=t.schedule(l,o),i.add(n))},()=>{a(),i.complete()},void 0,()=>{s=n=null}))})}(100),(0,Kr.p)(()=>this._canAutoResize&&!!this._pdf),(0,J.Q)(this.destroy$)).subscribe(()=>{this.updateSize()})})}static \u0275fac=function(i){return new(i||o)(_.rXU(_.aKT),_.rXU(R.SKi))};static \u0275cmp=_.VBU({type:o,selectors:[["pdf-viewer"]],viewQuery:function(i,n){if(1&i&&_.GBs(hd,5),2&i){let s;_.mGM(s=_.lsd())&&(n.pdfViewerContainer=s.first)}},inputs:{src:"src",cMapsUrl:[0,"c-maps-url","cMapsUrl"],page:"page",renderText:[0,"render-text","renderText"],renderTextMode:[0,"render-text-mode","renderTextMode"],originalSize:[0,"original-size","originalSize"],showAll:[0,"show-all","showAll"],stickToPage:[0,"stick-to-page","stickToPage"],zoom:"zoom",zoomScale:[0,"zoom-scale","zoomScale"],rotation:"rotation",externalLinkTarget:[0,"external-link-target","externalLinkTarget"],autoresize:"autoresize",fitToPage:[0,"fit-to-page","fitToPage"],showBorders:[0,"show-borders","showBorders"]},outputs:{afterLoadComplete:"after-load-complete",pageRendered:"page-rendered",pageInitialized:"pages-initialized",textLayerRendered:"text-layer-rendered",onError:"error",onProgress:"on-progress",pageChange:"pageChange"},standalone:!1,features:[_.OA$],decls:3,vars:0,consts:[["pdfViewerContainer",""],[1,"ng2-pdf-viewer-container"],[1,"pdfViewer"]],template:function(i,n){1&i&&(_.j41(0,"div",1,0),_.nrm(2,"div",2),_.k0s())},styles:['.ng2-pdf-viewer-container[_ngcontent-%COMP%]{overflow-x:auto;position:absolute;height:100%;width:100%;-webkit-overflow-scrolling:touch}[_nghost-%COMP%]{display:block;position:relative}[_nghost-%COMP%] {--pdfViewer-padding-bottom: 0;--page-margin: 1px auto -8px;--page-border: 9px solid transparent;--spreadHorizontalWrapped-margin-LR: -3.5px;--viewer-container-height: 0;--annotation-unfocused-field-background: url("data:image/svg+xml;charset=UTF-8,<svg width=\'1px\' height=\'1px\' xmlns=\'http://www.w3.org/2000/svg\'><rect width=\'100%\' height=\'100%\' style=\'fill:rgba(0, 54, 255, 0.13);\'/></svg>");--xfa-unfocused-field-background: var( --annotation-unfocused-field-background );--page-border-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAATCAYAAAByUDbMAAAA1ElEQVQ4jbWUWw6EIAxFy2NFs/8NzR4UJhpqLsdi5mOmSSMUOfYWqv3S0gMr4XlYH/64gZa/gN3ANYA7KAXALt4ktoQ5MI9YxqaG8bWmsIysMuT6piSQCa4whZThCu8CM4zP9YJaKci9jicPq3NcBWYoPMGUlhG7ivtkB+gVyFY75wXghOvh8t5mto1Mdim6e+MBqH6XsY+YAwjpq3vGF7weTWQptLEDVCZvPTMl5JZZsdh47FHW6qFMyvLYqjcnmdFfY9Xk/KDOlzCusX2mi/ofM7MPkzBcSp4Q1/wAAAAASUVORK5CYII=) 9 9 repeat;--scale-factor: 1;--focus-outline: solid 2px blue;--hover-outline: dashed 2px blue;--freetext-line-height: 1.35;--freetext-padding: 2px;--editorInk-editing-cursor: pointer}@media screen and (forced-colors: active){[_nghost-%COMP%] {--pdfViewer-padding-bottom: 9px;--page-margin: 8px auto -1px;--page-border: 1px solid CanvasText;--page-border-image: none;--spreadHorizontalWrapped-margin-LR: 3.5px}}@media (forced-colors: active){[_nghost-%COMP%] {--focus-outline: solid 3px ButtonText;--hover-outline: dashed 3px ButtonText}}[_nghost-%COMP%] .textLayer{position:absolute;text-align:initial;inset:0;overflow:hidden;opacity:.2;line-height:1;-webkit-text-size-adjust:none;text-size-adjust:none;forced-color-adjust:none;transform-origin:0 0}[_nghost-%COMP%] .textLayer span, [_nghost-%COMP%] .textLayer br{color:transparent;position:absolute;white-space:pre;cursor:text;transform-origin:0% 0%}[_nghost-%COMP%] .textLayer span.markedContent{top:0;height:0}[_nghost-%COMP%] .textLayer .highlight{margin:-1px;padding:1px;background-color:#b400aa;border-radius:4px}[_nghost-%COMP%] .textLayer .highlight.appended{position:initial}[_nghost-%COMP%] .textLayer .highlight.begin{border-radius:4px 0 0 4px}[_nghost-%COMP%] .textLayer .highlight.end{border-radius:0 4px 4px 0}[_nghost-%COMP%] .textLayer .highlight.middle{border-radius:0}[_nghost-%COMP%] .textLayer .highlight.selected{background-color:#006400}[_nghost-%COMP%] .textLayer ::selection{background:rgb(0,0,255)}[_nghost-%COMP%] .textLayer br::selection{background:transparent}[_nghost-%COMP%] .textLayer .endOfContent{display:block;position:absolute;inset:100% 0 0;z-index:-1;cursor:default;-webkit-user-select:none;user-select:none}[_nghost-%COMP%] .textLayer .endOfContent.active{top:0}@media (forced-colors: active){[_nghost-%COMP%] .annotationLayer .textWidgetAnnotation input:required, [_nghost-%COMP%] .annotationLayer .textWidgetAnnotation textarea:required, [_nghost-%COMP%] .annotationLayer .choiceWidgetAnnotation select:required, [_nghost-%COMP%] .annotationLayer .buttonWidgetAnnotation.checkBox input:required, [_nghost-%COMP%] .annotationLayer .buttonWidgetAnnotation.radioButton input:required{outline:1.5px solid selectedItem}}[_nghost-%COMP%] .annotationLayer{position:absolute;top:0;left:0;pointer-events:none;transform-origin:0 0}[_nghost-%COMP%] .annotationLayer section{position:absolute;text-align:initial;pointer-events:auto;box-sizing:border-box;transform-origin:0 0}[_nghost-%COMP%] .annotationLayer .linkAnnotation>a, [_nghost-%COMP%] .annotationLayer .buttonWidgetAnnotation.pushButton>a{position:absolute;font-size:1em;top:0;left:0;width:100%;height:100%}[_nghost-%COMP%] .annotationLayer .buttonWidgetAnnotation.pushButton>canvas{width:100%;height:100%}[_nghost-%COMP%] .annotationLayer .linkAnnotation>a:hover, [_nghost-%COMP%] .annotationLayer .buttonWidgetAnnotation.pushButton>a:hover{opacity:.2;background:rgb(255,255,0);box-shadow:0 2px 10px #ff0}[_nghost-%COMP%] .annotationLayer .textAnnotation img{position:absolute;cursor:pointer;width:100%;height:100%}[_nghost-%COMP%] .annotationLayer .textWidgetAnnotation input, [_nghost-%COMP%] .annotationLayer .textWidgetAnnotation textarea, [_nghost-%COMP%] .annotationLayer .choiceWidgetAnnotation select, [_nghost-%COMP%] .annotationLayer .buttonWidgetAnnotation.checkBox input, [_nghost-%COMP%] .annotationLayer .buttonWidgetAnnotation.radioButton input{background-image:var(--annotation-unfocused-field-background);border:1px solid transparent;box-sizing:border-box;font:calc(9px * var(--scale-factor)) sans-serif;height:100%;margin:0;vertical-align:top;width:100%}[_nghost-%COMP%] .annotationLayer .textWidgetAnnotation input:required, [_nghost-%COMP%] .annotationLayer .textWidgetAnnotation textarea:required, [_nghost-%COMP%] .annotationLayer .choiceWidgetAnnotation select:required, [_nghost-%COMP%] .annotationLayer .buttonWidgetAnnotation.checkBox input:required, [_nghost-%COMP%] .annotationLayer .buttonWidgetAnnotation.radioButton input:required{outline:1.5px solid red}[_nghost-%COMP%] .annotationLayer .choiceWidgetAnnotation select option{padding:0}[_nghost-%COMP%] .annotationLayer .buttonWidgetAnnotation.radioButton input{border-radius:50%}[_nghost-%COMP%] .annotationLayer .textWidgetAnnotation textarea{resize:none}[_nghost-%COMP%] .annotationLayer .textWidgetAnnotation input[disabled], [_nghost-%COMP%] .annotationLayer .textWidgetAnnotation textarea[disabled], [_nghost-%COMP%] .annotationLayer .choiceWidgetAnnotation select[disabled], [_nghost-%COMP%] .annotationLayer .buttonWidgetAnnotation.checkBox input[disabled], [_nghost-%COMP%] .annotationLayer .buttonWidgetAnnotation.radioButton input[disabled]{background:none;border:1px solid transparent;cursor:not-allowed}[_nghost-%COMP%] .annotationLayer .textWidgetAnnotation input:hover, [_nghost-%COMP%] .annotationLayer .textWidgetAnnotation textarea:hover, [_nghost-%COMP%] .annotationLayer .choiceWidgetAnnotation select:hover, [_nghost-%COMP%] .annotationLayer .buttonWidgetAnnotation.checkBox input:hover, [_nghost-%COMP%] .annotationLayer .buttonWidgetAnnotation.radioButton input:hover{border:1px solid rgb(0,0,0)}[_nghost-%COMP%] .annotationLayer .textWidgetAnnotation input:focus, [_nghost-%COMP%] .annotationLayer .textWidgetAnnotation textarea:focus, [_nghost-%COMP%] .annotationLayer .choiceWidgetAnnotation select:focus{background:none;border:1px solid transparent}[_nghost-%COMP%] .annotationLayer .textWidgetAnnotation input :focus, [_nghost-%COMP%] .annotationLayer .textWidgetAnnotation textarea :focus, [_nghost-%COMP%] .annotationLayer .choiceWidgetAnnotation select :focus, [_nghost-%COMP%] .annotationLayer .buttonWidgetAnnotation.checkBox :focus, [_nghost-%COMP%] .annotationLayer .buttonWidgetAnnotation.radioButton :focus{background-image:none;background-color:transparent;outline:auto}[_nghost-%COMP%] .annotationLayer .buttonWidgetAnnotation.checkBox input:checked:before, [_nghost-%COMP%] .annotationLayer .buttonWidgetAnnotation.checkBox input:checked:after, [_nghost-%COMP%] .annotationLayer .buttonWidgetAnnotation.radioButton input:checked:before{background-color:CanvasText;content:"";display:block;position:absolute}[_nghost-%COMP%] .annotationLayer .buttonWidgetAnnotation.checkBox input:checked:before, [_nghost-%COMP%] .annotationLayer .buttonWidgetAnnotation.checkBox input:checked:after{height:80%;left:45%;width:1px}[_nghost-%COMP%] .annotationLayer .buttonWidgetAnnotation.checkBox input:checked:before{transform:rotate(45deg)}[_nghost-%COMP%] .annotationLayer .buttonWidgetAnnotation.checkBox input:checked:after{transform:rotate(-45deg)}[_nghost-%COMP%] .annotationLayer .buttonWidgetAnnotation.radioButton input:checked:before{border-radius:50%;height:50%;left:30%;top:20%;width:50%}[_nghost-%COMP%] .annotationLayer .textWidgetAnnotation input.comb{font-family:monospace;padding-left:2px;padding-right:0}[_nghost-%COMP%] .annotationLayer .textWidgetAnnotation input.comb:focus{width:103%}[_nghost-%COMP%] .annotationLayer .buttonWidgetAnnotation.checkBox input, [_nghost-%COMP%] .annotationLayer .buttonWidgetAnnotation.radioButton input{-webkit-appearance:none;appearance:none}[_nghost-%COMP%] .annotationLayer .popupTriggerArea{height:100%;width:100%}[_nghost-%COMP%] .annotationLayer .popupWrapper{position:absolute;font-size:calc(9px * var(--scale-factor));width:100%;min-width:calc(180px * var(--scale-factor));pointer-events:none}[_nghost-%COMP%] .annotationLayer .popup{position:absolute;max-width:calc(180px * var(--scale-factor));background-color:#ff9;box-shadow:0 calc(2px * var(--scale-factor)) calc(5px * var(--scale-factor)) #888;border-radius:calc(2px * var(--scale-factor));padding:calc(6px * var(--scale-factor));margin-left:calc(5px * var(--scale-factor));cursor:pointer;font:message-box;white-space:normal;word-wrap:break-word;pointer-events:auto}[_nghost-%COMP%] .annotationLayer .popup>*{font-size:calc(9px * var(--scale-factor))}[_nghost-%COMP%] .annotationLayer .popup h1{display:inline-block}[_nghost-%COMP%] .annotationLayer .popupDate{display:inline-block;margin-left:calc(5px * var(--scale-factor))}[_nghost-%COMP%] .annotationLayer .popupContent{border-top:1px solid rgb(51,51,51);margin-top:calc(2px * var(--scale-factor));padding-top:calc(2px * var(--scale-factor))}[_nghost-%COMP%] .annotationLayer .richText>*{white-space:pre-wrap;font-size:calc(9px * var(--scale-factor))}[_nghost-%COMP%] .annotationLayer .highlightAnnotation, [_nghost-%COMP%] .annotationLayer .underlineAnnotation, [_nghost-%COMP%] .annotationLayer .squigglyAnnotation, [_nghost-%COMP%] .annotationLayer .strikeoutAnnotation, [_nghost-%COMP%] .annotationLayer .freeTextAnnotation, [_nghost-%COMP%] .annotationLayer .lineAnnotation svg line, [_nghost-%COMP%] .annotationLayer .squareAnnotation svg rect, [_nghost-%COMP%] .annotationLayer .circleAnnotation svg ellipse, [_nghost-%COMP%] .annotationLayer .polylineAnnotation svg polyline, [_nghost-%COMP%] .annotationLayer .polygonAnnotation svg polygon, [_nghost-%COMP%] .annotationLayer .caretAnnotation, [_nghost-%COMP%] .annotationLayer .inkAnnotation svg polyline, [_nghost-%COMP%] .annotationLayer .stampAnnotation, [_nghost-%COMP%] .annotationLayer .fileAttachmentAnnotation{cursor:pointer}[_nghost-%COMP%] .annotationLayer section svg{position:absolute;width:100%;height:100%}[_nghost-%COMP%] .annotationLayer .annotationTextContent{position:absolute;width:100%;height:100%;opacity:0;color:transparent;-webkit-user-select:none;user-select:none;pointer-events:none}[_nghost-%COMP%] .annotationLayer .annotationTextContent span{width:100%;display:inline-block}@media (forced-colors: active){[_nghost-%COMP%] .xfaLayer *:required{outline:1.5px solid selectedItem}}[_nghost-%COMP%] .xfaLayer .highlight{margin:-1px;padding:1px;background-color:#efcbed;border-radius:4px}[_nghost-%COMP%] .xfaLayer .highlight.appended{position:initial}[_nghost-%COMP%] .xfaLayer .highlight.begin{border-radius:4px 0 0 4px}[_nghost-%COMP%] .xfaLayer .highlight.end{border-radius:0 4px 4px 0}[_nghost-%COMP%] .xfaLayer .highlight.middle{border-radius:0}[_nghost-%COMP%] .xfaLayer .highlight.selected{background-color:#cbdfcb}[_nghost-%COMP%] .xfaLayer ::selection{background:rgb(0,0,255)}[_nghost-%COMP%] .xfaPage{overflow:hidden;position:relative}[_nghost-%COMP%] .xfaContentarea{position:absolute}[_nghost-%COMP%] .xfaPrintOnly{display:none}[_nghost-%COMP%] .xfaLayer{position:absolute;text-align:initial;top:0;left:0;transform-origin:0 0;line-height:1.2}[_nghost-%COMP%] .xfaLayer *{color:inherit;font:inherit;font-style:inherit;font-weight:inherit;font-kerning:inherit;letter-spacing:-.01px;text-align:inherit;text-decoration:inherit;box-sizing:border-box;background-color:transparent;padding:0;margin:0;pointer-events:auto;line-height:inherit}[_nghost-%COMP%] .xfaLayer *:required{outline:1.5px solid red}[_nghost-%COMP%] .xfaLayer div{pointer-events:none}[_nghost-%COMP%] .xfaLayer svg{pointer-events:none}[_nghost-%COMP%] .xfaLayer svg *{pointer-events:none}[_nghost-%COMP%] .xfaLayer a{color:#00f}[_nghost-%COMP%] .xfaRich li{margin-left:3em}[_nghost-%COMP%] .xfaFont{color:#000;font-weight:400;font-kerning:none;font-size:10px;font-style:normal;letter-spacing:0;text-decoration:none;vertical-align:0}[_nghost-%COMP%] .xfaCaption{overflow:hidden;flex:0 0 auto}[_nghost-%COMP%] .xfaCaptionForCheckButton{overflow:hidden;flex:1 1 auto}[_nghost-%COMP%] .xfaLabel{height:100%;width:100%}[_nghost-%COMP%] .xfaLeft{display:flex;flex-direction:row;align-items:center}[_nghost-%COMP%] .xfaRight{display:flex;flex-direction:row-reverse;align-items:center}[_nghost-%COMP%] .xfaLeft>.xfaCaption, [_nghost-%COMP%] .xfaLeft>.xfaCaptionForCheckButton, [_nghost-%COMP%] .xfaRight>.xfaCaption, [_nghost-%COMP%] .xfaRight>.xfaCaptionForCheckButton{max-height:100%}[_nghost-%COMP%] .xfaTop{display:flex;flex-direction:column;align-items:flex-start}[_nghost-%COMP%] .xfaBottom{display:flex;flex-direction:column-reverse;align-items:flex-start}[_nghost-%COMP%] .xfaTop>.xfaCaption, [_nghost-%COMP%] .xfaTop>.xfaCaptionForCheckButton, [_nghost-%COMP%] .xfaBottom>.xfaCaption, [_nghost-%COMP%] .xfaBottom>.xfaCaptionForCheckButton{width:100%}[_nghost-%COMP%] .xfaBorder{background-color:transparent;position:absolute;pointer-events:none}[_nghost-%COMP%] .xfaWrapped{width:100%;height:100%}[_nghost-%COMP%] .xfaTextfield:focus, [_nghost-%COMP%] .xfaSelect:focus{background-image:none;background-color:transparent;outline:auto;outline-offset:-1px}[_nghost-%COMP%] .xfaCheckbox:focus, [_nghost-%COMP%] .xfaRadio:focus{outline:auto}[_nghost-%COMP%] .xfaTextfield, [_nghost-%COMP%] .xfaSelect{height:100%;width:100%;flex:1 1 auto;border:none;resize:none;background-image:var(--xfa-unfocused-field-background)}[_nghost-%COMP%] .xfaTop>.xfaTextfield, [_nghost-%COMP%] .xfaTop>.xfaSelect, [_nghost-%COMP%] .xfaBottom>.xfaTextfield, [_nghost-%COMP%] .xfaBottom>.xfaSelect{flex:0 1 auto}[_nghost-%COMP%] .xfaButton{cursor:pointer;width:100%;height:100%;border:none;text-align:center}[_nghost-%COMP%] .xfaLink{width:100%;height:100%;position:absolute;top:0;left:0}[_nghost-%COMP%] .xfaCheckbox, [_nghost-%COMP%] .xfaRadio{width:100%;height:100%;flex:0 0 auto;border:none}[_nghost-%COMP%] .xfaRich{white-space:pre-wrap;width:100%;height:100%}[_nghost-%COMP%] .xfaImage{object-position:left top;object-fit:contain;width:100%;height:100%}[_nghost-%COMP%] .xfaLrTb, [_nghost-%COMP%] .xfaRlTb, [_nghost-%COMP%] .xfaTb{display:flex;flex-direction:column;align-items:stretch}[_nghost-%COMP%] .xfaLr{display:flex;flex-direction:row;align-items:stretch}[_nghost-%COMP%] .xfaRl{display:flex;flex-direction:row-reverse;align-items:stretch}[_nghost-%COMP%] .xfaTb>div{justify-content:left}[_nghost-%COMP%] .xfaPosition{position:relative}[_nghost-%COMP%] .xfaArea{position:relative}[_nghost-%COMP%] .xfaValignMiddle{display:flex;align-items:center}[_nghost-%COMP%] .xfaTable{display:flex;flex-direction:column;align-items:stretch}[_nghost-%COMP%] .xfaTable .xfaRow{display:flex;flex-direction:row;align-items:stretch}[_nghost-%COMP%] .xfaTable .xfaRlRow{display:flex;flex-direction:row-reverse;align-items:stretch;flex:1}[_nghost-%COMP%] .xfaTable .xfaRlRow>div{flex:1}[_nghost-%COMP%] .xfaNonInteractive input, [_nghost-%COMP%] .xfaNonInteractive textarea, [_nghost-%COMP%] .xfaDisabled input, [_nghost-%COMP%] .xfaDisabled textarea, [_nghost-%COMP%] .xfaReadOnly input, [_nghost-%COMP%] .xfaReadOnly textarea{background:initial}@media print{[_nghost-%COMP%] .xfaTextfield, [_nghost-%COMP%] .xfaSelect{background:transparent}[_nghost-%COMP%] .xfaSelect{-webkit-appearance:none;appearance:none;text-indent:1px;text-overflow:""}}[_nghost-%COMP%] [data-editor-rotation="90"]{transform:rotate(90deg)}[_nghost-%COMP%] [data-editor-rotation="180"]{transform:rotate(180deg)}[_nghost-%COMP%] [data-editor-rotation="270"]{transform:rotate(270deg)}[_nghost-%COMP%] .annotationEditorLayer{background:transparent;position:absolute;top:0;left:0;font-size:calc(100px * var(--scale-factor));transform-origin:0 0}[_nghost-%COMP%] .annotationEditorLayer .selectedEditor{outline:var(--focus-outline);resize:none}[_nghost-%COMP%] .annotationEditorLayer .freeTextEditor{position:absolute;background:transparent;border-radius:3px;padding:calc(var(--freetext-padding) * var(--scale-factor));resize:none;width:auto;height:auto;z-index:1;transform-origin:0 0;touch-action:none}[_nghost-%COMP%] .annotationEditorLayer .freeTextEditor .internal{background:transparent;border:none;top:0;left:0;overflow:visible;white-space:nowrap;resize:none;font:10px sans-serif;line-height:var(--freetext-line-height)}[_nghost-%COMP%] .annotationEditorLayer .freeTextEditor .overlay{position:absolute;display:none;background:transparent;top:0;left:0;width:100%;height:100%}[_nghost-%COMP%] .annotationEditorLayer .freeTextEditor .overlay.enabled{display:block}[_nghost-%COMP%] .annotationEditorLayer .freeTextEditor .internal:empty:before{content:attr(default-content);color:gray}[_nghost-%COMP%] .annotationEditorLayer .freeTextEditor .internal:focus{outline:none}[_nghost-%COMP%] .annotationEditorLayer .inkEditor.disabled{resize:none}[_nghost-%COMP%] .annotationEditorLayer .inkEditor.disabled.selectedEditor{resize:horizontal}[_nghost-%COMP%] .annotationEditorLayer .freeTextEditor:hover:not(.selectedEditor), [_nghost-%COMP%] .annotationEditorLayer .inkEditor:hover:not(.selectedEditor){outline:var(--hover-outline)}[_nghost-%COMP%] .annotationEditorLayer .inkEditor{position:absolute;background:transparent;border-radius:3px;overflow:auto;width:100%;height:100%;z-index:1;transform-origin:0 0;cursor:auto}[_nghost-%COMP%] .annotationEditorLayer .inkEditor.editing{resize:none;cursor:var(--editorInk-editing-cursor),pointer}[_nghost-%COMP%] .annotationEditorLayer .inkEditor .inkEditorCanvas{position:absolute;top:0;left:0;width:100%;height:100%;touch-action:none}[_nghost-%COMP%] [data-main-rotation="90"]{transform:rotate(90deg) translateY(-100%)}[_nghost-%COMP%] [data-main-rotation="180"]{transform:rotate(180deg) translate(-100%,-100%)}[_nghost-%COMP%] [data-main-rotation="270"]{transform:rotate(270deg) translate(-100%)}[_nghost-%COMP%] .pdfViewer{padding-bottom:var(--pdfViewer-padding-bottom)}[_nghost-%COMP%] .pdfViewer .canvasWrapper{overflow:hidden}[_nghost-%COMP%] .pdfViewer .canvasWrapper canvas{width:100%}[_nghost-%COMP%] .pdfViewer .page{direction:ltr;width:816px;height:1056px;margin:var(--page-margin);position:relative;overflow:visible;border:var(--page-border);border-image:var(--page-border-image);background-clip:content-box;background-color:#fff}[_nghost-%COMP%] .pdfViewer .dummyPage{position:relative;width:0;height:var(--viewer-container-height)}[_nghost-%COMP%] .pdfViewer.removePageBorders .page{margin:0 auto 10px;border:none}[_nghost-%COMP%] .pdfViewer.singlePageView{display:inline-block}[_nghost-%COMP%] .pdfViewer.singlePageView .page{margin:0;border:none}[_nghost-%COMP%] .pdfViewer.scrollHorizontal, [_nghost-%COMP%] .pdfViewer.scrollWrapped, [_nghost-%COMP%] .spread{margin-left:3.5px;margin-right:3.5px;text-align:center}[_nghost-%COMP%] .pdfViewer.scrollHorizontal, [_nghost-%COMP%] .spread{white-space:nowrap}[_nghost-%COMP%] .pdfViewer.removePageBorders, [_nghost-%COMP%] .pdfViewer.scrollHorizontal .spread, [_nghost-%COMP%] .pdfViewer.scrollWrapped .spread{margin-left:0;margin-right:0}[_nghost-%COMP%] .spread .page, [_nghost-%COMP%] .spread .dummyPage, [_nghost-%COMP%] .pdfViewer.scrollHorizontal .page, [_nghost-%COMP%] .pdfViewer.scrollWrapped .page, [_nghost-%COMP%] .pdfViewer.scrollHorizontal .spread, [_nghost-%COMP%] .pdfViewer.scrollWrapped .spread{display:inline-block;vertical-align:middle}[_nghost-%COMP%] .spread .page, [_nghost-%COMP%] .pdfViewer.scrollHorizontal .page, [_nghost-%COMP%] .pdfViewer.scrollWrapped .page{margin-left:var(--spreadHorizontalWrapped-margin-LR);margin-right:var(--spreadHorizontalWrapped-margin-LR)}[_nghost-%COMP%] .pdfViewer.removePageBorders .spread .page, [_nghost-%COMP%] .pdfViewer.removePageBorders.scrollHorizontal .page, [_nghost-%COMP%] .pdfViewer.removePageBorders.scrollWrapped .page{margin-left:5px;margin-right:5px}[_nghost-%COMP%] .pdfViewer .page canvas{margin:0;display:block}[_nghost-%COMP%] .pdfViewer .page canvas[hidden]{display:none}[_nghost-%COMP%] .pdfViewer .page .loadingIcon{position:absolute;display:block;inset:0;background:url(data:image/gif;base64,R0lGODlhGAAYAPQQAM7Ozvr6+uDg4LCwsOjo6I6OjsjIyJycnNjY2KioqMDAwPLy8nZ2doaGhri4uGhoaP///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh/ilPcHRpbWl6ZWQgd2l0aCBodHRwczovL2V6Z2lmLmNvbS9vcHRpbWl6ZQAh+QQJBwAQACwAAAAAGAAYAAAFmiAkjiTkOGVaBgjZNGSgkgKjjM8zLoI8iy+BKCdiCX8iBeMAhEEIPRXLxViYUE9CbCQoFAzFhHY3zkaT3oPvBz1zE4UBsr1eWZH4vAowOBwGAHk8AoQLfH6Agm0Ed3qOAXWOIgQKiWyFJQgDgJEpdG+WEACNEFNFmKVlVzJQk6qdkwqBoi1mebJ3ALNGeIZHtGSwNDS1RZKueCEAIfkECQcAEAAsAAAAABgAGAAABZcgJI4kpChlWgYCWRQkEKgjURgjw4zOg9CjVwuiEyEeO6CxkBC9nA+HiuUqLEyoBZI0Mx4SAFFgQCDZuguBoGv6Dtg0gvpqdhxQQDkBzuUr/4A1JwMKP39pc2mDhYCIc4GQYn6QCwCMeY91l0p6dBAEJ0OfcFRimZ91Mwt0alxxAIZyRmuAsKxDLKKvZbM1tJxmvGKRpn8hACH5BAkHABAALAAAAAAYABgAAAWhICSOJGQYZVoGAnkcJBKoI3EAY1GMCtPSosSBINKJBIwGkHdwBGGQA0OhYpEGQxNqkYzNIITBACEKKBaxxNfBeOCO4vMy0Hg8nDHFeCktkKtfNAtoS4UqAicKBj9zBAKPC4iKi4aRkISGmWWBmjUIAIyHkCUEAKCVo2WmREecVqoCgZhgP4NHrGWCj7e3szSpuxAsoVWxnp6cVV4kyZW+KSEAIfkECQcAEAAsAAAAABgAGAAABZkgJI4kBABlWgYEOQykEKgjMSDjcYxG0dKi108nEhQKQN4rCIMkCgbawjWYnSCLY2yGVSgEooBhWqsGGwxc0RtNBgoMhmJ1QgETjANYFeBKyUmBKQQIdT9JDmgPDQ6EhoKJD4sOgpWWgiwChyqEBH5hmptSoSOZgJ4kLKWkYTF7C2SaqaM/hEWygay4mYG8t6uffFuzl1iANCEAIfkECQcAEAAsAAAAABgAGAAABZ0gJI4khCBlmhKkopBCoI6LIozDMAIHO4uuBVBnOiR+I4FrCDwAZsKdQnaCLIwwmRUA8JmioprWUCjcwlwUMnAoG0qL03k2KCS8cC0UjOzDCQKBfHQFDAwFU4CCfgqFhy9+kZJWgzSKSAcPZn+BfQENDw8OljGWJAFeDoZPYTBnC1GdSXqnsoBolSulX2GyP6hgvnG0KrS3NJNhuSQhACH5BAkHABAALAAAAAAYABgAAAWaICSOJCQIZZoupGGQRKCOC0CMijIiwz2LABtQZxoMfjQhxAXszWQ7gOwECRhh0MCJJRJARTUoIHFAgbfI6uBwAJS01J/i4PClVYHvfV8lbLlIBmwFbQt+aGmChG18jXeGT4dICQxlb4g/AQUMDER9XjR6BAdiDQwINDBmkAsPDVh4cX4imw53iLKuaVqAcUsPqEiidkt6j4AzIQAh+QQJBwAQACwAAAAAGAAYAAAFmSAkjiREEGWaBiSCtCoZCMsIAKOg1LEo0KKbaKFQ9EYLoOkFuQlirNxzCQkUW9GZ0hQd4nyDAWr4G/esYSbyZFYZwu3jqiuvr8u8I2BwOAwASXh1e31/doeHC3klWnElfAlTd46MfQUGk2stCVEGBQWSdCciDg5VDAVYKoEiDQ0iBwxGcj9RDw8+qHIzebc2DJJQJK6qiKVyIQAh+QQJBwAQACwAAAAAGAAYAAAFmSAkjiS0LGWaBiRBtCoZCKgoCCMB1DF0sz6cCQDo5W62l28XAyZFpyECBv3lnCbhUqHMIo0Qg4Jbmn1jRCa4iV27TzfXGjEecOFWMN1OdvvfPGUuXSoKBw6EXokrAwcHRVU0UAeEBANAAAmUI1gNDyhjJgUHLW0iDg8FIqOnBQZrDA9TELE2rEYIDw4jta2LMpCrqld/YQpgIQAh+QQJBwAQACwAAAAAGAAYAAAFmyAkjiS0LGWaBiRBkKw6BgIqCsJcyyMe4yJajhcEml5H26o1PN2QQd3uFiv2AADlAgflIbDdZLgkABOJgep5LfWty4p4zeU+w+XsvJWXliEKDwdEBgMKYQ4PDw1qK3EDCCMAiQ5BCV0LCj+FSDQkgCgGBiYHAy2MIgoMghAHqw4HAGsNDEMFBTekdgwKI7aRB2MwkL2rVHoQoWchACH5BAkHABAALAAAAAAYABgAAAWWICSOJLQsZZoGJEGQrDoGAioKwlzLIx7jIlqOFwSaXkfbqjU83ZBB3e4WK0qrCxyU55peid0qcUwuixyNx6PhILsAcAJazXYj4lvz2MkLiFsHDAlEcABKZwwMBX8pBgoKQxAIigpBA1sLBj+PSDQkB4uSACYDlTMyBgWDEKVnl2QFBUigN61gBQYjtLV5JZ4jtlR6omMhACH5BAkHABAALAAAAAAYABgAAAWaICSOJLQsZZoGJEGQrDoGAioKwlzLIx7jIlqOFwSaXkdbidYanm7I4AjwYDh6saJuJ3JUG1mZi9srPA7EcRimJLrfJYWZUVC8TziXnEG3u/E+cIJaPAFrPQl1aQAIbRAGBZGHJQiMUQKRBkEKbQsAPZaEXQcslSYKmjMyAAdXj34ACkNEiUgDA5t+PAQHn6Ogjkuzry2DNwhuIQAh+QQFBwAQACwAAAAAGAAYAAAFnCAkjiS0LGVaBgBJEGSguo8zCsK4CPIsMg+ECCcKEH0ix6MwhJl4KiOp8UCdmrEbo6EoHpxF8A6aBBZ6vhf5dmAkkGr0CoWs21WGQ2FvsI9xC3l7B311fy93iWGKJQQOhHCAJQB6A3IqcWwJLU90i2FkUiMKlhBELEI6MwgDXRAGhQgAYD6tTqRFAJxpA6mvrqazSKJJhUWMpjlIIQA7) center no-repeat}[_nghost-%COMP%] .pdfViewer .page .loadingIcon.notVisible{background:none}[_nghost-%COMP%] .pdfViewer.enablePermissions .textLayer span{-webkit-user-select:none!important;user-select:none!important;cursor:not-allowed}[_nghost-%COMP%] .pdfPresentationMode .pdfViewer{padding-bottom:0}[_nghost-%COMP%] .pdfPresentationMode .spread{margin:0}[_nghost-%COMP%] .pdfPresentationMode .pdfViewer .page{margin:0 auto;border:2px solid transparent}']})}return o})(),fd=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=_.$C({type:o});static \u0275inj=R.G2t({})}return o})();var pd=F(7089),Tr=F(4015);let Mr=(()=>{class o{getPdfViewerContainer(e){return e.closest("cue-pdf-viewer")?.querySelector(".ng2-pdf-viewer-container")}maintainCenterPosition(e,i,n){const s=this.getPdfViewerContainer(e);if(!s)return{...i,zoom:n(i.zoom)};const r=i.zoom,a=n(r);if(r===a)return i;const c={x:(s.scrollLeft+s.clientWidth/2)*(a/r)-s.clientWidth/2,y:(s.scrollTop+s.clientHeight/2)*(a/r)-s.clientHeight/2};return setTimeout(()=>{s.scrollLeft=Math.max(0,c.x),s.scrollTop=Math.max(0,c.y)},50),{...i,zoom:a,panOffset:c}}zoomAtPoint(e,i,n,s,r){const a=this.getPdfViewerContainer(e);if(!a)return{...i,zoom:n};const l=i.zoom;if(l===n)return i;const h=n/l,u={x:(a.scrollLeft+s)*h-s,y:(a.scrollTop+r)*h-r};return setTimeout(()=>{a.scrollLeft=Math.max(0,u.x),a.scrollTop=Math.max(0,u.y)},50),{...i,zoom:n,panOffset:u}}zoomIn(e,i){return this.maintainCenterPosition(e,i,n=>n+.25)}zoomOut(e,i){return this.maintainCenterPosition(e,i,n=>Math.max(i.minZoom,n-.25))}zoomFit(e,i){return this.maintainCenterPosition(e,i,()=>1)}setPanMode(e,i,n){const s=this.getPdfViewerContainer(e);return s&&(s.style.cursor=n?"grab":"default"),{...i,panMode:n}}startPan(e,i){const n=this.getPdfViewerContainer(e);return n?(i.preventDefault(),n.style.cursor="grabbing",{startX:i.clientX,startY:i.clientY,startScrollX:n.scrollLeft,startScrollY:n.scrollTop}):null}panMove(e,i,n){const s=this.getPdfViewerContainer(e);if(!s)return;i.preventDefault();const a=i.clientY-n.startY;s.scrollLeft=n.startScrollX-(i.clientX-n.startX),s.scrollTop=n.startScrollY-a}endPan(e,i){const n=this.getPdfViewerContainer(e);return n&&(n.style.cursor=i.panMode?"grab":"default"),{...i,panOffset:{x:n?.scrollLeft||0,y:n?.scrollTop||0}}}static \u0275fac=function(i){return new(i||o)};static \u0275prov=R.jDH({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})();var Lr=F(5381),gd=F(5187),Rr=F(2245),md=F(7888),bd=F(1696),_d=F(3319),Ir=F(6149);function vd(o,t){if(1&o){const e=_.RV6();_.j41(0,"cue-flexcontainer",3)(1,"cue-typography",7),_.EFF(2),_.nI1(3,"transloco"),_.k0s(),_.j41(4,"cue-select",8),_.mxI("valueChange",function(n){R.eBV(e);const s=_.XpG();return _.DH7(s.page,n)||(s.page=n),R.Njj(n)}),_.k0s()()}if(2&o){const e=_.XpG();_.R7$(2),_.JRh(_.bMT(3,5,"components.pdfViewer.labelPage")),_.R7$(2),_.R50("value",e.page),_.Y8G("menuPosition",e.selectMenuPositions())("options",e.pageOptions())("underline",!1)}}function Ad(o,t){if(1&o){const e=_.RV6();_.j41(0,"cue-flexcontainer",3)(1,"cue-button",9),_.nI1(2,"transloco"),_.bIt("click",function(){R.eBV(e);const n=_.XpG();return R.Njj(n.handleZoomOut())}),_.nrm(3,"cue-button-icon",10),_.k0s(),_.j41(4,"cue-button",9),_.nI1(5,"transloco"),_.bIt("click",function(){R.eBV(e);const n=_.XpG();return R.Njj(n.handleZoomIn())}),_.nrm(6,"cue-button-icon",11),_.k0s(),_.j41(7,"cue-button",12),_.nI1(8,"transloco"),_.bIt("click",function(){R.eBV(e);const n=_.XpG();return R.Njj(n.handleZoomFit())}),_.nrm(9,"cue-button-icon",13),_.k0s()()}if(2&o){const e=_.XpG();_.AVh("border-left",!e.pageSelectHidden()&&e.options().displayZoom),_.R7$(),_.Y8G("cueTooltip",_.bMT(2,6,"components.pdfViewer.tooltipZoomOut")),_.R7$(3),_.Y8G("cueTooltip",_.bMT(5,8,"components.pdfViewer.tooltipZoomIn")),_.R7$(3),_.Y8G("disabled",1===e.settings().zoom)("cueTooltip",_.bMT(8,10,"components.pdfViewer.tooltipZoomFit"))}}function yd(o,t){if(1&o){const e=_.RV6();_.j41(0,"cue-button",14),_.nI1(1,"transloco"),_.bIt("click",function(){R.eBV(e);const n=_.XpG();return R.Njj(n.handleRotate())}),_.nrm(2,"cue-button-icon",15),_.k0s()}if(2&o){const e=_.XpG();_.AVh("border-left",e.options().displayZoom&&e.options().displayRotate),_.Y8G("cueTooltip",_.bMT(1,3,"components.pdfViewer.tooltipRotate"))}}function wd(o,t){if(1&o){const e=_.RV6();_.j41(0,"cue-button",16),_.nI1(1,"transloco"),_.mxI("selectedChange",function(n){R.eBV(e);const s=_.XpG();return _.DH7(s.panMode,n)||(s.panMode=n),R.Njj(n)}),_.nrm(2,"cue-button-icon",17),_.k0s()}if(2&o){const e=_.XpG();_.AVh("border-left",e.options().displayRotate&&e.options().displayPan),_.Y8G("cueTooltip",_.bMT(1,5,"components.pdfViewer.tooltipPan")),_.R50("selected",e.panMode),_.Y8G("toggleButton",!0)}}let Ed=(()=>{class o{elementRef=(0,R.WQX)(_.aKT);panZoomService=(0,R.WQX)(Mr);options=(0,Q.hFB)(new Ir.g);settings=Q.geq.required();numPages=(0,Q.hFB)(1);page=(0,Q.geq)("1");panMode=(0,Q.geq)(!1);constructor(){(0,R.QZP)(()=>{const e=this.panMode();this.settings.update(i=>i.panMode!==e?this.panZoomService.setPanMode(this.elementRef.nativeElement,i,e):i)})}pageOptions=(0,It.EW)(()=>Array.from({length:this.numPages()},(e,i)=>(i+1).toString()));pageSelectHidden=(0,It.EW)(()=>{const e=this.options().displayPageSelect;return!!(this.options().hidePageSelectOnSinglePageDocument&&this.numPages()<2)||!e});selectMenuPositions=(0,It.EW)(()=>"top"===this.options().position?"bottomright":"topright");handleZoomIn(){this.settings.update(e=>this.panZoomService.zoomIn(this.elementRef.nativeElement,e))}handleZoomOut(){this.settings.update(e=>this.panZoomService.zoomOut(this.elementRef.nativeElement,e))}handleZoomFit(){this.settings.update(e=>this.panZoomService.zoomFit(this.elementRef.nativeElement,e))}handleRotate(){this.settings.update(e=>(e.rotation+=90,e))}static \u0275fac=function(i){return new(i||o)};static \u0275cmp=_.VBU({type:o,selectors:[["cue-pdf-toolbar"]],inputs:{options:[1,"options"],settings:[1,"settings"],numPages:[1,"numPages"],page:[1,"page"],panMode:[1,"panMode"]},outputs:{settings:"settingsChange",page:"pageChange",panMode:"panModeChange"},decls:7,vars:5,consts:[["justify","center",1,"container"],[1,"toolbar",3,"padded"],["align","center"],["align","center","gap","s"],["align","center","gap","s",3,"border-left"],["size","xs","variant","ghost",3,"cueTooltip","border-left"],["size","xs","variant","tertiary",3,"cueTooltip","border-left","selected","toggleButton"],["size","s"],["size","xs","placeholder","Select",3,"valueChange","value","menuPosition","options","underline"],["size","xs","variant","tertiary",3,"click","cueTooltip"],["icon","zoom-out"],["icon","zoom-in"],["size","xs","variant","tertiary",3,"click","disabled","cueTooltip"],["icon","zoom-fit"],["size","xs","variant","ghost",3,"click","cueTooltip"],["icon","rotate-2d"],["size","xs","variant","tertiary",3,"selectedChange","cueTooltip","selected","toggleButton"],["icon","move-click"]],template:function(i,n){1&i&&(_.j41(0,"cue-flexcontainer",0)(1,"cue-card",1)(2,"cue-flexcontainer",2),_.nVh(3,vd,5,7,"cue-flexcontainer",3),_.nVh(4,Ad,10,12,"cue-flexcontainer",4),_.nVh(5,yd,3,5,"cue-button",5),_.nVh(6,wd,3,7,"cue-button",6),_.k0s()()()),2&i&&(_.R7$(),_.Y8G("padded",!1),_.R7$(2),_.vxM(n.options().displayPageSelect&&!n.pageSelectHidden()?3:-1),_.R7$(),_.vxM(n.options().displayZoom?4:-1),_.R7$(),_.vxM(n.options().displayRotate?5:-1),_.R7$(),_.vxM(n.options().displayPan?6:-1))},dependencies:[Lr.n,gd.Z,Rr.o,md.l,bd.$,_d.a,pd.d,Tr.Kj],styles:[".container[_ngcontent-%COMP%]{width:100%;pointer-events:none}.toolbar[_ngcontent-%COMP%]{pointer-events:all;padding:5px 10px}.border-left[_ngcontent-%COMP%]{border-left:1px solid;padding-left:12px}"],changeDetection:0})}return o})();var xd=F(9769),Cd=F(2036),Sd=F(3191);let Or=(()=>{class o{_panZoomService;_hostEl;_settings;_minZoom;_startDistance=0;_startZoom=1;_touchStart=null;_touchMove=null;_touchEnd=null;_wheel=null;_virtualScroll={x:0,y:0};_lastPinchTime=0;pendingScroll=null;init(e,i,n,s){this._panZoomService=e,this._hostEl=i,this._settings=n,this._minZoom=s}attach(){const e=this._getContainer();!e||this._touchStart||(e.style.touchAction="none",this._touchStart=i=>{2===i.touches.length&&(i.preventDefault(),this._startDistance=o._dist(i.touches[0],i.touches[1]),this._startZoom=this._settings().zoom)},this._touchMove=i=>{if(2!==i.touches.length||0===this._startDistance)return;i.preventDefault();const n=o._dist(i.touches[0],i.touches[1])/this._startDistance,s=e.getBoundingClientRect();this._applyTransform(n,(i.touches[0].clientX+i.touches[1].clientX)/2-s.left,(i.touches[0].clientY+i.touches[1].clientY)/2-s.top)},this._touchEnd=i=>{if(i.touches.length>=2||0===this._startDistance)return;const s=this._hostEl.querySelector("pdf-viewer")?.style.transform.match(/scale\(([\d.]+)\)/),r=s?parseFloat(s[1]):1,a=Math.min(5,Math.max(this._minZoom(),this._startZoom*r));this._clearTransform(),this._settings.update(l=>this._panZoomService.zoomAtPoint(this._hostEl,l,a,e.clientWidth/2,e.clientHeight/2)),this._startDistance=0},this._wheel=i=>{if(!i.ctrlKey)return;i.preventDefault(),i.stopPropagation();const n=Date.now();n-this._lastPinchTime>300&&(this._virtualScroll={x:e.scrollLeft,y:e.scrollTop}),this._lastPinchTime=n;const s=this._settings().zoom,r=Math.min(5,Math.max(this._minZoom(),s*(1-.003*i.deltaY)));if(r===s)return;const a=e.getBoundingClientRect(),l=i.clientX-a.left,h=i.clientY-a.top,c=r/s;this._virtualScroll={x:Math.max(0,(this._virtualScroll.x+l)*c-l),y:Math.max(0,(this._virtualScroll.y+h)*c-h)},this.pendingScroll={...this._virtualScroll},this._settings.update(d=>({...d,zoom:r}))},e.addEventListener("touchstart",this._touchStart,{passive:!1}),e.addEventListener("touchmove",this._touchMove,{passive:!1}),e.addEventListener("touchend",this._touchEnd,{passive:!1}),e.addEventListener("wheel",this._wheel,{passive:!1,capture:!0}))}detach(){const e=this._getContainer();e&&(e.style.touchAction=""),this._touchStart&&(e?.removeEventListener("touchstart",this._touchStart),this._touchStart=null),this._touchMove&&(e?.removeEventListener("touchmove",this._touchMove),this._touchMove=null),this._touchEnd&&(e?.removeEventListener("touchend",this._touchEnd),this._touchEnd=null),this._wheel&&(e?.removeEventListener("wheel",this._wheel,{capture:!0}),this._wheel=null)}applyPendingScroll(){if(!this.pendingScroll)return;const e=this.pendingScroll;this.pendingScroll=null;const i=this._getContainer();i&&(i.scrollLeft=e.x,i.scrollTop=e.y)}handleDrawOverlayPinch(e){const i=this._getContainer();if(!i)return;const n=Date.now();n-this._lastPinchTime>300&&(this._virtualScroll={x:i.scrollLeft,y:i.scrollTop}),this._lastPinchTime=n;const s=this._settings().zoom,r=Math.min(5,Math.max(this._minZoom(),s*(1-.003*e.deltaY)));if(r===s)return;const a=i.getBoundingClientRect(),l=e.clientX-a.left,h=e.clientY-a.top,c=r/s;this._virtualScroll={x:Math.max(0,(this._virtualScroll.x+l)*c-l),y:Math.max(0,(this._virtualScroll.y+h)*c-h)},this.pendingScroll={...this._virtualScroll},this._settings.update(d=>({...d,zoom:r}))}handleOverlayTouchStart(e){2!==e.touches.length||!this._getContainer()||(this._startDistance=o._dist(e.touches[0],e.touches[1]),this._startZoom=this._settings().zoom)}handleOverlayTouchMove(e){if(2!==e.touches.length||0===this._startDistance)return;const i=this._getContainer();if(!i)return;const n=o._dist(e.touches[0],e.touches[1])/this._startDistance,s=i.getBoundingClientRect();this._applyTransform(n,(e.touches[0].clientX+e.touches[1].clientX)/2-s.left,(e.touches[0].clientY+e.touches[1].clientY)/2-s.top)}handleOverlayTouchEnd(e){if(e.touches.length>=2||0===this._startDistance)return;const i=this._getContainer();if(!i)return;const s=this._hostEl.querySelector("pdf-viewer")?.style.transform.match(/scale\(([\d.]+)\)/),r=s?parseFloat(s[1]):1,a=Math.min(5,Math.max(this._minZoom(),this._startZoom*r));this._clearTransform(),this._settings.update(l=>this._panZoomService.zoomAtPoint(this._hostEl,l,a,i.clientWidth/2,i.clientHeight/2)),this._startDistance=0}_getContainer(){return this._hostEl?.querySelector(".ng2-pdf-viewer-container")}static _dist(e,i){const n=i.clientX-e.clientX,s=i.clientY-e.clientY;return Math.sqrt(n*n+s*s)}_applyTransform(e,i,n){const s=this._hostEl.querySelector("pdf-viewer");s&&(s.style.transformOrigin=`${i}px ${n}px`,s.style.transform=`scale(${e})`)}_clearTransform(){const e=this._hostEl.querySelector("pdf-viewer");e&&(e.style.transform="",e.style.transformOrigin="")}static \u0275fac=function(i){return new(i||o)};static \u0275prov=R.jDH({token:o,factory:o.\u0275fac})}return o})(),Fr=(()=>{class o{_hostEl;canvasRect=(0,R.vPA)(null);_scrollListener=null;_canvasResizeObserver=null;init(e){this._hostEl=e}updateCanvasRect(){const e=this._hostEl?.querySelector(".container"),i=this._hostEl?.querySelector("pdf-viewer canvas");if(!e||!i)return void this.canvasRect.set(null);const n=e.getBoundingClientRect(),s=i.getBoundingClientRect();this.canvasRect.set({left:s.left-n.left,top:s.top-n.top,width:s.width,height:s.height})}attachCanvasResizeObserver(){if(this._canvasResizeObserver)return;const e=this._hostEl?.querySelector("pdf-viewer canvas");e&&(this._canvasResizeObserver=new ResizeObserver(()=>this.updateCanvasRect()),this._canvasResizeObserver.observe(e))}detachCanvasResizeObserver(){this._canvasResizeObserver?.disconnect(),this._canvasResizeObserver=null}attachScrollListener(){const e=this._hostEl?.querySelector(".ng2-pdf-viewer-container");!e||this._scrollListener||(this._scrollListener=()=>this.updateCanvasRect(),e.addEventListener("scroll",this._scrollListener,{passive:!0}))}detachScrollListener(){this._scrollListener&&(this._hostEl?.querySelector(".ng2-pdf-viewer-container")?.removeEventListener("scroll",this._scrollListener),this._scrollListener=null)}destroy(){this.detachScrollListener(),this.detachCanvasResizeObserver(),this.canvasRect.set(null)}static \u0275fac=function(i){return new(i||o)};static \u0275prov=R.jDH({token:o,factory:o.\u0275fac})}return o})();const Nr="cue-search-highlight";let Br=(()=>{class o{_hostEl;_searchService;_currentPage;_searchResults;pdfDoc=(0,R.vPA)(null);searchTerm=(0,R.vPA)("");allMatches=(0,R.vPA)([]);currentPageHighlights=(0,It.EW)(()=>{const e=this._currentPage?.()??1;return this.allMatches().filter(i=>i.page===e).map(i=>{const n=i.xywhStr.replace("percent:","").split(",").map(h=>parseFloat(h.trim()));if(4!==n.length||n.some(isNaN))return null;const[s,r,a,l]=n;return{x:s,y:r,width:a,height:l}}).filter(Boolean)});_scheduleTimer=null;_canvasResizeObserver=null;init(e){this._hostEl=e.hostEl,this._searchService=e.searchService,this._currentPage=e.currentPage,this._searchResults=e.searchResults}attachCanvasResizeObserver(){if(this._canvasResizeObserver)return;const e=this._hostEl.querySelector("pdf-viewer canvas");e&&(this._canvasResizeObserver=new ResizeObserver(()=>this.scheduleRender()),this._canvasResizeObserver.observe(e))}detachCanvasResizeObserver(){this._canvasResizeObserver?.disconnect(),this._canvasResizeObserver=null}destroy(){this.detachCanvasResizeObserver(),this._scheduleTimer&&clearTimeout(this._scheduleTimer)}runSearch(){var e=this;return(0,x.A)(function*(){const i=e.pdfDoc(),n=e.searchTerm();if(e.allMatches.set([]),!i||!n?.trim())return e.clearHighlights(),void e._searchResults.emit([]);const s=yield e._searchService.searchAll(i,n);e.allMatches.set(s),e._searchResults.emit(s),e.renderHighlights()})()}scheduleRender(){this._scheduleTimer&&clearTimeout(this._scheduleTimer),this._scheduleTimer=setTimeout(()=>this.renderHighlights(),50)}renderHighlights(){this.clearHighlights();const e=this.currentPageHighlights();if(0===e.length)return;const i=this._hostEl.querySelector("pdf-viewer .page"),n=this._hostEl.querySelector("pdf-viewer canvas");if(!i||!n)return;const s=n.clientWidth,r=n.clientHeight,a=i.getBoundingClientRect(),l=n.getBoundingClientRect(),h=l.left-a.left,c=l.top-a.top;for(const d of e){const u=document.createElement("div");u.className=Nr,u.style.cssText=`\n position: absolute;\n left: ${h+d.x/100*s}px;\n top: ${c+d.y/100*r}px;\n width: ${d.width/100*s}px;\n height: ${d.height/100*r}px;\n background-color: rgba(255, 200, 0, 0.40);\n border: 1.5px solid rgba(255, 160, 0, 0.85);\n border-radius: 2px;\n box-sizing: border-box;\n pointer-events: none;\n z-index: 4;\n animation: cue-highlight-pulse 2s ease-in-out infinite;\n `,i.appendChild(u)}o._ensureStyles()}clearHighlights(){this._hostEl?.querySelectorAll(`.${Nr}`).forEach(e=>e.remove())}static _stylesInjected=!1;static _ensureStyles(){if(o._stylesInjected)return;o._stylesInjected=!0;const e=document.createElement("style");e.textContent="\n @keyframes cue-highlight-pulse {\n 0%, 100% { background-color: rgba(255, 200, 0, 0.40); }\n 50% { background-color: rgba(255, 200, 0, 0.62); }\n }\n ",document.head.appendChild(e)}static \u0275fac=function(i){return new(i||o)};static \u0275prov=R.jDH({token:o,factory:o.\u0275fac})}return o})();var xn=F(8560),Td=F(5600);function Md(o,t){1&o&&(_.j41(0,"cue-typography",1),_.EFF(1),_.nI1(2,"transloco"),_.k0s()),2&o&&(_.R7$(),_.JRh(_.bMT(2,1,"components.pdfViewer.infoLoading")))}function Ld(o,t){if(1&o){const e=_.RV6();_.j41(0,"div",4),_.bIt("wheel",function(n){R.eBV(e);const s=_.XpG();return R.Njj(s.onDrawOverlayWheel(n))})("touchstart",function(n){R.eBV(e);const s=_.XpG();return R.Njj(s.onOverlayTouchStart(n))})("touchmove",function(n){R.eBV(e);const s=_.XpG();return R.Njj(s.onOverlayTouchMove(n))})("touchend",function(n){R.eBV(e);const s=_.XpG();return R.Njj(s.onOverlayTouchEnd(n))}),_.j41(1,"cue-image-viewer",5),_.mxI("drawingArtefactsChange",function(n){R.eBV(e);const s=_.XpG();return _.DH7(s.drawingArtefacts,n)||(s.drawingArtefacts=n),R.Njj(n)}),_.bIt("artefactDrawn",function(n){R.eBV(e);const s=_.XpG();return R.Njj(s.artefactDrawn.emit(n))})("artefactRemoved",function(n){R.eBV(e);const s=_.XpG();return R.Njj(s.artefactRemoved.emit(n))})("artefactSelected",function(n){R.eBV(e);const s=_.XpG();return R.Njj(s.artefactSelected.emit(n))})("artefactEdited",function(n){R.eBV(e);const s=_.XpG();return R.Njj(s.artefactEdited.emit(n))}),_.k0s()()}if(2&o){const e=t,i=_.XpG();_.xc7("left",e.left,"px")("top",e.top,"px")("width",e.width,"px")("height",e.height,"px"),_.AVh("draw-active",i.isEditOrDrawModeActive()),_.R7$(),_.Y8G("src",i._drawerSrc())("panDisabled",!0)("zoomDisabled",!0)("drawMode",i._drawMode())("drawnArtefactDef",i.drawnArtefactDef())("contextMenuItems",i.contextMenuItems()),_.R50("drawingArtefacts",i.drawingArtefacts),_.Y8G("toolbarOptions",i._drawerToolbar)}}function Rd(o,t){if(1&o){const e=_.RV6();_.j41(0,"cue-pdf-toolbar",7),_.mxI("pageChange",function(n){R.eBV(e),_.XpG(2);const s=_.r8f(2);return _.DH7(s.page,n)||(s.page=n),R.Njj(n)})("settingsChange",function(n){R.eBV(e);const s=_.XpG(2);return _.DH7(s.settings,n)||(s.settings=n),R.Njj(n)})("panModeChange",function(n){R.eBV(e);const s=_.XpG(2);return _.DH7(s.panMode,n)||(s.panMode=n),R.Njj(n)}),_.k0s()}if(2&o){const e=_.XpG(),i=_.XpG(),n=_.r8f(2);_.Aen(i.toolbarStyle()),_.Y8G("options",e),_.R50("page",n.page)("settings",i.settings),_.Y8G("numPages",i.numPages()),_.R50("panMode",i.panMode)}}function Id(o,t){1&o&&_.nVh(0,Rd,1,7,"cue-pdf-toolbar",6),2&o&&_.vxM(t.hidden?-1:0)}let kd=(()=>{class o{elementRef=(0,R.WQX)(_.aKT);panZoomSvc=(0,R.WQX)(Mr);searchSvc=(0,R.WQX)(Sd.g);drawing=(0,R.WQX)(Fr);pinch=(0,R.WQX)(Or);highlight=(0,R.WQX)(Br);src=(0,Q.hFB)("");settings=(0,Q.geq)(new Ir._);panMode=(0,Q.geq)(!1);drawMode=(0,Q.hFB)("none");contextMenuItems=(0,Q.hFB)([]);drawnArtefactDef=(0,Q.hFB)({allowRemove:!0,color:"rgba(0, 120, 255, 0.8)"});searchTerm=(0,Q.hFB)("");searchResults=(0,Q.CGW)();pdfLoaded=(0,Q.CGW)();drawingArtefacts=(0,Q.geq)((0,Cd.x)());artefactDrawn=(0,Q.CGW)();artefactRemoved=(0,Q.CGW)();artefactSelected=(0,Q.CGW)();artefactEdited=(0,Q.CGW)();_imageViewer=(0,Q.ebz)(xn.ImageViewer);activateEditForBbox(e){const i=this._imageViewer();i&&i.editService.startEditArtefact("bbox",e)}numPages=(0,R.vPA)(1);loading=(0,R.vPA)(!0);minZoom=(0,R.vPA)(.1);isPanning=(0,R.vPA)(!1);panStart=(0,R.vPA)(null);isMiddlePanning=(0,R.vPA)(!1);middlePanStart=(0,R.vPA)(null);_midMoveListener=this._onMiddlePanMove.bind(this);_midUpListener=this._onMiddlePanUp.bind(this);isDrawModeActive=(0,It.EW)(()=>"none"!==this._drawMode());isEditOrDrawModeActive=(0,It.EW)(()=>this.isDrawModeActive()||this.settings().editMode||null!==this._imageViewer()?.editService.editingArtefact());_lastScrolledBbox=null;_drawMode=(0,It.EW)(()=>{const e=this.settings().drawMode||this.drawMode();return"xywh"===e||"polygon"===e||"circle"===e?e:"none"});_drawerSrc=(0,It.EW)(()=>{const e=this.drawing.canvasRect();return e?`data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="${2*Math.round(e.width/2)}" height="${2*Math.round(e.height/2)}"/>`:""});_drawerToolbar=Object.assign(new Td.g,{hidden:!0});currentPageNum=(0,It.EW)(()=>Number(this.settings().page)||1);constructor(){const e=this.elementRef.nativeElement;this.pinch.init(this.panZoomSvc,e,this.settings,this.minZoom),this.drawing.init(e),this.highlight.init({hostEl:e,searchService:this.searchSvc,currentPage:this.currentPageNum,searchResults:this.searchResults}),(0,R.QZP)(()=>{this.settings.update(i=>this.panZoomSvc.setPanMode(e,i,this.panMode()))}),(0,R.QZP)(()=>{this.highlight.pdfDoc();const n=this.searchTerm();this.highlight.searchTerm.set(n),this.highlight.runSearch()}),(0,R.QZP)(()=>{0===this.highlight.currentPageHighlights().length&&this.highlight.clearHighlights(),this.highlight.scheduleRender()}),(0,R.QZP)(()=>{const i=this.settings().drawingArtefacts;this.drawingArtefacts.set(i)}),(0,R.QZP)(()=>{const i=this._imageViewer(),n=this.settings().editMode,s=this.drawingArtefacts();!i||!n||0===s.xywhs.length||queueMicrotask(()=>this.activateEditForBbox(0))}),(0,R.QZP)(()=>{const i=this.drawingArtefacts(),n=this.drawing.canvasRect(),s=i.xywhs[0];s?n&&this._lastScrolledBbox!==s.xywhStr&&(this._lastScrolledBbox=s.xywhStr,this.scrollToBbox(s)):this._lastScrolledBbox=null})}ngOnDestroy(){this.pinch.detach(),this.drawing.destroy(),this.highlight.destroy(),this._stopMiddlePan()}onPdfLoaded(e){var i=this;return(0,x.A)(function*(){i.numPages.set(e.numPages),i.loading.set(!1),i.highlight.pdfDoc.set(e),i.pdfLoaded.emit(e)})()}onPageRendered(){this.drawing.detachScrollListener(),this.drawing.attachScrollListener(),this.drawing.detachCanvasResizeObserver(),this.drawing.attachCanvasResizeObserver(),this.highlight.detachCanvasResizeObserver(),this.highlight.attachCanvasResizeObserver(),this._updateMinZoom(),this.highlight.renderHighlights(),this.pinch.attach(),this.pinch.applyPendingScroll(),requestAnimationFrame(()=>this.drawing.updateCanvasRect())}toolbarStyle(){const e=this.settings().toolbarOptions;return`left:${e.margin};right:${e.margin};${"top"===e.position?"top":"bottom"}:${e.margin}`}_overlayPinching=!1;onOverlayTouchStart(e){e.touches.length>=2&&(e.preventDefault(),this._overlayPinching=!0,this.pinch.handleOverlayTouchStart(e))}onOverlayTouchMove(e){(this._overlayPinching||e.touches.length>=2)&&(e.preventDefault(),this._overlayPinching=!0,this.pinch.handleOverlayTouchMove(e))}onOverlayTouchEnd(e){this._overlayPinching&&(this.pinch.handleOverlayTouchEnd(e),e.touches.length<2&&(this._overlayPinching=!1))}onMouseDown(e){if(1===e.button){e.preventDefault();const n=this.panZoomSvc.startPan(this.elementRef.nativeElement,e);return void(n&&(this.isMiddlePanning.set(!0),this.middlePanStart.set(n),window.addEventListener("mousemove",this._midMoveListener),window.addEventListener("mouseup",this._midUpListener)))}if(!this.panMode()||0!==e.button)return;const i=this.panZoomSvc.startPan(this.elementRef.nativeElement,e);i&&(this.isPanning.set(!0),this.panStart.set(i))}onMouseMove(e){!this.isPanning()||!this.panStart()||this.panZoomSvc.panMove(this.elementRef.nativeElement,e,this.panStart())}onMouseUp(){this.isPanning()&&(this.settings.update(e=>this.panZoomSvc.endPan(this.elementRef.nativeElement,e)),this.isPanning.set(!1),this.panStart.set(null))}_onMiddlePanMove(e){!this.isMiddlePanning()||!this.middlePanStart()||this.panZoomSvc.panMove(this.elementRef.nativeElement,e,this.middlePanStart())}_onMiddlePanUp(e){1===e.button&&this._stopMiddlePan()}_stopMiddlePan(){window.removeEventListener("mousemove",this._midMoveListener),window.removeEventListener("mouseup",this._midUpListener),this.isMiddlePanning()&&(this.settings.update(e=>this.panZoomSvc.endPan(this.elementRef.nativeElement,e)),this.isMiddlePanning.set(!1),this.middlePanStart.set(null))}onDrawOverlayWheel(e){const i=this.elementRef.nativeElement.querySelector(".ng2-pdf-viewer-container");i&&(e.preventDefault(),e.ctrlKey?this.pinch.handleDrawOverlayPinch(e):(i.scrollTop+=e.deltaY,i.scrollLeft+=e.deltaX))}scrollToBbox(e){const i=this.elementRef.nativeElement.querySelector(".ng2-pdf-viewer-container"),n=this.elementRef.nativeElement.querySelector(".container"),s=this.drawing.canvasRect();if(!i||!n||!s)return;const a=e.xywhStr.replace("percent:","").split(",").map(Number);if(a.length<4||a.some(isNaN))return;const[,l,,h]=a,c=n.getBoundingClientRect(),d=i.getBoundingClientRect();i.scrollBy({top:c.top+s.top+l/100*s.height+h/100*s.height/2-(d.top+d.height/2),behavior:"smooth"})}_updateMinZoom(){const e=this.elementRef.nativeElement.querySelector(".ng2-pdf-viewer-container");if(!e)return;const i=e.querySelector("canvas");if(!i)return;const n=this.settings().zoom;if(n<=0)return;const s=i.offsetWidth/n,r=i.offsetHeight/n;if(s<=0||r<=0)return;const a=Math.min(e.clientWidth/s,e.clientHeight/r),l=Math.max(.05,a);this.minZoom.set(l),this.settings.update(h=>({...h,minZoom:l}))}static \u0275fac=function(i){return new(i||o)};static \u0275cmp=_.VBU({type:o,selectors:[["cue-pdf-viewer"]],viewQuery:function(i,n){1&i&&_.wEZ(n._imageViewer,xn.ImageViewer,5),2&i&&_.NyB()},inputs:{src:[1,"src"],settings:[1,"settings"],panMode:[1,"panMode"],drawMode:[1,"drawMode"],contextMenuItems:[1,"contextMenuItems"],drawnArtefactDef:[1,"drawnArtefactDef"],searchTerm:[1,"searchTerm"],drawingArtefacts:[1,"drawingArtefacts"]},outputs:{settings:"settingsChange",panMode:"panModeChange",searchResults:"searchResults",pdfLoaded:"pdfLoaded",drawingArtefacts:"drawingArtefactsChange",artefactDrawn:"artefactDrawn",artefactRemoved:"artefactRemoved",artefactSelected:"artefactSelected",artefactEdited:"artefactEdited"},features:[_.Jv_([Or,Fr,Br])],decls:6,vars:25,consts:[["direction","column","align","center","justify","center",1,"container",3,"mousedown","mousemove","mouseup","mouseleave"],[1,"info"],[2,"width","100%","height","100%",3,"after-load-complete","page-rendered","src","page","render-text","render-text-mode","original-size","stick-to-page","zoom","rotation","external-link-target","autoresize","fit-to-page","show-borders","show-all"],[1,"drawing-overlay",3,"draw-active","left","top","width","height"],[1,"drawing-overlay",3,"wheel","touchstart","touchmove","touchend"],["fitMode","contain",2,"width","100%","height","100%",3,"drawingArtefactsChange","artefactDrawn","artefactRemoved","artefactSelected","artefactEdited","src","panDisabled","zoomDisabled","drawMode","drawnArtefactDef","contextMenuItems","drawingArtefacts","toolbarOptions"],[3,"style","options","page","settings","numPages","panMode"],[3,"pageChange","settingsChange","panModeChange","options","page","settings","numPages","panMode"]],template:function(i,n){if(1&i&&(_.j41(0,"cue-flexcontainer",0),_.bIt("mousedown",function(r){return n.onMouseDown(r)})("mousemove",function(r){return n.onMouseMove(r)})("mouseup",function(){return n.onMouseUp()})("mouseleave",function(){return n.onMouseUp()}),_.nVh(1,Md,3,3,"cue-typography",1),_.SS7(2),_.j41(3,"pdf-viewer",2),_.bIt("after-load-complete",function(r){return n.onPdfLoaded(r)})("page-rendered",function(){return n.onPageRendered()}),_.k0s(),_.nVh(4,Ld,2,18,"div",3),_.nVh(5,Id,1,1),_.k0s()),2&i){let s,r;_.AVh("pan-mode",n.panMode())("draw-mode",n.isDrawModeActive())("edit-mode",n.isEditOrDrawModeActive())("middle-panning",n.isMiddlePanning()),_.R7$(),_.vxM(n.loading()?1:-1),_.R7$();const a=_.bH3(n.settings());_.R7$(),_.Y8G("src",n.src())("page",a.page)("render-text",a.renderText)("render-text-mode",a.renderTextMode)("original-size",a.originalSize)("stick-to-page",a.stickToPage)("zoom",a.zoom)("rotation",a.rotation)("external-link-target",a.externalLinkTarget)("autoresize",a.autoresize)("fit-to-page",a.fitToPage)("show-borders",a.showBorders)("show-all",!1),_.R7$(),_.vxM((s=n.drawing.canvasRect())?4:-1,s),_.R7$(),_.vxM((r=a.toolbarOptions)?5:-1,r)}},dependencies:[fd,ud,Ed,Rr.o,Lr.n,xd.MD,xn.ImageViewer,Tr.Kj],styles:["[_nghost-%COMP%]{display:contents}.container[_ngcontent-%COMP%]{width:100%;height:100%;position:relative}.container.pan-mode[_ngcontent-%COMP%]{cursor:grab;-webkit-user-select:none;user-select:none}.container.pan-mode[_ngcontent-%COMP%]:active{cursor:grabbing}.container.draw-mode[_ngcontent-%COMP%]{cursor:crosshair;-webkit-user-select:none;user-select:none}.container.edit-mode[_ngcontent-%COMP%]{cursor:move;-webkit-user-select:none;user-select:none}.container.middle-panning[_ngcontent-%COMP%], .container.middle-panning[_ngcontent-%COMP%] .drawing-overlay[_ngcontent-%COMP%]{cursor:grabbing!important;-webkit-user-select:none;user-select:none}cue-pdf-toolbar[_ngcontent-%COMP%]{position:absolute;z-index:10}.info[_ngcontent-%COMP%]{position:absolute;top:50%;transform:translateY(-50%)}.drawing-overlay[_ngcontent-%COMP%]{position:absolute;z-index:5;background:transparent;pointer-events:none}.drawing-overlay.draw-active[_ngcontent-%COMP%]{pointer-events:auto}.drawing-overlay[_ngcontent-%COMP%] .container, .drawing-overlay[_ngcontent-%COMP%] cue-pan-zoom, .drawing-overlay[_ngcontent-%COMP%] .image-container{background:transparent!important}.drawing-overlay[_ngcontent-%COMP%] img{opacity:0!important}"],changeDetection:0})}return o})()}}]);
1
+ (self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[83],{3083(k1,Ra,dt){"use strict";dt.d(Ra,{DXFViewer:()=>ZM});var Pn={};dt.r(Pn),dt.d(Pn,{ArcCurve:()=>vv,CatmullRomCurve3:()=>yv,CubicBezierCurve:()=>_6,CubicBezierCurve3:()=>wv,EllipseCurve:()=>kl,LineCurve:()=>b6,LineCurve3:()=>Av,QuadraticBezierCurve:()=>S6,QuadraticBezierCurve3:()=>Cv,SplineCurve:()=>M6});var pt=dt(467),Pi=dt(9769),ie=dt(5802),ke=dt(7705),Lt=dt(2271),Kn=dt(7629);function Nt(i){this._pointer=0,this._data=i,this._eof=!1}function br(i,e){return i<=9?e:i>=10&&i<=59?parseFloat(e.trim()):i>=60&&i<=99?parseInt(e.trim()):i>=100&&i<=109?e:i>=110&&i<=149?parseFloat(e.trim()):i>=160&&i<=179?parseInt(e.trim()):i>=210&&i<=239?parseFloat(e.trim()):i>=270&&i<=289?parseInt(e.trim()):i>=290&&i<=299?function U1(i){if("0"===i)return!1;if("1"===i)return!0;throw TypeError("String '"+i+"' cannot be cast to Boolean type")}(e.trim()):i>=300&&i<=369?e:i>=370&&i<=389?parseInt(e.trim()):i>=390&&i<=399?e:i>=400&&i<=409?parseInt(e.trim()):i>=410&&i<=419?e:i>=420&&i<=429?parseInt(e.trim()):i>=430&&i<=439?e:i>=440&&i<=459?parseInt(e.trim()):i>=460&&i<=469?parseFloat(e.trim()):i>=470&&i<=481||999===i||i>=1e3&&i<=1009?e:i>=1010&&i<=1059?parseFloat(e.trim()):i>=1060&&i<=1071?parseInt(e.trim()):(console.log("WARNING: Group code does not have a defined type: %j",{code:i,value:e}),e)}Nt.prototype.next=function(){var i;if(!this.hasNext())throw this._eof?new Error("Cannot call 'next' after EOF group has been read"):new Error("Unexpected end of input: EOF group not read before end of file. Ended on code "+this._data[this._pointer]);if(i={code:parseInt(this._data[this._pointer])},isNaN(i.code))throw new Error("Cannot parse group code: "+this._data[this._pointer]);return this._pointer++,i.value=br(i.code,this._data[this._pointer]),this._pointer++,0===i.code&&"EOF"===i.value&&(this._eof=!0),this.lastReadGroup=i,i},Nt.prototype.peek=function(){if(!this.hasNext())throw this._eof?new Error("Cannot call 'next' after EOF group has been read"):new Error("Unexpected end of input: EOF group not read before end of file. Ended on code "+this._data[this._pointer]);var i={code:parseInt(this._data[this._pointer])};if(isNaN(i.code))throw new Error("Cannot parse group code: "+this._data[this._pointer]);return i.value=br(i.code,this._data[this._pointer+1]),i},Nt.prototype.rewind=function(i){this._pointer=this._pointer-2*(i=i||1)},Nt.prototype.hasNext=function(){return!(this._eof||this._pointer>this._data.length-2)},Nt.prototype.isEOF=function(){return this._eof};const Sr=[0,16711680,16776960,65280,65535,255,16711935,16777215,8421504,12632256,16711680,16744319,13369344,13395558,10027008,10046540,8323072,8339263,4980736,4990502,16727808,16752511,13382400,13401958,10036736,10051404,8331008,8343359,4985600,4992806,16744192,16760703,13395456,13408614,10046464,10056268,8339200,8347455,4990464,4995366,16760576,16768895,13408512,13415014,10056192,10061132,8347392,8351551,4995328,4997670,16776960,16777087,13421568,13421670,10000384,10000460,8355584,8355647,5000192,5000230,12582656,14679935,10079232,11717734,7510016,8755276,6258432,7307071,3755008,4344870,8388352,12582783,6736896,10079334,5019648,7510092,4161280,6258495,2509824,3755046,4194048,10485631,3394560,8375398,2529280,6264908,2064128,5209919,1264640,3099686,65280,8388479,52224,6736998,38912,5019724,32512,4161343,19456,2509862,65343,8388511,52275,6737023,38950,5019743,32543,4161359,19475,2509871,65407,8388543,52326,6737049,38988,5019762,32575,4161375,19494,2509881,65471,8388575,52377,6737074,39026,5019781,32607,4161391,19513,2509890,65535,8388607,52428,6737100,39064,5019800,32639,4161407,19532,2509900,49151,8380415,39372,6730444,29336,5014936,24447,4157311,14668,2507340,32767,8372223,26316,6724044,19608,5010072,16255,4153215,9804,2505036,16383,8364031,13260,6717388,9880,5005208,8063,4149119,4940,2502476,255,8355839,204,6710988,152,5000344,127,4145023,76,2500172,4129023,10452991,3342540,8349388,2490520,6245528,2031743,5193599,1245260,3089996,8323327,12550143,6684876,10053324,4980888,7490712,4128895,6242175,2490444,3745356,12517631,14647295,10027212,11691724,7471256,8735896,6226047,7290751,3735628,4335180,16711935,16744447,13369548,13395660,9961624,9981080,8323199,8339327,4980812,4990540,16711871,16744415,13369497,13395634,9961586,9981061,8323167,8339311,4980793,4990530,16711807,16744383,13369446,13395609,9961548,9981042,8323135,8339295,4980774,4990521,16711743,16744351,13369395,13395583,9961510,9981023,8323103,8339279,4980755,4990511,3355443,5987163,8684676,11382189,14079702,16777215];var ze=dt(190);class B1{constructor(){this.appName=null,this.appNameWarningShown=!1,this.lastString=null,this.sectionStack=[this._CreateSection()],this.failure=!1}Feed(e){if(!this.appName)return 1001==e.code?(this.appName=e.value,!1):(this.appNameWarningShown||(this.appNameWarningShown=!0,ze.warn("XDATA section does not start with application name")),!1);if(1001==e.code)return!0;if(this.failure)return!1;if(1e3==e.code)return this.lastString&&ze.warn("XDATA section unused string: "+this.lastString),this.lastString=e.value,!1;const t=this._currentSection;if(1002==e.code){if("{"==e.value){if(!this.lastString)return ze.warn("Unnamed XDATA section encountered"),this.failure=!0,!1;const n=this._CreateSection();return t[this.lastString]=n,this.lastString=null,this.sectionStack.push(n),!1}return"}"==e.value?this.sectionStack.length<2?(ze.warn("Unmatched XDATA section closing"),this.failure=!0,!1):(this.sectionStack.length=this.sectionStack.length-1,!1):(ze.warn("Bad XDATA section control string encountered: "+e.value),this.failure=!0,!1)}return null!==this.lastString&&(t.values.push(this._CreateValue(1e3,this.lastString)),this.lastString=null),t.values.push(this._CreateValue(e.code,e.value)),!1}Finish(e){if(!this.failure&&this.appName){let t;e.hasOwnProperty("xdata")?t=e.xdata:(t={},e.xdata=t),t[this.appName]=this.sectionStack[0]}}get _currentSection(){return this.sectionStack[this.sectionStack.length-1]}_CreateSection(){return{values:[]}}_CreateValue(e,t){return{code:e,value:t}}}function Ve(i){var e={};i.rewind();var t=i.next(),n=t.code;if(e.x=t.value,n+=10,(t=i.next()).code!==n)throw new Error("Expected code for point value to be "+n+" but got "+t.code+".");return e.y=t.value,n+=10,(t=i.next()).code!==n?(i.rewind(),e):(e.z=t.value,e)}function La(i){i.rewind();let e=i.next();if(101!==e.code)throw new Error("Bad call for skipEmbeddedObject()");do{e=i.next()}while(0!==e.code);i.rewind()}function je(i,e,t){let n=null;for(;e.code>=1e3;)null==n&&(n=new B1),n.Feed(e)?(n.Finish(i),n=null):e=t.next();if(n)return n.Finish(i),t.rewind(),!0;switch(e.code){case 0:i.type=e.value;break;case 5:i.handle=e.value;break;case 6:i.lineType=e.value;break;case 8:i.layer=e.value;break;case 48:i.lineTypeScale=e.value;break;case 60:i.hidden=!!e.value;break;case 62:i.colorIndex=e.value,i.color=function G1(i){return Sr[i]}(Math.abs(e.value));break;case 67:i.inPaperSpace=0!==e.value;break;case 100:break;case 330:i.ownerHandle=e.value;break;case 347:i.materialObjectHandle=e.value;break;case 370:i.lineweight=e.value;break;case 420:i.color=e.value;break;default:return!1}return!0}function qt(){}function lt(i,e){var n,t=[],s=!1,r=!1;for(n=0;n<=4;n++){for(var o={};"EOF"!==e&&0!==e.code&&!r;){switch(e.code){case 10:case 11:case 12:case 13:if(s){r=!0;continue}o.x=e.value,s=!0;break;case 20:case 21:case 22:case 23:o.y=e.value;break;case 30:case 31:case 32:case 33:o.z=e.value;break;default:return t}e=i.next()}t.push(o),s=!1,r=!1}return i.rewind(),t}function $n(){}function Ri(){}function fn(){}function d0(){}function Mr(){}function ms(){}function Er(){}function Rn(){}function gs(){}function Et(i,e){if(!i||i<=0)throw Error("n must be greater than 0 vertices");var n,t=[],s=!1,r=!1,a=e.lastReadGroup;for(n=0;n<i;n++){for(var o={};"EOF"!==a&&0!==a.code&&!r;){switch(a.code){case 10:if(s){r=!0;continue}o.x=a.value,s=!0;break;case 20:o.y=a.value;break;case 30:o.z=a.value;break;case 40:o.startWidth=a.value;break;case 41:o.endWidth=a.value;break;case 42:0!=a.value&&(o.bulge=a.value);break;case 91:o.id=a.value;break;default:return s&&t.push(o),e.rewind(),t}a=e.next()}t.push(o),s=!1,r=!1}return e.rewind(),t}function Zt(){}function Qn(){}function vs(){}function Tr(){}function s8(i,e){var t={type:e.value};for(e=i.next();"EOF"!=e&&0!=e.code;)je(t,e,i),e=i.next();return t}function z1(){}function H1(){}function V1(){}function W1(){}function r8(i,e){let t=null;const n=()=>{const l={vertices:[],isClosed:!1};let c=!1,u=0;for(;;){if(u>0){for(let f=0;f<u&&10==i.code;f++){const d=Ve(e);42==(i=e.next()).code&&(d.bulge=i.value,i=e.next()),l.vertices.push(d)}return l}switch(i.code){case 72:c=i.value;break;case 73:l.isClosed=i.value;break;case 93:u=i.value;break;default:return l}i=e.next()}},s=()=>{if(72!=i.code)return null;const l={type:i.value};i=e.next();const c=4==l.type;for(;;){switch(i.code){case 10:c?(l.controlPoints||(l.controlPoints=[]),l.controlPoints.push(Ve(e))):l.start=Ve(e);break;case 11:c?(l.fitPoints||(l.fitPoints=[]),l.fitPoints.push(Ve(e))):l.end=Ve(e);break;case 40:c?(l.knotValues||(l.knotValues=[]),l.knotValues.push(i.value)):l.radius=i.value;break;case 50:l.startAngle=i.value*Math.PI/180;break;case 51:l.endAngle=i.value*Math.PI/180;break;case 73:c?l.rational=i.value:l.isCcw=i.value;break;case 74:l.periodic=i.value;break;case 94:l.degreeOfSplineCurve=i.value;break;case 95:case 96:case 40:case 42:case 97:break;default:return l}i=e.next()}};let r=!1,a=0,o=0;for(;;){if(!t){if(92!=i.code)return null;t={type:i.value,isExternal:!!(1&i.value),isOutermost:!!(16&i.value)},i=e.next()}for(2&t.type&&!r&&(t.polyline=n(),r=!0);a;){const l=s();l?(t.edges.push(l),a--):a=0}for(;o;)330==i.code?(t.sourceRefs.push(i.value),o--,i=e.next()):o=0;switch(i.code){case 93:a=i.value,a>0&&(t.edges=[]);break;case 97:o=i.value,o>0&&(t.sourceRefs=[]);break;default:return e.rewind(),t}i=e.next()}}function a8(i,e){if(53!=i.code)return null;const t={angle:i.value*Math.PI/180,base:{x:0,y:0},offset:{x:0,y:0}};i=e.next();let n=0;for(;;){switch(i.code){case 43:t.base.x=i.value;break;case 44:t.base.y=i.value;break;case 45:t.offset.x=i.value;break;case 46:t.offset.y=i.value;break;case 49:n>0&&(t.dashes.push(i.value),n--);break;case 79:n=i.value,i.value&&(t.dashes=[]);break;default:return e.rewind(),t}i=e.next()}}function o8(i,e){return 10!=i.code?null:Ve(e)}qt.ForEntityName="3DFACE",qt.prototype.parseEntity=function(i,e){var t={type:e.value,vertices:[]};for(e=i.next();"EOF"!==e&&0!==e.code;){switch(e.code){case 70:t.shape=!(1&~e.value),t.hasContinuousLinetypePattern=!(128&~e.value);break;case 10:t.vertices=lt(i,e),e=i.lastReadGroup;break;default:je(t,e,i)}e=i.next()}return t},$n.ForEntityName="ARC",$n.prototype.parseEntity=function(i,e){var t;for(t={type:e.value},e=i.next();"EOF"!==e&&0!==e.code;){switch(e.code){case 10:t.center=Ve(i);break;case 40:t.radius=e.value;break;case 50:t.startAngle=Math.PI/180*e.value;break;case 51:t.endAngle=Math.PI/180*e.value;break;case 210:t.extrusionDirection=Ve(i);break;default:je(t,e,i)}e=i.next()}return t},Ri.ForEntityName="ATTDEF",Ri.prototype.parseEntity=function(i,e){var t={type:e.value,scale:1,textStyle:"STANDARD"};for(e=i.next();"EOF"!==e&&0!==e.code;){switch(e.code){case 1:t.text=e.value;break;case 2:t.tag=e.value;break;case 3:t.prompt=e.value;break;case 7:t.textStyle=e.value;break;case 10:t.startPoint=Ve(i);break;case 11:t.endPoint=Ve(i);break;case 39:t.thickness=e.value;break;case 40:t.textHeight=e.value;break;case 41:t.scale=e.value;break;case 50:t.rotation=e.value;break;case 51:t.obliqueAngle=e.value;break;case 70:t.hidden=!!(1&e.value),t.constant=!!(2&e.value),t.verificationRequired=!!(4&e.value),t.preset=!!(8&e.value);break;case 71:t.backwards=!!(2&e.value),t.mirrored=!!(4&e.value);break;case 72:t.horizontalJustification=e.value;break;case 73:t.fieldLength=e.value;break;case 74:t.verticalJustification=e.value;break;case 100:break;case 101:La(i);break;case 210:t.extrusionDirection=Ve(i);break;default:je(t,e,i)}e=i.next()}return t},fn.ForEntityName="ATTRIB",fn.prototype.parseEntity=function(i,e){var t={type:e.value,scale:1,textStyle:"STANDARD"};for(e=i.next();"EOF"!==e&&0!==e.code;){switch(e.code){case 1:t.text=e.value;break;case 2:t.tag=e.value;break;case 3:t.prompt=e.value;break;case 7:t.textStyle=e.value;break;case 10:t.startPoint=Ve(i);break;case 11:t.endPoint=Ve(i);break;case 39:t.thickness=e.value;break;case 40:t.textHeight=e.value;break;case 41:t.scale=e.value;break;case 44:t.lineSpacingFactor=e.value;break;case 45:t.fillBoxScale=e.value;break;case 46:t.annotationHeight=e.value;break;case 50:t.rotation=e.value;break;case 51:t.obliqueAngle=e.value;break;case 63:t.backgroundFillColor=e.value;break;case 70:t.hidden=!!(1&e.value),t.constant=!!(2&e.value),t.verificationRequired=!!(4&e.value),t.preset=!!(8&e.value);break;case 71:t.attachmentPoint=e.value;break;case 72:t.horizontalJustification=e.value;break;case 73:t.lineSpacing=e.value;break;case 74:t.verticalJustification=e.value;break;case 90:t.backgroundFillSetting=e.value;break;case 100:break;case 210:t.extrusionDirection=Ve(i);break;case 280:t.lockPositionFlag=e.value;break;case 340:t.hardPointerId=e.value;break;default:je(t,e,i)}e=i.next()}return t},d0.ForEntityName="CIRCLE",d0.prototype.parseEntity=function(i,e){var t,n;for(t={type:e.value},e=i.next();"EOF"!==e&&0!==e.code;){switch(e.code){case 10:t.center=Ve(i);break;case 40:t.radius=e.value;break;case 50:t.startAngle=Math.PI/180*e.value;break;case 51:n=Math.PI/180*e.value,t.angleLength=n<t.startAngle?n+2*Math.PI-t.startAngle:n-t.startAngle,t.endAngle=n;break;case 210:t.extrusionDirection=Ve(i);break;default:je(t,e,i)}e=i.next()}return t},Mr.ForEntityName="DIMENSION",Mr.prototype.parseEntity=function(i,e){var t;for(t={type:e.value},e=i.next();"EOF"!==e&&0!==e.code;){switch(e.code){case 2:t.block=e.value;break;case 3:t.styleName=e.value;break;case 10:t.anchorPoint=Ve(i);break;case 11:t.middleOfText=Ve(i);break;case 12:t.insertionPoint=Ve(i);break;case 13:t.linearOrAngularPoint1=Ve(i);break;case 14:t.linearOrAngularPoint2=Ve(i);break;case 15:t.diameterOrRadiusPoint=Ve(i);break;case 16:t.arcPoint=Ve(i);break;case 70:t.dimensionType=e.value;break;case 71:t.attachmentPoint=e.value;break;case 42:t.actualMeasurement=e.value;break;case 1:t.text=e.value;break;case 50:t.angle=e.value;break;case 53:t.textRotation=e.value;break;default:je(t,e,i)}e=i.next()}return t},ms.ForEntityName="ELLIPSE",ms.prototype.parseEntity=function(i,e){var t;for(t={type:e.value},e=i.next();"EOF"!==e&&0!==e.code;){switch(e.code){case 10:t.center=Ve(i);break;case 11:t.majorAxisEndPoint=Ve(i);break;case 40:t.axisRatio=e.value;break;case 41:t.startAngle=e.value;break;case 42:t.endAngle=e.value;break;case 2:t.name=e.value;break;case 210:t.extrusionDirection=Ve(i);break;default:je(t,e,i)}e=i.next()}return t},Er.ForEntityName="INSERT",Er.prototype.parseEntity=function(i,e){var t;for(t={type:e.value},e=i.next();"EOF"!==e&&0!==e.code;){switch(e.code){case 2:t.name=e.value;break;case 41:t.xScale=e.value;break;case 42:t.yScale=e.value;break;case 43:t.zScale=e.value;break;case 10:t.position=Ve(i);break;case 50:t.rotation=e.value;break;case 70:t.columnCount=e.value;break;case 71:t.rowCount=e.value;break;case 44:t.columnSpacing=e.value;break;case 45:t.rowSpacing=e.value;break;case 210:t.extrusionDirection=Ve(i);break;default:je(t,e,i)}e=i.next()}return t},Rn.ForEntityName="LINE",Rn.prototype.parseEntity=function(i,e){var t={type:e.value,vertices:[]};for(e=i.next();"EOF"!==e&&0!==e.code;){switch(e.code){case 10:t.vertices.unshift(Ve(i));break;case 11:t.vertices.push(Ve(i));break;case 210:t.extrusionDirection=Ve(i);break;case 100:break;default:je(t,e,i)}e=i.next()}return t},gs.ForEntityName="LWPOLYLINE",gs.prototype.parseEntity=function(i,e){var t={type:e.value,vertices:[]},n=0;for(e=i.next();"EOF"!==e&&0!==e.code;){switch(e.code){case 38:t.elevation=e.value;break;case 39:t.depth=e.value;break;case 70:t.shape=!(1&~e.value),t.hasContinuousLinetypePattern=!(128&~e.value);break;case 90:n=e.value;break;case 10:t.vertices=Et(n,i);break;case 43:0!==e.value&&(t.width=e.value);break;case 210:t.extrusionDirection=Ve(i);break;default:je(t,e,i)}e=i.next()}return t},Zt.ForEntityName="MTEXT",Zt.prototype.parseEntity=function(i,e){var t={type:e.value};for(e=i.next();"EOF"!==e&&0!==e.code;){switch(e.code){case 3:case 1:t.text?t.text+=e.value:t.text=e.value;break;case 10:t.position=Ve(i);break;case 11:t.direction=Ve(i);break;case 40:t.height=e.value;break;case 41:t.width=e.value;break;case 44:t.lineSpacing=e.value;break;case 50:t.rotation=e.value;break;case 7:t.styleName=e.value;break;case 71:t.attachmentPoint=e.value;break;case 72:t.drawingDirection=e.value;break;case 101:La(i);break;default:je(t,e,i)}e=i.next()}return t},Qn.ForEntityName="POINT",Qn.prototype.parseEntity=function(i,e){var t;for(t={type:e.value},e=i.next();"EOF"!==e&&0!==e.code;){switch(e.code){case 10:t.position=Ve(i);break;case 39:t.thickness=e.value;break;case 210:t.extrusionDirection=Ve(i);break;case 100:break;default:je(t,e,i)}e=i.next()}return t},vs.ForEntityName="VERTEX",vs.prototype.parseEntity=function(i,e){var t={type:e.value};for(e=i.next();"EOF"!==e&&0!==e.code;){switch(e.code){case 10:t.x=e.value;break;case 20:t.y=e.value;break;case 30:t.z=e.value;break;case 40:case 41:case 50:break;case 42:0!=e.value&&(t.bulge=e.value);break;case 70:t.curveFittingVertex=!!(1&e.value),t.curveFitTangent=!!(2&e.value),t.splineVertex=!!(8&e.value),t.splineControlPoint=!!(16&e.value),t.threeDPolylineVertex=!!(32&e.value),t.threeDPolylineMesh=!!(64&e.value),t.polyfaceMeshVertex=!!(128&e.value);break;case 71:t.faces=[e.value];break;case 72:t.faces[1]=e.value;break;case 73:t.faces[2]=e.value;break;case 74:t.faces[3]=e.value;break;default:je(t,e,i)}e=i.next()}return t},Tr.ForEntityName="POLYLINE",Tr.prototype.parseEntity=function(i,e){var t={type:e.value,vertices:[]};for(e=i.next();"EOF"!==e&&0!==e.code;){switch(e.code){case 10:case 20:case 30:case 40:case 41:case 71:case 72:case 73:case 74:case 75:break;case 39:t.thickness=e.value;break;case 70:t.shape=!!(1&e.value),t.includesCurveFitVertices=!!(2&e.value),t.includesSplineFitVertices=!!(4&e.value),t.is3dPolyline=!!(8&e.value),t.is3dPolygonMesh=!!(16&e.value),t.is3dPolygonMeshClosed=!!(32&e.value),t.isPolyfaceMesh=!!(64&e.value),t.hasContinuousLinetypePattern=!!(128&e.value);break;case 210:t.extrusionDirection=Ve(i);break;default:je(t,e,i)}e=i.next()}return t.vertices=function i8(i,e){for(var t=new vs,n=[];!i.isEOF();)if(0===e.code)if("VERTEX"===e.value)n.push(t.parseEntity(i,e)),e=i.lastReadGroup;else if("SEQEND"===e.value){s8(i,e);break}return n}(i,e),t},z1.ForEntityName="SOLID",z1.prototype.parseEntity=function(i,e){var t;for((t={type:e.value}).points=[],e=i.next();"EOF"!==e&&0!==e.code;){switch(e.code){case 10:t.points[0]=Ve(i);break;case 11:t.points[1]=Ve(i);break;case 12:t.points[2]=Ve(i);break;case 13:t.points[3]=Ve(i);break;case 210:t.extrusionDirection=Ve(i);break;default:je(t,e,i)}e=i.next()}return t},H1.ForEntityName="SPLINE",H1.prototype.parseEntity=function(i,e){var t;for(t={type:e.value},e=i.next();"EOF"!==e&&0!==e.code;){switch(e.code){case 10:t.controlPoints||(t.controlPoints=[]),t.controlPoints.push(Ve(i));break;case 11:t.fitPoints||(t.fitPoints=[]),t.fitPoints.push(Ve(i));break;case 12:t.startTangent=Ve(i);break;case 13:t.endTangent=Ve(i);break;case 40:t.knotValues||(t.knotValues=[]),t.knotValues.push(e.value);break;case 70:!!(1&e.value)&&(t.closed=!0),!!(2&e.value)&&(t.periodic=!0),!!(4&e.value)&&(t.rational=!0),!!(8&e.value)&&(t.planar=!0),16&e.value&&(t.planar=!0,t.linear=!0);break;case 71:t.degreeOfSplineCurve=e.value;break;case 72:t.numberOfKnots=e.value;break;case 73:t.numberOfControlPoints=e.value;break;case 74:t.numberOfFitPoints=e.value;break;case 210:t.extrusionDirection=Ve(i);break;default:je(t,e,i)}e=i.next()}return t},V1.ForEntityName="TEXT",V1.prototype.parseEntity=function(i,e){var t;for(t={type:e.value},e=i.next();"EOF"!==e&&0!==e.code;){switch(e.code){case 10:t.startPoint=Ve(i);break;case 11:t.endPoint=Ve(i);break;case 40:t.textHeight=e.value;break;case 41:t.xScale=e.value;break;case 50:t.rotation=e.value;break;case 7:t.styleName=e.value;break;case 1:t.text=e.value;break;case 72:t.halign=e.value;break;case 73:t.valign=e.value;break;default:je(t,e,i)}e=i.next()}return t},W1.ForEntityName="HATCH",W1.prototype.parseEntity=function(i,e){var t;t={type:e.value};let n=0,s=0,r=0;for(e=i.next();"EOF"!==e&&0!==e.code;){for(;n>0;){const a=r8(e,i);a?(t.boundaryLoops.push(a),n--,e=i.next()):n=0}for(;s>0;){const a=a8(e,i);a?(t.definitionLines.push(a),s--,e=i.next()):s=0}for(;r>0;){const a=o8(e,i);a?(t.seedPoints.push(a),r--,e=i.next()):r=0}if(0===e.code)break;switch(e.code){case 2:t.patternName=e.value;break;case 70:t.isSolid=0!=e.value;break;case 91:n=e.value,n>0&&(t.boundaryLoops=[]);break;case 75:t.hatchStyle=e.value;break;case 76:t.patternType=e.value;break;case 52:t.patternAngle=e.value*Math.PI/180;break;case 41:t.patternScale=e.value;break;case 78:s=e.value,s>0&&(t.definitionLines=[]);break;case 98:r=e.value,r>0&&(t.seedPoints=[]);break;default:je(t,e,i)}e=i.next()}return t};const X1=new Map([[140,"DIMTXT"],[142,"DIMTSZ"],[144,"DIMLFAC"],[147,"DIMGAP"],[173,"DIMSAH"],[175,"DIMSOXD"],[176,"DIMCLRD"],[177,"DIMCLRE"],[178,"DIMCLRT"],[271,"DIMDEC"],[278,"DIMDSEP"],[281,"DIMSD1"],[282,"DIMSD2"],[3,"DIMPOST"],[40,"DIMSCALE"],[41,"DIMASZ"],[42,"DIMEXO"],[44,"DIMEXE"],[45,"DIMRND"],[46,"DIMDLE"],[5,"DIMBLK"],[6,"DIMBLK1"],[7,"DIMBLK2"],[75,"DIMSE1"],[76,"DIMSE2"],[78,"DIMZIN"]]);function ys(){this._entityHandlers={},function l8(i){i.registerEntityHandler(qt),i.registerEntityHandler($n),i.registerEntityHandler(Ri),i.registerEntityHandler(fn),i.registerEntityHandler(d0),i.registerEntityHandler(Mr),i.registerEntityHandler(ms),i.registerEntityHandler(Er),i.registerEntityHandler(Rn),i.registerEntityHandler(gs),i.registerEntityHandler(Zt),i.registerEntityHandler(Qn),i.registerEntityHandler(Tr),i.registerEntityHandler(z1),i.registerEntityHandler(H1),i.registerEntityHandler(V1),i.registerEntityHandler(W1)}(this)}function Ln(i){ze.debug("unhandled group "+Z4(i))}function Z4(i){return i.code+":"+i.value}function c8(i){return Sr[i]}ze.setLevel("error"),ys.prototype.parse=function(i,e){throw new Error("read() not implemented. Use readSync()")},ys.prototype.registerEntityHandler=function(i){var e=new i;this._entityHandlers[i.ForEntityName]=e},ys.prototype.parseSync=function(i){return"string"==typeof i?this._parse(i):(console.error("Cannot read DXF source of type `"+typeof i),null)},ys.prototype.parseStream=function(i,e){var t="",n=this;i.on("data",function s(o){t+=o}),i.on("end",function r(){try{var o=n._parse(t)}catch(l){return e(l)}e(null,o)}),i.on("error",function a(o){e(o)})},ys.prototype._parse=function(i){var e,t,n={},s=0,r=i.split(/\r\n|\r|\n/g);if(!(e=new Nt(r)).hasNext())throw Error("Empty file");var a=this,l=function(w,I){return t.code===w&&t.value===I},c=function(){var w=null,I=null,S={};for(t=e.next();;){if(l(0,"ENDSEC")){null!=w&&(S[w]=I);break}9===t.code?(null!=w&&(S[w]=I),w=t.value):10===t.code?I={x:t.value}:20===t.code?I.y=t.value:30===t.code?I.z=t.value:I=t.value,t=e.next()}return t=e.next(),S},u=function(){var I,w={};for(t=e.next();"EOF"!==t.value&&!l(0,"ENDSEC");)l(0,"BLOCK")?(ze.debug("block {"),I=f(),ze.debug("}"),M(I),I.name?w[I.name]=I:ze.error('block with handle "'+I.handle+'" is missing a name.')):(Ln(t),t=e.next());return w},f=function(){var w={};for(t=e.next();"EOF"!==t.value;){switch(t.code){case 1:w.xrefPath=t.value,t=e.next();break;case 2:w.name=t.value,t=e.next();break;case 3:w.name2=t.value,t=e.next();break;case 5:w.handle=t.value,t=e.next();break;case 8:w.layer=t.value,t=e.next();break;case 10:w.position=E(),t=e.next();break;case 67:w.inPaperSpace=!(!t.value||1!=t.value),t=e.next();break;case 70:0!=t.value&&(w.type=t.value),t=e.next();break;case 100:t=e.next();break;case 330:w.ownerHandle=t.value,t=e.next();break;case 0:if("ENDBLK"==t.value)break;w.entities=T(!0);break;default:Ln(t),t=e.next()}if(l(0,"ENDBLK")){t=e.next();break}}return w},d=function(){var w={};for(t=e.next();"EOF"!==t.value&&!l(0,"ENDSEC");)l(0,"TABLE")?(t=e.next(),b[t.value]?(ze.debug(t.value+" Table {"),w[b[t.value].tableName]=m(),ze.debug("}")):ze.debug("Unhandled Table "+t.value)):t=e.next();return t=e.next(),w};const p="ENDTAB";var m=function(){var P,w=b[t.value],I={},S=0;for(t=e.next();!l(0,p);)switch(t.code){case 5:I.handle=t.value,t=e.next();break;case 330:I.ownerHandle=t.value,t=e.next();break;case 100:"AcDbSymbolTable"===t.value||Ln(t),t=e.next();break;case 70:S=t.value,t=e.next();break;case 0:t.value===w.dxfSymbolName?I[w.tableRecordsProperty]=w.parseTableRecords():(Ln(t),t=e.next());break;default:Ln(t),t=e.next()}var X=I[w.tableRecordsProperty];return X?(X.constructor===Array?P=X.length:"object"==typeof X&&(P=Object.keys(X).length),S!==P&&ze.warn(`Parsed ${P} ${w.dxfSymbolName}'s but expected ${S}`)):I[w.tableRecordsProperty]=[],t=e.next(),I},b={VPORT:{tableRecordsProperty:"viewPorts",tableName:"viewPort",dxfSymbolName:"VPORT",parseTableRecords:function(){var w=[],I={};for(ze.debug("ViewPort {"),t=e.next();!l(0,p);)switch(t.code){case 2:I.name=t.value,t=e.next();break;case 10:I.lowerLeftCorner=E(),t=e.next();break;case 11:I.upperRightCorner=E(),t=e.next();break;case 12:I.center=E(),t=e.next();break;case 13:I.snapBasePoint=E(),t=e.next();break;case 14:I.snapSpacing=E(),t=e.next();break;case 15:I.gridSpacing=E(),t=e.next();break;case 16:I.viewDirectionFromTarget=E(),t=e.next();break;case 17:I.viewTarget=E(),t=e.next();break;case 42:I.lensLength=t.value,t=e.next();break;case 43:I.frontClippingPlane=t.value,t=e.next();break;case 44:I.backClippingPlane=t.value,t=e.next();break;case 45:I.viewHeight=t.value,t=e.next();break;case 50:I.snapRotationAngle=t.value,t=e.next();break;case 51:I.viewTwistAngle=t.value,t=e.next();break;case 79:I.orthographicType=t.value,t=e.next();break;case 110:case 110:I.ucsOrigin=E(),t=e.next();break;case 111:I.ucsXAxis=E(),t=e.next();break;case 112:I.ucsYAxis=E(),t=e.next();break;case 281:I.renderMode=t.value,t=e.next();break;case 281:I.defaultLightingType=t.value,t=e.next();break;case 292:I.defaultLightingOn=t.value,t=e.next();break;case 330:I.ownerHandle=t.value,t=e.next();break;case 63:case 421:case 431:I.ambientColor=t.value,t=e.next();break;case 0:"VPORT"===t.value&&(ze.debug("}"),w.push(I),ze.debug("ViewPort {"),I={},t=e.next());break;default:Ln(t),t=e.next()}return ze.debug("}"),w.push(I),w}},LTYPE:{tableRecordsProperty:"lineTypes",tableName:"lineType",dxfSymbolName:"LTYPE",parseTableRecords:function(){var I,P,w={},S={};for(ze.debug("LType {"),t=e.next();!l(0,"ENDTAB");)switch(t.code){case 2:S.name=t.value,I=t.value,t=e.next();break;case 3:S.description=t.value,t=e.next();break;case 73:(P=t.value)>0&&(S.pattern=[]),t=e.next();break;case 40:S.patternLength=t.value,t=e.next();break;case 49:S.pattern.push(t.value),t=e.next();break;case 0:ze.debug("}"),P>0&&P!==S.pattern.length&&ze.warn("lengths do not match on LTYPE pattern"),w[I]=S,S={},ze.debug("LType {"),t=e.next();break;default:t=e.next()}return ze.debug("}"),w[I]=S,w}},LAYER:{tableRecordsProperty:"layers",tableName:"layer",dxfSymbolName:"LAYER",parseTableRecords:function(){var I,w={},S={};for(ze.debug("Layer {"),t=e.next();!l(0,"ENDTAB");)switch(t.code){case 2:S.name=t.value,I=t.value,t=e.next();break;case 62:S.visible=t.value>=0,S.colorIndex=Math.abs(t.value),S.color=c8(S.colorIndex),t=e.next();break;case 70:S.frozen=!!(1&t.value)||!!(2&t.value),t=e.next();break;case 420:S.color=t.value,t=e.next();break;case 0:"LAYER"===t.value&&(ze.debug("}"),w[I]=S,ze.debug("Layer {"),S={},I=void 0,t=e.next());break;default:Ln(t),t=e.next()}return ze.debug("}"),w[I]=S,w}},DIMSTYLE:{tableRecordsProperty:"dimStyles",tableName:"dimstyle",dxfSymbolName:"DIMSTYLE",parseTableRecords:function(){var I,w={},S={};for(ze.debug("DimStyle {"),t=e.next();!l(0,"ENDTAB");)if(X1.has(t.code))S[X1.get(t.code)]=t.value,t=e.next();else switch(t.code){case 2:S.name=t.value,I=t.value,t=e.next();break;case 0:"DIMSTYLE"===t.value&&(ze.debug("}"),w[I]=S,ze.debug("DimStyle {"),S={},I=void 0,t=e.next());break;default:Ln(t),t=e.next()}return ze.debug("}"),w[I]=S,w}},STYLE:{tableRecordsProperty:"styles",tableName:"style",dxfSymbolName:"STYLE",parseTableRecords:function(){var S,w={},I={};for(ze.debug("Style {"),t=e.next();!l(0,p);)switch(t.code){case 100:I.subClassMarker=t.value,t=e.next();break;case 2:I.styleName=t.value,S=t.value,t=e.next();break;case 70:I.standardFlag=t.value,t=e.next();break;case 40:I.fixedTextHeight=t.value,t=e.next();break;case 41:I.widthFactor=t.value,t=e.next();break;case 50:I.obliqueAngle=t.value,t=e.next();break;case 71:I.textGenerationFlag=t.value,t=e.next();break;case 42:I.lastHeight=t.value,t=e.next();break;case 3:I.font=t.value,t=e.next();break;case 4:I.bigFont=t.value,t=e.next();break;case 1071:I.extendedFont=t.value,t=e.next();break;case 0:"STYLE"===t.value&&(ze.debug("}"),w[S]=I,ze.debug("Style {"),I={},S=void 0,t=e.next());break;default:Ln(t),t=e.next()}return ze.debug("}"),w[S]=I,w}}},T=function(w){var I=[],S=w?"ENDBLK":"ENDSEC";for(w||(t=e.next());;)if(0===t.code){if(t.value===S)break;var P,X=a._entityHandlers[t.value];if(null==X){ze.warn("Unhandled entity "+t.value),t=e.next();continue}ze.debug(t.value+" {"),P=X.parseEntity(e,t),t=e.lastReadGroup,ze.debug("}"),M(P),I.push(P)}else t=e.next();return"ENDSEC"==S&&(t=e.next()),I},E=function(){var w={},I=t.code;if(w.x=t.value,I+=10,(t=e.next()).code!=I)throw new Error("Expected code for point value to be "+I+" but got "+t.code+".");return w.y=t.value,I+=10,(t=e.next()).code!=I?(e.rewind(),w):(w.z=t.value,w)},M=function(w){if(!w)throw new TypeError("entity cannot be undefined or null");w.handle||(w.handle=s++)};return function(){for(t=e.next();!e.isEOF();)if(0===t.code&&"SECTION"===t.value){if(2!==(t=e.next()).code){console.error("Unexpected code %s after 0:SECTION",Z4(t)),t=e.next();continue}"HEADER"===t.value?(ze.debug("> HEADER"),n.header=c(),ze.debug("<")):"BLOCKS"===t.value?(ze.debug("> BLOCKS"),n.blocks=u(),ze.debug("<")):"ENTITIES"===t.value?(ze.debug("> ENTITIES"),n.entities=T(!1),ze.debug("<")):"TABLES"===t.value?(ze.debug("> TABLES"),n.tables=d(),ze.debug("<")):"EOF"===t.value?ze.debug("EOF"):ze.warn("Skipping section '%s'",t.value)}else t=e.next()}(),n};class h8{constructor(e,t="utf-8"){this.url=e,this.encoding=t}Fetch(){var e=this;return(0,pt.A)(function*(t=null){const n=yield fetch(e.url),s=+n.headers.get("Content-Length"),r=n.body.getReader();let a=0,o="",l=new TextDecoder(e.encoding);for(;;){const{done:u,value:f}=yield r.read();if(u){o+=l.decode(new ArrayBuffer(0),{stream:!1});break}o+=l.decode(f,{stream:!0}),a+=f.length,null!==t&&t("fetch",a,s)}return null!==t&&t("parse",0,null),(new ys).parseSync(o)}).apply(this,arguments)}}const jn=0,w0=1,mn=2,Li=100,m8=101,g8=102,v8=200,y8=201,x8=202,_8=203,q1=204,Z1=205,b8=206,S8=207,M8=208,E8=209,T8=210,w8=211,A8=212,C8=213,P8=214,Na=1e3,p0=1001,ka=1002,Jt=1003,K1=1004,_s=1005,kt=1006,Ua=1007,Dn=1008,ii=1009,si=1014,Q0=1015,Ar=1016,Di=1020,L0=1023,Fi=1026,bs=1027,Oi=3001,t0="srgb",Fn="srgb-linear",r2="display-p3",Ha="display-p3-linear",Va="linear",Ct="srgb",Wa="rec709",Es=7680,of=512,lf=513,cf=514,U5=515,hf=516,uf=517,ff=518,df=519,qa="300 es",On=2e3;class gn{addEventListener(e,t){void 0===this._listeners&&(this._listeners={});const n=this._listeners;void 0===n[e]&&(n[e]=[]),-1===n[e].indexOf(t)&&n[e].push(t)}hasEventListener(e,t){if(void 0===this._listeners)return!1;const n=this._listeners;return void 0!==n[e]&&-1!==n[e].indexOf(t)}removeEventListener(e,t){if(void 0===this._listeners)return;const s=this._listeners[e];if(void 0!==s){const r=s.indexOf(t);-1!==r&&s.splice(r,1)}}dispatchEvent(e){if(void 0===this._listeners)return;const n=this._listeners[e.type];if(void 0!==n){e.target=this;const s=n.slice(0);for(let r=0,a=s.length;r<a;r++)s[r].call(this,e);e.target=null}}}const a0=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"],ki=Math.PI/180,Ts=180/Math.PI;function I0(){const i=4294967295*Math.random()|0,e=4294967295*Math.random()|0,t=4294967295*Math.random()|0,n=4294967295*Math.random()|0;return(a0[255&i]+a0[i>>8&255]+a0[i>>16&255]+a0[i>>24&255]+"-"+a0[255&e]+a0[e>>8&255]+"-"+a0[e>>16&15|64]+a0[e>>24&255]+"-"+a0[63&t|128]+a0[t>>8&255]+"-"+a0[t>>16&255]+a0[t>>24&255]+a0[255&n]+a0[n>>8&255]+a0[n>>16&255]+a0[n>>24&255]).toLowerCase()}function Ut(i,e,t){return Math.max(e,Math.min(t,i))}function Cr(i,e,t){return(1-t)*i+t*e}function l2(i){return!(i&i-1)&&0!==i}function Ja(i){return Math.pow(2,Math.floor(Math.log(i)/Math.LN2))}function m0(i,e){switch(e.constructor){case Float32Array:return i;case Uint32Array:return i/4294967295;case Uint16Array:return i/65535;case Uint8Array:return i/255;case Int32Array:return Math.max(i/2147483647,-1);case Int16Array:return Math.max(i/32767,-1);case Int8Array:return Math.max(i/127,-1);default:throw new Error("Invalid component type.")}}function rt(i,e){switch(e.constructor){case Float32Array:return i;case Uint32Array:return Math.round(4294967295*i);case Uint16Array:return Math.round(65535*i);case Uint8Array:return Math.round(255*i);case Int32Array:return Math.round(2147483647*i);case Int16Array:return Math.round(32767*i);case Int8Array:return Math.round(127*i);default:throw new Error("Invalid component type.")}}class H{constructor(e=0,t=0){H.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,n=this.y,s=e.elements;return this.x=s[0]*t+s[3]*n+s[6],this.y=s[1]*t+s[4]*n+s[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(0===t)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(Ut(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const n=Math.cos(t),s=Math.sin(t),r=this.x-e.x,a=this.y-e.y;return this.x=r*n-a*s+e.x,this.y=r*s+a*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Ye{constructor(e,t,n,s,r,a,o,l,c){Ye.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],void 0!==e&&this.set(e,t,n,s,r,a,o,l,c)}set(e,t,n,s,r,a,o,l,c){const u=this.elements;return u[0]=e,u[1]=s,u[2]=o,u[3]=t,u[4]=r,u[5]=l,u[6]=n,u[7]=a,u[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,s=t.elements,r=this.elements,a=n[0],o=n[3],l=n[6],c=n[1],u=n[4],f=n[7],d=n[2],p=n[5],m=n[8],y=s[0],v=s[3],g=s[6],_=s[1],x=s[4],b=s[7],T=s[2],E=s[5],M=s[8];return r[0]=a*y+o*_+l*T,r[3]=a*v+o*x+l*E,r[6]=a*g+o*b+l*M,r[1]=c*y+u*_+f*T,r[4]=c*v+u*x+f*E,r[7]=c*g+u*b+f*M,r[2]=d*y+p*_+m*T,r[5]=d*v+p*x+m*E,r[8]=d*g+p*b+m*M,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[1],s=e[2],r=e[3],a=e[4],o=e[5],l=e[6],c=e[7],u=e[8];return t*a*u-t*o*c-n*r*u+n*o*l+s*r*c-s*a*l}invert(){const e=this.elements,t=e[0],n=e[1],s=e[2],r=e[3],a=e[4],o=e[5],l=e[6],c=e[7],u=e[8],f=u*a-o*c,d=o*l-u*r,p=c*r-a*l,m=t*f+n*d+s*p;if(0===m)return this.set(0,0,0,0,0,0,0,0,0);const y=1/m;return e[0]=f*y,e[1]=(s*c-u*n)*y,e[2]=(o*n-s*a)*y,e[3]=d*y,e[4]=(u*t-s*l)*y,e[5]=(s*r-o*t)*y,e[6]=p*y,e[7]=(n*l-c*t)*y,e[8]=(a*t-n*r)*y,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,n,s,r,a,o){const l=Math.cos(r),c=Math.sin(r);return this.set(n*l,n*c,-n*(l*a+c*o)+a+e,-s*c,s*l,-s*(-c*a+l*o)+o+t,0,0,1),this}scale(e,t){return this.premultiply(c2.makeScale(e,t)),this}rotate(e){return this.premultiply(c2.makeRotation(-e)),this}translate(e,t){return this.premultiply(c2.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,n,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,n=e.elements;for(let s=0;s<9;s++)if(t[s]!==n[s])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}clone(){return(new this.constructor).fromArray(this.elements)}}const c2=new Ye;function G5(i){for(let e=i.length-1;e>=0;--e)if(i[e]>=65535)return!0;return!1}function Pr(i){return document.createElementNS("http://www.w3.org/1999/xhtml",i)}function Pf(){const i=Pr("canvas");return i.style.display="block",i}Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array;const z5={};function Ui(i){i in z5||(z5[i]=!0,console.warn(i))}const H5=(new Ye).set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),V5=(new Ye).set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),Ka={[Fn]:{transfer:Va,primaries:Wa,toReference:i=>i,fromReference:i=>i},[t0]:{transfer:Ct,primaries:Wa,toReference:i=>i.convertSRGBToLinear(),fromReference:i=>i.convertLinearToSRGB()},[Ha]:{transfer:Va,primaries:"p3",toReference:i=>i.applyMatrix3(V5),fromReference:i=>i.applyMatrix3(H5)},[r2]:{transfer:Ct,primaries:"p3",toReference:i=>i.convertSRGBToLinear().applyMatrix3(V5),fromReference:i=>i.applyMatrix3(H5).convertLinearToSRGB()}},Rf=new Set([Fn,Ha]),_t={enabled:!0,_workingColorSpace:Fn,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(i){if(!Rf.has(i))throw new Error(`Unsupported working color space, "${i}".`);this._workingColorSpace=i},convert:function(i,e,t){return!1!==this.enabled&&e!==t&&e&&t?(0,Ka[t].fromReference)((0,Ka[e].toReference)(i)):i},fromWorkingColorSpace:function(i,e){return this.convert(i,this._workingColorSpace,e)},toWorkingColorSpace:function(i,e){return this.convert(i,e,this._workingColorSpace)},getPrimaries:function(i){return Ka[i].primaries},getTransfer:function(i){return""===i?Va:Ka[i].transfer}};function As(i){return i<.04045?.0773993808*i:Math.pow(.9478672986*i+.0521327014,2.4)}function h2(i){return i<.0031308?12.92*i:1.055*Math.pow(i,.41666)-.055}let Cs;class W5{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{void 0===Cs&&(Cs=Pr("canvas")),Cs.width=e.width,Cs.height=e.height;const n=Cs.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),t=Cs}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const t=Pr("canvas");t.width=e.width,t.height=e.height;const n=t.getContext("2d");n.drawImage(e,0,0,e.width,e.height);const s=n.getImageData(0,0,e.width,e.height),r=s.data;for(let a=0;a<r.length;a++)r[a]=255*As(r[a]/255);return n.putImageData(s,0,0),t}if(e.data){const t=e.data.slice(0);for(let n=0;n<t.length;n++)t[n]=t instanceof Uint8Array||t instanceof Uint8ClampedArray?Math.floor(255*As(t[n]/255)):As(t[n]);return{data:t,width:e.width,height:e.height}}return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}}let Lf=0;class Ps{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:Lf++}),this.uuid=I0(),this.data=e,this.dataReady=!0,this.version=0}set needsUpdate(e){!0===e&&this.version++}toJSON(e){const t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.images[this.uuid])return e.images[this.uuid];const n={uuid:this.uuid,url:""},s=this.data;if(null!==s){let r;if(Array.isArray(s)){r=[];for(let a=0,o=s.length;a<o;a++)r.push(u2(s[a].isDataTexture?s[a].image:s[a]))}else r=u2(s);n.url=r}return t||(e.images[this.uuid]=n),n}}function u2(i){return typeof HTMLImageElement<"u"&&i instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&i instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&i instanceof ImageBitmap?W5.getDataURL(i):i.data?{data:Array.from(i.data),width:i.width,height:i.height,type:i.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}let If=0,A0=(()=>{class i extends gn{constructor(t=i.DEFAULT_IMAGE,n=i.DEFAULT_MAPPING,s=p0,r=p0,a=kt,o=Dn,l=L0,c=ii,u=i.DEFAULT_ANISOTROPY,f=""){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:If++}),this.uuid=I0(),this.name="",this.source=new Ps(t),this.mipmaps=[],this.mapping=n,this.channel=0,this.wrapS=s,this.wrapT=r,this.magFilter=a,this.minFilter=o,this.anisotropy=u,this.format=l,this.internalFormat=null,this.type=c,this.offset=new H(0,0),this.repeat=new H(1,1),this.center=new H(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Ye,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,"string"==typeof f?this.colorSpace=f:(Ui("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace=f===Oi?t0:""),this.userData={},this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1,this.needsPMREMUpdate=!1}get image(){return this.source.data}set image(t=null){this.source.data=t}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return(new this.constructor).copy(this)}copy(t){return this.name=t.name,this.source=t.source,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.channel=t.channel,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.internalFormat=t.internalFormat,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.colorSpace=t.colorSpace,this.userData=JSON.parse(JSON.stringify(t.userData)),this.needsUpdate=!0,this}toJSON(t){const n=void 0===t||"string"==typeof t;if(!n&&void 0!==t.textures[this.uuid])return t.textures[this.uuid];const s={metadata:{version:4.6,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(t).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(s.userData=this.userData),n||(t.textures[this.uuid]=s),s}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(300!==this.mapping)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case 1e3:t.x=t.x-Math.floor(t.x);break;case p0:t.x=t.x<0?0:1;break;case 1002:t.x=1===Math.abs(Math.floor(t.x)%2)?Math.ceil(t.x)-t.x:t.x-Math.floor(t.x)}if(t.y<0||t.y>1)switch(this.wrapT){case 1e3:t.y=t.y-Math.floor(t.y);break;case p0:t.y=t.y<0?0:1;break;case 1002:t.y=1===Math.abs(Math.floor(t.y)%2)?Math.ceil(t.y)-t.y:t.y-Math.floor(t.y)}return this.flipY&&(t.y=1-t.y),t}set needsUpdate(t){!0===t&&(this.version++,this.source.needsUpdate=!0)}get encoding(){return Ui("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace===t0?Oi:3e3}set encoding(t){Ui("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace=t===Oi?t0:""}}return i.DEFAULT_IMAGE=null,i.DEFAULT_MAPPING=300,i.DEFAULT_ANISOTROPY=1,i})();class bt{constructor(e=0,t=0,n=0,s=1){bt.prototype.isVector4=!0,this.x=e,this.y=t,this.z=n,this.w=s}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,s){return this.x=e,this.y=t,this.z=n,this.w=s,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=void 0!==e.w?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,n=this.y,s=this.z,r=this.w,a=e.elements;return this.x=a[0]*t+a[4]*n+a[8]*s+a[12]*r,this.y=a[1]*t+a[5]*n+a[9]*s+a[13]*r,this.z=a[2]*t+a[6]*n+a[10]*s+a[14]*r,this.w=a[3]*t+a[7]*n+a[11]*s+a[15]*r,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,n,s,r;const l=e.elements,c=l[0],u=l[4],f=l[8],d=l[1],p=l[5],m=l[9],y=l[2],v=l[6],g=l[10];if(Math.abs(u-d)<.01&&Math.abs(f-y)<.01&&Math.abs(m-v)<.01){if(Math.abs(u+d)<.1&&Math.abs(f+y)<.1&&Math.abs(m+v)<.1&&Math.abs(c+p+g-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const x=(c+1)/2,b=(p+1)/2,T=(g+1)/2,E=(u+d)/4,M=(f+y)/4,w=(m+v)/4;return x>b&&x>T?x<.01?(n=0,s=.707106781,r=.707106781):(n=Math.sqrt(x),s=E/n,r=M/n):b>T?b<.01?(n=.707106781,s=0,r=.707106781):(s=Math.sqrt(b),n=E/s,r=w/s):T<.01?(n=.707106781,s=.707106781,r=0):(r=Math.sqrt(T),n=M/r,s=w/r),this.set(n,s,r,t),this}let _=Math.sqrt((v-m)*(v-m)+(f-y)*(f-y)+(d-u)*(d-u));return Math.abs(_)<.001&&(_=1),this.x=(v-m)/_,this.y=(f-y)/_,this.z=(d-u)/_,this.w=Math.acos((c+p+g-1)/2),this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this.w=e.w+(t.w-e.w)*n,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class Df extends gn{constructor(e=1,t=1,n={}){super(),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new bt(0,0,e,t),this.scissorTest=!1,this.viewport=new bt(0,0,e,t);const s={width:e,height:t,depth:1};void 0!==n.encoding&&(Ui("THREE.WebGLRenderTarget: option.encoding has been replaced by option.colorSpace."),n.colorSpace=n.encoding===Oi?t0:""),n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:kt,depthBuffer:!0,stencilBuffer:!1,depthTexture:null,samples:0},n),this.texture=new A0(s,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.flipY=!1,this.texture.generateMipmaps=n.generateMipmaps,this.texture.internalFormat=n.internalFormat,this.depthBuffer=n.depthBuffer,this.stencilBuffer=n.stencilBuffer,this.depthTexture=n.depthTexture,this.samples=n.samples}setSize(e,t,n=1){(this.width!==e||this.height!==t||this.depth!==n)&&(this.width=e,this.height=t,this.depth=n,this.texture.image.width=e,this.texture.image.height=t,this.texture.image.depth=n,this.dispose()),this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return(new this.constructor).copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.texture.isRenderTargetTexture=!0;const t=Object.assign({},e.texture.image);return this.texture.source=new Ps(t),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,null!==e.depthTexture&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class vn extends Df{constructor(e=1,t=1,n={}){super(e,t,n),this.isWebGLRenderTarget=!0}}class f2 extends A0{constructor(e=null,t=1,n=1,s=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:n,depth:s},this.magFilter=Jt,this.minFilter=Jt,this.wrapR=p0,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class X5 extends A0{constructor(e=null,t=1,n=1,s=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:n,depth:s},this.magFilter=Jt,this.minFilter=Jt,this.wrapR=p0,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class g0{constructor(e=0,t=0,n=0,s=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=n,this._w=s}static slerpFlat(e,t,n,s,r,a,o){let l=n[s+0],c=n[s+1],u=n[s+2],f=n[s+3];const d=r[a+0],p=r[a+1],m=r[a+2],y=r[a+3];if(0===o)return e[t+0]=l,e[t+1]=c,e[t+2]=u,void(e[t+3]=f);if(1===o)return e[t+0]=d,e[t+1]=p,e[t+2]=m,void(e[t+3]=y);if(f!==y||l!==d||c!==p||u!==m){let v=1-o;const g=l*d+c*p+u*m+f*y,_=g>=0?1:-1,x=1-g*g;if(x>Number.EPSILON){const T=Math.sqrt(x),E=Math.atan2(T,g*_);v=Math.sin(v*E)/T,o=Math.sin(o*E)/T}const b=o*_;if(l=l*v+d*b,c=c*v+p*b,u=u*v+m*b,f=f*v+y*b,v===1-o){const T=1/Math.sqrt(l*l+c*c+u*u+f*f);l*=T,c*=T,u*=T,f*=T}}e[t]=l,e[t+1]=c,e[t+2]=u,e[t+3]=f}static multiplyQuaternionsFlat(e,t,n,s,r,a){const o=n[s],l=n[s+1],c=n[s+2],u=n[s+3],f=r[a],d=r[a+1],p=r[a+2],m=r[a+3];return e[t]=o*m+u*f+l*p-c*d,e[t+1]=l*m+u*d+c*f-o*p,e[t+2]=c*m+u*p+o*d-l*f,e[t+3]=u*m-o*f-l*d-c*p,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,n,s){return this._x=e,this._y=t,this._z=n,this._w=s,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){const n=e._x,s=e._y,r=e._z,a=e._order,o=Math.cos,l=Math.sin,c=o(n/2),u=o(s/2),f=o(r/2),d=l(n/2),p=l(s/2),m=l(r/2);switch(a){case"XYZ":this._x=d*u*f+c*p*m,this._y=c*p*f-d*u*m,this._z=c*u*m+d*p*f,this._w=c*u*f-d*p*m;break;case"YXZ":this._x=d*u*f+c*p*m,this._y=c*p*f-d*u*m,this._z=c*u*m-d*p*f,this._w=c*u*f+d*p*m;break;case"ZXY":this._x=d*u*f-c*p*m,this._y=c*p*f+d*u*m,this._z=c*u*m+d*p*f,this._w=c*u*f-d*p*m;break;case"ZYX":this._x=d*u*f-c*p*m,this._y=c*p*f+d*u*m,this._z=c*u*m-d*p*f,this._w=c*u*f+d*p*m;break;case"YZX":this._x=d*u*f+c*p*m,this._y=c*p*f+d*u*m,this._z=c*u*m-d*p*f,this._w=c*u*f-d*p*m;break;case"XZY":this._x=d*u*f-c*p*m,this._y=c*p*f-d*u*m,this._z=c*u*m+d*p*f,this._w=c*u*f+d*p*m;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+a)}return!0===t&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const n=t/2,s=Math.sin(n);return this._x=e.x*s,this._y=e.y*s,this._z=e.z*s,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,n=t[0],s=t[4],r=t[8],a=t[1],o=t[5],l=t[9],c=t[2],u=t[6],f=t[10],d=n+o+f;if(d>0){const p=.5/Math.sqrt(d+1);this._w=.25/p,this._x=(u-l)*p,this._y=(r-c)*p,this._z=(a-s)*p}else if(n>o&&n>f){const p=2*Math.sqrt(1+n-o-f);this._w=(u-l)/p,this._x=.25*p,this._y=(s+a)/p,this._z=(r+c)/p}else if(o>f){const p=2*Math.sqrt(1+o-n-f);this._w=(r-c)/p,this._x=(s+a)/p,this._y=.25*p,this._z=(l+u)/p}else{const p=2*Math.sqrt(1+f-n-o);this._w=(a-s)/p,this._x=(r+c)/p,this._y=(l+u)/p,this._z=.25*p}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return n<Number.EPSILON?(n=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(Ut(this.dot(e),-1,1)))}rotateTowards(e,t){const n=this.angleTo(e);if(0===n)return this;const s=Math.min(1,t/n);return this.slerp(e,s),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return 0===e?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const n=e._x,s=e._y,r=e._z,a=e._w,o=t._x,l=t._y,c=t._z,u=t._w;return this._x=n*u+a*o+s*c-r*l,this._y=s*u+a*l+r*o-n*c,this._z=r*u+a*c+n*l-s*o,this._w=a*u-n*o-s*l-r*c,this._onChangeCallback(),this}slerp(e,t){if(0===t)return this;if(1===t)return this.copy(e);const n=this._x,s=this._y,r=this._z,a=this._w;let o=a*e._w+n*e._x+s*e._y+r*e._z;if(o<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,o=-o):this.copy(e),o>=1)return this._w=a,this._x=n,this._y=s,this._z=r,this;const l=1-o*o;if(l<=Number.EPSILON){const p=1-t;return this._w=p*a+t*this._w,this._x=p*n+t*this._x,this._y=p*s+t*this._y,this._z=p*r+t*this._z,this.normalize(),this}const c=Math.sqrt(l),u=Math.atan2(c,o),f=Math.sin((1-t)*u)/c,d=Math.sin(t*u)/c;return this._w=a*f+this._w*d,this._x=n*f+this._x*d,this._y=s*f+this._y*d,this._z=r*f+this._z*d,this._onChangeCallback(),this}slerpQuaternions(e,t,n){return this.copy(e).slerp(t,n)}random(){const e=Math.random(),t=Math.sqrt(1-e),n=Math.sqrt(e),s=2*Math.PI*Math.random(),r=2*Math.PI*Math.random();return this.set(t*Math.cos(s),n*Math.sin(r),n*Math.cos(r),t*Math.sin(s))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class F{constructor(e=0,t=0,n=0){F.prototype.isVector3=!0,this.x=e,this.y=t,this.z=n}set(e,t,n){return void 0===n&&(n=this.z),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(Y5.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(Y5.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,n=this.y,s=this.z,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6]*s,this.y=r[1]*t+r[4]*n+r[7]*s,this.z=r[2]*t+r[5]*n+r[8]*s,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,n=this.y,s=this.z,r=e.elements,a=1/(r[3]*t+r[7]*n+r[11]*s+r[15]);return this.x=(r[0]*t+r[4]*n+r[8]*s+r[12])*a,this.y=(r[1]*t+r[5]*n+r[9]*s+r[13])*a,this.z=(r[2]*t+r[6]*n+r[10]*s+r[14])*a,this}applyQuaternion(e){const t=this.x,n=this.y,s=this.z,r=e.x,a=e.y,o=e.z,l=e.w,c=2*(a*s-o*n),u=2*(o*t-r*s),f=2*(r*n-a*t);return this.x=t+l*c+a*f-o*u,this.y=n+l*u+o*c-r*f,this.z=s+l*f+r*u-a*c,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,n=this.y,s=this.z,r=e.elements;return this.x=r[0]*t+r[4]*n+r[8]*s,this.y=r[1]*t+r[5]*n+r[9]*s,this.z=r[2]*t+r[6]*n+r[10]*s,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const n=e.x,s=e.y,r=e.z,a=t.x,o=t.y,l=t.z;return this.x=s*l-r*o,this.y=r*a-n*l,this.z=n*o-s*a,this}projectOnVector(e){const t=e.lengthSq();if(0===t)return this.set(0,0,0);const n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return d2.copy(this).projectOnVector(e),this.sub(d2)}reflect(e){return this.sub(d2.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(0===t)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(Ut(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y,s=this.z-e.z;return t*t+n*n+s*s}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){const s=Math.sin(t)*e;return this.x=s*Math.sin(n),this.y=Math.cos(t)*e,this.z=s*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),s=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=s,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,4*t)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,3*t)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=2*(Math.random()-.5),t=Math.random()*Math.PI*2,n=Math.sqrt(1-e**2);return this.x=n*Math.cos(t),this.y=n*Math.sin(t),this.z=e,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const d2=new F,Y5=new g0;class C0{constructor(e=new F(1/0,1/0,1/0),t=new F(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t+=3)this.expandByPoint(j0.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,n=e.count;t<n;t++)this.expandByPoint(j0.fromBufferAttribute(e,t));return this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const n=j0.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}setFromObject(e,t=!1){return this.makeEmpty(),this.expandByObject(e,t)}clone(){return(new this.constructor).copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e,t=!1){e.updateWorldMatrix(!1,!1);const n=e.geometry;if(void 0!==n){const r=n.getAttribute("position");if(!0===t&&void 0!==r&&!0!==e.isInstancedMesh)for(let a=0,o=r.count;a<o;a++)!0===e.isMesh?e.getVertexPosition(a,j0):j0.fromBufferAttribute(r,a),j0.applyMatrix4(e.matrixWorld),this.expandByPoint(j0);else void 0!==e.boundingBox?(null===e.boundingBox&&e.computeBoundingBox(),$a.copy(e.boundingBox)):(null===n.boundingBox&&n.computeBoundingBox(),$a.copy(n.boundingBox)),$a.applyMatrix4(e.matrixWorld),this.union($a)}const s=e.children;for(let r=0,a=s.length;r<a;r++)this.expandByObject(s[r],t);return this}containsPoint(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y||e.z<this.min.z||e.z>this.max.z)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y||e.max.z<this.min.z||e.min.z>this.max.z)}intersectsSphere(e){return this.clampPoint(e.center,j0),j0.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(Rr),Qa.subVectors(this.max,Rr),Rs.subVectors(e.a,Rr),Ls.subVectors(e.b,Rr),Is.subVectors(e.c,Rr),ri.subVectors(Ls,Rs),ai.subVectors(Is,Ls),Bi.subVectors(Rs,Is);let t=[0,-ri.z,ri.y,0,-ai.z,ai.y,0,-Bi.z,Bi.y,ri.z,0,-ri.x,ai.z,0,-ai.x,Bi.z,0,-Bi.x,-ri.y,ri.x,0,-ai.y,ai.x,0,-Bi.y,Bi.x,0];return!(!p2(t,Rs,Ls,Is,Qa)||(t=[1,0,0,0,1,0,0,0,1],!p2(t,Rs,Ls,Is,Qa)))&&(ja.crossVectors(ri,ai),t=[ja.x,ja.y,ja.z],p2(t,Rs,Ls,Is,Qa))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,j0).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=.5*this.getSize(j0).length()),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()||(Nn[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Nn[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Nn[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Nn[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Nn[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Nn[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Nn[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Nn[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Nn)),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const Nn=[new F,new F,new F,new F,new F,new F,new F,new F],j0=new F,$a=new C0,Rs=new F,Ls=new F,Is=new F,ri=new F,ai=new F,Bi=new F,Rr=new F,Qa=new F,ja=new F,Gi=new F;function p2(i,e,t,n,s){for(let r=0,a=i.length-3;r<=a;r+=3){Gi.fromArray(i,r);const o=s.x*Math.abs(Gi.x)+s.y*Math.abs(Gi.y)+s.z*Math.abs(Gi.z),l=e.dot(Gi),c=t.dot(Gi),u=n.dot(Gi);if(Math.max(-Math.max(l,c,u),Math.min(l,c,u))>o)return!1}return!0}const Ff=new C0,Lr=new F,m2=new F;class v0{constructor(e=new F,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const n=this.center;void 0!==t?n.copy(t):Ff.setFromPoints(e).getCenter(n);let s=0;for(let r=0,a=e.length;r<a;r++)s=Math.max(s,n.distanceToSquared(e[r]));return this.radius=Math.sqrt(s),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){const t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){const n=this.center.distanceToSquared(e);return t.copy(e),n>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;Lr.subVectors(e,this.center);const t=Lr.lengthSq();if(t>this.radius*this.radius){const n=Math.sqrt(t),s=.5*(n-this.radius);this.center.addScaledVector(Lr,s/n),this.radius+=s}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(!0===this.center.equals(e.center)?this.radius=Math.max(this.radius,e.radius):(m2.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(Lr.copy(e.center).add(m2)),this.expandByPoint(Lr.copy(e.center).sub(m2))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return(new this.constructor).copy(this)}}const kn=new F,g2=new F,eo=new F,oi=new F,v2=new F,to=new F,y2=new F;class Ir{constructor(e=new F,t=new F(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,kn)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=kn.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(kn.copy(this.origin).addScaledVector(this.direction,t),kn.distanceToSquared(e))}distanceSqToSegment(e,t,n,s){g2.copy(e).add(t).multiplyScalar(.5),eo.copy(t).sub(e).normalize(),oi.copy(this.origin).sub(g2);const r=.5*e.distanceTo(t),a=-this.direction.dot(eo),o=oi.dot(this.direction),l=-oi.dot(eo),c=oi.lengthSq(),u=Math.abs(1-a*a);let f,d,p,m;if(u>0)if(f=a*l-o,d=a*o-l,m=r*u,f>=0)if(d>=-m)if(d<=m){const y=1/u;f*=y,d*=y,p=f*(f+a*d+2*o)+d*(a*f+d+2*l)+c}else d=r,f=Math.max(0,-(a*d+o)),p=-f*f+d*(d+2*l)+c;else d=-r,f=Math.max(0,-(a*d+o)),p=-f*f+d*(d+2*l)+c;else d<=-m?(f=Math.max(0,-(-a*r+o)),d=f>0?-r:Math.min(Math.max(-r,-l),r),p=-f*f+d*(d+2*l)+c):d<=m?(f=0,d=Math.min(Math.max(-r,-l),r),p=d*(d+2*l)+c):(f=Math.max(0,-(a*r+o)),d=f>0?r:Math.min(Math.max(-r,-l),r),p=-f*f+d*(d+2*l)+c);else d=a>0?-r:r,f=Math.max(0,-(a*d+o)),p=-f*f+d*(d+2*l)+c;return n&&n.copy(this.origin).addScaledVector(this.direction,f),s&&s.copy(g2).addScaledVector(eo,d),p}intersectSphere(e,t){kn.subVectors(e.center,this.origin);const n=kn.dot(this.direction),s=kn.dot(kn)-n*n,r=e.radius*e.radius;if(s>r)return null;const a=Math.sqrt(r-s),o=n-a,l=n+a;return l<0?null:this.at(o<0?l:o,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(0===t)return 0===e.distanceToPoint(this.origin)?0:null;const n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){const n=this.distanceToPlane(e);return null===n?null:this.at(n,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return 0===t||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,s,r,a,o,l;const c=1/this.direction.x,u=1/this.direction.y,f=1/this.direction.z,d=this.origin;return c>=0?(n=(e.min.x-d.x)*c,s=(e.max.x-d.x)*c):(n=(e.max.x-d.x)*c,s=(e.min.x-d.x)*c),u>=0?(r=(e.min.y-d.y)*u,a=(e.max.y-d.y)*u):(r=(e.max.y-d.y)*u,a=(e.min.y-d.y)*u),n>a||r>s||((r>n||isNaN(n))&&(n=r),(a<s||isNaN(s))&&(s=a),f>=0?(o=(e.min.z-d.z)*f,l=(e.max.z-d.z)*f):(o=(e.max.z-d.z)*f,l=(e.min.z-d.z)*f),n>l||o>s)||((o>n||n!=n)&&(n=o),(l<s||s!=s)&&(s=l),s<0)?null:this.at(n>=0?n:s,t)}intersectsBox(e){return null!==this.intersectBox(e,kn)}intersectTriangle(e,t,n,s,r){v2.subVectors(t,e),to.subVectors(n,e),y2.crossVectors(v2,to);let o,a=this.direction.dot(y2);if(a>0){if(s)return null;o=1}else{if(!(a<0))return null;o=-1,a=-a}oi.subVectors(this.origin,e);const l=o*this.direction.dot(to.crossVectors(oi,to));if(l<0)return null;const c=o*this.direction.dot(v2.cross(oi));if(c<0||l+c>a)return null;const u=-o*oi.dot(y2);return u<0?null:this.at(u/a,r)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return(new this.constructor).copy(this)}}class $e{constructor(e,t,n,s,r,a,o,l,c,u,f,d,p,m,y,v){$e.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],void 0!==e&&this.set(e,t,n,s,r,a,o,l,c,u,f,d,p,m,y,v)}set(e,t,n,s,r,a,o,l,c,u,f,d,p,m,y,v){const g=this.elements;return g[0]=e,g[4]=t,g[8]=n,g[12]=s,g[1]=r,g[5]=a,g[9]=o,g[13]=l,g[2]=c,g[6]=u,g[10]=f,g[14]=d,g[3]=p,g[7]=m,g[11]=y,g[15]=v,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return(new $e).fromArray(this.elements)}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){const t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,n=e.elements,s=1/Ds.setFromMatrixColumn(e,0).length(),r=1/Ds.setFromMatrixColumn(e,1).length(),a=1/Ds.setFromMatrixColumn(e,2).length();return t[0]=n[0]*s,t[1]=n[1]*s,t[2]=n[2]*s,t[3]=0,t[4]=n[4]*r,t[5]=n[5]*r,t[6]=n[6]*r,t[7]=0,t[8]=n[8]*a,t[9]=n[9]*a,t[10]=n[10]*a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,n=e.x,s=e.y,r=e.z,a=Math.cos(n),o=Math.sin(n),l=Math.cos(s),c=Math.sin(s),u=Math.cos(r),f=Math.sin(r);if("XYZ"===e.order){const d=a*u,p=a*f,m=o*u,y=o*f;t[0]=l*u,t[4]=-l*f,t[8]=c,t[1]=p+m*c,t[5]=d-y*c,t[9]=-o*l,t[2]=y-d*c,t[6]=m+p*c,t[10]=a*l}else if("YXZ"===e.order){const d=l*u,p=l*f,m=c*u,y=c*f;t[0]=d+y*o,t[4]=m*o-p,t[8]=a*c,t[1]=a*f,t[5]=a*u,t[9]=-o,t[2]=p*o-m,t[6]=y+d*o,t[10]=a*l}else if("ZXY"===e.order){const d=l*u,p=l*f,m=c*u,y=c*f;t[0]=d-y*o,t[4]=-a*f,t[8]=m+p*o,t[1]=p+m*o,t[5]=a*u,t[9]=y-d*o,t[2]=-a*c,t[6]=o,t[10]=a*l}else if("ZYX"===e.order){const d=a*u,p=a*f,m=o*u,y=o*f;t[0]=l*u,t[4]=m*c-p,t[8]=d*c+y,t[1]=l*f,t[5]=y*c+d,t[9]=p*c-m,t[2]=-c,t[6]=o*l,t[10]=a*l}else if("YZX"===e.order){const d=a*l,p=a*c,m=o*l,y=o*c;t[0]=l*u,t[4]=y-d*f,t[8]=m*f+p,t[1]=f,t[5]=a*u,t[9]=-o*u,t[2]=-c*u,t[6]=p*f+m,t[10]=d-y*f}else if("XZY"===e.order){const d=a*l,p=a*c,m=o*l,y=o*c;t[0]=l*u,t[4]=-f,t[8]=c*u,t[1]=d*f+y,t[5]=a*u,t[9]=p*f-m,t[2]=m*f-p,t[6]=o*u,t[10]=y*f+d}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(Of,e,Nf)}lookAt(e,t,n){const s=this.elements;return D0.subVectors(e,t),0===D0.lengthSq()&&(D0.z=1),D0.normalize(),li.crossVectors(n,D0),0===li.lengthSq()&&(1===Math.abs(n.z)?D0.x+=1e-4:D0.z+=1e-4,D0.normalize(),li.crossVectors(n,D0)),li.normalize(),no.crossVectors(D0,li),s[0]=li.x,s[4]=no.x,s[8]=D0.x,s[1]=li.y,s[5]=no.y,s[9]=D0.y,s[2]=li.z,s[6]=no.z,s[10]=D0.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,s=t.elements,r=this.elements,a=n[0],o=n[4],l=n[8],c=n[12],u=n[1],f=n[5],d=n[9],p=n[13],m=n[2],y=n[6],v=n[10],g=n[14],_=n[3],x=n[7],b=n[11],T=n[15],E=s[0],M=s[4],w=s[8],I=s[12],S=s[1],P=s[5],X=s[9],te=s[13],U=s[2],z=s[6],G=s[10],ee=s[14],J=s[3],Z=s[7],ne=s[11],Y=s[15];return r[0]=a*E+o*S+l*U+c*J,r[4]=a*M+o*P+l*z+c*Z,r[8]=a*w+o*X+l*G+c*ne,r[12]=a*I+o*te+l*ee+c*Y,r[1]=u*E+f*S+d*U+p*J,r[5]=u*M+f*P+d*z+p*Z,r[9]=u*w+f*X+d*G+p*ne,r[13]=u*I+f*te+d*ee+p*Y,r[2]=m*E+y*S+v*U+g*J,r[6]=m*M+y*P+v*z+g*Z,r[10]=m*w+y*X+v*G+g*ne,r[14]=m*I+y*te+v*ee+g*Y,r[3]=_*E+x*S+b*U+T*J,r[7]=_*M+x*P+b*z+T*Z,r[11]=_*w+x*X+b*G+T*ne,r[15]=_*I+x*te+b*ee+T*Y,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[4],s=e[8],r=e[12],a=e[1],o=e[5],l=e[9],c=e[13],u=e[2],f=e[6],d=e[10],p=e[14];return e[3]*(+r*l*f-s*c*f-r*o*d+n*c*d+s*o*p-n*l*p)+e[7]*(+t*l*p-t*c*d+r*a*d-s*a*p+s*c*u-r*l*u)+e[11]*(+t*c*f-t*o*p-r*a*f+n*a*p+r*o*u-n*c*u)+e[15]*(-s*o*u-t*l*f+t*o*d+s*a*f-n*a*d+n*l*u)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,n){const s=this.elements;return e.isVector3?(s[12]=e.x,s[13]=e.y,s[14]=e.z):(s[12]=e,s[13]=t,s[14]=n),this}invert(){const e=this.elements,t=e[0],n=e[1],s=e[2],r=e[3],a=e[4],o=e[5],l=e[6],c=e[7],u=e[8],f=e[9],d=e[10],p=e[11],m=e[12],y=e[13],v=e[14],g=e[15],_=f*v*c-y*d*c+y*l*p-o*v*p-f*l*g+o*d*g,x=m*d*c-u*v*c-m*l*p+a*v*p+u*l*g-a*d*g,b=u*y*c-m*f*c+m*o*p-a*y*p-u*o*g+a*f*g,T=m*f*l-u*y*l-m*o*d+a*y*d+u*o*v-a*f*v,E=t*_+n*x+s*b+r*T;if(0===E)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const M=1/E;return e[0]=_*M,e[1]=(y*d*r-f*v*r-y*s*p+n*v*p+f*s*g-n*d*g)*M,e[2]=(o*v*r-y*l*r+y*s*c-n*v*c-o*s*g+n*l*g)*M,e[3]=(f*l*r-o*d*r-f*s*c+n*d*c+o*s*p-n*l*p)*M,e[4]=x*M,e[5]=(u*v*r-m*d*r+m*s*p-t*v*p-u*s*g+t*d*g)*M,e[6]=(m*l*r-a*v*r-m*s*c+t*v*c+a*s*g-t*l*g)*M,e[7]=(a*d*r-u*l*r+u*s*c-t*d*c-a*s*p+t*l*p)*M,e[8]=b*M,e[9]=(m*f*r-u*y*r-m*n*p+t*y*p+u*n*g-t*f*g)*M,e[10]=(a*y*r-m*o*r+m*n*c-t*y*c-a*n*g+t*o*g)*M,e[11]=(u*o*r-a*f*r-u*n*c+t*f*c+a*n*p-t*o*p)*M,e[12]=T*M,e[13]=(u*y*s-m*f*s+m*n*d-t*y*d-u*n*v+t*f*v)*M,e[14]=(m*o*s-a*y*s-m*n*l+t*y*l+a*n*v-t*o*v)*M,e[15]=(a*f*s-u*o*s+u*n*l-t*f*l-a*n*d+t*o*d)*M,this}scale(e){const t=this.elements,n=e.x,s=e.y,r=e.z;return t[0]*=n,t[4]*=s,t[8]*=r,t[1]*=n,t[5]*=s,t[9]*=r,t[2]*=n,t[6]*=s,t[10]*=r,t[3]*=n,t[7]*=s,t[11]*=r,this}getMaxScaleOnAxis(){const e=this.elements;return Math.sqrt(Math.max(e[0]*e[0]+e[1]*e[1]+e[2]*e[2],e[4]*e[4]+e[5]*e[5]+e[6]*e[6],e[8]*e[8]+e[9]*e[9]+e[10]*e[10]))}makeTranslation(e,t,n){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const n=Math.cos(t),s=Math.sin(t),r=1-n,a=e.x,o=e.y,l=e.z,c=r*a,u=r*o;return this.set(c*a+n,c*o-s*l,c*l+s*o,0,c*o+s*l,u*o+n,u*l-s*a,0,c*l-s*o,u*l+s*a,r*l*l+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,s,r,a){return this.set(1,n,r,0,e,1,a,0,t,s,1,0,0,0,0,1),this}compose(e,t,n){const s=this.elements,r=t._x,a=t._y,o=t._z,l=t._w,c=r+r,u=a+a,f=o+o,d=r*c,p=r*u,m=r*f,y=a*u,v=a*f,g=o*f,_=l*c,x=l*u,b=l*f,T=n.x,E=n.y,M=n.z;return s[0]=(1-(y+g))*T,s[1]=(p+b)*T,s[2]=(m-x)*T,s[3]=0,s[4]=(p-b)*E,s[5]=(1-(d+g))*E,s[6]=(v+_)*E,s[7]=0,s[8]=(m+x)*M,s[9]=(v-_)*M,s[10]=(1-(d+y))*M,s[11]=0,s[12]=e.x,s[13]=e.y,s[14]=e.z,s[15]=1,this}decompose(e,t,n){const s=this.elements;let r=Ds.set(s[0],s[1],s[2]).length();const a=Ds.set(s[4],s[5],s[6]).length(),o=Ds.set(s[8],s[9],s[10]).length();this.determinant()<0&&(r=-r),e.x=s[12],e.y=s[13],e.z=s[14],en.copy(this);const c=1/r,u=1/a,f=1/o;return en.elements[0]*=c,en.elements[1]*=c,en.elements[2]*=c,en.elements[4]*=u,en.elements[5]*=u,en.elements[6]*=u,en.elements[8]*=f,en.elements[9]*=f,en.elements[10]*=f,t.setFromRotationMatrix(en),n.x=r,n.y=a,n.z=o,this}makePerspective(e,t,n,s,r,a,o=On){const l=this.elements,c=2*r/(t-e),u=2*r/(n-s),f=(t+e)/(t-e),d=(n+s)/(n-s);let p,m;if(o===On)p=-(a+r)/(a-r),m=-2*a*r/(a-r);else{if(2001!==o)throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+o);p=-a/(a-r),m=-a*r/(a-r)}return l[0]=c,l[4]=0,l[8]=f,l[12]=0,l[1]=0,l[5]=u,l[9]=d,l[13]=0,l[2]=0,l[6]=0,l[10]=p,l[14]=m,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(e,t,n,s,r,a,o=On){const l=this.elements,c=1/(t-e),u=1/(n-s),f=1/(a-r),d=(t+e)*c,p=(n+s)*u;let m,y;if(o===On)m=(a+r)*f,y=-2*f;else{if(2001!==o)throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+o);m=r*f,y=-1*f}return l[0]=2*c,l[4]=0,l[8]=0,l[12]=-d,l[1]=0,l[5]=2*u,l[9]=0,l[13]=-p,l[2]=0,l[6]=0,l[10]=y,l[14]=-m,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(e){const t=this.elements,n=e.elements;for(let s=0;s<16;s++)if(t[s]!==n[s])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}}const Ds=new F,en=new $e,Of=new F(0,0,0),Nf=new F(1,1,1),li=new F,no=new F,D0=new F,q5=new $e,Z5=new g0;let kf=(()=>{class i{constructor(t=0,n=0,s=0,r=i.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=n,this._z=s,this._order=r}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,n,s,r=this._order){return this._x=t,this._y=n,this._z=s,this._order=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,n=this._order,s=!0){const r=t.elements,a=r[0],o=r[4],l=r[8],c=r[1],u=r[5],f=r[9],d=r[2],p=r[6],m=r[10];switch(n){case"XYZ":this._y=Math.asin(Ut(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-f,m),this._z=Math.atan2(-o,a)):(this._x=Math.atan2(p,u),this._z=0);break;case"YXZ":this._x=Math.asin(-Ut(f,-1,1)),Math.abs(f)<.9999999?(this._y=Math.atan2(l,m),this._z=Math.atan2(c,u)):(this._y=Math.atan2(-d,a),this._z=0);break;case"ZXY":this._x=Math.asin(Ut(p,-1,1)),Math.abs(p)<.9999999?(this._y=Math.atan2(-d,m),this._z=Math.atan2(-o,u)):(this._y=0,this._z=Math.atan2(c,a));break;case"ZYX":this._y=Math.asin(-Ut(d,-1,1)),Math.abs(d)<.9999999?(this._x=Math.atan2(p,m),this._z=Math.atan2(c,a)):(this._x=0,this._z=Math.atan2(-o,u));break;case"YZX":this._z=Math.asin(Ut(c,-1,1)),Math.abs(c)<.9999999?(this._x=Math.atan2(-f,u),this._y=Math.atan2(-d,a)):(this._x=0,this._y=Math.atan2(l,m));break;case"XZY":this._z=Math.asin(-Ut(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(p,u),this._y=Math.atan2(l,a)):(this._x=Math.atan2(-f,m),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+n)}return this._order=n,!0===s&&this._onChangeCallback(),this}setFromQuaternion(t,n,s){return q5.makeRotationFromQuaternion(t),this.setFromRotationMatrix(q5,n,s)}setFromVector3(t,n=this._order){return this.set(t.x,t.y,t.z,n)}reorder(t){return Z5.setFromEuler(this),this.setFromQuaternion(Z5,t)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}fromArray(t){return this._x=t[0],this._y=t[1],this._z=t[2],void 0!==t[3]&&(this._order=t[3]),this._onChangeCallback(),this}toArray(t=[],n=0){return t[n]=this._x,t[n+1]=this._y,t[n+2]=this._z,t[n+3]=this._order,t}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}return i.DEFAULT_ORDER="XYZ",i})();class x2{constructor(){this.mask=1}set(e){this.mask=1<<e>>>0}enable(e){this.mask|=1<<e}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e}disable(e){this.mask&=~(1<<e)}disableAll(){this.mask=0}test(e){return 0!==(this.mask&e.mask)}isEnabled(e){return!!(this.mask&1<<e)}}let Uf=0;const J5=new F,Fs=new g0,Un=new $e,io=new F,Dr=new F,Bf=new F,Gf=new g0,K5=new F(1,0,0),$5=new F(0,1,0),Q5=new F(0,0,1),zf={type:"added"},Hf={type:"removed"};let Rt=(()=>{class i extends gn{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:Uf++}),this.uuid=I0(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=i.DEFAULT_UP.clone();const t=new F,n=new kf,s=new g0,r=new F(1,1,1);n._onChange(function a(){s.setFromEuler(n,!1)}),s._onChange(function o(){n.setFromQuaternion(s,void 0,!1)}),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:t},rotation:{configurable:!0,enumerable:!0,value:n},quaternion:{configurable:!0,enumerable:!0,value:s},scale:{configurable:!0,enumerable:!0,value:r},modelViewMatrix:{value:new $e},normalMatrix:{value:new Ye}}),this.matrix=new $e,this.matrixWorld=new $e,this.matrixAutoUpdate=i.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=i.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new x2,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(t){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(t),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(t){return this.quaternion.premultiply(t),this}setRotationFromAxisAngle(t,n){this.quaternion.setFromAxisAngle(t,n)}setRotationFromEuler(t){this.quaternion.setFromEuler(t,!0)}setRotationFromMatrix(t){this.quaternion.setFromRotationMatrix(t)}setRotationFromQuaternion(t){this.quaternion.copy(t)}rotateOnAxis(t,n){return Fs.setFromAxisAngle(t,n),this.quaternion.multiply(Fs),this}rotateOnWorldAxis(t,n){return Fs.setFromAxisAngle(t,n),this.quaternion.premultiply(Fs),this}rotateX(t){return this.rotateOnAxis(K5,t)}rotateY(t){return this.rotateOnAxis($5,t)}rotateZ(t){return this.rotateOnAxis(Q5,t)}translateOnAxis(t,n){return J5.copy(t).applyQuaternion(this.quaternion),this.position.add(J5.multiplyScalar(n)),this}translateX(t){return this.translateOnAxis(K5,t)}translateY(t){return this.translateOnAxis($5,t)}translateZ(t){return this.translateOnAxis(Q5,t)}localToWorld(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(this.matrixWorld)}worldToLocal(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(Un.copy(this.matrixWorld).invert())}lookAt(t,n,s){t.isVector3?io.copy(t):io.set(t,n,s);const r=this.parent;this.updateWorldMatrix(!0,!1),Dr.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Un.lookAt(Dr,io,this.up):Un.lookAt(io,Dr,this.up),this.quaternion.setFromRotationMatrix(Un),r&&(Un.extractRotation(r.matrixWorld),Fs.setFromRotationMatrix(Un),this.quaternion.premultiply(Fs.invert()))}add(t){if(arguments.length>1){for(let n=0;n<arguments.length;n++)this.add(arguments[n]);return this}return t===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",t),this):(t&&t.isObject3D?(null!==t.parent&&t.parent.remove(t),t.parent=this,this.children.push(t),t.dispatchEvent(zf)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",t),this)}remove(t){if(arguments.length>1){for(let s=0;s<arguments.length;s++)this.remove(arguments[s]);return this}const n=this.children.indexOf(t);return-1!==n&&(t.parent=null,this.children.splice(n,1),t.dispatchEvent(Hf)),this}removeFromParent(){const t=this.parent;return null!==t&&t.remove(this),this}clear(){return this.remove(...this.children)}attach(t){return this.updateWorldMatrix(!0,!1),Un.copy(this.matrixWorld).invert(),null!==t.parent&&(t.parent.updateWorldMatrix(!0,!1),Un.multiply(t.parent.matrixWorld)),t.applyMatrix4(Un),this.add(t),t.updateWorldMatrix(!1,!0),this}getObjectById(t){return this.getObjectByProperty("id",t)}getObjectByName(t){return this.getObjectByProperty("name",t)}getObjectByProperty(t,n){if(this[t]===n)return this;for(let s=0,r=this.children.length;s<r;s++){const o=this.children[s].getObjectByProperty(t,n);if(void 0!==o)return o}}getObjectsByProperty(t,n,s=[]){this[t]===n&&s.push(this);const r=this.children;for(let a=0,o=r.length;a<o;a++)r[a].getObjectsByProperty(t,n,s);return s}getWorldPosition(t){return this.updateWorldMatrix(!0,!1),t.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Dr,t,Bf),t}getWorldScale(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Dr,Gf,t),t}getWorldDirection(t){this.updateWorldMatrix(!0,!1);const n=this.matrixWorld.elements;return t.set(n[8],n[9],n[10]).normalize()}raycast(){}traverse(t){t(this);const n=this.children;for(let s=0,r=n.length;s<r;s++)n[s].traverse(t)}traverseVisible(t){if(!1===this.visible)return;t(this);const n=this.children;for(let s=0,r=n.length;s<r;s++)n[s].traverseVisible(t)}traverseAncestors(t){const n=this.parent;null!==n&&(t(n),n.traverseAncestors(t))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,t=!0);const n=this.children;for(let s=0,r=n.length;s<r;s++){const a=n[s];(!0===a.matrixWorldAutoUpdate||!0===t)&&a.updateMatrixWorld(t)}}updateWorldMatrix(t,n){const s=this.parent;if(!0===t&&null!==s&&!0===s.matrixWorldAutoUpdate&&s.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),!0===n){const r=this.children;for(let a=0,o=r.length;a<o;a++){const l=r[a];!0===l.matrixWorldAutoUpdate&&l.updateWorldMatrix(!1,!0)}}}toJSON(t){const n=void 0===t||"string"==typeof t,s={};n&&(t={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},s.metadata={version:4.6,type:"Object",generator:"Object3D.toJSON"});const r={};function a(l,c){return void 0===l[c.uuid]&&(l[c.uuid]=c.toJSON(t)),c.uuid}if(r.uuid=this.uuid,r.type=this.type,""!==this.name&&(r.name=this.name),!0===this.castShadow&&(r.castShadow=!0),!0===this.receiveShadow&&(r.receiveShadow=!0),!1===this.visible&&(r.visible=!1),!1===this.frustumCulled&&(r.frustumCulled=!1),0!==this.renderOrder&&(r.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),r.up=this.up.toArray(),!1===this.matrixAutoUpdate&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),null!==this.instanceColor&&(r.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(r.type="BatchedMesh",r.perObjectFrustumCulled=this.perObjectFrustumCulled,r.sortObjects=this.sortObjects,r.drawRanges=this._drawRanges,r.reservedRanges=this._reservedRanges,r.visibility=this._visibility,r.active=this._active,r.bounds=this._bounds.map(l=>({boxInitialized:l.boxInitialized,boxMin:l.box.min.toArray(),boxMax:l.box.max.toArray(),sphereInitialized:l.sphereInitialized,sphereRadius:l.sphere.radius,sphereCenter:l.sphere.center.toArray()})),r.maxGeometryCount=this._maxGeometryCount,r.maxVertexCount=this._maxVertexCount,r.maxIndexCount=this._maxIndexCount,r.geometryInitialized=this._geometryInitialized,r.geometryCount=this._geometryCount,r.matricesTexture=this._matricesTexture.toJSON(t),null!==this.boundingSphere&&(r.boundingSphere={center:r.boundingSphere.center.toArray(),radius:r.boundingSphere.radius}),null!==this.boundingBox&&(r.boundingBox={min:r.boundingBox.min.toArray(),max:r.boundingBox.max.toArray()})),this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&!0!==this.environment.isRenderTargetTexture&&(r.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=a(t.geometries,this.geometry);const l=this.geometry.parameters;if(void 0!==l&&void 0!==l.shapes){const c=l.shapes;if(Array.isArray(c))for(let u=0,f=c.length;u<f;u++)a(t.shapes,c[u]);else a(t.shapes,c)}}if(this.isSkinnedMesh&&(r.bindMode=this.bindMode,r.bindMatrix=this.bindMatrix.toArray(),void 0!==this.skeleton&&(a(t.skeletons,this.skeleton),r.skeleton=this.skeleton.uuid)),void 0!==this.material)if(Array.isArray(this.material)){const l=[];for(let c=0,u=this.material.length;c<u;c++)l.push(a(t.materials,this.material[c]));r.material=l}else r.material=a(t.materials,this.material);if(this.children.length>0){r.children=[];for(let l=0;l<this.children.length;l++)r.children.push(this.children[l].toJSON(t).object)}if(this.animations.length>0){r.animations=[];for(let l=0;l<this.animations.length;l++)r.animations.push(a(t.animations,this.animations[l]))}if(n){const l=o(t.geometries),c=o(t.materials),u=o(t.textures),f=o(t.images),d=o(t.shapes),p=o(t.skeletons),m=o(t.animations),y=o(t.nodes);l.length>0&&(s.geometries=l),c.length>0&&(s.materials=c),u.length>0&&(s.textures=u),f.length>0&&(s.images=f),d.length>0&&(s.shapes=d),p.length>0&&(s.skeletons=p),m.length>0&&(s.animations=m),y.length>0&&(s.nodes=y)}return s.object=r,s;function o(l){const c=[];for(const u in l){const f=l[u];delete f.metadata,c.push(f)}return c}}clone(t){return(new this.constructor).copy(this,t)}copy(t,n=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldAutoUpdate=t.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.animations=t.animations.slice(),this.userData=JSON.parse(JSON.stringify(t.userData)),!0===n)for(let s=0;s<t.children.length;s++)this.add(t.children[s].clone());return this}}return i.DEFAULT_UP=new F(0,1,0),i.DEFAULT_MATRIX_AUTO_UPDATE=!0,i.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0,i})();const tn=new F,Bn=new F,_2=new F,Gn=new F,Os=new F,Ns=new F,j5=new F,b2=new F,S2=new F,M2=new F;class W0{constructor(e=new F,t=new F,n=new F){this.a=e,this.b=t,this.c=n}static getNormal(e,t,n,s){s.subVectors(n,t),tn.subVectors(e,t),s.cross(tn);const r=s.lengthSq();return r>0?s.multiplyScalar(1/Math.sqrt(r)):s.set(0,0,0)}static getBarycoord(e,t,n,s,r){tn.subVectors(s,t),Bn.subVectors(n,t),_2.subVectors(e,t);const a=tn.dot(tn),o=tn.dot(Bn),l=tn.dot(_2),c=Bn.dot(Bn),u=Bn.dot(_2),f=a*c-o*o;if(0===f)return r.set(0,0,0),null;const d=1/f,p=(c*l-o*u)*d,m=(a*u-o*l)*d;return r.set(1-p-m,m,p)}static containsPoint(e,t,n,s){return null!==this.getBarycoord(e,t,n,s,Gn)&&Gn.x>=0&&Gn.y>=0&&Gn.x+Gn.y<=1}static getInterpolation(e,t,n,s,r,a,o,l){return null===this.getBarycoord(e,t,n,s,Gn)?(l.x=0,l.y=0,"z"in l&&(l.z=0),"w"in l&&(l.w=0),null):(l.setScalar(0),l.addScaledVector(r,Gn.x),l.addScaledVector(a,Gn.y),l.addScaledVector(o,Gn.z),l)}static isFrontFacing(e,t,n,s){return tn.subVectors(n,t),Bn.subVectors(e,t),tn.cross(Bn).dot(s)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,s){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[s]),this}setFromAttributeAndIndices(e,t,n,s){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,n),this.c.fromBufferAttribute(e,s),this}clone(){return(new this.constructor).copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return tn.subVectors(this.c,this.b),Bn.subVectors(this.a,this.b),.5*tn.cross(Bn).length()}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return W0.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return W0.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,n,s,r){return W0.getInterpolation(e,this.a,this.b,this.c,t,n,s,r)}containsPoint(e){return W0.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return W0.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const n=this.a,s=this.b,r=this.c;let a,o;Os.subVectors(s,n),Ns.subVectors(r,n),b2.subVectors(e,n);const l=Os.dot(b2),c=Ns.dot(b2);if(l<=0&&c<=0)return t.copy(n);S2.subVectors(e,s);const u=Os.dot(S2),f=Ns.dot(S2);if(u>=0&&f<=u)return t.copy(s);const d=l*f-u*c;if(d<=0&&l>=0&&u<=0)return a=l/(l-u),t.copy(n).addScaledVector(Os,a);M2.subVectors(e,r);const p=Os.dot(M2),m=Ns.dot(M2);if(m>=0&&p<=m)return t.copy(r);const y=p*c-l*m;if(y<=0&&c>=0&&m<=0)return o=c/(c-m),t.copy(n).addScaledVector(Ns,o);const v=u*m-p*f;if(v<=0&&f-u>=0&&p-m>=0)return j5.subVectors(r,s),o=(f-u)/(f-u+(p-m)),t.copy(s).addScaledVector(j5,o);const g=1/(v+y+d);return a=y*g,o=d*g,t.copy(n).addScaledVector(Os,a).addScaledVector(Ns,o)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const ec={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},ci={h:0,s:0,l:0},so={h:0,s:0,l:0};function E2(i,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?i+6*(e-i)*t:t<.5?e:t<2/3?i+6*(e-i)*(2/3-t):i}class be{constructor(e,t,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,n)}set(e,t,n){if(void 0===t&&void 0===n){const s=e;s&&s.isColor?this.copy(s):"number"==typeof s?this.setHex(s):"string"==typeof s&&this.setStyle(s)}else this.setRGB(e,t,n);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=t0){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,_t.toWorkingColorSpace(this,t),this}setRGB(e,t,n,s=_t.workingColorSpace){return this.r=e,this.g=t,this.b=n,_t.toWorkingColorSpace(this,s),this}setHSL(e,t,n,s=_t.workingColorSpace){if(e=function o2(i,e){return(i%e+e)%e}(e,1),t=Ut(t,0,1),n=Ut(n,0,1),0===t)this.r=this.g=this.b=n;else{const r=n<=.5?n*(1+t):n+t-n*t,a=2*n-r;this.r=E2(a,r,e+1/3),this.g=E2(a,r,e),this.b=E2(a,r,e-1/3)}return _t.toWorkingColorSpace(this,s),this}setStyle(e,t=t0){function n(r){void 0!==r&&parseFloat(r)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let s;if(s=/^(\w+)\(([^\)]*)\)/.exec(e)){let r;const o=s[2];switch(s[1]){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(r[4]),this.setRGB(Math.min(255,parseInt(r[1],10))/255,Math.min(255,parseInt(r[2],10))/255,Math.min(255,parseInt(r[3],10))/255,t);if(r=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(r[4]),this.setRGB(Math.min(100,parseInt(r[1],10))/100,Math.min(100,parseInt(r[2],10))/100,Math.min(100,parseInt(r[3],10))/100,t);break;case"hsl":case"hsla":if(r=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(r[4]),this.setHSL(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(s=/^\#([A-Fa-f\d]+)$/.exec(e)){const r=s[1],a=r.length;if(3===a)return this.setRGB(parseInt(r.charAt(0),16)/15,parseInt(r.charAt(1),16)/15,parseInt(r.charAt(2),16)/15,t);if(6===a)return this.setHex(parseInt(r,16),t);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=t0){const n=ec[e.toLowerCase()];return void 0!==n?this.setHex(n,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=As(e.r),this.g=As(e.g),this.b=As(e.b),this}copyLinearToSRGB(e){return this.r=h2(e.r),this.g=h2(e.g),this.b=h2(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=t0){return _t.fromWorkingColorSpace(o0.copy(this),e),65536*Math.round(Ut(255*o0.r,0,255))+256*Math.round(Ut(255*o0.g,0,255))+Math.round(Ut(255*o0.b,0,255))}getHexString(e=t0){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=_t.workingColorSpace){_t.fromWorkingColorSpace(o0.copy(this),t);const n=o0.r,s=o0.g,r=o0.b,a=Math.max(n,s,r),o=Math.min(n,s,r);let l,c;const u=(o+a)/2;if(o===a)l=0,c=0;else{const f=a-o;switch(c=u<=.5?f/(a+o):f/(2-a-o),a){case n:l=(s-r)/f+(s<r?6:0);break;case s:l=(r-n)/f+2;break;case r:l=(n-s)/f+4}l/=6}return e.h=l,e.s=c,e.l=u,e}getRGB(e,t=_t.workingColorSpace){return _t.fromWorkingColorSpace(o0.copy(this),t),e.r=o0.r,e.g=o0.g,e.b=o0.b,e}getStyle(e=t0){_t.fromWorkingColorSpace(o0.copy(this),e);const t=o0.r,n=o0.g,s=o0.b;return e!==t0?`color(${e} ${t.toFixed(3)} ${n.toFixed(3)} ${s.toFixed(3)})`:`rgb(${Math.round(255*t)},${Math.round(255*n)},${Math.round(255*s)})`}offsetHSL(e,t,n){return this.getHSL(ci),this.setHSL(ci.h+e,ci.s+t,ci.l+n)}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}lerpColors(e,t,n){return this.r=e.r+(t.r-e.r)*n,this.g=e.g+(t.g-e.g)*n,this.b=e.b+(t.b-e.b)*n,this}lerpHSL(e,t){this.getHSL(ci),e.getHSL(so);const n=Cr(ci.h,so.h,t),s=Cr(ci.s,so.s,t),r=Cr(ci.l,so.l,t);return this.setHSL(n,s,r),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){const t=this.r,n=this.g,s=this.b,r=e.elements;return this.r=r[0]*t+r[3]*n+r[6]*s,this.g=r[1]*t+r[4]*n+r[7]*s,this.b=r[2]*t+r[5]*n+r[8]*s,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(e=[],t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}const o0=new be;be.NAMES=ec;let Vf=0;class y0 extends gn{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:Vf++}),this.uuid=I0(),this.name="",this.type="Material",this.blending=1,this.side=0,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=204,this.blendDst=205,this.blendEquation=100,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new be(0,0,0),this.blendAlpha=0,this.depthFunc=3,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=519,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=Es,this.stencilZFail=Es,this.stencilZPass=Es,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(void 0!==e)for(const t in e){const n=e[t];if(void 0===n){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}const s=this[t];void 0!==s?s&&s.isColor?s.set(n):s&&s.isVector3&&n&&n.isVector3?s.copy(n):this[t]=n:console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`)}}toJSON(e){const t=void 0===e||"string"==typeof e;t&&(e={textures:{},images:{}});const n={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};function s(r){const a=[];for(const o in r){const l=r[o];delete l.metadata,a.push(l)}return a}if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),void 0!==this.roughness&&(n.roughness=this.roughness),void 0!==this.metalness&&(n.metalness=this.metalness),void 0!==this.sheen&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),void 0!==this.sheenRoughness&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity&&1!==this.emissiveIntensity&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),void 0!==this.specularIntensity&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),void 0!==this.shininess&&(n.shininess=this.shininess),void 0!==this.clearcoat&&(n.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),void 0!==this.iridescence&&(n.iridescence=this.iridescence),void 0!==this.iridescenceIOR&&(n.iridescenceIOR=this.iridescenceIOR),void 0!==this.iridescenceThicknessRange&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),void 0!==this.anisotropy&&(n.anisotropy=this.anisotropy),void 0!==this.anisotropyRotation&&(n.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(n.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,void 0!==this.combine&&(n.combine=this.combine)),void 0!==this.envMapIntensity&&(n.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(n.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),void 0!==this.transmission&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),void 0!==this.thickness&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).uuid),void 0!==this.attenuationDistance&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationColor&&(n.attenuationColor=this.attenuationColor.getHex()),void 0!==this.size&&(n.size=this.size),null!==this.shadowSide&&(n.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(n.sizeAttenuation=this.sizeAttenuation),1!==this.blending&&(n.blending=this.blending),0!==this.side&&(n.side=this.side),!0===this.vertexColors&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),!0===this.transparent&&(n.transparent=!0),204!==this.blendSrc&&(n.blendSrc=this.blendSrc),205!==this.blendDst&&(n.blendDst=this.blendDst),100!==this.blendEquation&&(n.blendEquation=this.blendEquation),null!==this.blendSrcAlpha&&(n.blendSrcAlpha=this.blendSrcAlpha),null!==this.blendDstAlpha&&(n.blendDstAlpha=this.blendDstAlpha),null!==this.blendEquationAlpha&&(n.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(n.blendColor=this.blendColor.getHex()),0!==this.blendAlpha&&(n.blendAlpha=this.blendAlpha),3!==this.depthFunc&&(n.depthFunc=this.depthFunc),!1===this.depthTest&&(n.depthTest=this.depthTest),!1===this.depthWrite&&(n.depthWrite=this.depthWrite),!1===this.colorWrite&&(n.colorWrite=this.colorWrite),255!==this.stencilWriteMask&&(n.stencilWriteMask=this.stencilWriteMask),519!==this.stencilFunc&&(n.stencilFunc=this.stencilFunc),0!==this.stencilRef&&(n.stencilRef=this.stencilRef),255!==this.stencilFuncMask&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==Es&&(n.stencilFail=this.stencilFail),this.stencilZFail!==Es&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==Es&&(n.stencilZPass=this.stencilZPass),!0===this.stencilWrite&&(n.stencilWrite=this.stencilWrite),void 0!==this.rotation&&0!==this.rotation&&(n.rotation=this.rotation),!0===this.polygonOffset&&(n.polygonOffset=!0),0!==this.polygonOffsetFactor&&(n.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(n.polygonOffsetUnits=this.polygonOffsetUnits),void 0!==this.linewidth&&1!==this.linewidth&&(n.linewidth=this.linewidth),void 0!==this.dashSize&&(n.dashSize=this.dashSize),void 0!==this.gapSize&&(n.gapSize=this.gapSize),void 0!==this.scale&&(n.scale=this.scale),!0===this.dithering&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),!0===this.alphaHash&&(n.alphaHash=!0),!0===this.alphaToCoverage&&(n.alphaToCoverage=!0),!0===this.premultipliedAlpha&&(n.premultipliedAlpha=!0),!0===this.forceSinglePass&&(n.forceSinglePass=!0),!0===this.wireframe&&(n.wireframe=!0),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(n.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(n.wireframeLinejoin=this.wireframeLinejoin),!0===this.flatShading&&(n.flatShading=!0),!1===this.visible&&(n.visible=!1),!1===this.toneMapped&&(n.toneMapped=!1),!1===this.fog&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData),t){const r=s(e.textures),a=s(e.images);r.length>0&&(n.textures=r),a.length>0&&(n.images=a)}return n}clone(){return(new this.constructor).copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let n=null;if(null!==t){const s=t.length;n=new Array(s);for(let r=0;r!==s;++r)n[r]=t[r].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){!0===e&&this.version++}}class zi extends y0{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new be(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const Kt=new F,ro=new H;class vt{constructor(e,t,n=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=e,this.itemSize=t,this.count=void 0!==e?e.length/t:0,this.normalized=n,this.usage=35044,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=Q0,this.version=0}onUploadCallback(){}set needsUpdate(e){!0===e&&this.version++}get updateRange(){return Ui("THREE.BufferAttribute: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,n){e*=this.itemSize,n*=t.itemSize;for(let s=0,r=this.itemSize;s<r;s++)this.array[e+s]=t.array[n+s];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(2===this.itemSize)for(let t=0,n=this.count;t<n;t++)ro.fromBufferAttribute(this,t),ro.applyMatrix3(e),this.setXY(t,ro.x,ro.y);else if(3===this.itemSize)for(let t=0,n=this.count;t<n;t++)Kt.fromBufferAttribute(this,t),Kt.applyMatrix3(e),this.setXYZ(t,Kt.x,Kt.y,Kt.z);return this}applyMatrix4(e){for(let t=0,n=this.count;t<n;t++)Kt.fromBufferAttribute(this,t),Kt.applyMatrix4(e),this.setXYZ(t,Kt.x,Kt.y,Kt.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)Kt.fromBufferAttribute(this,t),Kt.applyNormalMatrix(e),this.setXYZ(t,Kt.x,Kt.y,Kt.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)Kt.fromBufferAttribute(this,t),Kt.transformDirection(e),this.setXYZ(t,Kt.x,Kt.y,Kt.z);return this}set(e,t=0){return this.array.set(e,t),this}getComponent(e,t){let n=this.array[e*this.itemSize+t];return this.normalized&&(n=m0(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=rt(n,this.array)),this.array[e*this.itemSize+t]=n,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=m0(t,this.array)),t}setX(e,t){return this.normalized&&(t=rt(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=m0(t,this.array)),t}setY(e,t){return this.normalized&&(t=rt(t,this.array)),this.array[e*this.itemSize+1]=t,this}getZ(e){let t=this.array[e*this.itemSize+2];return this.normalized&&(t=m0(t,this.array)),t}setZ(e,t){return this.normalized&&(t=rt(t,this.array)),this.array[e*this.itemSize+2]=t,this}getW(e){let t=this.array[e*this.itemSize+3];return this.normalized&&(t=m0(t,this.array)),t}setW(e,t){return this.normalized&&(t=rt(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,n){return e*=this.itemSize,this.normalized&&(t=rt(t,this.array),n=rt(n,this.array)),this.array[e+0]=t,this.array[e+1]=n,this}setXYZ(e,t,n,s){return e*=this.itemSize,this.normalized&&(t=rt(t,this.array),n=rt(n,this.array),s=rt(s,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=s,this}setXYZW(e,t,n,s,r){return e*=this.itemSize,this.normalized&&(t=rt(t,this.array),n=rt(n,this.array),s=rt(s,this.array),r=rt(r,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=s,this.array[e+3]=r,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return""!==this.name&&(e.name=this.name),35044!==this.usage&&(e.usage=this.usage),e}}class tc extends vt{constructor(e,t,n){super(new Uint16Array(e),t,n)}}class nc extends vt{constructor(e,t,n){super(new Uint32Array(e),t,n)}}class Ne extends vt{constructor(e,t,n){super(new Float32Array(e),t,n)}}let Xf=0;const X0=new $e,T2=new Rt,ks=new F,F0=new C0,Or=new C0,n0=new F;class ct extends gn{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:Xf++}),this.uuid=I0(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){return this.index=Array.isArray(e)?new(G5(e)?nc:tc)(e,1):e,this}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return void 0!==this.attributes[e]}addGroup(e,t,n=0){this.groups.push({start:e,count:t,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){const t=this.attributes.position;void 0!==t&&(t.applyMatrix4(e),t.needsUpdate=!0);const n=this.attributes.normal;if(void 0!==n){const r=(new Ye).getNormalMatrix(e);n.applyNormalMatrix(r),n.needsUpdate=!0}const s=this.attributes.tangent;return void 0!==s&&(s.transformDirection(e),s.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}applyQuaternion(e){return X0.makeRotationFromQuaternion(e),this.applyMatrix4(X0),this}rotateX(e){return X0.makeRotationX(e),this.applyMatrix4(X0),this}rotateY(e){return X0.makeRotationY(e),this.applyMatrix4(X0),this}rotateZ(e){return X0.makeRotationZ(e),this.applyMatrix4(X0),this}translate(e,t,n){return X0.makeTranslation(e,t,n),this.applyMatrix4(X0),this}scale(e,t,n){return X0.makeScale(e,t,n),this.applyMatrix4(X0),this}lookAt(e){return T2.lookAt(e),T2.updateMatrix(),this.applyMatrix4(T2.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(ks).negate(),this.translate(ks.x,ks.y,ks.z),this}setFromPoints(e){const t=[];for(let n=0,s=e.length;n<s;n++){const r=e[n];t.push(r.x,r.y,r.z||0)}return this.setAttribute("position",new Ne(t,3)),this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new C0);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute)return console.error('THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box. Alternatively set "mesh.frustumCulled" to "false".',this),void this.boundingBox.set(new F(-1/0,-1/0,-1/0),new F(1/0,1/0,1/0));if(void 0!==e){if(this.boundingBox.setFromBufferAttribute(e),t)for(let n=0,s=t.length;n<s;n++)F0.setFromBufferAttribute(t[n]),this.morphTargetsRelative?(n0.addVectors(this.boundingBox.min,F0.min),this.boundingBox.expandByPoint(n0),n0.addVectors(this.boundingBox.max,F0.max),this.boundingBox.expandByPoint(n0)):(this.boundingBox.expandByPoint(F0.min),this.boundingBox.expandByPoint(F0.max))}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){null===this.boundingSphere&&(this.boundingSphere=new v0);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute)return console.error('THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere. Alternatively set "mesh.frustumCulled" to "false".',this),void this.boundingSphere.set(new F,1/0);if(e){const n=this.boundingSphere.center;if(F0.setFromBufferAttribute(e),t)for(let r=0,a=t.length;r<a;r++)Or.setFromBufferAttribute(t[r]),this.morphTargetsRelative?(n0.addVectors(F0.min,Or.min),F0.expandByPoint(n0),n0.addVectors(F0.max,Or.max),F0.expandByPoint(n0)):(F0.expandByPoint(Or.min),F0.expandByPoint(Or.max));F0.getCenter(n);let s=0;for(let r=0,a=e.count;r<a;r++)n0.fromBufferAttribute(e,r),s=Math.max(s,n.distanceToSquared(n0));if(t)for(let r=0,a=t.length;r<a;r++){const o=t[r],l=this.morphTargetsRelative;for(let c=0,u=o.count;c<u;c++)n0.fromBufferAttribute(o,c),l&&(ks.fromBufferAttribute(e,c),n0.add(ks)),s=Math.max(s,n.distanceToSquared(n0))}this.boundingSphere.radius=Math.sqrt(s),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const e=this.index,t=this.attributes;if(null===e||void 0===t.position||void 0===t.normal||void 0===t.uv)return void console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");const n=e.array,s=t.position.array,r=t.normal.array,a=t.uv.array,o=s.length/3;!1===this.hasAttribute("tangent")&&this.setAttribute("tangent",new vt(new Float32Array(4*o),4));const l=this.getAttribute("tangent").array,c=[],u=[];for(let S=0;S<o;S++)c[S]=new F,u[S]=new F;const f=new F,d=new F,p=new F,m=new H,y=new H,v=new H,g=new F,_=new F;function x(S,P,X){f.fromArray(s,3*S),d.fromArray(s,3*P),p.fromArray(s,3*X),m.fromArray(a,2*S),y.fromArray(a,2*P),v.fromArray(a,2*X),d.sub(f),p.sub(f),y.sub(m),v.sub(m);const te=1/(y.x*v.y-v.x*y.y);isFinite(te)&&(g.copy(d).multiplyScalar(v.y).addScaledVector(p,-y.y).multiplyScalar(te),_.copy(p).multiplyScalar(y.x).addScaledVector(d,-v.x).multiplyScalar(te),c[S].add(g),c[P].add(g),c[X].add(g),u[S].add(_),u[P].add(_),u[X].add(_))}let b=this.groups;0===b.length&&(b=[{start:0,count:n.length}]);for(let S=0,P=b.length;S<P;++S){const X=b[S],te=X.start;for(let z=te,G=te+X.count;z<G;z+=3)x(n[z+0],n[z+1],n[z+2])}const T=new F,E=new F,M=new F,w=new F;function I(S){M.fromArray(r,3*S),w.copy(M);const P=c[S];T.copy(P),T.sub(M.multiplyScalar(M.dot(P))).normalize(),E.crossVectors(w,P);const te=E.dot(u[S])<0?-1:1;l[4*S]=T.x,l[4*S+1]=T.y,l[4*S+2]=T.z,l[4*S+3]=te}for(let S=0,P=b.length;S<P;++S){const X=b[S],te=X.start;for(let z=te,G=te+X.count;z<G;z+=3)I(n[z+0]),I(n[z+1]),I(n[z+2])}}computeVertexNormals(){const e=this.index,t=this.getAttribute("position");if(void 0!==t){let n=this.getAttribute("normal");if(void 0===n)n=new vt(new Float32Array(3*t.count),3),this.setAttribute("normal",n);else for(let d=0,p=n.count;d<p;d++)n.setXYZ(d,0,0,0);const s=new F,r=new F,a=new F,o=new F,l=new F,c=new F,u=new F,f=new F;if(e)for(let d=0,p=e.count;d<p;d+=3){const m=e.getX(d+0),y=e.getX(d+1),v=e.getX(d+2);s.fromBufferAttribute(t,m),r.fromBufferAttribute(t,y),a.fromBufferAttribute(t,v),u.subVectors(a,r),f.subVectors(s,r),u.cross(f),o.fromBufferAttribute(n,m),l.fromBufferAttribute(n,y),c.fromBufferAttribute(n,v),o.add(u),l.add(u),c.add(u),n.setXYZ(m,o.x,o.y,o.z),n.setXYZ(y,l.x,l.y,l.z),n.setXYZ(v,c.x,c.y,c.z)}else for(let d=0,p=t.count;d<p;d+=3)s.fromBufferAttribute(t,d+0),r.fromBufferAttribute(t,d+1),a.fromBufferAttribute(t,d+2),u.subVectors(a,r),f.subVectors(s,r),u.cross(f),n.setXYZ(d+0,u.x,u.y,u.z),n.setXYZ(d+1,u.x,u.y,u.z),n.setXYZ(d+2,u.x,u.y,u.z);this.normalizeNormals(),n.needsUpdate=!0}}normalizeNormals(){const e=this.attributes.normal;for(let t=0,n=e.count;t<n;t++)n0.fromBufferAttribute(e,t),n0.normalize(),e.setXYZ(t,n0.x,n0.y,n0.z)}toNonIndexed(){function e(o,l){const c=o.array,u=o.itemSize,f=o.normalized,d=new c.constructor(l.length*u);let p=0,m=0;for(let y=0,v=l.length;y<v;y++){p=o.isInterleavedBufferAttribute?l[y]*o.data.stride+o.offset:l[y]*u;for(let g=0;g<u;g++)d[m++]=c[p++]}return new vt(d,u,f)}if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const t=new ct,n=this.index.array,s=this.attributes;for(const o in s){const c=e(s[o],n);t.setAttribute(o,c)}const r=this.morphAttributes;for(const o in r){const l=[],c=r[o];for(let u=0,f=c.length;u<f;u++){const p=e(c[u],n);l.push(p)}t.morphAttributes[o]=l}t.morphTargetsRelative=this.morphTargetsRelative;const a=this.groups;for(let o=0,l=a.length;o<l;o++){const c=a[o];t.addGroup(c.start,c.count,c.materialIndex)}return t}toJSON(){const e={metadata:{version:4.6,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,""!==this.name&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),void 0!==this.parameters){const l=this.parameters;for(const c in l)void 0!==l[c]&&(e[c]=l[c]);return e}e.data={attributes:{}};const t=this.index;null!==t&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const n=this.attributes;for(const l in n)e.data.attributes[l]=n[l].toJSON(e.data);const s={};let r=!1;for(const l in this.morphAttributes){const c=this.morphAttributes[l],u=[];for(let f=0,d=c.length;f<d;f++)u.push(c[f].toJSON(e.data));u.length>0&&(s[l]=u,r=!0)}r&&(e.data.morphAttributes=s,e.data.morphTargetsRelative=this.morphTargetsRelative);const a=this.groups;a.length>0&&(e.data.groups=JSON.parse(JSON.stringify(a)));const o=this.boundingSphere;return null!==o&&(e.data.boundingSphere={center:o.center.toArray(),radius:o.radius}),e}clone(){return(new this.constructor).copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const n=e.index;null!==n&&this.setIndex(n.clone(t));const s=e.attributes;for(const c in s)this.setAttribute(c,s[c].clone(t));const r=e.morphAttributes;for(const c in r){const u=[],f=r[c];for(let d=0,p=f.length;d<p;d++)u.push(f[d].clone(t));this.morphAttributes[c]=u}this.morphTargetsRelative=e.morphTargetsRelative;const a=e.groups;for(let c=0,u=a.length;c<u;c++){const f=a[c];this.addGroup(f.start,f.count,f.materialIndex)}const o=e.boundingBox;null!==o&&(this.boundingBox=o.clone());const l=e.boundingSphere;return null!==l&&(this.boundingSphere=l.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}const ic=new $e,Hi=new Ir,ao=new v0,sc=new F,Us=new F,Bs=new F,Gs=new F,w2=new F,oo=new F,lo=new H,co=new H,ho=new H,rc=new F,ac=new F,oc=new F,uo=new F,fo=new F;class $t extends Rt{constructor(e=new ct,t=new zi){super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),void 0!==e.morphTargetInfluences&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),void 0!==e.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}updateMorphTargets(){const t=this.geometry.morphAttributes,n=Object.keys(t);if(n.length>0){const s=t[n[0]];if(void 0!==s){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,a=s.length;r<a;r++){const o=s[r].name||String(r);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=r}}}}getVertexPosition(e,t){const n=this.geometry,r=n.morphAttributes.position,a=n.morphTargetsRelative;t.fromBufferAttribute(n.attributes.position,e);const o=this.morphTargetInfluences;if(r&&o){oo.set(0,0,0);for(let l=0,c=r.length;l<c;l++){const u=o[l];0!==u&&(w2.fromBufferAttribute(r[l],e),oo.addScaledVector(a?w2:w2.sub(t),u))}t.add(oo)}return t}raycast(e,t){const n=this.geometry,r=this.matrixWorld;void 0!==this.material&&(null===n.boundingSphere&&n.computeBoundingSphere(),ao.copy(n.boundingSphere),ao.applyMatrix4(r),Hi.copy(e.ray).recast(e.near),(!1!==ao.containsPoint(Hi.origin)||!(null===Hi.intersectSphere(ao,sc)||Hi.origin.distanceToSquared(sc)>(e.far-e.near)**2))&&(ic.copy(r).invert(),Hi.copy(e.ray).applyMatrix4(ic),(null===n.boundingBox||!1!==Hi.intersectsBox(n.boundingBox))&&this._computeIntersections(e,t,Hi)))}_computeIntersections(e,t,n){let s;const r=this.geometry,a=this.material,o=r.index,l=r.attributes.position,c=r.attributes.uv,u=r.attributes.uv1,f=r.attributes.normal,d=r.groups,p=r.drawRange;if(null!==o)if(Array.isArray(a))for(let m=0,y=d.length;m<y;m++){const v=d[m],g=a[v.materialIndex];for(let b=Math.max(v.start,p.start),T=Math.min(o.count,Math.min(v.start+v.count,p.start+p.count));b<T;b+=3)s=po(this,g,e,n,c,u,f,o.getX(b),o.getX(b+1),o.getX(b+2)),s&&(s.faceIndex=Math.floor(b/3),s.face.materialIndex=v.materialIndex,t.push(s))}else for(let v=Math.max(0,p.start),g=Math.min(o.count,p.start+p.count);v<g;v+=3)s=po(this,a,e,n,c,u,f,o.getX(v),o.getX(v+1),o.getX(v+2)),s&&(s.faceIndex=Math.floor(v/3),t.push(s));else if(void 0!==l)if(Array.isArray(a))for(let m=0,y=d.length;m<y;m++){const v=d[m],g=a[v.materialIndex];for(let b=Math.max(v.start,p.start),T=Math.min(l.count,Math.min(v.start+v.count,p.start+p.count));b<T;b+=3)s=po(this,g,e,n,c,u,f,b,b+1,b+2),s&&(s.faceIndex=Math.floor(b/3),s.face.materialIndex=v.materialIndex,t.push(s))}else for(let v=Math.max(0,p.start),g=Math.min(l.count,p.start+p.count);v<g;v+=3)s=po(this,a,e,n,c,u,f,v,v+1,v+2),s&&(s.faceIndex=Math.floor(v/3),t.push(s))}}function po(i,e,t,n,s,r,a,o,l,c){i.getVertexPosition(o,Us),i.getVertexPosition(l,Bs),i.getVertexPosition(c,Gs);const u=function Yf(i,e,t,n,s,r,a,o){let l;if(l=1===e.side?n.intersectTriangle(a,r,s,!0,o):n.intersectTriangle(s,r,a,0===e.side,o),null===l)return null;fo.copy(o),fo.applyMatrix4(i.matrixWorld);const c=t.ray.origin.distanceTo(fo);return c<t.near||c>t.far?null:{distance:c,point:fo.clone(),object:i}}(i,e,t,n,Us,Bs,Gs,uo);if(u){s&&(lo.fromBufferAttribute(s,o),co.fromBufferAttribute(s,l),ho.fromBufferAttribute(s,c),u.uv=W0.getInterpolation(uo,Us,Bs,Gs,lo,co,ho,new H)),r&&(lo.fromBufferAttribute(r,o),co.fromBufferAttribute(r,l),ho.fromBufferAttribute(r,c),u.uv1=W0.getInterpolation(uo,Us,Bs,Gs,lo,co,ho,new H),u.uv2=u.uv1),a&&(rc.fromBufferAttribute(a,o),ac.fromBufferAttribute(a,l),oc.fromBufferAttribute(a,c),u.normal=W0.getInterpolation(uo,Us,Bs,Gs,rc,ac,oc,new F),u.normal.dot(n.direction)>0&&u.normal.multiplyScalar(-1));const f={a:o,b:l,c,normal:new F,materialIndex:0};W0.getNormal(Us,Bs,Gs,f.normal),u.face=f}return u}class zs extends ct{constructor(e=1,t=1,n=1,s=1,r=1,a=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:s,heightSegments:r,depthSegments:a};const o=this;s=Math.floor(s),r=Math.floor(r),a=Math.floor(a);const l=[],c=[],u=[],f=[];let d=0,p=0;function m(y,v,g,_,x,b,T,E,M,w,I){const S=b/M,P=T/w,X=b/2,te=T/2,U=E/2,z=M+1,G=w+1;let ee=0,J=0;const Z=new F;for(let ne=0;ne<G;ne++){const Y=ne*P-te;for(let he=0;he<z;he++)Z[y]=(he*S-X)*_,Z[v]=Y*x,Z[g]=U,c.push(Z.x,Z.y,Z.z),Z[y]=0,Z[v]=0,Z[g]=E>0?1:-1,u.push(Z.x,Z.y,Z.z),f.push(he/M),f.push(1-ne/w),ee+=1}for(let ne=0;ne<w;ne++)for(let Y=0;Y<M;Y++){const Ce=d+Y+z*(ne+1),Q=d+(Y+1)+z*(ne+1),ae=d+(Y+1)+z*ne;l.push(d+Y+z*ne,Ce,ae),l.push(Ce,Q,ae),J+=6}o.addGroup(p,J,I),p+=J,d+=ee}m("z","y","x",-1,-1,n,t,e,a,r,0),m("z","y","x",1,-1,n,t,-e,a,r,1),m("x","z","y",1,1,e,n,t,s,a,2),m("x","z","y",1,-1,e,n,-t,s,a,3),m("x","y","z",1,-1,e,t,n,s,r,4),m("x","y","z",-1,-1,e,t,-n,s,r,5),this.setIndex(l),this.setAttribute("position",new Ne(c,3)),this.setAttribute("normal",new Ne(u,3)),this.setAttribute("uv",new Ne(f,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new zs(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}function Hs(i){const e={};for(const t in i){e[t]={};for(const n in i[t]){const s=i[t][n];s&&(s.isColor||s.isMatrix3||s.isMatrix4||s.isVector2||s.isVector3||s.isVector4||s.isTexture||s.isQuaternion)?s.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[t][n]=null):e[t][n]=s.clone():e[t][n]=Array.isArray(s)?s.slice():s}}return e}function x0(i){const e={};for(let t=0;t<i.length;t++){const n=Hs(i[t]);for(const s in n)e[s]=n[s]}return e}function lc(i){return null===i.getRenderTarget()?i.outputColorSpace:_t.workingColorSpace}const Zf={clone:Hs,merge:x0};class yn extends y0{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader="void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",this.fragmentShader="void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1,clipCullDistance:!1,multiDraw:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,void 0!==e&&this.setValues(e)}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=Hs(e.uniforms),this.uniformsGroups=function qf(i){const e=[];for(let t=0;t<i.length;t++)e.push(i[t].clone());return e}(e.uniformsGroups),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.fog=e.fog,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this}toJSON(e){const t=super.toJSON(e);t.glslVersion=this.glslVersion,t.uniforms={};for(const s in this.uniforms){const a=this.uniforms[s].value;t.uniforms[s]=a&&a.isTexture?{type:"t",value:a.toJSON(e).uuid}:a&&a.isColor?{type:"c",value:a.getHex()}:a&&a.isVector2?{type:"v2",value:a.toArray()}:a&&a.isVector3?{type:"v3",value:a.toArray()}:a&&a.isVector4?{type:"v4",value:a.toArray()}:a&&a.isMatrix3?{type:"m3",value:a.toArray()}:a&&a.isMatrix4?{type:"m4",value:a.toArray()}:{value:a}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;const n={};for(const s in this.extensions)!0===this.extensions[s]&&(n[s]=!0);return Object.keys(n).length>0&&(t.extensions=n),t}}class A2 extends Rt{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new $e,this.projectionMatrix=new $e,this.projectionMatrixInverse=new $e,this.coordinateSystem=On}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return(new this.constructor).copy(this)}}const hi=new F,cc=new H,hc=new H;class l0 extends A2{constructor(e=50,t=1,n=.1,s=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=n,this.far=s,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=null===e.view?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=2*Ts*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(.5*ki*this.fov);return.5*this.getFilmHeight()/e}getEffectiveFOV(){return 2*Ts*Math.atan(Math.tan(.5*ki*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,t,n){hi.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(hi.x,hi.y).multiplyScalar(-e/hi.z),hi.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(hi.x,hi.y).multiplyScalar(-e/hi.z)}getViewSize(e,t){return this.getViewBounds(e,cc,hc),t.subVectors(hc,cc)}setViewOffset(e,t,n,s,r,a){this.aspect=e/t,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=s,this.view.width=r,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(.5*ki*this.fov)/this.zoom,n=2*t,s=this.aspect*n,r=-.5*s;const a=this.view;if(null!==this.view&&this.view.enabled){const l=a.fullWidth,c=a.fullHeight;r+=a.offsetX*s/l,t-=a.offsetY*n/c,s*=a.width/l,n*=a.height/c}const o=this.filmOffset;0!==o&&(r+=e*o/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+s,t,t-n,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,null!==this.view&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}class $f extends Rt{constructor(e,t,n){super(),this.type="CubeCamera",this.renderTarget=n,this.coordinateSystem=null,this.activeMipmapLevel=0;const s=new l0(-90,1,e,t);s.layers=this.layers,this.add(s);const r=new l0(-90,1,e,t);r.layers=this.layers,this.add(r);const a=new l0(-90,1,e,t);a.layers=this.layers,this.add(a);const o=new l0(-90,1,e,t);o.layers=this.layers,this.add(o);const l=new l0(-90,1,e,t);l.layers=this.layers,this.add(l);const c=new l0(-90,1,e,t);c.layers=this.layers,this.add(c)}updateCoordinateSystem(){const e=this.coordinateSystem,t=this.children.concat(),[n,s,r,a,o,l]=t;for(const c of t)this.remove(c);if(e===On)n.up.set(0,1,0),n.lookAt(1,0,0),s.up.set(0,1,0),s.lookAt(-1,0,0),r.up.set(0,0,-1),r.lookAt(0,1,0),a.up.set(0,0,1),a.lookAt(0,-1,0),o.up.set(0,1,0),o.lookAt(0,0,1),l.up.set(0,1,0),l.lookAt(0,0,-1);else{if(2001!==e)throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);n.up.set(0,-1,0),n.lookAt(-1,0,0),s.up.set(0,-1,0),s.lookAt(1,0,0),r.up.set(0,0,1),r.lookAt(0,1,0),a.up.set(0,0,-1),a.lookAt(0,-1,0),o.up.set(0,-1,0),o.lookAt(0,0,1),l.up.set(0,-1,0),l.lookAt(0,0,-1)}for(const c of t)this.add(c),c.updateMatrixWorld()}update(e,t){null===this.parent&&this.updateMatrixWorld();const{renderTarget:n,activeMipmapLevel:s}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[r,a,o,l,c,u]=this.children,f=e.getRenderTarget(),d=e.getActiveCubeFace(),p=e.getActiveMipmapLevel(),m=e.xr.enabled;e.xr.enabled=!1;const y=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,e.setRenderTarget(n,0,s),e.render(t,r),e.setRenderTarget(n,1,s),e.render(t,a),e.setRenderTarget(n,2,s),e.render(t,o),e.setRenderTarget(n,3,s),e.render(t,l),e.setRenderTarget(n,4,s),e.render(t,c),n.texture.generateMipmaps=y,e.setRenderTarget(n,5,s),e.render(t,u),e.setRenderTarget(f,d,p),e.xr.enabled=m,n.texture.needsPMREMUpdate=!0}}class mo extends A0{constructor(e,t,n,s,r,a,o,l,c,u){super(e=void 0!==e?e:[],t=void 0!==t?t:301,n,s,r,a,o,l,c,u),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class Qf extends vn{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;const n={width:e,height:e,depth:1},s=[n,n,n,n,n,n];void 0!==t.encoding&&(Ui("THREE.WebGLCubeRenderTarget: option.encoding has been replaced by option.colorSpace."),t.colorSpace=t.encoding===Oi?t0:""),this.texture=new mo(s,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=void 0!==t.generateMipmaps&&t.generateMipmaps,this.texture.minFilter=void 0!==t.minFilter?t.minFilter:kt}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const n_uniforms={tEquirect:{value:null}},n_vertexShader="\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\tvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t\t\t\t\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t\t\t\t\t#include <begin_vertex>\n\t\t\t\t\t#include <project_vertex>\n\n\t\t\t\t}\n\t\t\t",n_fragmentShader="\n\n\t\t\t\tuniform sampler2D tEquirect;\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\t#include <common>\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvec3 direction = normalize( vWorldDirection );\n\n\t\t\t\t\tvec2 sampleUV = equirectUv( direction );\n\n\t\t\t\t\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\n\t\t\t\t}\n\t\t\t",s=new zs(5,5,5),r=new yn({name:"CubemapFromEquirect",uniforms:Hs(n_uniforms),vertexShader:n_vertexShader,fragmentShader:n_fragmentShader,side:1,blending:0});r.uniforms.tEquirect.value=t;const a=new $t(s,r),o=t.minFilter;return t.minFilter===Dn&&(t.minFilter=kt),new $f(1,10,this).update(e,a),t.minFilter=o,a.geometry.dispose(),a.material.dispose(),this}clear(e,t,n,s){const r=e.getRenderTarget();for(let a=0;a<6;a++)e.setRenderTarget(this,a),e.clear(t,n,s);e.setRenderTarget(r)}}const C2=new F,jf=new F,e7=new Ye;class Vi{constructor(e=new F(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,n,s){return this.normal.set(e,t,n),this.constant=s,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,n){const s=C2.subVectors(n,t).cross(jf.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(s,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t){const n=e.delta(C2),s=this.normal.dot(n);if(0===s)return 0===this.distanceToPoint(e.start)?t.copy(e.start):null;const r=-(e.start.dot(this.normal)+this.constant)/s;return r<0||r>1?null:t.copy(e.start).addScaledVector(n,r)}intersectsLine(e){const t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const n=t||e7.getNormalMatrix(e),s=this.coplanarPoint(C2).applyMatrix4(e),r=this.normal.applyMatrix3(n).normalize();return this.constant=-s.dot(r),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return(new this.constructor).copy(this)}}const Wi=new v0,go=new F;class vo{constructor(e=new Vi,t=new Vi,n=new Vi,s=new Vi,r=new Vi,a=new Vi){this.planes=[e,t,n,s,r,a]}set(e,t,n,s,r,a){const o=this.planes;return o[0].copy(e),o[1].copy(t),o[2].copy(n),o[3].copy(s),o[4].copy(r),o[5].copy(a),this}copy(e){const t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e,t=On){const n=this.planes,s=e.elements,r=s[0],a=s[1],o=s[2],l=s[3],c=s[4],u=s[5],f=s[6],d=s[7],p=s[8],m=s[9],y=s[10],v=s[11],g=s[12],_=s[13],x=s[14],b=s[15];if(n[0].setComponents(l-r,d-c,v-p,b-g).normalize(),n[1].setComponents(l+r,d+c,v+p,b+g).normalize(),n[2].setComponents(l+a,d+u,v+m,b+_).normalize(),n[3].setComponents(l-a,d-u,v-m,b-_).normalize(),n[4].setComponents(l-o,d-f,v-y,b-x).normalize(),t===On)n[5].setComponents(l+o,d+f,v+y,b+x).normalize();else{if(2001!==t)throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);n[5].setComponents(o,f,y,x).normalize()}return this}intersectsObject(e){if(void 0!==e.boundingSphere)null===e.boundingSphere&&e.computeBoundingSphere(),Wi.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;null===t.boundingSphere&&t.computeBoundingSphere(),Wi.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(Wi)}intersectsSprite(e){return Wi.center.set(0,0,0),Wi.radius=.7071067811865476,Wi.applyMatrix4(e.matrixWorld),this.intersectsSphere(Wi)}intersectsSphere(e){const t=this.planes,n=e.center,s=-e.radius;for(let r=0;r<6;r++)if(t[r].distanceToPoint(n)<s)return!1;return!0}intersectsBox(e){const t=this.planes;for(let n=0;n<6;n++){const s=t[n];if(go.x=s.normal.x>0?e.max.x:e.min.x,go.y=s.normal.y>0?e.max.y:e.min.y,go.z=s.normal.z>0?e.max.z:e.min.z,s.distanceToPoint(go)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}clone(){return(new this.constructor).copy(this)}}function uc(){let i=null,e=!1,t=null,n=null;function s(r,a){t(r,a),n=i.requestAnimationFrame(s)}return{start:function(){!0!==e&&null!==t&&(n=i.requestAnimationFrame(s),e=!0)},stop:function(){i.cancelAnimationFrame(n),e=!1},setAnimationLoop:function(r){t=r},setContext:function(r){i=r}}}function t7(i,e){const t=e.isWebGL2,n=new WeakMap;return{get:function a(c){return c.isInterleavedBufferAttribute&&(c=c.data),n.get(c)},remove:function o(c){c.isInterleavedBufferAttribute&&(c=c.data);const u=n.get(c);u&&(i.deleteBuffer(u.buffer),n.delete(c))},update:function l(c,u){if(c.isGLBufferAttribute){const d=n.get(c);return void((!d||d.version<c.version)&&n.set(c,{buffer:c.buffer,type:c.type,bytesPerElement:c.elementSize,version:c.version}))}c.isInterleavedBufferAttribute&&(c=c.data);const f=n.get(c);if(void 0===f)n.set(c,function s(c,u){const f=c.array,d=c.usage,p=f.byteLength,m=i.createBuffer();let y;if(i.bindBuffer(u,m),i.bufferData(u,f,d),c.onUploadCallback(),f instanceof Float32Array)y=i.FLOAT;else if(f instanceof Uint16Array)if(c.isFloat16BufferAttribute){if(!t)throw new Error("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.");y=i.HALF_FLOAT}else y=i.UNSIGNED_SHORT;else if(f instanceof Int16Array)y=i.SHORT;else if(f instanceof Uint32Array)y=i.UNSIGNED_INT;else if(f instanceof Int32Array)y=i.INT;else if(f instanceof Int8Array)y=i.BYTE;else if(f instanceof Uint8Array)y=i.UNSIGNED_BYTE;else{if(!(f instanceof Uint8ClampedArray))throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+f);y=i.UNSIGNED_BYTE}return{buffer:m,type:y,bytesPerElement:f.BYTES_PER_ELEMENT,version:c.version,size:p}}(c,u));else if(f.version<c.version){if(f.size!==c.array.byteLength)throw new Error("THREE.WebGLAttributes: The size of the buffer attribute's array buffer does not match the original size. Resizing buffer attributes is not supported.");(function r(c,u,f){const d=u.array,p=u._updateRange,m=u.updateRanges;if(i.bindBuffer(f,c),-1===p.count&&0===m.length&&i.bufferSubData(f,0,d),0!==m.length){for(let y=0,v=m.length;y<v;y++){const g=m[y];t?i.bufferSubData(f,g.start*d.BYTES_PER_ELEMENT,d,g.start,g.count):i.bufferSubData(f,g.start*d.BYTES_PER_ELEMENT,d.subarray(g.start,g.start+g.count))}u.clearUpdateRanges()}-1!==p.count&&(t?i.bufferSubData(f,p.offset*d.BYTES_PER_ELEMENT,d,p.offset,p.count):i.bufferSubData(f,p.offset*d.BYTES_PER_ELEMENT,d.subarray(p.offset,p.offset+p.count)),p.count=-1),u.onUploadCallback()})(f.buffer,c,u),f.version=c.version}}}}class Nr extends ct{constructor(e=1,t=1,n=1,s=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:s};const r=e/2,a=t/2,o=Math.floor(n),l=Math.floor(s),c=o+1,u=l+1,f=e/o,d=t/l,p=[],m=[],y=[],v=[];for(let g=0;g<u;g++){const _=g*d-a;for(let x=0;x<c;x++)m.push(x*f-r,-_,0),y.push(0,0,1),v.push(x/o),v.push(1-g/l)}for(let g=0;g<l;g++)for(let _=0;_<o;_++){const b=_+c*(g+1),T=_+1+c*(g+1),E=_+1+c*g;p.push(_+c*g,b,E),p.push(b,T,E)}this.setIndex(p),this.setAttribute("position",new Ne(m,3)),this.setAttribute("normal",new Ne(y,3)),this.setAttribute("uv",new Ne(v,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Nr(e.width,e.height,e.widthSegments,e.heightSegments)}}const ht={alphahash_fragment:"#ifdef USE_ALPHAHASH\n\tif ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;\n#endif",alphahash_pars_fragment:"#ifdef USE_ALPHAHASH\n\tconst float ALPHA_HASH_SCALE = 0.05;\n\tfloat hash2D( vec2 value ) {\n\t\treturn fract( 1.0e4 * sin( 17.0 * value.x + 0.1 * value.y ) * ( 0.1 + abs( sin( 13.0 * value.y + value.x ) ) ) );\n\t}\n\tfloat hash3D( vec3 value ) {\n\t\treturn hash2D( vec2( hash2D( value.xy ), value.z ) );\n\t}\n\tfloat getAlphaHashThreshold( vec3 position ) {\n\t\tfloat maxDeriv = max(\n\t\t\tlength( dFdx( position.xyz ) ),\n\t\t\tlength( dFdy( position.xyz ) )\n\t\t);\n\t\tfloat pixScale = 1.0 / ( ALPHA_HASH_SCALE * maxDeriv );\n\t\tvec2 pixScales = vec2(\n\t\t\texp2( floor( log2( pixScale ) ) ),\n\t\t\texp2( ceil( log2( pixScale ) ) )\n\t\t);\n\t\tvec2 alpha = vec2(\n\t\t\thash3D( floor( pixScales.x * position.xyz ) ),\n\t\t\thash3D( floor( pixScales.y * position.xyz ) )\n\t\t);\n\t\tfloat lerpFactor = fract( log2( pixScale ) );\n\t\tfloat x = ( 1.0 - lerpFactor ) * alpha.x + lerpFactor * alpha.y;\n\t\tfloat a = min( lerpFactor, 1.0 - lerpFactor );\n\t\tvec3 cases = vec3(\n\t\t\tx * x / ( 2.0 * a * ( 1.0 - a ) ),\n\t\t\t( x - 0.5 * a ) / ( 1.0 - a ),\n\t\t\t1.0 - ( ( 1.0 - x ) * ( 1.0 - x ) / ( 2.0 * a * ( 1.0 - a ) ) )\n\t\t);\n\t\tfloat threshold = ( x < ( 1.0 - a ) )\n\t\t\t? ( ( x < a ) ? cases.x : cases.y )\n\t\t\t: cases.z;\n\t\treturn clamp( threshold , 1.0e-6, 1.0 );\n\t}\n#endif",alphamap_fragment:"#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;\n#endif",alphamap_pars_fragment:"#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",alphatest_fragment:"#ifdef USE_ALPHATEST\n\t#ifdef ALPHA_TO_COVERAGE\n\tdiffuseColor.a = smoothstep( alphaTest, alphaTest + fwidth( diffuseColor.a ), diffuseColor.a );\n\tif ( diffuseColor.a == 0.0 ) discard;\n\t#else\n\tif ( diffuseColor.a < alphaTest ) discard;\n\t#endif\n#endif",alphatest_pars_fragment:"#ifdef USE_ALPHATEST\n\tuniform float alphaTest;\n#endif",aomap_fragment:"#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_CLEARCOAT ) \n\t\tclearcoatSpecularIndirect *= ambientOcclusion;\n\t#endif\n\t#if defined( USE_SHEEN ) \n\t\tsheenSpecularIndirect *= ambientOcclusion;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD )\n\t\tfloat dotNV = saturate( dot( geometryNormal, geometryViewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );\n\t#endif\n#endif",aomap_pars_fragment:"#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",batching_pars_vertex:"#ifdef USE_BATCHING\n\tattribute float batchId;\n\tuniform highp sampler2D batchingTexture;\n\tmat4 getBatchingMatrix( const in float i ) {\n\t\tint size = textureSize( batchingTexture, 0 ).x;\n\t\tint j = int( i ) * 4;\n\t\tint x = j % size;\n\t\tint y = j / size;\n\t\tvec4 v1 = texelFetch( batchingTexture, ivec2( x, y ), 0 );\n\t\tvec4 v2 = texelFetch( batchingTexture, ivec2( x + 1, y ), 0 );\n\t\tvec4 v3 = texelFetch( batchingTexture, ivec2( x + 2, y ), 0 );\n\t\tvec4 v4 = texelFetch( batchingTexture, ivec2( x + 3, y ), 0 );\n\t\treturn mat4( v1, v2, v3, v4 );\n\t}\n#endif",batching_vertex:"#ifdef USE_BATCHING\n\tmat4 batchingMatrix = getBatchingMatrix( batchId );\n#endif",begin_vertex:"vec3 transformed = vec3( position );\n#ifdef USE_ALPHAHASH\n\tvPosition = vec3( position );\n#endif",beginnormal_vertex:"vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n\tvec3 objectTangent = vec3( tangent.xyz );\n#endif",bsdfs:"float G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, 1.0, dotVH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n} // validated",iridescence_fragment:"#ifdef USE_IRIDESCENCE\n\tconst mat3 XYZ_TO_REC709 = mat3(\n\t\t 3.2404542, -0.9692660, 0.0556434,\n\t\t-1.5371385, 1.8760108, -0.2040259,\n\t\t-0.4985314, 0.0415560, 1.0572252\n\t);\n\tvec3 Fresnel0ToIor( vec3 fresnel0 ) {\n\t\tvec3 sqrtF0 = sqrt( fresnel0 );\n\t\treturn ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );\n\t}\n\tvec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {\n\t\treturn pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );\n\t}\n\tfloat IorToFresnel0( float transmittedIor, float incidentIor ) {\n\t\treturn pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));\n\t}\n\tvec3 evalSensitivity( float OPD, vec3 shift ) {\n\t\tfloat phase = 2.0 * PI * OPD * 1.0e-9;\n\t\tvec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );\n\t\tvec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );\n\t\tvec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );\n\t\tvec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );\n\t\txyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) );\n\t\txyz /= 1.0685e-7;\n\t\tvec3 rgb = XYZ_TO_REC709 * xyz;\n\t\treturn rgb;\n\t}\n\tvec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {\n\t\tvec3 I;\n\t\tfloat iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );\n\t\tfloat sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );\n\t\tfloat cosTheta2Sq = 1.0 - sinTheta2Sq;\n\t\tif ( cosTheta2Sq < 0.0 ) {\n\t\t\treturn vec3( 1.0 );\n\t\t}\n\t\tfloat cosTheta2 = sqrt( cosTheta2Sq );\n\t\tfloat R0 = IorToFresnel0( iridescenceIOR, outsideIOR );\n\t\tfloat R12 = F_Schlick( R0, 1.0, cosTheta1 );\n\t\tfloat T121 = 1.0 - R12;\n\t\tfloat phi12 = 0.0;\n\t\tif ( iridescenceIOR < outsideIOR ) phi12 = PI;\n\t\tfloat phi21 = PI - phi12;\n\t\tvec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) );\t\tvec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );\n\t\tvec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );\n\t\tvec3 phi23 = vec3( 0.0 );\n\t\tif ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI;\n\t\tif ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI;\n\t\tif ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI;\n\t\tfloat OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;\n\t\tvec3 phi = vec3( phi21 ) + phi23;\n\t\tvec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );\n\t\tvec3 r123 = sqrt( R123 );\n\t\tvec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );\n\t\tvec3 C0 = R12 + Rs;\n\t\tI = C0;\n\t\tvec3 Cm = Rs - T121;\n\t\tfor ( int m = 1; m <= 2; ++ m ) {\n\t\t\tCm *= r123;\n\t\t\tvec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );\n\t\t\tI += Cm * Sm;\n\t\t}\n\t\treturn max( I, vec3( 0.0 ) );\n\t}\n#endif",bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vBumpMapUv );\n\t\tvec2 dSTdy = dFdy( vBumpMapUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vBumpMapUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {\n\t\tvec3 vSigmaX = normalize( dFdx( surf_pos.xyz ) );\n\t\tvec3 vSigmaY = normalize( dFdy( surf_pos.xyz ) );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 ) * faceDirection;\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#ifdef ALPHA_TO_COVERAGE\n\t\tfloat distanceToPlane, distanceGradient;\n\t\tfloat clipOpacity = 1.0;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tdistanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;\n\t\t\tdistanceGradient = fwidth( distanceToPlane ) / 2.0;\n\t\t\tclipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane );\n\t\t\tif ( clipOpacity == 0.0 ) discard;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\t\tfloat unionClipOpacity = 1.0;\n\t\t\t#pragma unroll_loop_start\n\t\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\t\tplane = clippingPlanes[ i ];\n\t\t\t\tdistanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;\n\t\t\t\tdistanceGradient = fwidth( distanceToPlane ) / 2.0;\n\t\t\t\tunionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane );\n\t\t\t}\n\t\t\t#pragma unroll_loop_end\n\t\t\tclipOpacity *= 1.0 - unionClipOpacity;\n\t\t#endif\n\t\tdiffuseColor.a *= clipOpacity;\n\t\tif ( diffuseColor.a == 0.0 ) discard;\n\t#else\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\t\tbool clipped = true;\n\t\t\t#pragma unroll_loop_start\n\t\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\t\tplane = clippingPlanes[ i ];\n\t\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t\t}\n\t\t\t#pragma unroll_loop_end\n\t\t\tif ( clipped ) discard;\n\t\t#endif\n\t#endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - mvPosition.xyz;\n#endif",color_fragment:"#if defined( USE_COLOR_ALPHA )\n\tdiffuseColor *= vColor;\n#elif defined( USE_COLOR )\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR )\n\tvarying vec3 vColor;\n#endif",color_pars_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvarying vec3 vColor;\n#endif",color_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvColor = vec4( 1.0 );\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n\tvColor *= color;\n#endif\n#ifdef USE_INSTANCING_COLOR\n\tvColor.xyz *= instanceColor.xyz;\n#endif",common:"#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nvec3 pow2( const in vec3 x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\nfloat average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract( sin( sn ) * c );\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\n#ifdef USE_ALPHAHASH\n\tvarying vec3 vPosition;\n#endif\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat luminance( const in vec3 rgb ) {\n\tconst vec3 weights = vec3( 0.2126729, 0.7151522, 0.0721750 );\n\treturn dot( weights, rgb );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n\treturn m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}\nvec3 BRDF_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\nfloat F_Schlick( const in float f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n} // validated",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_minTileSize 16.0\n\tfloat getFace( vec3 direction ) {\n\t\tvec3 absDirection = abs( direction );\n\t\tfloat face = - 1.0;\n\t\tif ( absDirection.x > absDirection.z ) {\n\t\t\tif ( absDirection.x > absDirection.y )\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t} else {\n\t\t\tif ( absDirection.z > absDirection.y )\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t}\n\t\treturn face;\n\t}\n\tvec2 getUV( vec3 direction, float face ) {\n\t\tvec2 uv;\n\t\tif ( face == 0.0 ) {\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 1.0 ) {\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n\t\t} else if ( face == 2.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\n\t\t} else if ( face == 3.0 ) {\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 4.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\n\t\t} else {\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\n\t\t}\n\t\treturn 0.5 * ( uv + 1.0 );\n\t}\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\t\tfloat face = getFace( direction );\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\t\tfloat faceSize = exp2( mipInt );\n\t\thighp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;\n\t\tif ( face > 2.0 ) {\n\t\t\tuv.y += faceSize;\n\t\t\tface -= 3.0;\n\t\t}\n\t\tuv.x += face * faceSize;\n\t\tuv.x += filterInt * 3.0 * cubeUV_minTileSize;\n\t\tuv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );\n\t\tuv.x *= CUBEUV_TEXEL_WIDTH;\n\t\tuv.y *= CUBEUV_TEXEL_HEIGHT;\n\t\t#ifdef texture2DGradEXT\n\t\t\treturn texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;\n\t\t#else\n\t\t\treturn texture2D( envMap, uv ).rgb;\n\t\t#endif\n\t}\n\t#define cubeUV_r0 1.0\n\t#define cubeUV_m0 - 2.0\n\t#define cubeUV_r1 0.8\n\t#define cubeUV_m1 - 1.0\n\t#define cubeUV_r4 0.4\n\t#define cubeUV_m4 2.0\n\t#define cubeUV_r5 0.305\n\t#define cubeUV_m5 3.0\n\t#define cubeUV_r6 0.21\n\t#define cubeUV_m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= cubeUV_r1 ) {\n\t\t\tmip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;\n\t\t} else if ( roughness >= cubeUV_r4 ) {\n\t\t\tmip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;\n\t\t} else if ( roughness >= cubeUV_r5 ) {\n\t\t\tmip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;\n\t\t} else if ( roughness >= cubeUV_r6 ) {\n\t\t\tmip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;\n\t\t} else {\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness );\t\t}\n\t\treturn mip;\n\t}\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\t\tfloat mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );\n\t\tfloat mipF = fract( mip );\n\t\tfloat mipInt = floor( mip );\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\t\tif ( mipF == 0.0 ) {\n\t\t\treturn vec4( color0, 1.0 );\n\t\t} else {\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\t\t}\n\t}\n#endif",defaultnormal_vertex:"vec3 transformedNormal = objectNormal;\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = objectTangent;\n#endif\n#ifdef USE_BATCHING\n\tmat3 bm = mat3( batchingMatrix );\n\ttransformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) );\n\ttransformedNormal = bm * transformedNormal;\n\t#ifdef USE_TANGENT\n\t\ttransformedTangent = bm * transformedTangent;\n\t#endif\n#endif\n#ifdef USE_INSTANCING\n\tmat3 im = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) );\n\ttransformedNormal = im * transformedNormal;\n\t#ifdef USE_TANGENT\n\t\ttransformedTangent = im * transformedTangent;\n\t#endif\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\ttransformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",colorspace_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",colorspace_pars_fragment:"\nconst mat3 LINEAR_SRGB_TO_LINEAR_DISPLAY_P3 = mat3(\n\tvec3( 0.8224621, 0.177538, 0.0 ),\n\tvec3( 0.0331941, 0.9668058, 0.0 ),\n\tvec3( 0.0170827, 0.0723974, 0.9105199 )\n);\nconst mat3 LINEAR_DISPLAY_P3_TO_LINEAR_SRGB = mat3(\n\tvec3( 1.2249401, - 0.2249404, 0.0 ),\n\tvec3( - 0.0420569, 1.0420571, 0.0 ),\n\tvec3( - 0.0196376, - 0.0786361, 1.0982735 )\n);\nvec4 LinearSRGBToLinearDisplayP3( in vec4 value ) {\n\treturn vec4( value.rgb * LINEAR_SRGB_TO_LINEAR_DISPLAY_P3, value.a );\n}\nvec4 LinearDisplayP3ToLinearSRGB( in vec4 value ) {\n\treturn vec4( value.rgb * LINEAR_DISPLAY_P3_TO_LINEAR_SRGB, value.a );\n}\nvec4 LinearTransferOETF( in vec4 value ) {\n\treturn value;\n}\nvec4 sRGBTransferOETF( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn sRGBTransferOETF( value );\n}",envmap_fragment:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif",envmap_common_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif",envmap_physical_pars_fragment:"#ifdef USE_ENVMAP\n\tvec3 getIBLIrradiance( const in vec3 normal ) {\n\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\n\t\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\tvec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\n\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\tvec3 reflectVec = reflect( - viewDir, normal );\n\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n\t\t\treturn envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\t#ifdef USE_ANISOTROPY\n\t\tvec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) {\n\t\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\t\tvec3 bentNormal = cross( bitangent, viewDir );\n\t\t\t\tbentNormal = normalize( cross( bentNormal, bitangent ) );\n\t\t\t\tbentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) );\n\t\t\t\treturn getIBLRadiance( viewDir, bentNormal, roughness );\n\t\t\t#else\n\t\t\t\treturn vec3( 0.0 );\n\t\t\t#endif\n\t\t}\n\t#endif\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif",fog_vertex:"#ifdef USE_FOG\n\tvFogDepth = - mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float vFogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, vFogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float vFogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",gradientmap_pars_fragment:"#ifdef USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn vec3( texture2D( gradientMap, coord ).r );\n\t#else\n\t\tvec2 fw = fwidth( coord ) * 0.5;\n\t\treturn mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );\n\t#endif\n}",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\treflectedLight.indirectDiffuse += lightMapIrradiance;\n#endif",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_fragment:"LambertMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularStrength = specularStrength;",lights_lambert_pars_fragment:"varying vec3 vViewPosition;\nstruct LambertMaterial {\n\tvec3 diffuseColor;\n\tfloat specularStrength;\n};\nvoid RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Lambert\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Lambert",lights_pars_begin:"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\n#if defined( USE_LIGHT_PROBES )\n\tuniform vec3 lightProbe[ 9 ];\n#endif\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {\n\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\treturn irradiance;\n}\nfloat getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\t#if defined ( LEGACY_LIGHTS )\n\t\tif ( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\t\treturn pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t\t}\n\t\treturn 1.0;\n\t#else\n\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\t\tif ( cutoffDistance > 0.0 ) {\n\t\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t\t}\n\t\treturn distanceFalloff;\n\t#endif\n}\nfloat getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {\n\treturn smoothstep( coneCosine, penumbraCosine, angleCosine );\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) {\n\t\tlight.color = directionalLight.color;\n\t\tlight.direction = directionalLight.direction;\n\t\tlight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) {\n\t\tvec3 lVector = pointLight.position - geometryPosition;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tlight.color = pointLight.color;\n\t\tlight.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );\n\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) {\n\t\tvec3 lVector = spotLight.position - geometryPosition;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat angleCos = dot( light.direction, spotLight.direction );\n\t\tfloat spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\tif ( spotAttenuation > 0.0 ) {\n\t\t\tfloat lightDistance = length( lVector );\n\t\t\tlight.color = spotLight.color * spotAttenuation;\n\t\t\tlight.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t\t} else {\n\t\t\tlight.color = vec3( 0.0 );\n\t\t\tlight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {\n\t\tfloat dotNL = dot( normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\treturn irradiance;\n\t}\n#endif",lights_toon_fragment:"ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;",lights_toon_pars_fragment:"varying vec3 vViewPosition;\nstruct ToonMaterial {\n\tvec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_phong_pars_fragment:"varying vec3 vViewPosition;\nstruct BlinnPhongMaterial {\n\tvec3 diffuseColor;\n\tvec3 specularColor;\n\tfloat specularShininess;\n\tfloat specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;\nmaterial.roughness = min( material.roughness, 1.0 );\n#ifdef IOR\n\tmaterial.ior = ior;\n\t#ifdef USE_SPECULAR\n\t\tfloat specularIntensityFactor = specularIntensity;\n\t\tvec3 specularColorFactor = specularColor;\n\t\t#ifdef USE_SPECULAR_COLORMAP\n\t\t\tspecularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb;\n\t\t#endif\n\t\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\t\tspecularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a;\n\t\t#endif\n\t\tmaterial.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );\n\t#else\n\t\tfloat specularIntensityFactor = 1.0;\n\t\tvec3 specularColorFactor = vec3( 1.0 );\n\t\tmaterial.specularF90 = 1.0;\n\t#endif\n\tmaterial.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n\tmaterial.specularF90 = 1.0;\n#endif\n#ifdef USE_CLEARCOAT\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\tmaterial.clearcoatF0 = vec3( 0.04 );\n\tmaterial.clearcoatF90 = 1.0;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y;\n\t#endif\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_IRIDESCENCE\n\tmaterial.iridescence = iridescence;\n\tmaterial.iridescenceIOR = iridescenceIOR;\n\t#ifdef USE_IRIDESCENCEMAP\n\t\tmaterial.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r;\n\t#endif\n\t#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\t\tmaterial.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum;\n\t#else\n\t\tmaterial.iridescenceThickness = iridescenceThicknessMaximum;\n\t#endif\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheenColor;\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tmaterial.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb;\n\t#endif\n\tmaterial.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tmaterial.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a;\n\t#endif\n#endif\n#ifdef USE_ANISOTROPY\n\t#ifdef USE_ANISOTROPYMAP\n\t\tmat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x );\n\t\tvec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb;\n\t\tvec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b;\n\t#else\n\t\tvec2 anisotropyV = anisotropyVector;\n\t#endif\n\tmaterial.anisotropy = length( anisotropyV );\n\tif( material.anisotropy == 0.0 ) {\n\t\tanisotropyV = vec2( 1.0, 0.0 );\n\t} else {\n\t\tanisotropyV /= material.anisotropy;\n\t\tmaterial.anisotropy = saturate( material.anisotropy );\n\t}\n\tmaterial.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );\n\tmaterial.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y;\n\tmaterial.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y;\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat roughness;\n\tvec3 specularColor;\n\tfloat specularF90;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat clearcoat;\n\t\tfloat clearcoatRoughness;\n\t\tvec3 clearcoatF0;\n\t\tfloat clearcoatF90;\n\t#endif\n\t#ifdef USE_IRIDESCENCE\n\t\tfloat iridescence;\n\t\tfloat iridescenceIOR;\n\t\tfloat iridescenceThickness;\n\t\tvec3 iridescenceFresnel;\n\t\tvec3 iridescenceF0;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tvec3 sheenColor;\n\t\tfloat sheenRoughness;\n\t#endif\n\t#ifdef IOR\n\t\tfloat ior;\n\t#endif\n\t#ifdef USE_TRANSMISSION\n\t\tfloat transmission;\n\t\tfloat transmissionAlpha;\n\t\tfloat thickness;\n\t\tfloat attenuationDistance;\n\t\tvec3 attenuationColor;\n\t#endif\n\t#ifdef USE_ANISOTROPY\n\t\tfloat anisotropy;\n\t\tfloat alphaT;\n\t\tvec3 anisotropyT;\n\t\tvec3 anisotropyB;\n\t#endif\n};\nvec3 clearcoatSpecularDirect = vec3( 0.0 );\nvec3 clearcoatSpecularIndirect = vec3( 0.0 );\nvec3 sheenSpecularDirect = vec3( 0.0 );\nvec3 sheenSpecularIndirect = vec3(0.0 );\nvec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {\n float x = clamp( 1.0 - dotVH, 0.0, 1.0 );\n float x2 = x * x;\n float x5 = clamp( x * x2 * x2, 0.0, 0.9999 );\n return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );\n}\nfloat V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\n#ifdef USE_ANISOTROPY\n\tfloat V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) {\n\t\tfloat gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) );\n\t\tfloat gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) );\n\t\tfloat v = 0.5 / ( gv + gl );\n\t\treturn saturate(v);\n\t}\n\tfloat D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) {\n\t\tfloat a2 = alphaT * alphaB;\n\t\thighp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH );\n\t\thighp float v2 = dot( v, v );\n\t\tfloat w2 = a2 / v2;\n\t\treturn RECIPROCAL_PI * a2 * pow2 ( w2 );\n\t}\n#endif\n#ifdef USE_CLEARCOAT\n\tvec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) {\n\t\tvec3 f0 = material.clearcoatF0;\n\t\tfloat f90 = material.clearcoatF90;\n\t\tfloat roughness = material.clearcoatRoughness;\n\t\tfloat alpha = pow2( roughness );\n\t\tvec3 halfDir = normalize( lightDir + viewDir );\n\t\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\t\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\t\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\t\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\t\tvec3 F = F_Schlick( f0, f90, dotVH );\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\t\tfloat D = D_GGX( alpha, dotNH );\n\t\treturn F * ( V * D );\n\t}\n#endif\nvec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {\n\tvec3 f0 = material.specularColor;\n\tfloat f90 = material.specularF90;\n\tfloat roughness = material.roughness;\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( f0, f90, dotVH );\n\t#ifdef USE_IRIDESCENCE\n\t\tF = mix( F, material.iridescenceFresnel, material.iridescence );\n\t#endif\n\t#ifdef USE_ANISOTROPY\n\t\tfloat dotTL = dot( material.anisotropyT, lightDir );\n\t\tfloat dotTV = dot( material.anisotropyT, viewDir );\n\t\tfloat dotTH = dot( material.anisotropyT, halfDir );\n\t\tfloat dotBL = dot( material.anisotropyB, lightDir );\n\t\tfloat dotBV = dot( material.anisotropyB, viewDir );\n\t\tfloat dotBH = dot( material.anisotropyB, halfDir );\n\t\tfloat V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL );\n\t\tfloat D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH );\n\t#else\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\t\tfloat D = D_GGX( alpha, dotNH );\n\t#endif\n\treturn F * ( V * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie( float roughness, float dotNH ) {\n\tfloat alpha = pow2( roughness );\n\tfloat invAlpha = 1.0 / alpha;\n\tfloat cos2h = dotNH * dotNH;\n\tfloat sin2h = max( 1.0 - cos2h, 0.0078125 );\n\treturn ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );\n}\nfloat V_Neubelt( float dotNV, float dotNL ) {\n\treturn saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );\n}\nvec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat D = D_Charlie( sheenRoughness, dotNH );\n\tfloat V = V_Neubelt( dotNV, dotNL );\n\treturn sheenColor * ( D * V );\n}\n#endif\nfloat IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat r2 = roughness * roughness;\n\tfloat a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95;\n\tfloat b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72;\n\tfloat DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) );\n\treturn saturate( DG * RECIPROCAL_PI );\n}\nvec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\tvec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;\n\treturn fab;\n}\nvec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\treturn specularColor * fab.x + specularF90 * fab.y;\n}\n#ifdef USE_IRIDESCENCE\nvoid computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#else\nvoid computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#endif\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\t#ifdef USE_IRIDESCENCE\n\t\tvec3 Fr = mix( specularColor, iridescenceF0, iridescence );\n\t#else\n\t\tvec3 Fr = specularColor;\n\t#endif\n\tvec3 FssEss = Fr * fab.x + specularF90 * fab.y;\n\tfloat Ess = fab.x + fab.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometryNormal;\n\t\tvec3 viewDir = geometryViewDir;\n\t\tvec3 position = geometryPosition;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.roughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3( 0, 1, 0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = dotNLcc * directLight.color;\n\t\tclearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness );\n\t#endif\n\treflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material );\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );\n\t#endif\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\t#ifdef USE_IRIDESCENCE\n\t\tcomputeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );\n\t#else\n\t\tcomputeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\n\t#endif\n\tvec3 totalScattering = singleScattering + multiScattering;\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) );\n\treflectedLight.indirectSpecular += radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",lights_fragment_begin:"\nvec3 geometryPosition = - vViewPosition;\nvec3 geometryNormal = normal;\nvec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\nvec3 geometryClearcoatNormal = vec3( 0.0 );\n#ifdef USE_CLEARCOAT\n\tgeometryClearcoatNormal = clearcoatNormal;\n#endif\n#ifdef USE_IRIDESCENCE\n\tfloat dotNVi = saturate( dot( normal, geometryViewDir ) );\n\tif ( material.iridescenceThickness == 0.0 ) {\n\t\tmaterial.iridescence = 0.0;\n\t} else {\n\t\tmaterial.iridescence = saturate( material.iridescence );\n\t}\n\tif ( material.iridescence > 0.0 ) {\n\t\tmaterial.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );\n\t\tmaterial.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );\n\t}\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointLightInfo( pointLight, geometryPosition, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\tvec4 spotColor;\n\tvec3 spotLightCoord;\n\tbool inSpotLightMap;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotLightInfo( spotLight, geometryPosition, directLight );\n\t\t#if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX\n\t\t#elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t#define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS\n\t\t#else\n\t\t#define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#endif\n\t\t#if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )\n\t\t\tspotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;\n\t\t\tinSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );\n\t\t\tspotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );\n\t\t\tdirectLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;\n\t\t#endif\n\t\t#undef SPOT_LIGHT_MAP_INDEX\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalLightInfo( directionalLight, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\t#if defined( USE_LIGHT_PROBES )\n\t\tirradiance += getLightProbeIrradiance( lightProbe, geometryNormal );\n\t#endif\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal );\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\t\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getIBLIrradiance( geometryNormal );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\t#ifdef USE_ANISOTROPY\n\t\tradiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy );\n\t#else\n\t\tradiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness );\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness );\n\t#endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t\tvarying float vIsPerspective;\n\t#else\n\t\tuniform float logDepthBufFC;\n\t#endif\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\t#else\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\t\tgl_Position.z *= gl_Position.w;\n\t\t}\n\t#endif\n#endif",map_fragment:"#ifdef USE_MAP\n\tvec4 sampledDiffuseColor = texture2D( map, vMapUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\tsampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w );\n\t\n\t#endif\n\tdiffuseColor *= sampledDiffuseColor;\n#endif",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",map_particle_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\t#if defined( USE_POINTS_UV )\n\t\tvec2 uv = vUv;\n\t#else\n\t\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n\t#endif\n#endif\n#ifdef USE_MAP\n\tdiffuseColor *= texture2D( map, uv );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",map_particle_pars_fragment:"#if defined( USE_POINTS_UV )\n\tvarying vec2 vUv;\n#else\n\t#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\t\tuniform mat3 uvTransform;\n\t#endif\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphcolor_vertex:"#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE )\n\tvColor *= morphTargetBaseInfluence;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t#if defined( USE_COLOR_ALPHA )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];\n\t\t#elif defined( USE_COLOR )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];\n\t\t#endif\n\t}\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];\n\t\t}\n\t#else\n\t\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\t\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\t\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\t\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n\t#endif\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\tuniform float morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tuniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\t\tuniform sampler2DArray morphTargetsTexture;\n\t\tuniform ivec2 morphTargetsTextureSize;\n\t\tvec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {\n\t\t\tint texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;\n\t\t\tint y = texelIndex / morphTargetsTextureSize.x;\n\t\t\tint x = texelIndex - y * morphTargetsTextureSize.x;\n\t\t\tivec3 morphUV = ivec3( x, y, morphTargetIndex );\n\t\t\treturn texelFetch( morphTargetsTexture, morphUV, 0 );\n\t\t}\n\t#else\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\tuniform float morphTargetInfluences[ 8 ];\n\t\t#else\n\t\t\tuniform float morphTargetInfluences[ 4 ];\n\t\t#endif\n\t#endif\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];\n\t\t}\n\t#else\n\t\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\t\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\t\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\t\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\t\t\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\t\t\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\t\t\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\t\t#endif\n\t#endif\n#endif",normal_fragment_begin:"float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#ifdef FLAT_SHADED\n\tvec3 fdx = dFdx( vViewPosition );\n\tvec3 fdy = dFdy( vViewPosition );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal *= faceDirection;\n\t#endif\n#endif\n#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY )\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn = getTangentFrame( - vViewPosition, normal,\n\t\t#if defined( USE_NORMALMAP )\n\t\t\tvNormalMapUv\n\t\t#elif defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tvClearcoatNormalMapUv\n\t\t#else\n\t\t\tvUv\n\t\t#endif\n\t\t);\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn[0] *= faceDirection;\n\t\ttbn[1] *= faceDirection;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn2[0] *= faceDirection;\n\t\ttbn2[1] *= faceDirection;\n\t#endif\n#endif\nvec3 nonPerturbedNormal = normal;",normal_fragment_maps:"#ifdef USE_NORMALMAP_OBJECTSPACE\n\tnormal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * faceDirection;\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( USE_NORMALMAP_TANGENTSPACE )\n\tvec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\tnormal = normalize( tbn * mapN );\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\n#endif",normal_pars_fragment:"#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif",normal_pars_vertex:"#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif",normal_vertex:"#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef USE_NORMALMAP_OBJECTSPACE\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) )\n\tmat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) {\n\t\tvec3 q0 = dFdx( eye_pos.xyz );\n\t\tvec3 q1 = dFdy( eye_pos.xyz );\n\t\tvec2 st0 = dFdx( uv.st );\n\t\tvec2 st1 = dFdy( uv.st );\n\t\tvec3 N = surf_norm;\n\t\tvec3 q1perp = cross( q1, N );\n\t\tvec3 q0perp = cross( N, q0 );\n\t\tvec3 T = q1perp * st0.x + q0perp * st1.x;\n\t\tvec3 B = q1perp * st0.y + q0perp * st1.y;\n\t\tfloat det = max( dot( T, T ), dot( B, B ) );\n\t\tfloat scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det );\n\t\treturn mat3( T * scale, B * scale, N );\n\t}\n#endif",clearcoat_normal_fragment_begin:"#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal = nonPerturbedNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\tclearcoatNormal = normalize( tbn2 * clearcoatMapN );\n#endif",clearcoat_pars_fragment:"#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif",iridescence_pars_fragment:"#ifdef USE_IRIDESCENCEMAP\n\tuniform sampler2D iridescenceMap;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform sampler2D iridescenceThicknessMap;\n#endif",opaque_fragment:"#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= material.transmissionAlpha;\n#endif\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nvec2 packDepthToRG( in highp float v ) {\n\treturn packDepthToRGBA( v ).yx;\n}\nfloat unpackRGToDepth( const in highp vec2 v ) {\n\treturn unpackRGBAToDepth( vec4( v.xy, 0.0, 0.0 ) );\n}\nvec4 pack2HalfToRGBA( vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );\n}\nvec2 unpackRGBATo2Half( vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) {\n\treturn depth * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * depth - far );\n}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_BATCHING\n\tmvPosition = batchingMatrix * mvPosition;\n#endif\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#ifdef DITHERING\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#if NUM_SPOT_LIGHT_COORDS > 0\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#if NUM_SPOT_LIGHT_MAPS > 0\n\tuniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];\n#endif\n#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;\n\t\tbool frustumTest = inFrustum && shadowCoord.z <= 1.0;\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif",shadowmap_pars_vertex:"#if NUM_SPOT_LIGHT_COORDS > 0\n\tuniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif",shadowmap_vertex:"#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )\n\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\tvec4 shadowWorldPosition;\n#endif\n#if defined( USE_SHADOWMAP )\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if NUM_SPOT_LIGHT_COORDS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition;\n\t\t#if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t\tshadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias;\n\t\t#endif\n\t\tvSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n#endif",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#endif\n\treturn shadow;\n}",skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\tuniform highp sampler2D boneTexture;\n\tmat4 getBoneMatrix( const in float i ) {\n\t\tint size = textureSize( boneTexture, 0 ).x;\n\t\tint j = int( i ) * 4;\n\t\tint x = j % size;\n\t\tint y = j / size;\n\t\tvec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 );\n\t\tvec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 );\n\t\tvec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 );\n\t\tvec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 );\n\t\treturn mat4( v1, v2, v3, v4 );\n\t}\n#endif",skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn saturate( toneMappingExposure * color );\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n\treturn a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tconst mat3 ACESInputMat = mat3(\n\t\tvec3( 0.59719, 0.07600, 0.02840 ),\t\tvec3( 0.35458, 0.90834, 0.13383 ),\n\t\tvec3( 0.04823, 0.01566, 0.83777 )\n\t);\n\tconst mat3 ACESOutputMat = mat3(\n\t\tvec3( 1.60475, -0.10208, -0.00327 ),\t\tvec3( -0.53108, 1.10813, -0.07276 ),\n\t\tvec3( -0.07367, -0.00605, 1.07602 )\n\t);\n\tcolor *= toneMappingExposure / 0.6;\n\tcolor = ACESInputMat * color;\n\tcolor = RRTAndODTFit( color );\n\tcolor = ACESOutputMat * color;\n\treturn saturate( color );\n}\nconst mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3(\n\tvec3( 1.6605, - 0.1246, - 0.0182 ),\n\tvec3( - 0.5876, 1.1329, - 0.1006 ),\n\tvec3( - 0.0728, - 0.0083, 1.1187 )\n);\nconst mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3(\n\tvec3( 0.6274, 0.0691, 0.0164 ),\n\tvec3( 0.3293, 0.9195, 0.0880 ),\n\tvec3( 0.0433, 0.0113, 0.8956 )\n);\nvec3 agxDefaultContrastApprox( vec3 x ) {\n\tvec3 x2 = x * x;\n\tvec3 x4 = x2 * x2;\n\treturn + 15.5 * x4 * x2\n\t\t- 40.14 * x4 * x\n\t\t+ 31.96 * x4\n\t\t- 6.868 * x2 * x\n\t\t+ 0.4298 * x2\n\t\t+ 0.1191 * x\n\t\t- 0.00232;\n}\nvec3 AgXToneMapping( vec3 color ) {\n\tconst mat3 AgXInsetMatrix = mat3(\n\t\tvec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ),\n\t\tvec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ),\n\t\tvec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 )\n\t);\n\tconst mat3 AgXOutsetMatrix = mat3(\n\t\tvec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ),\n\t\tvec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ),\n\t\tvec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 )\n\t);\n\tconst float AgxMinEv = - 12.47393;\tconst float AgxMaxEv = 4.026069;\n\tcolor *= toneMappingExposure;\n\tcolor = LINEAR_SRGB_TO_LINEAR_REC2020 * color;\n\tcolor = AgXInsetMatrix * color;\n\tcolor = max( color, 1e-10 );\tcolor = log2( color );\n\tcolor = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv );\n\tcolor = clamp( color, 0.0, 1.0 );\n\tcolor = agxDefaultContrastApprox( color );\n\tcolor = AgXOutsetMatrix * color;\n\tcolor = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) );\n\tcolor = LINEAR_REC2020_TO_LINEAR_SRGB * color;\n\tcolor = clamp( color, 0.0, 1.0 );\n\treturn color;\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }",transmission_fragment:"#ifdef USE_TRANSMISSION\n\tmaterial.transmission = transmission;\n\tmaterial.transmissionAlpha = 1.0;\n\tmaterial.thickness = thickness;\n\tmaterial.attenuationDistance = attenuationDistance;\n\tmaterial.attenuationColor = attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tmaterial.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tmaterial.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g;\n\t#endif\n\tvec3 pos = vWorldPosition;\n\tvec3 v = normalize( cameraPosition - pos );\n\tvec3 n = inverseTransformDirection( normal, viewMatrix );\n\tvec4 transmitted = getIBLVolumeRefraction(\n\t\tn, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90,\n\t\tpos, modelMatrix, viewMatrix, projectionMatrix, material.ior, material.thickness,\n\t\tmaterial.attenuationColor, material.attenuationDistance );\n\tmaterial.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission );\n\ttotalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );\n#endif",transmission_pars_fragment:"#ifdef USE_TRANSMISSION\n\tuniform float transmission;\n\tuniform float thickness;\n\tuniform float attenuationDistance;\n\tuniform vec3 attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tuniform sampler2D transmissionMap;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tuniform sampler2D thicknessMap;\n\t#endif\n\tuniform vec2 transmissionSamplerSize;\n\tuniform sampler2D transmissionSamplerMap;\n\tuniform mat4 modelMatrix;\n\tuniform mat4 projectionMatrix;\n\tvarying vec3 vWorldPosition;\n\tfloat w0( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 );\n\t}\n\tfloat w1( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 );\n\t}\n\tfloat w2( float a ){\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 );\n\t}\n\tfloat w3( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * a );\n\t}\n\tfloat g0( float a ) {\n\t\treturn w0( a ) + w1( a );\n\t}\n\tfloat g1( float a ) {\n\t\treturn w2( a ) + w3( a );\n\t}\n\tfloat h0( float a ) {\n\t\treturn - 1.0 + w1( a ) / ( w0( a ) + w1( a ) );\n\t}\n\tfloat h1( float a ) {\n\t\treturn 1.0 + w3( a ) / ( w2( a ) + w3( a ) );\n\t}\n\tvec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) {\n\t\tuv = uv * texelSize.zw + 0.5;\n\t\tvec2 iuv = floor( uv );\n\t\tvec2 fuv = fract( uv );\n\t\tfloat g0x = g0( fuv.x );\n\t\tfloat g1x = g1( fuv.x );\n\t\tfloat h0x = h0( fuv.x );\n\t\tfloat h1x = h1( fuv.x );\n\t\tfloat h0y = h0( fuv.y );\n\t\tfloat h1y = h1( fuv.y );\n\t\tvec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\t\treturn g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) +\n\t\t\tg1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) );\n\t}\n\tvec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) {\n\t\tvec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) );\n\t\tvec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) );\n\t\tvec2 fLodSizeInv = 1.0 / fLodSize;\n\t\tvec2 cLodSizeInv = 1.0 / cLodSize;\n\t\tvec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) );\n\t\tvec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) );\n\t\treturn mix( fSample, cSample, fract( lod ) );\n\t}\n\tvec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {\n\t\tvec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );\n\t\tvec3 modelScale;\n\t\tmodelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );\n\t\tmodelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );\n\t\tmodelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );\n\t\treturn normalize( refractionVector ) * thickness * modelScale;\n\t}\n\tfloat applyIorToRoughness( const in float roughness, const in float ior ) {\n\t\treturn roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\n\t}\n\tvec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {\n\t\tfloat lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n\t\treturn textureBicubic( transmissionSamplerMap, fragCoord.xy, lod );\n\t}\n\tvec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tif ( isinf( attenuationDistance ) ) {\n\t\t\treturn vec3( 1.0 );\n\t\t} else {\n\t\t\tvec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n\t\t\tvec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );\t\t\treturn transmittance;\n\t\t}\n\t}\n\tvec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,\n\t\tconst in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,\n\t\tconst in mat4 viewMatrix, const in mat4 projMatrix, const in float ior, const in float thickness,\n\t\tconst in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\trefractionCoords += 1.0;\n\t\trefractionCoords /= 2.0;\n\t\tvec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n\t\tvec3 transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance );\n\t\tvec3 attenuatedColor = transmittance * transmittedLight.rgb;\n\t\tvec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n\t\tfloat transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0;\n\t\treturn vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor );\n\t}\n#endif",uv_pars_fragment:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tvarying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif",uv_pars_vertex:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tuniform mat3 mapTransform;\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform mat3 alphaMapTransform;\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tuniform mat3 lightMapTransform;\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tuniform mat3 aoMapTransform;\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tuniform mat3 bumpMapTransform;\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tuniform mat3 normalMapTransform;\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tuniform mat3 displacementMapTransform;\n\tvarying vec2 vDisplacementMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tuniform mat3 emissiveMapTransform;\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tuniform mat3 metalnessMapTransform;\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tuniform mat3 roughnessMapTransform;\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tuniform mat3 anisotropyMapTransform;\n\tvarying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tuniform mat3 clearcoatMapTransform;\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform mat3 clearcoatNormalMapTransform;\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform mat3 clearcoatRoughnessMapTransform;\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tuniform mat3 sheenColorMapTransform;\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tuniform mat3 sheenRoughnessMapTransform;\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tuniform mat3 iridescenceMapTransform;\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform mat3 iridescenceThicknessMapTransform;\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tuniform mat3 specularMapTransform;\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tuniform mat3 specularColorMapTransform;\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tuniform mat3 specularIntensityMapTransform;\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif",uv_vertex:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvUv = vec3( uv, 1 ).xy;\n#endif\n#ifdef USE_MAP\n\tvMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ALPHAMAP\n\tvAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_LIGHTMAP\n\tvLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_AOMAP\n\tvAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_BUMPMAP\n\tvBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_NORMALMAP\n\tvNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tvDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_METALNESSMAP\n\tvMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tvAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULARMAP\n\tvSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tvTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_THICKNESSMAP\n\tvThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_BATCHING\n\t\tworldPosition = batchingMatrix * worldPosition;\n\t#endif\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif",background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}",background_frag:"uniform sampler2D t2D;\nuniform float backgroundIntensity;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\ttexColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}",backgroundCube_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}",backgroundCube_frag:"#ifdef ENVMAP_TYPE_CUBE\n\tuniform samplerCube envMap;\n#elif defined( ENVMAP_TYPE_CUBE_UV )\n\tuniform sampler2D envMap;\n#endif\nuniform float flipEnvMap;\nuniform float backgroundBlurriness;\nuniform float backgroundIntensity;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 texColor = textureCube( envMap, vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 texColor = textureCubeUV( envMap, vWorldDirection, backgroundBlurriness );\n\t#else\n\t\tvec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}",cube_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}",cube_frag:"uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n\tvec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n\tgl_FragColor = texColor;\n\tgl_FragColor.a *= opacity;\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}",depth_vert:"#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <uv_vertex>\n\t#include <batching_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvHighPrecisionZW = gl_Position.zw;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <clipping_planes_fragment>\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <logdepthbuf_fragment>\n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#endif\n}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <batching_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\tvWorldPosition = worldPosition.xyz;\n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <clipping_planes_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",equirect_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",meshbasic_vert:"#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinbase_vertex>\n\t\t#include <skinnormal_vertex>\n\t\t#include <defaultnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <fog_vertex>\n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <specularmap_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\t\treflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include <aomap_fragment>\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <envmap_fragment>\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshlambert_frag:"#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_lambert_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_lambert_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n\tvViewPosition = - mvPosition.xyz;\n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t#else\n\t\tvec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshnormal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvarying vec3 vViewPosition;\n#endif\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",meshnormal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvarying vec3 vViewPosition;\n#endif\n#include <packing>\n#include <uv_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity );\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tgl_FragColor = vec4( packNormalToRGB( normal ), diffuseColor.a );\n\t#ifdef OPAQUE\n\t\tgl_FragColor.a = 1.0;\n\t#endif\n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n\tvarying vec3 vWorldPosition;\n#endif\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n#ifdef USE_TRANSMISSION\n\tvWorldPosition = worldPosition.xyz;\n#endif\n}",meshphysical_frag:"#define STANDARD\n#ifdef PHYSICAL\n\t#define IOR\n\t#define USE_SPECULAR\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef IOR\n\tuniform float ior;\n#endif\n#ifdef USE_SPECULAR\n\tuniform float specularIntensity;\n\tuniform vec3 specularColor;\n\t#ifdef USE_SPECULAR_COLORMAP\n\t\tuniform sampler2D specularColorMap;\n\t#endif\n\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\tuniform sampler2D specularIntensityMap;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_IRIDESCENCE\n\tuniform float iridescence;\n\tuniform float iridescenceIOR;\n\tuniform float iridescenceThicknessMinimum;\n\tuniform float iridescenceThicknessMaximum;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheenColor;\n\tuniform float sheenRoughness;\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tuniform sampler2D sheenColorMap;\n\t#endif\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tuniform sampler2D sheenRoughnessMap;\n\t#endif\n#endif\n#ifdef USE_ANISOTROPY\n\tuniform vec2 anisotropyVector;\n\t#ifdef USE_ANISOTROPYMAP\n\t\tuniform sampler2D anisotropyMap;\n\t#endif\n#endif\nvarying vec3 vViewPosition;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <iridescence_fragment>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_physical_pars_fragment>\n#include <transmission_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <clearcoat_pars_fragment>\n#include <iridescence_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <clearcoat_normal_fragment_begin>\n\t#include <clearcoat_normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\t#include <transmission_fragment>\n\tvec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n\t#ifdef USE_SHEEN\n\t\tfloat sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );\n\t\toutgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect;\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) );\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\t\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat;\n\t#endif\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_toon_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_toon_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",points_vert:"uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n#ifdef USE_POINTS_UV\n\tvarying vec2 vUv;\n\tuniform mat3 uvTransform;\n#endif\nvoid main() {\n\t#ifdef USE_POINTS_UV\n\t\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\t#endif\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <fog_vertex>\n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",shadow_vert:"#include <common>\n#include <batching_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <shadowmap_pars_vertex>\nvoid main() {\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <logdepthbuf_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n\t#include <logdepthbuf_fragment>\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include <common>\n#include <uv_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n}"},me={common:{diffuse:{value:new be(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Ye},alphaMap:{value:null},alphaMapTransform:{value:new Ye},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Ye}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Ye}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Ye}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Ye},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Ye},normalScale:{value:new H(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Ye},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Ye}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Ye}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Ye}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new be(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new be(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Ye},alphaTest:{value:0},uvTransform:{value:new Ye}},sprite:{diffuse:{value:new be(16777215)},opacity:{value:1},center:{value:new H(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Ye},alphaMap:{value:null},alphaMapTransform:{value:new Ye},alphaTest:{value:0}}},xn={basic:{uniforms:x0([me.common,me.specularmap,me.envmap,me.aomap,me.lightmap,me.fog]),vertexShader:ht.meshbasic_vert,fragmentShader:ht.meshbasic_frag},lambert:{uniforms:x0([me.common,me.specularmap,me.envmap,me.aomap,me.lightmap,me.emissivemap,me.bumpmap,me.normalmap,me.displacementmap,me.fog,me.lights,{emissive:{value:new be(0)}}]),vertexShader:ht.meshlambert_vert,fragmentShader:ht.meshlambert_frag},phong:{uniforms:x0([me.common,me.specularmap,me.envmap,me.aomap,me.lightmap,me.emissivemap,me.bumpmap,me.normalmap,me.displacementmap,me.fog,me.lights,{emissive:{value:new be(0)},specular:{value:new be(1118481)},shininess:{value:30}}]),vertexShader:ht.meshphong_vert,fragmentShader:ht.meshphong_frag},standard:{uniforms:x0([me.common,me.envmap,me.aomap,me.lightmap,me.emissivemap,me.bumpmap,me.normalmap,me.displacementmap,me.roughnessmap,me.metalnessmap,me.fog,me.lights,{emissive:{value:new be(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:ht.meshphysical_vert,fragmentShader:ht.meshphysical_frag},toon:{uniforms:x0([me.common,me.aomap,me.lightmap,me.emissivemap,me.bumpmap,me.normalmap,me.displacementmap,me.gradientmap,me.fog,me.lights,{emissive:{value:new be(0)}}]),vertexShader:ht.meshtoon_vert,fragmentShader:ht.meshtoon_frag},matcap:{uniforms:x0([me.common,me.bumpmap,me.normalmap,me.displacementmap,me.fog,{matcap:{value:null}}]),vertexShader:ht.meshmatcap_vert,fragmentShader:ht.meshmatcap_frag},points:{uniforms:x0([me.points,me.fog]),vertexShader:ht.points_vert,fragmentShader:ht.points_frag},dashed:{uniforms:x0([me.common,me.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:ht.linedashed_vert,fragmentShader:ht.linedashed_frag},depth:{uniforms:x0([me.common,me.displacementmap]),vertexShader:ht.depth_vert,fragmentShader:ht.depth_frag},normal:{uniforms:x0([me.common,me.bumpmap,me.normalmap,me.displacementmap,{opacity:{value:1}}]),vertexShader:ht.meshnormal_vert,fragmentShader:ht.meshnormal_frag},sprite:{uniforms:x0([me.sprite,me.fog]),vertexShader:ht.sprite_vert,fragmentShader:ht.sprite_frag},background:{uniforms:{uvTransform:{value:new Ye},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:ht.background_vert,fragmentShader:ht.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1}},vertexShader:ht.backgroundCube_vert,fragmentShader:ht.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:ht.cube_vert,fragmentShader:ht.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:ht.equirect_vert,fragmentShader:ht.equirect_frag},distanceRGBA:{uniforms:x0([me.common,me.displacementmap,{referencePosition:{value:new F},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:ht.distanceRGBA_vert,fragmentShader:ht.distanceRGBA_frag},shadow:{uniforms:x0([me.lights,me.fog,{color:{value:new be(0)},opacity:{value:1}}]),vertexShader:ht.shadow_vert,fragmentShader:ht.shadow_frag}};xn.physical={uniforms:x0([xn.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Ye},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Ye},clearcoatNormalScale:{value:new H(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Ye},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Ye},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Ye},sheen:{value:0},sheenColor:{value:new be(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Ye},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Ye},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Ye},transmissionSamplerSize:{value:new H},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Ye},attenuationDistance:{value:0},attenuationColor:{value:new be(0)},specularColor:{value:new be(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Ye},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Ye},anisotropyVector:{value:new H},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Ye}}]),vertexShader:ht.meshphysical_vert,fragmentShader:ht.meshphysical_frag};const yo={r:0,b:0,g:0};function t9(i,e,t,n,s,r,a){const o=new be(0);let c,u,l=!0===r?0:1,f=null,d=0,p=null;function y(v,g){v.getRGB(yo,lc(i)),n.buffers.color.setClear(yo.r,yo.g,yo.b,g,a)}return{getClearColor:function(){return o},setClearColor:function(v,g=1){o.set(v),l=g,y(o,l)},getClearAlpha:function(){return l},setClearAlpha:function(v){l=v,y(o,l)},render:function m(v,g){let _=!1,x=!0===g.isScene?g.background:null;x&&x.isTexture&&(x=(g.backgroundBlurriness>0?t:e).get(x)),null===x?y(o,l):x&&x.isColor&&(y(x,1),_=!0);const b=i.xr.getEnvironmentBlendMode();"additive"===b?n.buffers.color.setClear(0,0,0,1,a):"alpha-blend"===b&&n.buffers.color.setClear(0,0,0,0,a),(i.autoClear||_)&&i.clear(i.autoClearColor,i.autoClearDepth,i.autoClearStencil),x&&(x.isCubeTexture||306===x.mapping)?(void 0===u&&(u=new $t(new zs(1,1,1),new yn({name:"BackgroundCubeMaterial",uniforms:Hs(xn.backgroundCube.uniforms),vertexShader:xn.backgroundCube.vertexShader,fragmentShader:xn.backgroundCube.fragmentShader,side:1,depthTest:!1,depthWrite:!1,fog:!1})),u.geometry.deleteAttribute("normal"),u.geometry.deleteAttribute("uv"),u.onBeforeRender=function(T,E,M){this.matrixWorld.copyPosition(M.matrixWorld)},Object.defineProperty(u.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),s.update(u)),u.material.uniforms.envMap.value=x,u.material.uniforms.flipEnvMap.value=x.isCubeTexture&&!1===x.isRenderTargetTexture?-1:1,u.material.uniforms.backgroundBlurriness.value=g.backgroundBlurriness,u.material.uniforms.backgroundIntensity.value=g.backgroundIntensity,u.material.toneMapped=_t.getTransfer(x.colorSpace)!==Ct,(f!==x||d!==x.version||p!==i.toneMapping)&&(u.material.needsUpdate=!0,f=x,d=x.version,p=i.toneMapping),u.layers.enableAll(),v.unshift(u,u.geometry,u.material,0,0,null)):x&&x.isTexture&&(void 0===c&&(c=new $t(new Nr(2,2),new yn({name:"BackgroundMaterial",uniforms:Hs(xn.background.uniforms),vertexShader:xn.background.vertexShader,fragmentShader:xn.background.fragmentShader,side:0,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.deleteAttribute("normal"),Object.defineProperty(c.material,"map",{get:function(){return this.uniforms.t2D.value}}),s.update(c)),c.material.uniforms.t2D.value=x,c.material.uniforms.backgroundIntensity.value=g.backgroundIntensity,c.material.toneMapped=_t.getTransfer(x.colorSpace)!==Ct,!0===x.matrixAutoUpdate&&x.updateMatrix(),c.material.uniforms.uvTransform.value.copy(x.matrix),(f!==x||d!==x.version||p!==i.toneMapping)&&(c.material.needsUpdate=!0,f=x,d=x.version,p=i.toneMapping),c.layers.enableAll(),v.unshift(c,c.geometry,c.material,0,0,null))}}}function n9(i,e,t,n){const s=i.getParameter(i.MAX_VERTEX_ATTRIBS),r=n.isWebGL2?null:e.get("OES_vertex_array_object"),a=n.isWebGL2||null!==r,o={},l=v(null);let c=l,u=!1;function p(U){return n.isWebGL2?i.bindVertexArray(U):r.bindVertexArrayOES(U)}function m(U){return n.isWebGL2?i.deleteVertexArray(U):r.deleteVertexArrayOES(U)}function v(U){const z=[],G=[],ee=[];for(let J=0;J<s;J++)z[J]=0,G[J]=0,ee[J]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:z,enabledAttributes:G,attributeDivisors:ee,object:U,attributes:{},index:null}}function x(){const U=c.newAttributes;for(let z=0,G=U.length;z<G;z++)U[z]=0}function b(U){T(U,0)}function T(U,z){const ee=c.enabledAttributes,J=c.attributeDivisors;c.newAttributes[U]=1,0===ee[U]&&(i.enableVertexAttribArray(U),ee[U]=1),J[U]!==z&&((n.isWebGL2?i:e.get("ANGLE_instanced_arrays"))[n.isWebGL2?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](U,z),J[U]=z)}function E(){const U=c.newAttributes,z=c.enabledAttributes;for(let G=0,ee=z.length;G<ee;G++)z[G]!==U[G]&&(i.disableVertexAttribArray(G),z[G]=0)}function M(U,z,G,ee,J,Z,ne){!0===ne?i.vertexAttribIPointer(U,z,G,J,Z):i.vertexAttribPointer(U,z,G,ee,J,Z)}function X(){te(),u=!0,c!==l&&(c=l,p(c.object))}function te(){l.geometry=null,l.program=null,l.wireframe=!1}return{setup:function f(U,z,G,ee,J){let Z=!1;if(a){const ne=function y(U,z,G){const ee=!0===G.wireframe;let J=o[U.id];void 0===J&&(J={},o[U.id]=J);let Z=J[z.id];void 0===Z&&(Z={},J[z.id]=Z);let ne=Z[ee];return void 0===ne&&(ne=v(function d(){return n.isWebGL2?i.createVertexArray():r.createVertexArrayOES()}()),Z[ee]=ne),ne}(ee,G,z);c!==ne&&(c=ne,p(c.object)),Z=function g(U,z,G,ee){const J=c.attributes,Z=z.attributes;let ne=0;const Y=G.getAttributes();for(const he in Y)if(Y[he].location>=0){const Q=J[he];let ae=Z[he];if(void 0===ae&&("instanceMatrix"===he&&U.instanceMatrix&&(ae=U.instanceMatrix),"instanceColor"===he&&U.instanceColor&&(ae=U.instanceColor)),void 0===Q||Q.attribute!==ae||ae&&Q.data!==ae.data)return!0;ne++}return c.attributesNum!==ne||c.index!==ee}(U,ee,G,J),Z&&function _(U,z,G,ee){const J={},Z=z.attributes;let ne=0;const Y=G.getAttributes();for(const he in Y)if(Y[he].location>=0){let Q=Z[he];void 0===Q&&("instanceMatrix"===he&&U.instanceMatrix&&(Q=U.instanceMatrix),"instanceColor"===he&&U.instanceColor&&(Q=U.instanceColor));const ae={};ae.attribute=Q,Q&&Q.data&&(ae.data=Q.data),J[he]=ae,ne++}c.attributes=J,c.attributesNum=ne,c.index=ee}(U,ee,G,J)}else{const ne=!0===z.wireframe;(c.geometry!==ee.id||c.program!==G.id||c.wireframe!==ne)&&(c.geometry=ee.id,c.program=G.id,c.wireframe=ne,Z=!0)}null!==J&&t.update(J,i.ELEMENT_ARRAY_BUFFER),(Z||u)&&(u=!1,function w(U,z,G,ee){if(!1===n.isWebGL2&&(U.isInstancedMesh||ee.isInstancedBufferGeometry)&&null===e.get("ANGLE_instanced_arrays"))return;x();const J=ee.attributes,Z=G.getAttributes(),ne=z.defaultAttributeValues;for(const Y in Z){const he=Z[Y];if(he.location>=0){let Ce=J[Y];if(void 0===Ce&&("instanceMatrix"===Y&&U.instanceMatrix&&(Ce=U.instanceMatrix),"instanceColor"===Y&&U.instanceColor&&(Ce=U.instanceColor)),void 0!==Ce){const Q=Ce.normalized,ae=Ce.itemSize,xe=t.get(Ce);if(void 0===xe)continue;const Ee=xe.buffer,Le=xe.type,Fe=xe.bytesPerElement,tt=!0===n.isWebGL2&&(Le===i.INT||Le===i.UNSIGNED_INT||1013===Ce.gpuType);if(Ce.isInterleavedBufferAttribute){const He=Ce.data,B=He.stride,fe=Ce.offset;if(He.isInstancedInterleavedBuffer){for(let se=0;se<he.locationSize;se++)T(he.location+se,He.meshPerAttribute);!0!==U.isInstancedMesh&&void 0===ee._maxInstanceCount&&(ee._maxInstanceCount=He.meshPerAttribute*He.count)}else for(let se=0;se<he.locationSize;se++)b(he.location+se);i.bindBuffer(i.ARRAY_BUFFER,Ee);for(let se=0;se<he.locationSize;se++)M(he.location+se,ae/he.locationSize,Le,Q,B*Fe,(fe+ae/he.locationSize*se)*Fe,tt)}else{if(Ce.isInstancedBufferAttribute){for(let He=0;He<he.locationSize;He++)T(he.location+He,Ce.meshPerAttribute);!0!==U.isInstancedMesh&&void 0===ee._maxInstanceCount&&(ee._maxInstanceCount=Ce.meshPerAttribute*Ce.count)}else for(let He=0;He<he.locationSize;He++)b(he.location+He);i.bindBuffer(i.ARRAY_BUFFER,Ee);for(let He=0;He<he.locationSize;He++)M(he.location+He,ae/he.locationSize,Le,Q,ae*Fe,ae/he.locationSize*He*Fe,tt)}}else if(void 0!==ne){const Q=ne[Y];if(void 0!==Q)switch(Q.length){case 2:i.vertexAttrib2fv(he.location,Q);break;case 3:i.vertexAttrib3fv(he.location,Q);break;case 4:i.vertexAttrib4fv(he.location,Q);break;default:i.vertexAttrib1fv(he.location,Q)}}}}E()}(U,z,G,ee),null!==J&&i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,t.get(J).buffer))},reset:X,resetDefaultState:te,dispose:function I(){X();for(const U in o){const z=o[U];for(const G in z){const ee=z[G];for(const J in ee)m(ee[J].object),delete ee[J];delete z[G]}delete o[U]}},releaseStatesOfGeometry:function S(U){if(void 0===o[U.id])return;const z=o[U.id];for(const G in z){const ee=z[G];for(const J in ee)m(ee[J].object),delete ee[J];delete z[G]}delete o[U.id]},releaseStatesOfProgram:function P(U){for(const z in o){const G=o[z];if(void 0===G[U.id])continue;const ee=G[U.id];for(const J in ee)m(ee[J].object),delete ee[J];delete G[U.id]}},initAttributes:x,enableAttribute:b,disableUnusedAttributes:E}}function i9(i,e,t,n){const s=n.isWebGL2;let r;this.setMode=function a(u){r=u},this.render=function o(u,f){i.drawArrays(r,u,f),t.update(f,r,1)},this.renderInstances=function l(u,f,d){if(0===d)return;let p,m;if(s)p=i,m="drawArraysInstanced";else if(p=e.get("ANGLE_instanced_arrays"),m="drawArraysInstancedANGLE",null===p)return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");p[m](r,u,f,d),t.update(f,r,d)},this.renderMultiDraw=function c(u,f,d){if(0===d)return;const p=e.get("WEBGL_multi_draw");if(null===p)for(let m=0;m<d;m++)this.render(u[m],f[m]);else{p.multiDrawArraysWEBGL(r,u,0,f,0,d);let m=0;for(let y=0;y<d;y++)m+=f[y];t.update(m,r,1)}}}function s9(i,e,t){let n;function r(M){if("highp"===M){if(i.getShaderPrecisionFormat(i.VERTEX_SHADER,i.HIGH_FLOAT).precision>0&&i.getShaderPrecisionFormat(i.FRAGMENT_SHADER,i.HIGH_FLOAT).precision>0)return"highp";M="mediump"}return"mediump"===M&&i.getShaderPrecisionFormat(i.VERTEX_SHADER,i.MEDIUM_FLOAT).precision>0&&i.getShaderPrecisionFormat(i.FRAGMENT_SHADER,i.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}const a=typeof WebGL2RenderingContext<"u"&&"WebGL2RenderingContext"===i.constructor.name;let o=void 0!==t.precision?t.precision:"highp";const l=r(o);l!==o&&(console.warn("THREE.WebGLRenderer:",o,"not supported, using",l,"instead."),o=l);const c=a||e.has("WEBGL_draw_buffers"),u=!0===t.logarithmicDepthBuffer,f=i.getParameter(i.MAX_TEXTURE_IMAGE_UNITS),d=i.getParameter(i.MAX_VERTEX_TEXTURE_IMAGE_UNITS),p=i.getParameter(i.MAX_TEXTURE_SIZE),m=i.getParameter(i.MAX_CUBE_MAP_TEXTURE_SIZE),y=i.getParameter(i.MAX_VERTEX_ATTRIBS),v=i.getParameter(i.MAX_VERTEX_UNIFORM_VECTORS),g=i.getParameter(i.MAX_VARYING_VECTORS),_=i.getParameter(i.MAX_FRAGMENT_UNIFORM_VECTORS),x=d>0,b=a||e.has("OES_texture_float");return{isWebGL2:a,drawBuffers:c,getMaxAnisotropy:function s(){if(void 0!==n)return n;if(!0===e.has("EXT_texture_filter_anisotropic")){const M=e.get("EXT_texture_filter_anisotropic");n=i.getParameter(M.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else n=0;return n},getMaxPrecision:r,precision:o,logarithmicDepthBuffer:u,maxTextures:f,maxVertexTextures:d,maxTextureSize:p,maxCubemapSize:m,maxAttributes:y,maxVertexUniforms:v,maxVaryings:g,maxFragmentUniforms:_,vertexTextures:x,floatFragmentTextures:b,floatVertexTextures:x&&b,maxSamples:a?i.getParameter(i.MAX_SAMPLES):0}}function r9(i){const e=this;let t=null,n=0,s=!1,r=!1;const a=new Vi,o=new Ye,l={value:null,needsUpdate:!1};function u(f,d,p,m){const y=null!==f?f.length:0;let v=null;if(0!==y){if(v=l.value,!0!==m||null===v){const g=p+4*y,_=d.matrixWorldInverse;o.getNormalMatrix(_),(null===v||v.length<g)&&(v=new Float32Array(g));for(let x=0,b=p;x!==y;++x,b+=4)a.copy(f[x]).applyMatrix4(_,o),a.normal.toArray(v,b),v[b+3]=a.constant}l.value=v,l.needsUpdate=!0}return e.numPlanes=y,e.numIntersection=0,v}this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(f,d){const p=0!==f.length||d||0!==n||s;return s=d,n=f.length,p},this.beginShadows=function(){r=!0,u(null)},this.endShadows=function(){r=!1},this.setGlobalState=function(f,d){t=u(f,d,0)},this.setState=function(f,d,p){const m=f.clippingPlanes,y=f.clipIntersection,v=f.clipShadows,g=i.get(f);if(!s||null===m||0===m.length||r&&!v)r?u(null):function c(){l.value!==t&&(l.value=t,l.needsUpdate=n>0),e.numPlanes=n,e.numIntersection=0}();else{const _=r?0:n,x=4*_;let b=g.clippingState||null;l.value=b,b=u(m,d,x,p);for(let T=0;T!==x;++T)b[T]=t[T];g.clippingState=b,this.numIntersection=y?this.numPlanes:0,this.numPlanes+=_}}}function a9(i){let e=new WeakMap;function t(a,o){return 303===o?a.mapping=301:304===o&&(a.mapping=302),a}function s(a){const o=a.target;o.removeEventListener("dispose",s);const l=e.get(o);void 0!==l&&(e.delete(o),l.dispose())}return{get:function n(a){if(a&&a.isTexture){const o=a.mapping;if(303===o||304===o){if(e.has(a))return t(e.get(a).texture,a.mapping);{const l=a.image;if(l&&l.height>0){const c=new Qf(l.height);return c.fromEquirectangularTexture(i,a),e.set(a,c),a.addEventListener("dispose",s),t(c.texture,a.mapping)}return null}}}return a},dispose:function r(){e=new WeakMap}}}class xo extends A2{constructor(e=-1,t=1,n=1,s=-1,r=.1,a=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=n,this.bottom=s,this.near=r,this.far=a,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=null===e.view?null:Object.assign({},e.view),this}setViewOffset(e,t,n,s,r,a){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=s,this.view.width=r,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,s=(this.top+this.bottom)/2;let r=n-e,a=n+e,o=s+t,l=s-t;if(null!==this.view&&this.view.enabled){const c=(this.right-this.left)/this.view.fullWidth/this.zoom,u=(this.top-this.bottom)/this.view.fullHeight/this.zoom;r+=c*this.view.offsetX,a=r+c*this.view.width,o-=u*this.view.offsetY,l=o-u*this.view.height}this.projectionMatrix.makeOrthographic(r,a,o,l,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,null!==this.view&&(t.object.view=Object.assign({},this.view)),t}}const fc=[.125,.215,.35,.446,.526,.582],P2=new xo,dc=new be;let R2=null,L2=0,I2=0;const Yi=(1+Math.sqrt(5))/2,Ys=1/Yi,pc=[new F(1,1,1),new F(-1,1,1),new F(1,1,-1),new F(-1,1,-1),new F(0,Yi,Ys),new F(0,Yi,-Ys),new F(Ys,0,Yi),new F(-Ys,0,Yi),new F(Yi,Ys,0),new F(-Yi,Ys,0)];class mc{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,n=.1,s=100){R2=this._renderer.getRenderTarget(),L2=this._renderer.getActiveCubeFace(),I2=this._renderer.getActiveMipmapLevel(),this._setSize(256);const r=this._allocateTargets();return r.depthBuffer=!0,this._sceneToCubeUV(e,n,s,r),t>0&&this._blur(r,0,0,t),this._applyPMREM(r),this._cleanup(r),r}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){null===this._cubemapMaterial&&(this._cubemapMaterial=yc(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){null===this._equirectMaterial&&(this._equirectMaterial=vc(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),null!==this._cubemapMaterial&&this._cubemapMaterial.dispose(),null!==this._equirectMaterial&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){null!==this._blurMaterial&&this._blurMaterial.dispose(),null!==this._pingPongRenderTarget&&this._pingPongRenderTarget.dispose();for(let e=0;e<this._lodPlanes.length;e++)this._lodPlanes[e].dispose()}_cleanup(e){this._renderer.setRenderTarget(R2,L2,I2),e.scissorTest=!1,_o(e,0,0,e.width,e.height)}_fromTexture(e,t){this._setSize(301===e.mapping||302===e.mapping?0===e.image.length?16:e.image[0].width||e.image[0].image.width:e.image.width/4),R2=this._renderer.getRenderTarget(),L2=this._renderer.getActiveCubeFace(),I2=this._renderer.getActiveMipmapLevel();const n=t||this._allocateTargets();return this._textureToCubeUV(e,n),this._applyPMREM(n),this._cleanup(n),n}_allocateTargets(){const e=3*Math.max(this._cubeSize,112),t=4*this._cubeSize,n={magFilter:kt,minFilter:kt,generateMipmaps:!1,type:Ar,format:L0,colorSpace:Fn,depthBuffer:!1},s=gc(e,t,n);if(null===this._pingPongRenderTarget||this._pingPongRenderTarget.width!==e||this._pingPongRenderTarget.height!==t){null!==this._pingPongRenderTarget&&this._dispose(),this._pingPongRenderTarget=gc(e,t,n);const{_lodMax:r}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=function o9(i){const e=[],t=[],n=[];let s=i;const r=i-4+1+fc.length;for(let a=0;a<r;a++){const o=Math.pow(2,s);t.push(o);let l=1/o;a>i-4?l=fc[a-i+4-1]:0===a&&(l=0),n.push(l);const c=1/(o-2),u=-c,f=1+c,d=[u,u,f,u,f,f,u,u,f,f,u,f],p=6,m=6,y=3,v=2,g=1,_=new Float32Array(y*m*p),x=new Float32Array(v*m*p),b=new Float32Array(g*m*p);for(let E=0;E<p;E++){const M=E%3*2/3-1,w=E>2?0:-1;_.set([M,w,0,M+2/3,w,0,M+2/3,w+1,0,M,w,0,M+2/3,w+1,0,M,w+1,0],y*m*E),x.set(d,v*m*E),b.set([E,E,E,E,E,E],g*m*E)}const T=new ct;T.setAttribute("position",new vt(_,y)),T.setAttribute("uv",new vt(x,v)),T.setAttribute("faceIndex",new vt(b,g)),e.push(T),s>4&&s--}return{lodPlanes:e,sizeLods:t,sigmas:n}}(r)),this._blurMaterial=function l9(i,e,t){const n=new Float32Array(20),s=new F(0,1,0);return new yn({name:"SphericalGaussianBlur",defines:{n:20,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${i}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:n},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:s}},vertexShader:"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t",fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\t\t\tuniform int samples;\n\t\t\tuniform float weights[ n ];\n\t\t\tuniform bool latitudinal;\n\t\t\tuniform float dTheta;\n\t\t\tuniform float mipInt;\n\t\t\tuniform vec3 poleAxis;\n\n\t\t\t#define ENVMAP_TYPE_CUBE_UV\n\t\t\t#include <cube_uv_reflection_fragment>\n\n\t\t\tvec3 getSample( float theta, vec3 axis ) {\n\n\t\t\t\tfloat cosTheta = cos( theta );\n\t\t\t\t// Rodrigues' axis-angle rotation\n\t\t\t\tvec3 sampleDirection = vOutputDirection * cosTheta\n\t\t\t\t\t+ cross( axis, vOutputDirection ) * sin( theta )\n\t\t\t\t\t+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );\n\n\t\t\t\treturn bilinearCubeUV( envMap, sampleDirection, mipInt );\n\n\t\t\t}\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );\n\n\t\t\t\tif ( all( equal( axis, vec3( 0.0 ) ) ) ) {\n\n\t\t\t\t\taxis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );\n\n\t\t\t\t}\n\n\t\t\t\taxis = normalize( axis );\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t\t\t\tgl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );\n\n\t\t\t\tfor ( int i = 1; i < n; i++ ) {\n\n\t\t\t\t\tif ( i >= samples ) {\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfloat theta = dTheta * float( i );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( theta, axis );\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t",blending:0,depthTest:!1,depthWrite:!1})}(r,e,t)}return s}_compileMaterial(e){const t=new $t(this._lodPlanes[0],e);this._renderer.compile(t,P2)}_sceneToCubeUV(e,t,n,s){const o=new l0(90,1,t,n),l=[1,-1,1,1,1,1],c=[1,1,1,-1,-1,-1],u=this._renderer,f=u.autoClear,d=u.toneMapping;u.getClearColor(dc),u.toneMapping=0,u.autoClear=!1;const p=new zi({name:"PMREM.Background",side:1,depthWrite:!1,depthTest:!1}),m=new $t(new zs,p);let y=!1;const v=e.background;v?v.isColor&&(p.color.copy(v),e.background=null,y=!0):(p.color.copy(dc),y=!0);for(let g=0;g<6;g++){const _=g%3;0===_?(o.up.set(0,l[g],0),o.lookAt(c[g],0,0)):1===_?(o.up.set(0,0,l[g]),o.lookAt(0,c[g],0)):(o.up.set(0,l[g],0),o.lookAt(0,0,c[g]));const x=this._cubeSize;_o(s,_*x,g>2?x:0,x,x),u.setRenderTarget(s),y&&u.render(m,o),u.render(e,o)}m.geometry.dispose(),m.material.dispose(),u.toneMapping=d,u.autoClear=f,e.background=v}_textureToCubeUV(e,t){const n=this._renderer,s=301===e.mapping||302===e.mapping;s?(null===this._cubemapMaterial&&(this._cubemapMaterial=yc()),this._cubemapMaterial.uniforms.flipEnvMap.value=!1===e.isRenderTargetTexture?-1:1):null===this._equirectMaterial&&(this._equirectMaterial=vc());const r=s?this._cubemapMaterial:this._equirectMaterial,a=new $t(this._lodPlanes[0],r);r.uniforms.envMap.value=e;const l=this._cubeSize;_o(t,0,0,3*l,2*l),n.setRenderTarget(t),n.render(a,P2)}_applyPMREM(e){const t=this._renderer,n=t.autoClear;t.autoClear=!1;for(let s=1;s<this._lodPlanes.length;s++){const r=Math.sqrt(this._sigmas[s]*this._sigmas[s]-this._sigmas[s-1]*this._sigmas[s-1]);this._blur(e,s-1,s,r,pc[(s-1)%pc.length])}t.autoClear=n}_blur(e,t,n,s,r){const a=this._pingPongRenderTarget;this._halfBlur(e,a,t,n,s,"latitudinal",r),this._halfBlur(a,e,n,n,s,"longitudinal",r)}_halfBlur(e,t,n,s,r,a,o){const l=this._renderer,c=this._blurMaterial;"latitudinal"!==a&&"longitudinal"!==a&&console.error("blur direction must be either latitudinal or longitudinal!");const f=new $t(this._lodPlanes[s],c),d=c.uniforms,p=this._sizeLods[n]-1,m=isFinite(r)?Math.PI/(2*p):2*Math.PI/39,y=r/m,v=isFinite(r)?1+Math.floor(3*y):20;v>20&&console.warn(`sigmaRadians, ${r}, is too large and will clip, as it requested ${v} samples when the maximum is set to 20`);const g=[];let _=0;for(let M=0;M<20;++M){const w=M/y,I=Math.exp(-w*w/2);g.push(I),0===M?_+=I:M<v&&(_+=2*I)}for(let M=0;M<g.length;M++)g[M]=g[M]/_;d.envMap.value=e.texture,d.samples.value=v,d.weights.value=g,d.latitudinal.value="latitudinal"===a,o&&(d.poleAxis.value=o);const{_lodMax:x}=this;d.dTheta.value=m,d.mipInt.value=x-n;const b=this._sizeLods[s];_o(t,3*b*(s>x-4?s-x+4:0),4*(this._cubeSize-b),3*b,2*b),l.setRenderTarget(t),l.render(f,P2)}}function gc(i,e,t){const n=new vn(i,e,t);return n.texture.mapping=306,n.texture.name="PMREM.cubeUv",n.scissorTest=!0,n}function _o(i,e,t,n,s){i.viewport.set(e,t,n,s),i.scissor.set(e,t,n,s)}function vc(){return new yn({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t",fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\n\t\t\t#include <common>\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 outputDirection = normalize( vOutputDirection );\n\t\t\t\tvec2 uv = equirectUv( outputDirection );\n\n\t\t\t\tgl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );\n\n\t\t\t}\n\t\t",blending:0,depthTest:!1,depthWrite:!1})}function yc(){return new yn({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t",fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tuniform float flipEnvMap;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform samplerCube envMap;\n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) );\n\n\t\t\t}\n\t\t",blending:0,depthTest:!1,depthWrite:!1})}function c9(i){let e=new WeakMap,t=null;function r(o){const l=o.target;l.removeEventListener("dispose",r);const c=e.get(l);void 0!==c&&(e.delete(l),c.dispose())}return{get:function n(o){if(o&&o.isTexture){const l=o.mapping,c=303===l||304===l,u=301===l||302===l;if(c||u){if(o.isRenderTargetTexture&&!0===o.needsPMREMUpdate){o.needsPMREMUpdate=!1;let f=e.get(o);return null===t&&(t=new mc(i)),f=c?t.fromEquirectangular(o,f):t.fromCubemap(o,f),e.set(o,f),f.texture}if(e.has(o))return e.get(o).texture;{const f=o.image;if(c&&f&&f.height>0||u&&f&&function s(o){let l=0;for(let u=0;u<6;u++)void 0!==o[u]&&l++;return 6===l}(f)){null===t&&(t=new mc(i));const d=c?t.fromEquirectangular(o):t.fromCubemap(o);return e.set(o,d),o.addEventListener("dispose",r),d.texture}return null}}}return o},dispose:function a(){e=new WeakMap,null!==t&&(t.dispose(),t=null)}}}function h9(i){const e={};function t(n){if(void 0!==e[n])return e[n];let s;switch(n){case"WEBGL_depth_texture":s=i.getExtension("WEBGL_depth_texture")||i.getExtension("MOZ_WEBGL_depth_texture")||i.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":s=i.getExtension("EXT_texture_filter_anisotropic")||i.getExtension("MOZ_EXT_texture_filter_anisotropic")||i.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":s=i.getExtension("WEBGL_compressed_texture_s3tc")||i.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||i.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":s=i.getExtension("WEBGL_compressed_texture_pvrtc")||i.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:s=i.getExtension(n)}return e[n]=s,s}return{has:function(n){return null!==t(n)},init:function(n){n.isWebGL2?(t("EXT_color_buffer_float"),t("WEBGL_clip_cull_distance")):(t("WEBGL_depth_texture"),t("OES_texture_float"),t("OES_texture_half_float"),t("OES_texture_half_float_linear"),t("OES_standard_derivatives"),t("OES_element_index_uint"),t("OES_vertex_array_object"),t("ANGLE_instanced_arrays")),t("OES_texture_float_linear"),t("EXT_color_buffer_half_float"),t("WEBGL_multisampled_render_to_texture")},get:function(n){const s=t(n);return null===s&&console.warn("THREE.WebGLRenderer: "+n+" extension not supported."),s}}}function u9(i,e,t,n){const s={},r=new WeakMap;function a(f){const d=f.target;null!==d.index&&e.remove(d.index);for(const m in d.attributes)e.remove(d.attributes[m]);for(const m in d.morphAttributes){const y=d.morphAttributes[m];for(let v=0,g=y.length;v<g;v++)e.remove(y[v])}d.removeEventListener("dispose",a),delete s[d.id];const p=r.get(d);p&&(e.remove(p),r.delete(d)),n.releaseStatesOfGeometry(d),!0===d.isInstancedBufferGeometry&&delete d._maxInstanceCount,t.memory.geometries--}function c(f){const d=[],p=f.index,m=f.attributes.position;let y=0;if(null!==p){const _=p.array;y=p.version;for(let x=0,b=_.length;x<b;x+=3){const T=_[x+0],E=_[x+1],M=_[x+2];d.push(T,E,E,M,M,T)}}else{if(void 0===m)return;y=m.version;for(let x=0,b=m.array.length/3-1;x<b;x+=3){const T=x+0,E=x+1,M=x+2;d.push(T,E,E,M,M,T)}}const v=new(G5(d)?nc:tc)(d,1);v.version=y;const g=r.get(f);g&&e.remove(g),r.set(f,v)}return{get:function o(f,d){return!0===s[d.id]||(d.addEventListener("dispose",a),s[d.id]=!0,t.memory.geometries++),d},update:function l(f){const d=f.attributes;for(const m in d)e.update(d[m],i.ARRAY_BUFFER);const p=f.morphAttributes;for(const m in p){const y=p[m];for(let v=0,g=y.length;v<g;v++)e.update(y[v],i.ARRAY_BUFFER)}},getWireframeAttribute:function u(f){const d=r.get(f);if(d){const p=f.index;null!==p&&d.version<p.version&&c(f)}else c(f);return r.get(f)}}}function f9(i,e,t,n){const s=n.isWebGL2;let r,o,l;this.setMode=function a(p){r=p},this.setIndex=function c(p){o=p.type,l=p.bytesPerElement},this.render=function u(p,m){i.drawElements(r,m,o,p*l),t.update(m,r,1)},this.renderInstances=function f(p,m,y){if(0===y)return;let v,g;if(s)v=i,g="drawElementsInstanced";else if(v=e.get("ANGLE_instanced_arrays"),g="drawElementsInstancedANGLE",null===v)return void console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");v[g](r,m,o,p*l,y),t.update(m,r,y)},this.renderMultiDraw=function d(p,m,y){if(0===y)return;const v=e.get("WEBGL_multi_draw");if(null===v)for(let g=0;g<y;g++)this.render(p[g]/l,m[g]);else{v.multiDrawElementsWEBGL(r,m,0,o,p,0,y);let g=0;for(let _=0;_<y;_++)g+=m[_];t.update(g,r,1)}}}function d9(i){const t={frame:0,calls:0,triangles:0,points:0,lines:0};return{memory:{geometries:0,textures:0},render:t,programs:null,autoReset:!0,reset:function s(){t.calls=0,t.triangles=0,t.points=0,t.lines=0},update:function n(r,a,o){switch(t.calls++,a){case i.TRIANGLES:t.triangles+=o*(r/3);break;case i.LINES:t.lines+=o*(r/2);break;case i.LINE_STRIP:t.lines+=o*(r-1);break;case i.LINE_LOOP:t.lines+=o*r;break;case i.POINTS:t.points+=o*r;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",a)}}}}function p9(i,e){return i[0]-e[0]}function m9(i,e){return Math.abs(e[1])-Math.abs(i[1])}function g9(i,e,t){const n={},s=new Float32Array(8),r=new WeakMap,a=new bt,o=[];for(let c=0;c<8;c++)o[c]=[c,0];return{update:function l(c,u,f){const d=c.morphTargetInfluences;if(!0===e.isWebGL2){const p=u.morphAttributes.position||u.morphAttributes.normal||u.morphAttributes.color,m=void 0!==p?p.length:0;let y=r.get(u);if(void 0===y||y.count!==m){let U=function(){X.dispose(),r.delete(u),u.removeEventListener("dispose",U)};void 0!==y&&y.texture.dispose();const _=void 0!==u.morphAttributes.position,x=void 0!==u.morphAttributes.normal,b=void 0!==u.morphAttributes.color,T=u.morphAttributes.position||[],E=u.morphAttributes.normal||[],M=u.morphAttributes.color||[];let w=0;!0===_&&(w=1),!0===x&&(w=2),!0===b&&(w=3);let I=u.attributes.position.count*w,S=1;I>e.maxTextureSize&&(S=Math.ceil(I/e.maxTextureSize),I=e.maxTextureSize);const P=new Float32Array(I*S*4*m),X=new f2(P,I,S,m);X.type=Q0,X.needsUpdate=!0;const te=4*w;for(let z=0;z<m;z++){const G=T[z],ee=E[z],J=M[z],Z=I*S*4*z;for(let ne=0;ne<G.count;ne++){const Y=ne*te;!0===_&&(a.fromBufferAttribute(G,ne),P[Z+Y+0]=a.x,P[Z+Y+1]=a.y,P[Z+Y+2]=a.z,P[Z+Y+3]=0),!0===x&&(a.fromBufferAttribute(ee,ne),P[Z+Y+4]=a.x,P[Z+Y+5]=a.y,P[Z+Y+6]=a.z,P[Z+Y+7]=0),!0===b&&(a.fromBufferAttribute(J,ne),P[Z+Y+8]=a.x,P[Z+Y+9]=a.y,P[Z+Y+10]=a.z,P[Z+Y+11]=4===J.itemSize?a.w:1)}}y={count:m,texture:X,size:new H(I,S)},r.set(u,y),u.addEventListener("dispose",U)}let v=0;for(let _=0;_<d.length;_++)v+=d[_];const g=u.morphTargetsRelative?1:1-v;f.getUniforms().setValue(i,"morphTargetBaseInfluence",g),f.getUniforms().setValue(i,"morphTargetInfluences",d),f.getUniforms().setValue(i,"morphTargetsTexture",y.texture,t),f.getUniforms().setValue(i,"morphTargetsTextureSize",y.size)}else{const p=void 0===d?0:d.length;let m=n[u.id];if(void 0===m||m.length!==p){m=[];for(let x=0;x<p;x++)m[x]=[x,0];n[u.id]=m}for(let x=0;x<p;x++){const b=m[x];b[0]=x,b[1]=d[x]}m.sort(m9);for(let x=0;x<8;x++)x<p&&m[x][1]?(o[x][0]=m[x][0],o[x][1]=m[x][1]):(o[x][0]=Number.MAX_SAFE_INTEGER,o[x][1]=0);o.sort(p9);const y=u.morphAttributes.position,v=u.morphAttributes.normal;let g=0;for(let x=0;x<8;x++){const b=o[x],T=b[0],E=b[1];T!==Number.MAX_SAFE_INTEGER&&E?(y&&u.getAttribute("morphTarget"+x)!==y[T]&&u.setAttribute("morphTarget"+x,y[T]),v&&u.getAttribute("morphNormal"+x)!==v[T]&&u.setAttribute("morphNormal"+x,v[T]),s[x]=E,g+=E):(y&&!0===u.hasAttribute("morphTarget"+x)&&u.deleteAttribute("morphTarget"+x),v&&!0===u.hasAttribute("morphNormal"+x)&&u.deleteAttribute("morphNormal"+x),s[x]=0)}const _=u.morphTargetsRelative?1:1-g;f.getUniforms().setValue(i,"morphTargetBaseInfluence",_),f.getUniforms().setValue(i,"morphTargetInfluences",s)}}}}function v9(i,e,t,n){let s=new WeakMap;function o(l){const c=l.target;c.removeEventListener("dispose",o),t.remove(c.instanceMatrix),null!==c.instanceColor&&t.remove(c.instanceColor)}return{update:function r(l){const c=n.render.frame,f=e.get(l,l.geometry);if(s.get(f)!==c&&(e.update(f),s.set(f,c)),l.isInstancedMesh&&(!1===l.hasEventListener("dispose",o)&&l.addEventListener("dispose",o),s.get(l)!==c&&(t.update(l.instanceMatrix,i.ARRAY_BUFFER),null!==l.instanceColor&&t.update(l.instanceColor,i.ARRAY_BUFFER),s.set(l,c))),l.isSkinnedMesh){const d=l.skeleton;s.get(d)!==c&&(d.update(),s.set(d,c))}return f},dispose:function a(){s=new WeakMap}}}class xc extends A0{constructor(e,t,n,s,r,a,o,l,c,u){if((u=void 0!==u?u:Fi)!==Fi&&u!==bs)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===n&&u===Fi&&(n=si),void 0===n&&u===bs&&(n=Di),super(null,s,r,a,o,l,u,n,c),this.isDepthTexture=!0,this.image={width:e,height:t},this.magFilter=void 0!==o?o:Jt,this.minFilter=void 0!==l?l:Jt,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.compareFunction=e.compareFunction,this}toJSON(e){const t=super.toJSON(e);return null!==this.compareFunction&&(t.compareFunction=this.compareFunction),t}}const _c=new A0,bc=new xc(1,1);bc.compareFunction=515;const Sc=new f2,Mc=new X5,Ec=new mo,Tc=[],wc=[],Ac=new Float32Array(16),Cc=new Float32Array(9),Pc=new Float32Array(4);function qs(i,e,t){const n=i[0];if(n<=0||n>0)return i;const s=e*t;let r=Tc[s];if(void 0===r&&(r=new Float32Array(s),Tc[s]=r),0!==e){n.toArray(r,0);for(let a=1,o=0;a!==e;++a)o+=t,i[a].toArray(r,o)}return r}function jt(i,e){if(i.length!==e.length)return!1;for(let t=0,n=i.length;t<n;t++)if(i[t]!==e[t])return!1;return!0}function e0(i,e){for(let t=0,n=e.length;t<n;t++)i[t]=e[t]}function bo(i,e){let t=wc[e];void 0===t&&(t=new Int32Array(e),wc[e]=t);for(let n=0;n!==e;++n)t[n]=i.allocateTextureUnit();return t}function y9(i,e){const t=this.cache;t[0]!==e&&(i.uniform1f(this.addr,e),t[0]=e)}function x9(i,e){const t=this.cache;if(void 0!==e.x)(t[0]!==e.x||t[1]!==e.y)&&(i.uniform2f(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(jt(t,e))return;i.uniform2fv(this.addr,e),e0(t,e)}}function _9(i,e){const t=this.cache;if(void 0!==e.x)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(i.uniform3f(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else if(void 0!==e.r)(t[0]!==e.r||t[1]!==e.g||t[2]!==e.b)&&(i.uniform3f(this.addr,e.r,e.g,e.b),t[0]=e.r,t[1]=e.g,t[2]=e.b);else{if(jt(t,e))return;i.uniform3fv(this.addr,e),e0(t,e)}}function b9(i,e){const t=this.cache;if(void 0!==e.x)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(i.uniform4f(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(jt(t,e))return;i.uniform4fv(this.addr,e),e0(t,e)}}function S9(i,e){const t=this.cache,n=e.elements;if(void 0===n){if(jt(t,e))return;i.uniformMatrix2fv(this.addr,!1,e),e0(t,e)}else{if(jt(t,n))return;Pc.set(n),i.uniformMatrix2fv(this.addr,!1,Pc),e0(t,n)}}function M9(i,e){const t=this.cache,n=e.elements;if(void 0===n){if(jt(t,e))return;i.uniformMatrix3fv(this.addr,!1,e),e0(t,e)}else{if(jt(t,n))return;Cc.set(n),i.uniformMatrix3fv(this.addr,!1,Cc),e0(t,n)}}function E9(i,e){const t=this.cache,n=e.elements;if(void 0===n){if(jt(t,e))return;i.uniformMatrix4fv(this.addr,!1,e),e0(t,e)}else{if(jt(t,n))return;Ac.set(n),i.uniformMatrix4fv(this.addr,!1,Ac),e0(t,n)}}function T9(i,e){const t=this.cache;t[0]!==e&&(i.uniform1i(this.addr,e),t[0]=e)}function w9(i,e){const t=this.cache;if(void 0!==e.x)(t[0]!==e.x||t[1]!==e.y)&&(i.uniform2i(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(jt(t,e))return;i.uniform2iv(this.addr,e),e0(t,e)}}function A9(i,e){const t=this.cache;if(void 0!==e.x)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(i.uniform3i(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else{if(jt(t,e))return;i.uniform3iv(this.addr,e),e0(t,e)}}function C9(i,e){const t=this.cache;if(void 0!==e.x)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(i.uniform4i(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(jt(t,e))return;i.uniform4iv(this.addr,e),e0(t,e)}}function P9(i,e){const t=this.cache;t[0]!==e&&(i.uniform1ui(this.addr,e),t[0]=e)}function R9(i,e){const t=this.cache;if(void 0!==e.x)(t[0]!==e.x||t[1]!==e.y)&&(i.uniform2ui(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(jt(t,e))return;i.uniform2uiv(this.addr,e),e0(t,e)}}function L9(i,e){const t=this.cache;if(void 0!==e.x)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(i.uniform3ui(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else{if(jt(t,e))return;i.uniform3uiv(this.addr,e),e0(t,e)}}function I9(i,e){const t=this.cache;if(void 0!==e.x)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(i.uniform4ui(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(jt(t,e))return;i.uniform4uiv(this.addr,e),e0(t,e)}}function D9(i,e,t){const n=this.cache,s=t.allocateTextureUnit();n[0]!==s&&(i.uniform1i(this.addr,s),n[0]=s),t.setTexture2D(e||(this.type===i.SAMPLER_2D_SHADOW?bc:_c),s)}function F9(i,e,t){const n=this.cache,s=t.allocateTextureUnit();n[0]!==s&&(i.uniform1i(this.addr,s),n[0]=s),t.setTexture3D(e||Mc,s)}function O9(i,e,t){const n=this.cache,s=t.allocateTextureUnit();n[0]!==s&&(i.uniform1i(this.addr,s),n[0]=s),t.setTextureCube(e||Ec,s)}function N9(i,e,t){const n=this.cache,s=t.allocateTextureUnit();n[0]!==s&&(i.uniform1i(this.addr,s),n[0]=s),t.setTexture2DArray(e||Sc,s)}function U9(i,e){i.uniform1fv(this.addr,e)}function B9(i,e){const t=qs(e,this.size,2);i.uniform2fv(this.addr,t)}function G9(i,e){const t=qs(e,this.size,3);i.uniform3fv(this.addr,t)}function z9(i,e){const t=qs(e,this.size,4);i.uniform4fv(this.addr,t)}function H9(i,e){const t=qs(e,this.size,4);i.uniformMatrix2fv(this.addr,!1,t)}function V9(i,e){const t=qs(e,this.size,9);i.uniformMatrix3fv(this.addr,!1,t)}function W9(i,e){const t=qs(e,this.size,16);i.uniformMatrix4fv(this.addr,!1,t)}function X9(i,e){i.uniform1iv(this.addr,e)}function Y9(i,e){i.uniform2iv(this.addr,e)}function q9(i,e){i.uniform3iv(this.addr,e)}function Z9(i,e){i.uniform4iv(this.addr,e)}function J9(i,e){i.uniform1uiv(this.addr,e)}function K9(i,e){i.uniform2uiv(this.addr,e)}function $9(i,e){i.uniform3uiv(this.addr,e)}function Q9(i,e){i.uniform4uiv(this.addr,e)}function j9(i,e,t){const n=this.cache,s=e.length,r=bo(t,s);jt(n,r)||(i.uniform1iv(this.addr,r),e0(n,r));for(let a=0;a!==s;++a)t.setTexture2D(e[a]||_c,r[a])}function ep(i,e,t){const n=this.cache,s=e.length,r=bo(t,s);jt(n,r)||(i.uniform1iv(this.addr,r),e0(n,r));for(let a=0;a!==s;++a)t.setTexture3D(e[a]||Mc,r[a])}function tp(i,e,t){const n=this.cache,s=e.length,r=bo(t,s);jt(n,r)||(i.uniform1iv(this.addr,r),e0(n,r));for(let a=0;a!==s;++a)t.setTextureCube(e[a]||Ec,r[a])}function np(i,e,t){const n=this.cache,s=e.length,r=bo(t,s);jt(n,r)||(i.uniform1iv(this.addr,r),e0(n,r));for(let a=0;a!==s;++a)t.setTexture2DArray(e[a]||Sc,r[a])}class sp{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.type=t.type,this.setValue=function k9(i){switch(i){case 5126:return y9;case 35664:return x9;case 35665:return _9;case 35666:return b9;case 35674:return S9;case 35675:return M9;case 35676:return E9;case 5124:case 35670:return T9;case 35667:case 35671:return w9;case 35668:case 35672:return A9;case 35669:case 35673:return C9;case 5125:return P9;case 36294:return R9;case 36295:return L9;case 36296:return I9;case 35678:case 36198:case 36298:case 36306:case 35682:return D9;case 35679:case 36299:case 36307:return F9;case 35680:case 36300:case 36308:case 36293:return O9;case 36289:case 36303:case 36311:case 36292:return N9}}(t.type)}}class rp{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.type=t.type,this.size=t.size,this.setValue=function ip(i){switch(i){case 5126:return U9;case 35664:return B9;case 35665:return G9;case 35666:return z9;case 35674:return H9;case 35675:return V9;case 35676:return W9;case 5124:case 35670:return X9;case 35667:case 35671:return Y9;case 35668:case 35672:return q9;case 35669:case 35673:return Z9;case 5125:return J9;case 36294:return K9;case 36295:return $9;case 36296:return Q9;case 35678:case 36198:case 36298:case 36306:case 35682:return j9;case 35679:case 36299:case 36307:return ep;case 35680:case 36300:case 36308:case 36293:return tp;case 36289:case 36303:case 36311:case 36292:return np}}(t.type)}}class ap{constructor(e){this.id=e,this.seq=[],this.map={}}setValue(e,t,n){const s=this.seq;for(let r=0,a=s.length;r!==a;++r){const o=s[r];o.setValue(e,t[o.id],n)}}}const F2=/(\w+)(\])?(\[|\.)?/g;function Rc(i,e){i.seq.push(e),i.map[e.id]=e}function op(i,e,t){const n=i.name,s=n.length;for(F2.lastIndex=0;;){const r=F2.exec(n);let o=r[1];const c=r[3];if("]"===r[2]&&(o|=0),void 0===c||"["===c&&F2.lastIndex+2===s){Rc(t,void 0===c?new sp(o,i,e):new rp(o,i,e));break}{let f=t.map[o];void 0===f&&(f=new ap(o),Rc(t,f)),t=f}}}class So{constructor(e,t){this.seq=[],this.map={};const n=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let s=0;s<n;++s){const r=e.getActiveUniform(t,s);op(r,e.getUniformLocation(t,r.name),this)}}setValue(e,t,n,s){const r=this.map[t];void 0!==r&&r.setValue(e,n,s)}setOptional(e,t,n){const s=t[n];void 0!==s&&this.setValue(e,n,s)}static upload(e,t,n,s){for(let r=0,a=t.length;r!==a;++r){const o=t[r],l=n[o.id];!1!==l.needsUpdate&&o.setValue(e,l.value,s)}}static seqWithValue(e,t){const n=[];for(let s=0,r=e.length;s!==r;++s){const a=e[s];a.id in t&&n.push(a)}return n}}function Lc(i,e,t){const n=i.createShader(e);return i.shaderSource(n,t),i.compileShader(n),n}let cp=0;function Ic(i,e,t){const n=i.getShaderParameter(e,i.COMPILE_STATUS),s=i.getShaderInfoLog(e).trim();if(n&&""===s)return"";const r=/ERROR: 0:(\d+)/.exec(s);if(r){const a=parseInt(r[1]);return t.toUpperCase()+"\n\n"+s+"\n\n"+function hp(i,e){const t=i.split("\n"),n=[],s=Math.max(e-6,0),r=Math.min(e+6,t.length);for(let a=s;a<r;a++){const o=a+1;n.push(`${o===e?">":" "} ${o}: ${t[a]}`)}return n.join("\n")}(i.getShaderSource(e),a)}return s}function fp(i,e){const t=function up(i){const e=_t.getPrimaries(_t.workingColorSpace),t=_t.getPrimaries(i);let n;switch(e===t?n="":"p3"===e&&t===Wa?n="LinearDisplayP3ToLinearSRGB":e===Wa&&"p3"===t&&(n="LinearSRGBToLinearDisplayP3"),i){case Fn:case Ha:return[n,"LinearTransferOETF"];case t0:case r2:return[n,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",i),[n,"LinearTransferOETF"]}}(e);return`vec4 ${i}( vec4 value ) { return ${t[0]}( ${t[1]}( value ) ); }`}function dp(i,e){let t;switch(e){case 1:t="Linear";break;case 2:t="Reinhard";break;case 3:t="OptimizedCineon";break;case 4:t="ACESFilmic";break;case 6:t="AgX";break;case 5:t="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),t="Linear"}return"vec3 "+i+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}function Zs(i){return""!==i}function Dc(i,e){const t=e.numSpotLightShadows+e.numSpotLightMaps-e.numSpotLightShadowsWithMaps;return i.replace(/NUM_DIR_LIGHTS/g,e.numDirLights).replace(/NUM_SPOT_LIGHTS/g,e.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,e.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,t).replace(/NUM_RECT_AREA_LIGHTS/g,e.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,e.numPointLights).replace(/NUM_HEMI_LIGHTS/g,e.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,e.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,e.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,e.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,e.numPointLightShadows)}function Fc(i,e){return i.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}const yp=/^[ \t]*#include +<([\w\d./]+)>/gm;function O2(i){return i.replace(yp,_p)}const xp=new Map([["encodings_fragment","colorspace_fragment"],["encodings_pars_fragment","colorspace_pars_fragment"],["output_fragment","opaque_fragment"]]);function _p(i,e){let t=ht[e];if(void 0===t){const n=xp.get(e);if(void 0===n)throw new Error("Can not resolve #include <"+e+">");t=ht[n],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,n)}return O2(t)}const bp=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function Oc(i){return i.replace(bp,Sp)}function Sp(i,e,t,n){let s="";for(let r=parseInt(e);r<parseInt(t);r++)s+=n.replace(/\[\s*i\s*\]/g,"[ "+r+" ]").replace(/UNROLLED_LOOP_INDEX/g,r);return s}function Nc(i){let e=`precision ${i.precision} float;\n\tprecision ${i.precision} int;\n\tprecision ${i.precision} sampler2D;\n\tprecision ${i.precision} samplerCube;\n\t`;return i.isWebGL2&&(e+=`precision ${i.precision} sampler3D;\n\t\tprecision ${i.precision} sampler2DArray;\n\t\tprecision ${i.precision} sampler2DShadow;\n\t\tprecision ${i.precision} samplerCubeShadow;\n\t\tprecision ${i.precision} sampler2DArrayShadow;\n\t\tprecision ${i.precision} isampler2D;\n\t\tprecision ${i.precision} isampler3D;\n\t\tprecision ${i.precision} isamplerCube;\n\t\tprecision ${i.precision} isampler2DArray;\n\t\tprecision ${i.precision} usampler2D;\n\t\tprecision ${i.precision} usampler3D;\n\t\tprecision ${i.precision} usamplerCube;\n\t\tprecision ${i.precision} usampler2DArray;\n\t\t`),"highp"===i.precision?e+="\n#define HIGH_PRECISION":"mediump"===i.precision?e+="\n#define MEDIUM_PRECISION":"lowp"===i.precision&&(e+="\n#define LOW_PRECISION"),e}function Cp(i,e,t,n){const s=i.getContext(),r=t.defines;let a=t.vertexShader,o=t.fragmentShader;const l=function Mp(i){let e="SHADOWMAP_TYPE_BASIC";return 1===i.shadowMapType?e="SHADOWMAP_TYPE_PCF":2===i.shadowMapType?e="SHADOWMAP_TYPE_PCF_SOFT":3===i.shadowMapType&&(e="SHADOWMAP_TYPE_VSM"),e}(t),c=function Ep(i){let e="ENVMAP_TYPE_CUBE";if(i.envMap)switch(i.envMapMode){case 301:case 302:e="ENVMAP_TYPE_CUBE";break;case 306:e="ENVMAP_TYPE_CUBE_UV"}return e}(t),u=function Tp(i){let e="ENVMAP_MODE_REFLECTION";return i.envMap&&302===i.envMapMode&&(e="ENVMAP_MODE_REFRACTION"),e}(t),f=function wp(i){let e="ENVMAP_BLENDING_NONE";if(i.envMap)switch(i.combine){case 0:e="ENVMAP_BLENDING_MULTIPLY";break;case 1:e="ENVMAP_BLENDING_MIX";break;case 2:e="ENVMAP_BLENDING_ADD"}return e}(t),d=function Ap(i){const e=i.envMapCubeUVHeight;if(null===e)return null;const t=Math.log2(e)-2,n=1/e;return{texelWidth:1/(3*Math.max(Math.pow(2,t),112)),texelHeight:n,maxMip:t}}(t),p=t.isWebGL2?"":function pp(i){return[i.extensionDerivatives||i.envMapCubeUVHeight||i.bumpMap||i.normalMapTangentSpace||i.clearcoatNormalMap||i.flatShading||i.alphaToCoverage||"physical"===i.shaderID?"#extension GL_OES_standard_derivatives : enable":"",(i.extensionFragDepth||i.logarithmicDepthBuffer)&&i.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",i.extensionDrawBuffers&&i.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(i.extensionShaderTextureLOD||i.envMap||i.transmission)&&i.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(Zs).join("\n")}(t),m=function mp(i){return[i.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",i.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(Zs).join("\n")}(t),y=function gp(i){const e=[];for(const t in i){const n=i[t];!1!==n&&e.push("#define "+t+" "+n)}return e.join("\n")}(r),v=s.createProgram();let g,_,x=t.glslVersion?"#version "+t.glslVersion+"\n":"";t.isRawShaderMaterial?(g=["#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,y].filter(Zs).join("\n"),g.length>0&&(g+="\n"),_=[p,"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,y].filter(Zs).join("\n"),_.length>0&&(_+="\n")):(g=[Nc(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,y,t.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",t.batching?"#define USE_BATCHING":"",t.instancing?"#define USE_INSTANCING":"",t.instancingColor?"#define USE_INSTANCING_COLOR":"",t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+u:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.displacementMap?"#define USE_DISPLACEMENTMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.mapUv?"#define MAP_UV "+t.mapUv:"",t.alphaMapUv?"#define ALPHAMAP_UV "+t.alphaMapUv:"",t.lightMapUv?"#define LIGHTMAP_UV "+t.lightMapUv:"",t.aoMapUv?"#define AOMAP_UV "+t.aoMapUv:"",t.emissiveMapUv?"#define EMISSIVEMAP_UV "+t.emissiveMapUv:"",t.bumpMapUv?"#define BUMPMAP_UV "+t.bumpMapUv:"",t.normalMapUv?"#define NORMALMAP_UV "+t.normalMapUv:"",t.displacementMapUv?"#define DISPLACEMENTMAP_UV "+t.displacementMapUv:"",t.metalnessMapUv?"#define METALNESSMAP_UV "+t.metalnessMapUv:"",t.roughnessMapUv?"#define ROUGHNESSMAP_UV "+t.roughnessMapUv:"",t.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+t.anisotropyMapUv:"",t.clearcoatMapUv?"#define CLEARCOATMAP_UV "+t.clearcoatMapUv:"",t.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+t.clearcoatNormalMapUv:"",t.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+t.clearcoatRoughnessMapUv:"",t.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+t.iridescenceMapUv:"",t.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+t.iridescenceThicknessMapUv:"",t.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+t.sheenColorMapUv:"",t.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+t.sheenRoughnessMapUv:"",t.specularMapUv?"#define SPECULARMAP_UV "+t.specularMapUv:"",t.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+t.specularColorMapUv:"",t.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+t.specularIntensityMapUv:"",t.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+t.transmissionMapUv:"",t.thicknessMapUv?"#define THICKNESSMAP_UV "+t.thicknessMapUv:"",t.vertexTangents&&!1===t.flatShading?"#define USE_TANGENT":"",t.vertexColors?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.flatShading?"#define FLAT_SHADED":"",t.skinning?"#define USE_SKINNING":"",t.morphTargets?"#define USE_MORPHTARGETS":"",t.morphNormals&&!1===t.flatShading?"#define USE_MORPHNORMALS":"",t.morphColors&&t.isWebGL2?"#define USE_MORPHCOLORS":"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_TEXTURE_STRIDE "+t.morphTextureStride:"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_COUNT "+t.morphTargetsCount:"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.useLegacyLights?"#define LEGACY_LIGHTS":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING","\tattribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR","\tattribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1","\tattribute vec2 uv1;","#endif","#ifdef USE_UV2","\tattribute vec2 uv2;","#endif","#ifdef USE_UV3","\tattribute vec2 uv3;","#endif","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )","\tattribute vec4 color;","#elif defined( USE_COLOR )","\tattribute vec3 color;","#endif","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(Zs).join("\n"),_=[p,Nc(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,y,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+c:"",t.envMap?"#define "+u:"",t.envMap?"#define "+f:"",d?"#define CUBEUV_TEXEL_WIDTH "+d.texelWidth:"",d?"#define CUBEUV_TEXEL_HEIGHT "+d.texelHeight:"",d?"#define CUBEUV_MAX_MIP "+d.maxMip+".0":"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoat?"#define USE_CLEARCOAT":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescence?"#define USE_IRIDESCENCE":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaTest?"#define USE_ALPHATEST":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.sheen?"#define USE_SHEEN":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents&&!1===t.flatShading?"#define USE_TANGENT":"",t.vertexColors||t.instancingColor?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.gradientMap?"#define USE_GRADIENTMAP":"",t.flatShading?"#define FLAT_SHADED":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.useLegacyLights?"#define LEGACY_LIGHTS":"",t.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",0!==t.toneMapping?"#define TONE_MAPPING":"",0!==t.toneMapping?ht.tonemapping_pars_fragment:"",0!==t.toneMapping?dp("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.opaque?"#define OPAQUE":"",ht.colorspace_pars_fragment,fp("linearToOutputTexel",t.outputColorSpace),t.useDepthPacking?"#define DEPTH_PACKING "+t.depthPacking:"","\n"].filter(Zs).join("\n")),a=O2(a),a=Dc(a,t),a=Fc(a,t),o=O2(o),o=Dc(o,t),o=Fc(o,t),a=Oc(a),o=Oc(o),t.isWebGL2&&!0!==t.isRawShaderMaterial&&(x="#version 300 es\n",g=[m,"precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+g,_=["precision mediump sampler2DArray;","#define varying in",t.glslVersion===qa?"":"layout(location = 0) out highp vec4 pc_fragColor;",t.glslVersion===qa?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join("\n")+"\n"+_);const T=x+_+o,E=Lc(s,s.VERTEX_SHADER,x+g+a),M=Lc(s,s.FRAGMENT_SHADER,T);function w(X){if(i.debug.checkShaderErrors){const te=s.getProgramInfoLog(v).trim(),U=s.getShaderInfoLog(E).trim(),z=s.getShaderInfoLog(M).trim();let G=!0,ee=!0;if(!1===s.getProgramParameter(v,s.LINK_STATUS))if(G=!1,"function"==typeof i.debug.onShaderError)i.debug.onShaderError(s,v,E,M);else{const J=Ic(s,E,"vertex"),Z=Ic(s,M,"fragment");console.error("THREE.WebGLProgram: Shader Error "+s.getError()+" - VALIDATE_STATUS "+s.getProgramParameter(v,s.VALIDATE_STATUS)+"\n\nMaterial Name: "+X.name+"\nMaterial Type: "+X.type+"\n\nProgram Info Log: "+te+"\n"+J+"\n"+Z)}else""!==te?console.warn("THREE.WebGLProgram: Program Info Log:",te):(""===U||""===z)&&(ee=!1);ee&&(X.diagnostics={runnable:G,programLog:te,vertexShader:{log:U,prefix:g},fragmentShader:{log:z,prefix:_}})}s.deleteShader(E),s.deleteShader(M),I=new So(s,v),S=function vp(i,e){const t={},n=i.getProgramParameter(e,i.ACTIVE_ATTRIBUTES);for(let s=0;s<n;s++){const r=i.getActiveAttrib(e,s),a=r.name;let o=1;r.type===i.FLOAT_MAT2&&(o=2),r.type===i.FLOAT_MAT3&&(o=3),r.type===i.FLOAT_MAT4&&(o=4),t[a]={type:r.type,location:i.getAttribLocation(e,a),locationSize:o}}return t}(s,v)}let I,S;s.attachShader(v,E),s.attachShader(v,M),void 0!==t.index0AttributeName?s.bindAttribLocation(v,0,t.index0AttributeName):!0===t.morphTargets&&s.bindAttribLocation(v,0,"position"),s.linkProgram(v),this.getUniforms=function(){return void 0===I&&w(this),I},this.getAttributes=function(){return void 0===S&&w(this),S};let P=!1===t.rendererExtensionParallelShaderCompile;return this.isReady=function(){return!1===P&&(P=s.getProgramParameter(v,37297)),P},this.destroy=function(){n.releaseStatesOfProgram(this),s.deleteProgram(v),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=cp++,this.cacheKey=e,this.usedTimes=1,this.program=v,this.vertexShader=E,this.fragmentShader=M,this}let Pp=0;class Rp{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const n=e.fragmentShader,s=this._getShaderStage(e.vertexShader),r=this._getShaderStage(n),a=this._getShaderCacheForMaterial(e);return!1===a.has(s)&&(a.add(s),s.usedTimes++),!1===a.has(r)&&(a.add(r),r.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const n of t)n.usedTimes--,0===n.usedTimes&&this.shaderCache.delete(n.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const t=this.materialCache;let n=t.get(e);return void 0===n&&(n=new Set,t.set(e,n)),n}_getShaderStage(e){const t=this.shaderCache;let n=t.get(e);return void 0===n&&(n=new Lp(e),t.set(e,n)),n}}class Lp{constructor(e){this.id=Pp++,this.code=e,this.usedTimes=0}}function Ip(i,e,t,n,s,r,a){const o=new x2,l=new Rp,c=new Set,u=[],f=s.isWebGL2,d=s.logarithmicDepthBuffer,p=s.vertexTextures;let m=s.precision;const y={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function v(S){return c.add(S),0===S?"uv":`uv${S}`}return{getParameters:function g(S,P,X,te,U){const z=te.fog,G=U.geometry,J=(S.isMeshStandardMaterial?t:e).get(S.envMap||(S.isMeshStandardMaterial?te.environment:null)),Z=J&&306===J.mapping?J.image.height:null,ne=y[S.type];null!==S.precision&&(m=s.getMaxPrecision(S.precision),m!==S.precision&&console.warn("THREE.WebGLProgram.getParameters:",S.precision,"not supported, using",m,"instead."));const Y=G.morphAttributes.position||G.morphAttributes.normal||G.morphAttributes.color,he=void 0!==Y?Y.length:0;let Q,ae,xe,Ee,Ce=0;if(void 0!==G.morphAttributes.position&&(Ce=1),void 0!==G.morphAttributes.normal&&(Ce=2),void 0!==G.morphAttributes.color&&(Ce=3),ne){const wt=xn[ne];Q=wt.vertexShader,ae=wt.fragmentShader}else Q=S.vertexShader,ae=S.fragmentShader,l.update(S),xe=l.getVertexShaderID(S),Ee=l.getFragmentShaderID(S);const Le=i.getRenderTarget(),Fe=!0===U.isInstancedMesh,He=!!S.map,fe=!!J,se=!!S.aoMap,ue=!!S.lightMap,re=!!S.bumpMap,Be=!!S.normalMap,_e=!!S.displacementMap,R=!!S.emissiveMap,C=!!S.metalnessMap,V=!!S.roughnessMap,ce=S.anisotropy>0,le=S.clearcoat>0,oe=S.iridescence>0,De=S.sheen>0,ve=S.transmission>0,we=ce&&!!S.anisotropyMap,We=le&&!!S.clearcoatMap,st=le&&!!S.clearcoatNormalMap,D=le&&!!S.clearcoatRoughnessMap,ge=oe&&!!S.iridescenceMap,Se=oe&&!!S.iridescenceThicknessMap,Ie=De&&!!S.sheenColorMap,Oe=De&&!!S.sheenRoughnessMap,Te=!!S.specularMap,nt=!!S.specularColorMap,gt=!!S.specularIntensityMap,mt=ve&&!!S.transmissionMap,Qe=ve&&!!S.thicknessMap,k=!!S.alphaMap,Ue=!!S.extensions;let qe=0;S.toneMapped&&(null===Le||!0===Le.isXRRenderTarget)&&(qe=i.toneMapping);const xt={isWebGL2:f,shaderID:ne,shaderType:S.type,shaderName:S.name,vertexShader:Q,fragmentShader:ae,defines:S.defines,customVertexShaderID:xe,customFragmentShaderID:Ee,isRawShaderMaterial:!0===S.isRawShaderMaterial,glslVersion:S.glslVersion,precision:m,batching:!0===U.isBatchedMesh,instancing:Fe,instancingColor:Fe&&null!==U.instanceColor,supportsVertexTextures:p,outputColorSpace:null===Le?i.outputColorSpace:!0===Le.isXRRenderTarget?Le.texture.colorSpace:Fn,alphaToCoverage:!!S.alphaToCoverage,map:He,matcap:!!S.matcap,envMap:fe,envMapMode:fe&&J.mapping,envMapCubeUVHeight:Z,aoMap:se,lightMap:ue,bumpMap:re,normalMap:Be,displacementMap:p&&_e,emissiveMap:R,normalMapObjectSpace:Be&&1===S.normalMapType,normalMapTangentSpace:Be&&0===S.normalMapType,metalnessMap:C,roughnessMap:V,anisotropy:ce,anisotropyMap:we,clearcoat:le,clearcoatMap:We,clearcoatNormalMap:st,clearcoatRoughnessMap:D,iridescence:oe,iridescenceMap:ge,iridescenceThicknessMap:Se,sheen:De,sheenColorMap:Ie,sheenRoughnessMap:Oe,specularMap:Te,specularColorMap:nt,specularIntensityMap:gt,transmission:ve,transmissionMap:mt,thicknessMap:Qe,gradientMap:!!S.gradientMap,opaque:!1===S.transparent&&1===S.blending&&!1===S.alphaToCoverage,alphaMap:k,alphaTest:S.alphaTest>0,alphaHash:!!S.alphaHash,combine:S.combine,mapUv:He&&v(S.map.channel),aoMapUv:se&&v(S.aoMap.channel),lightMapUv:ue&&v(S.lightMap.channel),bumpMapUv:re&&v(S.bumpMap.channel),normalMapUv:Be&&v(S.normalMap.channel),displacementMapUv:_e&&v(S.displacementMap.channel),emissiveMapUv:R&&v(S.emissiveMap.channel),metalnessMapUv:C&&v(S.metalnessMap.channel),roughnessMapUv:V&&v(S.roughnessMap.channel),anisotropyMapUv:we&&v(S.anisotropyMap.channel),clearcoatMapUv:We&&v(S.clearcoatMap.channel),clearcoatNormalMapUv:st&&v(S.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:D&&v(S.clearcoatRoughnessMap.channel),iridescenceMapUv:ge&&v(S.iridescenceMap.channel),iridescenceThicknessMapUv:Se&&v(S.iridescenceThicknessMap.channel),sheenColorMapUv:Ie&&v(S.sheenColorMap.channel),sheenRoughnessMapUv:Oe&&v(S.sheenRoughnessMap.channel),specularMapUv:Te&&v(S.specularMap.channel),specularColorMapUv:nt&&v(S.specularColorMap.channel),specularIntensityMapUv:gt&&v(S.specularIntensityMap.channel),transmissionMapUv:mt&&v(S.transmissionMap.channel),thicknessMapUv:Qe&&v(S.thicknessMap.channel),alphaMapUv:k&&v(S.alphaMap.channel),vertexTangents:!!G.attributes.tangent&&(Be||ce),vertexColors:S.vertexColors,vertexAlphas:!0===S.vertexColors&&!!G.attributes.color&&4===G.attributes.color.itemSize,pointsUvs:!0===U.isPoints&&!!G.attributes.uv&&(He||k),fog:!!z,useFog:!0===S.fog,fogExp2:!!z&&z.isFogExp2,flatShading:!0===S.flatShading,sizeAttenuation:!0===S.sizeAttenuation,logarithmicDepthBuffer:d,skinning:!0===U.isSkinnedMesh,morphTargets:void 0!==G.morphAttributes.position,morphNormals:void 0!==G.morphAttributes.normal,morphColors:void 0!==G.morphAttributes.color,morphTargetsCount:he,morphTextureStride:Ce,numDirLights:P.directional.length,numPointLights:P.point.length,numSpotLights:P.spot.length,numSpotLightMaps:P.spotLightMap.length,numRectAreaLights:P.rectArea.length,numHemiLights:P.hemi.length,numDirLightShadows:P.directionalShadowMap.length,numPointLightShadows:P.pointShadowMap.length,numSpotLightShadows:P.spotShadowMap.length,numSpotLightShadowsWithMaps:P.numSpotLightShadowsWithMaps,numLightProbes:P.numLightProbes,numClippingPlanes:a.numPlanes,numClipIntersection:a.numIntersection,dithering:S.dithering,shadowMapEnabled:i.shadowMap.enabled&&X.length>0,shadowMapType:i.shadowMap.type,toneMapping:qe,useLegacyLights:i._useLegacyLights,decodeVideoTexture:He&&!0===S.map.isVideoTexture&&_t.getTransfer(S.map.colorSpace)===Ct,premultipliedAlpha:S.premultipliedAlpha,doubleSided:2===S.side,flipSided:1===S.side,useDepthPacking:S.depthPacking>=0,depthPacking:S.depthPacking||0,index0AttributeName:S.index0AttributeName,extensionDerivatives:Ue&&!0===S.extensions.derivatives,extensionFragDepth:Ue&&!0===S.extensions.fragDepth,extensionDrawBuffers:Ue&&!0===S.extensions.drawBuffers,extensionShaderTextureLOD:Ue&&!0===S.extensions.shaderTextureLOD,extensionClipCullDistance:Ue&&!0===S.extensions.clipCullDistance&&n.has("WEBGL_clip_cull_distance"),extensionMultiDraw:Ue&&!0===S.extensions.multiDraw&&n.has("WEBGL_multi_draw"),rendererExtensionFragDepth:f||n.has("EXT_frag_depth"),rendererExtensionDrawBuffers:f||n.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:f||n.has("EXT_shader_texture_lod"),rendererExtensionParallelShaderCompile:n.has("KHR_parallel_shader_compile"),customProgramCacheKey:S.customProgramCacheKey()};return xt.vertexUv1s=c.has(1),xt.vertexUv2s=c.has(2),xt.vertexUv3s=c.has(3),c.clear(),xt},getProgramCacheKey:function _(S){const P=[];if(S.shaderID?P.push(S.shaderID):(P.push(S.customVertexShaderID),P.push(S.customFragmentShaderID)),void 0!==S.defines)for(const X in S.defines)P.push(X),P.push(S.defines[X]);return!1===S.isRawShaderMaterial&&(function x(S,P){S.push(P.precision),S.push(P.outputColorSpace),S.push(P.envMapMode),S.push(P.envMapCubeUVHeight),S.push(P.mapUv),S.push(P.alphaMapUv),S.push(P.lightMapUv),S.push(P.aoMapUv),S.push(P.bumpMapUv),S.push(P.normalMapUv),S.push(P.displacementMapUv),S.push(P.emissiveMapUv),S.push(P.metalnessMapUv),S.push(P.roughnessMapUv),S.push(P.anisotropyMapUv),S.push(P.clearcoatMapUv),S.push(P.clearcoatNormalMapUv),S.push(P.clearcoatRoughnessMapUv),S.push(P.iridescenceMapUv),S.push(P.iridescenceThicknessMapUv),S.push(P.sheenColorMapUv),S.push(P.sheenRoughnessMapUv),S.push(P.specularMapUv),S.push(P.specularColorMapUv),S.push(P.specularIntensityMapUv),S.push(P.transmissionMapUv),S.push(P.thicknessMapUv),S.push(P.combine),S.push(P.fogExp2),S.push(P.sizeAttenuation),S.push(P.morphTargetsCount),S.push(P.morphAttributeCount),S.push(P.numDirLights),S.push(P.numPointLights),S.push(P.numSpotLights),S.push(P.numSpotLightMaps),S.push(P.numHemiLights),S.push(P.numRectAreaLights),S.push(P.numDirLightShadows),S.push(P.numPointLightShadows),S.push(P.numSpotLightShadows),S.push(P.numSpotLightShadowsWithMaps),S.push(P.numLightProbes),S.push(P.shadowMapType),S.push(P.toneMapping),S.push(P.numClippingPlanes),S.push(P.numClipIntersection),S.push(P.depthPacking)}(P,S),function b(S,P){o.disableAll(),P.isWebGL2&&o.enable(0),P.supportsVertexTextures&&o.enable(1),P.instancing&&o.enable(2),P.instancingColor&&o.enable(3),P.matcap&&o.enable(4),P.envMap&&o.enable(5),P.normalMapObjectSpace&&o.enable(6),P.normalMapTangentSpace&&o.enable(7),P.clearcoat&&o.enable(8),P.iridescence&&o.enable(9),P.alphaTest&&o.enable(10),P.vertexColors&&o.enable(11),P.vertexAlphas&&o.enable(12),P.vertexUv1s&&o.enable(13),P.vertexUv2s&&o.enable(14),P.vertexUv3s&&o.enable(15),P.vertexTangents&&o.enable(16),P.anisotropy&&o.enable(17),P.alphaHash&&o.enable(18),P.batching&&o.enable(19),S.push(o.mask),o.disableAll(),P.fog&&o.enable(0),P.useFog&&o.enable(1),P.flatShading&&o.enable(2),P.logarithmicDepthBuffer&&o.enable(3),P.skinning&&o.enable(4),P.morphTargets&&o.enable(5),P.morphNormals&&o.enable(6),P.morphColors&&o.enable(7),P.premultipliedAlpha&&o.enable(8),P.shadowMapEnabled&&o.enable(9),P.useLegacyLights&&o.enable(10),P.doubleSided&&o.enable(11),P.flipSided&&o.enable(12),P.useDepthPacking&&o.enable(13),P.dithering&&o.enable(14),P.transmission&&o.enable(15),P.sheen&&o.enable(16),P.opaque&&o.enable(17),P.pointsUvs&&o.enable(18),P.decodeVideoTexture&&o.enable(19),P.alphaToCoverage&&o.enable(20),S.push(o.mask)}(P,S),P.push(i.outputColorSpace)),P.push(S.customProgramCacheKey),P.join()},getUniforms:function T(S){const P=y[S.type];let X;return X=P?Zf.clone(xn[P].uniforms):S.uniforms,X},acquireProgram:function E(S,P){let X;for(let te=0,U=u.length;te<U;te++){const z=u[te];if(z.cacheKey===P){X=z,++X.usedTimes;break}}return void 0===X&&(X=new Cp(i,P,S,r),u.push(X)),X},releaseProgram:function M(S){if(0===--S.usedTimes){const P=u.indexOf(S);u[P]=u[u.length-1],u.pop(),S.destroy()}},releaseShaderCache:function w(S){l.remove(S)},programs:u,dispose:function I(){l.dispose()}}}function Dp(){let i=new WeakMap;return{get:function e(r){let a=i.get(r);return void 0===a&&(a={},i.set(r,a)),a},remove:function t(r){i.delete(r)},update:function n(r,a,o){i.get(r)[a]=o},dispose:function s(){i=new WeakMap}}}function Fp(i,e){return i.groupOrder!==e.groupOrder?i.groupOrder-e.groupOrder:i.renderOrder!==e.renderOrder?i.renderOrder-e.renderOrder:i.material.id!==e.material.id?i.material.id-e.material.id:i.z!==e.z?i.z-e.z:i.id-e.id}function kc(i,e){return i.groupOrder!==e.groupOrder?i.groupOrder-e.groupOrder:i.renderOrder!==e.renderOrder?i.renderOrder-e.renderOrder:i.z!==e.z?e.z-i.z:i.id-e.id}function Uc(){const i=[];let e=0;const t=[],n=[],s=[];function a(f,d,p,m,y,v){let g=i[e];return void 0===g?(g={id:f.id,object:f,geometry:d,material:p,groupOrder:m,renderOrder:f.renderOrder,z:y,group:v},i[e]=g):(g.id=f.id,g.object=f,g.geometry=d,g.material=p,g.groupOrder=m,g.renderOrder=f.renderOrder,g.z=y,g.group=v),e++,g}return{opaque:t,transmissive:n,transparent:s,init:function r(){e=0,t.length=0,n.length=0,s.length=0},push:function o(f,d,p,m,y,v){const g=a(f,d,p,m,y,v);p.transmission>0?n.push(g):!0===p.transparent?s.push(g):t.push(g)},unshift:function l(f,d,p,m,y,v){const g=a(f,d,p,m,y,v);p.transmission>0?n.unshift(g):!0===p.transparent?s.unshift(g):t.unshift(g)},finish:function u(){for(let f=e,d=i.length;f<d;f++){const p=i[f];if(null===p.id)break;p.id=null,p.object=null,p.geometry=null,p.material=null,p.group=null}},sort:function c(f,d){t.length>1&&t.sort(f||Fp),n.length>1&&n.sort(d||kc),s.length>1&&s.sort(d||kc)}}}function Op(){let i=new WeakMap;return{get:function e(n,s){const r=i.get(n);let a;return void 0===r?(a=new Uc,i.set(n,[a])):s>=r.length?(a=new Uc,r.push(a)):a=r[s],a},dispose:function t(){i=new WeakMap}}}function Np(){const i={};return{get:function(e){if(void 0!==i[e.id])return i[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new F,color:new be};break;case"SpotLight":t={position:new F,direction:new F,color:new be,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new F,color:new be,distance:0,decay:0};break;case"HemisphereLight":t={direction:new F,skyColor:new be,groundColor:new be};break;case"RectAreaLight":t={color:new be,position:new F,halfWidth:new F,halfHeight:new F}}return i[e.id]=t,t}}}let Up=0;function Bp(i,e){return(e.castShadow?2:0)-(i.castShadow?2:0)+(e.map?1:0)-(i.map?1:0)}function Gp(i,e){const t=new Np,n=function kp(){const i={};return{get:function(e){if(void 0!==i[e.id])return i[e.id];let t;switch(e.type){case"DirectionalLight":case"SpotLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new H};break;case"PointLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new H,shadowCameraNear:1,shadowCameraFar:1e3}}return i[e.id]=t,t}}}(),s={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let u=0;u<9;u++)s.probe.push(new F);const r=new F,a=new $e,o=new $e;return{setup:function l(u,f){let d=0,p=0,m=0;for(let X=0;X<9;X++)s.probe[X].set(0,0,0);let y=0,v=0,g=0,_=0,x=0,b=0,T=0,E=0,M=0,w=0,I=0;u.sort(Bp);const S=!0===f?Math.PI:1;for(let X=0,te=u.length;X<te;X++){const U=u[X],z=U.color,G=U.intensity,ee=U.distance,J=U.shadow&&U.shadow.map?U.shadow.map.texture:null;if(U.isAmbientLight)d+=z.r*G*S,p+=z.g*G*S,m+=z.b*G*S;else if(U.isLightProbe){for(let Z=0;Z<9;Z++)s.probe[Z].addScaledVector(U.sh.coefficients[Z],G);I++}else if(U.isDirectionalLight){const Z=t.get(U);if(Z.color.copy(U.color).multiplyScalar(U.intensity*S),U.castShadow){const ne=U.shadow,Y=n.get(U);Y.shadowBias=ne.bias,Y.shadowNormalBias=ne.normalBias,Y.shadowRadius=ne.radius,Y.shadowMapSize=ne.mapSize,s.directionalShadow[y]=Y,s.directionalShadowMap[y]=J,s.directionalShadowMatrix[y]=U.shadow.matrix,b++}s.directional[y]=Z,y++}else if(U.isSpotLight){const Z=t.get(U);Z.position.setFromMatrixPosition(U.matrixWorld),Z.color.copy(z).multiplyScalar(G*S),Z.distance=ee,Z.coneCos=Math.cos(U.angle),Z.penumbraCos=Math.cos(U.angle*(1-U.penumbra)),Z.decay=U.decay,s.spot[g]=Z;const ne=U.shadow;if(U.map&&(s.spotLightMap[M]=U.map,M++,ne.updateMatrices(U),U.castShadow&&w++),s.spotLightMatrix[g]=ne.matrix,U.castShadow){const Y=n.get(U);Y.shadowBias=ne.bias,Y.shadowNormalBias=ne.normalBias,Y.shadowRadius=ne.radius,Y.shadowMapSize=ne.mapSize,s.spotShadow[g]=Y,s.spotShadowMap[g]=J,E++}g++}else if(U.isRectAreaLight){const Z=t.get(U);Z.color.copy(z).multiplyScalar(G),Z.halfWidth.set(.5*U.width,0,0),Z.halfHeight.set(0,.5*U.height,0),s.rectArea[_]=Z,_++}else if(U.isPointLight){const Z=t.get(U);if(Z.color.copy(U.color).multiplyScalar(U.intensity*S),Z.distance=U.distance,Z.decay=U.decay,U.castShadow){const ne=U.shadow,Y=n.get(U);Y.shadowBias=ne.bias,Y.shadowNormalBias=ne.normalBias,Y.shadowRadius=ne.radius,Y.shadowMapSize=ne.mapSize,Y.shadowCameraNear=ne.camera.near,Y.shadowCameraFar=ne.camera.far,s.pointShadow[v]=Y,s.pointShadowMap[v]=J,s.pointShadowMatrix[v]=U.shadow.matrix,T++}s.point[v]=Z,v++}else if(U.isHemisphereLight){const Z=t.get(U);Z.skyColor.copy(U.color).multiplyScalar(G*S),Z.groundColor.copy(U.groundColor).multiplyScalar(G*S),s.hemi[x]=Z,x++}}_>0&&(e.isWebGL2?!0===i.has("OES_texture_float_linear")?(s.rectAreaLTC1=me.LTC_FLOAT_1,s.rectAreaLTC2=me.LTC_FLOAT_2):(s.rectAreaLTC1=me.LTC_HALF_1,s.rectAreaLTC2=me.LTC_HALF_2):!0===i.has("OES_texture_float_linear")?(s.rectAreaLTC1=me.LTC_FLOAT_1,s.rectAreaLTC2=me.LTC_FLOAT_2):!0===i.has("OES_texture_half_float_linear")?(s.rectAreaLTC1=me.LTC_HALF_1,s.rectAreaLTC2=me.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),s.ambient[0]=d,s.ambient[1]=p,s.ambient[2]=m;const P=s.hash;(P.directionalLength!==y||P.pointLength!==v||P.spotLength!==g||P.rectAreaLength!==_||P.hemiLength!==x||P.numDirectionalShadows!==b||P.numPointShadows!==T||P.numSpotShadows!==E||P.numSpotMaps!==M||P.numLightProbes!==I)&&(s.directional.length=y,s.spot.length=g,s.rectArea.length=_,s.point.length=v,s.hemi.length=x,s.directionalShadow.length=b,s.directionalShadowMap.length=b,s.pointShadow.length=T,s.pointShadowMap.length=T,s.spotShadow.length=E,s.spotShadowMap.length=E,s.directionalShadowMatrix.length=b,s.pointShadowMatrix.length=T,s.spotLightMatrix.length=E+M-w,s.spotLightMap.length=M,s.numSpotLightShadowsWithMaps=w,s.numLightProbes=I,P.directionalLength=y,P.pointLength=v,P.spotLength=g,P.rectAreaLength=_,P.hemiLength=x,P.numDirectionalShadows=b,P.numPointShadows=T,P.numSpotShadows=E,P.numSpotMaps=M,P.numLightProbes=I,s.version=Up++)},setupView:function c(u,f){let d=0,p=0,m=0,y=0,v=0;const g=f.matrixWorldInverse;for(let _=0,x=u.length;_<x;_++){const b=u[_];if(b.isDirectionalLight){const T=s.directional[d];T.direction.setFromMatrixPosition(b.matrixWorld),r.setFromMatrixPosition(b.target.matrixWorld),T.direction.sub(r),T.direction.transformDirection(g),d++}else if(b.isSpotLight){const T=s.spot[m];T.position.setFromMatrixPosition(b.matrixWorld),T.position.applyMatrix4(g),T.direction.setFromMatrixPosition(b.matrixWorld),r.setFromMatrixPosition(b.target.matrixWorld),T.direction.sub(r),T.direction.transformDirection(g),m++}else if(b.isRectAreaLight){const T=s.rectArea[y];T.position.setFromMatrixPosition(b.matrixWorld),T.position.applyMatrix4(g),o.identity(),a.copy(b.matrixWorld),a.premultiply(g),o.extractRotation(a),T.halfWidth.set(.5*b.width,0,0),T.halfHeight.set(0,.5*b.height,0),T.halfWidth.applyMatrix4(o),T.halfHeight.applyMatrix4(o),y++}else if(b.isPointLight){const T=s.point[p];T.position.setFromMatrixPosition(b.matrixWorld),T.position.applyMatrix4(g),p++}else if(b.isHemisphereLight){const T=s.hemi[v];T.direction.setFromMatrixPosition(b.matrixWorld),T.direction.transformDirection(g),v++}}},state:s}}function Bc(i,e){const t=new Gp(i,e),n=[],s=[];return{init:function r(){n.length=0,s.length=0},state:{lightsArray:n,shadowsArray:s,lights:t},setupLights:function l(f){t.setup(n,f)},setupLightsView:function c(f){t.setupView(n,f)},pushLight:function a(f){n.push(f)},pushShadow:function o(f){s.push(f)}}}function zp(i,e){let t=new WeakMap;return{get:function n(r,a=0){const o=t.get(r);let l;return void 0===o?(l=new Bc(i,e),t.set(r,[l])):a>=o.length?(l=new Bc(i,e),o.push(l)):l=o[a],l},dispose:function s(){t=new WeakMap}}}class Gc extends y0{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=3200,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}class zc extends y0{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}function Wp(i,e,t){let n=new vo;const s=new H,r=new H,a=new bt,o=new Gc({depthPacking:3201}),l=new zc,c={},u=t.maxTextureSize,f={[jn]:1,[w0]:0,[mn]:2},d=new yn({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new H},radius:{value:4}},vertexShader:"void main() {\n\tgl_Position = vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include <packing>\nvoid main() {\n\tconst float samples = float( VSM_SAMPLES );\n\tfloat mean = 0.0;\n\tfloat squared_mean = 0.0;\n\tfloat uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );\n\tfloat uvStart = samples <= 1.0 ? 0.0 : - 1.0;\n\tfor ( float i = 0.0; i < samples; i ++ ) {\n\t\tfloat uvOffset = uvStart + i * uvStride;\n\t\t#ifdef HORIZONTAL_PASS\n\t\t\tvec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) );\n\t\t\tmean += distribution.x;\n\t\t\tsquared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n\t\t#else\n\t\t\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) );\n\t\t\tmean += depth;\n\t\t\tsquared_mean += depth * depth;\n\t\t#endif\n\t}\n\tmean = mean / samples;\n\tsquared_mean = squared_mean / samples;\n\tfloat std_dev = sqrt( squared_mean - mean * mean );\n\tgl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}"}),p=d.clone();p.defines.HORIZONTAL_PASS=1;const m=new ct;m.setAttribute("position",new vt(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const y=new $t(m,d),v=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=1;let g=this.type;function _(E,M){const w=e.update(y);d.defines.VSM_SAMPLES!==E.blurSamples&&(d.defines.VSM_SAMPLES=E.blurSamples,p.defines.VSM_SAMPLES=E.blurSamples,d.needsUpdate=!0,p.needsUpdate=!0),null===E.mapPass&&(E.mapPass=new vn(s.x,s.y)),d.uniforms.shadow_pass.value=E.map.texture,d.uniforms.resolution.value=E.mapSize,d.uniforms.radius.value=E.radius,i.setRenderTarget(E.mapPass),i.clear(),i.renderBufferDirect(M,null,w,d,y,null),p.uniforms.shadow_pass.value=E.mapPass.texture,p.uniforms.resolution.value=E.mapSize,p.uniforms.radius.value=E.radius,i.setRenderTarget(E.map),i.clear(),i.renderBufferDirect(M,null,w,p,y,null)}function x(E,M,w,I){let S=null;const P=!0===w.isPointLight?E.customDistanceMaterial:E.customDepthMaterial;if(void 0!==P)S=P;else if(S=!0===w.isPointLight?l:o,i.localClippingEnabled&&!0===M.clipShadows&&Array.isArray(M.clippingPlanes)&&0!==M.clippingPlanes.length||M.displacementMap&&0!==M.displacementScale||M.alphaMap&&M.alphaTest>0||M.map&&M.alphaTest>0){const X=S.uuid,te=M.uuid;let U=c[X];void 0===U&&(U={},c[X]=U);let z=U[te];void 0===z&&(z=S.clone(),U[te]=z,M.addEventListener("dispose",T)),S=z}return S.visible=M.visible,S.wireframe=M.wireframe,S.side=3===I?null!==M.shadowSide?M.shadowSide:M.side:null!==M.shadowSide?M.shadowSide:f[M.side],S.alphaMap=M.alphaMap,S.alphaTest=M.alphaTest,S.map=M.map,S.clipShadows=M.clipShadows,S.clippingPlanes=M.clippingPlanes,S.clipIntersection=M.clipIntersection,S.displacementMap=M.displacementMap,S.displacementScale=M.displacementScale,S.displacementBias=M.displacementBias,S.wireframeLinewidth=M.wireframeLinewidth,S.linewidth=M.linewidth,!0===w.isPointLight&&!0===S.isMeshDistanceMaterial&&(i.properties.get(S).light=w),S}function b(E,M,w,I,S){if(!1===E.visible)return;if(E.layers.test(M.layers)&&(E.isMesh||E.isLine||E.isPoints)&&(E.castShadow||E.receiveShadow&&3===S)&&(!E.frustumCulled||n.intersectsObject(E))){E.modelViewMatrix.multiplyMatrices(w.matrixWorldInverse,E.matrixWorld);const te=e.update(E),U=E.material;if(Array.isArray(U)){const z=te.groups;for(let G=0,ee=z.length;G<ee;G++){const J=z[G],Z=U[J.materialIndex];if(Z&&Z.visible){const ne=x(E,Z,I,S);E.onBeforeShadow(i,E,M,w,te,ne,J),i.renderBufferDirect(w,null,te,ne,E,J),E.onAfterShadow(i,E,M,w,te,ne,J)}}}else if(U.visible){const z=x(E,U,I,S);E.onBeforeShadow(i,E,M,w,te,z,null),i.renderBufferDirect(w,null,te,z,E,null),E.onAfterShadow(i,E,M,w,te,z,null)}}const X=E.children;for(let te=0,U=X.length;te<U;te++)b(X[te],M,w,I,S)}function T(E){E.target.removeEventListener("dispose",T);for(const w in c){const I=c[w],S=E.target.uuid;S in I&&(I[S].dispose(),delete I[S])}}this.render=function(E,M,w){if(!1===v.enabled||!1===v.autoUpdate&&!1===v.needsUpdate||0===E.length)return;const I=i.getRenderTarget(),S=i.getActiveCubeFace(),P=i.getActiveMipmapLevel(),X=i.state;X.setBlending(0),X.buffers.color.setClear(1,1,1,1),X.buffers.depth.setTest(!0),X.setScissorTest(!1);const te=3!==g&&3===this.type,U=3===g&&3!==this.type;for(let z=0,G=E.length;z<G;z++){const ee=E[z],J=ee.shadow;if(void 0===J){console.warn("THREE.WebGLShadowMap:",ee,"has no shadow.");continue}if(!1===J.autoUpdate&&!1===J.needsUpdate)continue;s.copy(J.mapSize);const Z=J.getFrameExtents();if(s.multiply(Z),r.copy(J.mapSize),(s.x>u||s.y>u)&&(s.x>u&&(r.x=Math.floor(u/Z.x),s.x=r.x*Z.x,J.mapSize.x=r.x),s.y>u&&(r.y=Math.floor(u/Z.y),s.y=r.y*Z.y,J.mapSize.y=r.y)),null===J.map||!0===te||!0===U){const Y=3!==this.type?{minFilter:Jt,magFilter:Jt}:{};null!==J.map&&J.map.dispose(),J.map=new vn(s.x,s.y,Y),J.map.texture.name=ee.name+".shadowMap",J.camera.updateProjectionMatrix()}i.setRenderTarget(J.map),i.clear();const ne=J.getViewportCount();for(let Y=0;Y<ne;Y++){const he=J.getViewport(Y);a.set(r.x*he.x,r.y*he.y,r.x*he.z,r.y*he.w),X.viewport(a),J.updateMatrices(ee,Y),n=J.getFrustum(),b(M,w,J.camera,ee,this.type)}!0!==J.isPointLightShadow&&3===this.type&&_(J,w),J.needsUpdate=!1}g=this.type,v.needsUpdate=!1,i.setRenderTarget(I,S,P)}}function Xp(i,e,t){const n=t.isWebGL2,o=new function s(){let k=!1;const de=new bt;let pe=null;const Ue=new bt(0,0,0,0);return{setMask:function(qe){pe!==qe&&!k&&(i.colorMask(qe,qe,qe,qe),pe=qe)},setLocked:function(qe){k=qe},setClear:function(qe,xt,wt,r0,K0){!0===K0&&(qe*=r0,xt*=r0,wt*=r0),de.set(qe,xt,wt,r0),!1===Ue.equals(de)&&(i.clearColor(qe,xt,wt,r0),Ue.copy(de))},reset:function(){k=!1,pe=null,Ue.set(-1,0,0,0)}}},l=new function r(){let k=!1,de=null,pe=null,Ue=null;return{setTest:function(qe){qe?Fe(i.DEPTH_TEST):tt(i.DEPTH_TEST)},setMask:function(qe){de!==qe&&!k&&(i.depthMask(qe),de=qe)},setFunc:function(qe){if(pe!==qe){switch(qe){case 0:i.depthFunc(i.NEVER);break;case 1:i.depthFunc(i.ALWAYS);break;case 2:i.depthFunc(i.LESS);break;case 3:default:i.depthFunc(i.LEQUAL);break;case 4:i.depthFunc(i.EQUAL);break;case 5:i.depthFunc(i.GEQUAL);break;case 6:i.depthFunc(i.GREATER);break;case 7:i.depthFunc(i.NOTEQUAL)}pe=qe}},setLocked:function(qe){k=qe},setClear:function(qe){Ue!==qe&&(i.clearDepth(qe),Ue=qe)},reset:function(){k=!1,de=null,pe=null,Ue=null}}},c=new function a(){let k=!1,de=null,pe=null,Ue=null,qe=null,xt=null,wt=null,r0=null,K0=null;return{setTest:function(At){k||(At?Fe(i.STENCIL_TEST):tt(i.STENCIL_TEST))},setMask:function(At){de!==At&&!k&&(i.stencilMask(At),de=At)},setFunc:function(At,T0,Cn){(pe!==At||Ue!==T0||qe!==Cn)&&(i.stencilFunc(At,T0,Cn),pe=At,Ue=T0,qe=Cn)},setOp:function(At,T0,Cn){(xt!==At||wt!==T0||r0!==Cn)&&(i.stencilOp(At,T0,Cn),xt=At,wt=T0,r0=Cn)},setLocked:function(At){k=At},setClear:function(At){K0!==At&&(i.clearStencil(At),K0=At)},reset:function(){k=!1,de=null,pe=null,Ue=null,qe=null,xt=null,wt=null,r0=null,K0=null}}},u=new WeakMap,f=new WeakMap;let d={},p={},m=new WeakMap,y=[],v=null,g=!1,_=null,x=null,b=null,T=null,E=null,M=null,w=null,I=new be(0,0,0),S=0,P=!1,X=null,te=null,U=null,z=null,G=null;const ee=i.getParameter(i.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let J=!1,Z=0;const ne=i.getParameter(i.VERSION);-1!==ne.indexOf("WebGL")?(Z=parseFloat(/^WebGL (\d)/.exec(ne)[1]),J=Z>=1):-1!==ne.indexOf("OpenGL ES")&&(Z=parseFloat(/^OpenGL ES (\d)/.exec(ne)[1]),J=Z>=2);let Y=null,he={};const Ce=i.getParameter(i.SCISSOR_BOX),Q=i.getParameter(i.VIEWPORT),ae=(new bt).fromArray(Ce),xe=(new bt).fromArray(Q);function Ee(k,de,pe,Ue){const qe=new Uint8Array(4),xt=i.createTexture();i.bindTexture(k,xt),i.texParameteri(k,i.TEXTURE_MIN_FILTER,i.NEAREST),i.texParameteri(k,i.TEXTURE_MAG_FILTER,i.NEAREST);for(let wt=0;wt<pe;wt++)!n||k!==i.TEXTURE_3D&&k!==i.TEXTURE_2D_ARRAY?i.texImage2D(de+wt,0,i.RGBA,1,1,0,i.RGBA,i.UNSIGNED_BYTE,qe):i.texImage3D(de,0,i.RGBA,1,1,Ue,0,i.RGBA,i.UNSIGNED_BYTE,qe);return xt}const Le={};function Fe(k){!0!==d[k]&&(i.enable(k),d[k]=!0)}function tt(k){!1!==d[k]&&(i.disable(k),d[k]=!1)}Le[i.TEXTURE_2D]=Ee(i.TEXTURE_2D,i.TEXTURE_2D,1),Le[i.TEXTURE_CUBE_MAP]=Ee(i.TEXTURE_CUBE_MAP,i.TEXTURE_CUBE_MAP_POSITIVE_X,6),n&&(Le[i.TEXTURE_2D_ARRAY]=Ee(i.TEXTURE_2D_ARRAY,i.TEXTURE_2D_ARRAY,1,1),Le[i.TEXTURE_3D]=Ee(i.TEXTURE_3D,i.TEXTURE_3D,1,1)),o.setClear(0,0,0,1),l.setClear(1),c.setClear(0),Fe(i.DEPTH_TEST),l.setFunc(3),_e(!1),R(1),Fe(i.CULL_FACE),re(0);const se={[Li]:i.FUNC_ADD,[m8]:i.FUNC_SUBTRACT,[g8]:i.FUNC_REVERSE_SUBTRACT};if(n)se[103]=i.MIN,se[104]=i.MAX;else{const k=e.get("EXT_blend_minmax");null!==k&&(se[103]=k.MIN_EXT,se[104]=k.MAX_EXT)}const ue={[v8]:i.ZERO,[y8]:i.ONE,[x8]:i.SRC_COLOR,[q1]:i.SRC_ALPHA,[T8]:i.SRC_ALPHA_SATURATE,[M8]:i.DST_COLOR,[b8]:i.DST_ALPHA,[_8]:i.ONE_MINUS_SRC_COLOR,[Z1]:i.ONE_MINUS_SRC_ALPHA,[E8]:i.ONE_MINUS_DST_COLOR,[S8]:i.ONE_MINUS_DST_ALPHA,[w8]:i.CONSTANT_COLOR,[A8]:i.ONE_MINUS_CONSTANT_COLOR,[C8]:i.CONSTANT_ALPHA,[P8]:i.ONE_MINUS_CONSTANT_ALPHA};function re(k,de,pe,Ue,qe,xt,wt,r0,K0,At){if(0!==k){if(!1===g&&(Fe(i.BLEND),g=!0),5===k)qe=qe||de,xt=xt||pe,wt=wt||Ue,(de!==x||qe!==E)&&(i.blendEquationSeparate(se[de],se[qe]),x=de,E=qe),(pe!==b||Ue!==T||xt!==M||wt!==w)&&(i.blendFuncSeparate(ue[pe],ue[Ue],ue[xt],ue[wt]),b=pe,T=Ue,M=xt,w=wt),(!1===r0.equals(I)||K0!==S)&&(i.blendColor(r0.r,r0.g,r0.b,K0),I.copy(r0),S=K0),_=k,P=!1;else if(k!==_||At!==P){if((100!==x||100!==E)&&(i.blendEquation(i.FUNC_ADD),x=100,E=100),At)switch(k){case 1:i.blendFuncSeparate(i.ONE,i.ONE_MINUS_SRC_ALPHA,i.ONE,i.ONE_MINUS_SRC_ALPHA);break;case 2:i.blendFunc(i.ONE,i.ONE);break;case 3:i.blendFuncSeparate(i.ZERO,i.ONE_MINUS_SRC_COLOR,i.ZERO,i.ONE);break;case 4:i.blendFuncSeparate(i.ZERO,i.SRC_COLOR,i.ZERO,i.SRC_ALPHA);break;default:console.error("THREE.WebGLState: Invalid blending: ",k)}else switch(k){case 1:i.blendFuncSeparate(i.SRC_ALPHA,i.ONE_MINUS_SRC_ALPHA,i.ONE,i.ONE_MINUS_SRC_ALPHA);break;case 2:i.blendFunc(i.SRC_ALPHA,i.ONE);break;case 3:i.blendFuncSeparate(i.ZERO,i.ONE_MINUS_SRC_COLOR,i.ZERO,i.ONE);break;case 4:i.blendFunc(i.ZERO,i.SRC_COLOR);break;default:console.error("THREE.WebGLState: Invalid blending: ",k)}b=null,T=null,M=null,w=null,I.set(0,0,0),S=0,_=k,P=At}}else!0===g&&(tt(i.BLEND),g=!1)}function _e(k){X!==k&&(i.frontFace(k?i.CW:i.CCW),X=k)}function R(k){0!==k?(Fe(i.CULL_FACE),k!==te&&i.cullFace(1===k?i.BACK:2===k?i.FRONT:i.FRONT_AND_BACK)):tt(i.CULL_FACE),te=k}function V(k,de,pe){k?(Fe(i.POLYGON_OFFSET_FILL),(z!==de||G!==pe)&&(i.polygonOffset(de,pe),z=de,G=pe)):tt(i.POLYGON_OFFSET_FILL)}return{buffers:{color:o,depth:l,stencil:c},enable:Fe,disable:tt,bindFramebuffer:function He(k,de){return p[k]!==de&&(i.bindFramebuffer(k,de),p[k]=de,n&&(k===i.DRAW_FRAMEBUFFER&&(p[i.FRAMEBUFFER]=de),k===i.FRAMEBUFFER&&(p[i.DRAW_FRAMEBUFFER]=de)),!0)},drawBuffers:function B(k,de){let pe=y,Ue=!1;if(k)if(pe=m.get(de),void 0===pe&&(pe=[],m.set(de,pe)),k.isWebGLMultipleRenderTargets){const qe=k.texture;if(pe.length!==qe.length||pe[0]!==i.COLOR_ATTACHMENT0){for(let xt=0,wt=qe.length;xt<wt;xt++)pe[xt]=i.COLOR_ATTACHMENT0+xt;pe.length=qe.length,Ue=!0}}else pe[0]!==i.COLOR_ATTACHMENT0&&(pe[0]=i.COLOR_ATTACHMENT0,Ue=!0);else pe[0]!==i.BACK&&(pe[0]=i.BACK,Ue=!0);Ue&&(t.isWebGL2?i.drawBuffers(pe):e.get("WEBGL_draw_buffers").drawBuffersWEBGL(pe))},useProgram:function fe(k){return v!==k&&(i.useProgram(k),v=k,!0)},setBlending:re,setMaterial:function Be(k,de){2===k.side?tt(i.CULL_FACE):Fe(i.CULL_FACE);let pe=1===k.side;de&&(pe=!pe),_e(pe),1===k.blending&&!1===k.transparent?re(0):re(k.blending,k.blendEquation,k.blendSrc,k.blendDst,k.blendEquationAlpha,k.blendSrcAlpha,k.blendDstAlpha,k.blendColor,k.blendAlpha,k.premultipliedAlpha),l.setFunc(k.depthFunc),l.setTest(k.depthTest),l.setMask(k.depthWrite),o.setMask(k.colorWrite);const Ue=k.stencilWrite;c.setTest(Ue),Ue&&(c.setMask(k.stencilWriteMask),c.setFunc(k.stencilFunc,k.stencilRef,k.stencilFuncMask),c.setOp(k.stencilFail,k.stencilZFail,k.stencilZPass)),V(k.polygonOffset,k.polygonOffsetFactor,k.polygonOffsetUnits),!0===k.alphaToCoverage?Fe(i.SAMPLE_ALPHA_TO_COVERAGE):tt(i.SAMPLE_ALPHA_TO_COVERAGE)},setFlipSided:_e,setCullFace:R,setLineWidth:function C(k){k!==U&&(J&&i.lineWidth(k),U=k)},setPolygonOffset:V,setScissorTest:function ce(k){k?Fe(i.SCISSOR_TEST):tt(i.SCISSOR_TEST)},activeTexture:function le(k){void 0===k&&(k=i.TEXTURE0+ee-1),Y!==k&&(i.activeTexture(k),Y=k)},bindTexture:function oe(k,de,pe){void 0===pe&&(pe=null===Y?i.TEXTURE0+ee-1:Y);let Ue=he[pe];void 0===Ue&&(Ue={type:void 0,texture:void 0},he[pe]=Ue),(Ue.type!==k||Ue.texture!==de)&&(Y!==pe&&(i.activeTexture(pe),Y=pe),i.bindTexture(k,de||Le[k]),Ue.type=k,Ue.texture=de)},unbindTexture:function De(){const k=he[Y];void 0!==k&&void 0!==k.type&&(i.bindTexture(k.type,null),k.type=void 0,k.texture=void 0)},compressedTexImage2D:function ve(){try{i.compressedTexImage2D.apply(i,arguments)}catch(k){console.error("THREE.WebGLState:",k)}},compressedTexImage3D:function we(){try{i.compressedTexImage3D.apply(i,arguments)}catch(k){console.error("THREE.WebGLState:",k)}},texImage2D:function Oe(){try{i.texImage2D.apply(i,arguments)}catch(k){console.error("THREE.WebGLState:",k)}},texImage3D:function Te(){try{i.texImage3D.apply(i,arguments)}catch(k){console.error("THREE.WebGLState:",k)}},updateUBOMapping:function mt(k,de){let pe=f.get(de);void 0===pe&&(pe=new WeakMap,f.set(de,pe));let Ue=pe.get(k);void 0===Ue&&(Ue=i.getUniformBlockIndex(de,k.name),pe.set(k,Ue))},uniformBlockBinding:function Qe(k,de){const Ue=f.get(de).get(k);u.get(de)!==Ue&&(i.uniformBlockBinding(de,Ue,k.__bindingPointIndex),u.set(de,Ue))},texStorage2D:function Se(){try{i.texStorage2D.apply(i,arguments)}catch(k){console.error("THREE.WebGLState:",k)}},texStorage3D:function Ie(){try{i.texStorage3D.apply(i,arguments)}catch(k){console.error("THREE.WebGLState:",k)}},texSubImage2D:function We(){try{i.texSubImage2D.apply(i,arguments)}catch(k){console.error("THREE.WebGLState:",k)}},texSubImage3D:function st(){try{i.texSubImage3D.apply(i,arguments)}catch(k){console.error("THREE.WebGLState:",k)}},compressedTexSubImage2D:function D(){try{i.compressedTexSubImage2D.apply(i,arguments)}catch(k){console.error("THREE.WebGLState:",k)}},compressedTexSubImage3D:function ge(){try{i.compressedTexSubImage3D.apply(i,arguments)}catch(k){console.error("THREE.WebGLState:",k)}},scissor:function nt(k){!1===ae.equals(k)&&(i.scissor(k.x,k.y,k.z,k.w),ae.copy(k))},viewport:function gt(k){!1===xe.equals(k)&&(i.viewport(k.x,k.y,k.z,k.w),xe.copy(k))},reset:function Mt(){i.disable(i.BLEND),i.disable(i.CULL_FACE),i.disable(i.DEPTH_TEST),i.disable(i.POLYGON_OFFSET_FILL),i.disable(i.SCISSOR_TEST),i.disable(i.STENCIL_TEST),i.disable(i.SAMPLE_ALPHA_TO_COVERAGE),i.blendEquation(i.FUNC_ADD),i.blendFunc(i.ONE,i.ZERO),i.blendFuncSeparate(i.ONE,i.ZERO,i.ONE,i.ZERO),i.blendColor(0,0,0,0),i.colorMask(!0,!0,!0,!0),i.clearColor(0,0,0,0),i.depthMask(!0),i.depthFunc(i.LESS),i.clearDepth(1),i.stencilMask(4294967295),i.stencilFunc(i.ALWAYS,0,4294967295),i.stencilOp(i.KEEP,i.KEEP,i.KEEP),i.clearStencil(0),i.cullFace(i.BACK),i.frontFace(i.CCW),i.polygonOffset(0,0),i.activeTexture(i.TEXTURE0),i.bindFramebuffer(i.FRAMEBUFFER,null),!0===n&&(i.bindFramebuffer(i.DRAW_FRAMEBUFFER,null),i.bindFramebuffer(i.READ_FRAMEBUFFER,null)),i.useProgram(null),i.lineWidth(1),i.scissor(0,0,i.canvas.width,i.canvas.height),i.viewport(0,0,i.canvas.width,i.canvas.height),d={},Y=null,he={},p={},m=new WeakMap,y=[],v=null,g=!1,_=null,x=null,b=null,T=null,E=null,M=null,w=null,I=new be(0,0,0),S=0,P=!1,X=null,te=null,U=null,z=null,G=null,ae.set(0,0,i.canvas.width,i.canvas.height),xe.set(0,0,i.canvas.width,i.canvas.height),o.reset(),l.reset(),c.reset()}}}function Yp(i,e,t,n,s,r,a){const o=s.isWebGL2,l=e.has("WEBGL_multisampled_render_to_texture")?e.get("WEBGL_multisampled_render_to_texture"):null,c=!(typeof navigator>"u")&&/OculusBrowser/g.test(navigator.userAgent),u=new WeakMap;let f;const d=new WeakMap;let p=!1;try{p=typeof OffscreenCanvas<"u"&&null!==new OffscreenCanvas(1,1).getContext("2d")}catch{}function m(R,C){return p?new OffscreenCanvas(R,C):Pr("canvas")}function y(R,C,V,ce){let le=1;if((R.width>ce||R.height>ce)&&(le=ce/Math.max(R.width,R.height)),le<1||!0===C){if(typeof HTMLImageElement<"u"&&R instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&R instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&R instanceof ImageBitmap){const oe=C?Ja:Math.floor,De=oe(le*R.width),ve=oe(le*R.height);void 0===f&&(f=m(De,ve));const we=V?m(De,ve):f;return we.width=De,we.height=ve,we.getContext("2d").drawImage(R,0,0,De,ve),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+R.width+"x"+R.height+") to ("+De+"x"+ve+")."),we}return"data"in R&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+R.width+"x"+R.height+")."),R}return R}function v(R){return l2(R.width)&&l2(R.height)}function _(R,C){return R.generateMipmaps&&C&&R.minFilter!==Jt&&R.minFilter!==kt}function x(R){i.generateMipmap(R)}function b(R,C,V,ce,le=!1){if(!1===o)return C;if(null!==R){if(void 0!==i[R])return i[R];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+R+"'")}let oe=C;if(C===i.RED&&(V===i.FLOAT&&(oe=i.R32F),V===i.HALF_FLOAT&&(oe=i.R16F),V===i.UNSIGNED_BYTE&&(oe=i.R8)),C===i.RED_INTEGER&&(V===i.UNSIGNED_BYTE&&(oe=i.R8UI),V===i.UNSIGNED_SHORT&&(oe=i.R16UI),V===i.UNSIGNED_INT&&(oe=i.R32UI),V===i.BYTE&&(oe=i.R8I),V===i.SHORT&&(oe=i.R16I),V===i.INT&&(oe=i.R32I)),C===i.RG&&(V===i.FLOAT&&(oe=i.RG32F),V===i.HALF_FLOAT&&(oe=i.RG16F),V===i.UNSIGNED_BYTE&&(oe=i.RG8)),C===i.RGBA){const De=le?Va:_t.getTransfer(ce);V===i.FLOAT&&(oe=i.RGBA32F),V===i.HALF_FLOAT&&(oe=i.RGBA16F),V===i.UNSIGNED_BYTE&&(oe=De===Ct?i.SRGB8_ALPHA8:i.RGBA8),V===i.UNSIGNED_SHORT_4_4_4_4&&(oe=i.RGBA4),V===i.UNSIGNED_SHORT_5_5_5_1&&(oe=i.RGB5_A1)}return(oe===i.R16F||oe===i.R32F||oe===i.RG16F||oe===i.RG32F||oe===i.RGBA16F||oe===i.RGBA32F)&&e.get("EXT_color_buffer_float"),oe}function T(R,C,V){return!0===_(R,V)||R.isFramebufferTexture&&R.minFilter!==Jt&&R.minFilter!==kt?Math.log2(Math.max(C.width,C.height))+1:void 0!==R.mipmaps&&R.mipmaps.length>0?R.mipmaps.length:R.isCompressedTexture&&Array.isArray(R.image)?C.mipmaps.length:1}function E(R){return R===Jt||1004===R||R===_s?i.NEAREST:i.LINEAR}function M(R){const C=R.target;C.removeEventListener("dispose",M),function I(R){const C=n.get(R);if(void 0===C.__webglInit)return;const V=R.source,ce=d.get(V);if(ce){const le=ce[C.__cacheKey];le.usedTimes--,0===le.usedTimes&&S(R),0===Object.keys(ce).length&&d.delete(V)}n.remove(R)}(C),C.isVideoTexture&&u.delete(C)}function w(R){const C=R.target;C.removeEventListener("dispose",w),function P(R){const C=R.texture,V=n.get(R),ce=n.get(C);if(void 0!==ce.__webglTexture&&(i.deleteTexture(ce.__webglTexture),a.memory.textures--),R.depthTexture&&R.depthTexture.dispose(),R.isWebGLCubeRenderTarget)for(let le=0;le<6;le++){if(Array.isArray(V.__webglFramebuffer[le]))for(let oe=0;oe<V.__webglFramebuffer[le].length;oe++)i.deleteFramebuffer(V.__webglFramebuffer[le][oe]);else i.deleteFramebuffer(V.__webglFramebuffer[le]);V.__webglDepthbuffer&&i.deleteRenderbuffer(V.__webglDepthbuffer[le])}else{if(Array.isArray(V.__webglFramebuffer))for(let le=0;le<V.__webglFramebuffer.length;le++)i.deleteFramebuffer(V.__webglFramebuffer[le]);else i.deleteFramebuffer(V.__webglFramebuffer);if(V.__webglDepthbuffer&&i.deleteRenderbuffer(V.__webglDepthbuffer),V.__webglMultisampledFramebuffer&&i.deleteFramebuffer(V.__webglMultisampledFramebuffer),V.__webglColorRenderbuffer)for(let le=0;le<V.__webglColorRenderbuffer.length;le++)V.__webglColorRenderbuffer[le]&&i.deleteRenderbuffer(V.__webglColorRenderbuffer[le]);V.__webglDepthRenderbuffer&&i.deleteRenderbuffer(V.__webglDepthRenderbuffer)}if(R.isWebGLMultipleRenderTargets)for(let le=0,oe=C.length;le<oe;le++){const De=n.get(C[le]);De.__webglTexture&&(i.deleteTexture(De.__webglTexture),a.memory.textures--),n.remove(C[le])}n.remove(C),n.remove(R)}(C)}function S(R){const C=n.get(R);i.deleteTexture(C.__webglTexture),delete d.get(R.source)[C.__cacheKey],a.memory.textures--}let X=0;function G(R,C){const V=n.get(R);if(R.isVideoTexture&&function Be(R){const C=a.render.frame;u.get(R)!==C&&(u.set(R,C),R.update())}(R),!1===R.isRenderTargetTexture&&R.version>0&&V.__version!==R.version){const ce=R.image;if(null===ce)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else{if(!1!==ce.complete)return void ae(V,R,C);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}t.bindTexture(i.TEXTURE_2D,V.__webglTexture,i.TEXTURE0+C)}const ne={[Na]:i.REPEAT,[p0]:i.CLAMP_TO_EDGE,[ka]:i.MIRRORED_REPEAT},Y={[Jt]:i.NEAREST,[K1]:i.NEAREST_MIPMAP_NEAREST,[_s]:i.NEAREST_MIPMAP_LINEAR,[kt]:i.LINEAR,[Ua]:i.LINEAR_MIPMAP_NEAREST,[Dn]:i.LINEAR_MIPMAP_LINEAR},he={[of]:i.NEVER,[df]:i.ALWAYS,[lf]:i.LESS,[U5]:i.LEQUAL,[cf]:i.EQUAL,[ff]:i.GEQUAL,[hf]:i.GREATER,[uf]:i.NOTEQUAL};function Ce(R,C,V){if(C.type===Q0&&!1===e.has("OES_texture_float_linear")&&(C.magFilter===kt||1007===C.magFilter||C.magFilter===_s||C.magFilter===Dn||C.minFilter===kt||1007===C.minFilter||C.minFilter===_s||C.minFilter===Dn)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),V?(i.texParameteri(R,i.TEXTURE_WRAP_S,ne[C.wrapS]),i.texParameteri(R,i.TEXTURE_WRAP_T,ne[C.wrapT]),(R===i.TEXTURE_3D||R===i.TEXTURE_2D_ARRAY)&&i.texParameteri(R,i.TEXTURE_WRAP_R,ne[C.wrapR]),i.texParameteri(R,i.TEXTURE_MAG_FILTER,Y[C.magFilter]),i.texParameteri(R,i.TEXTURE_MIN_FILTER,Y[C.minFilter])):(i.texParameteri(R,i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),i.texParameteri(R,i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE),(R===i.TEXTURE_3D||R===i.TEXTURE_2D_ARRAY)&&i.texParameteri(R,i.TEXTURE_WRAP_R,i.CLAMP_TO_EDGE),(C.wrapS!==p0||C.wrapT!==p0)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),i.texParameteri(R,i.TEXTURE_MAG_FILTER,E(C.magFilter)),i.texParameteri(R,i.TEXTURE_MIN_FILTER,E(C.minFilter)),C.minFilter!==Jt&&C.minFilter!==kt&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),C.compareFunction&&(i.texParameteri(R,i.TEXTURE_COMPARE_MODE,i.COMPARE_REF_TO_TEXTURE),i.texParameteri(R,i.TEXTURE_COMPARE_FUNC,he[C.compareFunction])),!0===e.has("EXT_texture_filter_anisotropic")){const ce=e.get("EXT_texture_filter_anisotropic");if(C.magFilter===Jt||C.minFilter!==_s&&C.minFilter!==Dn||C.type===Q0&&!1===e.has("OES_texture_float_linear")||!1===o&&C.type===Ar&&!1===e.has("OES_texture_half_float_linear"))return;(C.anisotropy>1||n.get(C).__currentAnisotropy)&&(i.texParameterf(R,ce.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(C.anisotropy,s.getMaxAnisotropy())),n.get(C).__currentAnisotropy=C.anisotropy)}}function Q(R,C){let V=!1;void 0===R.__webglInit&&(R.__webglInit=!0,C.addEventListener("dispose",M));const ce=C.source;let le=d.get(ce);void 0===le&&(le={},d.set(ce,le));const oe=function z(R){const C=[];return C.push(R.wrapS),C.push(R.wrapT),C.push(R.wrapR||0),C.push(R.magFilter),C.push(R.minFilter),C.push(R.anisotropy),C.push(R.internalFormat),C.push(R.format),C.push(R.type),C.push(R.generateMipmaps),C.push(R.premultiplyAlpha),C.push(R.flipY),C.push(R.unpackAlignment),C.push(R.colorSpace),C.join()}(C);if(oe!==R.__cacheKey){void 0===le[oe]&&(le[oe]={texture:i.createTexture(),usedTimes:0},a.memory.textures++,V=!0),le[oe].usedTimes++;const De=le[R.__cacheKey];void 0!==De&&(le[R.__cacheKey].usedTimes--,0===De.usedTimes&&S(C)),R.__cacheKey=oe,R.__webglTexture=le[oe].texture}return V}function ae(R,C,V){let ce=i.TEXTURE_2D;(C.isDataArrayTexture||C.isCompressedArrayTexture)&&(ce=i.TEXTURE_2D_ARRAY),C.isData3DTexture&&(ce=i.TEXTURE_3D);const le=Q(R,C),oe=C.source;t.bindTexture(ce,R.__webglTexture,i.TEXTURE0+V);const De=n.get(oe);if(oe.version!==De.__version||!0===le){t.activeTexture(i.TEXTURE0+V);const ve=_t.getPrimaries(_t.workingColorSpace),we=""===C.colorSpace?null:_t.getPrimaries(C.colorSpace),We=""===C.colorSpace||ve===we?i.NONE:i.BROWSER_DEFAULT_WEBGL;i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,C.flipY),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,C.premultiplyAlpha),i.pixelStorei(i.UNPACK_ALIGNMENT,C.unpackAlignment),i.pixelStorei(i.UNPACK_COLORSPACE_CONVERSION_WEBGL,We);const st=function g(R){return!o&&(R.wrapS!==p0||R.wrapT!==p0||R.minFilter!==Jt&&R.minFilter!==kt)}(C)&&!1===v(C.image);let D=y(C.image,st,!1,s.maxTextureSize);D=_e(C,D);const ge=v(D)||o,Se=r.convert(C.format,C.colorSpace);let Te,Ie=r.convert(C.type),Oe=b(C.internalFormat,Se,Ie,C.colorSpace,C.isVideoTexture);Ce(ce,C,ge);const nt=C.mipmaps,gt=o&&!0!==C.isVideoTexture&&36196!==Oe,mt=void 0===De.__version||!0===le,Qe=oe.dataReady,Mt=T(C,D,ge);if(C.isDepthTexture)Oe=i.DEPTH_COMPONENT,o?Oe=C.type===Q0?i.DEPTH_COMPONENT32F:C.type===si?i.DEPTH_COMPONENT24:C.type===Di?i.DEPTH24_STENCIL8:i.DEPTH_COMPONENT16:C.type===Q0&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),C.format===Fi&&Oe===i.DEPTH_COMPONENT&&1012!==C.type&&C.type!==si&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),C.type=si,Ie=r.convert(C.type)),C.format===bs&&Oe===i.DEPTH_COMPONENT&&(Oe=i.DEPTH_STENCIL,C.type!==Di&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),C.type=Di,Ie=r.convert(C.type))),mt&&(gt?t.texStorage2D(i.TEXTURE_2D,1,Oe,D.width,D.height):t.texImage2D(i.TEXTURE_2D,0,Oe,D.width,D.height,0,Se,Ie,null));else if(C.isDataTexture)if(nt.length>0&&ge){gt&&mt&&t.texStorage2D(i.TEXTURE_2D,Mt,Oe,nt[0].width,nt[0].height);for(let k=0,de=nt.length;k<de;k++)Te=nt[k],gt?Qe&&t.texSubImage2D(i.TEXTURE_2D,k,0,0,Te.width,Te.height,Se,Ie,Te.data):t.texImage2D(i.TEXTURE_2D,k,Oe,Te.width,Te.height,0,Se,Ie,Te.data);C.generateMipmaps=!1}else gt?(mt&&t.texStorage2D(i.TEXTURE_2D,Mt,Oe,D.width,D.height),Qe&&t.texSubImage2D(i.TEXTURE_2D,0,0,0,D.width,D.height,Se,Ie,D.data)):t.texImage2D(i.TEXTURE_2D,0,Oe,D.width,D.height,0,Se,Ie,D.data);else if(C.isCompressedTexture)if(C.isCompressedArrayTexture){gt&&mt&&t.texStorage3D(i.TEXTURE_2D_ARRAY,Mt,Oe,nt[0].width,nt[0].height,D.depth);for(let k=0,de=nt.length;k<de;k++)Te=nt[k],C.format!==L0?null!==Se?gt?Qe&&t.compressedTexSubImage3D(i.TEXTURE_2D_ARRAY,k,0,0,0,Te.width,Te.height,D.depth,Se,Te.data,0,0):t.compressedTexImage3D(i.TEXTURE_2D_ARRAY,k,Oe,Te.width,Te.height,D.depth,0,Te.data,0,0):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):gt?Qe&&t.texSubImage3D(i.TEXTURE_2D_ARRAY,k,0,0,0,Te.width,Te.height,D.depth,Se,Ie,Te.data):t.texImage3D(i.TEXTURE_2D_ARRAY,k,Oe,Te.width,Te.height,D.depth,0,Se,Ie,Te.data)}else{gt&&mt&&t.texStorage2D(i.TEXTURE_2D,Mt,Oe,nt[0].width,nt[0].height);for(let k=0,de=nt.length;k<de;k++)Te=nt[k],C.format!==L0?null!==Se?gt?Qe&&t.compressedTexSubImage2D(i.TEXTURE_2D,k,0,0,Te.width,Te.height,Se,Te.data):t.compressedTexImage2D(i.TEXTURE_2D,k,Oe,Te.width,Te.height,0,Te.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):gt?Qe&&t.texSubImage2D(i.TEXTURE_2D,k,0,0,Te.width,Te.height,Se,Ie,Te.data):t.texImage2D(i.TEXTURE_2D,k,Oe,Te.width,Te.height,0,Se,Ie,Te.data)}else if(C.isDataArrayTexture)gt?(mt&&t.texStorage3D(i.TEXTURE_2D_ARRAY,Mt,Oe,D.width,D.height,D.depth),Qe&&t.texSubImage3D(i.TEXTURE_2D_ARRAY,0,0,0,0,D.width,D.height,D.depth,Se,Ie,D.data)):t.texImage3D(i.TEXTURE_2D_ARRAY,0,Oe,D.width,D.height,D.depth,0,Se,Ie,D.data);else if(C.isData3DTexture)gt?(mt&&t.texStorage3D(i.TEXTURE_3D,Mt,Oe,D.width,D.height,D.depth),Qe&&t.texSubImage3D(i.TEXTURE_3D,0,0,0,0,D.width,D.height,D.depth,Se,Ie,D.data)):t.texImage3D(i.TEXTURE_3D,0,Oe,D.width,D.height,D.depth,0,Se,Ie,D.data);else if(C.isFramebufferTexture){if(mt)if(gt)t.texStorage2D(i.TEXTURE_2D,Mt,Oe,D.width,D.height);else{let k=D.width,de=D.height;for(let pe=0;pe<Mt;pe++)t.texImage2D(i.TEXTURE_2D,pe,Oe,k,de,0,Se,Ie,null),k>>=1,de>>=1}}else if(nt.length>0&&ge){gt&&mt&&t.texStorage2D(i.TEXTURE_2D,Mt,Oe,nt[0].width,nt[0].height);for(let k=0,de=nt.length;k<de;k++)Te=nt[k],gt?Qe&&t.texSubImage2D(i.TEXTURE_2D,k,0,0,Se,Ie,Te):t.texImage2D(i.TEXTURE_2D,k,Oe,Se,Ie,Te);C.generateMipmaps=!1}else gt?(mt&&t.texStorage2D(i.TEXTURE_2D,Mt,Oe,D.width,D.height),Qe&&t.texSubImage2D(i.TEXTURE_2D,0,0,0,Se,Ie,D)):t.texImage2D(i.TEXTURE_2D,0,Oe,Se,Ie,D);_(C,ge)&&x(ce),De.__version=oe.version,C.onUpdate&&C.onUpdate(C)}R.__version=C.version}function Ee(R,C,V,ce,le,oe){const De=r.convert(V.format,V.colorSpace),ve=r.convert(V.type),we=b(V.internalFormat,De,ve,V.colorSpace);if(!n.get(C).__hasExternalTextures){const st=Math.max(1,C.width>>oe),D=Math.max(1,C.height>>oe);le===i.TEXTURE_3D||le===i.TEXTURE_2D_ARRAY?t.texImage3D(le,oe,we,st,D,C.depth,0,De,ve,null):t.texImage2D(le,oe,we,st,D,0,De,ve,null)}t.bindFramebuffer(i.FRAMEBUFFER,R),re(C)?l.framebufferTexture2DMultisampleEXT(i.FRAMEBUFFER,ce,le,n.get(V).__webglTexture,0,ue(C)):(le===i.TEXTURE_2D||le>=i.TEXTURE_CUBE_MAP_POSITIVE_X&&le<=i.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&i.framebufferTexture2D(i.FRAMEBUFFER,ce,le,n.get(V).__webglTexture,oe),t.bindFramebuffer(i.FRAMEBUFFER,null)}function Le(R,C,V){if(i.bindRenderbuffer(i.RENDERBUFFER,R),C.depthBuffer&&!C.stencilBuffer){let ce=!0===o?i.DEPTH_COMPONENT24:i.DEPTH_COMPONENT16;if(V||re(C)){const le=C.depthTexture;le&&le.isDepthTexture&&(le.type===Q0?ce=i.DEPTH_COMPONENT32F:le.type===si&&(ce=i.DEPTH_COMPONENT24));const oe=ue(C);re(C)?l.renderbufferStorageMultisampleEXT(i.RENDERBUFFER,oe,ce,C.width,C.height):i.renderbufferStorageMultisample(i.RENDERBUFFER,oe,ce,C.width,C.height)}else i.renderbufferStorage(i.RENDERBUFFER,ce,C.width,C.height);i.framebufferRenderbuffer(i.FRAMEBUFFER,i.DEPTH_ATTACHMENT,i.RENDERBUFFER,R)}else if(C.depthBuffer&&C.stencilBuffer){const ce=ue(C);V&&!1===re(C)?i.renderbufferStorageMultisample(i.RENDERBUFFER,ce,i.DEPTH24_STENCIL8,C.width,C.height):re(C)?l.renderbufferStorageMultisampleEXT(i.RENDERBUFFER,ce,i.DEPTH24_STENCIL8,C.width,C.height):i.renderbufferStorage(i.RENDERBUFFER,i.DEPTH_STENCIL,C.width,C.height),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.DEPTH_STENCIL_ATTACHMENT,i.RENDERBUFFER,R)}else{const ce=!0===C.isWebGLMultipleRenderTargets?C.texture:[C.texture];for(let le=0;le<ce.length;le++){const oe=ce[le],De=r.convert(oe.format,oe.colorSpace),ve=r.convert(oe.type),we=b(oe.internalFormat,De,ve,oe.colorSpace),We=ue(C);V&&!1===re(C)?i.renderbufferStorageMultisample(i.RENDERBUFFER,We,we,C.width,C.height):re(C)?l.renderbufferStorageMultisampleEXT(i.RENDERBUFFER,We,we,C.width,C.height):i.renderbufferStorage(i.RENDERBUFFER,we,C.width,C.height)}}i.bindRenderbuffer(i.RENDERBUFFER,null)}function tt(R){const C=n.get(R),V=!0===R.isWebGLCubeRenderTarget;if(R.depthTexture&&!C.__autoAllocateDepthBuffer){if(V)throw new Error("target.depthTexture not supported in Cube render targets");!function Fe(R,C){if(C&&C.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(t.bindFramebuffer(i.FRAMEBUFFER,R),!C.depthTexture||!C.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");(!n.get(C.depthTexture).__webglTexture||C.depthTexture.image.width!==C.width||C.depthTexture.image.height!==C.height)&&(C.depthTexture.image.width=C.width,C.depthTexture.image.height=C.height,C.depthTexture.needsUpdate=!0),G(C.depthTexture,0);const ce=n.get(C.depthTexture).__webglTexture,le=ue(C);if(C.depthTexture.format===Fi)re(C)?l.framebufferTexture2DMultisampleEXT(i.FRAMEBUFFER,i.DEPTH_ATTACHMENT,i.TEXTURE_2D,ce,0,le):i.framebufferTexture2D(i.FRAMEBUFFER,i.DEPTH_ATTACHMENT,i.TEXTURE_2D,ce,0);else{if(C.depthTexture.format!==bs)throw new Error("Unknown depthTexture format");re(C)?l.framebufferTexture2DMultisampleEXT(i.FRAMEBUFFER,i.DEPTH_STENCIL_ATTACHMENT,i.TEXTURE_2D,ce,0,le):i.framebufferTexture2D(i.FRAMEBUFFER,i.DEPTH_STENCIL_ATTACHMENT,i.TEXTURE_2D,ce,0)}}(C.__webglFramebuffer,R)}else if(V){C.__webglDepthbuffer=[];for(let ce=0;ce<6;ce++)t.bindFramebuffer(i.FRAMEBUFFER,C.__webglFramebuffer[ce]),C.__webglDepthbuffer[ce]=i.createRenderbuffer(),Le(C.__webglDepthbuffer[ce],R,!1)}else t.bindFramebuffer(i.FRAMEBUFFER,C.__webglFramebuffer),C.__webglDepthbuffer=i.createRenderbuffer(),Le(C.__webglDepthbuffer,R,!1);t.bindFramebuffer(i.FRAMEBUFFER,null)}function ue(R){return Math.min(s.maxSamples,R.samples)}function re(R){const C=n.get(R);return o&&R.samples>0&&!0===e.has("WEBGL_multisampled_render_to_texture")&&!1!==C.__useRenderToTexture}function _e(R,C){const V=R.colorSpace,ce=R.format,le=R.type;return!0===R.isCompressedTexture||!0===R.isVideoTexture||1035===R.format||V!==Fn&&""!==V&&(_t.getTransfer(V)===Ct?!1===o?!0===e.has("EXT_sRGB")&&ce===L0?(R.format=1035,R.minFilter=kt,R.generateMipmaps=!1):C=W5.sRGBToLinear(C):(ce!==L0||le!==ii)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",V)),C}this.allocateTextureUnit=function U(){const R=X;return R>=s.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+R+" texture units while this GPU supports only "+s.maxTextures),X+=1,R},this.resetTextureUnits=function te(){X=0},this.setTexture2D=G,this.setTexture2DArray=function ee(R,C){const V=n.get(R);R.version>0&&V.__version!==R.version?ae(V,R,C):t.bindTexture(i.TEXTURE_2D_ARRAY,V.__webglTexture,i.TEXTURE0+C)},this.setTexture3D=function J(R,C){const V=n.get(R);R.version>0&&V.__version!==R.version?ae(V,R,C):t.bindTexture(i.TEXTURE_3D,V.__webglTexture,i.TEXTURE0+C)},this.setTextureCube=function Z(R,C){const V=n.get(R);R.version>0&&V.__version!==R.version?function xe(R,C,V){if(6!==C.image.length)return;const ce=Q(R,C),le=C.source;t.bindTexture(i.TEXTURE_CUBE_MAP,R.__webglTexture,i.TEXTURE0+V);const oe=n.get(le);if(le.version!==oe.__version||!0===ce){t.activeTexture(i.TEXTURE0+V);const De=_t.getPrimaries(_t.workingColorSpace),ve=""===C.colorSpace?null:_t.getPrimaries(C.colorSpace),we=""===C.colorSpace||De===ve?i.NONE:i.BROWSER_DEFAULT_WEBGL;i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,C.flipY),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,C.premultiplyAlpha),i.pixelStorei(i.UNPACK_ALIGNMENT,C.unpackAlignment),i.pixelStorei(i.UNPACK_COLORSPACE_CONVERSION_WEBGL,we);const We=C.isCompressedTexture||C.image[0].isCompressedTexture,st=C.image[0]&&C.image[0].isDataTexture,D=[];for(let k=0;k<6;k++)D[k]=We||st?st?C.image[k].image:C.image[k]:y(C.image[k],!1,!0,s.maxCubemapSize),D[k]=_e(C,D[k]);const ge=D[0],Se=v(ge)||o,Ie=r.convert(C.format,C.colorSpace),Oe=r.convert(C.type),Te=b(C.internalFormat,Ie,Oe,C.colorSpace),nt=o&&!0!==C.isVideoTexture,gt=void 0===oe.__version||!0===ce,mt=le.dataReady;let Mt,Qe=T(C,ge,Se);if(Ce(i.TEXTURE_CUBE_MAP,C,Se),We){nt&&gt&&t.texStorage2D(i.TEXTURE_CUBE_MAP,Qe,Te,ge.width,ge.height);for(let k=0;k<6;k++){Mt=D[k].mipmaps;for(let de=0;de<Mt.length;de++){const pe=Mt[de];C.format!==L0?null!==Ie?nt?mt&&t.compressedTexSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+k,de,0,0,pe.width,pe.height,Ie,pe.data):t.compressedTexImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+k,de,Te,pe.width,pe.height,0,pe.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):nt?mt&&t.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+k,de,0,0,pe.width,pe.height,Ie,Oe,pe.data):t.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+k,de,Te,pe.width,pe.height,0,Ie,Oe,pe.data)}}}else{Mt=C.mipmaps,nt&&gt&&(Mt.length>0&&Qe++,t.texStorage2D(i.TEXTURE_CUBE_MAP,Qe,Te,D[0].width,D[0].height));for(let k=0;k<6;k++)if(st){nt?mt&&t.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+k,0,0,0,D[k].width,D[k].height,Ie,Oe,D[k].data):t.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+k,0,Te,D[k].width,D[k].height,0,Ie,Oe,D[k].data);for(let de=0;de<Mt.length;de++){const Ue=Mt[de].image[k].image;nt?mt&&t.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+k,de+1,0,0,Ue.width,Ue.height,Ie,Oe,Ue.data):t.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+k,de+1,Te,Ue.width,Ue.height,0,Ie,Oe,Ue.data)}}else{nt?mt&&t.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+k,0,0,0,Ie,Oe,D[k]):t.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+k,0,Te,Ie,Oe,D[k]);for(let de=0;de<Mt.length;de++){const pe=Mt[de];nt?mt&&t.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+k,de+1,0,0,Ie,Oe,pe.image[k]):t.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+k,de+1,Te,Ie,Oe,pe.image[k])}}}_(C,Se)&&x(i.TEXTURE_CUBE_MAP),oe.__version=le.version,C.onUpdate&&C.onUpdate(C)}R.__version=C.version}(V,R,C):t.bindTexture(i.TEXTURE_CUBE_MAP,V.__webglTexture,i.TEXTURE0+C)},this.rebindTextures=function He(R,C,V){const ce=n.get(R);void 0!==C&&Ee(ce.__webglFramebuffer,R,R.texture,i.COLOR_ATTACHMENT0,i.TEXTURE_2D,0),void 0!==V&&tt(R)},this.setupRenderTarget=function B(R){const C=R.texture,V=n.get(R),ce=n.get(C);R.addEventListener("dispose",w),!0!==R.isWebGLMultipleRenderTargets&&(void 0===ce.__webglTexture&&(ce.__webglTexture=i.createTexture()),ce.__version=C.version,a.memory.textures++);const le=!0===R.isWebGLCubeRenderTarget,oe=!0===R.isWebGLMultipleRenderTargets,De=v(R)||o;if(le){V.__webglFramebuffer=[];for(let ve=0;ve<6;ve++)if(o&&C.mipmaps&&C.mipmaps.length>0){V.__webglFramebuffer[ve]=[];for(let we=0;we<C.mipmaps.length;we++)V.__webglFramebuffer[ve][we]=i.createFramebuffer()}else V.__webglFramebuffer[ve]=i.createFramebuffer()}else{if(o&&C.mipmaps&&C.mipmaps.length>0){V.__webglFramebuffer=[];for(let ve=0;ve<C.mipmaps.length;ve++)V.__webglFramebuffer[ve]=i.createFramebuffer()}else V.__webglFramebuffer=i.createFramebuffer();if(oe)if(s.drawBuffers){const ve=R.texture;for(let we=0,We=ve.length;we<We;we++){const st=n.get(ve[we]);void 0===st.__webglTexture&&(st.__webglTexture=i.createTexture(),a.memory.textures++)}}else console.warn("THREE.WebGLRenderer: WebGLMultipleRenderTargets can only be used with WebGL2 or WEBGL_draw_buffers extension.");if(o&&R.samples>0&&!1===re(R)){const ve=oe?C:[C];V.__webglMultisampledFramebuffer=i.createFramebuffer(),V.__webglColorRenderbuffer=[],t.bindFramebuffer(i.FRAMEBUFFER,V.__webglMultisampledFramebuffer);for(let we=0;we<ve.length;we++){const We=ve[we];V.__webglColorRenderbuffer[we]=i.createRenderbuffer(),i.bindRenderbuffer(i.RENDERBUFFER,V.__webglColorRenderbuffer[we]);const st=r.convert(We.format,We.colorSpace),D=r.convert(We.type),ge=b(We.internalFormat,st,D,We.colorSpace,!0===R.isXRRenderTarget),Se=ue(R);i.renderbufferStorageMultisample(i.RENDERBUFFER,Se,ge,R.width,R.height),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0+we,i.RENDERBUFFER,V.__webglColorRenderbuffer[we])}i.bindRenderbuffer(i.RENDERBUFFER,null),R.depthBuffer&&(V.__webglDepthRenderbuffer=i.createRenderbuffer(),Le(V.__webglDepthRenderbuffer,R,!0)),t.bindFramebuffer(i.FRAMEBUFFER,null)}}if(le){t.bindTexture(i.TEXTURE_CUBE_MAP,ce.__webglTexture),Ce(i.TEXTURE_CUBE_MAP,C,De);for(let ve=0;ve<6;ve++)if(o&&C.mipmaps&&C.mipmaps.length>0)for(let we=0;we<C.mipmaps.length;we++)Ee(V.__webglFramebuffer[ve][we],R,C,i.COLOR_ATTACHMENT0,i.TEXTURE_CUBE_MAP_POSITIVE_X+ve,we);else Ee(V.__webglFramebuffer[ve],R,C,i.COLOR_ATTACHMENT0,i.TEXTURE_CUBE_MAP_POSITIVE_X+ve,0);_(C,De)&&x(i.TEXTURE_CUBE_MAP),t.unbindTexture()}else if(oe){const ve=R.texture;for(let we=0,We=ve.length;we<We;we++){const st=ve[we],D=n.get(st);t.bindTexture(i.TEXTURE_2D,D.__webglTexture),Ce(i.TEXTURE_2D,st,De),Ee(V.__webglFramebuffer,R,st,i.COLOR_ATTACHMENT0+we,i.TEXTURE_2D,0),_(st,De)&&x(i.TEXTURE_2D)}t.unbindTexture()}else{let ve=i.TEXTURE_2D;if((R.isWebGL3DRenderTarget||R.isWebGLArrayRenderTarget)&&(o?ve=R.isWebGL3DRenderTarget?i.TEXTURE_3D:i.TEXTURE_2D_ARRAY:console.error("THREE.WebGLTextures: THREE.Data3DTexture and THREE.DataArrayTexture only supported with WebGL2.")),t.bindTexture(ve,ce.__webglTexture),Ce(ve,C,De),o&&C.mipmaps&&C.mipmaps.length>0)for(let we=0;we<C.mipmaps.length;we++)Ee(V.__webglFramebuffer[we],R,C,i.COLOR_ATTACHMENT0,ve,we);else Ee(V.__webglFramebuffer,R,C,i.COLOR_ATTACHMENT0,ve,0);_(C,De)&&x(ve),t.unbindTexture()}R.depthBuffer&&tt(R)},this.updateRenderTargetMipmap=function fe(R){const C=v(R)||o,V=!0===R.isWebGLMultipleRenderTargets?R.texture:[R.texture];for(let ce=0,le=V.length;ce<le;ce++){const oe=V[ce];if(_(oe,C)){const De=R.isWebGLCubeRenderTarget?i.TEXTURE_CUBE_MAP:i.TEXTURE_2D,ve=n.get(oe).__webglTexture;t.bindTexture(De,ve),x(De),t.unbindTexture()}}},this.updateMultisampleRenderTarget=function se(R){if(o&&R.samples>0&&!1===re(R)){const C=R.isWebGLMultipleRenderTargets?R.texture:[R.texture],V=R.width,ce=R.height;let le=i.COLOR_BUFFER_BIT;const oe=[],De=R.stencilBuffer?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT,ve=n.get(R),we=!0===R.isWebGLMultipleRenderTargets;if(we)for(let We=0;We<C.length;We++)t.bindFramebuffer(i.FRAMEBUFFER,ve.__webglMultisampledFramebuffer),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0+We,i.RENDERBUFFER,null),t.bindFramebuffer(i.FRAMEBUFFER,ve.__webglFramebuffer),i.framebufferTexture2D(i.DRAW_FRAMEBUFFER,i.COLOR_ATTACHMENT0+We,i.TEXTURE_2D,null,0);t.bindFramebuffer(i.READ_FRAMEBUFFER,ve.__webglMultisampledFramebuffer),t.bindFramebuffer(i.DRAW_FRAMEBUFFER,ve.__webglFramebuffer);for(let We=0;We<C.length;We++){oe.push(i.COLOR_ATTACHMENT0+We),R.depthBuffer&&oe.push(De);const st=void 0!==ve.__ignoreDepthValues&&ve.__ignoreDepthValues;if(!1===st&&(R.depthBuffer&&(le|=i.DEPTH_BUFFER_BIT),R.stencilBuffer&&(le|=i.STENCIL_BUFFER_BIT)),we&&i.framebufferRenderbuffer(i.READ_FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.RENDERBUFFER,ve.__webglColorRenderbuffer[We]),!0===st&&(i.invalidateFramebuffer(i.READ_FRAMEBUFFER,[De]),i.invalidateFramebuffer(i.DRAW_FRAMEBUFFER,[De])),we){const D=n.get(C[We]).__webglTexture;i.framebufferTexture2D(i.DRAW_FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.TEXTURE_2D,D,0)}i.blitFramebuffer(0,0,V,ce,0,0,V,ce,le,i.NEAREST),c&&i.invalidateFramebuffer(i.READ_FRAMEBUFFER,oe)}if(t.bindFramebuffer(i.READ_FRAMEBUFFER,null),t.bindFramebuffer(i.DRAW_FRAMEBUFFER,null),we)for(let We=0;We<C.length;We++){t.bindFramebuffer(i.FRAMEBUFFER,ve.__webglMultisampledFramebuffer),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0+We,i.RENDERBUFFER,ve.__webglColorRenderbuffer[We]);const st=n.get(C[We]).__webglTexture;t.bindFramebuffer(i.FRAMEBUFFER,ve.__webglFramebuffer),i.framebufferTexture2D(i.DRAW_FRAMEBUFFER,i.COLOR_ATTACHMENT0+We,i.TEXTURE_2D,st,0)}t.bindFramebuffer(i.DRAW_FRAMEBUFFER,ve.__webglMultisampledFramebuffer)}},this.setupDepthRenderbuffer=tt,this.setupFrameBufferTexture=Ee,this.useMultisampledRTT=re}function qp(i,e,t){const n=t.isWebGL2;return{convert:function s(r,a=""){let o;const l=_t.getTransfer(a);if(r===ii)return i.UNSIGNED_BYTE;if(1017===r)return i.UNSIGNED_SHORT_4_4_4_4;if(1018===r)return i.UNSIGNED_SHORT_5_5_5_1;if(1010===r)return i.BYTE;if(1011===r)return i.SHORT;if(1012===r)return i.UNSIGNED_SHORT;if(1013===r)return i.INT;if(r===si)return i.UNSIGNED_INT;if(r===Q0)return i.FLOAT;if(r===Ar)return n?i.HALF_FLOAT:(o=e.get("OES_texture_half_float"),null!==o?o.HALF_FLOAT_OES:null);if(1021===r)return i.ALPHA;if(r===L0)return i.RGBA;if(1024===r)return i.LUMINANCE;if(1025===r)return i.LUMINANCE_ALPHA;if(r===Fi)return i.DEPTH_COMPONENT;if(r===bs)return i.DEPTH_STENCIL;if(1035===r)return o=e.get("EXT_sRGB"),null!==o?o.SRGB_ALPHA_EXT:null;if(1028===r)return i.RED;if(1029===r)return i.RED_INTEGER;if(1030===r)return i.RG;if(1031===r)return i.RG_INTEGER;if(1033===r)return i.RGBA_INTEGER;if(33776===r||33777===r||33778===r||33779===r)if(l===Ct){if(o=e.get("WEBGL_compressed_texture_s3tc_srgb"),null===o)return null;if(33776===r)return o.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(33777===r)return o.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(33778===r)return o.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(33779===r)return o.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else{if(o=e.get("WEBGL_compressed_texture_s3tc"),null===o)return null;if(33776===r)return o.COMPRESSED_RGB_S3TC_DXT1_EXT;if(33777===r)return o.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(33778===r)return o.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(33779===r)return o.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(35840===r||35841===r||35842===r||35843===r){if(o=e.get("WEBGL_compressed_texture_pvrtc"),null===o)return null;if(35840===r)return o.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(35841===r)return o.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(35842===r)return o.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(35843===r)return o.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(36196===r)return o=e.get("WEBGL_compressed_texture_etc1"),null!==o?o.COMPRESSED_RGB_ETC1_WEBGL:null;if(37492===r||37496===r){if(o=e.get("WEBGL_compressed_texture_etc"),null===o)return null;if(37492===r)return l===Ct?o.COMPRESSED_SRGB8_ETC2:o.COMPRESSED_RGB8_ETC2;if(37496===r)return l===Ct?o.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:o.COMPRESSED_RGBA8_ETC2_EAC}if(37808===r||37809===r||37810===r||37811===r||37812===r||37813===r||37814===r||37815===r||37816===r||37817===r||37818===r||37819===r||37820===r||37821===r){if(o=e.get("WEBGL_compressed_texture_astc"),null===o)return null;if(37808===r)return l===Ct?o.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:o.COMPRESSED_RGBA_ASTC_4x4_KHR;if(37809===r)return l===Ct?o.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:o.COMPRESSED_RGBA_ASTC_5x4_KHR;if(37810===r)return l===Ct?o.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:o.COMPRESSED_RGBA_ASTC_5x5_KHR;if(37811===r)return l===Ct?o.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:o.COMPRESSED_RGBA_ASTC_6x5_KHR;if(37812===r)return l===Ct?o.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:o.COMPRESSED_RGBA_ASTC_6x6_KHR;if(37813===r)return l===Ct?o.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:o.COMPRESSED_RGBA_ASTC_8x5_KHR;if(37814===r)return l===Ct?o.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:o.COMPRESSED_RGBA_ASTC_8x6_KHR;if(37815===r)return l===Ct?o.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:o.COMPRESSED_RGBA_ASTC_8x8_KHR;if(37816===r)return l===Ct?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:o.COMPRESSED_RGBA_ASTC_10x5_KHR;if(37817===r)return l===Ct?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:o.COMPRESSED_RGBA_ASTC_10x6_KHR;if(37818===r)return l===Ct?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:o.COMPRESSED_RGBA_ASTC_10x8_KHR;if(37819===r)return l===Ct?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:o.COMPRESSED_RGBA_ASTC_10x10_KHR;if(37820===r)return l===Ct?o.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:o.COMPRESSED_RGBA_ASTC_12x10_KHR;if(37821===r)return l===Ct?o.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:o.COMPRESSED_RGBA_ASTC_12x12_KHR}if(36492===r||36494===r||36495===r){if(o=e.get("EXT_texture_compression_bptc"),null===o)return null;if(36492===r)return l===Ct?o.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:o.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(36494===r)return o.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(36495===r)return o.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}if(36283===r||36284===r||36285===r||36286===r){if(o=e.get("EXT_texture_compression_rgtc"),null===o)return null;if(36492===r)return o.COMPRESSED_RED_RGTC1_EXT;if(36284===r)return o.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(36285===r)return o.COMPRESSED_RED_GREEN_RGTC2_EXT;if(36286===r)return o.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}return r===Di?n?i.UNSIGNED_INT_24_8:(o=e.get("WEBGL_depth_texture"),null!==o?o.UNSIGNED_INT_24_8_WEBGL:null):void 0!==i[r]?i[r]:null}}}class Zp extends l0{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}class kr extends Rt{constructor(){super(),this.isGroup=!0,this.type="Group"}}const Jp={type:"move"};class N2{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return null===this._hand&&(this._hand=new kr,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return null===this._targetRay&&(this._targetRay=new kr,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new F,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new F),this._targetRay}getGripSpace(){return null===this._grip&&(this._grip=new kr,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new F,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new F),this._grip}dispatchEvent(e){return null!==this._targetRay&&this._targetRay.dispatchEvent(e),null!==this._grip&&this._grip.dispatchEvent(e),null!==this._hand&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const t=this._hand;if(t)for(const n of e.hand.values())this._getHandJoint(t,n)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),null!==this._hand&&(this._hand.visible=!1),this}update(e,t,n){let s=null,r=null,a=null;const o=this._targetRay,l=this._grip,c=this._hand;if(e&&"visible-blurred"!==t.session.visibilityState){if(c&&e.hand){a=!0;for(const y of e.hand.values()){const v=t.getJointPose(y,n),g=this._getHandJoint(c,y);null!==v&&(g.matrix.fromArray(v.transform.matrix),g.matrix.decompose(g.position,g.rotation,g.scale),g.matrixWorldNeedsUpdate=!0,g.jointRadius=v.radius),g.visible=null!==v}const d=c.joints["index-finger-tip"].position.distanceTo(c.joints["thumb-tip"].position),p=.02,m=.005;c.inputState.pinching&&d>p+m?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&d<=p-m&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else null!==l&&e.gripSpace&&(r=t.getPose(e.gripSpace,n),null!==r&&(l.matrix.fromArray(r.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,r.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(r.linearVelocity)):l.hasLinearVelocity=!1,r.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(r.angularVelocity)):l.hasAngularVelocity=!1));null!==o&&(s=t.getPose(e.targetRaySpace,n),null===s&&null!==r&&(s=r),null!==s&&(o.matrix.fromArray(s.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,s.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(s.linearVelocity)):o.hasLinearVelocity=!1,s.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(s.angularVelocity)):o.hasAngularVelocity=!1,this.dispatchEvent(Jp)))}return null!==o&&(o.visible=null!==s),null!==l&&(l.visible=null!==r),null!==c&&(c.visible=null!==a),this}_getHandJoint(e,t){if(void 0===e.joints[t.jointName]){const n=new kr;n.matrixAutoUpdate=!1,n.visible=!1,e.joints[t.jointName]=n,e.add(n)}return e.joints[t.jointName]}}class Qp{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t,n){if(null===this.texture){const s=new A0;e.properties.get(s).__webglTexture=t.texture,(t.depthNear!=n.depthNear||t.depthFar!=n.depthFar)&&(this.depthNear=t.depthNear,this.depthFar=t.depthFar),this.texture=s}}render(e,t){if(null!==this.texture){if(null===this.mesh){const n=t.cameras[0].viewport,s=new yn({extensions:{fragDepth:!0},vertexShader:"\nvoid main() {\n\n\tgl_Position = vec4( position, 1.0 );\n\n}",fragmentShader:"\nuniform sampler2DArray depthColor;\nuniform float depthWidth;\nuniform float depthHeight;\n\nvoid main() {\n\n\tvec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight );\n\n\tif ( coord.x >= 1.0 ) {\n\n\t\tgl_FragDepthEXT = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r;\n\n\t} else {\n\n\t\tgl_FragDepthEXT = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r;\n\n\t}\n\n}",uniforms:{depthColor:{value:this.texture},depthWidth:{value:n.z},depthHeight:{value:n.w}}});this.mesh=new $t(new Nr(20,20),s)}e.render(this.mesh,t)}}reset(){this.texture=null,this.mesh=null}}class jp extends gn{constructor(e,t){super();const n=this;let s=null,r=1,a=null,o="local-floor",l=1,c=null,u=null,f=null,d=null,p=null,m=null;const y=new Qp,v=t.getContextAttributes();let g=null,_=null;const x=[],b=[],T=new H;let E=null;const M=new l0;M.layers.enable(1),M.viewport=new bt;const w=new l0;w.layers.enable(2),w.viewport=new bt;const I=[M,w],S=new Zp;S.layers.enable(1),S.layers.enable(2);let P=null,X=null;function te(Q){const ae=b.indexOf(Q.inputSource);if(-1===ae)return;const xe=x[ae];void 0!==xe&&(xe.update(Q.inputSource,Q.frame,c||a),xe.dispatchEvent({type:Q.type,data:Q.inputSource}))}function U(){s.removeEventListener("select",te),s.removeEventListener("selectstart",te),s.removeEventListener("selectend",te),s.removeEventListener("squeeze",te),s.removeEventListener("squeezestart",te),s.removeEventListener("squeezeend",te),s.removeEventListener("end",U),s.removeEventListener("inputsourceschange",z);for(let Q=0;Q<x.length;Q++){const ae=b[Q];null!==ae&&(b[Q]=null,x[Q].disconnect(ae))}P=null,X=null,y.reset(),e.setRenderTarget(g),p=null,d=null,f=null,s=null,_=null,Ce.stop(),n.isPresenting=!1,e.setPixelRatio(E),e.setSize(T.width,T.height,!1),n.dispatchEvent({type:"sessionend"})}function z(Q){for(let ae=0;ae<Q.removed.length;ae++){const xe=Q.removed[ae],Ee=b.indexOf(xe);Ee>=0&&(b[Ee]=null,x[Ee].disconnect(xe))}for(let ae=0;ae<Q.added.length;ae++){const xe=Q.added[ae];let Ee=b.indexOf(xe);if(-1===Ee){for(let Fe=0;Fe<x.length;Fe++){if(Fe>=b.length){b.push(xe),Ee=Fe;break}if(null===b[Fe]){b[Fe]=xe,Ee=Fe;break}}if(-1===Ee)break}const Le=x[Ee];Le&&Le.connect(xe)}}this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(Q){let ae=x[Q];return void 0===ae&&(ae=new N2,x[Q]=ae),ae.getTargetRaySpace()},this.getControllerGrip=function(Q){let ae=x[Q];return void 0===ae&&(ae=new N2,x[Q]=ae),ae.getGripSpace()},this.getHand=function(Q){let ae=x[Q];return void 0===ae&&(ae=new N2,x[Q]=ae),ae.getHandSpace()},this.setFramebufferScaleFactor=function(Q){r=Q,!0===n.isPresenting&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(Q){o=Q,!0===n.isPresenting&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return c||a},this.setReferenceSpace=function(Q){c=Q},this.getBaseLayer=function(){return null!==d?d:p},this.getBinding=function(){return f},this.getFrame=function(){return m},this.getSession=function(){return s},this.setSession=function(){var Q=(0,pt.A)(function*(ae){if(s=ae,null!==s){if(g=e.getRenderTarget(),s.addEventListener("select",te),s.addEventListener("selectstart",te),s.addEventListener("selectend",te),s.addEventListener("squeeze",te),s.addEventListener("squeezestart",te),s.addEventListener("squeezeend",te),s.addEventListener("end",U),s.addEventListener("inputsourceschange",z),!0!==v.xrCompatible&&(yield t.makeXRCompatible()),E=e.getPixelRatio(),e.getSize(T),void 0===s.renderState.layers||!1===e.capabilities.isWebGL2)p=new XRWebGLLayer(s,t,{antialias:void 0!==s.renderState.layers||v.antialias,alpha:!0,depth:v.depth,stencil:v.stencil,framebufferScaleFactor:r}),s.updateRenderState({baseLayer:p}),e.setPixelRatio(1),e.setSize(p.framebufferWidth,p.framebufferHeight,!1),_=new vn(p.framebufferWidth,p.framebufferHeight,{format:L0,type:ii,colorSpace:e.outputColorSpace,stencilBuffer:v.stencil});else{let xe=null,Ee=null,Le=null;v.depth&&(Le=v.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,xe=v.stencil?bs:Fi,Ee=v.stencil?Di:si);const Fe={colorFormat:t.RGBA8,depthFormat:Le,scaleFactor:r};f=new XRWebGLBinding(s,t),d=f.createProjectionLayer(Fe),s.updateRenderState({layers:[d]}),e.setPixelRatio(1),e.setSize(d.textureWidth,d.textureHeight,!1),_=new vn(d.textureWidth,d.textureHeight,{format:L0,type:ii,depthTexture:new xc(d.textureWidth,d.textureHeight,Ee,void 0,void 0,void 0,void 0,void 0,void 0,xe),stencilBuffer:v.stencil,colorSpace:e.outputColorSpace,samples:v.antialias?4:0}),e.properties.get(_).__ignoreDepthValues=d.ignoreDepthValues}_.isXRRenderTarget=!0,this.setFoveation(l),c=null,a=yield s.requestReferenceSpace(o),Ce.setContext(s),Ce.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}});return function(ae){return Q.apply(this,arguments)}}(),this.getEnvironmentBlendMode=function(){if(null!==s)return s.environmentBlendMode};const G=new F,ee=new F;function Z(Q,ae){null===ae?Q.matrixWorld.copy(Q.matrix):Q.matrixWorld.multiplyMatrices(ae.matrixWorld,Q.matrix),Q.matrixWorldInverse.copy(Q.matrixWorld).invert()}this.updateCamera=function(Q){if(null===s)return;null!==y.texture&&(Q.near=y.depthNear,Q.far=y.depthFar),S.near=w.near=M.near=Q.near,S.far=w.far=M.far=Q.far,(P!==S.near||X!==S.far)&&(s.updateRenderState({depthNear:S.near,depthFar:S.far}),P=S.near,X=S.far,M.near=P,M.far=X,w.near=P,w.far=X,M.updateProjectionMatrix(),w.updateProjectionMatrix(),Q.updateProjectionMatrix());const ae=Q.parent,xe=S.cameras;Z(S,ae);for(let Ee=0;Ee<xe.length;Ee++)Z(xe[Ee],ae);2===xe.length?function J(Q,ae,xe){G.setFromMatrixPosition(ae.matrixWorld),ee.setFromMatrixPosition(xe.matrixWorld);const Ee=G.distanceTo(ee),Le=ae.projectionMatrix.elements,Fe=xe.projectionMatrix.elements,tt=Le[14]/(Le[10]-1),He=Le[14]/(Le[10]+1),B=(Le[9]+1)/Le[5],fe=(Le[9]-1)/Le[5],se=(Le[8]-1)/Le[0],ue=(Fe[8]+1)/Fe[0],re=tt*se,Be=tt*ue,_e=Ee/(-se+ue),R=_e*-se;ae.matrixWorld.decompose(Q.position,Q.quaternion,Q.scale),Q.translateX(R),Q.translateZ(_e),Q.matrixWorld.compose(Q.position,Q.quaternion,Q.scale),Q.matrixWorldInverse.copy(Q.matrixWorld).invert();const C=tt+_e,V=He+_e;Q.projectionMatrix.makePerspective(re-R,Be+(Ee-R),B*He/V*C,fe*He/V*C,C,V),Q.projectionMatrixInverse.copy(Q.projectionMatrix).invert()}(S,M,w):S.projectionMatrix.copy(M.projectionMatrix),function ne(Q,ae,xe){null===xe?Q.matrix.copy(ae.matrixWorld):(Q.matrix.copy(xe.matrixWorld),Q.matrix.invert(),Q.matrix.multiply(ae.matrixWorld)),Q.matrix.decompose(Q.position,Q.quaternion,Q.scale),Q.updateMatrixWorld(!0),Q.projectionMatrix.copy(ae.projectionMatrix),Q.projectionMatrixInverse.copy(ae.projectionMatrixInverse),Q.isPerspectiveCamera&&(Q.fov=2*Ts*Math.atan(1/Q.projectionMatrix.elements[5]),Q.zoom=1)}(Q,S,ae)},this.getCamera=function(){return S},this.getFoveation=function(){if(null!==d||null!==p)return l},this.setFoveation=function(Q){l=Q,null!==d&&(d.fixedFoveation=Q),null!==p&&void 0!==p.fixedFoveation&&(p.fixedFoveation=Q)},this.hasDepthSensing=function(){return null!==y.texture};let Y=null;const Ce=new uc;Ce.setAnimationLoop(function he(Q,ae){if(u=ae.getViewerPose(c||a),m=ae,null!==u){const xe=u.views;null!==p&&(e.setRenderTargetFramebuffer(_,p.framebuffer),e.setRenderTarget(_));let Ee=!1;xe.length!==S.cameras.length&&(S.cameras.length=0,Ee=!0);for(let Fe=0;Fe<xe.length;Fe++){const tt=xe[Fe];let He=null;if(null!==p)He=p.getViewport(tt);else{const fe=f.getViewSubImage(d,tt);He=fe.viewport,0===Fe&&(e.setRenderTargetTextures(_,fe.colorTexture,d.ignoreDepthValues?void 0:fe.depthStencilTexture),e.setRenderTarget(_))}let B=I[Fe];void 0===B&&(B=new l0,B.layers.enable(Fe),B.viewport=new bt,I[Fe]=B),B.matrix.fromArray(tt.transform.matrix),B.matrix.decompose(B.position,B.quaternion,B.scale),B.projectionMatrix.fromArray(tt.projectionMatrix),B.projectionMatrixInverse.copy(B.projectionMatrix).invert(),B.viewport.set(He.x,He.y,He.width,He.height),0===Fe&&(S.matrix.copy(B.matrix),S.matrix.decompose(S.position,S.quaternion,S.scale)),!0===Ee&&S.cameras.push(B)}const Le=s.enabledFeatures;if(Le&&Le.includes("depth-sensing")){const Fe=f.getDepthInformation(xe[0]);Fe&&Fe.isValid&&Fe.texture&&y.init(e,Fe,s.renderState)}}for(let xe=0;xe<x.length;xe++){const Ee=b[xe],Le=x[xe];null!==Ee&&void 0!==Le&&Le.update(Ee,ae,c||a)}y.render(e,S),Y&&Y(Q,ae),ae.detectedPlanes&&n.dispatchEvent({type:"planesdetected",data:ae}),m=null}),this.setAnimationLoop=function(Q){Y=Q},this.dispose=function(){}}}function em(i,e){function t(v,g){!0===v.matrixAutoUpdate&&v.updateMatrix(),g.value.copy(v.matrix)}function r(v,g){v.opacity.value=g.opacity,g.color&&v.diffuse.value.copy(g.color),g.emissive&&v.emissive.value.copy(g.emissive).multiplyScalar(g.emissiveIntensity),g.map&&(v.map.value=g.map,t(g.map,v.mapTransform)),g.alphaMap&&(v.alphaMap.value=g.alphaMap,t(g.alphaMap,v.alphaMapTransform)),g.bumpMap&&(v.bumpMap.value=g.bumpMap,t(g.bumpMap,v.bumpMapTransform),v.bumpScale.value=g.bumpScale,1===g.side&&(v.bumpScale.value*=-1)),g.normalMap&&(v.normalMap.value=g.normalMap,t(g.normalMap,v.normalMapTransform),v.normalScale.value.copy(g.normalScale),1===g.side&&v.normalScale.value.negate()),g.displacementMap&&(v.displacementMap.value=g.displacementMap,t(g.displacementMap,v.displacementMapTransform),v.displacementScale.value=g.displacementScale,v.displacementBias.value=g.displacementBias),g.emissiveMap&&(v.emissiveMap.value=g.emissiveMap,t(g.emissiveMap,v.emissiveMapTransform)),g.specularMap&&(v.specularMap.value=g.specularMap,t(g.specularMap,v.specularMapTransform)),g.alphaTest>0&&(v.alphaTest.value=g.alphaTest);const _=e.get(g).envMap;if(_&&(v.envMap.value=_,v.flipEnvMap.value=_.isCubeTexture&&!1===_.isRenderTargetTexture?-1:1,v.reflectivity.value=g.reflectivity,v.ior.value=g.ior,v.refractionRatio.value=g.refractionRatio),g.lightMap){v.lightMap.value=g.lightMap;const x=!0===i._useLegacyLights?Math.PI:1;v.lightMapIntensity.value=g.lightMapIntensity*x,t(g.lightMap,v.lightMapTransform)}g.aoMap&&(v.aoMap.value=g.aoMap,v.aoMapIntensity.value=g.aoMapIntensity,t(g.aoMap,v.aoMapTransform))}return{refreshFogUniforms:function n(v,g){g.color.getRGB(v.fogColor.value,lc(i)),g.isFog?(v.fogNear.value=g.near,v.fogFar.value=g.far):g.isFogExp2&&(v.fogDensity.value=g.density)},refreshMaterialUniforms:function s(v,g,_,x,b){g.isMeshBasicMaterial||g.isMeshLambertMaterial?r(v,g):g.isMeshToonMaterial?(r(v,g),function f(v,g){g.gradientMap&&(v.gradientMap.value=g.gradientMap)}(v,g)):g.isMeshPhongMaterial?(r(v,g),function u(v,g){v.specular.value.copy(g.specular),v.shininess.value=Math.max(g.shininess,1e-4)}(v,g)):g.isMeshStandardMaterial?(r(v,g),function d(v,g){v.metalness.value=g.metalness,g.metalnessMap&&(v.metalnessMap.value=g.metalnessMap,t(g.metalnessMap,v.metalnessMapTransform)),v.roughness.value=g.roughness,g.roughnessMap&&(v.roughnessMap.value=g.roughnessMap,t(g.roughnessMap,v.roughnessMapTransform)),e.get(g).envMap&&(v.envMapIntensity.value=g.envMapIntensity)}(v,g),g.isMeshPhysicalMaterial&&function p(v,g,_){v.ior.value=g.ior,g.sheen>0&&(v.sheenColor.value.copy(g.sheenColor).multiplyScalar(g.sheen),v.sheenRoughness.value=g.sheenRoughness,g.sheenColorMap&&(v.sheenColorMap.value=g.sheenColorMap,t(g.sheenColorMap,v.sheenColorMapTransform)),g.sheenRoughnessMap&&(v.sheenRoughnessMap.value=g.sheenRoughnessMap,t(g.sheenRoughnessMap,v.sheenRoughnessMapTransform))),g.clearcoat>0&&(v.clearcoat.value=g.clearcoat,v.clearcoatRoughness.value=g.clearcoatRoughness,g.clearcoatMap&&(v.clearcoatMap.value=g.clearcoatMap,t(g.clearcoatMap,v.clearcoatMapTransform)),g.clearcoatRoughnessMap&&(v.clearcoatRoughnessMap.value=g.clearcoatRoughnessMap,t(g.clearcoatRoughnessMap,v.clearcoatRoughnessMapTransform)),g.clearcoatNormalMap&&(v.clearcoatNormalMap.value=g.clearcoatNormalMap,t(g.clearcoatNormalMap,v.clearcoatNormalMapTransform),v.clearcoatNormalScale.value.copy(g.clearcoatNormalScale),1===g.side&&v.clearcoatNormalScale.value.negate())),g.iridescence>0&&(v.iridescence.value=g.iridescence,v.iridescenceIOR.value=g.iridescenceIOR,v.iridescenceThicknessMinimum.value=g.iridescenceThicknessRange[0],v.iridescenceThicknessMaximum.value=g.iridescenceThicknessRange[1],g.iridescenceMap&&(v.iridescenceMap.value=g.iridescenceMap,t(g.iridescenceMap,v.iridescenceMapTransform)),g.iridescenceThicknessMap&&(v.iridescenceThicknessMap.value=g.iridescenceThicknessMap,t(g.iridescenceThicknessMap,v.iridescenceThicknessMapTransform))),g.transmission>0&&(v.transmission.value=g.transmission,v.transmissionSamplerMap.value=_.texture,v.transmissionSamplerSize.value.set(_.width,_.height),g.transmissionMap&&(v.transmissionMap.value=g.transmissionMap,t(g.transmissionMap,v.transmissionMapTransform)),v.thickness.value=g.thickness,g.thicknessMap&&(v.thicknessMap.value=g.thicknessMap,t(g.thicknessMap,v.thicknessMapTransform)),v.attenuationDistance.value=g.attenuationDistance,v.attenuationColor.value.copy(g.attenuationColor)),g.anisotropy>0&&(v.anisotropyVector.value.set(g.anisotropy*Math.cos(g.anisotropyRotation),g.anisotropy*Math.sin(g.anisotropyRotation)),g.anisotropyMap&&(v.anisotropyMap.value=g.anisotropyMap,t(g.anisotropyMap,v.anisotropyMapTransform))),v.specularIntensity.value=g.specularIntensity,v.specularColor.value.copy(g.specularColor),g.specularColorMap&&(v.specularColorMap.value=g.specularColorMap,t(g.specularColorMap,v.specularColorMapTransform)),g.specularIntensityMap&&(v.specularIntensityMap.value=g.specularIntensityMap,t(g.specularIntensityMap,v.specularIntensityMapTransform))}(v,g,b)):g.isMeshMatcapMaterial?(r(v,g),function m(v,g){g.matcap&&(v.matcap.value=g.matcap)}(v,g)):g.isMeshDepthMaterial?r(v,g):g.isMeshDistanceMaterial?(r(v,g),function y(v,g){const _=e.get(g).light;v.referencePosition.value.setFromMatrixPosition(_.matrixWorld),v.nearDistance.value=_.shadow.camera.near,v.farDistance.value=_.shadow.camera.far}(v,g)):g.isMeshNormalMaterial?r(v,g):g.isLineBasicMaterial?(function a(v,g){v.diffuse.value.copy(g.color),v.opacity.value=g.opacity,g.map&&(v.map.value=g.map,t(g.map,v.mapTransform))}(v,g),g.isLineDashedMaterial&&function o(v,g){v.dashSize.value=g.dashSize,v.totalSize.value=g.dashSize+g.gapSize,v.scale.value=g.scale}(v,g)):g.isPointsMaterial?function l(v,g,_,x){v.diffuse.value.copy(g.color),v.opacity.value=g.opacity,v.size.value=g.size*_,v.scale.value=.5*x,g.map&&(v.map.value=g.map,t(g.map,v.uvTransform)),g.alphaMap&&(v.alphaMap.value=g.alphaMap,t(g.alphaMap,v.alphaMapTransform)),g.alphaTest>0&&(v.alphaTest.value=g.alphaTest)}(v,g,_,x):g.isSpriteMaterial?function c(v,g){v.diffuse.value.copy(g.color),v.opacity.value=g.opacity,v.rotation.value=g.rotation,g.map&&(v.map.value=g.map,t(g.map,v.mapTransform)),g.alphaMap&&(v.alphaMap.value=g.alphaMap,t(g.alphaMap,v.alphaMapTransform)),g.alphaTest>0&&(v.alphaTest.value=g.alphaTest)}(v,g):g.isShadowMaterial?(v.color.value.copy(g.color),v.opacity.value=g.opacity):g.isShaderMaterial&&(g.uniformsNeedUpdate=!1)}}}function tm(i,e,t,n){let s={},r={},a=[];const o=t.isWebGL2?i.getParameter(i.MAX_UNIFORM_BUFFER_BINDINGS):0;function p(_,x,b,T){const E=_.value,M=x+"_"+b;if(void 0===T[M])return T[M]="number"==typeof E||"boolean"==typeof E?E:E.clone(),!0;{const w=T[M];if("number"==typeof E||"boolean"==typeof E){if(w!==E)return T[M]=E,!0}else if(!1===w.equals(E))return w.copy(E),!0}return!1}function y(_){const x={boundary:0,storage:0};return"number"==typeof _||"boolean"==typeof _?(x.boundary=4,x.storage=4):_.isVector2?(x.boundary=8,x.storage=8):_.isVector3||_.isColor?(x.boundary=16,x.storage=12):_.isVector4?(x.boundary=16,x.storage=16):_.isMatrix3?(x.boundary=48,x.storage=48):_.isMatrix4?(x.boundary=64,x.storage=64):_.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",_),x}function v(_){const x=_.target;x.removeEventListener("dispose",v);const b=a.indexOf(x.__bindingPointIndex);a.splice(b,1),i.deleteBuffer(s[x.id]),delete s[x.id],delete r[x.id]}return{bind:function l(_,x){n.uniformBlockBinding(_,x.program)},update:function c(_,x){let b=s[_.id];void 0===b&&(function m(_){const x=_.uniforms;let b=0;for(let M=0,w=x.length;M<w;M++){const I=Array.isArray(x[M])?x[M]:[x[M]];for(let S=0,P=I.length;S<P;S++){const X=I[S],te=Array.isArray(X.value)?X.value:[X.value];for(let U=0,z=te.length;U<z;U++){const ee=y(te[U]),J=b%16;0!==J&&16-J<ee.boundary&&(b+=16-J),X.__data=new Float32Array(ee.storage/Float32Array.BYTES_PER_ELEMENT),X.__offset=b,b+=ee.storage}}}const E=b%16;E>0&&(b+=16-E),_.__size=b,_.__cache={}}(_),b=function u(_){const x=function f(){for(let _=0;_<o;_++)if(-1===a.indexOf(_))return a.push(_),_;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}();_.__bindingPointIndex=x;const b=i.createBuffer(),T=_.__size,E=_.usage;return i.bindBuffer(i.UNIFORM_BUFFER,b),i.bufferData(i.UNIFORM_BUFFER,T,E),i.bindBuffer(i.UNIFORM_BUFFER,null),i.bindBufferBase(i.UNIFORM_BUFFER,x,b),b}(_),s[_.id]=b,_.addEventListener("dispose",v)),n.updateUBOMapping(_,x.program);const E=e.render.frame;r[_.id]!==E&&(function d(_){const b=_.uniforms,T=_.__cache;i.bindBuffer(i.UNIFORM_BUFFER,s[_.id]);for(let E=0,M=b.length;E<M;E++){const w=Array.isArray(b[E])?b[E]:[b[E]];for(let I=0,S=w.length;I<S;I++){const P=w[I];if(!0===p(P,E,I,T)){const X=P.__offset,te=Array.isArray(P.value)?P.value:[P.value];let U=0;for(let z=0;z<te.length;z++){const G=te[z],ee=y(G);"number"==typeof G||"boolean"==typeof G?(P.__data[0]=G,i.bufferSubData(i.UNIFORM_BUFFER,X+U,P.__data)):G.isMatrix3?(P.__data[0]=G.elements[0],P.__data[1]=G.elements[1],P.__data[2]=G.elements[2],P.__data[3]=0,P.__data[4]=G.elements[3],P.__data[5]=G.elements[4],P.__data[6]=G.elements[5],P.__data[7]=0,P.__data[8]=G.elements[6],P.__data[9]=G.elements[7],P.__data[10]=G.elements[8],P.__data[11]=0):(G.toArray(P.__data,U),U+=ee.storage/Float32Array.BYTES_PER_ELEMENT)}i.bufferSubData(i.UNIFORM_BUFFER,X,P.__data)}}}i.bindBuffer(i.UNIFORM_BUFFER,null)}(_),r[_.id]=E)},dispose:function g(){for(const _ in s)i.deleteBuffer(s[_]);a=[],s={},r={}}}}class Hc{constructor(e={}){const{canvas:t=Pf(),context:n=null,depth:s=!0,stencil:r=!0,alpha:a=!1,antialias:o=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:c=!1,powerPreference:u="default",failIfMajorPerformanceCaveat:f=!1}=e;let d;this.isWebGLRenderer=!0,d=null!==n?n.getContextAttributes().alpha:a;const p=new Uint32Array(4),m=new Int32Array(4);let y=null,v=null;const g=[],_=[];this.domElement=t,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this._outputColorSpace=t0,this._useLegacyLights=!1,this.toneMapping=0,this.toneMappingExposure=1;const x=this;let b=!1,T=0,E=0,M=null,w=-1,I=null;const S=new bt,P=new bt;let X=null;const te=new be(0);let U=0,z=t.width,G=t.height,ee=1,J=null,Z=null;const ne=new bt(0,0,z,G),Y=new bt(0,0,z,G);let he=!1;const Ce=new vo;let Q=!1,ae=!1,xe=null;const Ee=new $e,Le=new H,Fe=new F,tt={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function He(){return null===M?ee:1}let se,ue,re,Be,_e,R,C,V,ce,le,oe,De,ve,we,We,st,D,ge,Se,Ie,Oe,Te,nt,gt,B=n;function fe(L,W){for(let $=0;$<L.length;$++){const K=t.getContext(L[$],W);if(null!==K)return K}return null}try{const L={alpha:!0,depth:s,stencil:r,antialias:o,premultipliedAlpha:l,preserveDrawingBuffer:c,powerPreference:u,failIfMajorPerformanceCaveat:f};if("setAttribute"in t&&t.setAttribute("data-engine","three.js r161"),t.addEventListener("webglcontextlost",Mt,!1),t.addEventListener("webglcontextrestored",k,!1),t.addEventListener("webglcontextcreationerror",de,!1),null===B){const W=["webgl2","webgl","experimental-webgl"];if(!0===x.isWebGL1Renderer&&W.shift(),B=fe(W,L),null===B)throw fe(W)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}typeof WebGLRenderingContext<"u"&&B instanceof WebGLRenderingContext&&console.warn("THREE.WebGLRenderer: WebGL 1 support was deprecated in r153 and will be removed in r163."),void 0===B.getShaderPrecisionFormat&&(B.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(L){throw console.error("THREE.WebGLRenderer: "+L.message),L}function mt(){se=new h9(B),ue=new s9(B,se,e),se.init(ue),Te=new qp(B,se,ue),re=new Xp(B,se,ue),Be=new d9(B),_e=new Dp,R=new Yp(B,se,re,_e,ue,Te,Be),C=new a9(x),V=new c9(x),ce=new t7(B,ue),nt=new n9(B,se,ce,ue),le=new u9(B,ce,Be,nt),oe=new v9(B,le,ce,Be),Se=new g9(B,ue,R),st=new r9(_e),De=new Ip(x,C,V,se,ue,nt,st),ve=new em(x,_e),we=new Op,We=new zp(se,ue),ge=new t9(x,C,V,re,oe,d,l),D=new Wp(x,oe,ue),gt=new tm(B,Be,ue,re),Ie=new i9(B,se,Be,ue),Oe=new f9(B,se,Be,ue),Be.programs=De.programs,x.capabilities=ue,x.extensions=se,x.properties=_e,x.renderLists=we,x.shadowMap=D,x.state=re,x.info=Be}mt();const Qe=new jp(x,B);function Mt(L){L.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),b=!0}function k(){console.log("THREE.WebGLRenderer: Context Restored."),b=!1;const L=Be.autoReset,W=D.enabled,$=D.autoUpdate,j=D.needsUpdate,K=D.type;mt(),Be.autoReset=L,D.enabled=W,D.autoUpdate=$,D.needsUpdate=j,D.type=K}function de(L){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",L.statusMessage)}function pe(L){const W=L.target;W.removeEventListener("dispose",pe),function Ue(L){(function qe(L){const W=_e.get(L).programs;void 0!==W&&(W.forEach(function($){De.releaseProgram($)}),L.isShaderMaterial&&De.releaseShaderCache(L))})(L),_e.remove(L)}(W)}function xt(L,W,$){!0===L.transparent&&2===L.side&&!1===L.forceSinglePass?(L.side=1,L.needsUpdate=!0,N1(L,W,$),L.side=0,L.needsUpdate=!0,N1(L,W,$),L.side=2):N1(L,W,$)}this.xr=Qe,this.getContext=function(){return B},this.getContextAttributes=function(){return B.getContextAttributes()},this.forceContextLoss=function(){const L=se.get("WEBGL_lose_context");L&&L.loseContext()},this.forceContextRestore=function(){const L=se.get("WEBGL_lose_context");L&&L.restoreContext()},this.getPixelRatio=function(){return ee},this.setPixelRatio=function(L){void 0!==L&&(ee=L,this.setSize(z,G,!1))},this.getSize=function(L){return L.set(z,G)},this.setSize=function(L,W,$=!0){Qe.isPresenting?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(z=L,G=W,t.width=Math.floor(L*ee),t.height=Math.floor(W*ee),!0===$&&(t.style.width=L+"px",t.style.height=W+"px"),this.setViewport(0,0,L,W))},this.getDrawingBufferSize=function(L){return L.set(z*ee,G*ee).floor()},this.setDrawingBufferSize=function(L,W,$){z=L,G=W,ee=$,t.width=Math.floor(L*$),t.height=Math.floor(W*$),this.setViewport(0,0,L,W)},this.getCurrentViewport=function(L){return L.copy(S)},this.getViewport=function(L){return L.copy(ne)},this.setViewport=function(L,W,$,j){L.isVector4?ne.set(L.x,L.y,L.z,L.w):ne.set(L,W,$,j),re.viewport(S.copy(ne).multiplyScalar(ee).floor())},this.getScissor=function(L){return L.copy(Y)},this.setScissor=function(L,W,$,j){L.isVector4?Y.set(L.x,L.y,L.z,L.w):Y.set(L,W,$,j),re.scissor(P.copy(Y).multiplyScalar(ee).floor())},this.getScissorTest=function(){return he},this.setScissorTest=function(L){re.setScissorTest(he=L)},this.setOpaqueSort=function(L){J=L},this.setTransparentSort=function(L){Z=L},this.getClearColor=function(L){return L.copy(ge.getClearColor())},this.setClearColor=function(){ge.setClearColor.apply(ge,arguments)},this.getClearAlpha=function(){return ge.getClearAlpha()},this.setClearAlpha=function(){ge.setClearAlpha.apply(ge,arguments)},this.clear=function(L=!0,W=!0,$=!0){let j=0;if(L){let K=!1;if(null!==M){const Ae=M.texture.format;K=1033===Ae||1031===Ae||1029===Ae}if(K){const Ae=M.texture.type,Ge=Ae===ii||Ae===si||1012===Ae||Ae===Di||1017===Ae||1018===Ae,Je=ge.getClearColor(),it=ge.getClearAlpha(),ut=Je.r,at=Je.g,ot=Je.b;Ge?(p[0]=ut,p[1]=at,p[2]=ot,p[3]=it,B.clearBufferuiv(B.COLOR,0,p)):(m[0]=ut,m[1]=at,m[2]=ot,m[3]=it,B.clearBufferiv(B.COLOR,0,m))}else j|=B.COLOR_BUFFER_BIT}W&&(j|=B.DEPTH_BUFFER_BIT),$&&(j|=B.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),B.clear(j)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){t.removeEventListener("webglcontextlost",Mt,!1),t.removeEventListener("webglcontextrestored",k,!1),t.removeEventListener("webglcontextcreationerror",de,!1),we.dispose(),We.dispose(),_e.dispose(),C.dispose(),V.dispose(),oe.dispose(),nt.dispose(),gt.dispose(),De.dispose(),Qe.dispose(),Qe.removeEventListener("sessionstart",K0),Qe.removeEventListener("sessionend",At),xe&&(xe.dispose(),xe=null),T0.stop()},this.renderBufferDirect=function(L,W,$,j,K,Ae){null===W&&(W=tt);const Ge=K.isMesh&&K.matrixWorld.determinant()<0,Je=function KM(L,W,$,j,K){!0!==W.isScene&&(W=tt),R.resetTextureUnits();const Ae=W.fog,Je=null===M?x.outputColorSpace:!0===M.isXRRenderTarget?M.texture.colorSpace:Fn,it=(j.isMeshStandardMaterial?V:C).get(j.envMap||(j.isMeshStandardMaterial?W.environment:null)),ut=!0===j.vertexColors&&!!$.attributes.color&&4===$.attributes.color.itemSize,at=!!$.attributes.tangent&&(!!j.normalMap||j.anisotropy>0),ot=!!$.morphAttributes.position,Yt=!!$.morphAttributes.normal,H0=!!$.morphAttributes.color;let s0=0;j.toneMapped&&(null===M||!0===M.isXRRenderTarget)&&(s0=x.toneMapping);const Jn=$.morphAttributes.position||$.morphAttributes.normal||$.morphAttributes.color,Ot=void 0!==Jn?Jn.length:0,ft=_e.get(j),W4=v.state.lights;!0!==Q||!0!==ae&&L===I||st.setState(j,L,L===I&&j.id===w);let Ht=!1;j.version===ft.__version?(ft.needsLights&&ft.lightsStateVersion!==W4.state.version||ft.outputColorSpace!==Je||K.isBatchedMesh&&!1===ft.batching||!K.isBatchedMesh&&!0===ft.batching||K.isInstancedMesh&&!1===ft.instancing||!K.isInstancedMesh&&!0===ft.instancing||K.isSkinnedMesh&&!1===ft.skinning||!K.isSkinnedMesh&&!0===ft.skinning||K.isInstancedMesh&&!0===ft.instancingColor&&null===K.instanceColor||K.isInstancedMesh&&!1===ft.instancingColor&&null!==K.instanceColor||ft.envMap!==it||!0===j.fog&&ft.fog!==Ae||void 0!==ft.numClippingPlanes&&(ft.numClippingPlanes!==st.numPlanes||ft.numIntersection!==st.numIntersection)||ft.vertexAlphas!==ut||ft.vertexTangents!==at||ft.morphTargets!==ot||ft.morphNormals!==Yt||ft.morphColors!==H0||ft.toneMapping!==s0||!0===ue.isWebGL2&&ft.morphTargetsCount!==Ot)&&(Ht=!0):(Ht=!0,ft.__version=j.version);let ds=ft.currentProgram;!0===Ht&&(ds=N1(j,W,K));let t8=!1,Pa=!1,X4=!1;const f0=ds.getUniforms(),ps=ft.uniforms;if(re.useProgram(ds.program)&&(t8=!0,Pa=!0,X4=!0),j.id!==w&&(w=j.id,Pa=!0),t8||I!==L){f0.setValue(B,"projectionMatrix",L.projectionMatrix),f0.setValue(B,"viewMatrix",L.matrixWorldInverse);const $0=f0.map.cameraPosition;void 0!==$0&&$0.setValue(B,Fe.setFromMatrixPosition(L.matrixWorld)),ue.logarithmicDepthBuffer&&f0.setValue(B,"logDepthBufFC",2/(Math.log(L.far+1)/Math.LN2)),(j.isMeshPhongMaterial||j.isMeshToonMaterial||j.isMeshLambertMaterial||j.isMeshBasicMaterial||j.isMeshStandardMaterial||j.isShaderMaterial)&&f0.setValue(B,"isOrthographic",!0===L.isOrthographicCamera),I!==L&&(I=L,Pa=!0,X4=!0)}if(K.isSkinnedMesh){f0.setOptional(B,K,"bindMatrix"),f0.setOptional(B,K,"bindMatrixInverse");const $0=K.skeleton;$0&&(ue.floatVertexTextures?(null===$0.boneTexture&&$0.computeBoneTexture(),f0.setValue(B,"boneTexture",$0.boneTexture,R)):console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required."))}K.isBatchedMesh&&(f0.setOptional(B,K,"batchingTexture"),f0.setValue(B,"batchingTexture",K._matricesTexture,R));const Y4=$.morphAttributes;if((void 0!==Y4.position||void 0!==Y4.normal||void 0!==Y4.color&&!0===ue.isWebGL2)&&Se.update(K,$,ds),(Pa||ft.receiveShadow!==K.receiveShadow)&&(ft.receiveShadow=K.receiveShadow,f0.setValue(B,"receiveShadow",K.receiveShadow)),j.isMeshGouraudMaterial&&null!==j.envMap&&(ps.envMap.value=it,ps.flipEnvMap.value=it.isCubeTexture&&!1===it.isRenderTargetTexture?-1:1),Pa&&(f0.setValue(B,"toneMappingExposure",x.toneMappingExposure),ft.needsLights&&function $M(L,W){L.ambientLightColor.needsUpdate=W,L.lightProbe.needsUpdate=W,L.directionalLights.needsUpdate=W,L.directionalLightShadows.needsUpdate=W,L.pointLights.needsUpdate=W,L.pointLightShadows.needsUpdate=W,L.spotLights.needsUpdate=W,L.spotLightShadows.needsUpdate=W,L.rectAreaLights.needsUpdate=W,L.hemisphereLights.needsUpdate=W}(ps,X4),Ae&&!0===j.fog&&ve.refreshFogUniforms(ps,Ae),ve.refreshMaterialUniforms(ps,j,ee,G,xe),So.upload(B,ju(ft),ps,R)),j.isShaderMaterial&&!0===j.uniformsNeedUpdate&&(So.upload(B,ju(ft),ps,R),j.uniformsNeedUpdate=!1),j.isSpriteMaterial&&f0.setValue(B,"center",K.center),f0.setValue(B,"modelViewMatrix",K.modelViewMatrix),f0.setValue(B,"normalMatrix",K.normalMatrix),f0.setValue(B,"modelMatrix",K.matrixWorld),j.isShaderMaterial||j.isRawShaderMaterial){const $0=j.uniformsGroups;for(let q4=0,jM=$0.length;q4<jM;q4++)if(ue.isWebGL2){const n8=$0[q4];gt.update(n8,ds),gt.bind(n8,ds)}else console.warn("THREE.WebGLRenderer: Uniform Buffer Objects can only be used with WebGL 2.")}return ds}(L,W,$,j,K);re.setMaterial(j,Ge);let it=$.index,ut=1;if(!0===j.wireframe){if(it=le.getWireframeAttribute($),void 0===it)return;ut=2}const at=$.drawRange,ot=$.attributes.position;let Yt=at.start*ut,H0=(at.start+at.count)*ut;null!==Ae&&(Yt=Math.max(Yt,Ae.start*ut),H0=Math.min(H0,(Ae.start+Ae.count)*ut)),null!==it?(Yt=Math.max(Yt,0),H0=Math.min(H0,it.count)):null!=ot&&(Yt=Math.max(Yt,0),H0=Math.min(H0,ot.count));const s0=H0-Yt;if(s0<0||s0===1/0)return;nt.setup(K,j,Je,$,it);let Jn,Ot=Ie;if(null!==it&&(Jn=ce.get(it),Ot=Oe,Ot.setIndex(Jn)),K.isMesh)!0===j.wireframe?(re.setLineWidth(j.wireframeLinewidth*He()),Ot.setMode(B.LINES)):Ot.setMode(B.TRIANGLES);else if(K.isLine){let ft=j.linewidth;void 0===ft&&(ft=1),re.setLineWidth(ft*He()),Ot.setMode(K.isLineSegments?B.LINES:K.isLineLoop?B.LINE_LOOP:B.LINE_STRIP)}else K.isPoints?Ot.setMode(B.POINTS):K.isSprite&&Ot.setMode(B.TRIANGLES);if(K.isBatchedMesh)Ot.renderMultiDraw(K._multiDrawStarts,K._multiDrawCounts,K._multiDrawCount);else if(K.isInstancedMesh)Ot.renderInstances(Yt,s0,K.count);else if($.isInstancedBufferGeometry){const W4=Math.min($.instanceCount,void 0!==$._maxInstanceCount?$._maxInstanceCount:1/0);Ot.renderInstances(Yt,s0,W4)}else Ot.render(Yt,s0)},this.compile=function(L,W,$=null){null===$&&($=L),v=We.get($),v.init(),_.push(v),$.traverseVisible(function(K){K.isLight&&K.layers.test(W.layers)&&(v.pushLight(K),K.castShadow&&v.pushShadow(K))}),L!==$&&L.traverseVisible(function(K){K.isLight&&K.layers.test(W.layers)&&(v.pushLight(K),K.castShadow&&v.pushShadow(K))}),v.setupLights(x._useLegacyLights);const j=new Set;return L.traverse(function(K){const Ae=K.material;if(Ae)if(Array.isArray(Ae))for(let Ge=0;Ge<Ae.length;Ge++){const Je=Ae[Ge];xt(Je,$,K),j.add(Je)}else xt(Ae,$,K),j.add(Ae)}),_.pop(),v=null,j},this.compileAsync=function(L,W,$=null){const j=this.compile(L,W,$);return new Promise(K=>{function Ae(){j.forEach(function(Ge){_e.get(Ge).currentProgram.isReady()&&j.delete(Ge)}),0!==j.size?setTimeout(Ae,10):K(L)}null!==se.get("KHR_parallel_shader_compile")?Ae():setTimeout(Ae,10)})};let wt=null;function K0(){T0.stop()}function At(){T0.start()}const T0=new uc;function Cn(L,W,$,j){if(!1===L.visible)return;if(L.layers.test(W.layers))if(L.isGroup)$=L.renderOrder;else if(L.isLOD)!0===L.autoUpdate&&L.update(W);else if(L.isLight)v.pushLight(L),L.castShadow&&v.pushShadow(L);else if(L.isSprite){if(!L.frustumCulled||Ce.intersectsSprite(L)){j&&Fe.setFromMatrixPosition(L.matrixWorld).applyMatrix4(Ee);const Ge=oe.update(L),Je=L.material;Je.visible&&y.push(L,Ge,Je,$,Fe.z,null)}}else if((L.isMesh||L.isLine||L.isPoints)&&(!L.frustumCulled||Ce.intersectsObject(L))){const Ge=oe.update(L),Je=L.material;if(j&&(void 0!==L.boundingSphere?(null===L.boundingSphere&&L.computeBoundingSphere(),Fe.copy(L.boundingSphere.center)):(null===Ge.boundingSphere&&Ge.computeBoundingSphere(),Fe.copy(Ge.boundingSphere.center)),Fe.applyMatrix4(L.matrixWorld).applyMatrix4(Ee)),Array.isArray(Je)){const it=Ge.groups;for(let ut=0,at=it.length;ut<at;ut++){const ot=it[ut],Yt=Je[ot.materialIndex];Yt&&Yt.visible&&y.push(L,Ge,Yt,$,Fe.z,ot)}}else Je.visible&&y.push(L,Ge,Je,$,Fe.z,null)}const Ae=L.children;for(let Ge=0,Je=Ae.length;Ge<Je;Ge++)Cn(Ae[Ge],W,$,j)}function $u(L,W,$,j){const K=L.opaque,Ae=L.transmissive,Ge=L.transparent;v.setupLightsView($),!0===Q&&st.setGlobalState(x.clippingPlanes,$),Ae.length>0&&function JM(L,W,$,j){if(null!==(!0===$.isScene?$.overrideMaterial:null))return;const Ae=ue.isWebGL2;null===xe&&(xe=new vn(1,1,{generateMipmaps:!0,type:se.has("EXT_color_buffer_half_float")?Ar:ii,minFilter:Dn,samples:Ae?4:0})),x.getDrawingBufferSize(Le),Ae?xe.setSize(Le.x,Le.y):xe.setSize(Ja(Le.x),Ja(Le.y));const Ge=x.getRenderTarget();x.setRenderTarget(xe),x.getClearColor(te),U=x.getClearAlpha(),U<1&&x.setClearColor(16777215,.5),x.clear();const Je=x.toneMapping;x.toneMapping=0,O1(L,$,j),R.updateMultisampleRenderTarget(xe),R.updateRenderTargetMipmap(xe);let it=!1;for(let ut=0,at=W.length;ut<at;ut++){const ot=W[ut],Yt=ot.object,H0=ot.geometry,s0=ot.material,Jn=ot.group;if(2===s0.side&&Yt.layers.test(j.layers)){const Ot=s0.side;s0.side=1,s0.needsUpdate=!0,Qu(Yt,$,j,H0,s0,Jn),s0.side=Ot,s0.needsUpdate=!0,it=!0}}!0===it&&(R.updateMultisampleRenderTarget(xe),R.updateRenderTargetMipmap(xe)),x.setRenderTarget(Ge),x.setClearColor(te,U),x.toneMapping=Je}(K,Ae,W,$),j&&re.viewport(S.copy(j)),K.length>0&&O1(K,W,$),Ae.length>0&&O1(Ae,W,$),Ge.length>0&&O1(Ge,W,$),re.buffers.depth.setTest(!0),re.buffers.depth.setMask(!0),re.buffers.color.setMask(!0),re.setPolygonOffset(!1)}function O1(L,W,$){const j=!0===W.isScene?W.overrideMaterial:null;for(let K=0,Ae=L.length;K<Ae;K++){const Ge=L[K],Je=Ge.object,it=Ge.geometry,ut=null===j?Ge.material:j,at=Ge.group;Je.layers.test($.layers)&&Qu(Je,W,$,it,ut,at)}}function Qu(L,W,$,j,K,Ae){L.onBeforeRender(x,W,$,j,K,Ae),L.modelViewMatrix.multiplyMatrices($.matrixWorldInverse,L.matrixWorld),L.normalMatrix.getNormalMatrix(L.modelViewMatrix),K.onBeforeRender(x,W,$,j,L,Ae),!0===K.transparent&&2===K.side&&!1===K.forceSinglePass?(K.side=1,K.needsUpdate=!0,x.renderBufferDirect($,W,j,K,L,Ae),K.side=0,K.needsUpdate=!0,x.renderBufferDirect($,W,j,K,L,Ae),K.side=2):x.renderBufferDirect($,W,j,K,L,Ae),L.onAfterRender(x,W,$,j,K,Ae)}function N1(L,W,$){!0!==W.isScene&&(W=tt);const j=_e.get(L),K=v.state.lights,Ge=K.state.version,Je=De.getParameters(L,K.state,v.state.shadowsArray,W,$),it=De.getProgramCacheKey(Je);let ut=j.programs;j.environment=L.isMeshStandardMaterial?W.environment:null,j.fog=W.fog,j.envMap=(L.isMeshStandardMaterial?V:C).get(L.envMap||j.environment),void 0===ut&&(L.addEventListener("dispose",pe),ut=new Map,j.programs=ut);let at=ut.get(it);if(void 0!==at){if(j.currentProgram===at&&j.lightsStateVersion===Ge)return e8(L,Je),at}else Je.uniforms=De.getUniforms(L),L.onBuild($,Je,x),L.onBeforeCompile(Je,x),at=De.acquireProgram(Je,it),ut.set(it,at),j.uniforms=Je.uniforms;const ot=j.uniforms;return(!L.isShaderMaterial&&!L.isRawShaderMaterial||!0===L.clipping)&&(ot.clippingPlanes=st.uniform),e8(L,Je),j.needsLights=function QM(L){return L.isMeshLambertMaterial||L.isMeshToonMaterial||L.isMeshPhongMaterial||L.isMeshStandardMaterial||L.isShadowMaterial||L.isShaderMaterial&&!0===L.lights}(L),j.lightsStateVersion=Ge,j.needsLights&&(ot.ambientLightColor.value=K.state.ambient,ot.lightProbe.value=K.state.probe,ot.directionalLights.value=K.state.directional,ot.directionalLightShadows.value=K.state.directionalShadow,ot.spotLights.value=K.state.spot,ot.spotLightShadows.value=K.state.spotShadow,ot.rectAreaLights.value=K.state.rectArea,ot.ltc_1.value=K.state.rectAreaLTC1,ot.ltc_2.value=K.state.rectAreaLTC2,ot.pointLights.value=K.state.point,ot.pointLightShadows.value=K.state.pointShadow,ot.hemisphereLights.value=K.state.hemi,ot.directionalShadowMap.value=K.state.directionalShadowMap,ot.directionalShadowMatrix.value=K.state.directionalShadowMatrix,ot.spotShadowMap.value=K.state.spotShadowMap,ot.spotLightMatrix.value=K.state.spotLightMatrix,ot.spotLightMap.value=K.state.spotLightMap,ot.pointShadowMap.value=K.state.pointShadowMap,ot.pointShadowMatrix.value=K.state.pointShadowMatrix),j.currentProgram=at,j.uniformsList=null,at}function ju(L){if(null===L.uniformsList){const W=L.currentProgram.getUniforms();L.uniformsList=So.seqWithValue(W.seq,L.uniforms)}return L.uniformsList}function e8(L,W){const $=_e.get(L);$.outputColorSpace=W.outputColorSpace,$.batching=W.batching,$.instancing=W.instancing,$.instancingColor=W.instancingColor,$.skinning=W.skinning,$.morphTargets=W.morphTargets,$.morphNormals=W.morphNormals,$.morphColors=W.morphColors,$.morphTargetsCount=W.morphTargetsCount,$.numClippingPlanes=W.numClippingPlanes,$.numIntersection=W.numClipIntersection,$.vertexAlphas=W.vertexAlphas,$.vertexTangents=W.vertexTangents,$.toneMapping=W.toneMapping}T0.setAnimationLoop(function r0(L){wt&&wt(L)}),typeof self<"u"&&T0.setContext(self),this.setAnimationLoop=function(L){wt=L,Qe.setAnimationLoop(L),null===L?T0.stop():T0.start()},Qe.addEventListener("sessionstart",K0),Qe.addEventListener("sessionend",At),this.render=function(L,W){if(void 0===W||!0===W.isCamera){if(!0!==b){if(!0===L.matrixWorldAutoUpdate&&L.updateMatrixWorld(),null===W.parent&&!0===W.matrixWorldAutoUpdate&&W.updateMatrixWorld(),!0===Qe.enabled&&!0===Qe.isPresenting&&(!0===Qe.cameraAutoUpdate&&Qe.updateCamera(W),W=Qe.getCamera()),!0===L.isScene&&L.onBeforeRender(x,L,W,M),v=We.get(L,_.length),v.init(),_.push(v),Ee.multiplyMatrices(W.projectionMatrix,W.matrixWorldInverse),Ce.setFromProjectionMatrix(Ee),ae=this.localClippingEnabled,Q=st.init(this.clippingPlanes,ae),y=we.get(L,g.length),y.init(),g.push(y),Cn(L,W,0,x.sortObjects),y.finish(),!0===x.sortObjects&&y.sort(J,Z),this.info.render.frame++,!0===Q&&st.beginShadows(),D.render(v.state.shadowsArray,L,W),!0===Q&&st.endShadows(),!0===this.info.autoReset&&this.info.reset(),(!1===Qe.enabled||!1===Qe.isPresenting||!1===Qe.hasDepthSensing())&&ge.render(y,L),v.setupLights(x._useLegacyLights),W.isArrayCamera){const j=W.cameras;for(let K=0,Ae=j.length;K<Ae;K++){const Ge=j[K];$u(y,L,Ge,Ge.viewport)}}else $u(y,L,W);null!==M&&(R.updateMultisampleRenderTarget(M),R.updateRenderTargetMipmap(M)),!0===L.isScene&&L.onAfterRender(x,L,W),nt.resetDefaultState(),w=-1,I=null,_.pop(),v=_.length>0?_[_.length-1]:null,g.pop(),y=g.length>0?g[g.length-1]:null}}else console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.")},this.getActiveCubeFace=function(){return T},this.getActiveMipmapLevel=function(){return E},this.getRenderTarget=function(){return M},this.setRenderTargetTextures=function(L,W,$){_e.get(L.texture).__webglTexture=W,_e.get(L.depthTexture).__webglTexture=$;const j=_e.get(L);j.__hasExternalTextures=!0,j.__hasExternalTextures&&(j.__autoAllocateDepthBuffer=void 0===$,j.__autoAllocateDepthBuffer||!0===se.has("WEBGL_multisampled_render_to_texture")&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),j.__useRenderToTexture=!1))},this.setRenderTargetFramebuffer=function(L,W){const $=_e.get(L);$.__webglFramebuffer=W,$.__useDefaultFramebuffer=void 0===W},this.setRenderTarget=function(L,W=0,$=0){M=L,T=W,E=$;let j=!0,K=null,Ae=!1,Ge=!1;if(L){const it=_e.get(L);void 0!==it.__useDefaultFramebuffer?(re.bindFramebuffer(B.FRAMEBUFFER,null),j=!1):void 0===it.__webglFramebuffer?R.setupRenderTarget(L):it.__hasExternalTextures&&R.rebindTextures(L,_e.get(L.texture).__webglTexture,_e.get(L.depthTexture).__webglTexture);const ut=L.texture;(ut.isData3DTexture||ut.isDataArrayTexture||ut.isCompressedArrayTexture)&&(Ge=!0);const at=_e.get(L).__webglFramebuffer;L.isWebGLCubeRenderTarget?(K=Array.isArray(at[W])?at[W][$]:at[W],Ae=!0):K=ue.isWebGL2&&L.samples>0&&!1===R.useMultisampledRTT(L)?_e.get(L).__webglMultisampledFramebuffer:Array.isArray(at)?at[$]:at,S.copy(L.viewport),P.copy(L.scissor),X=L.scissorTest}else S.copy(ne).multiplyScalar(ee).floor(),P.copy(Y).multiplyScalar(ee).floor(),X=he;if(re.bindFramebuffer(B.FRAMEBUFFER,K)&&ue.drawBuffers&&j&&re.drawBuffers(L,K),re.viewport(S),re.scissor(P),re.setScissorTest(X),Ae){const it=_e.get(L.texture);B.framebufferTexture2D(B.FRAMEBUFFER,B.COLOR_ATTACHMENT0,B.TEXTURE_CUBE_MAP_POSITIVE_X+W,it.__webglTexture,$)}else if(Ge){const it=_e.get(L.texture);B.framebufferTextureLayer(B.FRAMEBUFFER,B.COLOR_ATTACHMENT0,it.__webglTexture,$||0,W||0)}w=-1},this.readRenderTargetPixels=function(L,W,$,j,K,Ae,Ge){if(!L||!L.isWebGLRenderTarget)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let Je=_e.get(L).__webglFramebuffer;if(L.isWebGLCubeRenderTarget&&void 0!==Ge&&(Je=Je[Ge]),Je){re.bindFramebuffer(B.FRAMEBUFFER,Je);try{const it=L.texture,ut=it.format,at=it.type;if(ut!==L0&&Te.convert(ut)!==B.getParameter(B.IMPLEMENTATION_COLOR_READ_FORMAT))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");const ot=at===Ar&&(se.has("EXT_color_buffer_half_float")||ue.isWebGL2&&se.has("EXT_color_buffer_float"));if(!(at===ii||Te.convert(at)===B.getParameter(B.IMPLEMENTATION_COLOR_READ_TYPE)||at===Q0&&(ue.isWebGL2||se.has("OES_texture_float")||se.has("WEBGL_color_buffer_float"))||ot))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");W>=0&&W<=L.width-j&&$>=0&&$<=L.height-K&&B.readPixels(W,$,j,K,Te.convert(ut),Te.convert(at),Ae)}finally{const it=null!==M?_e.get(M).__webglFramebuffer:null;re.bindFramebuffer(B.FRAMEBUFFER,it)}}},this.copyFramebufferToTexture=function(L,W,$=0){const j=Math.pow(2,-$),K=Math.floor(W.image.width*j),Ae=Math.floor(W.image.height*j);R.setTexture2D(W,0),B.copyTexSubImage2D(B.TEXTURE_2D,$,0,0,L.x,L.y,K,Ae),re.unbindTexture()},this.copyTextureToTexture=function(L,W,$,j=0){const K=W.image.width,Ae=W.image.height,Ge=Te.convert($.format),Je=Te.convert($.type);R.setTexture2D($,0),B.pixelStorei(B.UNPACK_FLIP_Y_WEBGL,$.flipY),B.pixelStorei(B.UNPACK_PREMULTIPLY_ALPHA_WEBGL,$.premultiplyAlpha),B.pixelStorei(B.UNPACK_ALIGNMENT,$.unpackAlignment),W.isDataTexture?B.texSubImage2D(B.TEXTURE_2D,j,L.x,L.y,K,Ae,Ge,Je,W.image.data):W.isCompressedTexture?B.compressedTexSubImage2D(B.TEXTURE_2D,j,L.x,L.y,W.mipmaps[0].width,W.mipmaps[0].height,Ge,W.mipmaps[0].data):B.texSubImage2D(B.TEXTURE_2D,j,L.x,L.y,Ge,Je,W.image),0===j&&$.generateMipmaps&&B.generateMipmap(B.TEXTURE_2D),re.unbindTexture()},this.copyTextureToTexture3D=function(L,W,$,j,K=0){if(x.isWebGL1Renderer)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");const Ae=L.max.x-L.min.x+1,Ge=L.max.y-L.min.y+1,Je=L.max.z-L.min.z+1,it=Te.convert(j.format),ut=Te.convert(j.type);let at;if(j.isData3DTexture)R.setTexture3D(j,0),at=B.TEXTURE_3D;else{if(!j.isDataArrayTexture&&!j.isCompressedArrayTexture)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");R.setTexture2DArray(j,0),at=B.TEXTURE_2D_ARRAY}B.pixelStorei(B.UNPACK_FLIP_Y_WEBGL,j.flipY),B.pixelStorei(B.UNPACK_PREMULTIPLY_ALPHA_WEBGL,j.premultiplyAlpha),B.pixelStorei(B.UNPACK_ALIGNMENT,j.unpackAlignment);const ot=B.getParameter(B.UNPACK_ROW_LENGTH),Yt=B.getParameter(B.UNPACK_IMAGE_HEIGHT),H0=B.getParameter(B.UNPACK_SKIP_PIXELS),s0=B.getParameter(B.UNPACK_SKIP_ROWS),Jn=B.getParameter(B.UNPACK_SKIP_IMAGES),Ot=$.isCompressedTexture?$.mipmaps[K]:$.image;B.pixelStorei(B.UNPACK_ROW_LENGTH,Ot.width),B.pixelStorei(B.UNPACK_IMAGE_HEIGHT,Ot.height),B.pixelStorei(B.UNPACK_SKIP_PIXELS,L.min.x),B.pixelStorei(B.UNPACK_SKIP_ROWS,L.min.y),B.pixelStorei(B.UNPACK_SKIP_IMAGES,L.min.z),$.isDataTexture||$.isData3DTexture?B.texSubImage3D(at,K,W.x,W.y,W.z,Ae,Ge,Je,it,ut,Ot.data):$.isCompressedArrayTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),B.compressedTexSubImage3D(at,K,W.x,W.y,W.z,Ae,Ge,Je,it,Ot.data)):B.texSubImage3D(at,K,W.x,W.y,W.z,Ae,Ge,Je,it,ut,Ot),B.pixelStorei(B.UNPACK_ROW_LENGTH,ot),B.pixelStorei(B.UNPACK_IMAGE_HEIGHT,Yt),B.pixelStorei(B.UNPACK_SKIP_PIXELS,H0),B.pixelStorei(B.UNPACK_SKIP_ROWS,s0),B.pixelStorei(B.UNPACK_SKIP_IMAGES,Jn),0===K&&j.generateMipmaps&&B.generateMipmap(at),re.unbindTexture()},this.initTexture=function(L){L.isCubeTexture?R.setTextureCube(L,0):L.isData3DTexture?R.setTexture3D(L,0):L.isDataArrayTexture||L.isCompressedArrayTexture?R.setTexture2DArray(L,0):R.setTexture2D(L,0),re.unbindTexture()},this.resetState=function(){T=0,E=0,M=null,re.reset(),nt.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return On}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorSpace=e===r2?"display-p3":"srgb",t.unpackColorSpace=_t.workingColorSpace===Ha?"display-p3":"srgb"}get outputEncoding(){return console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace===t0?Oi:3e3}set outputEncoding(e){console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace=e===Oi?t0:Fn}get useLegacyLights(){return console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights}set useLegacyLights(e){console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights=e}}(class nm extends Hc{}).prototype.isWebGL1Renderer=!0;class Vc extends Rt{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),null!==e.background&&(this.background=e.background.clone()),null!==e.environment&&(this.environment=e.environment.clone()),null!==e.fog&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,null!==e.overrideMaterial&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return null!==this.fog&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),1!==this.backgroundIntensity&&(t.object.backgroundIntensity=this.backgroundIntensity),t}}class B2{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=void 0!==e?e.length/t:0,this.usage=35044,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.version=0,this.uuid=I0()}onUploadCallback(){}set needsUpdate(e){!0===e&&this.version++}get updateRange(){return Ui("THREE.InterleavedBuffer: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,n){e*=this.stride,n*=t.stride;for(let s=0,r=this.stride;s<r;s++)this.array[e+s]=t.array[n+s];return this}set(e,t=0){return this.array.set(e,t),this}clone(e){void 0===e.arrayBuffers&&(e.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=I0()),void 0===e.arrayBuffers[this.array.buffer._uuid]&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const t=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),n=new this.constructor(t,this.stride);return n.setUsage(this.usage),n}onUpload(e){return this.onUploadCallback=e,this}toJSON(e){return void 0===e.arrayBuffers&&(e.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=I0()),void 0===e.arrayBuffers[this.array.buffer._uuid]&&(e.arrayBuffers[this.array.buffer._uuid]=Array.from(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}}const _0=new F;class ui{constructor(e,t,n,s=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=e,this.itemSize=t,this.offset=n,this.normalized=s}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(e){this.data.needsUpdate=e}applyMatrix4(e){for(let t=0,n=this.data.count;t<n;t++)_0.fromBufferAttribute(this,t),_0.applyMatrix4(e),this.setXYZ(t,_0.x,_0.y,_0.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)_0.fromBufferAttribute(this,t),_0.applyNormalMatrix(e),this.setXYZ(t,_0.x,_0.y,_0.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)_0.fromBufferAttribute(this,t),_0.transformDirection(e),this.setXYZ(t,_0.x,_0.y,_0.z);return this}getComponent(e,t){let n=this.array[e*this.data.stride+this.offset+t];return this.normalized&&(n=m0(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=rt(n,this.array)),this.data.array[e*this.data.stride+this.offset+t]=n,this}setX(e,t){return this.normalized&&(t=rt(t,this.array)),this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.normalized&&(t=rt(t,this.array)),this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.normalized&&(t=rt(t,this.array)),this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.normalized&&(t=rt(t,this.array)),this.data.array[e*this.data.stride+this.offset+3]=t,this}getX(e){let t=this.data.array[e*this.data.stride+this.offset];return this.normalized&&(t=m0(t,this.array)),t}getY(e){let t=this.data.array[e*this.data.stride+this.offset+1];return this.normalized&&(t=m0(t,this.array)),t}getZ(e){let t=this.data.array[e*this.data.stride+this.offset+2];return this.normalized&&(t=m0(t,this.array)),t}getW(e){let t=this.data.array[e*this.data.stride+this.offset+3];return this.normalized&&(t=m0(t,this.array)),t}setXY(e,t,n){return e=e*this.data.stride+this.offset,this.normalized&&(t=rt(t,this.array),n=rt(n,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this}setXYZ(e,t,n,s){return e=e*this.data.stride+this.offset,this.normalized&&(t=rt(t,this.array),n=rt(n,this.array),s=rt(s,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=s,this}setXYZW(e,t,n,s,r){return e=e*this.data.stride+this.offset,this.normalized&&(t=rt(t,this.array),n=rt(n,this.array),s=rt(s,this.array),r=rt(r,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=s,this.data.array[e+3]=r,this}clone(e){if(void 0===e){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let n=0;n<this.count;n++){const s=n*this.data.stride+this.offset;for(let r=0;r<this.itemSize;r++)t.push(this.data.array[s+r])}return new vt(new this.array.constructor(t),this.itemSize,this.normalized)}return void 0===e.interleavedBuffers&&(e.interleavedBuffers={}),void 0===e.interleavedBuffers[this.data.uuid]&&(e.interleavedBuffers[this.data.uuid]=this.data.clone(e)),new ui(e.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(e){if(void 0===e){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let n=0;n<this.count;n++){const s=n*this.data.stride+this.offset;for(let r=0;r<this.itemSize;r++)t.push(this.data.array[s+r])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:t,normalized:this.normalized}}return void 0===e.interleavedBuffers&&(e.interleavedBuffers={}),void 0===e.interleavedBuffers[this.data.uuid]&&(e.interleavedBuffers[this.data.uuid]=this.data.toJSON(e)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}class er extends vt{constructor(e,t,n,s=1){super(e,t,n),this.isInstancedBufferAttribute=!0,this.meshPerAttribute=s}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}toJSON(){const e=super.toJSON();return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}}class R0 extends y0{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new be(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.fog=e.fog,this}}const a3=new F,o3=new F,l3=new $e,Y2=new Ir,Lo=new v0;class Zi extends Rt{constructor(e=new ct,t=new R0){super(),this.isLine=!0,this.type="Line",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}computeLineDistances(){const e=this.geometry;if(null===e.index){const t=e.attributes.position,n=[0];for(let s=1,r=t.count;s<r;s++)a3.fromBufferAttribute(t,s-1),o3.fromBufferAttribute(t,s),n[s]=n[s-1],n[s]+=a3.distanceTo(o3);e.setAttribute("lineDistance",new Ne(n,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(e,t){const n=this.geometry,s=this.matrixWorld,r=e.params.Line.threshold,a=n.drawRange;if(null===n.boundingSphere&&n.computeBoundingSphere(),Lo.copy(n.boundingSphere),Lo.applyMatrix4(s),Lo.radius+=r,!1===e.ray.intersectsSphere(Lo))return;l3.copy(s).invert(),Y2.copy(e.ray).applyMatrix4(l3);const o=r/((this.scale.x+this.scale.y+this.scale.z)/3),l=o*o,c=new F,u=new F,f=new F,d=new F,p=this.isLineSegments?2:1,m=n.index,v=n.attributes.position;if(null!==m)for(let x=Math.max(0,a.start),b=Math.min(m.count,a.start+a.count)-1;x<b;x+=p){const T=m.getX(x),E=m.getX(x+1);if(c.fromBufferAttribute(v,T),u.fromBufferAttribute(v,E),Y2.distanceSqToSegment(c,u,d,f)>l)continue;d.applyMatrix4(this.matrixWorld);const w=e.ray.origin.distanceTo(d);w<e.near||w>e.far||t.push({distance:w,point:f.clone().applyMatrix4(this.matrixWorld),index:x,face:null,faceIndex:null,object:this})}else for(let x=Math.max(0,a.start),b=Math.min(v.count,a.start+a.count)-1;x<b;x+=p){if(c.fromBufferAttribute(v,x),u.fromBufferAttribute(v,x+1),Y2.distanceSqToSegment(c,u,d,f)>l)continue;d.applyMatrix4(this.matrixWorld);const E=e.ray.origin.distanceTo(d);E<e.near||E>e.far||t.push({distance:E,point:f.clone().applyMatrix4(this.matrixWorld),index:x,face:null,faceIndex:null,object:this})}}updateMorphTargets(){const t=this.geometry.morphAttributes,n=Object.keys(t);if(n.length>0){const s=t[n[0]];if(void 0!==s){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,a=s.length;r<a;r++){const o=s[r].name||String(r);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=r}}}}}const c3=new F,h3=new F;class _n extends Zi{constructor(e,t){super(e,t),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(null===e.index){const t=e.attributes.position,n=[];for(let s=0,r=t.count;s<r;s+=2)c3.fromBufferAttribute(t,s),h3.fromBufferAttribute(t,s+1),n[s]=0===s?0:n[s-1],n[s+1]=n[s]+c3.distanceTo(h3);e.setAttribute("lineDistance",new Ne(n,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class u3 extends y0{constructor(e){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new be(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}}const f3=new $e,q2=new Ir,Io=new v0,Do=new F;class d3 extends Rt{constructor(e=new ct,t=new u3){super(),this.isPoints=!0,this.type="Points",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}raycast(e,t){const n=this.geometry,s=this.matrixWorld,r=e.params.Points.threshold,a=n.drawRange;if(null===n.boundingSphere&&n.computeBoundingSphere(),Io.copy(n.boundingSphere),Io.applyMatrix4(s),Io.radius+=r,!1===e.ray.intersectsSphere(Io))return;f3.copy(s).invert(),q2.copy(e.ray).applyMatrix4(f3);const o=r/((this.scale.x+this.scale.y+this.scale.z)/3),l=o*o,c=n.index,f=n.attributes.position;if(null!==c)for(let m=Math.max(0,a.start),y=Math.min(c.count,a.start+a.count);m<y;m++){const v=c.getX(m);Do.fromBufferAttribute(f,v),p3(Do,v,l,s,e,t,this)}else for(let m=Math.max(0,a.start),y=Math.min(f.count,a.start+a.count);m<y;m++)Do.fromBufferAttribute(f,m),p3(Do,m,l,s,e,t,this)}updateMorphTargets(){const t=this.geometry.morphAttributes,n=Object.keys(t);if(n.length>0){const s=t[n[0]];if(void 0!==s){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,a=s.length;r<a;r++){const o=s[r].name||String(r);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=r}}}}}function p3(i,e,t,n,s,r,a){const o=q2.distanceSqToPoint(i);if(o<t){const l=new F;q2.closestPointToPoint(i,l),l.applyMatrix4(n);const c=s.ray.origin.distanceTo(l);if(c<s.near||c>s.far)return;r.push({distance:c,distanceToRay:Math.sqrt(o),point:l,index:e,face:null,object:a})}}class ml extends yn{constructor(e){super(e),this.isRawShaderMaterial=!0,this.type="RawShaderMaterial"}}function $i(i,e,t){return!i||!t&&i.constructor===e?i:"number"==typeof e.BYTES_PER_ELEMENT?new e(i):Array.prototype.slice.call(i)}class Yo{constructor(e,t,n,s){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=void 0!==s?s:new t.constructor(n),this.sampleValues=t,this.valueSize=n,this.settings=null,this.DefaultSettings_={}}evaluate(e){const t=this.parameterPositions;let n=this._cachedIndex,s=t[n],r=t[n-1];e:{t:{let a;n:{i:if(!(e<s)){for(let o=n+2;;){if(void 0===s){if(e<r)break i;return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}if(n===o)break;if(r=s,s=t[++n],e<s)break t}a=t.length;break n}if(!(e>=r)){const o=t[1];e<o&&(n=2,r=o);for(let l=n-2;;){if(void 0===r)return this._cachedIndex=0,this.copySampleValue_(0);if(n===l)break;if(s=r,r=t[--n-1],e>=r)break t}a=n,n=0;break n}break e}for(;n<a;){const o=n+a>>>1;e<t[o]?a=o:n=o+1}if(s=t[n],r=t[n-1],void 0===r)return this._cachedIndex=0,this.copySampleValue_(0);if(void 0===s)return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}this._cachedIndex=n,this.intervalChanged_(n,r,s)}return this.interpolate_(n,r,e,s)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){const t=this.resultBuffer,n=this.sampleValues,s=this.valueSize,r=e*s;for(let a=0;a!==s;++a)t[a]=n[r+a];return t}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}}class og extends Yo{constructor(e,t,n,s){super(e,t,n,s),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:2400,endingEnd:2400}}intervalChanged_(e,t,n){const s=this.parameterPositions;let r=e-2,a=e+1,o=s[r],l=s[a];if(void 0===o)switch(this.getSettings_().endingStart){case 2401:r=e,o=2*t-n;break;case 2402:r=s.length-2,o=t+s[r]-s[r+1];break;default:r=e,o=n}if(void 0===l)switch(this.getSettings_().endingEnd){case 2401:a=e,l=2*n-t;break;case 2402:a=1,l=n+s[1]-s[0];break;default:a=e-1,l=t}const c=.5*(n-t),u=this.valueSize;this._weightPrev=c/(t-o),this._weightNext=c/(l-n),this._offsetPrev=r*u,this._offsetNext=a*u}interpolate_(e,t,n,s){const r=this.resultBuffer,a=this.sampleValues,o=this.valueSize,l=e*o,c=l-o,u=this._offsetPrev,f=this._offsetNext,d=this._weightPrev,p=this._weightNext,m=(n-t)/(s-t),y=m*m,v=y*m,g=-d*v+2*d*y-d*m,_=(1+d)*v+(-1.5-2*d)*y+(-.5+d)*m+1,x=(-1-p)*v+(1.5+p)*y+.5*m,b=p*v-p*y;for(let T=0;T!==o;++T)r[T]=g*a[u+T]+_*a[c+T]+x*a[l+T]+b*a[f+T];return r}}class I3 extends Yo{constructor(e,t,n,s){super(e,t,n,s)}interpolate_(e,t,n,s){const r=this.resultBuffer,a=this.sampleValues,o=this.valueSize,l=e*o,c=l-o,u=(n-t)/(s-t),f=1-u;for(let d=0;d!==o;++d)r[d]=a[c+d]*f+a[l+d]*u;return r}}class lg extends Yo{constructor(e,t,n,s){super(e,t,n,s)}interpolate_(e){return this.copySampleValue_(e-1)}}class Sn{constructor(e,t,n,s){if(void 0===e)throw new Error("THREE.KeyframeTrack: track name is undefined");if(void 0===t||0===t.length)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=$i(t,this.TimeBufferType),this.values=$i(n,this.ValueBufferType),this.setInterpolation(s||this.DefaultInterpolation)}static toJSON(e){const t=e.constructor;let n;if(t.toJSON!==this.toJSON)n=t.toJSON(e);else{n={name:e.name,times:$i(e.times,Array),values:$i(e.values,Array)};const s=e.getInterpolation();s!==e.DefaultInterpolation&&(n.interpolation=s)}return n.type=e.ValueTypeName,n}InterpolantFactoryMethodDiscrete(e){return new lg(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new I3(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new og(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let t;switch(e){case 2300:t=this.InterpolantFactoryMethodDiscrete;break;case 2301:t=this.InterpolantFactoryMethodLinear;break;case 2302:t=this.InterpolantFactoryMethodSmooth}if(void 0===t){const n="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(e===this.DefaultInterpolation)throw new Error(n);this.setInterpolation(this.DefaultInterpolation)}return console.warn("THREE.KeyframeTrack:",n),this}return this.createInterpolant=t,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return 2300;case this.InterpolantFactoryMethodLinear:return 2301;case this.InterpolantFactoryMethodSmooth:return 2302}}getValueSize(){return this.values.length/this.times.length}shift(e){if(0!==e){const t=this.times;for(let n=0,s=t.length;n!==s;++n)t[n]+=e}return this}scale(e){if(1!==e){const t=this.times;for(let n=0,s=t.length;n!==s;++n)t[n]*=e}return this}trim(e,t){const n=this.times,s=n.length;let r=0,a=s-1;for(;r!==s&&n[r]<e;)++r;for(;-1!==a&&n[a]>t;)--a;if(++a,0!==r||a!==s){r>=a&&(a=Math.max(a,1),r=a-1);const o=this.getValueSize();this.times=n.slice(r,a),this.values=this.values.slice(r*o,a*o)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const n=this.times,s=this.values,r=n.length;0===r&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let a=null;for(let o=0;o!==r;o++){const l=n[o];if("number"==typeof l&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,o,l),e=!1;break}if(null!==a&&a>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,o,l,a),e=!1;break}a=l}if(void 0!==s&&function R3(i){return ArrayBuffer.isView(i)&&!(i instanceof DataView)}(s))for(let o=0,l=s.length;o!==l;++o){const c=s[o];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,o,c),e=!1;break}}return e}optimize(){const e=this.times.slice(),t=this.values.slice(),n=this.getValueSize(),s=2302===this.getInterpolation(),r=e.length-1;let a=1;for(let o=1;o<r;++o){let l=!1;const c=e[o];if(c!==e[o+1]&&(1!==o||c!==e[0]))if(s)l=!0;else{const f=o*n,d=f-n,p=f+n;for(let m=0;m!==n;++m){const y=t[f+m];if(y!==t[d+m]||y!==t[p+m]){l=!0;break}}}if(l){if(o!==a){e[a]=e[o];const f=o*n,d=a*n;for(let p=0;p!==n;++p)t[d+p]=t[f+p]}++a}}if(r>0){e[a]=e[r];for(let o=r*n,l=a*n,c=0;c!==n;++c)t[l+c]=t[o+c];++a}return a!==e.length?(this.times=e.slice(0,a),this.values=t.slice(0,a*n)):(this.times=e,this.values=t),this}clone(){const e=this.times.slice(),t=this.values.slice(),s=new(0,this.constructor)(this.name,e,t);return s.createInterpolant=this.createInterpolant,s}}Sn.prototype.TimeBufferType=Float32Array,Sn.prototype.ValueBufferType=Float32Array,Sn.prototype.DefaultInterpolation=2301;class rr extends Sn{}rr.prototype.ValueTypeName="bool",rr.prototype.ValueBufferType=Array,rr.prototype.DefaultInterpolation=2300,rr.prototype.InterpolantFactoryMethodLinear=void 0,rr.prototype.InterpolantFactoryMethodSmooth=void 0;(class D3 extends Sn{}).prototype.ValueTypeName="color";(class qo extends Sn{}).prototype.ValueTypeName="number";class cg extends Yo{constructor(e,t,n,s){super(e,t,n,s)}interpolate_(e,t,n,s){const r=this.resultBuffer,a=this.sampleValues,o=this.valueSize,l=(n-t)/(s-t);let c=e*o;for(let u=c+o;c!==u;c+=4)g0.slerpFlat(r,0,a,c-o,a,c,l);return r}}class Kr extends Sn{InterpolantFactoryMethodLinear(e){return new cg(this.times,this.values,this.getValueSize(),e)}}Kr.prototype.ValueTypeName="quaternion",Kr.prototype.DefaultInterpolation=2301,Kr.prototype.InterpolantFactoryMethodSmooth=void 0;class ar extends Sn{}ar.prototype.ValueTypeName="string",ar.prototype.ValueBufferType=Array,ar.prototype.DefaultInterpolation=2300,ar.prototype.InterpolantFactoryMethodLinear=void 0,ar.prototype.InterpolantFactoryMethodSmooth=void 0;(class Zo extends Sn{}).prototype.ValueTypeName="vector",Error;class B3 extends ct{constructor(){super(),this.isInstancedBufferGeometry=!0,this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(e){return super.copy(e),this.instanceCount=e.instanceCount,this}toJSON(){const e=super.toJSON();return e.instanceCount=this.instanceCount,e.isInstancedBufferGeometry=!0,e}}const Sl="\\[\\]\\.:\\/",Ig=new RegExp("["+Sl+"]","g"),Ml="[^"+Sl+"]",Dg="[^"+Sl.replace("\\.","")+"]",Ug=new RegExp("^"+/((?:WC+[\/:])*)/.source.replace("WC",Ml)+/(WCOD+)?/.source.replace("WCOD",Dg)+/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",Ml)+/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",Ml)+"$"),Bg=["material","materials","bones","map"];class Gg{constructor(e,t,n){const s=n||Pt.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,s)}getValue(e,t){this.bind();const s=this._bindings[this._targetGroup.nCachedObjects_];void 0!==s&&s.getValue(e,t)}setValue(e,t){const n=this._bindings;for(let s=this._targetGroup.nCachedObjects_,r=n.length;s!==r;++s)n[s].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}}let Pt=(()=>{class i{constructor(t,n,s){this.path=n,this.parsedPath=s||i.parseTrackName(n),this.node=i.findNode(t,this.parsedPath.nodeName),this.rootNode=t,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(t,n,s){return t&&t.isAnimationObjectGroup?new i.Composite(t,n,s):new i(t,n,s)}static sanitizeNodeName(t){return t.replace(/\s/g,"_").replace(Ig,"")}static parseTrackName(t){const n=Ug.exec(t);if(null===n)throw new Error("PropertyBinding: Cannot parse trackName: "+t);const s={nodeName:n[2],objectName:n[3],objectIndex:n[4],propertyName:n[5],propertyIndex:n[6]},r=s.nodeName&&s.nodeName.lastIndexOf(".");if(void 0!==r&&-1!==r){const a=s.nodeName.substring(r+1);-1!==Bg.indexOf(a)&&(s.nodeName=s.nodeName.substring(0,r),s.objectName=a)}if(null===s.propertyName||0===s.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return s}static findNode(t,n){if(void 0===n||""===n||"."===n||-1===n||n===t.name||n===t.uuid)return t;if(t.skeleton){const s=t.skeleton.getBoneByName(n);if(void 0!==s)return s}if(t.children){const s=function(a){for(let o=0;o<a.length;o++){const l=a[o];if(l.name===n||l.uuid===n)return l;const c=s(l.children);if(c)return c}return null},r=s(t.children);if(r)return r}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(t,n){t[n]=this.targetObject[this.propertyName]}_getValue_array(t,n){const s=this.resolvedProperty;for(let r=0,a=s.length;r!==a;++r)t[n++]=s[r]}_getValue_arrayElement(t,n){t[n]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(t,n){this.resolvedProperty.toArray(t,n)}_setValue_direct(t,n){this.targetObject[this.propertyName]=t[n]}_setValue_direct_setNeedsUpdate(t,n){this.targetObject[this.propertyName]=t[n],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(t,n){this.targetObject[this.propertyName]=t[n],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(t,n){const s=this.resolvedProperty;for(let r=0,a=s.length;r!==a;++r)s[r]=t[n++]}_setValue_array_setNeedsUpdate(t,n){const s=this.resolvedProperty;for(let r=0,a=s.length;r!==a;++r)s[r]=t[n++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(t,n){const s=this.resolvedProperty;for(let r=0,a=s.length;r!==a;++r)s[r]=t[n++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(t,n){this.resolvedProperty[this.propertyIndex]=t[n]}_setValue_arrayElement_setNeedsUpdate(t,n){this.resolvedProperty[this.propertyIndex]=t[n],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(t,n){this.resolvedProperty[this.propertyIndex]=t[n],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(t,n){this.resolvedProperty.fromArray(t,n)}_setValue_fromArray_setNeedsUpdate(t,n){this.resolvedProperty.fromArray(t,n),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(t,n){this.resolvedProperty.fromArray(t,n),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(t,n){this.bind(),this.getValue(t,n)}_setValue_unbound(t,n){this.bind(),this.setValue(t,n)}bind(){let t=this.node;const n=this.parsedPath,s=n.objectName,r=n.propertyName;let a=n.propertyIndex;if(t||(t=i.findNode(this.rootNode,n.nodeName),this.node=t),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!t)return void console.warn("THREE.PropertyBinding: No target node found for track: "+this.path+".");if(s){let u=n.objectIndex;switch(s){case"materials":if(!t.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!t.material.materials)return void console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);t=t.material.materials;break;case"bones":if(!t.skeleton)return void console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);t=t.skeleton.bones;for(let f=0;f<t.length;f++)if(t[f].name===u){u=f;break}break;case"map":if("map"in t){t=t.map;break}if(!t.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!t.material.map)return void console.error("THREE.PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);t=t.material.map;break;default:if(void 0===t[s])return void console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);t=t[s]}if(void 0!==u){if(void 0===t[u])return void console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,t);t=t[u]}}const o=t[r];if(void 0===o)return void console.error("THREE.PropertyBinding: Trying to update property for track: "+n.nodeName+"."+r+" but it wasn't found.",t);let l=this.Versioning.None;this.targetObject=t,void 0!==t.needsUpdate?l=this.Versioning.NeedsUpdate:void 0!==t.matrixWorldNeedsUpdate&&(l=this.Versioning.MatrixWorldNeedsUpdate);let c=this.BindingType.Direct;if(void 0!==a){if("morphTargetInfluences"===r){if(!t.geometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(!t.geometry.morphAttributes)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);void 0!==t.morphTargetDictionary[a]&&(a=t.morphTargetDictionary[a])}c=this.BindingType.ArrayElement,this.resolvedProperty=o,this.propertyIndex=a}else void 0!==o.fromArray&&void 0!==o.toArray?(c=this.BindingType.HasFromToArray,this.resolvedProperty=o):Array.isArray(o)?(c=this.BindingType.EntireArray,this.resolvedProperty=o):this.propertyName=r;this.getValue=this.GetterByBindingType[c],this.setValue=this.SetterByBindingTypeAndVersioning[c][l]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}return i.Composite=Gg,i})();Pt.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},Pt.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},Pt.prototype.GetterByBindingType=[Pt.prototype._getValue_direct,Pt.prototype._getValue_array,Pt.prototype._getValue_arrayElement,Pt.prototype._getValue_toArray],Pt.prototype.SetterByBindingTypeAndVersioning=[[Pt.prototype._setValue_direct,Pt.prototype._setValue_direct_setNeedsUpdate,Pt.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[Pt.prototype._setValue_array,Pt.prototype._setValue_array_setNeedsUpdate,Pt.prototype._setValue_array_setMatrixWorldNeedsUpdate],[Pt.prototype._setValue_arrayElement,Pt.prototype._setValue_arrayElement_setNeedsUpdate,Pt.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[Pt.prototype._setValue_fromArray,Pt.prototype._setValue_fromArray_setNeedsUpdate,Pt.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]],new Float32Array(1);class Wg extends B2{constructor(e,t,n=1){super(e,t),this.isInstancedInterleavedBuffer=!0,this.meshPerAttribute=n}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}clone(e){const t=super.clone(e);return t.meshPerAttribute=this.meshPerAttribute,t}toJSON(e){const t=super.toJSON(e);return t.isInstancedInterleavedBuffer=!0,t.meshPerAttribute=this.meshPerAttribute,t}}class K3{constructor(e=1,t=0,n=0){return this.radius=e,this.phi=t,this.theta=n,this}set(e,t,n){return this.radius=e,this.phi=t,this.theta=n,this}copy(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this}makeSafe(){return this.phi=Math.max(1e-6,Math.min(Math.PI-1e-6,this.phi)),this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,n){return this.radius=Math.sqrt(e*e+t*t+n*n),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,n),this.phi=Math.acos(Ut(t/this.radius,-1,1))),this}clone(){return(new this.constructor).copy(this)}}const $3=new H;class Xg{constructor(e=new H(1/0,1/0),t=new H(-1/0,-1/0)){this.isBox2=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const n=$3.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}clone(){return(new this.constructor).copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y}getCenter(e){return this.isEmpty()?e.set(0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}containsPoint(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y)}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,$3).distanceTo(e)}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:"161"}})),typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__="161");class et{constructor(e,t,n,s,r){this.layerName=e??null,this.blockName=t??null,this.geometryType=n??null,this.color=s,this.lineType=r??null}Compare(e){let t=Wn(this.layerName,e.layerName);return 0!==t||(t=Wn(this.blockName,e.blockName),0!==t)||(t=Wn(this.geometryType,e.geometryType),0!==t)||(t=Wn(this.color,e.color),0!==t)?t:Wn(this.lineType,e.lineType)}IsIndexed(){return this.geometryType===et.GeometryType.INDEXED_LINES||this.geometryType===et.GeometryType.INDEXED_TRIANGLES}IsInstanced(){return this.geometryType===et.GeometryType.BLOCK_INSTANCE||this.geometryType===et.GeometryType.POINT_INSTANCE}}function Wn(i,e){return null===i?null===e?0:-1:null===e?1:i<e?-1:i>e?1:0}et.GeometryType=Object.freeze({POINTS:0,LINES:1,INDEXED_LINES:2,TRIANGLES:3,INDEXED_TRIANGLES:4,BLOCK_INSTANCE:5,POINT_INSTANCE:6});class s1{constructor(e,t=16){this.type=e,this.capacity=t,this.size=0,this.buffer=new(Al(e))(t)}GetSize(){return this.size}Push(e){this._CheckGrow();const t=this.size;return this.buffer[t]=e,this.size++,t}Get(e){if(e>=this.size)throw new Error(`Index out of range: ${e}/${this.size}`);return this.buffer[e]}CopyTo(e,t,n=0,s=-1){-1===s&&(s=this.size-n);const r=new(Al(this.type))(this.buffer.buffer,n,s);e.set(r,t)}_CheckGrow(){if(this.size<this.capacity)return;this.capacity*=2;const e=new(Al(this.type))(this.capacity);e.set(this.buffer),this.buffer=e}}function Al(i){switch(i){case 0:return Int8Array;case 1:return Uint8Array;case 2:return Uint8ClampedArray;case 3:return Int16Array;case 4:return Uint16Array;case 5:return Int32Array;case 6:return Uint32Array;case 9:return Float32Array;case 10:return Float64Array;default:throw new Error("Unrecognized native type: "+i)}}const h0=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];function nn(i,e,t){return Math.max(e,Math.min(t,i))}function Qr(i,e,t){return(1-t)*i+t*e}Math,Math;const gi="srgb",Pl="srgb-linear",fv="display-p3",h6="display-p3-linear",Rl="linear";class jr{constructor(e,t,n,s,r,a,o,l,c){jr.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],void 0!==e&&this.set(e,t,n,s,r,a,o,l,c)}set(e,t,n,s,r,a,o,l,c){const u=this.elements;return u[0]=e,u[1]=s,u[2]=o,u[3]=t,u[4]=r,u[5]=l,u[6]=n,u[7]=a,u[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,s=t.elements,r=this.elements,a=n[0],o=n[3],l=n[6],c=n[1],u=n[4],f=n[7],d=n[2],p=n[5],m=n[8],y=s[0],v=s[3],g=s[6],_=s[1],x=s[4],b=s[7],T=s[2],E=s[5],M=s[8];return r[0]=a*y+o*_+l*T,r[3]=a*v+o*x+l*E,r[6]=a*g+o*b+l*M,r[1]=c*y+u*_+f*T,r[4]=c*v+u*x+f*E,r[7]=c*g+u*b+f*M,r[2]=d*y+p*_+m*T,r[5]=d*v+p*x+m*E,r[8]=d*g+p*b+m*M,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[1],s=e[2],r=e[3],a=e[4],o=e[5],l=e[6],c=e[7],u=e[8];return t*a*u-t*o*c-n*r*u+n*o*l+s*r*c-s*a*l}invert(){const e=this.elements,t=e[0],n=e[1],s=e[2],r=e[3],a=e[4],o=e[5],l=e[6],c=e[7],u=e[8],f=u*a-o*c,d=o*l-u*r,p=c*r-a*l,m=t*f+n*d+s*p;if(0===m)return this.set(0,0,0,0,0,0,0,0,0);const y=1/m;return e[0]=f*y,e[1]=(s*c-u*n)*y,e[2]=(o*n-s*a)*y,e[3]=d*y,e[4]=(u*t-s*l)*y,e[5]=(s*r-o*t)*y,e[6]=p*y,e[7]=(n*l-c*t)*y,e[8]=(a*t-n*r)*y,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,n,s,r,a,o){const l=Math.cos(r),c=Math.sin(r);return this.set(n*l,n*c,-n*(l*a+c*o)+a+e,-s*c,s*l,-s*(-c*a+l*o)+o+t,0,0,1),this}scale(e,t){return this.premultiply(Ll.makeScale(e,t)),this}rotate(e){return this.premultiply(Ll.makeRotation(-e)),this}translate(e,t){return this.premultiply(Ll.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,n,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,n=e.elements;for(let s=0;s<9;s++)if(t[s]!==n[s])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}clone(){return(new this.constructor).fromArray(this.elements)}}const Ll=new jr,m6=(new jr).set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),g6=(new jr).set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),a1={[Pl]:{transfer:Rl,primaries:"rec709",toReference:i=>i,fromReference:i=>i},[gi]:{transfer:"srgb",primaries:"rec709",toReference:i=>i.convertSRGBToLinear(),fromReference:i=>i.convertLinearToSRGB()},[h6]:{transfer:Rl,primaries:"p3",toReference:i=>i.applyMatrix3(g6),fromReference:i=>i.applyMatrix3(m6)},[fv]:{transfer:"srgb",primaries:"p3",toReference:i=>i.convertSRGBToLinear().applyMatrix3(g6),fromReference:i=>i.applyMatrix3(m6).convertLinearToSRGB()}},dv=new Set([Pl,h6]),sn={enabled:!0,_workingColorSpace:Pl,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(i){if(!dv.has(i))throw new Error(`Unsupported working color space, "${i}".`);this._workingColorSpace=i},convert:function(i,e,t){return!1!==this.enabled&&e!==t&&e&&t?(0,a1[t].fromReference)((0,a1[e].toReference)(i)):i},fromWorkingColorSpace:function(i,e){return this.convert(i,this._workingColorSpace,e)},toWorkingColorSpace:function(i,e){return this.convert(i,e,this._workingColorSpace)},getPrimaries:function(i){return a1[i].primaries},getTransfer:function(i){return""===i?Rl:a1[i].transfer}};function Il(i){return i<.04045?.0773993808*i:Math.pow(.9478672986*i+.0521327014,2.4)}function Dl(i){return i<.0031308?12.92*i:1.055*Math.pow(i,.41666)-.055}const v6={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},vi={h:0,s:0,l:0},o1={h:0,s:0,l:0};function Fl(i,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?i+6*(e-i)*t:t<.5?e:t<2/3?i+6*(e-i)*(2/3-t):i}class Ol{constructor(e,t,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,n)}set(e,t,n){if(void 0===t&&void 0===n){const s=e;s&&s.isColor?this.copy(s):"number"==typeof s?this.setHex(s):"string"==typeof s&&this.setStyle(s)}else this.setRGB(e,t,n);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=gi){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,sn.toWorkingColorSpace(this,t),this}setRGB(e,t,n,s=sn.workingColorSpace){return this.r=e,this.g=t,this.b=n,sn.toWorkingColorSpace(this,s),this}setHSL(e,t,n,s=sn.workingColorSpace){if(e=function Cl(i,e){return(i%e+e)%e}(e,1),t=nn(t,0,1),n=nn(n,0,1),0===t)this.r=this.g=this.b=n;else{const r=n<=.5?n*(1+t):n+t-n*t,a=2*n-r;this.r=Fl(a,r,e+1/3),this.g=Fl(a,r,e),this.b=Fl(a,r,e-1/3)}return sn.toWorkingColorSpace(this,s),this}setStyle(e,t=gi){function n(r){void 0!==r&&parseFloat(r)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let s;if(s=/^(\w+)\(([^\)]*)\)/.exec(e)){let r;const o=s[2];switch(s[1]){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(r[4]),this.setRGB(Math.min(255,parseInt(r[1],10))/255,Math.min(255,parseInt(r[2],10))/255,Math.min(255,parseInt(r[3],10))/255,t);if(r=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(r[4]),this.setRGB(Math.min(100,parseInt(r[1],10))/100,Math.min(100,parseInt(r[2],10))/100,Math.min(100,parseInt(r[3],10))/100,t);break;case"hsl":case"hsla":if(r=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(r[4]),this.setHSL(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(s=/^\#([A-Fa-f\d]+)$/.exec(e)){const r=s[1],a=r.length;if(3===a)return this.setRGB(parseInt(r.charAt(0),16)/15,parseInt(r.charAt(1),16)/15,parseInt(r.charAt(2),16)/15,t);if(6===a)return this.setHex(parseInt(r,16),t);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=gi){const n=v6[e.toLowerCase()];return void 0!==n?this.setHex(n,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=Il(e.r),this.g=Il(e.g),this.b=Il(e.b),this}copyLinearToSRGB(e){return this.r=Dl(e.r),this.g=Dl(e.g),this.b=Dl(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=gi){return sn.fromWorkingColorSpace(u0.copy(this),e),65536*Math.round(nn(255*u0.r,0,255))+256*Math.round(nn(255*u0.g,0,255))+Math.round(nn(255*u0.b,0,255))}getHexString(e=gi){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=sn.workingColorSpace){sn.fromWorkingColorSpace(u0.copy(this),t);const n=u0.r,s=u0.g,r=u0.b,a=Math.max(n,s,r),o=Math.min(n,s,r);let l,c;const u=(o+a)/2;if(o===a)l=0,c=0;else{const f=a-o;switch(c=u<=.5?f/(a+o):f/(2-a-o),a){case n:l=(s-r)/f+(s<r?6:0);break;case s:l=(r-n)/f+2;break;case r:l=(n-s)/f+4}l/=6}return e.h=l,e.s=c,e.l=u,e}getRGB(e,t=sn.workingColorSpace){return sn.fromWorkingColorSpace(u0.copy(this),t),e.r=u0.r,e.g=u0.g,e.b=u0.b,e}getStyle(e=gi){sn.fromWorkingColorSpace(u0.copy(this),e);const t=u0.r,n=u0.g,s=u0.b;return e!==gi?`color(${e} ${t.toFixed(3)} ${n.toFixed(3)} ${s.toFixed(3)})`:`rgb(${Math.round(255*t)},${Math.round(255*n)},${Math.round(255*s)})`}offsetHSL(e,t,n){return this.getHSL(vi),this.setHSL(vi.h+e,vi.s+t,vi.l+n)}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}lerpColors(e,t,n){return this.r=e.r+(t.r-e.r)*n,this.g=e.g+(t.g-e.g)*n,this.b=e.b+(t.b-e.b)*n,this}lerpHSL(e,t){this.getHSL(vi),e.getHSL(o1);const n=Qr(vi.h,o1.h,t),s=Qr(vi.s,o1.s,t),r=Qr(vi.l,o1.l,t);return this.setHSL(n,s,r),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){const t=this.r,n=this.g,s=this.b,r=e.elements;return this.r=r[0]*t+r[3]*n+r[6]*s,this.g=r[1]*t+r[4]*n+r[7]*s,this.b=r[2]*t+r[5]*n+r[8]*s,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(e=[],t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}const u0=new Ol;Ol.NAMES=v6;class Tt{constructor(e=0,t=0){Tt.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,n=this.y,s=e.elements;return this.x=s[0]*t+s[3]*n+s[6],this.y=s[1]*t+s[4]*n+s[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(0===t)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(nn(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const n=Math.cos(t),s=Math.sin(t),r=this.x-e.x,a=this.y-e.y;return this.x=r*n-a*s+e.x,this.y=r*s+a*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class pv{constructor(e=0,t=0,n=0,s=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=n,this._w=s}static slerpFlat(e,t,n,s,r,a,o){let l=n[s+0],c=n[s+1],u=n[s+2],f=n[s+3];const d=r[a+0],p=r[a+1],m=r[a+2],y=r[a+3];if(0===o)return e[t+0]=l,e[t+1]=c,e[t+2]=u,void(e[t+3]=f);if(1===o)return e[t+0]=d,e[t+1]=p,e[t+2]=m,void(e[t+3]=y);if(f!==y||l!==d||c!==p||u!==m){let v=1-o;const g=l*d+c*p+u*m+f*y,_=g>=0?1:-1,x=1-g*g;if(x>Number.EPSILON){const T=Math.sqrt(x),E=Math.atan2(T,g*_);v=Math.sin(v*E)/T,o=Math.sin(o*E)/T}const b=o*_;if(l=l*v+d*b,c=c*v+p*b,u=u*v+m*b,f=f*v+y*b,v===1-o){const T=1/Math.sqrt(l*l+c*c+u*u+f*f);l*=T,c*=T,u*=T,f*=T}}e[t]=l,e[t+1]=c,e[t+2]=u,e[t+3]=f}static multiplyQuaternionsFlat(e,t,n,s,r,a){const o=n[s],l=n[s+1],c=n[s+2],u=n[s+3],f=r[a],d=r[a+1],p=r[a+2],m=r[a+3];return e[t]=o*m+u*f+l*p-c*d,e[t+1]=l*m+u*d+c*f-o*p,e[t+2]=c*m+u*p+o*d-l*f,e[t+3]=u*m-o*f-l*d-c*p,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,n,s){return this._x=e,this._y=t,this._z=n,this._w=s,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){const n=e._x,s=e._y,r=e._z,a=e._order,o=Math.cos,l=Math.sin,c=o(n/2),u=o(s/2),f=o(r/2),d=l(n/2),p=l(s/2),m=l(r/2);switch(a){case"XYZ":this._x=d*u*f+c*p*m,this._y=c*p*f-d*u*m,this._z=c*u*m+d*p*f,this._w=c*u*f-d*p*m;break;case"YXZ":this._x=d*u*f+c*p*m,this._y=c*p*f-d*u*m,this._z=c*u*m-d*p*f,this._w=c*u*f+d*p*m;break;case"ZXY":this._x=d*u*f-c*p*m,this._y=c*p*f+d*u*m,this._z=c*u*m+d*p*f,this._w=c*u*f-d*p*m;break;case"ZYX":this._x=d*u*f-c*p*m,this._y=c*p*f+d*u*m,this._z=c*u*m-d*p*f,this._w=c*u*f+d*p*m;break;case"YZX":this._x=d*u*f+c*p*m,this._y=c*p*f+d*u*m,this._z=c*u*m-d*p*f,this._w=c*u*f-d*p*m;break;case"XZY":this._x=d*u*f-c*p*m,this._y=c*p*f-d*u*m,this._z=c*u*m+d*p*f,this._w=c*u*f+d*p*m;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+a)}return!0===t&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const n=t/2,s=Math.sin(n);return this._x=e.x*s,this._y=e.y*s,this._z=e.z*s,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,n=t[0],s=t[4],r=t[8],a=t[1],o=t[5],l=t[9],c=t[2],u=t[6],f=t[10],d=n+o+f;if(d>0){const p=.5/Math.sqrt(d+1);this._w=.25/p,this._x=(u-l)*p,this._y=(r-c)*p,this._z=(a-s)*p}else if(n>o&&n>f){const p=2*Math.sqrt(1+n-o-f);this._w=(u-l)/p,this._x=.25*p,this._y=(s+a)/p,this._z=(r+c)/p}else if(o>f){const p=2*Math.sqrt(1+o-n-f);this._w=(r-c)/p,this._x=(s+a)/p,this._y=.25*p,this._z=(l+u)/p}else{const p=2*Math.sqrt(1+f-n-o);this._w=(a-s)/p,this._x=(r+c)/p,this._y=(l+u)/p,this._z=.25*p}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return n<Number.EPSILON?(n=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(nn(this.dot(e),-1,1)))}rotateTowards(e,t){const n=this.angleTo(e);if(0===n)return this;const s=Math.min(1,t/n);return this.slerp(e,s),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return 0===e?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const n=e._x,s=e._y,r=e._z,a=e._w,o=t._x,l=t._y,c=t._z,u=t._w;return this._x=n*u+a*o+s*c-r*l,this._y=s*u+a*l+r*o-n*c,this._z=r*u+a*c+n*l-s*o,this._w=a*u-n*o-s*l-r*c,this._onChangeCallback(),this}slerp(e,t){if(0===t)return this;if(1===t)return this.copy(e);const n=this._x,s=this._y,r=this._z,a=this._w;let o=a*e._w+n*e._x+s*e._y+r*e._z;if(o<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,o=-o):this.copy(e),o>=1)return this._w=a,this._x=n,this._y=s,this._z=r,this;const l=1-o*o;if(l<=Number.EPSILON){const p=1-t;return this._w=p*a+t*this._w,this._x=p*n+t*this._x,this._y=p*s+t*this._y,this._z=p*r+t*this._z,this.normalize(),this}const c=Math.sqrt(l),u=Math.atan2(c,o),f=Math.sin((1-t)*u)/c,d=Math.sin(t*u)/c;return this._w=a*f+this._w*d,this._x=n*f+this._x*d,this._y=s*f+this._y*d,this._z=r*f+this._z*d,this._onChangeCallback(),this}slerpQuaternions(e,t,n){return this.copy(e).slerp(t,n)}random(){const e=Math.random(),t=Math.sqrt(1-e),n=Math.sqrt(e),s=2*Math.PI*Math.random(),r=2*Math.PI*Math.random();return this.set(t*Math.cos(s),n*Math.sin(r),n*Math.cos(r),t*Math.sin(s))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class yt{constructor(e=0,t=0,n=0){yt.prototype.isVector3=!0,this.x=e,this.y=t,this.z=n}set(e,t,n){return void 0===n&&(n=this.z),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(y6.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(y6.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,n=this.y,s=this.z,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6]*s,this.y=r[1]*t+r[4]*n+r[7]*s,this.z=r[2]*t+r[5]*n+r[8]*s,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,n=this.y,s=this.z,r=e.elements,a=1/(r[3]*t+r[7]*n+r[11]*s+r[15]);return this.x=(r[0]*t+r[4]*n+r[8]*s+r[12])*a,this.y=(r[1]*t+r[5]*n+r[9]*s+r[13])*a,this.z=(r[2]*t+r[6]*n+r[10]*s+r[14])*a,this}applyQuaternion(e){const t=this.x,n=this.y,s=this.z,r=e.x,a=e.y,o=e.z,l=e.w,c=2*(a*s-o*n),u=2*(o*t-r*s),f=2*(r*n-a*t);return this.x=t+l*c+a*f-o*u,this.y=n+l*u+o*c-r*f,this.z=s+l*f+r*u-a*c,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,n=this.y,s=this.z,r=e.elements;return this.x=r[0]*t+r[4]*n+r[8]*s,this.y=r[1]*t+r[5]*n+r[9]*s,this.z=r[2]*t+r[6]*n+r[10]*s,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const n=e.x,s=e.y,r=e.z,a=t.x,o=t.y,l=t.z;return this.x=s*l-r*o,this.y=r*a-n*l,this.z=n*o-s*a,this}projectOnVector(e){const t=e.lengthSq();if(0===t)return this.set(0,0,0);const n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return Nl.copy(this).projectOnVector(e),this.sub(Nl)}reflect(e){return this.sub(Nl.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(0===t)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(nn(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y,s=this.z-e.z;return t*t+n*n+s*s}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){const s=Math.sin(t)*e;return this.x=s*Math.sin(n),this.y=Math.cos(t)*e,this.z=s*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),s=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=s,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,4*t)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,3*t)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=2*(Math.random()-.5),t=Math.random()*Math.PI*2,n=Math.sqrt(1-e**2);return this.x=n*Math.cos(t),this.y=n*Math.sin(t),this.z=e,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const Nl=new yt,y6=new pv;class ea{constructor(e,t,n,s,r,a,o,l,c,u,f,d,p,m,y,v){ea.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],void 0!==e&&this.set(e,t,n,s,r,a,o,l,c,u,f,d,p,m,y,v)}set(e,t,n,s,r,a,o,l,c,u,f,d,p,m,y,v){const g=this.elements;return g[0]=e,g[4]=t,g[8]=n,g[12]=s,g[1]=r,g[5]=a,g[9]=o,g[13]=l,g[2]=c,g[6]=u,g[10]=f,g[14]=d,g[3]=p,g[7]=m,g[11]=y,g[15]=v,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return(new ea).fromArray(this.elements)}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){const t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,n=e.elements,s=1/or.setFromMatrixColumn(e,0).length(),r=1/or.setFromMatrixColumn(e,1).length(),a=1/or.setFromMatrixColumn(e,2).length();return t[0]=n[0]*s,t[1]=n[1]*s,t[2]=n[2]*s,t[3]=0,t[4]=n[4]*r,t[5]=n[5]*r,t[6]=n[6]*r,t[7]=0,t[8]=n[8]*a,t[9]=n[9]*a,t[10]=n[10]*a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,n=e.x,s=e.y,r=e.z,a=Math.cos(n),o=Math.sin(n),l=Math.cos(s),c=Math.sin(s),u=Math.cos(r),f=Math.sin(r);if("XYZ"===e.order){const d=a*u,p=a*f,m=o*u,y=o*f;t[0]=l*u,t[4]=-l*f,t[8]=c,t[1]=p+m*c,t[5]=d-y*c,t[9]=-o*l,t[2]=y-d*c,t[6]=m+p*c,t[10]=a*l}else if("YXZ"===e.order){const d=l*u,p=l*f,m=c*u,y=c*f;t[0]=d+y*o,t[4]=m*o-p,t[8]=a*c,t[1]=a*f,t[5]=a*u,t[9]=-o,t[2]=p*o-m,t[6]=y+d*o,t[10]=a*l}else if("ZXY"===e.order){const d=l*u,p=l*f,m=c*u,y=c*f;t[0]=d-y*o,t[4]=-a*f,t[8]=m+p*o,t[1]=p+m*o,t[5]=a*u,t[9]=y-d*o,t[2]=-a*c,t[6]=o,t[10]=a*l}else if("ZYX"===e.order){const d=a*u,p=a*f,m=o*u,y=o*f;t[0]=l*u,t[4]=m*c-p,t[8]=d*c+y,t[1]=l*f,t[5]=y*c+d,t[9]=p*c-m,t[2]=-c,t[6]=o*l,t[10]=a*l}else if("YZX"===e.order){const d=a*l,p=a*c,m=o*l,y=o*c;t[0]=l*u,t[4]=y-d*f,t[8]=m*f+p,t[1]=f,t[5]=a*u,t[9]=-o*u,t[2]=-c*u,t[6]=p*f+m,t[10]=d-y*f}else if("XZY"===e.order){const d=a*l,p=a*c,m=o*l,y=o*c;t[0]=l*u,t[4]=-f,t[8]=c*u,t[1]=d*f+y,t[5]=a*u,t[9]=p*f-m,t[2]=m*f-p,t[6]=o*u,t[10]=y*f+d}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(mv,e,gv)}lookAt(e,t,n){const s=this.elements;return N0.subVectors(e,t),0===N0.lengthSq()&&(N0.z=1),N0.normalize(),yi.crossVectors(n,N0),0===yi.lengthSq()&&(1===Math.abs(n.z)?N0.x+=1e-4:N0.z+=1e-4,N0.normalize(),yi.crossVectors(n,N0)),yi.normalize(),l1.crossVectors(N0,yi),s[0]=yi.x,s[4]=l1.x,s[8]=N0.x,s[1]=yi.y,s[5]=l1.y,s[9]=N0.y,s[2]=yi.z,s[6]=l1.z,s[10]=N0.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,s=t.elements,r=this.elements,a=n[0],o=n[4],l=n[8],c=n[12],u=n[1],f=n[5],d=n[9],p=n[13],m=n[2],y=n[6],v=n[10],g=n[14],_=n[3],x=n[7],b=n[11],T=n[15],E=s[0],M=s[4],w=s[8],I=s[12],S=s[1],P=s[5],X=s[9],te=s[13],U=s[2],z=s[6],G=s[10],ee=s[14],J=s[3],Z=s[7],ne=s[11],Y=s[15];return r[0]=a*E+o*S+l*U+c*J,r[4]=a*M+o*P+l*z+c*Z,r[8]=a*w+o*X+l*G+c*ne,r[12]=a*I+o*te+l*ee+c*Y,r[1]=u*E+f*S+d*U+p*J,r[5]=u*M+f*P+d*z+p*Z,r[9]=u*w+f*X+d*G+p*ne,r[13]=u*I+f*te+d*ee+p*Y,r[2]=m*E+y*S+v*U+g*J,r[6]=m*M+y*P+v*z+g*Z,r[10]=m*w+y*X+v*G+g*ne,r[14]=m*I+y*te+v*ee+g*Y,r[3]=_*E+x*S+b*U+T*J,r[7]=_*M+x*P+b*z+T*Z,r[11]=_*w+x*X+b*G+T*ne,r[15]=_*I+x*te+b*ee+T*Y,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[4],s=e[8],r=e[12],a=e[1],o=e[5],l=e[9],c=e[13],u=e[2],f=e[6],d=e[10],p=e[14];return e[3]*(+r*l*f-s*c*f-r*o*d+n*c*d+s*o*p-n*l*p)+e[7]*(+t*l*p-t*c*d+r*a*d-s*a*p+s*c*u-r*l*u)+e[11]*(+t*c*f-t*o*p-r*a*f+n*a*p+r*o*u-n*c*u)+e[15]*(-s*o*u-t*l*f+t*o*d+s*a*f-n*a*d+n*l*u)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,n){const s=this.elements;return e.isVector3?(s[12]=e.x,s[13]=e.y,s[14]=e.z):(s[12]=e,s[13]=t,s[14]=n),this}invert(){const e=this.elements,t=e[0],n=e[1],s=e[2],r=e[3],a=e[4],o=e[5],l=e[6],c=e[7],u=e[8],f=e[9],d=e[10],p=e[11],m=e[12],y=e[13],v=e[14],g=e[15],_=f*v*c-y*d*c+y*l*p-o*v*p-f*l*g+o*d*g,x=m*d*c-u*v*c-m*l*p+a*v*p+u*l*g-a*d*g,b=u*y*c-m*f*c+m*o*p-a*y*p-u*o*g+a*f*g,T=m*f*l-u*y*l-m*o*d+a*y*d+u*o*v-a*f*v,E=t*_+n*x+s*b+r*T;if(0===E)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const M=1/E;return e[0]=_*M,e[1]=(y*d*r-f*v*r-y*s*p+n*v*p+f*s*g-n*d*g)*M,e[2]=(o*v*r-y*l*r+y*s*c-n*v*c-o*s*g+n*l*g)*M,e[3]=(f*l*r-o*d*r-f*s*c+n*d*c+o*s*p-n*l*p)*M,e[4]=x*M,e[5]=(u*v*r-m*d*r+m*s*p-t*v*p-u*s*g+t*d*g)*M,e[6]=(m*l*r-a*v*r-m*s*c+t*v*c+a*s*g-t*l*g)*M,e[7]=(a*d*r-u*l*r+u*s*c-t*d*c-a*s*p+t*l*p)*M,e[8]=b*M,e[9]=(m*f*r-u*y*r-m*n*p+t*y*p+u*n*g-t*f*g)*M,e[10]=(a*y*r-m*o*r+m*n*c-t*y*c-a*n*g+t*o*g)*M,e[11]=(u*o*r-a*f*r-u*n*c+t*f*c+a*n*p-t*o*p)*M,e[12]=T*M,e[13]=(u*y*s-m*f*s+m*n*d-t*y*d-u*n*v+t*f*v)*M,e[14]=(m*o*s-a*y*s-m*n*l+t*y*l+a*n*v-t*o*v)*M,e[15]=(a*f*s-u*o*s+u*n*l-t*f*l-a*n*d+t*o*d)*M,this}scale(e){const t=this.elements,n=e.x,s=e.y,r=e.z;return t[0]*=n,t[4]*=s,t[8]*=r,t[1]*=n,t[5]*=s,t[9]*=r,t[2]*=n,t[6]*=s,t[10]*=r,t[3]*=n,t[7]*=s,t[11]*=r,this}getMaxScaleOnAxis(){const e=this.elements;return Math.sqrt(Math.max(e[0]*e[0]+e[1]*e[1]+e[2]*e[2],e[4]*e[4]+e[5]*e[5]+e[6]*e[6],e[8]*e[8]+e[9]*e[9]+e[10]*e[10]))}makeTranslation(e,t,n){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const n=Math.cos(t),s=Math.sin(t),r=1-n,a=e.x,o=e.y,l=e.z,c=r*a,u=r*o;return this.set(c*a+n,c*o-s*l,c*l+s*o,0,c*o+s*l,u*o+n,u*l-s*a,0,c*l-s*o,u*l+s*a,r*l*l+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,s,r,a){return this.set(1,n,r,0,e,1,a,0,t,s,1,0,0,0,0,1),this}compose(e,t,n){const s=this.elements,r=t._x,a=t._y,o=t._z,l=t._w,c=r+r,u=a+a,f=o+o,d=r*c,p=r*u,m=r*f,y=a*u,v=a*f,g=o*f,_=l*c,x=l*u,b=l*f,T=n.x,E=n.y,M=n.z;return s[0]=(1-(y+g))*T,s[1]=(p+b)*T,s[2]=(m-x)*T,s[3]=0,s[4]=(p-b)*E,s[5]=(1-(d+g))*E,s[6]=(v+_)*E,s[7]=0,s[8]=(m+x)*M,s[9]=(v-_)*M,s[10]=(1-(d+y))*M,s[11]=0,s[12]=e.x,s[13]=e.y,s[14]=e.z,s[15]=1,this}decompose(e,t,n){const s=this.elements;let r=or.set(s[0],s[1],s[2]).length();const a=or.set(s[4],s[5],s[6]).length(),o=or.set(s[8],s[9],s[10]).length();this.determinant()<0&&(r=-r),e.x=s[12],e.y=s[13],e.z=s[14],rn.copy(this);const c=1/r,u=1/a,f=1/o;return rn.elements[0]*=c,rn.elements[1]*=c,rn.elements[2]*=c,rn.elements[4]*=u,rn.elements[5]*=u,rn.elements[6]*=u,rn.elements[8]*=f,rn.elements[9]*=f,rn.elements[10]*=f,t.setFromRotationMatrix(rn),n.x=r,n.y=a,n.z=o,this}makePerspective(e,t,n,s,r,a,o=2e3){const l=this.elements,c=2*r/(t-e),u=2*r/(n-s),f=(t+e)/(t-e),d=(n+s)/(n-s);let p,m;if(2e3===o)p=-(a+r)/(a-r),m=-2*a*r/(a-r);else{if(2001!==o)throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+o);p=-a/(a-r),m=-a*r/(a-r)}return l[0]=c,l[4]=0,l[8]=f,l[12]=0,l[1]=0,l[5]=u,l[9]=d,l[13]=0,l[2]=0,l[6]=0,l[10]=p,l[14]=m,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(e,t,n,s,r,a,o=2e3){const l=this.elements,c=1/(t-e),u=1/(n-s),f=1/(a-r),d=(t+e)*c,p=(n+s)*u;let m,y;if(2e3===o)m=(a+r)*f,y=-2*f;else{if(2001!==o)throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+o);m=r*f,y=-1*f}return l[0]=2*c,l[4]=0,l[8]=0,l[12]=-d,l[1]=0,l[5]=2*u,l[9]=0,l[13]=-p,l[2]=0,l[6]=0,l[10]=y,l[14]=-m,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(e){const t=this.elements,n=e.elements;for(let s=0;s<16;s++)if(t[s]!==n[s])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}}const or=new yt,rn=new ea,mv=new yt(0,0,0),gv=new yt(1,1,1),yi=new yt,l1=new yt,N0=new yt;class Mn{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(e,t){const n=this.getUtoTmapping(e);return this.getPoint(n,t)}getPoints(e=5){const t=[];for(let n=0;n<=e;n++)t.push(this.getPoint(n/e));return t}getSpacedPoints(e=5){const t=[];for(let n=0;n<=e;n++)t.push(this.getPointAt(n/e));return t}getLength(){const e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const t=[];let n,s=this.getPoint(0),r=0;t.push(0);for(let a=1;a<=e;a++)n=this.getPoint(a/e),r+=n.distanceTo(s),t.push(r),s=n;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t){const n=this.getLengths();let s=0;const r=n.length;let a;a=t||e*n[r-1];let c,o=0,l=r-1;for(;o<=l;)if(s=Math.floor(o+(l-o)/2),c=n[s]-a,c<0)o=s+1;else{if(!(c>0)){l=s;break}l=s-1}if(s=l,n[s]===a)return s/(r-1);const u=n[s];return(s+(a-u)/(n[s+1]-u))/(r-1)}getTangent(e,t){let s=e-1e-4,r=e+1e-4;s<0&&(s=0),r>1&&(r=1);const a=this.getPoint(s),o=this.getPoint(r),l=t||(a.isVector2?new Tt:new yt);return l.copy(o).sub(a).normalize(),l}getTangentAt(e,t){const n=this.getUtoTmapping(e);return this.getTangent(n,t)}computeFrenetFrames(e,t){const n=new yt,s=[],r=[],a=[],o=new yt,l=new ea;for(let p=0;p<=e;p++)s[p]=this.getTangentAt(p/e,new yt);r[0]=new yt,a[0]=new yt;let c=Number.MAX_VALUE;const u=Math.abs(s[0].x),f=Math.abs(s[0].y),d=Math.abs(s[0].z);u<=c&&(c=u,n.set(1,0,0)),f<=c&&(c=f,n.set(0,1,0)),d<=c&&n.set(0,0,1),o.crossVectors(s[0],n).normalize(),r[0].crossVectors(s[0],o),a[0].crossVectors(s[0],r[0]);for(let p=1;p<=e;p++){if(r[p]=r[p-1].clone(),a[p]=a[p-1].clone(),o.crossVectors(s[p-1],s[p]),o.length()>Number.EPSILON){o.normalize();const m=Math.acos(nn(s[p-1].dot(s[p]),-1,1));r[p].applyMatrix4(l.makeRotationAxis(o,m))}a[p].crossVectors(s[p],r[p])}if(!0===t){let p=Math.acos(nn(r[0].dot(r[e]),-1,1));p/=e,s[0].dot(o.crossVectors(r[0],r[e]))>0&&(p=-p);for(let m=1;m<=e;m++)r[m].applyMatrix4(l.makeRotationAxis(s[m],p*m)),a[m].crossVectors(s[m],r[m])}return{tangents:s,normals:r,binormals:a}}clone(){return(new this.constructor).copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.6,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class kl extends Mn{constructor(e=0,t=0,n=1,s=1,r=0,a=2*Math.PI,o=!1,l=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=n,this.yRadius=s,this.aStartAngle=r,this.aEndAngle=a,this.aClockwise=o,this.aRotation=l}getPoint(e,t){const n=t||new Tt,s=2*Math.PI;let r=this.aEndAngle-this.aStartAngle;const a=Math.abs(r)<Number.EPSILON;for(;r<0;)r+=s;for(;r>s;)r-=s;r<Number.EPSILON&&(r=a?0:s),!0===this.aClockwise&&!a&&(r===s?r=-s:r-=s);const o=this.aStartAngle+e*r;let l=this.aX+this.xRadius*Math.cos(o),c=this.aY+this.yRadius*Math.sin(o);if(0!==this.aRotation){const u=Math.cos(this.aRotation),f=Math.sin(this.aRotation),d=l-this.aX,p=c-this.aY;l=d*u-p*f+this.aX,c=d*f+p*u+this.aY}return n.set(l,c)}copy(e){return super.copy(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}toJSON(){const e=super.toJSON();return e.aX=this.aX,e.aY=this.aY,e.xRadius=this.xRadius,e.yRadius=this.yRadius,e.aStartAngle=this.aStartAngle,e.aEndAngle=this.aEndAngle,e.aClockwise=this.aClockwise,e.aRotation=this.aRotation,e}fromJSON(e){return super.fromJSON(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}}class vv extends kl{constructor(e,t,n,s,r,a){super(e,t,n,n,s,r,a),this.isArcCurve=!0,this.type="ArcCurve"}}function Ul(){let i=0,e=0,t=0,n=0;function s(r,a,o,l){i=r,e=o,t=-3*r+3*a-2*o-l,n=2*r-2*a+o+l}return{initCatmullRom:function(r,a,o,l,c){s(a,o,c*(o-r),c*(l-a))},initNonuniformCatmullRom:function(r,a,o,l,c,u,f){let d=(a-r)/c-(o-r)/(c+u)+(o-a)/u,p=(o-a)/u-(l-a)/(u+f)+(l-o)/f;d*=u,p*=u,s(a,o,d,p)},calc:function(r){const a=r*r;return i+e*r+t*a+n*(a*r)}}}const c1=new yt,Bl=new Ul,Gl=new Ul,zl=new Ul;class yv extends Mn{constructor(e=[],t=!1,n="centripetal",s=.5){super(),this.isCatmullRomCurve3=!0,this.type="CatmullRomCurve3",this.points=e,this.closed=t,this.curveType=n,this.tension=s}getPoint(e,t=new yt){const n=t,s=this.points,r=s.length,a=(r-(this.closed?0:1))*e;let c,u,o=Math.floor(a),l=a-o;this.closed?o+=o>0?0:(Math.floor(Math.abs(o)/r)+1)*r:0===l&&o===r-1&&(o=r-2,l=1),this.closed||o>0?c=s[(o-1)%r]:(c1.subVectors(s[0],s[1]).add(s[0]),c=c1);const f=s[o%r],d=s[(o+1)%r];if(this.closed||o+2<r?u=s[(o+2)%r]:(c1.subVectors(s[r-1],s[r-2]).add(s[r-1]),u=c1),"centripetal"===this.curveType||"chordal"===this.curveType){const p="chordal"===this.curveType?.5:.25;let m=Math.pow(c.distanceToSquared(f),p),y=Math.pow(f.distanceToSquared(d),p),v=Math.pow(d.distanceToSquared(u),p);y<1e-4&&(y=1),m<1e-4&&(m=y),v<1e-4&&(v=y),Bl.initNonuniformCatmullRom(c.x,f.x,d.x,u.x,m,y,v),Gl.initNonuniformCatmullRom(c.y,f.y,d.y,u.y,m,y,v),zl.initNonuniformCatmullRom(c.z,f.z,d.z,u.z,m,y,v)}else"catmullrom"===this.curveType&&(Bl.initCatmullRom(c.x,f.x,d.x,u.x,this.tension),Gl.initCatmullRom(c.y,f.y,d.y,u.y,this.tension),zl.initCatmullRom(c.z,f.z,d.z,u.z,this.tension));return n.set(Bl.calc(l),Gl.calc(l),zl.calc(l)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++)this.points.push(e.points[t].clone());return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,n=this.points.length;t<n;t++)e.points.push(this.points[t].toArray());return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const s=e.points[t];this.points.push((new yt).fromArray(s))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}}function x6(i,e,t,n,s){const r=.5*(n-e),a=.5*(s-t),o=i*i;return(2*t-2*n+r+a)*(i*o)+(-3*t+3*n-2*r-a)*o+r*i+t}function ta(i,e,t,n){return function xv(i,e){const t=1-i;return t*t*e}(i,e)+function _v(i,e){return 2*(1-i)*i*e}(i,t)+function bv(i,e){return i*i*e}(i,n)}function na(i,e,t,n,s){return function Sv(i,e){const t=1-i;return t*t*t*e}(i,e)+function Mv(i,e){const t=1-i;return 3*t*t*i*e}(i,t)+function Ev(i,e){return 3*(1-i)*i*i*e}(i,n)+function Tv(i,e){return i*i*i*e}(i,s)}class _6 extends Mn{constructor(e=new Tt,t=new Tt,n=new Tt,s=new Tt){super(),this.isCubicBezierCurve=!0,this.type="CubicBezierCurve",this.v0=e,this.v1=t,this.v2=n,this.v3=s}getPoint(e,t=new Tt){const n=t,s=this.v0,r=this.v1,a=this.v2,o=this.v3;return n.set(na(e,s.x,r.x,a.x,o.x),na(e,s.y,r.y,a.y,o.y)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}class wv extends Mn{constructor(e=new yt,t=new yt,n=new yt,s=new yt){super(),this.isCubicBezierCurve3=!0,this.type="CubicBezierCurve3",this.v0=e,this.v1=t,this.v2=n,this.v3=s}getPoint(e,t=new yt){const n=t,s=this.v0,r=this.v1,a=this.v2,o=this.v3;return n.set(na(e,s.x,r.x,a.x,o.x),na(e,s.y,r.y,a.y,o.y),na(e,s.z,r.z,a.z,o.z)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}class b6 extends Mn{constructor(e=new Tt,t=new Tt){super(),this.isLineCurve=!0,this.type="LineCurve",this.v1=e,this.v2=t}getPoint(e,t=new Tt){const n=t;return 1===e?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e,t=new Tt){return t.subVectors(this.v2,this.v1).normalize()}getTangentAt(e,t){return this.getTangent(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class Av extends Mn{constructor(e=new yt,t=new yt){super(),this.isLineCurve3=!0,this.type="LineCurve3",this.v1=e,this.v2=t}getPoint(e,t=new yt){const n=t;return 1===e?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e,t=new yt){return t.subVectors(this.v2,this.v1).normalize()}getTangentAt(e,t){return this.getTangent(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class S6 extends Mn{constructor(e=new Tt,t=new Tt,n=new Tt){super(),this.isQuadraticBezierCurve=!0,this.type="QuadraticBezierCurve",this.v0=e,this.v1=t,this.v2=n}getPoint(e,t=new Tt){const n=t,s=this.v0,r=this.v1,a=this.v2;return n.set(ta(e,s.x,r.x,a.x),ta(e,s.y,r.y,a.y)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class Cv extends Mn{constructor(e=new yt,t=new yt,n=new yt){super(),this.isQuadraticBezierCurve3=!0,this.type="QuadraticBezierCurve3",this.v0=e,this.v1=t,this.v2=n}getPoint(e,t=new yt){const n=t,s=this.v0,r=this.v1,a=this.v2;return n.set(ta(e,s.x,r.x,a.x),ta(e,s.y,r.y,a.y),ta(e,s.z,r.z,a.z)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class M6 extends Mn{constructor(e=[]){super(),this.isSplineCurve=!0,this.type="SplineCurve",this.points=e}getPoint(e,t=new Tt){const n=t,s=this.points,r=(s.length-1)*e,a=Math.floor(r),o=r-a,l=s[0===a?a:a-1],c=s[a],u=s[a>s.length-2?s.length-1:a+1],f=s[a>s.length-3?s.length-1:a+2];return n.set(x6(o,l.x,c.x,u.x,f.x),x6(o,l.y,c.y,u.y,f.y)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++)this.points.push(e.points[t].clone());return this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,n=this.points.length;t<n;t++)e.points.push(this.points[t].toArray());return e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const s=e.points[t];this.points.push((new Tt).fromArray(s))}return this}}class Pv extends Mn{constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1}add(e){this.curves.push(e)}closePath(){const e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);return e.equals(t)||this.curves.push(new Pn[!0===e.isVector2?"LineCurve":"LineCurve3"](t,e)),this}getPoint(e,t){const n=e*this.getLength(),s=this.getCurveLengths();let r=0;for(;r<s.length;){if(s[r]>=n){const a=s[r]-n,o=this.curves[r],l=o.getLength();return o.getPointAt(0===l?0:1-a/l,t)}r++}return null}getLength(){const e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const e=[];let t=0;for(let n=0,s=this.curves.length;n<s;n++)t+=this.curves[n].getLength(),e.push(t);return this.cacheLengths=e,e}getSpacedPoints(e=40){const t=[];for(let n=0;n<=e;n++)t.push(this.getPoint(n/e));return this.autoClose&&t.push(t[0]),t}getPoints(e=12){const t=[];let n;for(let s=0,r=this.curves;s<r.length;s++){const a=r[s],l=a.getPoints(a.isEllipseCurve?2*e:a.isLineCurve||a.isLineCurve3?1:a.isSplineCurve?e*a.points.length:e);for(let c=0;c<l.length;c++){const u=l[c];n&&n.equals(u)||(t.push(u),n=u)}}return this.autoClose&&t.length>1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,n=e.curves.length;t<n;t++)this.curves.push(e.curves[t].clone());return this.autoClose=e.autoClose,this}toJSON(){const e=super.toJSON();e.autoClose=this.autoClose,e.curves=[];for(let t=0,n=this.curves.length;t<n;t++)e.curves.push(this.curves[t].toJSON());return e}fromJSON(e){super.fromJSON(e),this.autoClose=e.autoClose,this.curves=[];for(let t=0,n=e.curves.length;t<n;t++){const s=e.curves[t];this.curves.push((new Pn[s.type]).fromJSON(s))}return this}}class Hl extends Pv{constructor(e){super(),this.type="Path",this.currentPoint=new Tt,e&&this.setFromPoints(e)}setFromPoints(e){this.moveTo(e[0].x,e[0].y);for(let t=1,n=e.length;t<n;t++)this.lineTo(e[t].x,e[t].y);return this}moveTo(e,t){return this.currentPoint.set(e,t),this}lineTo(e,t){const n=new b6(this.currentPoint.clone(),new Tt(e,t));return this.curves.push(n),this.currentPoint.set(e,t),this}quadraticCurveTo(e,t,n,s){const r=new S6(this.currentPoint.clone(),new Tt(e,t),new Tt(n,s));return this.curves.push(r),this.currentPoint.set(n,s),this}bezierCurveTo(e,t,n,s,r,a){const o=new _6(this.currentPoint.clone(),new Tt(e,t),new Tt(n,s),new Tt(r,a));return this.curves.push(o),this.currentPoint.set(r,a),this}splineThru(e){const t=[this.currentPoint.clone()].concat(e),n=new M6(t);return this.curves.push(n),this.currentPoint.copy(e[e.length-1]),this}arc(e,t,n,s,r,a){return this.absarc(e+this.currentPoint.x,t+this.currentPoint.y,n,s,r,a),this}absarc(e,t,n,s,r,a){return this.absellipse(e,t,n,n,s,r,a),this}ellipse(e,t,n,s,r,a,o,l){return this.absellipse(e+this.currentPoint.x,t+this.currentPoint.y,n,s,r,a,o,l),this}absellipse(e,t,n,s,r,a,o,l){const c=new kl(e,t,n,s,r,a,o,l);if(this.curves.length>0){const f=c.getPoint(0);f.equals(this.currentPoint)||this.lineTo(f.x,f.y)}this.curves.push(c);const u=c.getPoint(1);return this.currentPoint.copy(u),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){const e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}}class Vl extends Hl{constructor(e){super(e),this.uuid=function c6(){const i=4294967295*Math.random()|0,e=4294967295*Math.random()|0,t=4294967295*Math.random()|0,n=4294967295*Math.random()|0;return(h0[255&i]+h0[i>>8&255]+h0[i>>16&255]+h0[i>>24&255]+"-"+h0[255&e]+h0[e>>8&255]+"-"+h0[e>>16&15|64]+h0[e>>24&255]+"-"+h0[63&t|128]+h0[t>>8&255]+"-"+h0[t>>16&255]+h0[t>>24&255]+h0[255&n]+h0[n>>8&255]+h0[n>>16&255]+h0[n>>24&255]).toLowerCase()}(),this.type="Shape",this.holes=[]}getPointsHoles(e){const t=[];for(let n=0,s=this.holes.length;n<s;n++)t[n]=this.holes[n].getPoints(e);return t}extractPoints(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}}copy(e){super.copy(e),this.holes=[];for(let t=0,n=e.holes.length;t<n;t++)this.holes.push(e.holes[t].clone());return this}toJSON(){const e=super.toJSON();e.uuid=this.uuid,e.holes=[];for(let t=0,n=this.holes.length;t<n;t++)e.holes.push(this.holes[t].toJSON());return e}fromJSON(e){super.fromJSON(e),this.uuid=e.uuid,this.holes=[];for(let t=0,n=e.holes.length;t<n;t++){const s=e.holes[t];this.holes.push((new Hl).fromJSON(s))}return this}}function E6(i,e,t,n,s){let r,a;if(s===function Yv(i,e,t,n){let s=0;for(let r=e,a=t-n;r<t;r+=n)s+=(i[a]-i[r])*(i[r+1]+i[a+1]),a=r;return s}(i,e,t,n)>0)for(r=e;r<t;r+=n)a=A6(r,i[r],i[r+1],a);else for(r=t-n;r>=e;r-=n)a=A6(r,i[r],i[r+1],a);return a&&h1(a,a.next)&&(ra(a),a=a.next),a}function ss(i,e){if(!i)return i;e||(e=i);let n,t=i;do{if(n=!1,t.steiner||!h1(t,t.next)&&0!==Dt(t.prev,t,t.next))t=t.next;else{if(ra(t),t=e=t.prev,t===t.next)break;n=!0}}while(n||t!==e);return e}function ia(i,e,t,n,s,r,a){if(!i)return;!a&&r&&function Gv(i,e,t,n){let s=i;do{0===s.z&&(s.z=Wl(s.x,s.y,e,t,n)),s.prevZ=s.prev,s.nextZ=s.next,s=s.next}while(s!==i);s.prevZ.nextZ=null,s.prevZ=null,function zv(i){let e,t,n,s,r,a,o,l,c=1;do{for(t=i,i=null,r=null,a=0;t;){for(a++,n=t,o=0,e=0;e<c&&(o++,n=n.nextZ,n);e++);for(l=c;o>0||l>0&&n;)0!==o&&(0===l||!n||t.z<=n.z)?(s=t,t=t.nextZ,o--):(s=n,n=n.nextZ,l--),r?r.nextZ=s:i=s,s.prevZ=r,r=s;t=n}r.nextZ=null,c*=2}while(a>1)}(s)}(i,n,s,r);let l,c,o=i;for(;i.prev!==i.next;)if(l=i.prev,c=i.next,r?Iv(i,n,s,r):Lv(i))e.push(l.i/t|0),e.push(i.i/t|0),e.push(c.i/t|0),ra(i),i=c.next,o=c.next;else if((i=c)===o){a?1===a?ia(i=Dv(ss(i),e,t),e,t,n,s,r,2):2===a&&Fv(i,e,t,n,s,r):ia(ss(i),e,t,n,s,r,1);break}}function Lv(i){const e=i.prev,t=i,n=i.next;if(Dt(e,t,n)>=0)return!1;const s=e.x,r=t.x,a=n.x,o=e.y,l=t.y,c=n.y,u=s<r?s<a?s:a:r<a?r:a,f=o<l?o<c?o:c:l<c?l:c,d=s>r?s>a?s:a:r>a?r:a,p=o>l?o>c?o:c:l>c?l:c;let m=n.next;for(;m!==e;){if(m.x>=u&&m.x<=d&&m.y>=f&&m.y<=p&&lr(s,o,r,l,a,c,m.x,m.y)&&Dt(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function Iv(i,e,t,n){const s=i.prev,r=i,a=i.next;if(Dt(s,r,a)>=0)return!1;const o=s.x,l=r.x,c=a.x,u=s.y,f=r.y,d=a.y,p=o<l?o<c?o:c:l<c?l:c,m=u<f?u<d?u:d:f<d?f:d,y=o>l?o>c?o:c:l>c?l:c,v=u>f?u>d?u:d:f>d?f:d,g=Wl(p,m,e,t,n),_=Wl(y,v,e,t,n);let x=i.prevZ,b=i.nextZ;for(;x&&x.z>=g&&b&&b.z<=_;){if(x.x>=p&&x.x<=y&&x.y>=m&&x.y<=v&&x!==s&&x!==a&&lr(o,u,l,f,c,d,x.x,x.y)&&Dt(x.prev,x,x.next)>=0||(x=x.prevZ,b.x>=p&&b.x<=y&&b.y>=m&&b.y<=v&&b!==s&&b!==a&&lr(o,u,l,f,c,d,b.x,b.y)&&Dt(b.prev,b,b.next)>=0))return!1;b=b.nextZ}for(;x&&x.z>=g;){if(x.x>=p&&x.x<=y&&x.y>=m&&x.y<=v&&x!==s&&x!==a&&lr(o,u,l,f,c,d,x.x,x.y)&&Dt(x.prev,x,x.next)>=0)return!1;x=x.prevZ}for(;b&&b.z<=_;){if(b.x>=p&&b.x<=y&&b.y>=m&&b.y<=v&&b!==s&&b!==a&&lr(o,u,l,f,c,d,b.x,b.y)&&Dt(b.prev,b,b.next)>=0)return!1;b=b.nextZ}return!0}function Dv(i,e,t){let n=i;do{const s=n.prev,r=n.next.next;!h1(s,r)&&T6(s,n,n.next,r)&&sa(s,r)&&sa(r,s)&&(e.push(s.i/t|0),e.push(n.i/t|0),e.push(r.i/t|0),ra(n),ra(n.next),n=i=r),n=n.next}while(n!==i);return ss(n)}function Fv(i,e,t,n,s,r){let a=i;do{let o=a.next.next;for(;o!==a.prev;){if(a.i!==o.i&&Vv(a,o)){let l=w6(a,o);return a=ss(a,a.next),l=ss(l,l.next),ia(a,e,t,n,s,r,0),void ia(l,e,t,n,s,r,0)}o=o.next}a=a.next}while(a!==i)}function Nv(i,e){return i.x-e.x}function kv(i,e){const t=function Uv(i,e){let s,t=e,n=-1/0;const r=i.x,a=i.y;do{if(a<=t.y&&a>=t.next.y&&t.next.y!==t.y){const d=t.x+(a-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(d<=r&&d>n&&(n=d,s=t.x<t.next.x?t:t.next,d===r))return s}t=t.next}while(t!==e);if(!s)return null;const o=s,l=s.x,c=s.y;let f,u=1/0;t=s;do{r>=t.x&&t.x>=l&&r!==t.x&&lr(a<c?r:n,a,l,c,a<c?n:r,a,t.x,t.y)&&(f=Math.abs(a-t.y)/(r-t.x),sa(t,i)&&(f<u||f===u&&(t.x>s.x||t.x===s.x&&Bv(s,t)))&&(s=t,u=f)),t=t.next}while(t!==o);return s}(i,e);if(!t)return e;const n=w6(t,i);return ss(n,n.next),ss(t,t.next)}function Bv(i,e){return Dt(i.prev,i,e.prev)<0&&Dt(e.next,i,i.next)<0}function Wl(i,e,t,n,s){return(i=1431655765&((i=858993459&((i=252645135&((i=16711935&((i=(i-t)*s|0)|i<<8))|i<<4))|i<<2))|i<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-n)*s|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function Hv(i){let e=i,t=i;do{(e.x<t.x||e.x===t.x&&e.y<t.y)&&(t=e),e=e.next}while(e!==i);return t}function lr(i,e,t,n,s,r,a,o){return(s-a)*(e-o)>=(i-a)*(r-o)&&(i-a)*(n-o)>=(t-a)*(e-o)&&(t-a)*(r-o)>=(s-a)*(n-o)}function Vv(i,e){return i.next.i!==e.i&&i.prev.i!==e.i&&!function Wv(i,e){let t=i;do{if(t.i!==i.i&&t.next.i!==i.i&&t.i!==e.i&&t.next.i!==e.i&&T6(t,t.next,i,e))return!0;t=t.next}while(t!==i);return!1}(i,e)&&(sa(i,e)&&sa(e,i)&&function Xv(i,e){let t=i,n=!1;const s=(i.x+e.x)/2,r=(i.y+e.y)/2;do{t.y>r!=t.next.y>r&&t.next.y!==t.y&&s<(t.next.x-t.x)*(r-t.y)/(t.next.y-t.y)+t.x&&(n=!n),t=t.next}while(t!==i);return n}(i,e)&&(Dt(i.prev,i,e.prev)||Dt(i,e.prev,e))||h1(i,e)&&Dt(i.prev,i,i.next)>0&&Dt(e.prev,e,e.next)>0)}function Dt(i,e,t){return(e.y-i.y)*(t.x-e.x)-(e.x-i.x)*(t.y-e.y)}function h1(i,e){return i.x===e.x&&i.y===e.y}function T6(i,e,t,n){const s=f1(Dt(i,e,t)),r=f1(Dt(i,e,n)),a=f1(Dt(t,n,i)),o=f1(Dt(t,n,e));return!!(s!==r&&a!==o||0===s&&u1(i,t,e)||0===r&&u1(i,n,e)||0===a&&u1(t,i,n)||0===o&&u1(t,e,n))}function u1(i,e,t){return e.x<=Math.max(i.x,t.x)&&e.x>=Math.min(i.x,t.x)&&e.y<=Math.max(i.y,t.y)&&e.y>=Math.min(i.y,t.y)}function f1(i){return i>0?1:i<0?-1:0}function sa(i,e){return Dt(i.prev,i,i.next)<0?Dt(i,e,i.next)>=0&&Dt(i,i.prev,e)>=0:Dt(i,e,i.prev)<0||Dt(i,i.next,e)<0}function w6(i,e){const t=new Xl(i.i,i.x,i.y),n=new Xl(e.i,e.x,e.y),s=i.next,r=e.prev;return i.next=e,e.prev=i,t.next=s,s.prev=t,n.next=t,t.prev=n,r.next=n,n.prev=r,n}function A6(i,e,t,n){const s=new Xl(i,e,t);return n?(s.next=n.next,s.prev=n,n.next.prev=s,n.next=s):(s.prev=s,s.next=s),s}function ra(i){i.next.prev=i.prev,i.prev.next=i.next,i.prevZ&&(i.prevZ.nextZ=i.nextZ),i.nextZ&&(i.nextZ.prevZ=i.prevZ)}function Xl(i,e,t){this.i=i,this.x=e,this.y=t,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}class cr{static area(e){const t=e.length;let n=0;for(let s=t-1,r=0;r<t;s=r++)n+=e[s].x*e[r].y-e[r].x*e[s].y;return.5*n}static isClockWise(e){return cr.area(e)<0}static triangulateShape(e,t){const n=[],s=[],r=[];C6(e),P6(n,e);let a=e.length;t.forEach(C6);for(let l=0;l<t.length;l++)s.push(a),a+=t[l].length,P6(n,t[l]);const o=function(i,e,t=2){const n=e&&e.length,s=n?e[0]*t:i.length;let r=E6(i,0,s,t,!0);const a=[];if(!r||r.next===r.prev)return a;let o,l,c,u,f,d,p;if(n&&(r=function Ov(i,e,t,n){const s=[];let r,a,o,l,c;for(r=0,a=e.length;r<a;r++)o=e[r]*n,l=r<a-1?e[r+1]*n:i.length,c=E6(i,o,l,n,!1),c===c.next&&(c.steiner=!0),s.push(Hv(c));for(s.sort(Nv),r=0;r<s.length;r++)t=kv(s[r],t);return t}(i,e,r,t)),i.length>80*t){o=c=i[0],l=u=i[1];for(let m=t;m<s;m+=t)f=i[m],d=i[m+1],f<o&&(o=f),d<l&&(l=d),f>c&&(c=f),d>u&&(u=d);p=Math.max(c-o,u-l),p=0!==p?32767/p:0}return ia(r,a,t,o,l,p,0),a}(n,s);for(let l=0;l<o.length;l+=3)r.push(o.slice(l,l+3));return r}}function C6(i){const e=i.length;e>2&&i[e-1].equals(i[0])&&i.pop()}function P6(i,e){for(let t=0;t<e.length;t++)i.push(e[t].x),i.push(e[t].y)}class qv{constructor(){this.type="ShapePath",this.color=new Ol,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new Hl,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){return this.currentPath.lineTo(e,t),this}quadraticCurveTo(e,t,n,s){return this.currentPath.quadraticCurveTo(e,t,n,s),this}bezierCurveTo(e,t,n,s,r,a){return this.currentPath.bezierCurveTo(e,t,n,s,r,a),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e){function n(g,_){const x=_.length;let b=!1;for(let T=x-1,E=0;E<x;T=E++){let M=_[T],w=_[E],I=w.x-M.x,S=w.y-M.y;if(Math.abs(S)>Number.EPSILON){if(S<0&&(M=_[E],I=-I,w=_[T],S=-S),g.y<M.y||g.y>w.y)continue;if(g.y===M.y){if(g.x===M.x)return!0}else{const P=S*(g.x-M.x)-I*(g.y-M.y);if(0===P)return!0;if(P<0)continue;b=!b}}else{if(g.y!==M.y)continue;if(w.x<=g.x&&g.x<=M.x||M.x<=g.x&&g.x<=w.x)return!0}}return b}const s=cr.isClockWise,r=this.subPaths;if(0===r.length)return[];let a,o,l;const c=[];if(1===r.length)return o=r[0],l=new Vl,l.curves=o.curves,c.push(l),c;let u=!s(r[0].getPoints());u=e?!u:u;const f=[],d=[];let y,v,p=[],m=0;d[m]=void 0,p[m]=[];for(let g=0,_=r.length;g<_;g++)o=r[g],y=o.getPoints(),a=s(y),a=e?!a:a,a?(!u&&d[m]&&m++,d[m]={s:new Vl,p:y},d[m].s.curves=o.curves,u&&m++,p[m]=[]):p[m].push({h:o,p:y[0]});if(!d[0])return function t(g){const _=[];for(let x=0,b=g.length;x<b;x++){const T=g[x],E=new Vl;E.curves=T.curves,_.push(E)}return _}(r);if(d.length>1){let g=!1,_=0;for(let x=0,b=d.length;x<b;x++)f[x]=[];for(let x=0,b=d.length;x<b;x++){const T=p[x];for(let E=0;E<T.length;E++){const M=T[E];let w=!0;for(let I=0;I<d.length;I++)n(M.p,d[I].p)&&(x!==I&&_++,w?(w=!1,f[I].push(M)):g=!0);w&&f[x].push(M)}}_>0&&!1===g&&(p=f)}for(let g=0,_=d.length;g<_;g++){l=d[g].s,c.push(l),v=p[g];for(let x=0,b=v.length;x<b;x++)l.holes.push(v[x].h)}return c}}const Gt=Object.freeze({TEXT:0,ESCAPE:1,SKIP_FORMAT:2,PARAGRAPH1:3,PARAGRAPH2:4,PARAGRAPH3:5,COLOR:6}),Xn=Object.freeze({TEXT:0,SCOPE:1,PARAGRAPH:2,NON_BREAKING_SPACE:3,PARAGRAPH_ALIGNMENT:4,COLOR:5}),Zv=new Set(["L","l","O","o","K","k","P","X","~"]),Jv=new Set(["f","F","p","Q","H","W","S","A","C","T"]),Kv=new Set(["\\","{","}"]);let xi=(()=>{class i{constructor(){this.entities=[]}Parse(t){const n=t.length;let s=0,r=Gt.TEXT,a=[],o=this.entities,l=0;const c=this;function u(){r!==Gt.TEXT||s===l||(o.push({type:Xn.TEXT,content:t.slice(s,l)}),s=l)}function f(y){o.push({type:y})}function d(){const y=t.slice(s,l),v=parseInt(y);isNaN(v)||v<1||v>255||o.push({type:Xn.COLOR,color:Sr[v]})}function p(){const y={type:Xn.SCOPE,content:[]};o.push(y),o=y.content,a.push(y)}function m(){0!==a.length&&(a.pop(),o=0===a.length?c.entities:a[a.length-1].content)}for(;l<n;l++){const y=t.charAt(l);switch(r){case Gt.TEXT:if("{"===y){u(),p(),s=l+1;continue}if("}"===y){u(),m(),s=l+1;continue}if("\\"===y){u(),r=Gt.ESCAPE;continue}continue;case Gt.ESCAPE:if(Zv.has(y)){switch(y){case"P":f(Xn.PARAGRAPH);break;case"~":f(Xn.NON_BREAKING_SPACE)}r=Gt.TEXT,s=l+1;continue}if(Jv.has(y)){switch(y){case"p":r=Gt.PARAGRAPH1;continue;case"C":r=Gt.COLOR,s=l+1;continue}r=Gt.SKIP_FORMAT;continue}s=Kv.has(y)?l:l-1,r=Gt.TEXT;continue;case Gt.PARAGRAPH1:r="x"===y?Gt.PARAGRAPH2:Gt.SKIP_FORMAT;continue;case Gt.PARAGRAPH2:r="q"===y?Gt.PARAGRAPH3:Gt.SKIP_FORMAT;continue;case Gt.PARAGRAPH3:o.push({type:Xn.PARAGRAPH_ALIGNMENT,alignment:y}),r=Gt.SKIP_FORMAT;continue;case Gt.SKIP_FORMAT:";"===y&&(s=l+1,r=Gt.TEXT);continue;case Gt.COLOR:";"===y&&(d(),s=l+1,r=Gt.TEXT);continue;default:throw new Error("Unhandled state")}}u()}GetContent(){return this.entities}*GetText(){yield*function*t(n){for(const s of n)s.type===Xn.TEXT?yield s.content:s.type===Xn.SCOPE&&(yield*t(s.content))}(this.GetContent())}}return i.EntityType=Xn,i})();const $v=/(?:%%([dpcou%]))|(?:\\U\+([0-9a-f]{4}))/gi;function _i(i){return i.replaceAll($v,(e,t,n)=>{if(void 0!==t)switch(t.toLowerCase()){case"d":return"\xb0";case"p":return"\xb1";case"c":return"\u2205";case"o":case"u":return"";case"%":return"%"}else if(void 0!==n){const s=parseInt(n,16);return isNaN(s)?e:String.fromCharCode(s)}return e})}let R6=(()=>{class i{constructor(t,n=null){this.fontFetchers=t,this.fonts=[],this.options=Object.create(i.DefaultOptions),n&&Object.assign(this.options,n),this.shapes=new Map,this.stubShapeLoaded=!1,this.stubShape=null}FetchFonts(t){var n=this;return(0,pt.A)(function*(){if(!n.stubShapeLoaded){n.stubShapeLoaded=!0;for(const r of Array.from(n.options.fallbackChar))if(yield n.FetchFonts(r)){n.stubShape=n._CreateCharShape(r);break}}let s=!1;for(const r of t){if(r.codePointAt(0)<32)continue;let a=!1;for(const o of n.fonts)if(o.HasChar(r)){a=!0;break}if(!a){if(!n.fontFetchers)return!1;for(;n.fontFetchers.length>0;){const o=n.fontFetchers.shift(),l=yield n._FetchFont(o);if(n.fonts.push(l),l.HasChar(r)){a=!0;break}}a||(s=!0)}}return!s})()}get canRender(){return null!==this.fonts&&this.fonts.length>0}GetLineWidth(t,n){const s=new Yl(n);for(const r of t){const a=this._GetCharShape(r);a&&s.PushChar(r,a)}return s.GetCurrentPosition()}*Render({text:t,startPos:n,endPos:s,rotation:r=0,widthFactor:a=1,hAlign:o=0,vAlign:l=0,color:c,layer:u=null,fontSize:f}){const d=new Yl(f);for(const p of t){const m=this._GetCharShape(p);m&&d.PushChar(p,m)}yield*d.Render(n,s,r,a,o,l,c,u)}*RenderMText({formattedText:t,position:n,fontSize:s,width:r=null,rotation:a=0,direction:o=null,attachment:l,lineSpacing:c=1,color:u,layer:f=null}){s||(s=1);const d=new Si(s,this._GetCharShape.bind(this));d.FeedText(t),yield*d.Render(n,r,a,o,l,c,u,f)}_GetCharShape(t){let n=this.shapes.get(t);return n||(n=this._CreateCharShape(t),this.shapes.set(t,n),n)}_CreateCharShape(t){for(const n of this.fonts){const s=n.GetCharPath(t);if(s)return new Qv(n,s,this.options)}return this.stubShape}_FetchFont(t){return(0,pt.A)(function*(){return new jv(yield t())})()}}return i.DefaultOptions={curveSubdivision:2,fallbackChar:"\ufffd?"},i})();class Qv{constructor(e,t,n){if(this.font=e,this.advance=t.advance,this.bounds=t.bounds,t.path){const s=t.path.toShapes(!1);this.vertices=[],this.indices=[];for(const r of s){let u=function(f){for(const d of f)l.vertices.push(d)};const a=r.extractPoints(n.curveSubdivision);if(!cr.isClockWise(a.shape)){a.shape=a.shape.reverse();for(const f of a.holes)cr.isClockWise(f)&&(a.holes[h]=f.reverse())}const o=cr.triangulateShape(a.shape,a.holes),l=this,c=this.vertices.length;u(a.shape);for(const f of a.holes)u(f);for(const f of o)for(const d of f)this.indices.push(c+d)}}else this.vertices=null}GetVertices(e,t){return this.vertices.map(n=>n.clone().multiplyScalar(t).add(e))}}class jv{constructor(e){this.data=e,this.charMap=new Map;for(const t of Object.values(e.glyphs.glyphs))void 0!==t.unicode&&this.charMap.set(String.fromCodePoint(t.unicode),t);this.scale=100/(72*(this.data.unitsPerEm||2048))}HasChar(e){return this.charMap.has(e)}GetCharPath(e){const t=this.charMap.get(e);if(!t)return null;const n=this.scale,s=new qv;for(const r of t.path.commands)switch(r.type){case"M":s.moveTo(r.x*n,r.y*n);break;case"L":s.lineTo(r.x*n,r.y*n);break;case"Q":s.quadraticCurveTo(r.x1*n,r.y1*n,r.x*n,r.y*n);break;case"C":s.bezierCurveTo(r.x1*n,r.y1*n,r.x2*n,r.y2*n,r.x*n,r.y*n)}return{advance:t.advanceWidth*n,path:s,bounds:{xMin:t.xMin*n,xMax:t.xMax*n,yMin:t.yMin*n,yMax:t.yMax*n}}}GetKerning(e,t){const n=this.data.charToGlyphIndex(e);if(0===n)return 0;const s=this.data.charToGlyphIndex(e);return 0===s?0:this.data.getKerningValue(n,s)*this.scale}}const q0=Object.freeze({LEFT:0,CENTER:1,RIGHT:2,ALIGNED:3,MIDDLE:4,FIT:5}),bi=Object.freeze({BASELINE:0,BOTTOM:1,MIDDLE:2,TOP:3}),b0=Object.freeze({TOP_LEFT:1,TOP_CENTER:2,TOP_RIGHT:3,MIDDLE_LEFT:4,MIDDLE_CENTER:5,MIDDLE_RIGHT:6,BOTTOM_LEFT:7,BOTTOM_CENTER:8,BOTTOM_RIGHT:9});let Si=(()=>{class i{constructor(t,n){this.fontSize=t,this.charShapeProvider=n,this.curParagraph=new i.Paragraph(this),this.paragraphs=[this.curParagraph],this.spaceShape=n(" ")}FeedText(t){let s=null,r=null;for(const a of function*n(a){for(const o of a)o.type===xi.EntityType.SCOPE?yield*n(o.content):yield o}(t))switch(a.type){case xi.EntityType.TEXT:for(const l of a.content)" "===l?this.curParagraph.FeedSpace():this.curParagraph.FeedChar(l);break;case xi.EntityType.PARAGRAPH:this.curParagraph=new i.Paragraph(this),this.curParagraph.SetAlignment(s),this.curParagraph.SetColor(r),this.paragraphs.push(this.curParagraph);break;case xi.EntityType.NON_BREAKING_SPACE:this.curParagraph.FeedChar(" ");break;case xi.EntityType.PARAGRAPH_ALIGNMENT:let o=null;switch(a.alignment){case"l":o=i.Paragraph.Alignment.LEFT;break;case"c":o=i.Paragraph.Alignment.CENTER;break;case"r":o=i.Paragraph.Alignment.RIGHT;break;case"d":o=i.Paragraph.Alignment.JUSTIFY;break;case"j":o=null}this.curParagraph.SetAlignment(o),s=o;break;case xi.EntityType.COLOR:r=a.color,this.curParagraph.SetColor(r)}}*Render(t,n,s,r,a,o,l,c){for(const v of this.paragraphs)v.BuildLines(n);if(null===n||0===n){n=0;for(const v of this.paragraphs){const g=v.GetMaxLineWidth();g>n&&(n=g)}}let u=i.Paragraph.Alignment.LEFT;switch(a){case b0.TOP_CENTER:case b0.MIDDLE_CENTER:case b0.BOTTOM_CENTER:u=i.Paragraph.Alignment.CENTER;break;case b0.TOP_RIGHT:case b0.MIDDLE_RIGHT:case b0.BOTTOM_RIGHT:u=i.Paragraph.Alignment.RIGHT}for(const v of this.paragraphs)v.ApplyAlignment(n,u);null!==r&&(s=180*Math.atan2(r.y,r.x)/Math.PI);const f=5*o*this.fontSize/3;let d=0;for(const v of this.paragraphs)null===v.lines?d++:d+=v.lines.length;d*=f;let p=new H;switch(a){case b0.TOP_LEFT:break;case b0.TOP_CENTER:p.x=n/2;break;case b0.TOP_RIGHT:p.x=n;break;case b0.MIDDLE_LEFT:p.y=-d/2;break;case b0.MIDDLE_CENTER:p.x=n/2,p.y=-d/2;break;case b0.MIDDLE_RIGHT:p.x=n,p.y=-d/2;break;case b0.BOTTOM_LEFT:p.y=-d;break;case b0.BOTTOM_CENTER:p.x=n/2,p.y=-d;break;case b0.BOTTOM_RIGHT:p.x=n,p.y=-d;break;default:throw new Error("Unhandled alignment")}const m=(new Ye).translate(-p.x,-p.y).rotate(-s*Math.PI/180).translate(t.x,t.y);let y=-this.fontSize;for(const v of this.paragraphs)if(null!==v.lines)for(const g of v.lines){for(let _=g.startChunkIdx;_<g.startChunkIdx+g.numChunks;_++){const x=v.chunks[_];let b=x.position;(0===_||_!==g.startChunkIdx)&&(b+=x.GetSpacingWidth());const T=new H(b,y);T.applyMatrix3(m),x.block&&(yield*x.block.Render(T,null,s,null,q0.LEFT,bi.BASELINE,l,c))}y-=f}else y-=f}}return i.Paragraph=class{constructor(e){this.textBox=e,this.chunks=[],this.curChunk=null,this.alignment=null,this.lines=null,this.color=null}FeedChar(e){const t=this.textBox.charShapeProvider(e);null!==t&&(null===this.curChunk&&this._AddChunk(),this.curChunk.PushChar(e,t))}FeedSpace(){(null===this.curChunk||null!==this.curChunk.lastChar)&&this._AddChunk(),this.curChunk.PushSpace()}SetAlignment(e){this.alignment=e}SetColor(e){this.color=e}BuildLines(e){if(null===this.curChunk)return;this.lines=[];let t=0,n=0,s=0;const r=()=>{this.lines.push(new i.Paragraph.Line(this,t,n-t,s)),t=n,s=0};for(;n<this.chunks.length;n++){const a=this.chunks[n];let o=a.GetWidth(0===t||n!==t);null!==e&&0!==e&&s+o>e&&(0==n&&a.leadingSpaces>0&&(this.lines.push(new i.Paragraph.Line(this,t,t,0)),a.leadingSpaces=0,o=a.GetWidth(!1)),0!==s&&r()),a.position=s,s+=o}t!==n&&0!==s&&r()}GetMaxLineWidth(){if(null===this.lines)return 0;let e=0;for(const t of this.lines)t.width>e&&(e=t.width);return e}ApplyAlignment(e,t){if(this.lines)for(const n of this.lines)n.ApplyAlignment(e,t)}_AddChunk(){this.curChunk=new i.Paragraph.Chunk(this,this.textBox.fontSize,this.color,this.curChunk),this.chunks.push(this.curChunk)}},i})();Si.Paragraph.Alignment=Object.freeze({LEFT:0,CENTER:1,RIGHT:2,JUSTIFY:3}),Si.Paragraph.Chunk=class{constructor(i,e,t,n){this.paragraph=i,this.fontSize=e,this.color=t,this.prevChunk=n,this.lastChar=null,this.lastShape=null,this.leadingSpaces=0,this.spaceStartKerning=null,this.spaceEndKerning=null,this.block=null,this.position=null}PushSpace(){if(this.block)throw new Error("Illegal operation");this.leadingSpaces++}PushChar(i,e){null===this.spaceStartKerning&&(0===this.leadingSpaces?(this.spaceStartKerning=0,this.spaceEndKerning=0):(this.spaceStartKerning=this.prevChunk&&this.prevChunk.lastShape&&this.prevChunk.fontSize===this.fontSize&&this.prevChunk.lastShape.font===this.paragraph.textBox.spaceShape.font?this.prevChunk.lastShape.font.GetKerning(this.prevChunk.lastChar," "):0,this.spaceEndKerning=e.font===this.paragraph.textBox.spaceShape.font?e.font.GetKerning(" ",i):0)),null===this.block&&(this.block=new Yl(this.fontSize,this.color)),this.block.PushChar(i,e),this.lastChar=i,this.lastShape=e}GetSpacingWidth(){return(this.leadingSpaces*this.paragraph.textBox.spaceShape.advance+this.spaceStartKerning+this.spaceEndKerning)*this.fontSize}GetWidth(i){if(null===this.block)return 0;let e=this.block.GetCurrentPosition();return i&&(e+=this.GetSpacingWidth()),e}},Si.Paragraph.Line=class{constructor(i,e,t,n){this.paragraph=i,this.startChunkIdx=e,this.numChunks=t,this.width=n}ApplyAlignment(i,e){switch(this.paragraph.alignment??e){case Si.Paragraph.Alignment.LEFT:break;case Si.Paragraph.Alignment.CENTER:{const n=(i-this.width)/2;this.ForEachChunk(s=>s.position+=n);break}case Si.Paragraph.Alignment.RIGHT:{const n=i-this.width;this.ForEachChunk(s=>s.position+=n);break}case Si.Paragraph.Alignment.JUSTIFY:{const n=i-this.width;if(n<=0||1===this.numChunks)break;const s=n/(this.numChunks-1);let r=0;this.ForEachChunk(a=>{a.position+=r,r+=s});break}default:throw new Error("Unhandled alignment: "+this.paragraph.alignment)}}ForEachChunk(i){for(let e=0;e<this.numChunks;e++)i(this.paragraph.chunks[this.startChunkIdx+e])}};class Yl{constructor(e,t){this.fontSize=e,this.color=t,this.glyphs=[],this.bounds=null,this.curX=0,this.prevChar=null,this.prevFont=null}PushChar(e,t){let n;n=null!==this.prevChar&&this.prevFont===t.font?this.prevFont.GetKerning(this.prevChar,e):0;const s=this.curX+n*this.fontSize;let r;if(t.vertices&&t.vertices.length>0){r=t.GetVertices({x:s,y:0},this.fontSize);const a=s+t.bounds.xMin*this.fontSize,o=s+t.bounds.xMax*this.fontSize,l=t.bounds.yMin*this.fontSize,c=t.bounds.yMax*this.fontSize;null===this.bounds?this.bounds={xMin:a,xMax:o,yMin:l,yMax:c}:(a<this.bounds.xMin&&(this.bounds.xMin=a),l<this.bounds.yMin&&(this.bounds.yMin=l),o>this.bounds.xMax&&(this.bounds.xMax=o),c>this.bounds.yMax&&(this.bounds.yMax=c))}else r=null;this.curX=s+t.advance*this.fontSize,this.glyphs.push({shape:t,vertices:r}),this.prevChar=e,this.prevFont=t.font}GetCurrentPosition(){return this.curX}*Render(e,t,n,s,r,a,o,l){if(null===this.bounds)return;t=t??e,n?n*=-Math.PI/180:n=0,s=s??1,r=r??q0.LEFT,a=a??bi.BASELINE;let c=new H,u=new H(s,1),f=r===q0.LEFT&&a===bi.BASELINE||r===q0.FIT||r===q0.ALIGNED?new H(e.x,e.y):new H(t.x,t.y);const d=()=>{const y=t.x-e.x;return y<2*Number.MIN_VALUE?s:y/(this.bounds.xMax-this.bounds.xMin)},p=()=>-Math.atan2(t.y-e.y,t.x-e.x);switch(r){case q0.LEFT:c.x=this.bounds.xMin;break;case q0.CENTER:c.x=(this.bounds.xMax-this.bounds.xMin)/2;break;case q0.RIGHT:c.x=this.bounds.xMax;break;case q0.MIDDLE:c.x=(this.bounds.xMax-this.bounds.xMin)/2,c.y=(this.bounds.yMax-this.bounds.yMin)/2;break;case q0.ALIGNED:{const y=d();u.x=y,u.y=y,n=p();break}case q0.FIT:u.x=d(),n=p();break;default:console.warn("Unrecognized hAlign value: "+r)}switch(a){case bi.BASELINE:break;case bi.BOTTOM:c.y=this.bounds.yMin;break;case bi.MIDDLE:c.y=(this.bounds.yMax-this.bounds.yMin)/2;break;case bi.TOP:c.y=this.bounds.yMax;break;default:console.warn("Unrecognized vAlign value: "+a)}const m=(new Ye).translate(-c.x,-c.y).scale(u.x,u.y).rotate(n).translate(f.x,f.y);for(const y of this.glyphs)if(y.vertices){for(const v of y.vertices)v.applyMatrix3(m);yield new Xe({type:Xe.Type.TRIANGLES,vertices:y.vertices,indices:y.shape.indices,layer:l,color:this.color??o})}}}function an(){}function hr(i){this._tree=i,this._ancestors=[],this._cursor=null}function ur(i){this.data=i,this.left=null,this.right=null,this.red=!0}function aa(i){this._root=null,this._comparator=i,this.size=0}function Z0(i){return null!==i&&i.red}function oa(i,e){var t=i.get_child(!e);return i.set_child(!e,t.get_child(e)),t.set_child(e,i),i.red=!0,t.red=!1,t}function L6(i,e){return i.set_child(!e,oa(i.get_child(!e),!e)),oa(i,e)}an.prototype.clear=function(){this._root=null,this.size=0},an.prototype.find=function(i){for(var e=this._root;null!==e;){var t=this._comparator(i,e.data);if(0===t)return e.data;e=e.get_child(t>0)}return null},an.prototype.findIter=function(i){for(var e=this._root,t=this.iterator();null!==e;){var n=this._comparator(i,e.data);if(0===n)return t._cursor=e,t;t._ancestors.push(e),e=e.get_child(n>0)}return null},an.prototype.lowerBound=function(i){for(var e=this._root,t=this.iterator(),n=this._comparator;null!==e;){var s=n(i,e.data);if(0===s)return t._cursor=e,t;t._ancestors.push(e),e=e.get_child(s>0)}for(var r=t._ancestors.length-1;r>=0;--r)if(n(i,(e=t._ancestors[r]).data)<0)return t._cursor=e,t._ancestors.length=r,t;return t._ancestors.length=0,t},an.prototype.upperBound=function(i){for(var e=this.lowerBound(i),t=this._comparator;null!==e.data()&&0===t(e.data(),i);)e.next();return e},an.prototype.min=function(){var i=this._root;if(null===i)return null;for(;null!==i.left;)i=i.left;return i.data},an.prototype.max=function(){var i=this._root;if(null===i)return null;for(;null!==i.right;)i=i.right;return i.data},an.prototype.iterator=function(){return new hr(this)},an.prototype.each=function(i){for(var t,e=this.iterator();null!==(t=e.next());)i(t)},an.prototype.reach=function(i){for(var t,e=this.iterator();null!==(t=e.prev());)i(t)},hr.prototype.data=function(){return null!==this._cursor?this._cursor.data:null},hr.prototype.next=function(){if(null===this._cursor){var i=this._tree._root;null!==i&&this._minNode(i)}else if(null===this._cursor.right){var e;do{if(e=this._cursor,!this._ancestors.length){this._cursor=null;break}this._cursor=this._ancestors.pop()}while(this._cursor.right===e)}else this._ancestors.push(this._cursor),this._minNode(this._cursor.right);return null!==this._cursor?this._cursor.data:null},hr.prototype.prev=function(){if(null===this._cursor){var i=this._tree._root;null!==i&&this._maxNode(i)}else if(null===this._cursor.left){var e;do{if(e=this._cursor,!this._ancestors.length){this._cursor=null;break}this._cursor=this._ancestors.pop()}while(this._cursor.left===e)}else this._ancestors.push(this._cursor),this._maxNode(this._cursor.left);return null!==this._cursor?this._cursor.data:null},hr.prototype._minNode=function(i){for(;null!==i.left;)this._ancestors.push(i),i=i.left;this._cursor=i},hr.prototype._maxNode=function(i){for(;null!==i.right;)this._ancestors.push(i),i=i.right;this._cursor=i},ur.prototype.get_child=function(i){return i?this.right:this.left},ur.prototype.set_child=function(i,e){i?this.right=e:this.left=e},(aa.prototype=new an).insert=function(i){var e=!1;if(null===this._root)this._root=new ur(i),e=!0,this.size++;else{var t=new ur(void 0),n=0,s=0,r=null,a=t,o=null,l=this._root;for(a.right=this._root;;){if(null===l?(l=new ur(i),o.set_child(n,l),e=!0,this.size++):Z0(l.left)&&Z0(l.right)&&(l.red=!0,l.left.red=!1,l.right.red=!1),Z0(l)&&Z0(o)){var c=a.right===r;l===o.get_child(s)?a.set_child(c,oa(r,!s)):a.set_child(c,L6(r,!s))}var u=this._comparator(l.data,i);if(0===u)break;s=n,null!==r&&(a=r),r=o,o=l,l=l.get_child(n=u<0)}this._root=t.right}return this._root.red=!1,e},aa.prototype.remove=function(i){if(null===this._root)return!1;var e=new ur(void 0),t=e;t.right=this._root;for(var n=null,s=null,r=null,a=1;null!==t.get_child(a);){var o=a;s=n,n=t,t=t.get_child(a);var l=this._comparator(i,t.data);if(a=l>0,0===l&&(r=t),!Z0(t)&&!Z0(t.get_child(a)))if(Z0(t.get_child(!a))){var c=oa(t,a);n.set_child(o,c),n=c}else if(!Z0(t.get_child(!a))){var u=n.get_child(!o);if(null!==u)if(Z0(u.get_child(!o))||Z0(u.get_child(o))){var f=s.right===n;Z0(u.get_child(o))?s.set_child(f,L6(n,o)):Z0(u.get_child(!o))&&s.set_child(f,oa(n,o));var d=s.get_child(f);d.red=!0,t.red=!0,d.left.red=!1,d.right.red=!1}else n.red=!1,u.red=!0,t.red=!0}}return null!==r&&(r.data=t.data,n.set_child(n.right===t,t.get_child(null===t.left)),this.size--),this._root=e.right,null!==this._root&&(this._root.red=!1),null!==r};class ey{constructor(){this.lines=[],this.triangles=[],this.texts=[]}AddLine(e,t,n=null){this.lines.push({start:e,end:t,color:n})}AddTriangles(e,t,n=null){this.triangles.push({vertices:e,indices:t,color:n})}AddText(e,t,n,s,r){this.texts.push({text:e,size:t,angle:n,color:s,position:r})}}const I6_vertices=[new H(0,0),new H(1,-.25),new H(1,.25)],I6_indices=[0,1,2];class ty{constructor(e,t,n){this.params=e,this.styleResolver=t,this.textWidthCalculator=n,this.isValid=!0,this._CalculateGeometry()}IsValid(){return this.isValid}GetTexts(){return[this._GetText()]}GenerateLayout(){const e=new ey,t=this.d1.distanceTo(this.d2),n=this.styleResolver("DIMCLRD");let s=this.styleResolver("DIMSCALE")??1;0==s&&(s=1);const r=this._GetText(),a=(this.styleResolver("DIMTXT")??1)*s,l=(this.textWidthCalculator(r,a),this.styleResolver("DIMCLRT")),c=(this.styleResolver("DIMASZ")??1)*s,u=(this.styleResolver("DIMTSZ")??0)*s;let f=this.params.textAnchor,d=!1;const p=this.d1.clone(),m=(this.styleResolver("DIMDLE")??0)*s;0!=m&&p.add(this.vDim.clone().multiplyScalar(-m));const y=this.d2.clone();0!=m&&y.add(this.vDim.clone().multiplyScalar(m)),e.AddLine(p,y,n),t<2*c&&(d=!0),f||(f=this.vDim.clone().multiplyScalar(this.d1.distanceTo(this.d2)/2).add(this.d1).add(this.vDimNorm.clone().multiplyScalar(.75*a)));const v=180*this.vDimNorm.angle()/Math.PI-90+(this.params.textRotation??0);e.AddText(r,a,v,l,f);const g=this.styleResolver("DIMCLRE"),_=(this.styleResolver("DIMEXO")??0)*s,x=(this.styleResolver("DIMEXE")??0)*s,b=(T,E)=>{const M=E.clone().sub(T);if(0==M.length())return;M.normalize();const I=T.clone();0!=_&&I.add(M.clone().multiplyScalar(_));const S=E.clone();0!=x&&S.add(M.clone().multiplyScalar(x)),e.AddLine(I,S,g)};(this.styleResolver("DIMSE1")??0)||b(this.params.p1,this.d1),this.styleResolver("DIMSE2")||b(this.params.p2,this.d2);for(let T=0;T<2;T++){const E=0==T?this.d1:this.d2;let M=1==T;d&&(M=!M);let w=(new Ye).identity();u>0?w.scale(u,u):(w.scale(c,c),M&&w.scale(-1,1));const I=-this.vDim.angle();w.rotate(I),w.translate(E.x,E.y),u>0?this._CreateTick(e,w,n):this._CreateArrowShape(e,w,n)}return e}_CreateArrowShape(e,t,n){const s=[];for(const r of I6_vertices)s.push(r.clone().applyMatrix3(t));e.AddTriangles(s,I6_indices,n)}_CreateTick(e,t,n){e.AddLine(new H(.5,.5).applyMatrix3(t),new H(-.5,-.5).applyMatrix3(t),n)}_CalculateGeometry(){if(this.vBase=this.params.p2.clone().sub(this.params.p1).normalize(),this.params.isAligned)this.vDim=this.vBase;else{const e=(this.params.angle??0)*Math.PI/180;this.vDim=new H(Math.cos(e),Math.sin(e))}this.d1=this.vDim.clone().multiplyScalar(this.params.p1.clone().sub(this.params.anchor).dot(this.vDim)).add(this.params.anchor),this.d2=this.vDim.clone().multiplyScalar(this.params.p2.clone().sub(this.params.anchor).dot(this.vDim)).add(this.params.anchor),0==this.d1.distanceTo(this.d2)&&(this.isValid=!1),this.vDim.copy(this.d2).sub(this.d1).normalize(),this.vDimNorm=this.vDim.y<-this.vDim.x?new H(this.vDim.y,-this.vDim.x):new H(-this.vDim.y,this.vDim.x)}_GetText(){if(" "==this.params.text)return"";if(""!=(this.params.text??"")&&-1==this.params.text.indexOf("<>"))return _i(this.params.text);let e=this.d2.distanceTo(this.d1);e*=this.styleResolver("DIMLFAC")??1;const t=this.styleResolver("DIMRND")??0;t>0&&(e=t*Math.round(e/t));const n=this.styleResolver("DIMZIN")??0,s=!!(4&n),r=!!(8&n);let a=e.toFixed(this.styleResolver("DIMDEC")??2);r&&(a=a.replace(/.0+$/,"")),s&&(a=a.replace(/^0+/,"")),a.startsWith(".")?a="0"+a:""==a&&(a="0"),a.endsWith(".")&&(a=a.substring(0,a.length-1));let o=this.styleResolver("DIMDSEP")??".";isNaN(o)||(o=String.fromCharCode(o)),"."!=o&&(a=a.replace(".",o));const l=this.styleResolver("DIMPOST")??"";return""!=l&&(-1!=l.indexOf("<>")?a=l.replaceAll("<>",a):a+=l),""!=(this.params.text??"")&&(a=this.params.text.replaceAll("<>",a)),_i(a)}}function D6(i,e,t,n,s=!1){const r=e.clone().sub(i),a=n.clone().sub(t);if(0==r.lengthSq()||0==a.lengthSq())return null;const o=r.cross(a);if(Math.abs(o)<=Number.EPSILON)return null;const l=t.clone().sub(i),c=l.cross(a)/o;if(!s&&(c<0||c>1))return null;const u=l.cross(r)/o;return!s&&(u<0||u>1)?null:[c,u,o]}const ql=Object.freeze({ODD_PARITY:0,OUTERMOST:1,THROUGH_ENTIRE_AREA:2}),d1=1e-4;function F6(i,e){return(i.intersection[2]>0&&e.intersection[2])>0||i.intersection[2]<0&&e.intersection[2]<0}class ny{constructor(e,t,n){this.style=t,this.line=n,this.lineDir=n[1].clone().sub(n[0]).normalize(),this.loops=[];for(let s=0;s<e.length;s++){const r=e[s],a=[];for(let o=0;o<r.length;o++)a.push({idx:o,start:r[o],end:r[o==r.length-1?0:o+1],loopIdx:s});this.loops.push(a)}}Calculate(){return this._ProcessEdges(),this._CreateNodes(),this.nodes.sort((e,t)=>e.intersection[0]-t.intersection[0]),this.style==ql.THROUGH_ENTIRE_AREA?this._GenerateThroughAllSegments():this._GenerateOddParitySegments()}_ProcessEdges(){for(const e of this.loops)for(const t of e){const n=t.end.clone().sub(t.start),s=n.length();if(t.isZero=s<=Number.EPSILON,t.isZero)continue;n.divideScalar(s);const r=n.cross(this.lineDir);t.isParallel=Math.abs(r)<=1e-6,!t.isParallel&&(t.intersection=D6(this.line[0],this.line[1],t.start,t.end,!0))}}_CreateNodes(){this.nodes=[];for(const e of this.loops)for(let t of e){if(t.isZero||t.isParallel||t.isProcessed||!t.intersection||t.intersection[1]<-d1||t.intersection[1]>1+d1)continue;const n=t.intersection[1]<=d1;if(n||t.intersection[1]>=1-d1){let[s,r]=this._GetConnectedEdge(t,n);if(!s)continue;if(t.isProcessed=!0,s.isProcessed=!0,r)F6(t,s)&&(t.toggle=!0,this.nodes.push(t));else{if(t.intersection[0]>s.intersection[0]){const a=s;s=t,t=a}t.suppress=!0,s.unsuppress=!0,this.nodes.push(t),F6(t,s)&&(s.toggle=!0),this.nodes.push(s)}}else t.isProcessed=!0,t.toggle=!0,this.nodes.push(t)}}_GetConnectedEdge(e,t){const n=this.loops[e.loopIdx];let s=e.idx,r=!0;do{t?0==s?s=n.length-1:s--:s==n.length-1?s=0:s++;const a=n[s];if(!a.isZero&&!a.isParallel)return[a,r];r=!1}while(s!=e.idx);return[null,!1]}_GenerateOddParitySegments(){const e=[];let t=!1,n=0,s=null;for(const r of this.nodes)r.suppress&&n++,r.unsuppress&&n--,r.toggle&&(t=!t),0==n&&t&&(r.unsuppress||r.toggle)?s=r:(n||!t)&&s&&(r.intersection[0]-s.intersection[0]>Number.EPSILON&&e.push([s.intersection[0],r.intersection[0]]),s=null);return e}_GenerateThroughAllSegments(){const e=[];let t=0,n=null;const s=new Array(this.loops.length).fill(0);function r(){for(const a of s)if(0!=a)return!1;return!0}for(const a of this.nodes){a.suppress&&t++,a.unsuppress&&t--;const o=r();a.toggle&&(a.intersection[2]>0?s[a.loopIdx]++:s[a.loopIdx]--),0!=t||r()||!a.unsuppress&&!o?(t||r())&&n&&(a.intersection[0]-n.intersection[0]>Number.EPSILON&&e.push([n.intersection[0],a.intersection[0]]),n=null):n=a}return e}}class iy{boundaryLoops;style;constructor(e,t){this.boundaryLoops=e,this.style=t}ClipLine(e){return new ny(this.boundaryLoops,this.style,e).Calculate()}GetPatternTransform({seedPoint:e,angle:t,scale:n}){const s=(new Ye).makeTranslation(-e.x,-e.y);return t&&s.rotate(t),1!=(n??1)&&s.scale(1/n,1/n),s}GetLineTransform({patTransform:e,basePoint:t,angle:n}){const s=e.clone();return t&&s.translate(-t.x,-t.y),n&&s.rotate(n),s}GetBoundingBox(e){const t=new Xg;for(const n of this.boundaryLoops)for(const s of n)t.expandByPoint(s.clone().applyMatrix3(e));return t}}class O{constructor(e,t=null,n=!0){this.lines=e,this.name=t,this.offsetInLineSpace=n}get isQcadDefault(){if(1!=this.lines.length)return!1;const e=this.lines[0];return!(e.dashes||Math.abs(e.angle-Math.PI/4)>1e-13)}static ParsePatFile(e){const t=e.split(/\r?\n/);if(t.length<2)throw new Error("Invalid .pat file content");let n=null;const s=[];for(let r of t){if(r=r.trim(),""==r||r.startsWith(";"))continue;if(null===n){const c=r.match(/\*([^,]+)(?:,.*)?/);if(!c)throw new Error("Bad header for .pat file content");n=c[1];continue}const a=r.indexOf(";");-1!=a&&(r=r.substring(0,a).trim());let o=r.split(/\s*,\s*/);""==o[o.length-1]&&(o.length=o.length-1),o=o.map(c=>{const u=parseFloat(c);if(isNaN(u))throw new Error("Failed to parse number in .pat file: "+c);return u});const l={angle:o[0]*Math.PI/180,base:new H(o[1],o[2]),offset:new H(o[3],o[4])};o.length>5&&(l.dashes=o.slice(5)),s.push(l)}return new O(s,n)}}const O6=new Map,N6=new Map;function N(i,e=!0){if(!i.name)throw new Error("Anonymous pattern cannot be registered");const t=i.name.toUpperCase(),n=e?O6:N6;n.has(t)?console.warn(`Pattern with name ${t} is already registered`):n.set(t,i)}function k6(i,e=!0){return(e?O6:N6).get(i.toUpperCase())}function U6(i,e,t,n,s){let r;if(s===function Kl(i,e,t,n){let s=0;for(let r=e,a=t-n;r<t;r+=n)s+=(i[a]-i[r])*(i[r+1]+i[a+1]),a=r;return s}(i,e,t,n)>0)for(let a=e;a<t;a+=n)r=H6(a/n|0,i[a],i[a+1],r);else for(let a=t-n;a>=e;a-=n)r=H6(a/n|0,i[a],i[a+1],r);return r&&fr(r,r.next)&&(ua(r),r=r.next),r}function rs(i,e){if(!i)return i;e||(e=i);let n,t=i;do{if(n=!1,t.steiner||!fr(t,t.next)&&0!==Ft(t.prev,t,t.next))t=t.next;else{if(ua(t),t=e=t.prev,t===t.next)break;n=!0}}while(n||t!==e);return e}function la(i,e,t,n,s,r,a){if(!i)return;!a&&r&&function py(i,e,t,n){let s=i;do{0===s.z&&(s.z=Zl(s.x,s.y,e,t,n)),s.prevZ=s.prev,s.nextZ=s.next,s=s.next}while(s!==i);s.prevZ.nextZ=null,s.prevZ=null,function my(i){let e,t=1;do{let s,n=i;i=null;let r=null;for(e=0;n;){e++;let a=n,o=0;for(let c=0;c<t&&(o++,a=a.nextZ,a);c++);let l=t;for(;o>0||l>0&&a;)0!==o&&(0===l||!a||n.z<=a.z)?(s=n,n=n.nextZ,o--):(s=a,a=a.nextZ,l--),r?r.nextZ=s:i=s,s.prevZ=r,r=s;n=a}r.nextZ=null,t*=2}while(e>1)}(s)}(i,n,s,r);let o=i;for(;i.prev!==i.next;){const l=i.prev,c=i.next;if(r?ay(i,n,s,r):ry(i))e.push(l.i,i.i,c.i),ua(i),i=c.next,o=c.next;else if((i=c)===o){a?1===a?la(i=oy(rs(i),e),e,t,n,s,r,2):2===a&&ly(i,e,t,n,s,r):la(rs(i),e,t,n,s,r,1);break}}}function ry(i){const e=i.prev,t=i,n=i.next;if(Ft(e,t,n)>=0)return!1;const s=e.x,r=t.x,a=n.x,o=e.y,l=t.y,c=n.y,u=Math.min(s,r,a),f=Math.min(o,l,c),d=Math.max(s,r,a),p=Math.max(o,l,c);let m=n.next;for(;m!==e;){if(m.x>=u&&m.x<=d&&m.y>=f&&m.y<=p&&ca(s,o,r,l,a,c,m.x,m.y)&&Ft(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function ay(i,e,t,n){const s=i.prev,r=i,a=i.next;if(Ft(s,r,a)>=0)return!1;const o=s.x,l=r.x,c=a.x,u=s.y,f=r.y,d=a.y,p=Math.min(o,l,c),m=Math.min(u,f,d),y=Math.max(o,l,c),v=Math.max(u,f,d),g=Zl(p,m,e,t,n),_=Zl(y,v,e,t,n);let x=i.prevZ,b=i.nextZ;for(;x&&x.z>=g&&b&&b.z<=_;){if(x.x>=p&&x.x<=y&&x.y>=m&&x.y<=v&&x!==s&&x!==a&&ca(o,u,l,f,c,d,x.x,x.y)&&Ft(x.prev,x,x.next)>=0||(x=x.prevZ,b.x>=p&&b.x<=y&&b.y>=m&&b.y<=v&&b!==s&&b!==a&&ca(o,u,l,f,c,d,b.x,b.y)&&Ft(b.prev,b,b.next)>=0))return!1;b=b.nextZ}for(;x&&x.z>=g;){if(x.x>=p&&x.x<=y&&x.y>=m&&x.y<=v&&x!==s&&x!==a&&ca(o,u,l,f,c,d,x.x,x.y)&&Ft(x.prev,x,x.next)>=0)return!1;x=x.prevZ}for(;b&&b.z<=_;){if(b.x>=p&&b.x<=y&&b.y>=m&&b.y<=v&&b!==s&&b!==a&&ca(o,u,l,f,c,d,b.x,b.y)&&Ft(b.prev,b,b.next)>=0)return!1;b=b.nextZ}return!0}function oy(i,e){let t=i;do{const n=t.prev,s=t.next.next;!fr(n,s)&&G6(n,t,t.next,s)&&ha(n,s)&&ha(s,n)&&(e.push(n.i,t.i,s.i),ua(t),ua(t.next),t=i=s),t=t.next}while(t!==i);return rs(t)}function ly(i,e,t,n,s,r){let a=i;do{let o=a.next.next;for(;o!==a.prev;){if(a.i!==o.i&&vy(a,o)){let l=z6(a,o);return a=rs(a,a.next),l=rs(l,l.next),la(a,e,t,n,s,r,0),void la(l,e,t,n,s,r,0)}o=o.next}a=a.next}while(a!==i)}function hy(i,e){let t=i.x-e.x;return 0===t&&(t=i.y-e.y,0===t)&&(t=(i.next.y-i.y)/(i.next.x-i.x)-(e.next.y-e.y)/(e.next.x-e.x)),t}function uy(i,e){const t=function fy(i,e){let t=e;const n=i.x,s=i.y;let a,r=-1/0;if(fr(i,t))return t;do{if(fr(i,t.next))return t.next;if(s<=t.y&&s>=t.next.y&&t.next.y!==t.y){const f=t.x+(s-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(f<=n&&f>r&&(r=f,a=t.x<t.next.x?t:t.next,f===n))return a}t=t.next}while(t!==e);if(!a)return null;const o=a,l=a.x,c=a.y;let u=1/0;t=a;do{if(n>=t.x&&t.x>=l&&n!==t.x&&B6(s<c?n:r,s,l,c,s<c?r:n,s,t.x,t.y)){const f=Math.abs(s-t.y)/(n-t.x);ha(t,i)&&(f<u||f===u&&(t.x>a.x||t.x===a.x&&dy(a,t)))&&(a=t,u=f)}t=t.next}while(t!==o);return a}(i,e);if(!t)return e;const n=z6(t,i);return rs(n,n.next),rs(t,t.next)}function dy(i,e){return Ft(i.prev,i,e.prev)<0&&Ft(e.next,i,i.next)<0}function Zl(i,e,t,n,s){return(i=1431655765&((i=858993459&((i=252645135&((i=16711935&((i=(i-t)*s|0)|i<<8))|i<<4))|i<<2))|i<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-n)*s|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function gy(i){let e=i,t=i;do{(e.x<t.x||e.x===t.x&&e.y<t.y)&&(t=e),e=e.next}while(e!==i);return t}function B6(i,e,t,n,s,r,a,o){return(s-a)*(e-o)>=(i-a)*(r-o)&&(i-a)*(n-o)>=(t-a)*(e-o)&&(t-a)*(r-o)>=(s-a)*(n-o)}function ca(i,e,t,n,s,r,a,o){return!(i===a&&e===o)&&B6(i,e,t,n,s,r,a,o)}function vy(i,e){return i.next.i!==e.i&&i.prev.i!==e.i&&!function yy(i,e){let t=i;do{if(t.i!==i.i&&t.next.i!==i.i&&t.i!==e.i&&t.next.i!==e.i&&G6(t,t.next,i,e))return!0;t=t.next}while(t!==i);return!1}(i,e)&&(ha(i,e)&&ha(e,i)&&function xy(i,e){let t=i,n=!1;const s=(i.x+e.x)/2,r=(i.y+e.y)/2;do{t.y>r!=t.next.y>r&&t.next.y!==t.y&&s<(t.next.x-t.x)*(r-t.y)/(t.next.y-t.y)+t.x&&(n=!n),t=t.next}while(t!==i);return n}(i,e)&&(Ft(i.prev,i,e.prev)||Ft(i,e.prev,e))||fr(i,e)&&Ft(i.prev,i,i.next)>0&&Ft(e.prev,e,e.next)>0)}function Ft(i,e,t){return(e.y-i.y)*(t.x-e.x)-(e.x-i.x)*(t.y-e.y)}function fr(i,e){return i.x===e.x&&i.y===e.y}function G6(i,e,t,n){const s=m1(Ft(i,e,t)),r=m1(Ft(i,e,n)),a=m1(Ft(t,n,i)),o=m1(Ft(t,n,e));return!!(s!==r&&a!==o||0===s&&p1(i,t,e)||0===r&&p1(i,n,e)||0===a&&p1(t,i,n)||0===o&&p1(t,e,n))}function p1(i,e,t){return e.x<=Math.max(i.x,t.x)&&e.x>=Math.min(i.x,t.x)&&e.y<=Math.max(i.y,t.y)&&e.y>=Math.min(i.y,t.y)}function m1(i){return i>0?1:i<0?-1:0}function ha(i,e){return Ft(i.prev,i,i.next)<0?Ft(i,e,i.next)>=0&&Ft(i,i.prev,e)>=0:Ft(i,e,i.prev)<0||Ft(i,i.next,e)<0}function z6(i,e){const t=Jl(i.i,i.x,i.y),n=Jl(e.i,e.x,e.y),s=i.next,r=e.prev;return i.next=e,e.prev=i,t.next=s,s.prev=t,n.next=t,t.prev=n,r.next=n,n.prev=r,n}function H6(i,e,t,n){const s=Jl(i,e,t);return n?(s.next=n.next,s.prev=n,n.next.prev=s,n.next=s):(s.prev=s,s.next=s),s}function ua(i){i.next.prev=i.prev,i.prev.next=i.next,i.prevZ&&(i.prevZ.nextZ=i.nextZ),i.nextZ&&(i.nextZ.prevZ=i.prevZ)}function Jl(i,e,t){return{i,x:e,y:t,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}N(O.ParsePatFile("\n*ACAD_ISO02W100,ACAD_ISO02W100\n0, 0,0, 0,5, 12,-3\n")),N(O.ParsePatFile("\n*ACAD_ISO03W100,ACAD_ISO03W100\n0, 0,0, 0,5, 12,-18\n")),N(O.ParsePatFile("\n*ACAD_ISO04W100,ACAD_ISO04W100\n0, 0,0, 0,5, 24,-3,.5,-3\n")),N(O.ParsePatFile("\n*ACAD_ISO05W100,ACAD_ISO05W100\n0, 0,0, 0,5, 24,-3,.5,-3,.5,-3\n")),N(O.ParsePatFile("\n*ACAD_ISO06W100,ACAD_ISO06W100\n0, 0,0, 0,5, 24,-3,.5,-3,.5,-6.5\n0, 0,0, 0,5, -34,.5,-3\n")),N(O.ParsePatFile("\n*ACAD_ISO07W100,ACAD_ISO07W100\n0, 0,0, 0,5, .5,-3\n")),N(O.ParsePatFile("\n*ACAD_ISO08W100,ACAD_ISO08W100\n0, 0,0, 0,5, 24,-3,6,-3\n")),N(O.ParsePatFile("\n*ACAD_ISO09W100,ACAD_ISO09W100\n0, 0,0, 0,5, 24,-3,6,-3,6,-3\n")),N(O.ParsePatFile("\n*ACAD_ISO10W100,ACAD_ISO10W100\n0, 0,0, 0,5, 12,-3,.5,-3\n")),N(O.ParsePatFile("\n*ACAD_ISO11W100,ACAD_ISO11W100\n0, 0,0, 0,5, 12,-3,12,-3,.5,-3\n")),N(O.ParsePatFile("\n*ACAD_ISO12W100,ACAD_ISO12W100\n0, 0,0, 0,5, 12,-3,.5,-3,.5,-3\n")),N(O.ParsePatFile("\n*ACAD_ISO13W100,ACAD_ISO13W100\n0, 0,0, 0,5, 12,-3,12,-3,.5,-6.5\n0, 0,0, 0,5, -33.5,.5,-3\n")),N(O.ParsePatFile("\n*ACAD_ISO14W100,ACAD_ISO14W100\n0, 0,0, 0,5, 12,-3,.5,-3,.5,-6.5\n0, 0,0, 0,5, -22,.5,-3\n")),N(O.ParsePatFile("\n*ACAD_ISO15W100,ACAD_ISO15W100\n0, 0,0, 0,5, 12,-3,12,-3,.5,-10\n0, 0,0, 0,5, -33.5,.5,-3,.5,-3\n")),N(O.ParsePatFile("\n*ANGLE,ANGLE\n0, 0,0, 0,6.985, 5.08,-1.905\n90, 0,0, 0,6.985, 5.08,-1.905\n")),N(O.ParsePatFile("\n*ANSI31,ANSI31\n45, 0,0, 0,3.175\n")),N(O.ParsePatFile("\n*ANSI32,ANSI32\n45, 0,0, 0,9.525\n45, 4.49013,0, 0,9.525\n")),N(O.ParsePatFile("\n*ANSI33,ANSI33\n45, 0,0, 0,6.35\n45, 4.49013,0, 0,6.35, 3.175,-1.5875\n")),N(O.ParsePatFile("\n*ANSI34,ANSI34\n45, 0,0, 0,19.05\n45, 4.49013,0, 0,19.05\n45, 8.98026,0, 0,19.05\n45, 13.4704,0, 0,19.05\n")),N(O.ParsePatFile("\n*ANSI35,ANSI35\n45, 0,0, 0,6.35\n45, 4.49013,0, 0,6.35, 7.9375,-1.5875,0,-1.5875\n")),N(O.ParsePatFile("\n*ANSI36,ANSI36\n45, 0,0, 5.55625,3.175, 7.9375,-1.5875,0,-1.5875\n")),N(O.ParsePatFile("\n*ANSI37,ANSI37\n45, 0,0, 0,3.175\n135, 0,0, 0,3.175\n")),N(O.ParsePatFile("\n*ANSI38,ANSI38\n45, 0,0, 0,3.175\n135, 0,0, 6.35,3.175, 7.9375,-4.7625\n")),N(O.ParsePatFile("\n*AR-B816,AR-B816\n0, 0,0, 0,203.2\n90, 0,0, 203.2,203.2, 203.2,-203.2\n")),N(O.ParsePatFile("\n*AR-B816C,AR-B816C\n0, 0,0, 203.2,203.2, 396.875,-9.525\n0, -203.2,9.525, 203.2,203.2, 396.875,-9.525\n90, 0,0, 203.2,203.2, -212.725,193.675\n90, -9.525,0, 203.2,203.2, -212.725,193.675\n")),N(O.ParsePatFile("\n*AR-B88,AR-B88\n0, 0,0, 0,203.2\n90, 0,0, 203.2,101.6, 203.2,-203.2\n")),N(O.ParsePatFile("\n*AR-BRELM,AR-BRELM\n0, 0,0, 0,135.484, 193.675,-9.525\n0, 0,57.15, 0,135.484, 193.675,-9.525\n0, 50.8,67.7418, 0,135.484, 92.075,-9.525\n0, 50.8,124.892, 0,135.484, 92.075,-9.525\n90, 0,0, 0,203.2, 57.15,-78.3336\n90, -9.525,0, 0,203.2, 57.15,-78.3336\n90, 50.8,67.7418, 0,101.6, 57.15,-78.3336\n90, 41.275,67.7418, 0,101.6, 57.15,-78.3336\n")),N(O.ParsePatFile("\n*AR-BRSTD,AR-BRSTD\n0, 0,0, 0,67.7418\n90, 0,0, 67.7418,101.6, 67.7418,-67.7418\n")),N(O.ParsePatFile("\n*AR-CONC-01,AR-CONC-01\n;Optimize to replace existing AR-CONC Pattern\n;By John Hyslop, Using AutoCAD Lisp Tool\n;Developed in mm as metric QCAD3 pattern\n243.434949,7.62,20.32,227.18450626,113.5922544,5.67961272,-562.2816542\n90,7.62,15.24,0,254,5.08,-248.92\n0,5.08,15.24,0,254,2.54,-251.46\n315,2.54,2.54,179.60512212,179.60512212,3.59210356,-355.61814322\n206.565051,7.62,5.08,340.77676066,113.5922544,5.67961272,-562.2816542\n63.434949,5.08,0,227.18450626,113.5922544,5.67961272,-562.2816542\n45,50.8,10.16,179.60512212,179.60512212,7.18420458,-352.02603966\n161.565051,58.42,7.62,240.9655582,80.32185358,8.03218612,-795.18633952\n288.434949,55.88,15.24,562.25296744,80.32185358,8.03218612,-795.18633952\n315,58.42,22.86,179.60512212,179.60512212,3.59210356,-355.61814322\n206.565051,63.5,25.4,340.77676066,113.5922544,5.67961272,-562.2816542\n63.434949,60.96,20.32,227.18450626,113.5922544,5.67961272,-562.2816542\n270,104.14,15.24,0,254,5.08,-248.92\n45,99.06,10.16,179.60512212,179.60512212,7.18420458,-352.02603966\n180,104.14,10.16,0,254,5.08,-248.92\n333.434949,99.06,5.08,227.18450626,113.5922544,5.67961272,-562.2816542\n225,101.6,7.62,179.60512212,179.60512212,3.59210356,-355.61814322\n116.565051,104.14,2.54,340.77676066,113.5922544,5.67961272,-562.2816542\n198.434949,160.02,20.32,562.25296744,80.32185358,8.03218612,-795.18633952\n63.434949,157.48,15.24,227.18450626,113.5922544,5.67961272,-562.2816542\n333.434949,152.4,17.78,227.18450626,113.5922544,5.67961272,-562.2816542\n26.565051,144.78,0,340.77676066,113.5922544,5.67961272,-562.2816542\n251.565051,147.32,7.62,240.9655582,80.32185358,8.03218612,-795.18633952\n116.565051,149.86,2.54,340.77676066,113.5922544,5.67961272,-562.2816542\n45,170.18,2.54,179.60512212,179.60512212,7.18420458,-352.02603966\n161.565051,177.8,0,240.9655582,80.32185358,8.03218612,-795.18633952\n288.434949,175.26,7.62,562.25296744,80.32185358,8.03218612,-795.18633952\n315,76.2,71.12,179.60512212,179.60512212,3.59210356,-355.61814322\n206.565051,81.28,73.66,340.77676066,113.5922544,5.67961272,-562.2816542\n63.434949,78.74,68.58,227.18450626,113.5922544,5.67961272,-562.2816542\n45,27.94,20.32,179.60512212,179.60512212,7.18420458,-352.02603966\n180,33.02,20.32,0,254,5.08,-248.92\n270,33.02,25.4,0,254,5.08,-248.92\n225,45.72,60.96,179.60512212,179.60512212,3.59210356,-355.61814322\n270,45.72,66.04,0,254,5.08,-248.92\n71.565051,43.18,58.42,240.9655582,80.32185358,8.03218612,-795.18633952\n198.434949,25.4,53.34,562.25296744,80.32185358,8.03218612,-795.18633952\n63.434949,22.86,48.26,227.18450626,113.5922544,5.67961272,-562.2816542\n333.434949,17.78,50.8,227.18450626,113.5922544,5.67961272,-562.2816542\n0,88.9,55.88,0,254,5.08,-248.92\n225,93.98,60.96,179.60512212,179.60512212,7.18420458,-352.02603966\n90,93.98,55.88,0,254,5.08,-248.92\n315,114.3,43.18,179.60512212,179.60512212,3.59210356,-355.61814322\n206.565051,119.38,45.72,340.77676066,113.5922544,5.67961272,-562.2816542\n63.434949,116.84,40.64,227.18450626,113.5922544,5.67961272,-562.2816542\n315,139.7,53.34,179.60512212,179.60512212,3.59210356,-355.61814322\n270,139.7,58.42,0,254,5.08,-248.92\n108.434949,142.24,50.8,562.25296744,80.32185358,8.03218612,-795.18633952\n206.565051,175.26,68.58,340.77676066,113.5922544,5.67961272,-562.2816542\n63.434949,172.72,63.5,227.18450626,113.5922544,5.67961272,-562.2816542\n315,170.18,66.04,179.60512212,179.60512212,3.59210356,-355.61814322\n333.434949,185.42,48.26,227.18450626,113.5922544,5.67961272,-562.2816542\n225,187.96,50.8,179.60512212,179.60512212,3.59210356,-355.61814322\n116.565051,190.5,45.72,340.77676066,113.5922544,5.67961272,-562.2816542\n26.565051,208.28,38.1,340.77676066,113.5922544,5.67961272,-562.2816542\n153.434949,213.36,35.56,227.18450626,113.5922544,5.67961272,-562.2816542\n270,213.36,40.64,0,254,5.08,-248.92\n180,236.22,43.18,0,254,2.54,-251.46\n270,236.22,45.72,0,254,2.54,-251.46\n45,233.68,43.18,179.60512212,179.60512212,3.59210356,-355.61814322\n153.434949,236.22,60.96,227.18450626,113.5922544,5.67961272,-562.2816542\n270,236.22,68.58,0,254,7.62,-246.38\n45,231.14,63.5,179.60512212,179.60512212,7.18420458,-352.02603966\n206.565051,231.14,88.9,340.77676066,113.5922544,5.67961272,-562.2816542\n63.434949,228.6,83.82,227.18450626,113.5922544,5.67961272,-562.2816542\n315,226.06,86.36,179.60512212,179.60512212,3.59210356,-355.61814322\n180,165.1,73.66,0,254,5.08,-248.92\n270,165.1,81.28,0,254,7.62,-246.38\n56.309932,160.02,73.66,563.57539812,70.4469254,9.15809954,-906.65192304\n198.434949,137.16,96.52,562.25296744,80.32185358,8.03218612,-795.18633952\n71.565051,134.62,88.9,240.9655582,80.32185358,8.03218612,-795.18633952\n315,129.54,93.98,179.60512212,179.60512212,7.18420458,-352.02603966\n180,96.52,83.82,0,254,7.62,-246.38\n270,96.52,91.44,0,254,7.62,-246.38\n45,88.9,83.82,179.60512212,179.60512212,10.77630814,-348.43393864\n225,83.82,109.22,179.60512212,179.60512212,7.18420458,-352.02603966\n90,83.82,104.14,0,254,5.08,-248.92\n0,78.74,104.14,0,254,5.08,-248.92\n206.565051,40.64,99.06,340.77676066,113.5922544,5.67961272,-562.2816542\n63.434949,38.1,93.98,227.18450626,113.5922544,5.67961272,-562.2816542\n315,35.56,96.52,179.60512212,179.60512212,3.59210356,-355.61814322\n108.434949,25.4,93.98,562.25296744,80.32185358,8.03218612,-795.18633952\n341.565051,17.78,96.52,240.9655582,80.32185358,8.03218612,-795.18633952\n225,22.86,101.6,179.60512212,179.60512212,7.18420458,-352.02603966\n270,38.1,114.3,0,254,5.08,-248.92\n45,33.02,109.22,179.60512212,179.60512212,7.18420458,-352.02603966\n180,38.1,109.22,0,254,5.08,-248.92\n315,91.44,119.38,179.60512212,179.60512212,3.59210356,-355.61814322\n206.565051,96.52,121.92,340.77676066,113.5922544,5.67961272,-562.2816542\n63.434949,93.98,116.84,227.18450626,113.5922544,5.67961272,-562.2816542\n0,129.54,101.6,0,254,2.54,-251.46\n225,132.08,104.14,179.60512212,179.60512212,3.59210356,-355.61814322\n90,132.08,101.6,0,254,2.54,-251.46\n0,175.26,96.52,0,254,5.08,-248.92\n243.434949,177.8,101.6,227.18450626,113.5922544,5.67961272,-562.2816542\n116.565051,180.34,96.52,340.77676066,113.5922544,5.67961272,-562.2816542\n26.565051,185.42,114.3,340.77676066,113.5922544,5.67961272,-562.2816542\n116.565051,187.96,109.22,340.77676066,113.5922544,5.67961272,-562.2816542\n251.565051,190.5,116.84,240.9655582,80.32185358,8.03218612,-795.18633952\n63.434949,223.52,91.44,227.18450626,113.5922544,5.67961272,-562.2816542\n180,228.6,91.44,0,254,5.08,-248.92\n296.565051,226.06,96.52,340.77676066,113.5922544,5.67961272,-562.2816542\n180,228.6,137.16,0,254,7.62,-246.38\n270,228.6,144.78,0,254,7.62,-246.38\n45,220.98,137.16,179.60512212,179.60512212,10.77630814,-348.43393864\n180,218.44,142.24,0,254,5.08,-248.92\n270,218.44,147.32,0,254,5.08,-248.92\n45,213.36,142.24,179.60512212,179.60512212,7.18420458,-352.02603966\n243.434949,208.28,165.1,227.18450626,113.5922544,5.67961272,-562.2816542\n26.565051,203.2,162.56,340.77676066,113.5922544,5.67961272,-562.2816542\n135,205.74,160.02,179.60512212,179.60512212,3.59210356,-355.61814322\n243.434949,170.18,152.4,227.18450626,113.5922544,5.67961272,-562.2816542\n116.565051,172.72,147.32,340.77676066,113.5922544,5.67961272,-562.2816542\n0,167.64,147.32,0,254,5.08,-248.92\n225,157.48,154.94,179.60512212,179.60512212,7.18420458,-352.02603966\n108.434949,160.02,147.32,562.25296744,80.32185358,8.03218612,-795.18633952\n341.565051,152.4,149.86,240.9655582,80.32185358,8.03218612,-795.18633952\n135,149.86,137.16,179.60512212,179.60512212,3.59210356,-355.61814322\n243.434949,152.4,142.24,227.18450626,113.5922544,5.67961272,-562.2816542\n26.565051,147.32,139.7,340.77676066,113.5922544,5.67961272,-562.2816542\n180,121.92,152.4,0,254,2.54,-251.46\n270,121.92,154.94,0,254,2.54,-251.46\n45,119.38,152.4,179.60512212,179.60512212,3.59210356,-355.61814322\n206.565051,111.76,170.18,340.77676066,113.5922544,5.67961272,-562.2816542\n63.434949,109.22,165.1,227.18450626,113.5922544,5.67961272,-562.2816542\n315,106.68,167.64,179.60512212,179.60512212,3.59210356,-355.61814322\n225,86.36,165.1,179.60512212,179.60512212,7.18420458,-352.02603966\n90,86.36,157.48,0,254,7.62,-246.38\n333.434949,81.28,160.02,227.18450626,113.5922544,5.67961272,-562.2816542\n180,76.2,154.94,0,254,5.08,-248.92\n270,76.2,160.02,0,254,5.08,-248.92\n45,71.12,154.94,179.60512212,179.60512212,7.18420458,-352.02603966\n135,53.34,142.24,179.60512212,179.60512212,3.59210356,-355.61814322\n243.434949,55.88,147.32,227.18450626,113.5922544,5.67961272,-562.2816542\n26.565051,50.8,144.78,340.77676066,113.5922544,5.67961272,-562.2816542\n180,27.94,160.02,0,254,5.08,-248.92\n270,27.94,165.1,0,254,5.08,-248.92\n45,22.86,160.02,179.60512212,179.60512212,7.18420458,-352.02603966\n270,15.24,177.8,0,254,7.62,-246.38\n45,10.16,172.72,179.60512212,179.60512212,7.18420458,-352.02603966\n153.434949,15.24,170.18,227.18450626,113.5922544,5.67961272,-562.2816542\n243.434949,208.28,198.12,227.18450626,113.5922544,5.67961272,-562.2816542\n90,208.28,193.04,0,254,5.08,-248.92\n0,205.74,193.04,0,254,2.54,-251.46\n135,220.98,208.28,179.60512212,179.60512212,3.59210356,-355.61814322\n243.434949,223.52,213.36,227.18450626,113.5922544,5.67961272,-562.2816542\n26.565051,218.44,210.82,340.77676066,113.5922544,5.67961272,-562.2816542\n180,218.44,213.36,0,254,5.08,-248.92\n251.565051,220.98,220.98,240.9655582,80.32185358,8.03218612,-795.18633952\n45,213.36,213.36,179.60512212,179.60512212,10.77630814,-348.43393864\n153.434949,182.88,233.68,227.18450626,113.5922544,5.67961272,-562.2816542\n135,165.1,185.42,179.60512212,179.60512212,3.59210356,-355.61814322\n243.434949,167.64,190.5,227.18450626,113.5922544,5.67961272,-562.2816542\n26.565051,162.56,187.96,340.77676066,113.5922544,5.67961272,-562.2816542\n135,160.02,195.58,179.60512212,179.60512212,3.59210356,-355.61814322\n251.565051,162.56,203.2,240.9655582,80.32185358,8.03218612,-795.18633952\n45,157.48,198.12,179.60512212,179.60512212,7.18420458,-352.02603966\n26.565051,66.04,193.04,340.77676066,113.5922544,5.67961272,-562.2816542\n153.434949,71.12,190.5,227.18450626,113.5922544,5.67961272,-562.2816542\n270,71.12,195.58,0,254,5.08,-248.92\n90,114.3,200.66,0,254,5.08,-248.92\n0,109.22,200.66,0,254,5.08,-248.92\n225,114.3,205.74,179.60512212,179.60512212,7.18420458,-352.02603966\n63.434949,124.46,210.82,227.18450626,113.5922544,5.67961272,-562.2816542\n315,121.92,213.36,179.60512212,179.60512212,3.59210356,-355.61814322\n206.565051,127,215.9,340.77676066,113.5922544,5.67961272,-562.2816542\n153.434949,147.32,223.52,227.18450626,113.5922544,5.67961272,-562.2816542\n270,147.32,231.14,0,254,7.62,-246.38\n45,142.24,226.06,179.60512212,179.60512212,7.18420458,-352.02603966\n0,71.12,236.22,0,254,7.62,-246.38\n135,66.04,203.2,179.60512212,179.60512212,3.59210356,-355.61814322\n270,66.04,208.28,0,254,5.08,-248.92\n45,63.5,205.74,179.60512212,179.60512212,3.59210356,-355.61814322\n116.565051,20.32,208.28,340.77676066,113.5922544,5.67961272,-562.2816542\n333.434949,15.24,210.82,227.18450626,113.5922544,5.67961272,-562.2816542\n225,17.78,213.36,179.60512212,179.60512212,3.59210356,-355.61814322\n135,30.48,218.44,179.60512212,179.60512212,3.59210356,-355.61814322\n243.434949,33.02,223.52,227.18450626,113.5922544,5.67961272,-562.2816542\n26.565051,27.94,220.98,340.77676066,113.5922544,5.67961272,-562.2816542\n0,222.21825,218.170506,0,254,0,-254\n0,206.330804,232.72877,0,254,0,-254\n0,208.872836,188.32957,0,254,0,-254\n0,183.55056,211.532978,0,254,0,-254\n0,167.663114,226.091242,0,254,0,-254\n0,222.022924,134.20979,0,254,0,-254\n0,206.135224,148.768054,0,254,0,-254\n0,170.205146,181.692042,0,254,0,-254\n0,144.88287,204.895704,0,254,0,-254\n0,128.99517,219.453968,0,254,0,-254\n0,208.677256,104.368854,0,254,0,-254\n0,183.35498,127.572516,0,254,0,-254\n0,167.467534,142.13078,0,254,0,-254\n0,131.537202,175.054768,0,254,0,-254\n0,106.214926,198.258176,0,254,0,-254\n0,90.32748,212.81644,0,254,0,-254\n0,221.827344,50.249328,0,254,0,-254\n0,205.939898,64.807592,0,254,0,-254\n0,170.009566,97.73158,0,254,0,-254\n0,144.68729,120.934988,0,254,0,-254\n0,128.799844,135.493252,0,254,0,-254\n0,92.869512,168.41724,0,254,0,-254\n0,67.547236,191.620902,0,254,0,-254\n0,51.65979,206.179166,0,254,0,-254\n0,208.48193,20.408392,0,254,0,-254\n0,183.159654,43.6118,0,254,0,-254\n0,167.271954,58.170064,0,254,0,-254\n0,131.341876,91.094052,0,254,0,-254\n0,106.0196,114.297714,0,254,0,-254\n0,90.1319,128.855978,0,254,0,-254\n0,54.201822,161.779966,0,254,0,-254\n0,28.879546,184.983628,0,254,0,-254\n0,12.991846,199.541638,0,254,0,-254\n0,169.813986,13.770864,0,254,0,-254\n0,144.49171,36.974526,0,254,0,-254\n0,128.604264,51.53279,0,254,0,-254\n0,89.821004,81.952846,0,254,0,-254\n0,67.351656,107.660186,0,254,0,-254\n0,51.46421,122.21845,0,254,0,-254\n0,15.533878,155.142438,0,254,0,-254\n0,131.146296,7.13359,0,254,0,-254\n0,105.82402,30.336998,0,254,0,-254\n0,89.936574,44.895262,0,254,0,-254\n0,54.006242,77.81925,0,254,0,-254\n0,28.683966,101.022912,0,254,0,-254\n0,12.79652,115.581176,0,254,0,-254\n0,92.478606,0.496062,0,254,0,-254\n0,67.15633,23.699724,0,254,0,-254\n0,51.26863,38.257988,0,254,0,-254\n0,15.338552,71.181976,0,254,0,-254\n0,28.488386,17.062196,0,254,0,-254\n0,12.60094,31.62046,0,254,0,-254\n0,232.573576,212.125814,0,254,0,-254\n0,211.15909,204.714856,0,254,0,-254\n0,197.17893,213.621112,0,254,0,-254\n0,219.38234,178.422554,0,254,0,-254\n0,175.76419,206.210408,0,254,0,-254\n0,161.78403,215.116664,0,254,0,-254\n0,183.98744,179.918106,0,254,0,-254\n0,140.369544,207.705706,0,254,0,-254\n0,126.389384,216.612216,0,254,0,-254\n0,220.450664,135.634984,0,254,0,-254\n0,206.470504,144.541494,0,254,0,-254\n0,148.592794,181.413658,0,254,0,-254\n0,104.974898,209.201258,0,254,0,-254\n0,90.994738,218.107514,0,254,0,-254\n0,228.673914,109.342936,0,254,0,-254\n0,185.055764,137.130536,0,254,0,-254\n0,171.075858,146.036792,0,254,0,-254\n0,113.198148,182.908956,0,254,0,-254\n0,69.579998,210.69681,0,254,0,-254\n0,55.599838,219.603066,0,254,0,-254\n0,193.279268,110.838234,0,254,0,-254\n0,149.661118,138.626088,0,254,0,-254\n0,135.680958,147.532344,0,254,0,-254\n0,77.803248,184.404508,0,254,0,-254\n0,34.185352,212.192362,0,254,0,-254\n0,20.205192,221.098618,0,254,0,-254\n0,229.742238,66.555366,0,254,0,-254\n0,215.762078,75.461622,0,254,0,-254\n0,157.884368,112.333786,0,254,0,-254\n0,114.266472,140.12164,0,254,0,-254\n0,100.286312,149.027896,0,254,0,-254\n0,42.408602,185.90006,0,254,0,-254\n0,237.965488,40.263064,0,254,0,-254\n0,194.347592,68.050918,0,254,0,-254\n0,180.367432,76.957174,0,254,0,-254\n0,122.489722,113.829338,0,254,0,-254\n0,78.871572,141.616938,0,254,0,-254\n0,64.891666,150.523448,0,254,0,-254\n0,7.013702,187.395612,0,254,0,-254\n0,202.570842,41.758616,0,254,0,-254\n0,158.952692,69.546216,0,254,0,-254\n0,144.972532,78.452726,0,254,0,-254\n0,87.094822,115.32489,0,254,0,-254\n0,43.476926,143.11249,0,254,0,-254\n0,29.496766,152.018746,0,254,0,-254\n0,225.053652,6.38175,0,254,0,-254\n0,167.175942,43.254168,0,254,0,-254\n0,123.558046,71.041768,0,254,0,-254\n0,109.577886,79.948024,0,254,0,-254\n0,51.700176,116.820188,0,254,0,-254\n0,8.08228,144.608042,0,254,0,-254\n0,189.659006,7.877302,0,254,0,-254\n0,131.781296,44.749466,0,254,0,-254\n0,88.1634,72.53732,0,254,0,-254\n0,74.18324,81.443576,0,254,0,-254\n0,16.30553,118.31574,0,254,0,-254\n0,168.24452,0.466598,0,254,0,-254\n0,154.26436,9.372854,0,254,0,-254\n0,96.38665,46.245018,0,254,0,-254\n0,52.7685,74.032872,0,254,0,-254\n0,38.78834,82.939128,0,254,0,-254\n0,132.84962,1.961896,0,254,0,-254\n0,118.86946,10.868406,0,254,0,-254\n0,60.99175,47.74057,0,254,0,-254\n0,17.373854,75.52817,0,254,0,-254\n0,3.393694,84.43468,0,254,0,-254\n0,97.454974,3.457448,0,254,0,-254\n0,83.474814,12.363704,0,254,0,-254\n0,25.597104,49.235868,0,254,0,-254\n0,62.060074,4.953,0,254,0,-254\n0,48.080168,13.859256,0,254,0,-254\n0,26.665428,6.448552,0,254,0,-254\n0,12.685268,15.354808,0,254,0,-254\n0,163.20897,236.374178,0,254,0,-254\n0,121.33453,230.861362,0,254,0,-254\n0,96.22282,227.555298,0,254,0,-254\n0,79.624174,225.370136,0,254,0,-254\n0,37.749734,219.85732,0,254,0,-254\n0,12.638278,216.551256,0,254,0,-254\n0,229.351078,221.227142,0,254,0,-254\n0,187.476638,215.714326,0,254,0,-254\n0,162.364928,212.408262,0,254,0,-254\n0,145.766282,210.2231,0,254,0,-254\n0,103.891842,204.710284,0,254,0,-254\n0,78.780132,201.40422,0,254,0,-254\n0,62.18174,199.219058,0,254,0,-254\n0,20.307046,193.705988,0,254,0,-254\n0,228.507036,197.261226,0,254,0,-254\n0,211.90839,195.076064,0,254,0,-254\n0,170.03395,189.563248,0,254,0,-254\n0,144.92224,186.257184,0,254,0,-254\n0,128.323594,184.071768,0,254,0,-254\n0,86.449154,178.558952,0,254,0,-254\n0,61.337698,175.252888,0,254,0,-254\n0,44.739052,173.067726,0,254,0,-254\n0,2.864358,167.55491,0,254,0,-254\n0,236.176058,174.415958,0,254,0,-254\n0,211.064348,171.110148,0,254,0,-254\n0,194.465702,168.924732,0,254,0,-254\n0,152.591262,163.411916,0,254,0,-254\n0,127.479552,160.105852,0,254,0,-254\n0,110.88116,157.92069,0,254,0,-254\n0,69.006466,152.407874,0,254,0,-254\n0,43.89501,149.10181,0,254,0,-254\n0,27.296364,146.916648,0,254,0,-254\n0,218.73337,148.26488,0,254,0,-254\n0,193.62166,144.958816,0,254,0,-254\n0,177.023014,142.773654,0,254,0,-254\n0,135.148574,137.260838,0,254,0,-254\n0,110.037118,133.954774,0,254,0,-254\n0,93.438472,131.769358,0,254,0,-254\n0,51.563778,126.256542,0,254,0,-254\n0,26.452322,122.950478,0,254,0,-254\n0,9.853676,120.765316,0,254,0,-254\n0,201.290682,122.113548,0,254,0,-254\n0,176.178972,118.807738,0,254,0,-254\n0,159.58058,116.622322,0,254,0,-254\n0,117.705886,111.109506,0,254,0,-254\n0,92.59443,107.803442,0,254,0,-254\n0,75.995784,105.61828,0,254,0,-254\n0,34.121344,100.105464,0,254,0,-254\n0,9.009634,96.7994,0,254,0,-254\n0,225.722434,101.475286,0,254,0,-254\n0,183.847994,95.96247,0,254,0,-254\n0,158.736538,92.656406,0,254,0,-254\n0,142.137892,90.471244,0,254,0,-254\n0,100.263198,84.958428,0,254,0,-254\n0,75.151742,81.652364,0,254,0,-254\n0,58.553096,79.466948,0,254,0,-254\n0,16.678656,73.954132,0,254,0,-254\n0,224.878392,77.50937,0,254,0,-254\n0,208.279746,75.324208,0,254,0,-254\n0,166.405306,69.811138,0,254,0,-254\n0,141.29385,66.505328,0,254,0,-254\n0,124.695204,64.319912,0,254,0,-254\n0,82.82051,58.807096,0,254,0,-254\n0,57.709054,55.501032,0,254,0,-254\n0,41.110408,53.31587,0,254,0,-254\n0,232.547414,54.664102,0,254,0,-254\n0,207.435704,51.358038,0,254,0,-254\n0,190.837312,49.172876,0,254,0,-254\n0,148.962618,43.66006,0,254,0,-254\n0,123.851162,40.353996,0,254,0,-254\n0,107.252516,38.168834,0,254,0,-254\n0,65.378076,32.656018,0,254,0,-254\n0,40.266366,29.349954,0,254,0,-254\n0,23.66772,27.164538,0,254,0,-254\n0,215.104726,28.513024,0,254,0,-254\n0,189.99327,25.20696,0,254,0,-254\n0,173.394624,23.021798,0,254,0,-254\n0,131.51993,17.508728,0,254,0,-254\n0,106.408474,14.202918,0,254,0,-254\n0,89.809828,12.017502,0,254,0,-254\n0,47.935388,6.504686,0,254,0,-254\n0,22.823678,3.198622,0,254,0,-254\n0,6.225032,1.01346,0,254,0,-254\n0,197.662038,2.361692,0,254,0,-254\n0,31.866332,226.2124,0,254,0,-254\n0,65.909444,230.88092,0,254,0,-254\n0,31.060136,204.140054,0,254,0,-254\n0,99.400106,235.125768,0,254,0,-254\n0,65.103248,208.808574,0,254,0,-254\n0,30.253686,182.067962,0,254,0,-254\n0,98.59391,213.053422,0,254,0,-254\n0,64.296798,186.736482,0,254,0,-254\n0,29.44749,159.995616,0,254,0,-254\n0,133.031484,218.02471,0,254,0,-254\n0,97.787714,190.981076,0,254,0,-254\n0,63.490602,164.664136,0,254,0,-254\n0,28.641294,137.92327,0,254,0,-254\n0,167.074596,222.69323,0,254,0,-254\n0,132.225288,195.952364,0,254,0,-254\n0,96.981264,168.90873,0,254,0,-254\n0,62.684406,142.59179,0,254,0,-254\n0,27.835098,115.850924,0,254,0,-254\n0,200.565258,226.937824,0,254,0,-254\n0,166.2684,200.620884,0,254,0,-254\n0,131.419092,173.880018,0,254,0,-254\n0,96.175068,146.836384,0,254,0,-254\n0,61.87821,120.519444,0,254,0,-254\n0,27.028902,93.778578,0,254,0,-254\n0,235.002832,231.909112,0,254,0,-254\n0,199.759062,204.865478,0,254,0,-254\n0,165.46195,178.548538,0,254,0,-254\n0,130.612642,151.807672,0,254,0,-254\n0,95.368872,124.764292,0,254,0,-254\n0,61.07176,98.447098,0,254,0,-254\n0,26.222452,71.706232,0,254,0,-254\n0,234.196636,209.836766,0,254,0,-254\n0,198.952866,182.793386,0,254,0,-254\n0,164.655754,156.476192,0,254,0,-254\n0,129.806446,129.735326,0,254,0,-254\n0,94.562676,102.691946,0,254,0,-254\n0,60.265564,76.374752,0,254,0,-254\n0,25.416256,49.63414,0,254,0,-254\n0,233.39044,187.76442,0,254,0,-254\n0,198.14667,160.72104,0,254,0,-254\n0,163.849558,134.403846,0,254,0,-254\n0,129.00025,107.663234,0,254,0,-254\n0,93.75648,80.6196,0,254,0,-254\n0,59.459368,54.30266,0,254,0,-254\n0,24.61006,27.561794,0,254,0,-254\n0,232.584244,165.692328,0,254,0,-254\n0,197.34022,138.648694,0,254,0,-254\n0,163.043362,112.331754,0,254,0,-254\n0,128.194054,85.590888,0,254,0,-254\n0,58.653172,32.230314,0,254,0,-254\n0,23.803864,5.489448,0,254,0,-254\n0,231.777794,143.619982,0,254,0,-254\n0,196.534024,116.576348,0,254,0,-254\n0,162.237166,90.259408,0,254,0,-254\n0,127.387858,63.518542,0,254,0,-254\n0,92.143834,36.474908,0,254,0,-254\n0,57.846976,10.157968,0,254,0,-254\n0,230.971598,121.547636,0,254,0,-254\n0,195.727828,94.504002,0,254,0,-254\n0,161.430716,68.187062,0,254,0,-254\n0,126.581408,41.446196,0,254,0,-254\n0,91.337638,14.402562,0,254,0,-254\n0,230.165402,99.47529,0,254,0,-254\n0,194.921632,72.431656,0,254,0,-254\n0,160.62452,46.114716,0,254,0,-254\n0,125.775212,19.37385,0,254,0,-254\n0,229.359206,77.402944,0,254,0,-254\n0,194.115436,50.359564,0,254,0,-254\n0,159.818324,24.04237,0,254,0,-254\n0,228.55301,55.330598,0,254,0,-254\n0,193.308986,28.287218,0,254,0,-254\n0,159.012128,1.970024,0,254,0,-254\n0,227.74656,33.258506,0,254,0,-254\n0,192.50279,6.214872,0,254,0,-254\n0,226.940364,11.18616,0,254,0,-254\n206.565051,254,15.24,340.77676066,113.5922544,5.67961272,-562.2816542\n63.434949,251.46,10.16,227.18450626,113.5922544,5.67961272,-562.2816542\n315,248.92,12.7,179.60512212,179.60512212,3.59210356,-355.61814322\n206.565051,246.38,137.16,340.77676066,113.5922544,5.67961272,-562.2816542\n63.434949,243.84,132.08,227.18450626,113.5922544,5.67961272,-562.2816542\n315,241.3,134.62,179.60512212,179.60512212,3.59210356,-355.61814322\n153.434949,254,182.88,227.18450626,113.5922544,5.67961272,-562.2816542\n288.434949,251.46,190.5,562.25296744,80.32185358,8.03218612,-795.18633952\n63.434949,248.92,185.42,227.18450626,113.5922544,5.67961272,-562.2816542\n135,246.38,236.22,179.60512212,179.60512212,3.59210356,-355.61814322\n270,246.38,241.3,0,254,5.08,-248.92\n45,243.84,238.76,179.60512212,179.60512212,3.59210356,-355.61814322\n0,195.58,243.84,0,254,5.08,-248.92\n270,182.88,238.76,0,254,5.08,-248.92\n26.565051,177.8,236.22,340.77676066,113.5922544,5.67961272,-562.2816542\n0,241.457734,241.2111,0,254,0,-254\n0,247.540526,194.966844,0,254,0,-254\n0,244.803168,155.405582,0,254,0,-254\n0,247.3452,111.006382,0,254,0,-254\n0,244.607588,71.444866,0,254,0,-254\n0,247.14962,27.045666,0,254,0,-254\n0,246.553736,203.219304,0,254,0,-254\n0,241.86515,143.045942,0,254,0,-254\n0,251.156978,73.96607,0,254,0,-254\n0,204.919072,241.865658,0,254,0,-254\n0,179.807616,238.559594,0,254,0,-254\n0,245.949724,223.412558,0,254,0,-254\n0,253.618492,200.56729,0,254,0,-254\n0,243.165122,127.626618,0,254,0,-254\n0,242.32108,103.660448,0,254,0,-254\n0,249.990102,80.815434,0,254,0,-254\n0,239.536732,7.874762,0,254,0,-254\n243.434949,198.12,248.92,227.18450626,113.5922544,5.67961272,-562.2816542\n116.565051,200.66,243.84,340.77676066,113.5922544,5.67961272,-562.2816542\n180,152.4,246.38,0,254,5.08,-248.92\n270,152.4,251.46,0,254,5.08,-248.92\n45,147.32,246.38,179.60512212,179.60512212,7.18420458,-352.02603966\n296.565051,104.14,254,340.77676066,113.5922544,5.67961272,-562.2816542\n63.434949,101.6,248.92,227.18450626,113.5922544,5.67961272,-562.2816542\n180,106.68,248.92,0,254,5.08,-248.92\n135,86.36,238.76,179.60512212,179.60512212,3.59210356,-355.61814322\n243.434949,88.9,243.84,227.18450626,113.5922544,5.67961272,-562.2816542\n26.565051,83.82,241.3,340.77676066,113.5922544,5.67961272,-562.2816542\n116.565051,78.74,236.22,340.77676066,113.5922544,5.67961272,-562.2816542\n225,76.2,241.3,179.60512212,179.60512212,7.18420458,-352.02603966\n45,0,246.38,179.60512212,179.60512212,7.18420458,-352.02603966\n161.565051,7.62,243.84,240.9655582,80.32185358,8.03218612,-795.18633952\n288.434949,5.08,251.46,562.25296744,80.32185358,8.03218612,-795.18633952\n0,93.065092,252.377956,0,254,0,-254\n0,54.397148,245.740428,0,254,0,-254\n0,15.729458,239.103154,0,254,0,-254\n0,174.695866,248.997978,0,254,0,-254\n0,139.30122,250.493276,0,254,0,-254\n0,68.511674,253.48438,0,254,0,-254\n0,113.665508,253.70663,0,254,0,-254\n0,97.066862,251.521468,0,254,0,-254\n0,55.192422,246.008398,0,254,0,-254\n0,30.080966,242.702588,0,254,0,-254\n0,13.48232,240.517172,0,254,0,-254\n0,32.672528,248.284746,0,254,0,-254\n0,66.71564,252.953266,0,254,0,-254\n0,133.83768,240.097056,0,254,0,-254\n0,167.880792,244.765576,0,254,0,-254\n0,201.371454,249.01017,0,254,0,-254\n0,245.485412,246.006874,0,254,0,-254\n0,210.090512,247.502426,0,254,0,-254\n0,246.793766,247.378474,0,254,0,-254\n0,235.809282,253.981458,0,254,0,-254\n")),N(O.ParsePatFile("\n*AR-CONC,AR-CONC\n50, 0,0, 104.896,-149.807, 19.05,-209.55\n355, 0,0, -51.7604,187.258, 15.24,-167.64\n100.451, 15.182,-1.32825, 145.557,-176.27, 16.19,-178.09\n46.1842, 0,50.8, 157.343,-224.71, 28.575,-314.325\n96.6356, 22.5899,47.2965, 218.335,-264.405, 24.285,-267.135\n351.184, 0,50.8, 196.679,280.887, 22.86,-251.46\n21, 25.4,38.1, 104.896,-149.807, 19.05,-209.55\n326, 25.4,38.1, -51.7604,187.258, 15.24,-167.64\n71.4514, 38.0345,29.5779, 145.557,-176.27, 16.19,-178.09\n37.5, 0,0, 53.9242,65.2018, 0,-165.608,0,-170.18,0,-168.275\n7.5, 0,0, 79.3242,90.6018, 0,-97.028,0,-161.798,0,-64.135\n-32.5, -56.642,0, 117.434,68.0212, 0,-63.5,0,-198.12,0,-262.89\n-42.5, -82.042,0, 92.0344,118.821, 0,-82.55,0,-131.572,0,-186.69\n")),N(O.ParsePatFile("\n*AR-HBONE,AR-HBONE\n45, 0,0, 101.6,101.6, 304.8,-101.6\n135, 71.842,71.842, 101.6,-101.6, 304.8,-101.6\n")),N(O.ParsePatFile("\n*AR-PARQ1,AR-PARQ1\n90, 0,0, 304.8,304.8, 304.8,-304.8\n90, 50.8,0, 304.8,304.8, 304.8,-304.8\n90, 101.6,0, 304.8,304.8, 304.8,-304.8\n90, 152.4,0, 304.8,304.8, 304.8,-304.8\n90, 203.2,0, 304.8,304.8, 304.8,-304.8\n90, 254,0, 304.8,304.8, 304.8,-304.8\n90, 304.8,0, 304.8,304.8, 304.8,-304.8\n0, 0,304.8, 304.8,-304.8, 304.8,-304.8\n0, 0,355.6, 304.8,-304.8, 304.8,-304.8\n0, 0,406.4, 304.8,-304.8, 304.8,-304.8\n0, 0,457.2, 304.8,-304.8, 304.8,-304.8\n0, 0,508, 304.8,-304.8, 304.8,-304.8\n0, 0,558.8, 304.8,-304.8, 304.8,-304.8\n0, 0,609.6, 304.8,-304.8, 304.8,-304.8\n")),N(O.ParsePatFile("\n*AR-RROOF,AR-RROOF\n0, 0,0, 55.88,25.4, 381,-50.8,127,-25.4\n0, 33.782,12.7, -25.4,33.782, 76.2,-8.382,152.4,-19.05\n0, 12.7,21.59, 132.08,17.018, 203.2,-35.56,101.6,-25.4\n")),N(O.ParsePatFile("\n*AR-RSHKE,AR-RSHKE\n0, 0,0, 647.7,304.8, 152.4,-127,177.8,-76.2,228.6,-101.6\n0, 152.4,12.7, 647.7,304.8, 127,-482.6,101.6,-152.4\n0, 457.2,-19.05, 647.7,304.8, 76.2,-787.4\n90, 0,0, 304.8,215.9, 292.1,-927.1\n90, 152.4,0, 304.8,215.9, 285.75,-933.45\n90, 279.4,0, 304.8,215.9, 266.7,-952.5\n90, 457.2,-19.05, 304.8,215.9, 292.1,-927.1\n90, 533.4,-19.05, 304.8,215.9, 292.1,-927.1\n90, 762,0, 304.8,215.9, 279.4,-939.8\n")),N(O.ParsePatFile("\n*AR-SAND,AR-SAND\n37.5, 0,0, 28.5242,39.8018, 0,-38.608,0,-43.18,0,-41.275\n7.5, 0,0, 53.9242,65.2018, 0,-20.828,0,-34.798,0,-13.335\n-32.5, -31.242,0, 66.6344,42.6212, 0,-12.7,0,-45.72,0,-59.69\n-42.5, -31.242,0, 41.2344,68.0212, 0,-6.35,0,-29.972,0,-34.29\n")),N(O.ParsePatFile("\n*BARBWIRE,BARBWIRE\n;By John Hyslop\n;Developed in mm as metric QCAD3 pattern\n315,7.62,14.224,17.960512212,17.960512212,0.359210356,-35.561814322\n288.434949,6.604,17.272,56.225296744,8.032185358,3.212874194,-77.10897837\n158.198591,7.874,16.764,80.18324705,4.716661636,1.36783191,-135.415354264\n116.565051,8.128,16.256,34.077676066,11.35922544,0.567961272,-56.22816542\n116.565051,8.636,15.24,34.077676066,11.35922544,1.135922544,-55.660204148\n111.801409,11.176,9.906,56.599939124,4.716661636,1.36783191,-135.415354264\n156.801409,12.954,9.144,136.74251925,3.335183322,1.934406342,-191.506230398\n289.653824,11.684,12.7,297.294468148,1.708588912,3.775981526,-373.822164724\n194.036243,7.874,9.144,80.085263502,6.160405002,1.047268924,-103.679614078\n251.565051,8.128,9.906,24.09655582,8.032185358,0.803218612,-79.518633952\n254.054604,8.636,11.684,104.668749768,3.488958224,1.84914794,-183.065643266\n74.744881,8.636,11.684,104.703186326,2.22772732,2.896045516,-286.708512434\n135,9.144,11.176,17.960512212,17.960512212,0.718420458,-35.202603966\n180,9.906,11.176,0,25.4,0.762,-24.638\n270,9.906,11.43,0,25.4,0.254,-25.146\n74.054604,9.906,11.43,104.668749768,3.488958224,3.69829588,-181.216495326\n161.565051,10.668,11.176,24.09655582,8.032185358,0.803218612,-79.518633952\n198.434949,11.43,11.43,56.225296744,8.032185358,0.803218612,-79.518633952\n258.231711,12.7,17.526,129.51095129,1.03608759,6.226886454,-616.461767582\n21.801409,11.43,17.018,56.599939124,4.716661636,1.36783191,-135.415354264\n75.963757,10.922,14.986,24.6416195,6.160405002,2.094537594,-102.632345154\n341.565051,10.16,15.24,24.09655582,8.032185358,0.803218612,-79.518633952\n45,9.398,14.478,17.960512212,17.960512212,1.077630814,-34.843393864\n288.434949,9.144,15.24,56.225296744,8.032185358,0.803218612,-79.518633952\n0,8.636,15.24,0,25.4,0.508,-24.892\n26.565051,8.128,14.986,34.077676066,11.35922544,0.567961272,-56.22816542\n78.231711,6.858,8.89,129.51095129,1.03608759,6.226886454,-616.461767582\n4.085617,19.812,12.192,331.17053781,1.80967507,3.565059926,-352.940928864\n0,17.526,12.192,0,25.4,2.286,-23.114\n354.289407,14.986,12.446,25.273944626,2.527394488,2.552668504,-252.714172244\n356.185925,11.938,13.97,25.343743064,1.689582854,3.818457184,-378.027270614\n351.469234,20.32,13.97,179.600730968,1.255949228,5.136831992,-508.546377622\n0,16.764,13.97,0,25.4,3.556,-21.844\n14.036243,11.684,12.7,80.085263502,6.160405002,5.236344112,-99.490538636\n189.865807,17.78,12.954,438.470633344,1.088016366,5.92968969,-587.039280834\n180,20.32,12.954,0,25.4,2.54,-22.86\n171.469234,25.4,12.192,179.600730968,1.255949228,5.136831992,-508.546377622\n186.115504,25.4,14.224,230.005013954,0.901980416,3.973724844,-711.296769428\n5.52754,3.499555612,13.546666582,255.265537982,0.815544724,4.394880466,-786.683623734\n3.691386,0,12.192,381.844852514,0.817654956,3.84896106,-785.188047096\n348.310631,0,13.208,129.51225558,0.85769704,7.522003244,-744.678315822\n348.690068,0,14.224,24.906749272,4.981349956,7.770905718,-121.744189836\n")),N(O.ParsePatFile("\n*BLOCKS-01\n;By John Hyslop, Tile2Hatch tool \xa9 CVH 2020\n;Developed in mm as metric QCAD3 pattern\n270,7.874,16.764,25.4,25.4,5.588,-19.812\n180,2.032,2.286,0,25.4,14.478,-10.922\n270,2.032,2.286,25.4,25.4,5.334,-20.066\n180,2.032,22.352,0,25.4,14.478,-10.922\n270,12.954,2.286,25.4,25.4,5.334,-20.066\n270,22.606,8.128,25.4,25.4,5.08,-20.32\n0,12.446,8.128,0,25.4,10.16,-15.24\n90,12.446,3.048,25.4,25.4,5.08,-20.32\n180,22.606,3.048,0,25.4,10.16,-15.24\n270,17.526,21.336,25.4,25.4,12.192,-13.208\n0,12.192,21.336,0,25.4,5.334,-20.066\n90,12.192,9.144,25.4,25.4,12.192,-13.208\n180,17.526,9.144,0,25.4,5.334,-20.066\n270,3.048,0.762,25.4,25.4,8.382,-17.018\n0,3.048,17.78,0,25.4,8.128,-17.272\n270,11.176,0.762,25.4,25.4,8.382,-17.018\n0,3.048,0.762,0,25.4,8.128,-17.272\n270,11.43,17.018,25.4,25.4,6.096,-19.304\n0,9.144,17.018,0,25.4,2.286,-23.114\n90,9.144,10.922,25.4,25.4,6.096,-19.304\n180,11.43,10.922,0,25.4,2.286,-23.114\n270,11.43,10.16,25.4,25.4,8.382,-17.018\n0,2.794,10.16,0,25.4,8.636,-16.764\n90,2.794,1.778,25.4,25.4,8.382,-17.018\n180,11.43,1.778,0,25.4,8.636,-16.764\n270,22.606,10.414,25.4,25.4,1.524,-23.876\n0,18.542,10.414,0,25.4,4.064,-21.336\n90,18.542,8.89,25.4,25.4,1.524,-23.876\n180,22.606,8.89,0,25.4,4.064,-21.336\n180,1.778,10.16,0,25.4,3.556,-21.844\n270,23.622,10.16,25.4,25.4,6.858,-18.542\n180,1.778,3.302,0,25.4,3.556,-21.844\n270,1.778,10.16,25.4,25.4,6.858,-18.542\n180,2.032,20.574,0,25.4,8.636,-16.764\n270,18.796,20.574,25.4,25.4,2.54,-22.86\n180,2.032,18.034,0,25.4,8.636,-16.764\n270,2.032,20.574,25.4,25.4,2.54,-22.86\n180,7.874,16.764,0,25.4,14.986,-10.414\n270,18.288,16.764,25.4,25.4,5.588,-19.812\n180,7.874,11.176,0,25.4,14.986,-10.414\n")),N(O.ParsePatFile("\n*BLOCKS-02\n;By John Hyslop, Tile2Hatch tool \xa9 CVH 2020\n;Developed in mm as metric QCAD3 pattern\n180,8.128,4.572,0,25.4,12.446,-12.954\n270,8.128,13.97,25.4,25.4,9.398,-16.002\n0,9.398,24.384,0,25.4,10.668,-14.732\n0,4.318,24.892,0,25.4,4.318,-21.082\n90,20.828,0,25.4,25.4,3.81,-21.59\n180,23.368,0,0,25.4,2.54,-22.86\n180,8.128,13.97,0,25.4,12.446,-12.954\n270,21.082,13.97,25.4,25.4,9.398,-16.002\n180,3.302,20.32,0,25.4,4.572,-20.828\n90,3.556,14.986,25.4,25.4,4.318,-21.082\n270,3.302,3.81,25.4,25.4,8.89,-16.51\n180,18.034,14.986,0,25.4,14.478,-10.922\n270,23.368,3.81,25.4,25.4,3.81,-21.59\n0,20.828,3.81,0,25.4,2.54,-22.86\n270,18.034,19.304,25.4,25.4,4.318,-21.082\n0,3.556,19.304,0,25.4,14.478,-10.922\n180,2.032,14.986,0,25.4,8.128,-17.272\n270,2.032,19.304,25.4,25.4,4.318,-21.082\n180,3.302,3.81,0,25.4,4.572,-20.828\n270,24.13,3.81,25.4,25.4,8.89,-16.51\n90,4.572,20.32,25.4,25.4,3.302,-22.098\n180,23.114,20.32,0,25.4,18.542,-6.858\n180,2.032,19.304,0,25.4,8.128,-17.272\n270,19.304,19.304,25.4,25.4,4.318,-21.082\n270,8.636,3.81,25.4,25.4,4.318,-21.082\n0,4.318,3.81,0,25.4,4.318,-21.082\n270,23.114,23.622,25.4,25.4,3.302,-22.098\n0,4.572,23.622,0,25.4,18.542,-6.858\n0,9.398,13.97,0,25.4,10.668,-14.732\n270,9.398,13.97,25.4,25.4,14.986,-10.414\n270,4.318,3.81,25.4,25.4,4.318,-21.082\n270,20.066,13.97,25.4,25.4,14.986,-10.414\n")),N(O.ParsePatFile("\n*BOX-OVERLAP\n;By John Hyslop, Tile2Hatch tool \xa9 CVH 2020\n;Developed in mm as metric QCAD3 pattern\n180,5.08,17.78,0,25.4,10.16,-15.24\n90,5.08,5.08,25.4,25.4,15.24,-10.16\n270,7.62,5.08,25.4,25.4,10.16,-15.24\n180,5.08,7.62,0,25.4,10.16,-15.24\n0,5.08,20.32,0,25.4,15.24,-10.16\n180,20.32,5.08,0,25.4,15.24,-10.16\n270,20.32,20.32,25.4,25.4,15.24,-10.16\n270,17.78,5.08,25.4,25.4,10.16,-15.24\n")),N(O.ParsePatFile("\n*BOX,BOX\n90, 0,0, 0,25.4\n90, 6.35,0, 0,25.4\n0, 0,0, 0,25.4, -6.35,6.35\n0, 0,6.35, 0,25.4, -6.35,6.35\n0, 0,12.7, 0,25.4, 6.35,-6.35\n0, 0,19.05, 0,25.4, 6.35,-6.35\n90, 12.7,0, 0,25.4, 6.35,-6.35\n90, 19.05,0, 0,25.4, 6.35,-6.35\n")),N(O.ParsePatFile("\n*BOXJOIN-01\n;By John Hyslop, Tile2Hatch tool \xa9 CVH 2020\n;Developed in mm as metric QCAD3 pattern\n90,3.810000254,3.81,25.4,25.4,17.78,-7.62\n0,3.810000254,21.59,0,25.4,17.78,-7.62\n270,11.430000254,3.81,25.4,25.4,7.62,-17.78\n180,3.810000254,11.43,0,25.4,7.62,-17.78\n270,13.970000254,3.81,25.4,25.4,7.62,-17.78\n180,21.590000254,3.81,0,25.4,17.78,-7.62\n270,21.590000254,21.59,25.4,25.4,17.78,-7.62\n180,3.810000254,13.97,0,25.4,7.62,-17.78\n")),N(O.ParsePatFile("\n*BOXJOIN-02\n;By John Hyslop, Tile2Hatch tool \xa9 CVH 2020\n;Developed in mm as metric QCAD3 pattern\n90,3.810000254,13.97,25.4,25.4,7.62,-17.78\n270,21.590000254,21.59,25.4,25.4,7.62,-17.78\n0,13.970000254,21.59,0,25.4,7.62,-17.78\n180,3.810000254,13.97,0,25.4,7.62,-17.78\n90,3.810000254,3.81,25.4,25.4,7.62,-17.78\n180,11.430000254,3.81,0,25.4,7.62,-17.78\n180,3.810000254,11.43,0,25.4,7.62,-17.78\n180,21.590000254,3.81,0,25.4,7.62,-17.78\n270,21.590000254,11.43,25.4,25.4,7.62,-17.78\n270,11.430000254,3.81,25.4,25.4,7.62,-17.78\n270,13.970000254,3.81,25.4,25.4,7.62,-17.78\n0,3.810000254,21.59,0,25.4,7.62,-17.78\n")),N(O.ParsePatFile("\n*BRASS,BRASS\n0, 0,0, 0,6.35\n0, 0,3.175, 0,6.35, 3.175,-1.5875\n")),N(O.ParsePatFile("\n*BRICK,BRICK\n0, 0,0, 0,6.35\n90, 0,0, 0,12.7, 6.35,-6.35\n90, 6.35,0, 0,12.7, -6.35,6.35\n")),N(O.ParsePatFile("\n*BRSTONE,BRSTONE\n0, 0,0, 0,8.382\n90, 22.86,0, 8.382,12.7, 8.382,-8.382\n90, 20.32,0, 8.382,12.7, 8.382,-8.382\n0, 22.86,1.397, 12.7,8.382, -22.86,2.54\n0, 22.86,2.794, 12.7,8.382, -22.86,2.54\n0, 22.86,4.191, 12.7,8.382, -22.86,2.54\n0, 22.86,5.588, 12.7,8.382, -22.86,2.54\n0, 22.86,6.985, 12.7,8.382, -22.86,2.54\n")),N(O.ParsePatFile("\n*BUBBLES-01,BUBBLES-01\n;By John Hyslop, Using AutoCAD Lisp Tool\n;Developed in mm as metric QCAD3 pattern\n0,1.4976856,0.4251706,0,25.4,0,-25.4\n0,1.5807944,0.8431022,0,25.4,0,-25.4\n0,1.7177766,1.2465812,0,25.4,0,-25.4\n0,1.9062192,1.6287242,0,25.4,0,-25.4\n0,2.1429472,1.9830034,0,25.4,0,-25.4\n0,2.4238966,2.3033736,0,25.4,0,-25.4\n0,2.7442414,2.584323,0,25.4,0,-25.4\n0,3.098546,2.821051,0,25.4,0,-25.4\n0,3.480689,3.0094936,0,25.4,0,-25.4\n0,3.884168,3.1464504,0,25.4,0,-25.4\n0,4.3020742,3.2295846,0,25.4,0,-25.4\n0,4.7272702,3.2574484,0,25.4,0,-25.4\n0,5.1524408,3.2295846,0,25.4,0,-25.4\n0,5.570347,3.1464504,0,25.4,0,-25.4\n0,5.973826,3.0094936,0,25.4,0,-25.4\n0,6.3559944,2.821051,0,25.4,0,-25.4\n0,6.7102736,2.584323,0,25.4,0,-25.4\n0,7.0306184,2.3033736,0,25.4,0,-25.4\n0,7.3115678,1.9830034,0,25.4,0,-25.4\n0,7.5482958,1.6287242,0,25.4,0,-25.4\n0,7.7367638,1.2465812,0,25.4,0,-25.4\n0,7.8737206,0.8431022,0,25.4,0,-25.4\n0,7.9568548,0.4251706,0,25.4,0,-25.4\n0,3.0482032,5.5942992,0,25.4,0,-25.4\n0,2.9839412,5.1610768,0,25.4,0,-25.4\n0,2.8775152,4.7362618,0,25.4,0,-25.4\n0,2.729992,4.3239182,0,25.4,0,-25.4\n0,2.5427432,3.9280338,0,25.4,0,-25.4\n0,2.3175976,3.5523932,0,25.4,0,-25.4\n0,2.0567142,3.2006286,0,25.4,0,-25.4\n0,1.7626076,2.8761436,0,25.4,0,-25.4\n0,1.4380972,2.582037,0,25.4,0,-25.4\n0,1.086358,2.3211536,0,25.4,0,-25.4\n0,0.7107174,2.096008,0,25.4,0,-25.4\n0,0.3148076,1.9087592,0,25.4,0,-25.4\n0,0.3148076,10.154666,0,25.4,0,-25.4\n0,0.7107174,9.9674172,0,25.4,0,-25.4\n0,1.086358,9.7422716,0,25.4,0,-25.4\n0,1.4380972,9.4813882,0,25.4,0,-25.4\n0,1.7626076,9.1872816,0,25.4,0,-25.4\n0,2.0567142,8.8627966,0,25.4,0,-25.4\n0,2.3175976,8.511032,0,25.4,0,-25.4\n0,2.5427432,8.1353914,0,25.4,0,-25.4\n0,2.729992,7.7394816,0,25.4,0,-25.4\n0,2.8775152,7.327138,0,25.4,0,-25.4\n0,2.9839412,6.902323,0,25.4,0,-25.4\n0,3.0482032,6.469126,0,25.4,0,-25.4\n0,3.0696916,6.0317126,0,25.4,0,-25.4\n0,18.7471304,9.4569026,0,25.4,0,-25.4\n0,18.6083702,9.0603324,0,25.4,0,-25.4\n0,18.3848248,8.70458,0,25.4,0,-25.4\n0,18.0877464,8.4074762,0,25.4,0,-25.4\n0,17.731994,8.1839562,0,25.4,0,-25.4\n0,17.3354238,8.0451706,0,25.4,0,-25.4\n0,16.9178986,7.9981298,0,25.4,0,-25.4\n0,16.5003988,8.0451706,0,25.4,0,-25.4\n0,16.1038286,8.1839562,0,25.4,0,-25.4\n0,15.7480762,8.4074762,0,25.4,0,-25.4\n0,15.4509724,8.70458,0,25.4,0,-25.4\n0,15.2274524,9.0603324,0,25.4,0,-25.4\n0,15.0886668,9.4569026,0,25.4,0,-25.4\n0,15.041626,9.8744024,0,25.4,0,-25.4\n0,15.0886668,10.2919276,0,25.4,0,-25.4\n0,15.2274524,10.6884978,0,25.4,0,-25.4\n0,15.4509724,11.0442502,0,25.4,0,-25.4\n0,15.7480762,11.341354,0,25.4,0,-25.4\n0,16.1038286,11.564874,0,25.4,0,-25.4\n0,16.5003988,11.7036342,0,25.4,0,-25.4\n0,16.9178986,11.750675,0,25.4,0,-25.4\n0,17.3354238,11.7036342,0,25.4,0,-25.4\n0,17.731994,11.564874,0,25.4,0,-25.4\n0,18.0877464,11.341354,0,25.4,0,-25.4\n0,18.3848248,11.0442502,0,25.4,0,-25.4\n0,18.6083702,10.6884978,0,25.4,0,-25.4\n0,18.7471304,10.2919276,0,25.4,0,-25.4\n0,18.7941712,9.8744024,0,25.4,0,-25.4\n0,21.2068664,21.1084414,0,25.4,0,-25.4\n0,20.8647792,21.3569804,0,25.4,0,-25.4\n0,20.5818486,21.6712292,0,25.4,0,-25.4\n0,11.7541802,19.0603632,0,25.4,0,-25.4\n0,11.6505482,18.6510676,0,25.4,0,-25.4\n0,11.480927,18.264378,0,25.4,0,-25.4\n0,11.2499902,17.9108862,0,25.4,0,-25.4\n0,10.9640116,17.6002442,0,25.4,0,-25.4\n0,10.6308144,17.3409102,0,25.4,0,-25.4\n0,10.2594664,17.1399454,0,25.4,0,-25.4\n0,9.8601022,17.0028362,0,25.4,0,-25.4\n0,9.4436184,16.9333418,0,25.4,0,-25.4\n0,9.0213688,16.9333418,0,25.4,0,-25.4\n0,8.6049104,17.0028362,0,25.4,0,-25.4\n0,8.2055462,17.1399454,0,25.4,0,-25.4\n0,7.8341982,17.3409102,0,25.4,0,-25.4\n0,7.5009756,17.6002442,0,25.4,0,-25.4\n0,7.2150224,17.9108862,0,25.4,0,-25.4\n0,6.9840602,18.264378,0,25.4,0,-25.4\n0,6.8144644,18.6510676,0,25.4,0,-25.4\n0,6.710807,19.0603632,0,25.4,0,-25.4\n0,6.6759328,19.481165,0,25.4,0,-25.4\n0,6.710807,19.9019668,0,25.4,0,-25.4\n0,6.8144644,20.3112878,0,25.4,0,-25.4\n0,6.9840602,20.697952,0,25.4,0,-25.4\n0,7.2150224,21.0514438,0,25.4,0,-25.4\n0,7.5009756,21.3620858,0,25.4,0,-25.4\n0,7.8341982,21.6214452,0,25.4,0,-25.4\n0,8.2055462,21.82241,0,25.4,0,-25.4\n0,10.2594664,21.82241,0,25.4,0,-25.4\n0,10.6308144,21.6214452,0,25.4,0,-25.4\n0,10.9640116,21.3620858,0,25.4,0,-25.4\n0,11.2499902,21.0514438,0,25.4,0,-25.4\n0,11.480927,20.697952,0,25.4,0,-25.4\n0,11.6505482,20.3112878,0,25.4,0,-25.4\n0,11.7541802,19.9019668,0,25.4,0,-25.4\n0,11.7890544,19.481165,0,25.4,0,-25.4\n0,20.8583784,16.4692076,0,25.4,0,-25.4\n0,20.7913224,16.0457896,0,25.4,0,-25.4\n0,20.6803752,15.6317442,0,25.4,0,-25.4\n0,20.5267306,15.2315418,0,25.4,0,-25.4\n0,20.3321158,14.8495766,0,25.4,0,-25.4\n0,20.0986644,14.490065,0,25.4,0,-25.4\n0,19.828891,14.1569186,0,25.4,0,-25.4\n0,19.5257674,13.853795,0,25.4,0,-25.4\n0,19.192621,13.5840216,0,25.4,0,-25.4\n0,18.8331094,13.3505448,0,25.4,0,-25.4\n0,18.4511442,13.15593,0,25.4,0,-25.4\n0,18.0509418,13.0023108,0,25.4,0,-25.4\n0,17.636871,12.8913636,0,25.4,0,-25.4\n0,17.2134784,12.8243076,0,25.4,0,-25.4\n0,16.7853868,12.8018794,0,25.4,0,-25.4\n0,16.3573206,12.8243076,0,25.4,0,-25.4\n0,15.9339026,12.8913636,0,25.4,0,-25.4\n0,15.5198572,13.0023108,0,25.4,0,-25.4\n0,15.1196548,13.15593,0,25.4,0,-25.4\n0,14.7376896,13.3505448,0,25.4,0,-25.4\n0,14.378178,13.5840216,0,25.4,0,-25.4\n0,14.0450316,13.853795,0,25.4,0,-25.4\n0,13.741908,14.1569186,0,25.4,0,-25.4\n0,13.4721346,14.490065,0,25.4,0,-25.4\n0,13.2386578,14.8495766,0,25.4,0,-25.4\n0,13.044043,15.2315418,0,25.4,0,-25.4\n0,12.8904238,15.6317442,0,25.4,0,-25.4\n0,12.7794766,16.0457896,0,25.4,0,-25.4\n0,12.7124206,16.4692076,0,25.4,0,-25.4\n0,12.6899924,16.8972738,0,25.4,0,-25.4\n0,12.7124206,17.3253654,0,25.4,0,-25.4\n0,12.7794766,17.748758,0,25.4,0,-25.4\n0,12.8904238,18.1628288,0,25.4,0,-25.4\n0,13.044043,18.5630312,0,25.4,0,-25.4\n0,13.2386578,18.9449964,0,25.4,0,-25.4\n0,13.4721346,19.304508,0,25.4,0,-25.4\n0,13.741908,19.6376544,0,25.4,0,-25.4\n0,14.0450316,19.9407526,0,25.4,0,-25.4\n0,14.378178,20.2105514,0,25.4,0,-25.4\n0,14.7376896,20.4440028,0,25.4,0,-25.4\n0,15.1196548,20.6386176,0,25.4,0,-25.4\n0,15.5198572,20.7922368,0,25.4,0,-25.4\n0,15.9339026,20.9032094,0,25.4,0,-25.4\n0,16.3573206,20.9702654,0,25.4,0,-25.4\n0,16.7853868,20.9926936,0,25.4,0,-25.4\n0,17.2134784,20.9702654,0,25.4,0,-25.4\n0,17.636871,20.9032094,0,25.4,0,-25.4\n0,18.0509418,20.7922368,0,25.4,0,-25.4\n0,18.4511442,20.6386176,0,25.4,0,-25.4\n0,18.8331094,20.4440028,0,25.4,0,-25.4\n0,19.192621,20.2105514,0,25.4,0,-25.4\n0,19.5257674,19.9407526,0,25.4,0,-25.4\n0,19.828891,19.6376544,0,25.4,0,-25.4\n0,20.0986644,19.304508,0,25.4,0,-25.4\n0,20.3321158,18.9449964,0,25.4,0,-25.4\n0,20.5267306,18.5630312,0,25.4,0,-25.4\n0,20.6803752,18.1628288,0,25.4,0,-25.4\n0,20.7913224,17.748758,0,25.4,0,-25.4\n0,20.8583784,17.3253654,0,25.4,0,-25.4\n0,20.8808066,16.8972738,0,25.4,0,-25.4\n0,13.3174994,9.6961452,0,25.4,0,-25.4\n0,13.2480558,9.2577158,0,25.4,0,-25.4\n0,13.1331716,8.8289638,0,25.4,0,-25.4\n0,12.9740914,8.4145628,0,25.4,0,-25.4\n0,12.7725932,8.0190594,0,25.4,0,-25.4\n0,12.530836,7.6467716,0,25.4,0,-25.4\n0,12.2514868,7.3018142,0,25.4,0,-25.4\n0,11.9375936,6.9879464,0,25.4,0,-25.4\n0,11.5926362,6.7085972,0,25.4,0,-25.4\n0,11.2203738,6.46684,0,25.4,0,-25.4\n0,10.824845,6.2653164,0,25.4,0,-25.4\n0,10.410444,6.1062362,0,25.4,0,-25.4\n0,9.981692,5.991352,0,25.4,0,-25.4\n0,9.5432626,5.9219084,0,25.4,0,-25.4\n0,9.0999818,5.8986928,0,25.4,0,-25.4\n0,8.6567264,5.9219084,0,25.4,0,-25.4\n0,8.218297,5.991352,0,25.4,0,-25.4\n0,7.7895196,6.1062362,0,25.4,0,-25.4\n0,7.3751186,6.2653164,0,25.4,0,-25.4\n0,6.9796152,6.46684,0,25.4,0,-25.4\n0,6.6073528,6.7085972,0,25.4,0,-25.4\n0,6.2623954,6.9879464,0,25.4,0,-25.4\n0,5.9485022,7.3018142,0,25.4,0,-25.4\n0,5.669153,7.6467716,0,25.4,0,-25.4\n0,5.4273958,8.0190594,0,25.4,0,-25.4\n0,5.2258722,8.4145628,0,25.4,0,-25.4\n0,5.0668174,8.8289638,0,25.4,0,-25.4\n0,4.9519332,9.2577158,0,25.4,0,-25.4\n0,4.8824896,9.6961452,0,25.4,0,-25.4\n0,4.8592486,10.139426,0,25.4,0,-25.4\n0,4.8824896,10.5827068,0,25.4,0,-25.4\n0,4.9519332,11.0211362,0,25.4,0,-25.4\n0,5.0668174,11.4498882,0,25.4,0,-25.4\n0,5.2258722,11.8642892,0,25.4,0,-25.4\n0,5.4273958,12.2597926,0,25.4,0,-25.4\n0,5.669153,12.6320804,0,25.4,0,-25.4\n0,5.9485022,12.9770378,0,25.4,0,-25.4\n0,6.2623954,13.2909056,0,25.4,0,-25.4\n0,6.6073528,13.5702548,0,25.4,0,-25.4\n0,6.9796152,13.812012,0,25.4,0,-25.4\n0,7.3751186,14.0135356,0,25.4,0,-25.4\n0,7.7895196,14.1726158,0,25.4,0,-25.4\n0,8.218297,14.2875,0,25.4,0,-25.4\n0,8.6567264,14.3569436,0,25.4,0,-25.4\n0,9.0999818,14.3801592,0,25.4,0,-25.4\n0,9.5432626,14.3569436,0,25.4,0,-25.4\n0,9.981692,14.2875,0,25.4,0,-25.4\n0,10.410444,14.1726158,0,25.4,0,-25.4\n0,10.824845,14.0135356,0,25.4,0,-25.4\n0,11.2203738,13.812012,0,25.4,0,-25.4\n0,11.5926362,13.5702548,0,25.4,0,-25.4\n0,11.9375936,13.2909056,0,25.4,0,-25.4\n0,12.2514868,12.9770378,0,25.4,0,-25.4\n0,12.530836,12.6320804,0,25.4,0,-25.4\n0,12.7725932,12.2597926,0,25.4,0,-25.4\n0,12.9740914,11.8642892,0,25.4,0,-25.4\n0,13.1331716,11.4498882,0,25.4,0,-25.4\n0,13.2480558,11.0211362,0,25.4,0,-25.4\n0,13.3174994,10.5827068,0,25.4,0,-25.4\n0,13.3407404,10.139426,0,25.4,0,-25.4\n0,21.5277192,2.3211536,0,25.4,0,-25.4\n0,21.1759546,2.582037,0,25.4,0,-25.4\n0,20.8514442,2.8761436,0,25.4,0,-25.4\n0,20.557363,3.2006286,0,25.4,0,-25.4\n0,20.2964796,3.5523932,0,25.4,0,-25.4\n0,20.0713086,3.9280338,0,25.4,0,-25.4\n0,19.8840852,4.3239182,0,25.4,0,-25.4\n0,19.7365366,4.7362618,0,25.4,0,-25.4\n0,19.630136,5.1610768,0,25.4,0,-25.4\n0,19.565874,5.5942992,0,25.4,0,-25.4\n0,19.5443856,6.0317126,0,25.4,0,-25.4\n0,19.565874,6.469126,0,25.4,0,-25.4\n0,19.630136,6.902323,0,25.4,0,-25.4\n0,19.7365366,7.327138,0,25.4,0,-25.4\n0,19.8840852,7.7394816,0,25.4,0,-25.4\n0,20.0713086,8.1353914,0,25.4,0,-25.4\n0,20.2964796,8.511032,0,25.4,0,-25.4\n0,20.557363,8.8627966,0,25.4,0,-25.4\n0,20.8514442,9.1872816,0,25.4,0,-25.4\n0,21.1759546,9.4813882,0,25.4,0,-25.4\n0,21.5277192,9.7422716,0,25.4,0,-25.4\n0,6.1278008,16.064738,0,25.4,0,-25.4\n0,6.0612782,15.6162756,0,25.4,0,-25.4\n0,5.9511438,15.1765,0,25.4,0,-25.4\n0,5.7983882,14.749653,0,25.4,0,-25.4\n0,5.6045608,14.339824,0,25.4,0,-25.4\n0,5.3714904,13.95095,0,25.4,0,-25.4\n0,5.1014122,13.5868156,0,25.4,0,-25.4\n0,4.7969678,13.2509006,0,25.4,0,-25.4\n0,4.4610528,12.9464308,0,25.4,0,-25.4\n0,4.0969184,12.676378,0,25.4,0,-25.4\n0,3.7080444,12.4433076,0,25.4,0,-25.4\n0,3.2982154,12.2494548,0,25.4,0,-25.4\n0,2.8713684,12.0967246,0,25.4,0,-25.4\n0,2.4315928,11.9865648,0,25.4,0,-25.4\n0,1.9831304,11.9200422,0,25.4,0,-25.4\n0,1.5303246,11.8977918,0,25.4,0,-25.4\n0,1.0774934,11.9200422,0,25.4,0,-25.4\n0,0.6290564,11.9865648,0,25.4,0,-25.4\n0,0.1892808,12.0967246,0,25.4,0,-25.4\n0,0.1892808,20.938363,0,25.4,0,-25.4\n0,0.6290564,21.0485228,0,25.4,0,-25.4\n0,1.0774934,21.1150454,0,25.4,0,-25.4\n0,1.5303246,21.1372958,0,25.4,0,-25.4\n0,1.9831304,21.1150454,0,25.4,0,-25.4\n0,2.4315928,21.0485228,0,25.4,0,-25.4\n0,2.8713684,20.938363,0,25.4,0,-25.4\n0,3.2982154,20.7856328,0,25.4,0,-25.4\n0,3.7080444,20.59178,0,25.4,0,-25.4\n0,4.0969184,20.3587096,0,25.4,0,-25.4\n0,4.4610528,20.0886568,0,25.4,0,-25.4\n0,4.7969678,19.784187,0,25.4,0,-25.4\n0,5.1014122,19.448272,0,25.4,0,-25.4\n0,5.3714904,19.0841376,0,25.4,0,-25.4\n0,5.6045608,18.6952636,0,25.4,0,-25.4\n0,5.7983882,18.2854346,0,25.4,0,-25.4\n0,5.9511438,17.8585876,0,25.4,0,-25.4\n0,6.0612782,17.418812,0,25.4,0,-25.4\n0,6.1278008,16.9703496,0,25.4,0,-25.4\n0,6.1500512,16.5175438,0,25.4,0,-25.4\n0,19.5946268,1.221359,0,25.4,0,-25.4\n0,19.5242688,0.7469886,0,25.4,0,-25.4\n0,19.4077336,0.281813,0,25.4,0,-25.4\n0,10.055352,0.281813,0,25.4,0,-25.4\n0,9.9388168,0.7469886,0,25.4,0,-25.4\n0,9.8684588,1.221359,0,25.4,0,-25.4\n0,9.844913,1.7003268,0,25.4,0,-25.4\n0,9.8684588,2.1792946,0,25.4,0,-25.4\n0,9.9388168,2.653665,0,25.4,0,-25.4\n0,10.055352,3.1188406,0,25.4,0,-25.4\n0,10.216896,3.570351,0,25.4,0,-25.4\n0,10.4219248,4.0038528,0,25.4,0,-25.4\n0,10.6684572,4.4151804,0,25.4,0,-25.4\n0,10.954131,4.800346,0,25.4,0,-25.4\n0,11.2761776,5.155692,0,25.4,0,-25.4\n0,11.6314982,5.4777386,0,25.4,0,-25.4\n0,12.0166892,5.763387,0,25.4,0,-25.4\n0,12.4280168,6.0099448,0,25.4,0,-25.4\n0,12.8615186,6.2149736,0,25.4,0,-25.4\n0,13.313029,6.3765176,0,25.4,0,-25.4\n0,13.7782046,6.4930528,0,25.4,0,-25.4\n0,14.252575,6.5634108,0,25.4,0,-25.4\n0,14.7315428,6.5869312,0,25.4,0,-25.4\n0,15.2105106,6.5634108,0,25.4,0,-25.4\n0,15.684881,6.4930528,0,25.4,0,-25.4\n0,16.1500566,6.3765176,0,25.4,0,-25.4\n0,16.601567,6.2149736,0,25.4,0,-25.4\n0,17.0350688,6.0099448,0,25.4,0,-25.4\n0,17.4463964,5.763387,0,25.4,0,-25.4\n0,17.8315874,5.4777386,0,25.4,0,-25.4\n0,18.186908,5.155692,0,25.4,0,-25.4\n0,18.5089546,4.800346,0,25.4,0,-25.4\n0,18.794603,4.4151804,0,25.4,0,-25.4\n0,19.0411608,4.0038528,0,25.4,0,-25.4\n0,19.2461896,3.570351,0,25.4,0,-25.4\n0,19.4077336,3.1188406,0,25.4,0,-25.4\n0,19.5242688,2.653665,0,25.4,0,-25.4\n0,19.5946268,2.1792946,0,25.4,0,-25.4\n0,19.6181472,1.7003268,0,25.4,0,-25.4\n0,25.1624084,12.2494548,0,25.4,0,-25.4\n0,24.7525794,12.4433076,0,25.4,0,-25.4\n0,24.3637308,12.676378,0,25.4,0,-25.4\n0,23.9995964,12.9464308,0,25.4,0,-25.4\n0,23.663656,13.2509006,0,25.4,0,-25.4\n0,23.3592116,13.5868156,0,25.4,0,-25.4\n0,23.0891334,13.95095,0,25.4,0,-25.4\n0,22.856063,14.339824,0,25.4,0,-25.4\n0,22.6622356,14.749653,0,25.4,0,-25.4\n0,22.5095054,15.1765,0,25.4,0,-25.4\n0,22.3993456,15.6162756,0,25.4,0,-25.4\n0,22.332823,16.064738,0,25.4,0,-25.4\n0,22.3105726,16.5175438,0,25.4,0,-25.4\n0,22.332823,16.9703496,0,25.4,0,-25.4\n0,22.3993456,17.418812,0,25.4,0,-25.4\n0,22.5095054,17.8585876,0,25.4,0,-25.4\n0,22.6622356,18.2854346,0,25.4,0,-25.4\n0,22.856063,18.6952636,0,25.4,0,-25.4\n0,23.0891334,19.0841376,0,25.4,0,-25.4\n0,23.3592116,19.448272,0,25.4,0,-25.4\n0,23.663656,19.784187,0,25.4,0,-25.4\n0,23.9995964,20.0886568,0,25.4,0,-25.4\n0,24.3637308,20.3587096,0,25.4,0,-25.4\n0,24.7525794,20.59178,0,25.4,0,-25.4\n0,25.1624084,20.7856328,0,25.4,0,-25.4\n0,24.0659412,22.037421,0,25.4,0,-25.4\n0,23.854537,21.6712292,0,25.4,0,-25.4\n0,23.571581,21.3569804,0,25.4,0,-25.4\n0,23.2294938,21.1084414,0,25.4,0,-25.4\n0,22.8432106,20.936458,0,25.4,0,-25.4\n0,22.429597,20.8485486,0,25.4,0,-25.4\n0,22.0067632,20.8485486,0,25.4,0,-25.4\n0,21.5931496,20.936458,0,25.4,0,-25.4\n0,20.370419,22.037421,0,25.4,0,-25.4\n0,25.302464,1.7612106,0,25.4,0,-25.4\n0,24.877649,1.65481,0,25.4,0,-25.4\n0,24.444452,1.590548,0,25.4,0,-25.4\n0,24.0070386,1.5690596,0,25.4,0,-25.4\n0,23.5696252,1.590548,0,25.4,0,-25.4\n0,23.1364028,1.65481,0,25.4,0,-25.4\n0,22.7115878,1.7612106,0,25.4,0,-25.4\n0,22.2992442,1.9087592,0,25.4,0,-25.4\n0,21.9033598,2.096008,0,25.4,0,-25.4\n0,21.9033598,9.9674172,0,25.4,0,-25.4\n0,22.2992442,10.154666,0,25.4,0,-25.4\n0,22.7115878,10.3022146,0,25.4,0,-25.4\n0,23.1364028,10.4086152,0,25.4,0,-25.4\n0,23.5696252,10.4728772,0,25.4,0,-25.4\n0,24.0070386,10.4943656,0,25.4,0,-25.4\n0,24.444452,10.4728772,0,25.4,0,-25.4\n0,24.877649,10.4086152,0,25.4,0,-25.4\n0,25.302464,10.3022146,0,25.4,0,-25.4\n0,19.2461896,25.2303026,0,25.4,0,-25.4\n0,19.0411608,24.7967754,0,25.4,0,-25.4\n0,18.794603,24.3854732,0,25.4,0,-25.4\n0,18.5089546,24.0002822,0,25.4,0,-25.4\n0,18.186908,23.6449616,0,25.4,0,-25.4\n0,17.8315874,23.322915,0,25.4,0,-25.4\n0,17.4463964,23.0372412,0,25.4,0,-25.4\n0,17.0350688,22.7907088,0,25.4,0,-25.4\n0,16.601567,22.58568,0,25.4,0,-25.4\n0,16.1500566,22.4241106,0,25.4,0,-25.4\n0,15.684881,22.3076008,0,25.4,0,-25.4\n0,15.2105106,22.2372428,0,25.4,0,-25.4\n0,14.7315428,22.213697,0,25.4,0,-25.4\n0,14.252575,22.2372428,0,25.4,0,-25.4\n0,13.7782046,22.3076008,0,25.4,0,-25.4\n0,13.313029,22.4241106,0,25.4,0,-25.4\n0,12.8615186,22.58568,0,25.4,0,-25.4\n0,12.4280168,22.7907088,0,25.4,0,-25.4\n0,12.0166892,23.0372412,0,25.4,0,-25.4\n0,11.6314982,23.322915,0,25.4,0,-25.4\n0,11.2761776,23.6449616,0,25.4,0,-25.4\n0,10.954131,24.0002822,0,25.4,0,-25.4\n0,10.6684572,24.3854732,0,25.4,0,-25.4\n0,10.4219248,24.7967754,0,25.4,0,-25.4\n0,10.216896,25.2303026,0,25.4,0,-25.4\n0,20.2397614,22.4395792,0,25.4,0,-25.4\n0,20.1955654,22.8601016,0,25.4,0,-25.4\n0,20.2397614,23.280624,0,25.4,0,-25.4\n0,20.370419,23.6827822,0,25.4,0,-25.4\n0,20.5818486,24.048974,0,25.4,0,-25.4\n0,20.8647792,24.3631974,0,25.4,0,-25.4\n0,21.2068664,24.6117364,0,25.4,0,-25.4\n0,8.6049104,21.9594938,0,25.4,0,-25.4\n0,9.0213688,22.0289882,0,25.4,0,-25.4\n0,9.4436184,22.0289882,0,25.4,0,-25.4\n0,9.8601022,21.9594938,0,25.4,0,-25.4\n0,7.9568548,24.9748294,0,25.4,0,-25.4\n0,7.8737206,24.5568978,0,25.4,0,-25.4\n0,7.7367638,24.1534188,0,25.4,0,-25.4\n0,7.5482958,23.7712758,0,25.4,0,-25.4\n0,7.3115678,23.4169966,0,25.4,0,-25.4\n0,7.0306184,23.0966264,0,25.4,0,-25.4\n0,6.7102736,22.815677,0,25.4,0,-25.4\n0,6.3559944,22.578949,0,25.4,0,-25.4\n0,5.973826,22.3905064,0,25.4,0,-25.4\n0,5.570347,22.2535496,0,25.4,0,-25.4\n0,5.1524408,22.1704154,0,25.4,0,-25.4\n0,4.7272702,22.1425516,0,25.4,0,-25.4\n0,4.3020742,22.1704154,0,25.4,0,-25.4\n0,3.884168,22.2535496,0,25.4,0,-25.4\n0,3.480689,22.3905064,0,25.4,0,-25.4\n0,3.098546,22.578949,0,25.4,0,-25.4\n0,2.7442414,22.815677,0,25.4,0,-25.4\n0,2.4238966,23.0966264,0,25.4,0,-25.4\n0,2.1429472,23.4169966,0,25.4,0,-25.4\n0,1.9062192,23.7712758,0,25.4,0,-25.4\n0,1.7177766,24.1534188,0,25.4,0,-25.4\n0,1.5807944,24.5568978,0,25.4,0,-25.4\n0,1.4976856,24.9748294,0,25.4,0,-25.4\n0,1.4697964,25.4,0,25.4,0,-25.4\n0,7.9847186,25.4,0,25.4,0,-25.4\n0,24.1966242,22.4395792,0,25.4,0,-25.4\n0,21.5931496,24.7837452,0,25.4,0,-25.4\n0,22.0067632,24.8716546,0,25.4,0,-25.4\n0,22.429597,24.8716546,0,25.4,0,-25.4\n0,22.8432106,24.7837452,0,25.4,0,-25.4\n0,23.2294938,24.6117364,0,25.4,0,-25.4\n0,23.571581,24.3631974,0,25.4,0,-25.4\n0,23.854537,24.048974,0,25.4,0,-25.4\n0,24.0659412,23.6827822,0,25.4,0,-25.4\n0,24.1966242,23.280624,0,25.4,0,-25.4\n0,24.2408202,22.8601016,0,25.4,0,-25.4\n")),N(O.ParsePatFile("\n*BUBBLES-02,BUBBLES-02\n;By John Hyslop, Using AutoCAD Lisp Tool\n;Developed in mm as metric QCAD3 pattern\n0,0.315722,3.5481006,0,25.4,0,-25.4\n0,0.1191006,3.162173,0,25.4,0,-25.4\n0,0.1191006,4.7896018,0,25.4,0,-25.4\n0,0.315722,4.4036742,0,25.4,0,-25.4\n0,0.3834892,3.9758874,0,25.4,0,-25.4\n0,0.9946386,13.9859512,0,25.4,0,-25.4\n0,0.840232,13.5788146,0,25.4,0,-25.4\n0,0.5928614,13.220446,0,25.4,0,-25.4\n0,0.2669286,12.9316988,0,25.4,0,-25.4\n0,0.2669286,15.9047688,0,25.4,0,-25.4\n0,0.5928614,15.6160216,0,25.4,0,-25.4\n0,0.840232,15.257653,0,25.4,0,-25.4\n0,0.9946386,14.8505164,0,25.4,0,-25.4\n0,1.0471404,14.4182338,0,25.4,0,-25.4\n0,0.321437,1.5549118,0,25.4,0,-25.4\n0,0.7453122,1.6269208,0,25.4,0,-25.4\n0,1.1745976,1.6510254,0,25.4,0,-25.4\n0,1.6039084,1.6269208,0,25.4,0,-25.4\n0,2.0277836,1.5549118,0,25.4,0,-25.4\n0,2.44094,1.435862,0,25.4,0,-25.4\n0,2.838196,1.2713208,0,25.4,0,-25.4\n0,3.214497,1.0633456,0,25.4,0,-25.4\n0,3.5651694,0.8145526,0,25.4,0,-25.4\n0,3.8857682,0.5280406,0,25.4,0,-25.4\n0,4.1722802,0.2074418,0,25.4,0,-25.4\n0,5.3785008,15.8337504,0,25.4,0,-25.4\n0,5.1644804,15.4630628,0,25.4,0,-25.4\n0,4.8365664,15.1879046,0,25.4,0,-25.4\n0,4.434332,15.041499,0,25.4,0,-25.4\n0,4.0062658,15.041499,0,25.4,0,-25.4\n0,3.6040314,15.1879046,0,25.4,0,-25.4\n0,3.2761174,15.4630628,0,25.4,0,-25.4\n0,3.062097,15.8337504,0,25.4,0,-25.4\n0,2.9877512,16.2553142,0,25.4,0,-25.4\n0,3.062097,16.676878,0,25.4,0,-25.4\n0,3.2761174,17.0475656,0,25.4,0,-25.4\n0,3.6040314,17.3227238,0,25.4,0,-25.4\n0,4.0062658,17.4691294,0,25.4,0,-25.4\n0,4.434332,17.4691294,0,25.4,0,-25.4\n0,4.8365664,17.3227238,0,25.4,0,-25.4\n0,5.1644804,17.0475656,0,25.4,0,-25.4\n0,5.3785008,16.676878,0,25.4,0,-25.4\n0,5.4528212,16.2553142,0,25.4,0,-25.4\n0,1.6039084,19.4068192,0,25.4,0,-25.4\n0,1.1745976,19.3827146,0,25.4,0,-25.4\n0,0.7453122,19.4068192,0,25.4,0,-25.4\n0,8.07212,6.3135002,0,25.4,0,-25.4\n0,7.9904082,5.9026552,0,25.4,0,-25.4\n0,7.8557628,5.5059834,0,25.4,0,-25.4\n0,7.6704952,5.130292,0,25.4,0,-25.4\n0,7.437755,4.7820072,0,25.4,0,-25.4\n0,7.1615554,4.4670472,0,25.4,0,-25.4\n0,6.8466208,4.1908476,0,25.4,0,-25.4\n0,6.4983106,3.9581328,0,25.4,0,-25.4\n0,6.1226192,3.7728652,0,25.4,0,-25.4\n0,5.7259474,3.6382198,0,25.4,0,-25.4\n0,5.3151024,3.5564826,0,25.4,0,-25.4\n0,4.89712,3.5291014,0,25.4,0,-25.4\n0,4.4791122,3.5564826,0,25.4,0,-25.4\n0,4.0682672,3.6382198,0,25.4,0,-25.4\n0,3.6715954,3.7728652,0,25.4,0,-25.4\n0,3.295904,3.9581328,0,25.4,0,-25.4\n0,2.9475938,4.1908476,0,25.4,0,-25.4\n0,2.6326592,4.4670472,0,25.4,0,-25.4\n0,2.3564596,4.7820072,0,25.4,0,-25.4\n0,2.1237448,5.130292,0,25.4,0,-25.4\n0,1.9384772,5.5059834,0,25.4,0,-25.4\n0,1.8038064,5.9026552,0,25.4,0,-25.4\n0,1.7220946,6.3135002,0,25.4,0,-25.4\n0,1.694688,6.731508,0,25.4,0,-25.4\n0,1.7220946,7.1495158,0,25.4,0,-25.4\n0,1.8038064,7.5603608,0,25.4,0,-25.4\n0,1.9384772,7.9570072,0,25.4,0,-25.4\n0,2.1237448,8.332724,0,25.4,0,-25.4\n0,2.3564596,8.6810088,0,25.4,0,-25.4\n0,2.6326592,8.9959434,0,25.4,0,-25.4\n0,2.9475938,9.272143,0,25.4,0,-25.4\n0,3.295904,9.5048832,0,25.4,0,-25.4\n0,3.6715954,9.6901508,0,25.4,0,-25.4\n0,4.0682672,9.8247962,0,25.4,0,-25.4\n0,4.4791122,9.9065334,0,25.4,0,-25.4\n0,4.89712,9.9339146,0,25.4,0,-25.4\n0,5.3151024,9.9065334,0,25.4,0,-25.4\n0,5.7259474,9.8247962,0,25.4,0,-25.4\n0,6.1226192,9.6901508,0,25.4,0,-25.4\n0,6.4983106,9.5048832,0,25.4,0,-25.4\n0,6.8466208,9.272143,0,25.4,0,-25.4\n0,7.1615554,8.9959434,0,25.4,0,-25.4\n0,7.437755,8.6810088,0,25.4,0,-25.4\n0,7.6704952,8.332724,0,25.4,0,-25.4\n0,7.8557628,7.9570072,0,25.4,0,-25.4\n0,7.9904082,7.5603608,0,25.4,0,-25.4\n0,8.07212,7.1495158,0,25.4,0,-25.4\n0,8.0995266,6.731508,0,25.4,0,-25.4\n0,18.0404516,13.0813048,0,25.4,0,-25.4\n0,17.9789836,12.6669292,0,25.4,0,-25.4\n0,17.8771804,12.2606054,0,25.4,0,-25.4\n0,17.736058,11.8661942,0,25.4,0,-25.4\n0,17.5569626,11.4875056,0,25.4,0,-25.4\n0,17.3416214,11.1282226,0,25.4,0,-25.4\n0,17.0920664,10.7917488,0,25.4,0,-25.4\n0,16.8107614,10.4813862,0,25.4,0,-25.4\n0,16.5003734,10.2000558,0,25.4,0,-25.4\n0,16.163925,9.9505262,0,25.4,0,-25.4\n0,15.8046166,9.7351596,0,25.4,0,-25.4\n0,15.4259534,9.5560642,0,25.4,0,-25.4\n0,15.0315422,9.4149418,0,25.4,0,-25.4\n0,14.625193,9.313164,0,25.4,0,-25.4\n0,14.2108428,9.251696,0,25.4,0,-25.4\n0,13.792454,9.2311474,0,25.4,0,-25.4\n0,13.3740652,9.251696,0,25.4,0,-25.4\n0,12.9596896,9.313164,0,25.4,0,-25.4\n0,12.5533404,9.4149418,0,25.4,0,-25.4\n0,12.1589292,9.5560642,0,25.4,0,-25.4\n0,11.780266,9.7351596,0,25.4,0,-25.4\n0,11.4209576,9.9505262,0,25.4,0,-25.4\n0,11.0845092,10.2000558,0,25.4,0,-25.4\n0,10.7741212,10.4813862,0,25.4,0,-25.4\n0,10.4928162,10.7917488,0,25.4,0,-25.4\n0,10.2432866,11.1282226,0,25.4,0,-25.4\n0,10.02792,11.4875056,0,25.4,0,-25.4\n0,9.8488246,11.8661942,0,25.4,0,-25.4\n0,9.7077022,12.2606054,0,25.4,0,-25.4\n0,9.6059244,12.6669292,0,25.4,0,-25.4\n0,9.5444564,13.0813048,0,25.4,0,-25.4\n0,9.5239078,13.4996936,0,25.4,0,-25.4\n0,9.5444564,13.9180824,0,25.4,0,-25.4\n0,9.6059244,14.332458,0,25.4,0,-25.4\n0,9.7077022,14.7387818,0,25.4,0,-25.4\n0,9.8488246,15.133193,0,25.4,0,-25.4\n0,10.02792,15.5118816,0,25.4,0,-25.4\n0,10.2432866,15.8711646,0,25.4,0,-25.4\n0,10.4928162,16.2076384,0,25.4,0,-25.4\n0,10.7741212,16.518001,0,25.4,0,-25.4\n0,11.0845092,16.7993314,0,25.4,0,-25.4\n0,11.4209576,17.048861,0,25.4,0,-25.4\n0,11.780266,17.2642276,0,25.4,0,-25.4\n0,12.1589292,17.443323,0,25.4,0,-25.4\n0,12.5533404,17.5844454,0,25.4,0,-25.4\n0,12.9596896,17.6862232,0,25.4,0,-25.4\n0,13.3740652,17.7476912,0,25.4,0,-25.4\n0,13.792454,17.7682398,0,25.4,0,-25.4\n0,14.2108428,17.7476912,0,25.4,0,-25.4\n0,14.625193,17.6862232,0,25.4,0,-25.4\n0,15.0315422,17.5844454,0,25.4,0,-25.4\n0,15.4259534,17.443323,0,25.4,0,-25.4\n0,15.8046166,17.2642276,0,25.4,0,-25.4\n0,16.163925,17.048861,0,25.4,0,-25.4\n0,16.5003734,16.7993314,0,25.4,0,-25.4\n0,16.8107614,16.518001,0,25.4,0,-25.4\n0,17.0920664,16.2076384,0,25.4,0,-25.4\n0,17.3416214,15.8711646,0,25.4,0,-25.4\n0,17.5569626,15.5118816,0,25.4,0,-25.4\n0,17.736058,15.133193,0,25.4,0,-25.4\n0,17.8771804,14.7387818,0,25.4,0,-25.4\n0,17.9789836,14.332458,0,25.4,0,-25.4\n0,18.0404516,13.9180824,0,25.4,0,-25.4\n0,18.0610002,13.4996936,0,25.4,0,-25.4\n0,8.9792048,0.3298444,0,25.4,0,-25.4\n0,8.9318846,0.7497064,0,25.4,0,-25.4\n0,8.9160858,1.1719306,0,25.4,0,-25.4\n0,8.9318846,1.5941294,0,25.4,0,-25.4\n0,8.9792048,2.0139914,0,25.4,0,-25.4\n0,9.0577416,2.429129,0,25.4,0,-25.4\n0,9.1670886,2.8372562,0,25.4,0,-25.4\n0,9.3066362,3.2360616,0,25.4,0,-25.4\n0,9.475597,3.62331,0,25.4,0,-25.4\n0,9.6730312,3.9968424,0,25.4,0,-25.4\n0,9.8978212,4.3546014,0,25.4,0,-25.4\n0,10.1487224,4.694555,0,25.4,0,-25.4\n0,10.4243124,5.0147982,0,25.4,0,-25.4\n0,10.7230672,5.3135784,0,25.4,0,-25.4\n0,11.0433104,5.5891684,0,25.4,0,-25.4\n0,11.383264,5.8400696,0,25.4,0,-25.4\n0,11.741023,6.0648596,0,25.4,0,-25.4\n0,12.1145554,6.2622684,0,25.4,0,-25.4\n0,12.5018292,6.4312292,0,25.4,0,-25.4\n0,12.9006346,6.5707768,0,25.4,0,-25.4\n0,13.3087364,6.6801238,0,25.4,0,-25.4\n0,13.723874,6.758686,0,25.4,0,-25.4\n0,14.143736,6.8059808,0,25.4,0,-25.4\n0,14.5659602,6.8217796,0,25.4,0,-25.4\n0,14.988159,6.8059808,0,25.4,0,-25.4\n0,15.408021,6.758686,0,25.4,0,-25.4\n0,15.8231586,6.6801238,0,25.4,0,-25.4\n0,16.2312858,6.5707768,0,25.4,0,-25.4\n0,16.6300658,6.4312292,0,25.4,0,-25.4\n0,17.0173396,6.2622684,0,25.4,0,-25.4\n0,17.390872,6.0648596,0,25.4,0,-25.4\n0,17.748631,5.8400696,0,25.4,0,-25.4\n0,18.0885846,5.5891684,0,25.4,0,-25.4\n0,18.4088278,5.3135784,0,25.4,0,-25.4\n0,18.7075826,5.0147982,0,25.4,0,-25.4\n0,18.983198,4.694555,0,25.4,0,-25.4\n0,19.2340992,4.3546014,0,25.4,0,-25.4\n0,19.4588892,3.9968424,0,25.4,0,-25.4\n0,19.656298,3.62331,0,25.4,0,-25.4\n0,19.8252588,3.2360616,0,25.4,0,-25.4\n0,23.5769404,0.2074418,0,25.4,0,-25.4\n0,23.8634524,0.5280406,0,25.4,0,-25.4\n0,24.1840512,0.8145526,0,25.4,0,-25.4\n0,24.5347236,1.0633456,0,25.4,0,-25.4\n0,24.9110246,1.2713208,0,25.4,0,-25.4\n0,25.3082552,1.435862,0,25.4,0,-25.4\n0,25.2128274,2.8558998,0,25.4,0,-25.4\n0,24.8269252,2.6592784,0,25.4,0,-25.4\n0,24.399113,2.5915112,0,25.4,0,-25.4\n0,23.9713262,2.6592784,0,25.4,0,-25.4\n0,23.5853986,2.8558998,0,25.4,0,-25.4\n0,23.2791508,3.162173,0,25.4,0,-25.4\n0,23.082504,3.5481006,0,25.4,0,-25.4\n0,23.0147622,3.9758874,0,25.4,0,-25.4\n0,23.082504,4.4036742,0,25.4,0,-25.4\n0,23.2791508,4.7896018,0,25.4,0,-25.4\n0,23.5853986,5.095875,0,25.4,0,-25.4\n0,23.9713262,5.2924964,0,25.4,0,-25.4\n0,24.399113,5.3602636,0,25.4,0,-25.4\n0,24.8269252,5.2924964,0,25.4,0,-25.4\n0,25.2128274,5.095875,0,25.4,0,-25.4\n0,25.2813566,12.729337,0,25.4,0,-25.4\n0,24.8585736,12.6251208,0,25.4,0,-25.4\n0,24.423116,12.6251208,0,25.4,0,-25.4\n0,24.000333,12.729337,0,25.4,0,-25.4\n0,23.614761,12.9316988,0,25.4,0,-25.4\n0,23.2888028,13.220446,0,25.4,0,-25.4\n0,23.0414576,13.5788146,0,25.4,0,-25.4\n0,22.887051,13.9859512,0,25.4,0,-25.4\n0,22.8345492,14.4182338,0,25.4,0,-25.4\n0,22.887051,14.8505164,0,25.4,0,-25.4\n0,23.0414576,15.257653,0,25.4,0,-25.4\n0,23.2888028,15.6160216,0,25.4,0,-25.4\n0,23.614761,15.9047688,0,25.4,0,-25.4\n0,24.000333,16.1071306,0,25.4,0,-25.4\n0,24.423116,16.2113468,0,25.4,0,-25.4\n0,24.8585736,16.2113468,0,25.4,0,-25.4\n0,25.2813566,16.1071306,0,25.4,0,-25.4\n0,20.2000104,0.7497064,0,25.4,0,-25.4\n0,20.1527156,0.3298444,0,25.4,0,-25.4\n0,19.9648064,2.8372562,0,25.4,0,-25.4\n0,20.0741534,2.429129,0,25.4,0,-25.4\n0,20.1527156,2.0139914,0,25.4,0,-25.4\n0,20.2000104,1.5941294,0,25.4,0,-25.4\n0,20.2158092,1.1719306,0,25.4,0,-25.4\n0,20.0741534,25.3147068,0,25.4,0,-25.4\n0,19.9648064,24.906605,0,25.4,0,-25.4\n0,19.8252588,24.5077996,0,25.4,0,-25.4\n0,19.656298,24.1205512,0,25.4,0,-25.4\n0,19.4588892,23.7469934,0,25.4,0,-25.4\n0,19.2340992,23.3892344,0,25.4,0,-25.4\n0,18.983198,23.0492808,0,25.4,0,-25.4\n0,18.7075826,22.7290376,0,25.4,0,-25.4\n0,18.4088278,22.4302828,0,25.4,0,-25.4\n0,18.0885846,22.1546928,0,25.4,0,-25.4\n0,17.748631,21.9037916,0,25.4,0,-25.4\n0,17.390872,21.6790016,0,25.4,0,-25.4\n0,17.0173396,21.4815674,0,25.4,0,-25.4\n0,16.6300658,21.3126066,0,25.4,0,-25.4\n0,16.2312858,21.173059,0,25.4,0,-25.4\n0,15.8231586,21.063712,0,25.4,0,-25.4\n0,15.408021,20.9851752,0,25.4,0,-25.4\n0,14.988159,20.937855,0,25.4,0,-25.4\n0,14.5659602,20.9220562,0,25.4,0,-25.4\n0,14.143736,20.937855,0,25.4,0,-25.4\n0,13.723874,20.9851752,0,25.4,0,-25.4\n0,13.3087364,21.063712,0,25.4,0,-25.4\n0,12.9006346,21.173059,0,25.4,0,-25.4\n0,12.5018292,21.3126066,0,25.4,0,-25.4\n0,12.1145554,21.4815674,0,25.4,0,-25.4\n0,11.741023,21.6790016,0,25.4,0,-25.4\n0,11.383264,21.9037916,0,25.4,0,-25.4\n0,11.0433104,22.1546928,0,25.4,0,-25.4\n0,10.7230672,22.4302828,0,25.4,0,-25.4\n0,10.4243124,22.7290376,0,25.4,0,-25.4\n0,10.1487224,23.0492808,0,25.4,0,-25.4\n0,9.8978212,23.3892344,0,25.4,0,-25.4\n0,9.6730312,23.7469934,0,25.4,0,-25.4\n0,9.475597,24.1205512,0,25.4,0,-25.4\n0,9.3066362,24.5077996,0,25.4,0,-25.4\n0,9.1670886,24.906605,0,25.4,0,-25.4\n0,9.0577416,25.3147068,0,25.4,0,-25.4\n0,4.9846484,22.7875846,0,25.4,0,-25.4\n0,4.9126394,22.3637094,0,25.4,0,-25.4\n0,4.793615,21.9505276,0,25.4,0,-25.4\n0,4.6290738,21.553297,0,25.4,0,-25.4\n0,4.4210732,21.176996,0,25.4,0,-25.4\n0,4.1722802,20.8263236,0,25.4,0,-25.4\n0,3.8857682,20.5057248,0,25.4,0,-25.4\n0,3.5651694,20.2192128,0,25.4,0,-25.4\n0,3.214497,19.9703944,0,25.4,0,-25.4\n0,2.838196,19.7624192,0,25.4,0,-25.4\n0,2.44094,19.597878,0,25.4,0,-25.4\n0,2.0277836,19.4788536,0,25.4,0,-25.4\n0,0.321437,19.4788536,0,25.4,0,-25.4\n0,4.4210732,25.2567694,0,25.4,0,-25.4\n0,4.6290738,24.880443,0,25.4,0,-25.4\n0,4.793615,24.4832124,0,25.4,0,-25.4\n0,4.9126394,24.070056,0,25.4,0,-25.4\n0,4.9846484,23.6461554,0,25.4,0,-25.4\n0,5.008753,23.21687,0,25.4,0,-25.4\n0,25.3082552,19.597878,0,25.4,0,-25.4\n0,24.9110246,19.7624192,0,25.4,0,-25.4\n0,24.5347236,19.9703944,0,25.4,0,-25.4\n0,24.1840512,20.2192128,0,25.4,0,-25.4\n0,23.8634524,20.5057248,0,25.4,0,-25.4\n0,23.5769404,20.8263236,0,25.4,0,-25.4\n0,23.3281474,21.176996,0,25.4,0,-25.4\n0,23.1201468,21.553297,0,25.4,0,-25.4\n0,22.9556056,21.9505276,0,25.4,0,-25.4\n0,22.8365812,22.3637094,0,25.4,0,-25.4\n0,22.7645722,22.7875846,0,25.4,0,-25.4\n0,22.7404422,23.21687,0,25.4,0,-25.4\n0,22.7645722,23.6461554,0,25.4,0,-25.4\n0,22.8365812,24.070056,0,25.4,0,-25.4\n0,22.9556056,24.4832124,0,25.4,0,-25.4\n0,23.1201468,24.880443,0,25.4,0,-25.4\n0,23.3281474,25.2567694,0,25.4,0,-25.4\n")),N(O.ParsePatFile("\n*BUBBLES-03,BUBBLES-03\n;By John Hyslop, Using AutoCAD Lisp Tool\n;Developed in mm as metric QCAD3 pattern\n0,10.1887274,4.1559734,0,25.4,0,-25.4\n0,10.0855526,3.6595304,0,25.4,0,-25.4\n0,9.9157536,3.181731,0,25.4,0,-25.4\n0,9.68248,2.7315414,0,25.4,0,-25.4\n0,9.3900752,2.3172928,0,25.4,0,-25.4\n0,9.0439748,1.9467068,0,25.4,0,-25.4\n0,8.6506558,1.6267176,0,25.4,0,-25.4\n0,8.217408,1.3632688,0,25.4,0,-25.4\n0,7.752334,1.1612372,0,25.4,0,-25.4\n0,7.2640952,1.0244582,0,25.4,0,-25.4\n0,6.7617594,0.9553956,0,25.4,0,-25.4\n0,6.2546992,0.9553956,0,25.4,0,-25.4\n0,5.7523634,1.0244582,0,25.4,0,-25.4\n0,5.2641246,1.1612372,0,25.4,0,-25.4\n0,4.7990252,1.3632688,0,25.4,0,-25.4\n0,4.3658028,1.6267176,0,25.4,0,-25.4\n0,3.9724838,1.9467068,0,25.4,0,-25.4\n0,3.6263834,2.3172928,0,25.4,0,-25.4\n0,3.3339786,2.7315414,0,25.4,0,-25.4\n0,3.100705,3.181731,0,25.4,0,-25.4\n0,2.9308806,3.6595304,0,25.4,0,-25.4\n0,2.8277312,4.1559734,0,25.4,0,-25.4\n0,2.7931364,4.6618398,0,25.4,0,-25.4\n0,2.8277312,5.1677062,0,25.4,0,-25.4\n0,2.9308806,5.6641746,0,25.4,0,-25.4\n0,3.100705,6.1419486,0,25.4,0,-25.4\n0,3.3339786,6.5921382,0,25.4,0,-25.4\n0,3.6263834,7.0063868,0,25.4,0,-25.4\n0,3.9724838,7.3769728,0,25.4,0,-25.4\n0,4.3658028,7.696962,0,25.4,0,-25.4\n0,4.7990252,7.9604362,0,25.4,0,-25.4\n0,5.2641246,8.1624424,0,25.4,0,-25.4\n0,5.7523634,8.2992468,0,25.4,0,-25.4\n0,6.2546992,8.368284,0,25.4,0,-25.4\n0,6.7617594,8.368284,0,25.4,0,-25.4\n0,7.2640952,8.2992468,0,25.4,0,-25.4\n0,7.752334,8.1624424,0,25.4,0,-25.4\n0,8.217408,7.9604362,0,25.4,0,-25.4\n0,8.6506558,7.696962,0,25.4,0,-25.4\n0,9.0439748,7.3769728,0,25.4,0,-25.4\n0,9.3900752,7.0063868,0,25.4,0,-25.4\n0,9.68248,6.5921382,0,25.4,0,-25.4\n0,9.9157536,6.1419486,0,25.4,0,-25.4\n0,10.0855526,5.6641746,0,25.4,0,-25.4\n0,10.1887274,5.1677062,0,25.4,0,-25.4\n0,10.2233222,4.6618398,0,25.4,0,-25.4\n0,18.2143908,14.7408138,0,25.4,0,-25.4\n0,17.687036,14.9496018,0,25.4,0,-25.4\n0,17.1900342,15.222855,0,25.4,0,-25.4\n0,16.7311578,15.55623,0,25.4,0,-25.4\n0,16.317722,15.9444944,0,25.4,0,-25.4\n0,15.9561784,16.3815014,0,25.4,0,-25.4\n0,15.6522674,16.860393,0,25.4,0,-25.4\n0,15.4107896,17.3736,0,25.4,0,-25.4\n0,15.2355042,17.9130198,0,25.4,0,-25.4\n0,15.1292306,18.4701434,0,25.4,0,-25.4\n0,15.0936198,19.0362078,0,25.4,0,-25.4\n0,15.1292306,19.6022722,0,25.4,0,-25.4\n0,15.2355042,20.1593958,0,25.4,0,-25.4\n0,15.4107896,20.6988156,0,25.4,0,-25.4\n0,18.1163722,0.530352,0,25.4,0,-25.4\n0,17.4814484,0.5615432,0,25.4,0,-25.4\n0,16.8526714,0.654812,0,25.4,0,-25.4\n0,16.236061,0.8092694,0,25.4,0,-25.4\n0,15.6375354,1.0234168,0,25.4,0,-25.4\n0,15.0629112,1.2951968,0,25.4,0,-25.4\n0,14.5176748,1.6219932,0,25.4,0,-25.4\n0,14.0071094,2.0006564,0,25.4,0,-25.4\n0,13.5361172,2.4275542,0,25.4,0,-25.4\n0,13.1092194,2.8985464,0,25.4,0,-25.4\n0,12.7305562,3.4091372,0,25.4,0,-25.4\n0,12.4037598,3.9543482,0,25.4,0,-25.4\n0,12.1319798,4.5289978,0,25.4,0,-25.4\n0,11.9178324,5.127498,0,25.4,0,-25.4\n0,11.763375,5.7441084,0,25.4,0,-25.4\n0,11.6701062,6.3729108,0,25.4,0,-25.4\n0,11.638915,7.0078092,0,25.4,0,-25.4\n0,11.6701062,7.6427076,0,25.4,0,-25.4\n0,11.763375,8.2714846,0,25.4,0,-25.4\n0,11.9178324,8.8881204,0,25.4,0,-25.4\n0,12.1319798,9.4866206,0,25.4,0,-25.4\n0,12.4037598,10.0612702,0,25.4,0,-25.4\n0,12.7305562,10.6064812,0,25.4,0,-25.4\n0,13.1092194,11.117072,0,25.4,0,-25.4\n0,13.5361172,11.5880642,0,25.4,0,-25.4\n0,14.0071094,12.0149366,0,25.4,0,-25.4\n0,14.5176748,12.3936252,0,25.4,0,-25.4\n0,15.0629112,12.7204216,0,25.4,0,-25.4\n0,15.6375354,12.9922016,0,25.4,0,-25.4\n0,16.236061,13.206349,0,25.4,0,-25.4\n0,16.8526714,13.3608064,0,25.4,0,-25.4\n0,17.4814484,13.4540752,0,25.4,0,-25.4\n0,18.1163722,13.4852664,0,25.4,0,-25.4\n0,14.3025876,16.7496744,0,25.4,0,-25.4\n0,14.1946122,16.0217104,0,25.4,0,-25.4\n0,14.0157962,15.3078434,0,25.4,0,-25.4\n0,13.7678668,14.6149568,0,25.4,0,-25.4\n0,13.453237,13.94968,0,25.4,0,-25.4\n0,13.0748786,13.3184646,0,25.4,0,-25.4\n0,12.6365,12.7273558,0,25.4,0,-25.4\n0,12.1422922,12.1820686,0,25.4,0,-25.4\n0,11.597005,11.6878608,0,25.4,0,-25.4\n0,11.0058962,11.2494822,0,25.4,0,-25.4\n0,10.3746808,10.8711492,0,25.4,0,-25.4\n0,9.7094294,10.556494,0,25.4,0,-25.4\n0,9.0165174,10.3085646,0,25.4,0,-25.4\n0,8.3026504,10.1297486,0,25.4,0,-25.4\n0,7.5746864,10.0217732,0,25.4,0,-25.4\n0,6.8396612,9.9856544,0,25.4,0,-25.4\n0,6.1046106,10.0217732,0,25.4,0,-25.4\n0,5.376672,10.1297486,0,25.4,0,-25.4\n0,4.662805,10.3085646,0,25.4,0,-25.4\n0,3.969893,10.556494,0,25.4,0,-25.4\n0,3.3046416,10.8711492,0,25.4,0,-25.4\n0,2.6734008,11.2494822,0,25.4,0,-25.4\n0,2.0823174,11.6878608,0,25.4,0,-25.4\n0,1.5370302,12.1820686,0,25.4,0,-25.4\n0,1.0428224,12.7273558,0,25.4,0,-25.4\n0,0.6044184,13.3184646,0,25.4,0,-25.4\n0,0.2260854,13.94968,0,25.4,0,-25.4\n0,13.7678668,20.3544678,0,25.4,0,-25.4\n0,14.0157962,19.6615558,0,25.4,0,-25.4\n0,14.1946122,18.9476888,0,25.4,0,-25.4\n0,14.3025876,18.2197502,0,25.4,0,-25.4\n0,14.3387064,17.4846996,0,25.4,0,-25.4\n0,25.3114302,14.6149568,0,25.4,0,-25.4\n0,25.0635262,15.3078434,0,25.4,0,-25.4\n0,24.8847102,16.0217104,0,25.4,0,-25.4\n0,24.7767094,16.7496744,0,25.4,0,-25.4\n0,24.740616,17.4846996,0,25.4,0,-25.4\n0,24.7767094,18.2197502,0,25.4,0,-25.4\n0,24.8847102,18.9476888,0,25.4,0,-25.4\n0,25.0635262,19.6615558,0,25.4,0,-25.4\n0,25.3114302,20.3544678,0,25.4,0,-25.4\n0,24.090884,18.4701434,0,25.4,0,-25.4\n0,23.984585,17.9130198,0,25.4,0,-25.4\n0,23.809325,17.3736,0,25.4,0,-25.4\n0,23.5678472,16.860393,0,25.4,0,-25.4\n0,23.2639362,16.3815014,0,25.4,0,-25.4\n0,22.9023926,15.9444944,0,25.4,0,-25.4\n0,22.4889314,15.55623,0,25.4,0,-25.4\n0,22.0300804,15.222855,0,25.4,0,-25.4\n0,21.5330532,14.9496018,0,25.4,0,-25.4\n0,21.0056984,14.7408138,0,25.4,0,-25.4\n0,20.4563472,14.5997676,0,25.4,0,-25.4\n0,19.8936356,14.528673,0,25.4,0,-25.4\n0,19.3264536,14.528673,0,25.4,0,-25.4\n0,18.7637674,14.5997676,0,25.4,0,-25.4\n0,15.6522674,21.2120226,0,25.4,0,-25.4\n0,15.9561784,21.6908888,0,25.4,0,-25.4\n0,16.317722,22.1279212,0,25.4,0,-25.4\n0,16.7311578,22.5161856,0,25.4,0,-25.4\n0,17.1900342,22.8495606,0,25.4,0,-25.4\n0,17.687036,23.1227884,0,25.4,0,-25.4\n0,18.2143908,23.3315764,0,25.4,0,-25.4\n0,18.7637674,23.472648,0,25.4,0,-25.4\n0,19.3264536,23.5437172,0,25.4,0,-25.4\n0,19.8936356,23.5437172,0,25.4,0,-25.4\n0,20.4563472,23.472648,0,25.4,0,-25.4\n0,21.0056984,23.3315764,0,25.4,0,-25.4\n0,21.5330532,23.1227884,0,25.4,0,-25.4\n0,22.0300804,22.8495606,0,25.4,0,-25.4\n0,22.4889314,22.5161856,0,25.4,0,-25.4\n0,22.9023926,22.1279212,0,25.4,0,-25.4\n0,23.2639362,21.6908888,0,25.4,0,-25.4\n0,23.5678472,21.2120226,0,25.4,0,-25.4\n0,23.809325,20.6988156,0,25.4,0,-25.4\n0,23.984585,20.1593958,0,25.4,0,-25.4\n0,24.090884,19.6022722,0,25.4,0,-25.4\n0,24.1264948,19.0362078,0,25.4,0,-25.4\n0,24.5626128,6.3729108,0,25.4,0,-25.4\n0,24.469344,5.7441084,0,25.4,0,-25.4\n0,24.3148866,5.127498,0,25.4,0,-25.4\n0,24.1007392,4.5289978,0,25.4,0,-25.4\n0,23.8289592,3.9543482,0,25.4,0,-25.4\n0,23.5021628,3.4091372,0,25.4,0,-25.4\n0,23.1234996,2.8985464,0,25.4,0,-25.4\n0,22.6966018,2.4275542,0,25.4,0,-25.4\n0,22.2256096,2.0006564,0,25.4,0,-25.4\n0,21.7150442,1.6219932,0,25.4,0,-25.4\n0,21.1698078,1.2951968,0,25.4,0,-25.4\n0,20.5951836,1.0234168,0,25.4,0,-25.4\n0,19.996658,0.8092694,0,25.4,0,-25.4\n0,19.3800476,0.654812,0,25.4,0,-25.4\n0,18.7512706,0.5615432,0,25.4,0,-25.4\n0,18.7512706,13.4540752,0,25.4,0,-25.4\n0,19.3800476,13.3608064,0,25.4,0,-25.4\n0,19.996658,13.206349,0,25.4,0,-25.4\n0,20.5951836,12.9922016,0,25.4,0,-25.4\n0,21.1698078,12.7204216,0,25.4,0,-25.4\n0,21.7150442,12.3936252,0,25.4,0,-25.4\n0,22.2256096,12.0149366,0,25.4,0,-25.4\n0,22.6966018,11.5880642,0,25.4,0,-25.4\n0,23.1234996,11.117072,0,25.4,0,-25.4\n0,23.5021628,10.6064812,0,25.4,0,-25.4\n0,23.8289592,10.0612702,0,25.4,0,-25.4\n0,24.1007392,9.4866206,0,25.4,0,-25.4\n0,24.3148866,8.8881204,0,25.4,0,-25.4\n0,24.469344,8.2714846,0,25.4,0,-25.4\n0,24.5626128,7.6427076,0,25.4,0,-25.4\n0,24.593804,7.0078092,0,25.4,0,-25.4\n0,12.6365,22.2420434,0,25.4,0,-25.4\n0,13.0748786,21.65096,0,25.4,0,-25.4\n0,13.453237,21.0197446,0,25.4,0,-25.4\n0,0.2260854,21.0197446,0,25.4,0,-25.4\n0,0.6044184,21.65096,0,25.4,0,-25.4\n0,1.0428224,22.2420434,0,25.4,0,-25.4\n0,1.5370302,22.7873306,0,25.4,0,-25.4\n0,2.0823174,23.2815638,0,25.4,0,-25.4\n0,2.6734008,23.7199424,0,25.4,0,-25.4\n0,3.3046416,24.0982754,0,25.4,0,-25.4\n0,3.969893,24.4129306,0,25.4,0,-25.4\n0,4.662805,24.66086,0,25.4,0,-25.4\n0,5.376672,24.839676,0,25.4,0,-25.4\n0,6.1046106,24.9476514,0,25.4,0,-25.4\n0,6.8396612,24.9837448,0,25.4,0,-25.4\n0,7.5746864,24.9476514,0,25.4,0,-25.4\n0,8.3026504,24.839676,0,25.4,0,-25.4\n0,9.0165174,24.66086,0,25.4,0,-25.4\n0,9.7094294,24.4129306,0,25.4,0,-25.4\n0,10.3746808,24.0982754,0,25.4,0,-25.4\n0,11.0058962,23.7199424,0,25.4,0,-25.4\n0,11.597005,23.2815638,0,25.4,0,-25.4\n0,12.1422922,22.7873306,0,25.4,0,-25.4\n")),N(O.ParsePatFile("\n*CELTIC-01,CELTIC PATTERN 01\n;By John Hyslop\n;Developed in mm as Metric QCAD3 pattern\n135,9.144,10.72444439,17.96051221,17.96051221,2.235085954,-33.68593847\n135,10.72444439,9.934222194,17.96051221,17.96051221,6.565564974,-29.35545945\n315,9.934222194,14.67555561,17.96051221,17.96051221,2.235085954,-33.68593847\n315,7.662333418,16.15722219,17.96051221,17.96051221,6.565564974,-29.35545945\n225,19.31811122,10.82322219,17.96051221,17.96051221,2.235085954,-33.68593847\n225,21.98511122,12.7,17.96051221,17.96051221,7.124336526,-28.7966879\n225,21.68877781,8.452555612,17.96051221,17.96051221,2.235085954,-33.68593847\n225,25.146,12.7,17.96051221,17.96051221,9.35942248,-26.56160194\n225,19.31811122,18.52788878,17.96051221,17.96051221,2.235085954,-33.68593847\n225,21.68877781,16.15722219,17.96051221,17.96051221,2.235085954,-33.68593847\n90,25.146,22.91091405,0,25.4,2.235085954,-23.16491405\n0,22.91091405,22.35214249,0,25.4,2.235085954,-23.16491405\n0,21.33046966,22.91091405,0,25.4,3.815530342,-21.58446966\n0,20.40466658,25.146,0,25.4,4.741333418,-20.65866658\n90,22.91091405,21.33046966,0,25.4,1.021672836,-24.37832716\n90,25.146,20.40466658,0,25.4,1.947475912,-23.45252409\n180,2.489085954,25.146,0,25.4,2.235085954,-23.16491405\n90,3.047857506,22.91091405,0,25.4,2.235085954,-23.16491405\n90,2.489085954,21.33046966,0,25.4,3.815530342,-21.58446966\n90,0.254,20.40466658,0,25.4,4.741333418,-20.65866658\n180,4.069530342,22.91091405,0,25.4,1.021672836,-24.37832716\n180,4.995333418,25.146,0,25.4,1.947475912,-23.45252409\n270,0.254,2.489085954,0,25.4,2.235085954,-23.16491405\n180,2.489085954,3.047857506,0,25.4,2.235085954,-23.16491405\n180,4.069530342,2.489085954,0,25.4,3.815530342,-21.58446966\n180,4.995333418,0.254,0,25.4,4.741333418,-20.65866658\n270,2.489085954,4.069530342,0,25.4,1.021672836,-24.37832716\n270,0.254,4.995333418,0,25.4,1.947475912,-23.45252409\n45,17.83644439,13.09511122,17.96051221,17.96051221,10.3372727,-25.58375198\n45,13.09511122,7.563555612,17.96051221,17.96051221,2.235085954,-33.68593847\n45,10.82322219,6.081888776,17.96051221,17.96051221,6.565564974,-29.35545945\n45,4.995333418,0.254,17.96051221,17.96051221,4.889250572,-31.03177385\n45,16.256,14.67555561,17.96051221,17.96051221,9.41146962,-26.5095548\n45,10.72444439,9.934222194,17.96051221,17.96051221,2.235085954,-33.68593847\n45,9.242777806,7.662333418,17.96051221,17.96051221,6.565564974,-29.35545945\n45,4.069530342,2.489085954,17.96051221,17.96051221,3.96344775,-31.95757693\n45,16.94744439,21.68877781,17.96051221,17.96051221,4.889250572,-31.03177385\n45,10.72444439,16.256,17.96051221,17.96051221,2.235085954,-33.68593847\n45,3.711222194,9.242777806,17.96051221,17.96051221,2.235085954,-33.68593847\n45,9.934222194,14.67555561,17.96051221,17.96051221,6.565564974,-29.35545945\n45,0.254,4.995333418,17.96051221,17.96051221,10.3372727,-25.58375198\n45,18.52788878,20.10833342,17.96051221,17.96051221,3.96344775,-31.95757693\n45,6.081888776,6.872111224,17.96051221,17.96051221,2.235085954,-33.68593847\n45,13.09511122,13.88533342,17.96051221,17.96051221,2.235085954,-33.68593847\n45,11.51466658,13.09511122,17.96051221,17.96051221,6.565564974,-29.35545945\n45,2.489085954,4.069530342,17.96051221,17.96051221,9.41146962,-26.5095548\n0,22.91091405,0.254,0,25.4,2.235085954,-23.16491405\n135,17.83644439,13.09511122,17.96051221,17.96051221,2.235085954,-33.68593847\n135,10.82322219,20.10833342,17.96051221,17.96051221,2.235085954,-33.68593847\n135,12.30488878,17.83644439,17.96051221,17.96051221,10.3372727,-25.58375198\n135,19.31811122,10.82322219,17.96051221,17.96051221,6.565564974,-29.35545945\n135,25.146,4.995333418,17.96051221,17.96051221,4.889250572,-31.03177385\n135,8.452555612,17.73766658,17.96051221,17.96051221,2.235085954,-33.68593847\n135,10.72444439,16.256,17.96051221,17.96051221,9.41146962,-26.5095548\n135,15.46577781,10.72444439,17.96051221,17.96051221,2.235085954,-33.68593847\n135,17.73766658,9.242777806,17.96051221,17.96051221,6.565564974,-29.35545945\n135,22.91091405,4.069530342,17.96051221,17.96051221,3.96344775,-31.95757693\n135,16.15722219,3.711222194,17.96051221,17.96051221,2.235085954,-33.68593847\n135,3.711222194,16.94744439,17.96051221,17.96051221,4.889250572,-31.03177385\n135,20.40466658,0.254,17.96051221,17.96051221,10.3372727,-25.58375198\n135,18.52788878,6.081888776,17.96051221,17.96051221,2.235085954,-33.68593847\n135,5.291666582,18.52788878,17.96051221,17.96051221,3.96344775,-31.95757693\n135,21.33046966,2.489085954,17.96051221,17.96051221,9.41146962,-26.5095548\n270,22.35214249,2.489085954,0,25.4,2.235085954,-23.16491405\n270,22.91091405,4.069530342,0,25.4,3.815530342,-21.58446966\n270,25.146,4.995333418,0,25.4,4.741333418,-20.65866658\n0,21.33046966,2.489085954,0,25.4,1.021672836,-24.37832716\n0,20.40466658,0.254,0,25.4,1.947475912,-23.45252409\n135,25.146,12.7,17.96051221,17.96051221,4.889250572,-31.03177385\n45,12.7,0.254,17.96051221,17.96051221,4.889250572,-31.03177385\n315,6.872111224,5.291666582,17.96051221,17.96051221,2.235085954,-33.68593847\n315,6.081888776,6.872111224,17.96051221,17.96051221,9.35942248,-26.56160194\n315,0.254,12.7,17.96051221,17.96051221,4.889250572,-31.03177385\n225,5.291666582,18.52788878,17.96051221,17.96051221,2.235085954,-33.68593847\n225,6.872111224,19.31811122,17.96051221,17.96051221,9.35942248,-26.56160194\n225,12.7,25.146,17.96051221,17.96051221,4.889250572,-31.03177385\n135,18.52788878,20.10833342,17.96051221,17.96051221,2.235085954,-33.68593847\n135,19.31811122,18.52788878,17.96051221,17.96051221,9.35942248,-26.56160194\n135,21.98511122,12.7,17.96051221,17.96051221,2.654164618,-33.26685981\n45,12.7,3.414888776,17.96051221,17.96051221,2.654164618,-33.26685981\n315,9.242777806,7.662333418,17.96051221,17.96051221,2.235085954,-33.68593847\n315,7.662333418,8.452555612,17.96051221,17.96051221,7.124336526,-28.7966879\n315,3.414888776,12.7,17.96051221,17.96051221,2.654164618,-33.26685981\n225,7.662333418,16.15722219,17.96051221,17.96051221,2.235085954,-33.68593847\n225,8.452555612,17.73766658,17.96051221,17.96051221,7.124336526,-28.7966879\n225,12.7,21.98511122,17.96051221,17.96051221,2.654164618,-33.26685981\n135,16.15722219,17.73766658,17.96051221,17.96051221,2.235085954,-33.68593847\n135,17.73766658,16.94744439,17.96051221,17.96051221,7.124336526,-28.7966879\n")),N(O.ParsePatFile("\n*CELTIC-02,CELTIC PATTERN 02\n;By John Hyslop\n;Developed in mm as Metric QCAD3 pattern,,,,,,\n180,11.1371634,0.392662664,0,25.4,3.125672946,-22.27432705\n270,25.00733734,11.1371634,0,25.4,3.125672946,-22.27432705\n270,0.392662664,17.38850955,0,25.4,3.125672946,-22.27432705\n180,17.38850955,25.00733734,0,25.4,3.125672946,-22.27432705\n90,25.00733734,11.9185817,0,25.4,13.08875564,-12.31124436\n270,25.00733734,7.230072408,0,25.4,6.837409744,-18.56259026\n180,11.1371634,7.230072408,0,25.4,3.125672946,-22.27432705\n180,13.4814183,8.011490454,0,25.4,9.18166439,-16.21833561\n0,8.011490454,11.9185817,0,25.4,3.125672946,-22.27432705\n0,4.29975391,11.1371634,0,25.4,9.18166439,-16.21833561\n270,21.10024609,17.38850955,0,25.4,3.125672946,-22.27432705\n270,21.88166439,21.88166439,0,25.4,9.96308269,-15.43691731\n270,13.4814183,25.00733734,0,25.4,3.125672946,-22.27432705\n270,18.16992759,25.00733734,0,25.4,3.125672946,-22.27432705\n90,17.38850955,18.16992759,0,25.4,6.837409744,-18.56259026\n90,18.16992759,8.011490454,0,25.4,3.125672946,-22.27432705\n90,17.38850955,4.29975391,0,25.4,9.18166439,-16.21833561\n90,14.2628366,18.16992759,0,25.4,6.837409744,-18.56259026\n90,13.4814183,8.011490454,0,25.4,3.125672946,-22.27432705\n90,14.2628366,4.29975391,0,25.4,9.18166439,-16.21833561\n90,7.230072408,14.2628366,0,25.4,3.125672946,-22.27432705\n90,7.230072408,0.392662664,0,25.4,3.125672946,-22.27432705\n90,8.011490454,11.9185817,0,25.4,9.18166439,-16.21833561\n90,8.011490454,0.392662664,0,25.4,6.837409744,-18.56259026\n90,11.9185817,0.392662664,0,25.4,3.125672946,-22.27432705\n90,11.9185817,14.2628366,0,25.4,3.125672946,-22.27432705\n90,11.1371634,11.9185817,0,25.4,9.18166439,-16.21833561\n90,11.1371634,0.392662664,0,25.4,6.837409744,-18.56259026\n180,17.38850955,18.16992759,0,25.4,3.125672946,-22.27432705\n180,3.51833561,18.16992759,0,25.4,3.125672946,-22.27432705\n180,7.230072408,17.38850955,0,25.4,6.837409744,-18.56259026\n180,21.10024609,17.38850955,0,25.4,9.18166439,-16.21833561\n180,3.51833561,13.4814183,0,25.4,3.125672946,-22.27432705\n180,7.230072408,14.2628366,0,25.4,6.837409744,-18.56259026\n180,17.38850955,13.4814183,0,25.4,3.125672946,-22.27432705\n180,21.10024609,14.2628366,0,25.4,9.18166439,-16.21833561\n180,25.00733734,7.230072408,0,25.4,3.125672946,-22.27432705\n180,25.00733734,8.011490454,0,25.4,6.837409744,-18.56259026\n180,25.00733734,11.9185817,0,25.4,3.125672946,-22.27432705\n180,25.00733734,11.1371634,0,25.4,6.837409744,-18.56259026\n180,25.00733734,25.00733734,0,25.4,6.837409744,-18.56259026\n0,11.9185817,0.392662664,0,25.4,13.08875564,-12.31124436\n0,0.392662664,0.392662664,0,25.4,6.837409744,-18.56259026\n270,0.392662664,13.4814183,0,25.4,13.08875564,-12.31124436\n270,0.392662664,25.00733734,0,25.4,6.837409744,-18.56259026\n180,13.4814183,25.00733734,0,25.4,13.08875564,-12.31124436\n180,21.88166439,21.88166439,0,25.4,3.711736544,-21.68826346\n90,21.88166439,3.51833561,0,25.4,3.711736544,-21.68826346\n0,14.2628366,4.29975391,0,25.4,3.125672946,-22.27432705\n0,11.9185817,3.51833561,0,25.4,9.96308269,-15.43691731\n0,3.51833561,3.51833561,0,25.4,3.711736544,-21.68826346\n270,4.29975391,11.1371634,0,25.4,3.125672946,-22.27432705\n270,3.51833561,13.4814183,0,25.4,9.96308269,-15.43691731\n270,3.51833561,21.88166439,0,25.4,3.711736544,-21.68826346\n180,11.1371634,21.10024609,0,25.4,3.125672946,-22.27432705\n180,13.4814183,21.88166439,0,25.4,9.96308269,-15.43691731\n")),N(O.ParsePatFile("\n*CELTIC-03,CELTIC-03\n;By John Hyslop, Using AutoCAD Lisp Tool\n;Developed in inch as imperial QCAD3 pattern\n90,6.35,13.97,0,25.4,5.08,-20.32\n90,19.05,6.35,0,25.4,5.08,-20.32\n0,6.35,6.35,0,25.4,12.7,-12.7\n270,6.35,11.43,0,25.4,5.08,-20.32\n90,3.81,3.81,0,25.4,7.62,-17.78\n180,21.59,3.81,0,25.4,17.78,-7.62\n270,21.59,11.43,0,25.4,7.62,-17.78\n270,21.59,21.59,0,25.4,7.62,-17.78\n0,3.81,21.59,0,25.4,17.78,-7.62\n90,3.81,13.97,0,25.4,7.62,-17.78\n270,19.05,19.05,0,25.4,5.08,-20.32\n0,6.35,19.05,0,25.4,12.7,-12.7\n90,13.97,6.35,0,25.4,12.7,-12.7\n90,11.43,6.35,0,25.4,12.7,-12.7\n270,13.97,3.81,0,25.4,7.62,-17.78\n90,11.43,-3.81,0,25.4,7.62,-17.78\n180,11.43,11.43,0,25.4,22.86,-2.54\n0,-11.43,13.97,0,25.4,22.86,-2.54\n")),N(O.ParsePatFile("\n*CELTIC-04,CELTIC-04\n;By John Hyslop, Using AutoCAD Lisp Tool\n;Developed in mm as metric QCAD3 pattern\n45,3.81,13.97,17.960512212,17.960512212,12.57235865,-23.348666028\n135,21.59,13.97,17.960512212,17.960512212,12.57235865,-23.348666028\n45,12.7,2.54,17.960512212,17.960512212,12.57235865,-23.348666028\n315,3.81,11.43,17.960512212,17.960512212,12.57235865,-23.348666028\n135,12.7,5.08,17.960512212,17.960512212,8.980256106,-26.940768318\n225,19.05,11.43,17.960512212,17.960512212,8.980256106,-26.940768318\n315,12.7,20.32,17.960512212,17.960512212,8.980256106,-26.940768318\n45,6.35,13.97,17.960512212,17.960512212,8.980256106,-26.940768318\n90,13.97,6.35,0,25.4,12.7,-12.7\n90,11.43,6.35,0,25.4,12.7,-12.7\n270,13.97,3.81,0,25.4,7.62,-17.78\n90,11.43,-3.81,0,25.4,7.62,-17.78\n180,11.43,11.43,0,25.4,22.86,-2.54\n0,-11.43,13.97,0,25.4,22.86,-2.54\n")),N(O.ParsePatFile("\n*CIRCLES-02,CIRCLES-02\n;By John Hyslop\n;Developed in mm as Metric QCAD3 pattern\n0,24.3609368,11.9663464,0,25.4,0,-25.4\n0,24.2918742,11.2356138,0,25.4,0,-25.4\n0,24.1770408,10.510647,0,25.4,0,-25.4\n0,24.0169192,9.7943162,0,25.4,0,-25.4\n0,23.8121444,9.0894408,0,25.4,0,-25.4\n0,23.5635038,8.3988402,0,25.4,0,-25.4\n0,23.271988,7.7252068,0,25.4,0,-25.4\n0,22.9387654,7.0711822,0,25.4,0,-25.4\n0,22.5651314,6.439408,0,25.4,0,-25.4\n0,22.1525592,5.8323226,0,25.4,0,-25.4\n0,21.7026744,5.252339,0,25.4,0,-25.4\n0,21.2172804,4.7017432,0,25.4,0,-25.4\n0,20.6982568,4.1827196,0,25.4,0,-25.4\n0,20.147661,3.6973256,0,25.4,0,-25.4\n0,19.5676774,3.2474408,0,25.4,0,-25.4\n0,18.960592,2.8348686,0,25.4,0,-25.4\n0,18.3288178,2.4612346,0,25.4,0,-25.4\n0,17.6747932,2.128012,0,25.4,0,-25.4\n0,17.0011598,1.8364962,0,25.4,0,-25.4\n0,16.3105592,1.5878556,0,25.4,0,-25.4\n0,15.6056838,1.3830808,0,25.4,0,-25.4\n0,14.889353,1.2229592,0,25.4,0,-25.4\n0,14.1643862,1.1081258,0,25.4,0,-25.4\n0,13.4336536,1.0390632,0,25.4,0,-25.4\n0,12.7,1.016,0,25.4,0,-25.4\n0,11.9663464,1.0390632,0,25.4,0,-25.4\n0,11.2356138,1.1081258,0,25.4,0,-25.4\n0,10.510647,1.2229592,0,25.4,0,-25.4\n0,9.7943162,1.3830808,0,25.4,0,-25.4\n0,9.0894408,1.5878556,0,25.4,0,-25.4\n0,8.3988402,1.8364962,0,25.4,0,-25.4\n0,7.7252068,2.128012,0,25.4,0,-25.4\n0,7.0711822,2.4612346,0,25.4,0,-25.4\n0,6.439408,2.8348686,0,25.4,0,-25.4\n0,5.8323226,3.2474408,0,25.4,0,-25.4\n0,5.252339,3.6973256,0,25.4,0,-25.4\n0,4.7017432,4.1827196,0,25.4,0,-25.4\n0,4.1827196,4.7017432,0,25.4,0,-25.4\n0,3.6973256,5.252339,0,25.4,0,-25.4\n0,3.2474408,5.8323226,0,25.4,0,-25.4\n0,2.8348686,6.439408,0,25.4,0,-25.4\n0,2.4612346,7.0711822,0,25.4,0,-25.4\n0,2.128012,7.7252068,0,25.4,0,-25.4\n0,1.8364962,8.3988402,0,25.4,0,-25.4\n0,1.5878556,9.0894408,0,25.4,0,-25.4\n0,1.3830808,9.7943162,0,25.4,0,-25.4\n0,1.2229592,10.510647,0,25.4,0,-25.4\n0,1.1081258,11.2356138,0,25.4,0,-25.4\n0,1.0390632,11.9663464,0,25.4,0,-25.4\n0,1.016,12.7,0,25.4,0,-25.4\n0,1.0390632,13.4336536,0,25.4,0,-25.4\n0,1.1081258,14.1643862,0,25.4,0,-25.4\n0,1.2229592,14.889353,0,25.4,0,-25.4\n0,1.3830808,15.6056838,0,25.4,0,-25.4\n0,1.5878556,16.3105592,0,25.4,0,-25.4\n0,1.8364962,17.0011598,0,25.4,0,-25.4\n0,2.128012,17.6747932,0,25.4,0,-25.4\n0,2.4612346,18.3288178,0,25.4,0,-25.4\n0,2.8348686,18.960592,0,25.4,0,-25.4\n0,3.2474408,19.5676774,0,25.4,0,-25.4\n0,3.6973256,20.147661,0,25.4,0,-25.4\n0,4.1827196,20.6982568,0,25.4,0,-25.4\n0,4.7017432,21.2172804,0,25.4,0,-25.4\n0,5.252339,21.7026744,0,25.4,0,-25.4\n0,5.8323226,22.1525592,0,25.4,0,-25.4\n0,6.439408,22.5651314,0,25.4,0,-25.4\n0,7.0711822,22.9387654,0,25.4,0,-25.4\n0,7.7252068,23.271988,0,25.4,0,-25.4\n0,8.3988402,23.5635038,0,25.4,0,-25.4\n0,9.0894408,23.8121444,0,25.4,0,-25.4\n0,9.7943162,24.0169192,0,25.4,0,-25.4\n0,10.510647,24.1770408,0,25.4,0,-25.4\n0,11.2356138,24.2918742,0,25.4,0,-25.4\n0,11.9663464,24.3609368,0,25.4,0,-25.4\n0,12.7,24.384,0,25.4,0,-25.4\n0,13.4336536,24.3609368,0,25.4,0,-25.4\n0,14.1643862,24.2918742,0,25.4,0,-25.4\n0,14.889353,24.1770408,0,25.4,0,-25.4\n0,15.6056838,24.0169192,0,25.4,0,-25.4\n0,16.3105592,23.8121444,0,25.4,0,-25.4\n0,17.0011598,23.5635038,0,25.4,0,-25.4\n0,17.6747932,23.271988,0,25.4,0,-25.4\n0,18.3288178,22.9387654,0,25.4,0,-25.4\n0,18.960592,22.5651314,0,25.4,0,-25.4\n0,19.5676774,22.1525592,0,25.4,0,-25.4\n0,20.147661,21.7026744,0,25.4,0,-25.4\n0,20.6982568,21.2172804,0,25.4,0,-25.4\n0,21.2172804,20.6982568,0,25.4,0,-25.4\n0,21.7026744,20.147661,0,25.4,0,-25.4\n0,22.1525592,19.5676774,0,25.4,0,-25.4\n0,22.5651314,18.960592,0,25.4,0,-25.4\n0,22.9387654,18.3288178,0,25.4,0,-25.4\n0,23.271988,17.6747932,0,25.4,0,-25.4\n0,23.5635038,17.0011598,0,25.4,0,-25.4\n0,23.8121444,16.3105592,0,25.4,0,-25.4\n0,24.0169192,15.6056838,0,25.4,0,-25.4\n0,24.1770408,14.889353,0,25.4,0,-25.4\n0,24.2918742,14.1643862,0,25.4,0,-25.4\n0,24.3609368,13.4336536,0,25.4,0,-25.4\n0,24.384,12.7,0,25.4,0,-25.4\n")),N(O.ParsePatFile("\n*CIRCLES,CIRCLES\n;By John Hyslop\n;Developed in mm as Metric QCAD3 pattern\n0,23.7384082,10.9516926,0,25.4,0,-25.4\n0,23.329011,9.2464382,0,25.4,0,-25.4\n0,22.6578922,7.6261976,0,25.4,0,-25.4\n0,21.7415618,6.1308996,0,25.4,0,-25.4\n0,20.6026258,4.7973742,0,25.4,0,-25.4\n0,19.2691004,3.6584382,0,25.4,0,-25.4\n0,17.7738024,2.7421078,0,25.4,0,-25.4\n0,16.1535618,2.070989,0,25.4,0,-25.4\n0,14.4483074,1.6615918,0,25.4,0,-25.4\n0,12.7,1.524,0,25.4,0,-25.4\n0,10.9516926,1.6615918,0,25.4,0,-25.4\n0,9.2464382,2.070989,0,25.4,0,-25.4\n0,7.6261976,2.7421078,0,25.4,0,-25.4\n0,6.1308996,3.6584382,0,25.4,0,-25.4\n0,4.7973742,4.7973742,0,25.4,0,-25.4\n0,3.6584382,6.1308996,0,25.4,0,-25.4\n0,2.7421078,7.6261976,0,25.4,0,-25.4\n0,2.070989,9.2464382,0,25.4,0,-25.4\n0,1.6615918,10.9516926,0,25.4,0,-25.4\n0,1.524,12.7,0,25.4,0,-25.4\n0,1.6615918,14.4483074,0,25.4,0,-25.4\n0,2.070989,16.1535618,0,25.4,0,-25.4\n0,2.7421078,17.7738024,0,25.4,0,-25.4\n0,3.6584382,19.2691004,0,25.4,0,-25.4\n0,4.7973742,20.6026258,0,25.4,0,-25.4\n0,6.1308996,21.7415618,0,25.4,0,-25.4\n0,7.6261976,22.6578922,0,25.4,0,-25.4\n0,9.2464382,23.329011,0,25.4,0,-25.4\n0,10.9516926,23.7384082,0,25.4,0,-25.4\n0,12.7,23.876,0,25.4,0,-25.4\n0,14.4483074,23.7384082,0,25.4,0,-25.4\n0,16.1535618,23.329011,0,25.4,0,-25.4\n0,17.7738024,22.6578922,0,25.4,0,-25.4\n0,19.2691004,21.7415618,0,25.4,0,-25.4\n0,20.6026258,20.6026258,0,25.4,0,-25.4\n0,21.7415618,19.2691004,0,25.4,0,-25.4\n0,22.6578922,17.7738024,0,25.4,0,-25.4\n0,23.329011,16.1535618,0,25.4,0,-25.4\n0,23.7384082,14.4483074,0,25.4,0,-25.4\n0,23.876,12.7,0,25.4,0,-25.4\n")),N(O.ParsePatFile("\n*CLAY,CLAY\n0, 0,0, 0,4.7625\n0, 0,.79375, 0,4.7625\n0, 0,1.5875, 0,4.7625\n0, 0,3.175, 0,4.7625, 4.7625,-3.175\n")),N(O.ParsePatFile("\n*CORK,CORK\n0, 0,0, 0,3.175\n135, 1.5875,-1.5875, 0,8.98026, 4.49013,-4.49013\n135, 2.38125,-1.5875, 0,8.98026, 4.49013,-4.49013\n135, 3.175,-1.5875, 0,8.98026, 4.49013,-4.49013\n")),N(O.ParsePatFile("\n*CROSS,CROSS\n0, 0,0, 6.35,6.35, 3.175,-9.525\n90, 1.5875,-1.5875, 6.35,6.35, 3.175,-9.525\n")),N(O.ParsePatFile("\n*DASH,DASH\n0, 0,0, 3.175,3.175, 3.175,-3.175\n")),N(O.ParsePatFile("\n*DOLMIT,DOLMIT\n0, 0,0, 0,6.35\n45, 0,0, 0,17.9605, 8.98026,-17.9605\n")),N(O.ParsePatFile("\n*DOTS,DOTS\n0, 0,0, .79375,1.5875, 0,-1.5875\n")),N(O.ParsePatFile("\n*EARTH,EARTH\n0, 0,0, 6.35,6.35, 6.35,-6.35\n0, 0,2.38125, 6.35,6.35, 6.35,-6.35\n0, 0,4.7625, 6.35,6.35, 6.35,-6.35\n90, .79375,5.55625, 6.35,6.35, 6.35,-6.35\n90, 3.175,5.55625, 6.35,6.35, 6.35,-6.35\n90, 5.55625,5.55625, 6.35,6.35, 6.35,-6.35\n")),N(O.ParsePatFile("\n*ESCHER,ESCHER\n60, 0,0, -15.24,26.3965, 27.94,-2.54\n180, 0,0, -15.24,26.3965, 27.94,-2.54\n300, 0,0, 15.24,26.3965, 27.94,-2.54\n60, 2.54,0, -15.24,26.3965, 5.08,-25.4\n300, 2.54,0, 15.24,26.3965, 5.08,-25.4\n60, -1.27,2.1997, -15.24,26.3965, 5.08,-25.4\n180, -1.27,2.1997, -15.24,26.3965, 5.08,-25.4\n300, -1.27,-2.1997, 15.24,26.3965, 5.08,-25.4\n180, -1.27,-2.1997, -15.24,26.3965, 5.08,-25.4\n60, -10.16,0, -15.24,26.3965, 5.08,-25.4\n300, -10.16,0, 15.24,26.3965, 5.08,-25.4\n60, 5.08,-8.79882, -15.24,26.3965, 5.08,-25.4\n180, 5.08,-8.79882, -15.24,26.3965, 5.08,-25.4\n300, 5.08,8.79882, 15.24,26.3965, 5.08,-25.4\n180, 5.08,8.79882, -15.24,26.3965, 5.08,-25.4\n0, 5.08,4.39941, -15.24,26.3965, 17.78,-12.7\n0, 5.08,-4.39941, -15.24,26.3965, 17.78,-12.7\n120, 1.27,6.59911, 15.24,26.3965, 17.78,-12.7\n120, -6.35,2.1997, 15.24,26.3965, 17.78,-12.7\n240, -6.35,-2.1997, 15.24,26.3965, 17.78,-12.7\n240, 1.27,-6.59911, 15.24,26.3965, 17.78,-12.7\n")),N(O.ParsePatFile("\n*EXPLOSION,EXPLOSION\n;By John Hyslop\n;Developed in mm as Metric QCAD3 pattern\n270,11.43,2.794,0,25.4,2.794,-22.606\n143.130102,12.446,2.032,91.44,5.08,1.27,-125.73\n270,12.446,4.318,0,25.4,2.286,-23.114\n112.380135,14.224,0,330.1971097,1.381577882,4.669733104,-462.3035852\n75.256437,12.954,20.574,104.7189028,1.292825964,4.990308282,-494.0405126\n287.525568,11.43,25.4,80.31173574,1.274789424,5.060914186,-501.0305006\n135,1.524,12.446,17.96051221,17.96051221,2.155261374,-33.76576305\n26.565051,0,11.684,34.07767607,11.35922544,1.703883816,-55.09224288\n353.884496,18.288,12.446,485.2654803,0.901980416,7.152705024,-708.1177892\n192.094757,25.4,13.97,234.1697095,1.774012962,7.273453068,-356.3992019\n3.691386,17.526,9.652,381.8448525,0.817654956,7.890370046,-781.1466379\n136.080924,24.384,3.048,916.1619403,0.677634662,9.52076582,-942.5558068\n336.037511,22.098,4.064,193.4234445,2.578979348,2.501609932,-247.6593782\n123.690068,24.638,0.254,35.22346245,7.04469254,4.579050024,-87.00195223\n324.462322,15.748,6.604,91.53339072,2.952690056,10.924953,-207.5741086\n117.645975,18.542,1.27,545.3600756,1.07143423,6.021460906,-596.1246343\n326.309932,13.97,4.318,56.35753981,7.04469254,5.494860232,-86.08614228\n106.38954,15.24,0,265.1799113,1.433404804,4.50089143,-445.5882554\n153.434949,3.048,8.636,22.71845063,11.35922544,3.407767632,-53.38835906\n64.798876,1.016,4.318,420.4426387,1.351905602,4.772226676,-472.4504468\n202.619865,4.064,5.588,193.4307693,1.953846232,3.302,-326.898\n59.036243,2.54,3.048,56.62883289,4.356064186,2.962123616,-145.1440546\n211.75948,7.874,6.35,239.620914,1.028416028,6.273337212,-621.0603858\n79.215702,6.858,1.016,413.4803361,1.188161962,5.429899732,-537.5600816\n212.471192,9.652,2.794,91.56028043,1.9480911,3.31175487,-327.8637273\n63.434949,8.89,1.27,22.71845063,11.35922544,1.703883816,-55.09224288\n135,10.16,0,17.96051221,17.96051221,1.796051272,-34.12497315\n74.357754,8.382,19.05,474.5101503,0.978371424,6.59422354,-652.8281297\n333.434949,0.762,22.86,22.71845063,11.35922544,8.51941908,-48.27670761\n110.556045,4.572,12.7,136.7508764,2.97284521,10.85088483,-206.1668104\n330.945396,0,15.24,56.74251999,2.467066186,5.23018004,-256.2788255\n99.462322,16.002,20.828,129.4477627,4.175734346,4.635065152,-149.8671031\n222.70939,19.304,23.876,35.89232217,1.435692836,4.493718724,-444.8781539\n74.744881,18.542,21.082,104.7031863,2.22772732,2.896045516,-286.7085124\n208.61046,24.13,24.13,261.5011486,2.027140726,6.365221712,-311.8958659\n62.744672,19.812,15.748,56.79200478,0.684240948,9.428841188,-933.4552873\n212.275644,24.638,18.796,331.1735533,1.130285268,5.70794007,-565.0860682\n55.00798,22.86,16.256,91.55735943,2.080849026,3.100465224,-306.9460475\n158.198591,25.4,15.24,80.18324705,4.716661636,2.73566382,-134.0475224\n51.911227,14.986,12.954,741.8363621,0.540303212,11.9407018,-1182.12948\n153.434949,16.51,12.192,22.71845063,11.35922544,1.703883816,-55.09224288\n35.537678,14.732,10.922,126.9656711,2.952690056,2.18499055,-216.3140711\n129.289407,19.304,5.334,198.3722919,1.78713765,7.220036614,-353.7817918\n322.30576,13.716,9.652,416.5899728,0.9135745,7.061931012,-699.1311588\n77.905243,12.954,6.096,129.5029455,1.774012962,3.636726534,-360.0359284\n282.994617,12.192,9.398,104.709577,1.903810518,3.388782656,-335.4894845\n62.525568,8.89,3.048,56.78897304,0.901412218,7.157213524,-708.564129\n267.137595,9.144,8.128,25.36830944,1.268415548,5.086345936,-503.5482576\n12.994617,2.54,6.604,104.709577,1.903810518,6.777565312,-332.1007018\n211.75948,7.874,9.906,239.620914,1.028416028,6.273337212,-621.0603858\n318.366461,5.588,11.938,269.9974641,2.109355192,3.05856513,-302.7979372\n189.462322,7.112,12.192,129.4477627,4.175734346,1.545021802,-152.9571465\n297.299572,3.048,20.066,829.3009284,0.728095572,8.860923858,-877.231464\n132.273689,8.128,14.478,35.8803669,1.708588912,7.551962798,-370.0461832\n282.994617,7.366,17.78,104.709577,1.903810518,3.388782656,-335.4894845\n140.194429,10.414,15.24,162.6068376,3.252136752,3.967606746,-194.4127349\n268.363423,10.668,24.13,25.38963909,0.725418158,8.893627882,-880.4691552\n102.200469,12.7,14.732,597.8446202,0.67098164,9.615166444,-951.9014896\n250.016893,14.732,20.32,80.29253258,2.170068558,5.9459876,-291.3533901\n84.559668,14.224,14.986,280.549586,1.20407557,5.358135842,-530.4554512\n222.184443,22.352,22.352,377.597688,0.588158336,10.96915408,-1085.946248\n")),N(O.ParsePatFile("\n*FLEX,FLEX\n0, 0,0, 0,6.35, 6.35,-6.35\n45, 6.35,0, 4.49013,4.49013, 1.5875,-5.80526,1.5875,-8.98026\n")),N(O.ParsePatFile("\n*GRASS,GRASS\n90, 0,0, 17.9605,17.9605, 4.7625,-31.1585\n45, 0,0, 0,25.4, 4.7625,-20.6375\n135, 0,0, 0,25.4, 4.7625,-20.6375\n")),N(O.ParsePatFile("\n*GRATE,GRATE\n0, 0,0, 0,.79375\n90, 0,0, 0,3.175\n")),N(O.ParsePatFile("\n*GRAVEL-01,GRAVEL-01\n;Optimize to replace existing GRAVEL Pattern\n;By John Hyslop, Using AutoCAD Lisp Tool\n;Developed in mm as metric QCAD3 pattern\n159.443955,4.064,3.302,80.266818638,2.97284521,4.340353778,-212.677341218\n114.775141,5.588,0,56.76841453,1.774012962,3.636726534,-360.03592839\n249.443955,8.128,2.032,80.266818638,2.97284521,2.170177016,-214.847518234\n186.009006,12.954,2.54,230.002940044,1.329496706,4.852663142,-480.413655376\n165.963757,18.034,1.27,24.6416195,6.160405002,5.236344112,-99.490538636\n101.309932,18.288,0,104.608346536,4.981349956,1.29515108,-128.219944728\n243.434949,21.336,3.556,22.718450626,11.35922544,3.975728904,-52.820397788\n355.426079,12.446,3.302,331.173933536,1.012764294,6.370287488,-630.658471472\n300.256437,10.668,6.35,148.094892532,1.828332132,3.528680776,-349.33939657\n228.012788,15.24,11.43,305.850675318,1.887967014,6.834440992,-334.887609878\n180,21.844,11.43,0,25.4,6.604,-18.796\n303.690068,15.748,15.748,35.223462446,7.04469254,3.66324007,-87.917762188\n225,18.288,18.288,17.960512212,17.960512212,3.592102544,-32.328922134\n110.224859,2.032,5.842,217.014069654,1.254416592,5.143108078,-509.167692864\n177.273689,7.366,5.588,25.371250756,1.20815481,5.340044184,-528.664375232\n217.69424,12.954,9.906,289.603117008,0.9135745,7.061931012,-699.131158758\n252.255328,14.986,16.256,586.403737782,0.967663038,6.667197486,-660.05256356\n301.429566,12.192,20.828,387.712303314,1.20407557,5.358135842,-530.455451152\n355.236358,6.096,21.336,25.312262304,2.109355192,6.117130006,-299.739372326\n43.66778,0.508,16.002,35.911314766,0.83514692,7.725108502,-764.785732808\n87.273689,0.254,10.668,25.371250756,1.20815481,5.340044184,-528.664375232\n30.963757,15.748,18.034,91.477345366,4.356064186,4.443185424,-143.662992836\n291.801409,14.732,20.574,56.599939124,4.716661636,2.73566382,-134.047522354\n203.198591,16.51,21.336,56.698117744,3.335183322,1.934406342,-191.506230398\n161.565051,19.558,20.32,24.09655582,8.032185358,3.212874194,-77.10897837\n4.969741,10.16,22.352,280.550012686,1.100196174,5.864045422,-580.540490682\n16.38954,0,20.574,265.179911346,1.433404804,4.50089143,-445.58825538\n197.354025,25.4,4.826,80.307559222,1.515237,4.25781597,-421.523771378\n74.054604,24.13,5.588,104.668749768,3.488958224,3.69829588,-181.216495326\n27.645975,18.796,2.794,545.360075648,1.07143423,6.021460906,-596.124634266\n145.304846,25.146,9.144,91.566911862,1.60643697,4.016092552,-397.593170268\n353.157227,17.78,12.7,434.77679618,1.008762778,6.395556678,-633.160101724\n171.469234,23.368,17.526,179.600730968,1.255949228,5.136831992,-508.546377622\n138.814075,25.4,15.748,234.164238554,2.389431086,2.700057084,-267.30564649\n90,25.4,14.224,0,25.4,1.524,-23.876\n60.945396,24.13,11.938,56.742519992,2.467066186,2.61509002,-258.893915536\n343.61046,21.082,21.844,184.909235464,1.433404804,4.50089143,-445.58825538\n293.198591,19.558,25.4,56.698117744,3.335183322,3.868812684,-189.571824056\n48.012788,16.002,22.86,305.850675318,1.887967014,3.417220496,-338.304830374\n312.510447,7.366,25.4,35.887120758,1.560309554,4.134820534,-409.347222706\n70.346176,4.318,21.844,80.303678102,1.708588912,3.775981526,-373.822164724\n")),N(O.ParsePatFile("\n*GRAVEL,GRAVEL\n228.0128, 18.288,25.4, 305.851,1.88796, 3.41721,-338.305\n184.9697, 16.002,22.86, -305.855,1.1002, 5.86405,-580.54\n132.5104, 10.16,22.352, -377.595,1.56032, 4.13482,-409.347\n267.2737, .254,16.002, -508.633,1.20815, 5.34005,-528.664\n292.8337, 0,10.668, -330.198,1.23208, 5.23634,-518.398\n357.2737, 2.032,5.842, -508.633,1.20815, 5.34005,-528.664\n37.6942, 7.366,5.588, -416.59,.913587, 7.06194,-699.131\n72.2553, 12.954,9.906, 586.404,.967664, 6.6672,-660.053\n121.4296, 14.986,16.256, 387.712,1.20409, 5.35813,-530.455\n175.2364, 12.192,20.828, -280.544,2.10934, 6.11713,-299.739\n222.3974, 6.096,21.336, 413.481,.815543, 7.91078,-783.168\n138.8141, 25.4,15.748, 234.164,2.38943, 2.70005,-267.306\n171.4692, 23.368,17.526, -334.082,1.25595, 5.13682,-508.546\n225, 18.288,18.288, 17.9605,17.9605, 3.59209,-32.3289\n203.1986, 16.51,21.336, -136.743,3.33517, 1.93441,-191.506\n291.8014, 14.732,20.574, -80.1833,4.71665, 2.73566,-134.048\n30.9638, 15.748,18.034, 91.4773,4.35607, 4.4432,-143.663\n161.5651, 19.558,20.32, -56.2253,8.03219, 3.21287,-77.109\n16.3895, 0,20.574, 265.18,1.4334, 4.50088,-445.588\n70.3462, 4.318,21.844, -297.294,1.70858, 3.77599,-373.822\n293.1986, 19.558,25.4, -136.743,3.33517, 3.8688,-189.572\n343.6105, 21.082,21.844, -265.18,1.4334, 4.50088,-445.588\n339.444, 0,4.826, -136.751,2.97284, 4.34035,-212.677\n294.7751, 4.064,3.302, -306.904,1.77401, 3.63672,-360.036\n66.8014, 19.812,0, 136.743,3.33517, 3.8688,-189.572\n17.354, 21.336,3.556, -345.474,1.51524, 4.25783,-421.524\n69.444, 7.366,0, -136.751,2.97284, 2.17018,-214.848\n101.3099, 18.288,0, 104.608,4.98135, 1.29515,-128.22\n165.9638, 18.034,1.27, -80.0853,6.16041, 5.23634,-99.4905\n186.009, 12.954,2.54, -255.263,1.32949, 4.85267,-480.414\n303.6901, 15.748,15.748, -56.3575,7.04469, 3.66324,-87.9178\n353.1572, 17.78,12.7, 434.777,1.00876, 6.39557,-633.16\n60.9454, 24.13,11.938, -204.766,2.46708, 2.61508,-258.894\n90, 25.4,14.224, 25.4,25.4, 1.524,-23.876\n120.2564, 12.446,3.302, -204.773,1.82834, 3.52867,-349.339\n48.0128, 10.668,6.35, 305.851,1.88796, 6.83443,-334.888\n0, 15.24,11.43, 25.4,25.4, 6.604,-18.796\n325.3048, 21.844,11.43, -310.042,1.60645, 4.0161,-397.593\n254.0546, 25.146,9.144, 104.669,3.48897, 3.69829,-181.217\n207.646, 24.13,5.588, 545.36,1.07142, 6.02145,-596.125\n175.4261, 18.796,2.794, 331.174,1.01277, 6.37029,-630.658\n175.4261, 18.796,2.794, 331.174,1.01277, 6.37029,-630.658\n")),N(O.ParsePatFile("\n*HATCH-DOTS\n;By John Hyslop, Tile2Hatch tool \xa9 CVH 2020\n;Developed in mm as metric QCAD3 pattern\n225,14.364914374,2.934914374,17.960512212,17.960512212,11.492295278,-24.428729146\n225,6.359242552,5.089242552,17.960512212,17.960512212,16.19060262,-19.730421804\n225,3.281299762,9.631299762,17.960512212,17.960512212,18.261173282,-17.659851142\n225,19.161365538,5.191365538,17.960512212,17.960512212,11.492295278,-24.428729146\n225,7.864421914,4.054421914,17.960512212,17.960512212,16.85579052,-19.065234158\n225,2.841461932,11.731461932,17.960512212,17.960512212,20.609227006,-15.311797418\n225,9.631299762,3.281299762,17.960512212,17.960512212,18.261173282,-17.659851142\n225,2.934914374,14.364914374,17.960512212,17.960512212,11.492295278,-24.428729146\n225,5.089242552,6.359242552,17.960512212,17.960512212,16.19060262,-19.730421804\n225,11.731462186,2.841462186,17.960512212,17.960512212,20.60922726,-15.311797164\n225,5.191365538,19.161365538,17.960512212,17.960512212,11.492295278,-24.428729146\n225,4.054421914,7.864421914,17.960512212,17.960512212,16.85579052,-19.065234158\n")),N(O.ParsePatFile("\n*HATCH-SQRS\n;By John Hyslop, Tile2Hatch tool \xa9 CVH 2020\n;Developed in mm as metric QCAD3 pattern\n225,2.794,9.144,17.960512212,17.960512212,7.902625292,-28.018399132\n225,2.794,21.844,17.960512212,17.960512212,7.902625292,-28.018399132\n225,2.794,6.604,17.960512212,17.960512212,13.290779108,-22.630245316\n225,19.304,2.794,17.960512212,17.960512212,7.902625292,-28.018399132\n225,2.794,14.224,17.960512212,17.960512212,7.902625292,-28.018399132\n225,2.794,11.684,17.960512212,17.960512212,7.902625292,-28.018399132\n225,6.604,2.794,17.960512212,17.960512212,13.290779108,-22.630245316\n225,2.794,19.304,17.960512212,17.960512212,7.902625292,-28.018399132\n225,2.794,4.064,17.960512212,17.960512212,9.698676564,-26.22234786\n225,4.064,2.794,17.960512212,17.960512212,9.698676564,-26.22234786\n225,11.684,2.794,17.960512212,17.960512212,7.902625292,-28.018399132\n225,14.224,2.794,17.960512212,17.960512212,7.902625292,-28.018399132\n225,9.144,2.794,17.960512212,17.960512212,7.902625292,-28.018399132\n225,21.844,2.794,17.960512212,17.960512212,7.902625292,-28.018399132\n225,2.794,16.764,17.960512212,17.960512212,7.902625292,-28.018399132\n225,16.764,2.794,17.960512212,17.960512212,7.902625292,-28.018399132\n")),N(O.ParsePatFile("\n*HEX,HEX\n0, 0,0, 0,5.49926, 3.175,-6.35\n120, 0,0, 0,5.49926, 3.175,-6.35\n60, 3.175,0, 0,5.49926, 3.175,-6.35\n")),N(O.ParsePatFile("\n*HEXAGONS\n;By John Hyslop, Tile2Hatch tool \xa9 CVH 2020\n;Developed in mm as metric QCAD3 pattern\n239.931417,5.587999746,25.399999492,204.778078632,1.15693825,5.576441984,-552.067817376\n239.931417,22.606,4.826,204.778078632,1.15693825,5.576441984,-552.067817376\n300.068583,19.812000254,25.399999492,352.866180728,1.15693825,5.576441984,-552.067817376\n60.068488,3.048,12.7,204.780260492,0.667036766,9.672031964,-957.531152498\n119.931512,7.874,4.318,762.42292397,0.667036766,9.67203171,-957.531152498\n300.068583,2.794,4.826,352.866180728,1.15693825,5.576441984,-552.067817376\n180,2.794,4.826,0,25.4,5.587998984,-19.812001016\n299.931512,17.526,21.082,762.42292397,0.667036766,9.67203171,-957.531152498\n0,7.874,21.082,0,25.4,9.652,-15.748\n180,17.526,4.318,0,25.4,9.652,-15.748\n240.068488,22.352,12.7,204.780260492,0.667036766,9.672031964,-957.531152498\n180,2.794,20.574,0,25.4,5.587998984,-19.812001016\n")),N(O.ParsePatFile("\n*HEXJOIN-01\n;By John Hyslop, Tile2Hatch tool \xa9 CVH 2020\n;Developed in mm as metric QCAD3 pattern\n45,3.81,16.51,17.960512212,17.960512212,7.184204834,-28.73681959\n270,21.59,16.51,25.4,25.4,7.62,-17.78\n315,16.51,21.59,17.960512212,17.960512212,7.184204834,-28.73681959\n180,16.51,3.81,0,25.4,7.62,-17.78\n270,13.97,3.81,25.4,25.4,7.62,-17.78\n90,3.81,8.89,25.4,25.4,7.62,-17.78\n135,8.89,3.81,17.960512212,17.960512212,7.184204834,-28.73681959\n180,3.81,13.97,0,25.4,7.62,-17.78\n270,11.43,3.81,25.4,25.4,7.62,-17.78\n180,3.81,11.43,0,25.4,7.62,-17.78\n225,21.59,8.89,17.960512212,17.960512212,7.184204834,-28.73681959\n0,8.89,21.59,0,25.4,7.62,-17.78\n")),N(O.ParsePatFile("\n*HEXJOIN-02\n;By John Hyslop, Tile2Hatch tool \xa9 CVH 2020\n;Developed in mm as metric QCAD3 pattern\n270,21.59,11.43,25.4,25.4,2.54,-22.86\n315,16.51,21.59,17.960512212,17.960512212,7.184204834,-28.73681959\n270,13.97,3.81,25.4,25.4,7.62,-17.78\n180,3.81,13.97,0,25.4,7.62,-17.78\n180,16.51,3.81,0,25.4,2.54,-22.86\n45,3.81,16.51,17.960512212,17.960512212,7.184204834,-28.73681959\n90,3.81,13.97,25.4,25.4,2.54,-22.86\n180,3.81,11.43,0,25.4,7.62,-17.78\n180,11.43,3.81,0,25.4,2.54,-22.86\n270,11.43,3.81,25.4,25.4,7.62,-17.78\n90,3.81,8.89,25.4,25.4,2.54,-22.86\n0,13.97,21.59,0,25.4,2.54,-22.86\n135,8.89,3.81,17.960512212,17.960512212,7.184204834,-28.73681959\n0,8.89,21.59,0,25.4,2.54,-22.86\n225,21.59,8.89,17.960512212,17.960512212,7.184204834,-28.73681959\n270,21.59,16.51,25.4,25.4,2.54,-22.86\n")),N(O.ParsePatFile("\n*HOLLY,HOLLY\n;By John Hyslop\n;Developed in mm as Metric QCAD3 pattern\n99.462322,20.32,2.794,129.4477627,4.175734346,1.545021802,-152.9571465\n74.744881,17.018,2.032,104.7031863,2.22772732,2.896045516,-286.7085124\n68.198591,13.462,3.81,80.18324705,4.716661636,2.73566382,-134.0475224\n270,14.732,9.398,0,25.4,1.778,-23.622\n248.198591,19.05,8.89,80.18324705,4.716661636,2.73566382,-134.0475224\n45,20.32,5.08,17.96051221,17.96051221,2.155261374,-33.76576305\n351.869898,22.86,3.302,25.14471705,3.592102544,1.796051272,-177.8090711\n0,21.844,3.302,0,25.4,1.016,-24.384\n26.565051,20.828,2.794,34.07767607,11.35922544,1.135922544,-55.66020415\n45,20.32,2.286,17.96051221,17.96051221,0.718420458,-35.20260397\n341.565051,19.558,2.54,24.09655582,8.032185358,0.803218612,-79.51863395\n0,18.542,2.54,0,25.4,1.016,-24.384\n26.565051,18.034,2.286,34.07767607,11.35922544,0.567961272,-56.22816542\n26.565051,17.526,2.032,34.07767607,11.35922544,0.567961272,-56.22816542\n53.130102,16.764,1.016,91.44,5.08,1.27,-125.73\n270,16.764,2.032,0,25.4,1.016,-24.384\n303.690068,16.256,2.794,35.22346245,7.04469254,0.915809954,-90.6651923\n315,15.748,3.302,17.96051221,17.96051221,0.718420458,-35.20260397\n345.963757,14.732,3.556,24.6416195,6.160405002,1.047268924,-103.6796141\n0,13.716,3.556,0,25.4,1.016,-24.384\n33.690068,12.954,3.048,35.22346245,7.04469254,0.915809954,-90.6651923\n255.963757,13.208,4.064,24.6416195,6.160405002,1.047268924,-103.6796141\n281.309932,12.954,5.334,104.6083465,4.981349956,1.29515108,-128.2199447\n284.036243,12.7,6.35,80.0852635,6.160405002,1.047268924,-103.6796141\n296.565051,12.192,7.366,34.07767607,11.35922544,1.135922544,-55.66020415\n303.690068,11.684,8.128,35.22346245,7.04469254,0.915809954,-90.6651923\n180,12.7,8.128,0,25.4,1.016,-24.384\n180,13.462,8.128,0,25.4,0.762,-24.638\n213.690068,14.224,8.636,35.22346245,7.04469254,0.915809954,-90.6651923\n243.434949,14.478,9.144,22.71845063,11.35922544,0.567961272,-56.22816542\n251.565051,14.732,9.906,24.09655582,8.032185358,0.803218612,-79.51863395\n108.434949,14.986,9.144,56.22529674,8.032185358,0.803218612,-79.51863395\n135,15.494,8.636,17.96051221,17.96051221,0.718420458,-35.20260397\n153.434949,16.002,8.382,22.71845063,11.35922544,0.567961272,-56.22816542\n161.565051,16.764,8.128,24.09655582,8.032185358,0.803218612,-79.51863395\n180,17.526,8.128,0,25.4,0.762,-24.638\n198.434949,18.288,8.382,56.22529674,8.032185358,0.803218612,-79.51863395\n225,18.796,8.89,17.96051221,17.96051221,0.718420458,-35.20260397\n251.565051,19.05,9.652,24.09655582,8.032185358,0.803218612,-79.51863395\n108.434949,19.304,8.89,56.22529674,8.032185358,0.803218612,-79.51863395\n116.565051,19.812,7.874,34.07767607,11.35922544,1.135922544,-55.66020415\n135,20.574,7.112,17.96051221,17.96051221,1.077630814,-34.84339386\n161.565051,21.336,6.858,24.09655582,8.032185358,0.803218612,-79.51863395\n180,22.098,6.858,0,25.4,0.762,-24.638\n90,22.098,6.096,0,25.4,0.762,-24.638\n111.801409,22.606,4.826,56.59993912,4.716661636,1.36783191,-135.4153543\n126.869898,23.368,3.81,35.56,5.08,1.27,-125.73\n149.036243,24.638,3.048,56.62883289,4.356064186,1.481061808,-146.6251165\n338.587031,11.684,8.128,627.3335515,0.463661252,13.91447154,-1377.532674\n338.198591,20.32,17.526,80.18324705,4.716661636,1.36783191,-135.4153543\n323.972627,18.034,15.748,218.4910814,1.867445084,3.454773634,-342.0225773\n315,15.24,13.462,17.96051221,17.96051221,2.873681832,-33.04734259\n135,14.732,13.97,17.96051221,17.96051221,1.796051272,-34.12497315\n126.869898,17.272,16.51,35.56,5.08,2.54,-124.46\n105.945396,19.558,18.288,80.24604144,3.488958224,1.84914794,-183.0656433\n30.963757,22.098,20.32,91.47734537,4.356064186,1.481061808,-146.6251165\n14.036243,21.082,20.066,80.0852635,6.160405002,1.047268924,-103.6796141\n0,20.32,20.066,0,25.4,0.762,-24.638\n341.565051,19.558,20.32,24.09655582,8.032185358,0.803218612,-79.51863395\n333.434949,19.05,20.574,22.71845063,11.35922544,0.567961272,-56.22816542\n63.434949,18.796,20.066,22.71845063,11.35922544,0.567961272,-56.22816542\n45,18.288,19.558,17.96051221,17.96051221,0.718420458,-35.20260397\n33.690068,17.526,19.05,35.22346245,7.04469254,0.915809954,-90.6651923\n18.434949,16.764,18.796,56.22529674,8.032185358,0.803218612,-79.51863395\n0,16.002,18.796,0,25.4,0.762,-24.638\n341.565051,15.24,19.05,24.09655582,8.032185358,0.803218612,-79.51863395\n108.434949,15.494,18.288,56.22529674,8.032185358,0.803218612,-79.51863395\n90,15.494,17.526,0,25.4,0.762,-24.638\n75.963757,15.24,16.51,24.6416195,6.160405002,1.047268924,-103.6796141\n45,14.478,15.748,17.96051221,17.96051221,1.077630814,-34.84339386\n14.036243,13.462,15.494,80.0852635,6.160405002,1.047268924,-103.6796141\n0,12.7,15.494,0,25.4,0.762,-24.638\n126.869898,13.462,14.478,35.56,5.08,1.27,-125.73\n90,13.462,13.716,0,25.4,0.762,-24.638\n75.963757,13.208,12.7,24.6416195,6.160405002,1.047268924,-103.6796141\n56.309932,12.7,11.938,56.35753981,7.04469254,0.915809954,-90.6651923\n191.309932,13.97,12.192,104.6083465,4.981349956,1.29515108,-128.2199447\n168.690068,15.24,11.938,24.90674927,4.981349956,1.29515108,-128.2199447\n161.565051,16.764,11.43,24.09655582,8.032185358,1.60643697,-78.71541559\n143.130102,17.78,10.668,91.44,5.08,1.27,-125.73\n270,17.78,10.922,0,25.4,0.254,-25.146\n270,17.78,11.684,0,25.4,0.762,-24.638\n243.434949,18.288,12.7,22.71845063,11.35922544,1.135922544,-55.66020415\n213.690068,19.05,13.208,35.22346245,7.04469254,0.915809954,-90.6651923\n198.434949,19.812,13.462,56.22529674,8.032185358,0.803218612,-79.51863395\n180,20.828,13.462,0,25.4,1.016,-24.384\n146.309932,21.59,12.954,56.35753981,7.04469254,0.915809954,-90.6651923\n303.690068,21.082,13.716,35.22346245,7.04469254,0.915809954,-90.6651923\n270,21.082,14.478,0,25.4,0.762,-24.638\n270,21.082,15.494,0,25.4,1.016,-24.384\n243.434949,21.59,16.51,22.71845063,11.35922544,1.135922544,-55.66020415\n225,22.098,17.018,17.96051221,17.96051221,0.718420458,-35.20260397\n296.565051,21.844,17.526,34.07767607,11.35922544,0.567961272,-56.22816542\n270,21.844,18.034,0,25.4,0.508,-24.892\n255.963757,22.098,19.05,24.6416195,6.160405002,1.047268924,-103.6796141\n243.434949,22.606,20.066,22.71845063,11.35922544,1.135922544,-55.66020415\n233.130102,23.368,21.082,91.44,5.08,1.27,-125.73\n40.601295,12.7,11.938,35.81521869,2.755016842,14.05058582,-220.1258435\n195.945396,6.604,13.716,80.24604144,3.488958224,1.84914794,-183.0656433\n5.194429,7.366,13.97,255.2564824,2.29960805,2.805521694,-277.7466482\n19.983107,7.112,17.272,217.0068451,2.170068558,2.9729938,-294.3263839\n185.710593,5.842,17.272,229.9928961,2.527394488,2.552668504,-252.7141722\n164.054604,5.588,20.066,104.6687498,3.488958224,1.84914794,-183.0656433\n45,6.858,20.066,17.96051221,17.96051221,1.436840916,-34.48418351\n90,5.334,23.368,0,25.4,1.016,-24.384\n75.963757,5.08,22.352,24.6416195,6.160405002,1.047268924,-103.6796141\n243.434949,7.874,11.938,22.71845063,11.35922544,1.135922544,-55.66020415\n236.309932,8.382,12.7,56.35753981,7.04469254,0.915809954,-90.6651923\n225,9.144,13.462,17.96051221,17.96051221,1.077630814,-34.84339386\n213.690068,9.906,13.97,35.22346245,7.04469254,0.915809954,-90.6651923\n189.462322,11.43,14.224,129.4477627,4.175734346,1.545021802,-152.9571465\n333.434949,10.922,14.478,22.71845063,11.35922544,0.567961272,-56.22816542\n326.309932,10.16,14.986,56.35753981,7.04469254,0.915809954,-90.6651923\n303.690068,9.652,15.748,35.22346245,7.04469254,0.915809954,-90.6651923\n270,9.652,16.764,0,25.4,1.016,-24.384\n251.565051,9.906,17.526,24.09655582,8.032185358,0.803218612,-79.51863395\n236.309932,10.414,18.288,56.35753981,7.04469254,0.915809954,-90.6651923\n213.690068,11.176,18.796,35.22346245,7.04469254,0.915809954,-90.6651923\n0,10.16,18.796,0,25.4,1.016,-24.384\n333.434949,9.144,19.304,22.71845063,11.35922544,1.135922544,-55.66020415\n306.869898,8.382,20.32,35.56,5.08,1.27,-125.73\n284.036243,8.128,21.336,80.0852635,6.160405002,1.047268924,-103.6796141\n341.565051,7.366,21.59,24.09655582,8.032185358,0.803218612,-79.51863395\n326.309932,6.604,22.098,56.35753981,7.04469254,0.915809954,-90.6651923\n303.690068,6.096,22.86,35.22346245,7.04469254,0.915809954,-90.6651923\n296.565051,5.334,24.384,34.07767607,11.35922544,1.703883816,-55.09224288\n56.309932,4.572,21.59,56.35753981,7.04469254,0.915809954,-90.6651923\n45,4.064,21.082,17.96051221,17.96051221,0.718420458,-35.20260397\n33.690068,3.302,20.574,35.22346245,7.04469254,0.915809954,-90.6651923\n116.565051,3.556,20.066,34.07767607,11.35922544,0.567961272,-56.22816542\n108.434949,3.81,19.304,56.22529674,8.032185358,0.803218612,-79.51863395\n90,3.81,18.288,0,25.4,1.016,-24.384\n63.434949,3.302,17.272,22.71845063,11.35922544,1.135922544,-55.66020415\n33.690068,2.54,16.764,35.22346245,7.04469254,0.915809954,-90.6651923\n165.963757,3.556,16.51,24.6416195,6.160405002,1.047268924,-103.6796141\n143.130102,4.572,15.748,91.44,5.08,1.27,-125.73\n116.565051,5.08,14.732,34.07767607,11.35922544,1.135922544,-55.66020415\n75.963757,4.826,13.716,24.6416195,6.160405002,1.047268924,-103.6796141\n63.434949,4.318,12.7,22.71845063,11.35922544,1.135922544,-55.66020415\n180,5.334,12.7,0,25.4,1.016,-24.384\n165.963757,6.35,12.446,24.6416195,6.160405002,1.047268924,-103.6796141\n135,6.858,11.938,17.96051221,17.96051221,0.718420458,-35.20260397\n116.565051,7.366,10.922,34.07767607,11.35922544,1.135922544,-55.66020415\n278.583621,5.334,24.384,847.7664863,0.473877386,13.61449474,-1347.834983\n104.036243,7.62,5.08,80.0852635,6.160405002,1.047268924,-103.6796141\n123.690068,8.128,4.318,35.22346245,7.04469254,0.915809954,-90.6651923\n153.434949,9.144,3.81,22.71845063,11.35922544,1.135922544,-55.66020415\n180,9.906,3.81,0,25.4,0.762,-24.638\n206.565051,10.922,4.318,34.07767607,11.35922544,1.135922544,-55.66020415\n236.309932,11.43,5.08,56.35753981,7.04469254,0.915809954,-90.6651923\n255.963757,11.684,6.096,24.6416195,6.160405002,1.047268924,-103.6796141\n288.434949,11.43,6.858,56.22529674,8.032185358,0.803218612,-79.51863395\n303.690068,10.922,7.62,35.22346245,7.04469254,0.915809954,-90.6651923\n333.434949,9.906,8.128,22.71845063,11.35922544,1.135922544,-55.66020415\n0,9.144,8.128,0,25.4,0.762,-24.638\n26.565051,8.128,7.62,34.07767607,11.35922544,1.135922544,-55.66020415\n56.309932,7.62,6.858,56.35753981,7.04469254,0.915809954,-90.6651923\n71.565051,7.366,6.096,24.09655582,8.032185358,0.803218612,-79.51863395\n104.036243,4.064,7.874,80.0852635,6.160405002,1.047268924,-103.6796141\n123.690068,4.572,7.112,35.22346245,7.04469254,0.915809954,-90.6651923\n153.434949,5.588,6.604,22.71845063,11.35922544,1.135922544,-55.66020415\n180,6.35,6.604,0,25.4,0.762,-24.638\n206.565051,7.366,7.112,34.07767607,11.35922544,1.135922544,-55.66020415\n236.309932,7.874,7.874,56.35753981,7.04469254,0.915809954,-90.6651923\n255.963757,8.128,8.89,24.6416195,6.160405002,1.047268924,-103.6796141\n288.434949,7.874,9.652,56.22529674,8.032185358,0.803218612,-79.51863395\n303.690068,7.366,10.414,35.22346245,7.04469254,0.915809954,-90.6651923\n333.434949,6.35,10.922,22.71845063,11.35922544,1.135922544,-55.66020415\n0,5.588,10.922,0,25.4,0.762,-24.638\n26.565051,4.572,10.414,34.07767607,11.35922544,1.135922544,-55.66020415\n56.309932,4.064,9.652,56.35753981,7.04469254,0.915809954,-90.6651923\n71.565051,3.81,8.89,24.09655582,8.032185358,0.803218612,-79.51863395\n104.036243,8.636,9.652,80.0852635,6.160405002,1.047268924,-103.6796141\n123.690068,9.144,8.89,35.22346245,7.04469254,0.915809954,-90.6651923\n153.434949,10.16,8.382,22.71845063,11.35922544,1.135922544,-55.66020415\n180,10.922,8.382,0,25.4,0.762,-24.638\n206.565051,11.938,8.89,34.07767607,11.35922544,1.135922544,-55.66020415\n236.309932,12.446,9.652,56.35753981,7.04469254,0.915809954,-90.6651923\n255.963757,12.7,10.668,24.6416195,6.160405002,1.047268924,-103.6796141\n288.434949,12.446,11.43,56.22529674,8.032185358,0.803218612,-79.51863395\n303.690068,11.938,12.192,35.22346245,7.04469254,0.915809954,-90.6651923\n333.434949,10.922,12.7,22.71845063,11.35922544,1.135922544,-55.66020415\n0,10.16,12.7,0,25.4,0.762,-24.638\n26.565051,9.144,12.192,34.07767607,11.35922544,1.135922544,-55.66020415\n56.309932,8.636,11.43,56.35753981,7.04469254,0.915809954,-90.6651923\n71.565051,8.382,10.668,24.09655582,8.032185358,0.803218612,-79.51863395\n")),N(O.ParsePatFile("\n*HONEY,HONEY\n0, 0,0, 4.7625,2.74963, 3.175,-6.35\n120, 0,0, 4.7625,2.74963, 3.175,-6.35\n60, 0,0, 4.7625,2.74963, -6.35,3.175\n")),N(O.ParsePatFile("\n*HOUND,HOUND\n0, 0,0, 6.35,1.5875, 25.4,-12.7\n90, 0,0, -6.35,1.5875, 25.4,-12.7\n")),N(O.ParsePatFile("\n*INSUL,INSUL\n0, 0,0, 0,9.525\n0, 0,3.175, 0,9.525, 3.175,-3.175\n0, 0,6.35, 0,9.525, 3.175,-3.175\n")),N(O.ParsePatFile("\n*JIS_LC_20,JIS_LC_20\n45, 0,0, 0,20\n45, .4,0, 0,20\n")),N(O.ParsePatFile("\n*JIS_LC_20A,JIS_LC_20A\n45, 0,0, 0,20\n45, 1,0, 0,20\n")),N(O.ParsePatFile("\n*JIS_LC_8,JIS_LC_8\n45, 0,0, 0,7.8\n45, .4,0, 0,7.8\n")),N(O.ParsePatFile("\n*JIS_LC_8A,JIS_LC_8A\n45, 0,0, 0,7.8\n45, 1,0, 0,7.8\n")),N(O.ParsePatFile("\n*JIS_RC_10,JIS_RC_10\n45, 0,0, 0,10\n45, .725,0, 0,10\n45, 1.45,0, 0,10\n")),N(O.ParsePatFile("\n*JIS_RC_15,JIS_RC_15\n45, 0,0, 0,15\n45, .725,0, 0,15\n45, 1.45,0, 0,15\n")),N(O.ParsePatFile("\n*JIS_RC_18,JIS_RC_18\n45, 0,0, 0,18\n45, 1,0, 0,18\n45, 2,0, 0,18\n")),N(O.ParsePatFile("\n*JIS_RC_30,JIS_RC_30\n45, 0,0, 0,30\n45, 1,0, 0,30\n45, 2,0, 0,30\n")),N(O.ParsePatFile("\n*JIS_STN_1E,JIS_STN_1E\n45, 0,0, 0,1\n45, .705,0, 0,1, 1,-.5\n")),N(O.ParsePatFile("\n*JIS_STN_2.5,JIS_STN_2.5\n45, 0,0, 0,2.5\n45, 1.765,0, 0,2.5, 1.2,-.5\n")),N(O.ParsePatFile("\n*JIS_WOOD,JIS_WOOD\n45, 0,0, 0,.70710678\n")),N(O.ParsePatFile("\n*LATTICE-01\n;By John Hyslop, Tile2Hatch tool \xa9 CVH 2020\n;Developed in mm as metric QCAD3 pattern\n180,2.162738626,10.16,0,25.4,4.325477252,-21.074522748\n270,15.24,2.162738626,25.4,25.4,4.325477252,-21.074522748\n270,10.16,2.162738626,25.4,25.4,4.325477252,-21.074522748\n135,12.7,6.80694346,17.960512212,17.960512212,8.334040482,-27.586983942\n225,18.59305654,12.7,17.960512212,17.960512212,8.334040482,-27.586983942\n45,2.162738626,15.24,17.960512212,17.960512212,11.309835394,-24.61118903\n180,2.162738626,15.24,0,25.4,4.325477252,-21.074522748\n315,12.7,18.59305654,17.960512212,17.960512212,8.334040482,-27.586983942\n45,6.80694346,12.7,17.960512212,17.960512212,8.334040482,-27.586983942\n315,15.24,23.237261374,17.960512212,17.960512212,11.309835394,-24.61118903\n45,15.24,2.162738626,17.960512212,17.960512212,11.309835394,-24.61118903\n315,2.162738626,10.16,17.960512212,17.960512212,11.309835394,-24.61118903\n")),N(O.ParsePatFile("\n*LATTICE-02\n;By John Hyslop, Tile2Hatch tool \xa9 CVH 2020\n;Developed in mm as metric QCAD3 pattern\n180,9.736666582,9.736666582,0,25.4,19.473333164,-5.926666836\n270,15.663333418,25.4,25.4,25.4,25.4;,0 Removed 0 IT RENDERS A POINT\n180,9.736666582,15.663333418,0,25.4,19.473333164,-5.926666836\n270,9.736666582,25.4,25.4,25.4,25.4;,0 Removed 0 IT RENDERS A POINT\n")),N(O.ParsePatFile("\n*LATTICE-03\n;By John Hyslop, Tile2Hatch tool \xa9 CVH 2020\n;Developed in mm as metric QCAD3 pattern\n180,9.736666582,9.736666582,0,25.4,19.473333164,-5.926666836\n180,9.736666582,15.663333418,0,25.4,19.473333164,-5.926666836\n270,15.663333418,9.736666582,25.4,25.4,19.473333164,-5.926666836\n270,9.736666582,9.736666582,25.4,25.4,19.473333164,-5.926666836\n")),N(O.ParsePatFile("\n*LATTICE-04\n;By John Hyslop, Tile2Hatch tool \xa9 CVH 2020\n;Developed in mm as metric QCAD3 pattern\n296.565051,3.894666582,11.684,34.077676066,11.35922544,28.776704194,-28.019422498\n296.565051,8.636000254,14.054666582,34.077676066,11.35922544,28.776704194,-28.019422498\n206.565051,11.684,21.505333418,34.077676066,11.35922544,28.776704194,-28.019422498\n206.565051,14.054666582,16.763999746,34.077676066,11.35922544,28.776704194,-28.019422498\n")),N(O.ParsePatFile("\n*LATTICE-05,LATTICE-05\n;By John Hyslop\n;Developed in mm as Metric QCAD3 pattern\n0,19.685,1.905,0,25.4,3.81,-21.59\n180,5.715,23.495,0,25.4,3.81,-21.59\n180,15.875,5.715,0,25.4,10.16,-15.24\n180,15.875,1.905,0,25.4,13.97,-11.43\n270,15.875,5.715,0,25.4,3.81,-21.59\n270,19.685,19.685,0,25.4,17.78,-7.62\n270,23.495,23.495,0,25.4,21.59,-3.81\n0,9.525,19.685,0,25.4,10.16,-15.24\n0,9.525,23.495,0,25.4,13.97,-11.43\n90,9.525,19.685,0,25.4,3.81,-21.59\n90,5.715,5.715,0,25.4,17.78,-7.62\n90,1.905,1.905,0,25.4,21.59,-3.81\n")),N(O.ParsePatFile("\n*LATTICE-06,LATTICE-06\n;By John Hyslop\n;Developed in mm as Metric QCAD3 pattern\n180,15.875,9.525,0,25.4,6.35,-19.05\n270,15.875,15.875,0,25.4,6.35,-19.05\n0,9.525,15.875,0,25.4,6.35,-19.05\n90,9.525,9.525,0,25.4,6.35,-19.05\n0,19.685,1.905,0,25.4,3.81,-21.59\n180,5.715,23.495,0,25.4,3.81,-21.59\n180,15.875,5.715,0,25.4,10.16,-15.24\n180,15.875,1.905,0,25.4,13.97,-11.43\n270,15.875,5.715,0,25.4,3.81,-21.59\n270,19.685,19.685,0,25.4,17.78,-7.62\n270,23.495,23.495,0,25.4,21.59,-3.81\n0,9.525,19.685,0,25.4,10.16,-15.24\n0,9.525,23.495,0,25.4,13.97,-11.43\n90,9.525,19.685,0,25.4,3.81,-21.59\n90,5.715,5.715,0,25.4,17.78,-7.62\n90,1.905,1.905,0,25.4,21.59,-3.81\n")),N(O.ParsePatFile("\n*LATTICE-07\n;By John Hyslop, Tile2Hatch tool \xa9 CVH 2020\n;Developed in mm as metric QCAD3 pattern\n270,17.568333418,17.568333164,25.4,25.4,22.436666582,-2.963333418\n270,20.531666836,17.568333164,25.4,25.4,22.436666582,-2.963333418\n270,4.868333164,4.868333418,25.4,25.4,22.436666582,-2.963333418\n270,7.831666582,4.868333418,25.4,25.4,22.436666582,-2.963333418\n180,17.568333418,7.831666582,0,25.4,22.436666582,-2.963333418\n180,17.568333418,4.868333164,0,25.4,22.436666582,-2.963333418\n180,4.868333418,20.531666836,0,25.4,22.436666582,-2.963333418\n180,4.868333418,17.568333418,0,25.4,22.436666582,-2.963333418\n")),N(O.ParsePatFile("\n*LEAF-01,LEAF-01\n;By John Hyslop, Using AutoCAD Lisp Tool\n;Developed in mm as metric QCAD3 pattern\n83.659808,22.86,5.08,25.244646742,2.804960862,2.30006779,-227.706714766\n26.565051,22.352,4.826,34.077676066,11.35922544,0.567961272,-56.22816542\n14.036243,21.336,4.572,80.085263502,6.160405002,1.047268924,-103.679614078\n315,21.336,4.572,17.960512212,17.960512212,1.436840916,-34.484183508\n83.659808,21.336,4.572,25.244646742,2.804960862,2.30006779,-227.706714766\n0,20.066,4.572,0,25.4,1.27,-24.13\n345.963757,20.828,3.048,24.6416195,6.160405002,1.047268924,-103.679614078\n326.309932,20.066,3.556,56.357539812,7.04469254,0.915809954,-90.665192304\n303.690068,19.558,4.318,35.223462446,7.04469254,0.915809954,-90.665192304\n18.434949,18.796,4.064,56.225296744,8.032185358,0.803218612,-79.518633952\n288.434949,18.542,4.826,56.225296744,8.032185358,0.803218612,-79.518633952\n180,19.558,4.826,0,25.4,1.016,-24.384\n258.690068,19.812,6.096,24.906749272,4.981349956,1.29515108,-128.219944728\n243.434949,20.066,6.604,22.718450626,11.35922544,0.567961272,-56.22816542\n225,20.828,7.366,17.960512212,17.960512212,1.077630814,-34.843393864\n213.690068,21.59,7.874,35.223462446,7.04469254,0.915809954,-90.665192304\n191.309932,22.86,8.128,104.608346536,4.981349956,1.29515108,-128.219944728\n128.659808,7.62,10.668,35.701322044,3.966813504,1.626393496,-161.0129622\n143.130102,8.636,9.906,91.44,5.08,1.27,-125.73\n153.434949,9.652,9.398,22.718450626,11.35922544,1.135922544,-55.660204148\n192.528808,9.652,9.398,104.69063898,2.755016842,2.341764176,-231.834664854\n105.945396,9.652,9.398,80.246041438,3.488958224,1.84914794,-183.065643266\n153.434949,10.668,8.89,22.718450626,11.35922544,1.135922544,-55.660204148\n149.036243,11.938,8.128,56.628832894,4.356064186,1.481061808,-146.625116452\n95.710593,11.938,8.128,229.992896122,2.527394488,2.552668504,-252.714172244\n194.931417,11.938,8.128,289.599936166,1.636157764,3.94314045,-390.37089693\n135,12.954,7.112,17.960512212,17.960512212,1.436840916,-34.484183508\n123.690068,13.462,6.35,35.223462446,7.04469254,0.915809954,-90.665192304\n199.653824,13.462,6.35,297.294468148,1.708588912,3.775981526,-373.822164724\n71.565051,13.462,6.35,24.09655582,8.032185358,2.409655582,-77.912196982\n119.054604,14.732,4.064,204.766485564,2.467066186,2.61509002,-258.893915536\n288.434949,14.732,3.556,56.225296744,8.032185358,1.60643697,-78.715415594\n21.801409,13.462,3.048,56.599939124,4.716661636,1.36783191,-135.415354264\n11.309932,12.192,2.794,104.608346536,4.981349956,1.29515108,-128.219944728\n0,11.43,2.794,0,25.4,0.762,-24.638\n341.565051,9.906,3.302,24.09655582,8.032185358,1.60643697,-78.715415594\n326.309932,8.382,4.318,56.357539812,7.04469254,1.831620162,-89.74938235\n308.659808,7.366,5.588,35.701322044,3.966813504,1.626393496,-161.0129622\n300.963757,6.604,6.858,91.477345366,4.356064186,1.481061808,-146.625116452\n285.945396,6.096,8.636,80.246041438,3.488958224,1.84914794,-183.065643266\n270,6.096,10.414,0,25.4,1.778,-23.622\n279.462322,5.842,11.938,129.447762694,4.175734346,1.545021802,-152.95714646\n285.945396,5.334,13.716,80.246041438,3.488958224,1.84914794,-183.065643266\n123.690068,5.842,12.954,35.223462446,7.04469254,0.915809954,-90.665192304\n161.565051,6.604,12.7,24.09655582,8.032185358,0.803218612,-79.518633952\n171.869898,8.382,12.446,25.144717046,3.592102544,1.796051272,-177.809071102\n171.869898,10.16,12.192,25.144717046,3.592102544,1.796051272,-177.809071102\n161.565051,11.684,11.684,24.09655582,8.032185358,1.60643697,-78.715415594\n161.565051,13.208,11.176,24.09655582,8.032185358,1.60643697,-78.715415594\n146.309932,14.732,10.16,56.357539812,7.04469254,1.831620162,-89.74938235\n119.744881,15.748,8.382,148.072666262,3.150482142,2.047813532,-202.733533318\n111.801409,16.256,7.112,56.599939124,4.716661636,1.36783191,-135.415354264\n90,16.256,6.096,0,25.4,1.016,-24.384\n75.963757,16.002,5.08,24.6416195,6.160405002,1.047268924,-103.679614078\n56.309932,15.494,4.318,56.357539812,7.04469254,0.915809954,-90.665192304\n63.434949,15.24,3.81,22.718450626,11.35922544,0.567961272,-56.22816542\n126.869898,16.002,2.794,35.56,5.08,1.27,-125.73\n45,15.24,2.032,17.960512212,17.960512212,1.077630814,-34.843393864\n233.130102,22.606,1.016,91.44,5.08,1.27,-125.73\n258.690068,1.778,1.27,24.906749272,4.981349956,1.29515108,-128.219944728\n258.690068,3.556,1.27,24.906749272,4.981349956,1.29515108,-128.219944728\n198.434949,6.604,0.508,56.225296744,8.032185358,1.60643697,-78.715415594\n225,7.874,0.508,17.960512212,17.960512212,0.718420458,-35.202603966\n198.434949,8.636,0.762,56.225296744,8.032185358,0.803218612,-79.518633952\n348.690068,7.366,1.016,24.906749272,4.981349956,1.29515108,-128.219944728\n345.963757,6.35,1.27,24.6416195,6.160405002,1.047268924,-103.679614078\n333.434949,5.334,1.778,22.718450626,11.35922544,1.135922544,-55.660204148\n333.434949,3.81,2.54,22.718450626,11.35922544,1.703883816,-55.092242876\n348.690068,2.54,2.794,24.906749272,4.981349956,1.29515108,-128.219944728\n0,1.778,2.794,0,25.4,0.762,-24.638\n8.130102,0,2.54,154.460405328,3.592102544,1.796051272,-177.809071102\n236.309932,0.508,5.842,56.357539812,7.04469254,0.915809954,-90.665192304\n236.309932,1.016,6.604,56.357539812,7.04469254,0.915809954,-90.665192304\n213.690068,1.778,7.112,35.223462446,7.04469254,0.915809954,-90.665192304\n0,0.762,7.112,0,25.4,1.016,-24.384\n326.309932,0,7.62,56.357539812,7.04469254,0.915809954,-90.665192304\n18.434949,0,6.604,56.225296744,8.032185358,0.803218612,-79.518633952\n0,0,13.97,0,25.4,1.778,-23.622\n14.036243,2.54,15.494,80.085263502,6.160405002,1.047268924,-103.679614078\n21.801409,1.27,14.986,56.599939124,4.716661636,1.36783191,-135.415354264\n30.963757,0,14.224,91.477345366,4.356064186,1.481061808,-146.625116452\n254.054604,0.508,16.764,104.668749768,3.488958224,1.84914794,-183.065643266\n158.198591,1.27,17.526,80.18324705,4.716661636,1.36783191,-135.415354264\n153.434949,2.794,16.764,22.718450626,11.35922544,1.703883816,-55.092242876\n158.198591,4.064,16.256,80.18324705,4.716661636,1.36783191,-135.415354264\n180,5.334,16.256,0,25.4,1.27,-24.13\n33.690068,4.572,15.748,35.223462446,7.04469254,0.915809954,-90.665192304\n45,4.064,15.24,17.960512212,17.960512212,0.718420458,-35.202603966\n53.130102,3.302,14.224,91.44,5.08,1.27,-125.73\n56.309932,2.286,12.7,56.357539812,7.04469254,1.831620162,-89.74938235\n51.340192,1.27,11.43,126.938033652,3.966813504,1.626393496,-161.0129622\n38.659808,0,10.414,35.701322044,3.966813504,1.626393496,-161.0129622\n180,20.828,12.192,0,25.4,2.54,-22.86\n310.601295,20.828,12.192,35.815218692,2.755016842,2.341764176,-231.834664854\n82.405357,20.828,12.192,204.774468022,1.678479244,3.843717484,-380.528029646\n180,21.336,12.192,0,25.4,0.508,-24.892\n194.036243,22.352,12.446,80.085263502,6.160405002,1.047268924,-103.679614078\n198.434949,23.114,12.7,56.225296744,8.032185358,0.803218612,-79.518633952\n0,21.082,9.398,0,25.4,2.032,-23.368\n348.690068,19.812,9.652,24.906749272,4.981349956,1.29515108,-128.219944728\n321.340192,18.542,10.668,126.938033652,3.966813504,1.626393496,-161.0129622\n300.963757,17.78,11.938,91.477345366,4.356064186,1.481061808,-146.625116452\n21.801409,16.51,11.43,56.599939124,4.716661636,1.36783191,-135.415354264\n284.036243,16.256,12.446,80.085263502,6.160405002,1.047268924,-103.679614078\n180,17.78,12.446,0,25.4,1.524,-23.876\n261.869898,18.034,14.224,25.144717046,3.592102544,1.796051272,-177.809071102\n248.198591,18.542,15.494,80.18324705,4.716661636,1.36783191,-135.415354264\n225,19.558,16.51,17.960512212,17.960512212,1.436840916,-34.484183508\n216.869898,20.574,17.272,35.56,5.08,1.27,-125.73\n198.434949,22.86,18.034,56.225296744,8.032185358,2.409655582,-77.912196982\n153.434949,9.144,16.51,22.718450626,11.35922544,1.703883816,-55.092242876\n170.537678,10.668,16.256,25.054405568,4.175734346,1.545021802,-152.95714646\n188.130102,12.446,16.51,154.460405328,3.592102544,1.796051272,-177.809071102\n201.801409,13.716,17.018,56.599939124,4.716661636,1.36783191,-135.415354264\n219.805571,15.24,18.288,35.773504272,3.252136752,1.9838035,-196.396538372\n18.434949,24.638,6.35,56.225296744,8.032185358,0.803218612,-79.518633952\n33.690068,23.876,5.842,35.223462446,7.04469254,0.915809954,-90.665192304\n0,23.876,5.842,0,25.4,1.016,-24.384\n80.537678,23.876,5.842,25.054405568,4.175734346,1.545021802,-152.95714646\n36.869898,22.86,5.08,35.56,5.08,1.27,-125.73\n341.565051,22.86,5.08,24.09655582,8.032185358,1.60643697,-78.715415594\n53.130102,24.638,4.064,91.44,5.08,1.27,-125.73\n38.659808,23.368,3.048,35.701322044,3.966813504,1.626393496,-161.0129622\n9.462322,21.844,2.794,129.447762694,4.175734346,1.545021802,-152.95714646\n180,24.13,8.128,0,25.4,1.27,-24.13\n158.198591,25.4,7.62,80.18324705,4.716661636,1.36783191,-135.415354264\n216.869898,23.622,1.778,35.56,5.08,1.27,-125.73\n206.565051,24.638,2.286,34.077676066,11.35922544,1.135922544,-55.660204148\n198.434949,25.4,2.54,56.225296744,8.032185358,0.803218612,-79.518633952\n90,24.638,0,0,25.4,0.508,-24.892\n26.565051,24.384,13.462,34.077676066,11.35922544,1.135922544,-55.660204148\n56.309932,24.384,13.462,56.357539812,7.04469254,1.831620162,-89.74938235\n36.869898,24.384,13.462,35.56,5.08,1.27,-125.73\n30.963757,23.114,12.7,91.477345366,4.356064186,1.481061808,-146.625116452\n78.690068,23.114,12.7,24.906749272,4.981349956,3.885452986,-125.629642822\n156.037511,25.4,11.684,193.423444496,2.578979348,2.501609932,-247.659378188\n30.963757,24.13,9.652,91.477345366,4.356064186,1.481061808,-146.625116452\n14.036243,23.114,9.398,80.085263502,6.160405002,1.047268924,-103.679614078\n180,25.4,18.034,0,25.4,2.54,-22.86\n0,21.844,22.098,0,25.4,2.286,-23.114\n11.309932,24.13,22.098,104.608346536,4.981349956,1.29515108,-128.219944728\n135,25.4,20.828,17.960512212,17.960512212,1.796051272,-34.124973152\n0,24.384,19.304,0,25.4,1.016,-24.384\n345.963757,23.368,19.558,24.6416195,6.160405002,1.047268924,-103.679614078\n333.434949,22.352,20.066,22.718450626,11.35922544,1.135922544,-55.660204148\n315,21.844,20.574,17.960512212,17.960512212,0.718420458,-35.202603966\n306.869898,21.082,21.59,35.56,5.08,1.27,-125.73\n11.309932,19.812,21.336,104.608346536,4.981349956,1.29515108,-128.219944728\n284.036243,19.558,22.352,80.085263502,6.160405002,1.047268924,-103.679614078\n180,21.082,22.352,0,25.4,1.524,-23.876\n14.036243,16.51,22.606,80.085263502,6.160405002,1.047268924,-103.679614078\n18.434949,15.748,22.352,56.225296744,8.032185358,0.803218612,-79.518633952\n33.690068,14.986,21.844,35.223462446,7.04469254,0.915809954,-90.665192304\n230.194429,16.51,19.812,162.6068376,3.252136752,1.9838035,-196.396538372\n239.036243,17.272,21.082,56.628832894,4.356064186,1.481061808,-146.625116452\n236.309932,18.288,22.606,56.357539812,7.04469254,1.831620162,-89.74938235\n213.690068,19.05,23.114,35.223462446,7.04469254,0.915809954,-90.665192304\n198.434949,19.812,23.368,56.225296744,8.032185358,0.803218612,-79.518633952\n0,18.796,23.368,0,25.4,1.016,-24.384\n345.963757,17.78,23.622,24.6416195,6.160405002,1.047268924,-103.679614078\n261.869898,21.336,24.13,25.144717046,3.592102544,1.796051272,-177.809071102\n248.198591,21.844,25.4,80.18324705,4.716661636,1.36783191,-135.415354264\n36.869898,13.97,21.082,35.56,5.08,1.27,-125.73\n0,13.97,21.082,0,25.4,2.032,-23.368\n78.690068,13.97,21.082,24.906749272,4.981349956,2.590301906,-126.924793648\n33.690068,13.208,20.574,35.223462446,7.04469254,0.915809954,-90.665192304\n30.963757,11.938,19.812,91.477345366,4.356064186,1.481061808,-146.625116452\n336.037511,11.938,19.812,193.423444496,2.578979348,2.501609932,-247.659378188\n79.380345,11.938,19.812,283.976346702,1.560309554,4.134820534,-409.347222706\n26.565051,10.922,19.304,34.077676066,11.35922544,1.135922544,-55.660204148\n9.462322,9.398,19.05,129.447762694,4.175734346,1.545021802,-152.95714646\n318.814075,9.398,19.05,234.164238554,2.389431086,2.700057084,-267.30564649\n82.405357,9.398,19.05,204.774468022,1.678479244,3.843717484,-380.528029646\n0,8.382,19.05,0,25.4,1.016,-24.384\n0,7.366,19.05,0,25.4,1.016,-24.384\n0,5.08,19.304,0,25.4,1.524,-23.876\n104.036243,5.334,18.288,80.085263502,6.160405002,1.047268924,-103.679614078\n201.801409,6.604,18.796,56.599939124,4.716661636,1.36783191,-135.415354264\n123.690068,7.62,17.272,35.223462446,7.04469254,1.831620162,-89.74938235\n338.198591,16.51,24.13,80.18324705,4.716661636,1.36783191,-135.415354264\n333.434949,14.986,24.892,22.718450626,11.35922544,1.703883816,-55.092242876\n348.690068,13.716,25.146,24.906749272,4.981349956,1.29515108,-128.219944728\n0,11.684,25.146,0,25.4,2.032,-23.368\n18.434949,10.16,24.638,56.225296744,8.032185358,1.60643697,-78.715415594\n26.565051,8.636,23.876,34.077676066,11.35922544,1.703883816,-55.092242876\n45,7.366,22.606,17.960512212,17.960512212,1.796051272,-34.124973152\n71.565051,6.858,21.082,24.09655582,8.032185358,1.60643697,-78.715415594\n81.869898,6.604,19.304,25.144717046,3.592102544,1.796051272,-177.809071102\n;0,5.08,19.304,0,25.4,1.524,-23.876\n315,0,20.828,17.960512212,17.960512212,0.718420458,-35.202603966\n198.434949,0.762,22.606,56.225296744,8.032185358,0.803218612,-79.518633952\n343.300756,0.762,22.606,184.898786158,2.432878802,2.651837978,-262.531947376\n74.744881,0.762,22.606,104.703186326,2.22772732,2.896045516,-286.708512434\n206.565051,1.27,22.86,34.077676066,11.35922544,0.567961272,-56.22816542\n213.690068,2.032,23.368,35.223462446,7.04469254,0.915809954,-90.665192304\n216.869898,3.048,24.13,35.56,5.08,1.27,-125.73\n352.874984,3.048,24.13,25.203858152,3.150482142,2.047813532,-202.733533318\n78.690068,3.048,24.13,24.906749272,4.981349956,1.29515108,-128.219944728\n213.690068,3.81,24.638,35.223462446,7.04469254,0.915809954,-90.665192304\n213.690068,4.572,25.146,35.223462446,7.04469254,0.915809954,-90.665192304\n206.565051,5.08,25.4,34.077676066,11.35922544,0.567961272,-56.22816542\n45,7.112,25.146,17.960512212,17.960512212,0.359210356,-35.561814322\n56.309932,6.604,24.384,56.357539812,7.04469254,0.915809954,-90.665192304\n56.309932,5.588,22.86,56.357539812,7.04469254,1.831620162,-89.74938235\n53.130102,4.826,21.844,91.44,5.08,1.27,-125.73\n45,3.556,20.574,17.960512212,17.960512212,1.796051272,-34.124973152\n36.869898,2.54,19.812,35.56,5.08,1.27,-125.73\n18.434949,1.016,19.304,56.225296744,8.032185358,1.60643697,-78.715415594\n0,0,19.304,0,25.4,1.016,-24.384\n81.253838,24.13,22.098,179.594740378,1.931126186,3.340848284,-330.743991038\n")),N(O.ParsePatFile("\n*LEAF-02,LEAF-02\n;By John Hyslop, Using AutoCAD Lisp Tool\n;Developed in mm as metric QCAD3 pattern\n303.690068,19.558,4.318,35.223462446,7.04469254,0.915809954,-90.665192304\n18.434949,18.796,4.064,56.225296744,8.032185358,0.803218612,-79.518633952\n288.434949,18.542,4.826,56.225296744,8.032185358,0.803218612,-79.518633952\n180,19.558,4.826,0,25.4,1.016,-24.384\n258.690068,19.812,6.096,24.906749272,4.981349956,1.29515108,-128.219944728\n243.434949,20.066,6.604,22.718450626,11.35922544,0.567961272,-56.22816542\n288.434949,14.732,3.556,56.225296744,8.032185358,1.60643697,-78.715415594\n21.801409,13.462,3.048,56.599939124,4.716661636,1.36783191,-135.415354264\n11.309932,12.192,2.794,104.608346536,4.981349956,1.29515108,-128.219944728\n0,11.43,2.794,0,25.4,0.762,-24.638\n341.565051,9.906,3.302,24.09655582,8.032185358,1.60643697,-78.715415594\n326.309932,8.382,4.318,56.357539812,7.04469254,1.831620162,-89.74938235\n308.659808,7.366,5.588,35.701322044,3.966813504,1.626393496,-161.0129622\n300.963757,6.604,6.858,91.477345366,4.356064186,1.481061808,-146.625116452\n285.945396,6.096,8.636,80.246041438,3.488958224,1.84914794,-183.065643266\n270,6.096,10.414,0,25.4,1.778,-23.622\n279.462322,5.842,11.938,129.447762694,4.175734346,1.545021802,-152.95714646\n285.945396,5.334,13.716,80.246041438,3.488958224,1.84914794,-183.065643266\n123.690068,5.842,12.954,35.223462446,7.04469254,0.915809954,-90.665192304\n161.565051,6.604,12.7,24.09655582,8.032185358,0.803218612,-79.518633952\n171.869898,8.382,12.446,25.144717046,3.592102544,1.796051272,-177.809071102\n171.869898,10.16,12.192,25.144717046,3.592102544,1.796051272,-177.809071102\n161.565051,11.684,11.684,24.09655582,8.032185358,1.60643697,-78.715415594\n161.565051,13.208,11.176,24.09655582,8.032185358,1.60643697,-78.715415594\n146.309932,14.732,10.16,56.357539812,7.04469254,1.831620162,-89.74938235\n119.744881,15.748,8.382,148.072666262,3.150482142,2.047813532,-202.733533318\n111.801409,16.256,7.112,56.599939124,4.716661636,1.36783191,-135.415354264\n90,16.256,6.096,0,25.4,1.016,-24.384\n75.963757,16.002,5.08,24.6416195,6.160405002,1.047268924,-103.679614078\n56.309932,15.494,4.318,56.357539812,7.04469254,0.915809954,-90.665192304\n63.434949,15.24,3.81,22.718450626,11.35922544,0.567961272,-56.22816542\n126.869898,16.002,2.794,35.56,5.08,1.27,-125.73\n45,15.24,2.032,17.960512212,17.960512212,1.077630814,-34.843393864\n225,7.874,0.508,17.960512212,17.960512212,0.718420458,-35.202603966\n198.434949,8.636,0.762,56.225296744,8.032185358,0.803218612,-79.518633952\n348.690068,7.366,1.016,24.906749272,4.981349956,1.29515108,-128.219944728\n345.963757,6.35,1.27,24.6416195,6.160405002,1.047268924,-103.679614078\n333.434949,5.334,1.778,22.718450626,11.35922544,1.135922544,-55.660204148\n333.434949,3.81,2.54,22.718450626,11.35922544,1.703883816,-55.092242876\n348.690068,2.54,2.794,24.906749272,4.981349956,1.29515108,-128.219944728\n0,1.778,2.794,0,25.4,0.762,-24.638\n8.130102,0,2.54,154.460405328,3.592102544,1.796051272,-177.809071102\n236.309932,0.508,5.842,56.357539812,7.04469254,0.915809954,-90.665192304\n236.309932,1.016,6.604,56.357539812,7.04469254,0.915809954,-90.665192304\n213.690068,1.778,7.112,35.223462446,7.04469254,0.915809954,-90.665192304\n0,0.762,7.112,0,25.4,1.016,-24.384\n326.309932,0,7.62,56.357539812,7.04469254,0.915809954,-90.665192304\n158.198591,1.27,17.526,80.18324705,4.716661636,1.36783191,-135.415354264\n153.434949,2.794,16.764,22.718450626,11.35922544,1.703883816,-55.092242876\n158.198591,4.064,16.256,80.18324705,4.716661636,1.36783191,-135.415354264\n180,5.334,16.256,0,25.4,1.27,-24.13\n33.690068,4.572,15.748,35.223462446,7.04469254,0.915809954,-90.665192304\n45,4.064,15.24,17.960512212,17.960512212,0.718420458,-35.202603966\n53.130102,3.302,14.224,91.44,5.08,1.27,-125.73\n56.309932,2.286,12.7,56.357539812,7.04469254,1.831620162,-89.74938235\n51.340192,1.27,11.43,126.938033652,3.966813504,1.626393496,-161.0129622\n38.659808,0,10.414,35.701322044,3.966813504,1.626393496,-161.0129622\n321.340192,18.542,10.668,126.938033652,3.966813504,1.626393496,-161.0129622\n300.963757,17.78,11.938,91.477345366,4.356064186,1.481061808,-146.625116452\n21.801409,16.51,11.43,56.599939124,4.716661636,1.36783191,-135.415354264\n284.036243,16.256,12.446,80.085263502,6.160405002,1.047268924,-103.679614078\n180,17.78,12.446,0,25.4,1.524,-23.876\n261.869898,18.034,14.224,25.144717046,3.592102544,1.796051272,-177.809071102\n248.198591,18.542,15.494,80.18324705,4.716661636,1.36783191,-135.415354264\n225,19.558,16.51,17.960512212,17.960512212,1.436840916,-34.484183508\n284.036243,19.558,22.352,80.085263502,6.160405002,1.047268924,-103.679614078\n0,5.08,19.304,0,25.4,1.524,-23.876\n104.036243,5.334,18.288,80.085263502,6.160405002,1.047268924,-103.679614078\n201.801409,6.604,18.796,56.599939124,4.716661636,1.36783191,-135.415354264\n123.690068,7.62,17.272,35.223462446,7.04469254,1.831620162,-89.74938235\n153.434949,9.144,16.51,22.718450626,11.35922544,1.703883816,-55.092242876\n170.537678,10.668,16.256,25.054405568,4.175734346,1.545021802,-152.95714646\n188.130102,12.446,16.51,154.460405328,3.592102544,1.796051272,-177.809071102\n201.801409,13.716,17.018,56.599939124,4.716661636,1.36783191,-135.415354264\n219.805571,15.24,18.288,35.773504272,3.252136752,1.9838035,-196.396538372\n230.194429,16.51,19.812,162.6068376,3.252136752,1.9838035,-196.396538372\n239.036243,17.272,21.082,56.628832894,4.356064186,1.481061808,-146.625116452\n236.309932,18.288,22.606,56.357539812,7.04469254,1.831620162,-89.74938235\n213.690068,19.05,23.114,35.223462446,7.04469254,0.915809954,-90.665192304\n198.434949,19.812,23.368,56.225296744,8.032185358,0.803218612,-79.518633952\n0,18.796,23.368,0,25.4,1.016,-24.384\n345.963757,17.78,23.622,24.6416195,6.160405002,1.047268924,-103.679614078\n338.198591,16.51,24.13,80.18324705,4.716661636,1.36783191,-135.415354264\n45,7.366,22.606,17.960512212,17.960512212,1.796051272,-34.124973152\n71.565051,6.858,21.082,24.09655582,8.032185358,1.60643697,-78.715415594\n81.869898,6.604,19.304,25.144717046,3.592102544,1.796051272,-177.809071102\n;0,5.08,19.304,0,25.4,1.524,-23.876\n53.130102,4.826,21.844,91.44,5.08,1.27,-125.73\n45,3.556,20.574,17.960512212,17.960512212,1.796051272,-34.124973152\n36.869898,2.54,19.812,35.56,5.08,1.27,-125.73\n18.434949,1.016,19.304,56.225296744,8.032185358,1.60643697,-78.715415594\n0,0,19.304,0,25.4,1.016,-24.384\n0,24.384,19.304,0,25.4,1.016,-24.384\n345.963757,23.368,19.558,24.6416195,6.160405002,1.047268924,-103.679614078\n333.434949,22.352,20.066,22.718450626,11.35922544,1.135922544,-55.660204148\n315,21.844,20.574,17.960512212,17.960512212,0.718420458,-35.202603966\n306.869898,21.082,21.59,35.56,5.08,1.27,-125.73\n11.309932,19.812,21.336,104.608346536,4.981349956,1.29515108,-128.219944728\n180,21.082,22.352,0,25.4,1.524,-23.876\n261.869898,21.336,24.13,25.144717046,3.592102544,1.796051272,-177.809071102\n248.198591,21.844,25.4,80.18324705,4.716661636,1.36783191,-135.415354264\n333.434949,14.986,24.892,22.718450626,11.35922544,1.703883816,-55.092242876\n348.690068,13.716,25.146,24.906749272,4.981349956,1.29515108,-128.219944728\n0,11.684,25.146,0,25.4,2.032,-23.368\n18.434949,10.16,24.638,56.225296744,8.032185358,1.60643697,-78.715415594\n26.565051,8.636,23.876,34.077676066,11.35922544,1.703883816,-55.092242876\n45,7.112,25.146,17.960512212,17.960512212,0.359210356,-35.561814322\n56.309932,6.604,24.384,56.357539812,7.04469254,0.915809954,-90.665192304\n56.309932,5.588,22.86,56.357539812,7.04469254,1.831620162,-89.74938235\n53.130102,24.638,4.064,91.44,5.08,1.27,-125.73\n38.659808,23.368,3.048,35.701322044,3.966813504,1.626393496,-161.0129622\n9.462322,21.844,2.794,129.447762694,4.175734346,1.545021802,-152.95714646\n345.963757,20.828,3.048,24.6416195,6.160405002,1.047268924,-103.679614078\n326.309932,20.066,3.556,56.357539812,7.04469254,0.915809954,-90.665192304\n225,20.828,7.366,17.960512212,17.960512212,1.077630814,-34.843393864\n213.690068,21.59,7.874,35.223462446,7.04469254,0.915809954,-90.665192304\n191.309932,22.86,8.128,104.608346536,4.981349956,1.29515108,-128.219944728\n180,24.13,8.128,0,25.4,1.27,-24.13\n158.198591,25.4,7.62,80.18324705,4.716661636,1.36783191,-135.415354264\n233.130102,22.606,1.016,91.44,5.08,1.27,-125.73\n216.869898,23.622,1.778,35.56,5.08,1.27,-125.73\n206.565051,24.638,2.286,34.077676066,11.35922544,1.135922544,-55.660204148\n198.434949,25.4,2.54,56.225296744,8.032185358,0.803218612,-79.518633952\n30.963757,24.13,9.652,91.477345366,4.356064186,1.481061808,-146.625116452\n14.036243,23.114,9.398,80.085263502,6.160405002,1.047268924,-103.679614078\n0,21.082,9.398,0,25.4,2.032,-23.368\n348.690068,19.812,9.652,24.906749272,4.981349956,1.29515108,-128.219944728\n216.869898,20.574,17.272,35.56,5.08,1.27,-125.73\n198.434949,22.86,18.034,56.225296744,8.032185358,2.409655582,-77.912196982\n180,25.4,18.034,0,25.4,2.54,-22.86\n")),N(O.ParsePatFile("\n*LEAF-03,LEAF-03\n;By John Hyslop, Using AutoCAD Lisp Tool\n;Developed in mm as metric QCAD3 pattern\n344.054604,21.844,9.652,104.668749768,3.488958224,1.84914794,-183.065643266\n338.198591,20.574,10.16,80.18324705,4.716661636,1.36783191,-135.415354264\n326.309932,19.05,11.176,56.357539812,7.04469254,1.831620162,-89.74938235\n320.194429,17.526,12.446,162.6068376,3.252136752,1.9838035,-196.396538372\n308.659808,16.51,13.716,35.701322044,3.966813504,1.626393496,-161.0129622\n300.963757,15.748,14.986,91.477345366,4.356064186,1.481061808,-146.625116452\n293.198591,14.986,16.764,56.698117744,3.335183322,1.934406342,-191.506230398\n281.309932,14.732,18.034,104.608346536,4.981349956,1.29515108,-128.219944728\n276.340192,14.478,20.32,204.76213556,2.804960862,2.30006779,-227.706714766\n270,14.478,21.59,0,25.4,1.27,-24.13\n257.471192,14.986,23.876,129.485790304,2.755016842,2.341764176,-231.834664854\n164.054604,16.764,23.368,104.668749768,3.488958224,1.84914794,-183.065643266\n158.198591,18.034,22.86,80.18324705,4.716661636,1.36783191,-135.415354264\n146.309932,19.558,21.844,56.357539812,7.04469254,1.831620162,-89.74938235\n140.194429,21.082,20.574,162.6068376,3.252136752,1.9838035,-196.396538372\n125.537678,22.352,18.796,126.965671138,2.952690056,2.18499055,-216.314071054\n116.565051,23.368,16.764,34.077676066,11.35922544,2.271845088,-54.524281604\n105.945396,23.876,14.986,80.246041438,3.488958224,1.84914794,-183.065643266\n97.125016,24.13,12.954,179.577488698,3.150482142,2.047813532,-202.733533318\n90,24.13,11.43,0,25.4,1.524,-23.876\n77.471192,23.622,9.144,129.485790304,2.755016842,2.341764176,-231.834664854\n195.945396,3.556,9.652,80.246041438,3.488958224,1.84914794,-183.065643266\n201.801409,4.826,10.16,56.599939124,4.716661636,1.36783191,-135.415354264\n213.690068,6.35,11.176,35.223462446,7.04469254,1.831620162,-89.74938235\n219.805571,7.874,12.446,35.773504272,3.252136752,1.9838035,-196.396538372\n231.340192,8.89,13.716,126.938033652,3.966813504,1.626393496,-161.0129622\n239.036243,9.652,14.986,56.628832894,4.356064186,1.481061808,-146.625116452\n246.801409,10.414,16.764,136.74251925,3.335183322,1.934406342,-191.506230398\n258.690068,10.668,18.034,24.906749272,4.981349956,1.29515108,-128.219944728\n263.659808,10.922,20.32,25.244646742,2.804960862,2.30006779,-227.706714766\n270,10.922,21.59,0,25.4,1.27,-24.13\n282.528808,10.414,23.876,104.69063898,2.755016842,2.341764176,-231.834664854\n15.945396,8.636,23.368,80.246041438,3.488958224,1.84914794,-183.065643266\n21.801409,7.366,22.86,56.599939124,4.716661636,1.36783191,-135.415354264\n33.690068,5.842,21.844,35.223462446,7.04469254,1.831620162,-89.74938235\n39.805571,4.318,20.574,35.773504272,3.252136752,1.9838035,-196.396538372\n54.462322,3.048,18.796,91.53339072,2.952690056,2.18499055,-216.314071054\n63.434949,2.032,16.764,22.718450626,11.35922544,2.271845088,-54.524281604\n74.054604,1.524,14.986,104.668749768,3.488958224,1.84914794,-183.065643266\n82.874984,1.27,12.954,25.203858152,3.150482142,2.047813532,-202.733533318\n90,1.27,11.43,0,25.4,1.524,-23.876\n102.528808,1.778,9.144,104.69063898,2.755016842,2.341764176,-231.834664854\n128.659808,5.334,3.81,35.701322044,3.966813504,1.626393496,-161.0129622\n146.309932,6.858,2.794,56.357539812,7.04469254,1.831620162,-89.74938235\n153.434949,8.382,2.032,22.718450626,11.35922544,1.703883816,-55.092242876\n164.054604,10.16,1.524,104.668749768,3.488958224,1.84914794,-183.065643266\n171.869898,11.938,1.27,25.144717046,3.592102544,1.796051272,-177.809071102\n180,13.462,1.27,0,25.4,1.524,-23.876\n188.130102,15.24,1.524,154.460405328,3.592102544,1.796051272,-177.809071102\n195.945396,17.018,2.032,80.246041438,3.488958224,1.84914794,-183.065643266\n206.565051,18.542,2.794,34.077676066,11.35922544,1.703883816,-55.092242876\n218.659808,19.812,3.81,35.701322044,3.966813504,1.626393496,-161.0129622\n225,21.082,5.08,17.960512212,17.960512212,1.796051272,-34.124973152\n315,19.812,6.35,17.960512212,17.960512212,1.796051272,-34.124973152\n321.340192,18.542,7.366,126.938033652,3.966813504,1.626393496,-161.0129622\n336.801409,16.764,8.128,136.74251925,3.335183322,1.934406342,-191.506230398\n341.565051,15.24,8.636,24.09655582,8.032185358,1.60643697,-78.715415594\n351.869898,13.462,8.89,25.144717046,3.592102544,1.796051272,-177.809071102\n0,11.938,8.89,0,25.4,1.524,-23.876\n8.130102,10.16,8.636,154.460405328,3.592102544,1.796051272,-177.809071102\n18.434949,8.636,8.128,56.225296744,8.032185358,1.60643697,-78.715415594\n23.198591,6.858,7.366,56.698117744,3.335183322,1.934406342,-191.506230398\n38.659808,5.588,6.35,35.701322044,3.966813504,1.626393496,-161.0129622\n45,4.318,5.08,17.960512212,17.960512212,1.796051272,-34.124973152\n")),N(O.ParsePatFile("\n*LINE,LINE\n0, 0,0, 0,3.175\n")),N(O.ParsePatFile("\n*LOOPLINKS,LOOPLINKS\n;By John Hyslop, Using AutoCAD Lisp Tool\n;Developed in mm as metric QCAD3 pattern\n206.565051,13.462,17.018,34.077676066,11.35922544,0.567961272,-56.22816542\n243.434949,13.716,17.526,22.718450626,11.35922544,0.567961272,-56.22816542\n116.565051,11.938,17.018,34.077676066,11.35922544,0.567961272,-56.22816542\n153.434949,12.446,16.764,22.718450626,11.35922544,0.567961272,-56.22816542\n180,12.954,16.764,0,25.4,0.508,-24.892\n258.690068,4.826,14.986,24.906749272,4.981349956,1.29515108,-128.219944728\n251.565051,5.08,15.748,24.09655582,8.032185358,0.803218612,-79.518633952\n243.434949,5.588,16.764,22.718450626,11.35922544,1.135922544,-55.660204148\n230.194429,6.858,18.288,162.6068376,3.252136752,1.9838035,-196.396538372\n225,7.874,19.304,17.960512212,17.960512212,1.436840916,-34.484183508\n209.744881,9.652,20.32,148.072666262,3.150482142,2.047813532,-202.733533318\n194.036243,11.684,20.828,80.085263502,6.160405002,2.094537594,-102.632345154\n251.565051,7.112,15.24,24.09655582,8.032185358,1.60643697,-78.715415594\n239.036243,7.874,16.51,56.628832894,4.356064186,1.481061808,-146.625116452\n225,8.89,17.526,17.960512212,17.960512212,1.436840916,-34.484183508\n210.963757,10.16,18.288,91.477345366,4.356064186,1.481061808,-146.625116452\n198.434949,11.684,18.796,56.225296744,8.032185358,1.60643697,-78.715415594\n116.565051,17.018,11.938,34.077676066,11.35922544,0.567961272,-56.22816542\n153.434949,17.526,11.684,22.718450626,11.35922544,0.567961272,-56.22816542\n26.565051,17.018,13.462,34.077676066,11.35922544,0.567961272,-56.22816542\n63.434949,16.764,12.954,22.718450626,11.35922544,0.567961272,-56.22816542\n90,16.764,12.446,0,25.4,0.508,-24.892\n168.690068,14.986,20.574,24.906749272,4.981349956,1.29515108,-128.219944728\n161.565051,15.748,20.32,24.09655582,8.032185358,0.803218612,-79.518633952\n153.434949,16.764,19.812,22.718450626,11.35922544,1.135922544,-55.660204148\n140.194429,18.288,18.542,162.6068376,3.252136752,1.9838035,-196.396538372\n135,19.304,17.526,17.960512212,17.960512212,1.436840916,-34.484183508\n119.744881,20.32,15.748,148.072666262,3.150482142,2.047813532,-202.733533318\n104.036243,20.828,13.716,80.085263502,6.160405002,2.094537594,-102.632345154\n161.565051,15.24,18.288,24.09655582,8.032185358,1.60643697,-78.715415594\n149.036243,16.51,17.526,56.628832894,4.356064186,1.481061808,-146.625116452\n135,17.526,16.51,17.960512212,17.960512212,1.436840916,-34.484183508\n120.963757,18.288,15.24,91.477345366,4.356064186,1.481061808,-146.625116452\n108.434949,18.796,13.716,56.225296744,8.032185358,1.60643697,-78.715415594\n26.565051,11.938,8.382,34.077676066,11.35922544,0.567961272,-56.22816542\n63.434949,11.684,7.874,22.718450626,11.35922544,0.567961272,-56.22816542\n296.565051,13.462,8.382,34.077676066,11.35922544,0.567961272,-56.22816542\n333.434949,12.954,8.636,22.718450626,11.35922544,0.567961272,-56.22816542\n0,12.446,8.636,0,25.4,0.508,-24.892\n78.690068,20.574,10.414,24.906749272,4.981349956,1.29515108,-128.219944728\n71.565051,20.32,9.652,24.09655582,8.032185358,0.803218612,-79.518633952\n63.434949,19.812,8.636,22.718450626,11.35922544,1.135922544,-55.660204148\n50.194429,18.542,7.112,162.6068376,3.252136752,1.9838035,-196.396538372\n45,17.526,6.096,17.960512212,17.960512212,1.436840916,-34.484183508\n29.744881,15.748,5.08,148.072666262,3.150482142,2.047813532,-202.733533318\n14.036243,13.716,4.572,80.085263502,6.160405002,2.094537594,-102.632345154\n71.565051,18.288,10.16,24.09655582,8.032185358,1.60643697,-78.715415594\n59.036243,17.526,8.89,56.628832894,4.356064186,1.481061808,-146.625116452\n45,16.51,7.874,17.960512212,17.960512212,1.436840916,-34.484183508\n30.963757,15.24,7.112,91.477345366,4.356064186,1.481061808,-146.625116452\n18.434949,13.716,6.604,56.225296744,8.032185358,1.60643697,-78.715415594\n296.565051,8.382,13.462,34.077676066,11.35922544,0.567961272,-56.22816542\n333.434949,7.874,13.716,22.718450626,11.35922544,0.567961272,-56.22816542\n206.565051,8.382,11.938,34.077676066,11.35922544,0.567961272,-56.22816542\n243.434949,8.636,12.446,22.718450626,11.35922544,0.567961272,-56.22816542\n270,8.636,12.954,0,25.4,0.508,-24.892\n348.690068,10.414,4.826,24.906749272,4.981349956,1.29515108,-128.219944728\n341.565051,9.652,5.08,24.09655582,8.032185358,0.803218612,-79.518633952\n333.434949,8.636,5.588,22.718450626,11.35922544,1.135922544,-55.660204148\n320.194429,7.112,6.858,162.6068376,3.252136752,1.9838035,-196.396538372\n315,6.096,7.874,17.960512212,17.960512212,1.436840916,-34.484183508\n299.744881,5.08,9.652,148.072666262,3.150482142,2.047813532,-202.733533318\n284.036243,4.572,11.684,80.085263502,6.160405002,2.094537594,-102.632345154\n341.565051,10.16,7.112,24.09655582,8.032185358,1.60643697,-78.715415594\n329.036243,8.89,7.874,56.628832894,4.356064186,1.481061808,-146.625116452\n315,7.874,8.89,17.960512212,17.960512212,1.436840916,-34.484183508\n300.963757,7.112,10.16,91.477345366,4.356064186,1.481061808,-146.625116452\n288.434949,6.604,11.684,56.225296744,8.032185358,1.60643697,-78.715415594\n90,11.684,-7.874,0,25.4,15.748,-9.652\n270,13.716,7.874,0,25.4,15.748,-9.652\n180,7.874,11.684,0,25.4,15.748,-9.652\n0,-7.874,13.716,0,25.4,15.748,-9.652\n")),N(O.ParsePatFile("\n*MAZE-01\n;By John Hyslop, Tile2Hatch tool \xa9 CVH 2020\n;Developed in mm as metric QCAD3 pattern\n180,24.13,23.368,0,25.4,6.35,-19.05\n90,24.13,13.97,25.4,25.4,9.398,-16.002\n90,21.082,13.97,25.4,25.4,6.35,-19.05\n0,17.78,10.668,0,25.4,2.794,-22.606\n180,14.478,20.32,0,25.4,9.652,-15.748\n270,14.478,23.368,25.4,25.4,3.048,-22.352\n0,1.778,23.368,0,25.4,12.7,-12.7\n90,24.13,7.366,25.4,25.4,3.302,-22.098\n180,11.43,1.27,0,25.4,9.652,-15.748\n0,17.78,7.366,0,25.4,6.35,-19.05\n270,11.43,4.318,25.4,25.4,3.048,-22.352\n0,4.826,4.318,0,25.4,6.604,-18.796\n90,17.78,4.318,25.4,25.4,3.048,-22.352\n270,4.826,20.32,25.4,25.4,16.002,-9.398\n0,7.874,7.366,0,25.4,6.604,-18.796\n270,7.874,17.272,25.4,25.4,9.906,-15.494\n180,17.78,17.272,0,25.4,9.906,-15.494\n270,17.78,23.368,25.4,25.4,6.096,-19.304\n180,24.13,4.318,0,25.4,6.35,-19.05\n90,24.13,1.27,25.4,25.4,3.048,-22.352\n0,14.478,1.27,0,25.4,9.652,-15.748\n270,14.478,10.668,25.4,25.4,9.398,-16.002\n270,17.78,13.97,25.4,25.4,3.302,-22.098\n0,11.43,13.97,0,25.4,6.35,-19.05\n90,11.43,10.668,25.4,25.4,3.302,-22.098\n90,1.778,1.27,25.4,25.4,22.098,-3.302\n")),N(O.ParsePatFile("\n*MAZE-02\n;By John Hyslop, Tile2Hatch tool \xa9 CVH 2020\n;Developed in mm as metric QCAD3 pattern\n270,22.859999746,2.54,25.4,25.4,2.54,-22.86\n0,17.779999746,2.54,0,25.4,5.08,-20.32\n90,0,7.62,25.4,25.4,12.7,-12.7\n270,22.859999746,22.86,25.4,25.4,12.7,-12.7\n270,7.619999746,22.86,25.4,25.4,2.54,-22.86\n180,7.619999746,22.86,0,25.4,10.16,-15.24\n0,5.079999746,5.08,0,25.4,3.81,-21.59\n90,5.079999746,7.62,25.4,25.4,5.08,-20.32\n180,12.699999746,7.62,0,25.4,7.62,-17.78\n90,12.699999746,2.54,25.4,25.4,5.08,-20.32\n270,17.779999746,5.08,25.4,25.4,2.54,-22.86\n0,15.239999746,5.08,0,25.4,2.54,-22.86\n270,15.239999746,7.62,25.4,25.4,2.54,-22.86\n180,17.779999746,7.62,0,25.4,2.54,-22.86\n270,15.239999746,15.24,25.4,25.4,2.54,-22.86\n0,7.619999746,15.24,0,25.4,7.62,-17.78\n90,7.619999746,10.16,25.4,25.4,5.08,-20.32\n180,17.779999746,10.16,0,25.4,10.16,-15.24\n180,15.239999746,12.7,0,25.4,5.08,-20.32\n270,20.319999746,20.32,25.4,25.4,12.7,-12.7\n0,2.539999746,2.54,0,25.4,10.16,-15.24\n0,2.539999746,20.32,0,25.4,17.78,-7.62\n270,2.539999746,5.08,25.4,25.4,2.54,-22.86\n90,2.539999746,7.62,25.4,25.4,12.7,-12.7\n180,2.539999746,5.08,0,25.4,7.62,-17.78\n180,0,7.62,0,25.4,5.080000254,-20.319999746\n180,7.619999746,0,0,25.4,7.62,-17.78\n270,17.779999746,17.78,25.4,25.4,5.08,-20.32\n0,10.159999746,0,0,25.4,10.16,-15.24\n0,5.079999746,17.78,0,25.4,12.7,-12.7\n90,5.079999746,15.24,25.4,25.4,2.54,-22.86\n270,15.239999746,2.54,25.4,25.4,2.54,-22.86\n0,10.159999746,22.86,0,25.4,10.16,-15.24\n270,10.159999746,25.4,25.4,25.4,2.54,-22.86\n")),N(O.ParsePatFile("\n*MUDST,MUDST\n0, 0,0, 12.7,6.35, 6.35,-6.35,0,-6.35,0,-6.35\n")),N(O.ParsePatFile("\n*NET,NET\n0, 0,0, 0,3.175\n90, 0,0, 0,3.175\n")),N(O.ParsePatFile("\n*NET3,NET3\n0, 0,0, 0,3.175\n60, 0,0, 0,3.175\n120, 0,0, 0,3.175\n")),N(O.ParsePatFile("\n*PLAST,PLAST\n0, 0,0, 0,6.35\n0, 0,.79375, 0,6.35\n0, 0,1.5875, 0,6.35\n")),N(O.ParsePatFile("\n*PLASTI,PLASTI\n0, 0,0, 0,6.35\n0, 0,.79375, 0,6.35\n0, 0,1.5875, 0,6.35\n0, 0,3.96875, 0,6.35\n")),N(O.ParsePatFile("\n*QCAD-LOGO\n;By John Hyslop, Line 101 modified by CVH to fix left side of pencil drift when hatching far from Origin\n;Developed in mm as metric QCAD3 pattern\n243.434949,20.32,9.144,22.718450626,11.35922544,0.567961272,-56.22816542\n248.198591,20.828,10.414,80.18324705,4.716661636,1.36783191,-135.415354264\n263.659808,21.082,12.7,25.244646742,2.804960862,2.30006779,-227.706714766\n276.340192,20.828,14.986,204.76213556,2.804960862,2.30006779,-227.706714766\n290.556045,20.066,17.018,136.750876358,2.97284521,2.170177016,-214.847518234\n310.601295,18.542,18.796,35.815218692,2.755016842,2.341764176,-231.834664854\n324.462322,16.764,20.066,91.53339072,2.952690056,2.18499055,-216.314071054\n336.801409,14.986,20.828,136.74251925,3.335183322,1.934406342,-191.506230398\n351.869898,13.208,21.082,25.144717046,3.592102544,1.796051272,-177.809071102\n26.565051,15.494,4.572,34.077676066,11.35922544,1.703883816,-55.092242876\n7.125016,13.462,4.318,179.577488698,3.150482142,2.047813532,-202.733533318\n0,11.43,4.318,0,25.4,2.032,-23.368\n344.054604,9.652,4.826,104.668749768,3.488958224,1.84914794,-183.065643266\n336.801409,7.874,5.588,136.74251925,3.335183322,1.934406342,-191.506230398\n320.194429,6.35,6.858,162.6068376,3.252136752,1.9838035,-196.396538372\n308.659808,5.334,8.128,35.701322044,3.966813504,1.626393496,-161.0129622\n293.198591,4.572,9.906,56.698117744,3.335183322,1.934406342,-191.506230398\n285.945396,4.064,11.684,80.246041438,3.488958224,1.84914794,-183.065643266\n270,4.064,13.208,0,25.4,1.524,-23.876\n261.869898,4.318,14.986,25.144717046,3.592102544,1.796051272,-177.809071102\n246.801409,5.08,16.764,136.74251925,3.335183322,1.934406342,-191.506230398\n234.462322,6.35,18.542,91.53339072,2.952690056,2.18499055,-216.314071054\n219.805571,7.874,19.812,35.773504272,3.252136752,1.9838035,-196.396538372\n206.565051,9.398,20.574,34.077676066,11.35922544,1.703883816,-55.092242876\n195.945396,11.176,21.082,80.246041438,3.488958224,1.84914794,-183.065643266\n180,12.192,21.082,0,25.4,1.016,-24.384\n180,13.208,21.082,0,25.4,1.016,-24.384\n233.130102,23.368,6.858,91.44,5.08,1.27,-125.73\n248.198591,23.876,8.128,80.18324705,4.716661636,1.36783191,-135.415354264\n248.198591,24.384,9.398,80.18324705,4.716661636,1.36783191,-135.415354264\n260.537678,24.638,10.922,25.054405568,4.175734346,1.545021802,-152.95714646\n261.869898,24.892,12.7,25.144717046,3.592102544,1.796051272,-177.809071102\n278.130102,24.638,14.478,154.460405328,3.592102544,1.796051272,-177.809071102\n279.462322,24.384,16.002,129.447762694,4.175734346,1.545021802,-152.95714646\n288.434949,23.876,17.526,56.225296744,8.032185358,1.60643697,-78.715415594\n299.744881,22.86,19.304,148.072666262,3.150482142,2.047813532,-202.733533318\n308.659808,21.844,20.574,35.701322044,3.966813504,1.626393496,-161.0129622\n315,20.574,21.844,17.960512212,17.960512212,1.796051272,-34.124973152\n321.340192,19.304,22.86,126.938033652,3.966813504,1.626393496,-161.0129622\n329.036243,18.034,23.622,56.628832894,4.356064186,1.481061808,-146.625116452\n338.198591,16.764,24.13,80.18324705,4.716661636,1.36783191,-135.415354264\n338.198591,15.494,24.638,80.18324705,4.716661636,1.36783191,-135.415354264\n350.537678,13.97,24.892,25.054405568,4.175734346,1.545021802,-152.95714646\n0,12.7,24.892,0,25.4,1.27,-24.13\n0,11.43,24.892,0,25.4,1.27,-24.13\n11.309932,10.16,24.638,104.608346536,4.981349956,1.29515108,-128.219944728\n14.036243,9.144,24.384,80.085263502,6.160405002,1.047268924,-103.679614078\n21.801409,7.874,23.876,56.599939124,4.716661636,1.36783191,-135.415354264\n21.801409,6.604,23.368,56.599939124,4.716661636,1.36783191,-135.415354264\n36.869898,5.588,22.606,35.56,5.08,1.27,-125.73\n36.869898,4.572,21.844,35.56,5.08,1.27,-125.73\n33.690068,19.05,2.286,35.223462446,7.04469254,0.915809954,-90.665192304\n26.565051,17.526,1.524,34.077676066,11.35922544,1.703883816,-55.092242876\n21.801409,16.256,1.016,56.599939124,4.716661636,1.36783191,-135.415354264\n11.309932,14.986,0.762,104.608346536,4.981349956,1.29515108,-128.219944728\n8.130102,13.208,0.508,154.460405328,3.592102544,1.796051272,-177.809071102\n0,11.684,0.508,0,25.4,1.524,-23.876\n350.537678,10.16,0.762,25.054405568,4.175734346,1.545021802,-152.95714646\n348.690068,8.89,1.016,24.906749272,4.981349956,1.29515108,-128.219944728\n338.198591,7.62,1.524,80.18324705,4.716661636,1.36783191,-135.415354264\n333.434949,6.604,2.032,22.718450626,11.35922544,1.135922544,-55.660204148\n323.130102,5.588,2.794,91.44,5.08,1.27,-125.73\n323.130102,4.572,3.556,91.44,5.08,1.27,-125.73\n315,3.556,4.572,17.960512212,17.960512212,1.436840916,-34.484183508\n306.869898,2.794,5.588,35.56,5.08,1.27,-125.73\n306.869898,2.032,6.604,35.56,5.08,1.27,-125.73\n296.565051,1.524,7.62,34.077676066,11.35922544,1.135922544,-55.660204148\n291.801409,1.016,8.89,56.599939124,4.716661636,1.36783191,-135.415354264\n281.309932,0.762,10.16,104.608346536,4.981349956,1.29515108,-128.219944728\n281.309932,0.508,11.43,104.608346536,4.981349956,1.29515108,-128.219944728\n270,0.508,12.7,0,25.4,1.27,-24.13\n270,0.508,13.97,0,25.4,1.27,-24.13\n258.690068,0.762,15.24,24.906749272,4.981349956,1.29515108,-128.219944728\n258.690068,1.016,16.51,24.906749272,4.981349956,1.29515108,-128.219944728\n248.198591,1.524,17.78,80.18324705,4.716661636,1.36783191,-135.415354264\n243.434949,2.032,18.796,22.718450626,11.35922544,1.135922544,-55.660204148\n233.130102,2.794,19.812,91.44,5.08,1.27,-125.73\n233.130102,3.556,20.828,91.44,5.08,1.27,-125.73\n225,4.572,21.844,17.960512212,17.960512212,1.436840916,-34.484183508\n0,8.89,5.334,0,25.4,7.366,-18.034\n180,14.224,9.906,0,25.4,1.016,-24.384\n270,14.224,11.176,0,25.4,1.27,-24.13\n180,15.748,11.176,0,25.4,1.524,-23.876\n270,15.748,12.192,0,25.4,1.016,-24.384\n270,24.892,2.794,0,25.4,0.254,-25.146\n270,24.892,3.302,0,25.4,0.508,-24.892\n45,20.828,2.032,17.960512212,17.960512212,3.592102544,-32.328922134\n225,22.86,5.08,17.960512212,17.960512212,3.592102544,-32.328922134\n45,20.066,2.794,17.960512212,17.960512212,3.592102544,-32.328922134\n0,13.8209782,14.218285,0,25.4,0,-25.4\n0,14.9935692,16.1227008,0,25.4,0,-25.4\n0,16.2642042,18.3038496,0,25.4,0,-25.4\n135,24.892,3.302,17.960512212,17.960512212,12.57235865,-23.348666028\n56.309932,24.384,1.778,56.357539812,7.04469254,0.915809954,-90.665192304\n45,23.876,1.27,17.960512212,17.960512212,0.718420458,-35.202603966\n33.690068,23.114,0.762,35.223462446,7.04469254,0.915809954,-90.665192304\n18.434949,22.352,0.508,56.225296744,8.032185358,0.803218612,-79.518633952\n135.806929,22.352,0.508,-35.917462074,0.505879862,12.753228494,-1262.569616842\n289.983107,12.192,12.192,217.006845132,2.170068558,2.9729938,-294.326383914\n338.198591,13.462,13.208,80.18324705,4.716661636,2.73566382,-134.047522354\n105.945396,12.192,12.192,80.246041438,3.488958224,1.84914794,-183.065643266\n218.659808,13.462,13.208,35.701322044,3.966813504,1.626393496,-161.0129622\n336.801409,11.684,13.97,136.74251925,3.335183322,1.934406342,-191.506230398\n56.309932,16.764,19.177,56.357539812,7.04469254,0.457905104,-91.123097408\n239.036243,12.065,11.049,56.628832894,4.356064186,0.740530904,-147.365647356\n236.309932,14.478,15.24,56.357539812,7.04469254,0.457905104,-91.123097408\n236.309932,15.748,17.272,56.357539812,7.04469254,0.457905104,-91.123097408\n0,11.684,10.414,0,25.4,0,-25.4\n0,12.446,8.636,0,25.4,0.508,-24.892\n0,13.716,8.636,0,25.4,0,-25.4\n0,11.43,8.636,0,25.4,0,-25.4\n0,9.144,8.636,0,25.4,0,-25.4\n0,6.858,8.636,0,25.4,0,-25.4\n180,6.096,8.636,0,25.4,0.762,-24.638\n180,8.382,8.636,0,25.4,0.762,-24.638\n180,10.668,8.636,0,25.4,0.762,-24.638\n239.036243,11.43,9.906,56.628832894,4.356064186,1.481061808,-146.625116452\n0,11.176,11.176,0,25.4,1.27,-24.13\n341.565051,10.414,11.43,24.09655582,8.032185358,0.803218612,-79.518633952\n315,9.906,11.938,17.960512212,17.960512212,0.718420458,-35.202603966\n296.565051,9.652,12.446,34.077676066,11.35922544,0.567961272,-56.22816542\n180,9.652,12.446,0,25.4,5.334,-20.066\n240.068488,14.478,20.828,204.780260492,0.667036766,9.672031964,-957.531152498\n0,16.002,12.446,0,25.4,4.572,-20.828\n240.255119,19.05,17.78,56.708680588,3.150482142,6.143440342,-198.637906508\n")),N(O.ParsePatFile("\n*REDBACK,REDBACK\n;By John Hyslop\n;Developed in mm as Metric QCAD3 pattern\n63.434949,18.542,19.812,22.71845063,11.35922544,0.567961272,-56.22816542\n33.690068,17.78,19.304,35.22346245,7.04469254,0.915809954,-90.6651923\n75.963757,17.526,18.288,24.6416195,6.160405002,1.047268924,-103.6796141\n0,16.764,18.288,0,25.4,0.762,-24.638\n108.434949,17.018,17.526,56.22529674,8.032185358,0.803218612,-79.51863395\n90,17.018,17.272,0,25.4,0.254,-25.146\n0,13.716,14.478,0,25.4,0.254,-25.146\n270,13.716,14.732,0,25.4,0.254,-25.146\n225,13.97,14.986,17.96051221,17.96051221,0.359210356,-35.56181432\n180,14.224,14.986,0,25.4,0.254,-25.146\n315,13.97,15.24,17.96051221,17.96051221,0.359210356,-35.56181432\n15.524111,9.398,13.97,184.9097925,1.359630758,4.745111668,-469.7660475\n0,8.89,13.97,0,25.4,0.508,-24.892\n45,8.636,13.716,17.96051221,17.96051221,0.359210356,-35.56181432\n0,7.874,13.716,0,25.4,0.762,-24.638\n26.565051,4.826,12.192,34.07767607,11.35922544,3.407767632,-53.38835906\n0,4.572,12.192,0,25.4,0.254,-25.146\n33.690068,3.81,11.684,35.22346245,7.04469254,0.915809954,-90.6651923\n32.005383,1.778,10.414,91.54141687,2.692394666,2.396231174,-237.2268895\n45,1.524,10.16,17.96051221,17.96051221,0.359210356,-35.56181432\n270,1.524,10.414,0,25.4,0.254,-25.146\n225,1.778,10.668,17.96051221,17.96051221,0.359210356,-35.56181432\n213.690068,4.064,12.192,35.22346245,7.04469254,2.747430116,-88.8335724\n243.434949,4.318,12.7,22.71845063,11.35922544,0.567961272,-56.22816542\n205.016893,8.128,14.478,56.77539445,1.534470134,4.20444803,-416.2403639\n189.462322,9.652,14.732,129.4477627,4.175734346,1.545021802,-152.9571465\n194.036243,10.668,14.986,80.0852635,6.160405002,1.047268924,-103.6796141\n194.036243,12.7,15.494,80.0852635,6.160405002,2.094537594,-102.6323452\n198.434949,14.224,16.002,56.22529674,8.032185358,1.60643697,-78.71541559\n6.340192,11.938,15.748,204.7621356,2.804960862,2.30006779,-227.7067148\n315,11.684,16.002,17.96051221,17.96051221,0.359210356,-35.56181432\n45,11.43,15.748,17.96051221,17.96051221,0.359210356,-35.56181432\n23.198591,9.652,14.986,56.69811774,3.335183322,1.934406342,-191.5062304\n0,8.89,14.986,0,25.4,0.762,-24.638\n45,8.128,14.224,17.96051221,17.96051221,1.077630814,-34.84339386\n236.309932,8.636,14.986,56.35753981,7.04469254,0.915809954,-90.6651923\n206.565051,9.144,15.24,34.07767607,11.35922544,0.567961272,-56.22816542\n206.565051,10.668,16.002,34.07767607,11.35922544,1.703883816,-55.09224288\n206.565051,11.176,16.256,34.07767607,11.35922544,0.567961272,-56.22816542\n206.565051,11.684,16.51,34.07767607,11.35922544,0.567961272,-56.22816542\n180,14.478,16.51,0,25.4,2.794,-22.606\n225,14.732,16.764,17.96051221,17.96051221,0.359210356,-35.56181432\n321.340192,13.462,17.78,126.9380337,3.966813504,1.626393496,-161.0129622\n296.565051,13.208,18.288,34.07767607,11.35922544,0.567961272,-56.22816542\n285.945396,12.7,20.066,80.24604144,3.488958224,1.84914794,-183.0656433\n254.054604,13.208,21.844,104.6687498,3.488958224,1.84914794,-183.0656433\n135,13.462,21.59,17.96051221,17.96051221,0.359210356,-35.56181432\n90,13.462,20.828,0,25.4,0.762,-24.638\n71.565051,13.208,20.066,24.09655582,8.032185358,0.803218612,-79.51863395\n105.945396,13.716,18.288,80.24604144,3.488958224,1.84914794,-183.0656433\n135,14.732,17.272,17.96051221,17.96051221,1.436840916,-34.48418351\n180,14.986,17.272,0,25.4,0.254,-25.146\n270,14.986,17.526,0,25.4,0.254,-25.146\n270,14.986,18.034,0,25.4,0.508,-24.892\n296.565051,14.732,18.542,34.07767607,11.35922544,0.567961272,-56.22816542\n278.130102,14.478,20.32,154.4604053,3.592102544,1.796051272,-177.8090711\n251.565051,14.732,21.082,24.09655582,8.032185358,0.803218612,-79.51863395\n225,14.986,21.336,17.96051221,17.96051221,0.359210356,-35.56181432\n225,15.24,21.59,17.96051221,17.96051221,0.359210356,-35.56181432\n243.434949,15.494,22.098,22.71845063,11.35922544,0.567961272,-56.22816542\n243.434949,16.002,23.114,22.71845063,11.35922544,1.135922544,-55.66020415\n243.434949,16.51,24.13,22.71845063,11.35922544,1.135922544,-55.66020415\n225,16.764,24.384,17.96051221,17.96051221,0.359210356,-35.56181432\n168.690068,20.574,23.622,24.90674927,4.981349956,3.885452986,-125.6296428\n355.601295,17.272,23.876,25.32518405,1.9480911,3.31175487,-327.8637273\n56.309932,16.764,23.114,56.35753981,7.04469254,0.915809954,-90.6651923\n56.309932,16.256,22.352,56.35753981,7.04469254,0.915809954,-90.6651923\n63.434949,16.002,21.844,22.71845063,11.35922544,0.567961272,-56.22816542\n56.309932,15.494,21.082,56.35753981,7.04469254,0.915809954,-90.6651923\n71.565051,15.24,20.32,24.09655582,8.032185358,0.803218612,-79.51863395\n90,15.24,20.066,0,25.4,0.254,-25.146\n90,15.24,19.558,0,25.4,0.508,-24.892\n90,15.24,18.796,0,25.4,0.762,-24.638\n225,15.494,19.05,17.96051221,17.96051221,0.359210356,-35.56181432\n243.434949,15.748,19.558,22.71845063,11.35922544,0.567961272,-56.22816542\n225,16.002,19.812,17.96051221,17.96051221,0.359210356,-35.56181432\n206.565051,16.51,20.066,34.07767607,11.35922544,0.567961272,-56.22816542\n206.565051,17.018,20.32,34.07767607,11.35922544,0.567961272,-56.22816542\n180,17.526,20.32,0,25.4,0.508,-24.892\n180,18.034,20.32,0,25.4,0.508,-24.892\n180,18.796,20.32,0,25.4,0.762,-24.638\n153.434949,19.304,20.066,22.71845063,11.35922544,0.567961272,-56.22816542\n135,19.558,19.812,17.96051221,17.96051221,0.359210356,-35.56181432\n135,14.224,14.224,17.96051221,17.96051221,0.359210356,-35.56181432\n26.565051,19.558,18.796,34.07767607,11.35922544,0.567961272,-56.22816542\n56.309932,19.05,18.034,56.35753981,7.04469254,0.915809954,-90.6651923\n14.036243,18.034,17.78,80.0852635,6.160405002,1.047268924,-103.6796141\n90,18.034,17.018,0,25.4,0.762,-24.638\n341.565051,17.272,17.272,24.09655582,8.032185358,0.803218612,-79.51863395\n0,17.018,17.272,0,25.4,0.254,-25.146\n90,14.224,13.97,0,25.4,0.254,-25.146\n180,14.478,13.97,0,25.4,0.254,-25.146\n225,14.732,14.224,17.96051221,17.96051221,0.359210356,-35.56181432\n270,14.732,14.478,0,25.4,0.254,-25.146\n135,14.986,14.224,17.96051221,17.96051221,0.359210356,-35.56181432\n74.475889,13.716,9.652,289.6013664,1.359630758,4.745111668,-469.7660475\n90,13.716,9.144,0,25.4,0.508,-24.892\n45,13.462,8.89,17.96051221,17.96051221,0.359210356,-35.56181432\n90,13.462,8.128,0,25.4,0.762,-24.638\n63.434949,11.938,5.08,22.71845063,11.35922544,3.407767632,-53.38835906\n90,11.938,4.826,0,25.4,0.254,-25.146\n56.309932,11.43,4.064,56.35753981,7.04469254,0.915809954,-90.6651923\n57.994617,10.16,2.032,148.0817038,2.692394666,2.396231174,-237.2268895\n45,9.906,1.778,17.96051221,17.96051221,0.359210356,-35.56181432\n180,10.16,1.778,0,25.4,0.254,-25.146\n225,10.414,2.032,17.96051221,17.96051221,0.359210356,-35.56181432\n236.309932,11.938,4.318,56.35753981,7.04469254,2.747430116,-88.8335724\n206.565051,12.446,4.572,34.07767607,11.35922544,0.567961272,-56.22816542\n244.983107,14.224,8.382,363.6694177,1.534470134,4.20444803,-416.2403639\n260.537678,14.478,9.906,25.05440557,4.175734346,1.545021802,-152.9571465\n255.963757,14.732,10.922,24.6416195,6.160405002,1.047268924,-103.6796141\n255.963757,15.24,12.954,24.6416195,6.160405002,2.094537594,-102.6323452\n251.565051,15.748,14.478,24.09655582,8.032185358,1.60643697,-78.71541559\n83.659808,15.494,12.192,25.24464674,2.804960862,2.30006779,-227.7067148\n135,15.748,11.938,17.96051221,17.96051221,0.359210356,-35.56181432\n45,15.494,11.684,17.96051221,17.96051221,0.359210356,-35.56181432\n66.801409,14.732,9.906,136.7425193,3.335183322,1.934406342,-191.5062304\n90,14.732,9.144,0,25.4,0.762,-24.638\n45,13.97,8.382,17.96051221,17.96051221,1.077630814,-34.84339386\n213.690068,14.732,8.89,35.22346245,7.04469254,0.915809954,-90.6651923\n243.434949,14.986,9.398,22.71845063,11.35922544,0.567961272,-56.22816542\n243.434949,15.748,10.922,22.71845063,11.35922544,1.703883816,-55.09224288\n243.434949,16.002,11.43,22.71845063,11.35922544,0.567961272,-56.22816542\n243.434949,16.256,11.938,22.71845063,11.35922544,0.567961272,-56.22816542\n270,16.256,14.732,0,25.4,2.794,-22.606\n225,16.51,14.986,17.96051221,17.96051221,0.359210356,-35.56181432\n128.659808,17.526,13.716,35.70132204,3.966813504,1.626393496,-161.0129622\n153.434949,18.034,13.462,22.71845063,11.35922544,0.567961272,-56.22816542\n164.054604,19.812,12.954,104.6687498,3.488958224,1.84914794,-183.0656433\n195.945396,21.59,13.462,80.24604144,3.488958224,1.84914794,-183.0656433\n315,21.336,13.716,17.96051221,17.96051221,0.359210356,-35.56181432\n0,20.574,13.716,0,25.4,0.762,-24.638\n18.434949,19.812,13.462,56.22529674,8.032185358,0.803218612,-79.51863395\n344.054604,18.034,13.97,104.6687498,3.488958224,1.84914794,-183.0656433\n315,17.018,14.986,17.96051221,17.96051221,1.436840916,-34.48418351\n270,17.018,15.24,0,25.4,0.254,-25.146\n180,17.272,15.24,0,25.4,0.254,-25.146\n180,17.78,15.24,0,25.4,0.508,-24.892\n153.434949,18.288,14.986,22.71845063,11.35922544,0.567961272,-56.22816542\n171.869898,20.066,14.732,25.14471705,3.592102544,1.796051272,-177.8090711\n198.434949,20.828,14.986,56.22529674,8.032185358,0.803218612,-79.51863395\n225,21.082,15.24,17.96051221,17.96051221,0.359210356,-35.56181432\n225,21.336,15.494,17.96051221,17.96051221,0.359210356,-35.56181432\n206.565051,21.844,15.748,34.07767607,11.35922544,0.567961272,-56.22816542\n206.565051,22.86,16.256,34.07767607,11.35922544,1.135922544,-55.66020415\n206.565051,23.876,16.764,34.07767607,11.35922544,1.135922544,-55.66020415\n225,24.13,17.018,17.96051221,17.96051221,0.359210356,-35.56181432\n281.309932,23.368,20.828,104.6083465,4.981349956,3.885452986,-125.6296428\n94.398705,23.622,17.526,305.8502981,1.9480911,3.31175487,-327.8637273\n33.690068,22.86,17.018,35.22346245,7.04469254,0.915809954,-90.6651923\n33.690068,22.098,16.51,35.22346245,7.04469254,0.915809954,-90.6651923\n26.565051,21.59,16.256,34.07767607,11.35922544,0.567961272,-56.22816542\n33.690068,20.828,15.748,35.22346245,7.04469254,0.915809954,-90.6651923\n18.434949,20.066,15.494,56.22529674,8.032185358,0.803218612,-79.51863395\n0,19.812,15.494,0,25.4,0.254,-25.146\n0,19.304,15.494,0,25.4,0.508,-24.892\n0,18.542,15.494,0,25.4,0.762,-24.638\n225,18.796,15.748,17.96051221,17.96051221,0.359210356,-35.56181432\n206.565051,19.304,16.002,34.07767607,11.35922544,0.567961272,-56.22816542\n225,19.558,16.256,17.96051221,17.96051221,0.359210356,-35.56181432\n243.434949,19.812,16.764,22.71845063,11.35922544,0.567961272,-56.22816542\n243.434949,20.066,17.272,22.71845063,11.35922544,0.567961272,-56.22816542\n270,20.066,17.78,0,25.4,0.508,-24.892\n270,20.066,18.288,0,25.4,0.508,-24.892\n270,20.066,19.05,0,25.4,0.762,-24.638\n296.565051,19.812,19.558,34.07767607,11.35922544,0.567961272,-56.22816542\n315,19.558,19.812,17.96051221,17.96051221,0.359210356,-35.56181432\n")),N(O.ParsePatFile("\n*SACNCR,SACNCR\n45, 0,0, 0,2.38125\n45, 1.6838,0, 0,2.38125, 0,-2.38125\n")),N(O.ParsePatFile("\n*SCAFFOLD\n;By John Hyslop, Tile2Hatch tool \xa9 CVH 2020\n;Developed in mm as metric QCAD3 pattern\n270,19.304,21.336,25.4,25.4,0.508,-24.892\n326.3099325,6.604,4.064,56.357539812,7.04469254,14.652960026,-76.928042486\n90,6.096,12.446,25.4,25.4,0.508,-24.892\n270,6.35,4.064,25.4,25.4,8.128,-17.272\n146.3099325,6.096,21.336,56.357539812,7.04469254,14.65296028,-76.928041978\n180,19.304,12.446,0,25.4,0.508,-24.892\n270,18.796,4.572,25.4,25.4,0.508,-24.892\n0,18.796,21.336,0,25.4,0.508,-24.892\n90,6.35,12.954,25.4,25.4,7.874,-17.526\n270,19.304,12.954,25.4,25.4,0.508,-24.892\n0,6.604,4.318,0,25.4,12.192,-13.208\n0,6.096,12.954,0,25.4,0.508,-24.892\n180,19.304,4.572,0,25.4,0.508,-24.892\n90,18.796,20.828,25.4,25.4,0.508,-24.892\n212.855722,6.096,12.446,514.310608918,0.444520828,14.513605212,-1436.846928942\n147.144278,6.096,4.572,937.049925236,0.444520828,14.513605212,-1436.846928942\n213.6900675,6.096,4.064,35.223462446,7.04469254,14.652959772,-76.928042486\n180,6.096,4.318,0,25.4,12.192,-13.208\n0,6.604,21.082,0,25.4,12.192,-13.208\n90,6.604,4.064,25.4,25.4,0.508,-24.892\n180,19.304,20.828,0,25.4,0.508,-24.892\n90,18.796,12.446,25.4,25.4,0.508,-24.892\n147.144278,18.796,4.572,937.049925236,0.444520828,14.513605466,-1436.846928688\n0,6.096,4.064,0,25.4,0.508,-24.892\n0,6.604,12.7,0,25.4,12.192,-13.208\n270,6.604,21.336,25.4,25.4,0.508,-24.892\n90,19.05,4.572,25.4,25.4,7.874,-17.526\n212.855722,18.796,20.828,514.310608918,0.444520828,14.513605466,-1436.846928688\n180,6.604,12.446,0,25.4,0.508,-24.892\n270,6.096,4.572,25.4,25.4,0.508,-24.892\n0,6.096,21.336,0,25.4,0.508,-24.892\n270,6.604,12.954,25.4,25.4,0.508,-24.892\n270,19.05,20.828,25.4,25.4,7.874,-17.526\n32.855722,6.604,4.572,514.310608918,0.444520828,14.513605466,-1436.846928688\n180,6.604,4.572,0,25.4,0.508,-24.892\n0,18.796,12.954,0,25.4,0.508,-24.892\n90,19.304,4.064,25.4,25.4,0.508,-24.892\n90,6.096,20.828,25.4,25.4,0.508,-24.892\n180,6.096,21.082,0,25.4,12.192,-13.208\n147.144278,6.096,12.954,937.049925236,0.444520828,14.513605212,-1436.846928942\n180,6.096,12.7,0,25.4,12.192,-13.208\n270,6.35,12.446,25.4,25.4,7.874,-17.526\n212.855722,6.096,20.828,514.310608918,0.444520828,14.513605466,-1436.846928688\n0,18.796,4.064,0,25.4,0.508,-24.892\n270,19.05,4.064,25.4,25.4,8.128,-17.272\n180,6.604,20.828,0,25.4,0.508,-24.892\n213.6900675,18.796,4.064,35.223462446,7.04469254,14.652960026,-76.928042486\n327.144278,6.604,20.828,937.049925236,0.444520828,14.513605466,-1436.846928688\n")),N(O.ParsePatFile("\n*SQUARE,SQUARE\n0, 0,0, 0,3.175, 3.175,-3.175\n90, 0,0, 0,3.175, 3.175,-3.175\n")),N(O.ParsePatFile("\n*SQUIGGLE-01,SQUIGGLE-01\n;By John Hyslop, Using AutoCAD Lisp Tool\n;Developed in mm as metric QCAD3 pattern\n45,2.794,-9.906,17.960512212,17.960512212,28.377609234,-7.54341519\n56.309932,1.778,13.97,56.357539812,7.04469254,1.831620162,-89.74938235\n81.869898,1.524,12.192,25.144717046,3.592102544,1.796051272,-177.809071102\n99.462322,1.778,10.668,129.447762694,4.175734346,1.545021802,-152.95714646\n123.690068,2.794,9.144,35.223462446,7.04469254,1.831620162,-89.74938235\n146.309932,4.318,8.128,56.357539812,7.04469254,1.831620162,-89.74938235\n170.537678,5.842,7.874,25.054405568,4.175734346,1.545021802,-152.95714646\n188.130102,7.62,8.128,154.460405328,3.592102544,1.796051272,-177.809071102\n213.690068,9.144,9.144,35.223462446,7.04469254,1.831620162,-89.74938235\n225,16.51,16.51,17.960512212,17.960512212,10.417097022,-25.503927402\n213.690068,18.034,17.526,35.223462446,7.04469254,1.831620162,-89.74938235\n189.462322,19.558,17.78,129.447762694,4.175734346,1.545021802,-152.95714646\n171.869898,21.336,17.526,25.144717046,3.592102544,1.796051272,-177.809071102\n146.309932,22.86,16.51,56.357539812,7.04469254,1.831620162,-89.74938235\n123.690068,23.876,14.986,35.223462446,7.04469254,1.831620162,-89.74938235\n99.462322,24.13,13.462,129.447762694,4.175734346,1.545021802,-152.95714646\n81.869898,23.876,11.684,25.144717046,3.592102544,1.796051272,-177.809071102\n56.309932,22.86,10.16,56.357539812,7.04469254,1.831620162,-89.74938235\n")),N(O.ParsePatFile("\n*SQUIGGLE-02,SQUIGGLE-02\n;By John Hyslop, Using AutoCAD Lisp Tool\n;Developed in mm as metric QCAD3 pattern\n75.963757,25.146,4.064,24.6416195,6.160405002,1.047268924,-103.679614078\n63.434949,24.638,3.048,22.718450626,11.35922544,1.135922544,-55.660204148\n45,23.876,2.286,17.960512212,17.960512212,1.077630814,-34.843393864\n14.036243,22.86,2.032,80.085263502,6.160405002,1.047268924,-103.679614078\n0,21.59,2.032,0,25.4,1.27,-24.13\n345.963757,20.574,2.286,24.6416195,6.160405002,1.047268924,-103.679614078\n315,19.812,3.048,17.960512212,17.960512212,1.077630814,-34.843393864\n296.565051,19.304,4.064,34.077676066,11.35922544,1.135922544,-55.660204148\n284.036243,19.05,5.08,80.085263502,6.160405002,1.047268924,-103.679614078\n281.309932,18.796,21.59,104.608346536,4.981349956,1.29515108,-128.219944728\n303.690068,18.288,22.352,35.223462446,7.04469254,0.915809954,-90.665192304\n315,17.526,23.114,17.960512212,17.960512212,1.077630814,-34.843393864\n345.963757,16.51,23.368,24.6416195,6.160405002,1.047268924,-103.679614078\n0,15.24,23.368,0,25.4,1.27,-24.13\n14.036243,14.224,23.114,80.085263502,6.160405002,1.047268924,-103.679614078\n45,13.462,22.352,17.960512212,17.960512212,1.077630814,-34.843393864\n56.309932,12.954,21.59,56.357539812,7.04469254,0.915809954,-90.665192304\n78.690068,12.7,20.32,24.906749272,4.981349956,1.29515108,-128.219944728\n75.963757,12.446,4.064,24.6416195,6.160405002,1.047268924,-103.679614078\n63.434949,11.938,3.048,22.718450626,11.35922544,1.135922544,-55.660204148\n45,11.176,2.286,17.960512212,17.960512212,1.077630814,-34.843393864\n14.036243,10.16,2.032,80.085263502,6.160405002,1.047268924,-103.679614078\n0,8.89,2.032,0,25.4,1.27,-24.13\n345.963757,7.874,2.286,24.6416195,6.160405002,1.047268924,-103.679614078\n315,7.112,3.048,17.960512212,17.960512212,1.077630814,-34.843393864\n296.565051,6.604,4.064,34.077676066,11.35922544,1.135922544,-55.660204148\n284.036243,6.35,5.08,80.085263502,6.160405002,1.047268924,-103.679614078\n281.309932,6.096,21.59,104.608346536,4.981349956,1.29515108,-128.219944728\n303.690068,5.588,22.352,35.223462446,7.04469254,0.915809954,-90.665192304\n315,4.826,23.114,17.960512212,17.960512212,1.077630814,-34.843393864\n345.963757,3.81,23.368,24.6416195,6.160405002,1.047268924,-103.679614078\n0,2.54,23.368,0,25.4,1.27,-24.13\n14.036243,1.524,23.114,80.085263502,6.160405002,1.047268924,-103.679614078\n45,0.762,22.352,17.960512212,17.960512212,1.077630814,-34.843393864\n56.309932,0.254,21.59,56.357539812,7.04469254,0.915809954,-90.665192304\n78.690068,0,20.32,24.906749272,4.981349956,1.29515108,-128.219944728\n270,19.05,20.32,0,25.4,15.24,-10.16\n270,12.7,20.32,0,25.4,15.24,-10.16\n270,6.35,20.32,0,25.4,15.24,-10.16\n270,0,20.32,0,25.4,15.24,-10.16\n")),N(O.ParsePatFile("\n*STARS,STARS\n0, 0,0, 0,5.49926, 3.175,-3.175\n60, 0,0, 0,5.49926, 3.175,-3.175\n120, 1.5875,2.74963, 0,5.49926, 3.175,-3.175\n")),N(O.ParsePatFile("\n*STEEL,STEEL\n45, 0,0, 0,3.175\n45, 0,1.5875, 0,3.175\n")),N(O.ParsePatFile("\n*SWAMP,SWAMP\n0, 0,0, 12.7,21.997, 3.175,-22.225\n90, 1.5875,0, 21.997,12.7, 1.5875,-42.4066\n90, 1.98438,0, 21.997,12.7, 1.27,-42.7241\n90, 1.19062,0, 21.997,12.7, 1.27,-42.7241\n60, 2.38125,0, 12.7,21.997, 1.016,-24.384\n120, .79375,0, 12.7,21.997, 1.016,-24.384\n")),N(O.ParsePatFile("\n*TRANS,TRANS\n0, 0,0, 0,6.35\n0, 0,3.175, 0,6.35, 3.175,-3.175\n")),N(O.ParsePatFile("\n*TRI-OVERLAP\n;By John Hyslop, Tile2Hatch tool \xa9 CVH 2020\n;Developed in mm as metric QCAD3 pattern\n59.641885,2.286000254,3.81,1206.700468992,0.313103514,20.605334202,-2039.928082188\n300.358115,12.7,21.590000254,853.832947398,0.313103514,20.605334202,-2039.928082188\n180,9.129485678,15.494,0,25.4,18.258981262,-7.141018738\n59.036243,22.737590288,4.452650734,56.628832894,4.356064186,5.17479407,-142.931383936\n180,23.114,3.81,0,25.4,20.827999746,-4.572000254\n300.963757,0,8.89,91.477345366,4.356064186,5.174794324,-142.931383682\n300.784147,3.048,3.81,148.105450296,0.464280504,13.89591328,-1375.695350204\n239.215853,22.352,3.81,1241.485813188,0.464280504,13.89591328,-1375.695350204\n")),N(O.ParsePatFile("\n*TRIANG,TRIANG\n60, 0,0, 4.7625,8.24889, 4.7625,-4.7625\n120, 0,0, 4.76250001,8.24889, 4.7625,-4.7625\n0, -2.38125,4.12445, 4.7625,8.24889, 4.7625,-4.7625\n")),N(O.ParsePatFile("\n*WEATHERBOARD,WEATHERBOARD\n; By John Hyslop, Manually Entered QCAD3 pattern\n; Developed in mm as metric QCAD3 pattern\n; Metric Hatch Scale 1 Makes 152mm horizontally placed boards\n; with a 13mm offset line to simulate a rounded edge\n0,0,0,0,152\n0,0,13,0,152\n")),N(O.ParsePatFile("\n*WEAVING,WEAVING\n;By John Hyslop, Using AutoCAD Lisp Tool\n;Developed in mm as metric QCAD3 pattern\n90,22.86,5.08,0,25.4,1.27,-24.13\n75.963757,22.352,3.048,24.6416195,6.160405002,2.094537594,-102.632345154\n66.801409,21.59,1.27,136.74251925,3.335183322,1.934406342,-191.506230398\n54.462322,20.32,-0.508,91.53339072,2.952690056,2.18499055,-216.314071054\n56.309932,19.304,-2.032,56.357539812,7.04469254,1.831620162,-89.74938235\n90,20.066,5.588,0,25.4,1.778,-23.622\n80.537678,19.812,4.064,25.054405568,4.175734346,1.545021802,-152.95714646\n63.434949,19.05,2.54,22.718450626,11.35922544,1.703883816,-55.092242876\n56.309932,18.034,1.016,56.357539812,7.04469254,1.831620162,-89.74938235\n56.309932,17.018,-0.508,56.357539812,7.04469254,1.831620162,-89.74938235\n333.434949,21.844,6.858,22.718450626,11.35922544,1.703883816,-55.092242876\n344.054604,20.066,7.366,104.668749768,3.488958224,1.84914794,-183.065643266\n0,18.034,7.366,0,25.4,2.032,-23.368\n9.462322,16.51,7.112,129.447762694,4.175734346,1.545021802,-152.95714646\n26.565051,14.986,6.35,34.077676066,11.35922544,1.703883816,-55.092242876\n38.659808,13.716,5.334,35.701322044,3.966813504,1.626393496,-161.0129622\n36.869898,11.684,3.81,35.56,5.08,2.54,-124.46\n20.556045,9.652,3.048,136.750876358,2.97284521,2.170177016,-214.847518234\n330.255119,23.114,9.398,56.708680588,3.150482142,2.047813532,-202.733533318\n344.054604,21.336,9.906,104.668749768,3.488958224,1.84914794,-183.065643266\n352.874984,19.304,10.16,25.203858152,3.150482142,2.047813532,-202.733533318\n0,17.526,10.16,0,25.4,1.778,-23.622\n14.036243,15.494,9.652,80.085263502,6.160405002,2.094537594,-102.632345154\n26.565051,13.462,8.636,34.077676066,11.35922544,2.271845088,-54.524281604\n33.690068,11.938,7.62,35.223462446,7.04469254,1.831620162,-89.74938235\n35.537678,10.16,6.35,126.965671138,2.952690056,2.18499055,-216.314071054\n0,5.08,2.54,0,25.4,1.27,-24.13\n348.690068,3.81,2.794,24.906749272,4.981349956,1.29515108,-128.219944728\n341.565051,3.048,3.048,24.09655582,8.032185358,0.803218612,-79.518633952\n336.801409,1.27,3.81,136.74251925,3.335183322,1.934406342,-191.506230398\n326.309932,-0.254,4.826,56.357539812,7.04469254,1.831620162,-89.74938235\n324.462322,-2.032,6.096,91.53339072,2.952690056,2.18499055,-216.314071054\n0,5.588,5.334,0,25.4,1.778,-23.622\n350.537678,4.064,5.588,25.054405568,4.175734346,1.545021802,-152.95714646\n333.434949,2.54,6.35,22.718450626,11.35922544,1.703883816,-55.092242876\n326.309932,1.016,7.366,56.357539812,7.04469254,1.831620162,-89.74938235\n326.309932,-0.508,8.382,56.357539812,7.04469254,1.831620162,-89.74938235\n60.255119,16.002,23.114,56.708680588,3.150482142,2.047813532,-202.733533318\n180,20.066,20.066,0,25.4,2.032,-23.368\n164.054604,21.844,19.558,104.668749768,3.488958224,1.84914794,-183.065643266\n153.434949,23.368,18.796,22.718450626,11.35922544,1.703883816,-55.092242876\n330.255119,23.114,22.098,56.708680588,3.150482142,2.047813532,-202.733533318\n345.963757,21.082,22.606,24.6416195,6.160405002,2.094537594,-102.632345154\n352.874984,19.05,22.86,25.203858152,3.150482142,2.047813532,-202.733533318\n60.255119,18.288,21.59,56.708680588,3.150482142,2.047813532,-202.733533318\n80.537678,18.034,20.066,25.054405568,4.175734346,1.545021802,-152.95714646\n90,18.034,18.034,0,25.4,2.032,-23.368\n104.036243,18.542,16.002,80.085263502,6.160405002,2.094537594,-102.632345154\n116.565051,19.304,14.478,34.077676066,11.35922544,1.703883816,-55.092242876\n129.805571,20.574,12.954,35.773504272,3.252136752,1.9838035,-196.396538372\n123.690068,21.59,11.43,35.223462446,7.04469254,1.831620162,-89.74938235\n113.198591,22.352,9.652,56.698117744,3.335183322,1.934406342,-191.506230398\n309.805571,18.034,11.684,35.773504272,3.252136752,1.9838035,-196.396538372\n305.537678,16.764,13.462,126.965671138,2.952690056,2.18499055,-216.314071054\n299.744881,15.748,15.24,148.072666262,3.150482142,2.047813532,-202.733533318\n285.945396,15.24,17.018,80.246041438,3.488958224,1.84914794,-183.065643266\n270,15.24,19.304,0,25.4,2.286,-23.114\n74.054604,15.494,21.336,104.668749768,3.488958224,1.84914794,-183.065643266\n82.874984,15.24,19.304,25.203858152,3.150482142,2.047813532,-202.733533318\n39.805571,13.716,18.034,35.773504272,3.252136752,1.9838035,-196.396538372\n35.537678,11.938,16.764,126.965671138,2.952690056,2.18499055,-216.314071054\n33.690068,10.414,15.748,35.223462446,7.04469254,1.831620162,-89.74938235\n15.945396,8.636,15.24,80.246041438,3.488958224,1.84914794,-183.065643266\n6.340192,6.35,14.986,204.76213556,2.804960862,2.30006779,-227.706714766\n350.537678,4.826,15.24,25.054405568,4.175734346,1.545021802,-152.95714646\n344.054604,3.048,15.748,104.668749768,3.488958224,1.84914794,-183.065643266\n23.198591,13.97,21.59,56.698117744,3.335183322,1.934406342,-191.506230398\n29.744881,12.192,20.574,148.072666262,3.150482142,2.047813532,-202.733533318\n39.805571,10.668,19.304,35.773504272,3.252136752,1.9838035,-196.396538372\n29.744881,8.89,18.288,148.072666262,3.150482142,2.047813532,-202.733533318\n7.125016,6.858,18.034,179.577488698,3.150482142,2.047813532,-202.733533318\n0,5.334,18.034,0,25.4,1.524,-23.876\n344.054604,3.556,18.542,104.668749768,3.488958224,1.84914794,-183.065643266\n333.434949,2.54,19.05,22.718450626,11.35922544,1.135922544,-55.660204148\n234.462322,7.874,-0.254,91.53339072,2.952690056,2.18499055,-216.314071054\n240.255119,8.89,1.524,56.708680588,3.150482142,2.047813532,-202.733533318\n243.434949,9.906,3.556,22.718450626,11.35922544,2.271845088,-54.524281604\n262.874984,10.16,5.588,25.203858152,3.150482142,2.047813532,-202.733533318\n270,10.16,7.62,0,25.4,2.032,-23.368\n282.528808,9.652,9.906,104.69063898,2.755016842,2.341764176,-231.834664854\n293.198591,8.89,11.684,56.698117744,3.335183322,1.934406342,-191.506230398\n309.805571,7.62,13.208,35.773504272,3.252136752,1.9838035,-196.396538372\n305.537678,6.35,14.986,126.965671138,2.952690056,2.18499055,-216.314071054\n270,5.334,19.812,0,25.4,1.778,-23.622\n254.054604,5.842,21.59,104.668749768,3.488958224,1.84914794,-183.065643266\n246.801409,6.604,23.368,136.74251925,3.335183322,1.934406342,-191.506230398\n236.309932,5.334,1.016,56.357539812,7.04469254,1.831620162,-89.74938235\n234.462322,6.604,2.794,91.53339072,2.952690056,2.18499055,-216.314071054\n249.443955,7.366,4.826,80.266818638,2.97284521,2.170177016,-214.847518234\n270,7.366,6.858,0,25.4,2.032,-23.368\n278.130102,7.112,8.636,154.460405328,3.592102544,1.796051272,-177.809071102\n296.565051,6.096,10.668,34.077676066,11.35922544,2.271845088,-54.524281604\n309.805571,4.826,12.192,35.773504272,3.252136752,1.9838035,-196.396538372\n303.690068,3.81,13.716,35.223462446,7.04469254,1.831620162,-89.74938235\n290.556045,3.048,15.748,136.750876358,2.97284521,2.170177016,-214.847518234\n341.565051,1.524,16.256,24.09655582,8.032185358,1.60643697,-78.715415594\n324.462322,-0.254,17.526,91.53339072,2.952690056,2.18499055,-216.314071054\n324.462322,-2.032,18.796,91.53339072,2.952690056,2.18499055,-216.314071054\n146.309932,1.016,20.066,56.357539812,7.04469254,1.831620162,-89.74938235\n146.309932,2.54,19.05,56.357539812,7.04469254,1.831620162,-89.74938235\n262.874984,2.794,21.082,25.203858152,3.150482142,2.047813532,-202.733533318\n255.963757,3.302,23.114,24.6416195,6.160405002,2.094537594,-102.632345154\n240.255119,4.318,24.892,56.708680588,3.150482142,2.047813532,-202.733533318\n")),N(O.ParsePatFile("\n*WIRE-FENCE\n;By John Hyslop, Tile2Hatch tool \xa9 CVH 2020\n;Developed in mm as metric QCAD3 pattern\n315,11.684,12.7,17.960512212,17.960512212,1.186955462,-34.734068962\n315,13.353142966,14.332857034,17.960512212,17.960512212,1.231577928,-34.689446496\n3.731397,12.767918076,14.294690232,381.845330542,0.55100347,0.586467966,-1170.2956782\n183.17983,11.77579941,14.229987034,432.544118908,1.408938508,23.016097986,-434.888914066\n183.17983,11.714581854,13.209697736,432.544118908,1.408938508,23.012451308,-434.892560744\n153.434949,13.208,12.954,22.718450626,11.35922544,0.567961272,-56.22816542\n266.593556,13.208,12.954,432.546308388,0.301846742,25.69937837,-2111.67704156\n266.593556,14.224,13.462,432.546308388,0.301846742,25.69937837,-2111.67704156\n2.602562,12.523304392,11.860695608,534.003174054,1.153354564,0.622066574,-558.754908396\n")),N(O.ParsePatFile("\n*XMASTREE-01,XMASTREE-01\n;By John Hyslop\n;Developed in mm as metric QCAD3 pattern\n180,1.016,24.13,0,25.4,1.016,-24.384\n90,1.016,20.828,0,25.4,3.302,-22.098\n180,8.382,20.828,0,25.4,7.366,-18.034\n49.763642,5.588,17.526,198.374734568,1.491539308,4.325464044,-428.2209495\n180,7.112,17.526,0,25.4,1.524,-23.876\n51.340192,4.064,13.716,126.938033652,3.966813504,4.879180742,-157.760174954\n180,5.588,13.716,0,25.4,1.524,-23.876\n52.431408,3.048,10.414,126.990557296,1.548665432,4.165909626,-412.425064658\n180,4.318,10.414,0,25.4,1.27,-24.13\n53.130102,2.032,7.366,91.44,5.08,3.81,-123.19\n180,3.302,7.366,0,25.4,1.27,-24.13\n53.972627,1.27,4.572,218.491081432,1.867445084,3.454773634,-342.02257732\n180,2.54,4.572,0,25.4,1.27,-24.13\n54.462322,0,1.016,91.53339072,2.952690056,4.369981354,-214.129080504\n0,24.384,24.13,0,25.4,1.016,-24.384\n90,24.384,20.828,0,25.4,3.302,-22.098\n0,17.018,20.828,0,25.4,7.366,-18.034\n130.236358,19.812,17.526,234.17167923,1.491539308,4.325464044,-428.2209495\n0,18.288,17.526,0,25.4,1.524,-23.876\n128.659808,21.336,13.716,35.701322044,3.966813504,4.879180742,-157.760174954\n0,19.812,13.716,0,25.4,1.524,-23.876\n127.568592,22.352,10.414,289.600417242,1.548665432,4.165909626,-412.425064658\n0,21.082,10.414,0,25.4,1.27,-24.13\n126.869898,23.368,7.366,35.56,5.08,3.81,-123.19\n0,22.098,7.366,0,25.4,1.27,-24.13\n126.027373,24.13,4.572,126.986269522,1.867445084,3.454773634,-342.02257732\n0,22.86,4.572,0,25.4,1.27,-24.13\n125.537678,25.4,1.016,126.965671138,2.952690056,4.369981354,-214.129080504\n0,11.684,1.016,0,25.4,1.016,-24.384\n270,11.684,4.318,0,25.4,3.302,-22.098\n0,4.318,4.318,0,25.4,7.366,-18.034\n229.763642,7.112,7.62,198.374734568,1.491539308,4.325464044,-428.2209495\n0,5.588,7.62,0,25.4,1.524,-23.876\n231.340192,8.636,11.43,126.938033652,3.966813504,4.879180742,-157.760174954\n0,7.112,11.43,0,25.4,1.524,-23.876\n232.431408,9.652,14.732,126.990557296,1.548665432,4.165909626,-412.425064658\n0,8.382,14.732,0,25.4,1.27,-24.13\n233.130102,10.668,17.78,91.44,5.08,3.81,-123.19\n0,9.398,17.78,0,25.4,1.27,-24.13\n233.972627,11.43,20.574,218.491081432,1.867445084,3.454773634,-342.02257732\n0,10.16,20.574,0,25.4,1.27,-24.13\n234.462322,12.7,24.13,91.53339072,2.952690056,4.369981354,-214.129080504\n180,13.716,1.016,0,25.4,1.016,-24.384\n270,13.716,4.318,0,25.4,3.302,-22.098\n180,21.082,4.318,0,25.4,7.366,-18.034\n310.236358,18.288,7.62,234.17167923,1.491539308,4.325464044,-428.2209495\n180,19.812,7.62,0,25.4,1.524,-23.876\n308.659808,16.764,11.43,35.701322044,3.966813504,4.879180742,-157.760174954\n180,18.288,11.43,0,25.4,1.524,-23.876\n307.568592,15.748,14.732,289.600417242,1.548665432,4.165909626,-412.425064658\n180,17.018,14.732,0,25.4,1.27,-24.13\n306.869898,14.732,17.78,35.56,5.08,3.81,-123.19\n180,16.002,17.78,0,25.4,1.27,-24.13\n306.027373,13.97,20.574,126.986269522,1.867445084,3.454773634,-342.02257732\n180,15.24,20.574,0,25.4,1.27,-24.13\n305.537678,12.7,24.13,126.965671138,2.952690056,4.369981354,-214.129080504\n")),N(O.ParsePatFile("\n*XMASTREE-02,XMASTREE-02\n;By John Hyslop\n;Developed in mm as metric QCAD3 pattern\n180,1.016,6.604,0,25.4,1.016,-24.384\n90,1.016,3.302,0,25.4,3.302,-22.098\n180,8.382,3.302,0,25.4,7.366,-18.034\n49.763642,5.588,0,198.374734568,1.491539308,4.325464044,-428.2209495\n180,7.112,25.4,0,25.4,1.524,-23.876\n51.340192,4.064,21.59,126.938033652,3.966813504,4.879180742,-157.760174954\n180,5.588,21.59,0,25.4,1.524,-23.876\n52.431408,3.048,18.288,126.990557296,1.548665432,4.165909626,-412.425064658\n180,4.318,18.288,0,25.4,1.27,-24.13\n53.130102,2.032,15.24,91.44,5.08,3.81,-123.19\n180,3.302,15.24,0,25.4,1.27,-24.13\n53.972627,1.27,12.446,218.491081432,1.867445084,3.454773634,-342.02257732\n180,2.54,12.446,0,25.4,1.27,-24.13\n54.462322,0,8.89,91.53339072,2.952690056,4.369981354,-214.129080504\n0,24.384,6.604,0,25.4,1.016,-24.384\n90,24.384,3.302,0,25.4,3.302,-22.098\n0,17.018,3.302,0,25.4,7.366,-18.034\n130.236358,19.812,0,234.17167923,1.491539308,4.325464044,-428.2209495\n0,18.288,25.4,0,25.4,1.524,-23.876\n128.659808,21.336,21.59,35.701322044,3.966813504,4.879180742,-157.760174954\n0,19.812,21.59,0,25.4,1.524,-23.876\n127.568592,22.352,18.288,289.600417242,1.548665432,4.165909626,-412.425064658\n0,21.082,18.288,0,25.4,1.27,-24.13\n126.869898,23.368,15.24,35.56,5.08,3.81,-123.19\n0,22.098,15.24,0,25.4,1.27,-24.13\n126.027373,24.13,12.446,126.986269522,1.867445084,3.454773634,-342.02257732\n0,22.86,12.446,0,25.4,1.27,-24.13\n125.537678,25.4,8.89,126.965671138,2.952690056,4.369981354,-214.129080504\n0,11.684,2.286,0,25.4,1.016,-24.384\n270,11.684,5.588,0,25.4,3.302,-22.098\n0,4.318,5.588,0,25.4,7.366,-18.034\n229.763642,7.112,8.89,198.374734568,1.491539308,4.325464044,-428.2209495\n0,5.588,8.89,0,25.4,1.524,-23.876\n231.340192,8.636,12.7,126.938033652,3.966813504,4.879180742,-157.760174954\n0,7.112,12.7,0,25.4,1.524,-23.876\n232.431408,9.652,16.002,126.990557296,1.548665432,4.165909626,-412.425064658\n0,8.382,16.002,0,25.4,1.27,-24.13\n233.130102,10.668,19.05,91.44,5.08,3.81,-123.19\n0,9.398,19.05,0,25.4,1.27,-24.13\n233.972627,11.43,21.844,218.491081432,1.867445084,3.454773634,-342.02257732\n0,10.16,21.844,0,25.4,1.27,-24.13\n234.462322,12.7,25.4,91.53339072,2.952690056,4.369981354,-214.129080504\n180,13.716,2.286,0,25.4,1.016,-24.384\n270,13.716,5.588,0,25.4,3.302,-22.098\n180,21.082,5.588,0,25.4,7.366,-18.034\n310.236358,18.288,8.89,234.17167923,1.491539308,4.325464044,-428.2209495\n180,19.812,8.89,0,25.4,1.524,-23.876\n308.659808,16.764,12.7,35.701322044,3.966813504,4.879180742,-157.760174954\n180,18.288,12.7,0,25.4,1.524,-23.876\n307.568592,15.748,16.002,289.600417242,1.548665432,4.165909626,-412.425064658\n180,17.018,16.002,0,25.4,1.27,-24.13\n306.869898,14.732,19.05,35.56,5.08,3.81,-123.19\n180,16.002,19.05,0,25.4,1.27,-24.13\n306.027373,13.97,21.844,126.986269522,1.867445084,3.454773634,-342.02257732\n180,15.24,21.844,0,25.4,1.27,-24.13\n305.537678,12.7,25.4,126.965671138,2.952690056,4.369981354,-214.129080504\n")),N(O.ParsePatFile("\n*ZIGZAG,ZIGZAG\n0, 0,0, 3.175,3.175, 3.175,-3.175\n90, 3.175,0, 3.175,3.175, 3.175,-3.175\n")),N(O.ParsePatFile("\n*ACAD_ISO02W100,ACAD_ISO02W100\n0, 0,0, 0,5, 12,-3\n"),!1),N(O.ParsePatFile("\n*ACAD_ISO03W100,ACAD_ISO03W100\n0, 0,0, 0,5, 12,-18\n"),!1),N(O.ParsePatFile("\n*ACAD_ISO04W100,ACAD_ISO04W100\n0, 0,0, 0,5, 24,-3,.5,-3\n"),!1),N(O.ParsePatFile("\n*ACAD_ISO05W100,ACAD_ISO05W100\n0, 0,0, 0,5, 24,-3,.5,-3,.5,-3\n"),!1),N(O.ParsePatFile("\n*ACAD_ISO06W100,ACAD_ISO06W100\n0, 0,0, 0,5, 24,-3,.5,-3,.5,-6.5\n0, 0,0, 0,5, -34,.5,-3\n"),!1),N(O.ParsePatFile("\n*ACAD_ISO07W100,ACAD_ISO07W100\n0, 0,0, 0,5, .5,-3\n"),!1),N(O.ParsePatFile("\n*ACAD_ISO08W100,ACAD_ISO08W100\n0, 0,0, 0,5, 24,-3,6,-3\n"),!1),N(O.ParsePatFile("\n*ACAD_ISO09W100,ACAD_ISO09W100\n0, 0,0, 0,5, 24,-3,6,-3,6,-3\n"),!1),N(O.ParsePatFile("\n*ACAD_ISO10W100,ACAD_ISO10W100\n0, 0,0, 0,5, 12,-3,.5,-3\n"),!1),N(O.ParsePatFile("\n*ACAD_ISO11W100,ACAD_ISO11W100\n0, 0,0, 0,5, 12,-3,12,-3,.5,-3\n"),!1),N(O.ParsePatFile("\n*ACAD_ISO12W100,ACAD_ISO12W100\n0, 0,0, 0,5, 12,-3,.5,-3,.5,-3\n"),!1),N(O.ParsePatFile("\n*ACAD_ISO13W100,ACAD_ISO13W100\n0, 0,0, 0,5, 12,-3,12,-3,.5,-6.5\n0, 0,0, 0,5, -33.5,.5,-3\n"),!1),N(O.ParsePatFile("\n*ACAD_ISO14W100,ACAD_ISO14W100\n0, 0,0, 0,5, 12,-3,.5,-3,.5,-6.5\n0, 0,0, 0,5, -22,.5,-3\n"),!1),N(O.ParsePatFile("\n*ACAD_ISO15W100,ACAD_ISO15W100\n0, 0,0, 0,5, 12,-3,12,-3,.5,-10\n0, 0,0, 0,5, -33.5,.5,-3,.5,-3\n"),!1),N(O.ParsePatFile("\n*ANGLE,ANGLE\n0, 0,0, 0,.275, .2,-.075\n90, 0,0, 0,.275, .2,-.075\n"),!1),N(O.ParsePatFile("\n*ANSI31,ANSI31\n45, 0,0, 0,.125\n"),!1),N(O.ParsePatFile("\n*ANSI32,ANSI32\n45, 0,0, 0,.375\n45, .1767767,0, 0,.375\n"),!1),N(O.ParsePatFile("\n*ANSI33,ANSI33\n45, 0,0, 0,.25\n45, .1767767,0, 0,.25, .125,-.0625\n"),!1),N(O.ParsePatFile("\n*ANSI34,ANSI34\n45, 0,0, 0,.75\n45, .1767767,0, 0,.75\n45, .35355339,0, 0,.75\n45, .53033009,0, 0,.75\n"),!1),N(O.ParsePatFile("\n*ANSI35,ANSI35\n45, 0,0, 0,.25\n45, .1767767,0, 0,.25, .3125,-.0625,0,-.0625\n"),!1),N(O.ParsePatFile("\n*ANSI36,ANSI36\n45, 0,0, .21875,.125, .3125,-.0625,0,-.0625\n"),!1),N(O.ParsePatFile("\n*ANSI37,ANSI37\n45, 0,0, 0,.125\n135, 0,0, 0,.125\n"),!1),N(O.ParsePatFile("\n*ANSI38,ANSI38\n45, 0,0, 0,.125\n135, 0,0, .25,.125, .3125,-.1875\n"),!1),N(O.ParsePatFile("\n*AR-B816C,AR-B816C\n0, 0,0, 8,8, 15.625,-.375\n0, -8,.375, 8,8, 15.625,-.375\n90, 0,0, 8,8, -8.375,7.625\n90, -.375,0, 8,8, -8.375,7.625\n"),!1),N(O.ParsePatFile("\n*AR-B816,AR-B816\n0, 0,0, 0,8\n90, 0,0, 8,8, 8,-8\n"),!1),N(O.ParsePatFile("\n*AR-B88,AR-B88\n0, 0,0, 0,8\n90, 0,0, 8,4, 8,-8\n"),!1),N(O.ParsePatFile("\n*AR-BRELM,AR-BRELM\n0, 0,0, 0,5.334, 7.625,-.375\n0, 0,2.25, 0,5.334, 7.625,-.375\n0, 2,2.667, 0,5.334, 3.625,-.375\n0, 2,4.917, 0,5.334, 3.625,-.375\n90, 0,0, 0,8, 2.25,-3.084\n90, -.375,0, 0,8, 2.25,-3.084\n90, 2,2.667, 0,4, 2.25,-3.084\n90, 1.625,2.667, 0,4, 2.25,-3.084\n"),!1),N(O.ParsePatFile("\n*AR-BRSTD,AR-BRSTD\n0, 0,0, 0,2.667\n90, 0,0, 2.667,4, 2.667,-2.667\n"),!1),N(O.ParsePatFile("\n*AR-CONC-01,AR-CONC-01\n;Optimize to replace existing AR-CONC Pattern\n;By John Hyslop, Using AutoCAD Lisp Tool\n;Developed in inch as imperial QCAD3 pattern\n243.434949,0.3,0.8,8.9442719,4.472136,0.2236068,-22.137073\n90,0.3,0.6,0,10,0.2,-9.8\n0,0.2,0.6,0,10,0.1,-9.9\n315,0.1,0.1,7.0710678,7.0710678,0.1414214,-14.0007143\n206.565051,0.3,0.2,13.4164079,4.472136,0.2236068,-22.137073\n63.434949,0.2,0,8.9442719,4.472136,0.2236068,-22.137073\n45,2,0.4,7.0710678,7.0710678,0.2828427,-13.8592929\n161.565051,2.3,0.3,9.486833,3.1622777,0.3162278,-31.3065488\n288.434949,2.2,0.6,22.1359436,3.1622777,0.3162278,-31.3065488\n315,2.3,0.9,7.0710678,7.0710678,0.1414214,-14.0007143\n206.565051,2.5,1,13.4164079,4.472136,0.2236068,-22.137073\n63.434949,2.4,0.8,8.9442719,4.472136,0.2236068,-22.137073\n270,4.1,0.6,0,10,0.2,-9.8\n45,3.9,0.4,7.0710678,7.0710678,0.2828427,-13.8592929\n180,4.1,0.4,0,10,0.2,-9.8\n333.434949,3.9,0.2,8.9442719,4.472136,0.2236068,-22.137073\n225,4,0.3,7.0710678,7.0710678,0.1414214,-14.0007143\n116.565051,4.1,0.1,13.4164079,4.472136,0.2236068,-22.137073\n198.434949,6.3,0.8,22.1359436,3.1622777,0.3162278,-31.3065488\n63.434949,6.2,0.6,8.9442719,4.472136,0.2236068,-22.137073\n333.434949,6,0.7,8.9442719,4.472136,0.2236068,-22.137073\n26.565051,5.7,0,13.4164079,4.472136,0.2236068,-22.137073\n251.565051,5.8,0.3,9.486833,3.1622777,0.3162278,-31.3065488\n116.565051,5.9,0.1,13.4164079,4.472136,0.2236068,-22.137073\n45,6.7,0.1,7.0710678,7.0710678,0.2828427,-13.8592929\n161.565051,7,0,9.486833,3.1622777,0.3162278,-31.3065488\n288.434949,6.9,0.3,22.1359436,3.1622777,0.3162278,-31.3065488\n315,3,2.8,7.0710678,7.0710678,0.1414214,-14.0007143\n206.565051,3.2,2.9,13.4164079,4.472136,0.2236068,-22.137073\n63.434949,3.1,2.7,8.9442719,4.472136,0.2236068,-22.137073\n45,1.1,0.8,7.0710678,7.0710678,0.2828427,-13.8592929\n180,1.3,0.8,0,10,0.2,-9.8\n270,1.3,1,0,10,0.2,-9.8\n225,1.8,2.4,7.0710678,7.0710678,0.1414214,-14.0007143\n270,1.8,2.6,0,10,0.2,-9.8\n71.565051,1.7,2.3,9.486833,3.1622777,0.3162278,-31.3065488\n198.434949,1,2.1,22.1359436,3.1622777,0.3162278,-31.3065488\n63.434949,0.9,1.9,8.9442719,4.472136,0.2236068,-22.137073\n333.434949,0.7,2,8.9442719,4.472136,0.2236068,-22.137073\n0,3.5,2.2,0,10,0.2,-9.8\n225,3.7,2.4,7.0710678,7.0710678,0.2828427,-13.8592929\n90,3.7,2.2,0,10,0.2,-9.8\n315,4.5,1.7,7.0710678,7.0710678,0.1414214,-14.0007143\n206.565051,4.7,1.8,13.4164079,4.472136,0.2236068,-22.137073\n63.434949,4.6,1.6,8.9442719,4.472136,0.2236068,-22.137073\n315,5.5,2.1,7.0710678,7.0710678,0.1414214,-14.0007143\n270,5.5,2.3,0,10,0.2,-9.8\n108.434949,5.6,2,22.1359436,3.1622777,0.3162278,-31.3065488\n206.565051,6.9,2.7,13.4164079,4.472136,0.2236068,-22.137073\n63.434949,6.8,2.5,8.9442719,4.472136,0.2236068,-22.137073\n315,6.7,2.6,7.0710678,7.0710678,0.1414214,-14.0007143\n333.434949,7.3,1.9,8.9442719,4.472136,0.2236068,-22.137073\n225,7.4,2,7.0710678,7.0710678,0.1414214,-14.0007143\n116.565051,7.5,1.8,13.4164079,4.472136,0.2236068,-22.137073\n26.565051,8.2,1.5,13.4164079,4.472136,0.2236068,-22.137073\n153.434949,8.4,1.4,8.9442719,4.472136,0.2236068,-22.137073\n270,8.4,1.6,0,10,0.2,-9.8\n180,9.3,1.7,0,10,0.1,-9.9\n270,9.3,1.8,0,10,0.1,-9.9\n45,9.2,1.7,7.0710678,7.0710678,0.1414214,-14.0007143\n153.434949,9.3,2.4,8.9442719,4.472136,0.2236068,-22.137073\n270,9.3,2.7,0,10,0.3,-9.7\n45,9.1,2.5,7.0710678,7.0710678,0.2828427,-13.8592929\n206.565051,9.1,3.5,13.4164079,4.472136,0.2236068,-22.137073\n63.434949,9,3.3,8.9442719,4.472136,0.2236068,-22.137073\n315,8.9,3.4,7.0710678,7.0710678,0.1414214,-14.0007143\n180,6.5,2.9,0,10,0.2,-9.8\n270,6.5,3.2,0,10,0.3,-9.7\n56.309932,6.3,2.9,22.1880078,2.773501,0.3605551,-35.6949576\n198.434949,5.4,3.8,22.1359436,3.1622777,0.3162278,-31.3065488\n71.565051,5.3,3.5,9.486833,3.1622777,0.3162278,-31.3065488\n315,5.1,3.7,7.0710678,7.0710678,0.2828427,-13.8592929\n180,3.8,3.3,0,10,0.3,-9.7\n270,3.8,3.6,0,10,0.3,-9.7\n45,3.5,3.3,7.0710678,7.0710678,0.4242641,-13.7178716\n225,3.3,4.3,7.0710678,7.0710678,0.2828427,-13.8592929\n90,3.3,4.1,0,10,0.2,-9.8\n0,3.1,4.1,0,10,0.2,-9.8\n206.565051,1.6,3.9,13.4164079,4.472136,0.2236068,-22.137073\n63.434949,1.5,3.7,8.9442719,4.472136,0.2236068,-22.137073\n315,1.4,3.8,7.0710678,7.0710678,0.1414214,-14.0007143\n108.434949,1,3.7,22.1359436,3.1622777,0.3162278,-31.3065488\n341.565051,0.7,3.8,9.486833,3.1622777,0.3162278,-31.3065488\n225,0.9,4,7.0710678,7.0710678,0.2828427,-13.8592929\n270,1.5,4.5,0,10,0.2,-9.8\n45,1.3,4.3,7.0710678,7.0710678,0.2828427,-13.8592929\n180,1.5,4.3,0,10,0.2,-9.8\n315,3.6,4.7,7.0710678,7.0710678,0.1414214,-14.0007143\n206.565051,3.8,4.8,13.4164079,4.472136,0.2236068,-22.137073\n63.434949,3.7,4.6,8.9442719,4.472136,0.2236068,-22.137073\n0,5.1,4,0,10,0.1,-9.9\n225,5.2,4.1,7.0710678,7.0710678,0.1414214,-14.0007143\n90,5.2,4,0,10,0.1,-9.9\n0,6.9,3.8,0,10,0.2,-9.8\n243.434949,7,4,8.9442719,4.472136,0.2236068,-22.137073\n116.565051,7.1,3.8,13.4164079,4.472136,0.2236068,-22.137073\n26.565051,7.3,4.5,13.4164079,4.472136,0.2236068,-22.137073\n116.565051,7.4,4.3,13.4164079,4.472136,0.2236068,-22.137073\n251.565051,7.5,4.6,9.486833,3.1622777,0.3162278,-31.3065488\n63.434949,8.8,3.6,8.9442719,4.472136,0.2236068,-22.137073\n180,9,3.6,0,10,0.2,-9.8\n296.565051,8.9,3.8,13.4164079,4.472136,0.2236068,-22.137073\n180,9,5.4,0,10,0.3,-9.7\n270,9,5.7,0,10,0.3,-9.7\n45,8.7,5.4,7.0710678,7.0710678,0.4242641,-13.7178716\n180,8.6,5.6,0,10,0.2,-9.8\n270,8.6,5.8,0,10,0.2,-9.8\n45,8.4,5.6,7.0710678,7.0710678,0.2828427,-13.8592929\n243.434949,8.2,6.5,8.9442719,4.472136,0.2236068,-22.137073\n26.565051,8,6.4,13.4164079,4.472136,0.2236068,-22.137073\n135,8.1,6.3,7.0710678,7.0710678,0.1414214,-14.0007143\n243.434949,6.7,6,8.9442719,4.472136,0.2236068,-22.137073\n116.565051,6.8,5.8,13.4164079,4.472136,0.2236068,-22.137073\n0,6.6,5.8,0,10,0.2,-9.8\n225,6.2,6.1,7.0710678,7.0710678,0.2828427,-13.8592929\n108.434949,6.3,5.8,22.1359436,3.1622777,0.3162278,-31.3065488\n341.565051,6,5.9,9.486833,3.1622777,0.3162278,-31.3065488\n135,5.9,5.4,7.0710678,7.0710678,0.1414214,-14.0007143\n243.434949,6,5.6,8.9442719,4.472136,0.2236068,-22.137073\n26.565051,5.8,5.5,13.4164079,4.472136,0.2236068,-22.137073\n180,4.8,6,0,10,0.1,-9.9\n270,4.8,6.1,0,10,0.1,-9.9\n45,4.7,6,7.0710678,7.0710678,0.1414214,-14.0007143\n206.565051,4.4,6.7,13.4164079,4.472136,0.2236068,-22.137073\n63.434949,4.3,6.5,8.9442719,4.472136,0.2236068,-22.137073\n315,4.2,6.6,7.0710678,7.0710678,0.1414214,-14.0007143\n225,3.4,6.5,7.0710678,7.0710678,0.2828427,-13.8592929\n90,3.4,6.2,0,10,0.3,-9.7\n333.434949,3.2,6.3,8.9442719,4.472136,0.2236068,-22.137073\n180,3,6.1,0,10,0.2,-9.8\n270,3,6.3,0,10,0.2,-9.8\n45,2.8,6.1,7.0710678,7.0710678,0.2828427,-13.8592929\n135,2.1,5.6,7.0710678,7.0710678,0.1414214,-14.0007143\n243.434949,2.2,5.8,8.9442719,4.472136,0.2236068,-22.137073\n26.565051,2,5.7,13.4164079,4.472136,0.2236068,-22.137073\n180,1.1,6.3,0,10,0.2,-9.8\n270,1.1,6.5,0,10,0.2,-9.8\n45,0.9,6.3,7.0710678,7.0710678,0.2828427,-13.8592929\n270,0.6,7,0,10,0.3,-9.7\n45,0.4,6.8,7.0710678,7.0710678,0.2828427,-13.8592929\n153.434949,0.6,6.7,8.9442719,4.472136,0.2236068,-22.137073\n243.434949,8.2,7.8,8.9442719,4.472136,0.2236068,-22.137073\n90,8.2,7.6,0,10,0.2,-9.8\n0,8.1,7.6,0,10,0.1,-9.9\n135,8.7,8.2,7.0710678,7.0710678,0.1414214,-14.0007143\n243.434949,8.8,8.4,8.9442719,4.472136,0.2236068,-22.137073\n26.565051,8.6,8.3,13.4164079,4.472136,0.2236068,-22.137073\n180,8.6,8.4,0,10,0.2,-9.8\n251.565051,8.7,8.7,9.486833,3.1622777,0.3162278,-31.3065488\n45,8.4,8.4,7.0710678,7.0710678,0.4242641,-13.7178716\n153.434949,7.2,9.2,8.9442719,4.472136,0.2236068,-22.137073\n135,6.5,7.3,7.0710678,7.0710678,0.1414214,-14.0007143\n243.434949,6.6,7.5,8.9442719,4.472136,0.2236068,-22.137073\n26.565051,6.4,7.4,13.4164079,4.472136,0.2236068,-22.137073\n135,6.3,7.7,7.0710678,7.0710678,0.1414214,-14.0007143\n251.565051,6.4,8,9.486833,3.1622777,0.3162278,-31.3065488\n45,6.2,7.8,7.0710678,7.0710678,0.2828427,-13.8592929\n26.565051,2.6,7.6,13.4164079,4.472136,0.2236068,-22.137073\n153.434949,2.8,7.5,8.9442719,4.472136,0.2236068,-22.137073\n270,2.8,7.7,0,10,0.2,-9.8\n90,4.5,7.9,0,10,0.2,-9.8\n0,4.3,7.9,0,10,0.2,-9.8\n225,4.5,8.1,7.0710678,7.0710678,0.2828427,-13.8592929\n63.434949,4.9,8.3,8.9442719,4.472136,0.2236068,-22.137073\n315,4.8,8.4,7.0710678,7.0710678,0.1414214,-14.0007143\n206.565051,5,8.5,13.4164079,4.472136,0.2236068,-22.137073\n153.434949,5.8,8.8,8.9442719,4.472136,0.2236068,-22.137073\n270,5.8,9.1,0,10,0.3,-9.7\n45,5.6,8.9,7.0710678,7.0710678,0.2828427,-13.8592929\n0,2.8,9.3,0,10,0.3,-9.7\n135,2.6,8,7.0710678,7.0710678,0.1414214,-14.0007143\n270,2.6,8.2,0,10,0.2,-9.8\n45,2.5,8.1,7.0710678,7.0710678,0.1414214,-14.0007143\n116.565051,0.8,8.2,13.4164079,4.472136,0.2236068,-22.137073\n333.434949,0.6,8.3,8.9442719,4.472136,0.2236068,-22.137073\n225,0.7,8.4,7.0710678,7.0710678,0.1414214,-14.0007143\n135,1.2,8.6,7.0710678,7.0710678,0.1414214,-14.0007143\n243.434949,1.3,8.8,8.9442719,4.472136,0.2236068,-22.137073\n26.565051,1.1,8.7,13.4164079,4.472136,0.2236068,-22.137073\n0,8.74875,8.58939,0,10,0,-10\n0,8.12326,9.16255,0,10,0,-10\n0,8.22334,7.41455,0,10,0,-10\n0,7.2264,8.32807,0,10,0,-10\n0,6.60091,8.90123,0,10,0,-10\n0,8.74106,5.28385,0,10,0,-10\n0,8.11556,5.85701,0,10,0,-10\n0,6.70099,7.15323,0,10,0,-10\n0,5.70405,8.06676,0,10,0,-10\n0,5.07855,8.63992,0,10,0,-10\n0,8.21564,4.10901,0,10,0,-10\n0,7.2187,5.02254,0,10,0,-10\n0,6.59321,5.5957,0,10,0,-10\n0,5.17863,6.89192,0,10,0,-10\n0,4.18169,7.80544,0,10,0,-10\n0,3.5562,8.3786,0,10,0,-10\n0,8.73336,1.97832,0,10,0,-10\n0,8.10787,2.55148,0,10,0,-10\n0,6.69329,3.8477,0,10,0,-10\n0,5.69635,4.76122,0,10,0,-10\n0,5.07086,5.33438,0,10,0,-10\n0,3.65628,6.6306,0,10,0,-10\n0,2.65934,7.54413,0,10,0,-10\n0,2.03385,8.11729,0,10,0,-10\n0,8.20795,0.80348,0,10,0,-10\n0,7.21101,1.717,0,10,0,-10\n0,6.58551,2.29016,0,10,0,-10\n0,5.17094,3.58638,0,10,0,-10\n0,4.174,4.49991,0,10,0,-10\n0,3.5485,5.07307,0,10,0,-10\n0,2.13393,6.36929,0,10,0,-10\n0,1.13699,7.28282,0,10,0,-10\n0,0.51149,7.85597,0,10,0,-10\n0,6.68559,0.54216,0,10,0,-10\n0,5.68865,1.45569,0,10,0,-10\n0,5.06316,2.02885,0,10,0,-10\n0,3.53626,3.22649,0,10,0,-10\n0,2.65164,4.23859,0,10,0,-10\n0,2.02615,4.81175,0,10,0,-10\n0,0.61157,6.10797,0,10,0,-10\n0,5.16324,0.28085,0,10,0,-10\n0,4.1663,1.19437,0,10,0,-10\n0,3.54081,1.76753,0,10,0,-10\n0,2.12623,3.06375,0,10,0,-10\n0,1.12929,3.97728,0,10,0,-10\n0,0.5038,4.55044,0,10,0,-10\n0,3.64089,0.01953,0,10,0,-10\n0,2.64395,0.93306,0,10,0,-10\n0,2.01845,1.50622,0,10,0,-10\n0,0.60388,2.80244,0,10,0,-10\n0,1.12159,0.67174,0,10,0,-10\n0,0.4961,1.2449,0,10,0,-10\n0,9.15644,8.35141,0,10,0,-10\n0,8.31335,8.05964,0,10,0,-10\n0,7.76295,8.41028,0,10,0,-10\n0,8.6371,7.02451,0,10,0,-10\n0,6.91985,8.11852,0,10,0,-10\n0,6.36945,8.46916,0,10,0,-10\n0,7.2436,7.08339,0,10,0,-10\n0,5.52636,8.17739,0,10,0,-10\n0,4.97596,8.52804,0,10,0,-10\n0,8.67916,5.33996,0,10,0,-10\n0,8.12876,5.69061,0,10,0,-10\n0,5.85011,7.14227,0,10,0,-10\n0,4.13287,8.23627,0,10,0,-10\n0,3.58247,8.58691,0,10,0,-10\n0,9.00291,4.30484,0,10,0,-10\n0,7.28566,5.39884,0,10,0,-10\n0,6.73527,5.74948,0,10,0,-10\n0,4.45662,7.20114,0,10,0,-10\n0,2.73937,8.29515,0,10,0,-10\n0,2.18897,8.64579,0,10,0,-10\n0,7.60942,4.36371,0,10,0,-10\n0,5.89217,5.45772,0,10,0,-10\n0,5.34177,5.80836,0,10,0,-10\n0,3.06312,7.26002,0,10,0,-10\n0,1.34588,8.35403,0,10,0,-10\n0,0.79548,8.70467,0,10,0,-10\n0,9.04497,2.62029,0,10,0,-10\n0,8.49457,2.97093,0,10,0,-10\n0,6.21592,4.42259,0,10,0,-10\n0,4.49868,5.5166,0,10,0,-10\n0,3.94828,5.86724,0,10,0,-10\n0,1.66963,7.3189,0,10,0,-10\n0,9.36872,1.58516,0,10,0,-10\n0,7.65148,2.67917,0,10,0,-10\n0,7.10108,3.02981,0,10,0,-10\n0,4.82243,4.48147,0,10,0,-10\n0,3.10518,5.57547,0,10,0,-10\n0,2.55479,5.92612,0,10,0,-10\n0,0.27613,7.37778,0,10,0,-10\n0,7.97523,1.64404,0,10,0,-10\n0,6.25798,2.73804,0,10,0,-10\n0,5.70758,3.08869,0,10,0,-10\n0,3.42893,4.54035,0,10,0,-10\n0,1.71169,5.63435,0,10,0,-10\n0,1.16129,5.98499,0,10,0,-10\n0,8.86038,0.25125,0,10,0,-10\n0,6.58173,1.70292,0,10,0,-10\n0,4.86449,2.79692,0,10,0,-10\n0,4.31409,3.14756,0,10,0,-10\n0,2.03544,4.59922,0,10,0,-10\n0,0.3182,5.69323,0,10,0,-10\n0,7.46689,0.31013,0,10,0,-10\n0,5.18824,1.76179,0,10,0,-10\n0,3.471,2.8558,0,10,0,-10\n0,2.9206,3.20644,0,10,0,-10\n0,0.64195,4.6581,0,10,0,-10\n0,6.6238,0.01837,0,10,0,-10\n0,6.0734,0.36901,0,10,0,-10\n0,3.79475,1.82067,0,10,0,-10\n0,2.0775,2.91468,0,10,0,-10\n0,1.5271,3.26532,0,10,0,-10\n0,5.2303,0.07724,0,10,0,-10\n0,4.6799,0.42789,0,10,0,-10\n0,2.40125,1.87955,0,10,0,-10\n0,0.68401,2.97355,0,10,0,-10\n0,0.13361,3.3242,0,10,0,-10\n0,3.83681,0.13612,0,10,0,-10\n0,3.28641,0.48676,0,10,0,-10\n0,1.00776,1.93842,0,10,0,-10\n0,2.44331,0.195,0,10,0,-10\n0,1.89292,0.54564,0,10,0,-10\n0,1.04982,0.25388,0,10,0,-10\n0,0.49942,0.60452,0,10,0,-10\n0,6.42555,9.30607,0,10,0,-10\n0,4.77695,9.08903,0,10,0,-10\n0,3.7883,8.95887,0,10,0,-10\n0,3.13481,8.87284,0,10,0,-10\n0,1.48621,8.6558,0,10,0,-10\n0,0.49757,8.52564,0,10,0,-10\n0,9.02957,8.70973,0,10,0,-10\n0,7.38097,8.49269,0,10,0,-10\n0,6.39232,8.36253,0,10,0,-10\n0,5.73883,8.2765,0,10,0,-10\n0,4.09023,8.05946,0,10,0,-10\n0,3.10158,7.9293,0,10,0,-10\n0,2.4481,7.84327,0,10,0,-10\n0,0.79949,7.62622,0,10,0,-10\n0,8.99634,7.76619,0,10,0,-10\n0,8.34285,7.68016,0,10,0,-10\n0,6.69425,7.46312,0,10,0,-10\n0,5.7056,7.33296,0,10,0,-10\n0,5.05211,7.24692,0,10,0,-10\n0,3.40351,7.02988,0,10,0,-10\n0,2.41487,6.89972,0,10,0,-10\n0,1.76138,6.81369,0,10,0,-10\n0,0.11277,6.59665,0,10,0,-10\n0,9.29827,6.86677,0,10,0,-10\n0,8.30962,6.73662,0,10,0,-10\n0,7.65613,6.65058,0,10,0,-10\n0,6.00753,6.43354,0,10,0,-10\n0,5.01888,6.30338,0,10,0,-10\n0,4.3654,6.21735,0,10,0,-10\n0,2.71679,6.00031,0,10,0,-10\n0,1.72815,5.87015,0,10,0,-10\n0,1.07466,5.78412,0,10,0,-10\n0,8.61155,5.8372,0,10,0,-10\n0,7.6229,5.70704,0,10,0,-10\n0,6.96941,5.62101,0,10,0,-10\n0,5.32081,5.40397,0,10,0,-10\n0,4.33217,5.27381,0,10,0,-10\n0,3.67868,5.18777,0,10,0,-10\n0,2.03007,4.97073,0,10,0,-10\n0,1.04143,4.84057,0,10,0,-10\n0,0.38794,4.75454,0,10,0,-10\n0,7.92483,4.80762,0,10,0,-10\n0,6.93618,4.67747,0,10,0,-10\n0,6.2827,4.59143,0,10,0,-10\n0,4.63409,4.37439,0,10,0,-10\n0,3.64545,4.24423,0,10,0,-10\n0,2.99196,4.1582,0,10,0,-10\n0,1.34336,3.94116,0,10,0,-10\n0,0.35471,3.811,0,10,0,-10\n0,8.88671,3.99509,0,10,0,-10\n0,7.23811,3.77805,0,10,0,-10\n0,6.24947,3.64789,0,10,0,-10\n0,5.59598,3.56186,0,10,0,-10\n0,3.94737,3.34482,0,10,0,-10\n0,2.95873,3.21466,0,10,0,-10\n0,2.30524,3.12862,0,10,0,-10\n0,0.65664,2.91158,0,10,0,-10\n0,8.85348,3.05155,0,10,0,-10\n0,8.19999,2.96552,0,10,0,-10\n0,6.55139,2.74847,0,10,0,-10\n0,5.56275,2.61832,0,10,0,-10\n0,4.90926,2.53228,0,10,0,-10\n0,3.26065,2.31524,0,10,0,-10\n0,2.27201,2.18508,0,10,0,-10\n0,1.61852,2.09905,0,10,0,-10\n0,9.15541,2.15213,0,10,0,-10\n0,8.16676,2.02197,0,10,0,-10\n0,7.51328,1.93594,0,10,0,-10\n0,5.86467,1.7189,0,10,0,-10\n0,4.87603,1.58874,0,10,0,-10\n0,4.22254,1.50271,0,10,0,-10\n0,2.57394,1.28567,0,10,0,-10\n0,1.58529,1.15551,0,10,0,-10\n0,0.9318,1.06947,0,10,0,-10\n0,8.46869,1.12256,0,10,0,-10\n0,7.48005,0.9924,0,10,0,-10\n0,6.82656,0.90637,0,10,0,-10\n0,5.17795,0.68932,0,10,0,-10\n0,4.18931,0.55917,0,10,0,-10\n0,3.53582,0.47313,0,10,0,-10\n0,1.88722,0.25609,0,10,0,-10\n0,0.89857,0.12593,0,10,0,-10\n0,0.24508,0.0399,0,10,0,-10\n0,7.78197,0.09298,0,10,0,-10\n0,1.25458,8.906,0,10,0,-10\n0,2.59486,9.0898,0,10,0,-10\n0,1.22284,8.03701,0,10,0,-10\n0,3.91339,9.25692,0,10,0,-10\n0,2.56312,8.22081,0,10,0,-10\n0,1.19109,7.16803,0,10,0,-10\n0,3.88165,8.38793,0,10,0,-10\n0,2.53137,7.35183,0,10,0,-10\n0,1.15935,6.29904,0,10,0,-10\n0,5.23746,8.58365,0,10,0,-10\n0,3.84991,7.51894,0,10,0,-10\n0,2.49963,6.48284,0,10,0,-10\n0,1.12761,5.43005,0,10,0,-10\n0,6.57774,8.76745,0,10,0,-10\n0,5.20572,7.71466,0,10,0,-10\n0,3.81816,6.64995,0,10,0,-10\n0,2.46789,5.61385,0,10,0,-10\n0,1.09587,4.56106,0,10,0,-10\n0,7.89627,8.93456,0,10,0,-10\n0,6.546,7.89846,0,10,0,-10\n0,5.17398,6.84567,0,10,0,-10\n0,3.78642,5.78096,0,10,0,-10\n0,2.43615,4.74486,0,10,0,-10\n0,1.06413,3.69207,0,10,0,-10\n0,9.25208,9.13028,0,10,0,-10\n0,7.86453,8.06557,0,10,0,-10\n0,6.51425,7.02947,0,10,0,-10\n0,5.14223,5.97668,0,10,0,-10\n0,3.75468,4.91198,0,10,0,-10\n0,2.4044,3.87587,0,10,0,-10\n0,1.03238,2.82308,0,10,0,-10\n0,9.22034,8.26129,0,10,0,-10\n0,7.83279,7.19659,0,10,0,-10\n0,6.48251,6.16048,0,10,0,-10\n0,5.11049,5.10769,0,10,0,-10\n0,3.72294,4.04299,0,10,0,-10\n0,2.37266,3.00688,0,10,0,-10\n0,1.00064,1.9541,0,10,0,-10\n0,9.1886,7.3923,0,10,0,-10\n0,7.80105,6.3276,0,10,0,-10\n0,6.45077,5.29149,0,10,0,-10\n0,5.07875,4.23871,0,10,0,-10\n0,3.6912,3.174,0,10,0,-10\n0,2.34092,2.1379,0,10,0,-10\n0,0.9689,1.08511,0,10,0,-10\n0,9.15686,6.52332,0,10,0,-10\n0,7.7693,5.45861,0,10,0,-10\n0,6.41903,4.42251,0,10,0,-10\n0,5.04701,3.36972,0,10,0,-10\n0,2.30918,1.26891,0,10,0,-10\n0,0.93716,0.21612,0,10,0,-10\n0,9.12511,5.65433,0,10,0,-10\n0,7.73756,4.58962,0,10,0,-10\n0,6.38729,3.55352,0,10,0,-10\n0,5.01527,2.50073,0,10,0,-10\n0,3.62771,1.43602,0,10,0,-10\n0,2.27744,0.39992,0,10,0,-10\n0,9.09337,4.78534,0,10,0,-10\n0,7.70582,3.72063,0,10,0,-10\n0,6.35554,2.68453,0,10,0,-10\n0,4.98352,1.63174,0,10,0,-10\n0,3.59597,0.56703,0,10,0,-10\n0,9.06163,3.91635,0,10,0,-10\n0,7.67408,2.85164,0,10,0,-10\n0,6.3238,1.81554,0,10,0,-10\n0,4.95178,0.76275,0,10,0,-10\n0,9.02989,3.04736,0,10,0,-10\n0,7.64234,1.98266,0,10,0,-10\n0,6.29206,0.94655,0,10,0,-10\n0,8.99815,2.17837,0,10,0,-10\n0,7.61059,1.11367,0,10,0,-10\n0,6.26032,0.07756,0,10,0,-10\n0,8.9664,1.30939,0,10,0,-10\n0,7.57885,0.24468,0,10,0,-10\n0,8.93466,0.4404,0,10,0,-10\n206.565051,10,0.6,13.4164079,4.472136,0.2236068,-22.137073\n63.434949,9.9,0.4,8.9442719,4.472136,0.2236068,-22.137073\n315,9.8,0.5,7.0710678,7.0710678,0.1414214,-14.0007143\n206.565051,9.7,5.4,13.4164079,4.472136,0.2236068,-22.137073\n63.434949,9.6,5.2,8.9442719,4.472136,0.2236068,-22.137073\n315,9.5,5.3,7.0710678,7.0710678,0.1414214,-14.0007143\n153.434949,10,7.2,8.9442719,4.472136,0.2236068,-22.137073\n288.434949,9.9,7.5,22.1359436,3.1622777,0.3162278,-31.3065488\n63.434949,9.8,7.3,8.9442719,4.472136,0.2236068,-22.137073\n135,9.7,9.3,7.0710678,7.0710678,0.1414214,-14.0007143\n270,9.7,9.5,0,10,0.2,-9.8\n45,9.6,9.4,7.0710678,7.0710678,0.1414214,-14.0007143\n0,7.7,9.6,0,10,0.2,-9.8\n270,7.2,9.4,0,10,0.2,-9.8\n26.565051,7,9.3,13.4164079,4.472136,0.2236068,-22.137073\n0,9.50621,9.4965,0,10,0,-10\n0,9.74569,7.67586,0,10,0,-10\n0,9.63792,6.11833,0,10,0,-10\n0,9.738,4.37033,0,10,0,-10\n0,9.63022,2.81279,0,10,0,-10\n0,9.7303,1.06479,0,10,0,-10\n0,9.70684,8.00076,0,10,0,-10\n0,9.52225,5.63173,0,10,0,-10\n0,9.88807,2.91205,0,10,0,-10\n0,8.06768,9.52227,0,10,0,-10\n0,7.07904,9.39211,0,10,0,-10\n0,9.68306,8.79577,0,10,0,-10\n0,9.98498,7.89635,0,10,0,-10\n0,9.57343,5.02467,0,10,0,-10\n0,9.5402,4.08112,0,10,0,-10\n0,9.84213,3.18171,0,10,0,-10\n0,9.43058,0.31003,0,10,0,-10\n243.434949,7.8,9.8,8.9442719,4.472136,0.2236068,-22.137073\n116.565051,7.9,9.6,13.4164079,4.472136,0.2236068,-22.137073\n180,6,9.7,0,10,0.2,-9.8\n270,6,9.9,0,10,0.2,-9.8\n45,5.8,9.7,7.0710678,7.0710678,0.2828427,-13.8592929\n296.565051,4.1,10,13.4164079,4.472136,0.2236068,-22.137073\n63.434949,4,9.8,8.9442719,4.472136,0.2236068,-22.137073\n180,4.2,9.8,0,10,0.2,-9.8\n135,3.4,9.4,7.0710678,7.0710678,0.1414214,-14.0007143\n243.434949,3.5,9.6,8.9442719,4.472136,0.2236068,-22.137073\n26.565051,3.3,9.5,13.4164079,4.472136,0.2236068,-22.137073\n116.565051,3.1,9.3,13.4164079,4.472136,0.2236068,-22.137073\n225,3,9.5,7.0710678,7.0710678,0.2828427,-13.8592929\n45,0,9.7,7.0710678,7.0710678,0.2828427,-13.8592929\n161.565051,0.3,9.6,9.486833,3.1622777,0.3162278,-31.3065488\n288.434949,0.2,9.9,22.1359436,3.1622777,0.3162278,-31.3065488\n0,3.66398,9.93614,0,10,0,-10\n0,2.14162,9.67482,0,10,0,-10\n0,0.61927,9.41351,0,10,0,-10\n0,6.87779,9.80307,0,10,0,-10\n0,5.4843,9.86194,0,10,0,-10\n0,2.69731,9.9797,0,10,0,-10\n0,4.47502,9.98845,0,10,0,-10\n0,3.82153,9.90242,0,10,0,-10\n0,2.17293,9.68537,0,10,0,-10\n0,1.18429,9.55522,0,10,0,-10\n0,0.5308,9.46918,0,10,0,-10\n0,1.28632,9.77499,0,10,0,-10\n0,2.6266,9.95879,0,10,0,-10\n0,5.2692,9.45264,0,10,0,-10\n0,6.60948,9.63644,0,10,0,-10\n0,7.92801,9.80355,0,10,0,-10\n0,9.66478,9.68531,0,10,0,-10\n0,8.27128,9.74419,0,10,0,-10\n0,9.71629,9.73931,0,10,0,-10\n0,9.28383,9.99927,0,10,0,-10\n"),!1),N(O.ParsePatFile("\n*AR-CONC,AR-CONC\n50, 0,0, 4.12975034,-5.89789472, .75,-8.25\n355, 0,0, -2.03781207,7.3723684, .6,-6.6\n100.4514, .5977168,-.0522934, 5.7305871,-6.9397673, .6374019,-7.01142112\n46.1842, 0,2, 6.19462551,-8.84684208, 1.125,-12.375\n96.6356, .88936745,1.86206693, 8.59588071,-10.40965104, .95610288,-10.51713\n351.1842, 0,2, 7.74328189,11.0585526, .9,-9.9\n21, 1,1.5, 4.12975034,-5.89789472, .75,-8.25\n326, 1,1.5, -2.03781207,7.3723684, .6,-6.6\n71.4514, 1.49742233,1.16448394, 5.7305871,-6.9397673, .6374019,-7.01142112\n37.5, 0,0, 2.123,2.567, 0,-6.52,0,-6.7,0,-6.625\n7.5, 0,0, 3.123,3.567, 0,-3.82,0,-6.37,0,-2.525\n-32.5, -2.23,0, 4.6234,2.678, 0,-2.5,0,-7.8,0,-10.35\n-42.5, -3.23,0, 3.6234,4.678, 0,-3.25,0,-5.18,0,-7.35\n"),!1),N(O.ParsePatFile("\n*AR-HBONE,AR-HBONE\n45, 0,0, 4,4, 12,-4\n135, 2.82842713,2.82842713, 4,-4, 12,-4\n"),!1),N(O.ParsePatFile("\n*AR-PARQ1,AR-PARQ1\n90, 0,0, 12,12, 12,-12\n90, 2,0, 12,12, 12,-12\n90, 4,0, 12,12, 12,-12\n90, 6,0, 12,12, 12,-12\n90, 8,0, 12,12, 12,-12\n90, 10,0, 12,12, 12,-12\n90, 12,0, 12,12, 12,-12\n0, 0,12, 12,-12, 12,-12\n0, 0,14, 12,-12, 12,-12\n0, 0,16, 12,-12, 12,-12\n0, 0,18, 12,-12, 12,-12\n0, 0,20, 12,-12, 12,-12\n0, 0,22, 12,-12, 12,-12\n0, 0,24, 12,-12, 12,-12\n"),!1),N(O.ParsePatFile("\n*AR-RROOF,AR-RROOF\n0, 0,0, 2.2,1, 15,-2,5,-1\n0, 1.33,.5, -1,1.33, 3,-.33,6,-.75\n0, .5,.85, 5.2,.67, 8,-1.4,4,-1\n"),!1),N(O.ParsePatFile("\n*AR-RSHKE,AR-RSHKE\n0, 0,0, 25.5,12, 6,-5,7,-3,9,-4\n0, 6,.5, 25.5,12, 5,-19,4,-6\n0, 18,-.75, 25.5,12, 3,-31\n90, 0,0, 12,8.5, 11.5,-36.5\n90, 6,0, 12,8.5, 11.25,-36.75\n90, 11,0, 12,8.5, 10.5,-37.5\n90, 18,-.75, 12,8.5, 11.5,-36.5\n90, 21,-.75, 12,8.5, 11.5,-36.5\n90, 30,0, 12,8.5, 11,-37\n"),!1),N(O.ParsePatFile("\n*AR-SAND,AR-SAND\n37.5, 0,0, 1.123,1.567, 0,-1.52,0,-1.7,0,-1.625\n7.5, 0,0, 2.123,2.567, 0,-.82,0,-1.37,0,-.525\n-32.5, -1.23,0, 2.6234,1.678, 0,-.5,0,-1.8,0,-2.35\n-42.5, -1.23,0, 1.6234,2.678, 0,-.25,0,-1.18,0,-1.35\n"),!1),N(O.ParsePatFile("\n*BARBWIRE,BARBWIRE\n;By John Hyslop\n;Developed in inch as imperial QCAD3 pattern\n315,0.3,0.56,0.70710678,0.70710678,0.01414214,-1.40007143\n288.434949,0.26,0.68,2.21359436,0.31622777,0.12649111,-3.03578655\n158.198591,0.31,0.66,3.15682075,0.18569534,0.05385165,-5.33131316\n116.565051,0.32,0.64,1.34164079,0.4472136,0.02236068,-2.2137073\n116.565051,0.34,0.6,1.34164079,0.4472136,0.04472136,-2.19134662\n111.801409,0.44,0.39,2.22834406,0.18569534,0.05385165,-5.33131316\n156.801409,0.51,0.36,5.38356375,0.13130643,0.07615773,-7.53961537\n289.653824,0.46,0.5,11.70450662,0.06726728,0.14866069,-14.71740806\n194.036243,0.31,0.36,3.15296313,0.24253563,0.04123106,-4.08187457\n251.565051,0.32,0.39,0.9486833,0.31622777,0.03162278,-3.13065488\n254.054604,0.34,0.46,4.12081692,0.13736056,0.0728011,-7.20730879\n74.744881,0.34,0.46,4.12217269,0.0877058,0.11401754,-11.28773671\n135,0.36,0.44,0.70710678,0.70710678,0.02828427,-1.38592929\n180,0.39,0.44,0,1,0.03,-0.97\n270,0.39,0.45,0,1,0.01,-0.99\n74.054604,0.39,0.45,4.12081692,0.13736056,0.1456022,-7.13450769\n161.565051,0.42,0.44,0.9486833,0.31622777,0.03162278,-3.13065488\n198.434949,0.45,0.45,2.21359436,0.31622777,0.03162278,-3.13065488\n258.231711,0.5,0.69,5.09885635,0.04079085,0.24515301,-24.27014833\n21.801409,0.45,0.67,2.22834406,0.18569534,0.05385165,-5.33131316\n75.963757,0.43,0.59,0.9701425,0.24253563,0.08246211,-4.04064351\n341.565051,0.4,0.6,0.9486833,0.31622777,0.03162278,-3.13065488\n45,0.37,0.57,0.70710678,0.70710678,0.04242641,-1.37178716\n288.434949,0.36,0.6,2.21359436,0.31622777,0.03162278,-3.13065488\n0,0.34,0.6,0,1,0.02,-0.98\n26.565051,0.32,0.59,1.34164079,0.4472136,0.02236068,-2.2137073\n78.231711,0.27,0.35,5.09885635,0.04079085,0.24515301,-24.27014833\n4.085617,0.78,0.48,13.03821015,0.07124705,0.14035669,-13.89531216\n0,0.69,0.48,0,1,0.09,-0.91\n354.289407,0.59,0.49,0.99503719,0.09950372,0.10049876,-9.94937686\n356.185925,0.47,0.55,0.99778516,0.06651901,0.15033296,-14.88296341\n351.469234,0.8,0.55,7.07089492,0.04944682,0.20223748,-20.02151093\n0,0.66,0.55,0,1,0.14,-0.86\n14.036243,0.46,0.5,3.15296313,0.24253563,0.20615528,-3.91695034\n189.865807,0.7,0.51,17.26262336,0.04283529,0.23345235,-23.11178271\n180,0.8,0.51,0,1,0.1,-0.9\n171.469234,1,0.48,7.07089492,0.04944682,0.20223748,-20.02151093\n186.115504,1,0.56,9.05531551,0.03551104,0.15644586,-28.00380982\n5.52754,0.13777778,0.53333333,10.04982433,0.03210806,0.17302679,-30.97179621\n3.691386,0,0.48,15.03326191,0.03219114,0.1515339,-30.91291524\n348.310631,0,0.52,5.0989077,0.0337676,0.29614186,-29.31804393\n348.690068,0,0.56,0.98058068,0.19611614,0.30594117,-4.79307834\n"),!1),N(O.ParsePatFile("\n*BLOCKS-01,BLOCKS-01 verbose\n;By John Hyslop, Tile2Hatch tool \xa9 CVH 2020\n;Developed in inch as imperial QCAD3 pattern\n270,0.31,0.66,1,1,0.22,-0.78\n180,0.08,0.09,0,1,0.57,-0.43\n270,0.08,0.09,1,1,0.21,-0.79\n180,0.08,0.88,0,1,0.57,-0.43\n270,0.51,0.09,1,1,0.21,-0.79\n270,0.89,0.32,1,1,0.2,-0.8\n0,0.49,0.32,0,1,0.4,-0.6\n90,0.49,0.12,1,1,0.2,-0.8\n180,0.89,0.12,0,1,0.4,-0.6\n270,0.69,0.84,1,1,0.48,-0.52\n0,0.48,0.84,0,1,0.21,-0.79\n90,0.48,0.36,1,1,0.48,-0.52\n180,0.69,0.36,0,1,0.21,-0.79\n270,0.12,0.03,1,1,0.33,-0.67\n0,0.12,0.7,0,1,0.32,-0.68\n270,0.44,0.03,1,1,0.33,-0.67\n0,0.12,0.03,0,1,0.32,-0.68\n270,0.45,0.67,1,1,0.24,-0.76\n0,0.36,0.67,0,1,0.09,-0.91\n90,0.36,0.43,1,1,0.24,-0.76\n180,0.45,0.43,0,1,0.09,-0.91\n270,0.45,0.4,1,1,0.33,-0.67\n0,0.11,0.4,0,1,0.34,-0.66\n90,0.11,0.07,1,1,0.33,-0.67\n180,0.45,0.07,0,1,0.34,-0.66\n270,0.89,0.41,1,1,0.06,-0.94\n0,0.73,0.41,0,1,0.16,-0.84\n90,0.73,0.35,1,1,0.06,-0.94\n180,0.89,0.35,0,1,0.16,-0.84\n180,0.07,0.4,0,1,0.14,-0.86\n270,0.93,0.4,1,1,0.27,-0.73\n180,0.07,0.13,0,1,0.14,-0.86\n270,0.07,0.4,1,1,0.27,-0.73\n180,0.08,0.81,0,1,0.34,-0.66\n270,0.74,0.81,1,1,0.1,-0.9\n180,0.08,0.71,0,1,0.34,-0.66\n270,0.08,0.81,1,1,0.1,-0.9\n180,0.31,0.66,0,1,0.59,-0.41\n270,0.72,0.66,1,1,0.22,-0.78\n180,0.31,0.44,0,1,0.59,-0.41\n"),!1),N(O.ParsePatFile("\n*BLOCKS-02,BLOCKS-02 verbose\n;By John Hyslop, Tile2Hatch tool \xa9 CVH 2020\n;Developed in inch as imperial QCAD3 pattern\n180,0.32,0.18,0,1,0.49,-0.51\n270,0.32,0.55,1,1,0.37,-0.63\n0,0.37,0.96,0,1,0.42,-0.58\n0,0.17,0.98,0,1,0.17,-0.83\n90,0.82,0,1,1,0.15,-0.85\n180,0.92,0,0,1,0.1,-0.9\n180,0.32,0.55,0,1,0.49,-0.51\n270,0.83,0.55,1,1,0.37,-0.63\n180,0.13,0.8,0,1,0.18,-0.82\n90,0.14,0.59,1,1,0.17,-0.83\n270,0.13,0.15,1,1,0.35,-0.65\n180,0.71,0.59,0,1,0.57,-0.43\n270,0.92,0.15,1,1,0.15,-0.85\n0,0.82,0.15,0,1,0.1,-0.9\n270,0.71,0.76,1,1,0.17,-0.83\n0,0.14,0.76,0,1,0.57,-0.43\n180,0.08,0.59,0,1,0.32,-0.68\n270,0.08,0.76,1,1,0.17,-0.83\n180,0.13,0.15,0,1,0.18,-0.82\n270,0.95,0.15,1,1,0.35,-0.65\n90,0.18,0.8,1,1,0.13,-0.87\n180,0.91,0.8,0,1,0.73,-0.27\n180,0.08,0.76,0,1,0.32,-0.68\n270,0.76,0.76,1,1,0.17,-0.83\n270,0.34,0.15,1,1,0.17,-0.83\n0,0.17,0.15,0,1,0.17,-0.83\n270,0.91,0.93,1,1,0.13,-0.87\n0,0.18,0.93,0,1,0.73,-0.27\n0,0.37,0.55,0,1,0.42,-0.58\n270,0.37,0.55,1,1,0.59,-0.41\n270,0.17,0.15,1,1,0.17,-0.83\n270,0.79,0.55,1,1,0.59,-0.41\n"),!1),N(O.ParsePatFile("\n*BOXJOIN-01,BOXJOIN-01 verbose\n;By John Hyslop, Tile2Hatch tool \xa9 CVH 2020\n;Developed in inch as imperial QCAD3 pattern\n90,0.15000001,0.15,1,1,0.7,-0.3\n0,0.15000001,0.85,0,1,0.7,-0.3\n270,0.45000001,0.15,1,1,0.3,-0.7\n180,0.15000001,0.45,0,1,0.3,-0.7\n270,0.55000001,0.15,1,1,0.3,-0.7\n180,0.85000001,0.15,0,1,0.7,-0.3\n270,0.85000001,0.85,1,1,0.7,-0.3\n180,0.15000001,0.55,0,1,0.3,-0.7\n"),!1),N(O.ParsePatFile("\n*BOXJOIN-02,BOXJOIN-02 verbose\n;By John Hyslop, Tile2Hatch tool \xa9 CVH 2020\n;Developed in inch as imperial QCAD3 pattern\n90,0.15000001,0.55,1,1,0.3,-0.7\n270,0.85000001,0.85,1,1,0.3,-0.7\n0,0.55000001,0.85,0,1,0.3,-0.7\n180,0.15000001,0.55,0,1,0.3,-0.7\n90,0.15000001,0.15,1,1,0.3,-0.7\n180,0.45000001,0.15,0,1,0.3,-0.7\n180,0.15000001,0.45,0,1,0.3,-0.7\n180,0.85000001,0.15,0,1,0.3,-0.7\n270,0.85000001,0.45,1,1,0.3,-0.7\n270,0.45000001,0.15,1,1,0.3,-0.7\n270,0.55000001,0.15,1,1,0.3,-0.7\n0,0.15000001,0.85,0,1,0.3,-0.7\n"),!1),N(O.ParsePatFile("\n*BOX,BOX\n90, 0,0, 0,1\n90, .25,0, 0,1\n0, 0,0, 0,1, -.25,.25\n0, 0,.25, 0,1, -.25,.25\n0, 0,.5, 0,1, .25,-.25\n0, 0,.75, 0,1, .25,-.25\n90, .5,0, 0,1, .25,-.25\n90, .75,0, 0,1, .25,-.25\n"),!1),N(O.ParsePatFile("\n*BOX-OVERLAP,BOX-OVERLAP verbose\n;By John Hyslop, Tile2Hatch tool \xa9 CVH 2020\n;Developed in inch as imperial QCAD3 pattern\n180,0.2,0.7,0,1,0.4,-0.6\n90,0.2,0.2,1,1,0.6,-0.4\n270,0.3,0.2,1,1,0.4,-0.6\n180,0.2,0.3,0,1,0.4,-0.6\n0,0.2,0.8,0,1,0.6,-0.4\n180,0.8,0.2,0,1,0.6,-0.4\n270,0.8,0.8,1,1,0.6,-0.4\n270,0.7,0.2,1,1,0.4,-0.6\n"),!1),N(O.ParsePatFile("\n*BRASS,BRASS\n0, 0,0, 0,.25\n0, 0,.125, 0,.25, .125,-.0625\n"),!1),N(O.ParsePatFile("\n*BRICK,BRICK\n0, 0,0, 0,.25\n90, 0,0, 0,.5, .25,-.25\n90, .25,0, 0,.5, -.25,.25\n"),!1),N(O.ParsePatFile("\n*BRSTONE,BRSTONE\n0, 0,0, 0,.33\n90, .9,0, .33,.5, .33,-.33\n90, .8,0, .33,.5, .33,-.33\n0, .9,.055, .5,.33, -.9,.1\n0, .9,.11, .5,.33, -.9,.1\n0, .9,.165, .5,.33, -.9,.1\n0, .9,.22, .5,.33, -.9,.1\n0, .9,.275, .5,.33, -.9,.1\n"),!1),N(O.ParsePatFile("\n*BUBBLES-01,BUBBLES-01\n;By John Hyslop, Using AutoCAD Lisp Tool\n;Developed in inch as imperial QCAD3 pattern\n0,0.058964,0.016739,0,1,0,-1\n0,0.062236,0.033193,0,1,0,-1\n0,0.067629,0.049078,0,1,0,-1\n0,0.075048,0.064123,0,1,0,-1\n0,0.084368,0.078071,0,1,0,-1\n0,0.095429,0.090684,0,1,0,-1\n0,0.108041,0.101745,0,1,0,-1\n0,0.12199,0.111065,0,1,0,-1\n0,0.137035,0.118484,0,1,0,-1\n0,0.15292,0.123876,0,1,0,-1\n0,0.169373,0.127149,0,1,0,-1\n0,0.186113,0.128246,0,1,0,-1\n0,0.202852,0.127149,0,1,0,-1\n0,0.219305,0.123876,0,1,0,-1\n0,0.23519,0.118484,0,1,0,-1\n0,0.250236,0.111065,0,1,0,-1\n0,0.264184,0.101745,0,1,0,-1\n0,0.276796,0.090684,0,1,0,-1\n0,0.287857,0.078071,0,1,0,-1\n0,0.297177,0.064123,0,1,0,-1\n0,0.304597,0.049078,0,1,0,-1\n0,0.309989,0.033193,0,1,0,-1\n0,0.313262,0.016739,0,1,0,-1\n0,0.120008,0.220248,0,1,0,-1\n0,0.117478,0.203192,0,1,0,-1\n0,0.113288,0.186467,0,1,0,-1\n0,0.10748,0.170233,0,1,0,-1\n0,0.100108,0.154647,0,1,0,-1\n0,0.091244,0.139858,0,1,0,-1\n0,0.080973,0.126009,0,1,0,-1\n0,0.069394,0.113234,0,1,0,-1\n0,0.056618,0.101655,0,1,0,-1\n0,0.04277,0.091384,0,1,0,-1\n0,0.027981,0.08252,0,1,0,-1\n0,0.012394,0.075148,0,1,0,-1\n0,0.012394,0.39979,0,1,0,-1\n0,0.027981,0.392418,0,1,0,-1\n0,0.04277,0.383554,0,1,0,-1\n0,0.056618,0.373283,0,1,0,-1\n0,0.069394,0.361704,0,1,0,-1\n0,0.080973,0.348929,0,1,0,-1\n0,0.091244,0.33508,0,1,0,-1\n0,0.100108,0.320291,0,1,0,-1\n0,0.10748,0.304704,0,1,0,-1\n0,0.113288,0.28847,0,1,0,-1\n0,0.117478,0.271745,0,1,0,-1\n0,0.120008,0.25469,0,1,0,-1\n0,0.120854,0.237469,0,1,0,-1\n0,0.738076,0.372319,0,1,0,-1\n0,0.732613,0.356706,0,1,0,-1\n0,0.723812,0.3427,0,1,0,-1\n0,0.712116,0.331003,0,1,0,-1\n0,0.69811,0.322203,0,1,0,-1\n0,0.682497,0.316739,0,1,0,-1\n0,0.666059,0.314887,0,1,0,-1\n0,0.649622,0.316739,0,1,0,-1\n0,0.634009,0.322203,0,1,0,-1\n0,0.620003,0.331003,0,1,0,-1\n0,0.608306,0.3427,0,1,0,-1\n0,0.599506,0.356706,0,1,0,-1\n0,0.594042,0.372319,0,1,0,-1\n0,0.59219,0.388756,0,1,0,-1\n0,0.594042,0.405194,0,1,0,-1\n0,0.599506,0.420807,0,1,0,-1\n0,0.608306,0.434813,0,1,0,-1\n0,0.620003,0.44651,0,1,0,-1\n0,0.634009,0.45531,0,1,0,-1\n0,0.649622,0.460773,0,1,0,-1\n0,0.666059,0.462625,0,1,0,-1\n0,0.682497,0.460773,0,1,0,-1\n0,0.69811,0.45531,0,1,0,-1\n0,0.712116,0.44651,0,1,0,-1\n0,0.723812,0.434813,0,1,0,-1\n0,0.732613,0.420807,0,1,0,-1\n0,0.738076,0.405194,0,1,0,-1\n0,0.739928,0.388756,0,1,0,-1\n0,0.834916,0.831041,0,1,0,-1\n0,0.821448,0.840826,0,1,0,-1\n0,0.810309,0.853198,0,1,0,-1\n0,0.462763,0.750408,0,1,0,-1\n0,0.458683,0.734294,0,1,0,-1\n0,0.452005,0.71907,0,1,0,-1\n0,0.442913,0.705153,0,1,0,-1\n0,0.431654,0.692923,0,1,0,-1\n0,0.418536,0.682713,0,1,0,-1\n0,0.403916,0.674801,0,1,0,-1\n0,0.388193,0.669403,0,1,0,-1\n0,0.371796,0.666667,0,1,0,-1\n0,0.355172,0.666667,0,1,0,-1\n0,0.338776,0.669403,0,1,0,-1\n0,0.323053,0.674801,0,1,0,-1\n0,0.308433,0.682713,0,1,0,-1\n0,0.295314,0.692923,0,1,0,-1\n0,0.284056,0.705153,0,1,0,-1\n0,0.274963,0.71907,0,1,0,-1\n0,0.268286,0.734294,0,1,0,-1\n0,0.264205,0.750408,0,1,0,-1\n0,0.262832,0.766975,0,1,0,-1\n0,0.264205,0.783542,0,1,0,-1\n0,0.268286,0.799657,0,1,0,-1\n0,0.274963,0.81488,0,1,0,-1\n0,0.284056,0.828797,0,1,0,-1\n0,0.295314,0.841027,0,1,0,-1\n0,0.308433,0.851238,0,1,0,-1\n0,0.323053,0.85915,0,1,0,-1\n0,0.403916,0.85915,0,1,0,-1\n0,0.418536,0.851238,0,1,0,-1\n0,0.431654,0.841027,0,1,0,-1\n0,0.442913,0.828797,0,1,0,-1\n0,0.452005,0.81488,0,1,0,-1\n0,0.458683,0.799657,0,1,0,-1\n0,0.462763,0.783542,0,1,0,-1\n0,0.464136,0.766975,0,1,0,-1\n0,0.821196,0.648394,0,1,0,-1\n0,0.818556,0.631724,0,1,0,-1\n0,0.814188,0.615423,0,1,0,-1\n0,0.808139,0.599667,0,1,0,-1\n0,0.800477,0.584629,0,1,0,-1\n0,0.791286,0.570475,0,1,0,-1\n0,0.780665,0.557359,0,1,0,-1\n0,0.768731,0.545425,0,1,0,-1\n0,0.755615,0.534804,0,1,0,-1\n0,0.741461,0.525612,0,1,0,-1\n0,0.726423,0.51795,0,1,0,-1\n0,0.710667,0.511902,0,1,0,-1\n0,0.694365,0.507534,0,1,0,-1\n0,0.677696,0.504894,0,1,0,-1\n0,0.660842,0.504011,0,1,0,-1\n0,0.643989,0.504894,0,1,0,-1\n0,0.627319,0.507534,0,1,0,-1\n0,0.611018,0.511902,0,1,0,-1\n0,0.595262,0.51795,0,1,0,-1\n0,0.580224,0.525612,0,1,0,-1\n0,0.56607,0.534804,0,1,0,-1\n0,0.552954,0.545425,0,1,0,-1\n0,0.54102,0.557359,0,1,0,-1\n0,0.530399,0.570475,0,1,0,-1\n0,0.521207,0.584629,0,1,0,-1\n0,0.513545,0.599667,0,1,0,-1\n0,0.507497,0.615423,0,1,0,-1\n0,0.503129,0.631724,0,1,0,-1\n0,0.500489,0.648394,0,1,0,-1\n0,0.499606,0.665247,0,1,0,-1\n0,0.500489,0.682101,0,1,0,-1\n0,0.503129,0.69877,0,1,0,-1\n0,0.507497,0.715072,0,1,0,-1\n0,0.513545,0.730828,0,1,0,-1\n0,0.521207,0.745866,0,1,0,-1\n0,0.530399,0.76002,0,1,0,-1\n0,0.54102,0.773136,0,1,0,-1\n0,0.552954,0.785069,0,1,0,-1\n0,0.56607,0.795691,0,1,0,-1\n0,0.580224,0.804882,0,1,0,-1\n0,0.595262,0.812544,0,1,0,-1\n0,0.611018,0.818592,0,1,0,-1\n0,0.627319,0.822961,0,1,0,-1\n0,0.643989,0.825601,0,1,0,-1\n0,0.660842,0.826484,0,1,0,-1\n0,0.677696,0.825601,0,1,0,-1\n0,0.694365,0.822961,0,1,0,-1\n0,0.710667,0.818592,0,1,0,-1\n0,0.726423,0.812544,0,1,0,-1\n0,0.741461,0.804882,0,1,0,-1\n0,0.755615,0.795691,0,1,0,-1\n0,0.768731,0.785069,0,1,0,-1\n0,0.780665,0.773136,0,1,0,-1\n0,0.791286,0.76002,0,1,0,-1\n0,0.800477,0.745866,0,1,0,-1\n0,0.808139,0.730828,0,1,0,-1\n0,0.814188,0.715072,0,1,0,-1\n0,0.818556,0.69877,0,1,0,-1\n0,0.821196,0.682101,0,1,0,-1\n0,0.822079,0.665247,0,1,0,-1\n0,0.524311,0.381738,0,1,0,-1\n0,0.521577,0.364477,0,1,0,-1\n0,0.517054,0.347597,0,1,0,-1\n0,0.510791,0.331282,0,1,0,-1\n0,0.502858,0.315711,0,1,0,-1\n0,0.49334,0.301054,0,1,0,-1\n0,0.482342,0.287473,0,1,0,-1\n0,0.469984,0.275116,0,1,0,-1\n0,0.456403,0.264118,0,1,0,-1\n0,0.441747,0.2546,0,1,0,-1\n0,0.426175,0.246666,0,1,0,-1\n0,0.40986,0.240403,0,1,0,-1\n0,0.39298,0.23588,0,1,0,-1\n0,0.375719,0.233146,0,1,0,-1\n0,0.358267,0.232232,0,1,0,-1\n0,0.340816,0.233146,0,1,0,-1\n0,0.323555,0.23588,0,1,0,-1\n0,0.306674,0.240403,0,1,0,-1\n0,0.290359,0.246666,0,1,0,-1\n0,0.274788,0.2546,0,1,0,-1\n0,0.260132,0.264118,0,1,0,-1\n0,0.246551,0.275116,0,1,0,-1\n0,0.234193,0.287473,0,1,0,-1\n0,0.223195,0.301054,0,1,0,-1\n0,0.213677,0.315711,0,1,0,-1\n0,0.205743,0.331282,0,1,0,-1\n0,0.199481,0.347597,0,1,0,-1\n0,0.194958,0.364477,0,1,0,-1\n0,0.192224,0.381738,0,1,0,-1\n0,0.191309,0.39919,0,1,0,-1\n0,0.192224,0.416642,0,1,0,-1\n0,0.194958,0.433903,0,1,0,-1\n0,0.199481,0.450783,0,1,0,-1\n0,0.205743,0.467098,0,1,0,-1\n0,0.213677,0.482669,0,1,0,-1\n0,0.223195,0.497326,0,1,0,-1\n0,0.234193,0.510907,0,1,0,-1\n0,0.246551,0.523264,0,1,0,-1\n0,0.260132,0.534262,0,1,0,-1\n0,0.274788,0.54378,0,1,0,-1\n0,0.290359,0.551714,0,1,0,-1\n0,0.306674,0.557977,0,1,0,-1\n0,0.323555,0.5625,0,1,0,-1\n0,0.340816,0.565234,0,1,0,-1\n0,0.358267,0.566148,0,1,0,-1\n0,0.375719,0.565234,0,1,0,-1\n0,0.39298,0.5625,0,1,0,-1\n0,0.40986,0.557977,0,1,0,-1\n0,0.426175,0.551714,0,1,0,-1\n0,0.441747,0.54378,0,1,0,-1\n0,0.456403,0.534262,0,1,0,-1\n0,0.469984,0.523264,0,1,0,-1\n0,0.482342,0.510907,0,1,0,-1\n0,0.49334,0.497326,0,1,0,-1\n0,0.502858,0.482669,0,1,0,-1\n0,0.510791,0.467098,0,1,0,-1\n0,0.517054,0.450783,0,1,0,-1\n0,0.521577,0.433903,0,1,0,-1\n0,0.524311,0.416642,0,1,0,-1\n0,0.525226,0.39919,0,1,0,-1\n0,0.847548,0.091384,0,1,0,-1\n0,0.833699,0.101655,0,1,0,-1\n0,0.820923,0.113234,0,1,0,-1\n0,0.809345,0.126009,0,1,0,-1\n0,0.799074,0.139858,0,1,0,-1\n0,0.790209,0.154647,0,1,0,-1\n0,0.782838,0.170233,0,1,0,-1\n0,0.777029,0.186467,0,1,0,-1\n0,0.77284,0.203192,0,1,0,-1\n0,0.77031,0.220248,0,1,0,-1\n0,0.769464,0.237469,0,1,0,-1\n0,0.77031,0.25469,0,1,0,-1\n0,0.77284,0.271745,0,1,0,-1\n0,0.777029,0.28847,0,1,0,-1\n0,0.782838,0.304704,0,1,0,-1\n0,0.790209,0.320291,0,1,0,-1\n0,0.799074,0.33508,0,1,0,-1\n0,0.809345,0.348929,0,1,0,-1\n0,0.820923,0.361704,0,1,0,-1\n0,0.833699,0.373283,0,1,0,-1\n0,0.847548,0.383554,0,1,0,-1\n0,0.241252,0.63247,0,1,0,-1\n0,0.238633,0.614814,0,1,0,-1\n0,0.234297,0.5975,0,1,0,-1\n0,0.228283,0.580695,0,1,0,-1\n0,0.220652,0.56456,0,1,0,-1\n0,0.211476,0.54925,0,1,0,-1\n0,0.200843,0.534914,0,1,0,-1\n0,0.188857,0.521689,0,1,0,-1\n0,0.175632,0.509702,0,1,0,-1\n0,0.161296,0.49907,0,1,0,-1\n0,0.145986,0.489894,0,1,0,-1\n0,0.129851,0.482262,0,1,0,-1\n0,0.113046,0.476249,0,1,0,-1\n0,0.095732,0.471912,0,1,0,-1\n0,0.078076,0.469293,0,1,0,-1\n0,0.060249,0.468417,0,1,0,-1\n0,0.042421,0.469293,0,1,0,-1\n0,0.024766,0.471912,0,1,0,-1\n0,0.007452,0.476249,0,1,0,-1\n0,0.007452,0.824345,0,1,0,-1\n0,0.024766,0.828682,0,1,0,-1\n0,0.042421,0.831301,0,1,0,-1\n0,0.060249,0.832177,0,1,0,-1\n0,0.078076,0.831301,0,1,0,-1\n0,0.095732,0.828682,0,1,0,-1\n0,0.113046,0.824345,0,1,0,-1\n0,0.129851,0.818332,0,1,0,-1\n0,0.145986,0.8107,0,1,0,-1\n0,0.161296,0.801524,0,1,0,-1\n0,0.175632,0.790892,0,1,0,-1\n0,0.188857,0.778905,0,1,0,-1\n0,0.200843,0.76568,0,1,0,-1\n0,0.211476,0.751344,0,1,0,-1\n0,0.220652,0.736034,0,1,0,-1\n0,0.228283,0.719899,0,1,0,-1\n0,0.234297,0.703094,0,1,0,-1\n0,0.238633,0.68578,0,1,0,-1\n0,0.241252,0.668124,0,1,0,-1\n0,0.242128,0.650297,0,1,0,-1\n0,0.771442,0.048085,0,1,0,-1\n0,0.768672,0.029409,0,1,0,-1\n0,0.764084,0.011095,0,1,0,-1\n0,0.39588,0.011095,0,1,0,-1\n0,0.391292,0.029409,0,1,0,-1\n0,0.388522,0.048085,0,1,0,-1\n0,0.387595,0.066942,0,1,0,-1\n0,0.388522,0.085799,0,1,0,-1\n0,0.391292,0.104475,0,1,0,-1\n0,0.39588,0.122789,0,1,0,-1\n0,0.40224,0.140565,0,1,0,-1\n0,0.410312,0.157632,0,1,0,-1\n0,0.420018,0.173826,0,1,0,-1\n0,0.431265,0.18899,0,1,0,-1\n0,0.443944,0.20298,0,1,0,-1\n0,0.457933,0.215659,0,1,0,-1\n0,0.473098,0.226905,0,1,0,-1\n0,0.489292,0.236612,0,1,0,-1\n0,0.506359,0.244684,0,1,0,-1\n0,0.524135,0.251044,0,1,0,-1\n0,0.542449,0.255632,0,1,0,-1\n0,0.561125,0.258402,0,1,0,-1\n0,0.579982,0.259328,0,1,0,-1\n0,0.598839,0.258402,0,1,0,-1\n0,0.617515,0.255632,0,1,0,-1\n0,0.635829,0.251044,0,1,0,-1\n0,0.653605,0.244684,0,1,0,-1\n0,0.670672,0.236612,0,1,0,-1\n0,0.686866,0.226905,0,1,0,-1\n0,0.702031,0.215659,0,1,0,-1\n0,0.71602,0.20298,0,1,0,-1\n0,0.728699,0.18899,0,1,0,-1\n0,0.739945,0.173826,0,1,0,-1\n0,0.749652,0.157632,0,1,0,-1\n0,0.757724,0.140565,0,1,0,-1\n0,0.764084,0.122789,0,1,0,-1\n0,0.768672,0.104475,0,1,0,-1\n0,0.771442,0.085799,0,1,0,-1\n0,0.772368,0.066942,0,1,0,-1\n0,0.990646,0.482262,0,1,0,-1\n0,0.974511,0.489894,0,1,0,-1\n0,0.959202,0.49907,0,1,0,-1\n0,0.944866,0.509702,0,1,0,-1\n0,0.93164,0.521689,0,1,0,-1\n0,0.919654,0.534914,0,1,0,-1\n0,0.909021,0.54925,0,1,0,-1\n0,0.899845,0.56456,0,1,0,-1\n0,0.892214,0.580695,0,1,0,-1\n0,0.886201,0.5975,0,1,0,-1\n0,0.881864,0.614814,0,1,0,-1\n0,0.879245,0.63247,0,1,0,-1\n0,0.878369,0.650297,0,1,0,-1\n0,0.879245,0.668124,0,1,0,-1\n0,0.881864,0.68578,0,1,0,-1\n0,0.886201,0.703094,0,1,0,-1\n0,0.892214,0.719899,0,1,0,-1\n0,0.899845,0.736034,0,1,0,-1\n0,0.909021,0.751344,0,1,0,-1\n0,0.919654,0.76568,0,1,0,-1\n0,0.93164,0.778905,0,1,0,-1\n0,0.944866,0.790892,0,1,0,-1\n0,0.959202,0.801524,0,1,0,-1\n0,0.974511,0.8107,0,1,0,-1\n0,0.990646,0.818332,0,1,0,-1\n0,0.947478,0.867615,0,1,0,-1\n0,0.939155,0.853198,0,1,0,-1\n0,0.928015,0.840826,0,1,0,-1\n0,0.914547,0.831041,0,1,0,-1\n0,0.899339,0.82427,0,1,0,-1\n0,0.883055,0.820809,0,1,0,-1\n0,0.866408,0.820809,0,1,0,-1\n0,0.850124,0.82427,0,1,0,-1\n0,0.801985,0.867615,0,1,0,-1\n0,0.99616,0.069339,0,1,0,-1\n0,0.979435,0.06515,0,1,0,-1\n0,0.96238,0.06262,0,1,0,-1\n0,0.945159,0.061774,0,1,0,-1\n0,0.927938,0.06262,0,1,0,-1\n0,0.910882,0.06515,0,1,0,-1\n0,0.894157,0.069339,0,1,0,-1\n0,0.877923,0.075148,0,1,0,-1\n0,0.862337,0.08252,0,1,0,-1\n0,0.862337,0.392418,0,1,0,-1\n0,0.877923,0.39979,0,1,0,-1\n0,0.894157,0.405599,0,1,0,-1\n0,0.910882,0.409788,0,1,0,-1\n0,0.927938,0.412318,0,1,0,-1\n0,0.945159,0.413164,0,1,0,-1\n0,0.96238,0.412318,0,1,0,-1\n0,0.979435,0.409788,0,1,0,-1\n0,0.99616,0.405599,0,1,0,-1\n0,0.757724,0.993319,0,1,0,-1\n0,0.749652,0.976251,0,1,0,-1\n0,0.739945,0.960058,0,1,0,-1\n0,0.728699,0.944893,0,1,0,-1\n0,0.71602,0.930904,0,1,0,-1\n0,0.702031,0.918225,0,1,0,-1\n0,0.686866,0.906978,0,1,0,-1\n0,0.670672,0.897272,0,1,0,-1\n0,0.653605,0.8892,0,1,0,-1\n0,0.635829,0.882839,0,1,0,-1\n0,0.617515,0.878252,0,1,0,-1\n0,0.598839,0.875482,0,1,0,-1\n0,0.579982,0.874555,0,1,0,-1\n0,0.561125,0.875482,0,1,0,-1\n0,0.542449,0.878252,0,1,0,-1\n0,0.524135,0.882839,0,1,0,-1\n0,0.506359,0.8892,0,1,0,-1\n0,0.489292,0.897272,0,1,0,-1\n0,0.473098,0.906978,0,1,0,-1\n0,0.457933,0.918225,0,1,0,-1\n0,0.443944,0.930904,0,1,0,-1\n0,0.431265,0.944893,0,1,0,-1\n0,0.420018,0.960058,0,1,0,-1\n0,0.410312,0.976251,0,1,0,-1\n0,0.40224,0.993319,0,1,0,-1\n0,0.796841,0.883448,0,1,0,-1\n0,0.795101,0.900004,0,1,0,-1\n0,0.796841,0.91656,0,1,0,-1\n0,0.801985,0.932393,0,1,0,-1\n0,0.810309,0.94681,0,1,0,-1\n0,0.821448,0.959181,0,1,0,-1\n0,0.834916,0.968966,0,1,0,-1\n0,0.338776,0.864547,0,1,0,-1\n0,0.355172,0.867283,0,1,0,-1\n0,0.371796,0.867283,0,1,0,-1\n0,0.388193,0.864547,0,1,0,-1\n0,0.313262,0.983261,0,1,0,-1\n0,0.309989,0.966807,0,1,0,-1\n0,0.304597,0.950922,0,1,0,-1\n0,0.297177,0.935877,0,1,0,-1\n0,0.287857,0.921929,0,1,0,-1\n0,0.276796,0.909316,0,1,0,-1\n0,0.264184,0.898255,0,1,0,-1\n0,0.250236,0.888935,0,1,0,-1\n0,0.23519,0.881516,0,1,0,-1\n0,0.219305,0.876124,0,1,0,-1\n0,0.202852,0.872851,0,1,0,-1\n0,0.186113,0.871754,0,1,0,-1\n0,0.169373,0.872851,0,1,0,-1\n0,0.15292,0.876124,0,1,0,-1\n0,0.137035,0.881516,0,1,0,-1\n0,0.12199,0.888935,0,1,0,-1\n0,0.108041,0.898255,0,1,0,-1\n0,0.095429,0.909316,0,1,0,-1\n0,0.084368,0.921929,0,1,0,-1\n0,0.075048,0.935877,0,1,0,-1\n0,0.067629,0.950922,0,1,0,-1\n0,0.062236,0.966807,0,1,0,-1\n0,0.058964,0.983261,0,1,0,-1\n0,0.057866,1,0,1,0,-1\n0,0.314359,1,0,1,0,-1\n0,0.952623,0.883448,0,1,0,-1\n0,0.850124,0.975738,0,1,0,-1\n0,0.866408,0.979199,0,1,0,-1\n0,0.883055,0.979199,0,1,0,-1\n0,0.899339,0.975738,0,1,0,-1\n0,0.914547,0.968966,0,1,0,-1\n0,0.928015,0.959181,0,1,0,-1\n0,0.939155,0.94681,0,1,0,-1\n0,0.947478,0.932393,0,1,0,-1\n0,0.952623,0.91656,0,1,0,-1\n0,0.954363,0.900004,0,1,0,-1\n"),!1),N(O.ParsePatFile("\n*BUBBLES-02,BUBBLES-02\n;By John Hyslop, Using AutoCAD Lisp Tool\n;Developed in inch as imperial QCAD3 pattern\n0,0.01243,0.139689,0,1,0,-1\n0,0.004689,0.124495,0,1,0,-1\n0,0.004689,0.188567,0,1,0,-1\n0,0.01243,0.173373,0,1,0,-1\n0,0.015098,0.156531,0,1,0,-1\n0,0.039159,0.550628,0,1,0,-1\n0,0.03308,0.534599,0,1,0,-1\n0,0.023341,0.52049,0,1,0,-1\n0,0.010509,0.509122,0,1,0,-1\n0,0.010509,0.626172,0,1,0,-1\n0,0.023341,0.614804,0,1,0,-1\n0,0.03308,0.600695,0,1,0,-1\n0,0.039159,0.584666,0,1,0,-1\n0,0.041226,0.567647,0,1,0,-1\n0,0.012655,0.061217,0,1,0,-1\n0,0.029343,0.064052,0,1,0,-1\n0,0.046244,0.065001,0,1,0,-1\n0,0.063146,0.064052,0,1,0,-1\n0,0.079834,0.061217,0,1,0,-1\n0,0.0961,0.05653,0,1,0,-1\n0,0.11174,0.050052,0,1,0,-1\n0,0.126555,0.041864,0,1,0,-1\n0,0.140361,0.032069,0,1,0,-1\n0,0.152983,0.020789,0,1,0,-1\n0,0.164263,0.008167,0,1,0,-1\n0,0.211752,0.623376,0,1,0,-1\n0,0.203326,0.608782,0,1,0,-1\n0,0.190416,0.597949,0,1,0,-1\n0,0.17458,0.592185,0,1,0,-1\n0,0.157727,0.592185,0,1,0,-1\n0,0.141891,0.597949,0,1,0,-1\n0,0.128981,0.608782,0,1,0,-1\n0,0.120555,0.623376,0,1,0,-1\n0,0.117628,0.639973,0,1,0,-1\n0,0.120555,0.65657,0,1,0,-1\n0,0.128981,0.671164,0,1,0,-1\n0,0.141891,0.681997,0,1,0,-1\n0,0.157727,0.687761,0,1,0,-1\n0,0.17458,0.687761,0,1,0,-1\n0,0.190416,0.681997,0,1,0,-1\n0,0.203326,0.671164,0,1,0,-1\n0,0.211752,0.65657,0,1,0,-1\n0,0.214678,0.639973,0,1,0,-1\n0,0.063146,0.764048,0,1,0,-1\n0,0.046244,0.763099,0,1,0,-1\n0,0.029343,0.764048,0,1,0,-1\n0,0.3178,0.248563,0,1,0,-1\n0,0.314583,0.232388,0,1,0,-1\n0,0.309282,0.216771,0,1,0,-1\n0,0.301988,0.20198,0,1,0,-1\n0,0.292825,0.188268,0,1,0,-1\n0,0.281951,0.175868,0,1,0,-1\n0,0.269552,0.164994,0,1,0,-1\n0,0.255839,0.155832,0,1,0,-1\n0,0.241048,0.148538,0,1,0,-1\n0,0.225431,0.143237,0,1,0,-1\n0,0.209256,0.140019,0,1,0,-1\n0,0.1928,0.138941,0,1,0,-1\n0,0.176343,0.140019,0,1,0,-1\n0,0.160168,0.143237,0,1,0,-1\n0,0.144551,0.148538,0,1,0,-1\n0,0.12976,0.155832,0,1,0,-1\n0,0.116047,0.164994,0,1,0,-1\n0,0.103648,0.175868,0,1,0,-1\n0,0.092774,0.188268,0,1,0,-1\n0,0.083612,0.20198,0,1,0,-1\n0,0.076318,0.216771,0,1,0,-1\n0,0.071016,0.232388,0,1,0,-1\n0,0.067799,0.248563,0,1,0,-1\n0,0.06672,0.26502,0,1,0,-1\n0,0.067799,0.281477,0,1,0,-1\n0,0.071016,0.297652,0,1,0,-1\n0,0.076318,0.313268,0,1,0,-1\n0,0.083612,0.32806,0,1,0,-1\n0,0.092774,0.341772,0,1,0,-1\n0,0.103648,0.354171,0,1,0,-1\n0,0.116047,0.365045,0,1,0,-1\n0,0.12976,0.374208,0,1,0,-1\n0,0.144551,0.381502,0,1,0,-1\n0,0.160168,0.386803,0,1,0,-1\n0,0.176343,0.390021,0,1,0,-1\n0,0.1928,0.391099,0,1,0,-1\n0,0.209256,0.390021,0,1,0,-1\n0,0.225431,0.386803,0,1,0,-1\n0,0.241048,0.381502,0,1,0,-1\n0,0.255839,0.374208,0,1,0,-1\n0,0.269552,0.365045,0,1,0,-1\n0,0.281951,0.354171,0,1,0,-1\n0,0.292825,0.341772,0,1,0,-1\n0,0.301988,0.32806,0,1,0,-1\n0,0.309282,0.313268,0,1,0,-1\n0,0.314583,0.297652,0,1,0,-1\n0,0.3178,0.281477,0,1,0,-1\n0,0.318879,0.26502,0,1,0,-1\n0,0.710254,0.515012,0,1,0,-1\n0,0.707834,0.498698,0,1,0,-1\n0,0.703826,0.482701,0,1,0,-1\n0,0.69827,0.467173,0,1,0,-1\n0,0.691219,0.452264,0,1,0,-1\n0,0.682741,0.438119,0,1,0,-1\n0,0.672916,0.424872,0,1,0,-1\n0,0.661841,0.412653,0,1,0,-1\n0,0.649621,0.401577,0,1,0,-1\n0,0.636375,0.391753,0,1,0,-1\n0,0.622229,0.383274,0,1,0,-1\n0,0.607321,0.376223,0,1,0,-1\n0,0.591793,0.370667,0,1,0,-1\n0,0.575795,0.36666,0,1,0,-1\n0,0.559482,0.36424,0,1,0,-1\n0,0.54301,0.363431,0,1,0,-1\n0,0.526538,0.36424,0,1,0,-1\n0,0.510224,0.36666,0,1,0,-1\n0,0.494226,0.370667,0,1,0,-1\n0,0.478698,0.376223,0,1,0,-1\n0,0.46379,0.383274,0,1,0,-1\n0,0.449644,0.391753,0,1,0,-1\n0,0.436398,0.401577,0,1,0,-1\n0,0.424178,0.412653,0,1,0,-1\n0,0.413103,0.424872,0,1,0,-1\n0,0.403279,0.438119,0,1,0,-1\n0,0.3948,0.452264,0,1,0,-1\n0,0.387749,0.467173,0,1,0,-1\n0,0.382193,0.482701,0,1,0,-1\n0,0.378186,0.498698,0,1,0,-1\n0,0.375766,0.515012,0,1,0,-1\n0,0.374957,0.531484,0,1,0,-1\n0,0.375766,0.547956,0,1,0,-1\n0,0.378186,0.56427,0,1,0,-1\n0,0.382193,0.580267,0,1,0,-1\n0,0.387749,0.595795,0,1,0,-1\n0,0.3948,0.610704,0,1,0,-1\n0,0.403279,0.624849,0,1,0,-1\n0,0.413103,0.638096,0,1,0,-1\n0,0.424178,0.650315,0,1,0,-1\n0,0.436398,0.661391,0,1,0,-1\n0,0.449644,0.671215,0,1,0,-1\n0,0.46379,0.679694,0,1,0,-1\n0,0.478698,0.686745,0,1,0,-1\n0,0.494226,0.692301,0,1,0,-1\n0,0.510224,0.696308,0,1,0,-1\n0,0.526538,0.698728,0,1,0,-1\n0,0.54301,0.699537,0,1,0,-1\n0,0.559482,0.698728,0,1,0,-1\n0,0.575795,0.696308,0,1,0,-1\n0,0.591793,0.692301,0,1,0,-1\n0,0.607321,0.686745,0,1,0,-1\n0,0.622229,0.679694,0,1,0,-1\n0,0.636375,0.671215,0,1,0,-1\n0,0.649621,0.661391,0,1,0,-1\n0,0.661841,0.650315,0,1,0,-1\n0,0.672916,0.638096,0,1,0,-1\n0,0.682741,0.624849,0,1,0,-1\n0,0.691219,0.610704,0,1,0,-1\n0,0.69827,0.595795,0,1,0,-1\n0,0.703826,0.580267,0,1,0,-1\n0,0.707834,0.56427,0,1,0,-1\n0,0.710254,0.547956,0,1,0,-1\n0,0.711063,0.531484,0,1,0,-1\n0,0.353512,0.012986,0,1,0,-1\n0,0.351649,0.029516,0,1,0,-1\n0,0.351027,0.046139,0,1,0,-1\n0,0.351649,0.062761,0,1,0,-1\n0,0.353512,0.079291,0,1,0,-1\n0,0.356604,0.095635,0,1,0,-1\n0,0.360909,0.111703,0,1,0,-1\n0,0.366403,0.127404,0,1,0,-1\n0,0.373055,0.14265,0,1,0,-1\n0,0.380828,0.157356,0,1,0,-1\n0,0.389678,0.171441,0,1,0,-1\n0,0.399556,0.184825,0,1,0,-1\n0,0.410406,0.197433,0,1,0,-1\n0,0.422168,0.209196,0,1,0,-1\n0,0.434776,0.220046,0,1,0,-1\n0,0.44816,0.229924,0,1,0,-1\n0,0.462245,0.238774,0,1,0,-1\n0,0.476951,0.246546,0,1,0,-1\n0,0.492198,0.253198,0,1,0,-1\n0,0.507899,0.258692,0,1,0,-1\n0,0.523966,0.262997,0,1,0,-1\n0,0.54031,0.26609,0,1,0,-1\n0,0.55684,0.267952,0,1,0,-1\n0,0.573463,0.268574,0,1,0,-1\n0,0.590085,0.267952,0,1,0,-1\n0,0.606615,0.26609,0,1,0,-1\n0,0.622959,0.262997,0,1,0,-1\n0,0.639027,0.258692,0,1,0,-1\n0,0.654727,0.253198,0,1,0,-1\n0,0.669974,0.246546,0,1,0,-1\n0,0.68468,0.238774,0,1,0,-1\n0,0.698765,0.229924,0,1,0,-1\n0,0.712149,0.220046,0,1,0,-1\n0,0.724757,0.209196,0,1,0,-1\n0,0.736519,0.197433,0,1,0,-1\n0,0.74737,0.184825,0,1,0,-1\n0,0.757248,0.171441,0,1,0,-1\n0,0.766098,0.157356,0,1,0,-1\n0,0.77387,0.14265,0,1,0,-1\n0,0.780522,0.127404,0,1,0,-1\n0,0.928226,0.008167,0,1,0,-1\n0,0.939506,0.020789,0,1,0,-1\n0,0.952128,0.032069,0,1,0,-1\n0,0.965934,0.041864,0,1,0,-1\n0,0.980749,0.050052,0,1,0,-1\n0,0.996388,0.05653,0,1,0,-1\n0,0.992631,0.112437,0,1,0,-1\n0,0.977438,0.104696,0,1,0,-1\n0,0.960595,0.102028,0,1,0,-1\n0,0.943753,0.104696,0,1,0,-1\n0,0.928559,0.112437,0,1,0,-1\n0,0.916502,0.124495,0,1,0,-1\n0,0.90876,0.139689,0,1,0,-1\n0,0.906093,0.156531,0,1,0,-1\n0,0.90876,0.173373,0,1,0,-1\n0,0.916502,0.188567,0,1,0,-1\n0,0.928559,0.200625,0,1,0,-1\n0,0.943753,0.208366,0,1,0,-1\n0,0.960595,0.211034,0,1,0,-1\n0,0.977438,0.208366,0,1,0,-1\n0,0.992631,0.200625,0,1,0,-1\n0,0.995329,0.501155,0,1,0,-1\n0,0.978684,0.497052,0,1,0,-1\n0,0.96154,0.497052,0,1,0,-1\n0,0.944895,0.501155,0,1,0,-1\n0,0.929715,0.509122,0,1,0,-1\n0,0.916882,0.52049,0,1,0,-1\n0,0.907144,0.534599,0,1,0,-1\n0,0.901065,0.550628,0,1,0,-1\n0,0.898998,0.567647,0,1,0,-1\n0,0.901065,0.584666,0,1,0,-1\n0,0.907144,0.600695,0,1,0,-1\n0,0.916882,0.614804,0,1,0,-1\n0,0.929715,0.626172,0,1,0,-1\n0,0.944895,0.634139,0,1,0,-1\n0,0.96154,0.638242,0,1,0,-1\n0,0.978684,0.638242,0,1,0,-1\n0,0.995329,0.634139,0,1,0,-1\n0,0.795276,0.029516,0,1,0,-1\n0,0.793414,0.012986,0,1,0,-1\n0,0.786016,0.111703,0,1,0,-1\n0,0.790321,0.095635,0,1,0,-1\n0,0.793414,0.079291,0,1,0,-1\n0,0.795276,0.062761,0,1,0,-1\n0,0.795898,0.046139,0,1,0,-1\n0,0.790321,0.996642,0,1,0,-1\n0,0.786016,0.980575,0,1,0,-1\n0,0.780522,0.964874,0,1,0,-1\n0,0.77387,0.949628,0,1,0,-1\n0,0.766098,0.934921,0,1,0,-1\n0,0.757248,0.920836,0,1,0,-1\n0,0.74737,0.907452,0,1,0,-1\n0,0.736519,0.894844,0,1,0,-1\n0,0.724757,0.883082,0,1,0,-1\n0,0.712149,0.872232,0,1,0,-1\n0,0.698765,0.862354,0,1,0,-1\n0,0.68468,0.853504,0,1,0,-1\n0,0.669974,0.845731,0,1,0,-1\n0,0.654727,0.839079,0,1,0,-1\n0,0.639027,0.833585,0,1,0,-1\n0,0.622959,0.82928,0,1,0,-1\n0,0.606615,0.826188,0,1,0,-1\n0,0.590085,0.824325,0,1,0,-1\n0,0.573463,0.823703,0,1,0,-1\n0,0.55684,0.824325,0,1,0,-1\n0,0.54031,0.826188,0,1,0,-1\n0,0.523966,0.82928,0,1,0,-1\n0,0.507899,0.833585,0,1,0,-1\n0,0.492198,0.839079,0,1,0,-1\n0,0.476951,0.845731,0,1,0,-1\n0,0.462245,0.853504,0,1,0,-1\n0,0.44816,0.862354,0,1,0,-1\n0,0.434776,0.872232,0,1,0,-1\n0,0.422168,0.883082,0,1,0,-1\n0,0.410406,0.894844,0,1,0,-1\n0,0.399556,0.907452,0,1,0,-1\n0,0.389678,0.920836,0,1,0,-1\n0,0.380828,0.934921,0,1,0,-1\n0,0.373055,0.949628,0,1,0,-1\n0,0.366403,0.964874,0,1,0,-1\n0,0.360909,0.980575,0,1,0,-1\n0,0.356604,0.996642,0,1,0,-1\n0,0.196246,0.897149,0,1,0,-1\n0,0.193411,0.880461,0,1,0,-1\n0,0.188725,0.864194,0,1,0,-1\n0,0.182247,0.848555,0,1,0,-1\n0,0.174058,0.83374,0,1,0,-1\n0,0.164263,0.819934,0,1,0,-1\n0,0.152983,0.807312,0,1,0,-1\n0,0.140361,0.796032,0,1,0,-1\n0,0.126555,0.786236,0,1,0,-1\n0,0.11174,0.778048,0,1,0,-1\n0,0.0961,0.77157,0,1,0,-1\n0,0.079834,0.766884,0,1,0,-1\n0,0.012655,0.766884,0,1,0,-1\n0,0.174058,0.994361,0,1,0,-1\n0,0.182247,0.979545,0,1,0,-1\n0,0.188725,0.963906,0,1,0,-1\n0,0.193411,0.94764,0,1,0,-1\n0,0.196246,0.930951,0,1,0,-1\n0,0.197195,0.91405,0,1,0,-1\n0,0.996388,0.77157,0,1,0,-1\n0,0.980749,0.778048,0,1,0,-1\n0,0.965934,0.786236,0,1,0,-1\n0,0.952128,0.796032,0,1,0,-1\n0,0.939506,0.807312,0,1,0,-1\n0,0.928226,0.819934,0,1,0,-1\n0,0.918431,0.83374,0,1,0,-1\n0,0.910242,0.848555,0,1,0,-1\n0,0.903764,0.864194,0,1,0,-1\n0,0.899078,0.880461,0,1,0,-1\n0,0.896243,0.897149,0,1,0,-1\n0,0.895293,0.91405,0,1,0,-1\n0,0.896243,0.930951,0,1,0,-1\n0,0.899078,0.94764,0,1,0,-1\n0,0.903764,0.963906,0,1,0,-1\n0,0.910242,0.979545,0,1,0,-1\n0,0.918431,0.994361,0,1,0,-1\n"),!1),N(O.ParsePatFile("\n*BUBBLES-03,BUBBLES-03\n;By John Hyslop, Using AutoCAD Lisp Tool\n;Developed in inch as imperial QCAD3 pattern\n0,0.401131,0.163621,0,1,0,-1\n0,0.397069,0.144076,0,1,0,-1\n0,0.390384,0.125265,0,1,0,-1\n0,0.3812,0.107541,0,1,0,-1\n0,0.369688,0.091232,0,1,0,-1\n0,0.356062,0.076642,0,1,0,-1\n0,0.340577,0.064044,0,1,0,-1\n0,0.32352,0.053672,0,1,0,-1\n0,0.30521,0.045718,0,1,0,-1\n0,0.285988,0.040333,0,1,0,-1\n0,0.266211,0.037614,0,1,0,-1\n0,0.246248,0.037614,0,1,0,-1\n0,0.226471,0.040333,0,1,0,-1\n0,0.207249,0.045718,0,1,0,-1\n0,0.188938,0.053672,0,1,0,-1\n0,0.171882,0.064044,0,1,0,-1\n0,0.156397,0.076642,0,1,0,-1\n0,0.142771,0.091232,0,1,0,-1\n0,0.131259,0.107541,0,1,0,-1\n0,0.122075,0.125265,0,1,0,-1\n0,0.115389,0.144076,0,1,0,-1\n0,0.111328,0.163621,0,1,0,-1\n0,0.109966,0.183537,0,1,0,-1\n0,0.111328,0.203453,0,1,0,-1\n0,0.115389,0.222999,0,1,0,-1\n0,0.122075,0.241809,0,1,0,-1\n0,0.131259,0.259533,0,1,0,-1\n0,0.142771,0.275842,0,1,0,-1\n0,0.156397,0.290432,0,1,0,-1\n0,0.171882,0.30303,0,1,0,-1\n0,0.188938,0.313403,0,1,0,-1\n0,0.207249,0.321356,0,1,0,-1\n0,0.226471,0.326742,0,1,0,-1\n0,0.246248,0.32946,0,1,0,-1\n0,0.266211,0.32946,0,1,0,-1\n0,0.285988,0.326742,0,1,0,-1\n0,0.30521,0.321356,0,1,0,-1\n0,0.32352,0.313403,0,1,0,-1\n0,0.340577,0.30303,0,1,0,-1\n0,0.356062,0.290432,0,1,0,-1\n0,0.369688,0.275842,0,1,0,-1\n0,0.3812,0.259533,0,1,0,-1\n0,0.390384,0.241809,0,1,0,-1\n0,0.397069,0.222999,0,1,0,-1\n0,0.401131,0.203453,0,1,0,-1\n0,0.402493,0.183537,0,1,0,-1\n0,0.717102,0.580347,0,1,0,-1\n0,0.69634,0.588567,0,1,0,-1\n0,0.676773,0.599325,0,1,0,-1\n0,0.658707,0.61245,0,1,0,-1\n0,0.64243,0.627736,0,1,0,-1\n0,0.628196,0.644941,0,1,0,-1\n0,0.616231,0.663795,0,1,0,-1\n0,0.606724,0.684,0,1,0,-1\n0,0.599823,0.705237,0,1,0,-1\n0,0.595639,0.727171,0,1,0,-1\n0,0.594237,0.749457,0,1,0,-1\n0,0.595639,0.771743,0,1,0,-1\n0,0.599823,0.793677,0,1,0,-1\n0,0.606724,0.814914,0,1,0,-1\n0,0.713243,0.02088,0,1,0,-1\n0,0.688246,0.022108,0,1,0,-1\n0,0.663491,0.02578,0,1,0,-1\n0,0.639215,0.031861,0,1,0,-1\n0,0.615651,0.040292,0,1,0,-1\n0,0.593028,0.050992,0,1,0,-1\n0,0.571562,0.063858,0,1,0,-1\n0,0.551461,0.078766,0,1,0,-1\n0,0.532918,0.095573,0,1,0,-1\n0,0.516111,0.114116,0,1,0,-1\n0,0.501203,0.134218,0,1,0,-1\n0,0.488337,0.155683,0,1,0,-1\n0,0.477637,0.178307,0,1,0,-1\n0,0.469206,0.20187,0,1,0,-1\n0,0.463125,0.226146,0,1,0,-1\n0,0.459453,0.250902,0,1,0,-1\n0,0.458225,0.275898,0,1,0,-1\n0,0.459453,0.300894,0,1,0,-1\n0,0.463125,0.325649,0,1,0,-1\n0,0.469206,0.349926,0,1,0,-1\n0,0.477637,0.373489,0,1,0,-1\n0,0.488337,0.396113,0,1,0,-1\n0,0.501203,0.417578,0,1,0,-1\n0,0.516111,0.43768,0,1,0,-1\n0,0.532918,0.456223,0,1,0,-1\n0,0.551461,0.473029,0,1,0,-1\n0,0.571562,0.487938,0,1,0,-1\n0,0.593028,0.500804,0,1,0,-1\n0,0.615651,0.511504,0,1,0,-1\n0,0.639215,0.519935,0,1,0,-1\n0,0.663491,0.526016,0,1,0,-1\n0,0.688246,0.529688,0,1,0,-1\n0,0.713243,0.530916,0,1,0,-1\n0,0.563094,0.659436,0,1,0,-1\n0,0.558843,0.630776,0,1,0,-1\n0,0.551803,0.602671,0,1,0,-1\n0,0.542042,0.575392,0,1,0,-1\n0,0.529655,0.5492,0,1,0,-1\n0,0.514759,0.524349,0,1,0,-1\n0,0.4975,0.501077,0,1,0,-1\n0,0.478043,0.479609,0,1,0,-1\n0,0.456575,0.460152,0,1,0,-1\n0,0.433303,0.442893,0,1,0,-1\n0,0.408452,0.427998,0,1,0,-1\n0,0.382261,0.41561,0,1,0,-1\n0,0.354981,0.405849,0,1,0,-1\n0,0.326876,0.398809,0,1,0,-1\n0,0.298216,0.394558,0,1,0,-1\n0,0.269278,0.393136,0,1,0,-1\n0,0.240339,0.394558,0,1,0,-1\n0,0.21168,0.398809,0,1,0,-1\n0,0.183575,0.405849,0,1,0,-1\n0,0.156295,0.41561,0,1,0,-1\n0,0.130104,0.427998,0,1,0,-1\n0,0.105252,0.442893,0,1,0,-1\n0,0.081981,0.460152,0,1,0,-1\n0,0.060513,0.479609,0,1,0,-1\n0,0.041056,0.501077,0,1,0,-1\n0,0.023796,0.524349,0,1,0,-1\n0,0.008901,0.5492,0,1,0,-1\n0,0.542042,0.801357,0,1,0,-1\n0,0.551803,0.774077,0,1,0,-1\n0,0.558843,0.745972,0,1,0,-1\n0,0.563094,0.717313,0,1,0,-1\n0,0.564516,0.688374,0,1,0,-1\n0,0.996513,0.575392,0,1,0,-1\n0,0.986753,0.602671,0,1,0,-1\n0,0.979713,0.630776,0,1,0,-1\n0,0.975461,0.659436,0,1,0,-1\n0,0.97404,0.688374,0,1,0,-1\n0,0.975461,0.717313,0,1,0,-1\n0,0.979713,0.745972,0,1,0,-1\n0,0.986753,0.774077,0,1,0,-1\n0,0.996513,0.801357,0,1,0,-1\n0,0.94846,0.727171,0,1,0,-1\n0,0.944275,0.705237,0,1,0,-1\n0,0.937375,0.684,0,1,0,-1\n0,0.927868,0.663795,0,1,0,-1\n0,0.915903,0.644941,0,1,0,-1\n0,0.901669,0.627736,0,1,0,-1\n0,0.885391,0.61245,0,1,0,-1\n0,0.867326,0.599325,0,1,0,-1\n0,0.847758,0.588567,0,1,0,-1\n0,0.826996,0.580347,0,1,0,-1\n0,0.805368,0.574794,0,1,0,-1\n0,0.783214,0.571995,0,1,0,-1\n0,0.760884,0.571995,0,1,0,-1\n0,0.738731,0.574794,0,1,0,-1\n0,0.616231,0.835119,0,1,0,-1\n0,0.628196,0.853972,0,1,0,-1\n0,0.64243,0.871178,0,1,0,-1\n0,0.658707,0.886464,0,1,0,-1\n0,0.676773,0.899589,0,1,0,-1\n0,0.69634,0.910346,0,1,0,-1\n0,0.717102,0.918566,0,1,0,-1\n0,0.738731,0.92412,0,1,0,-1\n0,0.760884,0.926918,0,1,0,-1\n0,0.783214,0.926918,0,1,0,-1\n0,0.805368,0.92412,0,1,0,-1\n0,0.826996,0.918566,0,1,0,-1\n0,0.847758,0.910346,0,1,0,-1\n0,0.867326,0.899589,0,1,0,-1\n0,0.885391,0.886464,0,1,0,-1\n0,0.901669,0.871178,0,1,0,-1\n0,0.915903,0.853972,0,1,0,-1\n0,0.927868,0.835119,0,1,0,-1\n0,0.937375,0.814914,0,1,0,-1\n0,0.944275,0.793677,0,1,0,-1\n0,0.94846,0.771743,0,1,0,-1\n0,0.949862,0.749457,0,1,0,-1\n0,0.967032,0.250902,0,1,0,-1\n0,0.96336,0.226146,0,1,0,-1\n0,0.957279,0.20187,0,1,0,-1\n0,0.948848,0.178307,0,1,0,-1\n0,0.938148,0.155683,0,1,0,-1\n0,0.925282,0.134218,0,1,0,-1\n0,0.910374,0.114116,0,1,0,-1\n0,0.893567,0.095573,0,1,0,-1\n0,0.875024,0.078766,0,1,0,-1\n0,0.854923,0.063858,0,1,0,-1\n0,0.833457,0.050992,0,1,0,-1\n0,0.810834,0.040292,0,1,0,-1\n0,0.78727,0.031861,0,1,0,-1\n0,0.762994,0.02578,0,1,0,-1\n0,0.738239,0.022108,0,1,0,-1\n0,0.738239,0.529688,0,1,0,-1\n0,0.762994,0.526016,0,1,0,-1\n0,0.78727,0.519935,0,1,0,-1\n0,0.810834,0.511504,0,1,0,-1\n0,0.833457,0.500804,0,1,0,-1\n0,0.854923,0.487938,0,1,0,-1\n0,0.875024,0.473029,0,1,0,-1\n0,0.893567,0.456223,0,1,0,-1\n0,0.910374,0.43768,0,1,0,-1\n0,0.925282,0.417578,0,1,0,-1\n0,0.938148,0.396113,0,1,0,-1\n0,0.948848,0.373489,0,1,0,-1\n0,0.957279,0.349926,0,1,0,-1\n0,0.96336,0.325649,0,1,0,-1\n0,0.967032,0.300894,0,1,0,-1\n0,0.96826,0.275898,0,1,0,-1\n0,0.4975,0.875671,0,1,0,-1\n0,0.514759,0.8524,0,1,0,-1\n0,0.529655,0.827549,0,1,0,-1\n0,0.008901,0.827549,0,1,0,-1\n0,0.023796,0.8524,0,1,0,-1\n0,0.041056,0.875671,0,1,0,-1\n0,0.060513,0.897139,0,1,0,-1\n0,0.081981,0.916597,0,1,0,-1\n0,0.105252,0.933856,0,1,0,-1\n0,0.130104,0.948751,0,1,0,-1\n0,0.156295,0.961139,0,1,0,-1\n0,0.183575,0.9709,0,1,0,-1\n0,0.21168,0.97794,0,1,0,-1\n0,0.240339,0.982191,0,1,0,-1\n0,0.269278,0.983612,0,1,0,-1\n0,0.298216,0.982191,0,1,0,-1\n0,0.326876,0.97794,0,1,0,-1\n0,0.354981,0.9709,0,1,0,-1\n0,0.382261,0.961139,0,1,0,-1\n0,0.408452,0.948751,0,1,0,-1\n0,0.433303,0.933856,0,1,0,-1\n0,0.456575,0.916597,0,1,0,-1\n0,0.478043,0.897139,0,1,0,-1\n"),!1),N(O.ParsePatFile("\n*CELTIC-01,CELTIC PATTERN 01\n;By John Hyslop\n;Developed in inch as imperial QCAD3 pattern\n135,0.36,0.42222222,0.70710678,0.70710678,0.08799551,-1.32621805\n135,0.42222222,0.39111111,0.70710678,0.70710678,0.25848681,-1.15572675\n315,0.39111111,0.57777778,0.70710678,0.70710678,0.08799551,-1.32621805\n315,0.30166667,0.63611111,0.70710678,0.70710678,0.25848681,-1.15572675\n225,0.76055556,0.42611111,0.70710678,0.70710678,0.08799551,-1.32621805\n225,0.86555556,0.5,0.70710678,0.70710678,0.28048569,-1.13372787\n225,0.85388889,0.33277778,0.70710678,0.70710678,0.08799551,-1.32621805\n225,0.99,0.5,0.70710678,0.70710678,0.3684812,-1.04573236\n225,0.76055556,0.72944444,0.70710678,0.70710678,0.08799551,-1.32621805\n225,0.85388889,0.63611111,0.70710678,0.70710678,0.08799551,-1.32621805\n90,0.99,0.90200449,0,1,0.08799551,-0.91200449\n0,0.90200449,0.88000561,0,1,0.08799551,-0.91200449\n0,0.83978227,0.90200449,0,1,0.15021773,-0.84978227\n0,0.80333333,0.99,0,1,0.18666667,-0.81333333\n90,0.90200449,0.83978227,0,1,0.04022334,-0.95977666\n90,0.99,0.80333333,0,1,0.07667228,-0.92332772\n180,0.09799551,0.99,0,1,0.08799551,-0.91200449\n90,0.11999439,0.90200449,0,1,0.08799551,-0.91200449\n90,0.09799551,0.83978227,0,1,0.15021773,-0.84978227\n90,0.01,0.80333333,0,1,0.18666667,-0.81333333\n180,0.16021773,0.90200449,0,1,0.04022334,-0.95977666\n180,0.19666667,0.99,0,1,0.07667228,-0.92332772\n270,0.01,0.09799551,0,1,0.08799551,-0.91200449\n180,0.09799551,0.11999439,0,1,0.08799551,-0.91200449\n180,0.16021773,0.09799551,0,1,0.15021773,-0.84978227\n180,0.19666667,0.01,0,1,0.18666667,-0.81333333\n270,0.09799551,0.16021773,0,1,0.04022334,-0.95977666\n270,0.01,0.19666667,0,1,0.07667228,-0.92332772\n45,0.70222222,0.51555556,0.70710678,0.70710678,0.40697924,-1.00723433\n45,0.51555556,0.29777778,0.70710678,0.70710678,0.08799551,-1.32621805\n45,0.42611111,0.23944444,0.70710678,0.70710678,0.25848681,-1.15572675\n45,0.19666667,0.01,0.70710678,0.70710678,0.19249018,-1.22172338\n45,0.64,0.57777778,0.70710678,0.70710678,0.3705303,-1.04368326\n45,0.42222222,0.39111111,0.70710678,0.70710678,0.08799551,-1.32621805\n45,0.36388889,0.30166667,0.70710678,0.70710678,0.25848681,-1.15572675\n45,0.16021773,0.09799551,0.70710678,0.70710678,0.15604125,-1.25817232\n45,0.66722222,0.85388889,0.70710678,0.70710678,0.19249018,-1.22172338\n45,0.42222222,0.64,0.70710678,0.70710678,0.08799551,-1.32621805\n45,0.14611111,0.36388889,0.70710678,0.70710678,0.08799551,-1.32621805\n45,0.39111111,0.57777778,0.70710678,0.70710678,0.25848681,-1.15572675\n45,0.01,0.19666667,0.70710678,0.70710678,0.40697924,-1.00723433\n45,0.72944444,0.79166667,0.70710678,0.70710678,0.15604125,-1.25817232\n45,0.23944444,0.27055556,0.70710678,0.70710678,0.08799551,-1.32621805\n45,0.51555556,0.54666667,0.70710678,0.70710678,0.08799551,-1.32621805\n45,0.45333333,0.51555556,0.70710678,0.70710678,0.25848681,-1.15572675\n45,0.09799551,0.16021773,0.70710678,0.70710678,0.3705303,-1.04368326\n0,0.90200449,0.01,0,1,0.08799551,-0.91200449\n135,0.70222222,0.51555556,0.70710678,0.70710678,0.08799551,-1.32621805\n135,0.42611111,0.79166667,0.70710678,0.70710678,0.08799551,-1.32621805\n135,0.48444444,0.70222222,0.70710678,0.70710678,0.40697924,-1.00723433\n135,0.76055556,0.42611111,0.70710678,0.70710678,0.25848681,-1.15572675\n135,0.99,0.19666667,0.70710678,0.70710678,0.19249018,-1.22172338\n135,0.33277778,0.69833333,0.70710678,0.70710678,0.08799551,-1.32621805\n135,0.42222222,0.64,0.70710678,0.70710678,0.3705303,-1.04368326\n135,0.60888889,0.42222222,0.70710678,0.70710678,0.08799551,-1.32621805\n135,0.69833333,0.36388889,0.70710678,0.70710678,0.25848681,-1.15572675\n135,0.90200449,0.16021773,0.70710678,0.70710678,0.15604125,-1.25817232\n135,0.63611111,0.14611111,0.70710678,0.70710678,0.08799551,-1.32621805\n135,0.14611111,0.66722222,0.70710678,0.70710678,0.19249018,-1.22172338\n135,0.80333333,0.01,0.70710678,0.70710678,0.40697924,-1.00723433\n135,0.72944444,0.23944444,0.70710678,0.70710678,0.08799551,-1.32621805\n135,0.20833333,0.72944444,0.70710678,0.70710678,0.15604125,-1.25817232\n135,0.83978227,0.09799551,0.70710678,0.70710678,0.3705303,-1.04368326\n270,0.88000561,0.09799551,0,1,0.08799551,-0.91200449\n270,0.90200449,0.16021773,0,1,0.15021773,-0.84978227\n270,0.99,0.19666667,0,1,0.18666667,-0.81333333\n0,0.83978227,0.09799551,0,1,0.04022334,-0.95977666\n0,0.80333333,0.01,0,1,0.07667228,-0.92332772\n135,0.99,0.5,0.70710678,0.70710678,0.19249018,-1.22172338\n45,0.5,0.01,0.70710678,0.70710678,0.19249018,-1.22172338\n315,0.27055556,0.20833333,0.70710678,0.70710678,0.08799551,-1.32621805\n315,0.23944444,0.27055556,0.70710678,0.70710678,0.3684812,-1.04573236\n315,0.01,0.5,0.70710678,0.70710678,0.19249018,-1.22172338\n225,0.20833333,0.72944444,0.70710678,0.70710678,0.08799551,-1.32621805\n225,0.27055556,0.76055556,0.70710678,0.70710678,0.3684812,-1.04573236\n225,0.5,0.99,0.70710678,0.70710678,0.19249018,-1.22172338\n135,0.72944444,0.79166667,0.70710678,0.70710678,0.08799551,-1.32621805\n135,0.76055556,0.72944444,0.70710678,0.70710678,0.3684812,-1.04573236\n135,0.86555556,0.5,0.70710678,0.70710678,0.10449467,-1.30971889\n45,0.5,0.13444444,0.70710678,0.70710678,0.10449467,-1.30971889\n315,0.36388889,0.30166667,0.70710678,0.70710678,0.08799551,-1.32621805\n315,0.30166667,0.33277778,0.70710678,0.70710678,0.28048569,-1.13372787\n315,0.13444444,0.5,0.70710678,0.70710678,0.10449467,-1.30971889\n225,0.30166667,0.63611111,0.70710678,0.70710678,0.08799551,-1.32621805\n225,0.33277778,0.69833333,0.70710678,0.70710678,0.28048569,-1.13372787\n225,0.5,0.86555556,0.70710678,0.70710678,0.10449467,-1.30971889\n135,0.63611111,0.69833333,0.70710678,0.70710678,0.08799551,-1.32621805\n135,0.69833333,0.66722222,0.70710678,0.70710678,0.28048569,-1.13372787\n"),!1),N(O.ParsePatFile("\n*CELTIC-02,CELTIC PATTERN 02\n;By John Hyslop\n;Developed in inch as imperial QCAD3 pattern\n180,0.438471,0.01545916,0,1,0.12305799,-0.87694201\n270,0.98454084,0.438471,0,1,0.12305799,-0.87694201\n270,0.01545916,0.68458699,0,1,0.12305799,-0.87694201\n180,0.68458699,0.98454084,0,1,0.12305799,-0.87694201\n90,0.98454084,0.4692355,0,1,0.51530534,-0.48469466\n270,0.98454084,0.28464852,0,1,0.26918936,-0.73081064\n180,0.438471,0.28464852,0,1,0.12305799,-0.87694201\n180,0.5307645,0.31541301,0,1,0.36148285,-0.63851715\n0,0.31541301,0.4692355,0,1,0.12305799,-0.87694201\n0,0.16928165,0.438471,0,1,0.36148285,-0.63851715\n270,0.83071835,0.68458699,0,1,0.12305799,-0.87694201\n270,0.86148285,0.86148285,0,1,0.39224735,-0.60775265\n270,0.5307645,0.98454084,0,1,0.12305799,-0.87694201\n270,0.71535148,0.98454084,0,1,0.12305799,-0.87694201\n90,0.68458699,0.71535148,0,1,0.26918936,-0.73081064\n90,0.71535148,0.31541301,0,1,0.12305799,-0.87694201\n90,0.68458699,0.16928165,0,1,0.36148285,-0.63851715\n90,0.561529,0.71535148,0,1,0.26918936,-0.73081064\n90,0.5307645,0.31541301,0,1,0.12305799,-0.87694201\n90,0.561529,0.16928165,0,1,0.36148285,-0.63851715\n90,0.28464852,0.561529,0,1,0.12305799,-0.87694201\n90,0.28464852,0.01545916,0,1,0.12305799,-0.87694201\n90,0.31541301,0.4692355,0,1,0.36148285,-0.63851715\n90,0.31541301,0.01545916,0,1,0.26918936,-0.73081064\n90,0.4692355,0.01545916,0,1,0.12305799,-0.87694201\n90,0.4692355,0.561529,0,1,0.12305799,-0.87694201\n90,0.438471,0.4692355,0,1,0.36148285,-0.63851715\n90,0.438471,0.01545916,0,1,0.26918936,-0.73081064\n180,0.68458699,0.71535148,0,1,0.12305799,-0.87694201\n180,0.13851715,0.71535148,0,1,0.12305799,-0.87694201\n180,0.28464852,0.68458699,0,1,0.26918936,-0.73081064\n180,0.83071835,0.68458699,0,1,0.36148285,-0.63851715\n180,0.13851715,0.5307645,0,1,0.12305799,-0.87694201\n180,0.28464852,0.561529,0,1,0.26918936,-0.73081064\n180,0.68458699,0.5307645,0,1,0.12305799,-0.87694201\n180,0.83071835,0.561529,0,1,0.36148285,-0.63851715\n180,0.98454084,0.28464852,0,1,0.12305799,-0.87694201\n180,0.98454084,0.31541301,0,1,0.26918936,-0.73081064\n180,0.98454084,0.4692355,0,1,0.12305799,-0.87694201\n180,0.98454084,0.438471,0,1,0.26918936,-0.73081064\n180,0.98454084,0.98454084,0,1,0.26918936,-0.73081064\n0,0.4692355,0.01545916,0,1,0.51530534,-0.48469466\n0,0.01545916,0.01545916,0,1,0.26918936,-0.73081064\n270,0.01545916,0.5307645,0,1,0.51530534,-0.48469466\n270,0.01545916,0.98454084,0,1,0.26918936,-0.73081064\n180,0.5307645,0.98454084,0,1,0.51530534,-0.48469466\n180,0.86148285,0.86148285,0,1,0.14613136,-0.85386864\n90,0.86148285,0.13851715,0,1,0.14613136,-0.85386864\n0,0.561529,0.16928165,0,1,0.12305799,-0.87694201\n0,0.4692355,0.13851715,0,1,0.39224735,-0.60775265\n0,0.13851715,0.13851715,0,1,0.14613136,-0.85386864\n270,0.16928165,0.438471,0,1,0.12305799,-0.87694201\n270,0.13851715,0.5307645,0,1,0.39224735,-0.60775265\n270,0.13851715,0.86148285,0,1,0.14613136,-0.85386864\n180,0.438471,0.83071835,0,1,0.12305799,-0.87694201\n180,0.5307645,0.86148285,0,1,0.39224735,-0.60775265\n"),!1),N(O.ParsePatFile("\n*CELTIC-03,CELTIC-03\n;By John Hyslop, Using AutoCAD Lisp Tool\n;Developed in inch as imperial QCAD3 pattern\n90,6.35,13.97,0,25.4,5.08,-20.32\n90,19.05,6.35,0,25.4,5.08,-20.32\n0,6.35,6.35,0,25.4,12.7,-12.7\n270,6.35,11.43,0,25.4,5.08,-20.32\n90,3.81,3.81,0,25.4,7.62,-17.78\n180,21.59,3.81,0,25.4,17.78,-7.62\n270,21.59,11.43,0,25.4,7.62,-17.78\n270,21.59,21.59,0,25.4,7.62,-17.78\n0,3.81,21.59,0,25.4,17.78,-7.62\n90,3.81,13.97,0,25.4,7.62,-17.78\n270,19.05,19.05,0,25.4,5.08,-20.32\n0,6.35,19.05,0,25.4,12.7,-12.7\n90,13.97,6.35,0,25.4,12.7,-12.7\n90,11.43,6.35,0,25.4,12.7,-12.7\n270,13.97,3.81,0,25.4,7.62,-17.78\n90,11.43,-3.81,0,25.4,7.62,-17.78\n180,11.43,11.43,0,25.4,22.86,-2.54\n0,-11.43,13.97,0,25.4,22.86,-2.54\n"),!1),N(O.ParsePatFile("\n*CELTIC-04,CELTIC-04\n;By John Hyslop, Using AutoCAD Lisp Tool\n;Developed in mm as metric QCAD3 pattern\n45,3.81,13.97,17.960512212,17.960512212,12.57235865,-23.348666028\n135,21.59,13.97,17.960512212,17.960512212,12.57235865,-23.348666028\n45,12.7,2.54,17.960512212,17.960512212,12.57235865,-23.348666028\n315,3.81,11.43,17.960512212,17.960512212,12.57235865,-23.348666028\n135,12.7,5.08,17.960512212,17.960512212,8.980256106,-26.940768318\n225,19.05,11.43,17.960512212,17.960512212,8.980256106,-26.940768318\n315,12.7,20.32,17.960512212,17.960512212,8.980256106,-26.940768318\n45,6.35,13.97,17.960512212,17.960512212,8.980256106,-26.940768318\n90,13.97,6.35,0,25.4,12.7,-12.7\n90,11.43,6.35,0,25.4,12.7,-12.7\n270,13.97,3.81,0,25.4,7.62,-17.78\n90,11.43,-3.81,0,25.4,7.62,-17.78\n180,11.43,11.43,0,25.4,22.86,-2.54\n0,-11.43,13.97,0,25.4,22.86,-2.54\n"),!1),N(O.ParsePatFile("\n*CIRCLES-02,CIRCLES-02\n;By John Hyslop\n;Developed in inch as imperial QCAD3 pattern\n0,0.959092,0.471116,0,1,0,-1\n0,0.956373,0.442347,0,1,0,-1\n0,0.951852,0.413805,0,1,0,-1\n0,0.945548,0.385603,0,1,0,-1\n0,0.937486,0.357852,0,1,0,-1\n0,0.927697,0.330663,0,1,0,-1\n0,0.91622,0.304142,0,1,0,-1\n0,0.903101,0.278393,0,1,0,-1\n0,0.888391,0.25352,0,1,0,-1\n0,0.872148,0.229619,0,1,0,-1\n0,0.854436,0.206785,0,1,0,-1\n0,0.835326,0.185108,0,1,0,-1\n0,0.814892,0.164674,0,1,0,-1\n0,0.793215,0.145564,0,1,0,-1\n0,0.770381,0.127852,0,1,0,-1\n0,0.74648,0.111609,0,1,0,-1\n0,0.721607,0.096899,0,1,0,-1\n0,0.695858,0.08378,0,1,0,-1\n0,0.669337,0.072303,0,1,0,-1\n0,0.642148,0.062514,0,1,0,-1\n0,0.614397,0.054452,0,1,0,-1\n0,0.586195,0.048148,0,1,0,-1\n0,0.557653,0.043627,0,1,0,-1\n0,0.528884,0.040908,0,1,0,-1\n0,0.5,0.04,0,1,0,-1\n0,0.471116,0.040908,0,1,0,-1\n0,0.442347,0.043627,0,1,0,-1\n0,0.413805,0.048148,0,1,0,-1\n0,0.385603,0.054452,0,1,0,-1\n0,0.357852,0.062514,0,1,0,-1\n0,0.330663,0.072303,0,1,0,-1\n0,0.304142,0.08378,0,1,0,-1\n0,0.278393,0.096899,0,1,0,-1\n0,0.25352,0.111609,0,1,0,-1\n0,0.229619,0.127852,0,1,0,-1\n0,0.206785,0.145564,0,1,0,-1\n0,0.185108,0.164674,0,1,0,-1\n0,0.164674,0.185108,0,1,0,-1\n0,0.145564,0.206785,0,1,0,-1\n0,0.127852,0.229619,0,1,0,-1\n0,0.111609,0.25352,0,1,0,-1\n0,0.096899,0.278393,0,1,0,-1\n0,0.08378,0.304142,0,1,0,-1\n0,0.072303,0.330663,0,1,0,-1\n0,0.062514,0.357852,0,1,0,-1\n0,0.054452,0.385603,0,1,0,-1\n0,0.048148,0.413805,0,1,0,-1\n0,0.043627,0.442347,0,1,0,-1\n0,0.040908,0.471116,0,1,0,-1\n0,0.04,0.5,0,1,0,-1\n0,0.040908,0.528884,0,1,0,-1\n0,0.043627,0.557653,0,1,0,-1\n0,0.048148,0.586195,0,1,0,-1\n0,0.054452,0.614397,0,1,0,-1\n0,0.062514,0.642148,0,1,0,-1\n0,0.072303,0.669337,0,1,0,-1\n0,0.08378,0.695858,0,1,0,-1\n0,0.096899,0.721607,0,1,0,-1\n0,0.111609,0.74648,0,1,0,-1\n0,0.127852,0.770381,0,1,0,-1\n0,0.145564,0.793215,0,1,0,-1\n0,0.164674,0.814892,0,1,0,-1\n0,0.185108,0.835326,0,1,0,-1\n0,0.206785,0.854436,0,1,0,-1\n0,0.229619,0.872148,0,1,0,-1\n0,0.25352,0.888391,0,1,0,-1\n0,0.278393,0.903101,0,1,0,-1\n0,0.304142,0.91622,0,1,0,-1\n0,0.330663,0.927697,0,1,0,-1\n0,0.357852,0.937486,0,1,0,-1\n0,0.385603,0.945548,0,1,0,-1\n0,0.413805,0.951852,0,1,0,-1\n0,0.442347,0.956373,0,1,0,-1\n0,0.471116,0.959092,0,1,0,-1\n0,0.5,0.96,0,1,0,-1\n0,0.528884,0.959092,0,1,0,-1\n0,0.557653,0.956373,0,1,0,-1\n0,0.586195,0.951852,0,1,0,-1\n0,0.614397,0.945548,0,1,0,-1\n0,0.642148,0.937486,0,1,0,-1\n0,0.669337,0.927697,0,1,0,-1\n0,0.695858,0.91622,0,1,0,-1\n0,0.721607,0.903101,0,1,0,-1\n0,0.74648,0.888391,0,1,0,-1\n0,0.770381,0.872148,0,1,0,-1\n0,0.793215,0.854436,0,1,0,-1\n0,0.814892,0.835326,0,1,0,-1\n0,0.835326,0.814892,0,1,0,-1\n0,0.854436,0.793215,0,1,0,-1\n0,0.872148,0.770381,0,1,0,-1\n0,0.888391,0.74648,0,1,0,-1\n0,0.903101,0.721607,0,1,0,-1\n0,0.91622,0.695858,0,1,0,-1\n0,0.927697,0.669337,0,1,0,-1\n0,0.937486,0.642148,0,1,0,-1\n0,0.945548,0.614397,0,1,0,-1\n0,0.951852,0.586195,0,1,0,-1\n0,0.956373,0.557653,0,1,0,-1\n0,0.959092,0.528884,0,1,0,-1\n0,0.96,0.5,0,1,0,-1\n"),!1),N(O.ParsePatFile("\n*CIRCLES,CIRCLES\n;By John Hyslop\n;Developed in inch as imperial QCAD3 pattern\n0,0.934583,0.431169,0,1,0,-1\n0,0.918465,0.364033,0,1,0,-1\n0,0.892043,0.300244,0,1,0,-1\n0,0.855967,0.241374,0,1,0,-1\n0,0.811127,0.188873,0,1,0,-1\n0,0.758626,0.144033,0,1,0,-1\n0,0.699756,0.107957,0,1,0,-1\n0,0.635967,0.081535,0,1,0,-1\n0,0.568831,0.065417,0,1,0,-1\n0,0.5,0.06,0,1,0,-1\n0,0.431169,0.065417,0,1,0,-1\n0,0.364033,0.081535,0,1,0,-1\n0,0.300244,0.107957,0,1,0,-1\n0,0.241374,0.144033,0,1,0,-1\n0,0.188873,0.188873,0,1,0,-1\n0,0.144033,0.241374,0,1,0,-1\n0,0.107957,0.300244,0,1,0,-1\n0,0.081535,0.364033,0,1,0,-1\n0,0.065417,0.431169,0,1,0,-1\n0,0.06,0.5,0,1,0,-1\n0,0.065417,0.568831,0,1,0,-1\n0,0.081535,0.635967,0,1,0,-1\n0,0.107957,0.699756,0,1,0,-1\n0,0.144033,0.758626,0,1,0,-1\n0,0.188873,0.811127,0,1,0,-1\n0,0.241374,0.855967,0,1,0,-1\n0,0.300244,0.892043,0,1,0,-1\n0,0.364033,0.918465,0,1,0,-1\n0,0.431169,0.934583,0,1,0,-1\n0,0.5,0.94,0,1,0,-1\n0,0.568831,0.934583,0,1,0,-1\n0,0.635967,0.918465,0,1,0,-1\n0,0.699756,0.892043,0,1,0,-1\n0,0.758626,0.855967,0,1,0,-1\n0,0.811127,0.811127,0,1,0,-1\n0,0.855967,0.758626,0,1,0,-1\n0,0.892043,0.699756,0,1,0,-1\n0,0.918465,0.635967,0,1,0,-1\n0,0.934583,0.568831,0,1,0,-1\n0,0.94,0.5,0,1,0,-1\n"),!1),N(O.ParsePatFile("\n*CLAY,CLAY\n0, 0,0, 0,.1875\n0, 0,.03125, 0,.1875\n0, 0,.0625, 0,.1875\n0, 0,.125, 0,.1875, .1875,-.125\n"),!1),N(O.ParsePatFile("\n*CORK,CORK\n0, 0,0, 0,.125\n135, .0625,-.0625, 0,.35355339, .1767767,-.1767767\n135, .09375,-.0625, 0,.35355339, .1767767,-.1767767\n135, .125,-.0625, 0,.35355339, .1767767,-.1767767\n"),!1),N(O.ParsePatFile("\n*CROSS,CROSS\n0, 0,0, .25,.25, .125,-.375\n90, .0625,-.0625, .25,.25, .125,-.375\n"),!1),N(O.ParsePatFile("\n*DASH,DASH\n0, 0,0, .125,.125, .125,-.125\n"),!1),N(O.ParsePatFile("\n*DOLMIT,DOLMIT\n0, 0,0, 0,.25\n45, 0,0, 0,.70710678, .35355339,-.70710768\n"),!1),N(O.ParsePatFile("\n*DOTS,DOTS\n0, 0,0, .03125,.0625, 0,-.0625\n"),!1),N(O.ParsePatFile("\n*EARTH,EARTH\n0, 0,0, .25,.25, .25,-.25\n0, 0,.09375, .25,.25, .25,-.25\n0, 0,.1875, .25,.25, .25,-.25\n90, .03125,.21875, .25,.25, .25,-.25\n90, .125,.21875, .25,.25, .25,-.25\n90, .21875,.21875, .25,.25, .25,-.25\n"),!1),N(O.ParsePatFile("\n*ESCHER,ESCHER\n60, 0,0, -.6,1.03923048, 1.1,-.1\n180, 0,0, -.6,1.03923048, 1.1,-.1\n300, 0,0, .6,1.03923048, 1.1,-.1\n60, .1,0, -.6,1.03923048, .2,-1\n300, .1,0, .6,1.03923048, .2,-1\n60, -.05,.08660254, -.6,1.03923048, .2,-1\n180, -.05,.08660254, -.6,1.03923048, .2,-1\n300, -.05,-.08660254, .6,1.03923048, .2,-1\n180, -.05,-.08660254, -.6,1.03923048, .2,-1\n60, -.4,0, -.6,1.03923048, .2,-1\n300, -.4,0, .6,1.03923048, .2,-1\n60, .2,-.34641016, -.6,1.03923048, .2,-1\n180, .2,-.34641016, -.6,1.03923048, .2,-1\n300, .2,.34641016, .6,1.03923048, .2,-1\n180, .2,.34641016, -.6,1.03923048, .2,-1\n0, .2,.17320508, -.6,1.03923048, .7,-.5\n0, .2,-.17320508, -.6,1.03923048, .7,-.5\n120, .05,.25980762, .6,1.03923048, .7,-.5\n120, -.25,.08660254, .6,1.03923048, .7,-.5\n240, -.25,-.08660254, .6,1.03923048, .7,-.5\n240, .05,-.25980762, .6,1.03923048, .7,-.5\n"),!1),N(O.ParsePatFile("\n*EXPLOSION,EXPLOSION\n;By John Hyslop\n;Developed in inch as imperial QCAD3 pattern\n270,0.45,0.11,0,1,0.11,-0.89\n143.130102,0.49,0.08,3.6,0.2,0.05,-4.95\n270,0.49,0.17,0,1,0.09,-0.91\n112.380135,0.56,0,12.99988621,0.05439283,0.18384776,-18.20092855\n75.256437,0.51,0.81,4.12279145,0.05089866,0.19646883,-19.45041388\n287.525568,0.45,1,3.16187936,0.05018856,0.19924859,-19.72561026\n135,0.06,0.49,0.70710678,0.70710678,0.08485281,-1.32936075\n26.565051,0,0.46,1.34164079,0.4472136,0.06708204,-2.16898594\n353.884496,0.72,0.49,19.10494017,0.03551104,0.28160256,-27.87865312\n192.094757,1,0.55,9.2192799,0.06984303,0.28635642,-14.03146464\n3.691386,0.69,0.38,15.03326191,0.03219114,0.31064449,-30.75380464\n136.080924,0.96,0.12,36.06936773,0.02667853,0.3748333,-37.10849633\n336.037511,0.87,0.16,7.61509624,0.10153462,0.09848858,-9.75036922\n123.690068,0.97,0.01,1.38675049,0.2773501,0.18027756,-3.42527371\n324.462322,0.62,0.26,3.6036768,0.11624764,0.43011626,-8.172209\n117.645975,0.73,0.05,21.47086912,0.04218245,0.23706539,-23.46947379\n326.309932,0.55,0.17,2.21880078,0.2773501,0.21633308,-3.3892182\n106.38954,0.6,0,10.44015399,0.05643326,0.17720045,-17.5428447\n153.434949,0.12,0.34,0.89442719,0.4472136,0.13416408,-2.1019039\n64.798876,0.04,0.17,16.55285979,0.05322463,0.18788294,-18.60041129\n202.619865,0.16,0.22,7.61538462,0.07692308,0.13,-12.87\n59.036243,0.1,0.12,2.22948161,0.17149859,0.11661904,-5.71433286\n211.75948,0.31,0.25,9.43389425,0.04048882,0.24698178,-24.45119629\n79.215702,0.27,0.04,16.27875339,0.04677803,0.21377558,-21.16378274\n212.471192,0.38,0.11,3.60473545,0.0766965,0.13038405,-12.90802076\n63.434949,0.35,0.05,0.89442719,0.4472136,0.06708204,-2.16898594\n135,0.4,0,0.70710678,0.70710678,0.07071068,-1.34350288\n74.357754,0.33,0.75,18.68150198,0.03851856,0.2596151,-25.70189487\n333.434949,0.03,0.9,0.89442719,0.4472136,0.3354102,-1.90065778\n110.556045,0.18,0.5,5.38389277,0.11704115,0.42720019,-8.11680356\n330.945396,0,0.6,2.23395748,0.09712859,0.2059126,-10.08971754\n99.462322,0.63,0.82,5.09636861,0.16439899,0.18248288,-5.90027965\n222.70939,0.76,0.94,1.41308355,0.05652334,0.17691806,-17.51488795\n74.744881,0.73,0.83,4.12217269,0.0877058,0.11401754,-11.28773671\n208.61046,0.95,0.95,10.29532081,0.07980869,0.25059928,-12.2793648\n62.744672,0.78,0.62,2.2359057,0.02693862,0.37121422,-36.75020816\n212.275644,0.97,0.74,13.03832887,0.04449942,0.22472205,-22.247483\n55.00798,0.9,0.64,3.60462045,0.08192319,0.12206556,-12.08449006\n158.198591,1,0.6,3.15682075,0.18569534,0.1077033,-5.27746151\n51.911227,0.59,0.51,29.20615599,0.02127178,0.47010637,-46.54053072\n153.434949,0.65,0.48,0.89442719,0.4472136,0.06708204,-2.16898594\n35.537678,0.58,0.43,4.99864847,0.11624764,0.08602325,-8.51630201\n129.289407,0.76,0.21,7.80993275,0.07035975,0.28425341,-13.928417\n322.30576,0.54,0.38,16.40118003,0.0359675,0.27802878,-27.52484877\n77.905243,0.51,0.24,5.09854116,0.06984303,0.14317821,-14.17464285\n282.994617,0.48,0.37,4.12242429,0.07495317,0.13341664,-13.20824742\n62.525568,0.35,0.12,2.23578634,0.03548867,0.28178006,-27.89622555\n267.137595,0.36,0.32,0.99875234,0.04993762,0.20024984,-19.82473455\n12.994617,0.1,0.26,4.12242429,0.07495317,0.26683328,-13.07483078\n211.75948,0.31,0.39,9.43389425,0.04048882,0.24698178,-24.45119629\n318.366461,0.22,0.47,10.62982142,0.08304548,0.12041595,-11.92117863\n189.462322,0.28,0.48,5.09636861,0.16439899,0.06082763,-6.0219349\n297.299572,0.12,0.79,32.64964285,0.02866518,0.34885527,-34.53667181\n132.273689,0.32,0.57,1.41261287,0.06726728,0.29732137,-14.56874737\n282.994617,0.29,0.7,4.12242429,0.07495317,0.13341664,-13.20824742\n140.194429,0.41,0.6,6.401844,0.12803688,0.15620499,-7.65404468\n268.363423,0.42,0.95,0.99959209,0.02855977,0.35014283,-34.66413997\n102.200469,0.5,0.58,23.53718977,0.0264166,0.37854986,-37.4764366\n250.016893,0.58,0.8,3.16112333,0.08543577,0.234094,-11.47060591\n84.559668,0.56,0.59,11.04525929,0.04740455,0.21095023,-20.88407288\n222.184443,0.88,0.88,14.86605071,0.02315584,0.43185646,-42.75378931\n"),!1),N(O.ParsePatFile("\n*FLEX,FLEX\n0, 0,0, 0,.25, .25,-.25\n45, .25,0, .1767767,.1767767, .0625,-.22855339,.0625,-.35355339\n"),!1),N(O.ParsePatFile("\n*GRASS,GRASS\n90, 0,0, .70710678,.70710678, .1875,-1.22671356\n45, 0,0, 0,1, .1875,-.8125\n135, 0,0, 0,1, .1875,-.8125\n"),!1),N(O.ParsePatFile("\n*GRATE,GRATE\n0, 0,0, 0,.03125\n90, 0,0, 0,.125\n"),!1),N(O.ParsePatFile("\n*GRAVEL-01,GRAVEL-01\n;Optimize to replace existing GRAVEL Pattern\n;By John Hyslop, Using AutoCAD Lisp Tool\n;Developed in inch as imperial QCAD3 pattern\n159.443955,0.16,0.13,3.16011097,0.11704115,0.17088007,-8.37312367\n114.775141,0.22,0,2.23497695,0.06984303,0.14317821,-14.17464285\n249.443955,0.32,0.08,3.16011097,0.11704115,0.08544004,-8.45856371\n186.009006,0.51,0.1,9.05523386,0.05234239,0.19104973,-18.91392344\n165.963757,0.71,0.05,0.9701425,0.24253563,0.20615528,-3.91695034\n101.309932,0.72,0,4.11843884,0.19611614,0.0509902,-5.04802932\n243.434949,0.84,0.14,0.89442719,0.4472136,0.15652476,-2.07954322\n355.426079,0.49,0.13,13.03834384,0.03987261,0.25079872,-24.82907368\n300.256437,0.42,0.25,5.83050758,0.07198158,0.13892444,-13.75351955\n228.012788,0.6,0.45,12.04136517,0.07432941,0.26907248,-13.18455157\n180,0.86,0.45,0,1,0.26,-0.74\n303.690068,0.62,0.62,1.38675049,0.2773501,0.14422205,-3.46132922\n225,0.72,0.72,0.70710678,0.70710678,0.14142136,-1.27279221\n110.224859,0.08,0.23,8.54386101,0.04938648,0.20248457,-20.04597216\n177.273689,0.29,0.22,0.99886814,0.04756515,0.21023796,-20.81355808\n217.69424,0.51,0.39,11.40169752,0.0359675,0.27802878,-27.52484877\n252.255328,0.59,0.64,23.08676133,0.03809697,0.26248809,-25.9863214\n301.429566,0.48,0.82,15.26426391,0.04740455,0.21095023,-20.88407288\n355.236358,0.24,0.84,0.99654576,0.08304548,0.24083189,-11.80076269\n43.66778,0.02,0.63,1.41383129,0.0328798,0.30413813,-30.10967452\n87.273689,0.01,0.42,0.99886814,0.04756515,0.21023796,-20.81355808\n30.963757,0.62,0.71,3.60147029,0.17149859,0.17492856,-5.65602334\n291.801409,0.58,0.81,2.22834406,0.18569534,0.1077033,-5.27746151\n203.198591,0.65,0.84,2.23220936,0.13130643,0.07615773,-7.53961537\n161.565051,0.77,0.8,0.9486833,0.31622777,0.12649111,-3.03578655\n4.969741,0.4,0.88,11.04527609,0.04331481,0.23086793,-22.85592483\n16.38954,0,0.81,10.44015399,0.05643326,0.17720045,-17.5428447\n197.354025,1,0.19,3.16171493,0.059655,0.16763055,-16.59542407\n74.054604,0.95,0.22,4.12081692,0.13736056,0.1456022,-7.13450769\n27.645975,0.74,0.11,21.47086912,0.04218245,0.23706539,-23.46947379\n145.304846,0.99,0.36,3.60499653,0.06324555,0.15811388,-15.65327442\n353.157227,0.7,0.5,17.1171967,0.03971507,0.25179357,-24.92756306\n171.469234,0.92,0.69,7.07089492,0.04944682,0.20223748,-20.02151093\n138.814075,1,0.62,9.21906451,0.09407209,0.10630146,-10.52384435\n90,1,0.56,0,1,0.06,-0.94\n60.945396,0.95,0.47,2.23395748,0.09712859,0.1029563,-10.19267384\n343.61046,0.83,0.86,7.27989116,0.05643326,0.17720045,-17.5428447\n293.198591,0.77,1,2.23220936,0.13130643,0.15231546,-7.46345764\n48.012788,0.63,0.9,12.04136517,0.07432941,0.13453624,-13.31908781\n312.510447,0.29,1,1.41287877,0.06142951,0.16278821,-16.11603239\n70.346176,0.17,0.86,3.16156213,0.06726728,0.14866069,-14.71740806\n"),!1),N(O.ParsePatFile("\n*GRAVEL,GRAVEL\n228.0128, .72,1, 12.041365,.074329, .134536,-13.319088\n184.9697, .63,.9, -12.041517,.043315, .230868,-22.855925\n132.5104, .4,.88, -14.865942,.06143, .162788,-16.116032\n267.2737, .01,.63, -20.024928,.047565, .210238,-20.813558\n292.8337, 0,.42, -12.99991,.048507, .206155,-20.409373\n357.2737, .08,.23, -20.024928,.047565, .210238,-20.813558\n37.6942, .29,.22, -16.40118,.035968, .278029,-27.524849\n72.2553, .51,.39, 23.086761,.038097, .262488,-25.986321\n121.4296, .59,.64, 15.264264,.047405, .21095,-20.884073\n175.2364, .48,.82, -11.045049,.083045, .240832,-11.800763\n222.3974, .24,.84, 16.278789,.032108, .311448,-30.833375\n138.8141, 1,.62, 9.219065,.094072, .106301,-10.523844\n171.4692, .92,.69, -13.152853,.049447, .202237,-20.021511\n225, .72,.72, .707107,.707107, .141421,-1.272792\n203.1986, .65,.84, -5.383564,.131306, .076158,-7.539615\n291.8014, .58,.81, -3.156821,.185695, .107703,-5.277462\n30.9638, .62,.71, 3.60147,.171499, .174929,-5.656023\n161.5651, .77,.8, -2.213594,.316228, .126491,-3.035787\n16.3895, 0,.81, 10.440154,.056433, .1772,-17.542845\n70.3462, .17,.86, -11.704507,.067267, .148661,-14.717408\n293.1986, .77,1, -5.383564,.131306, .152315,-7.463458\n343.6105, .83,.86, -10.440154,.056433, .1772,-17.542845\n339.444, 0,.19, -5.383893,.117041, .17088,-8.373124\n294.7751, .16,.13, -12.082844,.069843, .143178,-14.174643\n66.8014, .78,0, 5.383564,.131306, .152315,-7.463458\n17.354, .84,.14, -13.60134,.059655, .167631,-16.595424\n69.444, .29,0, -5.383893,.117041, .08544,-8.458564\n101.3099, .72,0, 4.118439,.196116, .05099,-5.048029\n165.9638, .71,.05, -3.152963,.242536, .206155,-3.91695\n186.009, .51,.1, -10.049739,.052342, .19105,-18.913923\n303.6901, .62,.62, -2.218801,.27735, .144222,-3.461329\n353.1572, .7,.5, 17.117197,.039715, .251794,-24.927563\n60.9454, .95,.47, -8.061673,.097129, .102956,-10.192674\n90, 1,.56, 1,1, .06,-.94\n120.2564, .49,.13, -8.061936,.071982, .138924,-13.75352\n48.0128, .42,.25, 12.041365,.074329, .269072,-13.184552\n0, .6,.45, 1,1, .26,-.74\n325.3048, .86,.45, -12.206392,.063246, .158114,-15.653274\n254.0546, .99,.36, 4.120817,.137361, .145602,-7.134508\n207.646, .95,.22, 21.470869,.042182, .237065,-23.469474\n175.4261, .74,.11, 13.038344,.039873, .250799,-24.829074\n"),!1),N(O.ParsePatFile("\n*HATCH-DOTS,HATCH-DOTS verbose\n;By John Hyslop, Tile2Hatch tool \xa9 CVH 2020\n;Developed in inch as imperial QCAD3 pattern\n225,0.56554781,0.11554781,0.70710678,0.70710678,0.45245257,-0.96176099\n225,0.25036388,0.20036388,0.70710678,0.70710678,0.6374253,-0.77678826\n225,0.12918503,0.37918503,0.70710678,0.70710678,0.71894383,-0.69526973\n225,0.75438447,0.20438447,0.70710678,0.70710678,0.45245257,-0.96176099\n225,0.30962291,0.15962291,0.70710678,0.70710678,0.6636138,-0.75059977\n225,0.11186858,0.46186858,0.70710678,0.70710678,0.81138689,-0.60282667\n225,0.37918503,0.12918503,0.70710678,0.70710678,0.71894383,-0.69526973\n225,0.11554781,0.56554781,0.70710678,0.70710678,0.45245257,-0.96176099\n225,0.20036388,0.25036388,0.70710678,0.70710678,0.6374253,-0.77678826\n225,0.46186859,0.11186859,0.70710678,0.70710678,0.8113869,-0.60282666\n225,0.20438447,0.75438447,0.70710678,0.70710678,0.45245257,-0.96176099\n225,0.15962291,0.30962291,0.70710678,0.70710678,0.6636138,-0.75059977\n"),!1),N(O.ParsePatFile("\n*HATCH-SQRS,HATCH-SQRS verbose\n;By John Hyslop, Tile2Hatch tool \xa9 CVH 2020\n;Developed in inch as imperial QCAD3 pattern\n225,0.11,0.36,0.70710678,0.70710678,0.31112698,-1.10308658\n225,0.11,0.86,0.70710678,0.70710678,0.31112698,-1.10308658\n225,0.11,0.26,0.70710678,0.70710678,0.52325902,-0.89095454\n225,0.76,0.11,0.70710678,0.70710678,0.31112698,-1.10308658\n225,0.11,0.56,0.70710678,0.70710678,0.31112698,-1.10308658\n225,0.11,0.46,0.70710678,0.70710678,0.31112698,-1.10308658\n225,0.26,0.11,0.70710678,0.70710678,0.52325902,-0.89095454\n225,0.11,0.76,0.70710678,0.70710678,0.31112698,-1.10308658\n225,0.11,0.16,0.70710678,0.70710678,0.38183766,-1.0323759\n225,0.16,0.11,0.70710678,0.70710678,0.38183766,-1.0323759\n225,0.46,0.11,0.70710678,0.70710678,0.31112698,-1.10308658\n225,0.56,0.11,0.70710678,0.70710678,0.31112698,-1.10308658\n225,0.36,0.11,0.70710678,0.70710678,0.31112698,-1.10308658\n225,0.86,0.11,0.70710678,0.70710678,0.31112698,-1.10308658\n225,0.11,0.66,0.70710678,0.70710678,0.31112698,-1.10308658\n225,0.66,0.11,0.70710678,0.70710678,0.31112698,-1.10308658\n"),!1),N(O.ParsePatFile("\n*HEXAGONS,HEXAGONS verbose\n;By John Hyslop, Tile2Hatch tool \xa9 CVH 2020\n;Developed in inch as imperial QCAD3 pattern\n239.931417,0.21999999,0.99999998,8.06212908,0.04554875,0.21954496,-21.73495344\n239.931417,0.89,0.19,8.06212908,0.04554875,0.21954496,-21.73495344\n300.068583,0.78000001,0.99999998,13.89236932,0.04554875,0.21954496,-21.73495344\n60.068488,0.12,0.5,8.06221498,0.02626129,0.38078866,-37.69807687\n119.931512,0.31,0.17,30.01665055,0.02626129,0.38078865,-37.69807687\n300.068583,0.11,0.19,13.89236932,0.04554875,0.21954496,-21.73495344\n180,0.11,0.19,0,1,0.21999996,-0.78000004\n299.931512,0.69,0.83,30.01665055,0.02626129,0.38078865,-37.69807687\n0,0.31,0.83,0,1,0.38,-0.62\n180,0.69,0.17,0,1,0.38,-0.62\n240.068488,0.88,0.5,8.06221498,0.02626129,0.38078866,-37.69807687\n180,0.11,0.81,0,1,0.21999996,-0.78000004\n"),!1),N(O.ParsePatFile("\n*HEXJOIN-01,HEXJOIN-01 verbose\n;By John Hyslop, Tile2Hatch tool \xa9 CVH 2020\n;Developed in inch as imperial QCAD3 pattern\n45,0.15,0.65,0.70710678,0.70710678,0.28284271,-1.13137085\n270,0.85,0.65,1,1,0.3,-0.7\n315,0.65,0.85,0.70710678,0.70710678,0.28284271,-1.13137085\n180,0.65,0.15,0,1,0.3,-0.7\n270,0.55,0.15,1,1,0.3,-0.7\n90,0.15,0.35,1,1,0.3,-0.7\n135,0.35,0.15,0.70710678,0.70710678,0.28284271,-1.13137085\n180,0.15,0.55,0,1,0.3,-0.7\n270,0.45,0.15,1,1,0.3,-0.7\n180,0.15,0.45,0,1,0.3,-0.7\n225,0.85,0.35,0.70710678,0.70710678,0.28284271,-1.13137085\n0,0.35,0.85,0,1,0.3,-0.7\n"),!1),N(O.ParsePatFile("\n*HEXJOIN-02,HEXJOIN-02 verbose\n;By John Hyslop, Tile2Hatch tool \xa9 CVH 2020\n;Developed in inch as imperial QCAD3 pattern\n270,0.85,0.45,1,1,0.1,-0.9\n315,0.65,0.85,0.70710678,0.70710678,0.28284271,-1.13137085\n270,0.55,0.15,1,1,0.3,-0.7\n180,0.15,0.55,0,1,0.3,-0.7\n180,0.65,0.15,0,1,0.1,-0.9\n45,0.15,0.65,0.70710678,0.70710678,0.28284271,-1.13137085\n90,0.15,0.55,1,1,0.1,-0.9\n180,0.15,0.45,0,1,0.3,-0.7\n180,0.45,0.15,0,1,0.1,-0.9\n270,0.45,0.15,1,1,0.3,-0.7\n90,0.15,0.35,1,1,0.1,-0.9\n0,0.55,0.85,0,1,0.1,-0.9\n135,0.35,0.15,0.70710678,0.70710678,0.28284271,-1.13137085\n0,0.35,0.85,0,1,0.1,-0.9\n225,0.85,0.35,0.70710678,0.70710678,0.28284271,-1.13137085\n270,0.85,0.65,1,1,0.1,-0.9\n"),!1),N(O.ParsePatFile("\n*HEX,HEX\n0, 0,0, 0,.21650635, .125,-.25\n120, 0,0, 0,.21650635, .125,-.25\n60, .125,0, 0,.21650635, .125,-.25\n"),!1),N(O.ParsePatFile("\n*HOLLY,HOLLY\n;By John Hyslop\n;Developed in inch as imperial QCAD3 pattern\n99.462322,0.8,0.11,5.09636861,0.16439899,0.06082763,-6.0219349\n74.744881,0.67,0.08,4.12217269,0.0877058,0.11401754,-11.28773671\n68.198591,0.53,0.15,3.15682075,0.18569534,0.1077033,-5.27746151\n270,0.58,0.37,0,1,0.07,-0.93\n248.198591,0.75,0.35,3.15682075,0.18569534,0.1077033,-5.27746151\n45,0.8,0.2,0.70710678,0.70710678,0.08485281,-1.32936075\n351.869898,0.9,0.13,0.98994949,0.14142136,0.07071068,-7.00035713\n0,0.86,0.13,0,1,0.04,-0.96\n26.565051,0.82,0.11,1.34164079,0.4472136,0.04472136,-2.19134662\n45,0.8,0.09,0.70710678,0.70710678,0.02828427,-1.38592929\n341.565051,0.77,0.1,0.9486833,0.31622777,0.03162278,-3.13065488\n0,0.73,0.1,0,1,0.04,-0.96\n26.565051,0.71,0.09,1.34164079,0.4472136,0.02236068,-2.2137073\n26.565051,0.69,0.08,1.34164079,0.4472136,0.02236068,-2.2137073\n53.130102,0.66,0.04,3.6,0.2,0.05,-4.95\n270,0.66,0.08,0,1,0.04,-0.96\n303.690068,0.64,0.11,1.38675049,0.2773501,0.03605551,-3.56949576\n315,0.62,0.13,0.70710678,0.70710678,0.02828427,-1.38592929\n345.963757,0.58,0.14,0.9701425,0.24253563,0.04123106,-4.08187457\n0,0.54,0.14,0,1,0.04,-0.96\n33.690068,0.51,0.12,1.38675049,0.2773501,0.03605551,-3.56949576\n255.963757,0.52,0.16,0.9701425,0.24253563,0.04123106,-4.08187457\n281.309932,0.51,0.21,4.11843884,0.19611614,0.0509902,-5.04802932\n284.036243,0.5,0.25,3.15296313,0.24253563,0.04123106,-4.08187457\n296.565051,0.48,0.29,1.34164079,0.4472136,0.04472136,-2.19134662\n303.690068,0.46,0.32,1.38675049,0.2773501,0.03605551,-3.56949576\n180,0.5,0.32,0,1,0.04,-0.96\n180,0.53,0.32,0,1,0.03,-0.97\n213.690068,0.56,0.34,1.38675049,0.2773501,0.03605551,-3.56949576\n243.434949,0.57,0.36,0.89442719,0.4472136,0.02236068,-2.2137073\n251.565051,0.58,0.39,0.9486833,0.31622777,0.03162278,-3.13065488\n108.434949,0.59,0.36,2.21359436,0.31622777,0.03162278,-3.13065488\n135,0.61,0.34,0.70710678,0.70710678,0.02828427,-1.38592929\n153.434949,0.63,0.33,0.89442719,0.4472136,0.02236068,-2.2137073\n161.565051,0.66,0.32,0.9486833,0.31622777,0.03162278,-3.13065488\n180,0.69,0.32,0,1,0.03,-0.97\n198.434949,0.72,0.33,2.21359436,0.31622777,0.03162278,-3.13065488\n225,0.74,0.35,0.70710678,0.70710678,0.02828427,-1.38592929\n251.565051,0.75,0.38,0.9486833,0.31622777,0.03162278,-3.13065488\n108.434949,0.76,0.35,2.21359436,0.31622777,0.03162278,-3.13065488\n116.565051,0.78,0.31,1.34164079,0.4472136,0.04472136,-2.19134662\n135,0.81,0.28,0.70710678,0.70710678,0.04242641,-1.37178716\n161.565051,0.84,0.27,0.9486833,0.31622777,0.03162278,-3.13065488\n180,0.87,0.27,0,1,0.03,-0.97\n90,0.87,0.24,0,1,0.03,-0.97\n111.801409,0.89,0.19,2.22834406,0.18569534,0.05385165,-5.33131316\n126.869898,0.92,0.15,1.4,0.2,0.05,-4.95\n149.036243,0.97,0.12,2.22948161,0.17149859,0.05830952,-5.77264238\n338.587031,0.46,0.32,24.69817132,0.01825438,0.54781384,-54.23356986\n338.198591,0.8,0.69,3.15682075,0.18569534,0.05385165,-5.33131316\n323.972627,0.71,0.62,8.60201108,0.07352146,0.13601471,-13.4654558\n315,0.6,0.53,0.70710678,0.70710678,0.11313708,-1.30107648\n135,0.58,0.55,0.70710678,0.70710678,0.07071068,-1.34350288\n126.869898,0.68,0.65,1.4,0.2,0.1,-4.9\n105.945396,0.77,0.72,3.15929297,0.13736056,0.0728011,-7.20730879\n30.963757,0.87,0.8,3.60147029,0.17149859,0.05830952,-5.77264238\n14.036243,0.83,0.79,3.15296313,0.24253563,0.04123106,-4.08187457\n0,0.8,0.79,0,1,0.03,-0.97\n341.565051,0.77,0.8,0.9486833,0.31622777,0.03162278,-3.13065488\n333.434949,0.75,0.81,0.89442719,0.4472136,0.02236068,-2.2137073\n63.434949,0.74,0.79,0.89442719,0.4472136,0.02236068,-2.2137073\n45,0.72,0.77,0.70710678,0.70710678,0.02828427,-1.38592929\n33.690068,0.69,0.75,1.38675049,0.2773501,0.03605551,-3.56949576\n18.434949,0.66,0.74,2.21359436,0.31622777,0.03162278,-3.13065488\n0,0.63,0.74,0,1,0.03,-0.97\n341.565051,0.6,0.75,0.9486833,0.31622777,0.03162278,-3.13065488\n108.434949,0.61,0.72,2.21359436,0.31622777,0.03162278,-3.13065488\n90,0.61,0.69,0,1,0.03,-0.97\n75.963757,0.6,0.65,0.9701425,0.24253563,0.04123106,-4.08187457\n45,0.57,0.62,0.70710678,0.70710678,0.04242641,-1.37178716\n14.036243,0.53,0.61,3.15296313,0.24253563,0.04123106,-4.08187457\n0,0.5,0.61,0,1,0.03,-0.97\n126.869898,0.53,0.57,1.4,0.2,0.05,-4.95\n90,0.53,0.54,0,1,0.03,-0.97\n75.963757,0.52,0.5,0.9701425,0.24253563,0.04123106,-4.08187457\n56.309932,0.5,0.47,2.21880078,0.2773501,0.03605551,-3.56949576\n191.309932,0.55,0.48,4.11843884,0.19611614,0.0509902,-5.04802932\n168.690068,0.6,0.47,0.98058068,0.19611614,0.0509902,-5.04802932\n161.565051,0.66,0.45,0.9486833,0.31622777,0.06324555,-3.09903211\n143.130102,0.7,0.42,3.6,0.2,0.05,-4.95\n270,0.7,0.43,0,1,0.01,-0.99\n270,0.7,0.46,0,1,0.03,-0.97\n243.434949,0.72,0.5,0.89442719,0.4472136,0.04472136,-2.19134662\n213.690068,0.75,0.52,1.38675049,0.2773501,0.03605551,-3.56949576\n198.434949,0.78,0.53,2.21359436,0.31622777,0.03162278,-3.13065488\n180,0.82,0.53,0,1,0.04,-0.96\n146.309932,0.85,0.51,2.21880078,0.2773501,0.03605551,-3.56949576\n303.690068,0.83,0.54,1.38675049,0.2773501,0.03605551,-3.56949576\n270,0.83,0.57,0,1,0.03,-0.97\n270,0.83,0.61,0,1,0.04,-0.96\n243.434949,0.85,0.65,0.89442719,0.4472136,0.04472136,-2.19134662\n225,0.87,0.67,0.70710678,0.70710678,0.02828427,-1.38592929\n296.565051,0.86,0.69,1.34164079,0.4472136,0.02236068,-2.2137073\n270,0.86,0.71,0,1,0.02,-0.98\n255.963757,0.87,0.75,0.9701425,0.24253563,0.04123106,-4.08187457\n243.434949,0.89,0.79,0.89442719,0.4472136,0.04472136,-2.19134662\n233.130102,0.92,0.83,3.6,0.2,0.05,-4.95\n40.601295,0.5,0.47,1.41004798,0.10846523,0.55317267,-8.66637179\n195.945396,0.26,0.54,3.15929297,0.13736056,0.0728011,-7.20730879\n5.194429,0.29,0.55,10.04946781,0.09053575,0.11045361,-10.93490741\n19.983107,0.28,0.68,8.54357658,0.08543577,0.117047,-11.58765291\n185.710593,0.23,0.68,9.05483843,0.09950372,0.10049876,-9.94937686\n164.054604,0.22,0.79,4.12081692,0.13736056,0.0728011,-7.20730879\n45,0.27,0.79,0.70710678,0.70710678,0.05656854,-1.35764502\n90,0.21,0.92,0,1,0.04,-0.96\n75.963757,0.2,0.88,0.9701425,0.24253563,0.04123106,-4.08187457\n243.434949,0.31,0.47,0.89442719,0.4472136,0.04472136,-2.19134662\n236.309932,0.33,0.5,2.21880078,0.2773501,0.03605551,-3.56949576\n225,0.36,0.53,0.70710678,0.70710678,0.04242641,-1.37178716\n213.690068,0.39,0.55,1.38675049,0.2773501,0.03605551,-3.56949576\n189.462322,0.45,0.56,5.09636861,0.16439899,0.06082763,-6.0219349\n333.434949,0.43,0.57,0.89442719,0.4472136,0.02236068,-2.2137073\n326.309932,0.4,0.59,2.21880078,0.2773501,0.03605551,-3.56949576\n303.690068,0.38,0.62,1.38675049,0.2773501,0.03605551,-3.56949576\n270,0.38,0.66,0,1,0.04,-0.96\n251.565051,0.39,0.69,0.9486833,0.31622777,0.03162278,-3.13065488\n236.309932,0.41,0.72,2.21880078,0.2773501,0.03605551,-3.56949576\n213.690068,0.44,0.74,1.38675049,0.2773501,0.03605551,-3.56949576\n0,0.4,0.74,0,1,0.04,-0.96\n333.434949,0.36,0.76,0.89442719,0.4472136,0.04472136,-2.19134662\n306.869898,0.33,0.8,1.4,0.2,0.05,-4.95\n284.036243,0.32,0.84,3.15296313,0.24253563,0.04123106,-4.08187457\n341.565051,0.29,0.85,0.9486833,0.31622777,0.03162278,-3.13065488\n326.309932,0.26,0.87,2.21880078,0.2773501,0.03605551,-3.56949576\n303.690068,0.24,0.9,1.38675049,0.2773501,0.03605551,-3.56949576\n296.565051,0.21,0.96,1.34164079,0.4472136,0.06708204,-2.16898594\n56.309932,0.18,0.85,2.21880078,0.2773501,0.03605551,-3.56949576\n45,0.16,0.83,0.70710678,0.70710678,0.02828427,-1.38592929\n33.690068,0.13,0.81,1.38675049,0.2773501,0.03605551,-3.56949576\n116.565051,0.14,0.79,1.34164079,0.4472136,0.02236068,-2.2137073\n108.434949,0.15,0.76,2.21359436,0.31622777,0.03162278,-3.13065488\n90,0.15,0.72,0,1,0.04,-0.96\n63.434949,0.13,0.68,0.89442719,0.4472136,0.04472136,-2.19134662\n33.690068,0.1,0.66,1.38675049,0.2773501,0.03605551,-3.56949576\n165.963757,0.14,0.65,0.9701425,0.24253563,0.04123106,-4.08187457\n143.130102,0.18,0.62,3.6,0.2,0.05,-4.95\n116.565051,0.2,0.58,1.34164079,0.4472136,0.04472136,-2.19134662\n75.963757,0.19,0.54,0.9701425,0.24253563,0.04123106,-4.08187457\n63.434949,0.17,0.5,0.89442719,0.4472136,0.04472136,-2.19134662\n180,0.21,0.5,0,1,0.04,-0.96\n165.963757,0.25,0.49,0.9701425,0.24253563,0.04123106,-4.08187457\n135,0.27,0.47,0.70710678,0.70710678,0.02828427,-1.38592929\n116.565051,0.29,0.43,1.34164079,0.4472136,0.04472136,-2.19134662\n278.583621,0.21,0.96,33.37663332,0.01865659,0.53600373,-53.0643694\n104.036243,0.3,0.2,3.15296313,0.24253563,0.04123106,-4.08187457\n123.690068,0.32,0.17,1.38675049,0.2773501,0.03605551,-3.56949576\n153.434949,0.36,0.15,0.89442719,0.4472136,0.04472136,-2.19134662\n180,0.39,0.15,0,1,0.03,-0.97\n206.565051,0.43,0.17,1.34164079,0.4472136,0.04472136,-2.19134662\n236.309932,0.45,0.2,2.21880078,0.2773501,0.03605551,-3.56949576\n255.963757,0.46,0.24,0.9701425,0.24253563,0.04123106,-4.08187457\n288.434949,0.45,0.27,2.21359436,0.31622777,0.03162278,-3.13065488\n303.690068,0.43,0.3,1.38675049,0.2773501,0.03605551,-3.56949576\n333.434949,0.39,0.32,0.89442719,0.4472136,0.04472136,-2.19134662\n0,0.36,0.32,0,1,0.03,-0.97\n26.565051,0.32,0.3,1.34164079,0.4472136,0.04472136,-2.19134662\n56.309932,0.3,0.27,2.21880078,0.2773501,0.03605551,-3.56949576\n71.565051,0.29,0.24,0.9486833,0.31622777,0.03162278,-3.13065488\n104.036243,0.16,0.31,3.15296313,0.24253563,0.04123106,-4.08187457\n123.690068,0.18,0.28,1.38675049,0.2773501,0.03605551,-3.56949576\n153.434949,0.22,0.26,0.89442719,0.4472136,0.04472136,-2.19134662\n180,0.25,0.26,0,1,0.03,-0.97\n206.565051,0.29,0.28,1.34164079,0.4472136,0.04472136,-2.19134662\n236.309932,0.31,0.31,2.21880078,0.2773501,0.03605551,-3.56949576\n255.963757,0.32,0.35,0.9701425,0.24253563,0.04123106,-4.08187457\n288.434949,0.31,0.38,2.21359436,0.31622777,0.03162278,-3.13065488\n303.690068,0.29,0.41,1.38675049,0.2773501,0.03605551,-3.56949576\n333.434949,0.25,0.43,0.89442719,0.4472136,0.04472136,-2.19134662\n0,0.22,0.43,0,1,0.03,-0.97\n26.565051,0.18,0.41,1.34164079,0.4472136,0.04472136,-2.19134662\n56.309932,0.16,0.38,2.21880078,0.2773501,0.03605551,-3.56949576\n71.565051,0.15,0.35,0.9486833,0.31622777,0.03162278,-3.13065488\n104.036243,0.34,0.38,3.15296313,0.24253563,0.04123106,-4.08187457\n123.690068,0.36,0.35,1.38675049,0.2773501,0.03605551,-3.56949576\n153.434949,0.4,0.33,0.89442719,0.4472136,0.04472136,-2.19134662\n180,0.43,0.33,0,1,0.03,-0.97\n206.565051,0.47,0.35,1.34164079,0.4472136,0.04472136,-2.19134662\n236.309932,0.49,0.38,2.21880078,0.2773501,0.03605551,-3.56949576\n255.963757,0.5,0.42,0.9701425,0.24253563,0.04123106,-4.08187457\n288.434949,0.49,0.45,2.21359436,0.31622777,0.03162278,-3.13065488\n303.690068,0.47,0.48,1.38675049,0.2773501,0.03605551,-3.56949576\n333.434949,0.43,0.5,0.89442719,0.4472136,0.04472136,-2.19134662\n0,0.4,0.5,0,1,0.03,-0.97\n26.565051,0.36,0.48,1.34164079,0.4472136,0.04472136,-2.19134662\n56.309932,0.34,0.45,2.21880078,0.2773501,0.03605551,-3.56949576\n71.565051,0.33,0.42,0.9486833,0.31622777,0.03162278,-3.13065488\n"),!1),N(O.ParsePatFile("\n*HONEY,HONEY\n0, 0,0, .1875,.10825317, .125,-.25\n120, 0,0, .1875,.10825317, .125,-.25\n60, 0,0, .1875,.10825317, -.25,.125\n"),!1),N(O.ParsePatFile("\n*HOUND,HOUND\n0, 0,0, .25,.0625, 1,-.5\n90, 0,0, -.25,.0625, 1,-.5\n"),!1),N(O.ParsePatFile("\n*INSUL,INSUL\n0, 0,0, 0,.375\n0, 0,.125, 0,.375, .125,-.125\n0, 0,.25, 0,.375, .125,-.125\n"),!1),N(O.ParsePatFile("\n*LATTICE-01,LATTICE-01 verbose\n;By John Hyslop, Tile2Hatch tool \xa9 CVH 2020\n;Developed in inch as imperial QCAD3 pattern\n180,0.08514719,0.4,0,1,0.17029438,-0.82970562\n270,0.6,0.08514719,1,1,0.17029438,-0.82970562\n270,0.4,0.08514719,1,1,0.17029438,-0.82970562\n135,0.5,0.2679899,0.70710678,0.70710678,0.32811183,-1.08610173\n225,0.7320101,0.5,0.70710678,0.70710678,0.32811183,-1.08610173\n45,0.08514719,0.6,0.70710678,0.70710678,0.44526911,-0.96894445\n180,0.08514719,0.6,0,1,0.17029438,-0.82970562\n315,0.5,0.7320101,0.70710678,0.70710678,0.32811183,-1.08610173\n45,0.2679899,0.5,0.70710678,0.70710678,0.32811183,-1.08610173\n315,0.6,0.91485281,0.70710678,0.70710678,0.44526911,-0.96894445\n45,0.6,0.08514719,0.70710678,0.70710678,0.44526911,-0.96894445\n315,0.08514719,0.4,0.70710678,0.70710678,0.44526911,-0.96894445\n"),!1),N(O.ParsePatFile("\n*LATTICE-02,LATTICE-02 verbose\n;By John Hyslop, Tile2Hatch tool \xa9 CVH 2020\n;Developed in inch as imperial QCAD3 pattern\n180,0.38333333,0.38333333,0,1,0.76666666,-0.23333334\n270,0.61666667,1,1,1,1;,0 Removed 0 IT RENDERS A POINT\n180,0.38333333,0.61666667,0,1,0.76666666,-0.23333334\n270,0.38333333,1,1,1,1,;0 Removed 0 IT RENDERS A POINT\n"),!1),N(O.ParsePatFile("\n*LATTICE-03,LATTICE-03 verbose\n;By John Hyslop, Tile2Hatch tool \xa9 CVH 2020\n;Developed in inch as imperial QCAD3 pattern\n180,0.38333333,0.38333333,0,1,0.76666666,-0.23333334\n180,0.38333333,0.61666667,0,1,0.76666666,-0.23333334\n270,0.61666667,0.38333333,1,1,0.76666666,-0.23333334\n270,0.38333333,0.38333333,1,1,0.76666666,-0.23333334\n"),!1),N(O.ParsePatFile("\n*LATTICE-04,LATTICE-04 verbose\n;By John Hyslop, Tile2Hatch tool \xa9 CVH 2020\n;Developed in inch as imperial QCAD3 pattern\n296.565051,0.15333333,0.46,1.34164079,0.4472136,1.13294111,-1.10312687\n296.565051,0.34000001,0.55333333,1.34164079,0.4472136,1.13294111,-1.10312687\n206.565051,0.46,0.84666667,1.34164079,0.4472136,1.13294111,-1.10312687\n206.565051,0.55333333,0.65999999,1.34164079,0.4472136,1.13294111,-1.10312687\n"),!1),N(O.ParsePatFile("\n*LATTICE-05,LATTICE-05\n;By John Hyslop\n;Developed in inch as imperial QCAD3 pattern\n0,0.775,0.075,0,1,0.15,-0.85\n180,0.225,0.925,0,1,0.15,-0.85\n180,0.625,0.225,0,1,0.4,-0.6\n180,0.625,0.075,0,1,0.55,-0.45\n270,0.625,0.225,0,1,0.15,-0.85\n270,0.775,0.775,0,1,0.7,-0.3\n270,0.925,0.925,0,1,0.85,-0.15\n0,0.375,0.775,0,1,0.4,-0.6\n0,0.375,0.925,0,1,0.55,-0.45\n90,0.375,0.775,0,1,0.15,-0.85\n90,0.225,0.225,0,1,0.7,-0.3\n90,0.075,0.075,0,1,0.85,-0.15\n"),!1),N(O.ParsePatFile("\n*LATTICE-06,LATTICE-06\n;By John Hyslop\n;Developed in inch as imperial QCAD3 pattern\n180,0.625,0.375,0,1,0.25,-0.75\n270,0.625,0.625,0,1,0.25,-0.75\n0,0.375,0.625,0,1,0.25,-0.75\n90,0.375,0.375,0,1,0.25,-0.75\n0,0.775,0.075,0,1,0.15,-0.85\n180,0.225,0.925,0,1,0.15,-0.85\n180,0.625,0.225,0,1,0.4,-0.6\n180,0.625,0.075,0,1,0.55,-0.45\n270,0.625,0.225,0,1,0.15,-0.85\n270,0.775,0.775,0,1,0.7,-0.3\n270,0.925,0.925,0,1,0.85,-0.15\n0,0.375,0.775,0,1,0.4,-0.6\n0,0.375,0.925,0,1,0.55,-0.45\n90,0.375,0.775,0,1,0.15,-0.85\n90,0.225,0.225,0,1,0.7,-0.3\n90,0.075,0.075,0,1,0.85,-0.15\n"),!1),N(O.ParsePatFile("\n*LATTICE-07, verbose comment\n;By John Hyslop, Tile2Hatch tool \xa9 CVH 2020\n;Developed in inch as imperial QCAD3 pattern\n270,0.69166667,0.69166666,1,1,0.88333333,-0.11666667\n270,0.80833334,0.69166666,1,1,0.88333333,-0.11666667\n270,0.19166666,0.19166667,1,1,0.88333333,-0.11666667\n270,0.30833333,0.19166667,1,1,0.88333333,-0.11666667\n180,0.69166667,0.30833333,0,1,0.88333333,-0.11666667\n180,0.69166667,0.19166666,0,1,0.88333333,-0.11666667\n180,0.19166667,0.80833334,0,1,0.88333333,-0.11666667\n180,0.19166667,0.69166667,0,1,0.88333333,-0.11666667\n"),!1),N(O.ParsePatFile("\n*LEAF-01,LEAF-01\n;By John Hyslop, Using AutoCAD Lisp Tool\n;Developed in inch as imperial QCAD3 pattern\n83.659808,0.9,0.2,0.99388373,0.11043153,0.09055385,-8.96483129\n26.565051,0.88,0.19,1.34164079,0.4472136,0.02236068,-2.2137073\n14.036243,0.84,0.18,3.15296313,0.24253563,0.04123106,-4.08187457\n315,0.84,0.18,0.70710678,0.70710678,0.05656854,-1.35764502\n83.659808,0.84,0.18,0.99388373,0.11043153,0.09055385,-8.96483129\n0,0.79,0.18,0,1,0.05,-0.95\n345.963757,0.82,0.12,0.9701425,0.24253563,0.04123106,-4.08187457\n326.309932,0.79,0.14,2.21880078,0.2773501,0.03605551,-3.56949576\n303.690068,0.77,0.17,1.38675049,0.2773501,0.03605551,-3.56949576\n18.434949,0.74,0.16,2.21359436,0.31622777,0.03162278,-3.13065488\n288.434949,0.73,0.19,2.21359436,0.31622777,0.03162278,-3.13065488\n180,0.77,0.19,0,1,0.04,-0.96\n258.690068,0.78,0.24,0.98058068,0.19611614,0.0509902,-5.04802932\n243.434949,0.79,0.26,0.89442719,0.4472136,0.02236068,-2.2137073\n225,0.82,0.29,0.70710678,0.70710678,0.04242641,-1.37178716\n213.690068,0.85,0.31,1.38675049,0.2773501,0.03605551,-3.56949576\n191.309932,0.9,0.32,4.11843884,0.19611614,0.0509902,-5.04802932\n128.659808,0.3,0.42,1.40556386,0.15617376,0.06403124,-6.339093\n143.130102,0.34,0.39,3.6,0.2,0.05,-4.95\n153.434949,0.38,0.37,0.89442719,0.4472136,0.04472136,-2.19134662\n192.528808,0.38,0.37,4.1216787,0.10846523,0.09219544,-9.12734901\n105.945396,0.38,0.37,3.15929297,0.13736056,0.0728011,-7.20730879\n153.434949,0.42,0.35,0.89442719,0.4472136,0.04472136,-2.19134662\n149.036243,0.47,0.32,2.22948161,0.17149859,0.05830952,-5.77264238\n95.710593,0.47,0.32,9.05483843,0.09950372,0.10049876,-9.94937686\n194.931417,0.47,0.32,11.40157229,0.06441566,0.15524175,-15.36893295\n135,0.51,0.28,0.70710678,0.70710678,0.05656854,-1.35764502\n123.690068,0.53,0.25,1.38675049,0.2773501,0.03605551,-3.56949576\n199.653824,0.53,0.25,11.70450662,0.06726728,0.14866069,-14.71740806\n71.565051,0.53,0.25,0.9486833,0.31622777,0.09486833,-3.06740933\n119.054604,0.58,0.16,8.06167266,0.09712859,0.1029563,-10.19267384\n288.434949,0.58,0.14,2.21359436,0.31622777,0.06324555,-3.09903211\n21.801409,0.53,0.12,2.22834406,0.18569534,0.05385165,-5.33131316\n11.309932,0.48,0.11,4.11843884,0.19611614,0.0509902,-5.04802932\n0,0.45,0.11,0,1,0.03,-0.97\n341.565051,0.39,0.13,0.9486833,0.31622777,0.06324555,-3.09903211\n326.309932,0.33,0.17,2.21880078,0.2773501,0.07211103,-3.53344025\n308.659808,0.29,0.22,1.40556386,0.15617376,0.06403124,-6.339093\n300.963757,0.26,0.27,3.60147029,0.17149859,0.05830952,-5.77264238\n285.945396,0.24,0.34,3.15929297,0.13736056,0.0728011,-7.20730879\n270,0.24,0.41,0,1,0.07,-0.93\n279.462322,0.23,0.47,5.09636861,0.16439899,0.06082763,-6.0219349\n285.945396,0.21,0.54,3.15929297,0.13736056,0.0728011,-7.20730879\n123.690068,0.23,0.51,1.38675049,0.2773501,0.03605551,-3.56949576\n161.565051,0.26,0.5,0.9486833,0.31622777,0.03162278,-3.13065488\n171.869898,0.33,0.49,0.98994949,0.14142136,0.07071068,-7.00035713\n171.869898,0.4,0.48,0.98994949,0.14142136,0.07071068,-7.00035713\n161.565051,0.46,0.46,0.9486833,0.31622777,0.06324555,-3.09903211\n161.565051,0.52,0.44,0.9486833,0.31622777,0.06324555,-3.09903211\n146.309932,0.58,0.4,2.21880078,0.2773501,0.07211103,-3.53344025\n119.744881,0.62,0.33,5.82963253,0.12403473,0.08062258,-7.98163517\n111.801409,0.64,0.28,2.22834406,0.18569534,0.05385165,-5.33131316\n90,0.64,0.24,0,1,0.04,-0.96\n75.963757,0.63,0.2,0.9701425,0.24253563,0.04123106,-4.08187457\n56.309932,0.61,0.17,2.21880078,0.2773501,0.03605551,-3.56949576\n63.434949,0.6,0.15,0.89442719,0.4472136,0.02236068,-2.2137073\n126.869898,0.63,0.11,1.4,0.2,0.05,-4.95\n45,0.6,0.08,0.70710678,0.70710678,0.04242641,-1.37178716\n233.130102,0.89,0.04,3.6,0.2,0.05,-4.95\n258.690068,0.07,0.05,0.98058068,0.19611614,0.0509902,-5.04802932\n258.690068,0.14,0.05,0.98058068,0.19611614,0.0509902,-5.04802932\n198.434949,0.26,0.02,2.21359436,0.31622777,0.06324555,-3.09903211\n225,0.31,0.02,0.70710678,0.70710678,0.02828427,-1.38592929\n198.434949,0.34,0.03,2.21359436,0.31622777,0.03162278,-3.13065488\n348.690068,0.29,0.04,0.98058068,0.19611614,0.0509902,-5.04802932\n345.963757,0.25,0.05,0.9701425,0.24253563,0.04123106,-4.08187457\n333.434949,0.21,0.07,0.89442719,0.4472136,0.04472136,-2.19134662\n333.434949,0.15,0.1,0.89442719,0.4472136,0.06708204,-2.16898594\n348.690068,0.1,0.11,0.98058068,0.19611614,0.0509902,-5.04802932\n0,0.07,0.11,0,1,0.03,-0.97\n8.130102,0,0.1,6.08111832,0.14142136,0.07071068,-7.00035713\n236.309932,0.02,0.23,2.21880078,0.2773501,0.03605551,-3.56949576\n236.309932,0.04,0.26,2.21880078,0.2773501,0.03605551,-3.56949576\n213.690068,0.07,0.28,1.38675049,0.2773501,0.03605551,-3.56949576\n0,0.03,0.28,0,1,0.04,-0.96\n326.309932,0,0.3,2.21880078,0.2773501,0.03605551,-3.56949576\n18.434949,0,0.26,2.21359436,0.31622777,0.03162278,-3.13065488\n0,0,0.55,0,1,0.07,-0.93\n14.036243,0.1,0.61,3.15296313,0.24253563,0.04123106,-4.08187457\n21.801409,0.05,0.59,2.22834406,0.18569534,0.05385165,-5.33131316\n30.963757,0,0.56,3.60147029,0.17149859,0.05830952,-5.77264238\n254.054604,0.02,0.66,4.12081692,0.13736056,0.0728011,-7.20730879\n158.198591,0.05,0.69,3.15682075,0.18569534,0.05385165,-5.33131316\n153.434949,0.11,0.66,0.89442719,0.4472136,0.06708204,-2.16898594\n158.198591,0.16,0.64,3.15682075,0.18569534,0.05385165,-5.33131316\n180,0.21,0.64,0,1,0.05,-0.95\n33.690068,0.18,0.62,1.38675049,0.2773501,0.03605551,-3.56949576\n45,0.16,0.6,0.70710678,0.70710678,0.02828427,-1.38592929\n53.130102,0.13,0.56,3.6,0.2,0.05,-4.95\n56.309932,0.09,0.5,2.21880078,0.2773501,0.07211103,-3.53344025\n51.340192,0.05,0.45,4.99756038,0.15617376,0.06403124,-6.339093\n38.659808,0,0.41,1.40556386,0.15617376,0.06403124,-6.339093\n180,0.82,0.48,0,1,0.1,-0.9\n310.601295,0.82,0.48,1.41004798,0.10846523,0.09219544,-9.12734901\n82.405357,0.82,0.48,8.06198693,0.06608186,0.15132746,-14.98141849\n180,0.84,0.48,0,1,0.02,-0.98\n194.036243,0.88,0.49,3.15296313,0.24253563,0.04123106,-4.08187457\n198.434949,0.91,0.5,2.21359436,0.31622777,0.03162278,-3.13065488\n0,0.83,0.37,0,1,0.08,-0.92\n348.690068,0.78,0.38,0.98058068,0.19611614,0.0509902,-5.04802932\n321.340192,0.73,0.42,4.99756038,0.15617376,0.06403124,-6.339093\n300.963757,0.7,0.47,3.60147029,0.17149859,0.05830952,-5.77264238\n21.801409,0.65,0.45,2.22834406,0.18569534,0.05385165,-5.33131316\n284.036243,0.64,0.49,3.15296313,0.24253563,0.04123106,-4.08187457\n180,0.7,0.49,0,1,0.06,-0.94\n261.869898,0.71,0.56,0.98994949,0.14142136,0.07071068,-7.00035713\n248.198591,0.73,0.61,3.15682075,0.18569534,0.05385165,-5.33131316\n225,0.77,0.65,0.70710678,0.70710678,0.05656854,-1.35764502\n216.869898,0.81,0.68,1.4,0.2,0.05,-4.95\n198.434949,0.9,0.71,2.21359436,0.31622777,0.09486833,-3.06740933\n153.434949,0.36,0.65,0.89442719,0.4472136,0.06708204,-2.16898594\n170.537678,0.42,0.64,0.98639392,0.16439899,0.06082763,-6.0219349\n188.130102,0.49,0.65,6.08111832,0.14142136,0.07071068,-7.00035713\n201.801409,0.54,0.67,2.22834406,0.18569534,0.05385165,-5.33131316\n219.805571,0.6,0.72,1.40840568,0.12803688,0.0781025,-7.73214718\n18.434949,0.97,0.25,2.21359436,0.31622777,0.03162278,-3.13065488\n33.690068,0.94,0.23,1.38675049,0.2773501,0.03605551,-3.56949576\n0,0.94,0.23,0,1,0.04,-0.96\n80.537678,0.94,0.23,0.98639392,0.16439899,0.06082763,-6.0219349\n36.869898,0.9,0.2,1.4,0.2,0.05,-4.95\n341.565051,0.9,0.2,0.9486833,0.31622777,0.06324555,-3.09903211\n53.130102,0.97,0.16,3.6,0.2,0.05,-4.95\n38.659808,0.92,0.12,1.40556386,0.15617376,0.06403124,-6.339093\n9.462322,0.86,0.11,5.09636861,0.16439899,0.06082763,-6.0219349\n180,0.95,0.32,0,1,0.05,-0.95\n158.198591,1,0.3,3.15682075,0.18569534,0.05385165,-5.33131316\n216.869898,0.93,0.07,1.4,0.2,0.05,-4.95\n206.565051,0.97,0.09,1.34164079,0.4472136,0.04472136,-2.19134662\n198.434949,1,0.1,2.21359436,0.31622777,0.03162278,-3.13065488\n90,0.97,0,0,1,0.02,-0.98\n26.565051,0.96,0.53,1.34164079,0.4472136,0.04472136,-2.19134662\n56.309932,0.96,0.53,2.21880078,0.2773501,0.07211103,-3.53344025\n36.869898,0.96,0.53,1.4,0.2,0.05,-4.95\n30.963757,0.91,0.5,3.60147029,0.17149859,0.05830952,-5.77264238\n78.690068,0.91,0.5,0.98058068,0.19611614,0.15297059,-4.94604893\n156.037511,1,0.46,7.61509624,0.10153462,0.09848858,-9.75036922\n30.963757,0.95,0.38,3.60147029,0.17149859,0.05830952,-5.77264238\n14.036243,0.91,0.37,3.15296313,0.24253563,0.04123106,-4.08187457\n180,1,0.71,0,1,0.1,-0.9\n0,0.86,0.87,0,1,0.09,-0.91\n11.309932,0.95,0.87,4.11843884,0.19611614,0.0509902,-5.04802932\n135,1,0.82,0.70710678,0.70710678,0.07071068,-1.34350288\n0,0.96,0.76,0,1,0.04,-0.96\n345.963757,0.92,0.77,0.9701425,0.24253563,0.04123106,-4.08187457\n333.434949,0.88,0.79,0.89442719,0.4472136,0.04472136,-2.19134662\n315,0.86,0.81,0.70710678,0.70710678,0.02828427,-1.38592929\n306.869898,0.83,0.85,1.4,0.2,0.05,-4.95\n11.309932,0.78,0.84,4.11843884,0.19611614,0.0509902,-5.04802932\n284.036243,0.77,0.88,3.15296313,0.24253563,0.04123106,-4.08187457\n180,0.83,0.88,0,1,0.06,-0.94\n14.036243,0.65,0.89,3.15296313,0.24253563,0.04123106,-4.08187457\n18.434949,0.62,0.88,2.21359436,0.31622777,0.03162278,-3.13065488\n33.690068,0.59,0.86,1.38675049,0.2773501,0.03605551,-3.56949576\n230.194429,0.65,0.78,6.401844,0.12803688,0.0781025,-7.73214718\n239.036243,0.68,0.83,2.22948161,0.17149859,0.05830952,-5.77264238\n236.309932,0.72,0.89,2.21880078,0.2773501,0.07211103,-3.53344025\n213.690068,0.75,0.91,1.38675049,0.2773501,0.03605551,-3.56949576\n198.434949,0.78,0.92,2.21359436,0.31622777,0.03162278,-3.13065488\n0,0.74,0.92,0,1,0.04,-0.96\n345.963757,0.7,0.93,0.9701425,0.24253563,0.04123106,-4.08187457\n261.869898,0.84,0.95,0.98994949,0.14142136,0.07071068,-7.00035713\n248.198591,0.86,1,3.15682075,0.18569534,0.05385165,-5.33131316\n36.869898,0.55,0.83,1.4,0.2,0.05,-4.95\n0,0.55,0.83,0,1,0.08,-0.92\n78.690068,0.55,0.83,0.98058068,0.19611614,0.10198039,-4.99703912\n33.690068,0.52,0.81,1.38675049,0.2773501,0.03605551,-3.56949576\n30.963757,0.47,0.78,3.60147029,0.17149859,0.05830952,-5.77264238\n336.037511,0.47,0.78,7.61509624,0.10153462,0.09848858,-9.75036922\n79.380345,0.47,0.78,11.18017113,0.06142951,0.16278821,-16.11603239\n26.565051,0.43,0.76,1.34164079,0.4472136,0.04472136,-2.19134662\n9.462322,0.37,0.75,5.09636861,0.16439899,0.06082763,-6.0219349\n318.814075,0.37,0.75,9.21906451,0.09407209,0.10630146,-10.52384435\n82.405357,0.37,0.75,8.06198693,0.06608186,0.15132746,-14.98141849\n0,0.33,0.75,0,1,0.04,-0.96\n0,0.29,0.75,0,1,0.04,-0.96\n0,0.2,0.76,0,1,0.06,-0.94\n104.036243,0.21,0.72,3.15296313,0.24253563,0.04123106,-4.08187457\n201.801409,0.26,0.74,2.22834406,0.18569534,0.05385165,-5.33131316\n123.690068,0.3,0.68,1.38675049,0.2773501,0.07211103,-3.53344025\n338.198591,0.65,0.95,3.15682075,0.18569534,0.05385165,-5.33131316\n333.434949,0.59,0.98,0.89442719,0.4472136,0.06708204,-2.16898594\n348.690068,0.54,0.99,0.98058068,0.19611614,0.0509902,-5.04802932\n0,0.46,0.99,0,1,0.08,-0.92\n18.434949,0.4,0.97,2.21359436,0.31622777,0.06324555,-3.09903211\n26.565051,0.34,0.94,1.34164079,0.4472136,0.06708204,-2.16898594\n45,0.29,0.89,0.70710678,0.70710678,0.07071068,-1.34350288\n71.565051,0.27,0.83,0.9486833,0.31622777,0.06324555,-3.09903211\n81.869898,0.26,0.76,0.98994949,0.14142136,0.07071068,-7.00035713\n;0,0.2,0.76,0,1,0.06,-0.94\n315,0,0.82,0.70710678,0.70710678,0.02828427,-1.38592929\n198.434949,0.03,0.89,2.21359436,0.31622777,0.03162278,-3.13065488\n343.300756,0.03,0.89,7.27947977,0.09578263,0.10440307,-10.33590344\n74.744881,0.03,0.89,4.12217269,0.0877058,0.11401754,-11.28773671\n206.565051,0.05,0.9,1.34164079,0.4472136,0.02236068,-2.2137073\n213.690068,0.08,0.92,1.38675049,0.2773501,0.03605551,-3.56949576\n216.869898,0.12,0.95,1.4,0.2,0.05,-4.95\n352.874984,0.12,0.95,0.99227788,0.12403473,0.08062258,-7.98163517\n78.690068,0.12,0.95,0.98058068,0.19611614,0.0509902,-5.04802932\n213.690068,0.15,0.97,1.38675049,0.2773501,0.03605551,-3.56949576\n213.690068,0.18,0.99,1.38675049,0.2773501,0.03605551,-3.56949576\n206.565051,0.2,1,1.34164079,0.4472136,0.02236068,-2.2137073\n45,0.28,0.99,0.70710678,0.70710678,0.01414214,-1.40007143\n56.309932,0.26,0.96,2.21880078,0.2773501,0.03605551,-3.56949576\n56.309932,0.22,0.9,2.21880078,0.2773501,0.07211103,-3.53344025\n53.130102,0.19,0.86,3.6,0.2,0.05,-4.95\n45,0.14,0.81,0.70710678,0.70710678,0.07071068,-1.34350288\n36.869898,0.1,0.78,1.4,0.2,0.05,-4.95\n18.434949,0.04,0.76,2.21359436,0.31622777,0.06324555,-3.09903211\n0,0,0.76,0,1,0.04,-0.96\n81.253838,0.95,0.87,7.07065907,0.07602859,0.13152946,-13.02141697\n"),!1),N(O.ParsePatFile("\n*LEAF-02,LEAF-02\n;By John Hyslop, Using AutoCAD Lisp Tool\n;Developed in inch as imperial QCAD3 pattern\n303.690068,0.77,0.17,1.38675049,0.2773501,0.03605551,-3.56949576\n18.434949,0.74,0.16,2.21359436,0.31622777,0.03162278,-3.13065488\n288.434949,0.73,0.19,2.21359436,0.31622777,0.03162278,-3.13065488\n180,0.77,0.19,0,1,0.04,-0.96\n258.690068,0.78,0.24,0.98058068,0.19611614,0.0509902,-5.04802932\n243.434949,0.79,0.26,0.89442719,0.4472136,0.02236068,-2.2137073\n288.434949,0.58,0.14,2.21359436,0.31622777,0.06324555,-3.09903211\n21.801409,0.53,0.12,2.22834406,0.18569534,0.05385165,-5.33131316\n11.309932,0.48,0.11,4.11843884,0.19611614,0.0509902,-5.04802932\n0,0.45,0.11,0,1,0.03,-0.97\n341.565051,0.39,0.13,0.9486833,0.31622777,0.06324555,-3.09903211\n326.309932,0.33,0.17,2.21880078,0.2773501,0.07211103,-3.53344025\n308.659808,0.29,0.22,1.40556386,0.15617376,0.06403124,-6.339093\n300.963757,0.26,0.27,3.60147029,0.17149859,0.05830952,-5.77264238\n285.945396,0.24,0.34,3.15929297,0.13736056,0.0728011,-7.20730879\n270,0.24,0.41,0,1,0.07,-0.93\n279.462322,0.23,0.47,5.09636861,0.16439899,0.06082763,-6.0219349\n285.945396,0.21,0.54,3.15929297,0.13736056,0.0728011,-7.20730879\n123.690068,0.23,0.51,1.38675049,0.2773501,0.03605551,-3.56949576\n161.565051,0.26,0.5,0.9486833,0.31622777,0.03162278,-3.13065488\n171.869898,0.33,0.49,0.98994949,0.14142136,0.07071068,-7.00035713\n171.869898,0.4,0.48,0.98994949,0.14142136,0.07071068,-7.00035713\n161.565051,0.46,0.46,0.9486833,0.31622777,0.06324555,-3.09903211\n161.565051,0.52,0.44,0.9486833,0.31622777,0.06324555,-3.09903211\n146.309932,0.58,0.4,2.21880078,0.2773501,0.07211103,-3.53344025\n119.744881,0.62,0.33,5.82963253,0.12403473,0.08062258,-7.98163517\n111.801409,0.64,0.28,2.22834406,0.18569534,0.05385165,-5.33131316\n90,0.64,0.24,0,1,0.04,-0.96\n75.963757,0.63,0.2,0.9701425,0.24253563,0.04123106,-4.08187457\n56.309932,0.61,0.17,2.21880078,0.2773501,0.03605551,-3.56949576\n63.434949,0.6,0.15,0.89442719,0.4472136,0.02236068,-2.2137073\n126.869898,0.63,0.11,1.4,0.2,0.05,-4.95\n45,0.6,0.08,0.70710678,0.70710678,0.04242641,-1.37178716\n225,0.31,0.02,0.70710678,0.70710678,0.02828427,-1.38592929\n198.434949,0.34,0.03,2.21359436,0.31622777,0.03162278,-3.13065488\n348.690068,0.29,0.04,0.98058068,0.19611614,0.0509902,-5.04802932\n345.963757,0.25,0.05,0.9701425,0.24253563,0.04123106,-4.08187457\n333.434949,0.21,0.07,0.89442719,0.4472136,0.04472136,-2.19134662\n333.434949,0.15,0.1,0.89442719,0.4472136,0.06708204,-2.16898594\n348.690068,0.1,0.11,0.98058068,0.19611614,0.0509902,-5.04802932\n0,0.07,0.11,0,1,0.03,-0.97\n8.130102,0,0.1,6.08111832,0.14142136,0.07071068,-7.00035713\n236.309932,0.02,0.23,2.21880078,0.2773501,0.03605551,-3.56949576\n236.309932,0.04,0.26,2.21880078,0.2773501,0.03605551,-3.56949576\n213.690068,0.07,0.28,1.38675049,0.2773501,0.03605551,-3.56949576\n0,0.03,0.28,0,1,0.04,-0.96\n326.309932,0,0.3,2.21880078,0.2773501,0.03605551,-3.56949576\n158.198591,0.05,0.69,3.15682075,0.18569534,0.05385165,-5.33131316\n153.434949,0.11,0.66,0.89442719,0.4472136,0.06708204,-2.16898594\n158.198591,0.16,0.64,3.15682075,0.18569534,0.05385165,-5.33131316\n180,0.21,0.64,0,1,0.05,-0.95\n33.690068,0.18,0.62,1.38675049,0.2773501,0.03605551,-3.56949576\n45,0.16,0.6,0.70710678,0.70710678,0.02828427,-1.38592929\n53.130102,0.13,0.56,3.6,0.2,0.05,-4.95\n56.309932,0.09,0.5,2.21880078,0.2773501,0.07211103,-3.53344025\n51.340192,0.05,0.45,4.99756038,0.15617376,0.06403124,-6.339093\n38.659808,0,0.41,1.40556386,0.15617376,0.06403124,-6.339093\n321.340192,0.73,0.42,4.99756038,0.15617376,0.06403124,-6.339093\n300.963757,0.7,0.47,3.60147029,0.17149859,0.05830952,-5.77264238\n21.801409,0.65,0.45,2.22834406,0.18569534,0.05385165,-5.33131316\n284.036243,0.64,0.49,3.15296313,0.24253563,0.04123106,-4.08187457\n180,0.7,0.49,0,1,0.06,-0.94\n261.869898,0.71,0.56,0.98994949,0.14142136,0.07071068,-7.00035713\n248.198591,0.73,0.61,3.15682075,0.18569534,0.05385165,-5.33131316\n225,0.77,0.65,0.70710678,0.70710678,0.05656854,-1.35764502\n284.036243,0.77,0.88,3.15296313,0.24253563,0.04123106,-4.08187457\n0,0.2,0.76,0,1,0.06,-0.94\n104.036243,0.21,0.72,3.15296313,0.24253563,0.04123106,-4.08187457\n201.801409,0.26,0.74,2.22834406,0.18569534,0.05385165,-5.33131316\n123.690068,0.3,0.68,1.38675049,0.2773501,0.07211103,-3.53344025\n153.434949,0.36,0.65,0.89442719,0.4472136,0.06708204,-2.16898594\n170.537678,0.42,0.64,0.98639392,0.16439899,0.06082763,-6.0219349\n188.130102,0.49,0.65,6.08111832,0.14142136,0.07071068,-7.00035713\n201.801409,0.54,0.67,2.22834406,0.18569534,0.05385165,-5.33131316\n219.805571,0.6,0.72,1.40840568,0.12803688,0.0781025,-7.73214718\n230.194429,0.65,0.78,6.401844,0.12803688,0.0781025,-7.73214718\n239.036243,0.68,0.83,2.22948161,0.17149859,0.05830952,-5.77264238\n236.309932,0.72,0.89,2.21880078,0.2773501,0.07211103,-3.53344025\n213.690068,0.75,0.91,1.38675049,0.2773501,0.03605551,-3.56949576\n198.434949,0.78,0.92,2.21359436,0.31622777,0.03162278,-3.13065488\n0,0.74,0.92,0,1,0.04,-0.96\n345.963757,0.7,0.93,0.9701425,0.24253563,0.04123106,-4.08187457\n338.198591,0.65,0.95,3.15682075,0.18569534,0.05385165,-5.33131316\n45,0.29,0.89,0.70710678,0.70710678,0.07071068,-1.34350288\n71.565051,0.27,0.83,0.9486833,0.31622777,0.06324555,-3.09903211\n81.869898,0.26,0.76,0.98994949,0.14142136,0.07071068,-7.00035713\n;0,0.2,0.76,0,1,0.06,-0.94\n53.130102,0.19,0.86,3.6,0.2,0.05,-4.95\n45,0.14,0.81,0.70710678,0.70710678,0.07071068,-1.34350288\n36.869898,0.1,0.78,1.4,0.2,0.05,-4.95\n18.434949,0.04,0.76,2.21359436,0.31622777,0.06324555,-3.09903211\n0,0,0.76,0,1,0.04,-0.96\n0,0.96,0.76,0,1,0.04,-0.96\n345.963757,0.92,0.77,0.9701425,0.24253563,0.04123106,-4.08187457\n333.434949,0.88,0.79,0.89442719,0.4472136,0.04472136,-2.19134662\n315,0.86,0.81,0.70710678,0.70710678,0.02828427,-1.38592929\n306.869898,0.83,0.85,1.4,0.2,0.05,-4.95\n11.309932,0.78,0.84,4.11843884,0.19611614,0.0509902,-5.04802932\n180,0.83,0.88,0,1,0.06,-0.94\n261.869898,0.84,0.95,0.98994949,0.14142136,0.07071068,-7.00035713\n248.198591,0.86,1,3.15682075,0.18569534,0.05385165,-5.33131316\n333.434949,0.59,0.98,0.89442719,0.4472136,0.06708204,-2.16898594\n348.690068,0.54,0.99,0.98058068,0.19611614,0.0509902,-5.04802932\n0,0.46,0.99,0,1,0.08,-0.92\n18.434949,0.4,0.97,2.21359436,0.31622777,0.06324555,-3.09903211\n26.565051,0.34,0.94,1.34164079,0.4472136,0.06708204,-2.16898594\n45,0.28,0.99,0.70710678,0.70710678,0.01414214,-1.40007143\n56.309932,0.26,0.96,2.21880078,0.2773501,0.03605551,-3.56949576\n56.309932,0.22,0.9,2.21880078,0.2773501,0.07211103,-3.53344025\n53.130102,0.97,0.16,3.6,0.2,0.05,-4.95\n38.659808,0.92,0.12,1.40556386,0.15617376,0.06403124,-6.339093\n9.462322,0.86,0.11,5.09636861,0.16439899,0.06082763,-6.0219349\n345.963757,0.82,0.12,0.9701425,0.24253563,0.04123106,-4.08187457\n326.309932,0.79,0.14,2.21880078,0.2773501,0.03605551,-3.56949576\n225,0.82,0.29,0.70710678,0.70710678,0.04242641,-1.37178716\n213.690068,0.85,0.31,1.38675049,0.2773501,0.03605551,-3.56949576\n191.309932,0.9,0.32,4.11843884,0.19611614,0.0509902,-5.04802932\n180,0.95,0.32,0,1,0.05,-0.95\n158.198591,1,0.3,3.15682075,0.18569534,0.05385165,-5.33131316\n233.130102,0.89,0.04,3.6,0.2,0.05,-4.95\n216.869898,0.93,0.07,1.4,0.2,0.05,-4.95\n206.565051,0.97,0.09,1.34164079,0.4472136,0.04472136,-2.19134662\n198.434949,1,0.1,2.21359436,0.31622777,0.03162278,-3.13065488\n30.963757,0.95,0.38,3.60147029,0.17149859,0.05830952,-5.77264238\n14.036243,0.91,0.37,3.15296313,0.24253563,0.04123106,-4.08187457\n0,0.83,0.37,0,1,0.08,-0.92\n348.690068,0.78,0.38,0.98058068,0.19611614,0.0509902,-5.04802932\n216.869898,0.81,0.68,1.4,0.2,0.05,-4.95\n198.434949,0.9,0.71,2.21359436,0.31622777,0.09486833,-3.06740933\n180,1,0.71,0,1,0.1,-0.9\n"),!1),N(O.ParsePatFile("\n*LEAF-03,LEAF-03\n;By John Hyslop, Using AutoCAD Lisp Tool\n;Developed in inch as imperial QCAD3 pattern\n344.054604,0.86,0.38,4.12081692,0.13736056,0.0728011,-7.20730879\n338.198591,0.81,0.4,3.15682075,0.18569534,0.05385165,-5.33131316\n326.309932,0.75,0.44,2.21880078,0.2773501,0.07211103,-3.53344025\n320.194429,0.69,0.49,6.401844,0.12803688,0.0781025,-7.73214718\n308.659808,0.65,0.54,1.40556386,0.15617376,0.06403124,-6.339093\n300.963757,0.62,0.59,3.60147029,0.17149859,0.05830952,-5.77264238\n293.198591,0.59,0.66,2.23220936,0.13130643,0.07615773,-7.53961537\n281.309932,0.58,0.71,4.11843884,0.19611614,0.0509902,-5.04802932\n276.340192,0.57,0.8,8.0615014,0.11043153,0.09055385,-8.96483129\n270,0.57,0.85,0,1,0.05,-0.95\n257.471192,0.59,0.94,5.09786576,0.10846523,0.09219544,-9.12734901\n164.054604,0.66,0.92,4.12081692,0.13736056,0.0728011,-7.20730879\n158.198591,0.71,0.9,3.15682075,0.18569534,0.05385165,-5.33131316\n146.309932,0.77,0.86,2.21880078,0.2773501,0.07211103,-3.53344025\n140.194429,0.83,0.81,6.401844,0.12803688,0.0781025,-7.73214718\n125.537678,0.88,0.74,4.99864847,0.11624764,0.08602325,-8.51630201\n116.565051,0.92,0.66,1.34164079,0.4472136,0.08944272,-2.14662526\n105.945396,0.94,0.59,3.15929297,0.13736056,0.0728011,-7.20730879\n97.125016,0.95,0.51,7.06997987,0.12403473,0.08062258,-7.98163517\n90,0.95,0.45,0,1,0.06,-0.94\n77.471192,0.93,0.36,5.09786576,0.10846523,0.09219544,-9.12734901\n195.945396,0.14,0.38,3.15929297,0.13736056,0.0728011,-7.20730879\n201.801409,0.19,0.4,2.22834406,0.18569534,0.05385165,-5.33131316\n213.690068,0.25,0.44,1.38675049,0.2773501,0.07211103,-3.53344025\n219.805571,0.31,0.49,1.40840568,0.12803688,0.0781025,-7.73214718\n231.340192,0.35,0.54,4.99756038,0.15617376,0.06403124,-6.339093\n239.036243,0.38,0.59,2.22948161,0.17149859,0.05830952,-5.77264238\n246.801409,0.41,0.66,5.38356375,0.13130643,0.07615773,-7.53961537\n258.690068,0.42,0.71,0.98058068,0.19611614,0.0509902,-5.04802932\n263.659808,0.43,0.8,0.99388373,0.11043153,0.09055385,-8.96483129\n270,0.43,0.85,0,1,0.05,-0.95\n282.528808,0.41,0.94,4.1216787,0.10846523,0.09219544,-9.12734901\n15.945396,0.34,0.92,3.15929297,0.13736056,0.0728011,-7.20730879\n21.801409,0.29,0.9,2.22834406,0.18569534,0.05385165,-5.33131316\n33.690068,0.23,0.86,1.38675049,0.2773501,0.07211103,-3.53344025\n39.805571,0.17,0.81,1.40840568,0.12803688,0.0781025,-7.73214718\n54.462322,0.12,0.74,3.6036768,0.11624764,0.08602325,-8.51630201\n63.434949,0.08,0.66,0.89442719,0.4472136,0.08944272,-2.14662526\n74.054604,0.06,0.59,4.12081692,0.13736056,0.0728011,-7.20730879\n82.874984,0.05,0.51,0.99227788,0.12403473,0.08062258,-7.98163517\n90,0.05,0.45,0,1,0.06,-0.94\n102.528808,0.07,0.36,4.1216787,0.10846523,0.09219544,-9.12734901\n128.659808,0.21,0.15,1.40556386,0.15617376,0.06403124,-6.339093\n146.309932,0.27,0.11,2.21880078,0.2773501,0.07211103,-3.53344025\n153.434949,0.33,0.08,0.89442719,0.4472136,0.06708204,-2.16898594\n164.054604,0.4,0.06,4.12081692,0.13736056,0.0728011,-7.20730879\n171.869898,0.47,0.05,0.98994949,0.14142136,0.07071068,-7.00035713\n180,0.53,0.05,0,1,0.06,-0.94\n188.130102,0.6,0.06,6.08111832,0.14142136,0.07071068,-7.00035713\n195.945396,0.67,0.08,3.15929297,0.13736056,0.0728011,-7.20730879\n206.565051,0.73,0.11,1.34164079,0.4472136,0.06708204,-2.16898594\n218.659808,0.78,0.15,1.40556386,0.15617376,0.06403124,-6.339093\n225,0.83,0.2,0.70710678,0.70710678,0.07071068,-1.34350288\n315,0.78,0.25,0.70710678,0.70710678,0.07071068,-1.34350288\n321.340192,0.73,0.29,4.99756038,0.15617376,0.06403124,-6.339093\n336.801409,0.66,0.32,5.38356375,0.13130643,0.07615773,-7.53961537\n341.565051,0.6,0.34,0.9486833,0.31622777,0.06324555,-3.09903211\n351.869898,0.53,0.35,0.98994949,0.14142136,0.07071068,-7.00035713\n0,0.47,0.35,0,1,0.06,-0.94\n8.130102,0.4,0.34,6.08111832,0.14142136,0.07071068,-7.00035713\n18.434949,0.34,0.32,2.21359436,0.31622777,0.06324555,-3.09903211\n23.198591,0.27,0.29,2.23220936,0.13130643,0.07615773,-7.53961537\n38.659808,0.22,0.25,1.40556386,0.15617376,0.06403124,-6.339093\n45,0.17,0.2,0.70710678,0.70710678,0.07071068,-1.34350288\n"),!1),N(O.ParsePatFile("\n*LINE,LINE\n0, 0,0, 0,.125\n"),!1),N(O.ParsePatFile("\n*LOOPLINKS,LOOPLINKS\n;By John Hyslop, Using AutoCAD Lisp Tool\n;Developed in inch as imperial QCAD3 pattern\n206.565051,0.53,0.67,1.34164079,0.4472136,0.02236068,-2.2137073\n243.434949,0.54,0.69,0.89442719,0.4472136,0.02236068,-2.2137073\n116.565051,0.47,0.67,1.34164079,0.4472136,0.02236068,-2.2137073\n153.434949,0.49,0.66,0.89442719,0.4472136,0.02236068,-2.2137073\n180,0.51,0.66,0,1,0.02,-0.98\n258.690068,0.19,0.59,0.98058068,0.19611614,0.0509902,-5.04802932\n251.565051,0.2,0.62,0.9486833,0.31622777,0.03162278,-3.13065488\n243.434949,0.22,0.66,0.89442719,0.4472136,0.04472136,-2.19134662\n230.194429,0.27,0.72,6.401844,0.12803688,0.0781025,-7.73214718\n225,0.31,0.76,0.70710678,0.70710678,0.05656854,-1.35764502\n209.744881,0.38,0.8,5.82963253,0.12403473,0.08062258,-7.98163517\n194.036243,0.46,0.82,3.15296313,0.24253563,0.08246211,-4.04064351\n251.565051,0.28,0.6,0.9486833,0.31622777,0.06324555,-3.09903211\n239.036243,0.31,0.65,2.22948161,0.17149859,0.05830952,-5.77264238\n225,0.35,0.69,0.70710678,0.70710678,0.05656854,-1.35764502\n210.963757,0.4,0.72,3.60147029,0.17149859,0.05830952,-5.77264238\n198.434949,0.46,0.74,2.21359436,0.31622777,0.06324555,-3.09903211\n116.565051,0.67,0.47,1.34164079,0.4472136,0.02236068,-2.2137073\n153.434949,0.69,0.46,0.89442719,0.4472136,0.02236068,-2.2137073\n26.565051,0.67,0.53,1.34164079,0.4472136,0.02236068,-2.2137073\n63.434949,0.66,0.51,0.89442719,0.4472136,0.02236068,-2.2137073\n90,0.66,0.49,0,1,0.02,-0.98\n168.690068,0.59,0.81,0.98058068,0.19611614,0.0509902,-5.04802932\n161.565051,0.62,0.8,0.9486833,0.31622777,0.03162278,-3.13065488\n153.434949,0.66,0.78,0.89442719,0.4472136,0.04472136,-2.19134662\n140.194429,0.72,0.73,6.401844,0.12803688,0.0781025,-7.73214718\n135,0.76,0.69,0.70710678,0.70710678,0.05656854,-1.35764502\n119.744881,0.8,0.62,5.82963253,0.12403473,0.08062258,-7.98163517\n104.036243,0.82,0.54,3.15296313,0.24253563,0.08246211,-4.04064351\n161.565051,0.6,0.72,0.9486833,0.31622777,0.06324555,-3.09903211\n149.036243,0.65,0.69,2.22948161,0.17149859,0.05830952,-5.77264238\n135,0.69,0.65,0.70710678,0.70710678,0.05656854,-1.35764502\n120.963757,0.72,0.6,3.60147029,0.17149859,0.05830952,-5.77264238\n108.434949,0.74,0.54,2.21359436,0.31622777,0.06324555,-3.09903211\n26.565051,0.47,0.33,1.34164079,0.4472136,0.02236068,-2.2137073\n63.434949,0.46,0.31,0.89442719,0.4472136,0.02236068,-2.2137073\n296.565051,0.53,0.33,1.34164079,0.4472136,0.02236068,-2.2137073\n333.434949,0.51,0.34,0.89442719,0.4472136,0.02236068,-2.2137073\n0,0.49,0.34,0,1,0.02,-0.98\n78.690068,0.81,0.41,0.98058068,0.19611614,0.0509902,-5.04802932\n71.565051,0.8,0.38,0.9486833,0.31622777,0.03162278,-3.13065488\n63.434949,0.78,0.34,0.89442719,0.4472136,0.04472136,-2.19134662\n50.194429,0.73,0.28,6.401844,0.12803688,0.0781025,-7.73214718\n45,0.69,0.24,0.70710678,0.70710678,0.05656854,-1.35764502\n29.744881,0.62,0.2,5.82963253,0.12403473,0.08062258,-7.98163517\n14.036243,0.54,0.18,3.15296313,0.24253563,0.08246211,-4.04064351\n71.565051,0.72,0.4,0.9486833,0.31622777,0.06324555,-3.09903211\n59.036243,0.69,0.35,2.22948161,0.17149859,0.05830952,-5.77264238\n45,0.65,0.31,0.70710678,0.70710678,0.05656854,-1.35764502\n30.963757,0.6,0.28,3.60147029,0.17149859,0.05830952,-5.77264238\n18.434949,0.54,0.26,2.21359436,0.31622777,0.06324555,-3.09903211\n296.565051,0.33,0.53,1.34164079,0.4472136,0.02236068,-2.2137073\n333.434949,0.31,0.54,0.89442719,0.4472136,0.02236068,-2.2137073\n206.565051,0.33,0.47,1.34164079,0.4472136,0.02236068,-2.2137073\n243.434949,0.34,0.49,0.89442719,0.4472136,0.02236068,-2.2137073\n270,0.34,0.51,0,1,0.02,-0.98\n348.690068,0.41,0.19,0.98058068,0.19611614,0.0509902,-5.04802932\n341.565051,0.38,0.2,0.9486833,0.31622777,0.03162278,-3.13065488\n333.434949,0.34,0.22,0.89442719,0.4472136,0.04472136,-2.19134662\n320.194429,0.28,0.27,6.401844,0.12803688,0.0781025,-7.73214718\n315,0.24,0.31,0.70710678,0.70710678,0.05656854,-1.35764502\n299.744881,0.2,0.38,5.82963253,0.12403473,0.08062258,-7.98163517\n284.036243,0.18,0.46,3.15296313,0.24253563,0.08246211,-4.04064351\n341.565051,0.4,0.28,0.9486833,0.31622777,0.06324555,-3.09903211\n329.036243,0.35,0.31,2.22948161,0.17149859,0.05830952,-5.77264238\n315,0.31,0.35,0.70710678,0.70710678,0.05656854,-1.35764502\n300.963757,0.28,0.4,3.60147029,0.17149859,0.05830952,-5.77264238\n288.434949,0.26,0.46,2.21359436,0.31622777,0.06324555,-3.09903211\n90,0.46,-0.31,0,1,0.62,-0.38\n270,0.54,0.31,0,1,0.62,-0.38\n180,0.31,0.46,0,1,0.62,-0.38\n0,-0.31,0.54,0,1,0.62,-0.38\n"),!1),N(O.ParsePatFile("\n*MAZE-01,MAZE-01 verbose\n;By John Hyslop, Tile2Hatch tool \xa9 CVH 2020\n;Developed in inch as imperial QCAD3 pattern\n180,0.95,0.92,0,1,0.25,-0.75\n90,0.95,0.55,1,1,0.37,-0.63\n90,0.83,0.55,1,1,0.25,-0.75\n0,0.7,0.42,0,1,0.11,-0.89\n180,0.57,0.8,0,1,0.38,-0.62\n270,0.57,0.92,1,1,0.12,-0.88\n0,0.07,0.92,0,1,0.5,-0.5\n90,0.95,0.29,1,1,0.13,-0.87\n180,0.45,0.05,0,1,0.38,-0.62\n0,0.7,0.29,0,1,0.25,-0.75\n270,0.45,0.17,1,1,0.12,-0.88\n0,0.19,0.17,0,1,0.26,-0.74\n90,0.7,0.17,1,1,0.12,-0.88\n270,0.19,0.8,1,1,0.63,-0.37\n0,0.31,0.29,0,1,0.26,-0.74\n270,0.31,0.68,1,1,0.39,-0.61\n180,0.7,0.68,0,1,0.39,-0.61\n270,0.7,0.92,1,1,0.24,-0.76\n180,0.95,0.17,0,1,0.25,-0.75\n90,0.95,0.05,1,1,0.12,-0.88\n0,0.57,0.05,0,1,0.38,-0.62\n270,0.57,0.42,1,1,0.37,-0.63\n270,0.7,0.55,1,1,0.13,-0.87\n0,0.45,0.55,0,1,0.25,-0.75\n90,0.45,0.42,1,1,0.13,-0.87\n90,0.07,0.05,1,1,0.87,-0.13\n"),!1),N(O.ParsePatFile("\n*MAZE-02,MAZE-02 verbose\n;By John Hyslop, Tile2Hatch tool \xa9 CVH 2020\n;Developed in inch as imperial QCAD3 pattern\n270,0.89999999,0.1,1,1,0.1,-0.9\n0,0.69999999,0.1,0,1,0.2,-0.8\n90,0,0.3,1,1,0.5,-0.5\n270,0.89999999,0.9,1,1,0.5,-0.5\n270,0.29999999,0.9,1,1,0.1,-0.9\n180,0.29999999,0.9,0,1,0.4,-0.6\n0,0.19999999,0.2,0,1,0.15,-0.85\n90,0.19999999,0.3,1,1,0.2,-0.8\n180,0.49999999,0.3,0,1,0.3,-0.7\n90,0.49999999,0.1,1,1,0.2,-0.8\n270,0.69999999,0.2,1,1,0.1,-0.9\n0,0.59999999,0.2,0,1,0.1,-0.9\n270,0.59999999,0.3,1,1,0.1,-0.9\n180,0.69999999,0.3,0,1,0.1,-0.9\n270,0.59999999,0.6,1,1,0.1,-0.9\n0,0.29999999,0.6,0,1,0.3,-0.7\n90,0.29999999,0.4,1,1,0.2,-0.8\n180,0.69999999,0.4,0,1,0.4,-0.6\n180,0.59999999,0.5,0,1,0.2,-0.8\n270,0.79999999,0.8,1,1,0.5,-0.5\n0,0.09999999,0.1,0,1,0.4,-0.6\n0,0.09999999,0.8,0,1,0.7,-0.3\n270,0.09999999,0.2,1,1,0.1,-0.9\n90,0.09999999,0.3,1,1,0.5,-0.5\n180,0.09999999,0.2,0,1,0.3,-0.7\n180,0,0.3,0,1,0.20000001,-0.79999999\n180,0.29999999,0,0,1,0.3,-0.7\n270,0.69999999,0.7,1,1,0.2,-0.8\n0,0.39999999,0,0,1,0.4,-0.6\n0,0.19999999,0.7,0,1,0.5,-0.5\n90,0.19999999,0.6,1,1,0.1,-0.9\n270,0.59999999,0.1,1,1,0.1,-0.9\n0,0.39999999,0.9,0,1,0.4,-0.6\n270,0.39999999,1,1,1,0.1,-0.9\n"),!1),N(O.ParsePatFile("\n*MUDST,MUDST\n0, 0,0, .5,.25, .25,-.25,0,-.25,0,-.25\n"),!1),N(O.ParsePatFile("\n*NET3,NET3\n0, 0,0, 0,.125\n60, 0,0, 0,.125\n120, 0,0, 0,.125\n"),!1),N(O.ParsePatFile("\n*NET,NET\n0, 0,0, 0,.125\n90, 0,0, 0,.125\n"),!1),N(O.ParsePatFile("\n*PLASTI,PLASTI\n0, 0,0, 0,.25\n0, 0,.03125, 0,.25\n0, 0,.0625, 0,.25\n0, 0,.15625, 0,.25\n"),!1),N(O.ParsePatFile("\n*PLAST,PLAST\n0, 0,0, 0,.25\n0, 0,.03125, 0,.25\n0, 0,.0625, 0,.25\n"),!1),N(O.ParsePatFile("\n*QCAD-LOGO,QCAD-LOGO\n;By John Hyslop, Line 101 modified by CVH to fix left side of pencil drift when hatching far from Origin\n;Developed in inch as imperial QCAD3 pattern\n243.434949,0.8,0.36,0.89442719,0.4472136,0.02236068,-2.2137073\n248.198591,0.82,0.41,3.15682075,0.18569534,0.05385165,-5.33131316\n263.659808,0.83,0.5,0.99388373,0.11043153,0.09055385,-8.96483129\n276.340192,0.82,0.59,8.0615014,0.11043153,0.09055385,-8.96483129\n290.556045,0.79,0.67,5.38389277,0.11704115,0.08544004,-8.45856371\n310.601295,0.73,0.74,1.41004798,0.10846523,0.09219544,-9.12734901\n324.462322,0.66,0.79,3.6036768,0.11624764,0.08602325,-8.51630201\n336.801409,0.59,0.82,5.38356375,0.13130643,0.07615773,-7.53961537\n351.869898,0.52,0.83,0.98994949,0.14142136,0.07071068,-7.00035713\n26.565051,0.61,0.18,1.34164079,0.4472136,0.06708204,-2.16898594\n7.125016,0.53,0.17,7.06997987,0.12403473,0.08062258,-7.98163517\n0,0.45,0.17,0,1,0.08,-0.92\n344.054604,0.38,0.19,4.12081692,0.13736056,0.0728011,-7.20730879\n336.801409,0.31,0.22,5.38356375,0.13130643,0.07615773,-7.53961537\n320.194429,0.25,0.27,6.401844,0.12803688,0.0781025,-7.73214718\n308.659808,0.21,0.32,1.40556386,0.15617376,0.06403124,-6.339093\n293.198591,0.18,0.39,2.23220936,0.13130643,0.07615773,-7.53961537\n285.945396,0.16,0.46,3.15929297,0.13736056,0.0728011,-7.20730879\n270,0.16,0.52,0,1,0.06,-0.94\n261.869898,0.17,0.59,0.98994949,0.14142136,0.07071068,-7.00035713\n246.801409,0.2,0.66,5.38356375,0.13130643,0.07615773,-7.53961537\n234.462322,0.25,0.73,3.6036768,0.11624764,0.08602325,-8.51630201\n219.805571,0.31,0.78,1.40840568,0.12803688,0.0781025,-7.73214718\n206.565051,0.37,0.81,1.34164079,0.4472136,0.06708204,-2.16898594\n195.945396,0.44,0.83,3.15929297,0.13736056,0.0728011,-7.20730879\n180,0.48,0.83,0,1,0.04,-0.96\n180,0.52,0.83,0,1,0.04,-0.96\n233.130102,0.92,0.27,3.6,0.2,0.05,-4.95\n248.198591,0.94,0.32,3.15682075,0.18569534,0.05385165,-5.33131316\n248.198591,0.96,0.37,3.15682075,0.18569534,0.05385165,-5.33131316\n260.537678,0.97,0.43,0.98639392,0.16439899,0.06082763,-6.0219349\n261.869898,0.98,0.5,0.98994949,0.14142136,0.07071068,-7.00035713\n278.130102,0.97,0.57,6.08111832,0.14142136,0.07071068,-7.00035713\n279.462322,0.96,0.63,5.09636861,0.16439899,0.06082763,-6.0219349\n288.434949,0.94,0.69,2.21359436,0.31622777,0.06324555,-3.09903211\n299.744881,0.9,0.76,5.82963253,0.12403473,0.08062258,-7.98163517\n308.659808,0.86,0.81,1.40556386,0.15617376,0.06403124,-6.339093\n315,0.81,0.86,0.70710678,0.70710678,0.07071068,-1.34350288\n321.340192,0.76,0.9,4.99756038,0.15617376,0.06403124,-6.339093\n329.036243,0.71,0.93,2.22948161,0.17149859,0.05830952,-5.77264238\n338.198591,0.66,0.95,3.15682075,0.18569534,0.05385165,-5.33131316\n338.198591,0.61,0.97,3.15682075,0.18569534,0.05385165,-5.33131316\n350.537678,0.55,0.98,0.98639392,0.16439899,0.06082763,-6.0219349\n0,0.5,0.98,0,1,0.05,-0.95\n0,0.45,0.98,0,1,0.05,-0.95\n11.309932,0.4,0.97,4.11843884,0.19611614,0.0509902,-5.04802932\n14.036243,0.36,0.96,3.15296313,0.24253563,0.04123106,-4.08187457\n21.801409,0.31,0.94,2.22834406,0.18569534,0.05385165,-5.33131316\n21.801409,0.26,0.92,2.22834406,0.18569534,0.05385165,-5.33131316\n36.869898,0.22,0.89,1.4,0.2,0.05,-4.95\n36.869898,0.18,0.86,1.4,0.2,0.05,-4.95\n33.690068,0.75,0.09,1.38675049,0.2773501,0.03605551,-3.56949576\n26.565051,0.69,0.06,1.34164079,0.4472136,0.06708204,-2.16898594\n21.801409,0.64,0.04,2.22834406,0.18569534,0.05385165,-5.33131316\n11.309932,0.59,0.03,4.11843884,0.19611614,0.0509902,-5.04802932\n8.130102,0.52,0.02,6.08111832,0.14142136,0.07071068,-7.00035713\n0,0.46,0.02,0,1,0.06,-0.94\n350.537678,0.4,0.03,0.98639392,0.16439899,0.06082763,-6.0219349\n348.690068,0.35,0.04,0.98058068,0.19611614,0.0509902,-5.04802932\n338.198591,0.3,0.06,3.15682075,0.18569534,0.05385165,-5.33131316\n333.434949,0.26,0.08,0.89442719,0.4472136,0.04472136,-2.19134662\n323.130102,0.22,0.11,3.6,0.2,0.05,-4.95\n323.130102,0.18,0.14,3.6,0.2,0.05,-4.95\n315,0.14,0.18,0.70710678,0.70710678,0.05656854,-1.35764502\n306.869898,0.11,0.22,1.4,0.2,0.05,-4.95\n306.869898,0.08,0.26,1.4,0.2,0.05,-4.95\n296.565051,0.06,0.3,1.34164079,0.4472136,0.04472136,-2.19134662\n291.801409,0.04,0.35,2.22834406,0.18569534,0.05385165,-5.33131316\n281.309932,0.03,0.4,4.11843884,0.19611614,0.0509902,-5.04802932\n281.309932,0.02,0.45,4.11843884,0.19611614,0.0509902,-5.04802932\n270,0.02,0.5,0,1,0.05,-0.95\n270,0.02,0.55,0,1,0.05,-0.95\n258.690068,0.03,0.6,0.98058068,0.19611614,0.0509902,-5.04802932\n258.690068,0.04,0.65,0.98058068,0.19611614,0.0509902,-5.04802932\n248.198591,0.06,0.7,3.15682075,0.18569534,0.05385165,-5.33131316\n243.434949,0.08,0.74,0.89442719,0.4472136,0.04472136,-2.19134662\n233.130102,0.11,0.78,3.6,0.2,0.05,-4.95\n233.130102,0.14,0.82,3.6,0.2,0.05,-4.95\n225,0.18,0.86,0.70710678,0.70710678,0.05656854,-1.35764502\n0,0.35,0.21,0,1,0.29,-0.71\n180,0.56,0.39,0,1,0.04,-0.96\n270,0.56,0.44,0,1,0.05,-0.95\n180,0.62,0.44,0,1,0.06,-0.94\n270,0.62,0.48,0,1,0.04,-0.96\n270,0.98,0.11,0,1,0.01,-0.99\n270,0.98,0.13,0,1,0.02,-0.98\n45,0.82,0.08,0.70710678,0.70710678,0.14142136,-1.27279221\n225,0.9,0.2,0.70710678,0.70710678,0.14142136,-1.27279221\n45,0.79,0.11,0.70710678,0.70710678,0.14142136,-1.27279221\n0,0.544133,0.559775,0,1,0,-1\n0,0.590298,0.634752,0,1,0,-1\n0,0.640323,0.720624,0,1,0,-1\n135,0.98,0.13,0.70710678,0.70710678,0.49497475,-0.91923882\n56.309932,0.96,0.07,2.21880078,0.2773501,0.03605551,-3.56949576\n45,0.94,0.05,0.70710678,0.70710678,0.02828427,-1.38592929\n33.690068,0.91,0.03,1.38675049,0.2773501,0.03605551,-3.56949576\n18.434949,0.88,0.02,2.21359436,0.31622777,0.03162278,-3.13065488\n135.806929,0.88,0.02,-1.41407331,0.01991653,0.50209561,-49.70746523\n289.983107,0.48,0.48,8.54357658,0.08543577,0.117047,-11.58765291\n338.198591,0.53,0.52,3.15682075,0.18569534,0.1077033,-5.27746151\n105.945396,0.48,0.48,3.15929297,0.13736056,0.0728011,-7.20730879\n218.659808,0.53,0.52,1.40556386,0.15617376,0.06403124,-6.339093\n336.801409,0.46,0.55,5.38356375,0.13130643,0.07615773,-7.53961537\n56.309932,0.66,0.755,2.21880078,0.2773501,0.01802776,-3.58752352\n239.036243,0.475,0.435,2.22948161,0.17149859,0.02915476,-5.80179714\n236.309932,0.57,0.6,2.21880078,0.2773501,0.01802776,-3.58752352\n236.309932,0.62,0.68,2.21880078,0.2773501,0.01802776,-3.58752352\n0,0.46,0.41,0,1,0,-1\n0,0.49,0.34,0,1,0.02,-0.98\n0,0.54,0.34,0,1,0,-1\n0,0.45,0.34,0,1,0,-1\n0,0.36,0.34,0,1,0,-1\n0,0.27,0.34,0,1,0,-1\n180,0.24,0.34,0,1,0.03,-0.97\n180,0.33,0.34,0,1,0.03,-0.97\n180,0.42,0.34,0,1,0.03,-0.97\n239.036243,0.45,0.39,2.22948161,0.17149859,0.05830952,-5.77264238\n0,0.44,0.44,0,1,0.05,-0.95\n341.565051,0.41,0.45,0.9486833,0.31622777,0.03162278,-3.13065488\n315,0.39,0.47,0.70710678,0.70710678,0.02828427,-1.38592929\n296.565051,0.38,0.49,1.34164079,0.4472136,0.02236068,-2.2137073\n180,0.38,0.49,0,1,0.21,-0.79\n240.068488,0.57,0.82,8.06221498,0.02626129,0.38078866,-37.69807687\n0,0.63,0.49,0,1,0.18,-0.82\n240.255119,0.75,0.7,2.23262522,0.12403473,0.24186773,-7.82039002\n"),!1),N(O.ParsePatFile("\n*REDBACK,REDBACK\n;By John Hyslop\n;Developed in inch as imperial QCAD3 pattern\n63.434949,0.73,0.78,0.89442719,0.4472136,0.02236068,-2.2137073\n33.690068,0.7,0.76,1.38675049,0.2773501,0.03605551,-3.56949576\n75.963757,0.69,0.72,0.9701425,0.24253563,0.04123106,-4.08187457\n0,0.66,0.72,0,1,0.03,-0.97\n108.434949,0.67,0.69,2.21359436,0.31622777,0.03162278,-3.13065488\n90,0.67,0.68,0,1,0.01,-0.99\n0,0.54,0.57,0,1,0.01,-0.99\n270,0.54,0.58,0,1,0.01,-0.99\n225,0.55,0.59,0.70710678,0.70710678,0.01414214,-1.40007143\n180,0.56,0.59,0,1,0.01,-0.99\n315,0.55,0.6,0.70710678,0.70710678,0.01414214,-1.40007143\n15.524111,0.37,0.55,7.27991309,0.05352877,0.18681542,-18.49472628\n0,0.35,0.55,0,1,0.02,-0.98\n45,0.34,0.54,0.70710678,0.70710678,0.01414214,-1.40007143\n0,0.31,0.54,0,1,0.03,-0.97\n26.565051,0.19,0.48,1.34164079,0.4472136,0.13416408,-2.1019039\n0,0.18,0.48,0,1,0.01,-0.99\n33.690068,0.15,0.46,1.38675049,0.2773501,0.03605551,-3.56949576\n32.005383,0.07,0.41,3.60399279,0.10599979,0.09433981,-9.33964132\n45,0.06,0.4,0.70710678,0.70710678,0.01414214,-1.40007143\n270,0.06,0.41,0,1,0.01,-0.99\n225,0.07,0.42,0.70710678,0.70710678,0.01414214,-1.40007143\n213.690068,0.16,0.48,1.38675049,0.2773501,0.10816654,-3.49738474\n243.434949,0.17,0.5,0.89442719,0.4472136,0.02236068,-2.2137073\n205.016893,0.32,0.57,2.23525175,0.06041221,0.16552945,-16.3874159\n189.462322,0.38,0.58,5.09636861,0.16439899,0.06082763,-6.0219349\n194.036243,0.42,0.59,3.15296313,0.24253563,0.04123106,-4.08187457\n194.036243,0.5,0.61,3.15296313,0.24253563,0.08246211,-4.04064351\n198.434949,0.56,0.63,2.21359436,0.31622777,0.06324555,-3.09903211\n6.340192,0.47,0.62,8.0615014,0.11043153,0.09055385,-8.96483129\n315,0.46,0.63,0.70710678,0.70710678,0.01414214,-1.40007143\n45,0.45,0.62,0.70710678,0.70710678,0.01414214,-1.40007143\n23.198591,0.38,0.59,2.23220936,0.13130643,0.07615773,-7.53961537\n0,0.35,0.59,0,1,0.03,-0.97\n45,0.32,0.56,0.70710678,0.70710678,0.04242641,-1.37178716\n236.309932,0.34,0.59,2.21880078,0.2773501,0.03605551,-3.56949576\n206.565051,0.36,0.6,1.34164079,0.4472136,0.02236068,-2.2137073\n206.565051,0.42,0.63,1.34164079,0.4472136,0.06708204,-2.16898594\n206.565051,0.44,0.64,1.34164079,0.4472136,0.02236068,-2.2137073\n206.565051,0.46,0.65,1.34164079,0.4472136,0.02236068,-2.2137073\n180,0.57,0.65,0,1,0.11,-0.89\n225,0.58,0.66,0.70710678,0.70710678,0.01414214,-1.40007143\n321.340192,0.53,0.7,4.99756038,0.15617376,0.06403124,-6.339093\n296.565051,0.52,0.72,1.34164079,0.4472136,0.02236068,-2.2137073\n285.945396,0.5,0.79,3.15929297,0.13736056,0.0728011,-7.20730879\n254.054604,0.52,0.86,4.12081692,0.13736056,0.0728011,-7.20730879\n135,0.53,0.85,0.70710678,0.70710678,0.01414214,-1.40007143\n90,0.53,0.82,0,1,0.03,-0.97\n71.565051,0.52,0.79,0.9486833,0.31622777,0.03162278,-3.13065488\n105.945396,0.54,0.72,3.15929297,0.13736056,0.0728011,-7.20730879\n135,0.58,0.68,0.70710678,0.70710678,0.05656854,-1.35764502\n180,0.59,0.68,0,1,0.01,-0.99\n270,0.59,0.69,0,1,0.01,-0.99\n270,0.59,0.71,0,1,0.02,-0.98\n296.565051,0.58,0.73,1.34164079,0.4472136,0.02236068,-2.2137073\n278.130102,0.57,0.8,6.08111832,0.14142136,0.07071068,-7.00035713\n251.565051,0.58,0.83,0.9486833,0.31622777,0.03162278,-3.13065488\n225,0.59,0.84,0.70710678,0.70710678,0.01414214,-1.40007143\n225,0.6,0.85,0.70710678,0.70710678,0.01414214,-1.40007143\n243.434949,0.61,0.87,0.89442719,0.4472136,0.02236068,-2.2137073\n243.434949,0.63,0.91,0.89442719,0.4472136,0.04472136,-2.19134662\n243.434949,0.65,0.95,0.89442719,0.4472136,0.04472136,-2.19134662\n225,0.66,0.96,0.70710678,0.70710678,0.01414214,-1.40007143\n168.690068,0.81,0.93,0.98058068,0.19611614,0.15297059,-4.94604893\n355.601295,0.68,0.94,0.99705449,0.0766965,0.13038405,-12.90802076\n56.309932,0.66,0.91,2.21880078,0.2773501,0.03605551,-3.56949576\n56.309932,0.64,0.88,2.21880078,0.2773501,0.03605551,-3.56949576\n63.434949,0.63,0.86,0.89442719,0.4472136,0.02236068,-2.2137073\n56.309932,0.61,0.83,2.21880078,0.2773501,0.03605551,-3.56949576\n71.565051,0.6,0.8,0.9486833,0.31622777,0.03162278,-3.13065488\n90,0.6,0.79,0,1,0.01,-0.99\n90,0.6,0.77,0,1,0.02,-0.98\n90,0.6,0.74,0,1,0.03,-0.97\n225,0.61,0.75,0.70710678,0.70710678,0.01414214,-1.40007143\n243.434949,0.62,0.77,0.89442719,0.4472136,0.02236068,-2.2137073\n225,0.63,0.78,0.70710678,0.70710678,0.01414214,-1.40007143\n206.565051,0.65,0.79,1.34164079,0.4472136,0.02236068,-2.2137073\n206.565051,0.67,0.8,1.34164079,0.4472136,0.02236068,-2.2137073\n180,0.69,0.8,0,1,0.02,-0.98\n180,0.71,0.8,0,1,0.02,-0.98\n180,0.74,0.8,0,1,0.03,-0.97\n153.434949,0.76,0.79,0.89442719,0.4472136,0.02236068,-2.2137073\n135,0.77,0.78,0.70710678,0.70710678,0.01414214,-1.40007143\n135,0.56,0.56,0.70710678,0.70710678,0.01414214,-1.40007143\n26.565051,0.77,0.74,1.34164079,0.4472136,0.02236068,-2.2137073\n56.309932,0.75,0.71,2.21880078,0.2773501,0.03605551,-3.56949576\n14.036243,0.71,0.7,3.15296313,0.24253563,0.04123106,-4.08187457\n90,0.71,0.67,0,1,0.03,-0.97\n341.565051,0.68,0.68,0.9486833,0.31622777,0.03162278,-3.13065488\n0,0.67,0.68,0,1,0.01,-0.99\n90,0.56,0.55,0,1,0.01,-0.99\n180,0.57,0.55,0,1,0.01,-0.99\n225,0.58,0.56,0.70710678,0.70710678,0.01414214,-1.40007143\n270,0.58,0.57,0,1,0.01,-0.99\n135,0.59,0.56,0.70710678,0.70710678,0.01414214,-1.40007143\n74.475889,0.54,0.38,11.4016286,0.05352877,0.18681542,-18.49472628\n90,0.54,0.36,0,1,0.02,-0.98\n45,0.53,0.35,0.70710678,0.70710678,0.01414214,-1.40007143\n90,0.53,0.32,0,1,0.03,-0.97\n63.434949,0.47,0.2,0.89442719,0.4472136,0.13416408,-2.1019039\n90,0.47,0.19,0,1,0.01,-0.99\n56.309932,0.45,0.16,2.21880078,0.2773501,0.03605551,-3.56949576\n57.994617,0.4,0.08,5.82998834,0.10599979,0.09433981,-9.33964132\n45,0.39,0.07,0.70710678,0.70710678,0.01414214,-1.40007143\n180,0.4,0.07,0,1,0.01,-0.99\n225,0.41,0.08,0.70710678,0.70710678,0.01414214,-1.40007143\n236.309932,0.47,0.17,2.21880078,0.2773501,0.10816654,-3.49738474\n206.565051,0.49,0.18,1.34164079,0.4472136,0.02236068,-2.2137073\n244.983107,0.56,0.33,14.31769361,0.06041221,0.16552945,-16.3874159\n260.537678,0.57,0.39,0.98639392,0.16439899,0.06082763,-6.0219349\n255.963757,0.58,0.43,0.9701425,0.24253563,0.04123106,-4.08187457\n255.963757,0.6,0.51,0.9701425,0.24253563,0.08246211,-4.04064351\n251.565051,0.62,0.57,0.9486833,0.31622777,0.06324555,-3.09903211\n83.659808,0.61,0.48,0.99388373,0.11043153,0.09055385,-8.96483129\n135,0.62,0.47,0.70710678,0.70710678,0.01414214,-1.40007143\n45,0.61,0.46,0.70710678,0.70710678,0.01414214,-1.40007143\n66.801409,0.58,0.39,5.38356375,0.13130643,0.07615773,-7.53961537\n90,0.58,0.36,0,1,0.03,-0.97\n45,0.55,0.33,0.70710678,0.70710678,0.04242641,-1.37178716\n213.690068,0.58,0.35,1.38675049,0.2773501,0.03605551,-3.56949576\n243.434949,0.59,0.37,0.89442719,0.4472136,0.02236068,-2.2137073\n243.434949,0.62,0.43,0.89442719,0.4472136,0.06708204,-2.16898594\n243.434949,0.63,0.45,0.89442719,0.4472136,0.02236068,-2.2137073\n243.434949,0.64,0.47,0.89442719,0.4472136,0.02236068,-2.2137073\n270,0.64,0.58,0,1,0.11,-0.89\n225,0.65,0.59,0.70710678,0.70710678,0.01414214,-1.40007143\n128.659808,0.69,0.54,1.40556386,0.15617376,0.06403124,-6.339093\n153.434949,0.71,0.53,0.89442719,0.4472136,0.02236068,-2.2137073\n164.054604,0.78,0.51,4.12081692,0.13736056,0.0728011,-7.20730879\n195.945396,0.85,0.53,3.15929297,0.13736056,0.0728011,-7.20730879\n315,0.84,0.54,0.70710678,0.70710678,0.01414214,-1.40007143\n0,0.81,0.54,0,1,0.03,-0.97\n18.434949,0.78,0.53,2.21359436,0.31622777,0.03162278,-3.13065488\n344.054604,0.71,0.55,4.12081692,0.13736056,0.0728011,-7.20730879\n315,0.67,0.59,0.70710678,0.70710678,0.05656854,-1.35764502\n270,0.67,0.6,0,1,0.01,-0.99\n180,0.68,0.6,0,1,0.01,-0.99\n180,0.7,0.6,0,1,0.02,-0.98\n153.434949,0.72,0.59,0.89442719,0.4472136,0.02236068,-2.2137073\n171.869898,0.79,0.58,0.98994949,0.14142136,0.07071068,-7.00035713\n198.434949,0.82,0.59,2.21359436,0.31622777,0.03162278,-3.13065488\n225,0.83,0.6,0.70710678,0.70710678,0.01414214,-1.40007143\n225,0.84,0.61,0.70710678,0.70710678,0.01414214,-1.40007143\n206.565051,0.86,0.62,1.34164079,0.4472136,0.02236068,-2.2137073\n206.565051,0.9,0.64,1.34164079,0.4472136,0.04472136,-2.19134662\n206.565051,0.94,0.66,1.34164079,0.4472136,0.04472136,-2.19134662\n225,0.95,0.67,0.70710678,0.70710678,0.01414214,-1.40007143\n281.309932,0.92,0.82,4.11843884,0.19611614,0.15297059,-4.94604893\n94.398705,0.93,0.69,12.04135032,0.0766965,0.13038405,-12.90802076\n33.690068,0.9,0.67,1.38675049,0.2773501,0.03605551,-3.56949576\n33.690068,0.87,0.65,1.38675049,0.2773501,0.03605551,-3.56949576\n26.565051,0.85,0.64,1.34164079,0.4472136,0.02236068,-2.2137073\n33.690068,0.82,0.62,1.38675049,0.2773501,0.03605551,-3.56949576\n18.434949,0.79,0.61,2.21359436,0.31622777,0.03162278,-3.13065488\n0,0.78,0.61,0,1,0.01,-0.99\n0,0.76,0.61,0,1,0.02,-0.98\n0,0.73,0.61,0,1,0.03,-0.97\n225,0.74,0.62,0.70710678,0.70710678,0.01414214,-1.40007143\n206.565051,0.76,0.63,1.34164079,0.4472136,0.02236068,-2.2137073\n225,0.77,0.64,0.70710678,0.70710678,0.01414214,-1.40007143\n243.434949,0.78,0.66,0.89442719,0.4472136,0.02236068,-2.2137073\n243.434949,0.79,0.68,0.89442719,0.4472136,0.02236068,-2.2137073\n270,0.79,0.7,0,1,0.02,-0.98\n270,0.79,0.72,0,1,0.02,-0.98\n270,0.79,0.75,0,1,0.03,-0.97\n296.565051,0.78,0.77,1.34164079,0.4472136,0.02236068,-2.2137073\n315,0.77,0.78,0.70710678,0.70710678,0.01414214,-1.40007143\n"),!1),N(O.ParsePatFile("\n*SACNCR,SACNCR\n45, 0,0, 0,.09375\n45, .06629126,0, 0,.09375, 0,-.09375\n"),!1),N(O.ParsePatFile("\n*SCAFFOLD, verbose comment\n;By John Hyslop, Tile2Hatch tool \xa9 CVH 2020\n;Developed in inch as imperial QCAD3 pattern\n270,0.76,0.84,1,1,0.02,-0.98\n326.3099325,0.26,0.16,2.21880078,0.2773501,0.57688819,-3.02866309\n90,0.24,0.49,1,1,0.02,-0.98\n270,0.25,0.16,1,1,0.32,-0.68\n146.3099325,0.24,0.84,2.21880078,0.2773501,0.5768882,-3.02866307\n180,0.76,0.49,0,1,0.02,-0.98\n270,0.74,0.18,1,1,0.02,-0.98\n0,0.74,0.84,0,1,0.02,-0.98\n90,0.25,0.51,1,1,0.31,-0.69\n270,0.76,0.51,1,1,0.02,-0.98\n0,0.26,0.17,0,1,0.48,-0.52\n0,0.24,0.51,0,1,0.02,-0.98\n180,0.76,0.18,0,1,0.02,-0.98\n90,0.74,0.82,1,1,0.02,-0.98\n212.855722,0.24,0.49,20.24844917,0.01750082,0.57140178,-56.56877673\n147.144278,0.24,0.18,36.89172934,0.01750082,0.57140178,-56.56877673\n213.6900675,0.24,0.16,1.38675049,0.2773501,0.57688818,-3.02866309\n180,0.24,0.17,0,1,0.48,-0.52\n0,0.26,0.83,0,1,0.48,-0.52\n90,0.26,0.16,1,1,0.02,-0.98\n180,0.76,0.82,0,1,0.02,-0.98\n90,0.74,0.49,1,1,0.02,-0.98\n147.144278,0.74,0.18,36.89172934,0.01750082,0.57140179,-56.56877672\n0,0.24,0.16,0,1,0.02,-0.98\n0,0.26,0.5,0,1,0.48,-0.52\n270,0.26,0.84,1,1,0.02,-0.98\n90,0.75,0.18,1,1,0.31,-0.69\n212.855722,0.74,0.82,20.24844917,0.01750082,0.57140179,-56.56877672\n180,0.26,0.49,0,1,0.02,-0.98\n270,0.24,0.18,1,1,0.02,-0.98\n0,0.24,0.84,0,1,0.02,-0.98\n270,0.26,0.51,1,1,0.02,-0.98\n270,0.75,0.82,1,1,0.31,-0.69\n32.855722,0.26,0.18,20.24844917,0.01750082,0.57140179,-56.56877672\n180,0.26,0.18,0,1,0.02,-0.98\n0,0.74,0.51,0,1,0.02,-0.98\n90,0.76,0.16,1,1,0.02,-0.98\n90,0.24,0.82,1,1,0.02,-0.98\n180,0.24,0.83,0,1,0.48,-0.52\n147.144278,0.24,0.51,36.89172934,0.01750082,0.57140178,-56.56877673\n180,0.24,0.5,0,1,0.48,-0.52\n270,0.25,0.49,1,1,0.31,-0.69\n212.855722,0.24,0.82,20.24844917,0.01750082,0.57140179,-56.56877672\n0,0.74,0.16,0,1,0.02,-0.98\n270,0.75,0.16,1,1,0.32,-0.68\n180,0.26,0.82,0,1,0.02,-0.98\n213.6900675,0.74,0.16,1.38675049,0.2773501,0.57688819,-3.02866309\n327.144278,0.26,0.82,36.89172934,0.01750082,0.57140179,-56.56877672\n"),!1),N(O.ParsePatFile("\n*SQUARE,SQUARE\n0, 0,0, 0,.125, .125,-.125\n90, 0,0, 0,.125, .125,-.125\n"),!1),N(O.ParsePatFile("\n*SQUIGGLE-01,SQUIGGLE-01\n;By John Hyslop, Using AutoCAD Lisp Tool\n;Developed in inch as imperial QCAD3 pattern\n45,0.11,-0.39,0.70710678,0.70710678,1.11722871,-0.29698485\n56.309932,0.07,0.55,2.21880078,0.2773501,0.07211103,-3.53344025\n81.869898,0.06,0.48,0.98994949,0.14142136,0.07071068,-7.00035713\n99.462322,0.07,0.42,5.09636861,0.16439899,0.06082763,-6.0219349\n123.690068,0.11,0.36,1.38675049,0.2773501,0.07211103,-3.53344025\n146.309932,0.17,0.32,2.21880078,0.2773501,0.07211103,-3.53344025\n170.537678,0.23,0.31,0.98639392,0.16439899,0.06082763,-6.0219349\n188.130102,0.3,0.32,6.08111832,0.14142136,0.07071068,-7.00035713\n213.690068,0.36,0.36,1.38675049,0.2773501,0.07211103,-3.53344025\n225,0.65,0.65,0.70710678,0.70710678,0.41012193,-1.00409163\n213.690068,0.71,0.69,1.38675049,0.2773501,0.07211103,-3.53344025\n189.462322,0.77,0.7,5.09636861,0.16439899,0.06082763,-6.0219349\n171.869898,0.84,0.69,0.98994949,0.14142136,0.07071068,-7.00035713\n146.309932,0.9,0.65,2.21880078,0.2773501,0.07211103,-3.53344025\n123.690068,0.94,0.59,1.38675049,0.2773501,0.07211103,-3.53344025\n99.462322,0.95,0.53,5.09636861,0.16439899,0.06082763,-6.0219349\n81.869898,0.94,0.46,0.98994949,0.14142136,0.07071068,-7.00035713\n56.309932,0.9,0.4,2.21880078,0.2773501,0.07211103,-3.53344025\n"),!1),N(O.ParsePatFile("\n*SQUIGGLE-02,SQUIGGLE-02\n;By John Hyslop, Using AutoCAD Lisp Tool\n;Developed in inch as imperial QCAD3 pattern\n75.963757,0.99,0.16,0.9701425,0.24253563,0.04123106,-4.08187457\n63.434949,0.97,0.12,0.89442719,0.4472136,0.04472136,-2.19134662\n45,0.94,0.09,0.70710678,0.70710678,0.04242641,-1.37178716\n14.036243,0.9,0.08,3.15296313,0.24253563,0.04123106,-4.08187457\n0,0.85,0.08,0,1,0.05,-0.95\n345.963757,0.81,0.09,0.9701425,0.24253563,0.04123106,-4.08187457\n315,0.78,0.12,0.70710678,0.70710678,0.04242641,-1.37178716\n296.565051,0.76,0.16,1.34164079,0.4472136,0.04472136,-2.19134662\n284.036243,0.75,0.2,3.15296313,0.24253563,0.04123106,-4.08187457\n281.309932,0.74,0.85,4.11843884,0.19611614,0.0509902,-5.04802932\n303.690068,0.72,0.88,1.38675049,0.2773501,0.03605551,-3.56949576\n315,0.69,0.91,0.70710678,0.70710678,0.04242641,-1.37178716\n345.963757,0.65,0.92,0.9701425,0.24253563,0.04123106,-4.08187457\n0,0.6,0.92,0,1,0.05,-0.95\n14.036243,0.56,0.91,3.15296313,0.24253563,0.04123106,-4.08187457\n45,0.53,0.88,0.70710678,0.70710678,0.04242641,-1.37178716\n56.309932,0.51,0.85,2.21880078,0.2773501,0.03605551,-3.56949576\n78.690068,0.5,0.8,0.98058068,0.19611614,0.0509902,-5.04802932\n75.963757,0.49,0.16,0.9701425,0.24253563,0.04123106,-4.08187457\n63.434949,0.47,0.12,0.89442719,0.4472136,0.04472136,-2.19134662\n45,0.44,0.09,0.70710678,0.70710678,0.04242641,-1.37178716\n14.036243,0.4,0.08,3.15296313,0.24253563,0.04123106,-4.08187457\n0,0.35,0.08,0,1,0.05,-0.95\n345.963757,0.31,0.09,0.9701425,0.24253563,0.04123106,-4.08187457\n315,0.28,0.12,0.70710678,0.70710678,0.04242641,-1.37178716\n296.565051,0.26,0.16,1.34164079,0.4472136,0.04472136,-2.19134662\n284.036243,0.25,0.2,3.15296313,0.24253563,0.04123106,-4.08187457\n281.309932,0.24,0.85,4.11843884,0.19611614,0.0509902,-5.04802932\n303.690068,0.22,0.88,1.38675049,0.2773501,0.03605551,-3.56949576\n315,0.19,0.91,0.70710678,0.70710678,0.04242641,-1.37178716\n345.963757,0.15,0.92,0.9701425,0.24253563,0.04123106,-4.08187457\n0,0.1,0.92,0,1,0.05,-0.95\n14.036243,0.06,0.91,3.15296313,0.24253563,0.04123106,-4.08187457\n45,0.03,0.88,0.70710678,0.70710678,0.04242641,-1.37178716\n56.309932,0.01,0.85,2.21880078,0.2773501,0.03605551,-3.56949576\n78.690068,0,0.8,0.98058068,0.19611614,0.0509902,-5.04802932\n270,0.75,0.8,0,1,0.6,-0.4\n270,0.5,0.8,0,1,0.6,-0.4\n270,0.25,0.8,0,1,0.6,-0.4\n270,0,0.8,0,1,0.6,-0.4\n"),!1),N(O.ParsePatFile("\n*STARS,STARS\n0, 0,0, 0,.21650635, .125,-.125\n60, 0,0, 0,.21650635, .125,-.125\n120, .0625,.10825318, 0,.21650635, .125,-.125\n"),!1),N(O.ParsePatFile("\n*STEEL,STEEL\n45, 0,0, 0,.125\n45, 0,.0625, 0,.125\n"),!1),N(O.ParsePatFile("\n*SWAMP,SWAMP\n0, 0,0, .5,.8660254, .125,-.875\n90, .0625,0, .8660254,.5, .0625,-1.66955081\n90, .078125,0, .8660254,.5, .05,-1.68205081\n90, .046875,0, .8660254,.5, .05,-1.68205081\n60, .09375,0, .5,.8660254, .04,-.96\n120, .03125,0, .5,.8660254, .04,-.96\n"),!1),N(O.ParsePatFile("\n*TRANS,TRANS\n0, 0,0, 0,.25\n0, 0,.125, 0,.25, .125,-.125\n"),!1),N(O.ParsePatFile("\n*TRIANG,TRIANG\n60, 0,0, .1875,.32475953, .1875,-.1875\n120, 0,0, .1875,.32475953, .1875,-.1875\n0, -.09375,.16237976, .1875,.32475953, .1875,-.1875\n"),!1),N(O.ParsePatFile("\n*TRI-OVERLAP,TRI-OVERLAP verbose\n;By John Hyslop, Tile2Hatch tool \xa9 CVH 2020\n;Developed in inch as imperial QCAD3 pattern\n59.641885,0.09000001,0.15,47.50789248,0.01232691,0.81123363,-80.31212922\n300.358115,0.5,0.85000001,33.61547037,0.01232691,0.81123363,-80.31212922\n180,0.35942857,0.61,0,1,0.71885753,-0.28114247\n59.036243,0.89518072,0.17530121,2.22948161,0.17149859,0.20373205,-5.62721984\n180,0.91,0.15,0,1,0.81999999,-0.18000001\n300.963757,0,0.35,3.60147029,0.17149859,0.20373206,-5.62721983\n300.784147,0.12,0.15,5.83092324,0.01827876,0.5470832,-54.16123426\n239.215853,0.88,0.15,48.87739422,0.01827876,0.5470832,-54.16123426\n"),!1),N(O.ParsePatFile("\n*WEATHERBOARD,WEATHERBOARD\n; By John Hyslop, Manually Entered QCAD3 pattern\n; Developed in inch as imperial QCAD3 pattern\n; Imperial Hatch Scale 1 Makes 6inch horizontally placed boards\n; with a 0.5in offset line to simulate a rounded edge\n0,0,0,0,6\n0,0,0.5,0,6\n"),!1),N(O.ParsePatFile("\n*WEAVING,WEAVING\n;By John Hyslop, Using AutoCAD Lisp Tool\n;Developed in inch as imperial QCAD3 pattern\n90,0.9,0.2,0,1,0.05,-0.95\n75.963757,0.88,0.12,0.9701425,0.24253563,0.08246211,-4.04064351\n66.801409,0.85,0.05,5.38356375,0.13130643,0.07615773,-7.53961537\n54.462322,0.8,-0.02,3.6036768,0.11624764,0.08602325,-8.51630201\n56.309932,0.76,-0.08,2.21880078,0.2773501,0.07211103,-3.53344025\n90,0.79,0.22,0,1,0.07,-0.93\n80.537678,0.78,0.16,0.98639392,0.16439899,0.06082763,-6.0219349\n63.434949,0.75,0.1,0.89442719,0.4472136,0.06708204,-2.16898594\n56.309932,0.71,0.04,2.21880078,0.2773501,0.07211103,-3.53344025\n56.309932,0.67,-0.02,2.21880078,0.2773501,0.07211103,-3.53344025\n333.434949,0.86,0.27,0.89442719,0.4472136,0.06708204,-2.16898594\n344.054604,0.79,0.29,4.12081692,0.13736056,0.0728011,-7.20730879\n0,0.71,0.29,0,1,0.08,-0.92\n9.462322,0.65,0.28,5.09636861,0.16439899,0.06082763,-6.0219349\n26.565051,0.59,0.25,1.34164079,0.4472136,0.06708204,-2.16898594\n38.659808,0.54,0.21,1.40556386,0.15617376,0.06403124,-6.339093\n36.869898,0.46,0.15,1.4,0.2,0.1,-4.9\n20.556045,0.38,0.12,5.38389277,0.11704115,0.08544004,-8.45856371\n330.255119,0.91,0.37,2.23262522,0.12403473,0.08062258,-7.98163517\n344.054604,0.84,0.39,4.12081692,0.13736056,0.0728011,-7.20730879\n352.874984,0.76,0.4,0.99227788,0.12403473,0.08062258,-7.98163517\n0,0.69,0.4,0,1,0.07,-0.93\n14.036243,0.61,0.38,3.15296313,0.24253563,0.08246211,-4.04064351\n26.565051,0.53,0.34,1.34164079,0.4472136,0.08944272,-2.14662526\n33.690068,0.47,0.3,1.38675049,0.2773501,0.07211103,-3.53344025\n35.537678,0.4,0.25,4.99864847,0.11624764,0.08602325,-8.51630201\n0,0.2,0.1,0,1,0.05,-0.95\n348.690068,0.15,0.11,0.98058068,0.19611614,0.0509902,-5.04802932\n341.565051,0.12,0.12,0.9486833,0.31622777,0.03162278,-3.13065488\n336.801409,0.05,0.15,5.38356375,0.13130643,0.07615773,-7.53961537\n326.309932,-0.01,0.19,2.21880078,0.2773501,0.07211103,-3.53344025\n324.462322,-0.08,0.24,3.6036768,0.11624764,0.08602325,-8.51630201\n0,0.22,0.21,0,1,0.07,-0.93\n350.537678,0.16,0.22,0.98639392,0.16439899,0.06082763,-6.0219349\n333.434949,0.1,0.25,0.89442719,0.4472136,0.06708204,-2.16898594\n326.309932,0.04,0.29,2.21880078,0.2773501,0.07211103,-3.53344025\n326.309932,-0.02,0.33,2.21880078,0.2773501,0.07211103,-3.53344025\n60.255119,0.63,0.91,2.23262522,0.12403473,0.08062258,-7.98163517\n180,0.79,0.79,0,1,0.08,-0.92\n164.054604,0.86,0.77,4.12081692,0.13736056,0.0728011,-7.20730879\n153.434949,0.92,0.74,0.89442719,0.4472136,0.06708204,-2.16898594\n330.255119,0.91,0.87,2.23262522,0.12403473,0.08062258,-7.98163517\n345.963757,0.83,0.89,0.9701425,0.24253563,0.08246211,-4.04064351\n352.874984,0.75,0.9,0.99227788,0.12403473,0.08062258,-7.98163517\n60.255119,0.72,0.85,2.23262522,0.12403473,0.08062258,-7.98163517\n80.537678,0.71,0.79,0.98639392,0.16439899,0.06082763,-6.0219349\n90,0.71,0.71,0,1,0.08,-0.92\n104.036243,0.73,0.63,3.15296313,0.24253563,0.08246211,-4.04064351\n116.565051,0.76,0.57,1.34164079,0.4472136,0.06708204,-2.16898594\n129.805571,0.81,0.51,1.40840568,0.12803688,0.0781025,-7.73214718\n123.690068,0.85,0.45,1.38675049,0.2773501,0.07211103,-3.53344025\n113.198591,0.88,0.38,2.23220936,0.13130643,0.07615773,-7.53961537\n309.805571,0.71,0.46,1.40840568,0.12803688,0.0781025,-7.73214718\n305.537678,0.66,0.53,4.99864847,0.11624764,0.08602325,-8.51630201\n299.744881,0.62,0.6,5.82963253,0.12403473,0.08062258,-7.98163517\n285.945396,0.6,0.67,3.15929297,0.13736056,0.0728011,-7.20730879\n270,0.6,0.76,0,1,0.09,-0.91\n74.054604,0.61,0.84,4.12081692,0.13736056,0.0728011,-7.20730879\n82.874984,0.6,0.76,0.99227788,0.12403473,0.08062258,-7.98163517\n39.805571,0.54,0.71,1.40840568,0.12803688,0.0781025,-7.73214718\n35.537678,0.47,0.66,4.99864847,0.11624764,0.08602325,-8.51630201\n33.690068,0.41,0.62,1.38675049,0.2773501,0.07211103,-3.53344025\n15.945396,0.34,0.6,3.15929297,0.13736056,0.0728011,-7.20730879\n6.340192,0.25,0.59,8.0615014,0.11043153,0.09055385,-8.96483129\n350.537678,0.19,0.6,0.98639392,0.16439899,0.06082763,-6.0219349\n344.054604,0.12,0.62,4.12081692,0.13736056,0.0728011,-7.20730879\n23.198591,0.55,0.85,2.23220936,0.13130643,0.07615773,-7.53961537\n29.744881,0.48,0.81,5.82963253,0.12403473,0.08062258,-7.98163517\n39.805571,0.42,0.76,1.40840568,0.12803688,0.0781025,-7.73214718\n29.744881,0.35,0.72,5.82963253,0.12403473,0.08062258,-7.98163517\n7.125016,0.27,0.71,7.06997987,0.12403473,0.08062258,-7.98163517\n0,0.21,0.71,0,1,0.06,-0.94\n344.054604,0.14,0.73,4.12081692,0.13736056,0.0728011,-7.20730879\n333.434949,0.1,0.75,0.89442719,0.4472136,0.04472136,-2.19134662\n234.462322,0.31,-0.01,3.6036768,0.11624764,0.08602325,-8.51630201\n240.255119,0.35,0.06,2.23262522,0.12403473,0.08062258,-7.98163517\n243.434949,0.39,0.14,0.89442719,0.4472136,0.08944272,-2.14662526\n262.874984,0.4,0.22,0.99227788,0.12403473,0.08062258,-7.98163517\n270,0.4,0.3,0,1,0.08,-0.92\n282.528808,0.38,0.39,4.1216787,0.10846523,0.09219544,-9.12734901\n293.198591,0.35,0.46,2.23220936,0.13130643,0.07615773,-7.53961537\n309.805571,0.3,0.52,1.40840568,0.12803688,0.0781025,-7.73214718\n305.537678,0.25,0.59,4.99864847,0.11624764,0.08602325,-8.51630201\n270,0.21,0.78,0,1,0.07,-0.93\n254.054604,0.23,0.85,4.12081692,0.13736056,0.0728011,-7.20730879\n246.801409,0.26,0.92,5.38356375,0.13130643,0.07615773,-7.53961537\n236.309932,0.21,0.04,2.21880078,0.2773501,0.07211103,-3.53344025\n234.462322,0.26,0.11,3.6036768,0.11624764,0.08602325,-8.51630201\n249.443955,0.29,0.19,3.16011097,0.11704115,0.08544004,-8.45856371\n270,0.29,0.27,0,1,0.08,-0.92\n278.130102,0.28,0.34,6.08111832,0.14142136,0.07071068,-7.00035713\n296.565051,0.24,0.42,1.34164079,0.4472136,0.08944272,-2.14662526\n309.805571,0.19,0.48,1.40840568,0.12803688,0.0781025,-7.73214718\n303.690068,0.15,0.54,1.38675049,0.2773501,0.07211103,-3.53344025\n290.556045,0.12,0.62,5.38389277,0.11704115,0.08544004,-8.45856371\n341.565051,0.06,0.64,0.9486833,0.31622777,0.06324555,-3.09903211\n324.462322,-0.01,0.69,3.6036768,0.11624764,0.08602325,-8.51630201\n324.462322,-0.08,0.74,3.6036768,0.11624764,0.08602325,-8.51630201\n146.309932,0.04,0.79,2.21880078,0.2773501,0.07211103,-3.53344025\n146.309932,0.1,0.75,2.21880078,0.2773501,0.07211103,-3.53344025\n262.874984,0.11,0.83,0.99227788,0.12403473,0.08062258,-7.98163517\n255.963757,0.13,0.91,0.9701425,0.24253563,0.08246211,-4.04064351\n240.255119,0.17,0.98,2.23262522,0.12403473,0.08062258,-7.98163517\n"),!1),N(O.ParsePatFile("\n*WIRE-FENCE,WIRE-FENCE verbose\n;By John Hyslop, Tile2Hatch tool \xa9 CVH 2020\n;Developed in inch as imperial QCAD3 pattern\n315,0.46,0.5,0.70710678,0.70710678,0.04673053,-1.36748303\n315,0.52571429,0.56428571,0.70710678,0.70710678,0.04848732,-1.36572624\n3.731397,0.50267394,0.56278308,15.03328073,0.02169305,0.02308929,-46.074633\n183.17983,0.46361415,0.56023571,17.02929602,0.05547002,0.90614559,-17.12161079\n183.17983,0.46120401,0.52006684,17.02929602,0.05547002,0.90600202,-17.12175436\n153.434949,0.52,0.51,0.89442719,0.4472136,0.02236068,-2.2137073\n266.593556,0.52,0.51,17.02938222,0.01188373,1.01178655,-83.1368914\n266.593556,0.56,0.53,17.02938222,0.01188373,1.01178655,-83.1368914\n2.602562,0.49304348,0.46695652,21.02374701,0.04540766,0.02449081,-21.99822474\n"),!1),N(O.ParsePatFile("\n*XMASTREE-01,XMASTREE-01\n;By John Hyslop\n;Developed in inch as imperial QCAD3 pattern\n180,0.04,0.95,0,1,0.04,-0.96\n90,0.04,0.82,0,1,0.13,-0.87\n180,0.33,0.82,0,1,0.29,-0.71\n49.763642,0.22,0.69,7.81002892,0.05872202,0.17029386,-16.8590925\n180,0.28,0.69,0,1,0.06,-0.94\n51.340192,0.16,0.54,4.99756038,0.15617376,0.19209373,-6.21103051\n180,0.22,0.54,0,1,0.06,-0.94\n52.431408,0.12,0.41,4.99962824,0.06097108,0.16401219,-16.23720727\n180,0.17,0.41,0,1,0.05,-0.95\n53.130102,0.08,0.29,3.6,0.2,0.15,-4.85\n180,0.13,0.29,0,1,0.05,-0.95\n53.972627,0.05,0.18,8.60201108,0.07352146,0.13601471,-13.4654558\n180,0.1,0.18,0,1,0.05,-0.95\n54.462322,0,0.04,3.6036768,0.11624764,0.17204651,-8.43027876\n0,0.96,0.95,0,1,0.04,-0.96\n90,0.96,0.82,0,1,0.13,-0.87\n0,0.67,0.82,0,1,0.29,-0.71\n130.236358,0.78,0.69,9.21935745,0.05872202,0.17029386,-16.8590925\n0,0.72,0.69,0,1,0.06,-0.94\n128.659808,0.84,0.54,1.40556386,0.15617376,0.19209373,-6.21103051\n0,0.78,0.54,0,1,0.06,-0.94\n127.568592,0.88,0.41,11.40159123,0.06097108,0.16401219,-16.23720727\n0,0.83,0.41,0,1,0.05,-0.95\n126.869898,0.92,0.29,1.4,0.2,0.15,-4.85\n0,0.87,0.29,0,1,0.05,-0.95\n126.027373,0.95,0.18,4.99945943,0.07352146,0.13601471,-13.4654558\n0,0.9,0.18,0,1,0.05,-0.95\n125.537678,1,0.04,4.99864847,0.11624764,0.17204651,-8.43027876\n0,0.46,0.04,0,1,0.04,-0.96\n270,0.46,0.17,0,1,0.13,-0.87\n0,0.17,0.17,0,1,0.29,-0.71\n229.763642,0.28,0.3,7.81002892,0.05872202,0.17029386,-16.8590925\n0,0.22,0.3,0,1,0.06,-0.94\n231.340192,0.34,0.45,4.99756038,0.15617376,0.19209373,-6.21103051\n0,0.28,0.45,0,1,0.06,-0.94\n232.431408,0.38,0.58,4.99962824,0.06097108,0.16401219,-16.23720727\n0,0.33,0.58,0,1,0.05,-0.95\n233.130102,0.42,0.7,3.6,0.2,0.15,-4.85\n0,0.37,0.7,0,1,0.05,-0.95\n233.972627,0.45,0.81,8.60201108,0.07352146,0.13601471,-13.4654558\n0,0.4,0.81,0,1,0.05,-0.95\n234.462322,0.5,0.95,3.6036768,0.11624764,0.17204651,-8.43027876\n180,0.54,0.04,0,1,0.04,-0.96\n270,0.54,0.17,0,1,0.13,-0.87\n180,0.83,0.17,0,1,0.29,-0.71\n310.236358,0.72,0.3,9.21935745,0.05872202,0.17029386,-16.8590925\n180,0.78,0.3,0,1,0.06,-0.94\n308.659808,0.66,0.45,1.40556386,0.15617376,0.19209373,-6.21103051\n180,0.72,0.45,0,1,0.06,-0.94\n307.568592,0.62,0.58,11.40159123,0.06097108,0.16401219,-16.23720727\n180,0.67,0.58,0,1,0.05,-0.95\n306.869898,0.58,0.7,1.4,0.2,0.15,-4.85\n180,0.63,0.7,0,1,0.05,-0.95\n306.027373,0.55,0.81,4.99945943,0.07352146,0.13601471,-13.4654558\n180,0.6,0.81,0,1,0.05,-0.95\n305.537678,0.5,0.95,4.99864847,0.11624764,0.17204651,-8.43027876\n"),!1),N(O.ParsePatFile("\n*XMASTREE-02,XMASTREE-02\n;By John Hyslop\n;Developed in inch as imperial QCAD3 pattern\n180,0.04,0.26,0,1,0.04,-0.96\n90,0.04,0.13,0,1,0.13,-0.87\n180,0.33,0.13,0,1,0.29,-0.71\n49.763642,0.22,0,7.81002892,0.05872202,0.17029386,-16.8590925\n180,0.28,1,0,1,0.06,-0.94\n51.340192,0.16,0.85,4.99756038,0.15617376,0.19209373,-6.21103051\n180,0.22,0.85,0,1,0.06,-0.94\n52.431408,0.12,0.72,4.99962824,0.06097108,0.16401219,-16.23720727\n180,0.17,0.72,0,1,0.05,-0.95\n53.130102,0.08,0.6,3.6,0.2,0.15,-4.85\n180,0.13,0.6,0,1,0.05,-0.95\n53.972627,0.05,0.49,8.60201108,0.07352146,0.13601471,-13.4654558\n180,0.1,0.49,0,1,0.05,-0.95\n54.462322,0,0.35,3.6036768,0.11624764,0.17204651,-8.43027876\n0,0.96,0.26,0,1,0.04,-0.96\n90,0.96,0.13,0,1,0.13,-0.87\n0,0.67,0.13,0,1,0.29,-0.71\n130.236358,0.78,0,9.21935745,0.05872202,0.17029386,-16.8590925\n0,0.72,1,0,1,0.06,-0.94\n128.659808,0.84,0.85,1.40556386,0.15617376,0.19209373,-6.21103051\n0,0.78,0.85,0,1,0.06,-0.94\n127.568592,0.88,0.72,11.40159123,0.06097108,0.16401219,-16.23720727\n0,0.83,0.72,0,1,0.05,-0.95\n126.869898,0.92,0.6,1.4,0.2,0.15,-4.85\n0,0.87,0.6,0,1,0.05,-0.95\n126.027373,0.95,0.49,4.99945943,0.07352146,0.13601471,-13.4654558\n0,0.9,0.49,0,1,0.05,-0.95\n125.537678,1,0.35,4.99864847,0.11624764,0.17204651,-8.43027876\n0,0.46,0.09,0,1,0.04,-0.96\n270,0.46,0.22,0,1,0.13,-0.87\n0,0.17,0.22,0,1,0.29,-0.71\n229.763642,0.28,0.35,7.81002892,0.05872202,0.17029386,-16.8590925\n0,0.22,0.35,0,1,0.06,-0.94\n231.340192,0.34,0.5,4.99756038,0.15617376,0.19209373,-6.21103051\n0,0.28,0.5,0,1,0.06,-0.94\n232.431408,0.38,0.63,4.99962824,0.06097108,0.16401219,-16.23720727\n0,0.33,0.63,0,1,0.05,-0.95\n233.130102,0.42,0.75,3.6,0.2,0.15,-4.85\n0,0.37,0.75,0,1,0.05,-0.95\n233.972627,0.45,0.86,8.60201108,0.07352146,0.13601471,-13.4654558\n0,0.4,0.86,0,1,0.05,-0.95\n234.462322,0.5,1,3.6036768,0.11624764,0.17204651,-8.43027876\n180,0.54,0.09,0,1,0.04,-0.96\n270,0.54,0.22,0,1,0.13,-0.87\n180,0.83,0.22,0,1,0.29,-0.71\n310.236358,0.72,0.35,9.21935745,0.05872202,0.17029386,-16.8590925\n180,0.78,0.35,0,1,0.06,-0.94\n308.659808,0.66,0.5,1.40556386,0.15617376,0.19209373,-6.21103051\n180,0.72,0.5,0,1,0.06,-0.94\n307.568592,0.62,0.63,11.40159123,0.06097108,0.16401219,-16.23720727\n180,0.67,0.63,0,1,0.05,-0.95\n306.869898,0.58,0.75,1.4,0.2,0.15,-4.85\n180,0.63,0.75,0,1,0.05,-0.95\n306.027373,0.55,0.86,4.99945943,0.07352146,0.13601471,-13.4654558\n180,0.6,0.86,0,1,0.05,-0.95\n305.537678,0.5,1,4.99864847,0.11624764,0.17204651,-8.43027876\n"),!1),N(O.ParsePatFile("\n*ZIGZAG,ZIGZAG\n0, 0,0, .125,.125, .125,-.125\n90, .125,0, .125,.125, .125,-.125\n"),!1);const as=65536,_y=15*Math.PI/180,V6="__point_shape",X6={DIMTXT:function(){return 2.5},DIMASZ:2.5,DIMCLRD:0,DIMCLRE:0,DIMCLRT:0,DIMDEC:2,DIMDLE:0,DIMDSEP:46,DIMEXE:1.25,DIMEXO:.625,DIMFXL:1,DIMFXLON:!1,DIMGAP:.625,DIMLFAC:1,DIMRND:0,DIMSAH:0,DIMSCALE:1,DIMSD1:0,DIMSD2:0,DIMSE1:0,DIMSE2:0,DIMSOXD:!1,DIMTSZ:0,DIMZIN:8};class fa{constructor(e){this.options=Object.create(fa.DefaultOptions),e&&Object.assign(this.options,e.sceneOptions),this.origin=null,this.batches=new aa((t,n)=>t.key.Compare(n.key)),this.layers=new Map,this.blocks=new Map,this.dimStyles=new Map,this.vars=new Map,this.fontStyles=new Map,this.inserts=new Map,this.bounds=null,this.pointShapeBlock=null,this.numBlocksFlattened=0,this.numEntitiesFiltered=0}Build(e,t){var n=this;return(0,pt.A)(function*(){const s=e.header||{};for(const[r,a]of Object.entries(s))r.startsWith("$")&&n.vars.set(r.slice(1),a);if(n.angBase=n.vars.get("ANGBASE")??0,n.angDir=n.vars.get("ANGDIR")??0,n.pdMode=n.vars.get("PDMODE")??0,n.pdSize=n.vars.get("PDSIZE")??0,n.isMetric=1==(n.vars.get("MEASUREMENT")??1),e.tables&&e.tables.layer)for(const[,r]of Object.entries(e.tables.layer.layers))r.displayName=_i(r.name),n.layers.set(r.name,r);if(e.tables&&e.tables.dimstyle)for(const[,r]of Object.entries(e.tables.dimstyle.dimStyles))n.dimStyles.set(r.name,r);if(e.tables&&e.tables.style)for(const[,r]of Object.entries(e.tables.style.styles))n.fontStyles.set(r.styleName,r);if(e.blocks)for(const[,r]of Object.entries(e.blocks))n.blocks.set(r.name,new Y6(r));n.textRenderer=new R6(t,n.options.textOptions),n.hasMissingChars=!1,yield n._FetchFonts(e);for(const r of e.entities)n._FilterEntity(r)&&("INSERT"===r.type?(n.inserts.set(r.handle,r),n.blocks.get(r.name)?.RegisterInsert(r)):"DIMENSION"==r.type&&null!==(r.block??null)&&n.blocks.get(r.block)?.RegisterInsert(r));for(const r of n.blocks.values()){if(r.data.hasOwnProperty("entities")){const a=r.DefinitionContext();for(const o of r.data.entities)n._FilterEntity(o)&&n._ProcessDxfEntity(o,a)}r.SetFlatten()&&n.numBlocksFlattened++}console.log(`${n.numBlocksFlattened} blocks flattened`);for(const r of e.entities)n._FilterEntity(r)?n._ProcessDxfEntity(r):n.numEntitiesFiltered++;console.log(`${n.numEntitiesFiltered} entities filtered`),n.scene=n._BuildScene(),delete n.batches,delete n.layers,delete n.blocks,delete n.textRenderer})()}_FilterEntity(e){if(e.hidden)return!1;const t=this._GetEntityLayer(e);return!("0"!=t&&this.layers.get(t)?.frozen||this.options.suppressPaperSpace&&e.inPaperSpace)}_FetchFonts(e){var t=this;return(0,pt.A)(function*(){function n(r){return"TEXT"===r.type||"MTEXT"===r.type||"DIMENSION"===r.type||"ATTDEF"===r.type||"ATTRIB"===r.type}const s=function(){var r=(0,pt.A)(function*(a){if(!t._FilterEntity(a))return;let o;if("TEXT"===a.type||"ATTRIB"===a.type||"ATTDEF"===a.type)o=yield t.textRenderer.FetchFonts(_i(a.text));else if("MTEXT"===a.type){const l=new xi;l.Parse(a.text),o=!0;for(const c of l.GetText())if(!(yield t.textRenderer.FetchFonts(_i(c)))){o=!1;break}}else{if("DIMENSION"!==a.type)throw new Error("Bad entity type");{o=!0;const l=t._CreateLinearDimension(a);if(l)for(const c of l.GetTexts())if(!(yield t.textRenderer.FetchFonts(c))){o=!1;break}}}return o||(t.hasMissingChars=!0),o});return function(o){return r.apply(this,arguments)}}();for(const r of e.entities)if(n(r)&&!(yield s(r)))return;for(const r of t.blocks.values())if(r.data.hasOwnProperty("entities"))for(const a of r.data.entities)if(n(a)&&!(yield s(a)))return})()}_ProcessDxfEntity(e,t=null){let n;switch(e.type){case"LINE":n=this._DecomposeLine(e,t);break;case"POLYLINE":case"LWPOLYLINE":n=this._DecomposePolyline(e,t);break;case"ARC":n=this._DecomposeArc(e,t);break;case"CIRCLE":n=this._DecomposeCircle(e,t);break;case"ELLIPSE":n=this._DecomposeEllipse(e,t);break;case"POINT":n=this._DecomposePoint(e,t);break;case"SPLINE":n=this._DecomposeSpline(e,t);break;case"INSERT":return void this._ProcessInsert(e,t);case"TEXT":n=this._DecomposeText(e,t);break;case"MTEXT":n=this._DecomposeMText(e,t);break;case"3DFACE":n=this._Decompose3DFace(e,t);break;case"SOLID":n=this._DecomposeSolid(e,t);break;case"DIMENSION":n=this._DecomposeDimension(e,t);break;case"ATTRIB":n=this._DecomposeAttribute(e,t);break;case"HATCH":n=this._DecomposeHatch(e,t);break;default:return void console.log("Unhandled entity type: "+e.type)}for(const s of n)this._ProcessEntity(s,t)}_ProcessEntity(e,t=null){switch(e.type){case Xe.Type.POINTS:this._ProcessPoints(e,t);break;case Xe.Type.LINE_SEGMENTS:this._ProcessLineSegments(e,t);break;case Xe.Type.POLYLINE:this._ProcessPolyline(e,t);break;case Xe.Type.TRIANGLES:this._ProcessTriangles(e,t);break;default:throw new Error("Unhandled entity type: "+e.type)}}_GetLineType(e,t=null,n=null){return 0}_IsPlainLine(e){return!0}*_DecomposeLine(e,t){if(2!==e.vertices.length)return;const n=this._GetEntityLayer(e,t),s=this._GetEntityColor(e,t);yield new Xe({type:Xe.Type.LINE_SEGMENTS,vertices:e.vertices,layer:n,color:s,lineType:this._GetLineType(e,e.vertices[0])})}_GenerateBulgeVertices(e,t,n,s){const r=4*Math.atan(s),a=Math.abs(r);if(a<this.options.arcTessellationAngle)return void e.push(new H(n.x,n.y));const o=r/2,l=Math.sin(o),c=Math.cos(o),u={x:n.x-t.x,y:n.y-t.y},f=u.x*u.x+u.y*u.y;if(f<2*Number.MIN_VALUE)return;const d=Math.sqrt(f);let p=d/2/l;u.x/=d,u.y/=d;const m_x=(u.x*l-u.y*c)*p+t.x,m_y=(u.x*c+u.y*l)*p+t.y;let y=Math.floor(a/this.options.arcTessellationAngle);if(y<this.options.minArcTessellationSubdivisions&&(y=this.options.minArcTessellationSubdivisions),y>1){const v=Math.atan2(t.y-m_y,t.x-m_x),g=r/y;r<0&&(p=-p);for(let _=1;_<y;_++){const x=v+_*g,b=new H(m_x+p*Math.cos(x),m_y+p*Math.sin(x));e.push(b)}}e.push(new H(n.x,n.y))}_GenerateArcVertices({vertices:e,center:t,radius:n,startAngle:s=null,endAngle:r=null,tessellationAngle:a=null,yRadius:o=null,transform:l=null,rotation:c=null,ccwAngleDir:u=!0}){if(!t||!n)return;a||(a=this.options.arcTessellationAngle),null===o&&(o=n),null==s?s=0:s+=this.angBase;let f=!1;if(null==r?(r=s+2*Math.PI,f=!0):r+=this.angBase,!u){const v=s;s=-r,r=-v}for(;r<=s;)r+=2*Math.PI;const d=r-s;let p=Math.floor(d/a);0===p&&(p=1);const m=d/p;let y=null;c&&(y=(new Ye).makeRotation(c));for(let v=0;v<=p&&(v!==p||!f);v++){let g;g=u?s+v*m:s+(p-v)*m;const _=new H(n*Math.cos(g),o*Math.sin(g));y&&_.applyMatrix3(y),_.add(t),l&&_.applyMatrix3(l),e.push(_)}}*_DecomposeArc(e,t){const n=this._GetEntityColor(e,t),s=this._GetEntityLayer(e,t),r=this._GetLineType(e,null,t),a=[];this._GenerateArcVertices({vertices:a,center:e.center,radius:e.radius,startAngle:e.startAngle,endAngle:e.endAngle,transform:this._GetEntityExtrusionTransform(e)}),yield new Xe({type:Xe.Type.POLYLINE,vertices:a,layer:s,color:n,lineType:r,shape:void 0===e.endAngle})}*_DecomposeCircle(e,t){const n=this._GetEntityColor(e,t),s=this._GetEntityLayer(e,t),r=this._GetLineType(e,null,t),a=[];this._GenerateArcVertices({vertices:a,center:e.center,radius:e.radius,transform:this._GetEntityExtrusionTransform(e)}),yield new Xe({type:Xe.Type.POLYLINE,vertices:a,layer:s,color:n,lineType:r,shape:!0})}*_DecomposeEllipse(e,t){const n=this._GetEntityColor(e,t),s=this._GetEntityLayer(e,t),r=this._GetLineType(e,null,t),a=[],o=Math.sqrt(e.majorAxisEndPoint.x*e.majorAxisEndPoint.x+e.majorAxisEndPoint.y*e.majorAxisEndPoint.y),l=o*e.axisRatio,c=Math.atan2(e.majorAxisEndPoint.y,e.majorAxisEndPoint.x),u=e.startAngle??0;let f=e.endAngle??u+2*Math.PI;for(;f<=u;)f+=2*Math.PI;const d=null===(e.endAngle??null)||Math.abs(f-u-2*Math.PI)<1e-6;this._GenerateArcVertices({vertices:a,center:e.center,radius:o,startAngle:e.startAngle,endAngle:d?null:e.endAngle,yRadius:l,rotation:c,ccwAngleDir:!this._GetEntityExtrusionTransform(e)}),yield new Xe({type:Xe.Type.POLYLINE,vertices:a,layer:s,color:n,lineType:r,shape:d})}*_DecomposePoint(e,t){if(this.pdMode===S0.NONE||this.pdMode!==S0.DOT&&this.pdSize<=0)return;const n=this._GetEntityColor(e,t),s=this._GetEntityLayer(e,t),r=this.pdMode&S0.MARK_MASK;if(0!==(this.pdMode&S0.SHAPE_MASK)){const l=new et(s,V6,et.GeometryType.POINT_INSTANCE,n,0);return this._GetBatch(l).PushVertex(this._TransformVertex(e.position)),void this._CreatePointShapeBlock()}if(r===S0.DOT)return void(yield new Xe({type:Xe.Type.POINTS,vertices:[e.position],layer:s,color:n,lineType:null}));const o=[];this._CreatePointMarker(o,r,e.position),yield new Xe({type:Xe.Type.LINE_SEGMENTS,vertices:o,layer:s,color:n,lineType:null})}*_DecomposeAttribute(e,t){if(!this.textRenderer.canRender)return;const n=this.inserts.get(e.ownerHandle),s=this._GetEntityLayer(n??e,t),r=this._GetEntityColor(n??e,t);yield*this.textRenderer.Render({text:_i(e.text),fontSize:e.textHeight*e.scale,startPos:e.startPoint,endPos:e.endPoint,rotation:e.rotation,hAlign:e.horizontalJustification,vAlign:e.verticalJustification,color:r,layer:s})}_CreatePointMarker(e,t,n=null){const s=this;function r(a,o){e.push({x:(n?.x??0)+a*s.pdSize*.5,y:(n?.y??0)+o*s.pdSize*.5})}switch(t){case S0.PLUS:r(0,1.5),r(0,-1.5),r(-1.5,0),r(1.5,0);break;case S0.CROSS:r(-1,1),r(1,-1),r(1,1),r(-1,-1);break;case S0.TICK:r(0,1),r(0,0);break;default:console.warn("Unsupported point display type: "+t)}}_CreatePointShapeBlock(){if(this.pointShapeBlock)return;this.pointShapeBlock=new Y6({name:V6,position:{x:0,y:0}}),this.pointShapeBlock.offset=new H(0,0);const e=this.pointShapeBlock.DefinitionContext(),t=this.pdMode&S0.MARK_MASK;if(t!==S0.DOT&&t!==S0.NONE){const n=[];this._CreatePointMarker(n,t);const s=new Xe({type:Xe.Type.LINE_SEGMENTS,vertices:n,color:J0.BY_BLOCK});this._ProcessEntity(s,e)}if(this.pdMode&S0.SQUARE){const n=.5*this.pdSize,r=new Xe({type:Xe.Type.POLYLINE,vertices:[{x:-n,y:n},{x:n,y:n},{x:n,y:-n},{x:-n,y:-n}],color:J0.BY_BLOCK,shape:!0});this._ProcessEntity(r,e)}if(this.pdMode&S0.CIRCLE){const n=[];this._GenerateArcVertices({vertices:n,center:{x:0,y:0},radius:.5*this.pdSize,tessellationAngle:_y});const s=new Xe({type:Xe.Type.POLYLINE,vertices:n,color:J0.BY_BLOCK,shape:!0});this._ProcessEntity(s,e)}}*_Decompose3DFace(e,t){yield*this._DecomposeFace(e,e.vertices,t,this.options.wireframeMesh)}*_DecomposeSolid(e,t){yield*this._DecomposeFace(e,e.points,t,!1,this._GetEntityExtrusionTransform(e))}*_DecomposeFace(e,t,n,s,r=null){const a=this._GetEntityLayer(e,n),o=this._GetEntityColor(e,n);function l(y,v,g){const _=(new H).subVectors(v,y),x=(new H).subVectors(g,y);return Math.abs(_.cross(x))>Number.EPSILON}const c=new H(t[0].x,t[0].y),u=new H(t[1].x,t[1].y),f=new H(t[2].x,t[2].y);let d=null,p=l(c,u,f),m=!1;if(t.length>3&&(d=new H(t[3].x,t[3].y),m=l(u,d,f),r&&d.applyMatrix3(r)),r&&(c.applyMatrix3(r),u.applyMatrix3(r),f.applyMatrix3(r)),p||m)if(s){const y=[];p&&!m?y.push(c,u,f):!p&&m?y.push(u,d,f):y.push(c,u,d,f),yield new Xe({type:Xe.Type.POLYLINE,vertices:y,layer:a,color:o,shape:!0})}else{const y=[],v=[];p&&(y.push(c,u,f),v.push(0,1,2)),m&&(p?v.push(1,2,3):(y.push(u,f),v.push(0,1,2)),y.push(d)),yield new Xe({type:Xe.Type.TRIANGLES,vertices:y,indices:v,layer:a,color:o})}}*_DecomposeText(e,t){if(!this.textRenderer.canRender)return;const n=this._GetEntityLayer(e,t),s=this._GetEntityColor(e,t),r=this._GetEntityTextStyle(e),a=0===r?.fixedTextHeight?null:r?.fixedTextHeight;yield*this.textRenderer.Render({text:_i(e.text),fontSize:e.textHeight??a??1,startPos:e.startPoint,endPos:e.endPoint,rotation:e.rotation,hAlign:e.halign,vAlign:e.valign,widthFactor:e.xScale,color:s,layer:n})}*_DecomposeMText(e,t){if(!this.textRenderer.canRender)return;const n=this._GetEntityLayer(e,t),s=this._GetEntityColor(e,t),r=this._GetEntityTextStyle(e),a=0===r?.fixedTextHeight?null:r?.fixedTextHeight,o=new xi;o.Parse(_i(e.text)),yield*this.textRenderer.RenderMText({formattedText:o.GetContent(),fontSize:e.height??a,position:e.position,rotation:e.rotation,direction:e.direction,attachment:e.attachmentPoint,lineSpacing:e.lineSpacing,width:e.width,color:s,layer:n})}_CreateLinearDimension(e){const t=15&(e.dimensionType||0);if(0!=t&&1!=t||!e.linearOrAngularPoint1||!e.linearOrAngularPoint2||!e.anchorPoint)return null;let n=null;e.hasOwnProperty("styleName")&&(n=this.dimStyles.get(e.styleName));const s=new ty({p1:(new H).copy(e.linearOrAngularPoint1),p2:(new H).copy(e.linearOrAngularPoint2),anchor:(new H).copy(e.anchorPoint),isAligned:1==t,angle:e.angle,text:e.text,textAnchor:e.middleOfText?(new H).copy(e.middleOfText):null,textRotation:e.textRotation},r=>this._GetDimStyleValue(r,e,n),(r,a)=>this.textRenderer.GetLineWidth(r,a));return s.IsValid?s:(console.warn("Invalid dimension geometry detected for "+e.handle),null)}*_DecomposeDimension(e,t){if(null!==(e.block??null)&&this.blocks.has(e.block))return void this._ProcessInsert({name:e.block,position:{x:0,y:0},layer:e.layer,color:e.color,colorIndex:e.colorIndex},t);const n=this._CreateLinearDimension(e);if(!n)return;const s=this._GetEntityLayer(e,t),r=this._GetEntityColor(e,t),a=this._GetEntityExtrusionTransform(e),o=n.GenerateLayout();for(const l of o.lines){const c=[];a&&(l.start.applyMatrix3(a),l.end.applyMatrix3(a)),c.push(l.start,l.end),yield new Xe({type:Xe.Type.LINE_SEGMENTS,vertices:c,layer:s,color:l.color??r})}for(const l of o.triangles){if(a)for(const c of l.vertices)c.applyMatrix3(a);yield new Xe({type:Xe.Type.TRIANGLES,vertices:l.vertices,indices:l.indices,layer:s,color:l.color??r})}if(this.textRenderer.canRender)for(const l of o.texts)a&&l.position.applyMatrix3(a),yield*this.textRenderer.Render({text:l.text,fontSize:l.size,startPos:l.position,rotation:l.angle,hAlign:q0.CENTER,vAlign:bi.MIDDLE,color:l.color??r,layer:s})}_TransformBoundaryLoop(e,t,n){n||(n=[]);for(const s of e)t&&s.applyMatrix3(t),n.push(s.x),n.push(s.y);return n}*_DecomposeHatch(e,t){const n=this._GetHatchBoundaryLoops(e);if(0==n.length)return void console.warn("HATCH entity with empty boundary loops array (perhaps some loop types are not implemented yet)");const s=e.hatchStyle??0,r=this._GetEntityLayer(e,t),a=this._GetEntityColor(e,t),o=this._GetEntityExtrusionTransform(e);let l=null;if(n.sort((d,p)=>d.isExternal!=p.isExternal?d.isExternal?-1:1:d.isOutermost!=p.isOutermost?d.isOutermost?-1:1:0),s==ql.THROUGH_ENTIRE_AREA)l=[n[0].vertices];else if(s==ql.OUTERMOST){l=[];for(const d of n)(d.isExternal||d.isOutermost)&&l.push(d.vertices);0==l.length&&(l=null)}if(l||(l=n.map(d=>d.vertices)),e.isSolid){const d=this._TransformBoundaryLoop(l[0],o),p=[];for(let v=1;v<l.length;v++)p.push(d.length/2),this._TransformBoundaryLoop(l[v],o,d);const m=function sy(i,e,t=2){const n=e&&e.length,s=n?e[0]*t:i.length;let r=U6(i,0,s,t,!0);const a=[];if(!r||r.next===r.prev)return a;let o,l,c;if(n&&(r=function cy(i,e,t,n){const s=[];for(let r=0,a=e.length;r<a;r++){const c=U6(i,e[r]*n,r<a-1?e[r+1]*n:i.length,n,!1);c===c.next&&(c.steiner=!0),s.push(gy(c))}s.sort(hy);for(let r=0;r<s.length;r++)t=uy(s[r],t);return t}(i,e,r,t)),i.length>80*t){o=i[0],l=i[1];let u=o,f=l;for(let d=t;d<s;d+=t){const p=i[d],m=i[d+1];p<o&&(o=p),m<l&&(l=m),p>u&&(u=p),m>f&&(f=m)}c=Math.max(u-o,f-l),c=0!==c?32767/c:0}return la(r,a,t,o,l,c,0),a}(d,p),y=[];for(const v of l)y.push(...v);return void(yield new Xe({type:Xe.Type.TRIANGLES,vertices:y,indices:m,layer:r,color:a}))}const c=new iy(l,s);let u=null;if(e.definitionLines&&(u=new O(e.definitionLines,e.patternName,!1)),(null==u||u.isQcadDefault)&&e.patternName){const d=k6(e.patternName,this.isMetric);d?u=d:console.log(`Hatch pattern with name ${e.patternName} not found (metric: ${this.isMetric})`)}if(null==u&&(u=k6("ANSI31")),!u)return;const f=e.seedPoints?e.seedPoints:[{x:0,y:0}];for(const d of f){const p=u.offsetInLineSpace?c.GetPatternTransform({seedPoint:d,angle:e.patternAngle,scale:e.patternScale}):new Ye;for(const m of u.lines){let y,v;if(u.offsetInLineSpace)y=m.offset.x,v=m.offset.y;else{const w=Math.sin(-(m.angle??0)),I=Math.cos(-(m.angle??0));y=m.offset.x*I-m.offset.y*w,v=m.offset.x*w+m.offset.y*I}v<0&&(v=-v,y=-y);const g=c.GetLineTransform({patTransform:p,basePoint:m.base,angle:m.angle??0}),_=c.GetBoundingBox(g),x=.05*(_.max.x-_.min.x);let b,T,E;if(0==v?(b=0,T=0):(b=Math.ceil(_.min.y/v),T=Math.floor(_.max.y/v)),T-b>2e4){console.warn("Too many lines produced by hatching pattern");continue}if(m.dashes&&m.dashes.length>1){E=0;for(const w of m.dashes)w<0?E-=w:E+=w}else E=null;const M=g.clone().invert();for(let w=b;w<=T;w++){let J=function(Y){return(Y-P)/te},Z=function(Y){const he=G.clone().multiplyScalar(Y[0]).add(U),Ce=G.clone().multiplyScalar(Y[1]).add(U);return o&&(he.applyMatrix3(o),Ce.applyMatrix3(o)),new Xe(Y[1]-Y[0]<=Number.EPSILON?{type:Xe.Type.POINTS,vertices:[he],layer:r,color:a}:{type:Xe.Type.LINE_SEGMENTS,vertices:[he,Ce],layer:r,color:a})};const I=w*v,S=w*y,P=_.min.x-x,X=_.max.x+x,te=X-P,U=new H(P,I).applyMatrix3(M),z=new H(X,I).applyMatrix3(M),G=z.clone().sub(U),ee=c.ClipLine([U,z]);function*ne(Y,he){for(const Ce of ee){if(Ce[0]>=he)return;if(Ce[1]<=Y)continue;const Q=Math.max(Y,Ce[0]),ae=Math.min(he,Ce[1]);yield[Q,ae],Y=ae}}if(null!==E){let Y=Math.floor((P-S)/E),he=Math.floor((X-S)/E);if(he-Y>=2e4){console.warn("Too many segments produced by hatching pattern line");continue}for(let Ce=Y;Ce<=he;Ce++){let Q=J(S+Ce*E);for(let ae of m.dashes){const xe=ae<0;xe&&(ae=-ae);const Ee=ae/te;if(!xe)for(const Le of ne(Q,Q+Ee))yield Z(Le);Q+=Ee}}}else for(const Y of ee)yield Z(Y)}}}}_GetHatchBoundaryLoops(e){if(!e.boundaryLoops)return[];const t=[],n=(s,r)=>{const a=r.length;if(0!=a){if(0==s.length)s.push(r[0]);else{const o=s[s.length-1];(o.x!=r[0].x||o.y!=r[0].y)&&s.push(r[0])}for(let o=1;o<a;o++)s.push(r[o])}};for(const s of e.boundaryLoops){const r=[];if(2&s.type)for(let a=0;a<s.polyline.vertices.length;a++){const o=s.polyline.vertices[a];0==(o.bulge??0)?r.push(new H(o.x,o.y)):(0==(s.polyline.vertices[0==a?s.polyline.vertices.length-1:a-1].bulge??0)&&r.push(new H(o.x,o.y)),this._GenerateBulgeVertices(r,o,s.polyline.vertices[a==s.polyline.vertices.length-1?0:a+1],o.bulge))}else if(s.edges&&s.edges.length>0)for(const a of s.edges)switch(a.type){case 1:n(r,[new H(a.start.x,a.start.y),new H(a.end.x,a.end.y)]);break;case 2:{const u=[];this._GenerateArcVertices({vertices:u,center:a.start,radius:a.radius,startAngle:a.startAngle,endAngle:a.endAngle,ccwAngleDir:a.isCcw}),n(r,u);break}case 3:{const u=a.start,f=a.end,d=Math.sqrt(f.x*f.x+f.y*f.y),m=d*a.radius,y=Math.atan2(f.y,f.x),v=[];if(this._GenerateArcVertices({vertices:v,center:u,radius:d,startAngle:a.startAngle,endAngle:a.endAngle,yRadius:m,ccwAngleDir:a.isCcw}),0!==y){const g=Math.cos(y),_=Math.sin(y);for(const x of v){const b=x.x-u.x,T=x.y-u.y;x.x=b*g-T*_+u.x,x.y=b*_+T*g+u.y}}n(r,v);break}case 4:const o=a.controlPoints.map(u=>[u.x,u.y]),l=4*o.length,c=1/l;for(let u=0;u<=l;u++){const f=this._InterpolateSpline(u*c,a.degreeOfSplineCurve,o,a.knotValues);r.push(new H(f[0],f[1]))}break;default:console.warn("Unhandled hatch boundary loop edge type: "+a.type)}if(r.length>2){const a=r[0],o=r[r.length-1];o.x==a.x&&o.y==a.y&&(r.length=r.length-1)}r.length>2&&t.push({vertices:r,isExternal:s.isExternal,isOutermost:s.isOutermost})}return t}_GetDimStyleValue(e,t,n){const s=t?.xdata?.ACAD?.DSTYLE?.values;if(s){let r=!0,a=!1;for(const o of s){if(r){if(1070!=o.code)break;X1.get(o.value)==e&&(a=!0)}else if(a)return o.value;r=!r}}if(n&&n.hasOwnProperty(e))return n[e];if(this.vars.has(e))return this.vars.get(e);if(X6.hasOwnProperty(e)){const r=X6[e];return r instanceof Function?r.call(this):r}return null}_ProcessInsert(e,t=null){if(t){if(t.name===e.name)return void console.warn("Recursive block reference: "+t.name);const c=this.blocks.get(e.name);if(!c)return void console.warn("Unresolved nested block reference: "+e.name);const u=t.NestedBlockContext(c,e);if(c.data.entities)for(const f of c.data.entities)this._ProcessDxfEntity(f,u);return}const n=this.blocks.get(e.name);if(!n)return void console.warn("Unresolved block reference in INSERT: "+e.name);if(!n.HasGeometry())return;const s=this._GetEntityLayer(e,null),r=this._GetEntityColor(e,null),a=this._GetLineType(e,null,null),o=n.InstantiationContext().GetInsertionTransform(e),l=n.bounds;if(this._UpdateBounds(new H(l.minX,l.minY).applyMatrix3(o)),this._UpdateBounds(new H(l.maxX,l.maxY).applyMatrix3(o)),this._UpdateBounds(new H(l.minX,l.maxY).applyMatrix3(o)),this._UpdateBounds(new H(l.maxX,l.minY).applyMatrix3(o)),o.translate(-this.origin.x,-this.origin.y),n.flatten)for(const c of n.batches)this._FlattenBatch(c,s,r,a,o);else{const c=new et(s,e.name,et.GeometryType.BLOCK_INSTANCE,r,a);this._GetBatch(c).PushInstanceTransform(o)}}_FlattenBatch(e,t,n,s,r){t??=e.key.layerName;const a=t?this.layers.get(t):null;let o;o=e.key.color===J0.BY_BLOCK?n:e.key.color===J0.BY_LAYER?a?.color??0:e.key.color;const c=new et(t,null,e.key.geometryType,o,0);this._GetBatch(c).Merge(e,r)}*_GenerateShapedPolyline(e,t,n,s,r){yield new Xe({type:Xe.Type.POLYLINE,vertices:e,layer:t,color:n,lineType:s,shape:r})}_MirrorEntityVertices(e,t=null){if(!e.extrusionDirection||e.extrusionDirection.z>=0)return t??e.vertices;(!t||t===e.vertices)&&(t=e.vertices.slice());const n=t.length;for(let s=0;s<n;s++){const r=t[s],a={x:-r.x};for(const o in r)r.hasOwnProperty(o)&&"x"!==o&&(a[o]=r[o]);t[s]=a}return t}*_DecomposePolyline(e,t=null){if(e.isPolyfaceMesh)return void(yield*this._DecomposePolyfaceMesh(e,t));let n,s;if(e.includesCurveFitVertices||e.includesSplineFitVertices?(n=e.vertices.filter(p=>p.splineVertex||p.curveFittingVertex),s=n.length):(n=e.vertices,s=e.vertices.length),s<2)return;n=this._MirrorEntityVertices(e,n);const r=this._GetEntityColor(e,t),a=this._GetEntityLayer(e,t),o=this;let l=0,c=this._IsPlainLine(n[0]),u=this._GetLineType(e,n[0],t),f=null;function*d(p){if(p===l)return;let m=!1,y=f;p===s&&0===l?(m=!0,null===y&&(y=n)):p===s-1&&0===l?null===y&&(y=n):p===s?null===y&&(y=n.slice(l,p),y.push(n[0])):null===y&&(y=n.slice(l,p+1)),c?yield new Xe({type:Xe.Type.POLYLINE,vertices:y,layer:a,color:r,lineType:u,shape:m}):yield*o._GenerateShapedPolyline(y,a,r,u,m),l=p,p!==s&&(c=o._IsPlainLine(n[p]),u=o._GetLineType(e,n[p])),f=null}for(let p=1;p<=s;p++){const m=n[p-1];let y;if(p===s){if(!e.shape){yield*d(p-1);break}y=n[0]}else y=n[p];if(m.bulge&&c?(null===f&&(f=n.slice(l,p)),this._GenerateBulgeVertices(f,m,y,m.bulge)):null!==f&&f.push(y),p===s){yield*d(p);break}const v=this._IsPlainLine(y),g=this._GetLineType(e,y);(v!==c||c&&g!==u)&&(yield*d(p))}}*_DecomposePolyfaceMesh(e,t=null){const n=this._GetEntityLayer(e,t),s=this._GetEntityColor(e,t),r=[],a=[];for(const c of e.vertices)if(c.faces){const u={indices:[],hiddenEdges:[]};for(let f of c.faces){if(0==f)break;if(f>r.length){if(65536-f>r.length)continue;f-=65536}u.indices.push(f<0?-f-1:f-1),u.hiddenEdges.push(f<0)}(3==u.indices.length||4==u.indices.length)&&a.push(u)}else r.push(new H(c.x,c.y));const o=[],l=(c,u)=>{if(o.length>0){const f=o[o.length-1];if(f.indices[f.indices.length-1]==c)return void f.indices.push(u);f.indices[0]==f.indices[f.indices.length-1]&&(f.isClosed=!0)}o.push({indices:[c,u],isClosed:!1})};for(const c of a)if(this.options.wireframeMesh)for(let u=0;u<c.indices.length;u++)c.hiddenEdges[u]||l(c.indices[u],c.indices[u<c.indices.length-1?u+1:0]);else{let u;u=3==c.indices.length?c.indices:[c.indices[0],c.indices[1],c.indices[2],c.indices[0],c.indices[2],c.indices[3]],yield new Xe({type:Xe.Type.TRIANGLES,vertices:r,indices:u,layer:n,color:s})}if(this.options.wireframeMesh)for(const c of o)if(2==c.length)yield new Xe({type:Xe.Type.LINE_SEGMENTS,vertices:[r[c.indices[0]],r[c.indices[1]]],layer:n,color:s});else{const u=[];for(const f of c.indices)u.push(r[f]);yield new Xe({type:Xe.Type.POLYLINE,vertices:u,layer:n,color:s,shape:c.isClosed})}}*_DecomposeSpline(e,t=null){const n=this._GetEntityColor(e,t),s=this._GetEntityLayer(e,t),r=this._GetLineType(e,null,t);if(!e.controlPoints)return;const a=e.controlPoints.map(u=>[u.x,u.y]),o=[],l=4*a.length,c=1/l;for(let u=0;u<=l;u++){const f=this._InterpolateSpline(u*c,e.degreeOfSplineCurve,a,e.knotValues);o.push({x:f[0],y:f[1]})}yield new Xe({type:Xe.Type.POLYLINE,vertices:o,layer:s,color:n,lineType:r})}_InterpolateSpline(e,t,n,s=null,r=null){let a,o,l,c;const u=n.length,f=n[0].length;if(t<1)throw new Error("Degree must be at least 1 (linear)");if(t>u-1)throw new Error("Degree must be less than or equal to point count - 1");if(!r)for(r=[],a=0;a<u;a++)r[a]=1;if(s){if(s.length!==u+t+1)throw new Error("Bad knot vector length")}else for(s=[],a=0;a<u+t+1;a++)s[a]=a;const d=[t,s.length-1-t],p=s[d[0]],m=s[d[1]];for((e=e*(m-p)+p)<p?e=p:e>m&&(e=m),l=d[0];l<d[1]&&!(e>=s[l]&&e<=s[l+1]);l++);const y=[];for(a=0;a<u;a++){for(y[a]=[],o=0;o<f;o++)y[a][o]=n[a][o]*r[a];y[a][f]=r[a]}let v;for(c=1;c<=t+1;c++)for(a=l;a>l-t-1+c;a--)for(v=(e-s[a])/(s[a+t+1-c]-s[a]),o=0;o<f+1;o++)y[a][o]=(1-v)*y[a-1][o]+v*y[a][o];const g=[];for(a=0;a<f;a++)g[a]=y[l][a]/y[l][f];return g}_ProcessPoints(e,t=null){const n=new et(e.layer,t?.name,et.GeometryType.POINTS,e.color,0),s=this._GetBatch(n);for(const r of e.vertices)s.PushVertex(this._TransformVertex(r,t))}_ProcessLineSegments(e,t=null){if(e.vertices.length%2!=0)throw Error("Even number of vertices expected");const n=new et(e.layer,t?.name,et.GeometryType.LINES,e.color,e.lineType),s=this._GetBatch(n);for(const r of e.vertices)s.PushVertex(this._TransformVertex(r,t))}_ProcessPolyline(e,t=null){if(e.vertices.length<2)return;const n=e.vertices.length;if(n<=3){const a=new et(e.layer,t?.name,et.GeometryType.LINES,e.color,e.lineType),o=this._GetBatch(a);let l=null;for(const c of e.vertices)null!==l&&(o.PushVertex(this._TransformVertex(l,t)),o.PushVertex(this._TransformVertex(c,t))),l=c;return void(e.shape&&n>2&&(o.PushVertex(this._TransformVertex(e.vertices[n-1],t)),o.PushVertex(this._TransformVertex(e.vertices[0],t))))}const s=new et(e.layer,t?.name,et.GeometryType.INDEXED_LINES,e.color,e.lineType),r=this._GetBatch(s);for(const a of e._IterateLineChunks()){const o=r.PushChunk(a.verticesCount);for(const l of a.vertices)o.PushVertex(this._TransformVertex(l,t));for(const l of a.indices)o.PushIndex(l);o.Finish()}}_ProcessTriangles(e,t=null){if(e.vertices.length<3)return;if(e.indices.length%3!=0)return void console.error("Unexpected size of indices array: "+e.indices.length);const n=new et(e.layer,t?.name,et.GeometryType.INDEXED_TRIANGLES,e.color,0),r=this._GetBatch(n).PushChunk(e.vertices.length);for(const a of e.vertices)r.PushVertex(this._TransformVertex(a,t));for(const a of e.indices)r.PushIndex(a);r.Finish()}_GetEntityColor(e,t=null){let n=J0.BY_LAYER;if(0===e.colorIndex)n=J0.BY_BLOCK;else if(256===e.colorIndex){if(e.hasOwnProperty("layer")){const s=this.layers.get(e.layer);if(s)return s.color}n=J0.BY_LAYER}else e.hasOwnProperty("color")&&null!=e.color&&(n=e.color);if(t)return n;if(n===J0.BY_BLOCK)return 16777215;if(n!==J0.BY_LAYER)return n;if(e.hasOwnProperty("layer")){const s=this.layers.get(e.layer);if(s&&null!=s.color)return s.color}return 0}_GetEntityLayer(e,t=null){return e.hasOwnProperty("layer")&&null!=e.layer?e.layer:t?null:"0"}_GetEntityTextStyle(e){return e.hasOwnProperty("styleName")?this.fontStyles.get(e.styleName)??null:null}_GetEntityExtrusionTransform(e){return!e.hasOwnProperty("extrusionDirection")||e.extrusionDirection.z>0?null:(new Ye).scale(-1,1)}_GetBatch(e){let t=this.batches.find({key:e});if(null!==t)return t;if(t=new Ey(e),this.batches.insert(t),null!==e.blockName&&!e.IsInstanced()){const n=this.blocks.get(e.blockName);n&&n.batches.push(t)}return t}_TransformVertex(e,t=null){return t?t.TransformVertex(e):(this._UpdateBounds(e),{x:e.x-this.origin.x,y:e.y-this.origin.y})}_UpdateBounds(e){null===this.bounds?this.bounds={minX:e.x,maxX:e.x,minY:e.y,maxY:e.y}:(e.x<this.bounds.minX?this.bounds.minX=e.x:e.x>this.bounds.maxX&&(this.bounds.maxX=e.x),e.y<this.bounds.minY?this.bounds.minY=e.y:e.y>this.bounds.maxY&&(this.bounds.maxY=e.y)),null===this.origin&&(this.origin={x:e.x,y:e.y})}_BuildScene(){let e=0,t=0,n=0;this.batches.each(a=>{e+=a.GetVerticesBufferSize(),t+=a.GetIndicesBufferSize(),n+=a.GetTransformsSize()});const s={vertices:new ArrayBuffer(e),indices:new ArrayBuffer(t),transforms:new ArrayBuffer(n),batches:[],layers:[],origin:this.origin,bounds:this.bounds,hasMissingChars:this.hasMissingChars},r={vertices:new Float32Array(s.vertices),verticesOffset:0,indices:new Uint16Array(s.indices),indicesOffset:0,transforms:new Float32Array(s.transforms),transformsOffset:0};this.batches.each(a=>{s.batches.push(a.Serialize(r))});for(const a of this.layers.values())a.frozen||s.layers.push({name:a.name,displayName:a.displayName,color:a.color});return s.pointShapeHasDot=(this.pdMode&S0.MARK_MASK)===S0.DOT,s}}class Ey{constructor(e){this.key=e,e.IsIndexed()?this.chunks=[]:e.geometryType===et.GeometryType.BLOCK_INSTANCE?this.transforms=new s1(9):this.vertices=new s1(9)}PushVertex(e){const t=this.vertices.Push(e.x);return this.vertices.Push(e.y),t}PushInstanceTransform(e){for(let t=0;t<2;t++)for(let n=0;n<3;n++)this.transforms.Push(e.elements[3*n+t])}PushChunk(e){if(e>as)throw new Error("Vertices count exceeds chunk limit: "+e);let t=null,n=0;for(const s of this.chunks){const r=as-s.vertices.GetSize()/2;r<e||(null===t||r<n)&&(t=s,n=r)}return null===t&&(t=this._NewChunk(e)),new wy(t,e)}Merge(e,t=null){if(this.key.geometryType!==e.key.geometryType)throw new Error(`Rendering batch merging geometry type mismatch: ${this.key.geometryType} !== ${e.key.geometryType}`);if(this.key.IsInstanced())throw new Error("Attempted to merge instanced batch");if(this.key.IsIndexed())for(const n of e.chunks){const s=n.vertices.size,r=this.PushChunk(s/2);for(let o=0;o<s;o+=2){const l=new H(n.vertices.Get(o),n.vertices.Get(o+1));t&&l.applyMatrix3(t),r.PushVertex(l)}const a=n.indices.size;for(let o=0;o<a;o++)r.PushIndex(n.indices.Get(o));r.Finish()}else{const n=e.vertices.size;for(let s=0;s<n;s+=2){const r=new H(e.vertices.Get(s),e.vertices.Get(s+1));t&&r.applyMatrix3(t),this.PushVertex(r)}}}GetVerticesBufferSize(){if(this.key.IsIndexed()){let e=0;for(const t of this.chunks)e+=t.vertices.GetSize();return e*Float32Array.BYTES_PER_ELEMENT}return this.key.geometryType===et.GeometryType.BLOCK_INSTANCE?0:this.vertices.GetSize()*Float32Array.BYTES_PER_ELEMENT}GetIndicesBufferSize(){if(this.key.IsIndexed()){let e=0;for(const t of this.chunks)e+=t.indices.GetSize();return e*Uint16Array.BYTES_PER_ELEMENT}return 0}GetTransformsSize(){return this.key.geometryType===et.GeometryType.BLOCK_INSTANCE?this.transforms.GetSize()*Float32Array.BYTES_PER_ELEMENT:0}Serialize(e){if(this.key.IsIndexed()){const t={key:this.key,chunks:[]};for(const n of this.chunks)t.chunks.push(n.Serialize(e));return t}if(this.key.geometryType===et.GeometryType.BLOCK_INSTANCE){const t=this.transforms.GetSize(),n={key:this.key,transformsOffset:e.transformsOffset,transformsSize:t};return this.transforms.CopyTo(e.transforms,e.transformsOffset),e.transformsOffset+=t,n}{const t=this.vertices.GetSize(),n={key:this.key,verticesOffset:e.verticesOffset,verticesSize:t};return this.vertices.CopyTo(e.vertices,e.verticesOffset),e.verticesOffset+=t,n}}_NewChunk(e){const t=new Ty(e);return this.chunks.push(t),t}}class Y6{constructor(e){this.data=e,this.useCount=0,this.nestedUseCount=0,this.verticesCount=0,this.offset=null,this.batches=[],this.flatten=!1,this.bounds=null}SetFlatten(){return!!this.HasGeometry()&&(this.flatten=1===this.useCount||this.useCount*this.verticesCount<=1024,this.flatten)}HasGeometry(){return null!==this.offset}RegisterInsert(e){this.useCount++}RegisterNestedUse(e){this.nestedUseCount++}DefinitionContext(){return new k0(this,k0.Type.DEFINITION)}InstantiationContext(){return new k0(this,k0.Type.INSTANTIATION)}UpdateBounds(e){null===this.bounds?this.bounds={minX:e.x,maxX:e.x,minY:e.y,maxY:e.y}:(e.x<this.bounds.minX?this.bounds.minX=e.x:e.x>this.bounds.maxX&&(this.bounds.maxX=e.x),e.y<this.bounds.minY?this.bounds.minY=e.y:e.y>this.bounds.maxY&&(this.bounds.maxY=e.y))}}class k0{constructor(e,t){this.block=e,this.type=t,this.origin=this.block.data.position,this.transform=new Ye}get name(){return this.block.data.name}TransformVertex(e){const t=new H(e.x,e.y).applyMatrix3(this.transform);if(this.type!==k0.Type.DEFINITION&&this.type!==k0.Type.NESTED_DEFINITION)throw new Error("Unexpected transform type");if(this.block.verticesCount++,null===this.block.offset){this.block.offset=t;const n=new H;return this.block.UpdateBounds(n),n}return t.sub(this.block.offset),this.block.UpdateBounds(t),t}GetInsertionTransform(e){const t=(new Ye).translate(-this.origin.x,-this.origin.y),r=-(e.rotation||0)*Math.PI/180;let a=e.position.x;const o=e.position.y;if(t.scale(e.xScale||1,e.yScale||1),t.rotate(r),t.translate(a,o),e.extrusionDirection&&e.extrusionDirection.z<0&&t.scale(-1,1),this.type!==k0.Type.INSTANTIATION)return t;const l=(new Ye).translate(this.block.offset.x,this.block.offset.y);return t.multiply(l)}NestedBlockContext(e,t){e.RegisterNestedUse(this.block);const s=new k0(e,k0.Type.NESTED_DEFINITION).GetInsertionTransform(t),r=new k0(this.block,k0.Type.NESTED_DEFINITION);return r.transform=(new Ye).multiplyMatrices(this.transform,s),r}}k0.Type=Object.freeze({DEFINITION:0,NESTED_DEFINITION:1,INSTANTIATION:2});class Ty{constructor(e){e<16&&(e=16),this.indices=new s1(4,2*e),this.vertices=new s1(9,2*e)}Serialize(e){const t={};{const n=this.vertices.GetSize();t.verticesOffset=e.verticesOffset,t.verticesSize=n,this.vertices.CopyTo(e.vertices,e.verticesOffset),e.verticesOffset+=n}{const n=this.indices.GetSize();t.indicesOffset=e.indicesOffset,t.indicesSize=n,this.indices.CopyTo(e.indices,e.indicesOffset),e.indicesOffset+=n}return t}}class wy{constructor(e,t){this.chunk=e,this.verticesCount=t,this.verticesOffset=this.chunk.vertices.GetSize()/2,this.numVerticesPushed=0}PushVertex(e){if(this.numVerticesPushed===this.verticesCount)throw new Error;this.chunk.vertices.Push(e.x),this.chunk.vertices.Push(e.y),this.numVerticesPushed++}PushIndex(e){if(e<0||e>=this.verticesCount)throw new Error(`Index out of range: ${e}/${this.verticesCount}`);this.chunk.indices.Push(e+this.verticesOffset)}Finish(){if(this.numVerticesPushed!==this.verticesCount)throw new Error(`Not all vertices pushed: ${this.numVerticesPushed}/${this.verticesCount}`)}}class Xe{constructor({type:e,vertices:t,indices:n=null,layer:s=null,color:r,lineType:a=0,shape:o=!1}){this.type=e,this.vertices=t,this.indices=n,this.layer=s,this.color=r,this.lineType=a,this.shape=o}*_IterateVertices(e,t){for(let n=e;n<e+t;n++)yield this.vertices[n]}*_IterateLineChunks(){const e=this.vertices.length;if(e<2)return;const t=this;for(let n=0;n<=e;n+=as){let r,a,o,l,s=e-n;if(s>as?(s=as,r=!1):r=!0,r&&this.shape&&n>0&&s===as&&(r=!1),n===e&&!this.shape)break;s<2?(a=1===s&&this.shape?function*(){yield this.vertices[n],yield this.vertices[0]}():1===s?function*(){yield this.vertices[n-1],yield this.vertices[n]}():function*(){yield this.vertices[e-1],yield this.vertices[0]}(),o=$l(2,!1),l=2):r&&this.shape&&n>0&&s<as?(a=function*(){yield*t._IterateVertices(n,s),yield this.vertices[0]}(),o=$l(s+1,!1),l=s+1):(a=this._IterateVertices(n,s),o=$l(s,r&&0===n&&this.shape),l=s),yield{verticesCount:l,vertices:a,indices:o}}}}function*$l(i,e){for(let t=0;t<i-1;t++)yield t,yield t+1;e&&i>2&&(yield i-1,yield 0)}Xe.Type=Object.freeze({POINTS:0,LINE_SEGMENTS:1,POLYLINE:2,TRIANGLES:3});const S0=Object.freeze({DOT:0,NONE:1,PLUS:2,CROSS:3,TICK:4,MARK_MASK:15,CIRCLE:32,SQUARE:64,SHAPE_MASK:240}),J0=Object.freeze({BY_LAYER:-1,BY_BLOCK:-2});var i,e;function da(){this.table=new Uint16Array(16),this.trans=new Uint16Array(288)}function Ay(i,e){this.source=i,this.sourceIndex=0,this.tag=0,this.bitcount=0,this.dest=e,this.destLen=0,this.ltree=new da,this.dtree=new da}fa.DefaultOptions={arcTessellationAngle:10/180*Math.PI,minArcTessellationSubdivisions:8,wireframeMesh:!1,suppressPaperSpace:!1,textOptions:R6.DefaultOptions},String.prototype.codePointAt||(e=function(t){if(null==this)throw TypeError();var n=String(this),s=n.length,r=t?Number(t):0;if(r!=r&&(r=0),!(r<0||r>=s)){var o,a=n.charCodeAt(r);return a>=55296&&a<=56319&&s>r+1&&(o=n.charCodeAt(r+1))>=56320&&o<=57343?1024*(a-55296)+o-56320+65536:a}},(i=function(){try{var t={},n=Object.defineProperty,s=n(t,t,t)&&n}catch{}return s}())?i(String.prototype,"codePointAt",{value:e,configurable:!0,writable:!0}):String.prototype.codePointAt=e);var Z6=new da,J6=new da,jl=new Uint8Array(30),e4=new Uint16Array(30),K6=new Uint8Array(30),$6=new Uint16Array(30),Cy=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Q6=new da,En=new Uint8Array(320);function j6(i,e,t,n){var s,r;for(s=0;s<t;++s)i[s]=0;for(s=0;s<30-t;++s)i[s+t]=s/t|0;for(r=n,s=0;s<30;++s)e[s]=r,r+=1<<i[s]}var eh=new Uint16Array(16);function t4(i,e,t,n){var s,r;for(s=0;s<16;++s)i.table[s]=0;for(s=0;s<n;++s)i.table[e[t+s]]++;for(i.table[0]=0,r=0,s=0;s<16;++s)eh[s]=r,r+=i.table[s];for(s=0;s<n;++s)e[t+s]&&(i.trans[eh[e[t+s]]++]=s)}function Ry(i){i.bitcount--||(i.tag=i.source[i.sourceIndex++],i.bitcount=7);var e=1&i.tag;return i.tag>>>=1,e}function Tn(i,e,t){if(!e)return t;for(;i.bitcount<24;)i.tag|=i.source[i.sourceIndex++]<<i.bitcount,i.bitcount+=8;var n=i.tag&65535>>>16-e;return i.tag>>>=e,i.bitcount-=e,n+t}function n4(i,e){for(;i.bitcount<24;)i.tag|=i.source[i.sourceIndex++]<<i.bitcount,i.bitcount+=8;var t=0,n=0,s=0,r=i.tag;do{n=2*n+(1&r),r>>>=1,++s,t+=e.table[s],n-=e.table[s]}while(n>=0);return i.tag=r,i.bitcount-=s,e.trans[t+n]}function Ly(i,e,t){var n,s,r,a,o,l;for(n=Tn(i,5,257),s=Tn(i,5,1),r=Tn(i,4,4),a=0;a<19;++a)En[a]=0;for(a=0;a<r;++a){var c=Tn(i,3,0);En[Cy[a]]=c}for(t4(Q6,En,0,19),o=0;o<n+s;){var u=n4(i,Q6);switch(u){case 16:var f=En[o-1];for(l=Tn(i,2,3);l;--l)En[o++]=f;break;case 17:for(l=Tn(i,3,3);l;--l)En[o++]=0;break;case 18:for(l=Tn(i,7,11);l;--l)En[o++]=0;break;default:En[o++]=u}}t4(e,En,0,n),t4(t,En,n,s)}function th(i,e,t){for(;;){var s,r,a,o,n=n4(i,e);if(256===n)return 0;if(n<256)i.dest[i.destLen++]=n;else for(s=Tn(i,jl[n-=257],e4[n]),r=n4(i,t),o=a=i.destLen-Tn(i,K6[r],$6[r]);o<a+s;++o)i.dest[i.destLen++]=i.dest[o]}}function Iy(i){for(var e,n;i.bitcount>8;)i.sourceIndex--,i.bitcount-=8;if((e=256*(e=i.source[i.sourceIndex+1])+i.source[i.sourceIndex])!==(65535&~(256*i.source[i.sourceIndex+3]+i.source[i.sourceIndex+2])))return-3;for(i.sourceIndex+=4,n=e;n;--n)i.dest[i.destLen++]=i.source[i.sourceIndex++];return i.bitcount=0,0}(function Py(i,e){var t;for(t=0;t<7;++t)i.table[t]=0;for(i.table[7]=24,i.table[8]=152,i.table[9]=112,t=0;t<24;++t)i.trans[t]=256+t;for(t=0;t<144;++t)i.trans[24+t]=t;for(t=0;t<8;++t)i.trans[168+t]=280+t;for(t=0;t<112;++t)i.trans[176+t]=144+t;for(t=0;t<5;++t)e.table[t]=0;for(e.table[5]=32,t=0;t<32;++t)e.trans[t]=t})(Z6,J6),j6(jl,e4,4,3),j6(K6,$6,2,1),jl[28]=0,e4[28]=258;function dr(i,e,t,n,s){return Math.pow(1-s,3)*i+3*Math.pow(1-s,2)*s*e+3*(1-s)*Math.pow(s,2)*t+Math.pow(s,3)*n}function Yn(){this.x1=Number.NaN,this.y1=Number.NaN,this.x2=Number.NaN,this.y2=Number.NaN}function Qt(){this.commands=[],this.fill="black",this.stroke=null,this.strokeWidth=1}function nh(i){throw new Error(i)}function ih(i,e){i||nh(e)}Yn.prototype.isEmpty=function(){return isNaN(this.x1)||isNaN(this.y1)||isNaN(this.x2)||isNaN(this.y2)},Yn.prototype.addPoint=function(i,e){"number"==typeof i&&((isNaN(this.x1)||isNaN(this.x2))&&(this.x1=i,this.x2=i),i<this.x1&&(this.x1=i),i>this.x2&&(this.x2=i)),"number"==typeof e&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=e,this.y2=e),e<this.y1&&(this.y1=e),e>this.y2&&(this.y2=e))},Yn.prototype.addX=function(i){this.addPoint(i,null)},Yn.prototype.addY=function(i){this.addPoint(null,i)},Yn.prototype.addBezier=function(i,e,t,n,s,r,a,o){var l=[i,e],c=[t,n],u=[s,r],f=[a,o];this.addPoint(i,e),this.addPoint(a,o);for(var d=0;d<=1;d++){var p=6*l[d]-12*c[d]+6*u[d],m=-3*l[d]+9*c[d]-9*u[d]+3*f[d],y=3*c[d]-3*l[d];if(0!==m){var g=Math.pow(p,2)-4*y*m;if(!(g<0)){var _=(-p+Math.sqrt(g))/(2*m);0<_&&_<1&&(0===d&&this.addX(dr(l[d],c[d],u[d],f[d],_)),1===d&&this.addY(dr(l[d],c[d],u[d],f[d],_)));var x=(-p-Math.sqrt(g))/(2*m);0<x&&x<1&&(0===d&&this.addX(dr(l[d],c[d],u[d],f[d],x)),1===d&&this.addY(dr(l[d],c[d],u[d],f[d],x)))}}else{if(0===p)continue;var v=-y/p;0<v&&v<1&&(0===d&&this.addX(dr(l[d],c[d],u[d],f[d],v)),1===d&&this.addY(dr(l[d],c[d],u[d],f[d],v)))}}},Yn.prototype.addQuad=function(i,e,t,n,s,r){var a=i+.6666666666666666*(t-i),o=e+2/3*(n-e);this.addBezier(i,e,a,o,a+1/3*(s-i),o+1/3*(r-e),s,r)},Qt.prototype.moveTo=function(i,e){this.commands.push({type:"M",x:i,y:e})},Qt.prototype.lineTo=function(i,e){this.commands.push({type:"L",x:i,y:e})},Qt.prototype.curveTo=Qt.prototype.bezierCurveTo=function(i,e,t,n,s,r){this.commands.push({type:"C",x1:i,y1:e,x2:t,y2:n,x:s,y:r})},Qt.prototype.quadTo=Qt.prototype.quadraticCurveTo=function(i,e,t,n){this.commands.push({type:"Q",x1:i,y1:e,x:t,y:n})},Qt.prototype.close=Qt.prototype.closePath=function(){this.commands.push({type:"Z"})},Qt.prototype.extend=function(i){if(i.commands)i=i.commands;else if(i instanceof Yn){var e=i;return this.moveTo(e.x1,e.y1),this.lineTo(e.x2,e.y1),this.lineTo(e.x2,e.y2),this.lineTo(e.x1,e.y2),void this.close()}Array.prototype.push.apply(this.commands,i)},Qt.prototype.getBoundingBox=function(){for(var i=new Yn,e=0,t=0,n=0,s=0,r=0;r<this.commands.length;r++){var a=this.commands[r];switch(a.type){case"M":i.addPoint(a.x,a.y),e=n=a.x,t=s=a.y;break;case"L":i.addPoint(a.x,a.y),n=a.x,s=a.y;break;case"Q":i.addQuad(n,s,a.x1,a.y1,a.x,a.y),n=a.x,s=a.y;break;case"C":i.addBezier(n,s,a.x1,a.y1,a.x2,a.y2,a.x,a.y),n=a.x,s=a.y;break;case"Z":n=e,s=t;break;default:throw new Error("Unexpected path command "+a.type)}}return i.isEmpty()&&i.addPoint(0,0),i},Qt.prototype.draw=function(i){i.beginPath();for(var e=0;e<this.commands.length;e+=1){var t=this.commands[e];"M"===t.type?i.moveTo(t.x,t.y):"L"===t.type?i.lineTo(t.x,t.y):"C"===t.type?i.bezierCurveTo(t.x1,t.y1,t.x2,t.y2,t.x,t.y):"Q"===t.type?i.quadraticCurveTo(t.x1,t.y1,t.x,t.y):"Z"===t.type&&i.closePath()}this.fill&&(i.fillStyle=this.fill,i.fill()),this.stroke&&(i.strokeStyle=this.stroke,i.lineWidth=this.strokeWidth,i.stroke())},Qt.prototype.toPathData=function(i){function e(a){return Math.round(a)===a?""+Math.round(a):a.toFixed(i)}function t(){for(var a=arguments,o="",l=0;l<arguments.length;l+=1){var c=a[l];c>=0&&l>0&&(o+=" "),o+=e(c)}return o}i=void 0!==i?i:2;for(var n="",s=0;s<this.commands.length;s+=1){var r=this.commands[s];"M"===r.type?n+="M"+t(r.x,r.y):"L"===r.type?n+="L"+t(r.x,r.y):"C"===r.type?n+="C"+t(r.x1,r.y1,r.x2,r.y2,r.x,r.y):"Q"===r.type?n+="Q"+t(r.x1,r.y1,r.x,r.y):"Z"===r.type&&(n+="Z")}return n},Qt.prototype.toSVG=function(i){var e='<path d="';return e+=this.toPathData(i),e+='"',this.fill&&"black"!==this.fill&&(e+=null===this.fill?' fill="none"':' fill="'+this.fill+'"'),this.stroke&&(e+=' stroke="'+this.stroke+'" stroke-width="'+this.strokeWidth+'"'),e+"/>"},Qt.prototype.toDOMElement=function(i){var e=this.toPathData(i),t=document.createElementNS("http://www.w3.org/2000/svg","path");return t.setAttribute("d",e),t};var Ze={fail:nh,argument:ih,assert:ih},rh=2147483648,pr={},ye={},Ke={};function on(i){return function(){return i}}ye.BYTE=function(i){return Ze.argument(i>=0&&i<=255,"Byte value should be between 0 and 255."),[i]},Ke.BYTE=on(1),ye.CHAR=function(i){return[i.charCodeAt(0)]},Ke.CHAR=on(1),ye.CHARARRAY=function(i){typeof i>"u"&&(i="",console.warn("Undefined CHARARRAY encountered and treated as an empty string. This is probably caused by a missing glyph name."));for(var e=[],t=0;t<i.length;t+=1)e[t]=i.charCodeAt(t);return e},Ke.CHARARRAY=function(i){return typeof i>"u"?0:i.length},ye.USHORT=function(i){return[i>>8&255,255&i]},Ke.USHORT=on(2),ye.SHORT=function(i){return i>=32768&&(i=-(65536-i)),[i>>8&255,255&i]},Ke.SHORT=on(2),ye.UINT24=function(i){return[i>>16&255,i>>8&255,255&i]},Ke.UINT24=on(3),ye.ULONG=function(i){return[i>>24&255,i>>16&255,i>>8&255,255&i]},Ke.ULONG=on(4),ye.LONG=function(i){return i>=rh&&(i=-(2*rh-i)),[i>>24&255,i>>16&255,i>>8&255,255&i]},Ke.LONG=on(4),ye.FIXED=ye.ULONG,Ke.FIXED=Ke.ULONG,ye.FWORD=ye.SHORT,Ke.FWORD=Ke.SHORT,ye.UFWORD=ye.USHORT,Ke.UFWORD=Ke.USHORT,ye.LONGDATETIME=function(i){return[0,0,0,0,i>>24&255,i>>16&255,i>>8&255,255&i]},Ke.LONGDATETIME=on(8),ye.TAG=function(i){return Ze.argument(4===i.length,"Tag should be exactly 4 ASCII characters."),[i.charCodeAt(0),i.charCodeAt(1),i.charCodeAt(2),i.charCodeAt(3)]},Ke.TAG=on(4),ye.Card8=ye.BYTE,Ke.Card8=Ke.BYTE,ye.Card16=ye.USHORT,Ke.Card16=Ke.USHORT,ye.OffSize=ye.BYTE,Ke.OffSize=Ke.BYTE,ye.SID=ye.USHORT,Ke.SID=Ke.USHORT,ye.NUMBER=function(i){return i>=-107&&i<=107?[i+139]:i>=108&&i<=1131?[247+((i-=108)>>8),255&i]:i>=-1131&&i<=-108?[251+((i=-i-108)>>8),255&i]:i>=-32768&&i<=32767?ye.NUMBER16(i):ye.NUMBER32(i)},Ke.NUMBER=function(i){return ye.NUMBER(i).length},ye.NUMBER16=function(i){return[28,i>>8&255,255&i]},Ke.NUMBER16=on(3),ye.NUMBER32=function(i){return[29,i>>24&255,i>>16&255,i>>8&255,255&i]},Ke.NUMBER32=on(5),ye.REAL=function(i){var e=i.toString(),t=/\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(e);if(t){var n=parseFloat("1e"+((t[2]?+t[2]:0)+t[1].length));e=(Math.round(i*n)/n).toString()}for(var s="",r=0,a=e.length;r<a;r+=1){var o=e[r];s+="e"===o?"-"===e[++r]?"c":"b":"."===o?"a":"-"===o?"e":o}for(var l=[30],c=0,u=(s+=1&s.length?"f":"ff").length;c<u;c+=2)l.push(parseInt(s.substr(c,2),16));return l},Ke.REAL=function(i){return ye.REAL(i).length},ye.NAME=ye.CHARARRAY,Ke.NAME=Ke.CHARARRAY,ye.STRING=ye.CHARARRAY,Ke.STRING=Ke.CHARARRAY,pr.UTF8=function(i,e,t){for(var n=[],s=t,r=0;r<s;r++,e+=1)n[r]=i.getUint8(e);return String.fromCharCode.apply(null,n)},pr.UTF16=function(i,e,t){for(var n=[],s=t/2,r=0;r<s;r++,e+=2)n[r]=i.getUint16(e);return String.fromCharCode.apply(null,n)},ye.UTF16=function(i){for(var e=[],t=0;t<i.length;t+=1){var n=i.charCodeAt(t);e[e.length]=n>>8&255,e[e.length]=255&n}return e},Ke.UTF16=function(i){return 2*i.length};var i4={"x-mac-croatian":"\xc4\xc5\xc7\xc9\xd1\xd6\xdc\xe1\xe0\xe2\xe4\xe3\xe5\xe7\xe9\xe8\xea\xeb\xed\xec\xee\xef\xf1\xf3\xf2\xf4\xf6\xf5\xfa\xf9\xfb\xfc\u2020\xb0\xa2\xa3\xa7\u2022\xb6\xdf\xae\u0160\u2122\xb4\xa8\u2260\u017d\xd8\u221e\xb1\u2264\u2265\u2206\xb5\u2202\u2211\u220f\u0161\u222b\xaa\xba\u03a9\u017e\xf8\xbf\xa1\xac\u221a\u0192\u2248\u0106\xab\u010c\u2026\xa0\xc0\xc3\xd5\u0152\u0153\u0110\u2014\u201c\u201d\u2018\u2019\xf7\u25ca\uf8ff\xa9\u2044\u20ac\u2039\u203a\xc6\xbb\u2013\xb7\u201a\u201e\u2030\xc2\u0107\xc1\u010d\xc8\xcd\xce\xcf\xcc\xd3\xd4\u0111\xd2\xda\xdb\xd9\u0131\u02c6\u02dc\xaf\u03c0\xcb\u02da\xb8\xca\xe6\u02c7","x-mac-cyrillic":"\u0410\u0411\u0412\u0413\u0414\u0415\u0416\u0417\u0418\u0419\u041a\u041b\u041c\u041d\u041e\u041f\u0420\u0421\u0422\u0423\u0424\u0425\u0426\u0427\u0428\u0429\u042a\u042b\u042c\u042d\u042e\u042f\u2020\xb0\u0490\xa3\xa7\u2022\xb6\u0406\xae\xa9\u2122\u0402\u0452\u2260\u0403\u0453\u221e\xb1\u2264\u2265\u0456\xb5\u0491\u0408\u0404\u0454\u0407\u0457\u0409\u0459\u040a\u045a\u0458\u0405\xac\u221a\u0192\u2248\u2206\xab\xbb\u2026\xa0\u040b\u045b\u040c\u045c\u0455\u2013\u2014\u201c\u201d\u2018\u2019\xf7\u201e\u040e\u045e\u040f\u045f\u2116\u0401\u0451\u044f\u0430\u0431\u0432\u0433\u0434\u0435\u0436\u0437\u0438\u0439\u043a\u043b\u043c\u043d\u043e\u043f\u0440\u0441\u0442\u0443\u0444\u0445\u0446\u0447\u0448\u0449\u044a\u044b\u044c\u044d\u044e","x-mac-gaelic":"\xc4\xc5\xc7\xc9\xd1\xd6\xdc\xe1\xe0\xe2\xe4\xe3\xe5\xe7\xe9\xe8\xea\xeb\xed\xec\xee\xef\xf1\xf3\xf2\xf4\xf6\xf5\xfa\xf9\xfb\xfc\u2020\xb0\xa2\xa3\xa7\u2022\xb6\xdf\xae\xa9\u2122\xb4\xa8\u2260\xc6\xd8\u1e02\xb1\u2264\u2265\u1e03\u010a\u010b\u1e0a\u1e0b\u1e1e\u1e1f\u0120\u0121\u1e40\xe6\xf8\u1e41\u1e56\u1e57\u027c\u0192\u017f\u1e60\xab\xbb\u2026\xa0\xc0\xc3\xd5\u0152\u0153\u2013\u2014\u201c\u201d\u2018\u2019\u1e61\u1e9b\xff\u0178\u1e6a\u20ac\u2039\u203a\u0176\u0177\u1e6b\xb7\u1ef2\u1ef3\u204a\xc2\xca\xc1\xcb\xc8\xcd\xce\xcf\xcc\xd3\xd4\u2663\xd2\xda\xdb\xd9\u0131\xdd\xfd\u0174\u0175\u1e84\u1e85\u1e80\u1e81\u1e82\u1e83","x-mac-greek":"\xc4\xb9\xb2\xc9\xb3\xd6\xdc\u0385\xe0\xe2\xe4\u0384\xa8\xe7\xe9\xe8\xea\xeb\xa3\u2122\xee\xef\u2022\xbd\u2030\xf4\xf6\xa6\u20ac\xf9\xfb\xfc\u2020\u0393\u0394\u0398\u039b\u039e\u03a0\xdf\xae\xa9\u03a3\u03aa\xa7\u2260\xb0\xb7\u0391\xb1\u2264\u2265\xa5\u0392\u0395\u0396\u0397\u0399\u039a\u039c\u03a6\u03ab\u03a8\u03a9\u03ac\u039d\xac\u039f\u03a1\u2248\u03a4\xab\xbb\u2026\xa0\u03a5\u03a7\u0386\u0388\u0153\u2013\u2015\u201c\u201d\u2018\u2019\xf7\u0389\u038a\u038c\u038e\u03ad\u03ae\u03af\u03cc\u038f\u03cd\u03b1\u03b2\u03c8\u03b4\u03b5\u03c6\u03b3\u03b7\u03b9\u03be\u03ba\u03bb\u03bc\u03bd\u03bf\u03c0\u03ce\u03c1\u03c3\u03c4\u03b8\u03c9\u03c2\u03c7\u03c5\u03b6\u03ca\u03cb\u0390\u03b0\xad","x-mac-icelandic":"\xc4\xc5\xc7\xc9\xd1\xd6\xdc\xe1\xe0\xe2\xe4\xe3\xe5\xe7\xe9\xe8\xea\xeb\xed\xec\xee\xef\xf1\xf3\xf2\xf4\xf6\xf5\xfa\xf9\xfb\xfc\xdd\xb0\xa2\xa3\xa7\u2022\xb6\xdf\xae\xa9\u2122\xb4\xa8\u2260\xc6\xd8\u221e\xb1\u2264\u2265\xa5\xb5\u2202\u2211\u220f\u03c0\u222b\xaa\xba\u03a9\xe6\xf8\xbf\xa1\xac\u221a\u0192\u2248\u2206\xab\xbb\u2026\xa0\xc0\xc3\xd5\u0152\u0153\u2013\u2014\u201c\u201d\u2018\u2019\xf7\u25ca\xff\u0178\u2044\u20ac\xd0\xf0\xde\xfe\xfd\xb7\u201a\u201e\u2030\xc2\xca\xc1\xcb\xc8\xcd\xce\xcf\xcc\xd3\xd4\uf8ff\xd2\xda\xdb\xd9\u0131\u02c6\u02dc\xaf\u02d8\u02d9\u02da\xb8\u02dd\u02db\u02c7","x-mac-inuit":"\u1403\u1404\u1405\u1406\u140a\u140b\u1431\u1432\u1433\u1434\u1438\u1439\u1449\u144e\u144f\u1450\u1451\u1455\u1456\u1466\u146d\u146e\u146f\u1470\u1472\u1473\u1483\u148b\u148c\u148d\u148e\u1490\u1491\xb0\u14a1\u14a5\u14a6\u2022\xb6\u14a7\xae\xa9\u2122\u14a8\u14aa\u14ab\u14bb\u14c2\u14c3\u14c4\u14c5\u14c7\u14c8\u14d0\u14ef\u14f0\u14f1\u14f2\u14f4\u14f5\u1505\u14d5\u14d6\u14d7\u14d8\u14da\u14db\u14ea\u1528\u1529\u152a\u152b\u152d\u2026\xa0\u152e\u153e\u1555\u1556\u1557\u2013\u2014\u201c\u201d\u2018\u2019\u1558\u1559\u155a\u155d\u1546\u1547\u1548\u1549\u154b\u154c\u1550\u157f\u1580\u1581\u1582\u1583\u1584\u1585\u158f\u1590\u1591\u1592\u1593\u1594\u1595\u1671\u1672\u1673\u1674\u1675\u1676\u1596\u15a0\u15a1\u15a2\u15a3\u15a4\u15a5\u15a6\u157c\u0141\u0142","x-mac-ce":"\xc4\u0100\u0101\xc9\u0104\xd6\xdc\xe1\u0105\u010c\xe4\u010d\u0106\u0107\xe9\u0179\u017a\u010e\xed\u010f\u0112\u0113\u0116\xf3\u0117\xf4\xf6\xf5\xfa\u011a\u011b\xfc\u2020\xb0\u0118\xa3\xa7\u2022\xb6\xdf\xae\xa9\u2122\u0119\xa8\u2260\u0123\u012e\u012f\u012a\u2264\u2265\u012b\u0136\u2202\u2211\u0142\u013b\u013c\u013d\u013e\u0139\u013a\u0145\u0146\u0143\xac\u221a\u0144\u0147\u2206\xab\xbb\u2026\xa0\u0148\u0150\xd5\u0151\u014c\u2013\u2014\u201c\u201d\u2018\u2019\xf7\u25ca\u014d\u0154\u0155\u0158\u2039\u203a\u0159\u0156\u0157\u0160\u201a\u201e\u0161\u015a\u015b\xc1\u0164\u0165\xcd\u017d\u017e\u016a\xd3\xd4\u016b\u016e\xda\u016f\u0170\u0171\u0172\u0173\xdd\xfd\u0137\u017b\u0141\u017c\u0122\u02c7",macintosh:"\xc4\xc5\xc7\xc9\xd1\xd6\xdc\xe1\xe0\xe2\xe4\xe3\xe5\xe7\xe9\xe8\xea\xeb\xed\xec\xee\xef\xf1\xf3\xf2\xf4\xf6\xf5\xfa\xf9\xfb\xfc\u2020\xb0\xa2\xa3\xa7\u2022\xb6\xdf\xae\xa9\u2122\xb4\xa8\u2260\xc6\xd8\u221e\xb1\u2264\u2265\xa5\xb5\u2202\u2211\u220f\u03c0\u222b\xaa\xba\u03a9\xe6\xf8\xbf\xa1\xac\u221a\u0192\u2248\u2206\xab\xbb\u2026\xa0\xc0\xc3\xd5\u0152\u0153\u2013\u2014\u201c\u201d\u2018\u2019\xf7\u25ca\xff\u0178\u2044\u20ac\u2039\u203a\ufb01\ufb02\u2021\xb7\u201a\u201e\u2030\xc2\xca\xc1\xcb\xc8\xcd\xce\xcf\xcc\xd3\xd4\uf8ff\xd2\xda\xdb\xd9\u0131\u02c6\u02dc\xaf\u02d8\u02d9\u02da\xb8\u02dd\u02db\u02c7","x-mac-romanian":"\xc4\xc5\xc7\xc9\xd1\xd6\xdc\xe1\xe0\xe2\xe4\xe3\xe5\xe7\xe9\xe8\xea\xeb\xed\xec\xee\xef\xf1\xf3\xf2\xf4\xf6\xf5\xfa\xf9\xfb\xfc\u2020\xb0\xa2\xa3\xa7\u2022\xb6\xdf\xae\xa9\u2122\xb4\xa8\u2260\u0102\u0218\u221e\xb1\u2264\u2265\xa5\xb5\u2202\u2211\u220f\u03c0\u222b\xaa\xba\u03a9\u0103\u0219\xbf\xa1\xac\u221a\u0192\u2248\u2206\xab\xbb\u2026\xa0\xc0\xc3\xd5\u0152\u0153\u2013\u2014\u201c\u201d\u2018\u2019\xf7\u25ca\xff\u0178\u2044\u20ac\u2039\u203a\u021a\u021b\u2021\xb7\u201a\u201e\u2030\xc2\xca\xc1\xcb\xc8\xcd\xce\xcf\xcc\xd3\xd4\uf8ff\xd2\xda\xdb\xd9\u0131\u02c6\u02dc\xaf\u02d8\u02d9\u02da\xb8\u02dd\u02db\u02c7","x-mac-turkish":"\xc4\xc5\xc7\xc9\xd1\xd6\xdc\xe1\xe0\xe2\xe4\xe3\xe5\xe7\xe9\xe8\xea\xeb\xed\xec\xee\xef\xf1\xf3\xf2\xf4\xf6\xf5\xfa\xf9\xfb\xfc\u2020\xb0\xa2\xa3\xa7\u2022\xb6\xdf\xae\xa9\u2122\xb4\xa8\u2260\xc6\xd8\u221e\xb1\u2264\u2265\xa5\xb5\u2202\u2211\u220f\u03c0\u222b\xaa\xba\u03a9\xe6\xf8\xbf\xa1\xac\u221a\u0192\u2248\u2206\xab\xbb\u2026\xa0\xc0\xc3\xd5\u0152\u0153\u2013\u2014\u201c\u201d\u2018\u2019\xf7\u25ca\xff\u0178\u011e\u011f\u0130\u0131\u015e\u015f\u2021\xb7\u201a\u201e\u2030\xc2\xca\xc1\xcb\xc8\xcd\xce\xcf\xcc\xd3\xd4\uf8ff\xd2\xda\xdb\xd9\uf8a0\u02c6\u02dc\xaf\u02d8\u02d9\u02da\xb8\u02dd\u02db\u02c7"};pr.MACSTRING=function(i,e,t,n){var s=i4[n];if(void 0!==s){for(var r="",a=0;a<t;a++){var o=i.getUint8(e+a);r+=o<=127?String.fromCharCode(o):s[127&o]}return r}};var v1,g1="function"==typeof WeakMap&&new WeakMap;function s4(i){return i>=-128&&i<=127}function Ny(i,e,t){for(var n=0,s=i.length;e<s&&n<64&&0===i[e];)++e,++n;return t.push(128|n-1),e}function ky(i,e,t){for(var n=0,s=i.length,r=e;r<s&&n<64;){var a=i[r];if(!s4(a)||0===a&&r+1<s&&0===i[r+1])break;++r,++n}t.push(n-1);for(var o=e;o<r;++o)t.push(i[o]+256&255);return r}function Uy(i,e,t){for(var n=0,s=i.length,r=e;r<s&&n<64;){var a=i[r];if(0===a||s4(a)&&r+1<s&&s4(i[r+1]))break;++r,++n}t.push(64|n-1);for(var o=e;o<r;++o){var l=i[o];t.push(l+65536>>8&255,l+256&255)}return r}ye.MACSTRING=function(i,e){var t=function(i){if(!v1)for(var e in v1={},i4)v1[e]=new String(e);var t=v1[i];if(void 0!==t){if(g1){var n=g1.get(t);if(void 0!==n)return n}var s=i4[i];if(void 0!==s){for(var r={},a=0;a<s.length;a++)r[s.charCodeAt(a)]=a+128;return g1&&g1.set(t,r),r}}}(e);if(void 0!==t){for(var n=[],s=0;s<i.length;s++){var r=i.charCodeAt(s);if(r>=128&&void 0===(r=t[r]))return;n[s]=r}return n}},Ke.MACSTRING=function(i,e){var t=ye.MACSTRING(i,e);return void 0!==t?t.length:0},ye.VARDELTAS=function(i){for(var e=0,t=[];e<i.length;){var n=i[e];e=0===n?Ny(i,e,t):n>=-128&&n<=127?ky(i,e,t):Uy(i,e,t)}return t},ye.INDEX=function(i){for(var e=1,t=[e],n=[],s=0;s<i.length;s+=1){var r=ye.OBJECT(i[s]);Array.prototype.push.apply(n,r),t.push(e+=r.length)}if(0===n.length)return[0,0];for(var a=[],o=1+Math.floor(Math.log(e)/Math.log(2))/8|0,l=[void 0,ye.BYTE,ye.USHORT,ye.UINT24,ye.ULONG][o],c=0;c<t.length;c+=1){var u=l(t[c]);Array.prototype.push.apply(a,u)}return Array.prototype.concat(ye.Card16(i.length),ye.OffSize(o),a,n)},Ke.INDEX=function(i){return ye.INDEX(i).length},ye.DICT=function(i){for(var e=[],t=Object.keys(i),n=t.length,s=0;s<n;s+=1){var r=parseInt(t[s],0),a=i[r];e=(e=e.concat(ye.OPERAND(a.value,a.type))).concat(ye.OPERATOR(r))}return e},Ke.DICT=function(i){return ye.DICT(i).length},ye.OPERATOR=function(i){return i<1200?[i]:[12,i-1200]},ye.OPERAND=function(i,e){var t=[];if(Array.isArray(e))for(var n=0;n<e.length;n+=1)Ze.argument(i.length===e.length,"Not enough arguments given for type"+e),t=t.concat(ye.OPERAND(i[n],e[n]));else if("SID"===e)t=t.concat(ye.NUMBER(i));else if("offset"===e)t=t.concat(ye.NUMBER32(i));else if("number"===e)t=t.concat(ye.NUMBER(i));else{if("real"!==e)throw new Error("Unknown operand type "+e);t=t.concat(ye.REAL(i))}return t},ye.OP=ye.BYTE,Ke.OP=Ke.BYTE;var y1="function"==typeof WeakMap&&new WeakMap;function i0(i,e,t){if(e.length&&("coverageFormat"!==e[0].name||1===e[0].value))for(var n=0;n<e.length;n+=1){var s=e[n];this[s.name]=s.value}if(this.tableName=i,this.fields=e,t)for(var r=Object.keys(t),a=0;a<r.length;a+=1){var o=r[a];void 0!==this[o]&&(this[o]=t[o])}}function pa(i,e,t){void 0===t&&(t=e.length);var n=new Array(e.length+1);n[0]={name:i+"Count",type:"USHORT",value:t};for(var s=0;s<e.length;s++)n[s+1]={name:i+s,type:"USHORT",value:e[s]};return n}function r4(i,e,t){var n=e.length,s=new Array(n+1);s[0]={name:i+"Count",type:"USHORT",value:n};for(var r=0;r<n;r++)s[r+1]={name:i+r,type:"TABLE",value:t(e[r],r)};return s}function ma(i,e,t){var n=e.length,s=[];s[0]={name:i+"Count",type:"USHORT",value:n};for(var r=0;r<n;r++)s=s.concat(t(e[r],r));return s}function x1(i){1===i.format?i0.call(this,"coverageTable",[{name:"coverageFormat",type:"USHORT",value:1}].concat(pa("glyph",i.glyphs))):2===i.format?i0.call(this,"coverageTable",[{name:"coverageFormat",type:"USHORT",value:2}].concat(ma("rangeRecord",i.ranges,function(e){return[{name:"startGlyphID",type:"USHORT",value:e.start},{name:"endGlyphID",type:"USHORT",value:e.end},{name:"startCoverageIndex",type:"USHORT",value:e.index}]}))):Ze.assert(!1,"Coverage format must be 1 or 2.")}function _1(i){i0.call(this,"scriptListTable",ma("scriptRecord",i,function(e,t){var n=e.script,s=n.defaultLangSys;return Ze.assert(!!s,"Unable to write GSUB: script "+e.tag+" has no default language system."),[{name:"scriptTag"+t,type:"TAG",value:e.tag},{name:"script"+t,type:"TABLE",value:new i0("scriptTable",[{name:"defaultLangSys",type:"TABLE",value:new i0("defaultLangSys",[{name:"lookupOrder",type:"USHORT",value:0},{name:"reqFeatureIndex",type:"USHORT",value:s.reqFeatureIndex}].concat(pa("featureIndex",s.featureIndexes)))}].concat(ma("langSys",n.langSysRecords,function(r,a){var o=r.langSys;return[{name:"langSysTag"+a,type:"TAG",value:r.tag},{name:"langSys"+a,type:"TABLE",value:new i0("langSys",[{name:"lookupOrder",type:"USHORT",value:0},{name:"reqFeatureIndex",type:"USHORT",value:o.reqFeatureIndex}].concat(pa("featureIndex",o.featureIndexes)))}]})))}]}))}function b1(i){i0.call(this,"featureListTable",ma("featureRecord",i,function(e,t){var n=e.feature;return[{name:"featureTag"+t,type:"TAG",value:e.tag},{name:"feature"+t,type:"TABLE",value:new i0("featureTable",[{name:"featureParams",type:"USHORT",value:n.featureParams}].concat(pa("lookupListIndex",n.lookupListIndexes)))}]}))}function S1(i,e){i0.call(this,"lookupListTable",r4("lookup",i,function(t){var n=e[t.lookupType];return Ze.assert(!!n,"Unable to write GSUB lookup type "+t.lookupType+" tables."),new i0("lookupTable",[{name:"lookupType",type:"USHORT",value:t.lookupType},{name:"lookupFlag",type:"USHORT",value:t.lookupFlag}].concat(r4("subtable",t.subtables,n)))}))}ye.CHARSTRING=function(i){if(y1){var e=y1.get(i);if(void 0!==e)return e}for(var t=[],n=i.length,s=0;s<n;s+=1){var r=i[s];t=t.concat(ye[r.type](r.value))}return y1&&y1.set(i,t),t},Ke.CHARSTRING=function(i){return ye.CHARSTRING(i).length},ye.OBJECT=function(i){var e=ye[i.type];return Ze.argument(void 0!==e,"No encoding function for type "+i.type),e(i.value)},Ke.OBJECT=function(i){var e=Ke[i.type];return Ze.argument(void 0!==e,"No sizeOf function for type "+i.type),e(i.value)},ye.TABLE=function(i){for(var e=[],t=i.fields.length,n=[],s=[],r=0;r<t;r+=1){var a=i.fields[r],o=ye[a.type];Ze.argument(void 0!==o,"No encoding function for field type "+a.type+" ("+a.name+")");var l=i[a.name];void 0===l&&(l=a.value);var c=o(l);"TABLE"===a.type?(s.push(e.length),e=e.concat([0,0]),n.push(c)):e=e.concat(c)}for(var u=0;u<n.length;u+=1){var f=s[u],d=e.length;Ze.argument(d<65536,"Table "+i.tableName+" too big."),e[f]=d>>8,e[f+1]=255&d,e=e.concat(n[u])}return e},Ke.TABLE=function(i){for(var e=0,t=i.fields.length,n=0;n<t;n+=1){var s=i.fields[n],r=Ke[s.type];Ze.argument(void 0!==r,"No sizeOf function for field type "+s.type+" ("+s.name+")");var a=i[s.name];void 0===a&&(a=s.value),e+=r(a),"TABLE"===s.type&&(e+=2)}return e},ye.RECORD=ye.TABLE,Ke.RECORD=Ke.TABLE,ye.LITERAL=function(i){return i},Ke.LITERAL=function(i){return i.length},i0.prototype.encode=function(){return ye.TABLE(this)},i0.prototype.sizeOf=function(){return Ke.TABLE(this)},(x1.prototype=Object.create(i0.prototype)).constructor=x1,(_1.prototype=Object.create(i0.prototype)).constructor=_1,(b1.prototype=Object.create(i0.prototype)).constructor=b1,(S1.prototype=Object.create(i0.prototype)).constructor=S1;var Me={Table:i0,Record:i0,Coverage:x1,ScriptList:_1,FeatureList:b1,LookupList:S1,ushortList:pa,tableList:r4,recordList:ma};function ah(i,e){return i.getUint8(e)}function M1(i,e){return i.getUint16(e,!1)}function a4(i,e){return i.getUint32(e,!1)}function oh(i,e){return i.getInt16(e,!1)+i.getUint16(e+2,!1)/65535}var Wy={byte:1,uShort:2,short:2,uLong:4,fixed:4,longDateTime:8,tag:4};function q(i,e){this.data=i,this.offset=e,this.relativeOffset=0}q.prototype.parseByte=function(){var i=this.data.getUint8(this.offset+this.relativeOffset);return this.relativeOffset+=1,i},q.prototype.parseChar=function(){var i=this.data.getInt8(this.offset+this.relativeOffset);return this.relativeOffset+=1,i},q.prototype.parseCard8=q.prototype.parseByte,q.prototype.parseUShort=function(){var i=this.data.getUint16(this.offset+this.relativeOffset);return this.relativeOffset+=2,i},q.prototype.parseCard16=q.prototype.parseUShort,q.prototype.parseSID=q.prototype.parseUShort,q.prototype.parseOffset16=q.prototype.parseUShort,q.prototype.parseShort=function(){var i=this.data.getInt16(this.offset+this.relativeOffset);return this.relativeOffset+=2,i},q.prototype.parseF2Dot14=function(){var i=this.data.getInt16(this.offset+this.relativeOffset)/16384;return this.relativeOffset+=2,i},q.prototype.parseULong=function(){var i=a4(this.data,this.offset+this.relativeOffset);return this.relativeOffset+=4,i},q.prototype.parseOffset32=q.prototype.parseULong,q.prototype.parseFixed=function(){var i=oh(this.data,this.offset+this.relativeOffset);return this.relativeOffset+=4,i},q.prototype.parseString=function(i){var e=this.data,t=this.offset+this.relativeOffset,n="";this.relativeOffset+=i;for(var s=0;s<i;s++)n+=String.fromCharCode(e.getUint8(t+s));return n},q.prototype.parseTag=function(){return this.parseString(4)},q.prototype.parseLongDateTime=function(){var i=a4(this.data,this.offset+this.relativeOffset+4);return i-=2082844800,this.relativeOffset+=8,i},q.prototype.parseVersion=function(i){var e=M1(this.data,this.offset+this.relativeOffset),t=M1(this.data,this.offset+this.relativeOffset+2);return this.relativeOffset+=4,void 0===i&&(i=4096),e+t/i/10},q.prototype.skip=function(i,e){void 0===e&&(e=1),this.relativeOffset+=Wy[i]*e},q.prototype.parseULongList=function(i){void 0===i&&(i=this.parseULong());for(var e=new Array(i),t=this.data,n=this.offset+this.relativeOffset,s=0;s<i;s++)e[s]=t.getUint32(n),n+=4;return this.relativeOffset+=4*i,e},q.prototype.parseOffset16List=q.prototype.parseUShortList=function(i){void 0===i&&(i=this.parseUShort());for(var e=new Array(i),t=this.data,n=this.offset+this.relativeOffset,s=0;s<i;s++)e[s]=t.getUint16(n),n+=2;return this.relativeOffset+=2*i,e},q.prototype.parseShortList=function(i){for(var e=new Array(i),t=this.data,n=this.offset+this.relativeOffset,s=0;s<i;s++)e[s]=t.getInt16(n),n+=2;return this.relativeOffset+=2*i,e},q.prototype.parseByteList=function(i){for(var e=new Array(i),t=this.data,n=this.offset+this.relativeOffset,s=0;s<i;s++)e[s]=t.getUint8(n++);return this.relativeOffset+=i,e},q.prototype.parseList=function(i,e){e||(e=i,i=this.parseUShort());for(var t=new Array(i),n=0;n<i;n++)t[n]=e.call(this);return t},q.prototype.parseList32=function(i,e){e||(e=i,i=this.parseULong());for(var t=new Array(i),n=0;n<i;n++)t[n]=e.call(this);return t},q.prototype.parseRecordList=function(i,e){e||(e=i,i=this.parseUShort());for(var t=new Array(i),n=Object.keys(e),s=0;s<i;s++){for(var r={},a=0;a<n.length;a++){var o=n[a];r[o]=e[o].call(this)}t[s]=r}return t},q.prototype.parseRecordList32=function(i,e){e||(e=i,i=this.parseULong());for(var t=new Array(i),n=Object.keys(e),s=0;s<i;s++){for(var r={},a=0;a<n.length;a++){var o=n[a];r[o]=e[o].call(this)}t[s]=r}return t},q.prototype.parseStruct=function(i){if("function"==typeof i)return i.call(this);for(var e=Object.keys(i),t={},n=0;n<e.length;n++){var s=e[n];t[s]=i[s].call(this)}return t},q.prototype.parseValueRecord=function(i){if(void 0===i&&(i=this.parseUShort()),0!==i){var e={};return 1&i&&(e.xPlacement=this.parseShort()),2&i&&(e.yPlacement=this.parseShort()),4&i&&(e.xAdvance=this.parseShort()),8&i&&(e.yAdvance=this.parseShort()),16&i&&(e.xPlaDevice=void 0,this.parseShort()),32&i&&(e.yPlaDevice=void 0,this.parseShort()),64&i&&(e.xAdvDevice=void 0,this.parseShort()),128&i&&(e.yAdvDevice=void 0,this.parseShort()),e}},q.prototype.parseValueRecordList=function(){for(var i=this.parseUShort(),e=this.parseUShort(),t=new Array(e),n=0;n<e;n++)t[n]=this.parseValueRecord(i);return t},q.prototype.parsePointer=function(i){var e=this.parseOffset16();if(e>0)return new q(this.data,this.offset+e).parseStruct(i)},q.prototype.parsePointer32=function(i){var e=this.parseOffset32();if(e>0)return new q(this.data,this.offset+e).parseStruct(i)},q.prototype.parseListOfLists=function(i){for(var e=this.parseOffset16List(),t=e.length,n=this.relativeOffset,s=new Array(t),r=0;r<t;r++){var a=e[r];if(0!==a)if(this.relativeOffset=a,i){for(var o=this.parseOffset16List(),l=new Array(o.length),c=0;c<o.length;c++)this.relativeOffset=a+o[c],l[c]=i.call(this);s[r]=l}else s[r]=this.parseUShortList();else s[r]=void 0}return this.relativeOffset=n,s},q.prototype.parseCoverage=function(){var i=this.offset+this.relativeOffset,e=this.parseUShort(),t=this.parseUShort();if(1===e)return{format:1,glyphs:this.parseUShortList(t)};if(2===e){for(var n=new Array(t),s=0;s<t;s++)n[s]={start:this.parseUShort(),end:this.parseUShort(),index:this.parseUShort()};return{format:2,ranges:n}}throw new Error("0x"+i.toString(16)+": Coverage format must be 1 or 2.")},q.prototype.parseClassDef=function(){var i=this.offset+this.relativeOffset,e=this.parseUShort();if(1===e)return{format:1,startGlyph:this.parseUShort(),classes:this.parseUShortList()};if(2===e)return{format:2,ranges:this.parseRecordList({start:q.uShort,end:q.uShort,classId:q.uShort})};throw new Error("0x"+i.toString(16)+": ClassDef format must be 1 or 2.")},q.list=function(i,e){return function(){return this.parseList(i,e)}},q.list32=function(i,e){return function(){return this.parseList32(i,e)}},q.recordList=function(i,e){return function(){return this.parseRecordList(i,e)}},q.recordList32=function(i,e){return function(){return this.parseRecordList32(i,e)}},q.pointer=function(i){return function(){return this.parsePointer(i)}},q.pointer32=function(i){return function(){return this.parsePointer32(i)}},q.tag=q.prototype.parseTag,q.byte=q.prototype.parseByte,q.uShort=q.offset16=q.prototype.parseUShort,q.uShortList=q.prototype.parseUShortList,q.uLong=q.offset32=q.prototype.parseULong,q.uLongList=q.prototype.parseULongList,q.struct=q.prototype.parseStruct,q.coverage=q.prototype.parseCoverage,q.classDef=q.prototype.parseClassDef;var lh={reserved:q.uShort,reqFeatureIndex:q.uShort,featureIndexes:q.uShortList};q.prototype.parseScriptList=function(){return this.parsePointer(q.recordList({tag:q.tag,script:q.pointer({defaultLangSys:q.pointer(lh),langSysRecords:q.recordList({tag:q.tag,langSys:q.pointer(lh)})})}))||[]},q.prototype.parseFeatureList=function(){return this.parsePointer(q.recordList({tag:q.tag,feature:q.pointer({featureParams:q.offset16,lookupListIndexes:q.uShortList})}))||[]},q.prototype.parseLookupList=function(i){return this.parsePointer(q.list(q.pointer(function(){var e=this.parseUShort();Ze.argument(1<=e&&e<=9,"GPOS/GSUB lookup type "+e+" unknown.");var t=this.parseUShort(),n=16&t;return{lookupType:e,lookupFlag:t,subtables:this.parseList(q.pointer(i[e])),markFilteringSet:n?this.parseUShort():void 0}})))||[]},q.prototype.parseFeatureVariationsList=function(){return this.parsePointer32(function(){var i=this.parseUShort(),e=this.parseUShort();return Ze.argument(1===i&&e<1,"GPOS/GSUB feature variations table unknown."),this.parseRecordList32({conditionSetOffset:q.offset32,featureTableSubstitutionOffset:q.offset32})})||[]};var Pe={getByte:ah,getCard8:ah,getUShort:M1,getCard16:M1,getShort:function By(i,e){return i.getInt16(e,!1)},getULong:a4,getFixed:oh,getTag:function Gy(i,e){for(var t="",n=e;n<e+4;n+=1)t+=String.fromCharCode(i.getInt8(n));return t},getOffset:function zy(i,e,t){for(var n=0,s=0;s<t;s+=1)n<<=8,n+=i.getUint8(e+s);return n},getBytes:function Hy(i,e,t){for(var n=[],s=e;s<t;s+=1)n.push(i.getUint8(s));return n},bytesToString:function Vy(i){for(var e="",t=0;t<i.length;t+=1)e+=String.fromCharCode(i[t]);return e},Parser:q};function Zy(i,e,t){i.segments.push({end:e,start:e,delta:-(e-t),offset:0,glyphIndex:t})}var ch_parse=function qy(i,e){var t={};t.version=Pe.getUShort(i,e),Ze.argument(0===t.version,"cmap table version should be 0."),t.numTables=Pe.getUShort(i,e+2);for(var n=-1,s=t.numTables-1;s>=0;s-=1){var r=Pe.getUShort(i,e+4+8*s),a=Pe.getUShort(i,e+4+8*s+2);if(3===r&&(0===a||1===a||10===a)||0===r&&(0===a||1===a||2===a||3===a||4===a)){n=Pe.getULong(i,e+4+8*s+4);break}}if(-1===n)throw new Error("No valid cmap sub-tables found.");var o=new Pe.Parser(i,e+n);if(t.format=o.parseUShort(),12===t.format)!function Xy(i,e){var t;e.parseUShort(),i.length=e.parseULong(),i.language=e.parseULong(),i.groupCount=t=e.parseULong(),i.glyphIndexMap={};for(var n=0;n<t;n+=1)for(var s=e.parseULong(),r=e.parseULong(),a=e.parseULong(),o=s;o<=r;o+=1)i.glyphIndexMap[o]=a,a++}(t,o);else{if(4!==t.format)throw new Error("Only format 4 and 12 cmap tables are supported (found format "+t.format+").");!function Yy(i,e,t,n,s){var r;i.length=e.parseUShort(),i.language=e.parseUShort(),i.segCount=r=e.parseUShort()>>1,e.skip("uShort",3),i.glyphIndexMap={};for(var a=new Pe.Parser(t,n+s+14),o=new Pe.Parser(t,n+s+16+2*r),l=new Pe.Parser(t,n+s+16+4*r),c=new Pe.Parser(t,n+s+16+6*r),u=n+s+16+8*r,f=0;f<r-1;f+=1)for(var d=void 0,p=a.parseUShort(),m=o.parseUShort(),y=l.parseShort(),v=c.parseUShort(),g=m;g<=p;g+=1)0!==v?(u=c.offset+c.relativeOffset-2,u+=v,0!==(d=Pe.getUShort(t,u+=2*(g-m)))&&(d=d+y&65535)):d=g+y&65535,i.glyphIndexMap[g]=d}(t,o,i,e,n)}return t},ch_make=function Ky(i){var t,e=!0;for(t=i.length-1;t>0;t-=1)if(i.get(t).unicode>65535){console.log("Adding CMAP format 12 (needed!)"),e=!1;break}var s=[{name:"version",type:"USHORT",value:0},{name:"numTables",type:"USHORT",value:e?1:2},{name:"platformID",type:"USHORT",value:3},{name:"encodingID",type:"USHORT",value:1},{name:"offset",type:"ULONG",value:e?12:20}];e||(s=s.concat([{name:"cmap12PlatformID",type:"USHORT",value:3},{name:"cmap12EncodingID",type:"USHORT",value:10},{name:"cmap12Offset",type:"ULONG",value:0}])),s=s.concat([{name:"format",type:"USHORT",value:4},{name:"cmap4Length",type:"USHORT",value:0},{name:"language",type:"USHORT",value:0},{name:"segCountX2",type:"USHORT",value:0},{name:"searchRange",type:"USHORT",value:0},{name:"entrySelector",type:"USHORT",value:0},{name:"rangeShift",type:"USHORT",value:0}]);var r=new Me.Table("cmap",s);for(r.segments=[],t=0;t<i.length;t+=1){for(var a=i.get(t),o=0;o<a.unicodes.length;o+=1)Zy(r,a.unicodes[o],t);r.segments=r.segments.sort(function(_,x){return _.start-x.start})}!function Jy(i){i.segments.push({end:65535,start:65535,delta:1,offset:0})}(r);var l=r.segments.length,c=0,u=[],f=[],d=[],p=[],m=[],y=[];for(t=0;t<l;t+=1){var v=r.segments[t];v.end<=65535&&v.start<=65535?(u=u.concat({name:"end_"+t,type:"USHORT",value:v.end}),f=f.concat({name:"start_"+t,type:"USHORT",value:v.start}),d=d.concat({name:"idDelta_"+t,type:"SHORT",value:v.delta}),p=p.concat({name:"idRangeOffset_"+t,type:"USHORT",value:v.offset}),void 0!==v.glyphId&&(m=m.concat({name:"glyph_"+t,type:"USHORT",value:v.glyphId}))):c+=1,!e&&void 0!==v.glyphIndex&&(y=(y=(y=y.concat({name:"cmap12Start_"+t,type:"ULONG",value:v.start})).concat({name:"cmap12End_"+t,type:"ULONG",value:v.end})).concat({name:"cmap12Glyph_"+t,type:"ULONG",value:v.glyphIndex}))}if(r.segCountX2=2*(l-c),r.searchRange=2*Math.pow(2,Math.floor(Math.log(l-c)/Math.log(2))),r.entrySelector=Math.log(r.searchRange/2)/Math.log(2),r.rangeShift=r.segCountX2-r.searchRange,r.fields=r.fields.concat(u),r.fields.push({name:"reservedPad",type:"USHORT",value:0}),r.fields=r.fields.concat(f),r.fields=r.fields.concat(d),r.fields=r.fields.concat(p),r.fields=r.fields.concat(m),r.cmap4Length=14+2*u.length+2+2*f.length+2*d.length+2*p.length+2*m.length,!e){var g=16+4*y.length;r.cmap12Offset=20+r.cmap4Length,r.fields=r.fields.concat([{name:"cmap12Format",type:"USHORT",value:12},{name:"cmap12Reserved",type:"USHORT",value:0},{name:"cmap12Length",type:"ULONG",value:g},{name:"cmap12Language",type:"ULONG",value:0},{name:"cmap12nGroups",type:"ULONG",value:y.length/3}]),r.fields=r.fields.concat(y)}return r},E1=[".notdef","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quoteright","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","quoteleft","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","exclamdown","cent","sterling","fraction","yen","florin","section","currency","quotesingle","quotedblleft","guillemotleft","guilsinglleft","guilsinglright","fi","fl","endash","dagger","daggerdbl","periodcentered","paragraph","bullet","quotesinglbase","quotedblbase","quotedblright","guillemotright","ellipsis","perthousand","questiondown","grave","acute","circumflex","tilde","macron","breve","dotaccent","dieresis","ring","cedilla","hungarumlaut","ogonek","caron","emdash","AE","ordfeminine","Lslash","Oslash","OE","ordmasculine","ae","dotlessi","lslash","oslash","oe","germandbls","onesuperior","logicalnot","mu","trademark","Eth","onehalf","plusminus","Thorn","onequarter","divide","brokenbar","degree","thorn","threequarters","twosuperior","registered","minus","eth","multiply","threesuperior","copyright","Aacute","Acircumflex","Adieresis","Agrave","Aring","Atilde","Ccedilla","Eacute","Ecircumflex","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Ntilde","Oacute","Ocircumflex","Odieresis","Ograve","Otilde","Scaron","Uacute","Ucircumflex","Udieresis","Ugrave","Yacute","Ydieresis","Zcaron","aacute","acircumflex","adieresis","agrave","aring","atilde","ccedilla","eacute","ecircumflex","edieresis","egrave","iacute","icircumflex","idieresis","igrave","ntilde","oacute","ocircumflex","odieresis","ograve","otilde","scaron","uacute","ucircumflex","udieresis","ugrave","yacute","ydieresis","zcaron","exclamsmall","Hungarumlautsmall","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","266 ff","onedotenleader","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","commasuperior","threequartersemdash","periodsuperior","questionsmall","asuperior","bsuperior","centsuperior","dsuperior","esuperior","isuperior","lsuperior","msuperior","nsuperior","osuperior","rsuperior","ssuperior","tsuperior","ff","ffi","ffl","parenleftinferior","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","exclamdownsmall","centoldstyle","Lslashsmall","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","Dotaccentsmall","Macronsmall","figuredash","hypheninferior","Ogoneksmall","Ringsmall","Cedillasmall","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","zerosuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall","001.000","001.001","001.002","001.003","Black","Bold","Book","Light","Medium","Regular","Roman","Semibold"],$y=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quoteright","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","quoteleft","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","exclamdown","cent","sterling","fraction","yen","florin","section","currency","quotesingle","quotedblleft","guillemotleft","guilsinglleft","guilsinglright","fi","fl","","endash","dagger","daggerdbl","periodcentered","","paragraph","bullet","quotesinglbase","quotedblbase","quotedblright","guillemotright","ellipsis","perthousand","","questiondown","","grave","acute","circumflex","tilde","macron","breve","dotaccent","dieresis","","ring","cedilla","","hungarumlaut","ogonek","caron","emdash","","","","","","","","","","","","","","","","","AE","","ordfeminine","","","","","Lslash","Oslash","OE","ordmasculine","","","","","","ae","","","","dotlessi","","","lslash","oslash","oe","germandbls"],Qy=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclamsmall","Hungarumlautsmall","","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","commasuperior","threequartersemdash","periodsuperior","questionsmall","","asuperior","bsuperior","centsuperior","dsuperior","esuperior","","","isuperior","","","lsuperior","msuperior","nsuperior","osuperior","","","rsuperior","ssuperior","tsuperior","","ff","fi","fl","ffi","ffl","parenleftinferior","","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","exclamdownsmall","centoldstyle","Lslashsmall","","","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","","Dotaccentsmall","","","Macronsmall","","","figuredash","hypheninferior","","","Ogoneksmall","Ringsmall","Cedillasmall","","","","onequarter","onehalf","threequarters","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","","","zerosuperior","onesuperior","twosuperior","threesuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall"],os=[".notdef",".null","nonmarkingreturn","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quotesingle","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","grave","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","Adieresis","Aring","Ccedilla","Eacute","Ntilde","Odieresis","Udieresis","aacute","agrave","acircumflex","adieresis","atilde","aring","ccedilla","eacute","egrave","ecircumflex","edieresis","iacute","igrave","icircumflex","idieresis","ntilde","oacute","ograve","ocircumflex","odieresis","otilde","uacute","ugrave","ucircumflex","udieresis","dagger","degree","cent","sterling","section","bullet","paragraph","germandbls","registered","copyright","trademark","acute","dieresis","notequal","AE","Oslash","infinity","plusminus","lessequal","greaterequal","yen","mu","partialdiff","summation","product","pi","integral","ordfeminine","ordmasculine","Omega","ae","oslash","questiondown","exclamdown","logicalnot","radical","florin","approxequal","Delta","guillemotleft","guillemotright","ellipsis","nonbreakingspace","Agrave","Atilde","Otilde","OE","oe","endash","emdash","quotedblleft","quotedblright","quoteleft","quoteright","divide","lozenge","ydieresis","Ydieresis","fraction","currency","guilsinglleft","guilsinglright","fi","fl","daggerdbl","periodcentered","quotesinglbase","quotedblbase","perthousand","Acircumflex","Ecircumflex","Aacute","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Oacute","Ocircumflex","apple","Ograve","Uacute","Ucircumflex","Ugrave","dotlessi","circumflex","tilde","macron","breve","dotaccent","ring","cedilla","hungarumlaut","ogonek","caron","Lslash","lslash","Scaron","scaron","Zcaron","zcaron","brokenbar","Eth","eth","Yacute","yacute","Thorn","thorn","minus","multiply","onesuperior","twosuperior","threesuperior","onehalf","onequarter","threequarters","franc","Gbreve","gbreve","Idotaccent","Scedilla","scedilla","Cacute","cacute","Ccaron","ccaron","dcroat"];function hh(i){this.font=i}function uh(i){this.cmap=i}function T1(i,e){this.encoding=i,this.charset=e}function o4(i){switch(i.version){case 1:this.names=os.slice();break;case 2:this.names=new Array(i.numberOfGlyphs);for(var e=0;e<i.numberOfGlyphs;e++)this.names[e]=i.glyphNameIndex[e]<os.length?os[i.glyphNameIndex[e]]:i.names[i.glyphNameIndex[e]-os.length];break;case 2.5:this.names=new Array(i.numberOfGlyphs);for(var t=0;t<i.numberOfGlyphs;t++)this.names[t]=os[t+i.glyphNameIndex[t]];break;default:this.names=[]}}hh.prototype.charToGlyphIndex=function(i){var e=i.codePointAt(0),t=this.font.glyphs;if(t)for(var n=0;n<t.length;n+=1)for(var s=t.get(n),r=0;r<s.unicodes.length;r+=1)if(s.unicodes[r]===e)return n;return null},uh.prototype.charToGlyphIndex=function(i){return this.cmap.glyphIndexMap[i.codePointAt(0)]||0},T1.prototype.charToGlyphIndex=function(i){var e=i.codePointAt(0);return this.charset.indexOf(this.encoding[e])},o4.prototype.nameToGlyphIndex=function(i){return this.names.indexOf(i)},o4.prototype.glyphIndexToName=function(i){return this.names[i]};var ls_line=function nx(i,e,t,n,s){i.beginPath(),i.moveTo(e,t),i.lineTo(n,s),i.stroke()};function U0(i){this.bindConstructorValues(i)}function w1(i,e,t){Object.defineProperty(i,e,{get:function(){return i[t]},set:function(n){i[t]=n},enumerable:!0,configurable:!0})}function l4(i,e){if(this.font=i,this.glyphs={},Array.isArray(e))for(var t=0;t<e.length;t++){var n=e[t];n.path.unitsPerEm=i.unitsPerEm,this.glyphs[t]=n}this.length=e&&e.length||0}U0.prototype.bindConstructorValues=function(i){this.index=i.index||0,this.name=i.name||null,this.unicode=i.unicode||void 0,this.unicodes=i.unicodes||void 0!==i.unicode?[i.unicode]:[],"xMin"in i&&(this.xMin=i.xMin),"yMin"in i&&(this.yMin=i.yMin),"xMax"in i&&(this.xMax=i.xMax),"yMax"in i&&(this.yMax=i.yMax),"advanceWidth"in i&&(this.advanceWidth=i.advanceWidth),Object.defineProperty(this,"path",function ix(i,e){var t=e||new Qt;return{configurable:!0,get:function(){return"function"==typeof t&&(t=t()),t},set:function(n){t=n}}}(0,i.path))},U0.prototype.addUnicode=function(i){0===this.unicodes.length&&(this.unicode=i),this.unicodes.push(i)},U0.prototype.getBoundingBox=function(){return this.path.getBoundingBox()},U0.prototype.getPath=function(i,e,t,n,s){var r,a;i=void 0!==i?i:0,e=void 0!==e?e:0,t=void 0!==t?t:72,n||(n={});var o=n.xScale,l=n.yScale;if(n.hinting&&s&&s.hinting&&(a=this.path&&s.hinting.exec(this,t)),a)r=s.hinting.getCommands(a),i=Math.round(i),e=Math.round(e),o=l=1;else{r=this.path.commands;var c=1/(this.path.unitsPerEm||1e3)*t;void 0===o&&(o=c),void 0===l&&(l=c)}for(var u=new Qt,f=0;f<r.length;f+=1){var d=r[f];"M"===d.type?u.moveTo(i+d.x*o,e+-d.y*l):"L"===d.type?u.lineTo(i+d.x*o,e+-d.y*l):"Q"===d.type?u.quadraticCurveTo(i+d.x1*o,e+-d.y1*l,i+d.x*o,e+-d.y*l):"C"===d.type?u.curveTo(i+d.x1*o,e+-d.y1*l,i+d.x2*o,e+-d.y2*l,i+d.x*o,e+-d.y*l):"Z"===d.type&&u.closePath()}return u},U0.prototype.getContours=function(){if(void 0===this.points)return[];for(var i=[],e=[],t=0;t<this.points.length;t+=1){var n=this.points[t];e.push(n),n.lastPointOfContour&&(i.push(e),e=[])}return Ze.argument(0===e.length,"There are still points left in the current contour."),i},U0.prototype.getMetrics=function(){for(var i=this.path.commands,e=[],t=[],n=0;n<i.length;n+=1){var s=i[n];"Z"!==s.type&&(e.push(s.x),t.push(s.y)),("Q"===s.type||"C"===s.type)&&(e.push(s.x1),t.push(s.y1)),"C"===s.type&&(e.push(s.x2),t.push(s.y2))}var r={xMin:Math.min.apply(null,e),yMin:Math.min.apply(null,t),xMax:Math.max.apply(null,e),yMax:Math.max.apply(null,t),leftSideBearing:this.leftSideBearing};return isFinite(r.xMin)||(r.xMin=0),isFinite(r.xMax)||(r.xMax=this.advanceWidth),isFinite(r.yMin)||(r.yMin=0),isFinite(r.yMax)||(r.yMax=0),r.rightSideBearing=this.advanceWidth-r.leftSideBearing-(r.xMax-r.xMin),r},U0.prototype.draw=function(i,e,t,n,s){this.getPath(e,t,n,s).draw(i)},U0.prototype.drawPoints=function(i,e,t,n){function s(f,d,p,m){i.beginPath();for(var y=0;y<f.length;y+=1)i.moveTo(d+f[y].x*m,p+f[y].y*m),i.arc(d+f[y].x*m,p+f[y].y*m,2,0,2*Math.PI,!1);i.closePath(),i.fill()}e=void 0!==e?e:0,t=void 0!==t?t:0;for(var r=1/this.path.unitsPerEm*(n=void 0!==n?n:24),a=[],o=[],l=this.path,c=0;c<l.commands.length;c+=1){var u=l.commands[c];void 0!==u.x&&a.push({x:u.x,y:-u.y}),void 0!==u.x1&&o.push({x:u.x1,y:-u.y1}),void 0!==u.x2&&o.push({x:u.x2,y:-u.y2})}i.fillStyle="blue",s(a,e,t,r),i.fillStyle="red",s(o,e,t,r)},U0.prototype.drawMetrics=function(i,e,t,n){var s;e=void 0!==e?e:0,t=void 0!==t?t:0,s=1/this.path.unitsPerEm*(n=void 0!==n?n:24),i.lineWidth=1,i.strokeStyle="black",ls_line(i,e,-1e4,e,1e4),ls_line(i,-1e4,t,1e4,t);var r=this.xMin||0,a=this.yMin||0,o=this.xMax||0,l=this.yMax||0,c=this.advanceWidth||0;i.strokeStyle="blue",ls_line(i,e+r*s,-1e4,e+r*s,1e4),ls_line(i,e+o*s,-1e4,e+o*s,1e4),ls_line(i,-1e4,t+-a*s,1e4,t+-a*s),ls_line(i,-1e4,t+-l*s,1e4,t+-l*s),i.strokeStyle="green",ls_line(i,e+c*s,-1e4,e+c*s,1e4)},l4.prototype.get=function(i){if(void 0===this.glyphs[i]){this.font._push(i),"function"==typeof this.glyphs[i]&&(this.glyphs[i]=this.glyphs[i]());var e=this.glyphs[i],t=this.font._IndexToUnicodeMap[i];if(t)for(var n=0;n<t.unicodes.length;n++)e.addUnicode(t.unicodes[n]);this.font.cffEncoding?e.name=this.font.isCIDFont?"gid"+i:this.font.cffEncoding.charset[i]:this.font.glyphNames.names&&(e.name=this.font.glyphNames.glyphIndexToName(i)),this.glyphs[i].advanceWidth=this.font._hmtxTableData[i].advanceWidth,this.glyphs[i].leftSideBearing=this.font._hmtxTableData[i].leftSideBearing}else"function"==typeof this.glyphs[i]&&(this.glyphs[i]=this.glyphs[i]());return this.glyphs[i]},l4.prototype.push=function(i,e){this.glyphs[i]=e,this.length++};var wn={GlyphSet:l4,glyphLoader:function sx(i,e){return new U0({index:e,font:i})},ttfGlyphLoader:function rx(i,e,t,n,s,r){return function(){var a=new U0({index:e,font:i});return a.path=function(){t(a,n,s);var o=r(i.glyphs,a);return o.unitsPerEm=i.unitsPerEm,o},w1(a,"xMin","_xMin"),w1(a,"xMax","_xMax"),w1(a,"yMin","_yMin"),w1(a,"yMax","_yMax"),a}},cffGlyphLoader:function ax(i,e,t,n){return function(){var s=new U0({index:e,font:i});return s.path=function(){var r=t(i,s,n);return r.unitsPerEm=i.unitsPerEm,r},s}}};function fh(i,e){if(i===e)return!0;if(Array.isArray(i)&&Array.isArray(e)){if(i.length!==e.length)return!1;for(var t=0;t<i.length;t+=1)if(!fh(i[t],e[t]))return!1;return!0}return!1}function c4(i){return i.length<1240?107:i.length<33900?1131:32768}function Mi(i,e,t){var a,o,n=[],s=[],r=Pe.getCard16(i,e);if(0!==r){var l=Pe.getByte(i,e+2);a=e+(r+1)*l+2;for(var c=e+3,u=0;u<r+1;u+=1)n.push(Pe.getOffset(i,c,l)),c+=l;o=a+n[r]}else o=e+2;for(var f=0;f<n.length-1;f+=1){var d=Pe.getBytes(i,a+n[f],a+n[f+1]);t&&(d=t(d)),s.push(d)}return{objects:s,startOffset:e,endOffset:o}}function hx(i,e){if(28===e)return i.parseByte()<<8|i.parseByte();if(29===e)return i.parseByte()<<24|i.parseByte()<<16|i.parseByte()<<8|i.parseByte();if(30===e)return function cx(i){for(var e="",n=["0","1","2","3","4","5","6","7","8","9",".","E","E-",null,"-"];;){var s=i.parseByte(),r=s>>4,a=15&s;if(15===r||(e+=n[r],15===a))break;e+=n[a]}return parseFloat(e)}(i);if(e>=32&&e<=246)return e-139;if(e>=247&&e<=250)return 256*(e-247)+i.parseByte()+108;if(e>=251&&e<=254)return 256*-(e-251)-i.parseByte()-108;throw new Error("Invalid b0 "+e)}function dh(i,e,t){var n=new Pe.Parser(i,e=void 0!==e?e:0),s=[],r=[];for(t=void 0!==t?t:i.length;n.relativeOffset<t;){var a=n.parseByte();a<=21?(12===a&&(a=1200+n.parseByte()),s.push([a,r]),r=[]):r.push(hx(n,a))}return function ux(i){for(var e={},t=0;t<i.length;t+=1){var r,n=i[t][0],s=i[t][1];if(r=1===s.length?s[0]:s,e.hasOwnProperty(n)&&!isNaN(e[n]))throw new Error("Object "+e+" already has key "+n);e[n]=r}return e}(s)}function ga(i,e){return e<=390?E1[e]:i[e-391]}function ph(i,e,t){for(var s,n={},r=0;r<e.length;r+=1){var a=e[r];if(Array.isArray(a.type)){var o=[];o.length=a.type.length;for(var l=0;l<a.type.length;l++)void 0===(s=void 0!==i[a.op]?i[a.op][l]:void 0)&&(s=void 0!==a.value&&void 0!==a.value[l]?a.value[l]:null),"SID"===a.type[l]&&(s=ga(t,s)),o[l]=s;n[a.name]=o}else void 0===(s=i[a.op])&&(s=void 0!==a.value?a.value:null),"SID"===a.type&&(s=ga(t,s)),n[a.name]=s}return n}var mh=[{name:"version",op:0,type:"SID"},{name:"notice",op:1,type:"SID"},{name:"copyright",op:1200,type:"SID"},{name:"fullName",op:2,type:"SID"},{name:"familyName",op:3,type:"SID"},{name:"weight",op:4,type:"SID"},{name:"isFixedPitch",op:1201,type:"number",value:0},{name:"italicAngle",op:1202,type:"number",value:0},{name:"underlinePosition",op:1203,type:"number",value:-100},{name:"underlineThickness",op:1204,type:"number",value:50},{name:"paintType",op:1205,type:"number",value:0},{name:"charstringType",op:1206,type:"number",value:2},{name:"fontMatrix",op:1207,type:["real","real","real","real","real","real"],value:[.001,0,0,.001,0,0]},{name:"uniqueId",op:13,type:"number"},{name:"fontBBox",op:5,type:["number","number","number","number"],value:[0,0,0,0]},{name:"strokeWidth",op:1208,type:"number",value:0},{name:"xuid",op:14,type:[],value:null},{name:"charset",op:15,type:"offset",value:0},{name:"encoding",op:16,type:"offset",value:0},{name:"charStrings",op:17,type:"offset",value:0},{name:"private",op:18,type:["number","offset"],value:[0,0]},{name:"ros",op:1230,type:["SID","SID","number"]},{name:"cidFontVersion",op:1231,type:"number",value:0},{name:"cidFontRevision",op:1232,type:"number",value:0},{name:"cidFontType",op:1233,type:"number",value:0},{name:"cidCount",op:1234,type:"number",value:8720},{name:"uidBase",op:1235,type:"number"},{name:"fdArray",op:1236,type:"offset"},{name:"fdSelect",op:1237,type:"offset"},{name:"fontName",op:1238,type:"SID"}],gh=[{name:"subrs",op:19,type:"offset",value:0},{name:"defaultWidthX",op:20,type:"number",value:0},{name:"nominalWidthX",op:21,type:"number",value:0}];function dx(i,e){return ph(dh(i,0,i.byteLength),mh,e)}function vh(i,e,t,n){return ph(dh(i,e,t),gh,n)}function yh(i,e,t,n){for(var s=[],r=0;r<t.length;r+=1){var o=dx(new DataView(new Uint8Array(t[r]).buffer),n);o._subrs=[],o._subrsBias=0,o._defaultWidthX=0,o._nominalWidthX=0;var l=o.private[0],c=o.private[1];if(0!==l&&0!==c){var u=vh(i,c+e,l,n);if(o._defaultWidthX=u.defaultWidthX,o._nominalWidthX=u.nominalWidthX,0!==u.subrs){var d=Mi(i,c+u.subrs+e);o._subrs=d.objects,o._subrsBias=c4(o._subrs)}o._privateDict=u}s.push(o)}return s}function xh(i,e,t){var n,s,r,a,m,y,v,g,o=new Qt,l=[],c=0,u=!1,f=!1,d=0,p=0;if(i.isCIDFont){var x=i.tables.cff.topDict._fdArray[i.tables.cff.topDict._fdSelect[e.index]];m=x._subrs,y=x._subrsBias,v=x._defaultWidthX,g=x._nominalWidthX}else m=i.tables.cff.topDict._subrs,y=i.tables.cff.topDict._subrsBias,v=i.tables.cff.topDict._defaultWidthX,g=i.tables.cff.topDict._nominalWidthX;var b=v;function T(w,I){f&&o.closePath(),o.moveTo(w,I),f=!0}function E(){l.length%2!=0&&!u&&(b=l.shift()+g),c+=l.length>>1,l.length=0,u=!0}return function M(w){for(var I,S,P,X,te,U,z,G,ee,J,Z,ne,Y=0;Y<w.length;){var he=w[Y];switch(Y+=1,he){case 1:case 3:case 18:case 23:E();break;case 4:l.length>1&&!u&&(b=l.shift()+g,u=!0),p+=l.pop(),T(d,p);break;case 5:for(;l.length>0;)d+=l.shift(),p+=l.shift(),o.lineTo(d,p);break;case 6:for(;l.length>0&&(d+=l.shift(),o.lineTo(d,p),0!==l.length);)p+=l.shift(),o.lineTo(d,p);break;case 7:for(;l.length>0&&(p+=l.shift(),o.lineTo(d,p),0!==l.length);)d+=l.shift(),o.lineTo(d,p);break;case 8:for(;l.length>0;)n=d+l.shift(),s=p+l.shift(),r=n+l.shift(),a=s+l.shift(),d=r+l.shift(),p=a+l.shift(),o.curveTo(n,s,r,a,d,p);break;case 10:te=l.pop()+y,(U=m[te])&&M(U);break;case 11:return;case 12:switch(he=w[Y],Y+=1,he){case 35:n=d+l.shift(),s=p+l.shift(),r=n+l.shift(),a=s+l.shift(),z=r+l.shift(),G=a+l.shift(),ee=z+l.shift(),J=G+l.shift(),Z=ee+l.shift(),ne=J+l.shift(),d=Z+l.shift(),p=ne+l.shift(),l.shift(),o.curveTo(n,s,r,a,z,G),o.curveTo(ee,J,Z,ne,d,p);break;case 34:n=d+l.shift(),s=p,r=n+l.shift(),a=s+l.shift(),z=r+l.shift(),G=a,ee=z+l.shift(),J=a,Z=ee+l.shift(),ne=p,d=Z+l.shift(),o.curveTo(n,s,r,a,z,G),o.curveTo(ee,J,Z,ne,d,p);break;case 36:n=d+l.shift(),s=p+l.shift(),r=n+l.shift(),a=s+l.shift(),z=r+l.shift(),G=a,ee=z+l.shift(),J=a,Z=ee+l.shift(),ne=J+l.shift(),d=Z+l.shift(),o.curveTo(n,s,r,a,z,G),o.curveTo(ee,J,Z,ne,d,p);break;case 37:n=d+l.shift(),s=p+l.shift(),r=n+l.shift(),a=s+l.shift(),z=r+l.shift(),G=a+l.shift(),ee=z+l.shift(),J=G+l.shift(),Z=ee+l.shift(),ne=J+l.shift(),Math.abs(Z-d)>Math.abs(ne-p)?d=Z+l.shift():p=ne+l.shift(),o.curveTo(n,s,r,a,z,G),o.curveTo(ee,J,Z,ne,d,p);break;default:console.log("Glyph "+e.index+": unknown operator 1200"+he),l.length=0}break;case 14:l.length>0&&!u&&(b=l.shift()+g,u=!0),f&&(o.closePath(),f=!1);break;case 19:case 20:E(),Y+=c+7>>3;break;case 21:l.length>2&&!u&&(b=l.shift()+g,u=!0),p+=l.pop(),T(d+=l.pop(),p);break;case 22:l.length>1&&!u&&(b=l.shift()+g,u=!0),T(d+=l.pop(),p);break;case 24:for(;l.length>2;)n=d+l.shift(),s=p+l.shift(),r=n+l.shift(),a=s+l.shift(),d=r+l.shift(),p=a+l.shift(),o.curveTo(n,s,r,a,d,p);d+=l.shift(),p+=l.shift(),o.lineTo(d,p);break;case 25:for(;l.length>6;)d+=l.shift(),p+=l.shift(),o.lineTo(d,p);n=d+l.shift(),s=p+l.shift(),r=n+l.shift(),a=s+l.shift(),d=r+l.shift(),p=a+l.shift(),o.curveTo(n,s,r,a,d,p);break;case 26:for(l.length%2&&(d+=l.shift());l.length>0;)n=d,s=p+l.shift(),r=n+l.shift(),a=s+l.shift(),d=r,p=a+l.shift(),o.curveTo(n,s,r,a,d,p);break;case 27:for(l.length%2&&(p+=l.shift());l.length>0;)n=d+l.shift(),s=p,r=n+l.shift(),a=s+l.shift(),d=r+l.shift(),o.curveTo(n,s,r,a,d,p=a);break;case 28:l.push(((I=w[Y])<<24|(S=w[Y+1])<<16)>>16),Y+=2;break;case 29:te=l.pop()+i.gsubrsBias,(U=i.gsubrs[te])&&M(U);break;case 30:for(;l.length>0&&(n=d,s=p+l.shift(),r=n+l.shift(),a=s+l.shift(),d=r+l.shift(),p=a+(1===l.length?l.shift():0),o.curveTo(n,s,r,a,d,p),0!==l.length);)n=d+l.shift(),s=p,r=n+l.shift(),a=s+l.shift(),p=a+l.shift(),d=r+(1===l.length?l.shift():0),o.curveTo(n,s,r,a,d,p);break;case 31:for(;l.length>0&&(n=d+l.shift(),s=p,r=n+l.shift(),a=s+l.shift(),p=a+l.shift(),d=r+(1===l.length?l.shift():0),o.curveTo(n,s,r,a,d,p),0!==l.length);)n=d,s=p+l.shift(),r=n+l.shift(),a=s+l.shift(),d=r+l.shift(),p=a+(1===l.length?l.shift():0),o.curveTo(n,s,r,a,d,p);break;default:he<32?console.log("Glyph "+e.index+": unknown operator "+he):he<247?l.push(he-139):he<251?(I=w[Y],Y+=1,l.push(256*(he-247)+I+108)):he<255?(I=w[Y],Y+=1,l.push(256*-(he-251)-I-108)):(I=w[Y],S=w[Y+1],P=w[Y+2],X=w[Y+3],Y+=4,l.push((I<<24|S<<16|P<<8|X)/65536))}}}(t),e.advanceWidth=b,o}function _h(i,e){var t,n=E1.indexOf(i);return n>=0&&(t=n),(n=e.indexOf(i))>=0?t=n+E1.length:(t=E1.length+e.length,e.push(i)),t}function bh(i,e,t){for(var n={},s=0;s<i.length;s+=1){var r=i[s],a=e[r.name];void 0!==a&&!fh(a,r.value)&&("SID"===r.type&&(a=_h(a,t)),n[r.op]={name:r.name,type:r.type,value:a})}return n}function Sh(i,e){var t=new Me.Record("Top DICT",[{name:"dict",type:"DICT",value:{}}]);return t.dict=bh(mh,i,e),t}function Mh(i){var e=new Me.Record("Top DICT INDEX",[{name:"topDicts",type:"INDEX",value:[]}]);return e.topDicts=[{name:"topDict_0",type:"TABLE",value:i}],e}function Mx(i){var e=[],t=i.path;e.push({name:"width",type:"NUMBER",value:i.advanceWidth});for(var n=0,s=0,r=0;r<t.commands.length;r+=1){var a=void 0,o=void 0,l=t.commands[r];if("Q"===l.type){var c=.3333333333333333,u=2/3;l={type:"C",x:l.x,y:l.y,x1:Math.round(c*n+u*l.x1),y1:Math.round(c*s+u*l.y1),x2:Math.round(c*l.x+u*l.x1),y2:Math.round(c*l.y+u*l.y1)}}if("M"===l.type)a=Math.round(l.x-n),o=Math.round(l.y-s),e.push({name:"dx",type:"NUMBER",value:a}),e.push({name:"dy",type:"NUMBER",value:o}),e.push({name:"rmoveto",type:"OP",value:21}),n=Math.round(l.x),s=Math.round(l.y);else if("L"===l.type)a=Math.round(l.x-n),o=Math.round(l.y-s),e.push({name:"dx",type:"NUMBER",value:a}),e.push({name:"dy",type:"NUMBER",value:o}),e.push({name:"rlineto",type:"OP",value:5}),n=Math.round(l.x),s=Math.round(l.y);else if("C"===l.type){var f=Math.round(l.x1-n),d=Math.round(l.y1-s),p=Math.round(l.x2-l.x1),m=Math.round(l.y2-l.y1);a=Math.round(l.x-l.x2),o=Math.round(l.y-l.y2),e.push({name:"dx1",type:"NUMBER",value:f}),e.push({name:"dy1",type:"NUMBER",value:d}),e.push({name:"dx2",type:"NUMBER",value:p}),e.push({name:"dy2",type:"NUMBER",value:m}),e.push({name:"dx",type:"NUMBER",value:a}),e.push({name:"dy",type:"NUMBER",value:o}),e.push({name:"rrcurveto",type:"OP",value:8}),n=Math.round(l.x),s=Math.round(l.y)}}return e.push({name:"endchar",type:"OP",value:14}),e}var Eh_parse=function vx(i,e,t,n){t.tables.cff={};var s=function fx(i,e){var t={};return t.formatMajor=Pe.getCard8(i,e),t.formatMinor=Pe.getCard8(i,e+1),t.size=Pe.getCard8(i,e+2),t.offsetSize=Pe.getCard8(i,e+3),t.startOffset=e,t.endOffset=e+4,t}(i,e),r=Mi(i,s.endOffset,Pe.bytesToString),a=Mi(i,r.endOffset),o=Mi(i,a.endOffset,Pe.bytesToString),l=Mi(i,o.endOffset);t.gsubrs=l.objects,t.gsubrsBias=c4(t.gsubrs);var c=yh(i,e,a.objects,o.objects);if(1!==c.length)throw new Error("CFF table has too many fonts in 'FontSet' - count of fonts NameIndex.length = "+c.length);var u=c[0];if(t.tables.cff.topDict=u,u._privateDict&&(t.defaultWidthX=u._privateDict.defaultWidthX,t.nominalWidthX=u._privateDict.nominalWidthX),void 0!==u.ros[0]&&void 0!==u.ros[1]&&(t.isCIDFont=!0),t.isCIDFont){var f=u.fdArray,d=u.fdSelect;if(0===f||0===d)throw new Error("Font is marked as a CID font, but FDArray and/or FDSelect information is missing");var p=Mi(i,f+=e),m=yh(i,e,p.objects,o.objects);u._fdArray=m,u._fdSelect=function gx(i,e,t,n){var r,s=[],a=new Pe.Parser(i,e),o=a.parseCard8();if(0===o)for(var l=0;l<t;l++){if((r=a.parseCard8())>=n)throw new Error("CFF table CID Font FDSelect has bad FD index value "+r+" (FD count "+n+")");s.push(r)}else{if(3!==o)throw new Error("CFF Table CID Font FDSelect table has unsupported format "+o);var c=a.parseCard16(),u=a.parseCard16();if(0!==u)throw new Error("CFF Table CID Font FDSelect format 3 range has bad initial GID "+u);for(var f,d=0;d<c;d++){if(r=a.parseCard8(),f=a.parseCard16(),r>=n)throw new Error("CFF table CID Font FDSelect has bad FD index value "+r+" (FD count "+n+")");if(f>t)throw new Error("CFF Table CID Font FDSelect format 3 range has bad GID "+f);for(;u<f;u++)s.push(r);u=f}if(f!==t)throw new Error("CFF Table CID Font FDSelect format 3 range has bad final GID "+f)}return s}(i,d+=e,t.numGlyphs,m.length)}var x,y=e+u.private[1],v=vh(i,y,u.private[0],o.objects);if(t.defaultWidthX=v.defaultWidthX,t.nominalWidthX=v.nominalWidthX,0!==v.subrs){var _=Mi(i,y+v.subrs);t.subrs=_.objects,t.subrsBias=c4(t.subrs)}else t.subrs=[],t.subrsBias=0;n.lowMemory?(x=function ox(i,e){var s,r,t=[],n=Pe.getCard16(i,e);if(0!==n){var a=Pe.getByte(i,e+2);s=e+(n+1)*a+2;for(var o=e+3,l=0;l<n+1;l+=1)t.push(Pe.getOffset(i,o,a)),o+=a;r=s+t[n]}else r=e+2;return{offsets:t,startOffset:e,endOffset:r}}(i,e+u.charStrings),t.nGlyphs=x.offsets.length):(x=Mi(i,e+u.charStrings),t.nGlyphs=x.objects.length);var b=function px(i,e,t,n){var s,r,a=new Pe.Parser(i,e);t-=1;var o=[".notdef"],l=a.parseCard8();if(0===l)for(var c=0;c<t;c+=1)s=a.parseSID(),o.push(ga(n,s));else if(1===l)for(;o.length<=t;){s=a.parseSID(),r=a.parseCard8();for(var u=0;u<=r;u+=1)o.push(ga(n,s)),s+=1}else{if(2!==l)throw new Error("Unknown charset format "+l);for(;o.length<=t;){s=a.parseSID(),r=a.parseCard16();for(var f=0;f<=r;f+=1)o.push(ga(n,s)),s+=1}}return o}(i,e+u.charset,t.nGlyphs,o.objects);if(t.cffEncoding=0===u.encoding?new T1($y,b):1===u.encoding?new T1(Qy,b):function mx(i,e,t){var n,s={},r=new Pe.Parser(i,e),a=r.parseCard8();if(0===a)for(var o=r.parseCard8(),l=0;l<o;l+=1)s[n=r.parseCard8()]=l;else{if(1!==a)throw new Error("Unknown encoding format "+a);var c=r.parseCard8();n=1;for(var u=0;u<c;u+=1)for(var f=r.parseCard8(),d=r.parseCard8(),p=f;p<=f+d;p+=1)s[p]=n,n+=1}return new T1(s,t)}(i,e+u.encoding,b),t.encoding=t.encoding||t.cffEncoding,t.glyphs=new wn.GlyphSet(t),n.lowMemory)t._push=function(M){var w=function lx(i,e,t,n,s){var r=Pe.getCard16(t,n),a=0;0!==r&&(a=n+(r+1)*Pe.getByte(t,n+2)+2);var l=Pe.getBytes(t,a+e[i],a+e[i+1]);return s&&(l=s(l)),l}(M,x.offsets,i,e+u.charStrings);t.glyphs.push(M,wn.cffGlyphLoader(t,M,xh,w))};else for(var T=0;T<t.nGlyphs;T+=1)t.glyphs.push(T,wn.cffGlyphLoader(t,T,xh,x.objects[T]))},Eh_make=function wx(i,e){for(var o,t=new Me.Table("CFF ",[{name:"header",type:"RECORD"},{name:"nameIndex",type:"RECORD"},{name:"topDictIndex",type:"RECORD"},{name:"stringIndex",type:"RECORD"},{name:"globalSubrIndex",type:"RECORD"},{name:"charsets",type:"RECORD"},{name:"charStringsIndex",type:"RECORD"},{name:"privateDict",type:"RECORD"}]),n=1/e.unitsPerEm,s={version:e.version,fullName:e.fullName,familyName:e.familyName,weight:e.weightName,fontBBox:e.fontBBox||[0,0,0,0],fontMatrix:[n,0,0,n,0,0],charset:999,encoding:0,charStrings:999,private:[0,999]},a=[],l=1;l<i.length;l+=1)o=i.get(l),a.push(o.name);var c=[];t.header=function yx(){return new Me.Record("Header",[{name:"major",type:"Card8",value:1},{name:"minor",type:"Card8",value:0},{name:"hdrSize",type:"Card8",value:4},{name:"major",type:"Card8",value:1}])}(),t.nameIndex=function xx(i){var e=new Me.Record("Name INDEX",[{name:"names",type:"INDEX",value:[]}]);e.names=[];for(var t=0;t<i.length;t+=1)e.names.push({name:"name_"+t,type:"NAME",value:i[t]});return e}([e.postScriptName]);var u=Sh(s,c);t.topDictIndex=Mh(u),t.globalSubrIndex=function bx(){return new Me.Record("Global Subr INDEX",[{name:"subrs",type:"INDEX",value:[]}])}(),t.charsets=function Sx(i,e){for(var t=new Me.Record("Charsets",[{name:"format",type:"Card8",value:0}]),n=0;n<i.length;n+=1){var r=_h(i[n],e);t.fields.push({name:"glyph_"+n,type:"SID",value:r})}return t}(a,c),t.charStringsIndex=function Ex(i){for(var e=new Me.Record("CharStrings INDEX",[{name:"charStrings",type:"INDEX",value:[]}]),t=0;t<i.length;t+=1){var n=i.get(t),s=Mx(n);e.charStrings.push({name:n.name,type:"CHARSTRING",value:s})}return e}(i),t.privateDict=function Tx(i,e){var t=new Me.Record("Private DICT",[{name:"dict",type:"DICT",value:{}}]);return t.dict=bh(gh,i,e),t}({},c),t.stringIndex=function _x(i){var e=new Me.Record("String INDEX",[{name:"strings",type:"INDEX",value:[]}]);e.strings=[];for(var t=0;t<i.length;t+=1)e.strings.push({name:"string_"+t,type:"STRING",value:i[t]});return e}(c);var f=t.header.sizeOf()+t.nameIndex.sizeOf()+t.topDictIndex.sizeOf()+t.stringIndex.sizeOf()+t.globalSubrIndex.sizeOf();return s.charset=f,s.encoding=0,s.charStrings=s.charset+t.charsets.sizeOf(),s.private[1]=s.charStrings+t.charStringsIndex.sizeOf(),u=Sh(s,c),t.topDictIndex=Mh(u),t},Th_parse=function Ax(i,e){var t={},n=new Pe.Parser(i,e);return t.version=n.parseVersion(),t.fontRevision=Math.round(1e3*n.parseFixed())/1e3,t.checkSumAdjustment=n.parseULong(),t.magicNumber=n.parseULong(),Ze.argument(1594834165===t.magicNumber,"Font header has wrong magic number."),t.flags=n.parseUShort(),t.unitsPerEm=n.parseUShort(),t.created=n.parseLongDateTime(),t.modified=n.parseLongDateTime(),t.xMin=n.parseShort(),t.yMin=n.parseShort(),t.xMax=n.parseShort(),t.yMax=n.parseShort(),t.macStyle=n.parseUShort(),t.lowestRecPPEM=n.parseUShort(),t.fontDirectionHint=n.parseShort(),t.indexToLocFormat=n.parseShort(),t.glyphDataFormat=n.parseShort(),t},Th_make=function Cx(i){var e=Math.round((new Date).getTime()/1e3)+2082844800,t=e;return i.createdTimestamp&&(t=i.createdTimestamp+2082844800),new Me.Table("head",[{name:"version",type:"FIXED",value:65536},{name:"fontRevision",type:"FIXED",value:65536},{name:"checkSumAdjustment",type:"ULONG",value:0},{name:"magicNumber",type:"ULONG",value:1594834165},{name:"flags",type:"USHORT",value:0},{name:"unitsPerEm",type:"USHORT",value:1e3},{name:"created",type:"LONGDATETIME",value:t},{name:"modified",type:"LONGDATETIME",value:e},{name:"xMin",type:"SHORT",value:0},{name:"yMin",type:"SHORT",value:0},{name:"xMax",type:"SHORT",value:0},{name:"yMax",type:"SHORT",value:0},{name:"macStyle",type:"USHORT",value:0},{name:"lowestRecPPEM",type:"USHORT",value:0},{name:"fontDirectionHint",type:"SHORT",value:2},{name:"indexToLocFormat",type:"SHORT",value:0},{name:"glyphDataFormat",type:"SHORT",value:0}],i)},wh_parse=function Px(i,e){var t={},n=new Pe.Parser(i,e);return t.version=n.parseVersion(),t.ascender=n.parseShort(),t.descender=n.parseShort(),t.lineGap=n.parseShort(),t.advanceWidthMax=n.parseUShort(),t.minLeftSideBearing=n.parseShort(),t.minRightSideBearing=n.parseShort(),t.xMaxExtent=n.parseShort(),t.caretSlopeRise=n.parseShort(),t.caretSlopeRun=n.parseShort(),t.caretOffset=n.parseShort(),n.relativeOffset+=8,t.metricDataFormat=n.parseShort(),t.numberOfHMetrics=n.parseUShort(),t},wh_make=function Rx(i){return new Me.Table("hhea",[{name:"version",type:"FIXED",value:65536},{name:"ascender",type:"FWORD",value:0},{name:"descender",type:"FWORD",value:0},{name:"lineGap",type:"FWORD",value:0},{name:"advanceWidthMax",type:"UFWORD",value:0},{name:"minLeftSideBearing",type:"FWORD",value:0},{name:"minRightSideBearing",type:"FWORD",value:0},{name:"xMaxExtent",type:"FWORD",value:0},{name:"caretSlopeRise",type:"SHORT",value:1},{name:"caretSlopeRun",type:"SHORT",value:0},{name:"caretOffset",type:"SHORT",value:0},{name:"reserved1",type:"SHORT",value:0},{name:"reserved2",type:"SHORT",value:0},{name:"reserved3",type:"SHORT",value:0},{name:"reserved4",type:"SHORT",value:0},{name:"metricDataFormat",type:"SHORT",value:0},{name:"numberOfHMetrics",type:"USHORT",value:0}],i)},Ah_parse=function Dx(i,e,t,n,s,r,a){a.lowMemory?function Ix(i,e,t,n,s){i._hmtxTableData={};for(var r,a,o=new Pe.Parser(e,t),l=0;l<s;l+=1)l<n&&(r=o.parseUShort(),a=o.parseShort()),i._hmtxTableData[l]={advanceWidth:r,leftSideBearing:a}}(i,e,t,n,s):function Lx(i,e,t,n,s){for(var r,a,o=new Pe.Parser(i,e),l=0;l<n;l+=1){l<t&&(r=o.parseUShort(),a=o.parseShort());var c=s.get(l);c.advanceWidth=r,c.leftSideBearing=a}}(e,t,n,s,r)},Ah_make=function Fx(i){for(var e=new Me.Table("hmtx",[]),t=0;t<i.length;t+=1){var n=i.get(t),r=n.leftSideBearing||0;e.fields.push({name:"advanceWidth_"+t,type:"USHORT",value:n.advanceWidth||0}),e.fields.push({name:"leftSideBearing_"+t,type:"SHORT",value:r})}return e},Ch_make=function Ox(i){for(var e=new Me.Table("ltag",[{name:"version",type:"ULONG",value:1},{name:"flags",type:"ULONG",value:0},{name:"numTags",type:"ULONG",value:i.length}]),t="",n=12+4*i.length,s=0;s<i.length;++s){var r=t.indexOf(i[s]);r<0&&(r=t.length,t+=i[s]),e.fields.push({name:"offset "+s,type:"USHORT",value:n+r}),e.fields.push({name:"length "+s,type:"USHORT",value:i[s].length})}return e.fields.push({name:"stringPool",type:"CHARARRAY",value:t}),e},Ch_parse=function Nx(i,e){var t=new Pe.Parser(i,e),n=t.parseULong();Ze.argument(1===n,"Unsupported ltag table version."),t.skip("uLong",1);for(var s=t.parseULong(),r=[],a=0;a<s;a++){for(var o="",l=e+t.parseUShort(),c=t.parseUShort(),u=l;u<l+c;++u)o+=String.fromCharCode(i.getInt8(u));r.push(o)}return r},Ph_parse=function kx(i,e){var t={},n=new Pe.Parser(i,e);return t.version=n.parseVersion(),t.numGlyphs=n.parseUShort(),1===t.version&&(t.maxPoints=n.parseUShort(),t.maxContours=n.parseUShort(),t.maxCompositePoints=n.parseUShort(),t.maxCompositeContours=n.parseUShort(),t.maxZones=n.parseUShort(),t.maxTwilightPoints=n.parseUShort(),t.maxStorage=n.parseUShort(),t.maxFunctionDefs=n.parseUShort(),t.maxInstructionDefs=n.parseUShort(),t.maxStackElements=n.parseUShort(),t.maxSizeOfInstructions=n.parseUShort(),t.maxComponentElements=n.parseUShort(),t.maxComponentDepth=n.parseUShort()),t},Ph_make=function Ux(i){return new Me.Table("maxp",[{name:"version",type:"FIXED",value:20480},{name:"numGlyphs",type:"USHORT",value:i}])},Rh=["copyright","fontFamily","fontSubfamily","uniqueID","fullName","version","postScriptName","trademark","manufacturer","designer","description","manufacturerURL","designerURL","license","licenseURL","reserved","preferredFamily","preferredSubfamily","compatibleFullName","sampleText","postScriptFindFontName","wwsFamily","wwsSubfamily"],Lh={0:"en",1:"fr",2:"de",3:"it",4:"nl",5:"sv",6:"es",7:"da",8:"pt",9:"no",10:"he",11:"ja",12:"ar",13:"fi",14:"el",15:"is",16:"mt",17:"tr",18:"hr",19:"zh-Hant",20:"ur",21:"hi",22:"th",23:"ko",24:"lt",25:"pl",26:"hu",27:"es",28:"lv",29:"se",30:"fo",31:"fa",32:"ru",33:"zh",34:"nl-BE",35:"ga",36:"sq",37:"ro",38:"cz",39:"sk",40:"si",41:"yi",42:"sr",43:"mk",44:"bg",45:"uk",46:"be",47:"uz",48:"kk",49:"az-Cyrl",50:"az-Arab",51:"hy",52:"ka",53:"mo",54:"ky",55:"tg",56:"tk",57:"mn-CN",58:"mn",59:"ps",60:"ks",61:"ku",62:"sd",63:"bo",64:"ne",65:"sa",66:"mr",67:"bn",68:"as",69:"gu",70:"pa",71:"or",72:"ml",73:"kn",74:"ta",75:"te",76:"si",77:"my",78:"km",79:"lo",80:"vi",81:"id",82:"tl",83:"ms",84:"ms-Arab",85:"am",86:"ti",87:"om",88:"so",89:"sw",90:"rw",91:"rn",92:"ny",93:"mg",94:"eo",128:"cy",129:"eu",130:"ca",131:"la",132:"qu",133:"gn",134:"ay",135:"tt",136:"ug",137:"dz",138:"jv",139:"su",140:"gl",141:"af",142:"br",143:"iu",144:"gd",145:"gv",146:"ga",147:"to",148:"el-polyton",149:"kl",150:"az",151:"nn"},Bx={0:0,1:0,2:0,3:0,4:0,5:0,6:0,7:0,8:0,9:0,10:5,11:1,12:4,13:0,14:6,15:0,16:0,17:0,18:0,19:2,20:4,21:9,22:21,23:3,24:29,25:29,26:29,27:29,28:29,29:0,30:0,31:4,32:7,33:25,34:0,35:0,36:0,37:0,38:29,39:29,40:0,41:5,42:7,43:7,44:7,45:7,46:7,47:7,48:7,49:7,50:4,51:24,52:23,53:7,54:7,55:7,56:7,57:27,58:7,59:4,60:4,61:4,62:4,63:26,64:9,65:9,66:9,67:13,68:13,69:11,70:10,71:12,72:17,73:16,74:14,75:15,76:18,77:19,78:20,79:22,80:30,81:0,82:0,83:0,84:4,85:28,86:28,87:28,88:0,89:0,90:0,91:0,92:0,93:0,94:0,128:0,129:0,130:0,131:0,132:0,133:0,134:0,135:7,136:4,137:26,138:0,139:0,140:0,141:0,142:0,143:28,144:0,145:0,146:0,147:0,148:6,149:0,150:0,151:0},Ih={1078:"af",1052:"sq",1156:"gsw",1118:"am",5121:"ar-DZ",15361:"ar-BH",3073:"ar",2049:"ar-IQ",11265:"ar-JO",13313:"ar-KW",12289:"ar-LB",4097:"ar-LY",6145:"ary",8193:"ar-OM",16385:"ar-QA",1025:"ar-SA",10241:"ar-SY",7169:"aeb",14337:"ar-AE",9217:"ar-YE",1067:"hy",1101:"as",2092:"az-Cyrl",1068:"az",1133:"ba",1069:"eu",1059:"be",2117:"bn",1093:"bn-IN",8218:"bs-Cyrl",5146:"bs",1150:"br",1026:"bg",1027:"ca",3076:"zh-HK",5124:"zh-MO",2052:"zh",4100:"zh-SG",1028:"zh-TW",1155:"co",1050:"hr",4122:"hr-BA",1029:"cs",1030:"da",1164:"prs",1125:"dv",2067:"nl-BE",1043:"nl",3081:"en-AU",10249:"en-BZ",4105:"en-CA",9225:"en-029",16393:"en-IN",6153:"en-IE",8201:"en-JM",17417:"en-MY",5129:"en-NZ",13321:"en-PH",18441:"en-SG",7177:"en-ZA",11273:"en-TT",2057:"en-GB",1033:"en",12297:"en-ZW",1061:"et",1080:"fo",1124:"fil",1035:"fi",2060:"fr-BE",3084:"fr-CA",1036:"fr",5132:"fr-LU",6156:"fr-MC",4108:"fr-CH",1122:"fy",1110:"gl",1079:"ka",3079:"de-AT",1031:"de",5127:"de-LI",4103:"de-LU",2055:"de-CH",1032:"el",1135:"kl",1095:"gu",1128:"ha",1037:"he",1081:"hi",1038:"hu",1039:"is",1136:"ig",1057:"id",1117:"iu",2141:"iu-Latn",2108:"ga",1076:"xh",1077:"zu",1040:"it",2064:"it-CH",1041:"ja",1099:"kn",1087:"kk",1107:"km",1158:"quc",1159:"rw",1089:"sw",1111:"kok",1042:"ko",1088:"ky",1108:"lo",1062:"lv",1063:"lt",2094:"dsb",1134:"lb",1071:"mk",2110:"ms-BN",1086:"ms",1100:"ml",1082:"mt",1153:"mi",1146:"arn",1102:"mr",1148:"moh",1104:"mn",2128:"mn-CN",1121:"ne",1044:"nb",2068:"nn",1154:"oc",1096:"or",1123:"ps",1045:"pl",1046:"pt",2070:"pt-PT",1094:"pa",1131:"qu-BO",2155:"qu-EC",3179:"qu",1048:"ro",1047:"rm",1049:"ru",9275:"smn",4155:"smj-NO",5179:"smj",3131:"se-FI",1083:"se",2107:"se-SE",8251:"sms",6203:"sma-NO",7227:"sms",1103:"sa",7194:"sr-Cyrl-BA",3098:"sr",6170:"sr-Latn-BA",2074:"sr-Latn",1132:"nso",1074:"tn",1115:"si",1051:"sk",1060:"sl",11274:"es-AR",16394:"es-BO",13322:"es-CL",9226:"es-CO",5130:"es-CR",7178:"es-DO",12298:"es-EC",17418:"es-SV",4106:"es-GT",18442:"es-HN",2058:"es-MX",19466:"es-NI",6154:"es-PA",15370:"es-PY",10250:"es-PE",20490:"es-PR",3082:"es",1034:"es",21514:"es-US",14346:"es-UY",8202:"es-VE",2077:"sv-FI",1053:"sv",1114:"syr",1064:"tg",2143:"tzm",1097:"ta",1092:"tt",1098:"te",1054:"th",1105:"bo",1055:"tr",1090:"tk",1152:"ug",1058:"uk",1070:"hsb",1056:"ur",2115:"uz-Cyrl",1091:"uz",1066:"vi",1106:"cy",1160:"wo",1157:"sah",1144:"ii",1130:"yo"};function Gx(i,e,t){switch(i){case 0:if(65535===e)return"und";if(t)return t[e];break;case 1:return Lh[e];case 3:return Ih[e]}}var h4="utf-16",zx={0:"macintosh",1:"x-mac-japanese",2:"x-mac-chinesetrad",3:"x-mac-korean",6:"x-mac-greek",7:"x-mac-cyrillic",9:"x-mac-devanagai",10:"x-mac-gurmukhi",11:"x-mac-gujarati",12:"x-mac-oriya",13:"x-mac-bengali",14:"x-mac-tamil",15:"x-mac-telugu",16:"x-mac-kannada",17:"x-mac-malayalam",18:"x-mac-sinhalese",19:"x-mac-burmese",20:"x-mac-khmer",21:"x-mac-thai",22:"x-mac-lao",23:"x-mac-georgian",24:"x-mac-armenian",25:"x-mac-chinesesimp",26:"x-mac-tibetan",27:"x-mac-mongolian",28:"x-mac-ethiopic",29:"x-mac-ce",30:"x-mac-vietnamese",31:"x-mac-extarabic"},Hx={15:"x-mac-icelandic",17:"x-mac-turkish",18:"x-mac-croatian",24:"x-mac-ce",25:"x-mac-ce",26:"x-mac-ce",27:"x-mac-ce",28:"x-mac-ce",30:"x-mac-icelandic",37:"x-mac-romanian",38:"x-mac-ce",39:"x-mac-ce",40:"x-mac-ce",143:"x-mac-inuit",146:"x-mac-gaelic"};function Dh(i,e,t){switch(i){case 0:return h4;case 1:return Hx[t]||zx[e];case 3:if(1===e||10===e)return h4}}function u4(i){var e={};for(var t in i)e[i[t]]=parseInt(t);return e}function Fh(i,e,t,n,s,r){return new Me.Record("NameRecord",[{name:"platformID",type:"USHORT",value:i},{name:"encodingID",type:"USHORT",value:e},{name:"languageID",type:"USHORT",value:t},{name:"nameID",type:"USHORT",value:n},{name:"length",type:"USHORT",value:s},{name:"offset",type:"USHORT",value:r}])}function Oh(i,e){var t=function Wx(i,e){var t=i.length,n=e.length-t+1;e:for(var s=0;s<n;s++)for(;s<n;s++){for(var r=0;r<t;r++)if(e[s+r]!==i[r])continue e;return s}return-1}(i,e);if(t<0){t=e.length;for(var n=0,s=i.length;n<s;++n)e.push(i[n])}return t}var Nh_parse=function Vx(i,e,t){for(var n={},s=new Pe.Parser(i,e),r=s.parseUShort(),a=s.parseUShort(),o=s.offset+s.parseUShort(),l=0;l<a;l++){var c=s.parseUShort(),u=s.parseUShort(),f=s.parseUShort(),d=s.parseUShort(),p=Rh[d]||d,m=s.parseUShort(),y=s.parseUShort(),v=Gx(c,f,t),g=Dh(c,u,f);if(void 0!==g&&void 0!==v){var _;if(_=g===h4?pr.UTF16(i,o+y,m):pr.MACSTRING(i,o+y,m,g)){var x=n[p];void 0===x&&(x=n[p]={}),x[v]=_}}}return 1===r&&s.parseUShort(),n},Nh_make=function Xx(i,e){var t,n=[],s={},r=u4(Rh);for(var a in i){var o=r[a];if(void 0===o&&(o=a),t=parseInt(o),isNaN(t))throw new Error('Name table entry "'+a+'" does not exist, see nameTableNames for complete list.');s[t]=i[a],n.push(t)}for(var l=u4(Lh),c=u4(Ih),u=[],f=[],d=0;d<n.length;d++){var p=s[t=n[d]];for(var m in p){var y=p[m],v=1,g=l[m],_=Bx[g],x=Dh(v,_,g),b=ye.MACSTRING(y,x);void 0===b&&(v=0,(g=e.indexOf(m))<0&&(g=e.length,e.push(m)),_=4,b=ye.UTF16(y));var T=Oh(b,f);u.push(Fh(v,_,g,t,b.length,T));var E=c[m];if(void 0!==E){var M=ye.UTF16(y),w=Oh(M,f);u.push(Fh(3,1,E,t,M.length,w))}}}u.sort(function(P,X){return P.platformID-X.platformID||P.encodingID-X.encodingID||P.languageID-X.languageID||P.nameID-X.nameID});for(var I=new Me.Table("name",[{name:"format",type:"USHORT",value:0},{name:"count",type:"USHORT",value:u.length},{name:"stringOffset",type:"USHORT",value:6+12*u.length}]),S=0;S<u.length;S++)I.fields.push({name:"record_"+S,type:"RECORD",value:u[S]});return I.fields.push({name:"strings",type:"LITERAL",value:f}),I},f4=[{begin:0,end:127},{begin:128,end:255},{begin:256,end:383},{begin:384,end:591},{begin:592,end:687},{begin:688,end:767},{begin:768,end:879},{begin:880,end:1023},{begin:11392,end:11519},{begin:1024,end:1279},{begin:1328,end:1423},{begin:1424,end:1535},{begin:42240,end:42559},{begin:1536,end:1791},{begin:1984,end:2047},{begin:2304,end:2431},{begin:2432,end:2559},{begin:2560,end:2687},{begin:2688,end:2815},{begin:2816,end:2943},{begin:2944,end:3071},{begin:3072,end:3199},{begin:3200,end:3327},{begin:3328,end:3455},{begin:3584,end:3711},{begin:3712,end:3839},{begin:4256,end:4351},{begin:6912,end:7039},{begin:4352,end:4607},{begin:7680,end:7935},{begin:7936,end:8191},{begin:8192,end:8303},{begin:8304,end:8351},{begin:8352,end:8399},{begin:8400,end:8447},{begin:8448,end:8527},{begin:8528,end:8591},{begin:8592,end:8703},{begin:8704,end:8959},{begin:8960,end:9215},{begin:9216,end:9279},{begin:9280,end:9311},{begin:9312,end:9471},{begin:9472,end:9599},{begin:9600,end:9631},{begin:9632,end:9727},{begin:9728,end:9983},{begin:9984,end:10175},{begin:12288,end:12351},{begin:12352,end:12447},{begin:12448,end:12543},{begin:12544,end:12591},{begin:12592,end:12687},{begin:43072,end:43135},{begin:12800,end:13055},{begin:13056,end:13311},{begin:44032,end:55215},{begin:55296,end:57343},{begin:67840,end:67871},{begin:19968,end:40959},{begin:57344,end:63743},{begin:12736,end:12783},{begin:64256,end:64335},{begin:64336,end:65023},{begin:65056,end:65071},{begin:65040,end:65055},{begin:65104,end:65135},{begin:65136,end:65279},{begin:65280,end:65519},{begin:65520,end:65535},{begin:3840,end:4095},{begin:1792,end:1871},{begin:1920,end:1983},{begin:3456,end:3583},{begin:4096,end:4255},{begin:4608,end:4991},{begin:5024,end:5119},{begin:5120,end:5759},{begin:5760,end:5791},{begin:5792,end:5887},{begin:6016,end:6143},{begin:6144,end:6319},{begin:10240,end:10495},{begin:40960,end:42127},{begin:5888,end:5919},{begin:66304,end:66351},{begin:66352,end:66383},{begin:66560,end:66639},{begin:118784,end:119039},{begin:119808,end:120831},{begin:1044480,end:1048573},{begin:65024,end:65039},{begin:917504,end:917631},{begin:6400,end:6479},{begin:6480,end:6527},{begin:6528,end:6623},{begin:6656,end:6687},{begin:11264,end:11359},{begin:11568,end:11647},{begin:19904,end:19967},{begin:43008,end:43055},{begin:65536,end:65663},{begin:65856,end:65935},{begin:66432,end:66463},{begin:66464,end:66527},{begin:66640,end:66687},{begin:66688,end:66735},{begin:67584,end:67647},{begin:68096,end:68191},{begin:119552,end:119647},{begin:73728,end:74751},{begin:119648,end:119679},{begin:7040,end:7103},{begin:7168,end:7247},{begin:7248,end:7295},{begin:43136,end:43231},{begin:43264,end:43311},{begin:43312,end:43359},{begin:43520,end:43615},{begin:65936,end:65999},{begin:66e3,end:66047},{begin:66208,end:66271},{begin:127024,end:127135}],d4_parse=function qx(i,e){var t={},n=new Pe.Parser(i,e);t.version=n.parseUShort(),t.xAvgCharWidth=n.parseShort(),t.usWeightClass=n.parseUShort(),t.usWidthClass=n.parseUShort(),t.fsType=n.parseUShort(),t.ySubscriptXSize=n.parseShort(),t.ySubscriptYSize=n.parseShort(),t.ySubscriptXOffset=n.parseShort(),t.ySubscriptYOffset=n.parseShort(),t.ySuperscriptXSize=n.parseShort(),t.ySuperscriptYSize=n.parseShort(),t.ySuperscriptXOffset=n.parseShort(),t.ySuperscriptYOffset=n.parseShort(),t.yStrikeoutSize=n.parseShort(),t.yStrikeoutPosition=n.parseShort(),t.sFamilyClass=n.parseShort(),t.panose=[];for(var s=0;s<10;s++)t.panose[s]=n.parseByte();return t.ulUnicodeRange1=n.parseULong(),t.ulUnicodeRange2=n.parseULong(),t.ulUnicodeRange3=n.parseULong(),t.ulUnicodeRange4=n.parseULong(),t.achVendID=String.fromCharCode(n.parseByte(),n.parseByte(),n.parseByte(),n.parseByte()),t.fsSelection=n.parseUShort(),t.usFirstCharIndex=n.parseUShort(),t.usLastCharIndex=n.parseUShort(),t.sTypoAscender=n.parseShort(),t.sTypoDescender=n.parseShort(),t.sTypoLineGap=n.parseShort(),t.usWinAscent=n.parseUShort(),t.usWinDescent=n.parseUShort(),t.version>=1&&(t.ulCodePageRange1=n.parseULong(),t.ulCodePageRange2=n.parseULong()),t.version>=2&&(t.sxHeight=n.parseShort(),t.sCapHeight=n.parseShort(),t.usDefaultChar=n.parseUShort(),t.usBreakChar=n.parseUShort(),t.usMaxContent=n.parseUShort()),t},d4_make=function Zx(i){return new Me.Table("OS/2",[{name:"version",type:"USHORT",value:3},{name:"xAvgCharWidth",type:"SHORT",value:0},{name:"usWeightClass",type:"USHORT",value:0},{name:"usWidthClass",type:"USHORT",value:0},{name:"fsType",type:"USHORT",value:0},{name:"ySubscriptXSize",type:"SHORT",value:650},{name:"ySubscriptYSize",type:"SHORT",value:699},{name:"ySubscriptXOffset",type:"SHORT",value:0},{name:"ySubscriptYOffset",type:"SHORT",value:140},{name:"ySuperscriptXSize",type:"SHORT",value:650},{name:"ySuperscriptYSize",type:"SHORT",value:699},{name:"ySuperscriptXOffset",type:"SHORT",value:0},{name:"ySuperscriptYOffset",type:"SHORT",value:479},{name:"yStrikeoutSize",type:"SHORT",value:49},{name:"yStrikeoutPosition",type:"SHORT",value:258},{name:"sFamilyClass",type:"SHORT",value:0},{name:"bFamilyType",type:"BYTE",value:0},{name:"bSerifStyle",type:"BYTE",value:0},{name:"bWeight",type:"BYTE",value:0},{name:"bProportion",type:"BYTE",value:0},{name:"bContrast",type:"BYTE",value:0},{name:"bStrokeVariation",type:"BYTE",value:0},{name:"bArmStyle",type:"BYTE",value:0},{name:"bLetterform",type:"BYTE",value:0},{name:"bMidline",type:"BYTE",value:0},{name:"bXHeight",type:"BYTE",value:0},{name:"ulUnicodeRange1",type:"ULONG",value:0},{name:"ulUnicodeRange2",type:"ULONG",value:0},{name:"ulUnicodeRange3",type:"ULONG",value:0},{name:"ulUnicodeRange4",type:"ULONG",value:0},{name:"achVendID",type:"CHARARRAY",value:"XXXX"},{name:"fsSelection",type:"USHORT",value:0},{name:"usFirstCharIndex",type:"USHORT",value:0},{name:"usLastCharIndex",type:"USHORT",value:0},{name:"sTypoAscender",type:"SHORT",value:0},{name:"sTypoDescender",type:"SHORT",value:0},{name:"sTypoLineGap",type:"SHORT",value:0},{name:"usWinAscent",type:"USHORT",value:0},{name:"usWinDescent",type:"USHORT",value:0},{name:"ulCodePageRange1",type:"ULONG",value:0},{name:"ulCodePageRange2",type:"ULONG",value:0},{name:"sxHeight",type:"SHORT",value:0},{name:"sCapHeight",type:"SHORT",value:0},{name:"usDefaultChar",type:"USHORT",value:0},{name:"usBreakChar",type:"USHORT",value:0},{name:"usMaxContext",type:"USHORT",value:0}],i)},d4_getUnicodeRange=function Yx(i){for(var e=0;e<f4.length;e+=1){var t=f4[e];if(i>=t.begin&&i<t.end)return e}return-1},kh_parse=function Jx(i,e){var t={},n=new Pe.Parser(i,e);switch(t.version=n.parseVersion(),t.italicAngle=n.parseFixed(),t.underlinePosition=n.parseShort(),t.underlineThickness=n.parseShort(),t.isFixedPitch=n.parseULong(),t.minMemType42=n.parseULong(),t.maxMemType42=n.parseULong(),t.minMemType1=n.parseULong(),t.maxMemType1=n.parseULong(),t.version){case 1:t.names=os.slice();break;case 2:t.numberOfGlyphs=n.parseUShort(),t.glyphNameIndex=new Array(t.numberOfGlyphs);for(var s=0;s<t.numberOfGlyphs;s++)t.glyphNameIndex[s]=n.parseUShort();t.names=[];for(var r=0;r<t.numberOfGlyphs;r++)if(t.glyphNameIndex[r]>=os.length){var a=n.parseChar();t.names.push(n.parseString(a))}break;case 2.5:t.numberOfGlyphs=n.parseUShort(),t.offset=new Array(t.numberOfGlyphs);for(var o=0;o<t.numberOfGlyphs;o++)t.offset[o]=n.parseChar()}return t},kh_make=function Kx(){return new Me.Table("post",[{name:"version",type:"FIXED",value:196608},{name:"italicAngle",type:"FIXED",value:0},{name:"underlinePosition",type:"FWORD",value:0},{name:"underlineThickness",type:"FWORD",value:0},{name:"isFixedPitch",type:"ULONG",value:0},{name:"minMemType42",type:"ULONG",value:0},{name:"maxMemType42",type:"ULONG",value:0},{name:"minMemType1",type:"ULONG",value:0},{name:"maxMemType1",type:"ULONG",value:0}])},ln=new Array(9);ln[1]=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort();return 1===t?{substFormat:1,coverage:this.parsePointer(q.coverage),deltaGlyphId:this.parseUShort()}:2===t?{substFormat:2,coverage:this.parsePointer(q.coverage),substitute:this.parseOffset16List()}:void Ze.assert(!1,"0x"+e.toString(16)+": lookup type 1 format must be 1 or 2.")},ln[2]=function(){var e=this.parseUShort();return Ze.argument(1===e,"GSUB Multiple Substitution Subtable identifier-format must be 1"),{substFormat:e,coverage:this.parsePointer(q.coverage),sequences:this.parseListOfLists()}},ln[3]=function(){var e=this.parseUShort();return Ze.argument(1===e,"GSUB Alternate Substitution Subtable identifier-format must be 1"),{substFormat:e,coverage:this.parsePointer(q.coverage),alternateSets:this.parseListOfLists()}},ln[4]=function(){var e=this.parseUShort();return Ze.argument(1===e,"GSUB ligature table identifier-format must be 1"),{substFormat:e,coverage:this.parsePointer(q.coverage),ligatureSets:this.parseListOfLists(function(){return{ligGlyph:this.parseUShort(),components:this.parseUShortList(this.parseUShort()-1)}})}};var mr={sequenceIndex:q.uShort,lookupListIndex:q.uShort};ln[5]=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort();if(1===t)return{substFormat:t,coverage:this.parsePointer(q.coverage),ruleSets:this.parseListOfLists(function(){var r=this.parseUShort(),a=this.parseUShort();return{input:this.parseUShortList(r-1),lookupRecords:this.parseRecordList(a,mr)}})};if(2===t)return{substFormat:t,coverage:this.parsePointer(q.coverage),classDef:this.parsePointer(q.classDef),classSets:this.parseListOfLists(function(){var r=this.parseUShort(),a=this.parseUShort();return{classes:this.parseUShortList(r-1),lookupRecords:this.parseRecordList(a,mr)}})};if(3===t){var n=this.parseUShort(),s=this.parseUShort();return{substFormat:t,coverages:this.parseList(n,q.pointer(q.coverage)),lookupRecords:this.parseRecordList(s,mr)}}Ze.assert(!1,"0x"+e.toString(16)+": lookup type 5 format must be 1, 2 or 3.")},ln[6]=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort();return 1===t?{substFormat:1,coverage:this.parsePointer(q.coverage),chainRuleSets:this.parseListOfLists(function(){return{backtrack:this.parseUShortList(),input:this.parseUShortList(this.parseShort()-1),lookahead:this.parseUShortList(),lookupRecords:this.parseRecordList(mr)}})}:2===t?{substFormat:2,coverage:this.parsePointer(q.coverage),backtrackClassDef:this.parsePointer(q.classDef),inputClassDef:this.parsePointer(q.classDef),lookaheadClassDef:this.parsePointer(q.classDef),chainClassSet:this.parseListOfLists(function(){return{backtrack:this.parseUShortList(),input:this.parseUShortList(this.parseShort()-1),lookahead:this.parseUShortList(),lookupRecords:this.parseRecordList(mr)}})}:3===t?{substFormat:3,backtrackCoverage:this.parseList(q.pointer(q.coverage)),inputCoverage:this.parseList(q.pointer(q.coverage)),lookaheadCoverage:this.parseList(q.pointer(q.coverage)),lookupRecords:this.parseRecordList(mr)}:void Ze.assert(!1,"0x"+e.toString(16)+": lookup type 6 format must be 1, 2 or 3.")},ln[7]=function(){var e=this.parseUShort();Ze.argument(1===e,"GSUB Extension Substitution subtable identifier-format must be 1");var t=this.parseUShort(),n=new q(this.data,this.offset+this.parseULong());return{substFormat:1,lookupType:t,extension:ln[t].call(n)}},ln[8]=function(){var e=this.parseUShort();return Ze.argument(1===e,"GSUB Reverse Chaining Contextual Single Substitution Subtable identifier-format must be 1"),{substFormat:e,coverage:this.parsePointer(q.coverage),backtrackCoverage:this.parseList(q.pointer(q.coverage)),lookaheadCoverage:this.parseList(q.pointer(q.coverage)),substitutes:this.parseUShortList()}};var gr=new Array(9);gr[1]=function(e){return new Me.Table("substitutionTable",1===e.substFormat?[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new Me.Coverage(e.coverage)},{name:"deltaGlyphID",type:"USHORT",value:e.deltaGlyphId}]:[{name:"substFormat",type:"USHORT",value:2},{name:"coverage",type:"TABLE",value:new Me.Coverage(e.coverage)}].concat(Me.ushortList("substitute",e.substitute)))},gr[2]=function(e){return Ze.assert(1===e.substFormat,"Lookup type 2 substFormat must be 1."),new Me.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new Me.Coverage(e.coverage)}].concat(Me.tableList("seqSet",e.sequences,function(t){return new Me.Table("sequenceSetTable",Me.ushortList("sequence",t))})))},gr[3]=function(e){return Ze.assert(1===e.substFormat,"Lookup type 3 substFormat must be 1."),new Me.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new Me.Coverage(e.coverage)}].concat(Me.tableList("altSet",e.alternateSets,function(t){return new Me.Table("alternateSetTable",Me.ushortList("alternate",t))})))},gr[4]=function(e){return Ze.assert(1===e.substFormat,"Lookup type 4 substFormat must be 1."),new Me.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new Me.Coverage(e.coverage)}].concat(Me.tableList("ligSet",e.ligatureSets,function(t){return new Me.Table("ligatureSetTable",Me.tableList("ligature",t,function(n){return new Me.Table("ligatureTable",[{name:"ligGlyph",type:"USHORT",value:n.ligGlyph}].concat(Me.ushortList("component",n.components,n.components.length+1)))}))})))},gr[6]=function(e){if(1===e.substFormat)return new Me.Table("chainContextTable",[{name:"substFormat",type:"USHORT",value:e.substFormat},{name:"coverage",type:"TABLE",value:new Me.Coverage(e.coverage)}].concat(Me.tableList("chainRuleSet",e.chainRuleSets,function(r){return new Me.Table("chainRuleSetTable",Me.tableList("chainRule",r,function(a){var o=Me.ushortList("backtrackGlyph",a.backtrack,a.backtrack.length).concat(Me.ushortList("inputGlyph",a.input,a.input.length+1)).concat(Me.ushortList("lookaheadGlyph",a.lookahead,a.lookahead.length)).concat(Me.ushortList("substitution",[],a.lookupRecords.length));return a.lookupRecords.forEach(function(l,c){o=o.concat({name:"sequenceIndex"+c,type:"USHORT",value:l.sequenceIndex}).concat({name:"lookupListIndex"+c,type:"USHORT",value:l.lookupListIndex})}),new Me.Table("chainRuleTable",o)}))})));if(2===e.substFormat)Ze.assert(!1,"lookup type 6 format 2 is not yet supported.");else if(3===e.substFormat){var n=[{name:"substFormat",type:"USHORT",value:e.substFormat}];return n.push({name:"backtrackGlyphCount",type:"USHORT",value:e.backtrackCoverage.length}),e.backtrackCoverage.forEach(function(r,a){n.push({name:"backtrackCoverage"+a,type:"TABLE",value:new Me.Coverage(r)})}),n.push({name:"inputGlyphCount",type:"USHORT",value:e.inputCoverage.length}),e.inputCoverage.forEach(function(r,a){n.push({name:"inputCoverage"+a,type:"TABLE",value:new Me.Coverage(r)})}),n.push({name:"lookaheadGlyphCount",type:"USHORT",value:e.lookaheadCoverage.length}),e.lookaheadCoverage.forEach(function(r,a){n.push({name:"lookaheadCoverage"+a,type:"TABLE",value:new Me.Coverage(r)})}),n.push({name:"substitutionCount",type:"USHORT",value:e.lookupRecords.length}),e.lookupRecords.forEach(function(r,a){n=n.concat({name:"sequenceIndex"+a,type:"USHORT",value:r.sequenceIndex}).concat({name:"lookupListIndex"+a,type:"USHORT",value:r.lookupListIndex})}),new Me.Table("chainContextTable",n)}Ze.assert(!1,"lookup type 6 format must be 1, 2 or 3.")};var Uh_parse=function $x(i,e){var t=new q(i,e=e||0),n=t.parseVersion(1);return Ze.argument(1===n||1.1===n,"Unsupported GSUB table version."),1===n?{version:n,scripts:t.parseScriptList(),features:t.parseFeatureList(),lookups:t.parseLookupList(ln)}:{version:n,scripts:t.parseScriptList(),features:t.parseFeatureList(),lookups:t.parseLookupList(ln),variations:t.parseFeatureVariationsList()}},Uh_make=function Qx(i){return new Me.Table("GSUB",[{name:"version",type:"ULONG",value:65536},{name:"scripts",type:"TABLE",value:new Me.ScriptList(i.scripts)},{name:"features",type:"TABLE",value:new Me.FeatureList(i.features)},{name:"lookups",type:"TABLE",value:new Me.LookupList(i.lookups,gr)}])},Bh_parse=function jx(i,e){var t=new Pe.Parser(i,e),n=t.parseULong();Ze.argument(1===n,"Unsupported META table version."),t.parseULong(),t.parseULong();for(var s=t.parseULong(),r={},a=0;a<s;a++){var o=t.parseTag(),l=t.parseULong(),c=t.parseULong(),u=pr.UTF8(i,e+l,c);r[o]=u}return r},Bh_make=function e_(i){var e=Object.keys(i).length,t="",n=16+12*e,s=new Me.Table("meta",[{name:"version",type:"ULONG",value:1},{name:"flags",type:"ULONG",value:0},{name:"offset",type:"ULONG",value:n},{name:"numTags",type:"ULONG",value:e}]);for(var r in i){var a=t.length;t+=i[r],s.fields.push({name:"tag "+r,type:"TAG",value:r}),s.fields.push({name:"offset "+r,type:"ULONG",value:n+a}),s.fields.push({name:"length "+r,type:"ULONG",value:i[r].length})}return s.fields.push({name:"stringPool",type:"CHARARRAY",value:t}),s};function Gh(i){return Math.log(i)/Math.log(2)|0}function p4(i){for(;i.length%4!=0;)i.push(0);for(var e=0,t=0;t<i.length;t+=4)e+=(i[t]<<24)+(i[t+1]<<16)+(i[t+2]<<8)+i[t+3];return e%Math.pow(2,32)}function zh(i,e,t,n){return new Me.Record("Table Record",[{name:"tag",type:"TAG",value:void 0!==i?i:""},{name:"checkSum",type:"ULONG",value:void 0!==e?e:0},{name:"offset",type:"ULONG",value:void 0!==t?t:0},{name:"length",type:"ULONG",value:void 0!==n?n:0}])}function Hh(i){var e=new Me.Table("sfnt",[{name:"version",type:"TAG",value:"OTTO"},{name:"numTables",type:"USHORT",value:0},{name:"searchRange",type:"USHORT",value:0},{name:"entrySelector",type:"USHORT",value:0},{name:"rangeShift",type:"USHORT",value:0}]);e.tables=i,e.numTables=i.length;var t=Math.pow(2,Gh(e.numTables));e.searchRange=16*t,e.entrySelector=Gh(t),e.rangeShift=16*e.numTables-e.searchRange;for(var n=[],s=[],r=e.sizeOf()+zh().sizeOf()*e.numTables;r%4!=0;)r+=1,s.push({name:"padding",type:"BYTE",value:0});for(var a=0;a<i.length;a+=1){var o=i[a];Ze.argument(4===o.tableName.length,"Table name"+o.tableName+" is invalid.");var l=o.sizeOf(),c=zh(o.tableName,p4(o.encode()),r,l);for(n.push({name:c.tag+" Table Record",type:"RECORD",value:c}),s.push({name:o.tableName+" table",type:"RECORD",value:o}),r+=l,Ze.argument(!isNaN(r),"Something went wrong calculating the offset.");r%4!=0;)r+=1,s.push({name:"padding",type:"BYTE",value:0})}return n.sort(function(u,f){return u.value.tag>f.value.tag?1:-1}),e.fields=e.fields.concat(n),e.fields=e.fields.concat(s),e}function Vh(i,e,t){for(var n=0;n<e.length;n+=1){var s=i.charToGlyphIndex(e[n]);if(s>0)return i.glyphs.get(s).getMetrics()}return t}function t_(i){for(var e=0,t=0;t<i.length;t+=1)e+=i[t];return e/i.length}var i__fontToTable=function n_(i){for(var l,e=[],t=[],n=[],s=[],r=[],a=[],o=[],c=0,u=0,f=0,d=0,p=0,m=0;m<i.glyphs.length;m+=1){var y=i.glyphs.get(m),v=0|y.unicode;if(isNaN(y.advanceWidth))throw new Error("Glyph "+y.name+" ("+m+"): advanceWidth is not a number.");(l>v||void 0===l)&&v>0&&(l=v),c<v&&(c=v);var g=d4_getUnicodeRange(v);if(g<32)u|=1<<g;else if(g<64)f|=1<<g-32;else if(g<96)d|=1<<g-64;else{if(!(g<123))throw new Error("Unicode ranges bits > 123 are reserved for internal usage");p|=1<<g-96}if(".notdef"!==y.name){var _=y.getMetrics();e.push(_.xMin),t.push(_.yMin),n.push(_.xMax),s.push(_.yMax),a.push(_.leftSideBearing),o.push(_.rightSideBearing),r.push(y.advanceWidth)}}var x={xMin:Math.min.apply(null,e),yMin:Math.min.apply(null,t),xMax:Math.max.apply(null,n),yMax:Math.max.apply(null,s),advanceWidthMax:Math.max.apply(null,r),advanceWidthAvg:t_(r),minLeftSideBearing:Math.min.apply(null,a),maxLeftSideBearing:Math.max.apply(null,a),minRightSideBearing:Math.min.apply(null,o)};x.ascender=i.ascender,x.descender=i.descender;var b=Th_make({flags:3,unitsPerEm:i.unitsPerEm,xMin:x.xMin,yMin:x.yMin,xMax:x.xMax,yMax:x.yMax,lowestRecPPEM:3,createdTimestamp:i.createdTimestamp}),T=wh_make({ascender:x.ascender,descender:x.descender,advanceWidthMax:x.advanceWidthMax,minLeftSideBearing:x.minLeftSideBearing,minRightSideBearing:x.minRightSideBearing,xMaxExtent:x.maxLeftSideBearing+(x.xMax-x.xMin),numberOfHMetrics:i.glyphs.length}),E=Ph_make(i.glyphs.length),M=d4_make(Object.assign({xAvgCharWidth:Math.round(x.advanceWidthAvg),usFirstCharIndex:l,usLastCharIndex:c,ulUnicodeRange1:u,ulUnicodeRange2:f,ulUnicodeRange3:d,ulUnicodeRange4:p,sTypoAscender:x.ascender,sTypoDescender:x.descender,sTypoLineGap:0,usWinAscent:x.yMax,usWinDescent:Math.abs(x.yMin),ulCodePageRange1:1,sxHeight:Vh(i,"xyvw",{yMax:Math.round(x.ascender/2)}).yMax,sCapHeight:Vh(i,"HIKLEFJMNTZBDPRAGOQSUVWXY",x).yMax,usDefaultChar:i.hasChar(" ")?32:0,usBreakChar:i.hasChar(" ")?32:0},i.tables.os2)),w=Ah_make(i.glyphs),I=ch_make(i.glyphs),S=i.getEnglishName("fontFamily"),P=i.getEnglishName("fontSubfamily"),X=S+" "+P,te=i.getEnglishName("postScriptName");te||(te=S.replace(/\s/g,"")+"-"+P);var U={};for(var z in i.names)U[z]=i.names[z];U.uniqueID||(U.uniqueID={en:i.getEnglishName("manufacturer")+":"+X}),U.postScriptName||(U.postScriptName={en:te}),U.preferredFamily||(U.preferredFamily=i.names.fontFamily),U.preferredSubfamily||(U.preferredSubfamily=i.names.fontSubfamily);var G=[],ee=Nh_make(U,G),J=G.length>0?Ch_make(G):void 0,Z=kh_make(),ne=Eh_make(i.glyphs,{version:i.getEnglishName("version"),fullName:X,familyName:S,weightName:P,postScriptName:te,unitsPerEm:i.unitsPerEm,fontBBox:[0,x.yMin,x.ascender,x.advanceWidthMax]}),Y=i.metas&&Object.keys(i.metas).length>0?Bh_make(i.metas):void 0,he=[b,T,E,M,ee,I,Z,ne,w];J&&he.push(J),i.tables.gsub&&he.push(Uh_make(i.tables.gsub)),Y&&he.push(Y);for(var Ce=Hh(he),ae=p4(Ce.encode()),xe=Ce.fields,Ee=!1,Le=0;Le<xe.length;Le+=1)if("head table"===xe[Le].name){xe[Le].value.checkSumAdjustment=2981146554-ae,Ee=!0;break}if(!Ee)throw new Error("Could not find head table with checkSum to adjust.");return Ce};function m4(i,e){for(var t=0,n=i.length-1;t<=n;){var s=t+n>>>1,r=i[s].tag;if(r===e)return s;r<e?t=s+1:n=s-1}return-t-1}function Wh(i,e){for(var t=0,n=i.length-1;t<=n;){var s=t+n>>>1,r=i[s];if(r===e)return s;r<e?t=s+1:n=s-1}return-t-1}function Xh(i,e){for(var t,n=0,s=i.length-1;n<=s;){var r=n+s>>>1,a=(t=i[r]).start;if(a===e)return t;a<e?n=r+1:s=r-1}if(n>0)return e>(t=i[n-1]).end?0:t}function va(i,e){this.font=i,this.tableName=e}function ya(i){va.call(this,i,"gpos")}function B0(i){va.call(this,i,"gsub")}function s_(i,e){var t=i.length;if(t!==e.length)return!1;for(var n=0;n<t;n++)if(i[n]!==e[n])return!1;return!0}function g4(i,e,t){for(var n=i.subtables,s=0;s<n.length;s++){var r=n[s];if(r.substFormat===e)return r}if(t)return n.push(t),t}function Yh(i){for(var e=new ArrayBuffer(i.length),t=new Uint8Array(e),n=0;n<i.length;++n)t[n]=i[n];return e}function xa(i,e){if(!i)throw e}function qh(i,e,t,n,s){var r;return(e&n)>0?(r=i.parseByte(),0===(e&s)&&(r=-r),r=t+r):r=(e&s)>0?t:t+i.parseShort(),r}function Zh(i,e,t){var s,r,n=new Pe.Parser(e,t);if(i.numberOfContours=n.parseShort(),i._xMin=n.parseShort(),i._yMin=n.parseShort(),i._xMax=n.parseShort(),i._yMax=n.parseShort(),i.numberOfContours>0){for(var a=i.endPointIndices=[],o=0;o<i.numberOfContours;o+=1)a.push(n.parseUShort());i.instructionLength=n.parseUShort(),i.instructions=[];for(var l=0;l<i.instructionLength;l+=1)i.instructions.push(n.parseByte());var c=a[a.length-1]+1;s=[];for(var u=0;u<c;u+=1)if(r=n.parseByte(),s.push(r),(8&r)>0)for(var f=n.parseByte(),d=0;d<f;d+=1)s.push(r),u+=1;if(Ze.argument(s.length===c,"Bad flags."),a.length>0){var m,p=[];if(c>0){for(var y=0;y<c;y+=1)(m={}).onCurve=!!(1&(r=s[y])),m.lastPointOfContour=a.indexOf(y)>=0,p.push(m);for(var v=0,g=0;g<c;g+=1)(m=p[g]).x=qh(n,r=s[g],v,2,16),v=m.x;for(var _=0,x=0;x<c;x+=1)(m=p[x]).y=qh(n,r=s[x],_,4,32),_=m.y}i.points=p}else i.points=[]}else if(0===i.numberOfContours)i.points=[];else{i.isComposite=!0,i.points=[],i.components=[];for(var b=!0;b;){s=n.parseUShort();var T={glyphIndex:n.parseUShort(),xScale:1,scale01:0,scale10:0,yScale:1,dx:0,dy:0};(1&s)>0?(2&s)>0?(T.dx=n.parseShort(),T.dy=n.parseShort()):T.matchedPoints=[n.parseUShort(),n.parseUShort()]:(2&s)>0?(T.dx=n.parseChar(),T.dy=n.parseChar()):T.matchedPoints=[n.parseByte(),n.parseByte()],(8&s)>0?T.xScale=T.yScale=n.parseF2Dot14():(64&s)>0?(T.xScale=n.parseF2Dot14(),T.yScale=n.parseF2Dot14()):(128&s)>0&&(T.xScale=n.parseF2Dot14(),T.scale01=n.parseF2Dot14(),T.scale10=n.parseF2Dot14(),T.yScale=n.parseF2Dot14()),i.components.push(T),b=!!(32&s)}if(256&s){i.instructionLength=n.parseUShort(),i.instructions=[];for(var E=0;E<i.instructionLength;E+=1)i.instructions.push(n.parseByte())}}}function v4(i,e){for(var t=[],n=0;n<i.length;n+=1){var s=i[n];t.push({x:e.xScale*s.x+e.scale01*s.y+e.dx,y:e.scale10*s.x+e.yScale*s.y+e.dy,onCurve:s.onCurve,lastPointOfContour:s.lastPointOfContour})}return t}function Jh(i){var e=new Qt;if(!i)return e;for(var t=function o_(i){for(var e=[],t=[],n=0;n<i.length;n+=1){var s=i[n];t.push(s),s.lastPointOfContour&&(e.push(t),t=[])}return Ze.argument(0===t.length,"There are still points left in the current contour."),e}(i),n=0;n<t.length;++n){var s=t[n],a=s[s.length-1],o=s[0];if(a.onCurve)e.moveTo(a.x,a.y);else if(o.onCurve)e.moveTo(o.x,o.y);else{var l={x:.5*(a.x+o.x),y:.5*(a.y+o.y)};e.moveTo(l.x,l.y)}for(var c=0;c<s.length;++c)if(a=o,o=s[(c+1)%s.length],a.onCurve)e.lineTo(a.x,a.y);else{var f=o;o.onCurve||(f={x:.5*(a.x+o.x),y:.5*(a.y+o.y)}),e.quadraticCurveTo(a.x,a.y,f.x,f.y)}e.closePath()}return e}function Kh(i,e){if(e.isComposite)for(var t=0;t<e.components.length;t+=1){var n=e.components[t],s=i.get(n.glyphIndex);if(s.getPath(),s.points){var r=void 0;if(void 0===n.matchedPoints)r=v4(s.points,n);else{if(n.matchedPoints[0]>e.points.length-1||n.matchedPoints[1]>s.points.length-1)throw Error("Matched points out of range in "+e.name);var a=e.points[n.matchedPoints[0]],o=s.points[n.matchedPoints[1]],l={xScale:n.xScale,scale01:n.scale01,scale10:n.scale10,yScale:n.yScale,dx:0,dy:0};o=v4([o],l)[0],l.dx=a.x-o.x,l.dy=a.y-o.y,r=v4(s.points,l)}e.points=e.points.concat(r)}}return Jh(e.points)}va.prototype={searchTag:m4,binSearch:Wh,getTable:function(i){var e=this.font.tables[this.tableName];return!e&&i&&(e=this.font.tables[this.tableName]=this.createDefaultTable()),e},getScriptNames:function(){var i=this.getTable();return i?i.scripts.map(function(e){return e.tag}):[]},getDefaultScriptName:function(){var i=this.getTable();if(i){for(var e=!1,t=0;t<i.scripts.length;t++){var n=i.scripts[t].tag;if("DFLT"===n)return n;"latn"===n&&(e=!0)}if(e)return"latn"}},getScriptTable:function(i,e){var t=this.getTable(e);if(t){var n=t.scripts,s=m4(t.scripts,i=i||"DFLT");if(s>=0)return n[s].script;if(e){var r={tag:i,script:{defaultLangSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]},langSysRecords:[]}};return n.splice(-1-s,0,r),r.script}}},getLangSysTable:function(i,e,t){var n=this.getScriptTable(i,t);if(n){if(!e||"dflt"===e||"DFLT"===e)return n.defaultLangSys;var s=m4(n.langSysRecords,e);if(s>=0)return n.langSysRecords[s].langSys;if(t){var r={tag:e,langSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]}};return n.langSysRecords.splice(-1-s,0,r),r.langSys}}},getFeatureTable:function(i,e,t,n){var s=this.getLangSysTable(i,e,n);if(s){for(var r,a=s.featureIndexes,o=this.font.tables[this.tableName].features,l=0;l<a.length;l++)if((r=o[a[l]]).tag===t)return r.feature;if(n){var c=o.length;return Ze.assert(0===c||t>=o[c-1].tag,"Features must be added in alphabetical order."),o.push(r={tag:t,feature:{params:0,lookupListIndexes:[]}}),a.push(c),r.feature}}},getLookupTables:function(i,e,t,n,s){var r=this.getFeatureTable(i,e,t,s),a=[];if(r){for(var o,l=r.lookupListIndexes,c=this.font.tables[this.tableName].lookups,u=0;u<l.length;u++)(o=c[l[u]]).lookupType===n&&a.push(o);if(0===a.length&&s){var f=c.length;return c.push(o={lookupType:n,lookupFlag:0,subtables:[],markFilteringSet:void 0}),l.push(f),[o]}}return a},getGlyphClass:function(i,e){switch(i.format){case 1:return i.startGlyph<=e&&e<i.startGlyph+i.classes.length?i.classes[e-i.startGlyph]:0;case 2:var t=Xh(i.ranges,e);return t?t.classId:0}},getCoverageIndex:function(i,e){switch(i.format){case 1:var t=Wh(i.glyphs,e);return t>=0?t:-1;case 2:var n=Xh(i.ranges,e);return n?n.index+e-n.start:-1}},expandCoverage:function(i){if(1===i.format)return i.glyphs;for(var e=[],t=i.ranges,n=0;n<t.length;n++)for(var s=t[n],a=s.end,o=s.start;o<=a;o++)e.push(o);return e}},(ya.prototype=va.prototype).init=function(){var i=this.getDefaultScriptName();this.defaultKerningTables=this.getKerningTables(i)},ya.prototype.getKerningValue=function(i,e,t){for(var n=0;n<i.length;n++)for(var s=i[n].subtables,r=0;r<s.length;r++){var a=s[r],o=this.getCoverageIndex(a.coverage,e);if(!(o<0))switch(a.posFormat){case 1:for(var l=a.pairSets[o],c=0;c<l.length;c++){var u=l[c];if(u.secondGlyph===t)return u.value1&&u.value1.xAdvance||0}break;case 2:var f=this.getGlyphClass(a.classDef1,e),d=this.getGlyphClass(a.classDef2,t),p=a.classRecords[f][d];return p.value1&&p.value1.xAdvance||0}}return 0},ya.prototype.getKerningTables=function(i,e){if(this.font.tables.gpos)return this.getLookupTables(i,e,"kern",2)},(B0.prototype=va.prototype).createDefaultTable=function(){return{version:1,scripts:[{tag:"DFLT",script:{defaultLangSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]},langSysRecords:[]}}],features:[],lookups:[]}},B0.prototype.getSingle=function(i,e,t){for(var n=[],s=this.getLookupTables(e,t,i,1),r=0;r<s.length;r++)for(var a=s[r].subtables,o=0;o<a.length;o++){var l=a[o],c=this.expandCoverage(l.coverage),u=void 0;if(1===l.substFormat){var f=l.deltaGlyphId;for(u=0;u<c.length;u++){var d=c[u];n.push({sub:d,by:d+f})}}else{var p=l.substitute;for(u=0;u<c.length;u++)n.push({sub:c[u],by:p[u]})}}return n},B0.prototype.getMultiple=function(i,e,t){for(var n=[],s=this.getLookupTables(e,t,i,2),r=0;r<s.length;r++)for(var a=s[r].subtables,o=0;o<a.length;o++){var l=a[o],c=this.expandCoverage(l.coverage),u=void 0;for(u=0;u<c.length;u++)n.push({sub:c[u],by:l.sequences[u]})}return n},B0.prototype.getAlternates=function(i,e,t){for(var n=[],s=this.getLookupTables(e,t,i,3),r=0;r<s.length;r++)for(var a=s[r].subtables,o=0;o<a.length;o++)for(var l=a[o],c=this.expandCoverage(l.coverage),u=l.alternateSets,f=0;f<c.length;f++)n.push({sub:c[f],by:u[f]});return n},B0.prototype.getLigatures=function(i,e,t){for(var n=[],s=this.getLookupTables(e,t,i,4),r=0;r<s.length;r++)for(var a=s[r].subtables,o=0;o<a.length;o++)for(var l=a[o],c=this.expandCoverage(l.coverage),u=l.ligatureSets,f=0;f<c.length;f++)for(var d=c[f],p=u[f],m=0;m<p.length;m++){var y=p[m];n.push({sub:[d].concat(y.components),by:y.ligGlyph})}return n},B0.prototype.addSingle=function(i,e,t,n){var r=g4(this.getLookupTables(t,n,i,1,!0)[0],2,{substFormat:2,coverage:{format:1,glyphs:[]},substitute:[]});Ze.assert(1===r.coverage.format,"Single: unable to modify coverage table format "+r.coverage.format);var a=e.sub,o=this.binSearch(r.coverage.glyphs,a);o<0&&(r.coverage.glyphs.splice(o=-1-o,0,a),r.substitute.splice(o,0,0)),r.substitute[o]=e.by},B0.prototype.addMultiple=function(i,e,t,n){Ze.assert(e.by instanceof Array&&e.by.length>1,'Multiple: "by" must be an array of two or more ids');var r=g4(this.getLookupTables(t,n,i,2,!0)[0],1,{substFormat:1,coverage:{format:1,glyphs:[]},sequences:[]});Ze.assert(1===r.coverage.format,"Multiple: unable to modify coverage table format "+r.coverage.format);var a=e.sub,o=this.binSearch(r.coverage.glyphs,a);o<0&&(r.coverage.glyphs.splice(o=-1-o,0,a),r.sequences.splice(o,0,0)),r.sequences[o]=e.by},B0.prototype.addAlternate=function(i,e,t,n){var r=g4(this.getLookupTables(t,n,i,3,!0)[0],1,{substFormat:1,coverage:{format:1,glyphs:[]},alternateSets:[]});Ze.assert(1===r.coverage.format,"Alternate: unable to modify coverage table format "+r.coverage.format);var a=e.sub,o=this.binSearch(r.coverage.glyphs,a);o<0&&(r.coverage.glyphs.splice(o=-1-o,0,a),r.alternateSets.splice(o,0,0)),r.alternateSets[o]=e.by},B0.prototype.addLigature=function(i,e,t,n){var s=this.getLookupTables(t,n,i,4,!0)[0],r=s.subtables[0];r||(s.subtables[0]=r={substFormat:1,coverage:{format:1,glyphs:[]},ligatureSets:[]}),Ze.assert(1===r.coverage.format,"Ligature: unable to modify coverage table format "+r.coverage.format);var a=e.sub[0],o=e.sub.slice(1),l={ligGlyph:e.by,components:o},c=this.binSearch(r.coverage.glyphs,a);if(c>=0){for(var u=r.ligatureSets[c],f=0;f<u.length;f++)if(s_(u[f].components,o))return;u.push(l)}else r.coverage.glyphs.splice(c=-1-c,0,a),r.ligatureSets.splice(c,0,[l])},B0.prototype.getFeature=function(i,e,t){if(/ss\d\d/.test(i))return this.getSingle(i,e,t);switch(i){case"aalt":case"salt":return this.getSingle(i,e,t).concat(this.getAlternates(i,e,t));case"dlig":case"liga":case"rlig":return this.getLigatures(i,e,t);case"ccmp":return this.getMultiple(i,e,t).concat(this.getLigatures(i,e,t));case"stch":return this.getMultiple(i,e,t)}},B0.prototype.add=function(i,e,t,n){if(/ss\d\d/.test(i))return this.addSingle(i,e,t,n);switch(i){case"aalt":case"salt":return"number"==typeof e.by?this.addSingle(i,e,t,n):this.addAlternate(i,e,t,n);case"dlig":case"liga":case"rlig":return this.addLigature(i,e,t,n);case"ccmp":return e.by instanceof Array?this.addMultiple(i,e,t,n):this.addLigature(i,e,t,n)}};var Qh,cs,jh,y4,$h={getPath:Jh,parse:function h_(i,e,t,n,s){return s.lowMemory?function c_(i,e,t,n){var s=new wn.GlyphSet(n);return n._push=function(r){var a=t[r];s.push(r,a!==t[r+1]?wn.ttfGlyphLoader(n,r,Zh,i,e+a,Kh):wn.glyphLoader(n,r))},s}(i,e,t,n):function l_(i,e,t,n){for(var s=new wn.GlyphSet(n),r=0;r<t.length-1;r+=1){var a=t[r];s.push(r,a!==t[r+1]?wn.ttfGlyphLoader(n,r,Zh,i,e+a,Kh):wn.glyphLoader(n,r))}return s}(i,e,t,n)}};function eu(i){this.font=i,this.getCommands=function(e){return $h.getPath(e).commands},this._fpgmState=this._prepState=void 0,this._errorState=0}function u_(i){return i}function tu(i){return Math.sign(i)*Math.round(Math.abs(i))}function f_(i){return Math.sign(i)*Math.round(Math.abs(2*i))/2}function d_(i){return Math.sign(i)*(Math.round(Math.abs(i)+.5)-.5)}function p_(i){return Math.sign(i)*Math.ceil(Math.abs(i))}function m_(i){return Math.sign(i)*Math.floor(Math.abs(i))}var nu=function(i){var e=this.srPeriod,t=this.srPhase,s=1;return i<0&&(i=-i,s=-1),i+=this.srThreshold-t,i=Math.trunc(i/e)*e,(i+=t)<0?t*s:i*s},An={x:1,y:0,axis:"x",distance:function(i,e,t,n){return(t?i.xo:i.x)-(n?e.xo:e.x)},interpolate:function(i,e,t,n){var s,r,a,o,l,c,u;if(!n||n===this)return s=i.xo-e.xo,r=i.xo-t.xo,l=e.x-e.xo,c=t.x-t.xo,0===(u=(a=Math.abs(s))+(o=Math.abs(r)))?void(i.x=i.xo+(l+c)/2):void(i.x=i.xo+(l*o+c*a)/u);s=n.distance(i,e,!0,!0),r=n.distance(i,t,!0,!0),l=n.distance(e,e,!1,!0),c=n.distance(t,t,!1,!0),0!==(u=(a=Math.abs(s))+(o=Math.abs(r)))?An.setRelative(i,i,(l*o+c*a)/u,n,!0):An.setRelative(i,i,(l+c)/2,n,!0)},normalSlope:Number.NEGATIVE_INFINITY,setRelative:function(i,e,t,n,s){i.x=n&&n!==this?(s?e.xo:e.x)+t*n.x+(i.y-((s?e.yo:e.y)+t*n.y))/n.normalSlope:(s?e.xo:e.x)+t},slope:0,touch:function(i){i.xTouched=!0},touched:function(i){return i.xTouched},untouch:function(i){i.xTouched=!1}},qn={x:0,y:1,axis:"y",distance:function(i,e,t,n){return(t?i.yo:i.y)-(n?e.yo:e.y)},interpolate:function(i,e,t,n){var s,r,a,o,l,c,u;if(!n||n===this)return s=i.yo-e.yo,r=i.yo-t.yo,l=e.y-e.yo,c=t.y-t.yo,0===(u=(a=Math.abs(s))+(o=Math.abs(r)))?void(i.y=i.yo+(l+c)/2):void(i.y=i.yo+(l*o+c*a)/u);s=n.distance(i,e,!0,!0),r=n.distance(i,t,!0,!0),l=n.distance(e,e,!1,!0),c=n.distance(t,t,!1,!0),0!==(u=(a=Math.abs(s))+(o=Math.abs(r)))?qn.setRelative(i,i,(l*o+c*a)/u,n,!0):qn.setRelative(i,i,(l+c)/2,n,!0)},normalSlope:0,setRelative:function(i,e,t,n,s){i.y=n&&n!==this?(s?e.yo:e.y)+t*n.y+n.normalSlope*(i.x-((s?e.xo:e.x)+t*n.x)):(s?e.yo:e.y)+t},slope:Number.POSITIVE_INFINITY,touch:function(i){i.yTouched=!0},touched:function(i){return i.yTouched},untouch:function(i){i.yTouched=!1}};function _a(i,e){this.x=i,this.y=e,this.axis=void 0,this.slope=e/i,this.normalSlope=-i/e,Object.freeze(this)}function ba(i,e){var t=Math.sqrt(i*i+e*e);return e/=t,1===(i/=t)&&0===e?An:0===i&&1===e?qn:new _a(i,e)}function Zn(i,e,t,n){this.x=this.xo=Math.round(64*i)/64,this.y=this.yo=Math.round(64*e)/64,this.lastPointOfContour=t,this.onCurve=n,this.prevPointOnContour=void 0,this.nextPointOnContour=void 0,this.xTouched=!1,this.yTouched=!1,Object.preventExtensions(this)}Object.freeze(An),Object.freeze(qn),_a.prototype.distance=function(i,e,t,n){return this.x*An.distance(i,e,t,n)+this.y*qn.distance(i,e,t,n)},_a.prototype.interpolate=function(i,e,t,n){var s,r,a,o,l,c,u;a=n.distance(i,e,!0,!0),o=n.distance(i,t,!0,!0),s=n.distance(e,e,!1,!0),r=n.distance(t,t,!1,!0),0!==(u=(l=Math.abs(a))+(c=Math.abs(o)))?this.setRelative(i,i,(s*c+r*l)/u,n,!0):this.setRelative(i,i,(s+r)/2,n,!0)},_a.prototype.setRelative=function(i,e,t,n,s){var c=(n=n||this).normalSlope,u=this.slope,f=i.x,d=i.y;i.x=(u*f-c*((s?e.xo:e.x)+t*n.x)+((s?e.yo:e.y)+t*n.y)-d)/(u-c),i.y=u*(i.x-f)+d},_a.prototype.touch=function(i){i.xTouched=!0,i.yTouched=!0},Zn.prototype.nextTouched=function(i){for(var e=this.nextPointOnContour;!i.touched(e)&&e!==this;)e=e.nextPointOnContour;return e},Zn.prototype.prevTouched=function(i){for(var e=this.prevPointOnContour;!i.touched(e)&&e!==this;)e=e.prevPointOnContour;return e};var Sa=Object.freeze(new Zn(0,0)),g_={cvCutIn:17/16,deltaBase:9,deltaShift:.125,loop:1,minDis:1,autoFlip:!0};function Ei(i,e){switch(this.env=i,this.stack=[],this.prog=e,i){case"glyf":this.zp0=this.zp1=this.zp2=1,this.rp0=this.rp1=this.rp2=0;case"prep":this.fv=this.pv=this.dpv=An,this.round=tu}}function A1(i){for(var e=i.tZone=new Array(i.gZone.length),t=0;t<e.length;t++)e[t]=new Zn(0,0)}function iu(i,e){var r,t=i.prog,n=i.ip,s=1;do{if(88===(r=t[++n]))s++;else if(89===r)s--;else if(64===r)n+=t[n+1]+1;else if(65===r)n+=2*t[n+1]+1;else if(r>=176&&r<=183)n+=r-176+1;else if(r>=184&&r<=191)n+=2*(r-184+1);else if(e&&1===s&&27===r)break}while(s>0);i.ip=n}function su(i,e){exports.DEBUG&&console.log(e.step,"SVTCA["+i.axis+"]"),e.fv=e.pv=e.dpv=i}function ru(i,e){exports.DEBUG&&console.log(e.step,"SPVTCA["+i.axis+"]"),e.pv=e.dpv=i}function au(i,e){exports.DEBUG&&console.log(e.step,"SFVTCA["+i.axis+"]"),e.fv=i}function ou(i,e){var o,l,t=e.stack,n=t.pop(),s=t.pop(),r=e.z2[n],a=e.z1[s];exports.DEBUG&&console.log("SPVTL["+i+"]",n,s),i?(o=r.y-a.y,l=a.x-r.x):(o=a.x-r.x,l=a.y-r.y),e.pv=e.dpv=ba(o,l)}function lu(i,e){var o,l,t=e.stack,n=t.pop(),s=t.pop(),r=e.z2[n],a=e.z1[s];exports.DEBUG&&console.log("SFVTL["+i+"]",n,s),i?(o=r.y-a.y,l=a.x-r.x):(o=a.x-r.x,l=a.y-r.y),e.fv=ba(o,l)}function x4(i){exports.DEBUG&&console.log(i.step,"POP[]"),i.stack.pop()}function cu(i,e){var t=e.stack.pop(),n=e.z0[t],s=e.fv,r=e.pv;exports.DEBUG&&console.log(e.step,"MDAP["+i+"]",t);var a=r.distance(n,Sa);i&&(a=e.round(a)),s.setRelative(n,Sa,a,r),s.touch(n),e.rp0=e.rp1=t}function hu(i,e){var s,r,a,t=e.z2,n=t.length-2;exports.DEBUG&&console.log(e.step,"IUP["+i.axis+"]");for(var o=0;o<n;o++)!i.touched(s=t[o])&&(r=s.prevTouched(i))!==s&&(r===(a=s.nextTouched(i))&&i.setRelative(s,s,i.distance(r,r,!1,!0),i,!0),i.interpolate(s,r,a,i))}function uu(i,e){for(var t=e.stack,s=(i?e.z0:e.z1)[i?e.rp1:e.rp2],r=e.fv,a=e.pv,o=e.loop,l=e.z2;o--;){var c=t.pop(),u=l[c],f=a.distance(s,s,!1,!0);r.setRelative(u,u,f,a),r.touch(u),exports.DEBUG&&console.log(e.step,(e.loop>1?"loop "+(e.loop-o)+": ":"")+"SHP["+(i?"rp1":"rp2")+"]",c)}e.loop=1}function fu(i,e){var s=(i?e.z0:e.z1)[i?e.rp1:e.rp2],r=e.fv,a=e.pv,o=e.stack.pop(),l=e.z2[e.contours[o]],c=l;exports.DEBUG&&console.log(e.step,"SHC["+i+"]",o);var u=a.distance(s,s,!1,!0);do{c!==s&&r.setRelative(c,c,u,a),c=c.nextPointOnContour}while(c!==l)}function du(i,e){var l,s=(i?e.z0:e.z1)[i?e.rp1:e.rp2],r=e.fv,a=e.pv,o=e.stack.pop();switch(exports.DEBUG&&console.log(e.step,"SHZ["+i+"]",o),o){case 0:l=e.tZone;break;case 1:l=e.gZone;break;default:throw new Error("Invalid zone")}for(var c,u=a.distance(s,s,!1,!0),f=l.length-2,d=0;d<f;d++)r.setRelative(c=l[d],c,u,a)}function pu(i,e){var t=e.stack,n=t.pop()/64,s=t.pop(),r=e.z1[s],o=e.fv;o.setRelative(r,e.z0[e.rp0],n,e.pv),o.touch(r),exports.DEBUG&&console.log(e.step,"MSIRP["+i+"]",n,s),e.rp1=e.rp0,e.rp2=s,i&&(e.rp0=s)}function mu(i,e){var t=e.stack,n=t.pop(),s=t.pop(),r=e.z0[s],a=e.fv,o=e.pv,l=e.cvt[n];exports.DEBUG&&console.log(e.step,"MIAP["+i+"]",n,"(",l,")",s);var c=o.distance(r,Sa);i&&(Math.abs(c-l)<e.cvCutIn&&(c=l),c=e.round(c)),a.setRelative(r,Sa,c,o),0===e.zp0&&(r.xo=r.x,r.yo=r.y),a.touch(r),e.rp0=e.rp1=s}function gu(i,e){var t=e.stack,n=t.pop(),s=e.z2[n];exports.DEBUG&&console.log(e.step,"GC["+i+"]",n),t.push(64*e.dpv.distance(s,Sa,i,!1))}function vu(i,e){var t=e.stack,n=t.pop(),s=t.pop(),o=e.dpv.distance(e.z0[s],e.z1[n],i,i);exports.DEBUG&&console.log(e.step,"MD["+i+"]",n,s,"->",o),e.stack.push(Math.round(64*o))}function _4(i,e){var t=e.stack,n=t.pop(),s=e.fv,r=e.pv,a=e.ppem,o=e.deltaBase+16*(i-1),l=e.deltaShift,c=e.z0;exports.DEBUG&&console.log(e.step,"DELTAP["+i+"]",n,t);for(var u=0;u<n;u++){var f=t.pop(),d=t.pop();if(o+((240&d)>>4)===a){var m=(15&d)-8;m>=0&&m++,exports.DEBUG&&console.log(e.step,"DELTAPFIX",f,"by",m*l);var y=c[f];s.setRelative(y,y,m*l,r)}}}function C1(i,e){var t=e.stack,n=t.pop();exports.DEBUG&&console.log(e.step,"ROUND[]"),t.push(64*e.round(n/64))}function b4(i,e){var t=e.stack,n=t.pop(),s=e.ppem,r=e.deltaBase+16*(i-1),a=e.deltaShift;exports.DEBUG&&console.log(e.step,"DELTAC["+i+"]",n,t);for(var o=0;o<n;o++){var l=t.pop(),c=t.pop();if(r+((240&c)>>4)===s){var f=(15&c)-8;f>=0&&f++;var d=f*a;exports.DEBUG&&console.log(e.step,"DELTACFIX",l,"by",d),e.cvt[l]+=d}}}function yu(i,e){var o,l,t=e.stack,n=t.pop(),s=t.pop(),r=e.z2[n],a=e.z1[s];exports.DEBUG&&console.log(e.step,"SDPVTL["+i+"]",n,s),i?(o=r.y-a.y,l=a.x-r.x):(o=a.x-r.x,l=a.y-r.y),e.dpv=ba(o,l)}function Ti(i,e){var t=e.stack,n=e.prog,s=e.ip;exports.DEBUG&&console.log(e.step,"PUSHB["+i+"]");for(var r=0;r<i;r++)t.push(n[++s]);e.ip=s}function wi(i,e){var t=e.ip,n=e.prog,s=e.stack;exports.DEBUG&&console.log(e.ip,"PUSHW["+i+"]");for(var r=0;r<i;r++){var a=n[++t]<<8|n[++t];32768&a&&(a=-(1+(65535^a))),s.push(a)}e.ip=t}function Re(i,e,t,n,s,r){var y,v,g,_,a=r.stack,o=i&&a.pop(),l=a.pop(),u=r.z0[r.rp0],f=r.z1[l],d=r.minDis,p=r.fv,m=r.dpv;g=(v=y=m.distance(f,u,!0,!0))>=0?1:-1,v=Math.abs(v),i&&(_=r.cvt[o],n&&Math.abs(v-_)<r.cvCutIn&&(v=_)),t&&v<d&&(v=d),n&&(v=r.round(v)),p.setRelative(f,u,g*v,m),p.touch(f),exports.DEBUG&&console.log(r.step,(i?"MIRP[":"MDRP[")+(e?"M":"m")+(t?">":"_")+(n?"R":"_")+(0===s?"Gr":1===s?"Bl":2===s?"Wh":"")+"]",i?o+"("+r.cvt[o]+","+_+")":"",l,"(d =",y,"->",g*v,")"),r.rp1=r.rp0,r.rp2=l,e&&(r.rp0=l)}function vr(i){this.char=i,this.state={},this.activeState=null}function S4(i,e,t){this.contextName=t,this.startIndex=i,this.endOffset=e}function Gb(i,e,t){this.contextName=i,this.openRange=null,this.ranges=[],this.checkStart=e,this.checkEnd=t}function cn(i,e){this.context=i,this.index=e,this.length=i.length,this.current=i[e],this.backtrack=i.slice(0,e),this.lookahead=i.slice(e+1)}function P1(i){this.eventId=i,this.subscribers=[]}function zb(i){var e=this,t=["start","end","next","newToken","contextStart","contextEnd","insertToken","removeToken","removeRange","replaceToken","replaceRange","composeRUD","updateContextsRanges"];t.forEach(function(s){Object.defineProperty(e.events,s,{value:new P1(s)})}),i&&t.forEach(function(s){var r=i[s];"function"==typeof r&&e.events[s].subscribe(r)}),["insertToken","removeToken","removeRange","replaceToken","replaceRange","composeRUD"].forEach(function(s){e.events[s].subscribe(e.updateContextsRanges)})}function zt(i){this.tokens=[],this.registeredContexts={},this.contextCheckers=[],this.events={},this.registeredModifiers=[],zb.call(this,i)}function Ai(i){return/[\u0600-\u065F\u066A-\u06D2\u06FA-\u06FF]/.test(i)}function xu(i){return/[\u0630\u0690\u0621\u0631\u0661\u0671\u0622\u0632\u0672\u0692\u06C2\u0623\u0673\u0693\u06C3\u0624\u0694\u06C4\u0625\u0675\u0695\u06C5\u06E5\u0676\u0696\u06C6\u0627\u0677\u0697\u06C7\u0648\u0688\u0698\u06C8\u0689\u0699\u06C9\u068A\u06CA\u066B\u068B\u06CB\u068C\u068D\u06CD\u06FD\u068E\u06EE\u06FE\u062F\u068F\u06CF\u06EF]/.test(i)}function Ci(i){return/[\u0600-\u0605\u060C-\u060E\u0610-\u061B\u061E\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED]/.test(i)}function R1(i){return/[A-z]/.test(i)}function G0(i){this.font=i,this.features={}}function hs(i){this.id=i.id,this.tag=i.tag,this.substitution=i.substitution}function Ma(i,e){if(!i)return-1;switch(e.format){case 1:return e.glyphs.indexOf(i);case 2:for(var t=e.ranges,n=0;n<t.length;n++){var s=t[n];if(i>=s.start&&i<=s.end)return s.index+(i-s.start)}break;default:return-1}return-1}function Vb(i,e){return-1===Ma(i,e.coverage)?null:i+e.deltaGlyphId}function Wb(i,e){var t=Ma(i,e.coverage);return-1===t?null:e.substitute[t]}function M4(i,e){for(var t=[],n=0;n<i.length;n++){var s=i[n],r=e.current,a=Ma(r=Array.isArray(r)?r[0]:r,s);-1!==a&&t.push(a)}return t.length!==i.length?-1:t}function Xb(i,e){if(i.context.length<e.inputCoverage.length+e.lookaheadCoverage.length+e.backtrackCoverage.length)return[];var n=M4(e.inputCoverage,i);if(-1===n)return[];if(i.lookahead.length<e.lookaheadCoverage.length)return[];for(var r=i.lookahead.slice(e.inputCoverage.length-1);r.length&&Ci(r[0].char);)r.shift();var a=new cn(r,0),o=M4(e.lookaheadCoverage,a),l=[].concat(i.backtrack);for(l.reverse();l.length&&Ci(l[0].char);)l.shift();if(l.length<e.backtrackCoverage.length)return[];var c=new cn(l,0),u=M4(e.backtrackCoverage,c),d=[];if(n.length===e.inputCoverage.length&&o.length===e.lookaheadCoverage.length&&u.length===e.backtrackCoverage.length)for(var p=0;p<e.lookupRecords.length;p++)for(var v=this.getLookupByIndex(e.lookupRecords[p].lookupListIndex),g=0;g<v.subtables.length;g++){var _=v.subtables[g],x=this.getLookupMethod(v,_);if("12"===this.getSubstitutionType(v,_))for(var T=0;T<n.length;T++){var M=x(i.get(T));M&&d.push(M)}}return d}function Yb(i,e){var n=Ma(i.current,e.coverage);if(-1===n)return null;for(var s,r=e.ligatureSets[n],a=0;a<r.length;a++){s=r[a];for(var o=0;o<s.components.length&&i.lookahead[o]===s.components[o];o++)if(o===s.components.length-1)return s}return null}function qb(i,e){var t=Ma(i,e.coverage);return-1===t?null:e.sequences[t]}eu.prototype.exec=function(i,e){if("number"!=typeof e)throw new Error("Point size is not a number!");if(!(this._errorState>2)){var t=this.font,n=this._prepState;if(!n||n.ppem!==e){var s=this._fpgmState;if(!s){Ei.prototype=g_,(s=this._fpgmState=new Ei("fpgm",t.tables.fpgm)).funcs=[],s.font=t,exports.DEBUG&&(console.log("---EXEC FPGM---"),s.step=-1);try{cs(s)}catch(c){return console.log("Hinting error in FPGM:"+c),void(this._errorState=3)}}Ei.prototype=s,(n=this._prepState=new Ei("prep",t.tables.prep)).ppem=e;var r=t.tables.cvt;if(r)for(var a=n.cvt=new Array(r.length),o=e/t.unitsPerEm,l=0;l<r.length;l++)a[l]=r[l]*o;else n.cvt=[];exports.DEBUG&&(console.log("---EXEC PREP---"),n.step=-1);try{cs(n)}catch(c){this._errorState<2&&console.log("Hinting error in PREP:"+c),this._errorState=2}}if(!(this._errorState>1))try{return jh(i,n)}catch(c){return this._errorState<1&&(console.log("Hinting error:"+c),console.log("Note: further hinting errors are silenced")),void(this._errorState=1)}}},jh=function(i,e){var r,a,o,t=e.ppem/e.font.unitsPerEm,n=t,s=i.components;if(Ei.prototype=e,s){var l=e.font;a=[],r=[];for(var c=0;c<s.length;c++){var u=s[c],f=l.glyphs.get(u.glyphIndex);o=new Ei("glyf",f.instructions),exports.DEBUG&&(console.log("---EXEC COMP "+c+"---"),o.step=-1),y4(f,o,t,n);for(var d=Math.round(u.dx*t),p=Math.round(u.dy*n),m=o.gZone,y=o.contours,v=0;v<m.length;v++){var g=m[v];g.xTouched=g.yTouched=!1,g.xo=g.x=g.x+d,g.yo=g.y=g.y+p}var _=a.length;a.push.apply(a,m);for(var x=0;x<y.length;x++)r.push(y[x]+_)}i.instructions&&!o.inhibitGridFit&&((o=new Ei("glyf",i.instructions)).gZone=o.z0=o.z1=o.z2=a,o.contours=r,a.push(new Zn(0,0),new Zn(Math.round(i.advanceWidth*t),0)),exports.DEBUG&&(console.log("---EXEC COMPOSITE---"),o.step=-1),cs(o),a.length-=2)}else o=new Ei("glyf",i.instructions),exports.DEBUG&&(console.log("---EXEC GLYPH---"),o.step=-1),y4(i,o,t,n),a=o.gZone;return a},y4=function(i,e,t,n){for(var l,s=i.points||[],r=s.length,a=e.gZone=e.z0=e.z1=e.z2=[],o=e.contours=[],c=0;c<r;c++)a[c]=new Zn((l=s[c]).x*t,l.y*n,l.lastPointOfContour,l.onCurve);for(var u,f,d=0;d<r;d++)l=a[d],u||(u=l,o.push(d)),l.lastPointOfContour?(l.nextPointOnContour=u,u.prevPointOnContour=l,u=void 0):(l.nextPointOnContour=f=a[d+1],f.prevPointOnContour=l);if(!e.inhibitGridFit){if(exports.DEBUG){console.log("PROCESSING GLYPH",e.stack);for(var p=0;p<r;p++)console.log(p,a[p].x,a[p].y)}if(a.push(new Zn(0,0),new Zn(Math.round(i.advanceWidth*t),0)),cs(e),a.length-=2,exports.DEBUG){console.log("FINISHED GLYPH",e.stack);for(var m=0;m<r;m++)console.log(m,a[m].x,a[m].y)}}},cs=function(i){var e=i.prog;if(e){var n,t=e.length;for(i.ip=0;i.ip<t;i.ip++){if(exports.DEBUG&&i.step++,!(n=Qh[e[i.ip]]))throw new Error("unknown instruction: 0x"+Number(e[i.ip]).toString(16));n(i)}}},Qh=[su.bind(void 0,qn),su.bind(void 0,An),ru.bind(void 0,qn),ru.bind(void 0,An),au.bind(void 0,qn),au.bind(void 0,An),ou.bind(void 0,0),ou.bind(void 0,1),lu.bind(void 0,0),lu.bind(void 0,1),function v_(i){var e=i.stack,t=e.pop(),n=e.pop();exports.DEBUG&&console.log(i.step,"SPVFS[]",t,n),i.pv=i.dpv=ba(n,t)},function y_(i){var e=i.stack,t=e.pop(),n=e.pop();exports.DEBUG&&console.log(i.step,"SPVFS[]",t,n),i.fv=ba(n,t)},function x_(i){var e=i.stack,t=i.pv;exports.DEBUG&&console.log(i.step,"GPV[]"),e.push(16384*t.x),e.push(16384*t.y)},function __(i){var e=i.stack,t=i.fv;exports.DEBUG&&console.log(i.step,"GFV[]"),e.push(16384*t.x),e.push(16384*t.y)},function b_(i){i.fv=i.pv,exports.DEBUG&&console.log(i.step,"SFVTPV[]")},function S_(i){var e=i.stack,t=e.pop(),n=e.pop(),s=e.pop(),r=e.pop(),a=e.pop(),o=i.z0,l=i.z1,c=o[t],u=o[n],f=l[s],d=l[r],p=i.z2[a];exports.DEBUG&&console.log("ISECT[], ",t,n,s,r,a);var m=c.x,y=c.y,v=u.x,g=u.y,_=f.x,x=f.y,b=d.x,T=d.y,E=(m-v)*(x-T)-(y-g)*(_-b),M=m*g-y*v,w=_*T-x*b;p.x=(M*(_-b)-w*(m-v))/E,p.y=(M*(x-T)-w*(y-g))/E},function M_(i){i.rp0=i.stack.pop(),exports.DEBUG&&console.log(i.step,"SRP0[]",i.rp0)},function E_(i){i.rp1=i.stack.pop(),exports.DEBUG&&console.log(i.step,"SRP1[]",i.rp1)},function T_(i){i.rp2=i.stack.pop(),exports.DEBUG&&console.log(i.step,"SRP2[]",i.rp2)},function w_(i){var e=i.stack.pop();switch(exports.DEBUG&&console.log(i.step,"SZP0[]",e),i.zp0=e,e){case 0:i.tZone||A1(i),i.z0=i.tZone;break;case 1:i.z0=i.gZone;break;default:throw new Error("Invalid zone pointer")}},function A_(i){var e=i.stack.pop();switch(exports.DEBUG&&console.log(i.step,"SZP1[]",e),i.zp1=e,e){case 0:i.tZone||A1(i),i.z1=i.tZone;break;case 1:i.z1=i.gZone;break;default:throw new Error("Invalid zone pointer")}},function C_(i){var e=i.stack.pop();switch(exports.DEBUG&&console.log(i.step,"SZP2[]",e),i.zp2=e,e){case 0:i.tZone||A1(i),i.z2=i.tZone;break;case 1:i.z2=i.gZone;break;default:throw new Error("Invalid zone pointer")}},function P_(i){var e=i.stack.pop();switch(exports.DEBUG&&console.log(i.step,"SZPS[]",e),i.zp0=i.zp1=i.zp2=e,e){case 0:i.tZone||A1(i),i.z0=i.z1=i.z2=i.tZone;break;case 1:i.z0=i.z1=i.z2=i.gZone;break;default:throw new Error("Invalid zone pointer")}},function R_(i){i.loop=i.stack.pop(),exports.DEBUG&&console.log(i.step,"SLOOP[]",i.loop)},function L_(i){exports.DEBUG&&console.log(i.step,"RTG[]"),i.round=tu},function I_(i){exports.DEBUG&&console.log(i.step,"RTHG[]"),i.round=d_},function D_(i){var e=i.stack.pop();exports.DEBUG&&console.log(i.step,"SMD[]",e),i.minDis=e/64},function F_(i){exports.DEBUG&&console.log(i.step,"ELSE[]"),iu(i,!1)},function O_(i){var e=i.stack.pop();exports.DEBUG&&console.log(i.step,"JMPR[]",e),i.ip+=e-1},function N_(i){var e=i.stack.pop();exports.DEBUG&&console.log(i.step,"SCVTCI[]",e),i.cvCutIn=e/64},void 0,void 0,function k_(i){var e=i.stack;exports.DEBUG&&console.log(i.step,"DUP[]"),e.push(e[e.length-1])},x4,function U_(i){exports.DEBUG&&console.log(i.step,"CLEAR[]"),i.stack.length=0},function B_(i){var e=i.stack,t=e.pop(),n=e.pop();exports.DEBUG&&console.log(i.step,"SWAP[]"),e.push(t),e.push(n)},function G_(i){var e=i.stack;exports.DEBUG&&console.log(i.step,"DEPTH[]"),e.push(e.length)},function V_(i){var e=i.stack,t=e.pop();exports.DEBUG&&console.log(i.step,"CINDEX[]",t),e.push(e[e.length-t])},function W_(i){var e=i.stack,t=e.pop();exports.DEBUG&&console.log(i.step,"MINDEX[]",t),e.push(e.splice(e.length-t,1)[0])},void 0,void 0,void 0,function z_(i){var e=i.stack,t=e.pop(),n=e.pop();exports.DEBUG&&console.log(i.step,"LOOPCALL[]",t,n);var s=i.ip,r=i.prog;i.prog=i.funcs[t];for(var a=0;a<n;a++)cs(i),exports.DEBUG&&console.log(++i.step,a+1<n?"next loopcall":"done loopcall",a);i.ip=s,i.prog=r},function H_(i){var e=i.stack.pop();exports.DEBUG&&console.log(i.step,"CALL[]",e);var t=i.ip,n=i.prog;i.prog=i.funcs[e],cs(i),i.ip=t,i.prog=n,exports.DEBUG&&console.log(++i.step,"returning from",e)},function X_(i){if("fpgm"!==i.env)throw new Error("FDEF not allowed here");var t=i.prog,n=i.ip,s=i.stack.pop(),r=n;for(exports.DEBUG&&console.log(i.step,"FDEF[]",s);45!==t[++n];);i.ip=n,i.funcs[s]=t.slice(r+1,n)},void 0,cu.bind(void 0,0),cu.bind(void 0,1),hu.bind(void 0,qn),hu.bind(void 0,An),uu.bind(void 0,0),uu.bind(void 0,1),fu.bind(void 0,0),fu.bind(void 0,1),du.bind(void 0,0),du.bind(void 0,1),function Y_(i){for(var e=i.stack,t=i.loop,n=i.fv,s=e.pop()/64,r=i.z2;t--;){var a=e.pop(),o=r[a];exports.DEBUG&&console.log(i.step,(i.loop>1?"loop "+(i.loop-t)+": ":"")+"SHPIX[]",a,s),n.setRelative(o,o,s),n.touch(o)}i.loop=1},function q_(i){for(var e=i.stack,t=i.rp1,n=i.rp2,s=i.loop,r=i.z0[t],a=i.z1[n],o=i.fv,l=i.dpv,c=i.z2;s--;){var u=e.pop(),f=c[u];exports.DEBUG&&console.log(i.step,(i.loop>1?"loop "+(i.loop-s)+": ":"")+"IP[]",u,t,"<->",n),o.interpolate(f,r,a,l),o.touch(f)}i.loop=1},pu.bind(void 0,0),pu.bind(void 0,1),function Z_(i){for(var e=i.stack,n=i.z0[i.rp0],s=i.loop,r=i.fv,a=i.pv,o=i.z1;s--;){var l=e.pop(),c=o[l];exports.DEBUG&&console.log(i.step,(i.loop>1?"loop "+(i.loop-s)+": ":"")+"ALIGNRP[]",l),r.setRelative(c,n,0,a),r.touch(c)}i.loop=1},function J_(i){exports.DEBUG&&console.log(i.step,"RTDG[]"),i.round=f_},mu.bind(void 0,0),mu.bind(void 0,1),function K_(i){var e=i.prog,t=i.ip,n=i.stack,s=e[++t];exports.DEBUG&&console.log(i.step,"NPUSHB[]",s);for(var r=0;r<s;r++)n.push(e[++t]);i.ip=t},function $_(i){var e=i.ip,t=i.prog,n=i.stack,s=t[++e];exports.DEBUG&&console.log(i.step,"NPUSHW[]",s);for(var r=0;r<s;r++){var a=t[++e]<<8|t[++e];32768&a&&(a=-(1+(65535^a))),n.push(a)}i.ip=e},function Q_(i){var e=i.stack,t=i.store;t||(t=i.store=[]);var n=e.pop(),s=e.pop();exports.DEBUG&&console.log(i.step,"WS",n,s),t[s]=n},function j_(i){var e=i.stack,t=i.store,n=e.pop();exports.DEBUG&&console.log(i.step,"RS",n),e.push(t&&t[n]||0)},function eb(i){var e=i.stack,t=e.pop(),n=e.pop();exports.DEBUG&&console.log(i.step,"WCVTP",t,n),i.cvt[n]=t/64},function tb(i){var e=i.stack,t=e.pop();exports.DEBUG&&console.log(i.step,"RCVT",t),e.push(64*i.cvt[t])},gu.bind(void 0,0),gu.bind(void 0,1),void 0,vu.bind(void 0,0),vu.bind(void 0,1),function nb(i){exports.DEBUG&&console.log(i.step,"MPPEM[]"),i.stack.push(i.ppem)},void 0,function ib(i){exports.DEBUG&&console.log(i.step,"FLIPON[]"),i.autoFlip=!0},void 0,void 0,function sb(i){var e=i.stack,t=e.pop(),n=e.pop();exports.DEBUG&&console.log(i.step,"LT[]",t,n),e.push(n<t?1:0)},function rb(i){var e=i.stack,t=e.pop(),n=e.pop();exports.DEBUG&&console.log(i.step,"LTEQ[]",t,n),e.push(n<=t?1:0)},function ab(i){var e=i.stack,t=e.pop(),n=e.pop();exports.DEBUG&&console.log(i.step,"GT[]",t,n),e.push(n>t?1:0)},function ob(i){var e=i.stack,t=e.pop(),n=e.pop();exports.DEBUG&&console.log(i.step,"GTEQ[]",t,n),e.push(n>=t?1:0)},function lb(i){var e=i.stack,t=e.pop(),n=e.pop();exports.DEBUG&&console.log(i.step,"EQ[]",t,n),e.push(t===n?1:0)},function cb(i){var e=i.stack,t=e.pop(),n=e.pop();exports.DEBUG&&console.log(i.step,"NEQ[]",t,n),e.push(t!==n?1:0)},function hb(i){var e=i.stack,t=e.pop();exports.DEBUG&&console.log(i.step,"ODD[]",t),e.push(Math.trunc(t)%2?1:0)},function ub(i){var e=i.stack,t=e.pop();exports.DEBUG&&console.log(i.step,"EVEN[]",t),e.push(Math.trunc(t)%2?0:1)},function fb(i){var e=i.stack.pop();exports.DEBUG&&console.log(i.step,"IF[]",e),e||(iu(i,!0),exports.DEBUG&&console.log(i.step,"EIF[]"))},function db(i){exports.DEBUG&&console.log(i.step,"EIF[]")},function pb(i){var e=i.stack,t=e.pop(),n=e.pop();exports.DEBUG&&console.log(i.step,"AND[]",t,n),e.push(t&&n?1:0)},function mb(i){var e=i.stack,t=e.pop(),n=e.pop();exports.DEBUG&&console.log(i.step,"OR[]",t,n),e.push(t||n?1:0)},function gb(i){var e=i.stack,t=e.pop();exports.DEBUG&&console.log(i.step,"NOT[]",t),e.push(t?0:1)},_4.bind(void 0,1),function vb(i){var t=i.stack.pop();exports.DEBUG&&console.log(i.step,"SDB[]",t),i.deltaBase=t},function yb(i){var t=i.stack.pop();exports.DEBUG&&console.log(i.step,"SDS[]",t),i.deltaShift=Math.pow(.5,t)},function xb(i){var e=i.stack,t=e.pop(),n=e.pop();exports.DEBUG&&console.log(i.step,"ADD[]",t,n),e.push(n+t)},function _b(i){var e=i.stack,t=e.pop(),n=e.pop();exports.DEBUG&&console.log(i.step,"SUB[]",t,n),e.push(n-t)},function bb(i){var e=i.stack,t=e.pop(),n=e.pop();exports.DEBUG&&console.log(i.step,"DIV[]",t,n),e.push(64*n/t)},function Sb(i){var e=i.stack,t=e.pop(),n=e.pop();exports.DEBUG&&console.log(i.step,"MUL[]",t,n),e.push(n*t/64)},function Mb(i){var e=i.stack,t=e.pop();exports.DEBUG&&console.log(i.step,"ABS[]",t),e.push(Math.abs(t))},function Eb(i){var e=i.stack,t=e.pop();exports.DEBUG&&console.log(i.step,"NEG[]",t),e.push(-t)},function Tb(i){var e=i.stack,t=e.pop();exports.DEBUG&&console.log(i.step,"FLOOR[]",t),e.push(64*Math.floor(t/64))},function wb(i){var e=i.stack,t=e.pop();exports.DEBUG&&console.log(i.step,"CEILING[]",t),e.push(64*Math.ceil(t/64))},C1.bind(void 0,0),C1.bind(void 0,1),C1.bind(void 0,2),C1.bind(void 0,3),void 0,void 0,void 0,void 0,function Ab(i){var e=i.stack,t=e.pop(),n=e.pop();exports.DEBUG&&console.log(i.step,"WCVTF[]",t,n),i.cvt[n]=t*i.ppem/i.font.unitsPerEm},_4.bind(void 0,2),_4.bind(void 0,3),b4.bind(void 0,1),b4.bind(void 0,2),b4.bind(void 0,3),function Cb(i){var t,e=i.stack.pop();switch(exports.DEBUG&&console.log(i.step,"SROUND[]",e),i.round=nu,192&e){case 0:t=.5;break;case 64:t=1;break;case 128:t=2;break;default:throw new Error("invalid SROUND value")}switch(i.srPeriod=t,48&e){case 0:i.srPhase=0;break;case 16:i.srPhase=.25*t;break;case 32:i.srPhase=.5*t;break;case 48:i.srPhase=.75*t;break;default:throw new Error("invalid SROUND value")}i.srThreshold=0==(e&=15)?0:(e/8-.5)*t},function Pb(i){var t,e=i.stack.pop();switch(exports.DEBUG&&console.log(i.step,"S45ROUND[]",e),i.round=nu,192&e){case 0:t=Math.sqrt(2)/2;break;case 64:t=Math.sqrt(2);break;case 128:t=2*Math.sqrt(2);break;default:throw new Error("invalid S45ROUND value")}switch(i.srPeriod=t,48&e){case 0:i.srPhase=0;break;case 16:i.srPhase=.25*t;break;case 32:i.srPhase=.5*t;break;case 48:i.srPhase=.75*t;break;default:throw new Error("invalid S45ROUND value")}i.srThreshold=0==(e&=15)?0:(e/8-.5)*t},void 0,void 0,function Rb(i){exports.DEBUG&&console.log(i.step,"ROFF[]"),i.round=u_},void 0,function Lb(i){exports.DEBUG&&console.log(i.step,"RUTG[]"),i.round=p_},function Ib(i){exports.DEBUG&&console.log(i.step,"RDTG[]"),i.round=m_},x4,x4,void 0,void 0,void 0,void 0,void 0,function Db(i){var e=i.stack.pop();exports.DEBUG&&console.log(i.step,"SCANCTRL[]",e)},yu.bind(void 0,0),yu.bind(void 0,1),function Fb(i){var e=i.stack,t=e.pop(),n=0;exports.DEBUG&&console.log(i.step,"GETINFO[]",t),1&t&&(n=35),32&t&&(n|=4096),e.push(n)},void 0,function Ob(i){var e=i.stack,t=e.pop(),n=e.pop(),s=e.pop();exports.DEBUG&&console.log(i.step,"ROLL[]"),e.push(n),e.push(t),e.push(s)},function Nb(i){var e=i.stack,t=e.pop(),n=e.pop();exports.DEBUG&&console.log(i.step,"MAX[]",t,n),e.push(Math.max(n,t))},function kb(i){var e=i.stack,t=e.pop(),n=e.pop();exports.DEBUG&&console.log(i.step,"MIN[]",t,n),e.push(Math.min(n,t))},function Ub(i){var e=i.stack.pop();exports.DEBUG&&console.log(i.step,"SCANTYPE[]",e)},function Bb(i){var e=i.stack.pop(),t=i.stack.pop();switch(exports.DEBUG&&console.log(i.step,"INSTCTRL[]",e,t),e){case 1:return void(i.inhibitGridFit=!!t);case 2:return void(i.ignoreCvt=!!t);default:throw new Error("invalid INSTCTRL[] selector")}},void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,Ti.bind(void 0,1),Ti.bind(void 0,2),Ti.bind(void 0,3),Ti.bind(void 0,4),Ti.bind(void 0,5),Ti.bind(void 0,6),Ti.bind(void 0,7),Ti.bind(void 0,8),wi.bind(void 0,1),wi.bind(void 0,2),wi.bind(void 0,3),wi.bind(void 0,4),wi.bind(void 0,5),wi.bind(void 0,6),wi.bind(void 0,7),wi.bind(void 0,8),Re.bind(void 0,0,0,0,0,0),Re.bind(void 0,0,0,0,0,1),Re.bind(void 0,0,0,0,0,2),Re.bind(void 0,0,0,0,0,3),Re.bind(void 0,0,0,0,1,0),Re.bind(void 0,0,0,0,1,1),Re.bind(void 0,0,0,0,1,2),Re.bind(void 0,0,0,0,1,3),Re.bind(void 0,0,0,1,0,0),Re.bind(void 0,0,0,1,0,1),Re.bind(void 0,0,0,1,0,2),Re.bind(void 0,0,0,1,0,3),Re.bind(void 0,0,0,1,1,0),Re.bind(void 0,0,0,1,1,1),Re.bind(void 0,0,0,1,1,2),Re.bind(void 0,0,0,1,1,3),Re.bind(void 0,0,1,0,0,0),Re.bind(void 0,0,1,0,0,1),Re.bind(void 0,0,1,0,0,2),Re.bind(void 0,0,1,0,0,3),Re.bind(void 0,0,1,0,1,0),Re.bind(void 0,0,1,0,1,1),Re.bind(void 0,0,1,0,1,2),Re.bind(void 0,0,1,0,1,3),Re.bind(void 0,0,1,1,0,0),Re.bind(void 0,0,1,1,0,1),Re.bind(void 0,0,1,1,0,2),Re.bind(void 0,0,1,1,0,3),Re.bind(void 0,0,1,1,1,0),Re.bind(void 0,0,1,1,1,1),Re.bind(void 0,0,1,1,1,2),Re.bind(void 0,0,1,1,1,3),Re.bind(void 0,1,0,0,0,0),Re.bind(void 0,1,0,0,0,1),Re.bind(void 0,1,0,0,0,2),Re.bind(void 0,1,0,0,0,3),Re.bind(void 0,1,0,0,1,0),Re.bind(void 0,1,0,0,1,1),Re.bind(void 0,1,0,0,1,2),Re.bind(void 0,1,0,0,1,3),Re.bind(void 0,1,0,1,0,0),Re.bind(void 0,1,0,1,0,1),Re.bind(void 0,1,0,1,0,2),Re.bind(void 0,1,0,1,0,3),Re.bind(void 0,1,0,1,1,0),Re.bind(void 0,1,0,1,1,1),Re.bind(void 0,1,0,1,1,2),Re.bind(void 0,1,0,1,1,3),Re.bind(void 0,1,1,0,0,0),Re.bind(void 0,1,1,0,0,1),Re.bind(void 0,1,1,0,0,2),Re.bind(void 0,1,1,0,0,3),Re.bind(void 0,1,1,0,1,0),Re.bind(void 0,1,1,0,1,1),Re.bind(void 0,1,1,0,1,2),Re.bind(void 0,1,1,0,1,3),Re.bind(void 0,1,1,1,0,0),Re.bind(void 0,1,1,1,0,1),Re.bind(void 0,1,1,1,0,2),Re.bind(void 0,1,1,1,0,3),Re.bind(void 0,1,1,1,1,0),Re.bind(void 0,1,1,1,1,1),Re.bind(void 0,1,1,1,1,2),Re.bind(void 0,1,1,1,1,3)],vr.prototype.setState=function(i,e){return this.state[i]=e,this.activeState={key:i,value:this.state[i]},this.activeState},vr.prototype.getState=function(i){return this.state[i]||null},zt.prototype.inboundIndex=function(i){return i>=0&&i<this.tokens.length},zt.prototype.composeRUD=function(i){var e=this,n=i.map(function(r){return e[r[0]].apply(e,r.slice(1).concat(!0))}),s=function(r){return"object"==typeof r&&r.hasOwnProperty("FAIL")};if(n.every(s))return{FAIL:"composeRUD: one or more operations hasn't completed successfully",report:n.filter(s)};this.dispatch("composeRUD",[n.filter(function(r){return!s(r)})])},zt.prototype.replaceRange=function(i,e,t,n){e=null!==e?e:this.tokens.length;var s=t.every(function(a){return a instanceof vr});if(!isNaN(i)&&this.inboundIndex(i)&&s){var r=this.tokens.splice.apply(this.tokens,[i,e].concat(t));return n||this.dispatch("replaceToken",[i,e,t]),[r,t]}return{FAIL:"replaceRange: invalid tokens or startIndex."}},zt.prototype.replaceToken=function(i,e,t){if(!isNaN(i)&&this.inboundIndex(i)&&e instanceof vr){var n=this.tokens.splice(i,1,e);return t||this.dispatch("replaceToken",[i,e]),[n[0],e]}return{FAIL:"replaceToken: invalid token or index."}},zt.prototype.removeRange=function(i,e,t){e=isNaN(e)?this.tokens.length:e;var n=this.tokens.splice(i,e);return t||this.dispatch("removeRange",[n,i,e]),n},zt.prototype.removeToken=function(i,e){if(!isNaN(i)&&this.inboundIndex(i)){var t=this.tokens.splice(i,1);return e||this.dispatch("removeToken",[t,i]),t}return{FAIL:"removeToken: invalid token index."}},zt.prototype.insertToken=function(i,e,t){return i.every(function(s){return s instanceof vr})?(this.tokens.splice.apply(this.tokens,[e,0].concat(i)),t||this.dispatch("insertToken",[i,e]),i):{FAIL:"insertToken: invalid token(s)."}},zt.prototype.registerModifier=function(i,e,t){this.events.newToken.subscribe(function(n,s){if(null===e||!0===e.apply(this,[n,s])){var l=t.apply(this,[n,s]);n.setState(i,l)}}),this.registeredModifiers.push(i)},P1.prototype.subscribe=function(i){return"function"==typeof i?this.subscribers.push(i)-1:{FAIL:"invalid '"+this.eventId+"' event handler"}},P1.prototype.unsubscribe=function(i){this.subscribers.splice(i,1)},cn.prototype.setCurrentIndex=function(i){this.index=i,this.current=this.context[i],this.backtrack=this.context.slice(0,i),this.lookahead=this.context.slice(i+1)},cn.prototype.get=function(i){switch(!0){case 0===i:return this.current;case i<0&&Math.abs(i)<=this.backtrack.length:return this.backtrack.slice(i)[0];case i>0&&i<=this.lookahead.length:return this.lookahead[i-1];default:return null}},zt.prototype.rangeToText=function(i){if(i instanceof S4)return this.getRangeTokens(i).map(function(e){return e.char}).join("")},zt.prototype.getText=function(){return this.tokens.map(function(i){return i.char}).join("")},zt.prototype.getContext=function(i){return this.registeredContexts[i]||null},zt.prototype.on=function(i,e){var t=this.events[i];return t?t.subscribe(e):null},zt.prototype.dispatch=function(i,e){var t=this,n=this.events[i];n instanceof P1&&n.subscribers.forEach(function(s){s.apply(t,e||[])})},zt.prototype.registerContextChecker=function(i,e,t){if(this.getContext(i))return{FAIL:"context name '"+i+"' is already registered."};if("function"!=typeof e)return{FAIL:"missing context start check."};if("function"!=typeof t)return{FAIL:"missing context end check."};var n=new Gb(i,e,t);return this.registeredContexts[i]=n,this.contextCheckers.push(n),n},zt.prototype.getRangeTokens=function(i){return[].concat(this.tokens.slice(i.startIndex,i.startIndex+i.endOffset))},zt.prototype.getContextRanges=function(i){var e=this.getContext(i);return e?e.ranges:{FAIL:"context checker '"+i+"' is not registered."}},zt.prototype.resetContextsRanges=function(){var i=this.registeredContexts;for(var e in i)i.hasOwnProperty(e)&&(i[e].ranges=[])},zt.prototype.updateContextsRanges=function(){this.resetContextsRanges();for(var i=this.tokens.map(function(n){return n.char}),e=0;e<i.length;e++){var t=new cn(i,e);this.runContextCheck(t)}this.dispatch("updateContextsRanges",[this.registeredContexts])},zt.prototype.setEndOffset=function(i,e){var n=new S4(this.getContext(e).openRange.startIndex,i,e),s=this.getContext(e).ranges;return n.rangeId=e+"."+s.length,s.push(n),this.getContext(e).openRange=null,n},zt.prototype.runContextCheck=function(i){var e=this,t=i.index;this.contextCheckers.forEach(function(n){var s=n.contextName,r=e.getContext(s).openRange;if(!r&&n.checkStart(i)&&(r=new S4(t,null,s),e.getContext(s).openRange=r,e.dispatch("contextStart",[s,t])),r&&n.checkEnd(i)){var o=e.setEndOffset(t-r.startIndex+1,s);e.dispatch("contextEnd",[s,o])}})},zt.prototype.tokenize=function(i){this.tokens=[],this.resetContextsRanges();var e=Array.from(i);this.dispatch("start");for(var t=0;t<e.length;t++){var n=e[t],s=new cn(e,t);this.dispatch("next",[s]),this.runContextCheck(s);var r=new vr(n);this.tokens.push(r),this.dispatch("newToken",[r,s])}return this.dispatch("end",[this.tokens]),this.tokens},G0.prototype.getDefaultScriptFeaturesIndexes=function(){for(var i=this.font.tables.gsub.scripts,e=0;e<i.length;e++){var t=i[e];if("DFLT"===t.tag)return t.script.defaultLangSys.featureIndexes}return[]},G0.prototype.getScriptFeaturesIndexes=function(i){if(!this.font.tables.gsub)return[];if(!i)return this.getDefaultScriptFeaturesIndexes();for(var t=this.font.tables.gsub.scripts,n=0;n<t.length;n++){var s=t[n];if(s.tag===i&&s.script.defaultLangSys)return s.script.defaultLangSys.featureIndexes;var r=s.langSysRecords;if(r)for(var a=0;a<r.length;a++){var o=r[a];if(o.tag===i)return o.langSys.featureIndexes}}return this.getDefaultScriptFeaturesIndexes()},G0.prototype.mapTagsToFeatures=function(i,e){for(var t={},n=0;n<i.length;n++)t[i[n].tag]=i[n].feature;this.features[e].tags=t},G0.prototype.getScriptFeatures=function(i){var e=this.features[i];if(this.features.hasOwnProperty(i))return e;var t=this.getScriptFeaturesIndexes(i);if(!t)return null;var n=this.font.tables.gsub;return e=t.map(function(s){return n.features[s]}),this.features[i]=e,this.mapTagsToFeatures(e,i),e},G0.prototype.getSubstitutionType=function(i,e){return i.lookupType.toString()+e.substFormat.toString()},G0.prototype.getLookupMethod=function(i,e){var t=this;switch(this.getSubstitutionType(i,e)){case"11":return function(s){return Vb.apply(t,[s,e])};case"12":return function(s){return Wb.apply(t,[s,e])};case"63":return function(s){return Xb.apply(t,[s,e])};case"41":return function(s){return Yb.apply(t,[s,e])};case"21":return function(s){return qb.apply(t,[s,e])};default:throw new Error("lookupType: "+i.lookupType+" - substFormat: "+e.substFormat+" is not yet supported")}},G0.prototype.lookupFeature=function(i){var e=i.contextParams,t=e.index,n=this.getFeature({tag:i.tag,script:i.script});if(!n)return new Error("font '"+this.font.names.fullName.en+"' doesn't support feature '"+i.tag+"' for script '"+i.script+"'.");for(var s=this.getFeatureLookups(n),r=[].concat(e.context),a=0;a<s.length;a++)for(var o=s[a],l=this.getLookupSubtables(o),c=0;c<l.length;c++){var u=l[c],f=this.getSubstitutionType(o,u),d=this.getLookupMethod(o,u),p=void 0;switch(f){case"11":(p=d(e.current))&&r.splice(t,1,new hs({id:11,tag:i.tag,substitution:p}));break;case"12":(p=d(e.current))&&r.splice(t,1,new hs({id:12,tag:i.tag,substitution:p}));break;case"63":p=d(e),Array.isArray(p)&&p.length&&r.splice(t,1,new hs({id:63,tag:i.tag,substitution:p}));break;case"41":(p=d(e))&&r.splice(t,1,new hs({id:41,tag:i.tag,substitution:p}));break;case"21":(p=d(e.current))&&r.splice(t,1,new hs({id:21,tag:i.tag,substitution:p}))}e=new cn(r,t),(!Array.isArray(p)||p.length)&&(p=null)}return r.length?r:null},G0.prototype.supports=function(i){if(!i.script)return!1;this.getScriptFeatures(i.script);var e=this.features.hasOwnProperty(i.script);if(!i.tag)return e;var t=this.features[i.script].some(function(n){return n.tag===i.tag});return e&&t},G0.prototype.getLookupSubtables=function(i){return i.subtables||null},G0.prototype.getLookupByIndex=function(i){return this.font.tables.gsub.lookups[i]||null},G0.prototype.getFeatureLookups=function(i){return i.lookupListIndexes.map(this.getLookupByIndex.bind(this))},G0.prototype.getFeature=function(e){if(!this.font)return{FAIL:"No font was found"};this.features.hasOwnProperty(e.script)||this.getScriptFeatures(e.script);var t=this.features[e.script];return t?t.tags[e.tag]?this.features[e.script].tags[e.tag]:null:{FAIL:"No feature for script "+e.script}};var Kb={startCheck:function Zb(i){var e=i.current,t=i.get(-1);return null===t&&Ai(e)||!Ai(t)&&Ai(e)},endCheck:function Jb(i){var e=i.get(1);return null===e||!Ai(e)}},jb={startCheck:function $b(i){var e=i.current,t=i.get(-1);return(Ai(e)||Ci(e))&&!Ai(t)},endCheck:function Qb(i){var e=i.get(1);switch(!0){case null===e:return!0;case!Ai(e)&&!Ci(e):var t=function Hb(i){return/\s/.test(i)}(e);if(!t)return!0;if(t&&!i.lookahead.some(function(s){return Ai(s)||Ci(s)}))return!0;break;default:return!1}}},_u={11:function eS(i,e,t){e[t].setState(i.tag,i.substitution)},12:function tS(i,e,t){e[t].setState(i.tag,i.substitution)},63:function nS(i,e,t){i.substitution.forEach(function(n,s){e[t+s].setState(i.tag,n)})},41:function iS(i,e,t){var n=e[t];n.setState(i.tag,i.substitution.ligGlyph);for(var s=i.substitution.components.length,r=0;r<s;r++)(n=e[t+r+1]).setState("deleted",!0)}};function E4(i,e,t){i instanceof hs&&_u[i.id]&&_u[i.id](i,e,t)}function aS(i){var e=this,t="arab",n=this.featuresTags[t],s=this.tokenizer.getRangeTokens(i);if(1!==s.length){var r=new cn(s.map(function(o){return o.getState("glyphIndex")}),0),a=new cn(s.map(function(o){return o.char}),0);s.forEach(function(o,l){if(!Ci(o.char)){r.setCurrentIndex(l),a.setCurrentIndex(l);var u,c=0;switch(function sS(i){for(var e=[].concat(i.backtrack),t=e.length-1;t>=0;t--){var n=e[t],s=xu(n),r=Ci(n);if(!s&&!r)return!0;if(s)return!1}return!1}(a)&&(c|=1),function rS(i){if(xu(i.current))return!1;for(var e=0;e<i.lookahead.length;e++)if(!Ci(i.lookahead[e]))return!0;return!1}(a)&&(c|=2),c){case 1:u="fina";break;case 2:u="init";break;case 3:u="medi"}if(-1!==n.indexOf(u)){var f=e.query.lookupFeature({tag:u,script:t,contextParams:r});if(f instanceof Error)return console.info(f.message);f.forEach(function(d,p){d instanceof hs&&(E4(d,s,p),r.context[p]=d.substitution)})}}})}}function bu(i,e){return new cn(i.map(function(n){return n.activeState.value}),e||0)}function oS(i){var e=this,n=this.tokenizer.getRangeTokens(i),s=bu(n);s.context.forEach(function(r,a){s.setCurrentIndex(a);var o=e.query.lookupFeature({tag:"rlig",script:"arab",contextParams:s});o.length&&(o.forEach(function(l){return E4(l,n,a)}),s=bu(n))})}var hS={startCheck:function lS(i){var e=i.current,t=i.get(-1);return null===t&&R1(e)||!R1(t)&&R1(e)},endCheck:function cS(i){var e=i.get(1);return null===e||!R1(e)}};function Su(i,e){return new cn(i.map(function(n){return n.activeState.value}),e||0)}function uS(i){var e=this,n=this.tokenizer.getRangeTokens(i),s=Su(n);s.context.forEach(function(r,a){s.setCurrentIndex(a);var o=e.query.lookupFeature({tag:"liga",script:"latn",contextParams:s});o.length&&(o.forEach(function(l){return E4(l,n,a)}),s=Su(n))})}function hn(i){this.baseDir=i||"ltr",this.tokenizer=new zt,this.featuresTags={}}function T4(i){var e=this.contextChecks[i+"Check"];return this.tokenizer.registerContextChecker(i,e.startCheck,e.endCheck)}function fS(){return T4.call(this,"latinWord"),T4.call(this,"arabicWord"),T4.call(this,"arabicSentence"),this.tokenizer.tokenize(this.text)}function dS(){var i=this;this.tokenizer.getContextRanges("arabicSentence").forEach(function(t){var n=i.tokenizer.getRangeTokens(t);i.tokenizer.replaceRange(t.startIndex,t.endOffset,n.reverse())})}function w4(){if(-1===this.tokenizer.registeredModifiers.indexOf("glyphIndex"))throw new Error("glyphIndex modifier is required to apply arabic presentation features.")}function pS(){var i=this;this.featuresTags.hasOwnProperty("arab")&&(w4.call(this),this.tokenizer.getContextRanges("arabicWord").forEach(function(n){aS.call(i,n)}))}function mS(){var i=this,e="arab";this.featuresTags.hasOwnProperty(e)&&-1!==this.featuresTags[e].indexOf("rlig")&&(w4.call(this),this.tokenizer.getContextRanges("arabicWord").forEach(function(s){oS.call(i,s)}))}function gS(){var i=this,e="latn";this.featuresTags.hasOwnProperty(e)&&-1!==this.featuresTags[e].indexOf("liga")&&(w4.call(this),this.tokenizer.getContextRanges("latinWord").forEach(function(s){uS.call(i,s)}))}function St(i){(i=i||{}).tables=i.tables||{},i.empty||(xa(i.familyName,"When creating a new Font object, familyName is required."),xa(i.styleName,"When creating a new Font object, styleName is required."),xa(i.unitsPerEm,"When creating a new Font object, unitsPerEm is required."),xa(i.ascender,"When creating a new Font object, ascender is required."),xa(i.descender<=0,"When creating a new Font object, negative descender value is required."),this.names={fontFamily:{en:i.familyName||" "},fontSubfamily:{en:i.styleName||" "},fullName:{en:i.fullName||i.familyName+" "+i.styleName},postScriptName:{en:i.postScriptName||(i.familyName+i.styleName).replace(/\s/g,"")},designer:{en:i.designer||" "},designerURL:{en:i.designerURL||" "},manufacturer:{en:i.manufacturer||" "},manufacturerURL:{en:i.manufacturerURL||" "},license:{en:i.license||" "},licenseURL:{en:i.licenseURL||" "},version:{en:i.version||"Version 0.1"},description:{en:i.description||" "},copyright:{en:i.copyright||" "},trademark:{en:i.trademark||" "}},this.unitsPerEm=i.unitsPerEm||1e3,this.ascender=i.ascender,this.descender=i.descender,this.createdTimestamp=i.createdTimestamp,this.tables=Object.assign(i.tables,{os2:Object.assign({usWeightClass:i.weightClass||this.usWeightClasses.MEDIUM,usWidthClass:i.widthClass||this.usWidthClasses.MEDIUM,fsSelection:i.fsSelection||this.fsSelectionValues.REGULAR},i.tables.os2)})),this.supported=!0,this.glyphs=new wn.GlyphSet(this,i.glyphs||[]),this.encoding=new hh(this),this.position=new ya(this),this.substitution=new B0(this),this.tables=this.tables||{},this._push=null,this._hmtxTableData={},Object.defineProperty(this,"hinting",{get:function(){return this._hinting?this._hinting:"truetype"===this.outlinesFormat?this._hinting=new eu(this):void 0}})}function yS(i,e,t){var n={},s=new Pe.Parser(i,e);return n.tag=s.parseTag(),n.minValue=s.parseFixed(),n.defaultValue=s.parseFixed(),n.maxValue=s.parseFixed(),s.skip("uShort",1),n.name=t[s.parseUShort()]||{},n}function _S(i,e,t,n){var s={},r=new Pe.Parser(i,e);s.name=n[r.parseUShort()]||{},r.skip("uShort",1),s.coordinates={};for(var a=0;a<t.length;++a)s.coordinates[t[a].tag]=r.parseFixed();return s}hn.prototype.setText=function(i){this.text=i},hn.prototype.contextChecks={latinWordCheck:hS,arabicWordCheck:Kb,arabicSentenceCheck:jb},hn.prototype.registerFeatures=function(i,e){var t=this,n=e.filter(function(s){return t.query.supports({script:i,tag:s})});this.featuresTags[i]=this.featuresTags.hasOwnProperty(i)?this.featuresTags[i].concat(n):n},hn.prototype.applyFeatures=function(i,e){if(!i)throw new Error("No valid font was provided to apply features");this.query||(this.query=new G0(i));for(var t=0;t<e.length;t++){var n=e[t];this.query.supports({script:n.script})&&this.registerFeatures(n.script,n.tags)}},hn.prototype.registerModifier=function(i,e,t){this.tokenizer.registerModifier(i,e,t)},hn.prototype.checkContextReady=function(i){return!!this.tokenizer.getContext(i)},hn.prototype.applyFeaturesToContexts=function(){this.checkContextReady("arabicWord")&&(pS.call(this),mS.call(this)),this.checkContextReady("latinWord")&&gS.call(this),this.checkContextReady("arabicSentence")&&dS.call(this)},hn.prototype.processText=function(i){(!this.text||this.text!==i)&&(this.setText(i),fS.call(this),this.applyFeaturesToContexts())},hn.prototype.getBidiText=function(i){return this.processText(i),this.tokenizer.getText()},hn.prototype.getTextGlyphs=function(i){this.processText(i);for(var e=[],t=0;t<this.tokenizer.tokens.length;t++){var n=this.tokenizer.tokens[t];if(!n.state.deleted){var s=n.activeState.value;e.push(Array.isArray(s)?s[0]:s)}}return e},St.prototype.hasChar=function(i){return null!==this.encoding.charToGlyphIndex(i)},St.prototype.charToGlyphIndex=function(i){return this.encoding.charToGlyphIndex(i)},St.prototype.charToGlyph=function(i){var e=this.charToGlyphIndex(i),t=this.glyphs.get(e);return t||(t=this.glyphs.get(0)),t},St.prototype.updateFeatures=function(i){return this.defaultRenderOptions.features.map(function(e){return"latn"===e.script?{script:"latn",tags:e.tags.filter(function(t){return i[t]})}:e})},St.prototype.stringToGlyphs=function(i,e){var t=this,n=new hn;n.registerModifier("glyphIndex",null,function(f){return t.charToGlyphIndex(f.char)});var r=e?this.updateFeatures(e.features):this.defaultRenderOptions.features;n.applyFeatures(this,r);for(var a=n.getTextGlyphs(i),o=a.length,l=new Array(o),c=this.glyphs.get(0),u=0;u<o;u+=1)l[u]=this.glyphs.get(a[u])||c;return l},St.prototype.nameToGlyphIndex=function(i){return this.glyphNames.nameToGlyphIndex(i)},St.prototype.nameToGlyph=function(i){var e=this.nameToGlyphIndex(i),t=this.glyphs.get(e);return t||(t=this.glyphs.get(0)),t},St.prototype.glyphIndexToName=function(i){return this.glyphNames.glyphIndexToName?this.glyphNames.glyphIndexToName(i):""},St.prototype.getKerningValue=function(i,e){i=i.index||i,e=e.index||e;var t=this.position.defaultKerningTables;return t?this.position.getKerningValue(t,i,e):this.kerningPairs[i+","+e]||0},St.prototype.defaultRenderOptions={kerning:!0,features:[{script:"arab",tags:["init","medi","fina","rlig"]},{script:"latn",tags:["liga","rlig"]}]},St.prototype.forEachGlyph=function(i,e,t,n,s,r){e=void 0!==e?e:0,t=void 0!==t?t:0,n=void 0!==n?n:72,s=Object.assign({},this.defaultRenderOptions,s);var l,a=1/this.unitsPerEm*n,o=this.stringToGlyphs(i,s);if(s.kerning){var c=s.script||this.position.getDefaultScriptName();l=this.position.getKerningTables(c,s.language)}for(var u=0;u<o.length;u+=1){var f=o[u];r.call(this,f,e,t,n,s),f.advanceWidth&&(e+=f.advanceWidth*a),s.kerning&&u<o.length-1&&(e+=(l?this.position.getKerningValue(l,f.index,o[u+1].index):this.getKerningValue(f,o[u+1]))*a),s.letterSpacing?e+=s.letterSpacing*n:s.tracking&&(e+=s.tracking/1e3*n)}return e},St.prototype.getPath=function(i,e,t,n,s){var r=new Qt;return this.forEachGlyph(i,e,t,n,s,function(a,o,l,c){var u=a.getPath(o,l,c,s,this);r.extend(u)}),r},St.prototype.getPaths=function(i,e,t,n,s){var r=[];return this.forEachGlyph(i,e,t,n,s,function(a,o,l,c){var u=a.getPath(o,l,c,s,this);r.push(u)}),r},St.prototype.getAdvanceWidth=function(i,e,t){return this.forEachGlyph(i,0,0,e,t,function(){})},St.prototype.draw=function(i,e,t,n,s,r){this.getPath(e,t,n,s,r).draw(i)},St.prototype.drawPoints=function(i,e,t,n,s,r){this.forEachGlyph(e,t,n,s,r,function(a,o,l,c){a.drawPoints(i,o,l,c)})},St.prototype.drawMetrics=function(i,e,t,n,s,r){this.forEachGlyph(e,t,n,s,r,function(a,o,l,c){a.drawMetrics(i,o,l,c)})},St.prototype.getEnglishName=function(i){var e=this.names[i];if(e)return e.en},St.prototype.validate=function(){var i=this;function t(n){var s=i.getEnglishName(n);s&&s.trim()}t("fontFamily"),t("weightName"),t("manufacturer"),t("copyright"),t("version")},St.prototype.toTables=function(){return i__fontToTable(this)},St.prototype.toBuffer=function(){return console.warn("Font.toBuffer is deprecated. Use Font.toArrayBuffer instead."),this.toArrayBuffer()},St.prototype.toArrayBuffer=function(){for(var e=this.toTables().encode(),t=new ArrayBuffer(e.length),n=new Uint8Array(t),s=0;s<e.length;s++)n[s]=e[s];return t},St.prototype.download=function(i){var e=this.getEnglishName("fontFamily"),t=this.getEnglishName("fontSubfamily");i=i||e.replace(/\s/g,"")+"-"+t+".otf";var n=this.toArrayBuffer();if(function r_(){return typeof window<"u"}())if(window.URL=window.URL||window.webkitURL,window.URL){var s=new DataView(n),r=new Blob([s],{type:"font/opentype"}),a=document.createElement("a");a.href=window.URL.createObjectURL(r),a.download=i;var o=document.createEvent("MouseEvents");o.initEvent("click",!0,!1),a.dispatchEvent(o)}else console.warn("Font file could not be downloaded. Try using a different browser.");else{var l=dt(7256),c=function a_(i){for(var e=new Buffer(i.byteLength),t=new Uint8Array(i),n=0;n<e.length;++n)e[n]=t[n];return e}(n);l.writeFileSync(i,c)}},St.prototype.fsSelectionValues={ITALIC:1,UNDERSCORE:2,NEGATIVE:4,OUTLINED:8,STRIKEOUT:16,BOLD:32,REGULAR:64,USER_TYPO_METRICS:128,WWS:256,OBLIQUE:512},St.prototype.usWidthClasses={ULTRA_CONDENSED:1,EXTRA_CONDENSED:2,CONDENSED:3,SEMI_CONDENSED:4,MEDIUM:5,SEMI_EXPANDED:6,EXPANDED:7,EXTRA_EXPANDED:8,ULTRA_EXPANDED:9},St.prototype.usWeightClasses={THIN:100,EXTRA_LIGHT:200,LIGHT:300,NORMAL:400,MEDIUM:500,SEMI_BOLD:600,BOLD:700,EXTRA_BOLD:800,BLACK:900};var MS_parse=function SS(i,e,t){var n=new Pe.Parser(i,e),s=n.parseULong();Ze.argument(65536===s,"Unsupported fvar table version.");var r=n.parseOffset16();n.skip("uShort",1);for(var a=n.parseUShort(),o=n.parseUShort(),l=n.parseUShort(),c=n.parseUShort(),u=[],f=0;f<a;f++)u.push(yS(i,e+r+f*o,t));for(var d=[],p=e+r+a*o,m=0;m<l;m++)d.push(_S(i,p+m*c,u,t));return{axes:u,instances:d}},ES=function(){return{coverage:this.parsePointer(q.coverage),attachPoints:this.parseList(q.pointer(q.uShortList))}},TS=function(){var i=this.parseUShort();return Ze.argument(1===i||2===i||3===i,"Unsupported CaretValue table version."),1===i?{coordinate:this.parseShort()}:2===i?{pointindex:this.parseShort()}:3===i?{coordinate:this.parseShort()}:void 0},wS=function(){return this.parseList(q.pointer(TS))},AS=function(){return{coverage:this.parsePointer(q.coverage),ligGlyphs:this.parseList(q.pointer(wS))}},CS=function(){return this.parseUShort(),this.parseList(q.pointer(q.coverage))},RS_parse=function PS(i,e){var t=new q(i,e=e||0),n=t.parseVersion(1);Ze.argument(1===n||1.2===n||1.3===n,"Unsupported GDEF table version.");var s={version:n,classDef:t.parsePointer(q.classDef),attachList:t.parsePointer(ES),ligCaretList:t.parsePointer(AS),markAttachClassDef:t.parsePointer(q.classDef)};return n>=1.2&&(s.markGlyphSets=t.parsePointer(CS)),s},un=new Array(10);un[1]=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort();return 1===t?{posFormat:1,coverage:this.parsePointer(q.coverage),value:this.parseValueRecord()}:2===t?{posFormat:2,coverage:this.parsePointer(q.coverage),values:this.parseValueRecordList()}:void Ze.assert(!1,"0x"+e.toString(16)+": GPOS lookup type 1 format must be 1 or 2.")},un[2]=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort();Ze.assert(1===t||2===t,"0x"+e.toString(16)+": GPOS lookup type 2 format must be 1 or 2.");var n=this.parsePointer(q.coverage),s=this.parseUShort(),r=this.parseUShort();if(1===t)return{posFormat:t,coverage:n,valueFormat1:s,valueFormat2:r,pairSets:this.parseList(q.pointer(q.list(function(){return{secondGlyph:this.parseUShort(),value1:this.parseValueRecord(s),value2:this.parseValueRecord(r)}})))};if(2===t){var a=this.parsePointer(q.classDef),o=this.parsePointer(q.classDef),l=this.parseUShort(),c=this.parseUShort();return{posFormat:t,coverage:n,valueFormat1:s,valueFormat2:r,classDef1:a,classDef2:o,class1Count:l,class2Count:c,classRecords:this.parseList(l,q.list(c,function(){return{value1:this.parseValueRecord(s),value2:this.parseValueRecord(r)}}))}}},un[3]=function(){return{error:"GPOS Lookup 3 not supported"}},un[4]=function(){return{error:"GPOS Lookup 4 not supported"}},un[5]=function(){return{error:"GPOS Lookup 5 not supported"}},un[6]=function(){return{error:"GPOS Lookup 6 not supported"}},un[7]=function(){return{error:"GPOS Lookup 7 not supported"}},un[8]=function(){return{error:"GPOS Lookup 8 not supported"}},un[9]=function(){return{error:"GPOS Lookup 9 not supported"}};new Array(10);var FS_parse=function LS(i,e){var t=new q(i,e=e||0),n=t.parseVersion(1);return Ze.argument(1===n||1.1===n,"Unsupported GPOS table version "+n),1===n?{version:n,scripts:t.parseScriptList(),features:t.parseFeatureList(),lookups:t.parseLookupList(un)}:{version:n,scripts:t.parseScriptList(),features:t.parseFeatureList(),lookups:t.parseLookupList(un),variations:t.parseFeatureVariationsList()}},US_parse=function kS(i,e){var t=new Pe.Parser(i,e),n=t.parseUShort();if(0===n)return function OS(i){var e={};i.skip("uShort");var t=i.parseUShort();Ze.argument(0===t,"Unsupported kern sub-table version."),i.skip("uShort",2);var n=i.parseUShort();i.skip("uShort",3);for(var s=0;s<n;s+=1){var r=i.parseUShort(),a=i.parseUShort(),o=i.parseShort();e[r+","+a]=o}return e}(t);if(1===n)return function NS(i){var e={};i.skip("uShort"),i.parseULong()>1&&console.warn("Only the first kern subtable is supported."),i.skip("uLong");var s=255&i.parseUShort();if(i.skip("uShort"),0===s){var r=i.parseUShort();i.skip("uShort",3);for(var a=0;a<r;a+=1){var o=i.parseUShort(),l=i.parseUShort(),c=i.parseShort();e[o+","+l]=c}}return e}(t);throw new Error("Unsupported kern table version ("+n+").")},GS_parse=function BS(i,e,t,n){for(var s=new Pe.Parser(i,e),r=n?s.parseUShort:s.parseULong,a=[],o=0;o<t+1;o+=1){var l=r.call(s);n&&(l*=2),a.push(l)}return a};function zS(i,e){dt(7256).readFile(i,function(n,s){if(n)return e(n.message);e(null,Yh(s))})}function HS(i,e){var t=new XMLHttpRequest;t.open("get",i,!0),t.responseType="arraybuffer",t.onload=function(){return t.response?e(null,t.response):e("Font could not be loaded: "+t.statusText)},t.onerror=function(){e("Font could not be loaded")},t.send()}function Eu(i,e){for(var t=[],n=12,s=0;s<e;s+=1){var r=Pe.getTag(i,n),a=Pe.getULong(i,n+4),o=Pe.getULong(i,n+8),l=Pe.getULong(i,n+12);t.push({tag:r,checksum:a,offset:o,length:l,compression:!1}),n+=16}return t}function Wt(i,e){if("WOFF"===e.compression){var t=new Uint8Array(i.buffer,e.offset+2,e.compressedLength-2),n=new Uint8Array(e.length);if(function Dy(i,e){var n,r,t=new Ay(i,e);do{switch(n=Ry(t),Tn(t,2,0)){case 0:r=Iy(t);break;case 1:r=th(t,Z6,J6);break;case 2:Ly(t,t.ltree,t.dtree),r=th(t,t.ltree,t.dtree);break;default:r=-3}if(0!==r)throw new Error("Data error")}while(!n);t.destLen<t.dest.length&&("function"==typeof t.dest.slice?t.dest.slice(0,t.destLen):t.dest.subarray(0,t.destLen))}(t,n),n.byteLength!==e.length)throw new Error("Decompression error: "+e.tag+" decompressed length doesn't match recorded length");return{data:new DataView(n.buffer,0),offset:0}}return{data:i,offset:e.offset}}function A4(i,e){e=e??{};var t,n,a,s=new St({empty:!0}),r=new DataView(i,0),o=[],l=Pe.getTag(r,0);if("\0\x01\0\0"===l||"true"===l||"typ1"===l)s.outlinesFormat="truetype",o=Eu(r,a=Pe.getUShort(r,4));else if("OTTO"===l)s.outlinesFormat="cff",o=Eu(r,a=Pe.getUShort(r,4));else{if("wOFF"!==l)throw new Error("Unsupported OpenType signature "+l);var c=Pe.getTag(r,4);if("\0\x01\0\0"===c)s.outlinesFormat="truetype";else{if("OTTO"!==c)throw new Error("Unsupported OpenType flavor "+l);s.outlinesFormat="cff"}o=function VS(i,e){for(var t=[],n=44,s=0;s<e;s+=1){var r=Pe.getTag(i,n),a=Pe.getULong(i,n+4),o=Pe.getULong(i,n+8),l=Pe.getULong(i,n+12);t.push({tag:r,offset:a,compression:o<l&&"WOFF",compressedLength:o,length:l}),n+=20}return t}(r,a=Pe.getUShort(r,12))}for(var u,f,d,p,m,y,v,g,_,x,b,T,E=0;E<a;E+=1){var M=o[E],w=void 0;switch(M.tag){case"cmap":w=Wt(r,M),s.tables.cmap=ch_parse(w.data,w.offset),s.encoding=new uh(s.tables.cmap);break;case"cvt ":w=Wt(r,M),T=new Pe.Parser(w.data,w.offset),s.tables.cvt=T.parseShortList(M.length/2);break;case"fvar":f=M;break;case"fpgm":w=Wt(r,M),T=new Pe.Parser(w.data,w.offset),s.tables.fpgm=T.parseByteList(M.length);break;case"head":w=Wt(r,M),s.tables.head=Th_parse(w.data,w.offset),s.unitsPerEm=s.tables.head.unitsPerEm,t=s.tables.head.indexToLocFormat;break;case"hhea":w=Wt(r,M),s.tables.hhea=wh_parse(w.data,w.offset),s.ascender=s.tables.hhea.ascender,s.descender=s.tables.hhea.descender,s.numberOfHMetrics=s.tables.hhea.numberOfHMetrics;break;case"hmtx":v=M;break;case"ltag":w=Wt(r,M),n=Ch_parse(w.data,w.offset);break;case"maxp":w=Wt(r,M),s.tables.maxp=Ph_parse(w.data,w.offset),s.numGlyphs=s.tables.maxp.numGlyphs;break;case"name":x=M;break;case"OS/2":w=Wt(r,M),s.tables.os2=d4_parse(w.data,w.offset);break;case"post":w=Wt(r,M),s.tables.post=kh_parse(w.data,w.offset),s.glyphNames=new o4(s.tables.post);break;case"prep":w=Wt(r,M),T=new Pe.Parser(w.data,w.offset),s.tables.prep=T.parseByteList(M.length);break;case"glyf":d=M;break;case"loca":_=M;break;case"CFF ":u=M;break;case"kern":g=M;break;case"GDEF":p=M;break;case"GPOS":m=M;break;case"GSUB":y=M;break;case"meta":b=M}}var I=Wt(r,x);if(s.tables.name=Nh_parse(I.data,I.offset,n),s.names=s.tables.name,d&&_){var S=0===t,P=Wt(r,_),X=GS_parse(P.data,P.offset,s.numGlyphs,S),te=Wt(r,d);s.glyphs=$h.parse(te.data,te.offset,X,s,e)}else{if(!u)throw new Error("Font doesn't contain TrueType or CFF outlines.");var U=Wt(r,u);Eh_parse(U.data,U.offset,s,e)}var z=Wt(r,v);if(Ah_parse(s,z.data,z.offset,s.numberOfHMetrics,s.numGlyphs,s.glyphs,e),function tx(i,e){e.lowMemory?function ex(i){i._IndexToUnicodeMap={};for(var e=i.tables.cmap.glyphIndexMap,t=Object.keys(e),n=0;n<t.length;n+=1){var s=t[n],r=e[s];void 0===i._IndexToUnicodeMap[r]?i._IndexToUnicodeMap[r]={unicodes:[parseInt(s)]}:i._IndexToUnicodeMap[r].unicodes.push(parseInt(s))}}(i):function jy(i){for(var e,t=i.tables.cmap.glyphIndexMap,n=Object.keys(t),s=0;s<n.length;s+=1){var r=n[s];(e=i.glyphs.get(t[r])).addUnicode(parseInt(r))}for(var o=0;o<i.glyphs.length;o+=1)e=i.glyphs.get(o),i.cffEncoding?e.name=i.isCIDFont?"gid"+o:i.cffEncoding.charset[o]:i.glyphNames.names&&(e.name=i.glyphNames.glyphIndexToName(o))}(i)}(s,e),g){var G=Wt(r,g);s.kerningPairs=US_parse(G.data,G.offset)}else s.kerningPairs={};if(p){var ee=Wt(r,p);s.tables.gdef=RS_parse(ee.data,ee.offset)}if(m){var J=Wt(r,m);s.tables.gpos=FS_parse(J.data,J.offset),s.position.init()}if(y){var Z=Wt(r,y);s.tables.gsub=Uh_parse(Z.data,Z.offset)}if(f){var ne=Wt(r,f);s.tables.fvar=MS_parse(ne.data,ne.offset,s.names)}if(b){var Y=Wt(r,b);s.tables.meta=Bh_parse(Y.data,Y.offset),s.metas=s.tables.meta}return s}var YS=Object.freeze({__proto__:null,Font:St,Glyph:U0,Path:Qt,BoundingBox:Yn,_parse:Pe,parse:A4,load:function WS(i,e,t){t=t??{};var s=typeof window>"u"&&!t.isUrl?zS:HS;return new Promise(function(r,a){s(i,function(o,l){if(o){if(e)return e(o);a(o)}var c;try{c=A4(l,t)}catch(u){if(e)return e(u,null);a(u)}if(e)return e(null,c);r(c)})})},loadSync:function XS(i,e){return A4(Yh(dt(7256).readFileSync(i)),e)}});const qS=YS,Ea="DxfWorkerMsg";let Tu=(()=>{class i{constructor(t,n=!1){this.worker=t,n?t.onmessage=this._ProcessRequest.bind(this):t&&(t.addEventListener("message",this._ProcessResponse.bind(this),!1),t.addEventListener("error",this._OnError.bind(this),!1),this.reqSeq=1,this.requests=new Map,this.progressCbk=null)}Load(t,n,s,r){var a=this;return(0,pt.A)(function*(){return a.worker?a._SendRequest(i.WorkerMsg.LOAD,{url:t,fonts:n,options:a._CloneOptions(s)},r):a._Load(t,n,s,r)})()}Destroy(){var t=this;return(0,pt.A)(function*(n=!1){t.worker&&(n||(yield t._SendRequest(i.WorkerMsg.DESTROY)),t.worker.terminate())}).apply(this,arguments)}_ProcessRequest(t){var n=this;return(0,pt.A)(function*(){const s=t.data;if(s.signature!==Ea)return void console.log("Message with bad signature",s);const r={seq:s.seq,type:s.type,signature:Ea},a=[];try{r.data=yield n._ProcessRequestMessage(s.type,s.data,a,s.seq)}catch(o){console.error(o),r.error=String(o)}n.worker.postMessage(r,a),s.type===i.WorkerMsg.DESTROY&&(n.worker.onmessage=null,n.worker.close(),n.worker=null)})()}_ProcessRequestMessage(t,n,s,r){var a=this;return(0,pt.A)(function*(){switch(t){case i.WorkerMsg.LOAD:{const{scene:o,dxf:l}=yield a._Load(n.url,n.fonts,n.options,(c,u,f)=>a._SendProgress(r,c,u,f));return s.push(o.vertices),s.push(o.indices),s.push(o.transforms),{scene:o,dxf:l}}case i.WorkerMsg.DESTROY:return null;default:throw"Unknown message type: "+t}})()}_ProcessResponse(t){var n=this;return(0,pt.A)(function*(){const s=t.data;if(s.signature!==Ea)return void console.log("Message with bad signature",s);const r=s.seq,a=n.requests.get(r);if(!a)return void console.error("Unmatched message sequence: ",r);const o=s.data;s.type!==i.WorkerMsg.PROGRESS?(n.requests.delete(r),s.hasOwnProperty("error")?a.SetError(s.error):a.SetResponse(o)):a.progressCbk&&a.progressCbk(o.phase,o.size,o.totalSize)})()}_OnError(t){var n=this;return(0,pt.A)(function*(){console.error("DxfWorker worker error",t);const s=Array.from(n.requests.values);n.requests.clear(),s.forEach(r=>r.SetError(t))})()}_SendRequest(t){var n=this;return(0,pt.A)(function*(s,r=null,a=null){const o=n.reqSeq++,l=new i.Request(o,a);return n.requests.set(o,l),n.worker.postMessage({seq:o,type:s,data:r,signature:Ea}),yield l.GetResponse()}).apply(this,arguments)}_SendProgress(t,n,s,r){this.worker.postMessage({seq:t,type:i.WorkerMsg.PROGRESS,data:{phase:n,size:s,totalSize:r},signature:Ea})}_Load(t,n,s,r){var a=this;return(0,pt.A)(function*(){let o;o=n?a._CreateFontFetchers(n,r):[];const l=yield new h8(t,s.fileEncoding).Fetch(r);r&&r("prepare",0,null);const c=new fa(s);return yield c.Build(l,o),{scene:c.scene,dxf:!0===s.retainParsedDxf?l:void 0}})()}_CreateFontFetchers(t,n){function s(a){return(0,pt.A)(function*(){n&&n("font",0,null);const o=yield fetch(a).then(l=>l.arrayBuffer());return n&&n("prepare",0,null),qS.parse(o)})}const r=[];for(const a of t)r.push(s(a));return r}_CloneOptions(t){if(Array.isArray(t))return t.map(n=>this._CloneOptions(n));if("object"==typeof t&&null!==t){const n={};for(const s in t)n[s]=this._CloneOptions(t[s]);return n}return t}}return i.WorkerMsg={LOAD:"LOAD",PROGRESS:"PROGRESS",DESTROY:"DESTROY"},i.Request=class{constructor(e,t){this.seq=e,this.progressCbk=t,this.promise=new Promise((n,s)=>{this._Resolve=n,this._Reject=s})}GetResponse(){var e=this;return(0,pt.A)(function*(){return yield e.promise})()}SetResponse(e){this._Resolve(e)}SetError(e){this._Reject(e)}},i})();class wu{constructor(e,t,n,s){this.instanceType=e,this.geometryType=t??null,this.color=n,this.lineType=s??null}Compare(e){let t=Wn(this.instanceType,e.instanceType);return 0!==t||(t=Wn(this.geometryType,e.geometryType),0!==t)||(t=Wn(this.color,e.color),0!==t)?t:Wn(this.lineType,e.lineType)}}const Ta=function(i,e){var D,ge,Se,Ie,Oe,Te;void 0===e&&console.warn('THREE.OrbitControls: The second parameter "domElement" is now mandatory.'),e===document&&console.error('THREE.OrbitControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.'),this.object=i,this.domElement=e,this.enabled=!0,this.target=new F,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.mouseZoomSpeedFactor=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:37,UP:38,RIGHT:39,BOTTOM:40},this.mouseButtons={LEFT:0,MIDDLE:1,RIGHT:2},this.touches={ONE:0,TWO:2},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this.getPolarAngle=function(){return c.phi},this.getAzimuthalAngle=function(){return c.theta},this.listenToKeyEvents=function(D){D.addEventListener("keydown",De),this._domElementKeyEvents=D},this.saveState=function(){t.target0.copy(t.target),t.position0.copy(t.object.position),t.zoom0=t.object.zoom},this.reset=function(){t.target.copy(t.target0),t.object.position.copy(t.position0),t.object.zoom=t.zoom0,t.object.updateProjectionMatrix(),t.dispatchEvent(n),t.update(),o=a.NONE},this.update=(D=new F,ge=(new g0).setFromUnitVectors(i.up,new F(0,1,0)),Se=ge.clone().invert(),Ie=new F,Oe=new g0,Te=2*Math.PI,function(){var gt=t.object.position;D.copy(gt).sub(t.target),D.applyQuaternion(ge),c.setFromVector3(D),t.autoRotate&&o===a.NONE&&S(function w(){return 2*Math.PI/60/60*t.autoRotateSpeed}()),t.enableDamping?(c.theta+=u.theta*t.dampingFactor,c.phi+=u.phi*t.dampingFactor):(c.theta+=u.theta,c.phi+=u.phi);var mt=t.minAzimuthAngle,Qe=t.maxAzimuthAngle;return isFinite(mt)&&isFinite(Qe)&&(mt<-Math.PI?mt+=Te:mt>Math.PI&&(mt-=Te),Qe<-Math.PI?Qe+=Te:Qe>Math.PI&&(Qe-=Te),c.theta=mt<=Qe?Math.max(mt,Math.min(Qe,c.theta)):c.theta>(mt+Qe)/2?Math.max(mt,c.theta):Math.min(Qe,c.theta)),c.phi=Math.max(t.minPolarAngle,Math.min(t.maxPolarAngle,c.phi)),c.makeSafe(),c.radius*=f,c.radius=Math.max(t.minDistance,Math.min(t.maxDistance,c.radius)),!0===t.enableDamping?t.target.addScaledVector(d,t.dampingFactor):t.target.add(d),D.setFromSpherical(c),D.applyQuaternion(Se),gt.copy(t.target).add(D),t.object.lookAt(t.target),!0===t.enableDamping?(u.theta*=1-t.dampingFactor,u.phi*=1-t.dampingFactor,d.multiplyScalar(1-t.dampingFactor)):(u.set(0,0,0),d.set(0,0,0)),f=1,!!(p||Ie.distanceToSquared(t.object.position)>l||8*(1-Oe.dot(t.object.quaternion))>l)&&(t.dispatchEvent(n),Ie.copy(t.object.position),Oe.copy(t.object.quaternion),p=!1,!0)}),this.dispose=function(){t.domElement.removeEventListener("contextmenu",st),t.domElement.removeEventListener("pointerdown",_e),t.domElement.removeEventListener("wheel",oe),t.domElement.removeEventListener("touchstart",ve),t.domElement.removeEventListener("touchend",We),t.domElement.removeEventListener("touchmove",we),t.domElement.ownerDocument.removeEventListener("pointermove",R),t.domElement.ownerDocument.removeEventListener("pointerup",C),null!==t._domElementKeyEvents&&t._domElementKeyEvents.removeEventListener("keydown",De)};var t=this,n={type:"change"},s={type:"start"},r={type:"end"},a={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},o=a.NONE,l=1e-6,c=new K3,u=new K3,f=1,d=new F,p=!1,m=new H,y=new H,v=new H,g=new H,_=new H,x=new H,b=new H,T=new H,E=new H,M=new H;function I(D){return Math.pow(.95,t.zoomSpeed*(D?t.mouseZoomSpeedFactor:1))}function S(D){u.theta-=D}function P(D){u.phi-=D}var X=function(){var D=new F;return function(Se,Ie){D.setFromMatrixColumn(Ie,0),D.multiplyScalar(-Se),d.add(D)}}(),te=function(){var D=new F;return function(Se,Ie){!0===t.screenSpacePanning?D.setFromMatrixColumn(Ie,1):(D.setFromMatrixColumn(Ie,0),D.crossVectors(t.object.up,D)),D.multiplyScalar(Se),d.add(D)}}(),U=function(){var D=new F;return function(Se,Ie){var Oe=t.domElement;if(t.object.isPerspectiveCamera){D.copy(t.object.position).sub(t.target);var nt=D.length();nt*=Math.tan(t.object.fov/2*Math.PI/180),X(2*Se*nt/Oe.clientHeight,t.object.matrix),te(2*Ie*nt/Oe.clientHeight,t.object.matrix)}else t.object.isOrthographicCamera?(X(Se*(t.object.right-t.object.left)/t.object.zoom/Oe.clientWidth/window.devicePixelRatio,t.object.matrix),te(Ie*(t.object.top-t.object.bottom)/t.object.zoom/Oe.clientHeight/window.devicePixelRatio,t.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),t.enablePan=!1)}}();function z(D,ge){U(-(ge.x-t.domElement.width/2)*(D-1)/D,-(ge.y-t.domElement.height/2)*(D-1)/D)}function G(D,ge){if(t.object.isPerspectiveCamera)f/=D;else if(t.object.isOrthographicCamera){const Se=Math.max(t.minZoom,Math.min(t.maxZoom,t.object.zoom*D));z(Se/t.object.zoom,ge),t.object.zoom=Se,t.object.updateProjectionMatrix(),p=!0}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),t.enableZoom=!1}function ee(D,ge){if(t.object.isPerspectiveCamera)f*=D;else if(t.object.isOrthographicCamera){const Se=Math.max(t.minZoom,Math.min(t.maxZoom,t.object.zoom/D));z(Se/t.object.zoom,ge),t.object.zoom=Se,t.object.updateProjectionMatrix(),p=!0}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),t.enableZoom=!1}function J(D){m.set(D.clientX,D.clientY)}function ne(D){g.set(D.clientX,D.clientY)}function Ee(D){1==D.touches.length?m.set(D.touches[0].pageX,D.touches[0].pageY):m.set(.5*(D.touches[0].pageX+D.touches[1].pageX),.5*(D.touches[0].pageY+D.touches[1].pageY))}function Le(D){1==D.touches.length?g.set(D.touches[0].pageX,D.touches[0].pageY):g.set(.5*(D.touches[0].pageX+D.touches[1].pageX),.5*(D.touches[0].pageY+D.touches[1].pageY))}function Fe(D){const ge=t.domElement.getBoundingClientRect();b.set((D.touches[0].clientX+D.touches[1].clientX)/2-ge.left,(D.touches[0].clientY+D.touches[1].clientY)/2-ge.top).multiplyScalar(window.devicePixelRatio);var Se=D.touches[0].pageX-D.touches[1].pageX,Ie=D.touches[0].pageY-D.touches[1].pageY,Oe=Math.sqrt(Se*Se+Ie*Ie);T.set(0,Oe)}function B(D){1==D.touches.length?y.set(D.touches[0].pageX,D.touches[0].pageY):y.set(.5*(D.touches[0].pageX+D.touches[1].pageX),.5*(D.touches[0].pageY+D.touches[1].pageY)),v.subVectors(y,m).multiplyScalar(t.rotateSpeed);var Ie=t.domElement;S(2*Math.PI*v.x/Ie.clientHeight),P(2*Math.PI*v.y/Ie.clientHeight),m.copy(y)}function fe(D){1==D.touches.length?_.set(D.touches[0].pageX,D.touches[0].pageY):_.set(.5*(D.touches[0].pageX+D.touches[1].pageX),.5*(D.touches[0].pageY+D.touches[1].pageY)),x.subVectors(_,g).multiplyScalar(t.panSpeed*window.devicePixelRatio),U(x.x,x.y),g.copy(_)}function se(D){var ge=D.touches[0].pageX-D.touches[1].pageX,Se=D.touches[0].pageY-D.touches[1].pageY,Ie=Math.sqrt(ge*ge+Se*Se);E.set(0,Ie),M.set(0,E.y/T.y),G(M.y,b),T.copy(E)}function _e(D){if(!1!==t.enabled)switch(D.pointerType){case"mouse":case"pen":!function V(D){var ge;switch(D.preventDefault(),t.domElement.focus?t.domElement.focus():window.focus(),D.button){case 0:ge=t.mouseButtons.LEFT;break;case 1:ge=t.mouseButtons.MIDDLE;break;case 2:ge=t.mouseButtons.RIGHT;break;default:ge=-1}switch(ge){case 1:if(!1===t.enableZoom)return;(function Z(D){const ge=t.domElement.getBoundingClientRect();b.set(D.clientX-ge.left,D.clientY-ge.top),T.set(D.clientX,D.clientY)})(D),o=a.DOLLY;break;case 0:if(D.ctrlKey||D.metaKey||D.shiftKey){if(!1===t.enablePan)return;ne(D),o=a.PAN}else{if(!1===t.enableRotate)return;J(D),o=a.ROTATE}break;case 2:if(D.ctrlKey||D.metaKey||D.shiftKey){if(!1===t.enableRotate)return;J(D),o=a.ROTATE}else{if(!1===t.enablePan)return;ne(D),o=a.PAN}break;default:o=a.NONE}o!==a.NONE&&(t.domElement.ownerDocument.addEventListener("pointermove",R),t.domElement.ownerDocument.addEventListener("pointerup",C),t.dispatchEvent(s))}(D)}}function R(D){if(!1!==t.enabled)switch(D.pointerType){case"mouse":case"pen":!function ce(D){if(!1!==t.enabled)switch(D.preventDefault(),o){case a.ROTATE:if(!1===t.enableRotate)return;!function Y(D){y.set(D.clientX,D.clientY),v.subVectors(y,m).multiplyScalar(t.rotateSpeed);var ge=t.domElement;S(2*Math.PI*v.x/ge.clientHeight),P(2*Math.PI*v.y/ge.clientHeight),m.copy(y),t.update()}(D);break;case a.DOLLY:if(!1===t.enableZoom)return;!function he(D){E.set(D.clientX,D.clientY),M.subVectors(E,T),M.y>0?G(I(!0),b):M.y<0&&ee(I(!0),b),T.copy(E),t.update()}(D);break;case a.PAN:if(!1===t.enablePan)return;!function Ce(D){_.set(D.clientX,D.clientY),x.subVectors(_,g).multiplyScalar(t.panSpeed*window.devicePixelRatio),U(x.x,x.y),g.copy(_),t.update()}(D)}}(D)}}function C(D){switch(D.pointerType){case"mouse":case"pen":!function le(){t.domElement.ownerDocument.removeEventListener("pointermove",R),t.domElement.ownerDocument.removeEventListener("pointerup",C),!1!==t.enabled&&(t.dispatchEvent(r),o=a.NONE)}()}}function oe(D){!1===t.enabled||!1===t.enableZoom||o!==a.NONE&&o!==a.ROTATE||(D.preventDefault(),D.stopPropagation(),t.dispatchEvent(s),function ae(D){const ge=t.domElement.getBoundingClientRect(),Se=new H((D.clientX-ge.left)*window.devicePixelRatio,(D.clientY-ge.top)*window.devicePixelRatio);D.deltaY<0?ee(I(),Se):D.deltaY>0&&G(I(),Se),t.update()}(D),t.dispatchEvent(r))}function De(D){!1===t.enabled||!1===t.enablePan||function xe(D){var ge=!1;switch(D.keyCode){case t.keys.UP:U(0,t.keyPanSpeed),ge=!0;break;case t.keys.BOTTOM:U(0,-t.keyPanSpeed),ge=!0;break;case t.keys.LEFT:U(t.keyPanSpeed,0),ge=!0;break;case t.keys.RIGHT:U(-t.keyPanSpeed,0),ge=!0}ge&&(D.preventDefault(),t.update())}(D)}function ve(D){if(!1!==t.enabled){switch(D.preventDefault(),D.touches.length){case 1:switch(t.touches.ONE){case 0:if(!1===t.enableRotate)return;Ee(D),o=a.TOUCH_ROTATE;break;case 1:if(!1===t.enablePan)return;Le(D),o=a.TOUCH_PAN;break;default:o=a.NONE}break;case 2:switch(t.touches.TWO){case 2:if(!1===t.enableZoom&&!1===t.enablePan)return;(function tt(D){t.enableZoom&&Fe(D),t.enablePan&&Le(D)})(D),o=a.TOUCH_DOLLY_PAN;break;case 3:if(!1===t.enableZoom&&!1===t.enableRotate)return;(function He(D){t.enableZoom&&Fe(D),t.enableRotate&&Ee(D)})(D),o=a.TOUCH_DOLLY_ROTATE;break;default:o=a.NONE}break;default:o=a.NONE}o!==a.NONE&&t.dispatchEvent(s)}}function we(D){if(!1!==t.enabled)switch(D.preventDefault(),D.stopPropagation(),o){case a.TOUCH_ROTATE:if(!1===t.enableRotate)return;B(D),t.update();break;case a.TOUCH_PAN:if(!1===t.enablePan)return;fe(D),t.update();break;case a.TOUCH_DOLLY_PAN:if(!1===t.enableZoom&&!1===t.enablePan)return;(function ue(D){t.enableZoom&&se(D),t.enablePan&&fe(D)})(D),t.update();break;case a.TOUCH_DOLLY_ROTATE:if(!1===t.enableZoom&&!1===t.enableRotate)return;(function re(D){t.enableZoom&&se(D),t.enableRotate&&B(D)})(D),t.update();break;default:o=a.NONE}}function We(D){!1!==t.enabled&&(t.dispatchEvent(r),o=a.NONE)}function st(D){!1!==t.enabled&&D.preventDefault()}t.domElement.addEventListener("contextmenu",st),t.domElement.addEventListener("pointerdown",_e),t.domElement.addEventListener("wheel",oe),t.domElement.addEventListener("touchstart",ve),t.domElement.addEventListener("touchend",We),t.domElement.addEventListener("touchmove",we),this.update()};(Ta.prototype=Object.create(gn.prototype)).constructor=Ta;const C4=function(i,e){Ta.call(this,i,e),this.screenSpacePanning=!1,this.mouseButtons.LEFT=2,this.mouseButtons.RIGHT=0,this.touches.ONE=1,this.touches.TWO=3};(C4.prototype=Object.create(gn.prototype)).constructor=C4;const L1=Object.freeze({INFO:"info",WARN:"warn",ERROR:"error"});class yr{constructor(e,t=null){if(this.domContainer=e,this.options=Object.create(yr.DefaultOptions),t&&Object.assign(this.options,t),t=this.options,this.clearColor=this.options.clearColor.getHex(),this.scene=new Vc,this.ownsRenderer=!t.renderer,this.renderer=t.renderer,!this.renderer)try{this.renderer=new Hc({alpha:t.canvasAlpha,premultipliedAlpha:t.canvasPremultipliedAlpha,antialias:t.antialias,depth:!1,preserveDrawingBuffer:t.preserveDrawingBuffer})}catch(r){return console.log("Failed to create renderer: "+r),void(this.renderer=null)}const n=this.renderer;n.sortObjects=!1,n.setPixelRatio(window.devicePixelRatio);const s=this.camera=new xo(-1,1,1,-1,.1,2);s.position.z=1,s.position.x=0,s.position.y=0,this.simpleColorMaterial=[],this.simplePointMaterial=[];for(let r=0;r<M0.MAX;r++)this.simpleColorMaterial[r]=this._CreateSimpleColorMaterial(r),this.simplePointMaterial[r]=this._CreateSimplePointMaterial(r);n.setClearColor(t.clearColor,t.clearAlpha),t.autoResize?(this.canvasWidth=e.clientWidth,this.canvasHeight=e.clientHeight,e.style.position="relative"):(this.canvasWidth=t.canvasWidth,this.canvasHeight=t.canvasHeight,this.resizeObserver=null),n.setSize(this.canvasWidth,this.canvasHeight),this.canvas=n.domElement,e.style.display="block",t.autoResize&&(this.canvas.style.position="absolute",this.resizeObserver=new ResizeObserver(r=>this._OnResize(r[0])),this.resizeObserver.observe(e)),e.appendChild(this.canvas),this.canvas.addEventListener("pointerdown",this._OnPointerEvent.bind(this)),this.canvas.addEventListener("pointerup",this._OnPointerEvent.bind(this)),this.Render(),this.materials=new aa((r,a)=>r.key.Compare(a.key)),this.layers=new Map,this.defaultLayer=null,this.blocks=new Map,this.worker=null}HasRenderer(){return!!this.renderer}GetRenderer(){return this.renderer}GetCanvas(){return this.canvas}GetDxf(){return this.parsedDxf}SetSize(e,t){this._EnsureRenderer();const n=e/this.canvasWidth,s=t/this.canvasHeight,r=this.camera,a=(r.left+r.right)/2,o=(r.bottom+r.top)/2,l=r.right-r.left,c=r.top-r.bottom;r.left=a-n*l/2,r.right=a+n*l/2,r.bottom=o-s*c/2,r.top=o+s*c/2,r.updateProjectionMatrix(),this.canvasWidth=e,this.canvasHeight=t,this.renderer.setSize(e,t),this.controls&&this.controls.update(),this._Emit("resized",{width:e,height:t}),this._Emit("viewChanged"),this.Render()}Load(e){var t=this;return(0,pt.A)(function*({url:n,fonts:s=null,progressCbk:r=null,workerFactory:a=null}){if(null==n)throw new Error("`url` parameter is not specified");t._EnsureRenderer(),t.Clear(),t.worker=new Tu(a?a():null);const{scene:o,dxf:l}=yield t.worker.Load(n,s,t.options,r);yield t.worker.Destroy(),t.worker=null,t.parsedDxf=l,t.origin=o.origin,t.bounds=o.bounds,t.hasMissingChars=o.hasMissingChars;for(const c of o.layers)t.layers.set(c.name,new Cu(c.name,c.displayName,c.color));t.defaultLayer=t.layers.get("0")??new Cu("0","0",0);for(const c of o.batches)if(null!==c.key.blockName&&c.key.geometryType!==et.GeometryType.BLOCK_INSTANCE&&c.key.geometryType!==et.GeometryType.POINT_INSTANCE){let u=t.blocks.get(c.key.blockName);u||(u=new ZS,t.blocks.set(c.key.blockName,u)),u.PushBatch(new Au(t,o,c))}console.log(`DXF scene:\n ${o.batches.length} batches,\n ${t.layers.size} layers,\n ${t.blocks.size} blocks,\n vertices ${o.vertices.byteLength} B,\n indices ${o.indices.byteLength} B\n transforms ${o.transforms.byteLength} B`);for(const c of o.batches)t._LoadBatch(o,c);t._Emit("loaded"),o.bounds?t.FitView(o.bounds.minX-o.origin.x,o.bounds.maxX-o.origin.x,o.bounds.minY-o.origin.y,o.bounds.maxY-o.origin.y):t._Message("Empty document",L1.WARN),t.hasMissingChars&&t._Message("Some characters cannot be properly displayed due to missing fonts",L1.WARN),t._CreateControls(),t.Render()}).apply(this,arguments)}Render(){this._EnsureRenderer(),this.renderer.render(this.scene,this.camera)}GetLayers(e=!1){const t=[];for(const n of this.layers.values())e&&0==n.objects.length||t.push({name:n.name,displayName:n.displayName,color:this._TransformColor(n.color)});return t}ShowLayer(e,t){this._EnsureRenderer();const n=this.layers.get(e);if(n){for(const s of n.objects)s.visible=t;this.Render()}}Clear(){this._EnsureRenderer(),this.worker&&(this.worker.Destroy(!0),this.worker=null),this.controls&&(this.controls.dispose(),this.controls=null),this.scene.clear();for(const e of this.layers.values())e.Dispose();this.layers.clear(),this.blocks.clear(),this.materials.each(e=>e.material.dispose()),this.materials.clear(),this.SetView({x:0,y:0},2),this._Emit("cleared"),this.Render()}Destroy(){if(this.HasRenderer()){this.resizeObserver&&this.resizeObserver.disconnect(),this.Clear(),this._Emit("destroyed");for(const e of this.simplePointMaterial)e.dispose();for(const e of this.simpleColorMaterial)e.dispose();this.simplePointMaterial=null,this.simpleColorMaterial=null,this.ownsRenderer&&this.renderer.dispose(),this.renderer=null}}SetView(e,t){const s=t/(this.canvasWidth/this.canvasHeight),r=this.camera;r.left=-t/2,r.right=t/2,r.top=s/2,r.bottom=-s/2,r.zoom=1,r.position.set(e.x,e.y,1),r.rotation.set(0,0,0),r.updateMatrix(),r.updateProjectionMatrix(),this.controls&&(this.controls.target.set(r.position.x,r.position.y,0),this.controls.update()),this._Emit("viewChanged")}FitView(e,t,n,s,r=.1){const a=this.canvasWidth/this.canvasHeight;let o=t-e;const l=s-n,c={x:e+o/2,y:n+l/2};l*a>o&&(o=l*a),o<=2*Number.MIN_VALUE&&(o=1),this.SetView(c,o*(1+r))}GetScene(){return this.scene}GetCamera(){return this.camera}GetOrigin(){return this.origin}GetBounds(){return this.bounds}Subscribe(e,t){this._EnsureRenderer(),this.canvas.addEventListener(P4+e,t)}Unsubscribe(e,t){this._EnsureRenderer(),this.canvas.removeEventListener(P4+e,t)}_EnsureRenderer(){if(!this.HasRenderer())throw new Error("WebGL renderer not available. Probable WebGL context loss, try refreshing the page.")}_CreateControls(){this.controls&&this.controls.dispose();const e=this.controls=new Ta(this.camera,this.canvas);e.enableRotate=!1,e.mouseButtons={LEFT:2,MIDDLE:1},e.touches={ONE:1,TWO:2},e.zoomSpeed=3,e.mouseZoomSpeedFactor=.05,e.target=new F(this.camera.position.x,this.camera.position.y,0),e.addEventListener("change",()=>{this.Render(),this._Emit("viewChanged")}),e.update()}_Emit(e,t=null){this.canvas.dispatchEvent(new CustomEvent(P4+e,{detail:t}))}_Message(e,t=L1.INFO){this._Emit("message",{message:e,level:t})}_OnPointerEvent(e){const t=e.target.getBoundingClientRect(),n={x:e.clientX-t.left,y:e.clientY-t.top};this._Emit(e.type,{domEvent:e,canvasCoord:n,position:this._CanvasToSceneCoord(n.x,n.y)})}_CanvasToSceneCoord(e,t){const n=new F(2*e/this.canvasWidth-1,2*-t/this.canvasHeight+1,1).unproject(this.camera);return{x:n.x,y:n.y}}_OnResize(e){this.SetSize(Math.floor(e.contentRect.width),Math.floor(e.contentRect.height))}_LoadBatch(e,t){if(null!==t.key.blockName&&t.key.geometryType!==et.GeometryType.BLOCK_INSTANCE&&t.key.geometryType!==et.GeometryType.POINT_INSTANCE)return;const n=new Au(this,e,t).CreateObjects();for(const s of n)this.scene.add(s),(s._dxfViewerLayer??this.defaultLayer).PushObject(s)}_GetSimpleColorMaterial(e,t=M0.NONE){const n=new wu(t,null,e,0);let s=this.materials.find({key:n});return null!==s||(s={key:n,material:this._CreateSimpleColorMaterialInstance(e,t)},this.materials.insert(s)),s.material}_CreateSimpleColorMaterial(e=M0.NONE){const t=this._GenerateShaders(e,!1);return new ml({uniforms:{color:{value:new be(16711935)}},vertexShader:t.vertex,fragmentShader:t.fragment,depthTest:!1,depthWrite:!1,glslVersion:qa,side:2})}_CreateSimpleColorMaterialInstance(e,t=M0.NONE){const s=this.simpleColorMaterial[t].clone();return s.uniforms.color={value:new be(e)},s}_GetSimplePointMaterial(e,t=M0.NONE){const n=new wu(t,et.GeometryType.POINTS,e,0);let s=this.materials.find({key:n});return null!==s||(s={key:n,material:this._CreateSimplePointMaterialInstance(e,this.options.pointSize,t)},this.materials.insert(s)),s.material}_CreateSimplePointMaterial(e=M0.NONE){const t=this._GenerateShaders(e,!0);return new ml({uniforms:{color:{value:new be(16711935)},pointSize:{value:2}},vertexShader:t.vertex,fragmentShader:t.fragment,depthTest:!1,depthWrite:!1,glslVersion:qa})}_CreateSimplePointMaterialInstance(e,t=2,n=M0.NONE){const r=this.simplePointMaterial[n].clone();return r.uniforms.color={value:new be(e)},r.uniforms.size={value:t},r}_GenerateShaders(e,t){return{vertex:`\n\n precision highp float;\n precision highp int;\n in vec2 position;\n ${e===M0.FULL?"\n /* First row. */\n in vec3 instanceTransform0;\n /* Second row. */\n in vec3 instanceTransform1;\n ":""}\n ${e===M0.POINT?"\n in vec2 instanceTransform;\n ":""}\n uniform mat4 modelViewMatrix;\n uniform mat4 projectionMatrix;\n ${t?"uniform float pointSize;":""}\n\n void main() {\n vec4 pos = vec4(position, 0.0, 1.0);\n ${e===M0.FULL?"\n pos.xy = mat2(instanceTransform0[0], instanceTransform1[0],\n instanceTransform0[1], instanceTransform1[1]) * pos.xy +\n vec2(instanceTransform0[2], instanceTransform1[2]);\n ":""}\n ${e===M0.POINT?"\n pos.xy += instanceTransform;\n ":""}\n gl_Position = projectionMatrix * modelViewMatrix * pos;\n ${t?"gl_PointSize = pointSize;":""}\n }\n `,fragment:"\n\n precision highp float;\n precision highp int;\n uniform vec3 color;\n out vec4 fragColor;\n\n void main() {\n fragColor = vec4(color, 1.0);\n }\n "}}_TransformColor(e){if(!this.options.colorCorrection&&!this.options.blackWhiteInversion)return e;const t=I1(this.clearColor);if(16777215===e&&t>=.8)return 0;if(0===e&&t<=.2)return 16777215;if(!this.options.colorCorrection)return e;const n=I1(e),r=function JS(i,e){return(I1(i)+.05)/(I1(e)+.05)}(e,this.clearColor);if((r>=1?r:1/r)<1.5){let o;o=t>.5?t/2:2*t,e=o>n?function KS(i,e){const t=Ru(i);return t.l*=e,t.l>1&&(t.l=1),Pu(t)}(e,o/n):function $S(i,e){const t=Ru(i);return t.l/=e,Pu(t)}(e,n/o)}return e}}yr.MessageLevel=L1,yr.DefaultOptions={canvasWidth:400,canvasHeight:300,autoResize:!1,clearColor:new be("#000"),clearAlpha:1,canvasAlpha:!1,canvasPremultipliedAlpha:!0,antialias:!0,colorCorrection:!1,blackWhiteInversion:!0,pointSize:2,sceneOptions:fa.DefaultOptions,retainParsedDxf:!1,preserveDrawingBuffer:!1,fileEncoding:"utf-8",renderer:void 0},yr.SetupWorker=function(){new Tu(self,!0)};const M0=Object.freeze({NONE:0,FULL:1,POINT:2,MAX:3});class Au{constructor(e,t,n){if(this.viewer=e,this.key=n.key,n.hasOwnProperty("verticesOffset")){const s=new Float32Array(t.vertices,n.verticesOffset*Float32Array.BYTES_PER_ELEMENT,n.verticesSize);(this.key.geometryType!==et.GeometryType.POINT_INSTANCE||t.pointShapeHasDot)&&(this.vertices=new vt(s,2)),this.key.geometryType===et.GeometryType.POINT_INSTANCE&&(this.transforms=new er(s,2))}if(n.hasOwnProperty("chunks")){this.chunks=[];for(const s of n.chunks){const r=new Float32Array(t.vertices,s.verticesOffset*Float32Array.BYTES_PER_ELEMENT,s.verticesSize),a=new Uint16Array(t.indices,s.indicesOffset*Uint16Array.BYTES_PER_ELEMENT,s.indicesSize);this.chunks.push({vertices:new vt(r,2),indices:new vt(a,1)})}}if(n.hasOwnProperty("transformsOffset")){const s=new Float32Array(t.transforms,n.transformsOffset*Float32Array.BYTES_PER_ELEMENT,n.transformsSize),r=new Wg(s,6);this.transforms0=new ui(r,3,0),this.transforms1=new ui(r,3,3)}this.layer=null!==this.key.layerName?this.viewer.layers.get(this.key.layerName):null}GetInstanceType(){switch(this.key.geometryType){case et.GeometryType.BLOCK_INSTANCE:return M0.FULL;case et.GeometryType.POINT_INSTANCE:return M0.POINT;default:return M0.NONE}}*CreateObjects(e=null){if(this.key.geometryType!==et.GeometryType.BLOCK_INSTANCE&&this.key.geometryType!==et.GeometryType.POINT_INSTANCE)yield*this._CreateObjects(e);else{if(null!==e)throw new Error("Unexpected instance batch specified for instance batch");yield*this._CreateBlockInstanceObjects()}}*_CreateObjects(e){const t=e?e._GetInstanceColor(this):this.key.color,n=e?.layer??this.layer,r=(this.key.geometryType===et.GeometryType.POINTS||this.key.geometryType===et.GeometryType.POINT_INSTANCE?this.viewer._GetSimplePointMaterial:this.viewer._GetSimpleColorMaterial).call(this.viewer,this.viewer._TransformColor(t),e?.GetInstanceType()??M0.NONE);let a;switch(this.key.geometryType){case et.GeometryType.POINTS:case et.GeometryType.POINT_INSTANCE:a=d3;break;case et.GeometryType.LINES:case et.GeometryType.INDEXED_LINES:a=_n;break;case et.GeometryType.TRIANGLES:case et.GeometryType.INDEXED_TRIANGLES:a=$t;break;default:throw new Error("Unexpected geometry type:"+this.key.geometryType)}function o(l,c){const u=e?new B3:new ct;u.setAttribute("position",l),e?._SetInstanceTransformAttribute(u),c&&u.setIndex(c);const f=new a(u,r);return f.frustumCulled=!1,f.matrixAutoUpdate=!1,f._dxfViewerLayer=n,f}if(this.chunks)for(const l of this.chunks)yield o(l.vertices,l.indices);else yield o(this.vertices)}_SetInstanceTransformAttribute(e){if(!e.isInstancedBufferGeometry)throw new Error("InstancedBufferGeometry expected");this.key.geometryType===et.GeometryType.POINT_INSTANCE?e.setAttribute("instanceTransform",this.transforms):(e.setAttribute("instanceTransform0",this.transforms0),e.setAttribute("instanceTransform1",this.transforms1))}*_CreateBlockInstanceObjects(){const e=this.viewer.blocks.get(this.key.blockName);if(e){for(const t of e.batches)yield*t.CreateObjects(this);this.vertices&&(yield*this._CreateObjects())}}_GetInstanceColor(e){const t=e.key.color;return t===J0.BY_BLOCK?this.key.color:t===J0.BY_LAYER?e.layer?e.layer.color:this.layer?this.layer.color:0:t}}class Cu{constructor(e,t,n){this.name=e,this.displayName=t,this.color=n,this.objects=[]}PushObject(e){this.objects.push(e)}Dispose(){for(const e of this.objects)e.geometry.dispose();this.objects=null}}class ZS{constructor(){this.batches=[]}PushBatch(e){this.batches.push(e)}}const P4="__dxf_";function xr(i){return i<=.03928?i/12.92:Math.pow((i+.055)/1.055,2.4)}function R4(i){return i<.003?12.92*i:1.055*Math.pow(i,1/2.4)-.055}function I1(i){return.2126*xr(((16711680&i)>>>16)/255)+.7152*xr(((65280&i)>>>8)/255)+.0722*xr((255&i)/255)}function Pu({h:i,l:e,s:t}){let n,s,r;if(0===t)n=s=r=e;else{let a=function(c,u,f){return f<0&&(f+=1),f>1&&(f-=1),f<1/6?c+6*(u-c)*f:f<.5?u:f<2/3?c+(u-c)*(2/3-f)*6:c};const o=e<.5?e*(1+t):e+t-e*t,l=2*e-o;n=a(l,o,i+1/3),s=a(l,o,i),r=a(l,o,i-1/3)}return Math.min(Math.floor(256*R4(n)),255)<<16|Math.min(Math.floor(256*R4(s)),255)<<8|Math.min(Math.floor(256*R4(r)),255)}function Ru(i){const e=xr(((16711680&i)>>>16)/255),t=xr(((65280&i)>>>8)/255),n=xr((255&i)/255),s=Math.max(e,t,n),r=Math.min(e,t,n);let a,o;const l=(s+r)/2;if(s===r)a=o=0;else{const c=s-r;switch(o=l>.5?c/(2-s-r):c/(s+r),s){case e:a=(t-n)/c+(t<n?6:0);break;case t:a=(n-e)/c+2;break;case n:a=(e-t)/c+4}a/=6}return{h:a,l,s:o}}var z0=dt(4701);let L4=(()=>{class i{_dxf;_pressTime;_pressTimer;_shortPressDuration=300;_longPressDuration=1e3;_emittedLongPress=!1;modelLoaded=(0,ie.vPA)(!1);drawingClicked=(0,ie.vPA)(void 0);drawingLongClicked=(0,ie.vPA)(void 0);viewChanged=(0,ie.vPA)(void 0);init(t){this._dxf=t,t.Subscribe("loaded",()=>this.modelLoaded.set(!0)),t.Subscribe("pointerdown",n=>{void 0===this._pressTime&&(this._pressTime=(new Date).getTime(),this._pressTimer=setTimeout(()=>{this._handleLongPress(n),this._emittedLongPress=!0,clearTimeout(this._pressTimer)},this._longPressDuration))}),t.Subscribe("pointerup",n=>{void 0!==this._pressTime&&(clearTimeout(this._pressTimer),(new Date).getTime()-this._pressTime<this._shortPressDuration&&!this._emittedLongPress&&this._handleShortPress(n),this._reset())}),t.Subscribe("viewChanged",()=>{this.viewChanged.set((new Date).getTime())})}destroy(){this._dxf?.Unsubscribe("loaded",()=>{}),this._dxf?.Unsubscribe("pointerdown",()=>{}),this._dxf?.Unsubscribe("pointerup",()=>{}),this._dxf?.Unsubscribe("viewChanged",()=>{})}_handleShortPress(t){this.drawingClicked.set(this._processKeyPress(t))}_handleLongPress(t){this.drawingLongClicked.set(this._processKeyPress(t))}_reset(){this._pressTime=void 0,this._emittedLongPress=!1}_processKeyPress(t){const n=t.detail.position,s=this._dxf?.GetOrigin()??new z0.I9Y(0,0);return{...t.detail,origin:s,absolutePosition:{x:n.x+s.x,y:n.y+s.y}}}static \u0275fac=function(n){return new(n||i)};static \u0275prov=ie.jDH({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();class QS extends z0.B69{constructor(e=document.createElement("div")){super(),this.isCSS2DObject=!0,this.element=e,this.element.style.position="absolute",this.element.style.userSelect="none",this.element.setAttribute("draggable",!1),this.center=new z0.I9Y(.5,.5),this.addEventListener("removed",function(){this.traverse(function(t){t.element&&t.element instanceof t.element.ownerDocument.defaultView.Element&&null!==t.element.parentNode&&t.element.remove()})})}copy(e,t){return super.copy(e,t),this.element=e.element.cloneNode(!0),this.center=e.center,this}}const _r=new z0.Pq0,Lu=new z0.kn4,Iu=new z0.kn4,Du=new z0.Pq0,Fu=new z0.Pq0;class Ou{constructor(e={}){const t=this;let n,s,r,a;const o={objects:new WeakMap},l=void 0!==e.element?e.element:document.createElement("div");function c(m){m.isCSS2DObject&&(m.element.style.display="none");for(let y=0,v=m.children.length;y<v;y++)c(m.children[y])}function u(m,y,v){if(!1!==m.visible){if(m.isCSS2DObject){_r.setFromMatrixPosition(m.matrixWorld),_r.applyMatrix4(Iu);const g=_r.z>=-1&&_r.z<=1&&!0===m.layers.test(v.layers),_=m.element;_.style.display=!0===g?"":"none",!0===g&&(m.onBeforeRender(t,y,v),_.style.transform="translate("+-100*m.center.x+"%,"+-100*m.center.y+"%)translate("+(_r.x*r+r)+"px,"+(-_r.y*a+a)+"px)",_.parentNode!==l&&l.appendChild(_),m.onAfterRender(t,y,v));const x={distanceToCameraSquared:f(v,m)};o.objects.set(m,x)}for(let g=0,_=m.children.length;g<_;g++)u(m.children[g],y,v)}else c(m)}function f(m,y){return Du.setFromMatrixPosition(m.matrixWorld),Fu.setFromMatrixPosition(y.matrixWorld),Du.distanceToSquared(Fu)}l.style.overflow="hidden",this.domElement=l,this.sortObjects=!0,this.getSize=function(){return{width:n,height:s}},this.render=function(m,y){!0===m.matrixWorldAutoUpdate&&m.updateMatrixWorld(),null===y.parent&&!0===y.matrixWorldAutoUpdate&&y.updateMatrixWorld(),Lu.copy(y.matrixWorldInverse),Iu.multiplyMatrices(y.projectionMatrix,Lu),u(m,m,y),this.sortObjects&&function p(m){const y=function d(m){const y=[];return m.traverseVisible(function(v){v.isCSS2DObject&&y.push(v)}),y}(m).sort(function(g,_){return g.renderOrder!==_.renderOrder?_.renderOrder-g.renderOrder:o.objects.get(g).distanceToCameraSquared-o.objects.get(_).distanceToCameraSquared}),v=y.length;for(let g=0,_=y.length;g<_;g++)y[g].element.style.zIndex=v-g}(m)},this.setSize=function(m,y){n=m,s=y,r=n/2,a=s/2,l.style.width=m+"px",l.style.height=y+"px"}}}let I4=(()=>{class i{_dxf;_canvas;_scene=new z0.Z58;_camera=new z0.i7d;_labelRenderer=new Ou;_loadedAnnotations=[];clickedBox=(0,ie.vPA)(void 0);ngOnDestroy(){this._loadedAnnotations=[],this._labelRenderer=new Ou}init(t,n){this._dxf=t,this._canvas=n,this._scene=t.GetScene(),this._camera=t.GetCamera(),this._buildLabelRenderer(),this._initEventListeners()}addAnnotations(t){t.forEach(n=>{const s=document.createElement("div");s.innerHTML="I'm an annotation",console.warn("Should show a proper marker!");const r=new QS(s);this._scene?.add(r),this._loadedAnnotations.push({overlayObject:r,div:s,coordinate:n.coordinate})}),this._updateOverlayPositions()}dispose(){this._loadedAnnotations=[]}_buildLabelRenderer(){if(void 0===this._canvas)throw new Error("Canvas not set");this._labelRenderer.setSize(this._canvas.clientWidth,this._canvas.clientHeight),this._labelRenderer.domElement.className="label-renderer",this._labelRenderer.domElement.style.position="absolute",this._labelRenderer.domElement.style.top="0px",this._labelRenderer.domElement.style.pointerEvents="none",this._canvas.appendChild(this._labelRenderer.domElement),this._labelRenderer.render(this._scene,this._camera)}_onWindowResize(){void 0!==this._canvas&&this._labelRenderer.setSize(this._canvas.clientWidth,this._canvas.clientHeight)}_handleViewChange(){this._updateOverlayPositions()}_updateOverlayPositions(){const t=this._dxf?.GetOrigin()??new z0.I9Y(0,0);this._loadedAnnotations.forEach(n=>{n.overlayObject.position.set(n.coordinate.x-t.x,n.coordinate.y-t.y,0)}),this._render()}_render(){this._labelRenderer.render(this._scene,this._camera)}_initEventListeners(){window.addEventListener("resize",this._onWindowResize),this._dxf?.Subscribe("viewChanged",()=>this._handleViewChange())}static \u0275fac=function(n){return new(n||i)};static \u0275prov=ie.jDH({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})(),D4=(()=>{class i{_events=(0,ie.WQX)(L4);_annotationService=(0,ie.WQX)(I4);_viewerOptions=new Kn.lH;_canvas;_dxfViewer;_loadedFiles=[];destroy(){console.warn("NB! Make sure memory is released properly!"),this._loadedFiles=[]}set viewerOptions(t){this._viewerOptions=t}set canvas(t){this._canvas=t}dispose(){this._dxfViewer?.Clear()}get parsedDxf(){return this._dxfViewer?.parsedDxf}buildViewer(){var t=this;return(0,pt.A)(function*(){if(void 0!==t._canvas)return t._dxfViewer||(t._dxfViewer=new yr(t._canvas,t._viewerOptions),t._events.init(t._dxfViewer),t._annotationService.init(t._dxfViewer,t._canvas)),t._dxfViewer;console.error("Canvas not set")})()}resize(t){null!=this._dxfViewer&&(this._dxfViewer.SetSize(t.width,t.height),this._dxfViewer.Render())}zoomFit(){if(null==this._dxfViewer)return;const t=this._dxfViewer.GetBounds();if(!t)return;const{maxX:n,maxY:s,minX:r,minY:a}=t,o=this._dxfViewer.GetOrigin()??new z0.I9Y(0,0);this._dxfViewer.FitView(r-o.x,n-o.x,a-o.y,s-o.y,0),this._dxfViewer.Render()}setDarkBackground(t){var n=this;return(0,pt.A)(function*(){n._viewerOptions.clearAlpha=t?1:0,n._viewerOptions.clearColor.set(t?2105376:16777215),n._dxfViewer&&n._dxfViewer.renderer&&(n._dxfViewer.renderer.setClearColor(t?2105376:16777215,t?1:0),n._dxfViewer.Render())})()}zoomIn(){this._zoom(1.2)}zoomOut(){this._zoom(.8)}flyTo(t){if(null==this._dxfViewer)return;const n=this._dxfViewer.GetOrigin()??new z0.I9Y(0,0),s=t.x-n.x,a=t.y-n.y;this._dxfViewer.FitView(s,s+t.w,a,a+t.h,0),this._dxfViewer.Render()}getLayers(){if(null==this._dxfViewer)return[];const t=[];for(const n of this._dxfViewer.GetLayers()){const s={name:n.name,displayName:n.displayName,color:this._getCssColor(n.color),checked:!0,toggleCheck:()=>{s.checked=!s.checked,this._dxfViewer?.ShowLayer(s.name,s.checked)}};t.push(s)}return t}load(t,n,s){var r=this;return(0,pt.A)(function*(){null!=r._dxfViewer&&(r._viewerOptions.retainParsedDxf=!0,Object.assign(r._dxfViewer.options,r._viewerOptions),console.log("DXFViewerService load() options:",r._dxfViewer.options.retainParsedDxf,r._viewerOptions.retainParsedDxf),yield r._dxfViewer.Load({url:t,fonts:n,progressCbk:s?.bind(r),workerFactory:null}),r._loadedFiles.push({url:t,fonts:n}))})()}_zoom(t){if(null==this._dxfViewer)return;const n=this._dxfViewer.GetCamera();n.zoom=n.zoom*t,n.updateProjectionMatrix(),this._dxfViewer.Render()}_getCssColor(t){if(void 0===t)return"red";let n=t.toString(16);for(;n.length<6;)n="0"+n;return"#"+n}static \u0275fac=function(n){return new(n||i)};static \u0275prov=ie.jDH({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();var Nu=dt(6034),F4=dt(2245),ku=dt(932),O4=dt(5381),A=dt(5547);const jS=(i,e)=>e.category;function eM(i,e){if(1&i){const t=A.RV6();A.j41(0,"cue-flexcontainer",1)(1,"cue-checkbox",2),A.bIt("checkedChange",function(){ie.eBV(t);const s=A.XpG();return ie.Njj(s.toggleAll())}),A.k0s()()}if(2&i){const t=A.XpG();A.R7$(),A.Y8G("checked",t.allVisible())}}function tM(i,e){if(1&i&&(A.j41(0,"cue-typography",3),A.EFF(1),A.k0s()),2&i){const t=A.XpG().$implicit;A.R7$(),A.JRh(t.category)}}function nM(i,e){if(1&i){const t=A.RV6();A.j41(0,"cue-flexcontainer",1)(1,"cue-checkbox",4),A.bIt("checkedChange",function(){const s=ie.eBV(t).$implicit,r=A.XpG(2);return ie.Njj(r.toggleSingle(s))}),A.k0s(),A.j41(2,"cue-typography",5),A.bIt("click",function(){const s=ie.eBV(t).$implicit,r=A.XpG(2);return ie.Njj(r.toggleSingle(s))}),A.EFF(3),A.k0s()()}if(2&i){const t=e.$implicit;A.R7$(),A.Y8G("checked",t.visible)("color",t.color),A.R7$(2),A.JRh(t.label)}}function iM(i,e){if(1&i&&(A.nVh(0,tM,2,1,"cue-typography",3),A.Z7z(1,nM,4,3,"cue-flexcontainer",1,A.Vm6)),2&i){const t=e.$implicit;A.vxM(t.category?0:-1),A.R7$(),A.Dyx(t.items)}}let sM=(()=>{class i{layers=(0,ke.geq)([]);visibilityChange=(0,ke.CGW)();layerChange=(0,ke.CGW)();visibilityAll=(0,ke.CGW)();showCheckAll=(0,Lt.EW)(()=>this.layers().length>1);allVisible=(0,Lt.EW)(()=>this.layers().every(t=>t.visible));groupedLayers=(0,Lt.EW)(()=>{const t=[];for(const n of this.layers()){const s=n.category,r=t.find(a=>a.category===s);r?r.items.push(n):t.push({category:s,items:[n]})}return t});toggleAll(){const t=this.allVisible(),n=this.layers().map(s=>(s.visible=!t,s));this.layers.update(()=>[...n]),this.visibilityAll.emit(t),this.emitChange()}toggleSingle(t){t.visible=!t.visible,this.layerChange.emit(t),this.layers.update(()=>[...this.layers()]),this.emitChange()}emitChange(){this.visibilityChange.emit(this.layers())}static \u0275fac=function(n){return new(n||i)};static \u0275cmp=A.VBU({type:i,selectors:[["cue-layer-legend"]],inputs:{layers:[1,"layers"]},outputs:{layers:"layersChange",visibilityChange:"visibilityChange",layerChange:"layerChange",visibilityAll:"visibilityAll"},decls:4,vars:1,consts:[["direction","column"],["align","center","justify","start",2,"width","100%"],["size","s",3,"checkedChange","checked"],["variant","label",2,"margin-top","4px","opacity","0.6"],["size","s",3,"checkedChange","checked","color"],[2,"cursor","pointer",3,"click"]],template:function(n,s){1&n&&(A.j41(0,"cue-flexcontainer",0),A.nVh(1,eM,2,1,"cue-flexcontainer",1),A.Z7z(2,iM,3,1,null,null,jS),A.k0s()),2&n&&(A.R7$(),A.vxM(s.showCheckAll()?1:-1),A.R7$(),A.Dyx(s.groupedLayers()))},dependencies:[O4.n,F4.o,ku.S],encapsulation:2,changeDetection:0})}return i})(),rM=(()=>{class i{title=(0,ke.hFB)("Legend");layers=(0,ke.hFB)([]);position=(0,ke.hFB)("top-left");close=(0,ke.CGW)();visibilityChange=(0,ke.CGW)();layerChange=(0,ke.CGW)();visibilityAll=(0,ke.CGW)();static \u0275fac=function(n){return new(n||i)};static \u0275cmp=A.VBU({type:i,selectors:[["cue-color-legend-panel"]],inputs:{title:[1,"title"],layers:[1,"layers"],position:[1,"position"]},outputs:{close:"close",visibilityChange:"visibilityChange",layerChange:"layerChange",visibilityAll:"visibilityAll"},decls:3,vars:4,consts:[[3,"clickedClose","label","padded","position"],[1,"content"],[3,"visibilityAll","layerChange","visibilityChange","layers"]],template:function(n,s){1&n&&(A.j41(0,"cue-draggable-card",0),A.bIt("clickedClose",function(){return s.close.emit()}),A.j41(1,"div",1)(2,"cue-layer-legend",2),A.bIt("visibilityAll",function(a){return s.visibilityAll.emit(a)})("layerChange",function(a){return s.layerChange.emit(a)})("visibilityChange",function(a){return s.visibilityChange.emit(a)}),A.k0s()()()),2&n&&(A.Y8G("label",s.title())("padded",!1)("position",s.position()),A.R7$(2),A.Y8G("layers",s.layers()))},dependencies:[Nu.y,sM],styles:[".content[_ngcontent-%COMP%]{padding-left:10px;padding-right:10px;margin-bottom:30px;font-size:.8em;max-height:200px;max-width:180px;overflow:auto}"]})}return i})(),Uu=(()=>{class i{layers=(0,ke.hFB)([]);close=(0,ke.CGW)();layerDefs=(0,Lt.EW)(()=>this.layers().map(t=>({label:t.displayName??t.name,color:t.color,visible:t.checked})));updateAll(t){t?this.layers().forEach(n=>{n.checked&&n.toggleCheck()}):this.layers().forEach(n=>{n.checked||n.toggleCheck()})}updateSingle(t){const n=this.layers().find(s=>(s.displayName??s.name)===t.label);n&&n.toggleCheck()}static \u0275fac=function(n){return new(n||i)};static \u0275cmp=A.VBU({type:i,selectors:[["cue-layers"]],inputs:{layers:[1,"layers"]},outputs:{close:"close"},decls:1,vars:1,consts:[["title","Drawing layers",3,"close","visibilityAll","layerChange","layers"]],template:function(n,s){1&n&&(A.j41(0,"cue-color-legend-panel",0),A.bIt("close",function(){return s.close.emit()})("visibilityAll",function(a){return s.updateAll(a)})("layerChange",function(a){return s.updateSingle(a)}),A.k0s()),2&n&&A.Y8G("layers",s.layerDefs())},dependencies:[Pi.MD,rM],encapsulation:2})}return i})();const aM=(i,e)=>e.name;function oM(i,e){if(1&i){const t=A.RV6();A.j41(0,"div",9),A.bIt("click",function(s){ie.eBV(t);const r=A.XpG().$index,a=A.XpG(3);return s.stopPropagation(),ie.Njj(a.toggleGeometries(r))}),A.j41(1,"cue-flexcontainer",3)(2,"cue-checkbox",10),A.bIt("checkedChange",function(){ie.eBV(t);const s=A.XpG().$index,r=A.XpG(3);return ie.Njj(r.toggleGeometries(s))}),A.k0s(),A.j41(3,"cue-typography"),A.EFF(4,"Geometries"),A.k0s()()()}if(2&i){const t=A.XpG().$implicit;A.R7$(2),A.Y8G("checked",!1!==t.geometriesVisible)}}function lM(i,e){if(1&i){const t=A.RV6();A.j41(0,"div",6),A.bIt("click",function(s){const r=ie.eBV(t).$index,a=A.XpG(3);return s.stopPropagation(),ie.Njj(a.toggleViewport(r))}),A.j41(1,"cue-flexcontainer",3)(2,"cue-checkbox",7),A.bIt("checkedChange",function(){const s=ie.eBV(t).$index,r=A.XpG(3);return ie.Njj(r.toggleViewport(s))}),A.k0s(),A.j41(3,"cue-typography"),A.EFF(4),A.k0s()()(),A.nVh(5,oM,5,1,"div",8)}if(2&i){const t=e.$implicit;A.R7$(2),A.Y8G("checked",!1!==t.visible)("color",t.color??"rgba(255, 0, 0, 0.8)"),A.R7$(2),A.JRh(t.label),A.R7$(),A.vxM(null!=t.modelGeometries&&t.modelGeometries.length?5:-1)}}function cM(i,e){if(1&i&&(A.j41(0,"div",5),A.Z7z(1,lM,6,4,null,null,A.Vm6),A.k0s()),2&i){const t=A.XpG(2);A.R7$(),A.Dyx(t.selectedLayout().viewports)}}function hM(i,e){if(1&i){const t=A.RV6();A.j41(0,"div",2),A.bIt("click",function(){const s=ie.eBV(t).$implicit,r=A.XpG();return ie.Njj(r.selectLayout(s))}),A.j41(1,"cue-flexcontainer",3)(2,"span",4),A.EFF(3),A.k0s()()(),A.nVh(4,cM,3,0,"div",5)}if(2&i){let t,n;const s=e.$implicit,r=A.XpG();A.AVh("selected",(null==(t=r.selectedLayout())?null:t.name)===s.name),A.R7$(3),A.JRh(s.name),A.R7$(),A.vxM((null==(n=r.selectedLayout())?null:n.name)===s.name?4:-1)}}let uM=(()=>{class i{layouts=(0,ke.hFB)([]);close=(0,ke.CGW)();layoutSelected=(0,ke.CGW)();selectedLayout=(0,ie.vPA)(null);selectLayout(t){if(this.selectedLayout()?.name===t.name)this.selectedLayout.set(null),this.layoutSelected.emit(null);else{const n={...t,viewports:t.viewports.map(s=>({...s,visible:s.visible??!0,geometriesVisible:s.geometriesVisible??!0}))};this.selectedLayout.set(n),this.layoutSelected.emit(n)}}toggleViewport(t){const n=this.selectedLayout();if(!n)return;const s={...n,viewports:n.viewports.map((r,a)=>a===t?{...r,visible:!r.visible}:{...r})};this.selectedLayout.set(s),this.layoutSelected.emit(s)}toggleGeometries(t){const n=this.selectedLayout();if(!n)return;const s={...n,viewports:n.viewports.map((r,a)=>a===t?{...r,geometriesVisible:!r.geometriesVisible}:{...r})};this.selectedLayout.set(s),this.layoutSelected.emit(s)}static \u0275fac=function(n){return new(n||i)};static \u0275cmp=A.VBU({type:i,selectors:[["cue-layouts"]],inputs:{layouts:[1,"layouts"]},outputs:{close:"close",layoutSelected:"layoutSelected"},decls:4,vars:1,consts:[[3,"clickedClose","padded"],[1,"content"],[1,"layout-item",3,"click"],["align","center","gap","s"],[1,"layout-name"],[1,"viewports-list"],[1,"viewport-item",3,"click"],["size","s",3,"checkedChange","checked","color"],[1,"geometry-item"],[1,"geometry-item",3,"click"],["size","s","color","#ffa8a8",3,"checkedChange","checked"]],template:function(n,s){1&n&&(A.j41(0,"cue-draggable-card",0),A.bIt("clickedClose",function(){return s.close.emit()}),A.j41(1,"div",1),A.Z7z(2,hM,5,4,null,null,aM),A.k0s()()),2&n&&(A.Y8G("padded",!1),A.R7$(2),A.Dyx(s.layouts()))},dependencies:[Nu.y,O4.n,F4.o,ku.S],styles:[".content[_ngcontent-%COMP%]{padding:10px;margin-bottom:10px;font-size:.8em;max-height:300px;overflow-y:auto}.layout-item[_ngcontent-%COMP%]{padding:6px 8px;border-radius:4px;cursor:pointer;transition:background-color .15s ease}.layout-item[_ngcontent-%COMP%]:hover{background-color:#0000000d}.layout-item.selected[_ngcontent-%COMP%]{background-color:#00000014;font-weight:500}.layout-name[_ngcontent-%COMP%]{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.viewports-list[_ngcontent-%COMP%]{padding-left:20px;margin-bottom:4px}.viewport-item[_ngcontent-%COMP%]{padding:4px 8px;border-radius:4px;cursor:pointer;transition:background-color .15s ease}.viewport-item[_ngcontent-%COMP%]:hover{background-color:#0000000d}.geometry-item[_ngcontent-%COMP%]{padding:4px 8px 4px 28px;border-radius:4px;cursor:pointer;transition:background-color .15s ease;font-size:.9em}.geometry-item[_ngcontent-%COMP%]:hover{background-color:#0000000d}.viewport-label[_ngcontent-%COMP%]{font-size:.9em;color:#000000b3}"]})}return i})(),dM=(()=>{class i{targetEl;renderer;displayLoading=(0,ke.hFB)(!1);loadingMessage=(0,ke.hFB)("");displayLoadingChanged=(0,ie.QZP)(()=>{this.setVisible(this.displayLoading())});hostPosition="relative";uid="";constructor(t,n){this.targetEl=t,this.renderer=n}ngOnInit(){const t=this.buildLoadingContainer();this.renderer.appendChild(this.targetEl.nativeElement,t)}setVisible(t){const s=this.targetEl.nativeElement.querySelector("."+this.uid);s&&this.renderer.setStyle(s,"display",t?"flex":"none")}buildLoadingContainer(){this.uid="loading-container-"+function fM(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(i){const e=16*Math.random()|0;return("x"==i?e:3&e|8).toString(16)})}();const t=this.renderer.createElement("div");this.renderer.setStyle(t,"display",this.displayLoading()?"flex":"none"),this.renderer.setStyle(t,"flex-direction","column"),this.renderer.setStyle(t,"z-index",1e3);const n=getComputedStyle(this.targetEl.nativeElement).getPropertyValue("border-radius");console.log(n),n&&this.renderer.setStyle(t,"border-radius",n);const s=document.createElement("style");s.textContent="\n .lds-facebook {\n display: inline-block;\n position: relative;\n width: 80px;\n height: 80px;\n }\n .lds-facebook div {\n display: inline-block;\n position: absolute;\n left: 8px;\n width: 16px;\n background: #000;\n animation: lds-facebook 1.2s cubic-bezier(0, 0.5, 0.5, 1) infinite;\n }\n .lds-facebook div:nth-child(1) {\n left: 8px;\n animation-delay: -0.24s;\n background: #fff;\n }\n .lds-facebook div:nth-child(2) {\n left: 32px;\n animation-delay: -0.12s;\n background: #fff;\n }\n .lds-facebook div:nth-child(3) {\n left: 56px;\n animation-delay: 0;\n background: #fff;\n }\n @keyframes lds-facebook {\n 0% {\n top: 8px;\n height: 64px;\n }\n 50%, 100% {\n top: 24px;\n height: 32px;\n }\n }\n ",document.head.appendChild(s),this.renderer.setStyle(t,"justify-content","center"),this.renderer.setStyle(t,"align-items","center"),this.renderer.addClass(t,this.uid),this.renderer.setStyle(t,"position","absolute"),this.renderer.setStyle(t,"top","0"),this.renderer.setStyle(t,"bottom","0"),this.renderer.setStyle(t,"left","0"),this.renderer.setStyle(t,"right","0"),this.renderer.setStyle(t,"border-radius","10px"),this.renderer.setStyle(t,"z-index","1000"),this.renderer.setStyle(t,"background-color","rgba(200,200,200,0.2)");const r=this.renderer.createElement("div");this.renderer.addClass(r,"lds-facebook");const a=this.renderer.createElement("div"),o=this.renderer.createElement("div"),l=this.renderer.createElement("div");this.renderer.appendChild(r,a),this.renderer.appendChild(r,o),this.renderer.appendChild(r,l),this.renderer.appendChild(t,r);const c=this.renderer.createElement("div");return this.renderer.setStyle(c,"color","#fff"),this.renderer.setStyle(c,"font-size","1.2em"),this.renderer.setStyle(c,"font-family","var(--cue-font-family)"),this.renderer.addClass(c,"spinner-message"),c.innerHTML=this.loadingMessage(),this.renderer.appendChild(t,c),t}static \u0275fac=function(n){return new(n||i)(A.rXU(A.aKT),A.rXU(A.sFG))};static \u0275dir=A.FsC({type:i,selectors:[["","cueLoadingOverlay",""]],hostVars:2,hostBindings:function(n,s){2&n&&A.xc7("position",s.hostPosition)},inputs:{displayLoading:[1,"displayLoading"],loadingMessage:[1,"loadingMessage"]}})}return i})();var pM=dt(5970),mM=dt(7089),Bu=dt(5187),gM=dt(1696),vM=dt(3319),yM=dt(9731),xM=dt(4015);function _M(i,e){if(1&i){const t=A.RV6();A.j41(0,"cue-flexcontainer",3)(1,"cue-button",5),A.nI1(2,"transloco"),A.bIt("click",function(){ie.eBV(t);const s=A.XpG();return ie.Njj(s.service.zoomOut())}),A.nrm(3,"cue-button-icon",6),A.k0s(),A.j41(4,"cue-button",5),A.nI1(5,"transloco"),A.bIt("click",function(){ie.eBV(t);const s=A.XpG();return ie.Njj(s.service.zoomIn())}),A.nrm(6,"cue-button-icon",7),A.k0s(),A.j41(7,"cue-button",5),A.nI1(8,"transloco"),A.bIt("click",function(){ie.eBV(t);const s=A.XpG();return ie.Njj(s.service.zoomFit())}),A.nrm(9,"cue-button-icon",8),A.k0s()()}2&i&&(A.R7$(),A.Y8G("cueTooltip",A.bMT(2,3,"components.dxfViewer.tooltipZoomOut")),A.R7$(3),A.Y8G("cueTooltip",A.bMT(5,5,"components.dxfViewer.tooltipZoomIn")),A.R7$(3),A.Y8G("cueTooltip",A.bMT(8,7,"components.dxfViewer.tooltipZoomFit")))}function bM(i,e){if(1&i){const t=A.RV6();A.j41(0,"cue-button",9),A.nI1(1,"transloco"),A.nI1(2,"transloco"),A.mxI("selectedChange",function(s){ie.eBV(t);const r=A.XpG();return A.DH7(r.layersVisible,s)||(r.layersVisible=s),ie.Njj(s)}),A.nrm(3,"cue-button-icon",10),A.k0s()}if(2&i){const t=A.XpG();A.AVh("border-left",t.options().displayZoom&&t.options().displayLayers),A.Y8G("cueTooltip",t.layersVisible()?A.bMT(1,6,"components.dxfViewer.tooltipHideLayers"):A.bMT(2,8,"components.dxfViewer.tooltipShowLayers"))("toggleButton",!0),A.R50("selected",t.layersVisible),A.R7$(3),A.Y8G("icon",t.layersVisible()?"layers-clear":"layers")}}function SM(i,e){if(1&i){const t=A.RV6();A.j41(0,"cue-button",9),A.nI1(1,"transloco"),A.nI1(2,"transloco"),A.mxI("selectedChange",function(s){ie.eBV(t);const r=A.XpG();return A.DH7(r.layoutsVisible,s)||(r.layoutsVisible=s),ie.Njj(s)}),A.nrm(3,"cue-button-icon",11),A.k0s()}if(2&i){const t=A.XpG();A.AVh("border-left",!t.options().displayLayers),A.Y8G("cueTooltip",t.layoutsVisible()?A.bMT(1,5,"components.dxfViewer.tooltipHideLayouts"):A.bMT(2,7,"components.dxfViewer.tooltipShowLayouts"))("toggleButton",!0),A.R50("selected",t.layoutsVisible)}}function MM(i,e){if(1&i){const t=A.RV6();A.j41(0,"cue-button",9),A.nI1(1,"transloco"),A.nI1(2,"transloco"),A.mxI("selectedChange",function(s){ie.eBV(t);const r=A.XpG();return A.DH7(r.blackBackground,s)||(r.blackBackground=s),ie.Njj(s)}),A.bIt("selectedChange",function(s){ie.eBV(t);const r=A.XpG();return ie.Njj(r.service.setDarkBackground(s))}),A.nrm(3,"cue-button-icon",12),A.k0s()}if(2&i){const t=A.XpG();A.AVh("border-left",t.options().displayLayers&&t.options().displayBlackWhite),A.Y8G("cueTooltip",t.blackBackground()?A.bMT(1,5,"components.dxfViewer.tooltipRemoveDarkBackground"):A.bMT(2,7,"components.dxfViewer.tooltipSetDarkBackground"))("toggleButton",!0),A.R50("selected",t.blackBackground)}}let EM=(()=>{class i{service=(0,ie.WQX)(D4);options=(0,ke.hFB)(new yM.g);hasLayouts=(0,ke.hFB)(!1);layersVisible=(0,ke.geq)(!1);layoutsVisible=(0,ke.geq)(!1);blackBackground=(0,ke.geq)(!1);selectMenuPositions=(0,Lt.EW)(()=>"top"===this.options().position?"bottomleft":"topleft");static \u0275fac=function(n){return new(n||i)};static \u0275cmp=A.VBU({type:i,selectors:[["cue-dxf-toolbar"]],inputs:{options:[1,"options"],hasLayouts:[1,"hasLayouts"],layersVisible:[1,"layersVisible"],layoutsVisible:[1,"layoutsVisible"],blackBackground:[1,"blackBackground"]},outputs:{layersVisible:"layersVisibleChange",layoutsVisible:"layoutsVisibleChange",blackBackground:"blackBackgroundChange"},decls:7,vars:5,consts:[["justify","center",1,"container"],[1,"toolbar",3,"padded"],["align","center"],["align","center","gap","s"],["size","xs","variant","ghost",3,"border-left","cueTooltip","toggleButton","selected"],["size","xs","variant","tertiary",3,"click","cueTooltip"],["icon","zoom-out"],["icon","zoom-in"],["icon","zoom-fit"],["size","xs","variant","ghost",3,"selectedChange","cueTooltip","toggleButton","selected"],[3,"icon"],["icon","document"],["icon","black-white"]],template:function(n,s){1&n&&(A.j41(0,"cue-flexcontainer",0)(1,"cue-card",1)(2,"cue-flexcontainer",2),A.nVh(3,_M,10,9,"cue-flexcontainer",3),A.nVh(4,bM,4,10,"cue-button",4),A.nVh(5,SM,4,9,"cue-button",4),A.nVh(6,MM,4,9,"cue-button",4),A.k0s()()()),2&n&&(A.R7$(),A.Y8G("padded",!1),A.R7$(2),A.vxM(s.options().displayZoom?3:-1),A.R7$(),A.vxM(s.options().displayLayers?4:-1),A.R7$(),A.vxM(s.options().displayLayouts&&s.hasLayouts()?5:-1),A.R7$(),A.vxM(s.options().displayBlackWhite?6:-1))},dependencies:[O4.n,Bu.Z,gM.$,vM.a,mM.d,xM.Kj],styles:[".container[_ngcontent-%COMP%]{width:100%;pointer-events:none}.toolbar[_ngcontent-%COMP%]{pointer-events:all;padding:5px 10px}.border-left[_ngcontent-%COMP%]{border-left:1px solid;padding-left:12px}"],changeDetection:0})}return i})();var N4=dt(8560),Gu=dt(2036),TM=dt(5600);function wM(i){const e=/\bd="([^"]+)"/gi;let t;for(;null!==(t=e.exec(i));){const n=t[1].trim();if(/[Zz]\s*$/.test(n)&&(n.match(/[LlHhVvCcSsQqTtAa]/g)??[]).length>=2)return!0}return!1}let zu=(()=>{class i{extractedGeometries=(0,ie.vPA)({});extractedGeometriesVisible=(0,ie.vPA)({});transferredGeometries=(0,ie.vPA)([]);activeMatch=(0,ie.vPA)(null);isExtracting=(0,ie.vPA)(!1);_shadowRoot;_hitMap=new Map;_matches=[];_matchIndex=0;_lastTabTime=0;_parsedDxf=null;setShadowRoot(t){this._shadowRoot=t}getParsedDxf(){return this._parsedDxf}clearShadowRoot(){this._shadowRoot&&(this._shadowRoot.innerHTML="",this._shadowRoot=void 0),this._hitMap.clear()}toggleVisibility(t,n){this.extractedGeometriesVisible.update(s=>({...s,[t]:n}))}extractGeometries(t,n,s){var r=this;return(0,pt.A)(function*(){s&&s("Extracting geometries..."),r.isExtracting.set(!0);const a=n?.parsedDxf||n;if(!a||!a.entities&&!a.blocks)return s&&s(""),void r.isExtracting.set(!1);r._parsedDxf=a;const o=a.entities||[],l={},c={};o.forEach(u=>{const f=u.type||"Unknown",d=u.layer||"0";l[f]=(l[f]||0)+1,c[d]=(c[d]||0)+1});try{const{DrawEntitySVG:u}=yield dt.e(376).then(dt.bind(dt,6376)),f=new u;f.fromEntity(o,a,!1);const d=f.asElement();if(d.children.length>0){const y={value:d.innerHTML,entityMap:f.entityMap};t?(r.extractedGeometries.update(v=>({...v,[t.label]:y})),r.extractedGeometriesVisible.update(v=>({...v,[t.label]:!0}))):(r.extractedGeometries.update(v=>({...v,global:y})),r.extractedGeometriesVisible.update(v=>({...v,global:!0})))}}catch(u){console.error("DXF extraction failed",u)}finally{s&&s(""),r.isExtracting.set(!1)}})()}generateShadowSVG(t){if(!this._shadowRoot)return;const n=this._shadowRoot.querySelector("svg");n&&this._shadowRoot.removeChild(n);const s=document.createElementNS("http://www.w3.org/2000/svg","svg");s.setAttribute("style","position: absolute; top: 0; left: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none;");let r=0;this._hitMap.clear();const a=this.extractedGeometries(),o=this.extractedGeometriesVisible();for(const l of t.viewports){if(!1===l.visible)continue;const c=a[l.label]||a.global,u=[...l.modelGeometries||[]];if(!(u.length>0||c))continue;const d=o[l.label]||o.global,p=document.createElementNS("http://www.w3.org/2000/svg","g");p.setAttribute("data-visible",String(!1!==d)),l.modelToPaperTransformationMatrix&&p.setAttribute("transform",l.modelToPaperTransformationMatrix);const m=(y,v)=>{const g="geom-"+r++;y.setAttribute("data-geom-id",g),y.classList.add("dxf-path","clickable");const _=y.outerHTML;y.setAttribute("fill","none"),y.setAttribute("stroke","transparent");const x=document.importNode(y,!0);p.appendChild(x),this._hitMap.set(g,{transform:l.modelToPaperTransformationMatrix,entity:v,svg:_})};for(const y of u)if("svgPath"===y.type&&y.value){const _=(new DOMParser).parseFromString(`<svg xmlns="http://www.w3.org/2000/svg">${y.value}</svg>`,"image/svg+xml").documentElement;if(_){const x=Array.from(_.children);for(const b of x){const T="svg"===b.tagName.toLowerCase()?Array.from(b.children):[b];for(const E of T)m(E,y.originalEntity||y)}}}if(c&&c.value){const g=(new DOMParser).parseFromString(`<svg xmlns="http://www.w3.org/2000/svg">${c.value}</svg>`,"image/svg+xml").documentElement;if(g){const _=Array.from(g.children);for(const x of _){const b="svg"===x.tagName.toLowerCase()?Array.from(x.children):[x];for(const T of b){const E=T.getAttribute("data-dxf-id");m(T,E?c.entityMap.get(E):{type:"DXF Extract"})}}}}s.appendChild(p)}this._shadowRoot.appendChild(s)}handleTabKeyDown(t,n,s){if("Tab"!==t.key||!n||!this._shadowRoot)return;t.preventDefault();const r=Date.now();if(r-this._lastTabTime<2e3&&this._matches.length>0){this._matchIndex=(this._matchIndex+1)%this._matches.length;const o=this._matches[this._matchIndex];return this.activeMatch.set({transform:o.transform,entity:o.entity,svg:o.svg}),void(this._lastTabTime=r)}this._matches=[],this._matchIndex=0,this.activeMatch.set(null),s&&(s.style.pointerEvents="auto",s.getBoundingClientRect());const a=this._shadowRoot.elementsFromPoint(n.clientX,n.clientY);s&&(s.style.pointerEvents="none");for(const o of a){const l=o.getAttribute("data-geom-id");if(l&&this._hitMap.has(l)){const c=this._hitMap.get(l);this._matches.push({entity:c.entity,layer:c.entity.layer||"Unknown",dist:0,originalDist:0,transform:c.transform,svg:c.svg})}}if(this._matches.length>0){const o=this._matches[0];this.activeMatch.set({transform:o.transform,entity:o.entity,svg:o.svg}),this._lastTabTime=r}}handleShadowClick(t,n,s=!1){if(!this._shadowRoot)return null;const r=this._shadowElementsFromPoint(t,n),a=[];for(const c of r){const u=c.getAttribute("data-geom-id");u&&this._hitMap.has(u)&&a.push(this._hitMap.get(u))}if(0===a.length)return null;const l=s?a.find(c=>"INSERT"===c?.entity?.type)??a[0]:a[0];return this.transferredGeometries.update(c=>c.find(u=>u.entity===l.entity)?c:[...c,{transform:l.transform,entity:l.entity,svg:l.svg}]),l}resolveFromComposedPath(t){for(const n of t)if(n instanceof Element){const s=n.getAttribute("data-geom-id");if(s&&this._hitMap.has(s))return this._hitMap.get(s)}return null}hitTestAtPoint(t,n){const s=this._shadowElementsFromPoint(t,n);for(const r of s){const a=r.getAttribute("data-geom-id");if(a&&this._hitMap.has(a))return this._hitMap.get(a)}return null}getAllHitsAtPoint(t,n){const s=this._shadowElementsFromPoint(t,n),r=[];for(const a of s){const o=a.getAttribute("data-geom-id");o&&this._hitMap.has(o)&&r.push(this._hitMap.get(o))}return r}getAllHitsInRect(t,n,s,r,a){if(!this._shadowRoot)return[];const o=new Map,l=this._shadowRoot.querySelectorAll("[data-geom-id]");for(const u of l){if(!(u instanceof SVGGraphicsElement))continue;const f=u.getAttribute("data-geom-id");if(!f||!this._hitMap.has(f))continue;const d=this._hitMap.get(f),p=u.getScreenCTM();if(!p)continue;let m;try{m=u.getBBox()}catch{continue}if(0===m.width&&0===m.height)continue;const y=[new DOMPoint(m.x,m.y).matrixTransform(p),new DOMPoint(m.x+m.width,m.y).matrixTransform(p),new DOMPoint(m.x,m.y+m.height).matrixTransform(p),new DOMPoint(m.x+m.width,m.y+m.height).matrixTransform(p)],v={left:Math.min(...y.map(g=>g.x)),top:Math.min(...y.map(g=>g.y)),right:Math.max(...y.map(g=>g.x)),bottom:Math.max(...y.map(g=>g.y))};o.has(d.entity)||o.set(d.entity,{entry:d,bboxes:[]}),o.get(d.entity).bboxes.push(v)}const c=[];for(const{entry:u,bboxes:f}of o.values())"window"===a?f.every(p=>p.left>=t&&p.top>=n&&p.right<=s&&p.bottom<=r)&&c.push(u):f.some(p=>p.right>t&&p.left<s&&p.bottom>n&&p.top<r)&&c.push(u);return c}_shadowElementsFromPoint(t,n){if(!this._shadowRoot)return[];const r=[],a=this._shadowRoot.querySelectorAll("[data-geom-id]");for(const o of a){if(!(o instanceof SVGGraphicsElement))continue;const l=o.getScreenCTM();if(!l)continue;let c,u;try{c=new DOMPoint(t,n).matrixTransform(l.inverse())}catch{continue}try{u=o.getBBox()}catch{continue}const f=Math.sqrt(l.a*l.a+l.b*l.b),d=f>0?12/f:12;c.x>=u.x-d&&c.x<=u.x+u.width+d&&c.y>=u.y-d&&c.y<=u.y+u.height+d&&r.push(o)}return r}analyzeClosedPolygons(){const t=[];for(const n of this._hitMap.values())wM(n.svg)&&t.push(n);return t}static \u0275fac=function(n){return new(n||i)};static \u0275prov=ie.jDH({token:i,factory:i.\u0275fac})}return i})();const k4=2*Math.PI;function U4(i){if(!i)return null;switch(i.type){case"LINE":return!i.vertices||i.vertices.length<2?null:{start:{x:i.vertices[0].x,y:i.vertices[0].y},end:{x:i.vertices[1].x,y:i.vertices[1].y},isClosed:!1};case"ARC":{const e=i.center.x,t=i.center.y,n=i.radius,s=i.startAngle,r=i.endAngle;return{start:{x:e+n*Math.cos(s),y:t+n*Math.sin(s)},end:{x:e+n*Math.cos(r),y:t+n*Math.sin(r)},isClosed:!1}}case"CIRCLE":return{start:{x:i.center.x,y:i.center.y},end:{x:i.center.x,y:i.center.y},isClosed:!0};case"LWPOLYLINE":case"POLYLINE":{const e=i.vertices??[];return e.length<2?null:!0===i.shape||!0===i.closed?{start:{x:e[0].x,y:e[0].y},end:{x:e[0].x,y:e[0].y},isClosed:!0}:{start:{x:e[0].x,y:e[0].y},end:{x:e[e.length-1].x,y:e[e.length-1].y},isClosed:!1}}default:return null}}function E0(i,e){return Math.sqrt((i.x-e.x)**2+(i.y-e.y)**2)}function Hu(i,e){const t=E0(i,e.start),n=E0(i,e.end);return t<=n?{point:e.start,which:"start",distance:t}:{point:e.end,which:"end",distance:n}}function B4(i,e,t,n){const s=e.x*n.y-e.y*n.x;if(Math.abs(s)<1e-12)return null;const r=t.x-i.x,a=t.y-i.y;return{t:(r*n.y-a*n.x)/s,u:(r*e.y-a*e.x)/s}}function Vu(i,e,t,n){const s=wa(i,e),r=wa(t,n),a=Aa(i,e),o=Aa(t,n);if(!(s&&r&&a&&o))return null;const l=B4(s,a,r,o);return l?{intersection:{x:s.x+l.t*a.x,y:s.y+l.t*a.y}}:null}function wa(i,e){if("LINE"===i.type){const t=i.vertices;if(!t||t.length<2)return null;const n="start"===e?t[0]:t[t.length-1];return{x:n.x,y:n.y}}if("ARC"===i.type){const t="start"===e?i.startAngle:i.endAngle;return{x:i.center.x+i.radius*Math.cos(t),y:i.center.y+i.radius*Math.sin(t)}}if("LWPOLYLINE"===i.type||"POLYLINE"===i.type){const t=i.vertices??[];if(0===t.length)return null;const n="start"===e?t[0]:t[t.length-1];return{x:n.x,y:n.y}}return null}function Wu(i,e,t){const n=[];for(const a of[e,"start"===e?"end":"start"]){const o=wa(i,a),l=Aa(i,a);if(o&&l)for(const c of["start","end"]){const u=wa(t,c),f=Aa(t,c);if(!u||!f)continue;const d=B4(o,l,u,f);if(!d)continue;const{t:p,u:m}=d;n.push({intersection:{x:o.x+p*l.x,y:o.y+p*l.y},joiningEndA:a,joiningEndB:c,tA:p,tB:m,priority:p>-.01&&m>-.01?0:p>-.01?1:2})}}if(0===n.length)return null;n.sort((a,o)=>a.priority!==o.priority?a.priority-o.priority:Math.abs(a.tA)-Math.abs(o.tA));const r=n[0];return{intersection:r.intersection,joiningEndA:r.joiningEndA,joiningEndB:r.joiningEndB}}function Aa(i,e){if("LINE"===i.type)return function AM(i,e){const t=i.vertices[0],n=i.vertices[1];return"start"===e?{x:n.x-t.x,y:n.y-t.y}:{x:t.x-n.x,y:t.y-n.y}}(i,e);if("ARC"===i.type)return function CM(i,e){const t="start"===e?i.startAngle:i.endAngle,n=Math.cos(t),s=Math.sin(t);return"start"===e?{x:-s,y:n}:{x:s,y:-n}}(i,e);if("LWPOLYLINE"===i.type||"POLYLINE"===i.type){const t=i.vertices??[];if(t.length<2)return null;if("start"===e)return{x:t[1].x-t[0].x,y:t[1].y-t[0].y};{const n=t.length-1;return{x:t[n-1].x-t[n].x,y:t[n-1].y-t[n].y}}}return null}function G4(i,e){return`<path d="M ${Xt(i.x)} ${Xt(i.y)} L ${Xt(e.x)} ${Xt(e.y)}"/>`}function Xu(i,e,t){const n=i.center.x,s=i.center.y,r=i.radius,a=n+r*Math.cos(e),o=s+r*Math.sin(e),l=n+r*Math.cos(t),c=s+r*Math.sin(t);let u=t-e;for(;u<0;)u+=k4;for(;u>k4;)u-=k4;if(u<1e-4)return"";const f=u>Math.PI?1:0;return`<path d="M ${Xt(a)} ${Xt(o)} A ${Xt(r)} ${Xt(r)} 0 ${f} 1 ${Xt(l)} ${Xt(c)}"/>`}function us(i,e,t){if("LINE"===i.type)return G4(e,t);if("ARC"===i.type){const n=i.center.x,s=i.center.y;return Xu(i,Math.atan2(e.y-s,e.x-n),Math.atan2(t.y-s,t.x-n))}if("LWPOLYLINE"===i.type||"POLYLINE"===i.type){const n=[...i.vertices??[]];if(0===n.length)return"";const s=[...n];return s[0]={...s[0],x:e.x,y:e.y},s[s.length-1]={...s[s.length-1],x:t.x,y:t.y},Yu(s,!1)}return""}function Yu(i,e){if(i.length<2)return"";let t=`M ${Xt(i[0].x)} ${Xt(i[0].y)}`;for(let n=0;n<i.length-1;n++){const s=i[n],r=i[n+1];if(void 0!==s.bulge&&Math.abs(s.bulge)>1e-4){const a=Math.sqrt((s.x-r.x)**2+(s.y-r.y)**2),o=Math.abs(s.bulge),l=a/2*(1+o*o)/(2*o),c=o>1?1:0,u=s.bulge>0?1:0;t+=` A ${Xt(l)} ${Xt(l)} 0 ${c} ${u} ${Xt(r.x)} ${Xt(r.y)}`}else t+=` L ${Xt(r.x)} ${Xt(r.y)}`}return e&&(t+=" Z"),`<path d="${t}"/>`}function z4(i){if("LINE"===i.type){const e=i.vertices[0],t=i.vertices[1];return G4({x:e.x,y:e.y},{x:t.x,y:t.y})}return"ARC"===i.type?Xu(i,i.startAngle,i.endAngle):"LWPOLYLINE"===i.type||"POLYLINE"===i.type?Yu(i.vertices??[],!0===i.shape||!0===i.closed):"CIRCLE"===i.type?`<circle cx="${Xt(i.center.x)}" cy="${Xt(i.center.y)}" r="${Xt(i.radius)}"/>`:""}function Ca(i){if(0===i.length)return"";const e=i.map(s=>{const r=/\bd="([^"]+)"/.exec(s.svg);return r?r[1].trim():""}).filter(Boolean);if(0===e.length)return`<g>${i.map(s=>s.svg).join("")}</g>`;const t=/^\s*[Mm]\s+[-\d.e+]+[,\s]+[-\d.e+]+\s*/;return`<path d="${e[0]+e.slice(1).map(s=>" "+s.replace(t,"")).join("")+" Z"}"/>`}function qu(i,e,t,n){const s={x:e.x-i.x,y:e.y-i.y},a=B4(i,s,t,{x:n.x-t.x,y:n.y-t.y});return a?{x:i.x+a.t*s.x,y:i.y+a.t*s.y}:null}function Zu(i,e,t,n){if("LINE"!==t.type)return null;const s=U4(t);if(!s)return null;const r=qu(i,e,s.start,s.end);if(!r)return null;const a=s.end.x-s.start.x,o=s.end.y-s.start.y,l=a*a+o*o;return l<1e-12?null:((n.x-s.start.x)*a+(n.y-s.start.y)*o)/l>((r.x-s.start.x)*a+(r.y-s.start.y)*o)/l?"start":"end"}function Ju(i,e,t,n){const s_x=e.x-i.x,s_y=e.y-i.y,r=wa(t,n),a=Aa(t,n);if(!r||!a)return null;const o=s_x*a.y-s_y*a.x;if(Math.abs(o)<1e-12)return null;const u=((r.x-e.x)*a.y-(r.y-e.y)*a.x)/o;return{intersection:{x:e.x+u*s_x,y:e.y+u*s_y}}}function Xt(i){return i.toFixed(6)}function H4(i,e,t){const n=t.x-e.x,s=t.y-e.y,r=n*n+s*s;if(r<1e-12)return E0(i,e);const a=Math.max(0,Math.min(1,((i.x-e.x)*n+(i.y-e.y)*s)/r));return E0(i,{x:e.x+a*n,y:e.y+a*s})}function RM(i,e,t,n){return{syntheticEntity:{type:"LINE",vertices:[{x:t.x,y:t.y},{x:n.x,y:n.y}],layer:i.layer??"0",_decomposedFrom:i,_segmentIndex:e},svg:G4({x:t.x,y:t.y},{x:n.x,y:n.y})}}function D1(i,e){const t=i.position?.x??0,n=i.position?.y??0,s=i.xScale??1,r=i.yScale??1,o=(i.rotation??0)*Math.PI/180,l=Math.cos(o),c=Math.sin(o);return{x:s*(e.x*l-e.y*c)+t,y:r*(e.x*c+e.y*l)+n}}function V4(i,e){if("LINE"===e.type){const t=e.vertices;return!t||t.length<2?1/0:H4(i,{x:t[0].x,y:t[0].y},{x:t[1].x,y:t[1].y})}if("ARC"===e.type)return Math.abs(E0(i,{x:e.center.x,y:e.center.y})-e.radius);if("LWPOLYLINE"===e.type||"POLYLINE"===e.type){const t=e.vertices??[];let n=1/0;for(let s=0;s<t.length-1;s++)n=Math.min(n,H4(i,{x:t[s].x,y:t[s].y},{x:t[s+1].x,y:t[s+1].y}));return n}return 1/0}let Ku=(()=>{class i{chain=(0,ie.vPA)([]);hasChain=(0,Lt.EW)(()=>this.chain().length>0);previewSvg=(0,Lt.EW)(()=>{const t=this.chain();return 0===t.length?"":Ca(t)});chainTransform=(0,Lt.EW)(()=>this.chain()[0]?.transform);hoveredHit=(0,ie.vPA)(null);hoveredModelPt=(0,ie.vPA)(null);filletPreviewSvgs=(0,Lt.EW)(()=>{const t=this.chain(),n=this.hoveredHit();if(0===t.length||!n)return[];const s=t[t.length-1],r=n.entity,a=n.transform;if(a!==s.transform)return[];const o=U4(r);if(!o||o.isClosed)return[];if(Hu(s.endPoint,o).distance<=.5)return[];let u=null;const f=this.hoveredModelPt(),d=f?Zu(s.startPoint,s.endPoint,r,f)??(E0(f,o.start)<=E0(f,o.end)?"end":"start"):null;if(null!==d){if("LINE"===s.entity?.type){const w=Ju(s.startPoint,s.endPoint,r,d);if(w){const I=function PM(i,e){const t=i.end.x-i.start.x,n=i.end.y-i.start.y,s=t*t+n*n;return s<1e-12?null:((e.x-i.start.x)*t+(e.y-i.start.y)*n)/s}(o,w.intersection);(null===I||I>=-5&&I<=6)&&(u={...w,joiningEndB:d})}}if(!u){const w=Vu(s.entity,s.freeEntityEnd,r,d);w&&(u={intersection:w.intersection,joiningEndB:d})}}if(!u){const w=Wu(s.entity,s.freeEntityEnd,r);w&&(u={intersection:w.intersection,joiningEndB:w.joiningEndB})}if(!u)return[];const p=u.intersection,m=u.joiningEndB,v="start"==("start"===m?"end":"start")?o.start:o.end,g=us(s.entity,s.startPoint,p),x="ARC"===r.type?"start"===m?o.start:o.end:p,b="start"===m?o.start:o.end,M=us(r,x,{x:x.x+5*(v.x-b.x),y:x.y+5*(v.y-b.y)});return[{svg:g,transform:s.transform},{svg:M,transform:a}]});_history=(0,ie.vPA)([]);_future=(0,ie.vPA)([]);canUndo=(0,Lt.EW)(()=>this._history().length>0);canRedo=(0,Lt.EW)(()=>this._future().length>0);_saveSnapshot(){this._history.update(t=>[...t,this.chain()]),this._future.set([])}undo(){const t=this._history();if(0===t.length)return;const n=t[t.length-1];this._history.update(s=>s.slice(0,-1)),this._future.update(s=>[...s,this.chain()]),this.chain.set(n)}redo(){const t=this._future();if(0===t.length)return;const n=t[t.length-1];this._future.update(s=>s.slice(0,-1)),this._history.update(s=>[...s,this.chain()]),this.chain.set(n)}reset(){this.chain.set([]),this._history.set([]),this._future.set([])}closePolygon(){const t=this.chain();return t.length<2?null:this._attemptClose(t,t[0].transform)??null}handleEntityClick(t,n){const{entity:s,transform:r}=t,a=U4(s);if(a?.isClosed){const b=z4(s),T={segments:[{entity:s,transform:r,svg:b,startPoint:a.start,endPoint:a.end,freeEntityEnd:"end"}],closedPathSvg:b,transform:r};return this.reset(),{done:!0,result:T}}if(!a)return null;const o=this.chain();if(this._saveSnapshot(),0===o.length){const b=z4(s);return this.chain.set([{entity:s,transform:r,svg:b,startPoint:a.start,endPoint:a.end,freeEntityEnd:"end"}]),{done:!1}}if(r!==o[0].transform)return null;if(1===o.length){const b=o[0];Math.min(E0(b.startPoint,a.start),E0(b.startPoint,a.end))<Math.min(E0(b.endPoint,a.start),E0(b.endPoint,a.end))&&this.chain.update(M=>{const w=M[0];return[{...w,startPoint:w.endPoint,endPoint:w.startPoint,freeEntityEnd:"start"===w.freeEntityEnd?"end":"start"}]})}const c=this.chain(),u=c[c.length-1].endPoint,f=Hu(u,a),d=f.which,m="start"==("start"===d?"end":"start")?a.start:a.end;let y,v;if(f.distance<=.5)y=u,v=m;else{const b=c[c.length-1];let T=null;const E=n?Zu(b.startPoint,b.endPoint,s,n)??(E0(n,a.start)<=E0(n,a.end)?"end":"start"):null;if(null!==E){if("LINE"===b.entity?.type){const M=Ju(b.startPoint,b.endPoint,s,E);M&&(T={...M,joiningEndB:E})}if(!T){const M=Vu(b.entity,b.freeEntityEnd,s,E);M&&(T={intersection:M.intersection,joiningEndB:E})}}if(!T){const M=Wu(b.entity,b.freeEntityEnd,s);M&&(T={intersection:M.intersection,joiningEndB:M.joiningEndB})}if(T&&E0(T.intersection,"start"==("start"===T.joiningEndB?"end":"start")?a.start:a.end)<=.5&&(T=null),T){const M=T.intersection,w=T.joiningEndB,I="start"===w?"end":"start",S="start"===I?a.start:a.end;this.chain.update(z=>{const G=[...z],ee=G[G.length-1],J=us(ee.entity,ee.startPoint,M);return G[G.length-1]={...ee,endPoint:M,svg:J},G});const X="ARC"===s.type?"start"===w?a.start:a.end:M,U={entity:s,transform:r,svg:us(s,X,S),startPoint:X,endPoint:S,freeEntityEnd:I};return this.chain.update(z=>[...z,U]),this._checkClose(this.chain(),r)}y=u,v=m}const x={entity:s,transform:r,svg:us(s,y,v),startPoint:y,endPoint:v,freeEntityEnd:"start"===d?"end":"start"};return this.chain.update(b=>[...b,x]),this._checkClose(this.chain(),r)}_checkClose(t,n){const o=E0(t[t.length-1].endPoint,t[0].startPoint);if(t.length>=3&&o<=.5){const c={segments:t,closedPathSvg:Ca(t),transform:n};return this.reset(),{done:!0,result:c}}return{done:!1}}_attemptClose(t,n){if(t.length<2)return null;const s=t[t.length-1],r=t[0];if(2===t.length){const u={segments:t,closedPathSvg:Ca(t),transform:n};return this.reset(),{done:!0,result:u}}const a=qu(s.startPoint,s.endPoint,r.startPoint,r.endPoint);if(a){const c=us(s.entity,s.startPoint,a),u=us(r.entity,a,r.endPoint),f=[{...r,startPoint:a,svg:u},...t.slice(1,-1),{...s,endPoint:a,svg:c}],p={segments:f,closedPathSvg:Ca(f),transform:n};return this.reset(),{done:!0,result:p}}const l={segments:t,closedPathSvg:Ca(t),transform:n};return this.reset(),{done:!0,result:l}}static \u0275fac=function(n){return new(n||i)};static \u0275prov=ie.jDH({token:i,factory:i.\u0275fac})}return i})();var DM=dt(177);let FM=(()=>{class i{_el=(0,ie.WQX)(A.aKT);_platformId=(0,ie.WQX)(A.Agw);dragThreshold=(0,ke.hFB)(6);dragSelectEnd=(0,ke.CGW)();dragSelectMove=(0,ke.CGW)();dragSelectCancel=(0,ke.CGW)();_overlay=null;_startX=0;_startY=0;_dragging=!1;_moveListener=t=>this._onMouseMove(t);_upListener=t=>this._onMouseUp(t);_keyListener=t=>{"Escape"===t.key&&this._cancel()};_wasDragging=!1;_onMouseDown(t){(0,DM.UE)(this._platformId)&&0===t.button&&(this._startX=t.clientX,this._startY=t.clientY,this._dragging=!1,this._wasDragging=!1,document.addEventListener("mousemove",this._moveListener),document.addEventListener("mouseup",this._upListener),document.addEventListener("keydown",this._keyListener))}_onHostClick(t){this._wasDragging&&(t.stopImmediatePropagation(),this._wasDragging=!1)}_onMouseMove(t){const n=t.clientX-this._startX,s=t.clientY-this._startY;if(!this._dragging){if(Math.abs(n)<this.dragThreshold()&&Math.abs(s)<this.dragThreshold())return;this._dragging=!0,this._createOverlay()}const r=n>=0?"window":"crossing";this._updateOverlay(t.clientX,t.clientY,r);const a=this._toFractional(t.clientX,t.clientY,r);a&&this.dragSelectMove.emit(a)}_onMouseUp(t){if(this._removeListeners(),!this._dragging)return void this._destroyOverlay();this._dragging=!1,this._wasDragging=!0,this._destroyOverlay();const r=this._toFractional(t.clientX,t.clientY,t.clientX-this._startX>=0?"window":"crossing");r&&this.dragSelectEnd.emit(r)}_cancel(){this._removeListeners(),this._dragging=!1,this._destroyOverlay(),this.dragSelectCancel.emit()}_toFractional(t,n,s){const a=this._el.nativeElement.getBoundingClientRect();if(0===a.width||0===a.height)return null;const o=(Math.min(this._startX,t)-a.left)/a.width,l=(Math.min(this._startY,n)-a.top)/a.height,c=(Math.max(this._startX,t)-a.left)/a.width,u=(Math.max(this._startY,n)-a.top)/a.height;return{left:Math.max(0,o),top:Math.max(0,l),right:Math.min(1,c),bottom:Math.min(1,u),mode:s}}_createOverlay(){if(this._overlay)return;const t=document.createElement("div");t.style.cssText=["position: fixed","pointer-events: none","z-index: 9999","box-sizing: border-box"].join(";"),document.body.appendChild(t),this._overlay=t}_updateOverlay(t,n,s){if(!this._overlay)return;const r=Math.min(this._startX,t),a=Math.min(this._startY,n),o=Math.max(this._startX,t),l=Math.max(this._startY,n);"window"===s?(this._overlay.style.border="1px solid #1565c0",this._overlay.style.background="rgba(21, 101, 192, 0.10)",this._overlay.style.borderStyle="solid"):(this._overlay.style.border="1px dashed #2e7d32",this._overlay.style.background="rgba(46, 125, 50, 0.10)",this._overlay.style.borderStyle="dashed"),this._overlay.style.left=`${r}px`,this._overlay.style.top=`${a}px`,this._overlay.style.width=o-r+"px",this._overlay.style.height=l-a+"px"}_destroyOverlay(){this._overlay&&(this._overlay.remove(),this._overlay=null)}_removeListeners(){document.removeEventListener("mousemove",this._moveListener),document.removeEventListener("mouseup",this._upListener),document.removeEventListener("keydown",this._keyListener)}ngOnDestroy(){this._removeListeners(),this._destroyOverlay()}static \u0275fac=function(n){return new(n||i)};static \u0275dir=A.FsC({type:i,selectors:[["","cueDragSelect",""]],hostBindings:function(n,s){1&n&&A.bIt("mousedown",function(a){return s._onMouseDown(a)})("click",function(a){return s._onHostClick(a)})},inputs:{dragThreshold:[1,"dragThreshold"]},outputs:{dragSelectEnd:"dragSelectEnd",dragSelectMove:"dragSelectMove",dragSelectCancel:"dragSelectCancel"}})}return i})();const OM=["shadowContainer"];function NM(i,e){if(1&i){const t=A.RV6();A.j41(0,"div",7),A.bIt("click",function(s){ie.eBV(t);const r=A.XpG();return ie.Njj(r.onToolClick(s))})("mouseleave",function(){ie.eBV(t);const s=A.XpG();return ie.Njj(s.onToolMouseLeave())}),A.k0s()}if(2&i){const t=A.XpG();A.xc7("cursor",t.toolCursor())}}function kM(i,e){if(1&i){const t=A.RV6();A.j41(0,"button",8),A.bIt("click",function(){ie.eBV(t);const s=A.XpG();return ie.Njj(s.showShadowDom.set(!s.showShadowDom()))}),A.EFF(1),A.k0s()}if(2&i){const t=A.XpG();A.R7$(),A.SpI(" SVG Hit-Test: ",t.showShadowDom()?"ON":"OFF"," ")}}function UM(i,e){if(1&i&&(A.j41(0,"cue-card",6)(1,"cue-typography",9),A.EFF(2),A.k0s(),A.j41(3,"cue-typography",10),A.EFF(4),A.k0s()()),2&i){const t=e;A.R7$(2),A.SpI("Entity: ",t.entity.type||"Unknown"),A.R7$(2),A.SpI("Layer: ",t.entity.layer||"0")}}function fs(i,e){return i.replace(/\s*class="[^"]*"/g,"").replace(/\s*stroke="[^"]*"/g,"").replace(/(<(?:path|circle|ellipse|line|polyline|rect)(?:\s|>))/g,`$1fill="none" vector-effect="non-scaling-stroke" style="stroke-width: var(--dxf-sw, ${e})" `).replace(/(<text(?:\s|>))/g,`$1vector-effect="non-scaling-stroke" style="stroke-width: var(--dxf-sw, ${e})" `)}let BM=(()=>{class i{_geomService=(0,ie.WQX)(zu);_polygonSelectService=(0,ie.WQX)(Ku);_cdref=(0,ie.WQX)(ke.gRc);layout=ke.hFB.required();handlers=ke.hFB.required();showHitTest=(0,ke.hFB)(!1);tools=(0,ke.hFB)([]);activeTool=(0,ke.hFB)(null);viewportSelectMode=(0,ke.hFB)(!1);autoExtractGeometries=(0,ke.hFB)(!1);enableShadowHitTest=(0,ke.hFB)(!0);tabCycleOrder=(0,ke.hFB)("block-first");imageToolbarOptions=(0,ke.hFB)(new TM.g);imageActiveTool=(0,ke.geq)("pan");pointDrawn=(0,ke.CGW)();svgItemsSelected=(0,ke.CGW)();polygonSelected=(0,ke.CGW)();viewportSelected=(0,ke.CGW)();shadowClicked=(0,ke.CGW)();shadowDragSelected=(0,ke.CGW)();highlightedSvgItems=(0,ke.hFB)([]);showShadowDom=(0,ie.vPA)(!1);drawnPoints=(0,ie.vPA)([]);selectedSvgItems=(0,ie.vPA)([]);hoveredSvgItem=(0,ie.vPA)(null);isAnalyzingSpaces=(0,ie.vPA)(!1);lastCompletedPolygon=(0,ie.vPA)(null);closedPolygons=(0,ie.vPA)([]);extractedGeometries=this._geomService.extractedGeometries;extractedGeometriesVisible=this._geomService.extractedGeometriesVisible;transferredGeometries=this._geomService.transferredGeometries;activeMatch=this._geomService.activeMatch;isExtracting=this._geomService.isExtracting;polygonChain=this._polygonSelectService.chain;polygonPreviewSvg=this._polygonSelectService.previewSvg;polygonChainTransform=this._polygonSelectService.chainTransform;canUndoPolygon=this._polygonSelectService.canUndo;canRedoPolygon=this._polygonSelectService.canRedo;polygonFilletPreviewSvgs=this._polygonSelectService.filletPreviewSvgs;undoPolygon(){this._polygonSelectService.undo()}redoPolygon(){this._polygonSelectService.redo()}closePolygon(){return this._polygonSelectService.closePolygon()}startPolygonWithEntity(t,n,s){this._polygonSelectService.reset();const r=this._clientToModelCoord(n,s)??void 0;this._polygonSelectService.handleEntityClick(t,r),this.lastCompletedPolygon.set(null)}shadowContainer=(0,ke.ebz)("shadowContainer");_imageViewer=(0,ke.ebz)(N4.ImageViewer);_shadowRoot;toolCursor=(0,Lt.EW)(()=>{if(this.viewportSelectMode()&&!this.activeTool())return"crosshair";switch(this.activeTool()){case"draw-point":case"svg-polygon-select":return"crosshair";case"svg-select":return"pointer";default:return"default"}});layoutArtefacts=(0,Lt.EW)(()=>{const t=this.layout();if(!t)return(0,Gu.x)();const n=t.viewports.filter(r=>!1!==r.visible);return{...(0,Gu.x)(),circles:this.drawnPoints().map(r=>({cx:r.viewportCoord.x,cy:r.viewportCoord.y,r:.8,color:"#ff4444",showFill:!0})),xywhs:n.map(r=>({xywhStr:r.xywh,color:r.color??"rgba(255, 0, 0, 0.8)",showFill:!1,label:r.label})),svgPaths:[...n.filter(r=>!1!==r.geometriesVisible&&r.modelGeometries?.length).flatMap(r=>r.modelGeometries.filter(a=>"svgPath"===a.type).map(a=>({svg:a.value,transform:r.modelToPaperTransformationMatrix,color:"#ffa8a8",fillColor:"rgba(255, 168, 168, 0.3)",label:a.label}))),...n.filter(r=>{const o=this.extractedGeometries()[r.label]?r.label:"global",l=this.extractedGeometries()[o],c=this.extractedGeometriesVisible()[o];return!1!==r.geometriesVisible&&c&&l}).map(r=>{const a=this.extractedGeometries()[r.label]?r.label:"global",o=this.extractedGeometries()[a],c=(new DOMParser).parseFromString(`<svg xmlns="http://www.w3.org/2000/svg">${o.value}</svg>`,"image/svg+xml");return c.querySelectorAll("path, circle, line, polyline, ellipse, rect").forEach(f=>{f.setAttribute("vector-effect","non-scaling-stroke"),f.setAttribute("fill","none")}),c.querySelectorAll("text").forEach(f=>{f.setAttribute("fill","none"),f.setAttribute("stroke","none")}),{svg:c.documentElement.innerHTML,transform:r.modelToPaperTransformationMatrix,color:"#a8a8ff",fillColor:"rgba(168, 168, 255, 0.3)",label:r.label+" (Extracted)"}}),...this.transferredGeometries().map(r=>({svg:fs(r.svg,"2"),strokeWidth:2,transform:r.transform,color:"#0000ff",fillColor:"rgba(0, 0, 255, 0.3)",label:(r.entity?.label||r.entity?.type)+" (Transferred)"})),...this.activeMatch()?[{svg:fs(this.activeMatch().svg,"4"),strokeWidth:4,transform:this.activeMatch().transform,color:"#00ff00",fillColor:"rgba(0, 255, 0, 0.5)",label:(this.activeMatch().entity?.label||this.activeMatch().entity?.type)+" (Active Match)"}]:[],...[...this.selectedSvgItems(),...this.highlightedSvgItems().filter(r=>!this.selectedSvgItems().some(a=>a.entity===r.entity))].map(r=>({svg:fs(r.svg,"3"),strokeWidth:3,transform:r.transform,color:r.color??"#ff8800",fillColor:"rgba(255, 136, 0, 0.35)",label:(r.entity?.label||r.entity?.type)+" (Selected)"})),...(()=>{const r=this.hoveredSvgItem();return r?"svg-polygon-select"===this.activeTool()&&this.polygonChain().length>0||this.selectedSvgItems().some(o=>o.entity===r.entity)||this.highlightedSvgItems().some(o=>o.entity===r.entity)?[]:[{svg:fs(r.svg,"3"),strokeWidth:3,transform:r.transform,color:"#2979ff",fillColor:"rgba(41, 121, 255, 0.2)",label:(r.entity?.label||r.entity?.type)+" (Hover)"}]:[]})(),...(()=>{const r=this.polygonPreviewSvg();return r?[{svg:fs(r,"3"),strokeWidth:3,transform:this.polygonChainTransform(),color:"#00e5ff",fillColor:"rgba(0, 229, 255, 0.15)",label:`Polygon (${this.polygonChain().length} segment(s))`}]:[]})(),...this.polygonFilletPreviewSvgs().map(r=>({svg:fs(r.svg,"2"),strokeWidth:2,transform:r.transform,color:"#ffeb3b",fillColor:"none",strokeDashArray:"6,4",label:"Fillet preview"})),...(()=>{const r=this.lastCompletedPolygon();return r?[{svg:fs(r.closedPathSvg,"3"),strokeWidth:3,transform:r.transform,color:"#00e5ff",fillColor:"rgba(0, 229, 255, 0.15)",label:`Selected Polygon (${r.segments.length} segments)`}]:[]})()]}});imageViewerContextMenu=(0,Lt.EW)(()=>[{label:"Extract DXF Geometries",visible:t=>!(!t?.label||"string"!=typeof t.label||this.extractedGeometries()[t.label]||this.extractedGeometries().global),action:t=>{this._extractGeometries(t)}},{label:"Toggle Extracted SVG",visible:t=>!(!t?.label||"string"!=typeof t.label||!this.extractedGeometries()[t.label]),action:t=>{const n=this.extractedGeometriesVisible()[t.label];this._geomService.toggleVisibility(t.label,!n)}}]);_extractGeometries(t){var n=this;return(0,pt.A)(function*(){const s=yield n.handlers().getParsedDxf(),r=n.layout();if(!r)return;const a=r.viewports.find(o=>o.label===t.label);a&&n._geomService.extractGeometries(a,{parsedDxf:s},o=>{n._cdref.detectChanges(),o||setTimeout(()=>{n._geomService.toggleVisibility(a.label,!1)},3e3)})})()}_ensureGeometriesExtracted(){var t=this;return(0,pt.A)(function*(){if(!t.layout())return;const s=yield t.handlers().getParsedDxf();yield t._geomService.extractGeometries(null,{parsedDxf:s}),t._cdref.detectChanges()})()}onToolClick(t){switch(this.activeTool()){case"draw-point":this._handleDrawPoint(t);break;case"svg-select":this._handleSvgSelect(t);break;case"svg-polygon-select":this._handlePolygonSelect(t)}}_handleDrawPoint(t){const n=this._imageViewer();if(!n)return;const s=n.mouseToImagePercent(t);if(!s)return;const r=this._findViewportForPoint(s.x,s.y),o={viewportCoord:s,modelCoord:r?this._getModelCoord(s,r):null,viewportLabel:r?.label??null};this.drawnPoints.update(l=>[...l,o]),this.pointDrawn.emit(o),t.stopPropagation()}onToolMouseMove(t){if("svg-select"!==this.activeTool()&&"svg-polygon-select"!==this.activeTool()||"svg-polygon-select"===this.activeTool())return;const n=this._geomService.hitTestAtPoint(t.clientX,t.clientY);this.hoveredSvgItem.set(n?{transform:n.transform,entity:n.entity,svg:n.svg}:null)}onToolMouseLeave(){this.hoveredSvgItem.set(null)}_getPreferredHit(t,n,s){const r=this._geomService.resolveFromComposedPath(t),a=l=>"INSERT"===l?.entity?.type,o=this.tabCycleOrder();return"block-first"===o&&r&&!a(r)?this._geomService.getAllHitsAtPoint(n,s).find(c=>a(c))??r:"line-first"===o&&a(r)?this._geomService.getAllHitsAtPoint(n,s).find(c=>!a(c))??r:r}onShadowContainerMouseMove(t){const n=this.activeTool();if("svg-select"!==n&&"svg-polygon-select"!==n)return;if("svg-polygon-select"===n){const r=this._buildSortedPolygonHits(t.clientX,t.clientY);this._tabCycleHits=r,this._tabCycleIndex=0,this._tabCyclePos={clientX:t.clientX,clientY:t.clientY};const a=r[0]??null;this.hoveredSvgItem.set(a?{transform:a.transform,entity:a.entity,svg:a.svg}:null),this._polygonSelectService.hoveredHit.set(a);const o=this._clientToModelCoord(t.clientX,t.clientY);return void this._polygonSelectService.hoveredModelPt.set(o)}const s=this._getPreferredHit(t.composedPath(),t.clientX,t.clientY);this.hoveredSvgItem.set(s?{transform:s.transform,entity:s.entity,svg:s.svg}:null)}onShadowContainerMouseLeave(){this.hoveredSvgItem.set(null),this._polygonSelectService.hoveredHit.set(null),this._polygonSelectService.hoveredModelPt.set(null)}onShadowContainerClick(t){const n=this.activeTool(),s=this.hoveredSvgItem();"svg-select"===n?this._handleSvgSelect(t):"svg-polygon-select"===n?this._handlePolygonSelect(t):this.viewportSelectMode()?this._handleViewportSelect(t):s&&this._tabCycleHits.length>0?this._handlePolygonSelect(t):this.onShadowClick(t)}_handleViewportSelect(t){const n=this._imageViewer();if(!n)return;const s=n.mouseToImagePercent(t);if(!s)return;const r=this._findViewportForPoint(s.x,s.y);r&&(this.viewportSelected.emit(r.label),t.stopPropagation())}_handleSvgSelect(t){const s=this.hoveredSvgItem()??this._geomService.resolveFromComposedPath(t.composedPath());if(!s)return;const r={transform:s.transform,entity:s.entity,svg:s.svg};let a;this.selectedSvgItems.update(o=>{const l=o.findIndex(c=>c.entity===r.entity);return a=l>=0?o.filter((c,u)=>u!==l):[...o,r],a}),this.svgItemsSelected.emit(a),t.stopPropagation()}_handlePolygonSelect(t){const s=this.hoveredSvgItem()??this._geomService.resolveFromComposedPath(t.composedPath());if(!s)return;const r=this._clientToModelCoord(t.clientX,t.clientY)??this._polygonSelectService.hoveredModelPt()??void 0,a=this._polygonSelectService.handleEntityClick(s,r);null!==a&&(a.done?(this.lastCompletedPolygon.set(a.result),this.polygonSelected.emit(a.result)):1===this.polygonChain().length&&this.lastCompletedPolygon.set(null),t.stopPropagation())}_findViewportForPoint(t,n){const s=this.layout();return s?s.viewports.find(r=>{if(!1===r.visible)return!1;const a=this._parseXYWH(r.xywh);return!!a&&t>=a.x&&t<=a.x+a.width&&n>=a.y&&n<=a.y+a.height})??null:null}_parseXYWH(t){try{const s=t.replace("percent:","").split(",").map(c=>parseFloat(c.trim()));if(4!==s.length||s.some(isNaN))return null;const[r,a,o,l]=s;return{x:r,y:a,width:o,height:l}}catch{return null}}_isClosedPolyline(t){return!("LWPOLYLINE"!==t?.type&&"POLYLINE"!==t?.type||!0!==t.shape&&!0!==t.closed)}_clientToModelCoord(t,n){const s=this._imageViewer()?.mouseToImagePercent({clientX:t,clientY:n});if(!s)return null;const r=this._findViewportForPoint(s.x,s.y);return r?this._getModelCoord(s,r):null}_getModelCoord(t,n){if(!n.modelToPaperTransformationMatrix)return null;const s=this._imageViewer()?.imageDimensions();return s&&0!==s.width&&0!==s.height?this._invertMatrix(n.modelToPaperTransformationMatrix,t.x/100*s.width,t.y/100*s.height):null}_invertMatrix(t,n,s){const r=t.match(/matrix\(\s*([-\d.e+]+)\s*,\s*([-\d.e+]+)\s*,\s*([-\d.e+]+)\s*,\s*([-\d.e+]+)\s*,\s*([-\d.e+]+)\s*,\s*([-\d.e+]+)\s*\)/);if(!r)return null;const[,a,o,l,c,u,f]=r.map(Number),d=a*c-o*l;if(Math.abs(d)<1e-10)return null;const p=n-u,m=s-f;return{x:(c*p-l*m)/d,y:(-o*p+a*m)/d}}_lastMousePos=null;_tabCycleHits=[];_tabCycleIndex=0;_tabCyclePos=null;onMouseMove(t){if(this._lastMousePos={clientX:t.clientX,clientY:t.clientY},this._tabCyclePos){const n=Math.abs(this._tabCyclePos.clientX-t.clientX),s=Math.abs(this._tabCyclePos.clientY-t.clientY);(n>2||s>2)&&(this._tabCycleHits=[],this._tabCyclePos=null)}}onKeyDown(t){if("Escape"===t.key&&"svg-polygon-select"===this.activeTool())return this._polygonSelectService.reset(),void t.preventDefault();if("svg-polygon-select"===this.activeTool()){if("z"===t.key&&(t.ctrlKey||t.metaKey)&&!t.shiftKey)return this._polygonSelectService.undo(),void t.preventDefault();if("y"===t.key&&(t.ctrlKey||t.metaKey)||"z"===t.key&&(t.ctrlKey||t.metaKey)&&t.shiftKey)return this._polygonSelectService.redo(),void t.preventDefault();if("Enter"===t.key||" "===t.key){t.preventDefault();const n=this._polygonSelectService.closePolygon();return void(n&&(this.lastCompletedPolygon.set(n.result),this.polygonSelected.emit(n.result)))}}return"Tab"===t.key?(t.preventDefault(),void this._cyclePolygonSelectHit()):void 0}_buildSortedPolygonHits(t,n){const s=this._geomService.getAllHitsAtPoint(t,n),r=this._clientToModelCoord(t,n),a=new Set,o=s.filter(f=>!a.has(f.entity)&&(a.add(f.entity),!0)),l=o.find(f=>"INSERT"===f.entity?.type),c=o.flatMap(f=>{if(this._isClosedPolyline(f.entity))return function LM(i,e){if("LWPOLYLINE"!==i.type&&"POLYLINE"!==i.type)return[];const t=i.vertices??[];if(t.length<2)return[];const s=t.length,r=!0===i.shape||!0===i.closed?s:s-1,a=[];for(let o=0;o<r;o++){const l=t[o],c=t[(o+1)%s],u=RM(i,o,l,c),f=e?H4(e,{x:l.x,y:l.y},{x:c.x,y:c.y}):0;a.push({...u,_dist:f})}return e&&a.sort((o,l)=>o._dist-l._dist),a.map(({syntheticEntity:o,svg:l})=>({syntheticEntity:o,svg:l}))}(f.entity,r).map(p=>({transform:f.transform,entity:p.syntheticEntity,svg:p.svg}));if("INSERT"===f.entity?.type){const d=function IM(i,e,t){if(!i?.name)return[];if(!e?.blocks)return[];const n=e.blocks[i.name];if(!n?.entities)return[];const s=[];for(const r of n.entities){let a=null;if("LINE"===r.type){if(!r.vertices||r.vertices.length<2)continue;const c=D1(i,{x:r.vertices[0].x,y:r.vertices[0].y}),u=D1(i,{x:r.vertices[1].x,y:r.vertices[1].y});a={...r,vertices:[{...r.vertices[0],...c},{...r.vertices[1],...u}],_decomposedFrom:i}}else if("LWPOLYLINE"===r.type||"POLYLINE"===r.type){const c=r.vertices??[];if(c.length<2)continue;a={...r,vertices:c.map(u=>{const f=D1(i,{x:u.x,y:u.y});return{...u,...f}}),_decomposedFrom:i}}else{if("ARC"!==r.type)continue;{const c=D1(i,{x:r.center.x,y:r.center.y}),u=Math.sqrt(Math.abs((i.xScale??1)*(i.yScale??1))),f=(i.rotation??0)*Math.PI/180;a={...r,center:{...r.center,...c},radius:r.radius*u,startAngle:r.startAngle+f,endAngle:r.endAngle+f,_decomposedFrom:i}}}const o=z4(a);if(!o)continue;const l=t?V4(t,a):0;s.push({entity:a,svg:o,_dist:l})}return t&&s.sort((r,a)=>r._dist-a._dist),s.map(({entity:r,svg:a})=>({entity:r,svg:a}))}(f.entity,this._geomService.getParsedDxf(),r);return d.length>0?d.map(p=>({transform:f.transform,entity:p.entity,svg:p.svg})):[f]}return[f]}),u=l?.entity??null;return r?c.sort((f,d)=>{const p=u&&f.entity?._decomposedFrom===u?0:1,m=u&&d.entity?._decomposedFrom===u?0:1;return p!==m?p-m:V4(r,f.entity)-V4(r,d.entity)}):u&&c.sort((f,d)=>(f.entity?._decomposedFrom===u?0:1)-(d.entity?._decomposedFrom===u?0:1)),c}_cyclePolygonSelectHit(){const t=this._lastMousePos;if(!t)return;this._tabCyclePos&&Math.abs(this._tabCyclePos.clientX-t.clientX)<2&&Math.abs(this._tabCyclePos.clientY-t.clientY)<2&&0!==this._tabCycleHits.length?this._tabCycleIndex=(this._tabCycleIndex+1)%this._tabCycleHits.length:(this._tabCycleHits=this._buildSortedPolygonHits(t.clientX,t.clientY),this._tabCycleIndex=0,this._tabCyclePos=t);const s=this._tabCycleHits[this._tabCycleIndex];if(s){this.hoveredSvgItem.set({transform:s.transform,entity:s.entity,svg:s.svg}),this._polygonSelectService.hoveredHit.set(s);const r=this._clientToModelCoord(t.clientX,t.clientY);this._polygonSelectService.hoveredModelPt.set(r)}}constructor(){(0,ie.QZP)(()=>{const t=this.activeTool();if("svg-select"!==t&&"svg-polygon-select"!==t)return;const n=this.extractedGeometries();Object.keys(n).length>0||this._ensureGeometriesExtracted()}),(0,ie.QZP)(()=>{if(!this.autoExtractGeometries()||!this.layout())return;const n=this.extractedGeometries();Object.keys(n).length>0||this._ensureGeometriesExtracted().then(()=>{this.isAnalyzingSpaces.set(!0),this._cdref.detectChanges(),setTimeout(()=>{this.closedPolygons.set(this._geomService.analyzeClosedPolygons()),this.isAnalyzingSpaces.set(!1),this._cdref.detectChanges()},0)})}),(0,ie.QZP)(()=>{"svg-polygon-select"!==this.activeTool()&&(this._polygonSelectService.reset(),this.hoveredSvgItem.set(null),this._tabCycleHits=[],this._tabCyclePos=null)}),(0,ie.QZP)(()=>{const t=this.shadowContainer()?.nativeElement,n=this.layout();if(this.extractedGeometries(),this.extractedGeometriesVisible(),this.enableShadowHitTest())t&&n?((!this._shadowRoot||this._shadowRoot.host!==t)&&(this._shadowRoot=t.attachShadow({mode:"open"}),this._shadowRoot.innerHTML='<style>\nsvg { pointer-events: none; }\ng[data-visible="false"] { opacity: 0; }\n.dxf-path { stroke: var(--shadow-stroke, transparent); stroke-width: 10px; fill: none; pointer-events: stroke; cursor: pointer; vector-effect: non-scaling-stroke; }\n.dxf-path:hover { stroke: cyan; opacity: 0.5; }\ntext.dxf-path { stroke-width: 1px; fill: var(--shadow-stroke, transparent); pointer-events: auto; }\ntext.dxf-path:hover { fill: cyan; stroke: cyan; }\ncircle.dxf-path, ellipse.dxf-path { stroke: var(--shadow-stroke, transparent); stroke-width: 10px; fill: none; pointer-events: stroke; vector-effect: non-scaling-stroke; }\ncircle.dxf-path:hover, ellipse.dxf-path:hover { stroke: cyan; opacity: 0.5; }\n</style>',this._geomService.setShadowRoot(this._shadowRoot)),this._geomService.generateShadowSVG(n)):!n&&this._shadowRoot&&(this._geomService.clearShadowRoot(),this._shadowRoot=void 0);else if(this._shadowRoot){const r=this._shadowRoot.querySelector("svg");r&&r.remove()}})}onShadowClick(t){const n="block-first"===this.tabCycleOrder(),r=this._geomService.resolveFromComposedPath(t.composedPath())??this._geomService.handleShadowClick(t.clientX,t.clientY,n);r&&(this.shadowClicked.emit({entity:r.entity,svg:r.svg,transform:r.transform,clientX:t.clientX,clientY:t.clientY}),t.stopPropagation())}onDragSelectEnd(t){const n=this.shadowContainer()?.nativeElement;if(!n)return;const s=n.getBoundingClientRect(),c=this._geomService.getAllHitsInRect(s.left+t.left*s.width,s.top+t.top*s.height,s.left+t.right*s.width,s.top+t.bottom*s.height,t.mode);c.length>0&&this.shadowDragSelected.emit({hits:c,mode:t.mode})}getClosedPolygonsForLayer(t){return this._geomService.analyzeClosedPolygons().filter(n=>n.entity?.layer===t)}extractedOverlayVisible=(0,Lt.EW)(()=>{const t=this.extractedGeometries(),n=Object.keys(t)[0];return!!n&&(this.extractedGeometriesVisible()[n]??!1)});toggleExtractedOverlay(){const t=this.extractedGeometries(),n=Object.keys(t)[0];n&&this._geomService.toggleVisibility(n,!this.extractedOverlayVisible())}static \u0275fac=function(n){return new(n||i)};static \u0275cmp=A.VBU({type:i,selectors:[["cue-dxf-layout-viewer"]],viewQuery:function(n,s){1&n&&A.wEZ(s.shadowContainer,OM,5)(s._imageViewer,N4.ImageViewer,5),2&n&&A.NyB(2)},hostBindings:function(n,s){1&n&&A.bIt("mousemove",function(a){return s.onMouseMove(a)})("keydown",function(a){return s.onKeyDown(a)},A.tSv)},inputs:{layout:[1,"layout"],handlers:[1,"handlers"],showHitTest:[1,"showHitTest"],tools:[1,"tools"],activeTool:[1,"activeTool"],viewportSelectMode:[1,"viewportSelectMode"],autoExtractGeometries:[1,"autoExtractGeometries"],enableShadowHitTest:[1,"enableShadowHitTest"],tabCycleOrder:[1,"tabCycleOrder"],imageToolbarOptions:[1,"imageToolbarOptions"],imageActiveTool:[1,"imageActiveTool"],highlightedSvgItems:[1,"highlightedSvgItems"]},outputs:{imageActiveTool:"imageActiveToolChange",pointDrawn:"pointDrawn",svgItemsSelected:"svgItemsSelected",polygonSelected:"polygonSelected",viewportSelected:"viewportSelected",shadowClicked:"shadowClicked",shadowDragSelected:"shadowDragSelected"},features:[A.Jv_([zu,Ku])],decls:7,vars:16,consts:[["shadowContainer",""],[1,"layout-viewer-container"],[3,"activeToolChange","src","drawingArtefacts","contextMenuItems","toolbarOptions","activeTool"],["cueDragSelect","",1,"dxf-shadow-container",2,"position","absolute","top","0","left","0","width","100%","height","100%",3,"dragSelectEnd","click","mousemove","mouseleave"],[1,"dxf-tool-overlay",2,"position","absolute","top","0","left","0","width","100%","height","100%","z-index","20","pointer-events","all",3,"cursor"],[1,"hit-test-toggle"],["variant","default",1,"padded","match-card"],[1,"dxf-tool-overlay",2,"position","absolute","top","0","left","0","width","100%","height","100%","z-index","20","pointer-events","all",3,"click","mouseleave"],[1,"hit-test-toggle",3,"click"],["size","s","weight","semibold"],["size","s"]],template:function(n,s){if(1&n){const r=A.RV6();A.j41(0,"div",1)(1,"cue-image-viewer",2),A.mxI("activeToolChange",function(o){return ie.eBV(r),A.DH7(s.imageActiveTool,o)||(s.imageActiveTool=o),ie.Njj(o)}),A.j41(2,"div",3,0),A.bIt("dragSelectEnd",function(o){return s.onDragSelectEnd(o)})("click",function(o){return s.onShadowContainerClick(o)})("mousemove",function(o){return s.onShadowContainerMouseMove(o)})("mouseleave",function(){return s.onShadowContainerMouseLeave()}),A.k0s(),A.nVh(4,NM,1,2,"div",4),A.k0s(),A.nVh(5,kM,2,1,"button",5),A.nVh(6,UM,5,2,"cue-card",6),A.k0s()}if(2&n){let r;A.R7$(),A.Y8G("src",s.layout().url)("drawingArtefacts",s.layoutArtefacts())("contextMenuItems",s.imageViewerContextMenu())("toolbarOptions",s.imageToolbarOptions()),A.R50("activeTool",s.imageActiveTool),A.R7$(),A.xc7("cursor",s.viewportSelectMode()&&!s.activeTool()?"crosshair":"svg-select"===s.activeTool()||"svg-polygon-select"===s.activeTool()||s.hoveredSvgItem()?s.toolCursor():"default")("z-index","svg-select"===s.activeTool()||"svg-polygon-select"===s.activeTool()||s.viewportSelectMode()||"select"===s.imageActiveTool()||s.hoveredSvgItem()?20:10)("pointer-events","svg-select"===s.activeTool()||"svg-polygon-select"===s.activeTool()||s.viewportSelectMode()||"select"===s.imageActiveTool()||s.hoveredSvgItem()?"all":"none")("--shadow-stroke",s.showShadowDom()?"magenta":"transparent"),A.R7$(2),A.vxM(s.activeTool()&&"svg-select"!==s.activeTool()&&"svg-polygon-select"!==s.activeTool()?4:-1),A.R7$(),A.vxM(s.showHitTest()?5:-1),A.R7$(),A.vxM((r=s.activeMatch())?6:-1,r)}},dependencies:[Pi.MD,N4.ImageViewer,Bu.Z,F4.o,FM],styles:["[_nghost-%COMP%]{display:block;width:100%;height:100%;position:relative}.layout-viewer-container[_ngcontent-%COMP%]{width:100%;height:100%;position:relative;background:#f0f0f0}.hit-test-toggle[_ngcontent-%COMP%]{position:absolute;top:10px;right:10px;z-index:100;cursor:pointer;background:#fff;padding:10px 14px;border-radius:6px;box-shadow:0 4px 12px #00000026;border:1px solid rgba(0,0,0,.1);font-size:12px;font-weight:600;transition:all .2s ease}.hit-test-toggle[_ngcontent-%COMP%]:hover{background:#f8f8f8;transform:translateY(-1px);box-shadow:0 6px 16px #0003}.hit-test-toggle[_ngcontent-%COMP%]:active{transform:translateY(0)}.match-card[_ngcontent-%COMP%]{position:absolute;top:20px;left:50%;transform:translate(-50%);z-index:100;pointer-events:none;display:flex;flex-direction:column;gap:4px;background:#fffffff2;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);border:1px solid rgba(0,0,0,.05);box-shadow:0 4px 20px #0000001a;min-width:200px}"]})}return i})();const GM=["canvas"],zM=()=>[];function HM(i,e){if(1&i&&A.nrm(0,"cue-dxf-layout-viewer",3),2&i){const t=A.XpG();A.Y8G("layout",e)("handlers",t.dxfLayoutHandlers)}}function VM(i,e){if(1&i){const t=A.RV6();A.j41(0,"cue-dxf-toolbar",7),A.bIt("layersVisibleChange",function(s){ie.eBV(t);const r=A.XpG(3);return ie.Njj(r.toggleLayerPanel(s))})("layoutsVisibleChange",function(s){ie.eBV(t);const r=A.XpG(3);return ie.Njj(r.toggleLayoutPanel(s))}),A.mxI("blackBackgroundChange",function(s){ie.eBV(t);const r=A.XpG(3);return A.DH7(r.blackBackground,s)||(r.blackBackground=s),ie.Njj(s)}),A.k0s()}if(2&i){const t=A.XpG(),n=A.XpG(2);A.Aen(n.toolbarStyle()),A.Y8G("options",t)("layersVisible",n.showLayerPanel())("layoutsVisible",n.showLayoutPanel()),A.R50("blackBackground",n.blackBackground),A.Y8G("hasLayouts",n.drawingHasLayouts())}}function WM(i,e){1&i&&A.nVh(0,VM,1,7,"cue-dxf-toolbar",6),2&i&&A.vxM(e.hidden?-1:0)}function XM(i,e){if(1&i&&A.nVh(0,WM,1,1),2&i){let t;const n=A.XpG();A.vxM((t=n.toolbarOptions())?0:-1,t)}}function YM(i,e){if(1&i){const t=A.RV6();A.j41(0,"cue-layers",8),A.bIt("close",function(){ie.eBV(t);const s=A.XpG();return ie.Njj(s.showLayerPanel.set(!1))}),A.k0s()}if(2&i){const t=A.XpG();A.Y8G("layers",t.layers)}}function qM(i,e){if(1&i){const t=A.RV6();A.j41(0,"cue-layouts",9),A.bIt("close",function(){ie.eBV(t);const s=A.XpG();return ie.Njj(s.closeLayoutPanel())})("layoutSelected",function(s){ie.eBV(t);const r=A.XpG();return ie.Njj(r.onLayoutSelected(s))}),A.k0s()}if(2&i){const t=A.XpG();A.Y8G("layouts",t.layoutInfo()??A.lJ4(1,zM))}}let ZM=(()=>{class i{_service=(0,ie.WQX)(D4);_events=(0,ie.WQX)(L4);_annotationService=(0,ie.WQX)(I4);_cdref=(0,ie.WQX)(ke.gRc);fileURL=ke.hFB.required();layoutInfo=(0,ke.hFB)();settings=(0,ke.hFB)(new Kn.As);annotationMarkers=(0,ke.hFB)([]);showLayerPanel=(0,ke.geq)(!1);blackBackground=(0,ke.geq)(!1);viewerOptions=(0,Lt.uu)(()=>this.settings()?.viewerOptions);toolbarOptions=(0,Lt.uu)(()=>this.settings()?.toolbar);showLayoutPanel=(0,ie.vPA)(!1);selectedLayout=(0,ie.vPA)(null);drawingHasLayouts=(0,Lt.EW)(()=>void 0!==this.layoutInfo()&&this.layoutInfo().length>0);modelLoaded=(0,ke.CGW)();drawingClick=(0,ke.CGW)();_canvas;set content(t){if(t){if(this._canvas===t.nativeElement||(this._canvas=t.nativeElement,void 0===this._canvas))return;this._service.canvas=this._canvas,this._service.viewerOptions=this.viewerOptions(),this._service.buildViewer()}}layersComponent;dxfLayoutHandlers={getParsedDxf:(()=>{var n,t=this;return n=(0,pt.A)(function*(){return t._service.parsedDxf}),function(){return n.apply(this,arguments)}})()};_lastMousePos=null;onMouseMove(t){this._lastMousePos={clientX:t.clientX,clientY:t.clientY}}onKeyDown(t){}isLoading=(0,ie.vPA)(!1);loadingMessage=(0,ie.vPA)("");layers=[];canvasRect;toolbarStyle=(0,Lt.EW)(()=>{const t=this.toolbarOptions();return{position:"absolute",left:t.margin,right:t.margin,["top"===t.position?"top":"bottom"]:t.margin,"z-index":"10",display:"flex","justify-content":"center"}});onShadowClick(t){}constructor(){var t=this;console.log("DXFViewer: constructor initialized"),(0,ie.QZP)(()=>{this._cdref.detectChanges()}),(0,ie.QZP)(()=>{this._events.modelLoaded()&&this.modelLoaded.emit()}),(0,ie.QZP)(()=>{const n=this._events.drawingClicked();void 0!==n&&this.drawingClick.emit(n)}),(0,ie.QZP)(()=>{const n=this.selectedLayout();console.log("DXFViewer: selectedLayout changed to:",n?.name,"truthy:",!!n)}),(0,ie.QZP)(()=>{this._service.viewerOptions=this.viewerOptions()}),(0,ie.QZP)(()=>{this._service.setDarkBackground(this.blackBackground())}),(0,ie.QZP)((0,pt.A)(function*(){console.log("DXFViewer: fileURL effect triggered. url:",t.fileURL()),void 0!==t.fileURL()&&void 0!==t.settings()&&(yield t.loadFile(t.fileURL()))}))}ngOnDestroy(){this._service.destroy(),this._annotationService.dispose()}loadFile(t){var n=this;return(0,pt.A)(function*(){n.isLoading.set(!0),n._cdref.detectChanges();try{console.log("DXFViewer: loading file:",t),yield n._service.load(t,n.settings().fonts),console.log("DXFViewer: load complete")}catch(s){console.error("DXFViewer: load error:",s)}finally{n.isLoading.set(!1)}n.layers=n._service.getLayers(),console.log("DXFViewer: layers loaded:",n.layers.length),n.annotationMarkers().length&&n._annotationService.addAnnotations(n.annotationMarkers())})()}trackProgress(t){switch(t){case"font":this.loadingMessage.set("Fetching fonts...");break;case"fetch":this.loadingMessage.set("Fetching file...");break;case"parse":this.loadingMessage.set("Parsing file...");break;case"prepare":this.loadingMessage.set("Preparing rendering data...")}this._cdref.detectChanges()}onResized(t){this.canvasRect=t.newRect,this._service.resize(this.canvasRect)}onLayoutSelected(t){console.log("DXFViewer.onLayoutSelected:",t?.name),this.selectedLayout.set(t?{...t}:null)}toggleLayerPanel(t){this.showLayerPanel.set(t),t&&this.closeLayoutPanel()}toggleLayoutPanel(t){this.showLayoutPanel.set(t),t?this.showLayerPanel.set(!1):this.selectedLayout.set(null)}closeLayoutPanel(){this.showLayoutPanel.set(!1),this.selectedLayout.set(null)}static \u0275fac=function(n){return new(n||i)};static \u0275cmp=A.VBU({type:i,selectors:[["cue-dxf-viewer"]],viewQuery:function(n,s){if(1&n&&A.GBs(GM,5)(Uu,5),2&n){let r;A.mGM(r=A.lsd())&&(s.content=r.first),A.mGM(r=A.lsd())&&(s.layersComponent=r.first)}},hostBindings:function(n,s){1&n&&A.bIt("mousemove",function(a){return s.onMouseMove(a)})("keydown",function(a){return s.onKeyDown(a)},A.tSv)},inputs:{fileURL:[1,"fileURL"],layoutInfo:[1,"layoutInfo"],settings:[1,"settings"],annotationMarkers:[1,"annotationMarkers"],showLayerPanel:[1,"showLayerPanel"],blackBackground:[1,"blackBackground"]},outputs:{showLayerPanel:"showLayerPanelChange",blackBackground:"blackBackgroundChange",modelLoaded:"modelLoaded",drawingClick:"drawingClick"},features:[A.Jv_([D4,L4,I4])],decls:7,vars:8,consts:[["canvas",""],[1,"wrapper"],["cueLoadingOverlay","","cueResized","",1,"canvas",3,"resized","displayLoading","loadingMessage"],[1,"layout-viewer",3,"layout","handlers"],[3,"layers"],[3,"layouts"],[3,"options","style","layersVisible","layoutsVisible","blackBackground","hasLayouts"],[3,"layersVisibleChange","layoutsVisibleChange","blackBackgroundChange","options","layersVisible","layoutsVisible","blackBackground","hasLayouts"],[3,"close","layers"],[3,"close","layoutSelected","layouts"]],template:function(n,s){if(1&n&&(A.j41(0,"div",1)(1,"div",2,0),A.bIt("resized",function(a){return s.onResized(a)}),A.k0s(),A.nVh(3,HM,1,2,"cue-dxf-layout-viewer",3),A.nVh(4,XM,1,1),A.nVh(5,YM,1,1,"cue-layers",4),A.nVh(6,qM,1,2,"cue-layouts",5),A.k0s()),2&n){let r;A.R7$(),A.xc7("visibility",null!==s.selectedLayout()?"hidden":"visible"),A.Y8G("displayLoading",s.isLoading())("loadingMessage",s.loadingMessage()),A.R7$(2),A.vxM((r=s.selectedLayout())?3:-1,r),A.R7$(),A.vxM(s.selectedLayout()?-1:4),A.R7$(),A.vxM(s.showLayerPanel()?5:-1),A.R7$(),A.vxM(s.showLayoutPanel()?6:-1)}},dependencies:[Pi.MD,Uu,uM,dM,pM.C,EM,BM],styles:["[_nghost-%COMP%]{display:block;width:100%;height:100%}.wrapper[_ngcontent-%COMP%]{position:relative;width:100%;height:100%;overflow:hidden}.canvas[_ngcontent-%COMP%], .layout-viewer[_ngcontent-%COMP%]{position:absolute;top:0;left:0;width:100%;height:100%}.menu[_ngcontent-%COMP%]{position:absolute;bottom:20px;left:50%;right:50%}.toolbar-container[_ngcontent-%COMP%]{position:absolute;display:flex;flex-direction:row;justify-content:center;pointer-events:none;right:0;bottom:0;width:100%;z-index:100}.hidden[_ngcontent-%COMP%]{visibility:hidden} .xywh-box{pointer-events:all;color:#fff;background-color:#dcf00066;border:1px solid yellow;font-family:sans-serif;padding:2px;background:#0009} .clickable:hover, .dxf-path:hover{cursor:pointer} cue-image-viewer svg g[title*=Extracted] *{vector-effect:non-scaling-stroke;fill:transparent!important}"]})}return i})()},190(k1,Ra,dt){var Pn,pt;!function(){"use strict";Pn=function(){var Pi=function(){},ie="undefined",ke=typeof window!==ie&&typeof window.navigator!==ie&&/Trident\/|MSIE /.test(window.navigator.userAgent),Lt=["trace","debug","info","warn","error"],Kn={},Nt=null;function br(je,qt){var lt=je[qt];if("function"==typeof lt.bind)return lt.bind(je);try{return Function.prototype.bind.call(lt,je)}catch{return function(){return Function.prototype.apply.apply(lt,[je,arguments])}}}function U1(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function ze(){for(var je=this.getLevel(),qt=0;qt<Lt.length;qt++){var lt=Lt[qt];this[lt]=qt<je?Pi:this.methodFactory(lt,je,this.name)}if(this.log=this.debug,typeof console===ie&&je<this.levels.SILENT)return"No console available for logging"}function B1(je){return function(){typeof console!==ie&&(ze.call(this),this[je].apply(this,arguments))}}function G1(je,qt,lt){return function Sr(je){return"debug"===je&&(je="log"),typeof console!==ie&&("trace"===je&&ke?U1:void 0!==console[je]?br(console,je):void 0!==console.log?br(console,"log"):Pi)}(je)||B1.apply(this,arguments)}function Ve(je,qt){var $n,Ri,fn,lt=this,d0="loglevel";function ms(){var Et;if(typeof window!==ie&&d0){try{Et=window.localStorage[d0]}catch{}if(typeof Et===ie)try{var Zt=window.document.cookie,Qn=encodeURIComponent(d0),vs=Zt.indexOf(Qn+"=");-1!==vs&&(Et=/^([^;]+)/.exec(Zt.slice(vs+Qn.length+1))[1])}catch{}return void 0===lt.levels[Et]&&(Et=void 0),Et}}function Rn(Et){var Zt=Et;if("string"==typeof Zt&&void 0!==lt.levels[Zt.toUpperCase()]&&(Zt=lt.levels[Zt.toUpperCase()]),"number"==typeof Zt&&Zt>=0&&Zt<=lt.levels.SILENT)return Zt;throw new TypeError("log.setLevel() called with invalid level: "+Et)}"string"==typeof je?d0+=":"+je:"symbol"==typeof je&&(d0=void 0),lt.name=je,lt.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},lt.methodFactory=qt||G1,lt.getLevel=function(){return fn??Ri??$n},lt.setLevel=function(Et,Zt){return fn=Rn(Et),!1!==Zt&&function Mr(Et){var Zt=(Lt[Et]||"silent").toUpperCase();if(typeof window!==ie&&d0){try{return void(window.localStorage[d0]=Zt)}catch{}try{window.document.cookie=encodeURIComponent(d0)+"="+Zt+";"}catch{}}}(fn),ze.call(lt)},lt.setDefaultLevel=function(Et){Ri=Rn(Et),ms()||lt.setLevel(Et,!1)},lt.resetLevel=function(){fn=null,function Er(){if(typeof window!==ie&&d0){try{window.localStorage.removeItem(d0)}catch{}try{window.document.cookie=encodeURIComponent(d0)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}(),ze.call(lt)},lt.enableAll=function(Et){lt.setLevel(lt.levels.TRACE,Et)},lt.disableAll=function(Et){lt.setLevel(lt.levels.SILENT,Et)},lt.rebuild=function(){if(Nt!==lt&&($n=Rn(Nt.getLevel())),ze.call(lt),Nt===lt)for(var Et in Kn)Kn[Et].rebuild()},$n=Rn(Nt?Nt.getLevel():"WARN");var gs=ms();null!=gs&&(fn=Rn(gs)),ze.call(lt)}(Nt=new Ve).getLogger=function(qt){if("symbol"!=typeof qt&&"string"!=typeof qt||""===qt)throw new TypeError("You must supply a name when creating a logger.");var lt=Kn[qt];return lt||(lt=Kn[qt]=new Ve(qt,Nt.methodFactory)),lt};var La=typeof window!==ie?window.log:void 0;return Nt.noConflict=function(){return typeof window!==ie&&window.log===Nt&&(window.log=La),Nt},Nt.getLoggers=function(){return Kn},Nt.default=Nt,Nt},void 0!==(pt=Pn.call(Ra,dt,Ra,k1))&&(k1.exports=pt)}()},7256(){}}]);