Files
anonymous_github/public/script/vendor.min.js
T

2 lines
1.1 MiB
Plaintext
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
function markedMermaid(e){return{extensions:[{name:"mermaid",level:"block",start(e){return e.match(/^```mermaid/m)?.index},tokenizer(e,t){e=/^```mermaid\n([\s\S]*?)\n```/.exec(e);if(e)return{type:"mermaid",raw:e[0],text:e[1].trim()}},renderer(e){const t="mermaid-"+Math.random().toString(36).substr(2,9);e=`<div class="mermaid" id="${t}">${e.text}</div>`;return"undefined"==typeof mermaid&&"function"==typeof window.loadMermaid&&window.loadMermaid(),setTimeout(()=>{if("undefined"!=typeof mermaid){window.mermaidInitialized||(mermaid.initialize({startOnLoad:!1,theme:"default",securityLevel:"strict"}),window.mermaidInitialized=!0);try{var e=document.getElementById(t);e&&!e.getAttribute("data-processed")&&(mermaid.init(void 0,e),e.setAttribute("data-processed","true"))}catch(e){console.error("Mermaid rendering error:",e)}}},100),e}}]}}!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=e.pdfjsLib=t():"function"==typeof define&&define.amd?define("pdfjs-dist/build/pdf",[],()=>e.pdfjsLib=t()):"object"==typeof exports?exports["pdfjs-dist/build/pdf"]=e.pdfjsLib=t():e["pdfjs-dist/build/pdf"]=e.pdfjsLib=t()}(globalThis,()=>(()=>{"use strict";var __webpack_modules__=[,(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.VerbosityLevel=t.Util=t.UnknownErrorException=t.UnexpectedResponseException=t.TextRenderingMode=t.RenderingIntentFlag=t.PromiseCapability=t.PermissionFlag=t.PasswordResponses=t.PasswordException=t.PageActionEventType=t.OPS=t.MissingPDFException=t.MAX_IMAGE_SIZE_TO_CACHE=t.LINE_FACTOR=t.LINE_DESCENT_FACTOR=t.InvalidPDFException=t.ImageKind=t.IDENTITY_MATRIX=t.FormatError=t.FeatureTest=t.FONT_IDENTITY_MATRIX=t.DocumentActionEventType=t.CMapCompressionType=t.BaseException=t.BASELINE_FACTOR=t.AnnotationType=t.AnnotationReplyType=t.AnnotationPrefix=t.AnnotationMode=t.AnnotationFlag=t.AnnotationFieldFlag=t.AnnotationEditorType=t.AnnotationEditorPrefix=t.AnnotationEditorParamsType=t.AnnotationBorderStyleType=t.AnnotationActionEventType=t.AbortException=void 0,t.assert=function(e,t){e||s(t)},t.bytesToString=h,t.createValidAbsoluteUrl=function(e){let t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null,i=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(e)try{if(i&&"string"==typeof e){if(i.addDefaultProtocol&&e.startsWith("www.")){const t=e.match(/\./g);2<=t?.length&&(e="http://"+e)}if(i.tryConvertEncoding)try{e=p(e)}catch{}}var n=t?new URL(e,t):new URL(e);if(function(e){switch(e?.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return 1;default:return}}(n))return n}catch{}return null},t.getModificationDate=function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:new Date;return[e.getUTCFullYear().toString(),(e.getUTCMonth()+1).toString().padStart(2,"0"),e.getUTCDate().toString().padStart(2,"0"),e.getUTCHours().toString().padStart(2,"0"),e.getUTCMinutes().toString().padStart(2,"0"),e.getUTCSeconds().toString().padStart(2,"0")].join("")},t.getUuid=function(){if("undefined"!=typeof crypto&&"function"==typeof crypto?.randomUUID)return crypto.randomUUID();var t=new Uint8Array(32);if("undefined"!=typeof crypto&&"function"==typeof crypto?.getRandomValues)crypto.getRandomValues(t);else for(let e=0;e<32;e++)t[e]=Math.floor(255*Math.random());return h(t)},t.getVerbosityLevel=function(){return r},t.info=function(e){r>=n.INFOS&&console.log("Info: "+e)},t.isArrayBuffer=function(e){return"object"==typeof e&&void 0!==e?.byteLength},t.isArrayEqual=function(i,n){if(i.length!==n.length)return!1;for(let e=0,t=i.length;e<t;e++)if(i[e]!==n[e])return!1;return!0},t.isNodeJS=void 0,t.normalizeUnicode=function(e){return m||(m=/([\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,g=new Map([["ſt","ſt"]])),e.replaceAll(m,(e,t,i)=>t?t.normalize("NFKC"):g.get(i))},t.objectFromMap=function(e){var t,i,n=Object.create(null);for([t,i]of e)n[t]=i;return n},t.objectSize=function(e){return Object.keys(e).length},t.setVerbosityLevel=function(e){Number.isInteger(e)&&(r=e)},t.shadow=a,t.string32=function(e){return String.fromCharCode(e>>24&255,e>>16&255,e>>8&255,255&e)},t.stringToBytes=c,t.stringToPDFString=function(i){if("ï"<=i[0]){let e;if("þ"===i[0]&&"ÿ"===i[1]?e="utf-16be":"ÿ"===i[0]&&"þ"===i[1]?e="utf-16le":"ï"===i[0]&&"»"===i[1]&&"¿"===i[2]&&(e="utf-8"),e)try{var t=new TextDecoder(e,{fatal:!0}),n=c(i);return t.decode(n)}catch(i){o(`stringToPDFString: "${i}".`)}}var r=[];for(let e=0,t=i.length;e<t;e++){var s=u[i.charCodeAt(e)];r.push(s?String.fromCharCode(s):i.charAt(e))}return r.join("")},t.stringToUTF8String=p,t.unreachable=s,t.utf8StringToString=function(e){return unescape(encodeURIComponent(e))},t.warn=o,i(2),i(84),i(86),i(87),i(89),i(93),i(101),i(102),i(105),i(107),i(109),i(113),i(116),i(123);i=!("object"!=typeof process||process+""!="[object process]"||process.versions.nw||process.versions.electron&&process.type&&"browser"!==process.type);t.isNodeJS=i,t.IDENTITY_MATRIX=[1,0,0,1,0,0],t.FONT_IDENTITY_MATRIX=[.001,0,0,.001,0,0],t.MAX_IMAGE_SIZE_TO_CACHE=1e7,t.LINE_FACTOR=1.35,t.LINE_DESCENT_FACTOR=.35,t.BASELINE_FACTOR=.25925925925925924,t.RenderingIntentFlag={ANY:1,DISPLAY:2,PRINT:4,SAVE:8,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,OPLIST:256},t.AnnotationMode={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},t.AnnotationEditorPrefix="pdfjs_internal_editor_",t.AnnotationEditorType={DISABLE:-1,NONE:0,FREETEXT:3,STAMP:13,INK:15},t.AnnotationEditorParamsType={RESIZE:1,CREATE:2,FREETEXT_SIZE:11,FREETEXT_COLOR:12,FREETEXT_OPACITY:13,INK_COLOR:21,INK_THICKNESS:22,INK_OPACITY:23},t.PermissionFlag={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},t.TextRenderingMode={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_ADD_TO_PATH:4,STROKE_ADD_TO_PATH:5,FILL_STROKE_ADD_TO_PATH:6,ADD_TO_PATH:7,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4},t.ImageKind={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},t.AnnotationType={TEXT:1,LINK:2,FREETEXT:3,LINE:4,SQUARE:5,CIRCLE:6,POLYGON:7,POLYLINE:8,HIGHLIGHT:9,UNDERLINE:10,SQUIGGLY:11,STRIKEOUT:12,STAMP:13,CARET:14,INK:15,POPUP:16,FILEATTACHMENT:17,SOUND:18,MOVIE:19,WIDGET:20,SCREEN:21,PRINTERMARK:22,TRAPNET:23,WATERMARK:24,THREED:25,REDACT:26},t.AnnotationReplyType={GROUP:"Group",REPLY:"R"},t.AnnotationFlag={INVISIBLE:1,HIDDEN:2,PRINT:4,NOZOOM:8,NOROTATE:16,NOVIEW:32,READONLY:64,LOCKED:128,TOGGLENOVIEW:256,LOCKEDCONTENTS:512},t.AnnotationFieldFlag={READONLY:1,REQUIRED:2,NOEXPORT:4,MULTILINE:4096,PASSWORD:8192,NOTOGGLETOOFF:16384,RADIO:32768,PUSHBUTTON:65536,COMBO:131072,EDIT:262144,SORT:524288,FILESELECT:1048576,MULTISELECT:2097152,DONOTSPELLCHECK:4194304,DONOTSCROLL:8388608,COMB:16777216,RICHTEXT:33554432,RADIOSINUNISON:33554432,COMMITONSELCHANGE:67108864},t.AnnotationBorderStyleType={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5},t.AnnotationActionEventType={E:"Mouse Enter",X:"Mouse Exit",D:"Mouse Down",U:"Mouse Up",Fo:"Focus",Bl:"Blur",PO:"PageOpen",PC:"PageClose",PV:"PageVisible",PI:"PageInvisible",K:"Keystroke",F:"Format",V:"Validate",C:"Calculate"},t.DocumentActionEventType={WC:"WillClose",WS:"WillSave",DS:"DidSave",WP:"WillPrint",DP:"DidPrint"},t.PageActionEventType={O:"PageOpen",C:"PageClose"};const n={ERRORS:0,WARNINGS:1,INFOS:5};t.VerbosityLevel=n,t.CMapCompressionType={NONE:0,BINARY:1},t.OPS={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},t.PasswordResponses={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};let r=n.WARNINGS;function o(e){r>=n.WARNINGS&&console.log("Warning: "+e)}function s(e){throw new Error(e)}function a(e,t,i){return Object.defineProperty(e,t,{value:i,enumerable:!(3<arguments.length&&void 0!==arguments[3]&&arguments[3]),configurable:!0,writable:!1}),i}l.prototype=new Error;i=l.constructor=l;function l(e,t){this.constructor===l&&s("Cannot initialize BaseException."),this.message=e,this.name=t}function h(t){"object"==typeof t&&void 0!==t?.length||s("Invalid argument for bytesToString");var i=t.length;if(i<8192)return String.fromCharCode.apply(null,t);var n=[];for(let e=0;e<i;e+=8192){var r=Math.min(e+8192,i),r=t.subarray(e,r);n.push(String.fromCharCode.apply(null,r))}return n.join("")}function c(t){"string"!=typeof t&&s("Invalid argument for stringToBytes");var i=t.length,n=new Uint8Array(i);for(let e=0;e<i;++e)n[e]=255&t.charCodeAt(e);return n}t.BaseException=i,t.PasswordException=class extends i{constructor(e,t){super(e,"PasswordException"),this.code=t}},t.UnknownErrorException=class extends i{constructor(e,t){super(e,"UnknownErrorException"),this.details=t}},t.InvalidPDFException=class extends i{constructor(e){super(e,"InvalidPDFException")}},t.MissingPDFException=class extends i{constructor(e){super(e,"MissingPDFException")}},t.UnexpectedResponseException=class extends i{constructor(e,t){super(e,"UnexpectedResponseException"),this.status=t}},t.FormatError=class extends i{constructor(e){super(e,"FormatError")}},t.AbortException=class extends i{constructor(e){super(e,"AbortException")}},t.FeatureTest=class{static get isLittleEndian(){return a(this,"isLittleEndian",((e=new Uint8Array(4))[0]=1)===new Uint32Array(e.buffer,0,1)[0]);var e}static get isEvalSupported(){return a(this,"isEvalSupported",function(){try{return new Function(""),!0}catch{return!1}}())}static get isOffscreenCanvasSupported(){return a(this,"isOffscreenCanvasSupported","undefined"!=typeof OffscreenCanvas)}static get platform(){return"undefined"==typeof navigator?a(this,"platform",{isWin:!1,isMac:!1}):a(this,"platform",{isWin:navigator.platform.includes("Win"),isMac:navigator.platform.includes("Mac")})}static get isCSSRoundSupported(){return a(this,"isCSSRoundSupported",globalThis.CSS?.supports?.("width: round(1.5px, 1px)"))}};const d=[...Array(256).keys()].map(e=>e.toString(16).padStart(2,"0")),u=(t.Util=class{static makeHexColor(e,t,i){return"#"+d[e]+d[t]+d[i]}static scaleMinMax(e,t){let i;e[0]?(e[0]<0&&(i=t[0],t[0]=t[1],t[1]=i),t[0]*=e[0],t[1]*=e[0],e[3]<0&&(i=t[2],t[2]=t[3],t[3]=i),t[2]*=e[3],t[3]*=e[3]):(i=t[0],t[0]=t[2],t[2]=i,i=t[1],t[1]=t[3],t[3]=i,e[1]<0&&(i=t[2],t[2]=t[3],t[3]=i),t[2]*=e[1],t[3]*=e[1],e[2]<0&&(i=t[0],t[0]=t[1],t[1]=i),t[0]*=e[2],t[1]*=e[2]),t[0]+=e[4],t[1]+=e[4],t[2]+=e[5],t[3]+=e[5]}static transform(e,t){return[e[0]*t[0]+e[2]*t[1],e[1]*t[0]+e[3]*t[1],e[0]*t[2]+e[2]*t[3],e[1]*t[2]+e[3]*t[3],e[0]*t[4]+e[2]*t[5]+e[4],e[1]*t[4]+e[3]*t[5]+e[5]]}static applyTransform(e,t){return[e[0]*t[0]+e[1]*t[2]+t[4],e[0]*t[1]+e[1]*t[3]+t[5]]}static applyInverseTransform(e,t){var i=t[0]*t[3]-t[1]*t[2];return[(e[0]*t[3]-e[1]*t[2]+t[2]*t[5]-t[4]*t[3])/i,(-e[0]*t[1]+e[1]*t[0]+t[4]*t[1]-t[5]*t[0])/i]}static getAxialAlignedBoundingBox(e,t){var i=this.applyTransform(e,t),n=this.applyTransform(e.slice(2,4),t),r=this.applyTransform([e[0],e[3]],t),e=this.applyTransform([e[2],e[1]],t);return[Math.min(i[0],n[0],r[0],e[0]),Math.min(i[1],n[1],r[1],e[1]),Math.max(i[0],n[0],r[0],e[0]),Math.max(i[1],n[1],r[1],e[1])]}static inverseTransform(e){var t=e[0]*e[3]-e[1]*e[2];return[e[3]/t,-e[1]/t,-e[2]/t,e[0]/t,(e[2]*e[5]-e[4]*e[3])/t,(e[4]*e[1]-e[5]*e[0])/t]}static singularValueDecompose2dScale(e){var t=[e[0],e[2],e[1],e[3]],i=e[0]*t[0]+e[1]*t[2],n=e[0]*t[1]+e[1]*t[3],r=e[2]*t[0]+e[3]*t[2],e=e[2]*t[1]+e[3]*t[3],t=(i+e)/2,i=Math.sqrt((i+e)**2-4*(i*e-r*n))/2,e=t-i||1;return[Math.sqrt(t+i||1),Math.sqrt(e)]}static normalizeRect(e){var t=e.slice(0);return e[0]>e[2]&&(t[0]=e[2],t[2]=e[0]),e[1]>e[3]&&(t[1]=e[3],t[3]=e[1]),t}static intersect(e,t){var i,n=Math.max(Math.min(e[0],e[2]),Math.min(t[0],t[2])),r=Math.min(Math.max(e[0],e[2]),Math.max(t[0],t[2]));return r<n||(i=Math.max(Math.min(e[1],e[3]),Math.min(t[1],t[3])),(e=Math.min(Math.max(e[1],e[3]),Math.max(t[1],t[3])))<i)?null:[n,i,r,e]}static bezierBoundingBox(t,i,n,r,s,o,a,l){var h=[],e=[[],[]];let c,d,u,p,m,g,f,v;for(let e=0;e<2;++e)u=0===e?(d=6*t-12*n+6*s,c=-3*t+9*n-9*s+3*a,3*n-3*t):(d=6*i-12*r+6*o,c=-3*i+9*r-9*o+3*l,3*r-3*i),Math.abs(c)<1e-12?Math.abs(d)<1e-12||0<(p=-u/d)&&p<1&&h.push(p):(f=d*d-4*u*c,v=Math.sqrt(f),f<0||(0<(m=(-d+v)/(2*c))&&m<1&&h.push(m),0<(g=(-d-v)/(2*c))&&g<1&&h.push(g)));let y,b=h.length;for(var w=b;b--;)y=1-(p=h[b]),e[0][b]=y*y*y*t+3*y*y*p*n+3*y*p*p*s+p*p*p*a,e[1][b]=y*y*y*i+3*y*y*p*r+3*y*p*p*o+p*p*p*l;return e[0][w]=t,e[1][w]=i,e[0][w+1]=a,e[1][w+1]=l,e[0].length=e[1].length=w+2,[Math.min(...e[0]),Math.min(...e[1]),Math.max(...e[0]),Math.max(...e[1])]}},[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,728,711,710,729,733,731,730,732,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8226,8224,8225,8230,8212,8211,402,8260,8249,8250,8722,8240,8222,8220,8221,8216,8217,8218,8482,64257,64258,321,338,352,376,381,305,322,339,353,382,0,8364]);function p(e){return decodeURIComponent(escape(e))}t.PromiseCapability=class{#t=!1;constructor(){this.promise=new Promise((t,i)=>{this.resolve=e=>{this.#t=!0,t(e)},this.reject=e=>{this.#t=!0,i(e)}})}get settled(){return this.#t}};let m=null,g=null;t.AnnotationPrefix="pdfjs_internal_id_"},(e,t,i)=>{function n(e,t){var i={};i[e]=l(e,t,d),s({global:!0,constructor:!0,arity:1,forced:d},i)}function r(e,t){var i;c&&c[e]&&((i={})[e]=l(h+"."+e,t,d),s({target:h,stat:!0,constructor:!0,arity:1,forced:d},i))}var s=i(3),o=i(4),a=i(69),l=i(70),h="WebAssembly",c=o[h],d=7!==Error("e",{cause:7}).cause;n("Error",function(t){return function(e){return a(t,this,arguments)}}),n("EvalError",function(t){return function(e){return a(t,this,arguments)}}),n("RangeError",function(t){return function(e){return a(t,this,arguments)}}),n("ReferenceError",function(t){return function(e){return a(t,this,arguments)}}),n("SyntaxError",function(t){return function(e){return a(t,this,arguments)}}),n("TypeError",function(t){return function(e){return a(t,this,arguments)}}),n("URIError",function(t){return function(e){return a(t,this,arguments)}}),r("CompileError",function(t){return function(e){return a(t,this,arguments)}}),r("LinkError",function(t){return function(e){return a(t,this,arguments)}}),r("RuntimeError",function(t){return function(e){return a(t,this,arguments)}})},(e,t,i)=>{var h=i(4),c=i(5).f,d=i(44),u=i(48),p=i(38),m=i(56),g=i(68);e.exports=function(e,t){var i,n,r,s,o=e.target,a=e.global,l=e.stat;if(i=a?h:l?h[o]||p(o,{}):(h[o]||{}).prototype)for(n in t){if(r=t[n],s=e.dontCallGetSet?(s=c(i,n))&&s.value:i[n],!g(a?n:o+(l?".":"#")+n,e.forced)&&void 0!==s){if(typeof r==typeof s)continue;m(r,s)}(e.sham||s&&s.sham)&&d(r,"sham",!0),u(i,n,r,e)}}},function(e){function t(e){return e&&e.Math===Math&&e}e.exports=t("object"==typeof globalThis&&globalThis)||t("object"==typeof window&&window)||t("object"==typeof self&&self)||t("object"==typeof global&&global)||function(){return this}()||this||Function("return this")()},(e,t,i)=>{var n=i(6),r=i(8),s=i(10),o=i(11),a=i(12),l=i(18),h=i(39),c=i(42),d=Object.getOwnPropertyDescriptor;t.f=n?d:function(e,t){if(e=a(e),t=l(t),c)try{return d(e,t)}catch(e){}if(h(e,t))return o(!r(s.f,e,t),e[t])}},(e,t,i)=>{i=i(7);e.exports=!i(function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]})},e=>{e.exports=function(e){try{return!!e()}catch(e){return!0}}},(e,t,i)=>{var i=i(9),n=Function.prototype.call;e.exports=i?n.bind(n):function(){return n.apply(n,arguments)}},(e,t,i)=>{i=i(7);e.exports=!i(function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})},(e,t)=>{var i={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor,r=n&&!i.call({1:2},1);t.f=r?function(e){e=n(this,e);return!!e&&e.enumerable}:i},e=>{e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},(e,t,i)=>{var n=i(13),r=i(16);e.exports=function(e){return n(r(e))}},(e,t,i)=>{var n=i(14),r=i(7),s=i(15),o=Object,a=n("".split);e.exports=r(function(){return!o("z").propertyIsEnumerable(0)})?function(e){return"String"===s(e)?a(e,""):o(e)}:o},(e,t,i)=>{var i=i(9),n=Function.prototype,r=n.call,n=i&&n.bind.bind(r,r);e.exports=i?n:function(e){return function(){return r.apply(e,arguments)}}},(e,t,i)=>{var i=i(14),n=i({}.toString),r=i("".slice);e.exports=function(e){return r(n(e),8,-1)}},(e,t,i)=>{var n=i(17),r=TypeError;e.exports=function(e){if(n(e))throw r("Can't call method on "+e);return e}},e=>{e.exports=function(e){return null==e}},(e,t,i)=>{var n=i(19),r=i(23);e.exports=function(e){e=n(e,"string");return r(e)?e:e+""}},(e,t,i)=>{var n=i(8),r=i(20),s=i(23),o=i(30),a=i(33),i=i(34),l=TypeError,h=i("toPrimitive");e.exports=function(e,t){if(!r(e)||s(e))return e;var i=o(e,h);if(i){if(i=n(i,e,t=void 0===t?"default":t),!r(i)||s(i))return i;throw l("Can't convert object to primitive value")}return a(e,t=void 0===t?"number":t)}},(e,t,i)=>{var n=i(21),i=i(22),r=i.all;e.exports=i.IS_HTMLDDA?function(e){return"object"==typeof e?null!==e:n(e)||e===r}:function(e){return"object"==typeof e?null!==e:n(e)}},(e,t,i)=>{var i=i(22),n=i.all;e.exports=i.IS_HTMLDDA?function(e){return"function"==typeof e||e===n}:function(e){return"function"==typeof e}},e=>{var t="object"==typeof document&&document.all;e.exports={all:t,IS_HTMLDDA:void 0===t&&void 0!==t}},(e,t,i)=>{var n=i(24),r=i(21),s=i(25),i=i(26),o=Object;e.exports=i?function(e){return"symbol"==typeof e}:function(e){var t=n("Symbol");return r(t)&&s(t.prototype,o(e))}},(e,t,i)=>{var n=i(4),r=i(21);e.exports=function(e,t){return arguments.length<2?(i=n[e],r(i)?i:void 0):n[e]&&n[e][t];var i}},(e,t,i)=>{i=i(14);e.exports=i({}.isPrototypeOf)},(e,t,i)=>{i=i(27);e.exports=i&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},(e,t,i)=>{var n=i(28),r=i(7),s=i(4).String;e.exports=!!Object.getOwnPropertySymbols&&!r(function(){var e=Symbol("symbol detection");return!s(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&n&&n<41})},(e,t,i)=>{var n,r,s=i(4),i=i(29),o=s.process,s=s.Deno,o=o&&o.versions||s&&s.version,s=o&&o.v8;!(r=s?0<(n=s.split("."))[0]&&n[0]<4?1:+(n[0]+n[1]):r)&&i&&(!(n=i.match(/Edge\/(\d+)/))||74<=n[1])&&(n=i.match(/Chrome\/(\d+)/))&&(r=+n[1]),e.exports=r},e=>{e.exports="undefined"!=typeof navigator&&String(navigator.userAgent)||""},(e,t,i)=>{var n=i(31),r=i(17);e.exports=function(e,t){e=e[t];return r(e)?void 0:n(e)}},(e,t,i)=>{var n=i(21),r=i(32),s=TypeError;e.exports=function(e){if(n(e))return e;throw s(r(e)+" is not a function")}},e=>{var t=String;e.exports=function(e){try{return t(e)}catch(e){return"Object"}}},(e,t,i)=>{var r=i(8),s=i(21),o=i(20),a=TypeError;e.exports=function(e,t){var i,n;if("string"===t&&s(i=e.toString)&&!o(n=r(i,e)))return n;if(s(i=e.valueOf)&&!o(n=r(i,e)))return n;if("string"!==t&&s(i=e.toString)&&!o(n=r(i,e)))return n;throw a("Can't convert object to primitive value")}},(e,t,i)=>{var n=i(4),r=i(35),s=i(39),o=i(41),a=i(27),i=i(26),l=n.Symbol,h=r("wks"),c=i?l.for||l:l&&l.withoutSetter||o;e.exports=function(e){return s(h,e)||(h[e]=a&&s(l,e)?l[e]:c("Symbol."+e)),h[e]}},(e,t,i)=>{var n=i(36),r=i(37);(e.exports=function(e,t){return r[e]||(r[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.32.2",mode:n?"pure":"global",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.32.2/LICENSE",source:"https://github.com/zloirock/core-js"})},e=>{e.exports=!1},(e,t,i)=>{var n=i(4),i=i(38),r="__core-js_shared__",n=n[r]||i(r,{});e.exports=n},(e,t,i)=>{var n=i(4),r=Object.defineProperty;e.exports=function(t,i){try{r(n,t,{value:i,configurable:!0,writable:!0})}catch(e){n[t]=i}return i}},(e,t,i)=>{var n=i(14),r=i(40),s=n({}.hasOwnProperty);e.exports=Object.hasOwn||function(e,t){return s(r(e),t)}},(e,t,i)=>{var n=i(16),r=Object;e.exports=function(e){return r(n(e))}},(e,t,i)=>{var i=i(14),n=0,r=Math.random(),s=i(1..toString);e.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+s(++n+r,36)}},(e,t,i)=>{var n=i(6),r=i(7),s=i(43);e.exports=!n&&!r(function(){return 7!==Object.defineProperty(s("div"),"a",{get:function(){return 7}}).a})},(e,t,i)=>{var n=i(4),i=i(20),r=n.document,s=i(r)&&i(r.createElement);e.exports=function(e){return s?r.createElement(e):{}}},(e,t,i)=>{var n=i(6),r=i(45),s=i(11);e.exports=n?function(e,t,i){return r.f(e,t,s(1,i))}:function(e,t,i){return e[t]=i,e}},(e,t,i)=>{var n=i(6),r=i(42),s=i(46),o=i(47),a=i(18),l=TypeError,h=Object.defineProperty,c=Object.getOwnPropertyDescriptor,d="enumerable",u="configurable",p="writable";t.f=n?s?function(e,t,i){var n;return o(e),t=a(t),o(i),"function"==typeof e&&"prototype"===t&&"value"in i&&p in i&&!i[p]&&(n=c(e,t))&&n[p]&&(e[t]=i.value,i={configurable:(u in i?i:n)[u],enumerable:(d in i?i:n)[d],writable:!1}),h(e,t,i)}:h:function(e,t,i){if(o(e),t=a(t),o(i),r)try{return h(e,t,i)}catch(e){}if("get"in i||"set"in i)throw l("Accessors not supported");return"value"in i&&(e[t]=i.value),e}},(e,t,i)=>{var n=i(6),i=i(7);e.exports=n&&i(function(){return 42!==Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype})},(e,t,i)=>{var n=i(20),r=String,s=TypeError;e.exports=function(e){if(n(e))return e;throw s(r(e)+" is not an object")}},(e,t,i)=>{var o=i(21),a=i(45),l=i(49),h=i(38);e.exports=function(e,t,i,n){var r=(n=n||{}).enumerable,s=void 0!==n.name?n.name:t;if(o(i)&&l(i,s,n),n.global)r?e[t]=i:h(t,i);else{try{n.unsafe?e[t]&&(r=!0):delete e[t]}catch(e){}r?e[t]=i:a.f(e,t,{value:i,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return e}},(e,t,i)=>{var n=i(14),r=i(7),s=i(21),o=i(39),a=i(6),l=i(50).CONFIGURABLE,h=i(51),i=i(52),c=i.enforce,d=i.get,u=String,p=Object.defineProperty,m=n("".slice),g=n("".replace),f=n([].join),v=a&&!r(function(){return 8!==p(function(){},"length",{value:8}).length}),y=String(String).split("String"),i=e.exports=function(e,t,i){"Symbol("===m(u(t),0,7)&&(t="["+g(u(t),/^Symbol\(([^)]*)\)/,"$1")+"]"),i&&i.getter&&(t="get "+t),i&&i.setter&&(t="set "+t),(!o(e,"name")||l&&e.name!==t)&&(a?p(e,"name",{value:t,configurable:!0}):e.name=t),v&&i&&o(i,"arity")&&e.length!==i.arity&&p(e,"length",{value:i.arity});try{i&&o(i,"constructor")&&i.constructor?a&&p(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}i=c(e);return o(i,"source")||(i.source=f(y,"string"==typeof t?t:"")),e};Function.prototype.toString=i(function(){return s(this)&&d(this).source||h(this)},"toString")},(e,t,i)=>{var n=i(6),i=i(39),r=Function.prototype,s=n&&Object.getOwnPropertyDescriptor,i=i(r,"name"),o=i&&"something"===function(){}.name,n=i&&(!n||s(r,"name").configurable);e.exports={EXISTS:i,PROPER:o,CONFIGURABLE:n}},(e,t,i)=>{var n=i(14),r=i(21),i=i(37),s=n(Function.toString);r(i.inspectSource)||(i.inspectSource=function(e){return s(e)}),e.exports=i.inspectSource},(e,t,i)=>{var n,r,s,o,a=i(53),l=i(4),h=i(20),c=i(44),d=i(39),u=i(37),p=i(54),i=i(55),m="Object already initialized",g=l.TypeError,l=l.WeakMap,f=a||u.state?((s=u.state||(u.state=new l)).get=s.get,s.has=s.has,s.set=s.set,n=function(e,t){if(s.has(e))throw g(m);return t.facade=e,s.set(e,t),t},r=function(e){return s.get(e)||{}},function(e){return s.has(e)}):(i[o=p("state")]=!0,n=function(e,t){if(d(e,o))throw g(m);return t.facade=e,c(e,o,t),t},r=function(e){return d(e,o)?e[o]:{}},function(e){return d(e,o)});e.exports={set:n,get:r,has:f,enforce:function(e){return f(e)?r(e):n(e,{})},getterFor:function(t){return function(e){if(h(e)&&(e=r(e)).type===t)return e;throw g("Incompatible receiver, "+t+" required")}}}},(e,t,i)=>{var n=i(4),i=i(21),n=n.WeakMap;e.exports=i(n)&&/native code/.test(String(n))},(e,t,i)=>{var n=i(35),r=i(41),s=n("keys");e.exports=function(e){return s[e]||(s[e]=r(e))}},e=>{e.exports={}},(e,t,i)=>{var l=i(39),h=i(57),c=i(5),d=i(45);e.exports=function(e,t,i){for(var n=h(t),r=d.f,s=c.f,o=0;o<n.length;o++){var a=n[o];l(e,a)||i&&l(i,a)||r(e,a,s(t,a))}}},(e,t,i)=>{var n=i(24),r=i(14),s=i(58),o=i(67),a=i(47),l=r([].concat);e.exports=n("Reflect","ownKeys")||function(e){var t=s.f(a(e)),i=o.f;return i?l(t,i(e)):t}},(e,t,i)=>{var n=i(59),r=i(66).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return n(e,r)}},(e,t,i)=>{var n=i(14),o=i(39),a=i(12),l=i(60).indexOf,h=i(55),c=n([].push);e.exports=function(e,t){var i,n=a(e),r=0,s=[];for(i in n)!o(h,i)&&o(n,i)&&c(s,i);for(;t.length>r;)!o(n,i=t[r++])||~l(s,i)||c(s,i);return s}},(e,t,i)=>{function n(a){return function(e,t,i){var n,r=l(e),s=c(r),o=h(i,s);if(a&&t!=t){for(;o<s;)if((n=r[o++])!=n)return!0}else for(;o<s;o++)if((a||o in r)&&r[o]===t)return a||o||0;return!a&&-1}}var l=i(12),h=i(61),c=i(64);e.exports={includes:n(!0),indexOf:n(!1)}},(e,t,i)=>{var n=i(62),r=Math.max,s=Math.min;e.exports=function(e,t){e=n(e);return e<0?r(e+t,0):s(e,t)}},(e,t,i)=>{var n=i(63);e.exports=function(e){e=+e;return e!=e||0==e?0:n(e)}},e=>{var t=Math.ceil,i=Math.floor;e.exports=Math.trunc||function(e){e=+e;return(0<e?i:t)(e)}},(e,t,i)=>{var n=i(65);e.exports=function(e){return n(e.length)}},(e,t,i)=>{var n=i(62),r=Math.min;e.exports=function(e){return 0<e?r(n(e),9007199254740991):0}},e=>{e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},(e,t)=>{t.f=Object.getOwnPropertySymbols},(e,t,i)=>{function n(e,t){return(e=l[a(e)])===c||e!==h&&(s(t)?r(t):!!t)}var r=i(7),s=i(21),o=/#|\.prototype\./,a=n.normalize=function(e){return String(e).replace(o,".").toLowerCase()},l=n.data={},h=n.NATIVE="N",c=n.POLYFILL="P";e.exports=n},(e,t,i)=>{var i=i(9),n=Function.prototype,r=n.apply,s=n.call;e.exports="object"==typeof Reflect&&Reflect.apply||(i?s.bind(r):function(){return s.apply(r,arguments)})},(e,t,i)=>{var d=i(24),u=i(39),p=i(44),m=i(25),g=i(71),f=i(56),v=i(74),y=i(75),b=i(76),w=i(80),x=i(81),S=i(6),A=i(36);e.exports=function(e,t,i,n){var r="stackTraceLimit",s=n?2:1,o=e.split("."),a=o[o.length-1],l=d.apply(null,o);if(l){var h=l.prototype;if(!A&&u(h,"cause")&&delete h.cause,!i)return l;var o=d("Error"),c=t(function(e,t){t=b(n?t:e,void 0),e=n?new l(e):new l;return void 0!==t&&p(e,"message",t),x(e,c,e.stack,2),this&&m(h,this)&&y(e,this,c),s<arguments.length&&w(e,arguments[s]),e});if(c.prototype=h,"Error"!==a?g?g(c,o):f(c,o,{name:!0}):S&&r in l&&(v(c,l,r),v(c,l,"prepareStackTrace")),f(c,l),!A)try{h.name!==a&&p(h,"name",a),h.constructor=c}catch(e){}return c}}},(e,t,i)=>{var r=i(72),s=i(47),o=i(73);e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var i,n=!1,e={};try{(i=r(Object.prototype,"__proto__","set"))(e,[]),n=e instanceof Array}catch(i){}return function(e,t){return s(e),o(t),n?i(e,t):e.__proto__=t,e}}():void 0)},(e,t,i)=>{var n=i(14),r=i(31);e.exports=function(e,t,i){try{return n(r(Object.getOwnPropertyDescriptor(e,t)[i]))}catch(e){}}},(e,t,i)=>{var n=i(21),r=String,s=TypeError;e.exports=function(e){if("object"==typeof e||n(e))return e;throw s("Can't set "+r(e)+" as a prototype")}},(e,t,i)=>{var n=i(45).f;e.exports=function(e,t,i){i in e||n(e,i,{configurable:!0,get:function(){return t[i]},set:function(e){t[i]=e}})}},(e,t,i)=>{var n=i(21),r=i(20),s=i(71);e.exports=function(e,t,i){return s&&n(t=t.constructor)&&t!==i&&r(t=t.prototype)&&t!==i.prototype&&s(e,t),e}},(e,t,i)=>{var n=i(77);e.exports=function(e,t){return void 0===e?arguments.length<2?"":t:n(e)}},(e,t,i)=>{var n=i(78),r=String;e.exports=function(e){if("Symbol"===n(e))throw TypeError("Cannot convert a Symbol value to a string");return r(e)}},(e,t,i)=>{var n=i(79),r=i(21),s=i(15),o=i(34)("toStringTag"),a=Object,l="Arguments"===s(function(){return arguments}());e.exports=n?s:function(e){var t;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(t=function(e,t){try{return e[t]}catch(e){}}(e=a(e),o))?t:l?s(e):"Object"===(t=s(e))&&r(e.callee)?"Arguments":t}},(e,t,i)=>{var n={};n[i(34)("toStringTag")]="z",e.exports="[object z]"===String(n)},(e,t,i)=>{var n=i(20),r=i(44);e.exports=function(e,t){n(t)&&"cause"in t&&r(e,"cause",t.cause)}},(e,t,i)=>{var r=i(44),s=i(82),o=i(83),a=Error.captureStackTrace;e.exports=function(e,t,i,n){o&&(a?a(e,t):r(e,"stack",s(i,n)))}},(e,t,i)=>{var i=i(14),n=Error,r=i("".replace),i=String(n("zxcasd").stack),s=/\n\s*at [^:]*:[^\n]*/,o=s.test(i);e.exports=function(e,t){if(o&&"string"==typeof e&&!n.prepareStackTrace)for(;t--;)e=r(e,s,"");return e}},(e,t,i)=>{var n=i(7),r=i(11);e.exports=!n(function(){var e=Error("a");return!("stack"in e)||(Object.defineProperty(e,"stack",r(1,7)),7!==e.stack)})},(e,t,i)=>{var n=i(48),r=i(14),d=i(77),u=i(85),i=URLSearchParams,s=i.prototype,p=r(s.append),m=r(s.delete),g=r(s.forEach),f=r([].push),r=new i("a=1&a=2&b=3");r.delete("a",1),r.delete("b",void 0),r+""!="a=2"&&n(s,"delete",function(e){var t=arguments.length,i=t<2?void 0:arguments[1];if(t&&void 0===i)return m(this,e);var n=[];g(this,function(e,t){f(n,{key:t,value:e})}),u(t,1);for(var r,s=d(e),o=d(i),a=0,l=0,h=!1,c=n.length;a<c;)r=n[a++],h||r.key===s?(h=!0,m(this,r.key)):l++;for(;l<c;)(r=n[l++]).key===s&&r.value===o||p(this,r.key,r.value)},{enumerable:!0,unsafe:!0})},e=>{var i=TypeError;e.exports=function(e,t){if(e<t)throw i("Not enough arguments");return e}},(e,t,i)=>{var n=i(48),r=i(14),o=i(77),a=i(85),i=URLSearchParams,s=i.prototype,l=r(s.getAll),h=r(s.has),r=new i("a=1");!r.has("a",2)&&r.has("a",void 0)||n(s,"has",function(e){var t=arguments.length,i=t<2?void 0:arguments[1];if(t&&void 0===i)return h(this,e);var n=l(this,e);a(t,1);for(var r=o(i),s=0;s<n.length;)if(n[s++]===r)return!0;return!1},{enumerable:!0,unsafe:!0})},(e,t,i)=>{var n=i(6),r=i(14),i=i(88),s=URLSearchParams.prototype,o=r(s.forEach);!n||"size"in s||i(s,"size",{get:function(){var e=0;return o(this,function(){e++}),e},configurable:!0,enumerable:!0})},(e,t,i)=>{var n=i(49),r=i(45);e.exports=function(e,t,i){return i.get&&n(i.get,t,{getter:!0}),i.set&&n(i.set,t,{setter:!0}),r.f(e,t,i)}},(e,t,i)=>{var n=i(3),s=i(40),o=i(64),a=i(90),l=i(92);n({target:"Array",proto:!0,arity:1,forced:i(7)(function(){return 4294967297!==[].push.call({length:4294967296},1)})||!function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(e){return e instanceof TypeError}}()},{push:function(e){var t=s(this),i=o(t),n=arguments.length;l(i+n);for(var r=0;r<n;r++)t[i]=arguments[r],i++;return a(t,i),i}})},(e,t,i)=>{var n=i(6),r=i(91),s=TypeError,o=Object.getOwnPropertyDescriptor,i=n&&!function(){if(void 0!==this)return 1;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(e){return e instanceof TypeError}}();e.exports=i?function(e,t){if(r(e)&&!o(e,"length").writable)throw s("Cannot set read only .length");return e.length=t}:function(e,t){return e.length=t}},(e,t,i)=>{var n=i(15);e.exports=Array.isArray||function(e){return"Array"===n(e)}},e=>{var t=TypeError;e.exports=function(e){if(9007199254740991<e)throw t("Maximum allowed index exceeded");return e}},(e,t,i)=>{var n=i(94),r=i(98).findLast,s=n.aTypedArray;(0,n.exportTypedArrayMethod)("findLast",function(e){return r(s(this),e,1<arguments.length?arguments[1]:void 0)})},(e,t,i)=>{function n(e){var t,e=w(e);if(u(e))return(t=_(e))&&p(t,L)?t[L]:n(e)}function r(e){return!!u(e)&&(e=m(e),p(F,e)||p(P,e))}var s,o,a,l=i(95),h=i(6),c=i(4),d=i(21),u=i(20),p=i(39),m=i(78),g=i(32),f=i(44),v=i(48),y=i(88),b=i(25),w=i(96),x=i(71),S=i(34),A=i(41),i=i(52),k=i.enforce,_=i.get,i=c.Int8Array,C=i&&i.prototype,T=c.Uint8ClampedArray,T=T&&T.prototype,E=i&&w(i),M=C&&w(C),i=Object.prototype,R=c.TypeError,S=S("toStringTag"),$=A("TYPED_ARRAY_TAG"),L="TypedArrayConstructor",I=l&&!!x&&"Opera"!==m(c.opera),A=!1,F={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},P={BigInt64Array:8,BigUint64Array:8};for(s in F)(a=(o=c[s])&&o.prototype)?k(a)[L]=o:I=!1;for(s in P)(a=(o=c[s])&&o.prototype)&&(k(a)[L]=o);if((!I||!d(E)||E===Function.prototype)&&(E=function(){throw R("Incorrect invocation")},I))for(s in F)c[s]&&x(c[s],E);if((!I||!M||M===i)&&(M=E.prototype,I))for(s in F)c[s]&&x(c[s].prototype,M);if(I&&w(T)!==M&&x(T,M),h&&!p(M,S))for(s in y(M,S,{configurable:A=!0,get:function(){return u(this)?this[$]:void 0}}),F)c[s]&&f(c[s],$,s);e.exports={NATIVE_ARRAY_BUFFER_VIEWS:I,TYPED_ARRAY_TAG:A&&$,aTypedArray:function(e){if(r(e))return e;throw R("Target is not a typed array")},aTypedArrayConstructor:function(e){if(!d(e)||x&&!b(E,e))throw R(g(e)+" is not a typed array constructor");return e},exportTypedArrayMethod:function(e,t,i,n){if(h){if(i)for(var r in F){r=c[r];if(r&&p(r.prototype,e))try{delete r.prototype[e]}catch(i){try{r.prototype[e]=t}catch(e){}}}M[e]&&!i||v(M,e,!i&&I&&C[e]||t,n)}},exportTypedArrayStaticMethod:function(e,t,i){var n,r;if(h){if(x){if(i)for(n in F)if((r=c[n])&&p(r,e))try{delete r[e]}catch(e){}if(E[e]&&!i)return;try{return v(E,e,!i&&I&&E[e]||t)}catch(e){}}for(n in F)!(r=c[n])||r[e]&&!i||v(r,e,t)}},getTypedArrayConstructor:n,isView:function(e){return!!u(e)&&("DataView"===(e=m(e))||p(F,e)||p(P,e))},isTypedArray:r,TypedArray:E,TypedArrayPrototype:M}},e=>{e.exports="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView},(e,t,i)=>{var n=i(39),r=i(21),s=i(40),o=i(54),i=i(97),a=o("IE_PROTO"),l=Object,h=l.prototype;e.exports=i?l.getPrototypeOf:function(e){var t,e=s(e);return n(e,a)?e[a]:(t=e.constructor,r(t)&&e instanceof t?t.prototype:e instanceof l?h:null)}},(e,t,i)=>{i=i(7);e.exports=!i(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})},(e,t,i)=>{function n(l){var h=1===l;return function(e,t,i){for(var n,r=u(e),s=d(r),o=c(t,i),a=p(s);0<a--;)if(o(n=s[a],a,r))switch(l){case 0:return n;case 1:return a}return h?-1:void 0}}var c=i(99),d=i(13),u=i(40),p=i(64);e.exports={findLast:n(0),findLastIndex:n(1)}},(e,t,i)=>{var n=i(100),r=i(31),s=i(9),o=n(n.bind);e.exports=function(e,t){return r(e),void 0===t?e:s?o(e,t):function(){return e.apply(t,arguments)}}},(e,t,i)=>{var n=i(15),r=i(14);e.exports=function(e){if("Function"===n(e))return r(e)}},(e,t,i)=>{var n=i(94),r=i(98).findLastIndex,s=n.aTypedArray;(0,n.exportTypedArrayMethod)("findLastIndex",function(e){return r(s(this),e,1<arguments.length?arguments[1]:void 0)})},(e,t,i)=>{var n=i(4),s=i(8),r=i(94),o=i(64),a=i(103),l=i(40),i=i(7),h=n.RangeError,c=n.Int8Array,n=c&&c.prototype,d=n&&n.set,u=r.aTypedArray,n=r.exportTypedArrayMethod,p=!i(function(){var e=new Uint8ClampedArray(2);return s(d,e,{length:1,0:3},1),3!==e[1]}),r=p&&r.NATIVE_ARRAY_BUFFER_VIEWS&&i(function(){var e=new c(2);return e.set(1),e.set("2",1),0!==e[0]||2!==e[1]});n("set",function(e){u(this);var t=a(1<arguments.length?arguments[1]:void 0,1),i=l(e);if(p)return s(d,this,i,t);var e=this.length,n=o(i),r=0;if(e<n+t)throw h("Wrong length");for(;r<n;)this[t+r]=i[r++]},!p||r)},(e,t,i)=>{var n=i(104),r=RangeError;e.exports=function(e,t){e=n(e);if(e%t)throw r("Wrong offset");return e}},(e,t,i)=>{var n=i(62),r=RangeError;e.exports=function(e){e=n(e);if(e<0)throw r("The argument can't be less than 0");return e}},(e,t,i)=>{var n=i(106),i=i(94),r=i.aTypedArray,s=i.exportTypedArrayMethod,o=i.getTypedArrayConstructor;s("toReversed",function(){return n(r(this),o(this))})},(e,t,i)=>{var s=i(64);e.exports=function(e,t){for(var i=s(e),n=new t(i),r=0;r<i;r++)n[r]=e[i-r-1];return n}},(e,t,i)=>{var n=i(94),r=i(14),s=i(31),o=i(108),a=n.aTypedArray,l=n.getTypedArrayConstructor,i=n.exportTypedArrayMethod,h=r(n.TypedArrayPrototype.sort);i("toSorted",function(e){void 0!==e&&s(e);var t=a(this),t=o(l(t),t);return h(t,e)})},(e,t,i)=>{var s=i(64);e.exports=function(e,t){for(var i=0,n=s(t),r=new e(n);i<n;)r[i]=t[i++];return r}},(e,t,i)=>{var n=i(110),r=i(94),s=i(111),o=i(62),a=i(112),l=r.aTypedArray,h=r.getTypedArrayConstructor;(0,r.exportTypedArrayMethod)("with",function(e,t){var i=l(this),e=o(e),t=s(i)?a(t):+t;return n(i,h(i),e,t)},!!!function(){try{new Int8Array(1).with(2,{valueOf:function(){throw 8}})}catch(e){return 8===e}}())},(e,t,i)=>{var l=i(64),h=i(62),c=RangeError;e.exports=function(e,t,i,n){var r=l(e),i=h(i),s=i<0?r+i:i;if(r<=s||s<0)throw c("Incorrect index");for(var o=new t(r),a=0;a<r;a++)o[a]=a===s?n:e[a];return o}},(e,t,i)=>{var n=i(78);e.exports=function(e){e=n(e);return"BigInt64Array"===e||"BigUint64Array"===e}},(e,t,i)=>{var n=i(19),r=TypeError;e.exports=function(e){e=n(e,"number");if("number"==typeof e)throw r("Can't convert number to bigint");return BigInt(e)}},(e,t,i)=>{var n=i(6),r=i(88),s=i(114),i=ArrayBuffer.prototype;!n||"detached"in i||r(i,"detached",{configurable:!0,get:function(){return s(this)}})},(e,t,i)=>{var n=i(14),r=i(115),s=n(ArrayBuffer.prototype.slice);e.exports=function(e){if(0!==r(e))return!1;try{return s(e,0,0),!1}catch(e){return!0}}},(e,t,i)=>{var n=i(72),r=i(15),s=TypeError;e.exports=n(ArrayBuffer.prototype,"byteLength","get")||function(e){if("ArrayBuffer"!==r(e))throw s("ArrayBuffer expected");return e.byteLength}},(e,t,i)=>{var n=i(3),r=i(117);r&&n({target:"ArrayBuffer",proto:!0},{transfer:function(){return r(this,arguments.length?arguments[0]:void 0,!0)}})},(e,t,i)=>{var n=i(4),r=i(14),s=i(72),h=i(118),c=i(114),d=i(115),i=i(119),u=n.TypeError,p=n.structuredClone,m=n.ArrayBuffer,g=n.DataView,f=Math.min,n=m.prototype,o=g.prototype,v=r(n.slice),y=s(n,"resizable","get"),b=s(n,"maxByteLength","get"),w=r(o.getInt8),x=r(o.setInt8);e.exports=i&&function(e,t,i){var n=d(e),t=void 0===t?n:h(t),r=!y||!y(e);if(c(e))throw u("ArrayBuffer is detached");e=p(e,{transfer:[e]});if(n===t&&(i||r))return e;if(t<=n&&(!i||r))return v(e,0,t);for(var i=i&&!r&&b?{maxByteLength:b(e)}:void 0,r=new m(t,i),s=new g(e),o=new g(r),a=f(t,n),l=0;l<a;l++)x(o,l,w(s,l));return r}},(e,t,i)=>{var n=i(62),r=i(65),s=RangeError;e.exports=function(e){if(void 0===e)return 0;var e=n(e),t=r(e);if(e!==t)throw s("Wrong length or index");return t}},(e,t,i)=>{var n=i(4),r=i(7),s=i(28),o=i(120),a=i(121),l=i(122),h=n.structuredClone;e.exports=!!h&&!r(function(){var e,t;return!(a&&92<s||l&&94<s||o&&97<s)&&(e=new ArrayBuffer(8),t=h(e,{transfer:[e]}),0!==e.byteLength||8!==t.byteLength)})},(e,t,i)=>{var n=i(121),i=i(122);e.exports=!n&&!i&&"object"==typeof window&&"object"==typeof document},e=>{e.exports="object"==typeof Deno&&Deno&&"object"==typeof Deno.version},(e,t,i)=>{var n=i(4),i=i(15);e.exports="process"===i(n.process)},(e,t,i)=>{var n=i(3),r=i(117);r&&n({target:"ArrayBuffer",proto:!0},{transferToFixedLength:function(){return r(this,arguments.length?arguments[0]:void 0,!1)}})},(__unused_webpack_module,exports,__w_pdfjs_require__)=>{Object.defineProperty(exports,"__esModule",{value:!0}),exports.RenderTask=exports.PDFWorkerUtil=exports.PDFWorker=exports.PDFPageProxy=exports.PDFDocumentProxy=exports.PDFDocumentLoadingTask=exports.PDFDataRangeTransport=exports.LoopbackPort=exports.DefaultStandardFontDataFactory=exports.DefaultFilterFactory=exports.DefaultCanvasFactory=exports.DefaultCMapReaderFactory=void 0,Object.defineProperty(exports,"SVGGraphics",{enumerable:!0,get:function(){return _displaySvg.SVGGraphics}}),exports.build=void 0,exports.getDocument=getDocument,exports.version=void 0,__w_pdfjs_require__(84),__w_pdfjs_require__(86),__w_pdfjs_require__(87),__w_pdfjs_require__(2),__w_pdfjs_require__(93),__w_pdfjs_require__(101),__w_pdfjs_require__(102),__w_pdfjs_require__(105),__w_pdfjs_require__(107),__w_pdfjs_require__(109),__w_pdfjs_require__(113),__w_pdfjs_require__(116),__w_pdfjs_require__(123),__w_pdfjs_require__(89),__w_pdfjs_require__(125),__w_pdfjs_require__(136),__w_pdfjs_require__(138),__w_pdfjs_require__(141),__w_pdfjs_require__(143),__w_pdfjs_require__(145),__w_pdfjs_require__(147),__w_pdfjs_require__(149),__w_pdfjs_require__(152);var _util=__w_pdfjs_require__(1),_annotation_storage=__w_pdfjs_require__(163),_display_utils=__w_pdfjs_require__(168),_font_loader=__w_pdfjs_require__(171),_displayNode_utils=__w_pdfjs_require__(172),_canvas=__w_pdfjs_require__(173),_worker_options=__w_pdfjs_require__(176),_message_handler=__w_pdfjs_require__(177),_metadata=__w_pdfjs_require__(178),_optional_content_config=__w_pdfjs_require__(179),_transport_stream=__w_pdfjs_require__(180),_displayFetch_stream=__w_pdfjs_require__(181),_displayNetwork=__w_pdfjs_require__(184),_displayNode_stream=__w_pdfjs_require__(185),_displaySvg=__w_pdfjs_require__(186),_xfa_text=__w_pdfjs_require__(194);const DEFAULT_RANGE_CHUNK_SIZE=65536,RENDERING_CANCELLED_TIMEOUT=100,DELAYED_CLEANUP_TIMEOUT=5e3,DefaultCanvasFactory=_util.isNodeJS?_displayNode_utils.NodeCanvasFactory:_display_utils.DOMCanvasFactory,DefaultCMapReaderFactory=(exports.DefaultCanvasFactory=DefaultCanvasFactory,_util.isNodeJS?_displayNode_utils.NodeCMapReaderFactory:_display_utils.DOMCMapReaderFactory),DefaultFilterFactory=(exports.DefaultCMapReaderFactory=DefaultCMapReaderFactory,_util.isNodeJS?_displayNode_utils.NodeFilterFactory:_display_utils.DOMFilterFactory),DefaultStandardFontDataFactory=(exports.DefaultFilterFactory=DefaultFilterFactory,_util.isNodeJS?_displayNode_utils.NodeStandardFontDataFactory:_display_utils.DOMStandardFontDataFactory);function getDocument(e){if("string"==typeof e||e instanceof URL?e={url:e}:(0,_util.isArrayBuffer)(e)&&(e={data:e}),"object"!=typeof e)throw new Error("Invalid parameter in getDocument, need parameter object.");if(!e.url&&!e.data&&!e.range)throw new Error("Invalid parameter object: need either .data, .range or .url");const i=new PDFDocumentLoadingTask,n=i["docId"],r=e.url?getUrlProp(e.url):null,s=e.data?getDataProp(e.data):null,o=e.httpHeaders||null,a=!0===e.withCredentials,t=e.password??null,l=e.range instanceof PDFDataRangeTransport?e.range:null,h=Number.isInteger(e.rangeChunkSize)&&0<e.rangeChunkSize?e.rangeChunkSize:DEFAULT_RANGE_CHUNK_SIZE;let c=e.worker instanceof PDFWorker?e.worker:null;const d=e.verbosity,u="string"!=typeof e.docBaseUrl||(0,_display_utils.isDataScheme)(e.docBaseUrl)?null:e.docBaseUrl,p="string"==typeof e.cMapUrl?e.cMapUrl:null,m=!1!==e.cMapPacked,g=e.CMapReaderFactory||DefaultCMapReaderFactory,f="string"==typeof e.standardFontDataUrl?e.standardFontDataUrl:null,v=e.StandardFontDataFactory||DefaultStandardFontDataFactory,y=!0!==e.stopAtErrors,b=Number.isInteger(e.maxImageSize)&&-1<e.maxImageSize?e.maxImageSize:-1,w=!1!==e.isEvalSupported,x="boolean"==typeof e.isOffscreenCanvasSupported?e.isOffscreenCanvasSupported:!_util.isNodeJS,S=Number.isInteger(e.canvasMaxAreaInBytes)?e.canvasMaxAreaInBytes:-1,A="boolean"==typeof e.disableFontFace?e.disableFontFace:_util.isNodeJS,k=!0===e.fontExtraProperties,_=!0===e.enableXfa,C=e.ownerDocument||globalThis.document,T=!0===e.disableRange,E=!0===e.disableStream,M=!0===e.disableAutoFetch,R=!0===e.pdfBug,$=l?l.length:e.length??NaN,L="boolean"==typeof e.useSystemFonts?e.useSystemFonts:!_util.isNodeJS&&!A,I="boolean"==typeof e.useWorkerFetch?e.useWorkerFetch:g===_display_utils.DOMCMapReaderFactory&&v===_display_utils.DOMStandardFontDataFactory&&p&&f&&(0,_display_utils.isValidFetchUrl)(p,document.baseURI)&&(0,_display_utils.isValidFetchUrl)(f,document.baseURI),F=e.canvasFactory||new DefaultCanvasFactory({ownerDocument:C}),D=e.filterFactory||new DefaultFilterFactory({docId:n,ownerDocument:C}),P=((0,_util.setVerbosityLevel)(d),{canvasFactory:F,filterFactory:D});if(I||(P.cMapReaderFactory=new g({baseUrl:p,isCompressed:m}),P.standardFontDataFactory=new v({baseUrl:f})),!c){const e={verbosity:d,port:_worker_options.GlobalWorkerOptions.workerPort};c=e.port?PDFWorker.fromPort(e):new PDFWorker(e),i._worker=c}const O={docId:n,apiVersion:"3.11.174",data:s,password:t,disableAutoFetch:M,rangeChunkSize:h,length:$,docBaseUrl:u,enableXfa:_,evaluatorOptions:{maxImageSize:b,disableFontFace:A,ignoreErrors:y,isEvalSupported:w,isOffscreenCanvasSupported:x,canvasMaxAreaInBytes:S,fontExtraProperties:k,useSystemFonts:L,cMapUrl:I?p:null,standardFontDataUrl:I?f:null}},N={ignoreErrors:y,isEvalSupported:w,disableFontFace:A,fontExtraProperties:k,enableXfa:_,ownerDocument:C,disableAutoFetch:M,pdfBug:R,styleElement:null};return c.promise.then(function(){if(i.destroyed)throw new Error("Loading aborted");var e=_fetchDocument(c,O),t=new Promise(function(e){let t;var i;l?t=new _transport_stream.PDFDataTransportStream({length:$,initialData:l.initialData,progressiveDone:l.progressiveDone,contentDispositionFilename:l.contentDispositionFilename,disableRange:T,disableStream:E},l):s||(t=(i={url:r,length:$,httpHeaders:o,withCredentials:a,rangeChunkSize:h,disableRange:T,disableStream:E},new(_util.isNodeJS?_displayNode_stream.PDFNodeStream:(0,_display_utils.isValidFetchUrl)(i.url)?_displayFetch_stream.PDFFetchStream:_displayNetwork.PDFNetworkStream)(i))),e(t)});return Promise.all([e,t]).then(function(e){var[e,t]=e;if(i.destroyed)throw new Error("Loading aborted");e=new _message_handler.MessageHandler(n,e,c.port),t=new WorkerTransport(e,i,t,N,P);i._transport=t,e.send("Ready",null)})}).catch(i._capability.reject),i}async function _fetchDocument(e,t){if(e.destroyed)throw new Error("Worker was destroyed");t=await e.messageHandler.sendWithPromise("GetDocRequest",t,t.data?[t.data.buffer]:null);if(e.destroyed)throw new Error("Worker was destroyed");return t}function getUrlProp(e){if(e instanceof URL)return e.href;try{return new URL(e,window.location).href}catch{if(_util.isNodeJS&&"string"==typeof e)return e}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}function getDataProp(e){if(_util.isNodeJS&&"undefined"!=typeof Buffer&&e instanceof Buffer)throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if(e instanceof Uint8Array&&e.byteLength===e.buffer.byteLength)return e;if("string"==typeof e)return(0,_util.stringToBytes)(e);if("object"==typeof e&&!isNaN(e?.length)||(0,_util.isArrayBuffer)(e))return new Uint8Array(e);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}exports.DefaultStandardFontDataFactory=DefaultStandardFontDataFactory;class PDFDocumentLoadingTask{static#e=0;constructor(){this._capability=new _util.PromiseCapability,this._transport=null,this._worker=null,this.docId="d"+PDFDocumentLoadingTask.#e++,this.destroyed=!1,this.onPassword=null,this.onProgress=null}get promise(){return this._capability.promise}async destroy(){this.destroyed=!0;try{this._worker?.port&&(this._worker._pendingDestroy=!0),await this._transport?.destroy()}catch(e){throw this._worker?.port&&delete this._worker._pendingDestroy,e}this._transport=null,this._worker&&(this._worker.destroy(),this._worker=null)}}exports.PDFDocumentLoadingTask=PDFDocumentLoadingTask;class PDFDataRangeTransport{constructor(e,t){var i=2<arguments.length&&void 0!==arguments[2]&&arguments[2],n=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;this.length=e,this.initialData=t,this.progressiveDone=i,this.contentDispositionFilename=n,this._rangeListeners=[],this._progressListeners=[],this._progressiveReadListeners=[],this._progressiveDoneListeners=[],this._readyCapability=new _util.PromiseCapability}addRangeListener(e){this._rangeListeners.push(e)}addProgressListener(e){this._progressListeners.push(e)}addProgressiveReadListener(e){this._progressiveReadListeners.push(e)}addProgressiveDoneListener(e){this._progressiveDoneListeners.push(e)}onDataRange(e,t){for(const i of this._rangeListeners)i(e,t)}onDataProgress(t,i){this._readyCapability.promise.then(()=>{for(const e of this._progressListeners)e(t,i)})}onDataProgressiveRead(t){this._readyCapability.promise.then(()=>{for(const e of this._progressiveReadListeners)e(t)})}onDataProgressiveDone(){this._readyCapability.promise.then(()=>{for(const e of this._progressiveDoneListeners)e()})}transportReady(){this._readyCapability.resolve()}requestDataRange(e,t){(0,_util.unreachable)("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}exports.PDFDataRangeTransport=PDFDataRangeTransport;class PDFDocumentProxy{constructor(e,t){this._pdfInfo=e,this._transport=t,Object.defineProperty(this,"getJavaScript",{value:()=>((0,_display_utils.deprecated)("`PDFDocumentProxy.getJavaScript`, please use `PDFDocumentProxy.getJSActions` instead."),this.getJSActions().then(e=>{if(!e)return e;var t=[];for(const i in e)t.push(...e[i]);return t}))})}get annotationStorage(){return this._transport.annotationStorage}get filterFactory(){return this._transport.filterFactory}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return(0,_util.shadow)(this,"isPureXfa",!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}getPage(e){return this._transport.getPage(e)}getPageIndex(e){return this._transport.getPageIndex(e)}getDestinations(){return this._transport.getDestinations()}getDestination(e){return this._transport.getDestination(e)}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(){return this._transport.getOptionalContentConfig()}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(){return this._transport.startCleanup(0<arguments.length&&void 0!==arguments[0]&&arguments[0]||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}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()}}exports.PDFDocumentProxy=PDFDocumentProxy;class PDFPageProxy{#n=null;#i=!1;constructor(e,t,i){var n=3<arguments.length&&void 0!==arguments[3]&&arguments[3];this._pageIndex=e,this._pageInfo=t,this._transport=i,this._stats=n?new _display_utils.StatTimer:null,this._pdfBug=n,this.commonObjs=i.commonObjs,this.objs=new PDFObjects,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(){var{scale:e,rotation:t=this.rotate,offsetX:i=0,offsetY:n=0,dontFlip:r=!1}=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return new _display_utils.PageViewport({viewBox:this.view,scale:e,rotation:t,offsetX:i,offsetY:n,dontFlip:r})}getAnnotations(){var{intent:e="display"}=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},e=this._transport.getRenderingIntent(e);return this._transport.getAnnotations(this._pageIndex,e.renderingIntent)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return(0,_util.shadow)(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){return this._transport._htmlForXfa?.children[this._pageIndex]||null}render(e){let{canvasContext:t,viewport:i,intent:n="display",annotationMode:r=_util.AnnotationMode.ENABLE,transform:s=null,background:o=null,optionalContentConfigPromise:a=null,annotationCanvasMap:l=null,pageColors:h=null,printAnnotationStorage:c=null}=e;this._stats?.time("Overall");e=this._transport.getRenderingIntent(n,r,c);this.#i=!1,this.#r(),a=a||this._transport.getOptionalContentConfig();let d=this._intentStates.get(e.cacheKey);d||(d=Object.create(null),this._intentStates.set(e.cacheKey,d)),d.streamReaderCancelTimeout&&(clearTimeout(d.streamReaderCancelTimeout),d.streamReaderCancelTimeout=null);const u=!!(e.renderingIntent&_util.RenderingIntentFlag.PRINT),p=(d.displayReadyCapability||(d.displayReadyCapability=new _util.PromiseCapability,d.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(e)),e=>{d.renderTasks.delete(m),(this._maybeCleanupAfterRender||u)&&(this.#i=!0),this.#s(!u),e?(m.capability.reject(e),this._abortOperatorList({intentState:d,reason:e instanceof Error?e:new Error(e)})):m.capability.resolve(),this._stats?.timeEnd("Rendering"),this._stats?.timeEnd("Overall")}),m=new InternalRenderTask({callback:p,params:{canvasContext:t,viewport:i,transform:s,background:o},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:l,operatorList:d.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!u,pdfBug:this._pdfBug,pageColors:h});(d.renderTasks||=new Set).add(m);e=m.task;return Promise.all([d.displayReadyCapability.promise,a]).then(e=>{var[e,t]=e;this.destroyed?p():(this._stats?.time("Rendering"),m.initializeGraphics({transparency:e,optionalContentConfig:t}),m.operatorListChanged())}).catch(p),e}getOperatorList(){var{intent:e="display",annotationMode:t=_util.AnnotationMode.ENABLE,printAnnotationStorage:i=null}=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},e=this._transport.getRenderingIntent(e,t,i,!0);let n,r=this._intentStates.get(e.cacheKey);return r||(r=Object.create(null),this._intentStates.set(e.cacheKey,r)),r.opListReadCapability||((n=Object.create(null)).operatorListChanged=function(){r.operatorList.lastChunk&&(r.opListReadCapability.resolve(r.operatorList),r.renderTasks.delete(n))},r.opListReadCapability=new _util.PromiseCapability,(r.renderTasks||=new Set).add(n),r.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(e)),r.opListReadCapability.promise}streamTextContent(){var{includeMarkedContent:e=!1,disableNormalization:t=!1}=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:!0===e,disableNormalization:!0===t},{highWaterMark:100,size:e=>e.items.length})}getTextContent(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};if(this._transport._htmlForXfa)return this.getXfa().then(e=>_xfa_text.XfaText.textContent(e));const i=this.streamTextContent(e);return new Promise(function(n,e){const t=i.getReader(),r={items:[],styles:Object.create(null)};!function i(){t.read().then(function(e){var{value:e,done:t}=e;t?n(r):(Object.assign(r.styles,e.styles),r.items.push(...e.items),i())},e)}()})}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;var e=[];for(const t of this._intentStates.values())if(this._abortOperatorList({intentState:t,reason:new Error("Page was destroyed."),force:!0}),!t.opListReadCapability)for(const i of t.renderTasks)e.push(i.completed),i.cancel();return this.objs.clear(),this.#i=!1,this.#r(),Promise.all(e)}cleanup(){var e=0<arguments.length&&void 0!==arguments[0]&&arguments[0],t=(this.#i=!0,this.#s(!1));return e&&t&&(this._stats&&=new _display_utils.StatTimer),t}#s(){let e=0<arguments.length&&void 0!==arguments[0]&&arguments[0];if(this.#r(),!this.#i||this.destroyed)return!1;if(e)return this.#n=setTimeout(()=>{this.#n=null,this.#s(!1)},DELAYED_CLEANUP_TIMEOUT),!1;for(const{renderTasks:e,operatorList:t}of this._intentStates.values())if(0<e.size||!t.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),!(this.#i=!1)}#r(){this.#n&&(clearTimeout(this.#n),this.#n=null)}_startRenderPage(e,t){t=this._intentStates.get(t);t&&(this._stats?.timeEnd("Page Request"),t.displayReadyCapability?.resolve(e))}_renderPageChunk(i,n){for(let e=0,t=i.length;e<t;e++)n.operatorList.fnArray.push(i.fnArray[e]),n.operatorList.argsArray.push(i.argsArray[e]);n.operatorList.lastChunk=i.lastChunk,n.operatorList.separateAnnots=i.separateAnnots;for(const i of n.renderTasks)i.operatorListChanged();i.lastChunk&&this.#s(!0)}_pumpOperatorList(e){var{renderingIntent:e,cacheKey:t,annotationStorageSerializable:i}=e;const{map:n,transfers:r}=i,s=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:e,cacheKey:t,annotationStorage:n},r).getReader(),o=this._intentStates.get(t),a=(o.streamReader=s,()=>{s.read().then(e=>{var{value:e,done:t}=e;t?o.streamReader=null:this._transport.destroyed||(this._renderPageChunk(e,o),a())},e=>{if(o.streamReader=null,!this._transport.destroyed){if(o.operatorList){o.operatorList.lastChunk=!0;for(const e of o.renderTasks)e.operatorListChanged();this.#s(!0)}if(o.displayReadyCapability)o.displayReadyCapability.reject(e);else{if(!o.opListReadCapability)throw e;o.opListReadCapability.reject(e)}}})});a()}_abortOperatorList(e){let{intentState:t,reason:i,force:n=!1}=e;if(t.streamReader){if(t.streamReaderCancelTimeout&&(clearTimeout(t.streamReaderCancelTimeout),t.streamReaderCancelTimeout=null),!n){if(0<t.renderTasks.size)return;if(i instanceof _display_utils.RenderingCancelledException){let e=RENDERING_CANCELLED_TIMEOUT;return 0<i.extraDelay&&i.extraDelay<1e3&&(e+=i.extraDelay),void(t.streamReaderCancelTimeout=setTimeout(()=>{t.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:t,reason:i,force:!0})},e))}}if(t.streamReader.cancel(new _util.AbortException(i.message)).catch(()=>{}),t.streamReader=null,!this._transport.destroyed){for(const[e,i]of this._intentStates)if(i===t){this._intentStates.delete(e);break}this.cleanup()}}}get stats(){return this._stats}}exports.PDFPageProxy=PDFPageProxy;class LoopbackPort{#a=new Set;#o=Promise.resolve();postMessage(e,t){const i={data:structuredClone(e,null)};this.#o.then(()=>{for(const e of this.#a)e.call(this,i)})}addEventListener(e,t){this.#a.add(t)}removeEventListener(e,t){this.#a.delete(t)}terminate(){this.#a.clear()}}exports.LoopbackPort=LoopbackPort;const PDFWorkerUtil={isWorkerDisabled:!1,fallbackWorkerSrc:null,fakeWorkerId:0};if(exports.PDFWorkerUtil=PDFWorkerUtil,_util.isNodeJS&&"function"==typeof require)PDFWorkerUtil.isWorkerDisabled=!0,PDFWorkerUtil.fallbackWorkerSrc="./pdf.worker.js";else if("object"==typeof document){const t=document?.currentScript?.src;t&&(PDFWorkerUtil.fallbackWorkerSrc=t.replace(/(\.(?:min\.)?js)(\?.*)?$/i,".worker$1$2"))}PDFWorkerUtil.isSameOrigin=function(e,t){let i;try{if(!(i=new URL(e)).origin||"null"===i.origin)return!1}catch{return!1}e=new URL(t,i);return i.origin===e.origin},PDFWorkerUtil.createCDNWrapper=function(e){return URL.createObjectURL(new Blob([`importScripts("${e}");`]))};class PDFWorker{static#l;constructor(){var{name:e=null,port:t=null,verbosity:i=(0,_util.getVerbosityLevel)()}=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};if(this.name=e,this.destroyed=!1,this.verbosity=i,this._readyCapability=new _util.PromiseCapability,this._port=null,this._webWorker=null,this._messageHandler=null,t){if(PDFWorker.#l?.has(t))throw new Error("Cannot use more than one PDFWorker per port.");(PDFWorker.#l||=new WeakMap).set(t,this),this._initializeFromPort(t)}else this._initialize()}get promise(){return this._readyCapability.promise}get port(){return this._port}get messageHandler(){return this._messageHandler}_initializeFromPort(e){this._port=e,this._messageHandler=new _message_handler.MessageHandler("main","worker",e),this._messageHandler.on("ready",function(){}),this._readyCapability.resolve(),this._messageHandler.send("configure",{verbosity:this.verbosity})}_initialize(){if(!PDFWorkerUtil.isWorkerDisabled&&!PDFWorker._mainThreadWorkerMessageHandler){let e=PDFWorker["workerSrc"];try{PDFWorkerUtil.isSameOrigin(window.location.href,e)||(e=PDFWorkerUtil.createCDNWrapper(new URL(e,window.location).href));const t=new Worker(e),i=new _message_handler.MessageHandler("main","worker",t),n=()=>{t.removeEventListener("error",r),i.destroy(),t.terminate(),this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()},r=()=>{this._webWorker||n()},s=(t.addEventListener("error",r),i.on("test",e=>{t.removeEventListener("error",r),this.destroyed?n():e?(this._messageHandler=i,this._port=t,this._webWorker=t,this._readyCapability.resolve(),i.send("configure",{verbosity:this.verbosity})):(this._setupFakeWorker(),i.destroy(),t.terminate())}),i.on("ready",e=>{if(t.removeEventListener("error",r),this.destroyed)n();else try{s()}catch{this._setupFakeWorker()}}),()=>{var e=new Uint8Array;i.send("test",e,[e.buffer])});return void s()}catch{(0,_util.info)("The worker has been disabled.")}}this._setupFakeWorker()}_setupFakeWorker(){PDFWorkerUtil.isWorkerDisabled||((0,_util.warn)("Setting up fake worker."),PDFWorkerUtil.isWorkerDisabled=!0),PDFWorker._setupFakeWorkerGlobal.then(e=>{var t,i,n;this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):(t=new LoopbackPort,this._port=t,i="fake"+PDFWorkerUtil.fakeWorkerId++,n=new _message_handler.MessageHandler(i+"_worker",i,t),e.setup(n,t),e=new _message_handler.MessageHandler(i,i+"_worker",t),this._messageHandler=e,this._readyCapability.resolve(),e.send("configure",{verbosity:this.verbosity}))}).catch(e=>{this._readyCapability.reject(new Error(`Setting up fake worker failed: "${e.message}".`))})}destroy(){this.destroyed=!0,this._webWorker&&(this._webWorker.terminate(),this._webWorker=null),PDFWorker.#l?.delete(this._port),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}static fromPort(e){if(!e?.port)throw new Error("PDFWorker.fromPort - invalid method signature.");var t=this.#l?.get(e.port);if(t){if(t._pendingDestroy)throw new Error("PDFWorker.fromPort - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return t}return new PDFWorker(e)}static get workerSrc(){if(_worker_options.GlobalWorkerOptions.workerSrc)return _worker_options.GlobalWorkerOptions.workerSrc;if(null!==PDFWorkerUtil.fallbackWorkerSrc)return _util.isNodeJS||(0,_display_utils.deprecated)('No "GlobalWorkerOptions.workerSrc" specified.'),PDFWorkerUtil.fallbackWorkerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _mainThreadWorkerMessageHandler(){try{return globalThis.pdfjsWorker?.WorkerMessageHandler||null}catch{return null}}static get _setupFakeWorkerGlobal(){const loader=async()=>{const mainWorkerMessageHandler=this._mainThreadWorkerMessageHandler;if(mainWorkerMessageHandler)return mainWorkerMessageHandler;if(_util.isNodeJS&&"function"==typeof require){const worker=eval("require")(this.workerSrc);return worker.WorkerMessageHandler}return await(0,_display_utils.loadScript)(this.workerSrc),window.pdfjsWorker.WorkerMessageHandler};return(0,_util.shadow)(this,"_setupFakeWorkerGlobal",loader())}}exports.PDFWorker=PDFWorker;class WorkerTransport{#c=new Map;#h=new Map;#d=new Map;#u=null;constructor(e,t,i,n,r){this.messageHandler=e,this.loadingTask=t,this.commonObjs=new PDFObjects,this.fontLoader=new _font_loader.FontLoader({ownerDocument:n.ownerDocument,styleElement:n.styleElement}),this._params=n,this.canvasFactory=r.canvasFactory,this.filterFactory=r.filterFactory,this.cMapReaderFactory=r.cMapReaderFactory,this.standardFontDataFactory=r.standardFontDataFactory,this.destroyed=!1,this.destroyCapability=null,this._networkStream=i,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=new _util.PromiseCapability,this.setupMessageHandler()}#p(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null,i=this.#c.get(e);return i||(i=this.messageHandler.sendWithPromise(e,t),this.#c.set(e,i),i)}get annotationStorage(){return(0,_util.shadow)(this,"annotationStorage",new _annotation_storage.AnnotationStorage)}getRenderingIntent(e){let t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:_util.AnnotationMode.ENABLE,i=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null,n=3<arguments.length&&void 0!==arguments[3]&&arguments[3],r=_util.RenderingIntentFlag.DISPLAY,s=_annotation_storage.SerializableEmpty;switch(e){case"any":r=_util.RenderingIntentFlag.ANY;break;case"display":break;case"print":r=_util.RenderingIntentFlag.PRINT;break;default:(0,_util.warn)("getRenderingIntent - invalid intent: "+e)}switch(t){case _util.AnnotationMode.DISABLE:r+=_util.RenderingIntentFlag.ANNOTATIONS_DISABLE;break;case _util.AnnotationMode.ENABLE:break;case _util.AnnotationMode.ENABLE_FORMS:r+=_util.RenderingIntentFlag.ANNOTATIONS_FORMS;break;case _util.AnnotationMode.ENABLE_STORAGE:r+=_util.RenderingIntentFlag.ANNOTATIONS_STORAGE,s=(r&_util.RenderingIntentFlag.PRINT&&i instanceof _annotation_storage.PrintAnnotationStorage?i:this.annotationStorage).serializable;break;default:(0,_util.warn)("getRenderingIntent - invalid annotationMode: "+t)}return n&&(r+=_util.RenderingIntentFlag.OPLIST),{renderingIntent:r,cacheKey:r+"_"+s.hash,annotationStorageSerializable:s}}destroy(){if(!this.destroyCapability){this.destroyed=!0,this.destroyCapability=new _util.PromiseCapability,this.#u?.reject(new Error("Worker was destroyed during onPassword callback"));var e=[];for(const t of this.#h.values())e.push(t._destroy());this.#h.clear(),this.#d.clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const t=this.messageHandler.sendWithPromise("Terminate",null);e.push(t),Promise.all(e).then(()=>{this.commonObjs.clear(),this.fontLoader.clear(),this.#c.clear(),this.filterFactory.destroy(),this._networkStream?.cancelAllRequests(new _util.AbortException("Worker was terminated.")),this.messageHandler&&(this.messageHandler.destroy(),this.messageHandler=null),this.destroyCapability.resolve()},this.destroyCapability.reject)}return this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:o,loadingTask:n}=this;o.on("GetReader",(e,i)=>{(0,_util.assert)(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=e=>{this._lastProgress={loaded:e.loaded,total:e.total}},i.onPull=()=>{this._fullReader.read().then(function(e){var{value:e,done:t}=e;t?i.close():((0,_util.assert)(e instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),i.enqueue(new Uint8Array(e),1,[e]))}).catch(e=>{i.error(e)})},i.onCancel=e=>{this._fullReader.cancel(e),i.ready.catch(e=>{if(!this.destroyed)throw e})}}),o.on("ReaderHeadersReady",e=>{const t=new _util.PromiseCapability,i=this._fullReader;return i.headersReady.then(()=>{i.isStreamingSupported&&i.isRangeSupported||(this._lastProgress&&n.onProgress?.(this._lastProgress),i.onProgress=e=>{n.onProgress?.({loaded:e.loaded,total:e.total})}),t.resolve({isStreamingSupported:i.isStreamingSupported,isRangeSupported:i.isRangeSupported,contentLength:i.contentLength})},t.reject),t.promise}),o.on("GetRangeReader",(e,i)=>{(0,_util.assert)(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const t=this._networkStream.getRangeReader(e.begin,e.end);t?(i.onPull=()=>{t.read().then(function(e){var{value:e,done:t}=e;t?i.close():((0,_util.assert)(e instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),i.enqueue(new Uint8Array(e),1,[e]))}).catch(e=>{i.error(e)})},i.onCancel=e=>{t.cancel(e),i.ready.catch(e=>{if(!this.destroyed)throw e})}):i.close()}),o.on("GetDoc",e=>{e=e.pdfInfo;this._numPages=e.numPages,this._htmlForXfa=e.htmlForXfa,delete e.htmlForXfa,n._capability.resolve(new PDFDocumentProxy(e,this))}),o.on("DocException",function(e){let t;switch(e.name){case"PasswordException":t=new _util.PasswordException(e.message,e.code);break;case"InvalidPDFException":t=new _util.InvalidPDFException(e.message);break;case"MissingPDFException":t=new _util.MissingPDFException(e.message);break;case"UnexpectedResponseException":t=new _util.UnexpectedResponseException(e.message,e.status);break;case"UnknownErrorException":t=new _util.UnknownErrorException(e.message,e.details);break;default:(0,_util.unreachable)("DocException - expected a valid Error.")}n._capability.reject(t)}),o.on("PasswordRequest",e=>{if(this.#u=new _util.PromiseCapability,n.onPassword){var t=e=>{e instanceof Error?this.#u.reject(e):this.#u.resolve({password:e})};try{n.onPassword(t,e.code)}catch(e){this.#u.reject(e)}}else this.#u.reject(new _util.PasswordException(e.message,e.code));return this.#u.promise}),o.on("DataLoaded",e=>{n.onProgress?.({loaded:e.length,total:e.length}),this.downloadInfoCapability.resolve(e)}),o.on("StartRenderPage",e=>{this.destroyed||this.#h.get(e.pageIndex)._startRenderPage(e.transparency,e.cacheKey)}),o.on("commonobj",e=>{let[t,i,n]=e;if(!this.destroyed&&!this.commonObjs.has(t))switch(i){case"Font":const e=this._params;if("error"in n){const o=n.error;(0,_util.warn)("Error during font loading: "+o),this.commonObjs.resolve(t,o)}else{const r=e.pdfBug&&globalThis.FontInspector?.enabled?(e,t)=>globalThis.FontInspector.fontAdded(e,t):null,s=new _font_loader.FontFaceObject(n,{isEvalSupported:e.isEvalSupported,disableFontFace:e.disableFontFace,ignoreErrors:e.ignoreErrors,inspectFont:r});this.fontLoader.bind(s).catch(e=>o.sendWithPromise("FontFallback",{id:t})).finally(()=>{!e.fontExtraProperties&&s.data&&(s.data=null),this.commonObjs.resolve(t,s)})}break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(t,n);break;default:throw new Error("Got unknown common object type "+i)}}),o.on("obj",e=>{let[t,i,n,r]=e;if(!this.destroyed){var s=this.#h.get(i);if(!s.objs.has(t))switch(n){case"Image":if(s.objs.resolve(t,r),r){let e;if(r.bitmap){const{width:t,height:i}=r;e=t*i*4}else e=r.data?.length||0;e>_util.MAX_IMAGE_SIZE_TO_CACHE&&(s._maybeCleanupAfterRender=!0)}break;case"Pattern":s.objs.resolve(t,r);break;default:throw new Error("Got unknown object type "+n)}}}),o.on("DocProgress",e=>{this.destroyed||n.onProgress?.({loaded:e.loaded,total:e.total})}),o.on("FetchBuiltInCMap",e=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.cMapReaderFactory?this.cMapReaderFactory.fetch(e):Promise.reject(new Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter."))),o.on("FetchStandardFontData",e=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.standardFontDataFactory?this.standardFontDataFactory.fetch(e):Promise.reject(new Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter.")))}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){this.annotationStorage.size<=0&&(0,_util.warn)("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");var{map:e,transfers:t}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:e,filename:this._fullReader?.filename??null},t).finally(()=>{this.annotationStorage.resetModified()})}getPage(e){if(!Number.isInteger(e)||e<=0||e>this._numPages)return Promise.reject(new Error("Invalid page request."));const t=e-1,i=this.#d.get(t);return i||(e=this.messageHandler.sendWithPromise("GetPage",{pageIndex:t}).then(e=>{if(this.destroyed)throw new Error("Transport destroyed");e=new PDFPageProxy(t,e,this,this._params.pdfBug);return this.#h.set(t,e),e}),this.#d.set(t,e),e)}getPageIndex(e){return"object"!=typeof e||null===e||!Number.isInteger(e.num)||e.num<0||!Number.isInteger(e.gen)||e.gen<0?Promise.reject(new Error("Invalid pageIndex request.")):this.messageHandler.sendWithPromise("GetPageIndex",{num:e.num,gen:e.gen})}getAnnotations(e,t){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:e,intent:t})}getFieldObjects(){return this.#p("GetFieldObjects")}hasJSActions(){return this.#p("HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(e){return"string"!=typeof e?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:e})}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.#p("GetDocJSActions")}getPageJSActions(e){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:e})}getStructTree(e){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:e})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(){return this.messageHandler.sendWithPromise("GetOptionalContentConfig",null).then(e=>new _optional_content_config.OptionalContentConfig(e))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){var e="GetMetadata",t=this.#c.get(e);return t||(t=this.messageHandler.sendWithPromise(e,null).then(e=>({info:e[0],metadata:e[1]?new _metadata.Metadata(e[1]):null,contentDispositionFilename:this._fullReader?.filename??null,contentLength:this._fullReader?.contentLength??null})),this.#c.set(e,t),t)}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(){let e=0<arguments.length&&void 0!==arguments[0]&&arguments[0];if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const e of this.#h.values())if(!e.cleanup())throw new Error(`startCleanup: Page ${e.pageNumber} is currently rendering.`);this.commonObjs.clear(),e||this.fontLoader.clear(),this.#c.clear(),this.filterFactory.destroy(!0)}}get loadingParams(){var{disableAutoFetch:e,enableXfa:t}=this._params;return(0,_util.shadow)(this,"loadingParams",{disableAutoFetch:e,enableXfa:t})}}class PDFObjects{#f=Object.create(null);#g(e){return this.#f[e]||={capability:new _util.PromiseCapability,data:null}}get(e){let t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null;if(t){const i=this.#g(e);return i.capability.promise.then(()=>t(i.data)),null}const i=this.#f[e];if(i?.capability.settled)return i.data;throw new Error(`Requesting object that isn't resolved yet ${e}.`)}has(e){return this.#f[e]?.capability.settled||!1}resolve(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null,e=this.#g(e);e.data=t,e.capability.resolve()}clear(){for(const t in this.#f){var e=this.#f[t]["data"];e?.bitmap?.close()}this.#f=Object.create(null)}}class RenderTask{#m=null;constructor(e){this.#m=e,this.onContinue=null}get promise(){return this.#m.capability.promise}cancel(){this.#m.cancel(null,0<arguments.length&&void 0!==arguments[0]?arguments[0]:0)}get separateAnnots(){var e,t=this.#m.operatorList["separateAnnots"];return!!t&&(e=this.#m["annotationCanvasMap"],t.form||t.canvas&&0<e?.size)}}exports.RenderTask=RenderTask;class InternalRenderTask{static#b=new WeakSet;constructor(e){var{callback:e,params:t,objs:i,commonObjs:n,annotationCanvasMap:r,operatorList:s,pageIndex:o,canvasFactory:a,filterFactory:l,useRequestAnimationFrame:h=!1,pdfBug:c=!1,pageColors:d=null}=e;this.callback=e,this.params=t,this.objs=i,this.commonObjs=n,this.annotationCanvasMap=r,this.operatorListIdx=null,this.operatorList=s,this._pageIndex=o,this.canvasFactory=a,this.filterFactory=l,this._pdfBug=c,this.pageColors=d,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=!0===h&&"undefined"!=typeof window,this.cancelled=!1,this.capability=new _util.PromiseCapability,this.task=new RenderTask(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=t.canvasContext.canvas}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics(e){var{transparency:e=!1,optionalContentConfig:t}=e;if(!this.cancelled){if(this._canvas){if(InternalRenderTask.#b.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.");InternalRenderTask.#b.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());var{canvasContext:i,viewport:n,transform:r,background:s}=this.params;this.gfx=new _canvas.CanvasGraphics(i,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:t},this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:r,viewport:n,transparency:e,background:s}),this.operatorListIdx=0,this.graphicsReady=!0,this.graphicsReadyCallback?.()}}cancel(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:null,t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0;this.running=!1,this.cancelled=!0,this.gfx?.endDrawing(),InternalRenderTask.#b.delete(this._canvas),this.callback(e||new _display_utils.RenderingCancelledException("Rendering cancelled, page "+(this._pageIndex+1),t))}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?window.requestAnimationFrame(()=>{this._nextBound().catch(this._cancelBound)}):Promise.resolve().then(this._nextBound).catch(this._cancelBound)}async _next(){this.cancelled||(this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continueBound,this.stepper),this.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk)&&(this.gfx.endDrawing(),InternalRenderTask.#b.delete(this._canvas),this.callback()))}}const version="3.11.174",build=(exports.version=version,"ce8716743");exports.build=build},(e,t,i)=>{var n=i(3),r=i(126);n({target:"Set",proto:!0,real:!0,forced:!i(135)("difference")},{difference:r})},(e,t,i)=>{var r=i(127),n=i(128),s=i(129),o=i(132),a=i(133),l=i(130),h=i(131),c=n.has,d=n.remove;e.exports=function(e){var t=r(this),i=a(e),n=s(t);return o(t)<=i.size?l(t,function(e){i.includes(e)&&d(n,e)}):h(i.getIterator(),function(e){c(t,e)&&d(n,e)}),n}},(e,t,i)=>{var n=i(128).has;e.exports=function(e){return n(e),e}},(e,t,i)=>{var i=i(14),n=Set.prototype;e.exports={Set:Set,add:i(n.add),has:i(n.has),remove:i(n.delete),proto:n}},(e,t,i)=>{var n=i(128),r=i(130),s=n.Set,o=n.add;e.exports=function(e){var t=new s;return r(e,function(e){o(t,e)}),t}},(e,t,i)=>{var n=i(14),r=i(131),i=i(128),s=i.Set,i=i.proto,o=n(i.forEach),a=n(i.keys),l=a(new s).next;e.exports=function(e,t,i){return i?r({iterator:a(e),next:l},t):o(e,t)}},(e,t,i)=>{var o=i(8);e.exports=function(e,t,i){for(var n,r=i?e:e.iterator,s=e.next;!(n=o(s,r)).done;)if(void 0!==(n=t(n.value)))return n}},(e,t,i)=>{var n=i(72),i=i(128);e.exports=n(i.proto,"size","get")||function(e){return e.size}},(e,t,i)=>{function n(e,t,i,n){this.set=e,this.size=t,this.has=i,this.keys=n}var r=i(31),s=i(47),o=i(8),a=i(62),l=i(134),h="Invalid size",c=RangeError,d=TypeError,u=Math.max;n.prototype={getIterator:function(){return l(s(o(this.keys,this.set)))},includes:function(e){return o(this.has,this.set,e)}},e.exports=function(e){s(e);var t=+e.size;if(t!=t)throw d(h);t=a(t);if(t<0)throw c(h);return new n(e,u(t,0),r(e.has),r(e.keys))}},e=>{e.exports=function(e){return{iterator:e,next:e.next,done:!1}}},(e,t,i)=>{function n(e){return{size:e,has:function(){return!1},keys:function(){return{next:function(){return{done:!0}}}}}}var r=i(24);e.exports=function(e){var t=r("Set");try{(new t)[e](n(0));try{return(new t)[e](n(-1)),!1}catch(e){return!0}}catch(e){return!1}}},(e,t,i)=>{var n=i(3),r=i(7),s=i(137);n({target:"Set",proto:!0,real:!0,forced:!i(135)("intersection")||r(function(){return"3,2"!==Array.from(new Set([1,2,3]).intersection(new Set([3,2])))})},{intersection:s})},(e,t,i)=>{var r=i(127),n=i(128),s=i(132),o=i(133),a=i(130),l=i(131),h=n.Set,c=n.add,d=n.has;e.exports=function(e){var t=r(this),i=o(e),n=new h;return s(t)>i.size?l(i.getIterator(),function(e){d(t,e)&&c(n,e)}):a(t,function(e){i.includes(e)&&c(n,e)}),n}},(e,t,i)=>{var n=i(3),r=i(139);n({target:"Set",proto:!0,real:!0,forced:!i(135)("isDisjointFrom")},{isDisjointFrom:r})},(e,t,i)=>{var r=i(127),s=i(128).has,o=i(132),a=i(133),l=i(130),h=i(131),c=i(140);e.exports=function(e){var t,i=r(this),n=a(e);return o(i)<=n.size?!1!==l(i,function(e){if(n.includes(e))return!1},!0):(t=n.getIterator(),!1!==h(t,function(e){if(s(i,e))return c(t,"normal",!1)}))}},(e,t,i)=>{var s=i(8),o=i(47),a=i(30);e.exports=function(e,t,i){var n,r;o(e);try{if(!(n=a(e,"return"))){if("throw"===t)throw i;return i}n=s(n,e)}catch(e){r=!0,n=e}if("throw"===t)throw i;if(r)throw n;return o(n),i}},(e,t,i)=>{var n=i(3),r=i(142);n({target:"Set",proto:!0,real:!0,forced:!i(135)("isSubsetOf")},{isSubsetOf:r})},(e,t,i)=>{var n=i(127),r=i(132),s=i(130),o=i(133);e.exports=function(e){var t=n(this),i=o(e);return!(r(t)>i.size)&&!1!==s(t,function(e){if(!i.includes(e))return!1},!0)}},(e,t,i)=>{var n=i(3),r=i(144);n({target:"Set",proto:!0,real:!0,forced:!i(135)("isSupersetOf")},{isSupersetOf:r})},(e,t,i)=>{var n=i(127),r=i(128).has,s=i(132),o=i(133),a=i(131),l=i(140);e.exports=function(e){var t,i=n(this),e=o(e);return!(s(i)<e.size)&&(t=e.getIterator(),!1!==a(t,function(e){if(!r(i,e))return l(t,"normal",!1)}))}},(e,t,i)=>{var n=i(3),r=i(146);n({target:"Set",proto:!0,real:!0,forced:!i(135)("symmetricDifference")},{symmetricDifference:r})},(e,t,i)=>{var n=i(127),r=i(128),s=i(129),o=i(133),a=i(131),l=r.add,h=r.has,c=r.remove;e.exports=function(e){var t=n(this),e=o(e).getIterator(),i=s(t);return a(e,function(e){(h(t,e)?c:l)(i,e)}),i}},(e,t,i)=>{var n=i(3),r=i(148);n({target:"Set",proto:!0,real:!0,forced:!i(135)("union")},{union:r})},(e,t,i)=>{var n=i(127),r=i(128).add,s=i(129),o=i(133),a=i(131);e.exports=function(e){var t=n(this),e=o(e).getIterator(),i=s(t);return a(e,function(e){r(i,e)}),i}},(e,t,i)=>{function n(){d(this,w);var e=p((t=arguments.length)<1?void 0:arguments[0]),t=p(t<2?void 0:arguments[1],"Error"),t=new b(e,t);return(e=y(e)).name=v,h(t,"stack",l(1,g(e.stack,1))),u(t,this,n),t}var r,s=i(3),o=i(4),a=i(24),l=i(11),h=i(45).f,c=i(39),d=i(150),u=i(75),p=i(76),m=i(151),g=i(82),f=i(6),i=i(36),v="DOMException",y=a("Error"),b=a(v),w=n.prototype=b.prototype,x="stack"in y(v),S="stack"in new b(1,2),f=b&&f&&Object.getOwnPropertyDescriptor(o,v),o=!(!f||f.writable&&f.configurable),f=x&&!o&&!S,A=(s({global:!0,constructor:!0,forced:i||f},{DOMException:f?n:b}),a(v)),x=A.prototype;if(x.constructor!==A)for(var k in i||h(x,"constructor",l(1,A)),m)!c(m,k)||c(A,r=(k=m[k]).s)||h(A,r,l(6,k.c))},(e,t,i)=>{var n=i(25),r=TypeError;e.exports=function(e,t){if(n(t,e))return e;throw r("Incorrect invocation")}},e=>{e.exports={IndexSizeError:{s:"INDEX_SIZE_ERR",c:1,m:1},DOMStringSizeError:{s:"DOMSTRING_SIZE_ERR",c:2,m:0},HierarchyRequestError:{s:"HIERARCHY_REQUEST_ERR",c:3,m:1},WrongDocumentError:{s:"WRONG_DOCUMENT_ERR",c:4,m:1},InvalidCharacterError:{s:"INVALID_CHARACTER_ERR",c:5,m:1},NoDataAllowedError:{s:"NO_DATA_ALLOWED_ERR",c:6,m:0},NoModificationAllowedError:{s:"NO_MODIFICATION_ALLOWED_ERR",c:7,m:1},NotFoundError:{s:"NOT_FOUND_ERR",c:8,m:1},NotSupportedError:{s:"NOT_SUPPORTED_ERR",c:9,m:1},InUseAttributeError:{s:"INUSE_ATTRIBUTE_ERR",c:10,m:1},InvalidStateError:{s:"INVALID_STATE_ERR",c:11,m:1},SyntaxError:{s:"SYNTAX_ERR",c:12,m:1},InvalidModificationError:{s:"INVALID_MODIFICATION_ERR",c:13,m:1},NamespaceError:{s:"NAMESPACE_ERR",c:14,m:1},InvalidAccessError:{s:"INVALID_ACCESS_ERR",c:15,m:1},ValidationError:{s:"VALIDATION_ERR",c:16,m:0},TypeMismatchError:{s:"TYPE_MISMATCH_ERR",c:17,m:1},SecurityError:{s:"SECURITY_ERR",c:18,m:1},NetworkError:{s:"NETWORK_ERR",c:19,m:1},AbortError:{s:"ABORT_ERR",c:20,m:1},URLMismatchError:{s:"URL_MISMATCH_ERR",c:21,m:1},QuotaExceededError:{s:"QUOTA_EXCEEDED_ERR",c:22,m:1},TimeoutError:{s:"TIMEOUT_ERR",c:23,m:1},InvalidNodeTypeError:{s:"INVALID_NODE_TYPE_ERR",c:24,m:1},DataCloneError:{s:"DATA_CLONE_ERR",c:25,m:1}}},(l,h,e)=>{function t(n){return!s(function(){var e=new v.Set([7]),t=n(e),i=n(C(7));return t===e||!t.has(7)||"object"!=typeof i||7!=+i})&&n}function i(i,n){return!s(function(){var e=new n,t=i({a:e,b:e});return!(t&&t.a===t.b&&t.a instanceof n&&t.a.stack===e.stack)})}function u(e){throw new E("Uncloneable type: "+e,I)}function p(e,t){return D||O(t),D(e)}function m(e,t,i,n,r){var s=v[t];return w(s)||O(t),new s(N(e.buffer,r),i,n)}function g(e,t,i){this.object=e,this.type=t,this.metadata=i}function f(e,i,n){if(W(e)&&u("Symbol"),!w(e))return e;if(i){if(R(i,e))return $(i,e)}else i=new M;var t,r,s,o,a,l,h,c,d=S(e);switch(d){case"Array":s=Q(k(e));break;case"Object":s={};break;case"Map":s=new M;break;case"Set":s=new he;break;case"RegExp":s=new RegExp(e.source,K(e));break;case"Error":switch(r=e.name){case"AggregateError":s=y("AggregateError")([]);break;case"EvalError":s=Z();break;case"RangeError":s=ee();break;case"ReferenceError":s=te();break;case"SyntaxError":s=ie();break;case"TypeError":s=ne();break;case"URIError":s=re();break;case"CompileError":s=oe();break;case"LinkError":s=ae();break;case"RuntimeError":s=le();break;default:s=T()}break;case"DOMException":s=new E(e.message,e.name);break;case"ArrayBuffer":case"SharedArrayBuffer":s=n?new g(e,d):N(e,i,d);break;case"DataView":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float16Array":case"Float32Array":case"Float64Array":case"BigInt64Array":case"BigUint64Array":l="DataView"===d?e.byteLength:e.length,s=n?new g(e,d,{offset:e.byteOffset,length:l}):m(e,d,e.byteOffset,l,i);break;case"DOMQuad":try{s=new DOMQuad(f(e.p1,i,n),f(e.p2,i,n),f(e.p3,i,n),f(e.p4,i,n))}catch(i){s=p(e,d)}break;case"File":if(D)try{s=D(e),S(s)!==d&&(s=void 0)}catch(e){}if(!s)try{s=new File([e],e.name,e)}catch(e){}s||O(d);break;case"FileList":if(o=function(){var t;try{t=new v.DataTransfer}catch(e){try{t=new v.ClipboardEvent("").clipboardData}catch(t){}}return t&&t.items&&t.files?t:null}()){for(a=0,l=k(e);a<l;a++)o.items.add(f(e[a],i,n));s=o.files}else s=p(e,d);break;case"ImageData":try{s=new ImageData(f(e.data,i,n),e.width,e.height,{colorSpace:e.colorSpace})}catch(i){s=p(e,d)}break;default:if(D)s=D(e);else switch(d){case"BigInt":s=C(e.valueOf());break;case"Boolean":s=C(pe(e));break;case"Number":s=C(me(e));break;case"String":s=C(ge(e));break;case"Date":s=new J(fe(e));break;case"Blob":try{s=e.slice(0,e.size,e.type)}catch(e){O(d)}break;case"DOMPoint":case"DOMPointReadOnly":t=v[d];try{s=t.fromPoint?t.fromPoint(e):new t(e.x,e.y,e.z,e.w)}catch(e){O(d)}break;case"DOMRect":case"DOMRectReadOnly":t=v[d];try{s=t.fromRect?t.fromRect(e):new t(e.x,e.y,e.width,e.height)}catch(e){O(d)}break;case"DOMMatrix":case"DOMMatrixReadOnly":t=v[d];try{s=t.fromMatrix?t.fromMatrix(e):new t(e)}catch(e){O(d)}break;case"AudioData":case"VideoFrame":b(e.clone)||O(d);try{s=e.clone()}catch(e){u(d)}break;case"CropTarget":case"CryptoKey":case"FileSystemDirectoryHandle":case"FileSystemFileHandle":case"FileSystemHandle":case"GPUCompilationInfo":case"GPUCompilationMessage":case"ImageBitmap":case"RTCCertificate":case"WebAssembly.Module":O(d);default:u(d)}}switch(L(i,e,s),d){case"Array":case"Object":for(h=de(e),a=0,l=k(h);a<l;a++)c=h[a],j(s,c,f(e[c],i,n));break;case"Map":e.forEach(function(e,t){L(s,f(t,i,n),f(e,i,n))});break;case"Set":e.forEach(function(e){ce(s,f(e,i,n))});break;case"Error":A(s,"message",f(e.message,i,n)),V(e,"cause")&&A(s,"cause",f(e.cause,i,n)),"AggregateError"===r&&(s.errors=f(e.errors,i,n));case"DOMException":Y&&A(s,"stack",f(e.stack,i,n))}return s}function d(e,i){if(!w(e))return e;if(R(i,e))return $(i,e);var t,n,r,s,o,a,l,h;if(e instanceof g)switch(t=e.type,n=e.object,t){case"ArrayBuffer":case"SharedArrayBuffer":h=N(n,i,t);break;case"DataView":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float16Array":case"Float32Array":case"Float64Array":case"BigInt64Array":case"BigUint64Array":r=e.metadata,h=m(n,t,r.offset,r.length,i)}else switch(S(e)){case"Array":case"Object":for(a=de(e),s=0,o=k(a);s<o;s++)e[l=a[s]]=d(e[l],i);break;case"Map":h=new M,e.forEach(function(e,t){L(h,d(t,i),d(e,i))});break;case"Set":h=new he,e.forEach(function(e){ce(h,d(e,i))});break;case"Error":e.message=d(e.message,i),V(e,"cause")&&(e.cause=d(e.cause,i)),"AggregateError"===e.name&&(e.errors=d(e.errors,i));case"DOMException":Y&&(e.stack=d(e.stack,i))}return L(i,e,h||e),h||e}var n,c=e(36),B=e(3),v=e(4),y=e(24),r=e(14),s=e(7),z=e(41),b=e(21),H=e(153),U=e(17),w=e(20),W=e(23),q=e(154),x=e(47),S=e(78),V=e(39),j=e(159),A=e(44),k=e(64),G=e(85),K=e(160),o=e(162),X=e(128),Y=e(83),_=e(119),C=v.Object,Q=v.Array,J=v.Date,T=v.Error,Z=v.EvalError,ee=v.RangeError,te=v.ReferenceError,ie=v.SyntaxError,ne=v.TypeError,re=v.URIError,se=v.PerformanceMark,e=v.WebAssembly,oe=e&&e.CompileError||T,ae=e&&e.LinkError||T,le=e&&e.RuntimeError||T,E=y("DOMException"),M=o.Map,R=o.has,$=o.get,L=o.set,he=X.Set,ce=X.add,de=y("Object","keys"),ue=r([].push),pe=r((!0).valueOf),me=r(1..valueOf),ge=r("".valueOf),fe=r(J.prototype.getTime),a=z("structuredClone"),I="DataCloneError",F="Transferring",P=v.structuredClone,e=c||!i(P,T)||!i(P,E)||(n=P,!!s(function(){var e=n(new v.AggregateError([1],a,{cause:3}));return"AggregateError"!==e.name||1!==e.errors[0]||e.message!==a||3!==e.cause})),o=!P&&t(function(e){return new se(a,{detail:e}).detail}),D=t(P)||o,O=function(e,t){throw new E((t||"Cloning")+" of "+e+" cannot be properly polyfilled in this engine",I)},N=function(e,t,i){if(R(t,e))return $(t,e);var n,r,s,o,a,l;if("SharedArrayBuffer"===(i||S(e)))n=D?D(e):e;else{i=v.DataView;i||"function"==typeof e.slice||O("ArrayBuffer");try{if("function"!=typeof e.slice||e.resizable){r=e.byteLength,s="maxByteLength"in e?{maxByteLength:e.maxByteLength}:void 0,n=new ArrayBuffer(r,s),o=new i(e),a=new i(n);for(l=0;l<r;l++)a.setUint8(l,o.getUint8(l))}else n=e.slice(0)}catch(e){throw new E("ArrayBuffer is detached",I)}}return L(t,e,n),n};B({global:!0,enumerable:!0,sham:!_,forced:e},{structuredClone:function(e){var t,i=1<G(arguments.length,1)&&!U(arguments[1])?x(arguments[1]):void 0,i=i?i.transfer:void 0,n=!1,r=(void 0!==i&&(r=function(e,t){if(!w(e))throw ne("Transfer option cannot be converted to a sequence");var i=[];q(e,function(e){ue(i,x(e))});for(var n,r,s,o,a,l=0,h=k(i),c=[];l<h;)if(n=i[l++],"ArrayBuffer"!==(r=S(n))){if(R(t,n))throw new E("Duplicate transferable",I);if(_)o=P(n,{transfer:[n]});else switch(r){case"ImageBitmap":s=v.OffscreenCanvas,H(s)||O(r,F);try{(a=new s(n.width,n.height)).getContext("bitmaprenderer").transferFromImageBitmap(n),o=a.transferToImageBitmap()}catch(e){}break;case"AudioData":case"VideoFrame":b(n.clone)&&b(n.close)||O(r,F);try{o=n.clone(),n.close()}catch(e){}break;case"MediaSourceHandle":case"MessagePort":case"OffscreenCanvas":case"ReadableStream":case"TransformStream":case"WritableStream":O(r,F)}if(void 0===o)throw new E("This object cannot be transferred: "+r,I);L(t,n,o)}else ue(c,n);return c}(i,t=new M),n=!!k(r)),f(e,t,n));if(n){for(var s,o,a=i,l=t=new M,h=0,c=k(a);h<c;){if(s=a[h++],R(l,s))throw new E("Duplicate transferable",I);o=_?P(s,{transfer:[s]}):(b(s.transfer)||O("ArrayBuffer",F),s.transfer()),L(l,s,o)}r=d(r,t)}return r}})},(e,t,i)=>{function n(){}function r(e){if(!l(e))return!1;try{return p(n,u,e),!0}catch(e){return!1}}function s(e){if(!l(e))return!1;switch(h(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return f||!!g(m,d(e))}catch(e){return!0}}var o=i(14),a=i(7),l=i(21),h=i(78),c=i(24),d=i(51),u=[],p=c("Reflect","construct"),m=/^\s*(?:class|function)\b/,g=o(m.exec),f=!m.exec(n);s.sham=!0,e.exports=!p||a(function(){var e;return r(r.call)||!r(Object)||!r(function(){e=!0})||e})?s:r},(e,t,i)=>{function v(e,t){this.stopped=e,this.result=t}var y=i(99),b=i(8),w=i(47),x=i(32),S=i(155),A=i(64),k=i(25),_=i(157),C=i(158),T=i(140),E=TypeError,M=v.prototype;e.exports=function(e,t,i){function n(e){return s&&T(s,"normal",e),new v(!0,e)}function r(e){return u?(w(e),g?f(e[0],e[1],n):f(e[0],e[1])):g?f(e,n):f(e)}var s,o,a,l,h,c,d=i&&i.that,u=!(!i||!i.AS_ENTRIES),p=!(!i||!i.IS_RECORD),m=!(!i||!i.IS_ITERATOR),g=!(!i||!i.INTERRUPTED),f=y(t,d);if(p)s=e.iterator;else if(m)s=e;else{if(!(i=C(e)))throw E(x(e)+" is not iterable");if(S(i)){for(o=0,a=A(e);o<a;o++)if((l=r(e[o]))&&k(M,l))return l;return new v(!1)}s=_(e,i)}for(h=(p?e:s).next;!(c=b(h,s)).done;){try{l=r(c.value)}catch(e){T(s,"throw",e)}if("object"==typeof l&&l&&k(M,l))return l}return new v(!1)}},(e,t,i)=>{var n=i(34),r=i(156),s=n("iterator"),o=Array.prototype;e.exports=function(e){return void 0!==e&&(r.Array===e||o[s]===e)}},e=>{e.exports={}},(e,t,i)=>{var n=i(8),r=i(31),s=i(47),o=i(32),a=i(158),l=TypeError;e.exports=function(e,t){t=arguments.length<2?a(e):t;if(r(t))return s(n(t,e));throw l(o(e)+" is not iterable")}},(e,t,i)=>{var n=i(78),r=i(30),s=i(17),o=i(156),a=i(34)("iterator");e.exports=function(e){if(!s(e))return r(e,a)||r(e,"@@iterator")||o[n(e)]}},(e,t,i)=>{var n=i(18),r=i(45),s=i(11);e.exports=function(e,t,i){t=n(t);t in e?r.f(e,t,s(0,i)):e[t]=i}},(e,t,i)=>{var n=i(8),r=i(39),s=i(25),o=i(161),a=RegExp.prototype;e.exports=function(e){var t=e.flags;return void 0!==t||"flags"in a||r(e,"flags")||!s(a,e)?t:n(o,e)}},(e,t,i)=>{var n=i(47);e.exports=function(){var e=n(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.unicodeSets&&(t+="v"),e.sticky&&(t+="y"),t}},(e,t,i)=>{var i=i(14),n=Map.prototype;e.exports={Map:Map,set:i(n.set),get:i(n.get),has:i(n.has),remove:i(n.delete),proto:n}},(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SerializableEmpty=t.PrintAnnotationStorage=t.AnnotationStorage=void 0,i(89),i(149),i(152);var n=i(1),s=i(164),o=i(170);const a=Object.freeze({map:null,hash:"",transfers:void 0});t.SerializableEmpty=a;class r{#v=!1;#y=new Map;constructor(){this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(e,t){e=this.#y.get(e);return void 0===e?t:Object.assign(t,e)}getRawValue(e){return this.#y.get(e)}remove(e){if(this.#y.delete(e),0===this.#y.size&&this.resetModified(),"function"==typeof this.onAnnotationEditor){for(const e of this.#y.values())if(e instanceof s.AnnotationEditor)return;this.onAnnotationEditor(null)}}setValue(e,t){var i=this.#y.get(e);let n=!1;if(void 0!==i)for(const[e,s]of Object.entries(t))i[e]!==s&&(n=!0,i[e]=s);else n=!0,this.#y.set(e,t);n&&this.#_(),t instanceof s.AnnotationEditor&&"function"==typeof this.onAnnotationEditor&&this.onAnnotationEditor(t.constructor._type)}has(e){return this.#y.has(e)}getAll(){return 0<this.#y.size?(0,n.objectFromMap)(this.#y):null}setAll(e){for(var[t,i]of Object.entries(e))this.setValue(t,i)}get size(){return this.#y.size}#_(){this.#v||(this.#v=!0,"function"==typeof this.onSetModified&&this.onSetModified())}resetModified(){this.#v&&(this.#v=!1,"function"==typeof this.onResetModified)&&this.onResetModified()}get print(){return new l(this)}get serializable(){if(0===this.#y.size)return a;const e=new Map,t=new o.MurmurHash3_64,i=[],n=Object.create(null);let r=!1;for(const[i,o]of this.#y){const a=o instanceof s.AnnotationEditor?o.serialize(!1,n):o;a&&(e.set(i,a),t.update(i+":"+JSON.stringify(a)),r||=!!a.bitmap)}if(r)for(const t of e.values())t.bitmap&&i.push(t.bitmap);return 0<e.size?{map:e,hash:t.hexdigest(),transfers:i}:a}}class l extends(t.AnnotationStorage=r){#A;constructor(e){super();var{map:e,hash:t,transfers:i}=e.serializable,e=structuredClone(e,null);this.#A={map:e,hash:t,transfers:i}}get print(){(0,n.unreachable)("Should not call PrintAnnotationStorage.print")}get serializable(){return this.#A}}t.PrintAnnotationStorage=l},(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.AnnotationEditor=void 0,i(89),i(2);var n=i(165),f=i(1),r=i(168);class T{#S="";#E=!1;#x=null;#w=null;#C=null;#T=!1;#P=null;#k=this.focusin.bind(this);#M=this.focusout.bind(this);#F=!1;#R=!1;#D=!1;_initialOptions=Object.create(null);_uiManager=null;_focusEventsAllowed=!0;_l10nPromise=null;#I=!1;#O=T._zIndex++;static _borderLineWidth=-1;static _colorManager=new n.ColorManager;static _zIndex=1;static SMALL_EDITOR_SIZE=0;constructor(e){this.constructor===T&&(0,f.unreachable)("Cannot initialize AnnotationEditor."),this.parent=e.parent,this.id=e.id,this.width=this.height=null,this.pageIndex=e.parent.pageIndex,this.name=e.name,this.div=null,this._uiManager=e.uiManager,this.annotationElementId=null,this._willKeepAspectRatio=!1,this._initialOptions.isCentered=e.isCentered,this._structTreeParentId=null;var{rotation:t,rawDims:{pageWidth:i,pageHeight:n,pageX:r,pageY:s}}=this.parent.viewport,[t,i]=(this.rotation=t,this.pageRotation=(360+t-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[i,n],this.pageTranslation=[r,s],this.parentDimensions);this.x=e.x/t,this.y=e.y/i,this.isAttachedToDOM=!1,this.deleted=!1}get editorType(){return Object.getPrototypeOf(this).constructor._type}static get _defaultLineColor(){return(0,f.shadow)(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(e){var t=new s({id:e.parent.getNextId(),parent:e.parent,uiManager:e._uiManager});t.annotationElementId=e.annotationElementId,t.deleted=!0,t._uiManager.addToAnnotationStorage(t)}static initialize(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null;if(T._l10nPromise||=new Map(["editor_alt_text_button_label","editor_alt_text_edit_button_label","editor_alt_text_decorative_tooltip"].map(e=>[e,t.get(e)])),e?.strings)for(const i of e.strings)T._l10nPromise.set(i,t.get(i));if(-1===T._borderLineWidth){const i=getComputedStyle(document.documentElement);T._borderLineWidth=parseFloat(i.getPropertyValue("--outline-width"))||0}}static updateDefaultParams(e,t){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(e){return!1}static paste(e,t){(0,f.unreachable)("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return this.#I}set _isDraggable(e){this.#I=e,this.div?.classList.toggle("draggable",e)}center(){var[e,t]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*t/(2*e),this.y+=this.width*e/(2*t);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*t/(2*e),this.y-=this.width*e/(2*t);break;default:this.x-=this.width/2,this.y-=this.height/2}this.fixAndSetPosition()}addCommands(e){this._uiManager.addCommands(e)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=this.#O}setParent(e){null!==e&&(this.pageIndex=e.pageIndex,this.pageDimensions=e.pageDimensions),this.parent=e}focusin(e){this._focusEventsAllowed&&(this.#F?this.#F=!1:this.parent.setSelected(this))}focusout(e){this._focusEventsAllowed&&this.isAttachedToDOM&&!e.relatedTarget?.closest("#"+this.id)&&(e.preventDefault(),!this.parent?.isMultipleSelection)&&this.commitOrRemove()}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(e,t,i,n){var[r,s]=this.parentDimensions;[i,n]=this.screenToPageTranslation(i,n),this.x=(e+i)/r,this.y=(t+n)/s,this.fixAndSetPosition()}#L(e,t,i){var[e,n]=e;[t,i]=this.screenToPageTranslation(t,i),this.x+=t/e,this.y+=i/n,this.fixAndSetPosition()}translate(e,t){this.#L(this.parentDimensions,e,t)}translateInPage(e,t){this.#L(this.pageDimensions,e,t),this.div.scrollIntoView({block:"nearest"})}drag(e,t){var[i,n]=this.parentDimensions;if(this.x+=e/i,this.y+=t/n,this.parent&&(this.x<0||1<this.x||this.y<0||1<this.y)){const{x:e,y:t}=this.div.getBoundingClientRect();this.parent.findNewParent(this,e,t)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}var{x:e,y:i}=this,[t,n]=this.#N();i+=n,this.div.style.left=(100*(e+=t)).toFixed(2)+"%",this.div.style.top=(100*i).toFixed(2)+"%",this.div.scrollIntoView({block:"nearest"})}#N(){var[e,t]=this.parentDimensions,i=T["_borderLineWidth"],n=i/e,r=i/t;switch(this.rotation){case 90:return[-n,r];case 180:return[n,r];case 270:return[n,-r];default:return[-n,-r]}}fixAndSetPosition(){var[e,t]=this.pageDimensions;let{x:i,y:n,width:r,height:s}=this;switch(r*=e,s*=t,i*=e,n*=t,this.rotation){case 0:i=Math.max(0,Math.min(e-r,i)),n=Math.max(0,Math.min(t-s,n));break;case 90:i=Math.max(0,Math.min(e-s,i)),n=Math.min(t,Math.max(r,n));break;case 180:i=Math.min(e,Math.max(r,i)),n=Math.min(t,Math.max(s,n));break;case 270:i=Math.min(e,Math.max(s,i)),n=Math.max(0,Math.min(t-r,n))}this.x=i/=e,this.y=n/=t;var[o,a]=this.#N(),o=(i+=o,n+=a,this.div)["style"];o.left=(100*i).toFixed(2)+"%",o.top=(100*n).toFixed(2)+"%",this.moveInDOM()}static#B(e,t,i){switch(i){case 90:return[t,-e];case 180:return[-e,-t];case 270:return[-t,e];default:return[e,t]}}screenToPageTranslation(e,t){return T.#B(e,t,this.parentRotation)}pageTranslationToScreen(e,t){return T.#B(e,t,360-this.parentRotation)}#j(e){switch(e){case 90:{const[e,t]=this.pageDimensions;return[0,-e/t,t/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(){var{parentScale:e,pageDimensions:[t,i]}=this,t=t*e,i=i*e;return f.FeatureTest.isCSSRoundSupported?[Math.round(t),Math.round(i)]:[t,i]}setDims(e,t){var[i,n]=this.parentDimensions;this.div.style.width=(100*e/i).toFixed(2)+"%",this.#T||(this.div.style.height=(100*t/n).toFixed(2)+"%"),this.#x?.classList.toggle("small",e<T.SMALL_EDITOR_SIZE||t<T.SMALL_EDITOR_SIZE)}fixDims(){var e,t,i=this.div["style"],{height:n,width:r}=i,s=r.endsWith("%"),o=!this.#T&&n.endsWith("%");s&&o||([e,t]=this.parentDimensions,s||(i.width=(100*parseFloat(r)/e).toFixed(2)+"%"),this.#T)||o||(i.height=(100*parseFloat(n)/t).toFixed(2)+"%")}getInitialTranslation(){return[0,0]}#U(){if(!this.#P){this.#P=document.createElement("div"),this.#P.classList.add("resizers");const e=["topLeft","topRight","bottomRight","bottomLeft"];this._willKeepAspectRatio||e.push("topMiddle","middleRight","bottomMiddle","middleLeft");for(const t of e){const e=document.createElement("div");this.#P.append(e),e.classList.add("resizer",t),e.addEventListener("pointerdown",this.#z.bind(this,t)),e.addEventListener("contextmenu",r.noContextMenu)}this.div.prepend(this.#P)}}#z(e,t){t.preventDefault();var i=f.FeatureTest.platform["isMac"];if(!(0!==t.button||t.ctrlKey&&i)){const o=this.#W.bind(this,e),a=this._isDraggable,l={passive:!(this._isDraggable=!1),capture:!0},h=(window.addEventListener("pointermove",o,l),this.x),c=this.y,d=this.width,u=this.height,p=this.parent.div.style.cursor,m=this.div.style.cursor,g=(this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(t.target).cursor,()=>{this._isDraggable=a,window.removeEventListener("pointerup",g),window.removeEventListener("blur",g),window.removeEventListener("pointermove",o,l),this.parent.div.style.cursor=p,this.div.style.cursor=m;const i=this.x,n=this.y,r=this.width,s=this.height;i===h&&n===c&&r===d&&s===u||this.addCommands({cmd:()=>{this.width=r,this.height=s,this.x=i,this.y=n;var[e,t]=this.parentDimensions;this.setDims(e*r,t*s),this.fixAndSetPosition()},undo:()=>{this.width=d,this.height=u,this.x=h,this.y=c;var[e,t]=this.parentDimensions;this.setDims(e*d,t*u),this.fixAndSetPosition()},mustExec:!0})});window.addEventListener("pointerup",g),window.addEventListener("blur",g)}}#W(e,t){const[i,n]=this.parentDimensions,r=this.x,s=this.y,o=this.width,a=this.height,l=T.MIN_SIZE/i,h=T.MIN_SIZE/n,c=e=>Math.round(1e4*e)/1e4,d=this.#j(this.rotation),u=(e,t)=>[d[0]*e+d[2]*t,d[1]*e+d[3]*t],p=this.#j(360-this.rotation);let m,g,f=!1,v=!1;switch(e){case"topLeft":f=!0,m=(e,t)=>[0,0],g=(e,t)=>[e,t];break;case"topMiddle":m=(e,t)=>[e/2,0],g=(e,t)=>[e/2,t];break;case"topRight":f=!0,m=(e,t)=>[e,0],g=(e,t)=>[0,t];break;case"middleRight":v=!0,m=(e,t)=>[e,t/2],g=(e,t)=>[0,t/2];break;case"bottomRight":f=!0,m=(e,t)=>[e,t],g=(e,t)=>[0,0];break;case"bottomMiddle":m=(e,t)=>[e/2,t],g=(e,t)=>[e/2,0];break;case"bottomLeft":f=!0,m=(e,t)=>[0,t],g=(e,t)=>[e,0];break;case"middleLeft":v=!0,m=(e,t)=>[0,t/2],g=(e,t)=>[e,t/2]}var y=m(o,a),b=g(o,a),e=u(...b),w=c(r+e[0]),x=c(s+e[1]);let S=1,A=1,[k,_]=this.screenToPageTranslation(t.movementX,t.movementY);if([k,_]=[p[0]*(t=k/i)+p[2]*(C=_/n),p[1]*t+p[3]*C],f){const e=Math.hypot(o,a);S=A=Math.max(Math.min(Math.hypot(b[0]-y[0]-k,b[1]-y[1]-_)/e,1/o,1/a),l/o,h/a)}else v?S=Math.max(l,Math.min(1,Math.abs(b[0]-y[0]-k)))/o:A=Math.max(h,Math.min(1,Math.abs(b[1]-y[1]-_)))/a;var t=c(o*S),C=c(a*A),b=w-(e=u(...g(t,C)))[0],y=x-e[1];this.width=t,this.height=C,this.x=b,this.y=y,this.setDims(i*t,n*C),this.fixAndSetPosition()}async addAltTextButton(){if(!this.#x){const t=this.#x=document.createElement("button"),e=(t.className="altText",await T._l10nPromise.get("editor_alt_text_button_label"));if(t.textContent=e,t.setAttribute("aria-label",e),t.tabIndex="0",t.addEventListener("contextmenu",r.noContextMenu),t.addEventListener("pointerdown",e=>e.stopPropagation()),t.addEventListener("click",e=>{e.preventDefault(),this._uiManager.editAltText(this)},{capture:!0}),t.addEventListener("keydown",e=>{e.target===t&&"Enter"===e.key&&(e.preventDefault(),this._uiManager.editAltText(this))}),this.#H(),this.div.append(t),!T.SMALL_EDITOR_SIZE){const e=40;T.SMALL_EDITOR_SIZE=Math.min(128,Math.round(1.4*t.getBoundingClientRect().width))}}}async#H(){const t=this.#x;if(t)if(this.#S||this.#E){T._l10nPromise.get("editor_alt_text_edit_button_label").then(e=>{t.setAttribute("aria-label",e)});let e=this.#w;if(!e){this.#w=e=document.createElement("span"),e.className="tooltip",e.setAttribute("role","tooltip");var i=e.id="alt-text-tooltip-"+this.id;t.setAttribute("aria-describedby",i);t.addEventListener("mouseenter",()=>{this.#C=setTimeout(()=>{this.#C=null,this.#w.classList.add("show"),this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",subtype:this.editorType,data:{action:"alt_text_tooltip"}}})},100)}),t.addEventListener("mouseleave",()=>{clearTimeout(this.#C),this.#C=null,this.#w?.classList.remove("show")})}t.classList.add("done"),e.innerText=this.#E?await T._l10nPromise.get("editor_alt_text_decorative_tooltip"):this.#S,e.parentNode||t.append(e)}else t.classList.remove("done"),this.#w?.remove()}getClientDimensions(){return this.div.getBoundingClientRect()}get altTextData(){return{altText:this.#S,decorative:this.#E}}set altTextData(e){var{altText:e,decorative:t}=e;this.#S===e&&this.#E===t||(this.#S=e,this.#E=t,this.#H())}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.setAttribute("tabIndex",0),this.setInForeground(),this.div.addEventListener("focusin",this.#k),this.div.addEventListener("focusout",this.#M);var[e,t]=this.parentDimensions,[e,t]=(this.parentRotation%180!=0&&(this.div.style.maxWidth=(100*t/e).toFixed(2)+"%",this.div.style.maxHeight=(100*e/t).toFixed(2)+"%"),this.getInitialTranslation());return this.translate(e,t),(0,n.bindEvents)(this,this.div,["pointerdown"]),this.div}pointerdown(e){var t=f.FeatureTest.platform["isMac"];0!==e.button||e.ctrlKey&&t?e.preventDefault():(this.#F=!0,this.#q(e))}#q(i){if(this._isDraggable){const n=this._uiManager.isSelected(this);this._uiManager.setUpDragSession();let e,t;n&&(e={passive:!0,capture:!0},t=e=>{var[e,t]=this.screenToPageTranslation(e.movementX,e.movementY);this._uiManager.dragSelectedEditors(e,t)},window.addEventListener("pointermove",t,e));const r=()=>{if(window.removeEventListener("pointerup",r),window.removeEventListener("blur",r),n&&window.removeEventListener("pointermove",t,e),this.#F=!1,!this._uiManager.endDragSession()){const n=f.FeatureTest.platform["isMac"];i.ctrlKey&&!n||i.shiftKey||i.metaKey&&n?this.parent.toggleSelected(this):this.parent.setSelected(this)}};window.addEventListener("pointerup",r),window.addEventListener("blur",r)}}moveInDOM(){this.parent?.moveEditorInDOM(this)}_setParentAndPosition(e,t,i){e.changeParent(this),this.x=t,this.y=i,this.fixAndSetPosition()}getRect(e,t){var i=this.parentScale,[n,r]=this.pageDimensions,[s,o]=this.pageTranslation,a=e/i,l=t/i,h=this.x*n,c=this.y*r,d=this.width*n,u=this.height*r;switch(this.rotation){case 0:return[h+a+s,r-c-l-u+o,h+a+d+s,r-c-l+o];case 90:return[h+l+s,r-c+a+o,h+l+u+s,r-c+a+d+o];case 180:return[h-a-d+s,r-c+l+o,h-a+s,r-c+l+u+o];case 270:return[h-l-u+s,r-c-a-d+o,h-l+s,r-c-a+o];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(e,t){var[i,n,r,s]=e,o=r-i,a=s-n;switch(this.rotation){case 0:return[i,t-s,o,a];case 90:return[i,t-n,a,o];case 180:return[r,t-n,o,a];case 270:return[r,t-s,a,o];default:throw new Error("Invalid rotation")}}onceAdded(){}isEmpty(){return!1}enableEditMode(){this.#D=!0}disableEditMode(){this.#D=!1}isInEditMode(){return this.#D}shouldGetKeyboardEvents(){return!1}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}rebuild(){this.div?.addEventListener("focusin",this.#k),this.div?.addEventListener("focusout",this.#M)}serialize(){(0,f.unreachable)("An editor must be serializable")}static deserialize(e,t,i){var t=new this.prototype.constructor({parent:t,id:t.getNextId(),uiManager:i}),[i,n]=(t.rotation=e.rotation,t.pageDimensions),[e,r,s,o]=t.getRectInCurrentCoords(e.rect,n);return t.x=e/i,t.y=r/n,t.width=s/i,t.height=o/n,t}remove(){this.div.removeEventListener("focusin",this.#k),this.div.removeEventListener("focusout",this.#M),this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),this.#x?.remove(),this.#x=null,this.#w=null}get isResizable(){return!1}makeResizable(){this.isResizable&&(this.#U(),this.#P.classList.remove("hidden"))}select(){this.makeResizable(),this.div?.classList.add("selectedEditor")}unselect(){this.#P?.classList.add("hidden"),this.div?.classList.remove("selectedEditor"),this.div?.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus()}updateParams(e,t){}disableEditing(){this.#x&&(this.#x.hidden=!0)}enableEditing(){this.#x&&(this.#x.hidden=!1)}enterInEditMode(){}get contentDiv(){return this.div}get isEditing(){return this.#R}set isEditing(e){this.#R=e,this.parent&&(e?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}setAspectRatio(e,t){this.#T=!0;var i=this.div["style"];i.aspectRatio=e/t,i.height="auto"}static get MIN_SIZE(){return 16}}class s extends(t.AnnotationEditor=T){constructor(e){super(e),this.annotationElementId=e.annotationElementId,this.deleted=!0}serialize(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex}}}},(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.KeyboardManager=t.CommandManager=t.ColorManager=t.AnnotationEditorUIManager=void 0,t.bindEvents=function(e,t,i){for(const n of i)t.addEventListener(n,e[n].bind(e))},t.opacityToHex=function(e){return Math.round(Math.min(255,Math.max(1,255*e))).toString(16).padStart(2,"0")},i(93),i(101),i(102),i(105),i(107),i(109),i(113),i(116),i(123),i(2),i(89),i(125),i(136),i(138),i(141),i(143),i(145),i(147),i(166);var s=i(1),o=i(168);class n{#G=0;getId(){return""+s.AnnotationEditorPrefix+this.#G++}}class a{#V=(0,s.getUuid)();#G=0;#$=null;static get _isSVGFittingCanvas(){const e=new OffscreenCanvas(1,3).getContext("2d"),t=new Image;t.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>';var i=t.decode().then(()=>(e.drawImage(t,0,0,1,1,0,0,1,3),0===new Uint32Array(e.getImageData(0,0,1,1).data.buffer)[0]));return(0,s.shadow)(this,"_isSVGFittingCanvas",i)}async#X(e,i){this.#$||=new Map;let n=this.#$.get(e);if(null===n)return null;if(n?.bitmap)n.refCounter+=1;else{try{n||={bitmap:null,id:`image_${this.#V}_`+this.#G++,refCounter:0,isSvg:!1};let e;if("string"==typeof i){n.url=i;var t=await fetch(i);if(!t.ok)throw new Error(t.statusText);e=await t.blob()}else e=n.file=i;if("image/svg+xml"===e.type){const i=a._isSVGFittingCanvas,r=new FileReader,s=new Image,o=new Promise((e,t)=>{s.onload=()=>{n.bitmap=s,n.isSvg=!0,e()},r.onload=async()=>{var e=n.svgUrl=r.result;s.src=await i?e+"#svgView(preserveAspectRatio(none))":e},s.onerror=r.onerror=t});r.readAsDataURL(e),await o}else n.bitmap=await createImageBitmap(e);n.refCounter=1}catch(e){console.error(e),n=null}this.#$.set(e,n),n&&this.#$.set(n.id,n)}return n}async getFromFile(e){var{lastModified:t,name:i,size:n,type:r}=e;return this.#X(t+`_${i}_${n}_`+r,e)}async getFromUrl(e){return this.#X(e,e)}async getFromId(e){this.#$||=new Map;e=this.#$.get(e);return e?e.bitmap?(e.refCounter+=1,e):e.file?this.getFromFile(e.file):this.getFromUrl(e.url):null}getSvgUrl(e){e=this.#$.get(e);return e?.isSvg?e.svgUrl:null}deleteId(e){this.#$||=new Map;e=this.#$.get(e);e&&(--e.refCounter,0===e.refCounter)&&(e.bitmap=null)}isValidId(e){return e.startsWith(`image_${this.#V}_`)}}class r{#K=[];#Y=!1;#J;#Q=-1;constructor(){this.#J=0<arguments.length&&void 0!==arguments[0]?arguments[0]:128}add(e){var{cmd:e,undo:t,mustExec:i,type:n=NaN,overwriteIfSameType:r=!1,keepUndo:s=!1}=e;i&&e(),this.#Y||(i={cmd:e,undo:t,type:n},-1===this.#Q?(0<this.#K.length&&(this.#K.length=0),this.#Q=0,this.#K.push(i)):r&&this.#K[this.#Q].type===n?(s&&(i.undo=this.#K[this.#Q].undo),this.#K[this.#Q]=i):((e=this.#Q+1)===this.#J?this.#K.splice(0,1):(this.#Q=e)<this.#K.length&&this.#K.splice(e),this.#K.push(i)))}undo(){-1!==this.#Q&&(this.#Y=!0,this.#K[this.#Q].undo(),this.#Y=!1,--this.#Q)}redo(){this.#Q<this.#K.length-1&&(this.#Q+=1,this.#Y=!0,this.#K[this.#Q].cmd(),this.#Y=!1)}hasSomethingToUndo(){return-1!==this.#Q}hasSomethingToRedo(){return this.#Q<this.#K.length-1}destroy(){this.#K=null}}t.CommandManager=r;class l{constructor(e){this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;var t=s.FeatureTest.platform["isMac"];for(const[n,s,r={}]of e)for(const e of n){var i=e.startsWith("mac+");t&&i?(this.callbacks.set(e.slice(4),{callback:s,options:r}),this.allKeys.add(e.split("+").at(-1))):t||i||(this.callbacks.set(e,{callback:s,options:r}),this.allKeys.add(e.split("+").at(-1)))}}#Z(e){e.altKey&&this.buffer.push("alt"),e.ctrlKey&&this.buffer.push("ctrl"),e.metaKey&&this.buffer.push("meta"),e.shiftKey&&this.buffer.push("shift"),this.buffer.push(e.key);e=this.buffer.join("+");return this.buffer.length=0,e}exec(e,t){var i,n,r,s;this.allKeys.has(t.key)&&(i=this.callbacks.get(this.#Z(t)))&&({callback:i,options:{bubbles:n=!1,args:r=[],checker:s=null}}=i,s&&!s(e,t)||(i.bind(e,...r)(),n)||(t.stopPropagation(),t.preventDefault()))}}t.KeyboardManager=l;class h{static _colorsMapping=new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]);get _colors(){var e=new Map([["CanvasText",null],["Canvas",null]]);return(0,o.getColorValues)(e),(0,s.shadow)(this,"_colors",e)}convert(e){const i=(0,o.getRGB)(e);if(window.matchMedia("(forced-colors: active)").matches)for(const[e,t]of this._colors)if(t.every((e,t)=>e===i[t]))return h._colorsMapping.get(e);return i}getHexCode(e){var t=this._colors.get(e);return t?s.Util.makeHexColor(...t):e}}t.ColorManager=h;class c{#tt=null;#et=new Map;#nt=new Map;#it=null;#rt=null;#st=new r;#at=0;#ot=new Set;#lt=null;#ct=null;#ht=new Set;#dt=null;#ut=new n;#pt=!1;#ft=!1;#gt=null;#mt=s.AnnotationEditorType.NONE;#bt=new Set;#vt=null;#yt=this.blur.bind(this);#_t=this.focus.bind(this);#At=this.copy.bind(this);#St=this.cut.bind(this);#Et=this.paste.bind(this);#xt=this.keydown.bind(this);#wt=this.onEditingAction.bind(this);#Ct=this.onPageChanging.bind(this);#Tt=this.onScaleChanging.bind(this);#Pt=this.onRotationChanging.bind(this);#kt={isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1};#Mt=[0,0];#Ft=null;#Rt=null;#Dt=null;static TRANSLATE_SMALL=1;static TRANSLATE_BIG=10;static get _keyboardManager(){var e=c.prototype,t=e=>{var t=document["activeElement"];return t&&e.#Rt.contains(t)&&e.hasSomethingToControl()},i=this.TRANSLATE_SMALL,n=this.TRANSLATE_BIG;return(0,s.shadow)(this,"_keyboardManager",new l([[["ctrl+a","mac+meta+a"],e.selectAll],[["ctrl+z","mac+meta+z"],e.undo],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],e.redo],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete","mac+Delete"],e.delete],[["Escape","mac+Escape"],e.unselectAll],[["ArrowLeft","mac+ArrowLeft"],e.translateSelectedEditors,{args:[-i,0],checker:t}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],e.translateSelectedEditors,{args:[-n,0],checker:t}],[["ArrowRight","mac+ArrowRight"],e.translateSelectedEditors,{args:[i,0],checker:t}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],e.translateSelectedEditors,{args:[n,0],checker:t}],[["ArrowUp","mac+ArrowUp"],e.translateSelectedEditors,{args:[0,-i],checker:t}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],e.translateSelectedEditors,{args:[0,-n],checker:t}],[["ArrowDown","mac+ArrowDown"],e.translateSelectedEditors,{args:[0,i],checker:t}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],e.translateSelectedEditors,{args:[0,n],checker:t}]]))}constructor(e,t,i,n,r,s){this.#Rt=e,this.#Dt=t,this.#it=i,this._eventBus=n,this._eventBus._on("editingaction",this.#wt),this._eventBus._on("pagechanging",this.#Ct),this._eventBus._on("scalechanging",this.#Tt),this._eventBus._on("rotationchanging",this.#Pt),this.#rt=r.annotationStorage,this.#dt=r.filterFactory,this.#vt=s,this.viewParameters={realScale:o.PixelsPerInch.PDF_TO_CSS_UNITS,rotation:0}}destroy(){this.#It(),this.#Ot(),this._eventBus._off("editingaction",this.#wt),this._eventBus._off("pagechanging",this.#Ct),this._eventBus._off("scalechanging",this.#Tt),this._eventBus._off("rotationchanging",this.#Pt);for(const e of this.#nt.values())e.destroy();this.#nt.clear(),this.#et.clear(),this.#ht.clear(),this.#tt=null,this.#bt.clear(),this.#st.destroy(),this.#it.destroy()}get hcmFilter(){return(0,s.shadow)(this,"hcmFilter",this.#vt?this.#dt.addHCMFilter(this.#vt.foreground,this.#vt.background):"none")}get direction(){return(0,s.shadow)(this,"direction",getComputedStyle(this.#Rt).direction)}editAltText(e){this.#it?.editAltText(this,e)}onPageChanging(e){e=e.pageNumber;this.#at=e-1}focusMainContainer(){this.#Rt.focus()}findParent(e,t){for(const o of this.#nt.values()){var{x:i,y:n,width:r,height:s}=o.div.getBoundingClientRect();if(i<=e&&e<=i+r&&n<=t&&t<=n+s)return o}return null}disableUserSelect(){this.#Dt.classList.toggle("noUserSelect",0<arguments.length&&void 0!==arguments[0]&&arguments[0])}addShouldRescale(e){this.#ht.add(e)}removeShouldRescale(e){this.#ht.delete(e)}onScaleChanging(e){e=e.scale;this.commitOrRemove(),this.viewParameters.realScale=e*o.PixelsPerInch.PDF_TO_CSS_UNITS;for(const e of this.#ht)e.onScaleChanging()}onRotationChanging(e){e=e.pagesRotation;this.commitOrRemove(),this.viewParameters.rotation=e}addToAnnotationStorage(e){e.isEmpty()||!this.#rt||this.#rt.has(e.id)||this.#rt.setValue(e.id,e)}#Lt(){window.addEventListener("focus",this.#_t),window.addEventListener("blur",this.#yt)}#Ot(){window.removeEventListener("focus",this.#_t),window.removeEventListener("blur",this.#yt)}blur(){if(this.hasSelection){var e=document["activeElement"];for(const t of this.#bt)if(t.div.contains(e)){this.#gt=[t,e],t._focusEventsAllowed=!1;break}}}focus(){if(this.#gt){const[e,t]=this.#gt;this.#gt=null,t.addEventListener("focusin",()=>{e._focusEventsAllowed=!0},{once:!0}),t.focus()}}#Nt(){window.addEventListener("keydown",this.#xt,{capture:!0})}#It(){window.removeEventListener("keydown",this.#xt,{capture:!0})}#Bt(){document.addEventListener("copy",this.#At),document.addEventListener("cut",this.#St),document.addEventListener("paste",this.#Et)}#jt(){document.removeEventListener("copy",this.#At),document.removeEventListener("cut",this.#St),document.removeEventListener("paste",this.#Et)}addEditListeners(){this.#Nt(),this.#Bt()}removeEditListeners(){this.#It(),this.#jt()}copy(e){if(e.preventDefault(),this.#tt?.commitOrRemove(),this.hasSelection){var t=[];for(const e of this.#bt){var i=e.serialize(!0);i&&t.push(i)}0!==t.length&&e.clipboardData.setData("application/pdfjs",JSON.stringify(t))}}cut(e){this.copy(e),this.delete()}paste(t){t.preventDefault();const e=t["clipboardData"];for(const t of e.items)for(const e of this.#ct)if(e.isHandlingMimeForPasting(t.type))return void e.paste(t,this.currentLayer);let i=e.getData("application/pdfjs");if(i){try{i=JSON.parse(i)}catch(t){return void(0,s.warn)(`paste: "${t.message}".`)}if(Array.isArray(i)){this.unselectAll();var n=this.currentLayer;try{const t=[];for(const e of i){const i=n.deserialize(e);if(!i)return;t.push(i)}this.addCommands({cmd:()=>{for(const e of t)this.#Ut(e);this.#zt(t)},undo:()=>{for(const e of t)e.remove()},mustExec:!0})}catch(t){(0,s.warn)(`paste: "${t.message}".`)}}}}keydown(e){this.getActive()?.shouldGetKeyboardEvents()||c._keyboardManager.exec(this,e)}onEditingAction(e){["undo","redo","delete","selectAll"].includes(e.name)&&this[e.name]()}#Wt(e){Object.entries(e).some(e=>{var[e,t]=e;return this.#kt[e]!==t})&&this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(this.#kt,e)})}#Ht(e){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:e})}setEditingState(e){e?(this.#Lt(),this.#Nt(),this.#Bt(),this.#Wt({isEditing:this.#mt!==s.AnnotationEditorType.NONE,isEmpty:this.#qt(),hasSomethingToUndo:this.#st.hasSomethingToUndo(),hasSomethingToRedo:this.#st.hasSomethingToRedo(),hasSelectedEditor:!1})):(this.#Ot(),this.#It(),this.#jt(),this.#Wt({isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(e){if(!this.#ct){this.#ct=e;for(const e of this.#ct)this.#Ht(e.defaultPropertiesToUpdate)}}getId(){return this.#ut.getId()}get currentLayer(){return this.#nt.get(this.#at)}getLayer(e){return this.#nt.get(e)}get currentPageIndex(){return this.#at}addLayer(e){this.#nt.set(e.pageIndex,e),this.#pt?e.enable():e.disable()}removeLayer(e){this.#nt.delete(e.pageIndex)}updateMode(e){let t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null;if(this.#mt!==e)if((this.#mt=e)!==s.AnnotationEditorType.NONE){this.setEditingState(!0),this.#Gt(),this.unselectAll();for(const t of this.#nt.values())t.updateMode(e);if(t)for(const e of this.#et.values())if(e.annotationElementId===t){this.setSelected(e),e.enterInEditMode();break}}else this.setEditingState(!1),this.#Vt()}updateToolbar(e){e!==this.#mt&&this._eventBus.dispatch("switchannotationeditormode",{source:this,mode:e})}updateParams(e,t){if(this.#ct)if(e!==s.AnnotationEditorParamsType.CREATE){for(const i of this.#bt)i.updateParams(e,t);for(const n of this.#ct)n.updateDefaultParams(e,t)}else this.currentLayer.addNewEditor(e)}enableWaiting(){var e=0<arguments.length&&void 0!==arguments[0]&&arguments[0];if(this.#ft!==e){this.#ft=e;for(const t of this.#nt.values())e?t.disableClick():t.enableClick(),t.div.classList.toggle("waiting",e)}}#Gt(){if(!this.#pt){this.#pt=!0;for(const e of this.#nt.values())e.enable()}}#Vt(){if(this.unselectAll(),this.#pt){this.#pt=!1;for(const e of this.#nt.values())e.disable()}}getEditors(e){var t=[];for(const i of this.#et.values())i.pageIndex===e&&t.push(i);return t}getEditor(e){return this.#et.get(e)}addEditor(e){this.#et.set(e.id,e)}removeEditor(e){this.#et.delete(e.id),this.unselect(e),e.annotationElementId&&this.#ot.has(e.annotationElementId)||this.#rt?.remove(e.id)}addDeletedAnnotationElement(e){this.#ot.add(e.annotationElementId),e.deleted=!0}isDeletedAnnotationElement(e){return this.#ot.has(e)}removeDeletedAnnotationElement(e){this.#ot.delete(e.annotationElementId),e.deleted=!1}#Ut(e){var t=this.#nt.get(e.pageIndex);t?t.addOrRebuild(e):this.addEditor(e)}setActiveEditor(e){this.#tt!==e&&(this.#tt=e)&&this.#Ht(e.propertiesToUpdate)}toggleSelected(e){this.#bt.has(e)?(this.#bt.delete(e),e.unselect(),this.#Wt({hasSelectedEditor:this.hasSelection})):(this.#bt.add(e),e.select(),this.#Ht(e.propertiesToUpdate),this.#Wt({hasSelectedEditor:!0}))}setSelected(e){for(const t of this.#bt)t!==e&&t.unselect();this.#bt.clear(),this.#bt.add(e),e.select(),this.#Ht(e.propertiesToUpdate),this.#Wt({hasSelectedEditor:!0})}isSelected(e){return this.#bt.has(e)}unselect(e){e.unselect(),this.#bt.delete(e),this.#Wt({hasSelectedEditor:this.hasSelection})}get hasSelection(){return 0!==this.#bt.size}undo(){this.#st.undo(),this.#Wt({hasSomethingToUndo:this.#st.hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:this.#qt()})}redo(){this.#st.redo(),this.#Wt({hasSomethingToUndo:!0,hasSomethingToRedo:this.#st.hasSomethingToRedo(),isEmpty:this.#qt()})}addCommands(e){this.#st.add(e),this.#Wt({hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:this.#qt()})}#qt(){if(0===this.#et.size)return!0;if(1===this.#et.size)for(const e of this.#et.values())return e.isEmpty();return!1}delete(){if(this.commitOrRemove(),this.hasSelection){const t=[...this.#bt];this.addCommands({cmd:()=>{for(const e of t)e.remove()},undo:()=>{for(const e of t)this.#Ut(e)},mustExec:!0})}}commitOrRemove(){this.#tt?.commitOrRemove()}hasSomethingToControl(){return this.#tt||this.hasSelection}#zt(e){this.#bt.clear();for(const t of e)t.isEmpty()||(this.#bt.add(t),t.select());this.#Wt({hasSelectedEditor:!0})}selectAll(){for(const e of this.#bt)e.commit();this.#zt(this.#et.values())}unselectAll(){if(this.#tt)this.#tt.commitOrRemove();else if(this.hasSelection){for(const e of this.#bt)e.unselect();this.#bt.clear(),this.#Wt({hasSelectedEditor:!1})}}translateSelectedEditors(e,t){if(2<arguments.length&&void 0!==arguments[2]&&arguments[2]||this.commitOrRemove(),this.hasSelection){this.#Mt[0]+=e,this.#Mt[1]+=t;const[i,n]=this.#Mt,r=[...this.#bt];this.#Ft&&clearTimeout(this.#Ft),this.#Ft=setTimeout(()=>{this.#Ft=null,this.#Mt[0]=this.#Mt[1]=0,this.addCommands({cmd:()=>{for(const e of r)this.#et.has(e.id)&&e.translateInPage(i,n)},undo:()=>{for(const e of r)this.#et.has(e.id)&&e.translateInPage(-i,-n)},mustExec:!1})},1e3);for(const i of r)i.translateInPage(e,t)}}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),this.#lt=new Map;for(const e of this.#bt)this.#lt.set(e,{savedX:e.x,savedY:e.y,savedPageIndex:e.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!this.#lt)return!1;this.disableUserSelect(!1);const r=this.#lt;this.#lt=null;let e=!1;for(var[{x:t,y:i,pageIndex:n},s]of r)s.newX=t,s.newY=i,s.newPageIndex=n,e||=t!==s.savedX||i!==s.savedY||n!==s.savedPageIndex;if(!e)return!1;const o=(e,t,i,n)=>{var r;this.#et.has(e.id)&&((r=this.#nt.get(n))?e._setParentAndPosition(r,t,i):(e.pageIndex=n,e.x=t,e.y=i))};return this.addCommands({cmd:()=>{for(var[e,{newX:t,newY:i,newPageIndex:n}]of r)o(e,t,i,n)},undo:()=>{for(var[e,{savedX:t,savedY:i,savedPageIndex:n}]of r)o(e,t,i,n)},mustExec:!0}),!0}dragSelectedEditors(e,t){if(this.#lt)for(const i of this.#lt.keys())i.drag(e,t)}rebuild(e){var t;null===e.parent?(t=this.getLayer(e.pageIndex))?(t.changeParent(e),t.addOrRebuild(e)):(this.addEditor(e),this.addToAnnotationStorage(e),e.rebuild()):e.parent.addOrRebuild(e)}isActive(e){return this.#tt===e}getActive(){return this.#tt}getMode(){return this.#mt}get imageManager(){return(0,s.shadow)(this,"imageManager",new a)}}t.AnnotationEditorUIManager=c},(e,D,t)=>{function m(e,t,i,n){var r,s,o,a,l,h=e[t],c=n&&h===n.value,d=c&&"string"==typeof n.source?{source:n.source}:{};if(v(h)){var u=y(h),p=c?n.nodes:u?[]:{};if(u)for(r=p.length,o=w(h),a=0;a<o;a++)g(h,a,m(h,""+a,i,a<r?p[a]:void 0));else for(s=_(h),o=w(s),a=0;a<o;a++)l=s[a],g(h,l,m(h,l,i,b(p,l)?p[l]:void 0))}return f(i,e,t,h,d)}function g(e,t,i){if(r){var n=C(e,t);if(n&&!n.configurable)return}void 0===i?delete e[t]:d(e,t,i)}function s(e,t,i,n){this.value=e,this.end=t,this.source=i,this.nodes=n}function o(e,t){this.source=e,this.index=t}var i=t(3),r=t(6),n=t(4),a=t(24),l=t(14),f=t(8),h=t(21),v=t(20),y=t(91),b=t(39),c=t(77),w=t(64),d=t(159),u=t(7),p=t(167),t=t(27),x=n.JSON,S=n.Number,A=n.SyntaxError,k=x&&x.parse,_=a("Object","keys"),C=Object.getOwnPropertyDescriptor,T=l("".charAt),E=l("".slice),M=l(/./.exec),R=l([].push),$=/^\d$/,L=/^[1-9]$/,I=/^(?:-|\d)$/,F=/^[\t\n\r ]$/,n=(o.prototype={fork:function(e){return new o(this.source,e)},parse:function(){var e=this.source,t=this.skip(F,this.index),i=this.fork(t),e=T(e,t);if(M(I,e))return i.number();switch(e){case"{":return i.object();case"[":return i.array();case'"':return i.string();case"t":return i.keyword(!0);case"f":return i.keyword(!1);case"n":return i.keyword(null)}throw A('Unexpected character: "'+e+'" at: '+t)},node:function(e,t,i,n,r){return new s(t,n,e?null:E(this.source,i,n),r)},object:function(){for(var e=this.source,t=this.index+1,i=!1,n={},r={};t<e.length;){if(t=this.until(['"',"}"],t),"}"===T(e,t)&&!i){t++;break}var s=this.fork(t).string(),o=s.value,t=s.end,o=(t=this.until([":"],t)+1,t=this.skip(F,t),s=this.fork(t).parse(),d(r,o,s),d(n,o,s.value),t=this.until([",","}"],s.end),T(e,t));if(","===o)i=!0,t++;else if("}"===o){t++;break}}return this.node(1,n,this.index,t,r)},array:function(){for(var e=this.source,t=this.index+1,i=!1,n=[],r=[];t<e.length;){if(t=this.skip(F,t),"]"===T(e,t)&&!i){t++;break}var s=this.fork(t).parse();if(R(r,s),R(n,s.value),t=this.until([",","]"],s.end),","===T(e,t))i=!0,t++;else if("]"===T(e,t)){t++;break}}return this.node(1,n,this.index,t,r)},string:function(){var e=this.index,t=p(this.source,this.index+1);return this.node(0,t.value,e,t.end)},number:function(){var e=this.source,t=this.index,i=t;if("-"===T(e,i)&&i++,"0"===T(e,i))i++;else{if(!M(L,T(e,i)))throw A("Failed to parse number at: "+i);i=this.skip($,++i)}if("."===T(e,i)&&(i=this.skip($,++i)),"e"!==T(e,i)&&"E"!==T(e,i)||("+"!==T(e,++i)&&"-"!==T(e,i)||i++,i!==(i=this.skip($,i))))return this.node(0,S(E(e,t,i)),t,i);throw A("Failed to parse number's exponent value at: "+i)},keyword:function(e){var t=""+e,i=this.index,n=i+t.length;if(E(this.source,i,n)!==t)throw A("Failed to parse value at: "+i);return this.node(0,e,i,n)},skip:function(e,t){for(var i=this.source;t<i.length&&M(e,T(i,t));t++);return t},until:function(e,t){t=this.skip(F,t);for(var i=T(this.source,t),n=0;n<e.length;n++)if(e[n]===i)return t;throw A('Unexpected character: "'+i+'" at: '+t)}},u(function(){var n,e="9007199254740993";return k(e,function(e,t,i){n=i.source}),n!==e})),P=t&&!u(function(){return 1/k("-0 \t")!=-1/0});i({target:"JSON",stat:!0,forced:n},{parse:function(e,t){if(P&&!h(t))return k(e);var i=0,e=(i=c(e),new o(i,0)),n=e.parse(),r=n.value;if((e=e.skip(F,n.end))<i.length)throw A('Unexpected extra character: "'+T(i,e)+'" after the parsed data at: '+e);return h(t)?m({"":r},"",t,n):r}})},(e,t,i)=>{var n=i(14),o=i(39),a=SyntaxError,l=parseInt,h=String.fromCharCode,c=n("".charAt),d=n("".slice),u=n(/./.exec),p={'\\"':'"',"\\\\":"\\","\\/":"/","\\b":"\b","\\f":"\f","\\n":"\n","\\r":"\r","\\t":"\t"},m=/^[\da-f]{4}$/i,g=/^[\u0000-\u001F]$/;e.exports=function(e,t){for(var i=!0,n="";t<e.length;){var r=c(e,t);if("\\"===r){var s=d(e,t,t+2);if(o(p,s))n+=p[s],t+=2;else{if("\\u"!==s)throw a('Unknown escape sequence: "'+s+'"');s=d(e,t+=2,t+4);if(!u(m,s))throw a("Bad Unicode escape at: "+t);n+=h(l(s,16)),t+=4}}else{if('"'===r){i=!1,t++;break}if(u(g,r))throw a("Bad control character in string literal at: "+t);n+=r,t++}}if(i)throw a("Unterminated string at: "+t);return{value:n,end:t}}},(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.StatTimer=t.RenderingCancelledException=t.PixelsPerInch=t.PageViewport=t.PDFDateString=t.DOMStandardFontDataFactory=t.DOMSVGFactory=t.DOMFilterFactory=t.DOMCanvasFactory=t.DOMCMapReaderFactory=void 0,t.deprecated=function(e){console.log("Deprecated API usage: "+e)},t.getColorValues=function(e){var t=document.createElement("span");t.style.visibility="hidden",document.body.append(t);for(const n of e.keys()){t.style.color=n;var i=window.getComputedStyle(t).color;e.set(n,y(i))}t.remove()},t.getCurrentTransform=function(e){var{a:e,b:t,c:i,d:n,e:r,f:s}=e.getTransform();return[e,t,i,n,r,s]},t.getCurrentTransformInverse=function(e){var{a:e,b:t,c:i,d:n,e:r,f:s}=e.getTransform().invertSelf();return[e,t,i,n,r,s]},t.getFilenameFromUrl=function(e){return 1<arguments.length&&void 0!==arguments[1]&&arguments[1]||([e]=e.split(/[#?]/,1)),e.substring(e.lastIndexOf("/")+1)},t.getPdfFilenameFromUrl=function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"document.pdf";if("string"!=typeof e)return t;if(g(e))return(0,d.warn)('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),t;var i=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i,e=/^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/.exec(e);let n=i.exec(e[1])||i.exec(e[2])||i.exec(e[3]);if(n&&(n=n[0]).includes("%"))try{n=i.exec(decodeURIComponent(n))[0]}catch{}return n||t},t.getRGB=y,t.getXfaPageViewport=function(e,t){var{scale:t=1,rotation:i=0}=t,{width:e,height:n}=e.attributes.style,e=[0,0,parseInt(e),parseInt(n)];return new p({viewBox:e,scale:t,rotation:i})},t.isDataScheme=g,t.isPdfFile=function(e){return"string"==typeof e&&/\.pdf$/i.test(e)},t.isValidFetchUrl=f,t.loadScript=function(n){let r=1<arguments.length&&void 0!==arguments[1]&&arguments[1];return new Promise((t,e)=>{const i=document.createElement("script");i.src=n,i.onload=function(e){r&&i.remove(),t(e)},i.onerror=function(){e(new Error("Cannot load script at: "+i.src))},(document.head||document.documentElement).append(i)})},t.noContextMenu=function(e){e.preventDefault()},t.setLayerDimensions=function(e,t){let i=2<arguments.length&&void 0!==arguments[2]&&arguments[2],n=!(3<arguments.length&&void 0!==arguments[3])||arguments[3];if(t instanceof p){const{pageWidth:n,pageHeight:r}=t.rawDims,s=e["style"],o=d.FeatureTest.isCSSRoundSupported,a=`var(--scale-factor) * ${n}px`,l=`var(--scale-factor) * ${r}px`,h=o?`round(${a}, 1px)`:`calc(${a})`,c=o?`round(${l}, 1px)`:`calc(${l})`;i&&t.rotation%180!=0?(s.width=c,s.height=h):(s.width=h,s.height=c)}n&&e.setAttribute("data-main-rotation",t.rotation)},i(2),i(93),i(101),i(102),i(105),i(107),i(109),i(113),i(116),i(123),i(89),i(84),i(86),i(87);var n=i(169),d=i(1);const s="http://www.w3.org/2000/svg";class r{static CSS=96;static PDF=72;static PDF_TO_CSS_UNITS=this.CSS/this.PDF}t.PixelsPerInch=r;class o extends n.BaseFilterFactory{#$t;#Xt;#e;#Kt;#Yt;#Jt;#Qt;#Zt;#te;#ee;#G=0;constructor(){var{docId:e,ownerDocument:t=globalThis.document}=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};super(),this.#e=e,this.#Kt=t}get#$(){return this.#$t||=new Map}get#ne(){var e,t;return this.#Xt||(t=(e=this.#Kt.createElement("div"))["style"],t.visibility="hidden",t.contain="strict",t.width=t.height=0,t.position="absolute",t.top=t.left=0,t.zIndex=-1,(t=this.#Kt.createElementNS(s,"svg")).setAttribute("width",0),t.setAttribute("height",0),this.#Xt=this.#Kt.createElementNS(s,"defs"),e.append(t),t.append(this.#Xt),this.#Kt.body.append(e)),this.#Xt}addFilter(e){if(!e)return"none";let t,i,n,r,s=this.#$.get(e);if(s)return s;if(1===e.length){const s=e[0],o=new Array(256);for(let e=0;e<256;e++)o[e]=s[e]/255;r=t=i=n=o.join(",")}else{const[s,o,a]=e,l=new Array(256),h=new Array(256),c=new Array(256);for(let e=0;e<256;e++)l[e]=s[e]/255,h[e]=o[e]/255,c[e]=a[e]/255;t=l.join(","),i=h.join(","),n=c.join(","),r=""+t+i+n}if(s=this.#$.get(r))return this.#$.set(e,s),s;const o=`g_${this.#e}_transfer_map_`+this.#G++,a=`url(#${o})`,l=(this.#$.set(e,a),this.#$.set(r,a),this.#ie(o));return this.#re(t,i,n,l),a}addHCMFilter(e,t){var i=e+"-"+t;if(this.#Jt!==i&&(this.#Jt=i,this.#Qt="none",this.#Yt?.remove(),e)&&t){const s=this.#se(e),o=(e=d.Util.makeHexColor(...s),this.#se(t));if(t=d.Util.makeHexColor(...o),this.#ne.style.color="",("#000000"!==e||"#ffffff"!==t)&&e!==t){var n=new Array(256);for(let e=0;e<=255;e++){const t=e/255;n[e]=t<=.03928?t/12.92:((.055+t)/1.055)**2.4}i=n.join(","),e=`g_${this.#e}_hcm_filter`,t=this.#Zt=this.#ie(e),i=(this.#re(i,i,i,t),this.#ae(t),(e,t)=>{var i=s[e]/255,n=o[e]/255,r=new Array(t+1);for(let e=0;e<=t;e++)r[e]=i+e/t*(n-i);return r.join(",")});this.#re(i(0,5),i(1,5),i(2,5),t),this.#Qt=`url(#${e})`}}return this.#Qt}addHighlightHCMFilter(i,n,r,s){var o=i+`-${n}-${r}-`+s;if(this.#te!==o&&(this.#te=o,this.#ee="none",this.#Zt?.remove(),i)&&n){var[o,i]=[i,n].map(this.#se.bind(this));let l=Math.round(.2126*o[0]+.7152*o[1]+.0722*o[2]),h=Math.round(.2126*i[0]+.7152*i[1]+.0722*i[2]),[e,t]=[r,s].map(this.#se.bind(this));h<l&&([l,h,e,t]=[h,l,t,e]),this.#ne.style.color="";n=(e,t,i)=>{var n=new Array(256),r=(h-l)/i,s=e/255,o=(t-e)/(255*i);let a=0;for(let e=0;e<=i;e++){const t=Math.round(l+e*r),i=s+e*o;for(let e=a;e<=t;e++)n[e]=i;a=t+1}for(let e=a;e<256;e++)n[e]=n[a-1];return n.join(",")},o=`g_${this.#e}_hcm_highlight_filter`,i=this.#Zt=this.#ie(o);this.#ae(i),this.#re(n(e[0],t[0],5),n(e[1],t[1],5),n(e[2],t[2],5),i),this.#ee=`url(#${o})`}return this.#ee}destroy(){0<arguments.length&&void 0!==arguments[0]&&arguments[0]&&(this.#Qt||this.#ee)||(this.#Xt&&(this.#Xt.parentNode.parentNode.remove(),this.#Xt=null),this.#$t&&(this.#$t.clear(),this.#$t=null),this.#G=0)}#ae(e){var t=this.#Kt.createElementNS(s,"feColorMatrix");t.setAttribute("type","matrix"),t.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"),e.append(t)}#ie(e){var t=this.#Kt.createElementNS(s,"filter");return t.setAttribute("color-interpolation-filters","sRGB"),t.setAttribute("id",e),this.#ne.append(t),t}#oe(e,t,i){t=this.#Kt.createElementNS(s,t);t.setAttribute("type","discrete"),t.setAttribute("tableValues",i),e.append(t)}#re(e,t,i,n){var r=this.#Kt.createElementNS(s,"feComponentTransfer");n.append(r),this.#oe(r,"feFuncR",e),this.#oe(r,"feFuncG",t),this.#oe(r,"feFuncB",i)}#se(e){return this.#ne.style.color=e,y(getComputedStyle(this.#ne).getPropertyValue("color"))}}t.DOMFilterFactory=o;class a extends n.BaseCanvasFactory{constructor(){var{ownerDocument:e=globalThis.document}=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};super(),this._document=e}_createCanvas(e,t){var i=this._document.createElement("canvas");return i.width=e,i.height=t,i}}async function l(n,e){let r=1<arguments.length&&void 0!==e&&e;if(f(n,document.baseURI)){e=await fetch(n);if(e.ok)return r?new Uint8Array(await e.arrayBuffer()):(0,d.stringToBytes)(await e.text());throw new Error(e.statusText)}return new Promise((t,e)=>{const i=new XMLHttpRequest;i.open("GET",n,!0),r&&(i.responseType="arraybuffer"),i.onreadystatechange=()=>{if(i.readyState===XMLHttpRequest.DONE){if(200===i.status||0===i.status){let e;if(r&&i.response?e=new Uint8Array(i.response):!r&&i.responseText&&(e=(0,d.stringToBytes)(i.responseText)),e)return void t(e)}e(new Error(i.statusText))}},i.send(null)})}t.DOMCanvasFactory=a;class h extends n.BaseCMapReaderFactory{_fetchData(e,t){return l(e,this.isCompressed).then(e=>({cMapData:e,compressionType:t}))}}t.DOMCMapReaderFactory=h;class c extends n.BaseStandardFontDataFactory{_fetchData(e){return l(e,!0)}}t.DOMStandardFontDataFactory=c;class u extends n.BaseSVGFactory{_createSVG(e){return document.createElementNS(s,e)}}t.DOMSVGFactory=u;class p{constructor(e){let{viewBox:t,scale:i,rotation:n,offsetX:r=0,offsetY:s=0,dontFlip:o=!1}=e;this.viewBox=t,this.scale=i,this.rotation=n,this.offsetX=r,this.offsetY=s;var e=(t[2]+t[0])/2,a=(t[3]+t[1])/2;let l,h,c,d,u,p,m,g;switch((n%=360)<0&&(n+=360),n){case 180:l=-1,h=0,c=0,d=1;break;case 90:l=0,h=1,c=1,d=0;break;case 270:l=0,h=-1,c=-1,d=0;break;case 0:l=1,h=0,c=0,d=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}o&&(c=-c,d=-d),g=0===l?(u=Math.abs(a-t[1])*i+r,p=Math.abs(e-t[0])*i+s,m=(t[3]-t[1])*i,(t[2]-t[0])*i):(u=Math.abs(e-t[0])*i+r,p=Math.abs(a-t[1])*i+s,m=(t[2]-t[0])*i,(t[3]-t[1])*i),this.transform=[l*i,h*i,c*i,d*i,u-l*i*e-c*i*a,p-h*i*e-d*i*a],this.width=m,this.height=g}get rawDims(){var e=this["viewBox"];return(0,d.shadow)(this,"rawDims",{pageWidth:e[2]-e[0],pageHeight:e[3]-e[1],pageX:e[0],pageY:e[1]})}clone(){var{scale:e=this.scale,rotation:t=this.rotation,offsetX:i=this.offsetX,offsetY:n=this.offsetY,dontFlip:r=!1}=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return new p({viewBox:this.viewBox.slice(),scale:e,rotation:t,offsetX:i,offsetY:n,dontFlip:r})}convertToViewportPoint(e,t){return d.Util.applyTransform([e,t],this.transform)}convertToViewportRectangle(e){var t=d.Util.applyTransform([e[0],e[1]],this.transform),e=d.Util.applyTransform([e[2],e[3]],this.transform);return[t[0],t[1],e[0],e[1]]}convertToPdfPoint(e,t){return d.Util.applyInverseTransform([e,t],this.transform)}}t.PageViewport=p;class m extends d.BaseException{constructor(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0;super(e,"RenderingCancelledException"),this.extraDelay=t}}function g(e){var t=e.length;let i=0;for(;i<t&&""===e[i].trim();)i++;return"data:"===e.substring(i,i+5).toLowerCase()}function f(e,t){try{var i=(t?new URL(e,t):new URL(e))["protocol"];return"http:"===i||"https:"===i}catch{return!1}}t.RenderingCancelledException=m,t.StatTimer=class{started=Object.create(null);times=[];time(e){e in this.started&&(0,d.warn)("Timer is already running for "+e),this.started[e]=Date.now()}timeEnd(e){e in this.started||(0,d.warn)("Timer has not been started for "+e),this.times.push({name:e,start:this.started[e],end:Date.now()}),delete this.started[e]}toString(){const e=[];let t=0;for(const{name:e}of this.times)t=Math.max(e.length,t);for(var{name:i,start:n,end:r}of this.times)e.push(`${i.padEnd(t)} ${r-n}ms\n`);return e.join("")}};let v;function y(e){var t;return e.startsWith("#")?[(16711680&(t=parseInt(e.slice(1),16)))>>16,(65280&t)>>8,255&t]:e.startsWith("rgb(")?e.slice(4,-1).split(",").map(e=>parseInt(e)):e.startsWith("rgba(")?e.slice(5,-1).split(",").map(e=>parseInt(e)).slice(0,3):((0,d.warn)(`Not a valid color format: "${e}"`),[0,0,0])}t.PDFDateString=class{static toDateObject(e){if(!e||"string"!=typeof e)return null;e=(v||=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?")).exec(e);if(!e)return null;var t=parseInt(e[1],10),i=1<=(i=parseInt(e[2],10))&&i<=12?i-1:0,n=1<=(n=parseInt(e[3],10))&&n<=31?n:1;let r=parseInt(e[4],10),s=(r=0<=r&&r<=23?r:0,parseInt(e[5],10));s=0<=s&&s<=59?s:0;var o=0<=(o=parseInt(e[6],10))&&o<=59?o:0,a=e[7]||"Z",l=0<=(l=parseInt(e[8],10))&&l<=23?l:0,e=0<=(e=parseInt(e[9],10)||0)&&e<=59?e:0;return"-"===a?(r+=l,s+=e):"+"===a&&(r-=l,s-=e),new Date(Date.UTC(t,i,n,r,s,o))}}},(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BaseStandardFontDataFactory=t.BaseSVGFactory=t.BaseFilterFactory=t.BaseCanvasFactory=t.BaseCMapReaderFactory=void 0,i(2);var n=i(1);t.BaseFilterFactory=class r{constructor(){this.constructor===r&&(0,n.unreachable)("Cannot initialize BaseFilterFactory.")}addFilter(e){return"none"}addHCMFilter(e,t){return"none"}addHighlightHCMFilter(e,t,i,n){return"none"}destroy(){}};t.BaseCanvasFactory=class s{constructor(){this.constructor===s&&(0,n.unreachable)("Cannot initialize BaseCanvasFactory.")}create(e,t){if(e<=0||t<=0)throw new Error("Invalid canvas size");return{canvas:e=this._createCanvas(e,t),context:e.getContext("2d")}}reset(e,t,i){if(!e.canvas)throw new Error("Canvas is not specified");if(t<=0||i<=0)throw new Error("Invalid canvas size");e.canvas.width=t,e.canvas.height=i}destroy(e){if(!e.canvas)throw new Error("Canvas is not specified");e.canvas.width=0,e.canvas.height=0,e.canvas=null,e.context=null}_createCanvas(e,t){(0,n.unreachable)("Abstract method `_createCanvas` called.")}};t.BaseCMapReaderFactory=class o{constructor(e){var{baseUrl:e=null,isCompressed:t=!0}=e;this.constructor===o&&(0,n.unreachable)("Cannot initialize BaseCMapReaderFactory."),this.baseUrl=e,this.isCompressed=t}async fetch(e){if(e=e.name,!this.baseUrl)throw new Error('The CMap "baseUrl" parameter must be specified, ensure that the "cMapUrl" and "cMapPacked" API parameters are provided.');if(!e)throw new Error("CMap name must be specified.");const t=this.baseUrl+e+(this.isCompressed?".bcmap":""),i=this.isCompressed?n.CMapCompressionType.BINARY:n.CMapCompressionType.NONE;return this._fetchData(t,i).catch(e=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: `+t)})}_fetchData(e,t){(0,n.unreachable)("Abstract method `_fetchData` called.")}};t.BaseStandardFontDataFactory=class a{constructor(e){var{baseUrl:e=null}=e;this.constructor===a&&(0,n.unreachable)("Cannot initialize BaseStandardFontDataFactory."),this.baseUrl=e}async fetch(e){if(e=e.filename,!this.baseUrl)throw new Error('The standard font "baseUrl" parameter must be specified, ensure that the "standardFontDataUrl" API parameter is provided.');if(!e)throw new Error("Font filename must be specified.");const t=""+this.baseUrl+e;return this._fetchData(t).catch(e=>{throw new Error("Unable to load font data at: "+t)})}_fetchData(e){(0,n.unreachable)("Abstract method `_fetchData` called.")}};t.BaseSVGFactory=class l{constructor(){this.constructor===l&&(0,n.unreachable)("Cannot initialize BaseSVGFactory.")}create(e,t){var i=2<arguments.length&&void 0!==arguments[2]&&arguments[2];if(e<=0||t<=0)throw new Error("Invalid SVG dimensions");var n=this._createSVG("svg:svg");return n.setAttribute("version","1.1"),i||(n.setAttribute("width",e+"px"),n.setAttribute("height",t+"px")),n.setAttribute("preserveAspectRatio","none"),n.setAttribute("viewBox",`0 0 ${e} `+t),n}createElement(e){if("string"!=typeof e)throw new Error("Invalid SVG element type");return this._createSVG(e)}_createSVG(e){(0,n.unreachable)("Abstract method `_createSVG` called.")}}},(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MurmurHash3_64=void 0,i(93),i(101),i(102),i(105),i(107),i(109),i(113),i(116),i(123),i(2);var u=i(1);const n=3285377520,p=4294901760,m=65535;t.MurmurHash3_64=class{constructor(e){this.h1=e?4294967295&e:n,this.h2=e?4294967295&e:n}update(i){let n,r;if("string"==typeof i){n=new Uint8Array(2*i.length);for(let e=r=0,t=i.length;e<t;e++){const s=i.charCodeAt(e);s<=255?n[r++]=s:(n[r++]=s>>>8,n[r++]=255&s)}}else{if(!(0,u.isArrayBuffer)(i))throw new Error("Wrong data format in MurmurHash3_64_update. Input must be a string or array.");n=i.slice(),r=n.byteLength}const s=r>>2,e=r-4*s,t=new Uint32Array(n.buffer,0,s);let o=0,a,l=this.h1,h=this.h2;var c=3432918353,d=461845907;for(let e=0;e<s;e++)1&e?(o=(o=(o=(o=t[e])*c&p|11601*o&m)<<15|o>>>17)*d&p|13715*o&m,l=5*(l=(l^=o)<<13|l>>>19)+3864292196):(a=(a=(a=(a=t[e])*c&p|11601*a&m)<<15|a>>>17)*d&p|13715*a&m,h=5*(h=(h^=a)<<13|h>>>19)+3864292196);switch(o=0,e){case 3:o^=n[4*s+2]<<16;case 2:o^=n[4*s+1]<<8;case 1:o=(o=(o=(o^=n[4*s])*c&p|11601*o&m)<<15|o>>>17)*d&p|13715*o&m,1&s?l^=o:h^=o}this.h1=l,this.h2=h}hexdigest(){var e=this.h1,t=this.h2,e=3981806797*(e^=t>>>1)&p|36045*e&m;return e=444984403*(e^=(t=4283543511*t&p|(2950163797*(t<<16|e>>>16)&p)>>>16)>>>1)&p|60499*e&m,((e^=(t=3301882366*t&p|(3120437893*(t<<16|e>>>16)&p)>>>16)>>>1)>>>0).toString(16).padStart(8,"0")+(t>>>0).toString(16).padStart(8,"0")}}},(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FontLoader=t.FontFaceObject=void 0,i(125),i(136),i(138),i(141),i(143),i(145),i(147),i(89),i(149);var p=i(1);t.FontLoader=class{#le=new Set;constructor(e){var{ownerDocument:e=globalThis.document}=e;this._document=e,this.nativeFontFaces=new Set,this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(e){this.nativeFontFaces.add(e),this._document.fonts.add(e)}removeNativeFontFace(e){this.nativeFontFaces.delete(e),this._document.fonts.delete(e)}insertRule(e){this.styleElement||(this.styleElement=this._document.createElement("style"),this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));var t=this.styleElement.sheet;t.insertRule(e,t.cssRules.length)}clear(){for(const e of this.nativeFontFaces)this._document.fonts.delete(e);this.nativeFontFaces.clear(),this.#le.clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont(e){if(e&&!this.#le.has(e.loadedName))if((0,p.assert)(!this.disableFontFace,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){var{loadedName:t,src:i,style:n}=e,i=new FontFace(t,i,n);this.addNativeFontFace(i);try{await i.load(),this.#le.add(t)}catch{(0,p.warn)(`Cannot load system font: ${e.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(i)}}else(0,p.unreachable)("Not implemented: loadSystemFont without the Font Loading API.")}async bind(t){if(!(t.attached||t.missingFile&&!t.systemFontInfo))if(t.attached=!0,t.systemFontInfo)await this.loadSystemFont(t.systemFontInfo);else if(this.isFontLoadingAPISupported){const i=t.createNativeFontFace();if(i){this.addNativeFontFace(i);try{await i.loaded}catch(e){throw(0,p.warn)(`Failed to load font '${i.family}': '${e}'.`),t.disableFontFace=!0,e}}}else{const i=t.createFontFaceRule();i&&(this.insertRule(i),this.isSyncFontLoadingSupported||await new Promise(e=>{e=this._queueLoadingCallback(e);this._prepareFontLoadEvent(t,e)}))}}get isFontLoadingAPISupported(){var e=!!this._document?.fonts;return(0,p.shadow)(this,"isFontLoadingAPISupported",e)}get isSyncFontLoadingSupported(){let e=!1;return(p.isNodeJS||"undefined"!=typeof navigator&&/Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent))&&(e=!0),(0,p.shadow)(this,"isSyncFontLoadingSupported",e)}_queueLoadingCallback(e){const t=this["loadingRequests"],i={done:!1,complete:function(){for((0,p.assert)(!i.done,"completeRequest() cannot be called twice."),i.done=!0;0<t.length&&t[0].done;){var e=t.shift();setTimeout(e.callback,0)}},callback:e};return t.push(i),i}get _loadTestFont(){var e=atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");return(0,p.shadow)(this,"_loadTestFont",e)}_prepareFontLoadEvent(e,t){function i(e,t){return e.charCodeAt(t)<<24|e.charCodeAt(t+1)<<16|e.charCodeAt(t+2)<<8|255&e.charCodeAt(t+3)}function n(e,t,i,n){return e.substring(0,t)+n+e.substring(t+i)}let r,s;var o=this._document.createElement("canvas");o.width=1,o.height=1;const a=o.getContext("2d");let l=0;var h="lt"+Date.now()+this.loadTestFontId++,c=1482184792;let d=i(o=n(this._loadTestFont,976,h.length,h),16);for(r=0,s=h.length-3;r<s;r+=4)d=d-c+i(h,r)|0;r<h.length&&(d=d-c+i(h+"XXX",r)|0),o=n(o,16,4,(0,p.string32)(d));o=`@font-face {font-family:"${h}";src:${`url(data:font/opentype;base64,${btoa(o)});`}}`;this.insertRule(o);const u=this._document.createElement("div");u.style.visibility="hidden",u.style.width=u.style.height="10px",u.style.position="absolute",u.style.top=u.style.left="0px";for(const t of[e.loadedName,h]){const e=this._document.createElement("span");e.textContent="Hi",e.style.fontFamily=t,u.append(e)}this._document.body.append(u),function e(t,i){30<++l?((0,p.warn)("Load test font never loaded."),i()):(a.font="30px "+t,a.fillText(".",0,20),0<a.getImageData(0,0,1,1).data[3]?i():setTimeout(e.bind(null,t,i)))}(h,()=>{u.remove(),t.complete()})}},t.FontFaceObject=class{constructor(e,t){var{isEvalSupported:t=!0,disableFontFace:i=!1,ignoreErrors:n=!1,inspectFont:r=null}=t;this.compiledGlyphs=Object.create(null);for(const t in e)this[t]=e[t];this.isEvalSupported=!1!==t,this.disableFontFace=!0===i,this.ignoreErrors=!0===n,this._inspectFont=r}createNativeFontFace(){if(!this.data||this.disableFontFace)return null;let e;var t;return e=this.cssFontInfo?(t={weight:this.cssFontInfo.fontWeight},this.cssFontInfo.italicAngle&&(t.style=`oblique ${this.cssFontInfo.italicAngle}deg`),new FontFace(this.cssFontInfo.fontFamily,this.data,t)):new FontFace(this.loadedName,this.data,{}),this._inspectFont?.(this),e}createFontFaceRule(){if(!this.data||this.disableFontFace)return null;var t=(0,p.bytesToString)(this.data),t=`url(data:${this.mimetype};base64,${btoa(t)});`;let i;if(this.cssFontInfo){let e=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(e+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),i=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${e}src:${t}}`}else i=`@font-face {font-family:"${this.loadedName}";src:${t}}`;return this._inspectFont?.(this,t),i}getPathGenerator(e,t){if(void 0!==this.compiledGlyphs[t])return this.compiledGlyphs[t];let n;try{n=e.get(this.loadedName+"_path_"+t)}catch(e){if(this.ignoreErrors)return(0,p.warn)(`getPathGenerator - ignoring character: "${e}".`),this.compiledGlyphs[t]=function(e,t){};throw e}if(this.isEvalSupported&&p.FeatureTest.isEvalSupported){const e=[];for(const t of n){const n=void 0!==t.args?t.args.join(","):"";e.push("c.",t.cmd,"(",n,");\n")}return this.compiledGlyphs[t]=new Function("c","size",e.join(""))}return this.compiledGlyphs[t]=function(e,t){for(const i of n)"scale"===i.cmd&&(i.args=[t,-t]),e[i.cmd].apply(e,i.args)}}}},(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NodeStandardFontDataFactory=t.NodeFilterFactory=t.NodeCanvasFactory=t.NodeCMapReaderFactory=void 0,i(2),i(93),i(101),i(102),i(105),i(107),i(109),i(113),i(116),i(123);var n=i(169),i=i(1);if(!globalThis.DOMMatrix&&i.isNodeJS)try{globalThis.DOMMatrix=require("canvas").DOMMatrix}catch(e){(0,i.warn)(`Cannot polyfill \`DOMMatrix\`, rendering may be broken: "${e}".`)}if(!globalThis.Path2D&&i.isNodeJS)try{var r=require("canvas")["CanvasRenderingContext2D"],s=require("path2d-polyfill")["polyfillPath2D"];globalThis.CanvasRenderingContext2D=r,s(globalThis)}catch(e){(0,i.warn)(`Cannot polyfill \`Path2D\`, rendering may be broken: "${e}".`)}function o(e){return new Promise((i,n)=>{require("fs").readFile(e,(e,t)=>{!e&&t?i(new Uint8Array(t)):n(new Error(e))})})}class a extends n.BaseFilterFactory{}t.NodeFilterFactory=a;class l extends n.BaseCanvasFactory{_createCanvas(e,t){return require("canvas").createCanvas(e,t)}}t.NodeCanvasFactory=l;class h extends n.BaseCMapReaderFactory{_fetchData(e,t){return o(e).then(e=>({cMapData:e,compressionType:t}))}}t.NodeCMapReaderFactory=h;class c extends n.BaseStandardFontDataFactory{_fetchData(e){return o(e)}}t.NodeStandardFontDataFactory=c},(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CanvasGraphics=void 0,i(2),i(93),i(101),i(102),i(105),i(107),i(109),i(113),i(116),i(123),i(89);var w=i(1),R=i(168),x=i(174),d=i(175);const u=4096;class h{constructor(e){this.canvasFactory=e,this.cache=Object.create(null)}getCanvas(e,t,i){let n;return void 0!==this.cache[e]?(n=this.cache[e],this.canvasFactory.reset(n,t,i)):(n=this.canvasFactory.create(t,i),this.cache[e]=n),n}delete(e){delete this.cache[e]}clear(){for(const t in this.cache){var e=this.cache[t];this.canvasFactory.destroy(e),delete this.cache[t]}}}function v(e,t,i,n,r,s,o,a,l,h){var[c,d,u,p,m,g]=(0,R.getCurrentTransform)(e);if(0===d&&0===u){const R=o*c+m,f=Math.round(R),v=a*p+g,y=Math.round(v),b=(o+l)*c+m,w=Math.abs(Math.round(b)-f)||1,x=(a+h)*p+g,S=Math.abs(Math.round(x)-y)||1;e.setTransform(Math.sign(c),0,0,Math.sign(p),f,y),e.drawImage(t,i,n,r,s,0,0,w,S),void e.setTransform(c,d,u,p,m,g)}else if(0===c&&0===p){const R=a*u+m,A=Math.round(R),k=o*d+g,_=Math.round(k),C=(a+h)*u+m,T=Math.abs(Math.round(C)-A)||1,E=(o+l)*d+g,M=Math.abs(Math.round(E)-_)||1;e.setTransform(0,Math.sign(d),Math.sign(u),0,A,_),e.drawImage(t,i,n,r,s,0,0,M,T),void e.setTransform(c,d,u,p,m,g)}else e.drawImage(t,i,n,r,s,o,a,l,h),Math.hypot(c,d),Math.hypot(u,p)}class p{constructor(e,t){this.alphaIsShape=!1,this.fontSize=0,this.fontSizeScale=1,this.textMatrix=w.IDENTITY_MATRIX,this.textMatrixScale=1,this.fontMatrix=w.FONT_IDENTITY_MATRIX,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=w.TextRenderingMode.FILL,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,e,t])}clone(){var e=Object.create(this);return e.clipBox=this.clipBox.slice(),e}setCurrentPoint(e,t){this.x=e,this.y=t}updatePathMinMax(e,t,i){[t,i]=w.Util.applyTransform([t,i],e),this.minX=Math.min(this.minX,t),this.minY=Math.min(this.minY,i),this.maxX=Math.max(this.maxX,t),this.maxY=Math.max(this.maxY,i)}updateRectMinMax(e,t){var i=w.Util.applyTransform(t,e),t=w.Util.applyTransform(t.slice(2),e);this.minX=Math.min(this.minX,i[0],t[0]),this.minY=Math.min(this.minY,i[1],t[1]),this.maxX=Math.max(this.maxX,i[0],t[0]),this.maxY=Math.max(this.maxY,i[1],t[1])}updateScalingPathMinMax(e,t){w.Util.scaleMinMax(e,t),this.minX=Math.min(this.minX,t[0]),this.maxX=Math.max(this.maxX,t[1]),this.minY=Math.min(this.minY,t[2]),this.maxY=Math.max(this.maxY,t[3])}updateCurvePathMinMax(e,t,i,n,r,s,o,a,l,h){t=w.Util.bezierBoundingBox(t,i,n,r,s,o,a,l);h?(h[0]=Math.min(h[0],t[0],t[2]),h[1]=Math.max(h[1],t[0],t[2]),h[2]=Math.min(h[2],t[1],t[3]),h[3]=Math.max(h[3],t[1],t[3])):this.updateRectMinMax(e,t)}getPathBoundingBox(){let e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:x.PathType.FILL,t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null;var i=[this.minX,this.minY,this.maxX,this.maxY];if(e===x.PathType.STROKE){t||(0,w.unreachable)("Stroke bounding box must include transform.");const e=w.Util.singularValueDecompose2dScale(t),n=e[0]*this.lineWidth/2,x=e[1]*this.lineWidth/2;i[0]-=n,i[1]-=x,i[2]+=n,i[3]+=x}return i}updateClipFromPath(){var e=w.Util.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(e||[0,0,0,0])}isEmptyClip(){return this.minX===1/0}startNewPathAndClipBox(e){this.clipBox=e,this.minX=1/0,this.minY=1/0,this.maxX=0,this.maxY=0}getClippedPathBoundingBox(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:x.PathType.FILL;return w.Util.intersect(this.clipBox,this.getPathBoundingBox(e,1<arguments.length&&void 0!==arguments[1]?arguments[1]:null))}}function o(o,a){if("undefined"!=typeof ImageData&&a instanceof ImageData)o.putImageData(a,0,0);else{const c=a.height,d=a.width,u=c%16,p=(c-u)/16,m=0===u?p:p+1,g=o.createImageData(d,16);let n,r=0;var l=a.data,h=g.data;let t,i,s,e;if(a.kind===w.ImageKind.GRAYSCALE_1BPP){const a=l.byteLength,c=new Uint32Array(h.buffer,0,h.byteLength>>2),e=c.length,f=d+7>>3,v=4294967295,y=w.FeatureTest.isLittleEndian?4278190080:255;for(t=0;t<m;t++){for(s=t<p?16:u,n=0,i=0;i<s;i++){const o=a-r;let e=0;const u=o>f?d:8*o-7,p=-8&u;let t=0,i=0;for(;e<p;e+=8)i=l[r++],c[n++]=128&i?v:y,c[n++]=64&i?v:y,c[n++]=32&i?v:y,c[n++]=16&i?v:y,c[n++]=8&i?v:y,c[n++]=4&i?v:y,c[n++]=2&i?v:y,c[n++]=1&i?v:y;for(;e<u;e++)0===t&&(i=l[r++],t=128),c[n++]=i&t?v:y,t>>=1}for(;n<e;)c[n++]=0;o.putImageData(g,0,16*t)}}else if(a.kind===w.ImageKind.RGBA_32BPP){for(i=0,e=16*d*4,t=0;t<p;t++)h.set(l.subarray(r,r+e)),r+=e,o.putImageData(g,0,i),i+=16;t<m&&(e=d*u*4,h.set(l.subarray(r,r+e)),o.putImageData(g,0,i))}else{if(a.kind!==w.ImageKind.RGB_24BPP)throw new Error("bad image kind: "+a.kind);for(s=16,e=d*s,t=0;t<m;t++){for(t>=p&&(s=u,e=d*s),n=0,i=e;i--;)h[n++]=l[r++],h[n++]=l[r++],h[n++]=l[r++],h[n++]=255;o.putImageData(g,0,16*t)}}}}function y(i,e){if(e.bitmap)i.drawImage(e.bitmap,0,0);else{const s=e.height,o=e.width,a=s%16,l=(s-a)/16,h=0==a?l:1+l,c=i.createImageData(o,16);let t=0;var n=e.data,r=c.data;for(let e=0;e<h;e++){const s=e<l?16:a;({srcPos:t}=(0,d.convertBlackAndWhiteToRGBA)({src:n,srcPos:t,dest:r,width:o,height:s,nonBlackColor:0})),i.putImageData(c,0,16*e)}}}function m(e,t){for(const i of["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font","filter"])void 0!==e[i]&&(t[i]=e[i]);void 0!==e.setLineDash&&(t.setLineDash(e.getLineDash()),t.lineDashOffset=e.lineDashOffset)}function g(e){var t;e.strokeStyle=e.fillStyle="#000000",e.fillRule="nonzero",e.globalAlpha=1,e.lineWidth=1,e.lineCap="butt",e.lineJoin="miter",e.miterLimit=10,e.globalCompositeOperation="source-over",e.font="10px sans-serif",void 0!==e.setLineDash&&(e.setLineDash([]),e.lineDashOffset=0),w.isNodeJS||(t=e["filter"],"none"!==t&&""!==t&&(e.filter="none"))}function $(t,i,n){const r=t.length;for(let e=3;e<r;e+=4){const r=n?n[t[e]]:t[e];i[e]=i[e]*r*.00392156862745098|0}}function L(t,i,n){const r=t.length;for(let e=3;e<r;e+=4){const r=77*t[e-3]+152*t[e-2]+28*t[e-1];i[e]=n?i[e]*n[r>>8]>>8:i[e]*r>>16}}function b(e,t){var e=w.Util.singularValueDecompose2dScale(e),i=(e[0]=Math.fround(e[0]),e[1]=Math.fround(e[1]),Math.fround((globalThis.devicePixelRatio||1)*R.PixelsPerInch.PDF_TO_CSS_UNITS));return void 0!==t?t:e[0]<=i||e[1]<=i}const n=["butt","round","square"],r=["miter","round","bevel"],s={},a={};class l{constructor(e,t,i,n,r,s,o,a){var{optionalContentConfig:s,markedContentStack:l=null}=s;this.ctx=e,this.current=new p(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=t,this.objs=i,this.canvasFactory=n,this.filterFactory=r,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=l||[],this.optionalContentConfig=s,this.cachedCanvases=new h(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=o,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.pageColors=a,this._cachedScaleForStroking=[-1,0],this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map}getObject(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null;return"string"==typeof e?(e.startsWith("g_")?this.commonObjs:this.objs).get(e):t}beginDrawing(e){var{transform:e,viewport:t,transparency:i=!1,background:n=null}=e,r=this.ctx.canvas.width,s=this.ctx.canvas.height,o=this.ctx.fillStyle;if(this.ctx.fillStyle=n||"#ffffff",this.ctx.fillRect(0,0,r,s),this.ctx.fillStyle=o,i){const e=this.cachedCanvases.getCanvas("transparent",r,s);this.compositeCtx=this.ctx,this.transparentCanvas=e.canvas,this.ctx=e.context,this.ctx.save(),this.ctx.transform(...(0,R.getCurrentTransform)(this.compositeCtx))}this.ctx.save(),g(this.ctx),e&&(this.ctx.transform(...e),this.outputScaleX=e[0],this.outputScaleY=e[0]),this.ctx.transform(...t.transform),this.viewportScale=t.scale,this.baseTransform=(0,R.getCurrentTransform)(this.ctx)}executeOperatorList(e,t,i,n){var r=e.argsArray,s=e.fnArray;let o=t||0;var a=r.length;if(a===o)return o;var l=10<a-o&&"function"==typeof i,h=l?Date.now()+15:0;let c=0;for(var d,u=this.commonObjs,p=this.objs;;){if(void 0!==n&&o===n.nextBreakPoint)return n.breakIt(o,i),o;if((d=s[o])!==w.OPS.dependency)this[d].apply(this,r[o]);else for(const e of r[o]){const t=e.startsWith("g_")?u:p;if(!t.has(e))return t.get(e,i),o}if(++o===a)return o;if(l&&10<++c){if(Date.now()>h)return i(),o;c=0}}}#ce(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();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.#ce(),this.cachedCanvases.clear(),this.cachedPatterns.clear();for(const e of this._cachedBitmapsMap.values()){for(const t of e.values())"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement&&(t.width=t.height=0);e.clear()}this._cachedBitmapsMap.clear(),this.#he()}#he(){var e,t;this.pageColors&&"none"!==(e=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background))&&(t=this.ctx.filter,this.ctx.filter=e,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=t)}_scaleImage(i,e){var t=i.width,n=i.height;let r,s,o=Math.max(Math.hypot(e[0],e[1]),1),a=Math.max(Math.hypot(e[2],e[3]),1),l=t,h=n,c="prescale1";for(;2<o&&1<l||2<a&&1<h;){let e=l,t=h;2<o&&1<l&&(e=16384<=l?Math.floor(l/2)-1||1:Math.ceil(l/2),o/=l/e),2<a&&1<h&&(t=16384<=h?Math.floor(h/2)-1||1:Math.ceil(h)/2,a/=h/t),r=this.cachedCanvases.getCanvas(c,e,t),(s=r.context).clearRect(0,0,e,t),s.drawImage(i,0,0,l,h,0,0,e,t),i=r.canvas,l=e,h=t,c="prescale1"===c?"prescale2":"prescale1"}return{img:i,paintWidth:l,paintHeight:h}}_createMaskCanvas(e){const t=this.ctx,{width:i,height:n}=e,r=this.current.fillColor,s=this.current.patternFill,o=(0,R.getCurrentTransform)(t);let a,l,h,c;if((e.bitmap||e.data)&&1<e.count){const t=e.bitmap||e.data.buffer,i=(l=JSON.stringify(s?o:[o.slice(0,4),r]),(a=this._cachedBitmapsMap.get(t))||(a=new Map,this._cachedBitmapsMap.set(t,a)),a.get(l));if(i&&!s)return{canvas:i,offsetX:Math.round(Math.min(o[0],o[2])+o[4]),offsetY:Math.round(Math.min(o[1],o[3])+o[5])};h=i}h||y((c=this.cachedCanvases.getCanvas("maskCanvas",i,n)).context,e);var d=w.Util.transform(o,[1/i,0,0,-1/n,0,0]),d=w.Util.transform(d,[1,0,0,1,0,-n]),u=w.Util.applyTransform([0,0],d),p=w.Util.applyTransform([i,n],d),m=w.Util.normalizeRect([u[0],u[1],p[0],p[1]]),g=Math.round(m[2]-m[0])||1,m=Math.round(m[3]-m[1])||1,g=this.cachedCanvases.getCanvas("fillCanvas",g,m),m=g.context,f=Math.min(u[0],p[0]),u=Math.min(u[1],p[1]),p=(m.translate(-f,-u),m.transform(...d),h||(h=(h=this._scaleImage(c.canvas,(0,R.getCurrentTransformInverse)(m))).img,a&&s&&a.set(l,h)),m.imageSmoothingEnabled=b((0,R.getCurrentTransform)(m),e.interpolate),v(m,h,0,0,h.width,h.height,0,0,i,n),m.globalCompositeOperation="source-in",w.Util.transform((0,R.getCurrentTransformInverse)(m),[1,0,0,1,-f,-u]));return m.fillStyle=s?r.getPattern(t,this,p,x.PathType.FILL):r,m.fillRect(0,0,i,n),a&&!s&&(this.cachedCanvases.delete("fillCanvas"),a.set(l,g.canvas)),{canvas:g.canvas,offsetX:Math.round(f),offsetY:Math.round(u)}}setLineWidth(e){e!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=e,this.ctx.lineWidth=e}setLineCap(e){this.ctx.lineCap=n[e]}setLineJoin(e){this.ctx.lineJoin=r[e]}setMiterLimit(e){this.ctx.miterLimit=e}setDash(e,t){var i=this.ctx;void 0!==i.setLineDash&&(i.setLineDash(e),i.lineDashOffset=t)}setRenderingIntent(e){}setFlatness(e){}setGState(e){for(var[t,i]of e)switch(t){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(){var e=this.inSMaskMode;this.current.activeSMask&&!e?this.beginSMaskMode():!this.current.activeSMask&&e&&this.endSMaskMode()}beginSMaskMode(){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");var e=this.ctx.canvas.width,t=this.ctx.canvas.height,i="smaskGroupAt"+this.groupLevel,i=this.cachedCanvases.getCanvas(i,e,t),e=(this.suspendedCtx=this.ctx,this.ctx=i.context,this.ctx),n=(e.setTransform(...(0,R.getCurrentTransform)(this.suspendedCtx)),m(this.suspendedCtx,e),e),o=this.suspendedCtx;if(n._removeMirroring)throw new Error("Context is already forwarding operations.");n.__originalSave=n.save,n.__originalRestore=n.restore,n.__originalRotate=n.rotate,n.__originalScale=n.scale,n.__originalTranslate=n.translate,n.__originalTransform=n.transform,n.__originalSetTransform=n.setTransform,n.__originalResetTransform=n.resetTransform,n.__originalClip=n.clip,n.__originalMoveTo=n.moveTo,n.__originalLineTo=n.lineTo,n.__originalBezierCurveTo=n.bezierCurveTo,n.__originalRect=n.rect,n.__originalClosePath=n.closePath,n.__originalBeginPath=n.beginPath,n._removeMirroring=()=>{n.save=n.__originalSave,n.restore=n.__originalRestore,n.rotate=n.__originalRotate,n.scale=n.__originalScale,n.translate=n.__originalTranslate,n.transform=n.__originalTransform,n.setTransform=n.__originalSetTransform,n.resetTransform=n.__originalResetTransform,n.clip=n.__originalClip,n.moveTo=n.__originalMoveTo,n.lineTo=n.__originalLineTo,n.bezierCurveTo=n.__originalBezierCurveTo,n.rect=n.__originalRect,n.closePath=n.__originalClosePath,n.beginPath=n.__originalBeginPath,delete n._removeMirroring},n.save=function(){o.save(),this.__originalSave()},n.restore=function(){o.restore(),this.__originalRestore()},n.translate=function(e,t){o.translate(e,t),this.__originalTranslate(e,t)},n.scale=function(e,t){o.scale(e,t),this.__originalScale(e,t)},n.transform=function(e,t,i,n,r,s){o.transform(e,t,i,n,r,s),this.__originalTransform(e,t,i,n,r,s)},n.setTransform=function(e,t,i,n,r,s){o.setTransform(e,t,i,n,r,s),this.__originalSetTransform(e,t,i,n,r,s)},n.resetTransform=function(){o.resetTransform(),this.__originalResetTransform()},n.rotate=function(e){o.rotate(e),this.__originalRotate(e)},n.clip=function(e){o.clip(e),this.__originalClip(e)},n.moveTo=function(e,t){o.moveTo(e,t),this.__originalMoveTo(e,t)},n.lineTo=function(e,t){o.lineTo(e,t),this.__originalLineTo(e,t)},n.bezierCurveTo=function(e,t,i,n,r,s){o.bezierCurveTo(e,t,i,n,r,s),this.__originalBezierCurveTo(e,t,i,n,r,s)},n.rect=function(e,t,i,n){o.rect(e,t,i,n),this.__originalRect(e,t,i,n)},n.closePath=function(){o.closePath(),this.__originalClosePath()},n.beginPath=function(){o.beginPath(),this.__originalBeginPath()},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(),m(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(e){if(this.current.activeSMask){e?(e[0]=Math.floor(e[0]),e[1]=Math.floor(e[1]),e[2]=Math.ceil(e[2]),e[3]=Math.ceil(e[3])):e=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];var t=this.current.activeSMask,i=this.suspendedCtx,n=this.ctx,r=(e=e)[0],s=e[1],o=e[2]-r,e=e[3]-s;if(0!=o&&0!=e){var a,l=t.context,h=n,c=o,d=e,o=t.subtype,u=t.backdrop,p=t.transferMap,m=r,g=s,f=t.offsetX,v=t.offsetY,y=!!u,b=y?u[0]:0,w=y?u[1]:0,x=y?u[2]:0,S="Luminosity"===o?L:$,A=Math.min(d,Math.ceil(1048576/c));for(let e=0;e<d;e+=A){const u=Math.min(A,d-e),E=l.getImageData(m-f,e+(g-v),c,u),M=h.getImageData(m,e+g,c,u);if(y){k=void 0;_=void 0;C=void 0;T=void 0;a=void 0;var k=E.data;var _=b;var C=w;var T=x;const R=k.length;for(let e=3;e<R;e+=4){const R=k[e];0===R?(k[e-3]=_,k[e-2]=C,k[e-1]=T):R<255&&(a=255-R,k[e-3]=k[e-3]*R+_*a>>8,k[e-2]=k[e-2]*R+C*a>>8,k[e-1]=k[e-1]*R+T*a>>8)}}S(E.data,M.data,p),h.putImageData(M,m,e+g)}i.save(),i.globalAlpha=1,i.globalCompositeOperation="source-over",i.setTransform(1,0,0,1,0,0),i.drawImage(n.canvas,0,0),i.restore()}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()}}save(){(this.inSMaskMode?(m(this.ctx,this.suspendedCtx),this.suspendedCtx):this.ctx).save();var e=this.current;this.stateStack.push(e),this.current=e.clone()}restore(){0===this.stateStack.length&&this.inSMaskMode&&this.endSMaskMode(),0!==this.stateStack.length&&(this.current=this.stateStack.pop(),this.inSMaskMode?(this.suspendedCtx.restore(),m(this.suspendedCtx,this.ctx)):this.ctx.restore(),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null)}transform(e,t,i,n,r,s){this.ctx.transform(e,t,i,n,r,s),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(n,r,s){var o=this.ctx,a=this.current;let l,h,c=a.x,d=a.y;var u=(0,R.getCurrentTransform)(o),p=0===u[0]&&0===u[3]||0===u[1]&&0===u[2],m=p?s.slice(0):null;for(let e=0,t=0,i=n.length;e<i;e++)switch(0|n[s]){case w.OPS.rectangle:c=r[t++],d=r[t++];const n=r[t++],s=r[t++],g=c+n,f=d+s;o.moveTo(c,d),0===n||0===s?o.lineTo(g,f):(o.lineTo(g,d),o.lineTo(g,f),o.lineTo(c,f)),p||a.updateRectMinMax(u,[c,d,g,f]),o.closePath();break;case w.OPS.moveTo:c=r[t++],d=r[t++],o.moveTo(c,d),p||a.updatePathMinMax(u,c,d);break;case w.OPS.lineTo:c=r[t++],d=r[t++],o.lineTo(c,d),p||a.updatePathMinMax(u,c,d);break;case w.OPS.curveTo:l=c,h=d,c=r[t+4],d=r[t+5],o.bezierCurveTo(r[t],r[t+1],r[t+2],r[t+3],c,d),a.updateCurvePathMinMax(u,l,h,r[t],r[t+1],r[t+2],r[t+3],c,d,m),t+=6;break;case w.OPS.curveTo2:l=c,h=d,o.bezierCurveTo(c,d,r[t],r[t+1],r[t+2],r[t+3]),a.updateCurvePathMinMax(u,l,h,c,d,r[t],r[t+1],r[t+2],r[t+3],m),c=r[t+2],d=r[t+3],t+=4;break;case w.OPS.curveTo3:l=c,h=d,c=r[t+2],d=r[t+3],o.bezierCurveTo(r[t],r[t+1],c,d,c,d),a.updateCurvePathMinMax(u,l,h,r[t],r[t+1],c,d,c,d,m),t+=4;break;case w.OPS.closePath:o.closePath()}p&&a.updateScalingPathMinMax(u,m),a.setCurrentPoint(c,d)}closePath(){this.ctx.closePath()}stroke(){var e=!(0<arguments.length&&void 0!==arguments[0])||arguments[0],t=this.ctx,i=this.current.strokeColor;t.globalAlpha=this.current.strokeAlpha,this.contentVisible&&("object"==typeof i&&i?.getPattern?(t.save(),t.strokeStyle=i.getPattern(t,this,(0,R.getCurrentTransformInverse)(t),x.PathType.STROKE),this.rescaleAndStroke(!1),t.restore()):this.rescaleAndStroke(!0)),e&&this.consumePath(this.current.getClippedPathBoundingBox()),t.globalAlpha=this.current.fillAlpha}closeStroke(){this.closePath(),this.stroke()}fill(){var e=!(0<arguments.length&&void 0!==arguments[0])||arguments[0],t=this.ctx,i=this.current.fillColor;let n=!1;this.current.patternFill&&(t.save(),t.fillStyle=i.getPattern(t,this,(0,R.getCurrentTransformInverse)(t),x.PathType.FILL),n=!0);i=this.current.getClippedPathBoundingBox();this.contentVisible&&null!==i&&(this.pendingEOFill?(t.fill("evenodd"),this.pendingEOFill=!1):t.fill()),n&&t.restore(),e&&this.consumePath(i)}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=s}eoClip(){this.pendingClip=a}beginText(){this.current.textMatrix=w.IDENTITY_MATRIX,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}endText(){var e=this.pendingTextPaths,t=this.ctx;if(void 0!==e){t.save(),t.beginPath();for(const i of e)t.setTransform(...i.transform),t.translate(i.x,i.y),i.addToPath(t,i.fontSize);t.restore(),t.clip(),t.beginPath(),delete this.pendingTextPaths}else t.beginPath()}setCharSpacing(e){this.current.charSpacing=e}setWordSpacing(e){this.current.wordSpacing=e}setHScale(e){this.current.textHScale=e/100}setLeading(e){this.current.leading=-e}setFont(i,n){var r=this.commonObjs.get(i),s=this.current;if(!r)throw new Error("Can't find font for "+i);if(s.fontMatrix=r.fontMatrix||w.FONT_IDENTITY_MATRIX,0!==s.fontMatrix[0]&&0!==s.fontMatrix[3]||(0,w.warn)("Invalid font matrix for font "+i),n<0?(n=-n,s.fontDirection=-1):s.fontDirection=1,this.current.font=r,this.current.fontSize=n,!r.isType3Font){i=r.loadedName||"sans-serif",s=r.systemFontInfo?.css||`"${i}", `+r.fallbackName;let e="normal";r.black?e="900":r.bold&&(e="bold");i=r.italic?"italic":"normal";let t=n;n<16?t=16:100<n&&(t=100),this.current.fontSizeScale=n/t,this.ctx.font=i+` ${e} ${t}px `+s}}setTextRenderingMode(e){this.current.textRenderingMode=e}setTextRise(e){this.current.textRise=e}moveText(e,t){this.current.x=this.current.lineX+=e,this.current.y=this.current.lineY+=t}setLeadingMoveText(e,t){this.setLeading(-t),this.moveText(e,t)}setTextMatrix(e,t,i,n,r,s){this.current.textMatrix=[e,t,i,n,r,s],this.current.textMatrixScale=Math.hypot(e,t),this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}nextLine(){this.moveText(0,this.current.leading)}paintChar(e,t,i,n){var r=this.ctx,s=this.current,o=s.font,a=s.textRenderingMode,l=s.fontSize/s.fontSizeScale,h=a&w.TextRenderingMode.FILL_STROKE_MASK,a=!!(a&w.TextRenderingMode.ADD_TO_PATH_FLAG),s=s.patternFill&&!o.missingFile;let c;(o.disableFontFace||a||s)&&(c=o.getPathGenerator(this.commonObjs,e)),o.disableFontFace||s?(r.save(),r.translate(t,i),r.beginPath(),c(r,l),n&&r.setTransform(...n),h!==w.TextRenderingMode.FILL&&h!==w.TextRenderingMode.FILL_STROKE||r.fill(),h!==w.TextRenderingMode.STROKE&&h!==w.TextRenderingMode.FILL_STROKE||r.stroke(),r.restore()):(h!==w.TextRenderingMode.FILL&&h!==w.TextRenderingMode.FILL_STROKE||r.fillText(e,t,i),h!==w.TextRenderingMode.STROKE&&h!==w.TextRenderingMode.FILL_STROKE||r.strokeText(e,t,i)),a&&(this.pendingTextPaths||=[]).push({transform:(0,R.getCurrentTransform)(r),x:t,y:i,fontSize:l,addToPath:c})}get isFontSubpixelAAEnabled(){var e=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10)["context"],t=(e.scale(1.5,1),e.fillText("I",0,10),e.getImageData(0,0,10,10).data);let i=!1;for(let e=3;e<t.length;e+=4)if(0<t[e]&&t[e]<255){i=!0;break}return(0,w.shadow)(this,"isFontSubpixelAAEnabled",i)}showText(o){const a=this.current,l=a.font;if(l.isType3Font)return this.showType3Text(o);var h=a.fontSize;if(0!==h){const c=this.ctx,d=a.fontSizeScale,u=a.charSpacing,p=a.wordSpacing,m=a.fontDirection,g=a.textHScale*m,i=o.length,f=l.vertical,n=f?1:-1,v=l.defaultVMetrics,y=h*a.fontMatrix[0],b=a.textRenderingMode===w.TextRenderingMode.FILL&&!l.disableFontFace&&!a.patternFill;c.save(),c.transform(...a.textMatrix),c.translate(a.x,a.y+a.textRise),0<m?c.scale(g,-1):c.scale(g,1);let s;if(a.patternFill){c.save();const o=a.fillColor.getPattern(c,this,(0,R.getCurrentTransformInverse)(c),x.PathType.FILL);s=(0,R.getCurrentTransform)(c),c.restore(),c.fillStyle=o}let e=a.lineWidth;var t=a.textMatrixScale;if(0===t||0===e){const o=a.textRenderingMode&w.TextRenderingMode.FILL_STROKE_MASK;o!==w.TextRenderingMode.STROKE&&o!==w.TextRenderingMode.FILL_STROKE||(e=this.getSinglePixelWidth())}else e/=t;if(1!==d&&(c.scale(d,d),e/=d),c.lineWidth=e,l.isInvalidPDFjsFont){const l=[];let e=0;for(const a of o)l.push(a.unicode),e+=a.width;c.fillText(l.join(""),0,0),a.x+=e*y*g,c.restore(),void this.compose()}else{let e,r=0;for(e=0;e<i;++e){const a=o[e];if("number"==typeof a)r+=n*a*h/1e3;else{let e=!1;const R=(a.isSpace?p:0)+u,x=a.fontChar,g=a.accent;let t,i,n=a.width;if(f){const o=a.vmetric||v,l=-(a.vmetric?o[1]:.5*n)*y,w=o[2]*y;n=o?-o[0]:n,t=l/d,i=(r+w)/d}else t=r/d,i=0;if(l.remeasure&&0<n){const o=1e3*c.measureText(x).width/h*d;if(n<o&&this.isFontSubpixelAAEnabled){const a=n/o;e=!0,c.save(),c.scale(a,1),t/=a}else n!==o&&(t+=(n-o)/2e3*h/d)}if(this.contentVisible&&(a.isInFont||l.missingFile))if(b&&!g)c.fillText(x,t,i);else if(this.paintChar(x,t,i,s),g){const o=t+h*g.offset.x/d,a=i-h*g.offset.y/d;this.paintChar(g.fontChar,o,a,s)}r+=f?n*y-R*m:n*y+R*m,e&&c.restore()}}f?a.y-=r:a.x+=r*g,c.restore(),this.compose()}}}showType3Text(e){const t=this.ctx,i=this.current,n=i.font,r=i.fontSize,s=i.fontDirection,o=n.vertical?1:-1,a=i.charSpacing,l=i.wordSpacing,h=i.textHScale*s,c=i.fontMatrix||w.FONT_IDENTITY_MATRIX,d=e.length;let u,p,m,g;if(i.textRenderingMode!==w.TextRenderingMode.INVISIBLE&&0!==r){for(this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,t.save(),t.transform(...i.textMatrix),t.translate(i.x,i.y),t.scale(h,s),u=0;u<d;++u)if("number"==typeof(p=e[u]))this.ctx.translate(g=o*p*r/1e3,0),i.x+=g*h;else{const s=(p.isSpace?l:0)+a,d=n.charProcOperatorList[p.operatorListId];d?(this.contentVisible&&(this.processingType3=p,this.save(),t.scale(r,r),t.transform(...c),this.executeOperatorList(d),this.restore()),m=w.Util.applyTransform([p.width,0],c)[0]*r+s,t.translate(m,0),i.x+=m*h):(0,w.warn)(`Type3 character "${p.operatorListId}" is not available.`)}t.restore(),this.processingType3=null}}setCharWidth(e,t){}setCharWidthAndBounds(e,t,i,n,r,s){this.ctx.rect(i,n,r-i,s-n),this.ctx.clip(),this.endPath()}getColorN_Pattern(e){let t;var i,n;return t="TilingPattern"===e[0]?(i=e[1],n=this.baseTransform||(0,R.getCurrentTransform)(this.ctx),new x.TilingPattern(e,i,this.ctx,{createCanvasGraphics:e=>new l(e,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack})},n)):this._getPattern(e[1],e[2])}setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments)}setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0}setStrokeRGBColor(e,t,i){e=w.Util.makeHexColor(e,t,i);this.ctx.strokeStyle=e,this.current.strokeColor=e}setFillRGBColor(e,t,i){e=w.Util.makeHexColor(e,t,i);this.ctx.fillStyle=e,this.current.fillColor=e,this.current.patternFill=!1}_getPattern(e){let t,i=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null;return this.cachedPatterns.has(e)?t=this.cachedPatterns.get(e):(t=(0,x.getShadingPattern)(this.getObject(e)),this.cachedPatterns.set(e,t)),i&&(t.matrix=i),t}shadingFill(e){if(this.contentVisible){var t=this.ctx;this.save();const n=this._getPattern(e);t.fillStyle=n.getPattern(t,this,(0,R.getCurrentTransformInverse)(t),x.PathType.SHADING);var i=(0,R.getCurrentTransformInverse)(t);if(i){const{width:e,height:n}=t.canvas,[R,x,r,s]=w.Util.getAxialAlignedBoundingBox([0,0,e,n],i);this.ctx.fillRect(R,x,r-R,s-x)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox()),this.restore()}}beginInlineImage(){(0,w.unreachable)("Should not call beginInlineImage")}beginImageData(){(0,w.unreachable)("Should not call beginImageData")}paintFormXObjectBegin(e,t){if(this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),Array.isArray(e)&&6===e.length&&this.transform(...e),this.baseTransform=(0,R.getCurrentTransform)(this.ctx),t)){const e=t[2]-t[0],i=t[3]-t[1];this.ctx.rect(t[0],t[1],e,i),this.current.updateRectMinMax((0,R.getCurrentTransform)(this.ctx),t),this.clip(),this.endPath()}}paintFormXObjectEnd(){this.contentVisible&&(this.restore(),this.baseTransform=this.baseTransformStack.pop())}beginGroup(s){if(this.contentVisible){this.save(),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);var o=this.ctx,a=(s.isolated||(0,w.info)("TODO: Support non-isolated groups."),s.knockout&&(0,w.warn)("Knockout groups not supported."),(0,R.getCurrentTransform)(o));if(s.matrix&&o.transform(...s.matrix),!s.bbox)throw new Error("Bounding box is required.");var l=w.Util.getAxialAlignedBoundingBox(s.bbox,(0,R.getCurrentTransform)(o)),h=[0,0,o.canvas.width,o.canvas.height],l=w.Util.intersect(l,h)||[0,0,0,0],h=Math.floor(l[0]),c=Math.floor(l[1]);let e=Math.max(Math.ceil(l[2])-h,1),t=Math.max(Math.ceil(l[3])-c,1),i=1,n=1,r=(e>u&&(i=e/u,e=u),t>u&&(n=t/u,t=u),this.current.startNewPathAndClipBox([0,0,e,t]),"groupAt"+this.groupLevel);s.smask&&(r+="_smask_"+this.smaskCounter++%2);var l=this.cachedCanvases.getCanvas(r,e,t),d=l.context;d.scale(1/i,1/n),d.translate(-h,-c),d.transform(...a),s.smask?this.smaskStack.push({canvas:l.canvas,context:d,offsetX:h,offsetY:c,scaleX:i,scaleY:n,subtype:s.smask.subtype,backdrop:s.smask.backdrop,transferMap:s.smask.transferMap||null,startTransformInverse:null}):(o.setTransform(1,0,0,1,0,0),o.translate(h,c),o.scale(i,n),o.save()),m(o,d),this.ctx=d,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(o),this.groupLevel++}}endGroup(e){if(this.contentVisible){this.groupLevel--;const t=this.ctx,i=this.groupStack.pop();if(this.ctx=i,this.ctx.imageSmoothingEnabled=!1,e.smask)this.tempSMask=this.smaskStack.pop(),this.restore();else{this.ctx.restore();const e=(0,R.getCurrentTransform)(this.ctx),i=(this.restore(),this.ctx.save(),this.ctx.setTransform(...e),w.Util.getAxialAlignedBoundingBox([0,0,t.canvas.width,t.canvas.height],e));this.ctx.drawImage(t.canvas,0,0),this.ctx.restore(),this.compose(i)}}}beginAnnotation(e,t,i,n,r){if(this.#ce(),g(this.ctx),this.ctx.save(),this.save(),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),Array.isArray(t)&&4===t.length){const n=t[2]-t[0],a=t[3]-t[1];if(r&&this.annotationCanvasMap){(i=i.slice())[4]-=t[0],i[5]-=t[1],(t=t.slice())[0]=t[1]=0,t[2]=n,t[3]=a;const[r,l]=w.Util.singularValueDecompose2dScale((0,R.getCurrentTransform)(this.ctx)),h=this["viewportScale"],c=Math.ceil(n*this.outputScaleX*h),d=Math.ceil(a*this.outputScaleY*h);this.annotationCanvas=this.canvasFactory.create(c,d);var{canvas:s,context:o}=this.annotationCanvas;this.annotationCanvasMap.set(e,s),this.annotationCanvas.savedCtx=this.ctx,this.ctx=o,this.ctx.save(),this.ctx.setTransform(r,0,0,-l,0,a*l),g(this.ctx)}else g(this.ctx),this.ctx.rect(t[0],t[1],n,a),this.ctx.clip(),this.endPath()}this.current=new p(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(...i),this.transform(...n)}endAnnotation(){this.annotationCanvas&&(this.ctx.restore(),this.#he(),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(e){var t,i;this.contentVisible&&(t=e.count,(e=this.getObject(e.data,e)).count=t,t=this.ctx,(i=this.processingType3)&&(void 0===i.compiled&&(i.compiled=function(e){const{width:i,height:n}=e;if(1e3<i||1e3<n)return null;const r=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),s=i+1;let o,t,a,l=new Uint8Array(s*(n+1));var h=i+7&-8;let c=new Uint8Array(h*n),d=0;for(const i of e.data){let e=128;for(;0<e;)c[d++]=i&e?0:255,e>>=1}let u=0;for((d=0)!==c[d]&&(l[0]=1,++u),t=1;t<i;t++)c[d]!==c[d+1]&&(l[t]=c[d]?2:1,++u),d++;for(0!==c[d]&&(l[t]=2,++u),o=1;o<n;o++){d=o*h,a=o*s,c[d-h]!==c[d]&&(l[a]=c[d]?1:8,++u);let e=(c[d]?4:0)+(c[d-h]?8:0);for(t=1;t<i;t++)e=(e>>2)+(c[d+1]?4:0)+(c[d-h+1]?8:0),r[e]&&(l[a+t]=r[e],++u),d++;if(c[d-h]!==c[d]&&(l[a+t]=c[d]?2:4,++u),1e3<u)return null}for(d=h*(n-1),a=o*s,0!==c[d]&&(l[a]=8,++u),t=1;t<i;t++)c[d]!==c[d+1]&&(l[a+t]=c[d]?4:8,++u),d++;if(0!==c[d]&&(l[a+t]=4,++u),1e3<u)return null;const p=new Int32Array([0,s,-1,0,-s,0,0,0,1]),m=new Path2D;for(o=0;u&&o<=n;o++){let t=o*s;const n=t+i;for(;t<n&&!l[t];)t++;if(t!==n){m.moveTo(t%s,o);const r=t;let e=l[t];do{const i=p[e];for(;t+=i,!l[t];);const n=l[t];5!==n&&10!==n?(e=n,l[t]=0):(e=n&51*e>>4,l[t]&=e>>2|e<<2),m.lineTo(t%s,t/s|0),l[t]||--u}while(r!==t);--o}}return c=null,l=null,function(e){e.save(),e.scale(1/i,-1/n),e.translate(0,-n),e.fill(m),e.beginPath(),e.restore()}}(e)),i.compiled)?i.compiled(t):(e=(i=this._createMaskCanvas(e)).canvas,t.save(),t.setTransform(1,0,0,1,0,0),t.drawImage(e,i.offsetX,i.offsetY),t.restore(),this.compose()))}paintImageMaskXObjectRepeat(e,i){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:0,r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:0,s=4<arguments.length?arguments[4]:void 0,o=5<arguments.length?arguments[5]:void 0;if(this.contentVisible){e=this.getObject(e.data,e);var a=this.ctx,l=(a.save(),(0,R.getCurrentTransform)(a)),h=(a.transform(i,n,r,s,0,0),this._createMaskCanvas(e));a.setTransform(1,0,0,1,h.offsetX-l[4],h.offsetY-l[5]);for(let e=0,t=o.length;e<t;e+=2){const R=w.Util.transform(l,[i,n,r,s,o[e],o[e+1]]),[c,d]=w.Util.applyTransform([0,0],R);a.drawImage(h.canvas,c,d)}a.restore(),this.compose()}}paintImageMaskXObjectGroup(e){if(this.contentVisible){var t=this.ctx,i=this.current.fillColor,n=this.current.patternFill;for(const r of e){const{data:e,width:s,height:o,transform:a}=r,l=this.cachedCanvases.getCanvas("maskCanvas",s,o),h=l.context;h.save(),y(h,this.getObject(e,r)),h.globalCompositeOperation="source-in",h.fillStyle=n?i.getPattern(h,this,(0,R.getCurrentTransformInverse)(t),x.PathType.FILL):i,h.fillRect(0,0,s,o),h.restore(),t.save(),t.transform(...a),t.scale(1,-1),v(t,l.canvas,0,0,s,o,0,-1,1,1),t.restore()}this.compose()}}paintImageXObject(e){this.contentVisible&&((e=this.getObject(e))?this.paintInlineImageXObject(e):(0,w.warn)("Dependent image isn't ready yet"))}paintImageXObjectRepeat(e,i,n,r){if(this.contentVisible){e=this.getObject(e);if(e){var s=e.width,o=e.height,a=[];for(let e=0,t=r.length;e<t;e+=2)a.push({transform:[i,0,0,n,r[e],r[e+1]],x:0,y:0,w:s,h:o});this.paintInlineImageXObjectGroup(e,a)}else(0,w.warn)("Dependent image isn't ready yet")}}applyTransferMapsToCanvas(e){return"none"!==this.current.transferMaps&&(e.filter=this.current.transferMaps,e.drawImage(e.canvas,0,0),e.filter="none"),e.canvas}applyTransferMapsToBitmap(e){var t,i;return"none"===this.current.transferMaps?e.bitmap:({bitmap:e,width:t,height:i}=e,(i=(t=this.cachedCanvases.getCanvas("inlineImage",t,i)).context).filter=this.current.transferMaps,i.drawImage(e,0,0),i.filter="none",t.canvas)}paintInlineImageXObject(t){if(this.contentVisible){var i=t.width,n=t.height,r=this.ctx;if(this.save(),!w.isNodeJS){const t=r["filter"];"none"!==t&&""!==t&&(r.filter="none")}r.scale(1/i,-1/n);let e;if(t.bitmap)e=this.applyTransferMapsToBitmap(t);else if("function"==typeof HTMLElement&&t instanceof HTMLElement||!t.data)e=t;else{const w=this.cachedCanvases.getCanvas("inlineImage",i,n).context;o(w,t),e=this.applyTransferMapsToCanvas(w)}var s=this._scaleImage(e,(0,R.getCurrentTransformInverse)(r));r.imageSmoothingEnabled=b((0,R.getCurrentTransform)(r),t.interpolate),v(r,s.img,0,0,s.paintWidth,s.paintHeight,0,-n,i,n),this.compose(),this.restore()}}paintInlineImageXObjectGroup(t,i){if(this.contentVisible){const n=this.ctx;let e;if(t.bitmap)e=t.bitmap;else{const i=t.width,n=t.height,r=this.cachedCanvases.getCanvas("inlineImage",i,n).context;o(r,t),e=this.applyTransferMapsToCanvas(r)}for(const t of i)n.save(),n.transform(...t.transform),n.scale(1,-1),v(n,e,t.x,t.y,t.w,t.h,0,-1,1,1),n.restore();this.compose()}}paintSolidColorImageMask(){this.contentVisible&&(this.ctx.fillRect(0,0,1,1),this.compose())}markPoint(e){}markPointProps(e,t){}beginMarkedContent(e){this.markedContentStack.push({visible:!0})}beginMarkedContentProps(e,t){"OC"===e?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(t)}):this.markedContentStack.push({visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(){this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(){}endCompat(){}consumePath(e){var t=this.current.isEmptyClip(),e=(this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(e),this.ctx);this.pendingClip&&(t||(this.pendingClip===a?e.clip("evenodd"):e.clip()),this.pendingClip=null),this.current.startNewPathAndClipBox(this.current.clipBox),e.beginPath()}getSinglePixelWidth(){var e,t,i;return this._cachedGetSinglePixelWidth||(0===(i=(0,R.getCurrentTransform)(this.ctx))[1]&&0===i[2]?this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(i[0]),Math.abs(i[3])):(e=Math.abs(i[0]*i[3]-i[2]*i[1]),t=Math.hypot(i[0],i[2]),i=Math.hypot(i[1],i[3]),this._cachedGetSinglePixelWidth=Math.max(t,i)/e)),this._cachedGetSinglePixelWidth}getScaleForStroking(){if(-1===this._cachedScaleForStroking[0]){var i,n,r,s=this.current["lineWidth"],{a:o,b:a,c:l,d:h}=this.ctx.getTransform();let e,t;0===a&&0===l?(r=Math.abs(o))===(i=Math.abs(h))?e=t=0===s?1/r:(n=r*s)<1?1/n:1:t=0===s?(e=1/r,1/i):(n=r*s,r=i*s,e=n<1?1/n:1,r<1?1/r:1):(i=Math.abs(o*h-a*l),n=Math.hypot(o,a),r=Math.hypot(l,h),t=0===s?(e=r/i,n/i):(o=s*i,e=o<r?r/o:1,o<n?n/o:1)),this._cachedScaleForStroking[0]=e,this._cachedScaleForStroking[1]=t}return this._cachedScaleForStroking}rescaleAndStroke(t){var e=this["ctx"],i=this.current["lineWidth"],[n,r]=this.getScaleForStroking();if(e.lineWidth=i||1,1===n&&1===r)e.stroke();else{i=e.getLineDash();if(t&&e.save(),e.scale(n,r),0<i.length){const t=Math.max(n,r);e.setLineDash(i.map(e=>e/t)),e.lineDashOffset/=t}e.stroke(),t&&e.restore()}}isContentVisible(){for(let e=this.markedContentStack.length-1;0<=e;e--)if(!this.markedContentStack[e].visible)return!1;return!0}}t.CanvasGraphics=l;for(const e in w.OPS)void 0!==l.prototype[e]&&(l.prototype[w.OPS[e]]=l.prototype[e])},(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TilingPattern=t.PathType=void 0,t.getShadingPattern=function(e){switch(e[0]){case"RadialAxial":return new r(e);case"Mesh":return new s(e);case"Dummy":return new o}throw new Error("Unknown IR type: "+e[0])},i(2);var v=i(1),y=i(168);const h={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};function c(e,t){var i,n,r;t&&(i=t[2]-t[0],n=t[3]-t[1],(r=new Path2D).rect(t[0],t[1],i,n),e.clip(r))}t.PathType=h;class n{constructor(){this.constructor===n&&(0,v.unreachable)("Cannot initialize BaseShadingPattern.")}getPattern(){(0,v.unreachable)("Abstract method `getPattern` called.")}}class r extends n{constructor(e){super(),this._type=e[1],this._bbox=e[2],this._colorStops=e[3],this._p0=e[4],this._p1=e[5],this._r0=e[6],this._r1=e[7],this.matrix=null}_createGradient(e){let t;"axial"===this._type?t=e.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):"radial"===this._type&&(t=e.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));for(const e of this._colorStops)t.addColorStop(e[0],e[1]);return t}getPattern(e,t,i,n){let r;if(n===h.STROKE||n===h.FILL){const h=t.current.getClippedPathBoundingBox(n,(0,y.getCurrentTransform)(e))||[0,0,0,0],s=Math.ceil(h[2]-h[0])||1,o=Math.ceil(h[3]-h[1])||1,a=t.cachedCanvases.getCanvas("pattern",s,o,!0),l=a.context;l.clearRect(0,0,l.canvas.width,l.canvas.height),l.beginPath(),l.rect(0,0,l.canvas.width,l.canvas.height),l.translate(-h[0],-h[1]),i=v.Util.transform(i,[1,0,0,1,h[0],h[1]]),l.transform(...t.baseTransform),this.matrix&&l.transform(...this.matrix),c(l,this._bbox),l.fillStyle=this._createGradient(l),l.fill(),r=e.createPattern(a.canvas,"no-repeat");n=new DOMMatrix(i);r.setTransform(n)}else c(e,this._bbox),r=this._createGradient(e);return r}}function b(t,d,u,p,e,i,m,g){var n=d.coords,f=d.colors,v=t.data,y=4*t.width;let r;n[u+1]>n[p+1]&&(r=u,u=p,p=r,r=i,i=m,m=r),n[p+1]>n[e+1]&&(r=p,p=e,e=r,r=m,m=g,g=r),n[u+1]>n[p+1]&&(r=u,u=p,p=r,r=i,i=m,m=r);var b=(n[u]+d.offsetX)*d.scaleX,w=(n[u+1]+d.offsetY)*d.scaleY,x=(n[p]+d.offsetX)*d.scaleX,S=(n[p+1]+d.offsetY)*d.scaleY,A=(n[e]+d.offsetX)*d.scaleX,k=(n[e+1]+d.offsetY)*d.scaleY;if(!(k<=w)){var _=f[i],C=f[i+1],T=f[i+2],E=f[m],M=f[m+1],R=f[m+2],$=f[g],L=f[g+1],I=f[g+2],t=Math.round(w),F=Math.round(k);let n,r,s,o,a,l,h,c;for(let e=t;e<=F;e++){if(e<S){const d=e<w?0:(w-e)/(w-S);n=b-(b-x)*d,r=_-(_-E)*d,s=C-(C-M)*d,o=T-(T-R)*d}else{var P=e>k?1:S==k?0:(S-e)/(S-k);n=x-(x-A)*P,r=E-(E-$)*P,s=M-(M-L)*P,o=R-(R-I)*P}let t;a=b-(b-A)*(t=e<w?0:e>k?1:(w-e)/(w-k)),l=_-(_-$)*t,h=C-(C-L)*t,c=T-(T-I)*t;const u=Math.round(Math.min(n,a)),p=Math.round(Math.max(n,a));let i=y*e+4*u;for(let e=u;e<=p;e++)(t=(n-e)/(n-a))<0?t=0:1<t&&(t=1),v[i++]=r-(r-l)*t|0,v[i++]=s-(s-h)*t|0,v[i++]=o-(o-c)*t|0,v[i++]=255}}}class s extends n{constructor(e){super(),this._coords=e[2],this._colors=e[3],this._figures=e[4],this._bounds=e[5],this._bbox=e[7],this._background=e[8],this.matrix=null}_createMeshCanvas(i,n,e){var t=Math.floor(this._bounds[0]),r=Math.floor(this._bounds[1]),s=Math.ceil(this._bounds[2])-t,o=Math.ceil(this._bounds[3])-r,a=Math.min(Math.ceil(Math.abs(s*i[0]*1.1)),3e3),i=Math.min(Math.ceil(Math.abs(o*i[1]*1.1)),3e3),s=s/a,o=o/i,l={coords:this._coords,colors:this._colors,offsetX:-t,offsetY:-r,scaleX:1/s,scaleY:1/o},e=e.getCanvas("mesh",a+4,i+4,!1),h=e.context,c=h.createImageData(a,i);if(n){const i=c.data;for(let e=0,t=i.length;e<t;e+=4)i[e]=n[0],i[e+1]=n[1],i[e+2]=n[2],i[e+3]=255}for(const i of this._figures){d=void 0;u=void 0;p=void 0;m=void 0;g=void 0;f=void 0;v=void 0;y=void 0;var d=c;var u=i;var p=l;var m=u.coords,g=u.colors;let e,t;switch(u.type){case"lattice":var f=u.verticesPerRow,v=Math.floor(m.length/f)-1,y=f-1;for(e=0;e<v;e++){let t=e*f;for(let e=0;e<y;e++,t++)b(d,p,m[t],m[t+1],m[t+f],g[t],g[t+1],g[t+f]),b(d,p,m[t+f+1],m[t+1],m[t+f],g[t+f+1],g[t+1],g[t+f])}break;case"triangles":for(e=0,t=m.length;e<t;e+=3)b(d,p,m[e],m[e+1],m[e+2],g[e],g[e+1],g[e+2]);break;default:throw new Error("illegal figure")}}return h.putImageData(c,2,2),{canvas:e.canvas,offsetX:t-2*s,offsetY:r-2*o,scaleX:s,scaleY:o}}getPattern(e,t,i,n){c(e,this._bbox);let r;if(n===h.SHADING)r=v.Util.singularValueDecompose2dScale((0,y.getCurrentTransform)(e));else if(r=v.Util.singularValueDecompose2dScale(t.baseTransform),this.matrix){const e=v.Util.singularValueDecompose2dScale(this.matrix);r=[r[0]*e[0],r[1]*e[1]]}var s=this._createMeshCanvas(r,n===h.SHADING?null:this._background,t.cachedCanvases);return n!==h.SHADING&&(e.setTransform(...t.baseTransform),this.matrix)&&e.transform(...this.matrix),e.translate(s.offsetX,s.offsetY),e.scale(s.scaleX,s.scaleY),e.createPattern(s.canvas,"no-repeat")}}class o extends n{getPattern(){return"hotpink"}}t.TilingPattern=class a{static MAX_PATTERN_SIZE=3e3;constructor(e,t,i,n,r){this.operatorList=e[2],this.matrix=e[3]||[1,0,0,1,0,0],this.bbox=e[4],this.xstep=e[5],this.ystep=e[6],this.paintType=e[7],this.tilingType=e[8],this.color=t,this.ctx=i,this.canvasGraphicsFactory=n,this.baseTransform=r}createPatternCanvas(e){var t=this.operatorList,i=this.bbox,n=this.xstep,r=this.ystep,s=this.paintType,o=this.tilingType,a=this.color,l=this.canvasGraphicsFactory,o=((0,v.info)("TilingType: "+o),i[0]),h=i[1],c=i[2],i=i[3],d=v.Util.singularValueDecompose2dScale(this.matrix),u=v.Util.singularValueDecompose2dScale(this.baseTransform),d=[d[0]*u[0],d[1]*u[1]],u=this.getSizeAndScale(n,this.ctx.canvas.width,d[0]),n=this.getSizeAndScale(r,this.ctx.canvas.height,d[1]),d=(r=e.cachedCanvases.getCanvas("pattern",u.size,n.size,!0)).context;(l=l.createCanvasGraphics(d)).groupLevel=e.groupLevel,this.setFillAndStrokeStyleToContext(l,s,a);let p=o,m=h,g=c,f=i;return o<0&&(p=0,g+=Math.abs(o)),h<0&&(m=0,f+=Math.abs(h)),d.translate(-u.scale*p,-n.scale*m),l.transform(u.scale,0,0,n.scale,0,0),d.save(),this.clipBbox(l,p,m,g,f),l.baseTransform=(0,y.getCurrentTransform)(l.ctx),l.executeOperatorList(t),l.endDrawing(),{canvas:r.canvas,scaleX:u.scale,scaleY:n.scale,offsetX:p,offsetY:m}}getSizeAndScale(e,t,i){e=Math.abs(e),t=Math.max(a.MAX_PATTERN_SIZE,t);let n=Math.ceil(e*i);return n>=t?n=t:i=n/e,{scale:i,size:n}}clipBbox(e,t,i,n,r){e.ctx.rect(t,i,n-t,r-i),e.current.updateRectMinMax((0,y.getCurrentTransform)(e.ctx),[t,i,n,r]),e.clip(),e.endPath()}setFillAndStrokeStyleToContext(e,t,i){var n=e.ctx,r=e.current;switch(t){case 1:const e=this.ctx;n.fillStyle=e.fillStyle,n.strokeStyle=e.strokeStyle,r.fillColor=e.fillStyle,r.strokeColor=e.strokeStyle;break;case 2:var s=v.Util.makeHexColor(i[0],i[1],i[2]);n.fillStyle=s,n.strokeStyle=s,r.fillColor=s,r.strokeColor=s;break;default:throw new v.FormatError("Unsupported paint type: "+t)}}getPattern(e,t,i,n){let r=i,s=(n!==h.SHADING&&(r=v.Util.transform(r,t.baseTransform),this.matrix)&&(r=v.Util.transform(r,this.matrix)),i=this.createPatternCanvas(t),new DOMMatrix(r));return s=(s=s.translate(i.offsetX,i.offsetY)).scale(1/i.scaleX,1/i.scaleY),(n=e.createPattern(i.canvas,"repeat")).setTransform(s),n}}},(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.convertBlackAndWhiteToRGBA=n,t.convertToRGBA=function(t){switch(t.kind){case m.ImageKind.GRAYSCALE_1BPP:return n(t);case m.ImageKind.RGB_24BPP:{var o=t;let{src:i,srcPos:e=0,dest:n,destPos:r=0}=o,s=0;var a=i.length>>2,l=new Uint32Array(i.buffer,e,a);if(m.FeatureTest.isLittleEndian){for(;s<a-2;s+=3,r+=4){const o=l[s],e=l[s+1],t=l[s+2];n[r]=4278190080|o,n[r+1]=o>>>24|e<<8|4278190080,n[r+2]=e>>>16|t<<16|4278190080,n[r+3]=t>>>8|4278190080}for(let e=4*s,t=i.length;e<t;e+=3)n[r++]=i[e]|i[e+1]<<8|i[e+2]<<16|4278190080}else{for(;s<a-2;s+=3,r+=4){const o=l[s],e=l[s+1],t=l[s+2];n[r]=255|o,n[r+1]=o<<24|e>>>8|255,n[r+2]=e<<16|t>>>16|255,n[r+3]=t<<8|255}for(let e=4*s,t=i.length;e<t;e+=3)n[r++]=i[e]<<24|i[e+1]<<16|i[e+2]<<8|255}return{srcPos:e,destPos:r};return}}return null},t.grayToRGBA=function(i,n){if(m.FeatureTest.isLittleEndian)for(let e=0,t=i.length;e<t;e++)n[e]=65793*i[e]|4278190080;else for(let e=0,t=i.length;e<t;e++)n[e]=16843008*i[e]|255},i(93),i(101),i(102),i(105),i(107),i(109),i(113),i(116),i(123);var m=i(1);function n(t){let{src:i,srcPos:n=0,dest:r,width:e,height:s,nonBlackColor:o=4294967295,inverseDecode:a=!1}=t;var t=m.FeatureTest.isLittleEndian?4278190080:255,[l,h]=a?[o,t]:[t,o],c=e>>3,d=7&e,u=i.length;r=new Uint32Array(r.buffer);let p=0;for(let e=0;e<s;e++){for(const t=n+c;n<t;n++){const t=n<u?i[n]:255;r[p++]=128&t?h:l,r[p++]=64&t?h:l,r[p++]=32&t?h:l,r[p++]=16&t?h:l,r[p++]=8&t?h:l,r[p++]=4&t?h:l,r[p++]=2&t?h:l,r[p++]=1&t?h:l}if(0!=d){const t=n<u?i[n++]:255;for(let e=0;e<d;e++)r[p++]=t&1<<7-e?h:l}}return{srcPos:n,destPos:p}}},(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.GlobalWorkerOptions=void 0;var i=Object.create(null);(t.GlobalWorkerOptions=i).workerPort=null,i.workerSrc=""},(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MessageHandler=void 0,i(2);var h=i(1);function c(e){switch(e instanceof Error||"object"==typeof e&&null!==e||(0,h.unreachable)('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),e.name){case"AbortException":return new h.AbortException(e.message);case"MissingPDFException":return new h.MissingPDFException(e.message);case"PasswordException":return new h.PasswordException(e.message,e.code);case"UnexpectedResponseException":return new h.UnexpectedResponseException(e.message,e.status);case"UnknownErrorException":return new h.UnknownErrorException(e.message,e.details);default:return new h.UnknownErrorException(e.message,e.toString())}}t.MessageHandler=class{constructor(e,t,s){this.sourceName=e,this.targetName=t,this.comObj=s,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),this._onComObjOnMessage=t=>{const i=t.data;if(i.targetName===this.sourceName)if(i.stream)this.#de(i);else if(i.callback){const t=i.callbackId,s=this.callbackCapabilities[t];if(!s)throw new Error("Cannot resolve callback "+t);if(delete this.callbackCapabilities[t],1===i.callback)s.resolve(i.data);else{if(2!==i.callback)throw new Error("Unexpected callback case");s.reject(c(i.reason))}}else{const n=this.actionHandler[i.action];if(!n)throw new Error("Unknown action from worker: "+i.action);if(i.callbackId){const t=this.sourceName,r=i.sourceName;new Promise(function(e){e(n(i.data))}).then(function(e){s.postMessage({sourceName:t,targetName:r,callback:1,callbackId:i.callbackId,data:e})},function(e){s.postMessage({sourceName:t,targetName:r,callback:2,callbackId:i.callbackId,reason:c(e)})})}else i.streamId?this.#ue(i):n(i.data)}},s.addEventListener("message",this._onComObjOnMessage)}on(e,t){var i=this.actionHandler;if(i[e])throw new Error(`There is already an actionName called "${e}"`);i[e]=t}send(e,t,i){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,data:t},i)}sendWithPromise(e,t,i){var n=this.callbackId++,r=new h.PromiseCapability;this.callbackCapabilities[n]=r;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,callbackId:n,data:t},i)}catch(e){r.reject(e)}return r.promise}sendWithStream(i,n,e,r){const s=this.streamId++,o=this.sourceName,a=this.targetName,l=this.comObj;return new ReadableStream({start:e=>{var t=new h.PromiseCapability;return this.streamControllers[s]={controller:e,startCall:t,pullCall:null,cancelCall:null,isClosed:!1},l.postMessage({sourceName:o,targetName:a,action:i,streamId:s,data:n,desiredSize:e.desiredSize},r),t.promise},pull:e=>{var t=new h.PromiseCapability;return this.streamControllers[s].pullCall=t,l.postMessage({sourceName:o,targetName:a,stream:6,streamId:s,desiredSize:e.desiredSize}),t.promise},cancel:e=>{(0,h.assert)(e instanceof Error,"cancel must have a valid reason");var t=new h.PromiseCapability;return this.streamControllers[s].cancelCall=t,this.streamControllers[s].isClosed=!0,l.postMessage({sourceName:o,targetName:a,stream:1,streamId:s,reason:c(e)}),t.promise}},e)}#ue(t){const r=t.streamId,s=this.sourceName,o=t.sourceName,a=this.comObj,e=this,i=this.actionHandler[t.action],n={enqueue(e){var t,i=1<arguments.length&&void 0!==arguments[1]?arguments[1]:1,n=2<arguments.length?arguments[2]:void 0;this.isCancelled||(t=this.desiredSize,this.desiredSize-=i,0<t&&this.desiredSize<=0&&(this.sinkCapability=new h.PromiseCapability,this.ready=this.sinkCapability.promise),a.postMessage({sourceName:s,targetName:o,stream:4,streamId:r,chunk:e},n))},close(){this.isCancelled||(this.isCancelled=!0,a.postMessage({sourceName:s,targetName:o,stream:3,streamId:r}),delete e.streamSinks[r])},error(e){(0,h.assert)(e instanceof Error,"error must have a valid reason"),this.isCancelled||(this.isCancelled=!0,a.postMessage({sourceName:s,targetName:o,stream:5,streamId:r,reason:c(e)}))},sinkCapability:new h.PromiseCapability,onPull:null,onCancel:null,isCancelled:!1,desiredSize:t.desiredSize,ready:null};n.sinkCapability.resolve(),n.ready=n.sinkCapability.promise,this.streamSinks[r]=n,new Promise(function(e){e(i(t.data,n))}).then(function(){a.postMessage({sourceName:s,targetName:o,stream:8,streamId:r,success:!0})},function(e){a.postMessage({sourceName:s,targetName:o,stream:8,streamId:r,reason:c(e)})})}#de(t){const i=t.streamId,n=this.sourceName,r=t.sourceName,s=this.comObj,e=this.streamControllers[i],o=this.streamSinks[i];switch(t.stream){case 8:t.success?e.startCall.resolve():e.startCall.reject(c(t.reason));break;case 7:t.success?e.pullCall.resolve():e.pullCall.reject(c(t.reason));break;case 6:o?(o.desiredSize<=0&&0<t.desiredSize&&o.sinkCapability.resolve(),o.desiredSize=t.desiredSize,new Promise(function(e){e(o.onPull?.())}).then(function(){s.postMessage({sourceName:n,targetName:r,stream:7,streamId:i,success:!0})},function(e){s.postMessage({sourceName:n,targetName:r,stream:7,streamId:i,reason:c(e)})})):s.postMessage({sourceName:n,targetName:r,stream:7,streamId:i,success:!0});break;case 4:(0,h.assert)(e,"enqueue should have stream controller"),e.isClosed||e.controller.enqueue(t.chunk);break;case 3:(0,h.assert)(e,"close should have stream controller"),e.isClosed||(e.isClosed=!0,e.controller.close(),this.#pe(e,i));break;case 5:(0,h.assert)(e,"error should have stream controller"),e.controller.error(c(t.reason)),this.#pe(e,i);break;case 2:t.success?e.cancelCall.resolve():e.cancelCall.reject(c(t.reason)),this.#pe(e,i);break;case 1:o&&(new Promise(function(e){e(o.onCancel?.(c(t.reason)))}).then(function(){s.postMessage({sourceName:n,targetName:r,stream:2,streamId:i,success:!0})},function(e){s.postMessage({sourceName:n,targetName:r,stream:2,streamId:i,reason:c(e)})}),o.sinkCapability.reject(c(t.reason)),o.isCancelled=!0,delete this.streamSinks[i]);break;default:throw new Error("Unexpected stream case")}}async#pe(e,t){await Promise.allSettled([e.startCall?.promise,e.pullCall?.promise,e.cancelCall?.promise]),delete this.streamControllers[t]}destroy(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}},(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Metadata=void 0;var n=i(1);t.Metadata=class{#fe;#ge;constructor(e){var{parsedData:e,rawData:t}=e;this.#fe=e,this.#ge=t}getRaw(){return this.#ge}get(e){return this.#fe.get(e)??null}getAll(){return(0,n.objectFromMap)(this.#fe)}has(e){return this.#fe.has(e)}}},(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.OptionalContentConfig=void 0;var s=i(1),n=i(170);const r=Symbol("INTERNAL");class o{#me=!0;constructor(e,t){this.name=e,this.intent=t}get visible(){return this.#me}_setVisible(e,t){e!==r&&(0,s.unreachable)("Internal method `_setVisible` called."),this.#me=t}}t.OptionalContentConfig=class{#be=null;#ve=new Map;#ye=null;#_e=null;constructor(e){if(this.name=null,(this.creator=null)!==e){this.name=e.name,this.creator=e.creator,this.#_e=e.order;for(const t of e.groups)this.#ve.set(t.id,new o(t.name,t.intent));if("OFF"===e.baseState)for(const e of this.#ve.values())e._setVisible(r,!1);for(const i of e.on)this.#ve.get(i)._setVisible(r,!0);for(const n of e.off)this.#ve.get(n)._setVisible(r,!1);this.#ye=this.getHash()}}#Ae(i){const n=i.length;if(n<2)return!0;var r=i[0];for(let t=1;t<n;t++){const n=i[t];let e;if(Array.isArray(n))e=this.#Ae(n);else{if(!this.#ve.has(n))return(0,s.warn)("Optional content group not found: "+n),!0;e=this.#ve.get(n).visible}switch(r){case"And":if(e)break;return!1;case"Or":if(e)return!0;break;case"Not":return!e;default:return!0}}return"And"===r}isVisible(e){if(0!==this.#ve.size)if(e){if("OCG"===e.type)return this.#ve.has(e.id)?this.#ve.get(e.id).visible:((0,s.warn)("Optional content group not found: "+e.id),!0);if("OCMD"===e.type){if(e.expression)return this.#Ae(e.expression);if(!e.policy||"AnyOn"===e.policy){for(const t of e.ids){if(!this.#ve.has(t))return(0,s.warn)("Optional content group not found: "+t),!0;if(this.#ve.get(t).visible)return!0}return!1}if("AllOn"===e.policy)for(const i of e.ids){if(!this.#ve.has(i))return(0,s.warn)("Optional content group not found: "+i),!0;if(!this.#ve.get(i).visible)return!1}else{if("AnyOff"===e.policy){for(const n of e.ids){if(!this.#ve.has(n))return(0,s.warn)("Optional content group not found: "+n),!0;if(!this.#ve.get(n).visible)return!0}return!1}if("AllOff"===e.policy)for(const r of e.ids){if(!this.#ve.has(r))return(0,s.warn)("Optional content group not found: "+r),!0;if(this.#ve.get(r).visible)return!1}else(0,s.warn)(`Unknown optional content policy ${e.policy}.`)}}else(0,s.warn)(`Unknown group type ${e.type}.`)}else(0,s.warn)("Optional content group not defined.");return!0}setVisibility(e){var t=!(1<arguments.length&&void 0!==arguments[1])||arguments[1];this.#ve.has(e)?(this.#ve.get(e)._setVisible(r,!!t),this.#be=null):(0,s.warn)("Optional content group not found: "+e)}get hasInitialVisibility(){return null===this.#ye||this.getHash()===this.#ye}getOrder(){return this.#ve.size?this.#_e?this.#_e.slice():[...this.#ve.keys()]:null}getGroups(){return 0<this.#ve.size?(0,s.objectFromMap)(this.#ve):null}getGroup(e){return this.#ve.get(e)||null}getHash(){if(null!==this.#be)return this.#be;var e,t,i=new n.MurmurHash3_64;for([e,t]of this.#ve)i.update(e+":"+t.visible);return this.#be=i.hexdigest()}}},(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PDFDataTransportStream=void 0,i(93),i(101),i(102),i(105),i(107),i(109),i(113),i(116),i(123),i(89);var a=i(1),r=i(168);t.PDFDataTransportStream=class{constructor(e,t){var{length:e,initialData:i,progressiveDone:n=!1,contentDispositionFilename:r=null,disableRange:s=!1,disableStream:o=!1}=e;if((0,a.assert)(t,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.'),this._queuedChunks=[],this._progressiveDone=n,this._contentDispositionFilename=r,0<i?.length){const e=(i instanceof Uint8Array&&i.byteLength===i.buffer.byteLength?i:new Uint8Array(i)).buffer;this._queuedChunks.push(e)}this._pdfDataRangeTransport=t,this._isStreamingSupported=!o,this._isRangeSupported=!s,this._contentLength=e,this._fullRequestReader=null,this._rangeReaders=[],this._pdfDataRangeTransport.addRangeListener((e,t)=>{this._onReceiveData({begin:e,chunk:t})}),this._pdfDataRangeTransport.addProgressListener((e,t)=>{this._onProgress({loaded:e,total:t})}),this._pdfDataRangeTransport.addProgressiveReadListener(e=>{this._onReceiveData({chunk:e})}),this._pdfDataRangeTransport.addProgressiveDoneListener(()=>{this._onProgressiveDone()}),this._pdfDataRangeTransport.transportReady()}_onReceiveData(e){let{begin:t,chunk:i}=e;const n=(i instanceof Uint8Array&&i.byteLength===i.buffer.byteLength?i:new Uint8Array(i)).buffer;if(void 0===t)this._fullRequestReader?this._fullRequestReader._enqueue(n):this._queuedChunks.push(n);else{const e=this._rangeReaders.some(function(e){return e._begin===t&&(e._enqueue(n),!0)});(0,a.assert)(e,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}_onProgress(e){void 0===e.total?this._rangeReaders[0]?.onProgress?.({loaded:e.loaded}):this._fullRequestReader?.onProgress?.({loaded:e.loaded,total:e.total})}_onProgressiveDone(){this._fullRequestReader?.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(e){e=this._rangeReaders.indexOf(e);0<=e&&this._rangeReaders.splice(e,1)}getFullReader(){(0,a.assert)(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");var e=this._queuedChunks;return this._queuedChunks=null,new n(this,e,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(e,t){var i;return t<=this._progressiveDataLength?null:(i=new s(this,e,t),this._pdfDataRangeTransport.requestDataRange(e,t),this._rangeReaders.push(i),i)}cancelAllRequests(e){this._fullRequestReader?.cancel(e);for(const t of this._rangeReaders.slice(0))t.cancel(e);this._pdfDataRangeTransport.abort()}};class n{constructor(e,t){var i=2<arguments.length&&void 0!==arguments[2]&&arguments[2],n=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;this._stream=e,this._done=i||!1,this._filename=(0,r.isPdfFile)(n)?n:null,this._queuedChunks=t||[],this._loaded=0;for(const e of this._queuedChunks)this._loaded+=e.byteLength;this._requests=[],this._headersReady=Promise.resolve(),(e._fullRequestReader=this).onProgress=null}_enqueue(e){this._done||(0<this._requests.length?this._requests.shift().resolve({value:e,done:!1}):this._queuedChunks.push(e),this._loaded+=e.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}async read(){var e;return 0<this._queuedChunks.length?{value:this._queuedChunks.shift(),done:!1}:this._done?{value:void 0,done:!0}:(e=new a.PromiseCapability,this._requests.push(e),e.promise)}cancel(e){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 s{constructor(e,t,i){this._stream=e,this._begin=t,this._end=i,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(e){if(!this._done){if(0===this._requests.length)this._queuedChunk=e;else{this._requests.shift().resolve({value:e,done:!1});for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0}this._done=!0,this._stream._removeRangeReader(this)}}get isStreamingSupported(){return!1}async read(){if(this._queuedChunk){const e=this._queuedChunk;return this._queuedChunk=null,{value:e,done:!1}}if(this._done)return{value:void 0,done:!0};const e=new a.PromiseCapability;return this._requests.push(e),e.promise}cancel(e){this._done=!0;for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}}},(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PDFFetchStream=void 0,i(93),i(101),i(102),i(105),i(107),i(109),i(113),i(116),i(123),i(89);var s=i(1),o=i(182);function a(e,t,i){return{method:"GET",headers:e,signal:i.signal,mode:"cors",credentials:t?"include":"same-origin",redirect:"follow"}}function l(e){var t=new Headers;for(const n in e){var i=e[n];void 0!==i&&t.append(n,i)}return t}function n(e){return e instanceof Uint8Array?e.buffer:e instanceof ArrayBuffer?e:((0,s.warn)("getArrayBuffer - unexpected data format: "+e),new Uint8Array(e).buffer)}t.PDFFetchStream=class{constructor(e){this.source=e,this.isHttp=/^https?:/i.test(e.url),this.httpHeaders=this.isHttp&&e.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return(0,s.assert)(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new r(this),this._fullRequestReader}getRangeReader(e,t){return t<=this._progressiveDataLength?null:(e=new h(this,e,t),this._rangeRequestReaders.push(e),e)}cancelAllRequests(e){this._fullRequestReader?.cancel(e);for(const t of this._rangeRequestReaders.slice(0))t.cancel(e)}};class r{constructor(e){this._stream=e,this._reader=null,this._loaded=0,this._filename=null;e=e.source;this._withCredentials=e.withCredentials||!1,this._contentLength=e.length,this._headersCapability=new s.PromiseCapability,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,this._headers=l(this._stream.httpHeaders);const r=e.url;fetch(r,a(this._headers,this._withCredentials,this._abortController)).then(t=>{if(!(0,o.validateResponseStatus)(t.status))throw(0,o.createResponseStatusError)(t.status,r);this._reader=t.body.getReader(),this._headersCapability.resolve();var e=e=>t.headers.get(e),{allowRangeRequests:i,suggestedLength:n}=(0,o.validateRangeRequestCapabilities)({getResponseHeader:e,isHttp:this._stream.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=i,this._contentLength=n||this._contentLength,this._filename=(0,o.extractFilenameFromHeader)(e),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new s.AbortException("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}async read(){await this._headersCapability.promise;var{value:e,done:t}=await this._reader.read();return t?{value:e,done:t}:(this._loaded+=e.byteLength,this.onProgress?.({loaded:this._loaded,total:this._contentLength}),{value:n(e),done:!1})}cancel(e){this._reader?.cancel(e),this._abortController.abort()}}class h{constructor(e,t,i){this._stream=e,this._reader=null,this._loaded=0;e=e.source;this._withCredentials=e.withCredentials||!1,this._readCapability=new s.PromiseCapability,this._isStreamingSupported=!e.disableStream,this._abortController=new AbortController,this._headers=l(this._stream.httpHeaders),this._headers.append("Range",`bytes=${t}-`+(i-1));const n=e.url;fetch(n,a(this._headers,this._withCredentials,this._abortController)).then(e=>{if(!(0,o.validateResponseStatus)(e.status))throw(0,o.createResponseStatusError)(e.status,n);this._readCapability.resolve(),this._reader=e.body.getReader()}).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._readCapability.promise;var{value:e,done:t}=await this._reader.read();return t?{value:e,done:t}:(this._loaded+=e.byteLength,this.onProgress?.({loaded:this._loaded}),{value:n(e),done:!1})}cancel(e){this._reader?.cancel(e),this._abortController.abort()}}},(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createResponseStatusError=function(e,t){return 404===e||0===e&&t.startsWith("file:")?new n.MissingPDFException('Missing PDF "'+t+'".'):new n.UnexpectedResponseException(`Unexpected server response (${e}) while retrieving PDF "${t}".`,e)},t.extractFilenameFromHeader=function(t){t=t("Content-Disposition");if(t){let e=(0,r.getFilenameFromContentDispositionHeader)(t);if(e.includes("%"))try{e=decodeURIComponent(e)}catch{}if((0,s.isPdfFile)(e))return e}return null},t.validateRangeRequestCapabilities=function(e){var{getResponseHeader:e,isHttp:t,rangeChunkSize:i,disableRange:n}=e,r={allowRangeRequests:!1,suggestedLength:void 0},s=parseInt(e("Content-Length"),10);return!Number.isInteger(s)||(r.suggestedLength=s)<=2*i||!n&&t&&"bytes"===e("Accept-Ranges")&&"identity"===(e("Content-Encoding")||"identity")&&(r.allowRangeRequests=!0),r},t.validateResponseStatus=function(e){return 200===e||206===e};var n=i(1),r=i(183),s=i(168)},(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getFilenameFromContentDispositionHeader=function(e){let r=!0,t=a("filename\\*","i").exec(e);var i;return t?(i=l(t=t[1]),n(i=o(i=h(i=unescape(i))))):(t=function(e){for(var n=[],t=a("filename\\*((?!0\\d)\\d+)(\\*?)","ig");null!==(i=t.exec(e));){var[,i,r,s]=i;if((i=parseInt(i,10))in n){if(0===i)break}else n[i]=[r,s]}var o=[];for(let i=0;i<n.length&&i in n;++i){let[e,t]=n[i];t=l(t),e&&(t=unescape(t),0===i)&&(t=h(t)),o.push(t)}return o.join("")}(e))?n(o(t)):(t=a("filename","i").exec(e))?n(o(l(t=t[1]))):"";function a(e,t){return new RegExp("(?:^|;)\\s*"+e+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',t)}function s(e,t){if(e){if(!/^[\x00-\xFF]+$/.test(t))return t;try{var i=new TextDecoder(e,{fatal:!0}),n=(0,c.stringToBytes)(t);t=i.decode(n),r=!1}catch{}}return t}function n(e){return e=r&&/[\x80-\xff]/.test(e)&&(e=s("utf-8",e),r)?s("iso-8859-1",e):e}function l(e){if(e.startsWith('"')){var t=e.slice(1).split('\\"');for(let e=0;e<t.length;++e){var i=t[e].indexOf('"');-1!==i&&(t[e]=t[e].slice(0,i),t.length=e+1),t[e]=t[e].replaceAll(/\\(.)/g,"$1")}e=t.join('"')}return e}function h(e){var t=e.indexOf("'");return-1===t?e:s(e.slice(0,t),e.slice(t+1).replace(/^[^']*'/,""))}function o(e){return!e.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(e)?e:e.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,function(e,t,i,n){if("q"===i||"Q"===i)return s(t,n=(n=n.replaceAll("_"," ")).replaceAll(/=([0-9a-fA-F]{2})/g,function(e,t){return String.fromCharCode(parseInt(t,16))}));try{n=atob(n)}catch{}return s(t,n)})}},i(89),i(149);var c=i(1)},(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PDFNetworkStream=void 0,i(89);var s=i(1),o=i(182);class n{constructor(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};this.url=e,this.isHttp=/^https?:/i.test(e),this.httpHeaders=this.isHttp&&t.httpHeaders||Object.create(null),this.withCredentials=t.withCredentials||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}requestRange(e,t,i){var n={begin:e,end:t};for(const e in i)n[e]=i[e];return this.request(n)}requestFull(e){return this.request(e)}request(t){const i=new XMLHttpRequest,e=this.currXhrId++,n=this.pendingRequests[e]={xhr:i};i.open("GET",this.url),i.withCredentials=this.withCredentials;for(const t in this.httpHeaders){const e=this.httpHeaders[t];void 0!==e&&i.setRequestHeader(t,e)}return this.isHttp&&"begin"in t&&"end"in t?(i.setRequestHeader("Range",`bytes=${t.begin}-`+(t.end-1)),n.expectedStatus=206):n.expectedStatus=200,i.responseType="arraybuffer",t.onError&&(i.onerror=function(e){t.onError(i.status)}),i.onreadystatechange=this.onStateChange.bind(this,e),i.onprogress=this.onProgress.bind(this,e),n.onHeadersReceived=t.onHeadersReceived,n.onDone=t.onDone,n.onError=t.onError,n.onProgress=t.onProgress,i.send(null),e}onProgress(e,t){e=this.pendingRequests[e];e&&e.onProgress?.(t)}onStateChange(e,t){var i=this.pendingRequests[e];if(i){var n=i.xhr;if(2<=n.readyState&&i.onHeadersReceived&&(i.onHeadersReceived(),delete i.onHeadersReceived),4===n.readyState&&e in this.pendingRequests)if(delete this.pendingRequests[e],0===n.status&&this.isHttp)i.onError?.(n.status);else{e=n.status||200;if(200===e&&206===i.expectedStatus||e===i.expectedStatus){var r=function(e){e=e.response;return"string"!=typeof e?e:(0,s.stringToBytes)(e).buffer}(n);if(206===e){const e=n.getResponseHeader("Content-Range"),t=/bytes (\d+)-(\d+)\/(\d+)/.exec(e);i.onDone({begin:parseInt(t[1],10),chunk:r})}else r?i.onDone({begin:0,chunk:r}):i.onError?.(n.status)}else i.onError?.(n.status)}}}getRequestXhr(e){return this.pendingRequests[e].xhr}isPendingRequest(e){return e in this.pendingRequests}abortRequest(e){var t=this.pendingRequests[e].xhr;delete this.pendingRequests[e],t.abort()}}t.PDFNetworkStream=class{constructor(e){this._source=e,this._manager=new n(e.url,{httpHeaders:e.httpHeaders,withCredentials:e.withCredentials}),this._rangeChunkSize=e.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(e){e=this._rangeRequestReaders.indexOf(e);0<=e&&this._rangeRequestReaders.splice(e,1)}getFullReader(){return(0,s.assert)(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new r(this._manager,this._source),this._fullRequestReader}getRangeReader(e,t){e=new a(this._manager,e,t);return e.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(e),e}cancelAllRequests(e){this._fullRequestReader?.cancel(e);for(const t of this._rangeRequestReaders.slice(0))t.cancel(e)}};class r{constructor(e,t){this._manager=e;var i={onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=t.url,this._fullRequestId=e.requestFull(i),this._headersReceivedCapability=new s.PromiseCapability,this._disableRange=t.disableRange||!1,this._contentLength=t.length,this._rangeChunkSize=t.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 e=this._fullRequestId,t=this._manager.getRequestXhr(e),i=e=>t.getResponseHeader(e),{allowRangeRequests:n,suggestedLength:r}=(0,o.validateRangeRequestCapabilities)({getResponseHeader:i,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});n&&(this._isRangeSupported=!0),this._contentLength=r||this._contentLength,this._filename=(0,o.extractFilenameFromHeader)(i),this._isRangeSupported&&this._manager.abortRequest(e),this._headersReceivedCapability.resolve()}_onDone(e){if(e&&(0<this._requests.length?this._requests.shift().resolve({value:e.chunk,done:!1}):this._cachedChunks.push(e.chunk)),this._done=!0,!(0<this._cachedChunks.length)){for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(e){this._storedError=(0,o.createResponseStatusError)(e,this._url),this._headersReceivedCapability.reject(this._storedError);for(const e of this._requests)e.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(e){this.onProgress?.({loaded:e.loaded,total:e.lengthComputable?e.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._headersReceivedCapability.promise}async read(){if(this._storedError)throw this._storedError;var e;return 0<this._cachedChunks.length?{value:this._cachedChunks.shift(),done:!1}:this._done?{value:void 0,done:!0}:(e=new s.PromiseCapability,this._requests.push(e),e.promise)}cancel(e){this._done=!0,this._headersReceivedCapability.reject(e);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 a{constructor(e,t,i){this._manager=e;var n={onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=e.url,this._requestId=e.requestRange(t,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(e){e=e.chunk;0<this._requests.length?this._requests.shift().resolve({value:e,done:!1}):this._queuedChunk=e,this._done=!0;for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(e){this._storedError=(0,o.createResponseStatusError)(e,this._url);for(const e of this._requests)e.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(e){this.isStreamingSupported||this.onProgress?.({loaded:e.loaded})}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;if(null!==this._queuedChunk){const e=this._queuedChunk;return this._queuedChunk=null,{value:e,done:!1}}if(this._done)return{value:void 0,done:!0};const e=new s.PromiseCapability;return this._requests.push(e),e.promise}cancel(e){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()}}},(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PDFNodeStream=void 0,i(89),i(93),i(101),i(102),i(105),i(107),i(109),i(113),i(116),i(123);var r=i(1),s=i(182);const o=/^file:\/\/\/[a-zA-Z]:\//;t.PDFNodeStream=class{constructor(e){this.source=e,this.url=function(e){var t=require("url"),i=t.parse(e);if("file:"!==i.protocol&&!i.host){if(/^[a-z]:[/\\]/i.test(e))return t.parse("file:///"+e);i.host||(i.protocol="file:")}return i}(e.url),this.isHttp="http:"===this.url.protocol||"https:"===this.url.protocol,this.isFsUrl="file:"===this.url.protocol,this.httpHeaders=this.isHttp&&e.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return(0,r.assert)(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=new(this.isFsUrl?d:h)(this),this._fullRequestReader}getRangeReader(e,t){return t<=this._progressiveDataLength?null:(e=new(this.isFsUrl?u:c)(this,e,t),this._rangeRequestReaders.push(e),e)}cancelAllRequests(e){this._fullRequestReader?.cancel(e);for(const t of this._rangeRequestReaders.slice(0))t.cancel(e)}};class n{constructor(e){this._url=e.url,this._done=!1,this._storedError=null,this.onProgress=null;e=e.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=new r.PromiseCapability,this._headersCapability=new r.PromiseCapability}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}async read(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;var e=this._readableStream.read();return null===e?(this._readCapability=new r.PromiseCapability,this.read()):(this._loaded+=e.length,this.onProgress?.({loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(e).buffer,done:!1})}cancel(e){this._readableStream?this._readableStream.destroy(e):this._error(e)}_error(e){this._storedError=e,this._readCapability.resolve()}_setReadableStream(e){(this._readableStream=e).on("readable",()=>{this._readCapability.resolve()}),e.on("end",()=>{e.destroy(),this._done=!0,this._readCapability.resolve()}),e.on("error",e=>{this._error(e)}),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new r.AbortException("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class a{constructor(e){this._url=e.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=new r.PromiseCapability;e=e.source;this._isStreamingSupported=!e.disableStream}get isStreamingSupported(){return this._isStreamingSupported}async read(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;var e=this._readableStream.read();return null===e?(this._readCapability=new r.PromiseCapability,this.read()):(this._loaded+=e.length,this.onProgress?.({loaded:this._loaded}),{value:new Uint8Array(e).buffer,done:!1})}cancel(e){this._readableStream?this._readableStream.destroy(e):this._error(e)}_error(e){this._storedError=e,this._readCapability.resolve()}_setReadableStream(e){(this._readableStream=e).on("readable",()=>{this._readCapability.resolve()}),e.on("end",()=>{e.destroy(),this._done=!0,this._readCapability.resolve()}),e.on("error",e=>{this._error(e)}),this._storedError&&this._readableStream.destroy(this._storedError)}}function l(e,t){return{protocol:e.protocol,auth:e.auth,host:e.hostname,port:e.port,path:e.path,method:"GET",headers:t}}class h extends n{constructor(n){super(n);var e,t=e=>{if(404===e.statusCode){const n=new r.MissingPDFException(`Missing PDF "${this._url}".`);this._storedError=n,void this._headersCapability.reject(n)}else{this._headersCapability.resolve(),this._setReadableStream(e);var e=e=>this._readableStream.headers[e.toLowerCase()],{allowRangeRequests:t,suggestedLength:i}=(0,s.validateRangeRequestCapabilities)({getResponseHeader:e,isHttp:n.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=t,this._contentLength=i||this._contentLength,this._filename=(0,s.extractFilenameFromHeader)(e)}};this._request=null,"http:"===this._url.protocol?(e=require("http"),this._request=e.request(l(this._url,n.httpHeaders),t)):(e=require("https"),this._request=e.request(l(this._url,n.httpHeaders),t)),this._request.on("error",e=>{this._storedError=e,this._headersCapability.reject(e)}),this._request.end()}}class c extends a{constructor(e,t,i){super(e),this._httpHeaders={};for(const t in e.httpHeaders){const i=e.httpHeaders[t];void 0!==i&&(this._httpHeaders[t]=i)}this._httpHeaders.Range=`bytes=${t}-`+(i-1);t=e=>{if(404!==e.statusCode)this._setReadableStream(e);else{const e=new r.MissingPDFException(`Missing PDF "${this._url}".`);this._storedError=e}};if(this._request=null,"http:"===this._url.protocol){const e=require("http");this._request=e.request(l(this._url,this._httpHeaders),t)}else{const e=require("https");this._request=e.request(l(this._url,this._httpHeaders),t)}this._request.on("error",e=>{this._storedError=e}),this._request.end()}}class d extends n{constructor(e){super(e);let i=decodeURIComponent(this._url.path);o.test(this._url.href)&&(i=i.replace(/^\//,""));const n=require("fs");n.lstat(i,(e,t)=>{e?("ENOENT"===e.code&&(e=new r.MissingPDFException(`Missing PDF "${i}".`)),this._storedError=e,this._headersCapability.reject(e)):(this._contentLength=t.size,this._setReadableStream(n.createReadStream(i)),this._headersCapability.resolve())})}}class u extends a{constructor(e,t,i){super(e);let n=decodeURIComponent(this._url.path);o.test(this._url.href)&&(n=n.replace(/^\//,""));e=require("fs");this._setReadableStream(e.createReadStream(n,{start:t,end:i-1}))}}},(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SVGGraphics=void 0,i(84),i(86),i(87),i(93),i(101),i(102),i(105),i(107),i(109),i(113),i(116),i(123),i(2),i(89),i(187);var n=i(168),v=i(1);function y(i){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"";if(URL.createObjectURL&&"undefined"!=typeof Blob&&!(2<arguments.length&&void 0!==arguments[2]&&arguments[2]))return URL.createObjectURL(new Blob([i],{type:e}));var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let r=`data:${e};base64,`;for(let e=0,t=i.length;e<t;e+=3){var s=255&i[e],o=255&i[e+1],a=255&i[e+2];r+=n[s>>2]+n[(3&s)<<4|o>>4]+n[e+1<t?(15&o)<<2|a>>6:64]+n[e+2<t?63&a:64]}return r}const r=["butt","round","square"],s=["miter","round","bevel"],o=function(){const m=new Uint8Array([137,80,78,71,13,10,26,10]),o=new Int32Array(256);for(let e=0;e<256;e++){let t=e;for(let e=0;e<8;e++)t=1&t?3988292384^t>>1&2147483647:t>>1&2147483647;o[e]=t}function g(e,t,i,n){var r=n,s=t.length,s=(i[r]=s>>24&255,i[r+1]=s>>16&255,i[r+2]=s>>8&255,i[r+3]=255&s,i[r+=4]=255&e.charCodeAt(0),i[r+1]=255&e.charCodeAt(1),i[r+2]=255&e.charCodeAt(2),i[r+3]=255&e.charCodeAt(3),i.set(t,r+=4),function(t,i,n){let r=-1;for(let e=i;e<n;e++){const i=255&(r^t[e]);r=r>>>8^o[i]}return-1^r}(i,n+4,r+=t.length));i[r]=s>>24&255,i[r+1]=s>>16&255,i[r+2]=s>>8&255,i[r+3]=255&s}function f(e){let t=e.length;var i=65535,n=Math.ceil(t/i),r=new Uint8Array(2+t+5*n+4);let s=0,o=(r[s++]=120,r[s++]=156,0);for(;t>i;)r[s++]=0,r[s++]=255,r[s++]=255,r[s++]=0,r[s++]=0,r.set(e.subarray(o,o+i),s),s+=i,o+=i,t-=i;r[s++]=1,r[s++]=255&t,r[s++]=t>>8&255,r[s++]=255&~t,r[s++]=(65535&~t)>>8&255,r.set(e.subarray(o),s),s+=e.length-o;n=function(t,i,n){let r=1,s=0;for(let e=i;e<n;++e)r=(r+(255&t[e]))%65521,s=(s+r)%65521;return s<<16|r}(e,0,e.length);return r[s++]=n>>24&255,r[s++]=n>>16&255,r[s++]=n>>8&255,r[s++]=255&n,r}return function(s,o,a){{var l=s,h=(s=void 0===s.kind?v.ImageKind.GRAYSCALE_1BPP:s.kind,l.width),c=l.height;let e,t,i;var d=l.data;switch(s){case v.ImageKind.GRAYSCALE_1BPP:t=0,e=1,i=h+7>>3;break;case v.ImageKind.RGB_24BPP:t=2,e=8,i=3*h;break;case v.ImageKind.RGBA_32BPP:t=6,e=8,i=4*h;break;default:throw new Error("invalid format")}var u=new Uint8Array((1+i)*c);let n=0,r=0;for(let e=0;e<c;++e)u[n++]=0,u.set(d.subarray(r,r+i),n),r+=i,n+=i;if(s===v.ImageKind.GRAYSCALE_1BPP&&a)for(let e=n=0;e<c;e++){n++;for(let e=0;e<i;e++)u[n++]^=255}var l=new Uint8Array([h>>24&255,h>>16&255,h>>8&255,255&h,c>>24&255,c>>16&255,c>>8&255,255&c,e,t,0,0,0]),s=function(e){if(v.isNodeJS)try{var t=8<=parseInt(process.versions.node)?e:Buffer.from(e),i=require("zlib").deflateSync(t,{level:9});return i instanceof Uint8Array?i:new Uint8Array(i)}catch(e){(0,v.warn)("Not compressing PNG because zlib.deflateSync is unavailable: "+e)}return f(e)}(u),a=m.length+36+l.length+s.length,a=new Uint8Array(a),p=0;return a.set(m,0),g("IHDR",l,a,p+=m.length),g("IDATA",s,a,p+=12+l.length),p+=12+s.length,g("IEND",new Uint8Array(0),a,p),y(a,"image/png",o)}}}();class a{constructor(){this.fontSizeScale=1,this.fontWeight="normal",this.fontSize=0,this.textMatrix=v.IDENTITY_MATRIX,this.fontMatrix=v.FONT_IDENTITY_MATRIX,this.leading=0,this.textRenderingMode=v.TextRenderingMode.FILL,this.textMatrixScale=1,this.x=0,this.y=0,this.lineX=0,this.lineY=0,this.charSpacing=0,this.wordSpacing=0,this.textHScale=1,this.textRise=0,this.fillColor="#000000",this.strokeColor="#000000",this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.lineJoin="",this.lineCap="",this.miterLimit=0,this.dashArray=[],this.dashPhase=0,this.dependencies=[],this.activeClipUrl=null,this.clipGroup=null,this.maskId=""}clone(){return Object.create(this)}setCurrentPoint(e,t){this.x=e,this.y=t}}function b(e){if(Number.isInteger(e))return e.toString();var t=e.toFixed(10);let i=t.length-1;if("0"!==t[i])return t;for(;"0"===t[--i];);return t.substring(0,"."===t[i]?i:i+1)}function w(e){if(0===e[4]&&0===e[5]){if(0===e[1]&&0===e[2])return 1===e[0]&&1===e[3]?"":`scale(${b(e[0])} ${b(e[3])})`;if(e[0]===e[3]&&e[1]===-e[2])return`rotate(${b(180*Math.acos(e[0])/Math.PI)})`}else if(1===e[0]&&0===e[1]&&0===e[2]&&1===e[3])return`translate(${b(e[4])} ${b(e[5])})`;return`matrix(${b(e[0])} ${b(e[1])} ${b(e[2])} ${b(e[3])} ${b(e[4])} ${b(e[5])})`}let l=0,h=0,m=0;t.SVGGraphics=class{constructor(e,t){var i=2<arguments.length&&void 0!==arguments[2]&&arguments[2];(0,n.deprecated)("The SVG back-end is no longer maintained and *may* be removed in the future."),this.svgFactory=new n.DOMSVGFactory,this.current=new a,this.transformMatrix=v.IDENTITY_MATRIX,this.transformStack=[],this.extraStack=[],this.commonObjs=e,this.objs=t,this.pendingClip=null,this.pendingEOFill=!1,this.embedFonts=!1,this.embeddedFonts=Object.create(null),this.cssStyle=null,this.forceDataSchema=!!i,this._operatorIdMapping=[];for(const e in v.OPS)this._operatorIdMapping[v.OPS[e]]=e}getObject(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null;return"string"==typeof e?(e.startsWith("g_")?this.commonObjs:this.objs).get(e):t}save(){this.transformStack.push(this.transformMatrix);var e=this.current;this.extraStack.push(e),this.current=e.clone()}restore(){this.transformMatrix=this.transformStack.pop(),this.current=this.extraStack.pop(),this.pendingClip=null,this.tgrp=null}group(e){this.save(),this.executeOpTree(e),this.restore()}loadDependencies(i){const n=i.fnArray,r=i.argsArray;for(let e=0,t=n.length;e<t;e++)if(n[e]===v.OPS.dependency)for(const n of r[e]){const i=n.startsWith("g_")?this.commonObjs:this.objs,r=new Promise(e=>{i.get(n,e)});this.current.dependencies.push(r)}return Promise.all(this.current.dependencies)}transform(e,t,i,n,r,s){this.transformMatrix=v.Util.transform(this.transformMatrix,[e,t,i,n,r,s]),this.tgrp=null}getSVG(e,t){this.viewport=t;const i=this._initialize(t);return this.loadDependencies(e).then(()=>(this.transformMatrix=v.IDENTITY_MATRIX,this.executeOpTree(this.convertOpList(e)),i))}convertOpList(t){var i=this._operatorIdMapping,n=t.argsArray,r=t.fnArray,s=[];for(let e=0,t=r.length;e<t;e++){var o=r[e];s.push({fnId:o,fn:i[o],args:n[e]})}{let e=[];var a=[];for(const l of t=s)"save"!==l.fn?"restore"===l.fn?e=a.pop():e.push(l):(e.push({fnId:92,fn:"group",items:[]}),a.push(e),e=e.at(-1).items);return e}}executeOpTree(e){for(const t of e){const e=t.fn,i=t.fnId,n=t.args;switch(0|i){case v.OPS.beginText:this.beginText();break;case v.OPS.dependency:break;case v.OPS.setLeading:this.setLeading(n);break;case v.OPS.setLeadingMoveText:this.setLeadingMoveText(n[0],n[1]);break;case v.OPS.setFont:this.setFont(n);break;case v.OPS.showText:case v.OPS.showSpacedText:this.showText(n[0]);break;case v.OPS.endText:this.endText();break;case v.OPS.moveText:this.moveText(n[0],n[1]);break;case v.OPS.setCharSpacing:this.setCharSpacing(n[0]);break;case v.OPS.setWordSpacing:this.setWordSpacing(n[0]);break;case v.OPS.setHScale:this.setHScale(n[0]);break;case v.OPS.setTextMatrix:this.setTextMatrix(n[0],n[1],n[2],n[3],n[4],n[5]);break;case v.OPS.setTextRise:this.setTextRise(n[0]);break;case v.OPS.setTextRenderingMode:this.setTextRenderingMode(n[0]);break;case v.OPS.setLineWidth:this.setLineWidth(n[0]);break;case v.OPS.setLineJoin:this.setLineJoin(n[0]);break;case v.OPS.setLineCap:this.setLineCap(n[0]);break;case v.OPS.setMiterLimit:this.setMiterLimit(n[0]);break;case v.OPS.setFillRGBColor:this.setFillRGBColor(n[0],n[1],n[2]);break;case v.OPS.setStrokeRGBColor:this.setStrokeRGBColor(n[0],n[1],n[2]);break;case v.OPS.setStrokeColorN:this.setStrokeColorN(n);break;case v.OPS.setFillColorN:this.setFillColorN(n);break;case v.OPS.shadingFill:this.shadingFill(n[0]);break;case v.OPS.setDash:this.setDash(n[0],n[1]);break;case v.OPS.setRenderingIntent:this.setRenderingIntent(n[0]);break;case v.OPS.setFlatness:this.setFlatness(n[0]);break;case v.OPS.setGState:this.setGState(n[0]);break;case v.OPS.fill:this.fill();break;case v.OPS.eoFill:this.eoFill();break;case v.OPS.stroke:this.stroke();break;case v.OPS.fillStroke:this.fillStroke();break;case v.OPS.eoFillStroke:this.eoFillStroke();break;case v.OPS.clip:this.clip("nonzero");break;case v.OPS.eoClip:this.clip("evenodd");break;case v.OPS.paintSolidColorImageMask:this.paintSolidColorImageMask();break;case v.OPS.paintImageXObject:this.paintImageXObject(n[0]);break;case v.OPS.paintInlineImageXObject:this.paintInlineImageXObject(n[0]);break;case v.OPS.paintImageMaskXObject:this.paintImageMaskXObject(n[0]);break;case v.OPS.paintFormXObjectBegin:this.paintFormXObjectBegin(n[0],n[1]);break;case v.OPS.paintFormXObjectEnd:this.paintFormXObjectEnd();break;case v.OPS.closePath:this.closePath();break;case v.OPS.closeStroke:this.closeStroke();break;case v.OPS.closeFillStroke:this.closeFillStroke();break;case v.OPS.closeEOFillStroke:this.closeEOFillStroke();break;case v.OPS.nextLine:this.nextLine();break;case v.OPS.transform:this.transform(n[0],n[1],n[2],n[3],n[4],n[5]);break;case v.OPS.constructPath:this.constructPath(n[0],n[1]);break;case v.OPS.endPath:this.endPath();break;case 92:this.group(t.items);break;default:(0,v.warn)("Unimplemented operator "+e)}}}setWordSpacing(e){this.current.wordSpacing=e}setCharSpacing(e){this.current.charSpacing=e}nextLine(){this.moveText(0,this.current.leading)}setTextMatrix(e,t,i,n,r,s){var o=this.current;o.textMatrix=o.lineMatrix=[e,t,i,n,r,s],o.textMatrixScale=Math.hypot(e,t),o.x=o.lineX=0,o.y=o.lineY=0,o.xcoords=[],o.ycoords=[],o.tspan=this.svgFactory.createElement("svg:tspan"),o.tspan.setAttributeNS(null,"font-family",o.fontFamily),o.tspan.setAttributeNS(null,"font-size",b(o.fontSize)+"px"),o.tspan.setAttributeNS(null,"y",b(-o.y)),o.txtElement=this.svgFactory.createElement("svg:text"),o.txtElement.append(o.tspan)}beginText(){var e=this.current;e.x=e.lineX=0,e.y=e.lineY=0,e.textMatrix=v.IDENTITY_MATRIX,e.lineMatrix=v.IDENTITY_MATRIX,e.textMatrixScale=1,e.tspan=this.svgFactory.createElement("svg:tspan"),e.txtElement=this.svgFactory.createElement("svg:text"),e.txtgrp=this.svgFactory.createElement("svg:g"),e.xcoords=[],e.ycoords=[]}moveText(e,t){var i=this.current;i.x=i.lineX+=e,i.y=i.lineY+=t,i.xcoords=[],i.ycoords=[],i.tspan=this.svgFactory.createElement("svg:tspan"),i.tspan.setAttributeNS(null,"font-family",i.fontFamily),i.tspan.setAttributeNS(null,"font-size",b(i.fontSize)+"px"),i.tspan.setAttributeNS(null,"y",b(-i.y))}showText(r){const s=this.current,o=s.font,t=s.fontSize;if(0!==t){var a,l=s.fontSizeScale,h=s.charSpacing,c=s.wordSpacing,d=s.fontDirection,i=s.textHScale*d,u=o.vertical,p=u?1:-1,m=o.defaultVMetrics,g=t*s.fontMatrix[0];let n=0;for(const v of r)if(null===v)n+=d*c;else if("number"==typeof v)n+=p*v*t/1e3;else{const r=(v.isSpace?c:0)+h,f=v.fontChar;let e,t,i=v.width;if(u){const s=v.vmetric||m,o=(a=v.vmetric?s[1]:.5*i,s[2]*g);i=s?-s[0]:i,e=-a*g/l,t=(n+o)/l}else e=n/l,t=0;(v.isInFont||o.missingFile)&&(s.xcoords.push(s.x+e),u&&s.ycoords.push(-s.y+t),s.tspan.textContent+=f),n+=u?i*g-r*d:i*g+r*d}s.tspan.setAttributeNS(null,"x",s.xcoords.map(b).join(" ")),u?s.tspan.setAttributeNS(null,"y",s.ycoords.map(b).join(" ")):s.tspan.setAttributeNS(null,"y",b(-s.y)),u?s.y-=n:s.x+=n*i,s.tspan.setAttributeNS(null,"font-family",s.fontFamily),s.tspan.setAttributeNS(null,"font-size",b(s.fontSize)+"px"),"normal"!==s.fontStyle&&s.tspan.setAttributeNS(null,"font-style",s.fontStyle),"normal"!==s.fontWeight&&s.tspan.setAttributeNS(null,"font-weight",s.fontWeight);r=s.textRenderingMode&v.TextRenderingMode.FILL_STROKE_MASK;if(r===v.TextRenderingMode.FILL||r===v.TextRenderingMode.FILL_STROKE?("#000000"!==s.fillColor&&s.tspan.setAttributeNS(null,"fill",s.fillColor),s.fillAlpha<1&&s.tspan.setAttributeNS(null,"fill-opacity",s.fillAlpha)):s.textRenderingMode===v.TextRenderingMode.ADD_TO_PATH?s.tspan.setAttributeNS(null,"fill","transparent"):s.tspan.setAttributeNS(null,"fill","none"),r===v.TextRenderingMode.STROKE||r===v.TextRenderingMode.FILL_STROKE){const r=1/(s.textMatrixScale||1);this._setStrokeAttributes(s.tspan,r)}let e=s.textMatrix;0!==s.textRise&&((e=e.slice())[5]+=s.textRise),s.txtElement.setAttributeNS(null,"transform",`${w(e)} scale(${b(i)}, -1)`),s.txtElement.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),s.txtElement.append(s.tspan),s.txtgrp.append(s.txtElement),this._ensureTransformGroup().append(s.txtElement)}}setLeadingMoveText(e,t){this.setLeading(-t),this.moveText(e,t)}addFontStyle(e){if(!e.data)throw new Error('addFontStyle: No font data available, ensure that the "fontExtraProperties" API parameter is set.');this.cssStyle||(this.cssStyle=this.svgFactory.createElement("svg:style"),this.cssStyle.setAttributeNS(null,"type","text/css"),this.defs.append(this.cssStyle));var t=y(e.data,e.mimetype,this.forceDataSchema);this.cssStyle.textContent+=`@font-face { font-family: "${e.loadedName}"; src: url(${t}); }
`}setFont(e){var t=this.current,i=this.commonObjs.get(e[0]);let n=e[1],r=(t.font=i,!this.embedFonts||i.missingFile||this.embeddedFonts[i.loadedName]||(this.addFontStyle(i),this.embeddedFonts[i.loadedName]=i),t.fontMatrix=i.fontMatrix||v.FONT_IDENTITY_MATRIX,"normal");i.black?r="900":i.bold&&(r="bold");e=i.italic?"italic":"normal";n<0?(n=-n,t.fontDirection=-1):t.fontDirection=1,t.fontSize=n,t.fontFamily=i.loadedName,t.fontWeight=r,t.fontStyle=e,t.tspan=this.svgFactory.createElement("svg:tspan"),t.tspan.setAttributeNS(null,"y",b(-t.y)),t.xcoords=[],t.ycoords=[]}endText(){var e=this.current;e.textRenderingMode&v.TextRenderingMode.ADD_TO_PATH_FLAG&&e.txtElement?.hasChildNodes()&&(e.element=e.txtElement,this.clip("nonzero"),this.endPath())}setLineWidth(e){0<e&&(this.current.lineWidth=e)}setLineCap(e){this.current.lineCap=r[e]}setLineJoin(e){this.current.lineJoin=s[e]}setMiterLimit(e){this.current.miterLimit=e}setStrokeAlpha(e){this.current.strokeAlpha=e}setStrokeRGBColor(e,t,i){this.current.strokeColor=v.Util.makeHexColor(e,t,i)}setFillAlpha(e){this.current.fillAlpha=e}setFillRGBColor(e,t,i){this.current.fillColor=v.Util.makeHexColor(e,t,i),this.current.tspan=this.svgFactory.createElement("svg:tspan"),this.current.xcoords=[],this.current.ycoords=[]}setStrokeColorN(e){this.current.strokeColor=this._makeColorN_Pattern(e)}setFillColorN(e){this.current.fillColor=this._makeColorN_Pattern(e)}shadingFill(e){var{width:t,height:i}=this.viewport,n=v.Util.inverseTransform(this.transformMatrix),[t,i,n,r]=v.Util.getAxialAlignedBoundingBox([0,0,t,i],n),s=this.svgFactory.createElement("svg:rect");s.setAttributeNS(null,"x",t),s.setAttributeNS(null,"y",i),s.setAttributeNS(null,"width",n-t),s.setAttributeNS(null,"height",r-i),s.setAttributeNS(null,"fill",this._makeShadingPattern(e)),this.current.fillAlpha<1&&s.setAttributeNS(null,"fill-opacity",this.current.fillAlpha),this._ensureTransformGroup().append(s)}_makeColorN_Pattern(e){return"TilingPattern"===e[0]?this._makeTilingPattern(e):this._makeShadingPattern(e)}_makeTilingPattern(e){var t=e[1],i=e[2],n=e[3]||v.IDENTITY_MATRIX,[r,s,o,a]=e[4],l=e[5],h=e[6],e=e[7],c="shading"+m++,[r,s,o,a]=v.Util.normalizeRect([...v.Util.applyTransform([r,s],n),...v.Util.applyTransform([o,a],n)]),[d,u]=v.Util.singularValueDecompose2dScale(n),l=l*d,d=h*u,h=this.svgFactory.createElement("svg:pattern"),u=(h.setAttributeNS(null,"id",c),h.setAttributeNS(null,"patternUnits","userSpaceOnUse"),h.setAttributeNS(null,"width",l),h.setAttributeNS(null,"height",d),h.setAttributeNS(null,"x",""+r),h.setAttributeNS(null,"y",""+s),this.svg),l=this.transformMatrix,d=this.current.fillColor,p=this.current.strokeColor,o=this.svgFactory.create(o-r,a-s);if(this.svg=o,this.transformMatrix=n,2===e){const e=v.Util.makeHexColor(...t);this.current.fillColor=e,this.current.strokeColor=e}return this.executeOpTree(this.convertOpList(i)),this.svg=u,this.transformMatrix=l,this.current.fillColor=d,this.current.strokeColor=p,h.append(o.childNodes[0]),this.defs.append(h),`url(#${c})`}_makeShadingPattern(t){switch((t="string"==typeof t?this.objs.get(t):t)[0]){case"RadialAxial":var i="shading"+m++,n=t[3];let e;switch(t[1]){case"axial":const h=t[4],v=t[5];(e=this.svgFactory.createElement("svg:linearGradient")).setAttributeNS(null,"id",i),e.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),e.setAttributeNS(null,"x1",h[0]),e.setAttributeNS(null,"y1",h[1]),e.setAttributeNS(null,"x2",v[0]),e.setAttributeNS(null,"y2",v[1]);break;case"radial":var r=t[4],s=t[5],o=t[6],a=t[7];(e=this.svgFactory.createElement("svg:radialGradient")).setAttributeNS(null,"id",i),e.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),e.setAttributeNS(null,"cx",s[0]),e.setAttributeNS(null,"cy",s[1]),e.setAttributeNS(null,"r",a),e.setAttributeNS(null,"fx",r[0]),e.setAttributeNS(null,"fy",r[1]),e.setAttributeNS(null,"fr",o);break;default:throw new Error("Unknown RadialAxial type: "+t[1])}for(const t of n){var l=this.svgFactory.createElement("svg:stop");l.setAttributeNS(null,"offset",t[0]),l.setAttributeNS(null,"stop-color",t[1]),e.append(l)}return this.defs.append(e),`url(#${i})`;case"Mesh":return(0,v.warn)("Unimplemented pattern Mesh"),null;case"Dummy":return"hotpink";default:throw new Error("Unknown IR type: "+t[0])}}setDash(e,t){this.current.dashArray=e,this.current.dashPhase=t}constructPath(e,t){const i=this.current;let n=i.x,r=i.y,s=[],o=0;for(const i of e)switch(0|i){case v.OPS.rectangle:n=t[o++],r=t[o++];const e=n+t[o++],i=r+t[o++];s.push("M",b(n),b(r),"L",b(e),b(r),"L",b(e),b(i),"L",b(n),b(i),"Z");break;case v.OPS.moveTo:n=t[o++],r=t[o++],s.push("M",b(n),b(r));break;case v.OPS.lineTo:n=t[o++],r=t[o++],s.push("L",b(n),b(r));break;case v.OPS.curveTo:n=t[o+4],r=t[o+5],s.push("C",b(t[o]),b(t[o+1]),b(t[o+2]),b(t[o+3]),b(n),b(r)),o+=6;break;case v.OPS.curveTo2:s.push("C",b(n),b(r),b(t[o]),b(t[o+1]),b(t[o+2]),b(t[o+3])),n=t[o+2],r=t[o+3],o+=4;break;case v.OPS.curveTo3:n=t[o+2],r=t[o+3],s.push("C",b(t[o]),b(t[o+1]),b(n),b(r),b(n),b(r)),o+=4;break;case v.OPS.closePath:s.push("Z")}s=s.join(" "),i.path&&0<e.length&&e[0]!==v.OPS.rectangle&&e[0]!==v.OPS.moveTo?s=i.path.getAttributeNS(null,"d")+s:(i.path=this.svgFactory.createElement("svg:path"),this._ensureTransformGroup().append(i.path)),i.path.setAttributeNS(null,"d",s),i.path.setAttributeNS(null,"fill","none"),i.element=i.path,i.setCurrentPoint(n,r)}endPath(){const e=this.current;if(e.path=null,this.pendingClip)if(e.element){var t="clippath"+l++,i=this.svgFactory.createElement("svg:clipPath"),n=(i.setAttributeNS(null,"id",t),i.setAttributeNS(null,"transform",w(this.transformMatrix)),e.element.cloneNode(!0));if("evenodd"===this.pendingClip?n.setAttributeNS(null,"clip-rule","evenodd"):n.setAttributeNS(null,"clip-rule","nonzero"),this.pendingClip=null,i.append(n),this.defs.append(i),e.activeClipUrl){e.clipGroup=null;for(const e of this.extraStack)e.clipGroup=null;i.setAttributeNS(null,"clip-path",e.activeClipUrl)}e.activeClipUrl=`url(#${t})`,this.tgrp=null}else this.pendingClip=null}clip(e){this.pendingClip=e}closePath(){var e,t=this.current;t.path&&(e=t.path.getAttributeNS(null,"d")+"Z",t.path.setAttributeNS(null,"d",e))}setLeading(e){this.current.leading=-e}setTextRise(e){this.current.textRise=e}setTextRenderingMode(e){this.current.textRenderingMode=e}setHScale(e){this.current.textHScale=e/100}setRenderingIntent(e){}setFlatness(e){}setGState(e){for(var[t,i]of e)switch(t){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);break;case"CA":this.setStrokeAlpha(i);break;case"ca":this.setFillAlpha(i);break;default:(0,v.warn)("Unimplemented graphic state operator "+t)}}fill(){var e=this.current;e.element&&(e.element.setAttributeNS(null,"fill",e.fillColor),e.element.setAttributeNS(null,"fill-opacity",e.fillAlpha),this.endPath())}stroke(){var e=this.current;e.element&&(this._setStrokeAttributes(e.element),e.element.setAttributeNS(null,"fill","none"),this.endPath())}_setStrokeAttributes(e){let t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:1;var i=this.current;let n=i.dashArray;1!==t&&0<n.length&&(n=n.map(function(e){return t*e})),e.setAttributeNS(null,"stroke",i.strokeColor),e.setAttributeNS(null,"stroke-opacity",i.strokeAlpha),e.setAttributeNS(null,"stroke-miterlimit",b(i.miterLimit)),e.setAttributeNS(null,"stroke-linecap",i.lineCap),e.setAttributeNS(null,"stroke-linejoin",i.lineJoin),e.setAttributeNS(null,"stroke-width",b(t*i.lineWidth)+"px"),e.setAttributeNS(null,"stroke-dasharray",n.map(b).join(" ")),e.setAttributeNS(null,"stroke-dashoffset",b(t*i.dashPhase)+"px")}eoFill(){this.current.element?.setAttributeNS(null,"fill-rule","evenodd"),this.fill()}fillStroke(){this.stroke(),this.fill()}eoFillStroke(){this.current.element?.setAttributeNS(null,"fill-rule","evenodd"),this.fillStroke()}closeStroke(){this.closePath(),this.stroke()}closeFillStroke(){this.closePath(),this.fillStroke()}closeEOFillStroke(){this.closePath(),this.eoFillStroke()}paintSolidColorImageMask(){var e=this.svgFactory.createElement("svg:rect");e.setAttributeNS(null,"x","0"),e.setAttributeNS(null,"y","0"),e.setAttributeNS(null,"width","1px"),e.setAttributeNS(null,"height","1px"),e.setAttributeNS(null,"fill",this.current.fillColor),this._ensureTransformGroup().append(e)}paintImageXObject(e){var t=this.getObject(e);t?this.paintInlineImageXObject(t):(0,v.warn)(`Dependent image with object ID ${e} is not ready yet`)}paintInlineImageXObject(e,t){var i=e.width,n=e.height,e=o(e,this.forceDataSchema,!!t),r=this.svgFactory.createElement("svg:rect"),r=(r.setAttributeNS(null,"x","0"),r.setAttributeNS(null,"y","0"),r.setAttributeNS(null,"width",b(i)),r.setAttributeNS(null,"height",b(n)),this.current.element=r,this.clip("nonzero"),this.svgFactory.createElement("svg:image"));r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",e),r.setAttributeNS(null,"x","0"),r.setAttributeNS(null,"y",b(-n)),r.setAttributeNS(null,"width",b(i)+"px"),r.setAttributeNS(null,"height",b(n)+"px"),r.setAttributeNS(null,"transform",`scale(${b(1/i)} ${b(-1/n)})`),(t||this._ensureTransformGroup()).append(r)}paintImageMaskXObject(e){var t,i,n,r,s,o,e=this.getObject(e.data,e);e.bitmap?(0,v.warn)("paintImageMaskXObject: ImageBitmap support is not implemented, ensure that the `isOffscreenCanvasSupported` API parameter is disabled."):(t=this.current,i=e.width,n=e.height,r=t.fillColor,t.maskId="mask"+h++,(s=this.svgFactory.createElement("svg:mask")).setAttributeNS(null,"id",t.maskId),(o=this.svgFactory.createElement("svg:rect")).setAttributeNS(null,"x","0"),o.setAttributeNS(null,"y","0"),o.setAttributeNS(null,"width",b(i)),o.setAttributeNS(null,"height",b(n)),o.setAttributeNS(null,"fill",r),o.setAttributeNS(null,"mask",`url(#${t.maskId})`),this.defs.append(s),this._ensureTransformGroup().append(o),this.paintInlineImageXObject(e,s))}paintFormXObjectBegin(e,t){if(Array.isArray(e)&&6===e.length&&this.transform(e[0],e[1],e[2],e[3],e[4],e[5]),t){const e=t[2]-t[0],i=t[3]-t[1],n=this.svgFactory.createElement("svg:rect");n.setAttributeNS(null,"x",t[0]),n.setAttributeNS(null,"y",t[1]),n.setAttributeNS(null,"width",b(e)),n.setAttributeNS(null,"height",b(i)),this.current.element=n,this.clip("nonzero"),this.endPath()}}paintFormXObjectEnd(){}_initialize(e){var t=this.svgFactory.create(e.width,e.height),i=this.svgFactory.createElement("svg:defs"),i=(t.append(i),this.defs=i,this.svgFactory.createElement("svg:g"));return i.setAttributeNS(null,"transform",w(e.transform)),t.append(i),this.svg=i,t}_ensureClipGroup(){var e;return this.current.clipGroup||((e=this.svgFactory.createElement("svg:g")).setAttributeNS(null,"clip-path",this.current.activeClipUrl),this.svg.append(e),this.current.clipGroup=e),this.current.clipGroup}_ensureTransformGroup(){return this.tgrp||(this.tgrp=this.svgFactory.createElement("svg:g"),this.tgrp.setAttributeNS(null,"transform",w(this.transformMatrix)),(this.current.activeClipUrl?this._ensureClipGroup():this.svg).append(this.tgrp)),this.tgrp}}},(e,t,i)=>{var n=i(3),r=i(188),i=i(193);n({target:"Array",proto:!0},{group:function(e){return r(this,e,1<arguments.length?arguments[1]:void 0)}}),i("group")},(e,t,i)=>{var p=i(99),n=i(14),m=i(13),g=i(40),f=i(18),v=i(64),y=i(189),b=i(108),w=Array,x=n([].push);e.exports=function(e,t,i,n){for(var r,s,o,a=g(e),l=m(a),h=p(t,i),c=y(null),d=v(l),u=0;u<d;u++)o=l[u],(s=f(h(o,u,a)))in c?x(c[s],o):c[s]=[o];if(n&&(r=n(a))!==w)for(s in c)c[s]=b(r,c[s]);return c}},(e,t,i)=>{function n(){}function r(e){e.write(g("")),e.close();var t=e.parentWindow.Object;return e=null,t}var s,o=i(47),a=i(190),l=i(66),h=i(55),c=i(192),d=i(43),i=i(54),u="prototype",p="script",m=i("IE_PROTO"),g=function(e){return"<"+p+">"+e+"</"+p+">"},f=function(){try{s=new ActiveXObject("htmlfile")}catch(i){}var e,t;f="undefined"==typeof document||document.domain&&s?r(s):(e=d("iframe"),t="java"+p+":",e.style.display="none",c.appendChild(e),e.src=String(t),(t=e.contentWindow.document).open(),t.write(g("document.F=Object")),t.close(),t.F);for(var i=l.length;i--;)delete f[u][l[i]];return f()};h[m]=!0,e.exports=Object.create||function(e,t){var i;return null!==e?(n[u]=o(e),i=new n,n[u]=null,i[m]=e):i=f(),void 0===t?i:a.f(i,t)}},(e,t,i)=>{var n=i(6),r=i(46),a=i(45),l=i(47),h=i(12),c=i(191);t.f=n&&!r?Object.defineProperties:function(e,t){l(e);for(var i,n=h(t),r=c(t),s=r.length,o=0;o<s;)a.f(e,i=r[o++],n[i]);return e}},(e,t,i)=>{var n=i(59),r=i(66);e.exports=Object.keys||function(e){return n(e,r)}},(e,t,i)=>{i=i(24);e.exports=i("document","documentElement")},(e,t,i)=>{var n=i(34),r=i(189),i=i(45).f,s=n("unscopables"),o=Array.prototype;void 0===o[s]&&i(o,s,{configurable:!0,value:r(null)}),e.exports=function(e){o[s][e]=!0}},(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.XfaText=void 0,i(89);class s{static textContent(e){const r=[],t={items:r,styles:Object.create(null)};return function t(i){if(i){let e=null;var n=i.name;if("#text"===n)e=i.value;else{if(!s.shouldBuildText(n))return;i?.attributes?.textContent?e=i.attributes.textContent:i.value&&(e=i.value)}if(null!==e&&r.push({str:e}),i.children)for(const r of i.children)t(r)}}(e),t}static shouldBuildText(e){return!("textarea"===e||"input"===e||"option"===e||"select"===e)}}t.XfaText=s},(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TextLayerRenderTask=void 0,t.renderTextLayer=function(e){e.textContentSource||!e.textContent&&!e.textContentStream||((0,l.deprecated)("The TextLayerRender `textContent`/`textContentStream` parameters will be removed in the future, please use `textContentSource` instead."),e.textContentSource=e.textContent||e.textContentStream);var{container:t,viewport:i}=e,t=getComputedStyle(t),n=t.getPropertyValue("visibility"),t=parseFloat(t.getPropertyValue("--scale-factor")),n=("visible"===n&&(!t||1e-5<Math.abs(t-i.scale))&&console.error("The `--scale-factor` CSS-variable must be set, to the same value as `viewport.scale`, either on the `container`-element itself or higher up in the DOM."),new r(e));return n._render(),n},t.updateTextLayer=function(e){let{container:t,viewport:i,textDivs:n,textDivProperties:r,isOffscreenCanvasSupported:s,mustRotate:o=!0,mustRescale:a=!0}=e;if(o&&(0,l.setLayerDimensions)(t,{rotation:i.rotation}),a){const e=f(0,s),t={prevFontSize:null,prevFontFamily:null,div:null,scale:i.scale*(globalThis.devicePixelRatio||1),properties:null,ctx:e};for(const e of n)t.properties=r.get(e),t.div=e,h(t)}},i(89),i(2);var m=i(1),l=i(168);const g=new Map;function f(e,t){let i;if(t&&m.FeatureTest.isOffscreenCanvasSupported)i=new OffscreenCanvas(e,e).getContext("2d",{alpha:!1});else{const t=document.createElement("canvas");t.width=t.height=e,i=t.getContext("2d",{alpha:!1})}return i}function h(e){var t,i,n,{div:r,scale:s,properties:o,ctx:a,prevFontSize:l,prevFontFamily:h}=e,c=r["style"];let d="";0!==o.canvasWidth&&o.hasText&&(t=c["fontFamily"],{canvasWidth:i,fontSize:n}=o,l=(l===n&&h===t||(a.font=n*s+"px "+t,e.prevFontSize=n,e.prevFontFamily=t),a.measureText(r.textContent))["width"],0<l)&&(d=`scaleX(${i*s/l})`),0<(d=0!==o.angle?`rotate(${o.angle}deg) `+d:d).length&&(c.transform=d)}class r{constructor(e){var{textContentSource:e,container:t,viewport:i,textDivs:n,textDivProperties:r,textContentItemsStr:s,isOffscreenCanvasSupported:o}=e,{pageWidth:e,pageHeight:n,pageX:s,pageY:r}=(this._textContentSource=e,this._isReadableStream=e instanceof ReadableStream,this._container=this._rootContainer=t,this._textDivs=n||[],this._textContentItemsStr=s||[],this._isOffscreenCanvasSupported=o,this._fontInspectorEnabled=!!globalThis.FontInspector?.enabled,this._reader=null,this._textDivProperties=r||new WeakMap,this._canceled=!1,this._capability=new m.PromiseCapability,this._layoutTextParams={prevFontSize:null,prevFontFamily:null,div:null,scale:i.scale*(globalThis.devicePixelRatio||1),properties:null,ctx:f(0,o)},i.rawDims);this._transform=[1,0,0,-1,-s,r+n],this._pageWidth=e,this._pageHeight=n,(0,l.setLayerDimensions)(t,i),this._capability.promise.finally(()=>{this._layoutTextParams=null}).catch(()=>{})}get promise(){return this._capability.promise}cancel(){this._canceled=!0,this._reader&&(this._reader.cancel(new m.AbortException("TextLayer task cancelled.")).catch(()=>{}),this._reader=null),this._capability.reject(new m.AbortException("TextLayer task cancelled."))}_processItems(e,r){for(const p of e)if(void 0!==p.str){this._textContentItemsStr.push(p.str);{s=void 0;o=void 0;a=void 0;l=void 0;h=void 0;c=void 0;d=void 0;u=void 0;var s=this;var o=p;var a=r;var l=document.createElement("span"),h={angle:0,canvasWidth:0,hasText:""!==o.str,hasEOL:o.hasEOL,fontSize:0},c=(s._textDivs.push(l),m.Util.transform(s._transform,o.transform));let e=Math.atan2(c[1],c[0]);var a=a[o.fontName],d=(a.vertical&&(e+=Math.PI/2),Math.hypot(c[2],c[3])),u=d*function(e,t){var i=g.get(e);if(i)return i;i=f(30,t),i.font="30px "+e,t=i.measureText("");let n=t.fontBoundingBoxAscent,r=Math.abs(t.fontBoundingBoxDescent);if(n){const t=n/(n+r);return g.set(e,t),i.canvas.width=i.canvas.height=0,t}i.strokeStyle="red",i.clearRect(0,0,30,30),i.strokeText("g",0,0);let s=i.getImageData(0,0,30,30).data;r=0;for(let e=s.length-1-3;0<=e;e-=4)if(0<s[e]){r=Math.ceil(e/4/30);break}i.clearRect(0,0,30,30),i.strokeText("A",0,30),s=i.getImageData(0,0,30,30).data;for(let e=n=0,t=s.length;e<t;e+=4)if(0<s[e]){n=30-Math.floor(e/4/30);break}if(i.canvas.width=i.canvas.height=0,n){const t=n/(n+r);return g.set(e,t),t}return g.set(e,.8),.8}(a.fontFamily,s._isOffscreenCanvasSupported);let t,i,n=(i=0===e?(t=c[4],c[5]-u):(t=c[4]+u*Math.sin(e),c[5]-u*Math.cos(e)),c="calc(var(--scale-factor)*",u=l.style,s._container===s._rootContainer?(u.left=(100*t/s._pageWidth).toFixed(2)+"%",u.top=(100*i/s._pageHeight).toFixed(2)+"%"):(u.left=c+t.toFixed(2)+"px)",u.top=c+i.toFixed(2)+"px)"),u.fontSize=c+d.toFixed(2)+"px)",u.fontFamily=a.fontFamily,h.fontSize=d,l.setAttribute("role","presentation"),l.textContent=o.str,l.dir=o.dir,s._fontInspectorEnabled&&(l.dataset.fontName=o.fontName),0!==e&&(h.angle=e*(180/Math.PI)),!1);if(1<o.str.length)n=!0;else if(" "!==o.str&&o.transform[0]!==o.transform[3]){const s=Math.abs(o.transform[0]),a=Math.abs(o.transform[3]);s!==a&&1.5<Math.max(s,a)/Math.min(s,a)&&(n=!0)}n&&(h.canvasWidth=a.vertical?o.height:o.width),s._textDivProperties.set(l,h),s._isReadableStream&&s._layoutText(l)}}else if("beginMarkedContentProps"===p.type||"beginMarkedContent"===p.type){const e=this._container;this._container=document.createElement("span"),this._container.classList.add("markedContent"),null!==p.id&&this._container.setAttribute("id",""+p.id),e.append(this._container)}else"endMarkedContent"===p.type&&(this._container=this._container.parentNode)}_layoutText(e){var t=this._layoutTextParams.properties=this._textDivProperties.get(e);if(this._layoutTextParams.div=e,h(this._layoutTextParams),t.hasText&&this._container.append(e),t.hasEOL){const e=document.createElement("br");e.setAttribute("role","presentation"),this._container.append(e)}}_render(){const i=new m.PromiseCapability;let n=Object.create(null);if(this._isReadableStream){const r=()=>{this._reader.read().then(e=>{var{value:e,done:t}=e;t?i.resolve():(Object.assign(n,e.styles),this._processItems(e.items,n),r())},i.reject)};this._reader=this._textContentSource.getReader(),r()}else{if(!this._textContentSource)throw new Error('No "textContentSource" parameter specified.');{const{items:n,styles:e}=this._textContentSource;this._processItems(n,e),i.resolve()}}i.promise.then(()=>{n=null;var e=this;if(!e._canceled){const t=e._textDivs,i=e._capability;if(!(1e5<t.length||e._isReadableStream))for(const i of t)e._layoutText(i);i.resolve()}},this._capability.reject)}}t.TextLayerRenderTask=r},(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.AnnotationEditorLayer=void 0,i(125),i(136),i(138),i(141),i(143),i(145),i(147);var n=i(1),r=i(164),l=i(197),h=i(202),s=i(168),c=i(203);class d{#Se;#Ee=!1;#xe=null;#we=this.pointerup.bind(this);#Ce=this.pointerdown.bind(this);#Te=new Map;#Pe=!1;#ke=!1;#Me=!1;#Fe;static _initialized=!1;constructor(e){var{uiManager:e,pageIndex:t,div:i,accessibilityManager:n,annotationLayer:r,viewport:s,l10n:o}=e,a=[l.FreeTextEditor,h.InkEditor,c.StampEditor];if(!d._initialized){d._initialized=!0;for(const e of a)e.initialize(o)}e.registerEditorTypes(a),this.#Fe=e,this.pageIndex=t,this.div=i,this.#Se=n,this.#xe=r,this.viewport=s,this.#Fe.addLayer(this)}get isEmpty(){return 0===this.#Te.size}updateToolbar(e){this.#Fe.updateToolbar(e)}updateMode(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:this.#Fe.getMode();this.#Re(),e===n.AnnotationEditorType.INK?(this.addInkEditorIfNeeded(!1),this.disableClick()):this.enableClick(),e!==n.AnnotationEditorType.NONE&&(this.div.classList.toggle("freeTextEditing",e===n.AnnotationEditorType.FREETEXT),this.div.classList.toggle("inkEditing",e===n.AnnotationEditorType.INK),this.div.classList.toggle("stampEditing",e===n.AnnotationEditorType.STAMP),this.div.hidden=!1)}addInkEditorIfNeeded(e){if(e||this.#Fe.getMode()===n.AnnotationEditorType.INK){if(!e)for(const e of this.#Te.values())if(e.isEmpty())return void e.setInBackground();this.#De({offsetX:0,offsetY:0},!1).setInBackground()}}setEditingState(e){this.#Fe.setEditingState(e)}addCommands(e){this.#Fe.addCommands(e)}enable(){this.div.style.pointerEvents="auto";var e=new Set;for(const t of this.#Te.values())t.enableEditing(),t.annotationElementId&&e.add(t.annotationElementId);if(this.#xe){const t=this.#xe.getEditableAnnotations();for(const i of t)if(i.hide(),!this.#Fe.isDeletedAnnotationElement(i.data.id)&&!e.has(i.data.id)){const t=this.deserialize(i);t&&(this.addOrRebuild(t),t.enableEditing())}}}disable(){this.#Me=!0,this.div.style.pointerEvents="none";var e=new Set;for(const i of this.#Te.values())i.disableEditing(),i.annotationElementId&&null===i.serialize()?(this.getEditableAnnotation(i.annotationElementId)?.show(),i.remove()):e.add(i.annotationElementId);if(this.#xe)for(const n of this.#xe.getEditableAnnotations()){var t=n.data["id"];e.has(t)||this.#Fe.isDeletedAnnotationElement(t)||n.show()}this.#Re(),this.isEmpty&&(this.div.hidden=!0),this.#Me=!1}getEditableAnnotation(e){return this.#xe?.getEditableAnnotation(e)||null}setActiveEditor(e){this.#Fe.getActive()!==e&&this.#Fe.setActiveEditor(e)}enableClick(){this.div.addEventListener("pointerdown",this.#Ce),this.div.addEventListener("pointerup",this.#we)}disableClick(){this.div.removeEventListener("pointerdown",this.#Ce),this.div.removeEventListener("pointerup",this.#we)}attach(e){this.#Te.set(e.id,e);var t=e["annotationElementId"];t&&this.#Fe.isDeletedAnnotationElement(t)&&this.#Fe.removeDeletedAnnotationElement(e)}detach(e){this.#Te.delete(e.id),this.#Se?.removePointerInTextLayer(e.contentDiv),!this.#Me&&e.annotationElementId&&this.#Fe.addDeletedAnnotationElement(e)}remove(e){this.detach(e),this.#Fe.removeEditor(e),e.div.contains(document.activeElement)&&setTimeout(()=>{this.#Fe.focusMainContainer()},0),e.div.remove(),e.isAttachedToDOM=!1,this.#ke||this.addInkEditorIfNeeded(!1)}changeParent(e){e.parent!==this&&(e.annotationElementId&&(this.#Fe.addDeletedAnnotationElement(e.annotationElementId),r.AnnotationEditor.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){var t;this.changeParent(e),this.#Fe.addEditor(e),this.attach(e),e.isAttachedToDOM||(t=e.render(),this.div.append(t),e.isAttachedToDOM=!0),e.fixAndSetPosition(),e.onceAdded(),this.#Fe.addToAnnotationStorage(e)}moveEditorInDOM(e){if(e.isAttachedToDOM){const t=document["activeElement"];e.div.contains(t)&&(e._focusEventsAllowed=!1,setTimeout(()=>{e.div.contains(document.activeElement)?e._focusEventsAllowed=!0:(e.div.addEventListener("focusin",()=>{e._focusEventsAllowed=!0},{once:!0}),t.focus())},0)),e._structTreeParentId=this.#Se?.moveElementInDOM(this.div,e.div,e.contentDiv,!0)}}addOrRebuild(e){e.needsToBeRebuilt()?e.rebuild():this.add(e)}addUndoableEditor(e){this.addCommands({cmd:()=>e._uiManager.rebuild(e),undo:()=>{e.remove()},mustExec:!1})}getNextId(){return this.#Fe.getId()}#Ie(e){switch(this.#Fe.getMode()){case n.AnnotationEditorType.FREETEXT:return new l.FreeTextEditor(e);case n.AnnotationEditorType.INK:return new h.InkEditor(e);case n.AnnotationEditorType.STAMP:return new c.StampEditor(e)}return null}pasteEditor(e,t){this.#Fe.updateToolbar(e),this.#Fe.updateMode(e);var{offsetX:e,offsetY:i}=this.#Oe(),n=this.getNextId(),n=this.#Ie({parent:this,id:n,x:e,y:i,uiManager:this.#Fe,isCentered:!0,...t});n&&this.add(n)}deserialize(e){switch(e.annotationType??e.annotationEditorType){case n.AnnotationEditorType.FREETEXT:return l.FreeTextEditor.deserialize(e,this,this.#Fe);case n.AnnotationEditorType.INK:return h.InkEditor.deserialize(e,this,this.#Fe);case n.AnnotationEditorType.STAMP:return c.StampEditor.deserialize(e,this,this.#Fe)}return null}#De(e,t){var i=this.getNextId(),i=this.#Ie({parent:this,id:i,x:e.offsetX,y:e.offsetY,uiManager:this.#Fe,isCentered:t});return i&&this.add(i),i}#Oe(){var{x:e,y:t,width:i,height:n}=this.div.getBoundingClientRect(),r=Math.max(0,e),s=Math.max(0,t),r=(r+Math.min(window.innerWidth,e+i))/2-e,i=(s+Math.min(window.innerHeight,t+n))/2-t,[e,s]=this.viewport.rotation%180==0?[r,i]:[i,r];return{offsetX:e,offsetY:s}}addNewEditor(){this.#De(this.#Oe(),!0)}setSelected(e){this.#Fe.setSelected(e)}toggleSelected(e){this.#Fe.toggleSelected(e)}isSelected(e){return this.#Fe.isSelected(e)}unselect(e){this.#Fe.unselect(e)}pointerup(e){var t=n.FeatureTest.platform["isMac"];0!==e.button||e.ctrlKey&&t||e.target!==this.div||!this.#Pe||(this.#Pe=!1,this.#Ee?this.#Fe.getMode()!==n.AnnotationEditorType.STAMP?this.#De(e,!1):this.#Fe.unselectAll():this.#Ee=!0)}pointerdown(e){var t;this.#Pe?this.#Pe=!1:(t=n.FeatureTest.platform.isMac,0!==e.button||e.ctrlKey&&t||e.target===this.div&&(this.#Pe=!0,t=this.#Fe.getActive(),this.#Ee=!t||t.isEmpty()))}findNewParent(e,t,i){t=this.#Fe.findParent(t,i);return null!==t&&t!==this&&(t.changeParent(e),!0)}destroy(){this.#Fe.getActive()?.parent===this&&(this.#Fe.commitOrRemove(),this.#Fe.setActiveEditor(null));for(const e of this.#Te.values())this.#Se?.removePointerInTextLayer(e.contentDiv),e.setParent(null),e.isAttachedToDOM=!1,e.div.remove();this.div=null,this.#Te.clear(),this.#Fe.removeLayer(this)}#Re(){this.#ke=!0;for(const e of this.#Te.values())e.isEmpty()&&e.remove();this.#ke=!1}render(e){e=e.viewport;this.viewport=e,(0,s.setLayerDimensions)(this.div,e);for(const e of this.#Fe.getEditors(this.pageIndex))this.add(e);this.updateMode()}update(e){e=e.viewport;this.#Fe.commitOrRemove(),this.viewport=e,(0,s.setLayerDimensions)(this.div,{rotation:e.rotation}),this.updateMode()}get pageDimensions(){var{pageWidth:e,pageHeight:t}=this.viewport.rawDims;return[e,t]}}t.AnnotationEditorLayer=d},(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FreeTextEditor=void 0,i(89);var h=i(1),u=i(165),n=i(164),c=i(198);class r extends n.AnnotationEditor{#Le=this.editorDivBlur.bind(this);#Ne=this.editorDivFocus.bind(this);#Be=this.editorDivInput.bind(this);#je=this.editorDivKeydown.bind(this);#Ue;#ze="";#We=this.id+"-editor";#He;#qe=null;static _freeTextDefaultContent="";static _internalPadding=0;static _defaultColor=null;static _defaultFontSize=10;static get _keyboardManager(){var e=r.prototype,t=e=>e.isEmpty(),i=u.AnnotationEditorUIManager.TRANSLATE_SMALL,n=u.AnnotationEditorUIManager.TRANSLATE_BIG;return(0,h.shadow)(this,"_keyboardManager",new u.KeyboardManager([[["ctrl+s","mac+meta+s","ctrl+p","mac+meta+p"],e.commitOrRemove,{bubbles:!0}],[["ctrl+Enter","mac+meta+Enter","Escape","mac+Escape"],e.commitOrRemove],[["ArrowLeft","mac+ArrowLeft"],e._translateEmpty,{args:[-i,0],checker:t}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],e._translateEmpty,{args:[-n,0],checker:t}],[["ArrowRight","mac+ArrowRight"],e._translateEmpty,{args:[i,0],checker:t}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],e._translateEmpty,{args:[n,0],checker:t}],[["ArrowUp","mac+ArrowUp"],e._translateEmpty,{args:[0,-i],checker:t}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],e._translateEmpty,{args:[0,-n],checker:t}],[["ArrowDown","mac+ArrowDown"],e._translateEmpty,{args:[0,i],checker:t}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],e._translateEmpty,{args:[0,n],checker:t}]]))}static _type="freetext";constructor(e){super({...e,name:"freeTextEditor"}),this.#Ue=e.color||r._defaultColor||n.AnnotationEditor._defaultLineColor,this.#He=e.fontSize||r._defaultFontSize}static initialize(e){n.AnnotationEditor.initialize(e,{strings:["free_text2_default_content","editor_free_text2_aria_label"]});e=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(e.getPropertyValue("--freetext-padding"))}static updateDefaultParams(e,t){switch(e){case h.AnnotationEditorParamsType.FREETEXT_SIZE:r._defaultFontSize=t;break;case h.AnnotationEditorParamsType.FREETEXT_COLOR:r._defaultColor=t}}updateParams(e,t){switch(e){case h.AnnotationEditorParamsType.FREETEXT_SIZE:this.#Ge(t);break;case h.AnnotationEditorParamsType.FREETEXT_COLOR:this.#Ve(t)}}static get defaultPropertiesToUpdate(){return[[h.AnnotationEditorParamsType.FREETEXT_SIZE,r._defaultFontSize],[h.AnnotationEditorParamsType.FREETEXT_COLOR,r._defaultColor||n.AnnotationEditor._defaultLineColor]]}get propertiesToUpdate(){return[[h.AnnotationEditorParamsType.FREETEXT_SIZE,this.#He],[h.AnnotationEditorParamsType.FREETEXT_COLOR,this.#Ue]]}#Ge(e){const t=e=>{this.editorDiv.style.fontSize=`calc(${e}px * var(--scale-factor))`,this.translate(0,-(e-this.#He)*this.parentScale),this.#He=e,this.#$e()},i=this.#He;this.addCommands({cmd:()=>{t(e)},undo:()=>{t(i)},mustExec:!0,type:h.AnnotationEditorParamsType.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})}#Ve(e){const t=this.#Ue;this.addCommands({cmd:()=>{this.#Ue=this.editorDiv.style.color=e},undo:()=>{this.#Ue=this.editorDiv.style.color=t},mustExec:!0,type:h.AnnotationEditorParamsType.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})}_translateEmpty(e,t){this._uiManager.translateSelectedEditors(e,t,!0)}getInitialTranslation(){var e=this.parentScale;return[-r._internalPadding*e,-(r._internalPadding+this.#He)*e]}rebuild(){this.parent&&(super.rebuild(),null===this.div||this.isAttachedToDOM||this.parent.add(this))}enableEditMode(){this.isInEditMode()||(this.parent.setEditingState(!1),this.parent.updateToolbar(h.AnnotationEditorType.FREETEXT),super.enableEditMode(),this.overlayDiv.classList.remove("enabled"),this.editorDiv.contentEditable=!0,this._isDraggable=!1,this.div.removeAttribute("aria-activedescendant"),this.editorDiv.addEventListener("keydown",this.#je),this.editorDiv.addEventListener("focus",this.#Ne),this.editorDiv.addEventListener("blur",this.#Le),this.editorDiv.addEventListener("input",this.#Be))}disableEditMode(){this.isInEditMode()&&(this.parent.setEditingState(!0),super.disableEditMode(),this.overlayDiv.classList.add("enabled"),this.editorDiv.contentEditable=!1,this.div.setAttribute("aria-activedescendant",this.#We),this._isDraggable=!0,this.editorDiv.removeEventListener("keydown",this.#je),this.editorDiv.removeEventListener("focus",this.#Ne),this.editorDiv.removeEventListener("blur",this.#Le),this.editorDiv.removeEventListener("input",this.#Be),this.div.focus({preventScroll:!0}),this.isEditing=!1,this.parent.div.classList.add("freeTextEditing"))}focusin(e){this._focusEventsAllowed&&(super.focusin(e),e.target!==this.editorDiv)&&this.editorDiv.focus()}onceAdded(){this.width?this.#Xe():(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()}#Ke(){var e=this.editorDiv.getElementsByTagName("div");if(0===e.length)return this.editorDiv.innerText;var t=[];for(const i of e)t.push(i.innerText.replace(/\r\n?|\n/,""));return t.join("\n")}#$e(){const[e,t]=this.parentDimensions;let i;if(this.isAttachedToDOM)i=this.div.getBoundingClientRect();else{const{currentLayer:e,div:t}=this,n=t.style.display;t.style.display="hidden",e.div.append(this.div),i=t.getBoundingClientRect(),t.remove(),t.style.display=n}this.rotation%180==this.parentRotation%180?(this.width=i.width/e,this.height=i.height/t):(this.width=i.height/e,this.height=i.width/t),this.fixAndSetPosition()}commit(){if(this.isInEditMode()){super.commit(),this.disableEditMode();const e=this.#ze,t=this.#ze=this.#Ke().trimEnd();if(e!==t){const i=e=>{(this.#ze=e)?(this.#Ye(),this._uiManager.rebuild(this),this.#$e()):this.remove()};this.addCommands({cmd:()=>{i(t)},undo:()=>{i(e)},mustExec:!1}),this.#$e()}}}shouldGetKeyboardEvents(){return this.isInEditMode()}enterInEditMode(){this.enableEditMode(),this.editorDiv.focus()}dblclick(e){this.enterInEditMode()}keydown(e){e.target===this.div&&"Enter"===e.key&&(this.enterInEditMode(),e.preventDefault())}editorDivKeydown(e){r._keyboardManager.exec(this,e)}editorDivFocus(e){this.isEditing=!0}editorDivBlur(e){this.isEditing=!1}editorDivInput(e){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){let r,s;this.width&&(r=this.x,s=this.y),super.render(),this.editorDiv=document.createElement("div"),this.editorDiv.className="internal",this.editorDiv.setAttribute("id",this.#We),this.enableEditing(),n.AnnotationEditor._l10nPromise.get("editor_free_text2_aria_label").then(e=>this.editorDiv?.setAttribute("aria-label",e)),n.AnnotationEditor._l10nPromise.get("free_text2_default_content").then(e=>this.editorDiv?.setAttribute("default-content",e)),this.editorDiv.contentEditable=!0;const c=this.editorDiv["style"];if(c.fontSize=`calc(${this.#He}px * var(--scale-factor))`,c.color=this.#Ue,this.div.append(this.editorDiv),this.overlayDiv=document.createElement("div"),this.overlayDiv.classList.add("overlay","enabled"),this.div.append(this.overlayDiv),(0,u.bindEvents)(this,this.div,["dblclick","keydown"]),this.width){const[c,d]=this.parentDimensions;if(this.annotationElementId){const u=this.#qe["position"];let[e,t]=this.getInitialTranslation();[e,t]=this.pageTranslationToScreen(e,t);var[o,a]=this.pageDimensions,[l,h]=this.pageTranslation;let i,n;switch(this.rotation){case 0:i=r+(u[0]-l)/o,n=s+this.height-(u[1]-h)/a;break;case 90:i=r+(u[0]-l)/o,n=s-(u[1]-h)/a,[e,t]=[t,-e];break;case 180:i=r-this.width+(u[0]-l)/o,n=s-(u[1]-h)/a,[e,t]=[-e,-t];break;case 270:i=r+(u[0]-l-this.height*a)/o,n=s+(u[1]-h-this.width*o)/a,[e,t]=[-t,e]}this.setAt(i*c,n*d,e,t)}else this.setAt(r*c,s*d,this.width*c,this.height*d);this.#Ye(),this._isDraggable=!0,this.editorDiv.contentEditable=!1}else this._isDraggable=!1,this.editorDiv.contentEditable=!0}return this.div}#Ye(){if(this.editorDiv.replaceChildren(),this.#ze)for(const t of this.#ze.split("\n")){var e=document.createElement("div");e.append(t?document.createTextNode(t):document.createElement("br")),this.editorDiv.append(e)}}get contentDiv(){return this.editorDiv}static deserialize(e,t,i){let n=null;if(e instanceof c.FreeTextAnnotationElement){const{data:{defaultAppearanceData:{fontSize:t,fontColor:i},rect:r,rotation:c,id:s},textContent:o,textPosition:a,parent:{page:{pageNumber:l}}}=e;if(!o||0===o.length)return null;n=e={annotationType:h.AnnotationEditorType.FREETEXT,color:Array.from(i),fontSize:t,value:o.join("\n"),position:a,pageIndex:l-1,rect:r,rotation:c,id:s,deleted:!1}}const r=super.deserialize(e,t,i);return r.#He=e.fontSize,r.#Ue=h.Util.makeHexColor(...e.color),r.#ze=e.value,r.annotationElementId=e.id||null,r.#qe=n,r}serialize(){var e=0<arguments.length&&void 0!==arguments[0]&&arguments[0];if(this.isEmpty())return null;if(this.deleted)return{pageIndex:this.pageIndex,id:this.annotationElementId,deleted:!0};var t=r._internalPadding*this.parentScale,t=this.getRect(t,t),i=n.AnnotationEditor._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:this.#Ue),i={annotationType:h.AnnotationEditorType.FREETEXT,color:i,fontSize:this.#He,value:this.#ze,pageIndex:this.pageIndex,rect:t,rotation:this.rotation,structTreeParentId:this._structTreeParentId};if(!e){if(this.annotationElementId&&!this.#Je(i))return null;i.id=this.annotationElementId}return i}#Je(e){const{value:t,fontSize:i,color:n,rect:r,pageIndex:s}=this.#qe;return e.value!==t||e.fontSize!==i||e.rect.some((e,t)=>1<=Math.abs(e-r[t]))||e.color.some((e,t)=>e!==n[t])||e.pageIndex!==s}#Xe(){var e=0<arguments.length&&void 0!==arguments[0]&&arguments[0];this.annotationElementId&&(this.#$e(),e||0!==this.width&&0!==this.height?(e=r._internalPadding*this.parentScale,this.#qe.rect=this.getRect(e,e)):setTimeout(()=>this.#Xe(!0),0))}}t.FreeTextEditor=r},(D,e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.StampAnnotationElement=e.InkAnnotationElement=e.FreeTextAnnotationElement=e.AnnotationLayer=void 0,t(89),t(125),t(136),t(138),t(141),t(143),t(145),t(147);var u=t(1),d=t(168),s=t(163),r=t(199),o=t(200),p=t(201);const m=new WeakSet;function g(e){return{width:e[2]-e[0],height:e[3]-e[1]}}class a{static create(e){switch(e.data.annotationType){case u.AnnotationType.LINK:return new i(e);case u.AnnotationType.TEXT:return new l(e);case u.AnnotationType.WIDGET:switch(e.data.fieldType){case"Tx":return new h(e);case"Btn":return new(e.data.radioButton?y:e.data.checkBox?v:b)(e);case"Ch":return new w(e);case"Sig":return new c(e)}return new f(e);case u.AnnotationType.POPUP:return new x(e);case u.AnnotationType.FREETEXT:return new A(e);case u.AnnotationType.LINE:return new k(e);case u.AnnotationType.SQUARE:return new _(e);case u.AnnotationType.CIRCLE:return new C(e);case u.AnnotationType.POLYLINE:return new T(e);case u.AnnotationType.CARET:return new M(e);case u.AnnotationType.INK:return new R(e);case u.AnnotationType.POLYGON:return new E(e);case u.AnnotationType.HIGHLIGHT:return new $(e);case u.AnnotationType.UNDERLINE:return new L(e);case u.AnnotationType.SQUIGGLY:return new I(e);case u.AnnotationType.STRIKEOUT:return new F(e);case u.AnnotationType.STAMP:return new P(e);case u.AnnotationType.FILEATTACHMENT:return new O(e);default:return new n(e)}}}class n{#Qe=!1;constructor(e){var{isRenderable:t=!1,ignoreBorder:i=!1,createQuadrilaterals:n=!1}=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};this.isRenderable=t,this.data=e.data,this.layer=e.layer,this.linkService=e.linkService,this.downloadManager=e.downloadManager,this.imageResourcesPath=e.imageResourcesPath,this.renderForms=e.renderForms,this.svgFactory=e.svgFactory,this.annotationStorage=e.annotationStorage,this.enableScripting=e.enableScripting,this.hasJSActions=e.hasJSActions,this._fieldObjects=e.fieldObjects,this.parent=e.parent,t&&(this.container=this._createContainer(i)),n&&this._createQuadrilaterals()}static _hasPopupData(e){var{titleObj:e,contentsObj:t,richText:i}=e;return!!(e?.str||t?.str||i?.str)}get hasPopupData(){return n._hasPopupData(this.data)}_createContainer(e){const{data:t,parent:{page:i,viewport:n}}=this,r=document.createElement("section");r.setAttribute("data-annotation-id",t.id),this instanceof f||(r.tabIndex=1e3),r.style.zIndex=this.parent.zIndex++,this.data.popupRef&&r.setAttribute("aria-haspopup","dialog"),t.noRotate&&r.classList.add("norotate");var{pageWidth:s,pageHeight:o,pageX:a,pageY:l}=n.rawDims;if(!t.rect||this instanceof x){const e=t["rotation"];t.hasOwnCanvas||0===e||this.setRotation(e,r)}else{var{width:h,height:c}=g(t.rect),d=u.Util.normalizeRect([t.rect[0],i.view[3]-t.rect[1]+i.view[1],t.rect[2],i.view[3]-t.rect[3]+i.view[1]]);if(!e&&0<t.borderStyle.width){r.style.borderWidth=t.borderStyle.width+"px";const e=t.borderStyle.horizontalCornerRadius,i=t.borderStyle.verticalCornerRadius;if(0<e||0<i){const t=`calc(${e}px * var(--scale-factor)) / calc(${i}px * var(--scale-factor))`;r.style.borderRadius=t}else if(this instanceof y){const e=`calc(${h}px * var(--scale-factor)) / calc(${c}px * var(--scale-factor))`;r.style.borderRadius=e}switch(t.borderStyle.style){case u.AnnotationBorderStyleType.SOLID:r.style.borderStyle="solid";break;case u.AnnotationBorderStyleType.DASHED:r.style.borderStyle="dashed";break;case u.AnnotationBorderStyleType.BEVELED:(0,u.warn)("Unimplemented border style: beveled");break;case u.AnnotationBorderStyleType.INSET:(0,u.warn)("Unimplemented border style: inset");break;case u.AnnotationBorderStyleType.UNDERLINE:r.style.borderBottomStyle="solid"}const n=t.borderColor||null;n?(this.#Qe=!0,r.style.borderColor=u.Util.makeHexColor(0|n[0],0|n[1],0|n[2])):r.style.borderWidth=0}r.style.left=100*(d[0]-a)/s+"%",r.style.top=100*(d[1]-l)/o+"%";e=t["rotation"];t.hasOwnCanvas||0===e?(r.style.width=100*h/s+"%",r.style.height=100*c/o+"%"):this.setRotation(e,r)}return r}setRotation(i){var n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:this.container;if(this.data.rect){var{pageWidth:r,pageHeight:s}=this.parent.viewport.rawDims,{width:o,height:a}=g(this.data.rect);let e,t;t=i%180==0?(e=100*o/r,100*a/s):(e=100*a/r,100*o/s),n.style.width=e+"%",n.style.height=t+"%",n.setAttribute("data-main-rotation",(360-i)%360)}}get _commonActions(){const t=(e,t,i)=>{var e=i.detail[e],n=e[0],e=e.slice(1);i.target.style[t]=r.ColorConverters[n+"_HTML"](e),this.annotationStorage.setValue(this.data.id,{[t]:r.ColorConverters[n+"_rgb"](e)})};return(0,u.shadow)(this,"_commonActions",{display:e=>{var e=e.detail["display"],t=e%2==1;this.container.style.visibility=t?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noView:t,noPrint:1===e||2===e})},print:e=>{this.annotationStorage.setValue(this.data.id,{noPrint:!e.detail.print})},hidden:e=>{e=e.detail.hidden;this.container.style.visibility=e?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noPrint:e,noView:e})},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=>{e=e.detail.rotation;this.setRotation(e),this.annotationStorage.setValue(this.data.id,{rotation:e})}})}_dispatchEventFromSandbox(e,t){var i=this._commonActions;for(const n of Object.keys(t.detail))(e[n]||i[n])?.(t)}_setDefaultPropertiesFromJS(e){if(this.enableScripting){var t=this.annotationStorage.getRawValue(this.data.id);if(t){var i,n,r=this._commonActions;for([i,n]of Object.entries(t)){var s=r[i];s&&(s({detail:{[i]:n},target:e}),delete t[i])}}}}_createQuadrilaterals(){if(this.container){const t=this.data["quadPoints"];if(t){const[i,n,r,s]=this.data.rect;if(1===t.length){const[,{x:o,y:e},{x:a,y:l}]=t[0];if(r===o&&s===e&&i===a&&n===l)return}const o=this.container["style"];let e;if(this.#Qe){const{borderColor:t,borderWidth:i}=o;o.borderWidth=0,e=["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="${t}" stroke-width="${i}">`],this.container.classList.add("hasBorder")}const a=r-i,l=s-n,h=this["svgFactory"],c=h.createElement("svg"),d=(c.classList.add("quadrilateralsContainer"),c.setAttribute("width",0),c.setAttribute("height",0),h.createElement("defs")),u=(c.append(d),h.createElement("clipPath")),p="clippath_"+this.data.id;u.setAttribute("id",p),u.setAttribute("clipPathUnits","objectBoundingBox"),d.append(u);for(const[,{x:n,y:r},{x:o,y:c}]of t){const t=h.createElement("rect"),d=(o-i)/a,p=(s-r)/l,m=(n-o)/a,g=(r-c)/l;t.setAttribute("x",d),t.setAttribute("y",p),t.setAttribute("width",m),t.setAttribute("height",g),u.append(t),e?.push(`<rect vector-effect="non-scaling-stroke" x="${d}" y="${p}" width="${m}" height="${g}"/>`)}this.#Qe&&(e.push("</g></svg>')"),o.backgroundImage=e.join("")),this.container.append(c),this.container.style.clipPath=`url(#${p})`}}}_createPopup(){var{container:e,data:t}=this,e=(e.setAttribute("aria-haspopup","dialog"),new x({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(){(0,u.unreachable)("Abstract method `AnnotationElement.render` called")}_getElementsByName(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null,i=[];if(this._fieldObjects){var n,r,s=this._fieldObjects[e];if(s)for(const{page:e,id:o,exportValues:a}of s)-1!==e&&o!==t&&(n="string"==typeof a?a:null,!(r=document.querySelector(`[data-element-id="${o}"]`))||m.has(r)?i.push({id:o,exportValue:n,domElement:r}):(0,u.warn)("_getElementsByName - element not allowed: "+o))}else for(const u of document.getElementsByName(e)){const e=u["exportValue"],l=u.getAttribute("data-element-id");l!==t&&m.has(u)&&i.push({id:l,exportValue:e,domElement:u})}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(){var e=this.getElementsToTriggerPopup();if(Array.isArray(e))for(const t of e)t.classList.add("highlightArea");else e.classList.add("highlightArea")}_editOnDoubleClick(){const{annotationEditorType:e,data:{id:t}}=this;this.container.addEventListener("dblclick",()=>{this.linkService.eventBus?.dispatch("switchannotationeditormode",{source:this,mode:e,editId:t})})}}class i extends n{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!!(1<arguments.length&&void 0!==arguments[1]?arguments[1]:null)?.ignoreBorder,createQuadrilaterals:!0}),this.isTooltipOnly=e.data.isTooltipOnly}render(){var{data:e,linkService:t}=this,i=document.createElement("a");i.setAttribute("data-element-id",e.id);let n=!1;return e.url?(t.addLinkAttributes(i,e.url,e.newWindow),n=!0):e.action?(this._bindNamedAction(i,e.action),n=!0):e.attachment?(this._bindAttachment(i,e.attachment),n=!0):e.setOCGState?(this.#Ze(i,e.setOCGState),n=!0):e.dest?(this._bindLink(i,e.dest),n=!0):(e.actions&&(e.actions.Action||e.actions["Mouse Up"]||e.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(i,e),n=!0),e.resetForm?(this._bindResetFormAction(i,e.resetForm),n=!0):this.isTooltipOnly&&!n&&(this._bindLink(i,""),n=!0)),this.container.classList.add("linkAnnotation"),n&&this.container.append(i),this.container}#tn(){this.container.setAttribute("data-internal-link","")}_bindLink(e,t){e.href=this.linkService.getDestinationHash(t),e.onclick=()=>(t&&this.linkService.goToDestination(t),!1),!t&&""!==t||this.#tn()}_bindNamedAction(e,t){e.href=this.linkService.getAnchorUrl(""),e.onclick=()=>(this.linkService.executeNamedAction(t),!1),this.#tn()}_bindAttachment(e,t){e.href=this.linkService.getAnchorUrl(""),e.onclick=()=>(this.downloadManager?.openOrDownloadData(this.container,t.content,t.filename),!1),this.#tn()}#Ze(e,t){e.href=this.linkService.getAnchorUrl(""),e.onclick=()=>(this.linkService.executeSetOCGState(t),!1),this.#tn()}_bindJSAction(e,t){e.href=this.linkService.getAnchorUrl("");var i=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const r of Object.keys(t.actions)){var n=i.get(r);n&&(e[n]=()=>(this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t.id,name:r}}),!1))}e.onclick||(e.onclick=()=>!1),this.#tn()}_bindResetFormAction(e,o){const a=e.onclick;a||(e.href=this.linkService.getAnchorUrl("")),this.#tn(),this._fieldObjects?e.onclick=()=>{a?.();const{fields:e,refs:t,include:i}=o,n=[];if(0!==e.length||0!==t.length){const o=new Set(t);for(const a of e){const e=this._fieldObjects[a]||[];for(const{id:a}of e)o.add(a)}for(const e of Object.values(this._fieldObjects))for(const a of e)o.has(a.id)===i&&n.push(a)}else for(const e of Object.values(this._fieldObjects))n.push(...e);var r=this.annotationStorage,s=[];for(const e of n){const o=e["id"];switch(s.push(o),e.type){case"text":{const a=e.defaultValue||"";r.setValue(o,{value:a});break}case"checkbox":case"radiobutton":{const a=e.defaultValue===e.exportValues;r.setValue(o,{value:a});break}case"combobox":case"listbox":{const a=e.defaultValue||"";r.setValue(o,{value:a});break}default:continue}const a=document.querySelector(`[data-element-id="${o}"]`);a&&(m.has(a)?a.dispatchEvent(new Event("resetform")):(0,u.warn)("_bindResetFormAction - element not allowed: "+o))}return this.enableScripting&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:s,name:"ResetForm"}}),!1}:((0,u.warn)('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),a||(e.onclick=()=>!1))}}class l extends n{constructor(e){super(e,{isRenderable:!0})}render(){this.container.classList.add("textAnnotation");var e=document.createElement("img");return e.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",e.alt="[{{type}} Annotation]",e.dataset.l10nId="text_annotation_type",e.dataset.l10nArgs=JSON.stringify({type:this.data.name}),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.append(e),this.container}}class f extends n{render(){return this.data.alternativeText&&(this.container.title=this.data.alternativeText),this.container}showElementAndHideCanvas(e){this.data.hasOwnCanvas&&("CANVAS"===e.previousSibling?.nodeName&&(e.previousSibling.hidden=!0),e.hidden=!1)}_getKeyModifier(e){var{isWin:t,isMac:i}=u.FeatureTest.platform;return t&&e.ctrlKey||i&&e.metaKey}_setEventListener(e,t,i,n,r){i.includes("mouse")?e.addEventListener(i,e=>{this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:n,value:r(e),shift:e.shiftKey,modifier:this._getKeyModifier(e)}})}):e.addEventListener(i,e=>{if("blur"===i){if(!t.focused||!e.relatedTarget)return;t.focused=!1}else if("focus"===i){if(t.focused)return;t.focused=!0}r&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:n,value:r(e)}})})}_setEventListeners(e,t,i,n){for(var[r,s]of i)"Action"!==s&&!this.data.actions?.[s]||("Focus"!==s&&"Blur"!==s||(t||={focused:!1}),this._setEventListener(e,t,r,s,n),"Focus"!==s||this.data.actions?.Blur?"Blur"!==s||this.data.actions?.Focus||this._setEventListener(e,t,"focus","Focus",null):this._setEventListener(e,t,"blur","Blur",null))}_setBackgroundColor(e){var t=this.data.backgroundColor||null;e.style.backgroundColor=null===t?"transparent":u.Util.makeHexColor(t[0],t[1],t[2])}_setTextStyle(e){const t=["left","center","right"],i=this.data.defaultAppearanceData["fontColor"],n=this.data.defaultAppearanceData.fontSize||9,r=e.style;let s;var o=e=>Math.round(10*e)/10;if(this.data.multiLine){const e=Math.abs(this.data.rect[3]-this.data.rect[1]-2),t=e/(Math.round(e/(u.LINE_FACTOR*n))||1);s=Math.min(n,o(t/u.LINE_FACTOR))}else{const e=Math.abs(this.data.rect[3]-this.data.rect[1]-2);s=Math.min(n,o(e/u.LINE_FACTOR))}r.fontSize=`calc(${s}px * var(--scale-factor))`,r.color=u.Util.makeHexColor(i[0],i[1],i[2]),null!==this.data.textAlignment&&(r.textAlign=t[this.data.textAlignment])}_setRequired(e,t){t?e.setAttribute("required",!0):e.removeAttribute("required"),e.setAttribute("aria-required",t)}}class h extends f{constructor(e){super(e,{isRenderable:e.renderForms||!e.data.hasAppearance&&!!e.data.fieldValue})}setPropertyOnSiblings(e,t,i,n){var r=this.annotationStorage;for(const s of this._getElementsByName(e.name,e.id))s.domElement&&(s.domElement[t]=i),r.setValue(s.id,{[n]:i})}render(){const n=this.annotationStorage,l=this.data.id;this.container.classList.add("textWidgetAnnotation");let r=null;if(this.renderForms){var s=n.getValue(l,{value:this.data.fieldValue});let e=s.value||"";var o=n.getValue(l,{charLimit:this.data.maxLen}).charLimit;o&&e.length>o&&(e=e.slice(0,o));let t=s.formattedValue||this.data.textContent?.join("\n")||null;t&&this.data.comb&&(t=t.replaceAll(/\s+/g,""));const h={userValue:e,formattedValue:t,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?((r=document.createElement("textarea")).textContent=t??e,this.data.doNotScroll&&(r.style.overflowY="hidden")):((r=document.createElement("input")).type="text",r.setAttribute("value",t??e),this.data.doNotScroll&&(r.style.overflowX="hidden")),this.data.hasOwnCanvas&&(r.hidden=!0),m.add(r),r.setAttribute("data-element-id",l),r.disabled=this.data.readOnly,r.name=this.data.fieldName,r.tabIndex=1e3,this._setRequired(r,this.data.required),o&&(r.maxLength=o),r.addEventListener("input",e=>{n.setValue(l,{value:e.target.value}),this.setPropertyOnSiblings(r,"value",e.target.value,"value"),h.formattedValue=null}),r.addEventListener("resetform",e=>{var t=this.data.defaultFieldValue??"";r.value=h.userValue=t,h.formattedValue=null});let i=e=>{var t=h["formattedValue"];null!=t&&(e.target.value=t),e.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){r.addEventListener("focus",e=>{h.focused||(e=e["target"],h.userValue&&(e.value=h.userValue),h.lastCommittedValue=e.value,h.commitKey=1,h.focused=!0)}),r.addEventListener("updatefromsandbox",e=>{this.showElementAndHideCanvas(e.target),this._dispatchEventFromSandbox({value(e){h.userValue=e.detail.value??"",n.setValue(l,{value:h.userValue.toString()}),e.target.value=h.userValue},formattedValue(e){var t=e.detail["formattedValue"];null!=(h.formattedValue=t)&&e.target!==document.activeElement&&(e.target.value=t),n.setValue(l,{formattedValue:t})},selRange(e){e.target.setSelectionRange(...e.detail.selRange)},charLimit:t=>{var i=t.detail["charLimit"],t=t["target"];if(0===i)t.removeAttribute("maxLength");else{t.setAttribute("maxLength",i);let e=h.userValue;!e||e.length<=i||(e=e.slice(0,i),t.value=h.userValue=e,n.setValue(l,{value:e}),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:l,name:"Keystroke",value:e,willCommit:!0,commitKey:1,selStart:t.selectionStart,selEnd:t.selectionEnd}}))}}},e)}),r.addEventListener("keydown",e=>{let t=-(h.commitKey=1);var i;"Escape"===e.key?t=0:"Enter"!==e.key||this.data.multiLine?"Tab"===e.key&&(h.commitKey=3):t=2,-1!==t&&(i=e.target.value,h.lastCommittedValue!==i)&&(h.lastCommittedValue=i,h.userValue=i,this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:l,name:"Keystroke",value:i,willCommit:!0,commitKey:t,selStart:e.target.selectionStart,selEnd:e.target.selectionEnd}}))});const a=i;i=null,r.addEventListener("blur",e=>{var t;h.focused&&e.relatedTarget&&(h.focused=!1,t=e.target["value"],h.userValue=t,h.lastCommittedValue!==t&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:l,name:"Keystroke",value:t,willCommit:!0,commitKey:h.commitKey,selStart:e.target.selectionStart,selEnd:e.target.selectionEnd}}),a(e))}),this.data.actions?.Keystroke&&r.addEventListener("beforeinput",e=>{h.lastCommittedValue=null;var{data:t,target:i}=e,{value:n,selectionStart:r,selectionEnd:s}=i;let o=r,a=s;switch(e.inputType){case"deleteWordBackward":{const e=n.substring(0,r).match(/\w*[^\w]*$/);e&&(o-=e[0].length);break}case"deleteWordForward":{const e=n.substring(r).match(/^[^\w]*\w*/);e&&(a+=e[0].length);break}case"deleteContentBackward":r===s&&--o;break;case"deleteContentForward":r===s&&(a+=1)}e.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:l,name:"Keystroke",value:n,change:t||"",willCommit:!1,selStart:o,selEnd:a}})}),this._setEventListeners(r,h,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],e=>e.target.value)}if(i&&r.addEventListener("blur",i),this.data.comb){const n=(this.data.rect[2]-this.data.rect[0])/o;r.classList.add("comb"),r.style.letterSpacing=`calc(${n}px * var(--scale-factor) - 1ch)`}}else(r=document.createElement("div")).textContent=this.data.fieldValue,r.style.verticalAlign="middle",r.style.display="table-cell";return this._setTextStyle(r),this._setBackgroundColor(r),this._setDefaultPropertiesFromJS(r),this.container.append(r),this.container}}class c extends f{constructor(e){super(e,{isRenderable:!!e.data.hasOwnCanvas})}}class v extends f{constructor(e){super(e,{isRenderable:e.renderForms})}render(){const n=this.annotationStorage,r=this.data,s=r.id;let e=n.getValue(s,{value:r.exportValue===r.fieldValue}).value;"string"==typeof e&&(e="Off"!==e,n.setValue(s,{value:e})),this.container.classList.add("buttonWidgetAnnotation","checkBox");var t=document.createElement("input");return m.add(t),t.setAttribute("data-element-id",s),t.disabled=r.readOnly,this._setRequired(t,this.data.required),t.type="checkbox",t.name=r.fieldName,e&&t.setAttribute("checked",!0),t.setAttribute("exportValue",r.exportValue),t.tabIndex=1e3,t.addEventListener("change",e=>{var{name:t,checked:i}=e.target;for(const e of this._getElementsByName(t,s)){const s=i&&e.exportValue===r.exportValue;e.domElement&&(e.domElement.checked=s),n.setValue(e.id,{value:s})}n.setValue(s,{value:i})}),t.addEventListener("resetform",e=>{var t=r.defaultFieldValue||"Off";e.target.checked=t===r.exportValue}),this.enableScripting&&this.hasJSActions&&(t.addEventListener("updatefromsandbox",e=>{this._dispatchEventFromSandbox({value(e){e.target.checked="Off"!==e.detail.value,n.setValue(s,{value:e.target.checked})}},e)}),this._setEventListeners(t,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],e=>e.target.checked)),this._setBackgroundColor(t),this._setDefaultPropertiesFromJS(t),this.container.append(t),this.container}}class y extends f{constructor(e){super(e,{isRenderable:e.renderForms})}render(){this.container.classList.add("buttonWidgetAnnotation","radioButton");const i=this.annotationStorage,n=this.data,r=n.id;let s=i.getValue(r,{value:n.fieldValue===n.buttonValue}).value;"string"==typeof s&&(s=s!==n.buttonValue,i.setValue(r,{value:s}));var e=document.createElement("input");if(m.add(e),e.setAttribute("data-element-id",r),e.disabled=n.readOnly,this._setRequired(e,this.data.required),e.type="radio",e.name=n.fieldName,s&&e.setAttribute("checked",!0),e.tabIndex=1e3,e.addEventListener("change",e=>{var{name:t,checked:e}=e.target;for(const e of this._getElementsByName(t,r))i.setValue(e.id,{value:!1});i.setValue(r,{value:e})}),e.addEventListener("resetform",e=>{var t=n.defaultFieldValue;e.target.checked=null!=t&&t===n.buttonValue}),this.enableScripting&&this.hasJSActions){const s=n.buttonValue;e.addEventListener("updatefromsandbox",e=>{this._dispatchEventFromSandbox({value:e=>{var t=s===e.detail.value;for(const s of this._getElementsByName(e.target.name)){const e=t&&s.id===r;s.domElement&&(s.domElement.checked=e),i.setValue(s.id,{value:e})}}},e)}),this._setEventListeners(e,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],e=>e.target.checked)}return this._setBackgroundColor(e),this._setDefaultPropertiesFromJS(e),this.container.append(e),this.container}}class b extends i{constructor(e){super(e,{ignoreBorder:e.data.hasAppearance})}render(){var e=super.render(),t=(e.classList.add("buttonWidgetAnnotation","pushButton"),this.data.alternativeText&&(e.title=this.data.alternativeText),e.lastChild);return this.enableScripting&&this.hasJSActions&&t&&(this._setDefaultPropertiesFromJS(t),t.addEventListener("updatefromsandbox",e=>{this._dispatchEventFromSandbox({},e)})),e}}class w extends f{constructor(e){super(e,{isRenderable:e.renderForms})}render(){this.container.classList.add("choiceWidgetAnnotation");const s=this.annotationStorage,o=this.data.id,e=s.getValue(o,{value:this.data.fieldValue}),a=document.createElement("select");m.add(a),a.setAttribute("data-element-id",o),a.disabled=this.data.readOnly,this._setRequired(a,this.data.required),a.name=this.data.fieldName,a.tabIndex=1e3;let t=this.data.combo&&0<this.data.options.length;this.data.combo||(a.size=this.data.options.length,this.data.multiSelect&&(a.multiple=!0)),a.addEventListener("resetform",e=>{var t=this.data.defaultFieldValue;for(const e of a.options)e.selected=e.value===t});for(const s of this.data.options){const o=document.createElement("option");o.textContent=s.displayValue,o.value=s.exportValue,e.value.includes(s.exportValue)&&(o.setAttribute("selected",!0),t=!1),a.append(o)}let i=null;if(t){const s=document.createElement("option");s.value=" ",s.setAttribute("hidden",!0),s.setAttribute("selected",!0),a.prepend(s),i=()=>{s.remove(),a.removeEventListener("input",i),i=null},a.addEventListener("input",i)}const l=e=>{const t=e?"value":"textContent",{options:i,multiple:n}=a;return n?Array.prototype.filter.call(i,e=>e.selected).map(e=>e[t]):-1===i.selectedIndex?null:i[i.selectedIndex][t]};let h=l(!1);const c=e=>{e=e.target.options;return Array.prototype.map.call(e,e=>({displayValue:e.textContent,exportValue:e.value}))};return this.enableScripting&&this.hasJSActions?(a.addEventListener("updatefromsandbox",e=>{this._dispatchEventFromSandbox({value(e){i?.();var e=e.detail.value,t=new Set(Array.isArray(e)?e:[e]);for(const s of a.options)s.selected=t.has(s.value);s.setValue(o,{value:l(!0)}),h=l(!1)},multipleSelection(e){a.multiple=!0},remove(e){var t=a.options,i=e.detail.remove;t[i].selected=!1,a.remove(i),0<t.length&&-1===Array.prototype.findIndex.call(t,e=>e.selected)&&(t[0].selected=!0),s.setValue(o,{value:l(!0),items:c(e)}),h=l(!1)},clear(e){for(;0!==a.length;)a.remove(0);s.setValue(o,{value:null,items:[]}),h=l(!1)},insert(e){var{index:t,displayValue:i,exportValue:n}=e.detail.insert,t=a.children[t],r=document.createElement("option");r.textContent=i,r.value=n,t?t.before(r):a.append(r),s.setValue(o,{value:l(!0),items:c(e)}),h=l(!1)},items(e){const t=e.detail["items"];for(;0!==a.length;)a.remove(0);for(const s of t){const{displayValue:o,exportValue:e}=s,t=document.createElement("option");t.textContent=o,t.value=e,a.append(t)}0<a.options.length&&(a.options[0].selected=!0),s.setValue(o,{value:l(!0),items:c(e)}),h=l(!1)},indices(e){var t=new Set(e.detail.indices);for(const s of e.target.options)s.selected=t.has(s.index);s.setValue(o,{value:l(!0)}),h=l(!1)},editable(e){e.target.disabled=!e.detail.editable}},e)}),a.addEventListener("input",e=>{var t=l(!0);s.setValue(o,{value:t}),e.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:o,name:"Keystroke",value:h,changeEx:t,willCommit:!1,commitKey:1,keyDown:!1}})}),this._setEventListeners(a,null,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"],["input","Validate"]],e=>e.target.value)):a.addEventListener("input",function(e){s.setValue(o,{value:l(!0)})}),this.data.combo&&this._setTextStyle(a),this._setBackgroundColor(a),this._setDefaultPropertiesFromJS(a),this.container.append(a),this.container}}class x extends n{constructor(e){var{data:t,elements:i}=e;super(e,{isRenderable:n._hasPopupData(t)}),this.elements=i}render(){this.container.classList.add("popupAnnotation");var e=new S({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}),t=[];for(const i of this.elements)i.popup=e,t.push(i.data.id),i.addHighlightArea();return this.container.setAttribute("aria-controls",t.map(e=>""+u.AnnotationPrefix+e).join(",")),this.container}}class S{#en=null;#nn=this.#in.bind(this);#rn=this.#sn.bind(this);#an=this.#on.bind(this);#ln=this.#cn.bind(this);#Ue=null;#Rt=null;#hn=null;#dn=null;#un=null;#pn=null;#fn=!1;#gn=null;#mn=null;#bn=null;#vn=null;#yn=!1;constructor(e){var{container:e,color:t,elements:i,titleObj:n,modificationDate:r,contentsObj:s,richText:o,parent:a,rect:l,parentRect:h,open:c}=e,e=(this.#Rt=e,this.#vn=n,this.#hn=s,this.#bn=o,this.#un=a,this.#Ue=t,this.#mn=l,this.#pn=h,this.#dn=i,d.PDFDateString.toDateObject(r));e&&(this.#en=a.l10n.get("annotation_date_string",{date:e.toLocaleDateString(),time:e.toLocaleTimeString()})),this.trigger=i.flatMap(e=>e.getElementsToTriggerPopup());for(const e of this.trigger)e.addEventListener("click",this.#ln),e.addEventListener("mouseenter",this.#an),e.addEventListener("mouseleave",this.#rn),e.classList.add("popupTriggerArea");for(const e of i)e.container?.addEventListener("keydown",this.#nn);this.#Rt.hidden=!0,c&&this.#cn()}render(){if(!this.#gn){const{page:{view:s},viewport:{rawDims:{pageWidth:o,pageHeight:a,pageX:l,pageY:h}}}=this.#un,c=this.#gn=document.createElement("div");if(c.className="popup",this.#Ue){const s=c.style.outlineColor=u.Util.makeHexColor(...this.#Ue);if(CSS.supports("background-color","color-mix(in srgb, red 30%, white)"))c.style.backgroundColor=`color-mix(in srgb, ${s} 30%, white)`;else{const s=.7;c.style.backgroundColor=u.Util.makeHexColor(...this.#Ue.map(e=>Math.floor(.7*(255-e)+e)))}}var i=document.createElement("span"),n=(i.className="header",document.createElement("h1"));if(i.append(n),{dir:n.dir,str:n.textContent}=this.#vn,c.append(i),this.#en){const s=document.createElement("span");s.classList.add("popupDate"),this.#en.then(e=>{s.textContent=e}),i.append(s)}n=this.#hn,i=this.#bn;if(!i?.str||n?.str&&n.str!==i.str){const s=this._formatContents(n);c.append(s)}else p.XfaLayer.render({xfaHtml:i.html,intent:"richText",div:c}),c.lastChild.classList.add("richText","popupContent");let e=!!this.#pn,t=e?this.#pn:this.#mn;for(const s of this.#dn)if(!t||null!==u.Util.intersect(s.data.rect,t)){t=s.data.rect,e=!0;break}var n=u.Util.normalizeRect([t[0],s[3]-t[1]+s[1],t[2],s[3]-t[3]+s[1]]),i=e?t[2]-t[0]+5:0,i=n[0]+i,n=n[1],r=this.#Rt["style"];r.left=100*(i-l)/o+"%",r.top=100*(n-h)/a+"%",this.#Rt.append(c)}}_formatContents(e){let{str:t,dir:i}=e;var n=document.createElement("p"),r=(n.classList.add("popupContent"),n.dir=i,t.split(/(?:\r\n?|\n)/));for(let e=0,t=r.length;e<t;++e){const i=r[e];n.append(document.createTextNode(i)),e<t-1&&n.append(document.createElement("br"))}return n}#in(e){e.altKey||e.shiftKey||e.ctrlKey||e.metaKey||("Enter"===e.key||"Escape"===e.key&&this.#fn)&&this.#cn()}#cn(){this.#fn=!this.#fn,this.#fn?(this.#on(),this.#Rt.addEventListener("click",this.#ln),this.#Rt.addEventListener("keydown",this.#nn)):(this.#sn(),this.#Rt.removeEventListener("click",this.#ln),this.#Rt.removeEventListener("keydown",this.#nn))}#on(){this.#gn||this.render(),this.isVisible?this.#fn&&this.#Rt.classList.add("focused"):(this.#Rt.hidden=!1,this.#Rt.style.zIndex=parseInt(this.#Rt.style.zIndex)+1e3)}#sn(){this.#Rt.classList.remove("focused"),!this.#fn&&this.isVisible&&(this.#Rt.hidden=!0,this.#Rt.style.zIndex=parseInt(this.#Rt.style.zIndex)-1e3)}forceHide(){this.#yn=this.isVisible,this.#yn&&(this.#Rt.hidden=!0)}maybeShow(){this.#yn&&(this.#yn=!1,this.#Rt.hidden=!1)}get isVisible(){return!1===this.#Rt.hidden}}class A extends n{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.textContent=e.data.textContent,this.textPosition=e.data.textPosition,this.annotationEditorType=u.AnnotationEditorType.FREETEXT}render(){if(this.container.classList.add("freeTextAnnotation"),this.textContent){var e=document.createElement("div");e.classList.add("annotationTextContent"),e.setAttribute("role","comment");for(const i of this.textContent){var t=document.createElement("span");t.textContent=i,e.append(t)}this.container.append(e)}return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this._editOnDoubleClick(),this.container}}e.FreeTextAnnotationElement=A;class k extends n{#_n=null;constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("lineAnnotation");var e=this.data,{width:t,height:i}=g(e.rect),t=this.svgFactory.create(t,i,!0),i=this.#_n=this.svgFactory.createElement("svg:line");return i.setAttribute("x1",e.rect[2]-e.lineCoordinates[0]),i.setAttribute("y1",e.rect[3]-e.lineCoordinates[1]),i.setAttribute("x2",e.rect[2]-e.lineCoordinates[2]),i.setAttribute("y2",e.rect[3]-e.lineCoordinates[3]),i.setAttribute("stroke-width",e.borderStyle.width||1),i.setAttribute("stroke","transparent"),i.setAttribute("fill","transparent"),t.append(i),this.container.append(t),!e.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#_n}addHighlightArea(){this.container.classList.add("highlightArea")}}class _ extends n{#An=null;constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("squareAnnotation");var e=this.data,{width:t,height:i}=g(e.rect),n=this.svgFactory.create(t,i,!0),r=e.borderStyle.width,s=this.#An=this.svgFactory.createElement("svg:rect");return s.setAttribute("x",r/2),s.setAttribute("y",r/2),s.setAttribute("width",t-r),s.setAttribute("height",i-r),s.setAttribute("stroke-width",r||1),s.setAttribute("stroke","transparent"),s.setAttribute("fill","transparent"),n.append(s),this.container.append(n),!e.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#An}addHighlightArea(){this.container.classList.add("highlightArea")}}class C extends n{#Sn=null;constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("circleAnnotation");var e=this.data,{width:t,height:i}=g(e.rect),n=this.svgFactory.create(t,i,!0),r=e.borderStyle.width,s=this.#Sn=this.svgFactory.createElement("svg:ellipse");return s.setAttribute("cx",t/2),s.setAttribute("cy",i/2),s.setAttribute("rx",t/2-r/2),s.setAttribute("ry",i/2-r/2),s.setAttribute("stroke-width",r||1),s.setAttribute("stroke","transparent"),s.setAttribute("fill","transparent"),n.append(s),this.container.append(n),!e.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#Sn}addHighlightArea(){this.container.classList.add("highlightArea")}}class T extends n{#En=null;constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.containerClassName="polylineAnnotation",this.svgElementName="svg:polyline"}render(){this.container.classList.add(this.containerClassName);const e=this.data,{width:t,height:i}=g(e.rect),n=this.svgFactory.create(t,i,!0);let r=[];for(const t of e.vertices){const i=t.x-e.rect[0],n=e.rect[3]-t.y;r.push(i+","+n)}r=r.join(" ");var s=this.#En=this.svgFactory.createElement(this.svgElementName);return s.setAttribute("points",r),s.setAttribute("stroke-width",e.borderStyle.width||1),s.setAttribute("stroke","transparent"),s.setAttribute("fill","transparent"),n.append(s),this.container.append(n),!e.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#En}addHighlightArea(){this.container.classList.add("highlightArea")}}class E extends T{constructor(e){super(e),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}}class M extends n{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("caretAnnotation"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container}}class R extends n{#xn=[];constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline",this.annotationEditorType=u.AnnotationEditorType.INK}render(){this.container.classList.add(this.containerClassName);const t=this.data,{width:i,height:e}=g(t.rect),n=this.svgFactory.create(i,e,!0);for(const i of t.inkLists){let e=[];for(const n of i){const i=n.x-t.rect[0],s=t.rect[3]-n.y;e.push(i+","+s)}e=e.join(" ");var r=this.svgFactory.createElement(this.svgElementName);this.#xn.push(r),r.setAttribute("points",e),r.setAttribute("stroke-width",t.borderStyle.width||1),r.setAttribute("stroke","transparent"),r.setAttribute("fill","transparent"),!t.popupRef&&this.hasPopupData&&this._createPopup(),n.append(r)}return this.container.append(n),this.container}getElementsToTriggerPopup(){return this.#xn}addHighlightArea(){this.container.classList.add("highlightArea")}}e.InkAnnotationElement=R;class $ extends n{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("highlightAnnotation"),this.container}}class L extends n{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("underlineAnnotation"),this.container}}class I extends n{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("squigglyAnnotation"),this.container}}class F extends n{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("strikeoutAnnotation"),this.container}}class P extends n{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("stampAnnotation"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container}}e.StampAnnotationElement=P;class O extends n{#wn=null;constructor(e){super(e,{isRenderable:!0});var{filename:e,content:t}=this.data.file;this.filename=(0,d.getFilenameFromUrl)(e,!0),this.content=t,this.linkService.eventBus?.dispatch("fileattachmentannotation",{source:this,filename:e,content:t})}render(){this.container.classList.add("fileAttachmentAnnotation");var{container:e,data:t}=this;let i;t.hasAppearance||0===t.fillAlpha?i=document.createElement("div"):((i=document.createElement("img")).src=`${this.imageResourcesPath}annotation-${/paperclip/i.test(t.name)?"paperclip":"pushpin"}.svg`,t.fillAlpha&&t.fillAlpha<1&&(i.style=`filter: opacity(${Math.round(100*t.fillAlpha)}%);`)),i.addEventListener("dblclick",this.#Cn.bind(this)),this.#wn=i;const n=u.FeatureTest.platform["isMac"];return e.addEventListener("keydown",e=>{"Enter"===e.key&&(n?e.metaKey:e.ctrlKey)&&this.#Cn()}),!t.popupRef&&this.hasPopupData?this._createPopup():i.classList.add("popupTriggerArea"),e.append(i),e}getElementsToTriggerPopup(){return this.#wn}addHighlightArea(){this.container.classList.add("highlightArea")}#Cn(){this.downloadManager?.openOrDownloadData(this.container,this.content,this.filename)}}e.AnnotationLayer=class{#Se=null;#Tn=null;#Pn=new Map;constructor(e){var{div:e,accessibilityManager:t,annotationCanvasMap:i,l10n:n,page:r,viewport:s}=e;this.div=e,this.#Se=t,this.#Tn=i,this.l10n=n,this.page=r,this.viewport=s,this.zIndex=0,this.l10n||=o.NullL10n}#kn(e,t){var i=e.firstChild||e;i.id=""+u.AnnotationPrefix+t,this.div.append(e),this.#Se?.moveElementInDOM(this.div,e,i,!1)}async render(e){const t=e["annotations"],i=this.div;(0,d.setLayerDimensions)(i,this.viewport);var n=new Map,r={data:null,layer:i,linkService:e.linkService,downloadManager:e.downloadManager,imageResourcesPath:e.imageResourcesPath||"",renderForms:!1!==e.renderForms,svgFactory:new d.DOMSVGFactory,annotationStorage:e.annotationStorage||new s.AnnotationStorage,enableScripting:!0===e.enableScripting,hasJSActions:e.hasJSActions,fieldObjects:e.fieldObjects,parent:this,elements:null};for(const e of t)if(!e.noHTML){const t=e.annotationType===u.AnnotationType.POPUP;if(t){const t=n.get(e.id);if(!t)continue;r.elements=t}else{const{width:t,height:i}=g(e.rect);if(t<=0||i<=0)continue}r.data=e;const i=a.create(r);if(i.isRenderable){if(!t&&e.popupRef){const t=n.get(e.popupRef);t?t.push(i):n.set(e.popupRef,[i])}0<i.annotationEditorType&&this.#Pn.set(i.data.id,i);const d=i.render();e.hidden&&(d.style.visibility="hidden"),this.#kn(d,e.id)}}this.#Mn(),await this.l10n.translate(i)}update(e){var e=e["viewport"],t=this.div;this.viewport=e,(0,d.setLayerDimensions)(t,{rotation:e.rotation}),this.#Mn(),t.hidden=!1}#Mn(){if(this.#Tn){var e,t,i=this.div;for([e,t]of this.#Tn){var n,r=i.querySelector(`[data-annotation-id="${e}"]`);r&&(n=r["firstChild"],n?"CANVAS"===n.nodeName?n.replaceWith(t):n.before(t):r.append(t))}this.#Tn.clear()}}getEditableAnnotations(){return Array.from(this.#Pn.values())}getEditableAnnotation(e){return this.#Pn.get(e)}}},(e,t)=>{function i(e){return Math.floor(255*Math.max(0,Math.min(1,e))).toString(16).padStart(2,"0")}function r(e){return Math.max(0,Math.min(255,255*e))}Object.defineProperty(t,"__esModule",{value:!0}),t.ColorConverters=void 0,t.ColorConverters=class{static CMYK_G(e){var[e,t,i,n]=e;return["G",1-Math.min(1,.3*e+.59*i+.11*t+n)]}static G_CMYK(e){var[e]=e;return["CMYK",0,0,0,1-e]}static G_RGB(e){var[e]=e;return["RGB",e,e,e]}static G_rgb(e){var[e]=e;return[e=r(e),e,e]}static G_HTML(e){var[e]=e,e=i(e);return"#"+e+e+e}static RGB_G(e){var[e,t,i]=e;return["G",.3*e+.59*t+.11*i]}static RGB_rgb(e){return e.map(r)}static RGB_HTML(e){return"#"+e.map(i).join("")}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB(e){var[e,t,i,n]=e;return["RGB",1-Math.min(1,e+n),1-Math.min(1,i+n),1-Math.min(1,t+n)]}static CMYK_rgb(e){var[e,t,i,n]=e;return[r(1-Math.min(1,e+n)),r(1-Math.min(1,i+n)),r(1-Math.min(1,t+n))]}static CMYK_HTML(e){e=this.CMYK_RGB(e).slice(1);return this.RGB_HTML(e)}static RGB_CMYK(e){var[e,t,i]=e,e=1-e,t=1-t,i=1-i;return["CMYK",e,t,i,Math.min(e,t,i)]}}},(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NullL10n=void 0,t.getL10nFallback=n;const i={of_pages:"of {{pagesCount}}",page_of_pages:"({{pageNumber}} of {{pagesCount}})",document_properties_kb:"{{size_kb}} KB ({{size_b}} bytes)",document_properties_mb:"{{size_mb}} MB ({{size_b}} bytes)",document_properties_date_string:"{{date}}, {{time}}",document_properties_page_size_unit_inches:"in",document_properties_page_size_unit_millimeters:"mm",document_properties_page_size_orientation_portrait:"portrait",document_properties_page_size_orientation_landscape:"landscape",document_properties_page_size_name_a3:"A3",document_properties_page_size_name_a4:"A4",document_properties_page_size_name_letter:"Letter",document_properties_page_size_name_legal:"Legal",document_properties_page_size_dimension_string:"{{width}} × {{height}} {{unit}} ({{orientation}})",document_properties_page_size_dimension_name_string:"{{width}} × {{height}} {{unit}} ({{name}}, {{orientation}})",document_properties_linearized_yes:"Yes",document_properties_linearized_no:"No",additional_layers:"Additional Layers",page_landmark:"Page {{page}}",thumb_page_title:"Page {{page}}",thumb_page_canvas:"Thumbnail of Page {{page}}",find_reached_top:"Reached top of document, continued from bottom",find_reached_bottom:"Reached end of document, continued from top","find_match_count[one]":"{{current}} of {{total}} match","find_match_count[other]":"{{current}} of {{total}} matches","find_match_count_limit[one]":"More than {{limit}} match","find_match_count_limit[other]":"More than {{limit}} matches",find_not_found:"Phrase not found",page_scale_width:"Page Width",page_scale_fit:"Page Fit",page_scale_auto:"Automatic Zoom",page_scale_actual:"Actual Size",page_scale_percent:"{{scale}}%",loading_error:"An error occurred while loading the PDF.",invalid_file_error:"Invalid or corrupted PDF file.",missing_file_error:"Missing PDF file.",unexpected_response_error:"Unexpected server response.",rendering_error:"An error occurred while rendering the page.",annotation_date_string:"{{date}}, {{time}}",printing_not_supported:"Warning: Printing is not fully supported by this browser.",printing_not_ready:"Warning: The PDF is not fully loaded for printing.",web_fonts_disabled:"Web fonts are disabled: unable to use embedded PDF fonts.",free_text2_default_content:"Start typing…",editor_free_text2_aria_label:"Text Editor",editor_ink2_aria_label:"Draw Editor",editor_ink_canvas_aria_label:"User-created image",editor_alt_text_button_label:"Alt text",editor_alt_text_edit_button_label:"Edit alt text",editor_alt_text_decorative_tooltip:"Marked as decorative",print_progress_percent:"{{progress}}%"};function n(e,t){switch(e){case"find_match_count":e=`find_match_count[${1===t.total?"one":"other"}]`;break;case"find_match_count_limit":e=`find_match_count_limit[${1===t.limit?"one":"other"}]`}return i[e]||""}t.NullL10n={getLanguage:async()=>"en-us",getDirection:async()=>"ltr",async get(e){var i,t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null;return e=2<arguments.length&&void 0!==arguments[2]?arguments[2]:n(e,t),(i=t)?e.replaceAll(/\{\{\s*(\w+)\s*\}\}/g,(e,t)=>t in i?i[t]:"{{"+t+"}}"):e},async translate(e){}}},(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.XfaLayer=void 0,i(89);var d=i(194);t.XfaLayer=class{static setupStorage(e,t,i,n,r){var s=n.getValue(t,{value:null});switch(i.name){case"textarea":null!==s.value&&(e.textContent=s.value),"print"!==r&&e.addEventListener("input",e=>{n.setValue(t,{value:e.target.value})});break;case"input":if("radio"===i.attributes.type||"checkbox"===i.attributes.type){if(s.value===i.attributes.xfaOn?e.setAttribute("checked",!0):s.value===i.attributes.xfaOff&&e.removeAttribute("checked"),"print"===r)break;e.addEventListener("change",e=>{n.setValue(t,{value:e.target.checked?e.target.getAttribute("xfaOn"):e.target.getAttribute("xfaOff")})})}else{if(null!==s.value&&e.setAttribute("value",s.value),"print"===r)break;e.addEventListener("input",e=>{n.setValue(t,{value:e.target.value})})}break;case"select":if(null!==s.value){e.setAttribute("value",s.value);for(const e of i.children)e.attributes.value===s.value?e.attributes.selected=!0:e.attributes.hasOwnProperty("selected")&&delete e.attributes.selected}e.addEventListener("input",e=>{e=e.target.options,e=-1===e.selectedIndex?"":e[e.selectedIndex].value;n.setValue(t,{value:e})})}}static setAttributes(e){let{html:t,element:i,storage:n=null,intent:r,linkService:s}=e;var o=i["attributes"],a=t instanceof HTMLAnchorElement;"radio"===o.type&&(o.name=o.name+"-"+r);for(const[e,i]of Object.entries(o))if(null!=i)switch(e){case"class":i.length&&t.setAttribute(e,i.join(" "));break;case"dataId":break;case"id":t.setAttribute("data-element-id",i);break;case"style":Object.assign(t.style,i);break;case"textContent":t.textContent=i;break;default:a&&("href"===e||"newWindow"===e)||t.setAttribute(e,i)}a&&s.addLinkAttributes(t,o.href,o.newWindow),n&&o.dataId&&this.setupStorage(t,o.dataId,i,n)}static render(e){const t=e.annotationStorage,i=e.linkService,n=e.xfaHtml,r=e.intent||"display",s=document.createElement(n.name),o=(n.attributes&&this.setAttributes({html:s,element:n,intent:r,linkService:i}),[[n,-1,s]]),a=e.div;if(a.append(s),e.viewport){const t=`matrix(${e.viewport.transform.join(",")})`;a.style.transform=t}"richText"!==r&&a.setAttribute("class","xfaLayer xfaFont");for(var l=[];0<o.length;){const[e,n,s]=o.at(-1);if(n+1===e.children.length)o.pop();else{const a=e.children[++o.at(-1)[1]];if(null!==a){var h=a["name"];if("#text"===h){const e=document.createTextNode(a.value);l.push(e),s.append(e)}else{var c=a?.attributes?.xmlns?document.createElementNS(a.attributes.xmlns,h):document.createElement(h);if(s.append(c),a.attributes&&this.setAttributes({html:c,element:a,storage:t,intent:r,linkService:i}),a.children&&0<a.children.length)o.push([a,-1,c]);else if(a.value){const e=document.createTextNode(a.value);d.XfaText.shouldBuildText(h)&&l.push(e),c.append(e)}}}}}for(const e of a.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))e.setAttribute("readOnly",!0);return{textDivs:l}}static update(e){var t=`matrix(${e.viewport.transform.join(",")})`;e.div.style.transform=t,e.div.hidden=!1}}},(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.InkEditor=void 0,i(89),i(2);var g=i(1),f=i(164),v=i(198),n=i(168),o=i(165);class y extends f.AnnotationEditor{#Fn=0;#Rn=0;#Dn=this.canvasPointermove.bind(this);#In=this.canvasPointerleave.bind(this);#On=this.canvasPointerup.bind(this);#Ln=this.canvasPointerdown.bind(this);#Nn=new Path2D;#Bn=!1;#jn=!1;#Un=!1;#zn=null;#Wn=0;#Hn=0;#qn=null;static _defaultColor=null;static _defaultOpacity=1;static _defaultThickness=1;static _type="ink";constructor(e){super({...e,name:"inkEditor"}),this.color=e.color||null,this.thickness=e.thickness||null,this.opacity=e.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(e){f.AnnotationEditor.initialize(e,{strings:["editor_ink_canvas_aria_label","editor_ink2_aria_label"]})}static updateDefaultParams(e,t){switch(e){case g.AnnotationEditorParamsType.INK_THICKNESS:y._defaultThickness=t;break;case g.AnnotationEditorParamsType.INK_COLOR:y._defaultColor=t;break;case g.AnnotationEditorParamsType.INK_OPACITY:y._defaultOpacity=t/100}}updateParams(e,t){switch(e){case g.AnnotationEditorParamsType.INK_THICKNESS:this.#Gn(t);break;case g.AnnotationEditorParamsType.INK_COLOR:this.#Ve(t);break;case g.AnnotationEditorParamsType.INK_OPACITY:this.#Vn(t)}}static get defaultPropertiesToUpdate(){return[[g.AnnotationEditorParamsType.INK_THICKNESS,y._defaultThickness],[g.AnnotationEditorParamsType.INK_COLOR,y._defaultColor||f.AnnotationEditor._defaultLineColor],[g.AnnotationEditorParamsType.INK_OPACITY,Math.round(100*y._defaultOpacity)]]}get propertiesToUpdate(){return[[g.AnnotationEditorParamsType.INK_THICKNESS,this.thickness||y._defaultThickness],[g.AnnotationEditorParamsType.INK_COLOR,this.color||y._defaultColor||f.AnnotationEditor._defaultLineColor],[g.AnnotationEditorParamsType.INK_OPACITY,Math.round(100*(this.opacity??y._defaultOpacity))]]}#Gn(e){const t=this.thickness;this.addCommands({cmd:()=>{this.thickness=e,this.#$n()},undo:()=>{this.thickness=t,this.#$n()},mustExec:!0,type:g.AnnotationEditorParamsType.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0})}#Ve(e){const t=this.color;this.addCommands({cmd:()=>{this.color=e,this.#Xn()},undo:()=>{this.color=t,this.#Xn()},mustExec:!0,type:g.AnnotationEditorParamsType.INK_COLOR,overwriteIfSameType:!0,keepUndo:!0})}#Vn(e){e/=100;const t=this.opacity;this.addCommands({cmd:()=>{this.opacity=e,this.#Xn()},undo:()=>{this.opacity=t,this.#Xn()},mustExec:!0,type:g.AnnotationEditorParamsType.INK_OPACITY,overwriteIfSameType:!0,keepUndo:!0})}rebuild(){this.parent&&(super.rebuild(),null!==this.div)&&(this.canvas||(this.#Kn(),this.#Yn()),this.isAttachedToDOM||(this.parent.add(this),this.#Jn()),this.#$n())}remove(){null!==this.canvas&&(this.isEmpty()||this.commit(),this.canvas.width=this.canvas.height=0,this.canvas.remove(),this.canvas=null,this.#zn.disconnect(),this.#zn=null,super.remove())}setParent(e){!this.parent&&e?this._uiManager.removeShouldRescale(this):this.parent&&null===e&&this._uiManager.addShouldRescale(this),super.setParent(e)}onScaleChanging(){var[e,t]=this.parentDimensions,e=this.width*e,t=this.height*t;this.setDimensions(e,t)}enableEditMode(){this.#Bn||null===this.canvas||(super.enableEditMode(),this._isDraggable=!1,this.canvas.addEventListener("pointerdown",this.#Ln))}disableEditMode(){this.isInEditMode()&&null!==this.canvas&&(super.disableEditMode(),this._isDraggable=!this.isEmpty(),this.div.classList.remove("editing"),this.canvas.removeEventListener("pointerdown",this.#Ln))}onceAdded(){this._isDraggable=!this.isEmpty()}isEmpty(){return 0===this.paths.length||1===this.paths.length&&0===this.paths[0].length}#Qn(){var{parentRotation:e,parentDimensions:[t,i]}=this;switch(e){case 90:return[0,i,i,t];case 180:return[t,i,t,i];case 270:return[t,0,i,t];default:return[0,0,t,i]}}#Zn(){var{ctx:e,color:t,opacity:i,thickness:n,parentScale:r,scaleFactor:s}=this;e.lineWidth=n*r/s,e.lineCap="round",e.lineJoin="round",e.miterLimit=10,e.strokeStyle=""+t+(0,o.opacityToHex)(i)}#ti(e,t){this.canvas.addEventListener("contextmenu",n.noContextMenu),this.canvas.addEventListener("pointerleave",this.#In),this.canvas.addEventListener("pointermove",this.#Dn),this.canvas.addEventListener("pointerup",this.#On),this.canvas.removeEventListener("pointerdown",this.#Ln),this.isEditing=!0,this.#Un||(this.#Un=!0,this.#Jn(),this.thickness||=y._defaultThickness,this.color||=y._defaultColor||f.AnnotationEditor._defaultLineColor,this.opacity??=y._defaultOpacity),this.currentPath.push([e,t]),this.#jn=!1,this.#Zn(),this.#qn=()=>{this.#ei(),this.#qn&&window.requestAnimationFrame(this.#qn)},window.requestAnimationFrame(this.#qn)}#ni(t,i){var[n,e]=this.currentPath.at(-1);if(!(1<this.currentPath.length&&t===n&&i===e)){n=this.currentPath;let e=this.#Nn;n.push([t,i]),this.#jn=!0,n.length<=2?(e.moveTo(...n[0]),e.lineTo(t,i)):(3===n.length&&(this.#Nn=e=new Path2D,e.moveTo(...n[0])),this.#ii(e,...n.at(-3),...n.at(-2),t,i))}}#ri(){var e;0!==this.currentPath.length&&(e=this.currentPath.at(-1),this.#Nn.lineTo(...e))}#si(e,t){this.#qn=null,e=Math.min(Math.max(e,0),this.canvas.width),t=Math.min(Math.max(t,0),this.canvas.height),this.#ni(e,t),this.#ri();let i;if(1!==this.currentPath.length)i=this.#ai();else{const n=[e,t];i=[[n,n.slice(),n.slice(),n]]}const n=this.#Nn,r=this.currentPath;this.currentPath=[],this.#Nn=new Path2D,this.addCommands({cmd:()=>{this.allRawPaths.push(r),this.paths.push(i),this.bezierPath2D.push(n),this.rebuild()},undo:()=>{this.allRawPaths.pop(),this.paths.pop(),this.bezierPath2D.pop(),0===this.paths.length?this.remove():(this.canvas||(this.#Kn(),this.#Yn()),this.#$n())},mustExec:!0})}#ei(){if(this.#jn){this.#jn=!1;Math.ceil(this.thickness*this.parentScale);const e=this.currentPath.slice(-3),t=e.map(e=>e[0]),i=e.map(e=>e[1]),n=(Math.min(...t),Math.max(...t),Math.min(...i),Math.max(...i),this)["ctx"];n.save(),n.clearRect(0,0,this.canvas.width,this.canvas.height);for(const r of this.bezierPath2D)n.stroke(r);n.stroke(this.#Nn),n.restore()}}#ii(e,t,i,n,r,s,o){t=(t+n)/2,i=(i+r)/2,s=(n+s)/2,o=(r+o)/2;e.bezierCurveTo(t+2*(n-t)/3,i+2*(r-i)/3,s+2*(n-s)/3,o+2*(r-o)/3,s,o)}#ai(){var e=this.currentPath;if(e.length<=2)return[[e[0],e[0],e.at(-1),e.at(-1)]];var t=[];let i,[n,r]=e[0];for(i=1;i<e.length-2;i++){const[s,o]=e[i],[a,l]=e[i+1],h=(s+a)/2,c=(o+l)/2,d=[n+2*(s-n)/3,r+2*(o-r)/3],u=[h+2*(s-h)/3,c+2*(o-c)/3];t.push([[n,r],d,u,[h,c]]),[n,r]=[h,c]}const[s,o]=e[i],[a,l]=e[i+1],h=[n+2*(s-n)/3,r+2*(o-r)/3],c=[a+2*(s-a)/3,l+2*(o-l)/3];return t.push([[n,r],h,c,[a,l]]),t}#Xn(){if(this.isEmpty())this.#oi();else{this.#Zn();const{canvas:e,ctx:t}=this;t.setTransform(1,0,0,1,0,0),t.clearRect(0,0,e.width,e.height),this.#oi();for(const e of this.bezierPath2D)t.stroke(e)}}commit(){this.#Bn||(super.commit(),this.isEditing=!1,this.disableEditMode(),this.setInForeground(),this.#Bn=!0,this.div.classList.add("disabled"),this.#$n(!0),this.makeResizable(),this.parent.addInkEditorIfNeeded(!0),this.moveInDOM(),this.div.focus({preventScroll:!0}))}focusin(e){this._focusEventsAllowed&&(super.focusin(e),this.enableEditMode())}canvasPointerdown(e){0===e.button&&this.isInEditMode()&&!this.#Bn&&(this.setInForeground(),e.preventDefault(),"mouse"!==e.type&&this.div.focus(),this.#ti(e.offsetX,e.offsetY))}canvasPointermove(e){e.preventDefault(),this.#ni(e.offsetX,e.offsetY)}canvasPointerup(e){e.preventDefault(),this.#li(e)}canvasPointerleave(e){this.#li(e)}#li(e){this.canvas.removeEventListener("pointerleave",this.#In),this.canvas.removeEventListener("pointermove",this.#Dn),this.canvas.removeEventListener("pointerup",this.#On),this.canvas.addEventListener("pointerdown",this.#Ln),setTimeout(()=>{this.canvas.removeEventListener("contextmenu",n.noContextMenu)},10),this.#si(e.offsetX,e.offsetY),this.addToAnnotationStorage(),this.setInBackground()}#Kn(){this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=0,this.canvas.className="inkEditorCanvas",f.AnnotationEditor._l10nPromise.get("editor_ink_canvas_aria_label").then(e=>this.canvas?.setAttribute("aria-label",e)),this.div.append(this.canvas),this.ctx=this.canvas.getContext("2d")}#Yn(){this.#zn=new ResizeObserver(e=>{e=e[0].contentRect;e.width&&e.height&&this.setDimensions(e.width,e.height)}),this.#zn.observe(this.div)}get isResizable(){return!this.isEmpty()&&this.#Bn}render(){if(!this.div){let e,t;this.width&&(e=this.x,t=this.y),super.render(),f.AnnotationEditor._l10nPromise.get("editor_ink2_aria_label").then(e=>this.div?.setAttribute("aria-label",e));const[i,n,r,s]=this.#Qn();if(this.setAt(i,n,0,0),this.setDims(r,s),this.#Kn(),this.width){const[i,n]=this.parentDimensions;this.setAspectRatio(this.width*i,this.height*n),this.setAt(e*i,t*n,this.width*i,this.height*n),this.#Un=!0,this.#Jn(),this.setDims(this.width*i,this.height*n),this.#Xn(),this.div.classList.add("disabled")}else this.div.classList.add("editing"),this.enableEditMode();this.#Yn()}return this.div}#Jn(){var e,t;this.#Un&&([e,t]=this.parentDimensions,this.canvas.width=Math.ceil(this.width*e),this.canvas.height=Math.ceil(this.height*t),this.#oi())}setDimensions(e,t){var i=Math.round(e),n=Math.round(t);this.#Wn===i&&this.#Hn===n||(this.#Wn=i,this.#Hn=n,this.canvas.style.visibility="hidden",[i,n]=this.parentDimensions,this.width=e/i,this.height=t/n,this.fixAndSetPosition(),this.#Bn&&this.#ci(e,t),this.#Jn(),this.#Xn(),this.canvas.style.visibility="visible",this.fixDims())}#ci(e,t){var i=this.#hi(),e=(e-i)/this.#Rn,t=(t-i)/this.#Fn;this.scaleFactor=Math.min(e,t)}#oi(){var e=this.#hi()/2;this.ctx.setTransform(this.scaleFactor,0,0,this.scaleFactor,this.translationX*this.scaleFactor+e,this.translationY*this.scaleFactor+e)}static#di(i){var n=new Path2D;for(let e=0,t=i.length;e<t;e++){var[r,s,o,a]=i[e];0===e&&n.moveTo(...r),n.bezierCurveTo(s[0],s[1],o[0],o[1],a[0],a[1])}return n}static#ui(i,e,n){var[r,s,o,a]=e;switch(n){case 0:for(let e=0,t=i.length;e<t;e+=2)i[e]+=r,i[e+1]=a-i[e+1];break;case 90:for(let e=0,t=i.length;e<t;e+=2){const n=i[e];i[e]=i[e+1]+r,i[e+1]=n+s}break;case 180:for(let e=0,t=i.length;e<t;e+=2)i[e]=o-i[e],i[e+1]+=s;break;case 270:for(let e=0,t=i.length;e<t;e+=2){const n=i[e];i[e]=o-i[e+1],i[e+1]=a-n}break;default:throw new Error("Invalid rotation")}return i}static#pi(i,e,n){var[r,s,o,a]=e;switch(n){case 0:for(let e=0,t=i.length;e<t;e+=2)i[e]-=r,i[e+1]=a-i[e+1];break;case 90:for(let e=0,t=i.length;e<t;e+=2){const n=i[e];i[e]=i[e+1]-s,i[e+1]=n-r}break;case 180:for(let e=0,t=i.length;e<t;e+=2)i[e]=o-i[e],i[e+1]-=s;break;case 270:for(let e=0,t=i.length;e<t;e+=2){const n=i[e];i[e]=a-i[e+1],i[e+1]=o-n}break;default:throw new Error("Invalid rotation")}return i}#fi(i,n,r,e){const t=[],s=this.thickness/2,o=i*n+s,a=i*r+s;for(const n of this.paths){const r=[],s=[];for(let e=0,t=n.length;e<t;e++){var[l,h,c,d]=n[e],u=i*l[0]+o,l=i*l[1]+a,p=i*h[0]+o,h=i*h[1]+a,m=i*c[0]+o,c=i*c[1]+a,g=i*d[0]+o,d=i*d[1]+a;0===e&&(r.push(u,l),s.push(u,l)),r.push(p,h,m,c,g,d),s.push(p,h),e===t-1&&s.push(g,d)}t.push({bezier:y.#ui(r,e,this.rotation),points:y.#ui(s,e,this.rotation)})}return t}#gi(){let e=1/0,t=-1/0,i=1/0,n=-1/0;for(const l of this.paths)for(var[r,s,o,a]of l){r=g.Util.bezierBoundingBox(...r,...s,...o,...a);e=Math.min(e,r[0]),i=Math.min(i,r[1]),t=Math.max(t,r[2]),n=Math.max(n,r[3])}return[e,i,t,n]}#hi(){return this.#Bn?Math.ceil(this.thickness*this.parentScale):0}#$n(){var e,t,i,n,r,s,o=0<arguments.length&&void 0!==arguments[0]&&arguments[0];this.isEmpty()||(this.#Bn?(s=this.#gi(),e=this.#hi(),this.#Rn=Math.max(f.AnnotationEditor.MIN_SIZE,s[2]-s[0]),this.#Fn=Math.max(f.AnnotationEditor.MIN_SIZE,s[3]-s[1]),t=Math.ceil(e+this.#Rn*this.scaleFactor),i=Math.ceil(e+this.#Fn*this.scaleFactor),[n,r]=this.parentDimensions,this.width=t/n,this.height=i/r,this.setAspectRatio(t,i),n=this.translationX,r=this.translationY,this.translationX=-s[0],this.translationY=-s[1],this.#Jn(),this.#Xn(),this.#Wn=t,this.#Hn=i,this.setDims(t,i),s=o?e/this.scaleFactor/2:0,this.translate(n-this.translationX-s,r-this.translationY-s)):this.#Xn())}static deserialize(e,r,t){if(e instanceof v.InkAnnotationElement)return null;const s=super.deserialize(e,r,t),[o,a]=(s.thickness=e.thickness,s.color=g.Util.makeHexColor(...e.color),s.opacity=e.opacity,s.pageDimensions),l=s.width*o,h=s.height*a,c=s.parentScale,d=e.thickness/2;s.#Bn=!0,s.#Wn=Math.round(l),s.#Hn=Math.round(h);var u,{paths:r,rect:p,rotation:m}=e;for({bezier:u}of r){u=y.#pi(u,p,m);const r=[];s.paths.push(r);let i=c*(u[0]-d),n=c*(u[1]-d);for(let e=2,t=u.length;e<t;e+=6){const v=c*(u[e]-d),s=c*(u[e+1]-d),o=c*(u[e+2]-d),a=c*(u[e+3]-d),l=c*(u[e+4]-d),h=c*(u[e+5]-d);r.push([[i,n],[v,s],[o,a],[l,h]]),i=l,n=h}const f=this.#di(r);s.bezierPath2D.push(f)}t=s.#gi();return s.#Rn=Math.max(f.AnnotationEditor.MIN_SIZE,t[2]-t[0]),s.#Fn=Math.max(f.AnnotationEditor.MIN_SIZE,t[3]-t[1]),s.#ci(l,h),s}serialize(){var e,t;return this.isEmpty()?null:(e=this.getRect(0,0),t=f.AnnotationEditor._colorManager.convert(this.ctx.strokeStyle),{annotationType:g.AnnotationEditorType.INK,color:t,thickness:this.thickness,opacity:this.opacity,paths:this.#fi(this.scaleFactor/this.parentScale,this.translationX,this.translationY,e),pageIndex:this.pageIndex,rect:e,rotation:this.rotation,structTreeParentId:this._structTreeParentId})}}t.InkEditor=y},(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.StampEditor=void 0,i(149),i(152);var s=i(1),n=i(164),o=i(168),a=i(198);class r extends n.AnnotationEditor{#mi=null;#bi=null;#vi=null;#yi=null;#_i=null;#Ai=null;#zn=null;#Si=null;#Ei=!1;#xi=!1;static _type="stamp";constructor(e){super({...e,name:"stampEditor"}),this.#yi=e.bitmapUrl,this.#_i=e.bitmapFile}static initialize(e){n.AnnotationEditor.initialize(e)}static get supportedTypes(){return(0,s.shadow)(this,"supportedTypes",["apng","avif","bmp","gif","jpeg","png","svg+xml","webp","x-icon"].map(e=>"image/"+e))}static get supportedTypesStr(){return(0,s.shadow)(this,"supportedTypesStr",this.supportedTypes.join(","))}static isHandlingMimeForPasting(e){return this.supportedTypes.includes(e)}static paste(e,t){t.pasteEditor(s.AnnotationEditorType.STAMP,{bitmapFile:e.getAsFile()})}#wi(e){var t=1<arguments.length&&void 0!==arguments[1]&&arguments[1];e?(this.#mi=e.bitmap,t||(this.#bi=e.id,this.#Ei=e.isSvg),this.#Kn()):this.remove()}#Ci(){this.#vi=null,this._uiManager.enableWaiting(!1),this.#Ai&&this.div.focus()}#Ti(){if(this.#bi)this._uiManager.enableWaiting(!0),this._uiManager.imageManager.getFromId(this.#bi).then(e=>this.#wi(e,!0)).finally(()=>this.#Ci());else if(this.#yi){const t=this.#yi;this.#yi=null,this._uiManager.enableWaiting(!0),void(this.#vi=this._uiManager.imageManager.getFromUrl(t).then(e=>this.#wi(e)).finally(()=>this.#Ci()))}else if(this.#_i){const t=this.#_i;this.#_i=null,this._uiManager.enableWaiting(!0),void(this.#vi=this._uiManager.imageManager.getFromFile(t).then(e=>this.#wi(e)).finally(()=>this.#Ci()))}else{const t=document.createElement("input");t.type="file",t.accept=r.supportedTypesStr,this.#vi=new Promise(e=>{t.addEventListener("change",async()=>{if(t.files&&0!==t.files.length){this._uiManager.enableWaiting(!0);const e=await this._uiManager.imageManager.getFromFile(t.files[0]);this.#wi(e)}else this.remove();e()}),t.addEventListener("cancel",()=>{this.remove(),e()})}).finally(()=>this.#Ci()),t.click()}}remove(){this.#bi&&(this.#mi=null,this._uiManager.imageManager.deleteId(this.#bi),this.#Ai?.remove(),this.#Ai=null,this.#zn?.disconnect(),this.#zn=null),super.remove()}rebuild(){this.parent?(super.rebuild(),null!==this.div&&(this.#bi&&this.#Ti(),this.isAttachedToDOM||this.parent.add(this))):this.#bi&&this.#Ti()}onceAdded(){this._isDraggable=!0,this.div.focus()}isEmpty(){return!(this.#vi||this.#mi||this.#yi||this.#_i)}get isResizable(){return!0}render(){if(!this.div){let e,t;var i,n;this.width&&(e=this.x,t=this.y),super.render(),this.div.hidden=!0,this.#mi?this.#Kn():this.#Ti(),this.width&&([i,n]=this.parentDimensions,this.setAt(e*i,t*n,this.width*i,this.height*n))}return this.div}#Kn(){const e=this["div"];let{width:t,height:i}=this.#mi;var[n,r]=this.pageDimensions;if(this.width)t=this.width*n,i=this.height*r;else if(t>.75*n||i>.75*r){const e=Math.min(.75*n/t,.75*r/i);t*=e,i*=e}var[s,o]=this.parentDimensions,s=(this.setDims(t*s/n,i*o/r),this._uiManager.enableWaiting(!1),this.#Ai=document.createElement("canvas"));e.append(s),e.hidden=!1,this.#Pi(t,i),this.#Yn(),this.#xi||(this.parent.addUndoableEditor(this),this.#xi=!0),this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",subtype:this.editorType,data:{action:"inserted_image"}}}),this.addAltTextButton()}#ki(e,t){var[i,n]=this.parentDimensions;this.width=e/i,this.height=t/n,this.setDims(e,t),this._initialOptions?.isCentered?this.center():this.fixAndSetPosition(),(this._initialOptions=null)!==this.#Si&&clearTimeout(this.#Si),this.#Si=setTimeout(()=>{this.#Si=null,this.#Pi(e,t)},200)}#Mi(e,t){const{width:i,height:n}=this.#mi;let r=i,s=n,o=this.#mi;for(;r>2*e||s>2*t;){const i=r,n=s;r>2*e&&(r=16384<=r?Math.floor(r/2)-1:Math.ceil(r/2)),s>2*t&&(s=16384<=s?Math.floor(s/2)-1:Math.ceil(s/2));var a=new OffscreenCanvas(r,s);a.getContext("2d").drawImage(o,0,0,i,n,0,0,r,s),o=a.transferToImageBitmap()}return o}#Pi(e,t){e=Math.ceil(e),t=Math.ceil(t);var i,n=this.#Ai;!n||n.width===e&&n.height===t||(n.width=e,n.height=t,i=this.#Ei?this.#mi:this.#Mi(e,t),(n=n.getContext("2d")).filter=this._uiManager.hcmFilter,n.drawImage(i,0,0,i.width,i.height,0,0,e,t))}#Fi(e){if(e){if(this.#Ei){const e=this._uiManager.imageManager.getSvgUrl(this.#bi);if(e)return e}const e=document.createElement("canvas");return{width:e.width,height:e.height}=this.#mi,e.getContext("2d").drawImage(this.#mi,0,0),e.toDataURL()}if(this.#Ei){const[e,t]=this.pageDimensions,i=Math.round(this.width*e*o.PixelsPerInch.PDF_TO_CSS_UNITS),n=Math.round(this.height*t*o.PixelsPerInch.PDF_TO_CSS_UNITS),r=new OffscreenCanvas(i,n);return r.getContext("2d").drawImage(this.#mi,0,0,this.#mi.width,this.#mi.height,0,0,i,n),r.transferToImageBitmap()}return structuredClone(this.#mi)}#Yn(){this.#zn=new ResizeObserver(e=>{e=e[0].contentRect;e.width&&e.height&&this.#ki(e.width,e.height)}),this.#zn.observe(this.div)}static deserialize(e,t,i){var n,r,s,o;return e instanceof a.StampAnnotationElement?null:(t=super.deserialize(e,t,i),{rect:e,bitmapUrl:n,bitmapId:o,isSvg:r,accessibilityData:s}=e,[i,o]=(o&&i.imageManager.isValidId(o)?t.#bi=o:t.#yi=n,t.#Ei=r,t.pageDimensions),t.width=(e[2]-e[0])/i,t.height=(e[3]-e[1])/o,s&&(t.altTextData=s),t)}serialize(){let e=0<arguments.length&&void 0!==arguments[0]&&arguments[0],t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null;if(this.isEmpty())return null;var i={annotationType:s.AnnotationEditorType.STAMP,bitmapId:this.#bi,pageIndex:this.pageIndex,rect:this.getRect(0,0),rotation:this.rotation,isSvg:this.#Ei,structTreeParentId:this._structTreeParentId};if(e)i.bitmapUrl=this.#Fi(!0),i.accessibilityData=this.altTextData;else{var{decorative:n,altText:r}=this.altTextData;if(!n&&r&&(i.accessibilityData={type:"Figure",alt:r}),null!==t){t.stamps||=new Map;n=this.#Ei?(i.rect[2]-i.rect[0])*(i.rect[3]-i.rect[1]):null;if(t.stamps.has(this.#bi)){if(this.#Ei){const e=t.stamps.get(this.#bi);n>e.area&&(e.area=n,e.serialized.bitmap.close(),e.serialized.bitmap=this.#Fi(!1))}}else t.stamps.set(this.#bi,{area:n,serialized:i}),i.bitmap=this.#Fi(!1)}}return i}}t.StampEditor=r}],__webpack_module_cache__={};function __w_pdfjs_require__(e){var t=__webpack_module_cache__[e];return void 0!==t||(t=__webpack_module_cache__[e]={exports:{}},__webpack_modules__[e].call(t.exports,t,t.exports,__w_pdfjs_require__)),t.exports}var __webpack_exports__={};return(()=>{var e=__webpack_exports__,t=(Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"AbortException",{enumerable:!0,get:function(){return t.AbortException}}),Object.defineProperty(e,"AnnotationEditorLayer",{enumerable:!0,get:function(){return s.AnnotationEditorLayer}}),Object.defineProperty(e,"AnnotationEditorParamsType",{enumerable:!0,get:function(){return t.AnnotationEditorParamsType}}),Object.defineProperty(e,"AnnotationEditorType",{enumerable:!0,get:function(){return t.AnnotationEditorType}}),Object.defineProperty(e,"AnnotationEditorUIManager",{enumerable:!0,get:function(){return o.AnnotationEditorUIManager}}),Object.defineProperty(e,"AnnotationLayer",{enumerable:!0,get:function(){return a.AnnotationLayer}}),Object.defineProperty(e,"AnnotationMode",{enumerable:!0,get:function(){return t.AnnotationMode}}),Object.defineProperty(e,"CMapCompressionType",{enumerable:!0,get:function(){return t.CMapCompressionType}}),Object.defineProperty(e,"DOMSVGFactory",{enumerable:!0,get:function(){return n.DOMSVGFactory}}),Object.defineProperty(e,"FeatureTest",{enumerable:!0,get:function(){return t.FeatureTest}}),Object.defineProperty(e,"GlobalWorkerOptions",{enumerable:!0,get:function(){return l.GlobalWorkerOptions}}),Object.defineProperty(e,"ImageKind",{enumerable:!0,get:function(){return t.ImageKind}}),Object.defineProperty(e,"InvalidPDFException",{enumerable:!0,get:function(){return t.InvalidPDFException}}),Object.defineProperty(e,"MissingPDFException",{enumerable:!0,get:function(){return t.MissingPDFException}}),Object.defineProperty(e,"OPS",{enumerable:!0,get:function(){return t.OPS}}),Object.defineProperty(e,"PDFDataRangeTransport",{enumerable:!0,get:function(){return i.PDFDataRangeTransport}}),Object.defineProperty(e,"PDFDateString",{enumerable:!0,get:function(){return n.PDFDateString}}),Object.defineProperty(e,"PDFWorker",{enumerable:!0,get:function(){return i.PDFWorker}}),Object.defineProperty(e,"PasswordResponses",{enumerable:!0,get:function(){return t.PasswordResponses}}),Object.defineProperty(e,"PermissionFlag",{enumerable:!0,get:function(){return t.PermissionFlag}}),Object.defineProperty(e,"PixelsPerInch",{enumerable:!0,get:function(){return n.PixelsPerInch}}),Object.defineProperty(e,"PromiseCapability",{enumerable:!0,get:function(){return t.PromiseCapability}}),Object.defineProperty(e,"RenderingCancelledException",{enumerable:!0,get:function(){return n.RenderingCancelledException}}),Object.defineProperty(e,"SVGGraphics",{enumerable:!0,get:function(){return i.SVGGraphics}}),Object.defineProperty(e,"UnexpectedResponseException",{enumerable:!0,get:function(){return t.UnexpectedResponseException}}),Object.defineProperty(e,"Util",{enumerable:!0,get:function(){return t.Util}}),Object.defineProperty(e,"VerbosityLevel",{enumerable:!0,get:function(){return t.VerbosityLevel}}),Object.defineProperty(e,"XfaLayer",{enumerable:!0,get:function(){return h.XfaLayer}}),Object.defineProperty(e,"build",{enumerable:!0,get:function(){return i.build}}),Object.defineProperty(e,"createValidAbsoluteUrl",{enumerable:!0,get:function(){return t.createValidAbsoluteUrl}}),Object.defineProperty(e,"getDocument",{enumerable:!0,get:function(){return i.getDocument}}),Object.defineProperty(e,"getFilenameFromUrl",{enumerable:!0,get:function(){return n.getFilenameFromUrl}}),Object.defineProperty(e,"getPdfFilenameFromUrl",{enumerable:!0,get:function(){return n.getPdfFilenameFromUrl}}),Object.defineProperty(e,"getXfaPageViewport",{enumerable:!0,get:function(){return n.getXfaPageViewport}}),Object.defineProperty(e,"isDataScheme",{enumerable:!0,get:function(){return n.isDataScheme}}),Object.defineProperty(e,"isPdfFile",{enumerable:!0,get:function(){return n.isPdfFile}}),Object.defineProperty(e,"loadScript",{enumerable:!0,get:function(){return n.loadScript}}),Object.defineProperty(e,"noContextMenu",{enumerable:!0,get:function(){return n.noContextMenu}}),Object.defineProperty(e,"normalizeUnicode",{enumerable:!0,get:function(){return t.normalizeUnicode}}),Object.defineProperty(e,"renderTextLayer",{enumerable:!0,get:function(){return r.renderTextLayer}}),Object.defineProperty(e,"setLayerDimensions",{enumerable:!0,get:function(){return n.setLayerDimensions}}),Object.defineProperty(e,"shadow",{enumerable:!0,get:function(){return t.shadow}}),Object.defineProperty(e,"updateTextLayer",{enumerable:!0,get:function(){return r.updateTextLayer}}),Object.defineProperty(e,"version",{enumerable:!0,get:function(){return i.version}}),__w_pdfjs_require__(1)),i=__w_pdfjs_require__(124),n=__w_pdfjs_require__(168),r=__w_pdfjs_require__(195),s=__w_pdfjs_require__(196),o=__w_pdfjs_require__(165),a=__w_pdfjs_require__(198),l=__w_pdfjs_require__(176),h=__w_pdfjs_require__(201)})(),__webpack_exports__})()),angular.module("ngPDFViewer",[]).directive("pdfviewer",["$window",function(I){const F=[.5,.75,1,1.25,1.5,2,3];return{restrict:"E",scope:{src:"@"},link:function(e,t){t=t[0];t.classList.add("pdf-viewer");let s=null,o=[],n=!1,i=null,r=1,a=1,l=0,h=0,c=612/792,d=0;const u=document.createElement("div"),p=(u.className="pdf-toolbar",document.createElement("div"));function m(e,t,i){var n=document.createElement("button");return n.type="button",n.className="pdf-toolbar-btn",n.title=t,n.setAttribute("aria-label",t),n.innerHTML='<i class="fas '+e+'"></i>',n.addEventListener("click",i),n}p.className="pdf-pages",p.tabIndex=0,p.setAttribute("aria-label","PDF pages"),t.appendChild(u),t.appendChild(p);const g=m("fa-chevron-up","Previous page",function(){_(a-1)}),f=m("fa-chevron-down","Next page",function(){_(a+1)}),v=document.createElement("input"),y=(v.type="text",v.className="pdf-toolbar-page",v.setAttribute("aria-label","Page number"),v.title="Page number — type a page and press Enter",v.addEventListener("keydown",function(e){"Enter"===e.key&&(_(parseInt(v.value,10)),v.blur())}),v.addEventListener("blur",function(){v.value=String(a)}),document.createElement("span")),b=(y.className="pdf-toolbar-count",m("fa-search-minus","Zoom out",function(){$(F[Math.max(0,S()-1)])})),w=m("fa-search-plus","Zoom in",function(){$(F[Math.min(F.length-1,S()+1)])}),x=document.createElement("button");x.type="button",x.className="pdf-toolbar-btn pdf-toolbar-zoom",x.title="Reset zoom to fit the width",x.setAttribute("aria-label","Reset zoom to fit the width"),x.addEventListener("click",function(){$(1)}),u.appendChild(g),u.appendChild(f);t=document.createElement("span"),t.className="pdf-toolbar-group",t.appendChild(v),t.appendChild(y),u.appendChild(t),t=document.createElement("span");function S(){let t=0;for(let e=0;e<F.length;e++)Math.abs(F[e]-r)<Math.abs(F[t]-r)&&(t=e);return t}function A(){var e=s?s.numPages:0;u.style.display=e?"":"none",y.textContent="/ "+e,document.activeElement!==v&&(v.value=String(a)),g.disabled=a<=1,f.disabled=a>=e,x.textContent=Math.round(100*r)+"%",b.disabled=0===S(),w.disabled=S()===F.length-1}function k(e){e=o[e-1];e&&(p.scrollTop+=e.getBoundingClientRect().top-p.getBoundingClientRect().top)}function _(e){s&&!isNaN(e)&&(e=Math.min(Math.max(1,e),s.numPages),o[e-1])&&(k(e),a=e,l=e,h=Date.now()+800,A(),E())}function C(){d++,i&&(clearTimeout(i),i=null),s&&(s.destroy(),s=null),o=[],a=1,p.innerHTML="",A()}function T(){var e=Math.max(120,p.clientWidth-24);return Math.round(Math.min(e,1e3)*r)}function E(){if(s){const a=d;var e=p.getBoundingClientRect();const i=e.top-400,n=e.top+p.clientHeight+400;o.forEach(function(o,e){var t;o.dataset.state||(t=o.getBoundingClientRect()).top>n||t.bottom<i||(o.dataset.state="rendering",s.getPage(e+1).then(function(e){if(a===d){var t,i=o,n=I.devicePixelRatio||1,r=e.getViewport({scale:1}),s=parseFloat(i.style.width);if(s)return r=e.getViewport({scale:s/r.width*n}),(t=document.createElement("canvas")).width=Math.floor(r.width),t.height=Math.floor(r.height),t.style.width=s+"px",t.style.height=Math.floor(r.height/n)+"px",i.innerHTML="",i.appendChild(t),i.style.height="",e.render({canvasContext:t.getContext("2d"),viewport:r}).promise}}).then(function(){a===d&&(o.dataset.state="done",l&&Date.now()<h&&k(l),E())}).catch(function(){o.dataset.state="failed"}))})}}function M(){n||(n=!0,I.requestAnimationFrame(function(){if(n=!1,o.length&&!(Date.now()<h)){var e=p.getBoundingClientRect(),i=e.top+e.height/2;let t=1;for(let e=0;e<o.length;e++){if(!(o[e].getBoundingClientRect().top<=i))break;t=e+1}t!==a&&(a=t,A())}E()}))}function R(){const t=T();o.forEach(function(e){delete e.dataset.state,e.innerHTML="",e.style.width=t+"px",e.style.height=Math.round(t/c)+"px"}),E()}function $(e){var t;s&&e!==r&&(t=a,r=e,A(),R(),_(t))}function L(){s&&(i&&clearTimeout(i),i=setTimeout(function(){i=null,s&&R()},250))}t.className="pdf-toolbar-group pdf-toolbar-right",t.appendChild(b),t.appendChild(x),t.appendChild(w),u.appendChild(t),p.addEventListener("scroll",M,{passive:!0}),angular.element(I).on("resize",L),A(),e.$watch("src",function(e){if(C(),e){const r=d;pdfjsLib.getDocument({url:e,isEvalSupported:!1,standardFontDataUrl:"/script/external/pdf-standard-fonts/",cMapUrl:"/script/external/pdf-cmaps/",cMapPacked:!0}).promise.then(function(e){if(r===d)return(s=e).getPage(1).then(function(e){if(r===d){var e=e.getViewport({scale:1}),t=(e.width&&e.height&&(c=e.width/e.height),T());for(let e=1;e<=s.numPages;e++){var i=document.createElement("div");i.className="pdf-viewer-page",i.style.width=t+"px",i.style.height=Math.round(t/c)+"px",p.appendChild(i),o.push(i)}A();{let e=!1;function n(){e||(e=!0,E())}I.requestAnimationFrame(n),I.setTimeout(n,50)}}});e.destroy()}).catch(function(){var e;r===d&&(p.innerHTML="",(e=document.createElement("div")).className="pdf-viewer-error",e.textContent="This PDF could not be displayed.",p.appendChild(e))})}}),e.$on("$destroy",function(){p.removeEventListener("scroll",M),angular.element(I).off("resize",L),C()})}}}]),angular.module("htmlDoc",[]).directive("htmlDoc",[function(){return{restrict:"E",scope:{content:"<",baseUrl:"@",allowScripts:"<"},link:function(r,e){const s=e[0];function t(){s.innerHTML="";var t=r.content;if("string"==typeof t){var i=document.createElement("iframe"),n=(i.className="html-doc-frame",i.setAttribute("title","Rendered HTML document"),["allow-popups","allow-popups-to-escape-sandbox"]);r.allowScripts&&n.push("allow-scripts","allow-forms","allow-modals"),i.setAttribute("sandbox",n.join(" ")),i.setAttribute("referrerpolicy","no-referrer"),s.appendChild(i);let e="";r.baseUrl&&(e='<base href="'+r.baseUrl.replace(/&/g,"&amp;").replace(/"/g,"&quot;")+'">'),i.srcdoc=e+t}}s.classList.add("html-doc"),r.$watch("content",t),r.$watch("baseUrl",t),r.$watch("allowScripts",t)}}}]),!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.katex=t():e.katex=t()}("undefined"!=typeof self?self:this,function(){"use strict";var D={d:function(e,t){for(var i in t)D.o(t,i)&&!D.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}},t={};D.d(t,{default:function(){return _n}});class O{constructor(e,t){this.name=void 0,this.position=void 0,this.length=void 0,this.rawMessage=void 0;let i,n,r="KaTeX parse error: "+e;var s=t&&t.loc;if(s&&s.start<=s.end){const e=s.lexer.input,t=(i=s.start,n=s.end,i===e.length?r+=" at end of input: ":r+=" at position "+(i+1)+": ",e.slice(i,n).replace(/[^]/g,"$&̲"));var s=15<i?"…"+e.slice(i-15,i):e.slice(0,i),o=n+15<e.length?e.slice(n,n+15)+"…":e.slice(n);r+=s+t+o}t=new Error(r);return t.name="ParseError",t.__proto__=O.prototype,null!=(t.position=i)&&null!=n&&(t.length=n-i),t.rawMessage=e,t}}O.prototype.__proto__=Error.prototype;var _=O;function N(e){return"ordgroup"===e.type||"color"===e.type?1===e.body.length?N(e.body[0]):e:"font"===e.type?N(e.body):e}const B=/([A-Z])/g,z={"&":"&amp;",">":"&gt;","<":"&lt;",'"':"&quot;","'":"&#x27;"},H=/[&><"']/g;var C={contains:function(e,t){return-1!==e.indexOf(t)},deflt:function(e,t){return void 0===e?t:e},escape:function(e){return String(e).replace(H,e=>z[e])},hyphenate:function(e){return e.replace(B,"-$1").toLowerCase()},getBaseElem:N,isCharacterBox:function(e){e=N(e);return"mathord"===e.type||"textord"===e.type||"atom"===e.type},protocolFromUrl:function(e){e=/^[\x00-\x20]*([^\\/#?]*?)(:|&#0*58|&#x0*3a|&colon)/i.exec(e);return e?":"===e[2]&&/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(e[1])?e[1].toLowerCase():null:"_relative"}};const U={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format <type>"},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color <color>",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:e=>"#"+e},macros:{type:"object",cli:"-m, --macro <def>",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(e,t)=>(t.push(e),t)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:e=>Math.max(0,e),cli:"--min-rule-thickness <size>",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:e=>Math.max(0,e),cli:"-s, --max-size <n>",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:e=>Math.max(0,e),cli:"-e, --max-expand <n>",cliProcessor:e=>"Infinity"===e?1/0:parseInt(e)},globalGroup:{type:"boolean",cli:!1}};class W{constructor(e){this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,e=e||{};for(const i in U){var t;U.hasOwnProperty(i)&&(t=U[i],this[i]=void 0!==e[i]?t.processor?t.processor(e[i]):e[i]:function(e){if(e.default)return e.default;if(e=e.type,"string"!=typeof(e=Array.isArray(e)?e[0]:e))return e.enum[0];switch(e){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{}}}(t))}}reportNonstrict(e,t,i){let n=this.strict;if((n="function"==typeof n?n(e,t,i):n)&&"ignore"!==n){if(!0===n||"error"===n)throw new _("LaTeX-incompatible input and strict mode is set to 'error': "+t+" ["+e+"]",i);"warn"===n?"undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+t+" ["+e+"]"):"undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to unrecognized '"+n+"': "+t+" ["+e+"]")}}useStrictBehavior(e,t,i){let n=this.strict;if("function"==typeof n)try{n=n(e,t,i)}catch(e){n="error"}return!(!n||"ignore"===n||!0!==n&&"error"!==n&&("warn"===n?"undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+t+" ["+e+"]"):"undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to unrecognized '"+n+"': "+t+" ["+e+"]"),1))}isTrusted(e){if(e.url&&!e.protocol){const t=C.protocolFromUrl(e.url);if(null==t)return!1;e.protocol=t}const t="function"==typeof this.trust?this.trust(e):this.trust;return Boolean(t)}}class q{constructor(e,t,i){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=t,this.cramped=i}sup(){return V[j[this.id]]}sub(){return V[G[this.id]]}fracNum(){return V[K[this.id]]}fracDen(){return V[X[this.id]]}cramp(){return V[Y[this.id]]}text(){return V[Q[this.id]]}isTight(){return 2<=this.size}}const V=[new q(0,0,!1),new q(1,0,!0),new q(2,1,!1),new q(3,1,!0),new q(4,2,!1),new q(5,2,!0),new q(6,3,!1),new q(7,3,!0)],j=[4,5,4,5,6,7,6,7],G=[5,5,5,5,7,7,7,7],K=[2,3,4,5,6,7,6,7],X=[3,3,5,5,7,7,7,7],Y=[1,1,3,3,5,5,7,7],Q=[0,1,2,3,2,3,2,3];var T={DISPLAY:V[0],TEXT:V[2],SCRIPT:V[4],SCRIPTSCRIPT:V[6]};const J=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}],Z=[];function ee(t){for(let e=0;e<Z.length;e+=2)if(t>=Z[e]&&t<=Z[e+1])return 1}J.forEach(e=>e.blocks.forEach(e=>Z.push(...e)));const te={doubleleftarrow:"M262 157\nl10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3\n 0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28\n 14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5\nc2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5\n 157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87\n-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7\n-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z\nm8 0v40h399730v-40zm0 194v40h399730v-40z",doublerightarrow:"M399738 392l\n-10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5\n 14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88\n-33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68\n-17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18\n-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782\nc-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3\n-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z",leftarrow:"M400000 241H110l3-3c68.7-52.7 113.7-120\n 135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8\n-5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247\nc-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208\n 490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3\n 1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202\n l-3-3h399890zM100 241v40h399900v-40z",leftbrace:"M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117\n-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7\n 5-6 9-10 13-.7 1-7.3 1-20 1H6z",leftbraceunder:"M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13\n 35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688\n 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7\n-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z",leftgroup:"M400000 80\nH435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0\n 435 0h399565z",leftgroupunder:"M400000 262\nH435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219\n 435 219h399565z",leftharpoon:"M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3\n-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5\n-18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7\n-196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z",leftharpoonplus:"M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5\n 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3\n-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7\n-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z\nm0 0v40h400000v-40z",leftharpoondown:"M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333\n 5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5\n 1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667\n-152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z",leftharpoondownplus:"M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12\n 10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7\n-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0\nv40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z",lefthook:"M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5\n-83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3\n-68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21\n 71.5 23h399859zM103 281v-40h399897v40z",leftlinesegment:"M40 281 V428 H0 V94 H40 V241 H400000 v40z\nM40 281 V428 H0 V94 H40 V241 H400000 v40z",leftmapsto:"M40 281 V448H0V74H40V241H400000v40z\nM40 281 V448H0V74H40V241H400000v40z",leftToFrom:"M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23\n-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8\nc28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3\n 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z",longequal:"M0 50 h400000 v40H0z m0 194h40000v40H0z\nM0 50 h400000 v40H0z m0 194h40000v40H0z",midbrace:"M200428 334\nc-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14\n-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7\n 311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11\n 12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z",midbraceunder:"M199572 214\nc100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14\n 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3\n 11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0\n-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z",oiintSize1:"M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6\n-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z\nm368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8\n60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z",oiintSize2:"M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8\n-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z\nm502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2\nc0 110 84 276 504 276s502.4-166 502.4-276z",oiiintSize1:"M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6\n-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z\nm525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0\n85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z",oiiintSize2:"M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8\n-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z\nm770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1\nc0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z",rightarrow:"M0 241v40h399891c-47.3 35.3-84 78-110 128\n-16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20\n 11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7\n 39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85\n-40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5\n-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67\n 151.7 139 205zm0 0v40h399900v-40z",rightbrace:"M400000 542l\n-6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5\ns-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1\nc124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z",rightbraceunder:"M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3\n 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237\n-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z",rightgroup:"M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0\n 3-1 3-3v-38c-76-158-257-219-435-219H0z",rightgroupunder:"M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18\n 0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z",rightharpoon:"M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3\n-3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2\n-10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58\n 69.2 92 94.5zm0 0v40h399900v-40z",rightharpoonplus:"M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11\n-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7\n 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z\nm0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z",rightharpoondown:"M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8\n 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5\n-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95\n-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z",rightharpoondownplus:"M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8\n 15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3\n 8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3\n-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z\nm0-194v40h400000v-40zm0 0v40h400000v-40z",righthook:"M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3\n 15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0\n-13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21\n 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z",rightlinesegment:"M399960 241 V94 h40 V428 h-40 V281 H0 v-40z\nM399960 241 V94 h40 V428 h-40 V281 H0 v-40z",rightToFrom:"M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23\n 1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32\n-52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142\n-167z M100 147v40h399900v-40zM0 341v40h399900v-40z",twoheadleftarrow:"M0 167c68 40\n 115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69\n-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3\n-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19\n-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101\n 10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z",twoheadrightarrow:"M400000 167\nc-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3\n 41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42\n 18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333\n-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70\n 101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z",tilde1:"M200 55.538c-77 0-168 73.953-177 73.953-3 0-7\n-2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0\n 114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0\n 4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128\n-68.267.847-113-73.952-191-73.952z",tilde2:"M344 55.266c-142 0-300.638 81.316-311.5 86.418\n-8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9\n 31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114\nc1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751\n 181.476 676 181.476c-149 0-189-126.21-332-126.21z",tilde3:"M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457\n-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0\n 411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697\n 16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696\n -338 0-409-156.573-744-156.573z",tilde4:"M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345\n-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409\n 177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9\n 14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409\n -175.236-744-175.236z",vec:"M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5\n3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11\n10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63\n-1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1\n-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59\nH213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359\nc-16-25.333-24-45-24-59z",widehat1:"M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22\nc-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z",widehat2:"M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",widehat3:"M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",widehat4:"M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",widecheck1:"M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,\n-5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z",widecheck2:"M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",widecheck3:"M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",widecheck4:"M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",baraboveleftarrow:"M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202\nc4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5\nc-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130\ns-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47\n121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6\ns2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11\nc0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z\nM100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z",rightarrowabovebar:"M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32\n-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0\n13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39\n-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5\n-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5\n-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67\n151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z",baraboveshortleftharpoon:"M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11\nc1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17\nc2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21\nc-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40\nc-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z\nM0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z",rightharpoonaboveshortbar:"M0,241 l0,40c399126,0,399993,0,399993,0\nc4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,\n-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6\nc-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z\nM0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z",shortbaraboveleftharpoon:"M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11\nc1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,\n1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,\n-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z\nM93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z",shortrightharpoonabovebar:"M53,241l0,40c398570,0,399437,0,399437,0\nc4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,\n-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6\nc-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z\nM500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z"};class ie{constructor(e){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=e,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(e){return C.contains(this.classes,e)}toNode(){var t=document.createDocumentFragment();for(let e=0;e<this.children.length;e++)t.appendChild(this.children[e].toNode());return t}toMarkup(){let t="";for(let e=0;e<this.children.length;e++)t+=this.children[e].toMarkup();return t}toText(){return this.children.map(e=>e.toText()).join("")}}var ne={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}};const re={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},se={"Å":"A","Ð":"D","Þ":"o","å":"a","ð":"d","þ":"o","А":"A","Б":"B","В":"B","Г":"F","Д":"A","Е":"E","Ж":"K","З":"3","И":"N","Й":"N","К":"K","Л":"N","М":"M","Н":"H","О":"O","П":"N","Р":"P","С":"C","Т":"T","У":"y","Ф":"O","Х":"X","Ц":"U","Ч":"h","Ш":"W","Щ":"W","Ъ":"B","Ы":"X","Ь":"B","Э":"3","Ю":"X","Я":"R","а":"a","б":"b","в":"a","г":"r","д":"y","е":"e","ж":"m","з":"e","и":"n","й":"n","к":"n","л":"n","м":"m","н":"n","о":"o","п":"n","р":"p","с":"c","т":"o","у":"y","ф":"b","х":"x","ц":"n","ч":"n","ш":"w","щ":"w","ъ":"a","ы":"m","ь":"a","э":"e","ю":"m","я":"r"};function oe(e,t,i){if(!ne[t])throw new Error("Font metrics not found for font: "+t+".");let n=e.charCodeAt(0),r=ne[t][n];if(!r&&e[0]in se&&(n=se[e[0]].charCodeAt(0),r=ne[t][n]),r||"text"!==i||ee(n)&&(r=ne[t][77]),r)return{depth:r[0],height:r[1],italic:r[2],skew:r[3],width:r[4]}}function ae(e,t){return t.size<2?e:he[e-1][t.size-1]}const le={},he=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],ce=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488];class de{constructor(e){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=e.style,this.color=e.color,this.size=e.size||de.BASESIZE,this.textSize=e.textSize||this.size,this.phantom=!!e.phantom,this.font=e.font||"",this.fontFamily=e.fontFamily||"",this.fontWeight=e.fontWeight||"",this.fontShape=e.fontShape||"",this.sizeMultiplier=ce[this.size-1],this.maxSize=e.maxSize,this.minRuleThickness=e.minRuleThickness,this._fontMetrics=void 0}extend(e){var t={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};for(const i in e)e.hasOwnProperty(i)&&(t[i]=e[i]);return new de(t)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:ae(this.textSize,e)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(e){return this.size===e&&this.textSize===e?this:this.extend({style:this.style.text(),size:e,textSize:e,sizeMultiplier:ce[e-1]})}havingBaseStyle(e){e=e||this.style.text();var t=ae(de.BASESIZE,e);return this.size===t&&this.textSize===de.BASESIZE&&this.style===e?this:this.extend({style:e,size:t})}havingBaseSizing(){let e;switch(this.style.id){case 4:case 5:e=3;break;case 6:case 7:e=1;break;default:e=6}return this.extend({style:this.style.text(),size:e})}withColor(e){return this.extend({color:e})}withPhantom(){return this.extend({phantom:!0})}withFont(e){return this.extend({font:e})}withTextFontFamily(e){return this.extend({fontFamily:e,font:""})}withTextFontWeight(e){return this.extend({fontWeight:e,font:""})}withTextFontShape(e){return this.extend({fontShape:e,font:""})}sizingClasses(e){return e.size!==this.size?["sizing","reset-size"+e.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==de.BASESIZE?["sizing","reset-size"+this.size,"size"+de.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=function(e){var t=5<=e?0:3<=e?1:2;if(!le[t]){const e=le[t]={cssEmPerMu:re.quad[t]/18};for(const i in re)re.hasOwnProperty(i)&&(e[i]=re[i][t])}return le[t]}(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}de.BASESIZE=6;var ue=de;function pe(e){return(e="string"!=typeof e?e.unit:e)in ye||e in be||"ex"===e}function E(e,t){let i;if(e.unit in ye)i=ye[e.unit]/t.fontMetrics().ptPerEm/t.sizeMultiplier;else if("mu"===e.unit)i=t.fontMetrics().cssEmPerMu;else{var n=t.style.isTight()?t.havingStyle(t.style.text()):t;if("ex"===e.unit)i=n.fontMetrics().xHeight;else{if("em"!==e.unit)throw new _("Invalid unit: '"+e.unit+"'");i=n.fontMetrics().quad}n!==t&&(i*=n.sizeMultiplier/t.sizeMultiplier)}return Math.min(e.number*i,t.maxSize)}function me(e){return e.filter(e=>e).join(" ")}function ge(e,t,i){if(this.classes=e||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=i||{},t){t.style.isTight()&&this.classes.push("mtight");const e=t.getColor();e&&(this.style.color=e)}}function fe(e){var t=document.createElement(e);t.className=me(this.classes);for(const e in this.style)this.style.hasOwnProperty(e)&&(t.style[e]=this.style[e]);for(const e in this.attributes)this.attributes.hasOwnProperty(e)&&t.setAttribute(e,this.attributes[e]);for(let e=0;e<this.children.length;e++)t.appendChild(this.children[e].toNode());return t}function ve(e){let t="<"+e,i=(this.classes.length&&(t+=' class="'+C.escape(me(this.classes))+'"'),"");for(const e in this.style)this.style.hasOwnProperty(e)&&(i+=C.hyphenate(e)+":"+this.style[e]+";");i&&(t+=' style="'+C.escape(i)+'"');for(const e in this.attributes)this.attributes.hasOwnProperty(e)&&(t+=" "+e+'="'+C.escape(this.attributes[e])+'"');t+=">";for(let e=0;e<this.children.length;e++)t+=this.children[e].toMarkup();return t+="</"+e+">"}const ye={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:1.00375,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:1.00375},be={ex:!0,em:!0,mu:!0},M=function(e){return+e.toFixed(4)+"em"};class we{constructor(e,t,i,n){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,ge.call(this,e,i,n),this.children=t||[]}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return C.contains(this.classes,e)}toNode(){return fe.call(this,"span")}toMarkup(){return ve.call(this,"span")}}class xe{constructor(e,t,i,n){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,ge.call(this,t,n),this.children=i||[],this.setAttribute("href",e)}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return C.contains(this.classes,e)}toNode(){return fe.call(this,"a")}toMarkup(){return ve.call(this,"a")}}class Se{constructor(e,t,i){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=t,this.src=e,this.classes=["mord"],this.style=i}hasClass(e){return C.contains(this.classes,e)}toNode(){var e=document.createElement("img");e.src=this.src,e.alt=this.alt,e.className="mord";for(const t in this.style)this.style.hasOwnProperty(t)&&(e.style[t]=this.style[t]);return e}toMarkup(){let e='<img src="'+C.escape(this.src)+'" alt="'+C.escape(this.alt)+'"',t="";for(const e in this.style)this.style.hasOwnProperty(e)&&(t+=C.hyphenate(e)+":"+this.style[e]+";");return t&&(e+=' style="'+C.escape(t)+'"'),e+="'/>"}}const Ae={"î":"ı̂","ï":"ı̈","í":"ı́","ì":"ı̀"};class m{constructor(e,t,i,n,r,s,o,a){this.text=void 0,this.height=void 0,this.depth=void 0,this.italic=void 0,this.skew=void 0,this.width=void 0,this.maxFontSize=void 0,this.classes=void 0,this.style=void 0,this.text=e,this.height=t||0,this.depth=i||0,this.italic=n||0,this.skew=r||0,this.width=s||0,this.classes=o||[],this.style=a||{},this.maxFontSize=0;e=function(t){for(let e=0;e<J.length;e++){var i=J[e];for(let e=0;e<i.blocks.length;e++){var n=i.blocks[e];if(t>=n[0]&&t<=n[1])return i.name}}return null}(this.text.charCodeAt(0));e&&this.classes.push(e+"_fallback"),/[\xee\xef\xed\xec]/.test(this.text)&&(this.text=Ae[this.text])}hasClass(e){return C.contains(this.classes,e)}toNode(){const e=document.createTextNode(this.text);let t=null;0<this.italic&&((t=document.createElement("span")).style.marginRight=M(this.italic)),0<this.classes.length&&((t=t||document.createElement("span")).className=me(this.classes));for(const e in this.style)this.style.hasOwnProperty(e)&&(t=t||document.createElement("span"),t.style[e]=this.style[e]);return t?(t.appendChild(e),t):e}toMarkup(){let e=!1,t="<span",i=(this.classes.length&&(e=!0,t=(t+=' class="')+C.escape(me(this.classes))+'"'),"");0<this.italic&&(i+="margin-right:"+this.italic+"em;");for(const e in this.style)this.style.hasOwnProperty(e)&&(i+=C.hyphenate(e)+":"+this.style[e]+";");i&&(e=!0,t+=' style="'+C.escape(i)+'"');var n=C.escape(this.text);return e?t=(t+=">")+n+"</span>":n}}class ke{constructor(e,t){this.children=void 0,this.attributes=void 0,this.children=e||[],this.attributes=t||{}}toNode(){var t=document.createElementNS("http://www.w3.org/2000/svg","svg");for(const e in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,e)&&t.setAttribute(e,this.attributes[e]);for(let e=0;e<this.children.length;e++)t.appendChild(this.children[e].toNode());return t}toMarkup(){let t='<svg xmlns="http://www.w3.org/2000/svg"';for(const e in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,e)&&(t+=" "+e+'="'+C.escape(this.attributes[e])+'"');t+=">";for(let e=0;e<this.children.length;e++)t+=this.children[e].toMarkup();return t+="</svg>"}}class _e{constructor(e,t){this.pathName=void 0,this.alternate=void 0,this.pathName=e,this.alternate=t}toNode(){var e=document.createElementNS("http://www.w3.org/2000/svg","path");return this.alternate?e.setAttribute("d",this.alternate):e.setAttribute("d",te[this.pathName]),e}toMarkup(){return this.alternate?'<path d="'+C.escape(this.alternate)+'"/>':'<path d="'+C.escape(te[this.pathName])+'"/>'}}class Ce{constructor(e){this.attributes=void 0,this.attributes=e||{}}toNode(){var e=document.createElementNS("http://www.w3.org/2000/svg","line");for(const t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);return e}toMarkup(){let e="<line";for(const t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&(e+=" "+t+'="'+C.escape(this.attributes[t])+'"');return e+="/>"}}function Te(e){if(e instanceof m)return e;throw new Error("Expected symbolNode but got "+String(e)+".")}const Ee={bin:1,close:1,inner:1,open:1,punct:1,rel:1},Me={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1},Re={math:{},text:{}};var d=Re;function i(e,t,i,n,r,s){Re[e][r]={font:t,group:i,replace:n},s&&n&&(Re[e][n]=Re[e][r])}var n="math",r="text",s="main",e="ams",o="accent-token",a="bin",l="close",$e="inner",h="mathord",c="op-token",u="open",Le="punct",p="rel",g="spacing",f="textord";i(n,s,p,"≡","\\equiv",!0),i(n,s,p,"≺","\\prec",!0),i(n,s,p,"≻","\\succ",!0),i(n,s,p,"","\\sim",!0),i(n,s,p,"⊥","\\perp"),i(n,s,p,"⪯","\\preceq",!0),i(n,s,p,"⪰","\\succeq",!0),i(n,s,p,"≃","\\simeq",!0),i(n,s,p,"","\\mid",!0),i(n,s,p,"≪","\\ll",!0),i(n,s,p,"≫","\\gg",!0),i(n,s,p,"≍","\\asymp",!0),i(n,s,p,"∥","\\parallel"),i(n,s,p,"⋈","\\bowtie",!0),i(n,s,p,"⌣","\\smile",!0),i(n,s,p,"⊑","\\sqsubseteq",!0),i(n,s,p,"⊒","\\sqsupseteq",!0),i(n,s,p,"≐","\\doteq",!0),i(n,s,p,"⌢","\\frown",!0),i(n,s,p,"∋","\\ni",!0),i(n,s,p,"∝","\\propto",!0),i(n,s,p,"⊢","\\vdash",!0),i(n,s,p,"⊣","\\dashv",!0),i(n,s,p,"∋","\\owns"),i(n,s,Le,".","\\ldotp"),i(n,s,Le,"⋅","\\cdotp"),i(n,s,f,"#","\\#"),i(r,s,f,"#","\\#"),i(n,s,f,"&","\\&"),i(r,s,f,"&","\\&"),i(n,s,f,"ℵ","\\aleph",!0),i(n,s,f,"∀","\\forall",!0),i(n,s,f,"ℏ","\\hbar",!0),i(n,s,f,"∃","\\exists",!0),i(n,s,f,"∇","\\nabla",!0),i(n,s,f,"♭","\\flat",!0),i(n,s,f,"","\\ell",!0),i(n,s,f,"♮","\\natural",!0),i(n,s,f,"♣","\\clubsuit",!0),i(n,s,f,"℘","\\wp",!0),i(n,s,f,"♯","\\sharp",!0),i(n,s,f,"♢","\\diamondsuit",!0),i(n,s,f,"","\\Re",!0),i(n,s,f,"♡","\\heartsuit",!0),i(n,s,f,"","\\Im",!0),i(n,s,f,"♠","\\spadesuit",!0),i(n,s,f,"§","\\S",!0),i(r,s,f,"§","\\S"),i(n,s,f,"¶","\\P",!0),i(r,s,f,"¶","\\P"),i(n,s,f,"†","\\dag"),i(r,s,f,"†","\\dag"),i(r,s,f,"†","\\textdagger"),i(n,s,f,"‡","\\ddag"),i(r,s,f,"‡","\\ddag"),i(r,s,f,"‡","\\textdaggerdbl"),i(n,s,l,"⎱","\\rmoustache",!0),i(n,s,u,"⎰","\\lmoustache",!0),i(n,s,l,"⟯","\\rgroup",!0),i(n,s,u,"⟮","\\lgroup",!0),i(n,s,a,"∓","\\mp",!0),i(n,s,a,"⊖","\\ominus",!0),i(n,s,a,"⊎","\\uplus",!0),i(n,s,a,"⊓","\\sqcap",!0),i(n,s,a,"","\\ast"),i(n,s,a,"⊔","\\sqcup",!0),i(n,s,a,"◯","\\bigcirc",!0),i(n,s,a,"∙","\\bullet",!0),i(n,s,a,"‡","\\ddagger"),i(n,s,a,"≀","\\wr",!0),i(n,s,a,"⨿","\\amalg"),i(n,s,a,"&","\\And"),i(n,s,p,"⟵","\\longleftarrow",!0),i(n,s,p,"⇐","\\Leftarrow",!0),i(n,s,p,"⟸","\\Longleftarrow",!0),i(n,s,p,"⟶","\\longrightarrow",!0),i(n,s,p,"⇒","\\Rightarrow",!0),i(n,s,p,"⟹","\\Longrightarrow",!0),i(n,s,p,"↔","\\leftrightarrow",!0),i(n,s,p,"⟷","\\longleftrightarrow",!0),i(n,s,p,"⇔","\\Leftrightarrow",!0),i(n,s,p,"⟺","\\Longleftrightarrow",!0),i(n,s,p,"↦","\\mapsto",!0),i(n,s,p,"⟼","\\longmapsto",!0),i(n,s,p,"↗","\\nearrow",!0),i(n,s,p,"↩","\\hookleftarrow",!0),i(n,s,p,"↪","\\hookrightarrow",!0),i(n,s,p,"↘","\\searrow",!0),i(n,s,p,"↼","\\leftharpoonup",!0),i(n,s,p,"⇀","\\rightharpoonup",!0),i(n,s,p,"↙","\\swarrow",!0),i(n,s,p,"↽","\\leftharpoondown",!0),i(n,s,p,"⇁","\\rightharpoondown",!0),i(n,s,p,"↖","\\nwarrow",!0),i(n,s,p,"⇌","\\rightleftharpoons",!0),i(n,e,p,"≮","\\nless",!0),i(n,e,p,"","\\@nleqslant"),i(n,e,p,"","\\@nleqq"),i(n,e,p,"⪇","\\lneq",!0),i(n,e,p,"≨","\\lneqq",!0),i(n,e,p,"","\\@lvertneqq"),i(n,e,p,"⋦","\\lnsim",!0),i(n,e,p,"⪉","\\lnapprox",!0),i(n,e,p,"⊀","\\nprec",!0),i(n,e,p,"⋠","\\npreceq",!0),i(n,e,p,"⋨","\\precnsim",!0),i(n,e,p,"⪹","\\precnapprox",!0),i(n,e,p,"≁","\\nsim",!0),i(n,e,p,"","\\@nshortmid"),i(n,e,p,"∤","\\nmid",!0),i(n,e,p,"⊬","\\nvdash",!0),i(n,e,p,"⊭","\\nvDash",!0),i(n,e,p,"⋪","\\ntriangleleft"),i(n,e,p,"⋬","\\ntrianglelefteq",!0),i(n,e,p,"⊊","\\subsetneq",!0),i(n,e,p,"","\\@varsubsetneq"),i(n,e,p,"⫋","\\subsetneqq",!0),i(n,e,p,"","\\@varsubsetneqq"),i(n,e,p,"≯","\\ngtr",!0),i(n,e,p,"","\\@ngeqslant"),i(n,e,p,"","\\@ngeqq"),i(n,e,p,"⪈","\\gneq",!0),i(n,e,p,"≩","\\gneqq",!0),i(n,e,p,"","\\@gvertneqq"),i(n,e,p,"⋧","\\gnsim",!0),i(n,e,p,"⪊","\\gnapprox",!0),i(n,e,p,"⊁","\\nsucc",!0),i(n,e,p,"⋡","\\nsucceq",!0),i(n,e,p,"⋩","\\succnsim",!0),i(n,e,p,"⪺","\\succnapprox",!0),i(n,e,p,"≆","\\ncong",!0),i(n,e,p,"","\\@nshortparallel"),i(n,e,p,"∦","\\nparallel",!0),i(n,e,p,"⊯","\\nVDash",!0),i(n,e,p,"⋫","\\ntriangleright"),i(n,e,p,"⋭","\\ntrianglerighteq",!0),i(n,e,p,"","\\@nsupseteqq"),i(n,e,p,"⊋","\\supsetneq",!0),i(n,e,p,"","\\@varsupsetneq"),i(n,e,p,"⫌","\\supsetneqq",!0),i(n,e,p,"","\\@varsupsetneqq"),i(n,e,p,"⊮","\\nVdash",!0),i(n,e,p,"⪵","\\precneqq",!0),i(n,e,p,"⪶","\\succneqq",!0),i(n,e,p,"","\\@nsubseteqq"),i(n,e,a,"⊴","\\unlhd"),i(n,e,a,"⊵","\\unrhd"),i(n,e,p,"↚","\\nleftarrow",!0),i(n,e,p,"↛","\\nrightarrow",!0),i(n,e,p,"⇍","\\nLeftarrow",!0),i(n,e,p,"⇏","\\nRightarrow",!0),i(n,e,p,"↮","\\nleftrightarrow",!0),i(n,e,p,"⇎","\\nLeftrightarrow",!0),i(n,e,p,"△","\\vartriangle"),i(n,e,f,"ℏ","\\hslash"),i(n,e,f,"▽","\\triangledown"),i(n,e,f,"◊","\\lozenge"),i(n,e,f,"Ⓢ","\\circledS"),i(n,e,f,"®","\\circledR"),i(r,e,f,"®","\\circledR"),i(n,e,f,"∡","\\measuredangle",!0),i(n,e,f,"∄","\\nexists"),i(n,e,f,"℧","\\mho"),i(n,e,f,"Ⅎ","\\Finv",!0),i(n,e,f,"⅁","\\Game",!0),i(n,e,f,"","\\backprime"),i(n,e,f,"▲","\\blacktriangle"),i(n,e,f,"▼","\\blacktriangledown"),i(n,e,f,"■","\\blacksquare"),i(n,e,f,"⧫","\\blacklozenge"),i(n,e,f,"★","\\bigstar"),i(n,e,f,"∢","\\sphericalangle",!0),i(n,e,f,"∁","\\complement",!0),i(n,e,f,"ð","\\eth",!0),i(r,s,f,"ð","ð"),i(n,e,f,"","\\diagup"),i(n,e,f,"╲","\\diagdown"),i(n,e,f,"□","\\square"),i(n,e,f,"□","\\Box"),i(n,e,f,"◊","\\Diamond"),i(n,e,f,"¥","\\yen",!0),i(r,e,f,"¥","\\yen",!0),i(n,e,f,"✓","\\checkmark",!0),i(r,e,f,"✓","\\checkmark"),i(n,e,f,"ℶ","\\beth",!0),i(n,e,f,"ℸ","\\daleth",!0),i(n,e,f,"ℷ","\\gimel",!0),i(n,e,f,"ϝ","\\digamma",!0),i(n,e,f,"ϰ","\\varkappa"),i(n,e,u,"┌","\\@ulcorner",!0),i(n,e,l,"┐","\\@urcorner",!0),i(n,e,u,"└","\\@llcorner",!0),i(n,e,l,"┘","\\@lrcorner",!0),i(n,e,p,"≦","\\leqq",!0),i(n,e,p,"⩽","\\leqslant",!0),i(n,e,p,"⪕","\\eqslantless",!0),i(n,e,p,"≲","\\lesssim",!0),i(n,e,p,"⪅","\\lessapprox",!0),i(n,e,p,"≊","\\approxeq",!0),i(n,e,a,"⋖","\\lessdot"),i(n,e,p,"⋘","\\lll",!0),i(n,e,p,"≶","\\lessgtr",!0),i(n,e,p,"⋚","\\lesseqgtr",!0),i(n,e,p,"⪋","\\lesseqqgtr",!0),i(n,e,p,"≑","\\doteqdot"),i(n,e,p,"≓","\\risingdotseq",!0),i(n,e,p,"≒","\\fallingdotseq",!0),i(n,e,p,"∽","\\backsim",!0),i(n,e,p,"⋍","\\backsimeq",!0),i(n,e,p,"⫅","\\subseteqq",!0),i(n,e,p,"⋐","\\Subset",!0),i(n,e,p,"⊏","\\sqsubset",!0),i(n,e,p,"≼","\\preccurlyeq",!0),i(n,e,p,"⋞","\\curlyeqprec",!0),i(n,e,p,"≾","\\precsim",!0),i(n,e,p,"⪷","\\precapprox",!0),i(n,e,p,"⊲","\\vartriangleleft"),i(n,e,p,"⊴","\\trianglelefteq"),i(n,e,p,"⊨","\\vDash",!0),i(n,e,p,"⊪","\\Vvdash",!0),i(n,e,p,"⌣","\\smallsmile"),i(n,e,p,"⌢","\\smallfrown"),i(n,e,p,"≏","\\bumpeq",!0),i(n,e,p,"≎","\\Bumpeq",!0),i(n,e,p,"≧","\\geqq",!0),i(n,e,p,"⩾","\\geqslant",!0),i(n,e,p,"⪖","\\eqslantgtr",!0),i(n,e,p,"≳","\\gtrsim",!0),i(n,e,p,"⪆","\\gtrapprox",!0),i(n,e,a,"⋗","\\gtrdot"),i(n,e,p,"⋙","\\ggg",!0),i(n,e,p,"≷","\\gtrless",!0),i(n,e,p,"⋛","\\gtreqless",!0),i(n,e,p,"⪌","\\gtreqqless",!0),i(n,e,p,"≖","\\eqcirc",!0),i(n,e,p,"≗","\\circeq",!0),i(n,e,p,"≜","\\triangleq",!0),i(n,e,p,"","\\thicksim"),i(n,e,p,"≈","\\thickapprox"),i(n,e,p,"⫆","\\supseteqq",!0),i(n,e,p,"⋑","\\Supset",!0),i(n,e,p,"⊐","\\sqsupset",!0),i(n,e,p,"≽","\\succcurlyeq",!0),i(n,e,p,"⋟","\\curlyeqsucc",!0),i(n,e,p,"≿","\\succsim",!0),i(n,e,p,"⪸","\\succapprox",!0),i(n,e,p,"⊳","\\vartriangleright"),i(n,e,p,"⊵","\\trianglerighteq"),i(n,e,p,"⊩","\\Vdash",!0),i(n,e,p,"","\\shortmid"),i(n,e,p,"∥","\\shortparallel"),i(n,e,p,"≬","\\between",!0),i(n,e,p,"⋔","\\pitchfork",!0),i(n,e,p,"∝","\\varpropto"),i(n,e,p,"◀","\\blacktriangleleft"),i(n,e,p,"∴","\\therefore",!0),i(n,e,p,"∍","\\backepsilon"),i(n,e,p,"▶","\\blacktriangleright"),i(n,e,p,"∵","\\because",!0),i(n,e,p,"⋘","\\llless"),i(n,e,p,"⋙","\\gggtr"),i(n,e,a,"⊲","\\lhd"),i(n,e,a,"⊳","\\rhd"),i(n,e,p,"≂","\\eqsim",!0),i(n,s,p,"⋈","\\Join"),i(n,e,p,"≑","\\Doteq",!0),i(n,e,a,"∔","\\dotplus",!0),i(n,e,a,"","\\smallsetminus"),i(n,e,a,"⋒","\\Cap",!0),i(n,e,a,"⋓","\\Cup",!0),i(n,e,a,"⩞","\\doublebarwedge",!0),i(n,e,a,"⊟","\\boxminus",!0),i(n,e,a,"⊞","\\boxplus",!0),i(n,e,a,"⋇","\\divideontimes",!0),i(n,e,a,"⋉","\\ltimes",!0),i(n,e,a,"⋊","\\rtimes",!0),i(n,e,a,"⋋","\\leftthreetimes",!0),i(n,e,a,"⋌","\\rightthreetimes",!0),i(n,e,a,"⋏","\\curlywedge",!0),i(n,e,a,"⋎","\\curlyvee",!0),i(n,e,a,"⊝","\\circleddash",!0),i(n,e,a,"⊛","\\circledast",!0),i(n,e,a,"⋅","\\centerdot"),i(n,e,a,"⊺","\\intercal",!0),i(n,e,a,"⋒","\\doublecap"),i(n,e,a,"⋓","\\doublecup"),i(n,e,a,"⊠","\\boxtimes",!0),i(n,e,p,"⇢","\\dashrightarrow",!0),i(n,e,p,"⇠","\\dashleftarrow",!0),i(n,e,p,"⇇","\\leftleftarrows",!0),i(n,e,p,"⇆","\\leftrightarrows",!0),i(n,e,p,"⇚","\\Lleftarrow",!0),i(n,e,p,"↞","\\twoheadleftarrow",!0),i(n,e,p,"↢","\\leftarrowtail",!0),i(n,e,p,"↫","\\looparrowleft",!0),i(n,e,p,"⇋","\\leftrightharpoons",!0),i(n,e,p,"↶","\\curvearrowleft",!0),i(n,e,p,"↺","\\circlearrowleft",!0),i(n,e,p,"↰","\\Lsh",!0),i(n,e,p,"⇈","\\upuparrows",!0),i(n,e,p,"↿","\\upharpoonleft",!0),i(n,e,p,"⇃","\\downharpoonleft",!0),i(n,s,p,"⊶","\\origof",!0),i(n,s,p,"⊷","\\imageof",!0),i(n,e,p,"⊸","\\multimap",!0),i(n,e,p,"↭","\\leftrightsquigarrow",!0),i(n,e,p,"⇉","\\rightrightarrows",!0),i(n,e,p,"⇄","\\rightleftarrows",!0),i(n,e,p,"↠","\\twoheadrightarrow",!0),i(n,e,p,"↣","\\rightarrowtail",!0),i(n,e,p,"↬","\\looparrowright",!0),i(n,e,p,"↷","\\curvearrowright",!0),i(n,e,p,"↻","\\circlearrowright",!0),i(n,e,p,"↱","\\Rsh",!0),i(n,e,p,"⇊","\\downdownarrows",!0),i(n,e,p,"↾","\\upharpoonright",!0),i(n,e,p,"⇂","\\downharpoonright",!0),i(n,e,p,"⇝","\\rightsquigarrow",!0),i(n,e,p,"⇝","\\leadsto"),i(n,e,p,"⇛","\\Rrightarrow",!0),i(n,e,p,"↾","\\restriction"),i(n,s,f,"","`"),i(n,s,f,"$","\\$"),i(r,s,f,"$","\\$"),i(r,s,f,"$","\\textdollar"),i(n,s,f,"%","\\%"),i(r,s,f,"%","\\%"),i(n,s,f,"_","\\_"),i(r,s,f,"_","\\_"),i(r,s,f,"_","\\textunderscore"),i(n,s,f,"∠","\\angle",!0),i(n,s,f,"∞","\\infty",!0),i(n,s,f,"","\\prime"),i(n,s,f,"△","\\triangle"),i(n,s,f,"Γ","\\Gamma",!0),i(n,s,f,"Δ","\\Delta",!0),i(n,s,f,"Θ","\\Theta",!0),i(n,s,f,"Λ","\\Lambda",!0),i(n,s,f,"Ξ","\\Xi",!0),i(n,s,f,"Π","\\Pi",!0),i(n,s,f,"Σ","\\Sigma",!0),i(n,s,f,"Υ","\\Upsilon",!0),i(n,s,f,"Φ","\\Phi",!0),i(n,s,f,"Ψ","\\Psi",!0),i(n,s,f,"Ω","\\Omega",!0),i(n,s,f,"A","Α"),i(n,s,f,"B","Β"),i(n,s,f,"E","Ε"),i(n,s,f,"Z","Ζ"),i(n,s,f,"H","Η"),i(n,s,f,"I","Ι"),i(n,s,f,"K","Κ"),i(n,s,f,"M","Μ"),i(n,s,f,"N","Ν"),i(n,s,f,"O","Ο"),i(n,s,f,"P","Ρ"),i(n,s,f,"T","Τ"),i(n,s,f,"X","Χ"),i(n,s,f,"¬","\\neg",!0),i(n,s,f,"¬","\\lnot"),i(n,s,f,"","\\top"),i(n,s,f,"⊥","\\bot"),i(n,s,f,"∅","\\emptyset"),i(n,e,f,"∅","\\varnothing"),i(n,s,h,"α","\\alpha",!0),i(n,s,h,"β","\\beta",!0),i(n,s,h,"γ","\\gamma",!0),i(n,s,h,"δ","\\delta",!0),i(n,s,h,"ϵ","\\epsilon",!0),i(n,s,h,"ζ","\\zeta",!0),i(n,s,h,"η","\\eta",!0),i(n,s,h,"θ","\\theta",!0),i(n,s,h,"ι","\\iota",!0),i(n,s,h,"κ","\\kappa",!0),i(n,s,h,"λ","\\lambda",!0),i(n,s,h,"μ","\\mu",!0),i(n,s,h,"ν","\\nu",!0),i(n,s,h,"ξ","\\xi",!0),i(n,s,h,"ο","\\omicron",!0),i(n,s,h,"π","\\pi",!0),i(n,s,h,"ρ","\\rho",!0),i(n,s,h,"σ","\\sigma",!0),i(n,s,h,"τ","\\tau",!0),i(n,s,h,"υ","\\upsilon",!0),i(n,s,h,"ϕ","\\phi",!0),i(n,s,h,"χ","\\chi",!0),i(n,s,h,"ψ","\\psi",!0),i(n,s,h,"ω","\\omega",!0),i(n,s,h,"ε","\\varepsilon",!0),i(n,s,h,"ϑ","\\vartheta",!0),i(n,s,h,"ϖ","\\varpi",!0),i(n,s,h,"ϱ","\\varrho",!0),i(n,s,h,"ς","\\varsigma",!0),i(n,s,h,"φ","\\varphi",!0),i(n,s,a,"","*",!0),i(n,s,a,"+","+"),i(n,s,a,"","-",!0),i(n,s,a,"⋅","\\cdot",!0),i(n,s,a,"∘","\\circ",!0),i(n,s,a,"÷","\\div",!0),i(n,s,a,"±","\\pm",!0),i(n,s,a,"×","\\times",!0),i(n,s,a,"∩","\\cap",!0),i(n,s,a,"","\\cup",!0),i(n,s,a,"","\\setminus",!0),i(n,s,a,"∧","\\land"),i(n,s,a,"","\\lor"),i(n,s,a,"∧","\\wedge",!0),i(n,s,a,"","\\vee",!0),i(n,s,f,"√","\\surd"),i(n,s,u,"⟨","\\langle",!0),i(n,s,u,"","\\lvert"),i(n,s,u,"∥","\\lVert"),i(n,s,l,"?","?"),i(n,s,l,"!","!"),i(n,s,l,"⟩","\\rangle",!0),i(n,s,l,"","\\rvert"),i(n,s,l,"∥","\\rVert"),i(n,s,p,"=","="),i(n,s,p,":",":"),i(n,s,p,"≈","\\approx",!0),i(n,s,p,"≅","\\cong",!0),i(n,s,p,"≥","\\ge"),i(n,s,p,"≥","\\geq",!0),i(n,s,p,"←","\\gets"),i(n,s,p,">","\\gt",!0),i(n,s,p,"∈","\\in",!0),i(n,s,p,"","\\@not"),i(n,s,p,"⊂","\\subset",!0),i(n,s,p,"⊃","\\supset",!0),i(n,s,p,"⊆","\\subseteq",!0),i(n,s,p,"⊇","\\supseteq",!0),i(n,e,p,"⊈","\\nsubseteq",!0),i(n,e,p,"⊉","\\nsupseteq",!0),i(n,s,p,"⊨","\\models"),i(n,s,p,"←","\\leftarrow",!0),i(n,s,p,"≤","\\le"),i(n,s,p,"≤","\\leq",!0),i(n,s,p,"<","\\lt",!0),i(n,s,p,"→","\\rightarrow",!0),i(n,s,p,"→","\\to"),i(n,e,p,"≱","\\ngeq",!0),i(n,e,p,"≰","\\nleq",!0),i(n,s,g," ","\\ "),i(n,s,g," ","\\space"),i(n,s,g," ","\\nobreakspace"),i(r,s,g," ","\\ "),i(r,s,g," "," "),i(r,s,g," ","\\space"),i(r,s,g," ","\\nobreakspace"),i(n,s,g,null,"\\nobreak"),i(n,s,g,null,"\\allowbreak"),i(n,s,Le,",",","),i(n,s,Le,";",";"),i(n,e,a,"⊼","\\barwedge",!0),i(n,e,a,"⊻","\\veebar",!0),i(n,s,a,"⊙","\\odot",!0),i(n,s,a,"⊕","\\oplus",!0),i(n,s,a,"⊗","\\otimes",!0),i(n,s,f,"∂","\\partial",!0),i(n,s,a,"⊘","\\oslash",!0),i(n,e,a,"⊚","\\circledcirc",!0),i(n,e,a,"⊡","\\boxdot",!0),i(n,s,a,"△","\\bigtriangleup"),i(n,s,a,"▽","\\bigtriangledown"),i(n,s,a,"†","\\dagger"),i(n,s,a,"⋄","\\diamond"),i(n,s,a,"⋆","\\star"),i(n,s,a,"◃","\\triangleleft"),i(n,s,a,"▹","\\triangleright"),i(n,s,u,"{","\\{"),i(r,s,f,"{","\\{"),i(r,s,f,"{","\\textbraceleft"),i(n,s,l,"}","\\}"),i(r,s,f,"}","\\}"),i(r,s,f,"}","\\textbraceright"),i(n,s,u,"{","\\lbrace"),i(n,s,l,"}","\\rbrace"),i(n,s,u,"[","\\lbrack",!0),i(r,s,f,"[","\\lbrack",!0),i(n,s,l,"]","\\rbrack",!0),i(r,s,f,"]","\\rbrack",!0),i(n,s,u,"(","\\lparen",!0),i(n,s,l,")","\\rparen",!0),i(r,s,f,"<","\\textless",!0),i(r,s,f,">","\\textgreater",!0),i(n,s,u,"⌊","\\lfloor",!0),i(n,s,l,"⌋","\\rfloor",!0),i(n,s,u,"⌈","\\lceil",!0),i(n,s,l,"⌉","\\rceil",!0),i(n,s,f,"\\","\\backslash"),i(n,s,f,"","|"),i(n,s,f,"","\\vert"),i(r,s,f,"|","\\textbar",!0),i(n,s,f,"∥","\\|"),i(n,s,f,"∥","\\Vert"),i(r,s,f,"∥","\\textbardbl"),i(r,s,f,"~","\\textasciitilde"),i(r,s,f,"\\","\\textbackslash"),i(r,s,f,"^","\\textasciicircum"),i(n,s,p,"↑","\\uparrow",!0),i(n,s,p,"⇑","\\Uparrow",!0),i(n,s,p,"↓","\\downarrow",!0),i(n,s,p,"⇓","\\Downarrow",!0),i(n,s,p,"↕","\\updownarrow",!0),i(n,s,p,"⇕","\\Updownarrow",!0),i(n,s,c,"∐","\\coprod"),i(n,s,c,"","\\bigvee"),i(n,s,c,"⋀","\\bigwedge"),i(n,s,c,"⨄","\\biguplus"),i(n,s,c,"⋂","\\bigcap"),i(n,s,c,"","\\bigcup"),i(n,s,c,"∫","\\int"),i(n,s,c,"∫","\\intop"),i(n,s,c,"∬","\\iint"),i(n,s,c,"∭","\\iiint"),i(n,s,c,"∏","\\prod"),i(n,s,c,"∑","\\sum"),i(n,s,c,"⨂","\\bigotimes"),i(n,s,c,"⨁","\\bigoplus"),i(n,s,c,"⨀","\\bigodot"),i(n,s,c,"∮","\\oint"),i(n,s,c,"∯","\\oiint"),i(n,s,c,"∰","\\oiiint"),i(n,s,c,"⨆","\\bigsqcup"),i(n,s,c,"∫","\\smallint"),i(r,s,$e,"…","\\textellipsis"),i(n,s,$e,"…","\\mathellipsis"),i(r,s,$e,"…","\\ldots",!0),i(n,s,$e,"…","\\ldots",!0),i(n,s,$e,"⋯","\\@cdots",!0),i(n,s,$e,"⋱","\\ddots",!0),i(n,s,f,"⋮","\\varvdots"),i(n,s,o,"ˊ","\\acute"),i(n,s,o,"ˋ","\\grave"),i(n,s,o,"¨","\\ddot"),i(n,s,o,"~","\\tilde"),i(n,s,o,"ˉ","\\bar"),i(n,s,o,"˘","\\breve"),i(n,s,o,"ˇ","\\check"),i(n,s,o,"^","\\hat"),i(n,s,o,"⃗","\\vec"),i(n,s,o,"˙","\\dot"),i(n,s,o,"˚","\\mathring"),i(n,s,h,"","\\@imath"),i(n,s,h,"","\\@jmath"),i(n,s,f,"ı","ı"),i(n,s,f,"ȷ","ȷ"),i(r,s,f,"ı","\\i",!0),i(r,s,f,"ȷ","\\j",!0),i(r,s,f,"ß","\\ss",!0),i(r,s,f,"æ","\\ae",!0),i(r,s,f,"œ","\\oe",!0),i(r,s,f,"ø","\\o",!0),i(r,s,f,"Æ","\\AE",!0),i(r,s,f,"Œ","\\OE",!0),i(r,s,f,"Ø","\\O",!0),i(r,s,o,"ˊ","\\'"),i(r,s,o,"ˋ","\\`"),i(r,s,o,"ˆ","\\^"),i(r,s,o,"˜","\\~"),i(r,s,o,"ˉ","\\="),i(r,s,o,"˘","\\u"),i(r,s,o,"˙","\\."),i(r,s,o,"¸","\\c"),i(r,s,o,"˚","\\r"),i(r,s,o,"ˇ","\\v"),i(r,s,o,"¨",'\\"'),i(r,s,o,"˝","\\H"),i(r,s,o,"◯","\\textcircled");const Ie={"--":!0,"---":!0,"``":!0,"''":!0};i(r,s,f,"","--",!0),i(r,s,f,"","\\textendash"),i(r,s,f,"—","---",!0),i(r,s,f,"—","\\textemdash"),i(r,s,f,"","`",!0),i(r,s,f,"","\\textquoteleft"),i(r,s,f,"","'",!0),i(r,s,f,"","\\textquoteright"),i(r,s,f,"“","``",!0),i(r,s,f,"“","\\textquotedblleft"),i(r,s,f,"”","''",!0),i(r,s,f,"”","\\textquotedblright"),i(n,s,f,"°","\\degree",!0),i(r,s,f,"°","\\degree"),i(r,s,f,"°","\\textdegree",!0),i(n,s,f,"£","\\pounds"),i(n,s,f,"£","\\mathsterling",!0),i(r,s,f,"£","\\pounds"),i(r,s,f,"£","\\textsterling",!0),i(n,e,f,"✠","\\maltese"),i(r,e,f,"✠","\\maltese");var Fe='0123456789/@."';for(let e=0;e<Fe.length;e++){const t=Fe.charAt(e);i(n,s,f,t,t)}var Pe='0123456789!@*()-=+";:?/.,';for(let e=0;e<Pe.length;e++){const t=Pe.charAt(e);i(r,s,f,t,t)}var De="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";for(let e=0;e<De.length;e++){const t=De.charAt(e);i(n,s,h,t,t),i(r,s,f,t,t)}i(n,e,f,"C",""),i(r,e,f,"C",""),i(n,e,f,"H",""),i(r,e,f,"H",""),i(n,e,f,"N",""),i(r,e,f,"N",""),i(n,e,f,"P",""),i(r,e,f,"P",""),i(n,e,f,"Q",""),i(r,e,f,"Q",""),i(n,e,f,"R",""),i(r,e,f,"R",""),i(n,e,f,"Z",""),i(r,e,f,"Z",""),i(n,s,h,"h",""),i(r,s,h,"h","");let v="";for(let e=0;e<De.length;e++){const t=De.charAt(e);i(n,s,h,t,v=String.fromCharCode(55349,56320+e)),i(r,s,f,t,v),i(n,s,h,t,v=String.fromCharCode(55349,56372+e)),i(r,s,f,t,v),i(n,s,h,t,v=String.fromCharCode(55349,56424+e)),i(r,s,f,t,v),i(n,s,h,t,v=String.fromCharCode(55349,56580+e)),i(r,s,f,t,v),i(n,s,h,t,v=String.fromCharCode(55349,56684+e)),i(r,s,f,t,v),i(n,s,h,t,v=String.fromCharCode(55349,56736+e)),i(r,s,f,t,v),i(n,s,h,t,v=String.fromCharCode(55349,56788+e)),i(r,s,f,t,v),i(n,s,h,t,v=String.fromCharCode(55349,56840+e)),i(r,s,f,t,v),i(n,s,h,t,v=String.fromCharCode(55349,56944+e)),i(r,s,f,t,v),e<26&&(i(n,s,h,t,v=String.fromCharCode(55349,56632+e)),i(r,s,f,t,v),i(n,s,h,t,v=String.fromCharCode(55349,56476+e)),i(r,s,f,t,v))}i(n,s,h,"k",v=String.fromCharCode(55349,56668)),i(r,s,f,"k",v);for(let e=0;e<10;e++){const t=e.toString();i(n,s,h,t,v=String.fromCharCode(55349,57294+e)),i(r,s,f,t,v),i(n,s,h,t,v=String.fromCharCode(55349,57314+e)),i(r,s,f,t,v),i(n,s,h,t,v=String.fromCharCode(55349,57324+e)),i(r,s,f,t,v),i(n,s,h,t,v=String.fromCharCode(55349,57334+e)),i(r,s,f,t,v)}for(let e=0;e<"ÐÞþ".length;e++){const t="ÐÞþ".charAt(e);i(n,s,h,t,t),i(r,s,f,t,t)}function Oe(e,t,i){return{value:e=d[i][e]&&d[i][e].replace?d[i][e].replace:e,metrics:oe(e,t,i)}}function Ne(t,e,i,n,r){var s=Oe(t,e,i),o=s.metrics;let a;if(t=s.value,o){let e=o.italic;("text"===i||n&&"mathit"===n.font)&&(e=0),a=new m(t,o.height,o.depth,e,o.skew,o.width,r)}else"undefined"!=typeof console&&console.warn("No character metrics for '"+t+"' in style '"+e+"' and mode '"+i+"'"),a=new m(t,0,0,0,0,0,r);if(n){a.maxFontSize=n.sizeMultiplier,n.style.isTight()&&a.classes.push("mtight");const t=n.getColor();t&&(a.style.color=t)}return a}function Be(t){let i=0,n=0,r=0;for(let e=0;e<t.children.length;e++){var s=t.children[e];s.height>i&&(i=s.height),s.depth>n&&(n=s.depth),s.maxFontSize>r&&(r=s.maxFontSize)}t.height=i,t.depth=n,t.maxFontSize=r}function y(e,t,i,n){return e=new we(e,t,i,n),Be(e),e}function ze(e){return e=new ie(e),Be(e),e}function He(e,t,i){let n="";switch(e){case"amsrm":n="AMS";break;case"textrm":n="Main";break;case"textsf":n="SansSerif";break;case"texttt":n="Typewriter";break;default:n=e}return n+"-"+("textbf"===t&&"textit"===i?"BoldItalic":"textbf"===t?"Bold":"textit"===t?"Italic":"Regular")}const Ue=[["mathbf","textbf","Main-Bold"],["mathbf","textbf","Main-Bold"],["mathnormal","textit","Math-Italic"],["mathnormal","textit","Math-Italic"],["boldsymbol","boldsymbol","Main-BoldItalic"],["boldsymbol","boldsymbol","Main-BoldItalic"],["mathscr","textscr","Script-Regular"],["","",""],["","",""],["","",""],["mathfrak","textfrak","Fraktur-Regular"],["mathfrak","textfrak","Fraktur-Regular"],["mathbb","textbb","AMS-Regular"],["mathbb","textbb","AMS-Regular"],["mathboldfrak","textboldfrak","Fraktur-Regular"],["mathboldfrak","textboldfrak","Fraktur-Regular"],["mathsf","textsf","SansSerif-Regular"],["mathsf","textsf","SansSerif-Regular"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathitsf","textitsf","SansSerif-Italic"],["mathitsf","textitsf","SansSerif-Italic"],["","",""],["","",""],["mathtt","texttt","Typewriter-Regular"],["mathtt","texttt","Typewriter-Regular"]],We=[["mathbf","textbf","Main-Bold"],["","",""],["mathsf","textsf","SansSerif-Regular"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathtt","texttt","Typewriter-Regular"]],qe=(e,t,i,n)=>new we(e,t,i,n),Ve={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},je={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]};var R={fontMap:Ve,makeSymbol:Ne,mathsym:function(e,t,i,n){return void 0===n&&(n=[]),"boldsymbol"===i.font&&Oe(e,"Main-Bold",t).metrics?Ne(e,"Main-Bold",t,i,n.concat(["mathbf"])):"\\"===e||"main"===d[t][e].font?Ne(e,"Main-Regular",t,i,n):Ne(e,"AMS-Regular",t,i,n.concat(["amsrm"]))},makeSpan:y,makeSvgSpan:qe,makeLineSpan:function(e,t,i){e=y([e],[],t);return e.height=Math.max(i||t.fontMetrics().defaultRuleThickness,t.minRuleThickness),e.style.borderBottomWidth=M(e.height),e.maxFontSize=1,e},makeAnchor:function(e,t,i,n){e=new xe(e,t,i,n);return Be(e),e},makeFragment:ze,wrapFragment:function(e,t){return e instanceof ie?y([],[e],t):e},makeVList:function(t,i){const{children:n,depth:r}=function(i){if("individualShift"===i.positionType){const s=i.children,a=[s[0]],l=-s[0].shift-s[0].elem.depth;let t=l;for(let e=1;e<s.length;e++){var n=-s[e].shift-t-s[e].elem.depth,r=n-(s[e-1].elem.height+s[e-1].elem.depth);t+=n,a.push({type:"kern",size:r}),a.push(s[e])}return{children:a,depth:l}}let s;if("top"===i.positionType){let t=i.positionData;for(let e=0;e<i.children.length;e++){var o=i.children[e];t-="kern"===o.type?o.size:o.elem.height+o.elem.depth}s=t}else if("bottom"===i.positionType)s=-i.positionData;else{var e=i.children[0];if("elem"!==e.type)throw new Error('First child must have type "elem".');if("shift"===i.positionType)s=-e.elem.depth-i.positionData;else{if("firstBaseline"!==i.positionType)throw new Error("Invalid positionType "+i.positionType+".");s=-e.elem.depth}}return{children:i.children,depth:s}}(t);let s=0;for(let e=0;e<n.length;e++){const i=n[e];if("elem"===i.type){const t=i.elem;s=Math.max(s,t.maxFontSize,t.height)}}s+=2;var o=y(["pstrut"],[]),a=(o.style.height=M(s),[]);let l=r,h=r,c=r;for(let e=0;e<n.length;e++){const i=n[e];if("kern"===i.type)c+=i.size;else{const t=i.elem,n=i.wrapperClasses||[],r=i.wrapperStyle||{},l=y(n,[o,t],void 0,r);l.style.top=M(-s-c-t.depth),i.marginLeft&&(l.style.marginLeft=i.marginLeft),i.marginRight&&(l.style.marginRight=i.marginRight),a.push(l),c+=t.height+t.depth}l=Math.min(l,c),h=Math.max(h,c)}var e=y(["vlist"],a);let d;if(e.style.height=M(h),l<0){const t=y([],[]),i=y(["vlist"],[t]),n=(i.style.height=M(-l),y(["vlist-s"],[new m("")]));d=[y(["vlist-r"],[e,n]),y(["vlist-r"],[i])]}else d=[y(["vlist-r"],[e])];t=y(["vlist-t"],d);return 2===d.length&&t.classes.push("vlist-t2"),t.height=h,t.depth=-l,t},makeOrd:function(e,n,r){var s,o,a=e.mode,l=e.text,h=["mord"],e="math"===a||"text"===a&&n.font,c=e?n.font:n.fontFamily;let t="",i="";if(55349===l.charCodeAt(0)&&([t,i]=function(e,t){var i=1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536,t="math"===t?0:1;if(119808<=i&&i<120484){const e=Math.floor((i-119808)/26);return[Ue[e][2],Ue[e][t]]}if(120782<=i&&i<=120831){const e=Math.floor((i-120782)/10);return[We[e][2],We[e][t]]}if(120485==i||120486==i)return[Ue[0][2],Ue[0][t]];if(120486<i&&i<120782)return["",""];throw new _("Unsupported character: "+e)}(l,a)),0<t.length)return Ne(l,t,a,n,h.concat(i));if(c){let t,i;if("boldsymbol"===c){s=l,o=a;const n="textord"!==r&&Oe(s,"Math-BoldItalic",o).metrics?{fontName:"Math-BoldItalic",fontClass:"boldsymbol"}:{fontName:"Main-Bold",fontClass:"mathbf"};t=n.fontName,i=[n.fontClass]}else i=e?(t=Ve[c].fontName,[c]):(t=He(c,n.fontWeight,n.fontShape),[c,n.fontWeight,n.fontShape]);if(Oe(l,t,a).metrics)return Ne(l,t,a,n,h.concat(i));if(Ie.hasOwnProperty(l)&&"Typewriter"===t.slice(0,10)){const r=[];for(let e=0;e<l.length;e++)r.push(Ne(l[e],t,a,n,h.concat(i)));return ze(r)}}if("mathord"===r)return Ne(l,"Math-Italic",a,n,h.concat(["mathnormal"]));if("textord"!==r)throw new Error("unexpected type: "+r+" in makeOrd");{const e=d[a][l]&&d[a][l].font;if("ams"===e){const e=He("amsrm",n.fontWeight,n.fontShape);return Ne(l,e,a,n,h.concat("amsrm",n.fontWeight,n.fontShape))}if("main"!==e&&e){const r=He(e,n.fontWeight,n.fontShape);return Ne(l,r,a,n,h.concat(r,n.fontWeight,n.fontShape))}{const e=He("textrm",n.fontWeight,n.fontShape);return Ne(l,e,a,n,h.concat(n.fontWeight,n.fontShape))}}},makeGlue:(e,t)=>{var i=y(["mspace"],[],t),e=E(e,t);return i.style.marginRight=M(e),i},staticSvg:function(e,t){var[e,i,n]=je[e],e=new _e(e),e=new ke([e],{width:M(i),height:M(n),style:"width:"+M(i),viewBox:"0 0 "+1e3*i+" "+1e3*n,preserveAspectRatio:"xMinYMin"}),e=qe(["overlay"],[e],t);return e.height=n,e.style.height=M(n),e.style.width=M(i),e},svgData:je,tryCombineChars:t=>{for(let e=0;e<t.length-1;e++){var i=t[e],n=t[e+1];i instanceof m&&n instanceof m&&((e,t)=>{if(me(e.classes)!==me(t.classes)||e.skew!==t.skew||e.maxFontSize!==t.maxFontSize)return!1;if(1===e.classes.length){const t=e.classes[0];if("mbin"===t||"mord"===t)return!1}for(const i in e.style)if(e.style.hasOwnProperty(i)&&e.style[i]!==t.style[i])return!1;for(const n in t.style)if(t.style.hasOwnProperty(n)&&e.style[n]!==t.style[n])return!1;return!0})(i,n)&&(i.text+=n.text,i.height=Math.max(i.height,n.height),i.depth=Math.max(i.depth,n.depth),i.italic=n.italic,t.splice(e+1,1),e--)}return t}};const b={number:3,unit:"mu"},Ge={number:4,unit:"mu"},Ke={number:5,unit:"mu"},Xe={mord:{mop:b,mbin:Ge,mrel:Ke,minner:b},mop:{mord:b,mop:b,mrel:Ke,minner:b},mbin:{mord:Ge,mop:Ge,mopen:Ge,minner:Ge},mrel:{mord:Ke,mop:Ke,mopen:Ke,minner:Ke},mopen:{},mclose:{mop:b,mbin:Ge,mrel:Ke,minner:b},mpunct:{mord:b,mop:b,mrel:Ke,mopen:b,mclose:b,mpunct:b,minner:b},minner:{mord:b,mop:b,mbin:Ge,mrel:Ke,mopen:b,mpunct:b,minner:b}},Ye={mord:{mop:b},mop:{mord:b,mop:b},mbin:{},mrel:{},mopen:{},mclose:{mop:b},mpunct:{},minner:{mop:b}},Qe={},Je={},Ze={};function w(e){var{type:e,names:t,props:i,handler:n,htmlBuilder:r,mathmlBuilder:s}=e,o={type:e,numArgs:i.numArgs,argTypes:i.argTypes,allowedInArgument:!!i.allowedInArgument,allowedInText:!!i.allowedInText,allowedInMath:void 0===i.allowedInMath||i.allowedInMath,numOptionalArgs:i.numOptionalArgs||0,infix:!!i.infix,primitive:!!i.primitive,handler:n};for(let e=0;e<t.length;++e)Qe[t[e]]=o;e&&(r&&(Je[e]=r),s)&&(Ze[e]=s)}function et(e){var{type:e,htmlBuilder:t,mathmlBuilder:i}=e;w({type:e,names:[],props:{numArgs:0},handler(){throw new Error("Should never be called.")},htmlBuilder:t,mathmlBuilder:i})}function tt(e){return"ordgroup"===e.type&&1===e.body.length?e.body[0]:e}function x(e){return"ordgroup"===e.type?e.body:[e]}function $(t,i,e,r){void 0===r&&(r=[null,null]);var s=[];for(let e=0;e<t.length;e++){const r=L(t[e],i);if(r instanceof ie){const t=r.children;s.push(...t)}else s.push(r)}if(R.tryCombineChars(s),e){let n=i;if(1===t.length){const e=t[0];"sizing"===e.type?n=i.havingSize(e.size):"styling"===e.type&&(n=i.havingStyle(ot[e.style]))}var o=nt([r[0]||"leftmost"],[],i),r=nt([r[1]||"rightmost"],[],i),e="root"===e;lt(s,(e,t)=>{var i=t.classes[0],n=e.classes[0];"mbin"===i&&C.contains(st,n)?t.classes[0]="mord":"mbin"===n&&C.contains(rt,i)&&(e.classes[0]="mord")},{node:o},r,e),lt(s,(e,t)=>{var t=dt(t),i=dt(e),e=t&&i?(e.hasClass("mtight")?Ye:Xe)[t][i]:null;if(e)return R.makeGlue(e,n)},{node:o},r,e)}return s}function it(e,t){return e=["nulldelimiter"].concat(e.baseSizingClasses()),nt(t.concat(e))}const nt=R.makeSpan,rt=["leftmost","mbin","mopen","mrel","mop","mpunct"],st=["rightmost","mrel","mclose","mpunct"],ot={display:T.DISPLAY,text:T.TEXT,script:T.SCRIPT,scriptscript:T.SCRIPTSCRIPT},at={mord:"mord",mop:"mop",mbin:"mbin",mrel:"mrel",mopen:"mopen",mclose:"mclose",mpunct:"mpunct",minner:"minner"},lt=function(i,e,t,n,r){n&&i.push(n);let s=0;for(;s<i.length;s++){const n=i[s],a=ht(n);if(a)lt(a.children,e,t,null,r);else{var o=!n.hasClass("mspace");if(o){const r=e(n,t.node);r&&(t.insertAfter?t.insertAfter(r):(i.unshift(r),s++))}o?t.node=n:r&&n.hasClass("newline")&&(t.node=nt(["leftmost"])),t.insertAfter=(t=>e=>{i.splice(t+1,0,e),s++})(s)}}n&&i.pop()},ht=function(e){return e instanceof ie||e instanceof xe||e instanceof we&&e.hasClass("enclosing")?e:null},ct=function(e,t){var i=ht(e);if(i){const e=i.children;if(e.length){if("right"===t)return ct(e[e.length-1],"right");if("left"===t)return ct(e[0],"left")}}return e},dt=function(e,t){return e&&(t&&(e=ct(e,t)),at[e.classes[0]])||null},L=function(t,i,n){if(!t)return nt();if(Je[t.type]){let e=Je[t.type](t,i);if(n&&i.size!==n.size){e=nt(i.sizingClasses(n),[e],i);const t=i.sizeMultiplier/n.sizeMultiplier;e.height*=t,e.depth*=t}return e}throw new _("Got group of unknown type: '"+t.type+"'")};function ut(e,t){e=nt(["base"],e,t),t=nt(["strut"]);return t.style.height=M(e.height+e.depth),e.depth&&(t.style.verticalAlign=M(-e.depth)),e.children.unshift(t),e}function pt(e,i){let t=null;1===e.length&&"tag"===e[0].type&&(t=e[0].tag,e=e[0].body);var n=$(e,i,"root");let r;2===n.length&&n[1].hasClass("tag")&&(r=n.pop());var s=[];let o,a=[];for(let t=0;t<n.length;t++)if(a.push(n[t]),n[t].hasClass("mbin")||n[t].hasClass("mrel")||n[t].hasClass("allowbreak")){let e=!1;for(;t<n.length-1&&n[t+1].hasClass("mspace")&&!n[t+1].hasClass("newline");)t++,a.push(n[t]),n[t].hasClass("nobreak")&&(e=!0);e||(s.push(ut(a,i)),a=[])}else n[t].hasClass("newline")&&(a.pop(),0<a.length&&(s.push(ut(a,i)),a=[]),s.push(n[t]));0<a.length&&s.push(ut(a,i)),t?((o=ut($(t,i,!0))).classes=["tag"],s.push(o)):r&&s.push(r);var l=nt(["katex-html"],s);if(l.setAttribute("aria-hidden","true"),o){const e=o.children[0];e.style.height=M(l.height+l.depth),l.depth&&(e.style.verticalAlign=M(-l.depth))}return l}function mt(e){return new ie(e)}class S{constructor(e,t,i){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=e,this.attributes={},this.children=t||[],this.classes=i||[]}setAttribute(e,t){this.attributes[e]=t}getAttribute(e){return this.attributes[e]}toNode(){var t=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(const e in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,e)&&t.setAttribute(e,this.attributes[e]);0<this.classes.length&&(t.className=me(this.classes));for(let e=0;e<this.children.length;e++)t.appendChild(this.children[e].toNode());return t}toMarkup(){let t="<"+this.type;for(const e in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,e)&&(t+=" "+e+'="',t+=C.escape(this.attributes[e]),t+='"');0<this.classes.length&&(t+=' class ="'+C.escape(me(this.classes))+'"'),t+=">";for(let e=0;e<this.children.length;e++)t+=this.children[e].toMarkup();return t+="</"+this.type+">"}toText(){return this.children.map(e=>e.toText()).join("")}}class gt{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return C.escape(this.toText())}toText(){return this.text}}var A={MathNode:S,TextNode:gt,SpaceNode:class{constructor(e){this.width=void 0,this.character=void 0,this.width=e,this.character=.05555<=e&&e<=.05556?"":.1666<=e&&e<=.1667?"":.2222<=e&&e<=.2223?"":.2777<=e&&e<=.2778?"":-.05556<=e&&e<=-.05555?"":-.1667<=e&&e<=-.1666?"":-.2223<=e&&e<=-.2222?"":-.2778<=e&&e<=-.2777?"":null}toNode(){var e;return this.character?document.createTextNode(this.character):((e=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace")).setAttribute("width",M(this.width)),e)}toMarkup(){return this.character?"<mtext>"+this.character+"</mtext>":'<mspace width="'+M(this.width)+'"/>'}toText(){return this.character||" "}},newDocumentFragment:mt};function ft(e,t,i){return!d[t][e]||!d[t][e].replace||55349===e.charCodeAt(0)||Ie.hasOwnProperty(e)&&i&&(i.fontFamily&&"tt"===i.fontFamily.slice(4,6)||i.font&&"tt"===i.font.slice(4,6))||(e=d[t][e].replace),new A.TextNode(e)}function vt(e){return 1===e.length?e[0]:new A.MathNode("mrow",e)}function yt(e,t){if("texttt"===t.fontFamily)return"monospace";if("textsf"===t.fontFamily)return"textit"===t.fontShape&&"textbf"===t.fontWeight?"sans-serif-bold-italic":"textit"===t.fontShape?"sans-serif-italic":"textbf"===t.fontWeight?"bold-sans-serif":"sans-serif";if("textit"===t.fontShape&&"textbf"===t.fontWeight)return"bold-italic";if("textit"===t.fontShape)return"italic";if("textbf"===t.fontWeight)return"bold";if(!(t=t.font)||"mathnormal"===t)return null;var i=e.mode;if("mathit"===t)return"italic";if("boldsymbol"===t)return"textord"===e.type?"bold":"bold-italic";if("mathbf"===t)return"bold";if("mathbb"===t)return"double-struck";if("mathfrak"===t)return"fraktur";if("mathscr"===t||"mathcal"===t)return"script";if("mathsf"===t)return"sans-serif";if("mathtt"===t)return"monospace";let n=e.text;return!C.contains(["\\imath","\\jmath"],n)&&oe(n=d[i][n]&&d[i][n].replace?d[i][n].replace:n,R.fontMap[t].fontName,i)?R.fontMap[t].variant:null}function k(t,i,e){if(1===t.length){const n=I(t[0],i);return e&&n instanceof S&&"mo"===n.type&&(n.setAttribute("lspace","0em"),n.setAttribute("rspace","0em")),[n]}const n=[];let r;for(let e=0;e<t.length;e++){var s=I(t[e],i);if(s instanceof S&&r instanceof S){if("mtext"===s.type&&"mtext"===r.type&&s.getAttribute("mathvariant")===r.getAttribute("mathvariant")){r.children.push(...s.children);continue}if("mn"===s.type&&"mn"===r.type){r.children.push(...s.children);continue}if("mi"===s.type&&1===s.children.length&&"mn"===r.type){const t=s.children[0];if(t instanceof gt&&"."===t.text){r.children.push(...s.children);continue}}else if("mi"===r.type&&1===r.children.length){const t=r.children[0];if(t instanceof gt&&"̸"===t.text&&("mo"===s.type||"mi"===s.type||"mn"===s.type)){const t=s.children[0];t instanceof gt&&0<t.text.length&&(t.text=t.text.slice(0,1)+"̸"+t.text.slice(1),n.pop())}}}n.push(s),r=s}return n}function bt(e,t,i){return vt(k(e,t,i))}const I=function(e,t){if(!e)return new A.MathNode("mrow");if(Ze[e.type])return Ze[e.type](e,t);throw new _("Got group of unknown type: '"+e.type+"'")};function wt(e,t,i,n,r){e=k(e,i),i=1===e.length&&e[0]instanceof S&&C.contains(["mrow","mtable"],e[0].type)?e[0]:new A.MathNode("mrow",e),e=new A.MathNode("annotation",[new A.TextNode(t)]),e.setAttribute("encoding","application/x-tex"),t=new A.MathNode("semantics",[i,e]),i=new A.MathNode("math",[t]),i.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),n&&i.setAttribute("display","block"),e=r?"katex":"katex-mathml";return R.makeSpan([e],[i])}const xt=function(e){return new ue({style:e.displayMode?T.DISPLAY:T.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})},St=function(e,t){var i;return t.displayMode&&(i=["katex-display"],t.leqno&&i.push("leqno"),t.fleqn&&i.push("fleqn"),e=R.makeSpan(i,[e])),e},At={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",overgroup:"⏠",undergroup:"⏡",overleftrightarrow:"↔",underleftrightarrow:"↔",xleftrightarrow:"↔",Overrightarrow:"⇒",xRightarrow:"⇒",overleftharpoon:"↼",xleftharpoonup:"↼",overrightharpoon:"⇀",xrightharpoonup:"⇀",xLeftarrow:"⇐",xLeftrightarrow:"⇔",xhookleftarrow:"↩",xhookrightarrow:"↪",xmapsto:"↦",xrightharpoondown:"⇁",xleftharpoondown:"↽",xrightleftharpoons:"⇌",xleftrightharpoons:"⇋",xtwoheadleftarrow:"↞",xtwoheadrightarrow:"↠",xlongequal:"=",xtofrom:"⇄",xrightleftarrows:"⇄",xrightequilibrium:"⇌",xleftequilibrium:"⇋","\\cdrightarrow":"→","\\cdleftarrow":"←","\\cdlongequal":"="},kt={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]};function _t(e){return(e=new A.MathNode("mo",[new A.TextNode(At[e.replace(/^\\/,"")])])).setAttribute("stretchy","true"),e}function Ct(u,p){var{span:e,minWidth:t,height:i}=function(){let n=4e5;var r=u.label.slice(1);if(C.contains(["widehat","widecheck","widetilde","utilde"],r)){var s="ordgroup"===(s=u.base).type?s.body.length:1;let e,t,i;if(5<s)t="widehat"===r||"widecheck"===r?(e=420,n=2364,i=.42,r+"4"):(e=312,n=2340,i=.34,"tilde4");else{const u=[1,1,2,2,3,3][s];t="widehat"===r||"widecheck"===r?(n=[0,1062,2364,2364,2364][u],e=[0,239,300,360,420][u],i=[0,.24,.3,.3,.36,.42][u],r+u):(n=[0,600,1033,2339,2340][u],e=[0,260,286,306,312][u],i=[0,.26,.286,.3,.306,.34][u],"tilde"+u)}s=new _e(t),s=new ke([s],{width:"100%",height:M(i),viewBox:"0 0 "+n+" "+e,preserveAspectRatio:"none"});return{span:R.makeSvgSpan([],[s],p),minWidth:0,height:i}}{const u=[],s=kt[r],[o,a,l]=s,C=l/1e3,h=o.length;let t,i;if(1===h)t=["hide-tail"],i=[s[3]];else if(2===h)t=["halfarrow-left","halfarrow-right"],i=["xMinYMin","xMaxYMin"];else{if(3!==h)throw new Error("Correct katexImagesData or update code here to support\n "+h+" children.");t=["brace-left","brace-center","brace-right"],i=["xMinYMin","xMidYMin","xMaxYMin"]}for(let e=0;e<h;e++){const s=new _e(o[e]),c=new ke([s],{width:"400em",height:M(C),viewBox:"0 0 "+n+" "+l,preserveAspectRatio:i[e]+" slice"}),d=R.makeSvgSpan([t[e]],[c],p);if(1===h)return{span:d,minWidth:a,height:C};d.style.height=M(C),u.push(d)}return{span:R.makeSpan(["stretchy"],u,p),minWidth:a,height:C}}}();return e.height=i,e.style.height=M(i),0<t&&(e.style.minWidth=M(t)),e}function F(e,t){if(e&&e.type===t)return e;throw new Error("Expected node of type "+t+", but got "+(e?"node of type "+e.type:String(e)))}function Tt(e){var t=Et(e);if(t)return t;throw new Error("Expected node of symbol group type, but got "+(e?"node of type "+e.type:String(e)))}function Et(e){return e&&("atom"===e.type||Me.hasOwnProperty(e.type))?e:null}const Mt=(n,r)=>{let e,s,o;n&&"supsub"===n.type?(s=F(n.base,"accent"),e=s.base,n.base=e,o=function(e){if(e instanceof we)return e;throw new Error("Expected span<HtmlDomNode> but got "+String(e)+".")}(L(n,r)),n.base=s):(s=F(n,"accent"),e=s.base);n=L(e,r.havingCrampedStyle());let a=0;if(s.isShifty&&C.isCharacterBox(e)){const n=C.getBaseElem(e);a=Te(L(n,r.havingCrampedStyle())).skew}var l="\\c"===s.label;let h,c=l?n.height+n.depth:Math.min(n.height,r.fontMetrics().xHeight);if(s.isStretchy)h=Ct(s,r),h=R.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n},{type:"elem",elem:h,wrapperClasses:["svg-align"],wrapperStyle:0<a?{width:"calc(100% - "+M(2*a)+")",marginLeft:M(2*a)}:void 0}]},r);else{let e,t;"\\vec"===s.label?(e=R.staticSvg("vec",r),t=R.svgData.vec[1]):((e=Te(e=R.makeOrd({mode:s.mode,text:s.label},r,"textord"))).italic=0,t=e.width,l&&(c+=e.depth)),h=R.makeSpan(["accent-body"],[e]);const o="\\textcircled"===s.label;o&&(h.classes.push("accent-full"),c=n.height);let i=a;o||(i-=t/2),h.style.left=M(i),"\\textcircled"===s.label&&(h.style.top=".2em"),h=R.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n},{type:"kern",size:-c},{type:"elem",elem:h}]},r)}l=R.makeSpan(["mord","accent"],[h],r);return o?(o.children[0]=l,o.height=Math.max(l.height,o.height),o.classes[0]="mord",o):l},Rt=(e,t)=>{var i=e.isStretchy?_t(e.label):new A.MathNode("mo",[ft(e.label,e.mode)]),e=new A.MathNode("mover",[I(e.base,t),i]);return e.setAttribute("accent","true"),e},$t=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(e=>"\\"+e).join("|")),Lt=(w({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(e,t)=>{var t=tt(t[0]),i=!$t.test(e.funcName),n=!i||"\\widehat"===e.funcName||"\\widetilde"===e.funcName||"\\widecheck"===e.funcName;return{type:"accent",mode:e.parser.mode,label:e.funcName,isStretchy:i,isShifty:n,base:t}},htmlBuilder:Mt,mathmlBuilder:Rt}),w({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(e,t)=>{t=t[0];let i=e.parser.mode;return"math"===i&&(e.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+e.funcName+" works only in text mode"),i="text"),{type:"accent",mode:i,label:e.funcName,isStretchy:!1,isShifty:!0,base:t}},htmlBuilder:Mt,mathmlBuilder:Rt}),w({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(e,t)=>{var{parser:e,funcName:i}=e,t=t[0];return{type:"accentUnder",mode:e.mode,label:i,base:t}},htmlBuilder:(e,t)=>{var i=L(e.base,t),n=Ct(e,t),e="\\utilde"===e.label?.12:0,n=R.makeVList({positionType:"top",positionData:i.height,children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:e},{type:"elem",elem:i}]},t);return R.makeSpan(["mord","accentunder"],[n],t)},mathmlBuilder:(e,t)=>{var i=_t(e.label),e=new A.MathNode("munder",[I(e.base,t),i]);return e.setAttribute("accentunder","true"),e}}),e=>{e=new A.MathNode("mpadded",e?[e]:[]);return e.setAttribute("width","+0.6em"),e.setAttribute("lspace","0.3em"),e}),It=(w({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler(e,t,i){var{parser:e,funcName:n}=e;return{type:"xArrow",mode:e.mode,label:n,body:t[0],below:i[0]}},htmlBuilder(e,t){var i=t.style,n=t.havingStyle(i.sup()),r=R.wrapFragment(L(e.body,n,t),t),s="\\x"===e.label.slice(0,2)?"x":"cd";let o;r.classes.push(s+"-arrow-pad"),e.below&&(n=t.havingStyle(i.sub()),(o=R.wrapFragment(L(e.below,n,t),t)).classes.push(s+"-arrow-pad"));i=Ct(e,t),n=-t.fontMetrics().axisHeight+.5*i.height;let a,l=-t.fontMetrics().axisHeight-.5*i.height-.111;if((.25<r.depth||"\\xleftequilibrium"===e.label)&&(l-=r.depth),o){const e=-t.fontMetrics().axisHeight+o.height+.5*i.height+.111;a=R.makeVList({positionType:"individualShift",children:[{type:"elem",elem:r,shift:l},{type:"elem",elem:i,shift:n},{type:"elem",elem:o,shift:e}]},t)}else a=R.makeVList({positionType:"individualShift",children:[{type:"elem",elem:r,shift:l},{type:"elem",elem:i,shift:n}]},t);return a.children[0].children[0].children[1].classes.push("svg-align"),R.makeSpan(["mrel","x-arrow"],[a],t)},mathmlBuilder(e,t){var i,n,r=_t(e.label);let s;return r.setAttribute("minsize","x"===e.label.charAt(0)?"1.75em":"3.0em"),s=e.body?(i=Lt(I(e.body,t)),e.below?(n=Lt(I(e.below,t)),new A.MathNode("munderover",[r,n,i])):new A.MathNode("mover",[r,i])):e.below?(n=Lt(I(e.below,t)),new A.MathNode("munder",[r,n])):(s=Lt(),new A.MathNode("mover",[r,s]))}}),R.makeSpan);function Ft(e,t){var i=$(e.body,t,!0);return It([e.mclass],i,t)}function Pt(e,t){let i;t=k(e.body,t);return"minner"===e.mclass?i=new A.MathNode("mpadded",t):"mord"===e.mclass?e.isCharacterBox?(i=t[0]).type="mi":i=new A.MathNode("mi",t):(e.isCharacterBox?(i=t[0]).type="mo":i=new A.MathNode("mo",t),"mbin"===e.mclass?(i.attributes.lspace="0.22em",i.attributes.rspace="0.22em"):"mpunct"===e.mclass?(i.attributes.lspace="0em",i.attributes.rspace="0.17em"):"mopen"===e.mclass||"mclose"===e.mclass?(i.attributes.lspace="0em",i.attributes.rspace="0em"):"minner"===e.mclass&&(i.attributes.lspace="0.0556em",i.attributes.width="+0.1111em")),i}w({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(e,t){var{parser:e,funcName:i}=e,t=t[0];return{type:"mclass",mode:e.mode,mclass:"m"+i.slice(5),body:x(t),isCharacterBox:C.isCharacterBox(t)}},htmlBuilder:Ft,mathmlBuilder:Pt});const Dt=e=>{e="ordgroup"===e.type&&e.body.length?e.body[0]:e;return"atom"!==e.type||"bin"!==e.family&&"rel"!==e.family?"mord":"m"+e.family},Ot=(w({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(e,t){e=e.parser;return{type:"mclass",mode:e.mode,mclass:Dt(t[0]),body:x(t[1]),isCharacterBox:C.isCharacterBox(t[1])}}}),w({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(e,t){var{parser:e,funcName:i}=e,n=t[1],t=t[0],r="\\stackrel"!==i?Dt(n):"mrel",n={type:"op",mode:n.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:"\\stackrel"!==i,body:x(n)},n={type:"supsub",mode:t.mode,base:n,sup:"\\underset"===i?null:t,sub:"\\underset"===i?t:null};return{type:"mclass",mode:e.mode,mclass:r,body:[n],isCharacterBox:C.isCharacterBox(n)}},htmlBuilder:Ft,mathmlBuilder:Pt}),w({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(e,t){e=e.parser;return{type:"pmb",mode:e.mode,mclass:Dt(t[0]),body:x(t[0])}},htmlBuilder(e,t){var i=$(e.body,t,!0),e=R.makeSpan([e.mclass],i,t);return e.style.textShadow="0.02em 0.01em 0.04px",e},mathmlBuilder(e,t){e=k(e.body,t),t=new A.MathNode("mstyle",e);return t.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),t}}),{">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"}),Nt=e=>"textord"===e.type&&"@"===e.text;w({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(e,t){var{parser:e,funcName:i}=e;return{type:"cdlabel",mode:e.mode,side:i.slice(4),label:t[0]}},htmlBuilder(e,t){var i=t.havingStyle(t.style.sup()),i=R.wrapFragment(L(e.label,i,t),t);return i.classes.push("cd-label-"+e.side),i.style.bottom=M(.8-i.depth),i.height=0,i.depth=0,i},mathmlBuilder(e,t){let i=new A.MathNode("mrow",[I(e.label,t)]);return(i=new A.MathNode("mpadded",[i])).setAttribute("width","0"),"left"===e.side&&i.setAttribute("lspace","-1width"),i.setAttribute("voffset","0.7em"),(i=new A.MathNode("mstyle",[i])).setAttribute("displaystyle","false"),i.setAttribute("scriptlevel","1"),i}}),w({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(e,t){e=e.parser;return{type:"cdlabelparent",mode:e.mode,fragment:t[0]}},htmlBuilder(e,t){e=R.wrapFragment(L(e.fragment,t),t);return e.classes.push("cd-vert-arrow"),e},mathmlBuilder(e,t){return new A.MathNode("mrow",[I(e.fragment,t)])}}),w({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(e,t){var e=e["parser"],i=F(t[0],"ordgroup").body;let n="";for(let e=0;e<i.length;e++)n+=F(i[e],"textord").text;let r,s=parseInt(n);if(isNaN(s))throw new _("\\@char has non-numeric argument "+n);if(s<0||1114111<=s)throw new _("\\@char with invalid code point "+n);return r=s<=65535?String.fromCharCode(s):(s-=65536,String.fromCharCode(55296+(s>>10),56320+(1023&s))),{type:"textord",mode:e.mode,text:r}}});g=(e,t)=>{t=$(e.body,t.withColor(e.color),!1);return R.makeFragment(t)},Le=(e,t)=>{t=k(e.body,t.withColor(e.color)),t=new A.MathNode("mstyle",t);return t.setAttribute("mathcolor",e.color),t};w({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(e,t){var e=e["parser"],i=F(t[0],"color-token").color,t=t[1];return{type:"color",mode:e.mode,color:i,body:x(t)}},htmlBuilder:g,mathmlBuilder:Le}),w({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(e,t){var{parser:e,breakOnTokenText:i}=e,t=F(t[0],"color-token").color,i=(e.gullet.macros.set("\\current@color",t),e.parseExpression(!0,i));return{type:"color",mode:e.mode,color:t,body:i}},htmlBuilder:g,mathmlBuilder:Le}),w({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(e,t,i){var e=e["parser"],n="["===e.gullet.future().text?e.parseSizeGroup(!0):null,r=!e.settings.displayMode||!e.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:e.mode,newLine:r,size:n&&F(n,"size").value}},htmlBuilder(e,t){var i=R.makeSpan(["mspace"],[],t);return e.newLine&&(i.classes.push("newline"),e.size)&&(i.style.marginTop=M(E(e.size,t))),i},mathmlBuilder(e,t){var i=new A.MathNode("mspace");return e.newLine&&(i.setAttribute("linebreak","newline"),e.size)&&i.setAttribute("height",M(E(e.size,t))),i}});function Bt(e,t,i){if(i=oe(d.math[e]&&d.math[e].replace||e,t,i))return i;throw new Error("Unsupported symbol "+e+" and font size "+t+".")}function zt(e,t,i,n){return t=i.havingBaseStyle(t),n=R.makeSpan(n.concat(t.sizingClasses(i)),[e],i),e=t.sizeMultiplier/i.sizeMultiplier,n.height*=e,n.depth*=e,n.maxFontSize=t.sizeMultiplier,n}function Ht(e,t,i){i=t.havingBaseStyle(i),i=(1-t.sizeMultiplier/i.sizeMultiplier)*t.fontMetrics().axisHeight,e.classes.push("delimcenter"),e.style.top=M(i),e.height-=i,e.depth+=i}function Ut(e,t,i,n,r,s){return e=R.makeSymbol(e,"Size"+t+"-Regular",r,n),r=zt(R.makeSpan(["delimsizing","size"+t],[e],n),T.TEXT,n,s),i&&Ht(r,n,T.TEXT),r}function Wt(e,t,i){return{type:"elem",elem:R.makeSpan(["delimsizinginner","Size1-Regular"===t?"delim-size1":"delim-size4"],[R.makeSpan([],[R.makeSymbol(e,t,i)])])}}function qt(e,t,i){var n=(ne["Size4-Regular"][e.charCodeAt(0)]?ne["Size4-Regular"]:ne["Size1-Regular"])[e.charCodeAt(0)][4],e=new _e("inner",function(e,t){switch(e){case"⎜":return"M291 0 H417 V"+t+" H291z M291 0 H417 V"+t+" H291z";case"":return"M145 0 H188 V"+t+" H145z M145 0 H188 V"+t+" H145z";case"∥":return"M145 0 H188 V"+t+" H145z M145 0 H188 V"+t+" H145zM367 0 H410 V"+t+" H367z M367 0 H410 V"+t+" H367z";case"⎟":return"M457 0 H583 V"+t+" H457z M457 0 H583 V"+t+" H457z";case"⎢":return"M319 0 H403 V"+t+" H319z M319 0 H403 V"+t+" H319z";case"⎥":return"M263 0 H347 V"+t+" H263z M263 0 H347 V"+t+" H263z";case"⎪":return"M384 0 H504 V"+t+" H384z M384 0 H504 V"+t+" H384z";case"⏐":return"M312 0 H355 V"+t+" H312z M312 0 H355 V"+t+" H312z";case"‖":return"M257 0 H300 V"+t+" H257z M257 0 H300 V"+t+" H257zM478 0 H521 V"+t+" H478z M478 0 H521 V"+t+" H478z";default:return""}}(e,Math.round(1e3*t))),e=new ke([e],{width:M(n),height:M(t),style:"width:"+M(n),viewBox:"0 0 "+1e3*n+" "+Math.round(1e3*t),preserveAspectRatio:"xMinYMin"});return(e=R.makeSvgSpan([],[e],i)).height=t,e.style.height=M(t),e.style.width=M(n),{type:"elem",elem:e}}function Vt(e,t,i,n,r,s){let o,a,l,h,c="",d=0,u=(o=l=h=e,a=null,"Size1-Regular");"\\uparrow"===e?l=h="⏐":"\\Uparrow"===e?l=h="‖":"\\downarrow"===e?o=l="⏐":"\\Downarrow"===e?o=l="‖":"\\updownarrow"===e?(o="\\uparrow",l="⏐",h="\\downarrow"):"\\Updownarrow"===e?(o="\\Uparrow",l="‖",h="\\Downarrow"):C.contains(Zt,e)?(l="",c="vert",d=333):C.contains(ei,e)?(l="∥",c="doublevert",d=556):"["===e||"\\lbrack"===e?(o="⎡",l="⎢",h="⎣",u="Size4-Regular",c="lbrack",d=667):"]"===e||"\\rbrack"===e?(o="⎤",l="⎥",h="⎦",u="Size4-Regular",c="rbrack",d=667):"\\lfloor"===e||"⌊"===e?(l=o="⎢",h="⎣",u="Size4-Regular",c="lfloor",d=667):"\\lceil"===e||"⌈"===e?(o="⎡",l=h="⎢",u="Size4-Regular",c="lceil",d=667):"\\rfloor"===e||"⌋"===e?(l=o="⎥",h="⎦",u="Size4-Regular",c="rfloor",d=667):"\\rceil"===e||"⌉"===e?(o="⎤",l=h="⎥",u="Size4-Regular",c="rceil",d=667):"("===e||"\\lparen"===e?(o="⎛",l="⎜",h="⎝",u="Size4-Regular",c="lparen",d=875):")"===e||"\\rparen"===e?(o="⎞",l="⎟",h="⎠",u="Size4-Regular",c="rparen",d=875):"\\{"===e||"\\lbrace"===e?(o="⎧",a="⎨",h="⎩",l="⎪",u="Size4-Regular"):"\\}"===e||"\\rbrace"===e?(o="⎫",a="⎬",h="⎭",l="⎪",u="Size4-Regular"):"\\lgroup"===e||"⟮"===e?(o="⎧",h="⎩",l="⎪",u="Size4-Regular"):"\\rgroup"===e||"⟯"===e?(o="⎫",h="⎭",l="⎪",u="Size4-Regular"):"\\lmoustache"===e||"⎰"===e?(o="⎧",h="⎭",l="⎪",u="Size4-Regular"):"\\rmoustache"!==e&&"⎱"!==e||(o="⎫",h="⎩",l="⎪",u="Size4-Regular");var e=Bt(o,u,r),p=e.height+e.depth,e=Bt(l,u,r),e=e.height+e.depth,m=(m=Bt(h,u,r)).height+m.depth;let g=0,f=1;if(null!==a){const e=Bt(a,u,r);g=e.height+e.depth,f=2}var v=(v=p+m+g)+Math.max(0,Math.ceil((t-v)/(f*e)))*f*e;let y=n.fontMetrics().axisHeight;i&&(y*=n.sizeMultiplier);var t=v/2-y,b=[];if(0<c.length){const e=v-p-m,t=Math.round(1e3*v),i=function(e,t){switch(e){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+t+" v1759 h347 v-84\nH403z M403 1759 V0 H319 V1759 v"+t+" v1759 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+t+" v1759 H0 v84 H347z\nM347 1759 V0 H263 V1759 v"+t+" v1759 h84z";case"vert":return"M145 15 v585 v"+t+" v585 c2.667,10,9.667,15,21,15\nc10,0,16.667,-5,20,-15 v-585 v"+-t+" v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-10,0,-16.667,5,-20,15z M188 15 H145 v585 v"+t+" v585 h43z";case"doublevert":return"M145 15 v585 v"+t+" v585 c2.667,10,9.667,15,21,15\nc10,0,16.667,-5,20,-15 v-585 v"+-t+" v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-10,0,-16.667,5,-20,15z M188 15 H145 v585 v"+t+" v585 h43z\nM367 15 v585 v"+t+" v585 c2.667,10,9.667,15,21,15\nc10,0,16.667,-5,20,-15 v-585 v"+-t+" v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-10,0,-16.667,5,-20,15z M410 15 H367 v585 v"+t+" v585 h43z";case"lfloor":return"M319 602 V0 H403 V602 v"+t+" v1715 h263 v84 H319z\nMM319 602 V0 H403 V602 v"+t+" v1715 H319z";case"rfloor":return"M319 602 V0 H403 V602 v"+t+" v1799 H0 v-84 H319z\nMM319 602 V0 H403 V602 v"+t+" v1715 H319z";case"lceil":return"M403 1759 V84 H666 V0 H319 V1759 v"+t+" v602 h84z\nM403 1759 V0 H319 V1759 v"+t+" v602 h84z";case"rceil":return"M347 1759 V0 H0 V84 H263 V1759 v"+t+" v602 h84z\nM347 1759 V0 h-84 V1759 v"+t+" v602 h84z";case"lparen":return"M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1\nc-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349,\n-36,557 l0,"+(t+84)+"c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210,\n949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9\nc0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5,\n-544.7,-112.5,-882c-2,-104,-3,-167,-3,-189\nl0,-"+(t+92)+"c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3,\n-210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z";case"rparen":return"M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3,\n63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5\nc11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,"+(t+9)+"\nc-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664\nc-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11\nc0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17\nc242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558\nl0,-"+(t+144)+"c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,\n-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z";default:throw new Error("Unknown stretchy delimiter.")}}(c,Math.round(1e3*e)),r=new _e(c,i),s=(d/1e3).toFixed(3)+"em",o=(t/1e3).toFixed(3)+"em",a=new ke([r],{width:s,height:o,viewBox:"0 0 "+d+" "+t}),C=R.makeSvgSpan([],[a],n);C.height=t/1e3,C.style.width=s,C.style.height=o,b.push({type:"elem",elem:C})}else{if(b.push(Wt(h,u,r)),b.push(Jt),null===a){const e=v-p-m+.016;b.push(qt(l,e,n))}else{const e=(v-p-m-g)/2+.016;b.push(qt(l,e,n)),b.push(Jt),b.push(Wt(a,u,r)),b.push(Jt),b.push(qt(l,e,n))}b.push(Jt),b.push(Wt(o,u,r))}return e=n.havingBaseStyle(T.TEXT),i=R.makeVList({positionType:"bottom",positionData:t,children:b},e),zt(R.makeSpan(["delimsizing","mult"],[i],e),T.TEXT,n,s)}function jt(n,e,t,i,r){return i=function(e,t){e*=1e3;let i="";switch(n){case"sqrtMain":i="M95,"+(622+e+80)+"\nc-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14\nc0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54\nc44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10\ns173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429\nc69,-144,104.5,-217.7,106.5,-221\nl"+e/2.075+" -"+e+"\nc5.3,-9.3,12,-14,20,-14\nH400000v"+(40+e)+"H845.2724\ns-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7\nc-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z\nM"+(834+e)+" 80h400000v"+(40+e)+"h-400000z";break;case"sqrtSize1":i="M263,"+(601+e+80)+"c0.7,0,18,39.7,52,119\nc34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120\nc340,-704.7,510.7,-1060.3,512,-1067\nl"+e/2.084+" -"+e+"\nc4.7,-7.3,11,-11,19,-11\nH40000v"+(40+e)+"H1012.3\ns-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232\nc-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1\ns-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26\nc-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z\nM"+(1001+e)+" 80h400000v"+(40+e)+"h-400000z";break;case"sqrtSize2":i="M983 "+(10+e+80)+"\nl"+e/3.13+" -"+e+"\nc4,-6.7,10,-10,18,-10 H400000v"+(40+e)+"\nH1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7\ns-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744\nc-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30\nc26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722\nc56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5\nc53.7,-170.3,84.5,-266.8,92.5,-289.5z\nM"+(1001+e)+" 80h400000v"+(40+e)+"h-400000z";break;case"sqrtSize3":i="M424,"+(2398+e+80)+"\nc-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514\nc0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20\ns-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121\ns209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081\nl"+e/4.223+" -"+e+"c4,-6.7,10,-10,18,-10 H400000\nv"+(40+e)+"H1014.6\ns-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185\nc-2,6,-10,9,-24,9\nc-8,0,-12,-0.7,-12,-2z M"+(1001+e)+" 80\nh400000v"+(40+e)+"h-400000z";break;case"sqrtSize4":i="M473,"+(2713+e+80)+"\nc339.3,-1799.3,509.3,-2700,510,-2702 l"+e/5.298+" -"+e+"\nc3.3,-7.3,9.3,-11,18,-11 H400000v"+(40+e)+"H1017.7\ns-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9\nc-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200\nc0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26\ns76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,\n606zM"+(1001+e)+" 80h400000v"+(40+e)+"H1017.7z";break;case"sqrtTall":i="M702 "+(80+e)+"H400000"+(40+e)+"\nH742v"+(t-54-80-e)+"l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1\nh-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170\nc-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667\n219 661 l218 661zM702 80H400000v"+(40+e)+"H742z"}return i}(i,t),i=new _e(n,i),i=new ke([i],{width:"400em",height:M(e),viewBox:"0 0 400000 "+t,preserveAspectRatio:"xMinYMin slice"}),R.makeSvgSpan(["hide-tail"],[i],r)}function Gt(i,n,r,s){for(let t=Math.min(2,3-s.style.size);t<r.length&&"stack"!==r[t].type;t++){var o=Bt(i,function(e){if("small"===e.type)return"Main-Regular";if("large"===e.type)return"Size"+e.size+"-Regular";if("stack"===e.type)return"Size4-Regular";throw new Error("Add support for delim type '"+e.type+"' here.")}(r[t]),"math");let e=o.height+o.depth;if("small"===r[t].type&&(e*=s.havingBaseStyle(r[t].style).sizeMultiplier),e>n)return r[t]}return r[r.length-1]}function Kt(e,t,i,n,r,s){"<"===e||"\\lt"===e||"⟨"===e?e="\\langle":">"!==e&&"\\gt"!==e&&"⟩"!==e||(e="\\rangle"),d=C.contains(ni,e)?si:C.contains(ti,e)?ai:oi;var o,a,l,h,c,d=Gt(e,t,d,n);return"small"===d.type?(o=e,a=d.style,l=i,h=n,c=s,o=R.makeSymbol(o,"Main-Regular",r,h),o=zt(o,a,h,c),l&&Ht(o,h,a),o):"large"===d.type?Ut(e,d.size,i,n,r,s):Vt(e,t,i,n,r,s)}const Xt={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},Yt=e=>{var t=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(t))throw new _("Expected a control sequence",e);return t},Qt=(e,t,i,n)=>{let r=e.gullet.macros.get(i.text);null==r&&(i.noexpand=!0,r={tokens:[i],numArgs:0,unexpandable:!e.gullet.isExpandable(i.text)}),e.gullet.macros.set(t,r,n)},Jt=(w({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(e){var{parser:e,funcName:t}=e,i=(e.consumeSpaces(),e.fetch());if(Xt[i.text])return"\\global"!==t&&"\\\\globallong"!==t||(i.text=Xt[i.text]),F(e.parseFunction(),"internal");throw new _("Invalid token after macro prefix",i)}}),w({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){let{parser:t,funcName:i}=e,n=t.gullet.popToken();e=n.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(e))throw new _("Expected a control sequence",n);let r,s=0;for(var o=[[]];"{"!==t.gullet.future().text;)if("#"===(n=t.gullet.popToken()).text){if("{"===t.gullet.future().text){r=t.gullet.future(),o[s].push("{");break}if(n=t.gullet.popToken(),!/^[1-9]$/.test(n.text))throw new _('Invalid argument number "'+n.text+'"');if(parseInt(n.text)!==s+1)throw new _('Argument number "'+n.text+'" out of order');s++,o.push([])}else{if("EOF"===n.text)throw new _("Expected a macro definition");o[s].push(n.text)}let a=t.gullet.consumeArg()["tokens"];return r&&a.unshift(r),"\\edef"!==i&&"\\xdef"!==i||(a=t.gullet.expandTokens(a)).reverse(),t.gullet.macros.set(e,{tokens:a,numArgs:s,delimiters:o},i===Xt[i]),{type:"internal",mode:t.mode}}}),w({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:e,funcName:t}=e,i=Yt(e.gullet.popToken()),n=(e.gullet.consumeSpaces(),(e=>{let t=e.gullet.popToken();return t="="===t.text&&" "===(t=e.gullet.popToken()).text?e.gullet.popToken():t})(e));return Qt(e,i,n,"\\\\globallet"===t),{type:"internal",mode:e.mode}}}),w({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:e,funcName:t}=e,i=Yt(e.gullet.popToken()),n=e.gullet.popToken(),r=e.gullet.popToken();return Qt(e,i,r,"\\\\globalfuture"===t),e.gullet.pushToken(r),e.gullet.pushToken(n),{type:"internal",mode:e.mode}}}),{type:"kern",size:-.008}),Zt=["|","\\lvert","\\rvert","\\vert"],ei=["\\|","\\lVert","\\rVert","\\Vert"],ti=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"],ii=["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"],ni=["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],ri=[0,1.2,1.8,2.4,3],si=[{type:"small",style:T.SCRIPTSCRIPT},{type:"small",style:T.SCRIPT},{type:"small",style:T.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],oi=[{type:"small",style:T.SCRIPTSCRIPT},{type:"small",style:T.SCRIPT},{type:"small",style:T.TEXT},{type:"stack"}],ai=[{type:"small",style:T.SCRIPTSCRIPT},{type:"small",style:T.SCRIPT},{type:"small",style:T.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}];var li={sqrtImage:function(e,t){var i=t.havingBaseSizing(),n=Gt("\\surd",e*i.sizeMultiplier,ai,i);let r=i.sizeMultiplier;i=Math.max(0,t.minRuleThickness-t.fontMetrics().sqrtRuleThickness);let s,o,a=0,l=0,h=0;return o="small"===n.type?(h=1e3+1e3*i+80,e<1?r=1:e<1.4&&(r=.7),a=(1+i+.08)/r,l=(1+i)/r,(s=jt("sqrtMain",a,h,i,t)).style.minWidth="0.853em",.833/r):"large"===n.type?(h=1080*ri[n.size],l=(ri[n.size]+i)/r,a=(ri[n.size]+i+.08)/r,(s=jt("sqrtSize"+n.size,a,h,i,t)).style.minWidth="1.02em",1/r):(a=e+i+.08,l=e+i,h=Math.floor(1e3*e+i)+80,(s=jt("sqrtTall",a,h,i,t)).style.minWidth="0.742em",1.056),s.height=l,s.style.height=M(a),{span:s,advanceWidth:o,ruleWidth:(t.fontMetrics().sqrtRuleThickness+i)*r}},sizedDelim:function(e,t,i,n,r){if("<"===e||"\\lt"===e||"⟨"===e?e="\\langle":">"!==e&&"\\gt"!==e&&"⟩"!==e||(e="\\rangle"),C.contains(ti,e)||C.contains(ni,e))return Ut(e,t,!1,i,n,r);if(C.contains(ii,e))return Vt(e,ri[t],!1,i,n,r);throw new _("Illegal delimiter: '"+e+"'")},sizeToMaxHeight:ri,customSizedDelim:Kt,leftRightDelim:function(e,t,i,n,r,s){var o=n.fontMetrics().axisHeight*n.sizeMultiplier,a=5/n.fontMetrics().ptPerEm,t=Math.max(t-o,i+o),i=Math.max(t/500*901,2*t-a);return Kt(e,i,!0,n,r,s)}};const hi={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},ci=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","<",">","\\langle","⟨","\\rangle","⟩","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."];function di(e,t){var i=Et(e);if(i&&C.contains(ci,i.text))return i;throw new _(i?"Invalid delimiter '"+i.text+"' after '"+t.funcName+"'":"Invalid delimiter type '"+e.type+"'",e)}function ui(e){if(!e.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}w({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1,argTypes:["primitive"]},handler:(e,t)=>{t=di(t[0],e);return{type:"delimsizing",mode:e.parser.mode,size:hi[e.funcName].size,mclass:hi[e.funcName].mclass,delim:t.text}},htmlBuilder:(e,t)=>"."===e.delim?R.makeSpan([e.mclass]):li.sizedDelim(e.delim,e.size,t,e.mode,[e.mclass]),mathmlBuilder:e=>{var t=[],t=("."!==e.delim&&t.push(ft(e.delim,e.mode)),new A.MathNode("mo",t)),e=("mopen"===e.mclass||"mclose"===e.mclass?t.setAttribute("fence","true"):t.setAttribute("fence","false"),t.setAttribute("stretchy","true"),M(li.sizeToMaxHeight[e.size]));return t.setAttribute("minsize",e),t.setAttribute("maxsize",e),t}}),w({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var i=e.parser.gullet.macros.get("\\current@color");if(i&&"string"!=typeof i)throw new _("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:e.parser.mode,delim:di(t[0],e).text,color:i}}}),w({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var t=di(t[0],e),e=e.parser,i=(++e.leftrightDepth,e.parseExpression(!1)),n=(--e.leftrightDepth,e.expect("\\right",!1),F(e.parseFunction(),"leftright-right"));return{type:"leftright",mode:e.mode,body:i,left:t.text,right:n.delim,rightColor:n.color}},htmlBuilder:(t,e)=>{ui(t);const i=$(t.body,e,!0,["mopen","mclose"]);let n,r,s=0,o=0,a=!1;for(let e=0;e<i.length;e++)i[e].isMiddle?a=!0:(s=Math.max(i[e].height,s),o=Math.max(i[e].depth,o));if(s*=e.sizeMultiplier,o*=e.sizeMultiplier,n="."===t.left?it(e,["mopen"]):li.leftRightDelim(t.left,s,o,e,t.mode,["mopen"]),i.unshift(n),a)for(let e=1;e<i.length;e++){const n=i[e].isMiddle;n&&(i[e]=li.leftRightDelim(n.delim,s,o,n.options,t.mode,[]))}if("."===t.right)r=it(e,["mclose"]);else{const i=t.rightColor?e.withColor(t.rightColor):e;r=li.leftRightDelim(t.right,s,o,i,t.mode,["mclose"])}return i.push(r),R.makeSpan(["minner"],i,e)},mathmlBuilder:(e,t)=>{ui(e);var i=k(e.body,t);if("."!==e.left){const t=new A.MathNode("mo",[ft(e.left,e.mode)]);t.setAttribute("fence","true"),i.unshift(t)}if("."!==e.right){const t=new A.MathNode("mo",[ft(e.right,e.mode)]);t.setAttribute("fence","true"),e.rightColor&&t.setAttribute("mathcolor",e.rightColor),i.push(t)}return vt(i)}}),w({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{t=di(t[0],e);if(e.parser.leftrightDepth)return{type:"middle",mode:e.parser.mode,delim:t.text};throw new _("\\middle without preceding \\left",t)},htmlBuilder:(e,t)=>{let i;return"."===e.delim?i=it(t,[]):(i=li.sizedDelim(e.delim,1,t,e.mode,[]),e={delim:e.delim,options:t},i.isMiddle=e),i},mathmlBuilder:(e,t)=>{e="\\vert"===e.delim||"|"===e.delim?ft("|","text"):ft(e.delim,e.mode),e=new A.MathNode("mo",[e]);return e.setAttribute("fence","true"),e.setAttribute("lspace","0.05em"),e.setAttribute("rspace","0.05em"),e}});a=(n,r)=>{const s=R.wrapFragment(L(n.body,r),r),o=n.label.slice(1);let a,e=r.sizeMultiplier,l=0;const h=C.isCharacterBox(n.body);if("sout"===o)(a=R.makeSpan(["stretchy","sout"])).height=r.fontMetrics().defaultRuleThickness/e,l=-.5*r.fontMetrics().xHeight;else if("phase"===o){const n=E({number:.6,unit:"pt"},r),o=E({number:.35,unit:"ex"},r),h=(e/=r.havingBaseSizing().sizeMultiplier,s.height+s.depth+n+o),C=(s.style.paddingLeft=M(h/2+n),Math.floor(1e3*h*e)),t="M400000 "+C+" H0 L"+C/2+" 0 l65 45 L145 "+(C-80)+" H400000z",i=new ke([new _e("phase",t)],{width:"400em",height:M(C/1e3),viewBox:"0 0 400000 "+C,preserveAspectRatio:"xMinYMin slice"});(a=R.makeSvgSpan(["hide-tail"],[i],r)).style.height=M(h),l=s.depth+n+o}else{/cancel/.test(o)?h||s.classes.push("cancel-pad"):"angl"===o?s.classes.push("anglpad"):s.classes.push("boxpad");let e=0,t=0,i=0;t=/box/.test(o)?(i=Math.max(r.fontMetrics().fboxrule,r.minRuleThickness),e=r.fontMetrics().fboxsep+("colorbox"===o?0:i)):"angl"===o?(i=Math.max(r.fontMetrics().defaultRuleThickness,r.minRuleThickness),e=4*i,Math.max(0,.25-s.depth)):e=h?.2:0,a=function(e,t,i,n,r){let s;n=e.height+e.depth+i+n;if(/fbox|color|angl/.test(t)){if(s=R.makeSpan(["stretchy",t],[],r),"fbox"===t){const e=r.color&&r.getColor();e&&(s.style.borderColor=e)}}else{const e=[],i=(/^[bx]cancel$/.test(t)&&e.push(new Ce({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(t)&&e.push(new Ce({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"})),new ke(e,{width:"100%",height:M(n)}));s=R.makeSvgSpan([],[i],r)}return s.height=n,s.style.height=M(n),s}(s,o,e,t,r),/fbox|boxed|fcolorbox/.test(o)?(a.style.borderStyle="solid",a.style.borderWidth=M(i)):"angl"===o&&.049!==i&&(a.style.borderTopWidth=M(i),a.style.borderRightWidth=M(i)),l=s.depth+t,n.backgroundColor&&(a.style.backgroundColor=n.backgroundColor,n.borderColor)&&(a.style.borderColor=n.borderColor)}let t;if(n.backgroundColor)t=R.makeVList({positionType:"individualShift",children:[{type:"elem",elem:a,shift:l},{type:"elem",elem:s,shift:0}]},r);else{const n=/cancel|phase/.test(o)?["svg-align"]:[];t=R.makeVList({positionType:"individualShift",children:[{type:"elem",elem:s,shift:0},{type:"elem",elem:a,shift:l,wrapperClasses:n}]},r)}return/cancel/.test(o)&&(t.height=s.height,t.depth=s.depth),/cancel/.test(o)&&!h?R.makeSpan(["mord","cancel-lap"],[t],r):R.makeSpan(["mord"],[t],r)},u=(e,t)=>{let i=0;var n=new A.MathNode(-1<e.label.indexOf("colorbox")?"mpadded":"menclose",[I(e.body,t)]);switch(e.label){case"\\cancel":n.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":n.setAttribute("notation","downdiagonalstrike");break;case"\\phase":n.setAttribute("notation","phasorangle");break;case"\\sout":n.setAttribute("notation","horizontalstrike");break;case"\\fbox":n.setAttribute("notation","box");break;case"\\angl":n.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(i=t.fontMetrics().fboxsep*t.fontMetrics().ptPerEm,n.setAttribute("width","+"+2*i+"pt"),n.setAttribute("height","+"+2*i+"pt"),n.setAttribute("lspace",i+"pt"),n.setAttribute("voffset",i+"pt"),"\\fcolorbox"===e.label){const i=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness);n.setAttribute("style","border: "+i+"em solid "+String(e.borderColor))}break;case"\\xcancel":n.setAttribute("notation","updiagonalstrike downdiagonalstrike")}return e.backgroundColor&&n.setAttribute("mathbackground",e.backgroundColor),n};w({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","text"]},handler(e,t,i){var{parser:e,funcName:n}=e,r=F(t[0],"color-token").color,t=t[1];return{type:"enclose",mode:e.mode,label:n,backgroundColor:r,body:t}},htmlBuilder:a,mathmlBuilder:u}),w({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","text"]},handler(e,t,i){var{parser:e,funcName:n}=e,r=F(t[0],"color-token").color,s=F(t[1],"color-token").color,t=t[2];return{type:"enclose",mode:e.mode,label:n,backgroundColor:s,borderColor:r,body:t}},htmlBuilder:a,mathmlBuilder:u}),w({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(e,t){e=e.parser;return{type:"enclose",mode:e.mode,label:"\\fbox",body:t[0]}}}),w({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\sout","\\phase"],props:{numArgs:1},handler(e,t){var{parser:e,funcName:i}=e,t=t[0];return{type:"enclose",mode:e.mode,label:i,body:t}},htmlBuilder:a,mathmlBuilder:u}),w({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(e,t){e=e.parser;return{type:"enclose",mode:e.mode,label:"\\angl",body:t[0]}}});const pi={};function mi(e){var{type:e,names:t,props:i,handler:n,htmlBuilder:r,mathmlBuilder:s}=e,o={type:e,numArgs:i.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:n};for(let e=0;e<t.length;++e)pi[t[e]]=o;r&&(Je[e]=r),s&&(Ze[e]=s)}const gi={};function P(e,t){gi[e]=t}class fi{constructor(e,t,i){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=e,this.start=t,this.end=i}static range(e,t){return t?e&&e.loc&&t.loc&&e.loc.lexer===t.loc.lexer?new fi(e.loc.lexer,e.loc.start,t.loc.end):null:e&&e.loc}}class vi{constructor(e,t){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=e,this.loc=t}range(e,t){return new vi(t,fi.range(this,e))}}function yi(e){var t=[];e.consumeSpaces();let i=e.fetch().text;for("\\relax"===i&&(e.consume(),e.consumeSpaces(),i=e.fetch().text);"\\hline"===i||"\\hdashline"===i;)e.consume(),t.push("\\hdashline"===i),e.consumeSpaces(),i=e.fetch().text;return t}const bi=e=>{if(!e.parser.settings.displayMode)throw new _("{"+e.envName+"} can be used only in display mode.")};function wi(e){if(-1===e.indexOf("ed"))return-1===e.indexOf("*")}function xi(t,e,i){let{hskipBeforeAndAfter:n,addJot:r,cols:s,arraystretch:o,colSeparationType:a,autoTag:l,singleRow:h,emptySingleRow:c,maxNumCols:d,leqno:u}=e;if(t.gullet.beginGroup(),h||t.gullet.macros.set("\\cr","\\\\\\relax"),!o){const e=t.gullet.expandMacroAsText("\\arraystretch");if(null==e)o=1;else if(!(o=parseFloat(e))||o<0)throw new _("Invalid \\arraystretch: "+e)}t.gullet.beginGroup();let p=[];const m=[p],g=[],f=[],v=null!=l?[]:void 0;function y(){l&&t.gullet.macros.set("\\@eqnsw","1",!0)}function b(){v&&(t.gullet.macros.get("\\df@tag")?(v.push(t.subparse([new vi("\\df@tag")])),t.gullet.macros.set("\\df@tag",void 0,!0)):v.push(Boolean(l)&&"1"===t.gullet.macros.get("\\@eqnsw")))}for(y(),f.push(yi(t));;){let e=t.parseExpression(!1,h?"\\end":"\\\\");t.gullet.endGroup(),t.gullet.beginGroup(),e={type:"ordgroup",mode:t.mode,body:e},i&&(e={type:"styling",mode:t.mode,style:i,body:[e]}),p.push(e);const n=t.fetch().text;if("&"===n){if(d&&p.length===d){if(h||a)throw new _("Too many tab characters: &",t.nextToken);t.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}t.consume()}else{if("\\end"===n){b(),1===p.length&&"styling"===e.type&&0===e.body[0].body.length&&(1<m.length||!c)&&m.pop(),f.length<m.length+1&&f.push([]);break}if("\\\\"!==n)throw new _("Expected & or \\\\ or \\cr or \\end",t.nextToken);{let e;t.consume()," "!==t.gullet.future().text&&(e=t.parseSizeGroup(!0)),g.push(e?e.value:null),b(),f.push(yi(t)),p=[],m.push(p),y()}}}return t.gullet.endGroup(),t.gullet.endGroup(),{type:"array",mode:t.mode,addJot:r,arraystretch:o,body:m,cols:s,rowGaps:g,hskipBeforeAndAfter:n,hLinesBeforeRow:f,colSeparationType:a,tags:v,leqno:u}}function Si(e){return"d"===e.slice(0,1)?"display":"text"}function Ai(n,r){let s,o;const a=n.body.length,l=n.hLinesBeforeRow;let h=0,c=new Array(a);const d=[],u=Math.max(r.fontMetrics().arrayRuleWidth,r.minRuleThickness),e=1/r.fontMetrics().ptPerEm;let p=5*e;n.colSeparationType&&"small"===n.colSeparationType&&(p=r.havingStyle(T.SCRIPT).sizeMultiplier/r.sizeMultiplier*.2778);var t="CD"===n.colSeparationType?E({number:3,unit:"ex"},r):12*e,m=3*e,g=.7*(t=n.arraystretch*t),f=.3*t;let v=0;function y(t){for(let e=0;e<t.length;++e)0<e&&(v+=.25),d.push({pos:v,isDashed:t[e]})}for(y(l[0]),s=0;s<n.body.length;++s){const _=n.body[s];let e=g,t=f;h<_.length&&(h=_.length);const d=new Array(_.length);for(o=0;o<_.length;++o){const n=L(_[o],r);t<n.depth&&(t=n.depth),e<n.height&&(e=n.height),d[o]=n}const u=n.rowGaps[s];let i=0;u&&0<(i=E(u,r))&&(i+=f,t<i&&(t=i),i=0),n.addJot&&(t+=m),d.height=e,d.depth=t,v+=e,d.pos=v,v+=t+i,c[s]=d,y(l[s+1])}var b=v/2+r.fontMetrics().axisHeight,w=n.cols||[],x=[];let S,A;var i=[];if(n.tags&&n.tags.some(e=>e))for(s=0;s<a;++s){const _=c[s],o=_.pos-b,a=n.tags[s];var k=!0===a?R.makeSpan(["eqn-num"],[],r):!1===a?R.makeSpan([],[],r):R.makeSpan([],$(a,r,!0),r);k.depth=_.depth,k.height=_.height,i.push({type:"elem",elem:k,shift:o})}for(o=0,A=0;o<h||A<w.length;++o,++A){let t,i=w[A]||{},e=!0;for(;"separator"===i.type;){if(e||((S=R.makeSpan(["arraycolsep"],[])).style.width=M(r.fontMetrics().doubleRuleSep),x.push(S)),"|"!==i.separator&&":"!==i.separator)throw new _("Invalid separator type: "+i.separator);{const n="|"===i.separator?"solid":"dashed",s=R.makeSpan(["vertical-separator"],[],r),_=(s.style.height=M(v),s.style.borderRightWidth=M(u),s.style.borderRightStyle=n,s.style.margin="0 "+M(-u/2),v-b);_&&(s.style.verticalAlign=M(-_)),x.push(s)}A++,i=w[A]||{},e=!1}if(!(o>=h)){(0<o||n.hskipBeforeAndAfter)&&0!==(t=C.deflt(i.pregap,p))&&((S=R.makeSpan(["arraycolsep"],[])).style.width=M(t),x.push(S));let e=[];for(s=0;s<a;++s){const n=c[s],r=n[o];if(r){const _=n.pos-b;r.depth=n.depth,r.height=n.height,e.push({type:"elem",elem:r,shift:_})}}e=R.makeVList({positionType:"individualShift",children:e},r),e=R.makeSpan(["col-align-"+(i.align||"c")],[e]),x.push(e),(o<h-1||n.hskipBeforeAndAfter)&&0!==(t=C.deflt(i.postgap,p))&&((S=R.makeSpan(["arraycolsep"],[])).style.width=M(t),x.push(S))}}if(c=R.makeSpan(["mtable"],x),0<d.length){const n=R.makeLineSpan("hline",r,u),s=R.makeLineSpan("hdashline",r,u),_=[{type:"elem",elem:c,shift:0}];for(;0<d.length;){const r=d.pop(),o=r.pos-b;r.isDashed?_.push({type:"elem",elem:s,shift:o}):_.push({type:"elem",elem:n,shift:o})}c=R.makeVList({positionType:"individualShift",children:_},r)}return 0===i.length?R.makeSpan(["mord"],[c],r):(t=R.makeVList({positionType:"individualShift",children:i},r),t=R.makeSpan(["tag"],[t],r),R.makeFragment([c,t]))}function ki(s,o){var t=[],i=new A.MathNode("mtd",[],["mtr-glue"]),n=new A.MathNode("mtd",[],["mml-eqn-num"]);for(let e=0;e<s.body.length;e++){const r=s.body[e],a=[];for(let e=0;e<r.length;e++)a.push(new A.MathNode("mtd",[I(r[e],o)]));s.tags&&s.tags[e]&&(a.unshift(i),a.push(i),s.leqno?a.unshift(n):a.push(n)),t.push(new A.MathNode("mtr",a))}let e=new A.MathNode("mtable",t);const r=.5===s.arraystretch?.1:.16+s.arraystretch-1+(s.addJot?.09:0);e.setAttribute("rowspacing",M(r));let a="",l="";if(s.cols&&0<s.cols.length){const o=s.cols;let t="",i=!1,n=0,r=o.length;"separator"===o[0].type&&(a+="top ",n=1),"separator"===o[o.length-1].type&&(a+="bottom ",--r);for(let e=n;e<r;e++)"align"===o[e].type?(l+=Ci[o[e].align],i&&(t+="none "),i=!0):"separator"===o[e].type&&i&&(t+="|"===o[e].separator?"solid ":"dashed ",i=!1);e.setAttribute("columnalign",l.trim()),/[sd]/.test(t)&&e.setAttribute("columnlines",t.trim())}if("align"===s.colSeparationType){const o=s.cols||[];let t="";for(let e=1;e<o.length;e++)t+=e%2?"0em ":"1em ";e.setAttribute("columnspacing",t.trim())}else"alignat"===s.colSeparationType||"gather"===s.colSeparationType?e.setAttribute("columnspacing","0em"):"small"===s.colSeparationType?e.setAttribute("columnspacing","0.2778em"):"CD"===s.colSeparationType?e.setAttribute("columnspacing","0.5em"):e.setAttribute("columnspacing","1em");let h="";var c=s.hLinesBeforeRow;a=(a+=0<c[0].length?"left ":"")+(0<c[c.length-1].length?"right ":"");for(let e=1;e<c.length-1;e++)h+=0===c[e].length?"none ":c[e][0]?"dashed ":"solid ";return/[sd]/.test(h)&&e.setAttribute("rowlines",h.trim()),""!==a&&(e=new A.MathNode("menclose",[e])).setAttribute("notation",a.trim()),s.arraystretch&&s.arraystretch<1&&(e=new A.MathNode("mstyle",[e])).setAttribute("scriptlevel","1"),e}function _i(e,i){-1===e.envName.indexOf("ed")&&bi(e);var n=[],t=-1<e.envName.indexOf("at")?"alignat":"align",r="split"===e.envName,t=xi(e.parser,{cols:n,addJot:!0,autoTag:r?void 0:wi(e.envName),emptySingleRow:!0,colSeparationType:t,maxNumCols:r?2:void 0,leqno:e.parser.settings.leqno},"display");let s,o=0;const a={type:"ordgroup",mode:e.mode,body:[]};if(i[0]&&"ordgroup"===i[0].type){let t="";for(let e=0;e<i[0].body.length;e++)t+=F(i[0].body[e],"textord").text;s=Number(t),o=2*s}const l=!o;t.body.forEach(function(t){for(let e=1;e<t.length;e+=2){var i=F(t[e],"styling");F(i.body[0],"ordgroup").body.unshift(a)}if(l)o<t.length&&(o=t.length);else{var e=t.length/2;if(s<e)throw new _("Too many math in a row: expected "+s+", but got "+e,t[0])}});for(let i=0;i<o;++i){let e="r",t=0;i%2==1?e="l":0<i&&l&&(t=1),n[i]={type:"align",align:e,pregap:t,postgap:0}}return t.colSeparationType=l?"align":"alignat",t}const Ci={c:"center ",l:"left ",r:"right "};mi({type:"array",names:["array","darray"],props:{numArgs:1},handler(e,t){t=(Et(t[0])?[t[0]]:F(t[0],"ordgroup").body).map(function(e){var t=Tt(e).text;if(-1!=="lcr".indexOf(t))return{type:"align",align:t};if("|"===t)return{type:"separator",separator:"|"};if(":"===t)return{type:"separator",separator:":"};throw new _("Unknown column alignment: "+t,e)}),t={cols:t,hskipBeforeAndAfter:!0,maxNumCols:t.length};return xi(e.parser,t,Si(e.envName))},htmlBuilder:Ai,mathmlBuilder:ki}),mi({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(e){const t={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[e.envName.replace("*","")];let i="c";var n={hskipBeforeAndAfter:!1,cols:[{type:"align",align:i}]};if("*"===e.envName.charAt(e.envName.length-1)){const t=e.parser;if(t.consumeSpaces(),"["===t.fetch().text){if(t.consume(),t.consumeSpaces(),i=t.fetch().text,-1==="lcr".indexOf(i))throw new _("Expected l or c or r",t.nextToken);t.consume(),t.consumeSpaces(),t.expect("]"),t.consume(),n.cols=[{type:"align",align:i}]}}var n=xi(e.parser,n,Si(e.envName)),r=Math.max(0,...n.body.map(e=>e.length));return n.cols=new Array(r).fill({type:"align",align:i}),t?{type:"leftright",mode:e.mode,body:[n],left:t[0],right:t[1],rightColor:void 0}:n},htmlBuilder:Ai,mathmlBuilder:ki}),mi({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(e){e=xi(e.parser,{arraystretch:.5},"script");return e.colSeparationType="small",e},htmlBuilder:Ai,mathmlBuilder:ki}),mi({type:"array",names:["subarray"],props:{numArgs:1},handler(e,t){t=(Et(t[0])?[t[0]]:F(t[0],"ordgroup").body).map(function(e){var t=Tt(e).text;if(-1!=="lc".indexOf(t))return{type:"align",align:t};throw new _("Unknown column alignment: "+t,e)});if(1<t.length)throw new _("{subarray} can contain only one column");if(0<(e=xi(e.parser,{cols:t,hskipBeforeAndAfter:!1,arraystretch:.5},"script")).body.length&&1<e.body[0].length)throw new _("{subarray} can contain only one column");return e},htmlBuilder:Ai,mathmlBuilder:ki}),mi({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(e){var t=xi(e.parser,{arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},Si(e.envName));return{type:"leftright",mode:e.mode,body:[t],left:-1<e.envName.indexOf("r")?".":"\\{",right:-1<e.envName.indexOf("r")?"\\}":".",rightColor:void 0}},htmlBuilder:Ai,mathmlBuilder:ki}),mi({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:_i,htmlBuilder:Ai,mathmlBuilder:ki}),mi({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(e){C.contains(["gather","gather*"],e.envName)&&bi(e);var t={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:wi(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return xi(e.parser,t,"display")},htmlBuilder:Ai,mathmlBuilder:ki}),mi({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:_i,htmlBuilder:Ai,mathmlBuilder:ki}),mi({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(e){bi(e);var t={autoTag:wi(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:e.parser.settings.leqno};return xi(e.parser,t,"display")},htmlBuilder:Ai,mathmlBuilder:ki}),mi({type:"array",names:["CD"],props:{numArgs:0},handler(e){bi(e);{var r=e.parser,s,o,n=[];for(r.gullet.beginGroup(),r.gullet.macros.set("\\cr","\\\\\\relax"),r.gullet.beginGroup();;){n.push(r.parseExpression(!1,"\\\\")),r.gullet.endGroup(),r.gullet.beginGroup();const e=r.fetch().text;if("&"!==e&&"\\\\"!==e){if("\\end"!==e)throw new _("Expected \\\\ or \\cr or \\end",r.nextToken);0===n[n.length-1].length&&n.pop();break}r.consume()}let i=[];const h=[i];for(let t=0;t<n.length;t++){var a=n[t];let e={type:"styling",body:[],mode:"math",style:"display"};for(let n=0;n<a.length;n++)if(Nt(a[n])){i.push(e);const h=Tt(a[n+=1]).text,c=new Array(2);if(c[0]={type:"ordgroup",mode:"math",body:[]},c[1]={type:"ordgroup",mode:"math",body:[]},!(-1<"=|.".indexOf(h))){if(!(-1<"<>AV".indexOf(h)))throw new _('Expected one of "<>AV=|." after @',a[n]);for(let i=0;i<2;i++){let t=!0;for(let e=n+1;e<a.length;e++){if(o=h,("mathord"===(s=a[e]).type||"atom"===s.type)&&s.text===o){t=!1,n=e;break}if(Nt(a[e]))throw new _("Missing a "+h+" character to complete a CD arrow.",a[e]);c[i].body.push(a[e])}if(t)throw new _("Missing a "+h+" character to complete a CD arrow.",a[n])}}var l={type:"styling",body:[function(e,t,i){var n=Ot[e];switch(n){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return i.callFunction(n,[t[0]],[t[1]]);case"\\uparrow":case"\\downarrow":{const e={type:"atom",text:n,mode:"math",family:"rel"},r={type:"ordgroup",mode:"math",body:[i.callFunction("\\\\cdleft",[t[0]],[]),i.callFunction("\\Big",[e],[]),i.callFunction("\\\\cdright",[t[1]],[])]};return i.callFunction("\\\\cdparent",[r],[])}case"\\\\cdlongequal":return i.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{const e={type:"textord",text:"\\Vert",mode:"math"};return i.callFunction("\\Big",[e],[])}default:return{type:"textord",text:" ",mode:"math"}}}(h,c,r)],mode:"math",style:"display"};i.push(l),e={type:"styling",body:[],mode:"math",style:"display"}}else e.body.push(a[n]);t%2==0?i.push(e):i.shift(),i=[],h.push(i)}return r.gullet.endGroup(),r.gullet.endGroup(),{type:"array",mode:"math",body:h,arraystretch:1,addJot:!0,rowGaps:[null],cols:new Array(h[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25}),colSeparationType:"CD",hLinesBeforeRow:new Array(h.length+1).fill([])}}},htmlBuilder:Ai,mathmlBuilder:ki}),P("\\nonumber","\\gdef\\@eqnsw{0}"),P("\\notag","\\nonumber"),w({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(e,t){throw new _(e.funcName+" valid only within array environment")}});var Ti=pi;w({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(e,t){let{parser:i,funcName:n}=e;var r=t[0];if("ordgroup"!==r.type)throw new _("Invalid environment name",r);let s="";for(let e=0;e<r.body.length;++e)s+=F(r.body[e],"textord").text;if("\\begin"!==n)return{type:"environment",mode:i.mode,name:s,nameGroup:r};{if(!Ti.hasOwnProperty(s))throw new _("No such environment: "+s,r);const e=Ti[s],{args:t,optArgs:n}=i.parseArguments("\\begin{"+s+"}",e),l={mode:i.mode,envName:s,parser:i},h=e.handler(l,t,n);i.expect("\\end",!1);var o=i.nextToken,a=F(i.parseFunction(),"environment");if(a.name!==s)throw new _("Mismatch: \\begin{"+s+"} matched by \\end{"+a.name+"}",o);return h}}});function Ei(e){let t=null;return t=0<e.length?"."===(t=e)?null:t:t}function Mi(e){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(e))return{number:+e,unit:"bp"};var t=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(e);if(!t)throw new _("Invalid size: '"+e+"' in \\includegraphics");if(e={number:+(t[1]+t[2]),unit:t[3]},pe(e))return e;throw new _("Invalid unit: '"+e.unit+"' in \\includegraphics.")}const Ri=(e,t)=>{var i=e.font,t=t.withFont(i);return L(e.body,t)},$i=(e,t)=>{var i=e.font,t=t.withFont(i);return I(e.body,t)},Li={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak","\\bm":"\\boldsymbol"},Ii=(w({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(e,t)=>{var{parser:e,funcName:i}=e,t=tt(t[0]);let n=i;return n in Li&&(n=Li[n]),{type:"font",mode:e.mode,font:n.slice(1),body:t}},htmlBuilder:Ri,mathmlBuilder:$i}),w({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(e,t)=>{var e=e["parser"],t=t[0],i=C.isCharacterBox(t);return{type:"mclass",mode:e.mode,mclass:Dt(t),body:[{type:"font",mode:e.mode,font:"boldsymbol",body:t}],isCharacterBox:i}}}),w({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{parser:e,funcName:i,breakOnTokenText:n}=e,r=e["mode"],n=e.parseExpression(!0,n);return{type:"font",mode:r,font:"math"+i.slice(1),body:{type:"ordgroup",mode:e.mode,body:n}}},htmlBuilder:Ri,mathmlBuilder:$i}),(e,t)=>{let i=t;return"display"===e?i=i.id>=T.SCRIPT.id?i.text():T.DISPLAY:"text"===e&&i.size===T.DISPLAY.size?i=T.TEXT:"script"===e?i=T.SCRIPT:"scriptscript"===e&&(i=T.SCRIPTSCRIPT),i}),Fi=(e,t)=>{const i=Ii(e.size,t.style),n=i.fracNum(),r=i.fracDen();var s=t.havingStyle(n),o=L(e.numer,s,t);if(e.continued){const e=8.5/t.fontMetrics().ptPerEm,i=3.5/t.fontMetrics().ptPerEm;o.height=o.height<e?e:o.height,o.depth=o.depth<i?i:o.depth}s=t.havingStyle(r);var a=L(e.denom,s,t);let l,h,c,d,u,p,m,g,f,v;if(c=e.hasBarLine?(l=e.barSize?(h=E(e.barSize,t),R.makeLineSpan("frac-line",t,h)):R.makeLineSpan("frac-line",t),h=l.height,l.height):(l=null,h=0,t.fontMetrics().defaultRuleThickness),p=i.size===T.DISPLAY.size||"display"===e.size?(d=t.fontMetrics().num1,u=0<h?3*c:7*c,t.fontMetrics().denom1):(u=0<h?(d=t.fontMetrics().num2,c):(d=t.fontMetrics().num3,3*c),t.fontMetrics().denom2),l){const e=t.fontMetrics().axisHeight,i=(d-o.depth-(e+.5*h)<u&&(d+=u-(d-o.depth-(e+.5*h))),e-.5*h-(a.height-p)<u&&(p+=u-(e-.5*h-(a.height-p))),-(e-.5*h));m=R.makeVList({positionType:"individualShift",children:[{type:"elem",elem:a,shift:p},{type:"elem",elem:l,shift:i},{type:"elem",elem:o,shift:-d}]},t)}else{const e=d-o.depth-(a.height-p);e<u&&(d+=.5*(u-e),p+=.5*(u-e)),m=R.makeVList({positionType:"individualShift",children:[{type:"elem",elem:a,shift:p},{type:"elem",elem:o,shift:-d}]},t)}return s=t.havingStyle(i),m.height*=s.sizeMultiplier/t.sizeMultiplier,m.depth*=s.sizeMultiplier/t.sizeMultiplier,g=i.size===T.DISPLAY.size?t.fontMetrics().delim1:(i.size===T.SCRIPTSCRIPT.size?t.havingStyle(T.SCRIPT):t).fontMetrics().delim2,f=null==e.leftDelim?it(t,["mopen"]):li.customSizedDelim(e.leftDelim,g,!0,t.havingStyle(i),e.mode,["mopen"]),v=e.continued?R.makeSpan([]):null==e.rightDelim?it(t,["mclose"]):li.customSizedDelim(e.rightDelim,g,!0,t.havingStyle(i),e.mode,["mclose"]),R.makeSpan(["mord"].concat(s.sizingClasses(t)),[f,R.makeSpan(["mfrac"],[m]),v],t)},Pi=(e,t)=>{let i=new A.MathNode("mfrac",[I(e.numer,t),I(e.denom,t)]);if(e.hasBarLine){if(e.barSize){const n=E(e.barSize,t);i.setAttribute("linethickness",M(n))}}else i.setAttribute("linethickness","0px");const n=Ii(e.size,t.style);if(n.size!==t.style.size){i=new A.MathNode("mstyle",[i]);const e=n.size===T.DISPLAY.size?"true":"false";i.setAttribute("displaystyle",e),i.setAttribute("scriptlevel","0")}if(null==e.leftDelim&&null==e.rightDelim)return i;{const t=[];if(null!=e.leftDelim){const i=new A.MathNode("mo",[new A.TextNode(e.leftDelim.replace("\\",""))]);i.setAttribute("fence","true"),t.push(i)}if(t.push(i),null!=e.rightDelim){const i=new A.MathNode("mo",[new A.TextNode(e.rightDelim.replace("\\",""))]);i.setAttribute("fence","true"),t.push(i)}return vt(t)}},Di=(w({type:"genfrac",names:["\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(e,t)=>{var{parser:e,funcName:i}=e,n=t[0],t=t[1];let r,s=null,o=null,a="auto";switch(i){case"\\dfrac":case"\\frac":case"\\tfrac":r=!0;break;case"\\\\atopfrac":r=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":r=!1,s="(",o=")";break;case"\\\\bracefrac":r=!1,s="\\{",o="\\}";break;case"\\\\brackfrac":r=!1,s="[",o="]";break;default:throw new Error("Unrecognized genfrac command")}switch(i){case"\\dfrac":case"\\dbinom":a="display";break;case"\\tfrac":case"\\tbinom":a="text"}return{type:"genfrac",mode:e.mode,continued:!1,numer:n,denom:t,hasBarLine:r,leftDelim:s,rightDelim:o,size:a,barSize:null}},htmlBuilder:Fi,mathmlBuilder:Pi}),w({type:"genfrac",names:["\\cfrac"],props:{numArgs:2},handler:(e,t)=>{var e=e["parser"],i=t[0],t=t[1];return{type:"genfrac",mode:e.mode,continued:!0,numer:i,denom:t,hasBarLine:!0,leftDelim:null,rightDelim:null,size:"display",barSize:null}}}),w({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(e){let t,{parser:i,funcName:n,token:r}=e;switch(n){case"\\over":t="\\frac";break;case"\\choose":t="\\binom";break;case"\\atop":t="\\\\atopfrac";break;case"\\brace":t="\\\\bracefrac";break;case"\\brack":t="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:i.mode,replaceWith:t,token:r}}}),["display","text","script","scriptscript"]),Oi=(w({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(e,t){var e=e["parser"],i=t[4],n=t[5],r=tt(t[0]),r="atom"===r.type&&"open"===r.family?Ei(r.text):null,s=tt(t[1]),s="atom"===s.type&&"close"===s.family?Ei(s.text):null,o=F(t[2],"size");let a,l=null,h=(a=!!o.isBlank||0<(l=o.value).number,"auto"),c=t[3];if("ordgroup"===c.type){if(0<c.body.length){const e=F(c.body[0],"textord");h=Di[Number(e.text)]}}else c=F(c,"textord"),h=Di[Number(c.text)];return{type:"genfrac",mode:e.mode,numer:i,denom:n,continued:!1,hasBarLine:a,barSize:l,leftDelim:r,rightDelim:s,size:h}},htmlBuilder:Fi,mathmlBuilder:Pi}),w({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(e,t){var{parser:e,token:i}=e;return{type:"infix",mode:e.mode,replaceWith:"\\\\abovefrac",size:F(t[0],"size").value,token:i}}}),w({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(e,t)=>{var e=e["parser"],i=t[0],n=function(e){if(e)return e;throw new Error("Expected non-null, but got "+String(e))}(F(t[1],"infix").size),t=t[2],r=0<n.number;return{type:"genfrac",mode:e.mode,numer:i,denom:t,continued:!1,hasBarLine:r,barSize:n,leftDelim:null,rightDelim:null,size:"auto"}},htmlBuilder:Fi,mathmlBuilder:Pi}),(e,t)=>{var i=t.style;let n,r;r="supsub"===e.type?(n=e.sup?L(e.sup,t.havingStyle(i.sup()),t):L(e.sub,t.havingStyle(i.sub()),t),F(e.base,"horizBrace")):F(e,"horizBrace");i=L(r.base,t.havingBaseStyle(T.DISPLAY)),e=Ct(r,t);let s;if((r.isOver?(s=R.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"kern",size:.1},{type:"elem",elem:e}]},t)).children[0].children[0].children[1]:(s=R.makeVList({positionType:"bottom",positionData:i.depth+.1+e.height,children:[{type:"elem",elem:e},{type:"kern",size:.1},{type:"elem",elem:i}]},t)).children[0].children[0].children[0]).classes.push("svg-align"),n){const e=R.makeSpan(["mord",r.isOver?"mover":"munder"],[s],t);s=r.isOver?R.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:e},{type:"kern",size:.2},{type:"elem",elem:n}]},t):R.makeVList({positionType:"bottom",positionData:e.depth+.2+n.height+n.depth,children:[{type:"elem",elem:n},{type:"kern",size:.2},{type:"elem",elem:e}]},t)}return R.makeSpan(["mord",r.isOver?"mover":"munder"],[s],t)}),Ni=(w({type:"horizBrace",names:["\\overbrace","\\underbrace"],props:{numArgs:1},handler(e,t){var{parser:e,funcName:i}=e;return{type:"horizBrace",mode:e.mode,label:i,isOver:/^\\over/.test(i),base:t[0]}},htmlBuilder:Oi,mathmlBuilder:(e,t)=>{var i=_t(e.label);return new A.MathNode(e.isOver?"mover":"munder",[I(e.base,t),i])}}),w({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(e,t)=>{var e=e["parser"],i=t[1],t=F(t[0],"url").url;return e.settings.isTrusted({command:"\\href",url:t})?{type:"href",mode:e.mode,href:t,body:x(i)}:e.formatUnsupportedCmd("\\href")},htmlBuilder:(e,t)=>{var i=$(e.body,t,!1);return R.makeAnchor(e.href,[],i,t)},mathmlBuilder:(e,t)=>{let i=bt(e.body,t);return(i=i instanceof S?i:new S("mrow",[i])).setAttribute("href",e.href),i}}),w({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(e,t)=>{var e=e["parser"],i=F(t[0],"url").url;if(!e.settings.isTrusted({command:"\\url",url:i}))return e.formatUnsupportedCmd("\\url");var n=[];for(let t=0;t<i.length;t++){let e=i[t];"~"===e&&(e="\\textasciitilde"),n.push({type:"textord",mode:"text",text:e})}t={type:"text",mode:e.mode,font:"\\texttt",body:n};return{type:"href",mode:e.mode,href:i,body:x(t)}}}),w({type:"hbox",names:["\\hbox"],props:{numArgs:1,argTypes:["text"],allowedInText:!0,primitive:!0},handler(e,t){e=e.parser;return{type:"hbox",mode:e.mode,body:x(t[0])}},htmlBuilder(e,t){e=$(e.body,t,!1);return R.makeFragment(e)},mathmlBuilder(e,t){return new A.MathNode("mrow",k(e.body,t))}}),w({type:"html",names:["\\htmlClass","\\htmlId","\\htmlStyle","\\htmlData"],props:{numArgs:2,argTypes:["raw","original"],allowedInText:!0},handler:(t,e)=>{let{parser:i,funcName:n}=t;var r=F(e[0],"raw").string,t=e[1];let s;i.settings.strict&&i.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var o={};switch(n){case"\\htmlClass":o.class=r,s={command:"\\htmlClass",class:r};break;case"\\htmlId":o.id=r,s={command:"\\htmlId",id:r};break;case"\\htmlStyle":o.style=r,s={command:"\\htmlStyle",style:r};break;case"\\htmlData":{const t=r.split(",");for(let e=0;e<t.length;e++){const i=t[e].split("=");if(2!==i.length)throw new _("Error parsing key-value for \\htmlData");o["data-"+i[0].trim()]=i[1].trim()}s={command:"\\htmlData",attributes:o};break}default:throw new Error("Unrecognized html command")}return i.settings.isTrusted(s)?{type:"html",mode:i.mode,attributes:o,body:x(t)}:i.formatUnsupportedCmd(n)},htmlBuilder:(e,t)=>{var i=$(e.body,t,!1),n=["enclosing"],r=(e.attributes.class&&n.push(...e.attributes.class.trim().split(/\s+/)),R.makeSpan(n,i,t));for(const t in e.attributes)"class"!==t&&e.attributes.hasOwnProperty(t)&&r.setAttribute(t,e.attributes[t]);return r},mathmlBuilder:(e,t)=>bt(e.body,t)}),w({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInText:!0},handler:(e,t)=>{e=e.parser;return{type:"htmlmathml",mode:e.mode,html:x(t[0]),mathml:x(t[1])}},htmlBuilder:(e,t)=>{e=$(e.html,t,!1);return R.makeFragment(e)},mathmlBuilder:(e,t)=>bt(e.mathml,t)}),w({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(t,e,i)=>{let n=t["parser"],r={number:0,unit:"em"},s={number:.9,unit:"em"},o={number:0,unit:"em"},a="";if(i[0]){const t=F(i[0],"raw").string.split(",");for(let e=0;e<t.length;e++){const i=t[e].split("=");if(2===i.length){const t=i[1].trim();switch(i[0].trim()){case"alt":a=t;break;case"width":r=Mi(t);break;case"height":s=Mi(t);break;case"totalheight":o=Mi(t);break;default:throw new _("Invalid key: '"+i[0]+"' in \\includegraphics.")}}}}t=F(e[0],"url").url;return""===a&&(a=(a=(a=t).replace(/^.*[\\/]/,"")).substring(0,a.lastIndexOf("."))),n.settings.isTrusted({command:"\\includegraphics",url:t})?{type:"includegraphics",mode:n.mode,alt:a,width:r,height:s,totalheight:o,src:t}:n.formatUnsupportedCmd("\\includegraphics")},htmlBuilder:(e,t)=>{var i=E(e.height,t);let n=0,r=(0<e.totalheight.number&&(n=E(e.totalheight,t)-i),0);0<e.width.number&&(r=E(e.width,t));t={height:M(i+n)},0<r&&(t.width=M(r)),0<n&&(t.verticalAlign=M(-n)),e=new Se(e.src,e.alt,t);return e.height=i,e.depth=n,e},mathmlBuilder:(e,t)=>{var i=new A.MathNode("mglyph",[]);i.setAttribute("alt",e.alt);const n=E(e.height,t);let r=0;if(0<e.totalheight.number&&(r=E(e.totalheight,t)-n,i.setAttribute("valign",M(-r))),i.setAttribute("height",M(n+r)),0<e.width.number){const n=E(e.width,t);i.setAttribute("width",M(n))}return i.setAttribute("src",e.src),i}}),w({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(e,t){var{parser:i,funcName:n}=e,r=F(t[0],"size");if(i.settings.strict){const e="m"===n[1],t="mu"===r.value.unit;e?(t||i.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" supports only mu units, not "+r.value.unit+" units"),"math"!==i.mode&&i.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" works only in math mode")):t&&i.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" doesn't support mu units")}return{type:"kern",mode:i.mode,dimension:r.value}},htmlBuilder(e,t){return R.makeGlue(e.dimension,t)},mathmlBuilder(e,t){e=E(e.dimension,t);return new A.SpaceNode(e)}}),w({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:e,funcName:i}=e,t=t[0];return{type:"lap",mode:e.mode,alignment:i.slice(5),body:t}},htmlBuilder:(e,t)=>{let i;i="clap"===e.alignment?(i=R.makeSpan([],[L(e.body,t)]),R.makeSpan(["inner"],[i],t)):R.makeSpan(["inner"],[L(e.body,t)]);var n=R.makeSpan(["fix"],[]);let r=R.makeSpan([e.alignment],[i,n],t);e=R.makeSpan(["strut"]);return e.style.height=M(r.height+r.depth),r.depth&&(e.style.verticalAlign=M(-r.depth)),r.children.unshift(e),r=R.makeSpan(["thinbox"],[r],t),R.makeSpan(["mord","vbox"],[r],t)},mathmlBuilder:(e,t)=>{var i=new A.MathNode("mpadded",[I(e.body,t)]);if("rlap"!==e.alignment){const t="llap"===e.alignment?"-1":"-0.5";i.setAttribute("lspace",t+"width")}return i.setAttribute("width","0px"),i}}),w({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){var{funcName:e,parser:i}=e,n=i.mode,e=(i.switchMode("math"),"\\("===e?"\\)":"$"),r=i.parseExpression(!1,e);return i.expect(e),i.switchMode(n),{type:"styling",mode:i.mode,style:"text",body:r}}}),w({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){throw new _("Mismatched "+e.funcName)}}),(e,t)=>{switch(t.style.size){case T.DISPLAY.size:return e.display;case T.TEXT.size:return e.text;case T.SCRIPT.size:return e.script;case T.SCRIPTSCRIPT.size:return e.scriptscript;default:return e.text}}),Bi=(w({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(e,t)=>{e=e.parser;return{type:"mathchoice",mode:e.mode,display:x(t[0]),text:x(t[1]),script:x(t[2]),scriptscript:x(t[3])}},htmlBuilder:(e,t)=>{e=Ni(e,t),e=$(e,t,!1);return R.makeFragment(e)},mathmlBuilder:(e,t)=>{e=Ni(e,t);return bt(e,t)}}),(e,t,i,n,r,s,o)=>{e=R.makeSpan([],[e]);var a=i&&C.isCharacterBox(i);let l,h,c;if(t){const e=L(t,n.havingStyle(r.sup()),n);h={elem:e,kern:Math.max(n.fontMetrics().bigOpSpacing1,n.fontMetrics().bigOpSpacing3-e.depth)}}if(i){const e=L(i,n.havingStyle(r.sub()),n);l={elem:e,kern:Math.max(n.fontMetrics().bigOpSpacing2,n.fontMetrics().bigOpSpacing4-e.height)}}if(h&&l){const t=n.fontMetrics().bigOpSpacing5+l.elem.height+l.elem.depth+l.kern+e.depth+o;c=R.makeVList({positionType:"bottom",positionData:t,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:M(-s)},{type:"kern",size:l.kern},{type:"elem",elem:e},{type:"kern",size:h.kern},{type:"elem",elem:h.elem,marginLeft:M(s)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]},n)}else if(l){const t=e.height-o;c=R.makeVList({positionType:"top",positionData:t,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:M(-s)},{type:"kern",size:l.kern},{type:"elem",elem:e}]},n)}else{if(!h)return e;{const t=e.depth+o;c=R.makeVList({positionType:"bottom",positionData:t,children:[{type:"elem",elem:e},{type:"kern",size:h.kern},{type:"elem",elem:h.elem,marginLeft:M(s)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]},n)}}t=[c];if(l&&0!==s&&!a){const e=R.makeSpan(["mspace"],[],n);e.style.marginRight=M(s),t.unshift(e)}return R.makeSpan(["mop","op-limits"],t,n)}),zi=["\\smallint"],Hi=(t,i)=>{let e,n,r,s=!1;"supsub"===t.type?(e=t.sup,n=t.sub,r=F(t.base,"op"),s=!0):r=F(t,"op");t=i.style;let o,a=!1;if(t.size===T.DISPLAY.size&&r.symbol&&!C.contains(zi,r.name)&&(a=!0),r.symbol){const t=a?"Size2-Regular":"Size1-Regular";let e="";if("\\oiint"!==r.name&&"\\oiiint"!==r.name||(e=r.name.slice(1),r.name="oiint"===e?"\\iint":"\\iiint"),o=R.makeSymbol(r.name,t,"math",i,["mop","op-symbol",a?"large-op":"small-op"]),0<e.length){const t=o.italic,n=R.staticSvg(e+"Size"+(a?"2":"1"),i);o=R.makeVList({positionType:"individualShift",children:[{type:"elem",elem:o,shift:0},{type:"elem",elem:n,shift:a?.08:0}]},i),r.name="\\"+e,o.classes.unshift("mop"),o.italic=t}}else if(r.body){const t=$(r.body,i,!0);1===t.length&&t[0]instanceof m?(o=t[0]).classes[0]="mop":o=R.makeSpan(["mop"],t,i)}else{const t=[];for(let e=1;e<r.name.length;e++)t.push(R.mathsym(r.name[e],r.mode,i));o=R.makeSpan(["mop"],t,i)}let l=0,h=0;return(o instanceof m||"\\oiint"===r.name||"\\oiiint"===r.name)&&!r.suppressBaseShift&&(l=(o.height-o.depth)/2-i.fontMetrics().axisHeight,h=o.italic),s?Bi(o,e,n,i,t,h,l):(l&&(o.style.position="relative",o.style.top=M(l)),o)},Ui=(e,t)=>{let i;if(e.symbol)i=new S("mo",[ft(e.name,e.mode)]),C.contains(zi,e.name)&&i.setAttribute("largeop","false");else if(e.body)i=new S("mo",k(e.body,t));else{i=new S("mi",[new gt(e.name.slice(1))]);const t=new S("mo",[ft("","text")]);i=e.parentIsSupSub?new S("mrow",[i,t]):mt([i,t])}return i},Wi={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","":"\\bigvee","⋂":"\\bigcap","":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"},qi=(w({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","","⋂","","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:(e,t)=>{let{parser:i,funcName:n}=e,r=n;return 1===r.length&&(r=Wi[r]),{type:"op",mode:i.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:r}},htmlBuilder:Hi,mathmlBuilder:Ui}),w({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{e=e.parser,t=t[0];return{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:x(t)}},htmlBuilder:Hi,mathmlBuilder:Ui}),{"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"}),Vi=(w({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler(e){var{parser:e,funcName:t}=e;return{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:t}},htmlBuilder:Hi,mathmlBuilder:Ui}),w({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(e){var{parser:e,funcName:t}=e;return{type:"op",mode:e.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:t}},htmlBuilder:Hi,mathmlBuilder:Ui}),w({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0},handler(e){let{parser:t,funcName:i}=e,n=i;return 1===n.length&&(n=qi[n]),{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:n}},htmlBuilder:Hi,mathmlBuilder:Ui}),(e,t)=>{let i,n,r,s,o=!1;if("supsub"===e.type?(i=e.sup,n=e.sub,r=F(e.base,"operatorname"),o=!0):r=F(e,"operatorname"),0<r.body.length){const e=r.body.map(e=>{var t=e.text;return"string"==typeof t?{type:"textord",mode:e.mode,text:t}:e}),i=$(e,t.withFont("mathrm"),!0);for(let e=0;e<i.length;e++){const t=i[e];t instanceof m&&(t.text=t.text.replace(/\u2212/,"-").replace(/\u2217/,"*"))}s=R.makeSpan(["mop"],i,t)}else s=R.makeSpan(["mop"],[],t);return o?Bi(s,i,n,t,t.style,0,0):s});function ji(e,t,i){var n=$(e,t,!1),r=t.sizeMultiplier/i.sizeMultiplier;for(let e=0;e<n.length;e++){var s=n[e].classes.indexOf("sizing");s<0?Array.prototype.push.apply(n[e].classes,t.sizingClasses(i)):n[e].classes[s+1]==="reset-size"+t.size&&(n[e].classes[s+1]="reset-size"+i.size),n[e].height*=r,n[e].depth*=r}return R.makeFragment(n)}w({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(e,t)=>{var{parser:e,funcName:i}=e,t=t[0];return{type:"operatorname",mode:e.mode,body:x(t),alwaysHandleSupSub:"\\operatornamewithlimits"===i,limits:!1,parentIsSupSub:!1}},htmlBuilder:Vi,mathmlBuilder:(t,i)=>{let n=k(t.body,i.withFont("mathrm")),r=!0;for(let e=0;e<n.length;e++){const i=n[e];if(!(i instanceof A.SpaceNode))if(i instanceof A.MathNode)switch(i.type){case"mi":case"mn":case"ms":case"mspace":case"mtext":break;case"mo":{const t=i.children[0];1===i.children.length&&t instanceof A.TextNode?t.text=t.text.replace(/\u2212/,"-").replace(/\u2217/,"*"):r=!1;break}default:r=!1}else r=!1}if(r){const t=n.map(e=>e.toText()).join("");n=[new A.TextNode(t)]}var i=new A.MathNode("mi",n),e=(i.setAttribute("mathvariant","normal"),new A.MathNode("mo",[ft("","text")]));return t.parentIsSupSub?new A.MathNode("mrow",[i,e]):A.newDocumentFragment([i,e])}}),P("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@"),et({type:"ordgroup",htmlBuilder(e,t){return e.semisimple?R.makeFragment($(e.body,t,!1)):R.makeSpan(["mord"],$(e.body,t,!0),t)},mathmlBuilder(e,t){return bt(e.body,t,!0)}}),w({type:"overline",names:["\\overline"],props:{numArgs:1},handler(e,t){e=e.parser,t=t[0];return{type:"overline",mode:e.mode,body:t}},htmlBuilder(e,t){var e=L(e.body,t.havingCrampedStyle()),i=R.makeLineSpan("overline-line",t),n=t.fontMetrics().defaultRuleThickness,e=R.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:e},{type:"kern",size:3*n},{type:"elem",elem:i},{type:"kern",size:n}]},t);return R.makeSpan(["mord","overline"],[e],t)},mathmlBuilder(e,t){var i=new A.MathNode("mo",[new A.TextNode("‾")]),e=(i.setAttribute("stretchy","true"),new A.MathNode("mover",[I(e.body,t),i]));return e.setAttribute("accent","true"),e}}),w({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{e=e.parser,t=t[0];return{type:"phantom",mode:e.mode,body:x(t)}},htmlBuilder:(e,t)=>{e=$(e.body,t.withPhantom(),!1);return R.makeFragment(e)},mathmlBuilder:(e,t)=>{e=k(e.body,t);return new A.MathNode("mphantom",e)}}),w({type:"hphantom",names:["\\hphantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{e=e.parser,t=t[0];return{type:"hphantom",mode:e.mode,body:t}},htmlBuilder:(e,t)=>{let i=R.makeSpan([],[L(e.body,t.withPhantom())]);if(i.height=0,i.depth=0,i.children)for(let e=0;e<i.children.length;e++)i.children[e].height=0,i.children[e].depth=0;return i=R.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:i}]},t),R.makeSpan(["mord"],[i],t)},mathmlBuilder:(e,t)=>{e=k(x(e.body),t),t=new A.MathNode("mphantom",e),e=new A.MathNode("mpadded",[t]);return e.setAttribute("height","0px"),e.setAttribute("depth","0px"),e}}),w({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{e=e.parser,t=t[0];return{type:"vphantom",mode:e.mode,body:t}},htmlBuilder:(e,t)=>{var e=R.makeSpan(["inner"],[L(e.body,t.withPhantom())]),i=R.makeSpan(["fix"],[]);return R.makeSpan(["mord","rlap"],[e,i],t)},mathmlBuilder:(e,t)=>{e=k(x(e.body),t),t=new A.MathNode("mphantom",e),e=new A.MathNode("mpadded",[t]);return e.setAttribute("width","0px"),e}}),w({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(e,t){var e=e["parser"],i=F(t[0],"size").value,t=t[1];return{type:"raisebox",mode:e.mode,dy:i,body:t}},htmlBuilder(e,t){var i=L(e.body,t),e=E(e.dy,t);return R.makeVList({positionType:"shift",positionData:-e,children:[{type:"elem",elem:i}]},t)},mathmlBuilder(e,t){t=new A.MathNode("mpadded",[I(e.body,t)]),e=e.dy.number+e.dy.unit;return t.setAttribute("voffset",e),t}}),w({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0},handler(e){e=e.parser;return{type:"internal",mode:e.mode}}}),w({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,argTypes:["size","size","size"]},handler(e,t,i){var e=e["parser"],i=i[0],n=F(t[0],"size"),t=F(t[1],"size");return{type:"rule",mode:e.mode,shift:i&&F(i,"size").value,width:n.value,height:t.value}},htmlBuilder(e,t){var i=R.makeSpan(["mord","rule"],[],t),n=E(e.width,t),r=E(e.height,t),e=e.shift?E(e.shift,t):0;return i.style.borderRightWidth=M(n),i.style.borderTopWidth=M(r),i.style.bottom=M(e),i.width=n,i.height=r+e,i.depth=-e,i.maxFontSize=1.125*r*t.sizeMultiplier,i},mathmlBuilder(e,t){var i=E(e.width,t),n=E(e.height,t),e=e.shift?E(e.shift,t):0,t=t.color&&t.getColor()||"black",r=new A.MathNode("mspace"),t=(r.setAttribute("mathbackground",t),r.setAttribute("width",M(i)),r.setAttribute("height",M(n)),new A.MathNode("mpadded",[r]));return 0<=e?t.setAttribute("height",M(e)):(t.setAttribute("height",M(e)),t.setAttribute("depth",M(-e))),t.setAttribute("voffset",M(e)),t}});const Gi=["\\tiny","\\sixptsize","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"],Ki=(w({type:"sizing",names:Gi,props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{breakOnTokenText:e,funcName:i,parser:n}=e,e=n.parseExpression(!1,e);return{type:"sizing",mode:n.mode,size:Gi.indexOf(i)+1,body:e}},htmlBuilder:(e,t)=>{var i=t.havingSize(e.size);return ji(e.body,i,t)},mathmlBuilder:(e,t)=>{t=t.havingSize(e.size),e=k(e.body,t),e=new A.MathNode("mstyle",e);return e.setAttribute("mathsize",M(t.sizeMultiplier)),e}}),w({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(e,t,i)=>{let n=e["parser"],r=!1,s=!1;var o=i[0]&&F(i[0],"ordgroup");if(o){var a;for(let e=0;e<o.body.length;++e)if("t"===(a=o.body[e].text))r=!0;else{if("b"!==a){r=!1,s=!1;break}s=!0}}else r=!0,s=!0;e=t[0];return{type:"smash",mode:n.mode,body:e,smashHeight:r,smashDepth:s}},htmlBuilder:(e,t)=>{var i=R.makeSpan([],[L(e.body,t)]);if(!e.smashHeight&&!e.smashDepth)return i;if(e.smashHeight&&(i.height=0,i.children))for(let e=0;e<i.children.length;e++)i.children[e].height=0;if(e.smashDepth&&(i.depth=0,i.children))for(let e=0;e<i.children.length;e++)i.children[e].depth=0;e=R.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:i}]},t);return R.makeSpan(["mord"],[e],t)},mathmlBuilder:(e,t)=>{t=new A.MathNode("mpadded",[I(e.body,t)]);return e.smashHeight&&t.setAttribute("height","0px"),e.smashDepth&&t.setAttribute("depth","0px"),t}}),w({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(e,t,i){e=e.parser,i=i[0],t=t[0];return{type:"sqrt",mode:e.mode,body:t,index:i}},htmlBuilder(e,t){let i=L(e.body,t.havingCrampedStyle());0===i.height&&(i.height=t.fontMetrics().xHeight),i=R.wrapFragment(i,t);const n=t.fontMetrics().defaultRuleThickness;let r=n,s=(t.style.id<T.TEXT.id&&(r=t.fontMetrics().xHeight),n+r/4);const o=i.height+i.depth+s+n,{span:a,ruleWidth:l,advanceWidth:h}=li.sqrtImage(o,t),c=a.height-l;c>i.height+i.depth+s&&(s=(s+c-i.height-i.depth)/2);var d=a.height-i.height-s-l,d=(i.style.paddingLeft=M(h),R.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:i,wrapperClasses:["svg-align"]},{type:"kern",size:-(i.height+d)},{type:"elem",elem:a},{type:"kern",size:l}]},t));if(e.index){const i=t.havingStyle(T.SCRIPTSCRIPT),n=L(e.index,i,t),r=.6*(d.height-d.depth),s=R.makeVList({positionType:"shift",positionData:-r,children:[{type:"elem",elem:n}]},t),o=R.makeSpan(["root"],[s]);return R.makeSpan(["mord","sqrt"],[o,d],t)}return R.makeSpan(["mord","sqrt"],[d],t)},mathmlBuilder(e,t){var{body:e,index:i}=e;return i?new A.MathNode("mroot",[I(e,t),I(i,t)]):new A.MathNode("msqrt",[I(e,t)])}}),{display:T.DISPLAY,text:T.TEXT,script:T.SCRIPT,scriptscript:T.SCRIPTSCRIPT}),Xi=(w({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e,t){var{breakOnTokenText:e,funcName:i,parser:n}=e,e=n.parseExpression(!0,e),i=i.slice(1,i.length-5);return{type:"styling",mode:n.mode,style:i,body:e}},htmlBuilder(e,t){var i=Ki[e.style],i=t.havingStyle(i).withFont("");return ji(e.body,i,t)},mathmlBuilder(e,t){var i=Ki[e.style],t=t.havingStyle(i),i=k(e.body,t),t=new A.MathNode("mstyle",i),i={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]}[e.style];return t.setAttribute("scriptlevel",i[0]),t.setAttribute("displaystyle",i[1]),t}}),et({type:"supsub",htmlBuilder(e,t){n=t;const i=(s=(r=e).base)?"op"===s.type?s.limits&&(n.style.size===T.DISPLAY.size||s.alwaysHandleSupSub)?Hi:null:"operatorname"===s.type?s.alwaysHandleSupSub&&(n.style.size===T.DISPLAY.size||s.limits)?Vi:null:"accent"===s.type?C.isCharacterBox(s.base)?Mt:null:"horizBrace"===s.type&&!r.sub===s.isOver?Oi:null:null;if(i)return i(e,t);var{base:n,sup:r,sub:s}=e,o=L(n,t);let a,l;var h=t.fontMetrics();let c=0,d=0;n=n&&C.isCharacterBox(n);if(r){const e=t.havingStyle(t.style.sup());a=L(r,e,t),n||(c=o.height-e.fontMetrics().supDrop*e.sizeMultiplier/t.sizeMultiplier)}if(s){const e=t.havingStyle(t.style.sub());l=L(s,e,t),n||(d=o.depth+e.fontMetrics().subDrop*e.sizeMultiplier/t.sizeMultiplier)}r=t.style===T.DISPLAY?h.sup1:t.style.cramped?h.sup3:h.sup2,s=t.sizeMultiplier,n=M(.5/h.ptPerEm/s);let u,p=null;if(l){const t=e.base&&"op"===e.base.type&&e.base.name&&("\\oiint"===e.base.name||"\\oiiint"===e.base.name);(o instanceof m||t)&&(p=M(-o.italic))}if(a&&l){c=Math.max(c,r,a.depth+.25*h.xHeight),d=Math.max(d,h.sub2);const e=4*h.defaultRuleThickness;if(c-a.depth-(l.height-d)<e){d=e-(c-a.depth)+l.height;const t=.8*h.xHeight-(c-a.depth);0<t&&(c+=t,d-=t)}const i=[{type:"elem",elem:l,shift:d,marginRight:n,marginLeft:p},{type:"elem",elem:a,shift:-c,marginRight:n}];u=R.makeVList({positionType:"individualShift",children:i},t)}else if(l){d=Math.max(d,h.sub1,l.height-.8*h.xHeight);const e=[{type:"elem",elem:l,marginLeft:p,marginRight:n}];u=R.makeVList({positionType:"shift",positionData:d,children:e},t)}else{if(!a)throw new Error("supsub must have either sup or sub.");c=Math.max(c,r,a.depth+.25*h.xHeight),u=R.makeVList({positionType:"shift",positionData:-c,children:[{type:"elem",elem:a,marginRight:n}]},t)}s=dt(o,"right")||"mord";return R.makeSpan([s],[o,R.makeSpan(["msupsub"],[u])],t)},mathmlBuilder(e,t){let i,n=!1;e.base&&"horizBrace"===e.base.type&&!!e.sup===e.base.isOver&&(n=!0,i=e.base.isOver),!e.base||"op"!==e.base.type&&"operatorname"!==e.base.type||(e.base.parentIsSupSub=!0);var r=[I(e.base,t)];let s;if(e.sub&&r.push(I(e.sub,t)),e.sup&&r.push(I(e.sup,t)),n)s=i?"mover":"munder";else if(e.sub)if(e.sup){const i=e.base;s=i&&"op"===i.type&&i.limits&&t.style===T.DISPLAY||i&&"operatorname"===i.type&&i.alwaysHandleSupSub&&(t.style===T.DISPLAY||i.limits)?"munderover":"msubsup"}else{const i=e.base;s=i&&"op"===i.type&&i.limits&&(t.style===T.DISPLAY||i.alwaysHandleSupSub)||i&&"operatorname"===i.type&&i.alwaysHandleSupSub&&(i.limits||t.style===T.DISPLAY)?"munder":"msub"}else{const i=e.base;s=i&&"op"===i.type&&i.limits&&(t.style===T.DISPLAY||i.alwaysHandleSupSub)||i&&"operatorname"===i.type&&i.alwaysHandleSupSub&&(i.limits||t.style===T.DISPLAY)?"mover":"msup"}return new A.MathNode(s,r)}}),et({type:"atom",htmlBuilder(e,t){return R.mathsym(e.text,e.mode,t,["m"+e.family])},mathmlBuilder(e,t){var i=new A.MathNode("mo",[ft(e.text,e.mode)]);return"bin"===e.family?"bold-italic"===(t=yt(e,t))&&i.setAttribute("mathvariant",t):"punct"===e.family?i.setAttribute("separator","true"):"open"!==e.family&&"close"!==e.family||i.setAttribute("stretchy","false"),i}}),{mi:"italic",mn:"normal",mtext:"normal"}),Yi=(et({type:"mathord",htmlBuilder(e,t){return R.makeOrd(e,t,"mathord")},mathmlBuilder(e,t){var i=new A.MathNode("mi",[ft(e.text,e.mode,t)]),e=yt(e,t)||"italic";return e!==Xi[i.type]&&i.setAttribute("mathvariant",e),i}}),et({type:"textord",htmlBuilder(e,t){return R.makeOrd(e,t,"textord")},mathmlBuilder(e,t){var i=ft(e.text,e.mode,t),t=yt(e,t)||"normal",e="text"===e.mode?new A.MathNode("mtext",[i]):/[0-9]/.test(e.text)?new A.MathNode("mn",[i]):"\\prime"===e.text?new A.MathNode("mo",[i]):new A.MathNode("mi",[i]);return t!==Xi[e.type]&&e.setAttribute("mathvariant",t),e}}),{"\\nobreak":"nobreak","\\allowbreak":"allowbreak"}),Qi={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}},Ji=(et({type:"spacing",htmlBuilder(e,t){if(Qi.hasOwnProperty(e.text)){var i=Qi[e.text].className||"";if("text"!==e.mode)return R.makeSpan(["mspace",i],[R.mathsym(e.text,e.mode,t)],t);{const _=R.makeOrd(e,t,"textord");return _.classes.push(i),_}}if(Yi.hasOwnProperty(e.text))return R.makeSpan(["mspace",Yi[e.text]],[],t);throw new _('Unknown type of space "'+e.text+'"')},mathmlBuilder(e,t){if(Qi.hasOwnProperty(e.text))return new A.MathNode("mtext",[new A.TextNode(" ")]);if(Yi.hasOwnProperty(e.text))return new A.MathNode("mspace");throw new _('Unknown type of space "'+e.text+'"')}}),()=>{var e=new A.MathNode("mtd",[]);return e.setAttribute("width","50%"),e}),Zi=(et({type:"tag",mathmlBuilder(e,t){e=new A.MathNode("mtable",[new A.MathNode("mtr",[Ji(),new A.MathNode("mtd",[bt(e.body,t)]),Ji(),new A.MathNode("mtd",[bt(e.tag,t)])])]);return e.setAttribute("width","100%"),e}}),{"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"}),en={"\\textbf":"textbf","\\textmd":"textmd"},tn={"\\textit":"textit","\\textup":"textup"},nn=(e,t)=>{e=e.font;return e?Zi[e]?t.withTextFontFamily(Zi[e]):en[e]?t.withTextFontWeight(en[e]):t.withTextFontShape(tn[e]):t},rn=(w({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(e,t){var{parser:e,funcName:i}=e,t=t[0];return{type:"text",mode:e.mode,body:x(t),font:i}},htmlBuilder(e,t){t=nn(e,t),e=$(e.body,t,!0);return R.makeSpan(["mord","text"],e,t)},mathmlBuilder(e,t){t=nn(e,t);return bt(e.body,t)}}),w({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(e,t){e=e.parser;return{type:"underline",mode:e.mode,body:t[0]}},htmlBuilder(e,t){var e=L(e.body,t),i=R.makeLineSpan("underline-line",t),n=t.fontMetrics().defaultRuleThickness,i=R.makeVList({positionType:"top",positionData:e.height,children:[{type:"kern",size:n},{type:"elem",elem:i},{type:"kern",size:3*n},{type:"elem",elem:e}]},t);return R.makeSpan(["mord","underline"],[i],t)},mathmlBuilder(e,t){var i=new A.MathNode("mo",[new A.TextNode("‾")]),e=(i.setAttribute("stretchy","true"),new A.MathNode("munder",[I(e.body,t),i]));return e.setAttribute("accentunder","true"),e}}),w({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(e,t){e=e.parser;return{type:"vcenter",mode:e.mode,body:t[0]}},htmlBuilder(e,t){var e=L(e.body,t),i=t.fontMetrics().axisHeight,i=.5*(e.height-i-(e.depth+i));return R.makeVList({positionType:"shift",positionData:i,children:[{type:"elem",elem:e}]},t)},mathmlBuilder(e,t){return new A.MathNode("mpadded",[I(e.body,t)],["vcenter"])}}),w({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(e,t,i){throw new _("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(i,e){var n=rn(i),r=[],s=e.havingStyle(e.style.text());for(let t=0;t<n.length;t++){let e=n[t];"~"===e&&(e="\\textasciitilde"),r.push(R.makeSymbol(e,"Typewriter-Regular",i.mode,s,["mord","texttt"]))}return R.makeSpan(["mord","text"].concat(s.sizingClasses(e)),R.tryCombineChars(r),s)},mathmlBuilder(e,t){e=new A.TextNode(rn(e)),e=new A.MathNode("mtext",[e]);return e.setAttribute("mathvariant","monospace"),e}}),e=>e.body.replace(/ /g,e.star?"␣":" "));var sn=Qe;const on=new RegExp("[̀-ͯ]+$");class an{constructor(e,t){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=e,this.settings=t,this.tokenRegex=new RegExp("([ \r\n\t]+)|\\\\(\n|[ \r\t]+\n?)[ \r\t]*|([!-\\[\\]-‧‪-퟿豈-￿][̀-ͯ]*|[\ud800-\udbff][\udc00-\udfff][̀-ͯ]*|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5|(\\\\[a-zA-Z@]+)[ \r\n\t]*|\\\\[^\ud800-\udfff])","g"),this.catcodes={"%":14,"~":13}}setCatcode(e,t){this.catcodes[e]=t}lex(){const e=this.input,t=this.tokenRegex.lastIndex;if(t===e.length)return new vi("EOF",new fi(this,t,t));var i=this.tokenRegex.exec(e);if(null===i||i.index!==t)throw new _("Unexpected character: '"+e[t]+"'",new vi(e[t],new fi(this,t,t+1)));i=i[6]||i[3]||(i[2]?"\\ ":" ");if(14!==this.catcodes[i])return new vi(i,new fi(this,t,this.tokenRegex.lastIndex));{const t=e.indexOf("\n",this.tokenRegex.lastIndex);return-1===t?(this.tokenRegex.lastIndex=e.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=t+1,this.lex()}}}class ln{constructor(e,t){void 0===e&&(e={}),void 0===t&&(t={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=t,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(0===this.undefStack.length)throw new _("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var e=this.undefStack.pop();for(const t in e)e.hasOwnProperty(t)&&(null==e[t]?delete this.current[t]:this.current[t]=e[t])}endGroups(){for(;0<this.undefStack.length;)this.endGroup()}has(e){return this.current.hasOwnProperty(e)||this.builtins.hasOwnProperty(e)}get(e){return(this.current.hasOwnProperty(e)?this.current:this.builtins)[e]}set(t,e,i){if(i=void 0===i?!1:i){for(let e=0;e<this.undefStack.length;e++)delete this.undefStack[e][t];0<this.undefStack.length&&(this.undefStack[this.undefStack.length-1][t]=e)}else{const e=this.undefStack[this.undefStack.length-1];e&&!e.hasOwnProperty(t)&&(e[t]=this.current[t])}null==e?delete this.current[t]:this.current[t]=e}}var hn=gi;P("\\noexpand",function(e){var t=e.popToken();return e.isExpandable(t.text)&&(t.noexpand=!0,t.treatAsRelax=!0),{tokens:[t],numArgs:0}}),P("\\expandafter",function(e){var t=e.popToken();return e.expandOnce(!0),{tokens:[t],numArgs:0}}),P("\\@firstoftwo",function(e){return{tokens:e.consumeArgs(2)[0],numArgs:0}}),P("\\@secondoftwo",function(e){return{tokens:e.consumeArgs(2)[1],numArgs:0}}),P("\\@ifnextchar",function(e){var t=e.consumeArgs(3),e=(e.consumeSpaces(),e.future());return 1===t[0].length&&t[0][0].text===e.text?{tokens:t[1],numArgs:0}:{tokens:t[2],numArgs:0}}),P("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}"),P("\\TextOrMath",function(e){var t=e.consumeArgs(2);return"text"===e.mode?{tokens:t[0],numArgs:0}:{tokens:t[1],numArgs:0}});const cn={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15},dn=(P("\\char",function(e){let t,i=e.popToken(),n="";if("'"===i.text)t=8,i=e.popToken();else if('"'===i.text)t=16,i=e.popToken();else if("`"===i.text)if("\\"===(i=e.popToken()).text[0])n=i.text.charCodeAt(1);else{if("EOF"===i.text)throw new _("\\char` missing argument");n=i.text.charCodeAt(0)}else t=10;if(t){if(null==(n=cn[i.text])||n>=t)throw new _("Invalid base-"+t+" digit "+i.text);for(var r;null!=(r=cn[e.future().text])&&r<t;)n=n*t+r,e.popToken()}return"\\@char{"+n+"}"}),(i,e,t)=>{let n=i.consumeArg().tokens;if(1!==n.length)throw new _("\\newcommand's first argument must be a macro name");var r=n[0].text,s=i.isDefined(r);if(s&&!e)throw new _("\\newcommand{"+r+"} attempting to redefine "+r+"; use \\renewcommand");if(!s&&!t)throw new _("\\renewcommand{"+r+"} when command "+r+" does not yet exist; use \\newcommand");let o=0;if(1===(n=i.consumeArg().tokens).length&&"["===n[0].text){let e="",t=i.expandNextToken();for(;"]"!==t.text&&"EOF"!==t.text;)e+=t.text,t=i.expandNextToken();if(!e.match(/^\s*[0-9]+\s*$/))throw new _("Invalid number of arguments: "+e);o=parseInt(e),n=i.consumeArg().tokens}return i.macros.set(r,{tokens:n,numArgs:o}),""}),un=(P("\\newcommand",e=>dn(e,!1,!0)),P("\\renewcommand",e=>dn(e,!0,!1)),P("\\providecommand",e=>dn(e,!0,!0)),P("\\message",e=>{e=e.consumeArgs(1)[0];return console.log(e.reverse().map(e=>e.text).join("")),""}),P("\\errmessage",e=>{e=e.consumeArgs(1)[0];return console.error(e.reverse().map(e=>e.text).join("")),""}),P("\\show",e=>{var t=e.popToken(),i=t.text;return console.log(t,e.macros.get(i),sn[i],d.math[i],d.text[i]),""}),P("\\bgroup","{"),P("\\egroup","}"),P("~","\\nobreakspace"),P("\\lq","`"),P("\\rq","'"),P("\\aa","\\r a"),P("\\AA","\\r A"),P("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}"),P("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}"),P("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}"),P("","\\mathscr{B}"),P("","\\mathscr{E}"),P("","\\mathscr{F}"),P("","\\mathscr{H}"),P("","\\mathscr{I}"),P("","\\mathscr{L}"),P("","\\mathscr{M}"),P("","\\mathscr{R}"),P("","\\mathfrak{C}"),P("","\\mathfrak{H}"),P("","\\mathfrak{Z}"),P("\\Bbbk","\\Bbb{k}"),P("·","\\cdotp"),P("\\llap","\\mathllap{\\textrm{#1}}"),P("\\rlap","\\mathrlap{\\textrm{#1}}"),P("\\clap","\\mathclap{\\textrm{#1}}"),P("\\mathstrut","\\vphantom{(}"),P("\\underbar","\\underline{\\text{#1}}"),P("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}}{\\char"338}'),P("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}"),P("\\ne","\\neq"),P("≠","\\neq"),P("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}"),P("∉","\\notin"),P("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}"),P("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}"),P("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}"),P("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}"),P("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}"),P("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}"),P("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}"),P("⟂","\\perp"),P("‼","\\mathclose{!\\mkern-0.8mu!}"),P("∌","\\notni"),P("⌜","\\ulcorner"),P("⌝","\\urcorner"),P("⌞","\\llcorner"),P("⌟","\\lrcorner"),P("©","\\copyright"),P("®","\\textregistered"),P("","\\textregistered"),P("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}'),P("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}'),P("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}'),P("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}'),P("\\vdots","\\mathord{\\varvdots\\rule{0pt}{15pt}}"),P("⋮","\\vdots"),P("\\varGamma","\\mathit{\\Gamma}"),P("\\varDelta","\\mathit{\\Delta}"),P("\\varTheta","\\mathit{\\Theta}"),P("\\varLambda","\\mathit{\\Lambda}"),P("\\varXi","\\mathit{\\Xi}"),P("\\varPi","\\mathit{\\Pi}"),P("\\varSigma","\\mathit{\\Sigma}"),P("\\varUpsilon","\\mathit{\\Upsilon}"),P("\\varPhi","\\mathit{\\Phi}"),P("\\varPsi","\\mathit{\\Psi}"),P("\\varOmega","\\mathit{\\Omega}"),P("\\substack","\\begin{subarray}{c}#1\\end{subarray}"),P("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax"),P("\\boxed","\\fbox{$\\displaystyle{#1}$}"),P("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;"),P("\\implies","\\DOTSB\\;\\Longrightarrow\\;"),P("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;"),{",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"}),pn=(P("\\dots",function(e){let t="\\dotso";e=e.expandAfterFuture().text;return e in un?t=un[e]:("\\not"===e.slice(0,4)||e in d.math&&C.contains(["bin","rel"],d.math[e].group))&&(t="\\dotsb"),t}),{")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0});P("\\dotso",function(e){return e.future().text in pn?"\\ldots\\,":"\\ldots"}),P("\\dotsc",function(e){e=e.future().text;return e in pn&&","!==e?"\\ldots\\,":"\\ldots"}),P("\\cdots",function(e){return e.future().text in pn?"\\@cdots\\,":"\\@cdots"}),P("\\dotsb","\\cdots"),P("\\dotsm","\\cdots"),P("\\dotsi","\\!\\cdots"),P("\\dotsx","\\ldots\\,"),P("\\DOTSI","\\relax"),P("\\DOTSB","\\relax"),P("\\DOTSX","\\relax"),P("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax"),P("\\,","\\tmspace+{3mu}{.1667em}"),P("\\thinspace","\\,"),P("\\>","\\mskip{4mu}"),P("\\:","\\tmspace+{4mu}{.2222em}"),P("\\medspace","\\:"),P("\\;","\\tmspace+{5mu}{.2777em}"),P("\\thickspace","\\;"),P("\\!","\\tmspace-{3mu}{.1667em}"),P("\\negthinspace","\\!"),P("\\negmedspace","\\tmspace-{4mu}{.2222em}"),P("\\negthickspace","\\tmspace-{5mu}{.277em}"),P("\\enspace","\\kern.5em "),P("\\enskip","\\hskip.5em\\relax"),P("\\quad","\\hskip1em\\relax"),P("\\qquad","\\hskip2em\\relax"),P("\\tag","\\@ifstar\\tag@literal\\tag@paren"),P("\\tag@paren","\\tag@literal{({#1})}"),P("\\tag@literal",e=>{if(e.macros.get("\\df@tag"))throw new _("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"}),P("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}"),P("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)"),P("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}"),P("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1"),P("\\newline","\\\\\\relax"),P("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");l=M(ne["Main-Regular"]["T".charCodeAt(0)][1]-.7*ne["Main-Regular"]["A".charCodeAt(0)][1]),P("\\LaTeX","\\textrm{\\html@mathml{L\\kern-.36em\\raisebox{"+l+"}{\\scriptstyle A}\\kern-.15em\\TeX}{LaTeX}}"),P("\\KaTeX","\\textrm{\\html@mathml{K\\kern-.17em\\raisebox{"+l+"}{\\scriptstyle A}\\kern-.15em\\TeX}{KaTeX}}"),P("\\hspace","\\@ifstar\\@hspacer\\@hspace"),P("\\@hspace","\\hskip #1\\relax"),P("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax"),P("\\ordinarycolon",":"),P("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}"),P("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}'),P("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}'),P("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}'),P("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}'),P("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}'),P("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}'),P("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}'),P("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}'),P("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}'),P("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}'),P("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}'),P("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}'),P("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}'),P("∷","\\dblcolon"),P("∹","\\eqcolon"),P("≔","\\coloneqq"),P("≕","\\eqqcolon"),P("⩴","\\Coloneqq"),P("\\ratio","\\vcentcolon"),P("\\coloncolon","\\dblcolon"),P("\\colonequals","\\coloneqq"),P("\\coloncolonequals","\\Coloneqq"),P("\\equalscolon","\\eqqcolon"),P("\\equalscoloncolon","\\Eqqcolon"),P("\\colonminus","\\coloneq"),P("\\coloncolonminus","\\Coloneq"),P("\\minuscolon","\\eqcolon"),P("\\minuscoloncolon","\\Eqcolon"),P("\\coloncolonapprox","\\Colonapprox"),P("\\coloncolonsim","\\Colonsim"),P("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),P("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}"),P("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),P("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}"),P("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}"),P("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}"),P("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}"),P("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}"),P("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}"),P("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}"),P("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}"),P("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}"),P("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}"),P("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}"),P("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}"),P("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}"),P("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}"),P("\\nleqq","\\html@mathml{\\@nleqq}{≰}"),P("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}"),P("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}"),P("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}"),P("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}"),P("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}"),P("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}"),P("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}"),P("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}"),P("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}"),P("\\imath","\\html@mathml{\\@imath}{ı}"),P("\\jmath","\\html@mathml{\\@jmath}{ȷ}"),P("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}"),P("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}"),P("⟦","\\llbracket"),P("⟧","\\rrbracket"),P("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}"),P("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}"),P("⦃","\\lBrace"),P("⦄","\\rBrace"),P("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}"),P("⦵","\\minuso"),P("\\darr","\\downarrow"),P("\\dArr","\\Downarrow"),P("\\Darr","\\Downarrow"),P("\\lang","\\langle"),P("\\rang","\\rangle"),P("\\uarr","\\uparrow"),P("\\uArr","\\Uparrow"),P("\\Uarr","\\Uparrow"),P("\\N","\\mathbb{N}"),P("\\R","\\mathbb{R}"),P("\\Z","\\mathbb{Z}"),P("\\alef","\\aleph"),P("\\alefsym","\\aleph"),P("\\Alpha","\\mathrm{A}"),P("\\Beta","\\mathrm{B}"),P("\\bull","\\bullet"),P("\\Chi","\\mathrm{X}"),P("\\clubs","\\clubsuit"),P("\\cnums","\\mathbb{C}"),P("\\Complex","\\mathbb{C}"),P("\\Dagger","\\ddagger"),P("\\diamonds","\\diamondsuit"),P("\\empty","\\emptyset"),P("\\Epsilon","\\mathrm{E}"),P("\\Eta","\\mathrm{H}"),P("\\exist","\\exists"),P("\\harr","\\leftrightarrow"),P("\\hArr","\\Leftrightarrow"),P("\\Harr","\\Leftrightarrow"),P("\\hearts","\\heartsuit"),P("\\image","\\Im"),P("\\infin","\\infty"),P("\\Iota","\\mathrm{I}"),P("\\isin","\\in"),P("\\Kappa","\\mathrm{K}"),P("\\larr","\\leftarrow"),P("\\lArr","\\Leftarrow"),P("\\Larr","\\Leftarrow"),P("\\lrarr","\\leftrightarrow"),P("\\lrArr","\\Leftrightarrow"),P("\\Lrarr","\\Leftrightarrow"),P("\\Mu","\\mathrm{M}"),P("\\natnums","\\mathbb{N}"),P("\\Nu","\\mathrm{N}"),P("\\Omicron","\\mathrm{O}"),P("\\plusmn","\\pm"),P("\\rarr","\\rightarrow"),P("\\rArr","\\Rightarrow"),P("\\Rarr","\\Rightarrow"),P("\\real","\\Re"),P("\\reals","\\mathbb{R}"),P("\\Reals","\\mathbb{R}"),P("\\Rho","\\mathrm{P}"),P("\\sdot","\\cdot"),P("\\sect","\\S"),P("\\spades","\\spadesuit"),P("\\sub","\\subset"),P("\\sube","\\subseteq"),P("\\supe","\\supseteq"),P("\\Tau","\\mathrm{T}"),P("\\thetasym","\\vartheta"),P("\\weierp","\\wp"),P("\\Zeta","\\mathrm{Z}"),P("\\argmin","\\DOTSB\\operatorname*{arg\\,min}"),P("\\argmax","\\DOTSB\\operatorname*{arg\\,max}"),P("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits"),P("\\bra","\\mathinner{\\langle{#1}|}"),P("\\ket","\\mathinner{|{#1}\\rangle}"),P("\\braket","\\mathinner{\\langle{#1}\\rangle}"),P("\\Bra","\\left\\langle#1\\right|"),P("\\Ket","\\left|#1\\right\\rangle"),p=l=>e=>{const t=e.consumeArg().tokens,n=e.consumeArg().tokens,r=e.consumeArg().tokens,i=e.consumeArg().tokens,s=e.macros.get("|"),o=e.macros.get("\\|");e.macros.beginGroup();var a=i=>e=>{l&&(e.macros.set("|",s),r.length)&&e.macros.set("\\|",o);let t=i;return!i&&r.length&&"|"===e.future().text&&(e.popToken(),t=!0),{tokens:t?r:n,numArgs:0}},a=(e.macros.set("|",a(!1)),r.length&&e.macros.set("\\|",a(!0)),e.consumeArg().tokens),a=e.expandTokens([...i,...a,...t]);return e.macros.endGroup(),{tokens:a.reverse(),numArgs:0}};P("\\bra@ket",p(!1)),P("\\bra@set",p(!0)),P("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}"),P("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}"),P("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}"),P("\\angln","{\\angl n}"),P("\\blue","\\textcolor{##6495ed}{#1}"),P("\\orange","\\textcolor{##ffa500}{#1}"),P("\\pink","\\textcolor{##ff00af}{#1}"),P("\\red","\\textcolor{##df0030}{#1}"),P("\\green","\\textcolor{##28ae7b}{#1}"),P("\\gray","\\textcolor{gray}{#1}"),P("\\purple","\\textcolor{##9d38bd}{#1}"),P("\\blueA","\\textcolor{##ccfaff}{#1}"),P("\\blueB","\\textcolor{##80f6ff}{#1}"),P("\\blueC","\\textcolor{##63d9ea}{#1}"),P("\\blueD","\\textcolor{##11accd}{#1}"),P("\\blueE","\\textcolor{##0c7f99}{#1}"),P("\\tealA","\\textcolor{##94fff5}{#1}"),P("\\tealB","\\textcolor{##26edd5}{#1}"),P("\\tealC","\\textcolor{##01d1c1}{#1}"),P("\\tealD","\\textcolor{##01a995}{#1}"),P("\\tealE","\\textcolor{##208170}{#1}"),P("\\greenA","\\textcolor{##b6ffb0}{#1}"),P("\\greenB","\\textcolor{##8af281}{#1}"),P("\\greenC","\\textcolor{##74cf70}{#1}"),P("\\greenD","\\textcolor{##1fab54}{#1}"),P("\\greenE","\\textcolor{##0d923f}{#1}"),P("\\goldA","\\textcolor{##ffd0a9}{#1}"),P("\\goldB","\\textcolor{##ffbb71}{#1}"),P("\\goldC","\\textcolor{##ff9c39}{#1}"),P("\\goldD","\\textcolor{##e07d10}{#1}"),P("\\goldE","\\textcolor{##a75a05}{#1}"),P("\\redA","\\textcolor{##fca9a9}{#1}"),P("\\redB","\\textcolor{##ff8482}{#1}"),P("\\redC","\\textcolor{##f9685d}{#1}"),P("\\redD","\\textcolor{##e84d39}{#1}"),P("\\redE","\\textcolor{##bc2612}{#1}"),P("\\maroonA","\\textcolor{##ffbde0}{#1}"),P("\\maroonB","\\textcolor{##ff92c6}{#1}"),P("\\maroonC","\\textcolor{##ed5fa6}{#1}"),P("\\maroonD","\\textcolor{##ca337c}{#1}"),P("\\maroonE","\\textcolor{##9e034e}{#1}"),P("\\purpleA","\\textcolor{##ddd7ff}{#1}"),P("\\purpleB","\\textcolor{##c6b9fc}{#1}"),P("\\purpleC","\\textcolor{##aa87ff}{#1}"),P("\\purpleD","\\textcolor{##7854ab}{#1}"),P("\\purpleE","\\textcolor{##543b78}{#1}"),P("\\mintA","\\textcolor{##f5f9e8}{#1}"),P("\\mintB","\\textcolor{##edf2df}{#1}"),P("\\mintC","\\textcolor{##e0e5cc}{#1}"),P("\\grayA","\\textcolor{##f6f7f7}{#1}"),P("\\grayB","\\textcolor{##f0f1f2}{#1}"),P("\\grayC","\\textcolor{##e3e5e6}{#1}"),P("\\grayD","\\textcolor{##d6d8da}{#1}"),P("\\grayE","\\textcolor{##babec2}{#1}"),P("\\grayF","\\textcolor{##888d93}{#1}"),P("\\grayG","\\textcolor{##626569}{#1}"),P("\\grayH","\\textcolor{##3b3e40}{#1}"),P("\\grayI","\\textcolor{##21242c}{#1}"),P("\\kaBlue","\\textcolor{##314453}{#1}"),P("\\kaGreen","\\textcolor{##71B307}{#1}");const mn={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class gn{constructor(e,t,i){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=t,this.expansionCount=0,this.feed(e),this.macros=new ln(hn,t.macros),this.mode=i,this.stack=[]}feed(e){this.lexer=new an(e,this.settings)}switchMode(e){this.mode=e}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return 0===this.stack.length&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(e){this.stack.push(e)}pushTokens(e){this.stack.push(...e)}scanArgument(e){let t,i,n;if(e){if(this.consumeSpaces(),"["!==this.future().text)return null;t=this.popToken(),{tokens:n,end:i}=this.consumeArg(["]"])}else({tokens:n,start:t,end:i}=this.consumeArg());return this.pushToken(new vi("EOF",i.loc)),this.pushTokens(n),t.range(i,"")}consumeSpaces(){for(;" "===this.future().text;)this.stack.pop()}consumeArg(e){var t=[],i=e&&0<e.length,n=(i||this.consumeSpaces(),this.future());let r,s=0,o=0;do{if(r=this.popToken(),t.push(r),"{"===r.text)++s;else if("}"===r.text){if(-1===--s)throw new _("Extra }",r)}else if("EOF"===r.text)throw new _("Unexpected end of input in a macro argument, expected '"+(e&&i?e[o]:"}")+"'",r);if(e&&i)if((0===s||1===s&&"{"===e[o])&&r.text===e[o]){if(++o===e.length){t.splice(-o,o);break}}else o=0}while(0!==s||i);return"{"===n.text&&"}"===t[t.length-1].text&&(t.pop(),t.shift()),t.reverse(),{tokens:t,start:n,end:r}}consumeArgs(t,i){if(i){if(i.length!==t+1)throw new _("The length of delimiters doesn't match the number of args!");const n=i[0];for(let e=0;e<n.length;e++){const i=this.popToken();if(n[e]!==i.text)throw new _("Use of the macro doesn't match its definition",i)}}const n=[];for(let e=0;e<t;e++)n.push(this.consumeArg(i&&i[e+1]).tokens);return n}countExpansion(e){if(this.expansionCount+=e,this.expansionCount>this.settings.maxExpand)throw new _("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(e){var t=this.popToken(),i=t.text,n=t.noexpand?null:this._getExpansion(i);if(null==n||e&&n.unexpandable){if(e&&null==n&&"\\"===i[0]&&!this.isDefined(i))throw new _("Undefined control sequence: "+i);return this.pushToken(t),!1}this.countExpansion(1);let r=n.tokens;var s=this.consumeArgs(n.numArgs,n.delimiters);if(n.numArgs)for(let e=(r=r.slice()).length-1;0<=e;--e){var o=r[e];if("#"===o.text){if(0===e)throw new _("Incomplete placeholder at end of macro body",o);if("#"===(o=r[--e]).text)r.splice(e+1,1);else{if(!/^[1-9]$/.test(o.text))throw new _("Not a valid argument number",o);r.splice(e,2,...s[+o.text-1])}}}return this.pushTokens(r),r.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;){var e;if(!1===this.expandOnce())return(e=this.stack.pop()).treatAsRelax&&(e.text="\\relax"),e}throw new Error}expandMacro(e){return this.macros.has(e)?this.expandTokens([new vi(e)]):void 0}expandTokens(e){var t=[],i=this.stack.length;for(this.pushTokens(e);this.stack.length>i;)if(!1===this.expandOnce(!0)){const e=this.stack.pop();e.treatAsRelax&&(e.noexpand=!1,e.treatAsRelax=!1),t.push(e)}return this.countExpansion(t.length),t}expandMacroAsText(e){e=this.expandMacro(e);return e&&e.map(e=>e.text).join("")}_getExpansion(i){const n=this.macros.get(i);if(null==n)return n;if(1===i.length){const n=this.lexer.catcodes[i];if(null!=n&&13!==n)return}i="function"==typeof n?n(this):n;if("string"!=typeof i)return i;{let e=0;if(-1!==i.indexOf("#")){const n=i.replace(/##/g,"");for(;-1!==n.indexOf("#"+(e+1));)++e}const n=new an(i,this.settings),r=[];let t=n.lex();for(;"EOF"!==t.text;)r.push(t),t=n.lex();return r.reverse(),{tokens:r,numArgs:e}}}isDefined(e){return this.macros.has(e)||sn.hasOwnProperty(e)||d.math.hasOwnProperty(e)||d.text.hasOwnProperty(e)||mn.hasOwnProperty(e)}isExpandable(e){var t=this.macros.get(e);return null!=t?"string"==typeof t||"function"==typeof t||!t.unexpandable:sn.hasOwnProperty(e)&&!sn[e].primitive}}const fn=/^[\u208a\u208b\u208c\u208d\u208e\u2080\u2081\u2082\u2083\u2084\u2085\u2086\u2087\u2088\u2089\u2090\u2091\u2095\u1d62\u2c7c\u2096\u2097\u2098\u2099\u2092\u209a\u1d63\u209b\u209c\u1d64\u1d65\u2093\u1d66\u1d67\u1d68\u1d69\u1d6a]/,vn=Object.freeze({"₊":"+","₋":"-","₌":"=","₍":"(","₎":")","₀":"0","₁":"1","₂":"2","₃":"3","₄":"4","₅":"5","₆":"6","₇":"7","₈":"8","₉":"9","ₐ":"a","ₑ":"e","ₕ":"h","ᵢ":"i","ⱼ":"j","ₖ":"k","ₗ":"l","ₘ":"m","ₙ":"n","ₒ":"o","ₚ":"p","ᵣ":"r","ₛ":"s","ₜ":"t","ᵤ":"u","ᵥ":"v","ₓ":"x","ᵦ":"β","ᵧ":"γ","ᵨ":"ρ","ᵩ":"ϕ","ᵪ":"χ","⁺":"+","⁻":"-","⁼":"=","⁽":"(","⁾":")","⁰":"0","¹":"1","²":"2","³":"3","⁴":"4","⁵":"5","⁶":"6","⁷":"7","⁸":"8","⁹":"9","ᴬ":"A","ᴮ":"B","ᴰ":"D","ᴱ":"E","ᴳ":"G","ᴴ":"H","ᴵ":"I","ᴶ":"J","ᴷ":"K","ᴸ":"L","ᴹ":"M","ᴺ":"N","ᴼ":"O","ᴾ":"P","ᴿ":"R","ᵀ":"T","ᵁ":"U","ⱽ":"V","ᵂ":"W","ᵃ":"a","ᵇ":"b","ᶜ":"c","ᵈ":"d","ᵉ":"e","ᶠ":"f","ᵍ":"g","ʰ":"h","ⁱ":"i","ʲ":"j","ᵏ":"k","ˡ":"l","ᵐ":"m","ⁿ":"n","ᵒ":"o","ᵖ":"p","ʳ":"r","ˢ":"s","ᵗ":"t","ᵘ":"u","ᵛ":"v","ʷ":"w","ˣ":"x","ʸ":"y","ᶻ":"z","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),yn={"́":{text:"\\'",math:"\\acute"},"̀":{text:"\\`",math:"\\grave"},"̈":{text:'\\"',math:"\\ddot"},"̃":{text:"\\~",math:"\\tilde"},"̄":{text:"\\=",math:"\\bar"},"̆":{text:"\\u",math:"\\breve"},"̌":{text:"\\v",math:"\\check"},"̂":{text:"\\^",math:"\\hat"},"̇":{text:"\\.",math:"\\dot"},"̊":{text:"\\r",math:"\\mathring"},"̋":{text:"\\H"},"̧":{text:"\\c"}},bn={"á":"á","à":"à","ä":"ä","ǟ":"ǟ","ã":"ã","ā":"ā","ă":"ă","ắ":"ắ","ằ":"ằ","ẵ":"ẵ","ǎ":"ǎ","â":"â","ấ":"ấ","ầ":"ầ","ẫ":"ẫ","ȧ":"ȧ","ǡ":"ǡ","å":"å","ǻ":"ǻ","ḃ":"ḃ","ć":"ć","ḉ":"ḉ","č":"č","ĉ":"ĉ","ċ":"ċ","ç":"ç","ď":"ď","ḋ":"ḋ","ḑ":"ḑ","é":"é","è":"è","ë":"ë","ẽ":"ẽ","ē":"ē","ḗ":"ḗ","ḕ":"ḕ","ĕ":"ĕ","ḝ":"ḝ","ě":"ě","ê":"ê","ế":"ế","ề":"ề","ễ":"ễ","ė":"ė","ȩ":"ȩ","ḟ":"ḟ","ǵ":"ǵ","ḡ":"ḡ","ğ":"ğ","ǧ":"ǧ","ĝ":"ĝ","ġ":"ġ","ģ":"ģ","ḧ":"ḧ","ȟ":"ȟ","ĥ":"ĥ","ḣ":"ḣ","ḩ":"ḩ","í":"í","ì":"ì","ï":"ï","ḯ":"ḯ","ĩ":"ĩ","ī":"ī","ĭ":"ĭ","ǐ":"ǐ","î":"î","ǰ":"ǰ","ĵ":"ĵ","ḱ":"ḱ","ǩ":"ǩ","ķ":"ķ","ĺ":"ĺ","ľ":"ľ","ļ":"ļ","ḿ":"ḿ","ṁ":"ṁ","ń":"ń","ǹ":"ǹ","ñ":"ñ","ň":"ň","ṅ":"ṅ","ņ":"ņ","ó":"ó","ò":"ò","ö":"ö","ȫ":"ȫ","õ":"õ","ṍ":"ṍ","ṏ":"ṏ","ȭ":"ȭ","ō":"ō","ṓ":"ṓ","ṑ":"ṑ","ŏ":"ŏ","ǒ":"ǒ","ô":"ô","ố":"ố","ồ":"ồ","ỗ":"ỗ","ȯ":"ȯ","ȱ":"ȱ","ő":"ő","ṕ":"ṕ","ṗ":"ṗ","ŕ":"ŕ","ř":"ř","ṙ":"ṙ","ŗ":"ŗ","ś":"ś","ṥ":"ṥ","š":"š","ṧ":"ṧ","ŝ":"ŝ","ṡ":"ṡ","ş":"ş","ẗ":"ẗ","ť":"ť","ṫ":"ṫ","ţ":"ţ","ú":"ú","ù":"ù","ü":"ü","ǘ":"ǘ","ǜ":"ǜ","ǖ":"ǖ","ǚ":"ǚ","ũ":"ũ","ṹ":"ṹ","ū":"ū","ṻ":"ṻ","ŭ":"ŭ","ǔ":"ǔ","û":"û","ů":"ů","ű":"ű","ṽ":"ṽ","ẃ":"ẃ","ẁ":"ẁ","ẅ":"ẅ","ŵ":"ŵ","ẇ":"ẇ","ẘ":"ẘ","ẍ":"ẍ","ẋ":"ẋ","ý":"ý","ỳ":"ỳ","ÿ":"ÿ","ỹ":"ỹ","ȳ":"ȳ","ŷ":"ŷ","ẏ":"ẏ","ẙ":"ẙ","ź":"ź","ž":"ž","ẑ":"ẑ","ż":"ż","Á":"Á","À":"À","Ä":"Ä","Ǟ":"Ǟ","Ã":"Ã","Ā":"Ā","Ă":"Ă","Ắ":"Ắ","Ằ":"Ằ","Ẵ":"Ẵ","Ǎ":"Ǎ","Â":"Â","Ấ":"Ấ","Ầ":"Ầ","Ẫ":"Ẫ","Ȧ":"Ȧ","Ǡ":"Ǡ","Å":"Å","Ǻ":"Ǻ","Ḃ":"Ḃ","Ć":"Ć","Ḉ":"Ḉ","Č":"Č","Ĉ":"Ĉ","Ċ":"Ċ","Ç":"Ç","Ď":"Ď","Ḋ":"Ḋ","Ḑ":"Ḑ","É":"É","È":"È","Ë":"Ë","Ẽ":"Ẽ","Ē":"Ē","Ḗ":"Ḗ","Ḕ":"Ḕ","Ĕ":"Ĕ","Ḝ":"Ḝ","Ě":"Ě","Ê":"Ê","Ế":"Ế","Ề":"Ề","Ễ":"Ễ","Ė":"Ė","Ȩ":"Ȩ","Ḟ":"Ḟ","Ǵ":"Ǵ","Ḡ":"Ḡ","Ğ":"Ğ","Ǧ":"Ǧ","Ĝ":"Ĝ","Ġ":"Ġ","Ģ":"Ģ","Ḧ":"Ḧ","Ȟ":"Ȟ","Ĥ":"Ĥ","Ḣ":"Ḣ","Ḩ":"Ḩ","Í":"Í","Ì":"Ì","Ï":"Ï","Ḯ":"Ḯ","Ĩ":"Ĩ","Ī":"Ī","Ĭ":"Ĭ","Ǐ":"Ǐ","Î":"Î","İ":"İ","Ĵ":"Ĵ","Ḱ":"Ḱ","Ǩ":"Ǩ","Ķ":"Ķ","Ĺ":"Ĺ","Ľ":"Ľ","Ļ":"Ļ","Ḿ":"Ḿ","Ṁ":"Ṁ","Ń":"Ń","Ǹ":"Ǹ","Ñ":"Ñ","Ň":"Ň","Ṅ":"Ṅ","Ņ":"Ņ","Ó":"Ó","Ò":"Ò","Ö":"Ö","Ȫ":"Ȫ","Õ":"Õ","Ṍ":"Ṍ","Ṏ":"Ṏ","Ȭ":"Ȭ","Ō":"Ō","Ṓ":"Ṓ","Ṑ":"Ṑ","Ŏ":"Ŏ","Ǒ":"Ǒ","Ô":"Ô","Ố":"Ố","Ồ":"Ồ","Ỗ":"Ỗ","Ȯ":"Ȯ","Ȱ":"Ȱ","Ő":"Ő","Ṕ":"Ṕ","Ṗ":"Ṗ","Ŕ":"Ŕ","Ř":"Ř","Ṙ":"Ṙ","Ŗ":"Ŗ","Ś":"Ś","Ṥ":"Ṥ","Š":"Š","Ṧ":"Ṧ","Ŝ":"Ŝ","Ṡ":"Ṡ","Ş":"Ş","Ť":"Ť","Ṫ":"Ṫ","Ţ":"Ţ","Ú":"Ú","Ù":"Ù","Ü":"Ü","Ǘ":"Ǘ","Ǜ":"Ǜ","Ǖ":"Ǖ","Ǚ":"Ǚ","Ũ":"Ũ","Ṹ":"Ṹ","Ū":"Ū","Ṻ":"Ṻ","Ŭ":"Ŭ","Ǔ":"Ǔ","Û":"Û","Ů":"Ů","Ű":"Ű","Ṽ":"Ṽ","Ẃ":"Ẃ","Ẁ":"Ẁ","Ẅ":"Ẅ","Ŵ":"Ŵ","Ẇ":"Ẇ","Ẍ":"Ẍ","Ẋ":"Ẋ","Ý":"Ý","Ỳ":"Ỳ","Ÿ":"Ÿ","Ỹ":"Ỹ","Ȳ":"Ȳ","Ŷ":"Ŷ","Ẏ":"Ẏ","Ź":"Ź","Ž":"Ž","Ẑ":"Ẑ","Ż":"Ż","ά":"ά","ὰ":"ὰ","ᾱ":"ᾱ","ᾰ":"ᾰ","έ":"έ","ὲ":"ὲ","ή":"ή","ὴ":"ὴ","ί":"ί","ὶ":"ὶ","ϊ":"ϊ","ΐ":"ΐ","ῒ":"ῒ","ῑ":"ῑ","ῐ":"ῐ","ό":"ό","ὸ":"ὸ","ύ":"ύ","ὺ":"ὺ","ϋ":"ϋ","ΰ":"ΰ","ῢ":"ῢ","ῡ":"ῡ","ῠ":"ῠ","ώ":"ώ","ὼ":"ὼ","Ύ":"Ύ","Ὺ":"Ὺ","Ϋ":"Ϋ","Ῡ":"Ῡ","Ῠ":"Ῠ","Ώ":"Ώ","Ὼ":"Ὼ"};class wn{constructor(e,t){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new gn(e,t,this.mode),this.settings=t,this.leftrightDepth=0}expect(e,t){if(void 0===t&&(t=!0),this.fetch().text!==e)throw new _("Expected '"+e+"', got '"+this.fetch().text+"'",this.fetch());t&&this.consume()}consume(){this.nextToken=null}fetch(){return null==this.nextToken&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(e){this.mode=e,this.gullet.switchMode(e)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var e=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),e}finally{this.gullet.endGroups()}}subparse(e){var t=this.nextToken,e=(this.consume(),this.gullet.pushToken(new vi("}")),this.gullet.pushTokens(e),this.parseExpression(!1));return this.expect("}"),this.nextToken=t,e}parseExpression(e,t){for(var i=[];;){"math"===this.mode&&this.consumeSpaces();var n=this.fetch();if(-1!==wn.endOfExpression.indexOf(n.text))break;if(t&&n.text===t)break;if(e&&sn[n.text]&&sn[n.text].infix)break;n=this.parseAtom(t);if(!n)break;"internal"!==n.type&&i.push(n)}return"text"===this.mode&&this.formLigatures(i),this.handleInfixNodes(i)}handleInfixNodes(t){let i,n=-1;for(let e=0;e<t.length;e++)if("infix"===t[e].type){if(-1!==n)throw new _("only one infix operator per group",t[e].token);n=e,i=t[e].replaceWith}var e,r;return-1!==n&&i?(e=t.slice(0,n),r=t.slice(n+1),e=1===e.length&&"ordgroup"===e[0].type?e[0]:{type:"ordgroup",mode:this.mode,body:e},r=1===r.length&&"ordgroup"===r[0].type?r[0]:{type:"ordgroup",mode:this.mode,body:r},["\\\\abovefrac"===i?this.callFunction(i,[e,t[n],r],[]):this.callFunction(i,[e,r],[])]):t}handleSupSubscript(e){var t=this.fetch(),i=t.text,e=(this.consume(),this.consumeSpaces(),this.parseGroup(e));if(e)return e;throw new _("Expected group after '"+i+"'",t)}formatUnsupportedCmd(t){var i=[];for(let e=0;e<t.length;e++)i.push({type:"textord",mode:"text",text:t[e]});var e={type:"text",mode:this.mode,body:i};return{type:"color",mode:this.mode,color:this.settings.errorColor,body:[e]}}parseAtom(e){const t=this.parseGroup("atom",e);if("text"===this.mode)return t;let i,n;for(;;){this.consumeSpaces();const e=this.fetch();if("\\limits"===e.text||"\\nolimits"===e.text){if(t&&"op"===t.type){const i="\\limits"===e.text;t.limits=i,t.alwaysHandleSupSub=!0}else{if(!t||"operatorname"!==t.type)throw new _("Limit controls must follow a math operator",e);t.alwaysHandleSupSub&&(t.limits="\\limits"===e.text)}this.consume()}else if("^"===e.text){if(i)throw new _("Double superscript",e);i=this.handleSupSubscript("superscript")}else if("_"===e.text){if(n)throw new _("Double subscript",e);n=this.handleSupSubscript("subscript")}else if("'"===e.text){if(i)throw new _("Double superscript",e);const t={type:"textord",mode:this.mode,text:"\\prime"},n=[t];for(this.consume();"'"===this.fetch().text;)n.push(t),this.consume();"^"===this.fetch().text&&n.push(this.handleSupSubscript("superscript")),i={type:"ordgroup",mode:this.mode,body:n}}else{if(!vn[e.text])break;{const t=fn.test(e.text),_=[];for(_.push(new vi(vn[e.text])),this.consume();;){const e=this.fetch().text;if(!vn[e])break;if(fn.test(e)!==t)break;_.unshift(new vi(vn[e])),this.consume()}var r=this.subparse(_);t?n={type:"ordgroup",mode:"math",body:r}:i={type:"ordgroup",mode:"math",body:r}}}}return i||n?{type:"supsub",mode:this.mode,base:t,sup:i,sub:n}:t}parseFunction(e,t){var i=this.fetch(),n=i.text,r=sn[n];if(!r)return null;if(this.consume(),t&&"atom"!==t&&!r.allowedInArgument)throw new _("Got function '"+n+"' with no arguments"+(t?" as "+t:""),i);if("text"===this.mode&&!r.allowedInText)throw new _("Can't use function '"+n+"' in text mode",i);if("math"===this.mode&&!1===r.allowedInMath)throw new _("Can't use function '"+n+"' in math mode",i);var{args:t,optArgs:r}=this.parseArguments(n,r);return this.callFunction(n,t,r,i,e)}callFunction(e,t,i,n,r){var s=sn[e];if(s&&s.handler)return s.handler({funcName:e,parser:this,token:n,breakOnTokenText:r},t,i);throw new _("No function handler for "+e)}parseArguments(i,n){var e=n.numArgs+n.numOptionalArgs;if(0===e)return{args:[],optArgs:[]};var r=[],s=[];for(let t=0;t<e;t++){let e=n.argTypes&&n.argTypes[t];var o=t<n.numOptionalArgs,a=((n.primitive&&null==e||"sqrt"===n.type&&1===t&&null==s[0])&&(e="primitive"),this.parseGroupOfType("argument to '"+i+"'",e,o));if(o)s.push(a);else{if(null==a)throw new _("Null argument, please report this as a bug");r.push(a)}}return{args:r,optArgs:s}}parseGroupOfType(e,t,i){switch(t){case"color":return this.parseColorGroup(i);case"size":return this.parseSizeGroup(i);case"url":return this.parseUrlGroup(i);case"math":case"text":return this.parseArgumentGroup(i,t);case"hbox":{const e=this.parseArgumentGroup(i,"text");return null!=e?{type:"styling",mode:e.mode,body:[e],style:"text"}:null}case"raw":{const e=this.parseStringGroup("raw",i);return null!=e?{type:"raw",mode:"text",string:e.text}:null}case"primitive":{if(i)throw new _("A primitive argument cannot be optional");const t=this.parseGroup(e);if(null==t)throw new _("Expected group as "+e,this.fetch());return t}case"original":case null:case void 0:return this.parseArgumentGroup(i);default:throw new _("Unknown group type as "+e,this.fetch())}}consumeSpaces(){for(;" "===this.fetch().text;)this.consume()}parseStringGroup(e,t){t=this.gullet.scanArgument(t);if(null==t)return null;let i,n="";for(;"EOF"!==(i=this.fetch()).text;)n+=i.text,this.consume();return this.consume(),t.text=n,t}parseRegexGroup(e,t){var i=this.fetch();let n,r=i,s="";for(;"EOF"!==(n=this.fetch()).text&&e.test(s+n.text);)r=n,s+=r.text,this.consume();if(""===s)throw new _("Invalid "+t+": '"+i.text+"'",i);return i.range(r,s)}parseColorGroup(e){e=this.parseStringGroup("color",e);if(null==e)return null;var t=/^(#[a-f0-9]{3}|#?[a-f0-9]{6}|[a-z]+)$/i.exec(e.text);if(!t)throw new _("Invalid color: '"+e.text+"'",e);let i=t[0];return/^[0-9a-f]{6}$/i.test(i)&&(i="#"+i),{type:"color-token",mode:this.mode,color:i}}parseSizeGroup(e){let t,i=!1;if(this.gullet.consumeSpaces(),!(t=e||"{"===this.gullet.future().text?this.parseStringGroup("size",e):this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/,"size")))return null;e||0!==t.text.length||(t.text="0pt",i=!0);e=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(t.text);if(!e)throw new _("Invalid size: '"+t.text+"'",t);e={number:+(e[1]+e[2]),unit:e[3]};if(pe(e))return{type:"size",mode:this.mode,value:e,isBlank:i};throw new _("Invalid unit: '"+e.unit+"'",t)}parseUrlGroup(e){this.gullet.lexer.setCatcode("%",13),this.gullet.lexer.setCatcode("~",12);var e=this.parseStringGroup("url",e);return this.gullet.lexer.setCatcode("%",14),this.gullet.lexer.setCatcode("~",13),null==e?null:(e=e.text.replace(/\\([#$%&~_^{}])/g,"$1"),{type:"url",mode:this.mode,url:e})}parseArgumentGroup(e,t){var i,n,e=this.gullet.scanArgument(e);return null==e?null:(i=this.mode,t&&this.switchMode(t),this.gullet.beginGroup(),n=this.parseExpression(!1,"EOF"),this.expect("EOF"),this.gullet.endGroup(),e={type:"ordgroup",mode:this.mode,loc:e.loc,body:n},t&&this.switchMode(i),e)}parseGroup(e,t){var i=this.fetch(),n=i.text;let r;if("{"===n||"\\begingroup"===n){this.consume();const e="{"===n?"}":"\\endgroup",t=(this.gullet.beginGroup(),this.parseExpression(!1,e)),_=this.fetch();this.expect(e),this.gullet.endGroup(),r={type:"ordgroup",mode:this.mode,loc:fi.range(i,_),body:t,semisimple:"\\begingroup"===n||void 0}}else if(null==(r=this.parseFunction(t,e)||this.parseSymbol())&&"\\"===n[0]&&!mn.hasOwnProperty(n)){if(this.settings.throwOnError)throw new _("Undefined control sequence: "+n,i);r=this.formatUnsupportedCmd(n),this.consume()}return r}formLigatures(t){let i=t.length-1;for(let e=0;e<i;++e){var n=t[e],r=n.text;"-"===r&&"-"===t[e+1].text&&(e+1<i&&"-"===t[e+2].text?(t.splice(e,3,{type:"textord",mode:"text",loc:fi.range(n,t[e+2]),text:"---"}),i-=2):(t.splice(e,2,{type:"textord",mode:"text",loc:fi.range(n,t[e+1]),text:"--"}),--i)),"'"!==r&&"`"!==r||t[e+1].text!==r||(t.splice(e,2,{type:"textord",mode:"text",loc:fi.range(n,t[e+1]),text:r+r}),--i)}}parseSymbol(){const t=this.fetch();let i=t.text;if(/^\\verb[^a-zA-Z]/.test(i)){this.consume();let e=i.slice(5);const n="*"===e.charAt(0);if((e=n?e.slice(1):e).length<2||e.charAt(0)!==e.slice(-1))throw new _("\\verb assertion failed --\n please report what input caused this bug");return{type:"verb",mode:"text",body:e=e.slice(1,-1),star:n}}bn.hasOwnProperty(i[0])&&!d[this.mode][i[0]]&&(this.settings.strict&&"math"===this.mode&&this.settings.reportNonstrict("unicodeTextInMathMode",'Accented Unicode text character "'+i[0]+'" used in math mode',t),i=bn[i[0]]+i.slice(1));const n=on.exec(i);let r;if(n&&("i"===(i=i.substring(0,n.index))?i="ı":"j"===i&&(i="ȷ")),d[this.mode][i]){this.settings.strict&&"math"===this.mode&&0<="ÐÞþ".indexOf(i)&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+i[0]+'" used in math mode',t);const n=d[this.mode][i].group,_=fi.range(t);let e;if(Ee.hasOwnProperty(n)){const t=n;e={type:"atom",mode:this.mode,family:t,loc:_,text:i}}else e={type:n,mode:this.mode,loc:_,text:i};r=e}else{if(!(128<=i.charCodeAt(0)))return null;this.settings.strict&&(ee(i.charCodeAt(0))?"math"===this.mode&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+i[0]+'" used in math mode',t):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+i[0]+'" ('+i.charCodeAt(0)+")",t)),r={type:"textord",mode:"text",loc:fi.range(t),text:i}}if(this.consume(),n)for(let e=0;e<n[0].length;e++){var s=n[0][e];if(!yn[s])throw new _("Unknown accent ' "+s+"'",t);var o=yn[s][this.mode]||yn[s].text;if(!o)throw new _("Accent "+s+" unsupported in "+this.mode+" mode",t);r={type:"accent",mode:this.mode,loc:fi.range(t),label:o,isStretchy:!1,isShifty:!0,base:r}}return r}}wn.endOfExpression=["}","\\endgroup","\\end","\\right","&"];function xn(e,t){if(!("string"==typeof e||e instanceof String))throw new TypeError("KaTeX can only parse string typed expression");delete(e=new wn(e,t)).gullet.macros.current["\\df@tag"];let i=e.parse();if(delete e.gullet.macros.current["\\current@color"],delete e.gullet.macros.current["\\color"],e.gullet.macros.get("\\df@tag")){if(!t.displayMode)throw new _("\\tag works only in display equations");i=[{type:"tag",mode:"text",body:i,tag:e.subparse([new vi("\\df@tag")])}]}return i}let Sn=function(e,t,i){t.textContent="";e=kn(e,i).toNode();t.appendChild(e)};"undefined"!=typeof document&&"CSS1Compat"!==document.compatMode&&("undefined"!=typeof console&&console.warn("Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype."),Sn=function(){throw new _("KaTeX doesn't work in quirks mode.")});function An(e,t,i){if(!i.throwOnError&&e instanceof _)return(t=R.makeSpan(["katex-error"],[new m(t)])).setAttribute("title",e.toString()),t.setAttribute("style","color:"+i.errorColor),t;throw e}function kn(t,i){var n=new W(i);try{const i=xn(t,n);{var r=i;var s=t;var o=n;var a=xt(o);let e;if("mathml"===o.output)return wt(r,s,a,o.displayMode,!0);if("html"===o.output){const s=pt(r,a);e=R.makeSpan(["katex"],[s])}else{s=wt(r,s,a,o.displayMode,!1),r=pt(r,a);e=R.makeSpan(["katex"],[s,r])}return St(e,o);return}}catch(i){return An(i,t,n)}}var _n={version:"0.16.10",render:Sn,renderToString:function(e,t){return kn(e,t).toMarkup()},ParseError:_,SETTINGS_SCHEMA:U,__parse:function(e,t){t=new W(t);return xn(e,t)},__renderToDomTree:kn,__renderToHTMLTree:function(e,t){var i=new W(t);try{var n=xn(e,i),r=i;return n=pt(n,xt(r)),n=R.makeSpan(["katex"],[n]),St(n,r)}catch(t){return An(t,e,i)}},__setFontMetrics:function(e,t){ne[e]=t},__defineSymbol:i,__defineFunction:w,__defineMacro:P,__domTree:{Span:we,Anchor:xe,SymbolNode:m,SvgNode:ke,PathNode:_e,LineNode:Ce}};return t.default}),!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("katex")):"function"==typeof define&&define.amd?define(["katex"],t):"object"==typeof exports?exports.renderMathInElement=t(require("katex")):e.renderMathInElement=t(e.katex)}("undefined"!=typeof self?self:this,function(c){return function(){"use strict";var i={771:function(e){e.exports=c}},n={};function r(e){var t=n[e];return void 0!==t||(t=n[e]={exports:{}},i[e](t,t.exports,r)),t.exports}r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(e,t){for(var i in t)r.o(t,i)&&!r.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};var e={};{r.d(e,{default:function(){return s}});var t=r(771),o=r.n(t);const a=/^\\begin{/,l=function(e,i){var n=function(t,e){var i;const n=[],r=new RegExp("("+e.map(e=>e.left.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")).join("|")+")");for(;-1!==(i=t.search(r));){0<i&&(n.push({type:"text",data:t.slice(0,i)}),t=t.slice(i));const r=e.findIndex(e=>t.startsWith(e.left));if(-1===(i=function(e,t,i){let n=i,r=0;for(var s=e.length;n<t.length;){const i=t[n];if(r<=0&&t.slice(n,n+s)===e)return n;"\\"===i?n++:"{"===i?r++:"}"===i&&r--,n++}return-1}(e[r].right,t,e[r].left.length)))break;var s=t.slice(0,i+e[r].right.length),o=a.test(s)?s:t.slice(e[r].left.length,i);n.push({type:"math",data:o,rawData:s,display:e[r].display}),t=t.slice(i+e[r].right.length)}return""!==t&&n.push({type:"text",data:t}),n}(e,i.delimiters);if(1===n.length&&"text"===n[0].type)return null;var r=document.createDocumentFragment();for(let t=0;t<n.length;t++)if("text"===n[t].type)r.appendChild(document.createTextNode(n[t].data));else{var s=document.createElement("span");let e=n[t].data;i.displayMode=n[t].display;try{i.preProcess&&(e=i.preProcess(e)),o().render(e,s,i)}catch(e){if(!(e instanceof o().ParseError))throw e;i.errorCallback("KaTeX auto-render: Failed to parse `"+n[t].data+"` with ",e),r.appendChild(document.createTextNode(n[t].rawData));continue}r.appendChild(s)}return r},h=function(r,s){for(let n=0;n<r.childNodes.length;n++){var o=r.childNodes[n];if(3===o.nodeType){let e=o.textContent,t=o.nextSibling,i=0;for(;t&&t.nodeType===Node.TEXT_NODE;)e+=t.textContent,t=t.nextSibling,i++;const h=l(e,s);if(h){for(let e=0;e<i;e++)o.nextSibling.remove();n+=h.childNodes.length-1,r.replaceChild(h,o)}else n+=i}else if(1===o.nodeType){const r=" "+o.className+" ";-1===s.ignoredTags.indexOf(o.nodeName.toLowerCase())&&s.ignoredClasses.every(e=>-1===r.indexOf(" "+e+" "))&&h(o,s)}}};var s=function(e,t){if(!e)throw new Error("No element provided to render");var i={};for(const e in t)t.hasOwnProperty(e)&&(i[e]=t[e]);i.delimiters=i.delimiters||[{left:"$$",right:"$$",display:!0},{left:"\\(",right:"\\)",display:!1},{left:"\\begin{equation}",right:"\\end{equation}",display:!0},{left:"\\begin{align}",right:"\\end{align}",display:!0},{left:"\\begin{alignat}",right:"\\end{alignat}",display:!0},{left:"\\begin{gather}",right:"\\end{gather}",display:!0},{left:"\\begin{CD}",right:"\\end{CD}",display:!0},{left:"\\[",right:"\\]",display:!0}],i.ignoredTags=i.ignoredTags||["script","noscript","style","textarea","pre","code","option"],i.ignoredClasses=i.ignoredClasses||[],i.errorCallback=i.errorCallback||console.error,i.macros=i.macros||{},h(e,i)}}return e.default}()}),!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("katex")):"function"==typeof define&&define.amd?define(["katex"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).markedKatex=t(e.katex)}(this,function(n){"use strict";const r=/^(\${1,2})(?!\$)((?:\\.|[^\\\n])*?(?:\\.|[^\\\n\$]))\1(?=[\s?!\.,:?!。,:]|$)/,i=/^(\${1,2})\n((?:\\[^]|[^\\])+?)\n\1(?:\n|$)/;function t(t,i){return e=>n.renderToString(e.text,{...t,displayMode:e.displayMode})+(i?"\n":"")}return function(e={}){return{extensions:[{name:"inlineKatex",level:"inline",start(e){let t,i=e;for(;i;){if(-1===(t=i.indexOf("$")))return;if((0===t||" "===i.charAt(t-1))&&i.substring(t).match(r))return t;i=i.substring(t+1).replace(/^\$+/,"")}},tokenizer(e,t){e=e.match(r);if(e)return{type:"inlineKatex",raw:e[0],text:e[2].trim(),displayMode:2===e[1].length}},renderer:t(e,!1)},{name:"blockKatex",level:"block",tokenizer(e,t){e=e.match(i);if(e)return{type:"blockKatex",raw:e[0],text:e[2].trim(),displayMode:2===e[1].length}},renderer:t(e,!0)}]}}}),"undefined"!=typeof window&&(window.markedMermaid=markedMermaid),"undefined"!=typeof module&&module.exports&&(module.exports=markedMermaid),!function(){function e(e){return e}function t(i){return function(e){var t=h("img",["image-output"]);return t.src="data:image/"+i+";base64,"+d(e).replace(/\n/g,""),t}}function i(){var t=this,e=u.display_priority.filter(function(e){return(t.raw.data||t.raw)[e]})[0];return e&&u.display[e]?u.display[e](t.raw[e]||t.raw.data[e]):h("div",["empty-output"])}function n(){var e=h("pre",["pyerr"]),t=this.raw.traceback.join("\n");return e.innerHTML=u.highlighter(u.ansi(c(t)),e),e}var r,s,o,a=this,l=void 0!==a.window,h=(s=(l?a:(r=new(require("jsdom").JSDOM)).window).document,function(e,t){e=s.createElement(e);return e.className=(t||[]).map(function(e){return u.prefix+e}).join(" "),e}),c=function(e){return e.replace(/</g,"&lt;").replace(/>/g,"&gt;")},d=function(e){return e.join?e.map(d).join(""):e},u={prefix:"nb-",markdown:(o=a.marked||"function"==typeof require&&require("marked"))&&o.parse||e,ansi:(o=a.ansi_up||"function"==typeof require&&require("ansi_up"))&&o.ansi_to_html||e,sanitizer:(o=a.DOMPurify||"function"==typeof require&&require("dompurify"),(l?o&&o.sanitize:o(r.window).sanitize)||e),highlighter:e,VERSION:"0.7.0",Input:function(e,t){this.raw=e,this.cell=t}},p=(u.Input.prototype.render=function(){var e,t,i,n;return this.raw.length?(e=h("div",["input"]),"number"==typeof(n=this.cell).number&&e.setAttribute("data-prompt-number",this.cell.number),t=h("pre"),i=h("code"),n=n.worksheet.notebook.metadata,n=this.cell.raw.language||n.language||n.kernelspec&&n.kernelspec.language||n.language_info&&n.language_info.name,i.setAttribute("data-language",n),i.className="lang-"+n,i.innerHTML=u.highlighter(c(d(this.raw)),t,i,n),t.appendChild(i),e.appendChild(t),this.el=e):h("div")},u.display={},u.display.text=function(e){var t=h("pre",["text-output"]);return t.innerHTML=u.highlighter(u.ansi(d(e)),t),t},u.display["text/plain"]=u.display.text,u.display.html=function(e){var t=h("div",["html-output"]);return t.innerHTML=u.sanitizer(d(e)),t},u.display["text/html"]=u.display.html,u.display.marked=function(e){return u.display.html(u.markdown(d(e)))},u.display["text/markdown"]=u.display.marked,u.display.svg=function(e){var t=h("div",["svg-output"]);return t.innerHTML=d(e),t},u.display["text/svg+xml"]=u.display.svg,u.display["image/svg+xml"]=u.display.svg,u.display.latex=function(e){var t=h("div",["latex-output"]);return t.innerHTML=d(e),t},u.display["text/latex"]=u.display.latex,u.display.javascript=function(e){var t=h("script");return t.innerHTML=d(e),t},u.display["application/javascript"]=u.display.javascript,u.display.png=t("png"),u.display["image/png"]=u.display.png,u.display.jpeg=t("jpeg"),u.display["image/jpeg"]=u.display.jpeg,u.display_priority=["png","image/png","jpeg","image/jpeg","svg","image/svg+xml","text/svg+xml","html","text/html","text/markdown","latex","text/latex","javascript","application/javascript","text","text/plain"],u.Output=function(e,t){this.raw=e,this.cell=t,this.type=e.output_type},u.Output.prototype.renderers={display_data:i,execute_result:i,pyout:i,pyerr:n,error:n,stream:function(){var e=h("pre",[this.raw.stream||this.raw.name]),t=d(this.raw.text);return e.innerHTML=u.highlighter(u.ansi(c(t)),e),e}},u.Output.prototype.render=function(){var e=h("div",["output"]),t=("number"==typeof this.cell.number&&e.setAttribute("data-prompt-number",this.cell.number),this.renderers[this.type].call(this));return e.appendChild(t),this.el=e},u.coalesceStreams=function(e){var t,i;return e.length?(t=e[0],i=[t],e.slice(1).forEach(function(e){"stream"===e.raw.output_type&&"stream"===t.raw.output_type&&e.raw.stream===t.raw.stream&&e.raw.name===t.raw.name?t.raw.text=t.raw.text.concat(e.raw.text):(i.push(e),t=e)}),i):e},[{left:"$$",right:"$$",display:!0},{left:"\\[",right:"\\]",display:!0},{left:"\\(",right:"\\)",display:!(u.Cell=function(e,t){var i=this;i.raw=e,i.worksheet=t,i.type=e.cell_type,"code"===i.type&&(i.number=-1<e.prompt_number?e.prompt_number:e.execution_count,t=e.input||[e.source],i.input=new u.Input(t,i),e=(i.raw.outputs||[]).map(function(e){return new u.Output(e,i)}),i.outputs=u.coalesceStreams(e))})},{left:"$",right:"$",display:!1}]);u.Cell.prototype.renderers={markdown:function(){var e=h("div",["cell","markdown-cell"]),t=d(this.raw.source);return null!=a.renderMathInElement?(e.innerHTML=u.sanitizer(t),a.renderMathInElement(e,{delimiters:p}),e.innerHTML=u.sanitizer(u.markdown(e.innerHTML.replace(/&gt;/g,">")))):e.innerHTML=u.sanitizer(u.markdown(t)),e},heading:function(){var e=h("h"+this.raw.level,["cell","heading-cell"]);return e.innerHTML=u.sanitizer(d(this.raw.source)),e},raw:function(){var e=h("div",["cell","raw-cell"]);return e.innerHTML=c(d(this.raw.source)),e},code:function(){var t=h("div",["cell","code-cell"]);t.appendChild(this.input.render()),this.outputs.forEach(function(e){t.appendChild(e.render())});return t}},u.Cell.prototype.render=function(){var e=this.renderers[this.type].call(this);return this.el=e},u.Worksheet=function(e,t){var i=this;this.raw=e,this.notebook=t,this.cells=e.cells.map(function(e){return new u.Cell(e,i)}),this.render=function(){var t=h("div",["worksheet"]);return i.cells.forEach(function(e){t.appendChild(e.render())}),this.el=t}},u.Notebook=function(e,t){var i=this,t=(this.raw=e,this.config=t,this.metadata=e.metadata||{}),t=(this.title=t.title||t.name,e.worksheets||[{cells:e.cells}]);this.worksheets=t.map(function(e){return new u.Worksheet(e,i)}),this.sheet=this.worksheets[0]},u.Notebook.prototype.render=function(){var t=h("div",["notebook"]);return this.worksheets.forEach(function(e){t.appendChild(e.render())}),this.el=t},u.parse=function(e,t){return new u.Notebook(e,t)},"function"==typeof define&&define.amd&&define(function(){return u}),"undefined"!=typeof exports?(exports="undefined"!=typeof module&&module.exports?module.exports=u:exports).nb=u:a.nb=u}.call(this);var Org=function(){var e={},n={rules:{},define:function(t,e){this.rules[t]=e,this["is"+t.substring(0,1).toUpperCase()+t.substring(1)]=function(e){return this.rules[t].exec(e)}}};function r(){}function s(e){this.stream=e,this.tokenStack=[]}function o(e,t){if(this.type=e,this.children=[],t)for(var i=0,n=t.length;i<n;++i)this.appendChild(t[i])}n.define("header",/^(\*+)\s+(.*)$/),n.define("preformatted",/^(\s*):(?: (.*)$|$)/),n.define("unorderedListElement",/^(\s*)(?:-|\+|\s+\*)\s+(.*)$/),n.define("orderedListElement",/^(\s*)(\d+)(?:\.|\))\s+(.*)$/),n.define("tableSeparator",/^(\s*)\|((?:\+|-)*?)\|?$/),n.define("tableRow",/^(\s*)\|(.*?)\|?$/),n.define("blank",/^$/),n.define("horizontalRule",/^(\s*)-{5,}$/),n.define("directive",/^(\s*)#\+(?:(begin|end)_)?(.*)$/i),n.define("comment",/^(\s*)#(.*)$/),n.define("line",/^(\s*)(.*)$/),r.prototype={isListElement:function(){return this.type===s.tokens.orderedListElement||this.type===s.tokens.unorderedListElement},isTableElement:function(){return this.type===s.tokens.tableSeparator||this.type===s.tokens.tableRow}},s.prototype={tokenize:function(e){var t=new r;if(t.fromLineNumber=this.stream.lineNumber,n.isHeader(e))t.type=s.tokens.header,t.indentation=0,t.content=RegExp.$2,t.level=RegExp.$1.length;else if(n.isPreformatted(e))t.type=s.tokens.preformatted,t.indentation=RegExp.$1.length,t.content=RegExp.$2;else if(n.isUnorderedListElement(e))t.type=s.tokens.unorderedListElement,t.indentation=RegExp.$1.length,t.content=RegExp.$2;else if(n.isOrderedListElement(e))t.type=s.tokens.orderedListElement,t.indentation=RegExp.$1.length,t.content=RegExp.$3,t.number=RegExp.$2;else if(n.isTableSeparator(e))t.type=s.tokens.tableSeparator,t.indentation=RegExp.$1.length,t.content=RegExp.$2;else if(n.isTableRow(e))t.type=s.tokens.tableRow,t.indentation=RegExp.$1.length,t.content=RegExp.$2;else if(n.isBlank(e))t.type=s.tokens.blank,t.indentation=0,t.content=null;else if(n.isHorizontalRule(e))t.type=s.tokens.horizontalRule,t.indentation=RegExp.$1.length,t.content=null;else if(n.isDirective(e)){t.type=s.tokens.directive,t.indentation=RegExp.$1.length,t.content=RegExp.$3;var i=RegExp.$2;/^begin/i.test(i)?t.beginDirective=!0:/^end/i.test(i)?t.endDirective=!0:t.oneshotDirective=!0}else{if(n.isComment(e))t.type=s.tokens.comment;else{if(!n.isLine(e))throw new Error("SyntaxError: Unknown line: "+e);t.type=s.tokens.line}t.indentation=RegExp.$1.length,t.content=RegExp.$2}return t},pushToken:function(e){this.tokenStack.push(e)},pushDummyTokenByType:function(e){var t=new r;t.type=e,this.tokenStack.push(t)},peekStackedToken:function(){return 0<this.tokenStack.length?this.tokenStack[this.tokenStack.length-1]:null},getStackedToken:function(){return 0<this.tokenStack.length?this.tokenStack.pop():null},peekNextToken:function(){return this.peekStackedToken()||this.tokenize(this.stream.peekNextLine())},getNextToken:function(){return this.getStackedToken()||this.tokenize(this.stream.getNextLine())},hasNext:function(){return this.stream.hasNext()},getLineNumber:function(){return this.stream.lineNumber}},s.tokens={},["header","orderedListElement","unorderedListElement","tableRow","tableSeparator","preformatted","line","horizontalRule","blank","directive","comment"].forEach(function(e,t){s.tokens[e]=t}),void 0!==e&&(e.Lexer=s),o.prototype={previousSibling:null,parent:null,get firstChild(){return this.children.length<1?null:this.children[0]},get lastChild(){return this.children.length<1?null:this.children[this.children.length-1]},appendChild:function(e){var t=this.children.length<1?null:this.lastChild;this.children.push(e),e.previousSibling=t,e.parent=this},toString:function(){var e="<"+this.type+">";return void 0!==this.value?e+=" "+this.value:this.children&&(e+="\n"+this.children.map(function(e,t){return"#"+t+" "+e.toString()}).join("\n").split("\n").map(function(e){return" "+e}).join("\n")),e}};var u={types:{},define:function(i,n){var e="create"+(this.types[i]=i).substring(0,1).toUpperCase()+i.substring(1),r="function"==typeof n;this[e]=function(e,t){e=new o(i,e);return r&&n(e,t||{}),e}}};function a(e){this.sequences=e.split(/\r?\n/),this.totalLines=this.sequences.length,this.lineNumber=0}function l(){this.inlineParser=new t}function t(){this.preEmphasis=" \t\\('\"",this.postEmphasis="- \t.,:!?;'\"\\)",this.borderForbidden=" \t\r\n,\"'",this.bodyRegexp="[\\s\\S]*?",this.markers="*/_=~+",this.emphasisPattern=this.buildEmphasisPattern(),this.linkPattern=/\[\[([^\]]*)\](?:\[([^\]]*)\])?\]/g}function i(){}function h(e,t){this.initialize(e,t),this.result=this.convert()}return u.define("text",function(e,t){e.value=t.value}),u.define("header",function(e,t){e.level=t.level}),u.define("orderedList"),u.define("unorderedList"),u.define("definitionList"),u.define("listElement"),u.define("paragraph"),u.define("preformatted"),u.define("table"),u.define("tableRow"),u.define("tableCell"),u.define("horizontalRule"),u.define("directive"),u.define("inlineContainer"),u.define("bold"),u.define("italic"),u.define("underline"),u.define("code"),u.define("verbatim"),u.define("dashed"),u.define("link",function(e,t){e.src=t.src}),void 0!==e&&(e.Node=u),a.prototype.peekNextLine=function(){return this.hasNext()?this.sequences[this.lineNumber]:null},a.prototype.getNextLine=function(){return this.hasNext()?this.sequences[this.lineNumber++]:null},a.prototype.hasNext=function(){return this.lineNumber<this.totalLines},void 0!==e&&(e.Stream=a),l.parseStream=function(e,t){var i=new l;return i.initStatus(e,t),i.parseNodes(),i.nodes},(l.prototype={initStatus:function(e,t){if("string"==typeof e&&(e=new a(e)),this.lexer=new s(e),this.nodes=[],this.options={toc:!0,num:!0,"^":"{}",multilineCell:!1},t&&"object"==typeof t)for(var i in t)this.options[i]=t[i];this.document={options:this.options,convert:function(e,t){return new e(this,t).result}}},parse:function(e,t){return this.initStatus(e,t),this.parseDocument(),this.document.nodes=this.nodes,this.document},createErrorReport:function(e){return new Error(e+" at line "+this.lexer.getLineNumber())},skipBlank:function(){for(var e=null;this.lexer.peekNextToken().type===s.tokens.blank;)e=this.lexer.getNextToken();return e},setNodeOriginFromToken:function(e,t){return e.fromLineNumber=t.fromLineNumber,e},appendNode:function(e){var t=0<this.nodes.length?this.nodes[this.nodes.length-1]:null;this.nodes.push(e),e.previousSibling=t},parseDocument:function(){this.parseTitle(),this.parseNodes()},parseNodes:function(){for(;this.lexer.hasNext();){var e=this.parseElement();e&&this.appendNode(e)}},parseTitle:function(){this.skipBlank(),this.lexer.hasNext()&&this.lexer.peekNextToken().type===s.tokens.line?this.document.title=this.createTextNode(this.lexer.getNextToken().content):this.document.title=null,this.lexer.pushDummyTokenByType(s.tokens.blank)},parseElement:function(){var e=null;switch(this.lexer.peekNextToken().type){case s.tokens.header:e=this.parseHeader();break;case s.tokens.preformatted:e=this.parsePreformatted();break;case s.tokens.orderedListElement:case s.tokens.unorderedListElement:e=this.parseList();break;case s.tokens.line:e=this.parseText();break;case s.tokens.tableRow:case s.tokens.tableSeparator:e=this.parseTable();break;case s.tokens.blank:this.skipBlank(),this.lexer.hasNext()&&(e=this.lexer.peekNextToken().type===s.tokens.line?this.parseParagraph():this.parseElement());break;case s.tokens.horizontalRule:this.lexer.getNextToken(),e=u.createHorizontalRule();break;case s.tokens.directive:e=this.parseDirective();break;case s.tokens.comment:this.lexer.getNextToken();break;default:throw this.createErrorReport("Unhandled token: "+this.lexer.peekNextToken().type)}return e},parseElementBesidesDirectiveEnd:function(){try{return this.parseElement=this.parseElementBesidesDirectiveEndBody,this.parseElement()}finally{this.parseElement=this.originalParseElement}},parseElementBesidesDirectiveEndBody:function(){return this.lexer.peekNextToken().type===s.tokens.directive&&this.lexer.peekNextToken().endDirective?null:this.originalParseElement()},parseHeader:function(){var e=this.lexer.getNextToken(),t=u.createHeader([this.createTextNode(e.content)],{level:e.level});return this.setNodeOriginFromToken(t,e),t},parsePreformatted:function(){for(var e=this.lexer.peekNextToken(),t=u.createPreformatted([]),i=(this.setNodeOriginFromToken(t,e),[]);this.lexer.hasNext();){var n=this.lexer.peekNextToken();if(n.type!==s.tokens.preformatted||n.indentation<e.indentation)break;this.lexer.getNextToken(),i.push(n.content)}return t.appendChild(this.createTextNode(i.join("\n"),!0)),t},definitionPattern:/^(.*?) :: *(.*)$/,parseList:function(){var e,t=this.lexer.peekNextToken(),i=!1;for(this.definitionPattern.test(t.content)?(e=u.createDefinitionList([]),i=!0):e=t.type===s.tokens.unorderedListElement?u.createUnorderedList([]):u.createOrderedList([]),this.setNodeOriginFromToken(e,t);this.lexer.hasNext();){var n=this.lexer.peekNextToken();if(!n.isListElement()||n.indentation!==t.indentation)break;e.appendChild(this.parseListElement(t.indentation,i))}return e},unknownDefinitionTerm:"???",parseListElement:function(e,t){var i=this.lexer.getNextToken(),n=u.createListElement([]);for(this.setNodeOriginFromToken(n,i),(n.isDefinitionList=t)?(t=this.definitionPattern.exec(i.content),n.term=[this.createTextNode(t&&t[1]?t[1]:this.unknownDefinitionTerm)],n.appendChild(this.createTextNode(t?t[2]:i.content))):n.appendChild(this.createTextNode(i.content));this.lexer.hasNext();){var r=this.skipBlank();if(!this.lexer.hasNext())break;var s=this.lexer.peekNextToken();if(r&&!s.isListElement()&&this.lexer.pushToken(r),s.indentation<=e)break;r=this.parseElement();r&&n.appendChild(r)}return n},parseTable:function(){for(var e,t=this.lexer.peekNextToken(),i=u.createTable([]),n=(this.setNodeOriginFromToken(i,t),!1),r=t.type===s.tokens.tableSeparator&&this.options.multilineCell;this.lexer.hasNext()&&(t=this.lexer.peekNextToken()).isTableElement();)t.type===s.tokens.tableRow?(e=this.parseTableRow(r),i.appendChild(e)):(n=!0,this.lexer.getNextToken());return n&&i.children.length&&i.children[0].children.forEach(function(e){e.isHeader=!0}),i},parseTableRow:function(e){for(var t,i,n,r=[];this.lexer.peekNextToken().type===s.tokens.tableRow&&(r.push(this.lexer.getNextToken()),e););if(r.length)return t=r.shift(),i=t.content.split("|"),r.forEach(function(e){e.content.split("|").forEach(function(e,t){i[t]=(i[t]||"")+"\n"+e})}),n=i.map(function(e){return u.createTableCell(l.parseStream(e))},this),this.setNodeOriginFromToken(u.createTableRow(n),t);throw this.createErrorReport("Expected table row")},parseDirective:function(){var e=this.lexer.getNextToken(),t=this.createDirectiveNodeFromToken(e);if(e.endDirective)throw this.createErrorReport("Unmatched 'end' directive for "+t.directiveName);if(e.oneshotDirective)return this.interpretDirective(t),t;if(e.beginDirective)return t.children=[],this.isVerbatimDirective(t)?this.parseDirectiveBlockVerbatim(t):this.parseDirectiveBlock(t);throw this.createErrorReport("Invalid directive "+t.directiveName)},createDirectiveNodeFromToken:function(e){var t=/^[ ]*([^ ]*)[ ]*(.*)[ ]*$/.exec(e.content),i=u.createDirective(null);return this.setNodeOriginFromToken(i,e),i.directiveName=t[1].toLowerCase(),i.directiveArguments=this.parseDirectiveArguments(t[2]),i.directiveOptions=this.parseDirectiveOptions(t[2]),i.directiveRawValue=t[2],i},isVerbatimDirective:function(e){e=e.directiveName;return"src"===e||"example"===e},parseDirectiveBlock:function(e,t){for(this.lexer.pushDummyTokenByType(s.tokens.blank);this.lexer.hasNext();){var i=this.lexer.peekNextToken();if(i.type===s.tokens.directive&&i.endDirective&&this.createDirectiveNodeFromToken(i).directiveName===e.directiveName)return this.lexer.getNextToken(),e;i=this.parseElementBesidesDirectiveEnd();i&&e.appendChild(i)}throw this.createErrorReport("Unclosed directive "+e.directiveName)},parseDirectiveBlockVerbatim:function(e){for(var t=[];this.lexer.hasNext();){var i=this.lexer.peekNextToken();if(i.type===s.tokens.directive&&i.endDirective&&this.createDirectiveNodeFromToken(i).directiveName===e.directiveName)return this.lexer.getNextToken(),e.appendChild(this.createTextNode(t.join("\n"),!0)),e;t.push(this.lexer.stream.getNextLine())}throw this.createErrorReport("Unclosed directive "+e.directiveName)},parseDirectiveArguments:function(e){return e.split(/[ ]+/).filter(function(e){return e.length&&"-"!==e[0]})},parseDirectiveOptions:function(e){return e.split(/[ ]+/).filter(function(e){return e.length&&"-"===e[0]})},interpretDirective:function(e){switch(e.directiveName){case"options:":this.interpretOptionDirective(e);break;case"title:":this.document.title=e.directiveRawValue;break;case"author:":this.document.author=e.directiveRawValue;break;case"email:":this.document.email=e.directiveRawValue}},interpretOptionDirective:function(e){e.directiveArguments.forEach(function(e){e=e.split(":");this.options[e[0]]=this.convertLispyValue(e[1])},this)},convertLispyValue:function(e){switch(e){case"t":return!0;case"nil":return!1;default:return/^[0-9]+$/.test(e)?parseInt(e):e}},parseParagraph:function(){for(var e=this.lexer.peekNextToken(),t=u.createParagraph([]),i=(this.setNodeOriginFromToken(t,e),[]);this.lexer.hasNext();){var n=this.lexer.peekNextToken();if(n.type!==s.tokens.line||n.indentation<e.indentation)break;this.lexer.getNextToken(),i.push(n.content)}return t.appendChild(this.createTextNode(i.join("\n"))),t},parseText:function(e){var t=this.lexer.getNextToken();return this.createTextNode(t.content,e)},createTextNode:function(e,t){return t?u.createText(null,{value:e}):this.inlineParser.parseEmphasis(e)}}).originalParseElement=l.prototype.parseElement,t.prototype={parseEmphasis:function(e){for(var t=this.emphasisPattern,i=[],n=t.lastIndex=0;l=t.exec(e);){var r=l[0],s=l[1],o=l[2],a=l[3],l=l[4],r=t.lastIndex-r.length,r=e.substring(n,r+s.length),s=t.lastIndex,r=(i.push(this.parseLink(r)),t.lastIndex=s,[u.createText(null,{value:a})]),s=this.emphasizeElementByMarker(r,o);i.push(s),n=t.lastIndex-l.length}return 0!==t.lastIndex&&t.lastIndex===e.length-1||i.push(this.parseLink(e.substring(n))),1===i.length?i[0]:u.createInlineContainer(i)},depth:0,parseLink:function(e){for(var t,i=this.linkPattern,n=[],r=i.lastIndex=0;a=i.exec(e);){var s=a[0],o=a[1],a=a[2],s=i.lastIndex-s.length,s=e.substring(r,s),s=(n.push(u.createText(null,{value:s})),u.createLink([]));s.src=o,a?(t=i.lastIndex,s.appendChild(this.parseEmphasis(a)),i.lastIndex=t):s.appendChild(u.createText(null,{value:o})),n.push(s),r=i.lastIndex}return 0!==i.lastIndex&&i.lastIndex===e.length-1||n.push(u.createText(null,{value:e.substring(r)})),u.createInlineContainer(n)},emphasizeElementByMarker:function(e,t){switch(t){case"*":return u.createBold(e);case"/":return u.createItalic(e);case"_":return u.createUnderline(e);case"=":case"~":return u.createCode(e);case"+":return u.createDashed(e)}},buildEmphasisPattern:function(){return new RegExp("(["+this.preEmphasis+"]|^|\r?\n)(["+this.markers+"])([^"+this.borderForbidden+"]|[^"+this.borderForbidden+"]"+this.bodyRegexp+"[^"+this.borderForbidden+"])\\2(["+this.postEmphasis+"]|$|\r?\n)","g")}},void 0!==e&&(e.Parser=l,e.InlineParser=t),i.prototype={exportOptions:{headerOffset:1,exportFromLineNumber:!1,suppressSubScriptHandling:!1,suppressAutoLink:!1},untitled:"Untitled",result:null,initialize:function(e,t){this.orgDocument=e,this.documentOptions=e.options||{},this.exportOptions=t||{},this.headers=[],this.headerOffset="number"==typeof this.exportOptions.headerOffset?this.exportOptions.headerOffset:1,this.sectionNumbers=[0]},createTocItem:function(e,t){var i=[];return i.parent=t,{headerNode:e,childTocs:i}},computeToc:function(e){"number"!=typeof e&&(e=1/0);for(var t=[],i=(t.parent=null,1),n=t,r=0;r<this.headers.length;++r){var s=this.headers[r];if(!(s.level>e)){if(0<(l=s.level-i))for(var o,a=0;a<l;++a)0===n.length&&((o=u.createHeader([],{level:i+a})).sectionNumberText="",n.push(this.createTocItem(o,n))),n=n[n.length-1].childTocs;else if(l<0)for(var l=-l,h=0;h<l;++h)n=n.parent;n.push(this.createTocItem(s,n)),i=s.level}}return t},convertNode:function(e,t,i){i||(e.type===u.types.directive?"example"!==e.directiveName&&"src"!==e.directiveName||(i=!0):e.type===u.types.preformatted&&(i=!0));var n,r=(e="string"==typeof e?u.createText(null,{value:e}):e).children?this.convertNodes(e.children,t,i):"",s=this.computeAuxDataForNode(e);switch(e.type){case u.types.header:var o=null,a=(0===r.indexOf("TODO ")?o="todo":0===r.indexOf("DONE ")&&(o="done"),null);if(t){var l=e.level,h=this.sectionNumbers.length;if(h<l)for(var c=l-h,d=0;d<c;++d)this.sectionNumbers[l-1-d]=0;else l<h&&(this.sectionNumbers.length=l);this.sectionNumbers[l-1]++,a=this.sectionNumbers.join("."),e.sectionNumberText=a}n=this.convertHeader(e,r,s,o,a),t&&this.headers.push(e);break;case u.types.orderedList:n=this.convertOrderedList(e,r,s);break;case u.types.unorderedList:n=this.convertUnorderedList(e,r,s);break;case u.types.definitionList:n=this.convertDefinitionList(e,r,s);break;case u.types.listElement:n=e.isDefinitionList?(h=this.convertNodes(e.term,t,i),this.convertDefinitionItem(e,r,s,h,r)):this.convertListItem(e,r,s);break;case u.types.paragraph:n=this.convertParagraph(e,r,s);break;case u.types.preformatted:n=this.convertPreformatted(e,r,s);break;case u.types.table:n=this.convertTable(e,r,s);break;case u.types.tableRow:n=this.convertTableRow(e,r,s);break;case u.types.tableCell:n=e.isHeader?this.convertTableHeader(e,r,s):this.convertTableCell(e,r,s);break;case u.types.horizontalRule:n=this.convertHorizontalRule(e,r,s);break;case u.types.inlineContainer:n=this.convertInlineContainer(e,r,s);break;case u.types.bold:n=this.convertBold(e,r,s);break;case u.types.italic:n=this.convertItalic(e,r,s);break;case u.types.underline:n=this.convertUnderline(e,r,s);break;case u.types.code:n=this.convertCode(e,r,s);break;case u.types.dashed:n=this.convertDashed(e,r,s);break;case u.types.link:n=this.convertLink(e,r,s);break;case u.types.directive:switch(e.directiveName){case"quote":n=this.convertQuote(e,r,s);break;case"example":n=this.convertExample(e,r,s);break;case"src":n=this.convertSrc(e,r,s);break;default:n=r}break;case u.types.text:n=this.convertText(e.value,i);break;default:throw"Unknown node type: "+e.type}return n="function"==typeof this.postProcess?this.postProcess(e,n,i):n},convertText:function(e,t){e=this.escapeSpecialChars(e,t);return this.exportOptions.suppressSubScriptHandling||t||(e=this.makeSubscripts(e,t)),e=this.exportOptions.suppressAutoLink?e:this.linkURL(e)},convertNodes:function(e,t,i){return e.map(function(e){return this.convertNode(e,t,i)},this).join("")},getNodeTextContent:function(e){return e.type===u.types.text?this.escapeSpecialChars(e.value):e.children?e.children.map(this.getNodeTextContent,this).join(""):""},escapeSpecialChars:function(e){throw"Implement escapeSpecialChars"},urlPattern:/\b(?:https?:\/\/|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’])/i,linkURL:function(e){var t=this;return e.replace(this.urlPattern,function(e){return e.indexOf("://")<0&&(e="http://"+e),t.makeLink(e)})},makeLink:function(e){throw"Implement makeLink"},makeSubscripts:function(e){return"{}"===this.documentOptions["^"]?e.replace(/\b([^_ \t]*)_{([^}]*)}/g,this.makeSubscript):this.documentOptions["^"]?e.replace(/\b([^_ \t]*)_([^_]*)\b/g,this.makeSubscript):e},makeSubscript:function(e,t,i){throw"Implement makeSubscript"},imageExtensionPattern:new RegExp("("+["bmp","png","jpeg","jpg","gif","tiff","tif","xbm","xpm","pbm","pgm","ppm"].join("|")+")$","i")},void 0!==e&&(e.Converter=i),h.prototype={__proto__:i.prototype,convert:function(){var e=this.orgDocument.title?this.convertNode(this.orgDocument.title):this.untitled,t=this.tag("h1",e),i=this.convertNodes(this.orgDocument.nodes,!0),n=this.computeToc(this.documentOptions.toc),r=this.tocToHTML(n);return{title:e,titleHTML:t,contentHTML:i,tocHTML:r,toc:n,toString:function(){return t+r+"\n"+i}}},tocToHTML:function(e){function a(e){for(var t="",i=0;i<e.length;++i){var n=e[i],r=n.headerNode.sectionNumberText,s=this.documentOptions.num?this.inlineTag("span",r,{class:"section-number"}):"",o=this.getNodeTextContent(n.headerNode),s=this.inlineTag("a",s+o,{href:"#header-"+r.replace(/\./g,"-")}),o=n.childTocs.length?a.call(this,n.childTocs):"";t+=this.tag("li",s+o)}return this.tag("ul",t)}return a.call(this,e)},computeAuxDataForNode:function(e){for(;e.parent&&e.parent.type===u.types.inlineContainer;)e=e.parent;for(var t=e.previousSibling,i="";t&&t.type===u.types.directive&&"attr_html:"===t.directiveName;)i+=t.directiveRawValue+" ",t=t.previousSibling;return i},convertHeader:function(e,t,i,n,r){var s={};return n&&(t=this.inlineTag("span",t.substring(0,4),{class:"task-status "+n})+t.substring(5)),r&&(t=this.inlineTag("span",r,{class:"section-number"})+t,s.id="header-"+r.replace(/\./g,"-")),n&&(s.class="task-status "+n),this.tag("h"+(this.headerOffset+e.level),t,s,i)},convertOrderedList:function(e,t,i){return this.tag("ol",t,null,i)},convertUnorderedList:function(e,t,i){return this.tag("ul",t,null,i)},convertDefinitionList:function(e,t,i){return this.tag("dl",t,null,i)},convertDefinitionItem:function(e,t,i,n,r){return this.tag("dt",n)+this.tag("dd",r)},convertListItem:function(e,t,i){if(this.exportOptions.suppressCheckboxHandling)return this.tag("li",t,null,i);var n={};if(/^\s*\[(X| |-)\]([\s\S]*)/.exec(t)){var t=RegExp.$2,r={type:"checkbox"};switch(RegExp.$1){case"X":r.checked="true",n["data-checkbox-status"]="done";break;case"-":n["data-checkbox-status"]="intermediate";break;default:n["data-checkbox-status"]="undone"}t=this.inlineTag("input",null,r)+t}return this.tag("li",t,n,i)},convertParagraph:function(e,t,i){return this.tag("p",t,null,i)},convertPreformatted:function(e,t,i){return this.tag("pre",t,null,i)},convertTable:function(e,t,i){return this.tag("table",this.tag("tbody",t),null,i)},convertTableRow:function(e,t,i){return this.tag("tr",t)},convertTableHeader:function(e,t,i){return this.tag("th",t)},convertTableCell:function(e,t,i){return this.tag("td",t)},convertHorizontalRule:function(e,t,i){return this.tag("hr",null,null,i)},convertInlineContainer:function(e,t,i){return t},convertBold:function(e,t,i){return this.inlineTag("b",t)},convertItalic:function(e,t,i){return this.inlineTag("i",t)},convertUnderline:function(e,t,i){return this.inlineTag("span",t,{style:"text-decoration:underline;"})},convertCode:function(e,t,i){return this.inlineTag("code",t)},convertDashed:function(e,t,i){return this.inlineTag("del",t)},convertLink:function(e,t,i){var n;return this.imageExtensionPattern.exec(e.src)?(n=this.getNodeTextContent(e),this.inlineTag("img",null,{src:e.src,alt:n,title:n},i)):this.inlineTag("a",t,{href:e.src})},convertQuote:function(e,t,i){return this.tag("blockquote",t,null,i)},convertExample:function(e,t,i){return this.tag("pre",t,null,i)},convertSrc:function(e,t,i){e=e.directiveArguments.length?e.directiveArguments[0]:"unknown";return t=this.tag("code",t,{class:"language-"+e},i),this.tag("pre",t,{class:"prettyprint"})},replaceMap:{"&":["&#38;",null],"<":["&#60;",null],">":["&#62;",null],'"':["&#34;",null],"'":["&#39;",null],"->":["&#10132;",function(e,t){return this.exportOptions.translateSymbolArrow&&!t}]},replaceRegexp:null,escapeSpecialChars:function(i,n){this.replaceRegexp||(this.replaceRegexp=new RegExp(Object.keys(this.replaceMap).join("|"),"g"));var r=this.replaceMap,s=this;return i.replace(this.replaceRegexp,function(e){var t;if(r[e])return"function"!=typeof(t=r[e][1])||t.call(s,i,n)?r[e][0]:e;throw"escapeSpecialChars: Invalid match"})},postProcess:function(e,t,i){return t=this.exportOptions.exportFromLineNumber&&"number"==typeof e.fromLineNumber?this.inlineTag("div",t,{"data-line-number":e.fromLineNumber}):t},makeLink:function(e){return'<a href="'+e+'">'+decodeURIComponent(e)+"</a>"},makeSubscript:function(e,t,i){return'<span class="org-subscript-parent">'+t+'</span><span class="org-subscript-child">'+i+"</span>"},attributesObjectToString:function(e){var t,i="";for(t in e)e.hasOwnProperty(t)&&(i+=" "+t+'="'+e[t]+'"');return i},inlineTag:function(e,t,i,n){var r="<"+e;return n&&(r+=" "+n),r+=this.attributesObjectToString(i=i||{}),null===t?r+"/>":r+">"+t+"</"+e+">"},tag:function(e,t,i,n){return this.inlineTag(e,t,i,n)+"\n"}},void 0!==e&&(e.ConverterHTML=h),e}();(function(){function l(e,i){var t,n;return i=o(e,i),(e=r.modules[i])||("function"==typeof(e=r.payloads[i])&&(t={id:i,uri:"",exports:n={},packaged:!0},n=e(function(e,t){return s(i,e,t)},n,t)||t.exports,r.modules[i]=n,delete r.payloads[i]),e=r.modules[i]=n||e),e}var e,t,i=function(){return this}(),r=(i||"undefined"==typeof window||(i=window),function(e,t,i){"string"!=typeof e?r.original?r.original.apply(this,arguments):(console.error("dropping module because define wasn't a string."),console.trace()):(2==arguments.length&&(i=t),r.modules[e]||(r.payloads[e]=i,r.modules[e]=null))}),s=(r.modules={},r.payloads={},function(e,t,i){if("string"==typeof t){var n=l(e,t);if(null!=n)return i&&i(),n}else if("[object Array]"===Object.prototype.toString.call(t)){for(var r=[],s=0,o=t.length;s<o;++s){var a=l(e,t[s]);if(null==a&&h.original)return;r.push(a)}return i&&i.apply(null,r)||!0}}),h=function(e,t){var i=s("",e,t);return null==i&&h.original?h.original.apply(this,arguments):i},o=function(e,t){var i;if(-1!==t.indexOf("!"))return i=t.split("!"),o(e,i[0])+"!"+o(e,i[1]);if("."==t.charAt(0))for(t=e.split("/").slice(0,-1).join("/")+"/"+t;-1!==t.indexOf(".")&&n!=t;){var n=t;t=t.replace(/\/\.\//,"/").replace(/[^\/]+\/\.\.\//,"")}return t};t=i,(e="ace")&&(i[e]||(i[e]={}),t=i[e]),t.define&&t.define.packaged||(r.original=t.define,t.define=r,t.define.packaged=!0),t.require&&t.require.packaged||(h.original=t.require,t.require=h,t.require.packaged=!0)})(),ace.define("ace/lib/fixoldbrowsers",["require","exports","module"],function(e,t,i){"use strict";"undefined"==typeof Element||Element.prototype.remove||Object.defineProperty(Element.prototype,"remove",{enumerable:!1,writable:!0,configurable:!0,value:function(){this.parentNode&&this.parentNode.removeChild(this)}})}),ace.define("ace/lib/useragent",["require","exports","module"],function(e,t,i){"use strict";t.OS={LINUX:"LINUX",MAC:"MAC",WINDOWS:"WINDOWS"},t.getOS=function(){return t.isMac?t.OS.MAC:t.isLinux?t.OS.LINUX:t.OS.WINDOWS};var n="object"==typeof navigator?navigator:{},r=(/mac|win|linux/i.exec(n.platform)||["other"])[0].toLowerCase(),s=n.userAgent||"",n=n.appName||"";t.isWin="win"==r,t.isMac="mac"==r,t.isLinux="linux"==r,t.isIE="Microsoft Internet Explorer"==n||0<=n.indexOf("MSAppHost")?parseFloat((s.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]):parseFloat((s.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]),t.isOldIE=t.isIE&&t.isIE<9,t.isGecko=t.isMozilla=s.match(/ Gecko\/\d+/),t.isOpera="object"==typeof opera&&"[object Opera]"==Object.prototype.toString.call(window.opera),t.isWebKit=parseFloat(s.split("WebKit/")[1])||void 0,t.isChrome=parseFloat(s.split(" Chrome/")[1])||void 0,t.isEdge=parseFloat(s.split(" Edge/")[1])||void 0,t.isAIR=0<=s.indexOf("AdobeAIR"),t.isAndroid=0<=s.indexOf("Android"),t.isChromeOS=0<=s.indexOf(" CrOS "),t.isIOS=/iPad|iPhone|iPod/.test(s)&&!window.MSStream,t.isIOS&&(t.isMac=!0),t.isMobile=t.isIOS||t.isAndroid}),ace.define("ace/lib/dom",["require","exports","module","ace/lib/useragent"],function(e,s,t){"use strict";var i,e=e("./useragent");s.buildDom=function e(t,i,n){if("string"==typeof t&&t)return h=document.createTextNode(t),i&&i.appendChild(h),h;if(!Array.isArray(t))return t&&t.appendChild&&i&&i.appendChild(t),t;if("string"!=typeof t[0]||!t[0]){for(var r=[],s=0;s<t.length;s++){var o=e(t[s],i,n);o&&r.push(o)}return r}for(var a=document.createElement(t[0]),l=t[1],h=1,s=h=l&&"object"==typeof l&&!Array.isArray(l)?2:h;s<t.length;s++)e(t[s],a,n);return 2==h&&Object.keys(l).forEach(function(e){var t=l[e];"class"===e?a.className=Array.isArray(t)?t.join(" "):t:"function"==typeof t||"value"==e||"$"==e[0]?a[e]=t:"ref"===e?n&&(n[t]=a):null!=t&&a.setAttribute(e,t)}),i&&i.appendChild(a),a},s.getDocumentHead=function(e){return(e=e||document).head||e.getElementsByTagName("head")[0]||e.documentElement},s.createElement=function(e,t){return document.createElementNS?document.createElementNS(t||"http://www.w3.org/1999/xhtml",e):document.createElement(e)},s.removeChildren=function(e){e.innerHTML=""},s.createTextNode=function(e,t){return(t?t.ownerDocument:document).createTextNode(e)},s.createFragment=function(e){return(e?e.ownerDocument:document).createDocumentFragment()},s.hasCssClass=function(e,t){return-1!==(e.className+"").split(/\s+/g).indexOf(t)},s.addCssClass=function(e,t){s.hasCssClass(e,t)||(e.className+=" "+t)},s.removeCssClass=function(e,t){for(var i=e.className.split(/\s+/g);;){var n=i.indexOf(t);if(-1==n)break;i.splice(n,1)}e.className=i.join(" ")},s.toggleCssClass=function(e,t){for(var i=e.className.split(/\s+/g),n=!0;;){var r=i.indexOf(t);if(-1==r)break;n=!1,i.splice(r,1)}return n&&i.push(t),e.className=i.join(" "),n},s.setCssClass=function(e,t,i){i?s.addCssClass(e,t):s.removeCssClass(e,t)},s.hasCssString=function(e,t){var i,n=0;if(i=(t=t||document).querySelectorAll("style"))for(;n<i.length;)if(i[n++].id===e)return!0},s.importCssString=function(e,t,i){var n=i,i=(n=i&&i.getRootNode&&(n=i.getRootNode())&&n!=i?n:document).ownerDocument||n;if(t&&s.hasCssString(t,n))return null;t&&(e+="\n/*# sourceURL=ace/css/"+t+" */");var r=s.createElement("style");r.appendChild(i.createTextNode(e)),t&&(r.id=t),(n=n==i?s.getDocumentHead(i):n).insertBefore(r,n.firstChild)},s.importCssStylsheet=function(e,t){s.buildDom(["link",{rel:"stylesheet",href:e}],s.getDocumentHead(t))},s.scrollbarWidth=function(e){var t=s.createElement("ace_inner"),i=(t.style.width="100%",t.style.minWidth="0px",t.style.height="200px",t.style.display="block",s.createElement("ace_outer")),n=i.style,e=(n.position="absolute",n.left="-10000px",n.overflow="hidden",n.width="200px",n.minWidth="0px",n.height="150px",n.display="block",i.appendChild(t),e.documentElement),r=(e.appendChild(i),t.offsetWidth),n=(n.overflow="scroll",t.offsetWidth);return r==n&&(n=i.clientWidth),e.removeChild(i),r-n},"undefined"==typeof document&&(s.importCssString=function(){}),s.computedStyle=function(e,t){return window.getComputedStyle(e,"")||{}},s.setStyle=function(e,t,i){e[t]!==i&&(e[t]=i)},s.HAS_CSS_ANIMATION=!1,s.HAS_CSS_TRANSFORMS=!1,s.HI_DPI=!e.isWin||"undefined"!=typeof window&&1.5<=window.devicePixelRatio,"undefined"!=typeof document&&(i=document.createElement("div"),s.HI_DPI&&void 0!==i.style.transform&&(s.HAS_CSS_TRANSFORMS=!0),e.isEdge||void 0===i.style.animationName||(s.HAS_CSS_ANIMATION=!0),i=null),s.HAS_CSS_TRANSFORMS?s.translate=function(e,t,i){e.style.transform="translate("+Math.round(t)+"px, "+Math.round(i)+"px)"}:s.translate=function(e,t,i){e.style.top=Math.round(i)+"px",e.style.left=Math.round(t)+"px"}}),ace.define("ace/lib/oop",["require","exports","module"],function(e,i,t){"use strict";i.inherits=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})},i.mixin=function(e,t){for(var i in t)e[i]=t[i];return e},i.implement=function(e,t){i.mixin(e,t)}}),ace.define("ace/lib/keys",["require","exports","module","ace/lib/oop"],function(e,t,i){"use strict";var s=e("./oop"),n=function(){var e,t,i={MODIFIER_KEYS:{16:"Shift",17:"Ctrl",18:"Alt",224:"Meta",91:"MetaLeft",92:"MetaRight",93:"ContextMenu"},KEY_MODS:{ctrl:1,alt:2,option:2,shift:4,super:8,meta:8,command:8,cmd:8,control:1},FUNCTION_KEYS:{8:"Backspace",9:"Tab",13:"Return",19:"Pause",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"Print",45:"Insert",46:"Delete",96:"Numpad0",97:"Numpad1",98:"Numpad2",99:"Numpad3",100:"Numpad4",101:"Numpad5",102:"Numpad6",103:"Numpad7",104:"Numpad8",105:"Numpad9","-13":"NumpadEnter",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"Numlock",145:"Scrolllock"},PRINTABLE_KEYS:{32:" ",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",59:";",61:"=",65:"a",66:"b",67:"c",68:"d",69:"e",70:"f",71:"g",72:"h",73:"i",74:"j",75:"k",76:"l",77:"m",78:"n",79:"o",80:"p",81:"q",82:"r",83:"s",84:"t",85:"u",86:"v",87:"w",88:"x",89:"y",90:"z",107:"+",109:"-",110:".",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",111:"/",106:"*"}};for(t in i.FUNCTION_KEYS)e=i.FUNCTION_KEYS[t].toLowerCase(),i[e]=parseInt(t,10);for(t in i.PRINTABLE_KEYS)e=i.PRINTABLE_KEYS[t].toLowerCase(),i[e]=parseInt(t,10);s.mixin(i,i.MODIFIER_KEYS),s.mixin(i,i.PRINTABLE_KEYS),s.mixin(i,i.FUNCTION_KEYS),i.enter=i.return,i.escape=i.esc,i.del=i.delete,i[173]="-";for(var n=["cmd","ctrl","alt","shift"],r=Math.pow(2,n.length);r--;)i.KEY_MODS[r]=n.filter(function(e){return r&i.KEY_MODS[e]}).join("-")+"-";return i.KEY_MODS[0]="",i.KEY_MODS[-1]="input-",i}();s.mixin(t,n),t.keyCodeToString=function(e){var t=n[e];return(t="string"!=typeof t?String.fromCharCode(e):t).toLowerCase()}}),ace.define("ace/lib/event",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(e,d,t){"use strict";function r(){if(null==i){i=!1;try{document.createComment("").addEventListener("test",function(){},{get passive(){i={passive:!1}}})}catch(e){}}return i}function s(e,t,i){this.elem=e,this.type=t,this.callback=i}function o(e,t,i){var n=l(t);if(!u.isMac&&p){if(t.getModifierState&&(t.getModifierState("OS")||t.getModifierState("Win"))&&(n|=8),p.altGr){if(3==(3&n))return;p.altGr=0}18!==i&&17!==i||(r="location"in t?t.location:t.keyLocation,17===i&&1===r?1==p[i]&&(m=t.timeStamp):18===i&&3===n&&2===r&&t.timeStamp-m<50&&(p.altGr=!0))}if(i in c.MODIFIER_KEYS&&(i=-1),!n&&13===i){var r="location"in t?t.location:t.keyLocation;if(3===r&&(e(t,n,-i),t.defaultPrevented))return}if(u.isChromeOS&&8&n){if(e(t,n,i),t.defaultPrevented)return;n&=-9}return!!(n||i in c.FUNCTION_KEYS||i in c.PRINTABLE_KEYS)&&e(t,n,i)}function a(){p=Object.create(null)}function l(e){return 0|(e.ctrlKey?1:0)|(e.altKey?2:0)|(e.shiftKey?4:0)|(e.metaKey?8:0)}var i,h,c=e("./keys"),u=e("./useragent"),p=null,m=0,g=(s.prototype.destroy=function(){f(this.elem,this.type,this.callback),this.elem=this.type=this.callback=void 0},d.addListener=function(e,t,i,n){e.addEventListener(t,i,r()),n&&n.$toDestroy.push(new s(e,t,i))}),f=d.removeListener=function(e,t,i){e.removeEventListener(t,i,r())};d.stopEvent=function(e){return d.stopPropagation(e),d.preventDefault(e),!1},d.stopPropagation=function(e){e.stopPropagation&&e.stopPropagation()},d.preventDefault=function(e){e.preventDefault&&e.preventDefault()},d.getButton=function(e){return"dblclick"==e.type?0:"contextmenu"==e.type||u.isMac&&e.ctrlKey&&!e.altKey&&!e.shiftKey?2:e.button},d.capture=function(e,t,i){function n(e){t&&t(e),i&&i(e),f(r,"mousemove",t),f(r,"mouseup",n),f(r,"dragstart",n)}var r=e&&e.ownerDocument||document;return g(r,"mousemove",t),g(r,"mouseup",n),g(r,"dragstart",n),n},d.addMouseWheelListener=function(e,t,i){"onmousewheel"in e?g(e,"mousewheel",function(e){void 0!==e.wheelDeltaX?(e.wheelX=-e.wheelDeltaX/8,e.wheelY=-e.wheelDeltaY/8):(e.wheelX=0,e.wheelY=-e.wheelDelta/8),t(e)},i):"onwheel"in e?g(e,"wheel",function(e){switch(e.deltaMode){case e.DOM_DELTA_PIXEL:e.wheelX=.35*e.deltaX||0,e.wheelY=.35*e.deltaY||0;break;case e.DOM_DELTA_LINE:case e.DOM_DELTA_PAGE:e.wheelX=5*(e.deltaX||0),e.wheelY=5*(e.deltaY||0)}t(e)},i):g(e,"DOMMouseScroll",function(e){e.axis&&e.axis==e.HORIZONTAL_AXIS?(e.wheelX=5*(e.detail||0),e.wheelY=0):(e.wheelX=0,e.wheelY=5*(e.detail||0)),t(e)},i)},d.addMultiMouseDownListener=function(e,i,n,r,t){function s(e){var t;if(0!==d.getButton(e)?h=0:1<e.detail&&!(4<++h)||(h=1),u.isIE&&(t=5<Math.abs(e.clientX-o)||5<Math.abs(e.clientY-a),l&&!t||(h=1),l&&clearTimeout(l),l=setTimeout(function(){l=null},i[h-1]||600),1==h)&&(o=e.clientX,a=e.clientY),e._clicks=h,n[r]("mousedown",e),4<h)h=0;else if(1<h)return n[r](c[h],e)}var o,a,l,h=0,c={2:"dblclick",3:"tripleclick",4:"quadclick"};(e=Array.isArray(e)?e:[e]).forEach(function(e){g(e,"mousedown",s,t)})};d.getModifierString=function(e){return c.KEY_MODS[l(e)]},d.addCommandKeyListener=function(e,i,t){var n,r;u.isOldGecko||u.isOpera&&!("KeyboardEvent"in window)?(n=null,g(e,"keydown",function(e){n=e.keyCode},t),g(e,"keypress",function(e){return o(i,e,n)},t)):(r=null,g(e,"keydown",function(e){p[e.keyCode]=(p[e.keyCode]||0)+1;var t=o(i,e,e.keyCode);return r=e.defaultPrevented,t},t),g(e,"keypress",function(e){r&&(e.ctrlKey||e.altKey||e.shiftKey||e.metaKey)&&(d.stopEvent(e),r=null)},t),g(e,"keyup",function(e){p[e.keyCode]=null},t),p||(a(),g(window,"focus",a)))},"object"==typeof window&&window.postMessage&&!u.isOldIE&&(h=1,d.nextTick=function(t,i){i=i||window;function n(e){e.data==r&&(d.stopPropagation(e),f(i,"message",n),t())}var r="zero-timeout-message-"+h++;g(i,"message",n),i.postMessage(r,"*")}),d.$idleBlocked=!1,d.onIdle=function(t,e){return setTimeout(function e(){d.$idleBlocked?setTimeout(e,100):t()},e)},d.$idleBlockId=null,d.blockIdle=function(e){d.$idleBlockId&&clearTimeout(d.$idleBlockId),d.$idleBlocked=!0,d.$idleBlockId=setTimeout(function(){d.$idleBlocked=!1},e||100)},d.nextFrame="object"==typeof window&&(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame),d.nextFrame?d.nextFrame=d.nextFrame.bind(window):d.nextFrame=function(e){setTimeout(e,17)}}),ace.define("ace/range",["require","exports","module"],function(e,t,i){"use strict";function s(e,t,i,n){this.start={row:e,column:t},this.end={row:i,column:n}}(function(){this.isEqual=function(e){return this.start.row===e.start.row&&this.end.row===e.end.row&&this.start.column===e.start.column&&this.end.column===e.end.column},this.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},this.contains=function(e,t){return 0==this.compare(e,t)},this.compareRange=function(e){var t=e.end,e=e.start,t=this.compare(t.row,t.column);return 1==t?1==(t=this.compare(e.row,e.column))?2:0==t?1:0:-1==t?-2:-1==(t=this.compare(e.row,e.column))?-1:1==t?42:0},this.comparePoint=function(e){return this.compare(e.row,e.column)},this.containsRange=function(e){return 0==this.comparePoint(e.start)&&0==this.comparePoint(e.end)},this.intersects=function(e){e=this.compareRange(e);return-1==e||0==e||1==e},this.isEnd=function(e,t){return this.end.row==e&&this.end.column==t},this.isStart=function(e,t){return this.start.row==e&&this.start.column==t},this.setStart=function(e,t){"object"==typeof e?(this.start.column=e.column,this.start.row=e.row):(this.start.row=e,this.start.column=t)},this.setEnd=function(e,t){"object"==typeof e?(this.end.column=e.column,this.end.row=e.row):(this.end.row=e,this.end.column=t)},this.inside=function(e,t){return 0==this.compare(e,t)&&!this.isEnd(e,t)&&!this.isStart(e,t)},this.insideStart=function(e,t){return 0==this.compare(e,t)&&!this.isEnd(e,t)},this.insideEnd=function(e,t){return 0==this.compare(e,t)&&!this.isStart(e,t)},this.compare=function(e,t){return this.isMultiLine()||e!==this.start.row?e<this.start.row?-1:e>this.end.row?1:this.start.row===e?t>=this.start.column?0:-1:this.end.row!==e||t<=this.end.column?0:1:t<this.start.column?-1:t>this.end.column?1:0},this.compareStart=function(e,t){return this.start.row==e&&this.start.column==t?-1:this.compare(e,t)},this.compareEnd=function(e,t){return this.end.row==e&&this.end.column==t?1:this.compare(e,t)},this.compareInside=function(e,t){return this.end.row==e&&this.end.column==t?1:this.start.row==e&&this.start.column==t?-1:this.compare(e,t)},this.clipRows=function(e,t){var i,n;return this.end.row>t?i={row:t+1,column:0}:this.end.row<e&&(i={row:e,column:0}),this.start.row>t?n={row:t+1,column:0}:this.start.row<e&&(n={row:e,column:0}),s.fromPoints(n||this.start,i||this.end)},this.extend=function(e,t){var i,n,r=this.compare(e,t);return 0==r?this:(-1==r?i={row:e,column:t}:n={row:e,column:t},s.fromPoints(i||this.start,n||this.end))},this.isEmpty=function(){return this.start.row===this.end.row&&this.start.column===this.end.column},this.isMultiLine=function(){return this.start.row!==this.end.row},this.clone=function(){return s.fromPoints(this.start,this.end)},this.collapseRows=function(){return 0==this.end.column?new s(this.start.row,0,Math.max(this.start.row,this.end.row-1),0):new s(this.start.row,0,this.end.row,0)},this.toScreenRange=function(e){var t=e.documentToScreenPosition(this.start),e=e.documentToScreenPosition(this.end);return new s(t.row,t.column,e.row,e.column)},this.moveBy=function(e,t){this.start.row+=e,this.start.column+=t,this.end.row+=e,this.end.column+=t}}).call(s.prototype),s.fromPoints=function(e,t){return new s(e.row,e.column,t.row,t.column)},s.comparePoints=function(e,t){return e.row-t.row||e.column-t.column},s.comparePoints=function(e,t){return e.row-t.row||e.column-t.column},t.Range=s}),ace.define("ace/lib/lang",["require","exports","module"],function(e,t,i){"use strict";t.last=function(e){return e[e.length-1]},t.stringReverse=function(e){return e.split("").reverse().join("")},t.stringRepeat=function(e,t){for(var i="";0<t;)1&t&&(i+=e),(t>>=1)&&(e+=e);return i};var n=/^\s\s*/,r=/\s\s*$/;t.stringTrimLeft=function(e){return e.replace(n,"")},t.stringTrimRight=function(e){return e.replace(r,"")},t.copyObject=function(e){var t,i={};for(t in e)i[t]=e[t];return i},t.copyArray=function(e){for(var t=[],i=0,n=e.length;i<n;i++)e[i]&&"object"==typeof e[i]?t[i]=this.copyObject(e[i]):t[i]=e[i];return t},t.deepCopy=function e(t){if("object"!=typeof t||!t)return t;if(Array.isArray(t))for(var i=[],n=0;n<t.length;n++)i[n]=e(t[n]);else{if("[object Object]"!==Object.prototype.toString.call(t))return t;for(var n in i={},t)i[n]=e(t[n])}return i},t.arrayToMap=function(e){for(var t={},i=0;i<e.length;i++)t[e[i]]=1;return t},t.createMap=function(e){var t,i=Object.create(null);for(t in e)i[t]=e[t];return i},t.arrayRemove=function(e,t){for(var i=0;i<=e.length;i++)t===e[i]&&e.splice(i,1)},t.escapeRegExp=function(e){return e.replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1")},t.escapeHTML=function(e){return(""+e).replace(/&/g,"&#38;").replace(/"/g,"&#34;").replace(/'/g,"&#39;").replace(/</g,"&#60;")},t.getMatchOffsets=function(e,t){var i=[];return e.replace(t,function(e){i.push({offset:arguments[arguments.length-2],length:e.length})}),i},t.deferredCall=function(e){function t(){n=null,e()}function i(e){return i.cancel(),n=setTimeout(t,e||0),i}var n=null;return(i.schedule=i).call=function(){return this.cancel(),e(),i},i.cancel=function(){return clearTimeout(n),n=null,i},i.isPending=function(){return n},i},t.delayedCall=function(e,t){function i(){r=null,e()}function n(e){null==r&&(r=setTimeout(i,e||t))}var r=null;return n.delay=function(e){r&&clearTimeout(r),r=setTimeout(i,e||t)},(n.schedule=n).call=function(){this.cancel(),e()},n.cancel=function(){r&&clearTimeout(r),r=null},n.isPending=function(){return r},n}}),ace.define("ace/clipboard",["require","exports","module"],function(e,t,i){"use strict";var n;i.exports={lineMode:!1,pasteCancelled:function(){return!!(n&&n>Date.now()-50)||(n=!1)},cancel:function(){n=Date.now()}}}),ace.define("ace/keyboard/textinput",["require","exports","module","ace/lib/event","ace/lib/useragent","ace/lib/dom","ace/lib/lang","ace/clipboard","ace/lib/keys"],function(e,t,i){"use strict";var N=e("../lib/event"),B=e("../lib/useragent"),z=e("../lib/dom"),H=e("../lib/lang"),U=e("../clipboard"),W=B.isChrome<18,q=B.isIE,V=63<B.isChrome,j=e("../lib/keys"),G=j.KEY_MODS,K=B.isIOS,X=K?/\s/:/\n/,Y=B.isMobile;t.TextInput=function(e,d){function t(){i=!0,u.blur(),u.focus(),i=!1}function a(){clearTimeout($),$=setTimeout(function(){l&&(u.style.cssText=l,l=""),d.renderer.$isMousePressed=!1,d.renderer.$keepTextAreaAtCursor&&d.renderer.$moveTextAreaToCursor()},0)}var u=z.createElement("textarea"),s=(u.className="ace_text-input",u.setAttribute("wrap","off"),u.setAttribute("autocorrect","off"),u.setAttribute("autocapitalize","off"),u.setAttribute("spellcheck",!1),u.style.opacity="0",e.insertBefore(u,e.firstChild),!1),p=!1,o=!1,m=!1,l="",g=(Y||(u.style.fontSize="1px"),!1),i=!1,f="",v=0,y=0,b=0;try{var h=document.activeElement===u}catch(e){}N.addListener(u,"blur",function(e){i||(d.onBlur(e),h=!1)},d),N.addListener(u,"focus",function(e){if(!i){if(h=!0,B.isEdge)try{if(!document.hasFocus())return}catch(e){}d.onFocus(e),B.isEdge?setTimeout(w):w()}},d),this.$focusScroll=!1,this.focus=function(){if(l||V||"browser"==this.$focusScroll)return u.focus({preventScroll:!0});var e=u.style.top;u.style.position="fixed",u.style.top="0px";try{var t=0!=u.getBoundingClientRect().top}catch(e){return}var i=[];if(t)for(var n=u.parentElement;n&&1==n.nodeType;)i.push(n),n.setAttribute("ace_nocontext",!0),n=!n.parentElement&&n.getRootNode?n.getRootNode().host:n.parentElement;u.focus({preventScroll:!0}),t&&i.forEach(function(e){e.removeAttribute("ace_nocontext")}),setTimeout(function(){u.style.position="","0px"==u.style.top&&(u.style.top=e)},0)},this.blur=function(){u.blur()},this.isFocused=function(){return h},d.on("beforeEndOperation",function(){var e=d.curOp,t=e&&e.command&&e.command.name;"insertstring"!=t&&(t=t&&(e.docChanged||e.selectionChanged),o&&t&&(f=u.value="",E()),w())});function n(e){C(e,!0)}function r(e){C(e,!1)}function c(e){var t=_(e);U.pasteCancelled()||("string"==typeof t?(t&&d.onPaste(t,e),B.isIE&&setTimeout(w),N.preventDefault(e)):(u.value="",p=!0))}var w=K?function(e){var t;!h||s&&!e||m||((t="\n ab"+(e=e||"")+"cde fg\n")!=u.value&&(u.value=f=t),t=4+(e.length||(d.selection.isEmpty()?0:1)),4==v&&y==t||u.setSelectionRange(4,t),v=4,y=t)}:function(){if(!o&&!m&&(h||S)){o=!0;var e,t,i=0,n=0,r="",s=(d.session&&(s=(e=d.selection).getRange(),e=e.cursor.row,i=s.start.column,n=s.end.column,r=d.session.getLine(e),s.start.row!=e?(t=d.session.getLine(e-1),i=s.start.row<e-1?0:i,n+=t.length+1,r=t+"\n"+r):s.end.row!=e?(t=d.session.getLine(e+1),n=s.end.row>e+1?t.length:n,n+=r.length+1,r=r+"\n"+t):Y&&0<e&&(r="\n"+r,n+=1,i+=1),400<r.length)&&(i<400&&n<400?r=r.slice(0,400):(r="\n",i==n?i=n=0:(i=0,n=1))),r+"\n\n");if(s!=f&&(u.value=f=s,v=y=s.length),S&&(v=u.selectionStart,y=u.selectionEnd),y!=n||v!=i||u.selectionEnd!=y)try{u.setSelectionRange(i,n),v=i,y=n}catch(e){}o=!1}},D=(this.resetSelection=w,h&&d.onFocus(),function(e){return 0===e.selectionStart&&e.selectionEnd>=f.length&&e.value===f&&f&&e.selectionEnd!==y}),x=null,S=(this.setInputHandler=function(e){x=e},!(this.getInputHandler=function(){return x})),A=function(e,t){if(S=S&&!1,p)return w(),e&&d.onPaste(e),p=!1,"";for(var i=u.selectionStart,n=u.selectionEnd,r=v,s=f.length-y,o=e,a=e.length-i,l=e.length-n,h=0;0<r&&f[h]==e[h];)h++,r--;for(o=o.slice(h),h=1;0<s&&f.length-h>v-1&&f[f.length-h]==e[e.length-h];)h++,s--;a-=h-1,l-=h-1;var c=o.length-h+1;return c<0&&(r=-c,c=0),o=o.slice(0,c),t||o||a||r||s||l?(c=!(m=!0),B.isAndroid&&". "==o&&(o=" ",c=!0),o&&!r&&!s&&!a&&!l||g?d.onTextInput(o):d.onTextInput(o,{extendLeft:r,extendRight:s,restoreStart:a,restoreEnd:l}),m=!1,f=e,v=i,y=n,b=l,c?"\n":o):""},k=function(e){if(o)return T();if(e&&e.inputType){if("historyUndo"==e.inputType)return d.execCommand("undo");if("historyRedo"==e.inputType)return d.execCommand("redo")}var e=u.value,t=A(e,!0);(500<e.length||X.test(t)||Y&&v<1&&v==y)&&w()},_=function(e,t,i){var n=e.clipboardData||window.clipboardData;if(n&&!W){var r=q||i?"Text":"text/plain";try{return t?!1!==n.setData(r,t):n.getData(r)}catch(e){if(!i)return _(e,t,!0)}}},C=function(e,t){var i=d.getCopyText();if(!i)return N.preventDefault(e);_(e,i)?(K&&(w(i),s=i,setTimeout(function(){s=!1},10)),t?d.onCut():d.onCopy(),N.preventDefault(e)):(s=!0,u.value=i,u.select(),setTimeout(function(){s=!1,w(),t?d.onCut():d.onCopy()}))},T=(N.addCommandKeyListener(u,d.onCommandKey.bind(d),d),N.addListener(u,"select",function(e){o||(s?s=!1:D(u)?(d.selectAll(),w()):Y&&u.selectionStart!=v&&w())},d),N.addListener(u,"input",k,d),N.addListener(u,"cut",n,d),N.addListener(u,"copy",r,d),N.addListener(u,"paste",c,d),"oncut"in u&&"oncopy"in u&&"onpaste"in u||N.addListener(e,"keydown",function(e){if((!B.isMac||e.metaKey)&&e.ctrlKey)switch(e.keyCode){case 67:r(e);break;case 86:c(e);break;case 88:n(e)}},d),function(){var e;if(o&&d.onCompositionUpdate&&!d.$readOnly)return g?t():void(o.useTextareaForIME?d.onCompositionUpdate(u.value):(e=u.value,A(e),o.markerRange&&(o.context&&(o.markerRange.start.column=o.selectionStart=o.context.compositionStartOffset),o.markerRange.end.column=o.markerRange.start.column+y-o.selectionStart+b)))}),E=function(e){d.onCompositionEnd&&!d.$readOnly&&(o=!1,d.onCompositionEnd(),d.off("mousedown",t),e)&&k()},M=H.delayedCall(T,50).schedule.bind(null,null);N.addListener(u,"compositionstart",function(e){o||!d.onCompositionStart||d.$readOnly||(o={},g)||(e.data&&(o.useTextareaForIME=!1),setTimeout(T,0),d._signal("compositionStart"),d.on("mousedown",t),(e=d.getSelectionRange()).end.row=e.start.row,e.end.column=e.start.column,o.markerRange=e,o.selectionStart=v,d.onCompositionStart(o),o.useTextareaForIME?(f=u.value="",y=v=0):(u.msGetInputContext&&(o.context=u.msGetInputContext()),u.getInputContext&&(o.context=u.getInputContext())))},d),N.addListener(u,"compositionupdate",T,d),N.addListener(u,"keyup",function(e){27==e.keyCode&&u.value.length<u.selectionStart&&(o||(f=u.value),v=y=-1,w()),M()},d),N.addListener(u,"keydown",M,d),N.addListener(u,"compositionend",E,d),this.getElement=function(){return u},this.setCommandMode=function(e){g=e,u.readOnly=!1},this.setReadOnly=function(e){g||(u.readOnly=e)},this.setCopyWithEmptySelection=function(e){},this.onContextMenu=function(e){S=!0,w(),d._emit("nativecontextmenu",{target:d,domEvent:e}),this.moveToMouse(e,!0)},this.moveToMouse=function(e,t){l=l||u.style.cssText,u.style.cssText=(t?"z-index:100000;":"")+(B.isIE?"opacity:0.1;":"")+"text-indent: -"+(v+y)*d.renderer.characterWidth*.5+"px;";function i(e){z.translate(u,e.clientX-s-2,Math.min(e.clientY-r-2,o))}var t=d.container.getBoundingClientRect(),n=z.computedStyle(d.container),r=t.top+(parseInt(n.borderTopWidth)||0),s=t.left+(parseInt(t.borderLeftWidth)||0),o=t.bottom-r-u.clientHeight-2;i(e),"mousedown"==e.type&&(d.renderer.$isMousePressed=!0,clearTimeout($),B.isWin)&&N.capture(d.container,i,a)},this.onContextMenuClose=a;function R(e){d.textInput.onContextMenu(e),a()}var $,L,I,F,P;function O(e){var t,i,n,r;document.activeElement!==I||P||o||L.$mouseHandler.isMousePressed||s||(t=I.selectionStart,i=I.selectionEnd,n=null,(r=0)==t?n=j.up:1==t?n=j.home:y<i&&"\n"==f[i]?n=j.end:t<v&&" "==f[t-1]?(n=j.left,r=G.option):t<v||t==v&&y!=v&&t==i?n=j.left:y<i&&2<f.slice(0,i).split("\n").length?n=j.down:y<i&&" "==f[i-1]?(n=j.right,r=G.option):(y<i||i==y&&y!=v&&t==i)&&(n=j.right),t!==i&&(r|=G.shift),n&&(!L.onCommandKey({},r,n)&&L.commands&&(n=j.keyCodeToString(n),r=L.commands.findKeyCommand(r,n))&&L.execCommand(r),v=t,y=i,w("")))}N.addListener(u,"mouseup",R,d),N.addListener(u,"mousedown",function(e){e.preventDefault(),a()},d),N.addListener(d.renderer.scroller,"contextmenu",R,d),N.addListener(u,"contextmenu",R,d),K&&(L=d,F=null,P=!1,(I=u).addEventListener("keydown",function(e){F&&clearTimeout(F),P=!0},!0),I.addEventListener("keyup",function(e){F=setTimeout(function(){P=!1},100)},!0),document.addEventListener("selectionchange",O),L.on("destroy",function(){document.removeEventListener("selectionchange",O)}))},t.$setUserAgentForTests=function(e,t){Y=e,K=t}}),ace.define("ace/mouse/default_handlers",["require","exports","module","ace/lib/useragent"],function(e,t,i){"use strict";function n(t){t.$clickSelection=null;var e=t.editor;e.setDefaultHandler("mousedown",this.onMouseDown.bind(t)),e.setDefaultHandler("dblclick",this.onDoubleClick.bind(t)),e.setDefaultHandler("tripleclick",this.onTripleClick.bind(t)),e.setDefaultHandler("quadclick",this.onQuadClick.bind(t)),e.setDefaultHandler("mousewheel",this.onMouseWheel.bind(t));["select","startSelect","selectEnd","selectAllEnd","selectByWordsEnd","selectByLinesEnd","dragWait","dragWaitEnd","focusWait"].forEach(function(e){t[e]=this[e]},this),t.selectByLines=this.extendSelectionBy.bind(t,"getLineRange"),t.selectByWords=this.extendSelectionBy.bind(t,"getWordRange")}function o(e,t){return(e.start.row==e.end.row?2*t.column-e.start.column-e.end.column:e.start.row!=e.end.row-1||e.start.column||e.end.column?2*t.row-e.start.row-e.end.row:t.column-4)<0?{cursor:e.start,anchor:e.end}:{cursor:e.end,anchor:e.start}}var s=e("../lib/useragent");(function(){this.onMouseDown=function(e){var t=e.inSelection(),i=e.getDocumentPosition(),n=(this.mousedownEvent=e,this.editor),r=e.getButton();if(0!==r)!n.getSelectionRange().isEmpty()&&1!=r||n.selection.moveToPosition(i),2==r&&(n.textInput.onContextMenu(e.domEvent),s.isMozilla||e.preventDefault());else{if(this.mousedownEvent.time=Date.now(),!t||n.isFocused()||(n.focus(),!this.$focusTimeout)||this.$clickSelection||n.inMultiSelectMode)return this.captureMouse(e),this.startSelect(i,1<e.domEvent._clicks),e.preventDefault();this.setState("focusWait"),this.captureMouse(e)}},this.startSelect=function(e,t){e=e||this.editor.renderer.screenToTextCoordinates(this.x,this.y);var i=this.editor;this.mousedownEvent&&(this.mousedownEvent.getShiftKey()?i.selection.selectToPosition(e):t||i.selection.moveToPosition(e),t||this.select(),i.renderer.scroller.setCapture&&i.renderer.scroller.setCapture(),i.setStyle("ace_selecting"),this.setState("select"))},this.select=function(){var e,t=this.editor,i=t.renderer.screenToTextCoordinates(this.x,this.y);this.$clickSelection&&(e=-1==(e=this.$clickSelection.comparePoint(i))?this.$clickSelection.end:1==e?this.$clickSelection.start:(i=(e=o(this.$clickSelection,i)).cursor,e.anchor),t.selection.setSelectionAnchor(e.row,e.column)),t.selection.selectToPosition(i),t.renderer.scrollCursorIntoView()},this.extendSelectionBy=function(e){var t,i,n,r=this.editor,s=r.renderer.screenToTextCoordinates(this.x,this.y),e=r.selection[e](s.row,s.column);this.$clickSelection&&(i=this.$clickSelection.comparePoint(e.start),t=this.$clickSelection.comparePoint(e.end),-1==i&&t<=0?(n=this.$clickSelection.end,e.end.row==s.row&&e.end.column==s.column||(s=e.start)):1==t&&0<=i?(n=this.$clickSelection.start,e.start.row==s.row&&e.start.column==s.column||(s=e.end)):n=-1==i&&1==t?(s=e.end,e.start):(s=(i=o(this.$clickSelection,s)).cursor,i.anchor),r.selection.setSelectionAnchor(n.row,n.column)),r.selection.selectToPosition(s),r.renderer.scrollCursorIntoView()},this.selectEnd=this.selectAllEnd=this.selectByWordsEnd=this.selectByLinesEnd=function(){this.$clickSelection=null,this.editor.unsetStyle("ace_selecting"),this.editor.renderer.scroller.releaseCapture&&this.editor.renderer.scroller.releaseCapture()},this.focusWait=function(){n=this.mousedownEvent.x,e=this.mousedownEvent.y,i=this.x,t=this.y;var e,t,i=Math.sqrt(Math.pow(i-n,2)+Math.pow(t-e,2)),n=Date.now();(0<i||n-this.mousedownEvent.time>this.$focusTimeout)&&this.startSelect(this.mousedownEvent.getDocumentPosition())},this.onDoubleClick=function(e){var e=e.getDocumentPosition(),t=this.editor,i=t.session.getBracketRange(e);i?(i.isEmpty()&&(i.start.column--,i.end.column++),this.setState("select")):(i=t.selection.getWordRange(e.row,e.column),this.setState("selectByWords")),this.$clickSelection=i,this.select()},this.onTripleClick=function(e){var e=e.getDocumentPosition(),t=this.editor,i=(this.setState("selectByLines"),t.getSelectionRange());i.isMultiLine()&&i.contains(e.row,e.column)?(this.$clickSelection=t.selection.getLineRange(i.start.row),this.$clickSelection.end=t.selection.getLineRange(i.end.row).end):this.$clickSelection=t.selection.getLineRange(e.row),this.select()},this.onQuadClick=function(e){var t=this.editor;t.selectAll(),this.$clickSelection=t.getSelectionRange(),this.setState("selectAll")},this.onMouseWheel=function(e){var t,i,n,r,s,o,a;if(!e.getAccelKey())return e.getShiftKey()&&e.wheelY&&!e.wheelX&&(e.wheelX=e.wheelY,e.wheelY=0),t=this.editor,this.$lastScroll||(this.$lastScroll={t:0,vx:0,vy:0,allowed:0}),i=this.$lastScroll,r=(a=(n=e.domEvent.timeStamp)-i.t)?e.wheelX/a:i.vx,s=a?e.wheelY/a:i.vy,a<550&&(r=(r+i.vx)/2,s=(s+i.vy)/2),a=!1,1<=(o=Math.abs(r/s))&&t.renderer.isScrollableBy(e.wheelX*e.speed,0)&&(a=!0),(a=o<=1&&t.renderer.isScrollableBy(0,e.wheelY*e.speed)?!0:a)?i.allowed=n:n-i.allowed<550&&(Math.abs(r)<=1.5*Math.abs(i.vx)&&Math.abs(s)<=1.5*Math.abs(i.vy)?(a=!0,i.allowed=n):i.allowed=0),i.t=n,i.vx=r,i.vy=s,a?(t.renderer.scrollBy(e.wheelX*e.speed,e.wheelY*e.speed),e.stop()):void 0}}).call(n.prototype),t.DefaultHandlers=n}),ace.define("ace/tooltip",["require","exports","module","ace/lib/oop","ace/lib/dom"],function(e,t,i){"use strict";function n(e){this.isOpen=!1,this.$element=null,this.$parentNode=e}e("./lib/oop");var r=e("./lib/dom");(function(){this.$init=function(){return this.$element=r.createElement("div"),this.$element.className="ace_tooltip",this.$element.style.display="none",this.$parentNode.appendChild(this.$element),this.$element},this.getElement=function(){return this.$element||this.$init()},this.setText=function(e){this.getElement().textContent=e},this.setHtml=function(e){this.getElement().innerHTML=e},this.setPosition=function(e,t){this.getElement().style.left=e+"px",this.getElement().style.top=t+"px"},this.setClassName=function(e){r.addCssClass(this.getElement(),e)},this.show=function(e,t,i){null!=e&&this.setText(e),null!=t&&null!=i&&this.setPosition(t,i),this.isOpen||(this.getElement().style.display="block",this.isOpen=!0)},this.hide=function(){this.isOpen&&(this.getElement().style.display="none",this.isOpen=!1)},this.getHeight=function(){return this.getElement().offsetHeight},this.getWidth=function(){return this.getElement().offsetWidth},this.destroy=function(){this.isOpen=!1,this.$element&&this.$element.parentNode&&this.$element.parentNode.removeChild(this.$element)}}).call(n.prototype),t.Tooltip=n}),ace.define("ace/mouse/default_gutter_handler",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/event","ace/tooltip"],function(e,t,i){"use strict";function d(e){o.call(this,e)}var u=e("../lib/dom"),n=e("../lib/oop"),p=e("../lib/event"),o=e("../tooltip").Tooltip;n.inherits(d,o),function(){this.setPosition=function(e,t){var i=window.innerWidth||document.documentElement.clientWidth,n=window.innerHeight||document.documentElement.clientHeight,r=this.getWidth(),s=this.getHeight();i<(e+=15)+r&&(e-=e+r-i),n<(t+=15)+s&&(t-=20+s),o.prototype.setPosition.call(this,e,t)}}.call(d.prototype),t.GutterHandler=function(n){function r(){i=i&&clearTimeout(i),a&&(c.hide(),a=null,l._signal("hideGutterTooltip",c),l.off("mousewheel",r))}function s(e){c.setPosition(e.x,e.y)}var i,o,a,l=n.editor,h=l.renderer.$gutterLayer,c=new d(l.container);n.editor.setDefaultHandler("guttermousedown",function(e){if(l.isFocused()&&0==e.getButton()){var t=h.getRegion(e);if("foldWidgets"!=t){var t=e.getDocumentPosition().row,i=l.session.selection;if(e.getShiftKey())i.selectTo(t,0);else{if(2==e.domEvent.detail)return l.selectAll(),e.preventDefault();n.$clickSelection=l.selection.getLineRange(t)}return n.setState("selectByLines"),n.captureMouse(e),e.preventDefault()}}}),n.editor.setDefaultHandler("guttermousemove",function(e){var t=e.domEvent.target||e.domEvent.srcElement;if(u.hasCssClass(t,"ace_fold-widget"))return r();a&&n.$tooltipFollowsMouse&&s(e),o=e,i=i||setTimeout(function(){i=null,(o&&!n.isMousePressed?function(){var e=o.getDocumentPosition().row,t=h.$annotations[e];if(!t)return r();if(e==l.session.getLength()){var e=l.renderer.pixelToScreenCoordinates(0,o.y).row,i=o.$pos;if(e>l.session.documentToScreenRow(i.row,i.column))return r()}a!=t&&(a=t.text.join("<br/>"),c.setHtml(a),c.show(),l._signal("showGutterTooltip",c),l.on("mousewheel",r),n.$tooltipFollowsMouse?s(o):(e=o.domEvent.target.getBoundingClientRect(),(i=c.getElement().style).left=e.right+"px",i.top=e.bottom+"px"))}:r)()},50)}),p.addListener(l.renderer.$gutter,"mouseout",function(e){o=null,a&&(i=i||setTimeout(function(){i=null,r()},50))},l),l.on("changeSession",r)}}),ace.define("ace/mouse/mouse_event",["require","exports","module","ace/lib/event","ace/lib/useragent"],function(e,t,i){"use strict";var n=e("../lib/event"),r=e("../lib/useragent"),e=t.MouseEvent=function(e,t){this.domEvent=e,this.editor=t,this.x=this.clientX=e.clientX,this.y=this.clientY=e.clientY,this.$pos=null,this.$inSelection=null,this.propagationStopped=!1,this.defaultPrevented=!1};!function(){this.stopPropagation=function(){n.stopPropagation(this.domEvent),this.propagationStopped=!0},this.preventDefault=function(){n.preventDefault(this.domEvent),this.defaultPrevented=!0},this.stop=function(){this.stopPropagation(),this.preventDefault()},this.getDocumentPosition=function(){return this.$pos||(this.$pos=this.editor.renderer.screenToTextCoordinates(this.clientX,this.clientY),this.$pos)},this.inSelection=function(){var e,t;return null===this.$inSelection&&((e=this.editor.getSelectionRange()).isEmpty()?this.$inSelection=!1:(t=this.getDocumentPosition(),this.$inSelection=e.contains(t.row,t.column))),this.$inSelection},this.getButton=function(){return n.getButton(this.domEvent)},this.getShiftKey=function(){return this.domEvent.shiftKey},this.getAccelKey=r.isMac?function(){return this.domEvent.metaKey}:function(){return this.domEvent.ctrlKey}}.call(e.prototype)}),ace.define("ace/mouse/dragdrop_handler",["require","exports","module","ace/lib/dom","ace/lib/event","ace/lib/useragent"],function(e,t,i){"use strict";function n(t){function e(){var e,t,i,n,r,s,o,a,l=u;u=y.renderer.screenToTextCoordinates(h,c),r=u,s=l,o=Date.now(),a=!s||r.row!=s.row,s=!s||r.column!=s.column,!f||a||s?(y.moveCursorToPosition(r),f=o,v={x:h,y:c}):5<A(v.x,v.y,h,c)?f=null:200<=o-f&&(y.renderer.scrollCursorIntoView(),f=null),a=u,s=l,r=Date.now(),o=y.renderer.layerConfig.lineHeight,l=y.renderer.layerConfig.characterWidth,e=y.renderer.scroller.getBoundingClientRect(),e={x:{left:h-e.left,right:e.right-h},y:{top:c-e.top,bottom:e.bottom-c}},t=Math.min(e.x.left,e.x.right),i=Math.min(e.y.top,e.y.bottom),n={row:a.row,column:a.column},t/l<=2&&(n.column+=e.x.left<e.x.right?-3:2),i/o<=1&&(n.row+=e.y.top<e.y.bottom?-1:1),t=a.row!=n.row,l=a.column!=n.column,i=!s||a.row!=s.row,t||l&&!i?g?200<=r-g&&y.renderer.scrollCursorIntoView(n):g=r:g=null}function i(){d=y.selection.toOrientedRange(),a=y.session.addMarker(d,"ace_selection",y.getSelectionStyle()),y.clearSelection(),y.isFocused()&&y.renderer.$cursorLayer.setBlinking(!1),clearInterval(l),e(),l=setInterval(e,20),x=0,_.addListener(document,"mousemove",r)}function n(){clearInterval(l),y.session.removeMarker(a),a=null,y.selection.fromOrientedRange(d),y.isFocused()&&!m&&y.$resetCursorStyle(),x=0,f=g=u=d=null,_.removeListener(document,"mousemove",r)}function r(){null==S&&(S=setTimeout(function(){null!=S&&a&&n()},20))}function s(e){e=e.types;return!e||Array.prototype.some.call(e,function(e){return"text/plain"==e||"Text"==e})}function o(e){var t=["copy","copymove","all","uninitialized"],i=C.isMac?e.altKey:e.ctrlKey,n="uninitialized";try{n=e.dataTransfer.effectAllowed.toLowerCase()}catch(e){}var r="none";return i&&0<=t.indexOf(n)?r="copy":0<=["move","copymove","linkmove","all","uninitialized"].indexOf(n)?r="move":0<=t.indexOf(n)&&(r="copy"),r}var a,h,c,l,d,u,p,m,g,f,v,y=t.editor,b=k.createElement("img"),w=(b.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",C.isOpera&&(b.style.cssText="width:1px;height:1px;position:fixed;top:0;left:0;z-index:2147483647;opacity:0;"),["dragWait","dragWaitEnd","startDrag","dragReadyEnd","onMouseDrag"].forEach(function(e){t[e]=this[e]},this),y.on("mousedown",this.onMouseDown.bind(t)),y.container),x=0,S=(this.onDragStart=function(e){var t;if(this.cancelDrag||!w.draggable)return t=this,setTimeout(function(){t.startSelect(),t.captureMouse(e)},0),e.preventDefault();d=y.getSelectionRange();var i=e.dataTransfer;i.effectAllowed=y.getReadOnly()?"copy":"copyMove",C.isOpera&&(y.container.appendChild(b),b.scrollTop=0),i.setDragImage&&i.setDragImage(b,0,0),C.isOpera&&y.container.removeChild(b),i.clearData(),i.setData("Text",y.session.getTextRange()),m=!0,this.setState("drag")},this.onDragEnd=function(e){w.draggable=!1,m=!1,this.setState(null),y.getReadOnly()||(e=e.dataTransfer.dropEffect,p||"move"!=e||y.session.remove(y.getSelectionRange()),y.$resetCursorStyle()),this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle("")},this.onDragEnter=function(e){if(!y.getReadOnly()&&s(e.dataTransfer))return h=e.clientX,c=e.clientY,a||i(),x++,e.dataTransfer.dropEffect=p=o(e),_.preventDefault(e)},this.onDragOver=function(e){if(!y.getReadOnly()&&s(e.dataTransfer))return h=e.clientX,c=e.clientY,a||(i(),x++),null!==S&&(S=null),e.dataTransfer.dropEffect=p=o(e),_.preventDefault(e)},this.onDragLeave=function(e){if(--x<=0&&a)return n(),p=null,_.preventDefault(e)},this.onDrop=function(e){if(u){var t=e.dataTransfer;if(m)switch(p){case"move":d=d.contains(u.row,u.column)?{start:u,end:u}:y.moveText(d,u);break;case"copy":d=y.moveText(d,u,!0)}else{t=t.getData("Text");d={start:u,end:y.session.insert(u,t)},y.focus(),p=null}return n(),_.preventDefault(e)}},_.addListener(w,"dragstart",this.onDragStart.bind(t),y),_.addListener(w,"dragend",this.onDragEnd.bind(t),y),_.addListener(w,"dragenter",this.onDragEnter.bind(t),y),_.addListener(w,"dragover",this.onDragOver.bind(t),y),_.addListener(w,"dragleave",this.onDragLeave.bind(t),y),_.addListener(w,"drop",this.onDrop.bind(t),y),null)}function A(e,t,i,n){return Math.sqrt(Math.pow(i-e,2)+Math.pow(n-t,2))}var k=e("../lib/dom"),_=e("../lib/event"),C=e("../lib/useragent");(function(){this.dragWait=function(){Date.now()-this.mousedownEvent.time>this.editor.getDragDelay()&&this.startDrag()},this.dragWaitEnd=function(){this.editor.container.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()),this.selectEnd()},this.dragReadyEnd=function(e){this.editor.$resetCursorStyle(),this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle(""),this.dragWaitEnd()},this.startDrag=function(){this.cancelDrag=!1;var e=this.editor,t=(e.container.draggable=!0,e.renderer.$cursorLayer.setBlinking(!1),e.setStyle("ace_dragging"),C.isWin?"default":"move");e.renderer.setCursorStyle(t),this.setState("dragReady")},this.onMouseDrag=function(e){var t=this.editor.container;C.isIE&&"dragReady"==this.state&&3<A(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y)&&t.dragDrop(),"dragWait"===this.state&&0<A(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y)&&(t.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()))},this.onMouseDown=function(e){var t,i,n;this.$dragEnabled&&(this.mousedownEvent=e,t=this.editor,i=e.inSelection(),n=e.getButton(),1!==(e.domEvent.detail||1)||0!==n||!i||e.editor.inMultiSelectMode&&(e.getAccelKey()||e.getShiftKey())||(this.mousedownEvent.time=Date.now(),"unselectable"in(n=e.domEvent.target||e.domEvent.srcElement)&&(n.unselectable="on"),t.getDragDelay()?(C.isWebKit&&(this.cancelDrag=!0,t.container.draggable=!0),this.setState("dragWait")):this.startDrag(),this.captureMouse(e,this.onMouseDrag.bind(this)),e.defaultPrevented=!0))}}).call(n.prototype),t.DragdropHandler=n}),ace.define("ace/mouse/touch_handler",["require","exports","module","ace/mouse/mouse_event","ace/lib/event","ace/lib/dom"],function(e,t,i){"use strict";var k=e("./mouse_event").MouseEvent,n=e("../lib/event"),a=e("../lib/dom");t.addTouchListeners=function(e,c){function r(){function t(e){var t,i=e.target.getAttribute("action");"more"!=i&&r?("paste"==i?n.readText().then(function(e){c.execCommand(i,e)}):i&&("cut"!=i&&"copy"!=i||(n?n.writeText(c.getCopyText()):document.execCommand("copy")),c.execCommand(i)),o.firstChild.style.display="none",r=!1,"openCommandPallete"!=i&&c.focus()):(r=!r,e=c.getCopyText(),t=c.session.getUndoManager().hasUndo(),o.replaceChild(a.buildDom(r?["span",!e&&["span",{class:"ace_mobile-button",action:"selectall"},"Select All"],e&&["span",{class:"ace_mobile-button",action:"copy"},"Copy"],e&&["span",{class:"ace_mobile-button",action:"cut"},"Cut"],n&&["span",{class:"ace_mobile-button",action:"paste"},"Paste"],t&&["span",{class:"ace_mobile-button",action:"undo"},"Undo"],["span",{class:"ace_mobile-button",action:"find"},"Find"],["span",{class:"ace_mobile-button",action:"openCommandPallete"},"Pallete"]]:["span"]),o.firstChild))}var n=window.navigator&&window.navigator.clipboard,r=!1;o=a.buildDom(["div",{class:"ace_mobile-menu",ontouchstart:function(e){b="menu",e.stopPropagation(),e.preventDefault(),c.textInput.focus()},ontouchend:function(e){e.stopPropagation(),e.preventDefault(),t(e)},onclick:t},["span"],["span",{class:"ace_mobile-button",action:"more"},"..."]],c.container)}function i(){o||r();var e=c.selection.cursor,e=c.renderer.textToScreenCoordinates(e.row,e.column),t=c.renderer.textToScreenCoordinates(0,0).pageX,i=c.renderer.scrollLeft,n=c.container.getBoundingClientRect();o.style.top=e.pageY-n.top-3+"px",e.pageX-n.left<n.width-70?(o.style.left="",o.style.right="10px"):(o.style.right="",o.style.left=t+i-n.left+"px"),o.style.display="",o.firstChild.style.display="none",c.on("input",s)}function s(e){o&&(o.style.display="none"),c.off("input",s)}function d(){f=null,clearTimeout(f);var e=c.selection.getRange(),t=e.contains(v.row,v.column);!e.isEmpty()&&t||(c.selection.moveToPosition(v),c.selection.selectWord()),b="wait",i()}var u,p,m,g,f,t,v,y,o,b="scroll",w=0,x=0,S=0,A=0;n.addListener(e,"contextmenu",function(e){y&&c.textInput.getElement().focus()},c),n.addListener(e,"touchstart",function(e){var t=e.touches;if(f||1<t.length)clearTimeout(f),f=null,m=-1,b="zoom";else{y=c.$mouseHandler.isMousePressed=!0;var i=c.renderer.layerConfig.lineHeight,n=c.renderer.layerConfig.lineHeight,r=e.timeStamp,s=(g=r,t[0]),o=s.clientX,s=s.clientY,o=(Math.abs(u-o)+Math.abs(p-s)>i&&(m=-1),u=e.clientX=o,p=e.clientY=s,S=A=0,new k(e,c));if(v=o.getDocumentPosition(),r-m<500&&1==t.length&&!w)x++,e.preventDefault(),e.button=0,f=null,clearTimeout(f),c.selection.moveToPosition(v),(s=2<=x?c.selection.getLineRange(v.row):c.session.getBracketRange(v))&&!s.isEmpty()?c.selection.setRange(s):c.selection.selectWord(),b="wait";else{x=0;var o=c.selection.cursor,t=c.selection.isEmpty()?o:c.selection.anchor,s=c.renderer.$cursorLayer.getPixelPosition(o,!0),o=c.renderer.$cursorLayer.getPixelPosition(t,!0),t=c.renderer.scroller.getBoundingClientRect(),a=c.renderer.layerConfig.offset,l=c.renderer.scrollLeft,h=function(e,t){return(e/=n)*e+(t=t/i-.75)*t};if(e.clientX<t.left)return void(b="zoom");s=h(e.clientX-t.left-s.left+l,e.clientY-t.top-s.top+a),h=h(e.clientX-t.left-o.left+l,e.clientY-t.top-o.top+a);s<3.5&&h<3.5&&(b=h<s?"cursor":"anchor"),b=h<3.5?"anchor":s<3.5?"cursor":"scroll",f=setTimeout(d,450)}m=r}},c),n.addListener(e,"touchend",function(e){y=c.$mouseHandler.isMousePressed=!1,t&&clearInterval(t),"zoom"==b?(b="",w=0):(f?(c.selection.moveToPosition(v),w=0,i):"scroll"==b?(w+=60,t=setInterval(function(){w--<=0&&(clearInterval(t),t=null),Math.abs(S)<.01&&(S=0),Math.abs(A)<.01&&(A=0),w<20&&(S*=.9),w<20&&(A*=.9);var e=c.session.getScrollTop();c.renderer.scrollBy(10*S,10*A),e==c.session.getScrollTop()&&(w=0)},10),s):i)(),clearTimeout(f),f=null},c),n.addListener(e,"touchmove",function(e){f&&(clearTimeout(f),f=null);var t=e.touches;if(!(1<t.length||"zoom"==b)){var t=t[0],i=u-t.clientX,n=p-t.clientY;if("wait"==b){if(!(4<i*i+n*n))return e.preventDefault();b="cursor"}u=t.clientX,p=t.clientY,e.clientX=t.clientX,e.clientY=t.clientY;var t=e.timeStamp,r=t-g;g=t,"scroll"==b?((t=new k(e,c)).speed=1,t.wheelX=i,t.wheelY=n,10*Math.abs(i)<Math.abs(n)&&(i=0),10*Math.abs(n)<Math.abs(i)&&(n=0),0!=r&&(S=i/r,A=n/r),c._emit("mousewheel",t),t.propagationStopped||(S=A=0)):(i=new k(e,c).getDocumentPosition(),"cursor"==b?c.selection.moveCursorToPosition(i):"anchor"==b&&c.selection.setSelectionAnchor(i.row,i.column),c.renderer.scrollCursorIntoView(i),e.preventDefault())}},c)}}),ace.define("ace/lib/net",["require","exports","module","ace/lib/dom"],function(e,t,i){"use strict";var r=e("./dom");t.get=function(e,t){var i=new XMLHttpRequest;i.open("GET",e,!0),i.onreadystatechange=function(){4===i.readyState&&t(i.responseText)},i.send(null)},t.loadScript=function(e,i){var t=r.getDocumentHead(),n=document.createElement("script");n.src=e,t.appendChild(n),n.onload=n.onreadystatechange=function(e,t){!t&&n.readyState&&"loaded"!=n.readyState&&"complete"!=n.readyState||(n=n.onload=n.onreadystatechange=null,t)||i()}},t.qualifyURL=function(e){var t=document.createElement("a");return t.href=e,t.href}}),ace.define("ace/lib/event_emitter",["require","exports","module"],function(e,t,i){"use strict";function s(){this.propagationStopped=!0}function o(){this.defaultPrevented=!0}var n={};n._emit=n._dispatchEvent=function(e,t){this._eventRegistry||(this._eventRegistry={}),this._defaultHandlers||(this._defaultHandlers={});var i=this._eventRegistry[e]||[],n=this._defaultHandlers[e];if(i.length||n){(t="object"==typeof t&&t?t:{}).type||(t.type=e),t.stopPropagation||(t.stopPropagation=s),t.preventDefault||(t.preventDefault=o);for(var i=i.slice(),r=0;r<i.length&&(i[r](t,this),!t.propagationStopped);r++);return n&&!t.defaultPrevented?n(t,this):void 0}},n._signal=function(e,t){if(i=(this._eventRegistry||{})[e])for(var i=i.slice(),n=0;n<i.length;n++)i[n](t,this)},n.once=function(t,i){var n=this;if(this.on(t,function e(){n.off(t,e),i.apply(null,arguments)}),!i)return new Promise(function(e){i=e})},n.setDefaultHandler=function(e,t){var i,n,r=this._defaultHandlers;(r=r||(this._defaultHandlers={_disabled_:{}}))[e]&&(n=r[e],(i=r._disabled_[e])||(r._disabled_[e]=i=[]),i.push(n),-1!=(n=i.indexOf(t)))&&i.splice(n,1),r[e]=t},n.removeDefaultHandler=function(e,t){var i,n=this._defaultHandlers;n&&(i=n._disabled_[e],n[e]==t?i&&this.setDefaultHandler(e,i.pop()):i&&-1!=(n=i.indexOf(t))&&i.splice(n,1))},n.on=n.addEventListener=function(e,t,i){this._eventRegistry=this._eventRegistry||{};var n=this._eventRegistry[e];return-1==(n=n||(this._eventRegistry[e]=[])).indexOf(t)&&n[i?"unshift":"push"](t),t},n.off=n.removeListener=n.removeEventListener=function(e,t){this._eventRegistry=this._eventRegistry||{};e=this._eventRegistry[e];e&&-1!==(t=e.indexOf(t))&&e.splice(t,1)},n.removeAllListeners=function(e){e||(this._eventRegistry=this._defaultHandlers=void 0),this._eventRegistry&&(this._eventRegistry[e]=void 0),this._defaultHandlers&&(this._defaultHandlers[e]=void 0)},t.EventEmitter=n}),ace.define("ace/lib/app_config",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],function(e,t,i){function n(e){"undefined"!=typeof console&&console.warn&&console.warn.apply(console,arguments)}function r(e,t){var i=new Error(e);i.data=t,"object"==typeof console&&console.error&&console.error(i),setTimeout(function(){throw i})}function s(){this.$defaultOptions={}}var o=e("./oop"),a=e("./event_emitter").EventEmitter,l={setOptions:function(t){Object.keys(t).forEach(function(e){this.setOption(e,t[e])},this)},getOptions:function(e){var t,i={};return e?Array.isArray(e)||(i=e,e=Object.keys(i)):(t=this.$options,e=Object.keys(t).filter(function(e){return!t[e].hidden})),e.forEach(function(e){i[e]=this.getOption(e)},this),i},setOption:function(e,t){var i;if(this["$"+e]!==t)return(i=this.$options[e])?i.forwardTo?this[i.forwardTo]&&this[i.forwardTo].setOption(e,t):(i.handlesSet||(this["$"+e]=t),void(i&&i.set&&i.set.call(this,t))):n('misspelled option "'+e+'"')},getOption:function(e){var t=this.$options[e];return t?t.forwardTo?this[t.forwardTo]&&this[t.forwardTo].getOption(e):t&&t.get?t.get.call(this):this["$"+e]:n('misspelled option "'+e+'"')}};(function(){o.implement(this,a),this.defineOptions=function(i,e,n){return i.$options||(this.$defaultOptions[e]=i.$options={}),Object.keys(n).forEach(function(e){var t=n[e];(t="string"==typeof t?{forwardTo:t}:t).name||(t.name=e),"initialValue"in(i.$options[t.name]=t)&&(i["$"+t.name]=t.initialValue)}),o.implement(i,l),this},this.resetOptions=function(i){Object.keys(i.$options).forEach(function(e){var t=i.$options[e];"value"in t&&i.setOption(e,t.value)})},this.setDefaultValue=function(e,t,i){if(!e){for(e in this.$defaultOptions)if(this.$defaultOptions[e][t])break;if(!this.$defaultOptions[e][t])return!1}var n=this.$defaultOptions[e]||(this.$defaultOptions[e]={});n[t]&&(n.forwardTo?this.setDefaultValue(n.forwardTo,t,i):n[t].value=i)},this.setDefaultValues=function(t,i){Object.keys(i).forEach(function(e){this.setDefaultValue(t,e,i[e])},this)},this.warn=n,this.reportError=r}).call(s.prototype),t.AppConfig=s}),ace.define("ace/config",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/lib/net","ace/lib/app_config"],function(u,p,m){var e=u("./lib/lang"),r=(u("./lib/oop"),u("./lib/net")),t=u("./lib/app_config").AppConfig,g=(m.exports=p=new t,function(){return this||"undefined"!=typeof window&&window}()),f={packaged:!1,workerPath:null,modePath:null,themePath:null,basePath:"",suffix:".js",$moduleUrls:{},loadWorkerFromBlob:!0,sharedPopups:!1},s=(p.get=function(e){if(f.hasOwnProperty(e))return f[e];throw new Error("Unknown config key: "+e)},p.set=function(e,t){if(f.hasOwnProperty(e))f[e]=t;else if(0==this.setDefaultValue("",e,t))throw new Error("Unknown config key: "+e)},p.all=function(){return e.copyObject(f)},p.$modes={},p.moduleUrl=function(e,t){var i,n,r;return f.$moduleUrls[e]||(e=e.split("/"),i="snippets"==(t=t||e[e.length-2]||"")?"/":"-",n=e[e.length-1],"worker"==t&&"-"==i&&(r=new RegExp("^"+t+"[\\-_]|[\\-_]"+t+"$","g"),n=n.replace(r,"")),(!n||n==t)&&1<e.length&&(n=e[e.length-2]),null==(r=f[t+"Path"])?r=f.basePath:"/"==i&&(t=i=""),r&&"/"!=r.slice(-1)&&(r+="/"),r+t+i+n+this.get("suffix"))},p.setModuleUrl=function(e,t){return f.$moduleUrls[e]=t},p.$loading={},p.loadModule=function(i,e){var t,n;Array.isArray(i)&&(t=i[0],i=i[1]);try{n=u(i)}catch(e){}return n&&!p.$loading[i]?e&&e(n):(p.$loading[i]||(p.$loading[i]=[]),p.$loading[i].push(e),1<p.$loading[i].length?void 0:(n=function(){u([i],function(t){p._emit("load.module",{name:i,module:t});var e=p.$loading[i];p.$loading[i]=null,e.forEach(function(e){e&&e(t)})})},p.get("packaged")?(r.loadScript(p.moduleUrl(i,t),n),void s()):n()))},function(){f.basePath||f.workerPath||f.modePath||f.themePath||Object.keys(f.$moduleUrls).length||(console.error("Unable to infer path to ace from script src,","use ace.config.set('basePath', 'path') to enable dynamic loading of modes and themes","or with webpack use ace/webpack-resolver"),s=function(){})});p.init=function(e){if(g&&g.document){f.packaged=e||u.packaged||m.packaged||g.define&&define.packaged;for(var t,i={},n="",e=document.currentScript||document._currentScript,r=(e&&e.ownerDocument||document).getElementsByTagName("script"),s=0;s<r.length;s++){var o=r[s],a=o.src||o.getAttribute("src");if(a){for(var l=o.attributes,h=0,c=l.length;h<c;h++){var d=l[h];0===d.name.indexOf("data-ace-")&&(i[d.name.replace(/^data-ace-/,"").replace(/-(.)/g,function(e,t){return t.toUpperCase()})]=d.value)}o=a.match(/^(.*)\/ace(\-\w+)?\.js(\?|$)/);o&&(n=o[1])}}for(t in n&&(i.base=i.base||n,i.packaged=!0),i.basePath=i.base,i.workerPath=i.workerPath||i.base,i.modePath=i.modePath||i.base,i.themePath=i.themePath||i.base,delete i.base,i)void 0!==i[t]&&p.set(t,i[t])}},p.version="1.4.12"}),ace.define("ace/mouse/mouse_handler",["require","exports","module","ace/lib/event","ace/lib/useragent","ace/mouse/default_handlers","ace/mouse/default_gutter_handler","ace/mouse/mouse_event","ace/mouse/dragdrop_handler","ace/mouse/touch_handler","ace/config"],function(e,t,i){"use strict";function n(n){function e(e){document.hasFocus&&document.hasFocus()&&(n.isFocused()||document.activeElement!=(n.textInput&&n.textInput.getElement()))||window.focus(),n.focus()}var r=this,t=(this.editor=n,new s(this),new o(this),new a(this),n.renderer.getMouseEventTarget()),i=(c.addListener(t,"click",this.onMouseEvent.bind(this,"click"),n),c.addListener(t,"mousemove",this.onMouseMove.bind(this,"mousemove"),n),c.addMultiMouseDownListener([t,n.renderer.scrollBarV&&n.renderer.scrollBarV.inner,n.renderer.scrollBarH&&n.renderer.scrollBarH.inner,n.textInput&&n.textInput.getElement()].filter(Boolean),[400,300,250],this,"onMouseEvent",n),c.addMouseWheelListener(n.container,this.onMouseWheel.bind(this,"mousewheel"),n),l(n.container,n),n.renderer.$gutter);c.addListener(i,"mousedown",this.onMouseEvent.bind(this,"guttermousedown"),n),c.addListener(i,"click",this.onMouseEvent.bind(this,"gutterclick"),n),c.addListener(i,"dblclick",this.onMouseEvent.bind(this,"gutterdblclick"),n),c.addListener(i,"mousemove",this.onMouseEvent.bind(this,"guttermousemove"),n),c.addListener(t,"mousedown",e,n),c.addListener(i,"mousedown",e,n),d.isIE&&n.renderer.scrollBarV&&(c.addListener(n.renderer.scrollBarV.element,"mousedown",e,n),c.addListener(n.renderer.scrollBarH.element,"mousedown",e,n)),n.on("mousemove",function(e){var t,i;r.state||r.$dragDelay||!r.$dragEnabled||(e=n.renderer.screenToTextCoordinates(e.x,e.y),t=n.session.selection.getRange(),i=n.renderer,!t.isEmpty()&&t.insideStart(e.row,e.column)?i.setCursorStyle("default"):i.setCursorStyle(""))},n)}var c=e("../lib/event"),d=e("../lib/useragent"),s=e("./default_handlers").DefaultHandlers,o=e("./default_gutter_handler").GutterHandler,u=e("./mouse_event").MouseEvent,a=e("./dragdrop_handler").DragdropHandler,l=e("./touch_handler").addTouchListeners,e=e("../config");(function(){this.onMouseEvent=function(e,t){this.editor._emit(e,new u(t,this.editor))},this.onMouseMove=function(e,t){var i=this.editor._eventRegistry&&this.editor._eventRegistry.mousemove;i&&i.length&&this.editor._emit(e,new u(t,this.editor))},this.onMouseWheel=function(e,t){var i=new u(t,this.editor);i.speed=2*this.$scrollSpeed,i.wheelX=t.wheelX,i.wheelY=t.wheelY,this.editor._emit(e,i)},this.setState=function(e){this.state=e},this.captureMouse=function(e,t){this.x=e.x,this.y=e.y,this.isMousePressed=!0;function i(e){if(e)return d.isWebKit&&!e.which&&a.releaseMouse?a.releaseMouse():(a.x=e.clientX,a.y=e.clientY,t&&t(e),a.mouseEvent=new u(e,a.editor),void(a.$mouseMoved=!0))}function n(e){s.off("beforeEndOperation",l),clearInterval(h),r(),a[a.state+"End"]&&a[a.state+"End"](e),a.state="",a.isMousePressed=o.$isMousePressed=!1,o.$keepTextAreaAtCursor&&o.$moveTextAreaToCursor(),a.$onCaptureMouseMove=a.releaseMouse=null,e&&a.onMouseEvent("mouseup",e),s.endOperation()}function r(){a[a.state]&&a[a.state](),a.$mouseMoved=!1}var s=this.editor,o=this.editor.renderer,a=(o.$isMousePressed=!0,this);if(d.isOldIE&&"dblclick"==e.domEvent.type)return setTimeout(function(){n(e)});var l=function(e){a.releaseMouse&&s.curOp.command.name&&s.curOp.selectionChanged&&(a[a.state+"End"]&&a[a.state+"End"](),a.state="",a.releaseMouse())},h=(s.on("beforeEndOperation",l),s.startOperation({command:{name:"mouse"}}),a.$onCaptureMouseMove=i,a.releaseMouse=c.capture(this.editor.container,i,n),setInterval(r,20))},this.releaseMouse=null,this.cancelContextMenu=function(){var t=function(e){e&&e.domEvent&&"contextmenu"!=e.domEvent.type||(this.editor.off("nativecontextmenu",t),e&&e.domEvent&&c.stopEvent(e.domEvent))}.bind(this);setTimeout(t,10),this.editor.on("nativecontextmenu",t)},this.destroy=function(){this.releaseMouse&&this.releaseMouse()}}).call(n.prototype),e.defineOptions(n.prototype,"mouseHandler",{scrollSpeed:{initialValue:2},dragDelay:{initialValue:d.isMac?150:0},dragEnabled:{initialValue:!0},focusTimeout:{initialValue:0},tooltipFollowsMouse:{initialValue:!0}}),t.MouseHandler=n}),ace.define("ace/mouse/fold_handler",["require","exports","module","ace/lib/dom"],function(e,t,i){"use strict";var n=e("../lib/dom");t.FoldHandler=function(r){r.on("click",function(e){var t=e.getDocumentPosition(),i=r.session,t=i.getFoldAt(t.row,t.column,1),t=(t&&(e.getAccelKey()?i.removeFold(t):i.expandFold(t),e.stop()),e.domEvent&&e.domEvent.target);t&&n.hasCssClass(t,"ace_inline_button")&&n.hasCssClass(t,"ace_toggle_wrap")&&(i.setOption("wrap",!i.getUseWrapMode()),r.renderer.scrollCursorIntoView())}),r.on("gutterclick",function(e){var t,i;"foldWidgets"==r.renderer.$gutterLayer.getRegion(e)&&(t=e.getDocumentPosition().row,(i=r.session).foldWidgets&&i.foldWidgets[t]&&r.session.onFoldWidgetClick(t,e),r.isFocused()||r.focus(),e.stop())}),r.on("gutterdblclick",function(e){var t,i,n;"foldWidgets"==r.renderer.$gutterLayer.getRegion(e)&&(n=e.getDocumentPosition().row,(i=(i=(t=r.session).getParentFoldRangeData(n,!0)).range||i.firstRange)&&(n=i.start.row,(n=t.getFoldAt(n,t.getLine(n).length,1))?t.removeFold(n):(t.addFold("...",i),r.renderer.scrollCursorIntoView({row:i.start.row,column:0}))),e.stop())})}}),ace.define("ace/keyboard/keybinding",["require","exports","module","ace/lib/keys","ace/lib/event"],function(e,t,i){"use strict";function n(e){this.$editor=e,this.$data={editor:e},this.$handlers=[],this.setDefaultHandler(e.commands)}var r=e("../lib/keys"),l=e("../lib/event");(function(){this.setDefaultHandler=function(e){this.removeKeyboardHandler(this.$defaultHandler),this.$defaultHandler=e,this.addKeyboardHandler(e,0)},this.setKeyboardHandler=function(e){var t=this.$handlers;if(t[t.length-1]!=e){for(;t[t.length-1]&&t[t.length-1]!=this.$defaultHandler;)this.removeKeyboardHandler(t[t.length-1]);this.addKeyboardHandler(e,1)}},this.addKeyboardHandler=function(e,t){var i;e&&("function"!=typeof e||e.handleKeyboard||(e.handleKeyboard=e),-1!=(i=this.$handlers.indexOf(e))&&this.$handlers.splice(i,1),null==t?this.$handlers.push(e):this.$handlers.splice(t,0,e),-1==i)&&e.attach&&e.attach(this.$editor)},this.removeKeyboardHandler=function(e){var t=this.$handlers.indexOf(e);return-1!=t&&(this.$handlers.splice(t,1),e.detach&&e.detach(this.$editor),!0)},this.getKeyboardHandler=function(){return this.$handlers[this.$handlers.length-1]},this.getStatusText=function(){var t=this.$data,i=t.editor;return this.$handlers.map(function(e){return e.getStatusText&&e.getStatusText(i,t)||""}).filter(Boolean).join(" ")},this.$callKeyboardHandlers=function(e,t,i,n){for(var r,s=!1,o=this.$editor.commands,a=this.$handlers.length;a--&&!((r=this.$handlers[a].handleKeyboard(this.$data,e,t,i,n))&&r.command&&((s="null"==r.command||o.exec(r.command,this.$editor,r.args,n))&&n&&-1!=e&&1!=r.passEvent&&1!=r.command.passEvent&&l.stopEvent(n),s)););return s||-1!=e||(r={command:"insertstring"},s=o.exec("insertstring",this.$editor,t)),s&&this.$editor._signal&&this.$editor._signal("keyboardActivity",r),s},this.onCommandKey=function(e,t,i){var n=r.keyCodeToString(i);return this.$callKeyboardHandlers(t,n,i,e)},this.onTextInput=function(e){return this.$callKeyboardHandlers(-1,e)}}).call(n.prototype),t.KeyBinding=n}),ace.define("ace/lib/bidiutil",["require","exports","module"],function(e,l,t){"use strict";function h(e,t,i,n){var r,s,o,a=g?x:w,l=0,h=-1,c=null,d=null,u=[];if(!n)for(c=0,n=[];c<i;c++)n[c]=m(e[c]);for(f=g,b=y=v=!1,d=0;d<i;d++){if(o=l,u[d]=r=function(e,t,i,n){var r,s,o,a=t[n];switch(a){case S:case A:v=!1;case C:case _:return a;case k:return v?_:k;case M:return v=!0,A;case R:return C;case $:return n<1||n+1>=t.length||(r=i[n-1])!=k&&r!=_||(l=t[n+1])!=k&&l!=_?C:(l=v?_:l)==r?l:C;case L:return(r=0<n?i[n-1]:T)==k&&n+1<t.length&&t[n+1]==k?k:C;case I:if(0<n&&i[n-1]==k)return k;if(v)return C;for(o=n+1,s=t.length;o<s&&t[o]==I;)o++;return o<s&&t[o]==k?k:C;case F:for(s=t.length,o=n+1;o<s&&t[o]==F;)o++;if(o<s){var l=e[n],l=1425<=l&&l<=2303||64286==l;if(r=t[o],l&&(r==A||r==M))return A}return n<1||(r=t[n-1])==T?C:i[n-1];case T:return y=!(v=!1),g;case E:return b=!0,C;case P:case D:case N:case B:case O:v=!1;case z:return C}}(e,n,u,d),o=240&(l=a[o][r]),l&=15,t[d]=s=a[l][5],0<o){if(16==o)for(c=h;c<d;c++)t[c]=1;h=-1}if(a[l][6])-1==h&&(h=d);else if(-1<h){for(c=h;c<d;c++)t[c]=s;h=-1}n[d]==T&&(t[d]=0),f|=s}if(b)for(c=0;c<i;c++)if(n[c]==E){t[c]=g;for(var p=c-1;0<=p&&n[p]==R;p--)t[p]=g}}function c(e,t,i){if(!(f<e))if(1!=e||1!=g||y)for(var n,r,s,o,a=i.length,l=0;l<a;){if(t[l]>=e){for(n=l+1;n<a&&t[n]>=e;)n++;for(r=l,s=n-1;r<s;r++,s--)o=i[r],i[r]=i[s],i[s]=o;l=n}l++}else i.reverse()}function m(e){var t=e.charCodeAt(0),i=t>>8;return 0==i?191<t?S:n[t]:5==i?/[\u0591-\u05f4]/.test(e)?A:S:6==i?/[\u0610-\u061a\u064b-\u065f\u06d6-\u06e4\u06e7-\u06ed]/.test(e)?F:/[\u0660-\u0669\u066b-\u066c]/.test(e)?_:1642==t?I:/[\u06f0-\u06f9]/.test(e)?k:M:32==i&&t<=8287?r[255&t]:254==i&&65136<=t?M:C}var g=0,f=0,v=!1,y=!1,b=!1,w=[[0,3,0,1,0,0,0],[0,3,0,1,2,2,0],[0,3,0,17,2,0,1],[0,3,5,5,4,1,0],[0,3,21,21,4,0,1],[0,3,5,5,4,2,0]],x=[[2,0,1,1,0,1,0],[2,0,1,1,0,2,0],[2,0,2,1,3,2,0],[2,0,2,33,3,1,1]],S=0,A=1,k=2,_=3,C=4,T=5,E=6,M=7,R=8,$=9,L=10,I=11,F=12,P=13,D=14,O=15,N=16,B=17,z=18,n=[z,z,z,z,z,z,z,z,z,E,T,E,R,T,z,z,z,z,z,z,z,z,z,z,z,z,z,z,T,T,T,E,R,C,C,I,I,I,C,C,C,C,C,L,$,L,$,$,k,k,k,k,k,k,k,k,k,k,$,C,C,C,C,C,C,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,C,C,C,C,C,C,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,C,C,C,C,z,z,z,z,z,z,T,z,z,z,z,z,z,z,z,z,z,z,z,z,z,z,z,z,z,z,z,z,z,z,z,z,z,$,C,I,I,I,I,C,C,C,C,S,C,C,z,C,C,I,I,k,k,C,S,C,C,C,k,S,C,C,C,C,C],r=[R,R,R,R,R,R,R,R,R,R,R,z,z,z,S,A,C,C,C,C,C,C,C,C,C,C,C,C,C,C,C,C,C,C,C,C,C,C,C,C,R,T,P,D,O,N,B,$,I,I,I,I,I,C,C,C,C,C,C,C,C,C,C,C,C,C,C,C,$,C,C,C,C,C,C,C,C,C,C,C,C,C,C,C,C,C,C,C,C,C,C,C,C,C,C,R];l.L=S,l.R=A,l.EN=k,l.ON_R=3,l.AN=4,l.R_H=5,l.B=6,l.RLE=7,l.DOT="·",l.doBidiReorder=function(e,t,i){if(e.length<2)return{};var n=e.split(""),r=new Array(n.length),s=new Array(n.length),o=[];g=i?1:0,h(n,o,n.length,t);for(var a=0;a<r.length;r[a]=a,a++);c(2,o,r),c(1,o,r);for(a=0;a<r.length-1;a++)t[a]===_?o[a]=l.AN:o[a]===A&&(t[a]>M&&t[a]<P||t[a]===C||t[a]===z)?o[a]=l.ON_R:0<a&&"ل"===n[a-1]&&/\u0622|\u0623|\u0625|\u0627/.test(n[a])&&(o[a-1]=o[a]=l.R_H,a++);n[n.length-1]===l.DOT&&(o[n.length-1]=l.B),""===n[0]&&(o[0]=l.RLE);for(a=0;a<r.length;a++)s[a]=o[r[a]];return{logicalFromVisual:r,bidiLevels:s}},l.hasBidiCharacters=function(e,t){for(var i=!1,n=0;n<e.length;n++)t[n]=m(e.charAt(n)),i||t[n]!=A&&t[n]!=M&&t[n]!=_||(i=!0);return i},l.getVisualFromLogicalIdx=function(e,t){for(var i=0;i<t.logicalFromVisual.length;i++)if(t.logicalFromVisual[i]==e)return i;return 0}}),ace.define("ace/bidihandler",["require","exports","module","ace/lib/bidiutil","ace/lib/lang"],function(e,t,i){"use strict";function n(e){this.session=e,this.bidiMap={},this.currentRow=null,this.bidiUtil=a,this.charWidths=[],this.EOL="¬",this.showInvisibles=!0,this.isRtlDir=!1,this.$isRtl=!1,this.line="",this.wrapIndent=0,this.EOF="¶",this.RLE="",this.contentWidth=0,this.fontMetrics=null,this.rtlLineOffset=0,this.wrapOffset=0,this.isMoveLeftOperation=!1,this.seenBidi=r.test(e.getValue())}var a=e("./lib/bidiutil"),o=e("./lib/lang"),r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\u202B]/;(function(){this.isBidiRow=function(e,t,i){return!!this.seenBidi&&(e!==this.currentRow&&(this.currentRow=e,this.updateRowLine(t,i),this.updateBidiMap()),this.bidiMap.bidiLevels)},this.onChange=function(e){this.seenBidi?this.currentRow=null:"insert"==e.action&&r.test(e.lines.join("\n"))&&(this.seenBidi=!0,this.currentRow=null)},this.getDocumentRow=function(){var e=0,t=this.session.$screenRowCache;return e=t.length&&0<=(t=this.session.$getRowCacheIndex(t,this.currentRow))?this.session.$docRowCache[t]:e},this.getSplitIndex=function(){var e=0,t=this.session.$screenRowCache;if(t.length)for(var i,n=this.session.$getRowCacheIndex(t,this.currentRow);0<this.currentRow-e&&(i=this.session.$getRowCacheIndex(t,this.currentRow-e-1))===n;)n=i,e++;else e=this.currentRow;return e},this.updateRowLine=function(e,t){var i,n=(e=void 0===e?this.getDocumentRow():e)===this.session.getLength()-1?this.EOF:this.EOL,r=(this.wrapIndent=0,this.line=this.session.getLine(e),this.isRtlDir=this.$isRtl||this.line.charAt(0)===this.RLE,this.session.$useWrapMode&&((e=this.session.$wrapData[e])&&(0<(t=void 0===t?this.getSplitIndex():t)&&e.length?(this.wrapIndent=e.indent,this.wrapOffset=this.wrapIndent*this.charWidths[a.L],this.line=t<e.length?this.line.substring(e[t-1],e[t]):this.line.substring(e[e.length-1])):this.line=this.line.substring(0,e[t])),t!=e.length)||(this.line+=this.showInvisibles?n:a.DOT),this.session),s=0;this.line=this.line.replace(/\t|[\u1100-\u2029, \u202F-\uFFE6]/g,function(e,t){return"\t"===e||r.isFullWidth(e.charCodeAt(0))?(i="\t"===e?r.getScreenTabSize(t+s):2,s+=i-1,o.stringRepeat(a.DOT,i)):e}),this.isRtlDir&&(this.fontMetrics.$main.textContent=this.line.charAt(this.line.length-1)==a.DOT?this.line.substr(0,this.line.length-1):this.line,this.rtlLineOffset=this.contentWidth-this.fontMetrics.$main.getBoundingClientRect().width)},this.updateBidiMap=function(){var e=[];a.hasBidiCharacters(this.line,e)||this.isRtlDir?this.bidiMap=a.doBidiReorder(this.line,e,this.isRtlDir):this.bidiMap={}},this.markAsDirty=function(){this.currentRow=null},this.updateCharacterWidths=function(e){var t;this.characterWidth!==e.$characterSize.width&&(this.fontMetrics=e,t=this.characterWidth=e.$characterSize.width,e=e.$measureCharWidth("ה"),this.charWidths[a.L]=this.charWidths[a.EN]=this.charWidths[a.ON_R]=t,this.charWidths[a.R]=this.charWidths[a.AN]=e,this.charWidths[a.R_H]=.45*e,this.charWidths[a.B]=this.charWidths[a.RLE]=0,this.currentRow=null)},this.setShowInvisibles=function(e){this.showInvisibles=e,this.currentRow=null},this.setEolChar=function(e){this.EOL=e},this.setContentWidth=function(e){this.contentWidth=e},this.isRtlLine=function(e){return!!this.$isRtl||(null!=e?this.session.getLine(e).charAt(0)==this.RLE:this.isRtlDir)},this.setRtlDirection=function(e,t){for(var i=e.getCursorPosition(),n=e.selection.getSelectionAnchor().row;n<=i.row;n++)t||e.session.getLine(n).charAt(0)!==e.session.$bidiHandler.RLE?t&&e.session.getLine(n).charAt(0)!==e.session.$bidiHandler.RLE&&e.session.doc.insert({column:0,row:n},e.session.$bidiHandler.RLE):e.session.doc.removeInLine(n,0,1)},this.getPosLeft=function(e){e-=this.wrapIndent;var t=this.line.charAt(0)===this.RLE?1:0,i=t<e?this.session.getOverwrite()?e:e-1:t,n=a.getVisualFromLogicalIdx(i,this.bidiMap),r=this.bidiMap.bidiLevels,s=0;!this.session.getOverwrite()&&e<=t&&r[n]%2!=0&&n++;for(var o=0;o<n;o++)s+=this.charWidths[r[o]];return!this.session.getOverwrite()&&t<e&&r[n]%2==0&&(s+=this.charWidths[r[n]]),this.wrapIndent&&(s+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset),this.isRtlDir&&(s+=this.rtlLineOffset),s},this.getSelections=function(e,t){var i,n=this.bidiMap,r=n.bidiLevels,s=[],o=0,a=Math.min(e,t)-this.wrapIndent,l=Math.max(e,t)-this.wrapIndent,h=!1,c=!1,d=0;this.wrapIndent&&(o+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset);for(var u,p=0;p<r.length;p++)u=n.logicalFromVisual[p],i=r[p],(h=a<=u&&u<l)&&!c?d=o:!h&&c&&s.push({left:d,width:o-d}),o+=this.charWidths[i],c=h;if(h&&p===r.length&&s.push({left:d,width:o-d}),this.isRtlDir)for(var m=0;m<s.length;m++)s[m].left+=this.rtlLineOffset;return s},this.offsetToCol=function(e){this.isRtlDir&&(e-=this.rtlLineOffset);var t=0,e=Math.max(e,0),i=0,n=0,r=this.bidiMap.bidiLevels,s=this.charWidths[r[n]];for(this.wrapIndent&&(e-=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset);i+s/2<e;){if(i+=s,n===r.length-1){s=0;break}s=this.charWidths[r[++n]]}return 0===(t=0<n&&r[n-1]%2!=0&&r[n]%2==0?(e<i&&n--,this.bidiMap.logicalFromVisual[n]):0<n&&r[n-1]%2==0&&r[n]%2!=0?1+(i<e?this.bidiMap.logicalFromVisual[n]:this.bidiMap.logicalFromVisual[n-1]):this.isRtlDir&&n===r.length-1&&0===s&&r[n-1]%2==0||!this.isRtlDir&&0===n&&r[n]%2!=0?1+this.bidiMap.logicalFromVisual[n]:(0<n&&r[n-1]%2!=0&&0!==s&&n--,this.bidiMap.logicalFromVisual[n]))&&this.isRtlDir&&t++,t+this.wrapIndent}}).call(n.prototype),t.BidiHandler=n}),ace.define("ace/selection",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/range"],function(e,t,i){"use strict";function n(e){this.session=e,this.doc=e.getDocument(),this.clearSelection(),this.cursor=this.lead=this.doc.createAnchor(0,0),this.anchor=this.doc.createAnchor(0,0),this.$silent=!1;var t=this;this.cursor.on("change",function(e){t.$cursorChanged=!0,t.$silent||t._emit("changeCursor"),t.$isEmpty||t.$silent||t._emit("changeSelection"),t.$keepDesiredColumnOnChange||e.old.column==e.value.column||(t.$desiredColumn=null)}),this.anchor.on("change",function(){t.$anchorChanged=!0,t.$isEmpty||t.$silent||t._emit("changeSelection")})}var r=e("./lib/oop"),s=e("./lib/lang"),o=e("./lib/event_emitter").EventEmitter,a=e("./range").Range;(function(){r.implement(this,o),this.isEmpty=function(){return this.$isEmpty||this.anchor.row==this.lead.row&&this.anchor.column==this.lead.column},this.isMultiLine=function(){return!this.$isEmpty&&this.anchor.row!=this.cursor.row},this.getCursor=function(){return this.lead.getPosition()},this.setSelectionAnchor=function(e,t){this.$isEmpty=!1,this.anchor.setPosition(e,t)},this.getAnchor=this.getSelectionAnchor=function(){return this.$isEmpty?this.getSelectionLead():this.anchor.getPosition()},this.getSelectionLead=function(){return this.lead.getPosition()},this.isBackwards=function(){var e=this.anchor,t=this.lead;return e.row>t.row||e.row==t.row&&e.column>t.column},this.getRange=function(){var e=this.anchor,t=this.lead;return this.$isEmpty?a.fromPoints(t,t):this.isBackwards()?a.fromPoints(t,e):a.fromPoints(e,t)},this.clearSelection=function(){this.$isEmpty||(this.$isEmpty=!0,this._emit("changeSelection"))},this.selectAll=function(){this.$setSelection(0,0,Number.MAX_VALUE,Number.MAX_VALUE)},this.setRange=this.setSelectionRange=function(e,t){var i=t?e.end:e.start,t=t?e.start:e.end;this.$setSelection(i.row,i.column,t.row,t.column)},this.$setSelection=function(e,t,i,n){var r,s;!this.$silent&&(r=this.$isEmpty,s=this.inMultiSelectMode,this.$silent=!0,this.$cursorChanged=this.$anchorChanged=!1,this.anchor.setPosition(e,t),this.cursor.setPosition(i,n),this.$isEmpty=!a.comparePoints(this.anchor,this.cursor),this.$silent=!1,this.$cursorChanged&&this._emit("changeCursor"),this.$cursorChanged||this.$anchorChanged||r!=this.$isEmpty||s)&&this._emit("changeSelection")},this.$moveSelection=function(e){var t=this.lead;this.$isEmpty&&this.setSelectionAnchor(t.row,t.column),e.call(this)},this.selectTo=function(e,t){this.$moveSelection(function(){this.moveCursorTo(e,t)})},this.selectToPosition=function(e){this.$moveSelection(function(){this.moveCursorToPosition(e)})},this.moveTo=function(e,t){this.clearSelection(),this.moveCursorTo(e,t)},this.moveToPosition=function(e){this.clearSelection(),this.moveCursorToPosition(e)},this.selectUp=function(){this.$moveSelection(this.moveCursorUp)},this.selectDown=function(){this.$moveSelection(this.moveCursorDown)},this.selectRight=function(){this.$moveSelection(this.moveCursorRight)},this.selectLeft=function(){this.$moveSelection(this.moveCursorLeft)},this.selectLineStart=function(){this.$moveSelection(this.moveCursorLineStart)},this.selectLineEnd=function(){this.$moveSelection(this.moveCursorLineEnd)},this.selectFileEnd=function(){this.$moveSelection(this.moveCursorFileEnd)},this.selectFileStart=function(){this.$moveSelection(this.moveCursorFileStart)},this.selectWordRight=function(){this.$moveSelection(this.moveCursorWordRight)},this.selectWordLeft=function(){this.$moveSelection(this.moveCursorWordLeft)},this.getWordRange=function(e,t){var i;return void 0===t&&(e=(i=e||this.lead).row,t=i.column),this.session.getWordRange(e,t)},this.selectWord=function(){this.setSelectionRange(this.getWordRange())},this.selectAWord=function(){var e=this.getCursor(),e=this.session.getAWordRange(e.row,e.column);this.setSelectionRange(e)},this.getLineRange=function(e,t){var e="number"==typeof e?e:this.lead.row,i=this.session.getFoldLine(e),i=i?(e=i.start.row,i.end.row):e;return!0===t?new a(e,0,i,this.session.getLine(i).length):new a(e,0,i+1,0)},this.selectLine=function(){this.setSelectionRange(this.getLineRange())},this.moveCursorUp=function(){this.moveCursorBy(-1,0)},this.moveCursorDown=function(){this.moveCursorBy(1,0)},this.wouldMoveIntoSoftTab=function(e,t,i){var n=e.column,r=e.column+t;return i<0&&(n=e.column-t,r=e.column),this.session.isTabStop(e)&&this.doc.getLine(e.row).slice(n,r).split(" ").length-1==t},this.moveCursorLeft=function(){var e,t=this.lead.getPosition();(e=this.session.getFoldAt(t.row,t.column,-1))?this.moveCursorTo(e.start.row,e.start.column):0===t.column?0<t.row&&this.moveCursorTo(t.row-1,this.doc.getLine(t.row-1).length):(e=this.session.getTabSize(),this.wouldMoveIntoSoftTab(t,e,-1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,-e):this.moveCursorBy(0,-1))},this.moveCursorRight=function(){var e,t=this.lead.getPosition();(e=this.session.getFoldAt(t.row,t.column,1))?this.moveCursorTo(e.end.row,e.end.column):this.lead.column==this.doc.getLine(this.lead.row).length?this.lead.row<this.doc.getLength()-1&&this.moveCursorTo(this.lead.row+1,0):(e=this.session.getTabSize(),t=this.lead,this.wouldMoveIntoSoftTab(t,e,1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,e):this.moveCursorBy(0,1))},this.moveCursorLineStart=function(){var e=this.lead.row,t=this.lead.column,i=this.session.documentToScreenRow(e,t),i=this.session.screenToDocumentPosition(i,0),e=this.session.getDisplayLine(e,null,i.row,i.column).match(/^\s*/);e[0].length==t||this.session.$useEmacsStyleLineStart||(i.column+=e[0].length),this.moveCursorToPosition(i)},this.moveCursorLineEnd=function(){var e,t=this.lead,t=this.session.getDocumentLastRowColumnPosition(t.row,t.column);this.lead.column==t.column&&(e=this.session.getLine(t.row),t.column==e.length)&&0<(e=e.search(/\s+$/))&&(t.column=e),this.moveCursorTo(t.row,t.column)},this.moveCursorFileEnd=function(){var e=this.doc.getLength()-1,t=this.doc.getLine(e).length;this.moveCursorTo(e,t)},this.moveCursorFileStart=function(){this.moveCursorTo(0,0)},this.moveCursorLongWordRight=function(){var e=this.lead.row,t=this.lead.column,i=this.doc.getLine(e),n=i.substring(t),r=(this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0,this.session.getFoldAt(e,t,1));r?this.moveCursorTo(r.end.row,r.end.column):(this.session.nonTokenRe.exec(n)&&(t+=this.session.nonTokenRe.lastIndex,this.session.nonTokenRe.lastIndex=0,n=i.substring(t)),t>=i.length?(this.moveCursorTo(e,i.length),this.moveCursorRight(),e<this.doc.getLength()-1&&this.moveCursorWordRight()):(this.session.tokenRe.exec(n)&&(t+=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(e,t)))},this.moveCursorLongWordLeft=function(){var e,t=this.lead.row,i=this.lead.column;(e=this.session.getFoldAt(t,i,-1))?this.moveCursorTo(e.start.row,e.start.column):(null==(e=this.session.getFoldStringAt(t,i,-1))&&(e=this.doc.getLine(t).substring(0,i)),e=s.stringReverse(e),this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0,this.session.nonTokenRe.exec(e)&&(i-=this.session.nonTokenRe.lastIndex,e=e.slice(this.session.nonTokenRe.lastIndex),this.session.nonTokenRe.lastIndex=0),i<=0?(this.moveCursorTo(t,0),this.moveCursorLeft(),0<t&&this.moveCursorWordLeft()):(this.session.tokenRe.exec(e)&&(i-=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(t,i)))},this.$shortWordEndIndex=function(e){var t,i=0,n=/\s/,r=this.session.tokenRe;if(r.lastIndex=0,this.session.tokenRe.exec(e))i=this.session.tokenRe.lastIndex;else{for(;(t=e[i])&&n.test(t);)i++;if(i<1)for(r.lastIndex=0;(t=e[i])&&!r.test(t);)if(r.lastIndex=0,i++,n.test(t)){if(2<i){i--;break}for(;(t=e[i])&&n.test(t);)i++;if(2<i)break}}return r.lastIndex=0,i},this.moveCursorShortWordRight=function(){var e=this.lead.row,t=this.lead.column,i=this.doc.getLine(e),n=i.substring(t),r=this.session.getFoldAt(e,t,1);if(r)return this.moveCursorTo(r.end.row,r.end.column);if(t==i.length){for(var s=this.doc.getLength();n=this.doc.getLine(++e),e<s&&/^\s*$/.test(n););/^\s+/.test(n)||(n=""),t=0}r=this.$shortWordEndIndex(n);this.moveCursorTo(e,t+r)},this.moveCursorShortWordLeft=function(){var e=this.lead.row,t=this.lead.column;if(n=this.session.getFoldAt(e,t,-1))return this.moveCursorTo(n.start.row,n.start.column);var i=this.session.getLine(e).substring(0,t);if(0===t){for(;i=this.doc.getLine(--e),0<e&&/^\s*$/.test(i););t=i.length,/\s+$/.test(i)||(i="")}var n=s.stringReverse(i),n=this.$shortWordEndIndex(n);return this.moveCursorTo(e,t-n)},this.moveCursorWordRight=function(){this.session.$selectLongWords?this.moveCursorLongWordRight():this.moveCursorShortWordRight()},this.moveCursorWordLeft=function(){this.session.$selectLongWords?this.moveCursorLongWordLeft():this.moveCursorShortWordLeft()},this.moveCursorBy=function(e,t){var i,n=this.session.documentToScreenPosition(this.lead.row,this.lead.column),r=(0===t&&(0!==e&&(this.session.$bidiHandler.isBidiRow(n.row,this.lead.row)?(i=this.session.$bidiHandler.getPosLeft(n.column),n.column=Math.round(i/this.session.$bidiHandler.charWidths[0])):i=n.column*this.session.$bidiHandler.charWidths[0]),this.$desiredColumn?n.column=this.$desiredColumn:this.$desiredColumn=n.column),0!=e&&this.session.lineWidgets&&this.session.lineWidgets[this.lead.row]&&(r=this.session.lineWidgets[this.lead.row],e<0?e-=r.rowsAbove||0:0<e&&(e+=r.rowCount-(r.rowsAbove||0))),this.session.screenToDocumentPosition(n.row+e,n.column,i));0!==e&&0===t&&r.row===this.lead.row&&(r.column,this.lead.column),this.moveCursorTo(r.row,r.column+t,0===t)},this.moveCursorToPosition=function(e){this.moveCursorTo(e.row,e.column)},this.moveCursorTo=function(e,t,i){var n=this.session.getFoldAt(e,t,1),n=(n&&(e=n.start.row,t=n.start.column),this.$keepDesiredColumnOnChange=!0,this.session.getLine(e));/[\uDC00-\uDFFF]/.test(n.charAt(t))&&n.charAt(t-1)&&(this.lead.row==e&&this.lead.column==t+1?--t:t+=1),this.lead.setPosition(e,t),this.$keepDesiredColumnOnChange=!1,i||(this.$desiredColumn=null)},this.moveCursorToScreen=function(e,t,i){e=this.session.screenToDocumentPosition(e,t);this.moveCursorTo(e.row,e.column,i)},this.detach=function(){this.lead.detach(),this.anchor.detach(),this.session=this.doc=null},this.fromOrientedRange=function(e){this.setSelectionRange(e,e.cursor==e.start),this.$desiredColumn=e.desiredColumn||this.$desiredColumn},this.toOrientedRange=function(e){var t=this.getRange();return e?(e.start.column=t.start.column,e.start.row=t.start.row,e.end.column=t.end.column,e.end.row=t.end.row):e=t,e.cursor=this.isBackwards()?e.start:e.end,e.desiredColumn=this.$desiredColumn,e},this.getRangeOfMovements=function(e){var t=this.getCursor();try{e(this);var i=this.getCursor();return a.fromPoints(t,i)}catch(e){return a.fromPoints(t,t)}finally{this.moveCursorToPosition(t)}},this.toJSON=function(){var e;return this.rangeCount?e=this.ranges.map(function(e){var t=e.clone();return t.isBackwards=e.cursor==e.start,t}):(e=this.getRange()).isBackwards=this.isBackwards(),e},this.fromJSON=function(e){if(null==e.start){if(this.rangeList&&1<e.length){this.toSingleRange(e[0]);for(var t=e.length;t--;){var i=a.fromPoints(e[t].start,e[t].end);e[t].isBackwards&&(i.cursor=i.start),this.addRange(i,!0)}return}e=e[0]}this.rangeList&&this.toSingleRange(e),this.setSelectionRange(e,e.isBackwards)},this.isEqual=function(e){if((e.length||this.rangeCount)&&e.length!=this.rangeCount)return!1;if(!e.length||!this.ranges)return this.getRange().isEqual(e);for(var t=this.ranges.length;t--;)if(!this.ranges[t].isEqual(e[t]))return!1;return!0}}).call(n.prototype),t.Selection=n}),ace.define("ace/tokenizer",["require","exports","module","ace/config"],function(e,t,i){"use strict";function n(e){for(var t in this.states=e,this.regExps={},this.matchMappings={},this.states){for(var i=this.states[t],n=[],r=0,s=this.matchMappings[t]={defaultToken:"text"},o="g",a=[],l=0;l<i.length;l++){var h,c,d=i[l];d.defaultToken&&(s.defaultToken=d.defaultToken),d.caseInsensitive&&(o="gi"),null==d.regex||(d.regex instanceof RegExp&&(d.regex=d.regex.toString().slice(1,-1)),h=d.regex,c=new RegExp("(?:("+h+")|(.))").exec("a").length-2,Array.isArray(d.token)?1==d.token.length||1==c?d.token=d.token[0]:c-1!=d.token.length?(this.reportError("number of classes and regexp groups doesn't match",{rule:d,groupCount:c-1}),d.token=d.token[0]):(d.tokenArray=d.token,d.token=null,d.onMatch=this.$arrayTokens):"function"!=typeof d.token||d.onMatch||(d.onMatch=1<c?this.$applyToken:d.token),1<c&&(h=/\\\d/.test(d.regex)?d.regex.replace(/\\([0-9]+)/g,function(e,t){return"\\"+(parseInt(t,10)+r+1)}):(c=1,this.removeCapturingGroups(d.regex)),!d.splitRegex)&&"string"!=typeof d.token&&a.push(d),s[r]=l,r+=c,n.push(h),d.onMatch)||(d.onMatch=null)}n.length||(s[0]=0,n.push("$")),a.forEach(function(e){e.splitRegex=this.createSplitterRegexp(e.regex,o)},this),this.regExps[t]=new RegExp("("+n.join(")|(")+")|($)",o)}}var r=e("./config"),y=2e3;(function(){this.$setMaxTokenCount=function(e){y=0|e},this.$applyToken=function(e){var t=this.splitRegex.exec(e).slice(1),i=this.token.apply(this,t);if("string"==typeof i)return[{type:i,value:e}];for(var n=[],r=0,s=i.length;r<s;r++)t[r]&&(n[n.length]={type:i[r],value:t[r]});return n},this.$arrayTokens=function(e){if(!e)return[];var t=this.splitRegex.exec(e);if(!t)return"text";for(var i=[],n=this.tokenArray,r=0,s=n.length;r<s;r++)t[r+1]&&(i[i.length]={type:n[r],value:t[r+1]});return i},this.removeCapturingGroups=function(e){return e.replace(/\\.|\[(?:\\.|[^\\\]])*|\(\?[:=!]|(\()/g,function(e,t){return t?"(?:":e})},this.createSplitterRegexp=function(e,t){var o,a,l;return"$"!=(e="^"!=(e=-1!=e.indexOf("(?=")&&(o=0,a=!1,l={},e.replace(/(\\.)|(\((?:\?[=!])?)|(\))|([\[\]])/g,function(e,t,i,n,r,s){return a?a="]"!=r:r?a=!0:n?(o==l.stack&&(l.end=s+1,l.stack=-1),o--):i&&(o++,1!=i.length)&&(l.stack=o,l.start=s),e}),null!=l.end)&&/^\)*$/.test(e.substr(l.end))?e.substring(0,l.start)+e.substr(l.end):e).charAt(0)?"^"+e:e).charAt(e.length-1)&&(e+="$"),new RegExp(e,(t||"").replace("g",""))},this.getLineTokens=function(e,t){t&&"string"!=typeof t?"#tmp"===(t=(i=t.slice(0))[0])&&(i.shift(),t=i.shift()):i=[];for(var i,n,r=t||"start",s=this.states[r],o=(s||(s=this.states[r="start"]),this.matchMappings[r]),a=this.regExps[r],l=[],h=a.lastIndex=0,c=0,d={type:null,value:""};n=a.exec(e);){var u,p=o.defaultToken,m=null,g=n[0],f=a.lastIndex;f-g.length>h&&(u=e.substring(h,f-g.length),d.type==p?d.value+=u:(d.type&&l.push(d),d={type:p,value:u}));for(var v=0;v<n.length-2;v++)if(void 0!==n[v+1]){p=(m=s[o[v]]).onMatch?m.onMatch(g,r,i,e):m.token,m.next&&(r="string"==typeof m.next?m.next:m.next(r,i),(s=this.states[r])||(this.reportError("state doesn't exist",r),s=this.states[r="start"]),o=this.matchMappings[r],(a=this.regExps[r]).lastIndex=h=f),m.consumeLineEnd&&(h=f);break}if(g)if("string"==typeof p)m&&!1===m.merge||d.type!==p?(d.type&&l.push(d),d={type:p,value:g}):d.value+=g;else if(p){d.type&&l.push(d);for(d={type:null,value:""},v=0;v<p.length;v++)l.push(p[v])}if(h==e.length)break;if(h=f,c++>y){for(c>2*e.length&&this.reportError("infinite loop with in ace tokenizer",{startState:t,line:e});h<e.length;)d.type&&l.push(d),d={value:e.substring(h,h+=500),type:"overflow"};r="start",i=[];break}}return d.type&&l.push(d),1<i.length&&i[0]!==r&&i.unshift("#tmp",r),{tokens:l,state:i.length?i:r}},this.reportError=r.reportError}).call(n.prototype),t.Tokenizer=n}),ace.define("ace/mode/text_highlight_rules",["require","exports","module","ace/lib/lang"],function(e,t,i){"use strict";function n(){this.$rules={start:[{token:"empty_line",regex:"^$"},{defaultToken:"text"}]}}var l=e("../lib/lang");(function(){this.addRules=function(e,t){if(t)for(var i in e){for(var n=e[i],r=0;r<n.length;r++){var s=n[r];(s.next||s.onMatch)&&("string"==typeof s.next&&0!==s.next.indexOf(t)&&(s.next=t+s.next),s.nextState)&&0!==s.nextState.indexOf(t)&&(s.nextState=t+s.nextState)}this.$rules[t+i]=n}else for(var i in e)this.$rules[i]=e[i]},this.getRules=function(){return this.$rules},this.embedRules=function(e,t,i,n,r){e="function"==typeof e?(new e).getRules():e;if(n)for(var s=0;s<n.length;s++)n[s]=t+n[s];else for(var o in n=[],e)n.push(t+o);if(this.addRules(e,t),i)for(var a=Array.prototype[r?"push":"unshift"],s=0;s<n.length;s++)a.apply(this.$rules[n[s]],l.deepCopy(i));this.$embeds||(this.$embeds=[]),this.$embeds.push(t)},this.getEmbeds=function(){return this.$embeds};function d(e,t){return"start"==e&&!t.length||t.unshift(this.nextState,e),this.nextState}function u(e,t){return t.shift(),t.shift()||"start"}this.normalizeRules=function(){var h=0,c=this.$rules;Object.keys(c).forEach(function e(t){var i=c[t];i.processed=!0;for(var n=0;n<i.length;n++){var r=i[n],s=null,o=(Array.isArray(r)&&(s=r,r={}),!r.regex&&r.start&&(r.regex=r.start,r.next||(r.next=[]),r.next.push({defaultToken:r.token},{token:r.token+".end",regex:r.end||r.start,next:"pop"}),r.token=r.token+".start",r.push=!0),r.next||r.push);if(o&&Array.isArray(o)?((l=r.stateName)||("string"!=typeof(l=r.token)&&(l=l[0]||""),c[l]&&(l+=h++)),c[l]=o,e(r.next=l)):"pop"==o&&(r.next=u),r.push&&(r.nextState=r.next||r.push,r.next=d,delete r.push),r.rules)for(var a in r.rules)c[a]?c[a].push&&c[a].push.apply(c[a],r.rules[a]):c[a]=r.rules[a];var l="string"==typeof r?r:r.include;(s=l?Array.isArray(l)?l.map(function(e){return c[e]}):c[l]:s)&&(o=[n,1].concat(s),r.noEscape&&(o=o.filter(function(e){return!e.next})),i.splice.apply(i,o),n--),r.keywordMap&&(r.token=this.createKeywordMapper(r.keywordMap,r.defaultToken||"text",r.caseInsensitive),delete r.defaultToken)}},this)},this.createKeywordMapper=function(r,t,s,o){var a=Object.create(null);return this.$keywordList=[],Object.keys(r).forEach(function(e){for(var t=r[e].split(o||"|"),i=t.length;i--;){var n=t[i];this.$keywordList.push(n),s&&(n=n.toLowerCase()),a[n]=e}},this),r=null,s?function(e){return a[e.toLowerCase()]||t}:function(e){return a[e]||t}},this.getKeywords=function(){return this.$keywords}}).call(n.prototype),t.TextHighlightRules=n}),ace.define("ace/mode/behaviour",["require","exports","module"],function(e,t,i){"use strict";function n(){this.$behaviours={}}(function(){this.add=function(e,t,i){switch(void 0){case this.$behaviours:this.$behaviours={};case this.$behaviours[e]:this.$behaviours[e]={}}this.$behaviours[e][t]=i},this.addBehaviours=function(e){for(var t in e)for(var i in e[t])this.add(t,i,e[t][i])},this.remove=function(e){this.$behaviours&&this.$behaviours[e]&&delete this.$behaviours[e]},this.inherit=function(e,t){e=("function"==typeof e?new e:e).getBehaviours(t),this.addBehaviours(e)},this.getBehaviours=function(e){if(!e)return this.$behaviours;for(var t={},i=0;i<e.length;i++)this.$behaviours[e[i]]&&(t[e[i]]=this.$behaviours[e[i]]);return t}}).call(n.prototype),t.Behaviour=n}),ace.define("ace/token_iterator",["require","exports","module","ace/range"],function(e,t,i){"use strict";function n(e,t,i){this.$session=e,this.$row=t,this.$rowTokens=e.getTokens(t),e=e.getTokenAt(t,i),this.$tokenIndex=e?e.index:-1}var r=e("./range").Range;(function(){this.stepBackward=function(){for(--this.$tokenIndex;this.$tokenIndex<0;){if(--this.$row,this.$row<0)return this.$row=0,null;this.$rowTokens=this.$session.getTokens(this.$row),this.$tokenIndex=this.$rowTokens.length-1}return this.$rowTokens[this.$tokenIndex]},this.stepForward=function(){var e;for(this.$tokenIndex+=1;this.$tokenIndex>=this.$rowTokens.length;){if(this.$row+=1,e=e||this.$session.getLength(),this.$row>=e)return this.$row=e-1,null;this.$rowTokens=this.$session.getTokens(this.$row),this.$tokenIndex=0}return this.$rowTokens[this.$tokenIndex]},this.getCurrentToken=function(){return this.$rowTokens[this.$tokenIndex]},this.getCurrentTokenRow=function(){return this.$row},this.getCurrentTokenColumn=function(){var e=this.$rowTokens,t=this.$tokenIndex,i=e[t].start;if(void 0===i)for(i=0;0<t;)i+=e[--t].value.length;return i},this.getCurrentTokenPosition=function(){return{row:this.$row,column:this.getCurrentTokenColumn()}},this.getCurrentTokenRange=function(){var e=this.$rowTokens[this.$tokenIndex],t=this.getCurrentTokenColumn();return new r(this.$row,t,this.$row,t+e.value.length)}}).call(n.prototype),t.TokenIterator=n}),ace.define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],function(e,t,i){"use strict";function u(e){var t=-1;if((l=e.multiSelect&&(t=e.selection.index,l.rangeCount!=e.multiSelect.rangeCount)?{rangeCount:e.multiSelect.rangeCount}:l)[t])return g=l[t];g=l[t]={autoInsertedBrackets:0,autoInsertedRow:-1,autoInsertedLineEnd:"",maybeInsertedBrackets:0,maybeInsertedRow:-1,maybeInsertedLineStart:"",maybeInsertedLineEnd:""}}function p(e,t,i,n){var r=e.end.row-e.start.row;return{text:i+t+n,selection:[0,e.start.column+1,r,e.end.column+(r?0:1)]}}function m(d){this.add("braces","insertion",function(e,t,i,n,r){var s=i.getCursorPosition(),o=n.doc.getLine(s.row);if("{"==r)return u(i),l=i.getSelectionRange(),""!==(h=n.doc.getTextRange(l))&&"{"!==h&&i.getWrapBehavioursEnabled()?p(l,h,"{","}"):m.isSaneInsertion(i,n)?/[\]\}\)]/.test(o[s.column])||i.inMultiSelectMode||d&&d.braces?(m.recordAutoInsert(i,n,"}"),{text:"{}",selection:[1,1]}):(m.recordMaybeInsert(i,n,"{"),{text:"{",selection:[1,1]}):void 0;if("}"==r){u(i);var a=o.substring(s.column,s.column+1);if("}"==a)if(null!==n.$findOpeningBracket("}",{column:s.column+1,row:s.row})&&m.isAutoInsertedClosing(s,o,r))return m.popAutoInsertedClosing(),{text:"",selection:[1,1]}}else{if("\n"==r||"\r\n"==r){u(i);var l="";if(m.isMaybeInsertedClosing(s,o)&&(l=f.stringRepeat("}",g.maybeInsertedBrackets),m.clearMaybeInsertedClosing()),"}"===(a=o.substring(s.column,s.column+1))){var h=n.findMatchingBracket({row:s.row,column:s.column+1},"}");if(!h)return null;var c=this.$getIndent(n.getLine(h.row))}else{if(!l)return void m.clearMaybeInsertedClosing();c=this.$getIndent(o)}r=c+n.getTabString();return{text:"\n"+r+"\n"+c+l,selection:[1,r.length,1,r.length]}}m.clearMaybeInsertedClosing()}}),this.add("braces","deletion",function(e,t,i,n,r){var s=n.doc.getTextRange(r);if(!r.isMultiLine()&&"{"==s){if(u(i),"}"==n.doc.getLine(r.start.row).substring(r.end.column,r.end.column+1))return r.end.column++,r;g.maybeInsertedBrackets--}}),this.add("parens","insertion",function(e,t,i,n,r){if("("==r)return u(i),s=i.getSelectionRange(),""!==(o=n.doc.getTextRange(s))&&i.getWrapBehavioursEnabled()?p(s,o,"(",")"):m.isSaneInsertion(i,n)?(m.recordAutoInsert(i,n,")"),{text:"()",selection:[1,1]}):void 0;if(")"==r){u(i);var s=i.getCursorPosition(),o=n.doc.getLine(s.row),i=o.substring(s.column,s.column+1);if(")"==i)if(null!==n.$findOpeningBracket(")",{column:s.column+1,row:s.row})&&m.isAutoInsertedClosing(s,o,r))return m.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}),this.add("parens","deletion",function(e,t,i,n,r){var s=n.doc.getTextRange(r);if(!r.isMultiLine()&&"("==s&&(u(i),")"==n.doc.getLine(r.start.row).substring(r.start.column+1,r.start.column+2)))return r.end.column++,r}),this.add("brackets","insertion",function(e,t,i,n,r){if("["==r)return u(i),s=i.getSelectionRange(),""!==(o=n.doc.getTextRange(s))&&i.getWrapBehavioursEnabled()?p(s,o,"[","]"):m.isSaneInsertion(i,n)?(m.recordAutoInsert(i,n,"]"),{text:"[]",selection:[1,1]}):void 0;if("]"==r){u(i);var s=i.getCursorPosition(),o=n.doc.getLine(s.row),i=o.substring(s.column,s.column+1);if("]"==i)if(null!==n.$findOpeningBracket("]",{column:s.column+1,row:s.row})&&m.isAutoInsertedClosing(s,o,r))return m.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}),this.add("brackets","deletion",function(e,t,i,n,r){var s=n.doc.getTextRange(r);if(!r.isMultiLine()&&"["==s&&(u(i),"]"==n.doc.getLine(r.start.row).substring(r.start.column+1,r.start.column+2)))return r.end.column++,r}),this.add("string_dquotes","insertion",function(e,t,i,n,r){var s=n.$mode.$quotes||v;if(1==r.length&&s[r]&&(!this.lineCommentStart||-1==this.lineCommentStart.indexOf(r))){u(i);var o=i.getSelectionRange(),a=n.doc.getTextRange(o);if(""!==a&&(1!=a.length||!s[a])&&i.getWrapBehavioursEnabled())return p(o,a,r,r);if(!a){var s=i.getCursorPosition(),o=n.doc.getLine(s.row),a=o.substring(s.column-1,s.column),i=o.substring(s.column,s.column+1),l=n.getTokenAt(s.row,s.column),h=n.getTokenAt(s.row,s.column+1);if("\\"==a&&l&&/escape/.test(l.type))return null;var c,l=l&&/string|escape/.test(l.type),d=!h||/string|escape/.test(h.type);if(i==r)(c=l!==d)&&/string\.end/.test(h.type)&&(c=!1);else{if(l&&!d)return null;if(l&&d)return null;h=n.$mode.tokenRe,l=(h.lastIndex=0,h.test(a)),d=(h.lastIndex=0,h.test(a));if(l||d)return null;if(i&&!/[\s;,.})\]\\]/.test(i))return null;n=o[s.column-2];if(a==r&&(n==r||h.test(n)))return null;c=!0}return{text:c?r+r:"",selection:[1,1]}}}}),this.add("string_dquotes","deletion",function(e,t,i,n,r){var s=n.$mode.$quotes||v,o=n.doc.getTextRange(r);if(!r.isMultiLine()&&s.hasOwnProperty(o)&&(u(i),n.doc.getLine(r.start.row).substring(r.start.column+1,r.start.column+2)==o))return r.end.column++,r})}var g,n=e("../../lib/oop"),r=e("../behaviour").Behaviour,s=e("../../token_iterator").TokenIterator,f=e("../../lib/lang"),o=["text","paren.rparen","rparen","paren","punctuation.operator"],a=["text","paren.rparen","rparen","paren","punctuation.operator","comment"],l={},v={'"':'"',"'":"'"};m.isSaneInsertion=function(e,t){var i=e.getCursorPosition(),n=new s(t,i.row,i.column);if(!this.$matchTokenType(n.getCurrentToken()||"text",o)){if(/[)}\]]/.test(e.session.getLine(i.row)[i.column]))return!0;e=new s(t,i.row,i.column+1);if(!this.$matchTokenType(e.getCurrentToken()||"text",o))return!1}return n.stepForward(),n.getCurrentTokenRow()!==i.row||this.$matchTokenType(n.getCurrentToken()||"text",a)},m.$matchTokenType=function(e,t){return-1<t.indexOf(e.type||e)},m.recordAutoInsert=function(e,t,i){e=e.getCursorPosition(),t=t.doc.getLine(e.row);this.isAutoInsertedClosing(e,t,g.autoInsertedLineEnd[0])||(g.autoInsertedBrackets=0),g.autoInsertedRow=e.row,g.autoInsertedLineEnd=i+t.substr(e.column),g.autoInsertedBrackets++},m.recordMaybeInsert=function(e,t,i){e=e.getCursorPosition(),t=t.doc.getLine(e.row);this.isMaybeInsertedClosing(e,t)||(g.maybeInsertedBrackets=0),g.maybeInsertedRow=e.row,g.maybeInsertedLineStart=t.substr(0,e.column)+i,g.maybeInsertedLineEnd=t.substr(e.column),g.maybeInsertedBrackets++},m.isAutoInsertedClosing=function(e,t,i){return 0<g.autoInsertedBrackets&&e.row===g.autoInsertedRow&&i===g.autoInsertedLineEnd[0]&&t.substr(e.column)===g.autoInsertedLineEnd},m.isMaybeInsertedClosing=function(e,t){return 0<g.maybeInsertedBrackets&&e.row===g.maybeInsertedRow&&t.substr(e.column)===g.maybeInsertedLineEnd&&t.substr(0,e.column)==g.maybeInsertedLineStart},m.popAutoInsertedClosing=function(){g.autoInsertedLineEnd=g.autoInsertedLineEnd.substr(1),g.autoInsertedBrackets--},m.clearMaybeInsertedClosing=function(){g&&(g.maybeInsertedBrackets=0,g.maybeInsertedRow=-1)},n.inherits(m,r),t.CstyleBehaviour=m}),ace.define("ace/unicode",["require","exports","module"],function(e,t,i){"use strict";for(var n=[48,9,8,25,5,0,2,25,48,0,11,0,5,0,6,22,2,30,2,457,5,11,15,4,8,0,2,0,18,116,2,1,3,3,9,0,2,2,2,0,2,19,2,82,2,138,2,4,3,155,12,37,3,0,8,38,10,44,2,0,2,1,2,1,2,0,9,26,6,2,30,10,7,61,2,9,5,101,2,7,3,9,2,18,3,0,17,58,3,100,15,53,5,0,6,45,211,57,3,18,2,5,3,11,3,9,2,1,7,6,2,2,2,7,3,1,3,21,2,6,2,0,4,3,3,8,3,1,3,3,9,0,5,1,2,4,3,11,16,2,2,5,5,1,3,21,2,6,2,1,2,1,2,1,3,0,2,4,5,1,3,2,4,0,8,3,2,0,8,15,12,2,2,8,2,2,2,21,2,6,2,1,2,4,3,9,2,2,2,2,3,0,16,3,3,9,18,2,2,7,3,1,3,21,2,6,2,1,2,4,3,8,3,1,3,2,9,1,5,1,2,4,3,9,2,0,17,1,2,5,4,2,2,3,4,1,2,0,2,1,4,1,4,2,4,11,5,4,4,2,2,3,3,0,7,0,15,9,18,2,2,7,2,2,2,22,2,9,2,4,4,7,2,2,2,3,8,1,2,1,7,3,3,9,19,1,2,7,2,2,2,22,2,9,2,4,3,8,2,2,2,3,8,1,8,0,2,3,3,9,19,1,2,7,2,2,2,22,2,15,4,7,2,2,2,3,10,0,9,3,3,9,11,5,3,1,2,17,4,23,2,8,2,0,3,6,4,0,5,5,2,0,2,7,19,1,14,57,6,14,2,9,40,1,2,0,3,1,2,0,3,0,7,3,2,6,2,2,2,0,2,0,3,1,2,12,2,2,3,4,2,0,2,5,3,9,3,1,35,0,24,1,7,9,12,0,2,0,2,0,5,9,2,35,5,19,2,5,5,7,2,35,10,0,58,73,7,77,3,37,11,42,2,0,4,328,2,3,3,6,2,0,2,3,3,40,2,3,3,32,2,3,3,6,2,0,2,3,3,14,2,56,2,3,3,66,5,0,33,15,17,84,13,619,3,16,2,25,6,74,22,12,2,6,12,20,12,19,13,12,2,2,2,1,13,51,3,29,4,0,5,1,3,9,34,2,3,9,7,87,9,42,6,69,11,28,4,11,5,11,11,39,3,4,12,43,5,25,7,10,38,27,5,62,2,28,3,10,7,9,14,0,89,75,5,9,18,8,13,42,4,11,71,55,9,9,4,48,83,2,2,30,14,230,23,280,3,5,3,37,3,5,3,7,2,0,2,0,2,0,2,30,3,52,2,6,2,0,4,2,2,6,4,3,3,5,5,12,6,2,2,6,67,1,20,0,29,0,14,0,17,4,60,12,5,0,4,11,18,0,5,0,3,9,2,0,4,4,7,0,2,0,2,0,2,3,2,10,3,3,6,4,5,0,53,1,2684,46,2,46,2,132,7,6,15,37,11,53,10,0,17,22,10,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,31,48,0,470,1,36,5,2,4,6,1,5,85,3,1,3,2,2,89,2,3,6,40,4,93,18,23,57,15,513,6581,75,20939,53,1164,68,45,3,268,4,27,21,31,3,13,13,1,2,24,9,69,11,1,38,8,3,102,3,1,111,44,25,51,13,68,12,9,7,23,4,0,5,45,3,35,13,28,4,64,15,10,39,54,10,13,3,9,7,22,4,1,5,66,25,2,227,42,2,1,3,9,7,11171,13,22,5,48,8453,301,3,61,3,105,39,6,13,4,6,11,2,12,2,4,2,0,2,1,2,1,2,107,34,362,19,63,3,53,41,11,5,15,17,6,13,1,25,2,33,4,2,134,20,9,8,25,5,0,2,25,12,88,4,5,3,5,3,5,3,2],r=0,s=[],o=0;o<n.length;o+=2)s.push(r+=n[o]),n[o+1]&&s.push(45,r+=n[o+1]);t.wordChars=String.fromCharCode.apply(null,s)}),ace.define("ace/mode/text",["require","exports","module","ace/config","ace/tokenizer","ace/mode/text_highlight_rules","ace/mode/behaviour/cstyle","ace/unicode","ace/lib/lang","ace/token_iterator","ace/range"],function(e,t,i){"use strict";function n(){this.HighlightRules=s}var o=e("../config"),r=e("../tokenizer").Tokenizer,s=e("./text_highlight_rules").TextHighlightRules,a=e("./behaviour/cstyle").CstyleBehaviour,l=e("../unicode"),x=e("../lib/lang"),g=e("../token_iterator").TokenIterator,f=e("../range").Range;(function(){this.$defaultBehaviour=new a,this.tokenRe=new RegExp("^["+l.wordChars+"\\$_]+","g"),this.nonTokenRe=new RegExp("^(?:[^"+l.wordChars+"\\$_]|\\s])+","g"),this.getTokenizer=function(){return this.$tokenizer||(this.$highlightRules=this.$highlightRules||new this.HighlightRules(this.$highlightRuleConfig),this.$tokenizer=new r(this.$highlightRules.getRules())),this.$tokenizer},this.lineCommentStart="",this.blockComment="",this.toggleCommentLines=function(e,r,i,n){function t(e){for(var t=i;t<=n;t++)e(s.getLine(t),t)}var s=r.doc,o=!0,a=!0,l=1/0,h=r.getTabSize(),c=!1;if(this.lineCommentStart){f=Array.isArray(this.lineCommentStart)?(y=this.lineCommentStart.map(x.escapeRegExp).join("|"),this.lineCommentStart[0]):(y=x.escapeRegExp(this.lineCommentStart),this.lineCommentStart),y=new RegExp("^(\\s*)(?:"+y+") ?"),c=r.getUseSoftTabs();var d=function(e,t){var i,n,r=e.match(y);r&&(i=r[1].length,n=r[0].length,g(e,i,n)||" "!=r[0][n-1]||n--,s.removeInLine(t,i,n))},u=f+" ",p=function(e,t){o&&!/\S/.test(e)||(g(e,l,l)?s.insertInLine({row:t,column:l},u):s.insertInLine({row:t,column:l},f))},m=function(e,t){return y.test(e)},g=function(e,t,i){for(var n=0;t--&&" "==e.charAt(t);)n++;if(n%h!=0)return!1;for(n=0;" "==e.charAt(i++);)n++;return 2<h?n%h!=h-1:n%h==0}}else{if(!this.blockComment)return!1;var f=this.blockComment.start,v=this.blockComment.end,y=new RegExp("^(\\s*)(?:"+x.escapeRegExp(f)+")"),b=new RegExp("(?:"+x.escapeRegExp(v)+")\\s*$"),p=function(e,t){m(e,t)||o&&!/\S/.test(e)||(s.insertInLine({row:t,column:e.length},v),s.insertInLine({row:t,column:l},f))},d=function(e,t){var i;(i=e.match(b))&&s.removeInLine(t,e.length-i[0].length,e.length),(i=e.match(y))&&s.removeInLine(t,i[1].length,i[0].length)},m=function(e,t){if(y.test(e))return!0;for(var i=r.getTokens(t),n=0;n<i.length;n++)if("comment"===i[n].type)return!0}}var w=1/0;t(function(e,t){var i=e.search(/\S/);-1!==i?(i<l&&(l=i),a&&!m(e,t)&&(a=!1)):w>e.length&&(w=e.length)}),l==1/0&&(l=w,a=o=!1),c&&l%h!=0&&(l=Math.floor(l/h)*h),t(a?d:p)},this.toggleBlockComment=function(e,t,i,n){var r=this.blockComment;if(r){!r.start&&r[0]&&(r=r[0]);var s,o,a=(u=new g(t,n.row,n.column)).getCurrentToken(),l=(t.selection,t.selection.toOrientedRange());if(a&&/comment/.test(a.type)){for(;a&&/comment/.test(a.type);){if(-1!=(p=a.value.indexOf(r.start))){var h=u.getCurrentTokenRow(),c=u.getCurrentTokenColumn()+p,d=new f(h,c,h,c+r.start.length);break}a=u.stepBackward()}for(var u,p,a=(u=new g(t,n.row,n.column)).getCurrentToken();a&&/comment/.test(a.type);){if(-1!=(p=a.value.indexOf(r.end))){var h=u.getCurrentTokenRow(),c=u.getCurrentTokenColumn()+p,m=new f(h,c,h,c+r.end.length);break}a=u.stepForward()}m&&t.remove(m),d&&(t.remove(d),s=d.start.row,o=-r.start.length)}else o=r.start.length,s=i.start.row,t.insert(i.end,r.end),t.insert(i.start,r.start);l.start.row==s&&(l.start.column+=o),l.end.row==s&&(l.end.column+=o),t.selection.fromOrientedRange(l)}},this.getNextLineIndent=function(e,t,i){return this.$getIndent(t)},this.checkOutdent=function(e,t,i){return!1},this.autoOutdent=function(e,t,i){},this.$getIndent=function(e){return e.match(/^\s*/)[0]},this.createWorker=function(e){return null},this.createModeDelegates=function(e){for(var n in this.$embeds=[],this.$modes={},e){var t,i,r;e[n]&&(i=(t=e[n]).prototype.$id,(r=o.$modes[i])||(o.$modes[i]=r=new t),o.$modes[n]||(o.$modes[n]=r),this.$embeds.push(n),this.$modes[n]=r)}for(var s=["toggleBlockComment","toggleCommentLines","getNextLineIndent","checkOutdent","autoOutdent","transformAction","getCompletions"],n=0;n<s.length;n++)!function(e){var t=s[n],i=e[t];e[s[n]]=function(){return this.$delegator(t,arguments,i)}}(this)},this.$delegator=function(e,t,i){var n=t[0]||"start";if("string"!=typeof n){if(Array.isArray(n[2])){var r=n[2][n[2].length-1];if(o=this.$modes[r])return o[e].apply(o,[n[1]].concat([].slice.call(t,1)))}n=n[0]||"start"}for(var s=0;s<this.$embeds.length;s++)if(this.$modes[this.$embeds[s]]){var o,a=n.split(this.$embeds[s]);if(!a[0]&&a[1])return t[0]=a[1],(o=this.$modes[this.$embeds[s]])[e].apply(o,t)}r=i.apply(this,t);return i?r:void 0},this.transformAction=function(e,t,i,n,r){if(this.$behaviour){var s,o=this.$behaviour.getBehaviours();for(s in o)if(o[s][t]){var a=o[s][t].apply(this,arguments);if(a)return a}}},this.getKeywords=function(e){if(!this.completionKeywords){var t=this.$tokenizer.rules,i=[];for(n in t)for(var n,r=t[n],s=0,o=r.length;s<o;s++)if("string"==typeof r[s].token)/keyword|support|storage/.test(r[s].token)&&i.push(r[s].regex);else if("object"==typeof r[s].token)for(var a=0,l=r[s].token.length;a<l;a++)/keyword|support|storage/.test(r[s].token[a])&&(n=r[s].regex.match(/\(.+?\)/g)[a],i.push(n.substr(1,n.length-2)));this.completionKeywords=i}return e?i.concat(this.$keywordList||[]):this.$keywordList},this.$createKeywordList=function(){return this.$highlightRules||this.getTokenizer(),this.$keywordList=this.$highlightRules.$keywordList||[]},this.getCompletions=function(e,t,i,n){return(this.$keywordList||this.$createKeywordList()).map(function(e){return{name:e,value:e,score:0,meta:"keyword"}})},this.$id="ace/mode/text"}).call(n.prototype),t.Mode=n}),ace.define("ace/apply_delta",["require","exports","module"],function(e,t,i){"use strict";t.applyDelta=function(e,t,i){var n=t.start.row,r=t.start.column,s=e[n]||"";switch(t.action){case"insert":1===t.lines.length?e[n]=s.substring(0,r)+t.lines[0]+s.substring(r):(o=[n,1].concat(t.lines),e.splice.apply(e,o),e[n]=s.substring(0,r)+e[n],e[n+t.lines.length-1]+=s.substring(r));break;case"remove":var o=t.end.column,a=t.end.row;n===a?e[n]=s.substring(0,r)+s.substring(o):e.splice(n,a-n+1,s.substring(0,r)+e[a].substring(o))}}}),ace.define("ace/anchor",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],function(e,t,i){"use strict";var n=e("./lib/oop"),r=e("./lib/event_emitter").EventEmitter,e=t.Anchor=function(e,t,i){this.$onChange=this.onChange.bind(this),this.attach(e),void 0===i?this.setPosition(t.row,t.column):this.setPosition(t,i)};!function(){function a(e,t,i){i=i?e.column<=t.column:e.column<t.column;return e.row<t.row||e.row==t.row&&i}n.implement(this,r),this.getPosition=function(){return this.$clipPositionToDocument(this.row,this.column)},this.getDocument=function(){return this.document},this.$insertRight=!1,this.onChange=function(e){var t,i,n,r,s,o;e.start.row==e.end.row&&e.start.row!=this.row||e.start.row>this.row||(e=e,t={row:this.row,column:this.column},i=this.$insertRight,n=((o="insert"==e.action)?1:-1)*(e.end.row-e.start.row),r=(o?1:-1)*(e.end.column-e.start.column),s=e.start,o=o?s:e.end,e=a(t,s,i)?{row:t.row,column:t.column}:a(o,t,!i)?{row:t.row+n,column:t.column+(t.row==o.row?r:0)}:{row:s.row,column:s.column},this.setPosition(e.row,e.column,!0))},this.setPosition=function(e,t,i){i=i?{row:e,column:t}:this.$clipPositionToDocument(e,t);this.row==i.row&&this.column==i.column||(e={row:this.row,column:this.column},this.row=i.row,this.column=i.column,this._signal("change",{old:e,value:i}))},this.detach=function(){this.document.off("change",this.$onChange)},this.attach=function(e){this.document=e||this.document,this.document.on("change",this.$onChange)},this.$clipPositionToDocument=function(e,t){var i={};return e>=this.document.getLength()?(i.row=Math.max(0,this.document.getLength()-1),i.column=this.document.getLine(i.row).length):e<0?(i.row=0,i.column=0):(i.row=e,i.column=Math.min(this.document.getLine(i.row).length,Math.max(0,t))),t<0&&(i.column=0),i}}.call(e.prototype)}),ace.define("ace/document",["require","exports","module","ace/lib/oop","ace/apply_delta","ace/lib/event_emitter","ace/range","ace/anchor"],function(e,t,i){"use strict";function n(e){this.$lines=[""],0===e.length?this.$lines=[""]:Array.isArray(e)?this.insertMergedLines({row:0,column:0},e):this.insert({row:0,column:0},e)}var r=e("./lib/oop"),s=e("./apply_delta").applyDelta,o=e("./lib/event_emitter").EventEmitter,a=e("./range").Range,l=e("./anchor").Anchor;(function(){r.implement(this,o),this.setValue=function(e){var t=this.getLength()-1;this.remove(new a(0,0,t,this.getLine(t).length)),this.insert({row:0,column:0},e)},this.getValue=function(){return this.getAllLines().join(this.getNewLineCharacter())},this.createAnchor=function(e,t){return new l(this,e,t)},0==="aaa".split(/a/).length?this.$split=function(e){return e.replace(/\r\n|\r/g,"\n").split("\n")}:this.$split=function(e){return e.split(/\r\n|\r|\n/)},this.$detectNewLine=function(e){e=e.match(/^.*?(\r\n|\r|\n)/m);this.$autoNewLine=e?e[1]:"\n",this._signal("changeNewLineMode")},this.getNewLineCharacter=function(){switch(this.$newLineMode){case"windows":return"\r\n";case"unix":return"\n";default:return this.$autoNewLine||"\n"}},this.$autoNewLine="",this.$newLineMode="auto",this.setNewLineMode=function(e){this.$newLineMode!==e&&(this.$newLineMode=e,this._signal("changeNewLineMode"))},this.getNewLineMode=function(){return this.$newLineMode},this.isNewLine=function(e){return"\r\n"==e||"\r"==e||"\n"==e},this.getLine=function(e){return this.$lines[e]||""},this.getLines=function(e,t){return this.$lines.slice(e,t+1)},this.getAllLines=function(){return this.getLines(0,this.getLength())},this.getLength=function(){return this.$lines.length},this.getTextRange=function(e){return this.getLinesForRange(e).join(this.getNewLineCharacter())},this.getLinesForRange=function(e){var t,i;return e.start.row===e.end.row?t=[this.getLine(e.start.row).substring(e.start.column,e.end.column)]:((t=this.getLines(e.start.row,e.end.row))[0]=(t[0]||"").substring(e.start.column),i=t.length-1,e.end.row-e.start.row==i&&(t[i]=t[i].substring(0,e.end.column))),t},this.insertLines=function(e,t){return console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead."),this.insertFullLines(e,t)},this.removeLines=function(e,t){return console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead."),this.removeFullLines(e,t)},this.insertNewLine=function(e){return console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead."),this.insertMergedLines(e,["",""])},this.insert=function(e,t){return this.getLength()<=1&&this.$detectNewLine(t),this.insertMergedLines(e,this.$split(t))},this.insertInLine=function(e,t){var i=this.clippedPos(e.row,e.column),e=this.pos(e.row,e.column+t.length);return this.applyDelta({start:i,end:e,action:"insert",lines:[t]},!0),this.clonePos(e)},this.clippedPos=function(e,t){var i=this.getLength(),i=(void 0===e?e=i:e<0?e=0:i<=e&&(e=i-1,t=void 0),this.getLine(e));return null==t&&(t=i.length),{row:e,column:t=Math.min(Math.max(t,0),i.length)}},this.clonePos=function(e){return{row:e.row,column:e.column}},this.pos=function(e,t){return{row:e,column:t}},this.$clipPosition=function(e){var t=this.getLength();return e.row>=t?(e.row=Math.max(0,t-1),e.column=this.getLine(t-1).length):(e.row=Math.max(0,e.row),e.column=Math.min(Math.max(e.column,0),this.getLine(e.row).length)),e},this.insertFullLines=function(e,t){var i=0,i=(e=Math.min(Math.max(e,0),this.getLength()))<this.getLength()?(t=t.concat([""]),0):(t=[""].concat(t),this.$lines[--e].length);this.insertMergedLines({row:e,column:i},t)},this.insertMergedLines=function(e,t){var e=this.clippedPos(e.row,e.column),i={row:e.row+t.length-1,column:(1==t.length?e.column:0)+t[t.length-1].length};return this.applyDelta({start:e,end:i,action:"insert",lines:t}),this.clonePos(i)},this.remove=function(e){var t=this.clippedPos(e.start.row,e.start.column),e=this.clippedPos(e.end.row,e.end.column);return this.applyDelta({start:t,end:e,action:"remove",lines:this.getLinesForRange({start:t,end:e})}),this.clonePos(t)},this.removeInLine=function(e,t,i){t=this.clippedPos(e,t),e=this.clippedPos(e,i);return this.applyDelta({start:t,end:e,action:"remove",lines:this.getLinesForRange({start:t,end:e})},!0),this.clonePos(t)},this.removeFullLines=function(e,t){e=Math.min(Math.max(0,e),this.getLength()-1);var i=(t=Math.min(Math.max(0,t),this.getLength()-1))==this.getLength()-1&&0<e,n=t<this.getLength()-1,r=i?e-1:e,i=i?this.getLine(r).length:0,s=n?t+1:t,n=n?0:this.getLine(s).length,r=new a(r,i,s,n),i=this.$lines.slice(e,t+1);return this.applyDelta({start:r.start,end:r.end,action:"remove",lines:this.getLinesForRange(r)}),i},this.removeNewLine=function(e){e<this.getLength()-1&&0<=e&&this.applyDelta({start:this.pos(e,this.getLine(e).length),end:this.pos(e+1,0),action:"remove",lines:["",""]})},this.replace=function(e,t){return e instanceof a||(e=a.fromPoints(e.start,e.end)),0===t.length&&e.isEmpty()?e.start:t==this.getTextRange(e)?e.end:(this.remove(e),t?this.insert(e.start,t):e.start)},this.applyDeltas=function(e){for(var t=0;t<e.length;t++)this.applyDelta(e[t])},this.revertDeltas=function(e){for(var t=e.length-1;0<=t;t--)this.revertDelta(e[t])},this.applyDelta=function(e,t){var i="insert"==e.action;(i?e.lines.length<=1&&!e.lines[0]:!a.comparePoints(e.start,e.end))||(i&&2e4<e.lines.length?this.$splitAndapplyLargeDelta(e,2e4):(s(this.$lines,e,t),this._signal("change",e)))},this.$safeApplyDelta=function(e){var t=this.$lines.length;("remove"==e.action&&e.start.row<t&&e.end.row<t||"insert"==e.action&&e.start.row<=t)&&this.applyDelta(e)},this.$splitAndapplyLargeDelta=function(e,t){for(var i=e.lines,n=i.length-t+1,r=e.start.row,s=e.start.column,o=0,a=0;o<n;o=a){a+=t-1;var l=i.slice(o,a);l.push(""),this.applyDelta({start:this.pos(r+o,s),end:this.pos(r+a,s=0),action:e.action,lines:l},!0)}e.lines=i.slice(o),e.start.row=r+o,e.start.column=s,this.applyDelta(e,!0)},this.revertDelta=function(e){this.$safeApplyDelta({start:this.clonePos(e.start),end:this.clonePos(e.end),action:"insert"==e.action?"remove":"insert",lines:e.lines.slice()})},this.indexToPosition=function(e,t){for(var i=this.$lines||this.getAllLines(),n=this.getNewLineCharacter().length,r=t||0,s=i.length;r<s;r++)if((e-=i[r].length+n)<0)return{row:r,column:e+i[r].length+n};return{row:s-1,column:e+i[s-1].length+n}},this.positionToIndex=function(e,t){for(var i=this.$lines||this.getAllLines(),n=this.getNewLineCharacter().length,r=0,s=Math.min(e.row,i.length),o=t||0;o<s;++o)r+=i[o].length+n;return r+e.column}}).call(n.prototype),t.Document=n}),ace.define("ace/background_tokenizer",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],function(e,t,i){"use strict";function n(e,t){this.running=!1,this.lines=[],this.states=[],this.currentLine=0,this.tokenizer=e;var a=this;this.$worker=function(){if(a.running){for(var e=new Date,t=a.currentLine,i=-1,n=a.doc,r=t;a.lines[t];)t++;var s=n.getLength(),o=0;for(a.running=!1;t<s;){for(a.$tokenizeRow(t),i=t;t++,a.lines[t];);if(++o%5==0&&20<new Date-e){a.running=setTimeout(a.$worker,20);break}}a.currentLine=t,r<=(i=-1==i?t:i)&&a.fireUpdateEvent(r,i)}}}var r=e("./lib/oop"),s=e("./lib/event_emitter").EventEmitter;(function(){r.implement(this,s),this.setTokenizer=function(e){this.tokenizer=e,this.lines=[],this.states=[],this.start(0)},this.setDocument=function(e){this.doc=e,this.lines=[],this.states=[],this.stop()},this.fireUpdateEvent=function(e,t){this._signal("update",{data:{first:e,last:t}})},this.start=function(e){this.currentLine=Math.min(e||0,this.currentLine,this.doc.getLength()),this.lines.splice(this.currentLine,this.lines.length),this.states.splice(this.currentLine,this.states.length),this.stop(),this.running=setTimeout(this.$worker,700)},this.scheduleStart=function(){this.running||(this.running=setTimeout(this.$worker,700))},this.$updateOnChange=function(e){var t=e.start.row,i=e.end.row-t;0==i?this.lines[t]=null:"remove"==e.action?(this.lines.splice(t,1+i,null),this.states.splice(t,1+i,null)):((e=Array(1+i)).unshift(t,1),this.lines.splice.apply(this.lines,e),this.states.splice.apply(this.states,e)),this.currentLine=Math.min(t,this.currentLine,this.doc.getLength()),this.stop()},this.stop=function(){this.running&&clearTimeout(this.running),this.running=!1},this.getTokens=function(e){return this.lines[e]||this.$tokenizeRow(e)},this.getState=function(e){return this.currentLine==e&&this.$tokenizeRow(e),this.states[e]||"start"},this.$tokenizeRow=function(e){var t=this.doc.getLine(e),i=this.states[e-1],t=this.tokenizer.getLineTokens(t,i,e);return this.states[e]+""!=t.state+""?(this.states[e]=t.state,this.lines[e+1]=null,this.currentLine>e+1&&(this.currentLine=e+1)):this.currentLine==e&&(this.currentLine=e+1),this.lines[e]=t.tokens}}).call(n.prototype),t.BackgroundTokenizer=n}),ace.define("ace/search_highlight",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],function(e,t,i){"use strict";function n(e,t,i){this.setRegexp(e),this.clazz=t,this.type=i||"text"}var h=e("./lib/lang"),c=(e("./lib/oop"),e("./range").Range);(function(){this.MAX_RANGES=500,this.setRegexp=function(e){this.regExp+""!=e+""&&(this.regExp=e,this.cache=[])},this.update=function(e,t,i,n){if(this.regExp)for(var r=n.firstRow,s=n.lastRow,o=r;o<=s;o++){var a=this.cache[o];null==a&&(a=(a=(a=h.getMatchOffsets(i.getLine(o),this.regExp)).length>this.MAX_RANGES?a.slice(0,this.MAX_RANGES):a).map(function(e){return new c(o,e.offset,o,e.offset+e.length)}),this.cache[o]=a.length?a:"");for(var l=a.length;l--;)t.drawSingleLineMarker(e,a[l].toScreenRange(i),this.clazz,n)}}}).call(n.prototype),t.SearchHighlight=n}),ace.define("ace/edit_session/fold_line",["require","exports","module","ace/range"],function(e,t,i){"use strict";function r(e,t){this.foldData=e,Array.isArray(t)?this.folds=t:t=this.folds=[t];e=t[t.length-1];this.range=new n(t[0].start.row,t[0].start.column,e.end.row,e.end.column),this.start=this.range.start,this.end=this.range.end,this.folds.forEach(function(e){e.setFoldLine(this)},this)}var n=e("../range").Range;(function(){this.shiftRow=function(t){this.start.row+=t,this.end.row+=t,this.folds.forEach(function(e){e.start.row+=t,e.end.row+=t})},this.addFold=function(e){if(e.sameRow){if(e.start.row<this.startRow||e.endRow>this.endRow)throw new Error("Can't add a fold to this FoldLine as it has no connection");this.folds.push(e),this.folds.sort(function(e,t){return-e.range.compareEnd(t.start.row,t.start.column)}),0<this.range.compareEnd(e.start.row,e.start.column)?(this.end.row=e.end.row,this.end.column=e.end.column):this.range.compareStart(e.end.row,e.end.column)<0&&(this.start.row=e.start.row,this.start.column=e.start.column)}else if(e.start.row==this.end.row)this.folds.push(e),this.end.row=e.end.row,this.end.column=e.end.column;else{if(e.end.row!=this.start.row)throw new Error("Trying to add fold to FoldRow that doesn't have a matching row");this.folds.unshift(e),this.start.row=e.start.row,this.start.column=e.start.column}e.foldLine=this},this.containsRow=function(e){return e>=this.start.row&&e<=this.end.row},this.walk=function(e,t,i){var n,r,s=0,o=this.folds,a=!0;null==t&&(t=this.end.row,i=this.end.column);for(var l=0;l<o.length;l++){if(-1==(r=(n=o[l]).range.compareStart(t,i)))return void e(null,t,i,s,a);if(!e(null,n.start.row,n.start.column,s,a)&&e(n.placeholder,n.start.row,n.start.column,s)||0===r)return;a=!n.sameRow,s=n.end.column}e(null,t,i,s,a)},this.getNextFoldTo=function(e,t){for(var i,n,r=0;r<this.folds.length;r++){if(-1==(n=(i=this.folds[r]).range.compareEnd(e,t)))return{fold:i,kind:"after"};if(0===n)return{fold:i,kind:"inside"}}return null},this.addRemoveChars=function(e,t,i){var n,r=this.getNextFoldTo(e,t);if(r)if(n=r.fold,"inside"==r.kind&&n.start.column!=t&&n.start.row!=e)window.console&&window.console.log(e,t,n);else if(n.start.row==e){var s,o=(s=this.folds).indexOf(n);for(0===o&&(this.start.column+=i);o<s.length;o++){if((n=s[o]).start.column+=i,!n.sameRow)return;n.end.column+=i}this.end.column+=i}},this.split=function(e,t){var i,n,e=this.getNextFoldTo(e,t);return e&&"inside"!=e.kind?(t=e.fold,e=this.folds,i=this.foldData,t=e.indexOf(t),n=e[t-1],this.end.row=n.end.row,this.end.column=n.end.column,n=new r(i,e=e.splice(t,e.length-t)),i.splice(i.indexOf(this)+1,0,n),n):null},this.merge=function(e){for(var t=e.folds,i=0;i<t.length;i++)this.addFold(t[i]);var n=this.foldData;n.splice(n.indexOf(e),1)},this.toString=function(){var t=[this.range.toString()+": ["];return this.folds.forEach(function(e){t.push(" "+e.toString())}),t.push("]"),t.join("\n")},this.idxToPosition=function(e){for(var t=0,i=0;i<this.folds.length;i++){var n=this.folds[i];if((e-=n.start.column-t)<0)return{row:n.start.row,column:n.start.column+e};if((e-=n.placeholder.length)<0)return n.start;t=n.end.column}return{row:this.end.row,column:this.end.column+e}}}).call(r.prototype),t.FoldLine=r}),ace.define("ace/range_list",["require","exports","module","ace/range"],function(e,t,i){"use strict";function n(){this.ranges=[],this.$bias=1}var a=e("./range").Range.comparePoints;(function(){this.comparePoints=a,this.pointIndex=function(e,t,i){for(var n=this.ranges,r=i||0;r<n.length;r++){var s=n[r],o=a(e,s.end);if(!(0<o))return s=a(e,s.start),0===o?t&&0!==s?-r-2:r:0<s||0===s&&!t?r:-r-1}return-r-1},this.add=function(e){var t=!e.isEmpty(),i=this.pointIndex(e.start,t),t=this.pointIndex(e.end,t,i=i<0?-i-1:i);return t<0?t=-t-1:t++,this.ranges.splice(i,t-i,e)},this.addList=function(e){for(var t=[],i=e.length;i--;)t.push.apply(t,this.add(e[i]));return t},this.substractPoint=function(e){e=this.pointIndex(e);if(0<=e)return this.ranges.splice(e,1)},this.merge=function(){for(var e=[],t=this.ranges,i=(t=t.sort(function(e,t){return a(e.start,t.start)}))[0],n=1;n<t.length;n++){var r=i,i=t[n],s=a(r.end,i.start);s<0||(0!=s||r.isEmpty()||i.isEmpty())&&(a(r.end,i.end)<0&&(r.end.row=i.end.row,r.end.column=i.end.column),t.splice(n,1),e.push(i),i=r,n--)}return this.ranges=t,e},this.contains=function(e,t){return 0<=this.pointIndex({row:e,column:t})},this.containsPoint=function(e){return 0<=this.pointIndex(e)},this.rangeAtPoint=function(e){e=this.pointIndex(e);if(0<=e)return this.ranges[e]},this.clipRows=function(e,t){var i=this.ranges;if(i[0].start.row>t||i[i.length-1].start.row<e)return[];for(var e=this.pointIndex({row:e,column:0}),n=this.pointIndex({row:t,column:0},e=e<0?-e-1:e),r=(n<0&&(n=-n-1),[]),s=e;s<n;s++)r.push(i[s]);return r},this.removeAll=function(){return this.ranges.splice(0,this.ranges.length)},this.attach=function(e){this.session&&this.detach(),this.session=e,this.onChange=this.$onChange.bind(this),this.session.on("change",this.onChange)},this.detach=function(){this.session&&(this.session.removeListener("change",this.onChange),this.session=null)},this.$onChange=function(e){for(var t=e.start,i=e.end,n=t.row,r=i.row,s=this.ranges,o=0,a=s.length;o<a&&!((c=s[o]).end.row>=n);o++);if("insert"==e.action)for(var l=r-n,h=-t.column+i.column;o<a;o++){if((c=s[o]).start.row>n)break;c.start.row==n&&c.start.column>=t.column&&(c.start.column==t.column&&this.$bias<=0||(c.start.column+=h,c.start.row+=l)),c.end.row==n&&c.end.column>=t.column&&(c.end.column==t.column&&this.$bias<0||(c.end.column==t.column&&0<h&&o<a-1&&c.end.column>c.start.column&&c.end.column==s[o+1].start.column&&(c.end.column-=h),c.end.column+=h,c.end.row+=l))}else for(var c,l=n-r,h=t.column-i.column;o<a;o++){if((c=s[o]).start.row>r)break;c.end.row<r&&(n<c.end.row||n==c.end.row&&t.column<c.end.column)?(c.end.row=n,c.end.column=t.column):c.end.row==r?c.end.column<=i.column?(l||c.end.column>t.column)&&(c.end.column=t.column,c.end.row=t.row):(c.end.column+=h,c.end.row+=l):c.end.row>r&&(c.end.row+=l),c.start.row<r&&(n<c.start.row||n==c.start.row&&t.column<c.start.column)?(c.start.row=n,c.start.column=t.column):c.start.row==r?c.start.column<=i.column?(l||c.start.column>t.column)&&(c.start.column=t.column,c.start.row=t.row):(c.start.column+=h,c.start.row+=l):c.start.row>r&&(c.start.row+=l)}if(0!=l&&o<a)for(;o<a;o++)(c=s[o]).start.row+=l,c.end.row+=l}}).call(n.prototype),t.RangeList=n}),ace.define("ace/edit_session/fold",["require","exports","module","ace/range_list","ace/lib/oop"],function(e,t,i){"use strict";function d(e,t){e.row-=t.row,0==e.row&&(e.column-=t.column)}function n(e,t){0==e.row&&(e.column+=t.column),e.row+=t.row}var r=e("../range_list").RangeList,e=e("../lib/oop"),s=t.Fold=function(e,t){this.foldLine=null,this.placeholder=t,this.range=e,this.start=e.start,this.end=e.end,this.sameRow=e.start.row==e.end.row,this.subFolds=this.ranges=[]};e.inherits(s,r),function(){this.toString=function(){return'"'+this.placeholder+'" '+this.range.toString()},this.setFoldLine=function(t){this.foldLine=t,this.subFolds.forEach(function(e){e.setFoldLine(t)})},this.clone=function(){var e=this.range.clone(),t=new s(e,this.placeholder);return this.subFolds.forEach(function(e){t.subFolds.push(e.clone())}),t.collapseChildren=this.collapseChildren,t},this.addSubFold=function(e){if(!this.range.isEqual(e)){s=e,o=this.start,d(s.start,o),d(s.end,o);for(var t=e.start.row,i=e.start.column,n=0,r=-1;n<this.subFolds.length&&1==(r=this.subFolds[n].range.compare(t,i));n++);var s=this.subFolds[n],o=0;if(0==r){if(s.range.containsRange(e))return s.addSubFold(e);o=1}for(var t=e.range.end.row,i=e.range.end.column,a=n,r=-1;a<this.subFolds.length&&1==(r=this.subFolds[a].range.compare(t,i));a++);0==r&&a++;for(var l=this.subFolds.splice(n,a-n,e),h=0==r?l.length-1:l.length,c=o;c<h;c++)e.addSubFold(l[c]);return e.setFoldLine(this.foldLine),e}},this.restoreRange=function(e){return e=e,t=this.start,n(e.start,t),void n(e.end,t);var t}}.call(s.prototype)}),ace.define("ace/edit_session/folding",["require","exports","module","ace/range","ace/edit_session/fold_line","ace/edit_session/fold","ace/token_iterator"],function(e,t,i){"use strict";var h=e("../range").Range,u=e("./fold_line").FoldLine,p=e("./fold").Fold,c=e("../token_iterator").TokenIterator;t.Folding=function(){this.getFoldAt=function(e,t,i){var n=this.getFoldLine(e);if(!n)return null;for(var r=n.folds,s=0;s<r.length;s++){var o=r[s].range;if(o.contains(e,t)&&(1!=i||!o.isEnd(e,t)||o.isEmpty())&&(-1!=i||!o.isStart(e,t)||o.isEmpty()))return r[s]}},this.getFoldsInRange=function(e){var t=e.start,i=e.end,n=this.$foldData,r=[];t.column+=1,--i.column;for(var s=0;s<n.length;s++){var o=n[s].range.compareRange(e);if(2!=o){if(-2==o)break;for(var a=n[s].folds,l=0;l<a.length;l++){var h=a[l];if(-2==(o=h.range.compareRange(e)))break;if(2!=o){if(42==o)break;r.push(h)}}}}return--t.column,i.column+=1,r},this.getFoldsInRangeList=function(e){var t;return Array.isArray(e)?(t=[],e.forEach(function(e){t=t.concat(this.getFoldsInRange(e))},this)):t=this.getFoldsInRange(e),t},this.getAllFolds=function(){for(var e=[],t=this.$foldData,i=0;i<t.length;i++)for(var n=0;n<t[i].folds.length;n++)e.push(t[i].folds[n]);return e},this.getFoldStringAt=function(e,t,i,n){if(!(n=n||this.getFoldLine(e)))return null;for(var r,s={end:{column:0}},o=0;o<n.folds.length;o++){var a,l=(a=n.folds[o]).range.compareEnd(e,t);if(-1==l){r=this.getLine(a.start.row).substring(s.end.column,a.start.column);break}if(0===l)return null;s=a}return r=r||this.getLine(a.start.row).substring(s.end.column),-1==i?r.substring(0,t-s.end.column):1==i?r.substring(t-s.end.column):r},this.getFoldLine=function(e,t){var i=this.$foldData,n=0;for(-1==(n=t?i.indexOf(t):n)&&(n=0);n<i.length;n++){var r=i[n];if(r.start.row<=e&&r.end.row>=e)return r;if(r.end.row>e)return null}return null},this.getNextFoldLine=function(e,t){var i=this.$foldData,n=0;for(-1==(n=t?i.indexOf(t):n)&&(n=0);n<i.length;n++){var r=i[n];if(r.end.row>=e)return r}return null},this.getFoldedRowCount=function(e,t){for(var i=this.$foldData,n=t-e+1,r=0;r<i.length;r++){var s=i[r],o=s.end.row,s=s.start.row;if(t<=o){s<t&&(e<=s?n-=t-s:n=0);break}e<=o&&(n-=e<=s?o-s:o-e+1)}return n},this.$addFoldLine=function(e){return this.$foldData.push(e),this.$foldData.sort(function(e,t){return e.start.row-t.start.row}),e},this.addFold=function(e,t){var i,n=this.$foldData,r=!1,s=(e instanceof p?i=e:(i=new p(t,e)).collapseChildren=t.collapseChildren,this.$clipRangeToDocument(i.range),i.start.row),e=i.start.column,o=i.end.row,t=i.end.column,a=this.getFoldAt(s,e,1),l=this.getFoldAt(o,t,-1);if(a&&l==a)return a.addSubFold(i);a&&!a.range.isStart(s,e)&&this.removeFold(a),l&&!l.range.isEnd(o,t)&&this.removeFold(l);e=this.getFoldsInRange(i.range);0<e.length&&(this.removeFolds(e),i.collapseChildren||e.forEach(function(e){i.addSubFold(e)}));for(var h=0;h<n.length;h++){var c=n[h];if(o==c.start.row){c.addFold(i),r=!0;break}if(s==c.end.row){if(c.addFold(i),r=!0,!i.sameRow){var d=n[h+1];if(d&&d.start.row==o){c.merge(d);break}}break}if(o<=c.start.row)break}return r||(c=this.$addFoldLine(new u(this.$foldData,i))),this.$useWrapMode?this.$updateWrapData(c.start.row,c.start.row):this.$updateRowLengthCache(c.start.row,c.start.row),this.$modified=!0,this._signal("changeFold",{data:i,action:"add"}),i},this.addFolds=function(e){e.forEach(function(e){this.addFold(e)},this)},this.removeFold=function(e){var t=e.foldLine,i=t.start.row,n=t.end.row,r=this.$foldData,s=t.folds;1==s.length?r.splice(r.indexOf(t),1):t.range.isEnd(e.end.row,e.end.column)?(s.pop(),t.end.row=s[s.length-1].end.row,t.end.column=s[s.length-1].end.column):t.range.isStart(e.start.row,e.start.column)?(s.shift(),t.start.row=s[0].start.row,t.start.column=s[0].start.column):e.sameRow?s.splice(s.indexOf(e),1):((s=(r=t.split(e.start.row,e.start.column)).folds).shift(),r.start.row=s[0].start.row,r.start.column=s[0].start.column),this.$updating||(this.$useWrapMode?this.$updateWrapData(i,n):this.$updateRowLengthCache(i,n)),this.$modified=!0,this._signal("changeFold",{data:e,action:"remove"})},this.removeFolds=function(e){for(var t=[],i=0;i<e.length;i++)t.push(e[i]);t.forEach(function(e){this.removeFold(e)},this),this.$modified=!0},this.expandFold=function(t){this.removeFold(t),t.subFolds.forEach(function(e){t.restoreRange(e),this.addFold(e)},this),0<t.collapseChildren&&this.foldAll(t.start.row+1,t.end.row,t.collapseChildren-1),t.subFolds=[]},this.expandFolds=function(e){e.forEach(function(e){this.expandFold(e)},this)},this.unfold=function(e,t){var i;if(null==e?(i=new h(0,0,this.getLength(),0),null==t&&(t=!0)):i="number"==typeof e?new h(e,0,e,this.getLine(e).length):"row"in e?h.fromPoints(e,e):e,e=this.getFoldsInRangeList(i),0!=t?this.removeFolds(e):this.expandFolds(e),e.length)return e},this.isRowFolded=function(e,t){return!!this.getFoldLine(e,t)},this.getRowFoldEnd=function(e,t){t=this.getFoldLine(e,t);return t?t.end.row:e},this.getRowFoldStart=function(e,t){t=this.getFoldLine(e,t);return t?t.start.row:e},this.getFoldDisplayLine=function(e,t,i,r,s){null==r&&(r=e.start.row),null==s&&(s=0),null==t&&(t=e.end.row),null==i&&(i=this.getLine(t).length);var o=this.doc,a="";return e.walk(function(e,t,i,n){if(!(t<r)){if(t==r){if(i<s)return;n=Math.max(s,n)}a+=null!=e?e:o.getLine(t).substring(n,i)}},t,i),a},this.getDisplayLine=function(e,t,i,n){var r=this.getFoldLine(e);return r?this.getFoldDisplayLine(r,e,t,i,n):(r=this.doc.getLine(e)).substring(n||0,t||r.length)},this.$cloneFoldData=function(){var t=[];return t=this.$foldData.map(function(e){e=e.folds.map(function(e){return e.clone()});return new u(t,e)})},this.toggleFold=function(e){var t=this.selection.getRange();if(t.isEmpty()){var i,n=t.start;if(i=this.getFoldAt(n.row,n.column))return void this.expandFold(i);(r=this.findMatchingBracket(n))?1==t.comparePoint(r)?t.end=r:(t.start=r,t.start.column++,t.end.column--):(r=this.findMatchingBracket({row:n.row,column:n.column+1}))?(1==t.comparePoint(r)?t.end=r:t.start=r,t.start.column++):t=this.getCommentFoldRange(n.row,n.column)||t}else{var r=this.getFoldsInRange(t);if(e&&r.length)return void this.expandFolds(r);1==r.length&&(i=r[0])}if((i=i||this.getFoldAt(t.start.row,t.start.column))&&i.range.toString()==t.toString())this.expandFold(i);else{n="...";if(!t.isMultiLine()){if((n=this.getTextRange(t)).length<4)return;n=n.trim().substring(0,2)+".."}this.addFold(n,t)}},this.getCommentFoldRange=function(e,t,i){var n=new c(this,e,t),r=n.getCurrentToken(),s=r&&r.type;if(r&&/^comment|string/.test(s)){"comment"==(s=s.match(/comment|string/)[0])&&(s+="|doc-start");var o=new RegExp(s),s=new h;if(1!=i){for(;(r=n.stepBackward())&&o.test(r.type););n.stepForward()}if(s.start.row=n.getCurrentTokenRow(),s.start.column=n.getCurrentTokenColumn()+2,n=new c(this,e,t),-1!=i){var a=-1;do{if(r=n.stepForward(),-1==a){var l=this.getState(n.$row);o.test(l)||(a=n.$row)}else if(n.$row>a)break}while(r&&o.test(r.type));r=n.stepBackward()}else r=n.getCurrentToken();return s.end.row=n.getCurrentTokenRow(),s.end.column=n.getCurrentTokenColumn()+r.value.length-2,s}},this.foldAll=function(e,t,i,n){null==i&&(i=1e5);var r=this.foldWidgets;if(r){t=t||this.getLength();for(var s,o=e=e||0;o<t;o++)null==r[o]&&(r[o]=this.getFoldWidget(o)),"start"!=r[o]||n&&!n(o)||(s=this.getFoldWidgetRange(o))&&s.isMultiLine()&&s.end.row<=t&&s.start.row>=e&&(o=s.end.row,s.collapseChildren=i,this.addFold("...",s))}},this.foldToLevel=function(e){for(this.foldAll();0<e--;)this.unfold(null,!1)},this.foldAllComments=function(){var r=this;this.foldAll(null,null,null,function(e){for(var t=r.getTokens(e),i=0;i<t.length;i++){var n=t[i];if("text"!=n.type||!/^\s+$/.test(n.value))return!!/comment/.test(n.type)}})},this.$foldStyles={manual:1,markbegin:1,markbeginend:1},this.$foldStyle="markbegin",this.setFoldStyle=function(e){if(!this.$foldStyles[e])throw new Error("invalid fold style: "+e+"["+Object.keys(this.$foldStyles).join(", ")+"]");this.$foldStyle!=e&&("manual"==(this.$foldStyle=e)&&this.unfold(),e=this.$foldMode,this.$setFolding(null),this.$setFolding(e))},this.$setFolding=function(e){this.$foldMode!=e&&(this.$foldMode=e,this.off("change",this.$updateFoldWidgets),this.off("tokenizerUpdate",this.$tokenizerUpdateFoldWidgets),this._signal("changeAnnotation"),e&&"manual"!=this.$foldStyle?(this.foldWidgets=[],this.getFoldWidget=e.getFoldWidget.bind(e,this,this.$foldStyle),this.getFoldWidgetRange=e.getFoldWidgetRange.bind(e,this,this.$foldStyle),this.$updateFoldWidgets=this.updateFoldWidgets.bind(this),this.$tokenizerUpdateFoldWidgets=this.tokenizerUpdateFoldWidgets.bind(this),this.on("change",this.$updateFoldWidgets),this.on("tokenizerUpdate",this.$tokenizerUpdateFoldWidgets)):this.foldWidgets=null)},this.getParentFoldRangeData=function(e,t){var i=this.foldWidgets;if(!i||t&&i[e])return{};for(var n=e-1;0<=n;){var r=i[n];if("start"==(r=null==r?i[n]=this.getFoldWidget(n):r)){var s=this.getFoldWidgetRange(n),o=o||s;if(s&&s.end.row>=e)break}n--}return{range:-1!==n&&s,firstRange:o}},this.onFoldWidgetClick=function(e,t){var i={children:(t=t.domEvent).shiftKey,all:t.ctrlKey||t.metaKey,siblings:t.altKey};this.$toggleFoldWidget(e,i)||(e=t.target||t.srcElement)&&/ace_fold-widget/.test(e.className)&&(e.className+=" ace_invalid")},this.$toggleFoldWidget=function(e,t){var i,n,r,s;if(this.getFoldWidget)return i=this.getFoldWidget(e),n=this.getLine(e),(n=this.getFoldAt(e,-1==(i="end"===i?-1:1)?0:n.length,i))?(t.children||t.all?this.removeFold(n):this.expandFold(n),n):(i=this.getFoldWidgetRange(e,!0))&&!i.isMultiLine()&&(n=this.getFoldAt(i.start.row,i.start.column,1))&&i.isEqual(n.range)?(this.removeFold(n),n):(t.siblings?((n=this.getParentFoldRangeData(e)).range&&(r=n.range.start.row+1,s=n.range.end.row),this.foldAll(r,s,t.all?1e4:0)):t.children?(s=i?i.end.row:this.getLength(),this.foldAll(e+1,s,t.all?1e4:0)):i&&(t.all&&(i.collapseChildren=1e4),this.addFold("...",i)),i)},this.toggleFoldWidget=function(e){var t,i=this.selection.getCursor().row;i=this.getRowFoldStart(i),!this.$toggleFoldWidget(i,{})&&(t=(t=this.getParentFoldRangeData(i,!0)).range||t.firstRange)&&(i=t.start.row,(i=this.getFoldAt(i,this.getLine(i).length,1))?this.removeFold(i):this.addFold("...",t))},this.updateFoldWidgets=function(e){var t=e.start.row,i=e.end.row-t;0==i?this.foldWidgets[t]=null:"remove"==e.action?this.foldWidgets.splice(t,1+i,null):((e=Array(1+i)).unshift(t,1),this.foldWidgets.splice.apply(this.foldWidgets,e))},this.tokenizerUpdateFoldWidgets=function(e){e=e.data;e.first!=e.last&&this.foldWidgets.length>e.first&&this.foldWidgets.splice(e.first,this.foldWidgets.length)}}}),ace.define("ace/edit_session/bracket_match",["require","exports","module","ace/token_iterator","ace/range"],function(e,t,i){"use strict";var d=e("../token_iterator").TokenIterator,a=e("../range").Range;t.BracketMatch=function(){this.findMatchingBracket=function(e,t){return 0!=e.column&&""!=(t=t||this.getLine(e.row).charAt(e.column-1))&&(t=t.match(/([\(\[\{])|([\)\]\}])/))?t[1]?this.$findClosingBracket(t[1],e):this.$findOpeningBracket(t[2],e):null},this.getBracketRange=function(e){var t,i,n=this.getLine(e.row),r=!0,s=n.charAt(e.column-1),o=s&&s.match(/([\(\[\{])|([\)\]\}])/);if(o||(s=n.charAt(e.column),e={row:e.row,column:e.column+1},o=s&&s.match(/([\(\[\{])|([\)\]\}])/),r=!1),!o)return null;if(o[1]){if(!(i=this.$findClosingBracket(o[1],e)))return null;t=a.fromPoints(e,i),r||(t.end.column++,t.start.column--),t.cursor=t.end}else{if(!(i=this.$findOpeningBracket(o[2],e)))return null;t=a.fromPoints(i,e),r||(t.start.column++,t.end.column--),t.cursor=t.start}return t},this.getMatchingBracketRanges=function(e){var t=this.getLine(e.row),i=t.charAt(e.column-1),n=i&&i.match(/([\(\[\{])|([\)\]\}])/);return n||(i=t.charAt(e.column),e={row:e.row,column:e.column+1},n=i&&i.match(/([\(\[\{])|([\)\]\}])/)),n?(t=new a(e.row,e.column-1,e.row,e.column),(i=n[1]?this.$findClosingBracket(n[1],e):this.$findOpeningBracket(n[2],e))?[t,new a(i.row,i.column,i.row,i.column+1)]:[t]):null},this.$brackets={")":"(","(":")","]":"[","[":"]","{":"}","}":"{","<":">",">":"<"},this.$findOpeningBracket=function(e,t,i){var n=this.$brackets[e],r=1,s=new d(this,t.row,t.column),o=s.getCurrentToken();if(o=o||s.stepForward()){i=i||new RegExp("(\\.?"+o.type.replace(".","\\.").replace("rparen",".paren").replace(/\b(?:end)\b/,"(?:start|begin|end)")+")+");for(var a=t.column-s.getCurrentTokenColumn()-2,l=o.value;;){for(;0<=a;){var h=l.charAt(a);if(h==n){if(0==--r)return{row:s.getCurrentTokenRow(),column:a+s.getCurrentTokenColumn()}}else h==e&&(r+=1);--a}for(;(o=s.stepBackward())&&!i.test(o.type););if(null==o)break;a=(l=o.value).length-1}return null}},this.$findClosingBracket=function(e,t,i){var n=this.$brackets[e],r=1,s=new d(this,t.row,t.column),o=s.getCurrentToken();if(o=o||s.stepForward()){i=i||new RegExp("(\\.?"+o.type.replace(".","\\.").replace("lparen",".paren").replace(/\b(?:start|begin)\b/,"(?:start|begin|end)")+")+");for(var a=t.column-s.getCurrentTokenColumn();;){for(var l=o.value,h=l.length;a<h;){var c=l.charAt(a);if(c==n){if(0==--r)return{row:s.getCurrentTokenRow(),column:a+s.getCurrentTokenColumn()}}else c==e&&(r+=1);a+=1}for(;(o=s.stepForward())&&!i.test(o.type););if(null==o)break;a=0}return null}}}}),ace.define("ace/edit_session",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/bidihandler","ace/config","ace/lib/event_emitter","ace/selection","ace/mode/text","ace/range","ace/document","ace/background_tokenizer","ace/search_highlight","ace/edit_session/folding","ace/edit_session/bracket_match"],function(e,t,i){"use strict";function n(e,t){this.$breakpoints=[],this.$decorations=[],this.$frontMarkers={},this.$backMarkers={},this.$markerId=1,this.$undoSelect=!0,this.$foldData=[],this.id="session"+ ++n.$uid,this.$foldData.toString=function(){return this.join("\n")},this.on("changeFold",this.onChangeFold.bind(this)),this.$onChange=this.onChange.bind(this),"object"==typeof e&&e.getLine||(e=new u(e)),this.setDocument(e),this.selection=new a(this),this.$bidiHandler=new o(this),l.resetOptions(this),this.setMode(t),l._signal("session",this)}var r=e("./lib/oop"),s=e("./lib/lang"),o=e("./bidihandler").BidiHandler,l=e("./config"),h=e("./lib/event_emitter").EventEmitter,a=e("./selection").Selection,c=e("./mode/text").Mode,d=e("./range").Range,u=e("./document").Document,p=e("./background_tokenizer").BackgroundTokenizer,f=e("./search_highlight").SearchHighlight;n.$uid=0,function(){function a(e){return!(e<4352)&&(4352<=e&&e<=4447||4515<=e&&e<=4519||4602<=e&&e<=4607||9001<=e&&e<=9002||11904<=e&&e<=11929||11931<=e&&e<=12019||12032<=e&&e<=12245||12272<=e&&e<=12283||12288<=e&&e<=12350||12353<=e&&e<=12438||12441<=e&&e<=12543||12549<=e&&e<=12589||12593<=e&&e<=12686||12688<=e&&e<=12730||12736<=e&&e<=12771||12784<=e&&e<=12830||12832<=e&&e<=12871||12880<=e&&e<=13054||13056<=e&&e<=19903||19968<=e&&e<=42124||42128<=e&&e<=42182||43360<=e&&e<=43388||44032<=e&&e<=55203||55216<=e&&e<=55238||55243<=e&&e<=55291||63744<=e&&e<=64255||65040<=e&&e<=65049||65072<=e&&e<=65106||65108<=e&&e<=65126||65128<=e&&e<=65131||65281<=e&&e<=65376||65504<=e&&e<=65510)}r.implement(this,h),this.setDocument=function(e){this.doc&&this.doc.removeListener("change",this.$onChange),(this.doc=e).on("change",this.$onChange),this.bgTokenizer&&this.bgTokenizer.setDocument(this.getDocument()),this.resetCaches()},this.getDocument=function(){return this.doc},this.$resetRowCache=function(e){var t;e?(t=this.$docRowCache.length,(e=this.$getRowCacheIndex(this.$docRowCache,e)+1)<t&&(this.$docRowCache.splice(e,t),this.$screenRowCache.splice(e,t))):(this.$docRowCache=[],this.$screenRowCache=[])},this.$getRowCacheIndex=function(e,t){for(var i=0,n=e.length-1;i<=n;){var r=i+n>>1,s=e[r];if(s<t)i=1+r;else{if(!(t<s))return r;n=r-1}}return i-1},this.resetCaches=function(){this.$modified=!0,this.$wrapData=[],this.$rowLengthCache=[],this.$resetRowCache(0),this.bgTokenizer&&this.bgTokenizer.start(0)},this.onChangeFold=function(e){e=e.data;this.$resetRowCache(e.start.row)},this.onChange=function(e){this.$modified=!0,this.$bidiHandler.onChange(e),this.$resetRowCache(e.start.row);var t=this.$updateInternalDataOnChange(e);!this.$fromUndo&&this.$undoManager&&(t&&t.length&&(this.$undoManager.add({action:"removeFolds",folds:t},this.mergeUndoDeltas),this.mergeUndoDeltas=!0),this.$undoManager.add(e,this.mergeUndoDeltas),this.mergeUndoDeltas=!0,this.$informUndoManager.schedule()),this.bgTokenizer&&this.bgTokenizer.$updateOnChange(e),this._signal("change",e)},this.setValue=function(e){this.doc.setValue(e),this.selection.moveTo(0,0),this.$resetRowCache(0),this.setUndoManager(this.$undoManager),this.getUndoManager().reset()},this.getValue=this.toString=function(){return this.doc.getValue()},this.getSelection=function(){return this.selection},this.getState=function(e){return this.bgTokenizer.getState(e)},this.getTokens=function(e){return this.bgTokenizer.getTokens(e)},this.getTokenAt=function(e,t){var i=this.bgTokenizer.getTokens(e),n=0;if(null==t)var r=i.length-1,n=this.getLine(e).length;else for(r=0;r<i.length&&!(t<=(n+=i[r].value.length));r++);return(e=i[r])?(e.index=r,e.start=n-e.value.length,e):null},this.setUndoManager=function(e){var t;this.$undoManager=e,this.$informUndoManager&&this.$informUndoManager.cancel(),e?(e.addSession(t=this),this.$syncInformUndoManager=function(){t.$informUndoManager.cancel(),t.mergeUndoDeltas=!1},this.$informUndoManager=s.delayedCall(this.$syncInformUndoManager)):this.$syncInformUndoManager=function(){}},this.markUndoGroup=function(){this.$syncInformUndoManager&&this.$syncInformUndoManager()},this.$defaultUndoManager={undo:function(){},redo:function(){},hasUndo:function(){},hasRedo:function(){},reset:function(){},add:function(){},addSelection:function(){},startNewGroup:function(){},addSession:function(){}},this.getUndoManager=function(){return this.$undoManager||this.$defaultUndoManager},this.getTabString=function(){return this.getUseSoftTabs()?s.stringRepeat(" ",this.getTabSize()):"\t"},this.setUseSoftTabs=function(e){this.setOption("useSoftTabs",e)},this.getUseSoftTabs=function(){return this.$useSoftTabs&&!this.$mode.$indentWithTabs},this.setTabSize=function(e){this.setOption("tabSize",e)},this.getTabSize=function(){return this.$tabSize},this.isTabStop=function(e){return this.$useSoftTabs&&e.column%this.$tabSize==0},this.setNavigateWithinSoftTabs=function(e){this.setOption("navigateWithinSoftTabs",e)},this.getNavigateWithinSoftTabs=function(){return this.$navigateWithinSoftTabs},this.$overwrite=!1,this.setOverwrite=function(e){this.setOption("overwrite",e)},this.getOverwrite=function(){return this.$overwrite},this.toggleOverwrite=function(){this.setOverwrite(!this.$overwrite)},this.addGutterDecoration=function(e,t){this.$decorations[e]||(this.$decorations[e]=""),this.$decorations[e]+=" "+t,this._signal("changeBreakpoint",{})},this.removeGutterDecoration=function(e,t){this.$decorations[e]=(this.$decorations[e]||"").replace(" "+t,""),this._signal("changeBreakpoint",{})},this.getBreakpoints=function(){return this.$breakpoints},this.setBreakpoints=function(e){this.$breakpoints=[];for(var t=0;t<e.length;t++)this.$breakpoints[e[t]]="ace_breakpoint";this._signal("changeBreakpoint",{})},this.clearBreakpoints=function(){this.$breakpoints=[],this._signal("changeBreakpoint",{})},this.setBreakpoint=function(e,t){(t=void 0===t?"ace_breakpoint":t)?this.$breakpoints[e]=t:delete this.$breakpoints[e],this._signal("changeBreakpoint",{})},this.clearBreakpoint=function(e){delete this.$breakpoints[e],this._signal("changeBreakpoint",{})},this.addMarker=function(e,t,i,n){var r=this.$markerId++,e={range:e,type:i||"line",renderer:"function"==typeof i?i:null,clazz:t,inFront:!!n,id:r};return n?(this.$frontMarkers[r]=e,this._signal("changeFrontMarker")):(this.$backMarkers[r]=e,this._signal("changeBackMarker")),r},this.addDynamicMarker=function(e,t){var i;if(e.update)return i=this.$markerId++,e.id=i,e.inFront=!!t,t?(this.$frontMarkers[i]=e,this._signal("changeFrontMarker")):(this.$backMarkers[i]=e,this._signal("changeBackMarker")),e},this.removeMarker=function(e){var t=this.$frontMarkers[e]||this.$backMarkers[e];t&&(delete(t.inFront?this.$frontMarkers:this.$backMarkers)[e],this._signal(t.inFront?"changeFrontMarker":"changeBackMarker"))},this.getMarkers=function(e){return e?this.$frontMarkers:this.$backMarkers},this.highlight=function(e){var t;this.$searchHighlight||(t=new f(null,"ace_selected-word","text"),this.$searchHighlight=this.addDynamicMarker(t)),this.$searchHighlight.setRegexp(e)},this.highlightLines=function(e,t,i,n){"number"!=typeof t&&(i=t,t=e),i=i||"ace_step";e=new d(e,0,t,1/0);return e.id=this.addMarker(e,i,"fullLine",n),e},this.setAnnotations=function(e){this.$annotations=e,this._signal("changeAnnotation",{})},this.getAnnotations=function(){return this.$annotations||[]},this.clearAnnotations=function(){this.setAnnotations([])},this.$detectNewLine=function(e){e=e.match(/^.*?(\r?\n)/m);this.$autoNewLine=e?e[1]:"\n"},this.getWordRange=function(e,t){var i,n=this.getLine(e),r=!1,s=(i=(r=(r=0<t?!!n.charAt(t-1).match(this.tokenRe):r)||!!n.charAt(t).match(this.tokenRe))?this.tokenRe:/^\s+$/.test(n.slice(t-1,t+1))?/\s/:this.nonTokenRe,t);if(0<s){for(;0<=--s&&n.charAt(s).match(i););s++}for(var o=t;o<n.length&&n.charAt(o).match(i);)o++;return new d(e,s,e,o)},this.getAWordRange=function(e,t){for(var i=this.getWordRange(e,t),n=this.getLine(i.end.row);n.charAt(i.end.column).match(/[ \t]/);)i.end.column+=1;return i},this.setNewLineMode=function(e){this.doc.setNewLineMode(e)},this.getNewLineMode=function(){return this.doc.getNewLineMode()},this.setUseWorker=function(e){this.setOption("useWorker",e)},this.getUseWorker=function(){return this.$useWorker},this.onReloadTokenizer=function(e){var t=e.data;this.bgTokenizer.start(t.first),this._signal("tokenizerUpdate",e)},this.$modes=l.$modes,this.$mode=null,this.$modeId=null,this.setMode=function(e,t){if(e&&"object"==typeof e){if(e.getTokenizer)return this.$onChangeMode(e);var i=e,n=i.path}else n=e||"ace/mode/text";this.$modes["ace/mode/text"]||(this.$modes["ace/mode/text"]=new c),this.$modes[n]&&!i?(this.$onChangeMode(this.$modes[n]),t&&t()):(this.$modeId=n,l.loadModule(["mode",n],function(e){if(this.$modeId!==n)return t&&t();this.$modes[n]&&!i?this.$onChangeMode(this.$modes[n]):e&&e.Mode&&(e=new e.Mode(i),i||((this.$modes[n]=e).$id=n),this.$onChangeMode(e)),t&&t()}.bind(this)),this.$mode||this.$onChangeMode(this.$modes["ace/mode/text"],!0))},this.$onChangeMode=function(e,t){var i,n,r,s;t||(this.$modeId=e.$id),this.$mode===e||(i=this.$mode,this.$mode=e,this.$stopWorker(),this.$useWorker&&this.$startWorker(),void 0!==(n=e.getTokenizer()).on&&(r=this.onReloadTokenizer.bind(this),n.on("update",r)),this.bgTokenizer?this.bgTokenizer.setTokenizer(n):(this.bgTokenizer=new p(n),(s=this).bgTokenizer.on("update",function(e){s._signal("tokenizerUpdate",e)})),this.bgTokenizer.setDocument(this.getDocument()),this.tokenRe=e.tokenRe,this.nonTokenRe=e.nonTokenRe,t)||(e.attachToSession&&e.attachToSession(this),this.$options.wrapMethod.set.call(this,this.$wrapMethod),this.$setFolding(e.foldingRules),this.bgTokenizer.start(0),this._emit("changeMode",{oldMode:i,mode:e}))},this.$stopWorker=function(){this.$worker&&(this.$worker.terminate(),this.$worker=null)},this.$startWorker=function(){try{this.$worker=this.$mode.createWorker(this)}catch(e){l.warn("Could not load worker",e),this.$worker=null}},this.getMode=function(){return this.$mode},this.$scrollTop=0,this.setScrollTop=function(e){this.$scrollTop===e||isNaN(e)||(this.$scrollTop=e,this._signal("changeScrollTop",e))},this.getScrollTop=function(){return this.$scrollTop},this.$scrollLeft=0,this.setScrollLeft=function(e){this.$scrollLeft===e||isNaN(e)||(this.$scrollLeft=e,this._signal("changeScrollLeft",e))},this.getScrollLeft=function(){return this.$scrollLeft},this.getScreenWidth=function(){return this.$computeWidth(),this.lineWidgets?Math.max(this.getLineWidgetMaxWidth(),this.screenWidth):this.screenWidth},this.getLineWidgetMaxWidth=function(){var t;return null!=this.lineWidgetsWidth?this.lineWidgetsWidth:(t=0,this.lineWidgets.forEach(function(e){e&&e.screenWidth>t&&(t=e.screenWidth)}),this.lineWidgetWidth=t)},this.$computeWidth=function(e){if(this.$modified||e){if(this.$modified=!1,this.$useWrapMode)return this.screenWidth=this.$wrapLimit;for(var t=this.doc.getAllLines(),i=this.$rowLengthCache,n=0,r=0,s=this.$foldData[r],o=s?s.start.row:1/0,a=t.length,l=0;l<a;l++){if(o<l){if(a<=(l=s.end.row+1))break;o=(s=this.$foldData[r++])?s.start.row:1/0}null==i[l]&&(i[l]=this.$getStringScreenWidth(t[l])[0]),i[l]>n&&(n=i[l])}this.screenWidth=n}},this.getLine=function(e){return this.doc.getLine(e)},this.getLines=function(e,t){return this.doc.getLines(e,t)},this.getLength=function(){return this.doc.getLength()},this.getTextRange=function(e){return this.doc.getTextRange(e||this.selection.getRange())},this.insert=function(e,t){return this.doc.insert(e,t)},this.remove=function(e){return this.doc.remove(e)},this.removeFullLines=function(e,t){return this.doc.removeFullLines(e,t)},this.undoChanges=function(e,t){if(e.length){this.$fromUndo=!0;for(var i=e.length-1;-1!=i;i--){var n=e[i];"insert"==n.action||"remove"==n.action?this.doc.revertDelta(n):n.folds&&this.addFolds(n.folds)}!t&&this.$undoSelect&&(e.selectionBefore?this.selection.fromJSON(e.selectionBefore):this.selection.setRange(this.$getUndoSelection(e,!0))),this.$fromUndo=!1}},this.redoChanges=function(e,t){if(e.length){this.$fromUndo=!0;for(var i=0;i<e.length;i++){var n=e[i];"insert"!=n.action&&"remove"!=n.action||this.doc.$safeApplyDelta(n)}!t&&this.$undoSelect&&(e.selectionAfter?this.selection.fromJSON(e.selectionAfter):this.selection.setRange(this.$getUndoSelection(e,!1))),this.$fromUndo=!1}},this.setUndoSelect=function(e){this.$undoSelect=e},this.$getUndoSelection=function(e,t){function i(e){return t?"insert"!==e.action:"insert"===e.action}for(var n,r,s=0;s<e.length;s++){var o=e[s];o.start&&(n?i(o)?(r=o.start,-1==n.compare(r.row,r.column)&&n.setStart(r),r=o.end,1==n.compare(r.row,r.column)&&n.setEnd(r)):(r=o.start,-1==n.compare(r.row,r.column)&&(n=d.fromPoints(o.start,o.start))):n=i(o)?d.fromPoints(o.start,o.end):d.fromPoints(o.start,o.start))}return n},this.replace=function(e,t){return this.doc.replace(e,t)},this.moveText=function(e,t,i){var n,r,s,o=this.getTextRange(e),a=this.getFoldsInRange(e),t=d.fromPoints(t,t);return i||(this.remove(e),r=e.start.row-e.end.row,(s=r?-e.end.column:e.start.column-e.end.column)&&(t.start.row==e.end.row&&t.start.column>e.end.column&&(t.start.column+=s),t.end.row==e.end.row)&&t.end.column>e.end.column&&(t.end.column+=s),r&&t.start.row>=e.end.row&&(t.start.row+=r,t.end.row+=r)),t.end=this.insert(t.start,o),a.length&&(n=e.start,i=t.start,r=i.row-n.row,s=i.column-n.column,this.addFolds(a.map(function(e){return(e=e.clone()).start.row==n.row&&(e.start.column+=s),e.end.row==n.row&&(e.end.column+=s),e.start.row+=r,e.end.row+=r,e}))),t},this.indentRows=function(e,t,i){i=i.replace(/\t/g,this.getTabString());for(var n=e;n<=t;n++)this.doc.insertInLine({row:n,column:0},i)},this.outdentRows=function(e){for(var t=e.collapseRows(),i=new d(0,0,0,0),n=this.getTabSize(),r=t.start.row;r<=t.end.row;++r){var s=this.getLine(r);i.start.row=r,i.end.row=r;for(var o=0;o<n&&" "==s.charAt(o);++o);o<n&&"\t"==s.charAt(o)?(i.start.column=o,i.end.column=o+1):(i.start.column=0,i.end.column=o),this.remove(i)}},this.$moveLines=function(e,t,i){if(e=this.getRowFoldStart(e),t=this.getRowFoldEnd(t),i<0){if((r=this.getRowFoldStart(e+i))<0)return 0;var n=r-e}else if(0<i){if((r=this.getRowFoldEnd(t+i))>this.doc.getLength()-1)return 0;n=r-t}else{e=this.$clipRowToDocument(e);n=(t=this.$clipRowToDocument(t))-e+1}var r=new d(e,0,t,Number.MAX_VALUE),r=this.getFoldsInRange(r).map(function(e){return(e=e.clone()).start.row+=n,e.end.row+=n,e}),i=0==i?this.doc.getLines(e,t):this.doc.removeFullLines(e,t);return this.doc.insertFullLines(e+n,i),r.length&&this.addFolds(r),n},this.moveLinesUp=function(e,t){return this.$moveLines(e,t,-1)},this.moveLinesDown=function(e,t){return this.$moveLines(e,t,1)},this.duplicateLines=function(e,t){return this.$moveLines(e,t,0)},this.$clipRowToDocument=function(e){return Math.max(0,Math.min(e,this.doc.getLength()-1))},this.$clipColumnToRow=function(e,t){return t<0?0:Math.min(this.doc.getLine(e).length,t)},this.$clipPositionToDocument=function(e,t){var i;return t=Math.max(0,t),t=e<0?e=0:(i=this.doc.getLength())<=e?this.doc.getLine(e=i-1).length:Math.min(this.doc.getLine(e).length,t),{row:e,column:t}},this.$clipRangeToDocument=function(e){e.start.row<0?(e.start.row=0,e.start.column=0):e.start.column=this.$clipColumnToRow(e.start.row,e.start.column);var t=this.doc.getLength()-1;return e.end.row>t?(e.end.row=t,e.end.column=this.doc.getLine(t).length):e.end.column=this.$clipColumnToRow(e.end.row,e.end.column),e},this.$wrapLimit=80,this.$useWrapMode=!1,this.$wrapLimitRange={min:null,max:null},this.setUseWrapMode=function(e){e!=this.$useWrapMode&&(this.$useWrapMode=e,this.$modified=!0,this.$resetRowCache(0),e&&(e=this.getLength(),this.$wrapData=Array(e),this.$updateWrapData(0,e-1)),this._signal("changeWrapMode"))},this.getUseWrapMode=function(){return this.$useWrapMode},this.setWrapLimitRange=function(e,t){this.$wrapLimitRange.min===e&&this.$wrapLimitRange.max===t||(this.$wrapLimitRange={min:e,max:t},this.$modified=!0,this.$bidiHandler.markAsDirty(),this.$useWrapMode&&this._signal("changeWrapMode"))},this.adjustWrapLimit=function(e,t){var i=this.$wrapLimitRange,t=(i.max<0&&(i={min:t,max:t}),this.$constrainWrapLimit(e,i.min,i.max));return t!=this.$wrapLimit&&1<t&&(this.$wrapLimit=t,this.$modified=!0,this.$useWrapMode&&(this.$updateWrapData(0,this.getLength()-1),this.$resetRowCache(0),this._signal("changeWrapLimit")),!0)},this.$constrainWrapLimit=function(e,t,i){return t&&(e=Math.max(t,e)),e=i?Math.min(i,e):e},this.getWrapLimit=function(){return this.$wrapLimit},this.setWrapLimit=function(e){this.setWrapLimitRange(e,e)},this.getWrapLimitRange=function(){return{min:this.$wrapLimitRange.min,max:this.$wrapLimitRange.max}},this.$updateInternalDataOnChange=function(e){var t=this.$useWrapMode,i=e.action,n=e.start,r=e.end,s=n.row,o=r.row,a=o-s,l=null;if(this.$updating=!0,0!=a)if("remove"===i){this[t?"$wrapData":"$rowLengthCache"].splice(s,a);var h=this.$foldData,l=this.getFoldsInRange(e);this.removeFolds(l);var c=0;for((p=this.getFoldLine(r.row))&&(p.addRemoveChars(r.row,r.column,n.column-r.column),p.shiftRow(-a),(d=this.getFoldLine(s))&&d!==p&&(d.merge(p),p=d),c=h.indexOf(p)+1);c<h.length;c++)(p=h[c]).start.row>=r.row&&p.shiftRow(-a);o=s}else{var d=Array(a),u=(d.unshift(s,0),t?this.$wrapData:this.$rowLengthCache),h=(u.splice.apply(u,d),this.$foldData),c=0;for((p=this.getFoldLine(s))&&(0==(u=p.range.compareInside(n.row,n.column))?(p=p.split(n.row,n.column))&&(p.shiftRow(a),p.addRemoveChars(o,0,r.column-n.column)):-1==u&&(p.addRemoveChars(s,0,r.column-n.column),p.shiftRow(a)),c=h.indexOf(p)+1);c<h.length;c++)(p=h[c]).start.row>=s&&p.shiftRow(a)}else{var p,a=Math.abs(e.start.column-e.end.column);"remove"===i&&(l=this.getFoldsInRange(e),this.removeFolds(l),a=-a),(p=this.getFoldLine(s))&&p.addRemoveChars(s,n.column,a)}return t&&this.$wrapData.length!=this.doc.getLength()&&console.error("doc.getLength() and $wrapData.length have to be the same!"),this.$updating=!1,t?this.$updateWrapData(s,o):this.$updateRowLengthCache(s,o),l},this.$updateRowLengthCache=function(e,t,i){this.$rowLengthCache[e]=null,this.$rowLengthCache[t]=null},this.$updateWrapData=function(e,t){var o,i,a=this.doc.getAllLines(),n=this.getTabSize(),r=this.$wrapData,s=this.$wrapLimit,l=e;for(t=Math.min(t,a.length-1);l<=t;)(i=this.getFoldLine(l,i))?(o=[],i.walk(function(e,t,i,n){var r;if(null!=e){(r=this.$getDisplayTokens(e,o.length))[0]=m;for(var s=1;s<r.length;s++)r[s]=g}else r=this.$getDisplayTokens(a[t].substring(n,i),o.length);o=o.concat(r)}.bind(this),i.end.row,a[i.end.row].length+1),r[i.start.row]=this.$computeWrapSplits(o,s,n),l=i.end.row+1):(o=this.$getDisplayTokens(a[l]),r[l]=this.$computeWrapSplits(o,s,n),l++)};var m=3,g=4;this.$computeWrapSplits=function(r,e,s){function t(e){for(var t=e-a,i=a;i<e;i++){var n=r[i];12!==n&&2!==n||--t}o.length||(u=function(){var e=0;if(0===d)return e;if(c)for(var t=0;t<r.length;t++){var i=r[t];if(10==i)e+=1;else{if(11!=i){if(12==i)continue;break}e+=s}}return h&&!1!==c&&(e+=s),Math.min(e,d)}(),o.indent=u),l+=t,o.push(l),a=e}if(0==r.length)return[];for(var o=[],i=r.length,a=0,l=0,h=this.$wrapAsCode,c=this.$indentedSoftWrap,d=e<=Math.max(2*s,8)||!1===c?0:Math.floor(e/2),u=0;e-u<i-a;){var n=a+e-u;if(10<=r[n-1]&&10<=r[n])t(n);else if(r[n]==m||r[n]==g){for(;n!=a-1&&r[n]!=m;n--);if(a<n);else{for(n=a+e;n<r.length&&r[n]==g;n++);if(n==r.length)break}t(n)}else{for(var p=Math.max(n-(e-(e>>2)),a-1);p<n&&r[n]<m;)n--;if(h){for(;p<n&&r[n]<m;)n--;for(;p<n&&9==r[n];)n--}else for(;p<n&&r[n]<10;)n--;p<n?t(++n):(2==r[n=a+e]&&n--,t(n-u))}}return o},this.$getDisplayTokens=function(e,t){var i,n=[];t=t||0;for(var r=0;r<e.length;r++){var s=e.charCodeAt(r);if(9==s){i=this.getScreenTabSize(n.length+t),n.push(11);for(var o=1;o<i;o++)n.push(12)}else 32==s?n.push(10):39<s&&s<48||57<s&&s<64?n.push(9):4352<=s&&a(s)?n.push(1,2):n.push(1)}return n},this.$getStringScreenWidth=function(e,t,i){if(0==t)return[0,0];var n,r;for(null==t&&(t=1/0),i=i||0,r=0;r<e.length&&(9==(n=e.charCodeAt(r))?i+=this.getScreenTabSize(i):4352<=n&&a(n)?i+=2:i+=1,!(t<i));r++);return[i,r]},this.lineWidgets=null,this.getRowLength=function(e){var t=1;return this.lineWidgets&&(t+=this.lineWidgets[e]&&this.lineWidgets[e].rowCount||0),this.$useWrapMode&&this.$wrapData[e]?this.$wrapData[e].length+t:t},this.getRowLineCount=function(e){return this.$useWrapMode&&this.$wrapData[e]?this.$wrapData[e].length+1:1},this.getRowWrapIndent=function(e){var t;return this.$useWrapMode&&(e=this.screenToDocumentPosition(e,Number.MAX_VALUE),(t=this.$wrapData[e.row]).length)&&t[0]<e.column?t.indent:0},this.getScreenLastRowColumn=function(e){e=this.screenToDocumentPosition(e,Number.MAX_VALUE);return this.documentToScreenColumn(e.row,e.column)},this.getDocumentLastRowColumn=function(e,t){e=this.documentToScreenRow(e,t);return this.getScreenLastRowColumn(e)},this.getDocumentLastRowColumnPosition=function(e,t){e=this.documentToScreenRow(e,t);return this.screenToDocumentPosition(e,Number.MAX_VALUE/10)},this.getRowSplitData=function(e){return this.$useWrapMode?this.$wrapData[e]:void 0},this.getScreenTabSize=function(e){return this.$tabSize-(e%this.$tabSize|0)},this.screenToDocumentRow=function(e,t){return this.screenToDocumentPosition(e,t).row},this.screenToDocumentColumn=function(e,t){return this.screenToDocumentPosition(e,t).column},this.screenToDocumentPosition=function(e,t,i){if(e<0)return{row:0,column:0};for(var n,r,s,o=0,a=0,l=0,h=0,c=this.$screenRowCache,d=this.$getRowCacheIndex(c,e),u=c.length,p=(s=u&&0<=d?(l=c[d],o=this.$docRowCache[d],e>c[u-1]):!u,this.getLength()-1),m=this.getNextFoldLine(o),g=m?m.start.row:1/0;l<=e&&!(e<l+(h=this.getRowLength(o))||p<=o);)l+=h,g<++o&&(o=m.end.row+1,g=(m=this.getNextFoldLine(o,m))?m.start.row:1/0),s&&(this.$docRowCache.push(o),this.$screenRowCache.push(l));if(m&&m.start.row<=o)n=this.getFoldDisplayLine(m),o=m.start.row;else{if(l+h<=e||p<o)return{row:p,column:this.getLine(p).length};n=this.getLine(o),m=null}d=0,c=Math.floor(e-l);return this.$useWrapMode&&(u=this.$wrapData[o])&&(r=u[c],0<c)&&u.length&&(d=u.indent,a=u[c-1]||u[u.length-1],n=n.substring(a)),void 0!==i&&this.$bidiHandler.isBidiRow(l+c,o,c)&&(t=this.$bidiHandler.offsetToCol(i)),a+=this.$getStringScreenWidth(n,t-d)[1],this.$useWrapMode&&r<=a&&(a=r-1),m?m.idxToPosition(a):{row:o,column:a}},this.documentToScreenPosition=function(e,t){var i=void 0===t?this.$clipPositionToDocument(e.row,e.column):this.$clipPositionToDocument(e,t),n=(e=i.row,t=i.column,0),i=null;(a=this.getFoldAt(e,t,1))&&(e=a.start.row,t=a.start.column);for(var r,s,o=0,a=this.$docRowCache,l=this.$getRowCacheIndex(a,e),h=a.length,c=(s=h&&0<=l?(o=a[l],n=this.$screenRowCache[l],e>a[h-1]):!h,this.getNextFoldLine(o)),d=c?c.start.row:1/0;o<e;){if(d<=o){if(e<(r=c.end.row+1))break;d=(c=this.getNextFoldLine(r,c))?c.start.row:1/0}else r=o+1;n+=this.getRowLength(o),o=r,s&&(this.$docRowCache.push(o),this.$screenRowCache.push(n))}var u="",i=c&&d<=o?(u=this.getFoldDisplayLine(c,e,t),c.start.row):(u=this.getLine(e).substring(0,t),e),l=0;if(this.$useWrapMode){var p=this.$wrapData[i];if(p){for(var m=0;u.length>=p[m];)n++,m++;u=u.substring(p[m-1]||0,u.length),l=0<m?p.indent:0}}return this.lineWidgets&&this.lineWidgets[o]&&this.lineWidgets[o].rowsAbove&&(n+=this.lineWidgets[o].rowsAbove),{row:n,column:l+this.$getStringScreenWidth(u)[0]}},this.documentToScreenColumn=function(e,t){return this.documentToScreenPosition(e,t).column},this.documentToScreenRow=function(e,t){return this.documentToScreenPosition(e,t).row},this.getScreenLength=function(){var e=0,t=null;if(this.$useWrapMode)for(var i=this.$wrapData.length,n=0,r=0,s=(t=this.$foldData[r++])?t.start.row:1/0;n<i;){var o=this.$wrapData[n];e+=o?o.length+1:1,s<++n&&(n=t.end.row+1,s=(t=this.$foldData[r++])?t.start.row:1/0)}else for(var e=this.getLength(),a=this.$foldData,r=0;r<a.length;r++)e-=(t=a[r]).end.row-t.start.row;return this.lineWidgets&&(e+=this.$getWidgetScreenLength()),e},this.$setFontMetrics=function(s){this.$enableVarChar&&(this.$getStringScreenWidth=function(e,t,i){if(0===t)return[0,0];var n,r;for(t=t||1/0,i=i||0,r=0;r<e.length&&!(t<(i+="\t"===(n=e.charAt(r))?this.getScreenTabSize(i):s.getCharacterWidth(n)));r++);return[i,r]})},this.destroy=function(){this.bgTokenizer&&(this.bgTokenizer.setDocument(null),this.bgTokenizer=null),this.$stopWorker(),this.removeAllListeners(),this.selection.detach()},this.isFullWidth=a}.call(n.prototype),e("./edit_session/folding").Folding.call(n.prototype),e("./edit_session/bracket_match").BracketMatch.call(n.prototype),l.defineOptions(n.prototype,"session",{wrap:{set:function(e){e&&"off"!=e?"free"==e?e=!0:"printMargin"==e?e=-1:"string"==typeof e&&(e=parseInt(e,10)||!1):e=!1,this.$wrap!=e&&((this.$wrap=e)?(this.setWrapLimitRange(e="number"==typeof e?e:null,e),this.setUseWrapMode(!0)):this.setUseWrapMode(!1))},get:function(){return this.getUseWrapMode()?-1==this.$wrap?"printMargin":this.getWrapLimitRange().min?this.$wrap:"free":"off"},handlesSet:!0},wrapMethod:{set:function(e){(e="auto"==e?"text"!=this.$mode.type:"text"!=e)!=this.$wrapAsCode&&(this.$wrapAsCode=e,this.$useWrapMode)&&(this.$useWrapMode=!1,this.setUseWrapMode(!0))},initialValue:"auto"},indentedSoftWrap:{set:function(){this.$useWrapMode&&(this.$useWrapMode=!1,this.setUseWrapMode(!0))},initialValue:!0},firstLineNumber:{set:function(){this._signal("changeBreakpoint")},initialValue:1},useWorker:{set:function(e){this.$useWorker=e,this.$stopWorker(),e&&this.$startWorker()},initialValue:!0},useSoftTabs:{initialValue:!0},tabSize:{set:function(e){0<(e=parseInt(e))&&this.$tabSize!==e&&(this.$modified=!0,this.$rowLengthCache=[],this.$tabSize=e,this._signal("changeTabSize"))},initialValue:4,handlesSet:!0},navigateWithinSoftTabs:{initialValue:!1},foldStyle:{set:function(e){this.setFoldStyle(e)},handlesSet:!0},overwrite:{set:function(e){this._signal("changeOverwrite")},initialValue:!1},newLineMode:{set:function(e){this.doc.setNewLineMode(e)},get:function(){return this.doc.getNewLineMode()},handlesSet:!0},mode:{set:function(e){this.setMode(e)},get:function(){return this.$modeId},handlesSet:!0}}),t.EditSession=n}),ace.define("ace/search",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],function(e,t,i){"use strict";function n(){this.$options={}}var y=e("./lib/lang"),r=e("./lib/oop"),b=e("./range").Range;(function(){this.set=function(e){return r.mixin(this.$options,e),this},this.getOptions=function(){return y.copyObject(this.$options)},this.setOptions=function(e){this.$options=e},this.find=function(e){var r,s=this.$options,e=this.$matchIterator(e,s);return!!e&&(r=null,e.forEach(function(e,t,i,n){return r=new b(e,t,i,n),!(t==n&&s.start&&s.start.start&&0!=s.skipCurrent&&r.isEqual(s.start)&&(r=null,1))}),r)},this.findAll=function(e){var t=this.$options;if(!t.needle)return[];this.$assembleRegExp(t);var i=t.range,n=i?e.getLines(i.start.row,i.end.row):e.doc.getAllLines(),r=[],s=t.re;if(t.$isMultiLine){var o,a=s.length,l=n.length-a;e:for(var h=s.offset||0;h<=l;h++){for(var c=0;c<a;c++)if(-1==n[h+c].search(s[c]))continue e;var d=n[h],u=n[h+a-1],d=d.length-d.match(s[0])[0].length,u=u.match(s[a-1])[0].length;o&&o.end.row===h&&o.end.column>d||(r.push(o=new b(h,d,h+a-1,u)),2<a&&(h=h+a-2))}}else for(var p=0;p<n.length;p++)for(var m=y.getMatchOffsets(n[p],s),c=0;c<m.length;c++){var g=m[c];r.push(new b(p,g.offset,p,g.offset+g.length))}if(i){for(var f=i.start.column,v=i.start.column,p=0,c=r.length-1;p<c&&r[p].start.column<f&&r[p].start.row==i.start.row;)p++;for(;p<c&&r[c].end.column>v&&r[c].end.row==i.end.row;)c--;for(r=r.slice(p,c+1),p=0,c=r.length;p<c;p++)r[p].start.row+=i.start.row,r[p].end.row+=i.start.row}return r},this.replace=function(e,t){var i=this.$options,n=this.$assembleRegExp(i);if(i.$isMultiLine)return t;if(n){var r=n.exec(e);if(!r||r[0].length!=e.length)return null;if(t=e.replace(n,t),i.preserveCase){t=t.split("");for(var s=Math.min(e.length,e.length);s--;){var o=e[s];o&&o.toLowerCase()!=o?t[s]=t[s].toUpperCase():t[s]=t[s].toLowerCase()}t=t.join("")}return t}},this.$assembleRegExp=function(e,t){if(e.needle instanceof RegExp)return e.re=e.needle;var i,n=e.needle;if(!e.needle)return e.re=!1;function r(e){return/\w/.test(e)||i.regExp?"\\b":""}e.regExp||(n=y.escapeRegExp(n)),e.wholeWord&&(i=e,n=r((s=n)[0])+s+r(s[s.length-1]));var s=e.caseSensitive?"gm":"gmi";if(e.$isMultiLine=!t&&/[\n\r]/.test(n),e.$isMultiLine)return e.re=this.$assembleMultilineRegExp(n,s);try{var o=new RegExp(n,s)}catch(e){o=!1}return e.re=o},this.$assembleMultilineRegExp=function(e,t){for(var i=e.replace(/\r\n|\r|\n/g,"$\n^").split("\n"),n=[],r=0;r<i.length;r++)try{n.push(new RegExp(i[r],t))}catch(e){return!1}return n},this.$matchIterator=function(c,i){var a,e,t,n,r,s,l,o,d=this.$assembleRegExp(i);return!!d&&(a=1==i.backwards,e=0!=i.skipCurrent,t=i.range,(n=(n=i.start)||(t?t[a?"end":"start"]:c.selection.getRange())).start&&(n=n[e!=a?"end":"start"]),r=t?t.start.row:0,s=t?t.end.row:c.getLength()-1,o=i.$isMultiLine?(l=d.length,function(e,t,i){var n=a?e-l+1:e;if(!(n<0)){var r=c.getLine(n),e=r.search(d[0]);if(!(!a&&e<t||-1===e)){for(var s=1;s<l;s++)if(-1==(r=c.getLine(n+s)).search(d[s]))return;var o=r.match(d[l-1])[0].length;if(!(a&&t<o))return!!i(n,e,n+l-1,o)||void 0}}}):a?function(e,t,i){var n,r=c.getLine(e),s=[];for(d.lastIndex=0;n=d.exec(r);){var o=n[0].length,a=n.index;if(!o){if(a>=r.length)break;d.lastIndex=a+=1}if(n.index+o>t)break;s.push(n.index,o)}for(var l=s.length-1;0<=l;l-=2){var h=s[l-1];if(i(e,h,e,h+(o=s[l])))return!0}}:function(e,t,i){var n=c.getLine(e);for(d.lastIndex=t;r=d.exec(n);){var r,s=r[0].length;if(i(e,r=r.index,e,r+s))return!0;if(!s&&(d.lastIndex=r+=1,r>=n.length))return!1}},{forEach:a?function(e){var t=n.row;if(!o(t,n.column,e)){for(t--;r<=t;t--)if(o(t,Number.MAX_VALUE,e))return;if(0!=i.wrap)for(t=s,r=n.row;r<=t;t--)if(o(t,Number.MAX_VALUE,e))return}}:function(e){var t=n.row;if(!o(t,n.column,e)){for(t+=1;t<=s;t++)if(o(t,0,e))return;if(0!=i.wrap)for(t=r,s=n.row;t<=s;t++)if(o(t,0,e))return}}})}}).call(n.prototype),t.Search=n}),ace.define("ace/keyboard/hash_handler",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(e,t,i){"use strict";function n(e,t){this.platform=t||(s.isMac?"mac":"win"),this.commands={},this.commandKeyBinding={},this.addCommands(e),this.$singleCommand=!0}function r(e,t){n.call(this,e,t),this.$singleCommand=!1}var a=e("../lib/keys"),s=e("../lib/useragent"),l=a.KEY_MODS;r.prototype=n.prototype,function(){function o(e){return"object"==typeof e&&e.bindKey&&e.bindKey.position||(e.isDefault?-100:0)}this.addCommand=function(e){this.commands[e.name]&&this.removeCommand(e),(this.commands[e.name]=e).bindKey&&this._buildKeyHash(e)},this.removeCommand=function(e,t){var i,n=e&&("string"==typeof e?e:e.name),r=(e=this.commands[n],t||delete this.commands[n],this.commandKeyBinding);for(i in r){var s,o=r[i];o==e?delete r[i]:Array.isArray(o)&&-1!=(s=o.indexOf(e))&&(o.splice(s,1),1==o.length)&&(r[i]=o[0])}},this.bindKey=function(e,n,r){if("object"==typeof e&&e&&(null==r&&(r=e.position),e=e[this.platform]),e)return"function"==typeof n?this.addCommand({exec:n,bindKey:e,name:n.name||e}):void e.split("|").forEach(function(e){var t="",i=(-1!=e.indexOf(" ")&&(e=(i=e.split(/\s+/)).pop(),i.forEach(function(e){e=this.parseKeys(e),e=l[e.hashId]+e.key;t+=(t?" ":"")+e,this._addCommandToBinding(t,"chainKeys")},this),t+=" "),this.parseKeys(e)),e=l[i.hashId]+i.key;this._addCommandToBinding(t+e,n,r)},this)},this._addCommandToBinding=function(e,t,i){var n=this.commandKeyBinding;if(t)if(!n[e]||this.$singleCommand)n[e]=t;else{Array.isArray(n[e])?-1!=(s=n[e].indexOf(t))&&n[e].splice(s,1):n[e]=[n[e]],"number"!=typeof i&&(i=o(t));for(var r=n[e],s=0;s<r.length;s++)if(i<o(r[s]))break;r.splice(s,0,t)}else delete n[e]},this.addCommands=function(i){i&&Object.keys(i).forEach(function(e){var t=i[e];if(t){if("string"==typeof t)return this.bindKey(t,e);"object"==typeof(t="function"==typeof t?{exec:t}:t)&&(t.name||(t.name=e),this.addCommand(t))}},this)},this.removeCommands=function(t){Object.keys(t).forEach(function(e){this.removeCommand(t[e])},this)},this.bindKeys=function(t){Object.keys(t).forEach(function(e){this.bindKey(e,t[e])},this)},this._buildKeyHash=function(e){this.bindKey(e.bindKey,e)},this.parseKeys=function(e){var t=e.toLowerCase().split(/[\-\+]([\-\+])?/).filter(function(e){return e}),i=t.pop(),n=a[i];if(a.FUNCTION_KEYS[n])i=a.FUNCTION_KEYS[n].toLowerCase();else{if(!t.length)return{key:i,hashId:-1};if(1==t.length&&"shift"==t[0])return{key:i.toUpperCase(),hashId:-1}}for(var r=0,s=t.length;s--;){var o=a.KEY_MODS[t[s]];if(null==o)return"undefined"!=typeof console&&console.error("invalid modifier "+t[s]+" in "+e),!1;r|=o}return{key:i,hashId:r}},this.findKeyCommand=function(e,t){e=l[e]+t;return this.commandKeyBinding[e]},this.handleKeyboard=function(e,t,i,n){var r,s;if(!(n<0))return r=l[t]+i,s=this.commandKeyBinding[r],e.$keyChain&&(e.$keyChain+=" "+r,s=this.commandKeyBinding[e.$keyChain]||s),!s||"chainKeys"!=s&&"chainKeys"!=s[s.length-1]?(e.$keyChain&&(t&&4!=t||1!=i.length?(-1==t||0<n)&&(e.$keyChain=""):e.$keyChain=e.$keyChain.slice(0,-r.length-1)),{command:s}):(e.$keyChain=e.$keyChain||r,{command:"null"})},this.getStatusText=function(e,t){return t.$keyChain||""}}.call(n.prototype),t.HashHandler=n,t.MultiHashHandler=r}),ace.define("ace/commands/command_manager",["require","exports","module","ace/lib/oop","ace/keyboard/hash_handler","ace/lib/event_emitter"],function(e,t,i){"use strict";function n(e,t){s.call(this,t,e),this.byName=this.commands,this.setDefaultHandler("exec",function(e){return e.command.exec(e.editor,e.args||{})})}var r=e("../lib/oop"),s=e("../keyboard/hash_handler").MultiHashHandler,o=e("../lib/event_emitter").EventEmitter;r.inherits(n,s),function(){r.implement(this,o),this.exec=function(e,t,i){if(Array.isArray(e)){for(var n=e.length;n--;)if(this.exec(e[n],t,i))return!0;return!1}var r;return!!(e="string"==typeof e?this.commands[e]:e)&&!(t&&t.$readOnly&&!e.readOnly||0!=this.$checkCommandState&&e.isAvailable&&!e.isAvailable(t)||((r={editor:t,command:e,args:i}).returnValue=this._emit("exec",r),this._signal("afterExec",r),!1===r.returnValue))},this.toggleRecording=function(e){if(!this.$inReplay)return e&&e._emit("changeStatus"),this.recording?(this.macro.pop(),this.off("exec",this.$addCommandToMacro),this.macro.length||(this.macro=this.oldMacro),this.recording=!1):(this.$addCommandToMacro||(this.$addCommandToMacro=function(e){this.macro.push([e.command,e.args])}.bind(this)),this.oldMacro=this.macro,this.macro=[],this.on("exec",this.$addCommandToMacro),this.recording=!0)},this.replay=function(t){if(!this.$inReplay&&this.macro){if(this.recording)return this.toggleRecording(t);try{this.$inReplay=!0,this.macro.forEach(function(e){"string"==typeof e?this.exec(e,t):this.exec(e[0],t,e[1])},this)}finally{this.$inReplay=!1}}},this.trimMacro=function(e){return e.map(function(e){return"string"!=typeof e[0]&&(e[0]=e[0].name),e=e[1]?e:e[0]})}}.call(n.prototype),t.CommandManager=n}),ace.define("ace/commands/default_commands",["require","exports","module","ace/lib/lang","ace/config","ace/range"],function(e,t,i){"use strict";function n(e,t){return{win:e,mac:t}}var l=e("../lib/lang"),r=e("../config"),h=e("../range").Range;t.commands=[{name:"showSettingsMenu",bindKey:n("Ctrl-,","Command-,"),exec:function(t){r.loadModule("ace/ext/settings_menu",function(e){e.init(t),t.showSettingsMenu()})},readOnly:!0},{name:"goToNextError",bindKey:n("Alt-E","F4"),exec:function(t){r.loadModule("./ext/error_marker",function(e){e.showErrorMarker(t,1)})},scrollIntoView:"animate",readOnly:!0},{name:"goToPreviousError",bindKey:n("Alt-Shift-E","Shift-F4"),exec:function(t){r.loadModule("./ext/error_marker",function(e){e.showErrorMarker(t,-1)})},scrollIntoView:"animate",readOnly:!0},{name:"selectall",description:"Select all",bindKey:n("Ctrl-A","Command-A"),exec:function(e){e.selectAll()},readOnly:!0},{name:"centerselection",description:"Center selection",bindKey:n(null,"Ctrl-L"),exec:function(e){e.centerSelection()},readOnly:!0},{name:"gotoline",description:"Go to line...",bindKey:n("Ctrl-L","Command-L"),exec:function(e,t){"number"!=typeof t||isNaN(t)||e.gotoLine(t),e.prompt({$type:"gotoLine"})},readOnly:!0},{name:"fold",bindKey:n("Alt-L|Ctrl-F1","Command-Alt-L|Command-F1"),exec:function(e){e.session.toggleFold(!1)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"unfold",bindKey:n("Alt-Shift-L|Ctrl-Shift-F1","Command-Alt-Shift-L|Command-Shift-F1"),exec:function(e){e.session.toggleFold(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleFoldWidget",bindKey:n("F2","F2"),exec:function(e){e.session.toggleFoldWidget()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleParentFoldWidget",bindKey:n("Alt-F2","Alt-F2"),exec:function(e){e.session.toggleFoldWidget(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"foldall",description:"Fold all",bindKey:n(null,"Ctrl-Command-Option-0"),exec:function(e){e.session.foldAll()},scrollIntoView:"center",readOnly:!0},{name:"foldAllComments",description:"Fold all comments",bindKey:n(null,"Ctrl-Command-Option-0"),exec:function(e){e.session.foldAllComments()},scrollIntoView:"center",readOnly:!0},{name:"foldOther",description:"Fold other",bindKey:n("Alt-0","Command-Option-0"),exec:function(e){e.session.foldAll(),e.session.unfold(e.selection.getAllRanges())},scrollIntoView:"center",readOnly:!0},{name:"unfoldall",description:"Unfold all",bindKey:n("Alt-Shift-0","Command-Option-Shift-0"),exec:function(e){e.session.unfold()},scrollIntoView:"center",readOnly:!0},{name:"findnext",description:"Find next",bindKey:n("Ctrl-K","Command-G"),exec:function(e){e.findNext()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"findprevious",description:"Find previous",bindKey:n("Ctrl-Shift-K","Command-Shift-G"),exec:function(e){e.findPrevious()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"selectOrFindNext",description:"Select or find next",bindKey:n("Alt-K","Ctrl-G"),exec:function(e){e.selection.isEmpty()?e.selection.selectWord():e.findNext()},readOnly:!0},{name:"selectOrFindPrevious",description:"Select or find previous",bindKey:n("Alt-Shift-K","Ctrl-Shift-G"),exec:function(e){e.selection.isEmpty()?e.selection.selectWord():e.findPrevious()},readOnly:!0},{name:"find",description:"Find",bindKey:n("Ctrl-F","Command-F"),exec:function(t){r.loadModule("ace/ext/searchbox",function(e){e.Search(t)})},readOnly:!0},{name:"overwrite",description:"Overwrite",bindKey:"Insert",exec:function(e){e.toggleOverwrite()},readOnly:!0},{name:"selecttostart",description:"Select to start",bindKey:n("Ctrl-Shift-Home","Command-Shift-Home|Command-Shift-Up"),exec:function(e){e.getSelection().selectFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotostart",description:"Go to start",bindKey:n("Ctrl-Home","Command-Home|Command-Up"),exec:function(e){e.navigateFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectup",description:"Select up",bindKey:n("Shift-Up","Shift-Up|Ctrl-Shift-P"),exec:function(e){e.getSelection().selectUp()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golineup",description:"Go line up",bindKey:n("Up","Up|Ctrl-P"),exec:function(e,t){e.navigateUp(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttoend",description:"Select to end",bindKey:n("Ctrl-Shift-End","Command-Shift-End|Command-Shift-Down"),exec:function(e){e.getSelection().selectFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotoend",description:"Go to end",bindKey:n("Ctrl-End","Command-End|Command-Down"),exec:function(e){e.navigateFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectdown",description:"Select down",bindKey:n("Shift-Down","Shift-Down|Ctrl-Shift-N"),exec:function(e){e.getSelection().selectDown()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golinedown",description:"Go line down",bindKey:n("Down","Down|Ctrl-N"),exec:function(e,t){e.navigateDown(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordleft",description:"Select word left",bindKey:n("Ctrl-Shift-Left","Option-Shift-Left"),exec:function(e){e.getSelection().selectWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordleft",description:"Go to word left",bindKey:n("Ctrl-Left","Option-Left"),exec:function(e){e.navigateWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolinestart",description:"Select to line start",bindKey:n("Alt-Shift-Left","Command-Shift-Left|Ctrl-Shift-A"),exec:function(e){e.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolinestart",description:"Go to line start",bindKey:n("Alt-Left|Home","Command-Left|Home|Ctrl-A"),exec:function(e){e.navigateLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectleft",description:"Select left",bindKey:n("Shift-Left","Shift-Left|Ctrl-Shift-B"),exec:function(e){e.getSelection().selectLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoleft",description:"Go to left",bindKey:n("Left","Left|Ctrl-B"),exec:function(e,t){e.navigateLeft(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordright",description:"Select word right",bindKey:n("Ctrl-Shift-Right","Option-Shift-Right"),exec:function(e){e.getSelection().selectWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordright",description:"Go to word right",bindKey:n("Ctrl-Right","Option-Right"),exec:function(e){e.navigateWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolineend",description:"Select to line end",bindKey:n("Alt-Shift-Right","Command-Shift-Right|Shift-End|Ctrl-Shift-E"),exec:function(e){e.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolineend",description:"Go to line end",bindKey:n("Alt-Right|End","Command-Right|End|Ctrl-E"),exec:function(e){e.navigateLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectright",description:"Select right",bindKey:n("Shift-Right","Shift-Right"),exec:function(e){e.getSelection().selectRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoright",description:"Go to right",bindKey:n("Right","Right|Ctrl-F"),exec:function(e,t){e.navigateRight(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectpagedown",description:"Select page down",bindKey:"Shift-PageDown",exec:function(e){e.selectPageDown()},readOnly:!0},{name:"pagedown",description:"Page down",bindKey:n(null,"Option-PageDown"),exec:function(e){e.scrollPageDown()},readOnly:!0},{name:"gotopagedown",description:"Go to page down",bindKey:n("PageDown","PageDown|Ctrl-V"),exec:function(e){e.gotoPageDown()},readOnly:!0},{name:"selectpageup",description:"Select page up",bindKey:"Shift-PageUp",exec:function(e){e.selectPageUp()},readOnly:!0},{name:"pageup",description:"Page up",bindKey:n(null,"Option-PageUp"),exec:function(e){e.scrollPageUp()},readOnly:!0},{name:"gotopageup",description:"Go to page up",bindKey:"PageUp",exec:function(e){e.gotoPageUp()},readOnly:!0},{name:"scrollup",description:"Scroll up",bindKey:n("Ctrl-Up",null),exec:function(e){e.renderer.scrollBy(0,-2*e.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"scrolldown",description:"Scroll down",bindKey:n("Ctrl-Down",null),exec:function(e){e.renderer.scrollBy(0,2*e.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"selectlinestart",description:"Select line start",bindKey:"Shift-Home",exec:function(e){e.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectlineend",description:"Select line end",bindKey:"Shift-End",exec:function(e){e.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"togglerecording",description:"Toggle recording",bindKey:n("Ctrl-Alt-E","Command-Option-E"),exec:function(e){e.commands.toggleRecording(e)},readOnly:!0},{name:"replaymacro",description:"Replay macro",bindKey:n("Ctrl-Shift-E","Command-Shift-E"),exec:function(e){e.commands.replay(e)},readOnly:!0},{name:"jumptomatching",description:"Jump to matching",bindKey:n("Ctrl-\\|Ctrl-P","Command-\\"),exec:function(e){e.jumpToMatching()},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"selecttomatching",description:"Select to matching",bindKey:n("Ctrl-Shift-\\|Ctrl-Shift-P","Command-Shift-\\"),exec:function(e){e.jumpToMatching(!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"expandToMatching",description:"Expand to matching",bindKey:n("Ctrl-Shift-M","Ctrl-Shift-M"),exec:function(e){e.jumpToMatching(!0,!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"passKeysToBrowser",description:"Pass keys to browser",bindKey:n(null,null),exec:function(){},passEvent:!0,readOnly:!0},{name:"copy",description:"Copy",exec:function(e){},readOnly:!0},{name:"cut",description:"Cut",exec:function(e){var t=e.$copyWithEmptySelection&&e.selection.isEmpty()?e.selection.getLineRange():e.selection.getRange();e._emit("cut",t),t.isEmpty()||e.session.remove(t),e.clearSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"paste",description:"Paste",exec:function(e,t){e.$handlePaste(t)},scrollIntoView:"cursor"},{name:"removeline",description:"Remove line",bindKey:n("Ctrl-D","Command-D"),exec:function(e){e.removeLines()},scrollIntoView:"cursor",multiSelectAction:"forEachLine"},{name:"duplicateSelection",description:"Duplicate selection",bindKey:n("Ctrl-Shift-D","Command-Shift-D"),exec:function(e){e.duplicateSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"sortlines",description:"Sort lines",bindKey:n("Ctrl-Alt-S","Command-Alt-S"),exec:function(e){e.sortLines()},scrollIntoView:"selection",multiSelectAction:"forEachLine"},{name:"togglecomment",description:"Toggle comment",bindKey:n("Ctrl-/","Command-/"),exec:function(e){e.toggleCommentLines()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"toggleBlockComment",description:"Toggle block comment",bindKey:n("Ctrl-Shift-/","Command-Shift-/"),exec:function(e){e.toggleBlockComment()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"modifyNumberUp",description:"Modify number up",bindKey:n("Ctrl-Shift-Up","Alt-Shift-Up"),exec:function(e){e.modifyNumber(1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"modifyNumberDown",description:"Modify number down",bindKey:n("Ctrl-Shift-Down","Alt-Shift-Down"),exec:function(e){e.modifyNumber(-1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"replace",description:"Replace",bindKey:n("Ctrl-H","Command-Option-F"),exec:function(t){r.loadModule("ace/ext/searchbox",function(e){e.Search(t,!0)})}},{name:"undo",description:"Undo",bindKey:n("Ctrl-Z","Command-Z"),exec:function(e){e.undo()}},{name:"redo",description:"Redo",bindKey:n("Ctrl-Shift-Z|Ctrl-Y","Command-Shift-Z|Command-Y"),exec:function(e){e.redo()}},{name:"copylinesup",description:"Copy lines up",bindKey:n("Alt-Shift-Up","Command-Option-Up"),exec:function(e){e.copyLinesUp()},scrollIntoView:"cursor"},{name:"movelinesup",description:"Move lines up",bindKey:n("Alt-Up","Option-Up"),exec:function(e){e.moveLinesUp()},scrollIntoView:"cursor"},{name:"copylinesdown",description:"Copy lines down",bindKey:n("Alt-Shift-Down","Command-Option-Down"),exec:function(e){e.copyLinesDown()},scrollIntoView:"cursor"},{name:"movelinesdown",description:"Move lines down",bindKey:n("Alt-Down","Option-Down"),exec:function(e){e.moveLinesDown()},scrollIntoView:"cursor"},{name:"del",description:"Delete",bindKey:n("Delete","Delete|Ctrl-D|Shift-Delete"),exec:function(e){e.remove("right")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"backspace",description:"Backspace",bindKey:n("Shift-Backspace|Backspace","Ctrl-Backspace|Shift-Backspace|Backspace|Ctrl-H"),exec:function(e){e.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"cut_or_delete",description:"Cut or delete",bindKey:n("Shift-Delete",null),exec:function(e){if(!e.selection.isEmpty())return!1;e.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestart",description:"Remove to line start",bindKey:n("Alt-Backspace","Command-Backspace"),exec:function(e){e.removeToLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineend",description:"Remove to line end",bindKey:n("Alt-Delete","Ctrl-K|Command-Delete"),exec:function(e){e.removeToLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestarthard",description:"Remove to line start hard",bindKey:n("Ctrl-Shift-Backspace",null),exec:function(e){var t=e.selection.getRange();t.start.column=0,e.session.remove(t)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineendhard",description:"Remove to line end hard",bindKey:n("Ctrl-Shift-Delete",null),exec:function(e){var t=e.selection.getRange();t.end.column=Number.MAX_VALUE,e.session.remove(t)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordleft",description:"Remove word left",bindKey:n("Ctrl-Backspace","Alt-Backspace|Ctrl-Alt-Backspace"),exec:function(e){e.removeWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordright",description:"Remove word right",bindKey:n("Ctrl-Delete","Alt-Delete"),exec:function(e){e.removeWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"outdent",description:"Outdent",bindKey:n("Shift-Tab","Shift-Tab"),exec:function(e){e.blockOutdent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"indent",description:"Indent",bindKey:n("Tab","Tab"),exec:function(e){e.indent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"blockoutdent",description:"Block outdent",bindKey:n("Ctrl-[","Ctrl-["),exec:function(e){e.blockOutdent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"blockindent",description:"Block indent",bindKey:n("Ctrl-]","Ctrl-]"),exec:function(e){e.blockIndent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"insertstring",description:"Insert string",exec:function(e,t){e.insert(t)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"inserttext",description:"Insert text",exec:function(e,t){e.insert(l.stringRepeat(t.text||"",t.times||1))},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"splitline",description:"Split line",bindKey:n(null,"Ctrl-O"),exec:function(e){e.splitLine()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"transposeletters",description:"Transpose letters",bindKey:n("Alt-Shift-X","Ctrl-T"),exec:function(e){e.transposeLetters()},multiSelectAction:function(e){e.transposeSelections(1)},scrollIntoView:"cursor"},{name:"touppercase",description:"To uppercase",bindKey:n("Ctrl-U","Ctrl-U"),exec:function(e){e.toUpperCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"tolowercase",description:"To lowercase",bindKey:n("Ctrl-Shift-U","Ctrl-Shift-U"),exec:function(e){e.toLowerCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"autoindent",description:"Auto Indent",bindKey:n(null,null),exec:function(e){e.autoIndent()},multiSelectAction:"forEachLine",scrollIntoView:"animate"},{name:"expandtoline",description:"Expand to line",bindKey:n("Ctrl-Shift-L","Command-Shift-L"),exec:function(e){var t=e.selection.getRange();t.start.column=t.end.column=0,t.end.row++,e.selection.setRange(t,!1)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"joinlines",description:"Join lines",bindKey:n(null,null),exec:function(e){for(var t=e.selection.isBackwards(),i=t?e.selection.getSelectionLead():e.selection.getSelectionAnchor(),n=t?e.selection.getSelectionAnchor():e.selection.getSelectionLead(),t=e.session.doc.getLine(i.row).length,r=e.session.doc.getTextRange(e.selection.getRange()).replace(/\n\s*/," ").length,s=e.session.doc.getLine(i.row),o=i.row+1;o<=n.row+1;o++){var a=l.stringTrimLeft(l.stringTrimRight(e.session.doc.getLine(o)));s+=a=0!==a.length?" "+a:a}n.row+1<e.session.doc.getLength()-1&&(s+=e.session.doc.getNewLineCharacter()),e.clearSelection(),e.session.doc.replace(new h(i.row,0,n.row+2,0),s),0<r?(e.selection.moveCursorTo(i.row,i.column),e.selection.selectTo(i.row,i.column+r)):(t=e.session.doc.getLine(i.row).length>t?t+1:t,e.selection.moveCursorTo(i.row,t))},multiSelectAction:"forEach",readOnly:!0},{name:"invertSelection",description:"Invert selection",bindKey:n(null,null),exec:function(e){var t=e.session.doc.getLength()-1,i=e.session.doc.getLine(t).length,n=e.selection.rangeList.ranges,r=[];n.length<1&&(n=[e.selection.getRange()]);for(var s=0;s<n.length;s++)s!=n.length-1||n[s].end.row===t&&n[s].end.column===i||r.push(new h(n[s].end.row,n[s].end.column,t,i)),0===s?0===n[s].start.row&&0===n[s].start.column||r.push(new h(0,0,n[s].start.row,n[s].start.column)):r.push(new h(n[s-1].end.row,n[s-1].end.column,n[s].start.row,n[s].start.column));e.exitMultiSelectMode(),e.clearSelection();for(s=0;s<r.length;s++)e.selection.addRange(r[s],!1)},readOnly:!0,scrollIntoView:"none"},{name:"addLineAfter",exec:function(e){e.selection.clearSelection(),e.navigateLineEnd(),e.insert("\n")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"addLineBefore",exec:function(e){e.selection.clearSelection();var t=e.getCursorPosition();e.selection.moveTo(t.row-1,Number.MAX_VALUE),e.insert("\n"),0===t.row&&e.navigateUp()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"openCommandPallete",description:"Open command pallete",bindKey:n("F1","F1"),exec:function(e){e.prompt({$type:"commands"})},readOnly:!0},{name:"modeSelect",description:"Change language mode...",bindKey:n(null,null),exec:function(e){e.prompt({$type:"modes"})},readOnly:!0}];for(var s=1;s<9;s++)t.commands.push({name:"foldToLevel"+s,description:"Fold To Level "+s,level:s,exec:function(e){e.session.foldToLevel(this.level)},scrollIntoView:"center",readOnly:!0})}),ace.define("ace/editor",["require","exports","module","ace/lib/fixoldbrowsers","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/lib/useragent","ace/keyboard/textinput","ace/mouse/mouse_handler","ace/mouse/fold_handler","ace/keyboard/keybinding","ace/edit_session","ace/search","ace/range","ace/lib/event_emitter","ace/commands/command_manager","ace/commands/default_commands","ace/config","ace/token_iterator","ace/clipboard"],function(e,t,i){"use strict";e("./lib/fixoldbrowsers");function r(e,t,i){this.$toDestroy=[];var n=e.getContainerElement();this.container=n,this.renderer=e,this.id="editor"+ ++r.$uid,this.commands=new m(o.isMac?"mac":"win",v),"object"==typeof document&&(this.textInput=new a(e.getTextAreaContainer(),this),this.renderer.textarea=this.textInput.getElement(),this.$mouseHandler=new l(this),new h(this)),this.keyBinding=new c(this),this.$search=(new u).set({wrap:!0}),this.$historyTracker=this.$historyTracker.bind(this),this.commands.on("exec",this.$historyTracker),this.$initOperationListeners(),this._$emitInputEvent=g.delayedCall(function(){this._signal("input",{}),this.session&&this.session.bgTokenizer&&this.session.bgTokenizer.scheduleStart()}.bind(this)),this.on("change",function(e,t){t._$emitInputEvent.schedule(31)}),this.setSession(t||i&&i.session||new d("")),y.resetOptions(this),i&&this.setOptions(i),y._signal("editor",this)}var s=e("./lib/oop"),n=e("./lib/dom"),g=e("./lib/lang"),o=e("./lib/useragent"),a=e("./keyboard/textinput").TextInput,l=e("./mouse/mouse_handler").MouseHandler,h=e("./mouse/fold_handler").FoldHandler,c=e("./keyboard/keybinding").KeyBinding,d=e("./edit_session").EditSession,u=e("./search").Search,f=e("./range").Range,p=e("./lib/event_emitter").EventEmitter,m=e("./commands/command_manager").CommandManager,v=e("./commands/default_commands").commands,y=e("./config"),b=e("./token_iterator").TokenIterator,w=e("./clipboard"),x=(r.$uid=0,function(){s.implement(this,p),this.$initOperationListeners=function(){this.commands.on("exec",this.startOperation.bind(this),!0),this.commands.on("afterExec",this.endOperation.bind(this),!0),this.$opResetTimer=g.delayedCall(this.endOperation.bind(this,!0)),this.on("change",function(){this.curOp||(this.startOperation(),this.curOp.selectionBefore=this.$lastSel),this.curOp.docChanged=!0}.bind(this),!0),this.on("changeSelection",function(){this.curOp||(this.startOperation(),this.curOp.selectionBefore=this.$lastSel),this.curOp.selectionChanged=!0}.bind(this),!0)},this.curOp=null,this.prevOp={},this.startOperation=function(e){if(this.curOp){if(!e||this.curOp.command)return;this.prevOp=this.curOp}e||(this.previousCommand=null,e={}),this.$opResetTimer.schedule(),this.curOp=this.session.curOp={command:e.command||{},args:e.args,scrollTop:this.renderer.scrollTop},this.curOp.selectionBefore=this.selection.toJSON()},this.endOperation=function(e){if(this.curOp&&this.session){if(e&&!1===e.returnValue||!this.session)return this.curOp=null;if((1!=e||!this.curOp.command||"mouse"!=this.curOp.command.name)&&(this._signal("beforeEndOperation"),this.curOp)){var e=this.curOp.command,t=e&&e.scrollIntoView;if(t){switch(t){case"center-animate":t="animate";case"center":this.renderer.scrollCursorIntoView(null,.5);break;case"animate":case"cursor":this.renderer.scrollCursorIntoView();break;case"selectionPart":var i=this.selection.getRange(),n=this.renderer.layerConfig;(i.start.row>=n.lastRow||i.end.row<=n.firstRow)&&this.renderer.scrollSelectionIntoView(this.selection.anchor,this.selection.lead)}"animate"==t&&this.renderer.animateScrolling(this.curOp.scrollTop)}e=this.selection.toJSON();this.curOp.selectionAfter=e,this.$lastSel=this.selection.toJSON(),this.session.getUndoManager().addSelection(e),this.prevOp=this.curOp,this.curOp=null}}},this.$mergeableCommands=["backspace","del","insertstring"],this.$historyTracker=function(e){var t,i,n,r;this.$mergeUndoDeltas&&(t=this.prevOp,i=this.$mergeableCommands,n=t.command&&e.command.name==t.command.name,"insertstring"==e.command.name?(r=e.args,void 0===this.mergeNextCommand&&(this.mergeNextCommand=!0),n=n&&this.mergeNextCommand&&(!/\s/.test(r)||/\s/.test(t.args)),this.mergeNextCommand=!0):n=n&&-1!==i.indexOf(e.command.name),(n="always"!=this.$mergeUndoDeltas&&2e3<Date.now()-this.sequenceStartTime?!1:n)?this.session.mergeUndoDeltas=!0:-1!==i.indexOf(e.command.name)&&(this.sequenceStartTime=Date.now()))},this.setKeyboardHandler=function(t,i){var n;t&&"string"==typeof t&&"ace"!=t?(this.$keybindingId=t,n=this,y.loadModule(["keybinding",t],function(e){n.$keybindingId==t&&n.keyBinding.setKeyboardHandler(e&&e.handler),i&&i()})):(this.$keybindingId=null,this.keyBinding.setKeyboardHandler(t),i&&i())},this.getKeyboardHandler=function(){return this.keyBinding.getKeyboardHandler()},this.setSession=function(e){var t,i;this.session!=e&&(this.curOp&&this.endOperation(),this.curOp={},(t=this.session)&&(this.session.off("change",this.$onDocumentChange),this.session.off("changeMode",this.$onChangeMode),this.session.off("tokenizerUpdate",this.$onTokenizerUpdate),this.session.off("changeTabSize",this.$onChangeTabSize),this.session.off("changeWrapLimit",this.$onChangeWrapLimit),this.session.off("changeWrapMode",this.$onChangeWrapMode),this.session.off("changeFold",this.$onChangeFold),this.session.off("changeFrontMarker",this.$onChangeFrontMarker),this.session.off("changeBackMarker",this.$onChangeBackMarker),this.session.off("changeBreakpoint",this.$onChangeBreakpoint),this.session.off("changeAnnotation",this.$onChangeAnnotation),this.session.off("changeOverwrite",this.$onCursorChange),this.session.off("changeScrollTop",this.$onScrollTopChange),this.session.off("changeScrollLeft",this.$onScrollLeftChange),(i=this.session.getSelection()).off("changeCursor",this.$onCursorChange),i.off("changeSelection",this.$onSelectionChange)),(this.session=e)?(this.$onDocumentChange=this.onDocumentChange.bind(this),e.on("change",this.$onDocumentChange),this.renderer.setSession(e),this.$onChangeMode=this.onChangeMode.bind(this),e.on("changeMode",this.$onChangeMode),this.$onTokenizerUpdate=this.onTokenizerUpdate.bind(this),e.on("tokenizerUpdate",this.$onTokenizerUpdate),this.$onChangeTabSize=this.renderer.onChangeTabSize.bind(this.renderer),e.on("changeTabSize",this.$onChangeTabSize),this.$onChangeWrapLimit=this.onChangeWrapLimit.bind(this),e.on("changeWrapLimit",this.$onChangeWrapLimit),this.$onChangeWrapMode=this.onChangeWrapMode.bind(this),e.on("changeWrapMode",this.$onChangeWrapMode),this.$onChangeFold=this.onChangeFold.bind(this),e.on("changeFold",this.$onChangeFold),this.$onChangeFrontMarker=this.onChangeFrontMarker.bind(this),this.session.on("changeFrontMarker",this.$onChangeFrontMarker),this.$onChangeBackMarker=this.onChangeBackMarker.bind(this),this.session.on("changeBackMarker",this.$onChangeBackMarker),this.$onChangeBreakpoint=this.onChangeBreakpoint.bind(this),this.session.on("changeBreakpoint",this.$onChangeBreakpoint),this.$onChangeAnnotation=this.onChangeAnnotation.bind(this),this.session.on("changeAnnotation",this.$onChangeAnnotation),this.$onCursorChange=this.onCursorChange.bind(this),this.session.on("changeOverwrite",this.$onCursorChange),this.$onScrollTopChange=this.onScrollTopChange.bind(this),this.session.on("changeScrollTop",this.$onScrollTopChange),this.$onScrollLeftChange=this.onScrollLeftChange.bind(this),this.session.on("changeScrollLeft",this.$onScrollLeftChange),this.selection=e.getSelection(),this.selection.on("changeCursor",this.$onCursorChange),this.$onSelectionChange=this.onSelectionChange.bind(this),this.selection.on("changeSelection",this.$onSelectionChange),this.onChangeMode(),this.onCursorChange(),this.onScrollTopChange(),this.onScrollLeftChange(),this.onSelectionChange(),this.onChangeFrontMarker(),this.onChangeBackMarker(),this.onChangeBreakpoint(),this.onChangeAnnotation(),this.session.getUseWrapMode()&&this.renderer.adjustWrapLimit(),this.renderer.updateFull()):(this.selection=null,this.renderer.setSession(e)),this._signal("changeSession",{session:e,oldSession:t}),this.curOp=null,t&&t._signal("changeEditor",{oldEditor:this}),e&&e._signal("changeEditor",{editor:this}),e)&&e.bgTokenizer&&e.bgTokenizer.scheduleStart()},this.getSession=function(){return this.session},this.setValue=function(e,t){return this.session.doc.setValue(e),t?1==t?this.navigateFileEnd():-1==t&&this.navigateFileStart():this.selectAll(),e},this.getValue=function(){return this.session.getValue()},this.getSelection=function(){return this.selection},this.resize=function(e){this.renderer.onResize(e)},this.setTheme=function(e,t){this.renderer.setTheme(e,t)},this.getTheme=function(){return this.renderer.getTheme()},this.setStyle=function(e){this.renderer.setStyle(e)},this.unsetStyle=function(e){this.renderer.unsetStyle(e)},this.getFontSize=function(){return this.getOption("fontSize")||n.computedStyle(this.container).fontSize},this.setFontSize=function(e){this.setOption("fontSize",e)},this.$highlightBrackets=function(){var n;this.$highlightPending||((n=this).$highlightPending=!0,setTimeout(function(){n.$highlightPending=!1;var e,t,i=n.session;i&&i.bgTokenizer&&(i.$bracketHighlight&&(i.$bracketHighlight.markerIds.forEach(function(e){i.removeMarker(e)}),i.$bracketHighlight=null),e=!(e=i.getMatchingBracketRanges(n.getCursorPosition()))&&i.$mode.getMatching?i.$mode.getMatching(n.session):e)&&(t="ace_bracket",Array.isArray(e)?1==e.length&&(t="ace_error_bracket"):e=[e],2==e.length&&(0==f.comparePoints(e[0].end,e[1].start)?e=[f.fromPoints(e[0].start,e[1].end)]:0==f.comparePoints(e[0].start,e[1].end)&&(e=[f.fromPoints(e[1].start,e[0].end)])),i.$bracketHighlight={ranges:e,markerIds:e.map(function(e){return i.addMarker(e,t,"text")})})},50))},this.$highlightTags=function(){var u;this.$highlightTagPending||((u=this).$highlightTagPending=!0,setTimeout(function(){u.$highlightTagPending=!1;var e=u.session;if(e&&e.bgTokenizer){var t=u.getCursorPosition(),i=new b(u.session,t.row,t.column),n=i.getCurrentToken();if(n&&/\b(?:tag-open|tag-name)/.test(n.type)){if(-1===n.type.indexOf("tag-open")||(n=i.stepForward())){var r,s=n.value,o=n.value,a=0,l=i.stepBackward();if("<"===l.value)for(;l=n,(n=i.stepForward())&&(-1!==n.type.indexOf("tag-name")?s===(o=n.value)&&("<"===l.value?a++:"</"===l.value&&a--):s===o&&"/>"===n.value&&a--),n&&0<=a;);else{do{if(n=l,l=i.stepBackward(),n)if(-1!==n.type.indexOf("tag-name"))s===n.value&&("<"===l.value?a++:"</"===l.value&&a--);else if("/>"===n.value){for(var h=0,c=l;c;){if(-1!==c.type.indexOf("tag-name")&&c.value===s){a--;break}if("<"===c.value)break;c=i.stepBackward(),h++}for(var d=0;d<h;d++)i.stepForward()}}while(l&&a<=0);i.stepForward()}n?(t=i.getCurrentTokenRow(),r=i.getCurrentTokenColumn(),t=new f(t,r,t,r+n.value.length),r=e.$backMarkers[e.$tagHighlight],e.$tagHighlight&&null!=r&&0!==t.compareRange(r.range)&&(e.removeMarker(e.$tagHighlight),e.$tagHighlight=null),e.$tagHighlight||(e.$tagHighlight=e.addMarker(t,"ace_bracket","text"))):(e.removeMarker(e.$tagHighlight),e.$tagHighlight=null)}}else e.removeMarker(e.$tagHighlight),e.$tagHighlight=null}},50))},this.focus=function(){var e=this;setTimeout(function(){e.isFocused()||e.textInput.focus()}),this.textInput.focus()},this.isFocused=function(){return this.textInput.isFocused()},this.blur=function(){this.textInput.blur()},this.onFocus=function(e){this.$isFocused||(this.$isFocused=!0,this.renderer.showCursor(),this.renderer.visualizeFocus(),this._emit("focus",e))},this.onBlur=function(e){this.$isFocused&&(this.$isFocused=!1,this.renderer.hideCursor(),this.renderer.visualizeBlur(),this._emit("blur",e))},this.$cursorChange=function(){this.renderer.updateCursor(),this.$highlightBrackets(),this.$highlightTags(),this.$updateHighlightActiveLine()},this.onDocumentChange=function(e){var t=this.session.$useWrapMode,i=e.start.row==e.end.row?e.end.row:1/0;this.renderer.updateLines(e.start.row,i,t),this._signal("change",e),this.$cursorChange()},this.onTokenizerUpdate=function(e){e=e.data;this.renderer.updateLines(e.first,e.last)},this.onScrollTopChange=function(){this.renderer.scrollToY(this.session.getScrollTop())},this.onScrollLeftChange=function(){this.renderer.scrollToX(this.session.getScrollLeft())},this.onCursorChange=function(){this.$cursorChange(),this._signal("changeSelection")},this.$updateHighlightActiveLine=function(){var e,t,i=this.getSession();this.$highlightActiveLine&&("line"==this.$selectionStyle&&this.selection.isMultiLine()||(e=this.getCursorPosition()),this.renderer.theme&&this.renderer.theme.$selectionColorConflict&&!this.selection.isEmpty()&&(e=!1),!this.renderer.$maxLines||1!==this.session.getLength()||1<this.renderer.$minLines||(e=!1)),i.$highlightLineMarker&&!e?(i.removeMarker(i.$highlightLineMarker.id),i.$highlightLineMarker=null):!i.$highlightLineMarker&&e?((t=new f(e.row,e.column,e.row,1/0)).id=i.addMarker(t,"ace_active-line","screenLine"),i.$highlightLineMarker=t):e&&(i.$highlightLineMarker.start.row=e.row,i.$highlightLineMarker.end.row=e.row,i.$highlightLineMarker.start.column=e.column,i._signal("changeBackMarker"))},this.onSelectionChange=function(e){var t,i,n=this.session,n=(n.$selectionMarker&&n.removeMarker(n.$selectionMarker),n.$selectionMarker=null,this.selection.isEmpty()?this.$updateHighlightActiveLine():(t=this.selection.getRange(),i=this.getSelectionStyle(),n.$selectionMarker=n.addMarker(t,"ace_selection",i)),this.$highlightSelectedWord&&this.$getSelectionHighLightRegexp());this.session.highlight(n),this._signal("changeSelection")},this.$getSelectionHighLightRegexp=function(){var e=this.session,t=this.getSelectionRange();if(!t.isEmpty()&&!t.isMultiLine()){var i=t.start.column,n=t.end.column,e=e.getLine(t.start.row),t=e.substring(i,n);if(!(5e3<t.length)&&/[\w\d]/.test(t)){t=this.$search.$assembleRegExp({wholeWord:!0,caseSensitive:!0,needle:t}),e=e.substring(i-1,n+1);if(t.test(e))return t}}},this.onChangeFrontMarker=function(){this.renderer.updateFrontMarkers()},this.onChangeBackMarker=function(){this.renderer.updateBackMarkers()},this.onChangeBreakpoint=function(){this.renderer.updateBreakpoints()},this.onChangeAnnotation=function(){this.renderer.setAnnotations(this.session.getAnnotations())},this.onChangeMode=function(e){this.renderer.updateText(),this._emit("changeMode",e)},this.onChangeWrapLimit=function(){this.renderer.updateFull()},this.onChangeWrapMode=function(){this.renderer.onResize(!0)},this.onChangeFold=function(){this.$updateHighlightActiveLine(),this.renderer.updateFull()},this.getSelectedText=function(){return this.session.getTextRange(this.getSelectionRange())},this.getCopyText=function(){var e=this.getSelectedText(),t=this.session.doc.getNewLineCharacter(),i=!1;if(!e&&this.$copyWithEmptySelection)for(var i=!0,n=this.selection.getAllRanges(),r=0;r<n.length;r++){var s=n[r];r&&n[r-1].start.row==s.start.row||(e+=this.session.getLine(s.start.row)+t)}var o={text:e};return this._signal("copy",o),w.lineMode=i?o.text:"",o.text},this.onCopy=function(){this.commands.exec("copy",this)},this.onCut=function(){this.commands.exec("cut",this)},this.onPaste=function(e,t){this.commands.exec("paste",this,{text:e,event:t})},this.$handlePaste=function(e){this._signal("paste",e="string"==typeof e?{text:e}:e);var t=e.text,e=t==w.lineMode,i=this.session;if(!this.inMultiSelectMode||this.inVirtualSelectionMode)e?i.insert({row:this.selection.lead.row,column:0},t):this.insert(t);else if(e)this.selection.rangeList.ranges.forEach(function(e){i.insert({row:e.start.row,column:0},t)});else{var n=t.split(/\r\n|\r|\n/),r=this.selection.rangeList.ranges,e=!(2!=n.length||n[0]&&n[1]);if(n.length!=r.length||e)return this.commands.exec("insertstring",this,t);for(var s=r.length;s--;){var o=r[s];o.isEmpty()||i.remove(o),i.insert(o.start,n[s])}}},this.execCommand=function(e,t){return this.commands.exec(e,this,t)},this.insert=function(e,t){var i,n=this.session,r=n.getMode(),s=this.getCursorPosition(),o=(this.getBehavioursEnabled()&&!t&&(i=r.transformAction(n.getState(s.row),"insertion",this,n,e))&&(e===i.text||this.inVirtualSelectionMode||(this.session.mergeUndoDeltas=!1,this.mergeNextCommand=!1),e=i.text),"\t"==e&&(e=this.session.getTabString()),this.selection.isEmpty()?this.session.getOverwrite()&&-1==e.indexOf("\n")&&((o=new f.fromPoints(s,s)).end.column+=e.length,this.session.remove(o)):(o=this.getSelectionRange(),s=this.session.remove(o),this.clearSelection()),"\n"!=e&&"\r\n"!=e||(a=n.getLine(s.row),s.column>a.search(/\S|$/)&&(t=a.substr(s.column).search(/\S|$/),n.doc.removeInLine(s.row,s.column,s.column+t))),this.clearSelection(),s.column),t=n.getState(s.row),a=n.getLine(s.row),l=r.checkOutdent(t,a,e);n.insert(s,e),i&&i.selection&&(2==i.selection.length?this.selection.setSelectionRange(new f(s.row,o+i.selection[0],s.row,o+i.selection[1])):this.selection.setSelectionRange(new f(s.row+i.selection[0],i.selection[1],s.row+i.selection[2],i.selection[3]))),this.$enableAutoIndent&&(n.getDocument().isNewLine(e)&&(o=r.getNextLineIndent(t,a.slice(0,s.column),n.getTabString()),n.insert({row:s.row+1,column:0},o)),l)&&r.autoOutdent(t,n,s.row)},this.autoIndent=function(){for(var e,t,i,n,r,s=this.session,o=s.getMode(),a=(i=this.selection.isEmpty()?(t=0,s.doc.getLength()-1):(t=(e=this.getSelectionRange()).start.row,e.end.row),""),l="",h=s.getTabString(),c=t;c<=i;c++)0<c&&(a=s.getState(c-1),n=s.getLine(c-1),l=o.getNextLineIndent(a,n,h)),n=s.getLine(c),l!==(r=o.$getIndent(n))&&(0<r.length&&(r=new f(c,0,c,r.length),s.remove(r)),0<l.length)&&s.insert({row:c,column:0},l),o.autoOutdent(a,s,c)},this.onTextInput=function(e,t){if(!t)return this.keyBinding.onTextInput(e);this.startOperation({command:{name:"insertstring"}});e=this.applyComposition.bind(this,e,t);this.selection.rangeCount?this.forEachSelection(e):e(),this.endOperation()},this.applyComposition=function(e,t){var i;(t.extendLeft||t.extendRight)&&((i=this.selection.getRange()).start.column-=t.extendLeft,i.end.column+=t.extendRight,i.start.column<0&&(i.start.row--,i.start.column+=this.session.getLine(i.start.row).length+1),this.selection.setRange(i),e||i.isEmpty()||this.remove()),!e&&this.selection.isEmpty()||this.insert(e,!0),(t.restoreStart||t.restoreEnd)&&((i=this.selection.getRange()).start.column-=t.restoreStart,i.end.column-=t.restoreEnd,this.selection.setRange(i))},this.onCommandKey=function(e,t,i){return this.keyBinding.onCommandKey(e,t,i)},this.setOverwrite=function(e){this.session.setOverwrite(e)},this.getOverwrite=function(){return this.session.getOverwrite()},this.toggleOverwrite=function(){this.session.toggleOverwrite()},this.setScrollSpeed=function(e){this.setOption("scrollSpeed",e)},this.getScrollSpeed=function(){return this.getOption("scrollSpeed")},this.setDragDelay=function(e){this.setOption("dragDelay",e)},this.getDragDelay=function(){return this.getOption("dragDelay")},this.setSelectionStyle=function(e){this.setOption("selectionStyle",e)},this.getSelectionStyle=function(){return this.getOption("selectionStyle")},this.setHighlightActiveLine=function(e){this.setOption("highlightActiveLine",e)},this.getHighlightActiveLine=function(){return this.getOption("highlightActiveLine")},this.setHighlightGutterLine=function(e){this.setOption("highlightGutterLine",e)},this.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},this.setHighlightSelectedWord=function(e){this.setOption("highlightSelectedWord",e)},this.getHighlightSelectedWord=function(){return this.$highlightSelectedWord},this.setAnimatedScroll=function(e){this.renderer.setAnimatedScroll(e)},this.getAnimatedScroll=function(){return this.renderer.getAnimatedScroll()},this.setShowInvisibles=function(e){this.renderer.setShowInvisibles(e)},this.getShowInvisibles=function(){return this.renderer.getShowInvisibles()},this.setDisplayIndentGuides=function(e){this.renderer.setDisplayIndentGuides(e)},this.getDisplayIndentGuides=function(){return this.renderer.getDisplayIndentGuides()},this.setShowPrintMargin=function(e){this.renderer.setShowPrintMargin(e)},this.getShowPrintMargin=function(){return this.renderer.getShowPrintMargin()},this.setPrintMarginColumn=function(e){this.renderer.setPrintMarginColumn(e)},this.getPrintMarginColumn=function(){return this.renderer.getPrintMarginColumn()},this.setReadOnly=function(e){this.setOption("readOnly",e)},this.getReadOnly=function(){return this.getOption("readOnly")},this.setBehavioursEnabled=function(e){this.setOption("behavioursEnabled",e)},this.getBehavioursEnabled=function(){return this.getOption("behavioursEnabled")},this.setWrapBehavioursEnabled=function(e){this.setOption("wrapBehavioursEnabled",e)},this.getWrapBehavioursEnabled=function(){return this.getOption("wrapBehavioursEnabled")},this.setShowFoldWidgets=function(e){this.setOption("showFoldWidgets",e)},this.getShowFoldWidgets=function(){return this.getOption("showFoldWidgets")},this.setFadeFoldWidgets=function(e){this.setOption("fadeFoldWidgets",e)},this.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},this.remove=function(e){this.selection.isEmpty()&&("left"==e?this.selection.selectLeft():this.selection.selectRight());var t,i,n,e=this.getSelectionRange();this.getBehavioursEnabled()&&(i=(t=this.session).getState(e.start.row),i=t.getMode().transformAction(i,"deletion",this,t,e),0===e.end.column&&"\n"==(n=t.getTextRange(e))[n.length-1]&&(n=t.getLine(e.end.row),/^\s+$/.test(n))&&(e.end.column=n.length),i)&&(e=i),this.session.remove(e),this.clearSelection()},this.removeWordRight=function(){this.selection.isEmpty()&&this.selection.selectWordRight(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeWordLeft=function(){this.selection.isEmpty()&&this.selection.selectWordLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeToLineStart=function(){this.selection.isEmpty()&&this.selection.selectLineStart(),this.selection.isEmpty()&&this.selection.selectLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeToLineEnd=function(){this.selection.isEmpty()&&this.selection.selectLineEnd();var e=this.getSelectionRange();e.start.column==e.end.column&&e.start.row==e.end.row&&(e.end.column=0,e.end.row++),this.session.remove(e),this.clearSelection()},this.splitLine=function(){this.selection.isEmpty()||(this.session.remove(this.getSelectionRange()),this.clearSelection());var e=this.getCursorPosition();this.insert("\n"),this.moveCursorToPosition(e)},this.transposeLetters=function(){var e,t,i,n;this.selection.isEmpty()&&0!==(t=(e=this.getCursorPosition()).column)&&(n=t<(n=this.session.getLine(e.row)).length?(i=n.charAt(t)+n.charAt(t-1),new f(e.row,t-1,e.row,t+1)):(i=n.charAt(t-1)+n.charAt(t-2),new f(e.row,t-2,e.row,t)),this.session.replace(n,i),this.session.selection.moveToPosition(n.end))},this.toLowerCase=function(){var e=this.getSelectionRange(),t=(this.selection.isEmpty()&&this.selection.selectWord(),this.getSelectionRange()),i=this.session.getTextRange(t);this.session.replace(t,i.toLowerCase()),this.selection.setSelectionRange(e)},this.toUpperCase=function(){var e=this.getSelectionRange(),t=(this.selection.isEmpty()&&this.selection.selectWord(),this.getSelectionRange()),i=this.session.getTextRange(t);this.session.replace(t,i.toUpperCase()),this.selection.setSelectionRange(e)},this.indent=function(){var e=this.session,t=this.getSelectionRange();if(!(t.start.row<t.end.row)){if(t.start.column<t.end.column){var i,n=e.getTextRange(t);if(!/^\s+$/.test(n))return i=this.$getSelectedRows(),void e.indentRows(i.first,i.last,"\t")}var r=e.getLine(t.start.row),n=t.start,s=e.getTabSize(),n=e.documentToScreenColumn(n.row,n.column);if(this.session.getUseSoftTabs())var o=s-n%s,a=g.stringRepeat(" ",o);else{for(o=n%s;" "==r[t.start.column-1]&&o;)t.start.column--,o--;this.selection.setSelectionRange(t),a="\t"}return this.insert(a)}i=this.$getSelectedRows(),e.indentRows(i.first,i.last,"\t")},this.blockIndent=function(){var e=this.$getSelectedRows();this.session.indentRows(e.first,e.last,"\t")},this.blockOutdent=function(){var e=this.session.getSelection();this.session.outdentRows(e.getRange())},this.sortLines=function(){for(var e=this.$getSelectedRows(),t=this.session,i=[],n=e.first;n<=e.last;n++)i.push(t.getLine(n));i.sort(function(e,t){return e.toLowerCase()<t.toLowerCase()?-1:e.toLowerCase()>t.toLowerCase()?1:0});for(var r=new f(0,0,0,0),n=e.first;n<=e.last;n++){var s=t.getLine(n);r.start.row=n,r.end.row=n,r.end.column=s.length,t.replace(r,i[n-e.first])}},this.toggleCommentLines=function(){var e=this.session.getState(this.getCursorPosition().row),t=this.$getSelectedRows();this.session.getMode().toggleCommentLines(e,this.session,t.first,t.last)},this.toggleBlockComment=function(){var e=this.getCursorPosition(),t=this.session.getState(e.row),i=this.getSelectionRange();this.session.getMode().toggleBlockComment(t,this.session,i,e)},this.getNumberAt=function(e,t){for(var i=/[\-]?[0-9]+(?:\.[0-9]+)?/g,n=(i.lastIndex=0,this.session.getLine(e));i.lastIndex<t;){var r=i.exec(n);if(r.index<=t&&r.index+r[0].length>=t)return{value:r[0],start:r.index,end:r.index+r[0].length}}return null},this.modifyNumber=function(e){var t,i,n,r=this.selection.getCursor().row,s=this.selection.getCursor().column,o=new f(r,s-1,r,s),o=this.session.getTextRange(o);!isNaN(parseFloat(o))&&isFinite(o)?(o=this.getNumberAt(r,s))&&(n=0<=o.value.indexOf(".")?o.start+o.value.indexOf(".")+1:o.end,t=o.start+o.value.length-n,i=parseFloat(o.value),i*=Math.pow(10,t),n!==o.end&&s<n?e*=Math.pow(10,o.end-s-1):e*=Math.pow(10,o.end-s),n=(i=(i+=e)/Math.pow(10,t)).toFixed(t),e=new f(r,o.start,r,o.end),this.session.replace(e,n),this.moveCursorTo(r,Math.max(o.start+1,s+n.length-o.value.length))):this.toggleWord()},this.$toggleWordPairs=[["first","last"],["true","false"],["yes","no"],["width","height"],["top","bottom"],["right","left"],["on","off"],["x","y"],["get","set"],["max","min"],["horizontal","vertical"],["show","hide"],["add","remove"],["up","down"],["before","after"],["even","odd"],["in","out"],["inside","outside"],["next","previous"],["increase","decrease"],["attach","detach"],["&&","||"],["==","!="]],this.toggleWord=function(){for(var i,n=this.selection.getCursor().row,e=this.selection.getCursor().column,r=(this.selection.selectWord(),this.getSelectedText()),s=this.selection.getWordRange().start.column,t=r.replace(/([a-z]+|[A-Z]+)(?=[A-Z_]|$)/g,"$1 ").split(/\s/),o=e-s-1,a=(o<0&&(o=0),0),l=this,h=(r.match(/[A-Za-z0-9_]+/)&&t.forEach(function(e,t){i=a+e.length,a<=o&&o<=i&&(r=e,l.selection.clearSelection(),l.moveCursorTo(n,a+s),l.selection.selectTo(n,i+s)),a=i}),this.$toggleWordPairs),c=0;c<h.length;c++)for(var d=h[c],u=0;u<=1;u++){var p=+!u,m=r.match(new RegExp("^\\s?_?("+g.escapeRegExp(d[u])+")\\s?$","i"));m&&r.match(new RegExp("([_]|^|\\s)("+g.escapeRegExp(m[1])+")($|\\s)","g"))&&(m=r.replace(new RegExp(g.escapeRegExp(d[u]),"i"),function(e){var t=d[p];return e.toUpperCase()==e?t=t.toUpperCase():e.charAt(0).toUpperCase()==e.charAt(0)&&(t=t.substr(0,0)+d[p].charAt(0).toUpperCase()+t.substr(1)),t}),this.insert(m))}},this.removeLines=function(){var e=this.$getSelectedRows();this.session.removeFullLines(e.first,e.last),this.clearSelection()},this.duplicateSelection=function(){var e,t=this.selection,i=this.session,n=t.getRange(),r=t.isBackwards();n.isEmpty()?(e=n.start.row,i.duplicateLines(e,e)):(e=r?n.start:n.end,i=i.insert(e,i.getTextRange(n),!1),n.start=e,n.end=i,t.setSelectionRange(n,r))},this.moveLinesDown=function(){this.$moveLines(1,!1)},this.moveLinesUp=function(){this.$moveLines(-1,!1)},this.moveText=function(e,t,i){return this.session.moveText(e,t,i)},this.copyLinesUp=function(){this.$moveLines(-1,!0)},this.copyLinesDown=function(){this.$moveLines(1,!0)},this.$moveLines=function(e,t){var i=this.selection;if(!i.inMultiSelectMode||this.inVirtualSelectionMode){var n=i.toOrientedRange(),r=this.$getSelectedRows(n),s=this.session.$moveLines(r.first,r.last,t?0:e);n.moveBy(s=t&&-1==e?0:s,0),i.fromOrientedRange(n)}else{for(var o=i.rangeList.ranges,a=(i.rangeList.detach(this.session),this.inVirtualSelectionMode=!0,0),l=0,h=o.length,c=0;c<h;c++){for(var d=c,u=(o[c].moveBy(a,0),(r=this.$getSelectedRows(o[c])).first),p=r.last;++c<h;){l&&o[c].moveBy(l,0);var m=this.$getSelectedRows(o[c]);if(t&&m.first!=p)break;if(!t&&m.first>p+1)break;p=m.last}for(c--,a=this.session.$moveLines(u,p,t?0:e),t&&-1==e&&(d=c+1);d<=c;)o[d].moveBy(a,0),d++;l+=a=t?a:0}i.fromOrientedRange(i.ranges[0]),i.rangeList.attach(this.session),this.inVirtualSelectionMode=!1}},this.$getSelectedRows=function(e){return e=(e||this.getSelectionRange()).collapseRows(),{first:this.session.getRowFoldStart(e.start.row),last:this.session.getRowFoldEnd(e.end.row)}},this.onCompositionStart=function(e){this.renderer.showComposition(e)},this.onCompositionUpdate=function(e){this.renderer.setCompositionText(e)},this.onCompositionEnd=function(){this.renderer.hideComposition()},this.getFirstVisibleRow=function(){return this.renderer.getFirstVisibleRow()},this.getLastVisibleRow=function(){return this.renderer.getLastVisibleRow()},this.isRowVisible=function(e){return e>=this.getFirstVisibleRow()&&e<=this.getLastVisibleRow()},this.isRowFullyVisible=function(e){return e>=this.renderer.getFirstFullyVisibleRow()&&e<=this.renderer.getLastFullyVisibleRow()},this.$getVisibleRowCount=function(){return this.renderer.getScrollBottomRow()-this.renderer.getScrollTopRow()+1},this.$moveByPage=function(e,t){var i=this.renderer,n=this.renderer.layerConfig,r=e*Math.floor(n.height/n.lineHeight),e=(!0===t?this.selection.$moveSelection(function(){this.moveCursorBy(r,0)}):!1===t&&(this.selection.moveCursorBy(r,0),this.selection.clearSelection()),i.scrollTop);i.scrollBy(0,r*n.lineHeight),null!=t&&i.scrollCursorIntoView(null,.5),i.animateScrolling(e)},this.selectPageDown=function(){this.$moveByPage(1,!0)},this.selectPageUp=function(){this.$moveByPage(-1,!0)},this.gotoPageDown=function(){this.$moveByPage(1,!1)},this.gotoPageUp=function(){this.$moveByPage(-1,!1)},this.scrollPageDown=function(){this.$moveByPage(1)},this.scrollPageUp=function(){this.$moveByPage(-1)},this.scrollToRow=function(e){this.renderer.scrollToRow(e)},this.scrollToLine=function(e,t,i,n){this.renderer.scrollToLine(e,t,i,n)},this.centerSelection=function(){var e=this.getSelectionRange(),e={row:Math.floor(e.start.row+(e.end.row-e.start.row)/2),column:Math.floor(e.start.column+(e.end.column-e.start.column)/2)};this.renderer.alignCursor(e,.5)},this.getCursorPosition=function(){return this.selection.getCursor()},this.getCursorPositionScreen=function(){return this.session.documentToScreenPosition(this.getCursorPosition())},this.getSelectionRange=function(){return this.selection.getRange()},this.selectAll=function(){this.selection.selectAll()},this.clearSelection=function(){this.selection.clearSelection()},this.moveCursorTo=function(e,t){this.selection.moveCursorTo(e,t)},this.moveCursorToPosition=function(e){this.selection.moveCursorToPosition(e)},this.jumpToMatching=function(e,t){var i=this.getCursorPosition(),n=new b(this.session,i.row,i.column),r=n.getCurrentToken(),s=r||n.stepForward();if(s){var o,a,l,h=!1,c={},d=i.column-s.start,u={")":"(","(":"(","]":"[","[":"[","{":"{","}":"{"};do{if(s.value.match(/[{}()\[\]]/g)){for(;d<s.value.length&&!h;d++)if(u[s.value[d]])switch(a=u[s.value[d]]+"."+s.type.replace("rparen","lparen"),isNaN(c[a])&&(c[a]=0),s.value[d]){case"(":case"[":case"{":c[a]++;break;case")":case"]":case"}":c[a]--,-1===c[a]&&(o="bracket",h=!0)}}else-1!==s.type.indexOf("tag-name")&&(isNaN(c[s.value])&&(c[s.value]=0),"<"===r.value?c[s.value]++:"</"===r.value&&c[s.value]--,-1===c[s.value])&&(o="tag",h=!0)}while(h||(r=s,s=n.stepForward(),d=0),s&&!h);if(o){if("bracket"===o)!(p=this.session.getBracketRange(i))&&(l=(p=new f(n.getCurrentTokenRow(),n.getCurrentTokenColumn()+d-1,n.getCurrentTokenRow(),n.getCurrentTokenColumn()+d-1)).start,t||l.row===i.row&&Math.abs(l.column-i.column)<2)&&(p=this.session.getBracketRange(l));else if("tag"===o){if(!s||-1===s.type.indexOf("tag-name"))return;var p,m=s.value;if(0===(p=new f(n.getCurrentTokenRow(),n.getCurrentTokenColumn()-2,n.getCurrentTokenRow(),n.getCurrentTokenColumn()-2)).compare(i.row,i.column))for(h=!1;s=r,(r=n.stepBackward())&&(-1!==r.type.indexOf("tag-close")&&p.setEnd(n.getCurrentTokenRow(),n.getCurrentTokenColumn()+1),s.value===m)&&-1!==s.type.indexOf("tag-name")&&("<"===r.value?c[m]++:"</"===r.value&&c[m]--,0===c[m])&&(h=!0),r&&!h;);s&&s.type.indexOf("tag-name")&&(l=p.start).row==i.row&&Math.abs(l.column-i.column)<2&&(l=p.end)}(l=p&&p.cursor||l)&&(e?p&&t?this.selection.setRange(p):p&&p.isEqual(this.getSelectionRange())?this.clearSelection():this.selection.selectTo(l.row,l.column):this.selection.moveTo(l.row,l.column))}}},this.gotoLine=function(e,t,i){this.selection.clearSelection(),this.session.unfold({row:e-1,column:t||0}),this.exitMultiSelectMode&&this.exitMultiSelectMode(),this.moveCursorTo(e-1,t||0),this.isRowFullyVisible(e-1)||this.scrollToLine(e-1,!0,i)},this.navigateTo=function(e,t){this.selection.moveTo(e,t)},this.navigateUp=function(e){var t;if(this.selection.isMultiLine()&&!this.selection.isBackwards())return t=this.selection.anchor.getPosition(),this.moveCursorToPosition(t);this.selection.clearSelection(),this.selection.moveCursorBy(-e||-1,0)},this.navigateDown=function(e){var t;if(this.selection.isMultiLine()&&this.selection.isBackwards())return t=this.selection.anchor.getPosition(),this.moveCursorToPosition(t);this.selection.clearSelection(),this.selection.moveCursorBy(e||1,0)},this.navigateLeft=function(e){if(this.selection.isEmpty())for(e=e||1;e--;)this.selection.moveCursorLeft();else{var t=this.getSelectionRange().start;this.moveCursorToPosition(t)}this.clearSelection()},this.navigateRight=function(e){if(this.selection.isEmpty())for(e=e||1;e--;)this.selection.moveCursorRight();else{var t=this.getSelectionRange().end;this.moveCursorToPosition(t)}this.clearSelection()},this.navigateLineStart=function(){this.selection.moveCursorLineStart(),this.clearSelection()},this.navigateLineEnd=function(){this.selection.moveCursorLineEnd(),this.clearSelection()},this.navigateFileEnd=function(){this.selection.moveCursorFileEnd(),this.clearSelection()},this.navigateFileStart=function(){this.selection.moveCursorFileStart(),this.clearSelection()},this.navigateWordRight=function(){this.selection.moveCursorWordRight(),this.clearSelection()},this.navigateWordLeft=function(){this.selection.moveCursorWordLeft(),this.clearSelection()},this.replace=function(e,t){t&&this.$search.set(t);var t=this.$search.find(this.session),i=0;return t&&(this.$tryReplace(t,e)&&(i=1),this.selection.setSelectionRange(t),this.renderer.scrollSelectionIntoView(t.start,t.end)),i},this.replaceAll=function(e,t){t&&this.$search.set(t);var i=this.$search.findAll(this.session),n=0;if(i.length){t=this.getSelectionRange();this.selection.moveTo(0,0);for(var r=i.length-1;0<=r;--r)this.$tryReplace(i[r],e)&&n++;this.selection.setSelectionRange(t)}return n},this.$tryReplace=function(e,t){var i=this.session.getTextRange(e);return null!==(t=this.$search.replace(i,t))?(e.end=this.session.replace(e,t),e):null},this.getLastSearchOptions=function(){return this.$search.getOptions()},this.find=function(e,t,i){t=t||{},"string"==typeof e||e instanceof RegExp?t.needle=e:"object"==typeof e&&s.mixin(t,e);var n=this.selection.getRange(),e=(null==t.needle&&((e=this.session.getTextRange(n)||this.$search.$options.needle)||(n=this.session.getWordRange(n.start.row,n.start.column),e=this.session.getTextRange(n)),this.$search.set({needle:e})),this.$search.set(t),t.start||this.$search.set({start:n}),this.$search.find(this.session));return t.preventScroll?e:e?(this.revealRange(e,i),e):(t.backwards?n.start=n.end:n.end=n.start,void this.selection.setRange(n))},this.findNext=function(e,t){this.find({skipCurrent:!0,backwards:!1},e,t)},this.findPrevious=function(e,t){this.find(e,{skipCurrent:!0,backwards:!0},t)},this.revealRange=function(e,t){this.session.unfold(e),this.selection.setSelectionRange(e);var i=this.renderer.scrollTop;this.renderer.scrollSelectionIntoView(e.start,e.end,.5),!1!==t&&this.renderer.animateScrolling(i)},this.undo=function(){this.session.getUndoManager().undo(this.session),this.renderer.scrollCursorIntoView(null,.5)},this.redo=function(){this.session.getUndoManager().redo(this.session),this.renderer.scrollCursorIntoView(null,.5)},this.destroy=function(){this.$toDestroy&&(this.$toDestroy.forEach(function(e){e.destroy()}),this.$toDestroy=null),this.$mouseHandler&&this.$mouseHandler.destroy(),this.renderer.destroy(),this._signal("destroy",this),this.session&&this.session.destroy(),this._$emitInputEvent&&this._$emitInputEvent.cancel(),this.removeAllListeners()},this.setAutoScrollEditorIntoView=function(e){var n,r,s,o,t,i,a;e&&(s=!1,(r=this).$scrollAnchor||(this.$scrollAnchor=document.createElement("div")),(o=this.$scrollAnchor).style.cssText="position:absolute",this.container.insertBefore(o,this.container.firstChild),t=this.on("changeSelection",function(){s=!0}),i=this.renderer.on("beforeRender",function(){s&&(n=r.renderer.container.getBoundingClientRect())}),a=this.renderer.on("afterRender",function(){var e,t,i;s&&n&&(r.isFocused()||r.searchBox&&r.searchBox.isFocused())&&(e=(t=r.renderer).$cursorLayer.$pixelPos,t=t.layerConfig,i=e.top-t.offset,null!=(s=0<=e.top&&i+n.top<0||!(e.top<t.height&&e.top+n.top+t.lineHeight>window.innerHeight)&&null)&&(o.style.top=i+"px",o.style.left=e.left+"px",o.style.height=t.lineHeight+"px",o.scrollIntoView(s)),s=n=null)}),this.setAutoScrollEditorIntoView=function(e){e||(delete this.setAutoScrollEditorIntoView,this.off("changeSelection",t),this.renderer.off("afterRender",a),this.renderer.off("beforeRender",i))})},this.$resetCursorStyle=function(){var e=this.$cursorStyle||"ace",t=this.renderer.$cursorLayer;t&&(t.setSmoothBlinking(/smooth/.test(e)),t.isBlinking=!this.$readOnly&&"wide"!=e,n.setCssClass(t.element,"ace_slim-cursors",/slim/.test(e)))},this.prompt=function(t,i,n){var r=this;y.loadModule("./ext/prompt",function(e){e.prompt(r,t,i,n)})}}.call(r.prototype),y.defineOptions(r.prototype,"editor",{selectionStyle:{set:function(e){this.onSelectionChange(),this._signal("changeSelectionStyle",{data:e})},initialValue:"line"},highlightActiveLine:{set:function(){this.$updateHighlightActiveLine()},initialValue:!0},highlightSelectedWord:{set:function(e){this.$onSelectionChange()},initialValue:!0},readOnly:{set:function(e){this.textInput.setReadOnly(e),this.$resetCursorStyle()},initialValue:!1},copyWithEmptySelection:{set:function(e){this.textInput.setCopyWithEmptySelection(e)},initialValue:!1},cursorStyle:{set:function(e){this.$resetCursorStyle()},values:["ace","slim","smooth","wide"],initialValue:"ace"},mergeUndoDeltas:{values:[!1,!0,"always"],initialValue:!0},behavioursEnabled:{initialValue:!0},wrapBehavioursEnabled:{initialValue:!0},enableAutoIndent:{initialValue:!0},autoScrollEditorIntoView:{set:function(e){this.setAutoScrollEditorIntoView(e)}},keyboardHandler:{set:function(e){this.setKeyboardHandler(e)},get:function(){return this.$keybindingId},handlesSet:!0},value:{set:function(e){this.session.setValue(e)},get:function(){return this.getValue()},handlesSet:!0,hidden:!0},session:{set:function(e){this.setSession(e)},get:function(){return this.session},handlesSet:!0,hidden:!0},showLineNumbers:{set:function(e){this.renderer.$gutterLayer.setShowLineNumbers(e),this.renderer.$loop.schedule(this.renderer.CHANGE_GUTTER),e&&this.$relativeLineNumbers?x.attach(this):x.detach(this)},initialValue:!0},relativeLineNumbers:{set:function(e){this.$showLineNumbers&&e?x.attach(this):x.detach(this)}},placeholder:{set:function(e){this.$updatePlaceholder||(this.$updatePlaceholder=function(){var e=this.session&&(this.renderer.$composition||this.getValue());e&&this.renderer.placeholderNode?(this.renderer.off("afterRender",this.$updatePlaceholder),n.removeCssClass(this.container,"ace_hasPlaceholder"),this.renderer.placeholderNode.remove(),this.renderer.placeholderNode=null):e||this.renderer.placeholderNode?!e&&this.renderer.placeholderNode&&(this.renderer.placeholderNode.textContent=this.$placeholder||""):(this.renderer.on("afterRender",this.$updatePlaceholder),n.addCssClass(this.container,"ace_hasPlaceholder"),(e=n.createElement("div")).className="ace_placeholder",e.textContent=this.$placeholder||"",this.renderer.placeholderNode=e,this.renderer.content.appendChild(this.renderer.placeholderNode))}.bind(this),this.on("input",this.$updatePlaceholder)),this.$updatePlaceholder()}},hScrollBarAlwaysVisible:"renderer",vScrollBarAlwaysVisible:"renderer",highlightGutterLine:"renderer",animatedScroll:"renderer",showInvisibles:"renderer",showPrintMargin:"renderer",printMarginColumn:"renderer",printMargin:"renderer",fadeFoldWidgets:"renderer",showFoldWidgets:"renderer",displayIndentGuides:"renderer",showGutter:"renderer",fontSize:"renderer",fontFamily:"renderer",maxLines:"renderer",minLines:"renderer",scrollPastEnd:"renderer",fixedWidthGutter:"renderer",theme:"renderer",hasCssTransforms:"renderer",maxPixelHeight:"renderer",useTextareaForIME:"renderer",scrollSpeed:"$mouseHandler",dragDelay:"$mouseHandler",dragEnabled:"$mouseHandler",focusTimeout:"$mouseHandler",tooltipFollowsMouse:"$mouseHandler",firstLineNumber:"session",overwrite:"session",newLineMode:"session",useWorker:"session",useSoftTabs:"session",navigateWithinSoftTabs:"session",tabSize:"session",wrap:"session",indentedSoftWrap:"session",foldStyle:"session",mode:"session"}),{getText:function(e,t){return(Math.abs(e.selection.lead.row-t)||t+1+(t<9?"·":""))+""},getWidth:function(e,t,i){return Math.max(t.toString().length,(i.lastRow+1).toString().length,2)*i.characterWidth},update:function(e,t){t.renderer.$loop.schedule(t.renderer.CHANGE_GUTTER)},attach:function(e){e.renderer.$gutterLayer.$renderer=this,e.on("changeSelection",this.update),this.update(null,e)},detach:function(e){e.renderer.$gutterLayer.$renderer==this&&(e.renderer.$gutterLayer.$renderer=null),e.off("changeSelection",this.update),this.update(null,e)}});t.Editor=r}),ace.define("ace/undomanager",["require","exports","module","ace/range"],function(e,t,i){"use strict";function r(e,t){for(var i=t;i--;){var n=e[i];if(n&&!n[0].ignore){for(;i<t-1;){var r=function(e,t){for(var i=e.length;i--;)for(var n=0;n<t.length;n++)if(!o(e[i],t[n])){for(;i<e.length;){for(;n--;)o(t[n],e[i]);n=t.length,i++}return[e,t]}return e.selectionBefore=t.selectionBefore=e.selectionAfter=t.selectionAfter=null,[t,e]}(e[i],e[i+1]);e[i]=r[0],e[i+1]=r[1],i++}return 1}}}function a(e){return{row:e.row,column:e.column}}function n(e){var t;return e=e||this,Array.isArray(e)?e.map(n).join("\n"):(t="",e.action?(t="insert"==e.action?"+":"-",t+="["+e.lines+"]"):e.value&&(t=Array.isArray(e.value)?e.value.map(s).join("\n"):s(e.value)),e.start&&(t+=s(e)),(e.id||e.rev)&&(t+="\t("+(e.id||e.rev)+")"),t)}function s(e){return e.start.row+":"+e.start.column+"=>"+e.end.row+":"+e.end.column}function o(e,t){var i="insert"==e.action,n="insert"==t.action;if(i&&n)if(0<=m(t.start,e.end))l(t,e,-1);else{if(!(m(t.start,e.start)<=0))return;l(e,t,1)}else if(i&&!n)if(0<=m(t.start,e.end))l(t,e,-1);else{if(!(m(t.end,e.start)<=0))return;l(e,t,-1)}else if(!i&&n)if(0<=m(t.start,e.start))l(t,e,1);else{if(!(m(t.start,e.start)<=0))return;l(e,t,1)}else if(!i&&!n)if(0<=m(t.start,e.start))l(t,e,1);else{if(!(m(t.end,e.start)<=0))return;l(e,t,-1)}return 1}function l(e,t,i){h(e.start,t.start,t.end,i),h(e.end,t.start,t.end,i)}function h(e,t,i,n){e.row==(1==n?t:i).row&&(e.column+=n*(i.column-t.column)),e.row+=n*(i.row-t.row)}function c(e,t){var i=e.lines,n=e.end,r=(e.end=a(t),e.end.row-e.start.row),s=i.splice(r,i.length),r=r?t.column:t.column-e.start.column;return i.push(s[0].substring(0,r)),s[0]=s[0].substr(r),{start:a(t),end:n,lines:s,action:e.action}}function d(e,t){var i;t={start:a((i=t).start),end:a(i.end),action:i.action,lines:i.lines.slice()};for(var n=e.length;n--;){for(var r=e[n],s=0;s<r.length;s++){var o=function(e,t){var i,n,r="insert"==e.action,s="insert"==t.action;if(r&&s)m(e.start,t.start)<0?l(t,e,1):l(e,t,1);else if(r&&!s)0<=m(e.start,t.end)?l(e,t,-1):(m(e.start,t.start)<=0||l(e,p.fromPoints(t.start,e.start),-1),l(t,e,1));else if(!r&&s)0<=m(t.start,e.end)?l(t,e,-1):(m(t.start,e.start)<=0||l(t,p.fromPoints(e.start,t.start),-1),l(e,t,1));else if(!r&&!s)if(0<=m(t.start,e.end))l(t,e,-1);else{if(!(m(t.end,e.start)<=0))return m(e.start,t.start)<0&&(e=c(i=e,t.start)),0<m(e.end,t.end)&&(n=c(e,t.end)),h(t.end,e.start,e.end,-1),n&&!i&&(e.lines=n.lines,e.start=n.start,e.end=n.end,n=e),[t,i,n].filter(Boolean);l(e,t,-1)}return[t,e]}(r[s],t);t=o[0],2!=o.length&&(o[2]?(r.splice(s+1,1,o[1],o[2]),s++):o[1]||(r.splice(s,1),s--))}r.length||e.splice(n,1)}}function u(){this.$maxRev=0,this.$fromUndo=!1,this.reset()}!function(){this.addSession=function(e){this.$session=e},this.add=function(e,t,i){this.$fromUndo||e!=this.$lastDelta&&(this.$keepRedoStack||(this.$redoStack.length=0),!1!==t&&this.lastDeltas||(this.lastDeltas=[],this.$undoStack.push(this.lastDeltas),e.id=this.$rev=++this.$maxRev),"remove"!=e.action&&"insert"!=e.action||(this.$lastDelta=e),this.lastDeltas.push(e))},this.addSelection=function(e,t){this.selections.push({value:e,rev:t||this.$rev})},this.startNewGroup=function(){return this.lastDeltas=null,this.$rev},this.markIgnored=function(e,t){null==t&&(t=this.$rev+1);for(var i=this.$undoStack,n=i.length;n--;){var r=i[n][0];if(r.id<=e)break;r.id<t&&(r.ignore=!0)}this.lastDeltas=null},this.getSelection=function(e,t){for(var i=this.selections,n=i.length;n--;){var r=i[n];if(r.rev<e)return r=t?i[n+1]:r}},this.getRevision=function(){return this.$rev},this.getDeltas=function(e,t){null==t&&(t=this.$rev+1);for(var i=this.$undoStack,n=null,r=0,s=i.length;s--;){var o=i[s][0];if(o.id<t&&!n&&(n=s+1),o.id<=e){r=s+1;break}}return i.slice(r,n)},this.getChangedRanges=function(e,t){null==t&&this.$rev},this.getChangedLines=function(e,t){null==t&&this.$rev},this.undo=function(e,t){this.lastDeltas=null;var i,n=this.$undoStack;if(r(n,n.length))return e=e||this.$session,this.$redoStackBaseRev!==this.$rev&&this.$redoStack.length&&(this.$redoStack=[]),this.$fromUndo=!0,i=null,(n=n.pop())&&(i=e.undoChanges(n,t),this.$redoStack.push(n),this.$syncRev()),this.$fromUndo=!1,i},this.redo=function(e,t){if(this.lastDeltas=null,e=e||this.$session,this.$fromUndo=!0,this.$redoStackBaseRev!=this.$rev){for(var i=this.getDeltas(this.$redoStackBaseRev,this.$rev+1),n=this.$redoStack,r=i,s=0;s<r.length;s++)for(var o=r[s],a=0;a<o.length;a++)d(n,o[a]);this.$redoStackBaseRev=this.$rev,this.$redoStack.forEach(function(e){e[0].id=++this.$maxRev},this)}var i=this.$redoStack.pop(),l=null;return i&&(l=e.redoChanges(i,t),this.$undoStack.push(i),this.$syncRev()),this.$fromUndo=!1,l},this.$syncRev=function(){var e=this.$undoStack,e=e[e.length-1],e=e&&e[0].id||0;this.$redoStackBaseRev=e,this.$rev=e},this.reset=function(){this.lastDeltas=null,this.$lastDelta=null,this.$undoStack=[],this.$redoStack=[],this.$rev=0,this.mark=0,this.$redoStackBaseRev=this.$rev,this.selections=[]},this.canUndo=function(){return 0<this.$undoStack.length},this.canRedo=function(){return 0<this.$redoStack.length},this.bookmark=function(e){null==e&&(e=this.$rev),this.mark=e},this.isAtBookmark=function(){return this.$rev===this.mark},this.toJSON=function(){},this.fromJSON=function(){},this.hasUndo=this.canUndo,this.hasRedo=this.canRedo,this.isClean=this.isAtBookmark,this.markClean=this.bookmark,this.$prettyPrint=function(e){return e?n(e):n(this.$undoStack)+"\n---\n"+n(this.$redoStack)}}.call(u.prototype);var p=e("./range").Range,m=p.comparePoints;p.comparePoints;t.UndoManager=u}),ace.define("ace/layer/lines",["require","exports","module","ace/lib/dom"],function(e,t,i){"use strict";function n(e,t){this.element=e,this.canvasHeight=t||5e5,this.element.style.height=2*this.canvasHeight+"px",this.cells=[],this.cellCache=[],this.$offsetCoefficient=0}var o=e("../lib/dom");(function(){this.moveContainer=function(e){o.translate(this.element,0,-(e.firstRowScreen*e.lineHeight%this.canvasHeight)-e.offset*this.$offsetCoefficient)},this.pageChanged=function(e,t){return Math.floor(e.firstRowScreen*e.lineHeight/this.canvasHeight)!==Math.floor(t.firstRowScreen*t.lineHeight/this.canvasHeight)},this.computeLineTop=function(e,t,i){var n=t.firstRowScreen*t.lineHeight,n=Math.floor(n/this.canvasHeight);return i.documentToScreenRow(e,0)*t.lineHeight-n*this.canvasHeight},this.computeLineHeight=function(e,t,i){return t.lineHeight*i.getRowLineCount(e)},this.getLength=function(){return this.cells.length},this.get=function(e){return this.cells[e]},this.shift=function(){this.$cacheCell(this.cells.shift())},this.pop=function(){this.$cacheCell(this.cells.pop())},this.push=function(e){if(Array.isArray(e)){this.cells.push.apply(this.cells,e);for(var t=o.createFragment(this.element),i=0;i<e.length;i++)t.appendChild(e[i].element);this.element.appendChild(t)}else this.cells.push(e),this.element.appendChild(e.element)},this.unshift=function(e){if(Array.isArray(e)){this.cells.unshift.apply(this.cells,e);for(var t=o.createFragment(this.element),i=0;i<e.length;i++)t.appendChild(e[i].element);this.element.firstChild?this.element.insertBefore(t,this.element.firstChild):this.element.appendChild(t)}else this.cells.unshift(e),this.element.insertAdjacentElement("afterbegin",e.element)},this.last=function(){return this.cells.length?this.cells[this.cells.length-1]:null},this.$cacheCell=function(e){e&&(e.element.remove(),this.cellCache.push(e))},this.createCell=function(e,t,i,n){var r,s=this.cellCache.pop();return s||(r=o.createElement("div"),n&&n(r),this.element.appendChild(r),s={element:r,text:"",row:e}),s.row=e,s}}).call(n.prototype),t.Lines=n}),ace.define("ace/layer/gutter",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/layer/lines"],function(e,t,i){"use strict";function h(e){var t=document.createTextNode(""),t=(e.appendChild(t),f.createElement("span"));return e.appendChild(t),e}function n(e){this.element=f.createElement("div"),this.element.className="ace_layer ace_gutter-layer",e.appendChild(this.element),this.setShowFoldWidgets(this.$showFoldWidgets),this.gutterWidth=0,this.$annotations=[],this.$updateAnnotations=this.$updateAnnotations.bind(this),this.$lines=new a(this.element),this.$lines.$offsetCoefficient=1}var f=e("../lib/dom"),r=e("../lib/oop"),s=e("../lib/lang"),o=e("../lib/event_emitter").EventEmitter,a=e("./lines").Lines;(function(){r.implement(this,o),this.setSession=function(e){this.session&&this.session.off("change",this.$updateAnnotations),(this.session=e)&&e.on("change",this.$updateAnnotations)},this.addGutterDecoration=function(e,t){window.console&&console.warn&&console.warn("deprecated use session.addGutterDecoration"),this.session.addGutterDecoration(e,t)},this.removeGutterDecoration=function(e,t){window.console&&console.warn&&console.warn("deprecated use session.removeGutterDecoration"),this.session.removeGutterDecoration(e,t)},this.setAnnotations=function(e){this.$annotations=[];for(var t=0;t<e.length;t++){var i=e[t],n=i.row,r=(r=this.$annotations[n])||(this.$annotations[n]={text:[]}),n=(n=i.text)?s.escapeHTML(n):i.html||"",n=(-1===r.text.indexOf(n)&&r.text.push(n),i.type);"error"==n?r.className=" ace_error":"warning"==n&&" ace_error"!=r.className?r.className=" ace_warning":"info"!=n||r.className||(r.className=" ace_info")}},this.$updateAnnotations=function(e){var t,i;this.$annotations.length&&(t=e.start.row,0!=(i=e.end.row-t))&&("remove"==e.action?this.$annotations.splice(t,1+i,null):((e=new Array(1+i)).unshift(t,1),this.$annotations.splice.apply(this.$annotations,e)))},this.update=function(e){this.config=e;for(var t=this.session,i=e.firstRow,n=Math.min(e.lastRow+e.gutterOffset,t.getLength()-1),r=(this.oldLastRow=n,this.config=e,this.$lines.moveContainer(e),this.$updateCursorRow(),t.getNextFoldLine(i)),s=r?r.start.row:1/0,o=null,a=-1,l=i;;){if(s<l&&(l=r.end.row+1,s=(r=t.getNextFoldLine(l,r))?r.start.row:1/0),n<l){for(;this.$lines.getLength()>a+1;)this.$lines.pop();break}(o=this.$lines.get(++a))?o.row=l:(o=this.$lines.createCell(l,e,this.session,h),this.$lines.push(o)),this.$renderCell(o,e,r,l),l++}this._signal("afterRender"),this.$updateGutterWidth(e)},this.$updateGutterWidth=function(e){var t=this.session,i=t.gutterRenderer||this.$renderer,n=t.$firstLineNumber,r=this.$lines.last()?this.$lines.last().text:"",n=((this.$fixedWidth||t.$useWrapMode)&&(r=t.getLength()+n-1),i?i.getWidth(t,r,e):r.toString().length*e.characterWidth),i=this.$padding||this.$computePadding();(n+=i.left+i.right)===this.gutterWidth||isNaN(n)||(this.gutterWidth=n,this.element.parentNode.style.width=this.element.style.width=Math.ceil(this.gutterWidth)+"px",this._signal("changeGutterWidth",n))},this.$updateCursorRow=function(){var e;this.$highlightGutterLine&&(e=this.session.selection.getCursor(),this.$cursorRow!==e.row)&&(this.$cursorRow=e.row)},this.updateLineHighlight=function(){if(this.$highlightGutterLine){var e=this.session.selection.cursor.row;if(this.$cursorRow=e,!this.$cursorCell||this.$cursorCell.row!=e){this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ",""));var t=this.$lines.cells;this.$cursorCell=null;for(var i=0;i<t.length;i++){var n=t[i];if(n.row>=this.$cursorRow){if(n.row>this.$cursorRow){var r=this.session.getFoldLine(this.$cursorRow);if(!(0<i&&r&&r.start.row==t[i-1].row))break;n=t[i-1]}n.element.className="ace_gutter-active-line "+n.element.className,this.$cursorCell=n;break}}}}},this.scrollLines=function(e){var t=this.config;if(this.config=e,this.$updateCursorRow(),this.$lines.pageChanged(t,e))return this.update(e);this.$lines.moveContainer(e);var i=Math.min(e.lastRow+e.gutterOffset,this.session.getLength()-1),n=this.oldLastRow;if(this.oldLastRow=i,!t||n<e.firstRow)return this.update(e);if(i<t.firstRow)return this.update(e);if(t.firstRow<e.firstRow)for(var r=this.session.getFoldedRowCount(t.firstRow,e.firstRow-1);0<r;r--)this.$lines.shift();if(i<n)for(r=this.session.getFoldedRowCount(i+1,n);0<r;r--)this.$lines.pop();e.firstRow<t.firstRow&&this.$lines.unshift(this.$renderLines(e,e.firstRow,t.firstRow-1)),n<i&&this.$lines.push(this.$renderLines(e,n+1,i)),this.updateLineHighlight(),this._signal("afterRender"),this.$updateGutterWidth(e)},this.$renderLines=function(e,t,i){for(var n=[],r=t,s=this.session.getNextFoldLine(r),o=s?s.start.row:1/0;o<r&&(r=s.end.row+1,o=(s=this.session.getNextFoldLine(r,s))?s.start.row:1/0),!(i<r);){var a=this.$lines.createCell(r,e,this.session,h);this.$renderCell(a,e,s,r),n.push(a),r++}return n},this.$renderCell=function(e,t,i,n){var r,s=e.element,o=this.session,a=s.childNodes[0],l=s.childNodes[1],h=o.$firstLineNumber,c=o.$breakpoints,d=o.$decorations,u=o.gutterRenderer||this.$renderer,p=this.$showFoldWidgets&&o.foldWidgets,m=i?i.start.row:Number.MAX_VALUE,g="ace_gutter-cell ",d=(this.$highlightGutterLine&&(n==this.$cursorRow||i&&n<this.$cursorRow&&m<=n&&this.$cursorRow<=i.end.row)&&(g+="ace_gutter-active-line ",this.$cursorCell!=e)&&(this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ","")),this.$cursorCell=e),c[n]&&(g+=c[n]),d[n]&&(g+=d[n]),this.$annotations[n]&&(g+=this.$annotations[n].className),s.className!=g&&(s.className=g),(r=p&&null==(r=p[n])?p[n]=o.getFoldWidget(n):r)?(g="ace_fold-widget ace_"+r,"start"==r&&n==m&&n<i.end.row?g+=" ace_closed":g+=" ace_open",l.className!=g&&(l.className=g),c=t.lineHeight+"px",f.setStyle(l.style,"height",c),f.setStyle(l.style,"display","inline-block")):l&&f.setStyle(l.style,"display","none"),(u?u.getText(o,n):n+h).toString());return d!==a.data&&(a.data=d),f.setStyle(e.element.style,"height",this.$lines.computeLineHeight(n,t,o)+"px"),f.setStyle(e.element.style,"top",this.$lines.computeLineTop(n,t,o)+"px"),e.text=d,e},this.$fixedWidth=!1,this.$highlightGutterLine=!0,this.$renderer="",this.setHighlightGutterLine=function(e){this.$highlightGutterLine=e},this.$showLineNumbers=!0,this.$renderer="",this.setShowLineNumbers=function(e){this.$renderer=!e&&{getWidth:function(){return 0},getText:function(){return""}}},this.getShowLineNumbers=function(){return this.$showLineNumbers},this.$showFoldWidgets=!0,this.setShowFoldWidgets=function(e){e?f.addCssClass(this.element,"ace_folding-enabled"):f.removeCssClass(this.element,"ace_folding-enabled"),this.$showFoldWidgets=e,this.$padding=null},this.getShowFoldWidgets=function(){return this.$showFoldWidgets},this.$computePadding=function(){var e;return this.element.firstChild?(e=f.computedStyle(this.element.firstChild),this.$padding={},this.$padding.left=(parseInt(e.borderLeftWidth)||0)+(parseInt(e.paddingLeft)||0)+1,this.$padding.right=(parseInt(e.borderRightWidth)||0)+(parseInt(e.paddingRight)||0),this.$padding):{left:0,right:0}},this.getRegion=function(e){var t=this.$padding||this.$computePadding(),i=this.element.getBoundingClientRect();return e.x<t.left+i.left?"markers":this.$showFoldWidgets&&e.x>i.right-t.right?"foldWidgets":void 0}}).call(n.prototype),t.Gutter=n}),ace.define("ace/layer/marker",["require","exports","module","ace/range","ace/lib/dom"],function(e,t,i){"use strict";function n(e){this.element=r.createElement("div"),this.element.className="ace_layer ace_marker-layer",e.appendChild(this.element)}var p=e("../range").Range,r=e("../lib/dom");(function(){this.$padding=0,this.setPadding=function(e){this.$padding=e},this.setSession=function(e){this.session=e},this.setMarkers=function(e){this.markers=e},this.elt=function(e,t){var i=-1!=this.i&&this.element.childNodes[this.i];i?this.i++:(i=document.createElement("div"),this.element.appendChild(i),this.i=-1),i.style.cssText=t,i.className=e},this.update=function(e){if(e){var t,i;for(i in this.config=e,this.i=0,this.markers){var n,r,s,o=this.markers[i];o.range?(s=o.range.clipRows(e.firstRow,e.lastRow)).isEmpty()||(s=s.toScreenRange(this.session),o.renderer?(n=this.$getTop(s.start.row,e),r=this.$padding+s.start.column*e.characterWidth,o.renderer(t,s,r,n,e)):"fullLine"==o.type?this.drawFullLineMarker(t,s,o.clazz,e):"screenLine"==o.type?this.drawScreenLineMarker(t,s,o.clazz,e):s.isMultiLine()?"text"==o.type?this.drawTextMarker(t,s,o.clazz,e):this.drawMultiLineMarker(t,s,o.clazz,e):this.drawSingleLineMarker(t,s,o.clazz+" ace_start ace_br15",e)):o.update(t,this,this.session,e)}if(-1!=this.i)for(;this.i<this.element.childElementCount;)this.element.removeChild(this.element.lastChild)}},this.$getTop=function(e,t){return(e-t.firstRowScreen)*t.lineHeight},this.drawTextMarker=function(e,t,i,n,r){for(var s,o=this.session,a=t.start.row,l=t.end.row,h=a,c=0,d=o.getScreenLastRowColumn(h),u=new p(h,t.start.column,h,c);h<=l;h++)u.start.row=u.end.row=h,u.start.column=h==a?t.start.column:o.getRowWrapIndent(h),u.end.column=d,s=c,c=d,d=h+1<l?o.getScreenLastRowColumn(h+1):h==l?0:t.end.column,this.drawSingleLineMarker(e,u,i+(h==a?" ace_start":"")+" ace_br"+((h==a||h==a+1&&t.start.column?1:0)|(s<c?2:0)|(d<c?4:0)|(h==l?8:0)),n,h==l?0:1,r)},this.drawMultiLineMarker=function(e,t,i,n,r){var s,o=this.$padding,a=n.lineHeight,l=this.$getTop(t.start.row,n),h=o+t.start.column*n.characterWidth;r=r||"",this.session.$bidiHandler.isBidiRow(t.start.row)?((s=t.clone()).end.row=s.start.row,s.end.column=this.session.getLine(s.start.row).length,this.drawBidiSingleLineMarker(e,s,i+" ace_br1 ace_start",n,null,r)):this.elt(i+" ace_br1 ace_start","height:"+a+"px;right:0;top:"+l+"px;left:"+h+"px;"+(r||"")),this.session.$bidiHandler.isBidiRow(t.end.row)?((s=t.clone()).start.row=s.end.row,s.start.column=0,this.drawBidiSingleLineMarker(e,s,i+" ace_br12",n,null,r)):(l=this.$getTop(t.end.row,n),h=t.end.column*n.characterWidth,this.elt(i+" ace_br12","height:"+a+"px;width:"+h+"px;top:"+l+"px;left:"+o+"px;"+(r||""))),(a=(t.end.row-t.start.row-1)*n.lineHeight)<=0||(l=this.$getTop(t.start.row+1,n),e=(t.start.column?1:0)|(t.end.column?0:8),this.elt(i+(e?" ace_br"+e:""),"height:"+a+"px;right:0;top:"+l+"px;left:"+o+"px;"+(r||"")))},this.drawSingleLineMarker=function(e,t,i,n,r,s){if(this.session.$bidiHandler.isBidiRow(t.start.row))return this.drawBidiSingleLineMarker(e,t,i,n,r,s);var e=n.lineHeight,r=(t.end.column+(r||0)-t.start.column)*n.characterWidth,o=this.$getTop(t.start.row,n),t=this.$padding+t.start.column*n.characterWidth;this.elt(i,"height:"+e+"px;width:"+r+"px;top:"+o+"px;left:"+t+"px;"+(s||""))},this.drawBidiSingleLineMarker=function(e,t,i,n,r,s){var o=n.lineHeight,a=this.$getTop(t.start.row,n),l=this.$padding;this.session.$bidiHandler.getSelections(t.start.column,t.end.column).forEach(function(e){this.elt(i,"height:"+o+"px;width:"+e.width+(r||0)+"px;top:"+a+"px;left:"+(l+e.left)+"px;"+(s||""))},this)},this.drawFullLineMarker=function(e,t,i,n,r){var s=this.$getTop(t.start.row,n),o=n.lineHeight;t.start.row!=t.end.row&&(o+=this.$getTop(t.end.row,n)-s),this.elt(i,"height:"+o+"px;top:"+s+"px;left:0;right:0;"+(r||""))},this.drawScreenLineMarker=function(e,t,i,n,r){t=this.$getTop(t.start.row,n),n=n.lineHeight;this.elt(i,"height:"+n+"px;top:"+t+"px;left:0;right:0;"+(r||""))}}).call(n.prototype),t.Marker=n}),ace.define("ace/layer/text",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/layer/lines","ace/lib/event_emitter"],function(e,t,i){"use strict";function n(e){this.dom=h,this.element=this.dom.createElement("div"),this.element.className="ace_layer ace_text-layer",e.appendChild(this.element),this.$updateEolChar=this.$updateEolChar.bind(this),this.$lines=new s(this.element)}var r=e("../lib/oop"),h=e("../lib/dom"),v=e("../lib/lang"),s=e("./lines").Lines,o=e("../lib/event_emitter").EventEmitter;(function(){r.implement(this,o),this.EOF_CHAR="¶",this.EOL_CHAR_LF="¬",this.EOL_CHAR_CRLF="¤",this.EOL_CHAR=this.EOL_CHAR_LF,this.TAB_CHAR="—",this.SPACE_CHAR="·",this.$padding=0,this.MAX_LINE_LENGTH=1e4,this.$updateEolChar=function(){var e=this.session.doc,e="\n"==e.getNewLineCharacter()&&"windows"!=e.getNewLineMode()?this.EOL_CHAR_LF:this.EOL_CHAR_CRLF;if(this.EOL_CHAR!=e)return this.EOL_CHAR=e,!0},this.setPadding=function(e){this.$padding=e,this.element.style.margin="0 "+e+"px"},this.getLineHeight=function(){return this.$fontMetrics.$characterSize.height||0},this.getCharacterWidth=function(){return this.$fontMetrics.$characterSize.width||0},this.$setFontMetrics=function(e){this.$fontMetrics=e,this.$fontMetrics.on("changeCharacterSize",function(e){this._signal("changeCharacterSize",e)}.bind(this)),this.$pollSizeChanges()},this.checkForSizeChanges=function(){this.$fontMetrics.checkForSizeChanges()},this.$pollSizeChanges=function(){return this.$pollSizeChangesTimer=this.$fontMetrics.$pollSizeChanges()},this.setSession=function(e){(this.session=e)&&this.$computeTabString()},this.showInvisibles=!1,this.showSpaces=!1,this.showTabs=!1,this.showEOL=!1,this.setShowInvisibles=function(e){return this.showInvisibles!=e&&("string"==typeof(this.showInvisibles=e)?(this.showSpaces=/tab/i.test(e),this.showTabs=/space/i.test(e),this.showEOL=/eol/i.test(e)):this.showSpaces=this.showTabs=this.showEOL=e,this.$computeTabString(),!0)},this.displayIndentGuides=!0,this.setDisplayIndentGuides=function(e){return this.displayIndentGuides!=e&&(this.displayIndentGuides=e,this.$computeTabString(),!0)},this.$tabStrings=[],this.onChangeTabSize=this.$computeTabString=function(){for(var e,t,i,n,r,s,o=this.session.getTabSize(),a=(this.tabSize=o,this.$tabStrings=[0]),l=1;l<o+1;l++)this.showTabs?((s=this.dom.createElement("span")).className="ace_invisible ace_invisible_tab",s.textContent=v.stringRepeat(this.TAB_CHAR,l),a.push(s)):a.push(this.dom.createTextNode(v.stringRepeat(" ",l),this.element));this.displayIndentGuides&&(this.$indentGuideRe=/\s\S| \t|\t |\s$/,e="ace_indent-guide",t=this.showSpaces?" ace_invisible ace_invisible_space":"",i=this.showSpaces?v.stringRepeat(this.SPACE_CHAR,this.tabSize):v.stringRepeat(" ",this.tabSize),n=this.showTabs?" ace_invisible ace_invisible_tab":"",r=this.showTabs?v.stringRepeat(this.TAB_CHAR,this.tabSize):i,(s=this.dom.createElement("span")).className=e+t,s.textContent=i,this.$tabStrings[" "]=s,(s=this.dom.createElement("span")).className=e+n,s.textContent=r,this.$tabStrings["\t"]=s)},this.updateLines=function(e,t,i){if(this.config.lastRow!=e.lastRow||this.config.firstRow!=e.firstRow)return this.update(e);this.config=e;for(var n=Math.max(t,e.firstRow),r=Math.min(i,e.lastRow),s=this.element.childNodes,o=0,a=e.firstRow;a<n;a++){if(l=this.session.getFoldLine(a)){if(l.containsRow(n)){n=l.start.row;break}a=l.end.row}o++}for(var l,h=!1,a=n,c=(l=this.session.getNextFoldLine(a))?l.start.row:1/0;c<a&&(a=l.end.row+1,c=(l=this.session.getNextFoldLine(a,l))?l.start.row:1/0),!(r<a);){var d,u=s[o++];u&&(this.dom.removeChildren(u),this.$renderLine(u,a,a==c&&l),h&&(u.style.top=this.$lines.computeLineTop(a,e,this.session)+"px"),d=e.lineHeight*this.session.getRowLength(a)+"px",u.style.height!=d)&&(h=!0,u.style.height=d),a++}if(h)for(;o<this.$lines.cells.length;){var p=this.$lines.cells[o++];p.element.style.top=this.$lines.computeLineTop(p.row,e,this.session)+"px"}},this.scrollLines=function(e){var t=this.config;if(this.config=e,this.$lines.pageChanged(t,e))return this.update(e);this.$lines.moveContainer(e);var i=e.lastRow,n=t?t.lastRow:-1;if(!t||n<e.firstRow)return this.update(e);if(i<t.firstRow)return this.update(e);if(!t||t.lastRow<e.firstRow)return this.update(e);if(e.lastRow<t.firstRow)return this.update(e);if(t.firstRow<e.firstRow)for(var r=this.session.getFoldedRowCount(t.firstRow,e.firstRow-1);0<r;r--)this.$lines.shift();if(t.lastRow>e.lastRow)for(r=this.session.getFoldedRowCount(e.lastRow+1,t.lastRow);0<r;r--)this.$lines.pop();e.firstRow<t.firstRow&&this.$lines.unshift(this.$renderLinesFragment(e,e.firstRow,t.firstRow-1)),e.lastRow>t.lastRow&&this.$lines.push(this.$renderLinesFragment(e,t.lastRow+1,e.lastRow))},this.$renderLinesFragment=function(e,t,i){for(var n=[],r=t,s=this.session.getNextFoldLine(r),o=s?s.start.row:1/0;o<r&&(r=s.end.row+1,o=(s=this.session.getNextFoldLine(r,s))?s.start.row:1/0),!(i<r);){var a=this.$lines.createCell(r,e,this.session),l=a.element;this.dom.removeChildren(l),h.setStyle(l.style,"height",this.$lines.computeLineHeight(r,e,this.session)+"px"),h.setStyle(l.style,"top",this.$lines.computeLineTop(r,e,this.session)+"px"),this.$renderLine(l,r,r==o&&s),this.$useLineGroups()?l.className="ace_line_group":l.className="ace_line",n.push(a),r++}return n},this.update=function(e){this.$lines.moveContainer(e);for(var t=(this.config=e).firstRow,i=e.lastRow,n=this.$lines;n.getLength();)n.pop();n.push(this.$renderLinesFragment(e,t,i))},this.$textToken={text:!0,rparen:!0,lparen:!0},this.$renderToken=function(e,t,i,n){for(var r,s,o=this,a=/(\t)|( +)|([\x00-\x1f\x80-\xa0\xad\u1680\u180E\u2000-\u200f\u2028\u2029\u202F\u205F\uFEFF\uFFF9-\uFFFC]+)|(\u3000)|([\u1100-\u115F\u11A3-\u11A7\u11FA-\u11FF\u2329-\u232A\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3001-\u303E\u3041-\u3096\u3099-\u30FF\u3105-\u312D\u3131-\u318E\u3190-\u31BA\u31C0-\u31E3\u31F0-\u321E\u3220-\u3247\u3250-\u32FE\u3300-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFAFF\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFF01-\uFF60\uFFE0-\uFFE6]|[\uD800-\uDBFF][\uDC00-\uDFFF])/g,l=this.dom.createFragment(this.element),h=0;r=a.exec(n);){var c,d,u=r[1],p=r[2],m=r[3],g=r[4],f=r[5];!o.showSpaces&&p||(c=h!=r.index?n.slice(h,r.index):"",h=r.index+r[0].length,c&&l.appendChild(this.dom.createTextNode(c,this.element)),u?(c=o.session.getScreenTabSize(t+r.index),l.appendChild(o.$tabStrings[c].cloneNode(!0)),t+=c-1):p?o.showSpaces?((d=this.dom.createElement("span")).className="ace_invisible ace_invisible_space",d.textContent=v.stringRepeat(o.SPACE_CHAR,p.length),l.appendChild(d)):l.appendChild(this.com.createTextNode(p,this.element)):m?((d=this.dom.createElement("span")).className="ace_invisible ace_invisible_space ace_invalid",d.textContent=v.stringRepeat(o.SPACE_CHAR,m.length),l.appendChild(d)):g?(t+=1,(d=this.dom.createElement("span")).style.width=2*o.config.characterWidth+"px",d.className=o.showSpaces?"ace_cjk ace_invisible ace_invisible_space":"ace_cjk",d.textContent=o.showSpaces?o.SPACE_CHAR:g,l.appendChild(d)):f&&(t+=1,(d=this.dom.createElement("span")).style.width=2*o.config.characterWidth+"px",d.className="ace_cjk",d.textContent=f,l.appendChild(d)))}return l.appendChild(this.dom.createTextNode(h?n.slice(h):n,this.element)),this.$textToken[i.type]?e.appendChild(l):(s="ace_"+i.type.replace(/\./g," ace_"),d=this.dom.createElement("span"),"fold"==i.type&&(d.style.width=i.value.length*this.config.characterWidth+"px"),d.className=s,d.appendChild(l),e.appendChild(d)),t+n.length},this.renderIndentGuide=function(e,t,i){var n=t.search(this.$indentGuideRe);if(n<=0||i<=n)return t;if(" "==t[0])for(var r=(n-=n%this.tabSize)/this.tabSize,s=0;s<r;s++)e.appendChild(this.$tabStrings[" "].cloneNode(!0));else{if("\t"!=t[0])return t;for(s=0;s<n;s++)e.appendChild(this.$tabStrings["\t"].cloneNode(!0))}return t.substr(n)},this.$createLineElement=function(e){var t=this.dom.createElement("div");return t.className="ace_line",t.style.height=this.config.lineHeight+"px",t},this.$renderWrappedLine=function(e,t,i){var n=0,r=0,s=i[0],o=0,a=this.$createLineElement();e.appendChild(a);for(var l=0;l<t.length;l++){var h=t[l],c=h.value;if(0==l&&this.displayIndentGuides){if(n=c.length,!(c=this.renderIndentGuide(a,c,s)))continue;n-=c.length}if(n+c.length<s)o=this.$renderToken(a,o,h,c),n+=c.length;else{for(;n+c.length>=s;)o=this.$renderToken(a,o,h,c.substring(0,s-n)),c=c.substring(s-n),n=s,a=this.$createLineElement(),e.appendChild(a),a.appendChild(this.dom.createTextNode(v.stringRepeat(" ",i.indent),this.element)),o=0,s=i[++r]||Number.MAX_VALUE;0!=c.length&&(n+=c.length,o=this.$renderToken(a,o,h,c))}}i[i.length-1]>this.MAX_LINE_LENGTH&&this.$renderOverflowMessage(a,o,null,"",!0)},this.$renderSimpleLine=function(e,t){var i=0,n=t[0],r=n.value;(r=this.displayIndentGuides?this.renderIndentGuide(e,r):r)&&(i=this.$renderToken(e,i,n,r));for(var s=1;s<t.length;s++){if(i+(r=(n=t[s]).value).length>this.MAX_LINE_LENGTH)return this.$renderOverflowMessage(e,i,n,r);i=this.$renderToken(e,i,n,r)}},this.$renderOverflowMessage=function(e,t,i,n,r){i&&this.$renderToken(e,t,i,n.slice(0,this.MAX_LINE_LENGTH-t));i=this.dom.createElement("span");i.className="ace_inline_button ace_keyword ace_toggle_wrap",i.textContent=r?"<hide>":"<click to see more...>",e.appendChild(i)},this.$renderLine=function(e,t,i){var n,r,s=e;(n=(i=i||0==i?i:this.session.getFoldLine(t))?this.$getFoldLineTokens(t,i):this.session.getTokens(t)).length?(r=this.session.getRowSplitData(t))&&r.length?(this.$renderWrappedLine(e,n,r),s=e.lastChild):(s=e,this.$useLineGroups()&&(s=this.$createLineElement(),e.appendChild(s)),this.$renderSimpleLine(s,n)):this.$useLineGroups()&&(s=this.$createLineElement(),e.appendChild(s)),this.showEOL&&s&&(i&&(t=i.end.row),(r=this.dom.createElement("span")).className="ace_invisible ace_invisible_eol",r.textContent=t==this.session.getLength()-1?this.EOF_CHAR:this.EOL_CHAR,s.appendChild(r))},this.$getFoldLineTokens=function(e,t){var d=this.session,u=[],p=d.getTokens(e);return t.walk(function(e,t,i,n,r){if(null!=e)u.push({type:"fold",value:e});else if((p=r?d.getTokens(t):p).length){for(var s,o=p,a=n,l=i,h=0,c=0;c+o[h].value.length<a;)if(c+=o[h].value.length,++h==o.length)return;for(c!=a&&((s=o[h].value.substring(a-c)).length>l-a&&(s=s.substring(0,l-a)),u.push({type:o[h].type,value:s}),c=a+s.length,h+=1);c<l&&h<o.length;)(s=o[h].value).length+c>l?u.push({type:o[h].type,value:s.substring(0,l-c)}):u.push(o[h]),c+=s.length,h+=1}},t.end.row,this.session.getLine(t.end.row).length),u},this.$useLineGroups=function(){return this.session.getUseWrapMode()},this.destroy=function(){}}).call(n.prototype),t.Text=n}),ace.define("ace/layer/cursor",["require","exports","module","ace/lib/dom"],function(e,t,i){"use strict";function n(e){this.element=h.createElement("div"),this.element.className="ace_layer ace_cursor-layer",e.appendChild(this.element),this.isVisible=!1,this.isBlinking=!0,this.blinkInterval=1e3,this.smoothBlinking=!1,this.cursors=[],this.cursor=this.addCursor(),h.addCssClass(this.element,"ace_hidden-cursors"),this.$updateCursors=this.$updateOpacity.bind(this)}var h=e("../lib/dom");(function(){this.$updateOpacity=function(e){for(var t=this.cursors,i=t.length;i--;)h.setStyle(t[i].style,"opacity",e?"":"0")},this.$startCssAnimation=function(){for(var e=this.cursors,t=e.length;t--;)e[t].style.animationDuration=this.blinkInterval+"ms";setTimeout(function(){h.addCssClass(this.element,"ace_animate-blinking")}.bind(this))},this.$stopCssAnimation=function(){h.removeCssClass(this.element,"ace_animate-blinking")},this.$padding=0,this.setPadding=function(e){this.$padding=e},this.setSession=function(e){this.session=e},this.setBlinking=function(e){e!=this.isBlinking&&(this.isBlinking=e,this.restartTimer())},this.setBlinkInterval=function(e){e!=this.blinkInterval&&(this.blinkInterval=e,this.restartTimer())},this.setSmoothBlinking=function(e){e!=this.smoothBlinking&&(this.smoothBlinking=e,h.setCssClass(this.element,"ace_smooth-blinking",e),this.$updateCursors(!0),this.restartTimer())},this.addCursor=function(){var e=h.createElement("div");return e.className="ace_cursor",this.element.appendChild(e),this.cursors.push(e),e},this.removeCursor=function(){var e;if(1<this.cursors.length)return(e=this.cursors.pop()).parentNode.removeChild(e),e},this.hideCursor=function(){this.isVisible=!1,h.addCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},this.showCursor=function(){this.isVisible=!0,h.removeCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},this.restartTimer=function(){var e,t=this.$updateCursors;clearInterval(this.intervalId),clearTimeout(this.timeoutId),this.$stopCssAnimation(),this.smoothBlinking&&h.removeCssClass(this.element,"ace_smooth-blinking"),t(!0),this.isBlinking&&this.blinkInterval&&this.isVisible?(this.smoothBlinking&&setTimeout(function(){h.addCssClass(this.element,"ace_smooth-blinking")}.bind(this)),h.HAS_CSS_ANIMATION?this.$startCssAnimation():(e=function(){this.timeoutId=setTimeout(function(){t(!1)},.6*this.blinkInterval)}.bind(this),this.intervalId=setInterval(function(){t(!0),e()},this.blinkInterval),e())):this.$stopCssAnimation()},this.getPixelPosition=function(e,t){if(!this.config||!this.session)return{left:0,top:0};e=e||this.session.selection.getCursor();var i=this.session.documentToScreenPosition(e);return{left:this.$padding+(this.session.$bidiHandler.isBidiRow(i.row,e.row)?this.session.$bidiHandler.getPosLeft(i.column):i.column*this.config.characterWidth),top:(i.row-(t?this.config.firstRowScreen:0))*this.config.lineHeight}},this.isCursorInView=function(e,t){return 0<=e.top&&e.top<t.maxHeight},this.update=function(e){this.config=e;for(var t=this.session.$selectionMarkers,i=0,n=0,i=0,r=(t=void 0!==t&&0!==t.length?t:[{cursor:null}]).length;i<r;i++){var s,o,a=this.getPixelPosition(t[i].cursor,!0);(a.top>e.height+e.offset||a.top<0)&&1<i||(o=(s=this.cursors[n++]||this.addCursor()).style,this.drawCursor?this.drawCursor(s,a,e,t[i],this.session):this.isCursorInView(a,e)?(h.setStyle(o,"display","block"),h.translate(s,a.left,a.top),h.setStyle(o,"width",Math.round(e.characterWidth)+"px"),h.setStyle(o,"height",e.lineHeight+"px")):h.setStyle(o,"display","none"))}for(;this.cursors.length>n;)this.removeCursor();var l=this.session.getOverwrite();this.$setOverwrite(l),this.$pixelPos=a,this.restartTimer()},this.drawCursor=null,this.$setOverwrite=function(e){e!=this.overwrite&&((this.overwrite=e)?h.addCssClass(this.element,"ace_overwrite-cursors"):h.removeCssClass(this.element,"ace_overwrite-cursors"))},this.destroy=function(){clearInterval(this.intervalId),clearTimeout(this.timeoutId)}}).call(n.prototype),t.Cursor=n}),ace.define("ace/scrollbar",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],function(e,t,i){"use strict";function n(e){this.element=a.createElement("div"),this.element.className="ace_scrollbar ace_scrollbar"+this.classSuffix,this.inner=a.createElement("div"),this.inner.className="ace_scrollbar-inner",this.inner.textContent=" ",this.element.appendChild(this.inner),e.appendChild(this.element),this.setVisible(!1),this.skipEvent=!1,l.addListener(this.element,"scroll",this.onScroll.bind(this)),l.addListener(this.element,"mousedown",l.preventDefault)}function r(e,t){n.call(this,e),this.scrollTop=0,this.scrollHeight=0,t.$scrollbarWidth=this.width=a.scrollbarWidth(e.ownerDocument),this.inner.style.width=this.element.style.width=(this.width||15)+5+"px",this.$minWidth=0}function s(e,t){n.call(this,e),this.scrollLeft=0,this.height=t.$scrollbarWidth,this.inner.style.height=this.element.style.height=(this.height||15)+5+"px"}var o=e("./lib/oop"),a=e("./lib/dom"),l=e("./lib/event"),h=e("./lib/event_emitter").EventEmitter;!function(){o.implement(this,h),this.setVisible=function(e){this.element.style.display=e?"":"none",this.isVisible=e,this.coeff=1}}.call(n.prototype),o.inherits(r,n),function(){this.classSuffix="-v",this.onScroll=function(){var e;this.skipEvent||(this.scrollTop=this.element.scrollTop,1!=this.coeff&&(e=this.element.clientHeight/this.scrollHeight,this.scrollTop=this.scrollTop*(1-e)/(this.coeff-e)),this._emit("scroll",{data:this.scrollTop})),this.skipEvent=!1},this.getWidth=function(){return Math.max(this.isVisible?this.width:0,this.$minWidth||0)},this.setHeight=function(e){this.element.style.height=e+"px"},this.setInnerHeight=this.setScrollHeight=function(e){32768<(this.scrollHeight=e)?(this.coeff=32768/e,e=32768):1!=this.coeff&&(this.coeff=1),this.inner.style.height=e+"px"},this.setScrollTop=function(e){this.scrollTop!=e&&(this.skipEvent=!0,this.scrollTop=e,this.element.scrollTop=e*this.coeff)}}.call(r.prototype);o.inherits(s,n),function(){this.classSuffix="-h",this.onScroll=function(){this.skipEvent||(this.scrollLeft=this.element.scrollLeft,this._emit("scroll",{data:this.scrollLeft})),this.skipEvent=!1},this.getHeight=function(){return this.isVisible?this.height:0},this.setWidth=function(e){this.element.style.width=e+"px"},this.setInnerWidth=function(e){this.inner.style.width=e+"px"},this.setScrollWidth=function(e){this.inner.style.width=e+"px"},this.setScrollLeft=function(e){this.scrollLeft!=e&&(this.skipEvent=!0,this.scrollLeft=this.element.scrollLeft=e)}}.call(s.prototype),t.ScrollBar=r,t.ScrollBarV=r,t.ScrollBarH=s,t.VScrollBar=r,t.HScrollBar=s}),ace.define("ace/renderloop",["require","exports","module","ace/lib/event"],function(e,t,i){"use strict";function n(e,t){this.onRender=e,this.pending=!1,this.changes=0,this.$recursionLimit=2,this.window=t||window;var i=this;this._flush=function(e){i.pending=!1;var t=i.changes;t&&(r.blockIdle(100),i.changes=0,i.onRender(t)),i.changes?i.$recursionLimit--<0||i.schedule():i.$recursionLimit=2}}var r=e("./lib/event");(function(){this.schedule=function(e){this.changes=this.changes|e,this.changes&&!this.pending&&(r.nextFrame(this._flush),this.pending=!0)},this.clear=function(e){var t=this.changes;return this.changes=0,t}}).call(n.prototype),t.RenderLoop=n}),ace.define("ace/layer/font_metrics",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/lib/event","ace/lib/useragent","ace/lib/event_emitter"],function(e,t,i){var n=e("../lib/oop"),r=e("../lib/dom"),s=e("../lib/lang"),o=e("../lib/event"),a=e("../lib/useragent"),l=e("../lib/event_emitter").EventEmitter,h="function"==typeof ResizeObserver,e=t.FontMetrics=function(e){this.el=r.createElement("div"),this.$setMeasureNodeStyles(this.el.style,!0),this.$main=r.createElement("div"),this.$setMeasureNodeStyles(this.$main.style),this.$measureNode=r.createElement("div"),this.$setMeasureNodeStyles(this.$measureNode.style),this.el.appendChild(this.$main),this.el.appendChild(this.$measureNode),e.appendChild(this.el),this.$measureNode.textContent=s.stringRepeat("X",256),this.$characterSize={width:0,height:0},h?this.$addObserver():this.checkForSizeChanges()};!function(){n.implement(this,l),this.$characterSize={width:0,height:0},this.$setMeasureNodeStyles=function(e,t){e.width=e.height="auto",e.left=e.top="0px",e.visibility="hidden",e.position="absolute",e.whiteSpace="pre",a.isIE<8?e["font-family"]="inherit":e.font="inherit",e.overflow=t?"hidden":"visible"},this.checkForSizeChanges=function(e){var t;!(e=void 0===e?this.$measureSizes():e)||this.$characterSize.width===e.width&&this.$characterSize.height===e.height||(this.$measureNode.style.fontWeight="bold",t=this.$measureSizes(),this.$measureNode.style.fontWeight="",this.$characterSize=e,this.charSizes=Object.create(null),this.allowBoldFonts=t&&t.width===e.width&&t.height===e.height,this._emit("changeCharacterSize",{data:e}))},this.$addObserver=function(){var t=this;this.$observer=new window.ResizeObserver(function(e){t.checkForSizeChanges()}),this.$observer.observe(this.$measureNode)},this.$pollSizeChanges=function(){var t;return this.$pollSizeChangesTimer||this.$observer?this.$pollSizeChangesTimer:(t=this).$pollSizeChangesTimer=o.onIdle(function e(){t.checkForSizeChanges(),o.onIdle(e,500)},500)},this.setPolling=function(e){e?this.$pollSizeChanges():this.$pollSizeChangesTimer&&(clearInterval(this.$pollSizeChangesTimer),this.$pollSizeChangesTimer=0)},this.$measureSizes=function(e){e={height:(e||this.$measureNode).clientHeight,width:(e||this.$measureNode).clientWidth/256};return 0===e.width||0===e.height?null:e},this.$measureCharWidth=function(e){return this.$main.textContent=s.stringRepeat(e,256),this.$main.getBoundingClientRect().width/256},this.getCharacterWidth=function(e){var t=this.charSizes[e];return t=void 0===t?this.charSizes[e]=this.$measureCharWidth(e)/this.$characterSize.width:t},this.destroy=function(){clearInterval(this.$pollSizeChangesTimer),this.$observer&&this.$observer.disconnect(),this.el&&this.el.parentNode&&this.el.parentNode.removeChild(this.el)},this.$getZoom=function e(t){return t&&t.parentElement?(window.getComputedStyle(t).zoom||1)*e(t.parentElement):1},this.$initTransformMeasureNodes=function(){function e(e,t){return["div",{style:"position: absolute;top:"+e+"px;left:"+t+"px;"}]}this.els=r.buildDom([e(0,0),e(200,0),e(0,200),e(200,200)],this.el)},this.transformCoordinates=function(e,t){function i(e,t,i){var n=e[1]*t[0]-e[0]*t[1];return[(-t[1]*i[0]+t[0]*i[1])/n,(+e[1]*i[0]-e[0]*i[1])/n]}function n(e,t){return[e[0]-t[0],e[1]-t[1]]}function r(e,t){return[e[0]+t[0],e[1]+t[1]]}function s(e,t){return[e*t[0],e*t[1]]}function o(e){e=e.getBoundingClientRect();return[e.left,e.top]}e=e&&s(1/this.$getZoom(this.el),e),this.els||this.$initTransformMeasureNodes();var a,l=o(this.els[0]),h=o(this.els[1]),c=o(this.els[2]),d=o(this.els[3]),d=i(n(d,h),n(d,c),n(r(h,c),r(d,l))),h=s(1+d[0],n(h,l)),c=s(1+d[1],n(c,l));return t?(a=d[0]*t[0]/200+d[1]*t[1]/200+1,t=r(s(t[0],h),s(t[1],c)),r(s(1/a/200,t),l)):(a=n(e,l),t=i(n(h,s(d[0],a)),n(c,s(d[1],a)),a),s(200,t))}}.call(e.prototype)}),ace.define("ace/virtual_renderer",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/config","ace/layer/gutter","ace/layer/marker","ace/layer/text","ace/layer/cursor","ace/scrollbar","ace/scrollbar","ace/renderloop","ace/layer/font_metrics","ace/lib/event_emitter","ace/lib/useragent"],function(e,t,i){"use strict";function n(e,t){var i=this,e=(this.container=e||a.createElement("div"),a.addCssClass(this.container,"ace_editor"),a.HI_DPI&&a.addCssClass(this.container,"ace_hidpi"),this.setTheme(t),this.$gutter=a.createElement("div"),this.$gutter.className="ace_gutter",this.container.appendChild(this.$gutter),this.$gutter.setAttribute("aria-hidden",!0),this.scroller=a.createElement("div"),this.scroller.className="ace_scroller",this.container.appendChild(this.scroller),this.content=a.createElement("div"),this.content.className="ace_content",this.scroller.appendChild(this.content),this.$gutterLayer=new o(this.$gutter),this.$gutterLayer.on("changeGutterWidth",this.onGutterResize.bind(this)),this.$markerBack=new l(this.content),this.$textLayer=new h(this.content));this.canvas=e.element,this.$markerFront=new l(this.content),this.$cursorLayer=new c(this.content),this.$horizScroll=!1,this.$vScroll=!1,this.scrollBar=this.scrollBarV=new u(this.container,this),this.scrollBarH=new d(this.container,this),this.scrollBarV.on("scroll",function(e){i.$scrollAnimation||i.session.setScrollTop(e.data-i.scrollMargin.top)}),this.scrollBarH.on("scroll",function(e){i.$scrollAnimation||i.session.setScrollLeft(e.data-i.scrollMargin.left)}),this.scrollTop=0,this.scrollLeft=0,this.cursorPos={row:0,column:0},this.$fontMetrics=new m(this.container),this.$textLayer.$setFontMetrics(this.$fontMetrics),this.$textLayer.on("changeCharacterSize",function(e){i.updateCharacterSize(),i.onResize(!0,i.gutterWidth,i.$size.width,i.$size.height),i._signal("changeCharacterSize",e)}),this.$size={width:0,height:0,scrollerHeight:0,scrollerWidth:0,$dirty:!0},this.layerConfig={width:1,padding:0,firstRow:0,firstRowScreen:0,lastRow:0,lineHeight:0,characterWidth:0,minHeight:1,maxHeight:1,offset:0,height:1,gutterOffset:1},this.scrollMargin={left:0,right:0,top:0,bottom:0,v:0,h:0},this.margin={left:0,right:0,top:0,bottom:0,v:0,h:0},this.$keepTextAreaAtCursor=!v.isIOS,this.$loop=new p(this.$renderChanges.bind(this),this.container.ownerDocument.defaultView),this.$loop.schedule(this.CHANGE_FULL),this.updateCharacterSize(),this.setPadding(4),s.resetOptions(this),s._signal("renderer",this)}var r=e("./lib/oop"),a=e("./lib/dom"),s=e("./config"),o=e("./layer/gutter").Gutter,l=e("./layer/marker").Marker,h=e("./layer/text").Text,c=e("./layer/cursor").Cursor,d=e("./scrollbar").HScrollBar,u=e("./scrollbar").VScrollBar,p=e("./renderloop").RenderLoop,m=e("./layer/font_metrics").FontMetrics,g=e("./lib/event_emitter").EventEmitter,f='.ace_br1 {border-top-left-radius : 3px;}.ace_br2 {border-top-right-radius : 3px;}.ace_br3 {border-top-left-radius : 3px; border-top-right-radius: 3px;}.ace_br4 {border-bottom-right-radius: 3px;}.ace_br5 {border-top-left-radius : 3px; border-bottom-right-radius: 3px;}.ace_br6 {border-top-right-radius : 3px; border-bottom-right-radius: 3px;}.ace_br7 {border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px;}.ace_br8 {border-bottom-left-radius : 3px;}.ace_br9 {border-top-left-radius : 3px; border-bottom-left-radius: 3px;}.ace_br10{border-top-right-radius : 3px; border-bottom-left-radius: 3px;}.ace_br11{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br12{border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br13{border-top-left-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br14{border-top-right-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br15{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_editor {position: relative;overflow: hidden;padding: 0;font: 12px/normal \'Monaco\', \'Menlo\', \'Ubuntu Mono\', \'Consolas\', \'source-code-pro\', monospace;direction: ltr;text-align: left;-webkit-tap-highlight-color: rgba(0, 0, 0, 0);}.ace_scroller {position: absolute;overflow: hidden;top: 0;bottom: 0;background-color: inherit;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;cursor: text;}.ace_content {position: absolute;box-sizing: border-box;min-width: 100%;contain: style size layout;font-variant-ligatures: no-common-ligatures;}.ace_dragging .ace_scroller:before{position: absolute;top: 0;left: 0;right: 0;bottom: 0;content: \'\';background: rgba(250, 250, 250, 0.01);z-index: 1000;}.ace_dragging.ace_dark .ace_scroller:before{background: rgba(0, 0, 0, 0.01);}.ace_selecting, .ace_selecting * {cursor: text !important;}.ace_gutter {position: absolute;overflow : hidden;width: auto;top: 0;bottom: 0;left: 0;cursor: default;z-index: 4;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;contain: style size layout;}.ace_gutter-active-line {position: absolute;left: 0;right: 0;}.ace_scroller.ace_scroll-left {box-shadow: 17px 0 16px -16px rgba(0, 0, 0, 0.4) inset;}.ace_gutter-cell {position: absolute;top: 0;left: 0;right: 0;padding-left: 19px;padding-right: 6px;background-repeat: no-repeat;}.ace_gutter-cell.ace_error {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAABOFBMVEX/////////QRswFAb/Ui4wFAYwFAYwFAaWGAfDRymzOSH/PxswFAb/SiUwFAYwFAbUPRvjQiDllog5HhHdRybsTi3/Tyv9Tir+Syj/UC3////XurebMBIwFAb/RSHbPx/gUzfdwL3kzMivKBAwFAbbvbnhPx66NhowFAYwFAaZJg8wFAaxKBDZurf/RB6mMxb/SCMwFAYwFAbxQB3+RB4wFAb/Qhy4Oh+4QifbNRcwFAYwFAYwFAb/QRzdNhgwFAYwFAbav7v/Uy7oaE68MBK5LxLewr/r2NXewLswFAaxJw4wFAbkPRy2PyYwFAaxKhLm1tMwFAazPiQwFAaUGAb/QBrfOx3bvrv/VC/maE4wFAbRPBq6MRO8Qynew8Dp2tjfwb0wFAbx6eju5+by6uns4uH9/f36+vr/GkHjAAAAYnRSTlMAGt+64rnWu/bo8eAA4InH3+DwoN7j4eLi4xP99Nfg4+b+/u9B/eDs1MD1mO7+4PHg2MXa347g7vDizMLN4eG+Pv7i5evs/v79yu7S3/DV7/498Yv24eH+4ufQ3Ozu/v7+y13sRqwAAADLSURBVHjaZc/XDsFgGIBhtDrshlitmk2IrbHFqL2pvXf/+78DPokj7+Fz9qpU/9UXJIlhmPaTaQ6QPaz0mm+5gwkgovcV6GZzd5JtCQwgsxoHOvJO15kleRLAnMgHFIESUEPmawB9ngmelTtipwwfASilxOLyiV5UVUyVAfbG0cCPHig+GBkzAENHS0AstVF6bacZIOzgLmxsHbt2OecNgJC83JERmePUYq8ARGkJx6XtFsdddBQgZE2nPR6CICZhawjA4Fb/chv+399kfR+MMMDGOQAAAABJRU5ErkJggg==");background-repeat: no-repeat;background-position: 2px center;}.ace_gutter-cell.ace_warning {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAmVBMVEX///8AAAD///8AAAAAAABPSzb/5sAAAAB/blH/73z/ulkAAAAAAAD85pkAAAAAAAACAgP/vGz/rkDerGbGrV7/pkQICAf////e0IsAAAD/oED/qTvhrnUAAAD/yHD/njcAAADuv2r/nz//oTj/p064oGf/zHAAAAA9Nir/tFIAAAD/tlTiuWf/tkIAAACynXEAAAAAAAAtIRW7zBpBAAAAM3RSTlMAABR1m7RXO8Ln31Z36zT+neXe5OzooRDfn+TZ4p3h2hTf4t3k3ucyrN1K5+Xaks52Sfs9CXgrAAAAjklEQVR42o3PbQ+CIBQFYEwboPhSYgoYunIqqLn6/z8uYdH8Vmdnu9vz4WwXgN/xTPRD2+sgOcZjsge/whXZgUaYYvT8QnuJaUrjrHUQreGczuEafQCO/SJTufTbroWsPgsllVhq3wJEk2jUSzX3CUEDJC84707djRc5MTAQxoLgupWRwW6UB5fS++NV8AbOZgnsC7BpEAAAAABJRU5ErkJggg==");background-position: 2px center;}.ace_gutter-cell.ace_info {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAAAAAA6mKC9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAJ0Uk5TAAB2k804AAAAPklEQVQY02NgIB68QuO3tiLznjAwpKTgNyDbMegwisCHZUETUZV0ZqOquBpXj2rtnpSJT1AEnnRmL2OgGgAAIKkRQap2htgAAAAASUVORK5CYII=");background-position: 2px center;}.ace_dark .ace_gutter-cell.ace_info {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAJFBMVEUAAAChoaGAgIAqKiq+vr6tra1ZWVmUlJSbm5s8PDxubm56enrdgzg3AAAAAXRSTlMAQObYZgAAAClJREFUeNpjYMAPdsMYHegyJZFQBlsUlMFVCWUYKkAZMxZAGdxlDMQBAG+TBP4B6RyJAAAAAElFTkSuQmCC");}.ace_scrollbar {contain: strict;position: absolute;right: 0;bottom: 0;z-index: 6;}.ace_scrollbar-inner {position: absolute;cursor: text;left: 0;top: 0;}.ace_scrollbar-v{overflow-x: hidden;overflow-y: scroll;top: 0;}.ace_scrollbar-h {overflow-x: scroll;overflow-y: hidden;left: 0;}.ace_print-margin {position: absolute;height: 100%;}.ace_text-input {position: absolute;z-index: 0;width: 0.5em;height: 1em;opacity: 0;background: transparent;-moz-appearance: none;appearance: none;border: none;resize: none;outline: none;overflow: hidden;font: inherit;padding: 0 1px;margin: 0 -1px;contain: strict;-ms-user-select: text;-moz-user-select: text;-webkit-user-select: text;user-select: text;white-space: pre!important;}.ace_text-input.ace_composition {background: transparent;color: inherit;z-index: 1000;opacity: 1;}.ace_composition_placeholder { color: transparent }.ace_composition_marker { border-bottom: 1px solid;position: absolute;border-radius: 0;margin-top: 1px;}[ace_nocontext=true] {transform: none!important;filter: none!important;clip-path: none!important;mask : none!important;contain: none!important;perspective: none!important;mix-blend-mode: initial!important;z-index: auto;}.ace_layer {z-index: 1;position: absolute;overflow: hidden;word-wrap: normal;white-space: pre;height: 100%;width: 100%;box-sizing: border-box;pointer-events: none;}.ace_gutter-layer {position: relative;width: auto;text-align: right;pointer-events: auto;height: 1000000px;contain: style size layout;}.ace_text-layer {font: inherit !important;position: absolute;height: 1000000px;width: 1000000px;contain: style size layout;}.ace_text-layer > .ace_line, .ace_text-layer > .ace_line_group {contain: style size layout;position: absolute;top: 0;left: 0;right: 0;}.ace_hidpi .ace_text-layer,.ace_hidpi .ace_gutter-layer,.ace_hidpi .ace_content,.ace_hidpi .ace_gutter {contain: strict;will-change: transform;}.ace_hidpi .ace_text-layer > .ace_line, .ace_hidpi .ace_text-layer > .ace_line_group {contain: strict;}.ace_cjk {display: inline-block;text-align: center;}.ace_cursor-layer {z-index: 4;}.ace_cursor {z-index: 4;position: absolute;box-sizing: border-box;border-left: 2px solid;transform: translatez(0);}.ace_multiselect .ace_cursor {border-left-width: 1px;}.ace_slim-cursors .ace_cursor {border-left-width: 1px;}.ace_overwrite-cursors .ace_cursor {border-left-width: 0;border-bottom: 1px solid;}.ace_hidden-cursors .ace_cursor {opacity: 0.2;}.ace_hasPlaceholder .ace_hidden-cursors .ace_cursor {opacity: 0;}.ace_smooth-blinking .ace_cursor {transition: opacity 0.18s;}.ace_animate-blinking .ace_cursor {animation-duration: 1000ms;animation-timing-function: step-end;animation-name: blink-ace-animate;animation-iteration-count: infinite;}.ace_animate-blinking.ace_smooth-blinking .ace_cursor {animation-duration: 1000ms;animation-timing-function: ease-in-out;animation-name: blink-ace-animate-smooth;}@keyframes blink-ace-animate {from, to { opacity: 1; }60% { opacity: 0; }}@keyframes blink-ace-animate-smooth {from, to { opacity: 1; }45% { opacity: 1; }60% { opacity: 0; }85% { opacity: 0; }}.ace_marker-layer .ace_step, .ace_marker-layer .ace_stack {position: absolute;z-index: 3;}.ace_marker-layer .ace_selection {position: absolute;z-index: 5;}.ace_marker-layer .ace_bracket {position: absolute;z-index: 6;}.ace_marker-layer .ace_error_bracket {position: absolute;border-bottom: 1px solid #DE5555;border-radius: 0;}.ace_marker-layer .ace_active-line {position: absolute;z-index: 2;}.ace_marker-layer .ace_selected-word {position: absolute;z-index: 4;box-sizing: border-box;}.ace_line .ace_fold {box-sizing: border-box;display: inline-block;height: 11px;margin-top: -2px;vertical-align: middle;background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACJJREFUeNpi+P//fxgTAwPDBxDxD078RSX+YeEyDFMCIMAAI3INmXiwf2YAAAAASUVORK5CYII=");background-repeat: no-repeat, repeat-x;background-position: center center, top left;color: transparent;border: 1px solid black;border-radius: 2px;cursor: pointer;pointer-events: auto;}.ace_dark .ace_fold {}.ace_fold:hover{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACBJREFUeNpi+P//fz4TAwPDZxDxD5X4i5fLMEwJgAADAEPVDbjNw87ZAAAAAElFTkSuQmCC");}.ace_tooltip {background-color: #FFF;background-image: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.1));border: 1px solid gray;border-radius: 1px;box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);color: black;max-width: 100%;padding: 3px 4px;position: fixed;z-index: 999999;box-sizing: border-box;cursor: default;white-space: pre;word-wrap: break-word;line-height: normal;font-style: normal;font-weight: normal;letter-spacing: normal;pointer-events: none;}.ace_folding-enabled > .ace_gutter-cell {padding-right: 13px;}.ace_fold-widget {box-sizing: border-box;margin: 0 -12px 0 1px;display: none;width: 11px;vertical-align: top;background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42mWKsQ0AMAzC8ixLlrzQjzmBiEjp0A6WwBCSPgKAXoLkqSot7nN3yMwR7pZ32NzpKkVoDBUxKAAAAABJRU5ErkJggg==");background-repeat: no-repeat;background-position: center;border-radius: 3px;border: 1px solid transparent;cursor: pointer;}.ace_folding-enabled .ace_fold-widget {display: inline-block; }.ace_fold-widget.ace_end {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42m3HwQkAMAhD0YzsRchFKI7sAikeWkrxwScEB0nh5e7KTPWimZki4tYfVbX+MNl4pyZXejUO1QAAAABJRU5ErkJggg==");}.ace_fold-widget.ace_closed {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAGCAYAAAAG5SQMAAAAOUlEQVR42jXKwQkAMAgDwKwqKD4EwQ26sSOkVWjgIIHAzPiCgaqiqnJHZnKICBERHN194O5b9vbLuAVRL+l0YWnZAAAAAElFTkSuQmCCXA==");}.ace_fold-widget:hover {border: 1px solid rgba(0, 0, 0, 0.3);background-color: rgba(255, 255, 255, 0.2);box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);}.ace_fold-widget:active {border: 1px solid rgba(0, 0, 0, 0.4);background-color: rgba(0, 0, 0, 0.05);box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);}.ace_dark .ace_fold-widget {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHklEQVQIW2P4//8/AzoGEQ7oGCaLLAhWiSwB146BAQCSTPYocqT0AAAAAElFTkSuQmCC");}.ace_dark .ace_fold-widget.ace_end {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAH0lEQVQIW2P4//8/AxQ7wNjIAjDMgC4AxjCVKBirIAAF0kz2rlhxpAAAAABJRU5ErkJggg==");}.ace_dark .ace_fold-widget.ace_closed {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAFCAYAAACAcVaiAAAAHElEQVQIW2P4//+/AxAzgDADlOOAznHAKgPWAwARji8UIDTfQQAAAABJRU5ErkJggg==");}.ace_dark .ace_fold-widget:hover {box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);background-color: rgba(255, 255, 255, 0.1);}.ace_dark .ace_fold-widget:active {box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);}.ace_inline_button {border: 1px solid lightgray;display: inline-block;margin: -1px 8px;padding: 0 5px;pointer-events: auto;cursor: pointer;}.ace_inline_button:hover {border-color: gray;background: rgba(200,200,200,0.2);display: inline-block;pointer-events: auto;}.ace_fold-widget.ace_invalid {background-color: #FFB4B4;border-color: #DE5555;}.ace_fade-fold-widgets .ace_fold-widget {transition: opacity 0.4s ease 0.05s;opacity: 0;}.ace_fade-fold-widgets:hover .ace_fold-widget {transition: opacity 0.05s ease 0.05s;opacity:1;}.ace_underline {text-decoration: underline;}.ace_bold {font-weight: bold;}.ace_nobold .ace_bold {font-weight: normal;}.ace_italic {font-style: italic;}.ace_error-marker {background-color: rgba(255, 0, 0,0.2);position: absolute;z-index: 9;}.ace_highlight-marker {background-color: rgba(255, 255, 0,0.2);position: absolute;z-index: 8;}.ace_mobile-menu {position: absolute;line-height: 1.5;border-radius: 4px;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;background: white;box-shadow: 1px 3px 2px grey;border: 1px solid #dcdcdc;color: black;}.ace_dark > .ace_mobile-menu {background: #333;color: #ccc;box-shadow: 1px 3px 2px grey;border: 1px solid #444;}.ace_mobile-button {padding: 2px;cursor: pointer;overflow: hidden;}.ace_mobile-button:hover {background-color: #eee;opacity:1;}.ace_mobile-button:active {background-color: #ddd;}.ace_placeholder {font-family: arial;transform: scale(0.9);transform-origin: left;white-space: pre;opacity: 0.7;margin: 0 10px;}',v=e("./lib/useragent"),y=v.isIE;a.importCssString(f,"ace_editor.css");(function(){this.CHANGE_CURSOR=1,this.CHANGE_MARKER=2,this.CHANGE_GUTTER=4,this.CHANGE_SCROLL=8,this.CHANGE_LINES=16,this.CHANGE_TEXT=32,this.CHANGE_SIZE=64,this.CHANGE_MARKER_BACK=128,this.CHANGE_MARKER_FRONT=256,this.CHANGE_FULL=512,this.CHANGE_H_SCROLL=1024,r.implement(this,g),this.updateCharacterSize=function(){this.$textLayer.allowBoldFonts!=this.$allowBoldFonts&&(this.$allowBoldFonts=this.$textLayer.allowBoldFonts,this.setStyle("ace_nobold",!this.$allowBoldFonts)),this.layerConfig.characterWidth=this.characterWidth=this.$textLayer.getCharacterWidth(),this.layerConfig.lineHeight=this.lineHeight=this.$textLayer.getLineHeight(),this.$updatePrintMargin(),a.setStyle(this.scroller.style,"line-height",this.lineHeight+"px")},this.setSession=function(e){this.session&&this.session.doc.off("changeNewLineMode",this.onChangeNewLineMode),(this.session=e)&&this.scrollMargin.top&&e.getScrollTop()<=0&&e.setScrollTop(-this.scrollMargin.top),this.$cursorLayer.setSession(e),this.$markerBack.setSession(e),this.$markerFront.setSession(e),this.$gutterLayer.setSession(e),this.$textLayer.setSession(e),e&&(this.$loop.schedule(this.CHANGE_FULL),this.session.$setFontMetrics(this.$fontMetrics),this.scrollBarH.scrollLeft=this.scrollBarV.scrollTop=null,this.onChangeNewLineMode=this.onChangeNewLineMode.bind(this),this.onChangeNewLineMode(),this.session.doc.on("changeNewLineMode",this.onChangeNewLineMode))},this.updateLines=function(e,t,i){if(void 0===t&&(t=1/0),this.$changedLines?(this.$changedLines.firstRow>e&&(this.$changedLines.firstRow=e),this.$changedLines.lastRow<t&&(this.$changedLines.lastRow=t)):this.$changedLines={firstRow:e,lastRow:t},this.$changedLines.lastRow<this.layerConfig.firstRow){if(!i)return;this.$changedLines.lastRow=this.layerConfig.lastRow}this.$changedLines.firstRow>this.layerConfig.lastRow||this.$loop.schedule(this.CHANGE_LINES)},this.onChangeNewLineMode=function(){this.$loop.schedule(this.CHANGE_TEXT),this.$textLayer.$updateEolChar(),this.session.$bidiHandler.setEolChar(this.$textLayer.EOL_CHAR)},this.onChangeTabSize=function(){this.$loop.schedule(this.CHANGE_TEXT|this.CHANGE_MARKER),this.$textLayer.onChangeTabSize()},this.updateText=function(){this.$loop.schedule(this.CHANGE_TEXT)},this.updateFull=function(e){e?this.$renderChanges(this.CHANGE_FULL,!0):this.$loop.schedule(this.CHANGE_FULL)},this.updateFontSize=function(){this.$textLayer.checkForSizeChanges()},this.$changes=0,this.$updateSizeAsync=function(){this.$loop.pending?this.$size.$dirty=!0:this.onResize()},this.onResize=function(e,t,i,n){if(!(2<this.resizing)){0<this.resizing?this.resizing++:this.resizing=e?1:0;var r=this.container,r=(n=n||r.clientHeight||r.scrollHeight,i=i||r.clientWidth||r.scrollWidth,this.$updateCachedSize(e,t,i,n));if(!this.$size.scrollerHeight||!i&&!n)return this.resizing=0;e&&(this.$gutterLayer.$padding=null),e?this.$renderChanges(r|this.$changes,!0):this.$loop.schedule(r|this.$changes),this.resizing&&(this.resizing=0),this.scrollBarV.scrollLeft=this.scrollBarV.scrollTop=null}},this.$updateCachedSize=function(e,t,i,n){n-=this.$extraHeight||0;var r=0,s=this.$size,o={width:s.width,height:s.height,scrollerHeight:s.scrollerHeight,scrollerWidth:s.scrollerWidth};return n&&(e||s.height!=n)&&(s.height=n,r|=this.CHANGE_SIZE,s.scrollerHeight=s.height,this.$horizScroll&&(s.scrollerHeight-=this.scrollBarH.getHeight()),this.scrollBarV.element.style.bottom=this.scrollBarH.getHeight()+"px",r|=this.CHANGE_SCROLL),i&&(e||s.width!=i)&&(r|=this.CHANGE_SIZE,s.width=i,null==t&&(t=this.$showGutter?this.$gutter.offsetWidth:0),this.gutterWidth=t,a.setStyle(this.scrollBarH.element.style,"left",t+"px"),a.setStyle(this.scroller.style,"left",t+this.margin.left+"px"),s.scrollerWidth=Math.max(0,i-t-this.scrollBarV.getWidth()-this.margin.h),a.setStyle(this.$gutter.style,"left",this.margin.left+"px"),t=this.scrollBarV.getWidth()+"px",a.setStyle(this.scrollBarH.element.style,"right",t),a.setStyle(this.scroller.style,"right",t),a.setStyle(this.scroller.style,"bottom",this.scrollBarH.getHeight()),this.session&&this.session.getUseWrapMode()&&this.adjustWrapLimit()||e)&&(r|=this.CHANGE_FULL),s.$dirty=!i||!n,r&&this._signal("resize",o),r},this.onGutterResize=function(e){e=this.$showGutter?e:0;e!=this.gutterWidth&&(this.$changes|=this.$updateCachedSize(!0,e,this.$size.width,this.$size.height)),this.session.getUseWrapMode()&&this.adjustWrapLimit()||this.$size.$dirty?this.$loop.schedule(this.CHANGE_FULL):this.$computeLayerConfig()},this.adjustWrapLimit=function(){var e=this.$size.scrollerWidth-2*this.$padding,e=Math.floor(e/this.characterWidth);return this.session.adjustWrapLimit(e,this.$showPrintMargin&&this.$printMarginColumn)},this.setAnimatedScroll=function(e){this.setOption("animatedScroll",e)},this.getAnimatedScroll=function(){return this.$animatedScroll},this.setShowInvisibles=function(e){this.setOption("showInvisibles",e),this.session.$bidiHandler.setShowInvisibles(e)},this.getShowInvisibles=function(){return this.getOption("showInvisibles")},this.getDisplayIndentGuides=function(){return this.getOption("displayIndentGuides")},this.setDisplayIndentGuides=function(e){this.setOption("displayIndentGuides",e)},this.setShowPrintMargin=function(e){this.setOption("showPrintMargin",e)},this.getShowPrintMargin=function(){return this.getOption("showPrintMargin")},this.setPrintMarginColumn=function(e){this.setOption("printMarginColumn",e)},this.getPrintMarginColumn=function(){return this.getOption("printMarginColumn")},this.getShowGutter=function(){return this.getOption("showGutter")},this.setShowGutter=function(e){return this.setOption("showGutter",e)},this.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},this.setFadeFoldWidgets=function(e){this.setOption("fadeFoldWidgets",e)},this.setHighlightGutterLine=function(e){this.setOption("highlightGutterLine",e)},this.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},this.$updatePrintMargin=function(){var e;(this.$showPrintMargin||this.$printMarginEl)&&(this.$printMarginEl||((e=a.createElement("div")).className="ace_layer ace_print-margin-layer",this.$printMarginEl=a.createElement("div"),this.$printMarginEl.className="ace_print-margin",e.appendChild(this.$printMarginEl),this.content.insertBefore(e,this.content.firstChild)),(e=this.$printMarginEl.style).left=Math.round(this.characterWidth*this.$printMarginColumn+this.$padding)+"px",e.visibility=this.$showPrintMargin?"visible":"hidden",this.session)&&-1==this.session.$wrap&&this.adjustWrapLimit()},this.getContainerElement=function(){return this.container},this.getMouseEventTarget=function(){return this.scroller},this.getTextAreaContainer=function(){return this.container},this.$moveTextAreaToCursor=function(){var e,t,i,n,r,s,o;this.$isMousePressed||(e=this.textarea.style,s=this.$composition,this.$keepTextAreaAtCursor||s?(i=this.$cursorLayer.$pixelPos)&&(s&&s.markerRange&&(i=this.$cursorLayer.getPixelPosition(s.markerRange.start,!0)),o=this.layerConfig,t=i.top,i=i.left,t-=o.offset,n=s&&s.useTextareaForIME?this.lineHeight:y?0:1,t<0||t>o.height-n?a.translate(this.textarea,0,0):(o=1,r=this.$size.height-n,s?s.useTextareaForIME?(s=this.textarea.value,o=this.characterWidth*this.session.$getStringScreenWidth(s)[0]):t+=this.lineHeight+2:t+=this.lineHeight,(i-=this.scrollLeft)>this.$size.scrollerWidth-o&&(i=this.$size.scrollerWidth-o),i+=this.gutterWidth+this.margin.left,a.setStyle(e,"height",n+"px"),a.setStyle(e,"width",o+"px"),a.translate(this.textarea,Math.min(i,this.$size.scrollerWidth-o),Math.min(t,r)))):a.translate(this.textarea,-100,0))},this.getFirstVisibleRow=function(){return this.layerConfig.firstRow},this.getFirstFullyVisibleRow=function(){return this.layerConfig.firstRow+(0===this.layerConfig.offset?0:1)},this.getLastFullyVisibleRow=function(){var e=this.layerConfig,t=e.lastRow;return this.session.documentToScreenRow(t,0)*e.lineHeight-this.session.getScrollTop()>e.height-e.lineHeight?t-1:t},this.getLastVisibleRow=function(){return this.layerConfig.lastRow},this.$padding=null,this.setPadding=function(e){this.$padding=e,this.$textLayer.setPadding(e),this.$cursorLayer.setPadding(e),this.$markerFront.setPadding(e),this.$markerBack.setPadding(e),this.$loop.schedule(this.CHANGE_FULL),this.$updatePrintMargin()},this.setScrollMargin=function(e,t,i,n){var r=this.scrollMargin;r.top=0|e,r.bottom=0|t,r.right=0|n,r.left=0|i,r.v=r.top+r.bottom,r.h=r.left+r.right,r.top&&this.scrollTop<=0&&this.session&&this.session.setScrollTop(-r.top),this.updateFull()},this.setMargin=function(e,t,i,n){var r=this.margin;r.top=0|e,r.bottom=0|t,r.right=0|n,r.left=0|i,r.v=r.top+r.bottom,r.h=r.left+r.right,this.$updateCachedSize(!0,this.gutterWidth,this.$size.width,this.$size.height),this.updateFull()},this.getHScrollBarAlwaysVisible=function(){return this.$hScrollBarAlwaysVisible},this.setHScrollBarAlwaysVisible=function(e){this.setOption("hScrollBarAlwaysVisible",e)},this.getVScrollBarAlwaysVisible=function(){return this.$vScrollBarAlwaysVisible},this.setVScrollBarAlwaysVisible=function(e){this.setOption("vScrollBarAlwaysVisible",e)},this.$updateScrollBarV=function(){var e=this.layerConfig.maxHeight,t=this.$size.scrollerHeight;!this.$maxLines&&this.$scrollPastEnd&&(e-=(t-this.lineHeight)*this.$scrollPastEnd,this.scrollTop>e-t)&&(e=this.scrollTop+t,this.scrollBarV.scrollTop=null),this.scrollBarV.setScrollHeight(e+this.scrollMargin.v),this.scrollBarV.setScrollTop(this.scrollTop+this.scrollMargin.top)},this.$updateScrollBarH=function(){this.scrollBarH.setScrollWidth(this.layerConfig.width+2*this.$padding+this.scrollMargin.h),this.scrollBarH.setScrollLeft(this.scrollLeft+this.scrollMargin.left)},this.$frozen=!1,this.freeze=function(){this.$frozen=!0},this.unfreeze=function(){this.$frozen=!1},this.$renderChanges=function(e,t){if(this.$changes&&(e|=this.$changes,this.$changes=0),this.session&&this.container.offsetWidth&&!this.$frozen&&(e||t)){if(this.$size.$dirty)return this.$changes|=e,this.onResize(!0);this.lineHeight||this.$textLayer.checkForSizeChanges(),this._signal("beforeRender",e),this.session&&this.session.$bidiHandler&&this.session.$bidiHandler.updateCharacterWidths(this.$fontMetrics);var i,n,t=this.layerConfig;(e&this.CHANGE_FULL||e&this.CHANGE_SIZE||e&this.CHANGE_TEXT||e&this.CHANGE_LINES||e&this.CHANGE_SCROLL||e&this.CHANGE_H_SCROLL)&&(e|=this.$computeLayerConfig()|this.$loop.clear(),t.firstRow!=this.layerConfig.firstRow&&t.firstRowScreen==this.layerConfig.firstRowScreen&&0<(i=this.scrollTop+(t.firstRow-this.layerConfig.firstRow)*this.lineHeight)&&(this.scrollTop=i,e=(e|=this.CHANGE_SCROLL)|(this.$computeLayerConfig()|this.$loop.clear())),t=this.layerConfig,this.$updateScrollBarV(),e&this.CHANGE_H_SCROLL&&this.$updateScrollBarH(),a.translate(this.content,-this.scrollLeft,-t.offset),i=t.width+2*this.$padding+"px",n=t.minHeight+"px",a.setStyle(this.content.style,"width",i),a.setStyle(this.content.style,"height",n)),e&this.CHANGE_H_SCROLL&&(a.translate(this.content,-this.scrollLeft,-t.offset),this.scroller.className=this.scrollLeft<=0?"ace_scroller":"ace_scroller ace_scroll-left"),e&this.CHANGE_FULL?(this.$changedLines=null,this.$textLayer.update(t),this.$showGutter&&this.$gutterLayer.update(t),this.$markerBack.update(t),this.$markerFront.update(t),this.$cursorLayer.update(t),this.$moveTextAreaToCursor()):e&this.CHANGE_SCROLL?(this.$changedLines=null,e&this.CHANGE_TEXT||e&this.CHANGE_LINES?this.$textLayer.update(t):this.$textLayer.scrollLines(t),this.$showGutter&&(e&this.CHANGE_GUTTER||e&this.CHANGE_LINES?this.$gutterLayer.update(t):this.$gutterLayer.scrollLines(t)),this.$markerBack.update(t),this.$markerFront.update(t),this.$cursorLayer.update(t),this.$moveTextAreaToCursor()):(e&this.CHANGE_TEXT?(this.$changedLines=null,this.$textLayer.update(t),this.$showGutter&&this.$gutterLayer.update(t)):e&this.CHANGE_LINES?(this.$updateLines()||e&this.CHANGE_GUTTER&&this.$showGutter)&&this.$gutterLayer.update(t):e&this.CHANGE_TEXT||e&this.CHANGE_GUTTER?this.$showGutter&&this.$gutterLayer.update(t):e&this.CHANGE_CURSOR&&this.$highlightGutterLine&&this.$gutterLayer.updateLineHighlight(t),e&this.CHANGE_CURSOR&&(this.$cursorLayer.update(t),this.$moveTextAreaToCursor()),e&(this.CHANGE_MARKER|this.CHANGE_MARKER_FRONT)&&this.$markerFront.update(t),e&(this.CHANGE_MARKER|this.CHANGE_MARKER_BACK)&&this.$markerBack.update(t)),this._signal("afterRender",e)}else this.$changes|=e},this.$autosize=function(){var e=this.session.getScreenLength()*this.lineHeight,t=this.$maxLines*this.lineHeight,i=Math.min(t,Math.max((this.$minLines||1)*this.lineHeight,e))+this.scrollMargin.v+(this.$extraHeight||0);this.$horizScroll&&(i+=this.scrollBarH.getHeight());t=!((i=this.$maxPixelHeight&&i>this.$maxPixelHeight?this.$maxPixelHeight:i)<=2*this.lineHeight)&&t<e;i==this.desiredHeight&&this.$size.height==this.desiredHeight&&t==this.$vScroll||(t!=this.$vScroll&&(this.$vScroll=t,this.scrollBarV.setVisible(t)),e=this.container.clientWidth,this.container.style.height=i+"px",this.$updateCachedSize(!0,this.$gutterWidth,e,i),this.desiredHeight=i,this._signal("autosize"))},this.$computeLayerConfig=function(){var e,t=this.session,i=this.$size,n=i.height<=2*this.lineHeight,r=this.session.getScreenLength()*this.lineHeight,s=this.$getLongestLine(),o=!n&&(this.$hScrollBarAlwaysVisible||i.scrollerWidth-s-2*this.$padding<0),a=this.$horizScroll!==o,o=(a&&(this.$horizScroll=o,this.scrollBarH.setVisible(o)),this.$vScroll),l=(this.$maxLines&&1<this.lineHeight&&this.$autosize(),i.scrollerHeight+this.lineHeight),h=!this.$maxLines&&this.$scrollPastEnd?(i.scrollerHeight-this.lineHeight)*this.$scrollPastEnd:0,c=(r+=h,this.scrollMargin),n=(this.session.setScrollTop(Math.max(-c.top,Math.min(this.scrollTop,r-i.scrollerHeight+c.bottom))),this.session.setScrollLeft(Math.max(-c.left,Math.min(this.scrollLeft,s+2*this.$padding-i.scrollerWidth+c.right))),!n&&(this.$vScrollBarAlwaysVisible||i.scrollerHeight-r+h<0||this.scrollTop>c.top)),h=o!==n,c=(h&&(this.$vScroll=n,this.scrollBarV.setVisible(n)),this.scrollTop%this.lineHeight),o=Math.ceil(l/this.lineHeight)-1,o=(n=Math.max(0,Math.round((this.scrollTop-c)/this.lineHeight)))+o,d=this.lineHeight,n=t.screenToDocumentRow(n,0),u=t.getFoldLine(n),t=(u&&(n=u.start.row),u=t.documentToScreenRow(n,0),e=t.getRowLength(n)*d,o=Math.min(t.screenToDocumentRow(o,0),t.getLength()-1),l=i.scrollerHeight+t.getRowLength(o)*d+e,c=this.scrollTop-u*d,0);return this.layerConfig.width==s&&!a||(t=this.CHANGE_H_SCROLL),(a||h)&&(t|=this.$updateCachedSize(!0,this.gutterWidth,i.width,i.height),this._signal("scrollbarVisibilityChanged"),h)&&(s=this.$getLongestLine()),this.layerConfig={width:s,padding:this.$padding,firstRow:n,firstRowScreen:u,lastRow:o,lineHeight:d,characterWidth:this.characterWidth,minHeight:l,maxHeight:r,offset:c,gutterOffset:d?Math.max(0,Math.ceil((c+i.height-i.scrollerHeight)/d)):0,height:this.$size.scrollerHeight},this.session.$bidiHandler&&this.session.$bidiHandler.setContentWidth(s-this.$padding),t},this.$updateLines=function(){if(this.$changedLines){var e=this.$changedLines.firstRow,t=this.$changedLines.lastRow,i=(this.$changedLines=null,this.layerConfig);if(!(e>i.lastRow+1||t<i.firstRow)){if(t!==1/0)return this.$textLayer.updateLines(i,e,t),!0;this.$showGutter&&this.$gutterLayer.update(i),this.$textLayer.update(i)}}},this.$getLongestLine=function(){var e=this.session.getScreenWidth();return this.showInvisibles&&!this.session.$useWrapMode&&(e+=1),this.$textLayer&&e>this.$textLayer.MAX_LINE_LENGTH&&(e=this.$textLayer.MAX_LINE_LENGTH+30),Math.max(this.$size.scrollerWidth-2*this.$padding,Math.round(e*this.characterWidth))},this.updateFrontMarkers=function(){this.$markerFront.setMarkers(this.session.getMarkers(!0)),this.$loop.schedule(this.CHANGE_MARKER_FRONT)},this.updateBackMarkers=function(){this.$markerBack.setMarkers(this.session.getMarkers()),this.$loop.schedule(this.CHANGE_MARKER_BACK)},this.addGutterDecoration=function(e,t){this.$gutterLayer.addGutterDecoration(e,t)},this.removeGutterDecoration=function(e,t){this.$gutterLayer.removeGutterDecoration(e,t)},this.updateBreakpoints=function(e){this.$loop.schedule(this.CHANGE_GUTTER)},this.setAnnotations=function(e){this.$gutterLayer.setAnnotations(e),this.$loop.schedule(this.CHANGE_GUTTER)},this.updateCursor=function(){this.$loop.schedule(this.CHANGE_CURSOR)},this.hideCursor=function(){this.$cursorLayer.hideCursor()},this.showCursor=function(){this.$cursorLayer.showCursor()},this.scrollSelectionIntoView=function(e,t,i){this.scrollCursorIntoView(e,i),this.scrollCursorIntoView(t,i)},this.scrollCursorIntoView=function(e,t,i){var n,r,s;0!==this.$size.scrollerHeight&&(n=(e=this.$cursorLayer.getPixelPosition(e)).left,e=e.top,s=i&&i.top||0,i=i&&i.bottom||0,e<(r=this.$scrollAnimation?this.session.getScrollTop():this.scrollTop)+s?(t&&r+s>e+this.lineHeight&&(e-=t*this.$size.scrollerHeight),0===e&&(e=-this.scrollMargin.top),this.session.setScrollTop(e)):r+this.$size.scrollerHeight-i<e+this.lineHeight&&(t&&r+this.$size.scrollerHeight-i<e-this.lineHeight&&(e+=t*this.$size.scrollerHeight),this.session.setScrollTop(e+this.lineHeight+i-this.$size.scrollerHeight)),n<(s=this.scrollLeft)?(n<this.$padding+2*this.layerConfig.characterWidth&&(n=-this.scrollMargin.left),this.session.setScrollLeft(n)):s+this.$size.scrollerWidth<n+this.characterWidth?this.session.setScrollLeft(Math.round(n+this.characterWidth-this.$size.scrollerWidth)):s<=this.$padding&&n-s<this.characterWidth&&this.session.setScrollLeft(0))},this.getScrollTop=function(){return this.session.getScrollTop()},this.getScrollLeft=function(){return this.session.getScrollLeft()},this.getScrollTopRow=function(){return this.scrollTop/this.lineHeight},this.getScrollBottomRow=function(){return Math.max(0,Math.floor((this.scrollTop+this.$size.scrollerHeight)/this.lineHeight)-1)},this.scrollToRow=function(e){this.session.setScrollTop(e*this.lineHeight)},this.alignCursor=function(e,t){var e=this.$cursorLayer.getPixelPosition(e="number"==typeof e?{row:e,column:0}:e),i=this.$size.scrollerHeight-this.lineHeight,e=e.top-i*(t||0);return this.session.setScrollTop(e),e},this.STEPS=8,this.$calcSteps=function(e,t){for(var i,n,r=0,s=this.STEPS,o=[],r=0;r<s;++r)o.push((i=r/this.STEPS,(t-(n=e))*(Math.pow(i-1,3)+1)+n));return o},this.scrollToLine=function(e,t,i,n){e=this.$cursorLayer.getPixelPosition({row:e,column:0}).top,t&&(e-=this.$size.scrollerHeight/2),t=this.scrollTop;this.session.setScrollTop(e),!1!==i&&this.animateScrolling(t,n)},this.animateScrolling=function(e,t){var i=this.scrollTop;if(this.$animatedScroll){var n=this;if(e!=i){if(this.$scrollAnimation){var r=this.$scrollAnimation.steps;if(r.length&&(e=r[0])==i)return}var s=n.$calcSteps(e,i);this.$scrollAnimation={from:e,to:i,steps:s},clearInterval(this.$timer),n.session.setScrollTop(s.shift()),n.session.$scrollTop=i,this.$timer=setInterval(function(){if(!n.session)return clearInterval(n.$timer);s.length?(n.session.setScrollTop(s.shift()),n.session.$scrollTop=i):null!=i?(n.session.$scrollTop=-1,n.session.setScrollTop(i),i=null):(n.$timer=clearInterval(n.$timer),n.$scrollAnimation=null,t&&t())},10)}}},this.scrollToY=function(e){this.scrollTop!==e&&(this.$loop.schedule(this.CHANGE_SCROLL),this.scrollTop=e)},this.scrollToX=function(e){this.scrollLeft!==e&&(this.scrollLeft=e),this.$loop.schedule(this.CHANGE_H_SCROLL)},this.scrollTo=function(e,t){this.session.setScrollTop(t),this.session.setScrollLeft(t)},this.scrollBy=function(e,t){t&&this.session.setScrollTop(this.session.getScrollTop()+t),e&&this.session.setScrollLeft(this.session.getScrollLeft()+e)},this.isScrollableBy=function(e,t){return t<0&&this.session.getScrollTop()>=1-this.scrollMargin.top||0<t&&this.session.getScrollTop()+this.$size.scrollerHeight-this.layerConfig.maxHeight<-1+this.scrollMargin.bottom||e<0&&this.session.getScrollLeft()>=1-this.scrollMargin.left||0<e&&this.session.getScrollLeft()+this.$size.scrollerWidth-this.layerConfig.width<-1+this.scrollMargin.right||void 0},this.pixelToScreenCoordinates=function(e,t){this.$hasCssTransforms?(n={top:0,left:0},e=(i=this.$fontMetrics.transformCoordinates([e,t]))[1]-this.gutterWidth-this.margin.left,t=i[0]):n=this.scroller.getBoundingClientRect();var i=e+this.scrollLeft-n.left-this.$padding,e=i/this.characterWidth,t=Math.floor((t+this.scrollTop-n.top)/this.lineHeight),n=this.$blockCursor?Math.floor(e):Math.round(e);return{row:t,column:n,side:0<e-n?1:-1,offsetX:i}},this.screenToTextCoordinates=function(e,t){this.$hasCssTransforms?(i={top:0,left:0},e=(n=this.$fontMetrics.transformCoordinates([e,t]))[1]-this.gutterWidth-this.margin.left,t=n[0]):i=this.scroller.getBoundingClientRect();var i,n=e+this.scrollLeft-i.left-this.$padding,e=n/this.characterWidth,e=this.$blockCursor?Math.floor(e):Math.round(e),t=Math.floor((t+this.scrollTop-i.top)/this.lineHeight);return this.session.screenToDocumentPosition(t,Math.max(e,0),n)},this.textToScreenCoordinates=function(e,t){var i=this.scroller.getBoundingClientRect(),t=this.session.documentToScreenPosition(e,t),e=this.$padding+(this.session.$bidiHandler.isBidiRow(t.row,e)?this.session.$bidiHandler.getPosLeft(t.column):Math.round(t.column*this.characterWidth)),t=t.row*this.lineHeight;return{pageX:i.left+e-this.scrollLeft,pageY:i.top+t-this.scrollTop}},this.visualizeFocus=function(){a.addCssClass(this.container,"ace_focus")},this.visualizeBlur=function(){a.removeCssClass(this.container,"ace_focus")},this.showComposition=function(e){(this.$composition=e).cssText||(e.cssText=this.textarea.style.cssText),null==e.useTextareaForIME&&(e.useTextareaForIME=this.$useTextareaForIME),this.$useTextareaForIME?(a.addCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText="",this.$moveTextAreaToCursor(),this.$cursorLayer.element.style.display="none"):e.markerId=this.session.addMarker(e.markerRange,"ace_composition_marker","text")},this.setCompositionText=function(e){var t=this.session.selection.cursor;this.addToken(e,"composition_placeholder",t.row,t.column),this.$moveTextAreaToCursor()},this.hideComposition=function(){var e;this.$composition&&(this.$composition.markerId&&this.session.removeMarker(this.$composition.markerId),a.removeCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText=this.$composition.cssText,e=this.session.selection.cursor,this.removeExtraToken(e.row,e.column),this.$composition=null,this.$cursorLayer.element.style.display="")},this.addToken=function(e,t,i,n){var r=this.session,s=(r.bgTokenizer.lines[i]=null,{type:t,value:e}),o=r.getTokens(i);if(null==n)o.push(s);else for(var a=0,l=0;l<o.length;l++){var h=o[l];if(n<=(a+=h.value.length)){var c=h.value.length-(a-n),d=h.value.slice(0,c),c=h.value.slice(c);o.splice(l,1,{type:h.type,value:d},s,{type:h.type,value:c});break}}this.updateLines(i,i)},this.removeExtraToken=function(e,t){this.updateLines(e,e)},this.setTheme=function(i,n){function e(e){if(r.$themeId!=i)return n&&n();if(!e||!e.cssClass)throw new Error("couldn't load module "+i+" or it didn't call define");e.$id&&(r.$themeId=e.$id),a.importCssString(e.cssText,e.cssClass,r.container),r.theme&&a.removeCssClass(r.container,r.theme.cssClass);var t="padding"in e?e.padding:"padding"in(r.theme||{})?4:r.$padding;r.$padding&&t!=r.$padding&&r.setPadding(t),r.$theme=e.cssClass,r.theme=e,a.addCssClass(r.container,e.cssClass),a.setCssClass(r.container,"ace_dark",e.isDark),r.$size&&(r.$size.width=0,r.$updateSizeAsync()),r._dispatchEvent("themeLoaded",{theme:e}),n&&n()}var t,r=this;this.$themeId=i,r._dispatchEvent("themeChange",{theme:i}),i&&"string"!=typeof i?e(i):(t=i||this.$options.theme.initialValue,s.loadModule(["theme",t],e))},this.getTheme=function(){return this.$themeId},this.setStyle=function(e,t){a.setCssClass(this.container,e,!1!==t)},this.unsetStyle=function(e){a.removeCssClass(this.container,e)},this.setCursorStyle=function(e){a.setStyle(this.scroller.style,"cursor",e)},this.setMouseCursor=function(e){a.setStyle(this.scroller.style,"cursor",e)},this.attachToShadowRoot=function(){a.importCssString(f,"ace_editor.css",this.container)},this.destroy=function(){this.freeze(),this.$fontMetrics.destroy(),this.$cursorLayer.destroy(),this.removeAllListeners(),this.container.textContent=""}}).call(n.prototype),s.defineOptions(n.prototype,"renderer",{animatedScroll:{initialValue:!1},showInvisibles:{set:function(e){this.$textLayer.setShowInvisibles(e)&&this.$loop.schedule(this.CHANGE_TEXT)},initialValue:!1},showPrintMargin:{set:function(){this.$updatePrintMargin()},initialValue:!0},printMarginColumn:{set:function(){this.$updatePrintMargin()},initialValue:80},printMargin:{set:function(e){"number"==typeof e&&(this.$printMarginColumn=e),this.$showPrintMargin=!!e,this.$updatePrintMargin()},get:function(){return this.$showPrintMargin&&this.$printMarginColumn}},showGutter:{set:function(e){this.$gutter.style.display=e?"block":"none",this.$loop.schedule(this.CHANGE_FULL),this.onGutterResize()},initialValue:!0},fadeFoldWidgets:{set:function(e){a.setCssClass(this.$gutter,"ace_fade-fold-widgets",e)},initialValue:!1},showFoldWidgets:{set:function(e){this.$gutterLayer.setShowFoldWidgets(e),this.$loop.schedule(this.CHANGE_GUTTER)},initialValue:!0},displayIndentGuides:{set:function(e){this.$textLayer.setDisplayIndentGuides(e)&&this.$loop.schedule(this.CHANGE_TEXT)},initialValue:!0},highlightGutterLine:{set:function(e){this.$gutterLayer.setHighlightGutterLine(e),this.$loop.schedule(this.CHANGE_GUTTER)},initialValue:!0},hScrollBarAlwaysVisible:{set:function(e){this.$hScrollBarAlwaysVisible&&this.$horizScroll||this.$loop.schedule(this.CHANGE_SCROLL)},initialValue:!1},vScrollBarAlwaysVisible:{set:function(e){this.$vScrollBarAlwaysVisible&&this.$vScroll||this.$loop.schedule(this.CHANGE_SCROLL)},initialValue:!1},fontSize:{set:function(e){"number"==typeof e&&(e+="px"),this.container.style.fontSize=e,this.updateFontSize()},initialValue:12},fontFamily:{set:function(e){this.container.style.fontFamily=e,this.updateFontSize()}},maxLines:{set:function(e){this.updateFull()}},minLines:{set:function(e){this.$minLines<562949953421311||(this.$minLines=0),this.updateFull()}},maxPixelHeight:{set:function(e){this.updateFull()},initialValue:0},scrollPastEnd:{set:function(e){this.$scrollPastEnd!=(e=+e||0)&&(this.$scrollPastEnd=e,this.$loop.schedule(this.CHANGE_SCROLL))},initialValue:0,handlesSet:!0},fixedWidthGutter:{set:function(e){this.$gutterLayer.$fixedWidth=!!e,this.$loop.schedule(this.CHANGE_GUTTER)}},theme:{set:function(e){this.setTheme(e)},get:function(){return this.$themeId||this.theme},initialValue:"./theme/textmate",handlesSet:!0},hasCssTransforms:{},useTextareaForIME:{initialValue:!v.isMobile&&!v.isIE}}),t.VirtualRenderer=n}),ace.define("ace/worker/worker_client",["require","exports","module","ace/lib/oop","ace/lib/net","ace/lib/event_emitter","ace/config"],function(a,e,t){"use strict";function l(e){var t;return"undefined"==typeof Worker?{postMessage:function(){},terminate:function(){}}:d.get("loadWorkerFromBlob")?(t=function(t){t="importScripts('"+n.qualifyURL(t)+"');";try{return new Blob([t],{type:"application/javascript"})}catch(e){var i=new(window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder);return i.append(t),i.getBlob("application/javascript")}}(e),t=(window.URL||window.webkitURL).createObjectURL(t),new Worker(t)):new Worker(e)}function h(e){e.postMessage||(e=this.$createWorkerFromOldConfig.apply(this,arguments)),this.$worker=e,this.$sendDeltaQueue=this.$sendDeltaQueue.bind(this),this.changeListener=this.changeListener.bind(this),this.onMessage=this.onMessage.bind(this),this.callbackId=1,this.callbacks={},this.$worker.onmessage=this.onMessage}var i=a("../lib/oop"),n=a("../lib/net"),c=a("../lib/event_emitter").EventEmitter,d=a("../config");(function(){i.implement(this,c),this.$createWorkerFromOldConfig=function(e,t,i,n,r){var s,o;return a.nameToUrl&&!a.toUrl&&(a.toUrl=a.nameToUrl),d.get("packaged")||!a.toUrl?n=n||d.moduleUrl(t,"worker"):(s=this.$normalizePath,n=n||s(a.toUrl("ace/worker/worker.js",null,"_")),o={},e.forEach(function(e){o[e]=s(a.toUrl(e,null,"_").replace(/(\.js)?(\?.*)?$/,""))})),this.$worker=l(n),r&&this.send("importScripts",r),this.$worker.postMessage({init:!0,tlns:o,module:t,classname:i}),this.$worker},this.onMessage=function(e){var t=e.data;switch(t.type){case"event":this._signal(t.name,{data:t.data});break;case"call":var i=this.callbacks[t.id];i&&(i(t.data),delete this.callbacks[t.id]);break;case"error":this.reportError(t.data);break;case"log":window.console&&console.log&&console.log.apply(console,t.data)}},this.reportError=function(e){window.console&&console.error&&console.error(e)},this.$normalizePath=function(e){return n.qualifyURL(e)},this.terminate=function(){this._signal("terminate",{}),this.deltaQueue=null,this.$worker.terminate(),this.$worker=null,this.$doc&&this.$doc.off("change",this.changeListener),this.$doc=null},this.send=function(e,t){this.$worker.postMessage({command:e,args:t})},this.call=function(e,t,i){var n;i&&(n=this.callbackId++,this.callbacks[n]=i,t.push(n)),this.send(e,t)},this.emit=function(e,t){try{t.data&&t.data.err&&(t.data.err={message:t.data.err.message,stack:t.data.err.stack,code:t.data.err.code}),this.$worker.postMessage({event:e,data:{data:t.data}})}catch(e){console.error(e.stack)}},this.attachToDocument=function(e){this.$doc&&this.terminate(),this.$doc=e,this.call("setValue",[e.getValue()]),e.on("change",this.changeListener)},this.changeListener=function(e){this.deltaQueue||(this.deltaQueue=[],setTimeout(this.$sendDeltaQueue,0)),"insert"==e.action?this.deltaQueue.push(e.start,e.lines):this.deltaQueue.push(e.start,e.end)},this.$sendDeltaQueue=function(){var e=this.deltaQueue;e&&(this.deltaQueue=null,50<e.length&&e.length>this.$doc.getLength()>>1?this.call("setValue",[this.$doc.getValue()]):this.emit("change",{data:e}))}}).call(h.prototype);e.UIWorkerClient=function(e,t,i){var n=null,r=!1,s=Object.create(c),o=[],a=new h({messageBuffer:o,terminate:function(){},postMessage:function(e){o.push(e),n&&(r?setTimeout(l):l())}}),l=(a.setEmitSync=function(e){r=e},function(){var e=o.shift();e.command?n[e.command].apply(n,e.args):e.event&&s._signal(e.event,e.data)});return s.postMessage=function(e){a.onMessage({data:e})},s.callback=function(e,t){this.postMessage({type:"call",id:t,data:e})},s.emit=function(e,t){this.postMessage({type:"event",name:e,data:t})},d.loadModule(["worker",t],function(e){for(n=new e[i](s);o.length;)l()}),a},e.WorkerClient=h,e.createWorker=l}),ace.define("ace/placeholder",["require","exports","module","ace/range","ace/lib/event_emitter","ace/lib/oop"],function(e,t,i){"use strict";function n(e,t,i,n,r,s){var o=this,t=(this.length=t,this.session=e,this.doc=e.getDocument(),this.mainClass=r,this.othersClass=s,this.$onUpdate=this.onUpdate.bind(this),this.doc.on("change",this.$onUpdate),this.$others=n,this.$onCursorChange=function(){setTimeout(function(){o.onCursorChange()})},this.$pos=i,e.getUndoManager().$undoStack||e.getUndoManager().$undostack||{length:-1});this.$undoStackDepth=t.length,this.setup(),e.selection.on("changeCursor",this.$onCursorChange)}var l=e("./range").Range,r=e("./lib/event_emitter").EventEmitter,s=e("./lib/oop");(function(){s.implement(this,r),this.setup=function(){var t=this,i=this.doc,e=this.session,n=(this.selectionBefore=e.selection.toJSON(),e.selection.inMultiSelectMode&&e.selection.toSingleRange(),this.pos=i.createAnchor(this.$pos.row,this.$pos.column),this.pos);n.$insertRight=!0,n.detach(),n.markerId=e.addMarker(new l(n.row,n.column,n.row,n.column+this.length),this.mainClass,null,!1),this.others=[],this.$others.forEach(function(e){e=i.createAnchor(e.row,e.column);e.$insertRight=!0,e.detach(),t.others.push(e)}),e.setUndoSelect(!1)},this.showOtherMarkers=function(){var t,i;this.othersActive||(t=this.session,(i=this).othersActive=!0,this.others.forEach(function(e){e.markerId=t.addMarker(new l(e.row,e.column,e.row,e.column+i.length),i.othersClass,null,!1)}))},this.hideOtherMarkers=function(){if(this.othersActive){this.othersActive=!1;for(var e=0;e<this.others.length;e++)this.session.removeMarker(this.others[e].markerId)}},this.onUpdate=function(e){if(this.$updating)return this.updateAnchors(e);var t=e;if(t.start.row===t.end.row&&t.start.row===this.pos.row){this.$updating=!0;var i="insert"===e.action?t.end.column-t.start.column:t.start.column-t.end.column,n=t.start.column>=this.pos.column&&t.start.column<=this.pos.column+this.length+1,r=t.start.column-this.pos.column;if(this.updateAnchors(e),n&&(this.length+=i),n&&!this.session.$fromUndo)if("insert"===e.action)for(var s=this.others.length-1;0<=s;s--){var o={row:(a=this.others[s]).row,column:a.column+r};this.doc.insertMergedLines(o,e.lines)}else if("remove"===e.action)for(s=this.others.length-1;0<=s;s--){var a,o={row:(a=this.others[s]).row,column:a.column+r};this.doc.remove(new l(o.row,o.column,o.row,o.column-i))}this.$updating=!1,this.updateMarkers()}},this.updateAnchors=function(e){this.pos.onChange(e);for(var t=this.others.length;t--;)this.others[t].onChange(e);this.updateMarkers()},this.updateMarkers=function(){if(!this.$updating){var i=this,n=this.session,e=function(e,t){n.removeMarker(e.markerId),e.markerId=n.addMarker(new l(e.row,e.column,e.row,e.column+i.length),t,null,!1)};e(this.pos,this.mainClass);for(var t=this.others.length;t--;)e(this.others[t],this.othersClass)}},this.onCursorChange=function(e){var t;!this.$updating&&this.session&&((t=this.session.selection.getCursor()).row===this.pos.row&&t.column>=this.pos.column&&t.column<=this.pos.column+this.length?(this.showOtherMarkers(),this._emit("cursorEnter",e)):(this.hideOtherMarkers(),this._emit("cursorLeave",e)))},this.detach=function(){this.session.removeMarker(this.pos&&this.pos.markerId),this.hideOtherMarkers(),this.doc.off("change",this.$onUpdate),this.session.selection.off("changeCursor",this.$onCursorChange),this.session.setUndoSelect(!0),this.session=null},this.cancel=function(){if(-1!==this.$undoStackDepth){for(var e=this.session.getUndoManager(),t=(e.$undoStack||e.$undostack).length-this.$undoStackDepth,i=0;i<t;i++)e.undo(this.session,!0);this.selectionBefore&&this.session.selection.fromJSON(this.selectionBefore)}}}).call(n.prototype),t.PlaceHolder=n}),ace.define("ace/mouse/multi_select_handler",["require","exports","module","ace/lib/event","ace/lib/useragent"],function(e,t,i){function _(e,t){return e.row==t.row&&e.column==t.column}var C=e("../lib/event"),T=e("../lib/useragent");t.onMouseDown=function(e){var t=e.domEvent,i=t.altKey,n=t.shiftKey,r=t.ctrlKey,s=e.getAccelKey(),o=e.getButton();if(r&&T.isMac&&(o=t.button),e.editor.inMultiSelectMode&&2==o)e.editor.textInput.onContextMenu(e.domEvent);else if(r||i||s){if(0===o){var a,l,h,c,d,u,p,m,g=e.editor,f=g.selection,v=g.inMultiSelectMode,y=e.getDocumentPosition(),b=f.getCursor(),b=e.inSelection()||f.isEmpty()&&_(y,b),w=e.x,x=e.y,S=g.session,A=g.renderer.pixelToScreenCoordinates(w,x),k=A;if(g.$mouseHandler.$enableJumpToDef)r&&i||s&&i?a=n?"block":"add":i&&g.$blockSelectEnabled&&(a="block");else if(s&&!i){if(a="add",!v&&n)return}else i&&g.$blockSelectEnabled&&(a="block");if(a&&T.isMac&&t.ctrlKey&&g.$mouseHandler.cancelContextMenu(),"add"==a)!v&&b||(v||(l=f.toOrientedRange(),g.addSelectionMarker(l)),h=f.rangeList.rangeAtPoint(y),g.inVirtualSelectionMode=!0,n&&(h=null,l=f.ranges[0]||l,g.removeSelectionMarker(l)),g.once("mouseup",function(){var e=f.toOrientedRange();h&&e.isEmpty()&&_(h.cursor,e.cursor)?f.substractPoint(e.cursor):(n?f.substractPoint(l.cursor):l&&(g.removeSelectionMarker(l),f.addRange(l)),f.addRange(e)),g.inVirtualSelectionMode=!1}));else if("block"==a)return e.stop(),g.inVirtualSelectionMode=!0,d=[],u=function(){var e=g.renderer.pixelToScreenCoordinates(w,x),t=S.screenToDocumentPosition(e.row,e.column,e.offsetX);_(k,e)&&_(t,f.lead)||(k=e,g.selection.moveToPosition(t),g.renderer.scrollCursorIntoView(),g.removeSelectionMarkers(d),d=f.rectangularRangeBlock(k,A),g.$mouseHandler.$clickSelection&&1==d.length&&d[0].isEmpty()&&(d[0]=g.$mouseHandler.$clickSelection.clone()),d.forEach(g.addSelectionMarker,g),g.updateSelectionMarkers())},v&&!s?f.toSingleRange():!v&&s&&(c=f.toOrientedRange(),g.addSelectionMarker(c)),n?A=S.documentToScreenPosition(f.lead):f.moveToPosition(y),k={row:-1,column:-1},p=u,C.capture(g.container,function(e){w=e.clientX,x=e.clientY},function(e){u(),clearInterval(m),g.removeSelectionMarkers(d),d.length||(d=[f.toOrientedRange()]),c&&(g.removeSelectionMarker(c),f.toSingleRange(c));for(var t=0;t<d.length;t++)f.addRange(d[t]);g.inVirtualSelectionMode=!1,g.$mouseHandler.$clickSelection=null}),m=setInterval(function(){p()},20),e.preventDefault()}}else 0===o&&e.editor.inMultiSelectMode&&e.editor.exitMultiSelectMode()}}),ace.define("ace/commands/multi_select_commands",["require","exports","module","ace/keyboard/hash_handler"],function(e,t,i){t.defaultCommands=[{name:"addCursorAbove",description:"Add cursor above",exec:function(e){e.selectMoreLines(-1)},bindKey:{win:"Ctrl-Alt-Up",mac:"Ctrl-Alt-Up"},scrollIntoView:"cursor",readOnly:!0},{name:"addCursorBelow",description:"Add cursor below",exec:function(e){e.selectMoreLines(1)},bindKey:{win:"Ctrl-Alt-Down",mac:"Ctrl-Alt-Down"},scrollIntoView:"cursor",readOnly:!0},{name:"addCursorAboveSkipCurrent",description:"Add cursor above (skip current)",exec:function(e){e.selectMoreLines(-1,!0)},bindKey:{win:"Ctrl-Alt-Shift-Up",mac:"Ctrl-Alt-Shift-Up"},scrollIntoView:"cursor",readOnly:!0},{name:"addCursorBelowSkipCurrent",description:"Add cursor below (skip current)",exec:function(e){e.selectMoreLines(1,!0)},bindKey:{win:"Ctrl-Alt-Shift-Down",mac:"Ctrl-Alt-Shift-Down"},scrollIntoView:"cursor",readOnly:!0},{name:"selectMoreBefore",description:"Select more before",exec:function(e){e.selectMore(-1)},bindKey:{win:"Ctrl-Alt-Left",mac:"Ctrl-Alt-Left"},scrollIntoView:"cursor",readOnly:!0},{name:"selectMoreAfter",description:"Select more after",exec:function(e){e.selectMore(1)},bindKey:{win:"Ctrl-Alt-Right",mac:"Ctrl-Alt-Right"},scrollIntoView:"cursor",readOnly:!0},{name:"selectNextBefore",description:"Select next before",exec:function(e){e.selectMore(-1,!0)},bindKey:{win:"Ctrl-Alt-Shift-Left",mac:"Ctrl-Alt-Shift-Left"},scrollIntoView:"cursor",readOnly:!0},{name:"selectNextAfter",description:"Select next after",exec:function(e){e.selectMore(1,!0)},bindKey:{win:"Ctrl-Alt-Shift-Right",mac:"Ctrl-Alt-Shift-Right"},scrollIntoView:"cursor",readOnly:!0},{name:"toggleSplitSelectionIntoLines",description:"Split into lines",exec:function(e){1<e.multiSelect.rangeCount?e.multiSelect.joinSelections():e.multiSelect.splitIntoLines()},bindKey:{win:"Ctrl-Alt-L",mac:"Ctrl-Alt-L"},readOnly:!0},{name:"splitSelectionIntoLines",description:"Split into lines",exec:function(e){e.multiSelect.splitIntoLines()},readOnly:!0},{name:"alignCursors",description:"Align cursors",exec:function(e){e.alignCursors()},bindKey:{win:"Ctrl-Alt-A",mac:"Ctrl-Alt-A"},scrollIntoView:"cursor"},{name:"findAll",description:"Find all",exec:function(e){e.findAll()},bindKey:{win:"Ctrl-Alt-K",mac:"Ctrl-Alt-G"},scrollIntoView:"cursor",readOnly:!0}],t.multiSelectCommands=[{name:"singleSelection",description:"Single selection",bindKey:"esc",exec:function(e){e.exitMultiSelectMode()},scrollIntoView:"cursor",readOnly:!0,isAvailable:function(e){return e&&e.inMultiSelectMode}}];e=e("../keyboard/hash_handler").HashHandler;t.keyboardHandler=new e(t.multiSelectCommands)}),ace.define("ace/multi_select",["require","exports","module","ace/range_list","ace/range","ace/selection","ace/mouse/multi_select_handler","ace/lib/event","ace/lib/lang","ace/commands/multi_select_commands","ace/search","ace/edit_session","ace/editor","ace/config"],function(e,r,t){function i(e){var t,i;function n(e){i&&(t.renderer.setMouseCursor(""),i=!1)}e.$multiselectOnSessionChange||(e.$onAddRange=e.$onAddRange.bind(e),e.$onRemoveRange=e.$onRemoveRange.bind(e),e.$onMultiSelect=e.$onMultiSelect.bind(e),e.$onSingleSelect=e.$onSingleSelect.bind(e),e.$multiselectOnSessionChange=r.onSessionChange.bind(e),e.$checkMultiselectChange=e.$checkMultiselectChange.bind(e),e.$multiselectOnSessionChange(e),e.on("changeSession",e.$multiselectOnSessionChange),e.on("mousedown",s),e.commands.addCommands(a.defaultCommands),(t=e).textInput&&(e=t.textInput.getElement(),i=!1,o.addListener(e,"keydown",function(e){e=18==e.keyCode&&!(e.ctrlKey||e.shiftKey||e.metaKey);t.$blockSelectEnabled&&e?i||(t.renderer.setMouseCursor("crosshair"),i=!0):i&&n()},t),o.addListener(e,"keyup",n,t),o.addListener(e,"blur",n,t)))}var n=e("./range_list").RangeList,w=e("./range").Range,u=e("./selection").Selection,s=e("./mouse/multi_select_handler").onMouseDown,o=e("./lib/event"),p=e("./lib/lang"),a=e("./commands/multi_select_commands");r.commands=a.defaultCommands.concat(a.multiSelectCommands);var l=new(e("./search").Search),h=e("./edit_session").EditSession,h=(function(){this.getSelectionMarkers=function(){return this.$selectionMarkers}}.call(h.prototype),function(){this.ranges=null,this.rangeList=null,this.addRange=function(e,t){if(e){if(!this.inMultiSelectMode&&0===this.rangeCount){var i=this.toOrientedRange();if(this.rangeList.add(i),this.rangeList.add(e),2!=this.rangeList.ranges.length)return this.rangeList.removeAll(),t||this.fromOrientedRange(e);this.rangeList.removeAll(),this.rangeList.add(i),this.$onAddRange(i)}e.cursor||(e.cursor=e.end);i=this.rangeList.add(e);return this.$onAddRange(e),i.length&&this.$onRemoveRange(i),1<this.rangeCount&&!this.inMultiSelectMode&&(this._signal("multiSelect"),this.inMultiSelectMode=!0,this.session.$undoSelect=!1,this.rangeList.attach(this.session)),t||this.fromOrientedRange(e)}},this.toSingleRange=function(e){e=e||this.ranges[0];var t=this.rangeList.removeAll();t.length&&this.$onRemoveRange(t),e&&this.fromOrientedRange(e)},this.substractPoint=function(e){e=this.rangeList.substractPoint(e);if(e)return this.$onRemoveRange(e),e[0]},this.mergeOverlappingRanges=function(){var e=this.rangeList.merge();e.length&&this.$onRemoveRange(e)},this.$onAddRange=function(e){this.rangeCount=this.rangeList.ranges.length,this.ranges.unshift(e),this._signal("addRange",{range:e})},this.$onRemoveRange=function(e){var t;this.rangeCount=this.rangeList.ranges.length,1==this.rangeCount&&this.inMultiSelectMode&&(t=this.rangeList.ranges.pop(),e.push(t),this.rangeCount=0);for(var i=e.length;i--;){var n=this.ranges.indexOf(e[i]);this.ranges.splice(n,1)}this._signal("removeRange",{ranges:e}),0===this.rangeCount&&this.inMultiSelectMode&&(this.inMultiSelectMode=!1,this._signal("singleSelect"),this.session.$undoSelect=!0,this.rangeList.detach(this.session)),(t=t||this.ranges[0])&&!t.isEqual(this.getRange())&&this.fromOrientedRange(t)},this.$initRangeList=function(){this.rangeList||(this.rangeList=new n,this.ranges=[],this.rangeCount=0)},this.getAllRanges=function(){return this.rangeCount?this.rangeList.ranges.concat():[this.getRange()]},this.splitIntoLines=function(){for(var e=this.ranges.length?this.ranges:[this.getRange()],t=[],i=0;i<e.length;i++){var n=e[i],r=n.start.row,s=n.end.row;if(r===s)t.push(n.clone());else{for(t.push(new w(r,n.start.column,r,this.session.getLine(r).length));++r<s;)t.push(this.getLineRange(r,!0));t.push(new w(s,0,s,n.end.column))}0!=i||this.isBackwards()||(t=t.reverse())}this.toSingleRange();for(i=t.length;i--;)this.addRange(t[i])},this.joinSelections=function(){var e=this.rangeList.ranges,t=e[e.length-1],e=w.fromPoints(e[0].start,t.end);this.toSingleRange(),this.setSelectionRange(e,t.cursor==t.start)},this.toggleBlockSelection=function(){var e,t;1<this.rangeCount?(t=(e=this.rangeList.ranges)[e.length-1],e=w.fromPoints(e[0].start,t.end),this.toSingleRange(),this.setSelectionRange(e,t.cursor==t.start)):(e=this.session.documentToScreenPosition(this.cursor),t=this.session.documentToScreenPosition(this.anchor),this.rectangularRangeBlock(e,t).forEach(this.addRange,this))},this.rectangularRangeBlock=function(e,t,i){var n,r,s,o,a,l,h,c=[],d=e.column<t.column,u=(o=(d?(n=e.column,r=t.column,s=e.offsetX,t):(n=t.column,r=e.column,s=t.offsetX,e)).offsetX,e.row<t.row);l=(u?(a=e.row,t):(a=t.row,e)).row,n<0&&(n=0),(a=a<0?0:a)==l&&(i=!0);for(var p,m,g=a;g<=l;g++){var f=w.fromPoints(this.session.screenToDocumentPosition(g,n,s),this.session.screenToDocumentPosition(g,r,o));if(f.isEmpty()){if(h&&(p=f.end,m=h,p.row==m.row)&&p.column==m.column)break;h=f.end}f.cursor=d?f.start:f.end,c.push(f)}if(u&&c.reverse(),!i){for(var v=c.length-1;c[v].isEmpty()&&0<v;)v--;if(0<v)for(var y=0;c[y].isEmpty();)y++;for(var b=v;y<=b;b--)c[b].isEmpty()&&c.splice(b,1)}return c}}.call(u.prototype),e("./editor").Editor);(function(){this.updateSelectionMarkers=function(){this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.addSelectionMarker=function(e){e.cursor||(e.cursor=e.end);var t=this.getSelectionStyle();return e.marker=this.session.addMarker(e,"ace_selection",t),this.session.$selectionMarkers.push(e),this.session.selectionMarkerCount=this.session.$selectionMarkers.length,e},this.removeSelectionMarker=function(e){e.marker&&(this.session.removeMarker(e.marker),-1!=(e=this.session.$selectionMarkers.indexOf(e))&&this.session.$selectionMarkers.splice(e,1),this.session.selectionMarkerCount=this.session.$selectionMarkers.length)},this.removeSelectionMarkers=function(e){for(var t=this.session.$selectionMarkers,i=e.length;i--;){var n=e[i];n.marker&&(this.session.removeMarker(n.marker),-1!=(n=t.indexOf(n)))&&t.splice(n,1)}this.session.selectionMarkerCount=t.length},this.$onAddRange=function(e){this.addSelectionMarker(e.range),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onRemoveRange=function(e){this.removeSelectionMarkers(e.ranges),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onMultiSelect=function(e){this.inMultiSelectMode||(this.inMultiSelectMode=!0,this.setStyle("ace_multiselect"),this.keyBinding.addKeyboardHandler(a.keyboardHandler),this.commands.setDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers())},this.$onSingleSelect=function(e){this.session.multiSelect.inVirtualMode||(this.inMultiSelectMode=!1,this.unsetStyle("ace_multiselect"),this.keyBinding.removeKeyboardHandler(a.keyboardHandler),this.commands.removeDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers(),this._emit("changeSelection"))},this.$onMultiSelectExec=function(e){var t,i=e.command,n=e.editor;if(n.multiSelect)return i.multiSelectAction?t="forEach"==i.multiSelectAction?n.forEachSelection(i,e.args):"forEachLine"==i.multiSelectAction?n.forEachSelection(i,e.args,!0):"single"==i.multiSelectAction?(n.exitMultiSelectMode(),i.exec(n,e.args||{})):i.multiSelectAction(n,e.args||{}):(t=i.exec(n,e.args||{}),n.multiSelect.addRange(n.multiSelect.toOrientedRange()),n.multiSelect.mergeOverlappingRanges()),t},this.forEachSelection=function(e,t,i){if(!this.inVirtualSelectionMode){var n,r=i&&i.keepOrder,s=1==i||i&&i.$byLines,o=this.session,i=this.selection,a=i.rangeList,l=(r?i:a).ranges;if(!l.length)return e.exec?e.exec(this,t||{}):e(this,t||{});var r=i._eventRegistry,h=(i._eventRegistry={},new u(o));this.inVirtualSelectionMode=!0;for(var c=l.length;c--;){if(s)for(;0<c&&l[c].start.row==l[c-1].end.row;)c--;h.fromOrientedRange(l[c]),h.index=c,this.selection=o.selection=h;var d=e.exec?e.exec(this,t||{}):e(this,t||{});n||void 0===d||(n=d),h.toOrientedRange(l[c])}h.detach(),this.selection=o.selection=i,this.inVirtualSelectionMode=!1,i._eventRegistry=r,i.mergeOverlappingRanges(),i.ranges[0]&&i.fromOrientedRange(i.ranges[0]);a=this.renderer.$scrollAnimation;return this.onCursorChange(),this.onSelectionChange(),a&&a.from==a.to&&this.renderer.animateScrolling(a.from),n}},this.exitMultiSelectMode=function(){this.inMultiSelectMode&&!this.inVirtualSelectionMode&&this.multiSelect.toSingleRange()},this.getSelectedText=function(){var e="";if(this.inMultiSelectMode&&!this.inVirtualSelectionMode){for(var t=this.multiSelect.rangeList.ranges,i=[],n=0;n<t.length;n++)i.push(this.session.getTextRange(t[n]));var r=this.session.getDocument().getNewLineCharacter();(e=i.join(r)).length==(i.length-1)*r.length&&(e="")}else this.selection.isEmpty()||(e=this.session.getTextRange(this.getSelectionRange()));return e},this.$checkMultiselectChange=function(e,t){var i;this.inMultiSelectMode&&!this.inVirtualSelectionMode&&(i=this.multiSelect.ranges[0],this.multiSelect.isEmpty()&&t==this.multiSelect.anchor||((i=t==this.multiSelect.anchor?i.cursor==i.start?i.end:i.start:i.cursor).row!=t.row||this.session.$clipPositionToDocument(i.row,i.column).column!=t.column?this.multiSelect.toSingleRange(this.multiSelect.toOrientedRange()):this.multiSelect.mergeOverlappingRanges()))},this.findAll=function(e,t,i){(t=t||{}).needle=e||t.needle,null==t.needle&&(n=this.selection.isEmpty()?this.selection.getWordRange():this.selection.getRange(),t.needle=this.session.getTextRange(n)),this.$search.set(t);var n,r=this.$search.findAll(this.session);if(!r.length)return 0;var s=this.multiSelect;i||s.toSingleRange(r[0]);for(var o=r.length;o--;)s.addRange(r[o],!0);return n&&s.rangeList.rangeAtPoint(n.start)&&s.addRange(n,!0),r.length},this.selectMoreLines=function(e,t){var i,n,r,s=this.selection.toOrientedRange(),o=s.cursor==s.end,a=this.session.documentToScreenPosition(s.cursor),l=(this.selection.$desiredColumn&&(a.column=this.selection.$desiredColumn),this.session.screenToDocumentPosition(a.row+e,a.column));e=s.isEmpty()?l:(i=this.session.documentToScreenPosition(o?s.end:s.start),this.session.screenToDocumentPosition(i.row+e,i.column)),o?(n=w.fromPoints(l,e)).cursor=n.start:(n=w.fromPoints(e,l)).cursor=n.end,n.desiredColumn=a.column,this.selection.inMultiSelectMode?t&&(r=s.cursor):this.selection.addRange(s),this.selection.addRange(n),r&&this.selection.substractPoint(r)},this.transposeSelections=function(e){for(var t=this.session,i=t.multiSelect,n=i.ranges,r=n.length;r--;)(o=n[r]).isEmpty()&&(a=t.getWordRange(o.start.row,o.start.column),o.start.row=a.start.row,o.start.column=a.start.column,o.end.row=a.end.row,o.end.column=a.end.column);i.mergeOverlappingRanges();for(var s=[],r=n.length;r--;){var o=n[r];s.unshift(t.getTextRange(o))}e<0?s.unshift(s.pop()):s.push(s.shift());for(r=n.length;r--;){var a=(o=n[r]).clone();t.replace(o,s[r]),o.start.row=a.start.row,o.start.column=a.start.column}i.fromOrientedRange(i.ranges[0])},this.selectMore=function(e,t,i){var n,r=this.session,s=r.multiSelect.toOrientedRange();s.isEmpty()&&((s=r.getWordRange(s.start.row,s.start.column)).cursor=-1==e?s.start:s.end,this.multiSelect.addRange(s),i)||(i=r.getTextRange(s),r=r,i=i,n=e,l.$options.wrap=!0,l.$options.needle=i,l.$options.backwards=-1==n,(i=l.find(r))&&(i.cursor=-1==e?i.start:i.end,this.session.unfold(i),this.multiSelect.addRange(i),this.renderer.scrollCursorIntoView(null,.5)),t&&this.multiSelect.substractPoint(s.cursor))},this.alignCursors=function(){var r=this.session,t=r.multiSelect,e=t.ranges,i=-1,n=e.filter(function(e){if(e.cursor.row==i)return!0;i=e.cursor.row});if(e.length&&n.length!=e.length-1){n.forEach(function(e){t.substractPoint(e.cursor)});var s=0,o=1/0,a=e.map(function(e){var e=e.cursor,t=r.getLine(e.row).substr(e.column).search(/\S/g);return e.column>s&&(s=e.column),(t=-1==t?0:t)<o&&(o=t),t});e.forEach(function(e,t){var i=e.cursor,n=s-i.column,t=a[t]-o;t<n?r.insert(i,p.stringRepeat(" ",n-t)):r.remove(new w(i.row,i.column,i.row,i.column-n+t)),e.start.column=e.end.column=s,e.start.row=e.end.row=i.row,e.cursor=e.end}),t.fromOrientedRange(e[0]),this.renderer.updateCursor(),this.renderer.updateBackMarkers()}else{var n=this.selection.getRange(),l=n.start.row,h=n.end.row,e=l==h;if(e){for(var c,d=this.session.getLength();c=this.session.getLine(h),/[=:]/.test(c)&&++h<d;);for(;c=this.session.getLine(l),/[=:]/.test(c)&&0<--l;);l<0&&(l=0),d<=h&&(h=d-1)}var u=this.session.removeFullLines(l,h),u=this.$reAlignText(u,e);this.session.insert({row:l,column:0},u.join("\n")+"\n"),e||(n.start.column=0,n.end.column=u[u.length-1].length),this.selection.setRange(n)}},this.$reAlignText=function(e,t){function i(e){return p.stringRepeat(" ",e)}function n(e){return e[2]?i(r)+e[2]+i(s-e[2].length+o)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]}var r,s,o,a=!0,l=!0;return e.map(function(e){var t=e.match(/(\s*)(.*?)(\s*)([=:].*)/);return t?(null==r?(r=t[1].length,s=t[2].length,o=t[3].length):(r+s+o!=t[1].length+t[2].length+t[3].length&&(l=!1),r!=t[1].length&&(a=!1),r>t[1].length&&(r=t[1].length),s<t[2].length&&(s=t[2].length),o>t[3].length&&(o=t[3].length)),t):[e]}).map(t?n:a?l?function(e){return e[2]?i(r+s-e[2].length)+e[2]+i(o)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]}:n:function(e){return e[2]?i(r)+e[2]+i(o)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]})}}).call(h.prototype),r.onSessionChange=function(e){var t=e.session,e=(t&&!t.multiSelect&&(t.$selectionMarkers=[],t.selection.$initRangeList(),t.multiSelect=t.selection),this.multiSelect=t&&t.multiSelect,e.oldSession);e&&(e.multiSelect.off("addRange",this.$onAddRange),e.multiSelect.off("removeRange",this.$onRemoveRange),e.multiSelect.off("multiSelect",this.$onMultiSelect),e.multiSelect.off("singleSelect",this.$onSingleSelect),e.multiSelect.lead.off("change",this.$checkMultiselectChange),e.multiSelect.anchor.off("change",this.$checkMultiselectChange)),t&&(t.multiSelect.on("addRange",this.$onAddRange),t.multiSelect.on("removeRange",this.$onRemoveRange),t.multiSelect.on("multiSelect",this.$onMultiSelect),t.multiSelect.on("singleSelect",this.$onSingleSelect),t.multiSelect.lead.on("change",this.$checkMultiselectChange),t.multiSelect.anchor.on("change",this.$checkMultiselectChange)),t&&this.inMultiSelectMode!=t.selection.inMultiSelectMode&&(t.selection.inMultiSelectMode?this.$onMultiSelect():this.$onSingleSelect())},r.MultiSelect=i,e("./config").defineOptions(h.prototype,"editor",{enableMultiselect:{set:function(e){i(this),e?(this.on("changeSession",this.$multiselectOnSessionChange),this.on("mousedown",s)):(this.off("changeSession",this.$multiselectOnSessionChange),this.off("mousedown",s))},value:!0},enableBlockSelect:{set:function(e){this.$blockSelectEnabled=e},value:!0}})}),ace.define("ace/mode/folding/fold_mode",["require","exports","module","ace/range"],function(e,t,i){"use strict";var c=e("../../range").Range,e=t.FoldMode=function(){};!function(){this.foldingStartMarker=null,this.foldingStopMarker=null,this.getFoldWidget=function(e,t,i){e=e.getLine(i);return this.foldingStartMarker.test(e)?"start":"markbeginend"==t&&this.foldingStopMarker&&this.foldingStopMarker.test(e)?"end":""},this.getFoldWidgetRange=function(e,t,i){return null},this.indentationBlock=function(e,t,i){var n=/\S/,r=e.getLine(t),s=r.search(n);if(-1!=s){for(var o,i=i||r.length,a=e.getLength(),r=t,l=t;++t<a;){var h=e.getLine(t).search(n);if(-1!=h){if(h<=s){h=e.getTokenAt(t,0);if(!h||"string"!==h.type)break}l=t}}return r<l?(o=e.getLine(l).length,new c(r,i,l,o)):void 0}},this.openingBracketBlock=function(e,t,i,n,r){i={row:i,column:n+1},n=e.$findClosingBracket(t,i,r);if(n)return"start"==(t=null==(t=e.foldWidgets[n.row])?e.getFoldWidget(n.row):t)&&n.row>i.row&&(n.row--,n.column=e.getLine(n.row).length),c.fromPoints(i,n)},this.closingBracketBlock=function(e,t,i,n,r){i={row:i,column:n},n=e.$findOpeningBracket(t,i);if(n)return n.column++,i.column--,c.fromPoints(n,i)}}.call(e.prototype)}),ace.define("ace/theme/textmate",["require","exports","module","ace/lib/dom"],function(e,t,i){"use strict";t.isDark=!1,t.cssClass="ace-tm",t.cssText='.ace-tm .ace_gutter {background: #f0f0f0;color: #333;}.ace-tm .ace_print-margin {width: 1px;background: #e8e8e8;}.ace-tm .ace_fold {background-color: #6B72E6;}.ace-tm {background-color: #FFFFFF;color: black;}.ace-tm .ace_cursor {color: black;}.ace-tm .ace_invisible {color: rgb(191, 191, 191);}.ace-tm .ace_storage,.ace-tm .ace_keyword {color: blue;}.ace-tm .ace_constant {color: rgb(197, 6, 11);}.ace-tm .ace_constant.ace_buildin {color: rgb(88, 72, 246);}.ace-tm .ace_constant.ace_language {color: rgb(88, 92, 246);}.ace-tm .ace_constant.ace_library {color: rgb(6, 150, 14);}.ace-tm .ace_invalid {background-color: rgba(255, 0, 0, 0.1);color: red;}.ace-tm .ace_support.ace_function {color: rgb(60, 76, 114);}.ace-tm .ace_support.ace_constant {color: rgb(6, 150, 14);}.ace-tm .ace_support.ace_type,.ace-tm .ace_support.ace_class {color: rgb(109, 121, 222);}.ace-tm .ace_keyword.ace_operator {color: rgb(104, 118, 135);}.ace-tm .ace_string {color: rgb(3, 106, 7);}.ace-tm .ace_comment {color: rgb(76, 136, 107);}.ace-tm .ace_comment.ace_doc {color: rgb(0, 102, 255);}.ace-tm .ace_comment.ace_doc.ace_tag {color: rgb(128, 159, 191);}.ace-tm .ace_constant.ace_numeric {color: rgb(0, 0, 205);}.ace-tm .ace_variable {color: rgb(49, 132, 149);}.ace-tm .ace_xml-pe {color: rgb(104, 104, 91);}.ace-tm .ace_entity.ace_name.ace_function {color: #0000A2;}.ace-tm .ace_heading {color: rgb(12, 7, 255);}.ace-tm .ace_list {color:rgb(185, 6, 144);}.ace-tm .ace_meta.ace_tag {color:rgb(0, 22, 142);}.ace-tm .ace_string.ace_regex {color: rgb(255, 0, 0)}.ace-tm .ace_marker-layer .ace_selection {background: rgb(181, 213, 255);}.ace-tm.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px white;}.ace-tm .ace_marker-layer .ace_step {background: rgb(252, 255, 0);}.ace-tm .ace_marker-layer .ace_stack {background: rgb(164, 229, 101);}.ace-tm .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgb(192, 192, 192);}.ace-tm .ace_marker-layer .ace_active-line {background: rgba(0, 0, 0, 0.07);}.ace-tm .ace_gutter-active-line {background-color : #dcdcdc;}.ace-tm .ace_marker-layer .ace_selected-word {background: rgb(250, 250, 255);border: 1px solid rgb(200, 200, 250);}.ace-tm .ace_indent-guide {background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;}',t.$id="ace/theme/textmate",e("../lib/dom").importCssString(t.cssText,t.cssClass)}),ace.define("ace/line_widgets",["require","exports","module","ace/lib/dom"],function(e,t,i){"use strict";function n(e){this.session=e,(this.session.widgetManager=this).session.getRowLength=this.getRowLength,this.session.$getWidgetScreenLength=this.$getWidgetScreenLength,this.updateOnChange=this.updateOnChange.bind(this),this.renderWidgets=this.renderWidgets.bind(this),this.measureWidgets=this.measureWidgets.bind(this),this.session._changedWidgets=[],this.$onChangeEditor=this.$onChangeEditor.bind(this),this.session.on("change",this.updateOnChange),this.session.on("changeFold",this.updateOnFold),this.session.on("changeEditor",this.$onChangeEditor)}var r=e("./lib/dom");(function(){this.getRowLength=function(e){var t=this.lineWidgets&&this.lineWidgets[e]&&this.lineWidgets[e].rowCount||0;return this.$useWrapMode&&this.$wrapData[e]?this.$wrapData[e].length+1+t:1+t},this.$getWidgetScreenLength=function(){var t=0;return this.lineWidgets.forEach(function(e){e&&e.rowCount&&!e.hidden&&(t+=e.rowCount)}),t},this.$onChangeEditor=function(e){this.attach(e.editor)},this.attach=function(e){e&&e.widgetManager&&e.widgetManager!=this&&e.widgetManager.detach(),this.editor!=e&&(this.detach(),this.editor=e)&&(e.widgetManager=this,e.renderer.on("beforeRender",this.measureWidgets),e.renderer.on("afterRender",this.renderWidgets))},this.detach=function(e){var t=this.editor;t&&(this.editor=null,t.widgetManager=null,t.renderer.off("beforeRender",this.measureWidgets),t.renderer.off("afterRender",this.renderWidgets),t=this.session.lineWidgets)&&t.forEach(function(e){e&&e.el&&e.el.parentNode&&(e._inDocument=!1,e.el.parentNode.removeChild(e.el))})},this.updateOnFold=function(e,t){var i=t.lineWidgets;if(i&&e.action){for(var t=e.data,n=t.start.row,r=t.end.row,s="add"==e.action,o=n+1;o<r;o++)i[o]&&(i[o].hidden=s);i[r]&&(s?i[n]?i[r].hidden=s:i[n]=i[r]:(i[n]==i[r]&&(i[n]=void 0),i[r].hidden=s))}},this.updateOnChange=function(e){var t,i,n,r=this.session.lineWidgets;r&&(t=e.start.row,0!=(i=e.end.row-t))&&("remove"==e.action?(n=r.splice(t+1,i),!r[t]&&n[n.length-1]&&(r[t]=n.pop()),n.forEach(function(e){e&&this.removeLineWidget(e)},this)):(n=new Array(i),r[t]&&null!=r[t].column&&e.start.column>r[t].column&&t++,n.unshift(t,0),r.splice.apply(r,n)),this.$updateRows())},this.$updateRows=function(){var i,e=this.session.lineWidgets;e&&(i=!0,e.forEach(function(e,t){if(e)for(i=!1,e.row=t;e.$oldWidget;)e.$oldWidget.row=t,e=e.$oldWidget}),i)&&(this.session.lineWidgets=null)},this.$registerLineWidget=function(e){this.session.lineWidgets||(this.session.lineWidgets=new Array(this.session.getLength()));var t=this.session.lineWidgets[e.row];return t&&(e.$oldWidget=t).el&&t.el.parentNode&&(t.el.parentNode.removeChild(t.el),t._inDocument=!1),this.session.lineWidgets[e.row]=e},this.addLineWidget=function(e){var t,i,n;return this.$registerLineWidget(e),e.session=this.session,this.editor&&(t=this.editor.renderer,e.html&&!e.el&&(e.el=r.createElement("div"),e.el.innerHTML=e.html),e.el&&(r.addCssClass(e.el,"ace_lineWidgetContainer"),e.el.style.position="absolute",e.el.style.zIndex=5,t.container.appendChild(e.el),e._inDocument=!0,e.coverGutter||(e.el.style.zIndex=3),null==e.pixelHeight)&&(e.pixelHeight=e.el.offsetHeight),null==e.rowCount&&(e.rowCount=e.pixelHeight/t.layerConfig.lineHeight),i=this.session.getFoldAt(e.row,0),(e.$fold=i)&&(n=this.session.lineWidgets,e.row!=i.end.row||n[i.start.row]?e.hidden=!0:n[i.start.row]=e),this.session._emit("changeFold",{data:{start:{row:e.row}}}),this.$updateRows(),this.renderWidgets(null,t),this.onWidgetChanged(e)),e},this.removeLineWidget=function(e){if(e._inDocument=!1,e.session=null,e.el&&e.el.parentNode&&e.el.parentNode.removeChild(e.el),e.editor&&e.editor.destroy)try{e.editor.destroy()}catch(e){}if(this.session.lineWidgets){var t=this.session.lineWidgets[e.row];if(t==e)this.session.lineWidgets[e.row]=e.$oldWidget,e.$oldWidget&&this.onWidgetChanged(e.$oldWidget);else for(;t;){if(t.$oldWidget==e){t.$oldWidget=e.$oldWidget;break}t=t.$oldWidget}}this.session._emit("changeFold",{data:{start:{row:e.row}}}),this.$updateRows()},this.getWidgetsAtRow=function(e){for(var t=this.session.lineWidgets,i=t&&t[e],n=[];i;)n.push(i),i=i.$oldWidget;return n},this.onWidgetChanged=function(e){this.session._changedWidgets.push(e),this.editor&&this.editor.renderer.updateFull()},this.measureWidgets=function(e,t){var i=this.session._changedWidgets,n=t.layerConfig;if(i&&i.length){for(var r=1/0,s=0;s<i.length;s++){var o=i[s];if(o&&o.el&&o.session==this.session){if(!o._inDocument){if(this.session.lineWidgets[o.row]!=o)continue;o._inDocument=!0,t.container.appendChild(o.el)}o.h=o.el.offsetHeight,o.fixedWidth||(o.w=o.el.offsetWidth,o.screenWidth=Math.ceil(o.w/n.characterWidth));var a=o.h/n.lineHeight;o.coverLine&&(a-=this.session.getRowLineCount(o.row))<0&&(a=0),o.rowCount!=a&&(o.rowCount=a,o.row<r)&&(r=o.row)}}r!=1/0&&(this.session._emit("changeFold",{data:{start:{row:r}}}),this.session.lineWidgetWidth=null),this.session._changedWidgets=[]}},this.renderWidgets=function(e,t){var i=t.layerConfig,n=this.session.lineWidgets;if(n){for(var r=Math.min(this.firstRow,i.firstRow),s=Math.max(this.lastRow,i.lastRow,n.length);0<r&&!n[r];)r--;this.firstRow=i.firstRow,this.lastRow=i.lastRow,t.$cursorLayer.config=i;for(var o=r;o<=s;o++){var a,l=n[o];l&&l.el&&(l.hidden?l.el.style.top=-100-(l.pixelHeight||0)+"px":(l._inDocument||(l._inDocument=!0,t.container.appendChild(l.el)),a=t.$cursorLayer.getPixelPosition({row:o,column:0},!0).top,l.coverLine||(a+=i.lineHeight*this.session.getRowLineCount(l.row)),l.el.style.top=a-i.offset+"px",a=l.coverGutter?0:t.gutterWidth,l.fixedWidth||(a-=t.scrollLeft),l.el.style.left=a+"px",l.fullWidth&&l.screenWidth&&(l.el.style.minWidth=i.width+2*i.padding+"px"),l.fixedWidth?l.el.style.right=t.scrollBar.getWidth()+"px":l.el.style.right=""))}}}}).call(n.prototype),t.LineWidgets=n}),ace.define("ace/ext/error_marker",["require","exports","module","ace/line_widgets","ace/lib/dom","ace/range"],function(e,t,i){"use strict";function h(e,t,i){var n=e.getAnnotations().sort(a.comparePoints);if(n.length){var r=function(e,t,i){for(var n=0,r=e.length-1;n<=r;){var s=n+r>>1,o=i(t,e[s]);if(0<o)n=1+s;else{if(!(o<0))return s;r=s-1}}return-(n+1)}(n,{row:t,column:-1},a.comparePoints),s=((r=r<0?-r-1:r)>=n.length?r=0<i?0:n.length-1:0===r&&i<0&&(r=n.length-1),n[r]);if(s&&i){if(s.row===t){for(;(s=n[r+=i])&&s.row===t;);if(!s)return n.slice()}var o=[];for(t=s.row;o[i<0?"unshift":"push"](s),(s=n[r+=i])&&s.row==t;);return o.length&&o}}}var c=e("../line_widgets").LineWidgets,d=e("../lib/dom"),a=e("../range").Range;t.showErrorMarker=function(e,t){var i,n=e.session,r=(n.widgetManager||(n.widgetManager=new c(n),n.widgetManager.attach(e)),e.getCursorPosition()),s=r.row,o=n.widgetManager.getWidgetsAtRow(s).filter(function(e){return"errorMarker"==e.type})[0],s=(o?o.destroy():s-=t,h(n,s,t));if(s){t=s[0];r.column=(t.pos&&"number"!=typeof t.column?t.pos.sc:t.column)||0,r.row=t.row,i=e.renderer.$gutterLayer.$annotations[r.row]}else{if(o)return;i={text:["Looks good!"],className:"ace_ok"}}e.session.unfold(r.row),e.selection.moveToPosition(r);function a(e,t,i){if(0===t&&("esc"===i||"return"===i))return l.destroy(),{command:"null"}}var l={row:r.row,fixedWidth:!0,coverGutter:!0,el:d.createElement("div"),type:"errorMarker"},s=l.el.appendChild(d.createElement("div")),t=l.el.appendChild(d.createElement("div")),o=(t.className="error_widget_arrow "+i.className,e.renderer.$cursorLayer.getPixelPosition(r).left);t.style.left=o+e.renderer.gutterWidth-5+"px",l.el.className="error_widget_wrapper",s.className="error_widget "+i.className,s.innerHTML=i.text.join("<br>"),s.appendChild(d.createElement("div"));l.destroy=function(){e.$mouseHandler.isMousePressed||(e.keyBinding.removeKeyboardHandler(a),n.widgetManager.removeLineWidget(l),e.off("changeSelection",l.destroy),e.off("changeSession",l.destroy),e.off("mouseup",l.destroy),e.off("change",l.destroy))},e.keyBinding.addKeyboardHandler(a),e.on("changeSelection",l.destroy),e.on("changeSession",l.destroy),e.on("mouseup",l.destroy),e.on("change",l.destroy),e.session.widgetManager.addLineWidget(l),l.el.onmousedown=e.focus.bind(e),e.renderer.scrollCursorIntoView(null,.5,{bottom:l.el.offsetHeight})},d.importCssString(" .error_widget_wrapper { background: inherit; color: inherit; border:none } .error_widget { border-top: solid 2px; border-bottom: solid 2px; margin: 5px 0; padding: 10px 40px; white-space: pre-wrap; } .error_widget.ace_error, .error_widget_arrow.ace_error{ border-color: #ff5a5a } .error_widget.ace_warning, .error_widget_arrow.ace_warning{ border-color: #F1D817 } .error_widget.ace_info, .error_widget_arrow.ace_info{ border-color: #5a5a5a } .error_widget.ace_ok, .error_widget_arrow.ace_ok{ border-color: #5aaa5a } .error_widget_arrow { position: absolute; border: solid 5px; border-top-color: transparent!important; border-right-color: transparent!important; border-left-color: transparent!important; top: -5px; }","")}),ace.define("ace/ace",["require","exports","module","ace/lib/fixoldbrowsers","ace/lib/dom","ace/lib/event","ace/range","ace/editor","ace/edit_session","ace/undomanager","ace/virtual_renderer","ace/worker/worker_client","ace/keyboard/hash_handler","ace/placeholder","ace/multi_select","ace/mode/folding/fold_mode","ace/theme/textmate","ace/ext/error_marker","ace/config"],function(e,s,t){"use strict";e("./lib/fixoldbrowsers");var o=e("./lib/dom"),a=e("./lib/event"),i=e("./range").Range,l=e("./editor").Editor,n=e("./edit_session").EditSession,r=e("./undomanager").UndoManager,h=e("./virtual_renderer").VirtualRenderer;e("./worker/worker_client"),e("./keyboard/hash_handler"),e("./placeholder"),e("./multi_select"),e("./mode/folding/fold_mode"),e("./theme/textmate"),e("./ext/error_marker"),s.config=e("./config"),s.require=e,"function"==typeof define&&(s.define=define),s.edit=function(e,t){if("string"==typeof e){var i=e;if(!(e=document.getElementById(i)))throw new Error("ace.edit can't find div #"+i)}var n,r;return e&&e.env&&e.env.editor instanceof l?e.env.editor:(i="",e&&/input|textarea/i.test(e.tagName)?(i=(n=e).value,e=o.createElement("pre"),n.parentNode.replaceChild(e,n)):e&&(i=e.textContent,e.innerHTML=""),i=s.createEditSession(i),e=new l(new h(e),i,t),r={document:i,editor:e,onResize:e.resize.bind(e,null)},n&&(r.textarea=n),a.addListener(window,"resize",r.onResize),e.on("destroy",function(){a.removeListener(window,"resize",r.onResize),r.editor.container.env=null}),e.container.env=e.env=r,e)},s.createEditSession=function(e,t){e=new n(e,t);return e.setUndoManager(new r),e},s.Range=i,s.Editor=l,s.EditSession=n,s.UndoManager=r,s.VirtualRenderer=h,s.version=s.config.version}),ace.require(["ace/ace"],function(e){for(var t in e&&(e.config.init(!0),e.define=ace.define),window.ace||(window.ace=e),e)e.hasOwnProperty(t)&&(window.ace[t]=e[t]);window.ace.default=window.ace,"object"==typeof module&&"object"==typeof exports&&module&&(module.exports=window.ace)}),angular.module("ui.ace",[]).constant("uiAceConfig",{}).directive("uiAce",["uiAceConfig",function(i){if(angular.isUndefined(window.ace))throw new Error("ui-ace need ace to work... (o rly?)");return{restrict:"EA",require:"?ngModel",link:function(o,e,a,n){function r(){var e=arguments[0],t=Array.prototype.slice.call(arguments,1);angular.isDefined(e)&&o.$evalAsync(function(){if(!angular.isFunction(e))throw new Error("ui-ace use a function as callback.");e(t)})}function t(e,t){if(e!==t){(d=angular.extend({},c,o.$eval(a.uiAce))).callbacks=[d.onLoad],d.onLoad!==c.onLoad&&d.callbacks.unshift(c.onLoad),p.removeListener("change",l),l=m(d.onChange),p.on("change",l),u.removeListener("blur",h),h=g(d.onBlur),u.on("blur",h);var i,n,r=u,e=p,s=d;if(angular.isDefined(s.workerPath)&&window.ace.require("ace/config").set("workerPath",s.workerPath),angular.isDefined(s.require)&&s.require.forEach(function(e){window.ace.require(e)}),angular.isDefined(s.showGutter)&&r.renderer.setShowGutter(s.showGutter),angular.isDefined(s.useWrapMode)&&e.setUseWrapMode(s.useWrapMode),angular.isDefined(s.showInvisibles)&&r.renderer.setShowInvisibles(s.showInvisibles),angular.isDefined(s.showIndentGuides)&&r.renderer.setDisplayIndentGuides(s.showIndentGuides),angular.isDefined(s.useSoftTabs)&&e.setUseSoftTabs(s.useSoftTabs),angular.isDefined(s.showPrintMargin)&&r.setShowPrintMargin(s.showPrintMargin),angular.isDefined(s.disableSearch)&&s.disableSearch&&r.commands.addCommands([{name:"unfind",bindKey:{win:"Ctrl-F",mac:"Command-F"},exec:function(){return!1},readOnly:!0}]),angular.isString(s.theme)&&r.setTheme("ace/theme/"+s.theme),angular.isString(s.mode)&&e.setMode("ace/mode/"+s.mode),angular.isDefined(s.firstLineNumber)&&(angular.isNumber(s.firstLineNumber)?e.setOption("firstLineNumber",s.firstLineNumber):angular.isFunction(s.firstLineNumber)&&e.setOption("firstLineNumber",s.firstLineNumber())),angular.isDefined(s.advanced))for(i in s.advanced)n={name:i,value:s.advanced[i]},r.setOption(n.name,n.value);if(angular.isDefined(s.rendererOptions))for(i in s.rendererOptions)n={name:i,value:s.rendererOptions[i]},r.renderer.setOption(n.name,n.value);angular.forEach(s.callbacks,function(e){angular.isFunction(e)&&e(r)})}}var l,h,c=i.ace||{},d=angular.extend({},c,o.$eval(a.uiAce)),u=window.ace.edit(e[0]),p=u.getSession(),m=function(i){return function(e){var t=p.getValue();!n||t===n.$viewValue||o.$$phase||o.$root.$$phase||o.$evalAsync(function(){n.$setViewValue(t)}),r(i,e,u)}},g=function(e){return function(){r(e,u)}};a.$observe("readonly",function(e){u.setReadOnly(!!e||""===e)}),n&&(n.$formatters.push(function(e){if(angular.isUndefined(e)||null===e)return"";if(angular.isObject(e)||angular.isArray(e))throw new Error("ui-ace cannot use an object or an array as a model");return e}),n.$render=function(){p.setValue(n.$viewValue)});o.$watch(a.uiAce,t,!0),t(c),e.on("$destroy",function(){u.session.$stopWorker(),u.destroy()}),o.$watch(function(){return[e[0].offsetWidth,e[0].offsetHeight]},function(){u.resize(),u.renderer.updateFull()},!0)}}}]),angular.module("anonymous-github",["ngRoute","ngSanitize","ui.ace","ngPDFViewer","htmlDoc","pascalprecht.translate","admin"]).config(["$routeProvider","$locationProvider","$translateProvider",function(e,t,i){i.useStaticFilesLoader({prefix:"/i18n/locale-",suffix:".json"}),i.preferredLanguage("en"),e.when("/",{templateUrl:"/partials/home.htm",controller:"homeController",title:"Anonymous GitHub Share the code, not the author"}).when("/dashboard",{templateUrl:"/partials/dashboard.htm",controller:"unifiedDashboardController",title:"Your anonymizations Anonymous GitHub"}).when("/pr-dashboard",{redirectTo:"/dashboard"}).when("/anonymize/:repoId?",{templateUrl:"/partials/anonymize.htm",controller:"anonymizeController",title:"New anonymization Anonymous GitHub"}).when("/pull-request-anonymize/:pullRequestId?",{templateUrl:"/partials/anonymize.htm",controller:"anonymizeController",title:"Anonymize a pull request Anonymous GitHub"}).when("/gist-anonymize/:gistId?",{templateUrl:"/partials/anonymize.htm",controller:"anonymizeController",title:"Anonymize a gist Anonymous GitHub"}).when("/status/:repoId",{templateUrl:"/partials/status.htm",controller:"statusController",title:"Repository status Anonymous GitHub"}).when("/conferences",{templateUrl:"/partials/conferences.htm",controller:"conferencesController",title:"Your conferences Anonymous GitHub"}).when("/conference/new",{templateUrl:"/partials/newConference.htm",controller:"newConferenceController",title:"New conference Anonymous GitHub"}).when("/conference/:conferenceId/edit",{templateUrl:"/partials/newConference.htm",controller:"newConferenceController",title:"Edit conference Anonymous GitHub"}).when("/conference/:conferenceId",{templateUrl:"/partials/conference.htm",controller:"conferenceController",title:"Conference Anonymous GitHub"}).when("/faq",{templateUrl:"/partials/faq.htm",controller:"faqController",title:"FAQ Anonymous GitHub"}).when("/profile",{templateUrl:"/partials/profile.htm",controller:"profileController",title:"Your settings Anonymous GitHub"}).when("/claim",{templateUrl:"/partials/claim.htm",controller:"claimController",title:"Claim an anonymization Anonymous GitHub"}).when("/pr/:pullRequestId/:path*?",{templateUrl:"/partials/pullRequest.htm",controller:"pullRequestController",title:"Anonymous pull request Anonymous GitHub",reloadOnUrl:!1}).when("/gist/:gistId/:path*?",{templateUrl:"/partials/gist.htm",controller:"gistController",title:"Anonymous gist Anonymous GitHub",reloadOnUrl:!1}).when("/r/:repoId/:path*?",{templateUrl:"/partials/explorer.htm",controller:"exploreController",title:"Anonymous repository Anonymous GitHub",reloadOnUrl:!1}).when("/repository/:repoId/:path*?",{templateUrl:"/partials/explorer.htm",controller:"exploreController",title:"Anonymous repository Anonymous GitHub",reloadOnUrl:!1}).when("/admin/",{templateUrl:"/partials/admin/overview.htm",controller:"overviewAdminController",title:"Admin · Overview Anonymous GitHub"}).when("/admin/repositories",{templateUrl:"/partials/admin/repositories.htm",controller:"repositoriesAdminController",title:"Admin · Repositories Anonymous GitHub"}).when("/admin/users",{templateUrl:"/partials/admin/users.htm",controller:"usersAdminController",title:"Admin · Users Anonymous GitHub"}).when("/admin/users/:username",{templateUrl:"/partials/admin/user.htm",controller:"userAdminController",title:"Admin · User details Anonymous GitHub"}).when("/admin/conferences",{templateUrl:"/partials/admin/conferences.htm",controller:"conferencesAdminController",title:"Admin · Conferences Anonymous GitHub"}).when("/admin/queues",{templateUrl:"/partials/admin/queues.htm",controller:"queuesAdminController",title:"Admin · Queues Anonymous GitHub"}).when("/admin/errors",{templateUrl:"/partials/admin/errors.htm",controller:"errorsAdminController",title:"Admin · Errors Anonymous GitHub"}).when("/404",{templateUrl:"/partials/404.htm",title:"Page not found Anonymous GitHub"}).otherwise({templateUrl:"/partials/404.htm",title:"Page not found Anonymous GitHub"}),t.html5Mode(!0)}]).filter("humanFileSize",function(){return humanFileSize}).filter("bigNum",function(){return function(e){var e=Number(e)||0,t=Math.abs(e);return t<1e3?String(e):t<1e4?(e/1e3).toFixed(1).replace(/\.0$/,"")+"k":t<1e6?Math.round(e/1e3)+"k":t<1e7?(e/1e6).toFixed(1).replace(/\.0$/,"")+"M":Math.round(e/1e6)+"M"}}).filter("humanTime",function(){return function(e){if(!e)return"never";var t,i=(e="string"!=typeof(e=e instanceof Date?Math.round((Date.now()-e)/1e3):e)&&"number"!=typeof e?e:Math.round((Date.now()-new Date(e))/1e3))<0?"from now":"ago";if(172800<Math.abs(e))return(t=new Date).setSeconds(t.getSeconds()-e),"on "+t.toLocaleDateString();for(var n=[(e=Math.abs(e))/60/60/24/365,e/60/60/24/30,e/60/60/24/7,e/60/60/24,e/60/60,e/60,e],r=["year","month","week","day","hour","minute","second"],s=0;s<r.length;s++){var o=Math.floor(n[s]),a=r[s];if(1<o&&(a+="s"),1<=o)return o+" "+a+" "+i}return"0 seconds "+i}}).filter("title",function(){return function(e){return e&&(e=e.toLowerCase()).split(" ").map(function(e){return e.charAt(0).toUpperCase()+e.substring(1,e.length)}).join(" ")}}).filter("statusMsg",function(){return function(e){var t,i;return e&&((t=e.match(/^rate_limited:(\d+)$/))?(t=Math.max(0,Math.ceil((parseInt(t[1],10)-Date.now())/1e3)))<=0?"Rate limited — resuming soon":(i=t%60,"Rate limited — retrying in "+(0<(t=Math.floor(t/60))?t+"m "+i+"s":i+"s")):e)}}).filter("diff",["$sce",function(c){const s=e=>e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");function d(e,t){if(t){var i=t.newPath&&"/dev/null"!==t.newPath?t.newPath:t.oldPath||"",n="/dev/null"===t.oldPath?"added":"/dev/null"===t.newPath?"deleted":t.oldPath&&t.newPath&&t.oldPath!==t.newPath?"renamed":"modified";if(e.push('<div class="diff-file-block">'),e.push('<div class="diff-file-header"><span class="diff-file-icon"><i class="far fa-file-code"></i></span><span class="diff-file-name">'+s(i)+'</span><span class="diff-file-status diff-file-status-'+n+'">'+n+"</span></div>"),t.lines.length){e.push('<table class="diff-file-table"><tbody>');for(const r of t.lines)e.push('<tr class="diff-row diff-row-'+r.kind+'"><td class="diff-gutter diff-gutter-old">'+(r.oldNo||"")+'</td><td class="diff-gutter diff-gutter-new">'+(r.newNo||"")+'</td><td class="diff-sign">'+("add"===r.kind?"+":"remove"===r.kind?"-":"hunk"===r.kind?"@":"")+'</td><td class="diff-code">'+s(r.text)+"</td></tr>");e.push("</tbody></table>")}e.push("</div>")}}return function(e){if(!e)return e;const t=[];let i=null,n=0,r=0;var s=()=>i=i||{oldPath:"",newPath:"",lines:[]},o=()=>{i&&(i.lines.length||i.oldPath||i.newPath)&&(d(t,i),i=null)},a=e.split("\n");for(let e=0;e<a.length;e++){var l,h=a[e];h.startsWith("diff --git")?(o(),s()):h.startsWith("--- ")?(i&&i.lines.length&&o(),s().oldPath=h.replace(/^--- (a\/)?/,"").trim()):h.startsWith("+++ ")?s().newPath=h.replace(/^\+\+\+ (b\/)?/,"").trim():h.startsWith("index ")||h.startsWith("similarity index")||h.startsWith("rename ")||h.startsWith("new file mode")||h.startsWith("deleted file mode")||h.startsWith("Binary files")||(h.startsWith("@@")?((l=h.match(/@@\s+-(\d+)(?:,\d+)?\s+\+(\d+)(?:,\d+)?\s+@@/))&&(n=parseInt(l[1],10),r=parseInt(l[2],10)),s().lines.push({kind:"hunk",oldNo:"",newNo:"",text:h})):i&&(h.startsWith("+")?(i.lines.push({kind:"add",oldNo:"",newNo:r,text:h.slice(1)}),r++):h.startsWith("-")?(i.lines.push({kind:"remove",oldNo:n,newNo:"",text:h.slice(1)}),n++):(i.lines.push({kind:"ctx",oldNo:n,newNo:r,text:h.startsWith(" ")?h.slice(1):h}),n++,r++)))}return d(t,i),c.trustAsHtml(t.join(""))}}]).directive("gistFile",["$location","$timeout","$sce",function(e,r,t){const s={javascript:"javascript",js:"javascript",typescript:"javascript",ts:"javascript",jsx:"javascript",tsx:"javascript",python:"python",py:"python",ipynb:"json",r:"r",julia:"julia",html:"markup",xml:"markup",svg:"markup",json:"json",yaml:"yaml",yml:"yaml",bash:"bash",sh:"bash",shell:"bash",css:"css",scss:"css",c:"c","c++":"cpp",cpp:"cpp",java:"java",go:"go",rust:"rust",ruby:"ruby",php:"php",sql:"sql",diff:"diff"};function o(e){var t=(e||"").lastIndexOf(".");return t<0?"":e.slice(t+1).toLowerCase()}return{restrict:"E",scope:{file:"=",terms:"=",options:"="},template:'<div ng-if="kind === \'md\'"><markdown content="file.content" terms="terms" options="options"></markdown></div><pre ng-if="kind === \'code\'" class="line-numbers"><code class="{{prismClass}}" ng-bind="file.content"></code></pre>',link:function(i,n){function e(){var e,t;i.file&&(i.kind=(e=i.file,"md"===(t=o(e&&e.filename))||"markdown"===t||e&&"Markdown"===e.language?"md":"code"),i.prismClass="language-"+(t=i.file,t&&t.language&&s[t.language.toLowerCase()]||s[o(t&&t.filename)]||"none"),r(()=>{n[0].querySelectorAll("pre code").forEach(e=>{window.Prism&&Prism.highlightElement(e)})},50))}i.$watch("file",e),i.$watch("file.content",e),i.$watch("terms",e),i.$watch("options",e,!0)}}}]).directive("markdown",["$location",function(r){return{restrict:"E",scope:{terms:"=",options:"=",content:"="},link:function(e,t,i){function n(){t.html(renderMD(e.content,r.url()+"/../"))}e.$watch(i.terms,n),e.$watch("terms",n),e.$watch("options",n),e.$watch("content",n)}}}]).directive("tree",[function(){return{restrict:"E",scope:{file:"=",parent:"@",searchQuery:"=",searchResults:"="},controller:["$element","$scope","$routeParams","$compile",function(i,g,n,r){if(g.repoId=document.location.pathname.split("/")[2],g.opens={},n.path){let t="";n.path.split("/").forEach(e=>{g.opens[t+"/"+e]=!0,t=t+"/"+e})}function s(e){var t,i=[];const n={"":{child:i}};for(t of e){if(t.path&&!n[t.path]){o=a=s=r=void 0;var r=t.path;if(!n[r]){var s=r.split("/");let t="";for(let e=0;e<s.length;e++){var o,a=t;t=t?t+"/"+s[e]:s[e],n[t]||(o={name:s[e],child:[]},n[t]=o,n[a].child.push(o))}}}var l,r=n[t.path||""].child;let e=t.path+"/"+t.name;e.startsWith("/")&&(e=e.substring(1)),null!=t.size?r.push({name:t.name,size:t.size,sha:t.sha}):n[e]||(l={name:t.name,child:[]},n[e]=l,r.push(l))}return i}const f=(e,t)=>{var i=!!e.child,n=!!t.child;return i&&n?e.name.localeCompare(t.name):i?-1:n?1:e.name.localeCompare(t.name)};function v(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function y(e,t,o){if(!e)return"";let a="<ul>";for(var l of e=e.sort(f))if(!o||function t(e,i,n){if(!n)return!0;const r=i?i+"/"+e.name:e.name;return e.child?!!n.folders.has(r)||e.child.some(e=>t(e,r,n)):n.paths.has(r)}(l,t?t.substring(1):"",o)){let i=!!l.child,n=l.name,r=l.size,s=l;if(i){let e=n,t=l.child;for(;t&&1==t.length;)e+="/"+t[0].name,r=t[0].size,t=t[0].child;n=e,s=t?{child:t}:l,null!=r&&0<=r&&(i=!1)}var l=null!=r?"Size: "+humanFileSize(r||0):"",h=t+"/"+n,c=i&&(d=h,c=void 0,c=g.$parent.fileCounts)&&c[d.startsWith("/")?d.substring(1):d]||0,d=o?!1!==g.opens[h]:g.opens[h],u=["file"],p=(i&&u.push("folder"),d&&u.push("open"),g.isActive(h)&&u.push("active"),i&&(m=h,p=void 0,!!(p=g.$parent.options&&g.$parent.options.truncatedFolders||[]).length)&&(m=m.startsWith("/")?m.substring(1):m,-1!==p.indexOf(m))),m=(p&&u.push("truncated"),String(h).replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;"));if(a+=`<li class="${u.join(" ")}" ng-class="{active: isActive('${m}'), open: ${o?"opens['"+m+"'] !== false":"opens['"+m+"']"}}" title="${v(l)}">`,i?(a+=`<a ng-click="openFolder('${m}', $event)"><span class="tree-toggle"></span><span class="tree-icon-folder"></span><span class="tree-name">${v(n)}</span>`,p&&(a+=`<span class="truncated-warning" title="{{ 'WARNINGS.folder_truncated' | translate }}"><i class="fas fa-exclamation-triangle"></i></span>`),0<c&&(a+=`<span class="tree-count">${c}</span>`),a+="</a>"):(u=""!==t,a+=`<a href='/r/${g.repoId}${encodePathForUrl(h)}'>${u?'<span class="tree-spacer"></span>':""}<span class="tree-icon-file"></span><span class="tree-name">${v(n)}</span></a>`),d&&s.child){l=s.child;if(1<l.length)a+=y(l,h,o);else if(i){let e=l;for(;e&&1==e.length;)e=e[0].child;a+=y(e,h,o)}}a+="</li>"}var m,p,d,c;return a+"</ul>"}function o(){i.html("");var e=g.searchQuery?function(){var e=g.searchResults;if(!e||!e.length)return null;var t=new Set,i=new Set;for(const r of e){var n=r.path?r.path+"/"+r.name:r.name;if(t.add(n),r.path){let e="";for(const s of r.path.split("/").filter(Boolean))e=e?e+"/"+s:s,i.add(e)}}return{paths:t,folders:i}}():null;let t;t=null!==e&&0===e.paths.size?'<div class="tree-search-empty">No files found</div>':y(s(g.file).sort(f),"",e),r(t)(g,e=>{i.append(e),a&&(e=function(e){if(e)for(var t=l(),i=0;i<t.length;i++)if(c(t[i])===e)return t[i];return null}(a))&&(e.classList.add("tree-focused"),i[0].focus())})}g.$watch("file",e=>{if(null!=e){if(0==e.length)return i.html("Empty repository");!function e(t,i){if(t)for(const r of t){var n;r.child&&0!==r.child.length&&((n=i+"/"+r.name)in g.opens||(g.opens[n]=!0),e(r.child,n))}}(s(e),""),o()}},!0),g.$watch("searchResults",(e,t)=>{e!==t&&g.file&&g.file.length&&o()}),g.$watch("searchQuery",(e,t)=>{e!==t&&!e&&g.file&&g.file.length&&o()}),g.isActive=function(e){return n.path==e.substring(1)},g.openFolder=function(e,t){var i=g.opens[e],i=(void 0===i&&g.searchQuery&&(i=!0),g.opens[e]=!i,t.target.closest("li")),t=i?i.querySelector(":scope > ul"):null;null!=t&&0!==t.children.length||g.$parent.getFiles(e.substring(1))};var a=n.path?"/"+n.path:null;function l(){return Array.from(i[0].querySelectorAll("li > a"))}function h(){return i[0].querySelector("a.tree-focused")}function c(e){var t,i;return e?(t=e.getAttribute("href"))?(i="/r/"+g.repoId,0===t.indexOf(i)?decodeURIComponent(t.substring(i.length)):null):(t=e.getAttribute("ng-click"))&&(i=t.match(/openFolder\('([^']+)'/))?i[1]:null:null}function d(e){var t=h();t&&t.classList.remove("tree-focused"),a=e?(e.classList.add("tree-focused"),e.scrollIntoView({block:"nearest"}),c(e)):null}i[0].setAttribute("tabindex","0"),i[0].addEventListener("keydown",function(e){var t,i,n,r=l();r.length&&(n=(t=h())?r.indexOf(t):-1,"ArrowDown"===e.key?(e.preventDefault(),d(r[n<r.length-1?n+1:0])):"ArrowUp"===e.key?(e.preventDefault(),d(r[0<n?n-1:r.length-1])):"ArrowRight"===e.key?(e.preventDefault(),t&&(i=t.closest("li"))&&i.classList.contains("folder")&&(i.classList.contains("open")?(n=i.querySelector(":scope > ul > li > a"))&&d(n):t.click())):"ArrowLeft"===e.key?(e.preventDefault(),t&&((i=t.closest("li"))&&i.classList.contains("folder")&&i.classList.contains("open")?t.click():(r=i&&i.parentElement?i.parentElement.closest("li.folder"):null)&&(n=r.querySelector(":scope > a"))&&d(n))):"Enter"===e.key&&(e.preventDefault(),t)&&t.click())}),i[0].addEventListener("click",function(e){e=e.target.closest("a");e&&i[0].contains(e)&&d(e)})}]}}]).directive("notebook",[function(){return{restrict:"E",scope:{file:"="},controller:["$element","$scope","$http",function(i,e,t){function n(e){e=nb.parse(e);try{i.html("");var t=e.render();i.html(DOMPurify.sanitize(t)),Prism.highlightAll()}catch(e){i.html("Unable to render the notebook.")}}function r(){if(e.$parent.content)try{n(JSON.parse(e.$parent.content))}catch(e){i.html("Unable to render the notebook invalid notebook format.")}else e.file&&t.get(e.file.download_url).then(e=>n(e.data))}e.$watch("file",e=>{r()}),r()}]}}]).directive("loc",[function(){return{restrict:"E",scope:{stats:"="},template:"<div class='lang' ng-repeat='lang in elements' title='{{lang.lang|title}}: {{lang.loc | number}} lines' data-toggle='tooltip' data-placement='bottom' style='width:{{lang.loc*100/total}}%;background:{{lang.color}};'></div>",controller:["$scope",function(i){function t(){for(var e in i.elements=[],i.total=0,i.stats){var t=i.stats[e].code;t&&(i.total+=t,i.elements.push({lang:e,loc:t,color:langColors[e]}))}setTimeout(()=>{$('[data-toggle="tooltip"]').tooltip()},100)}i.$watch("stats",e=>{t()}),t()}]}}]).controller("mainController",["$scope","$http","$location","$timeout",function(r,e,i,t){function n(e,t){t&&(r.title=t.title),r.path=i.url(),r.paths=i.path().substring(1).split("/")}r.title="Main",r.user={status:"connection"},r.site_options,r.toasts=[],r.removeToast=function(e){e=r.toasts.indexOf(e);-1!==e&&r.toasts.splice(e,1)},r.addToast=function(e){return r.toasts.push(e),t(function(){r.removeToast(e)},8e3),e},r.path=i.url(),r.paths=i.path().substring(1).split("/"),r.darkMode=function(e){localStorage.setItem("darkMode",e);var t,i="/css/prism-okaidia.css",n="/css/prism.css",n=(((r.isDarkMode=e)?($("body").addClass("dark-mode"),(t=document.createElement("link")).href=i,t.rel="stylesheet",document.head.append(t),$(`link[href='${n}']`)):($("body").removeClass("dark-mode"),(t=document.createElement("link")).href=n,t.rel="stylesheet",document.head.append(t),$(`link[href='${i}']`))).remove(),document.querySelector(".floatingchat-container-wrap-mo498 .floating-chat-kofi-text-container-wrap"));n&&(n.style.backgroundColor=e?"#FAF9F6":"#1A1815",n.style.color=e?"#1A1815":"#FAF9F6"),r.$broadcast("dark-mode",e)},r.darkMode("true"==localStorage.getItem("darkMode")),e.get("/api/user").then(e=>{e&&(r.user=e.data)},()=>{r.user=null}),e.get("/api/options").then(e=>{e&&(r.site_options=e.data)},()=>{r.site_options=null}),e.get("/api/message").then(e=>{e&&(r.generalMessage=e.data)},()=>{r.generalMessage=null}),r.$on("$routeChangeSuccess",n),r.$on("$routeUpdate",n)}]).controller("faqController",["$scope","$http",function(e,t){}]).controller("profileController",["$scope","$http",function(t,i){function n(){i.get("/api/user/default").then(e=>{e=e.data;e.terms&&(t.terms=e.terms.join("\n")),t.options=Object.assign({},t.options,e.options)})}t.terms="",t.options={expirationMode:"remove",update:!1,image:!0,pdf:!0,notebook:!0,loc:!0,link:!0},n(),t.saveDefault=()=>{var e={terms:t.terms.trim().split("\n"),options:t.options};i.post("/api/user/default",e).then(()=>{n(),t.message="Saved"},e=>{$translate("ERRORS."+e.data.error).then(e=>{t.error=e},console.error)})},t.deleteAccount=()=>{confirm("Delete your account? All your anonymized repositories, gists, and pull requests will be removed, and your personal data will be erased. This cannot be undone.")&&(t.deletingAccount=!0,i.delete("/api/user").then(()=>{window.location.href="/"},()=>{t.deletingAccount=!1,t.deleteError="Unable to delete the account. Please try again."}))}}]).controller("claimController",["$scope","$http","$location",function(t,e,i){t.repoId=null,t.repoUrl=null,t.claim=()=>{e.post("/api/repo/claim",{repoId:t.repoId,repoUrl:t.repoUrl}).then(e=>{i.url("/dashboard")},e=>{t.error=e.data,t.claimForm.repoUrl.$setValidity("not_found",!1),t.claimForm.repoId.$setValidity("not_found",!1)})}}]).controller("homeController",["$scope","$http","$location",function(t,e,i){function n(t){var i={series:t,bars:[],viewW:100,deltaToday:0,pctChange:0,pctAbs:0,isUp:!0};if(t&&!(t.length<2)){var n=new Array(t.length-1);for(let e=1;e<t.length;e++)n[e-1]=t[e]-t[e-1];var r=n.length,e=Math.max.apply(null,n),s=Math.min.apply(null,n),o=Math.min(0,s),a=e-o||1;i.viewW=2*r,i.bars=new Array(r);for(let e=0;e<r;e++){var l=(n[e]-o)/a,l=Math.max(1.5,34*l);i.bars[e]={x:(2*e+.25).toFixed(2),y:(36-l).toFixed(2),w:"1.5",h:l.toFixed(2)}}i.deltaToday=n[r-1],2<=r&&(s=n[r-2])&&(i.pctChange=(i.deltaToday-s)/s*100),i.pctAbs=Math.round(Math.abs(i.pctChange)),i.isUp=0<=i.pctChange}return i}t.user&&!t.user.status&&i.url("/dashboard"),t.$watch("user.status",()=>{t.user&&!t.user.status&&i.url("/dashboard")}),t.cards=[{key:"repositories",total:0,label:"repositories anonymized"},{key:"users",total:0,label:"researchers"},{key:"pageViews",total:0,label:"page views"},{key:"pullRequests",total:0,label:"pull requests"}],e.get("/api/stat/").then(e=>{t.stat=e.data,t.cards[0].total=e.data.nbRepositories,t.cards[1].total=e.data.nbUsers,t.cards[2].total=e.data.nbPageViews,t.cards[3].total=e.data.nbPullRequests}),t.history={repositories:n([]),users:n([]),pageViews:n([]),pullRequests:n([])},e.get("/api/stat/history?days=60").then(e=>{e=e.data||[];t.history={repositories:n(e.map(e=>e.nbRepositories||0)),users:n(e.map(e=>e.nbUsers||0)),pageViews:n(e.map(e=>e.nbPageViews||0)),pullRequests:n(e.map(e=>e.nbPullRequests||0))}})}]).controller("unifiedDashboardController",["$scope","$http","$location",function(r,s,e){r.$on("$routeChangeStart",function(){$('[data-toggle="tooltip"]').tooltip("dispose")}),r.$watch("user.status",()=>{null==r.user&&e.url("/")}),null==r.user&&e.url("/"),setTimeout(()=>{$('[data-toggle="tooltip"]').tooltip()},250),r.items=[],r.search="";const t="dashboard.filterPrefs",i="all",n={status:{ready:!0,expired:!0,removed:!1}},o="-anonymizeDate";var a=loadFilterPrefs(t)||{};r.typeFilter=a.typeFilter||i,r.filters={status:Object.assign({},n.status,a.filters&&a.filters.status||{})},r.orderBy=a.orderBy||o,r.$watchGroup(["typeFilter","orderBy"],()=>{saveFilterPrefs(t,{typeFilter:r.typeFilter,filters:r.filters,orderBy:r.orderBy})}),r.$watch("filters",()=>{saveFilterPrefs(t,{typeFilter:r.typeFilter,filters:r.filters,orderBy:r.orderBy})},!0),s.get("/api/user/quota").then(e=>{r.quota=e.data,r.quota.storage.percent=r.quota.storage.total?100*r.quota.storage.used/r.quota.storage.total:100,r.quota.file.percent=r.quota.file.total?100*r.quota.file.used/r.quota.file.total:100,r.quota.repository.percent=r.quota.repository.total?100*r.quota.repository.used/r.quota.repository.total:100},console.error);let l=null,h=null,c=null;function d(){r.items=(l||[]).concat(h||[]).concat(c||[])}function u(){l=null,h=null,c=null,s.get("/api/user/anonymized_repositories").then(e=>{l=e.data.map(e=>(e.pageView||(e.pageView=0),e.lastView||(e.lastView=""),e.options.terms=e.options.terms.filter(e=>e),e._type="repo",e._id=e.repoId,e._name=e.repoId,e._source=e.source.fullName,e._editUrl="/anonymize/"+e.repoId,e._viewUrl="/r/"+e.repoId+"/",e)),d()},e=>{console.error(e)}),s.get("/api/user/anonymized_pull_requests").then(e=>{h=e.data.map(e=>(e.pageView||(e.pageView=0),e.lastView||(e.lastView=""),e.options.terms=e.options.terms.filter(e=>e),e._type="pr",e._id=e.pullRequestId,e._name=e.pullRequestId,e._source=e.source.repositoryFullName+"#"+e.source.pullRequestId,e._editUrl="/pull-request-anonymize/"+e.pullRequestId,e._viewUrl="/pr/"+e.pullRequestId+"/",e)),d()},e=>{console.error(e)}),s.get("/api/user/anonymized_gists").then(e=>{c=e.data.map(e=>(e.pageView||(e.pageView=0),e.lastView||(e.lastView=""),e.options.terms=(e.options.terms||[]).filter(e=>e),e._type="gist",e._id=e.gistId,e._name=e.gistId,e._source=e.source.gistId,e._editUrl="/gist-anonymize/"+e.gistId,e._viewUrl="/gist/"+e.gistId+"/",e)),d()},e=>{console.error(e)})}function p(i,n){s.get("/api/repo/"+i).then(e=>{for(const t of r.items)if("repo"===t._type&&t.repoId==i){t.status=e.data.status;break}"ready"==e.data.status||"error"==e.data.status||"removed"==e.data.status||"expired"==e.data.status?n(e.data):setTimeout(()=>p(i,n),2500)})}u();const m=e=>"repo"===e?"repository":"gist"===e?"gist":"pull request",g=e=>"repo"===e?"/api/repo":"gist"===e?"/api/gist":"/api/pr";r.removeItem=t=>{const e=m(t._type);if(confirm(`Are you sure that you want to remove the ${e} ${t._id}?`)){const n={title:`Removing ${t._id}...`,date:new Date,body:`The ${e} ${t._id} is going to be removed.`};r.addToast(n);var i=g(t._type)+"/"+t._id;s.delete(i).then(()=>{"repo"===t._type?p(t._id,()=>{n.title=t._id+" is removed.",n.body=`The ${e} ${t._id} is removed.`,r.$apply()}):(n.title=t._id+" is removed.",n.body=`The ${e} ${t._id} is removed.`,u())},e=>{n.title=`Error during the removal of ${t._id}.`,n.body=e.body,u()})}},r.refreshItem=t=>{const e=m(t._type),i={title:`Refreshing ${t._id}...`,date:new Date,body:`The ${e} ${t._id} is going to be refreshed.`};r.addToast(i);var n=`${g(t._type)}/${t._id}/refresh`;s.post(n).then(()=>{"repo"===t._type?p(t._id,()=>{i.title=t._id+" is refreshed.",i.body=`The ${e} ${t._id} is refreshed.`,r.$apply()}):(i.title=t._id+" is refreshed.",i.body=`The ${e} ${t._id} is refreshed.`,u())},e=>{i.title=`Error during the refresh of ${t._id}.`,i.body=e.body,u()})},r.extendItem=t=>{const e=m(t._type),i={title:`Extending ${t._id}...`,date:new Date,body:`The expiration of ${e} ${t._id} is going to be extended by 6 months.`};r.addToast(i);var n=`${g(t._type)}/${t._id}/extend`;s.post(n).then(()=>{"repo"===t._type?p(t._id,()=>{i.title=t._id+" is extended.",i.body=`The expiration of ${e} ${t._id} is extended by 6 months.`,r.$apply()}):(i.title=t._id+" is extended.",i.body=`The expiration of ${e} ${t._id} is extended by 6 months.`,u())},e=>{i.title=`Error during the extension of ${t._id}.`,i.body=e.data&&e.data.error||e.body,u()})},r.itemFilter=e=>("all"===r.typeFilter||e._type===r.typeFilter)&&0!=r.filters.status[e.status]&&(0==r.search.trim().length||!!(e._source&&-1<e._source.indexOf(r.search))||-1<e._id.indexOf(r.search))}]).controller("dashboardController",["$scope","$location",function(e,t){t.url("/dashboard")}]).controller("prDashboardController",["$scope","$location",function(e,t){t.url("/dashboard")}]).controller("statusController",["$scope","$http","$routeParams",function(n,e,t){n.repoId=t.repoId,n.repo=null,n.progress=0,n.rateLimitResetAt=0,n.rateLimitCountdown="";var r=null;function i(i){function e(){var e,t=Math.max(0,Math.ceil((i-Date.now())/1e3));t<=0?(n.rateLimitCountdown="",n.rateLimitResetAt=0,clearInterval(r),r=null):(e=Math.floor(t/60),t=t%60,n.rateLimitCountdown=0<e?e+"m "+t+"s":t+"s"),n.$applyAsync()}n.rateLimitResetAt=i,r&&clearInterval(r),e(),r=setInterval(e,1e3)}n.$on("$destroy",function(){r&&clearInterval(r)}),n.getStatus=()=>{e.get("/api/repo/"+n.repoId,{repoId:n.repoId,repoUrl:n.repoUrl}).then(e=>{n.repo=e.data,e.data.rateLimitResetAt?i(e.data.rateLimitResetAt):n.repo.statusMessage=function(e){if(e){var t=e.match(/^rate_limited:(\d+)$/);if(t)return i(parseInt(t[1],10)),null;n.rateLimitResetAt=0}return e}(n.repo.statusMessage),"ready"==n.repo.status?n.progress=100:"queue"==n.repo.status?n.progress=10:"downloaded"==n.repo.status?n.progress=50:"download"==n.repo.status||"preparing"==n.repo.status?n.progress=25:"anonymizing"==n.repo.status&&(n.progress=75);e="ready"!=n.repo.status;(e="error"!=n.repo.status||n.rateLimitResetAt?e:!1)&&setTimeout(n.getStatus,2e3)},e=>{n.error=e.data.error})},n.getStatus()}]).controller("anonymizeController",["$scope","$http","$sce","$routeParams","$location","$translate","$timeout",function(s,o,r,e,t,a,l){function i(){var e=new Date;return e.setMonth(e.getMonth()+6),e}function n(e){return e.getFullYear()+`-${String(e.getMonth()+1).padStart(2,"0")}-`+String(e.getDate()).padStart(2,"0")}s.sourceUrl="",s.detectedType=null,s.repoId="",s.pullRequestId="",s.gistId="",s.terms="",s.defaultTerms="",s.branches=[],s.source={branch:"",commit:""},s.options={expirationMode:"remove",expirationDate:new Date,update:!1,image:!0,pdf:!0,notebook:!0,link:!0,body:!0,title:!0,origin:!1,diff:!0,content:!0,comments:!0,username:!0,date:!0},s.options.expirationDate=i(),s.minExpirationDate=n(new Date);var h,c=new Date;function d(e,t,i){s.anonymize&&s.anonymize[e]&&s.anonymize[e].$setValidity(t,i)}function u(){return s.isUpdate&&s._originalRepositoryID&&function(e){try{var t=parseGithubUrl(e);if(t&&t.owner&&t.repo)return t.owner+"/"+t.repo}catch(e){}return null}(s.sourceUrl)===s._originalFullName?s._originalRepositoryID:void 0}async function p(){var e=parseGithubUrl(s.sourceUrl);try{T();var t=await o.get(`/api/repo/${e.owner}/${e.repo}/`,{params:{repositoryID:u(),force:"1"}});s.details=t.data,s.details&&s.details.id&&(s.repositoryID=s.details.id),s.repoId||(s.repoId=s.details.repo+"-"+generateRandomId(4)),await s.getBranches()}catch(e){throw e.data&&(a("ERRORS."+e.data.error).then(e=>{s.addToast({title:"Error",date:new Date,body:e}),s.error=e},console.error),M(e.data.error)),d("sourceUrl","missing",!1),e}}async function m(e){if(s.readme&&!e)return s.readme;var t=parseGithubUrl(s.sourceUrl);try{var i=await o.get(`/api/repo/${t.owner}/${t.repo}/readme`,{params:{force:!0===e?"1":"0",branch:s.source.branch,repositoryID:u()}});s.readme=i.data}catch(e){s.readme=""}}function g(){var e={terms:s.terms?s.terms.split("\n"):[],image:!!s.options.image,link:!!s.options.link,repoId:s.repoId};s.source&&s.source.branch&&(e.branchName=s.source.branch);try{var t=parseGithubUrl(s.sourceUrl);e.repoName=t.owner+"/"+t.repo}catch(e){}return e}function f(i,n){let r=null,s=0;return function(){r&&l.cancel(r),r=l(()=>{r=null;const t=++s;var e=i();e&&o.post("/api/anonymize-preview",e).then(e=>{t===s&&n(e.data)},()=>{})},200)}}c.setFullYear(c.getFullYear()+1),s.maxExpirationDate=n(c),s.anonymize_readme="",s.readme="",s.html_readme="",s.isUpdate=!1,h=()=>{e.repoId&&""!=e.repoId&&(s.isUpdate=!0,s.detectedType="repo",s.repoId=e.repoId,o.get("/api/repo/"+s.repoId).then(async e=>{s.sourceUrl="https://github.com/"+e.data.source.fullName,s._originalFullName=e.data.source.fullName,s.terms=e.data.options.terms.filter(e=>e).join("\n"),s.source=e.data.source,s.role=e.data.role||"owner",s.coauthors=e.data.coauthors||[],s._originalBranch=e.data.source.branch,s.options=Object.assign({},s.options,e.data.options),s.conference=e.data.conference,s.repositoryID=e.data.source.repositoryID,s._originalRepositoryID=e.data.source.repositoryID,e.data.options.expirationDate&&(s.options.expirationDate=new Date(e.data.options.expirationDate)),await Promise.all([p(),m()]),y(),s.$apply()},()=>{t.url("/404")}),s.$watch("anonymize",()=>{s.anonymize.repoId&&(s.anonymize.repoId.$$element[0].disabled=!0)})),e.pullRequestId&&""!=e.pullRequestId&&(s.isUpdate=!0,s.detectedType="pr",s.pullRequestId=e.pullRequestId,o.get("/api/pr/"+s.pullRequestId).then(async t=>{s.sourceUrl="https://github.com/"+t.data.source.repositoryFullName+"/pull/"+t.data.source.pullRequestId,s.terms=t.data.options.terms.filter(e=>e).join("\n"),s.source=t.data.source,s.options=Object.assign({},s.options,t.data.options),s.conference=t.data.conference,t.data.options.expirationDate&&(s.options.expirationDate=new Date(t.data.options.expirationDate));try{s.details=(await o.get(`/api/pr/${t.data.source.repositoryFullName}/`+t.data.source.pullRequestId)).data}catch(e){t=e&&e.data&&e.data.error;t&&(a("ERRORS."+t).then(e=>{s.addToast({title:"Error",date:new Date,body:e}),s.error=e},console.error),M(t))}s.$apply()},()=>{t.url("/404")}),s.$watch("anonymize",()=>{s.anonymize.pullRequestId&&(s.anonymize.pullRequestId.$$element[0].disabled=!0),s.anonymize.sourceUrl&&(s.anonymize.sourceUrl.$$element[0].disabled=!0)})),e.gistId&&""!=e.gistId&&(s.isUpdate=!0,s.detectedType="gist",s.gistId=e.gistId,o.get("/api/gist/"+s.gistId).then(async e=>{s.sourceUrl="https://gist.github.com/"+e.data.source.gistId,s.terms=e.data.options.terms.filter(e=>e).join("\n"),s.source=e.data.source,s.options=Object.assign({},s.options,e.data.options),s.conference=e.data.conference,e.data.options.expirationDate&&(s.options.expirationDate=new Date(e.data.options.expirationDate)),s.details=(await o.get("/api/gist/source/"+e.data.source.gistId)).data,s.$apply()},()=>{t.url("/404")}),s.$watch("anonymize",()=>{s.anonymize.gistId&&(s.anonymize.gistId.$$element[0].disabled=!0),s.anonymize.sourceUrl&&(s.anonymize.sourceUrl.$$element[0].disabled=!0)}))},o.get("/api/user/default").then(e=>{e=e.data;e.terms&&(s.defaultTerms=e.terms.join("\n")),s.options=Object.assign({},s.options,e.options),s.options.expirationDate=e.options&&e.options.expirationDate?new Date(e.options.expirationDate):i(),h&&h()}),s.urlSelected=async()=>{s.terms=s.defaultTerms,s.isUpdate||(s.repoId="",s.pullRequestId="",s.gistId=""),s.details=null,s.branches=[],s.source={type:"GitHubStream",branch:"",commit:""},s.anonymize_readme="",s.readme="",s.html_readme="",s.detectedType=null;let e;try{e=parseGithubUrl(s.sourceUrl)}catch(e){return void d("sourceUrl","github",!1)}d("sourceUrl","github",!0);try{if(e.gistId&&!e.repo){s.detectedType="gist",s.source={gistId:e.gistId};var t=parseGithubUrl(s.sourceUrl);try{T();var i=await o.get("/api/gist/source/"+t.gistId);s.details=i.data,s.gistId||(s.gistId="gist-"+t.gistId.substring(0,6)+"-"+generateRandomId(4))}catch(e){throw e.data&&(a("ERRORS."+e.data.error).then(e=>{s.addToast({title:"Error",date:new Date,body:e}),s.error=e},console.error),M(e.data.error)),d("sourceUrl","missing",!1),e}await 0}else if(e.pullRequestId){s.detectedType="pr",s.source={repositoryFullName:e.owner+"/"+e.repo,pullRequestId:e.pullRequestId};var n=parseGithubUrl(s.sourceUrl);try{T();var r=await o.get(`/api/pr/${n.owner}/${n.repo}/`+n.pullRequestId);s.details=r.data,s.pullRequestId||(s.pullRequestId=n.repo+"-PR"+n.pullRequestId+"-"+generateRandomId(4))}catch(e){throw e.data&&(a("ERRORS."+e.data.error).then(e=>{s.addToast({title:"Error",date:new Date,body:e}),s.error=e},console.error),M(e.data.error)),d("sourceUrl","missing",!1),e}await 0}else s.detectedType="repo",await Promise.all([p(),m()]),y()}catch(e){return}s.$apply(),$('[data-toggle="tooltip"]').tooltip()},$('[data-toggle="tooltip"]').tooltip(),s.$watch("options.update",e=>{"repo"===s.detectedType&&s.anonymize&&s.anonymize.commit&&(s.anonymize.commit.$$element[0].disabled=!!e)}),s.$watch("source.branch",async()=>{var e;"repo"===s.detectedType&&(e=s.branches.filter(e=>e.name==s.source.branch)[0])&&(s.isUpdate&&s._originalBranch===s.source.branch&&!!s.source.commit||(s.source.commit=e.commit),s.readme=e.readme,await m(),y(),s.$apply())}),s.getBranches=async e=>{var t=parseGithubUrl(s.sourceUrl);try{var i=await o.get(`/api/repo/${t.owner}/${t.repo}/branches`,{params:{force:!0===e?"1":"0",repositoryID:u()}}),n=(s.branches=i.data,s.sourceUnreachable=!1,s.source.branch||(s.source.branch=s.details.defaultBranch),s.branches.filter(e=>e.name==s.source.branch));0<n.length&&(!e&&s.isUpdate&&!s.options.update&&s._originalBranch===s.source.branch&&s.source.commit||(s.source.commit=n[0].commit),s.readme=n[0].readme,await m(e))}catch(e){s.branches=[],s.sourceUnreachable=e&&(404===e.status||e.data&&"repo_not_found"===e.data.error);t=e&&e.data&&e.data.error||(e&&404===e.status?"repo_not_found":"unknown_error");a("ERRORS."+t).then(e=>{s.toasts=s.toasts||[],s.addToast({title:"Error",date:new Date,body:e}),s.error=e},console.error),d("sourceUrl","missing",!1)}s.$apply()};const v=f(()=>s.readme?{content:s.readme,options:g()}:null,e=>{s.anonymize_readme=e.content||"";let t="";try{var i=parseGithubUrl(s.sourceUrl),n=s.source.branch||s.details&&s.details.defaultBranch||"main";t=`https://github.com/${i.owner}/${i.repo}/raw/${n}/`}catch(e){}e=renderMD(s.anonymize_readme,t);s.html_readme=r.trustAsHtml(e),l(Prism.highlightAll,150)});function y(){s.anonymize&&s.anonymize.terms&&(s.termsRegexWarning=!!s.terms&&!!s.terms.match(/[-[\]{}()*+?.,\\^$|#]/g),v())}let b=new Map,w=new Set;const x=f(()=>{var e=function(){var e=new Set,t=s.details&&s.details.pullRequest;if(t){"string"==typeof t.title&&e.add(t.title),"string"==typeof t.body&&e.add(t.body),"string"==typeof t.diff&&e.add(t.diff);for(const i of s.details&&s.details.comments||[])"string"==typeof i.author&&e.add(i.author),"string"==typeof i.body&&e.add(i.body)}return e}(),e=(w=e,Array.from(e));return 0===e.length?null:{contents:e,options:g()}},t=>{if(t&&Array.isArray(t.contents)){var i=Array.from(w),n=new Map;for(let e=0;e<i.length&&e<t.contents.length;e++)n.set(i[e],t.contents[e]);b=n}});s.anonymizePrContent=function(e){if(e){if(b.has(e))return b.get(e);w.has(e)||x()}return e};let S=new Map,A=new Set,k=0;const _=f(()=>{var e=function(){var e=new Set,t=s.details&&s.details.gist;if(t){"string"==typeof t.description&&e.add(t.description),"string"==typeof t.ownerLogin&&e.add(t.ownerLogin);for(const i of t.files||[])"string"==typeof i.filename&&e.add(i.filename),"string"==typeof i.content&&e.add(i.content);for(const n of t.comments||[])"string"==typeof n.author&&e.add(n.author),"string"==typeof n.body&&e.add(n.body)}return e}(),e=(A=e,Array.from(e));return 0===e.length?null:{contents:e,options:g()}},t=>{if(t&&Array.isArray(t.contents)){var i=Array.from(A),n=new Map;for(let e=0;e<i.length&&e<t.contents.length;e++)n.set(i[e],t.contents[e]);S=n,k++,C()}});function C(){var e=s.details&&s.details.gist&&s.details.gist.files||[];s.previewGistFiles=e.map(e=>({filename:s.anonymizeGistContent(e.filename),content:s.anonymizeGistContent(e.content),language:e.language}))}function T(){d("repoId","used",!0),d("repoId","format",!0),d("pullRequestId","used",!0),d("pullRequestId","format",!0),d("gistId","used",!0),d("gistId","format",!0),d("sourceUrl","used",!0),d("sourceUrl","missing",!0),d("sourceUrl","access",!0),d("sourceUrl","github",!0),d("commit","exists",!0),d("conference","activated",!0),d("terms","format",!0),s.termsRegexWarning=!1}function E(){var e=s.anonymize&&s.anonymize.expirationDate;return(!s.options.expirationDate||e&&e.$invalid)&&(e&&e.$setDirty&&e.$setDirty(),s.error="Please choose a valid expiration date.")}function M(e){var t="pr"===s.detectedType?"pullRequestId":"gist"===s.detectedType?"gistId":"repoId";switch(e){case"repoId_already_used":d(t,"used",!1);break;case"invalid_repoId":case"options_not_provided":d(t,"format",!1);break;case"repo_already_anonymized":d("sourceUrl","used",!1);break;case"invalid_terms_format":d("terms","format",!1);break;case"repo_not_found":d("sourceUrl","missing",!1);break;case"repo_not_accessible":d("sourceUrl","access",!1);break;case"commit_not_found":d("commit","exists",!1);break;case"conf_not_activated":d("conference","activated",!1)}}s.anonymizeGistContent=function(e){if(e){if(S.has(e))return S.get(e);A.has(e)||_()}return e},s.previewGistFiles=[],s.$watch("details.gist.files",C,!0),s.$watch("terms",C),s.coauthors=s.coauthors||[],s.coauthorResults=[],s.coauthorError="",s.searchCoauthors=()=>{var e=(s.coauthorSearch||"").trim();s.coauthorError="",e.length<2?s.coauthorResults=[]:o.get("/api/user/search/github-users",{params:{q:e}}).then(e=>{const t=new Set((s.coauthors||[]).map(e=>(e.username||"").toLowerCase()));s.coauthorResults=(e.data||[]).filter(e=>!t.has((e.username||"").toLowerCase()))},()=>{s.coauthorResults=[]})},s.addCoauthor=(e,t)=>{t&&t.preventDefault(),e&&e.username&&o.post("/api/repo/"+s.repoId+"/coauthors",{username:e.username}).then(e=>{s.coauthors=e.data||[],s.coauthorResults=[],s.coauthorSearch="",s.coauthorError=""},e=>{e=e&&e.data&&e.data.error||"unknown_error";s.coauthorError=e})},s.removeCoauthor=e=>{e&&e.username&&confirm("Remove co-author "+e.username+"?")&&o.delete("/api/repo/"+s.repoId+"/coauthors/"+encodeURIComponent(e.username)).then(e=>{s.coauthors=e.data||[]},e=>{e=e&&e.data&&e.data.error||"unknown_error";s.coauthorError=e})},s.anonymizeRepo=e=>{var t,i;E()||(e.target.disabled=!0,t=parseGithubUrl(s.sourceUrl),t={repoId:s.repoId,terms:s.terms.trim().split("\n").filter(e=>e),fullName:t.owner+"/"+t.repo,repository:s.sourceUrl,options:s.options,source:s.source,conference:s.conference},s.details&&(t.options.pageSource=s.details.pageSource),T(),i=s.isUpdate?"/api/repo/"+s.repoId:"/api/repo/",o.post(i,t,{headers:{"Content-Type":"application/json"}}).then(()=>{window.location.href="/status/"+s.repoId},e=>{e.data&&(a("ERRORS."+e.data.error).then(e=>{s.error=e},console.error),M(e.data.error))}).finally(()=>{e.target.disabled=!1,s.$apply()}))},s.anonymizeGist=e=>{var t,i;E()||(e.target.disabled=!0,t=parseGithubUrl(s.sourceUrl),t={gistId:s.gistId,terms:s.terms.trim().split("\n").filter(e=>e),source:{gistId:t.gistId},options:s.options,conference:s.conference},T(),i=s.isUpdate?"/api/gist/"+s.gistId:"/api/gist/",o.post(i,t,{headers:{"Content-Type":"application/json"}}).then(()=>{window.location.href="/gist/"+s.gistId},e=>{e.data&&(a("ERRORS."+e.data.error).then(e=>{s.error=e},console.error),M(e.data.error))}).finally(()=>{e.target.disabled=!1,s.$apply()}))},s.anonymizePullRequest=e=>{var t,i;E()||(e.target.disabled=!0,t=parseGithubUrl(s.sourceUrl),t={pullRequestId:s.pullRequestId,terms:s.terms.trim().split("\n").filter(e=>e),source:{repositoryFullName:t.owner+"/"+t.repo,pullRequestId:t.pullRequestId},options:s.options,conference:s.conference},T(),i=s.isUpdate?"/api/pr/"+s.pullRequestId:"/api/pr/",o.post(i,t,{headers:{"Content-Type":"application/json"}}).then(()=>{window.location.href="/pr/"+s.pullRequestId},e=>{e.data&&(a("ERRORS."+e.data.error).then(e=>{s.error=e},console.error),M(e.data.error))}).finally(()=>{e.target.disabled=!1,s.$apply()}))},s.$watch("conference",()=>{s.conference&&o.get("/api/conferences/"+s.conference).then(e=>{s.conference_data=e.data,s.conference_data.startDate=new Date(s.conference_data.startDate),s.conference_data.endDate=new Date(s.conference_data.endDate),s.options.expirationDate=new Date(s.conference_data.endDate),s.options.expirationMode="remove",s.options.update=s.conference_data.options.update,s.options.image=s.conference_data.options.image,s.options.pdf=s.conference_data.options.pdf,s.options.notebook=s.conference_data.options.notebook,s.options.link=s.conference_data.options.link},()=>{s.conference_data=null})}),s.$watch("terms",()=>{"repo"===s.detectedType&&y(),"pr"===s.detectedType&&x(),"gist"===s.detectedType&&_()}),s.$watch("options.image",()=>{"repo"===s.detectedType&&y(),"pr"===s.detectedType&&x(),"gist"===s.detectedType&&_()}),s.$watch("options.link",()=>{"repo"===s.detectedType&&y(),"pr"===s.detectedType&&x(),"gist"===s.detectedType&&_()}),s.$watch("details",()=>{"pr"===s.detectedType&&x(),"gist"===s.detectedType&&_()},!0)}]).controller("exploreController",["$scope","$http","$location","$routeParams","$sce","$q",function(g,s,o,n,a,r){g.files=[],g.isMac=/Mac|iPhone|iPad|iPod/.test(navigator.platform||navigator.userAgent),g.fileSearchQuery="",g.fileSearchResults=null,g.fileSearchLoading=!1,document.addEventListener("keydown",function(e){(e.metaKey||e.ctrlKey)&&"k"===e.key&&(e.preventDefault(),e=document.querySelector(".tree-search-input"))&&(e.focus(),e.select())});var f=null;g.onFileSearchChange=function(){f&&(f.resolve(),f=null);var e=g.fileSearchQuery;!e||e.length<2?(g.fileSearchResults=null,g.fileSearchLoading=!1):(g.fileSearchLoading=!0,f=r.defer(),s.get(`/api/repo/${g.repoId}/files/search?q=`+encodeURIComponent(e),{timeout:f.promise}).then(function(e){f=null,g.fileSearchLoading=!1;for(var t={},i=(g.files.forEach(function(e){t[(e.path||"")+"/"+e.name]=!0}),[]),n={},r=0;r<e.data.length;r++){var s=e.data[r];if(s.path)for(var o=s.path.split("/"),a="",l=0;l<o.length;l++){var h=a,a=a?a+"/"+o[l]:o[l],c=h+"/"+o[l];t[c]||n[c]||(n[c]=!0,i.push({name:o[l],path:h}))}}i.sort(function(e,t){return(e.path||"").split("/").length-(t.path||"").split("/").length}),0<i.length&&g.files.push.apply(g.files,i);for(var d=[],u=0;u<e.data.length;u++){var p=e.data[u],m=(p.path||"")+"/"+p.name;t[m]||null==p.size||(d.push(p),t[m]=!0)}0<d.length&&g.files.push.apply(g.files,d),g.fileSearchResults=e.data},function(){f||(g.fileSearchLoading=!1,g.fileSearchResults=[])}))};const l={yml:"yaml",txt:"text",py:"python",js:"javascript",ts:"typescript"},h=["license","txt"],c=["png","jpg","jpeg","gif","svg","ico","bmp","tiff","tif","webp","avif","heif","heic"],d=["wav","mp3","ogg","wma","flac","aac","m4a"],u=["mp4","avi","webm","mov","mpg","mpeg","mkv","flv","wmv","3gp","3g2","m4v","f4v","f4p","f4a","f4b"];g.$on("$routeUpdate",function(e,t){if((n.path||"")!=g.filePath){if(g.filePath=n.path||"",g.paths=g.filePath.split("/").filter(e=>e&&0<e.trim().length),g.repoId!=n.repoId)return v();m();for(let e=0;e<g.paths.length-1;e++){const i=0<e?g.paths.slice(0,e).join("/"):"";g.files.some(e=>e.path===i)||g.getFiles(i)}}}),g.fileCounts=null,g.getFiles=function(i){return s.get(`/api/repo/${g.repoId}/files/?path=${encodeURIComponent(i)}&v=`+g.options.lastUpdateDate).then(function(e){const t=i||"";return g.files=g.files.filter(e=>e.path!==t),g.files.push(...e.data),e.data},function(e){g.type="error",g.content=e&&e.data&&e.data.error||"unknown_error",g.files=[]})};var p=null;function m(){g.content="",g.file=g.files.filter(e=>e.name==g.paths[g.paths.length-1]&&e.path==g.paths.slice(0,g.paths.length-1).join("/"))[0];let e="0";g.file&&g.file.sha&&(e=g.file.sha),g.url=`/api/repo/${g.repoId}/file/${encodePathForUrl(g.filePath)}?v=`+e;var t=g.filePath.substring(0,g.filePath.lastIndexOf("/")+1);g.fileBaseUrl=`/api/repo/${g.repoId}/file/`+(t?encodePathForUrl(t):""),g.showSource=!1,g.allowScripts=!1;let i=g.filePath.toLowerCase();var t=i.lastIndexOf(".");if(-1<t&&(i=i.substring(t+1)),g.aceOption={readOnly:!0,useWrapMode:!0,showGutter:!0,theme:"chrome",useSoftTab:!0,showPrintMargin:!1,tabSize:2,highlightSelectedWord:!1,fontSize:15,keyBinding:"vscode",fullLineSelection:!0,highlightActiveLine:!1,highlightGutterLine:!1,cursor:"hide",showInvisibles:!1,showIndentGuides:!0,enableBehaviours:!0,fadeFoldWidgets:!1,mode:(t=i,l[t]||t),onLoad:function(n){const i=ace.require("ace/range").Range;let r=null;function s(e,t){null!==r&&(n.session.removeMarker(r),r=null),null!=e&&(r=n.session.addMarker(new i(e,0,t,1),"highlighted-line","fullLine"))}function e(e){var t=window.location.hash.match(/^#L(\d+)(?:-L(\d+))?/);if(t){const i=parseInt(t[1])-1;t=t[2]?parseInt(t[2])-1:i;s(i,t),e&&setTimeout(()=>{n.scrollToLine(i,!0,!0,function(){})},100)}else s(null)}e(!0);let o=null;n.on("guttermousedown",function(e){var t=e.getDocumentPosition().row;let i=t,n=t;e.domEvent&&e.domEvent.shiftKey&&null!==o?(i=Math.min(o,t),n=Math.max(o,t)):o=t;t=i===n?"#L"+(i+1):`#L${i+1}-L`+(n+1),t=window.location.pathname+window.location.search+t;window.history.replaceState(null,"",t),s(i,n),e.stop()}),window.addEventListener("hashchange",()=>e(!1)),n.setFontSize(g.aceOption.fontSize),n.setReadOnly(g.aceOption.readOnly),n.setKeyboardHandler(g.aceOption.keyBinding),n.setSelectionStyle(g.aceOption.fullLineSelection?"line":"text"),n.setOption("displayIndentGuides",!0),n.setHighlightActiveLine(g.aceOption.highlightActiveLine),"hide"==g.aceOption.cursor&&(n.renderer.$cursorLayer.element.style.display="none"),n.setHighlightGutterLine(g.aceOption.highlightGutterLine),n.setShowInvisibles(g.aceOption.showInvisibles),n.setDisplayIndentGuides(g.aceOption.showIndentGuides),n.renderer.setShowPrintMargin(g.aceOption.showPrintMargin),n.setHighlightSelectedWord(g.aceOption.highlightSelectedWord),n.session.setUseSoftTabs(g.aceOption.useSoftTab),n.session.setTabSize(g.aceOption.tabSize),n.setBehavioursEnabled(g.aceOption.enableBehaviours),n.setFadeFoldWidgets(g.aceOption.fadeFoldWidgets)}},g.$on("dark-mode",(e,t)=>{g.aceOption.theme=t?"nord_dark":"chrome"}),g.isDarkMode&&(g.aceOption.theme="nord_dark"),g.type="pdf"==(t=i)?"pdf":"html"==t||"htm"==t?"html-doc":"md"==t?"md":"org"==t?"org":"ipynb"==t?"IPython":-1<h.indexOf(t)?"text":-1<c.indexOf(t)?"image":-1<u.indexOf(t)?"media":-1<d.indexOf(t)?"audio":"code","pdf"==g.type)g.content="pdf";else{var t=g.filePath,n=g.file;if(t){const r=g.type;g.type="loading",g.content="loading";n=n&&n.sha||"0";s.get(`/api/repo/${g.repoId}/file/${encodePathForUrl(t)}?v=`+n,{transformResponse:e=>e}).then(e=>{var t;g.type=r,g.content=e.data,""==g.content&&(g.content=null),"md"==g.type&&(g.content=a.trustAsHtml(renderMD(e.data,o.url()+"/../")),g.type="html"),"org"==g.type&&(t=contentAbs2Relative(e.data),t=(new Org.Parser).parse(t).convert(Org.ConverterHTML,{headerOffset:1,exportFromLineNumber:!1,suppressSubScriptHandling:!0,suppressAutoLink:!1}),g.content=a.trustAsHtml(t.toString()),g.type="html"),"code"==g.type&&"application/octet-stream"==e.headers("content-type")&&(g.type="binary",g.content="binary"),setTimeout(()=>{Prism.highlightAll()},50)},t=>{g.type="error",g.content="unknown_error";try{t.data=JSON.parse(t.data),t.data.error?g.content=t.data.error:g.content=t.data}catch(e){console.log(t),-1==t.status?g.content="request_error":502==t.status&&(g.content="unreachable")}})}else g.type="error",g.content="no_file_selected"}}function v(){g.repoId=n.repoId,g.type="loading",g.filePath=n.path||"",g.paths=g.filePath.split("/"),function i(n){s.get(`/api/repo/${g.repoId}/options`).then(e=>{g.options=e.data,g.options.url?window.location=g.options.url:n&&n(e.data)},e=>{function t(){var e,t=Math.max(0,Math.ceil((g.rateLimitResetAt-Date.now())/1e3));t<=0?(g.rateLimitCountdown="",g.rateLimitResetAt=0,p&&(clearInterval(p),p=null),i(n)):(e=Math.floor(t/60),t%=60,g.rateLimitCountdown=0<e?e+"m "+t+"s":t+"s"),g.$applyAsync()}"rate_limited"===(e=e.data||{}).error&&e.resetAt?(g.type="rate_limited",g.rateLimitResetAt=e.resetAt,p&&clearInterval(p),t(),p=setInterval(t,1e3)):"repository_not_ready"===e.error?(g.type="loading",setTimeout(function(){i(n)},3e3)):(g.type="error",g.content=e.error)})}(function(e){s.get(`/api/repo/${g.repoId}/files/counts`).then(function(e){g.fileCounts=e.data},function(){g.fileCounts={}});var t=r.resolve();for(let e=0;e<g.paths.length;e++){const i=0<e?g.paths.slice(0,e).join("/"):"";t=t.then(function(){return g.getFiles(i)}).then(function(){if("error"===g.type)return r.reject("error")})}t.then(function(){if(1==g.files.length&&""==g.files[0].name)g.files=[],g.type="empty";else{if(""==g.paths[0]){var i={};for(const e of g.files)-1<e.name.toLowerCase().indexOf("readme")&&(i[e.name.toLowerCase()]=e.name);let t=null;for(const n of["readme.md","readme.txt","readme.org","readme.1st","readme"])if(i[n]){t=n;break}if(t=!t&&0<Object.keys(i).length?Object.keys(i)[0]:t){let e=o.url();"/"!=e[e.length-1]&&(e+="/"),o.url(e+encodePathForUrl(i[t]))}}m()}})})}g.$on("$destroy",function(){p&&clearInterval(p)}),g.toggleSource=function(){g.showSource=!g.showSource},g.toggleAllowScripts=function(){g.allowScripts=!g.allowScripts},v()}]).controller("pullRequestController",["$scope","$http","$location","$routeParams","$sce",function(i,n,e,t,r){i.pullRequestId=t.pullRequestId,i.type="loading",async function(t){n.get(`/api/pr/${i.pullRequestId}/options`).then(e=>{i.options=e.data,i.options.url?window.location=i.options.url:t&&t(e.data)},e=>{i.type="error",i.content=e.data.error})}(e=>{!async function(t){n.get(`/api/pr/${i.pullRequestId}/content`).then(e=>{i.details=e.data,t&&t(e.data)},e=>{i.type="error",i.content=e.data.error})}()})}]).controller("gistController",["$scope","$http","$location","$routeParams","$sce",function(n,e,t,i,r){n.gistId=i.gistId,n.type="loading",async function(t){e.get(`/api/gist/${n.gistId}/options`).then(e=>{n.options=e.data,n.options.url?window.location=n.options.url:t&&t(e.data)},e=>{n.type="error",n.content=e.data.error})}(()=>{!async function(i){e.get(`/api/gist/${n.gistId}/content`).then(e=>{n.details=e.data;var t=e.data&&e.data.files&&e.data.files.length;n.tabState={active:t?"files":"comments"},i&&i(e.data)},e=>{n.type="error",n.content=e.data.error})}()})}]).controller("conferencesController",["$scope","$http","$location",function(i,n,e){i.$watch("user.status",()=>{null==i.user&&e.url("/")}),null==i.user&&e.url("/"),i.conferences=[],i.search="";const t="conferences.filterPrefs",r={status:{ready:!0,expired:!1,removed:!1}},s="name";var o=loadFilterPrefs(t)||{};function a(){n.get("/api/conferences/").then(e=>{i.conferences=e.data||[]},e=>{console.error(e)})}i.filters={status:Object.assign({},r.status,o.filters&&o.filters.status||{})},i.orderBy=o.orderBy||s,i.$watch("orderBy",()=>{saveFilterPrefs(t,{filters:i.filters,orderBy:i.orderBy})}),i.$watch("filters",()=>{saveFilterPrefs(t,{filters:i.filters,orderBy:i.orderBy})},!0),i.removeConference=function(e){if(confirm(`Are you sure that you want to remove the conference ${e.name}? All the repositories linked to this conference will expire.`)){const t={title:`Removing ${e.name}...`,date:new Date,body:`The conference ${e.name} is going to be removed.`};i.addToast(t),n.delete("/api/conferences/"+e.conferenceID).then(()=>{t.title=e.name+" is removed.",t.body=`The conference ${e.name} is removed.`,a()})}},a(),i.conferenceFilter=e=>0!=i.filters.status[e.status]&&(0==i.search.trim().length||-1<e.name.indexOf(i.search)||-1<e.conferenceID.indexOf(i.search))}]).controller("newConferenceController",["$scope","$http","$location","$routeParams",function(i,e,n,t){i.$watch("user.status",()=>{null==i.user&&n.url("/")}),null==i.user&&n.url("/"),i.plans=[],i.editionMode=!1,t.conferenceId&&(i.editionMode=!0,e.get("/api/conferences/"+t.conferenceId).then(e=>{i.options=e.data,i.options.startDate=new Date(i.options.startDate),i.options.endDate=new Date(i.options.endDate)})),e.get("/api/conferences/plans").then(e=>{i.plans=e.data,i.plan=i.plans.filter(e=>e.id==i.options.plan.planID)[0]});var t=new Date,r=(t.setDate(1),t.setMonth(t.getMonth()+1),new Date);r.setMonth(t.getMonth()+7,0),i.options={startDate:t,endDate:r,plan:{planID:"free_conference"},options:{link:!0,image:!0,pdf:!0,notebook:!0,update:!0,page:!0}},i.plan=null,i.$watch("options.plan.planID",()=>{i.plan=i.plans.filter(e=>e.id==i.options.plan.planID)[0]}),i.submit=function(){const t={title:`Creating ${i.options.name}...`,date:new Date,body:`The conference ${i.options.conferenceID} is in creation.`};i.editionMode&&(t.title=`Updating ${i.options.name}...`,t.body=`The conference '${i.options.conferenceID}' is updating.`),i.addToast(t),i.conference.name.$setValidity("required",!0),i.conference.conferenceID.$setValidity("pattern",!0),i.conference.conferenceID.$setValidity("required",!0),i.conference.conferenceID.$setValidity("used",!0),i.conference.startDate.$setValidity("required",!0),i.conference.startDate.$setValidity("invalid",!0),i.conference.endDate.$setValidity("required",!0),i.conference.endDate.$setValidity("invalid",!0),i.conference.$setValidity("error",!0),e.post("/api/conferences/"+(i.editionMode?i.options.conferenceID:""),i.options).then(()=>{i.editionMode?(t.title=i.options.name+" updated",t.body=`The conference '${i.options.conferenceID}' is updated.`):(t.title=i.options.name+" created",t.body=`The conference '${i.options.conferenceID}' is created.`),n.url("/conference/"+i.options.conferenceID)},e=>{switch(e.data.error){case"conf_name_missing":i.conference.name.$setValidity("required",!1);break;case"conf_id_missing":i.conference.conferenceID.$setValidity("required",!1);break;case"conf_id_format":i.conference.conferenceID.$setValidity("pattern",!1);break;case"conf_id_used":i.conference.conferenceID.$setValidity("used",!1);break;case"conf_start_date_missing":i.conference.startDate.$setValidity("required",!1);break;case"conf_end_date_missing":i.conference.endDate.$setValidity("required",!1);break;case"conf_start_date_invalid":i.conference.startDate.$setValidity("invalid",!1);break;case"conf_end_date_invalid":i.conference.endDate.$setValidity("invalid",!1);break;default:i.conference.$setValidity("error",!1)}i.removeToast(t)})}}]).controller("conferenceController",["$scope","$http","$location","$routeParams",function(t,e,i,n){t.$watch("user.status",()=>{null==t.user&&i.url("/")}),null==t.user&&i.url("/"),t.conference=null,t.search="",t.filters={status:{ready:!0,expired:!1,removed:!1}},t.orderBy="-anonymizeDate",t.repoFiler=e=>0!=t.filters.status[e.status]&&(0==t.search.trim().length||-1<e.source.fullName.indexOf(t.search)||-1<e.repoId.indexOf(t.search)),e.get("/api/conferences/"+n.conferenceId).then(e=>{t.conference=e.data})}]),$(document).on("click","#navbarSupportedContent .nav-link",function(e){var t;"dropdown"!==$(this).attr("data-toggle")&&(t=$("#navbarSupportedContent")).hasClass("show")&&t.collapse("hide")}),angular.module("admin",[]).controller("repositoriesAdminController",["$scope","$http","$location",function(n,r,e){n.Math=Math,n.$watch("user.status",()=>{null==n.user&&e.url("/")}),null==n.user&&e.url("/"),n.repositories=[],n.total=-1,n.totalPage=0,n.statusCounts=[],n.totalSize=0,n.selected={},n.allSelected=!1;const t=e=>{"/"===e.key&&!["INPUT","TEXTAREA","SELECT"].includes(document.activeElement?.tagName)&&(e.preventDefault(),e=document.querySelector('.admin-filter-toolbar input[type="search"]'))&&e.focus()},s=(document.addEventListener("keydown",t),n.$on("$destroy",()=>document.removeEventListener("keydown",t)),n.clearFilter=e=>{"dateRange"===e?(n.query.dateFrom="",n.query.dateTo=""):n.query[e]="",n.query.page=1},n.chips=[],()=>{var e=[];n.query.owner&&e.push({key:"owner",label:"Owner",value:n.query.owner}),n.query.conference&&e.push({key:"conference",label:"Conference",value:n.query.conference}),n.chips=e}),o=(n.showStatusMessage=e=>{var t=e.statusMessage||"(no message)";window.prompt(`Status message for ${e.repoId} (${e.status}):`,t)},n.fetchGithubInfo=e=>{const t=window.open("","_blank");t&&t.document.write("<pre>Loading GitHub info for "+e.repoId+"...</pre>"),r.get("/api/admin/repos/"+e.repoId+"/github").then(e=>{t&&(t.document.open(),t.document.write('<pre style="font:13px monospace;padding:16px;white-space:pre-wrap">'+JSON.stringify(e.data,null,2).replace(/[<>]/g,e=>"<"===e?"&lt;":"&gt;")+"</pre>"),t.document.close())},e=>{e=e&&e.data?JSON.stringify(e.data,null,2):String(e);t&&(t.document.body.innerHTML='<pre style="color:#B42318;padding:16px">'+e+"</pre>")})},n.statusCountFor=t=>{var e=(n.statusCounts||[]).find(e=>e._id===t);return e?e.count:0},n.statusStorageFor=t=>{var e=(n.statusCounts||[]).find(e=>e._id===t);return e?e.storage:0},n.isErrorsOnly=()=>n.query&&n.query.error&&!n.query.ready&&!n.query.preparing&&!n.query.expired&&!n.query.removed,n.toggleErrorsOnly=()=>{n.isErrorsOnly()?Object.assign(n.query,{ready:!1,preparing:!0,expired:!1,removed:!1,error:!0}):Object.assign(n.query,{ready:!1,preparing:!1,expired:!1,removed:!1,error:!0}),n.query.page=1},n.toggleSortDirection=()=>{n.query.direction="asc"===n.query.direction?"desc":"asc"},n.sortBy=e=>{n.query.sort===e?n.query.direction="asc"===n.query.direction?"desc":"asc":(n.query.sort=e,n.query.direction="desc"),n.query.page=1},n.sortIcon=e=>n.query.sort===e?"asc"===n.query.direction?"fa-arrow-up":"fa-arrow-down":"","admin.repos.filterPrefs");var i=loadFilterPrefs(o)||{},i=(n.query=Object.assign({},{page:1,limit:25,sort:"lastView",direction:"desc",search:"",owner:"",conference:"",dateFrom:"",dateTo:"",ready:!1,expired:!1,removed:!1,error:!0,preparing:!0},i,{page:1,search:""}),e.search());i.owner&&(n.query.owner=i.owner),i.conference&&(n.query.conference=i.conference),i.search&&(n.query.search=i.search);const a="admin.repos.presets";function l(){n.fetchError=null,r.get("/api/admin/repos",{params:n.query}).then(e=>{n.total=e.data.total,n.totalPage=Math.ceil(e.data.total/n.query.limit),n.repositories=e.data.results,n.statusCounts=e.data.statusCounts||[],n.totalSize=e.data.totalSize||0,n.allSelected=!1},e=>{n.fetchError=e&&e.data&&e.data.error||"Failed to load repositories",console.error(e)})}n.presets=JSON.parse(localStorage.getItem(a)||"[]"),n.savePreset=()=>{const t=window.prompt("Preset name:");var e;t&&(delete(e=Object.assign({},n.query)).page,n.presets=(n.presets||[]).filter(e=>e.name!==t),n.presets.push({name:t,query:e}),localStorage.setItem(a,JSON.stringify(n.presets)))},n.applyPreset=e=>{Object.assign(n.query,e.query,{page:1})},n.deletePreset=t=>{n.presets=(n.presets||[]).filter(e=>e.name!==t.name),localStorage.setItem(a,JSON.stringify(n.presets))},n.selectAllOnPage=()=>{n.allSelected=!n.allSelected,n.repositories.forEach(e=>{n.selected[e.repoId]=n.allSelected})},n.selectedCount=()=>Object.values(n.selected||{}).filter(Boolean).length,n.selectedRepos=()=>n.repositories.filter(e=>n.selected[e.repoId]),n.bulkRefresh=()=>{var e=n.selectedRepos();e.length&&confirm(`Force refresh ${e.length} repositories?`)&&e.forEach(e=>n.updateRepository(e))},n.bulkRemoveCache=()=>{var e=n.selectedRepos();e.length&&confirm(`Purge cache for ${e.length} repositories?`)&&e.forEach(e=>n.removeCache(e))},n.clearSelection=()=>{n.selected={},n.allSelected=!1},n.exportCsv=()=>{var e=new URLSearchParams(Object.entries(n.query).filter(([,e])=>""!==e&&!1!==e&&null!=e));e.set("format","csv"),e.set("limit","10000"),window.open("/api/admin/repos?"+e.toString(),"_blank")},n.removeCache=e=>{confirm("Remove cached files for "+e.repoId+"?")&&r.delete("/api/admin/repos/"+e.repoId).then(()=>l(),e=>console.error(e))},n.removeRepository=e=>{confirm("Remove repository "+e.repoId+"?")&&r.delete("/api/repo/"+e.repoId+"/").then(()=>l(),e=>console.error(e))},n.updateRepository=t=>{const i={title:`Refreshing ${t.repoId}...`,date:new Date,body:`The repository ${t.repoId} is going to be refreshed.`};n.toasts.push(i),r.post(`/api/repo/${t.repoId}/refresh`).then(e=>{"ready"==e.data.status?i.title=t.repoId+" is refreshed.":i.title=`Refreshing of ${t.repoId}.`},e=>{i.title=`Error during the refresh of ${t.repoId}.`,i.body=e.body})},n.fetchError=null,l();let h=null;n.$watch("query",()=>{clearTimeout(h),h=setTimeout(l,500);const{page:e,search:t,...i}=n.query;saveFilterPrefs(o,i),s()},!0),s()}]).controller("usersAdminController",["$scope","$http","$location",function(n,t,e){n.Math=Math,n.$watch("user.status",()=>{null==n.user&&e.url("/")}),null==n.user&&e.url("/"),n.users=[],n.total=-1,n.totalPage=0,n.statusCounts=[],n.selected={},n.allSelected=!1;const i=e=>{"/"===e.key&&!["INPUT","TEXTAREA","SELECT"].includes(document.activeElement?.tagName)&&(e.preventDefault(),e=document.querySelector('.admin-filter-toolbar input[type="search"]'))&&e.focus()},r=(document.addEventListener("keydown",i),n.$on("$destroy",()=>document.removeEventListener("keydown",i)),n.clearFilter=e=>{"dateRange"===e?(n.query.dateFrom="",n.query.dateTo=""):n.query[e]="",n.query.page=1},n.chips=[],()=>{var e=[];n.query.role&&e.push({key:"role",label:"Role",value:n.query.role}),n.chips=e}),s=(n.statusCountFor=t=>{var e=(n.statusCounts||[]).find(e=>e._id===t);return e?e.count:0},n.toggleSortDirection=()=>{n.query.direction="asc"===n.query.direction?"desc":"asc"},n.sortBy=e=>{n.query.sort===e?n.query.direction="asc"===n.query.direction?"desc":"asc":(n.query.sort=e,n.query.direction="desc"),n.query.page=1},n.sortIcon=e=>n.query.sort===e?"asc"===n.query.direction?"fa-arrow-up":"fa-arrow-down":"","admin.users.filterPrefs");var o=loadFilterPrefs(s)||{};function a(){n.fetchError=null,t.get("/api/admin/users",{params:n.query}).then(e=>{n.total=e.data.total,n.totalPage=Math.ceil(e.data.total/n.query.limit),n.users=e.data.results,n.statusCounts=e.data.statusCounts||[],n.allSelected=!1,n.$apply()},e=>{n.fetchError=e&&e.data&&e.data.error||"Failed to load users",console.error(e)})}n.query=Object.assign({},{page:1,limit:25,sort:"username",direction:"asc",search:"",status:"",role:"",dateFrom:"",dateTo:""},o,{page:1,search:""}),n.selectAllOnPage=()=>{n.allSelected=!n.allSelected,n.users.forEach(e=>{n.selected[e.username]=n.allSelected})},n.selectedCount=()=>Object.values(n.selected||{}).filter(Boolean).length,n.selectedUsers=()=>n.users.filter(e=>n.selected[e.username]),n.banUser=e=>{confirm(`Ban user ${e.username}?`)&&t.post(`/api/admin/users/${e.username}/ban`).then(a,e=>console.error(e))},n.activateUser=e=>{t.post(`/api/admin/users/${e.username}/activate`).then(a,e=>console.error(e))},n.bulkBan=()=>{var e=n.selectedUsers();e.length&&confirm(`Ban ${e.length} users?`)&&e.forEach(e=>n.banUser(e))},n.exportCsv=()=>{var e=new URLSearchParams(Object.entries(n.query).filter(([,e])=>""!==e&&!1!==e&&null!=e));e.set("format","csv"),e.set("limit","10000"),window.open("/api/admin/users?"+e.toString(),"_blank")},n.fetchError=null,a();let l=null;n.$watch("query",()=>{clearTimeout(l),l=setTimeout(a,500);const{page:e,search:t,...i}=n.query;saveFilterPrefs(s,i),r()},!0),r()}]).controller("userAdminController",["$scope","$http","$location","$routeParams",function(n,r,e,i){n.$watch("user.status",()=>{null==n.user&&e.url("/")}),null==n.user&&e.url("/"),n.userInfo,n.repositories=[],n.search="",n.selected={},n.allSelected=!1;const t="admin.user.filterPrefs",s={status:{ready:!0,expired:!0,removed:!0,error:!0,preparing:!0}},o="anonymizeDate",a="desc";var l=loadFilterPrefs(t)||{};function h(e){r.get("/api/admin/users/"+e+"/repos",{}).then(e=>{n.repositories=e.data},e=>{console.error(e)})}function c(e){r.get("/api/admin/users/"+e,{}).then(e=>{n.userInfo=e.data},e=>{console.error(e)})}function d(){r.get("/api/admin/tokens").then(e=>{n.tokens=e.data||[]},e=>{401!==e.status&&403!==e.status&&console.error(e)})}n.filters={status:Object.assign({},s.status,l.filters&&l.filters.status||{})},n.query={sort:l.sort||o,direction:l.direction||a},n.orderBy=("asc"===n.query.direction?"":"-")+n.query.sort,n.sortBy=e=>{n.query.sort===e?n.query.direction="asc"===n.query.direction?"desc":"asc":(n.query.sort=e,n.query.direction="desc"),n.orderBy=("asc"===n.query.direction?"":"-")+n.query.sort},n.sortIcon=e=>n.query.sort===e?"asc"===n.query.direction?"fa-arrow-up":"fa-arrow-down":"",n.$watch("query",()=>{saveFilterPrefs(t,{filters:n.filters,sort:n.query.sort,direction:n.query.direction})},!0),n.$watch("filters",()=>{saveFilterPrefs(t,{filters:n.filters,sort:n.query.sort,direction:n.query.direction})},!0),n.statusCountFor=t=>(n.repositories||[]).filter(e=>e.status===t).length,n.repoFiler=e=>0!=n.filters.status[e.status]&&(0==n.search.trim().length||-1<e.source.fullName.indexOf(n.search)||-1<e.repoId.indexOf(n.search)||!!(e.statusMessage&&-1<e.statusMessage.indexOf(n.search))||!!(e.conference&&-1<e.conference.indexOf(n.search))),n.selectAllOnPage=()=>{n.allSelected=!n.allSelected,(n.filteredRepositories||n.repositories).forEach(e=>{n.selected[e.repoId]=n.allSelected})},n.selectedCount=()=>Object.values(n.selected||{}).filter(Boolean).length,n.selectedRepos=()=>n.repositories.filter(e=>n.selected[e.repoId]),n.bulkRefresh=()=>{var e=n.selectedRepos();e.length&&confirm(`Force refresh ${e.length} repositories?`)&&e.forEach(e=>n.updateRepository(e))},n.bulkRemoveCache=()=>{var e=n.selectedRepos();e.length&&confirm(`Purge cache for ${e.length} repositories?`)&&e.forEach(e=>n.removeCache(e))},n.clearSelection=()=>{n.selected={},n.allSelected=!1},n.exportCsv=()=>{var e=n.filteredRepositories||n.repositories,t=["repoId","status","statusMessage","pageView","anonymizeDate","source.fullName","conference","size.storage"].join(","),e=e.map(e=>[e.repoId,e.status,e.statusMessage||"",e.pageView||0,e.anonymizeDate||"",e.source&&e.source.fullName||"",e.conference||"",e.size&&e.size.storage||0].map(e=>{e=String(null==e?"":e);return/[",\n\r]/.test(e)?'"'+e.replace(/"/g,'""')+'"':e}).join(",")),t=new Blob([t+"\n"+e.join("\n")],{type:"text/csv"}),e=document.createElement("a");e.href=URL.createObjectURL(t),e.download=i.username+"-repositories.csv",e.click()},n.showStatusMessage=e=>{var t=e.statusMessage||"(no message)";window.prompt(`Status message for ${e.repoId} (${e.status}):`,t)},n.fetchGithubInfo=e=>{const t=window.open("","_blank");t&&t.document.write("<pre>Loading GitHub info for "+e.repoId+"...</pre>"),r.get("/api/admin/repos/"+e.repoId+"/github").then(e=>{t&&(t.document.open(),t.document.write('<pre style="font:13px monospace;padding:16px;white-space:pre-wrap">'+JSON.stringify(e.data,null,2).replace(/[<>]/g,e=>"<"===e?"&lt;":"&gt;")+"</pre>"),t.document.close())},e=>{e=e&&e.data?JSON.stringify(e.data,null,2):String(e);t&&(t.document.body.innerHTML='<pre style="color:#B42318;padding:16px">'+e+"</pre>")})},c(i.username),h(i.username),n.banUser=()=>{confirm(`Ban user ${i.username}?`)&&r.post(`/api/admin/users/${i.username}/ban`).then(()=>c(i.username),e=>console.error(e))},n.activateUser=()=>{r.post(`/api/admin/users/${i.username}/activate`).then(()=>c(i.username),e=>console.error(e))},n.promoteUser=()=>{confirm(`Promote ${i.username} to admin?`)&&r.post(`/api/admin/users/${i.username}/promote`).then(()=>c(i.username),e=>console.error(e))},n.demoteUser=()=>{confirm(`Remove admin privileges from ${i.username}?`)&&r.post(`/api/admin/users/${i.username}/demote`).then(()=>c(i.username),e=>console.error(e))},n.tokens=[],n.tokenForm={name:"",plaintext:null},d(),n.createToken=()=>{n.tokenForm.name&&r.post("/api/admin/tokens",{name:n.tokenForm.name}).then(e=>{n.tokenForm.plaintext=e.data.token,n.tokenForm.name="",d()},e=>console.error(e))},n.revokeToken=e=>{confirm(`Revoke token "${e.name}"?`)&&r.delete("/api/admin/tokens/"+e.id).then(()=>d(),e=>console.error(e))},n.removeCache=e=>{confirm("Remove cached files for "+e.repoId+"?")&&r.delete("/api/admin/repos/"+e.repoId).then(()=>h(i.username),e=>console.error(e))},n.removeRepository=e=>{confirm("Remove repository "+e.repoId+"?")&&r.delete("/api/repo/"+e.repoId+"/").then(()=>h(i.username),e=>console.error(e))},n.updateRepository=t=>{const i={title:`Refreshing ${t.repoId}...`,date:new Date,body:`The repository ${t.repoId} is going to be refreshed.`};n.toasts.push(i),r.post(`/api/repo/${t.repoId}/refresh`).then(e=>{"ready"==e.data.status?i.title=t.repoId+" is refreshed.":i.title=`Refreshing of ${t.repoId}.`},e=>{i.title=`Error during the refresh of ${t.repoId}.`,i.body=e.body})},n.getGitHubRepositories=e=>{r.get(`/api/user/${n.userInfo.username}/all_repositories`,{params:{force:"1"}}).then(e=>{n.userInfo.repositories=e.data})};let u=null;n.$watch("query",()=>{clearTimeout(u),u=setTimeout(()=>{h(i.username)},500)},!0)}]).controller("conferencesAdminController",["$scope","$http","$location",function(n,t,e){n.Math=Math,n.$watch("user.status",()=>{null==n.user&&e.url("/")}),null==n.user&&e.url("/"),n.conferences=[],n.total=-1,n.totalPage=0,n.statusCounts=[];const i=e=>{"/"===e.key&&!["INPUT","TEXTAREA","SELECT"].includes(document.activeElement?.tagName)&&(e.preventDefault(),e=document.querySelector('.admin-filter-toolbar input[type="search"]'))&&e.focus()},r=(document.addEventListener("keydown",i),n.$on("$destroy",()=>document.removeEventListener("keydown",i)),n.clearFilter=e=>{"dateRange"===e?(n.query.dateFrom="",n.query.dateTo=""):n.query[e]="",n.query.page=1},n.chips=[],()=>{var e=[];(n.query.dateFrom||n.query.dateTo)&&e.push({key:"dateRange",label:"Date",value:(n.query.dateFrom||"…")+" "+(n.query.dateTo||"…")}),n.chips=e}),s=(n.statusCountFor=t=>{var e=(n.statusCounts||[]).find(e=>e._id===t);return e?e.count:0},n.toggleSortDirection=()=>{n.query.direction="asc"===n.query.direction?"desc":"asc"},n.sortBy=e=>{n.query.sort===e?n.query.direction="asc"===n.query.direction?"desc":"asc":(n.query.sort=e,n.query.direction="desc"),n.query.page=1},n.sortIcon=e=>n.query.sort===e?"asc"===n.query.direction?"fa-arrow-up":"fa-arrow-down":"","admin.conferences.filterPrefs");var o=loadFilterPrefs(s)||{},o=(n.query=Object.assign({},{page:1,limit:25,sort:"name",direction:"asc",search:"",dateFrom:"",dateTo:"",ready:!1,expired:!1,removed:!1,error:!0,preparing:!0},o,{page:1,search:""}),e.search());o.search&&(n.query.search=o.search);const a="admin.conferences.presets";function l(){n.fetchError=null,t.get("/api/admin/conferences",{params:n.query}).then(e=>{n.total=e.data.total,n.totalPage=Math.ceil(e.data.total/n.query.limit),n.conferences=e.data.results,n.statusCounts=e.data.statusCounts||[]},e=>{n.fetchError=e&&e.data&&e.data.error||"Failed to load conferences",console.error(e)})}n.presets=JSON.parse(localStorage.getItem(a)||"[]"),n.savePreset=()=>{const t=window.prompt("Preset name:");var e;t&&(delete(e=Object.assign({},n.query)).page,n.presets=(n.presets||[]).filter(e=>e.name!==t),n.presets.push({name:t,query:e}),localStorage.setItem(a,JSON.stringify(n.presets)))},n.applyPreset=e=>{Object.assign(n.query,e.query,{page:1})},n.deletePreset=t=>{n.presets=(n.presets||[]).filter(e=>e.name!==t.name),localStorage.setItem(a,JSON.stringify(n.presets))},n.removeConference=e=>{confirm("Remove conference "+e.conferenceID+"?")&&t.delete("/api/admin/conferences/"+e.conferenceID).then(()=>l(),e=>console.error(e))},n.exportCsv=()=>{var e=new URLSearchParams(Object.entries(n.query).filter(([,e])=>""!==e&&!1!==e&&null!=e));e.set("format","csv"),e.set("limit","10000"),window.open("/api/admin/conferences?"+e.toString(),"_blank")},n.fetchError=null,l();let h=null;n.$watch("query",()=>{clearTimeout(h),h=setTimeout(l,500);const{page:e,search:t,...i}=n.query;saveFilterPrefs(s,i),r()},!0),r()}]).controller("queuesAdminController",["$scope","$http","$location","$interval","$timeout",function(T,t,e,i,n){function r(){var e={queue:T.selectedQueue,search:T.query.search};t.get("/api/admin/queues",{params:e}).then(e=>{T.queueList=e.data.queues||[],T.jobs=e.data.jobs||[],T.selectedStats=T.queueList.find(e=>e.key===T.selectedQueue)||T.queueList[0]||null},e=>console.error(e))}function s(){t.get("/api/admin/queues/metrics",{params:{queue:T.selectedQueue,range:T.range}}).then(e=>{T.metricsPoints=e.data.points||[],n(h,0)},e=>console.error(e))}T.$watch("user.status",()=>{null==T.user&&e.url("/")}),null==T.user&&e.url("/"),T.queueList=[],T.jobs=[],T.selectedQueue="download",T.selectedStats=null,T.range="1h",T.allStates=["active","waiting","delayed","failed","completed"],T.stateFilter={active:!0,waiting:!0,delayed:!0,failed:!0,completed:!0},T.query={search:"",autoRefresh:!0},T.filteredJobs=()=>(T.jobs||[]).filter(e=>T.stateFilter[e._state]),T.jobProgressPct=e=>e&&e.progress&&"object"==typeof e.progress&&"number"==typeof e.progress.percent?Math.max(0,Math.min(100,Math.round(e.progress.percent))):"number"==typeof e.progress?Math.max(0,Math.min(100,Math.round(e.progress))):null,T.jobDuration=e=>{return e.processedOn?(e=(e.finishedOn||Date.now())-e.processedOn)<1e3?e+"ms":(e/1e3).toFixed(1)+"s":"-"},T.metricsPoints=[],T.selectQueue=e=>{T.selectedQueue=e,r(),s()},T.setRange=e=>{T.range=e,s()},r(),s();const o=i(()=>{T.query.autoRefresh&&(r(),s())},15e3);function a(e){var t=e&&e.data&&(e.data.message||e.data.error)||"Request failed";T.actionError=t,n(()=>{T.actionError=null},5e3),console.error(e)}T.$on("$destroy",()=>i.cancel(o)),T.refreshNow=function(){r(),s()},T.actionError=null,T.removeJob=e=>{t.delete(`/api/admin/queue/${T.selectedQueue}/`+e.id).then(r,a)},T.retryJob=e=>{t.post(`/api/admin/queue/${T.selectedQueue}/`+e.id).then(r,a)},T.retryFailed=()=>{confirm(`Retry all failed jobs in ${T.selectedQueue}?`)&&t.post(`/api/admin/queue/${T.selectedQueue}/retry-failed`).then(r,e=>console.error(e))},T.drainSelected=()=>{confirm(`Drain the ${T.selectedQueue} queue?`)&&t.post(`/api/admin/queue/${T.selectedQueue}/drain`).then(r,e=>console.error(e))},T.togglePause=()=>{var e=T.selectedStats&&T.selectedStats.paused?"resume":"pause";t.post(`/api/admin/queue/${T.selectedQueue}/`+e).then(r,e=>console.error(e))},T.emptyQueue=()=>{confirm(`Empty the ${T.selectedQueue} queue? This removes ALL jobs.`)&&t.post(`/api/admin/queue/${T.selectedQueue}/empty`).then(r,e=>console.error(e))},T.pauseAll=()=>{confirm("Pause all queues?")&&t.post("/api/admin/queues/pause-all").then(r,e=>console.error(e))};let l=null;function E(e){if(e<=0)return{ticks:[0],niceMax:1};var t=Math.pow(10,Math.floor(Math.log10(e)));let i=t;e/i<2?i=t/2:5<e/i&&(i=2*t);var n=Math.ceil(e/i)*i,r=[];for(let e=0;e<=n;e+=i)r.push(e);return{ticks:r,niceMax:n}}function h(){var e=document.getElementById("q-throughput-chart");if(e){var o=e.getContext("2d"),t=window.devicePixelRatio||1,i=e.parentElement.getBoundingClientRect(),n=i.width-40,i=n-44-50,e=(e.width=n*t,e.height=180*t,e.style.width=n+"px",e.style.height="180px",o.setTransform(t,0,0,t,0,0),document.body.classList.contains("dark-mode")),r="#8A857C",s=e?"rgba(255,255,255,0.06)":"rgba(0,0,0,0.06)",t=e?"#A7B2FF":"#3B4AD6",a=e?"rgba(167,178,255,0.12)":"rgba(59,74,214,0.08)",l=e?"#F08A82":"#B42318",h=e?"rgba(240,138,130,0.08)":"rgba(180,35,24,0.06)",c=e?"#F5C842":"#B8860B",d=T.metricsPoints||[];if(0===d.length)o.fillStyle=r,o.font="12px monospace",o.textAlign="center",o.fillText("No metrics data yet",n/2,90),M=null;else{function u(e){return 160-e/b.niceMax*150}function p(e){return 160-e/w.niceMax*150}function m(e){return 44+e*y}var e=d.map(function(e){return e.completed}),g=d.map(function(e){return e.failed}),f=d.map(function(e){return e.avgMs}),v=d.length,y=i/(v-1||1),b=E(Math.max(1,Math.max.apply(null,e),Math.max.apply(null,g))),i=Math.max.apply(null,f),w=0<i?E(i):{ticks:[0],niceMax:1},x=(o.textAlign="right",o.textBaseline="middle",o.font="10px monospace",b.ticks.forEach(function(e){var t=u(e);o.strokeStyle=s,o.lineWidth=1,o.beginPath(),o.moveTo(44,t),o.lineTo(n-50,t),o.stroke(),o.fillStyle=r,o.fillText(1e3<=e?(e/1e3).toFixed(1)+"k":String(e),38,t)}),0<i&&(o.textAlign="left",w.ticks.forEach(function(e){var t=p(e);o.fillStyle=c,o.fillText(1e3<=e?(e/1e3).toFixed(1)+"s":e+"ms",n-50+6,t)})),Date.now()),S=Math.min(6,v);o.textAlign="center",o.textBaseline="top";for(var A=0;A<S;A++){var k=Math.round(A/(S-1)*(v-1)),_=Math.round((x-d[k].ts)/6e4),k=m(k),_=_<=0?"now":_<60?_+"m":_<1440?Math.round(_/60)+"h":Math.round(_/1440)+"d";o.fillStyle=r,o.fillText(_,k,164)}C(e,u,a,t),C(g,u,h,l),0<i&&(o.beginPath(),f.forEach(function(e,t){var i,n=m(t),e=p(e);0===t?o.moveTo(n,e):(i=(m(t-1)+n)/2,o.bezierCurveTo(i,p(f[t-1]),i,e,n,e))}),o.strokeStyle=c,o.lineWidth=1,o.setLineDash([4,3]),o.stroke(),o.setLineDash([])),M={pts:d,maxLen:v,marginLeft:44,step:y,totalW:n,toX:m}}}function C(r,s,e,t){0!==r.length&&(o.beginPath(),o.moveTo(m(0),160),r.forEach(function(e,t){var i,n=m(t),e=s(e);0===t?o.lineTo(n,e):(i=(m(t-1)+n)/2,o.bezierCurveTo(i,s(r[t-1]),i,e,n,e))}),o.lineTo(m(r.length-1),160),o.closePath(),o.fillStyle=e,o.fill(),o.beginPath(),r.forEach(function(e,t){var i,n=m(t),e=s(e);0===t?o.moveTo(n,e):(i=(m(t-1)+n)/2,o.bezierCurveTo(i,s(r[t-1]),i,e,n,e))}),o.strokeStyle=t,o.lineWidth=1.5,o.stroke())}}T.$watch("query.search",()=>{clearTimeout(l),l=setTimeout(r,350)}),T.expanded={},T.toggleJob=e=>{T.expanded[e.id]=!T.expanded[e.id]},T.humanTime=e=>{return e?(e=new Date(e)).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})+" "+e.toLocaleDateString([],{month:"short",day:"numeric"}):""},T.delayCountdown=e=>{var t;return e?(e=Math.max(0,Math.ceil((e-Date.now())/1e3)))<=0?"resuming soon":(t=e%60,"in "+(0<(e=Math.floor(e/60))?e+"m "+t+"s":t+"s")):""};var M=null;function c(){var s,o,a=document.getElementById("q-throughput-chart");a&&!a._tipBound&&(a._tipBound=!0,s=document.getElementById("q-chart-tooltip"),o=document.getElementById("q-chart-crosshair"),a.addEventListener("mousemove",function(e){var t,i,n,r;M&&s&&o&&(t=M,i=a.getBoundingClientRect(),e=e.clientX-i.left,(i=Math.round((e-t.marginLeft)/t.step))<0||i>=t.maxLen?(s.style.display="none",o.style.display="none"):(e=t.pts[i],n=Date.now(),r='<div class="q-tip-time">'+((n=Math.round((n-e.ts)/6e4))<=0?"now":n<60?n+"m ago":n<1440?(r=n%60,Math.floor(n/60)+"h"+(r?" "+r+"m":"")+" ago"):Math.round(n/1440)+"d ago")+'</div><div class="q-tip-completed">&#9679; completed: '+e.completed+'/min</div><div class="q-tip-failed">&#9679; failed: '+e.failed+"/min</div>",0<e.avgMs&&(r+='<div class="q-tip-exec">&#9679; avg time: '+(1e3<=e.avgMs?(e.avgMs/1e3).toFixed(1)+"s":e.avgMs+"ms")+"</div>"),s.innerHTML=r,(e=(n=t.toX(i))+10)+(r=s.offsetWidth)>t.totalW&&(e=n-r-10),s.style.display="block",s.style.left=e+"px",s.style.top="8px",o.style.display="block",o.style.left=n+"px"))}),a.addEventListener("mouseleave",function(){s&&(s.style.display="none"),o&&(o.style.display="none")}))}T.$watch("metricsPoints",function(){n(c,50)})}]).controller("errorsAdminController",["$scope","$http","$location","$interval",function(c,n,e,t){c.$watch("user.status",()=>{null==c.user&&e.url("/")}),null==c.user&&e.url("/"),c.entries=[],c.visible=[],c.available=!0,c.cap=1e3,c.total=0,c.pageSize=250,c.expanded={},c.detailTab={},c.copyHint="",c.parsedFilterCount=0,c.stats={last24h:0,prev24h:0,delta:0,severity:{error:0,warn:0,info:0},unique:{error:0,warn:0,info:0},buckets:[],dropped:0},c.query={search:"",bucket:"",sort:"recent",group:"code",autoRefresh:!0},c.relTime=e=>{var t;return e?(t=new Date(e).getTime(),isNaN(t)?e:(t=Math.max(0,Date.now()-t),(t=Math.floor(t/1e3))<5?"just now":t<60?t+"s ago":(t=Math.floor(t/60))<60?t+"m ago":(t=Math.floor(t/60))<24?t+"h ago":(t=Math.floor(t/24))<7?t+"d ago":new Date(e).toLocaleDateString())):""},c.absTime=e=>{var t;return e?(t=new Date(e),isNaN(t.getTime())?e:t.toLocaleString()):""},c.absTimeShort=e=>{var t;return e?(t=new Date(e),isNaN(t.getTime())?e:t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})):""};const o=/^[a-zA-Z][a-zA-Z0-9]*(?:_[a-zA-Z0-9]+)+$/;function r(t){var i=(t.raw||[]).find(e=>e&&"object"==typeof e&&!Array.isArray(e));if(i){i.message&&o.test(i.message)?(t.displayMessage=i.message,t.displayContext=t.message):i.code&&o.test(String(i.code))?(t.displayMessage=String(i.code),t.displayContext=t.message):i.name&&"AnonymousError"!==i.name&&"Error"!==i.name?(t.displayMessage=i.name,t.displayContext=i.message||t.message):t.displayMessage=t.message,t._status=i.httpStatus||i.status||null,t._url=i.url||null,t._method=i.method||null,t._repoId=i.repoId||i.detail||null,t._detail=i.detail&&i.detail!==t._repoId?i.detail:null;let e="string"==typeof i.stack?i.stack:null;for(var n=[i.cause,i.err].filter(Boolean),r=0;!e&&r<n.length;r++)for(var s=n[r];!e&&s&&"object"==typeof s;)"string"==typeof s.stack&&(e=s.stack),s=s.cause;t._stack=e}else t.displayMessage=t.message,t._status=null,t._url=null,t._stack=null;return t._bucket=function(e,t){if("number"==typeof(e=e&&(e.httpStatus||e.status)||null)){if(500<=e)return"error";if(401===e||403===e||404===e)return"info";if(400<=e)return"warn"}return"error"===t?"error":"warn"===t?"warn":"info"}(i,t.level),t._detailJson=function(e,t){const s=[],i=(e,t)=>{null!=t&&""!==t&&s.push([e,t])};i("name",t&&t.name),i("code",e.displayMessage||t&&t.message),e._bucket&&i("kind",e._bucket);i("httpStatus",t&&t.httpStatus),t&&t.status&&!t.httpStatus&&i("status",t.status);i("module",e.module);let n=t&&t.detail;if("string"==typeof n){var r=n.trim();if("{"===r[0]||"["===r[0])try{n=JSON.parse(n)}catch{}}if(i("detail",n),i("repoId",t&&t.repoId),i("filePath",t&&t.filePath),i("upstreamStatus",t&&t.upstreamStatus),i("upstreamBody",t&&t.upstreamBody),i("url",e._url),i("err",t&&t.err),i("cause",t&&!t.err&&t.cause),i("ts",e.ts),!s.length)return JSON.stringify(e,null,2);const o=s.reduce((e,t)=>Math.max(e,t[0].length),0),a=["{"];return s.forEach(([e,t],i)=>{e=` ${`"${e}":`.padEnd(o+3," ")} `,i=i<s.length-1?",":"";let n;if(t&&"object"==typeof t){const r=" ".repeat(e.length);n=JSON.stringify(t,null,2).split("\n").map((e,t)=>0===t?e:r+e).join("\n")}else n="number"==typeof t||"boolean"==typeof t?String(t):JSON.stringify(t);a.push(e+n+i)}),a.push("}"),a.join("\n")}(t,i),t}function d(t,e){for(const a of e.filters){let e;if("code"===a.key)e=t.displayMessage;else if("module"===a.key)e=t.module;else if("status"===a.key)e=t._status;else if("url"===a.key)e=t._url;else if("repo"===a.key)e=t._repoId;else{if("level"!==a.key)continue;e=t.level}if(null==e)return!1;if(i=e,n=a.val,r=a.op,o=s=void 0,s=parseFloat(i),o=parseFloat(n),!("="===r?String(i)===String(n):"!="===r?String(i)!==String(n):">="===r?o<=s:"<="===r?s<=o:">"===r?o<s:"<"!==r||s<o))return!1}var i,n,r,s,o;if(e.free&&-1===((t.displayMessage||"")+" "+(t.module||"")+" "+(t._url||"")+" "+JSON.stringify(t.raw||[])).toLowerCase().indexOf(e.free))return!1;return!0}function s(){const t=function(e){var t=[];let i="";var n,r=/(\w+):(>=|<=|!=|>|<|=)?([^\s]+)/g;let s=0;for(;n=r.exec(e);)i+=e.slice(s,n.index),s=r.lastIndex,t.push({key:n[1],op:n[2]||"=",val:n[3]});return{filters:t,free:(i+=e.slice(s)).trim().toLowerCase()}}(c.query.search||""),i=(c.parsedFilterCount=t.filters.length,c.query.bucket);let e=c.entries.filter(e=>(!i||e._bucket===i)&&d(e,t));const n=c.query.group;if(n){var r=new Map;for(const l of e){o=l;var s,o="module"===n?o.module:o.displayMessage||o.message||"_";r.has(o)?((s=r.get(o)).count++,s._related.push(l),new Date(l.ts)>new Date(s.ts)&&(s.ts=l.ts,s._url=l._url,s._status=l._status),new Date(l.ts)<new Date(s._firstSeen)&&(s._firstSeen=l.ts)):((s=Object.assign({},l))._key=n+":"+o,s._related=[l],s._firstSeen=l.ts,s._lastHourCount=0,s.count=1,r.set(o,s))}const a=Date.now()-36e5;for(const h of r.values())h._lastHourCount=h._related.filter(e=>new Date(e.ts).getTime()>=a).length;e=Array.from(r.values())}else e=e.map((e,t)=>(e._key="row:"+t+":"+e.ts,e._related=[e],e._firstSeen=e.ts,e._lastHourCount=0,e.count=1,e));var o;"count"===c.query.sort?e.sort((e,t)=>t.count-e.count||new Date(t.ts)-new Date(e.ts)):e.sort((e,t)=>new Date(t.ts)-new Date(e.ts)),c.visible=e}function i(i){var e=i?c.entries.length:0,t=i?c.pageSize:Math.max(c.pageSize,c.entries.length||c.pageSize);n.get("/api/admin/errors",{params:{offset:e,limit:t}}).then(e=>{var t=(e.data.entries||[]).map(r);c.entries=i?c.entries.concat(t):t,c.available=!!e.data.available,c.cap=e.data.max||c.cap,c.total=e.data.total||c.entries.length,s()},e=>console.error(e))}function a(){i(),n.get("/api/admin/errors/stats").then(e=>{var e=e.data||{},t=e.prev24h?Math.round((e.last24h-e.prev24h)/e.prev24h*100):0;c.stats={last24h:e.last24h||0,prev24h:e.prev24h||0,delta:t,severity:e.severity||{error:0,warn:0,info:0},unique:e.unique||{error:0,warn:0,info:0},buckets:e.buckets||[],dropped:e.dropped||0}},e=>console.error(e))}function l(e){c.copyHint=e+" copied",setTimeout(()=>{c.copyHint="",c.$apply()},1500)}c.loadMore=()=>i(!0),c.canLoadMore=()=>c.entries.length<c.total,c.barPx=(e,t)=>{var i,n;let r=0;for(const s of c.stats.buckets||[])r=Math.max(r,(s.error||0)+(s.warn||0)+(s.info||0));return r&&(i=(e.error||0)+(e.warn||0)+(e.info||0))?(n=Math.round(i/r*60),e=e[t]||0,Math.round(e/i*n)):0},c.bucketTitle=e=>{return`${new Date(e.hour).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})} · ${e.error||0} err · ${e.warn||0} warn · ${e.info||0} info`},c.toggle=e=>{c.expanded[e._key]=!c.expanded[e._key]},c.setBucket=e=>{c.query.bucket=e},c.refreshNow=a,c.clearAll=()=>{confirm("Clear all captured errors?")&&n.delete("/api/admin/errors").then(a,e=>console.error(e))},c.exportCsv=()=>{var e=["ts","level","module","displayMessage","_status","_url","_repoId"],t=[e.join(",")];for(const r of c.visible)t.push(e.map(e=>{e=null==r[e]?"":String(r[e]);return/[",\n]/.test(e)?`"${e.replace(/"/g,'""')}"`:e}).join(","));var i=new Blob([t.join("\n")],{type:"text/csv;charset=utf-8"}),i=URL.createObjectURL(i),n=document.createElement("a");n.href=i,n.download=`errors-${(new Date).toISOString().slice(0,19)}.csv`,document.body.appendChild(n),n.click(),document.body.removeChild(n),URL.revokeObjectURL(i)},c.copyJson=e=>{navigator.clipboard.writeText(e._detailJson).then(()=>l("JSON"))},c.copyCurl=e=>{e._url&&(e=`curl -X ${e._method||"GET"} '${window.location.origin}${e._url}'`,navigator.clipboard.writeText(e).then(()=>l("curl")))},a();const h=t(()=>{c.query.autoRefresh&&a()},15e3);c.$on("$destroy",()=>t.cancel(h)),c.$watch("query.search",s),c.$watch("query.bucket",s),c.$watch("query.sort",s),c.$watch("query.group",s)}]).controller("overviewAdminController",["$scope","$http","$location","$interval",function(s,e,t,i){var n,r;function o(){e.get("/api/admin/overview").then(function(e){var r,t;e.data.history=(t=e.data.history,(r=t||[]).map(function(e,t){var i=r[t-1]||{},n=Object.assign({},e);return n.dailyRepositories=t?Math.max(0,(e.nbRepositories||0)-(i.nbRepositories||0)):0,n.dailyUsers=t?Math.max(0,(e.nbUsers||0)-(i.nbUsers||0)):0,n.dailyPageViews=t?Math.max(0,(e.nbPageViews||0)-(i.nbPageViews||0)):0,n})),e.data.daily={today:{repositories:(t=(t=e.data.history)&&t.length?t[t.length-1]:{}).dailyRepositories||0,users:t.dailyUsers||0,pageViews:t.dailyPageViews||0}},s.data=e.data,s.loading=!1,s.error=null,n={},(e.data.history||[]).forEach(function(t){["dailyPageViews","dailyRepositories","dailyUsers","nbUsers"].forEach(function(e){(!n[e]||t[e]>n[e])&&(n[e]=t[e])})})},function(e){s.loading=!1,s.error=e.data&&e.data.error||"Failed to load overview"})}s.Math=Math,s.$watch("user.status",()=>{null==s.user&&t.url("/")}),null==s.user?t.url("/"):(s.data=null,s.loading=!0,s.error=null,s.humanBytes=function(e){if(null==e)return"—";for(var t=["B","KB","MB","GB","TB"],i=0,n=e;1024<=n&&i<t.length-1;)n/=1024,i++;return n.toFixed(0<i?1:0)+" "+t[i]},s.humanDuration=function(e){var t,i;return e?(t=Math.floor(e/86400),i=Math.floor(e%86400/3600),e=Math.floor(e%3600/60),0<t?t+"d "+(i<10?"0":"")+i+"h":0<i?i+"h "+(e<10?"0":"")+e+"m":e+"m"):"—"},s.humanNum=function(e){return null==e?"—":1e6<=e?(e/1e6).toFixed(1)+"M":1e3<=e?(e/1e3).toFixed(1)+"K":String(e)},s.queueTotal=function(e){return e?(e.waiting||0)+(e.active||0)+(e.delayed||0)+(e.failed||0):0},s.statusCount=function(e){if(s.data&&s.data.repos)for(var t=s.data.repos.statusBreakdown||[],i=0;i<t.length;i++)if(t[i]._id===e)return t[i].count;return 0},s.barPct=function(e){var t,i,n=s.data&&s.data.repos?s.data.repos.total:0;return n?(t=[e],"expired"===e&&t.push("expiring"),"removed"===e&&t.push("removing"),"preparing"===e&&t.push("download"),i=0,t.forEach(function(e){i+=s.statusCount(e)}),Math.max(.4,i/n*100)):0},s.errPct=function(e){var t;return s.data&&s.data.errors?(t=Math.max(s.data.errors.severity.error,s.data.errors.severity.warn,s.data.errors.severity.info,1),s.data.errors.severity[e]/t*100):0},n={},s.historyBarH=function(e,t){return e&&n[t]?Math.max(1,Math.round(e[t]/n[t]*140)):0},s.historyLabel=function(e){return e&&e.date?(e=new Date(e.date)).getUTCMonth()+1+"/"+e.getUTCDate():""},o(),r=i(o,3e4),s.$on("$destroy",function(){i.cancel(r)}))}]);