@matdata/yasr 5.14.0 → 5.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/yasr.min.js CHANGED
@@ -1,50 +1,50 @@
1
- "use strict";var Yasr=(()=>{var mb=Object.create;var ka=Object.defineProperty;var bb=Object.getOwnPropertyDescriptor;var vb=Object.getOwnPropertyNames;var yb=Object.getPrototypeOf,xb=Object.prototype.hasOwnProperty;var at=(r,n)=>()=>(n||r((n={exports:{}}).exports,n),n.exports),Tb=(r,n)=>{for(var a in n)ka(r,a,{get:n[a],enumerable:!0})},Uc=(r,n,a,l)=>{if(n&&typeof n=="object"||typeof n=="function")for(let c of vb(n))!xb.call(r,c)&&c!==a&&ka(r,c,{get:()=>n[c],enumerable:!(l=bb(n,c))||l.enumerable});return r};var Ar=(r,n,a)=>(a=r!=null?mb(yb(r)):{},Uc(n||!r||!r.__esModule?ka(a,"default",{value:r,enumerable:!0}):a,r)),Ib=r=>Uc(ka({},"__esModule",{value:!0}),r);var Hc=at((N_,Ll)=>{"use strict";var Si=typeof Reflect=="object"?Reflect:null,kc=Si&&typeof Si.apply=="function"?Si.apply:function(n,a,l){return Function.prototype.apply.call(n,a,l)},Ma;Si&&typeof Si.ownKeys=="function"?Ma=Si.ownKeys:Object.getOwnPropertySymbols?Ma=function(n){return Object.getOwnPropertyNames(n).concat(Object.getOwnPropertySymbols(n))}:Ma=function(n){return Object.getOwnPropertyNames(n)};function Eb(r){console&&console.warn&&console.warn(r)}var Gc=Number.isNaN||function(n){return n!==n};function tt(){tt.init.call(this)}Ll.exports=tt;Ll.exports.once=Rb;tt.EventEmitter=tt;tt.prototype._events=void 0;tt.prototype._eventsCount=0;tt.prototype._maxListeners=void 0;var Mc=10;function Ga(r){if(typeof r!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof r)}Object.defineProperty(tt,"defaultMaxListeners",{enumerable:!0,get:function(){return Mc},set:function(r){if(typeof r!="number"||r<0||Gc(r))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+r+".");Mc=r}});tt.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};tt.prototype.setMaxListeners=function(n){if(typeof n!="number"||n<0||Gc(n))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+n+".");return this._maxListeners=n,this};function Oc(r){return r._maxListeners===void 0?tt.defaultMaxListeners:r._maxListeners}tt.prototype.getMaxListeners=function(){return Oc(this)};tt.prototype.emit=function(n){for(var a=[],l=1;l<arguments.length;l++)a.push(arguments[l]);var c=n==="error",p=this._events;if(p!==void 0)c=c&&p.error===void 0;else if(!c)return!1;if(c){var g;if(a.length>0&&(g=a[0]),g instanceof Error)throw g;var y=new Error("Unhandled error."+(g?" ("+g.message+")":""));throw y.context=g,y}var T=p[n];if(T===void 0)return!1;if(typeof T=="function")kc(T,this,a);else for(var U=T.length,A=Qc(T,U),l=0;l<U;++l)kc(A[l],this,a);return!0};function Wc(r,n,a,l){var c,p,g;if(Ga(a),p=r._events,p===void 0?(p=r._events=Object.create(null),r._eventsCount=0):(p.newListener!==void 0&&(r.emit("newListener",n,a.listener?a.listener:a),p=r._events),g=p[n]),g===void 0)g=p[n]=a,++r._eventsCount;else if(typeof g=="function"?g=p[n]=l?[a,g]:[g,a]:l?g.unshift(a):g.push(a),c=Oc(r),c>0&&g.length>c&&!g.warned){g.warned=!0;var y=new Error("Possible EventEmitter memory leak detected. "+g.length+" "+String(n)+" listeners added. Use emitter.setMaxListeners() to increase limit");y.name="MaxListenersExceededWarning",y.emitter=r,y.type=n,y.count=g.length,Eb(y)}return r}tt.prototype.addListener=function(n,a){return Wc(this,n,a,!1)};tt.prototype.on=tt.prototype.addListener;tt.prototype.prependListener=function(n,a){return Wc(this,n,a,!0)};function Cb(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function Dc(r,n,a){var l={fired:!1,wrapFn:void 0,target:r,type:n,listener:a},c=Cb.bind(l);return c.listener=a,l.wrapFn=c,c}tt.prototype.once=function(n,a){return Ga(a),this.on(n,Dc(this,n,a)),this};tt.prototype.prependOnceListener=function(n,a){return Ga(a),this.prependListener(n,Dc(this,n,a)),this};tt.prototype.removeListener=function(n,a){var l,c,p,g,y;if(Ga(a),c=this._events,c===void 0)return this;if(l=c[n],l===void 0)return this;if(l===a||l.listener===a)--this._eventsCount===0?this._events=Object.create(null):(delete c[n],c.removeListener&&this.emit("removeListener",n,l.listener||a));else if(typeof l!="function"){for(p=-1,g=l.length-1;g>=0;g--)if(l[g]===a||l[g].listener===a){y=l[g].listener,p=g;break}if(p<0)return this;p===0?l.shift():Ab(l,p),l.length===1&&(c[n]=l[0]),c.removeListener!==void 0&&this.emit("removeListener",n,y||a)}return this};tt.prototype.off=tt.prototype.removeListener;tt.prototype.removeAllListeners=function(n){var a,l,c;if(l=this._events,l===void 0)return this;if(l.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):l[n]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete l[n]),this;if(arguments.length===0){var p=Object.keys(l),g;for(c=0;c<p.length;++c)g=p[c],g!=="removeListener"&&this.removeAllListeners(g);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(a=l[n],typeof a=="function")this.removeListener(n,a);else if(a!==void 0)for(c=a.length-1;c>=0;c--)this.removeListener(n,a[c]);return this};function Zc(r,n,a){var l=r._events;if(l===void 0)return[];var c=l[n];return c===void 0?[]:typeof c=="function"?a?[c.listener||c]:[c]:a?_b(c):Qc(c,c.length)}tt.prototype.listeners=function(n){return Zc(this,n,!0)};tt.prototype.rawListeners=function(n){return Zc(this,n,!1)};tt.listenerCount=function(r,n){return typeof r.listenerCount=="function"?r.listenerCount(n):Vc.call(r,n)};tt.prototype.listenerCount=Vc;function Vc(r){var n=this._events;if(n!==void 0){var a=n[r];if(typeof a=="function")return 1;if(a!==void 0)return a.length}return 0}tt.prototype.eventNames=function(){return this._eventsCount>0?Ma(this._events):[]};function Qc(r,n){for(var a=new Array(n),l=0;l<n;++l)a[l]=r[l];return a}function Ab(r,n){for(;n+1<r.length;n++)r[n]=r[n+1];r.pop()}function _b(r){for(var n=new Array(r.length),a=0;a<n.length;++a)n[a]=r[a].listener||r[a];return n}function Rb(r,n){return new Promise(function(a,l){function c(g){r.removeListener(n,p),l(g)}function p(){typeof r.removeListener=="function"&&r.removeListener("error",c),a([].slice.call(arguments))}Pc(r,n,p,{once:!0}),n!=="error"&&Nb(r,c,{once:!0})})}function Nb(r,n,a){typeof r.on=="function"&&Pc(r,"error",n,a)}function Pc(r,n,a,l){if(typeof r.on=="function")l.once?r.once(n,a):r.on(n,a);else if(typeof r.addEventListener=="function")r.addEventListener(n,function c(p){l.once&&r.removeEventListener(n,c),a(p)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof r)}});var $n=at((ck,Lp)=>{var ql=IC(),yC=EC(),xC=CC(),TC=typeof window<"u"?window:global;Lp.exports={assign:ql,create:yC,trim:xC,bind:AC,slice:Kl,each:wp,map:_C,pluck:$l,isList:eu,isFunction:RC,isObject:NC,Global:TC};function IC(){return Object.assign?Object.assign:function(n,a,l,c){for(var p=1;p<arguments.length;p++)wp(Object(arguments[p]),function(g,y){n[y]=g});return n}}function EC(){if(Object.create)return function(a,l,c,p){var g=Kl(arguments,1);return ql.apply(this,[Object.create(a)].concat(g))};{let n=function(){};var r=n;return function(l,c,p,g){var y=Kl(arguments,1);return n.prototype=l,ql.apply(this,[new n].concat(y))}}}function CC(){return String.prototype.trim?function(n){return String.prototype.trim.call(n)}:function(n){return n.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}}function AC(r,n){return function(){return n.apply(r,Array.prototype.slice.call(arguments,0))}}function Kl(r,n){return Array.prototype.slice.call(r,n||0)}function wp(r,n){$l(r,function(a,l){return n(a,l),!1})}function _C(r,n){var a=eu(r)?[]:{};return $l(r,function(l,c){return a[c]=n(l,c),!1}),a}function $l(r,n){if(eu(r)){for(var a=0;a<r.length;a++)if(n(r[a],a))return r[a]}else for(var l in r)if(r.hasOwnProperty(l)&&n(r[l],l))return r[l]}function eu(r){return r!=null&&typeof r!="function"&&typeof r.length=="number"}function RC(r){return r&&{}.toString.call(r)==="[object Function]"}function NC(r){return r&&{}.toString.call(r)==="[object Object]"}});var Bp=at((dk,Fp)=>{var Wn=$n(),SC=Wn.slice,wC=Wn.pluck,Xi=Wn.each,LC=Wn.bind,FC=Wn.create,tu=Wn.isList,ru=Wn.isFunction,BC=Wn.isObject;Fp.exports={createStore:nu};var UC={version:"2.0.12",enabled:!1,get:function(r,n){var a=this.storage.read(this._namespacePrefix+r);return this._deserialize(a,n)},set:function(r,n){return n===void 0?this.remove(r):(this.storage.write(this._namespacePrefix+r,this._serialize(n)),n)},remove:function(r){this.storage.remove(this._namespacePrefix+r)},each:function(r){var n=this;this.storage.each(function(a,l){r.call(n,n._deserialize(a),(l||"").replace(n._namespaceRegexp,""))})},clearAll:function(){this.storage.clearAll()},hasNamespace:function(r){return this._namespacePrefix=="__storejs_"+r+"_"},createStore:function(){return nu.apply(this,arguments)},addPlugin:function(r){this._addPlugin(r)},namespace:function(r){return nu(this.storage,this.plugins,r)}};function kC(){var r=typeof console>"u"?null:console;if(r){var n=r.warn?r.warn:r.log;n.apply(r,arguments)}}function nu(r,n,a){a||(a=""),r&&!tu(r)&&(r=[r]),n&&!tu(n)&&(n=[n]);var l=a?"__storejs_"+a+"_":"",c=a?new RegExp("^"+l):null,p=/^[a-zA-Z0-9_\-]*$/;if(!p.test(a))throw new Error("store.js namespaces can only have alphanumerics + underscores and dashes");var g={_namespacePrefix:l,_namespaceRegexp:c,_testStorage:function(T){try{var U="__storejs__test__";T.write(U,U);var A=T.read(U)===U;return T.remove(U),A}catch{return!1}},_assignPluginFnProp:function(T,U){var A=this[U];this[U]=function(){var M=SC(arguments,0),X=this;function S(){if(A)return Xi(arguments,function(R,G){M[G]=R}),A.apply(X,M)}var Z=[S].concat(M);return T.apply(X,Z)}},_serialize:function(T){return JSON.stringify(T)},_deserialize:function(T,U){if(!T)return U;var A="";try{A=JSON.parse(T)}catch{A=T}return A!==void 0?A:U},_addStorage:function(T){this.enabled||this._testStorage(T)&&(this.storage=T,this.enabled=!0)},_addPlugin:function(T){var U=this;if(tu(T)){Xi(T,function(M){U._addPlugin(M)});return}var A=wC(this.plugins,function(M){return T===M});if(!A){if(this.plugins.push(T),!ru(T))throw new Error("Plugins must be function values that return objects");var F=T.call(this);if(!BC(F))throw new Error("Plugins must return an object of function properties");Xi(F,function(M,X){if(!ru(M))throw new Error("Bad plugin property: "+X+" from plugin "+T.name+". Plugins should only return functions.");U._assignPluginFnProp(M,X)})}},addStorage:function(T){kC("store.addStorage(storage) is deprecated. Use createStore([storages])"),this._addStorage(T)}},y=FC(g,UC,{plugins:[]});return y.raw={},Xi(y,function(T,U){ru(T)&&(y.raw[U]=LC(y,T))}),Xi(r,function(T){y._addStorage(T)}),Xi(n,function(T){y._addPlugin(T)}),y}});var Mp=at((hk,kp)=>{var MC=$n(),GC=MC.Global;kp.exports={name:"localStorage",read:Up,write:OC,each:WC,remove:DC,clearAll:ZC};function Yi(){return GC.localStorage}function Up(r){return Yi().getItem(r)}function OC(r,n){return Yi().setItem(r,n)}function WC(r){for(var n=Yi().length-1;n>=0;n--){var a=Yi().key(n);r(Up(a),a)}}function DC(r){return Yi().removeItem(r)}function ZC(){return Yi().clear()}});var Wp=at((pk,Op)=>{var VC=$n(),QC=VC.Global;Op.exports={name:"oldFF-globalStorage",read:PC,write:HC,each:Gp,remove:JC,clearAll:XC};var ei=QC.globalStorage;function PC(r){return ei[r]}function HC(r,n){ei[r]=n}function Gp(r){for(var n=ei.length-1;n>=0;n--){var a=ei.key(n);r(ei[a],a)}}function JC(r){return ei.removeItem(r)}function XC(){Gp(function(r,n){delete ei[r]})}});var Vp=at((gk,Zp)=>{var YC=$n(),iu=YC.Global;Zp.exports={name:"oldIE-userDataStorage",write:jC,read:zC,each:qC,remove:KC,clearAll:$C};var Po="storejs",Qo=iu.document,Ho=tA(),Dp=(iu.navigator?iu.navigator.userAgent:"").match(/ (MSIE 8|MSIE 9|MSIE 10)\./);function jC(r,n){if(!Dp){var a=ou(r);Ho(function(l){l.setAttribute(a,n),l.save(Po)})}}function zC(r){if(!Dp){var n=ou(r),a=null;return Ho(function(l){a=l.getAttribute(n)}),a}}function qC(r){Ho(function(n){for(var a=n.XMLDocument.documentElement.attributes,l=a.length-1;l>=0;l--){var c=a[l];r(n.getAttribute(c.name),c.name)}})}function KC(r){var n=ou(r);Ho(function(a){a.removeAttribute(n),a.save(Po)})}function $C(){Ho(function(r){var n=r.XMLDocument.documentElement.attributes;r.load(Po);for(var a=n.length-1;a>=0;a--)r.removeAttribute(n[a].name);r.save(Po)})}var eA=new RegExp("[!\"#$%&'()*+,/\\\\:;<=>?@[\\]^`{|}~]","g");function ou(r){return r.replace(/^\d/,"___$&").replace(eA,"___")}function tA(){if(!Qo||!Qo.documentElement||!Qo.documentElement.addBehavior)return null;var r="script",n,a,l;try{a=new ActiveXObject("htmlfile"),a.open(),a.write("<"+r+">document.w=window</"+r+'><iframe src="/favicon.ico"></iframe>'),a.close(),n=a.w.frames[0].document,l=n.createElement("div")}catch{l=Qo.createElement("div"),n=Qo.body}return function(c){var p=[].slice.call(arguments,0);p.unshift(l),n.appendChild(l),l.addBehavior("#default#userData"),l.load(Po),c.apply(this,p),n.removeChild(l)}}});var Yp=at((mk,Xp)=>{var Qp=$n(),rA=Qp.Global,nA=Qp.trim;Xp.exports={name:"cookieStorage",read:iA,write:oA,each:Pp,remove:Hp,clearAll:aA};var Jo=rA.document;function iA(r){if(!r||!Jp(r))return null;var n="(?:^|.*;\\s*)"+escape(r).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=\\s*((?:[^;](?!;))*[^;]?).*";return unescape(Jo.cookie.replace(new RegExp(n),"$1"))}function Pp(r){for(var n=Jo.cookie.split(/; ?/g),a=n.length-1;a>=0;a--)if(nA(n[a])){var l=n[a].split("="),c=unescape(l[0]),p=unescape(l[1]);r(p,c)}}function oA(r,n){r&&(Jo.cookie=escape(r)+"="+escape(n)+"; expires=Tue, 19 Jan 2038 03:14:07 GMT; path=/")}function Hp(r){!r||!Jp(r)||(Jo.cookie=escape(r)+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/")}function aA(){Pp(function(r,n){Hp(n)})}function Jp(r){return new RegExp("(?:^|;\\s*)"+escape(r).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=").test(Jo.cookie)}});var qp=at((bk,zp)=>{var sA=$n(),lA=sA.Global;zp.exports={name:"sessionStorage",read:jp,write:uA,each:fA,remove:cA,clearAll:dA};function ji(){return lA.sessionStorage}function jp(r){return ji().getItem(r)}function uA(r,n){return ji().setItem(r,n)}function fA(r){for(var n=ji().length-1;n>=0;n--){var a=ji().key(n);r(jp(a),a)}}function cA(r){return ji().removeItem(r)}function dA(){return ji().clear()}});var $p=at((vk,Kp)=>{Kp.exports={name:"memoryStorage",read:hA,write:pA,each:gA,remove:mA,clearAll:bA};var ti={};function hA(r){return ti[r]}function pA(r,n){ti[r]=n}function gA(r){for(var n in ti)ti.hasOwnProperty(n)&&r(ti[n],n)}function mA(r){delete ti[r]}function bA(r){ti={}}});var tg=at((yk,eg)=>{eg.exports=[Mp(),Wp(),Vp(),Yp(),qp(),$p()]});var rg=at((exports,module)=>{typeof JSON!="object"&&(JSON={});(function(){"use strict";var rx_one=/^[\],:{}\s]*$/,rx_two=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,rx_three=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,rx_four=/(?:^|:|,)(?:\s*\[)+/g,rx_escapable=/[\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,rx_dangerous=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;function f(r){return r<10?"0"+r:r}function this_value(){return this.valueOf()}typeof Date.prototype.toJSON!="function"&&(Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null},Boolean.prototype.toJSON=this_value,Number.prototype.toJSON=this_value,String.prototype.toJSON=this_value);var gap,indent,meta,rep;function quote(r){return rx_escapable.lastIndex=0,rx_escapable.test(r)?'"'+r.replace(rx_escapable,function(n){var a=meta[n];return typeof a=="string"?a:"\\u"+("0000"+n.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+r+'"'}function str(r,n){var a,l,c,p,g=gap,y,T=n[r];switch(T&&typeof T=="object"&&typeof T.toJSON=="function"&&(T=T.toJSON(r)),typeof rep=="function"&&(T=rep.call(n,r,T)),typeof T){case"string":return quote(T);case"number":return isFinite(T)?String(T):"null";case"boolean":case"null":return String(T);case"object":if(!T)return"null";if(gap+=indent,y=[],Object.prototype.toString.apply(T)==="[object Array]"){for(p=T.length,a=0;a<p;a+=1)y[a]=str(a,T)||"null";return c=y.length===0?"[]":gap?`[
1
+ "use strict";var Yasr=(()=>{var mb=Object.create;var ka=Object.defineProperty;var bb=Object.getOwnPropertyDescriptor;var vb=Object.getOwnPropertyNames;var yb=Object.getPrototypeOf,xb=Object.prototype.hasOwnProperty;var at=(r,n)=>()=>(n||r((n={exports:{}}).exports,n),n.exports),Tb=(r,n)=>{for(var a in n)ka(r,a,{get:n[a],enumerable:!0})},Uc=(r,n,a,l)=>{if(n&&typeof n=="object"||typeof n=="function")for(let c of vb(n))!xb.call(r,c)&&c!==a&&ka(r,c,{get:()=>n[c],enumerable:!(l=bb(n,c))||l.enumerable});return r};var Ar=(r,n,a)=>(a=r!=null?mb(yb(r)):{},Uc(n||!r||!r.__esModule?ka(a,"default",{value:r,enumerable:!0}):a,r)),Ib=r=>Uc(ka({},"__esModule",{value:!0}),r);var Hc=at((NR,Ll)=>{"use strict";var Si=typeof Reflect=="object"?Reflect:null,kc=Si&&typeof Si.apply=="function"?Si.apply:function(n,a,l){return Function.prototype.apply.call(n,a,l)},Ma;Si&&typeof Si.ownKeys=="function"?Ma=Si.ownKeys:Object.getOwnPropertySymbols?Ma=function(n){return Object.getOwnPropertyNames(n).concat(Object.getOwnPropertySymbols(n))}:Ma=function(n){return Object.getOwnPropertyNames(n)};function Eb(r){console&&console.warn&&console.warn(r)}var Gc=Number.isNaN||function(n){return n!==n};function tt(){tt.init.call(this)}Ll.exports=tt;Ll.exports.once=_b;tt.EventEmitter=tt;tt.prototype._events=void 0;tt.prototype._eventsCount=0;tt.prototype._maxListeners=void 0;var Mc=10;function Ga(r){if(typeof r!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof r)}Object.defineProperty(tt,"defaultMaxListeners",{enumerable:!0,get:function(){return Mc},set:function(r){if(typeof r!="number"||r<0||Gc(r))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+r+".");Mc=r}});tt.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};tt.prototype.setMaxListeners=function(n){if(typeof n!="number"||n<0||Gc(n))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+n+".");return this._maxListeners=n,this};function Oc(r){return r._maxListeners===void 0?tt.defaultMaxListeners:r._maxListeners}tt.prototype.getMaxListeners=function(){return Oc(this)};tt.prototype.emit=function(n){for(var a=[],l=1;l<arguments.length;l++)a.push(arguments[l]);var c=n==="error",p=this._events;if(p!==void 0)c=c&&p.error===void 0;else if(!c)return!1;if(c){var g;if(a.length>0&&(g=a[0]),g instanceof Error)throw g;var y=new Error("Unhandled error."+(g?" ("+g.message+")":""));throw y.context=g,y}var T=p[n];if(T===void 0)return!1;if(typeof T=="function")kc(T,this,a);else for(var U=T.length,A=Qc(T,U),l=0;l<U;++l)kc(A[l],this,a);return!0};function Wc(r,n,a,l){var c,p,g;if(Ga(a),p=r._events,p===void 0?(p=r._events=Object.create(null),r._eventsCount=0):(p.newListener!==void 0&&(r.emit("newListener",n,a.listener?a.listener:a),p=r._events),g=p[n]),g===void 0)g=p[n]=a,++r._eventsCount;else if(typeof g=="function"?g=p[n]=l?[a,g]:[g,a]:l?g.unshift(a):g.push(a),c=Oc(r),c>0&&g.length>c&&!g.warned){g.warned=!0;var y=new Error("Possible EventEmitter memory leak detected. "+g.length+" "+String(n)+" listeners added. Use emitter.setMaxListeners() to increase limit");y.name="MaxListenersExceededWarning",y.emitter=r,y.type=n,y.count=g.length,Eb(y)}return r}tt.prototype.addListener=function(n,a){return Wc(this,n,a,!1)};tt.prototype.on=tt.prototype.addListener;tt.prototype.prependListener=function(n,a){return Wc(this,n,a,!0)};function Cb(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function Dc(r,n,a){var l={fired:!1,wrapFn:void 0,target:r,type:n,listener:a},c=Cb.bind(l);return c.listener=a,l.wrapFn=c,c}tt.prototype.once=function(n,a){return Ga(a),this.on(n,Dc(this,n,a)),this};tt.prototype.prependOnceListener=function(n,a){return Ga(a),this.prependListener(n,Dc(this,n,a)),this};tt.prototype.removeListener=function(n,a){var l,c,p,g,y;if(Ga(a),c=this._events,c===void 0)return this;if(l=c[n],l===void 0)return this;if(l===a||l.listener===a)--this._eventsCount===0?this._events=Object.create(null):(delete c[n],c.removeListener&&this.emit("removeListener",n,l.listener||a));else if(typeof l!="function"){for(p=-1,g=l.length-1;g>=0;g--)if(l[g]===a||l[g].listener===a){y=l[g].listener,p=g;break}if(p<0)return this;p===0?l.shift():Ab(l,p),l.length===1&&(c[n]=l[0]),c.removeListener!==void 0&&this.emit("removeListener",n,y||a)}return this};tt.prototype.off=tt.prototype.removeListener;tt.prototype.removeAllListeners=function(n){var a,l,c;if(l=this._events,l===void 0)return this;if(l.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):l[n]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete l[n]),this;if(arguments.length===0){var p=Object.keys(l),g;for(c=0;c<p.length;++c)g=p[c],g!=="removeListener"&&this.removeAllListeners(g);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(a=l[n],typeof a=="function")this.removeListener(n,a);else if(a!==void 0)for(c=a.length-1;c>=0;c--)this.removeListener(n,a[c]);return this};function Zc(r,n,a){var l=r._events;if(l===void 0)return[];var c=l[n];return c===void 0?[]:typeof c=="function"?a?[c.listener||c]:[c]:a?Rb(c):Qc(c,c.length)}tt.prototype.listeners=function(n){return Zc(this,n,!0)};tt.prototype.rawListeners=function(n){return Zc(this,n,!1)};tt.listenerCount=function(r,n){return typeof r.listenerCount=="function"?r.listenerCount(n):Vc.call(r,n)};tt.prototype.listenerCount=Vc;function Vc(r){var n=this._events;if(n!==void 0){var a=n[r];if(typeof a=="function")return 1;if(a!==void 0)return a.length}return 0}tt.prototype.eventNames=function(){return this._eventsCount>0?Ma(this._events):[]};function Qc(r,n){for(var a=new Array(n),l=0;l<n;++l)a[l]=r[l];return a}function Ab(r,n){for(;n+1<r.length;n++)r[n]=r[n+1];r.pop()}function Rb(r){for(var n=new Array(r.length),a=0;a<n.length;++a)n[a]=r[a].listener||r[a];return n}function _b(r,n){return new Promise(function(a,l){function c(g){r.removeListener(n,p),l(g)}function p(){typeof r.removeListener=="function"&&r.removeListener("error",c),a([].slice.call(arguments))}Pc(r,n,p,{once:!0}),n!=="error"&&Nb(r,c,{once:!0})})}function Nb(r,n,a){typeof r.on=="function"&&Pc(r,"error",n,a)}function Pc(r,n,a,l){if(typeof r.on=="function")l.once?r.once(n,a):r.on(n,a);else if(typeof r.addEventListener=="function")r.addEventListener(n,function c(p){l.once&&r.removeEventListener(n,c),a(p)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof r)}});var $n=at((ck,Lp)=>{var ql=IC(),yC=EC(),xC=CC(),TC=typeof window<"u"?window:global;Lp.exports={assign:ql,create:yC,trim:xC,bind:AC,slice:Kl,each:wp,map:RC,pluck:$l,isList:eu,isFunction:_C,isObject:NC,Global:TC};function IC(){return Object.assign?Object.assign:function(n,a,l,c){for(var p=1;p<arguments.length;p++)wp(Object(arguments[p]),function(g,y){n[y]=g});return n}}function EC(){if(Object.create)return function(a,l,c,p){var g=Kl(arguments,1);return ql.apply(this,[Object.create(a)].concat(g))};{let n=function(){};var r=n;return function(l,c,p,g){var y=Kl(arguments,1);return n.prototype=l,ql.apply(this,[new n].concat(y))}}}function CC(){return String.prototype.trim?function(n){return String.prototype.trim.call(n)}:function(n){return n.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}}function AC(r,n){return function(){return n.apply(r,Array.prototype.slice.call(arguments,0))}}function Kl(r,n){return Array.prototype.slice.call(r,n||0)}function wp(r,n){$l(r,function(a,l){return n(a,l),!1})}function RC(r,n){var a=eu(r)?[]:{};return $l(r,function(l,c){return a[c]=n(l,c),!1}),a}function $l(r,n){if(eu(r)){for(var a=0;a<r.length;a++)if(n(r[a],a))return r[a]}else for(var l in r)if(r.hasOwnProperty(l)&&n(r[l],l))return r[l]}function eu(r){return r!=null&&typeof r!="function"&&typeof r.length=="number"}function _C(r){return r&&{}.toString.call(r)==="[object Function]"}function NC(r){return r&&{}.toString.call(r)==="[object Object]"}});var Bp=at((dk,Fp)=>{var Wn=$n(),SC=Wn.slice,wC=Wn.pluck,Xi=Wn.each,LC=Wn.bind,FC=Wn.create,tu=Wn.isList,ru=Wn.isFunction,BC=Wn.isObject;Fp.exports={createStore:nu};var UC={version:"2.0.12",enabled:!1,get:function(r,n){var a=this.storage.read(this._namespacePrefix+r);return this._deserialize(a,n)},set:function(r,n){return n===void 0?this.remove(r):(this.storage.write(this._namespacePrefix+r,this._serialize(n)),n)},remove:function(r){this.storage.remove(this._namespacePrefix+r)},each:function(r){var n=this;this.storage.each(function(a,l){r.call(n,n._deserialize(a),(l||"").replace(n._namespaceRegexp,""))})},clearAll:function(){this.storage.clearAll()},hasNamespace:function(r){return this._namespacePrefix=="__storejs_"+r+"_"},createStore:function(){return nu.apply(this,arguments)},addPlugin:function(r){this._addPlugin(r)},namespace:function(r){return nu(this.storage,this.plugins,r)}};function kC(){var r=typeof console>"u"?null:console;if(r){var n=r.warn?r.warn:r.log;n.apply(r,arguments)}}function nu(r,n,a){a||(a=""),r&&!tu(r)&&(r=[r]),n&&!tu(n)&&(n=[n]);var l=a?"__storejs_"+a+"_":"",c=a?new RegExp("^"+l):null,p=/^[a-zA-Z0-9_\-]*$/;if(!p.test(a))throw new Error("store.js namespaces can only have alphanumerics + underscores and dashes");var g={_namespacePrefix:l,_namespaceRegexp:c,_testStorage:function(T){try{var U="__storejs__test__";T.write(U,U);var A=T.read(U)===U;return T.remove(U),A}catch{return!1}},_assignPluginFnProp:function(T,U){var A=this[U];this[U]=function(){var M=SC(arguments,0),X=this;function S(){if(A)return Xi(arguments,function(_,G){M[G]=_}),A.apply(X,M)}var Z=[S].concat(M);return T.apply(X,Z)}},_serialize:function(T){return JSON.stringify(T)},_deserialize:function(T,U){if(!T)return U;var A="";try{A=JSON.parse(T)}catch{A=T}return A!==void 0?A:U},_addStorage:function(T){this.enabled||this._testStorage(T)&&(this.storage=T,this.enabled=!0)},_addPlugin:function(T){var U=this;if(tu(T)){Xi(T,function(M){U._addPlugin(M)});return}var A=wC(this.plugins,function(M){return T===M});if(!A){if(this.plugins.push(T),!ru(T))throw new Error("Plugins must be function values that return objects");var F=T.call(this);if(!BC(F))throw new Error("Plugins must return an object of function properties");Xi(F,function(M,X){if(!ru(M))throw new Error("Bad plugin property: "+X+" from plugin "+T.name+". Plugins should only return functions.");U._assignPluginFnProp(M,X)})}},addStorage:function(T){kC("store.addStorage(storage) is deprecated. Use createStore([storages])"),this._addStorage(T)}},y=FC(g,UC,{plugins:[]});return y.raw={},Xi(y,function(T,U){ru(T)&&(y.raw[U]=LC(y,T))}),Xi(r,function(T){y._addStorage(T)}),Xi(n,function(T){y._addPlugin(T)}),y}});var Mp=at((hk,kp)=>{var MC=$n(),GC=MC.Global;kp.exports={name:"localStorage",read:Up,write:OC,each:WC,remove:DC,clearAll:ZC};function Yi(){return GC.localStorage}function Up(r){return Yi().getItem(r)}function OC(r,n){return Yi().setItem(r,n)}function WC(r){for(var n=Yi().length-1;n>=0;n--){var a=Yi().key(n);r(Up(a),a)}}function DC(r){return Yi().removeItem(r)}function ZC(){return Yi().clear()}});var Wp=at((pk,Op)=>{var VC=$n(),QC=VC.Global;Op.exports={name:"oldFF-globalStorage",read:PC,write:HC,each:Gp,remove:JC,clearAll:XC};var ei=QC.globalStorage;function PC(r){return ei[r]}function HC(r,n){ei[r]=n}function Gp(r){for(var n=ei.length-1;n>=0;n--){var a=ei.key(n);r(ei[a],a)}}function JC(r){return ei.removeItem(r)}function XC(){Gp(function(r,n){delete ei[r]})}});var Vp=at((gk,Zp)=>{var YC=$n(),iu=YC.Global;Zp.exports={name:"oldIE-userDataStorage",write:jC,read:zC,each:qC,remove:KC,clearAll:$C};var Po="storejs",Qo=iu.document,Ho=tA(),Dp=(iu.navigator?iu.navigator.userAgent:"").match(/ (MSIE 8|MSIE 9|MSIE 10)\./);function jC(r,n){if(!Dp){var a=ou(r);Ho(function(l){l.setAttribute(a,n),l.save(Po)})}}function zC(r){if(!Dp){var n=ou(r),a=null;return Ho(function(l){a=l.getAttribute(n)}),a}}function qC(r){Ho(function(n){for(var a=n.XMLDocument.documentElement.attributes,l=a.length-1;l>=0;l--){var c=a[l];r(n.getAttribute(c.name),c.name)}})}function KC(r){var n=ou(r);Ho(function(a){a.removeAttribute(n),a.save(Po)})}function $C(){Ho(function(r){var n=r.XMLDocument.documentElement.attributes;r.load(Po);for(var a=n.length-1;a>=0;a--)r.removeAttribute(n[a].name);r.save(Po)})}var eA=new RegExp("[!\"#$%&'()*+,/\\\\:;<=>?@[\\]^`{|}~]","g");function ou(r){return r.replace(/^\d/,"___$&").replace(eA,"___")}function tA(){if(!Qo||!Qo.documentElement||!Qo.documentElement.addBehavior)return null;var r="script",n,a,l;try{a=new ActiveXObject("htmlfile"),a.open(),a.write("<"+r+">document.w=window</"+r+'><iframe src="/favicon.ico"></iframe>'),a.close(),n=a.w.frames[0].document,l=n.createElement("div")}catch{l=Qo.createElement("div"),n=Qo.body}return function(c){var p=[].slice.call(arguments,0);p.unshift(l),n.appendChild(l),l.addBehavior("#default#userData"),l.load(Po),c.apply(this,p),n.removeChild(l)}}});var Yp=at((mk,Xp)=>{var Qp=$n(),rA=Qp.Global,nA=Qp.trim;Xp.exports={name:"cookieStorage",read:iA,write:oA,each:Pp,remove:Hp,clearAll:aA};var Jo=rA.document;function iA(r){if(!r||!Jp(r))return null;var n="(?:^|.*;\\s*)"+escape(r).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=\\s*((?:[^;](?!;))*[^;]?).*";return unescape(Jo.cookie.replace(new RegExp(n),"$1"))}function Pp(r){for(var n=Jo.cookie.split(/; ?/g),a=n.length-1;a>=0;a--)if(nA(n[a])){var l=n[a].split("="),c=unescape(l[0]),p=unescape(l[1]);r(p,c)}}function oA(r,n){r&&(Jo.cookie=escape(r)+"="+escape(n)+"; expires=Tue, 19 Jan 2038 03:14:07 GMT; path=/")}function Hp(r){!r||!Jp(r)||(Jo.cookie=escape(r)+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/")}function aA(){Pp(function(r,n){Hp(n)})}function Jp(r){return new RegExp("(?:^|;\\s*)"+escape(r).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=").test(Jo.cookie)}});var qp=at((bk,zp)=>{var sA=$n(),lA=sA.Global;zp.exports={name:"sessionStorage",read:jp,write:uA,each:fA,remove:cA,clearAll:dA};function ji(){return lA.sessionStorage}function jp(r){return ji().getItem(r)}function uA(r,n){return ji().setItem(r,n)}function fA(r){for(var n=ji().length-1;n>=0;n--){var a=ji().key(n);r(jp(a),a)}}function cA(r){return ji().removeItem(r)}function dA(){return ji().clear()}});var $p=at((vk,Kp)=>{Kp.exports={name:"memoryStorage",read:hA,write:pA,each:gA,remove:mA,clearAll:bA};var ti={};function hA(r){return ti[r]}function pA(r,n){ti[r]=n}function gA(r){for(var n in ti)ti.hasOwnProperty(n)&&r(ti[n],n)}function mA(r){delete ti[r]}function bA(r){ti={}}});var tg=at((yk,eg)=>{eg.exports=[Mp(),Wp(),Vp(),Yp(),qp(),$p()]});var rg=at((exports,module)=>{typeof JSON!="object"&&(JSON={});(function(){"use strict";var rx_one=/^[\],:{}\s]*$/,rx_two=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,rx_three=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,rx_four=/(?:^|:|,)(?:\s*\[)+/g,rx_escapable=/[\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,rx_dangerous=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;function f(r){return r<10?"0"+r:r}function this_value(){return this.valueOf()}typeof Date.prototype.toJSON!="function"&&(Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null},Boolean.prototype.toJSON=this_value,Number.prototype.toJSON=this_value,String.prototype.toJSON=this_value);var gap,indent,meta,rep;function quote(r){return rx_escapable.lastIndex=0,rx_escapable.test(r)?'"'+r.replace(rx_escapable,function(n){var a=meta[n];return typeof a=="string"?a:"\\u"+("0000"+n.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+r+'"'}function str(r,n){var a,l,c,p,g=gap,y,T=n[r];switch(T&&typeof T=="object"&&typeof T.toJSON=="function"&&(T=T.toJSON(r)),typeof rep=="function"&&(T=rep.call(n,r,T)),typeof T){case"string":return quote(T);case"number":return isFinite(T)?String(T):"null";case"boolean":case"null":return String(T);case"object":if(!T)return"null";if(gap+=indent,y=[],Object.prototype.toString.apply(T)==="[object Array]"){for(p=T.length,a=0;a<p;a+=1)y[a]=str(a,T)||"null";return c=y.length===0?"[]":gap?`[
2
2
  `+gap+y.join(`,
3
3
  `+gap)+`
4
4
  `+g+"]":"["+y.join(",")+"]",gap=g,c}if(rep&&typeof rep=="object")for(p=rep.length,a=0;a<p;a+=1)typeof rep[a]=="string"&&(l=rep[a],c=str(l,T),c&&y.push(quote(l)+(gap?": ":":")+c));else for(l in T)Object.prototype.hasOwnProperty.call(T,l)&&(c=str(l,T),c&&y.push(quote(l)+(gap?": ":":")+c));return c=y.length===0?"{}":gap?`{
5
5
  `+gap+y.join(`,
6
6
  `+gap)+`
7
- `+g+"}":"{"+y.join(",")+"}",gap=g,c}}typeof JSON.stringify!="function"&&(meta={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},JSON.stringify=function(r,n,a){var l;if(gap="",indent="",typeof a=="number")for(l=0;l<a;l+=1)indent+=" ";else typeof a=="string"&&(indent=a);if(rep=n,n&&typeof n!="function"&&(typeof n!="object"||typeof n.length!="number"))throw new Error("JSON.stringify");return str("",{"":r})}),typeof JSON.parse!="function"&&(JSON.parse=function(text,reviver){var j;function walk(r,n){var a,l,c=r[n];if(c&&typeof c=="object")for(a in c)Object.prototype.hasOwnProperty.call(c,a)&&(l=walk(c,a),l!==void 0?c[a]=l:delete c[a]);return reviver.call(r,n,c)}if(text=String(text),rx_dangerous.lastIndex=0,rx_dangerous.test(text)&&(text=text.replace(rx_dangerous,function(r){return"\\u"+("0000"+r.charCodeAt(0).toString(16)).slice(-4)})),rx_one.test(text.replace(rx_two,"@").replace(rx_three,"]").replace(rx_four,"")))return j=eval("("+text+")"),typeof reviver=="function"?walk({"":j},""):j;throw new SyntaxError("JSON.parse")})})()});var ig=at((xk,ng)=>{ng.exports=vA;function vA(){return rg(),{}}});var ag=at((Tk,og)=>{var yA=Bp(),xA=tg(),TA=[ig()];og.exports=yA.createStore(xA,TA)});var ug=at(xs=>{"use strict";xs.byteLength=CA;xs.toByteArray=_A;xs.fromByteArray=SA;var qr=[],Nr=[],EA=typeof Uint8Array<"u"?Uint8Array:Array,su="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(ni=0,sg=su.length;ni<sg;++ni)qr[ni]=su[ni],Nr[su.charCodeAt(ni)]=ni;var ni,sg;Nr[45]=62;Nr[95]=63;function lg(r){var n=r.length;if(n%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var a=r.indexOf("=");a===-1&&(a=n);var l=a===n?0:4-a%4;return[a,l]}function CA(r){var n=lg(r),a=n[0],l=n[1];return(a+l)*3/4-l}function AA(r,n,a){return(n+a)*3/4-a}function _A(r){var n,a=lg(r),l=a[0],c=a[1],p=new EA(AA(r,l,c)),g=0,y=c>0?l-4:l,T;for(T=0;T<y;T+=4)n=Nr[r.charCodeAt(T)]<<18|Nr[r.charCodeAt(T+1)]<<12|Nr[r.charCodeAt(T+2)]<<6|Nr[r.charCodeAt(T+3)],p[g++]=n>>16&255,p[g++]=n>>8&255,p[g++]=n&255;return c===2&&(n=Nr[r.charCodeAt(T)]<<2|Nr[r.charCodeAt(T+1)]>>4,p[g++]=n&255),c===1&&(n=Nr[r.charCodeAt(T)]<<10|Nr[r.charCodeAt(T+1)]<<4|Nr[r.charCodeAt(T+2)]>>2,p[g++]=n>>8&255,p[g++]=n&255),p}function RA(r){return qr[r>>18&63]+qr[r>>12&63]+qr[r>>6&63]+qr[r&63]}function NA(r,n,a){for(var l,c=[],p=n;p<a;p+=3)l=(r[p]<<16&16711680)+(r[p+1]<<8&65280)+(r[p+2]&255),c.push(RA(l));return c.join("")}function SA(r){for(var n,a=r.length,l=a%3,c=[],p=16383,g=0,y=a-l;g<y;g+=p)c.push(NA(r,g,g+p>y?y:g+p));return l===1?(n=r[a-1],c.push(qr[n>>2]+qr[n<<4&63]+"==")):l===2&&(n=(r[a-2]<<8)+r[a-1],c.push(qr[n>>10]+qr[n>>4&63]+qr[n<<2&63]+"=")),c.join("")}});var fg=at(lu=>{lu.read=function(r,n,a,l,c){var p,g,y=c*8-l-1,T=(1<<y)-1,U=T>>1,A=-7,F=a?c-1:0,M=a?-1:1,X=r[n+F];for(F+=M,p=X&(1<<-A)-1,X>>=-A,A+=y;A>0;p=p*256+r[n+F],F+=M,A-=8);for(g=p&(1<<-A)-1,p>>=-A,A+=l;A>0;g=g*256+r[n+F],F+=M,A-=8);if(p===0)p=1-U;else{if(p===T)return g?NaN:(X?-1:1)*(1/0);g=g+Math.pow(2,l),p=p-U}return(X?-1:1)*g*Math.pow(2,p-l)};lu.write=function(r,n,a,l,c,p){var g,y,T,U=p*8-c-1,A=(1<<U)-1,F=A>>1,M=c===23?Math.pow(2,-24)-Math.pow(2,-77):0,X=l?0:p-1,S=l?1:-1,Z=n<0||n===0&&1/n<0?1:0;for(n=Math.abs(n),isNaN(n)||n===1/0?(y=isNaN(n)?1:0,g=A):(g=Math.floor(Math.log(n)/Math.LN2),n*(T=Math.pow(2,-g))<1&&(g--,T*=2),g+F>=1?n+=M/T:n+=M*Math.pow(2,1-F),n*T>=2&&(g++,T/=2),g+F>=A?(y=0,g=A):g+F>=1?(y=(n*T-1)*Math.pow(2,c),g=g+F):(y=n*Math.pow(2,F-1)*Math.pow(2,c),g=0));c>=8;r[a+X]=y&255,X+=S,y/=256,c-=8);for(g=g<<c|y,U+=c;U>0;r[a+X]=g&255,X+=S,g/=256,U-=8);r[a+X-S]|=Z*128}});var Rg=at($i=>{"use strict";var uu=ug(),qi=fg(),cg=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;$i.Buffer=Q;$i.SlowBuffer=kA;$i.INSPECT_MAX_BYTES=50;var Ts=2147483647;$i.kMaxLength=Ts;Q.TYPED_ARRAY_SUPPORT=wA();!Q.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function wA(){try{let r=new Uint8Array(1),n={foo:function(){return 42}};return Object.setPrototypeOf(n,Uint8Array.prototype),Object.setPrototypeOf(r,n),r.foo()===42}catch{return!1}}Object.defineProperty(Q.prototype,"parent",{enumerable:!0,get:function(){if(Q.isBuffer(this))return this.buffer}});Object.defineProperty(Q.prototype,"offset",{enumerable:!0,get:function(){if(Q.isBuffer(this))return this.byteOffset}});function pn(r){if(r>Ts)throw new RangeError('The value "'+r+'" is invalid for option "size"');let n=new Uint8Array(r);return Object.setPrototypeOf(n,Q.prototype),n}function Q(r,n,a){if(typeof r=="number"){if(typeof n=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return hu(r)}return gg(r,n,a)}Q.poolSize=8192;function gg(r,n,a){if(typeof r=="string")return FA(r,n);if(ArrayBuffer.isView(r))return BA(r);if(r==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r);if(Kr(r,ArrayBuffer)||r&&Kr(r.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Kr(r,SharedArrayBuffer)||r&&Kr(r.buffer,SharedArrayBuffer)))return cu(r,n,a);if(typeof r=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let l=r.valueOf&&r.valueOf();if(l!=null&&l!==r)return Q.from(l,n,a);let c=UA(r);if(c)return c;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof r[Symbol.toPrimitive]=="function")return Q.from(r[Symbol.toPrimitive]("string"),n,a);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r)}Q.from=function(r,n,a){return gg(r,n,a)};Object.setPrototypeOf(Q.prototype,Uint8Array.prototype);Object.setPrototypeOf(Q,Uint8Array);function mg(r){if(typeof r!="number")throw new TypeError('"size" argument must be of type number');if(r<0)throw new RangeError('The value "'+r+'" is invalid for option "size"')}function LA(r,n,a){return mg(r),r<=0?pn(r):n!==void 0?typeof a=="string"?pn(r).fill(n,a):pn(r).fill(n):pn(r)}Q.alloc=function(r,n,a){return LA(r,n,a)};function hu(r){return mg(r),pn(r<0?0:pu(r)|0)}Q.allocUnsafe=function(r){return hu(r)};Q.allocUnsafeSlow=function(r){return hu(r)};function FA(r,n){if((typeof n!="string"||n==="")&&(n="utf8"),!Q.isEncoding(n))throw new TypeError("Unknown encoding: "+n);let a=bg(r,n)|0,l=pn(a),c=l.write(r,n);return c!==a&&(l=l.slice(0,c)),l}function fu(r){let n=r.length<0?0:pu(r.length)|0,a=pn(n);for(let l=0;l<n;l+=1)a[l]=r[l]&255;return a}function BA(r){if(Kr(r,Uint8Array)){let n=new Uint8Array(r);return cu(n.buffer,n.byteOffset,n.byteLength)}return fu(r)}function cu(r,n,a){if(n<0||r.byteLength<n)throw new RangeError('"offset" is outside of buffer bounds');if(r.byteLength<n+(a||0))throw new RangeError('"length" is outside of buffer bounds');let l;return n===void 0&&a===void 0?l=new Uint8Array(r):a===void 0?l=new Uint8Array(r,n):l=new Uint8Array(r,n,a),Object.setPrototypeOf(l,Q.prototype),l}function UA(r){if(Q.isBuffer(r)){let n=pu(r.length)|0,a=pn(n);return a.length===0||r.copy(a,0,0,n),a}if(r.length!==void 0)return typeof r.length!="number"||mu(r.length)?pn(0):fu(r);if(r.type==="Buffer"&&Array.isArray(r.data))return fu(r.data)}function pu(r){if(r>=Ts)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Ts.toString(16)+" bytes");return r|0}function kA(r){return+r!=r&&(r=0),Q.alloc(+r)}Q.isBuffer=function(n){return n!=null&&n._isBuffer===!0&&n!==Q.prototype};Q.compare=function(n,a){if(Kr(n,Uint8Array)&&(n=Q.from(n,n.offset,n.byteLength)),Kr(a,Uint8Array)&&(a=Q.from(a,a.offset,a.byteLength)),!Q.isBuffer(n)||!Q.isBuffer(a))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(n===a)return 0;let l=n.length,c=a.length;for(let p=0,g=Math.min(l,c);p<g;++p)if(n[p]!==a[p]){l=n[p],c=a[p];break}return l<c?-1:c<l?1:0};Q.isEncoding=function(n){switch(String(n).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};Q.concat=function(n,a){if(!Array.isArray(n))throw new TypeError('"list" argument must be an Array of Buffers');if(n.length===0)return Q.alloc(0);let l;if(a===void 0)for(a=0,l=0;l<n.length;++l)a+=n[l].length;let c=Q.allocUnsafe(a),p=0;for(l=0;l<n.length;++l){let g=n[l];if(Kr(g,Uint8Array))p+g.length>c.length?(Q.isBuffer(g)||(g=Q.from(g)),g.copy(c,p)):Uint8Array.prototype.set.call(c,g,p);else if(Q.isBuffer(g))g.copy(c,p);else throw new TypeError('"list" argument must be an Array of Buffers');p+=g.length}return c};function bg(r,n){if(Q.isBuffer(r))return r.length;if(ArrayBuffer.isView(r)||Kr(r,ArrayBuffer))return r.byteLength;if(typeof r!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof r);let a=r.length,l=arguments.length>2&&arguments[2]===!0;if(!l&&a===0)return 0;let c=!1;for(;;)switch(n){case"ascii":case"latin1":case"binary":return a;case"utf8":case"utf-8":return du(r).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return a*2;case"hex":return a>>>1;case"base64":return _g(r).length;default:if(c)return l?-1:du(r).length;n=(""+n).toLowerCase(),c=!0}}Q.byteLength=bg;function MA(r,n,a){let l=!1;if((n===void 0||n<0)&&(n=0),n>this.length||((a===void 0||a>this.length)&&(a=this.length),a<=0)||(a>>>=0,n>>>=0,a<=n))return"";for(r||(r="utf8");;)switch(r){case"hex":return JA(this,n,a);case"utf8":case"utf-8":return yg(this,n,a);case"ascii":return PA(this,n,a);case"latin1":case"binary":return HA(this,n,a);case"base64":return VA(this,n,a);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return XA(this,n,a);default:if(l)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),l=!0}}Q.prototype._isBuffer=!0;function ii(r,n,a){let l=r[n];r[n]=r[a],r[a]=l}Q.prototype.swap16=function(){let n=this.length;if(n%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let a=0;a<n;a+=2)ii(this,a,a+1);return this};Q.prototype.swap32=function(){let n=this.length;if(n%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let a=0;a<n;a+=4)ii(this,a,a+3),ii(this,a+1,a+2);return this};Q.prototype.swap64=function(){let n=this.length;if(n%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let a=0;a<n;a+=8)ii(this,a,a+7),ii(this,a+1,a+6),ii(this,a+2,a+5),ii(this,a+3,a+4);return this};Q.prototype.toString=function(){let n=this.length;return n===0?"":arguments.length===0?yg(this,0,n):MA.apply(this,arguments)};Q.prototype.toLocaleString=Q.prototype.toString;Q.prototype.equals=function(n){if(!Q.isBuffer(n))throw new TypeError("Argument must be a Buffer");return this===n?!0:Q.compare(this,n)===0};Q.prototype.inspect=function(){let n="",a=$i.INSPECT_MAX_BYTES;return n=this.toString("hex",0,a).replace(/(.{2})/g,"$1 ").trim(),this.length>a&&(n+=" ... "),"<Buffer "+n+">"};cg&&(Q.prototype[cg]=Q.prototype.inspect);Q.prototype.compare=function(n,a,l,c,p){if(Kr(n,Uint8Array)&&(n=Q.from(n,n.offset,n.byteLength)),!Q.isBuffer(n))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof n);if(a===void 0&&(a=0),l===void 0&&(l=n?n.length:0),c===void 0&&(c=0),p===void 0&&(p=this.length),a<0||l>n.length||c<0||p>this.length)throw new RangeError("out of range index");if(c>=p&&a>=l)return 0;if(c>=p)return-1;if(a>=l)return 1;if(a>>>=0,l>>>=0,c>>>=0,p>>>=0,this===n)return 0;let g=p-c,y=l-a,T=Math.min(g,y),U=this.slice(c,p),A=n.slice(a,l);for(let F=0;F<T;++F)if(U[F]!==A[F]){g=U[F],y=A[F];break}return g<y?-1:y<g?1:0};function vg(r,n,a,l,c){if(r.length===0)return-1;if(typeof a=="string"?(l=a,a=0):a>2147483647?a=2147483647:a<-2147483648&&(a=-2147483648),a=+a,mu(a)&&(a=c?0:r.length-1),a<0&&(a=r.length+a),a>=r.length){if(c)return-1;a=r.length-1}else if(a<0)if(c)a=0;else return-1;if(typeof n=="string"&&(n=Q.from(n,l)),Q.isBuffer(n))return n.length===0?-1:dg(r,n,a,l,c);if(typeof n=="number")return n=n&255,typeof Uint8Array.prototype.indexOf=="function"?c?Uint8Array.prototype.indexOf.call(r,n,a):Uint8Array.prototype.lastIndexOf.call(r,n,a):dg(r,[n],a,l,c);throw new TypeError("val must be string, number or Buffer")}function dg(r,n,a,l,c){let p=1,g=r.length,y=n.length;if(l!==void 0&&(l=String(l).toLowerCase(),l==="ucs2"||l==="ucs-2"||l==="utf16le"||l==="utf-16le")){if(r.length<2||n.length<2)return-1;p=2,g/=2,y/=2,a/=2}function T(A,F){return p===1?A[F]:A.readUInt16BE(F*p)}let U;if(c){let A=-1;for(U=a;U<g;U++)if(T(r,U)===T(n,A===-1?0:U-A)){if(A===-1&&(A=U),U-A+1===y)return A*p}else A!==-1&&(U-=U-A),A=-1}else for(a+y>g&&(a=g-y),U=a;U>=0;U--){let A=!0;for(let F=0;F<y;F++)if(T(r,U+F)!==T(n,F)){A=!1;break}if(A)return U}return-1}Q.prototype.includes=function(n,a,l){return this.indexOf(n,a,l)!==-1};Q.prototype.indexOf=function(n,a,l){return vg(this,n,a,l,!0)};Q.prototype.lastIndexOf=function(n,a,l){return vg(this,n,a,l,!1)};function GA(r,n,a,l){a=Number(a)||0;let c=r.length-a;l?(l=Number(l),l>c&&(l=c)):l=c;let p=n.length;l>p/2&&(l=p/2);let g;for(g=0;g<l;++g){let y=parseInt(n.substr(g*2,2),16);if(mu(y))return g;r[a+g]=y}return g}function OA(r,n,a,l){return Is(du(n,r.length-a),r,a,l)}function WA(r,n,a,l){return Is(qA(n),r,a,l)}function DA(r,n,a,l){return Is(_g(n),r,a,l)}function ZA(r,n,a,l){return Is(KA(n,r.length-a),r,a,l)}Q.prototype.write=function(n,a,l,c){if(a===void 0)c="utf8",l=this.length,a=0;else if(l===void 0&&typeof a=="string")c=a,l=this.length,a=0;else if(isFinite(a))a=a>>>0,isFinite(l)?(l=l>>>0,c===void 0&&(c="utf8")):(c=l,l=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let p=this.length-a;if((l===void 0||l>p)&&(l=p),n.length>0&&(l<0||a<0)||a>this.length)throw new RangeError("Attempt to write outside buffer bounds");c||(c="utf8");let g=!1;for(;;)switch(c){case"hex":return GA(this,n,a,l);case"utf8":case"utf-8":return OA(this,n,a,l);case"ascii":case"latin1":case"binary":return WA(this,n,a,l);case"base64":return DA(this,n,a,l);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ZA(this,n,a,l);default:if(g)throw new TypeError("Unknown encoding: "+c);c=(""+c).toLowerCase(),g=!0}};Q.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function VA(r,n,a){return n===0&&a===r.length?uu.fromByteArray(r):uu.fromByteArray(r.slice(n,a))}function yg(r,n,a){a=Math.min(r.length,a);let l=[],c=n;for(;c<a;){let p=r[c],g=null,y=p>239?4:p>223?3:p>191?2:1;if(c+y<=a){let T,U,A,F;switch(y){case 1:p<128&&(g=p);break;case 2:T=r[c+1],(T&192)===128&&(F=(p&31)<<6|T&63,F>127&&(g=F));break;case 3:T=r[c+1],U=r[c+2],(T&192)===128&&(U&192)===128&&(F=(p&15)<<12|(T&63)<<6|U&63,F>2047&&(F<55296||F>57343)&&(g=F));break;case 4:T=r[c+1],U=r[c+2],A=r[c+3],(T&192)===128&&(U&192)===128&&(A&192)===128&&(F=(p&15)<<18|(T&63)<<12|(U&63)<<6|A&63,F>65535&&F<1114112&&(g=F))}}g===null?(g=65533,y=1):g>65535&&(g-=65536,l.push(g>>>10&1023|55296),g=56320|g&1023),l.push(g),c+=y}return QA(l)}var hg=4096;function QA(r){let n=r.length;if(n<=hg)return String.fromCharCode.apply(String,r);let a="",l=0;for(;l<n;)a+=String.fromCharCode.apply(String,r.slice(l,l+=hg));return a}function PA(r,n,a){let l="";a=Math.min(r.length,a);for(let c=n;c<a;++c)l+=String.fromCharCode(r[c]&127);return l}function HA(r,n,a){let l="";a=Math.min(r.length,a);for(let c=n;c<a;++c)l+=String.fromCharCode(r[c]);return l}function JA(r,n,a){let l=r.length;(!n||n<0)&&(n=0),(!a||a<0||a>l)&&(a=l);let c="";for(let p=n;p<a;++p)c+=$A[r[p]];return c}function XA(r,n,a){let l=r.slice(n,a),c="";for(let p=0;p<l.length-1;p+=2)c+=String.fromCharCode(l[p]+l[p+1]*256);return c}Q.prototype.slice=function(n,a){let l=this.length;n=~~n,a=a===void 0?l:~~a,n<0?(n+=l,n<0&&(n=0)):n>l&&(n=l),a<0?(a+=l,a<0&&(a=0)):a>l&&(a=l),a<n&&(a=n);let c=this.subarray(n,a);return Object.setPrototypeOf(c,Q.prototype),c};function Wt(r,n,a){if(r%1!==0||r<0)throw new RangeError("offset is not uint");if(r+n>a)throw new RangeError("Trying to access beyond buffer length")}Q.prototype.readUintLE=Q.prototype.readUIntLE=function(n,a,l){n=n>>>0,a=a>>>0,l||Wt(n,a,this.length);let c=this[n],p=1,g=0;for(;++g<a&&(p*=256);)c+=this[n+g]*p;return c};Q.prototype.readUintBE=Q.prototype.readUIntBE=function(n,a,l){n=n>>>0,a=a>>>0,l||Wt(n,a,this.length);let c=this[n+--a],p=1;for(;a>0&&(p*=256);)c+=this[n+--a]*p;return c};Q.prototype.readUint8=Q.prototype.readUInt8=function(n,a){return n=n>>>0,a||Wt(n,1,this.length),this[n]};Q.prototype.readUint16LE=Q.prototype.readUInt16LE=function(n,a){return n=n>>>0,a||Wt(n,2,this.length),this[n]|this[n+1]<<8};Q.prototype.readUint16BE=Q.prototype.readUInt16BE=function(n,a){return n=n>>>0,a||Wt(n,2,this.length),this[n]<<8|this[n+1]};Q.prototype.readUint32LE=Q.prototype.readUInt32LE=function(n,a){return n=n>>>0,a||Wt(n,4,this.length),(this[n]|this[n+1]<<8|this[n+2]<<16)+this[n+3]*16777216};Q.prototype.readUint32BE=Q.prototype.readUInt32BE=function(n,a){return n=n>>>0,a||Wt(n,4,this.length),this[n]*16777216+(this[n+1]<<16|this[n+2]<<8|this[n+3])};Q.prototype.readBigUInt64LE=Dn(function(n){n=n>>>0,Ki(n,"offset");let a=this[n],l=this[n+7];(a===void 0||l===void 0)&&Yo(n,this.length-8);let c=a+this[++n]*2**8+this[++n]*2**16+this[++n]*2**24,p=this[++n]+this[++n]*2**8+this[++n]*2**16+l*2**24;return BigInt(c)+(BigInt(p)<<BigInt(32))});Q.prototype.readBigUInt64BE=Dn(function(n){n=n>>>0,Ki(n,"offset");let a=this[n],l=this[n+7];(a===void 0||l===void 0)&&Yo(n,this.length-8);let c=a*2**24+this[++n]*2**16+this[++n]*2**8+this[++n],p=this[++n]*2**24+this[++n]*2**16+this[++n]*2**8+l;return(BigInt(c)<<BigInt(32))+BigInt(p)});Q.prototype.readIntLE=function(n,a,l){n=n>>>0,a=a>>>0,l||Wt(n,a,this.length);let c=this[n],p=1,g=0;for(;++g<a&&(p*=256);)c+=this[n+g]*p;return p*=128,c>=p&&(c-=Math.pow(2,8*a)),c};Q.prototype.readIntBE=function(n,a,l){n=n>>>0,a=a>>>0,l||Wt(n,a,this.length);let c=a,p=1,g=this[n+--c];for(;c>0&&(p*=256);)g+=this[n+--c]*p;return p*=128,g>=p&&(g-=Math.pow(2,8*a)),g};Q.prototype.readInt8=function(n,a){return n=n>>>0,a||Wt(n,1,this.length),this[n]&128?(255-this[n]+1)*-1:this[n]};Q.prototype.readInt16LE=function(n,a){n=n>>>0,a||Wt(n,2,this.length);let l=this[n]|this[n+1]<<8;return l&32768?l|4294901760:l};Q.prototype.readInt16BE=function(n,a){n=n>>>0,a||Wt(n,2,this.length);let l=this[n+1]|this[n]<<8;return l&32768?l|4294901760:l};Q.prototype.readInt32LE=function(n,a){return n=n>>>0,a||Wt(n,4,this.length),this[n]|this[n+1]<<8|this[n+2]<<16|this[n+3]<<24};Q.prototype.readInt32BE=function(n,a){return n=n>>>0,a||Wt(n,4,this.length),this[n]<<24|this[n+1]<<16|this[n+2]<<8|this[n+3]};Q.prototype.readBigInt64LE=Dn(function(n){n=n>>>0,Ki(n,"offset");let a=this[n],l=this[n+7];(a===void 0||l===void 0)&&Yo(n,this.length-8);let c=this[n+4]+this[n+5]*2**8+this[n+6]*2**16+(l<<24);return(BigInt(c)<<BigInt(32))+BigInt(a+this[++n]*2**8+this[++n]*2**16+this[++n]*2**24)});Q.prototype.readBigInt64BE=Dn(function(n){n=n>>>0,Ki(n,"offset");let a=this[n],l=this[n+7];(a===void 0||l===void 0)&&Yo(n,this.length-8);let c=(a<<24)+this[++n]*2**16+this[++n]*2**8+this[++n];return(BigInt(c)<<BigInt(32))+BigInt(this[++n]*2**24+this[++n]*2**16+this[++n]*2**8+l)});Q.prototype.readFloatLE=function(n,a){return n=n>>>0,a||Wt(n,4,this.length),qi.read(this,n,!0,23,4)};Q.prototype.readFloatBE=function(n,a){return n=n>>>0,a||Wt(n,4,this.length),qi.read(this,n,!1,23,4)};Q.prototype.readDoubleLE=function(n,a){return n=n>>>0,a||Wt(n,8,this.length),qi.read(this,n,!0,52,8)};Q.prototype.readDoubleBE=function(n,a){return n=n>>>0,a||Wt(n,8,this.length),qi.read(this,n,!1,52,8)};function pr(r,n,a,l,c,p){if(!Q.isBuffer(r))throw new TypeError('"buffer" argument must be a Buffer instance');if(n>c||n<p)throw new RangeError('"value" argument is out of bounds');if(a+l>r.length)throw new RangeError("Index out of range")}Q.prototype.writeUintLE=Q.prototype.writeUIntLE=function(n,a,l,c){if(n=+n,a=a>>>0,l=l>>>0,!c){let y=Math.pow(2,8*l)-1;pr(this,n,a,l,y,0)}let p=1,g=0;for(this[a]=n&255;++g<l&&(p*=256);)this[a+g]=n/p&255;return a+l};Q.prototype.writeUintBE=Q.prototype.writeUIntBE=function(n,a,l,c){if(n=+n,a=a>>>0,l=l>>>0,!c){let y=Math.pow(2,8*l)-1;pr(this,n,a,l,y,0)}let p=l-1,g=1;for(this[a+p]=n&255;--p>=0&&(g*=256);)this[a+p]=n/g&255;return a+l};Q.prototype.writeUint8=Q.prototype.writeUInt8=function(n,a,l){return n=+n,a=a>>>0,l||pr(this,n,a,1,255,0),this[a]=n&255,a+1};Q.prototype.writeUint16LE=Q.prototype.writeUInt16LE=function(n,a,l){return n=+n,a=a>>>0,l||pr(this,n,a,2,65535,0),this[a]=n&255,this[a+1]=n>>>8,a+2};Q.prototype.writeUint16BE=Q.prototype.writeUInt16BE=function(n,a,l){return n=+n,a=a>>>0,l||pr(this,n,a,2,65535,0),this[a]=n>>>8,this[a+1]=n&255,a+2};Q.prototype.writeUint32LE=Q.prototype.writeUInt32LE=function(n,a,l){return n=+n,a=a>>>0,l||pr(this,n,a,4,4294967295,0),this[a+3]=n>>>24,this[a+2]=n>>>16,this[a+1]=n>>>8,this[a]=n&255,a+4};Q.prototype.writeUint32BE=Q.prototype.writeUInt32BE=function(n,a,l){return n=+n,a=a>>>0,l||pr(this,n,a,4,4294967295,0),this[a]=n>>>24,this[a+1]=n>>>16,this[a+2]=n>>>8,this[a+3]=n&255,a+4};function xg(r,n,a,l,c){Ag(n,l,c,r,a,7);let p=Number(n&BigInt(4294967295));r[a++]=p,p=p>>8,r[a++]=p,p=p>>8,r[a++]=p,p=p>>8,r[a++]=p;let g=Number(n>>BigInt(32)&BigInt(4294967295));return r[a++]=g,g=g>>8,r[a++]=g,g=g>>8,r[a++]=g,g=g>>8,r[a++]=g,a}function Tg(r,n,a,l,c){Ag(n,l,c,r,a,7);let p=Number(n&BigInt(4294967295));r[a+7]=p,p=p>>8,r[a+6]=p,p=p>>8,r[a+5]=p,p=p>>8,r[a+4]=p;let g=Number(n>>BigInt(32)&BigInt(4294967295));return r[a+3]=g,g=g>>8,r[a+2]=g,g=g>>8,r[a+1]=g,g=g>>8,r[a]=g,a+8}Q.prototype.writeBigUInt64LE=Dn(function(n,a=0){return xg(this,n,a,BigInt(0),BigInt("0xffffffffffffffff"))});Q.prototype.writeBigUInt64BE=Dn(function(n,a=0){return Tg(this,n,a,BigInt(0),BigInt("0xffffffffffffffff"))});Q.prototype.writeIntLE=function(n,a,l,c){if(n=+n,a=a>>>0,!c){let T=Math.pow(2,8*l-1);pr(this,n,a,l,T-1,-T)}let p=0,g=1,y=0;for(this[a]=n&255;++p<l&&(g*=256);)n<0&&y===0&&this[a+p-1]!==0&&(y=1),this[a+p]=(n/g>>0)-y&255;return a+l};Q.prototype.writeIntBE=function(n,a,l,c){if(n=+n,a=a>>>0,!c){let T=Math.pow(2,8*l-1);pr(this,n,a,l,T-1,-T)}let p=l-1,g=1,y=0;for(this[a+p]=n&255;--p>=0&&(g*=256);)n<0&&y===0&&this[a+p+1]!==0&&(y=1),this[a+p]=(n/g>>0)-y&255;return a+l};Q.prototype.writeInt8=function(n,a,l){return n=+n,a=a>>>0,l||pr(this,n,a,1,127,-128),n<0&&(n=255+n+1),this[a]=n&255,a+1};Q.prototype.writeInt16LE=function(n,a,l){return n=+n,a=a>>>0,l||pr(this,n,a,2,32767,-32768),this[a]=n&255,this[a+1]=n>>>8,a+2};Q.prototype.writeInt16BE=function(n,a,l){return n=+n,a=a>>>0,l||pr(this,n,a,2,32767,-32768),this[a]=n>>>8,this[a+1]=n&255,a+2};Q.prototype.writeInt32LE=function(n,a,l){return n=+n,a=a>>>0,l||pr(this,n,a,4,2147483647,-2147483648),this[a]=n&255,this[a+1]=n>>>8,this[a+2]=n>>>16,this[a+3]=n>>>24,a+4};Q.prototype.writeInt32BE=function(n,a,l){return n=+n,a=a>>>0,l||pr(this,n,a,4,2147483647,-2147483648),n<0&&(n=4294967295+n+1),this[a]=n>>>24,this[a+1]=n>>>16,this[a+2]=n>>>8,this[a+3]=n&255,a+4};Q.prototype.writeBigInt64LE=Dn(function(n,a=0){return xg(this,n,a,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});Q.prototype.writeBigInt64BE=Dn(function(n,a=0){return Tg(this,n,a,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Ig(r,n,a,l,c,p){if(a+l>r.length)throw new RangeError("Index out of range");if(a<0)throw new RangeError("Index out of range")}function Eg(r,n,a,l,c){return n=+n,a=a>>>0,c||Ig(r,n,a,4,34028234663852886e22,-34028234663852886e22),qi.write(r,n,a,l,23,4),a+4}Q.prototype.writeFloatLE=function(n,a,l){return Eg(this,n,a,!0,l)};Q.prototype.writeFloatBE=function(n,a,l){return Eg(this,n,a,!1,l)};function Cg(r,n,a,l,c){return n=+n,a=a>>>0,c||Ig(r,n,a,8,17976931348623157e292,-17976931348623157e292),qi.write(r,n,a,l,52,8),a+8}Q.prototype.writeDoubleLE=function(n,a,l){return Cg(this,n,a,!0,l)};Q.prototype.writeDoubleBE=function(n,a,l){return Cg(this,n,a,!1,l)};Q.prototype.copy=function(n,a,l,c){if(!Q.isBuffer(n))throw new TypeError("argument should be a Buffer");if(l||(l=0),!c&&c!==0&&(c=this.length),a>=n.length&&(a=n.length),a||(a=0),c>0&&c<l&&(c=l),c===l||n.length===0||this.length===0)return 0;if(a<0)throw new RangeError("targetStart out of bounds");if(l<0||l>=this.length)throw new RangeError("Index out of range");if(c<0)throw new RangeError("sourceEnd out of bounds");c>this.length&&(c=this.length),n.length-a<c-l&&(c=n.length-a+l);let p=c-l;return this===n&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(a,l,c):Uint8Array.prototype.set.call(n,this.subarray(l,c),a),p};Q.prototype.fill=function(n,a,l,c){if(typeof n=="string"){if(typeof a=="string"?(c=a,a=0,l=this.length):typeof l=="string"&&(c=l,l=this.length),c!==void 0&&typeof c!="string")throw new TypeError("encoding must be a string");if(typeof c=="string"&&!Q.isEncoding(c))throw new TypeError("Unknown encoding: "+c);if(n.length===1){let g=n.charCodeAt(0);(c==="utf8"&&g<128||c==="latin1")&&(n=g)}}else typeof n=="number"?n=n&255:typeof n=="boolean"&&(n=Number(n));if(a<0||this.length<a||this.length<l)throw new RangeError("Out of range index");if(l<=a)return this;a=a>>>0,l=l===void 0?this.length:l>>>0,n||(n=0);let p;if(typeof n=="number")for(p=a;p<l;++p)this[p]=n;else{let g=Q.isBuffer(n)?n:Q.from(n,c),y=g.length;if(y===0)throw new TypeError('The value "'+n+'" is invalid for argument "value"');for(p=0;p<l-a;++p)this[p+a]=g[p%y]}return this};var zi={};function gu(r,n,a){zi[r]=class extends a{constructor(){super(),Object.defineProperty(this,"message",{value:n.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${r}]`,this.stack,delete this.name}get code(){return r}set code(c){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:c,writable:!0})}toString(){return`${this.name} [${r}]: ${this.message}`}}}gu("ERR_BUFFER_OUT_OF_BOUNDS",function(r){return r?`${r} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError);gu("ERR_INVALID_ARG_TYPE",function(r,n){return`The "${r}" argument must be of type number. Received type ${typeof n}`},TypeError);gu("ERR_OUT_OF_RANGE",function(r,n,a){let l=`The value of "${r}" is out of range.`,c=a;return Number.isInteger(a)&&Math.abs(a)>2**32?c=pg(String(a)):typeof a=="bigint"&&(c=String(a),(a>BigInt(2)**BigInt(32)||a<-(BigInt(2)**BigInt(32)))&&(c=pg(c)),c+="n"),l+=` It must be ${n}. Received ${c}`,l},RangeError);function pg(r){let n="",a=r.length,l=r[0]==="-"?1:0;for(;a>=l+4;a-=3)n=`_${r.slice(a-3,a)}${n}`;return`${r.slice(0,a)}${n}`}function YA(r,n,a){Ki(n,"offset"),(r[n]===void 0||r[n+a]===void 0)&&Yo(n,r.length-(a+1))}function Ag(r,n,a,l,c,p){if(r>a||r<n){let g=typeof n=="bigint"?"n":"",y;throw p>3?n===0||n===BigInt(0)?y=`>= 0${g} and < 2${g} ** ${(p+1)*8}${g}`:y=`>= -(2${g} ** ${(p+1)*8-1}${g}) and < 2 ** ${(p+1)*8-1}${g}`:y=`>= ${n}${g} and <= ${a}${g}`,new zi.ERR_OUT_OF_RANGE("value",y,r)}YA(l,c,p)}function Ki(r,n){if(typeof r!="number")throw new zi.ERR_INVALID_ARG_TYPE(n,"number",r)}function Yo(r,n,a){throw Math.floor(r)!==r?(Ki(r,a),new zi.ERR_OUT_OF_RANGE(a||"offset","an integer",r)):n<0?new zi.ERR_BUFFER_OUT_OF_BOUNDS:new zi.ERR_OUT_OF_RANGE(a||"offset",`>= ${a?1:0} and <= ${n}`,r)}var jA=/[^+/0-9A-Za-z-_]/g;function zA(r){if(r=r.split("=")[0],r=r.trim().replace(jA,""),r.length<2)return"";for(;r.length%4!==0;)r=r+"=";return r}function du(r,n){n=n||1/0;let a,l=r.length,c=null,p=[];for(let g=0;g<l;++g){if(a=r.charCodeAt(g),a>55295&&a<57344){if(!c){if(a>56319){(n-=3)>-1&&p.push(239,191,189);continue}else if(g+1===l){(n-=3)>-1&&p.push(239,191,189);continue}c=a;continue}if(a<56320){(n-=3)>-1&&p.push(239,191,189),c=a;continue}a=(c-55296<<10|a-56320)+65536}else c&&(n-=3)>-1&&p.push(239,191,189);if(c=null,a<128){if((n-=1)<0)break;p.push(a)}else if(a<2048){if((n-=2)<0)break;p.push(a>>6|192,a&63|128)}else if(a<65536){if((n-=3)<0)break;p.push(a>>12|224,a>>6&63|128,a&63|128)}else if(a<1114112){if((n-=4)<0)break;p.push(a>>18|240,a>>12&63|128,a>>6&63|128,a&63|128)}else throw new Error("Invalid code point")}return p}function qA(r){let n=[];for(let a=0;a<r.length;++a)n.push(r.charCodeAt(a)&255);return n}function KA(r,n){let a,l,c,p=[];for(let g=0;g<r.length&&!((n-=2)<0);++g)a=r.charCodeAt(g),l=a>>8,c=a%256,p.push(c),p.push(l);return p}function _g(r){return uu.toByteArray(zA(r))}function Is(r,n,a,l){let c;for(c=0;c<l&&!(c+a>=n.length||c>=r.length);++c)n[c+a]=r[c];return c}function Kr(r,n){return r instanceof n||r!=null&&r.constructor!=null&&r.constructor.name!=null&&r.constructor.name===n.name}function mu(r){return r!==r}var $A=function(){let r="0123456789abcdef",n=new Array(256);for(let a=0;a<16;++a){let l=a*16;for(let c=0;c<16;++c)n[l+c]=r[a]+r[c]}return n}();function Dn(r){return typeof BigInt>"u"?e_:r}function e_(){throw new Error("BigInt not supported")}});var Wg=at((Cu,Au)=>{((r,n)=>{typeof define=="function"&&define.amd?define([],n):typeof Au=="object"&&typeof Cu<"u"?Au.exports=n():r.Papa=n()})(Cu,function r(){var n=typeof self<"u"?self:typeof window<"u"?window:n!==void 0?n:{},a,l=!n.document&&!!n.postMessage,c=n.IS_PAPA_WORKER||!1,p={},g=0,y={};function T(_){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},function(w){var P=q(w);P.chunkSize=parseInt(P.chunkSize),w.step||w.chunk||(P.chunkSize=null),this._handle=new X(P),(this._handle.streamer=this)._config=P}.call(this,_),this.parseChunk=function(w,P){var $=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&0<$){let k=this._config.newline;k||(pe=this._config.quoteChar||'"',k=this._handle.guessLineEndings(w,pe)),w=[...w.split(k).slice($)].join(k)}this.isFirstChunk&&ae(this._config.beforeFirstChunk)&&(pe=this._config.beforeFirstChunk(w))!==void 0&&(w=pe),this.isFirstChunk=!1,this._halted=!1;var $=this._partialLine+w,pe=(this._partialLine="",this._handle.parse($,this._baseIndex,!this._finished));if(!this._handle.paused()&&!this._handle.aborted()){if(w=pe.meta.cursor,$=(this._finished||(this._partialLine=$.substring(w-this._baseIndex),this._baseIndex=w),pe&&pe.data&&(this._rowCount+=pe.data.length),this._finished||this._config.preview&&this._rowCount>=this._config.preview),c)n.postMessage({results:pe,workerId:y.WORKER_ID,finished:$});else if(ae(this._config.chunk)&&!P){if(this._config.chunk(pe,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);this._completeResults=pe=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(pe.data),this._completeResults.errors=this._completeResults.errors.concat(pe.errors),this._completeResults.meta=pe.meta),this._completed||!$||!ae(this._config.complete)||pe&&pe.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),$||pe&&pe.meta.paused||this._nextChunk(),pe}this._halted=!0},this._sendError=function(w){ae(this._config.error)?this._config.error(w):c&&this._config.error&&n.postMessage({workerId:y.WORKER_ID,error:w,finished:!1})}}function U(_){var w;(_=_||{}).chunkSize||(_.chunkSize=y.RemoteChunkSize),T.call(this,_),this._nextChunk=l?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(P){this._input=P,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(w=new XMLHttpRequest,this._config.withCredentials&&(w.withCredentials=this._config.withCredentials),l||(w.onload=te(this._chunkLoaded,this),w.onerror=te(this._chunkError,this)),w.open(this._config.downloadRequestBody?"POST":"GET",this._input,!l),this._config.downloadRequestHeaders){var P,$=this._config.downloadRequestHeaders;for(P in $)w.setRequestHeader(P,$[P])}var pe;this._config.chunkSize&&(pe=this._start+this._config.chunkSize-1,w.setRequestHeader("Range","bytes="+this._start+"-"+pe));try{w.send(this._config.downloadRequestBody)}catch(k){this._chunkError(k.message)}l&&w.status===0&&this._chunkError()}},this._chunkLoaded=function(){w.readyState===4&&(w.status<200||400<=w.status?this._chunkError():(this._start+=this._config.chunkSize||w.responseText.length,this._finished=!this._config.chunkSize||this._start>=(P=>(P=P.getResponseHeader("Content-Range"))!==null?parseInt(P.substring(P.lastIndexOf("/")+1)):-1)(w),this.parseChunk(w.responseText)))},this._chunkError=function(P){P=w.statusText||P,this._sendError(new Error(P))}}function A(_){(_=_||{}).chunkSize||(_.chunkSize=y.LocalChunkSize),T.call(this,_);var w,P,$=typeof FileReader<"u";this.stream=function(pe){this._input=pe,P=pe.slice||pe.webkitSlice||pe.mozSlice,$?((w=new FileReader).onload=te(this._chunkLoaded,this),w.onerror=te(this._chunkError,this)):w=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var pe=this._input,k=(this._config.chunkSize&&(k=Math.min(this._start+this._config.chunkSize,this._input.size),pe=P.call(pe,this._start,k)),w.readAsText(pe,this._config.encoding));$||this._chunkLoaded({target:{result:k}})},this._chunkLoaded=function(pe){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(pe.target.result)},this._chunkError=function(){this._sendError(w.error)}}function F(_){var w;T.call(this,_=_||{}),this.stream=function(P){return w=P,this._nextChunk()},this._nextChunk=function(){var P,$;if(!this._finished)return P=this._config.chunkSize,w=P?($=w.substring(0,P),w.substring(P)):($=w,""),this._finished=!w,this.parseChunk($)}}function M(_){T.call(this,_=_||{});var w=[],P=!0,$=!1;this.pause=function(){T.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){T.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(pe){this._input=pe,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){$&&w.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),w.length?this.parseChunk(w.shift()):P=!0},this._streamData=te(function(pe){try{w.push(typeof pe=="string"?pe:pe.toString(this._config.encoding)),P&&(P=!1,this._checkIsFinished(),this.parseChunk(w.shift()))}catch(k){this._streamError(k)}},this),this._streamError=te(function(pe){this._streamCleanUp(),this._sendError(pe)},this),this._streamEnd=te(function(){this._streamCleanUp(),$=!0,this._streamData("")},this),this._streamCleanUp=te(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function X(_){var w,P,$,pe,k=Math.pow(2,53),oe=-k,x=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,ee=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/,D=this,ce=0,ge=0,Oe=!1,Re=!1,we=[],re={data:[],errors:[],meta:{}};function Ze(le){return _.skipEmptyLines==="greedy"?le.join("").trim()==="":le.length===1&&le[0].length===0}function Ce(){if(re&&$&&(se("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+y.DefaultDelimiter+"'"),$=!1),_.skipEmptyLines&&(re.data=re.data.filter(function(Fe){return!Ze(Fe)})),ve()){let Fe=function(Je,Me){ae(_.transformHeader)&&(Je=_.transformHeader(Je,Me)),we.push(Je)};var ue=Fe;if(re)if(Array.isArray(re.data[0])){for(var le=0;ve()&&le<re.data.length;le++)re.data[le].forEach(Fe);re.data.splice(0,1)}else re.data.forEach(Fe)}function ye(Fe,Je){for(var Me=_.header?{}:[],Le=0;Le<Fe.length;Le++){var _e=Le,De=Fe[Le],De=((Be,Ve)=>(Te=>(_.dynamicTypingFunction&&_.dynamicTyping[Te]===void 0&&(_.dynamicTyping[Te]=_.dynamicTypingFunction(Te)),(_.dynamicTyping[Te]||_.dynamicTyping)===!0))(Be)?Ve==="true"||Ve==="TRUE"||Ve!=="false"&&Ve!=="FALSE"&&((Te=>{if(x.test(Te)&&(Te=parseFloat(Te),oe<Te&&Te<k))return 1})(Ve)?parseFloat(Ve):ee.test(Ve)?new Date(Ve):Ve===""?null:Ve):Ve)(_e=_.header?Le>=we.length?"__parsed_extra":we[Le]:_e,De=_.transform?_.transform(De,_e):De);_e==="__parsed_extra"?(Me[_e]=Me[_e]||[],Me[_e].push(De)):Me[_e]=De}return _.header&&(Le>we.length?se("FieldMismatch","TooManyFields","Too many fields: expected "+we.length+" fields but parsed "+Le,ge+Je):Le<we.length&&se("FieldMismatch","TooFewFields","Too few fields: expected "+we.length+" fields but parsed "+Le,ge+Je)),Me}var Ge;re&&(_.header||_.dynamicTyping||_.transform)&&(Ge=1,!re.data.length||Array.isArray(re.data[0])?(re.data=re.data.map(ye),Ge=re.data.length):re.data=ye(re.data,0),_.header&&re.meta&&(re.meta.fields=we),ge+=Ge)}function ve(){return _.header&&we.length===0}function se(le,ye,Ge,ue){le={type:le,code:ye,message:Ge},ue!==void 0&&(le.row=ue),re.errors.push(le)}ae(_.step)&&(pe=_.step,_.step=function(le){re=le,ve()?Ce():(Ce(),re.data.length!==0&&(ce+=le.data.length,_.preview&&ce>_.preview?P.abort():(re.data=re.data[0],pe(re,D))))}),this.parse=function(le,ye,Ge){var ue=_.quoteChar||'"',ue=(_.newline||(_.newline=this.guessLineEndings(le,ue)),$=!1,_.delimiter?ae(_.delimiter)&&(_.delimiter=_.delimiter(le),re.meta.delimiter=_.delimiter):((ue=((Fe,Je,Me,Le,_e)=>{var De,Be,Ve,Te;_e=_e||[","," ","|",";",y.RECORD_SEP,y.UNIT_SEP];for(var It=0;It<_e.length;It++){for(var Et,mr=_e[It],lt=0,Qt=0,ze=0,Xe=(Ve=void 0,new Z({comments:Le,delimiter:mr,newline:Je,preview:10}).parse(Fe)),mt=0;mt<Xe.data.length;mt++)Me&&Ze(Xe.data[mt])?ze++:(Et=Xe.data[mt].length,Qt+=Et,Ve===void 0?Ve=Et:0<Et&&(lt+=Math.abs(Et-Ve),Ve=Et));0<Xe.data.length&&(Qt/=Xe.data.length-ze),(Be===void 0||lt<=Be)&&(Te===void 0||Te<Qt)&&1.99<Qt&&(Be=lt,De=mr,Te=Qt)}return{successful:!!(_.delimiter=De),bestDelimiter:De}})(le,_.newline,_.skipEmptyLines,_.comments,_.delimitersToGuess)).successful?_.delimiter=ue.bestDelimiter:($=!0,_.delimiter=y.DefaultDelimiter),re.meta.delimiter=_.delimiter),q(_));return _.preview&&_.header&&ue.preview++,w=le,P=new Z(ue),re=P.parse(w,ye,Ge),Ce(),Oe?{meta:{paused:!0}}:re||{meta:{paused:!1}}},this.paused=function(){return Oe},this.pause=function(){Oe=!0,P.abort(),w=ae(_.chunk)?"":w.substring(P.getCharIndex())},this.resume=function(){D.streamer._halted?(Oe=!1,D.streamer.parseChunk(w,!0)):setTimeout(D.resume,3)},this.aborted=function(){return Re},this.abort=function(){Re=!0,P.abort(),re.meta.aborted=!0,ae(_.complete)&&_.complete(re),w=""},this.guessLineEndings=function(Fe,ue){Fe=Fe.substring(0,1048576);var ue=new RegExp(S(ue)+"([^]*?)"+S(ue),"gm"),Ge=(Fe=Fe.replace(ue,"")).split("\r"),ue=Fe.split(`
7
+ `+g+"}":"{"+y.join(",")+"}",gap=g,c}}typeof JSON.stringify!="function"&&(meta={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},JSON.stringify=function(r,n,a){var l;if(gap="",indent="",typeof a=="number")for(l=0;l<a;l+=1)indent+=" ";else typeof a=="string"&&(indent=a);if(rep=n,n&&typeof n!="function"&&(typeof n!="object"||typeof n.length!="number"))throw new Error("JSON.stringify");return str("",{"":r})}),typeof JSON.parse!="function"&&(JSON.parse=function(text,reviver){var j;function walk(r,n){var a,l,c=r[n];if(c&&typeof c=="object")for(a in c)Object.prototype.hasOwnProperty.call(c,a)&&(l=walk(c,a),l!==void 0?c[a]=l:delete c[a]);return reviver.call(r,n,c)}if(text=String(text),rx_dangerous.lastIndex=0,rx_dangerous.test(text)&&(text=text.replace(rx_dangerous,function(r){return"\\u"+("0000"+r.charCodeAt(0).toString(16)).slice(-4)})),rx_one.test(text.replace(rx_two,"@").replace(rx_three,"]").replace(rx_four,"")))return j=eval("("+text+")"),typeof reviver=="function"?walk({"":j},""):j;throw new SyntaxError("JSON.parse")})})()});var ig=at((xk,ng)=>{ng.exports=vA;function vA(){return rg(),{}}});var ag=at((Tk,og)=>{var yA=Bp(),xA=tg(),TA=[ig()];og.exports=yA.createStore(xA,TA)});var ug=at(xs=>{"use strict";xs.byteLength=CA;xs.toByteArray=RA;xs.fromByteArray=SA;var qr=[],Nr=[],EA=typeof Uint8Array<"u"?Uint8Array:Array,su="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(ni=0,sg=su.length;ni<sg;++ni)qr[ni]=su[ni],Nr[su.charCodeAt(ni)]=ni;var ni,sg;Nr[45]=62;Nr[95]=63;function lg(r){var n=r.length;if(n%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var a=r.indexOf("=");a===-1&&(a=n);var l=a===n?0:4-a%4;return[a,l]}function CA(r){var n=lg(r),a=n[0],l=n[1];return(a+l)*3/4-l}function AA(r,n,a){return(n+a)*3/4-a}function RA(r){var n,a=lg(r),l=a[0],c=a[1],p=new EA(AA(r,l,c)),g=0,y=c>0?l-4:l,T;for(T=0;T<y;T+=4)n=Nr[r.charCodeAt(T)]<<18|Nr[r.charCodeAt(T+1)]<<12|Nr[r.charCodeAt(T+2)]<<6|Nr[r.charCodeAt(T+3)],p[g++]=n>>16&255,p[g++]=n>>8&255,p[g++]=n&255;return c===2&&(n=Nr[r.charCodeAt(T)]<<2|Nr[r.charCodeAt(T+1)]>>4,p[g++]=n&255),c===1&&(n=Nr[r.charCodeAt(T)]<<10|Nr[r.charCodeAt(T+1)]<<4|Nr[r.charCodeAt(T+2)]>>2,p[g++]=n>>8&255,p[g++]=n&255),p}function _A(r){return qr[r>>18&63]+qr[r>>12&63]+qr[r>>6&63]+qr[r&63]}function NA(r,n,a){for(var l,c=[],p=n;p<a;p+=3)l=(r[p]<<16&16711680)+(r[p+1]<<8&65280)+(r[p+2]&255),c.push(_A(l));return c.join("")}function SA(r){for(var n,a=r.length,l=a%3,c=[],p=16383,g=0,y=a-l;g<y;g+=p)c.push(NA(r,g,g+p>y?y:g+p));return l===1?(n=r[a-1],c.push(qr[n>>2]+qr[n<<4&63]+"==")):l===2&&(n=(r[a-2]<<8)+r[a-1],c.push(qr[n>>10]+qr[n>>4&63]+qr[n<<2&63]+"=")),c.join("")}});var fg=at(lu=>{lu.read=function(r,n,a,l,c){var p,g,y=c*8-l-1,T=(1<<y)-1,U=T>>1,A=-7,F=a?c-1:0,M=a?-1:1,X=r[n+F];for(F+=M,p=X&(1<<-A)-1,X>>=-A,A+=y;A>0;p=p*256+r[n+F],F+=M,A-=8);for(g=p&(1<<-A)-1,p>>=-A,A+=l;A>0;g=g*256+r[n+F],F+=M,A-=8);if(p===0)p=1-U;else{if(p===T)return g?NaN:(X?-1:1)*(1/0);g=g+Math.pow(2,l),p=p-U}return(X?-1:1)*g*Math.pow(2,p-l)};lu.write=function(r,n,a,l,c,p){var g,y,T,U=p*8-c-1,A=(1<<U)-1,F=A>>1,M=c===23?Math.pow(2,-24)-Math.pow(2,-77):0,X=l?0:p-1,S=l?1:-1,Z=n<0||n===0&&1/n<0?1:0;for(n=Math.abs(n),isNaN(n)||n===1/0?(y=isNaN(n)?1:0,g=A):(g=Math.floor(Math.log(n)/Math.LN2),n*(T=Math.pow(2,-g))<1&&(g--,T*=2),g+F>=1?n+=M/T:n+=M*Math.pow(2,1-F),n*T>=2&&(g++,T/=2),g+F>=A?(y=0,g=A):g+F>=1?(y=(n*T-1)*Math.pow(2,c),g=g+F):(y=n*Math.pow(2,F-1)*Math.pow(2,c),g=0));c>=8;r[a+X]=y&255,X+=S,y/=256,c-=8);for(g=g<<c|y,U+=c;U>0;r[a+X]=g&255,X+=S,g/=256,U-=8);r[a+X-S]|=Z*128}});var _g=at($i=>{"use strict";var uu=ug(),qi=fg(),cg=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;$i.Buffer=Q;$i.SlowBuffer=kA;$i.INSPECT_MAX_BYTES=50;var Ts=2147483647;$i.kMaxLength=Ts;Q.TYPED_ARRAY_SUPPORT=wA();!Q.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function wA(){try{let r=new Uint8Array(1),n={foo:function(){return 42}};return Object.setPrototypeOf(n,Uint8Array.prototype),Object.setPrototypeOf(r,n),r.foo()===42}catch{return!1}}Object.defineProperty(Q.prototype,"parent",{enumerable:!0,get:function(){if(Q.isBuffer(this))return this.buffer}});Object.defineProperty(Q.prototype,"offset",{enumerable:!0,get:function(){if(Q.isBuffer(this))return this.byteOffset}});function pn(r){if(r>Ts)throw new RangeError('The value "'+r+'" is invalid for option "size"');let n=new Uint8Array(r);return Object.setPrototypeOf(n,Q.prototype),n}function Q(r,n,a){if(typeof r=="number"){if(typeof n=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return hu(r)}return gg(r,n,a)}Q.poolSize=8192;function gg(r,n,a){if(typeof r=="string")return FA(r,n);if(ArrayBuffer.isView(r))return BA(r);if(r==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r);if(Kr(r,ArrayBuffer)||r&&Kr(r.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Kr(r,SharedArrayBuffer)||r&&Kr(r.buffer,SharedArrayBuffer)))return cu(r,n,a);if(typeof r=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let l=r.valueOf&&r.valueOf();if(l!=null&&l!==r)return Q.from(l,n,a);let c=UA(r);if(c)return c;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof r[Symbol.toPrimitive]=="function")return Q.from(r[Symbol.toPrimitive]("string"),n,a);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r)}Q.from=function(r,n,a){return gg(r,n,a)};Object.setPrototypeOf(Q.prototype,Uint8Array.prototype);Object.setPrototypeOf(Q,Uint8Array);function mg(r){if(typeof r!="number")throw new TypeError('"size" argument must be of type number');if(r<0)throw new RangeError('The value "'+r+'" is invalid for option "size"')}function LA(r,n,a){return mg(r),r<=0?pn(r):n!==void 0?typeof a=="string"?pn(r).fill(n,a):pn(r).fill(n):pn(r)}Q.alloc=function(r,n,a){return LA(r,n,a)};function hu(r){return mg(r),pn(r<0?0:pu(r)|0)}Q.allocUnsafe=function(r){return hu(r)};Q.allocUnsafeSlow=function(r){return hu(r)};function FA(r,n){if((typeof n!="string"||n==="")&&(n="utf8"),!Q.isEncoding(n))throw new TypeError("Unknown encoding: "+n);let a=bg(r,n)|0,l=pn(a),c=l.write(r,n);return c!==a&&(l=l.slice(0,c)),l}function fu(r){let n=r.length<0?0:pu(r.length)|0,a=pn(n);for(let l=0;l<n;l+=1)a[l]=r[l]&255;return a}function BA(r){if(Kr(r,Uint8Array)){let n=new Uint8Array(r);return cu(n.buffer,n.byteOffset,n.byteLength)}return fu(r)}function cu(r,n,a){if(n<0||r.byteLength<n)throw new RangeError('"offset" is outside of buffer bounds');if(r.byteLength<n+(a||0))throw new RangeError('"length" is outside of buffer bounds');let l;return n===void 0&&a===void 0?l=new Uint8Array(r):a===void 0?l=new Uint8Array(r,n):l=new Uint8Array(r,n,a),Object.setPrototypeOf(l,Q.prototype),l}function UA(r){if(Q.isBuffer(r)){let n=pu(r.length)|0,a=pn(n);return a.length===0||r.copy(a,0,0,n),a}if(r.length!==void 0)return typeof r.length!="number"||mu(r.length)?pn(0):fu(r);if(r.type==="Buffer"&&Array.isArray(r.data))return fu(r.data)}function pu(r){if(r>=Ts)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Ts.toString(16)+" bytes");return r|0}function kA(r){return+r!=r&&(r=0),Q.alloc(+r)}Q.isBuffer=function(n){return n!=null&&n._isBuffer===!0&&n!==Q.prototype};Q.compare=function(n,a){if(Kr(n,Uint8Array)&&(n=Q.from(n,n.offset,n.byteLength)),Kr(a,Uint8Array)&&(a=Q.from(a,a.offset,a.byteLength)),!Q.isBuffer(n)||!Q.isBuffer(a))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(n===a)return 0;let l=n.length,c=a.length;for(let p=0,g=Math.min(l,c);p<g;++p)if(n[p]!==a[p]){l=n[p],c=a[p];break}return l<c?-1:c<l?1:0};Q.isEncoding=function(n){switch(String(n).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};Q.concat=function(n,a){if(!Array.isArray(n))throw new TypeError('"list" argument must be an Array of Buffers');if(n.length===0)return Q.alloc(0);let l;if(a===void 0)for(a=0,l=0;l<n.length;++l)a+=n[l].length;let c=Q.allocUnsafe(a),p=0;for(l=0;l<n.length;++l){let g=n[l];if(Kr(g,Uint8Array))p+g.length>c.length?(Q.isBuffer(g)||(g=Q.from(g)),g.copy(c,p)):Uint8Array.prototype.set.call(c,g,p);else if(Q.isBuffer(g))g.copy(c,p);else throw new TypeError('"list" argument must be an Array of Buffers');p+=g.length}return c};function bg(r,n){if(Q.isBuffer(r))return r.length;if(ArrayBuffer.isView(r)||Kr(r,ArrayBuffer))return r.byteLength;if(typeof r!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof r);let a=r.length,l=arguments.length>2&&arguments[2]===!0;if(!l&&a===0)return 0;let c=!1;for(;;)switch(n){case"ascii":case"latin1":case"binary":return a;case"utf8":case"utf-8":return du(r).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return a*2;case"hex":return a>>>1;case"base64":return Rg(r).length;default:if(c)return l?-1:du(r).length;n=(""+n).toLowerCase(),c=!0}}Q.byteLength=bg;function MA(r,n,a){let l=!1;if((n===void 0||n<0)&&(n=0),n>this.length||((a===void 0||a>this.length)&&(a=this.length),a<=0)||(a>>>=0,n>>>=0,a<=n))return"";for(r||(r="utf8");;)switch(r){case"hex":return JA(this,n,a);case"utf8":case"utf-8":return yg(this,n,a);case"ascii":return PA(this,n,a);case"latin1":case"binary":return HA(this,n,a);case"base64":return VA(this,n,a);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return XA(this,n,a);default:if(l)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),l=!0}}Q.prototype._isBuffer=!0;function ii(r,n,a){let l=r[n];r[n]=r[a],r[a]=l}Q.prototype.swap16=function(){let n=this.length;if(n%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let a=0;a<n;a+=2)ii(this,a,a+1);return this};Q.prototype.swap32=function(){let n=this.length;if(n%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let a=0;a<n;a+=4)ii(this,a,a+3),ii(this,a+1,a+2);return this};Q.prototype.swap64=function(){let n=this.length;if(n%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let a=0;a<n;a+=8)ii(this,a,a+7),ii(this,a+1,a+6),ii(this,a+2,a+5),ii(this,a+3,a+4);return this};Q.prototype.toString=function(){let n=this.length;return n===0?"":arguments.length===0?yg(this,0,n):MA.apply(this,arguments)};Q.prototype.toLocaleString=Q.prototype.toString;Q.prototype.equals=function(n){if(!Q.isBuffer(n))throw new TypeError("Argument must be a Buffer");return this===n?!0:Q.compare(this,n)===0};Q.prototype.inspect=function(){let n="",a=$i.INSPECT_MAX_BYTES;return n=this.toString("hex",0,a).replace(/(.{2})/g,"$1 ").trim(),this.length>a&&(n+=" ... "),"<Buffer "+n+">"};cg&&(Q.prototype[cg]=Q.prototype.inspect);Q.prototype.compare=function(n,a,l,c,p){if(Kr(n,Uint8Array)&&(n=Q.from(n,n.offset,n.byteLength)),!Q.isBuffer(n))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof n);if(a===void 0&&(a=0),l===void 0&&(l=n?n.length:0),c===void 0&&(c=0),p===void 0&&(p=this.length),a<0||l>n.length||c<0||p>this.length)throw new RangeError("out of range index");if(c>=p&&a>=l)return 0;if(c>=p)return-1;if(a>=l)return 1;if(a>>>=0,l>>>=0,c>>>=0,p>>>=0,this===n)return 0;let g=p-c,y=l-a,T=Math.min(g,y),U=this.slice(c,p),A=n.slice(a,l);for(let F=0;F<T;++F)if(U[F]!==A[F]){g=U[F],y=A[F];break}return g<y?-1:y<g?1:0};function vg(r,n,a,l,c){if(r.length===0)return-1;if(typeof a=="string"?(l=a,a=0):a>2147483647?a=2147483647:a<-2147483648&&(a=-2147483648),a=+a,mu(a)&&(a=c?0:r.length-1),a<0&&(a=r.length+a),a>=r.length){if(c)return-1;a=r.length-1}else if(a<0)if(c)a=0;else return-1;if(typeof n=="string"&&(n=Q.from(n,l)),Q.isBuffer(n))return n.length===0?-1:dg(r,n,a,l,c);if(typeof n=="number")return n=n&255,typeof Uint8Array.prototype.indexOf=="function"?c?Uint8Array.prototype.indexOf.call(r,n,a):Uint8Array.prototype.lastIndexOf.call(r,n,a):dg(r,[n],a,l,c);throw new TypeError("val must be string, number or Buffer")}function dg(r,n,a,l,c){let p=1,g=r.length,y=n.length;if(l!==void 0&&(l=String(l).toLowerCase(),l==="ucs2"||l==="ucs-2"||l==="utf16le"||l==="utf-16le")){if(r.length<2||n.length<2)return-1;p=2,g/=2,y/=2,a/=2}function T(A,F){return p===1?A[F]:A.readUInt16BE(F*p)}let U;if(c){let A=-1;for(U=a;U<g;U++)if(T(r,U)===T(n,A===-1?0:U-A)){if(A===-1&&(A=U),U-A+1===y)return A*p}else A!==-1&&(U-=U-A),A=-1}else for(a+y>g&&(a=g-y),U=a;U>=0;U--){let A=!0;for(let F=0;F<y;F++)if(T(r,U+F)!==T(n,F)){A=!1;break}if(A)return U}return-1}Q.prototype.includes=function(n,a,l){return this.indexOf(n,a,l)!==-1};Q.prototype.indexOf=function(n,a,l){return vg(this,n,a,l,!0)};Q.prototype.lastIndexOf=function(n,a,l){return vg(this,n,a,l,!1)};function GA(r,n,a,l){a=Number(a)||0;let c=r.length-a;l?(l=Number(l),l>c&&(l=c)):l=c;let p=n.length;l>p/2&&(l=p/2);let g;for(g=0;g<l;++g){let y=parseInt(n.substr(g*2,2),16);if(mu(y))return g;r[a+g]=y}return g}function OA(r,n,a,l){return Is(du(n,r.length-a),r,a,l)}function WA(r,n,a,l){return Is(qA(n),r,a,l)}function DA(r,n,a,l){return Is(Rg(n),r,a,l)}function ZA(r,n,a,l){return Is(KA(n,r.length-a),r,a,l)}Q.prototype.write=function(n,a,l,c){if(a===void 0)c="utf8",l=this.length,a=0;else if(l===void 0&&typeof a=="string")c=a,l=this.length,a=0;else if(isFinite(a))a=a>>>0,isFinite(l)?(l=l>>>0,c===void 0&&(c="utf8")):(c=l,l=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let p=this.length-a;if((l===void 0||l>p)&&(l=p),n.length>0&&(l<0||a<0)||a>this.length)throw new RangeError("Attempt to write outside buffer bounds");c||(c="utf8");let g=!1;for(;;)switch(c){case"hex":return GA(this,n,a,l);case"utf8":case"utf-8":return OA(this,n,a,l);case"ascii":case"latin1":case"binary":return WA(this,n,a,l);case"base64":return DA(this,n,a,l);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ZA(this,n,a,l);default:if(g)throw new TypeError("Unknown encoding: "+c);c=(""+c).toLowerCase(),g=!0}};Q.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function VA(r,n,a){return n===0&&a===r.length?uu.fromByteArray(r):uu.fromByteArray(r.slice(n,a))}function yg(r,n,a){a=Math.min(r.length,a);let l=[],c=n;for(;c<a;){let p=r[c],g=null,y=p>239?4:p>223?3:p>191?2:1;if(c+y<=a){let T,U,A,F;switch(y){case 1:p<128&&(g=p);break;case 2:T=r[c+1],(T&192)===128&&(F=(p&31)<<6|T&63,F>127&&(g=F));break;case 3:T=r[c+1],U=r[c+2],(T&192)===128&&(U&192)===128&&(F=(p&15)<<12|(T&63)<<6|U&63,F>2047&&(F<55296||F>57343)&&(g=F));break;case 4:T=r[c+1],U=r[c+2],A=r[c+3],(T&192)===128&&(U&192)===128&&(A&192)===128&&(F=(p&15)<<18|(T&63)<<12|(U&63)<<6|A&63,F>65535&&F<1114112&&(g=F))}}g===null?(g=65533,y=1):g>65535&&(g-=65536,l.push(g>>>10&1023|55296),g=56320|g&1023),l.push(g),c+=y}return QA(l)}var hg=4096;function QA(r){let n=r.length;if(n<=hg)return String.fromCharCode.apply(String,r);let a="",l=0;for(;l<n;)a+=String.fromCharCode.apply(String,r.slice(l,l+=hg));return a}function PA(r,n,a){let l="";a=Math.min(r.length,a);for(let c=n;c<a;++c)l+=String.fromCharCode(r[c]&127);return l}function HA(r,n,a){let l="";a=Math.min(r.length,a);for(let c=n;c<a;++c)l+=String.fromCharCode(r[c]);return l}function JA(r,n,a){let l=r.length;(!n||n<0)&&(n=0),(!a||a<0||a>l)&&(a=l);let c="";for(let p=n;p<a;++p)c+=$A[r[p]];return c}function XA(r,n,a){let l=r.slice(n,a),c="";for(let p=0;p<l.length-1;p+=2)c+=String.fromCharCode(l[p]+l[p+1]*256);return c}Q.prototype.slice=function(n,a){let l=this.length;n=~~n,a=a===void 0?l:~~a,n<0?(n+=l,n<0&&(n=0)):n>l&&(n=l),a<0?(a+=l,a<0&&(a=0)):a>l&&(a=l),a<n&&(a=n);let c=this.subarray(n,a);return Object.setPrototypeOf(c,Q.prototype),c};function Wt(r,n,a){if(r%1!==0||r<0)throw new RangeError("offset is not uint");if(r+n>a)throw new RangeError("Trying to access beyond buffer length")}Q.prototype.readUintLE=Q.prototype.readUIntLE=function(n,a,l){n=n>>>0,a=a>>>0,l||Wt(n,a,this.length);let c=this[n],p=1,g=0;for(;++g<a&&(p*=256);)c+=this[n+g]*p;return c};Q.prototype.readUintBE=Q.prototype.readUIntBE=function(n,a,l){n=n>>>0,a=a>>>0,l||Wt(n,a,this.length);let c=this[n+--a],p=1;for(;a>0&&(p*=256);)c+=this[n+--a]*p;return c};Q.prototype.readUint8=Q.prototype.readUInt8=function(n,a){return n=n>>>0,a||Wt(n,1,this.length),this[n]};Q.prototype.readUint16LE=Q.prototype.readUInt16LE=function(n,a){return n=n>>>0,a||Wt(n,2,this.length),this[n]|this[n+1]<<8};Q.prototype.readUint16BE=Q.prototype.readUInt16BE=function(n,a){return n=n>>>0,a||Wt(n,2,this.length),this[n]<<8|this[n+1]};Q.prototype.readUint32LE=Q.prototype.readUInt32LE=function(n,a){return n=n>>>0,a||Wt(n,4,this.length),(this[n]|this[n+1]<<8|this[n+2]<<16)+this[n+3]*16777216};Q.prototype.readUint32BE=Q.prototype.readUInt32BE=function(n,a){return n=n>>>0,a||Wt(n,4,this.length),this[n]*16777216+(this[n+1]<<16|this[n+2]<<8|this[n+3])};Q.prototype.readBigUInt64LE=Dn(function(n){n=n>>>0,Ki(n,"offset");let a=this[n],l=this[n+7];(a===void 0||l===void 0)&&Yo(n,this.length-8);let c=a+this[++n]*2**8+this[++n]*2**16+this[++n]*2**24,p=this[++n]+this[++n]*2**8+this[++n]*2**16+l*2**24;return BigInt(c)+(BigInt(p)<<BigInt(32))});Q.prototype.readBigUInt64BE=Dn(function(n){n=n>>>0,Ki(n,"offset");let a=this[n],l=this[n+7];(a===void 0||l===void 0)&&Yo(n,this.length-8);let c=a*2**24+this[++n]*2**16+this[++n]*2**8+this[++n],p=this[++n]*2**24+this[++n]*2**16+this[++n]*2**8+l;return(BigInt(c)<<BigInt(32))+BigInt(p)});Q.prototype.readIntLE=function(n,a,l){n=n>>>0,a=a>>>0,l||Wt(n,a,this.length);let c=this[n],p=1,g=0;for(;++g<a&&(p*=256);)c+=this[n+g]*p;return p*=128,c>=p&&(c-=Math.pow(2,8*a)),c};Q.prototype.readIntBE=function(n,a,l){n=n>>>0,a=a>>>0,l||Wt(n,a,this.length);let c=a,p=1,g=this[n+--c];for(;c>0&&(p*=256);)g+=this[n+--c]*p;return p*=128,g>=p&&(g-=Math.pow(2,8*a)),g};Q.prototype.readInt8=function(n,a){return n=n>>>0,a||Wt(n,1,this.length),this[n]&128?(255-this[n]+1)*-1:this[n]};Q.prototype.readInt16LE=function(n,a){n=n>>>0,a||Wt(n,2,this.length);let l=this[n]|this[n+1]<<8;return l&32768?l|4294901760:l};Q.prototype.readInt16BE=function(n,a){n=n>>>0,a||Wt(n,2,this.length);let l=this[n+1]|this[n]<<8;return l&32768?l|4294901760:l};Q.prototype.readInt32LE=function(n,a){return n=n>>>0,a||Wt(n,4,this.length),this[n]|this[n+1]<<8|this[n+2]<<16|this[n+3]<<24};Q.prototype.readInt32BE=function(n,a){return n=n>>>0,a||Wt(n,4,this.length),this[n]<<24|this[n+1]<<16|this[n+2]<<8|this[n+3]};Q.prototype.readBigInt64LE=Dn(function(n){n=n>>>0,Ki(n,"offset");let a=this[n],l=this[n+7];(a===void 0||l===void 0)&&Yo(n,this.length-8);let c=this[n+4]+this[n+5]*2**8+this[n+6]*2**16+(l<<24);return(BigInt(c)<<BigInt(32))+BigInt(a+this[++n]*2**8+this[++n]*2**16+this[++n]*2**24)});Q.prototype.readBigInt64BE=Dn(function(n){n=n>>>0,Ki(n,"offset");let a=this[n],l=this[n+7];(a===void 0||l===void 0)&&Yo(n,this.length-8);let c=(a<<24)+this[++n]*2**16+this[++n]*2**8+this[++n];return(BigInt(c)<<BigInt(32))+BigInt(this[++n]*2**24+this[++n]*2**16+this[++n]*2**8+l)});Q.prototype.readFloatLE=function(n,a){return n=n>>>0,a||Wt(n,4,this.length),qi.read(this,n,!0,23,4)};Q.prototype.readFloatBE=function(n,a){return n=n>>>0,a||Wt(n,4,this.length),qi.read(this,n,!1,23,4)};Q.prototype.readDoubleLE=function(n,a){return n=n>>>0,a||Wt(n,8,this.length),qi.read(this,n,!0,52,8)};Q.prototype.readDoubleBE=function(n,a){return n=n>>>0,a||Wt(n,8,this.length),qi.read(this,n,!1,52,8)};function pr(r,n,a,l,c,p){if(!Q.isBuffer(r))throw new TypeError('"buffer" argument must be a Buffer instance');if(n>c||n<p)throw new RangeError('"value" argument is out of bounds');if(a+l>r.length)throw new RangeError("Index out of range")}Q.prototype.writeUintLE=Q.prototype.writeUIntLE=function(n,a,l,c){if(n=+n,a=a>>>0,l=l>>>0,!c){let y=Math.pow(2,8*l)-1;pr(this,n,a,l,y,0)}let p=1,g=0;for(this[a]=n&255;++g<l&&(p*=256);)this[a+g]=n/p&255;return a+l};Q.prototype.writeUintBE=Q.prototype.writeUIntBE=function(n,a,l,c){if(n=+n,a=a>>>0,l=l>>>0,!c){let y=Math.pow(2,8*l)-1;pr(this,n,a,l,y,0)}let p=l-1,g=1;for(this[a+p]=n&255;--p>=0&&(g*=256);)this[a+p]=n/g&255;return a+l};Q.prototype.writeUint8=Q.prototype.writeUInt8=function(n,a,l){return n=+n,a=a>>>0,l||pr(this,n,a,1,255,0),this[a]=n&255,a+1};Q.prototype.writeUint16LE=Q.prototype.writeUInt16LE=function(n,a,l){return n=+n,a=a>>>0,l||pr(this,n,a,2,65535,0),this[a]=n&255,this[a+1]=n>>>8,a+2};Q.prototype.writeUint16BE=Q.prototype.writeUInt16BE=function(n,a,l){return n=+n,a=a>>>0,l||pr(this,n,a,2,65535,0),this[a]=n>>>8,this[a+1]=n&255,a+2};Q.prototype.writeUint32LE=Q.prototype.writeUInt32LE=function(n,a,l){return n=+n,a=a>>>0,l||pr(this,n,a,4,4294967295,0),this[a+3]=n>>>24,this[a+2]=n>>>16,this[a+1]=n>>>8,this[a]=n&255,a+4};Q.prototype.writeUint32BE=Q.prototype.writeUInt32BE=function(n,a,l){return n=+n,a=a>>>0,l||pr(this,n,a,4,4294967295,0),this[a]=n>>>24,this[a+1]=n>>>16,this[a+2]=n>>>8,this[a+3]=n&255,a+4};function xg(r,n,a,l,c){Ag(n,l,c,r,a,7);let p=Number(n&BigInt(4294967295));r[a++]=p,p=p>>8,r[a++]=p,p=p>>8,r[a++]=p,p=p>>8,r[a++]=p;let g=Number(n>>BigInt(32)&BigInt(4294967295));return r[a++]=g,g=g>>8,r[a++]=g,g=g>>8,r[a++]=g,g=g>>8,r[a++]=g,a}function Tg(r,n,a,l,c){Ag(n,l,c,r,a,7);let p=Number(n&BigInt(4294967295));r[a+7]=p,p=p>>8,r[a+6]=p,p=p>>8,r[a+5]=p,p=p>>8,r[a+4]=p;let g=Number(n>>BigInt(32)&BigInt(4294967295));return r[a+3]=g,g=g>>8,r[a+2]=g,g=g>>8,r[a+1]=g,g=g>>8,r[a]=g,a+8}Q.prototype.writeBigUInt64LE=Dn(function(n,a=0){return xg(this,n,a,BigInt(0),BigInt("0xffffffffffffffff"))});Q.prototype.writeBigUInt64BE=Dn(function(n,a=0){return Tg(this,n,a,BigInt(0),BigInt("0xffffffffffffffff"))});Q.prototype.writeIntLE=function(n,a,l,c){if(n=+n,a=a>>>0,!c){let T=Math.pow(2,8*l-1);pr(this,n,a,l,T-1,-T)}let p=0,g=1,y=0;for(this[a]=n&255;++p<l&&(g*=256);)n<0&&y===0&&this[a+p-1]!==0&&(y=1),this[a+p]=(n/g>>0)-y&255;return a+l};Q.prototype.writeIntBE=function(n,a,l,c){if(n=+n,a=a>>>0,!c){let T=Math.pow(2,8*l-1);pr(this,n,a,l,T-1,-T)}let p=l-1,g=1,y=0;for(this[a+p]=n&255;--p>=0&&(g*=256);)n<0&&y===0&&this[a+p+1]!==0&&(y=1),this[a+p]=(n/g>>0)-y&255;return a+l};Q.prototype.writeInt8=function(n,a,l){return n=+n,a=a>>>0,l||pr(this,n,a,1,127,-128),n<0&&(n=255+n+1),this[a]=n&255,a+1};Q.prototype.writeInt16LE=function(n,a,l){return n=+n,a=a>>>0,l||pr(this,n,a,2,32767,-32768),this[a]=n&255,this[a+1]=n>>>8,a+2};Q.prototype.writeInt16BE=function(n,a,l){return n=+n,a=a>>>0,l||pr(this,n,a,2,32767,-32768),this[a]=n>>>8,this[a+1]=n&255,a+2};Q.prototype.writeInt32LE=function(n,a,l){return n=+n,a=a>>>0,l||pr(this,n,a,4,2147483647,-2147483648),this[a]=n&255,this[a+1]=n>>>8,this[a+2]=n>>>16,this[a+3]=n>>>24,a+4};Q.prototype.writeInt32BE=function(n,a,l){return n=+n,a=a>>>0,l||pr(this,n,a,4,2147483647,-2147483648),n<0&&(n=4294967295+n+1),this[a]=n>>>24,this[a+1]=n>>>16,this[a+2]=n>>>8,this[a+3]=n&255,a+4};Q.prototype.writeBigInt64LE=Dn(function(n,a=0){return xg(this,n,a,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});Q.prototype.writeBigInt64BE=Dn(function(n,a=0){return Tg(this,n,a,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Ig(r,n,a,l,c,p){if(a+l>r.length)throw new RangeError("Index out of range");if(a<0)throw new RangeError("Index out of range")}function Eg(r,n,a,l,c){return n=+n,a=a>>>0,c||Ig(r,n,a,4,34028234663852886e22,-34028234663852886e22),qi.write(r,n,a,l,23,4),a+4}Q.prototype.writeFloatLE=function(n,a,l){return Eg(this,n,a,!0,l)};Q.prototype.writeFloatBE=function(n,a,l){return Eg(this,n,a,!1,l)};function Cg(r,n,a,l,c){return n=+n,a=a>>>0,c||Ig(r,n,a,8,17976931348623157e292,-17976931348623157e292),qi.write(r,n,a,l,52,8),a+8}Q.prototype.writeDoubleLE=function(n,a,l){return Cg(this,n,a,!0,l)};Q.prototype.writeDoubleBE=function(n,a,l){return Cg(this,n,a,!1,l)};Q.prototype.copy=function(n,a,l,c){if(!Q.isBuffer(n))throw new TypeError("argument should be a Buffer");if(l||(l=0),!c&&c!==0&&(c=this.length),a>=n.length&&(a=n.length),a||(a=0),c>0&&c<l&&(c=l),c===l||n.length===0||this.length===0)return 0;if(a<0)throw new RangeError("targetStart out of bounds");if(l<0||l>=this.length)throw new RangeError("Index out of range");if(c<0)throw new RangeError("sourceEnd out of bounds");c>this.length&&(c=this.length),n.length-a<c-l&&(c=n.length-a+l);let p=c-l;return this===n&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(a,l,c):Uint8Array.prototype.set.call(n,this.subarray(l,c),a),p};Q.prototype.fill=function(n,a,l,c){if(typeof n=="string"){if(typeof a=="string"?(c=a,a=0,l=this.length):typeof l=="string"&&(c=l,l=this.length),c!==void 0&&typeof c!="string")throw new TypeError("encoding must be a string");if(typeof c=="string"&&!Q.isEncoding(c))throw new TypeError("Unknown encoding: "+c);if(n.length===1){let g=n.charCodeAt(0);(c==="utf8"&&g<128||c==="latin1")&&(n=g)}}else typeof n=="number"?n=n&255:typeof n=="boolean"&&(n=Number(n));if(a<0||this.length<a||this.length<l)throw new RangeError("Out of range index");if(l<=a)return this;a=a>>>0,l=l===void 0?this.length:l>>>0,n||(n=0);let p;if(typeof n=="number")for(p=a;p<l;++p)this[p]=n;else{let g=Q.isBuffer(n)?n:Q.from(n,c),y=g.length;if(y===0)throw new TypeError('The value "'+n+'" is invalid for argument "value"');for(p=0;p<l-a;++p)this[p+a]=g[p%y]}return this};var zi={};function gu(r,n,a){zi[r]=class extends a{constructor(){super(),Object.defineProperty(this,"message",{value:n.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${r}]`,this.stack,delete this.name}get code(){return r}set code(c){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:c,writable:!0})}toString(){return`${this.name} [${r}]: ${this.message}`}}}gu("ERR_BUFFER_OUT_OF_BOUNDS",function(r){return r?`${r} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError);gu("ERR_INVALID_ARG_TYPE",function(r,n){return`The "${r}" argument must be of type number. Received type ${typeof n}`},TypeError);gu("ERR_OUT_OF_RANGE",function(r,n,a){let l=`The value of "${r}" is out of range.`,c=a;return Number.isInteger(a)&&Math.abs(a)>2**32?c=pg(String(a)):typeof a=="bigint"&&(c=String(a),(a>BigInt(2)**BigInt(32)||a<-(BigInt(2)**BigInt(32)))&&(c=pg(c)),c+="n"),l+=` It must be ${n}. Received ${c}`,l},RangeError);function pg(r){let n="",a=r.length,l=r[0]==="-"?1:0;for(;a>=l+4;a-=3)n=`_${r.slice(a-3,a)}${n}`;return`${r.slice(0,a)}${n}`}function YA(r,n,a){Ki(n,"offset"),(r[n]===void 0||r[n+a]===void 0)&&Yo(n,r.length-(a+1))}function Ag(r,n,a,l,c,p){if(r>a||r<n){let g=typeof n=="bigint"?"n":"",y;throw p>3?n===0||n===BigInt(0)?y=`>= 0${g} and < 2${g} ** ${(p+1)*8}${g}`:y=`>= -(2${g} ** ${(p+1)*8-1}${g}) and < 2 ** ${(p+1)*8-1}${g}`:y=`>= ${n}${g} and <= ${a}${g}`,new zi.ERR_OUT_OF_RANGE("value",y,r)}YA(l,c,p)}function Ki(r,n){if(typeof r!="number")throw new zi.ERR_INVALID_ARG_TYPE(n,"number",r)}function Yo(r,n,a){throw Math.floor(r)!==r?(Ki(r,a),new zi.ERR_OUT_OF_RANGE(a||"offset","an integer",r)):n<0?new zi.ERR_BUFFER_OUT_OF_BOUNDS:new zi.ERR_OUT_OF_RANGE(a||"offset",`>= ${a?1:0} and <= ${n}`,r)}var jA=/[^+/0-9A-Za-z-_]/g;function zA(r){if(r=r.split("=")[0],r=r.trim().replace(jA,""),r.length<2)return"";for(;r.length%4!==0;)r=r+"=";return r}function du(r,n){n=n||1/0;let a,l=r.length,c=null,p=[];for(let g=0;g<l;++g){if(a=r.charCodeAt(g),a>55295&&a<57344){if(!c){if(a>56319){(n-=3)>-1&&p.push(239,191,189);continue}else if(g+1===l){(n-=3)>-1&&p.push(239,191,189);continue}c=a;continue}if(a<56320){(n-=3)>-1&&p.push(239,191,189),c=a;continue}a=(c-55296<<10|a-56320)+65536}else c&&(n-=3)>-1&&p.push(239,191,189);if(c=null,a<128){if((n-=1)<0)break;p.push(a)}else if(a<2048){if((n-=2)<0)break;p.push(a>>6|192,a&63|128)}else if(a<65536){if((n-=3)<0)break;p.push(a>>12|224,a>>6&63|128,a&63|128)}else if(a<1114112){if((n-=4)<0)break;p.push(a>>18|240,a>>12&63|128,a>>6&63|128,a&63|128)}else throw new Error("Invalid code point")}return p}function qA(r){let n=[];for(let a=0;a<r.length;++a)n.push(r.charCodeAt(a)&255);return n}function KA(r,n){let a,l,c,p=[];for(let g=0;g<r.length&&!((n-=2)<0);++g)a=r.charCodeAt(g),l=a>>8,c=a%256,p.push(c),p.push(l);return p}function Rg(r){return uu.toByteArray(zA(r))}function Is(r,n,a,l){let c;for(c=0;c<l&&!(c+a>=n.length||c>=r.length);++c)n[c+a]=r[c];return c}function Kr(r,n){return r instanceof n||r!=null&&r.constructor!=null&&r.constructor.name!=null&&r.constructor.name===n.name}function mu(r){return r!==r}var $A=function(){let r="0123456789abcdef",n=new Array(256);for(let a=0;a<16;++a){let l=a*16;for(let c=0;c<16;++c)n[l+c]=r[a]+r[c]}return n}();function Dn(r){return typeof BigInt>"u"?eR:r}function eR(){throw new Error("BigInt not supported")}});var Wg=at((Cu,Au)=>{((r,n)=>{typeof define=="function"&&define.amd?define([],n):typeof Au=="object"&&typeof Cu<"u"?Au.exports=n():r.Papa=n()})(Cu,function r(){var n=typeof self<"u"?self:typeof window<"u"?window:n!==void 0?n:{},a,l=!n.document&&!!n.postMessage,c=n.IS_PAPA_WORKER||!1,p={},g=0,y={};function T(R){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},function(w){var P=q(w);P.chunkSize=parseInt(P.chunkSize),w.step||w.chunk||(P.chunkSize=null),this._handle=new X(P),(this._handle.streamer=this)._config=P}.call(this,R),this.parseChunk=function(w,P){var $=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&0<$){let k=this._config.newline;k||(fe=this._config.quoteChar||'"',k=this._handle.guessLineEndings(w,fe)),w=[...w.split(k).slice($)].join(k)}this.isFirstChunk&&ae(this._config.beforeFirstChunk)&&(fe=this._config.beforeFirstChunk(w))!==void 0&&(w=fe),this.isFirstChunk=!1,this._halted=!1;var $=this._partialLine+w,fe=(this._partialLine="",this._handle.parse($,this._baseIndex,!this._finished));if(!this._handle.paused()&&!this._handle.aborted()){if(w=fe.meta.cursor,$=(this._finished||(this._partialLine=$.substring(w-this._baseIndex),this._baseIndex=w),fe&&fe.data&&(this._rowCount+=fe.data.length),this._finished||this._config.preview&&this._rowCount>=this._config.preview),c)n.postMessage({results:fe,workerId:y.WORKER_ID,finished:$});else if(ae(this._config.chunk)&&!P){if(this._config.chunk(fe,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);this._completeResults=fe=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(fe.data),this._completeResults.errors=this._completeResults.errors.concat(fe.errors),this._completeResults.meta=fe.meta),this._completed||!$||!ae(this._config.complete)||fe&&fe.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),$||fe&&fe.meta.paused||this._nextChunk(),fe}this._halted=!0},this._sendError=function(w){ae(this._config.error)?this._config.error(w):c&&this._config.error&&n.postMessage({workerId:y.WORKER_ID,error:w,finished:!1})}}function U(R){var w;(R=R||{}).chunkSize||(R.chunkSize=y.RemoteChunkSize),T.call(this,R),this._nextChunk=l?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(P){this._input=P,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(w=new XMLHttpRequest,this._config.withCredentials&&(w.withCredentials=this._config.withCredentials),l||(w.onload=te(this._chunkLoaded,this),w.onerror=te(this._chunkError,this)),w.open(this._config.downloadRequestBody?"POST":"GET",this._input,!l),this._config.downloadRequestHeaders){var P,$=this._config.downloadRequestHeaders;for(P in $)w.setRequestHeader(P,$[P])}var fe;this._config.chunkSize&&(fe=this._start+this._config.chunkSize-1,w.setRequestHeader("Range","bytes="+this._start+"-"+fe));try{w.send(this._config.downloadRequestBody)}catch(k){this._chunkError(k.message)}l&&w.status===0&&this._chunkError()}},this._chunkLoaded=function(){w.readyState===4&&(w.status<200||400<=w.status?this._chunkError():(this._start+=this._config.chunkSize||w.responseText.length,this._finished=!this._config.chunkSize||this._start>=(P=>(P=P.getResponseHeader("Content-Range"))!==null?parseInt(P.substring(P.lastIndexOf("/")+1)):-1)(w),this.parseChunk(w.responseText)))},this._chunkError=function(P){P=w.statusText||P,this._sendError(new Error(P))}}function A(R){(R=R||{}).chunkSize||(R.chunkSize=y.LocalChunkSize),T.call(this,R);var w,P,$=typeof FileReader<"u";this.stream=function(fe){this._input=fe,P=fe.slice||fe.webkitSlice||fe.mozSlice,$?((w=new FileReader).onload=te(this._chunkLoaded,this),w.onerror=te(this._chunkError,this)):w=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var fe=this._input,k=(this._config.chunkSize&&(k=Math.min(this._start+this._config.chunkSize,this._input.size),fe=P.call(fe,this._start,k)),w.readAsText(fe,this._config.encoding));$||this._chunkLoaded({target:{result:k}})},this._chunkLoaded=function(fe){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(fe.target.result)},this._chunkError=function(){this._sendError(w.error)}}function F(R){var w;T.call(this,R=R||{}),this.stream=function(P){return w=P,this._nextChunk()},this._nextChunk=function(){var P,$;if(!this._finished)return P=this._config.chunkSize,w=P?($=w.substring(0,P),w.substring(P)):($=w,""),this._finished=!w,this.parseChunk($)}}function M(R){T.call(this,R=R||{});var w=[],P=!0,$=!1;this.pause=function(){T.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){T.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(fe){this._input=fe,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){$&&w.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),w.length?this.parseChunk(w.shift()):P=!0},this._streamData=te(function(fe){try{w.push(typeof fe=="string"?fe:fe.toString(this._config.encoding)),P&&(P=!1,this._checkIsFinished(),this.parseChunk(w.shift()))}catch(k){this._streamError(k)}},this),this._streamError=te(function(fe){this._streamCleanUp(),this._sendError(fe)},this),this._streamEnd=te(function(){this._streamCleanUp(),$=!0,this._streamData("")},this),this._streamCleanUp=te(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function X(R){var w,P,$,fe,k=Math.pow(2,53),oe=-k,x=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,ee=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/,D=this,de=0,ge=0,Oe=!1,_e=!1,we=[],re={data:[],errors:[],meta:{}};function Ze(le){return R.skipEmptyLines==="greedy"?le.join("").trim()==="":le.length===1&&le[0].length===0}function Ce(){if(re&&$&&(se("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+y.DefaultDelimiter+"'"),$=!1),R.skipEmptyLines&&(re.data=re.data.filter(function(Fe){return!Ze(Fe)})),ve()){let Fe=function(Je,Me){ae(R.transformHeader)&&(Je=R.transformHeader(Je,Me)),we.push(Je)};var ue=Fe;if(re)if(Array.isArray(re.data[0])){for(var le=0;ve()&&le<re.data.length;le++)re.data[le].forEach(Fe);re.data.splice(0,1)}else re.data.forEach(Fe)}function ye(Fe,Je){for(var Me=R.header?{}:[],Le=0;Le<Fe.length;Le++){var Re=Le,De=Fe[Le],De=((Be,Ve)=>(Te=>(R.dynamicTypingFunction&&R.dynamicTyping[Te]===void 0&&(R.dynamicTyping[Te]=R.dynamicTypingFunction(Te)),(R.dynamicTyping[Te]||R.dynamicTyping)===!0))(Be)?Ve==="true"||Ve==="TRUE"||Ve!=="false"&&Ve!=="FALSE"&&((Te=>{if(x.test(Te)&&(Te=parseFloat(Te),oe<Te&&Te<k))return 1})(Ve)?parseFloat(Ve):ee.test(Ve)?new Date(Ve):Ve===""?null:Ve):Ve)(Re=R.header?Le>=we.length?"__parsed_extra":we[Le]:Re,De=R.transform?R.transform(De,Re):De);Re==="__parsed_extra"?(Me[Re]=Me[Re]||[],Me[Re].push(De)):Me[Re]=De}return R.header&&(Le>we.length?se("FieldMismatch","TooManyFields","Too many fields: expected "+we.length+" fields but parsed "+Le,ge+Je):Le<we.length&&se("FieldMismatch","TooFewFields","Too few fields: expected "+we.length+" fields but parsed "+Le,ge+Je)),Me}var Ge;re&&(R.header||R.dynamicTyping||R.transform)&&(Ge=1,!re.data.length||Array.isArray(re.data[0])?(re.data=re.data.map(ye),Ge=re.data.length):re.data=ye(re.data,0),R.header&&re.meta&&(re.meta.fields=we),ge+=Ge)}function ve(){return R.header&&we.length===0}function se(le,ye,Ge,ue){le={type:le,code:ye,message:Ge},ue!==void 0&&(le.row=ue),re.errors.push(le)}ae(R.step)&&(fe=R.step,R.step=function(le){re=le,ve()?Ce():(Ce(),re.data.length!==0&&(de+=le.data.length,R.preview&&de>R.preview?P.abort():(re.data=re.data[0],fe(re,D))))}),this.parse=function(le,ye,Ge){var ue=R.quoteChar||'"',ue=(R.newline||(R.newline=this.guessLineEndings(le,ue)),$=!1,R.delimiter?ae(R.delimiter)&&(R.delimiter=R.delimiter(le),re.meta.delimiter=R.delimiter):((ue=((Fe,Je,Me,Le,Re)=>{var De,Be,Ve,Te;Re=Re||[","," ","|",";",y.RECORD_SEP,y.UNIT_SEP];for(var It=0;It<Re.length;It++){for(var Et,mr=Re[It],lt=0,Qt=0,ze=0,Xe=(Ve=void 0,new Z({comments:Le,delimiter:mr,newline:Je,preview:10}).parse(Fe)),mt=0;mt<Xe.data.length;mt++)Me&&Ze(Xe.data[mt])?ze++:(Et=Xe.data[mt].length,Qt+=Et,Ve===void 0?Ve=Et:0<Et&&(lt+=Math.abs(Et-Ve),Ve=Et));0<Xe.data.length&&(Qt/=Xe.data.length-ze),(Be===void 0||lt<=Be)&&(Te===void 0||Te<Qt)&&1.99<Qt&&(Be=lt,De=mr,Te=Qt)}return{successful:!!(R.delimiter=De),bestDelimiter:De}})(le,R.newline,R.skipEmptyLines,R.comments,R.delimitersToGuess)).successful?R.delimiter=ue.bestDelimiter:($=!0,R.delimiter=y.DefaultDelimiter),re.meta.delimiter=R.delimiter),q(R));return R.preview&&R.header&&ue.preview++,w=le,P=new Z(ue),re=P.parse(w,ye,Ge),Ce(),Oe?{meta:{paused:!0}}:re||{meta:{paused:!1}}},this.paused=function(){return Oe},this.pause=function(){Oe=!0,P.abort(),w=ae(R.chunk)?"":w.substring(P.getCharIndex())},this.resume=function(){D.streamer._halted?(Oe=!1,D.streamer.parseChunk(w,!0)):setTimeout(D.resume,3)},this.aborted=function(){return _e},this.abort=function(){_e=!0,P.abort(),re.meta.aborted=!0,ae(R.complete)&&R.complete(re),w=""},this.guessLineEndings=function(Fe,ue){Fe=Fe.substring(0,1048576);var ue=new RegExp(S(ue)+"([^]*?)"+S(ue),"gm"),Ge=(Fe=Fe.replace(ue,"")).split("\r"),ue=Fe.split(`
8
8
  `),Fe=1<ue.length&&ue[0].length<Ge[0].length;if(Ge.length===1||Fe)return`
9
9
  `;for(var Je=0,Me=0;Me<Ge.length;Me++)Ge[Me][0]===`
10
10
  `&&Je++;return Je>=Ge.length/2?`\r
11
- `:"\r"}}function S(_){return _.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Z(_){var w=(_=_||{}).delimiter,P=_.newline,$=_.comments,pe=_.step,k=_.preview,oe=_.fastMode,x=null,ee=!1,D=_.quoteChar==null?'"':_.quoteChar,ce=D;if(_.escapeChar!==void 0&&(ce=_.escapeChar),(typeof w!="string"||-1<y.BAD_DELIMITERS.indexOf(w))&&(w=","),$===w)throw new Error("Comment character same as delimiter");$===!0?$="#":(typeof $!="string"||-1<y.BAD_DELIMITERS.indexOf($))&&($=!1),P!==`
11
+ `:"\r"}}function S(R){return R.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Z(R){var w=(R=R||{}).delimiter,P=R.newline,$=R.comments,fe=R.step,k=R.preview,oe=R.fastMode,x=null,ee=!1,D=R.quoteChar==null?'"':R.quoteChar,de=D;if(R.escapeChar!==void 0&&(de=R.escapeChar),(typeof w!="string"||-1<y.BAD_DELIMITERS.indexOf(w))&&(w=","),$===w)throw new Error("Comment character same as delimiter");$===!0?$="#":(typeof $!="string"||-1<y.BAD_DELIMITERS.indexOf($))&&($=!1),P!==`
12
12
  `&&P!=="\r"&&P!==`\r
13
13
  `&&(P=`
14
- `);var ge=0,Oe=!1;this.parse=function(Re,we,re){if(typeof Re!="string")throw new Error("Input must be a string");var Ze=Re.length,Ce=w.length,ve=P.length,se=$.length,le=ae(pe),ye=[],Ge=[],ue=[],Fe=ge=0;if(!Re)return lt();if(oe||oe!==!1&&Re.indexOf(D)===-1){for(var Je=Re.split(P),Me=0;Me<Je.length;Me++){if(ue=Je[Me],ge+=ue.length,Me!==Je.length-1)ge+=P.length;else if(re)return lt();if(!$||ue.substring(0,se)!==$){if(le){if(ye=[],Te(ue.split(w)),Qt(),Oe)return lt()}else Te(ue.split(w));if(k&&k<=Me)return ye=ye.slice(0,k),lt(!0)}}return lt()}for(var Le=Re.indexOf(w,ge),_e=Re.indexOf(P,ge),De=new RegExp(S(ce)+S(D),"g"),Be=Re.indexOf(D,ge);;)if(Re[ge]===D)for(Be=ge,ge++;;){if((Be=Re.indexOf(D,Be+1))===-1)return re||Ge.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:ye.length,index:ge}),Et();if(Be===Ze-1)return Et(Re.substring(ge,Be).replace(De,D));if(D===ce&&Re[Be+1]===ce)Be++;else if(D===ce||Be===0||Re[Be-1]!==ce){Le!==-1&&Le<Be+1&&(Le=Re.indexOf(w,Be+1));var Ve=It((_e=_e!==-1&&_e<Be+1?Re.indexOf(P,Be+1):_e)===-1?Le:Math.min(Le,_e));if(Re.substr(Be+1+Ve,Ce)===w){ue.push(Re.substring(ge,Be).replace(De,D)),Re[ge=Be+1+Ve+Ce]!==D&&(Be=Re.indexOf(D,ge)),Le=Re.indexOf(w,ge),_e=Re.indexOf(P,ge);break}if(Ve=It(_e),Re.substring(Be+1+Ve,Be+1+Ve+ve)===P){if(ue.push(Re.substring(ge,Be).replace(De,D)),mr(Be+1+Ve+ve),Le=Re.indexOf(w,ge),Be=Re.indexOf(D,ge),le&&(Qt(),Oe))return lt();if(k&&ye.length>=k)return lt(!0);break}Ge.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:ye.length,index:ge}),Be++}}else if($&&ue.length===0&&Re.substring(ge,ge+se)===$){if(_e===-1)return lt();ge=_e+ve,_e=Re.indexOf(P,ge),Le=Re.indexOf(w,ge)}else if(Le!==-1&&(Le<_e||_e===-1))ue.push(Re.substring(ge,Le)),ge=Le+Ce,Le=Re.indexOf(w,ge);else{if(_e===-1)break;if(ue.push(Re.substring(ge,_e)),mr(_e+ve),le&&(Qt(),Oe))return lt();if(k&&ye.length>=k)return lt(!0)}return Et();function Te(ze){ye.push(ze),Fe=ge}function It(ze){var Xe=0;return Xe=ze!==-1&&(ze=Re.substring(Be+1,ze))&&ze.trim()===""?ze.length:Xe}function Et(ze){return re||(ze===void 0&&(ze=Re.substring(ge)),ue.push(ze),ge=Ze,Te(ue),le&&Qt()),lt()}function mr(ze){ge=ze,Te(ue),ue=[],_e=Re.indexOf(P,ge)}function lt(ze){if(_.header&&!we&&ye.length&&!ee){var Xe=ye[0],mt=Object.create(null),ut=new Set(Xe);let qe=!1;for(let kt=0;kt<Xe.length;kt++){let ft=Xe[kt];if(mt[ft=ae(_.transformHeader)?_.transformHeader(ft,kt):ft]){let Mt,br=mt[ft];for(;Mt=ft+"_"+br,br++,ut.has(Mt););ut.add(Mt),Xe[kt]=Mt,mt[ft]++,qe=!0,(x=x===null?{}:x)[Mt]=ft}else mt[ft]=1,Xe[kt]=ft;ut.add(ft)}qe&&console.warn("Duplicate headers found and renamed."),ee=!0}return{data:ye,errors:Ge,meta:{delimiter:w,linebreak:P,aborted:Oe,truncated:!!ze,cursor:Fe+(we||0),renamedHeaders:x}}}function Qt(){pe(lt()),ye=[],Ge=[]}},this.abort=function(){Oe=!0},this.getCharIndex=function(){return ge}}function R(_){var w=_.data,P=p[w.workerId],$=!1;if(w.error)P.userError(w.error,w.file);else if(w.results&&w.results.data){var pe={abort:function(){$=!0,G(w.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:J,resume:J};if(ae(P.userStep)){for(var k=0;k<w.results.data.length&&(P.userStep({data:w.results.data[k],errors:w.results.errors,meta:w.results.meta},pe),!$);k++);delete w.results}else ae(P.userChunk)&&(P.userChunk(w.results,pe,w.file),delete w.results)}w.finished&&!$&&G(w.workerId,w.results)}function G(_,w){var P=p[_];ae(P.userComplete)&&P.userComplete(w),P.terminate(),delete p[_]}function J(){throw new Error("Not implemented.")}function q(_){if(typeof _!="object"||_===null)return _;var w,P=Array.isArray(_)?[]:{};for(w in _)P[w]=q(_[w]);return P}function te(_,w){return function(){_.apply(w,arguments)}}function ae(_){return typeof _=="function"}return y.parse=function(_,w){var P=(w=w||{}).dynamicTyping||!1;if(ae(P)&&(w.dynamicTypingFunction=P,P={}),w.dynamicTyping=P,w.transform=!!ae(w.transform)&&w.transform,!w.worker||!y.WORKERS_SUPPORTED)return P=null,y.NODE_STREAM_INPUT,typeof _=="string"?(_=($=>$.charCodeAt(0)!==65279?$:$.slice(1))(_),P=new(w.download?U:F)(w)):_.readable===!0&&ae(_.read)&&ae(_.on)?P=new M(w):(n.File&&_ instanceof File||_ instanceof Object)&&(P=new A(w)),P.stream(_);(P=(()=>{var $;return!!y.WORKERS_SUPPORTED&&($=(()=>{var pe=n.URL||n.webkitURL||null,k=r.toString();return y.BLOB_URL||(y.BLOB_URL=pe.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ","(",k,")();"],{type:"text/javascript"})))})(),($=new n.Worker($)).onmessage=R,$.id=g++,p[$.id]=$)})()).userStep=w.step,P.userChunk=w.chunk,P.userComplete=w.complete,P.userError=w.error,w.step=ae(w.step),w.chunk=ae(w.chunk),w.complete=ae(w.complete),w.error=ae(w.error),delete w.worker,P.postMessage({input:_,config:w,workerId:P.id})},y.unparse=function(_,w){var P=!1,$=!0,pe=",",k=`\r
15
- `,oe='"',x=oe+oe,ee=!1,D=null,ce=!1,ge=((()=>{if(typeof w=="object"){if(typeof w.delimiter!="string"||y.BAD_DELIMITERS.filter(function(we){return w.delimiter.indexOf(we)!==-1}).length||(pe=w.delimiter),typeof w.quotes!="boolean"&&typeof w.quotes!="function"&&!Array.isArray(w.quotes)||(P=w.quotes),typeof w.skipEmptyLines!="boolean"&&typeof w.skipEmptyLines!="string"||(ee=w.skipEmptyLines),typeof w.newline=="string"&&(k=w.newline),typeof w.quoteChar=="string"&&(oe=w.quoteChar),typeof w.header=="boolean"&&($=w.header),Array.isArray(w.columns)){if(w.columns.length===0)throw new Error("Option columns is empty");D=w.columns}w.escapeChar!==void 0&&(x=w.escapeChar+oe),w.escapeFormulae instanceof RegExp?ce=w.escapeFormulae:typeof w.escapeFormulae=="boolean"&&w.escapeFormulae&&(ce=/^[=+\-@\t\r].*$/)}})(),new RegExp(S(oe),"g"));if(typeof _=="string"&&(_=JSON.parse(_)),Array.isArray(_)){if(!_.length||Array.isArray(_[0]))return Oe(null,_,ee);if(typeof _[0]=="object")return Oe(D||Object.keys(_[0]),_,ee)}else if(typeof _=="object")return typeof _.data=="string"&&(_.data=JSON.parse(_.data)),Array.isArray(_.data)&&(_.fields||(_.fields=_.meta&&_.meta.fields||D),_.fields||(_.fields=Array.isArray(_.data[0])?_.fields:typeof _.data[0]=="object"?Object.keys(_.data[0]):[]),Array.isArray(_.data[0])||typeof _.data[0]=="object"||(_.data=[_.data])),Oe(_.fields||[],_.data||[],ee);throw new Error("Unable to serialize unrecognized input");function Oe(we,re,Ze){var Ce="",ve=(typeof we=="string"&&(we=JSON.parse(we)),typeof re=="string"&&(re=JSON.parse(re)),Array.isArray(we)&&0<we.length),se=!Array.isArray(re[0]);if(ve&&$){for(var le=0;le<we.length;le++)0<le&&(Ce+=pe),Ce+=Re(we[le],le);0<re.length&&(Ce+=k)}for(var ye=0;ye<re.length;ye++){var Ge=(ve?we:re[ye]).length,ue=!1,Fe=ve?Object.keys(re[ye]).length===0:re[ye].length===0;if(Ze&&!ve&&(ue=Ze==="greedy"?re[ye].join("").trim()==="":re[ye].length===1&&re[ye][0].length===0),Ze==="greedy"&&ve){for(var Je=[],Me=0;Me<Ge;Me++){var Le=se?we[Me]:Me;Je.push(re[ye][Le])}ue=Je.join("").trim()===""}if(!ue){for(var _e=0;_e<Ge;_e++){0<_e&&!Fe&&(Ce+=pe);var De=ve&&se?we[_e]:_e;Ce+=Re(re[ye][De],_e)}ye<re.length-1&&(!Ze||0<Ge&&!Fe)&&(Ce+=k)}}return Ce}function Re(we,re){var Ze,Ce;return we==null?"":we.constructor===Date?JSON.stringify(we).slice(1,25):(Ce=!1,ce&&typeof we=="string"&&ce.test(we)&&(we="'"+we,Ce=!0),Ze=we.toString().replace(ge,x),(Ce=Ce||P===!0||typeof P=="function"&&P(we,re)||Array.isArray(P)&&P[re]||((ve,se)=>{for(var le=0;le<se.length;le++)if(-1<ve.indexOf(se[le]))return!0;return!1})(Ze,y.BAD_DELIMITERS)||-1<Ze.indexOf(pe)||Ze.charAt(0)===" "||Ze.charAt(Ze.length-1)===" ")?oe+Ze+oe:Ze)}},y.RECORD_SEP="",y.UNIT_SEP="",y.BYTE_ORDER_MARK="\uFEFF",y.BAD_DELIMITERS=["\r",`
16
- `,'"',y.BYTE_ORDER_MARK],y.WORKERS_SUPPORTED=!l&&!!n.Worker,y.NODE_STREAM_INPUT=1,y.LocalChunkSize=10485760,y.RemoteChunkSize=5242880,y.DefaultDelimiter=",",y.Parser=Z,y.ParserHandle=X,y.NetworkStreamer=U,y.FileStreamer=A,y.StringStreamer=F,y.ReadableStreamStreamer=M,n.jQuery&&((a=n.jQuery).fn.parse=function(_){var w=_.config||{},P=[];return this.each(function(k){if(!(a(this).prop("tagName").toUpperCase()==="INPUT"&&a(this).attr("type").toLowerCase()==="file"&&n.FileReader)||!this.files||this.files.length===0)return!0;for(var oe=0;oe<this.files.length;oe++)P.push({file:this.files[oe],inputElem:this,instanceConfig:a.extend({},w)})}),$(),this;function $(){if(P.length===0)ae(_.complete)&&_.complete();else{var k,oe,x,ee,D=P[0];if(ae(_.before)){var ce=_.before(D.file,D.inputElem);if(typeof ce=="object"){if(ce.action==="abort")return k="AbortError",oe=D.file,x=D.inputElem,ee=ce.reason,void(ae(_.error)&&_.error({name:k},oe,x,ee));if(ce.action==="skip")return void pe();typeof ce.config=="object"&&(D.instanceConfig=a.extend(D.instanceConfig,ce.config))}else if(ce==="skip")return void pe()}var ge=D.instanceConfig.complete;D.instanceConfig.complete=function(Oe){ae(ge)&&ge(Oe,D.file,D.inputElem),pe()},y.parse(D.file,D.instanceConfig)}}function pe(){P.splice(0,1),$()}}),c&&(n.onmessage=function(_){_=_.data,y.WORKER_ID===void 0&&_&&(y.WORKER_ID=_.workerId),typeof _.input=="string"?n.postMessage({workerId:y.WORKER_ID,results:y.parse(_.input,_.config),finished:!0}):(n.File&&_.input instanceof File||_.input instanceof Object)&&(_=y.parse(_.input,_.config))&&n.postMessage({workerId:y.WORKER_ID,results:_,finished:!0})}),(U.prototype=Object.create(T.prototype)).constructor=U,(A.prototype=Object.create(T.prototype)).constructor=A,(F.prototype=Object.create(F.prototype)).constructor=F,(M.prototype=Object.create(T.prototype)).constructor=M,y})});var bn=at((Lu,Fu)=>{(function(r,n){typeof Lu=="object"&&typeof Fu<"u"?Fu.exports=n():typeof define=="function"&&define.amd?define(n):(r=r||self,r.CodeMirror=n())})(Lu,function(){"use strict";var r=navigator.userAgent,n=navigator.platform,a=/gecko\/\d/i.test(r),l=/MSIE \d/.test(r),c=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(r),p=/Edge\/(\d+)/.exec(r),g=l||c||p,y=g&&(l?document.documentMode||6:+(p||c)[1]),T=!p&&/WebKit\//.test(r),U=T&&/Qt\/\d+\.\d+/.test(r),A=!p&&/Chrome\/(\d+)/.exec(r),F=A&&+A[1],M=/Opera\//.test(r),X=/Apple Computer/.test(navigator.vendor),S=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(r),Z=/PhantomJS/.test(r),R=X&&(/Mobile\/\w+/.test(r)||navigator.maxTouchPoints>2),G=/Android/.test(r),J=R||G||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(r),q=R||/Mac/.test(n),te=/\bCrOS\b/.test(r),ae=/win/i.test(n),_=M&&r.match(/Version\/(\d*\.\d*)/);_&&(_=Number(_[1])),_&&_>=15&&(M=!1,T=!0);var w=q&&(U||M&&(_==null||_<12.11)),P=a||g&&y>=9;function $(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var pe=function(e,t){var o=e.className,i=$(t).exec(o);if(i){var s=o.slice(i.index+i[0].length);e.className=o.slice(0,i.index)+(s?i[1]+s:"")}};function k(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function oe(e,t){return k(e).appendChild(t)}function x(e,t,o,i){var s=document.createElement(e);if(o&&(s.className=o),i&&(s.style.cssText=i),typeof t=="string")s.appendChild(document.createTextNode(t));else if(t)for(var u=0;u<t.length;++u)s.appendChild(t[u]);return s}function ee(e,t,o,i){var s=x(e,t,o,i);return s.setAttribute("role","presentation"),s}var D;document.createRange?D=function(e,t,o,i){var s=document.createRange();return s.setEnd(i||e,o),s.setStart(e,t),s}:D=function(e,t,o){var i=document.body.createTextRange();try{i.moveToElementText(e.parentNode)}catch{return i}return i.collapse(!0),i.moveEnd("character",o),i.moveStart("character",t),i};function ce(e,t){if(t.nodeType==3&&(t=t.parentNode),e.contains)return e.contains(t);do if(t.nodeType==11&&(t=t.host),t==e)return!0;while(t=t.parentNode)}function ge(e){var t=e.ownerDocument||e,o;try{o=e.activeElement}catch{o=t.body||null}for(;o&&o.shadowRoot&&o.shadowRoot.activeElement;)o=o.shadowRoot.activeElement;return o}function Oe(e,t){var o=e.className;$(t).test(o)||(e.className+=(o?" ":"")+t)}function Re(e,t){for(var o=e.split(" "),i=0;i<o.length;i++)o[i]&&!$(o[i]).test(t)&&(t+=" "+o[i]);return t}var we=function(e){e.select()};R?we=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:g&&(we=function(e){try{e.select()}catch{}});function re(e){return e.display.wrapper.ownerDocument}function Ze(e){return Ce(e.display.wrapper)}function Ce(e){return e.getRootNode?e.getRootNode():e.ownerDocument}function ve(e){return re(e).defaultView}function se(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function le(e,t,o){t||(t={});for(var i in e)e.hasOwnProperty(i)&&(o!==!1||!t.hasOwnProperty(i))&&(t[i]=e[i]);return t}function ye(e,t,o,i,s){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var u=i||0,d=s||0;;){var h=e.indexOf(" ",u);if(h<0||h>=t)return d+(t-u);d+=h-u,d+=o-d%o,u=h+1}}var Ge=function(){this.id=null,this.f=null,this.time=0,this.handler=se(this.onTimeout,this)};Ge.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},Ge.prototype.set=function(e,t){this.f=t;var o=+new Date+e;(!this.id||o<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=o)};function ue(e,t){for(var o=0;o<e.length;++o)if(e[o]==t)return o;return-1}var Fe=50,Je={toString:function(){return"CodeMirror.Pass"}},Me={scroll:!1},Le={origin:"*mouse"},_e={origin:"+move"};function De(e,t,o){for(var i=0,s=0;;){var u=e.indexOf(" ",i);u==-1&&(u=e.length);var d=u-i;if(u==e.length||s+d>=t)return i+Math.min(d,t-s);if(s+=u-i,s+=o-s%o,i=u+1,s>=t)return i}}var Be=[""];function Ve(e){for(;Be.length<=e;)Be.push(Te(Be)+" ");return Be[e]}function Te(e){return e[e.length-1]}function It(e,t){for(var o=[],i=0;i<e.length;i++)o[i]=t(e[i],i);return o}function Et(e,t,o){for(var i=0,s=o(t);i<e.length&&o(e[i])<=s;)i++;e.splice(i,0,t)}function mr(){}function lt(e,t){var o;return Object.create?o=Object.create(e):(mr.prototype=e,o=new mr),t&&le(t,o),o}var Qt=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function ze(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||Qt.test(e))}function Xe(e,t){return t?t.source.indexOf("\\w")>-1&&ze(e)?!0:t.test(e):ze(e)}function mt(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var ut=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function qe(e){return e.charCodeAt(0)>=768&&ut.test(e)}function kt(e,t,o){for(;(o<0?t>0:t<e.length)&&qe(e.charAt(t));)t+=o;return t}function ft(e,t,o){for(var i=t>o?-1:1;;){if(t==o)return t;var s=(t+o)/2,u=i<0?Math.ceil(s):Math.floor(s);if(u==t)return e(u)?t:o;e(u)?o=u:t=u+i}}function Mt(e,t,o,i){if(!e)return i(t,o,"ltr",0);for(var s=!1,u=0;u<e.length;++u){var d=e[u];(d.from<o&&d.to>t||t==o&&d.to==t)&&(i(Math.max(d.from,t),Math.min(d.to,o),d.level==1?"rtl":"ltr",u),s=!0)}s||i(t,o,"ltr")}var br=null;function vr(e,t,o){var i;br=null;for(var s=0;s<e.length;++s){var u=e[s];if(u.from<t&&u.to>t)return s;u.to==t&&(u.from!=u.to&&o=="before"?i=s:br=s),u.from==t&&(u.from!=u.to&&o!="before"?i=s:br=s)}return i??br}var vn=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function o(b){return b<=247?e.charAt(b):1424<=b&&b<=1524?"R":1536<=b&&b<=1785?t.charAt(b-1536):1774<=b&&b<=2220?"r":8192<=b&&b<=8203?"w":b==8204?"b":"L"}var i=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,s=/[stwN]/,u=/[LRr]/,d=/[Lb1n]/,h=/[1n]/;function m(b,I,C){this.level=b,this.from=I,this.to=C}return function(b,I){var C=I=="ltr"?"L":"R";if(b.length==0||I=="ltr"&&!i.test(b))return!1;for(var B=b.length,L=[],W=0;W<B;++W)L.push(o(b.charCodeAt(W)));for(var H=0,z=C;H<B;++H){var ne=L[H];ne=="m"?L[H]=z:z=ne}for(var he=0,ie=C;he<B;++he){var me=L[he];me=="1"&&ie=="r"?L[he]="n":u.test(me)&&(ie=me,me=="r"&&(L[he]="R"))}for(var Ae=1,Ee=L[0];Ae<B-1;++Ae){var ke=L[Ae];ke=="+"&&Ee=="1"&&L[Ae+1]=="1"?L[Ae]="1":ke==","&&Ee==L[Ae+1]&&(Ee=="1"||Ee=="n")&&(L[Ae]=Ee),Ee=ke}for(var et=0;et<B;++et){var Lt=L[et];if(Lt==",")L[et]="N";else if(Lt=="%"){var ct=void 0;for(ct=et+1;ct<B&&L[ct]=="%";++ct);for(var dr=et&&L[et-1]=="!"||ct<B&&L[ct]=="1"?"1":"N",$t=et;$t<ct;++$t)L[$t]=dr;et=ct-1}}for(var bt=0,er=C;bt<B;++bt){var Gt=L[bt];er=="L"&&Gt=="1"?L[bt]="L":u.test(Gt)&&(er=Gt)}for(var xt=0;xt<B;++xt)if(s.test(L[xt])){var vt=void 0;for(vt=xt+1;vt<B&&s.test(L[vt]);++vt);for(var ht=(xt?L[xt-1]:C)=="L",tr=(vt<B?L[vt]:C)=="L",Ri=ht==tr?ht?"L":"R":C,wn=xt;wn<vt;++wn)L[wn]=Ri;xt=vt-1}for(var Vt=[],Pr,Ft=0;Ft<B;)if(d.test(L[Ft])){var Sl=Ft;for(++Ft;Ft<B&&d.test(L[Ft]);++Ft);Vt.push(new m(0,Sl,Ft))}else{var ln=Ft,jn=Vt.length,zn=I=="rtl"?1:0;for(++Ft;Ft<B&&L[Ft]!="L";++Ft);for(var Xt=ln;Xt<Ft;)if(h.test(L[Xt])){ln<Xt&&(Vt.splice(jn,0,new m(1,ln,Xt)),jn+=zn);var Ni=Xt;for(++Xt;Xt<Ft&&h.test(L[Xt]);++Xt);Vt.splice(jn,0,new m(2,Ni,Xt)),jn+=zn,ln=Xt}else++Xt;ln<Ft&&Vt.splice(jn,0,new m(1,ln,Ft))}return I=="ltr"&&(Vt[0].level==1&&(Pr=b.match(/^\s+/))&&(Vt[0].from=Pr[0].length,Vt.unshift(new m(0,0,Pr[0].length))),Te(Vt).level==1&&(Pr=b.match(/\s+$/))&&(Te(Vt).to-=Pr[0].length,Vt.push(new m(0,B-Pr[0].length,B)))),I=="rtl"?Vt.reverse():Vt}}();function Ne(e,t){var o=e.order;return o==null&&(o=e.order=vn(e.text,t)),o}var Sr=[],Ie=function(e,t,o){if(e.addEventListener)e.addEventListener(t,o,!1);else if(e.attachEvent)e.attachEvent("on"+t,o);else{var i=e._handlers||(e._handlers={});i[t]=(i[t]||Sr).concat(o)}};function yr(e,t){return e._handlers&&e._handlers[t]||Sr}function Ct(e,t,o){if(e.removeEventListener)e.removeEventListener(t,o,!1);else if(e.detachEvent)e.detachEvent("on"+t,o);else{var i=e._handlers,s=i&&i[t];if(s){var u=ue(s,o);u>-1&&(i[t]=s.slice(0,u).concat(s.slice(u+1)))}}}function Ke(e,t){var o=yr(e,t);if(o.length)for(var i=Array.prototype.slice.call(arguments,2),s=0;s<o.length;++s)o[s].apply(null,i)}function $e(e,t,o){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Ke(e,o||t.type,e,t),pt(t)||t.codemirrorIgnore}function sr(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var o=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),i=0;i<t.length;++i)ue(o,t[i])==-1&&o.push(t[i])}function yt(e,t){return yr(e,t).length>0}function xr(e){e.prototype.on=function(t,o){Ie(this,t,o)},e.prototype.off=function(t,o){Ct(this,t,o)}}function At(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function rt(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function pt(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function Wr(e){At(e),rt(e)}function yn(e){return e.target||e.srcElement}function Yt(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),q&&e.ctrlKey&&t==1&&(t=3),t}var si=function(){if(g&&y<9)return!1;var e=x("div");return"draggable"in e||"dragDrop"in e}(),en;function li(e){if(en==null){var t=x("span","\u200B");oe(e,x("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(en=t.offsetWidth<=1&&t.offsetHeight>2&&!(g&&y<8))}var o=en?x("span","\u200B"):x("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return o.setAttribute("cm-text",""),o}var Pt;function Ht(e){if(Pt!=null)return Pt;var t=oe(e,document.createTextNode("A\u062EA")),o=D(t,0,1).getBoundingClientRect(),i=D(t,1,2).getBoundingClientRect();return k(e),!o||o.left==o.right?!1:Pt=i.right-o.right<3}var jt=`
14
+ `);var ge=0,Oe=!1;this.parse=function(_e,we,re){if(typeof _e!="string")throw new Error("Input must be a string");var Ze=_e.length,Ce=w.length,ve=P.length,se=$.length,le=ae(fe),ye=[],Ge=[],ue=[],Fe=ge=0;if(!_e)return lt();if(oe||oe!==!1&&_e.indexOf(D)===-1){for(var Je=_e.split(P),Me=0;Me<Je.length;Me++){if(ue=Je[Me],ge+=ue.length,Me!==Je.length-1)ge+=P.length;else if(re)return lt();if(!$||ue.substring(0,se)!==$){if(le){if(ye=[],Te(ue.split(w)),Qt(),Oe)return lt()}else Te(ue.split(w));if(k&&k<=Me)return ye=ye.slice(0,k),lt(!0)}}return lt()}for(var Le=_e.indexOf(w,ge),Re=_e.indexOf(P,ge),De=new RegExp(S(de)+S(D),"g"),Be=_e.indexOf(D,ge);;)if(_e[ge]===D)for(Be=ge,ge++;;){if((Be=_e.indexOf(D,Be+1))===-1)return re||Ge.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:ye.length,index:ge}),Et();if(Be===Ze-1)return Et(_e.substring(ge,Be).replace(De,D));if(D===de&&_e[Be+1]===de)Be++;else if(D===de||Be===0||_e[Be-1]!==de){Le!==-1&&Le<Be+1&&(Le=_e.indexOf(w,Be+1));var Ve=It((Re=Re!==-1&&Re<Be+1?_e.indexOf(P,Be+1):Re)===-1?Le:Math.min(Le,Re));if(_e.substr(Be+1+Ve,Ce)===w){ue.push(_e.substring(ge,Be).replace(De,D)),_e[ge=Be+1+Ve+Ce]!==D&&(Be=_e.indexOf(D,ge)),Le=_e.indexOf(w,ge),Re=_e.indexOf(P,ge);break}if(Ve=It(Re),_e.substring(Be+1+Ve,Be+1+Ve+ve)===P){if(ue.push(_e.substring(ge,Be).replace(De,D)),mr(Be+1+Ve+ve),Le=_e.indexOf(w,ge),Be=_e.indexOf(D,ge),le&&(Qt(),Oe))return lt();if(k&&ye.length>=k)return lt(!0);break}Ge.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:ye.length,index:ge}),Be++}}else if($&&ue.length===0&&_e.substring(ge,ge+se)===$){if(Re===-1)return lt();ge=Re+ve,Re=_e.indexOf(P,ge),Le=_e.indexOf(w,ge)}else if(Le!==-1&&(Le<Re||Re===-1))ue.push(_e.substring(ge,Le)),ge=Le+Ce,Le=_e.indexOf(w,ge);else{if(Re===-1)break;if(ue.push(_e.substring(ge,Re)),mr(Re+ve),le&&(Qt(),Oe))return lt();if(k&&ye.length>=k)return lt(!0)}return Et();function Te(ze){ye.push(ze),Fe=ge}function It(ze){var Xe=0;return Xe=ze!==-1&&(ze=_e.substring(Be+1,ze))&&ze.trim()===""?ze.length:Xe}function Et(ze){return re||(ze===void 0&&(ze=_e.substring(ge)),ue.push(ze),ge=Ze,Te(ue),le&&Qt()),lt()}function mr(ze){ge=ze,Te(ue),ue=[],Re=_e.indexOf(P,ge)}function lt(ze){if(R.header&&!we&&ye.length&&!ee){var Xe=ye[0],mt=Object.create(null),ut=new Set(Xe);let qe=!1;for(let kt=0;kt<Xe.length;kt++){let ft=Xe[kt];if(mt[ft=ae(R.transformHeader)?R.transformHeader(ft,kt):ft]){let Mt,br=mt[ft];for(;Mt=ft+"_"+br,br++,ut.has(Mt););ut.add(Mt),Xe[kt]=Mt,mt[ft]++,qe=!0,(x=x===null?{}:x)[Mt]=ft}else mt[ft]=1,Xe[kt]=ft;ut.add(ft)}qe&&console.warn("Duplicate headers found and renamed."),ee=!0}return{data:ye,errors:Ge,meta:{delimiter:w,linebreak:P,aborted:Oe,truncated:!!ze,cursor:Fe+(we||0),renamedHeaders:x}}}function Qt(){fe(lt()),ye=[],Ge=[]}},this.abort=function(){Oe=!0},this.getCharIndex=function(){return ge}}function _(R){var w=R.data,P=p[w.workerId],$=!1;if(w.error)P.userError(w.error,w.file);else if(w.results&&w.results.data){var fe={abort:function(){$=!0,G(w.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:J,resume:J};if(ae(P.userStep)){for(var k=0;k<w.results.data.length&&(P.userStep({data:w.results.data[k],errors:w.results.errors,meta:w.results.meta},fe),!$);k++);delete w.results}else ae(P.userChunk)&&(P.userChunk(w.results,fe,w.file),delete w.results)}w.finished&&!$&&G(w.workerId,w.results)}function G(R,w){var P=p[R];ae(P.userComplete)&&P.userComplete(w),P.terminate(),delete p[R]}function J(){throw new Error("Not implemented.")}function q(R){if(typeof R!="object"||R===null)return R;var w,P=Array.isArray(R)?[]:{};for(w in R)P[w]=q(R[w]);return P}function te(R,w){return function(){R.apply(w,arguments)}}function ae(R){return typeof R=="function"}return y.parse=function(R,w){var P=(w=w||{}).dynamicTyping||!1;if(ae(P)&&(w.dynamicTypingFunction=P,P={}),w.dynamicTyping=P,w.transform=!!ae(w.transform)&&w.transform,!w.worker||!y.WORKERS_SUPPORTED)return P=null,y.NODE_STREAM_INPUT,typeof R=="string"?(R=($=>$.charCodeAt(0)!==65279?$:$.slice(1))(R),P=new(w.download?U:F)(w)):R.readable===!0&&ae(R.read)&&ae(R.on)?P=new M(w):(n.File&&R instanceof File||R instanceof Object)&&(P=new A(w)),P.stream(R);(P=(()=>{var $;return!!y.WORKERS_SUPPORTED&&($=(()=>{var fe=n.URL||n.webkitURL||null,k=r.toString();return y.BLOB_URL||(y.BLOB_URL=fe.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ","(",k,")();"],{type:"text/javascript"})))})(),($=new n.Worker($)).onmessage=_,$.id=g++,p[$.id]=$)})()).userStep=w.step,P.userChunk=w.chunk,P.userComplete=w.complete,P.userError=w.error,w.step=ae(w.step),w.chunk=ae(w.chunk),w.complete=ae(w.complete),w.error=ae(w.error),delete w.worker,P.postMessage({input:R,config:w,workerId:P.id})},y.unparse=function(R,w){var P=!1,$=!0,fe=",",k=`\r
15
+ `,oe='"',x=oe+oe,ee=!1,D=null,de=!1,ge=((()=>{if(typeof w=="object"){if(typeof w.delimiter!="string"||y.BAD_DELIMITERS.filter(function(we){return w.delimiter.indexOf(we)!==-1}).length||(fe=w.delimiter),typeof w.quotes!="boolean"&&typeof w.quotes!="function"&&!Array.isArray(w.quotes)||(P=w.quotes),typeof w.skipEmptyLines!="boolean"&&typeof w.skipEmptyLines!="string"||(ee=w.skipEmptyLines),typeof w.newline=="string"&&(k=w.newline),typeof w.quoteChar=="string"&&(oe=w.quoteChar),typeof w.header=="boolean"&&($=w.header),Array.isArray(w.columns)){if(w.columns.length===0)throw new Error("Option columns is empty");D=w.columns}w.escapeChar!==void 0&&(x=w.escapeChar+oe),w.escapeFormulae instanceof RegExp?de=w.escapeFormulae:typeof w.escapeFormulae=="boolean"&&w.escapeFormulae&&(de=/^[=+\-@\t\r].*$/)}})(),new RegExp(S(oe),"g"));if(typeof R=="string"&&(R=JSON.parse(R)),Array.isArray(R)){if(!R.length||Array.isArray(R[0]))return Oe(null,R,ee);if(typeof R[0]=="object")return Oe(D||Object.keys(R[0]),R,ee)}else if(typeof R=="object")return typeof R.data=="string"&&(R.data=JSON.parse(R.data)),Array.isArray(R.data)&&(R.fields||(R.fields=R.meta&&R.meta.fields||D),R.fields||(R.fields=Array.isArray(R.data[0])?R.fields:typeof R.data[0]=="object"?Object.keys(R.data[0]):[]),Array.isArray(R.data[0])||typeof R.data[0]=="object"||(R.data=[R.data])),Oe(R.fields||[],R.data||[],ee);throw new Error("Unable to serialize unrecognized input");function Oe(we,re,Ze){var Ce="",ve=(typeof we=="string"&&(we=JSON.parse(we)),typeof re=="string"&&(re=JSON.parse(re)),Array.isArray(we)&&0<we.length),se=!Array.isArray(re[0]);if(ve&&$){for(var le=0;le<we.length;le++)0<le&&(Ce+=fe),Ce+=_e(we[le],le);0<re.length&&(Ce+=k)}for(var ye=0;ye<re.length;ye++){var Ge=(ve?we:re[ye]).length,ue=!1,Fe=ve?Object.keys(re[ye]).length===0:re[ye].length===0;if(Ze&&!ve&&(ue=Ze==="greedy"?re[ye].join("").trim()==="":re[ye].length===1&&re[ye][0].length===0),Ze==="greedy"&&ve){for(var Je=[],Me=0;Me<Ge;Me++){var Le=se?we[Me]:Me;Je.push(re[ye][Le])}ue=Je.join("").trim()===""}if(!ue){for(var Re=0;Re<Ge;Re++){0<Re&&!Fe&&(Ce+=fe);var De=ve&&se?we[Re]:Re;Ce+=_e(re[ye][De],Re)}ye<re.length-1&&(!Ze||0<Ge&&!Fe)&&(Ce+=k)}}return Ce}function _e(we,re){var Ze,Ce;return we==null?"":we.constructor===Date?JSON.stringify(we).slice(1,25):(Ce=!1,de&&typeof we=="string"&&de.test(we)&&(we="'"+we,Ce=!0),Ze=we.toString().replace(ge,x),(Ce=Ce||P===!0||typeof P=="function"&&P(we,re)||Array.isArray(P)&&P[re]||((ve,se)=>{for(var le=0;le<se.length;le++)if(-1<ve.indexOf(se[le]))return!0;return!1})(Ze,y.BAD_DELIMITERS)||-1<Ze.indexOf(fe)||Ze.charAt(0)===" "||Ze.charAt(Ze.length-1)===" ")?oe+Ze+oe:Ze)}},y.RECORD_SEP="",y.UNIT_SEP="",y.BYTE_ORDER_MARK="\uFEFF",y.BAD_DELIMITERS=["\r",`
16
+ `,'"',y.BYTE_ORDER_MARK],y.WORKERS_SUPPORTED=!l&&!!n.Worker,y.NODE_STREAM_INPUT=1,y.LocalChunkSize=10485760,y.RemoteChunkSize=5242880,y.DefaultDelimiter=",",y.Parser=Z,y.ParserHandle=X,y.NetworkStreamer=U,y.FileStreamer=A,y.StringStreamer=F,y.ReadableStreamStreamer=M,n.jQuery&&((a=n.jQuery).fn.parse=function(R){var w=R.config||{},P=[];return this.each(function(k){if(!(a(this).prop("tagName").toUpperCase()==="INPUT"&&a(this).attr("type").toLowerCase()==="file"&&n.FileReader)||!this.files||this.files.length===0)return!0;for(var oe=0;oe<this.files.length;oe++)P.push({file:this.files[oe],inputElem:this,instanceConfig:a.extend({},w)})}),$(),this;function $(){if(P.length===0)ae(R.complete)&&R.complete();else{var k,oe,x,ee,D=P[0];if(ae(R.before)){var de=R.before(D.file,D.inputElem);if(typeof de=="object"){if(de.action==="abort")return k="AbortError",oe=D.file,x=D.inputElem,ee=de.reason,void(ae(R.error)&&R.error({name:k},oe,x,ee));if(de.action==="skip")return void fe();typeof de.config=="object"&&(D.instanceConfig=a.extend(D.instanceConfig,de.config))}else if(de==="skip")return void fe()}var ge=D.instanceConfig.complete;D.instanceConfig.complete=function(Oe){ae(ge)&&ge(Oe,D.file,D.inputElem),fe()},y.parse(D.file,D.instanceConfig)}}function fe(){P.splice(0,1),$()}}),c&&(n.onmessage=function(R){R=R.data,y.WORKER_ID===void 0&&R&&(y.WORKER_ID=R.workerId),typeof R.input=="string"?n.postMessage({workerId:y.WORKER_ID,results:y.parse(R.input,R.config),finished:!0}):(n.File&&R.input instanceof File||R.input instanceof Object)&&(R=y.parse(R.input,R.config))&&n.postMessage({workerId:y.WORKER_ID,results:R,finished:!0})}),(U.prototype=Object.create(T.prototype)).constructor=U,(A.prototype=Object.create(T.prototype)).constructor=A,(F.prototype=Object.create(F.prototype)).constructor=F,(M.prototype=Object.create(T.prototype)).constructor=M,y})});var bn=at((Lu,Fu)=>{(function(r,n){typeof Lu=="object"&&typeof Fu<"u"?Fu.exports=n():typeof define=="function"&&define.amd?define(n):(r=r||self,r.CodeMirror=n())})(Lu,function(){"use strict";var r=navigator.userAgent,n=navigator.platform,a=/gecko\/\d/i.test(r),l=/MSIE \d/.test(r),c=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(r),p=/Edge\/(\d+)/.exec(r),g=l||c||p,y=g&&(l?document.documentMode||6:+(p||c)[1]),T=!p&&/WebKit\//.test(r),U=T&&/Qt\/\d+\.\d+/.test(r),A=!p&&/Chrome\/(\d+)/.exec(r),F=A&&+A[1],M=/Opera\//.test(r),X=/Apple Computer/.test(navigator.vendor),S=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(r),Z=/PhantomJS/.test(r),_=X&&(/Mobile\/\w+/.test(r)||navigator.maxTouchPoints>2),G=/Android/.test(r),J=_||G||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(r),q=_||/Mac/.test(n),te=/\bCrOS\b/.test(r),ae=/win/i.test(n),R=M&&r.match(/Version\/(\d*\.\d*)/);R&&(R=Number(R[1])),R&&R>=15&&(M=!1,T=!0);var w=q&&(U||M&&(R==null||R<12.11)),P=a||g&&y>=9;function $(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var fe=function(e,t){var o=e.className,i=$(t).exec(o);if(i){var s=o.slice(i.index+i[0].length);e.className=o.slice(0,i.index)+(s?i[1]+s:"")}};function k(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function oe(e,t){return k(e).appendChild(t)}function x(e,t,o,i){var s=document.createElement(e);if(o&&(s.className=o),i&&(s.style.cssText=i),typeof t=="string")s.appendChild(document.createTextNode(t));else if(t)for(var u=0;u<t.length;++u)s.appendChild(t[u]);return s}function ee(e,t,o,i){var s=x(e,t,o,i);return s.setAttribute("role","presentation"),s}var D;document.createRange?D=function(e,t,o,i){var s=document.createRange();return s.setEnd(i||e,o),s.setStart(e,t),s}:D=function(e,t,o){var i=document.body.createTextRange();try{i.moveToElementText(e.parentNode)}catch{return i}return i.collapse(!0),i.moveEnd("character",o),i.moveStart("character",t),i};function de(e,t){if(t.nodeType==3&&(t=t.parentNode),e.contains)return e.contains(t);do if(t.nodeType==11&&(t=t.host),t==e)return!0;while(t=t.parentNode)}function ge(e){var t=e.ownerDocument||e,o;try{o=e.activeElement}catch{o=t.body||null}for(;o&&o.shadowRoot&&o.shadowRoot.activeElement;)o=o.shadowRoot.activeElement;return o}function Oe(e,t){var o=e.className;$(t).test(o)||(e.className+=(o?" ":"")+t)}function _e(e,t){for(var o=e.split(" "),i=0;i<o.length;i++)o[i]&&!$(o[i]).test(t)&&(t+=" "+o[i]);return t}var we=function(e){e.select()};_?we=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:g&&(we=function(e){try{e.select()}catch{}});function re(e){return e.display.wrapper.ownerDocument}function Ze(e){return Ce(e.display.wrapper)}function Ce(e){return e.getRootNode?e.getRootNode():e.ownerDocument}function ve(e){return re(e).defaultView}function se(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function le(e,t,o){t||(t={});for(var i in e)e.hasOwnProperty(i)&&(o!==!1||!t.hasOwnProperty(i))&&(t[i]=e[i]);return t}function ye(e,t,o,i,s){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var u=i||0,d=s||0;;){var h=e.indexOf(" ",u);if(h<0||h>=t)return d+(t-u);d+=h-u,d+=o-d%o,u=h+1}}var Ge=function(){this.id=null,this.f=null,this.time=0,this.handler=se(this.onTimeout,this)};Ge.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},Ge.prototype.set=function(e,t){this.f=t;var o=+new Date+e;(!this.id||o<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=o)};function ue(e,t){for(var o=0;o<e.length;++o)if(e[o]==t)return o;return-1}var Fe=50,Je={toString:function(){return"CodeMirror.Pass"}},Me={scroll:!1},Le={origin:"*mouse"},Re={origin:"+move"};function De(e,t,o){for(var i=0,s=0;;){var u=e.indexOf(" ",i);u==-1&&(u=e.length);var d=u-i;if(u==e.length||s+d>=t)return i+Math.min(d,t-s);if(s+=u-i,s+=o-s%o,i=u+1,s>=t)return i}}var Be=[""];function Ve(e){for(;Be.length<=e;)Be.push(Te(Be)+" ");return Be[e]}function Te(e){return e[e.length-1]}function It(e,t){for(var o=[],i=0;i<e.length;i++)o[i]=t(e[i],i);return o}function Et(e,t,o){for(var i=0,s=o(t);i<e.length&&o(e[i])<=s;)i++;e.splice(i,0,t)}function mr(){}function lt(e,t){var o;return Object.create?o=Object.create(e):(mr.prototype=e,o=new mr),t&&le(t,o),o}var Qt=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function ze(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||Qt.test(e))}function Xe(e,t){return t?t.source.indexOf("\\w")>-1&&ze(e)?!0:t.test(e):ze(e)}function mt(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var ut=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function qe(e){return e.charCodeAt(0)>=768&&ut.test(e)}function kt(e,t,o){for(;(o<0?t>0:t<e.length)&&qe(e.charAt(t));)t+=o;return t}function ft(e,t,o){for(var i=t>o?-1:1;;){if(t==o)return t;var s=(t+o)/2,u=i<0?Math.ceil(s):Math.floor(s);if(u==t)return e(u)?t:o;e(u)?o=u:t=u+i}}function Mt(e,t,o,i){if(!e)return i(t,o,"ltr",0);for(var s=!1,u=0;u<e.length;++u){var d=e[u];(d.from<o&&d.to>t||t==o&&d.to==t)&&(i(Math.max(d.from,t),Math.min(d.to,o),d.level==1?"rtl":"ltr",u),s=!0)}s||i(t,o,"ltr")}var br=null;function vr(e,t,o){var i;br=null;for(var s=0;s<e.length;++s){var u=e[s];if(u.from<t&&u.to>t)return s;u.to==t&&(u.from!=u.to&&o=="before"?i=s:br=s),u.from==t&&(u.from!=u.to&&o!="before"?i=s:br=s)}return i??br}var vn=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function o(b){return b<=247?e.charAt(b):1424<=b&&b<=1524?"R":1536<=b&&b<=1785?t.charAt(b-1536):1774<=b&&b<=2220?"r":8192<=b&&b<=8203?"w":b==8204?"b":"L"}var i=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,s=/[stwN]/,u=/[LRr]/,d=/[Lb1n]/,h=/[1n]/;function m(b,I,C){this.level=b,this.from=I,this.to=C}return function(b,I){var C=I=="ltr"?"L":"R";if(b.length==0||I=="ltr"&&!i.test(b))return!1;for(var B=b.length,L=[],W=0;W<B;++W)L.push(o(b.charCodeAt(W)));for(var H=0,z=C;H<B;++H){var ne=L[H];ne=="m"?L[H]=z:z=ne}for(var pe=0,ie=C;pe<B;++pe){var me=L[pe];me=="1"&&ie=="r"?L[pe]="n":u.test(me)&&(ie=me,me=="r"&&(L[pe]="R"))}for(var Ae=1,Ee=L[0];Ae<B-1;++Ae){var ke=L[Ae];ke=="+"&&Ee=="1"&&L[Ae+1]=="1"?L[Ae]="1":ke==","&&Ee==L[Ae+1]&&(Ee=="1"||Ee=="n")&&(L[Ae]=Ee),Ee=ke}for(var et=0;et<B;++et){var Lt=L[et];if(Lt==",")L[et]="N";else if(Lt=="%"){var ct=void 0;for(ct=et+1;ct<B&&L[ct]=="%";++ct);for(var dr=et&&L[et-1]=="!"||ct<B&&L[ct]=="1"?"1":"N",$t=et;$t<ct;++$t)L[$t]=dr;et=ct-1}}for(var bt=0,er=C;bt<B;++bt){var Gt=L[bt];er=="L"&&Gt=="1"?L[bt]="L":u.test(Gt)&&(er=Gt)}for(var xt=0;xt<B;++xt)if(s.test(L[xt])){var vt=void 0;for(vt=xt+1;vt<B&&s.test(L[vt]);++vt);for(var ht=(xt?L[xt-1]:C)=="L",tr=(vt<B?L[vt]:C)=="L",_i=ht==tr?ht?"L":"R":C,wn=xt;wn<vt;++wn)L[wn]=_i;xt=vt-1}for(var Vt=[],Pr,Ft=0;Ft<B;)if(d.test(L[Ft])){var Sl=Ft;for(++Ft;Ft<B&&d.test(L[Ft]);++Ft);Vt.push(new m(0,Sl,Ft))}else{var ln=Ft,jn=Vt.length,zn=I=="rtl"?1:0;for(++Ft;Ft<B&&L[Ft]!="L";++Ft);for(var Xt=ln;Xt<Ft;)if(h.test(L[Xt])){ln<Xt&&(Vt.splice(jn,0,new m(1,ln,Xt)),jn+=zn);var Ni=Xt;for(++Xt;Xt<Ft&&h.test(L[Xt]);++Xt);Vt.splice(jn,0,new m(2,Ni,Xt)),jn+=zn,ln=Xt}else++Xt;ln<Ft&&Vt.splice(jn,0,new m(1,ln,Ft))}return I=="ltr"&&(Vt[0].level==1&&(Pr=b.match(/^\s+/))&&(Vt[0].from=Pr[0].length,Vt.unshift(new m(0,0,Pr[0].length))),Te(Vt).level==1&&(Pr=b.match(/\s+$/))&&(Te(Vt).to-=Pr[0].length,Vt.push(new m(0,B-Pr[0].length,B)))),I=="rtl"?Vt.reverse():Vt}}();function Ne(e,t){var o=e.order;return o==null&&(o=e.order=vn(e.text,t)),o}var Sr=[],Ie=function(e,t,o){if(e.addEventListener)e.addEventListener(t,o,!1);else if(e.attachEvent)e.attachEvent("on"+t,o);else{var i=e._handlers||(e._handlers={});i[t]=(i[t]||Sr).concat(o)}};function yr(e,t){return e._handlers&&e._handlers[t]||Sr}function Ct(e,t,o){if(e.removeEventListener)e.removeEventListener(t,o,!1);else if(e.detachEvent)e.detachEvent("on"+t,o);else{var i=e._handlers,s=i&&i[t];if(s){var u=ue(s,o);u>-1&&(i[t]=s.slice(0,u).concat(s.slice(u+1)))}}}function Ke(e,t){var o=yr(e,t);if(o.length)for(var i=Array.prototype.slice.call(arguments,2),s=0;s<o.length;++s)o[s].apply(null,i)}function $e(e,t,o){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Ke(e,o||t.type,e,t),pt(t)||t.codemirrorIgnore}function sr(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var o=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),i=0;i<t.length;++i)ue(o,t[i])==-1&&o.push(t[i])}function yt(e,t){return yr(e,t).length>0}function xr(e){e.prototype.on=function(t,o){Ie(this,t,o)},e.prototype.off=function(t,o){Ct(this,t,o)}}function At(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function rt(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function pt(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function Wr(e){At(e),rt(e)}function yn(e){return e.target||e.srcElement}function Yt(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),q&&e.ctrlKey&&t==1&&(t=3),t}var si=function(){if(g&&y<9)return!1;var e=x("div");return"draggable"in e||"dragDrop"in e}(),en;function li(e){if(en==null){var t=x("span","\u200B");oe(e,x("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(en=t.offsetWidth<=1&&t.offsetHeight>2&&!(g&&y<8))}var o=en?x("span","\u200B"):x("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return o.setAttribute("cm-text",""),o}var Pt;function Ht(e){if(Pt!=null)return Pt;var t=oe(e,document.createTextNode("A\u062EA")),o=D(t,0,1).getBoundingClientRect(),i=D(t,1,2).getBoundingClientRect();return k(e),!o||o.left==o.right?!1:Pt=i.right-o.right<3}var jt=`
17
17
 
18
18
  b`.split(/\n/).length!=3?function(e){for(var t=0,o=[],i=e.length;t<=i;){var s=e.indexOf(`
19
- `,t);s==-1&&(s=e.length);var u=e.slice(t,e.charAt(s-1)=="\r"?s-1:s),d=u.indexOf("\r");d!=-1?(o.push(u.slice(0,d)),t+=d+1):(o.push(u),t=s+1)}return o}:function(e){return e.split(/\r\n?|\n/)},wr=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch{return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch{}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},xn=function(){var e=x("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),lr=null;function Tr(e){if(lr!=null)return lr;var t=oe(e,x("span","x")),o=t.getBoundingClientRect(),i=D(t,0,1).getBoundingClientRect();return lr=Math.abs(o.left-i.left)>1}var tn={},ur={};function fr(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),tn[e]=t}function Dr(e,t){ur[e]=t}function Tn(e){if(typeof e=="string"&&ur.hasOwnProperty(e))e=ur[e];else if(e&&typeof e.name=="string"&&ur.hasOwnProperty(e.name)){var t=ur[e.name];typeof t=="string"&&(t={name:t}),e=lt(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Tn("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Tn("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function xe(e,t){t=Tn(t);var o=tn[t.name];if(!o)return xe(e,"text/plain");var i=o(e,t);if(N.hasOwnProperty(t.name)){var s=N[t.name];for(var u in s)s.hasOwnProperty(u)&&(i.hasOwnProperty(u)&&(i["_"+u]=i[u]),i[u]=s[u])}if(i.name=t.name,t.helperType&&(i.helperType=t.helperType),t.modeProps)for(var d in t.modeProps)i[d]=t.modeProps[d];return i}var N={};function K(e,t){var o=N.hasOwnProperty(e)?N[e]:N[e]={};le(t,o)}function be(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var o={};for(var i in t){var s=t[i];s instanceof Array&&(s=s.concat([])),o[i]=s}return o}function Ye(e,t){for(var o;e.innerMode&&(o=e.innerMode(t),!(!o||o.mode==e));)t=o.state,e=o.mode;return o||{mode:e,state:t}}function dt(e,t,o){return e.startState?e.startState(t,o):!0}var Ue=function(e,t,o){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=o};Ue.prototype.eol=function(){return this.pos>=this.string.length},Ue.prototype.sol=function(){return this.pos==this.lineStart},Ue.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Ue.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Ue.prototype.eat=function(e){var t=this.string.charAt(this.pos),o;if(typeof e=="string"?o=t==e:o=t&&(e.test?e.test(t):e(t)),o)return++this.pos,t},Ue.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Ue.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Ue.prototype.skipToEnd=function(){this.pos=this.string.length},Ue.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Ue.prototype.backUp=function(e){this.pos-=e},Ue.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=ye(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?ye(this.string,this.lineStart,this.tabSize):0)},Ue.prototype.indentation=function(){return ye(this.string,null,this.tabSize)-(this.lineStart?ye(this.string,this.lineStart,this.tabSize):0)},Ue.prototype.match=function(e,t,o){if(typeof e=="string"){var i=function(d){return o?d.toLowerCase():d},s=this.string.substr(this.pos,e.length);if(i(s)==i(e))return t!==!1&&(this.pos+=e.length),!0}else{var u=this.string.slice(this.pos).match(e);return u&&u.index>0?null:(u&&t!==!1&&(this.pos+=u[0].length),u)}},Ue.prototype.current=function(){return this.string.slice(this.start,this.pos)},Ue.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Ue.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Ue.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function de(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var o=e;!o.lines;)for(var i=0;;++i){var s=o.children[i],u=s.chunkSize();if(t<u){o=s;break}t-=u}return o.lines[t]}function _t(e,t,o){var i=[],s=t.line;return e.iter(t.line,o.line+1,function(u){var d=u.text;s==o.line&&(d=d.slice(0,o.ch)),s==t.line&&(d=d.slice(t.ch)),i.push(d),++s}),i}function Cr(e,t,o){var i=[];return e.iter(t,o,function(s){i.push(s.text)}),i}function Dt(e,t){var o=t-e.height;if(o)for(var i=e;i;i=i.parent)i.height+=o}function v(e){if(e.parent==null)return null;for(var t=e.parent,o=ue(t.lines,e),i=t.parent;i;t=i,i=i.parent)for(var s=0;i.children[s]!=t;++s)o+=i.children[s].chunkSize();return o+t.first}function E(e,t){var o=e.first;e:do{for(var i=0;i<e.children.length;++i){var s=e.children[i],u=s.height;if(t<u){e=s;continue e}t-=u,o+=s.chunkSize()}return o}while(!e.lines);for(var d=0;d<e.lines.length;++d){var h=e.lines[d],m=h.height;if(t<m)break;t-=m}return o+d}function V(e,t){return t>=e.first&&t<e.first+e.size}function Y(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function O(e,t,o){if(o===void 0&&(o=null),!(this instanceof O))return new O(e,t,o);this.line=e,this.ch=t,this.sticky=o}function fe(e,t){return e.line-t.line||e.ch-t.ch}function Pe(e,t){return e.sticky==t.sticky&&fe(e,t)==0}function Rt(e){return O(e.line,e.ch)}function zt(e,t){return fe(e,t)<0?t:e}function ui(e,t){return fe(e,t)<0?e:t}function Uu(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function Se(e,t){if(t.line<e.first)return O(e.first,0);var o=e.first+e.size-1;return t.line>o?O(o,de(e,o).text.length):bm(t,de(e,t.line).text.length)}function bm(e,t){var o=e.ch;return o==null||o>t?O(e.line,t):o<0?O(e.line,0):e}function ku(e,t){for(var o=[],i=0;i<t.length;i++)o[i]=Se(e,t[i]);return o}var oa=function(e,t){this.state=e,this.lookAhead=t},Zr=function(e,t,o,i){this.state=t,this.doc=e,this.line=o,this.maxLookAhead=i||0,this.baseTokens=null,this.baseTokenPos=1};Zr.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},Zr.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},Zr.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Zr.fromSaved=function(e,t,o){return t instanceof oa?new Zr(e,be(e.mode,t.state),o,t.lookAhead):new Zr(e,be(e.mode,t),o)},Zr.prototype.save=function(e){var t=e!==!1?be(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new oa(t,this.maxLookAhead):t};function Mu(e,t,o,i){var s=[e.state.modeGen],u={};Vu(e,t.text,e.doc.mode,o,function(b,I){return s.push(b,I)},u,i);for(var d=o.state,h=function(b){o.baseTokens=s;var I=e.state.overlays[b],C=1,B=0;o.state=!0,Vu(e,t.text,I.mode,o,function(L,W){for(var H=C;B<L;){var z=s[C];z>L&&s.splice(C,1,L,s[C+1],z),C+=2,B=Math.min(L,z)}if(W)if(I.opaque)s.splice(H,C-H,L,"overlay "+W),C=H+2;else for(;H<C;H+=2){var ne=s[H+1];s[H+1]=(ne?ne+" ":"")+"overlay "+W}},u),o.state=d,o.baseTokens=null,o.baseTokenPos=1},m=0;m<e.state.overlays.length;++m)h(m);return{styles:s,classes:u.bgClass||u.textClass?u:null}}function Gu(e,t,o){if(!t.styles||t.styles[0]!=e.state.modeGen){var i=no(e,v(t)),s=t.text.length>e.options.maxHighlightLength&&be(e.doc.mode,i.state),u=Mu(e,t,i);s&&(i.state=s),t.stateAfter=i.save(!s),t.styles=u.styles,u.classes?t.styleClasses=u.classes:t.styleClasses&&(t.styleClasses=null),o===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function no(e,t,o){var i=e.doc,s=e.display;if(!i.mode.startState)return new Zr(i,!0,t);var u=vm(e,t,o),d=u>i.first&&de(i,u-1).stateAfter,h=d?Zr.fromSaved(i,d,u):new Zr(i,dt(i.mode),u);return i.iter(u,t,function(m){Os(e,m.text,h);var b=h.line;m.stateAfter=b==t-1||b%5==0||b>=s.viewFrom&&b<s.viewTo?h.save():null,h.nextLine()}),o&&(i.modeFrontier=h.line),h}function Os(e,t,o,i){var s=e.doc.mode,u=new Ue(t,e.options.tabSize,o);for(u.start=u.pos=i||0,t==""&&Ou(s,o.state);!u.eol();)Ws(s,u,o.state),u.start=u.pos}function Ou(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var o=Ye(e,t);if(o.mode.blankLine)return o.mode.blankLine(o.state)}}function Ws(e,t,o,i){for(var s=0;s<10;s++){i&&(i[0]=Ye(e,o).mode);var u=e.token(t,o);if(t.pos>t.start)return u}throw new Error("Mode "+e.name+" failed to advance stream.")}var Wu=function(e,t,o){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=o};function Du(e,t,o,i){var s=e.doc,u=s.mode,d;t=Se(s,t);var h=de(s,t.line),m=no(e,t.line,o),b=new Ue(h.text,e.options.tabSize,m),I;for(i&&(I=[]);(i||b.pos<t.ch)&&!b.eol();)b.start=b.pos,d=Ws(u,b,m.state),i&&I.push(new Wu(b,d,be(s.mode,m.state)));return i?I:new Wu(b,d,m.state)}function Zu(e,t){if(e)for(;;){var o=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!o)break;e=e.slice(0,o.index)+e.slice(o.index+o[0].length);var i=o[1]?"bgClass":"textClass";t[i]==null?t[i]=o[2]:new RegExp("(?:^|\\s)"+o[2]+"(?:$|\\s)").test(t[i])||(t[i]+=" "+o[2])}return e}function Vu(e,t,o,i,s,u,d){var h=o.flattenSpans;h==null&&(h=e.options.flattenSpans);var m=0,b=null,I=new Ue(t,e.options.tabSize,i),C,B=e.options.addModeClass&&[null];for(t==""&&Zu(Ou(o,i.state),u);!I.eol();){if(I.pos>e.options.maxHighlightLength?(h=!1,d&&Os(e,t,i,I.pos),I.pos=t.length,C=null):C=Zu(Ws(o,I,i.state,B),u),B){var L=B[0].name;L&&(C="m-"+(C?L+" "+C:L))}if(!h||b!=C){for(;m<I.start;)m=Math.min(I.start,m+5e3),s(m,b);b=C}I.start=I.pos}for(;m<I.pos;){var W=Math.min(I.pos,m+5e3);s(W,b),m=W}}function vm(e,t,o){for(var i,s,u=e.doc,d=o?-1:t-(e.doc.mode.innerMode?1e3:100),h=t;h>d;--h){if(h<=u.first)return u.first;var m=de(u,h-1),b=m.stateAfter;if(b&&(!o||h+(b instanceof oa?b.lookAhead:0)<=u.modeFrontier))return h;var I=ye(m.text,null,e.options.tabSize);(s==null||i>I)&&(s=h-1,i=I)}return s}function ym(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontier<t-10)){for(var o=e.first,i=t-1;i>o;i--){var s=de(e,i).stateAfter;if(s&&(!(s instanceof oa)||i+s.lookAhead<t)){o=i+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,o)}}var Qu=!1,rn=!1;function xm(){Qu=!0}function Tm(){rn=!0}function aa(e,t,o){this.marker=e,this.from=t,this.to=o}function io(e,t){if(e)for(var o=0;o<e.length;++o){var i=e[o];if(i.marker==t)return i}}function Im(e,t){for(var o,i=0;i<e.length;++i)e[i]!=t&&(o||(o=[])).push(e[i]);return o}function Em(e,t,o){var i=o&&window.WeakSet&&(o.markedSpans||(o.markedSpans=new WeakSet));i&&e.markedSpans&&i.has(e.markedSpans)?e.markedSpans.push(t):(e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],i&&i.add(e.markedSpans)),t.marker.attachLine(e)}function Cm(e,t,o){var i;if(e)for(var s=0;s<e.length;++s){var u=e[s],d=u.marker,h=u.from==null||(d.inclusiveLeft?u.from<=t:u.from<t);if(h||u.from==t&&d.type=="bookmark"&&(!o||!u.marker.insertLeft)){var m=u.to==null||(d.inclusiveRight?u.to>=t:u.to>t);(i||(i=[])).push(new aa(d,u.from,m?null:u.to))}}return i}function Am(e,t,o){var i;if(e)for(var s=0;s<e.length;++s){var u=e[s],d=u.marker,h=u.to==null||(d.inclusiveRight?u.to>=t:u.to>t);if(h||u.from==t&&d.type=="bookmark"&&(!o||u.marker.insertLeft)){var m=u.from==null||(d.inclusiveLeft?u.from<=t:u.from<t);(i||(i=[])).push(new aa(d,m?null:u.from-t,u.to==null?null:u.to-t))}}return i}function Ds(e,t){if(t.full)return null;var o=V(e,t.from.line)&&de(e,t.from.line).markedSpans,i=V(e,t.to.line)&&de(e,t.to.line).markedSpans;if(!o&&!i)return null;var s=t.from.ch,u=t.to.ch,d=fe(t.from,t.to)==0,h=Cm(o,s,d),m=Am(i,u,d),b=t.text.length==1,I=Te(t.text).length+(b?s:0);if(h)for(var C=0;C<h.length;++C){var B=h[C];if(B.to==null){var L=io(m,B.marker);L?b&&(B.to=L.to==null?null:L.to+I):B.to=s}}if(m)for(var W=0;W<m.length;++W){var H=m[W];if(H.to!=null&&(H.to+=I),H.from==null){var z=io(h,H.marker);z||(H.from=I,b&&(h||(h=[])).push(H))}else H.from+=I,b&&(h||(h=[])).push(H)}h&&(h=Pu(h)),m&&m!=h&&(m=Pu(m));var ne=[h];if(!b){var he=t.text.length-2,ie;if(he>0&&h)for(var me=0;me<h.length;++me)h[me].to==null&&(ie||(ie=[])).push(new aa(h[me].marker,null,null));for(var Ae=0;Ae<he;++Ae)ne.push(ie);ne.push(m)}return ne}function Pu(e){for(var t=0;t<e.length;++t){var o=e[t];o.from!=null&&o.from==o.to&&o.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function _m(e,t,o){var i=null;if(e.iter(t.line,o.line+1,function(L){if(L.markedSpans)for(var W=0;W<L.markedSpans.length;++W){var H=L.markedSpans[W].marker;H.readOnly&&(!i||ue(i,H)==-1)&&(i||(i=[])).push(H)}}),!i)return null;for(var s=[{from:t,to:o}],u=0;u<i.length;++u)for(var d=i[u],h=d.find(0),m=0;m<s.length;++m){var b=s[m];if(!(fe(b.to,h.from)<0||fe(b.from,h.to)>0)){var I=[m,1],C=fe(b.from,h.from),B=fe(b.to,h.to);(C<0||!d.inclusiveLeft&&!C)&&I.push({from:b.from,to:h.from}),(B>0||!d.inclusiveRight&&!B)&&I.push({from:h.to,to:b.to}),s.splice.apply(s,I),m+=I.length-3}}return s}function Hu(e){var t=e.markedSpans;if(t){for(var o=0;o<t.length;++o)t[o].marker.detachLine(e);e.markedSpans=null}}function Ju(e,t){if(t){for(var o=0;o<t.length;++o)t[o].marker.attachLine(e);e.markedSpans=t}}function sa(e){return e.inclusiveLeft?-1:0}function la(e){return e.inclusiveRight?1:0}function Zs(e,t){var o=e.lines.length-t.lines.length;if(o!=0)return o;var i=e.find(),s=t.find(),u=fe(i.from,s.from)||sa(e)-sa(t);if(u)return-u;var d=fe(i.to,s.to)||la(e)-la(t);return d||t.id-e.id}function Xu(e,t){var o=rn&&e.markedSpans,i;if(o)for(var s=void 0,u=0;u<o.length;++u)s=o[u],s.marker.collapsed&&(t?s.from:s.to)==null&&(!i||Zs(i,s.marker)<0)&&(i=s.marker);return i}function Yu(e){return Xu(e,!0)}function ua(e){return Xu(e,!1)}function Rm(e,t){var o=rn&&e.markedSpans,i;if(o)for(var s=0;s<o.length;++s){var u=o[s];u.marker.collapsed&&(u.from==null||u.from<t)&&(u.to==null||u.to>t)&&(!i||Zs(i,u.marker)<0)&&(i=u.marker)}return i}function ju(e,t,o,i,s){var u=de(e,t),d=rn&&u.markedSpans;if(d)for(var h=0;h<d.length;++h){var m=d[h];if(m.marker.collapsed){var b=m.marker.find(0),I=fe(b.from,o)||sa(m.marker)-sa(s),C=fe(b.to,i)||la(m.marker)-la(s);if(!(I>=0&&C<=0||I<=0&&C>=0)&&(I<=0&&(m.marker.inclusiveRight&&s.inclusiveLeft?fe(b.to,o)>=0:fe(b.to,o)>0)||I>=0&&(m.marker.inclusiveRight&&s.inclusiveLeft?fe(b.from,i)<=0:fe(b.from,i)<0)))return!0}}}function Lr(e){for(var t;t=Yu(e);)e=t.find(-1,!0).line;return e}function Nm(e){for(var t;t=ua(e);)e=t.find(1,!0).line;return e}function Sm(e){for(var t,o;t=ua(e);)e=t.find(1,!0).line,(o||(o=[])).push(e);return o}function Vs(e,t){var o=de(e,t),i=Lr(o);return o==i?t:v(i)}function zu(e,t){if(t>e.lastLine())return t;var o=de(e,t),i;if(!In(e,o))return t;for(;i=ua(o);)o=i.find(1,!0).line;return v(o)+1}function In(e,t){var o=rn&&t.markedSpans;if(o){for(var i=void 0,s=0;s<o.length;++s)if(i=o[s],!!i.marker.collapsed){if(i.from==null)return!0;if(!i.marker.widgetNode&&i.from==0&&i.marker.inclusiveLeft&&Qs(e,t,i))return!0}}}function Qs(e,t,o){if(o.to==null){var i=o.marker.find(1,!0);return Qs(e,i.line,io(i.line.markedSpans,o.marker))}if(o.marker.inclusiveRight&&o.to==t.text.length)return!0;for(var s=void 0,u=0;u<t.markedSpans.length;++u)if(s=t.markedSpans[u],s.marker.collapsed&&!s.marker.widgetNode&&s.from==o.to&&(s.to==null||s.to!=o.from)&&(s.marker.inclusiveLeft||o.marker.inclusiveRight)&&Qs(e,t,s))return!0}function nn(e){e=Lr(e);for(var t=0,o=e.parent,i=0;i<o.lines.length;++i){var s=o.lines[i];if(s==e)break;t+=s.height}for(var u=o.parent;u;o=u,u=o.parent)for(var d=0;d<u.children.length;++d){var h=u.children[d];if(h==o)break;t+=h.height}return t}function fa(e){if(e.height==0)return 0;for(var t=e.text.length,o,i=e;o=Yu(i);){var s=o.find(0,!0);i=s.from.line,t+=s.from.ch-s.to.ch}for(i=e;o=ua(i);){var u=o.find(0,!0);t-=i.text.length-u.from.ch,i=u.to.line,t+=i.text.length-u.to.ch}return t}function Ps(e){var t=e.display,o=e.doc;t.maxLine=de(o,o.first),t.maxLineLength=fa(t.maxLine),t.maxLineChanged=!0,o.iter(function(i){var s=fa(i);s>t.maxLineLength&&(t.maxLineLength=s,t.maxLine=i)})}var fi=function(e,t,o){this.text=e,Ju(this,t),this.height=o?o(this):1};fi.prototype.lineNo=function(){return v(this)},xr(fi);function wm(e,t,o,i){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),Hu(e),Ju(e,o);var s=i?i(e):1;s!=e.height&&Dt(e,s)}function Lm(e){e.parent=null,Hu(e)}var Fm={},Bm={};function qu(e,t){if(!e||/^\s*$/.test(e))return null;var o=t.addModeClass?Bm:Fm;return o[e]||(o[e]=e.replace(/\S+/g,"cm-$&"))}function Ku(e,t){var o=ee("span",null,null,T?"padding-right: .1px":null),i={pre:ee("pre",[o],"CodeMirror-line"),content:o,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var s=0;s<=(t.rest?t.rest.length:0);s++){var u=s?t.rest[s-1]:t.line,d=void 0;i.pos=0,i.addToken=km,Ht(e.display.measure)&&(d=Ne(u,e.doc.direction))&&(i.addToken=Gm(i.addToken,d)),i.map=[];var h=t!=e.display.externalMeasured&&v(u);Om(u,i,Gu(e,u,h)),u.styleClasses&&(u.styleClasses.bgClass&&(i.bgClass=Re(u.styleClasses.bgClass,i.bgClass||"")),u.styleClasses.textClass&&(i.textClass=Re(u.styleClasses.textClass,i.textClass||""))),i.map.length==0&&i.map.push(0,0,i.content.appendChild(li(e.display.measure))),s==0?(t.measure.map=i.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(i.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(T){var m=i.content.lastChild;(/\bcm-tab\b/.test(m.className)||m.querySelector&&m.querySelector(".cm-tab"))&&(i.content.className="cm-tab-wrap-hack")}return Ke(e,"renderLine",e,t.line,i.pre),i.pre.className&&(i.textClass=Re(i.pre.className,i.textClass||"")),i}function Um(e){var t=x("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function km(e,t,o,i,s,u,d){if(t){var h=e.splitSpaces?Mm(t,e.trailingSpace):t,m=e.cm.state.specialChars,b=!1,I;if(!m.test(t))e.col+=t.length,I=document.createTextNode(h),e.map.push(e.pos,e.pos+t.length,I),g&&y<9&&(b=!0),e.pos+=t.length;else{I=document.createDocumentFragment();for(var C=0;;){m.lastIndex=C;var B=m.exec(t),L=B?B.index-C:t.length-C;if(L){var W=document.createTextNode(h.slice(C,C+L));g&&y<9?I.appendChild(x("span",[W])):I.appendChild(W),e.map.push(e.pos,e.pos+L,W),e.col+=L,e.pos+=L}if(!B)break;C+=L+1;var H=void 0;if(B[0]==" "){var z=e.cm.options.tabSize,ne=z-e.col%z;H=I.appendChild(x("span",Ve(ne),"cm-tab")),H.setAttribute("role","presentation"),H.setAttribute("cm-text"," "),e.col+=ne}else B[0]=="\r"||B[0]==`
20
- `?(H=I.appendChild(x("span",B[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),H.setAttribute("cm-text",B[0]),e.col+=1):(H=e.cm.options.specialCharPlaceholder(B[0]),H.setAttribute("cm-text",B[0]),g&&y<9?I.appendChild(x("span",[H])):I.appendChild(H),e.col+=1);e.map.push(e.pos,e.pos+1,H),e.pos++}}if(e.trailingSpace=h.charCodeAt(t.length-1)==32,o||i||s||b||u||d){var he=o||"";i&&(he+=i),s&&(he+=s);var ie=x("span",[I],he,u);if(d)for(var me in d)d.hasOwnProperty(me)&&me!="style"&&me!="class"&&ie.setAttribute(me,d[me]);return e.content.appendChild(ie)}e.content.appendChild(I)}}function Mm(e,t){if(e.length>1&&!/ /.test(e))return e;for(var o=t,i="",s=0;s<e.length;s++){var u=e.charAt(s);u==" "&&o&&(s==e.length-1||e.charCodeAt(s+1)==32)&&(u="\xA0"),i+=u,o=u==" "}return i}function Gm(e,t){return function(o,i,s,u,d,h,m){s=s?s+" cm-force-border":"cm-force-border";for(var b=o.pos,I=b+i.length;;){for(var C=void 0,B=0;B<t.length&&(C=t[B],!(C.to>b&&C.from<=b));B++);if(C.to>=I)return e(o,i,s,u,d,h,m);e(o,i.slice(0,C.to-b),s,u,null,h,m),u=null,i=i.slice(C.to-b),b=C.to}}}function $u(e,t,o,i){var s=!i&&o.widgetNode;s&&e.map.push(e.pos,e.pos+t,s),!i&&e.cm.display.input.needsContentAttribute&&(s||(s=e.content.appendChild(document.createElement("span"))),s.setAttribute("cm-marker",o.id)),s&&(e.cm.display.input.setUneditable(s),e.content.appendChild(s)),e.pos+=t,e.trailingSpace=!1}function Om(e,t,o){var i=e.markedSpans,s=e.text,u=0;if(!i){for(var d=1;d<o.length;d+=2)t.addToken(t,s.slice(u,u=o[d]),qu(o[d+1],t.cm.options));return}for(var h=s.length,m=0,b=1,I="",C,B,L=0,W,H,z,ne,he;;){if(L==m){W=H=z=B="",he=null,ne=null,L=1/0;for(var ie=[],me=void 0,Ae=0;Ae<i.length;++Ae){var Ee=i[Ae],ke=Ee.marker;if(ke.type=="bookmark"&&Ee.from==m&&ke.widgetNode)ie.push(ke);else if(Ee.from<=m&&(Ee.to==null||Ee.to>m||ke.collapsed&&Ee.to==m&&Ee.from==m)){if(Ee.to!=null&&Ee.to!=m&&L>Ee.to&&(L=Ee.to,H=""),ke.className&&(W+=" "+ke.className),ke.css&&(B=(B?B+";":"")+ke.css),ke.startStyle&&Ee.from==m&&(z+=" "+ke.startStyle),ke.endStyle&&Ee.to==L&&(me||(me=[])).push(ke.endStyle,Ee.to),ke.title&&((he||(he={})).title=ke.title),ke.attributes)for(var et in ke.attributes)(he||(he={}))[et]=ke.attributes[et];ke.collapsed&&(!ne||Zs(ne.marker,ke)<0)&&(ne=Ee)}else Ee.from>m&&L>Ee.from&&(L=Ee.from)}if(me)for(var Lt=0;Lt<me.length;Lt+=2)me[Lt+1]==L&&(H+=" "+me[Lt]);if(!ne||ne.from==m)for(var ct=0;ct<ie.length;++ct)$u(t,0,ie[ct]);if(ne&&(ne.from||0)==m){if($u(t,(ne.to==null?h+1:ne.to)-m,ne.marker,ne.from==null),ne.to==null)return;ne.to==m&&(ne=!1)}}if(m>=h)break;for(var dr=Math.min(h,L);;){if(I){var $t=m+I.length;if(!ne){var bt=$t>dr?I.slice(0,dr-m):I;t.addToken(t,bt,C?C+W:W,z,m+bt.length==L?H:"",B,he)}if($t>=dr){I=I.slice(dr-m),m=dr;break}m=$t,z=""}I=s.slice(u,u=o[b++]),C=qu(o[b++],t.cm.options)}}}function ef(e,t,o){this.line=t,this.rest=Sm(t),this.size=this.rest?v(Te(this.rest))-o+1:1,this.node=this.text=null,this.hidden=In(e,t)}function ca(e,t,o){for(var i=[],s,u=t;u<o;u=s){var d=new ef(e.doc,de(e.doc,u),u);s=u+d.size,i.push(d)}return i}var ci=null;function Wm(e){ci?ci.ops.push(e):e.ownsGroup=ci={ops:[e],delayedCallbacks:[]}}function Dm(e){var t=e.delayedCallbacks,o=0;do{for(;o<t.length;o++)t[o].call(null);for(var i=0;i<e.ops.length;i++){var s=e.ops[i];if(s.cursorActivityHandlers)for(;s.cursorActivityCalled<s.cursorActivityHandlers.length;)s.cursorActivityHandlers[s.cursorActivityCalled++].call(null,s.cm)}}while(o<t.length)}function Zm(e,t){var o=e.ownsGroup;if(o)try{Dm(o)}finally{ci=null,t(o)}}var oo=null;function Nt(e,t){var o=yr(e,t);if(o.length){var i=Array.prototype.slice.call(arguments,2),s;ci?s=ci.delayedCallbacks:oo?s=oo:(s=oo=[],setTimeout(Vm,0));for(var u=function(h){s.push(function(){return o[h].apply(null,i)})},d=0;d<o.length;++d)u(d)}}function Vm(){var e=oo;oo=null;for(var t=0;t<e.length;++t)e[t]()}function tf(e,t,o,i){for(var s=0;s<t.changes.length;s++){var u=t.changes[s];u=="text"?Pm(e,t):u=="gutter"?nf(e,t,o,i):u=="class"?Hs(e,t):u=="widget"&&Hm(e,t,i)}t.changes=null}function ao(e){return e.node==e.text&&(e.node=x("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),g&&y<8&&(e.node.style.zIndex=2)),e.node}function Qm(e,t){var o=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(o&&(o+=" CodeMirror-linebackground"),t.background)o?t.background.className=o:(t.background.parentNode.removeChild(t.background),t.background=null);else if(o){var i=ao(t);t.background=i.insertBefore(x("div",null,o),i.firstChild),e.display.input.setUneditable(t.background)}}function rf(e,t){var o=e.display.externalMeasured;return o&&o.line==t.line?(e.display.externalMeasured=null,t.measure=o.measure,o.built):Ku(e,t)}function Pm(e,t){var o=t.text.className,i=rf(e,t);t.text==t.node&&(t.node=i.pre),t.text.parentNode.replaceChild(i.pre,t.text),t.text=i.pre,i.bgClass!=t.bgClass||i.textClass!=t.textClass?(t.bgClass=i.bgClass,t.textClass=i.textClass,Hs(e,t)):o&&(t.text.className=o)}function Hs(e,t){Qm(e,t),t.line.wrapClass?ao(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var o=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=o||""}function nf(e,t,o,i){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var s=ao(t);t.gutterBackground=x("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px; width: "+i.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),s.insertBefore(t.gutterBackground,t.text)}var u=t.line.gutterMarkers;if(e.options.lineNumbers||u){var d=ao(t),h=t.gutter=x("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px");if(h.setAttribute("aria-hidden","true"),e.display.input.setUneditable(h),d.insertBefore(h,t.text),t.line.gutterClass&&(h.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!u||!u["CodeMirror-linenumbers"])&&(t.lineNumber=h.appendChild(x("div",Y(e.options,o),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+i.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),u)for(var m=0;m<e.display.gutterSpecs.length;++m){var b=e.display.gutterSpecs[m].className,I=u.hasOwnProperty(b)&&u[b];I&&h.appendChild(x("div",[I],"CodeMirror-gutter-elt","left: "+i.gutterLeft[b]+"px; width: "+i.gutterWidth[b]+"px"))}}}function Hm(e,t,o){t.alignable&&(t.alignable=null);for(var i=$("CodeMirror-linewidget"),s=t.node.firstChild,u=void 0;s;s=u)u=s.nextSibling,i.test(s.className)&&t.node.removeChild(s);of(e,t,o)}function Jm(e,t,o,i){var s=rf(e,t);return t.text=t.node=s.pre,s.bgClass&&(t.bgClass=s.bgClass),s.textClass&&(t.textClass=s.textClass),Hs(e,t),nf(e,t,o,i),of(e,t,i),t.node}function of(e,t,o){if(af(e,t.line,t,o,!0),t.rest)for(var i=0;i<t.rest.length;i++)af(e,t.rest[i],t,o,!1)}function af(e,t,o,i,s){if(t.widgets)for(var u=ao(o),d=0,h=t.widgets;d<h.length;++d){var m=h[d],b=x("div",[m.node],"CodeMirror-linewidget"+(m.className?" "+m.className:""));m.handleMouseEvents||b.setAttribute("cm-ignore-events","true"),Xm(m,b,o,i),e.display.input.setUneditable(b),s&&m.above?u.insertBefore(b,o.gutter||o.text):u.appendChild(b),Nt(m,"redraw")}}function Xm(e,t,o,i){if(e.noHScroll){(o.alignable||(o.alignable=[])).push(t);var s=i.wrapperWidth;t.style.left=i.fixedPos+"px",e.coverGutter||(s-=i.gutterTotalWidth,t.style.paddingLeft=i.gutterTotalWidth+"px"),t.style.width=s+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-i.gutterTotalWidth+"px"))}function so(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!ce(document.body,e.node)){var o="position: relative;";e.coverGutter&&(o+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(o+="width: "+t.display.wrapper.clientWidth+"px;"),oe(t.display.measure,x("div",[e.node],null,o))}return e.height=e.node.parentNode.offsetHeight}function on(e,t){for(var o=yn(t);o!=e.wrapper;o=o.parentNode)if(!o||o.nodeType==1&&o.getAttribute("cm-ignore-events")=="true"||o.parentNode==e.sizer&&o!=e.mover)return!0}function da(e){return e.lineSpace.offsetTop}function Js(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function sf(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=oe(e.measure,x("pre","x","CodeMirror-line-like")),o=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,i={left:parseInt(o.paddingLeft),right:parseInt(o.paddingRight)};return!isNaN(i.left)&&!isNaN(i.right)&&(e.cachedPaddingH=i),i}function Vr(e){return Fe-e.display.nativeBarWidth}function Zn(e){return e.display.scroller.clientWidth-Vr(e)-e.display.barWidth}function Xs(e){return e.display.scroller.clientHeight-Vr(e)-e.display.barHeight}function Ym(e,t,o){var i=e.options.lineWrapping,s=i&&Zn(e);if(!t.measure.heights||i&&t.measure.width!=s){var u=t.measure.heights=[];if(i){t.measure.width=s;for(var d=t.text.firstChild.getClientRects(),h=0;h<d.length-1;h++){var m=d[h],b=d[h+1];Math.abs(m.bottom-b.bottom)>2&&u.push((m.bottom+b.top)/2-o.top)}}u.push(o.bottom-o.top)}}function lf(e,t,o){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};if(e.rest){for(var i=0;i<e.rest.length;i++)if(e.rest[i]==t)return{map:e.measure.maps[i],cache:e.measure.caches[i]};for(var s=0;s<e.rest.length;s++)if(v(e.rest[s])>o)return{map:e.measure.maps[s],cache:e.measure.caches[s],before:!0}}}function jm(e,t){t=Lr(t);var o=v(t),i=e.display.externalMeasured=new ef(e.doc,t,o);i.lineN=o;var s=i.built=Ku(e,i);return i.text=s.pre,oe(e.display.lineMeasure,s.pre),i}function uf(e,t,o,i){return Qr(e,di(e,t),o,i)}function Ys(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[Pn(e,t)];var o=e.display.externalMeasured;if(o&&t>=o.lineN&&t<o.lineN+o.size)return o}function di(e,t){var o=v(t),i=Ys(e,o);i&&!i.text?i=null:i&&i.changes&&(tf(e,i,o,$s(e)),e.curOp.forceUpdate=!0),i||(i=jm(e,t));var s=lf(i,t,o);return{line:t,view:i,rect:null,map:s.map,cache:s.cache,before:s.before,hasHeights:!1}}function Qr(e,t,o,i,s){t.before&&(o=-1);var u=o+(i||""),d;return t.cache.hasOwnProperty(u)?d=t.cache[u]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(Ym(e,t.view,t.rect),t.hasHeights=!0),d=qm(e,t,o,i),d.bogus||(t.cache[u]=d)),{left:d.left,right:d.right,top:s?d.rtop:d.top,bottom:s?d.rbottom:d.bottom}}var ff={left:0,right:0,top:0,bottom:0};function cf(e,t,o){for(var i,s,u,d,h,m,b=0;b<e.length;b+=3)if(h=e[b],m=e[b+1],t<h?(s=0,u=1,d="left"):t<m?(s=t-h,u=s+1):(b==e.length-3||t==m&&e[b+3]>t)&&(u=m-h,s=u-1,t>=m&&(d="right")),s!=null){if(i=e[b+2],h==m&&o==(i.insertLeft?"left":"right")&&(d=o),o=="left"&&s==0)for(;b&&e[b-2]==e[b-3]&&e[b-1].insertLeft;)i=e[(b-=3)+2],d="left";if(o=="right"&&s==m-h)for(;b<e.length-3&&e[b+3]==e[b+4]&&!e[b+5].insertLeft;)i=e[(b+=3)+2],d="right";break}return{node:i,start:s,end:u,collapse:d,coverStart:h,coverEnd:m}}function zm(e,t){var o=ff;if(t=="left")for(var i=0;i<e.length&&(o=e[i]).left==o.right;i++);else for(var s=e.length-1;s>=0&&(o=e[s]).left==o.right;s--);return o}function qm(e,t,o,i){var s=cf(t.map,o,i),u=s.node,d=s.start,h=s.end,m=s.collapse,b;if(u.nodeType==3){for(var I=0;I<4;I++){for(;d&&qe(t.line.text.charAt(s.coverStart+d));)--d;for(;s.coverStart+h<s.coverEnd&&qe(t.line.text.charAt(s.coverStart+h));)++h;if(g&&y<9&&d==0&&h==s.coverEnd-s.coverStart?b=u.parentNode.getBoundingClientRect():b=zm(D(u,d,h).getClientRects(),i),b.left||b.right||d==0)break;h=d,d=d-1,m="right"}g&&y<11&&(b=Km(e.display.measure,b))}else{d>0&&(m=i="right");var C;e.options.lineWrapping&&(C=u.getClientRects()).length>1?b=C[i=="right"?C.length-1:0]:b=u.getBoundingClientRect()}if(g&&y<9&&!d&&(!b||!b.left&&!b.right)){var B=u.parentNode.getClientRects()[0];B?b={left:B.left,right:B.left+pi(e.display),top:B.top,bottom:B.bottom}:b=ff}for(var L=b.top-t.rect.top,W=b.bottom-t.rect.top,H=(L+W)/2,z=t.view.measure.heights,ne=0;ne<z.length-1&&!(H<z[ne]);ne++);var he=ne?z[ne-1]:0,ie=z[ne],me={left:(m=="right"?b.right:b.left)-t.rect.left,right:(m=="left"?b.left:b.right)-t.rect.left,top:he,bottom:ie};return!b.left&&!b.right&&(me.bogus=!0),e.options.singleCursorHeightPerLine||(me.rtop=L,me.rbottom=W),me}function Km(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Tr(e))return t;var o=screen.logicalXDPI/screen.deviceXDPI,i=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*o,right:t.right*o,top:t.top*i,bottom:t.bottom*i}}function df(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function hf(e){e.display.externalMeasure=null,k(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)df(e.display.view[t])}function lo(e){hf(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function pf(e){return A&&G?-(e.body.getBoundingClientRect().left-parseInt(getComputedStyle(e.body).marginLeft)):e.defaultView.pageXOffset||(e.documentElement||e.body).scrollLeft}function gf(e){return A&&G?-(e.body.getBoundingClientRect().top-parseInt(getComputedStyle(e.body).marginTop)):e.defaultView.pageYOffset||(e.documentElement||e.body).scrollTop}function js(e){var t=Lr(e),o=t.widgets,i=0;if(o)for(var s=0;s<o.length;++s)o[s].above&&(i+=so(o[s]));return i}function ha(e,t,o,i,s){if(!s){var u=js(t);o.top+=u,o.bottom+=u}if(i=="line")return o;i||(i="local");var d=nn(t);if(i=="local"?d+=da(e.display):d-=e.display.viewOffset,i=="page"||i=="window"){var h=e.display.lineSpace.getBoundingClientRect();d+=h.top+(i=="window"?0:gf(re(e)));var m=h.left+(i=="window"?0:pf(re(e)));o.left+=m,o.right+=m}return o.top+=d,o.bottom+=d,o}function mf(e,t,o){if(o=="div")return t;var i=t.left,s=t.top;if(o=="page")i-=pf(re(e)),s-=gf(re(e));else if(o=="local"||!o){var u=e.display.sizer.getBoundingClientRect();i+=u.left,s+=u.top}var d=e.display.lineSpace.getBoundingClientRect();return{left:i-d.left,top:s-d.top}}function pa(e,t,o,i,s){return i||(i=de(e.doc,t.line)),ha(e,i,uf(e,i,t.ch,s),o)}function Fr(e,t,o,i,s,u){i=i||de(e.doc,t.line),s||(s=di(e,i));function d(W,H){var z=Qr(e,s,W,H?"right":"left",u);return H?z.left=z.right:z.right=z.left,ha(e,i,z,o)}var h=Ne(i,e.doc.direction),m=t.ch,b=t.sticky;if(m>=i.text.length?(m=i.text.length,b="before"):m<=0&&(m=0,b="after"),!h)return d(b=="before"?m-1:m,b=="before");function I(W,H,z){var ne=h[H],he=ne.level==1;return d(z?W-1:W,he!=z)}var C=vr(h,m,b),B=br,L=I(m,C,b=="before");return B!=null&&(L.other=I(m,B,b!="before")),L}function bf(e,t){var o=0;t=Se(e.doc,t),e.options.lineWrapping||(o=pi(e.display)*t.ch);var i=de(e.doc,t.line),s=nn(i)+da(e.display);return{left:o,right:o,top:s,bottom:s+i.height}}function zs(e,t,o,i,s){var u=O(e,t,o);return u.xRel=s,i&&(u.outside=i),u}function qs(e,t,o){var i=e.doc;if(o+=e.display.viewOffset,o<0)return zs(i.first,0,null,-1,-1);var s=E(i,o),u=i.first+i.size-1;if(s>u)return zs(i.first+i.size-1,de(i,u).text.length,null,1,1);t<0&&(t=0);for(var d=de(i,s);;){var h=$m(e,d,s,t,o),m=Rm(d,h.ch+(h.xRel>0||h.outside>0?1:0));if(!m)return h;var b=m.find(1);if(b.line==s)return b;d=de(i,s=b.line)}}function vf(e,t,o,i){i-=js(t);var s=t.text.length,u=ft(function(d){return Qr(e,o,d-1).bottom<=i},s,0);return s=ft(function(d){return Qr(e,o,d).top>i},u,s),{begin:u,end:s}}function yf(e,t,o,i){o||(o=di(e,t));var s=ha(e,t,Qr(e,o,i),"line").top;return vf(e,t,o,s)}function Ks(e,t,o,i){return e.bottom<=o?!1:e.top>o?!0:(i?e.left:e.right)>t}function $m(e,t,o,i,s){s-=nn(t);var u=di(e,t),d=js(t),h=0,m=t.text.length,b=!0,I=Ne(t,e.doc.direction);if(I){var C=(e.options.lineWrapping?t0:e0)(e,t,o,u,I,i,s);b=C.level!=1,h=b?C.from:C.to-1,m=b?C.to:C.from-1}var B=null,L=null,W=ft(function(Ae){var Ee=Qr(e,u,Ae);return Ee.top+=d,Ee.bottom+=d,Ks(Ee,i,s,!1)?(Ee.top<=s&&Ee.left<=i&&(B=Ae,L=Ee),!0):!1},h,m),H,z,ne=!1;if(L){var he=i-L.left<L.right-i,ie=he==b;W=B+(ie?0:1),z=ie?"after":"before",H=he?L.left:L.right}else{!b&&(W==m||W==h)&&W++,z=W==0?"after":W==t.text.length?"before":Qr(e,u,W-(b?1:0)).bottom+d<=s==b?"after":"before";var me=Fr(e,O(o,W,z),"line",t,u);H=me.left,ne=s<me.top?-1:s>=me.bottom?1:0}return W=kt(t.text,W,1),zs(o,W,z,ne,i-H)}function e0(e,t,o,i,s,u,d){var h=ft(function(C){var B=s[C],L=B.level!=1;return Ks(Fr(e,O(o,L?B.to:B.from,L?"before":"after"),"line",t,i),u,d,!0)},0,s.length-1),m=s[h];if(h>0){var b=m.level!=1,I=Fr(e,O(o,b?m.from:m.to,b?"after":"before"),"line",t,i);Ks(I,u,d,!0)&&I.top>d&&(m=s[h-1])}return m}function t0(e,t,o,i,s,u,d){var h=vf(e,t,i,d),m=h.begin,b=h.end;/\s/.test(t.text.charAt(b-1))&&b--;for(var I=null,C=null,B=0;B<s.length;B++){var L=s[B];if(!(L.from>=b||L.to<=m)){var W=L.level!=1,H=Qr(e,i,W?Math.min(b,L.to)-1:Math.max(m,L.from)).right,z=H<u?u-H+1e9:H-u;(!I||C>z)&&(I=L,C=z)}}return I||(I=s[s.length-1]),I.from<m&&(I={from:m,to:I.to,level:I.level}),I.to>b&&(I={from:I.from,to:b,level:I.level}),I}var Vn;function hi(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(Vn==null){Vn=x("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Vn.appendChild(document.createTextNode("x")),Vn.appendChild(x("br"));Vn.appendChild(document.createTextNode("x"))}oe(e.measure,Vn);var o=Vn.offsetHeight/50;return o>3&&(e.cachedTextHeight=o),k(e.measure),o||1}function pi(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=x("span","xxxxxxxxxx"),o=x("pre",[t],"CodeMirror-line-like");oe(e.measure,o);var i=t.getBoundingClientRect(),s=(i.right-i.left)/10;return s>2&&(e.cachedCharWidth=s),s||10}function $s(e){for(var t=e.display,o={},i={},s=t.gutters.clientLeft,u=t.gutters.firstChild,d=0;u;u=u.nextSibling,++d){var h=e.display.gutterSpecs[d].className;o[h]=u.offsetLeft+u.clientLeft+s,i[h]=u.clientWidth}return{fixedPos:el(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:o,gutterWidth:i,wrapperWidth:t.wrapper.clientWidth}}function el(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function xf(e){var t=hi(e.display),o=e.options.lineWrapping,i=o&&Math.max(5,e.display.scroller.clientWidth/pi(e.display)-3);return function(s){if(In(e.doc,s))return 0;var u=0;if(s.widgets)for(var d=0;d<s.widgets.length;d++)s.widgets[d].height&&(u+=s.widgets[d].height);return o?u+(Math.ceil(s.text.length/i)||1)*t:u+t}}function tl(e){var t=e.doc,o=xf(e);t.iter(function(i){var s=o(i);s!=i.height&&Dt(i,s)})}function Qn(e,t,o,i){var s=e.display;if(!o&&yn(t).getAttribute("cm-not-content")=="true")return null;var u,d,h=s.lineSpace.getBoundingClientRect();try{u=t.clientX-h.left,d=t.clientY-h.top}catch{return null}var m=qs(e,u,d),b;if(i&&m.xRel>0&&(b=de(e.doc,m.line).text).length==m.ch){var I=ye(b,b.length,e.options.tabSize)-b.length;m=O(m.line,Math.max(0,Math.round((u-sf(e.display).left)/pi(e.display))-I))}return m}function Pn(e,t){if(t>=e.display.viewTo||(t-=e.display.viewFrom,t<0))return null;for(var o=e.display.view,i=0;i<o.length;i++)if(t-=o[i].size,t<0)return i}function qt(e,t,o,i){t==null&&(t=e.doc.first),o==null&&(o=e.doc.first+e.doc.size),i||(i=0);var s=e.display;if(i&&o<s.viewTo&&(s.updateLineNumbers==null||s.updateLineNumbers>t)&&(s.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=s.viewTo)rn&&Vs(e.doc,t)<s.viewTo&&Cn(e);else if(o<=s.viewFrom)rn&&zu(e.doc,o+i)>s.viewFrom?Cn(e):(s.viewFrom+=i,s.viewTo+=i);else if(t<=s.viewFrom&&o>=s.viewTo)Cn(e);else if(t<=s.viewFrom){var u=ga(e,o,o+i,1);u?(s.view=s.view.slice(u.index),s.viewFrom=u.lineN,s.viewTo+=i):Cn(e)}else if(o>=s.viewTo){var d=ga(e,t,t,-1);d?(s.view=s.view.slice(0,d.index),s.viewTo=d.lineN):Cn(e)}else{var h=ga(e,t,t,-1),m=ga(e,o,o+i,1);h&&m?(s.view=s.view.slice(0,h.index).concat(ca(e,h.lineN,m.lineN)).concat(s.view.slice(m.index)),s.viewTo+=i):Cn(e)}var b=s.externalMeasured;b&&(o<b.lineN?b.lineN+=i:t<b.lineN+b.size&&(s.externalMeasured=null))}function En(e,t,o){e.curOp.viewChanged=!0;var i=e.display,s=e.display.externalMeasured;if(s&&t>=s.lineN&&t<s.lineN+s.size&&(i.externalMeasured=null),!(t<i.viewFrom||t>=i.viewTo)){var u=i.view[Pn(e,t)];if(u.node!=null){var d=u.changes||(u.changes=[]);ue(d,o)==-1&&d.push(o)}}}function Cn(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function ga(e,t,o,i){var s=Pn(e,t),u,d=e.display.view;if(!rn||o==e.doc.first+e.doc.size)return{index:s,lineN:o};for(var h=e.display.viewFrom,m=0;m<s;m++)h+=d[m].size;if(h!=t){if(i>0){if(s==d.length-1)return null;u=h+d[s].size-t,s++}else u=h-t;t+=u,o+=u}for(;Vs(e.doc,o)!=o;){if(s==(i<0?0:d.length-1))return null;o+=i*d[s-(i<0?1:0)].size,s+=i}return{index:s,lineN:o}}function r0(e,t,o){var i=e.display,s=i.view;s.length==0||t>=i.viewTo||o<=i.viewFrom?(i.view=ca(e,t,o),i.viewFrom=t):(i.viewFrom>t?i.view=ca(e,t,i.viewFrom).concat(i.view):i.viewFrom<t&&(i.view=i.view.slice(Pn(e,t))),i.viewFrom=t,i.viewTo<o?i.view=i.view.concat(ca(e,i.viewTo,o)):i.viewTo>o&&(i.view=i.view.slice(0,Pn(e,o)))),i.viewTo=o}function Tf(e){for(var t=e.display.view,o=0,i=0;i<t.length;i++){var s=t[i];!s.hidden&&(!s.node||s.changes)&&++o}return o}function uo(e){e.display.input.showSelection(e.display.input.prepareSelection())}function If(e,t){t===void 0&&(t=!0);var o=e.doc,i={},s=i.cursors=document.createDocumentFragment(),u=i.selection=document.createDocumentFragment(),d=e.options.$customCursor;d&&(t=!0);for(var h=0;h<o.sel.ranges.length;h++)if(!(!t&&h==o.sel.primIndex)){var m=o.sel.ranges[h];if(!(m.from().line>=e.display.viewTo||m.to().line<e.display.viewFrom)){var b=m.empty();if(d){var I=d(e,m);I&&rl(e,I,s)}else(b||e.options.showCursorWhenSelecting)&&rl(e,m.head,s);b||n0(e,m,u)}}return i}function rl(e,t,o){var i=Fr(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),s=o.appendChild(x("div","\xA0","CodeMirror-cursor"));if(s.style.left=i.left+"px",s.style.top=i.top+"px",s.style.height=Math.max(0,i.bottom-i.top)*e.options.cursorHeight+"px",/\bcm-fat-cursor\b/.test(e.getWrapperElement().className)){var u=pa(e,t,"div",null,null),d=u.right-u.left;s.style.width=(d>0?d:e.defaultCharWidth())+"px"}if(i.other){var h=o.appendChild(x("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));h.style.display="",h.style.left=i.other.left+"px",h.style.top=i.other.top+"px",h.style.height=(i.other.bottom-i.other.top)*.85+"px"}}function ma(e,t){return e.top-t.top||e.left-t.left}function n0(e,t,o){var i=e.display,s=e.doc,u=document.createDocumentFragment(),d=sf(e.display),h=d.left,m=Math.max(i.sizerWidth,Zn(e)-i.sizer.offsetLeft)-d.right,b=s.direction=="ltr";function I(ie,me,Ae,Ee){me<0&&(me=0),me=Math.round(me),Ee=Math.round(Ee),u.appendChild(x("div",null,"CodeMirror-selected","position: absolute; left: "+ie+`px;
19
+ `,t);s==-1&&(s=e.length);var u=e.slice(t,e.charAt(s-1)=="\r"?s-1:s),d=u.indexOf("\r");d!=-1?(o.push(u.slice(0,d)),t+=d+1):(o.push(u),t=s+1)}return o}:function(e){return e.split(/\r\n?|\n/)},wr=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch{return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch{}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},xn=function(){var e=x("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),lr=null;function Tr(e){if(lr!=null)return lr;var t=oe(e,x("span","x")),o=t.getBoundingClientRect(),i=D(t,0,1).getBoundingClientRect();return lr=Math.abs(o.left-i.left)>1}var tn={},ur={};function fr(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),tn[e]=t}function Dr(e,t){ur[e]=t}function Tn(e){if(typeof e=="string"&&ur.hasOwnProperty(e))e=ur[e];else if(e&&typeof e.name=="string"&&ur.hasOwnProperty(e.name)){var t=ur[e.name];typeof t=="string"&&(t={name:t}),e=lt(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Tn("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Tn("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function xe(e,t){t=Tn(t);var o=tn[t.name];if(!o)return xe(e,"text/plain");var i=o(e,t);if(N.hasOwnProperty(t.name)){var s=N[t.name];for(var u in s)s.hasOwnProperty(u)&&(i.hasOwnProperty(u)&&(i["_"+u]=i[u]),i[u]=s[u])}if(i.name=t.name,t.helperType&&(i.helperType=t.helperType),t.modeProps)for(var d in t.modeProps)i[d]=t.modeProps[d];return i}var N={};function K(e,t){var o=N.hasOwnProperty(e)?N[e]:N[e]={};le(t,o)}function be(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var o={};for(var i in t){var s=t[i];s instanceof Array&&(s=s.concat([])),o[i]=s}return o}function Ye(e,t){for(var o;e.innerMode&&(o=e.innerMode(t),!(!o||o.mode==e));)t=o.state,e=o.mode;return o||{mode:e,state:t}}function dt(e,t,o){return e.startState?e.startState(t,o):!0}var Ue=function(e,t,o){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=o};Ue.prototype.eol=function(){return this.pos>=this.string.length},Ue.prototype.sol=function(){return this.pos==this.lineStart},Ue.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Ue.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Ue.prototype.eat=function(e){var t=this.string.charAt(this.pos),o;if(typeof e=="string"?o=t==e:o=t&&(e.test?e.test(t):e(t)),o)return++this.pos,t},Ue.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Ue.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Ue.prototype.skipToEnd=function(){this.pos=this.string.length},Ue.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Ue.prototype.backUp=function(e){this.pos-=e},Ue.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=ye(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?ye(this.string,this.lineStart,this.tabSize):0)},Ue.prototype.indentation=function(){return ye(this.string,null,this.tabSize)-(this.lineStart?ye(this.string,this.lineStart,this.tabSize):0)},Ue.prototype.match=function(e,t,o){if(typeof e=="string"){var i=function(d){return o?d.toLowerCase():d},s=this.string.substr(this.pos,e.length);if(i(s)==i(e))return t!==!1&&(this.pos+=e.length),!0}else{var u=this.string.slice(this.pos).match(e);return u&&u.index>0?null:(u&&t!==!1&&(this.pos+=u[0].length),u)}},Ue.prototype.current=function(){return this.string.slice(this.start,this.pos)},Ue.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Ue.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Ue.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function he(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var o=e;!o.lines;)for(var i=0;;++i){var s=o.children[i],u=s.chunkSize();if(t<u){o=s;break}t-=u}return o.lines[t]}function Rt(e,t,o){var i=[],s=t.line;return e.iter(t.line,o.line+1,function(u){var d=u.text;s==o.line&&(d=d.slice(0,o.ch)),s==t.line&&(d=d.slice(t.ch)),i.push(d),++s}),i}function Cr(e,t,o){var i=[];return e.iter(t,o,function(s){i.push(s.text)}),i}function Dt(e,t){var o=t-e.height;if(o)for(var i=e;i;i=i.parent)i.height+=o}function v(e){if(e.parent==null)return null;for(var t=e.parent,o=ue(t.lines,e),i=t.parent;i;t=i,i=i.parent)for(var s=0;i.children[s]!=t;++s)o+=i.children[s].chunkSize();return o+t.first}function E(e,t){var o=e.first;e:do{for(var i=0;i<e.children.length;++i){var s=e.children[i],u=s.height;if(t<u){e=s;continue e}t-=u,o+=s.chunkSize()}return o}while(!e.lines);for(var d=0;d<e.lines.length;++d){var h=e.lines[d],m=h.height;if(t<m)break;t-=m}return o+d}function V(e,t){return t>=e.first&&t<e.first+e.size}function Y(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function O(e,t,o){if(o===void 0&&(o=null),!(this instanceof O))return new O(e,t,o);this.line=e,this.ch=t,this.sticky=o}function ce(e,t){return e.line-t.line||e.ch-t.ch}function Pe(e,t){return e.sticky==t.sticky&&ce(e,t)==0}function _t(e){return O(e.line,e.ch)}function zt(e,t){return ce(e,t)<0?t:e}function ui(e,t){return ce(e,t)<0?e:t}function Uu(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function Se(e,t){if(t.line<e.first)return O(e.first,0);var o=e.first+e.size-1;return t.line>o?O(o,he(e,o).text.length):bm(t,he(e,t.line).text.length)}function bm(e,t){var o=e.ch;return o==null||o>t?O(e.line,t):o<0?O(e.line,0):e}function ku(e,t){for(var o=[],i=0;i<t.length;i++)o[i]=Se(e,t[i]);return o}var oa=function(e,t){this.state=e,this.lookAhead=t},Zr=function(e,t,o,i){this.state=t,this.doc=e,this.line=o,this.maxLookAhead=i||0,this.baseTokens=null,this.baseTokenPos=1};Zr.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},Zr.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},Zr.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Zr.fromSaved=function(e,t,o){return t instanceof oa?new Zr(e,be(e.mode,t.state),o,t.lookAhead):new Zr(e,be(e.mode,t),o)},Zr.prototype.save=function(e){var t=e!==!1?be(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new oa(t,this.maxLookAhead):t};function Mu(e,t,o,i){var s=[e.state.modeGen],u={};Vu(e,t.text,e.doc.mode,o,function(b,I){return s.push(b,I)},u,i);for(var d=o.state,h=function(b){o.baseTokens=s;var I=e.state.overlays[b],C=1,B=0;o.state=!0,Vu(e,t.text,I.mode,o,function(L,W){for(var H=C;B<L;){var z=s[C];z>L&&s.splice(C,1,L,s[C+1],z),C+=2,B=Math.min(L,z)}if(W)if(I.opaque)s.splice(H,C-H,L,"overlay "+W),C=H+2;else for(;H<C;H+=2){var ne=s[H+1];s[H+1]=(ne?ne+" ":"")+"overlay "+W}},u),o.state=d,o.baseTokens=null,o.baseTokenPos=1},m=0;m<e.state.overlays.length;++m)h(m);return{styles:s,classes:u.bgClass||u.textClass?u:null}}function Gu(e,t,o){if(!t.styles||t.styles[0]!=e.state.modeGen){var i=no(e,v(t)),s=t.text.length>e.options.maxHighlightLength&&be(e.doc.mode,i.state),u=Mu(e,t,i);s&&(i.state=s),t.stateAfter=i.save(!s),t.styles=u.styles,u.classes?t.styleClasses=u.classes:t.styleClasses&&(t.styleClasses=null),o===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function no(e,t,o){var i=e.doc,s=e.display;if(!i.mode.startState)return new Zr(i,!0,t);var u=vm(e,t,o),d=u>i.first&&he(i,u-1).stateAfter,h=d?Zr.fromSaved(i,d,u):new Zr(i,dt(i.mode),u);return i.iter(u,t,function(m){Os(e,m.text,h);var b=h.line;m.stateAfter=b==t-1||b%5==0||b>=s.viewFrom&&b<s.viewTo?h.save():null,h.nextLine()}),o&&(i.modeFrontier=h.line),h}function Os(e,t,o,i){var s=e.doc.mode,u=new Ue(t,e.options.tabSize,o);for(u.start=u.pos=i||0,t==""&&Ou(s,o.state);!u.eol();)Ws(s,u,o.state),u.start=u.pos}function Ou(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var o=Ye(e,t);if(o.mode.blankLine)return o.mode.blankLine(o.state)}}function Ws(e,t,o,i){for(var s=0;s<10;s++){i&&(i[0]=Ye(e,o).mode);var u=e.token(t,o);if(t.pos>t.start)return u}throw new Error("Mode "+e.name+" failed to advance stream.")}var Wu=function(e,t,o){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=o};function Du(e,t,o,i){var s=e.doc,u=s.mode,d;t=Se(s,t);var h=he(s,t.line),m=no(e,t.line,o),b=new Ue(h.text,e.options.tabSize,m),I;for(i&&(I=[]);(i||b.pos<t.ch)&&!b.eol();)b.start=b.pos,d=Ws(u,b,m.state),i&&I.push(new Wu(b,d,be(s.mode,m.state)));return i?I:new Wu(b,d,m.state)}function Zu(e,t){if(e)for(;;){var o=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!o)break;e=e.slice(0,o.index)+e.slice(o.index+o[0].length);var i=o[1]?"bgClass":"textClass";t[i]==null?t[i]=o[2]:new RegExp("(?:^|\\s)"+o[2]+"(?:$|\\s)").test(t[i])||(t[i]+=" "+o[2])}return e}function Vu(e,t,o,i,s,u,d){var h=o.flattenSpans;h==null&&(h=e.options.flattenSpans);var m=0,b=null,I=new Ue(t,e.options.tabSize,i),C,B=e.options.addModeClass&&[null];for(t==""&&Zu(Ou(o,i.state),u);!I.eol();){if(I.pos>e.options.maxHighlightLength?(h=!1,d&&Os(e,t,i,I.pos),I.pos=t.length,C=null):C=Zu(Ws(o,I,i.state,B),u),B){var L=B[0].name;L&&(C="m-"+(C?L+" "+C:L))}if(!h||b!=C){for(;m<I.start;)m=Math.min(I.start,m+5e3),s(m,b);b=C}I.start=I.pos}for(;m<I.pos;){var W=Math.min(I.pos,m+5e3);s(W,b),m=W}}function vm(e,t,o){for(var i,s,u=e.doc,d=o?-1:t-(e.doc.mode.innerMode?1e3:100),h=t;h>d;--h){if(h<=u.first)return u.first;var m=he(u,h-1),b=m.stateAfter;if(b&&(!o||h+(b instanceof oa?b.lookAhead:0)<=u.modeFrontier))return h;var I=ye(m.text,null,e.options.tabSize);(s==null||i>I)&&(s=h-1,i=I)}return s}function ym(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontier<t-10)){for(var o=e.first,i=t-1;i>o;i--){var s=he(e,i).stateAfter;if(s&&(!(s instanceof oa)||i+s.lookAhead<t)){o=i+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,o)}}var Qu=!1,rn=!1;function xm(){Qu=!0}function Tm(){rn=!0}function aa(e,t,o){this.marker=e,this.from=t,this.to=o}function io(e,t){if(e)for(var o=0;o<e.length;++o){var i=e[o];if(i.marker==t)return i}}function Im(e,t){for(var o,i=0;i<e.length;++i)e[i]!=t&&(o||(o=[])).push(e[i]);return o}function Em(e,t,o){var i=o&&window.WeakSet&&(o.markedSpans||(o.markedSpans=new WeakSet));i&&e.markedSpans&&i.has(e.markedSpans)?e.markedSpans.push(t):(e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],i&&i.add(e.markedSpans)),t.marker.attachLine(e)}function Cm(e,t,o){var i;if(e)for(var s=0;s<e.length;++s){var u=e[s],d=u.marker,h=u.from==null||(d.inclusiveLeft?u.from<=t:u.from<t);if(h||u.from==t&&d.type=="bookmark"&&(!o||!u.marker.insertLeft)){var m=u.to==null||(d.inclusiveRight?u.to>=t:u.to>t);(i||(i=[])).push(new aa(d,u.from,m?null:u.to))}}return i}function Am(e,t,o){var i;if(e)for(var s=0;s<e.length;++s){var u=e[s],d=u.marker,h=u.to==null||(d.inclusiveRight?u.to>=t:u.to>t);if(h||u.from==t&&d.type=="bookmark"&&(!o||u.marker.insertLeft)){var m=u.from==null||(d.inclusiveLeft?u.from<=t:u.from<t);(i||(i=[])).push(new aa(d,m?null:u.from-t,u.to==null?null:u.to-t))}}return i}function Ds(e,t){if(t.full)return null;var o=V(e,t.from.line)&&he(e,t.from.line).markedSpans,i=V(e,t.to.line)&&he(e,t.to.line).markedSpans;if(!o&&!i)return null;var s=t.from.ch,u=t.to.ch,d=ce(t.from,t.to)==0,h=Cm(o,s,d),m=Am(i,u,d),b=t.text.length==1,I=Te(t.text).length+(b?s:0);if(h)for(var C=0;C<h.length;++C){var B=h[C];if(B.to==null){var L=io(m,B.marker);L?b&&(B.to=L.to==null?null:L.to+I):B.to=s}}if(m)for(var W=0;W<m.length;++W){var H=m[W];if(H.to!=null&&(H.to+=I),H.from==null){var z=io(h,H.marker);z||(H.from=I,b&&(h||(h=[])).push(H))}else H.from+=I,b&&(h||(h=[])).push(H)}h&&(h=Pu(h)),m&&m!=h&&(m=Pu(m));var ne=[h];if(!b){var pe=t.text.length-2,ie;if(pe>0&&h)for(var me=0;me<h.length;++me)h[me].to==null&&(ie||(ie=[])).push(new aa(h[me].marker,null,null));for(var Ae=0;Ae<pe;++Ae)ne.push(ie);ne.push(m)}return ne}function Pu(e){for(var t=0;t<e.length;++t){var o=e[t];o.from!=null&&o.from==o.to&&o.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function Rm(e,t,o){var i=null;if(e.iter(t.line,o.line+1,function(L){if(L.markedSpans)for(var W=0;W<L.markedSpans.length;++W){var H=L.markedSpans[W].marker;H.readOnly&&(!i||ue(i,H)==-1)&&(i||(i=[])).push(H)}}),!i)return null;for(var s=[{from:t,to:o}],u=0;u<i.length;++u)for(var d=i[u],h=d.find(0),m=0;m<s.length;++m){var b=s[m];if(!(ce(b.to,h.from)<0||ce(b.from,h.to)>0)){var I=[m,1],C=ce(b.from,h.from),B=ce(b.to,h.to);(C<0||!d.inclusiveLeft&&!C)&&I.push({from:b.from,to:h.from}),(B>0||!d.inclusiveRight&&!B)&&I.push({from:h.to,to:b.to}),s.splice.apply(s,I),m+=I.length-3}}return s}function Hu(e){var t=e.markedSpans;if(t){for(var o=0;o<t.length;++o)t[o].marker.detachLine(e);e.markedSpans=null}}function Ju(e,t){if(t){for(var o=0;o<t.length;++o)t[o].marker.attachLine(e);e.markedSpans=t}}function sa(e){return e.inclusiveLeft?-1:0}function la(e){return e.inclusiveRight?1:0}function Zs(e,t){var o=e.lines.length-t.lines.length;if(o!=0)return o;var i=e.find(),s=t.find(),u=ce(i.from,s.from)||sa(e)-sa(t);if(u)return-u;var d=ce(i.to,s.to)||la(e)-la(t);return d||t.id-e.id}function Xu(e,t){var o=rn&&e.markedSpans,i;if(o)for(var s=void 0,u=0;u<o.length;++u)s=o[u],s.marker.collapsed&&(t?s.from:s.to)==null&&(!i||Zs(i,s.marker)<0)&&(i=s.marker);return i}function Yu(e){return Xu(e,!0)}function ua(e){return Xu(e,!1)}function _m(e,t){var o=rn&&e.markedSpans,i;if(o)for(var s=0;s<o.length;++s){var u=o[s];u.marker.collapsed&&(u.from==null||u.from<t)&&(u.to==null||u.to>t)&&(!i||Zs(i,u.marker)<0)&&(i=u.marker)}return i}function ju(e,t,o,i,s){var u=he(e,t),d=rn&&u.markedSpans;if(d)for(var h=0;h<d.length;++h){var m=d[h];if(m.marker.collapsed){var b=m.marker.find(0),I=ce(b.from,o)||sa(m.marker)-sa(s),C=ce(b.to,i)||la(m.marker)-la(s);if(!(I>=0&&C<=0||I<=0&&C>=0)&&(I<=0&&(m.marker.inclusiveRight&&s.inclusiveLeft?ce(b.to,o)>=0:ce(b.to,o)>0)||I>=0&&(m.marker.inclusiveRight&&s.inclusiveLeft?ce(b.from,i)<=0:ce(b.from,i)<0)))return!0}}}function Lr(e){for(var t;t=Yu(e);)e=t.find(-1,!0).line;return e}function Nm(e){for(var t;t=ua(e);)e=t.find(1,!0).line;return e}function Sm(e){for(var t,o;t=ua(e);)e=t.find(1,!0).line,(o||(o=[])).push(e);return o}function Vs(e,t){var o=he(e,t),i=Lr(o);return o==i?t:v(i)}function zu(e,t){if(t>e.lastLine())return t;var o=he(e,t),i;if(!In(e,o))return t;for(;i=ua(o);)o=i.find(1,!0).line;return v(o)+1}function In(e,t){var o=rn&&t.markedSpans;if(o){for(var i=void 0,s=0;s<o.length;++s)if(i=o[s],!!i.marker.collapsed){if(i.from==null)return!0;if(!i.marker.widgetNode&&i.from==0&&i.marker.inclusiveLeft&&Qs(e,t,i))return!0}}}function Qs(e,t,o){if(o.to==null){var i=o.marker.find(1,!0);return Qs(e,i.line,io(i.line.markedSpans,o.marker))}if(o.marker.inclusiveRight&&o.to==t.text.length)return!0;for(var s=void 0,u=0;u<t.markedSpans.length;++u)if(s=t.markedSpans[u],s.marker.collapsed&&!s.marker.widgetNode&&s.from==o.to&&(s.to==null||s.to!=o.from)&&(s.marker.inclusiveLeft||o.marker.inclusiveRight)&&Qs(e,t,s))return!0}function nn(e){e=Lr(e);for(var t=0,o=e.parent,i=0;i<o.lines.length;++i){var s=o.lines[i];if(s==e)break;t+=s.height}for(var u=o.parent;u;o=u,u=o.parent)for(var d=0;d<u.children.length;++d){var h=u.children[d];if(h==o)break;t+=h.height}return t}function fa(e){if(e.height==0)return 0;for(var t=e.text.length,o,i=e;o=Yu(i);){var s=o.find(0,!0);i=s.from.line,t+=s.from.ch-s.to.ch}for(i=e;o=ua(i);){var u=o.find(0,!0);t-=i.text.length-u.from.ch,i=u.to.line,t+=i.text.length-u.to.ch}return t}function Ps(e){var t=e.display,o=e.doc;t.maxLine=he(o,o.first),t.maxLineLength=fa(t.maxLine),t.maxLineChanged=!0,o.iter(function(i){var s=fa(i);s>t.maxLineLength&&(t.maxLineLength=s,t.maxLine=i)})}var fi=function(e,t,o){this.text=e,Ju(this,t),this.height=o?o(this):1};fi.prototype.lineNo=function(){return v(this)},xr(fi);function wm(e,t,o,i){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),Hu(e),Ju(e,o);var s=i?i(e):1;s!=e.height&&Dt(e,s)}function Lm(e){e.parent=null,Hu(e)}var Fm={},Bm={};function qu(e,t){if(!e||/^\s*$/.test(e))return null;var o=t.addModeClass?Bm:Fm;return o[e]||(o[e]=e.replace(/\S+/g,"cm-$&"))}function Ku(e,t){var o=ee("span",null,null,T?"padding-right: .1px":null),i={pre:ee("pre",[o],"CodeMirror-line"),content:o,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var s=0;s<=(t.rest?t.rest.length:0);s++){var u=s?t.rest[s-1]:t.line,d=void 0;i.pos=0,i.addToken=km,Ht(e.display.measure)&&(d=Ne(u,e.doc.direction))&&(i.addToken=Gm(i.addToken,d)),i.map=[];var h=t!=e.display.externalMeasured&&v(u);Om(u,i,Gu(e,u,h)),u.styleClasses&&(u.styleClasses.bgClass&&(i.bgClass=_e(u.styleClasses.bgClass,i.bgClass||"")),u.styleClasses.textClass&&(i.textClass=_e(u.styleClasses.textClass,i.textClass||""))),i.map.length==0&&i.map.push(0,0,i.content.appendChild(li(e.display.measure))),s==0?(t.measure.map=i.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(i.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(T){var m=i.content.lastChild;(/\bcm-tab\b/.test(m.className)||m.querySelector&&m.querySelector(".cm-tab"))&&(i.content.className="cm-tab-wrap-hack")}return Ke(e,"renderLine",e,t.line,i.pre),i.pre.className&&(i.textClass=_e(i.pre.className,i.textClass||"")),i}function Um(e){var t=x("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function km(e,t,o,i,s,u,d){if(t){var h=e.splitSpaces?Mm(t,e.trailingSpace):t,m=e.cm.state.specialChars,b=!1,I;if(!m.test(t))e.col+=t.length,I=document.createTextNode(h),e.map.push(e.pos,e.pos+t.length,I),g&&y<9&&(b=!0),e.pos+=t.length;else{I=document.createDocumentFragment();for(var C=0;;){m.lastIndex=C;var B=m.exec(t),L=B?B.index-C:t.length-C;if(L){var W=document.createTextNode(h.slice(C,C+L));g&&y<9?I.appendChild(x("span",[W])):I.appendChild(W),e.map.push(e.pos,e.pos+L,W),e.col+=L,e.pos+=L}if(!B)break;C+=L+1;var H=void 0;if(B[0]==" "){var z=e.cm.options.tabSize,ne=z-e.col%z;H=I.appendChild(x("span",Ve(ne),"cm-tab")),H.setAttribute("role","presentation"),H.setAttribute("cm-text"," "),e.col+=ne}else B[0]=="\r"||B[0]==`
20
+ `?(H=I.appendChild(x("span",B[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),H.setAttribute("cm-text",B[0]),e.col+=1):(H=e.cm.options.specialCharPlaceholder(B[0]),H.setAttribute("cm-text",B[0]),g&&y<9?I.appendChild(x("span",[H])):I.appendChild(H),e.col+=1);e.map.push(e.pos,e.pos+1,H),e.pos++}}if(e.trailingSpace=h.charCodeAt(t.length-1)==32,o||i||s||b||u||d){var pe=o||"";i&&(pe+=i),s&&(pe+=s);var ie=x("span",[I],pe,u);if(d)for(var me in d)d.hasOwnProperty(me)&&me!="style"&&me!="class"&&ie.setAttribute(me,d[me]);return e.content.appendChild(ie)}e.content.appendChild(I)}}function Mm(e,t){if(e.length>1&&!/ /.test(e))return e;for(var o=t,i="",s=0;s<e.length;s++){var u=e.charAt(s);u==" "&&o&&(s==e.length-1||e.charCodeAt(s+1)==32)&&(u="\xA0"),i+=u,o=u==" "}return i}function Gm(e,t){return function(o,i,s,u,d,h,m){s=s?s+" cm-force-border":"cm-force-border";for(var b=o.pos,I=b+i.length;;){for(var C=void 0,B=0;B<t.length&&(C=t[B],!(C.to>b&&C.from<=b));B++);if(C.to>=I)return e(o,i,s,u,d,h,m);e(o,i.slice(0,C.to-b),s,u,null,h,m),u=null,i=i.slice(C.to-b),b=C.to}}}function $u(e,t,o,i){var s=!i&&o.widgetNode;s&&e.map.push(e.pos,e.pos+t,s),!i&&e.cm.display.input.needsContentAttribute&&(s||(s=e.content.appendChild(document.createElement("span"))),s.setAttribute("cm-marker",o.id)),s&&(e.cm.display.input.setUneditable(s),e.content.appendChild(s)),e.pos+=t,e.trailingSpace=!1}function Om(e,t,o){var i=e.markedSpans,s=e.text,u=0;if(!i){for(var d=1;d<o.length;d+=2)t.addToken(t,s.slice(u,u=o[d]),qu(o[d+1],t.cm.options));return}for(var h=s.length,m=0,b=1,I="",C,B,L=0,W,H,z,ne,pe;;){if(L==m){W=H=z=B="",pe=null,ne=null,L=1/0;for(var ie=[],me=void 0,Ae=0;Ae<i.length;++Ae){var Ee=i[Ae],ke=Ee.marker;if(ke.type=="bookmark"&&Ee.from==m&&ke.widgetNode)ie.push(ke);else if(Ee.from<=m&&(Ee.to==null||Ee.to>m||ke.collapsed&&Ee.to==m&&Ee.from==m)){if(Ee.to!=null&&Ee.to!=m&&L>Ee.to&&(L=Ee.to,H=""),ke.className&&(W+=" "+ke.className),ke.css&&(B=(B?B+";":"")+ke.css),ke.startStyle&&Ee.from==m&&(z+=" "+ke.startStyle),ke.endStyle&&Ee.to==L&&(me||(me=[])).push(ke.endStyle,Ee.to),ke.title&&((pe||(pe={})).title=ke.title),ke.attributes)for(var et in ke.attributes)(pe||(pe={}))[et]=ke.attributes[et];ke.collapsed&&(!ne||Zs(ne.marker,ke)<0)&&(ne=Ee)}else Ee.from>m&&L>Ee.from&&(L=Ee.from)}if(me)for(var Lt=0;Lt<me.length;Lt+=2)me[Lt+1]==L&&(H+=" "+me[Lt]);if(!ne||ne.from==m)for(var ct=0;ct<ie.length;++ct)$u(t,0,ie[ct]);if(ne&&(ne.from||0)==m){if($u(t,(ne.to==null?h+1:ne.to)-m,ne.marker,ne.from==null),ne.to==null)return;ne.to==m&&(ne=!1)}}if(m>=h)break;for(var dr=Math.min(h,L);;){if(I){var $t=m+I.length;if(!ne){var bt=$t>dr?I.slice(0,dr-m):I;t.addToken(t,bt,C?C+W:W,z,m+bt.length==L?H:"",B,pe)}if($t>=dr){I=I.slice(dr-m),m=dr;break}m=$t,z=""}I=s.slice(u,u=o[b++]),C=qu(o[b++],t.cm.options)}}}function ef(e,t,o){this.line=t,this.rest=Sm(t),this.size=this.rest?v(Te(this.rest))-o+1:1,this.node=this.text=null,this.hidden=In(e,t)}function ca(e,t,o){for(var i=[],s,u=t;u<o;u=s){var d=new ef(e.doc,he(e.doc,u),u);s=u+d.size,i.push(d)}return i}var ci=null;function Wm(e){ci?ci.ops.push(e):e.ownsGroup=ci={ops:[e],delayedCallbacks:[]}}function Dm(e){var t=e.delayedCallbacks,o=0;do{for(;o<t.length;o++)t[o].call(null);for(var i=0;i<e.ops.length;i++){var s=e.ops[i];if(s.cursorActivityHandlers)for(;s.cursorActivityCalled<s.cursorActivityHandlers.length;)s.cursorActivityHandlers[s.cursorActivityCalled++].call(null,s.cm)}}while(o<t.length)}function Zm(e,t){var o=e.ownsGroup;if(o)try{Dm(o)}finally{ci=null,t(o)}}var oo=null;function Nt(e,t){var o=yr(e,t);if(o.length){var i=Array.prototype.slice.call(arguments,2),s;ci?s=ci.delayedCallbacks:oo?s=oo:(s=oo=[],setTimeout(Vm,0));for(var u=function(h){s.push(function(){return o[h].apply(null,i)})},d=0;d<o.length;++d)u(d)}}function Vm(){var e=oo;oo=null;for(var t=0;t<e.length;++t)e[t]()}function tf(e,t,o,i){for(var s=0;s<t.changes.length;s++){var u=t.changes[s];u=="text"?Pm(e,t):u=="gutter"?nf(e,t,o,i):u=="class"?Hs(e,t):u=="widget"&&Hm(e,t,i)}t.changes=null}function ao(e){return e.node==e.text&&(e.node=x("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),g&&y<8&&(e.node.style.zIndex=2)),e.node}function Qm(e,t){var o=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(o&&(o+=" CodeMirror-linebackground"),t.background)o?t.background.className=o:(t.background.parentNode.removeChild(t.background),t.background=null);else if(o){var i=ao(t);t.background=i.insertBefore(x("div",null,o),i.firstChild),e.display.input.setUneditable(t.background)}}function rf(e,t){var o=e.display.externalMeasured;return o&&o.line==t.line?(e.display.externalMeasured=null,t.measure=o.measure,o.built):Ku(e,t)}function Pm(e,t){var o=t.text.className,i=rf(e,t);t.text==t.node&&(t.node=i.pre),t.text.parentNode.replaceChild(i.pre,t.text),t.text=i.pre,i.bgClass!=t.bgClass||i.textClass!=t.textClass?(t.bgClass=i.bgClass,t.textClass=i.textClass,Hs(e,t)):o&&(t.text.className=o)}function Hs(e,t){Qm(e,t),t.line.wrapClass?ao(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var o=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=o||""}function nf(e,t,o,i){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var s=ao(t);t.gutterBackground=x("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px; width: "+i.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),s.insertBefore(t.gutterBackground,t.text)}var u=t.line.gutterMarkers;if(e.options.lineNumbers||u){var d=ao(t),h=t.gutter=x("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px");if(h.setAttribute("aria-hidden","true"),e.display.input.setUneditable(h),d.insertBefore(h,t.text),t.line.gutterClass&&(h.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!u||!u["CodeMirror-linenumbers"])&&(t.lineNumber=h.appendChild(x("div",Y(e.options,o),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+i.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),u)for(var m=0;m<e.display.gutterSpecs.length;++m){var b=e.display.gutterSpecs[m].className,I=u.hasOwnProperty(b)&&u[b];I&&h.appendChild(x("div",[I],"CodeMirror-gutter-elt","left: "+i.gutterLeft[b]+"px; width: "+i.gutterWidth[b]+"px"))}}}function Hm(e,t,o){t.alignable&&(t.alignable=null);for(var i=$("CodeMirror-linewidget"),s=t.node.firstChild,u=void 0;s;s=u)u=s.nextSibling,i.test(s.className)&&t.node.removeChild(s);of(e,t,o)}function Jm(e,t,o,i){var s=rf(e,t);return t.text=t.node=s.pre,s.bgClass&&(t.bgClass=s.bgClass),s.textClass&&(t.textClass=s.textClass),Hs(e,t),nf(e,t,o,i),of(e,t,i),t.node}function of(e,t,o){if(af(e,t.line,t,o,!0),t.rest)for(var i=0;i<t.rest.length;i++)af(e,t.rest[i],t,o,!1)}function af(e,t,o,i,s){if(t.widgets)for(var u=ao(o),d=0,h=t.widgets;d<h.length;++d){var m=h[d],b=x("div",[m.node],"CodeMirror-linewidget"+(m.className?" "+m.className:""));m.handleMouseEvents||b.setAttribute("cm-ignore-events","true"),Xm(m,b,o,i),e.display.input.setUneditable(b),s&&m.above?u.insertBefore(b,o.gutter||o.text):u.appendChild(b),Nt(m,"redraw")}}function Xm(e,t,o,i){if(e.noHScroll){(o.alignable||(o.alignable=[])).push(t);var s=i.wrapperWidth;t.style.left=i.fixedPos+"px",e.coverGutter||(s-=i.gutterTotalWidth,t.style.paddingLeft=i.gutterTotalWidth+"px"),t.style.width=s+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-i.gutterTotalWidth+"px"))}function so(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!de(document.body,e.node)){var o="position: relative;";e.coverGutter&&(o+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(o+="width: "+t.display.wrapper.clientWidth+"px;"),oe(t.display.measure,x("div",[e.node],null,o))}return e.height=e.node.parentNode.offsetHeight}function on(e,t){for(var o=yn(t);o!=e.wrapper;o=o.parentNode)if(!o||o.nodeType==1&&o.getAttribute("cm-ignore-events")=="true"||o.parentNode==e.sizer&&o!=e.mover)return!0}function da(e){return e.lineSpace.offsetTop}function Js(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function sf(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=oe(e.measure,x("pre","x","CodeMirror-line-like")),o=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,i={left:parseInt(o.paddingLeft),right:parseInt(o.paddingRight)};return!isNaN(i.left)&&!isNaN(i.right)&&(e.cachedPaddingH=i),i}function Vr(e){return Fe-e.display.nativeBarWidth}function Zn(e){return e.display.scroller.clientWidth-Vr(e)-e.display.barWidth}function Xs(e){return e.display.scroller.clientHeight-Vr(e)-e.display.barHeight}function Ym(e,t,o){var i=e.options.lineWrapping,s=i&&Zn(e);if(!t.measure.heights||i&&t.measure.width!=s){var u=t.measure.heights=[];if(i){t.measure.width=s;for(var d=t.text.firstChild.getClientRects(),h=0;h<d.length-1;h++){var m=d[h],b=d[h+1];Math.abs(m.bottom-b.bottom)>2&&u.push((m.bottom+b.top)/2-o.top)}}u.push(o.bottom-o.top)}}function lf(e,t,o){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};if(e.rest){for(var i=0;i<e.rest.length;i++)if(e.rest[i]==t)return{map:e.measure.maps[i],cache:e.measure.caches[i]};for(var s=0;s<e.rest.length;s++)if(v(e.rest[s])>o)return{map:e.measure.maps[s],cache:e.measure.caches[s],before:!0}}}function jm(e,t){t=Lr(t);var o=v(t),i=e.display.externalMeasured=new ef(e.doc,t,o);i.lineN=o;var s=i.built=Ku(e,i);return i.text=s.pre,oe(e.display.lineMeasure,s.pre),i}function uf(e,t,o,i){return Qr(e,di(e,t),o,i)}function Ys(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[Pn(e,t)];var o=e.display.externalMeasured;if(o&&t>=o.lineN&&t<o.lineN+o.size)return o}function di(e,t){var o=v(t),i=Ys(e,o);i&&!i.text?i=null:i&&i.changes&&(tf(e,i,o,$s(e)),e.curOp.forceUpdate=!0),i||(i=jm(e,t));var s=lf(i,t,o);return{line:t,view:i,rect:null,map:s.map,cache:s.cache,before:s.before,hasHeights:!1}}function Qr(e,t,o,i,s){t.before&&(o=-1);var u=o+(i||""),d;return t.cache.hasOwnProperty(u)?d=t.cache[u]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(Ym(e,t.view,t.rect),t.hasHeights=!0),d=qm(e,t,o,i),d.bogus||(t.cache[u]=d)),{left:d.left,right:d.right,top:s?d.rtop:d.top,bottom:s?d.rbottom:d.bottom}}var ff={left:0,right:0,top:0,bottom:0};function cf(e,t,o){for(var i,s,u,d,h,m,b=0;b<e.length;b+=3)if(h=e[b],m=e[b+1],t<h?(s=0,u=1,d="left"):t<m?(s=t-h,u=s+1):(b==e.length-3||t==m&&e[b+3]>t)&&(u=m-h,s=u-1,t>=m&&(d="right")),s!=null){if(i=e[b+2],h==m&&o==(i.insertLeft?"left":"right")&&(d=o),o=="left"&&s==0)for(;b&&e[b-2]==e[b-3]&&e[b-1].insertLeft;)i=e[(b-=3)+2],d="left";if(o=="right"&&s==m-h)for(;b<e.length-3&&e[b+3]==e[b+4]&&!e[b+5].insertLeft;)i=e[(b+=3)+2],d="right";break}return{node:i,start:s,end:u,collapse:d,coverStart:h,coverEnd:m}}function zm(e,t){var o=ff;if(t=="left")for(var i=0;i<e.length&&(o=e[i]).left==o.right;i++);else for(var s=e.length-1;s>=0&&(o=e[s]).left==o.right;s--);return o}function qm(e,t,o,i){var s=cf(t.map,o,i),u=s.node,d=s.start,h=s.end,m=s.collapse,b;if(u.nodeType==3){for(var I=0;I<4;I++){for(;d&&qe(t.line.text.charAt(s.coverStart+d));)--d;for(;s.coverStart+h<s.coverEnd&&qe(t.line.text.charAt(s.coverStart+h));)++h;if(g&&y<9&&d==0&&h==s.coverEnd-s.coverStart?b=u.parentNode.getBoundingClientRect():b=zm(D(u,d,h).getClientRects(),i),b.left||b.right||d==0)break;h=d,d=d-1,m="right"}g&&y<11&&(b=Km(e.display.measure,b))}else{d>0&&(m=i="right");var C;e.options.lineWrapping&&(C=u.getClientRects()).length>1?b=C[i=="right"?C.length-1:0]:b=u.getBoundingClientRect()}if(g&&y<9&&!d&&(!b||!b.left&&!b.right)){var B=u.parentNode.getClientRects()[0];B?b={left:B.left,right:B.left+pi(e.display),top:B.top,bottom:B.bottom}:b=ff}for(var L=b.top-t.rect.top,W=b.bottom-t.rect.top,H=(L+W)/2,z=t.view.measure.heights,ne=0;ne<z.length-1&&!(H<z[ne]);ne++);var pe=ne?z[ne-1]:0,ie=z[ne],me={left:(m=="right"?b.right:b.left)-t.rect.left,right:(m=="left"?b.left:b.right)-t.rect.left,top:pe,bottom:ie};return!b.left&&!b.right&&(me.bogus=!0),e.options.singleCursorHeightPerLine||(me.rtop=L,me.rbottom=W),me}function Km(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Tr(e))return t;var o=screen.logicalXDPI/screen.deviceXDPI,i=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*o,right:t.right*o,top:t.top*i,bottom:t.bottom*i}}function df(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function hf(e){e.display.externalMeasure=null,k(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)df(e.display.view[t])}function lo(e){hf(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function pf(e){return A&&G?-(e.body.getBoundingClientRect().left-parseInt(getComputedStyle(e.body).marginLeft)):e.defaultView.pageXOffset||(e.documentElement||e.body).scrollLeft}function gf(e){return A&&G?-(e.body.getBoundingClientRect().top-parseInt(getComputedStyle(e.body).marginTop)):e.defaultView.pageYOffset||(e.documentElement||e.body).scrollTop}function js(e){var t=Lr(e),o=t.widgets,i=0;if(o)for(var s=0;s<o.length;++s)o[s].above&&(i+=so(o[s]));return i}function ha(e,t,o,i,s){if(!s){var u=js(t);o.top+=u,o.bottom+=u}if(i=="line")return o;i||(i="local");var d=nn(t);if(i=="local"?d+=da(e.display):d-=e.display.viewOffset,i=="page"||i=="window"){var h=e.display.lineSpace.getBoundingClientRect();d+=h.top+(i=="window"?0:gf(re(e)));var m=h.left+(i=="window"?0:pf(re(e)));o.left+=m,o.right+=m}return o.top+=d,o.bottom+=d,o}function mf(e,t,o){if(o=="div")return t;var i=t.left,s=t.top;if(o=="page")i-=pf(re(e)),s-=gf(re(e));else if(o=="local"||!o){var u=e.display.sizer.getBoundingClientRect();i+=u.left,s+=u.top}var d=e.display.lineSpace.getBoundingClientRect();return{left:i-d.left,top:s-d.top}}function pa(e,t,o,i,s){return i||(i=he(e.doc,t.line)),ha(e,i,uf(e,i,t.ch,s),o)}function Fr(e,t,o,i,s,u){i=i||he(e.doc,t.line),s||(s=di(e,i));function d(W,H){var z=Qr(e,s,W,H?"right":"left",u);return H?z.left=z.right:z.right=z.left,ha(e,i,z,o)}var h=Ne(i,e.doc.direction),m=t.ch,b=t.sticky;if(m>=i.text.length?(m=i.text.length,b="before"):m<=0&&(m=0,b="after"),!h)return d(b=="before"?m-1:m,b=="before");function I(W,H,z){var ne=h[H],pe=ne.level==1;return d(z?W-1:W,pe!=z)}var C=vr(h,m,b),B=br,L=I(m,C,b=="before");return B!=null&&(L.other=I(m,B,b!="before")),L}function bf(e,t){var o=0;t=Se(e.doc,t),e.options.lineWrapping||(o=pi(e.display)*t.ch);var i=he(e.doc,t.line),s=nn(i)+da(e.display);return{left:o,right:o,top:s,bottom:s+i.height}}function zs(e,t,o,i,s){var u=O(e,t,o);return u.xRel=s,i&&(u.outside=i),u}function qs(e,t,o){var i=e.doc;if(o+=e.display.viewOffset,o<0)return zs(i.first,0,null,-1,-1);var s=E(i,o),u=i.first+i.size-1;if(s>u)return zs(i.first+i.size-1,he(i,u).text.length,null,1,1);t<0&&(t=0);for(var d=he(i,s);;){var h=$m(e,d,s,t,o),m=_m(d,h.ch+(h.xRel>0||h.outside>0?1:0));if(!m)return h;var b=m.find(1);if(b.line==s)return b;d=he(i,s=b.line)}}function vf(e,t,o,i){i-=js(t);var s=t.text.length,u=ft(function(d){return Qr(e,o,d-1).bottom<=i},s,0);return s=ft(function(d){return Qr(e,o,d).top>i},u,s),{begin:u,end:s}}function yf(e,t,o,i){o||(o=di(e,t));var s=ha(e,t,Qr(e,o,i),"line").top;return vf(e,t,o,s)}function Ks(e,t,o,i){return e.bottom<=o?!1:e.top>o?!0:(i?e.left:e.right)>t}function $m(e,t,o,i,s){s-=nn(t);var u=di(e,t),d=js(t),h=0,m=t.text.length,b=!0,I=Ne(t,e.doc.direction);if(I){var C=(e.options.lineWrapping?t0:e0)(e,t,o,u,I,i,s);b=C.level!=1,h=b?C.from:C.to-1,m=b?C.to:C.from-1}var B=null,L=null,W=ft(function(Ae){var Ee=Qr(e,u,Ae);return Ee.top+=d,Ee.bottom+=d,Ks(Ee,i,s,!1)?(Ee.top<=s&&Ee.left<=i&&(B=Ae,L=Ee),!0):!1},h,m),H,z,ne=!1;if(L){var pe=i-L.left<L.right-i,ie=pe==b;W=B+(ie?0:1),z=ie?"after":"before",H=pe?L.left:L.right}else{!b&&(W==m||W==h)&&W++,z=W==0?"after":W==t.text.length?"before":Qr(e,u,W-(b?1:0)).bottom+d<=s==b?"after":"before";var me=Fr(e,O(o,W,z),"line",t,u);H=me.left,ne=s<me.top?-1:s>=me.bottom?1:0}return W=kt(t.text,W,1),zs(o,W,z,ne,i-H)}function e0(e,t,o,i,s,u,d){var h=ft(function(C){var B=s[C],L=B.level!=1;return Ks(Fr(e,O(o,L?B.to:B.from,L?"before":"after"),"line",t,i),u,d,!0)},0,s.length-1),m=s[h];if(h>0){var b=m.level!=1,I=Fr(e,O(o,b?m.from:m.to,b?"after":"before"),"line",t,i);Ks(I,u,d,!0)&&I.top>d&&(m=s[h-1])}return m}function t0(e,t,o,i,s,u,d){var h=vf(e,t,i,d),m=h.begin,b=h.end;/\s/.test(t.text.charAt(b-1))&&b--;for(var I=null,C=null,B=0;B<s.length;B++){var L=s[B];if(!(L.from>=b||L.to<=m)){var W=L.level!=1,H=Qr(e,i,W?Math.min(b,L.to)-1:Math.max(m,L.from)).right,z=H<u?u-H+1e9:H-u;(!I||C>z)&&(I=L,C=z)}}return I||(I=s[s.length-1]),I.from<m&&(I={from:m,to:I.to,level:I.level}),I.to>b&&(I={from:I.from,to:b,level:I.level}),I}var Vn;function hi(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(Vn==null){Vn=x("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Vn.appendChild(document.createTextNode("x")),Vn.appendChild(x("br"));Vn.appendChild(document.createTextNode("x"))}oe(e.measure,Vn);var o=Vn.offsetHeight/50;return o>3&&(e.cachedTextHeight=o),k(e.measure),o||1}function pi(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=x("span","xxxxxxxxxx"),o=x("pre",[t],"CodeMirror-line-like");oe(e.measure,o);var i=t.getBoundingClientRect(),s=(i.right-i.left)/10;return s>2&&(e.cachedCharWidth=s),s||10}function $s(e){for(var t=e.display,o={},i={},s=t.gutters.clientLeft,u=t.gutters.firstChild,d=0;u;u=u.nextSibling,++d){var h=e.display.gutterSpecs[d].className;o[h]=u.offsetLeft+u.clientLeft+s,i[h]=u.clientWidth}return{fixedPos:el(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:o,gutterWidth:i,wrapperWidth:t.wrapper.clientWidth}}function el(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function xf(e){var t=hi(e.display),o=e.options.lineWrapping,i=o&&Math.max(5,e.display.scroller.clientWidth/pi(e.display)-3);return function(s){if(In(e.doc,s))return 0;var u=0;if(s.widgets)for(var d=0;d<s.widgets.length;d++)s.widgets[d].height&&(u+=s.widgets[d].height);return o?u+(Math.ceil(s.text.length/i)||1)*t:u+t}}function tl(e){var t=e.doc,o=xf(e);t.iter(function(i){var s=o(i);s!=i.height&&Dt(i,s)})}function Qn(e,t,o,i){var s=e.display;if(!o&&yn(t).getAttribute("cm-not-content")=="true")return null;var u,d,h=s.lineSpace.getBoundingClientRect();try{u=t.clientX-h.left,d=t.clientY-h.top}catch{return null}var m=qs(e,u,d),b;if(i&&m.xRel>0&&(b=he(e.doc,m.line).text).length==m.ch){var I=ye(b,b.length,e.options.tabSize)-b.length;m=O(m.line,Math.max(0,Math.round((u-sf(e.display).left)/pi(e.display))-I))}return m}function Pn(e,t){if(t>=e.display.viewTo||(t-=e.display.viewFrom,t<0))return null;for(var o=e.display.view,i=0;i<o.length;i++)if(t-=o[i].size,t<0)return i}function qt(e,t,o,i){t==null&&(t=e.doc.first),o==null&&(o=e.doc.first+e.doc.size),i||(i=0);var s=e.display;if(i&&o<s.viewTo&&(s.updateLineNumbers==null||s.updateLineNumbers>t)&&(s.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=s.viewTo)rn&&Vs(e.doc,t)<s.viewTo&&Cn(e);else if(o<=s.viewFrom)rn&&zu(e.doc,o+i)>s.viewFrom?Cn(e):(s.viewFrom+=i,s.viewTo+=i);else if(t<=s.viewFrom&&o>=s.viewTo)Cn(e);else if(t<=s.viewFrom){var u=ga(e,o,o+i,1);u?(s.view=s.view.slice(u.index),s.viewFrom=u.lineN,s.viewTo+=i):Cn(e)}else if(o>=s.viewTo){var d=ga(e,t,t,-1);d?(s.view=s.view.slice(0,d.index),s.viewTo=d.lineN):Cn(e)}else{var h=ga(e,t,t,-1),m=ga(e,o,o+i,1);h&&m?(s.view=s.view.slice(0,h.index).concat(ca(e,h.lineN,m.lineN)).concat(s.view.slice(m.index)),s.viewTo+=i):Cn(e)}var b=s.externalMeasured;b&&(o<b.lineN?b.lineN+=i:t<b.lineN+b.size&&(s.externalMeasured=null))}function En(e,t,o){e.curOp.viewChanged=!0;var i=e.display,s=e.display.externalMeasured;if(s&&t>=s.lineN&&t<s.lineN+s.size&&(i.externalMeasured=null),!(t<i.viewFrom||t>=i.viewTo)){var u=i.view[Pn(e,t)];if(u.node!=null){var d=u.changes||(u.changes=[]);ue(d,o)==-1&&d.push(o)}}}function Cn(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function ga(e,t,o,i){var s=Pn(e,t),u,d=e.display.view;if(!rn||o==e.doc.first+e.doc.size)return{index:s,lineN:o};for(var h=e.display.viewFrom,m=0;m<s;m++)h+=d[m].size;if(h!=t){if(i>0){if(s==d.length-1)return null;u=h+d[s].size-t,s++}else u=h-t;t+=u,o+=u}for(;Vs(e.doc,o)!=o;){if(s==(i<0?0:d.length-1))return null;o+=i*d[s-(i<0?1:0)].size,s+=i}return{index:s,lineN:o}}function r0(e,t,o){var i=e.display,s=i.view;s.length==0||t>=i.viewTo||o<=i.viewFrom?(i.view=ca(e,t,o),i.viewFrom=t):(i.viewFrom>t?i.view=ca(e,t,i.viewFrom).concat(i.view):i.viewFrom<t&&(i.view=i.view.slice(Pn(e,t))),i.viewFrom=t,i.viewTo<o?i.view=i.view.concat(ca(e,i.viewTo,o)):i.viewTo>o&&(i.view=i.view.slice(0,Pn(e,o)))),i.viewTo=o}function Tf(e){for(var t=e.display.view,o=0,i=0;i<t.length;i++){var s=t[i];!s.hidden&&(!s.node||s.changes)&&++o}return o}function uo(e){e.display.input.showSelection(e.display.input.prepareSelection())}function If(e,t){t===void 0&&(t=!0);var o=e.doc,i={},s=i.cursors=document.createDocumentFragment(),u=i.selection=document.createDocumentFragment(),d=e.options.$customCursor;d&&(t=!0);for(var h=0;h<o.sel.ranges.length;h++)if(!(!t&&h==o.sel.primIndex)){var m=o.sel.ranges[h];if(!(m.from().line>=e.display.viewTo||m.to().line<e.display.viewFrom)){var b=m.empty();if(d){var I=d(e,m);I&&rl(e,I,s)}else(b||e.options.showCursorWhenSelecting)&&rl(e,m.head,s);b||n0(e,m,u)}}return i}function rl(e,t,o){var i=Fr(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),s=o.appendChild(x("div","\xA0","CodeMirror-cursor"));if(s.style.left=i.left+"px",s.style.top=i.top+"px",s.style.height=Math.max(0,i.bottom-i.top)*e.options.cursorHeight+"px",/\bcm-fat-cursor\b/.test(e.getWrapperElement().className)){var u=pa(e,t,"div",null,null),d=u.right-u.left;s.style.width=(d>0?d:e.defaultCharWidth())+"px"}if(i.other){var h=o.appendChild(x("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));h.style.display="",h.style.left=i.other.left+"px",h.style.top=i.other.top+"px",h.style.height=(i.other.bottom-i.other.top)*.85+"px"}}function ma(e,t){return e.top-t.top||e.left-t.left}function n0(e,t,o){var i=e.display,s=e.doc,u=document.createDocumentFragment(),d=sf(e.display),h=d.left,m=Math.max(i.sizerWidth,Zn(e)-i.sizer.offsetLeft)-d.right,b=s.direction=="ltr";function I(ie,me,Ae,Ee){me<0&&(me=0),me=Math.round(me),Ee=Math.round(Ee),u.appendChild(x("div",null,"CodeMirror-selected","position: absolute; left: "+ie+`px;
21
21
  top: `+me+"px; width: "+(Ae??m-ie)+`px;
22
- height: `+(Ee-me)+"px"))}function C(ie,me,Ae){var Ee=de(s,ie),ke=Ee.text.length,et,Lt;function ct(bt,er){return pa(e,O(ie,bt),"div",Ee,er)}function dr(bt,er,Gt){var xt=yf(e,Ee,null,bt),vt=er=="ltr"==(Gt=="after")?"left":"right",ht=Gt=="after"?xt.begin:xt.end-(/\s/.test(Ee.text.charAt(xt.end-1))?2:1);return ct(ht,vt)[vt]}var $t=Ne(Ee,s.direction);return Mt($t,me||0,Ae??ke,function(bt,er,Gt,xt){var vt=Gt=="ltr",ht=ct(bt,vt?"left":"right"),tr=ct(er-1,vt?"right":"left"),Ri=me==null&&bt==0,wn=Ae==null&&er==ke,Vt=xt==0,Pr=!$t||xt==$t.length-1;if(tr.top-ht.top<=3){var Ft=(b?Ri:wn)&&Vt,Sl=(b?wn:Ri)&&Pr,ln=Ft?h:(vt?ht:tr).left,jn=Sl?m:(vt?tr:ht).right;I(ln,ht.top,jn-ln,ht.bottom)}else{var zn,Xt,Ni,wl;vt?(zn=b&&Ri&&Vt?h:ht.left,Xt=b?m:dr(bt,Gt,"before"),Ni=b?h:dr(er,Gt,"after"),wl=b&&wn&&Pr?m:tr.right):(zn=b?dr(bt,Gt,"before"):h,Xt=!b&&Ri&&Vt?m:ht.right,Ni=!b&&wn&&Pr?h:tr.left,wl=b?dr(er,Gt,"after"):m),I(zn,ht.top,Xt-zn,ht.bottom),ht.bottom<tr.top&&I(h,ht.bottom,null,tr.top),I(Ni,tr.top,wl-Ni,tr.bottom)}(!et||ma(ht,et)<0)&&(et=ht),ma(tr,et)<0&&(et=tr),(!Lt||ma(ht,Lt)<0)&&(Lt=ht),ma(tr,Lt)<0&&(Lt=tr)}),{start:et,end:Lt}}var B=t.from(),L=t.to();if(B.line==L.line)C(B.line,B.ch,L.ch);else{var W=de(s,B.line),H=de(s,L.line),z=Lr(W)==Lr(H),ne=C(B.line,B.ch,z?W.text.length+1:null).end,he=C(L.line,z?0:null,L.ch).start;z&&(ne.top<he.top-2?(I(ne.right,ne.top,null,ne.bottom),I(h,he.top,he.left,he.bottom)):I(ne.right,ne.top,he.left-ne.right,ne.bottom)),ne.bottom<he.top&&I(h,ne.bottom,null,he.top)}o.appendChild(u)}function nl(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var o=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||gi(e),t.cursorDiv.style.visibility=(o=!o)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function Ef(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||ol(e))}function il(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&gi(e))},100)}function ol(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),e.options.readOnly!="nocursor"&&(e.state.focused||(Ke(e,"focus",e,t),e.state.focused=!0,Oe(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),T&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),nl(e))}function gi(e,t){e.state.delayingBlurEvent||(e.state.focused&&(Ke(e,"blur",e,t),e.state.focused=!1,pe(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function ba(e){for(var t=e.display,o=t.lineDiv.offsetTop,i=Math.max(0,t.scroller.getBoundingClientRect().top),s=t.lineDiv.getBoundingClientRect().top,u=0,d=0;d<t.view.length;d++){var h=t.view[d],m=e.options.lineWrapping,b=void 0,I=0;if(!h.hidden){if(s+=h.line.height,g&&y<8){var C=h.node.offsetTop+h.node.offsetHeight;b=C-o,o=C}else{var B=h.node.getBoundingClientRect();b=B.bottom-B.top,!m&&h.text.firstChild&&(I=h.text.firstChild.getBoundingClientRect().right-B.left-1)}var L=h.line.height-b;if((L>.005||L<-.005)&&(s<i&&(u-=L),Dt(h.line,b),Cf(h.line),h.rest))for(var W=0;W<h.rest.length;W++)Cf(h.rest[W]);if(I>e.display.sizerWidth){var H=Math.ceil(I/pi(e.display));H>e.display.maxLineLength&&(e.display.maxLineLength=H,e.display.maxLine=h.line,e.display.maxLineChanged=!0)}}}Math.abs(u)>2&&(t.scroller.scrollTop+=u)}function Cf(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var o=e.widgets[t],i=o.node.parentNode;i&&(o.height=i.offsetHeight)}}function va(e,t,o){var i=o&&o.top!=null?Math.max(0,o.top):e.scroller.scrollTop;i=Math.floor(i-da(e));var s=o&&o.bottom!=null?o.bottom:i+e.wrapper.clientHeight,u=E(t,i),d=E(t,s);if(o&&o.ensure){var h=o.ensure.from.line,m=o.ensure.to.line;h<u?(u=h,d=E(t,nn(de(t,h))+e.wrapper.clientHeight)):Math.min(m,t.lastLine())>=d&&(u=E(t,nn(de(t,m))-e.wrapper.clientHeight),d=m)}return{from:u,to:Math.max(d,u+1)}}function i0(e,t){if(!$e(e,"scrollCursorIntoView")){var o=e.display,i=o.sizer.getBoundingClientRect(),s=null,u=o.wrapper.ownerDocument;if(t.top+i.top<0?s=!0:t.bottom+i.top>(u.defaultView.innerHeight||u.documentElement.clientHeight)&&(s=!1),s!=null&&!Z){var d=x("div","\u200B",null,`position: absolute;
22
+ height: `+(Ee-me)+"px"))}function C(ie,me,Ae){var Ee=he(s,ie),ke=Ee.text.length,et,Lt;function ct(bt,er){return pa(e,O(ie,bt),"div",Ee,er)}function dr(bt,er,Gt){var xt=yf(e,Ee,null,bt),vt=er=="ltr"==(Gt=="after")?"left":"right",ht=Gt=="after"?xt.begin:xt.end-(/\s/.test(Ee.text.charAt(xt.end-1))?2:1);return ct(ht,vt)[vt]}var $t=Ne(Ee,s.direction);return Mt($t,me||0,Ae??ke,function(bt,er,Gt,xt){var vt=Gt=="ltr",ht=ct(bt,vt?"left":"right"),tr=ct(er-1,vt?"right":"left"),_i=me==null&&bt==0,wn=Ae==null&&er==ke,Vt=xt==0,Pr=!$t||xt==$t.length-1;if(tr.top-ht.top<=3){var Ft=(b?_i:wn)&&Vt,Sl=(b?wn:_i)&&Pr,ln=Ft?h:(vt?ht:tr).left,jn=Sl?m:(vt?tr:ht).right;I(ln,ht.top,jn-ln,ht.bottom)}else{var zn,Xt,Ni,wl;vt?(zn=b&&_i&&Vt?h:ht.left,Xt=b?m:dr(bt,Gt,"before"),Ni=b?h:dr(er,Gt,"after"),wl=b&&wn&&Pr?m:tr.right):(zn=b?dr(bt,Gt,"before"):h,Xt=!b&&_i&&Vt?m:ht.right,Ni=!b&&wn&&Pr?h:tr.left,wl=b?dr(er,Gt,"after"):m),I(zn,ht.top,Xt-zn,ht.bottom),ht.bottom<tr.top&&I(h,ht.bottom,null,tr.top),I(Ni,tr.top,wl-Ni,tr.bottom)}(!et||ma(ht,et)<0)&&(et=ht),ma(tr,et)<0&&(et=tr),(!Lt||ma(ht,Lt)<0)&&(Lt=ht),ma(tr,Lt)<0&&(Lt=tr)}),{start:et,end:Lt}}var B=t.from(),L=t.to();if(B.line==L.line)C(B.line,B.ch,L.ch);else{var W=he(s,B.line),H=he(s,L.line),z=Lr(W)==Lr(H),ne=C(B.line,B.ch,z?W.text.length+1:null).end,pe=C(L.line,z?0:null,L.ch).start;z&&(ne.top<pe.top-2?(I(ne.right,ne.top,null,ne.bottom),I(h,pe.top,pe.left,pe.bottom)):I(ne.right,ne.top,pe.left-ne.right,ne.bottom)),ne.bottom<pe.top&&I(h,ne.bottom,null,pe.top)}o.appendChild(u)}function nl(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var o=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||gi(e),t.cursorDiv.style.visibility=(o=!o)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function Ef(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||ol(e))}function il(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&gi(e))},100)}function ol(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),e.options.readOnly!="nocursor"&&(e.state.focused||(Ke(e,"focus",e,t),e.state.focused=!0,Oe(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),T&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),nl(e))}function gi(e,t){e.state.delayingBlurEvent||(e.state.focused&&(Ke(e,"blur",e,t),e.state.focused=!1,fe(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function ba(e){for(var t=e.display,o=t.lineDiv.offsetTop,i=Math.max(0,t.scroller.getBoundingClientRect().top),s=t.lineDiv.getBoundingClientRect().top,u=0,d=0;d<t.view.length;d++){var h=t.view[d],m=e.options.lineWrapping,b=void 0,I=0;if(!h.hidden){if(s+=h.line.height,g&&y<8){var C=h.node.offsetTop+h.node.offsetHeight;b=C-o,o=C}else{var B=h.node.getBoundingClientRect();b=B.bottom-B.top,!m&&h.text.firstChild&&(I=h.text.firstChild.getBoundingClientRect().right-B.left-1)}var L=h.line.height-b;if((L>.005||L<-.005)&&(s<i&&(u-=L),Dt(h.line,b),Cf(h.line),h.rest))for(var W=0;W<h.rest.length;W++)Cf(h.rest[W]);if(I>e.display.sizerWidth){var H=Math.ceil(I/pi(e.display));H>e.display.maxLineLength&&(e.display.maxLineLength=H,e.display.maxLine=h.line,e.display.maxLineChanged=!0)}}}Math.abs(u)>2&&(t.scroller.scrollTop+=u)}function Cf(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var o=e.widgets[t],i=o.node.parentNode;i&&(o.height=i.offsetHeight)}}function va(e,t,o){var i=o&&o.top!=null?Math.max(0,o.top):e.scroller.scrollTop;i=Math.floor(i-da(e));var s=o&&o.bottom!=null?o.bottom:i+e.wrapper.clientHeight,u=E(t,i),d=E(t,s);if(o&&o.ensure){var h=o.ensure.from.line,m=o.ensure.to.line;h<u?(u=h,d=E(t,nn(he(t,h))+e.wrapper.clientHeight)):Math.min(m,t.lastLine())>=d&&(u=E(t,nn(he(t,m))-e.wrapper.clientHeight),d=m)}return{from:u,to:Math.max(d,u+1)}}function i0(e,t){if(!$e(e,"scrollCursorIntoView")){var o=e.display,i=o.sizer.getBoundingClientRect(),s=null,u=o.wrapper.ownerDocument;if(t.top+i.top<0?s=!0:t.bottom+i.top>(u.defaultView.innerHeight||u.documentElement.clientHeight)&&(s=!1),s!=null&&!Z){var d=x("div","\u200B",null,`position: absolute;
23
23
  top: `+(t.top-o.viewOffset-da(e.display))+`px;
24
24
  height: `+(t.bottom-t.top+Vr(e)+o.barHeight)+`px;
25
- left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(d),d.scrollIntoView(s),e.display.lineSpace.removeChild(d)}}}function o0(e,t,o,i){i==null&&(i=0);var s;!e.options.lineWrapping&&t==o&&(o=t.sticky=="before"?O(t.line,t.ch+1,"before"):t,t=t.ch?O(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t);for(var u=0;u<5;u++){var d=!1,h=Fr(e,t),m=!o||o==t?h:Fr(e,o);s={left:Math.min(h.left,m.left),top:Math.min(h.top,m.top)-i,right:Math.max(h.left,m.left),bottom:Math.max(h.bottom,m.bottom)+i};var b=al(e,s),I=e.doc.scrollTop,C=e.doc.scrollLeft;if(b.scrollTop!=null&&(co(e,b.scrollTop),Math.abs(e.doc.scrollTop-I)>1&&(d=!0)),b.scrollLeft!=null&&(Hn(e,b.scrollLeft),Math.abs(e.doc.scrollLeft-C)>1&&(d=!0)),!d)break}return s}function a0(e,t){var o=al(e,t);o.scrollTop!=null&&co(e,o.scrollTop),o.scrollLeft!=null&&Hn(e,o.scrollLeft)}function al(e,t){var o=e.display,i=hi(e.display);t.top<0&&(t.top=0);var s=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:o.scroller.scrollTop,u=Xs(e),d={};t.bottom-t.top>u&&(t.bottom=t.top+u);var h=e.doc.height+Js(o),m=t.top<i,b=t.bottom>h-i;if(t.top<s)d.scrollTop=m?0:t.top;else if(t.bottom>s+u){var I=Math.min(t.top,(b?h:t.bottom)-u);I!=s&&(d.scrollTop=I)}var C=e.options.fixedGutter?0:o.gutters.offsetWidth,B=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:o.scroller.scrollLeft-C,L=Zn(e)-o.gutters.offsetWidth,W=t.right-t.left>L;return W&&(t.right=t.left+L),t.left<10?d.scrollLeft=0:t.left<B?d.scrollLeft=Math.max(0,t.left+C-(W?0:10)):t.right>L+B-3&&(d.scrollLeft=t.right+(W?0:10)-L),d}function sl(e,t){t!=null&&(ya(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t)}function mi(e){ya(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function fo(e,t,o){(t!=null||o!=null)&&ya(e),t!=null&&(e.curOp.scrollLeft=t),o!=null&&(e.curOp.scrollTop=o)}function s0(e,t){ya(e),e.curOp.scrollToPos=t}function ya(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var o=bf(e,t.from),i=bf(e,t.to);Af(e,o,i,t.margin)}}function Af(e,t,o,i){var s=al(e,{left:Math.min(t.left,o.left),top:Math.min(t.top,o.top)-i,right:Math.max(t.right,o.right),bottom:Math.max(t.bottom,o.bottom)+i});fo(e,s.scrollLeft,s.scrollTop)}function co(e,t){Math.abs(e.doc.scrollTop-t)<2||(a||ul(e,{top:t}),_f(e,t,!0),a&&ul(e),go(e,100))}function _f(e,t,o){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),!(e.display.scroller.scrollTop==t&&!o)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function Hn(e,t,o,i){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),!((o?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!i)&&(e.doc.scrollLeft=t,Lf(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function ho(e){var t=e.display,o=t.gutters.offsetWidth,i=Math.round(e.doc.height+Js(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?o:0,docHeight:i,scrollHeight:i+Vr(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:o}}var Jn=function(e,t,o){this.cm=o;var i=this.vert=x("div",[x("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),s=this.horiz=x("div",[x("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");i.tabIndex=s.tabIndex=-1,e(i),e(s),Ie(i,"scroll",function(){i.clientHeight&&t(i.scrollTop,"vertical")}),Ie(s,"scroll",function(){s.clientWidth&&t(s.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,g&&y<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Jn.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,o=e.scrollHeight>e.clientHeight+1,i=e.nativeBarWidth;if(o){this.vert.style.display="block",this.vert.style.bottom=t?i+"px":"0";var s=e.viewHeight-(t?i:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+s)+"px"}else this.vert.scrollTop=0,this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=o?i+"px":"0",this.horiz.style.left=e.barLeft+"px";var u=e.viewWidth-e.barLeft-(o?i:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+u)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(i==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:o?i:0,bottom:t?i:0}},Jn.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Jn.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Jn.prototype.zeroWidthHack=function(){var e=q&&!S?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.visibility=this.vert.style.visibility="hidden",this.disableHoriz=new Ge,this.disableVert=new Ge},Jn.prototype.enableZeroWidthBar=function(e,t,o){e.style.visibility="";function i(){var s=e.getBoundingClientRect(),u=o=="vert"?document.elementFromPoint(s.right-1,(s.top+s.bottom)/2):document.elementFromPoint((s.right+s.left)/2,s.bottom-1);u!=e?e.style.visibility="hidden":t.set(1e3,i)}t.set(1e3,i)},Jn.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var po=function(){};po.prototype.update=function(){return{bottom:0,right:0}},po.prototype.setScrollLeft=function(){},po.prototype.setScrollTop=function(){},po.prototype.clear=function(){};function bi(e,t){t||(t=ho(e));var o=e.display.barWidth,i=e.display.barHeight;Rf(e,t);for(var s=0;s<4&&o!=e.display.barWidth||i!=e.display.barHeight;s++)o!=e.display.barWidth&&e.options.lineWrapping&&ba(e),Rf(e,ho(e)),o=e.display.barWidth,i=e.display.barHeight}function Rf(e,t){var o=e.display,i=o.scrollbars.update(t);o.sizer.style.paddingRight=(o.barWidth=i.right)+"px",o.sizer.style.paddingBottom=(o.barHeight=i.bottom)+"px",o.heightForcer.style.borderBottom=i.bottom+"px solid transparent",i.right&&i.bottom?(o.scrollbarFiller.style.display="block",o.scrollbarFiller.style.height=i.bottom+"px",o.scrollbarFiller.style.width=i.right+"px"):o.scrollbarFiller.style.display="",i.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(o.gutterFiller.style.display="block",o.gutterFiller.style.height=i.bottom+"px",o.gutterFiller.style.width=t.gutterWidth+"px"):o.gutterFiller.style.display=""}var Nf={native:Jn,null:po};function Sf(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&pe(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Nf[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),Ie(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,o){o=="horizontal"?Hn(e,t):co(e,t)},e),e.display.scrollbars.addClass&&Oe(e.display.wrapper,e.display.scrollbars.addClass)}var l0=0;function Xn(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++l0,markArrays:null},Wm(e.curOp)}function Yn(e){var t=e.curOp;t&&Zm(t,function(o){for(var i=0;i<o.ops.length;i++)o.ops[i].cm.curOp=null;u0(o)})}function u0(e){for(var t=e.ops,o=0;o<t.length;o++)f0(t[o]);for(var i=0;i<t.length;i++)c0(t[i]);for(var s=0;s<t.length;s++)d0(t[s]);for(var u=0;u<t.length;u++)h0(t[u]);for(var d=0;d<t.length;d++)p0(t[d])}function f0(e){var t=e.cm,o=t.display;m0(t),e.updateMaxLine&&Ps(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<o.viewFrom||e.scrollToPos.to.line>=o.viewTo)||o.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new xa(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function c0(e){e.updatedDisplay=e.mustUpdate&&ll(e.cm,e.update)}function d0(e){var t=e.cm,o=t.display;e.updatedDisplay&&ba(t),e.barMeasure=ho(t),o.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=uf(t,o.maxLine,o.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(o.scroller.clientWidth,o.sizer.offsetLeft+e.adjustWidthTo+Vr(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,o.sizer.offsetLeft+e.adjustWidthTo-Zn(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=o.input.prepareSelection())}function h0(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&Hn(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var o=e.focus&&e.focus==ge(Ze(t));e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,o),(e.updatedDisplay||e.startHeight!=t.doc.height)&&bi(t,e.barMeasure),e.updatedDisplay&&cl(t,e.barMeasure),e.selectionChanged&&nl(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),o&&Ef(e.cm)}function p0(e){var t=e.cm,o=t.display,i=t.doc;if(e.updatedDisplay&&wf(t,e.update),o.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(o.wheelStartX=o.wheelStartY=null),e.scrollTop!=null&&_f(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&Hn(t,e.scrollLeft,!0,!0),e.scrollToPos){var s=o0(t,Se(i,e.scrollToPos.from),Se(i,e.scrollToPos.to),e.scrollToPos.margin);i0(t,s)}var u=e.maybeHiddenMarkers,d=e.maybeUnhiddenMarkers;if(u)for(var h=0;h<u.length;++h)u[h].lines.length||Ke(u[h],"hide");if(d)for(var m=0;m<d.length;++m)d[m].lines.length&&Ke(d[m],"unhide");o.wrapper.offsetHeight&&(i.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&Ke(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function cr(e,t){if(e.curOp)return t();Xn(e);try{return t()}finally{Yn(e)}}function St(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Xn(e);try{return t.apply(e,arguments)}finally{Yn(e)}}}function Jt(e){return function(){if(this.curOp)return e.apply(this,arguments);Xn(this);try{return e.apply(this,arguments)}finally{Yn(this)}}}function wt(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Xn(t);try{return e.apply(this,arguments)}finally{Yn(t)}}}function go(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,se(g0,e))}function g0(e){var t=e.doc;if(!(t.highlightFrontier>=e.display.viewTo)){var o=+new Date+e.options.workTime,i=no(e,t.highlightFrontier),s=[];t.iter(i.line,Math.min(t.first+t.size,e.display.viewTo+500),function(u){if(i.line>=e.display.viewFrom){var d=u.styles,h=u.text.length>e.options.maxHighlightLength?be(t.mode,i.state):null,m=Mu(e,u,i,!0);h&&(i.state=h),u.styles=m.styles;var b=u.styleClasses,I=m.classes;I?u.styleClasses=I:b&&(u.styleClasses=null);for(var C=!d||d.length!=u.styles.length||b!=I&&(!b||!I||b.bgClass!=I.bgClass||b.textClass!=I.textClass),B=0;!C&&B<d.length;++B)C=d[B]!=u.styles[B];C&&s.push(i.line),u.stateAfter=i.save(),i.nextLine()}else u.text.length<=e.options.maxHighlightLength&&Os(e,u.text,i),u.stateAfter=i.line%5==0?i.save():null,i.nextLine();if(+new Date>o)return go(e,e.options.workDelay),!0}),t.highlightFrontier=i.line,t.modeFrontier=Math.max(t.modeFrontier,i.line),s.length&&cr(e,function(){for(var u=0;u<s.length;u++)En(e,s[u],"text")})}}var xa=function(e,t,o){var i=e.display;this.viewport=t,this.visible=va(i,e.doc,t),this.editorIsHidden=!i.wrapper.offsetWidth,this.wrapperHeight=i.wrapper.clientHeight,this.wrapperWidth=i.wrapper.clientWidth,this.oldDisplayWidth=Zn(e),this.force=o,this.dims=$s(e),this.events=[]};xa.prototype.signal=function(e,t){yt(e,t)&&this.events.push(arguments)},xa.prototype.finish=function(){for(var e=0;e<this.events.length;e++)Ke.apply(null,this.events[e])};function m0(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Vr(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Vr(e)+"px",t.scrollbarsClipped=!0)}function b0(e){if(e.hasFocus())return null;var t=ge(Ze(e));if(!t||!ce(e.display.lineDiv,t))return null;var o={activeElt:t};if(window.getSelection){var i=ve(e).getSelection();i.anchorNode&&i.extend&&ce(e.display.lineDiv,i.anchorNode)&&(o.anchorNode=i.anchorNode,o.anchorOffset=i.anchorOffset,o.focusNode=i.focusNode,o.focusOffset=i.focusOffset)}return o}function v0(e){if(!(!e||!e.activeElt||e.activeElt==ge(Ce(e.activeElt)))&&(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&ce(document.body,e.anchorNode)&&ce(document.body,e.focusNode))){var t=e.activeElt.ownerDocument,o=t.defaultView.getSelection(),i=t.createRange();i.setEnd(e.anchorNode,e.anchorOffset),i.collapse(!1),o.removeAllRanges(),o.addRange(i),o.extend(e.focusNode,e.focusOffset)}}function ll(e,t){var o=e.display,i=e.doc;if(t.editorIsHidden)return Cn(e),!1;if(!t.force&&t.visible.from>=o.viewFrom&&t.visible.to<=o.viewTo&&(o.updateLineNumbers==null||o.updateLineNumbers>=o.viewTo)&&o.renderedView==o.view&&Tf(e)==0)return!1;Ff(e)&&(Cn(e),t.dims=$s(e));var s=i.first+i.size,u=Math.max(t.visible.from-e.options.viewportMargin,i.first),d=Math.min(s,t.visible.to+e.options.viewportMargin);o.viewFrom<u&&u-o.viewFrom<20&&(u=Math.max(i.first,o.viewFrom)),o.viewTo>d&&o.viewTo-d<20&&(d=Math.min(s,o.viewTo)),rn&&(u=Vs(e.doc,u),d=zu(e.doc,d));var h=u!=o.viewFrom||d!=o.viewTo||o.lastWrapHeight!=t.wrapperHeight||o.lastWrapWidth!=t.wrapperWidth;r0(e,u,d),o.viewOffset=nn(de(e.doc,o.viewFrom)),e.display.mover.style.top=o.viewOffset+"px";var m=Tf(e);if(!h&&m==0&&!t.force&&o.renderedView==o.view&&(o.updateLineNumbers==null||o.updateLineNumbers>=o.viewTo))return!1;var b=b0(e);return m>4&&(o.lineDiv.style.display="none"),y0(e,o.updateLineNumbers,t.dims),m>4&&(o.lineDiv.style.display=""),o.renderedView=o.view,v0(b),k(o.cursorDiv),k(o.selectionDiv),o.gutters.style.height=o.sizer.style.minHeight=0,h&&(o.lastWrapHeight=t.wrapperHeight,o.lastWrapWidth=t.wrapperWidth,go(e,400)),o.updateLineNumbers=null,!0}function wf(e,t){for(var o=t.viewport,i=!0;;i=!1){if(!i||!e.options.lineWrapping||t.oldDisplayWidth==Zn(e)){if(o&&o.top!=null&&(o={top:Math.min(e.doc.height+Js(e.display)-Xs(e),o.top)}),t.visible=va(e.display,e.doc,o),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else i&&(t.visible=va(e.display,e.doc,o));if(!ll(e,t))break;ba(e);var s=ho(e);uo(e),bi(e,s),cl(e,s),t.force=!1}t.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function ul(e,t){var o=new xa(e,t);if(ll(e,o)){ba(e),wf(e,o);var i=ho(e);uo(e),bi(e,i),cl(e,i),o.finish()}}function y0(e,t,o){var i=e.display,s=e.options.lineNumbers,u=i.lineDiv,d=u.firstChild;function h(W){var H=W.nextSibling;return T&&q&&e.display.currentWheelTarget==W?W.style.display="none":W.parentNode.removeChild(W),H}for(var m=i.view,b=i.viewFrom,I=0;I<m.length;I++){var C=m[I];if(!C.hidden)if(!C.node||C.node.parentNode!=u){var B=Jm(e,C,b,o);u.insertBefore(B,d)}else{for(;d!=C.node;)d=h(d);var L=s&&t!=null&&t<=b&&C.lineNumber;C.changes&&(ue(C.changes,"gutter")>-1&&(L=!1),tf(e,C,b,o)),L&&(k(C.lineNumber),C.lineNumber.appendChild(document.createTextNode(Y(e.options,b)))),d=C.node.nextSibling}b+=C.size}for(;d;)d=h(d)}function fl(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px",Nt(e,"gutterChanged",e)}function cl(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Vr(e)+"px"}function Lf(e){var t=e.display,o=t.view;if(!(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))){for(var i=el(t)-t.scroller.scrollLeft+e.doc.scrollLeft,s=t.gutters.offsetWidth,u=i+"px",d=0;d<o.length;d++)if(!o[d].hidden){e.options.fixedGutter&&(o[d].gutter&&(o[d].gutter.style.left=u),o[d].gutterBackground&&(o[d].gutterBackground.style.left=u));var h=o[d].alignable;if(h)for(var m=0;m<h.length;m++)h[m].style.left=u}e.options.fixedGutter&&(t.gutters.style.left=i+s+"px")}}function Ff(e){if(!e.options.lineNumbers)return!1;var t=e.doc,o=Y(e.options,t.first+t.size-1),i=e.display;if(o.length!=i.lineNumChars){var s=i.measure.appendChild(x("div",[x("div",o)],"CodeMirror-linenumber CodeMirror-gutter-elt")),u=s.firstChild.offsetWidth,d=s.offsetWidth-u;return i.lineGutter.style.width="",i.lineNumInnerWidth=Math.max(u,i.lineGutter.offsetWidth-d)+1,i.lineNumWidth=i.lineNumInnerWidth+d,i.lineNumChars=i.lineNumInnerWidth?o.length:-1,i.lineGutter.style.width=i.lineNumWidth+"px",fl(e.display),!0}return!1}function dl(e,t){for(var o=[],i=!1,s=0;s<e.length;s++){var u=e[s],d=null;if(typeof u!="string"&&(d=u.style,u=u.className),u=="CodeMirror-linenumbers")if(t)i=!0;else continue;o.push({className:u,style:d})}return t&&!i&&o.push({className:"CodeMirror-linenumbers",style:null}),o}function Bf(e){var t=e.gutters,o=e.gutterSpecs;k(t),e.lineGutter=null;for(var i=0;i<o.length;++i){var s=o[i],u=s.className,d=s.style,h=t.appendChild(x("div",null,"CodeMirror-gutter "+u));d&&(h.style.cssText=d),u=="CodeMirror-linenumbers"&&(e.lineGutter=h,h.style.width=(e.lineNumWidth||1)+"px")}t.style.display=o.length?"":"none",fl(e)}function mo(e){Bf(e.display),qt(e),Lf(e)}function x0(e,t,o,i){var s=this;this.input=o,s.scrollbarFiller=x("div",null,"CodeMirror-scrollbar-filler"),s.scrollbarFiller.setAttribute("cm-not-content","true"),s.gutterFiller=x("div",null,"CodeMirror-gutter-filler"),s.gutterFiller.setAttribute("cm-not-content","true"),s.lineDiv=ee("div",null,"CodeMirror-code"),s.selectionDiv=x("div",null,null,"position: relative; z-index: 1"),s.cursorDiv=x("div",null,"CodeMirror-cursors"),s.measure=x("div",null,"CodeMirror-measure"),s.lineMeasure=x("div",null,"CodeMirror-measure"),s.lineSpace=ee("div",[s.measure,s.lineMeasure,s.selectionDiv,s.cursorDiv,s.lineDiv],null,"position: relative; outline: none");var u=ee("div",[s.lineSpace],"CodeMirror-lines");s.mover=x("div",[u],null,"position: relative"),s.sizer=x("div",[s.mover],"CodeMirror-sizer"),s.sizerWidth=null,s.heightForcer=x("div",null,null,"position: absolute; height: "+Fe+"px; width: 1px;"),s.gutters=x("div",null,"CodeMirror-gutters"),s.lineGutter=null,s.scroller=x("div",[s.sizer,s.heightForcer,s.gutters],"CodeMirror-scroll"),s.scroller.setAttribute("tabIndex","-1"),s.wrapper=x("div",[s.scrollbarFiller,s.gutterFiller,s.scroller],"CodeMirror"),A&&F===105&&(s.wrapper.style.clipPath="inset(0px)"),s.wrapper.setAttribute("translate","no"),g&&y<8&&(s.gutters.style.zIndex=-1,s.scroller.style.paddingRight=0),!T&&!(a&&J)&&(s.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(s.wrapper):e(s.wrapper)),s.viewFrom=s.viewTo=t.first,s.reportedViewFrom=s.reportedViewTo=t.first,s.view=[],s.renderedView=null,s.externalMeasured=null,s.viewOffset=0,s.lastWrapHeight=s.lastWrapWidth=0,s.updateLineNumbers=null,s.nativeBarWidth=s.barHeight=s.barWidth=0,s.scrollbarsClipped=!1,s.lineNumWidth=s.lineNumInnerWidth=s.lineNumChars=null,s.alignWidgets=!1,s.cachedCharWidth=s.cachedTextHeight=s.cachedPaddingH=null,s.maxLine=null,s.maxLineLength=0,s.maxLineChanged=!1,s.wheelDX=s.wheelDY=s.wheelStartX=s.wheelStartY=null,s.shift=!1,s.selForContextMenu=null,s.activeTouch=null,s.gutterSpecs=dl(i.gutters,i.lineNumbers),Bf(s),o.init(s)}var Ta=0,an=null;g?an=-.53:a?an=15:A?an=-.7:X&&(an=-1/3);function Uf(e){var t=e.wheelDeltaX,o=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),o==null&&e.detail&&e.axis==e.VERTICAL_AXIS?o=e.detail:o==null&&(o=e.wheelDelta),{x:t,y:o}}function T0(e){var t=Uf(e);return t.x*=an,t.y*=an,t}function kf(e,t){A&&F==102&&(e.display.chromeScrollHack==null?e.display.sizer.style.pointerEvents="none":clearTimeout(e.display.chromeScrollHack),e.display.chromeScrollHack=setTimeout(function(){e.display.chromeScrollHack=null,e.display.sizer.style.pointerEvents=""},100));var o=Uf(t),i=o.x,s=o.y,u=an;t.deltaMode===0&&(i=t.deltaX,s=t.deltaY,u=1);var d=e.display,h=d.scroller,m=h.scrollWidth>h.clientWidth,b=h.scrollHeight>h.clientHeight;if(i&&m||s&&b){if(s&&q&&T){e:for(var I=t.target,C=d.view;I!=h;I=I.parentNode)for(var B=0;B<C.length;B++)if(C[B].node==I){e.display.currentWheelTarget=I;break e}}if(i&&!a&&!M&&u!=null){s&&b&&co(e,Math.max(0,h.scrollTop+s*u)),Hn(e,Math.max(0,h.scrollLeft+i*u)),(!s||s&&b)&&At(t),d.wheelStartX=null;return}if(s&&u!=null){var L=s*u,W=e.doc.scrollTop,H=W+d.wrapper.clientHeight;L<0?W=Math.max(0,W+L-50):H=Math.min(e.doc.height,H+L+50),ul(e,{top:W,bottom:H})}Ta<20&&t.deltaMode!==0&&(d.wheelStartX==null?(d.wheelStartX=h.scrollLeft,d.wheelStartY=h.scrollTop,d.wheelDX=i,d.wheelDY=s,setTimeout(function(){if(d.wheelStartX!=null){var z=h.scrollLeft-d.wheelStartX,ne=h.scrollTop-d.wheelStartY,he=ne&&d.wheelDY&&ne/d.wheelDY||z&&d.wheelDX&&z/d.wheelDX;d.wheelStartX=d.wheelStartY=null,he&&(an=(an*Ta+he)/(Ta+1),++Ta)}},200)):(d.wheelDX+=i,d.wheelDY+=s))}}var Ir=function(e,t){this.ranges=e,this.primIndex=t};Ir.prototype.primary=function(){return this.ranges[this.primIndex]},Ir.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var o=this.ranges[t],i=e.ranges[t];if(!Pe(o.anchor,i.anchor)||!Pe(o.head,i.head))return!1}return!0},Ir.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new He(Rt(this.ranges[t].anchor),Rt(this.ranges[t].head));return new Ir(e,this.primIndex)},Ir.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Ir.prototype.contains=function(e,t){t||(t=e);for(var o=0;o<this.ranges.length;o++){var i=this.ranges[o];if(fe(t,i.from())>=0&&fe(e,i.to())<=0)return o}return-1};var He=function(e,t){this.anchor=e,this.head=t};He.prototype.from=function(){return ui(this.anchor,this.head)},He.prototype.to=function(){return zt(this.anchor,this.head)},He.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Br(e,t,o){var i=e&&e.options.selectionsMayTouch,s=t[o];t.sort(function(B,L){return fe(B.from(),L.from())}),o=ue(t,s);for(var u=1;u<t.length;u++){var d=t[u],h=t[u-1],m=fe(h.to(),d.from());if(i&&!d.empty()?m>0:m>=0){var b=ui(h.from(),d.from()),I=zt(h.to(),d.to()),C=h.empty()?d.from()==d.head:h.from()==h.head;u<=o&&--o,t.splice(--u,2,new He(C?I:b,C?b:I))}}return new Ir(t,o)}function An(e,t){return new Ir([new He(e,t||e)],0)}function _n(e){return e.text?O(e.from.line+e.text.length-1,Te(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Mf(e,t){if(fe(e,t.from)<0)return e;if(fe(e,t.to)<=0)return _n(t);var o=e.line+t.text.length-(t.to.line-t.from.line)-1,i=e.ch;return e.line==t.to.line&&(i+=_n(t).ch-t.to.ch),O(o,i)}function hl(e,t){for(var o=[],i=0;i<e.sel.ranges.length;i++){var s=e.sel.ranges[i];o.push(new He(Mf(s.anchor,t),Mf(s.head,t)))}return Br(e.cm,o,e.sel.primIndex)}function Gf(e,t,o){return e.line==t.line?O(o.line,e.ch-t.ch+o.ch):O(o.line+(e.line-t.line),e.ch)}function I0(e,t,o){for(var i=[],s=O(e.first,0),u=s,d=0;d<t.length;d++){var h=t[d],m=Gf(h.from,s,u),b=Gf(_n(h),s,u);if(s=h.to,u=b,o=="around"){var I=e.sel.ranges[d],C=fe(I.head,I.anchor)<0;i[d]=new He(C?b:m,C?m:b)}else i[d]=new He(m,m)}return new Ir(i,e.sel.primIndex)}function pl(e){e.doc.mode=xe(e.options,e.doc.modeOption),bo(e)}function bo(e){e.doc.iter(function(t){t.stateAfter&&(t.stateAfter=null),t.styles&&(t.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,go(e,100),e.state.modeGen++,e.curOp&&qt(e)}function Of(e,t){return t.from.ch==0&&t.to.ch==0&&Te(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function gl(e,t,o,i){function s(he){return o?o[he]:null}function u(he,ie,me){wm(he,ie,me,i),Nt(he,"change",he,t)}function d(he,ie){for(var me=[],Ae=he;Ae<ie;++Ae)me.push(new fi(b[Ae],s(Ae),i));return me}var h=t.from,m=t.to,b=t.text,I=de(e,h.line),C=de(e,m.line),B=Te(b),L=s(b.length-1),W=m.line-h.line;if(t.full)e.insert(0,d(0,b.length)),e.remove(b.length,e.size-b.length);else if(Of(e,t)){var H=d(0,b.length-1);u(C,C.text,L),W&&e.remove(h.line,W),H.length&&e.insert(h.line,H)}else if(I==C)if(b.length==1)u(I,I.text.slice(0,h.ch)+B+I.text.slice(m.ch),L);else{var z=d(1,b.length-1);z.push(new fi(B+I.text.slice(m.ch),L,i)),u(I,I.text.slice(0,h.ch)+b[0],s(0)),e.insert(h.line+1,z)}else if(b.length==1)u(I,I.text.slice(0,h.ch)+b[0]+C.text.slice(m.ch),s(0)),e.remove(h.line+1,W);else{u(I,I.text.slice(0,h.ch)+b[0],s(0)),u(C,B+C.text.slice(m.ch),L);var ne=d(1,b.length-1);W>1&&e.remove(h.line+1,W-1),e.insert(h.line+1,ne)}Nt(e,"change",e,t)}function Rn(e,t,o){function i(s,u,d){if(s.linked)for(var h=0;h<s.linked.length;++h){var m=s.linked[h];if(m.doc!=u){var b=d&&m.sharedHist;o&&!b||(t(m.doc,b),i(m.doc,s,b))}}}i(e,null,!0)}function Wf(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,tl(e),pl(e),Df(e),e.options.direction=t.direction,e.options.lineWrapping||Ps(e),e.options.mode=t.modeOption,qt(e)}function Df(e){(e.doc.direction=="rtl"?Oe:pe)(e.display.lineDiv,"CodeMirror-rtl")}function E0(e){cr(e,function(){Df(e),qt(e)})}function Ia(e){this.done=[],this.undone=[],this.undoDepth=e?e.undoDepth:1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e?e.maxGeneration:1}function ml(e,t){var o={from:Rt(t.from),to:_n(t),text:_t(e,t.from,t.to)};return Qf(e,o,t.from.line,t.to.line+1),Rn(e,function(i){return Qf(i,o,t.from.line,t.to.line+1)},!0),o}function Zf(e){for(;e.length;){var t=Te(e);if(t.ranges)e.pop();else break}}function C0(e,t){if(t)return Zf(e.done),Te(e.done);if(e.done.length&&!Te(e.done).ranges)return Te(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),Te(e.done)}function Vf(e,t,o,i){var s=e.history;s.undone.length=0;var u=+new Date,d,h;if((s.lastOp==i||s.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&s.lastModTime>u-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(d=C0(s,s.lastOp==i)))h=Te(d.changes),fe(t.from,t.to)==0&&fe(t.from,h.to)==0?h.to=_n(t):d.changes.push(ml(e,t));else{var m=Te(s.done);for((!m||!m.ranges)&&Ea(e.sel,s.done),d={changes:[ml(e,t)],generation:s.generation},s.done.push(d);s.done.length>s.undoDepth;)s.done.shift(),s.done[0].ranges||s.done.shift()}s.done.push(o),s.generation=++s.maxGeneration,s.lastModTime=s.lastSelTime=u,s.lastOp=s.lastSelOp=i,s.lastOrigin=s.lastSelOrigin=t.origin,h||Ke(e,"historyAdded")}function A0(e,t,o,i){var s=t.charAt(0);return s=="*"||s=="+"&&o.ranges.length==i.ranges.length&&o.somethingSelected()==i.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function _0(e,t,o,i){var s=e.history,u=i&&i.origin;o==s.lastSelOp||u&&s.lastSelOrigin==u&&(s.lastModTime==s.lastSelTime&&s.lastOrigin==u||A0(e,u,Te(s.done),t))?s.done[s.done.length-1]=t:Ea(t,s.done),s.lastSelTime=+new Date,s.lastSelOrigin=u,s.lastSelOp=o,i&&i.clearRedo!==!1&&Zf(s.undone)}function Ea(e,t){var o=Te(t);o&&o.ranges&&o.equals(e)||t.push(e)}function Qf(e,t,o,i){var s=t["spans_"+e.id],u=0;e.iter(Math.max(e.first,o),Math.min(e.first+e.size,i),function(d){d.markedSpans&&((s||(s=t["spans_"+e.id]={}))[u]=d.markedSpans),++u})}function R0(e){if(!e)return null;for(var t,o=0;o<e.length;++o)e[o].marker.explicitlyCleared?t||(t=e.slice(0,o)):t&&t.push(e[o]);return t?t.length?t:null:e}function N0(e,t){var o=t["spans_"+e.id];if(!o)return null;for(var i=[],s=0;s<t.text.length;++s)i.push(R0(o[s]));return i}function Pf(e,t){var o=N0(e,t),i=Ds(e,t);if(!o)return i;if(!i)return o;for(var s=0;s<o.length;++s){var u=o[s],d=i[s];if(u&&d)e:for(var h=0;h<d.length;++h){for(var m=d[h],b=0;b<u.length;++b)if(u[b].marker==m.marker)continue e;u.push(m)}else d&&(o[s]=d)}return o}function vi(e,t,o){for(var i=[],s=0;s<e.length;++s){var u=e[s];if(u.ranges){i.push(o?Ir.prototype.deepCopy.call(u):u);continue}var d=u.changes,h=[];i.push({changes:h});for(var m=0;m<d.length;++m){var b=d[m],I=void 0;if(h.push({from:b.from,to:b.to,text:b.text}),t)for(var C in b)(I=C.match(/^spans_(\d+)$/))&&ue(t,Number(I[1]))>-1&&(Te(h)[C]=b[C],delete b[C])}}return i}function bl(e,t,o,i){if(i){var s=e.anchor;if(o){var u=fe(t,s)<0;u!=fe(o,s)<0?(s=t,t=o):u!=fe(t,o)<0&&(t=o)}return new He(s,t)}else return new He(o||t,t)}function Ca(e,t,o,i,s){s==null&&(s=e.cm&&(e.cm.display.shift||e.extend)),Zt(e,new Ir([bl(e.sel.primary(),t,o,s)],0),i)}function Hf(e,t,o){for(var i=[],s=e.cm&&(e.cm.display.shift||e.extend),u=0;u<e.sel.ranges.length;u++)i[u]=bl(e.sel.ranges[u],t[u],null,s);var d=Br(e.cm,i,e.sel.primIndex);Zt(e,d,o)}function vl(e,t,o,i){var s=e.sel.ranges.slice(0);s[t]=o,Zt(e,Br(e.cm,s,e.sel.primIndex),i)}function Jf(e,t,o,i){Zt(e,An(t,o),i)}function S0(e,t,o){var i={ranges:t.ranges,update:function(s){this.ranges=[];for(var u=0;u<s.length;u++)this.ranges[u]=new He(Se(e,s[u].anchor),Se(e,s[u].head))},origin:o&&o.origin};return Ke(e,"beforeSelectionChange",e,i),e.cm&&Ke(e.cm,"beforeSelectionChange",e.cm,i),i.ranges!=t.ranges?Br(e.cm,i.ranges,i.ranges.length-1):t}function Xf(e,t,o){var i=e.history.done,s=Te(i);s&&s.ranges?(i[i.length-1]=t,Aa(e,t,o)):Zt(e,t,o)}function Zt(e,t,o){Aa(e,t,o),_0(e,e.sel,e.cm?e.cm.curOp.id:NaN,o)}function Aa(e,t,o){(yt(e,"beforeSelectionChange")||e.cm&&yt(e.cm,"beforeSelectionChange"))&&(t=S0(e,t,o));var i=o&&o.bias||(fe(t.primary().head,e.sel.primary().head)<0?-1:1);Yf(e,zf(e,t,i,!0)),!(o&&o.scroll===!1)&&e.cm&&e.cm.getOption("readOnly")!="nocursor"&&mi(e.cm)}function Yf(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,sr(e.cm)),Nt(e,"cursorActivity",e))}function jf(e){Yf(e,zf(e,e.sel,null,!1))}function zf(e,t,o,i){for(var s,u=0;u<t.ranges.length;u++){var d=t.ranges[u],h=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[u],m=_a(e,d.anchor,h&&h.anchor,o,i),b=d.head==d.anchor?m:_a(e,d.head,h&&h.head,o,i);(s||m!=d.anchor||b!=d.head)&&(s||(s=t.ranges.slice(0,u)),s[u]=new He(m,b))}return s?Br(e.cm,s,t.primIndex):t}function yi(e,t,o,i,s){var u=de(e,t.line);if(u.markedSpans)for(var d=0;d<u.markedSpans.length;++d){var h=u.markedSpans[d],m=h.marker,b="selectLeft"in m?!m.selectLeft:m.inclusiveLeft,I="selectRight"in m?!m.selectRight:m.inclusiveRight;if((h.from==null||(b?h.from<=t.ch:h.from<t.ch))&&(h.to==null||(I?h.to>=t.ch:h.to>t.ch))){if(s&&(Ke(m,"beforeCursorEnter"),m.explicitlyCleared))if(u.markedSpans){--d;continue}else break;if(!m.atomic)continue;if(o){var C=m.find(i<0?1:-1),B=void 0;if((i<0?I:b)&&(C=qf(e,C,-i,C&&C.line==t.line?u:null)),C&&C.line==t.line&&(B=fe(C,o))&&(i<0?B<0:B>0))return yi(e,C,t,i,s)}var L=m.find(i<0?-1:1);return(i<0?b:I)&&(L=qf(e,L,i,L.line==t.line?u:null)),L?yi(e,L,t,i,s):null}}return t}function _a(e,t,o,i,s){var u=i||1,d=yi(e,t,o,u,s)||!s&&yi(e,t,o,u,!0)||yi(e,t,o,-u,s)||!s&&yi(e,t,o,-u,!0);return d||(e.cantEdit=!0,O(e.first,0))}function qf(e,t,o,i){return o<0&&t.ch==0?t.line>e.first?Se(e,O(t.line-1)):null:o>0&&t.ch==(i||de(e,t.line)).text.length?t.line<e.first+e.size-1?O(t.line+1,0):null:new O(t.line,t.ch+o)}function Kf(e){e.setSelection(O(e.firstLine(),0),O(e.lastLine()),Me)}function $f(e,t,o){var i={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return i.canceled=!0}};return o&&(i.update=function(s,u,d,h){s&&(i.from=Se(e,s)),u&&(i.to=Se(e,u)),d&&(i.text=d),h!==void 0&&(i.origin=h)}),Ke(e,"beforeChange",e,i),e.cm&&Ke(e.cm,"beforeChange",e.cm,i),i.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:i.from,to:i.to,text:i.text,origin:i.origin}}function xi(e,t,o){if(e.cm){if(!e.cm.curOp)return St(e.cm,xi)(e,t,o);if(e.cm.state.suppressEdits)return}if(!((yt(e,"beforeChange")||e.cm&&yt(e.cm,"beforeChange"))&&(t=$f(e,t,!0),!t))){var i=Qu&&!o&&_m(e,t.from,t.to);if(i)for(var s=i.length-1;s>=0;--s)ec(e,{from:i[s].from,to:i[s].to,text:s?[""]:t.text,origin:t.origin});else ec(e,t)}}function ec(e,t){if(!(t.text.length==1&&t.text[0]==""&&fe(t.from,t.to)==0)){var o=hl(e,t);Vf(e,t,o,e.cm?e.cm.curOp.id:NaN),vo(e,t,o,Ds(e,t));var i=[];Rn(e,function(s,u){!u&&ue(i,s.history)==-1&&(ic(s.history,t),i.push(s.history)),vo(s,t,null,Ds(s,t))})}}function Ra(e,t,o){var i=e.cm&&e.cm.state.suppressEdits;if(!(i&&!o)){for(var s=e.history,u,d=e.sel,h=t=="undo"?s.done:s.undone,m=t=="undo"?s.undone:s.done,b=0;b<h.length&&(u=h[b],!(o?u.ranges&&!u.equals(e.sel):!u.ranges));b++);if(b!=h.length){for(s.lastOrigin=s.lastSelOrigin=null;;)if(u=h.pop(),u.ranges){if(Ea(u,m),o&&!u.equals(e.sel)){Zt(e,u,{clearRedo:!1});return}d=u}else if(i){h.push(u);return}else break;var I=[];Ea(d,m),m.push({changes:I,generation:s.generation}),s.generation=u.generation||++s.maxGeneration;for(var C=yt(e,"beforeChange")||e.cm&&yt(e.cm,"beforeChange"),B=function(H){var z=u.changes[H];if(z.origin=t,C&&!$f(e,z,!1))return h.length=0,{};I.push(ml(e,z));var ne=H?hl(e,z):Te(h);vo(e,z,ne,Pf(e,z)),!H&&e.cm&&e.cm.scrollIntoView({from:z.from,to:_n(z)});var he=[];Rn(e,function(ie,me){!me&&ue(he,ie.history)==-1&&(ic(ie.history,z),he.push(ie.history)),vo(ie,z,null,Pf(ie,z))})},L=u.changes.length-1;L>=0;--L){var W=B(L);if(W)return W.v}}}}function tc(e,t){if(t!=0&&(e.first+=t,e.sel=new Ir(It(e.sel.ranges,function(s){return new He(O(s.anchor.line+t,s.anchor.ch),O(s.head.line+t,s.head.ch))}),e.sel.primIndex),e.cm)){qt(e.cm,e.first,e.first-t,t);for(var o=e.cm.display,i=o.viewFrom;i<o.viewTo;i++)En(e.cm,i,"gutter")}}function vo(e,t,o,i){if(e.cm&&!e.cm.curOp)return St(e.cm,vo)(e,t,o,i);if(t.to.line<e.first){tc(e,t.text.length-1-(t.to.line-t.from.line));return}if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var s=t.text.length-1-(e.first-t.from.line);tc(e,s),t={from:O(e.first,0),to:O(t.to.line+s,t.to.ch),text:[Te(t.text)],origin:t.origin}}var u=e.lastLine();t.to.line>u&&(t={from:t.from,to:O(u,de(e,u).text.length),text:[t.text[0]],origin:t.origin}),t.removed=_t(e,t.from,t.to),o||(o=hl(e,t)),e.cm?w0(e.cm,t,i):gl(e,t,i),Aa(e,o,Me),e.cantEdit&&_a(e,O(e.firstLine(),0))&&(e.cantEdit=!1)}}function w0(e,t,o){var i=e.doc,s=e.display,u=t.from,d=t.to,h=!1,m=u.line;e.options.lineWrapping||(m=v(Lr(de(i,u.line))),i.iter(m,d.line+1,function(L){if(L==s.maxLine)return h=!0,!0})),i.sel.contains(t.from,t.to)>-1&&sr(e),gl(i,t,o,xf(e)),e.options.lineWrapping||(i.iter(m,u.line+t.text.length,function(L){var W=fa(L);W>s.maxLineLength&&(s.maxLine=L,s.maxLineLength=W,s.maxLineChanged=!0,h=!1)}),h&&(e.curOp.updateMaxLine=!0)),ym(i,u.line),go(e,400);var b=t.text.length-(d.line-u.line)-1;t.full?qt(e):u.line==d.line&&t.text.length==1&&!Of(e.doc,t)?En(e,u.line,"text"):qt(e,u.line,d.line+1,b);var I=yt(e,"changes"),C=yt(e,"change");if(C||I){var B={from:u,to:d,text:t.text,removed:t.removed,origin:t.origin};C&&Nt(e,"change",e,B),I&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(B)}e.display.selForContextMenu=null}function Ti(e,t,o,i,s){var u;i||(i=o),fe(i,o)<0&&(u=[i,o],o=u[0],i=u[1]),typeof t=="string"&&(t=e.splitLines(t)),xi(e,{from:o,to:i,text:t,origin:s})}function rc(e,t,o,i){o<e.line?e.line+=i:t<e.line&&(e.line=t,e.ch=0)}function nc(e,t,o,i){for(var s=0;s<e.length;++s){var u=e[s],d=!0;if(u.ranges){u.copied||(u=e[s]=u.deepCopy(),u.copied=!0);for(var h=0;h<u.ranges.length;h++)rc(u.ranges[h].anchor,t,o,i),rc(u.ranges[h].head,t,o,i);continue}for(var m=0;m<u.changes.length;++m){var b=u.changes[m];if(o<b.from.line)b.from=O(b.from.line+i,b.from.ch),b.to=O(b.to.line+i,b.to.ch);else if(t<=b.to.line){d=!1;break}}d||(e.splice(0,s+1),s=0)}}function ic(e,t){var o=t.from.line,i=t.to.line,s=t.text.length-(i-o)-1;nc(e.done,o,i,s),nc(e.undone,o,i,s)}function yo(e,t,o,i){var s=t,u=t;return typeof t=="number"?u=de(e,Uu(e,t)):s=v(t),s==null?null:(i(u,s)&&e.cm&&En(e.cm,s,o),u)}function xo(e){this.lines=e,this.parent=null;for(var t=0,o=0;o<e.length;++o)e[o].parent=this,t+=e[o].height;this.height=t}xo.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var o=e,i=e+t;o<i;++o){var s=this.lines[o];this.height-=s.height,Lm(s),Nt(s,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,o){this.height+=o,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var i=0;i<t.length;++i)t[i].parent=this},iterN:function(e,t,o){for(var i=e+t;e<i;++e)if(o(this.lines[e]))return!0}};function To(e){this.children=e;for(var t=0,o=0,i=0;i<e.length;++i){var s=e[i];t+=s.chunkSize(),o+=s.height,s.parent=this}this.size=t,this.height=o,this.parent=null}To.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var o=0;o<this.children.length;++o){var i=this.children[o],s=i.chunkSize();if(e<s){var u=Math.min(t,s-e),d=i.height;if(i.removeInner(e,u),this.height-=d-i.height,s==u&&(this.children.splice(o--,1),i.parent=null),(t-=u)==0)break;e=0}else e-=s}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof xo))){var h=[];this.collapse(h),this.children=[new xo(h)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,o){this.size+=t.length,this.height+=o;for(var i=0;i<this.children.length;++i){var s=this.children[i],u=s.chunkSize();if(e<=u){if(s.insertInner(e,t,o),s.lines&&s.lines.length>50){for(var d=s.lines.length%25+25,h=d;h<s.lines.length;){var m=new xo(s.lines.slice(h,h+=25));s.height-=m.height,this.children.splice(++i,0,m),m.parent=this}s.lines=s.lines.slice(0,d),this.maybeSpill()}break}e-=u}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=e.children.splice(e.children.length-5,5),o=new To(t);if(e.parent){e.size-=o.size,e.height-=o.height;var s=ue(e.parent.children,e);e.parent.children.splice(s+1,0,o)}else{var i=new To(e.children);i.parent=e,e.children=[i,o],e=i}o.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,o){for(var i=0;i<this.children.length;++i){var s=this.children[i],u=s.chunkSize();if(e<u){var d=Math.min(t,u-e);if(s.iterN(e,d,o))return!0;if((t-=d)==0)break;e=0}else e-=u}}};var Io=function(e,t,o){if(o)for(var i in o)o.hasOwnProperty(i)&&(this[i]=o[i]);this.doc=e,this.node=t};Io.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,o=this.line,i=v(o);if(!(i==null||!t)){for(var s=0;s<t.length;++s)t[s]==this&&t.splice(s--,1);t.length||(o.widgets=null);var u=so(this);Dt(o,Math.max(0,o.height-u)),e&&(cr(e,function(){oc(e,o,-u),En(e,i,"widget")}),Nt(e,"lineWidgetCleared",e,this,i))}},Io.prototype.changed=function(){var e=this,t=this.height,o=this.doc.cm,i=this.line;this.height=null;var s=so(this)-t;s&&(In(this.doc,i)||Dt(i,i.height+s),o&&cr(o,function(){o.curOp.forceUpdate=!0,oc(o,i,s),Nt(o,"lineWidgetChanged",o,e,v(i))}))},xr(Io);function oc(e,t,o){nn(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&sl(e,o)}function L0(e,t,o,i){var s=new Io(e,o,i),u=e.cm;return u&&s.noHScroll&&(u.display.alignWidgets=!0),yo(e,t,"widget",function(d){var h=d.widgets||(d.widgets=[]);if(s.insertAt==null?h.push(s):h.splice(Math.min(h.length,Math.max(0,s.insertAt)),0,s),s.line=d,u&&!In(e,d)){var m=nn(d)<e.scrollTop;Dt(d,d.height+so(s)),m&&sl(u,s.height),u.curOp.forceUpdate=!0}return!0}),u&&Nt(u,"lineWidgetAdded",u,s,typeof t=="number"?t:v(t)),s}var ac=0,Nn=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++ac};Nn.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&Xn(e),yt(this,"clear")){var o=this.find();o&&Nt(this,"clear",o.from,o.to)}for(var i=null,s=null,u=0;u<this.lines.length;++u){var d=this.lines[u],h=io(d.markedSpans,this);e&&!this.collapsed?En(e,v(d),"text"):e&&(h.to!=null&&(s=v(d)),h.from!=null&&(i=v(d))),d.markedSpans=Im(d.markedSpans,h),h.from==null&&this.collapsed&&!In(this.doc,d)&&e&&Dt(d,hi(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var m=0;m<this.lines.length;++m){var b=Lr(this.lines[m]),I=fa(b);I>e.display.maxLineLength&&(e.display.maxLine=b,e.display.maxLineLength=I,e.display.maxLineChanged=!0)}i!=null&&e&&this.collapsed&&qt(e,i,s+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&jf(e.doc)),e&&Nt(e,"markerCleared",e,this,i,s),t&&Yn(e),this.parent&&this.parent.clear()}},Nn.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var o,i,s=0;s<this.lines.length;++s){var u=this.lines[s],d=io(u.markedSpans,this);if(d.from!=null&&(o=O(t?u:v(u),d.from),e==-1))return o;if(d.to!=null&&(i=O(t?u:v(u),d.to),e==1))return i}return o&&{from:o,to:i}},Nn.prototype.changed=function(){var e=this,t=this.find(-1,!0),o=this,i=this.doc.cm;!t||!i||cr(i,function(){var s=t.line,u=v(t.line),d=Ys(i,u);if(d&&(df(d),i.curOp.selectionChanged=i.curOp.forceUpdate=!0),i.curOp.updateMaxLine=!0,!In(o.doc,s)&&o.height!=null){var h=o.height;o.height=null;var m=so(o)-h;m&&Dt(s,s.height+m)}Nt(i,"markerChanged",i,e)})},Nn.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||ue(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},Nn.prototype.detachLine=function(e){if(this.lines.splice(ue(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},xr(Nn);function Ii(e,t,o,i,s){if(i&&i.shared)return F0(e,t,o,i,s);if(e.cm&&!e.cm.curOp)return St(e.cm,Ii)(e,t,o,i,s);var u=new Nn(e,s),d=fe(t,o);if(i&&le(i,u,!1),d>0||d==0&&u.clearWhenEmpty!==!1)return u;if(u.replacedWith&&(u.collapsed=!0,u.widgetNode=ee("span",[u.replacedWith],"CodeMirror-widget"),i.handleMouseEvents||u.widgetNode.setAttribute("cm-ignore-events","true"),i.insertLeft&&(u.widgetNode.insertLeft=!0)),u.collapsed){if(ju(e,t.line,t,o,u)||t.line!=o.line&&ju(e,o.line,t,o,u))throw new Error("Inserting collapsed marker partially overlapping an existing one");Tm()}u.addToHistory&&Vf(e,{from:t,to:o,origin:"markText"},e.sel,NaN);var h=t.line,m=e.cm,b;if(e.iter(h,o.line+1,function(C){m&&u.collapsed&&!m.options.lineWrapping&&Lr(C)==m.display.maxLine&&(b=!0),u.collapsed&&h!=t.line&&Dt(C,0),Em(C,new aa(u,h==t.line?t.ch:null,h==o.line?o.ch:null),e.cm&&e.cm.curOp),++h}),u.collapsed&&e.iter(t.line,o.line+1,function(C){In(e,C)&&Dt(C,0)}),u.clearOnEnter&&Ie(u,"beforeCursorEnter",function(){return u.clear()}),u.readOnly&&(xm(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),u.collapsed&&(u.id=++ac,u.atomic=!0),m){if(b&&(m.curOp.updateMaxLine=!0),u.collapsed)qt(m,t.line,o.line+1);else if(u.className||u.startStyle||u.endStyle||u.css||u.attributes||u.title)for(var I=t.line;I<=o.line;I++)En(m,I,"text");u.atomic&&jf(m.doc),Nt(m,"markerAdded",m,u)}return u}var Eo=function(e,t){this.markers=e,this.primary=t;for(var o=0;o<e.length;++o)e[o].parent=this};Eo.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();Nt(this,"clear")}},Eo.prototype.find=function(e,t){return this.primary.find(e,t)},xr(Eo);function F0(e,t,o,i,s){i=le(i),i.shared=!1;var u=[Ii(e,t,o,i,s)],d=u[0],h=i.widgetNode;return Rn(e,function(m){h&&(i.widgetNode=h.cloneNode(!0)),u.push(Ii(m,Se(m,t),Se(m,o),i,s));for(var b=0;b<m.linked.length;++b)if(m.linked[b].isParent)return;d=Te(u)}),new Eo(u,d)}function sc(e){return e.findMarks(O(e.first,0),e.clipPos(O(e.lastLine())),function(t){return t.parent})}function B0(e,t){for(var o=0;o<t.length;o++){var i=t[o],s=i.find(),u=e.clipPos(s.from),d=e.clipPos(s.to);if(fe(u,d)){var h=Ii(e,u,d,i.primary,i.primary.type);i.markers.push(h),h.parent=i}}}function U0(e){for(var t=function(i){var s=e[i],u=[s.primary.doc];Rn(s.primary.doc,function(m){return u.push(m)});for(var d=0;d<s.markers.length;d++){var h=s.markers[d];ue(u,h.doc)==-1&&(h.parent=null,s.markers.splice(d--,1))}},o=0;o<e.length;o++)t(o)}var k0=0,Kt=function(e,t,o,i,s){if(!(this instanceof Kt))return new Kt(e,t,o,i,s);o==null&&(o=0),To.call(this,[new xo([new fi("",null)])]),this.first=o,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=o;var u=O(o,0);this.sel=An(u),this.history=new Ia(null),this.id=++k0,this.modeOption=t,this.lineSep=i,this.direction=s=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),gl(this,{from:u,to:u,text:e}),Zt(this,An(u),Me)};Kt.prototype=lt(To.prototype,{constructor:Kt,iter:function(e,t,o){o?this.iterN(e-this.first,t-e,o):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var o=0,i=0;i<t.length;++i)o+=t[i].height;this.insertInner(e-this.first,t,o)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=Cr(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:wt(function(e){var t=O(this.first,0),o=this.first+this.size-1;xi(this,{from:t,to:O(o,de(this,o).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&fo(this.cm,0,0),Zt(this,An(t),Me)}),replaceRange:function(e,t,o,i){t=Se(this,t),o=o?Se(this,o):t,Ti(this,e,t,o,i)},getRange:function(e,t,o){var i=_t(this,Se(this,e),Se(this,t));return o===!1?i:o===""?i.join(""):i.join(o||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(V(this,e))return de(this,e)},getLineNumber:function(e){return v(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=de(this,e)),Lr(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return Se(this,e)},getCursor:function(e){var t=this.sel.primary(),o;return e==null||e=="head"?o=t.head:e=="anchor"?o=t.anchor:e=="end"||e=="to"||e===!1?o=t.to():o=t.from(),o},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:wt(function(e,t,o){Jf(this,Se(this,typeof e=="number"?O(e,t||0):e),null,o)}),setSelection:wt(function(e,t,o){Jf(this,Se(this,e),Se(this,t||e),o)}),extendSelection:wt(function(e,t,o){Ca(this,Se(this,e),t&&Se(this,t),o)}),extendSelections:wt(function(e,t){Hf(this,ku(this,e),t)}),extendSelectionsBy:wt(function(e,t){var o=It(this.sel.ranges,e);Hf(this,ku(this,o),t)}),setSelections:wt(function(e,t,o){if(e.length){for(var i=[],s=0;s<e.length;s++)i[s]=new He(Se(this,e[s].anchor),Se(this,e[s].head||e[s].anchor));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),Zt(this,Br(this.cm,i,t),o)}}),addSelection:wt(function(e,t,o){var i=this.sel.ranges.slice(0);i.push(new He(Se(this,e),Se(this,t||e))),Zt(this,Br(this.cm,i,i.length-1),o)}),getSelection:function(e){for(var t=this.sel.ranges,o,i=0;i<t.length;i++){var s=_t(this,t[i].from(),t[i].to());o=o?o.concat(s):s}return e===!1?o:o.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],o=this.sel.ranges,i=0;i<o.length;i++){var s=_t(this,o[i].from(),o[i].to());e!==!1&&(s=s.join(e||this.lineSeparator())),t[i]=s}return t},replaceSelection:function(e,t,o){for(var i=[],s=0;s<this.sel.ranges.length;s++)i[s]=e;this.replaceSelections(i,t,o||"+input")},replaceSelections:wt(function(e,t,o){for(var i=[],s=this.sel,u=0;u<s.ranges.length;u++){var d=s.ranges[u];i[u]={from:d.from(),to:d.to(),text:this.splitLines(e[u]),origin:o}}for(var h=t&&t!="end"&&I0(this,i,t),m=i.length-1;m>=0;m--)xi(this,i[m]);h?Xf(this,h):this.cm&&mi(this.cm)}),undo:wt(function(){Ra(this,"undo")}),redo:wt(function(){Ra(this,"redo")}),undoSelection:wt(function(){Ra(this,"undo",!0)}),redoSelection:wt(function(){Ra(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,o=0,i=0;i<e.done.length;i++)e.done[i].ranges||++t;for(var s=0;s<e.undone.length;s++)e.undone[s].ranges||++o;return{undo:t,redo:o}},clearHistory:function(){var e=this;this.history=new Ia(this.history),Rn(this,function(t){return t.history=e.history},!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:vi(this.history.done),undone:vi(this.history.undone)}},setHistory:function(e){var t=this.history=new Ia(this.history);t.done=vi(e.done.slice(0),null,!0),t.undone=vi(e.undone.slice(0),null,!0)},setGutterMarker:wt(function(e,t,o){return yo(this,e,"gutter",function(i){var s=i.gutterMarkers||(i.gutterMarkers={});return s[t]=o,!o&&mt(s)&&(i.gutterMarkers=null),!0})}),clearGutter:wt(function(e){var t=this;this.iter(function(o){o.gutterMarkers&&o.gutterMarkers[e]&&yo(t,o,"gutter",function(){return o.gutterMarkers[e]=null,mt(o.gutterMarkers)&&(o.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!V(this,e)||(t=e,e=de(this,e),!e))return null}else if(t=v(e),t==null)return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:wt(function(e,t,o){return yo(this,e,t=="gutter"?"gutter":"class",function(i){var s=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!i[s])i[s]=o;else{if($(o).test(i[s]))return!1;i[s]+=" "+o}return!0})}),removeLineClass:wt(function(e,t,o){return yo(this,e,t=="gutter"?"gutter":"class",function(i){var s=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",u=i[s];if(u)if(o==null)i[s]=null;else{var d=u.match($(o));if(!d)return!1;var h=d.index+d[0].length;i[s]=u.slice(0,d.index)+(!d.index||h==u.length?"":" ")+u.slice(h)||null}else return!1;return!0})}),addLineWidget:wt(function(e,t,o){return L0(this,e,t,o)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,o){return Ii(this,Se(this,e),Se(this,t),o,o&&o.type||"range")},setBookmark:function(e,t){var o={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=Se(this,e),Ii(this,e,e,o,"bookmark")},findMarksAt:function(e){e=Se(this,e);var t=[],o=de(this,e.line).markedSpans;if(o)for(var i=0;i<o.length;++i){var s=o[i];(s.from==null||s.from<=e.ch)&&(s.to==null||s.to>=e.ch)&&t.push(s.marker.parent||s.marker)}return t},findMarks:function(e,t,o){e=Se(this,e),t=Se(this,t);var i=[],s=e.line;return this.iter(e.line,t.line+1,function(u){var d=u.markedSpans;if(d)for(var h=0;h<d.length;h++){var m=d[h];!(m.to!=null&&s==e.line&&e.ch>=m.to||m.from==null&&s!=e.line||m.from!=null&&s==t.line&&m.from>=t.ch)&&(!o||o(m.marker))&&i.push(m.marker.parent||m.marker)}++s}),i},getAllMarks:function(){var e=[];return this.iter(function(t){var o=t.markedSpans;if(o)for(var i=0;i<o.length;++i)o[i].from!=null&&e.push(o[i].marker)}),e},posFromIndex:function(e){var t,o=this.first,i=this.lineSeparator().length;return this.iter(function(s){var u=s.text.length+i;if(u>e)return t=e,!0;e-=u,++o}),Se(this,O(o,t))},indexFromPos:function(e){e=Se(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var o=this.lineSeparator().length;return this.iter(this.first,e.line,function(i){t+=i.text.length+o}),t},copy:function(e){var t=new Kt(Cr(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,o=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<o&&(o=e.to);var i=new Kt(Cr(this,t,o),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(i.history=this.history),(this.linked||(this.linked=[])).push({doc:i,sharedHist:e.sharedHist}),i.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],B0(i,sc(this)),i},unlinkDoc:function(e){if(e instanceof ot&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var o=this.linked[t];if(o.doc==e){this.linked.splice(t,1),e.unlinkDoc(this),U0(sc(this));break}}if(e.history==this.history){var i=[e.id];Rn(e,function(s){return i.push(s.id)},!0),e.history=new Ia(null),e.history.done=vi(this.history.done,i),e.history.undone=vi(this.history.undone,i)}},iterLinkedDocs:function(e){Rn(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):jt(e)},lineSeparator:function(){return this.lineSep||`
26
- `},setDirection:wt(function(e){e!="rtl"&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter(function(t){return t.order=null}),this.cm&&E0(this.cm))})}),Kt.prototype.eachLine=Kt.prototype.iter;var lc=0;function M0(e){var t=this;if(uc(t),!($e(t,e)||on(t.display,e))){At(e),g&&(lc=+new Date);var o=Qn(t,e,!0),i=e.dataTransfer.files;if(!(!o||t.isReadOnly()))if(i&&i.length&&window.FileReader&&window.File)for(var s=i.length,u=Array(s),d=0,h=function(){++d==s&&St(t,function(){o=Se(t.doc,o);var L={from:o,to:o,text:t.doc.splitLines(u.filter(function(W){return W!=null}).join(t.doc.lineSeparator())),origin:"paste"};xi(t.doc,L),Xf(t.doc,An(Se(t.doc,o),Se(t.doc,_n(L))))})()},m=function(L,W){if(t.options.allowDropFileTypes&&ue(t.options.allowDropFileTypes,L.type)==-1){h();return}var H=new FileReader;H.onerror=function(){return h()},H.onload=function(){var z=H.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(z)){h();return}u[W]=z,h()},H.readAsText(L)},b=0;b<i.length;b++)m(i[b],b);else{if(t.state.draggingText&&t.doc.sel.contains(o)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var I=e.dataTransfer.getData("Text");if(I){var C;if(t.state.draggingText&&!t.state.draggingText.copy&&(C=t.listSelections()),Aa(t.doc,An(o,o)),C)for(var B=0;B<C.length;++B)Ti(t.doc,"",C[B].anchor,C[B].head,"drag");t.replaceSelection(I,"around","paste"),t.display.input.focus()}}catch{}}}}function G0(e,t){if(g&&(!e.state.draggingText||+new Date-lc<100)){Wr(t);return}if(!($e(e,t)||on(e.display,t))&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!X)){var o=x("img",null,null,"position: fixed; left: 0; top: 0;");o.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",M&&(o.width=o.height=1,e.display.wrapper.appendChild(o),o._top=o.offsetTop),t.dataTransfer.setDragImage(o,0,0),M&&o.parentNode.removeChild(o)}}function O0(e,t){var o=Qn(e,t);if(o){var i=document.createDocumentFragment();rl(e,o,i),e.display.dragCursor||(e.display.dragCursor=x("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),oe(e.display.dragCursor,i)}}function uc(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function fc(e){if(document.getElementsByClassName){for(var t=document.getElementsByClassName("CodeMirror"),o=[],i=0;i<t.length;i++){var s=t[i].CodeMirror;s&&o.push(s)}o.length&&o[0].operation(function(){for(var u=0;u<o.length;u++)e(o[u])})}}var cc=!1;function W0(){cc||(D0(),cc=!0)}function D0(){var e;Ie(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,fc(Z0)},100))}),Ie(window,"blur",function(){return fc(gi)})}function Z0(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Sn={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},Co=0;Co<10;Co++)Sn[Co+48]=Sn[Co+96]=String(Co);for(var Na=65;Na<=90;Na++)Sn[Na]=String.fromCharCode(Na);for(var Ao=1;Ao<=12;Ao++)Sn[Ao+111]=Sn[Ao+63235]="F"+Ao;var sn={};sn.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},sn.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},sn.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},sn.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},sn.default=q?sn.macDefault:sn.pcDefault;function V0(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var o,i,s,u,d=0;d<t.length-1;d++){var h=t[d];if(/^(cmd|meta|m)$/i.test(h))u=!0;else if(/^a(lt)?$/i.test(h))o=!0;else if(/^(c|ctrl|control)$/i.test(h))i=!0;else if(/^s(hift)?$/i.test(h))s=!0;else throw new Error("Unrecognized modifier name: "+h)}return o&&(e="Alt-"+e),i&&(e="Ctrl-"+e),u&&(e="Cmd-"+e),s&&(e="Shift-"+e),e}function Q0(e){var t={};for(var o in e)if(e.hasOwnProperty(o)){var i=e[o];if(/^(name|fallthrough|(de|at)tach)$/.test(o))continue;if(i=="..."){delete e[o];continue}for(var s=It(o.split(" "),V0),u=0;u<s.length;u++){var d=void 0,h=void 0;u==s.length-1?(h=s.join(" "),d=i):(h=s.slice(0,u+1).join(" "),d="...");var m=t[h];if(!m)t[h]=d;else if(m!=d)throw new Error("Inconsistent bindings for "+h)}delete e[o]}for(var b in t)e[b]=t[b];return e}function Ei(e,t,o,i){t=Sa(t);var s=t.call?t.call(e,i):t[e];if(s===!1)return"nothing";if(s==="...")return"multi";if(s!=null&&o(s))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return Ei(e,t.fallthrough,o,i);for(var u=0;u<t.fallthrough.length;u++){var d=Ei(e,t.fallthrough[u],o,i);if(d)return d}}}function dc(e){var t=typeof e=="string"?e:Sn[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function hc(e,t,o){var i=e;return t.altKey&&i!="Alt"&&(e="Alt-"+e),(w?t.metaKey:t.ctrlKey)&&i!="Ctrl"&&(e="Ctrl-"+e),(w?t.ctrlKey:t.metaKey)&&i!="Mod"&&(e="Cmd-"+e),!o&&t.shiftKey&&i!="Shift"&&(e="Shift-"+e),e}function pc(e,t){if(M&&e.keyCode==34&&e.char)return!1;var o=Sn[e.keyCode];return o==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(o=e.code),hc(o,e,t))}function Sa(e){return typeof e=="string"?sn[e]:e}function Ci(e,t){for(var o=e.doc.sel.ranges,i=[],s=0;s<o.length;s++){for(var u=t(o[s]);i.length&&fe(u.from,Te(i).to)<=0;){var d=i.pop();if(fe(d.from,u.from)<0){u.from=d.from;break}}i.push(u)}cr(e,function(){for(var h=i.length-1;h>=0;h--)Ti(e.doc,"",i[h].from,i[h].to,"+delete");mi(e)})}function yl(e,t,o){var i=kt(e.text,t+o,o);return i<0||i>e.text.length?null:i}function xl(e,t,o){var i=yl(e,t.ch,o);return i==null?null:new O(t.line,i,o<0?"after":"before")}function Tl(e,t,o,i,s){if(e){t.doc.direction=="rtl"&&(s=-s);var u=Ne(o,t.doc.direction);if(u){var d=s<0?Te(u):u[0],h=s<0==(d.level==1),m=h?"after":"before",b;if(d.level>0||t.doc.direction=="rtl"){var I=di(t,o);b=s<0?o.text.length-1:0;var C=Qr(t,I,b).top;b=ft(function(B){return Qr(t,I,B).top==C},s<0==(d.level==1)?d.from:d.to-1,b),m=="before"&&(b=yl(o,b,1))}else b=s<0?d.to:d.from;return new O(i,b,m)}}return new O(i,s<0?o.text.length:0,s<0?"before":"after")}function P0(e,t,o,i){var s=Ne(t,e.doc.direction);if(!s)return xl(t,o,i);o.ch>=t.text.length?(o.ch=t.text.length,o.sticky="before"):o.ch<=0&&(o.ch=0,o.sticky="after");var u=vr(s,o.ch,o.sticky),d=s[u];if(e.doc.direction=="ltr"&&d.level%2==0&&(i>0?d.to>o.ch:d.from<o.ch))return xl(t,o,i);var h=function(ne,he){return yl(t,ne instanceof O?ne.ch:ne,he)},m,b=function(ne){return e.options.lineWrapping?(m=m||di(e,t),yf(e,t,m,ne)):{begin:0,end:t.text.length}},I=b(o.sticky=="before"?h(o,-1):o.ch);if(e.doc.direction=="rtl"||d.level==1){var C=d.level==1==i<0,B=h(o,C?1:-1);if(B!=null&&(C?B<=d.to&&B<=I.end:B>=d.from&&B>=I.begin)){var L=C?"before":"after";return new O(o.line,B,L)}}var W=function(ne,he,ie){for(var me=function(et,Lt){return Lt?new O(o.line,h(et,1),"before"):new O(o.line,et,"after")};ne>=0&&ne<s.length;ne+=he){var Ae=s[ne],Ee=he>0==(Ae.level!=1),ke=Ee?ie.begin:h(ie.end,-1);if(Ae.from<=ke&&ke<Ae.to||(ke=Ee?Ae.from:h(Ae.to,-1),ie.begin<=ke&&ke<ie.end))return me(ke,Ee)}},H=W(u+i,i,I);if(H)return H;var z=i>0?I.end:h(I.begin,-1);return z!=null&&!(i>0&&z==t.text.length)&&(H=W(i>0?0:s.length-1,i,b(z)),H)?H:null}var _o={selectAll:Kf,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Me)},killLine:function(e){return Ci(e,function(t){if(t.empty()){var o=de(e.doc,t.head.line).text.length;return t.head.ch==o&&t.head.line<e.lastLine()?{from:t.head,to:O(t.head.line+1,0)}:{from:t.head,to:O(t.head.line,o)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return Ci(e,function(t){return{from:O(t.from().line,0),to:Se(e.doc,O(t.to().line+1,0))}})},delLineLeft:function(e){return Ci(e,function(t){return{from:O(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return Ci(e,function(t){var o=e.charCoords(t.head,"div").top+5,i=e.coordsChar({left:0,top:o},"div");return{from:i,to:t.from()}})},delWrappedLineRight:function(e){return Ci(e,function(t){var o=e.charCoords(t.head,"div").top+5,i=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:o},"div");return{from:t.from(),to:i}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(O(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(O(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return gc(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return mc(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return H0(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var o=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:o},"div")},_e)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var o=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:o},"div")},_e)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var o=e.cursorCoords(t.head,"div").top+5,i=e.coordsChar({left:0,top:o},"div");return i.ch<e.getLine(i.line).search(/\S/)?mc(e,t.head):i},_e)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection(" ")},insertSoftTab:function(e){for(var t=[],o=e.listSelections(),i=e.options.tabSize,s=0;s<o.length;s++){var u=o[s].from(),d=ye(e.getLine(u.line),u.ch,i);t.push(Ve(i-d%i))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return cr(e,function(){for(var t=e.listSelections(),o=[],i=0;i<t.length;i++)if(t[i].empty()){var s=t[i].head,u=de(e.doc,s.line).text;if(u){if(s.ch==u.length&&(s=new O(s.line,s.ch-1)),s.ch>0)s=new O(s.line,s.ch+1),e.replaceRange(u.charAt(s.ch-1)+u.charAt(s.ch-2),O(s.line,s.ch-2),s,"+transpose");else if(s.line>e.doc.first){var d=de(e.doc,s.line-1).text;d&&(s=new O(s.line,1),e.replaceRange(u.charAt(0)+e.doc.lineSeparator()+d.charAt(d.length-1),O(s.line-1,d.length-1),s,"+transpose"))}}o.push(new He(s,s))}e.setSelections(o)})},newlineAndIndent:function(e){return cr(e,function(){for(var t=e.listSelections(),o=t.length-1;o>=0;o--)e.replaceRange(e.doc.lineSeparator(),t[o].anchor,t[o].head,"+input");t=e.listSelections();for(var i=0;i<t.length;i++)e.indentLine(t[i].from().line,null,!0);mi(e)})},openLine:function(e){return e.replaceSelection(`
27
- `,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function gc(e,t){var o=de(e.doc,t),i=Lr(o);return i!=o&&(t=v(i)),Tl(!0,e,i,t,1)}function H0(e,t){var o=de(e.doc,t),i=Nm(o);return i!=o&&(t=v(i)),Tl(!0,e,o,t,-1)}function mc(e,t){var o=gc(e,t.line),i=de(e.doc,o.line),s=Ne(i,e.doc.direction);if(!s||s[0].level==0){var u=Math.max(o.ch,i.text.search(/\S/)),d=t.line==o.line&&t.ch<=u&&t.ch;return O(o.line,d?0:u,o.sticky)}return o}function wa(e,t,o){if(typeof t=="string"&&(t=_o[t],!t))return!1;e.display.input.ensurePolled();var i=e.display.shift,s=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),o&&(e.display.shift=!1),s=t(e)!=Je}finally{e.display.shift=i,e.state.suppressEdits=!1}return s}function J0(e,t,o){for(var i=0;i<e.state.keyMaps.length;i++){var s=Ei(t,e.state.keyMaps[i],o,e);if(s)return s}return e.options.extraKeys&&Ei(t,e.options.extraKeys,o,e)||Ei(t,e.options.keyMap,o,e)}var X0=new Ge;function Ro(e,t,o,i){var s=e.state.keySeq;if(s){if(dc(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:X0.set(50,function(){e.state.keySeq==s&&(e.state.keySeq=null,e.display.input.reset())}),bc(e,s+" "+t,o,i))return!0}return bc(e,t,o,i)}function bc(e,t,o,i){var s=J0(e,t,i);return s=="multi"&&(e.state.keySeq=t),s=="handled"&&Nt(e,"keyHandled",e,t,o),(s=="handled"||s=="multi")&&(At(o),nl(e)),!!s}function vc(e,t){var o=pc(t,!0);return o?t.shiftKey&&!e.state.keySeq?Ro(e,"Shift-"+o,t,function(i){return wa(e,i,!0)})||Ro(e,o,t,function(i){if(typeof i=="string"?/^go[A-Z]/.test(i):i.motion)return wa(e,i)}):Ro(e,o,t,function(i){return wa(e,i)}):!1}function Y0(e,t,o){return Ro(e,"'"+o+"'",t,function(i){return wa(e,i,!0)})}var Il=null;function yc(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField())&&(t.curOp.focus=ge(Ze(t)),!$e(t,e))){g&&y<11&&e.keyCode==27&&(e.returnValue=!1);var o=e.keyCode;t.display.shift=o==16||e.shiftKey;var i=vc(t,e);M&&(Il=i?o:null,!i&&o==88&&!xn&&(q?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),a&&!q&&!i&&o==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),o==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&j0(t)}}function j0(e){var t=e.display.lineDiv;Oe(t,"CodeMirror-crosshair");function o(i){(i.keyCode==18||!i.altKey)&&(pe(t,"CodeMirror-crosshair"),Ct(document,"keyup",o),Ct(document,"mouseover",o))}Ie(document,"keyup",o),Ie(document,"mouseover",o)}function xc(e){e.keyCode==16&&(this.doc.sel.shift=!1),$e(this,e)}function Tc(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField())&&!(on(t.display,e)||$e(t,e)||e.ctrlKey&&!e.altKey||q&&e.metaKey)){var o=e.keyCode,i=e.charCode;if(M&&o==Il){Il=null,At(e);return}if(!(M&&(!e.which||e.which<10)&&vc(t,e))){var s=String.fromCharCode(i??o);s!="\b"&&(Y0(t,e,s)||t.display.input.onKeyPress(e))}}}var z0=400,El=function(e,t,o){this.time=e,this.pos=t,this.button=o};El.prototype.compare=function(e,t,o){return this.time+z0>e&&fe(t,this.pos)==0&&o==this.button};var No,So;function q0(e,t){var o=+new Date;return So&&So.compare(o,e,t)?(No=So=null,"triple"):No&&No.compare(o,e,t)?(So=new El(o,e,t),No=null,"double"):(No=new El(o,e,t),So=null,"single")}function Ic(e){var t=this,o=t.display;if(!($e(t,e)||o.activeTouch&&o.input.supportsTouch())){if(o.input.ensurePolled(),o.shift=e.shiftKey,on(o,e)){T||(o.scroller.draggable=!1,setTimeout(function(){return o.scroller.draggable=!0},100));return}if(!Cl(t,e)){var i=Qn(t,e),s=Yt(e),u=i?q0(i,s):"single";ve(t).focus(),s==1&&t.state.selectingText&&t.state.selectingText(e),!(i&&K0(t,s,i,u,e))&&(s==1?i?eb(t,i,u,e):yn(e)==o.scroller&&At(e):s==2?(i&&Ca(t.doc,i),setTimeout(function(){return o.input.focus()},20)):s==3&&(P?t.display.input.onContextMenu(e):il(t)))}}}function K0(e,t,o,i,s){var u="Click";return i=="double"?u="Double"+u:i=="triple"&&(u="Triple"+u),u=(t==1?"Left":t==2?"Middle":"Right")+u,Ro(e,hc(u,s),s,function(d){if(typeof d=="string"&&(d=_o[d]),!d)return!1;var h=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),h=d(e,o)!=Je}finally{e.state.suppressEdits=!1}return h})}function $0(e,t,o){var i=e.getOption("configureMouse"),s=i?i(e,t,o):{};if(s.unit==null){var u=te?o.shiftKey&&o.metaKey:o.altKey;s.unit=u?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(s.extend==null||e.doc.extend)&&(s.extend=e.doc.extend||o.shiftKey),s.addNew==null&&(s.addNew=q?o.metaKey:o.ctrlKey),s.moveOnDrag==null&&(s.moveOnDrag=!(q?o.altKey:o.ctrlKey)),s}function eb(e,t,o,i){g?setTimeout(se(Ef,e),0):e.curOp.focus=ge(Ze(e));var s=$0(e,o,i),u=e.doc.sel,d;e.options.dragDrop&&si&&!e.isReadOnly()&&o=="single"&&(d=u.contains(t))>-1&&(fe((d=u.ranges[d]).from(),t)<0||t.xRel>0)&&(fe(d.to(),t)>0||t.xRel<0)?tb(e,i,t,s):rb(e,i,t,s)}function tb(e,t,o,i){var s=e.display,u=!1,d=St(e,function(b){T&&(s.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:il(e)),Ct(s.wrapper.ownerDocument,"mouseup",d),Ct(s.wrapper.ownerDocument,"mousemove",h),Ct(s.scroller,"dragstart",m),Ct(s.scroller,"drop",d),u||(At(b),i.addNew||Ca(e.doc,o,null,null,i.extend),T&&!X||g&&y==9?setTimeout(function(){s.wrapper.ownerDocument.body.focus({preventScroll:!0}),s.input.focus()},20):s.input.focus())}),h=function(b){u=u||Math.abs(t.clientX-b.clientX)+Math.abs(t.clientY-b.clientY)>=10},m=function(){return u=!0};T&&(s.scroller.draggable=!0),e.state.draggingText=d,d.copy=!i.moveOnDrag,Ie(s.wrapper.ownerDocument,"mouseup",d),Ie(s.wrapper.ownerDocument,"mousemove",h),Ie(s.scroller,"dragstart",m),Ie(s.scroller,"drop",d),e.state.delayingBlurEvent=!0,setTimeout(function(){return s.input.focus()},20),s.scroller.dragDrop&&s.scroller.dragDrop()}function Ec(e,t,o){if(o=="char")return new He(t,t);if(o=="word")return e.findWordAt(t);if(o=="line")return new He(O(t.line,0),Se(e.doc,O(t.line+1,0)));var i=o(e,t);return new He(i.from,i.to)}function rb(e,t,o,i){g&&il(e);var s=e.display,u=e.doc;At(t);var d,h,m=u.sel,b=m.ranges;if(i.addNew&&!i.extend?(h=u.sel.contains(o),h>-1?d=b[h]:d=new He(o,o)):(d=u.sel.primary(),h=u.sel.primIndex),i.unit=="rectangle")i.addNew||(d=new He(o,o)),o=Qn(e,t,!0,!0),h=-1;else{var I=Ec(e,o,i.unit);i.extend?d=bl(d,I.anchor,I.head,i.extend):d=I}i.addNew?h==-1?(h=b.length,Zt(u,Br(e,b.concat([d]),h),{scroll:!1,origin:"*mouse"})):b.length>1&&b[h].empty()&&i.unit=="char"&&!i.extend?(Zt(u,Br(e,b.slice(0,h).concat(b.slice(h+1)),0),{scroll:!1,origin:"*mouse"}),m=u.sel):vl(u,h,d,Le):(h=0,Zt(u,new Ir([d],0),Le),m=u.sel);var C=o;function B(ie){if(fe(C,ie)!=0)if(C=ie,i.unit=="rectangle"){for(var me=[],Ae=e.options.tabSize,Ee=ye(de(u,o.line).text,o.ch,Ae),ke=ye(de(u,ie.line).text,ie.ch,Ae),et=Math.min(Ee,ke),Lt=Math.max(Ee,ke),ct=Math.min(o.line,ie.line),dr=Math.min(e.lastLine(),Math.max(o.line,ie.line));ct<=dr;ct++){var $t=de(u,ct).text,bt=De($t,et,Ae);et==Lt?me.push(new He(O(ct,bt),O(ct,bt))):$t.length>bt&&me.push(new He(O(ct,bt),O(ct,De($t,Lt,Ae))))}me.length||me.push(new He(o,o)),Zt(u,Br(e,m.ranges.slice(0,h).concat(me),h),{origin:"*mouse",scroll:!1}),e.scrollIntoView(ie)}else{var er=d,Gt=Ec(e,ie,i.unit),xt=er.anchor,vt;fe(Gt.anchor,xt)>0?(vt=Gt.head,xt=ui(er.from(),Gt.anchor)):(vt=Gt.anchor,xt=zt(er.to(),Gt.head));var ht=m.ranges.slice(0);ht[h]=nb(e,new He(Se(u,xt),vt)),Zt(u,Br(e,ht,h),Le)}}var L=s.wrapper.getBoundingClientRect(),W=0;function H(ie){var me=++W,Ae=Qn(e,ie,!0,i.unit=="rectangle");if(Ae)if(fe(Ae,C)!=0){e.curOp.focus=ge(Ze(e)),B(Ae);var Ee=va(s,u);(Ae.line>=Ee.to||Ae.line<Ee.from)&&setTimeout(St(e,function(){W==me&&H(ie)}),150)}else{var ke=ie.clientY<L.top?-20:ie.clientY>L.bottom?20:0;ke&&setTimeout(St(e,function(){W==me&&(s.scroller.scrollTop+=ke,H(ie))}),50)}}function z(ie){e.state.selectingText=!1,W=1/0,ie&&(At(ie),s.input.focus()),Ct(s.wrapper.ownerDocument,"mousemove",ne),Ct(s.wrapper.ownerDocument,"mouseup",he),u.history.lastSelOrigin=null}var ne=St(e,function(ie){ie.buttons===0||!Yt(ie)?z(ie):H(ie)}),he=St(e,z);e.state.selectingText=he,Ie(s.wrapper.ownerDocument,"mousemove",ne),Ie(s.wrapper.ownerDocument,"mouseup",he)}function nb(e,t){var o=t.anchor,i=t.head,s=de(e.doc,o.line);if(fe(o,i)==0&&o.sticky==i.sticky)return t;var u=Ne(s);if(!u)return t;var d=vr(u,o.ch,o.sticky),h=u[d];if(h.from!=o.ch&&h.to!=o.ch)return t;var m=d+(h.from==o.ch==(h.level!=1)?0:1);if(m==0||m==u.length)return t;var b;if(i.line!=o.line)b=(i.line-o.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var I=vr(u,i.ch,i.sticky),C=I-d||(i.ch-o.ch)*(h.level==1?-1:1);I==m-1||I==m?b=C<0:b=C>0}var B=u[m+(b?-1:0)],L=b==(B.level==1),W=L?B.from:B.to,H=L?"after":"before";return o.ch==W&&o.sticky==H?t:new He(new O(o.line,W,H),i)}function Cc(e,t,o,i){var s,u;if(t.touches)s=t.touches[0].clientX,u=t.touches[0].clientY;else try{s=t.clientX,u=t.clientY}catch{return!1}if(s>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;i&&At(t);var d=e.display,h=d.lineDiv.getBoundingClientRect();if(u>h.bottom||!yt(e,o))return pt(t);u-=h.top-d.viewOffset;for(var m=0;m<e.display.gutterSpecs.length;++m){var b=d.gutters.childNodes[m];if(b&&b.getBoundingClientRect().right>=s){var I=E(e.doc,u),C=e.display.gutterSpecs[m];return Ke(e,o,e,I,C.className,t),pt(t)}}}function Cl(e,t){return Cc(e,t,"gutterClick",!0)}function Ac(e,t){on(e.display,t)||ib(e,t)||$e(e,t,"contextmenu")||P||e.display.input.onContextMenu(t)}function ib(e,t){return yt(e,"gutterContextMenu")?Cc(e,t,"gutterContextMenu",!1):!1}function _c(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),lo(e)}var Ai={toString:function(){return"CodeMirror.Init"}},Rc={},La={};function ob(e){var t=e.optionHandlers;function o(i,s,u,d){e.defaults[i]=s,u&&(t[i]=d?function(h,m,b){b!=Ai&&u(h,m,b)}:u)}e.defineOption=o,e.Init=Ai,o("value","",function(i,s){return i.setValue(s)},!0),o("mode",null,function(i,s){i.doc.modeOption=s,pl(i)},!0),o("indentUnit",2,pl,!0),o("indentWithTabs",!1),o("smartIndent",!0),o("tabSize",4,function(i){bo(i),lo(i),qt(i)},!0),o("lineSeparator",null,function(i,s){if(i.doc.lineSep=s,!!s){var u=[],d=i.doc.first;i.doc.iter(function(m){for(var b=0;;){var I=m.text.indexOf(s,b);if(I==-1)break;b=I+s.length,u.push(O(d,I))}d++});for(var h=u.length-1;h>=0;h--)Ti(i.doc,s,u[h],O(u[h].line,u[h].ch+s.length))}}),o("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\u202d\u202e\u2066\u2067\u2069\ufeff\ufff9-\ufffc]/g,function(i,s,u){i.state.specialChars=new RegExp(s.source+(s.test(" ")?"":"| "),"g"),u!=Ai&&i.refresh()}),o("specialCharPlaceholder",Um,function(i){return i.refresh()},!0),o("electricChars",!0),o("inputStyle",J?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),o("spellcheck",!1,function(i,s){return i.getInputField().spellcheck=s},!0),o("autocorrect",!1,function(i,s){return i.getInputField().autocorrect=s},!0),o("autocapitalize",!1,function(i,s){return i.getInputField().autocapitalize=s},!0),o("rtlMoveVisually",!ae),o("wholeLineUpdateBefore",!0),o("theme","default",function(i){_c(i),mo(i)},!0),o("keyMap","default",function(i,s,u){var d=Sa(s),h=u!=Ai&&Sa(u);h&&h.detach&&h.detach(i,d),d.attach&&d.attach(i,h||null)}),o("extraKeys",null),o("configureMouse",null),o("lineWrapping",!1,sb,!0),o("gutters",[],function(i,s){i.display.gutterSpecs=dl(s,i.options.lineNumbers),mo(i)},!0),o("fixedGutter",!0,function(i,s){i.display.gutters.style.left=s?el(i.display)+"px":"0",i.refresh()},!0),o("coverGutterNextToScrollbar",!1,function(i){return bi(i)},!0),o("scrollbarStyle","native",function(i){Sf(i),bi(i),i.display.scrollbars.setScrollTop(i.doc.scrollTop),i.display.scrollbars.setScrollLeft(i.doc.scrollLeft)},!0),o("lineNumbers",!1,function(i,s){i.display.gutterSpecs=dl(i.options.gutters,s),mo(i)},!0),o("firstLineNumber",1,mo,!0),o("lineNumberFormatter",function(i){return i},mo,!0),o("showCursorWhenSelecting",!1,uo,!0),o("resetSelectionOnContextMenu",!0),o("lineWiseCopyCut",!0),o("pasteLinesPerSelection",!0),o("selectionsMayTouch",!1),o("readOnly",!1,function(i,s){s=="nocursor"&&(gi(i),i.display.input.blur()),i.display.input.readOnlyChanged(s)}),o("screenReaderLabel",null,function(i,s){s=s===""?null:s,i.display.input.screenReaderLabelChanged(s)}),o("disableInput",!1,function(i,s){s||i.display.input.reset()},!0),o("dragDrop",!0,ab),o("allowDropFileTypes",null),o("cursorBlinkRate",530),o("cursorScrollMargin",0),o("cursorHeight",1,uo,!0),o("singleCursorHeightPerLine",!0,uo,!0),o("workTime",100),o("workDelay",100),o("flattenSpans",!0,bo,!0),o("addModeClass",!1,bo,!0),o("pollInterval",100),o("undoDepth",200,function(i,s){return i.doc.history.undoDepth=s}),o("historyEventDelay",1250),o("viewportMargin",10,function(i){return i.refresh()},!0),o("maxHighlightLength",1e4,bo,!0),o("moveInputWithCursor",!0,function(i,s){s||i.display.input.resetPosition()}),o("tabindex",null,function(i,s){return i.display.input.getField().tabIndex=s||""}),o("autofocus",null),o("direction","ltr",function(i,s){return i.doc.setDirection(s)},!0),o("phrases",null)}function ab(e,t,o){var i=o&&o!=Ai;if(!t!=!i){var s=e.display.dragFunctions,u=t?Ie:Ct;u(e.display.scroller,"dragstart",s.start),u(e.display.scroller,"dragenter",s.enter),u(e.display.scroller,"dragover",s.over),u(e.display.scroller,"dragleave",s.leave),u(e.display.scroller,"drop",s.drop)}}function sb(e){e.options.lineWrapping?(Oe(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(pe(e.display.wrapper,"CodeMirror-wrap"),Ps(e)),tl(e),qt(e),lo(e),setTimeout(function(){return bi(e)},100)}function ot(e,t){var o=this;if(!(this instanceof ot))return new ot(e,t);this.options=t=t?le(t):{},le(Rc,t,!1);var i=t.value;typeof i=="string"?i=new Kt(i,t.mode,null,t.lineSeparator,t.direction):t.mode&&(i.modeOption=t.mode),this.doc=i;var s=new ot.inputStyles[t.inputStyle](this),u=this.display=new x0(e,i,s,t);u.wrapper.CodeMirror=this,_c(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Sf(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new Ge,keySeq:null,specialChars:null},t.autofocus&&!J&&u.input.focus(),g&&y<11&&setTimeout(function(){return o.display.input.reset(!0)},20),lb(this),W0(),Xn(this),this.curOp.forceUpdate=!0,Wf(this,i),t.autofocus&&!J||this.hasFocus()?setTimeout(function(){o.hasFocus()&&!o.state.focused&&ol(o)},20):gi(this);for(var d in La)La.hasOwnProperty(d)&&La[d](this,t[d],Ai);Ff(this),t.finishInit&&t.finishInit(this);for(var h=0;h<Al.length;++h)Al[h](this);Yn(this),T&&t.lineWrapping&&getComputedStyle(u.lineDiv).textRendering=="optimizelegibility"&&(u.lineDiv.style.textRendering="auto")}ot.defaults=Rc,ot.optionHandlers=La;function lb(e){var t=e.display;Ie(t.scroller,"mousedown",St(e,Ic)),g&&y<11?Ie(t.scroller,"dblclick",St(e,function(m){if(!$e(e,m)){var b=Qn(e,m);if(!(!b||Cl(e,m)||on(e.display,m))){At(m);var I=e.findWordAt(b);Ca(e.doc,I.anchor,I.head)}}})):Ie(t.scroller,"dblclick",function(m){return $e(e,m)||At(m)}),Ie(t.scroller,"contextmenu",function(m){return Ac(e,m)}),Ie(t.input.getField(),"contextmenu",function(m){t.scroller.contains(m.target)||Ac(e,m)});var o,i={end:0};function s(){t.activeTouch&&(o=setTimeout(function(){return t.activeTouch=null},1e3),i=t.activeTouch,i.end=+new Date)}function u(m){if(m.touches.length!=1)return!1;var b=m.touches[0];return b.radiusX<=1&&b.radiusY<=1}function d(m,b){if(b.left==null)return!0;var I=b.left-m.left,C=b.top-m.top;return I*I+C*C>20*20}Ie(t.scroller,"touchstart",function(m){if(!$e(e,m)&&!u(m)&&!Cl(e,m)){t.input.ensurePolled(),clearTimeout(o);var b=+new Date;t.activeTouch={start:b,moved:!1,prev:b-i.end<=300?i:null},m.touches.length==1&&(t.activeTouch.left=m.touches[0].pageX,t.activeTouch.top=m.touches[0].pageY)}}),Ie(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),Ie(t.scroller,"touchend",function(m){var b=t.activeTouch;if(b&&!on(t,m)&&b.left!=null&&!b.moved&&new Date-b.start<300){var I=e.coordsChar(t.activeTouch,"page"),C;!b.prev||d(b,b.prev)?C=new He(I,I):!b.prev.prev||d(b,b.prev.prev)?C=e.findWordAt(I):C=new He(O(I.line,0),Se(e.doc,O(I.line+1,0))),e.setSelection(C.anchor,C.head),e.focus(),At(m)}s()}),Ie(t.scroller,"touchcancel",s),Ie(t.scroller,"scroll",function(){t.scroller.clientHeight&&(co(e,t.scroller.scrollTop),Hn(e,t.scroller.scrollLeft,!0),Ke(e,"scroll",e))}),Ie(t.scroller,"mousewheel",function(m){return kf(e,m)}),Ie(t.scroller,"DOMMouseScroll",function(m){return kf(e,m)}),Ie(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(m){$e(e,m)||Wr(m)},over:function(m){$e(e,m)||(O0(e,m),Wr(m))},start:function(m){return G0(e,m)},drop:St(e,M0),leave:function(m){$e(e,m)||uc(e)}};var h=t.input.getField();Ie(h,"keyup",function(m){return xc.call(e,m)}),Ie(h,"keydown",St(e,yc)),Ie(h,"keypress",St(e,Tc)),Ie(h,"focus",function(m){return ol(e,m)}),Ie(h,"blur",function(m){return gi(e,m)})}var Al=[];ot.defineInitHook=function(e){return Al.push(e)};function wo(e,t,o,i){var s=e.doc,u;o==null&&(o="add"),o=="smart"&&(s.mode.indent?u=no(e,t).state:o="prev");var d=e.options.tabSize,h=de(s,t),m=ye(h.text,null,d);h.stateAfter&&(h.stateAfter=null);var b=h.text.match(/^\s*/)[0],I;if(!i&&!/\S/.test(h.text))I=0,o="not";else if(o=="smart"&&(I=s.mode.indent(u,h.text.slice(b.length),h.text),I==Je||I>150)){if(!i)return;o="prev"}o=="prev"?t>s.first?I=ye(de(s,t-1).text,null,d):I=0:o=="add"?I=m+e.options.indentUnit:o=="subtract"?I=m-e.options.indentUnit:typeof o=="number"&&(I=m+o),I=Math.max(0,I);var C="",B=0;if(e.options.indentWithTabs)for(var L=Math.floor(I/d);L;--L)B+=d,C+=" ";if(B<I&&(C+=Ve(I-B)),C!=b)return Ti(s,C,O(t,0),O(t,b.length),"+input"),h.stateAfter=null,!0;for(var W=0;W<s.sel.ranges.length;W++){var H=s.sel.ranges[W];if(H.head.line==t&&H.head.ch<b.length){var z=O(t,b.length);vl(s,W,new He(z,z));break}}}var Ur=null;function Fa(e){Ur=e}function _l(e,t,o,i,s){var u=e.doc;e.display.shift=!1,i||(i=u.sel);var d=+new Date-200,h=s=="paste"||e.state.pasteIncoming>d,m=jt(t),b=null;if(h&&i.ranges.length>1)if(Ur&&Ur.text.join(`
28
- `)==t){if(i.ranges.length%Ur.text.length==0){b=[];for(var I=0;I<Ur.text.length;I++)b.push(u.splitLines(Ur.text[I]))}}else m.length==i.ranges.length&&e.options.pasteLinesPerSelection&&(b=It(m,function(ne){return[ne]}));for(var C=e.curOp.updateInput,B=i.ranges.length-1;B>=0;B--){var L=i.ranges[B],W=L.from(),H=L.to();L.empty()&&(o&&o>0?W=O(W.line,W.ch-o):e.state.overwrite&&!h?H=O(H.line,Math.min(de(u,H.line).text.length,H.ch+Te(m).length)):h&&Ur&&Ur.lineWise&&Ur.text.join(`
25
+ left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(d),d.scrollIntoView(s),e.display.lineSpace.removeChild(d)}}}function o0(e,t,o,i){i==null&&(i=0);var s;!e.options.lineWrapping&&t==o&&(o=t.sticky=="before"?O(t.line,t.ch+1,"before"):t,t=t.ch?O(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t);for(var u=0;u<5;u++){var d=!1,h=Fr(e,t),m=!o||o==t?h:Fr(e,o);s={left:Math.min(h.left,m.left),top:Math.min(h.top,m.top)-i,right:Math.max(h.left,m.left),bottom:Math.max(h.bottom,m.bottom)+i};var b=al(e,s),I=e.doc.scrollTop,C=e.doc.scrollLeft;if(b.scrollTop!=null&&(co(e,b.scrollTop),Math.abs(e.doc.scrollTop-I)>1&&(d=!0)),b.scrollLeft!=null&&(Hn(e,b.scrollLeft),Math.abs(e.doc.scrollLeft-C)>1&&(d=!0)),!d)break}return s}function a0(e,t){var o=al(e,t);o.scrollTop!=null&&co(e,o.scrollTop),o.scrollLeft!=null&&Hn(e,o.scrollLeft)}function al(e,t){var o=e.display,i=hi(e.display);t.top<0&&(t.top=0);var s=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:o.scroller.scrollTop,u=Xs(e),d={};t.bottom-t.top>u&&(t.bottom=t.top+u);var h=e.doc.height+Js(o),m=t.top<i,b=t.bottom>h-i;if(t.top<s)d.scrollTop=m?0:t.top;else if(t.bottom>s+u){var I=Math.min(t.top,(b?h:t.bottom)-u);I!=s&&(d.scrollTop=I)}var C=e.options.fixedGutter?0:o.gutters.offsetWidth,B=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:o.scroller.scrollLeft-C,L=Zn(e)-o.gutters.offsetWidth,W=t.right-t.left>L;return W&&(t.right=t.left+L),t.left<10?d.scrollLeft=0:t.left<B?d.scrollLeft=Math.max(0,t.left+C-(W?0:10)):t.right>L+B-3&&(d.scrollLeft=t.right+(W?0:10)-L),d}function sl(e,t){t!=null&&(ya(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t)}function mi(e){ya(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function fo(e,t,o){(t!=null||o!=null)&&ya(e),t!=null&&(e.curOp.scrollLeft=t),o!=null&&(e.curOp.scrollTop=o)}function s0(e,t){ya(e),e.curOp.scrollToPos=t}function ya(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var o=bf(e,t.from),i=bf(e,t.to);Af(e,o,i,t.margin)}}function Af(e,t,o,i){var s=al(e,{left:Math.min(t.left,o.left),top:Math.min(t.top,o.top)-i,right:Math.max(t.right,o.right),bottom:Math.max(t.bottom,o.bottom)+i});fo(e,s.scrollLeft,s.scrollTop)}function co(e,t){Math.abs(e.doc.scrollTop-t)<2||(a||ul(e,{top:t}),Rf(e,t,!0),a&&ul(e),go(e,100))}function Rf(e,t,o){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),!(e.display.scroller.scrollTop==t&&!o)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function Hn(e,t,o,i){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),!((o?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!i)&&(e.doc.scrollLeft=t,Lf(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function ho(e){var t=e.display,o=t.gutters.offsetWidth,i=Math.round(e.doc.height+Js(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?o:0,docHeight:i,scrollHeight:i+Vr(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:o}}var Jn=function(e,t,o){this.cm=o;var i=this.vert=x("div",[x("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),s=this.horiz=x("div",[x("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");i.tabIndex=s.tabIndex=-1,e(i),e(s),Ie(i,"scroll",function(){i.clientHeight&&t(i.scrollTop,"vertical")}),Ie(s,"scroll",function(){s.clientWidth&&t(s.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,g&&y<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Jn.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,o=e.scrollHeight>e.clientHeight+1,i=e.nativeBarWidth;if(o){this.vert.style.display="block",this.vert.style.bottom=t?i+"px":"0";var s=e.viewHeight-(t?i:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+s)+"px"}else this.vert.scrollTop=0,this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=o?i+"px":"0",this.horiz.style.left=e.barLeft+"px";var u=e.viewWidth-e.barLeft-(o?i:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+u)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(i==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:o?i:0,bottom:t?i:0}},Jn.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Jn.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Jn.prototype.zeroWidthHack=function(){var e=q&&!S?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.visibility=this.vert.style.visibility="hidden",this.disableHoriz=new Ge,this.disableVert=new Ge},Jn.prototype.enableZeroWidthBar=function(e,t,o){e.style.visibility="";function i(){var s=e.getBoundingClientRect(),u=o=="vert"?document.elementFromPoint(s.right-1,(s.top+s.bottom)/2):document.elementFromPoint((s.right+s.left)/2,s.bottom-1);u!=e?e.style.visibility="hidden":t.set(1e3,i)}t.set(1e3,i)},Jn.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var po=function(){};po.prototype.update=function(){return{bottom:0,right:0}},po.prototype.setScrollLeft=function(){},po.prototype.setScrollTop=function(){},po.prototype.clear=function(){};function bi(e,t){t||(t=ho(e));var o=e.display.barWidth,i=e.display.barHeight;_f(e,t);for(var s=0;s<4&&o!=e.display.barWidth||i!=e.display.barHeight;s++)o!=e.display.barWidth&&e.options.lineWrapping&&ba(e),_f(e,ho(e)),o=e.display.barWidth,i=e.display.barHeight}function _f(e,t){var o=e.display,i=o.scrollbars.update(t);o.sizer.style.paddingRight=(o.barWidth=i.right)+"px",o.sizer.style.paddingBottom=(o.barHeight=i.bottom)+"px",o.heightForcer.style.borderBottom=i.bottom+"px solid transparent",i.right&&i.bottom?(o.scrollbarFiller.style.display="block",o.scrollbarFiller.style.height=i.bottom+"px",o.scrollbarFiller.style.width=i.right+"px"):o.scrollbarFiller.style.display="",i.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(o.gutterFiller.style.display="block",o.gutterFiller.style.height=i.bottom+"px",o.gutterFiller.style.width=t.gutterWidth+"px"):o.gutterFiller.style.display=""}var Nf={native:Jn,null:po};function Sf(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&fe(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Nf[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),Ie(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,o){o=="horizontal"?Hn(e,t):co(e,t)},e),e.display.scrollbars.addClass&&Oe(e.display.wrapper,e.display.scrollbars.addClass)}var l0=0;function Xn(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++l0,markArrays:null},Wm(e.curOp)}function Yn(e){var t=e.curOp;t&&Zm(t,function(o){for(var i=0;i<o.ops.length;i++)o.ops[i].cm.curOp=null;u0(o)})}function u0(e){for(var t=e.ops,o=0;o<t.length;o++)f0(t[o]);for(var i=0;i<t.length;i++)c0(t[i]);for(var s=0;s<t.length;s++)d0(t[s]);for(var u=0;u<t.length;u++)h0(t[u]);for(var d=0;d<t.length;d++)p0(t[d])}function f0(e){var t=e.cm,o=t.display;m0(t),e.updateMaxLine&&Ps(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<o.viewFrom||e.scrollToPos.to.line>=o.viewTo)||o.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new xa(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function c0(e){e.updatedDisplay=e.mustUpdate&&ll(e.cm,e.update)}function d0(e){var t=e.cm,o=t.display;e.updatedDisplay&&ba(t),e.barMeasure=ho(t),o.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=uf(t,o.maxLine,o.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(o.scroller.clientWidth,o.sizer.offsetLeft+e.adjustWidthTo+Vr(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,o.sizer.offsetLeft+e.adjustWidthTo-Zn(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=o.input.prepareSelection())}function h0(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&Hn(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var o=e.focus&&e.focus==ge(Ze(t));e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,o),(e.updatedDisplay||e.startHeight!=t.doc.height)&&bi(t,e.barMeasure),e.updatedDisplay&&cl(t,e.barMeasure),e.selectionChanged&&nl(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),o&&Ef(e.cm)}function p0(e){var t=e.cm,o=t.display,i=t.doc;if(e.updatedDisplay&&wf(t,e.update),o.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(o.wheelStartX=o.wheelStartY=null),e.scrollTop!=null&&Rf(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&Hn(t,e.scrollLeft,!0,!0),e.scrollToPos){var s=o0(t,Se(i,e.scrollToPos.from),Se(i,e.scrollToPos.to),e.scrollToPos.margin);i0(t,s)}var u=e.maybeHiddenMarkers,d=e.maybeUnhiddenMarkers;if(u)for(var h=0;h<u.length;++h)u[h].lines.length||Ke(u[h],"hide");if(d)for(var m=0;m<d.length;++m)d[m].lines.length&&Ke(d[m],"unhide");o.wrapper.offsetHeight&&(i.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&Ke(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function cr(e,t){if(e.curOp)return t();Xn(e);try{return t()}finally{Yn(e)}}function St(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Xn(e);try{return t.apply(e,arguments)}finally{Yn(e)}}}function Jt(e){return function(){if(this.curOp)return e.apply(this,arguments);Xn(this);try{return e.apply(this,arguments)}finally{Yn(this)}}}function wt(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Xn(t);try{return e.apply(this,arguments)}finally{Yn(t)}}}function go(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,se(g0,e))}function g0(e){var t=e.doc;if(!(t.highlightFrontier>=e.display.viewTo)){var o=+new Date+e.options.workTime,i=no(e,t.highlightFrontier),s=[];t.iter(i.line,Math.min(t.first+t.size,e.display.viewTo+500),function(u){if(i.line>=e.display.viewFrom){var d=u.styles,h=u.text.length>e.options.maxHighlightLength?be(t.mode,i.state):null,m=Mu(e,u,i,!0);h&&(i.state=h),u.styles=m.styles;var b=u.styleClasses,I=m.classes;I?u.styleClasses=I:b&&(u.styleClasses=null);for(var C=!d||d.length!=u.styles.length||b!=I&&(!b||!I||b.bgClass!=I.bgClass||b.textClass!=I.textClass),B=0;!C&&B<d.length;++B)C=d[B]!=u.styles[B];C&&s.push(i.line),u.stateAfter=i.save(),i.nextLine()}else u.text.length<=e.options.maxHighlightLength&&Os(e,u.text,i),u.stateAfter=i.line%5==0?i.save():null,i.nextLine();if(+new Date>o)return go(e,e.options.workDelay),!0}),t.highlightFrontier=i.line,t.modeFrontier=Math.max(t.modeFrontier,i.line),s.length&&cr(e,function(){for(var u=0;u<s.length;u++)En(e,s[u],"text")})}}var xa=function(e,t,o){var i=e.display;this.viewport=t,this.visible=va(i,e.doc,t),this.editorIsHidden=!i.wrapper.offsetWidth,this.wrapperHeight=i.wrapper.clientHeight,this.wrapperWidth=i.wrapper.clientWidth,this.oldDisplayWidth=Zn(e),this.force=o,this.dims=$s(e),this.events=[]};xa.prototype.signal=function(e,t){yt(e,t)&&this.events.push(arguments)},xa.prototype.finish=function(){for(var e=0;e<this.events.length;e++)Ke.apply(null,this.events[e])};function m0(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Vr(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Vr(e)+"px",t.scrollbarsClipped=!0)}function b0(e){if(e.hasFocus())return null;var t=ge(Ze(e));if(!t||!de(e.display.lineDiv,t))return null;var o={activeElt:t};if(window.getSelection){var i=ve(e).getSelection();i.anchorNode&&i.extend&&de(e.display.lineDiv,i.anchorNode)&&(o.anchorNode=i.anchorNode,o.anchorOffset=i.anchorOffset,o.focusNode=i.focusNode,o.focusOffset=i.focusOffset)}return o}function v0(e){if(!(!e||!e.activeElt||e.activeElt==ge(Ce(e.activeElt)))&&(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&de(document.body,e.anchorNode)&&de(document.body,e.focusNode))){var t=e.activeElt.ownerDocument,o=t.defaultView.getSelection(),i=t.createRange();i.setEnd(e.anchorNode,e.anchorOffset),i.collapse(!1),o.removeAllRanges(),o.addRange(i),o.extend(e.focusNode,e.focusOffset)}}function ll(e,t){var o=e.display,i=e.doc;if(t.editorIsHidden)return Cn(e),!1;if(!t.force&&t.visible.from>=o.viewFrom&&t.visible.to<=o.viewTo&&(o.updateLineNumbers==null||o.updateLineNumbers>=o.viewTo)&&o.renderedView==o.view&&Tf(e)==0)return!1;Ff(e)&&(Cn(e),t.dims=$s(e));var s=i.first+i.size,u=Math.max(t.visible.from-e.options.viewportMargin,i.first),d=Math.min(s,t.visible.to+e.options.viewportMargin);o.viewFrom<u&&u-o.viewFrom<20&&(u=Math.max(i.first,o.viewFrom)),o.viewTo>d&&o.viewTo-d<20&&(d=Math.min(s,o.viewTo)),rn&&(u=Vs(e.doc,u),d=zu(e.doc,d));var h=u!=o.viewFrom||d!=o.viewTo||o.lastWrapHeight!=t.wrapperHeight||o.lastWrapWidth!=t.wrapperWidth;r0(e,u,d),o.viewOffset=nn(he(e.doc,o.viewFrom)),e.display.mover.style.top=o.viewOffset+"px";var m=Tf(e);if(!h&&m==0&&!t.force&&o.renderedView==o.view&&(o.updateLineNumbers==null||o.updateLineNumbers>=o.viewTo))return!1;var b=b0(e);return m>4&&(o.lineDiv.style.display="none"),y0(e,o.updateLineNumbers,t.dims),m>4&&(o.lineDiv.style.display=""),o.renderedView=o.view,v0(b),k(o.cursorDiv),k(o.selectionDiv),o.gutters.style.height=o.sizer.style.minHeight=0,h&&(o.lastWrapHeight=t.wrapperHeight,o.lastWrapWidth=t.wrapperWidth,go(e,400)),o.updateLineNumbers=null,!0}function wf(e,t){for(var o=t.viewport,i=!0;;i=!1){if(!i||!e.options.lineWrapping||t.oldDisplayWidth==Zn(e)){if(o&&o.top!=null&&(o={top:Math.min(e.doc.height+Js(e.display)-Xs(e),o.top)}),t.visible=va(e.display,e.doc,o),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else i&&(t.visible=va(e.display,e.doc,o));if(!ll(e,t))break;ba(e);var s=ho(e);uo(e),bi(e,s),cl(e,s),t.force=!1}t.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function ul(e,t){var o=new xa(e,t);if(ll(e,o)){ba(e),wf(e,o);var i=ho(e);uo(e),bi(e,i),cl(e,i),o.finish()}}function y0(e,t,o){var i=e.display,s=e.options.lineNumbers,u=i.lineDiv,d=u.firstChild;function h(W){var H=W.nextSibling;return T&&q&&e.display.currentWheelTarget==W?W.style.display="none":W.parentNode.removeChild(W),H}for(var m=i.view,b=i.viewFrom,I=0;I<m.length;I++){var C=m[I];if(!C.hidden)if(!C.node||C.node.parentNode!=u){var B=Jm(e,C,b,o);u.insertBefore(B,d)}else{for(;d!=C.node;)d=h(d);var L=s&&t!=null&&t<=b&&C.lineNumber;C.changes&&(ue(C.changes,"gutter")>-1&&(L=!1),tf(e,C,b,o)),L&&(k(C.lineNumber),C.lineNumber.appendChild(document.createTextNode(Y(e.options,b)))),d=C.node.nextSibling}b+=C.size}for(;d;)d=h(d)}function fl(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px",Nt(e,"gutterChanged",e)}function cl(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Vr(e)+"px"}function Lf(e){var t=e.display,o=t.view;if(!(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))){for(var i=el(t)-t.scroller.scrollLeft+e.doc.scrollLeft,s=t.gutters.offsetWidth,u=i+"px",d=0;d<o.length;d++)if(!o[d].hidden){e.options.fixedGutter&&(o[d].gutter&&(o[d].gutter.style.left=u),o[d].gutterBackground&&(o[d].gutterBackground.style.left=u));var h=o[d].alignable;if(h)for(var m=0;m<h.length;m++)h[m].style.left=u}e.options.fixedGutter&&(t.gutters.style.left=i+s+"px")}}function Ff(e){if(!e.options.lineNumbers)return!1;var t=e.doc,o=Y(e.options,t.first+t.size-1),i=e.display;if(o.length!=i.lineNumChars){var s=i.measure.appendChild(x("div",[x("div",o)],"CodeMirror-linenumber CodeMirror-gutter-elt")),u=s.firstChild.offsetWidth,d=s.offsetWidth-u;return i.lineGutter.style.width="",i.lineNumInnerWidth=Math.max(u,i.lineGutter.offsetWidth-d)+1,i.lineNumWidth=i.lineNumInnerWidth+d,i.lineNumChars=i.lineNumInnerWidth?o.length:-1,i.lineGutter.style.width=i.lineNumWidth+"px",fl(e.display),!0}return!1}function dl(e,t){for(var o=[],i=!1,s=0;s<e.length;s++){var u=e[s],d=null;if(typeof u!="string"&&(d=u.style,u=u.className),u=="CodeMirror-linenumbers")if(t)i=!0;else continue;o.push({className:u,style:d})}return t&&!i&&o.push({className:"CodeMirror-linenumbers",style:null}),o}function Bf(e){var t=e.gutters,o=e.gutterSpecs;k(t),e.lineGutter=null;for(var i=0;i<o.length;++i){var s=o[i],u=s.className,d=s.style,h=t.appendChild(x("div",null,"CodeMirror-gutter "+u));d&&(h.style.cssText=d),u=="CodeMirror-linenumbers"&&(e.lineGutter=h,h.style.width=(e.lineNumWidth||1)+"px")}t.style.display=o.length?"":"none",fl(e)}function mo(e){Bf(e.display),qt(e),Lf(e)}function x0(e,t,o,i){var s=this;this.input=o,s.scrollbarFiller=x("div",null,"CodeMirror-scrollbar-filler"),s.scrollbarFiller.setAttribute("cm-not-content","true"),s.gutterFiller=x("div",null,"CodeMirror-gutter-filler"),s.gutterFiller.setAttribute("cm-not-content","true"),s.lineDiv=ee("div",null,"CodeMirror-code"),s.selectionDiv=x("div",null,null,"position: relative; z-index: 1"),s.cursorDiv=x("div",null,"CodeMirror-cursors"),s.measure=x("div",null,"CodeMirror-measure"),s.lineMeasure=x("div",null,"CodeMirror-measure"),s.lineSpace=ee("div",[s.measure,s.lineMeasure,s.selectionDiv,s.cursorDiv,s.lineDiv],null,"position: relative; outline: none");var u=ee("div",[s.lineSpace],"CodeMirror-lines");s.mover=x("div",[u],null,"position: relative"),s.sizer=x("div",[s.mover],"CodeMirror-sizer"),s.sizerWidth=null,s.heightForcer=x("div",null,null,"position: absolute; height: "+Fe+"px; width: 1px;"),s.gutters=x("div",null,"CodeMirror-gutters"),s.lineGutter=null,s.scroller=x("div",[s.sizer,s.heightForcer,s.gutters],"CodeMirror-scroll"),s.scroller.setAttribute("tabIndex","-1"),s.wrapper=x("div",[s.scrollbarFiller,s.gutterFiller,s.scroller],"CodeMirror"),A&&F===105&&(s.wrapper.style.clipPath="inset(0px)"),s.wrapper.setAttribute("translate","no"),g&&y<8&&(s.gutters.style.zIndex=-1,s.scroller.style.paddingRight=0),!T&&!(a&&J)&&(s.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(s.wrapper):e(s.wrapper)),s.viewFrom=s.viewTo=t.first,s.reportedViewFrom=s.reportedViewTo=t.first,s.view=[],s.renderedView=null,s.externalMeasured=null,s.viewOffset=0,s.lastWrapHeight=s.lastWrapWidth=0,s.updateLineNumbers=null,s.nativeBarWidth=s.barHeight=s.barWidth=0,s.scrollbarsClipped=!1,s.lineNumWidth=s.lineNumInnerWidth=s.lineNumChars=null,s.alignWidgets=!1,s.cachedCharWidth=s.cachedTextHeight=s.cachedPaddingH=null,s.maxLine=null,s.maxLineLength=0,s.maxLineChanged=!1,s.wheelDX=s.wheelDY=s.wheelStartX=s.wheelStartY=null,s.shift=!1,s.selForContextMenu=null,s.activeTouch=null,s.gutterSpecs=dl(i.gutters,i.lineNumbers),Bf(s),o.init(s)}var Ta=0,an=null;g?an=-.53:a?an=15:A?an=-.7:X&&(an=-1/3);function Uf(e){var t=e.wheelDeltaX,o=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),o==null&&e.detail&&e.axis==e.VERTICAL_AXIS?o=e.detail:o==null&&(o=e.wheelDelta),{x:t,y:o}}function T0(e){var t=Uf(e);return t.x*=an,t.y*=an,t}function kf(e,t){A&&F==102&&(e.display.chromeScrollHack==null?e.display.sizer.style.pointerEvents="none":clearTimeout(e.display.chromeScrollHack),e.display.chromeScrollHack=setTimeout(function(){e.display.chromeScrollHack=null,e.display.sizer.style.pointerEvents=""},100));var o=Uf(t),i=o.x,s=o.y,u=an;t.deltaMode===0&&(i=t.deltaX,s=t.deltaY,u=1);var d=e.display,h=d.scroller,m=h.scrollWidth>h.clientWidth,b=h.scrollHeight>h.clientHeight;if(i&&m||s&&b){if(s&&q&&T){e:for(var I=t.target,C=d.view;I!=h;I=I.parentNode)for(var B=0;B<C.length;B++)if(C[B].node==I){e.display.currentWheelTarget=I;break e}}if(i&&!a&&!M&&u!=null){s&&b&&co(e,Math.max(0,h.scrollTop+s*u)),Hn(e,Math.max(0,h.scrollLeft+i*u)),(!s||s&&b)&&At(t),d.wheelStartX=null;return}if(s&&u!=null){var L=s*u,W=e.doc.scrollTop,H=W+d.wrapper.clientHeight;L<0?W=Math.max(0,W+L-50):H=Math.min(e.doc.height,H+L+50),ul(e,{top:W,bottom:H})}Ta<20&&t.deltaMode!==0&&(d.wheelStartX==null?(d.wheelStartX=h.scrollLeft,d.wheelStartY=h.scrollTop,d.wheelDX=i,d.wheelDY=s,setTimeout(function(){if(d.wheelStartX!=null){var z=h.scrollLeft-d.wheelStartX,ne=h.scrollTop-d.wheelStartY,pe=ne&&d.wheelDY&&ne/d.wheelDY||z&&d.wheelDX&&z/d.wheelDX;d.wheelStartX=d.wheelStartY=null,pe&&(an=(an*Ta+pe)/(Ta+1),++Ta)}},200)):(d.wheelDX+=i,d.wheelDY+=s))}}var Ir=function(e,t){this.ranges=e,this.primIndex=t};Ir.prototype.primary=function(){return this.ranges[this.primIndex]},Ir.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var o=this.ranges[t],i=e.ranges[t];if(!Pe(o.anchor,i.anchor)||!Pe(o.head,i.head))return!1}return!0},Ir.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new He(_t(this.ranges[t].anchor),_t(this.ranges[t].head));return new Ir(e,this.primIndex)},Ir.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Ir.prototype.contains=function(e,t){t||(t=e);for(var o=0;o<this.ranges.length;o++){var i=this.ranges[o];if(ce(t,i.from())>=0&&ce(e,i.to())<=0)return o}return-1};var He=function(e,t){this.anchor=e,this.head=t};He.prototype.from=function(){return ui(this.anchor,this.head)},He.prototype.to=function(){return zt(this.anchor,this.head)},He.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Br(e,t,o){var i=e&&e.options.selectionsMayTouch,s=t[o];t.sort(function(B,L){return ce(B.from(),L.from())}),o=ue(t,s);for(var u=1;u<t.length;u++){var d=t[u],h=t[u-1],m=ce(h.to(),d.from());if(i&&!d.empty()?m>0:m>=0){var b=ui(h.from(),d.from()),I=zt(h.to(),d.to()),C=h.empty()?d.from()==d.head:h.from()==h.head;u<=o&&--o,t.splice(--u,2,new He(C?I:b,C?b:I))}}return new Ir(t,o)}function An(e,t){return new Ir([new He(e,t||e)],0)}function Rn(e){return e.text?O(e.from.line+e.text.length-1,Te(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Mf(e,t){if(ce(e,t.from)<0)return e;if(ce(e,t.to)<=0)return Rn(t);var o=e.line+t.text.length-(t.to.line-t.from.line)-1,i=e.ch;return e.line==t.to.line&&(i+=Rn(t).ch-t.to.ch),O(o,i)}function hl(e,t){for(var o=[],i=0;i<e.sel.ranges.length;i++){var s=e.sel.ranges[i];o.push(new He(Mf(s.anchor,t),Mf(s.head,t)))}return Br(e.cm,o,e.sel.primIndex)}function Gf(e,t,o){return e.line==t.line?O(o.line,e.ch-t.ch+o.ch):O(o.line+(e.line-t.line),e.ch)}function I0(e,t,o){for(var i=[],s=O(e.first,0),u=s,d=0;d<t.length;d++){var h=t[d],m=Gf(h.from,s,u),b=Gf(Rn(h),s,u);if(s=h.to,u=b,o=="around"){var I=e.sel.ranges[d],C=ce(I.head,I.anchor)<0;i[d]=new He(C?b:m,C?m:b)}else i[d]=new He(m,m)}return new Ir(i,e.sel.primIndex)}function pl(e){e.doc.mode=xe(e.options,e.doc.modeOption),bo(e)}function bo(e){e.doc.iter(function(t){t.stateAfter&&(t.stateAfter=null),t.styles&&(t.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,go(e,100),e.state.modeGen++,e.curOp&&qt(e)}function Of(e,t){return t.from.ch==0&&t.to.ch==0&&Te(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function gl(e,t,o,i){function s(pe){return o?o[pe]:null}function u(pe,ie,me){wm(pe,ie,me,i),Nt(pe,"change",pe,t)}function d(pe,ie){for(var me=[],Ae=pe;Ae<ie;++Ae)me.push(new fi(b[Ae],s(Ae),i));return me}var h=t.from,m=t.to,b=t.text,I=he(e,h.line),C=he(e,m.line),B=Te(b),L=s(b.length-1),W=m.line-h.line;if(t.full)e.insert(0,d(0,b.length)),e.remove(b.length,e.size-b.length);else if(Of(e,t)){var H=d(0,b.length-1);u(C,C.text,L),W&&e.remove(h.line,W),H.length&&e.insert(h.line,H)}else if(I==C)if(b.length==1)u(I,I.text.slice(0,h.ch)+B+I.text.slice(m.ch),L);else{var z=d(1,b.length-1);z.push(new fi(B+I.text.slice(m.ch),L,i)),u(I,I.text.slice(0,h.ch)+b[0],s(0)),e.insert(h.line+1,z)}else if(b.length==1)u(I,I.text.slice(0,h.ch)+b[0]+C.text.slice(m.ch),s(0)),e.remove(h.line+1,W);else{u(I,I.text.slice(0,h.ch)+b[0],s(0)),u(C,B+C.text.slice(m.ch),L);var ne=d(1,b.length-1);W>1&&e.remove(h.line+1,W-1),e.insert(h.line+1,ne)}Nt(e,"change",e,t)}function _n(e,t,o){function i(s,u,d){if(s.linked)for(var h=0;h<s.linked.length;++h){var m=s.linked[h];if(m.doc!=u){var b=d&&m.sharedHist;o&&!b||(t(m.doc,b),i(m.doc,s,b))}}}i(e,null,!0)}function Wf(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,tl(e),pl(e),Df(e),e.options.direction=t.direction,e.options.lineWrapping||Ps(e),e.options.mode=t.modeOption,qt(e)}function Df(e){(e.doc.direction=="rtl"?Oe:fe)(e.display.lineDiv,"CodeMirror-rtl")}function E0(e){cr(e,function(){Df(e),qt(e)})}function Ia(e){this.done=[],this.undone=[],this.undoDepth=e?e.undoDepth:1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e?e.maxGeneration:1}function ml(e,t){var o={from:_t(t.from),to:Rn(t),text:Rt(e,t.from,t.to)};return Qf(e,o,t.from.line,t.to.line+1),_n(e,function(i){return Qf(i,o,t.from.line,t.to.line+1)},!0),o}function Zf(e){for(;e.length;){var t=Te(e);if(t.ranges)e.pop();else break}}function C0(e,t){if(t)return Zf(e.done),Te(e.done);if(e.done.length&&!Te(e.done).ranges)return Te(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),Te(e.done)}function Vf(e,t,o,i){var s=e.history;s.undone.length=0;var u=+new Date,d,h;if((s.lastOp==i||s.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&s.lastModTime>u-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(d=C0(s,s.lastOp==i)))h=Te(d.changes),ce(t.from,t.to)==0&&ce(t.from,h.to)==0?h.to=Rn(t):d.changes.push(ml(e,t));else{var m=Te(s.done);for((!m||!m.ranges)&&Ea(e.sel,s.done),d={changes:[ml(e,t)],generation:s.generation},s.done.push(d);s.done.length>s.undoDepth;)s.done.shift(),s.done[0].ranges||s.done.shift()}s.done.push(o),s.generation=++s.maxGeneration,s.lastModTime=s.lastSelTime=u,s.lastOp=s.lastSelOp=i,s.lastOrigin=s.lastSelOrigin=t.origin,h||Ke(e,"historyAdded")}function A0(e,t,o,i){var s=t.charAt(0);return s=="*"||s=="+"&&o.ranges.length==i.ranges.length&&o.somethingSelected()==i.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function R0(e,t,o,i){var s=e.history,u=i&&i.origin;o==s.lastSelOp||u&&s.lastSelOrigin==u&&(s.lastModTime==s.lastSelTime&&s.lastOrigin==u||A0(e,u,Te(s.done),t))?s.done[s.done.length-1]=t:Ea(t,s.done),s.lastSelTime=+new Date,s.lastSelOrigin=u,s.lastSelOp=o,i&&i.clearRedo!==!1&&Zf(s.undone)}function Ea(e,t){var o=Te(t);o&&o.ranges&&o.equals(e)||t.push(e)}function Qf(e,t,o,i){var s=t["spans_"+e.id],u=0;e.iter(Math.max(e.first,o),Math.min(e.first+e.size,i),function(d){d.markedSpans&&((s||(s=t["spans_"+e.id]={}))[u]=d.markedSpans),++u})}function _0(e){if(!e)return null;for(var t,o=0;o<e.length;++o)e[o].marker.explicitlyCleared?t||(t=e.slice(0,o)):t&&t.push(e[o]);return t?t.length?t:null:e}function N0(e,t){var o=t["spans_"+e.id];if(!o)return null;for(var i=[],s=0;s<t.text.length;++s)i.push(_0(o[s]));return i}function Pf(e,t){var o=N0(e,t),i=Ds(e,t);if(!o)return i;if(!i)return o;for(var s=0;s<o.length;++s){var u=o[s],d=i[s];if(u&&d)e:for(var h=0;h<d.length;++h){for(var m=d[h],b=0;b<u.length;++b)if(u[b].marker==m.marker)continue e;u.push(m)}else d&&(o[s]=d)}return o}function vi(e,t,o){for(var i=[],s=0;s<e.length;++s){var u=e[s];if(u.ranges){i.push(o?Ir.prototype.deepCopy.call(u):u);continue}var d=u.changes,h=[];i.push({changes:h});for(var m=0;m<d.length;++m){var b=d[m],I=void 0;if(h.push({from:b.from,to:b.to,text:b.text}),t)for(var C in b)(I=C.match(/^spans_(\d+)$/))&&ue(t,Number(I[1]))>-1&&(Te(h)[C]=b[C],delete b[C])}}return i}function bl(e,t,o,i){if(i){var s=e.anchor;if(o){var u=ce(t,s)<0;u!=ce(o,s)<0?(s=t,t=o):u!=ce(t,o)<0&&(t=o)}return new He(s,t)}else return new He(o||t,t)}function Ca(e,t,o,i,s){s==null&&(s=e.cm&&(e.cm.display.shift||e.extend)),Zt(e,new Ir([bl(e.sel.primary(),t,o,s)],0),i)}function Hf(e,t,o){for(var i=[],s=e.cm&&(e.cm.display.shift||e.extend),u=0;u<e.sel.ranges.length;u++)i[u]=bl(e.sel.ranges[u],t[u],null,s);var d=Br(e.cm,i,e.sel.primIndex);Zt(e,d,o)}function vl(e,t,o,i){var s=e.sel.ranges.slice(0);s[t]=o,Zt(e,Br(e.cm,s,e.sel.primIndex),i)}function Jf(e,t,o,i){Zt(e,An(t,o),i)}function S0(e,t,o){var i={ranges:t.ranges,update:function(s){this.ranges=[];for(var u=0;u<s.length;u++)this.ranges[u]=new He(Se(e,s[u].anchor),Se(e,s[u].head))},origin:o&&o.origin};return Ke(e,"beforeSelectionChange",e,i),e.cm&&Ke(e.cm,"beforeSelectionChange",e.cm,i),i.ranges!=t.ranges?Br(e.cm,i.ranges,i.ranges.length-1):t}function Xf(e,t,o){var i=e.history.done,s=Te(i);s&&s.ranges?(i[i.length-1]=t,Aa(e,t,o)):Zt(e,t,o)}function Zt(e,t,o){Aa(e,t,o),R0(e,e.sel,e.cm?e.cm.curOp.id:NaN,o)}function Aa(e,t,o){(yt(e,"beforeSelectionChange")||e.cm&&yt(e.cm,"beforeSelectionChange"))&&(t=S0(e,t,o));var i=o&&o.bias||(ce(t.primary().head,e.sel.primary().head)<0?-1:1);Yf(e,zf(e,t,i,!0)),!(o&&o.scroll===!1)&&e.cm&&e.cm.getOption("readOnly")!="nocursor"&&mi(e.cm)}function Yf(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,sr(e.cm)),Nt(e,"cursorActivity",e))}function jf(e){Yf(e,zf(e,e.sel,null,!1))}function zf(e,t,o,i){for(var s,u=0;u<t.ranges.length;u++){var d=t.ranges[u],h=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[u],m=Ra(e,d.anchor,h&&h.anchor,o,i),b=d.head==d.anchor?m:Ra(e,d.head,h&&h.head,o,i);(s||m!=d.anchor||b!=d.head)&&(s||(s=t.ranges.slice(0,u)),s[u]=new He(m,b))}return s?Br(e.cm,s,t.primIndex):t}function yi(e,t,o,i,s){var u=he(e,t.line);if(u.markedSpans)for(var d=0;d<u.markedSpans.length;++d){var h=u.markedSpans[d],m=h.marker,b="selectLeft"in m?!m.selectLeft:m.inclusiveLeft,I="selectRight"in m?!m.selectRight:m.inclusiveRight;if((h.from==null||(b?h.from<=t.ch:h.from<t.ch))&&(h.to==null||(I?h.to>=t.ch:h.to>t.ch))){if(s&&(Ke(m,"beforeCursorEnter"),m.explicitlyCleared))if(u.markedSpans){--d;continue}else break;if(!m.atomic)continue;if(o){var C=m.find(i<0?1:-1),B=void 0;if((i<0?I:b)&&(C=qf(e,C,-i,C&&C.line==t.line?u:null)),C&&C.line==t.line&&(B=ce(C,o))&&(i<0?B<0:B>0))return yi(e,C,t,i,s)}var L=m.find(i<0?-1:1);return(i<0?b:I)&&(L=qf(e,L,i,L.line==t.line?u:null)),L?yi(e,L,t,i,s):null}}return t}function Ra(e,t,o,i,s){var u=i||1,d=yi(e,t,o,u,s)||!s&&yi(e,t,o,u,!0)||yi(e,t,o,-u,s)||!s&&yi(e,t,o,-u,!0);return d||(e.cantEdit=!0,O(e.first,0))}function qf(e,t,o,i){return o<0&&t.ch==0?t.line>e.first?Se(e,O(t.line-1)):null:o>0&&t.ch==(i||he(e,t.line)).text.length?t.line<e.first+e.size-1?O(t.line+1,0):null:new O(t.line,t.ch+o)}function Kf(e){e.setSelection(O(e.firstLine(),0),O(e.lastLine()),Me)}function $f(e,t,o){var i={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return i.canceled=!0}};return o&&(i.update=function(s,u,d,h){s&&(i.from=Se(e,s)),u&&(i.to=Se(e,u)),d&&(i.text=d),h!==void 0&&(i.origin=h)}),Ke(e,"beforeChange",e,i),e.cm&&Ke(e.cm,"beforeChange",e.cm,i),i.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:i.from,to:i.to,text:i.text,origin:i.origin}}function xi(e,t,o){if(e.cm){if(!e.cm.curOp)return St(e.cm,xi)(e,t,o);if(e.cm.state.suppressEdits)return}if(!((yt(e,"beforeChange")||e.cm&&yt(e.cm,"beforeChange"))&&(t=$f(e,t,!0),!t))){var i=Qu&&!o&&Rm(e,t.from,t.to);if(i)for(var s=i.length-1;s>=0;--s)ec(e,{from:i[s].from,to:i[s].to,text:s?[""]:t.text,origin:t.origin});else ec(e,t)}}function ec(e,t){if(!(t.text.length==1&&t.text[0]==""&&ce(t.from,t.to)==0)){var o=hl(e,t);Vf(e,t,o,e.cm?e.cm.curOp.id:NaN),vo(e,t,o,Ds(e,t));var i=[];_n(e,function(s,u){!u&&ue(i,s.history)==-1&&(ic(s.history,t),i.push(s.history)),vo(s,t,null,Ds(s,t))})}}function _a(e,t,o){var i=e.cm&&e.cm.state.suppressEdits;if(!(i&&!o)){for(var s=e.history,u,d=e.sel,h=t=="undo"?s.done:s.undone,m=t=="undo"?s.undone:s.done,b=0;b<h.length&&(u=h[b],!(o?u.ranges&&!u.equals(e.sel):!u.ranges));b++);if(b!=h.length){for(s.lastOrigin=s.lastSelOrigin=null;;)if(u=h.pop(),u.ranges){if(Ea(u,m),o&&!u.equals(e.sel)){Zt(e,u,{clearRedo:!1});return}d=u}else if(i){h.push(u);return}else break;var I=[];Ea(d,m),m.push({changes:I,generation:s.generation}),s.generation=u.generation||++s.maxGeneration;for(var C=yt(e,"beforeChange")||e.cm&&yt(e.cm,"beforeChange"),B=function(H){var z=u.changes[H];if(z.origin=t,C&&!$f(e,z,!1))return h.length=0,{};I.push(ml(e,z));var ne=H?hl(e,z):Te(h);vo(e,z,ne,Pf(e,z)),!H&&e.cm&&e.cm.scrollIntoView({from:z.from,to:Rn(z)});var pe=[];_n(e,function(ie,me){!me&&ue(pe,ie.history)==-1&&(ic(ie.history,z),pe.push(ie.history)),vo(ie,z,null,Pf(ie,z))})},L=u.changes.length-1;L>=0;--L){var W=B(L);if(W)return W.v}}}}function tc(e,t){if(t!=0&&(e.first+=t,e.sel=new Ir(It(e.sel.ranges,function(s){return new He(O(s.anchor.line+t,s.anchor.ch),O(s.head.line+t,s.head.ch))}),e.sel.primIndex),e.cm)){qt(e.cm,e.first,e.first-t,t);for(var o=e.cm.display,i=o.viewFrom;i<o.viewTo;i++)En(e.cm,i,"gutter")}}function vo(e,t,o,i){if(e.cm&&!e.cm.curOp)return St(e.cm,vo)(e,t,o,i);if(t.to.line<e.first){tc(e,t.text.length-1-(t.to.line-t.from.line));return}if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var s=t.text.length-1-(e.first-t.from.line);tc(e,s),t={from:O(e.first,0),to:O(t.to.line+s,t.to.ch),text:[Te(t.text)],origin:t.origin}}var u=e.lastLine();t.to.line>u&&(t={from:t.from,to:O(u,he(e,u).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Rt(e,t.from,t.to),o||(o=hl(e,t)),e.cm?w0(e.cm,t,i):gl(e,t,i),Aa(e,o,Me),e.cantEdit&&Ra(e,O(e.firstLine(),0))&&(e.cantEdit=!1)}}function w0(e,t,o){var i=e.doc,s=e.display,u=t.from,d=t.to,h=!1,m=u.line;e.options.lineWrapping||(m=v(Lr(he(i,u.line))),i.iter(m,d.line+1,function(L){if(L==s.maxLine)return h=!0,!0})),i.sel.contains(t.from,t.to)>-1&&sr(e),gl(i,t,o,xf(e)),e.options.lineWrapping||(i.iter(m,u.line+t.text.length,function(L){var W=fa(L);W>s.maxLineLength&&(s.maxLine=L,s.maxLineLength=W,s.maxLineChanged=!0,h=!1)}),h&&(e.curOp.updateMaxLine=!0)),ym(i,u.line),go(e,400);var b=t.text.length-(d.line-u.line)-1;t.full?qt(e):u.line==d.line&&t.text.length==1&&!Of(e.doc,t)?En(e,u.line,"text"):qt(e,u.line,d.line+1,b);var I=yt(e,"changes"),C=yt(e,"change");if(C||I){var B={from:u,to:d,text:t.text,removed:t.removed,origin:t.origin};C&&Nt(e,"change",e,B),I&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(B)}e.display.selForContextMenu=null}function Ti(e,t,o,i,s){var u;i||(i=o),ce(i,o)<0&&(u=[i,o],o=u[0],i=u[1]),typeof t=="string"&&(t=e.splitLines(t)),xi(e,{from:o,to:i,text:t,origin:s})}function rc(e,t,o,i){o<e.line?e.line+=i:t<e.line&&(e.line=t,e.ch=0)}function nc(e,t,o,i){for(var s=0;s<e.length;++s){var u=e[s],d=!0;if(u.ranges){u.copied||(u=e[s]=u.deepCopy(),u.copied=!0);for(var h=0;h<u.ranges.length;h++)rc(u.ranges[h].anchor,t,o,i),rc(u.ranges[h].head,t,o,i);continue}for(var m=0;m<u.changes.length;++m){var b=u.changes[m];if(o<b.from.line)b.from=O(b.from.line+i,b.from.ch),b.to=O(b.to.line+i,b.to.ch);else if(t<=b.to.line){d=!1;break}}d||(e.splice(0,s+1),s=0)}}function ic(e,t){var o=t.from.line,i=t.to.line,s=t.text.length-(i-o)-1;nc(e.done,o,i,s),nc(e.undone,o,i,s)}function yo(e,t,o,i){var s=t,u=t;return typeof t=="number"?u=he(e,Uu(e,t)):s=v(t),s==null?null:(i(u,s)&&e.cm&&En(e.cm,s,o),u)}function xo(e){this.lines=e,this.parent=null;for(var t=0,o=0;o<e.length;++o)e[o].parent=this,t+=e[o].height;this.height=t}xo.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var o=e,i=e+t;o<i;++o){var s=this.lines[o];this.height-=s.height,Lm(s),Nt(s,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,o){this.height+=o,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var i=0;i<t.length;++i)t[i].parent=this},iterN:function(e,t,o){for(var i=e+t;e<i;++e)if(o(this.lines[e]))return!0}};function To(e){this.children=e;for(var t=0,o=0,i=0;i<e.length;++i){var s=e[i];t+=s.chunkSize(),o+=s.height,s.parent=this}this.size=t,this.height=o,this.parent=null}To.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var o=0;o<this.children.length;++o){var i=this.children[o],s=i.chunkSize();if(e<s){var u=Math.min(t,s-e),d=i.height;if(i.removeInner(e,u),this.height-=d-i.height,s==u&&(this.children.splice(o--,1),i.parent=null),(t-=u)==0)break;e=0}else e-=s}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof xo))){var h=[];this.collapse(h),this.children=[new xo(h)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,o){this.size+=t.length,this.height+=o;for(var i=0;i<this.children.length;++i){var s=this.children[i],u=s.chunkSize();if(e<=u){if(s.insertInner(e,t,o),s.lines&&s.lines.length>50){for(var d=s.lines.length%25+25,h=d;h<s.lines.length;){var m=new xo(s.lines.slice(h,h+=25));s.height-=m.height,this.children.splice(++i,0,m),m.parent=this}s.lines=s.lines.slice(0,d),this.maybeSpill()}break}e-=u}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=e.children.splice(e.children.length-5,5),o=new To(t);if(e.parent){e.size-=o.size,e.height-=o.height;var s=ue(e.parent.children,e);e.parent.children.splice(s+1,0,o)}else{var i=new To(e.children);i.parent=e,e.children=[i,o],e=i}o.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,o){for(var i=0;i<this.children.length;++i){var s=this.children[i],u=s.chunkSize();if(e<u){var d=Math.min(t,u-e);if(s.iterN(e,d,o))return!0;if((t-=d)==0)break;e=0}else e-=u}}};var Io=function(e,t,o){if(o)for(var i in o)o.hasOwnProperty(i)&&(this[i]=o[i]);this.doc=e,this.node=t};Io.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,o=this.line,i=v(o);if(!(i==null||!t)){for(var s=0;s<t.length;++s)t[s]==this&&t.splice(s--,1);t.length||(o.widgets=null);var u=so(this);Dt(o,Math.max(0,o.height-u)),e&&(cr(e,function(){oc(e,o,-u),En(e,i,"widget")}),Nt(e,"lineWidgetCleared",e,this,i))}},Io.prototype.changed=function(){var e=this,t=this.height,o=this.doc.cm,i=this.line;this.height=null;var s=so(this)-t;s&&(In(this.doc,i)||Dt(i,i.height+s),o&&cr(o,function(){o.curOp.forceUpdate=!0,oc(o,i,s),Nt(o,"lineWidgetChanged",o,e,v(i))}))},xr(Io);function oc(e,t,o){nn(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&sl(e,o)}function L0(e,t,o,i){var s=new Io(e,o,i),u=e.cm;return u&&s.noHScroll&&(u.display.alignWidgets=!0),yo(e,t,"widget",function(d){var h=d.widgets||(d.widgets=[]);if(s.insertAt==null?h.push(s):h.splice(Math.min(h.length,Math.max(0,s.insertAt)),0,s),s.line=d,u&&!In(e,d)){var m=nn(d)<e.scrollTop;Dt(d,d.height+so(s)),m&&sl(u,s.height),u.curOp.forceUpdate=!0}return!0}),u&&Nt(u,"lineWidgetAdded",u,s,typeof t=="number"?t:v(t)),s}var ac=0,Nn=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++ac};Nn.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&Xn(e),yt(this,"clear")){var o=this.find();o&&Nt(this,"clear",o.from,o.to)}for(var i=null,s=null,u=0;u<this.lines.length;++u){var d=this.lines[u],h=io(d.markedSpans,this);e&&!this.collapsed?En(e,v(d),"text"):e&&(h.to!=null&&(s=v(d)),h.from!=null&&(i=v(d))),d.markedSpans=Im(d.markedSpans,h),h.from==null&&this.collapsed&&!In(this.doc,d)&&e&&Dt(d,hi(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var m=0;m<this.lines.length;++m){var b=Lr(this.lines[m]),I=fa(b);I>e.display.maxLineLength&&(e.display.maxLine=b,e.display.maxLineLength=I,e.display.maxLineChanged=!0)}i!=null&&e&&this.collapsed&&qt(e,i,s+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&jf(e.doc)),e&&Nt(e,"markerCleared",e,this,i,s),t&&Yn(e),this.parent&&this.parent.clear()}},Nn.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var o,i,s=0;s<this.lines.length;++s){var u=this.lines[s],d=io(u.markedSpans,this);if(d.from!=null&&(o=O(t?u:v(u),d.from),e==-1))return o;if(d.to!=null&&(i=O(t?u:v(u),d.to),e==1))return i}return o&&{from:o,to:i}},Nn.prototype.changed=function(){var e=this,t=this.find(-1,!0),o=this,i=this.doc.cm;!t||!i||cr(i,function(){var s=t.line,u=v(t.line),d=Ys(i,u);if(d&&(df(d),i.curOp.selectionChanged=i.curOp.forceUpdate=!0),i.curOp.updateMaxLine=!0,!In(o.doc,s)&&o.height!=null){var h=o.height;o.height=null;var m=so(o)-h;m&&Dt(s,s.height+m)}Nt(i,"markerChanged",i,e)})},Nn.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||ue(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},Nn.prototype.detachLine=function(e){if(this.lines.splice(ue(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},xr(Nn);function Ii(e,t,o,i,s){if(i&&i.shared)return F0(e,t,o,i,s);if(e.cm&&!e.cm.curOp)return St(e.cm,Ii)(e,t,o,i,s);var u=new Nn(e,s),d=ce(t,o);if(i&&le(i,u,!1),d>0||d==0&&u.clearWhenEmpty!==!1)return u;if(u.replacedWith&&(u.collapsed=!0,u.widgetNode=ee("span",[u.replacedWith],"CodeMirror-widget"),i.handleMouseEvents||u.widgetNode.setAttribute("cm-ignore-events","true"),i.insertLeft&&(u.widgetNode.insertLeft=!0)),u.collapsed){if(ju(e,t.line,t,o,u)||t.line!=o.line&&ju(e,o.line,t,o,u))throw new Error("Inserting collapsed marker partially overlapping an existing one");Tm()}u.addToHistory&&Vf(e,{from:t,to:o,origin:"markText"},e.sel,NaN);var h=t.line,m=e.cm,b;if(e.iter(h,o.line+1,function(C){m&&u.collapsed&&!m.options.lineWrapping&&Lr(C)==m.display.maxLine&&(b=!0),u.collapsed&&h!=t.line&&Dt(C,0),Em(C,new aa(u,h==t.line?t.ch:null,h==o.line?o.ch:null),e.cm&&e.cm.curOp),++h}),u.collapsed&&e.iter(t.line,o.line+1,function(C){In(e,C)&&Dt(C,0)}),u.clearOnEnter&&Ie(u,"beforeCursorEnter",function(){return u.clear()}),u.readOnly&&(xm(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),u.collapsed&&(u.id=++ac,u.atomic=!0),m){if(b&&(m.curOp.updateMaxLine=!0),u.collapsed)qt(m,t.line,o.line+1);else if(u.className||u.startStyle||u.endStyle||u.css||u.attributes||u.title)for(var I=t.line;I<=o.line;I++)En(m,I,"text");u.atomic&&jf(m.doc),Nt(m,"markerAdded",m,u)}return u}var Eo=function(e,t){this.markers=e,this.primary=t;for(var o=0;o<e.length;++o)e[o].parent=this};Eo.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();Nt(this,"clear")}},Eo.prototype.find=function(e,t){return this.primary.find(e,t)},xr(Eo);function F0(e,t,o,i,s){i=le(i),i.shared=!1;var u=[Ii(e,t,o,i,s)],d=u[0],h=i.widgetNode;return _n(e,function(m){h&&(i.widgetNode=h.cloneNode(!0)),u.push(Ii(m,Se(m,t),Se(m,o),i,s));for(var b=0;b<m.linked.length;++b)if(m.linked[b].isParent)return;d=Te(u)}),new Eo(u,d)}function sc(e){return e.findMarks(O(e.first,0),e.clipPos(O(e.lastLine())),function(t){return t.parent})}function B0(e,t){for(var o=0;o<t.length;o++){var i=t[o],s=i.find(),u=e.clipPos(s.from),d=e.clipPos(s.to);if(ce(u,d)){var h=Ii(e,u,d,i.primary,i.primary.type);i.markers.push(h),h.parent=i}}}function U0(e){for(var t=function(i){var s=e[i],u=[s.primary.doc];_n(s.primary.doc,function(m){return u.push(m)});for(var d=0;d<s.markers.length;d++){var h=s.markers[d];ue(u,h.doc)==-1&&(h.parent=null,s.markers.splice(d--,1))}},o=0;o<e.length;o++)t(o)}var k0=0,Kt=function(e,t,o,i,s){if(!(this instanceof Kt))return new Kt(e,t,o,i,s);o==null&&(o=0),To.call(this,[new xo([new fi("",null)])]),this.first=o,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=o;var u=O(o,0);this.sel=An(u),this.history=new Ia(null),this.id=++k0,this.modeOption=t,this.lineSep=i,this.direction=s=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),gl(this,{from:u,to:u,text:e}),Zt(this,An(u),Me)};Kt.prototype=lt(To.prototype,{constructor:Kt,iter:function(e,t,o){o?this.iterN(e-this.first,t-e,o):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var o=0,i=0;i<t.length;++i)o+=t[i].height;this.insertInner(e-this.first,t,o)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=Cr(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:wt(function(e){var t=O(this.first,0),o=this.first+this.size-1;xi(this,{from:t,to:O(o,he(this,o).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&fo(this.cm,0,0),Zt(this,An(t),Me)}),replaceRange:function(e,t,o,i){t=Se(this,t),o=o?Se(this,o):t,Ti(this,e,t,o,i)},getRange:function(e,t,o){var i=Rt(this,Se(this,e),Se(this,t));return o===!1?i:o===""?i.join(""):i.join(o||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(V(this,e))return he(this,e)},getLineNumber:function(e){return v(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=he(this,e)),Lr(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return Se(this,e)},getCursor:function(e){var t=this.sel.primary(),o;return e==null||e=="head"?o=t.head:e=="anchor"?o=t.anchor:e=="end"||e=="to"||e===!1?o=t.to():o=t.from(),o},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:wt(function(e,t,o){Jf(this,Se(this,typeof e=="number"?O(e,t||0):e),null,o)}),setSelection:wt(function(e,t,o){Jf(this,Se(this,e),Se(this,t||e),o)}),extendSelection:wt(function(e,t,o){Ca(this,Se(this,e),t&&Se(this,t),o)}),extendSelections:wt(function(e,t){Hf(this,ku(this,e),t)}),extendSelectionsBy:wt(function(e,t){var o=It(this.sel.ranges,e);Hf(this,ku(this,o),t)}),setSelections:wt(function(e,t,o){if(e.length){for(var i=[],s=0;s<e.length;s++)i[s]=new He(Se(this,e[s].anchor),Se(this,e[s].head||e[s].anchor));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),Zt(this,Br(this.cm,i,t),o)}}),addSelection:wt(function(e,t,o){var i=this.sel.ranges.slice(0);i.push(new He(Se(this,e),Se(this,t||e))),Zt(this,Br(this.cm,i,i.length-1),o)}),getSelection:function(e){for(var t=this.sel.ranges,o,i=0;i<t.length;i++){var s=Rt(this,t[i].from(),t[i].to());o=o?o.concat(s):s}return e===!1?o:o.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],o=this.sel.ranges,i=0;i<o.length;i++){var s=Rt(this,o[i].from(),o[i].to());e!==!1&&(s=s.join(e||this.lineSeparator())),t[i]=s}return t},replaceSelection:function(e,t,o){for(var i=[],s=0;s<this.sel.ranges.length;s++)i[s]=e;this.replaceSelections(i,t,o||"+input")},replaceSelections:wt(function(e,t,o){for(var i=[],s=this.sel,u=0;u<s.ranges.length;u++){var d=s.ranges[u];i[u]={from:d.from(),to:d.to(),text:this.splitLines(e[u]),origin:o}}for(var h=t&&t!="end"&&I0(this,i,t),m=i.length-1;m>=0;m--)xi(this,i[m]);h?Xf(this,h):this.cm&&mi(this.cm)}),undo:wt(function(){_a(this,"undo")}),redo:wt(function(){_a(this,"redo")}),undoSelection:wt(function(){_a(this,"undo",!0)}),redoSelection:wt(function(){_a(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,o=0,i=0;i<e.done.length;i++)e.done[i].ranges||++t;for(var s=0;s<e.undone.length;s++)e.undone[s].ranges||++o;return{undo:t,redo:o}},clearHistory:function(){var e=this;this.history=new Ia(this.history),_n(this,function(t){return t.history=e.history},!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:vi(this.history.done),undone:vi(this.history.undone)}},setHistory:function(e){var t=this.history=new Ia(this.history);t.done=vi(e.done.slice(0),null,!0),t.undone=vi(e.undone.slice(0),null,!0)},setGutterMarker:wt(function(e,t,o){return yo(this,e,"gutter",function(i){var s=i.gutterMarkers||(i.gutterMarkers={});return s[t]=o,!o&&mt(s)&&(i.gutterMarkers=null),!0})}),clearGutter:wt(function(e){var t=this;this.iter(function(o){o.gutterMarkers&&o.gutterMarkers[e]&&yo(t,o,"gutter",function(){return o.gutterMarkers[e]=null,mt(o.gutterMarkers)&&(o.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!V(this,e)||(t=e,e=he(this,e),!e))return null}else if(t=v(e),t==null)return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:wt(function(e,t,o){return yo(this,e,t=="gutter"?"gutter":"class",function(i){var s=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!i[s])i[s]=o;else{if($(o).test(i[s]))return!1;i[s]+=" "+o}return!0})}),removeLineClass:wt(function(e,t,o){return yo(this,e,t=="gutter"?"gutter":"class",function(i){var s=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",u=i[s];if(u)if(o==null)i[s]=null;else{var d=u.match($(o));if(!d)return!1;var h=d.index+d[0].length;i[s]=u.slice(0,d.index)+(!d.index||h==u.length?"":" ")+u.slice(h)||null}else return!1;return!0})}),addLineWidget:wt(function(e,t,o){return L0(this,e,t,o)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,o){return Ii(this,Se(this,e),Se(this,t),o,o&&o.type||"range")},setBookmark:function(e,t){var o={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=Se(this,e),Ii(this,e,e,o,"bookmark")},findMarksAt:function(e){e=Se(this,e);var t=[],o=he(this,e.line).markedSpans;if(o)for(var i=0;i<o.length;++i){var s=o[i];(s.from==null||s.from<=e.ch)&&(s.to==null||s.to>=e.ch)&&t.push(s.marker.parent||s.marker)}return t},findMarks:function(e,t,o){e=Se(this,e),t=Se(this,t);var i=[],s=e.line;return this.iter(e.line,t.line+1,function(u){var d=u.markedSpans;if(d)for(var h=0;h<d.length;h++){var m=d[h];!(m.to!=null&&s==e.line&&e.ch>=m.to||m.from==null&&s!=e.line||m.from!=null&&s==t.line&&m.from>=t.ch)&&(!o||o(m.marker))&&i.push(m.marker.parent||m.marker)}++s}),i},getAllMarks:function(){var e=[];return this.iter(function(t){var o=t.markedSpans;if(o)for(var i=0;i<o.length;++i)o[i].from!=null&&e.push(o[i].marker)}),e},posFromIndex:function(e){var t,o=this.first,i=this.lineSeparator().length;return this.iter(function(s){var u=s.text.length+i;if(u>e)return t=e,!0;e-=u,++o}),Se(this,O(o,t))},indexFromPos:function(e){e=Se(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var o=this.lineSeparator().length;return this.iter(this.first,e.line,function(i){t+=i.text.length+o}),t},copy:function(e){var t=new Kt(Cr(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,o=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<o&&(o=e.to);var i=new Kt(Cr(this,t,o),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(i.history=this.history),(this.linked||(this.linked=[])).push({doc:i,sharedHist:e.sharedHist}),i.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],B0(i,sc(this)),i},unlinkDoc:function(e){if(e instanceof ot&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var o=this.linked[t];if(o.doc==e){this.linked.splice(t,1),e.unlinkDoc(this),U0(sc(this));break}}if(e.history==this.history){var i=[e.id];_n(e,function(s){return i.push(s.id)},!0),e.history=new Ia(null),e.history.done=vi(this.history.done,i),e.history.undone=vi(this.history.undone,i)}},iterLinkedDocs:function(e){_n(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):jt(e)},lineSeparator:function(){return this.lineSep||`
26
+ `},setDirection:wt(function(e){e!="rtl"&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter(function(t){return t.order=null}),this.cm&&E0(this.cm))})}),Kt.prototype.eachLine=Kt.prototype.iter;var lc=0;function M0(e){var t=this;if(uc(t),!($e(t,e)||on(t.display,e))){At(e),g&&(lc=+new Date);var o=Qn(t,e,!0),i=e.dataTransfer.files;if(!(!o||t.isReadOnly()))if(i&&i.length&&window.FileReader&&window.File)for(var s=i.length,u=Array(s),d=0,h=function(){++d==s&&St(t,function(){o=Se(t.doc,o);var L={from:o,to:o,text:t.doc.splitLines(u.filter(function(W){return W!=null}).join(t.doc.lineSeparator())),origin:"paste"};xi(t.doc,L),Xf(t.doc,An(Se(t.doc,o),Se(t.doc,Rn(L))))})()},m=function(L,W){if(t.options.allowDropFileTypes&&ue(t.options.allowDropFileTypes,L.type)==-1){h();return}var H=new FileReader;H.onerror=function(){return h()},H.onload=function(){var z=H.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(z)){h();return}u[W]=z,h()},H.readAsText(L)},b=0;b<i.length;b++)m(i[b],b);else{if(t.state.draggingText&&t.doc.sel.contains(o)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var I=e.dataTransfer.getData("Text");if(I){var C;if(t.state.draggingText&&!t.state.draggingText.copy&&(C=t.listSelections()),Aa(t.doc,An(o,o)),C)for(var B=0;B<C.length;++B)Ti(t.doc,"",C[B].anchor,C[B].head,"drag");t.replaceSelection(I,"around","paste"),t.display.input.focus()}}catch{}}}}function G0(e,t){if(g&&(!e.state.draggingText||+new Date-lc<100)){Wr(t);return}if(!($e(e,t)||on(e.display,t))&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!X)){var o=x("img",null,null,"position: fixed; left: 0; top: 0;");o.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",M&&(o.width=o.height=1,e.display.wrapper.appendChild(o),o._top=o.offsetTop),t.dataTransfer.setDragImage(o,0,0),M&&o.parentNode.removeChild(o)}}function O0(e,t){var o=Qn(e,t);if(o){var i=document.createDocumentFragment();rl(e,o,i),e.display.dragCursor||(e.display.dragCursor=x("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),oe(e.display.dragCursor,i)}}function uc(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function fc(e){if(document.getElementsByClassName){for(var t=document.getElementsByClassName("CodeMirror"),o=[],i=0;i<t.length;i++){var s=t[i].CodeMirror;s&&o.push(s)}o.length&&o[0].operation(function(){for(var u=0;u<o.length;u++)e(o[u])})}}var cc=!1;function W0(){cc||(D0(),cc=!0)}function D0(){var e;Ie(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,fc(Z0)},100))}),Ie(window,"blur",function(){return fc(gi)})}function Z0(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Sn={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},Co=0;Co<10;Co++)Sn[Co+48]=Sn[Co+96]=String(Co);for(var Na=65;Na<=90;Na++)Sn[Na]=String.fromCharCode(Na);for(var Ao=1;Ao<=12;Ao++)Sn[Ao+111]=Sn[Ao+63235]="F"+Ao;var sn={};sn.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},sn.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},sn.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},sn.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},sn.default=q?sn.macDefault:sn.pcDefault;function V0(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var o,i,s,u,d=0;d<t.length-1;d++){var h=t[d];if(/^(cmd|meta|m)$/i.test(h))u=!0;else if(/^a(lt)?$/i.test(h))o=!0;else if(/^(c|ctrl|control)$/i.test(h))i=!0;else if(/^s(hift)?$/i.test(h))s=!0;else throw new Error("Unrecognized modifier name: "+h)}return o&&(e="Alt-"+e),i&&(e="Ctrl-"+e),u&&(e="Cmd-"+e),s&&(e="Shift-"+e),e}function Q0(e){var t={};for(var o in e)if(e.hasOwnProperty(o)){var i=e[o];if(/^(name|fallthrough|(de|at)tach)$/.test(o))continue;if(i=="..."){delete e[o];continue}for(var s=It(o.split(" "),V0),u=0;u<s.length;u++){var d=void 0,h=void 0;u==s.length-1?(h=s.join(" "),d=i):(h=s.slice(0,u+1).join(" "),d="...");var m=t[h];if(!m)t[h]=d;else if(m!=d)throw new Error("Inconsistent bindings for "+h)}delete e[o]}for(var b in t)e[b]=t[b];return e}function Ei(e,t,o,i){t=Sa(t);var s=t.call?t.call(e,i):t[e];if(s===!1)return"nothing";if(s==="...")return"multi";if(s!=null&&o(s))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return Ei(e,t.fallthrough,o,i);for(var u=0;u<t.fallthrough.length;u++){var d=Ei(e,t.fallthrough[u],o,i);if(d)return d}}}function dc(e){var t=typeof e=="string"?e:Sn[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function hc(e,t,o){var i=e;return t.altKey&&i!="Alt"&&(e="Alt-"+e),(w?t.metaKey:t.ctrlKey)&&i!="Ctrl"&&(e="Ctrl-"+e),(w?t.ctrlKey:t.metaKey)&&i!="Mod"&&(e="Cmd-"+e),!o&&t.shiftKey&&i!="Shift"&&(e="Shift-"+e),e}function pc(e,t){if(M&&e.keyCode==34&&e.char)return!1;var o=Sn[e.keyCode];return o==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(o=e.code),hc(o,e,t))}function Sa(e){return typeof e=="string"?sn[e]:e}function Ci(e,t){for(var o=e.doc.sel.ranges,i=[],s=0;s<o.length;s++){for(var u=t(o[s]);i.length&&ce(u.from,Te(i).to)<=0;){var d=i.pop();if(ce(d.from,u.from)<0){u.from=d.from;break}}i.push(u)}cr(e,function(){for(var h=i.length-1;h>=0;h--)Ti(e.doc,"",i[h].from,i[h].to,"+delete");mi(e)})}function yl(e,t,o){var i=kt(e.text,t+o,o);return i<0||i>e.text.length?null:i}function xl(e,t,o){var i=yl(e,t.ch,o);return i==null?null:new O(t.line,i,o<0?"after":"before")}function Tl(e,t,o,i,s){if(e){t.doc.direction=="rtl"&&(s=-s);var u=Ne(o,t.doc.direction);if(u){var d=s<0?Te(u):u[0],h=s<0==(d.level==1),m=h?"after":"before",b;if(d.level>0||t.doc.direction=="rtl"){var I=di(t,o);b=s<0?o.text.length-1:0;var C=Qr(t,I,b).top;b=ft(function(B){return Qr(t,I,B).top==C},s<0==(d.level==1)?d.from:d.to-1,b),m=="before"&&(b=yl(o,b,1))}else b=s<0?d.to:d.from;return new O(i,b,m)}}return new O(i,s<0?o.text.length:0,s<0?"before":"after")}function P0(e,t,o,i){var s=Ne(t,e.doc.direction);if(!s)return xl(t,o,i);o.ch>=t.text.length?(o.ch=t.text.length,o.sticky="before"):o.ch<=0&&(o.ch=0,o.sticky="after");var u=vr(s,o.ch,o.sticky),d=s[u];if(e.doc.direction=="ltr"&&d.level%2==0&&(i>0?d.to>o.ch:d.from<o.ch))return xl(t,o,i);var h=function(ne,pe){return yl(t,ne instanceof O?ne.ch:ne,pe)},m,b=function(ne){return e.options.lineWrapping?(m=m||di(e,t),yf(e,t,m,ne)):{begin:0,end:t.text.length}},I=b(o.sticky=="before"?h(o,-1):o.ch);if(e.doc.direction=="rtl"||d.level==1){var C=d.level==1==i<0,B=h(o,C?1:-1);if(B!=null&&(C?B<=d.to&&B<=I.end:B>=d.from&&B>=I.begin)){var L=C?"before":"after";return new O(o.line,B,L)}}var W=function(ne,pe,ie){for(var me=function(et,Lt){return Lt?new O(o.line,h(et,1),"before"):new O(o.line,et,"after")};ne>=0&&ne<s.length;ne+=pe){var Ae=s[ne],Ee=pe>0==(Ae.level!=1),ke=Ee?ie.begin:h(ie.end,-1);if(Ae.from<=ke&&ke<Ae.to||(ke=Ee?Ae.from:h(Ae.to,-1),ie.begin<=ke&&ke<ie.end))return me(ke,Ee)}},H=W(u+i,i,I);if(H)return H;var z=i>0?I.end:h(I.begin,-1);return z!=null&&!(i>0&&z==t.text.length)&&(H=W(i>0?0:s.length-1,i,b(z)),H)?H:null}var Ro={selectAll:Kf,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Me)},killLine:function(e){return Ci(e,function(t){if(t.empty()){var o=he(e.doc,t.head.line).text.length;return t.head.ch==o&&t.head.line<e.lastLine()?{from:t.head,to:O(t.head.line+1,0)}:{from:t.head,to:O(t.head.line,o)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return Ci(e,function(t){return{from:O(t.from().line,0),to:Se(e.doc,O(t.to().line+1,0))}})},delLineLeft:function(e){return Ci(e,function(t){return{from:O(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return Ci(e,function(t){var o=e.charCoords(t.head,"div").top+5,i=e.coordsChar({left:0,top:o},"div");return{from:i,to:t.from()}})},delWrappedLineRight:function(e){return Ci(e,function(t){var o=e.charCoords(t.head,"div").top+5,i=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:o},"div");return{from:t.from(),to:i}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(O(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(O(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return gc(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return mc(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return H0(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var o=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:o},"div")},Re)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var o=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:o},"div")},Re)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var o=e.cursorCoords(t.head,"div").top+5,i=e.coordsChar({left:0,top:o},"div");return i.ch<e.getLine(i.line).search(/\S/)?mc(e,t.head):i},Re)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection(" ")},insertSoftTab:function(e){for(var t=[],o=e.listSelections(),i=e.options.tabSize,s=0;s<o.length;s++){var u=o[s].from(),d=ye(e.getLine(u.line),u.ch,i);t.push(Ve(i-d%i))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return cr(e,function(){for(var t=e.listSelections(),o=[],i=0;i<t.length;i++)if(t[i].empty()){var s=t[i].head,u=he(e.doc,s.line).text;if(u){if(s.ch==u.length&&(s=new O(s.line,s.ch-1)),s.ch>0)s=new O(s.line,s.ch+1),e.replaceRange(u.charAt(s.ch-1)+u.charAt(s.ch-2),O(s.line,s.ch-2),s,"+transpose");else if(s.line>e.doc.first){var d=he(e.doc,s.line-1).text;d&&(s=new O(s.line,1),e.replaceRange(u.charAt(0)+e.doc.lineSeparator()+d.charAt(d.length-1),O(s.line-1,d.length-1),s,"+transpose"))}}o.push(new He(s,s))}e.setSelections(o)})},newlineAndIndent:function(e){return cr(e,function(){for(var t=e.listSelections(),o=t.length-1;o>=0;o--)e.replaceRange(e.doc.lineSeparator(),t[o].anchor,t[o].head,"+input");t=e.listSelections();for(var i=0;i<t.length;i++)e.indentLine(t[i].from().line,null,!0);mi(e)})},openLine:function(e){return e.replaceSelection(`
27
+ `,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function gc(e,t){var o=he(e.doc,t),i=Lr(o);return i!=o&&(t=v(i)),Tl(!0,e,i,t,1)}function H0(e,t){var o=he(e.doc,t),i=Nm(o);return i!=o&&(t=v(i)),Tl(!0,e,o,t,-1)}function mc(e,t){var o=gc(e,t.line),i=he(e.doc,o.line),s=Ne(i,e.doc.direction);if(!s||s[0].level==0){var u=Math.max(o.ch,i.text.search(/\S/)),d=t.line==o.line&&t.ch<=u&&t.ch;return O(o.line,d?0:u,o.sticky)}return o}function wa(e,t,o){if(typeof t=="string"&&(t=Ro[t],!t))return!1;e.display.input.ensurePolled();var i=e.display.shift,s=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),o&&(e.display.shift=!1),s=t(e)!=Je}finally{e.display.shift=i,e.state.suppressEdits=!1}return s}function J0(e,t,o){for(var i=0;i<e.state.keyMaps.length;i++){var s=Ei(t,e.state.keyMaps[i],o,e);if(s)return s}return e.options.extraKeys&&Ei(t,e.options.extraKeys,o,e)||Ei(t,e.options.keyMap,o,e)}var X0=new Ge;function _o(e,t,o,i){var s=e.state.keySeq;if(s){if(dc(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:X0.set(50,function(){e.state.keySeq==s&&(e.state.keySeq=null,e.display.input.reset())}),bc(e,s+" "+t,o,i))return!0}return bc(e,t,o,i)}function bc(e,t,o,i){var s=J0(e,t,i);return s=="multi"&&(e.state.keySeq=t),s=="handled"&&Nt(e,"keyHandled",e,t,o),(s=="handled"||s=="multi")&&(At(o),nl(e)),!!s}function vc(e,t){var o=pc(t,!0);return o?t.shiftKey&&!e.state.keySeq?_o(e,"Shift-"+o,t,function(i){return wa(e,i,!0)})||_o(e,o,t,function(i){if(typeof i=="string"?/^go[A-Z]/.test(i):i.motion)return wa(e,i)}):_o(e,o,t,function(i){return wa(e,i)}):!1}function Y0(e,t,o){return _o(e,"'"+o+"'",t,function(i){return wa(e,i,!0)})}var Il=null;function yc(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField())&&(t.curOp.focus=ge(Ze(t)),!$e(t,e))){g&&y<11&&e.keyCode==27&&(e.returnValue=!1);var o=e.keyCode;t.display.shift=o==16||e.shiftKey;var i=vc(t,e);M&&(Il=i?o:null,!i&&o==88&&!xn&&(q?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),a&&!q&&!i&&o==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),o==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&j0(t)}}function j0(e){var t=e.display.lineDiv;Oe(t,"CodeMirror-crosshair");function o(i){(i.keyCode==18||!i.altKey)&&(fe(t,"CodeMirror-crosshair"),Ct(document,"keyup",o),Ct(document,"mouseover",o))}Ie(document,"keyup",o),Ie(document,"mouseover",o)}function xc(e){e.keyCode==16&&(this.doc.sel.shift=!1),$e(this,e)}function Tc(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField())&&!(on(t.display,e)||$e(t,e)||e.ctrlKey&&!e.altKey||q&&e.metaKey)){var o=e.keyCode,i=e.charCode;if(M&&o==Il){Il=null,At(e);return}if(!(M&&(!e.which||e.which<10)&&vc(t,e))){var s=String.fromCharCode(i??o);s!="\b"&&(Y0(t,e,s)||t.display.input.onKeyPress(e))}}}var z0=400,El=function(e,t,o){this.time=e,this.pos=t,this.button=o};El.prototype.compare=function(e,t,o){return this.time+z0>e&&ce(t,this.pos)==0&&o==this.button};var No,So;function q0(e,t){var o=+new Date;return So&&So.compare(o,e,t)?(No=So=null,"triple"):No&&No.compare(o,e,t)?(So=new El(o,e,t),No=null,"double"):(No=new El(o,e,t),So=null,"single")}function Ic(e){var t=this,o=t.display;if(!($e(t,e)||o.activeTouch&&o.input.supportsTouch())){if(o.input.ensurePolled(),o.shift=e.shiftKey,on(o,e)){T||(o.scroller.draggable=!1,setTimeout(function(){return o.scroller.draggable=!0},100));return}if(!Cl(t,e)){var i=Qn(t,e),s=Yt(e),u=i?q0(i,s):"single";ve(t).focus(),s==1&&t.state.selectingText&&t.state.selectingText(e),!(i&&K0(t,s,i,u,e))&&(s==1?i?eb(t,i,u,e):yn(e)==o.scroller&&At(e):s==2?(i&&Ca(t.doc,i),setTimeout(function(){return o.input.focus()},20)):s==3&&(P?t.display.input.onContextMenu(e):il(t)))}}}function K0(e,t,o,i,s){var u="Click";return i=="double"?u="Double"+u:i=="triple"&&(u="Triple"+u),u=(t==1?"Left":t==2?"Middle":"Right")+u,_o(e,hc(u,s),s,function(d){if(typeof d=="string"&&(d=Ro[d]),!d)return!1;var h=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),h=d(e,o)!=Je}finally{e.state.suppressEdits=!1}return h})}function $0(e,t,o){var i=e.getOption("configureMouse"),s=i?i(e,t,o):{};if(s.unit==null){var u=te?o.shiftKey&&o.metaKey:o.altKey;s.unit=u?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(s.extend==null||e.doc.extend)&&(s.extend=e.doc.extend||o.shiftKey),s.addNew==null&&(s.addNew=q?o.metaKey:o.ctrlKey),s.moveOnDrag==null&&(s.moveOnDrag=!(q?o.altKey:o.ctrlKey)),s}function eb(e,t,o,i){g?setTimeout(se(Ef,e),0):e.curOp.focus=ge(Ze(e));var s=$0(e,o,i),u=e.doc.sel,d;e.options.dragDrop&&si&&!e.isReadOnly()&&o=="single"&&(d=u.contains(t))>-1&&(ce((d=u.ranges[d]).from(),t)<0||t.xRel>0)&&(ce(d.to(),t)>0||t.xRel<0)?tb(e,i,t,s):rb(e,i,t,s)}function tb(e,t,o,i){var s=e.display,u=!1,d=St(e,function(b){T&&(s.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:il(e)),Ct(s.wrapper.ownerDocument,"mouseup",d),Ct(s.wrapper.ownerDocument,"mousemove",h),Ct(s.scroller,"dragstart",m),Ct(s.scroller,"drop",d),u||(At(b),i.addNew||Ca(e.doc,o,null,null,i.extend),T&&!X||g&&y==9?setTimeout(function(){s.wrapper.ownerDocument.body.focus({preventScroll:!0}),s.input.focus()},20):s.input.focus())}),h=function(b){u=u||Math.abs(t.clientX-b.clientX)+Math.abs(t.clientY-b.clientY)>=10},m=function(){return u=!0};T&&(s.scroller.draggable=!0),e.state.draggingText=d,d.copy=!i.moveOnDrag,Ie(s.wrapper.ownerDocument,"mouseup",d),Ie(s.wrapper.ownerDocument,"mousemove",h),Ie(s.scroller,"dragstart",m),Ie(s.scroller,"drop",d),e.state.delayingBlurEvent=!0,setTimeout(function(){return s.input.focus()},20),s.scroller.dragDrop&&s.scroller.dragDrop()}function Ec(e,t,o){if(o=="char")return new He(t,t);if(o=="word")return e.findWordAt(t);if(o=="line")return new He(O(t.line,0),Se(e.doc,O(t.line+1,0)));var i=o(e,t);return new He(i.from,i.to)}function rb(e,t,o,i){g&&il(e);var s=e.display,u=e.doc;At(t);var d,h,m=u.sel,b=m.ranges;if(i.addNew&&!i.extend?(h=u.sel.contains(o),h>-1?d=b[h]:d=new He(o,o)):(d=u.sel.primary(),h=u.sel.primIndex),i.unit=="rectangle")i.addNew||(d=new He(o,o)),o=Qn(e,t,!0,!0),h=-1;else{var I=Ec(e,o,i.unit);i.extend?d=bl(d,I.anchor,I.head,i.extend):d=I}i.addNew?h==-1?(h=b.length,Zt(u,Br(e,b.concat([d]),h),{scroll:!1,origin:"*mouse"})):b.length>1&&b[h].empty()&&i.unit=="char"&&!i.extend?(Zt(u,Br(e,b.slice(0,h).concat(b.slice(h+1)),0),{scroll:!1,origin:"*mouse"}),m=u.sel):vl(u,h,d,Le):(h=0,Zt(u,new Ir([d],0),Le),m=u.sel);var C=o;function B(ie){if(ce(C,ie)!=0)if(C=ie,i.unit=="rectangle"){for(var me=[],Ae=e.options.tabSize,Ee=ye(he(u,o.line).text,o.ch,Ae),ke=ye(he(u,ie.line).text,ie.ch,Ae),et=Math.min(Ee,ke),Lt=Math.max(Ee,ke),ct=Math.min(o.line,ie.line),dr=Math.min(e.lastLine(),Math.max(o.line,ie.line));ct<=dr;ct++){var $t=he(u,ct).text,bt=De($t,et,Ae);et==Lt?me.push(new He(O(ct,bt),O(ct,bt))):$t.length>bt&&me.push(new He(O(ct,bt),O(ct,De($t,Lt,Ae))))}me.length||me.push(new He(o,o)),Zt(u,Br(e,m.ranges.slice(0,h).concat(me),h),{origin:"*mouse",scroll:!1}),e.scrollIntoView(ie)}else{var er=d,Gt=Ec(e,ie,i.unit),xt=er.anchor,vt;ce(Gt.anchor,xt)>0?(vt=Gt.head,xt=ui(er.from(),Gt.anchor)):(vt=Gt.anchor,xt=zt(er.to(),Gt.head));var ht=m.ranges.slice(0);ht[h]=nb(e,new He(Se(u,xt),vt)),Zt(u,Br(e,ht,h),Le)}}var L=s.wrapper.getBoundingClientRect(),W=0;function H(ie){var me=++W,Ae=Qn(e,ie,!0,i.unit=="rectangle");if(Ae)if(ce(Ae,C)!=0){e.curOp.focus=ge(Ze(e)),B(Ae);var Ee=va(s,u);(Ae.line>=Ee.to||Ae.line<Ee.from)&&setTimeout(St(e,function(){W==me&&H(ie)}),150)}else{var ke=ie.clientY<L.top?-20:ie.clientY>L.bottom?20:0;ke&&setTimeout(St(e,function(){W==me&&(s.scroller.scrollTop+=ke,H(ie))}),50)}}function z(ie){e.state.selectingText=!1,W=1/0,ie&&(At(ie),s.input.focus()),Ct(s.wrapper.ownerDocument,"mousemove",ne),Ct(s.wrapper.ownerDocument,"mouseup",pe),u.history.lastSelOrigin=null}var ne=St(e,function(ie){ie.buttons===0||!Yt(ie)?z(ie):H(ie)}),pe=St(e,z);e.state.selectingText=pe,Ie(s.wrapper.ownerDocument,"mousemove",ne),Ie(s.wrapper.ownerDocument,"mouseup",pe)}function nb(e,t){var o=t.anchor,i=t.head,s=he(e.doc,o.line);if(ce(o,i)==0&&o.sticky==i.sticky)return t;var u=Ne(s);if(!u)return t;var d=vr(u,o.ch,o.sticky),h=u[d];if(h.from!=o.ch&&h.to!=o.ch)return t;var m=d+(h.from==o.ch==(h.level!=1)?0:1);if(m==0||m==u.length)return t;var b;if(i.line!=o.line)b=(i.line-o.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var I=vr(u,i.ch,i.sticky),C=I-d||(i.ch-o.ch)*(h.level==1?-1:1);I==m-1||I==m?b=C<0:b=C>0}var B=u[m+(b?-1:0)],L=b==(B.level==1),W=L?B.from:B.to,H=L?"after":"before";return o.ch==W&&o.sticky==H?t:new He(new O(o.line,W,H),i)}function Cc(e,t,o,i){var s,u;if(t.touches)s=t.touches[0].clientX,u=t.touches[0].clientY;else try{s=t.clientX,u=t.clientY}catch{return!1}if(s>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;i&&At(t);var d=e.display,h=d.lineDiv.getBoundingClientRect();if(u>h.bottom||!yt(e,o))return pt(t);u-=h.top-d.viewOffset;for(var m=0;m<e.display.gutterSpecs.length;++m){var b=d.gutters.childNodes[m];if(b&&b.getBoundingClientRect().right>=s){var I=E(e.doc,u),C=e.display.gutterSpecs[m];return Ke(e,o,e,I,C.className,t),pt(t)}}}function Cl(e,t){return Cc(e,t,"gutterClick",!0)}function Ac(e,t){on(e.display,t)||ib(e,t)||$e(e,t,"contextmenu")||P||e.display.input.onContextMenu(t)}function ib(e,t){return yt(e,"gutterContextMenu")?Cc(e,t,"gutterContextMenu",!1):!1}function Rc(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),lo(e)}var Ai={toString:function(){return"CodeMirror.Init"}},_c={},La={};function ob(e){var t=e.optionHandlers;function o(i,s,u,d){e.defaults[i]=s,u&&(t[i]=d?function(h,m,b){b!=Ai&&u(h,m,b)}:u)}e.defineOption=o,e.Init=Ai,o("value","",function(i,s){return i.setValue(s)},!0),o("mode",null,function(i,s){i.doc.modeOption=s,pl(i)},!0),o("indentUnit",2,pl,!0),o("indentWithTabs",!1),o("smartIndent",!0),o("tabSize",4,function(i){bo(i),lo(i),qt(i)},!0),o("lineSeparator",null,function(i,s){if(i.doc.lineSep=s,!!s){var u=[],d=i.doc.first;i.doc.iter(function(m){for(var b=0;;){var I=m.text.indexOf(s,b);if(I==-1)break;b=I+s.length,u.push(O(d,I))}d++});for(var h=u.length-1;h>=0;h--)Ti(i.doc,s,u[h],O(u[h].line,u[h].ch+s.length))}}),o("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\u202d\u202e\u2066\u2067\u2069\ufeff\ufff9-\ufffc]/g,function(i,s,u){i.state.specialChars=new RegExp(s.source+(s.test(" ")?"":"| "),"g"),u!=Ai&&i.refresh()}),o("specialCharPlaceholder",Um,function(i){return i.refresh()},!0),o("electricChars",!0),o("inputStyle",J?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),o("spellcheck",!1,function(i,s){return i.getInputField().spellcheck=s},!0),o("autocorrect",!1,function(i,s){return i.getInputField().autocorrect=s},!0),o("autocapitalize",!1,function(i,s){return i.getInputField().autocapitalize=s},!0),o("rtlMoveVisually",!ae),o("wholeLineUpdateBefore",!0),o("theme","default",function(i){Rc(i),mo(i)},!0),o("keyMap","default",function(i,s,u){var d=Sa(s),h=u!=Ai&&Sa(u);h&&h.detach&&h.detach(i,d),d.attach&&d.attach(i,h||null)}),o("extraKeys",null),o("configureMouse",null),o("lineWrapping",!1,sb,!0),o("gutters",[],function(i,s){i.display.gutterSpecs=dl(s,i.options.lineNumbers),mo(i)},!0),o("fixedGutter",!0,function(i,s){i.display.gutters.style.left=s?el(i.display)+"px":"0",i.refresh()},!0),o("coverGutterNextToScrollbar",!1,function(i){return bi(i)},!0),o("scrollbarStyle","native",function(i){Sf(i),bi(i),i.display.scrollbars.setScrollTop(i.doc.scrollTop),i.display.scrollbars.setScrollLeft(i.doc.scrollLeft)},!0),o("lineNumbers",!1,function(i,s){i.display.gutterSpecs=dl(i.options.gutters,s),mo(i)},!0),o("firstLineNumber",1,mo,!0),o("lineNumberFormatter",function(i){return i},mo,!0),o("showCursorWhenSelecting",!1,uo,!0),o("resetSelectionOnContextMenu",!0),o("lineWiseCopyCut",!0),o("pasteLinesPerSelection",!0),o("selectionsMayTouch",!1),o("readOnly",!1,function(i,s){s=="nocursor"&&(gi(i),i.display.input.blur()),i.display.input.readOnlyChanged(s)}),o("screenReaderLabel",null,function(i,s){s=s===""?null:s,i.display.input.screenReaderLabelChanged(s)}),o("disableInput",!1,function(i,s){s||i.display.input.reset()},!0),o("dragDrop",!0,ab),o("allowDropFileTypes",null),o("cursorBlinkRate",530),o("cursorScrollMargin",0),o("cursorHeight",1,uo,!0),o("singleCursorHeightPerLine",!0,uo,!0),o("workTime",100),o("workDelay",100),o("flattenSpans",!0,bo,!0),o("addModeClass",!1,bo,!0),o("pollInterval",100),o("undoDepth",200,function(i,s){return i.doc.history.undoDepth=s}),o("historyEventDelay",1250),o("viewportMargin",10,function(i){return i.refresh()},!0),o("maxHighlightLength",1e4,bo,!0),o("moveInputWithCursor",!0,function(i,s){s||i.display.input.resetPosition()}),o("tabindex",null,function(i,s){return i.display.input.getField().tabIndex=s||""}),o("autofocus",null),o("direction","ltr",function(i,s){return i.doc.setDirection(s)},!0),o("phrases",null)}function ab(e,t,o){var i=o&&o!=Ai;if(!t!=!i){var s=e.display.dragFunctions,u=t?Ie:Ct;u(e.display.scroller,"dragstart",s.start),u(e.display.scroller,"dragenter",s.enter),u(e.display.scroller,"dragover",s.over),u(e.display.scroller,"dragleave",s.leave),u(e.display.scroller,"drop",s.drop)}}function sb(e){e.options.lineWrapping?(Oe(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(fe(e.display.wrapper,"CodeMirror-wrap"),Ps(e)),tl(e),qt(e),lo(e),setTimeout(function(){return bi(e)},100)}function ot(e,t){var o=this;if(!(this instanceof ot))return new ot(e,t);this.options=t=t?le(t):{},le(_c,t,!1);var i=t.value;typeof i=="string"?i=new Kt(i,t.mode,null,t.lineSeparator,t.direction):t.mode&&(i.modeOption=t.mode),this.doc=i;var s=new ot.inputStyles[t.inputStyle](this),u=this.display=new x0(e,i,s,t);u.wrapper.CodeMirror=this,Rc(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Sf(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new Ge,keySeq:null,specialChars:null},t.autofocus&&!J&&u.input.focus(),g&&y<11&&setTimeout(function(){return o.display.input.reset(!0)},20),lb(this),W0(),Xn(this),this.curOp.forceUpdate=!0,Wf(this,i),t.autofocus&&!J||this.hasFocus()?setTimeout(function(){o.hasFocus()&&!o.state.focused&&ol(o)},20):gi(this);for(var d in La)La.hasOwnProperty(d)&&La[d](this,t[d],Ai);Ff(this),t.finishInit&&t.finishInit(this);for(var h=0;h<Al.length;++h)Al[h](this);Yn(this),T&&t.lineWrapping&&getComputedStyle(u.lineDiv).textRendering=="optimizelegibility"&&(u.lineDiv.style.textRendering="auto")}ot.defaults=_c,ot.optionHandlers=La;function lb(e){var t=e.display;Ie(t.scroller,"mousedown",St(e,Ic)),g&&y<11?Ie(t.scroller,"dblclick",St(e,function(m){if(!$e(e,m)){var b=Qn(e,m);if(!(!b||Cl(e,m)||on(e.display,m))){At(m);var I=e.findWordAt(b);Ca(e.doc,I.anchor,I.head)}}})):Ie(t.scroller,"dblclick",function(m){return $e(e,m)||At(m)}),Ie(t.scroller,"contextmenu",function(m){return Ac(e,m)}),Ie(t.input.getField(),"contextmenu",function(m){t.scroller.contains(m.target)||Ac(e,m)});var o,i={end:0};function s(){t.activeTouch&&(o=setTimeout(function(){return t.activeTouch=null},1e3),i=t.activeTouch,i.end=+new Date)}function u(m){if(m.touches.length!=1)return!1;var b=m.touches[0];return b.radiusX<=1&&b.radiusY<=1}function d(m,b){if(b.left==null)return!0;var I=b.left-m.left,C=b.top-m.top;return I*I+C*C>20*20}Ie(t.scroller,"touchstart",function(m){if(!$e(e,m)&&!u(m)&&!Cl(e,m)){t.input.ensurePolled(),clearTimeout(o);var b=+new Date;t.activeTouch={start:b,moved:!1,prev:b-i.end<=300?i:null},m.touches.length==1&&(t.activeTouch.left=m.touches[0].pageX,t.activeTouch.top=m.touches[0].pageY)}}),Ie(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),Ie(t.scroller,"touchend",function(m){var b=t.activeTouch;if(b&&!on(t,m)&&b.left!=null&&!b.moved&&new Date-b.start<300){var I=e.coordsChar(t.activeTouch,"page"),C;!b.prev||d(b,b.prev)?C=new He(I,I):!b.prev.prev||d(b,b.prev.prev)?C=e.findWordAt(I):C=new He(O(I.line,0),Se(e.doc,O(I.line+1,0))),e.setSelection(C.anchor,C.head),e.focus(),At(m)}s()}),Ie(t.scroller,"touchcancel",s),Ie(t.scroller,"scroll",function(){t.scroller.clientHeight&&(co(e,t.scroller.scrollTop),Hn(e,t.scroller.scrollLeft,!0),Ke(e,"scroll",e))}),Ie(t.scroller,"mousewheel",function(m){return kf(e,m)}),Ie(t.scroller,"DOMMouseScroll",function(m){return kf(e,m)}),Ie(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(m){$e(e,m)||Wr(m)},over:function(m){$e(e,m)||(O0(e,m),Wr(m))},start:function(m){return G0(e,m)},drop:St(e,M0),leave:function(m){$e(e,m)||uc(e)}};var h=t.input.getField();Ie(h,"keyup",function(m){return xc.call(e,m)}),Ie(h,"keydown",St(e,yc)),Ie(h,"keypress",St(e,Tc)),Ie(h,"focus",function(m){return ol(e,m)}),Ie(h,"blur",function(m){return gi(e,m)})}var Al=[];ot.defineInitHook=function(e){return Al.push(e)};function wo(e,t,o,i){var s=e.doc,u;o==null&&(o="add"),o=="smart"&&(s.mode.indent?u=no(e,t).state:o="prev");var d=e.options.tabSize,h=he(s,t),m=ye(h.text,null,d);h.stateAfter&&(h.stateAfter=null);var b=h.text.match(/^\s*/)[0],I;if(!i&&!/\S/.test(h.text))I=0,o="not";else if(o=="smart"&&(I=s.mode.indent(u,h.text.slice(b.length),h.text),I==Je||I>150)){if(!i)return;o="prev"}o=="prev"?t>s.first?I=ye(he(s,t-1).text,null,d):I=0:o=="add"?I=m+e.options.indentUnit:o=="subtract"?I=m-e.options.indentUnit:typeof o=="number"&&(I=m+o),I=Math.max(0,I);var C="",B=0;if(e.options.indentWithTabs)for(var L=Math.floor(I/d);L;--L)B+=d,C+=" ";if(B<I&&(C+=Ve(I-B)),C!=b)return Ti(s,C,O(t,0),O(t,b.length),"+input"),h.stateAfter=null,!0;for(var W=0;W<s.sel.ranges.length;W++){var H=s.sel.ranges[W];if(H.head.line==t&&H.head.ch<b.length){var z=O(t,b.length);vl(s,W,new He(z,z));break}}}var Ur=null;function Fa(e){Ur=e}function Rl(e,t,o,i,s){var u=e.doc;e.display.shift=!1,i||(i=u.sel);var d=+new Date-200,h=s=="paste"||e.state.pasteIncoming>d,m=jt(t),b=null;if(h&&i.ranges.length>1)if(Ur&&Ur.text.join(`
28
+ `)==t){if(i.ranges.length%Ur.text.length==0){b=[];for(var I=0;I<Ur.text.length;I++)b.push(u.splitLines(Ur.text[I]))}}else m.length==i.ranges.length&&e.options.pasteLinesPerSelection&&(b=It(m,function(ne){return[ne]}));for(var C=e.curOp.updateInput,B=i.ranges.length-1;B>=0;B--){var L=i.ranges[B],W=L.from(),H=L.to();L.empty()&&(o&&o>0?W=O(W.line,W.ch-o):e.state.overwrite&&!h?H=O(H.line,Math.min(he(u,H.line).text.length,H.ch+Te(m).length)):h&&Ur&&Ur.lineWise&&Ur.text.join(`
29
29
  `)==m.join(`
30
- `)&&(W=H=O(W.line,0)));var z={from:W,to:H,text:b?b[B%b.length]:m,origin:s||(h?"paste":e.state.cutIncoming>d?"cut":"+input")};xi(e.doc,z),Nt(e,"inputRead",e,z)}t&&!h&&Sc(e,t),mi(e),e.curOp.updateInput<2&&(e.curOp.updateInput=C),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Nc(e,t){var o=e.clipboardData&&e.clipboardData.getData("Text");if(o)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&t.hasFocus()&&cr(t,function(){return _l(t,o,0,null,"paste")}),!0}function Sc(e,t){if(!(!e.options.electricChars||!e.options.smartIndent))for(var o=e.doc.sel,i=o.ranges.length-1;i>=0;i--){var s=o.ranges[i];if(!(s.head.ch>100||i&&o.ranges[i-1].head.line==s.head.line)){var u=e.getModeAt(s.head),d=!1;if(u.electricChars){for(var h=0;h<u.electricChars.length;h++)if(t.indexOf(u.electricChars.charAt(h))>-1){d=wo(e,s.head.line,"smart");break}}else u.electricInput&&u.electricInput.test(de(e.doc,s.head.line).text.slice(0,s.head.ch))&&(d=wo(e,s.head.line,"smart"));d&&Nt(e,"electricInput",e,s.head.line)}}}function wc(e){for(var t=[],o=[],i=0;i<e.doc.sel.ranges.length;i++){var s=e.doc.sel.ranges[i].head.line,u={anchor:O(s,0),head:O(s+1,0)};o.push(u),t.push(e.getRange(u.anchor,u.head))}return{text:t,ranges:o}}function Rl(e,t,o,i){e.setAttribute("autocorrect",o?"on":"off"),e.setAttribute("autocapitalize",i?"on":"off"),e.setAttribute("spellcheck",!!t)}function Lc(){var e=x("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; min-height: 1em; outline: none"),t=x("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return T?e.style.width="1000px":e.setAttribute("wrap","off"),R&&(e.style.border="1px solid black"),t}function ub(e){var t=e.optionHandlers,o=e.helpers={};e.prototype={constructor:e,focus:function(){ve(this).focus(),this.display.input.focus()},setOption:function(i,s){var u=this.options,d=u[i];u[i]==s&&i!="mode"||(u[i]=s,t.hasOwnProperty(i)&&St(this,t[i])(this,s,d),Ke(this,"optionChange",this,i))},getOption:function(i){return this.options[i]},getDoc:function(){return this.doc},addKeyMap:function(i,s){this.state.keyMaps[s?"push":"unshift"](Sa(i))},removeKeyMap:function(i){for(var s=this.state.keyMaps,u=0;u<s.length;++u)if(s[u]==i||s[u].name==i)return s.splice(u,1),!0},addOverlay:Jt(function(i,s){var u=i.token?i:e.getMode(this.options,i);if(u.startState)throw new Error("Overlays may not be stateful.");Et(this.state.overlays,{mode:u,modeSpec:i,opaque:s&&s.opaque,priority:s&&s.priority||0},function(d){return d.priority}),this.state.modeGen++,qt(this)}),removeOverlay:Jt(function(i){for(var s=this.state.overlays,u=0;u<s.length;++u){var d=s[u].modeSpec;if(d==i||typeof i=="string"&&d.name==i){s.splice(u,1),this.state.modeGen++,qt(this);return}}}),indentLine:Jt(function(i,s,u){typeof s!="string"&&typeof s!="number"&&(s==null?s=this.options.smartIndent?"smart":"prev":s=s?"add":"subtract"),V(this.doc,i)&&wo(this,i,s,u)}),indentSelection:Jt(function(i){for(var s=this.doc.sel.ranges,u=-1,d=0;d<s.length;d++){var h=s[d];if(h.empty())h.head.line>u&&(wo(this,h.head.line,i,!0),u=h.head.line,d==this.doc.sel.primIndex&&mi(this));else{var m=h.from(),b=h.to(),I=Math.max(u,m.line);u=Math.min(this.lastLine(),b.line-(b.ch?0:1))+1;for(var C=I;C<u;++C)wo(this,C,i);var B=this.doc.sel.ranges;m.ch==0&&s.length==B.length&&B[d].from().ch>0&&vl(this.doc,d,new He(m,B[d].to()),Me)}}}),getTokenAt:function(i,s){return Du(this,i,s)},getLineTokens:function(i,s){return Du(this,O(i),s,!0)},getTokenTypeAt:function(i){i=Se(this.doc,i);var s=Gu(this,de(this.doc,i.line)),u=0,d=(s.length-1)/2,h=i.ch,m;if(h==0)m=s[2];else for(;;){var b=u+d>>1;if((b?s[b*2-1]:0)>=h)d=b;else if(s[b*2+1]<h)u=b+1;else{m=s[b*2+2];break}}var I=m?m.indexOf("overlay "):-1;return I<0?m:I==0?null:m.slice(0,I-1)},getModeAt:function(i){var s=this.doc.mode;return s.innerMode?e.innerMode(s,this.getTokenAt(i).state).mode:s},getHelper:function(i,s){return this.getHelpers(i,s)[0]},getHelpers:function(i,s){var u=[];if(!o.hasOwnProperty(s))return u;var d=o[s],h=this.getModeAt(i);if(typeof h[s]=="string")d[h[s]]&&u.push(d[h[s]]);else if(h[s])for(var m=0;m<h[s].length;m++){var b=d[h[s][m]];b&&u.push(b)}else h.helperType&&d[h.helperType]?u.push(d[h.helperType]):d[h.name]&&u.push(d[h.name]);for(var I=0;I<d._global.length;I++){var C=d._global[I];C.pred(h,this)&&ue(u,C.val)==-1&&u.push(C.val)}return u},getStateAfter:function(i,s){var u=this.doc;return i=Uu(u,i??u.first+u.size-1),no(this,i+1,s).state},cursorCoords:function(i,s){var u,d=this.doc.sel.primary();return i==null?u=d.head:typeof i=="object"?u=Se(this.doc,i):u=i?d.from():d.to(),Fr(this,u,s||"page")},charCoords:function(i,s){return pa(this,Se(this.doc,i),s||"page")},coordsChar:function(i,s){return i=mf(this,i,s||"page"),qs(this,i.left,i.top)},lineAtHeight:function(i,s){return i=mf(this,{top:i,left:0},s||"page").top,E(this.doc,i+this.display.viewOffset)},heightAtLine:function(i,s,u){var d=!1,h;if(typeof i=="number"){var m=this.doc.first+this.doc.size-1;i<this.doc.first?i=this.doc.first:i>m&&(i=m,d=!0),h=de(this.doc,i)}else h=i;return ha(this,h,{top:0,left:0},s||"page",u||d).top+(d?this.doc.height-nn(h):0)},defaultTextHeight:function(){return hi(this.display)},defaultCharWidth:function(){return pi(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(i,s,u,d,h){var m=this.display;i=Fr(this,Se(this.doc,i));var b=i.bottom,I=i.left;if(s.style.position="absolute",s.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(s),m.sizer.appendChild(s),d=="over")b=i.top;else if(d=="above"||d=="near"){var C=Math.max(m.wrapper.clientHeight,this.doc.height),B=Math.max(m.sizer.clientWidth,m.lineSpace.clientWidth);(d=="above"||i.bottom+s.offsetHeight>C)&&i.top>s.offsetHeight?b=i.top-s.offsetHeight:i.bottom+s.offsetHeight<=C&&(b=i.bottom),I+s.offsetWidth>B&&(I=B-s.offsetWidth)}s.style.top=b+"px",s.style.left=s.style.right="",h=="right"?(I=m.sizer.clientWidth-s.offsetWidth,s.style.right="0px"):(h=="left"?I=0:h=="middle"&&(I=(m.sizer.clientWidth-s.offsetWidth)/2),s.style.left=I+"px"),u&&a0(this,{left:I,top:b,right:I+s.offsetWidth,bottom:b+s.offsetHeight})},triggerOnKeyDown:Jt(yc),triggerOnKeyPress:Jt(Tc),triggerOnKeyUp:xc,triggerOnMouseDown:Jt(Ic),execCommand:function(i){if(_o.hasOwnProperty(i))return _o[i].call(null,this)},triggerElectric:Jt(function(i){Sc(this,i)}),findPosH:function(i,s,u,d){var h=1;s<0&&(h=-1,s=-s);for(var m=Se(this.doc,i),b=0;b<s&&(m=Nl(this.doc,m,h,u,d),!m.hitSide);++b);return m},moveH:Jt(function(i,s){var u=this;this.extendSelectionsBy(function(d){return u.display.shift||u.doc.extend||d.empty()?Nl(u.doc,d.head,i,s,u.options.rtlMoveVisually):i<0?d.from():d.to()},_e)}),deleteH:Jt(function(i,s){var u=this.doc.sel,d=this.doc;u.somethingSelected()?d.replaceSelection("",null,"+delete"):Ci(this,function(h){var m=Nl(d,h.head,i,s,!1);return i<0?{from:m,to:h.head}:{from:h.head,to:m}})}),findPosV:function(i,s,u,d){var h=1,m=d;s<0&&(h=-1,s=-s);for(var b=Se(this.doc,i),I=0;I<s;++I){var C=Fr(this,b,"div");if(m==null?m=C.left:C.left=m,b=Fc(this,C,h,u),b.hitSide)break}return b},moveV:Jt(function(i,s){var u=this,d=this.doc,h=[],m=!this.display.shift&&!d.extend&&d.sel.somethingSelected();if(d.extendSelectionsBy(function(I){if(m)return i<0?I.from():I.to();var C=Fr(u,I.head,"div");I.goalColumn!=null&&(C.left=I.goalColumn),h.push(C.left);var B=Fc(u,C,i,s);return s=="page"&&I==d.sel.primary()&&sl(u,pa(u,B,"div").top-C.top),B},_e),h.length)for(var b=0;b<d.sel.ranges.length;b++)d.sel.ranges[b].goalColumn=h[b]}),findWordAt:function(i){var s=this.doc,u=de(s,i.line).text,d=i.ch,h=i.ch;if(u){var m=this.getHelper(i,"wordChars");(i.sticky=="before"||h==u.length)&&d?--d:++h;for(var b=u.charAt(d),I=Xe(b,m)?function(C){return Xe(C,m)}:/\s/.test(b)?function(C){return/\s/.test(C)}:function(C){return!/\s/.test(C)&&!Xe(C)};d>0&&I(u.charAt(d-1));)--d;for(;h<u.length&&I(u.charAt(h));)++h}return new He(O(i.line,d),O(i.line,h))},toggleOverwrite:function(i){i!=null&&i==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?Oe(this.display.cursorDiv,"CodeMirror-overwrite"):pe(this.display.cursorDiv,"CodeMirror-overwrite"),Ke(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==ge(Ze(this))},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:Jt(function(i,s){fo(this,i,s)}),getScrollInfo:function(){var i=this.display.scroller;return{left:i.scrollLeft,top:i.scrollTop,height:i.scrollHeight-Vr(this)-this.display.barHeight,width:i.scrollWidth-Vr(this)-this.display.barWidth,clientHeight:Xs(this),clientWidth:Zn(this)}},scrollIntoView:Jt(function(i,s){i==null?(i={from:this.doc.sel.primary().head,to:null},s==null&&(s=this.options.cursorScrollMargin)):typeof i=="number"?i={from:O(i,0),to:null}:i.from==null&&(i={from:i,to:null}),i.to||(i.to=i.from),i.margin=s||0,i.from.line!=null?s0(this,i):Af(this,i.from,i.to,i.margin)}),setSize:Jt(function(i,s){var u=this,d=function(m){return typeof m=="number"||/^\d+$/.test(String(m))?m+"px":m};i!=null&&(this.display.wrapper.style.width=d(i)),s!=null&&(this.display.wrapper.style.height=d(s)),this.options.lineWrapping&&hf(this);var h=this.display.viewFrom;this.doc.iter(h,this.display.viewTo,function(m){if(m.widgets){for(var b=0;b<m.widgets.length;b++)if(m.widgets[b].noHScroll){En(u,h,"widget");break}}++h}),this.curOp.forceUpdate=!0,Ke(this,"refresh",this)}),operation:function(i){return cr(this,i)},startOperation:function(){return Xn(this)},endOperation:function(){return Yn(this)},refresh:Jt(function(){var i=this.display.cachedTextHeight;qt(this),this.curOp.forceUpdate=!0,lo(this),fo(this,this.doc.scrollLeft,this.doc.scrollTop),fl(this.display),(i==null||Math.abs(i-hi(this.display))>.5||this.options.lineWrapping)&&tl(this),Ke(this,"refresh",this)}),swapDoc:Jt(function(i){var s=this.doc;return s.cm=null,this.state.selectingText&&this.state.selectingText(),Wf(this,i),lo(this),this.display.input.reset(),fo(this,i.scrollLeft,i.scrollTop),this.curOp.forceScroll=!0,Nt(this,"swapDoc",this,s),s}),phrase:function(i){var s=this.options.phrases;return s&&Object.prototype.hasOwnProperty.call(s,i)?s[i]:i},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},xr(e),e.registerHelper=function(i,s,u){o.hasOwnProperty(i)||(o[i]=e[i]={_global:[]}),o[i][s]=u},e.registerGlobalHelper=function(i,s,u,d){e.registerHelper(i,s,d),o[i]._global.push({pred:u,val:d})}}function Nl(e,t,o,i,s){var u=t,d=o,h=de(e,t.line),m=s&&e.direction=="rtl"?-o:o;function b(){var he=t.line+m;return he<e.first||he>=e.first+e.size?!1:(t=new O(he,t.ch,t.sticky),h=de(e,he))}function I(he){var ie;if(i=="codepoint"){var me=h.text.charCodeAt(t.ch+(o>0?0:-1));if(isNaN(me))ie=null;else{var Ae=o>0?me>=55296&&me<56320:me>=56320&&me<57343;ie=new O(t.line,Math.max(0,Math.min(h.text.length,t.ch+o*(Ae?2:1))),-o)}}else s?ie=P0(e.cm,h,t,o):ie=xl(h,t,o);if(ie==null)if(!he&&b())t=Tl(s,e.cm,h,t.line,m);else return!1;else t=ie;return!0}if(i=="char"||i=="codepoint")I();else if(i=="column")I(!0);else if(i=="word"||i=="group")for(var C=null,B=i=="group",L=e.cm&&e.cm.getHelper(t,"wordChars"),W=!0;!(o<0&&!I(!W));W=!1){var H=h.text.charAt(t.ch)||`
30
+ `)&&(W=H=O(W.line,0)));var z={from:W,to:H,text:b?b[B%b.length]:m,origin:s||(h?"paste":e.state.cutIncoming>d?"cut":"+input")};xi(e.doc,z),Nt(e,"inputRead",e,z)}t&&!h&&Sc(e,t),mi(e),e.curOp.updateInput<2&&(e.curOp.updateInput=C),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Nc(e,t){var o=e.clipboardData&&e.clipboardData.getData("Text");if(o)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&t.hasFocus()&&cr(t,function(){return Rl(t,o,0,null,"paste")}),!0}function Sc(e,t){if(!(!e.options.electricChars||!e.options.smartIndent))for(var o=e.doc.sel,i=o.ranges.length-1;i>=0;i--){var s=o.ranges[i];if(!(s.head.ch>100||i&&o.ranges[i-1].head.line==s.head.line)){var u=e.getModeAt(s.head),d=!1;if(u.electricChars){for(var h=0;h<u.electricChars.length;h++)if(t.indexOf(u.electricChars.charAt(h))>-1){d=wo(e,s.head.line,"smart");break}}else u.electricInput&&u.electricInput.test(he(e.doc,s.head.line).text.slice(0,s.head.ch))&&(d=wo(e,s.head.line,"smart"));d&&Nt(e,"electricInput",e,s.head.line)}}}function wc(e){for(var t=[],o=[],i=0;i<e.doc.sel.ranges.length;i++){var s=e.doc.sel.ranges[i].head.line,u={anchor:O(s,0),head:O(s+1,0)};o.push(u),t.push(e.getRange(u.anchor,u.head))}return{text:t,ranges:o}}function _l(e,t,o,i){e.setAttribute("autocorrect",o?"on":"off"),e.setAttribute("autocapitalize",i?"on":"off"),e.setAttribute("spellcheck",!!t)}function Lc(){var e=x("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; min-height: 1em; outline: none"),t=x("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return T?e.style.width="1000px":e.setAttribute("wrap","off"),_&&(e.style.border="1px solid black"),t}function ub(e){var t=e.optionHandlers,o=e.helpers={};e.prototype={constructor:e,focus:function(){ve(this).focus(),this.display.input.focus()},setOption:function(i,s){var u=this.options,d=u[i];u[i]==s&&i!="mode"||(u[i]=s,t.hasOwnProperty(i)&&St(this,t[i])(this,s,d),Ke(this,"optionChange",this,i))},getOption:function(i){return this.options[i]},getDoc:function(){return this.doc},addKeyMap:function(i,s){this.state.keyMaps[s?"push":"unshift"](Sa(i))},removeKeyMap:function(i){for(var s=this.state.keyMaps,u=0;u<s.length;++u)if(s[u]==i||s[u].name==i)return s.splice(u,1),!0},addOverlay:Jt(function(i,s){var u=i.token?i:e.getMode(this.options,i);if(u.startState)throw new Error("Overlays may not be stateful.");Et(this.state.overlays,{mode:u,modeSpec:i,opaque:s&&s.opaque,priority:s&&s.priority||0},function(d){return d.priority}),this.state.modeGen++,qt(this)}),removeOverlay:Jt(function(i){for(var s=this.state.overlays,u=0;u<s.length;++u){var d=s[u].modeSpec;if(d==i||typeof i=="string"&&d.name==i){s.splice(u,1),this.state.modeGen++,qt(this);return}}}),indentLine:Jt(function(i,s,u){typeof s!="string"&&typeof s!="number"&&(s==null?s=this.options.smartIndent?"smart":"prev":s=s?"add":"subtract"),V(this.doc,i)&&wo(this,i,s,u)}),indentSelection:Jt(function(i){for(var s=this.doc.sel.ranges,u=-1,d=0;d<s.length;d++){var h=s[d];if(h.empty())h.head.line>u&&(wo(this,h.head.line,i,!0),u=h.head.line,d==this.doc.sel.primIndex&&mi(this));else{var m=h.from(),b=h.to(),I=Math.max(u,m.line);u=Math.min(this.lastLine(),b.line-(b.ch?0:1))+1;for(var C=I;C<u;++C)wo(this,C,i);var B=this.doc.sel.ranges;m.ch==0&&s.length==B.length&&B[d].from().ch>0&&vl(this.doc,d,new He(m,B[d].to()),Me)}}}),getTokenAt:function(i,s){return Du(this,i,s)},getLineTokens:function(i,s){return Du(this,O(i),s,!0)},getTokenTypeAt:function(i){i=Se(this.doc,i);var s=Gu(this,he(this.doc,i.line)),u=0,d=(s.length-1)/2,h=i.ch,m;if(h==0)m=s[2];else for(;;){var b=u+d>>1;if((b?s[b*2-1]:0)>=h)d=b;else if(s[b*2+1]<h)u=b+1;else{m=s[b*2+2];break}}var I=m?m.indexOf("overlay "):-1;return I<0?m:I==0?null:m.slice(0,I-1)},getModeAt:function(i){var s=this.doc.mode;return s.innerMode?e.innerMode(s,this.getTokenAt(i).state).mode:s},getHelper:function(i,s){return this.getHelpers(i,s)[0]},getHelpers:function(i,s){var u=[];if(!o.hasOwnProperty(s))return u;var d=o[s],h=this.getModeAt(i);if(typeof h[s]=="string")d[h[s]]&&u.push(d[h[s]]);else if(h[s])for(var m=0;m<h[s].length;m++){var b=d[h[s][m]];b&&u.push(b)}else h.helperType&&d[h.helperType]?u.push(d[h.helperType]):d[h.name]&&u.push(d[h.name]);for(var I=0;I<d._global.length;I++){var C=d._global[I];C.pred(h,this)&&ue(u,C.val)==-1&&u.push(C.val)}return u},getStateAfter:function(i,s){var u=this.doc;return i=Uu(u,i??u.first+u.size-1),no(this,i+1,s).state},cursorCoords:function(i,s){var u,d=this.doc.sel.primary();return i==null?u=d.head:typeof i=="object"?u=Se(this.doc,i):u=i?d.from():d.to(),Fr(this,u,s||"page")},charCoords:function(i,s){return pa(this,Se(this.doc,i),s||"page")},coordsChar:function(i,s){return i=mf(this,i,s||"page"),qs(this,i.left,i.top)},lineAtHeight:function(i,s){return i=mf(this,{top:i,left:0},s||"page").top,E(this.doc,i+this.display.viewOffset)},heightAtLine:function(i,s,u){var d=!1,h;if(typeof i=="number"){var m=this.doc.first+this.doc.size-1;i<this.doc.first?i=this.doc.first:i>m&&(i=m,d=!0),h=he(this.doc,i)}else h=i;return ha(this,h,{top:0,left:0},s||"page",u||d).top+(d?this.doc.height-nn(h):0)},defaultTextHeight:function(){return hi(this.display)},defaultCharWidth:function(){return pi(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(i,s,u,d,h){var m=this.display;i=Fr(this,Se(this.doc,i));var b=i.bottom,I=i.left;if(s.style.position="absolute",s.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(s),m.sizer.appendChild(s),d=="over")b=i.top;else if(d=="above"||d=="near"){var C=Math.max(m.wrapper.clientHeight,this.doc.height),B=Math.max(m.sizer.clientWidth,m.lineSpace.clientWidth);(d=="above"||i.bottom+s.offsetHeight>C)&&i.top>s.offsetHeight?b=i.top-s.offsetHeight:i.bottom+s.offsetHeight<=C&&(b=i.bottom),I+s.offsetWidth>B&&(I=B-s.offsetWidth)}s.style.top=b+"px",s.style.left=s.style.right="",h=="right"?(I=m.sizer.clientWidth-s.offsetWidth,s.style.right="0px"):(h=="left"?I=0:h=="middle"&&(I=(m.sizer.clientWidth-s.offsetWidth)/2),s.style.left=I+"px"),u&&a0(this,{left:I,top:b,right:I+s.offsetWidth,bottom:b+s.offsetHeight})},triggerOnKeyDown:Jt(yc),triggerOnKeyPress:Jt(Tc),triggerOnKeyUp:xc,triggerOnMouseDown:Jt(Ic),execCommand:function(i){if(Ro.hasOwnProperty(i))return Ro[i].call(null,this)},triggerElectric:Jt(function(i){Sc(this,i)}),findPosH:function(i,s,u,d){var h=1;s<0&&(h=-1,s=-s);for(var m=Se(this.doc,i),b=0;b<s&&(m=Nl(this.doc,m,h,u,d),!m.hitSide);++b);return m},moveH:Jt(function(i,s){var u=this;this.extendSelectionsBy(function(d){return u.display.shift||u.doc.extend||d.empty()?Nl(u.doc,d.head,i,s,u.options.rtlMoveVisually):i<0?d.from():d.to()},Re)}),deleteH:Jt(function(i,s){var u=this.doc.sel,d=this.doc;u.somethingSelected()?d.replaceSelection("",null,"+delete"):Ci(this,function(h){var m=Nl(d,h.head,i,s,!1);return i<0?{from:m,to:h.head}:{from:h.head,to:m}})}),findPosV:function(i,s,u,d){var h=1,m=d;s<0&&(h=-1,s=-s);for(var b=Se(this.doc,i),I=0;I<s;++I){var C=Fr(this,b,"div");if(m==null?m=C.left:C.left=m,b=Fc(this,C,h,u),b.hitSide)break}return b},moveV:Jt(function(i,s){var u=this,d=this.doc,h=[],m=!this.display.shift&&!d.extend&&d.sel.somethingSelected();if(d.extendSelectionsBy(function(I){if(m)return i<0?I.from():I.to();var C=Fr(u,I.head,"div");I.goalColumn!=null&&(C.left=I.goalColumn),h.push(C.left);var B=Fc(u,C,i,s);return s=="page"&&I==d.sel.primary()&&sl(u,pa(u,B,"div").top-C.top),B},Re),h.length)for(var b=0;b<d.sel.ranges.length;b++)d.sel.ranges[b].goalColumn=h[b]}),findWordAt:function(i){var s=this.doc,u=he(s,i.line).text,d=i.ch,h=i.ch;if(u){var m=this.getHelper(i,"wordChars");(i.sticky=="before"||h==u.length)&&d?--d:++h;for(var b=u.charAt(d),I=Xe(b,m)?function(C){return Xe(C,m)}:/\s/.test(b)?function(C){return/\s/.test(C)}:function(C){return!/\s/.test(C)&&!Xe(C)};d>0&&I(u.charAt(d-1));)--d;for(;h<u.length&&I(u.charAt(h));)++h}return new He(O(i.line,d),O(i.line,h))},toggleOverwrite:function(i){i!=null&&i==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?Oe(this.display.cursorDiv,"CodeMirror-overwrite"):fe(this.display.cursorDiv,"CodeMirror-overwrite"),Ke(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==ge(Ze(this))},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:Jt(function(i,s){fo(this,i,s)}),getScrollInfo:function(){var i=this.display.scroller;return{left:i.scrollLeft,top:i.scrollTop,height:i.scrollHeight-Vr(this)-this.display.barHeight,width:i.scrollWidth-Vr(this)-this.display.barWidth,clientHeight:Xs(this),clientWidth:Zn(this)}},scrollIntoView:Jt(function(i,s){i==null?(i={from:this.doc.sel.primary().head,to:null},s==null&&(s=this.options.cursorScrollMargin)):typeof i=="number"?i={from:O(i,0),to:null}:i.from==null&&(i={from:i,to:null}),i.to||(i.to=i.from),i.margin=s||0,i.from.line!=null?s0(this,i):Af(this,i.from,i.to,i.margin)}),setSize:Jt(function(i,s){var u=this,d=function(m){return typeof m=="number"||/^\d+$/.test(String(m))?m+"px":m};i!=null&&(this.display.wrapper.style.width=d(i)),s!=null&&(this.display.wrapper.style.height=d(s)),this.options.lineWrapping&&hf(this);var h=this.display.viewFrom;this.doc.iter(h,this.display.viewTo,function(m){if(m.widgets){for(var b=0;b<m.widgets.length;b++)if(m.widgets[b].noHScroll){En(u,h,"widget");break}}++h}),this.curOp.forceUpdate=!0,Ke(this,"refresh",this)}),operation:function(i){return cr(this,i)},startOperation:function(){return Xn(this)},endOperation:function(){return Yn(this)},refresh:Jt(function(){var i=this.display.cachedTextHeight;qt(this),this.curOp.forceUpdate=!0,lo(this),fo(this,this.doc.scrollLeft,this.doc.scrollTop),fl(this.display),(i==null||Math.abs(i-hi(this.display))>.5||this.options.lineWrapping)&&tl(this),Ke(this,"refresh",this)}),swapDoc:Jt(function(i){var s=this.doc;return s.cm=null,this.state.selectingText&&this.state.selectingText(),Wf(this,i),lo(this),this.display.input.reset(),fo(this,i.scrollLeft,i.scrollTop),this.curOp.forceScroll=!0,Nt(this,"swapDoc",this,s),s}),phrase:function(i){var s=this.options.phrases;return s&&Object.prototype.hasOwnProperty.call(s,i)?s[i]:i},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},xr(e),e.registerHelper=function(i,s,u){o.hasOwnProperty(i)||(o[i]=e[i]={_global:[]}),o[i][s]=u},e.registerGlobalHelper=function(i,s,u,d){e.registerHelper(i,s,d),o[i]._global.push({pred:u,val:d})}}function Nl(e,t,o,i,s){var u=t,d=o,h=he(e,t.line),m=s&&e.direction=="rtl"?-o:o;function b(){var pe=t.line+m;return pe<e.first||pe>=e.first+e.size?!1:(t=new O(pe,t.ch,t.sticky),h=he(e,pe))}function I(pe){var ie;if(i=="codepoint"){var me=h.text.charCodeAt(t.ch+(o>0?0:-1));if(isNaN(me))ie=null;else{var Ae=o>0?me>=55296&&me<56320:me>=56320&&me<57343;ie=new O(t.line,Math.max(0,Math.min(h.text.length,t.ch+o*(Ae?2:1))),-o)}}else s?ie=P0(e.cm,h,t,o):ie=xl(h,t,o);if(ie==null)if(!pe&&b())t=Tl(s,e.cm,h,t.line,m);else return!1;else t=ie;return!0}if(i=="char"||i=="codepoint")I();else if(i=="column")I(!0);else if(i=="word"||i=="group")for(var C=null,B=i=="group",L=e.cm&&e.cm.getHelper(t,"wordChars"),W=!0;!(o<0&&!I(!W));W=!1){var H=h.text.charAt(t.ch)||`
31
31
  `,z=Xe(H,L)?"w":B&&H==`
32
- `?"n":!B||/\s/.test(H)?null:"p";if(B&&!W&&!z&&(z="s"),C&&C!=z){o<0&&(o=1,I(),t.sticky="after");break}if(z&&(C=z),o>0&&!I(!W))break}var ne=_a(e,t,u,d,!0);return Pe(u,ne)&&(ne.hitSide=!0),ne}function Fc(e,t,o,i){var s=e.doc,u=t.left,d;if(i=="page"){var h=Math.min(e.display.wrapper.clientHeight,ve(e).innerHeight||s(e).documentElement.clientHeight),m=Math.max(h-.5*hi(e.display),3);d=(o>0?t.bottom:t.top)+o*m}else i=="line"&&(d=o>0?t.bottom+3:t.top-3);for(var b;b=qs(e,u,d),!!b.outside;){if(o<0?d<=0:d>=s.height){b.hitSide=!0;break}d+=o*5}return b}var je=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Ge,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};je.prototype.init=function(e){var t=this,o=this,i=o.cm,s=o.div=e.lineDiv;s.contentEditable=!0,Rl(s,i.options.spellcheck,i.options.autocorrect,i.options.autocapitalize);function u(h){for(var m=h.target;m;m=m.parentNode){if(m==s)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(m.className))break}return!1}Ie(s,"paste",function(h){!u(h)||$e(i,h)||Nc(h,i)||y<=11&&setTimeout(St(i,function(){return t.updateFromDOM()}),20)}),Ie(s,"compositionstart",function(h){t.composing={data:h.data,done:!1}}),Ie(s,"compositionupdate",function(h){t.composing||(t.composing={data:h.data,done:!1})}),Ie(s,"compositionend",function(h){t.composing&&(h.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),Ie(s,"touchstart",function(){return o.forceCompositionEnd()}),Ie(s,"input",function(){t.composing||t.readFromDOMSoon()});function d(h){if(!(!u(h)||$e(i,h))){if(i.somethingSelected())Fa({lineWise:!1,text:i.getSelections()}),h.type=="cut"&&i.replaceSelection("",null,"cut");else if(i.options.lineWiseCopyCut){var m=wc(i);Fa({lineWise:!0,text:m.text}),h.type=="cut"&&i.operation(function(){i.setSelections(m.ranges,0,Me),i.replaceSelection("",null,"cut")})}else return;if(h.clipboardData){h.clipboardData.clearData();var b=Ur.text.join(`
33
- `);if(h.clipboardData.setData("Text",b),h.clipboardData.getData("Text")==b){h.preventDefault();return}}var I=Lc(),C=I.firstChild;Rl(C),i.display.lineSpace.insertBefore(I,i.display.lineSpace.firstChild),C.value=Ur.text.join(`
34
- `);var B=ge(Ce(s));we(C),setTimeout(function(){i.display.lineSpace.removeChild(I),B.focus(),B==s&&o.showPrimarySelection()},50)}}Ie(s,"copy",d),Ie(s,"cut",d)},je.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},je.prototype.prepareSelection=function(){var e=If(this.cm,!1);return e.focus=ge(Ce(this.div))==this.div,e},je.prototype.showSelection=function(e,t){!e||!this.cm.display.view.length||((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},je.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},je.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,o=t.doc.sel.primary(),i=o.from(),s=o.to();if(t.display.viewTo==t.display.viewFrom||i.line>=t.display.viewTo||s.line<t.display.viewFrom){e.removeAllRanges();return}var u=Ba(t,e.anchorNode,e.anchorOffset),d=Ba(t,e.focusNode,e.focusOffset);if(!(u&&!u.bad&&d&&!d.bad&&fe(ui(u,d),i)==0&&fe(zt(u,d),s)==0)){var h=t.display.view,m=i.line>=t.display.viewFrom&&Bc(t,i)||{node:h[0].measure.map[2],offset:0},b=s.line<t.display.viewTo&&Bc(t,s);if(!b){var I=h[h.length-1].measure,C=I.maps?I.maps[I.maps.length-1]:I.map;b={node:C[C.length-1],offset:C[C.length-2]-C[C.length-3]}}if(!m||!b){e.removeAllRanges();return}var B=e.rangeCount&&e.getRangeAt(0),L;try{L=D(m.node,m.offset,b.offset,b.node)}catch{}L&&(!a&&t.state.focused?(e.collapse(m.node,m.offset),L.collapsed||(e.removeAllRanges(),e.addRange(L))):(e.removeAllRanges(),e.addRange(L)),B&&e.anchorNode==null?e.addRange(B):a&&this.startGracePeriod()),this.rememberSelection()}},je.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){return e.cm.curOp.selectionChanged=!0})},20)},je.prototype.showMultipleSelections=function(e){oe(this.cm.display.cursorDiv,e.cursors),oe(this.cm.display.selectionDiv,e.selection)},je.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},je.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return ce(this.div,t)},je.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||ge(Ce(this.div))!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},je.prototype.blur=function(){this.div.blur()},je.prototype.getField=function(){return this.div},je.prototype.supportsTouch=function(){return!0},je.prototype.receivedFocus=function(){var e=this,t=this;this.selectionInEditor()?setTimeout(function(){return e.pollSelection()},20):cr(this.cm,function(){return t.cm.curOp.selectionChanged=!0});function o(){t.cm.state.focused&&(t.pollSelection(),t.polling.set(t.cm.options.pollInterval,o))}this.polling.set(this.cm.options.pollInterval,o)},je.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},je.prototype.pollSelection=function(){if(!(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())){var e=this.getSelection(),t=this.cm;if(G&&A&&this.cm.display.gutterSpecs.length&&fb(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(!this.composing){this.rememberSelection();var o=Ba(t,e.anchorNode,e.anchorOffset),i=Ba(t,e.focusNode,e.focusOffset);o&&i&&cr(t,function(){Zt(t.doc,An(o,i),Me),(o.bad||i.bad)&&(t.curOp.selectionChanged=!0)})}}},je.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,o=e.doc.sel.primary(),i=o.from(),s=o.to();if(i.ch==0&&i.line>e.firstLine()&&(i=O(i.line-1,de(e.doc,i.line-1).length)),s.ch==de(e.doc,s.line).text.length&&s.line<e.lastLine()&&(s=O(s.line+1,0)),i.line<t.viewFrom||s.line>t.viewTo-1)return!1;var u,d,h;i.line==t.viewFrom||(u=Pn(e,i.line))==0?(d=v(t.view[0].line),h=t.view[0].node):(d=v(t.view[u].line),h=t.view[u-1].node.nextSibling);var m=Pn(e,s.line),b,I;if(m==t.view.length-1?(b=t.viewTo-1,I=t.lineDiv.lastChild):(b=v(t.view[m+1].line)-1,I=t.view[m+1].node.previousSibling),!h)return!1;for(var C=e.doc.splitLines(cb(e,h,I,d,b)),B=_t(e.doc,O(d,0),O(b,de(e.doc,b).text.length));C.length>1&&B.length>1;)if(Te(C)==Te(B))C.pop(),B.pop(),b--;else if(C[0]==B[0])C.shift(),B.shift(),d++;else break;for(var L=0,W=0,H=C[0],z=B[0],ne=Math.min(H.length,z.length);L<ne&&H.charCodeAt(L)==z.charCodeAt(L);)++L;for(var he=Te(C),ie=Te(B),me=Math.min(he.length-(C.length==1?L:0),ie.length-(B.length==1?L:0));W<me&&he.charCodeAt(he.length-W-1)==ie.charCodeAt(ie.length-W-1);)++W;if(C.length==1&&B.length==1&&d==i.line)for(;L&&L>i.ch&&he.charCodeAt(he.length-W-1)==ie.charCodeAt(ie.length-W-1);)L--,W++;C[C.length-1]=he.slice(0,he.length-W).replace(/^\u200b+/,""),C[0]=C[0].slice(L).replace(/\u200b+$/,"");var Ae=O(d,L),Ee=O(b,B.length?Te(B).length-W:0);if(C.length>1||C[0]||fe(Ae,Ee))return Ti(e.doc,C,Ae,Ee,"+input"),!0},je.prototype.ensurePolled=function(){this.forceCompositionEnd()},je.prototype.reset=function(){this.forceCompositionEnd()},je.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},je.prototype.readFromDOMSoon=function(){var e=this;this.readDOMTimeout==null&&(this.readDOMTimeout=setTimeout(function(){if(e.readDOMTimeout=null,e.composing)if(e.composing.done)e.composing=null;else return;e.updateFromDOM()},80))},je.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&cr(this.cm,function(){return qt(e.cm)})},je.prototype.setUneditable=function(e){e.contentEditable="false"},je.prototype.onKeyPress=function(e){e.charCode==0||this.composing||(e.preventDefault(),this.cm.isReadOnly()||St(this.cm,_l)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0))},je.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},je.prototype.onContextMenu=function(){},je.prototype.resetPosition=function(){},je.prototype.needsContentAttribute=!0;function Bc(e,t){var o=Ys(e,t.line);if(!o||o.hidden)return null;var i=de(e.doc,t.line),s=lf(o,i,t.line),u=Ne(i,e.doc.direction),d="left";if(u){var h=vr(u,t.ch);d=h%2?"right":"left"}var m=cf(s.map,t.ch,d);return m.offset=m.collapse=="right"?m.end:m.start,m}function fb(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function _i(e,t){return t&&(e.bad=!0),e}function cb(e,t,o,i,s){var u="",d=!1,h=e.doc.lineSeparator(),m=!1;function b(L){return function(W){return W.id==L}}function I(){d&&(u+=h,m&&(u+=h),d=m=!1)}function C(L){L&&(I(),u+=L)}function B(L){if(L.nodeType==1){var W=L.getAttribute("cm-text");if(W){C(W);return}var H=L.getAttribute("cm-marker"),z;if(H){var ne=e.findMarks(O(i,0),O(s+1,0),b(+H));ne.length&&(z=ne[0].find(0))&&C(_t(e.doc,z.from,z.to).join(h));return}if(L.getAttribute("contenteditable")=="false")return;var he=/^(pre|div|p|li|table|br)$/i.test(L.nodeName);if(!/^br$/i.test(L.nodeName)&&L.textContent.length==0)return;he&&I();for(var ie=0;ie<L.childNodes.length;ie++)B(L.childNodes[ie]);/^(pre|p)$/i.test(L.nodeName)&&(m=!0),he&&(d=!0)}else L.nodeType==3&&C(L.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;B(t),t!=o;)t=t.nextSibling,m=!1;return u}function Ba(e,t,o){var i;if(t==e.display.lineDiv){if(i=e.display.lineDiv.childNodes[o],!i)return _i(e.clipPos(O(e.display.viewTo-1)),!0);t=null,o=0}else for(i=t;;i=i.parentNode){if(!i||i==e.display.lineDiv)return null;if(i.parentNode&&i.parentNode==e.display.lineDiv)break}for(var s=0;s<e.display.view.length;s++){var u=e.display.view[s];if(u.node==i)return db(u,t,o)}}function db(e,t,o){var i=e.text.firstChild,s=!1;if(!t||!ce(i,t))return _i(O(v(e.line),0),!0);if(t==i&&(s=!0,t=i.childNodes[o],o=0,!t)){var u=e.rest?Te(e.rest):e.line;return _i(O(v(u),u.text.length),s)}var d=t.nodeType==3?t:null,h=t;for(!d&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(d=t.firstChild,o&&(o=d.nodeValue.length));h.parentNode!=i;)h=h.parentNode;var m=e.measure,b=m.maps;function I(z,ne,he){for(var ie=-1;ie<(b?b.length:0);ie++)for(var me=ie<0?m.map:b[ie],Ae=0;Ae<me.length;Ae+=3){var Ee=me[Ae+2];if(Ee==z||Ee==ne){var ke=v(ie<0?e.line:e.rest[ie]),et=me[Ae]+he;return(he<0||Ee!=z)&&(et=me[Ae+(he?1:0)]),O(ke,et)}}}var C=I(d,h,o);if(C)return _i(C,s);for(var B=h.nextSibling,L=d?d.nodeValue.length-o:0;B;B=B.nextSibling){if(C=I(B,B.firstChild,0),C)return _i(O(C.line,C.ch-L),s);L+=B.textContent.length}for(var W=h.previousSibling,H=o;W;W=W.previousSibling){if(C=I(W,W.firstChild,-1),C)return _i(O(C.line,C.ch+H),s);H+=W.textContent.length}}var gt=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new Ge,this.hasSelection=!1,this.composing=null,this.resetting=!1};gt.prototype.init=function(e){var t=this,o=this,i=this.cm;this.createField(e);var s=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),R&&(s.style.width="0px"),Ie(s,"input",function(){g&&y>=9&&t.hasSelection&&(t.hasSelection=null),o.poll()}),Ie(s,"paste",function(d){$e(i,d)||Nc(d,i)||(i.state.pasteIncoming=+new Date,o.fastPoll())});function u(d){if(!$e(i,d)){if(i.somethingSelected())Fa({lineWise:!1,text:i.getSelections()});else if(i.options.lineWiseCopyCut){var h=wc(i);Fa({lineWise:!0,text:h.text}),d.type=="cut"?i.setSelections(h.ranges,null,Me):(o.prevInput="",s.value=h.text.join(`
35
- `),we(s))}else return;d.type=="cut"&&(i.state.cutIncoming=+new Date)}}Ie(s,"cut",u),Ie(s,"copy",u),Ie(e.scroller,"paste",function(d){if(!(on(e,d)||$e(i,d))){if(!s.dispatchEvent){i.state.pasteIncoming=+new Date,o.focus();return}var h=new Event("paste");h.clipboardData=d.clipboardData,s.dispatchEvent(h)}}),Ie(e.lineSpace,"selectstart",function(d){on(e,d)||At(d)}),Ie(s,"compositionstart",function(){var d=i.getCursor("from");o.composing&&o.composing.range.clear(),o.composing={start:d,range:i.markText(d,i.getCursor("to"),{className:"CodeMirror-composing"})}}),Ie(s,"compositionend",function(){o.composing&&(o.poll(),o.composing.range.clear(),o.composing=null)})},gt.prototype.createField=function(e){this.wrapper=Lc(),this.textarea=this.wrapper.firstChild;var t=this.cm.options;Rl(this.textarea,t.spellcheck,t.autocorrect,t.autocapitalize)},gt.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},gt.prototype.prepareSelection=function(){var e=this.cm,t=e.display,o=e.doc,i=If(e);if(e.options.moveInputWithCursor){var s=Fr(e,o.sel.primary().head,"div"),u=t.wrapper.getBoundingClientRect(),d=t.lineDiv.getBoundingClientRect();i.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,s.top+d.top-u.top)),i.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,s.left+d.left-u.left))}return i},gt.prototype.showSelection=function(e){var t=this.cm,o=t.display;oe(o.cursorDiv,e.cursors),oe(o.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},gt.prototype.reset=function(e){if(!(this.contextMenuPending||this.composing&&e)){var t=this.cm;if(this.resetting=!0,t.somethingSelected()){this.prevInput="";var o=t.getSelection();this.textarea.value=o,t.state.focused&&we(this.textarea),g&&y>=9&&(this.hasSelection=o)}else e||(this.prevInput=this.textarea.value="",g&&y>=9&&(this.hasSelection=null));this.resetting=!1}},gt.prototype.getField=function(){return this.textarea},gt.prototype.supportsTouch=function(){return!1},gt.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!J||ge(Ce(this.textarea))!=this.textarea))try{this.textarea.focus()}catch{}},gt.prototype.blur=function(){this.textarea.blur()},gt.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},gt.prototype.receivedFocus=function(){this.slowPoll()},gt.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},gt.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function o(){var i=t.poll();!i&&!e?(e=!0,t.polling.set(60,o)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,o)},gt.prototype.poll=function(){var e=this,t=this.cm,o=this.textarea,i=this.prevInput;if(this.contextMenuPending||this.resetting||!t.state.focused||wr(o)&&!i&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var s=o.value;if(s==i&&!t.somethingSelected())return!1;if(g&&y>=9&&this.hasSelection===s||q&&/[\uf700-\uf7ff]/.test(s))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var u=s.charCodeAt(0);if(u==8203&&!i&&(i="\u200B"),u==8666)return this.reset(),this.cm.execCommand("undo")}for(var d=0,h=Math.min(i.length,s.length);d<h&&i.charCodeAt(d)==s.charCodeAt(d);)++d;return cr(t,function(){_l(t,s.slice(d),i.length-d,null,e.composing?"*compose":null),s.length>1e3||s.indexOf(`
32
+ `?"n":!B||/\s/.test(H)?null:"p";if(B&&!W&&!z&&(z="s"),C&&C!=z){o<0&&(o=1,I(),t.sticky="after");break}if(z&&(C=z),o>0&&!I(!W))break}var ne=Ra(e,t,u,d,!0);return Pe(u,ne)&&(ne.hitSide=!0),ne}function Fc(e,t,o,i){var s=e.doc,u=t.left,d;if(i=="page"){var h=Math.min(e.display.wrapper.clientHeight,ve(e).innerHeight||s(e).documentElement.clientHeight),m=Math.max(h-.5*hi(e.display),3);d=(o>0?t.bottom:t.top)+o*m}else i=="line"&&(d=o>0?t.bottom+3:t.top-3);for(var b;b=qs(e,u,d),!!b.outside;){if(o<0?d<=0:d>=s.height){b.hitSide=!0;break}d+=o*5}return b}var je=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Ge,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};je.prototype.init=function(e){var t=this,o=this,i=o.cm,s=o.div=e.lineDiv;s.contentEditable=!0,_l(s,i.options.spellcheck,i.options.autocorrect,i.options.autocapitalize);function u(h){for(var m=h.target;m;m=m.parentNode){if(m==s)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(m.className))break}return!1}Ie(s,"paste",function(h){!u(h)||$e(i,h)||Nc(h,i)||y<=11&&setTimeout(St(i,function(){return t.updateFromDOM()}),20)}),Ie(s,"compositionstart",function(h){t.composing={data:h.data,done:!1}}),Ie(s,"compositionupdate",function(h){t.composing||(t.composing={data:h.data,done:!1})}),Ie(s,"compositionend",function(h){t.composing&&(h.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),Ie(s,"touchstart",function(){return o.forceCompositionEnd()}),Ie(s,"input",function(){t.composing||t.readFromDOMSoon()});function d(h){if(!(!u(h)||$e(i,h))){if(i.somethingSelected())Fa({lineWise:!1,text:i.getSelections()}),h.type=="cut"&&i.replaceSelection("",null,"cut");else if(i.options.lineWiseCopyCut){var m=wc(i);Fa({lineWise:!0,text:m.text}),h.type=="cut"&&i.operation(function(){i.setSelections(m.ranges,0,Me),i.replaceSelection("",null,"cut")})}else return;if(h.clipboardData){h.clipboardData.clearData();var b=Ur.text.join(`
33
+ `);if(h.clipboardData.setData("Text",b),h.clipboardData.getData("Text")==b){h.preventDefault();return}}var I=Lc(),C=I.firstChild;_l(C),i.display.lineSpace.insertBefore(I,i.display.lineSpace.firstChild),C.value=Ur.text.join(`
34
+ `);var B=ge(Ce(s));we(C),setTimeout(function(){i.display.lineSpace.removeChild(I),B.focus(),B==s&&o.showPrimarySelection()},50)}}Ie(s,"copy",d),Ie(s,"cut",d)},je.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},je.prototype.prepareSelection=function(){var e=If(this.cm,!1);return e.focus=ge(Ce(this.div))==this.div,e},je.prototype.showSelection=function(e,t){!e||!this.cm.display.view.length||((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},je.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},je.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,o=t.doc.sel.primary(),i=o.from(),s=o.to();if(t.display.viewTo==t.display.viewFrom||i.line>=t.display.viewTo||s.line<t.display.viewFrom){e.removeAllRanges();return}var u=Ba(t,e.anchorNode,e.anchorOffset),d=Ba(t,e.focusNode,e.focusOffset);if(!(u&&!u.bad&&d&&!d.bad&&ce(ui(u,d),i)==0&&ce(zt(u,d),s)==0)){var h=t.display.view,m=i.line>=t.display.viewFrom&&Bc(t,i)||{node:h[0].measure.map[2],offset:0},b=s.line<t.display.viewTo&&Bc(t,s);if(!b){var I=h[h.length-1].measure,C=I.maps?I.maps[I.maps.length-1]:I.map;b={node:C[C.length-1],offset:C[C.length-2]-C[C.length-3]}}if(!m||!b){e.removeAllRanges();return}var B=e.rangeCount&&e.getRangeAt(0),L;try{L=D(m.node,m.offset,b.offset,b.node)}catch{}L&&(!a&&t.state.focused?(e.collapse(m.node,m.offset),L.collapsed||(e.removeAllRanges(),e.addRange(L))):(e.removeAllRanges(),e.addRange(L)),B&&e.anchorNode==null?e.addRange(B):a&&this.startGracePeriod()),this.rememberSelection()}},je.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){return e.cm.curOp.selectionChanged=!0})},20)},je.prototype.showMultipleSelections=function(e){oe(this.cm.display.cursorDiv,e.cursors),oe(this.cm.display.selectionDiv,e.selection)},je.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},je.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return de(this.div,t)},je.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||ge(Ce(this.div))!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},je.prototype.blur=function(){this.div.blur()},je.prototype.getField=function(){return this.div},je.prototype.supportsTouch=function(){return!0},je.prototype.receivedFocus=function(){var e=this,t=this;this.selectionInEditor()?setTimeout(function(){return e.pollSelection()},20):cr(this.cm,function(){return t.cm.curOp.selectionChanged=!0});function o(){t.cm.state.focused&&(t.pollSelection(),t.polling.set(t.cm.options.pollInterval,o))}this.polling.set(this.cm.options.pollInterval,o)},je.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},je.prototype.pollSelection=function(){if(!(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())){var e=this.getSelection(),t=this.cm;if(G&&A&&this.cm.display.gutterSpecs.length&&fb(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(!this.composing){this.rememberSelection();var o=Ba(t,e.anchorNode,e.anchorOffset),i=Ba(t,e.focusNode,e.focusOffset);o&&i&&cr(t,function(){Zt(t.doc,An(o,i),Me),(o.bad||i.bad)&&(t.curOp.selectionChanged=!0)})}}},je.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,o=e.doc.sel.primary(),i=o.from(),s=o.to();if(i.ch==0&&i.line>e.firstLine()&&(i=O(i.line-1,he(e.doc,i.line-1).length)),s.ch==he(e.doc,s.line).text.length&&s.line<e.lastLine()&&(s=O(s.line+1,0)),i.line<t.viewFrom||s.line>t.viewTo-1)return!1;var u,d,h;i.line==t.viewFrom||(u=Pn(e,i.line))==0?(d=v(t.view[0].line),h=t.view[0].node):(d=v(t.view[u].line),h=t.view[u-1].node.nextSibling);var m=Pn(e,s.line),b,I;if(m==t.view.length-1?(b=t.viewTo-1,I=t.lineDiv.lastChild):(b=v(t.view[m+1].line)-1,I=t.view[m+1].node.previousSibling),!h)return!1;for(var C=e.doc.splitLines(cb(e,h,I,d,b)),B=Rt(e.doc,O(d,0),O(b,he(e.doc,b).text.length));C.length>1&&B.length>1;)if(Te(C)==Te(B))C.pop(),B.pop(),b--;else if(C[0]==B[0])C.shift(),B.shift(),d++;else break;for(var L=0,W=0,H=C[0],z=B[0],ne=Math.min(H.length,z.length);L<ne&&H.charCodeAt(L)==z.charCodeAt(L);)++L;for(var pe=Te(C),ie=Te(B),me=Math.min(pe.length-(C.length==1?L:0),ie.length-(B.length==1?L:0));W<me&&pe.charCodeAt(pe.length-W-1)==ie.charCodeAt(ie.length-W-1);)++W;if(C.length==1&&B.length==1&&d==i.line)for(;L&&L>i.ch&&pe.charCodeAt(pe.length-W-1)==ie.charCodeAt(ie.length-W-1);)L--,W++;C[C.length-1]=pe.slice(0,pe.length-W).replace(/^\u200b+/,""),C[0]=C[0].slice(L).replace(/\u200b+$/,"");var Ae=O(d,L),Ee=O(b,B.length?Te(B).length-W:0);if(C.length>1||C[0]||ce(Ae,Ee))return Ti(e.doc,C,Ae,Ee,"+input"),!0},je.prototype.ensurePolled=function(){this.forceCompositionEnd()},je.prototype.reset=function(){this.forceCompositionEnd()},je.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},je.prototype.readFromDOMSoon=function(){var e=this;this.readDOMTimeout==null&&(this.readDOMTimeout=setTimeout(function(){if(e.readDOMTimeout=null,e.composing)if(e.composing.done)e.composing=null;else return;e.updateFromDOM()},80))},je.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&cr(this.cm,function(){return qt(e.cm)})},je.prototype.setUneditable=function(e){e.contentEditable="false"},je.prototype.onKeyPress=function(e){e.charCode==0||this.composing||(e.preventDefault(),this.cm.isReadOnly()||St(this.cm,Rl)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0))},je.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},je.prototype.onContextMenu=function(){},je.prototype.resetPosition=function(){},je.prototype.needsContentAttribute=!0;function Bc(e,t){var o=Ys(e,t.line);if(!o||o.hidden)return null;var i=he(e.doc,t.line),s=lf(o,i,t.line),u=Ne(i,e.doc.direction),d="left";if(u){var h=vr(u,t.ch);d=h%2?"right":"left"}var m=cf(s.map,t.ch,d);return m.offset=m.collapse=="right"?m.end:m.start,m}function fb(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function Ri(e,t){return t&&(e.bad=!0),e}function cb(e,t,o,i,s){var u="",d=!1,h=e.doc.lineSeparator(),m=!1;function b(L){return function(W){return W.id==L}}function I(){d&&(u+=h,m&&(u+=h),d=m=!1)}function C(L){L&&(I(),u+=L)}function B(L){if(L.nodeType==1){var W=L.getAttribute("cm-text");if(W){C(W);return}var H=L.getAttribute("cm-marker"),z;if(H){var ne=e.findMarks(O(i,0),O(s+1,0),b(+H));ne.length&&(z=ne[0].find(0))&&C(Rt(e.doc,z.from,z.to).join(h));return}if(L.getAttribute("contenteditable")=="false")return;var pe=/^(pre|div|p|li|table|br)$/i.test(L.nodeName);if(!/^br$/i.test(L.nodeName)&&L.textContent.length==0)return;pe&&I();for(var ie=0;ie<L.childNodes.length;ie++)B(L.childNodes[ie]);/^(pre|p)$/i.test(L.nodeName)&&(m=!0),pe&&(d=!0)}else L.nodeType==3&&C(L.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;B(t),t!=o;)t=t.nextSibling,m=!1;return u}function Ba(e,t,o){var i;if(t==e.display.lineDiv){if(i=e.display.lineDiv.childNodes[o],!i)return Ri(e.clipPos(O(e.display.viewTo-1)),!0);t=null,o=0}else for(i=t;;i=i.parentNode){if(!i||i==e.display.lineDiv)return null;if(i.parentNode&&i.parentNode==e.display.lineDiv)break}for(var s=0;s<e.display.view.length;s++){var u=e.display.view[s];if(u.node==i)return db(u,t,o)}}function db(e,t,o){var i=e.text.firstChild,s=!1;if(!t||!de(i,t))return Ri(O(v(e.line),0),!0);if(t==i&&(s=!0,t=i.childNodes[o],o=0,!t)){var u=e.rest?Te(e.rest):e.line;return Ri(O(v(u),u.text.length),s)}var d=t.nodeType==3?t:null,h=t;for(!d&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(d=t.firstChild,o&&(o=d.nodeValue.length));h.parentNode!=i;)h=h.parentNode;var m=e.measure,b=m.maps;function I(z,ne,pe){for(var ie=-1;ie<(b?b.length:0);ie++)for(var me=ie<0?m.map:b[ie],Ae=0;Ae<me.length;Ae+=3){var Ee=me[Ae+2];if(Ee==z||Ee==ne){var ke=v(ie<0?e.line:e.rest[ie]),et=me[Ae]+pe;return(pe<0||Ee!=z)&&(et=me[Ae+(pe?1:0)]),O(ke,et)}}}var C=I(d,h,o);if(C)return Ri(C,s);for(var B=h.nextSibling,L=d?d.nodeValue.length-o:0;B;B=B.nextSibling){if(C=I(B,B.firstChild,0),C)return Ri(O(C.line,C.ch-L),s);L+=B.textContent.length}for(var W=h.previousSibling,H=o;W;W=W.previousSibling){if(C=I(W,W.firstChild,-1),C)return Ri(O(C.line,C.ch+H),s);H+=W.textContent.length}}var gt=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new Ge,this.hasSelection=!1,this.composing=null,this.resetting=!1};gt.prototype.init=function(e){var t=this,o=this,i=this.cm;this.createField(e);var s=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),_&&(s.style.width="0px"),Ie(s,"input",function(){g&&y>=9&&t.hasSelection&&(t.hasSelection=null),o.poll()}),Ie(s,"paste",function(d){$e(i,d)||Nc(d,i)||(i.state.pasteIncoming=+new Date,o.fastPoll())});function u(d){if(!$e(i,d)){if(i.somethingSelected())Fa({lineWise:!1,text:i.getSelections()});else if(i.options.lineWiseCopyCut){var h=wc(i);Fa({lineWise:!0,text:h.text}),d.type=="cut"?i.setSelections(h.ranges,null,Me):(o.prevInput="",s.value=h.text.join(`
35
+ `),we(s))}else return;d.type=="cut"&&(i.state.cutIncoming=+new Date)}}Ie(s,"cut",u),Ie(s,"copy",u),Ie(e.scroller,"paste",function(d){if(!(on(e,d)||$e(i,d))){if(!s.dispatchEvent){i.state.pasteIncoming=+new Date,o.focus();return}var h=new Event("paste");h.clipboardData=d.clipboardData,s.dispatchEvent(h)}}),Ie(e.lineSpace,"selectstart",function(d){on(e,d)||At(d)}),Ie(s,"compositionstart",function(){var d=i.getCursor("from");o.composing&&o.composing.range.clear(),o.composing={start:d,range:i.markText(d,i.getCursor("to"),{className:"CodeMirror-composing"})}}),Ie(s,"compositionend",function(){o.composing&&(o.poll(),o.composing.range.clear(),o.composing=null)})},gt.prototype.createField=function(e){this.wrapper=Lc(),this.textarea=this.wrapper.firstChild;var t=this.cm.options;_l(this.textarea,t.spellcheck,t.autocorrect,t.autocapitalize)},gt.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},gt.prototype.prepareSelection=function(){var e=this.cm,t=e.display,o=e.doc,i=If(e);if(e.options.moveInputWithCursor){var s=Fr(e,o.sel.primary().head,"div"),u=t.wrapper.getBoundingClientRect(),d=t.lineDiv.getBoundingClientRect();i.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,s.top+d.top-u.top)),i.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,s.left+d.left-u.left))}return i},gt.prototype.showSelection=function(e){var t=this.cm,o=t.display;oe(o.cursorDiv,e.cursors),oe(o.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},gt.prototype.reset=function(e){if(!(this.contextMenuPending||this.composing&&e)){var t=this.cm;if(this.resetting=!0,t.somethingSelected()){this.prevInput="";var o=t.getSelection();this.textarea.value=o,t.state.focused&&we(this.textarea),g&&y>=9&&(this.hasSelection=o)}else e||(this.prevInput=this.textarea.value="",g&&y>=9&&(this.hasSelection=null));this.resetting=!1}},gt.prototype.getField=function(){return this.textarea},gt.prototype.supportsTouch=function(){return!1},gt.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!J||ge(Ce(this.textarea))!=this.textarea))try{this.textarea.focus()}catch{}},gt.prototype.blur=function(){this.textarea.blur()},gt.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},gt.prototype.receivedFocus=function(){this.slowPoll()},gt.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},gt.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function o(){var i=t.poll();!i&&!e?(e=!0,t.polling.set(60,o)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,o)},gt.prototype.poll=function(){var e=this,t=this.cm,o=this.textarea,i=this.prevInput;if(this.contextMenuPending||this.resetting||!t.state.focused||wr(o)&&!i&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var s=o.value;if(s==i&&!t.somethingSelected())return!1;if(g&&y>=9&&this.hasSelection===s||q&&/[\uf700-\uf7ff]/.test(s))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var u=s.charCodeAt(0);if(u==8203&&!i&&(i="\u200B"),u==8666)return this.reset(),this.cm.execCommand("undo")}for(var d=0,h=Math.min(i.length,s.length);d<h&&i.charCodeAt(d)==s.charCodeAt(d);)++d;return cr(t,function(){Rl(t,s.slice(d),i.length-d,null,e.composing?"*compose":null),s.length>1e3||s.indexOf(`
36
36
  `)>-1?o.value=e.prevInput="":e.prevInput=s,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},gt.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},gt.prototype.onKeyPress=function(){g&&y>=9&&(this.hasSelection=null),this.fastPoll()},gt.prototype.onContextMenu=function(e){var t=this,o=t.cm,i=o.display,s=t.textarea;t.contextMenuPending&&t.contextMenuPending();var u=Qn(o,e),d=i.scroller.scrollTop;if(!u||M)return;var h=o.options.resetSelectionOnContextMenu;h&&o.doc.sel.contains(u)==-1&&St(o,Zt)(o.doc,An(u),Me);var m=s.style.cssText,b=t.wrapper.style.cssText,I=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",s.style.cssText=`position: absolute; width: 30px; height: 30px;
37
37
  top: `+(e.clientY-I.top-5)+"px; left: "+(e.clientX-I.left-5)+`px;
38
38
  z-index: 1000; background: `+(g?"rgba(255, 255, 255, .05)":"transparent")+`;
39
- outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var C;T&&(C=s.ownerDocument.defaultView.scrollY),i.input.focus(),T&&s.ownerDocument.defaultView.scrollTo(null,C),i.input.reset(),o.somethingSelected()||(s.value=t.prevInput=" "),t.contextMenuPending=L,i.selForContextMenu=o.doc.sel,clearTimeout(i.detectingSelectAll);function B(){if(s.selectionStart!=null){var H=o.somethingSelected(),z="\u200B"+(H?s.value:"");s.value="\u21DA",s.value=z,t.prevInput=H?"":"\u200B",s.selectionStart=1,s.selectionEnd=z.length,i.selForContextMenu=o.doc.sel}}function L(){if(t.contextMenuPending==L&&(t.contextMenuPending=!1,t.wrapper.style.cssText=b,s.style.cssText=m,g&&y<9&&i.scrollbars.setScrollTop(i.scroller.scrollTop=d),s.selectionStart!=null)){(!g||g&&y<9)&&B();var H=0,z=function(){i.selForContextMenu==o.doc.sel&&s.selectionStart==0&&s.selectionEnd>0&&t.prevInput=="\u200B"?St(o,Kf)(o):H++<10?i.detectingSelectAll=setTimeout(z,500):(i.selForContextMenu=null,i.input.reset())};i.detectingSelectAll=setTimeout(z,200)}}if(g&&y>=9&&B(),P){Wr(e);var W=function(){Ct(window,"mouseup",W),setTimeout(L,20)};Ie(window,"mouseup",W)}else setTimeout(L,50)},gt.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},gt.prototype.setUneditable=function(){},gt.prototype.needsContentAttribute=!1;function hb(e,t){if(t=t?le(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),t.autofocus==null){var o=ge(Ce(e));t.autofocus=o==e||e.getAttribute("autofocus")!=null&&o==document.body}function i(){e.value=h.getValue()}var s;if(e.form&&(Ie(e.form,"submit",i),!t.leaveSubmitMethodAlone)){var u=e.form;s=u.submit;try{var d=u.submit=function(){i(),u.submit=s,u.submit(),u.submit=d}}catch{}}t.finishInit=function(m){m.save=i,m.getTextArea=function(){return e},m.toTextArea=function(){m.toTextArea=isNaN,i(),e.parentNode.removeChild(m.getWrapperElement()),e.style.display="",e.form&&(Ct(e.form,"submit",i),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=s))}},e.style.display="none";var h=ot(function(m){return e.parentNode.insertBefore(m,e.nextSibling)},t);return h}function pb(e){e.off=Ct,e.on=Ie,e.wheelEventPixels=T0,e.Doc=Kt,e.splitLines=jt,e.countColumn=ye,e.findColumn=De,e.isWordChar=ze,e.Pass=Je,e.signal=Ke,e.Line=fi,e.changeEnd=_n,e.scrollbarModel=Nf,e.Pos=O,e.cmpPos=fe,e.modes=tn,e.mimeModes=ur,e.resolveMode=Tn,e.getMode=xe,e.modeExtensions=N,e.extendMode=K,e.copyState=be,e.startState=dt,e.innerMode=Ye,e.commands=_o,e.keyMap=sn,e.keyName=pc,e.isModifierKey=dc,e.lookupKey=Ei,e.normalizeKeyMap=Q0,e.StringStream=Ue,e.SharedTextMarker=Eo,e.TextMarker=Nn,e.LineWidget=Io,e.e_preventDefault=At,e.e_stopPropagation=rt,e.e_stop=Wr,e.addClass=Oe,e.contains=ce,e.rmClass=pe,e.keyNames=Sn}ob(ot),ub(ot);var gb="iter insert remove copy getEditor constructor".split(" ");for(var Ua in Kt.prototype)Kt.prototype.hasOwnProperty(Ua)&&ue(gb,Ua)<0&&(ot.prototype[Ua]=function(e){return function(){return e.apply(this.doc,arguments)}}(Kt.prototype[Ua]));return xr(Kt),ot.inputStyles={textarea:gt,contenteditable:je},ot.defineMode=function(e){!ot.defaults.mode&&e!="null"&&(ot.defaults.mode=e),fr.apply(this,arguments)},ot.defineMIME=Dr,ot.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),ot.defineMIME("text/plain","null"),ot.defineExtension=function(e,t){ot.prototype[e]=t},ot.defineDocExtension=function(e,t){Kt.prototype[e]=t},ot.fromTextArea=hb,pb(ot),ot.version="5.65.20",ot})});var Bu=at((jg,zg)=>{(function(r){typeof jg=="object"&&typeof zg=="object"?r(bn()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],r):r(CodeMirror)})(function(r){"use strict";function n(p,g,y,T){if(y&&y.call){var U=y;y=null}else var U=c(p,y,"rangeFinder");typeof g=="number"&&(g=r.Pos(g,0));var A=c(p,y,"minFoldSize");function F(Z){var R=U(p,g);if(!R||R.to.line-R.from.line<A)return null;if(T==="fold")return R;for(var G=p.findMarksAt(R.from),J=0;J<G.length;++J)if(G[J].__isFold){if(!Z)return null;R.cleared=!0,G[J].clear()}return R}var M=F(!0);if(c(p,y,"scanUp"))for(;!M&&g.line>p.firstLine();)g=r.Pos(g.line-1,0),M=F(!1);if(!(!M||M.cleared||T==="unfold")){var X=a(p,y,M);r.on(X,"mousedown",function(Z){S.clear(),r.e_preventDefault(Z)});var S=p.markText(M.from,M.to,{replacedWith:X,clearOnEnter:c(p,y,"clearOnEnter"),__isFold:!0});S.on("clear",function(Z,R){r.signal(p,"unfold",p,Z,R)}),r.signal(p,"fold",p,M.from,M.to)}}function a(p,g,y){var T=c(p,g,"widget");if(typeof T=="function"&&(T=T(y.from,y.to)),typeof T=="string"){var U=document.createTextNode(T);T=document.createElement("span"),T.appendChild(U),T.className="CodeMirror-foldmarker"}else T&&(T=T.cloneNode(!0));return T}r.newFoldFunction=function(p,g){return function(y,T){n(y,T,{rangeFinder:p,widget:g})}},r.defineExtension("foldCode",function(p,g,y){n(this,p,g,y)}),r.defineExtension("isFolded",function(p){for(var g=this.findMarksAt(p),y=0;y<g.length;++y)if(g[y].__isFold)return!0}),r.commands.toggleFold=function(p){p.foldCode(p.getCursor())},r.commands.fold=function(p){p.foldCode(p.getCursor(),null,"fold")},r.commands.unfold=function(p){p.foldCode(p.getCursor(),{scanUp:!1},"unfold")},r.commands.foldAll=function(p){p.operation(function(){for(var g=p.firstLine(),y=p.lastLine();g<=y;g++)p.foldCode(r.Pos(g,0),{scanUp:!1},"fold")})},r.commands.unfoldAll=function(p){p.operation(function(){for(var g=p.firstLine(),y=p.lastLine();g<=y;g++)p.foldCode(r.Pos(g,0),{scanUp:!1},"unfold")})},r.registerHelper("fold","combine",function(){var p=Array.prototype.slice.call(arguments,0);return function(g,y){for(var T=0;T<p.length;++T){var U=p[T](g,y);if(U)return U}}}),r.registerHelper("fold","auto",function(p,g){for(var y=p.getHelpers(g,"fold"),T=0;T<y.length;T++){var U=y[T](p,g);if(U)return U}});var l={rangeFinder:r.fold.auto,widget:"\u2194",minFoldSize:0,scanUp:!1,clearOnEnter:!0};r.defineOption("foldOptions",null);function c(p,g,y){if(g&&g[y]!==void 0)return g[y];var T=p.options.foldOptions;return T&&T[y]!==void 0?T[y]:l[y]}r.defineExtension("foldOption",function(p,g){return c(this,p,g)})})});var $g=at((qg,Kg)=>{(function(r){typeof qg=="object"&&typeof Kg=="object"?r(bn(),Bu()):typeof define=="function"&&define.amd?define(["../../lib/codemirror","./foldcode"],r):r(CodeMirror)})(function(r){"use strict";r.defineOption("foldGutter",!1,function(S,Z,R){R&&R!=r.Init&&(S.clearGutter(S.state.foldGutter.options.gutter),S.state.foldGutter=null,S.off("gutterClick",U),S.off("changes",F),S.off("viewportChange",M),S.off("fold",X),S.off("unfold",X),S.off("swapDoc",F),S.off("optionChange",A)),Z&&(S.state.foldGutter=new a(l(Z)),T(S),S.on("gutterClick",U),S.on("changes",F),S.on("viewportChange",M),S.on("fold",X),S.on("unfold",X),S.on("swapDoc",F),S.on("optionChange",A))});var n=r.Pos;function a(S){this.options=S,this.from=this.to=0}function l(S){return S===!0&&(S={}),S.gutter==null&&(S.gutter="CodeMirror-foldgutter"),S.indicatorOpen==null&&(S.indicatorOpen="CodeMirror-foldgutter-open"),S.indicatorFolded==null&&(S.indicatorFolded="CodeMirror-foldgutter-folded"),S}function c(S,Z){for(var R=S.findMarks(n(Z,0),n(Z+1,0)),G=0;G<R.length;++G)if(R[G].__isFold){var J=R[G].find(-1);if(J&&J.line===Z)return R[G]}}function p(S){if(typeof S=="string"){var Z=document.createElement("div");return Z.className=S+" CodeMirror-guttermarker-subtle",Z}else return S.cloneNode(!0)}function g(S,Z,R){var G=S.state.foldGutter.options,J=Z-1,q=S.foldOption(G,"minFoldSize"),te=S.foldOption(G,"rangeFinder"),ae=typeof G.indicatorFolded=="string"&&y(G.indicatorFolded),_=typeof G.indicatorOpen=="string"&&y(G.indicatorOpen);S.eachLine(Z,R,function(w){++J;var P=null,$=w.gutterMarkers;if($&&($=$[G.gutter]),c(S,J)){if(ae&&$&&ae.test($.className))return;P=p(G.indicatorFolded)}else{var pe=n(J,0),k=te&&te(S,pe);if(k&&k.to.line-k.from.line>=q){if(_&&$&&_.test($.className))return;P=p(G.indicatorOpen)}}!P&&!$||S.setGutterMarker(w,G.gutter,P)})}function y(S){return new RegExp("(^|\\s)"+S+"(?:$|\\s)\\s*")}function T(S){var Z=S.getViewport(),R=S.state.foldGutter;R&&(S.operation(function(){g(S,Z.from,Z.to)}),R.from=Z.from,R.to=Z.to)}function U(S,Z,R){var G=S.state.foldGutter;if(G){var J=G.options;if(R==J.gutter){var q=c(S,Z);q?q.clear():S.foldCode(n(Z,0),J)}}}function A(S,Z){Z=="mode"&&F(S)}function F(S){var Z=S.state.foldGutter;if(Z){var R=Z.options;Z.from=Z.to=0,clearTimeout(Z.changeUpdate),Z.changeUpdate=setTimeout(function(){T(S)},R.foldOnChangeTimeSpan||600)}}function M(S){var Z=S.state.foldGutter;if(Z){var R=Z.options;clearTimeout(Z.changeUpdate),Z.changeUpdate=setTimeout(function(){var G=S.getViewport();Z.from==Z.to||G.from-Z.to>20||Z.from-G.to>20?T(S):S.operation(function(){G.from<Z.from&&(g(S,G.from,Z.from),Z.from=G.from),G.to>Z.to&&(g(S,Z.to,G.to),Z.to=G.to)})},R.updateViewportTimeSpan||400)}}function X(S,Z){var R=S.state.foldGutter;if(R){var G=Z.line;G>=R.from&&G<R.to&&g(S,G,G+1)}}})});var rm=at((em,tm)=>{(function(r){typeof em=="object"&&typeof tm=="object"?r(bn()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],r):r(CodeMirror)})(function(r){"use strict";var n=r.Pos;function a(R,G){return R.line-G.line||R.ch-G.ch}var l="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",c=l+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",p=new RegExp("<(/?)(["+l+"]["+c+"]*)","g");function g(R,G,J,q){this.line=G,this.ch=J,this.cm=R,this.text=R.getLine(G),this.min=q?Math.max(q.from,R.firstLine()):R.firstLine(),this.max=q?Math.min(q.to-1,R.lastLine()):R.lastLine()}function y(R,G){var J=R.cm.getTokenTypeAt(n(R.line,G));return J&&/\btag\b/.test(J)}function T(R){if(!(R.line>=R.max))return R.ch=0,R.text=R.cm.getLine(++R.line),!0}function U(R){if(!(R.line<=R.min))return R.text=R.cm.getLine(--R.line),R.ch=R.text.length,!0}function A(R){for(;;){var G=R.text.indexOf(">",R.ch);if(G==-1){if(T(R))continue;return}if(!y(R,G+1)){R.ch=G+1;continue}var J=R.text.lastIndexOf("/",G),q=J>-1&&!/\S/.test(R.text.slice(J+1,G));return R.ch=G+1,q?"selfClose":"regular"}}function F(R){for(;;){var G=R.ch?R.text.lastIndexOf("<",R.ch-1):-1;if(G==-1){if(U(R))continue;return}if(!y(R,G+1)){R.ch=G;continue}p.lastIndex=G,R.ch=G;var J=p.exec(R.text);if(J&&J.index==G)return J}}function M(R){for(;;){p.lastIndex=R.ch;var G=p.exec(R.text);if(!G){if(T(R))continue;return}if(!y(R,G.index+1)){R.ch=G.index+1;continue}return R.ch=G.index+G[0].length,G}}function X(R){for(;;){var G=R.ch?R.text.lastIndexOf(">",R.ch-1):-1;if(G==-1){if(U(R))continue;return}if(!y(R,G+1)){R.ch=G;continue}var J=R.text.lastIndexOf("/",G),q=J>-1&&!/\S/.test(R.text.slice(J+1,G));return R.ch=G+1,q?"selfClose":"regular"}}function S(R,G){for(var J=[];;){var q=M(R),te,ae=R.line,_=R.ch-(q?q[0].length:0);if(!q||!(te=A(R)))return;if(te!="selfClose")if(q[1]){for(var w=J.length-1;w>=0;--w)if(J[w]==q[2]){J.length=w;break}if(w<0&&(!G||G==q[2]))return{tag:q[2],from:n(ae,_),to:n(R.line,R.ch)}}else J.push(q[2])}}function Z(R,G){for(var J=[];;){var q=X(R);if(!q)return;if(q=="selfClose"){F(R);continue}var te=R.line,ae=R.ch,_=F(R);if(!_)return;if(_[1])J.push(_[2]);else{for(var w=J.length-1;w>=0;--w)if(J[w]==_[2]){J.length=w;break}if(w<0&&(!G||G==_[2]))return{tag:_[2],from:n(R.line,R.ch),to:n(te,ae)}}}}r.registerHelper("fold","xml",function(R,G){for(var J=new g(R,G.line,0);;){var q=M(J);if(!q||J.line!=G.line)return;var te=A(J);if(!te)return;if(!q[1]&&te!="selfClose"){var ae=n(J.line,J.ch),_=S(J,q[2]);return _&&a(_.from,ae)>0?{from:ae,to:_.from}:null}}}),r.findMatchingTag=function(R,G,J){var q=new g(R,G.line,G.ch,J);if(!(q.text.indexOf(">")==-1&&q.text.indexOf("<")==-1)){var te=A(q),ae=te&&n(q.line,q.ch),_=te&&F(q);if(!(!te||!_||a(q,G)>0)){var w={from:n(q.line,q.ch),to:ae,tag:_[2]};return te=="selfClose"?{open:w,close:null,at:"open"}:_[1]?{open:Z(q,_[2]),close:w,at:"close"}:(q=new g(R,ae.line,ae.ch,J),{open:w,close:S(q,_[2]),at:"open"})}}},r.findEnclosingTag=function(R,G,J,q){for(var te=new g(R,G.line,G.ch,J);;){var ae=Z(te,q);if(!ae)break;var _=new g(R,G.line,G.ch,J),w=S(_,ae.tag);if(w)return{open:ae,close:w}}},r.scanForClosingTag=function(R,G,J,q){var te=new g(R,G.line,G.ch,q?{from:0,to:q}:null);return S(te,J)}})});var om=at((nm,im)=>{(function(r){typeof nm=="object"&&typeof im=="object"?r(bn()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],r):r(CodeMirror)})(function(r){"use strict";function n(a){return function(l,c){var p=c.line,g=l.getLine(p);function y(X){for(var S,Z=c.ch,R=0;;){var G=Z<=0?-1:g.lastIndexOf(X[0],Z-1);if(G==-1){if(R==1)break;R=1,Z=g.length;continue}if(R==1&&G<c.ch)break;if(S=l.getTokenTypeAt(r.Pos(p,G+1)),!/^(comment|string)/.test(S))return{ch:G+1,tokenType:S,pair:X};Z=G-1}}function T(X){var S=1,Z=l.lastLine(),R,G=X.ch,J;e:for(var q=p;q<=Z;++q)for(var te=l.getLine(q),ae=q==p?G:0;;){var _=te.indexOf(X.pair[0],ae),w=te.indexOf(X.pair[1],ae);if(_<0&&(_=te.length),w<0&&(w=te.length),ae=Math.min(_,w),ae==te.length)break;if(l.getTokenTypeAt(r.Pos(q,ae+1))==X.tokenType){if(ae==_)++S;else if(!--S){R=q,J=ae;break e}}++ae}return R==null||p==R?null:{from:r.Pos(p,G),to:r.Pos(R,J)}}for(var U=[],A=0;A<a.length;A++){var F=y(a[A]);F&&U.push(F)}U.sort(function(X,S){return X.ch-S.ch});for(var A=0;A<U.length;A++){var M=T(U[A]);if(M)return M}return null}}r.registerHelper("fold","brace",n([["{","}"],["[","]"]])),r.registerHelper("fold","brace-paren",n([["{","}"],["[","]"],["(",")"]])),r.registerHelper("fold","import",function(a,l){function c(A){if(A<a.firstLine()||A>a.lastLine())return null;var F=a.getTokenAt(r.Pos(A,1));if(/\S/.test(F.string)||(F=a.getTokenAt(r.Pos(A,F.end+1))),F.type!="keyword"||F.string!="import")return null;for(var M=A,X=Math.min(a.lastLine(),A+10);M<=X;++M){var S=a.getLine(M),Z=S.indexOf(";");if(Z!=-1)return{startCh:F.end,end:r.Pos(M,Z)}}}var p=l.line,g=c(p),y;if(!g||c(p-1)||(y=c(p-2))&&y.end.line==p-1)return null;for(var T=g.end;;){var U=c(T.line+1);if(U==null)break;T=U.end}return{from:a.clipPos(r.Pos(p,g.startCh+1)),to:T}}),r.registerHelper("fold","include",function(a,l){function c(U){if(U<a.firstLine()||U>a.lastLine())return null;var A=a.getTokenAt(r.Pos(U,1));if(/\S/.test(A.string)||(A=a.getTokenAt(r.Pos(U,A.end+1))),A.type=="meta"&&A.string.slice(0,8)=="#include")return A.start+8}var p=l.line,g=c(p);if(g==null||c(p-1)!=null)return null;for(var y=p;;){var T=c(y+1);if(T==null)break;++y}return{from:r.Pos(p,g+1),to:a.clipPos(r.Pos(y))}})})});var lm=at((am,sm)=>{(function(r){typeof am=="object"&&typeof sm=="object"?r(bn()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],r):r(CodeMirror)})(function(r){var n=/MSIE \d/.test(navigator.userAgent)&&(document.documentMode==null||document.documentMode<8),a=r.Pos,l={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<","<":">>",">":"<<"};function c(A){return A&&A.bracketRegex||/[(){}[\]]/}function p(A,F,M){var X=A.getLineHandle(F.line),S=F.ch-1,Z=M&&M.afterCursor;Z==null&&(Z=/(^| )cm-fat-cursor($| )/.test(A.getWrapperElement().className));var R=c(M),G=!Z&&S>=0&&R.test(X.text.charAt(S))&&l[X.text.charAt(S)]||R.test(X.text.charAt(S+1))&&l[X.text.charAt(++S)];if(!G)return null;var J=G.charAt(1)==">"?1:-1;if(M&&M.strict&&J>0!=(S==F.ch))return null;var q=A.getTokenTypeAt(a(F.line,S+1)),te=g(A,a(F.line,S+(J>0?1:0)),J,q,M);return te==null?null:{from:a(F.line,S),to:te&&te.pos,match:te&&te.ch==G.charAt(0),forward:J>0}}function g(A,F,M,X,S){for(var Z=S&&S.maxScanLineLength||1e4,R=S&&S.maxScanLines||1e3,G=[],J=c(S),q=M>0?Math.min(F.line+R,A.lastLine()+1):Math.max(A.firstLine()-1,F.line-R),te=F.line;te!=q;te+=M){var ae=A.getLine(te);if(ae){var _=M>0?0:ae.length-1,w=M>0?ae.length:-1;if(!(ae.length>Z))for(te==F.line&&(_=F.ch-(M<0?1:0));_!=w;_+=M){var P=ae.charAt(_);if(J.test(P)&&(X===void 0||(A.getTokenTypeAt(a(te,_+1))||"")==(X||""))){var $=l[P];if($&&$.charAt(1)==">"==M>0)G.push(P);else if(G.length)G.pop();else return{pos:a(te,_),ch:P}}}}}return te-M==(M>0?A.lastLine():A.firstLine())?!1:null}function y(A,F,M){for(var X=A.state.matchBrackets.maxHighlightLineLength||1e3,S=M&&M.highlightNonMatching,Z=[],R=A.listSelections(),G=0;G<R.length;G++){var J=R[G].empty()&&p(A,R[G].head,M);if(J&&(J.match||S!==!1)&&A.getLine(J.from.line).length<=X){var q=J.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket";Z.push(A.markText(J.from,a(J.from.line,J.from.ch+1),{className:q})),J.to&&A.getLine(J.to.line).length<=X&&Z.push(A.markText(J.to,a(J.to.line,J.to.ch+1),{className:q}))}}if(Z.length){n&&A.state.focused&&A.focus();var te=function(){A.operation(function(){for(var ae=0;ae<Z.length;ae++)Z[ae].clear()})};if(F)setTimeout(te,800);else return te}}function T(A){A.operation(function(){A.state.matchBrackets.currentlyHighlighted&&(A.state.matchBrackets.currentlyHighlighted(),A.state.matchBrackets.currentlyHighlighted=null),A.state.matchBrackets.currentlyHighlighted=y(A,!1,A.state.matchBrackets)})}function U(A){A.state.matchBrackets&&A.state.matchBrackets.currentlyHighlighted&&(A.state.matchBrackets.currentlyHighlighted(),A.state.matchBrackets.currentlyHighlighted=null)}r.defineOption("matchBrackets",!1,function(A,F,M){M&&M!=r.Init&&(A.off("cursorActivity",T),A.off("focus",T),A.off("blur",U),U(A)),F&&(A.state.matchBrackets=typeof F=="object"?F:{},A.on("cursorActivity",T),A.on("focus",T),A.on("blur",U))}),r.defineExtension("matchBrackets",function(){y(this,!0)}),r.defineExtension("findMatchingBracket",function(A,F,M){return(M||typeof F=="boolean")&&(M?(M.strict=F,F=M):F=F?{strict:!0}:null),p(this,A,F)}),r.defineExtension("scanForBracket",function(A,F,M,X){return g(this,A,F,M,X)})})});var cm=at((um,fm)=>{(function(r){typeof um=="object"&&typeof fm=="object"?r(bn()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],r):r(CodeMirror)})(function(r){"use strict";var n={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},a={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};r.defineMode("xml",function(l,c){var p=l.indentUnit,g={},y=c.htmlMode?n:a;for(var T in y)g[T]=y[T];for(var T in c)g[T]=c[T];var U,A;function F(x,ee){function D(Oe){return ee.tokenize=Oe,Oe(x,ee)}var ce=x.next();if(ce=="<")return x.eat("!")?x.eat("[")?x.match("CDATA[")?D(S("atom","]]>")):null:x.match("--")?D(S("comment","-->")):x.match("DOCTYPE",!0,!0)?(x.eatWhile(/[\w\._\-]/),D(Z(1))):null:x.eat("?")?(x.eatWhile(/[\w\._\-]/),ee.tokenize=S("meta","?>"),"meta"):(U=x.eat("/")?"closeTag":"openTag",ee.tokenize=M,"tag bracket");if(ce=="&"){var ge;return x.eat("#")?x.eat("x")?ge=x.eatWhile(/[a-fA-F\d]/)&&x.eat(";"):ge=x.eatWhile(/[\d]/)&&x.eat(";"):ge=x.eatWhile(/[\w\.\-:]/)&&x.eat(";"),ge?"atom":"error"}else return x.eatWhile(/[^&<]/),null}F.isInText=!0;function M(x,ee){var D=x.next();if(D==">"||D=="/"&&x.eat(">"))return ee.tokenize=F,U=D==">"?"endTag":"selfcloseTag","tag bracket";if(D=="=")return U="equals",null;if(D=="<"){ee.tokenize=F,ee.state=te,ee.tagName=ee.tagStart=null;var ce=ee.tokenize(x,ee);return ce?ce+" tag error":"tag error"}else return/[\'\"]/.test(D)?(ee.tokenize=X(D),ee.stringStartCol=x.column(),ee.tokenize(x,ee)):(x.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function X(x){var ee=function(D,ce){for(;!D.eol();)if(D.next()==x){ce.tokenize=M;break}return"string"};return ee.isInAttribute=!0,ee}function S(x,ee){return function(D,ce){for(;!D.eol();){if(D.match(ee)){ce.tokenize=F;break}D.next()}return x}}function Z(x){return function(ee,D){for(var ce;(ce=ee.next())!=null;){if(ce=="<")return D.tokenize=Z(x+1),D.tokenize(ee,D);if(ce==">")if(x==1){D.tokenize=F;break}else return D.tokenize=Z(x-1),D.tokenize(ee,D)}return"meta"}}function R(x){return x&&x.toLowerCase()}function G(x,ee,D){this.prev=x.context,this.tagName=ee||"",this.indent=x.indented,this.startOfLine=D,(g.doNotIndent.hasOwnProperty(ee)||x.context&&x.context.noIndent)&&(this.noIndent=!0)}function J(x){x.context&&(x.context=x.context.prev)}function q(x,ee){for(var D;;){if(!x.context||(D=x.context.tagName,!g.contextGrabbers.hasOwnProperty(R(D))||!g.contextGrabbers[R(D)].hasOwnProperty(R(ee))))return;J(x)}}function te(x,ee,D){return x=="openTag"?(D.tagStart=ee.column(),ae):x=="closeTag"?_:te}function ae(x,ee,D){return x=="word"?(D.tagName=ee.current(),A="tag",$):g.allowMissingTagName&&x=="endTag"?(A="tag bracket",$(x,ee,D)):(A="error",ae)}function _(x,ee,D){if(x=="word"){var ce=ee.current();return D.context&&D.context.tagName!=ce&&g.implicitlyClosed.hasOwnProperty(R(D.context.tagName))&&J(D),D.context&&D.context.tagName==ce||g.matchClosing===!1?(A="tag",w):(A="tag error",P)}else return g.allowMissingTagName&&x=="endTag"?(A="tag bracket",w(x,ee,D)):(A="error",P)}function w(x,ee,D){return x!="endTag"?(A="error",w):(J(D),te)}function P(x,ee,D){return A="error",w(x,ee,D)}function $(x,ee,D){if(x=="word")return A="attribute",pe;if(x=="endTag"||x=="selfcloseTag"){var ce=D.tagName,ge=D.tagStart;return D.tagName=D.tagStart=null,x=="selfcloseTag"||g.autoSelfClosers.hasOwnProperty(R(ce))?q(D,ce):(q(D,ce),D.context=new G(D,ce,ge==D.indented)),te}return A="error",$}function pe(x,ee,D){return x=="equals"?k:(g.allowMissing||(A="error"),$(x,ee,D))}function k(x,ee,D){return x=="string"?oe:x=="word"&&g.allowUnquoted?(A="string",$):(A="error",$(x,ee,D))}function oe(x,ee,D){return x=="string"?oe:$(x,ee,D)}return{startState:function(x){var ee={tokenize:F,state:te,indented:x||0,tagName:null,tagStart:null,context:null};return x!=null&&(ee.baseIndent=x),ee},token:function(x,ee){if(!ee.tagName&&x.sol()&&(ee.indented=x.indentation()),x.eatSpace())return null;U=null;var D=ee.tokenize(x,ee);return(D||U)&&D!="comment"&&(A=null,ee.state=ee.state(U||D,x,ee),A&&(D=A=="error"?D+" error":A)),D},indent:function(x,ee,D){var ce=x.context;if(x.tokenize.isInAttribute)return x.tagStart==x.indented?x.stringStartCol+1:x.indented+p;if(ce&&ce.noIndent)return r.Pass;if(x.tokenize!=M&&x.tokenize!=F)return D?D.match(/^(\s*)/)[0].length:0;if(x.tagName)return g.multilineTagIndentPastTag!==!1?x.tagStart+x.tagName.length+2:x.tagStart+p*(g.multilineTagIndentFactor||1);if(g.alignCDATA&&/<!\[CDATA\[/.test(ee))return 0;var ge=ee&&/^<(\/)?([\w_:\.-]*)/.exec(ee);if(ge&&ge[1])for(;ce;)if(ce.tagName==ge[2]){ce=ce.prev;break}else if(g.implicitlyClosed.hasOwnProperty(R(ce.tagName)))ce=ce.prev;else break;else if(ge)for(;ce;){var Oe=g.contextGrabbers[R(ce.tagName)];if(Oe&&Oe.hasOwnProperty(R(ge[2])))ce=ce.prev;else break}for(;ce&&ce.prev&&!ce.startOfLine;)ce=ce.prev;return ce?ce.indent+p:x.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:g.htmlMode?"html":"xml",helperType:g.htmlMode?"html":"xml",skipAttribute:function(x){x.state==k&&(x.state=$)},xmlCurrentTag:function(x){return x.tagName?{name:x.tagName,close:x.type=="closeTag"}:null},xmlCurrentContext:function(x){for(var ee=[],D=x.context;D;D=D.prev)ee.push(D.tagName);return ee.reverse()}}}),r.defineMIME("text/xml","xml"),r.defineMIME("application/xml","xml"),r.mimeModes.hasOwnProperty("text/html")||r.defineMIME("text/html",{name:"xml",htmlMode:!0})})});var pm=at((dm,hm)=>{(function(r){typeof dm=="object"&&typeof hm=="object"?r(bn()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],r):r(CodeMirror)})(function(r){"use strict";r.defineMode("javascript",function(n,a){var l=n.indentUnit,c=a.statementIndent,p=a.jsonld,g=a.json||p,y=a.trackScope!==!1,T=a.typescript,U=a.wordCharacters||/[\w$\xa1-\uffff]/,A=function(){function v(Rt){return{type:Rt,style:"keyword"}}var E=v("keyword a"),V=v("keyword b"),Y=v("keyword c"),O=v("keyword d"),fe=v("operator"),Pe={type:"atom",style:"atom"};return{if:v("if"),while:E,with:E,else:V,do:V,try:V,finally:V,return:O,break:O,continue:O,new:v("new"),delete:Y,void:Y,throw:Y,debugger:v("debugger"),var:v("var"),const:v("var"),let:v("var"),function:v("function"),catch:v("catch"),for:v("for"),switch:v("switch"),case:v("case"),default:v("default"),in:fe,typeof:fe,instanceof:fe,true:Pe,false:Pe,null:Pe,undefined:Pe,NaN:Pe,Infinity:Pe,this:v("this"),class:v("class"),super:v("atom"),yield:Y,export:v("export"),import:v("import"),extends:Y,await:Y}}(),F=/[+\-*&%=<>!?|~^@]/,M=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function X(v){for(var E=!1,V,Y=!1;(V=v.next())!=null;){if(!E){if(V=="/"&&!Y)return;V=="["?Y=!0:Y&&V=="]"&&(Y=!1)}E=!E&&V=="\\"}}var S,Z;function R(v,E,V){return S=v,Z=V,E}function G(v,E){var V=v.next();if(V=='"'||V=="'")return E.tokenize=J(V),E.tokenize(v,E);if(V=="."&&v.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return R("number","number");if(V=="."&&v.match(".."))return R("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(V))return R(V);if(V=="="&&v.eat(">"))return R("=>","operator");if(V=="0"&&v.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return R("number","number");if(/\d/.test(V))return v.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),R("number","number");if(V=="/")return v.eat("*")?(E.tokenize=q,q(v,E)):v.eat("/")?(v.skipToEnd(),R("comment","comment")):Dt(v,E,1)?(X(v),v.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),R("regexp","string-2")):(v.eat("="),R("operator","operator",v.current()));if(V=="`")return E.tokenize=te,te(v,E);if(V=="#"&&v.peek()=="!")return v.skipToEnd(),R("meta","meta");if(V=="#"&&v.eatWhile(U))return R("variable","property");if(V=="<"&&v.match("!--")||V=="-"&&v.match("->")&&!/\S/.test(v.string.slice(0,v.start)))return v.skipToEnd(),R("comment","comment");if(F.test(V))return(V!=">"||!E.lexical||E.lexical.type!=">")&&(v.eat("=")?(V=="!"||V=="=")&&v.eat("="):/[<>*+\-|&?]/.test(V)&&(v.eat(V),V==">"&&v.eat(V))),V=="?"&&v.eat(".")?R("."):R("operator","operator",v.current());if(U.test(V)){v.eatWhile(U);var Y=v.current();if(E.lastType!="."){if(A.propertyIsEnumerable(Y)){var O=A[Y];return R(O.type,O.style,Y)}if(Y=="async"&&v.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,!1))return R("async","keyword",Y)}return R("variable","variable",Y)}}function J(v){return function(E,V){var Y=!1,O;if(p&&E.peek()=="@"&&E.match(M))return V.tokenize=G,R("jsonld-keyword","meta");for(;(O=E.next())!=null&&!(O==v&&!Y);)Y=!Y&&O=="\\";return Y||(V.tokenize=G),R("string","string")}}function q(v,E){for(var V=!1,Y;Y=v.next();){if(Y=="/"&&V){E.tokenize=G;break}V=Y=="*"}return R("comment","comment")}function te(v,E){for(var V=!1,Y;(Y=v.next())!=null;){if(!V&&(Y=="`"||Y=="$"&&v.eat("{"))){E.tokenize=G;break}V=!V&&Y=="\\"}return R("quasi","string-2",v.current())}var ae="([{}])";function _(v,E){E.fatArrowAt&&(E.fatArrowAt=null);var V=v.string.indexOf("=>",v.start);if(!(V<0)){if(T){var Y=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(v.string.slice(v.start,V));Y&&(V=Y.index)}for(var O=0,fe=!1,Pe=V-1;Pe>=0;--Pe){var Rt=v.string.charAt(Pe),zt=ae.indexOf(Rt);if(zt>=0&&zt<3){if(!O){++Pe;break}if(--O==0){Rt=="("&&(fe=!0);break}}else if(zt>=3&&zt<6)++O;else if(U.test(Rt))fe=!0;else if(/["'\/`]/.test(Rt))for(;;--Pe){if(Pe==0)return;var ui=v.string.charAt(Pe-1);if(ui==Rt&&v.string.charAt(Pe-2)!="\\"){Pe--;break}}else if(fe&&!O){++Pe;break}}fe&&!O&&(E.fatArrowAt=Pe)}}var w={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,import:!0,"jsonld-keyword":!0};function P(v,E,V,Y,O,fe){this.indented=v,this.column=E,this.type=V,this.prev=O,this.info=fe,Y!=null&&(this.align=Y)}function $(v,E){if(!y)return!1;for(var V=v.localVars;V;V=V.next)if(V.name==E)return!0;for(var Y=v.context;Y;Y=Y.prev)for(var V=Y.vars;V;V=V.next)if(V.name==E)return!0}function pe(v,E,V,Y,O){var fe=v.cc;for(k.state=v,k.stream=O,k.marked=null,k.cc=fe,k.style=E,v.lexical.hasOwnProperty("align")||(v.lexical.align=!0);;){var Pe=fe.length?fe.pop():g?ue:ye;if(Pe(V,Y)){for(;fe.length&&fe[fe.length-1].lex;)fe.pop()();return k.marked?k.marked:V=="variable"&&$(v,Y)?"variable-2":E}}}var k={state:null,column:null,marked:null,cc:null};function oe(){for(var v=arguments.length-1;v>=0;v--)k.cc.push(arguments[v])}function x(){return oe.apply(null,arguments),!0}function ee(v,E){for(var V=E;V;V=V.next)if(V.name==v)return!0;return!1}function D(v){var E=k.state;if(k.marked="def",!!y){if(E.context){if(E.lexical.info=="var"&&E.context&&E.context.block){var V=ce(v,E.context);if(V!=null){E.context=V;return}}else if(!ee(v,E.localVars)){E.localVars=new Re(v,E.localVars);return}}a.globalVars&&!ee(v,E.globalVars)&&(E.globalVars=new Re(v,E.globalVars))}}function ce(v,E){if(E)if(E.block){var V=ce(v,E.prev);return V?V==E.prev?E:new Oe(V,E.vars,!0):null}else return ee(v,E.vars)?E:new Oe(E.prev,new Re(v,E.vars),!1);else return null}function ge(v){return v=="public"||v=="private"||v=="protected"||v=="abstract"||v=="readonly"}function Oe(v,E,V){this.prev=v,this.vars=E,this.block=V}function Re(v,E){this.name=v,this.next=E}var we=new Re("this",new Re("arguments",null));function re(){k.state.context=new Oe(k.state.context,k.state.localVars,!1),k.state.localVars=we}function Ze(){k.state.context=new Oe(k.state.context,k.state.localVars,!0),k.state.localVars=null}re.lex=Ze.lex=!0;function Ce(){k.state.localVars=k.state.context.vars,k.state.context=k.state.context.prev}Ce.lex=!0;function ve(v,E){var V=function(){var Y=k.state,O=Y.indented;if(Y.lexical.type=="stat")O=Y.lexical.indented;else for(var fe=Y.lexical;fe&&fe.type==")"&&fe.align;fe=fe.prev)O=fe.indented;Y.lexical=new P(O,k.stream.column(),v,null,Y.lexical,E)};return V.lex=!0,V}function se(){var v=k.state;v.lexical.prev&&(v.lexical.type==")"&&(v.indented=v.lexical.indented),v.lexical=v.lexical.prev)}se.lex=!0;function le(v){function E(V){return V==v?x():v==";"||V=="}"||V==")"||V=="]"?oe():x(E)}return E}function ye(v,E){return v=="var"?x(ve("vardef",E),rt,le(";"),se):v=="keyword a"?x(ve("form"),Je,ye,se):v=="keyword b"?x(ve("form"),ye,se):v=="keyword d"?k.stream.match(/^\s*$/,!1)?x():x(ve("stat"),Le,le(";"),se):v=="debugger"?x(le(";")):v=="{"?x(ve("}"),Ze,ft,se,Ce):v==";"?x():v=="if"?(k.state.lexical.info=="else"&&k.state.cc[k.state.cc.length-1]==se&&k.state.cc.pop()(),x(ve("form"),Je,ye,se,en)):v=="function"?x(jt):v=="for"?x(ve("form"),Ze,li,ye,Ce,se):v=="class"||T&&E=="interface"?(k.marked="keyword",x(ve("form",v=="class"?v:E),tn,se)):v=="variable"?T&&E=="declare"?(k.marked="keyword",x(ye)):T&&(E=="module"||E=="enum"||E=="type")&&k.stream.match(/^\s*\w/,!1)?(k.marked="keyword",E=="enum"?x(de):E=="type"?x(xn,le("operator"),Ne,le(";")):x(ve("form"),pt,le("{"),ve("}"),ft,se,se)):T&&E=="namespace"?(k.marked="keyword",x(ve("form"),ue,ye,se)):T&&E=="abstract"?(k.marked="keyword",x(ye)):x(ve("stat"),Qt):v=="switch"?x(ve("form"),Je,le("{"),ve("}","switch"),Ze,ft,se,se,Ce):v=="case"?x(ue,le(":")):v=="default"?x(le(":")):v=="catch"?x(ve("form"),re,Ge,ye,se,Ce):v=="export"?x(ve("stat"),Tn,se):v=="import"?x(ve("stat"),N,se):v=="async"?x(ye):E=="@"?x(ue,ye):oe(ve("stat"),ue,le(";"),se)}function Ge(v){if(v=="(")return x(lr,le(")"))}function ue(v,E){return Me(v,E,!1)}function Fe(v,E){return Me(v,E,!0)}function Je(v){return v!="("?oe():x(ve(")"),Le,le(")"),se)}function Me(v,E,V){if(k.state.fatArrowAt==k.stream.start){var Y=V?It:Te;if(v=="(")return x(re,ve(")"),qe(lr,")"),se,le("=>"),Y,Ce);if(v=="variable")return oe(re,pt,le("=>"),Y,Ce)}var O=V?De:_e;return w.hasOwnProperty(v)?x(O):v=="function"?x(jt,O):v=="class"||T&&E=="interface"?(k.marked="keyword",x(ve("form"),Tr,se)):v=="keyword c"||v=="async"?x(V?Fe:ue):v=="("?x(ve(")"),Le,le(")"),se,O):v=="operator"||v=="spread"?x(V?Fe:ue):v=="["?x(ve("]"),Ue,se,O):v=="{"?kt(Xe,"}",null,O):v=="quasi"?oe(Be,O):v=="new"?x(Et(V)):x()}function Le(v){return v.match(/[;\}\)\],]/)?oe():oe(ue)}function _e(v,E){return v==","?x(Le):De(v,E,!1)}function De(v,E,V){var Y=V==!1?_e:De,O=V==!1?ue:Fe;if(v=="=>")return x(re,V?It:Te,Ce);if(v=="operator")return/\+\+|--/.test(E)||T&&E=="!"?x(Y):T&&E=="<"&&k.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?x(ve(">"),qe(Ne,">"),se,Y):E=="?"?x(ue,le(":"),O):x(O);if(v=="quasi")return oe(Be,Y);if(v!=";"){if(v=="(")return kt(Fe,")","call",Y);if(v==".")return x(ze,Y);if(v=="[")return x(ve("]"),Le,le("]"),se,Y);if(T&&E=="as")return k.marked="keyword",x(Ne,Y);if(v=="regexp")return k.state.lastType=k.marked="operator",k.stream.backUp(k.stream.pos-k.stream.start-1),x(O)}}function Be(v,E){return v!="quasi"?oe():E.slice(E.length-2)!="${"?x(Be):x(Le,Ve)}function Ve(v){if(v=="}")return k.marked="string-2",k.state.tokenize=te,x(Be)}function Te(v){return _(k.stream,k.state),oe(v=="{"?ye:ue)}function It(v){return _(k.stream,k.state),oe(v=="{"?ye:Fe)}function Et(v){return function(E){return E=="."?x(v?lt:mr):E=="variable"&&T?x(yt,v?De:_e):oe(v?Fe:ue)}}function mr(v,E){if(E=="target")return k.marked="keyword",x(_e)}function lt(v,E){if(E=="target")return k.marked="keyword",x(De)}function Qt(v){return v==":"?x(se,ye):oe(_e,le(";"),se)}function ze(v){if(v=="variable")return k.marked="property",x()}function Xe(v,E){if(v=="async")return k.marked="property",x(Xe);if(v=="variable"||k.style=="keyword"){if(k.marked="property",E=="get"||E=="set")return x(mt);var V;return T&&k.state.fatArrowAt==k.stream.start&&(V=k.stream.match(/^\s*:\s*/,!1))&&(k.state.fatArrowAt=k.stream.pos+V[0].length),x(ut)}else{if(v=="number"||v=="string")return k.marked=p?"property":k.style+" property",x(ut);if(v=="jsonld-keyword")return x(ut);if(T&&ge(E))return k.marked="keyword",x(Xe);if(v=="[")return x(ue,Mt,le("]"),ut);if(v=="spread")return x(Fe,ut);if(E=="*")return k.marked="keyword",x(Xe);if(v==":")return oe(ut)}}function mt(v){return v!="variable"?oe(ut):(k.marked="property",x(jt))}function ut(v){if(v==":")return x(Fe);if(v=="(")return oe(jt)}function qe(v,E,V){function Y(O,fe){if(V?V.indexOf(O)>-1:O==","){var Pe=k.state.lexical;return Pe.info=="call"&&(Pe.pos=(Pe.pos||0)+1),x(function(Rt,zt){return Rt==E||zt==E?oe():oe(v)},Y)}return O==E||fe==E?x():V&&V.indexOf(";")>-1?oe(v):x(le(E))}return function(O,fe){return O==E||fe==E?x():oe(v,Y)}}function kt(v,E,V){for(var Y=3;Y<arguments.length;Y++)k.cc.push(arguments[Y]);return x(ve(E,V),qe(v,E),se)}function ft(v){return v=="}"?x():oe(ye,ft)}function Mt(v,E){if(T){if(v==":")return x(Ne);if(E=="?")return x(Mt)}}function br(v,E){if(T&&(v==":"||E=="in"))return x(Ne)}function vr(v){if(T&&v==":")return k.stream.match(/^\s*\w+\s+is\b/,!1)?x(ue,vn,Ne):x(Ne)}function vn(v,E){if(E=="is")return k.marked="keyword",x()}function Ne(v,E){if(E=="keyof"||E=="typeof"||E=="infer"||E=="readonly")return k.marked="keyword",x(E=="typeof"?Fe:Ne);if(v=="variable"||E=="void")return k.marked="type",x(sr);if(E=="|"||E=="&")return x(Ne);if(v=="string"||v=="number"||v=="atom")return x(sr);if(v=="[")return x(ve("]"),qe(Ne,"]",","),se,sr);if(v=="{")return x(ve("}"),Ie,se,sr);if(v=="(")return x(qe($e,")"),Sr,sr);if(v=="<")return x(qe(Ne,">"),Ne);if(v=="quasi")return oe(Ct,sr)}function Sr(v){if(v=="=>")return x(Ne)}function Ie(v){return v.match(/[\}\)\]]/)?x():v==","||v==";"?x(Ie):oe(yr,Ie)}function yr(v,E){if(v=="variable"||k.style=="keyword")return k.marked="property",x(yr);if(E=="?"||v=="number"||v=="string")return x(yr);if(v==":")return x(Ne);if(v=="[")return x(le("variable"),br,le("]"),yr);if(v=="(")return oe(wr,yr);if(!v.match(/[;\}\)\],]/))return x()}function Ct(v,E){return v!="quasi"?oe():E.slice(E.length-2)!="${"?x(Ct):x(Ne,Ke)}function Ke(v){if(v=="}")return k.marked="string-2",k.state.tokenize=te,x(Ct)}function $e(v,E){return v=="variable"&&k.stream.match(/^\s*[?:]/,!1)||E=="?"?x($e):v==":"?x(Ne):v=="spread"?x($e):oe(Ne)}function sr(v,E){if(E=="<")return x(ve(">"),qe(Ne,">"),se,sr);if(E=="|"||v=="."||E=="&")return x(Ne);if(v=="[")return x(Ne,le("]"),sr);if(E=="extends"||E=="implements")return k.marked="keyword",x(Ne);if(E=="?")return x(Ne,le(":"),Ne)}function yt(v,E){if(E=="<")return x(ve(">"),qe(Ne,">"),se,sr)}function xr(){return oe(Ne,At)}function At(v,E){if(E=="=")return x(Ne)}function rt(v,E){return E=="enum"?(k.marked="keyword",x(de)):oe(pt,Mt,Yt,si)}function pt(v,E){if(T&&ge(E))return k.marked="keyword",x(pt);if(v=="variable")return D(E),x();if(v=="spread")return x(pt);if(v=="[")return kt(yn,"]");if(v=="{")return kt(Wr,"}")}function Wr(v,E){return v=="variable"&&!k.stream.match(/^\s*:/,!1)?(D(E),x(Yt)):(v=="variable"&&(k.marked="property"),v=="spread"?x(pt):v=="}"?oe():v=="["?x(ue,le("]"),le(":"),Wr):x(le(":"),pt,Yt))}function yn(){return oe(pt,Yt)}function Yt(v,E){if(E=="=")return x(Fe)}function si(v){if(v==",")return x(rt)}function en(v,E){if(v=="keyword b"&&E=="else")return x(ve("form","else"),ye,se)}function li(v,E){if(E=="await")return x(li);if(v=="(")return x(ve(")"),Pt,se)}function Pt(v){return v=="var"?x(rt,Ht):v=="variable"?x(Ht):oe(Ht)}function Ht(v,E){return v==")"?x():v==";"?x(Ht):E=="in"||E=="of"?(k.marked="keyword",x(ue,Ht)):oe(ue,Ht)}function jt(v,E){if(E=="*")return k.marked="keyword",x(jt);if(v=="variable")return D(E),x(jt);if(v=="(")return x(re,ve(")"),qe(lr,")"),se,vr,ye,Ce);if(T&&E=="<")return x(ve(">"),qe(xr,">"),se,jt)}function wr(v,E){if(E=="*")return k.marked="keyword",x(wr);if(v=="variable")return D(E),x(wr);if(v=="(")return x(re,ve(")"),qe(lr,")"),se,vr,Ce);if(T&&E=="<")return x(ve(">"),qe(xr,">"),se,wr)}function xn(v,E){if(v=="keyword"||v=="variable")return k.marked="type",x(xn);if(E=="<")return x(ve(">"),qe(xr,">"),se)}function lr(v,E){return E=="@"&&x(ue,lr),v=="spread"?x(lr):T&&ge(E)?(k.marked="keyword",x(lr)):T&&v=="this"?x(Mt,Yt):oe(pt,Mt,Yt)}function Tr(v,E){return v=="variable"?tn(v,E):ur(v,E)}function tn(v,E){if(v=="variable")return D(E),x(ur)}function ur(v,E){if(E=="<")return x(ve(">"),qe(xr,">"),se,ur);if(E=="extends"||E=="implements"||T&&v==",")return E=="implements"&&(k.marked="keyword"),x(T?Ne:ue,ur);if(v=="{")return x(ve("}"),fr,se)}function fr(v,E){if(v=="async"||v=="variable"&&(E=="static"||E=="get"||E=="set"||T&&ge(E))&&k.stream.match(/^\s+#?[\w$\xa1-\uffff]/,!1))return k.marked="keyword",x(fr);if(v=="variable"||k.style=="keyword")return k.marked="property",x(Dr,fr);if(v=="number"||v=="string")return x(Dr,fr);if(v=="[")return x(ue,Mt,le("]"),Dr,fr);if(E=="*")return k.marked="keyword",x(fr);if(T&&v=="(")return oe(wr,fr);if(v==";"||v==",")return x(fr);if(v=="}")return x();if(E=="@")return x(ue,fr)}function Dr(v,E){if(E=="!"||E=="?")return x(Dr);if(v==":")return x(Ne,Yt);if(E=="=")return x(Fe);var V=k.state.lexical.prev,Y=V&&V.info=="interface";return oe(Y?wr:jt)}function Tn(v,E){return E=="*"?(k.marked="keyword",x(dt,le(";"))):E=="default"?(k.marked="keyword",x(ue,le(";"))):v=="{"?x(qe(xe,"}"),dt,le(";")):oe(ye)}function xe(v,E){if(E=="as")return k.marked="keyword",x(le("variable"));if(v=="variable")return oe(Fe,xe)}function N(v){return v=="string"?x():v=="("?oe(ue):v=="."?oe(_e):oe(K,be,dt)}function K(v,E){return v=="{"?kt(K,"}"):(v=="variable"&&D(E),E=="*"&&(k.marked="keyword"),x(Ye))}function be(v){if(v==",")return x(K,be)}function Ye(v,E){if(E=="as")return k.marked="keyword",x(K)}function dt(v,E){if(E=="from")return k.marked="keyword",x(ue)}function Ue(v){return v=="]"?x():oe(qe(Fe,"]"))}function de(){return oe(ve("form"),pt,le("{"),ve("}"),qe(_t,"}"),se,se)}function _t(){return oe(pt,Yt)}function Cr(v,E){return v.lastType=="operator"||v.lastType==","||F.test(E.charAt(0))||/[,.]/.test(E.charAt(0))}function Dt(v,E,V){return E.tokenize==G&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(E.lastType)||E.lastType=="quasi"&&/\{\s*$/.test(v.string.slice(0,v.pos-(V||0)))}return{startState:function(v){var E={tokenize:G,lastType:"sof",cc:[],lexical:new P((v||0)-l,0,"block",!1),localVars:a.localVars,context:a.localVars&&new Oe(null,null,!1),indented:v||0};return a.globalVars&&typeof a.globalVars=="object"&&(E.globalVars=a.globalVars),E},token:function(v,E){if(v.sol()&&(E.lexical.hasOwnProperty("align")||(E.lexical.align=!1),E.indented=v.indentation(),_(v,E)),E.tokenize!=q&&v.eatSpace())return null;var V=E.tokenize(v,E);return S=="comment"?V:(E.lastType=S=="operator"&&(Z=="++"||Z=="--")?"incdec":S,pe(E,V,S,Z,v))},indent:function(v,E){if(v.tokenize==q||v.tokenize==te)return r.Pass;if(v.tokenize!=G)return 0;var V=E&&E.charAt(0),Y=v.lexical,O;if(!/^\s*else\b/.test(E))for(var fe=v.cc.length-1;fe>=0;--fe){var Pe=v.cc[fe];if(Pe==se)Y=Y.prev;else if(Pe!=en&&Pe!=Ce)break}for(;(Y.type=="stat"||Y.type=="form")&&(V=="}"||(O=v.cc[v.cc.length-1])&&(O==_e||O==De)&&!/^[,\.=+\-*:?[\(]/.test(E));)Y=Y.prev;c&&Y.type==")"&&Y.prev.type=="stat"&&(Y=Y.prev);var Rt=Y.type,zt=V==Rt;return Rt=="vardef"?Y.indented+(v.lastType=="operator"||v.lastType==","?Y.info.length+1:0):Rt=="form"&&V=="{"?Y.indented:Rt=="form"?Y.indented+l:Rt=="stat"?Y.indented+(Cr(v,E)?c||l:0):Y.info=="switch"&&!zt&&a.doubleIndentSwitch!=!1?Y.indented+(/^(?:case|default)\b/.test(E)?l:2*l):Y.align?Y.column+(zt?0:1):Y.indented+(zt?0:l)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:g?null:"/*",blockCommentEnd:g?null:"*/",blockCommentContinue:g?null:" * ",lineComment:g?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:g?"json":"javascript",jsonldMode:p,jsonMode:g,expressionAllowed:Dt,skipExpression:function(v){pe(v,"atom","atom","true",new r.StringStream("",2,null))}}}),r.registerHelper("wordChars","javascript",/[\w$]/),r.defineMIME("text/javascript","javascript"),r.defineMIME("text/ecmascript","javascript"),r.defineMIME("application/javascript","javascript"),r.defineMIME("application/x-javascript","javascript"),r.defineMIME("application/ecmascript","javascript"),r.defineMIME("application/json",{name:"javascript",json:!0}),r.defineMIME("application/x-json",{name:"javascript",json:!0}),r.defineMIME("application/manifest+json",{name:"javascript",json:!0}),r.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),r.defineMIME("text/typescript",{name:"javascript",typescript:!0}),r.defineMIME("application/typescript",{name:"javascript",typescript:!0})})});var __={};Tb(__,{Parser:()=>Us,Yasr:()=>$r,default:()=>A_,registerPlugin:()=>C_});var mm=Ar(Hc());var Sb=typeof global=="object"&&global&&global.Object===Object&&global,Oa=Sb;var wb=typeof self=="object"&&self&&self.Object===Object&&self,Lb=Oa||wb||Function("return this")(),Tt=Lb;var Fb=Tt.Symbol,rr=Fb;var Jc=Object.prototype,Bb=Jc.hasOwnProperty,Ub=Jc.toString,Lo=rr?rr.toStringTag:void 0;function kb(r){var n=Bb.call(r,Lo),a=r[Lo];try{r[Lo]=void 0;var l=!0}catch{}var c=Ub.call(r);return l&&(n?r[Lo]=a:delete r[Lo]),c}var Xc=kb;var Mb=Object.prototype,Gb=Mb.toString;function Ob(r){return Gb.call(r)}var Yc=Ob;var Wb="[object Null]",Db="[object Undefined]",jc=rr?rr.toStringTag:void 0;function Zb(r){return r==null?r===void 0?Db:Wb:jc&&jc in Object(r)?Xc(r):Yc(r)}var Er=Zb;function Vb(r){return r!=null&&typeof r=="object"}var Bt=Vb;var Qb="[object Symbol]";function Pb(r){return typeof r=="symbol"||Bt(r)&&Er(r)==Qb}var wi=Pb;function Hb(r,n){for(var a=-1,l=r==null?0:r.length,c=Array(l);++a<l;)c[a]=n(r[a],a,r);return c}var zc=Hb;var Jb=Array.isArray,nt=Jb;var Xb=1/0,qc=rr?rr.prototype:void 0,Kc=qc?qc.toString:void 0;function $c(r){if(typeof r=="string")return r;if(nt(r))return zc(r,$c)+"";if(wi(r))return Kc?Kc.call(r):"";var n=r+"";return n=="0"&&1/r==-Xb?"-0":n}var ed=$c;function Yb(r){var n=typeof r;return r!=null&&(n=="object"||n=="function")}var Ot=Yb;function jb(r){return r}var Li=jb;var zb="[object AsyncFunction]",qb="[object Function]",Kb="[object GeneratorFunction]",$b="[object Proxy]";function ev(r){if(!Ot(r))return!1;var n=Er(r);return n==qb||n==Kb||n==zb||n==$b}var Fi=ev;var tv=Tt["__core-js_shared__"],Wa=tv;var td=function(){var r=/[^.]+$/.exec(Wa&&Wa.keys&&Wa.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}();function rv(r){return!!td&&td in r}var rd=rv;var nv=Function.prototype,iv=nv.toString;function ov(r){if(r!=null){try{return iv.call(r)}catch{}try{return r+""}catch{}}return""}var un=ov;var av=/[\\^$.*+?()[\]{}|]/g,sv=/^\[object .+?Constructor\]$/,lv=Function.prototype,uv=Object.prototype,fv=lv.toString,cv=uv.hasOwnProperty,dv=RegExp("^"+fv.call(cv).replace(av,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function hv(r){if(!Ot(r)||rd(r))return!1;var n=Fi(r)?dv:sv;return n.test(un(r))}var nd=hv;function pv(r,n){return r?.[n]}var id=pv;function gv(r,n){var a=id(r,n);return nd(a)?a:void 0}var hr=gv;var mv=hr(Tt,"WeakMap"),Da=mv;var od=Object.create,bv=function(){function r(){}return function(n){if(!Ot(n))return{};if(od)return od(n);r.prototype=n;var a=new r;return r.prototype=void 0,a}}(),ad=bv;function vv(r,n,a){switch(a.length){case 0:return r.call(n);case 1:return r.call(n,a[0]);case 2:return r.call(n,a[0],a[1]);case 3:return r.call(n,a[0],a[1],a[2])}return r.apply(n,a)}var sd=vv;function yv(r,n){var a=-1,l=r.length;for(n||(n=Array(l));++a<l;)n[a]=r[a];return n}var Za=yv;var xv=800,Tv=16,Iv=Date.now;function Ev(r){var n=0,a=0;return function(){var l=Iv(),c=Tv-(l-a);if(a=l,c>0){if(++n>=xv)return arguments[0]}else n=0;return r.apply(void 0,arguments)}}var ld=Ev;function Cv(r){return function(){return r}}var ud=Cv;var Av=function(){try{var r=hr(Object,"defineProperty");return r({},"",{}),r}catch{}}(),Bi=Av;var _v=Bi?function(r,n){return Bi(r,"toString",{configurable:!0,enumerable:!1,value:ud(n),writable:!0})}:Li,fd=_v;var Rv=ld(fd),cd=Rv;function Nv(r,n){for(var a=-1,l=r==null?0:r.length;++a<l&&n(r[a],a,r)!==!1;);return r}var dd=Nv;var Sv=9007199254740991,wv=/^(?:0|[1-9]\d*)$/;function Lv(r,n){var a=typeof r;return n=n??Sv,!!n&&(a=="number"||a!="symbol"&&wv.test(r))&&r>-1&&r%1==0&&r<n}var Ui=Lv;function Fv(r,n,a){n=="__proto__"&&Bi?Bi(r,n,{configurable:!0,enumerable:!0,value:a,writable:!0}):r[n]=a}var Ln=Fv;function Bv(r,n){return r===n||r!==r&&n!==n}var Hr=Bv;var Uv=Object.prototype,kv=Uv.hasOwnProperty;function Mv(r,n,a){var l=r[n];(!(kv.call(r,n)&&Hr(l,a))||a===void 0&&!(n in r))&&Ln(r,n,a)}var Va=Mv;function Gv(r,n,a,l){var c=!a;a||(a={});for(var p=-1,g=n.length;++p<g;){var y=n[p],T=l?l(a[y],r[y],y,a,r):void 0;T===void 0&&(T=r[y]),c?Ln(a,y,T):Va(a,y,T)}return a}var Jr=Gv;var hd=Math.max;function Ov(r,n,a){return n=hd(n===void 0?r.length-1:n,0),function(){for(var l=arguments,c=-1,p=hd(l.length-n,0),g=Array(p);++c<p;)g[c]=l[n+c];c=-1;for(var y=Array(n+1);++c<n;)y[c]=l[c];return y[n]=a(g),sd(r,this,y)}}var pd=Ov;function Wv(r,n){return cd(pd(r,n,Li),r+"")}var gd=Wv;var Dv=9007199254740991;function Zv(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=Dv}var ki=Zv;function Vv(r){return r!=null&&ki(r.length)&&!Fi(r)}var _r=Vv;function Qv(r,n,a){if(!Ot(a))return!1;var l=typeof n;return(l=="number"?_r(a)&&Ui(n,a.length):l=="string"&&n in a)?Hr(a[n],r):!1}var md=Qv;function Pv(r){return gd(function(n,a){var l=-1,c=a.length,p=c>1?a[c-1]:void 0,g=c>2?a[2]:void 0;for(p=r.length>3&&typeof p=="function"?(c--,p):void 0,g&&md(a[0],a[1],g)&&(p=c<3?void 0:p,c=1),n=Object(n);++l<c;){var y=a[l];y&&r(n,y,l,p)}return n})}var bd=Pv;var Hv=Object.prototype;function Jv(r){var n=r&&r.constructor,a=typeof n=="function"&&n.prototype||Hv;return r===a}var Fn=Jv;function Xv(r,n){for(var a=-1,l=Array(r);++a<r;)l[a]=n(a);return l}var vd=Xv;var Yv="[object Arguments]";function jv(r){return Bt(r)&&Er(r)==Yv}var Fl=jv;var yd=Object.prototype,zv=yd.hasOwnProperty,qv=yd.propertyIsEnumerable,Kv=Fl(function(){return arguments}())?Fl:function(r){return Bt(r)&&zv.call(r,"callee")&&!qv.call(r,"callee")},fn=Kv;function $v(){return!1}var xd=$v;var Ed=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Td=Ed&&typeof module=="object"&&module&&!module.nodeType&&module,ey=Td&&Td.exports===Ed,Id=ey?Tt.Buffer:void 0,ty=Id?Id.isBuffer:void 0,ry=ty||xd,kr=ry;var ny="[object Arguments]",iy="[object Array]",oy="[object Boolean]",ay="[object Date]",sy="[object Error]",ly="[object Function]",uy="[object Map]",fy="[object Number]",cy="[object Object]",dy="[object RegExp]",hy="[object Set]",py="[object String]",gy="[object WeakMap]",my="[object ArrayBuffer]",by="[object DataView]",vy="[object Float32Array]",yy="[object Float64Array]",xy="[object Int8Array]",Ty="[object Int16Array]",Iy="[object Int32Array]",Ey="[object Uint8Array]",Cy="[object Uint8ClampedArray]",Ay="[object Uint16Array]",_y="[object Uint32Array]",st={};st[vy]=st[yy]=st[xy]=st[Ty]=st[Iy]=st[Ey]=st[Cy]=st[Ay]=st[_y]=!0;st[ny]=st[iy]=st[my]=st[oy]=st[by]=st[ay]=st[sy]=st[ly]=st[uy]=st[fy]=st[cy]=st[dy]=st[hy]=st[py]=st[gy]=!1;function Ry(r){return Bt(r)&&ki(r.length)&&!!st[Er(r)]}var Cd=Ry;function Ny(r){return function(n){return r(n)}}var Mi=Ny;var Ad=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Fo=Ad&&typeof module=="object"&&module&&!module.nodeType&&module,Sy=Fo&&Fo.exports===Ad,Bl=Sy&&Oa.process,wy=function(){try{var r=Fo&&Fo.require&&Fo.require("util").types;return r||Bl&&Bl.binding&&Bl.binding("util")}catch{}}(),cn=wy;var _d=cn&&cn.isTypedArray,Ly=_d?Mi(_d):Cd,Bn=Ly;var Fy=Object.prototype,By=Fy.hasOwnProperty;function Uy(r,n){var a=nt(r),l=!a&&fn(r),c=!a&&!l&&kr(r),p=!a&&!l&&!c&&Bn(r),g=a||l||c||p,y=g?vd(r.length,String):[],T=y.length;for(var U in r)(n||By.call(r,U))&&!(g&&(U=="length"||c&&(U=="offset"||U=="parent")||p&&(U=="buffer"||U=="byteLength"||U=="byteOffset")||Ui(U,T)))&&y.push(U);return y}var Qa=Uy;function ky(r,n){return function(a){return r(n(a))}}var Pa=ky;var My=Pa(Object.keys,Object),Rd=My;var Gy=Object.prototype,Oy=Gy.hasOwnProperty;function Wy(r){if(!Fn(r))return Rd(r);var n=[];for(var a in Object(r))Oy.call(r,a)&&a!="constructor"&&n.push(a);return n}var Ha=Wy;function Dy(r){return _r(r)?Qa(r):Ha(r)}var Xr=Dy;function Zy(r){var n=[];if(r!=null)for(var a in Object(r))n.push(a);return n}var Nd=Zy;var Vy=Object.prototype,Qy=Vy.hasOwnProperty;function Py(r){if(!Ot(r))return Nd(r);var n=Fn(r),a=[];for(var l in r)l=="constructor"&&(n||!Qy.call(r,l))||a.push(l);return a}var Sd=Py;function Hy(r){return _r(r)?Qa(r,!0):Sd(r)}var Yr=Hy;var Jy=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Xy=/^\w*$/;function Yy(r,n){if(nt(r))return!1;var a=typeof r;return a=="number"||a=="symbol"||a=="boolean"||r==null||wi(r)?!0:Xy.test(r)||!Jy.test(r)||n!=null&&r in Object(n)}var Gi=Yy;var jy=hr(Object,"create"),dn=jy;function zy(){this.__data__=dn?dn(null):{},this.size=0}var wd=zy;function qy(r){var n=this.has(r)&&delete this.__data__[r];return this.size-=n?1:0,n}var Ld=qy;var Ky="__lodash_hash_undefined__",$y=Object.prototype,ex=$y.hasOwnProperty;function tx(r){var n=this.__data__;if(dn){var a=n[r];return a===Ky?void 0:a}return ex.call(n,r)?n[r]:void 0}var Fd=tx;var rx=Object.prototype,nx=rx.hasOwnProperty;function ix(r){var n=this.__data__;return dn?n[r]!==void 0:nx.call(n,r)}var Bd=ix;var ox="__lodash_hash_undefined__";function ax(r,n){var a=this.__data__;return this.size+=this.has(r)?0:1,a[r]=dn&&n===void 0?ox:n,this}var Ud=ax;function Oi(r){var n=-1,a=r==null?0:r.length;for(this.clear();++n<a;){var l=r[n];this.set(l[0],l[1])}}Oi.prototype.clear=wd;Oi.prototype.delete=Ld;Oi.prototype.get=Fd;Oi.prototype.has=Bd;Oi.prototype.set=Ud;var Ul=Oi;function sx(){this.__data__=[],this.size=0}var kd=sx;function lx(r,n){for(var a=r.length;a--;)if(Hr(r[a][0],n))return a;return-1}var Un=lx;var ux=Array.prototype,fx=ux.splice;function cx(r){var n=this.__data__,a=Un(n,r);if(a<0)return!1;var l=n.length-1;return a==l?n.pop():fx.call(n,a,1),--this.size,!0}var Md=cx;function dx(r){var n=this.__data__,a=Un(n,r);return a<0?void 0:n[a][1]}var Gd=dx;function hx(r){return Un(this.__data__,r)>-1}var Od=hx;function px(r,n){var a=this.__data__,l=Un(a,r);return l<0?(++this.size,a.push([r,n])):a[l][1]=n,this}var Wd=px;function Wi(r){var n=-1,a=r==null?0:r.length;for(this.clear();++n<a;){var l=r[n];this.set(l[0],l[1])}}Wi.prototype.clear=kd;Wi.prototype.delete=Md;Wi.prototype.get=Gd;Wi.prototype.has=Od;Wi.prototype.set=Wd;var kn=Wi;var gx=hr(Tt,"Map"),Mn=gx;function mx(){this.size=0,this.__data__={hash:new Ul,map:new(Mn||kn),string:new Ul}}var Dd=mx;function bx(r){var n=typeof r;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?r!=="__proto__":r===null}var Zd=bx;function vx(r,n){var a=r.__data__;return Zd(n)?a[typeof n=="string"?"string":"hash"]:a.map}var Gn=vx;function yx(r){var n=Gn(this,r).delete(r);return this.size-=n?1:0,n}var Vd=yx;function xx(r){return Gn(this,r).get(r)}var Qd=xx;function Tx(r){return Gn(this,r).has(r)}var Pd=Tx;function Ix(r,n){var a=Gn(this,r),l=a.size;return a.set(r,n),this.size+=a.size==l?0:1,this}var Hd=Ix;function Di(r){var n=-1,a=r==null?0:r.length;for(this.clear();++n<a;){var l=r[n];this.set(l[0],l[1])}}Di.prototype.clear=Dd;Di.prototype.delete=Vd;Di.prototype.get=Qd;Di.prototype.has=Pd;Di.prototype.set=Hd;var qn=Di;var Ex="Expected a function";function kl(r,n){if(typeof r!="function"||n!=null&&typeof n!="function")throw new TypeError(Ex);var a=function(){var l=arguments,c=n?n.apply(this,l):l[0],p=a.cache;if(p.has(c))return p.get(c);var g=r.apply(this,l);return a.cache=p.set(c,g)||p,g};return a.cache=new(kl.Cache||qn),a}kl.Cache=qn;var Jd=kl;var Cx=500;function Ax(r){var n=Jd(r,function(l){return a.size===Cx&&a.clear(),l}),a=n.cache;return n}var Xd=Ax;var _x=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Rx=/\\(\\)?/g,Nx=Xd(function(r){var n=[];return r.charCodeAt(0)===46&&n.push(""),r.replace(_x,function(a,l,c,p){n.push(c?p.replace(Rx,"$1"):l||a)}),n}),Yd=Nx;function Sx(r){return r==null?"":ed(r)}var Zi=Sx;function wx(r,n){return nt(r)?r:Gi(r,n)?[r]:Yd(Zi(r))}var Ja=wx;var Lx=1/0;function Fx(r){if(typeof r=="string"||wi(r))return r;var n=r+"";return n=="0"&&1/r==-Lx?"-0":n}var On=Fx;function Bx(r,n){n=Ja(n,r);for(var a=0,l=n.length;r!=null&&a<l;)r=r[On(n[a++])];return a&&a==l?r:void 0}var Xa=Bx;function Ux(r,n,a){var l=r==null?void 0:Xa(r,n);return l===void 0?a:l}var jd=Ux;function kx(r,n){for(var a=-1,l=n.length,c=r.length;++a<l;)r[c+a]=n[a];return r}var Ya=kx;var Mx=Pa(Object.getPrototypeOf,Object),Vi=Mx;var Gx="[object Object]",Ox=Function.prototype,Wx=Object.prototype,zd=Ox.toString,Dx=Wx.hasOwnProperty,Zx=zd.call(Object);function Vx(r){if(!Bt(r)||Er(r)!=Gx)return!1;var n=Vi(r);if(n===null)return!0;var a=Dx.call(n,"constructor")&&n.constructor;return typeof a=="function"&&a instanceof a&&zd.call(a)==Zx}var qd=Vx;function Qx(r){return function(n){return r?.[n]}}var Kd=Qx;function Px(){this.__data__=new kn,this.size=0}var $d=Px;function Hx(r){var n=this.__data__,a=n.delete(r);return this.size=n.size,a}var eh=Hx;function Jx(r){return this.__data__.get(r)}var th=Jx;function Xx(r){return this.__data__.has(r)}var rh=Xx;var Yx=200;function jx(r,n){var a=this.__data__;if(a instanceof kn){var l=a.__data__;if(!Mn||l.length<Yx-1)return l.push([r,n]),this.size=++a.size,this;a=this.__data__=new qn(l)}return a.set(r,n),this.size=a.size,this}var nh=jx;function Qi(r){var n=this.__data__=new kn(r);this.size=n.size}Qi.prototype.clear=$d;Qi.prototype.delete=eh;Qi.prototype.get=th;Qi.prototype.has=rh;Qi.prototype.set=nh;var jr=Qi;function zx(r,n){return r&&Jr(n,Xr(n),r)}var ih=zx;function qx(r,n){return r&&Jr(n,Yr(n),r)}var oh=qx;var uh=typeof exports=="object"&&exports&&!exports.nodeType&&exports,ah=uh&&typeof module=="object"&&module&&!module.nodeType&&module,Kx=ah&&ah.exports===uh,sh=Kx?Tt.Buffer:void 0,lh=sh?sh.allocUnsafe:void 0;function $x(r,n){if(n)return r.slice();var a=r.length,l=lh?lh(a):new r.constructor(a);return r.copy(l),l}var ja=$x;function eT(r,n){for(var a=-1,l=r==null?0:r.length,c=0,p=[];++a<l;){var g=r[a];n(g,a,r)&&(p[c++]=g)}return p}var za=eT;function tT(){return[]}var qa=tT;var rT=Object.prototype,nT=rT.propertyIsEnumerable,fh=Object.getOwnPropertySymbols,iT=fh?function(r){return r==null?[]:(r=Object(r),za(fh(r),function(n){return nT.call(r,n)}))}:qa,Pi=iT;function oT(r,n){return Jr(r,Pi(r),n)}var ch=oT;var aT=Object.getOwnPropertySymbols,sT=aT?function(r){for(var n=[];r;)Ya(n,Pi(r)),r=Vi(r);return n}:qa,Ka=sT;function lT(r,n){return Jr(r,Ka(r),n)}var dh=lT;function uT(r,n,a){var l=n(r);return nt(r)?l:Ya(l,a(r))}var $a=uT;function fT(r){return $a(r,Xr,Pi)}var Bo=fT;function cT(r){return $a(r,Yr,Ka)}var hh=cT;var dT=hr(Tt,"DataView"),es=dT;var hT=hr(Tt,"Promise"),ts=hT;var pT=hr(Tt,"Set"),rs=pT;var ph="[object Map]",gT="[object Object]",gh="[object Promise]",mh="[object Set]",bh="[object WeakMap]",vh="[object DataView]",mT=un(es),bT=un(Mn),vT=un(ts),yT=un(rs),xT=un(Da),Kn=Er;(es&&Kn(new es(new ArrayBuffer(1)))!=vh||Mn&&Kn(new Mn)!=ph||ts&&Kn(ts.resolve())!=gh||rs&&Kn(new rs)!=mh||Da&&Kn(new Da)!=bh)&&(Kn=function(r){var n=Er(r),a=n==gT?r.constructor:void 0,l=a?un(a):"";if(l)switch(l){case mT:return vh;case bT:return ph;case vT:return gh;case yT:return mh;case xT:return bh}return n});var Mr=Kn;var TT=Object.prototype,IT=TT.hasOwnProperty;function ET(r){var n=r.length,a=new r.constructor(n);return n&&typeof r[0]=="string"&&IT.call(r,"index")&&(a.index=r.index,a.input=r.input),a}var yh=ET;var CT=Tt.Uint8Array,Hi=CT;function AT(r){var n=new r.constructor(r.byteLength);return new Hi(n).set(new Hi(r)),n}var Ji=AT;function _T(r,n){var a=n?Ji(r.buffer):r.buffer;return new r.constructor(a,r.byteOffset,r.byteLength)}var xh=_T;var RT=/\w*$/;function NT(r){var n=new r.constructor(r.source,RT.exec(r));return n.lastIndex=r.lastIndex,n}var Th=NT;var Ih=rr?rr.prototype:void 0,Eh=Ih?Ih.valueOf:void 0;function ST(r){return Eh?Object(Eh.call(r)):{}}var Ch=ST;function wT(r,n){var a=n?Ji(r.buffer):r.buffer;return new r.constructor(a,r.byteOffset,r.length)}var ns=wT;var LT="[object Boolean]",FT="[object Date]",BT="[object Map]",UT="[object Number]",kT="[object RegExp]",MT="[object Set]",GT="[object String]",OT="[object Symbol]",WT="[object ArrayBuffer]",DT="[object DataView]",ZT="[object Float32Array]",VT="[object Float64Array]",QT="[object Int8Array]",PT="[object Int16Array]",HT="[object Int32Array]",JT="[object Uint8Array]",XT="[object Uint8ClampedArray]",YT="[object Uint16Array]",jT="[object Uint32Array]";function zT(r,n,a){var l=r.constructor;switch(n){case WT:return Ji(r);case LT:case FT:return new l(+r);case DT:return xh(r,a);case ZT:case VT:case QT:case PT:case HT:case JT:case XT:case YT:case jT:return ns(r,a);case BT:return new l;case UT:case GT:return new l(r);case kT:return Th(r);case MT:return new l;case OT:return Ch(r)}}var Ah=zT;function qT(r){return typeof r.constructor=="function"&&!Fn(r)?ad(Vi(r)):{}}var is=qT;var KT="[object Map]";function $T(r){return Bt(r)&&Mr(r)==KT}var _h=$T;var Rh=cn&&cn.isMap,eI=Rh?Mi(Rh):_h,Nh=eI;var tI="[object Set]";function rI(r){return Bt(r)&&Mr(r)==tI}var Sh=rI;var wh=cn&&cn.isSet,nI=wh?Mi(wh):Sh,Lh=nI;var iI=1,oI=2,aI=4,Fh="[object Arguments]",sI="[object Array]",lI="[object Boolean]",uI="[object Date]",fI="[object Error]",Bh="[object Function]",cI="[object GeneratorFunction]",dI="[object Map]",hI="[object Number]",Uh="[object Object]",pI="[object RegExp]",gI="[object Set]",mI="[object String]",bI="[object Symbol]",vI="[object WeakMap]",yI="[object ArrayBuffer]",xI="[object DataView]",TI="[object Float32Array]",II="[object Float64Array]",EI="[object Int8Array]",CI="[object Int16Array]",AI="[object Int32Array]",_I="[object Uint8Array]",RI="[object Uint8ClampedArray]",NI="[object Uint16Array]",SI="[object Uint32Array]",it={};it[Fh]=it[sI]=it[yI]=it[xI]=it[lI]=it[uI]=it[TI]=it[II]=it[EI]=it[CI]=it[AI]=it[dI]=it[hI]=it[Uh]=it[pI]=it[gI]=it[mI]=it[bI]=it[_I]=it[RI]=it[NI]=it[SI]=!0;it[fI]=it[Bh]=it[vI]=!1;function os(r,n,a,l,c,p){var g,y=n&iI,T=n&oI,U=n&aI;if(a&&(g=c?a(r,l,c,p):a(r)),g!==void 0)return g;if(!Ot(r))return r;var A=nt(r);if(A){if(g=yh(r),!y)return Za(r,g)}else{var F=Mr(r),M=F==Bh||F==cI;if(kr(r))return ja(r,y);if(F==Uh||F==Fh||M&&!c){if(g=T||M?{}:is(r),!y)return T?dh(r,oh(g,r)):ch(r,ih(g,r))}else{if(!it[F])return c?r:{};g=Ah(r,F,y)}}p||(p=new jr);var X=p.get(r);if(X)return X;p.set(r,g),Lh(r)?r.forEach(function(R){g.add(os(R,n,a,R,r,p))}):Nh(r)&&r.forEach(function(R,G){g.set(G,os(R,n,a,G,r,p))});var S=U?T?hh:Bo:T?Yr:Xr,Z=A?void 0:S(r);return dd(Z||r,function(R,G){Z&&(G=R,R=r[G]),Va(g,G,os(R,n,a,G,r,p))}),g}var kh=os;var wI=1,LI=4;function FI(r){return kh(r,wI|LI)}var as=FI;var BI="__lodash_hash_undefined__";function UI(r){return this.__data__.set(r,BI),this}var Mh=UI;function kI(r){return this.__data__.has(r)}var Gh=kI;function ss(r){var n=-1,a=r==null?0:r.length;for(this.__data__=new qn;++n<a;)this.add(r[n])}ss.prototype.add=ss.prototype.push=Mh;ss.prototype.has=Gh;var Oh=ss;function MI(r,n){for(var a=-1,l=r==null?0:r.length;++a<l;)if(n(r[a],a,r))return!0;return!1}var Wh=MI;function GI(r,n){return r.has(n)}var Dh=GI;var OI=1,WI=2;function DI(r,n,a,l,c,p){var g=a&OI,y=r.length,T=n.length;if(y!=T&&!(g&&T>y))return!1;var U=p.get(r),A=p.get(n);if(U&&A)return U==n&&A==r;var F=-1,M=!0,X=a&WI?new Oh:void 0;for(p.set(r,n),p.set(n,r);++F<y;){var S=r[F],Z=n[F];if(l)var R=g?l(Z,S,F,n,r,p):l(S,Z,F,r,n,p);if(R!==void 0){if(R)continue;M=!1;break}if(X){if(!Wh(n,function(G,J){if(!Dh(X,J)&&(S===G||c(S,G,a,l,p)))return X.push(J)})){M=!1;break}}else if(!(S===Z||c(S,Z,a,l,p))){M=!1;break}}return p.delete(r),p.delete(n),M}var ls=DI;function ZI(r){var n=-1,a=Array(r.size);return r.forEach(function(l,c){a[++n]=[c,l]}),a}var Zh=ZI;function VI(r){var n=-1,a=Array(r.size);return r.forEach(function(l){a[++n]=l}),a}var Vh=VI;var QI=1,PI=2,HI="[object Boolean]",JI="[object Date]",XI="[object Error]",YI="[object Map]",jI="[object Number]",zI="[object RegExp]",qI="[object Set]",KI="[object String]",$I="[object Symbol]",eE="[object ArrayBuffer]",tE="[object DataView]",Qh=rr?rr.prototype:void 0,Ml=Qh?Qh.valueOf:void 0;function rE(r,n,a,l,c,p,g){switch(a){case tE:if(r.byteLength!=n.byteLength||r.byteOffset!=n.byteOffset)return!1;r=r.buffer,n=n.buffer;case eE:return!(r.byteLength!=n.byteLength||!p(new Hi(r),new Hi(n)));case HI:case JI:case jI:return Hr(+r,+n);case XI:return r.name==n.name&&r.message==n.message;case zI:case KI:return r==n+"";case YI:var y=Zh;case qI:var T=l&QI;if(y||(y=Vh),r.size!=n.size&&!T)return!1;var U=g.get(r);if(U)return U==n;l|=PI,g.set(r,n);var A=ls(y(r),y(n),l,c,p,g);return g.delete(r),A;case $I:if(Ml)return Ml.call(r)==Ml.call(n)}return!1}var Ph=rE;var nE=1,iE=Object.prototype,oE=iE.hasOwnProperty;function aE(r,n,a,l,c,p){var g=a&nE,y=Bo(r),T=y.length,U=Bo(n),A=U.length;if(T!=A&&!g)return!1;for(var F=T;F--;){var M=y[F];if(!(g?M in n:oE.call(n,M)))return!1}var X=p.get(r),S=p.get(n);if(X&&S)return X==n&&S==r;var Z=!0;p.set(r,n),p.set(n,r);for(var R=g;++F<T;){M=y[F];var G=r[M],J=n[M];if(l)var q=g?l(J,G,M,n,r,p):l(G,J,M,r,n,p);if(!(q===void 0?G===J||c(G,J,a,l,p):q)){Z=!1;break}R||(R=M=="constructor")}if(Z&&!R){var te=r.constructor,ae=n.constructor;te!=ae&&"constructor"in r&&"constructor"in n&&!(typeof te=="function"&&te instanceof te&&typeof ae=="function"&&ae instanceof ae)&&(Z=!1)}return p.delete(r),p.delete(n),Z}var Hh=aE;var sE=1,Jh="[object Arguments]",Xh="[object Array]",us="[object Object]",lE=Object.prototype,Yh=lE.hasOwnProperty;function uE(r,n,a,l,c,p){var g=nt(r),y=nt(n),T=g?Xh:Mr(r),U=y?Xh:Mr(n);T=T==Jh?us:T,U=U==Jh?us:U;var A=T==us,F=U==us,M=T==U;if(M&&kr(r)){if(!kr(n))return!1;g=!0,A=!1}if(M&&!A)return p||(p=new jr),g||Bn(r)?ls(r,n,a,l,c,p):Ph(r,n,T,a,l,c,p);if(!(a&sE)){var X=A&&Yh.call(r,"__wrapped__"),S=F&&Yh.call(n,"__wrapped__");if(X||S){var Z=X?r.value():r,R=S?n.value():n;return p||(p=new jr),c(Z,R,a,l,p)}}return M?(p||(p=new jr),Hh(r,n,a,l,c,p)):!1}var jh=uE;function zh(r,n,a,l,c){return r===n?!0:r==null||n==null||!Bt(r)&&!Bt(n)?r!==r&&n!==n:jh(r,n,a,l,zh,c)}var fs=zh;var fE=1,cE=2;function dE(r,n,a,l){var c=a.length,p=c,g=!l;if(r==null)return!p;for(r=Object(r);c--;){var y=a[c];if(g&&y[2]?y[1]!==r[y[0]]:!(y[0]in r))return!1}for(;++c<p;){y=a[c];var T=y[0],U=r[T],A=y[1];if(g&&y[2]){if(U===void 0&&!(T in r))return!1}else{var F=new jr;if(l)var M=l(U,A,T,r,n,F);if(!(M===void 0?fs(A,U,fE|cE,l,F):M))return!1}}return!0}var qh=dE;function hE(r){return r===r&&!Ot(r)}var cs=hE;function pE(r){for(var n=Xr(r),a=n.length;a--;){var l=n[a],c=r[l];n[a]=[l,c,cs(c)]}return n}var Kh=pE;function gE(r,n){return function(a){return a==null?!1:a[r]===n&&(n!==void 0||r in Object(a))}}var ds=gE;function mE(r){var n=Kh(r);return n.length==1&&n[0][2]?ds(n[0][0],n[0][1]):function(a){return a===r||qh(a,r,n)}}var $h=mE;function bE(r,n){return r!=null&&n in Object(r)}var ep=bE;function vE(r,n,a){n=Ja(n,r);for(var l=-1,c=n.length,p=!1;++l<c;){var g=On(n[l]);if(!(p=r!=null&&a(r,g)))break;r=r[g]}return p||++l!=c?p:(c=r==null?0:r.length,!!c&&ki(c)&&Ui(g,c)&&(nt(r)||fn(r)))}var tp=vE;function yE(r,n){return r!=null&&tp(r,n,ep)}var rp=yE;var xE=1,TE=2;function IE(r,n){return Gi(r)&&cs(n)?ds(On(r),n):function(a){var l=jd(a,r);return l===void 0&&l===n?rp(a,r):fs(n,l,xE|TE)}}var np=IE;function EE(r){return function(n){return n?.[r]}}var ip=EE;function CE(r){return function(n){return Xa(n,r)}}var op=CE;function AE(r){return Gi(r)?ip(On(r)):op(r)}var ap=AE;function _E(r){return typeof r=="function"?r:r==null?Li:typeof r=="object"?nt(r)?np(r[0],r[1]):$h(r):ap(r)}var hs=_E;function RE(r){return function(n,a,l){for(var c=-1,p=Object(n),g=l(n),y=g.length;y--;){var T=g[r?y:++c];if(a(p[T],T,p)===!1)break}return n}}var sp=RE;var NE=sp(),ps=NE;function SE(r,n){return r&&ps(r,n,Xr)}var gs=SE;function wE(r,n){return function(a,l){if(a==null)return a;if(!_r(a))return r(a,l);for(var c=a.length,p=n?c:-1,g=Object(a);(n?p--:++p<c)&&l(g[p],p,g)!==!1;);return a}}var lp=wE;var LE=lp(gs),up=LE;function FE(r,n,a){(a!==void 0&&!Hr(r[n],a)||a===void 0&&!(n in r))&&Ln(r,n,a)}var Uo=FE;function BE(r){return Bt(r)&&_r(r)}var fp=BE;function UE(r,n){if(!(n==="constructor"&&typeof r[n]=="function")&&n!="__proto__")return r[n]}var ko=UE;function kE(r){return Jr(r,Yr(r))}var cp=kE;function ME(r,n,a,l,c,p,g){var y=ko(r,a),T=ko(n,a),U=g.get(T);if(U){Uo(r,a,U);return}var A=p?p(y,T,a+"",r,n,g):void 0,F=A===void 0;if(F){var M=nt(T),X=!M&&kr(T),S=!M&&!X&&Bn(T);A=T,M||X||S?nt(y)?A=y:fp(y)?A=Za(y):X?(F=!1,A=ja(T,!0)):S?(F=!1,A=ns(T,!0)):A=[]:qd(T)||fn(T)?(A=y,fn(y)?A=cp(y):(!Ot(y)||Fi(y))&&(A=is(T))):F=!1}F&&(g.set(T,A),c(A,T,l,p,g),g.delete(T)),Uo(r,a,A)}var dp=ME;function hp(r,n,a,l,c){r!==n&&ps(n,function(p,g){if(c||(c=new jr),Ot(p))dp(r,n,g,a,hp,l,c);else{var y=l?l(ko(r,g),p,g+"",r,n,c):void 0;y===void 0&&(y=p),Uo(r,g,y)}},Yr)}var pp=hp;function GE(r,n){var a=[];return up(r,function(l,c,p){n(l,c,p)&&a.push(l)}),a}var gp=GE;function OE(r,n){var a=nt(r)?za:gp;return a(r,hs(n,3))}var Gl=OE;var WE="[object Map]",DE="[object Set]",ZE=Object.prototype,VE=ZE.hasOwnProperty;function QE(r){if(r==null)return!0;if(_r(r)&&(nt(r)||typeof r=="string"||typeof r.splice=="function"||kr(r)||Bn(r)||fn(r)))return!r.length;var n=Mr(r);if(n==WE||n==DE)return!r.size;if(Fn(r))return!Ha(r).length;for(var a in r)if(VE.call(r,a))return!1;return!0}var ms=QE;function PE(r,n){var a={};return n=hs(n,3),gs(r,function(l,c,p){Ln(a,c,n(l,c,p))}),a}var Mo=PE;var HE=bd(function(r,n,a){pp(r,n,a)}),Ol=HE;var JE={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},XE=Kd(JE),mp=XE;var bp=/&(?:amp|lt|gt|quot|#39);/g,YE=RegExp(bp.source);function jE(r){return r=Zi(r),r&&YE.test(r)?r.replace(bp,mp):r}var Wl=jE;var zE=0;function qE(r){var n=++zE;return Zi(r)+n}var Dl=qE;function Zl(){return{persistenceId:function(r){var n="",a=r.rootEl;for(a.id&&(n=a.id);a&&a!==document;a=a.parentNode)if(a){a.id&&(n=a.id);break}return"yasr_"+n},getPlainQueryLinkToEndpoint:void 0,persistencyExpire:60*60*24*30,persistenceLabelResponse:"response",persistenceLabelConfig:"config",maxPersistentResponseSize:1e5,prefixes:{},plugins:{},pluginOrder:["Table","response","Geo","Graph"],defaultPlugin:"Table"}}var{entries:_p,setPrototypeOf:vp,isFrozen:KE,getPrototypeOf:$E,getOwnPropertyDescriptor:eC}=Object,{freeze:ir,seal:Rr,create:Yl}=Object,{apply:jl,construct:zl}=typeof Reflect<"u"&&Reflect;ir||(ir=function(n){return n});Rr||(Rr=function(n){return n});jl||(jl=function(n,a){for(var l=arguments.length,c=new Array(l>2?l-2:0),p=2;p<l;p++)c[p-2]=arguments[p];return n.apply(a,c)});zl||(zl=function(n){for(var a=arguments.length,l=new Array(a>1?a-1:0),c=1;c<a;c++)l[c-1]=arguments[c];return new n(...l)});var bs=or(Array.prototype.forEach),tC=or(Array.prototype.lastIndexOf),yp=or(Array.prototype.pop),Go=or(Array.prototype.push),rC=or(Array.prototype.splice),ys=or(String.prototype.toLowerCase),Vl=or(String.prototype.toString),Ql=or(String.prototype.match),Oo=or(String.prototype.replace),nC=or(String.prototype.indexOf),iC=or(String.prototype.trim),Gr=or(Object.prototype.hasOwnProperty),nr=or(RegExp.prototype.test),Wo=oC(TypeError);function or(r){return function(n){n instanceof RegExp&&(n.lastIndex=0);for(var a=arguments.length,l=new Array(a>1?a-1:0),c=1;c<a;c++)l[c-1]=arguments[c];return jl(r,n,l)}}function oC(r){return function(){for(var n=arguments.length,a=new Array(n),l=0;l<n;l++)a[l]=arguments[l];return zl(r,a)}}function We(r,n){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ys;vp&&vp(r,null);let l=n.length;for(;l--;){let c=n[l];if(typeof c=="string"){let p=a(c);p!==c&&(KE(n)||(n[l]=p),c=p)}r[c]=!0}return r}function aC(r){for(let n=0;n<r.length;n++)Gr(r,n)||(r[n]=null);return r}function zr(r){let n=Yl(null);for(let[a,l]of _p(r))Gr(r,a)&&(Array.isArray(l)?n[a]=aC(l):l&&typeof l=="object"&&l.constructor===Object?n[a]=zr(l):n[a]=l);return n}function Do(r,n){for(;r!==null;){let l=eC(r,n);if(l){if(l.get)return or(l.get);if(typeof l.value=="function")return or(l.value)}r=$E(r)}function a(){return null}return a}var xp=ir(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Pl=ir(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Hl=ir(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),sC=ir(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Jl=ir(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),lC=ir(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Tp=ir(["#text"]),Ip=ir(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Xl=ir(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Ep=ir(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),vs=ir(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),uC=Rr(/\{\{[\w\W]*|[\w\W]*\}\}/gm),fC=Rr(/<%[\w\W]*|[\w\W]*%>/gm),cC=Rr(/\$\{[\w\W]*/gm),dC=Rr(/^data-[\-\w.\u00B7-\uFFFF]+$/),hC=Rr(/^aria-[\-\w]+$/),Rp=Rr(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),pC=Rr(/^(?:\w+script|data):/i),gC=Rr(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Np=Rr(/^html$/i),mC=Rr(/^[a-z][.\w]*(-[.\w]+)+$/i),Cp=Object.freeze({__proto__:null,ARIA_ATTR:hC,ATTR_WHITESPACE:gC,CUSTOM_ELEMENT:mC,DATA_ATTR:dC,DOCTYPE_NAME:Np,ERB_EXPR:fC,IS_ALLOWED_URI:Rp,IS_SCRIPT_OR_DATA:pC,MUSTACHE_EXPR:uC,TMPLIT_EXPR:cC}),Zo={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},bC=function(){return typeof window>"u"?null:window},vC=function(n,a){if(typeof n!="object"||typeof n.createPolicy!="function")return null;let l=null,c="data-tt-policy-suffix";a&&a.hasAttribute(c)&&(l=a.getAttribute(c));let p="dompurify"+(l?"#"+l:"");try{return n.createPolicy(p,{createHTML(g){return g},createScriptURL(g){return g}})}catch{return console.warn("TrustedTypes policy "+p+" could not be created."),null}},Ap=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Sp(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:bC(),n=xe=>Sp(xe);if(n.version="3.3.1",n.removed=[],!r||!r.document||r.document.nodeType!==Zo.document||!r.Element)return n.isSupported=!1,n;let{document:a}=r,l=a,c=l.currentScript,{DocumentFragment:p,HTMLTemplateElement:g,Node:y,Element:T,NodeFilter:U,NamedNodeMap:A=r.NamedNodeMap||r.MozNamedAttrMap,HTMLFormElement:F,DOMParser:M,trustedTypes:X}=r,S=T.prototype,Z=Do(S,"cloneNode"),R=Do(S,"remove"),G=Do(S,"nextSibling"),J=Do(S,"childNodes"),q=Do(S,"parentNode");if(typeof g=="function"){let xe=a.createElement("template");xe.content&&xe.content.ownerDocument&&(a=xe.content.ownerDocument)}let te,ae="",{implementation:_,createNodeIterator:w,createDocumentFragment:P,getElementsByTagName:$}=a,{importNode:pe}=l,k=Ap();n.isSupported=typeof _p=="function"&&typeof q=="function"&&_&&_.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:oe,ERB_EXPR:x,TMPLIT_EXPR:ee,DATA_ATTR:D,ARIA_ATTR:ce,IS_SCRIPT_OR_DATA:ge,ATTR_WHITESPACE:Oe,CUSTOM_ELEMENT:Re}=Cp,{IS_ALLOWED_URI:we}=Cp,re=null,Ze=We({},[...xp,...Pl,...Hl,...Jl,...Tp]),Ce=null,ve=We({},[...Ip,...Xl,...Ep,...vs]),se=Object.seal(Yl(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),le=null,ye=null,Ge=Object.seal(Yl(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),ue=!0,Fe=!0,Je=!1,Me=!0,Le=!1,_e=!0,De=!1,Be=!1,Ve=!1,Te=!1,It=!1,Et=!1,mr=!0,lt=!1,Qt="user-content-",ze=!0,Xe=!1,mt={},ut=null,qe=We({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),kt=null,ft=We({},["audio","video","img","source","image","track"]),Mt=null,br=We({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),vr="http://www.w3.org/1998/Math/MathML",vn="http://www.w3.org/2000/svg",Ne="http://www.w3.org/1999/xhtml",Sr=Ne,Ie=!1,yr=null,Ct=We({},[vr,vn,Ne],Vl),Ke=We({},["mi","mo","mn","ms","mtext"]),$e=We({},["annotation-xml"]),sr=We({},["title","style","font","a","script"]),yt=null,xr=["application/xhtml+xml","text/html"],At="text/html",rt=null,pt=null,Wr=a.createElement("form"),yn=function(N){return N instanceof RegExp||N instanceof Function},Yt=function(){let N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(pt&&pt===N)){if((!N||typeof N!="object")&&(N={}),N=zr(N),yt=xr.indexOf(N.PARSER_MEDIA_TYPE)===-1?At:N.PARSER_MEDIA_TYPE,rt=yt==="application/xhtml+xml"?Vl:ys,re=Gr(N,"ALLOWED_TAGS")?We({},N.ALLOWED_TAGS,rt):Ze,Ce=Gr(N,"ALLOWED_ATTR")?We({},N.ALLOWED_ATTR,rt):ve,yr=Gr(N,"ALLOWED_NAMESPACES")?We({},N.ALLOWED_NAMESPACES,Vl):Ct,Mt=Gr(N,"ADD_URI_SAFE_ATTR")?We(zr(br),N.ADD_URI_SAFE_ATTR,rt):br,kt=Gr(N,"ADD_DATA_URI_TAGS")?We(zr(ft),N.ADD_DATA_URI_TAGS,rt):ft,ut=Gr(N,"FORBID_CONTENTS")?We({},N.FORBID_CONTENTS,rt):qe,le=Gr(N,"FORBID_TAGS")?We({},N.FORBID_TAGS,rt):zr({}),ye=Gr(N,"FORBID_ATTR")?We({},N.FORBID_ATTR,rt):zr({}),mt=Gr(N,"USE_PROFILES")?N.USE_PROFILES:!1,ue=N.ALLOW_ARIA_ATTR!==!1,Fe=N.ALLOW_DATA_ATTR!==!1,Je=N.ALLOW_UNKNOWN_PROTOCOLS||!1,Me=N.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Le=N.SAFE_FOR_TEMPLATES||!1,_e=N.SAFE_FOR_XML!==!1,De=N.WHOLE_DOCUMENT||!1,Te=N.RETURN_DOM||!1,It=N.RETURN_DOM_FRAGMENT||!1,Et=N.RETURN_TRUSTED_TYPE||!1,Ve=N.FORCE_BODY||!1,mr=N.SANITIZE_DOM!==!1,lt=N.SANITIZE_NAMED_PROPS||!1,ze=N.KEEP_CONTENT!==!1,Xe=N.IN_PLACE||!1,we=N.ALLOWED_URI_REGEXP||Rp,Sr=N.NAMESPACE||Ne,Ke=N.MATHML_TEXT_INTEGRATION_POINTS||Ke,$e=N.HTML_INTEGRATION_POINTS||$e,se=N.CUSTOM_ELEMENT_HANDLING||{},N.CUSTOM_ELEMENT_HANDLING&&yn(N.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(se.tagNameCheck=N.CUSTOM_ELEMENT_HANDLING.tagNameCheck),N.CUSTOM_ELEMENT_HANDLING&&yn(N.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(se.attributeNameCheck=N.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),N.CUSTOM_ELEMENT_HANDLING&&typeof N.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(se.allowCustomizedBuiltInElements=N.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Le&&(Fe=!1),It&&(Te=!0),mt&&(re=We({},Tp),Ce=[],mt.html===!0&&(We(re,xp),We(Ce,Ip)),mt.svg===!0&&(We(re,Pl),We(Ce,Xl),We(Ce,vs)),mt.svgFilters===!0&&(We(re,Hl),We(Ce,Xl),We(Ce,vs)),mt.mathMl===!0&&(We(re,Jl),We(Ce,Ep),We(Ce,vs))),N.ADD_TAGS&&(typeof N.ADD_TAGS=="function"?Ge.tagCheck=N.ADD_TAGS:(re===Ze&&(re=zr(re)),We(re,N.ADD_TAGS,rt))),N.ADD_ATTR&&(typeof N.ADD_ATTR=="function"?Ge.attributeCheck=N.ADD_ATTR:(Ce===ve&&(Ce=zr(Ce)),We(Ce,N.ADD_ATTR,rt))),N.ADD_URI_SAFE_ATTR&&We(Mt,N.ADD_URI_SAFE_ATTR,rt),N.FORBID_CONTENTS&&(ut===qe&&(ut=zr(ut)),We(ut,N.FORBID_CONTENTS,rt)),N.ADD_FORBID_CONTENTS&&(ut===qe&&(ut=zr(ut)),We(ut,N.ADD_FORBID_CONTENTS,rt)),ze&&(re["#text"]=!0),De&&We(re,["html","head","body"]),re.table&&(We(re,["tbody"]),delete le.tbody),N.TRUSTED_TYPES_POLICY){if(typeof N.TRUSTED_TYPES_POLICY.createHTML!="function")throw Wo('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof N.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Wo('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');te=N.TRUSTED_TYPES_POLICY,ae=te.createHTML("")}else te===void 0&&(te=vC(X,c)),te!==null&&typeof ae=="string"&&(ae=te.createHTML(""));ir&&ir(N),pt=N}},si=We({},[...Pl,...Hl,...sC]),en=We({},[...Jl,...lC]),li=function(N){let K=q(N);(!K||!K.tagName)&&(K={namespaceURI:Sr,tagName:"template"});let be=ys(N.tagName),Ye=ys(K.tagName);return yr[N.namespaceURI]?N.namespaceURI===vn?K.namespaceURI===Ne?be==="svg":K.namespaceURI===vr?be==="svg"&&(Ye==="annotation-xml"||Ke[Ye]):!!si[be]:N.namespaceURI===vr?K.namespaceURI===Ne?be==="math":K.namespaceURI===vn?be==="math"&&$e[Ye]:!!en[be]:N.namespaceURI===Ne?K.namespaceURI===vn&&!$e[Ye]||K.namespaceURI===vr&&!Ke[Ye]?!1:!en[be]&&(sr[be]||!si[be]):!!(yt==="application/xhtml+xml"&&yr[N.namespaceURI]):!1},Pt=function(N){Go(n.removed,{element:N});try{q(N).removeChild(N)}catch{R(N)}},Ht=function(N,K){try{Go(n.removed,{attribute:K.getAttributeNode(N),from:K})}catch{Go(n.removed,{attribute:null,from:K})}if(K.removeAttribute(N),N==="is")if(Te||It)try{Pt(K)}catch{}else try{K.setAttribute(N,"")}catch{}},jt=function(N){let K=null,be=null;if(Ve)N="<remove></remove>"+N;else{let Ue=Ql(N,/^[\r\n\t ]+/);be=Ue&&Ue[0]}yt==="application/xhtml+xml"&&Sr===Ne&&(N='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+N+"</body></html>");let Ye=te?te.createHTML(N):N;if(Sr===Ne)try{K=new M().parseFromString(Ye,yt)}catch{}if(!K||!K.documentElement){K=_.createDocument(Sr,"template",null);try{K.documentElement.innerHTML=Ie?ae:Ye}catch{}}let dt=K.body||K.documentElement;return N&&be&&dt.insertBefore(a.createTextNode(be),dt.childNodes[0]||null),Sr===Ne?$.call(K,De?"html":"body")[0]:De?K.documentElement:dt},wr=function(N){return w.call(N.ownerDocument||N,N,U.SHOW_ELEMENT|U.SHOW_COMMENT|U.SHOW_TEXT|U.SHOW_PROCESSING_INSTRUCTION|U.SHOW_CDATA_SECTION,null)},xn=function(N){return N instanceof F&&(typeof N.nodeName!="string"||typeof N.textContent!="string"||typeof N.removeChild!="function"||!(N.attributes instanceof A)||typeof N.removeAttribute!="function"||typeof N.setAttribute!="function"||typeof N.namespaceURI!="string"||typeof N.insertBefore!="function"||typeof N.hasChildNodes!="function")},lr=function(N){return typeof y=="function"&&N instanceof y};function Tr(xe,N,K){bs(xe,be=>{be.call(n,N,K,pt)})}let tn=function(N){let K=null;if(Tr(k.beforeSanitizeElements,N,null),xn(N))return Pt(N),!0;let be=rt(N.nodeName);if(Tr(k.uponSanitizeElement,N,{tagName:be,allowedTags:re}),_e&&N.hasChildNodes()&&!lr(N.firstElementChild)&&nr(/<[/\w!]/g,N.innerHTML)&&nr(/<[/\w!]/g,N.textContent)||N.nodeType===Zo.progressingInstruction||_e&&N.nodeType===Zo.comment&&nr(/<[/\w]/g,N.data))return Pt(N),!0;if(!(Ge.tagCheck instanceof Function&&Ge.tagCheck(be))&&(!re[be]||le[be])){if(!le[be]&&fr(be)&&(se.tagNameCheck instanceof RegExp&&nr(se.tagNameCheck,be)||se.tagNameCheck instanceof Function&&se.tagNameCheck(be)))return!1;if(ze&&!ut[be]){let Ye=q(N)||N.parentNode,dt=J(N)||N.childNodes;if(dt&&Ye){let Ue=dt.length;for(let de=Ue-1;de>=0;--de){let _t=Z(dt[de],!0);_t.__removalCount=(N.__removalCount||0)+1,Ye.insertBefore(_t,G(N))}}}return Pt(N),!0}return N instanceof T&&!li(N)||(be==="noscript"||be==="noembed"||be==="noframes")&&nr(/<\/no(script|embed|frames)/i,N.innerHTML)?(Pt(N),!0):(Le&&N.nodeType===Zo.text&&(K=N.textContent,bs([oe,x,ee],Ye=>{K=Oo(K,Ye," ")}),N.textContent!==K&&(Go(n.removed,{element:N.cloneNode()}),N.textContent=K)),Tr(k.afterSanitizeElements,N,null),!1)},ur=function(N,K,be){if(mr&&(K==="id"||K==="name")&&(be in a||be in Wr))return!1;if(!(Fe&&!ye[K]&&nr(D,K))){if(!(ue&&nr(ce,K))){if(!(Ge.attributeCheck instanceof Function&&Ge.attributeCheck(K,N))){if(!Ce[K]||ye[K]){if(!(fr(N)&&(se.tagNameCheck instanceof RegExp&&nr(se.tagNameCheck,N)||se.tagNameCheck instanceof Function&&se.tagNameCheck(N))&&(se.attributeNameCheck instanceof RegExp&&nr(se.attributeNameCheck,K)||se.attributeNameCheck instanceof Function&&se.attributeNameCheck(K,N))||K==="is"&&se.allowCustomizedBuiltInElements&&(se.tagNameCheck instanceof RegExp&&nr(se.tagNameCheck,be)||se.tagNameCheck instanceof Function&&se.tagNameCheck(be))))return!1}else if(!Mt[K]){if(!nr(we,Oo(be,Oe,""))){if(!((K==="src"||K==="xlink:href"||K==="href")&&N!=="script"&&nC(be,"data:")===0&&kt[N])){if(!(Je&&!nr(ge,Oo(be,Oe,"")))){if(be)return!1}}}}}}}return!0},fr=function(N){return N!=="annotation-xml"&&Ql(N,Re)},Dr=function(N){Tr(k.beforeSanitizeAttributes,N,null);let{attributes:K}=N;if(!K||xn(N))return;let be={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Ce,forceKeepAttr:void 0},Ye=K.length;for(;Ye--;){let dt=K[Ye],{name:Ue,namespaceURI:de,value:_t}=dt,Cr=rt(Ue),Dt=_t,v=Ue==="value"?Dt:iC(Dt);if(be.attrName=Cr,be.attrValue=v,be.keepAttr=!0,be.forceKeepAttr=void 0,Tr(k.uponSanitizeAttribute,N,be),v=be.attrValue,lt&&(Cr==="id"||Cr==="name")&&(Ht(Ue,N),v=Qt+v),_e&&nr(/((--!?|])>)|<\/(style|title|textarea)/i,v)){Ht(Ue,N);continue}if(Cr==="attributename"&&Ql(v,"href")){Ht(Ue,N);continue}if(be.forceKeepAttr)continue;if(!be.keepAttr){Ht(Ue,N);continue}if(!Me&&nr(/\/>/i,v)){Ht(Ue,N);continue}Le&&bs([oe,x,ee],V=>{v=Oo(v,V," ")});let E=rt(N.nodeName);if(!ur(E,Cr,v)){Ht(Ue,N);continue}if(te&&typeof X=="object"&&typeof X.getAttributeType=="function"&&!de)switch(X.getAttributeType(E,Cr)){case"TrustedHTML":{v=te.createHTML(v);break}case"TrustedScriptURL":{v=te.createScriptURL(v);break}}if(v!==Dt)try{de?N.setAttributeNS(de,Ue,v):N.setAttribute(Ue,v),xn(N)?Pt(N):yp(n.removed)}catch{Ht(Ue,N)}}Tr(k.afterSanitizeAttributes,N,null)},Tn=function xe(N){let K=null,be=wr(N);for(Tr(k.beforeSanitizeShadowDOM,N,null);K=be.nextNode();)Tr(k.uponSanitizeShadowNode,K,null),tn(K),Dr(K),K.content instanceof p&&xe(K.content);Tr(k.afterSanitizeShadowDOM,N,null)};return n.sanitize=function(xe){let N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},K=null,be=null,Ye=null,dt=null;if(Ie=!xe,Ie&&(xe="<!-->"),typeof xe!="string"&&!lr(xe))if(typeof xe.toString=="function"){if(xe=xe.toString(),typeof xe!="string")throw Wo("dirty is not a string, aborting")}else throw Wo("toString is not a function");if(!n.isSupported)return xe;if(Be||Yt(N),n.removed=[],typeof xe=="string"&&(Xe=!1),Xe){if(xe.nodeName){let _t=rt(xe.nodeName);if(!re[_t]||le[_t])throw Wo("root node is forbidden and cannot be sanitized in-place")}}else if(xe instanceof y)K=jt("<!---->"),be=K.ownerDocument.importNode(xe,!0),be.nodeType===Zo.element&&be.nodeName==="BODY"||be.nodeName==="HTML"?K=be:K.appendChild(be);else{if(!Te&&!Le&&!De&&xe.indexOf("<")===-1)return te&&Et?te.createHTML(xe):xe;if(K=jt(xe),!K)return Te?null:Et?ae:""}K&&Ve&&Pt(K.firstChild);let Ue=wr(Xe?xe:K);for(;Ye=Ue.nextNode();)tn(Ye),Dr(Ye),Ye.content instanceof p&&Tn(Ye.content);if(Xe)return xe;if(Te){if(It)for(dt=P.call(K.ownerDocument);K.firstChild;)dt.appendChild(K.firstChild);else dt=K;return(Ce.shadowroot||Ce.shadowrootmode)&&(dt=pe.call(l,dt,!0)),dt}let de=De?K.outerHTML:K.innerHTML;return De&&re["!doctype"]&&K.ownerDocument&&K.ownerDocument.doctype&&K.ownerDocument.doctype.name&&nr(Np,K.ownerDocument.doctype.name)&&(de="<!DOCTYPE "+K.ownerDocument.doctype.name+`>
40
- `+de),Le&&bs([oe,x,ee],_t=>{de=Oo(de,_t," ")}),te&&Et?te.createHTML(de):de},n.setConfig=function(){let xe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Yt(xe),Be=!0},n.clearConfig=function(){pt=null,Be=!1},n.isValidAttribute=function(xe,N,K){pt||Yt({});let be=rt(xe),Ye=rt(N);return ur(be,Ye,K)},n.addHook=function(xe,N){typeof N=="function"&&Go(k[xe],N)},n.removeHook=function(xe,N){if(N!==void 0){let K=tC(k[xe],N);return K===-1?void 0:rC(k[xe],K,1)[0]}return yp(k[xe])},n.removeHooks=function(xe){k[xe]=[]},n.removeAllHooks=function(){k=Ap()},n}var Vo=Sp();var Or=Ar(ag()),ri=class{constructor(n){this.namespace=n}set(n,a,l,c){if(Or.default.enabled&&(this.removeExpiredKeys(),n&&a!==void 0)){a.documentElement&&(a=new XMLSerializer().serializeToString(a.documentElement));try{Or.default.set(n,{namespace:this.namespace,val:a,exp:l,time:new Date().getTime()/1e3})}catch(p){if(p instanceof Error){let g=p;if(g.quotaExceeded=IA(p),g.quotaExceeded&&c)c(p);else throw g}throw p}}}remove(n){Or.default.enabled&&n&&Or.default.remove(n)}removeExpiredKeys(){Or.default.enabled&&Or.default.each((n,a)=>{n&&n.exp&&new Date().getTime()/1e3-n.time>n.exp&&this.remove(a)})}removeAll(){Or.default.enabled}removeNamespace(){Or.default.each((n,a)=>{n.namespace&&n.namespace===this.namespace&&this.remove(a)})}get(n){if(Or.default.enabled&&n)if(this.removeExpiredKeys(),n){var a=Or.default.get(n);return a?a.val:void 0}else return}};function IA(r){var n=!1;if(r)if(r.code)switch(r.code){case 22:n=!0;break;case 1014:r.name==="NS_ERROR_DOM_QUOTA_REACHED"&&(n=!0);break}else r.number===-2147024882&&(n=!0);return n}var{sanitize:Ck}=Vo;function Xo(r,n){if(r)return r.classList?r.classList.contains(n):!!r.className.match(new RegExp("(\\s|^)"+n+"(\\s|$)"))}function Qe(r,...n){if(r)for(let a of n)r.classList?r.classList.add(a):Xo(r,a)||(r.className+=" "+a)}function hn(r,n){if(r){if(r.classList)r.classList.remove(n);else if(Xo(r,n)){var a=new RegExp("(\\s|^)"+n+"(\\s|$)");r.className=r.className.replace(a," ")}}}function au(r,n){if(typeof r=="string"){let a=JSON.parse(r);if(n&&a.results)for(let l in a.results.bindings)a.results.bindings[l]=n(a.results.bindings[l]);return a}if(typeof r=="object"&&r.constructor==={}.constructor){if(n&&r.results)for(let a in r.results.bindings)r.results.bindings[a]=n(r.results.bindings[a]);return r}throw new Error("Could not parse json")}var Sg=Ar(Rg());var jo="http://www.w3.org/1999/02/22-rdf-syntax-ns#",zo="http://www.w3.org/2001/XMLSchema#",Es="http://www.w3.org/2000/10/swap/",gr={xsd:{decimal:`${zo}decimal`,boolean:`${zo}boolean`,double:`${zo}double`,integer:`${zo}integer`,string:`${zo}string`},rdf:{type:`${jo}type`,nil:`${jo}nil`,first:`${jo}first`,rest:`${jo}rest`,langString:`${jo}langString`},owl:{sameAs:"http://www.w3.org/2002/07/owl#sameAs"},r:{forSome:`${Es}reify#forSome`,forAll:`${Es}reify#forAll`},log:{implies:`${Es}log#implies`,isImpliedBy:`${Es}log#isImpliedBy`}};var{xsd:Cs}=gr,t_=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{8})|\\([^])/g,Ng={"\\":"\\","'":"'",'"':'"',n:`
41
- `,r:"\r",t:" ",f:"\f",b:"\b",_:"_","~":"~",".":".","-":"-","!":"!",$:"$","&":"&","(":"(",")":")","*":"*","+":"+",",":",",";":";","=":"=","/":"/","?":"?","#":"#","@":"@","%":"%"},r_=/[\x00-\x20<>\\"\{\}\|\^\`]/,n_={_iri:!0,_unescapedIri:!0,_simpleQuotedString:!0,_langcode:!0,_blank:!0,_newline:!0,_comment:!0,_whitespace:!0,_endOfFile:!0},i_=/$0^/,qo=class{constructor(n){if(this._iri=/^<((?:[^ <>{}\\]|\\[uU])+)>[ \t]*/,this._unescapedIri=/^<([^\x00-\x20<>\\"\{\}\|\^\`]*)>[ \t]*/,this._simpleQuotedString=/^"([^"\\\r\n]*)"(?=[^"])/,this._simpleApostropheString=/^'([^'\\\r\n]*)'(?=[^'])/,this._langcode=/^@([a-z]+(?:-[a-z0-9]+)*)(?=[^a-z0-9\-])/i,this._prefix=/^((?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)?:(?=[#\s<])/,this._prefixed=/^((?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)?:((?:(?:[0-:A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~])(?:(?:[\.\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~])*(?:[\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~]))?)?)(?:[ \t]+|(?=\.?[,;!\^\s#()\[\]\{\}"'<>]))/,this._variable=/^\?(?:(?:[A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:[\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)(?=[.,;!\^\s#()\[\]\{\}"'<>])/,this._blank=/^_:((?:[0-9A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)(?:[ \t]+|(?=\.?[,;:\s#()\[\]\{\}"'<>]))/,this._number=/^[\-+]?(?:(\d+\.\d*|\.?\d+)[eE][\-+]?|\d*(\.)?)\d+(?=\.?[,;:\s#()\[\]\{\}"'<>])/,this._boolean=/^(?:true|false)(?=[.,;\s#()\[\]\{\}"'<>])/,this._keyword=/^@[a-z]+(?=[\s#<:])/i,this._sparqlKeyword=/^(?:PREFIX|BASE|GRAPH)(?=[\s#<])/i,this._shortPredicates=/^a(?=[\s#()\[\]\{\}"'<>])/,this._newline=/^[ \t]*(?:#[^\n\r]*)?(?:\r\n|\n|\r)[ \t]*/,this._comment=/#([^\n\r]*)/,this._whitespace=/^[ \t]+/,this._endOfFile=/^(?:#[^\n\r]*)?$/,n=n||{},this._isImpliedBy=n.isImpliedBy,this._lineMode=!!n.lineMode){this._n3Mode=!1;for(let a in this)!(a in n_)&&this[a]instanceof RegExp&&(this[a]=i_)}else this._n3Mode=n.n3!==!1;this.comments=!!n.comments,this._literalClosingPos=0}_tokenizeToEnd(n,a){let l=this._input,c=l.length;for(;;){let y,T;for(;y=this._newline.exec(l);)this.comments&&(T=this._comment.exec(y[0]))&&p("comment",T[1],"",this._line,y[0].length),l=l.substr(y[0].length,l.length),c=l.length,this._line++;if(!y&&(y=this._whitespace.exec(l))&&(l=l.substr(y[0].length,l.length)),this._endOfFile.test(l))return a&&(this.comments&&(T=this._comment.exec(l))&&p("comment",T[1],"",this._line,l.length),l=null,p("eof","","",this._line,0)),this._input=l;let U=this._line,A=l[0],F="",M="",X="",S=null,Z=0,R=!1;switch(A){case"^":if(l.length<3)break;if(l[1]==="^"){if(this._previousMarker="^^",l=l.substr(2),l[0]!=="<"){R=!0;break}}else{this._n3Mode&&(Z=1,F="^");break}case"<":if(S=this._unescapedIri.exec(l))F="IRI",M=S[1];else if(S=this._iri.exec(l)){if(M=this._unescape(S[1]),M===null||r_.test(M))return g(this);F="IRI"}else l.length>1&&l[1]==="<"?(F="<<",Z=2):this._n3Mode&&l.length>1&&l[1]==="="&&(Z=2,this._isImpliedBy?(F="abbreviation",M="<"):(F="inverse",M=">"));break;case">":l.length>1&&l[1]===">"&&(F=">>",Z=2);break;case"_":((S=this._blank.exec(l))||a&&(S=this._blank.exec(`${l} `)))&&(F="blank",X="_",M=S[1]);break;case'"':if(S=this._simpleQuotedString.exec(l))M=S[1];else if({value:M,matchLength:Z}=this._parseLiteral(l),M===null)return g(this);(S!==null||Z!==0)&&(F="literal",this._literalClosingPos=0);break;case"'":if(!this._lineMode){if(S=this._simpleApostropheString.exec(l))M=S[1];else if({value:M,matchLength:Z}=this._parseLiteral(l),M===null)return g(this);(S!==null||Z!==0)&&(F="literal",this._literalClosingPos=0)}break;case"?":this._n3Mode&&(S=this._variable.exec(l))&&(F="var",M=S[0]);break;case"@":this._previousMarker==="literal"&&(S=this._langcode.exec(l))?(F="langcode",M=S[1]):(S=this._keyword.exec(l))&&(F=S[0]);break;case".":if(l.length===1?a:l[1]<"0"||l[1]>"9"){F=".",Z=1;break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"+":case"-":(S=this._number.exec(l)||a&&(S=this._number.exec(`${l} `)))&&(F="literal",M=S[0],X=typeof S[1]=="string"?Cs.double:typeof S[2]=="string"?Cs.decimal:Cs.integer);break;case"B":case"b":case"p":case"P":case"G":case"g":(S=this._sparqlKeyword.exec(l))?F=S[0].toUpperCase():R=!0;break;case"f":case"t":(S=this._boolean.exec(l))?(F="literal",M=S[0],X=Cs.boolean):R=!0;break;case"a":(S=this._shortPredicates.exec(l))?(F="abbreviation",M="a"):R=!0;break;case"=":this._n3Mode&&l.length>1&&(F="abbreviation",l[1]!==">"?(Z=1,M="="):(Z=2,M=">"));break;case"!":if(!this._n3Mode)break;case",":case";":case"[":case"]":case"(":case")":case"}":this._lineMode||(Z=1,F=A);break;case"{":!this._lineMode&&l.length>=2&&(l[1]==="|"?(F="{|",Z=2):(F=A,Z=1));break;case"|":l.length>=2&&l[1]==="}"&&(F="|}",Z=2);break;default:R=!0}if(R&&((this._previousMarker==="@prefix"||this._previousMarker==="PREFIX")&&(S=this._prefix.exec(l))?(F="prefix",M=S[1]||""):((S=this._prefixed.exec(l))||a&&(S=this._prefixed.exec(`${l} `)))&&(F="prefixed",X=S[1]||"",M=this._unescape(S[2]))),this._previousMarker==="^^")switch(F){case"prefixed":F="type";break;case"IRI":F="typeIRI";break;default:F=""}if(!F)return a||!/^'''|^"""/.test(l)&&/\n|\r/.test(l)?g(this):this._input=l;let G=Z||S[0].length,J=p(F,M,X,U,G);this.previousToken=J,this._previousMarker=F,l=l.substr(G,l.length)}function p(y,T,U,A,F){let M=l?c-l.length:c,X=M+F,S={type:y,value:T,prefix:U,line:A,start:M,end:X};return n(null,S),S}function g(y){n(y._syntaxError(/^\S*/.exec(l)[0]))}}_unescape(n){let a=!1,l=n.replace(t_,(c,p,g,y)=>{if(typeof p=="string")return String.fromCharCode(Number.parseInt(p,16));if(typeof g=="string"){let T=Number.parseInt(g,16);return T<=65535?String.fromCharCode(Number.parseInt(g,16)):String.fromCharCode(55296+((T-=65536)>>10),56320+(T&1023))}return y in Ng?Ng[y]:(a=!0,"")});return a?null:l}_parseLiteral(n){if(n.length>=3){let a=n.match(/^(?:"""|"|'''|'|)/)[0],l=a.length,c=Math.max(this._literalClosingPos,l);for(;(c=n.indexOf(a,c))>0;){let p=0;for(;n[c-p-1]==="\\";)p++;if(p%2===0){let g=n.substring(l,c),y=g.split(/\r\n|\r|\n/).length-1,T=c+l;if(l===1&&y!==0||l===3&&this._lineMode)break;return this._line+=y,{value:this._unescape(g),matchLength:T}}c++}this._literalClosingPos=n.length-l+1}return{value:"",matchLength:0}}_syntaxError(n){this._input=null;let a=new Error(`Unexpected "${n}" on line ${this._line}.`);return a.context={token:void 0,line:this._line,previousToken:this.previousToken},a}_readStartingBom(n){return n.startsWith("\uFEFF")?n.substr(1):n}tokenize(n,a){if(this._line=1,typeof n=="string")if(this._input=this._readStartingBom(n),typeof a=="function")queueMicrotask(()=>this._tokenizeToEnd(a,!0));else{let l=[],c;if(this._tokenizeToEnd((p,g)=>p?c=p:l.push(g),!0),c)throw c;return l}else this._pendingBuffer=null,typeof n.setEncoding=="function"&&n.setEncoding("utf8"),n.on("data",l=>{this._input!==null&&l.length!==0&&(this._pendingBuffer&&(l=Sg.Buffer.concat([this._pendingBuffer,l]),this._pendingBuffer=null),l[l.length-1]&128?this._pendingBuffer=l:(typeof this._input>"u"?this._input=this._readStartingBom(typeof l=="string"?l:l.toString()):this._input+=l,this._tokenizeToEnd(a,!1)))}),n.on("end",()=>{typeof this._input=="string"&&this._tokenizeToEnd(a,!0)}),n.on("error",a)}};var{rdf:o_,xsd:eo}=gr,ea,a_=0;var s_={namedNode:Lg,blankNode:Fg,variable:Ug,literal:Bg,defaultGraph:l_,quad:xu,triple:xu,fromTerm:Ko,fromQuad:kg},wg=s_,gn=class r{constructor(n){this.id=n}get value(){return this.id}equals(n){return n instanceof r?this.id===n.id:!!n&&this.termType===n.termType&&this.value===n.value}hashCode(){return 0}toJSON(){return{termType:this.termType,value:this.value}}},As=class extends gn{get termType(){return"NamedNode"}},$o=class r extends gn{get termType(){return"Literal"}get value(){return this.id.substring(1,this.id.lastIndexOf('"'))}get language(){let n=this.id,a=n.lastIndexOf('"')+1;return a<n.length&&n[a++]==="@"?n.substr(a).toLowerCase():""}get datatype(){return new As(this.datatypeString)}get datatypeString(){let n=this.id,a=n.lastIndexOf('"')+1,l=a<n.length?n[a]:"";return l==="^"?n.substr(a+2):l!=="@"?eo.string:o_.langString}equals(n){return n instanceof r?this.id===n.id:!!n&&!!n.datatype&&this.termType===n.termType&&this.value===n.value&&this.language===n.language&&this.datatype.value===n.datatype.value}toJSON(){return{termType:this.termType,value:this.value,language:this.language,datatype:{termType:"NamedNode",value:this.datatypeString}}}},bu=class extends gn{constructor(n){super(`_:${n}`)}get termType(){return"BlankNode"}get value(){return this.id.substr(2)}},vu=class extends gn{constructor(n){super(`?${n}`)}get termType(){return"Variable"}get value(){return this.id.substr(1)}},yu=class extends gn{constructor(){return super(""),ea||this}get termType(){return"DefaultGraph"}equals(n){return this===n||!!n&&this.termType===n.termType}};ea=new yu;var _s=class extends gn{constructor(n,a,l,c){super(""),this._subject=n,this._predicate=a,this._object=l,this._graph=c||ea}get termType(){return"Quad"}get subject(){return this._subject}get predicate(){return this._predicate}get object(){return this._object}get graph(){return this._graph}toJSON(){return{termType:this.termType,subject:this._subject.toJSON(),predicate:this._predicate.toJSON(),object:this._object.toJSON(),graph:this._graph.toJSON()}}equals(n){return!!n&&this._subject.equals(n.subject)&&this._predicate.equals(n.predicate)&&this._object.equals(n.object)&&this._graph.equals(n.graph)}};function Lg(r){return new As(r)}function Fg(r){return new bu(r||`n3-${a_++}`)}function Bg(r,n){if(typeof n=="string")return new $o(`"${r}"@${n.toLowerCase()}`);let a=n?n.value:"";return a===""&&(typeof r=="boolean"?a=eo.boolean:typeof r=="number"&&(Number.isFinite(r)?a=Number.isInteger(r)?eo.integer:eo.double:(a=eo.double,Number.isNaN(r)||(r=r>0?"INF":"-INF")))),a===""||a===eo.string?new $o(`"${r}"`):new $o(`"${r}"^^${a}`)}function Ug(r){return new vu(r)}function l_(){return ea}function xu(r,n,a,l){return new _s(r,n,a,l)}function Ko(r){if(r instanceof gn)return r;switch(r.termType){case"NamedNode":return Lg(r.value);case"BlankNode":return Fg(r.value);case"Variable":return Ug(r.value);case"DefaultGraph":return ea;case"Literal":return Bg(r.value,r.language||r.datatype);case"Quad":return kg(r);default:throw new Error(`Unexpected termType: ${r.termType}`)}}function kg(r){if(r instanceof _s)return r;if(r.termType!=="Quad")throw new Error(`Unexpected termType: ${r.termType}`);return xu(Ko(r.subject),Ko(r.predicate),Ko(r.object),Ko(r.graph))}var Mg=0,oi=class{constructor(n){this._contextStack=[],this._graph=null,n=n||{},this._setBase(n.baseIRI),n.factory&&Gg(this,n.factory);let a=typeof n.format=="string"?n.format.match(/\w*$/)[0].toLowerCase():"",l=/turtle/.test(a),c=/trig/.test(a),p=/triple/.test(a),g=/quad/.test(a),y=this._n3Mode=/n3/.test(a),T=p||g;(this._supportsNamedGraphs=!(l||y))||(this._readPredicateOrNamedGraph=this._readPredicate),this._supportsQuads=!(l||c||p||y),this._isImpliedBy=n.isImpliedBy,this._supportsRDFStar=a===""||/star|\*$/.test(a),T&&(this._resolveRelativeIRI=U=>null),this._blankNodePrefix=typeof n.blankNodePrefix!="string"?"":n.blankNodePrefix.replace(/^(?!_:)/,"_:"),this._lexer=n.lexer||new qo({lineMode:T,n3:y,isImpliedBy:this._isImpliedBy}),this._explicitQuantifiers=!!n.explicitQuantifiers}static _resetBlankNodePrefix(){Mg=0}_setBase(n){if(!n)this._base="",this._basePath="";else{let a=n.indexOf("#");a>=0&&(n=n.substr(0,a)),this._base=n,this._basePath=n.indexOf("/")<0?n:n.replace(/[^\/?]*(?:\?.*)?$/,""),n=n.match(/^(?:([a-z][a-z0-9+.-]*:))?(?:\/\/[^\/]*)?/i),this._baseRoot=n[0],this._baseScheme=n[1]}}_saveContext(n,a,l,c,p){let g=this._n3Mode;this._contextStack.push({type:n,subject:l,predicate:c,object:p,graph:a,inverse:g?this._inversePredicate:!1,blankPrefix:g?this._prefixes._:"",quantified:g?this._quantified:null}),g&&(this._inversePredicate=!1,this._prefixes._=this._graph?`${this._graph.value}.`:".",this._quantified=Object.create(this._quantified))}_restoreContext(n,a){let l=this._contextStack.pop();if(!l||l.type!==n)return this._error(`Unexpected ${a.type}`,a);this._subject=l.subject,this._predicate=l.predicate,this._object=l.object,this._graph=l.graph,this._n3Mode&&(this._inversePredicate=l.inverse,this._prefixes._=l.blankPrefix,this._quantified=l.quantified)}_readInTopContext(n){switch(n.type){case"eof":return this._graph!==null?this._error("Unclosed graph",n):(delete this._prefixes._,this._callback(null,null,this._prefixes));case"PREFIX":this._sparqlStyle=!0;case"@prefix":return this._readPrefix;case"BASE":this._sparqlStyle=!0;case"@base":return this._readBaseIRI;case"{":if(this._supportsNamedGraphs)return this._graph="",this._subject=null,this._readSubject;case"GRAPH":if(this._supportsNamedGraphs)return this._readNamedGraphLabel;default:return this._readSubject(n)}}_readEntity(n,a){let l;switch(n.type){case"IRI":case"typeIRI":let c=this._resolveIRI(n.value);if(c===null)return this._error("Invalid IRI",n);l=this._factory.namedNode(c);break;case"type":case"prefixed":let p=this._prefixes[n.prefix];if(p===void 0)return this._error(`Undefined prefix "${n.prefix}:"`,n);l=this._factory.namedNode(p+n.value);break;case"blank":l=this._factory.blankNode(this._prefixes[n.prefix]+n.value);break;case"var":l=this._factory.variable(n.value.substr(1));break;default:return this._error(`Expected entity but got ${n.type}`,n)}return!a&&this._n3Mode&&l.id in this._quantified&&(l=this._quantified[l.id]),l}_readSubject(n){switch(this._predicate=null,n.type){case"[":return this._saveContext("blank",this._graph,this._subject=this._factory.blankNode(),null,null),this._readBlankNodeHead;case"(":return this._saveContext("list",this._graph,this.RDF_NIL,null,null),this._subject=null,this._readListItem;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._graph=this._factory.blankNode(),null,null),this._readSubject):this._error("Unexpected graph",n);case"}":return this._readPunctuation(n);case"@forSome":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORSOME,this._quantifier="blankNode",this._readQuantifierList):this._error('Unexpected "@forSome"',n);case"@forAll":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORALL,this._quantifier="variable",this._readQuantifierList):this._error('Unexpected "@forAll"',n);case"literal":if(!this._n3Mode)return this._error("Unexpected literal",n);if(n.prefix.length===0)return this._literalValue=n.value,this._completeSubjectLiteral;this._subject=this._factory.literal(n.value,this._factory.namedNode(n.prefix));break;case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,null,null,null),this._graph=null,this._readSubject):this._error("Unexpected RDF-star syntax",n);default:if((this._subject=this._readEntity(n))===void 0)return;if(this._n3Mode)return this._getPathReader(this._readPredicateOrNamedGraph)}return this._readPredicateOrNamedGraph}_readPredicate(n){let a=n.type;switch(a){case"inverse":this._inversePredicate=!0;case"abbreviation":this._predicate=this.ABBREVIATIONS[n.value];break;case".":case"]":case"}":return this._predicate===null?this._error(`Unexpected ${a}`,n):(this._subject=null,a==="]"?this._readBlankNodeTail(n):this._readPunctuation(n));case";":return this._predicate!==null?this._readPredicate:this._error("Expected predicate but got ;",n);case"[":if(this._n3Mode)return this._saveContext("blank",this._graph,this._subject,this._subject=this._factory.blankNode(),null),this._readBlankNodeHead;case"blank":if(!this._n3Mode)return this._error("Disallowed blank node as predicate",n);default:if((this._predicate=this._readEntity(n))===void 0)return}return this._readObject}_readObject(n){switch(n.type){case"literal":if(n.prefix.length===0)return this._literalValue=n.value,this._readDataTypeOrLang;this._object=this._factory.literal(n.value,this._factory.namedNode(n.prefix));break;case"[":return this._saveContext("blank",this._graph,this._subject,this._predicate,this._subject=this._factory.blankNode()),this._readBlankNodeHead;case"(":return this._saveContext("list",this._graph,this._subject,this._predicate,this.RDF_NIL),this._subject=null,this._readListItem;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._factory.blankNode()),this._readSubject):this._error("Unexpected graph",n);case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,this._subject,this._predicate,null),this._graph=null,this._readSubject):this._error("Unexpected RDF-star syntax",n);default:if((this._object=this._readEntity(n))===void 0)return;if(this._n3Mode)return this._getPathReader(this._getContextEndReader())}return this._getContextEndReader()}_readPredicateOrNamedGraph(n){return n.type==="{"?this._readGraph(n):this._readPredicate(n)}_readGraph(n){return n.type!=="{"?this._error(`Expected graph but got ${n.type}`,n):(this._graph=this._subject,this._subject=null,this._readSubject)}_readBlankNodeHead(n){return n.type==="]"?(this._subject=null,this._readBlankNodeTail(n)):(this._predicate=null,this._readPredicate(n))}_readBlankNodeTail(n){if(n.type!=="]")return this._readBlankNodePunctuation(n);this._subject!==null&&this._emit(this._subject,this._predicate,this._object,this._graph);let a=this._predicate===null;return this._restoreContext("blank",n),this._object!==null?this._getContextEndReader():this._predicate!==null?this._readObject:a?this._readPredicateOrNamedGraph:this._readPredicateAfterBlank}_readPredicateAfterBlank(n){switch(n.type){case".":case"}":return this._subject=null,this._readPunctuation(n);default:return this._readPredicate(n)}}_readListItem(n){let a=null,l=null,c=this._readListItem,p=this._subject,g=this._contextStack,y=g[g.length-1];switch(n.type){case"[":this._saveContext("blank",this._graph,l=this._factory.blankNode(),this.RDF_FIRST,this._subject=a=this._factory.blankNode()),c=this._readBlankNodeHead;break;case"(":this._saveContext("list",this._graph,l=this._factory.blankNode(),this.RDF_FIRST,this.RDF_NIL),this._subject=null;break;case")":if(this._restoreContext("list",n),g.length!==0&&g[g.length-1].type==="list"&&this._emit(this._subject,this._predicate,this._object,this._graph),this._predicate===null){if(c=this._readPredicate,this._subject===this.RDF_NIL)return c}else if(c=this._getContextEndReader(),this._object===this.RDF_NIL)return c;l=this.RDF_NIL;break;case"literal":n.prefix.length===0?(this._literalValue=n.value,c=this._readListItemDataTypeOrLang):(a=this._factory.literal(n.value,this._factory.namedNode(n.prefix)),c=this._getContextEndReader());break;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._factory.blankNode()),this._readSubject):this._error("Unexpected graph",n);default:if((a=this._readEntity(n))===void 0)return}if(l===null&&(this._subject=l=this._factory.blankNode()),p===null?y.predicate===null?y.subject=l:y.object=l:this._emit(p,this.RDF_REST,l,this._graph),a!==null){if(this._n3Mode&&(n.type==="IRI"||n.type==="prefixed"))return this._saveContext("item",this._graph,l,this.RDF_FIRST,a),this._subject=a,this._predicate=null,this._getPathReader(this._readListItem);this._emit(l,this.RDF_FIRST,a,this._graph)}return c}_readDataTypeOrLang(n){return this._completeObjectLiteral(n,!1)}_readListItemDataTypeOrLang(n){return this._completeObjectLiteral(n,!0)}_completeLiteral(n){let a=this._factory.literal(this._literalValue);switch(n.type){case"type":case"typeIRI":let l=this._readEntity(n);if(l===void 0)return;a=this._factory.literal(this._literalValue,l),n=null;break;case"langcode":a=this._factory.literal(this._literalValue,n.value),n=null;break}return{token:n,literal:a}}_completeSubjectLiteral(n){return this._subject=this._completeLiteral(n).literal,this._readPredicateOrNamedGraph}_completeObjectLiteral(n,a){let l=this._completeLiteral(n);if(l)return this._object=l.literal,a&&this._emit(this._subject,this.RDF_FIRST,this._object,this._graph),l.token===null?this._getContextEndReader():(this._readCallback=this._getContextEndReader(),this._readCallback(l.token))}_readFormulaTail(n){return n.type!=="}"?this._readPunctuation(n):(this._subject!==null&&this._emit(this._subject,this._predicate,this._object,this._graph),this._restoreContext("formula",n),this._object===null?this._readPredicate:this._getContextEndReader())}_readPunctuation(n){let a,l=this._graph,c=this._subject,p=this._inversePredicate;switch(n.type){case"}":if(this._graph===null)return this._error("Unexpected graph closing",n);if(this._n3Mode)return this._readFormulaTail(n);this._graph=null;case".":this._subject=null,a=this._contextStack.length?this._readSubject:this._readInTopContext,p&&(this._inversePredicate=!1);break;case";":a=this._readPredicate;break;case",":a=this._readObject;break;case"{|":if(!this._supportsRDFStar)return this._error("Unexpected RDF-star syntax",n);let g=this._predicate,y=this._object;this._subject=this._factory.quad(c,g,y,this.DEFAULTGRAPH),a=this._readPredicate;break;case"|}":if(this._subject.termType!=="Quad")return this._error("Unexpected asserted triple closing",n);this._subject=null,a=this._readPunctuation;break;default:if(this._supportsQuads&&this._graph===null&&(l=this._readEntity(n))!==void 0){a=this._readQuadPunctuation;break}return this._error(`Expected punctuation to follow "${this._object.id}"`,n)}if(c!==null){let g=this._predicate,y=this._object;p?this._emit(y,g,c,l):this._emit(c,g,y,l)}return a}_readBlankNodePunctuation(n){let a;switch(n.type){case";":a=this._readPredicate;break;case",":a=this._readObject;break;default:return this._error(`Expected punctuation to follow "${this._object.id}"`,n)}return this._emit(this._subject,this._predicate,this._object,this._graph),a}_readQuadPunctuation(n){return n.type!=="."?this._error("Expected dot to follow quad",n):this._readInTopContext}_readPrefix(n){return n.type!=="prefix"?this._error("Expected prefix to follow @prefix",n):(this._prefix=n.value,this._readPrefixIRI)}_readPrefixIRI(n){if(n.type!=="IRI")return this._error(`Expected IRI to follow prefix "${this._prefix}:"`,n);let a=this._readEntity(n);return this._prefixes[this._prefix]=a.value,this._prefixCallback(this._prefix,a),this._readDeclarationPunctuation}_readBaseIRI(n){let a=n.type==="IRI"&&this._resolveIRI(n.value);return a?(this._setBase(a),this._readDeclarationPunctuation):this._error("Expected valid IRI to follow base declaration",n)}_readNamedGraphLabel(n){switch(n.type){case"IRI":case"blank":case"prefixed":return this._readSubject(n),this._readGraph;case"[":return this._readNamedGraphBlankLabel;default:return this._error("Invalid graph label",n)}}_readNamedGraphBlankLabel(n){return n.type!=="]"?this._error("Invalid graph label",n):(this._subject=this._factory.blankNode(),this._readGraph)}_readDeclarationPunctuation(n){return this._sparqlStyle?(this._sparqlStyle=!1,this._readInTopContext(n)):n.type!=="."?this._error("Expected declaration to end with a dot",n):this._readInTopContext}_readQuantifierList(n){let a;switch(n.type){case"IRI":case"prefixed":if((a=this._readEntity(n,!0))!==void 0)break;default:return this._error(`Unexpected ${n.type}`,n)}return this._explicitQuantifiers?(this._subject===null?this._emit(this._graph||this.DEFAULTGRAPH,this._predicate,this._subject=this._factory.blankNode(),this.QUANTIFIERS_GRAPH):this._emit(this._subject,this.RDF_REST,this._subject=this._factory.blankNode(),this.QUANTIFIERS_GRAPH),this._emit(this._subject,this.RDF_FIRST,a,this.QUANTIFIERS_GRAPH)):this._quantified[a.id]=this._factory[this._quantifier](this._factory.blankNode().value),this._readQuantifierPunctuation}_readQuantifierPunctuation(n){return n.type===","?this._readQuantifierList:(this._explicitQuantifiers&&(this._emit(this._subject,this.RDF_REST,this.RDF_NIL,this.QUANTIFIERS_GRAPH),this._subject=null),this._readCallback=this._getContextEndReader(),this._readCallback(n))}_getPathReader(n){return this._afterPath=n,this._readPath}_readPath(n){switch(n.type){case"!":return this._readForwardPath;case"^":return this._readBackwardPath;default:let a=this._contextStack,l=a.length&&a[a.length-1];if(l&&l.type==="item"){let c=this._subject;this._restoreContext("item",n),this._emit(this._subject,this.RDF_FIRST,c,this._graph)}return this._afterPath(n)}}_readForwardPath(n){let a,l,c=this._factory.blankNode();if((l=this._readEntity(n))!==void 0)return this._predicate===null?(a=this._subject,this._subject=c):(a=this._object,this._object=c),this._emit(a,l,c,this._graph),this._readPath}_readBackwardPath(n){let a=this._factory.blankNode(),l,c;if((l=this._readEntity(n))!==void 0)return this._predicate===null?(c=this._subject,this._subject=a):(c=this._object,this._object=a),this._emit(a,l,c,this._graph),this._readPath}_readRDFStarTailOrGraph(n){return n.type!==">>"?this._supportsQuads&&this._graph===null&&(this._graph=this._readEntity(n))!==void 0?this._readRDFStarTail:this._error(`Expected >> to follow "${this._object.id}"`,n):this._readRDFStarTail(n)}_readRDFStarTail(n){if(n.type!==">>")return this._error(`Expected >> but got ${n.type}`,n);let a=this._factory.quad(this._subject,this._predicate,this._object,this._graph||this.DEFAULTGRAPH);return this._restoreContext("<<",n),this._subject===null?(this._subject=a,this._readPredicate):(this._object=a,this._getContextEndReader())}_getContextEndReader(){let n=this._contextStack;if(!n.length)return this._readPunctuation;switch(n[n.length-1].type){case"blank":return this._readBlankNodeTail;case"list":return this._readListItem;case"formula":return this._readFormulaTail;case"<<":return this._readRDFStarTailOrGraph}}_emit(n,a,l,c){this._callback(null,this._factory.quad(n,a,l,c||this.DEFAULTGRAPH))}_error(n,a){let l=new Error(`${n} on line ${a.line}.`);l.context={token:a,line:a.line,previousToken:this._lexer.previousToken},this._callback(l),this._callback=Rs}_resolveIRI(n){return/^[a-z][a-z0-9+.-]*:/i.test(n)?n:this._resolveRelativeIRI(n)}_resolveRelativeIRI(n){if(!n.length)return this._base;switch(n[0]){case"#":return this._base+n;case"?":return this._base.replace(/(?:\?.*)?$/,n);case"/":return(n[1]==="/"?this._baseScheme:this._baseRoot)+this._removeDotSegments(n);default:return/^[^/:]*:/.test(n)?null:this._removeDotSegments(this._basePath+n)}}_removeDotSegments(n){if(!/(^|\/)\.\.?($|[/#?])/.test(n))return n;let a=n.length,l="",c=-1,p=-1,g=0,y="/";for(;c<a;){switch(y){case":":if(p<0&&n[++c]==="/"&&n[++c]==="/")for(;(p=c+1)<a&&n[p]!=="/";)c=p;break;case"?":case"#":c=a;break;case"/":if(n[c+1]===".")switch(y=n[++c+1],y){case"/":l+=n.substring(g,c-1),g=c+1;break;case void 0:case"?":case"#":return l+n.substring(g,c)+n.substr(c+1);case".":if(y=n[++c+1],y===void 0||y==="/"||y==="?"||y==="#"){if(l+=n.substring(g,c-2),(g=l.lastIndexOf("/"))>=p&&(l=l.substr(0,g)),y!=="/")return`${l}/${n.substr(c+1)}`;g=c+1}}}y=n[++c]}return l+n.substring(g)}parse(n,a,l){let c,p,g;if(a&&(a.onQuad||a.onPrefix||a.onComment)?(c=a.onQuad,p=a.onPrefix,g=a.onComment):(c=a,p=l),this._readCallback=this._readInTopContext,this._sparqlStyle=!1,this._prefixes=Object.create(null),this._prefixes._=this._blankNodePrefix?this._blankNodePrefix.substr(2):`b${Mg++}_`,this._prefixCallback=p||Rs,this._inversePredicate=!1,this._quantified=Object.create(null),!c){let T=[],U;if(this._callback=(A,F)=>{A?U=A:F&&T.push(F)},this._lexer.tokenize(n).every(A=>this._readCallback=this._readCallback(A)),U)throw U;return T}let y=(T,U)=>{T!==null?(this._callback(T),this._callback=Rs):this._readCallback&&(this._readCallback=this._readCallback(U))};g&&(this._lexer.comments=!0,y=(T,U)=>{T!==null?(this._callback(T),this._callback=Rs):this._readCallback&&(U.type==="comment"?g(U.value):this._readCallback=this._readCallback(U))}),this._callback=c,this._lexer.tokenize(n,y)}};function Rs(){}function Gg(r,n){r._factory=n,r.DEFAULTGRAPH=n.defaultGraph(),r.RDF_FIRST=n.namedNode(gr.rdf.first),r.RDF_REST=n.namedNode(gr.rdf.rest),r.RDF_NIL=n.namedNode(gr.rdf.nil),r.N3_FORALL=n.namedNode(gr.r.forAll),r.N3_FORSOME=n.namedNode(gr.r.forSome),r.ABBREVIATIONS={a:n.namedNode(gr.rdf.type),"=":n.namedNode(gr.owl.sameAs),">":n.namedNode(gr.log.implies),"<":n.namedNode(gr.log.isImpliedBy)},r.QUANTIFIERS_GRAPH=n.namedNode("urn:n3:quantifiers")}Gg(oi.prototype,wg);function Tu(r){if(r.termType==="NamedNode")return{value:r.value,type:"uri"};if(r.termType==="Literal"){let n={value:r.value,type:"literal"},a=r.language;a&&(n["xml:lang"]=a);let l=r.datatypeString;return l&&(n.datatype=l),n}return r.termType==="BlankNode"?{value:r.value,type:"bnode"}:{value:r.value,type:"uri"}}function Og(r){let n=Iu(r),a=["subject","predicate","object"],l=n.map(c=>({subject:Tu(c.subject),predicate:Tu(c.predicate),object:Tu(c.object)}));return{head:{vars:a},results:{bindings:l}}}function Iu(r){return new oi().parse(r||"")}function f_(r){let n={vars:[]};for(let a=0;a<r.childNodes.length;a++){let l=r.childNodes[a];if(l.nodeName=="variable"){let c=l.getAttribute("name");c&&n.vars.push(c)}}return n}var c_=["uri","literal","bnode","typed-literal"];function d_(r,n){let a={bindings:[]};for(let l=0;l<r.childNodes.length;l++){let c=r.childNodes[l],p={};for(let g=0;g<c.childNodes.length;g++){let y=c.childNodes[g];if(y.nodeName=="binding"){let T=y.getAttribute("name");if(T)for(let U=0;U<y.childNodes.length;U++){let A=y.childNodes[U];if(A.nodeName==="#text"||c_.indexOf(A.nodeName)<0)continue;let F={type:A.nodeName,value:Wl(A.innerHTML)},M=A.getAttribute("datatype");M&&(F.datatype=M),p[T]=F}}}ms(p)||a.bindings.push(n(p))}return a}function h_(r){return r.innerHTML==="true"}function Eu(r,n){if(typeof r!="string")return;let l=new DOMParser().parseFromString(r,"text/xml");if(!l.childNodes.length)return;let c=l.childNodes[0],p={};for(let g=0;g<c.childNodes.length;g++){let y=c.childNodes[g];y.nodeName=="head"&&(p.head=f_(y)),y.nodeName=="results"&&(p.results=d_(y,n)),y.nodeName=="boolean"&&(p.boolean=h_(y))}return p}var Dg=Ar(Wg());function Zg(r){let n=Dg.parse(r,{header:!0,skipEmptyLines:!0});if(n.meta.fields===void 0)throw new Error("Could not parse CSV, no headers found!");let a=n.meta.fields,c=n.data.map(g=>{let y={};for(let T in g)y[T]={value:g[T],type:"literal"};return y});return{head:{vars:a},results:{bindings:c}}}function Vg(r){let n=r.split(`
42
- `);n.pop();let[a,...l]=n,c=a.split(" ").map(y=>y.substring(1)),p=l.map(y=>{let T={};for(let[U,A]of y.split(" ").entries()){let F=c[U];if(A[0]==="<")T[F]={value:A.substring(1,A.length-1),type:"uri"};else if(A[0]==='"'){let M=A.lastIndexOf('"'),X=A.substring(1,M);if(M===A.length-1)T[F]={value:X,type:"literal"};else if(M<A.lastIndexOf("@")){let S=A.substring(A.lastIndexOf("@")+1);T[F]={value:X,type:"literal","xml:lang":S}}else if(M<A.lastIndexOf("^^")){let S=A.substring(A.lastIndexOf("^^")+2);T[F]={value:X,type:"typed-literal",datatype:S}}}}return T});return{head:{vars:c},results:{bindings:p}}}function to(r){return r==null?"":`${r}`}function Ns(r={}){let{separator:n,decimals:a}=r;return n?a?l=>l.toFixed(a).replace(".",n):l=>`${l}`.replace(".",n):a?l=>l.toFixed(a):l=>`${l}`}function mn(r={}){let n=typeof r.quote=="string"?r.quote:'"',a=typeof r.escapedQuote=="string"?r.escapedQuote:`${n}${n}`;if(!n||n===a)return c=>c;let l=new RegExp(n,"g");return c=>(c.includes(n)&&(c=c.replace(l,a)),`${n}${c}${n}`)}var p_='"';var Kk=new RegExp(p_,"g");function Ss(r={stringFormatter:mn()}){return n=>r.stringFormatter(n.toString().slice(7,-1))}function ws(r={stringFormatter:mn()}){return n=>{if(n===null)return"";let a=JSON.stringify(n);return a===void 0?"":(a[0]==='"'&&(a=a.replace(/^"(.+)"$/,"$1")),r.stringFormatter(a))}}var g_=RegExp(`[^.[\\]]+|\\[(?:([^"'][^[]*)|(["'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))`,"g");function m_(r){var n,a,l;let c=[],p;for(;p=g_.exec(r);)c.push((l=(n=p[3])!==null&&n!==void 0?n:(a=p[1])===null||a===void 0?void 0:a.trim())!==null&&l!==void 0?l:p[0]);return c}function _u(r,n,a){if(n in r){let p=r[n];return p===void 0?a:p}let l=Array.isArray(n)?n:m_(n,r),c=r;for(let p of l)if(c=c?.[p],c===void 0)return a;return c}function Ls(r,n){try{return Array.isArray(n)?r.push(...n):r.push(n),r}catch{return r.concat(n)}}function ta(r,n){let a=!0;return r.reduce((l,c)=>(c==null&&(c=""),a?(a=!1,`${c}`):`${l}${n}${c}`),"")}var Ru;(function(r){r.header="header",r.undefined="undefined",r.boolean="boolean",r.number="number",r.bigint="bigint",r.string="string",r.symbol="symbol",r.function="function",r.object="object"})(Ru||(Ru={}));var ai=class{constructor(n){this.opts=this.preprocessOpts(n)}preprocessOpts(n){let a=Object.assign({},n);a.fields&&(a.fields=this.preprocessFieldsInfo(a.fields,a.defaultValue)),a.transforms=a.transforms||[];let l=a.formatters&&a.formatters.string||mn(),c=ws({stringFormatter:l}),p={header:l,undefined:to,boolean:to,number:Ns(),bigint:to,string:l,symbol:Ss({stringFormatter:l}),function:c,object:c};return a.formatters=Object.assign(Object.assign({},p),a.formatters),a.delimiter=a.delimiter||",",a.eol=a.eol||`
43
- `,a.header=a.header!==!1,a.includeEmptyRows=a.includeEmptyRows||!1,a.withBOM=a.withBOM||!1,a}preprocessFieldsInfo(n,a){return n.map(l=>{if(typeof l=="string")return{label:l,value:c=>_u(c,l,a)};if(typeof l=="object"){let c="default"in l?l.default:a;if(typeof l.value=="string"){let p=l.value;return{label:l.label||l.value,value:g=>_u(g,p,c)}}if(typeof l.value=="function"){let p=l.label||l.value.name||"",g={label:p,default:c},y=l.value;return{label:p,value(T){let U=y(T,g);return U===void 0?c:U}}}}throw new Error("Invalid field info option. "+JSON.stringify(l))})}getHeader(){return ta(this.opts.fields.map(n=>this.opts.formatters.header(n.label)),this.opts.delimiter)}preprocessRow(n){return this.opts.transforms.reduce((a,l)=>a.map(c=>l(c)).reduce(Ls,[]),[n])}processRow(n){if(!n)return;let a=this.opts.fields.map(l=>this.processCell(n,l));if(!(!this.opts.includeEmptyRows&&a.every(l=>l==="")))return ta(a,this.opts.delimiter)}processCell(n,a){return this.processValue(a.value(n))}processValue(n){let a=this.opts.formatters[typeof n];return a(n)}};var ro=class extends ai{constructor(n){super(n)}parse(n){let a=this.preprocessData(n);this.opts.fields=this.opts.fields||this.preprocessFieldsInfo(a.reduce((g,y)=>(Object.keys(y).forEach(T=>{g.includes(T)||g.push(T)}),g),[]),this.opts.defaultValue);let l=this.opts.header?this.getHeader():"",c=this.processData(a);return(this.opts.withBOM?"\uFEFF":"")+l+(l&&c?this.opts.eol:"")+c}preprocessData(n){let a=Array.isArray(n)?n:[n];if(!this.opts.fields){if(n==null||a.length===0)throw new Error('Data should not be empty or the "fields" option should be included');if(typeof a[0]!="object")throw new Error('Data items should be objects or the "fields" option should be included')}return this.opts.transforms.length===0?a:a.map(l=>this.preprocessRow(l)).reduce(Ls,[])}processData(n){return ta(n.map(a=>this.processRow(a)).filter(a=>a),this.opts.eol)}};var Ut;(function(r){r[r.BACKSPACE=8]="BACKSPACE",r[r.FORM_FEED=12]="FORM_FEED",r[r.NEWLINE=10]="NEWLINE",r[r.CARRIAGE_RETURN=13]="CARRIAGE_RETURN",r[r.TAB=9]="TAB",r[r.SPACE=32]="SPACE",r[r.EXCLAMATION_MARK=33]="EXCLAMATION_MARK",r[r.QUOTATION_MARK=34]="QUOTATION_MARK",r[r.NUMBER_SIGN=35]="NUMBER_SIGN",r[r.DOLLAR_SIGN=36]="DOLLAR_SIGN",r[r.PERCENT_SIGN=37]="PERCENT_SIGN",r[r.AMPERSAND=38]="AMPERSAND",r[r.APOSTROPHE=39]="APOSTROPHE",r[r.LEFT_PARENTHESIS=40]="LEFT_PARENTHESIS",r[r.RIGHT_PARENTHESIS=41]="RIGHT_PARENTHESIS",r[r.ASTERISK=42]="ASTERISK",r[r.PLUS_SIGN=43]="PLUS_SIGN",r[r.COMMA=44]="COMMA",r[r.HYPHEN_MINUS=45]="HYPHEN_MINUS",r[r.FULL_STOP=46]="FULL_STOP",r[r.SOLIDUS=47]="SOLIDUS",r[r.DIGIT_ZERO=48]="DIGIT_ZERO",r[r.DIGIT_ONE=49]="DIGIT_ONE",r[r.DIGIT_TWO=50]="DIGIT_TWO",r[r.DIGIT_THREE=51]="DIGIT_THREE",r[r.DIGIT_FOUR=52]="DIGIT_FOUR",r[r.DIGIT_FIVE=53]="DIGIT_FIVE",r[r.DIGIT_SIX=54]="DIGIT_SIX",r[r.DIGIT_SEVEN=55]="DIGIT_SEVEN",r[r.DIGIT_EIGHT=56]="DIGIT_EIGHT",r[r.DIGIT_NINE=57]="DIGIT_NINE",r[r.COLON=58]="COLON",r[r.SEMICOLON=59]="SEMICOLON",r[r.LESS_THAN_SIGN=60]="LESS_THAN_SIGN",r[r.EQUALS_SIGN=61]="EQUALS_SIGN",r[r.GREATER_THAN_SIGN=62]="GREATER_THAN_SIGN",r[r.QUESTION_MARK=63]="QUESTION_MARK",r[r.COMMERCIAL_AT=64]="COMMERCIAL_AT",r[r.LATIN_CAPITAL_LETTER_A=65]="LATIN_CAPITAL_LETTER_A",r[r.LATIN_CAPITAL_LETTER_B=66]="LATIN_CAPITAL_LETTER_B",r[r.LATIN_CAPITAL_LETTER_C=67]="LATIN_CAPITAL_LETTER_C",r[r.LATIN_CAPITAL_LETTER_D=68]="LATIN_CAPITAL_LETTER_D",r[r.LATIN_CAPITAL_LETTER_E=69]="LATIN_CAPITAL_LETTER_E",r[r.LATIN_CAPITAL_LETTER_F=70]="LATIN_CAPITAL_LETTER_F",r[r.LATIN_CAPITAL_LETTER_G=71]="LATIN_CAPITAL_LETTER_G",r[r.LATIN_CAPITAL_LETTER_H=72]="LATIN_CAPITAL_LETTER_H",r[r.LATIN_CAPITAL_LETTER_I=73]="LATIN_CAPITAL_LETTER_I",r[r.LATIN_CAPITAL_LETTER_J=74]="LATIN_CAPITAL_LETTER_J",r[r.LATIN_CAPITAL_LETTER_K=75]="LATIN_CAPITAL_LETTER_K",r[r.LATIN_CAPITAL_LETTER_L=76]="LATIN_CAPITAL_LETTER_L",r[r.LATIN_CAPITAL_LETTER_M=77]="LATIN_CAPITAL_LETTER_M",r[r.LATIN_CAPITAL_LETTER_N=78]="LATIN_CAPITAL_LETTER_N",r[r.LATIN_CAPITAL_LETTER_O=79]="LATIN_CAPITAL_LETTER_O",r[r.LATIN_CAPITAL_LETTER_P=80]="LATIN_CAPITAL_LETTER_P",r[r.LATIN_CAPITAL_LETTER_Q=81]="LATIN_CAPITAL_LETTER_Q",r[r.LATIN_CAPITAL_LETTER_R=82]="LATIN_CAPITAL_LETTER_R",r[r.LATIN_CAPITAL_LETTER_S=83]="LATIN_CAPITAL_LETTER_S",r[r.LATIN_CAPITAL_LETTER_T=84]="LATIN_CAPITAL_LETTER_T",r[r.LATIN_CAPITAL_LETTER_U=85]="LATIN_CAPITAL_LETTER_U",r[r.LATIN_CAPITAL_LETTER_V=86]="LATIN_CAPITAL_LETTER_V",r[r.LATIN_CAPITAL_LETTER_W=87]="LATIN_CAPITAL_LETTER_W",r[r.LATIN_CAPITAL_LETTER_X=88]="LATIN_CAPITAL_LETTER_X",r[r.LATIN_CAPITAL_LETTER_Y=89]="LATIN_CAPITAL_LETTER_Y",r[r.LATIN_CAPITAL_LETTER_Z=90]="LATIN_CAPITAL_LETTER_Z",r[r.LEFT_SQUARE_BRACKET=91]="LEFT_SQUARE_BRACKET",r[r.REVERSE_SOLIDUS=92]="REVERSE_SOLIDUS",r[r.RIGHT_SQUARE_BRACKET=93]="RIGHT_SQUARE_BRACKET",r[r.CIRCUMFLEX_ACCENT=94]="CIRCUMFLEX_ACCENT",r[r.LOW_LINE=95]="LOW_LINE",r[r.GRAVE_ACCENT=96]="GRAVE_ACCENT",r[r.LATIN_SMALL_LETTER_A=97]="LATIN_SMALL_LETTER_A",r[r.LATIN_SMALL_LETTER_B=98]="LATIN_SMALL_LETTER_B",r[r.LATIN_SMALL_LETTER_C=99]="LATIN_SMALL_LETTER_C",r[r.LATIN_SMALL_LETTER_D=100]="LATIN_SMALL_LETTER_D",r[r.LATIN_SMALL_LETTER_E=101]="LATIN_SMALL_LETTER_E",r[r.LATIN_SMALL_LETTER_F=102]="LATIN_SMALL_LETTER_F",r[r.LATIN_SMALL_LETTER_G=103]="LATIN_SMALL_LETTER_G",r[r.LATIN_SMALL_LETTER_H=104]="LATIN_SMALL_LETTER_H",r[r.LATIN_SMALL_LETTER_I=105]="LATIN_SMALL_LETTER_I",r[r.LATIN_SMALL_LETTER_J=106]="LATIN_SMALL_LETTER_J",r[r.LATIN_SMALL_LETTER_K=107]="LATIN_SMALL_LETTER_K",r[r.LATIN_SMALL_LETTER_L=108]="LATIN_SMALL_LETTER_L",r[r.LATIN_SMALL_LETTER_M=109]="LATIN_SMALL_LETTER_M",r[r.LATIN_SMALL_LETTER_N=110]="LATIN_SMALL_LETTER_N",r[r.LATIN_SMALL_LETTER_O=111]="LATIN_SMALL_LETTER_O",r[r.LATIN_SMALL_LETTER_P=112]="LATIN_SMALL_LETTER_P",r[r.LATIN_SMALL_LETTER_Q=113]="LATIN_SMALL_LETTER_Q",r[r.LATIN_SMALL_LETTER_R=114]="LATIN_SMALL_LETTER_R",r[r.LATIN_SMALL_LETTER_S=115]="LATIN_SMALL_LETTER_S",r[r.LATIN_SMALL_LETTER_T=116]="LATIN_SMALL_LETTER_T",r[r.LATIN_SMALL_LETTER_U=117]="LATIN_SMALL_LETTER_U",r[r.LATIN_SMALL_LETTER_V=118]="LATIN_SMALL_LETTER_V",r[r.LATIN_SMALL_LETTER_W=119]="LATIN_SMALL_LETTER_W",r[r.LATIN_SMALL_LETTER_X=120]="LATIN_SMALL_LETTER_X",r[r.LATIN_SMALL_LETTER_Y=121]="LATIN_SMALL_LETTER_Y",r[r.LATIN_SMALL_LETTER_Z=122]="LATIN_SMALL_LETTER_Z",r[r.LEFT_CURLY_BRACKET=123]="LEFT_CURLY_BRACKET",r[r.VERTICAL_LINE=124]="VERTICAL_LINE",r[r.RIGHT_CURLY_BRACKET=125]="RIGHT_CURLY_BRACKET",r[r.TILDE=126]="TILDE"})(Ut||(Ut={}));var b_={[Ut.QUOTATION_MARK]:Ut.QUOTATION_MARK,[Ut.REVERSE_SOLIDUS]:Ut.REVERSE_SOLIDUS,[Ut.SOLIDUS]:Ut.SOLIDUS,[Ut.LATIN_SMALL_LETTER_B]:Ut.BACKSPACE,[Ut.LATIN_SMALL_LETTER_F]:Ut.FORM_FEED,[Ut.LATIN_SMALL_LETTER_N]:Ut.NEWLINE,[Ut.LATIN_SMALL_LETTER_R]:Ut.CARRIAGE_RETURN,[Ut.LATIN_SMALL_LETTER_T]:Ut.TAB};var Qg;(function(r){r[r.LEFT_BRACE=0]="LEFT_BRACE",r[r.RIGHT_BRACE=1]="RIGHT_BRACE",r[r.LEFT_BRACKET=2]="LEFT_BRACKET",r[r.RIGHT_BRACKET=3]="RIGHT_BRACKET",r[r.COLON=4]="COLON",r[r.COMMA=5]="COMMA",r[r.TRUE=6]="TRUE",r[r.FALSE=7]="FALSE",r[r.NULL=8]="NULL",r[r.STRING=9]="STRING",r[r.NUMBER=10]="NUMBER",r[r.SEPARATOR=11]="SEPARATOR"})(Qg||(Qg={}));var Pg;(function(r){r[r.START=0]="START",r[r.ENDED=1]="ENDED",r[r.ERROR=2]="ERROR",r[r.TRUE1=3]="TRUE1",r[r.TRUE2=4]="TRUE2",r[r.TRUE3=5]="TRUE3",r[r.FALSE1=6]="FALSE1",r[r.FALSE2=7]="FALSE2",r[r.FALSE3=8]="FALSE3",r[r.FALSE4=9]="FALSE4",r[r.NULL1=10]="NULL1",r[r.NULL2=11]="NULL2",r[r.NULL3=12]="NULL3",r[r.STRING_DEFAULT=13]="STRING_DEFAULT",r[r.STRING_AFTER_BACKSLASH=14]="STRING_AFTER_BACKSLASH",r[r.STRING_UNICODE_DIGIT_1=15]="STRING_UNICODE_DIGIT_1",r[r.STRING_UNICODE_DIGIT_2=16]="STRING_UNICODE_DIGIT_2",r[r.STRING_UNICODE_DIGIT_3=17]="STRING_UNICODE_DIGIT_3",r[r.STRING_UNICODE_DIGIT_4=18]="STRING_UNICODE_DIGIT_4",r[r.STRING_INCOMPLETE_CHAR=19]="STRING_INCOMPLETE_CHAR",r[r.NUMBER_AFTER_INITIAL_MINUS=20]="NUMBER_AFTER_INITIAL_MINUS",r[r.NUMBER_AFTER_INITIAL_ZERO=21]="NUMBER_AFTER_INITIAL_ZERO",r[r.NUMBER_AFTER_INITIAL_NON_ZERO=22]="NUMBER_AFTER_INITIAL_NON_ZERO",r[r.NUMBER_AFTER_FULL_STOP=23]="NUMBER_AFTER_FULL_STOP",r[r.NUMBER_AFTER_DECIMAL=24]="NUMBER_AFTER_DECIMAL",r[r.NUMBER_AFTER_E=25]="NUMBER_AFTER_E",r[r.NUMBER_AFTER_E_AND_SIGN=26]="NUMBER_AFTER_E_AND_SIGN",r[r.NUMBER_AFTER_E_AND_DIGIT=27]="NUMBER_AFTER_E_AND_DIGIT",r[r.SEPARATOR=28]="SEPARATOR",r[r.BOM_OR_START=29]="BOM_OR_START",r[r.BOM=30]="BOM"})(Pg||(Pg={}));var Fs;(function(r){r[r.OBJECT=0]="OBJECT",r[r.ARRAY=1]="ARRAY"})(Fs||(Fs={}));var Hg;(function(r){r[r.VALUE=0]="VALUE",r[r.KEY=1]="KEY",r[r.COLON=2]="COLON",r[r.COMMA=3]="COMMA",r[r.ENDED=4]="ENDED",r[r.ERROR=5]="ERROR",r[r.SEPARATOR=6]="SEPARATOR"})(Hg||(Hg={}));function Yg(r){let n=r.head.vars,a=r.results?.bindings;return new ro({fields:n}).parse(a?a.map(c=>Mo(c,p=>p.value)):[])}var Bs=r=>{for(let n in r)r[n].type!=="uri"&&(r[n].value=r[n].value.replace(/{{(.*?)}}/g,a=>(a=a.substring(2,a.length-2).trim(),r[a]?r[a].value:a)));return r},Su=class{constructor(n,a){n.executionTime&&(this.executionTime=n.executionTime),a&&(this.executionTime=a),n instanceof Error?this.error=n:n.content?this.setResponse(n):this.setSummary(n)}setResponse(n){this.res=n}setSummary(n){!n.data&&!n.error?this.summary={data:n}:this.summary=n}hasError(){return!!(this.res&&this.res.status>=400||this.errorSummary||this.error||this.summary&&this.summary.error)}getError(){if(!this.errorSummary){if(this.res&&this.res.status>=400){let n=this.res.content||this.res.statusText;this.errorSummary={text:n,status:this.res.status,statusText:this.res.ok?void 0:this.res.statusText}}if(this.summary&&this.summary.error&&(this.errorSummary=this.summary.error),this.error){let n=this.error;this.errorSummary={text:this.error.message,status:n.status,statusText:n.statusText}}}return this.errorSummary}getContentType(){if(this.res)return this.res.headers.get("content-type")||void 0;if(this.summary)return this.summary.contentType}getAsJson(){if(this.json)return this.json;if(!(this.json===!1||this.hasError()))return this.getParserFromContentType()?this.json:this.doLuckyGuess()?this.json:(this.json||(this.json=!1),this.json)}getData(){if(this.res){if(this.res.content)return this.res.content;if(this.res.body)return this.res.body;if(this.res.text)return this.res.text}if(this.summary)return this.summary.data}getResponseTime(){return this.executionTime}getParserFromContentType(){let n=this.getContentType();if(n){let a=as(this.getData());try{if(n.indexOf("json")>-1){if(n.indexOf("sparql-results+json")>=0)return this.json=au(a,Bs),this.type="json",!0;if(n.indexOf("application/rdf+json")>-1)return this.type="json",!0;this.type="json"}else{if(n.indexOf("xml")>-1)return this.json=Eu(a,Bs),this.type="xml",!0;if(n.indexOf("csv")>-1)return this.json=Zg(a),this.type="csv",!0;if(n.indexOf("tab-separated")>-1)return this.json=Vg(a),this.type="tsv",!0;if(n.indexOf("turtle")>0||n.indexOf("trig")>0||n.indexOf("triple")>0||n.indexOf("quad")>0)return this.json=Og(a),this.type="ttl",!0}}catch(l){l instanceof Error?this.errorSummary={text:l.message}:this.errorSummary={text:l}}}return!1}doLuckyGuess(){let n=as(this.getData());try{return this.json=au(n,Bs),this.type="json",!0}catch{}try{return this.json=Eu(n,Bs),this.type="xml",!0}catch{}return!1}getVariables(){let n=this.getAsJson();return n&&n.head?n.head.vars:[]}getBoolean(){let n=this.getAsJson();if(n&&"boolean"in n)return n.boolean}getBindings(){let n=this.getAsJson();return n&&n.results?n.results.bindings:null}getStatements(){return!this.statements&&this.type==="ttl"&&(this.statements=Iu(this.getData())),this.statements?this.statements:null}getOriginalResponseAsString(){let n=this.getData();return typeof n=="string"?n:this.type==="json"?JSON.stringify(n,void 0,2):n}getType(){return this.type||this.getAsJson(),this.type}getStatus(){if(this.res)return this.res.status;if(this.summary)return this.summary.status}getAsStoreObject(n){let a=this.summary;if(!a&&this.res&&(a={contentType:this.getContentType(),data:this.getOriginalResponseAsString(),error:this.getError(),status:this.getStatus(),executionTime:this.getResponseTime()}),a)return a.data&&a.data.length>n?void 0:a;if(this.error)return{error:this.getError(),executionTime:this.getResponseTime()}}asCsv(){let n=this.getAsJson();if(this.type==="csv")return this.getOriginalResponseAsString();if(n&&n.results)return Yg(n)}},Us=Su;function ks(r){var n=document.createElement("link");n.setAttribute("rel","stylesheet"),n.setAttribute("type","text/css"),n.setAttribute("href",r),document.getElementsByTagName("head")[0].appendChild(n)}function Ms(r,n){return new Promise((a,l)=>{var c=document.createElement("script");c.setAttribute("type","text/javascript"),c.setAttribute("async",""),c.setAttribute("src",r),n&&(c.innerHTML=n),c.onload=()=>a(),document.getElementsByTagName("head")[0].appendChild(c)})}Vo.addHook("afterSanitizeAttributes",r=>{r instanceof HTMLAnchorElement&&(r.target="_blank",r.rel="noopener noreferrer")});var wu=Vo.sanitize;var ra=class{constructor(n){this.priority=10;this.hideFromSelection=!0;this.yasr=n}draw(){let n=document.createElement("div");n.className="booleanResult";let a=this.yasr.results?.getBoolean(),l=document.createElement("i");l.className=a?"fas fa-check":"fas fa-xmark",n.appendChild(l);let c=document.createElement("span");c.textContent=a?"True":"False",n.appendChild(c),this.yasr.resultsEl.appendChild(n)}canHandleResults(){return!!this.yasr.results?.getBoolean&&(this.yasr.results.getBoolean()===!0||this.yasr.results.getBoolean()==!1)}getIcon(){return document.createElement("")}};var gm=Ar(bn()),FG=Ar(Bu()),BG=Ar($g()),UG=Ar(rm()),kG=Ar(om()),MG=Ar(lm()),GG=Ar(cm()),OG=Ar(pm());var Gs=class Gs{constructor(n){this.label="Response";this.priority=2;this.helpReference="https://docs.triply.cc/yasgui/#response";this.yasr=n,this.config=Gs.defaults,n.config.plugins.response&&n.config.plugins.response.dynamicConfig&&(this.config={...this.config,...n.config.plugins.response.dynamicConfig})}canHandleResults(){if(!this.yasr.results||!this.yasr.results.getOriginalResponseAsString)return!1;var n=this.yasr.results.getOriginalResponseAsString();return!((!n||n.length==0)&&this.yasr.results.getError())}getIcon(){let n=document.createElement("i");return n.className="fas fa-align-left",n}download(n){if(!this.yasr.results)return;let a=this.yasr.results.getContentType(),l=this.yasr.results.getType(),c=l==="xml"?"rdf":l;return{getData:()=>this.yasr.results?.getOriginalResponseAsString()||"",filename:`${n||"queryResults"}${c?"."+c:""}`,contentType:a||"text/plain",title:"Download result"}}draw(n){let a={...this.config,...n},l=this.yasr.results?.getOriginalResponseAsString()||"",c=l.split(`
39
+ outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var C;T&&(C=s.ownerDocument.defaultView.scrollY),i.input.focus(),T&&s.ownerDocument.defaultView.scrollTo(null,C),i.input.reset(),o.somethingSelected()||(s.value=t.prevInput=" "),t.contextMenuPending=L,i.selForContextMenu=o.doc.sel,clearTimeout(i.detectingSelectAll);function B(){if(s.selectionStart!=null){var H=o.somethingSelected(),z="\u200B"+(H?s.value:"");s.value="\u21DA",s.value=z,t.prevInput=H?"":"\u200B",s.selectionStart=1,s.selectionEnd=z.length,i.selForContextMenu=o.doc.sel}}function L(){if(t.contextMenuPending==L&&(t.contextMenuPending=!1,t.wrapper.style.cssText=b,s.style.cssText=m,g&&y<9&&i.scrollbars.setScrollTop(i.scroller.scrollTop=d),s.selectionStart!=null)){(!g||g&&y<9)&&B();var H=0,z=function(){i.selForContextMenu==o.doc.sel&&s.selectionStart==0&&s.selectionEnd>0&&t.prevInput=="\u200B"?St(o,Kf)(o):H++<10?i.detectingSelectAll=setTimeout(z,500):(i.selForContextMenu=null,i.input.reset())};i.detectingSelectAll=setTimeout(z,200)}}if(g&&y>=9&&B(),P){Wr(e);var W=function(){Ct(window,"mouseup",W),setTimeout(L,20)};Ie(window,"mouseup",W)}else setTimeout(L,50)},gt.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},gt.prototype.setUneditable=function(){},gt.prototype.needsContentAttribute=!1;function hb(e,t){if(t=t?le(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),t.autofocus==null){var o=ge(Ce(e));t.autofocus=o==e||e.getAttribute("autofocus")!=null&&o==document.body}function i(){e.value=h.getValue()}var s;if(e.form&&(Ie(e.form,"submit",i),!t.leaveSubmitMethodAlone)){var u=e.form;s=u.submit;try{var d=u.submit=function(){i(),u.submit=s,u.submit(),u.submit=d}}catch{}}t.finishInit=function(m){m.save=i,m.getTextArea=function(){return e},m.toTextArea=function(){m.toTextArea=isNaN,i(),e.parentNode.removeChild(m.getWrapperElement()),e.style.display="",e.form&&(Ct(e.form,"submit",i),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=s))}},e.style.display="none";var h=ot(function(m){return e.parentNode.insertBefore(m,e.nextSibling)},t);return h}function pb(e){e.off=Ct,e.on=Ie,e.wheelEventPixels=T0,e.Doc=Kt,e.splitLines=jt,e.countColumn=ye,e.findColumn=De,e.isWordChar=ze,e.Pass=Je,e.signal=Ke,e.Line=fi,e.changeEnd=Rn,e.scrollbarModel=Nf,e.Pos=O,e.cmpPos=ce,e.modes=tn,e.mimeModes=ur,e.resolveMode=Tn,e.getMode=xe,e.modeExtensions=N,e.extendMode=K,e.copyState=be,e.startState=dt,e.innerMode=Ye,e.commands=Ro,e.keyMap=sn,e.keyName=pc,e.isModifierKey=dc,e.lookupKey=Ei,e.normalizeKeyMap=Q0,e.StringStream=Ue,e.SharedTextMarker=Eo,e.TextMarker=Nn,e.LineWidget=Io,e.e_preventDefault=At,e.e_stopPropagation=rt,e.e_stop=Wr,e.addClass=Oe,e.contains=de,e.rmClass=fe,e.keyNames=Sn}ob(ot),ub(ot);var gb="iter insert remove copy getEditor constructor".split(" ");for(var Ua in Kt.prototype)Kt.prototype.hasOwnProperty(Ua)&&ue(gb,Ua)<0&&(ot.prototype[Ua]=function(e){return function(){return e.apply(this.doc,arguments)}}(Kt.prototype[Ua]));return xr(Kt),ot.inputStyles={textarea:gt,contenteditable:je},ot.defineMode=function(e){!ot.defaults.mode&&e!="null"&&(ot.defaults.mode=e),fr.apply(this,arguments)},ot.defineMIME=Dr,ot.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),ot.defineMIME("text/plain","null"),ot.defineExtension=function(e,t){ot.prototype[e]=t},ot.defineDocExtension=function(e,t){Kt.prototype[e]=t},ot.fromTextArea=hb,pb(ot),ot.version="5.65.20",ot})});var Bu=at((jg,zg)=>{(function(r){typeof jg=="object"&&typeof zg=="object"?r(bn()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],r):r(CodeMirror)})(function(r){"use strict";function n(p,g,y,T){if(y&&y.call){var U=y;y=null}else var U=c(p,y,"rangeFinder");typeof g=="number"&&(g=r.Pos(g,0));var A=c(p,y,"minFoldSize");function F(Z){var _=U(p,g);if(!_||_.to.line-_.from.line<A)return null;if(T==="fold")return _;for(var G=p.findMarksAt(_.from),J=0;J<G.length;++J)if(G[J].__isFold){if(!Z)return null;_.cleared=!0,G[J].clear()}return _}var M=F(!0);if(c(p,y,"scanUp"))for(;!M&&g.line>p.firstLine();)g=r.Pos(g.line-1,0),M=F(!1);if(!(!M||M.cleared||T==="unfold")){var X=a(p,y,M);r.on(X,"mousedown",function(Z){S.clear(),r.e_preventDefault(Z)});var S=p.markText(M.from,M.to,{replacedWith:X,clearOnEnter:c(p,y,"clearOnEnter"),__isFold:!0});S.on("clear",function(Z,_){r.signal(p,"unfold",p,Z,_)}),r.signal(p,"fold",p,M.from,M.to)}}function a(p,g,y){var T=c(p,g,"widget");if(typeof T=="function"&&(T=T(y.from,y.to)),typeof T=="string"){var U=document.createTextNode(T);T=document.createElement("span"),T.appendChild(U),T.className="CodeMirror-foldmarker"}else T&&(T=T.cloneNode(!0));return T}r.newFoldFunction=function(p,g){return function(y,T){n(y,T,{rangeFinder:p,widget:g})}},r.defineExtension("foldCode",function(p,g,y){n(this,p,g,y)}),r.defineExtension("isFolded",function(p){for(var g=this.findMarksAt(p),y=0;y<g.length;++y)if(g[y].__isFold)return!0}),r.commands.toggleFold=function(p){p.foldCode(p.getCursor())},r.commands.fold=function(p){p.foldCode(p.getCursor(),null,"fold")},r.commands.unfold=function(p){p.foldCode(p.getCursor(),{scanUp:!1},"unfold")},r.commands.foldAll=function(p){p.operation(function(){for(var g=p.firstLine(),y=p.lastLine();g<=y;g++)p.foldCode(r.Pos(g,0),{scanUp:!1},"fold")})},r.commands.unfoldAll=function(p){p.operation(function(){for(var g=p.firstLine(),y=p.lastLine();g<=y;g++)p.foldCode(r.Pos(g,0),{scanUp:!1},"unfold")})},r.registerHelper("fold","combine",function(){var p=Array.prototype.slice.call(arguments,0);return function(g,y){for(var T=0;T<p.length;++T){var U=p[T](g,y);if(U)return U}}}),r.registerHelper("fold","auto",function(p,g){for(var y=p.getHelpers(g,"fold"),T=0;T<y.length;T++){var U=y[T](p,g);if(U)return U}});var l={rangeFinder:r.fold.auto,widget:"\u2194",minFoldSize:0,scanUp:!1,clearOnEnter:!0};r.defineOption("foldOptions",null);function c(p,g,y){if(g&&g[y]!==void 0)return g[y];var T=p.options.foldOptions;return T&&T[y]!==void 0?T[y]:l[y]}r.defineExtension("foldOption",function(p,g){return c(this,p,g)})})});var $g=at((qg,Kg)=>{(function(r){typeof qg=="object"&&typeof Kg=="object"?r(bn(),Bu()):typeof define=="function"&&define.amd?define(["../../lib/codemirror","./foldcode"],r):r(CodeMirror)})(function(r){"use strict";r.defineOption("foldGutter",!1,function(S,Z,_){_&&_!=r.Init&&(S.clearGutter(S.state.foldGutter.options.gutter),S.state.foldGutter=null,S.off("gutterClick",U),S.off("changes",F),S.off("viewportChange",M),S.off("fold",X),S.off("unfold",X),S.off("swapDoc",F),S.off("optionChange",A)),Z&&(S.state.foldGutter=new a(l(Z)),T(S),S.on("gutterClick",U),S.on("changes",F),S.on("viewportChange",M),S.on("fold",X),S.on("unfold",X),S.on("swapDoc",F),S.on("optionChange",A))});var n=r.Pos;function a(S){this.options=S,this.from=this.to=0}function l(S){return S===!0&&(S={}),S.gutter==null&&(S.gutter="CodeMirror-foldgutter"),S.indicatorOpen==null&&(S.indicatorOpen="CodeMirror-foldgutter-open"),S.indicatorFolded==null&&(S.indicatorFolded="CodeMirror-foldgutter-folded"),S}function c(S,Z){for(var _=S.findMarks(n(Z,0),n(Z+1,0)),G=0;G<_.length;++G)if(_[G].__isFold){var J=_[G].find(-1);if(J&&J.line===Z)return _[G]}}function p(S){if(typeof S=="string"){var Z=document.createElement("div");return Z.className=S+" CodeMirror-guttermarker-subtle",Z}else return S.cloneNode(!0)}function g(S,Z,_){var G=S.state.foldGutter.options,J=Z-1,q=S.foldOption(G,"minFoldSize"),te=S.foldOption(G,"rangeFinder"),ae=typeof G.indicatorFolded=="string"&&y(G.indicatorFolded),R=typeof G.indicatorOpen=="string"&&y(G.indicatorOpen);S.eachLine(Z,_,function(w){++J;var P=null,$=w.gutterMarkers;if($&&($=$[G.gutter]),c(S,J)){if(ae&&$&&ae.test($.className))return;P=p(G.indicatorFolded)}else{var fe=n(J,0),k=te&&te(S,fe);if(k&&k.to.line-k.from.line>=q){if(R&&$&&R.test($.className))return;P=p(G.indicatorOpen)}}!P&&!$||S.setGutterMarker(w,G.gutter,P)})}function y(S){return new RegExp("(^|\\s)"+S+"(?:$|\\s)\\s*")}function T(S){var Z=S.getViewport(),_=S.state.foldGutter;_&&(S.operation(function(){g(S,Z.from,Z.to)}),_.from=Z.from,_.to=Z.to)}function U(S,Z,_){var G=S.state.foldGutter;if(G){var J=G.options;if(_==J.gutter){var q=c(S,Z);q?q.clear():S.foldCode(n(Z,0),J)}}}function A(S,Z){Z=="mode"&&F(S)}function F(S){var Z=S.state.foldGutter;if(Z){var _=Z.options;Z.from=Z.to=0,clearTimeout(Z.changeUpdate),Z.changeUpdate=setTimeout(function(){T(S)},_.foldOnChangeTimeSpan||600)}}function M(S){var Z=S.state.foldGutter;if(Z){var _=Z.options;clearTimeout(Z.changeUpdate),Z.changeUpdate=setTimeout(function(){var G=S.getViewport();Z.from==Z.to||G.from-Z.to>20||Z.from-G.to>20?T(S):S.operation(function(){G.from<Z.from&&(g(S,G.from,Z.from),Z.from=G.from),G.to>Z.to&&(g(S,Z.to,G.to),Z.to=G.to)})},_.updateViewportTimeSpan||400)}}function X(S,Z){var _=S.state.foldGutter;if(_){var G=Z.line;G>=_.from&&G<_.to&&g(S,G,G+1)}}})});var rm=at((em,tm)=>{(function(r){typeof em=="object"&&typeof tm=="object"?r(bn()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],r):r(CodeMirror)})(function(r){"use strict";var n=r.Pos;function a(_,G){return _.line-G.line||_.ch-G.ch}var l="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",c=l+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",p=new RegExp("<(/?)(["+l+"]["+c+"]*)","g");function g(_,G,J,q){this.line=G,this.ch=J,this.cm=_,this.text=_.getLine(G),this.min=q?Math.max(q.from,_.firstLine()):_.firstLine(),this.max=q?Math.min(q.to-1,_.lastLine()):_.lastLine()}function y(_,G){var J=_.cm.getTokenTypeAt(n(_.line,G));return J&&/\btag\b/.test(J)}function T(_){if(!(_.line>=_.max))return _.ch=0,_.text=_.cm.getLine(++_.line),!0}function U(_){if(!(_.line<=_.min))return _.text=_.cm.getLine(--_.line),_.ch=_.text.length,!0}function A(_){for(;;){var G=_.text.indexOf(">",_.ch);if(G==-1){if(T(_))continue;return}if(!y(_,G+1)){_.ch=G+1;continue}var J=_.text.lastIndexOf("/",G),q=J>-1&&!/\S/.test(_.text.slice(J+1,G));return _.ch=G+1,q?"selfClose":"regular"}}function F(_){for(;;){var G=_.ch?_.text.lastIndexOf("<",_.ch-1):-1;if(G==-1){if(U(_))continue;return}if(!y(_,G+1)){_.ch=G;continue}p.lastIndex=G,_.ch=G;var J=p.exec(_.text);if(J&&J.index==G)return J}}function M(_){for(;;){p.lastIndex=_.ch;var G=p.exec(_.text);if(!G){if(T(_))continue;return}if(!y(_,G.index+1)){_.ch=G.index+1;continue}return _.ch=G.index+G[0].length,G}}function X(_){for(;;){var G=_.ch?_.text.lastIndexOf(">",_.ch-1):-1;if(G==-1){if(U(_))continue;return}if(!y(_,G+1)){_.ch=G;continue}var J=_.text.lastIndexOf("/",G),q=J>-1&&!/\S/.test(_.text.slice(J+1,G));return _.ch=G+1,q?"selfClose":"regular"}}function S(_,G){for(var J=[];;){var q=M(_),te,ae=_.line,R=_.ch-(q?q[0].length:0);if(!q||!(te=A(_)))return;if(te!="selfClose")if(q[1]){for(var w=J.length-1;w>=0;--w)if(J[w]==q[2]){J.length=w;break}if(w<0&&(!G||G==q[2]))return{tag:q[2],from:n(ae,R),to:n(_.line,_.ch)}}else J.push(q[2])}}function Z(_,G){for(var J=[];;){var q=X(_);if(!q)return;if(q=="selfClose"){F(_);continue}var te=_.line,ae=_.ch,R=F(_);if(!R)return;if(R[1])J.push(R[2]);else{for(var w=J.length-1;w>=0;--w)if(J[w]==R[2]){J.length=w;break}if(w<0&&(!G||G==R[2]))return{tag:R[2],from:n(_.line,_.ch),to:n(te,ae)}}}}r.registerHelper("fold","xml",function(_,G){for(var J=new g(_,G.line,0);;){var q=M(J);if(!q||J.line!=G.line)return;var te=A(J);if(!te)return;if(!q[1]&&te!="selfClose"){var ae=n(J.line,J.ch),R=S(J,q[2]);return R&&a(R.from,ae)>0?{from:ae,to:R.from}:null}}}),r.findMatchingTag=function(_,G,J){var q=new g(_,G.line,G.ch,J);if(!(q.text.indexOf(">")==-1&&q.text.indexOf("<")==-1)){var te=A(q),ae=te&&n(q.line,q.ch),R=te&&F(q);if(!(!te||!R||a(q,G)>0)){var w={from:n(q.line,q.ch),to:ae,tag:R[2]};return te=="selfClose"?{open:w,close:null,at:"open"}:R[1]?{open:Z(q,R[2]),close:w,at:"close"}:(q=new g(_,ae.line,ae.ch,J),{open:w,close:S(q,R[2]),at:"open"})}}},r.findEnclosingTag=function(_,G,J,q){for(var te=new g(_,G.line,G.ch,J);;){var ae=Z(te,q);if(!ae)break;var R=new g(_,G.line,G.ch,J),w=S(R,ae.tag);if(w)return{open:ae,close:w}}},r.scanForClosingTag=function(_,G,J,q){var te=new g(_,G.line,G.ch,q?{from:0,to:q}:null);return S(te,J)}})});var om=at((nm,im)=>{(function(r){typeof nm=="object"&&typeof im=="object"?r(bn()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],r):r(CodeMirror)})(function(r){"use strict";function n(a){return function(l,c){var p=c.line,g=l.getLine(p);function y(X){for(var S,Z=c.ch,_=0;;){var G=Z<=0?-1:g.lastIndexOf(X[0],Z-1);if(G==-1){if(_==1)break;_=1,Z=g.length;continue}if(_==1&&G<c.ch)break;if(S=l.getTokenTypeAt(r.Pos(p,G+1)),!/^(comment|string)/.test(S))return{ch:G+1,tokenType:S,pair:X};Z=G-1}}function T(X){var S=1,Z=l.lastLine(),_,G=X.ch,J;e:for(var q=p;q<=Z;++q)for(var te=l.getLine(q),ae=q==p?G:0;;){var R=te.indexOf(X.pair[0],ae),w=te.indexOf(X.pair[1],ae);if(R<0&&(R=te.length),w<0&&(w=te.length),ae=Math.min(R,w),ae==te.length)break;if(l.getTokenTypeAt(r.Pos(q,ae+1))==X.tokenType){if(ae==R)++S;else if(!--S){_=q,J=ae;break e}}++ae}return _==null||p==_?null:{from:r.Pos(p,G),to:r.Pos(_,J)}}for(var U=[],A=0;A<a.length;A++){var F=y(a[A]);F&&U.push(F)}U.sort(function(X,S){return X.ch-S.ch});for(var A=0;A<U.length;A++){var M=T(U[A]);if(M)return M}return null}}r.registerHelper("fold","brace",n([["{","}"],["[","]"]])),r.registerHelper("fold","brace-paren",n([["{","}"],["[","]"],["(",")"]])),r.registerHelper("fold","import",function(a,l){function c(A){if(A<a.firstLine()||A>a.lastLine())return null;var F=a.getTokenAt(r.Pos(A,1));if(/\S/.test(F.string)||(F=a.getTokenAt(r.Pos(A,F.end+1))),F.type!="keyword"||F.string!="import")return null;for(var M=A,X=Math.min(a.lastLine(),A+10);M<=X;++M){var S=a.getLine(M),Z=S.indexOf(";");if(Z!=-1)return{startCh:F.end,end:r.Pos(M,Z)}}}var p=l.line,g=c(p),y;if(!g||c(p-1)||(y=c(p-2))&&y.end.line==p-1)return null;for(var T=g.end;;){var U=c(T.line+1);if(U==null)break;T=U.end}return{from:a.clipPos(r.Pos(p,g.startCh+1)),to:T}}),r.registerHelper("fold","include",function(a,l){function c(U){if(U<a.firstLine()||U>a.lastLine())return null;var A=a.getTokenAt(r.Pos(U,1));if(/\S/.test(A.string)||(A=a.getTokenAt(r.Pos(U,A.end+1))),A.type=="meta"&&A.string.slice(0,8)=="#include")return A.start+8}var p=l.line,g=c(p);if(g==null||c(p-1)!=null)return null;for(var y=p;;){var T=c(y+1);if(T==null)break;++y}return{from:r.Pos(p,g+1),to:a.clipPos(r.Pos(y))}})})});var lm=at((am,sm)=>{(function(r){typeof am=="object"&&typeof sm=="object"?r(bn()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],r):r(CodeMirror)})(function(r){var n=/MSIE \d/.test(navigator.userAgent)&&(document.documentMode==null||document.documentMode<8),a=r.Pos,l={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<","<":">>",">":"<<"};function c(A){return A&&A.bracketRegex||/[(){}[\]]/}function p(A,F,M){var X=A.getLineHandle(F.line),S=F.ch-1,Z=M&&M.afterCursor;Z==null&&(Z=/(^| )cm-fat-cursor($| )/.test(A.getWrapperElement().className));var _=c(M),G=!Z&&S>=0&&_.test(X.text.charAt(S))&&l[X.text.charAt(S)]||_.test(X.text.charAt(S+1))&&l[X.text.charAt(++S)];if(!G)return null;var J=G.charAt(1)==">"?1:-1;if(M&&M.strict&&J>0!=(S==F.ch))return null;var q=A.getTokenTypeAt(a(F.line,S+1)),te=g(A,a(F.line,S+(J>0?1:0)),J,q,M);return te==null?null:{from:a(F.line,S),to:te&&te.pos,match:te&&te.ch==G.charAt(0),forward:J>0}}function g(A,F,M,X,S){for(var Z=S&&S.maxScanLineLength||1e4,_=S&&S.maxScanLines||1e3,G=[],J=c(S),q=M>0?Math.min(F.line+_,A.lastLine()+1):Math.max(A.firstLine()-1,F.line-_),te=F.line;te!=q;te+=M){var ae=A.getLine(te);if(ae){var R=M>0?0:ae.length-1,w=M>0?ae.length:-1;if(!(ae.length>Z))for(te==F.line&&(R=F.ch-(M<0?1:0));R!=w;R+=M){var P=ae.charAt(R);if(J.test(P)&&(X===void 0||(A.getTokenTypeAt(a(te,R+1))||"")==(X||""))){var $=l[P];if($&&$.charAt(1)==">"==M>0)G.push(P);else if(G.length)G.pop();else return{pos:a(te,R),ch:P}}}}}return te-M==(M>0?A.lastLine():A.firstLine())?!1:null}function y(A,F,M){for(var X=A.state.matchBrackets.maxHighlightLineLength||1e3,S=M&&M.highlightNonMatching,Z=[],_=A.listSelections(),G=0;G<_.length;G++){var J=_[G].empty()&&p(A,_[G].head,M);if(J&&(J.match||S!==!1)&&A.getLine(J.from.line).length<=X){var q=J.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket";Z.push(A.markText(J.from,a(J.from.line,J.from.ch+1),{className:q})),J.to&&A.getLine(J.to.line).length<=X&&Z.push(A.markText(J.to,a(J.to.line,J.to.ch+1),{className:q}))}}if(Z.length){n&&A.state.focused&&A.focus();var te=function(){A.operation(function(){for(var ae=0;ae<Z.length;ae++)Z[ae].clear()})};if(F)setTimeout(te,800);else return te}}function T(A){A.operation(function(){A.state.matchBrackets.currentlyHighlighted&&(A.state.matchBrackets.currentlyHighlighted(),A.state.matchBrackets.currentlyHighlighted=null),A.state.matchBrackets.currentlyHighlighted=y(A,!1,A.state.matchBrackets)})}function U(A){A.state.matchBrackets&&A.state.matchBrackets.currentlyHighlighted&&(A.state.matchBrackets.currentlyHighlighted(),A.state.matchBrackets.currentlyHighlighted=null)}r.defineOption("matchBrackets",!1,function(A,F,M){M&&M!=r.Init&&(A.off("cursorActivity",T),A.off("focus",T),A.off("blur",U),U(A)),F&&(A.state.matchBrackets=typeof F=="object"?F:{},A.on("cursorActivity",T),A.on("focus",T),A.on("blur",U))}),r.defineExtension("matchBrackets",function(){y(this,!0)}),r.defineExtension("findMatchingBracket",function(A,F,M){return(M||typeof F=="boolean")&&(M?(M.strict=F,F=M):F=F?{strict:!0}:null),p(this,A,F)}),r.defineExtension("scanForBracket",function(A,F,M,X){return g(this,A,F,M,X)})})});var cm=at((um,fm)=>{(function(r){typeof um=="object"&&typeof fm=="object"?r(bn()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],r):r(CodeMirror)})(function(r){"use strict";var n={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},a={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};r.defineMode("xml",function(l,c){var p=l.indentUnit,g={},y=c.htmlMode?n:a;for(var T in y)g[T]=y[T];for(var T in c)g[T]=c[T];var U,A;function F(x,ee){function D(Oe){return ee.tokenize=Oe,Oe(x,ee)}var de=x.next();if(de=="<")return x.eat("!")?x.eat("[")?x.match("CDATA[")?D(S("atom","]]>")):null:x.match("--")?D(S("comment","-->")):x.match("DOCTYPE",!0,!0)?(x.eatWhile(/[\w\._\-]/),D(Z(1))):null:x.eat("?")?(x.eatWhile(/[\w\._\-]/),ee.tokenize=S("meta","?>"),"meta"):(U=x.eat("/")?"closeTag":"openTag",ee.tokenize=M,"tag bracket");if(de=="&"){var ge;return x.eat("#")?x.eat("x")?ge=x.eatWhile(/[a-fA-F\d]/)&&x.eat(";"):ge=x.eatWhile(/[\d]/)&&x.eat(";"):ge=x.eatWhile(/[\w\.\-:]/)&&x.eat(";"),ge?"atom":"error"}else return x.eatWhile(/[^&<]/),null}F.isInText=!0;function M(x,ee){var D=x.next();if(D==">"||D=="/"&&x.eat(">"))return ee.tokenize=F,U=D==">"?"endTag":"selfcloseTag","tag bracket";if(D=="=")return U="equals",null;if(D=="<"){ee.tokenize=F,ee.state=te,ee.tagName=ee.tagStart=null;var de=ee.tokenize(x,ee);return de?de+" tag error":"tag error"}else return/[\'\"]/.test(D)?(ee.tokenize=X(D),ee.stringStartCol=x.column(),ee.tokenize(x,ee)):(x.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function X(x){var ee=function(D,de){for(;!D.eol();)if(D.next()==x){de.tokenize=M;break}return"string"};return ee.isInAttribute=!0,ee}function S(x,ee){return function(D,de){for(;!D.eol();){if(D.match(ee)){de.tokenize=F;break}D.next()}return x}}function Z(x){return function(ee,D){for(var de;(de=ee.next())!=null;){if(de=="<")return D.tokenize=Z(x+1),D.tokenize(ee,D);if(de==">")if(x==1){D.tokenize=F;break}else return D.tokenize=Z(x-1),D.tokenize(ee,D)}return"meta"}}function _(x){return x&&x.toLowerCase()}function G(x,ee,D){this.prev=x.context,this.tagName=ee||"",this.indent=x.indented,this.startOfLine=D,(g.doNotIndent.hasOwnProperty(ee)||x.context&&x.context.noIndent)&&(this.noIndent=!0)}function J(x){x.context&&(x.context=x.context.prev)}function q(x,ee){for(var D;;){if(!x.context||(D=x.context.tagName,!g.contextGrabbers.hasOwnProperty(_(D))||!g.contextGrabbers[_(D)].hasOwnProperty(_(ee))))return;J(x)}}function te(x,ee,D){return x=="openTag"?(D.tagStart=ee.column(),ae):x=="closeTag"?R:te}function ae(x,ee,D){return x=="word"?(D.tagName=ee.current(),A="tag",$):g.allowMissingTagName&&x=="endTag"?(A="tag bracket",$(x,ee,D)):(A="error",ae)}function R(x,ee,D){if(x=="word"){var de=ee.current();return D.context&&D.context.tagName!=de&&g.implicitlyClosed.hasOwnProperty(_(D.context.tagName))&&J(D),D.context&&D.context.tagName==de||g.matchClosing===!1?(A="tag",w):(A="tag error",P)}else return g.allowMissingTagName&&x=="endTag"?(A="tag bracket",w(x,ee,D)):(A="error",P)}function w(x,ee,D){return x!="endTag"?(A="error",w):(J(D),te)}function P(x,ee,D){return A="error",w(x,ee,D)}function $(x,ee,D){if(x=="word")return A="attribute",fe;if(x=="endTag"||x=="selfcloseTag"){var de=D.tagName,ge=D.tagStart;return D.tagName=D.tagStart=null,x=="selfcloseTag"||g.autoSelfClosers.hasOwnProperty(_(de))?q(D,de):(q(D,de),D.context=new G(D,de,ge==D.indented)),te}return A="error",$}function fe(x,ee,D){return x=="equals"?k:(g.allowMissing||(A="error"),$(x,ee,D))}function k(x,ee,D){return x=="string"?oe:x=="word"&&g.allowUnquoted?(A="string",$):(A="error",$(x,ee,D))}function oe(x,ee,D){return x=="string"?oe:$(x,ee,D)}return{startState:function(x){var ee={tokenize:F,state:te,indented:x||0,tagName:null,tagStart:null,context:null};return x!=null&&(ee.baseIndent=x),ee},token:function(x,ee){if(!ee.tagName&&x.sol()&&(ee.indented=x.indentation()),x.eatSpace())return null;U=null;var D=ee.tokenize(x,ee);return(D||U)&&D!="comment"&&(A=null,ee.state=ee.state(U||D,x,ee),A&&(D=A=="error"?D+" error":A)),D},indent:function(x,ee,D){var de=x.context;if(x.tokenize.isInAttribute)return x.tagStart==x.indented?x.stringStartCol+1:x.indented+p;if(de&&de.noIndent)return r.Pass;if(x.tokenize!=M&&x.tokenize!=F)return D?D.match(/^(\s*)/)[0].length:0;if(x.tagName)return g.multilineTagIndentPastTag!==!1?x.tagStart+x.tagName.length+2:x.tagStart+p*(g.multilineTagIndentFactor||1);if(g.alignCDATA&&/<!\[CDATA\[/.test(ee))return 0;var ge=ee&&/^<(\/)?([\w_:\.-]*)/.exec(ee);if(ge&&ge[1])for(;de;)if(de.tagName==ge[2]){de=de.prev;break}else if(g.implicitlyClosed.hasOwnProperty(_(de.tagName)))de=de.prev;else break;else if(ge)for(;de;){var Oe=g.contextGrabbers[_(de.tagName)];if(Oe&&Oe.hasOwnProperty(_(ge[2])))de=de.prev;else break}for(;de&&de.prev&&!de.startOfLine;)de=de.prev;return de?de.indent+p:x.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:g.htmlMode?"html":"xml",helperType:g.htmlMode?"html":"xml",skipAttribute:function(x){x.state==k&&(x.state=$)},xmlCurrentTag:function(x){return x.tagName?{name:x.tagName,close:x.type=="closeTag"}:null},xmlCurrentContext:function(x){for(var ee=[],D=x.context;D;D=D.prev)ee.push(D.tagName);return ee.reverse()}}}),r.defineMIME("text/xml","xml"),r.defineMIME("application/xml","xml"),r.mimeModes.hasOwnProperty("text/html")||r.defineMIME("text/html",{name:"xml",htmlMode:!0})})});var pm=at((dm,hm)=>{(function(r){typeof dm=="object"&&typeof hm=="object"?r(bn()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],r):r(CodeMirror)})(function(r){"use strict";r.defineMode("javascript",function(n,a){var l=n.indentUnit,c=a.statementIndent,p=a.jsonld,g=a.json||p,y=a.trackScope!==!1,T=a.typescript,U=a.wordCharacters||/[\w$\xa1-\uffff]/,A=function(){function v(_t){return{type:_t,style:"keyword"}}var E=v("keyword a"),V=v("keyword b"),Y=v("keyword c"),O=v("keyword d"),ce=v("operator"),Pe={type:"atom",style:"atom"};return{if:v("if"),while:E,with:E,else:V,do:V,try:V,finally:V,return:O,break:O,continue:O,new:v("new"),delete:Y,void:Y,throw:Y,debugger:v("debugger"),var:v("var"),const:v("var"),let:v("var"),function:v("function"),catch:v("catch"),for:v("for"),switch:v("switch"),case:v("case"),default:v("default"),in:ce,typeof:ce,instanceof:ce,true:Pe,false:Pe,null:Pe,undefined:Pe,NaN:Pe,Infinity:Pe,this:v("this"),class:v("class"),super:v("atom"),yield:Y,export:v("export"),import:v("import"),extends:Y,await:Y}}(),F=/[+\-*&%=<>!?|~^@]/,M=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function X(v){for(var E=!1,V,Y=!1;(V=v.next())!=null;){if(!E){if(V=="/"&&!Y)return;V=="["?Y=!0:Y&&V=="]"&&(Y=!1)}E=!E&&V=="\\"}}var S,Z;function _(v,E,V){return S=v,Z=V,E}function G(v,E){var V=v.next();if(V=='"'||V=="'")return E.tokenize=J(V),E.tokenize(v,E);if(V=="."&&v.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return _("number","number");if(V=="."&&v.match(".."))return _("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(V))return _(V);if(V=="="&&v.eat(">"))return _("=>","operator");if(V=="0"&&v.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return _("number","number");if(/\d/.test(V))return v.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),_("number","number");if(V=="/")return v.eat("*")?(E.tokenize=q,q(v,E)):v.eat("/")?(v.skipToEnd(),_("comment","comment")):Dt(v,E,1)?(X(v),v.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),_("regexp","string-2")):(v.eat("="),_("operator","operator",v.current()));if(V=="`")return E.tokenize=te,te(v,E);if(V=="#"&&v.peek()=="!")return v.skipToEnd(),_("meta","meta");if(V=="#"&&v.eatWhile(U))return _("variable","property");if(V=="<"&&v.match("!--")||V=="-"&&v.match("->")&&!/\S/.test(v.string.slice(0,v.start)))return v.skipToEnd(),_("comment","comment");if(F.test(V))return(V!=">"||!E.lexical||E.lexical.type!=">")&&(v.eat("=")?(V=="!"||V=="=")&&v.eat("="):/[<>*+\-|&?]/.test(V)&&(v.eat(V),V==">"&&v.eat(V))),V=="?"&&v.eat(".")?_("."):_("operator","operator",v.current());if(U.test(V)){v.eatWhile(U);var Y=v.current();if(E.lastType!="."){if(A.propertyIsEnumerable(Y)){var O=A[Y];return _(O.type,O.style,Y)}if(Y=="async"&&v.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,!1))return _("async","keyword",Y)}return _("variable","variable",Y)}}function J(v){return function(E,V){var Y=!1,O;if(p&&E.peek()=="@"&&E.match(M))return V.tokenize=G,_("jsonld-keyword","meta");for(;(O=E.next())!=null&&!(O==v&&!Y);)Y=!Y&&O=="\\";return Y||(V.tokenize=G),_("string","string")}}function q(v,E){for(var V=!1,Y;Y=v.next();){if(Y=="/"&&V){E.tokenize=G;break}V=Y=="*"}return _("comment","comment")}function te(v,E){for(var V=!1,Y;(Y=v.next())!=null;){if(!V&&(Y=="`"||Y=="$"&&v.eat("{"))){E.tokenize=G;break}V=!V&&Y=="\\"}return _("quasi","string-2",v.current())}var ae="([{}])";function R(v,E){E.fatArrowAt&&(E.fatArrowAt=null);var V=v.string.indexOf("=>",v.start);if(!(V<0)){if(T){var Y=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(v.string.slice(v.start,V));Y&&(V=Y.index)}for(var O=0,ce=!1,Pe=V-1;Pe>=0;--Pe){var _t=v.string.charAt(Pe),zt=ae.indexOf(_t);if(zt>=0&&zt<3){if(!O){++Pe;break}if(--O==0){_t=="("&&(ce=!0);break}}else if(zt>=3&&zt<6)++O;else if(U.test(_t))ce=!0;else if(/["'\/`]/.test(_t))for(;;--Pe){if(Pe==0)return;var ui=v.string.charAt(Pe-1);if(ui==_t&&v.string.charAt(Pe-2)!="\\"){Pe--;break}}else if(ce&&!O){++Pe;break}}ce&&!O&&(E.fatArrowAt=Pe)}}var w={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,import:!0,"jsonld-keyword":!0};function P(v,E,V,Y,O,ce){this.indented=v,this.column=E,this.type=V,this.prev=O,this.info=ce,Y!=null&&(this.align=Y)}function $(v,E){if(!y)return!1;for(var V=v.localVars;V;V=V.next)if(V.name==E)return!0;for(var Y=v.context;Y;Y=Y.prev)for(var V=Y.vars;V;V=V.next)if(V.name==E)return!0}function fe(v,E,V,Y,O){var ce=v.cc;for(k.state=v,k.stream=O,k.marked=null,k.cc=ce,k.style=E,v.lexical.hasOwnProperty("align")||(v.lexical.align=!0);;){var Pe=ce.length?ce.pop():g?ue:ye;if(Pe(V,Y)){for(;ce.length&&ce[ce.length-1].lex;)ce.pop()();return k.marked?k.marked:V=="variable"&&$(v,Y)?"variable-2":E}}}var k={state:null,column:null,marked:null,cc:null};function oe(){for(var v=arguments.length-1;v>=0;v--)k.cc.push(arguments[v])}function x(){return oe.apply(null,arguments),!0}function ee(v,E){for(var V=E;V;V=V.next)if(V.name==v)return!0;return!1}function D(v){var E=k.state;if(k.marked="def",!!y){if(E.context){if(E.lexical.info=="var"&&E.context&&E.context.block){var V=de(v,E.context);if(V!=null){E.context=V;return}}else if(!ee(v,E.localVars)){E.localVars=new _e(v,E.localVars);return}}a.globalVars&&!ee(v,E.globalVars)&&(E.globalVars=new _e(v,E.globalVars))}}function de(v,E){if(E)if(E.block){var V=de(v,E.prev);return V?V==E.prev?E:new Oe(V,E.vars,!0):null}else return ee(v,E.vars)?E:new Oe(E.prev,new _e(v,E.vars),!1);else return null}function ge(v){return v=="public"||v=="private"||v=="protected"||v=="abstract"||v=="readonly"}function Oe(v,E,V){this.prev=v,this.vars=E,this.block=V}function _e(v,E){this.name=v,this.next=E}var we=new _e("this",new _e("arguments",null));function re(){k.state.context=new Oe(k.state.context,k.state.localVars,!1),k.state.localVars=we}function Ze(){k.state.context=new Oe(k.state.context,k.state.localVars,!0),k.state.localVars=null}re.lex=Ze.lex=!0;function Ce(){k.state.localVars=k.state.context.vars,k.state.context=k.state.context.prev}Ce.lex=!0;function ve(v,E){var V=function(){var Y=k.state,O=Y.indented;if(Y.lexical.type=="stat")O=Y.lexical.indented;else for(var ce=Y.lexical;ce&&ce.type==")"&&ce.align;ce=ce.prev)O=ce.indented;Y.lexical=new P(O,k.stream.column(),v,null,Y.lexical,E)};return V.lex=!0,V}function se(){var v=k.state;v.lexical.prev&&(v.lexical.type==")"&&(v.indented=v.lexical.indented),v.lexical=v.lexical.prev)}se.lex=!0;function le(v){function E(V){return V==v?x():v==";"||V=="}"||V==")"||V=="]"?oe():x(E)}return E}function ye(v,E){return v=="var"?x(ve("vardef",E),rt,le(";"),se):v=="keyword a"?x(ve("form"),Je,ye,se):v=="keyword b"?x(ve("form"),ye,se):v=="keyword d"?k.stream.match(/^\s*$/,!1)?x():x(ve("stat"),Le,le(";"),se):v=="debugger"?x(le(";")):v=="{"?x(ve("}"),Ze,ft,se,Ce):v==";"?x():v=="if"?(k.state.lexical.info=="else"&&k.state.cc[k.state.cc.length-1]==se&&k.state.cc.pop()(),x(ve("form"),Je,ye,se,en)):v=="function"?x(jt):v=="for"?x(ve("form"),Ze,li,ye,Ce,se):v=="class"||T&&E=="interface"?(k.marked="keyword",x(ve("form",v=="class"?v:E),tn,se)):v=="variable"?T&&E=="declare"?(k.marked="keyword",x(ye)):T&&(E=="module"||E=="enum"||E=="type")&&k.stream.match(/^\s*\w/,!1)?(k.marked="keyword",E=="enum"?x(he):E=="type"?x(xn,le("operator"),Ne,le(";")):x(ve("form"),pt,le("{"),ve("}"),ft,se,se)):T&&E=="namespace"?(k.marked="keyword",x(ve("form"),ue,ye,se)):T&&E=="abstract"?(k.marked="keyword",x(ye)):x(ve("stat"),Qt):v=="switch"?x(ve("form"),Je,le("{"),ve("}","switch"),Ze,ft,se,se,Ce):v=="case"?x(ue,le(":")):v=="default"?x(le(":")):v=="catch"?x(ve("form"),re,Ge,ye,se,Ce):v=="export"?x(ve("stat"),Tn,se):v=="import"?x(ve("stat"),N,se):v=="async"?x(ye):E=="@"?x(ue,ye):oe(ve("stat"),ue,le(";"),se)}function Ge(v){if(v=="(")return x(lr,le(")"))}function ue(v,E){return Me(v,E,!1)}function Fe(v,E){return Me(v,E,!0)}function Je(v){return v!="("?oe():x(ve(")"),Le,le(")"),se)}function Me(v,E,V){if(k.state.fatArrowAt==k.stream.start){var Y=V?It:Te;if(v=="(")return x(re,ve(")"),qe(lr,")"),se,le("=>"),Y,Ce);if(v=="variable")return oe(re,pt,le("=>"),Y,Ce)}var O=V?De:Re;return w.hasOwnProperty(v)?x(O):v=="function"?x(jt,O):v=="class"||T&&E=="interface"?(k.marked="keyword",x(ve("form"),Tr,se)):v=="keyword c"||v=="async"?x(V?Fe:ue):v=="("?x(ve(")"),Le,le(")"),se,O):v=="operator"||v=="spread"?x(V?Fe:ue):v=="["?x(ve("]"),Ue,se,O):v=="{"?kt(Xe,"}",null,O):v=="quasi"?oe(Be,O):v=="new"?x(Et(V)):x()}function Le(v){return v.match(/[;\}\)\],]/)?oe():oe(ue)}function Re(v,E){return v==","?x(Le):De(v,E,!1)}function De(v,E,V){var Y=V==!1?Re:De,O=V==!1?ue:Fe;if(v=="=>")return x(re,V?It:Te,Ce);if(v=="operator")return/\+\+|--/.test(E)||T&&E=="!"?x(Y):T&&E=="<"&&k.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?x(ve(">"),qe(Ne,">"),se,Y):E=="?"?x(ue,le(":"),O):x(O);if(v=="quasi")return oe(Be,Y);if(v!=";"){if(v=="(")return kt(Fe,")","call",Y);if(v==".")return x(ze,Y);if(v=="[")return x(ve("]"),Le,le("]"),se,Y);if(T&&E=="as")return k.marked="keyword",x(Ne,Y);if(v=="regexp")return k.state.lastType=k.marked="operator",k.stream.backUp(k.stream.pos-k.stream.start-1),x(O)}}function Be(v,E){return v!="quasi"?oe():E.slice(E.length-2)!="${"?x(Be):x(Le,Ve)}function Ve(v){if(v=="}")return k.marked="string-2",k.state.tokenize=te,x(Be)}function Te(v){return R(k.stream,k.state),oe(v=="{"?ye:ue)}function It(v){return R(k.stream,k.state),oe(v=="{"?ye:Fe)}function Et(v){return function(E){return E=="."?x(v?lt:mr):E=="variable"&&T?x(yt,v?De:Re):oe(v?Fe:ue)}}function mr(v,E){if(E=="target")return k.marked="keyword",x(Re)}function lt(v,E){if(E=="target")return k.marked="keyword",x(De)}function Qt(v){return v==":"?x(se,ye):oe(Re,le(";"),se)}function ze(v){if(v=="variable")return k.marked="property",x()}function Xe(v,E){if(v=="async")return k.marked="property",x(Xe);if(v=="variable"||k.style=="keyword"){if(k.marked="property",E=="get"||E=="set")return x(mt);var V;return T&&k.state.fatArrowAt==k.stream.start&&(V=k.stream.match(/^\s*:\s*/,!1))&&(k.state.fatArrowAt=k.stream.pos+V[0].length),x(ut)}else{if(v=="number"||v=="string")return k.marked=p?"property":k.style+" property",x(ut);if(v=="jsonld-keyword")return x(ut);if(T&&ge(E))return k.marked="keyword",x(Xe);if(v=="[")return x(ue,Mt,le("]"),ut);if(v=="spread")return x(Fe,ut);if(E=="*")return k.marked="keyword",x(Xe);if(v==":")return oe(ut)}}function mt(v){return v!="variable"?oe(ut):(k.marked="property",x(jt))}function ut(v){if(v==":")return x(Fe);if(v=="(")return oe(jt)}function qe(v,E,V){function Y(O,ce){if(V?V.indexOf(O)>-1:O==","){var Pe=k.state.lexical;return Pe.info=="call"&&(Pe.pos=(Pe.pos||0)+1),x(function(_t,zt){return _t==E||zt==E?oe():oe(v)},Y)}return O==E||ce==E?x():V&&V.indexOf(";")>-1?oe(v):x(le(E))}return function(O,ce){return O==E||ce==E?x():oe(v,Y)}}function kt(v,E,V){for(var Y=3;Y<arguments.length;Y++)k.cc.push(arguments[Y]);return x(ve(E,V),qe(v,E),se)}function ft(v){return v=="}"?x():oe(ye,ft)}function Mt(v,E){if(T){if(v==":")return x(Ne);if(E=="?")return x(Mt)}}function br(v,E){if(T&&(v==":"||E=="in"))return x(Ne)}function vr(v){if(T&&v==":")return k.stream.match(/^\s*\w+\s+is\b/,!1)?x(ue,vn,Ne):x(Ne)}function vn(v,E){if(E=="is")return k.marked="keyword",x()}function Ne(v,E){if(E=="keyof"||E=="typeof"||E=="infer"||E=="readonly")return k.marked="keyword",x(E=="typeof"?Fe:Ne);if(v=="variable"||E=="void")return k.marked="type",x(sr);if(E=="|"||E=="&")return x(Ne);if(v=="string"||v=="number"||v=="atom")return x(sr);if(v=="[")return x(ve("]"),qe(Ne,"]",","),se,sr);if(v=="{")return x(ve("}"),Ie,se,sr);if(v=="(")return x(qe($e,")"),Sr,sr);if(v=="<")return x(qe(Ne,">"),Ne);if(v=="quasi")return oe(Ct,sr)}function Sr(v){if(v=="=>")return x(Ne)}function Ie(v){return v.match(/[\}\)\]]/)?x():v==","||v==";"?x(Ie):oe(yr,Ie)}function yr(v,E){if(v=="variable"||k.style=="keyword")return k.marked="property",x(yr);if(E=="?"||v=="number"||v=="string")return x(yr);if(v==":")return x(Ne);if(v=="[")return x(le("variable"),br,le("]"),yr);if(v=="(")return oe(wr,yr);if(!v.match(/[;\}\)\],]/))return x()}function Ct(v,E){return v!="quasi"?oe():E.slice(E.length-2)!="${"?x(Ct):x(Ne,Ke)}function Ke(v){if(v=="}")return k.marked="string-2",k.state.tokenize=te,x(Ct)}function $e(v,E){return v=="variable"&&k.stream.match(/^\s*[?:]/,!1)||E=="?"?x($e):v==":"?x(Ne):v=="spread"?x($e):oe(Ne)}function sr(v,E){if(E=="<")return x(ve(">"),qe(Ne,">"),se,sr);if(E=="|"||v=="."||E=="&")return x(Ne);if(v=="[")return x(Ne,le("]"),sr);if(E=="extends"||E=="implements")return k.marked="keyword",x(Ne);if(E=="?")return x(Ne,le(":"),Ne)}function yt(v,E){if(E=="<")return x(ve(">"),qe(Ne,">"),se,sr)}function xr(){return oe(Ne,At)}function At(v,E){if(E=="=")return x(Ne)}function rt(v,E){return E=="enum"?(k.marked="keyword",x(he)):oe(pt,Mt,Yt,si)}function pt(v,E){if(T&&ge(E))return k.marked="keyword",x(pt);if(v=="variable")return D(E),x();if(v=="spread")return x(pt);if(v=="[")return kt(yn,"]");if(v=="{")return kt(Wr,"}")}function Wr(v,E){return v=="variable"&&!k.stream.match(/^\s*:/,!1)?(D(E),x(Yt)):(v=="variable"&&(k.marked="property"),v=="spread"?x(pt):v=="}"?oe():v=="["?x(ue,le("]"),le(":"),Wr):x(le(":"),pt,Yt))}function yn(){return oe(pt,Yt)}function Yt(v,E){if(E=="=")return x(Fe)}function si(v){if(v==",")return x(rt)}function en(v,E){if(v=="keyword b"&&E=="else")return x(ve("form","else"),ye,se)}function li(v,E){if(E=="await")return x(li);if(v=="(")return x(ve(")"),Pt,se)}function Pt(v){return v=="var"?x(rt,Ht):v=="variable"?x(Ht):oe(Ht)}function Ht(v,E){return v==")"?x():v==";"?x(Ht):E=="in"||E=="of"?(k.marked="keyword",x(ue,Ht)):oe(ue,Ht)}function jt(v,E){if(E=="*")return k.marked="keyword",x(jt);if(v=="variable")return D(E),x(jt);if(v=="(")return x(re,ve(")"),qe(lr,")"),se,vr,ye,Ce);if(T&&E=="<")return x(ve(">"),qe(xr,">"),se,jt)}function wr(v,E){if(E=="*")return k.marked="keyword",x(wr);if(v=="variable")return D(E),x(wr);if(v=="(")return x(re,ve(")"),qe(lr,")"),se,vr,Ce);if(T&&E=="<")return x(ve(">"),qe(xr,">"),se,wr)}function xn(v,E){if(v=="keyword"||v=="variable")return k.marked="type",x(xn);if(E=="<")return x(ve(">"),qe(xr,">"),se)}function lr(v,E){return E=="@"&&x(ue,lr),v=="spread"?x(lr):T&&ge(E)?(k.marked="keyword",x(lr)):T&&v=="this"?x(Mt,Yt):oe(pt,Mt,Yt)}function Tr(v,E){return v=="variable"?tn(v,E):ur(v,E)}function tn(v,E){if(v=="variable")return D(E),x(ur)}function ur(v,E){if(E=="<")return x(ve(">"),qe(xr,">"),se,ur);if(E=="extends"||E=="implements"||T&&v==",")return E=="implements"&&(k.marked="keyword"),x(T?Ne:ue,ur);if(v=="{")return x(ve("}"),fr,se)}function fr(v,E){if(v=="async"||v=="variable"&&(E=="static"||E=="get"||E=="set"||T&&ge(E))&&k.stream.match(/^\s+#?[\w$\xa1-\uffff]/,!1))return k.marked="keyword",x(fr);if(v=="variable"||k.style=="keyword")return k.marked="property",x(Dr,fr);if(v=="number"||v=="string")return x(Dr,fr);if(v=="[")return x(ue,Mt,le("]"),Dr,fr);if(E=="*")return k.marked="keyword",x(fr);if(T&&v=="(")return oe(wr,fr);if(v==";"||v==",")return x(fr);if(v=="}")return x();if(E=="@")return x(ue,fr)}function Dr(v,E){if(E=="!"||E=="?")return x(Dr);if(v==":")return x(Ne,Yt);if(E=="=")return x(Fe);var V=k.state.lexical.prev,Y=V&&V.info=="interface";return oe(Y?wr:jt)}function Tn(v,E){return E=="*"?(k.marked="keyword",x(dt,le(";"))):E=="default"?(k.marked="keyword",x(ue,le(";"))):v=="{"?x(qe(xe,"}"),dt,le(";")):oe(ye)}function xe(v,E){if(E=="as")return k.marked="keyword",x(le("variable"));if(v=="variable")return oe(Fe,xe)}function N(v){return v=="string"?x():v=="("?oe(ue):v=="."?oe(Re):oe(K,be,dt)}function K(v,E){return v=="{"?kt(K,"}"):(v=="variable"&&D(E),E=="*"&&(k.marked="keyword"),x(Ye))}function be(v){if(v==",")return x(K,be)}function Ye(v,E){if(E=="as")return k.marked="keyword",x(K)}function dt(v,E){if(E=="from")return k.marked="keyword",x(ue)}function Ue(v){return v=="]"?x():oe(qe(Fe,"]"))}function he(){return oe(ve("form"),pt,le("{"),ve("}"),qe(Rt,"}"),se,se)}function Rt(){return oe(pt,Yt)}function Cr(v,E){return v.lastType=="operator"||v.lastType==","||F.test(E.charAt(0))||/[,.]/.test(E.charAt(0))}function Dt(v,E,V){return E.tokenize==G&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(E.lastType)||E.lastType=="quasi"&&/\{\s*$/.test(v.string.slice(0,v.pos-(V||0)))}return{startState:function(v){var E={tokenize:G,lastType:"sof",cc:[],lexical:new P((v||0)-l,0,"block",!1),localVars:a.localVars,context:a.localVars&&new Oe(null,null,!1),indented:v||0};return a.globalVars&&typeof a.globalVars=="object"&&(E.globalVars=a.globalVars),E},token:function(v,E){if(v.sol()&&(E.lexical.hasOwnProperty("align")||(E.lexical.align=!1),E.indented=v.indentation(),R(v,E)),E.tokenize!=q&&v.eatSpace())return null;var V=E.tokenize(v,E);return S=="comment"?V:(E.lastType=S=="operator"&&(Z=="++"||Z=="--")?"incdec":S,fe(E,V,S,Z,v))},indent:function(v,E){if(v.tokenize==q||v.tokenize==te)return r.Pass;if(v.tokenize!=G)return 0;var V=E&&E.charAt(0),Y=v.lexical,O;if(!/^\s*else\b/.test(E))for(var ce=v.cc.length-1;ce>=0;--ce){var Pe=v.cc[ce];if(Pe==se)Y=Y.prev;else if(Pe!=en&&Pe!=Ce)break}for(;(Y.type=="stat"||Y.type=="form")&&(V=="}"||(O=v.cc[v.cc.length-1])&&(O==Re||O==De)&&!/^[,\.=+\-*:?[\(]/.test(E));)Y=Y.prev;c&&Y.type==")"&&Y.prev.type=="stat"&&(Y=Y.prev);var _t=Y.type,zt=V==_t;return _t=="vardef"?Y.indented+(v.lastType=="operator"||v.lastType==","?Y.info.length+1:0):_t=="form"&&V=="{"?Y.indented:_t=="form"?Y.indented+l:_t=="stat"?Y.indented+(Cr(v,E)?c||l:0):Y.info=="switch"&&!zt&&a.doubleIndentSwitch!=!1?Y.indented+(/^(?:case|default)\b/.test(E)?l:2*l):Y.align?Y.column+(zt?0:1):Y.indented+(zt?0:l)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:g?null:"/*",blockCommentEnd:g?null:"*/",blockCommentContinue:g?null:" * ",lineComment:g?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:g?"json":"javascript",jsonldMode:p,jsonMode:g,expressionAllowed:Dt,skipExpression:function(v){fe(v,"atom","atom","true",new r.StringStream("",2,null))}}}),r.registerHelper("wordChars","javascript",/[\w$]/),r.defineMIME("text/javascript","javascript"),r.defineMIME("text/ecmascript","javascript"),r.defineMIME("application/javascript","javascript"),r.defineMIME("application/x-javascript","javascript"),r.defineMIME("application/ecmascript","javascript"),r.defineMIME("application/json",{name:"javascript",json:!0}),r.defineMIME("application/x-json",{name:"javascript",json:!0}),r.defineMIME("application/manifest+json",{name:"javascript",json:!0}),r.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),r.defineMIME("text/typescript",{name:"javascript",typescript:!0}),r.defineMIME("application/typescript",{name:"javascript",typescript:!0})})});var RR={};Tb(RR,{Parser:()=>Us,Yasr:()=>$r,default:()=>AR,registerPlugin:()=>CR});var mm=Ar(Hc());var Sb=typeof global=="object"&&global&&global.Object===Object&&global,Oa=Sb;var wb=typeof self=="object"&&self&&self.Object===Object&&self,Lb=Oa||wb||Function("return this")(),Tt=Lb;var Fb=Tt.Symbol,rr=Fb;var Jc=Object.prototype,Bb=Jc.hasOwnProperty,Ub=Jc.toString,Lo=rr?rr.toStringTag:void 0;function kb(r){var n=Bb.call(r,Lo),a=r[Lo];try{r[Lo]=void 0;var l=!0}catch{}var c=Ub.call(r);return l&&(n?r[Lo]=a:delete r[Lo]),c}var Xc=kb;var Mb=Object.prototype,Gb=Mb.toString;function Ob(r){return Gb.call(r)}var Yc=Ob;var Wb="[object Null]",Db="[object Undefined]",jc=rr?rr.toStringTag:void 0;function Zb(r){return r==null?r===void 0?Db:Wb:jc&&jc in Object(r)?Xc(r):Yc(r)}var Er=Zb;function Vb(r){return r!=null&&typeof r=="object"}var Bt=Vb;var Qb="[object Symbol]";function Pb(r){return typeof r=="symbol"||Bt(r)&&Er(r)==Qb}var wi=Pb;function Hb(r,n){for(var a=-1,l=r==null?0:r.length,c=Array(l);++a<l;)c[a]=n(r[a],a,r);return c}var zc=Hb;var Jb=Array.isArray,nt=Jb;var Xb=1/0,qc=rr?rr.prototype:void 0,Kc=qc?qc.toString:void 0;function $c(r){if(typeof r=="string")return r;if(nt(r))return zc(r,$c)+"";if(wi(r))return Kc?Kc.call(r):"";var n=r+"";return n=="0"&&1/r==-Xb?"-0":n}var ed=$c;function Yb(r){var n=typeof r;return r!=null&&(n=="object"||n=="function")}var Ot=Yb;function jb(r){return r}var Li=jb;var zb="[object AsyncFunction]",qb="[object Function]",Kb="[object GeneratorFunction]",$b="[object Proxy]";function ev(r){if(!Ot(r))return!1;var n=Er(r);return n==qb||n==Kb||n==zb||n==$b}var Fi=ev;var tv=Tt["__core-js_shared__"],Wa=tv;var td=function(){var r=/[^.]+$/.exec(Wa&&Wa.keys&&Wa.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}();function rv(r){return!!td&&td in r}var rd=rv;var nv=Function.prototype,iv=nv.toString;function ov(r){if(r!=null){try{return iv.call(r)}catch{}try{return r+""}catch{}}return""}var un=ov;var av=/[\\^$.*+?()[\]{}|]/g,sv=/^\[object .+?Constructor\]$/,lv=Function.prototype,uv=Object.prototype,fv=lv.toString,cv=uv.hasOwnProperty,dv=RegExp("^"+fv.call(cv).replace(av,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function hv(r){if(!Ot(r)||rd(r))return!1;var n=Fi(r)?dv:sv;return n.test(un(r))}var nd=hv;function pv(r,n){return r?.[n]}var id=pv;function gv(r,n){var a=id(r,n);return nd(a)?a:void 0}var hr=gv;var mv=hr(Tt,"WeakMap"),Da=mv;var od=Object.create,bv=function(){function r(){}return function(n){if(!Ot(n))return{};if(od)return od(n);r.prototype=n;var a=new r;return r.prototype=void 0,a}}(),ad=bv;function vv(r,n,a){switch(a.length){case 0:return r.call(n);case 1:return r.call(n,a[0]);case 2:return r.call(n,a[0],a[1]);case 3:return r.call(n,a[0],a[1],a[2])}return r.apply(n,a)}var sd=vv;function yv(r,n){var a=-1,l=r.length;for(n||(n=Array(l));++a<l;)n[a]=r[a];return n}var Za=yv;var xv=800,Tv=16,Iv=Date.now;function Ev(r){var n=0,a=0;return function(){var l=Iv(),c=Tv-(l-a);if(a=l,c>0){if(++n>=xv)return arguments[0]}else n=0;return r.apply(void 0,arguments)}}var ld=Ev;function Cv(r){return function(){return r}}var ud=Cv;var Av=function(){try{var r=hr(Object,"defineProperty");return r({},"",{}),r}catch{}}(),Bi=Av;var Rv=Bi?function(r,n){return Bi(r,"toString",{configurable:!0,enumerable:!1,value:ud(n),writable:!0})}:Li,fd=Rv;var _v=ld(fd),cd=_v;function Nv(r,n){for(var a=-1,l=r==null?0:r.length;++a<l&&n(r[a],a,r)!==!1;);return r}var dd=Nv;var Sv=9007199254740991,wv=/^(?:0|[1-9]\d*)$/;function Lv(r,n){var a=typeof r;return n=n??Sv,!!n&&(a=="number"||a!="symbol"&&wv.test(r))&&r>-1&&r%1==0&&r<n}var Ui=Lv;function Fv(r,n,a){n=="__proto__"&&Bi?Bi(r,n,{configurable:!0,enumerable:!0,value:a,writable:!0}):r[n]=a}var Ln=Fv;function Bv(r,n){return r===n||r!==r&&n!==n}var Hr=Bv;var Uv=Object.prototype,kv=Uv.hasOwnProperty;function Mv(r,n,a){var l=r[n];(!(kv.call(r,n)&&Hr(l,a))||a===void 0&&!(n in r))&&Ln(r,n,a)}var Va=Mv;function Gv(r,n,a,l){var c=!a;a||(a={});for(var p=-1,g=n.length;++p<g;){var y=n[p],T=l?l(a[y],r[y],y,a,r):void 0;T===void 0&&(T=r[y]),c?Ln(a,y,T):Va(a,y,T)}return a}var Jr=Gv;var hd=Math.max;function Ov(r,n,a){return n=hd(n===void 0?r.length-1:n,0),function(){for(var l=arguments,c=-1,p=hd(l.length-n,0),g=Array(p);++c<p;)g[c]=l[n+c];c=-1;for(var y=Array(n+1);++c<n;)y[c]=l[c];return y[n]=a(g),sd(r,this,y)}}var pd=Ov;function Wv(r,n){return cd(pd(r,n,Li),r+"")}var gd=Wv;var Dv=9007199254740991;function Zv(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=Dv}var ki=Zv;function Vv(r){return r!=null&&ki(r.length)&&!Fi(r)}var Rr=Vv;function Qv(r,n,a){if(!Ot(a))return!1;var l=typeof n;return(l=="number"?Rr(a)&&Ui(n,a.length):l=="string"&&n in a)?Hr(a[n],r):!1}var md=Qv;function Pv(r){return gd(function(n,a){var l=-1,c=a.length,p=c>1?a[c-1]:void 0,g=c>2?a[2]:void 0;for(p=r.length>3&&typeof p=="function"?(c--,p):void 0,g&&md(a[0],a[1],g)&&(p=c<3?void 0:p,c=1),n=Object(n);++l<c;){var y=a[l];y&&r(n,y,l,p)}return n})}var bd=Pv;var Hv=Object.prototype;function Jv(r){var n=r&&r.constructor,a=typeof n=="function"&&n.prototype||Hv;return r===a}var Fn=Jv;function Xv(r,n){for(var a=-1,l=Array(r);++a<r;)l[a]=n(a);return l}var vd=Xv;var Yv="[object Arguments]";function jv(r){return Bt(r)&&Er(r)==Yv}var Fl=jv;var yd=Object.prototype,zv=yd.hasOwnProperty,qv=yd.propertyIsEnumerable,Kv=Fl(function(){return arguments}())?Fl:function(r){return Bt(r)&&zv.call(r,"callee")&&!qv.call(r,"callee")},fn=Kv;function $v(){return!1}var xd=$v;var Ed=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Td=Ed&&typeof module=="object"&&module&&!module.nodeType&&module,ey=Td&&Td.exports===Ed,Id=ey?Tt.Buffer:void 0,ty=Id?Id.isBuffer:void 0,ry=ty||xd,kr=ry;var ny="[object Arguments]",iy="[object Array]",oy="[object Boolean]",ay="[object Date]",sy="[object Error]",ly="[object Function]",uy="[object Map]",fy="[object Number]",cy="[object Object]",dy="[object RegExp]",hy="[object Set]",py="[object String]",gy="[object WeakMap]",my="[object ArrayBuffer]",by="[object DataView]",vy="[object Float32Array]",yy="[object Float64Array]",xy="[object Int8Array]",Ty="[object Int16Array]",Iy="[object Int32Array]",Ey="[object Uint8Array]",Cy="[object Uint8ClampedArray]",Ay="[object Uint16Array]",Ry="[object Uint32Array]",st={};st[vy]=st[yy]=st[xy]=st[Ty]=st[Iy]=st[Ey]=st[Cy]=st[Ay]=st[Ry]=!0;st[ny]=st[iy]=st[my]=st[oy]=st[by]=st[ay]=st[sy]=st[ly]=st[uy]=st[fy]=st[cy]=st[dy]=st[hy]=st[py]=st[gy]=!1;function _y(r){return Bt(r)&&ki(r.length)&&!!st[Er(r)]}var Cd=_y;function Ny(r){return function(n){return r(n)}}var Mi=Ny;var Ad=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Fo=Ad&&typeof module=="object"&&module&&!module.nodeType&&module,Sy=Fo&&Fo.exports===Ad,Bl=Sy&&Oa.process,wy=function(){try{var r=Fo&&Fo.require&&Fo.require("util").types;return r||Bl&&Bl.binding&&Bl.binding("util")}catch{}}(),cn=wy;var Rd=cn&&cn.isTypedArray,Ly=Rd?Mi(Rd):Cd,Bn=Ly;var Fy=Object.prototype,By=Fy.hasOwnProperty;function Uy(r,n){var a=nt(r),l=!a&&fn(r),c=!a&&!l&&kr(r),p=!a&&!l&&!c&&Bn(r),g=a||l||c||p,y=g?vd(r.length,String):[],T=y.length;for(var U in r)(n||By.call(r,U))&&!(g&&(U=="length"||c&&(U=="offset"||U=="parent")||p&&(U=="buffer"||U=="byteLength"||U=="byteOffset")||Ui(U,T)))&&y.push(U);return y}var Qa=Uy;function ky(r,n){return function(a){return r(n(a))}}var Pa=ky;var My=Pa(Object.keys,Object),_d=My;var Gy=Object.prototype,Oy=Gy.hasOwnProperty;function Wy(r){if(!Fn(r))return _d(r);var n=[];for(var a in Object(r))Oy.call(r,a)&&a!="constructor"&&n.push(a);return n}var Ha=Wy;function Dy(r){return Rr(r)?Qa(r):Ha(r)}var Xr=Dy;function Zy(r){var n=[];if(r!=null)for(var a in Object(r))n.push(a);return n}var Nd=Zy;var Vy=Object.prototype,Qy=Vy.hasOwnProperty;function Py(r){if(!Ot(r))return Nd(r);var n=Fn(r),a=[];for(var l in r)l=="constructor"&&(n||!Qy.call(r,l))||a.push(l);return a}var Sd=Py;function Hy(r){return Rr(r)?Qa(r,!0):Sd(r)}var Yr=Hy;var Jy=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Xy=/^\w*$/;function Yy(r,n){if(nt(r))return!1;var a=typeof r;return a=="number"||a=="symbol"||a=="boolean"||r==null||wi(r)?!0:Xy.test(r)||!Jy.test(r)||n!=null&&r in Object(n)}var Gi=Yy;var jy=hr(Object,"create"),dn=jy;function zy(){this.__data__=dn?dn(null):{},this.size=0}var wd=zy;function qy(r){var n=this.has(r)&&delete this.__data__[r];return this.size-=n?1:0,n}var Ld=qy;var Ky="__lodash_hash_undefined__",$y=Object.prototype,ex=$y.hasOwnProperty;function tx(r){var n=this.__data__;if(dn){var a=n[r];return a===Ky?void 0:a}return ex.call(n,r)?n[r]:void 0}var Fd=tx;var rx=Object.prototype,nx=rx.hasOwnProperty;function ix(r){var n=this.__data__;return dn?n[r]!==void 0:nx.call(n,r)}var Bd=ix;var ox="__lodash_hash_undefined__";function ax(r,n){var a=this.__data__;return this.size+=this.has(r)?0:1,a[r]=dn&&n===void 0?ox:n,this}var Ud=ax;function Oi(r){var n=-1,a=r==null?0:r.length;for(this.clear();++n<a;){var l=r[n];this.set(l[0],l[1])}}Oi.prototype.clear=wd;Oi.prototype.delete=Ld;Oi.prototype.get=Fd;Oi.prototype.has=Bd;Oi.prototype.set=Ud;var Ul=Oi;function sx(){this.__data__=[],this.size=0}var kd=sx;function lx(r,n){for(var a=r.length;a--;)if(Hr(r[a][0],n))return a;return-1}var Un=lx;var ux=Array.prototype,fx=ux.splice;function cx(r){var n=this.__data__,a=Un(n,r);if(a<0)return!1;var l=n.length-1;return a==l?n.pop():fx.call(n,a,1),--this.size,!0}var Md=cx;function dx(r){var n=this.__data__,a=Un(n,r);return a<0?void 0:n[a][1]}var Gd=dx;function hx(r){return Un(this.__data__,r)>-1}var Od=hx;function px(r,n){var a=this.__data__,l=Un(a,r);return l<0?(++this.size,a.push([r,n])):a[l][1]=n,this}var Wd=px;function Wi(r){var n=-1,a=r==null?0:r.length;for(this.clear();++n<a;){var l=r[n];this.set(l[0],l[1])}}Wi.prototype.clear=kd;Wi.prototype.delete=Md;Wi.prototype.get=Gd;Wi.prototype.has=Od;Wi.prototype.set=Wd;var kn=Wi;var gx=hr(Tt,"Map"),Mn=gx;function mx(){this.size=0,this.__data__={hash:new Ul,map:new(Mn||kn),string:new Ul}}var Dd=mx;function bx(r){var n=typeof r;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?r!=="__proto__":r===null}var Zd=bx;function vx(r,n){var a=r.__data__;return Zd(n)?a[typeof n=="string"?"string":"hash"]:a.map}var Gn=vx;function yx(r){var n=Gn(this,r).delete(r);return this.size-=n?1:0,n}var Vd=yx;function xx(r){return Gn(this,r).get(r)}var Qd=xx;function Tx(r){return Gn(this,r).has(r)}var Pd=Tx;function Ix(r,n){var a=Gn(this,r),l=a.size;return a.set(r,n),this.size+=a.size==l?0:1,this}var Hd=Ix;function Di(r){var n=-1,a=r==null?0:r.length;for(this.clear();++n<a;){var l=r[n];this.set(l[0],l[1])}}Di.prototype.clear=Dd;Di.prototype.delete=Vd;Di.prototype.get=Qd;Di.prototype.has=Pd;Di.prototype.set=Hd;var qn=Di;var Ex="Expected a function";function kl(r,n){if(typeof r!="function"||n!=null&&typeof n!="function")throw new TypeError(Ex);var a=function(){var l=arguments,c=n?n.apply(this,l):l[0],p=a.cache;if(p.has(c))return p.get(c);var g=r.apply(this,l);return a.cache=p.set(c,g)||p,g};return a.cache=new(kl.Cache||qn),a}kl.Cache=qn;var Jd=kl;var Cx=500;function Ax(r){var n=Jd(r,function(l){return a.size===Cx&&a.clear(),l}),a=n.cache;return n}var Xd=Ax;var Rx=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,_x=/\\(\\)?/g,Nx=Xd(function(r){var n=[];return r.charCodeAt(0)===46&&n.push(""),r.replace(Rx,function(a,l,c,p){n.push(c?p.replace(_x,"$1"):l||a)}),n}),Yd=Nx;function Sx(r){return r==null?"":ed(r)}var Zi=Sx;function wx(r,n){return nt(r)?r:Gi(r,n)?[r]:Yd(Zi(r))}var Ja=wx;var Lx=1/0;function Fx(r){if(typeof r=="string"||wi(r))return r;var n=r+"";return n=="0"&&1/r==-Lx?"-0":n}var On=Fx;function Bx(r,n){n=Ja(n,r);for(var a=0,l=n.length;r!=null&&a<l;)r=r[On(n[a++])];return a&&a==l?r:void 0}var Xa=Bx;function Ux(r,n,a){var l=r==null?void 0:Xa(r,n);return l===void 0?a:l}var jd=Ux;function kx(r,n){for(var a=-1,l=n.length,c=r.length;++a<l;)r[c+a]=n[a];return r}var Ya=kx;var Mx=Pa(Object.getPrototypeOf,Object),Vi=Mx;var Gx="[object Object]",Ox=Function.prototype,Wx=Object.prototype,zd=Ox.toString,Dx=Wx.hasOwnProperty,Zx=zd.call(Object);function Vx(r){if(!Bt(r)||Er(r)!=Gx)return!1;var n=Vi(r);if(n===null)return!0;var a=Dx.call(n,"constructor")&&n.constructor;return typeof a=="function"&&a instanceof a&&zd.call(a)==Zx}var qd=Vx;function Qx(r){return function(n){return r?.[n]}}var Kd=Qx;function Px(){this.__data__=new kn,this.size=0}var $d=Px;function Hx(r){var n=this.__data__,a=n.delete(r);return this.size=n.size,a}var eh=Hx;function Jx(r){return this.__data__.get(r)}var th=Jx;function Xx(r){return this.__data__.has(r)}var rh=Xx;var Yx=200;function jx(r,n){var a=this.__data__;if(a instanceof kn){var l=a.__data__;if(!Mn||l.length<Yx-1)return l.push([r,n]),this.size=++a.size,this;a=this.__data__=new qn(l)}return a.set(r,n),this.size=a.size,this}var nh=jx;function Qi(r){var n=this.__data__=new kn(r);this.size=n.size}Qi.prototype.clear=$d;Qi.prototype.delete=eh;Qi.prototype.get=th;Qi.prototype.has=rh;Qi.prototype.set=nh;var jr=Qi;function zx(r,n){return r&&Jr(n,Xr(n),r)}var ih=zx;function qx(r,n){return r&&Jr(n,Yr(n),r)}var oh=qx;var uh=typeof exports=="object"&&exports&&!exports.nodeType&&exports,ah=uh&&typeof module=="object"&&module&&!module.nodeType&&module,Kx=ah&&ah.exports===uh,sh=Kx?Tt.Buffer:void 0,lh=sh?sh.allocUnsafe:void 0;function $x(r,n){if(n)return r.slice();var a=r.length,l=lh?lh(a):new r.constructor(a);return r.copy(l),l}var ja=$x;function eT(r,n){for(var a=-1,l=r==null?0:r.length,c=0,p=[];++a<l;){var g=r[a];n(g,a,r)&&(p[c++]=g)}return p}var za=eT;function tT(){return[]}var qa=tT;var rT=Object.prototype,nT=rT.propertyIsEnumerable,fh=Object.getOwnPropertySymbols,iT=fh?function(r){return r==null?[]:(r=Object(r),za(fh(r),function(n){return nT.call(r,n)}))}:qa,Pi=iT;function oT(r,n){return Jr(r,Pi(r),n)}var ch=oT;var aT=Object.getOwnPropertySymbols,sT=aT?function(r){for(var n=[];r;)Ya(n,Pi(r)),r=Vi(r);return n}:qa,Ka=sT;function lT(r,n){return Jr(r,Ka(r),n)}var dh=lT;function uT(r,n,a){var l=n(r);return nt(r)?l:Ya(l,a(r))}var $a=uT;function fT(r){return $a(r,Xr,Pi)}var Bo=fT;function cT(r){return $a(r,Yr,Ka)}var hh=cT;var dT=hr(Tt,"DataView"),es=dT;var hT=hr(Tt,"Promise"),ts=hT;var pT=hr(Tt,"Set"),rs=pT;var ph="[object Map]",gT="[object Object]",gh="[object Promise]",mh="[object Set]",bh="[object WeakMap]",vh="[object DataView]",mT=un(es),bT=un(Mn),vT=un(ts),yT=un(rs),xT=un(Da),Kn=Er;(es&&Kn(new es(new ArrayBuffer(1)))!=vh||Mn&&Kn(new Mn)!=ph||ts&&Kn(ts.resolve())!=gh||rs&&Kn(new rs)!=mh||Da&&Kn(new Da)!=bh)&&(Kn=function(r){var n=Er(r),a=n==gT?r.constructor:void 0,l=a?un(a):"";if(l)switch(l){case mT:return vh;case bT:return ph;case vT:return gh;case yT:return mh;case xT:return bh}return n});var Mr=Kn;var TT=Object.prototype,IT=TT.hasOwnProperty;function ET(r){var n=r.length,a=new r.constructor(n);return n&&typeof r[0]=="string"&&IT.call(r,"index")&&(a.index=r.index,a.input=r.input),a}var yh=ET;var CT=Tt.Uint8Array,Hi=CT;function AT(r){var n=new r.constructor(r.byteLength);return new Hi(n).set(new Hi(r)),n}var Ji=AT;function RT(r,n){var a=n?Ji(r.buffer):r.buffer;return new r.constructor(a,r.byteOffset,r.byteLength)}var xh=RT;var _T=/\w*$/;function NT(r){var n=new r.constructor(r.source,_T.exec(r));return n.lastIndex=r.lastIndex,n}var Th=NT;var Ih=rr?rr.prototype:void 0,Eh=Ih?Ih.valueOf:void 0;function ST(r){return Eh?Object(Eh.call(r)):{}}var Ch=ST;function wT(r,n){var a=n?Ji(r.buffer):r.buffer;return new r.constructor(a,r.byteOffset,r.length)}var ns=wT;var LT="[object Boolean]",FT="[object Date]",BT="[object Map]",UT="[object Number]",kT="[object RegExp]",MT="[object Set]",GT="[object String]",OT="[object Symbol]",WT="[object ArrayBuffer]",DT="[object DataView]",ZT="[object Float32Array]",VT="[object Float64Array]",QT="[object Int8Array]",PT="[object Int16Array]",HT="[object Int32Array]",JT="[object Uint8Array]",XT="[object Uint8ClampedArray]",YT="[object Uint16Array]",jT="[object Uint32Array]";function zT(r,n,a){var l=r.constructor;switch(n){case WT:return Ji(r);case LT:case FT:return new l(+r);case DT:return xh(r,a);case ZT:case VT:case QT:case PT:case HT:case JT:case XT:case YT:case jT:return ns(r,a);case BT:return new l;case UT:case GT:return new l(r);case kT:return Th(r);case MT:return new l;case OT:return Ch(r)}}var Ah=zT;function qT(r){return typeof r.constructor=="function"&&!Fn(r)?ad(Vi(r)):{}}var is=qT;var KT="[object Map]";function $T(r){return Bt(r)&&Mr(r)==KT}var Rh=$T;var _h=cn&&cn.isMap,eI=_h?Mi(_h):Rh,Nh=eI;var tI="[object Set]";function rI(r){return Bt(r)&&Mr(r)==tI}var Sh=rI;var wh=cn&&cn.isSet,nI=wh?Mi(wh):Sh,Lh=nI;var iI=1,oI=2,aI=4,Fh="[object Arguments]",sI="[object Array]",lI="[object Boolean]",uI="[object Date]",fI="[object Error]",Bh="[object Function]",cI="[object GeneratorFunction]",dI="[object Map]",hI="[object Number]",Uh="[object Object]",pI="[object RegExp]",gI="[object Set]",mI="[object String]",bI="[object Symbol]",vI="[object WeakMap]",yI="[object ArrayBuffer]",xI="[object DataView]",TI="[object Float32Array]",II="[object Float64Array]",EI="[object Int8Array]",CI="[object Int16Array]",AI="[object Int32Array]",RI="[object Uint8Array]",_I="[object Uint8ClampedArray]",NI="[object Uint16Array]",SI="[object Uint32Array]",it={};it[Fh]=it[sI]=it[yI]=it[xI]=it[lI]=it[uI]=it[TI]=it[II]=it[EI]=it[CI]=it[AI]=it[dI]=it[hI]=it[Uh]=it[pI]=it[gI]=it[mI]=it[bI]=it[RI]=it[_I]=it[NI]=it[SI]=!0;it[fI]=it[Bh]=it[vI]=!1;function os(r,n,a,l,c,p){var g,y=n&iI,T=n&oI,U=n&aI;if(a&&(g=c?a(r,l,c,p):a(r)),g!==void 0)return g;if(!Ot(r))return r;var A=nt(r);if(A){if(g=yh(r),!y)return Za(r,g)}else{var F=Mr(r),M=F==Bh||F==cI;if(kr(r))return ja(r,y);if(F==Uh||F==Fh||M&&!c){if(g=T||M?{}:is(r),!y)return T?dh(r,oh(g,r)):ch(r,ih(g,r))}else{if(!it[F])return c?r:{};g=Ah(r,F,y)}}p||(p=new jr);var X=p.get(r);if(X)return X;p.set(r,g),Lh(r)?r.forEach(function(_){g.add(os(_,n,a,_,r,p))}):Nh(r)&&r.forEach(function(_,G){g.set(G,os(_,n,a,G,r,p))});var S=U?T?hh:Bo:T?Yr:Xr,Z=A?void 0:S(r);return dd(Z||r,function(_,G){Z&&(G=_,_=r[G]),Va(g,G,os(_,n,a,G,r,p))}),g}var kh=os;var wI=1,LI=4;function FI(r){return kh(r,wI|LI)}var as=FI;var BI="__lodash_hash_undefined__";function UI(r){return this.__data__.set(r,BI),this}var Mh=UI;function kI(r){return this.__data__.has(r)}var Gh=kI;function ss(r){var n=-1,a=r==null?0:r.length;for(this.__data__=new qn;++n<a;)this.add(r[n])}ss.prototype.add=ss.prototype.push=Mh;ss.prototype.has=Gh;var Oh=ss;function MI(r,n){for(var a=-1,l=r==null?0:r.length;++a<l;)if(n(r[a],a,r))return!0;return!1}var Wh=MI;function GI(r,n){return r.has(n)}var Dh=GI;var OI=1,WI=2;function DI(r,n,a,l,c,p){var g=a&OI,y=r.length,T=n.length;if(y!=T&&!(g&&T>y))return!1;var U=p.get(r),A=p.get(n);if(U&&A)return U==n&&A==r;var F=-1,M=!0,X=a&WI?new Oh:void 0;for(p.set(r,n),p.set(n,r);++F<y;){var S=r[F],Z=n[F];if(l)var _=g?l(Z,S,F,n,r,p):l(S,Z,F,r,n,p);if(_!==void 0){if(_)continue;M=!1;break}if(X){if(!Wh(n,function(G,J){if(!Dh(X,J)&&(S===G||c(S,G,a,l,p)))return X.push(J)})){M=!1;break}}else if(!(S===Z||c(S,Z,a,l,p))){M=!1;break}}return p.delete(r),p.delete(n),M}var ls=DI;function ZI(r){var n=-1,a=Array(r.size);return r.forEach(function(l,c){a[++n]=[c,l]}),a}var Zh=ZI;function VI(r){var n=-1,a=Array(r.size);return r.forEach(function(l){a[++n]=l}),a}var Vh=VI;var QI=1,PI=2,HI="[object Boolean]",JI="[object Date]",XI="[object Error]",YI="[object Map]",jI="[object Number]",zI="[object RegExp]",qI="[object Set]",KI="[object String]",$I="[object Symbol]",eE="[object ArrayBuffer]",tE="[object DataView]",Qh=rr?rr.prototype:void 0,Ml=Qh?Qh.valueOf:void 0;function rE(r,n,a,l,c,p,g){switch(a){case tE:if(r.byteLength!=n.byteLength||r.byteOffset!=n.byteOffset)return!1;r=r.buffer,n=n.buffer;case eE:return!(r.byteLength!=n.byteLength||!p(new Hi(r),new Hi(n)));case HI:case JI:case jI:return Hr(+r,+n);case XI:return r.name==n.name&&r.message==n.message;case zI:case KI:return r==n+"";case YI:var y=Zh;case qI:var T=l&QI;if(y||(y=Vh),r.size!=n.size&&!T)return!1;var U=g.get(r);if(U)return U==n;l|=PI,g.set(r,n);var A=ls(y(r),y(n),l,c,p,g);return g.delete(r),A;case $I:if(Ml)return Ml.call(r)==Ml.call(n)}return!1}var Ph=rE;var nE=1,iE=Object.prototype,oE=iE.hasOwnProperty;function aE(r,n,a,l,c,p){var g=a&nE,y=Bo(r),T=y.length,U=Bo(n),A=U.length;if(T!=A&&!g)return!1;for(var F=T;F--;){var M=y[F];if(!(g?M in n:oE.call(n,M)))return!1}var X=p.get(r),S=p.get(n);if(X&&S)return X==n&&S==r;var Z=!0;p.set(r,n),p.set(n,r);for(var _=g;++F<T;){M=y[F];var G=r[M],J=n[M];if(l)var q=g?l(J,G,M,n,r,p):l(G,J,M,r,n,p);if(!(q===void 0?G===J||c(G,J,a,l,p):q)){Z=!1;break}_||(_=M=="constructor")}if(Z&&!_){var te=r.constructor,ae=n.constructor;te!=ae&&"constructor"in r&&"constructor"in n&&!(typeof te=="function"&&te instanceof te&&typeof ae=="function"&&ae instanceof ae)&&(Z=!1)}return p.delete(r),p.delete(n),Z}var Hh=aE;var sE=1,Jh="[object Arguments]",Xh="[object Array]",us="[object Object]",lE=Object.prototype,Yh=lE.hasOwnProperty;function uE(r,n,a,l,c,p){var g=nt(r),y=nt(n),T=g?Xh:Mr(r),U=y?Xh:Mr(n);T=T==Jh?us:T,U=U==Jh?us:U;var A=T==us,F=U==us,M=T==U;if(M&&kr(r)){if(!kr(n))return!1;g=!0,A=!1}if(M&&!A)return p||(p=new jr),g||Bn(r)?ls(r,n,a,l,c,p):Ph(r,n,T,a,l,c,p);if(!(a&sE)){var X=A&&Yh.call(r,"__wrapped__"),S=F&&Yh.call(n,"__wrapped__");if(X||S){var Z=X?r.value():r,_=S?n.value():n;return p||(p=new jr),c(Z,_,a,l,p)}}return M?(p||(p=new jr),Hh(r,n,a,l,c,p)):!1}var jh=uE;function zh(r,n,a,l,c){return r===n?!0:r==null||n==null||!Bt(r)&&!Bt(n)?r!==r&&n!==n:jh(r,n,a,l,zh,c)}var fs=zh;var fE=1,cE=2;function dE(r,n,a,l){var c=a.length,p=c,g=!l;if(r==null)return!p;for(r=Object(r);c--;){var y=a[c];if(g&&y[2]?y[1]!==r[y[0]]:!(y[0]in r))return!1}for(;++c<p;){y=a[c];var T=y[0],U=r[T],A=y[1];if(g&&y[2]){if(U===void 0&&!(T in r))return!1}else{var F=new jr;if(l)var M=l(U,A,T,r,n,F);if(!(M===void 0?fs(A,U,fE|cE,l,F):M))return!1}}return!0}var qh=dE;function hE(r){return r===r&&!Ot(r)}var cs=hE;function pE(r){for(var n=Xr(r),a=n.length;a--;){var l=n[a],c=r[l];n[a]=[l,c,cs(c)]}return n}var Kh=pE;function gE(r,n){return function(a){return a==null?!1:a[r]===n&&(n!==void 0||r in Object(a))}}var ds=gE;function mE(r){var n=Kh(r);return n.length==1&&n[0][2]?ds(n[0][0],n[0][1]):function(a){return a===r||qh(a,r,n)}}var $h=mE;function bE(r,n){return r!=null&&n in Object(r)}var ep=bE;function vE(r,n,a){n=Ja(n,r);for(var l=-1,c=n.length,p=!1;++l<c;){var g=On(n[l]);if(!(p=r!=null&&a(r,g)))break;r=r[g]}return p||++l!=c?p:(c=r==null?0:r.length,!!c&&ki(c)&&Ui(g,c)&&(nt(r)||fn(r)))}var tp=vE;function yE(r,n){return r!=null&&tp(r,n,ep)}var rp=yE;var xE=1,TE=2;function IE(r,n){return Gi(r)&&cs(n)?ds(On(r),n):function(a){var l=jd(a,r);return l===void 0&&l===n?rp(a,r):fs(n,l,xE|TE)}}var np=IE;function EE(r){return function(n){return n?.[r]}}var ip=EE;function CE(r){return function(n){return Xa(n,r)}}var op=CE;function AE(r){return Gi(r)?ip(On(r)):op(r)}var ap=AE;function RE(r){return typeof r=="function"?r:r==null?Li:typeof r=="object"?nt(r)?np(r[0],r[1]):$h(r):ap(r)}var hs=RE;function _E(r){return function(n,a,l){for(var c=-1,p=Object(n),g=l(n),y=g.length;y--;){var T=g[r?y:++c];if(a(p[T],T,p)===!1)break}return n}}var sp=_E;var NE=sp(),ps=NE;function SE(r,n){return r&&ps(r,n,Xr)}var gs=SE;function wE(r,n){return function(a,l){if(a==null)return a;if(!Rr(a))return r(a,l);for(var c=a.length,p=n?c:-1,g=Object(a);(n?p--:++p<c)&&l(g[p],p,g)!==!1;);return a}}var lp=wE;var LE=lp(gs),up=LE;function FE(r,n,a){(a!==void 0&&!Hr(r[n],a)||a===void 0&&!(n in r))&&Ln(r,n,a)}var Uo=FE;function BE(r){return Bt(r)&&Rr(r)}var fp=BE;function UE(r,n){if(!(n==="constructor"&&typeof r[n]=="function")&&n!="__proto__")return r[n]}var ko=UE;function kE(r){return Jr(r,Yr(r))}var cp=kE;function ME(r,n,a,l,c,p,g){var y=ko(r,a),T=ko(n,a),U=g.get(T);if(U){Uo(r,a,U);return}var A=p?p(y,T,a+"",r,n,g):void 0,F=A===void 0;if(F){var M=nt(T),X=!M&&kr(T),S=!M&&!X&&Bn(T);A=T,M||X||S?nt(y)?A=y:fp(y)?A=Za(y):X?(F=!1,A=ja(T,!0)):S?(F=!1,A=ns(T,!0)):A=[]:qd(T)||fn(T)?(A=y,fn(y)?A=cp(y):(!Ot(y)||Fi(y))&&(A=is(T))):F=!1}F&&(g.set(T,A),c(A,T,l,p,g),g.delete(T)),Uo(r,a,A)}var dp=ME;function hp(r,n,a,l,c){r!==n&&ps(n,function(p,g){if(c||(c=new jr),Ot(p))dp(r,n,g,a,hp,l,c);else{var y=l?l(ko(r,g),p,g+"",r,n,c):void 0;y===void 0&&(y=p),Uo(r,g,y)}},Yr)}var pp=hp;function GE(r,n){var a=[];return up(r,function(l,c,p){n(l,c,p)&&a.push(l)}),a}var gp=GE;function OE(r,n){var a=nt(r)?za:gp;return a(r,hs(n,3))}var Gl=OE;var WE="[object Map]",DE="[object Set]",ZE=Object.prototype,VE=ZE.hasOwnProperty;function QE(r){if(r==null)return!0;if(Rr(r)&&(nt(r)||typeof r=="string"||typeof r.splice=="function"||kr(r)||Bn(r)||fn(r)))return!r.length;var n=Mr(r);if(n==WE||n==DE)return!r.size;if(Fn(r))return!Ha(r).length;for(var a in r)if(VE.call(r,a))return!1;return!0}var ms=QE;function PE(r,n){var a={};return n=hs(n,3),gs(r,function(l,c,p){Ln(a,c,n(l,c,p))}),a}var Mo=PE;var HE=bd(function(r,n,a){pp(r,n,a)}),Ol=HE;var JE={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},XE=Kd(JE),mp=XE;var bp=/&(?:amp|lt|gt|quot|#39);/g,YE=RegExp(bp.source);function jE(r){return r=Zi(r),r&&YE.test(r)?r.replace(bp,mp):r}var Wl=jE;var zE=0;function qE(r){var n=++zE;return Zi(r)+n}var Dl=qE;function Zl(){return{persistenceId:function(r){var n="",a=r.rootEl;for(a.id&&(n=a.id);a&&a!==document;a=a.parentNode)if(a){a.id&&(n=a.id);break}return"yasr_"+n},getPlainQueryLinkToEndpoint:void 0,persistencyExpire:60*60*24*30,persistenceLabelResponse:"response",persistenceLabelConfig:"config",maxPersistentResponseSize:1e5,prefixes:{},plugins:{},pluginOrder:["Table","response","Geo","Graph"],defaultPlugin:"Table"}}var{entries:Rp,setPrototypeOf:vp,isFrozen:KE,getPrototypeOf:$E,getOwnPropertyDescriptor:eC}=Object,{freeze:ir,seal:_r,create:Yl}=Object,{apply:jl,construct:zl}=typeof Reflect<"u"&&Reflect;ir||(ir=function(n){return n});_r||(_r=function(n){return n});jl||(jl=function(n,a){for(var l=arguments.length,c=new Array(l>2?l-2:0),p=2;p<l;p++)c[p-2]=arguments[p];return n.apply(a,c)});zl||(zl=function(n){for(var a=arguments.length,l=new Array(a>1?a-1:0),c=1;c<a;c++)l[c-1]=arguments[c];return new n(...l)});var bs=or(Array.prototype.forEach),tC=or(Array.prototype.lastIndexOf),yp=or(Array.prototype.pop),Go=or(Array.prototype.push),rC=or(Array.prototype.splice),ys=or(String.prototype.toLowerCase),Vl=or(String.prototype.toString),Ql=or(String.prototype.match),Oo=or(String.prototype.replace),nC=or(String.prototype.indexOf),iC=or(String.prototype.trim),Gr=or(Object.prototype.hasOwnProperty),nr=or(RegExp.prototype.test),Wo=oC(TypeError);function or(r){return function(n){n instanceof RegExp&&(n.lastIndex=0);for(var a=arguments.length,l=new Array(a>1?a-1:0),c=1;c<a;c++)l[c-1]=arguments[c];return jl(r,n,l)}}function oC(r){return function(){for(var n=arguments.length,a=new Array(n),l=0;l<n;l++)a[l]=arguments[l];return zl(r,a)}}function We(r,n){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ys;vp&&vp(r,null);let l=n.length;for(;l--;){let c=n[l];if(typeof c=="string"){let p=a(c);p!==c&&(KE(n)||(n[l]=p),c=p)}r[c]=!0}return r}function aC(r){for(let n=0;n<r.length;n++)Gr(r,n)||(r[n]=null);return r}function zr(r){let n=Yl(null);for(let[a,l]of Rp(r))Gr(r,a)&&(Array.isArray(l)?n[a]=aC(l):l&&typeof l=="object"&&l.constructor===Object?n[a]=zr(l):n[a]=l);return n}function Do(r,n){for(;r!==null;){let l=eC(r,n);if(l){if(l.get)return or(l.get);if(typeof l.value=="function")return or(l.value)}r=$E(r)}function a(){return null}return a}var xp=ir(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Pl=ir(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Hl=ir(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),sC=ir(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Jl=ir(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),lC=ir(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Tp=ir(["#text"]),Ip=ir(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Xl=ir(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Ep=ir(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),vs=ir(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),uC=_r(/\{\{[\w\W]*|[\w\W]*\}\}/gm),fC=_r(/<%[\w\W]*|[\w\W]*%>/gm),cC=_r(/\$\{[\w\W]*/gm),dC=_r(/^data-[\-\w.\u00B7-\uFFFF]+$/),hC=_r(/^aria-[\-\w]+$/),_p=_r(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),pC=_r(/^(?:\w+script|data):/i),gC=_r(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Np=_r(/^html$/i),mC=_r(/^[a-z][.\w]*(-[.\w]+)+$/i),Cp=Object.freeze({__proto__:null,ARIA_ATTR:hC,ATTR_WHITESPACE:gC,CUSTOM_ELEMENT:mC,DATA_ATTR:dC,DOCTYPE_NAME:Np,ERB_EXPR:fC,IS_ALLOWED_URI:_p,IS_SCRIPT_OR_DATA:pC,MUSTACHE_EXPR:uC,TMPLIT_EXPR:cC}),Zo={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},bC=function(){return typeof window>"u"?null:window},vC=function(n,a){if(typeof n!="object"||typeof n.createPolicy!="function")return null;let l=null,c="data-tt-policy-suffix";a&&a.hasAttribute(c)&&(l=a.getAttribute(c));let p="dompurify"+(l?"#"+l:"");try{return n.createPolicy(p,{createHTML(g){return g},createScriptURL(g){return g}})}catch{return console.warn("TrustedTypes policy "+p+" could not be created."),null}},Ap=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Sp(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:bC(),n=xe=>Sp(xe);if(n.version="3.3.1",n.removed=[],!r||!r.document||r.document.nodeType!==Zo.document||!r.Element)return n.isSupported=!1,n;let{document:a}=r,l=a,c=l.currentScript,{DocumentFragment:p,HTMLTemplateElement:g,Node:y,Element:T,NodeFilter:U,NamedNodeMap:A=r.NamedNodeMap||r.MozNamedAttrMap,HTMLFormElement:F,DOMParser:M,trustedTypes:X}=r,S=T.prototype,Z=Do(S,"cloneNode"),_=Do(S,"remove"),G=Do(S,"nextSibling"),J=Do(S,"childNodes"),q=Do(S,"parentNode");if(typeof g=="function"){let xe=a.createElement("template");xe.content&&xe.content.ownerDocument&&(a=xe.content.ownerDocument)}let te,ae="",{implementation:R,createNodeIterator:w,createDocumentFragment:P,getElementsByTagName:$}=a,{importNode:fe}=l,k=Ap();n.isSupported=typeof Rp=="function"&&typeof q=="function"&&R&&R.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:oe,ERB_EXPR:x,TMPLIT_EXPR:ee,DATA_ATTR:D,ARIA_ATTR:de,IS_SCRIPT_OR_DATA:ge,ATTR_WHITESPACE:Oe,CUSTOM_ELEMENT:_e}=Cp,{IS_ALLOWED_URI:we}=Cp,re=null,Ze=We({},[...xp,...Pl,...Hl,...Jl,...Tp]),Ce=null,ve=We({},[...Ip,...Xl,...Ep,...vs]),se=Object.seal(Yl(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),le=null,ye=null,Ge=Object.seal(Yl(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),ue=!0,Fe=!0,Je=!1,Me=!0,Le=!1,Re=!0,De=!1,Be=!1,Ve=!1,Te=!1,It=!1,Et=!1,mr=!0,lt=!1,Qt="user-content-",ze=!0,Xe=!1,mt={},ut=null,qe=We({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),kt=null,ft=We({},["audio","video","img","source","image","track"]),Mt=null,br=We({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),vr="http://www.w3.org/1998/Math/MathML",vn="http://www.w3.org/2000/svg",Ne="http://www.w3.org/1999/xhtml",Sr=Ne,Ie=!1,yr=null,Ct=We({},[vr,vn,Ne],Vl),Ke=We({},["mi","mo","mn","ms","mtext"]),$e=We({},["annotation-xml"]),sr=We({},["title","style","font","a","script"]),yt=null,xr=["application/xhtml+xml","text/html"],At="text/html",rt=null,pt=null,Wr=a.createElement("form"),yn=function(N){return N instanceof RegExp||N instanceof Function},Yt=function(){let N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(pt&&pt===N)){if((!N||typeof N!="object")&&(N={}),N=zr(N),yt=xr.indexOf(N.PARSER_MEDIA_TYPE)===-1?At:N.PARSER_MEDIA_TYPE,rt=yt==="application/xhtml+xml"?Vl:ys,re=Gr(N,"ALLOWED_TAGS")?We({},N.ALLOWED_TAGS,rt):Ze,Ce=Gr(N,"ALLOWED_ATTR")?We({},N.ALLOWED_ATTR,rt):ve,yr=Gr(N,"ALLOWED_NAMESPACES")?We({},N.ALLOWED_NAMESPACES,Vl):Ct,Mt=Gr(N,"ADD_URI_SAFE_ATTR")?We(zr(br),N.ADD_URI_SAFE_ATTR,rt):br,kt=Gr(N,"ADD_DATA_URI_TAGS")?We(zr(ft),N.ADD_DATA_URI_TAGS,rt):ft,ut=Gr(N,"FORBID_CONTENTS")?We({},N.FORBID_CONTENTS,rt):qe,le=Gr(N,"FORBID_TAGS")?We({},N.FORBID_TAGS,rt):zr({}),ye=Gr(N,"FORBID_ATTR")?We({},N.FORBID_ATTR,rt):zr({}),mt=Gr(N,"USE_PROFILES")?N.USE_PROFILES:!1,ue=N.ALLOW_ARIA_ATTR!==!1,Fe=N.ALLOW_DATA_ATTR!==!1,Je=N.ALLOW_UNKNOWN_PROTOCOLS||!1,Me=N.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Le=N.SAFE_FOR_TEMPLATES||!1,Re=N.SAFE_FOR_XML!==!1,De=N.WHOLE_DOCUMENT||!1,Te=N.RETURN_DOM||!1,It=N.RETURN_DOM_FRAGMENT||!1,Et=N.RETURN_TRUSTED_TYPE||!1,Ve=N.FORCE_BODY||!1,mr=N.SANITIZE_DOM!==!1,lt=N.SANITIZE_NAMED_PROPS||!1,ze=N.KEEP_CONTENT!==!1,Xe=N.IN_PLACE||!1,we=N.ALLOWED_URI_REGEXP||_p,Sr=N.NAMESPACE||Ne,Ke=N.MATHML_TEXT_INTEGRATION_POINTS||Ke,$e=N.HTML_INTEGRATION_POINTS||$e,se=N.CUSTOM_ELEMENT_HANDLING||{},N.CUSTOM_ELEMENT_HANDLING&&yn(N.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(se.tagNameCheck=N.CUSTOM_ELEMENT_HANDLING.tagNameCheck),N.CUSTOM_ELEMENT_HANDLING&&yn(N.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(se.attributeNameCheck=N.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),N.CUSTOM_ELEMENT_HANDLING&&typeof N.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(se.allowCustomizedBuiltInElements=N.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Le&&(Fe=!1),It&&(Te=!0),mt&&(re=We({},Tp),Ce=[],mt.html===!0&&(We(re,xp),We(Ce,Ip)),mt.svg===!0&&(We(re,Pl),We(Ce,Xl),We(Ce,vs)),mt.svgFilters===!0&&(We(re,Hl),We(Ce,Xl),We(Ce,vs)),mt.mathMl===!0&&(We(re,Jl),We(Ce,Ep),We(Ce,vs))),N.ADD_TAGS&&(typeof N.ADD_TAGS=="function"?Ge.tagCheck=N.ADD_TAGS:(re===Ze&&(re=zr(re)),We(re,N.ADD_TAGS,rt))),N.ADD_ATTR&&(typeof N.ADD_ATTR=="function"?Ge.attributeCheck=N.ADD_ATTR:(Ce===ve&&(Ce=zr(Ce)),We(Ce,N.ADD_ATTR,rt))),N.ADD_URI_SAFE_ATTR&&We(Mt,N.ADD_URI_SAFE_ATTR,rt),N.FORBID_CONTENTS&&(ut===qe&&(ut=zr(ut)),We(ut,N.FORBID_CONTENTS,rt)),N.ADD_FORBID_CONTENTS&&(ut===qe&&(ut=zr(ut)),We(ut,N.ADD_FORBID_CONTENTS,rt)),ze&&(re["#text"]=!0),De&&We(re,["html","head","body"]),re.table&&(We(re,["tbody"]),delete le.tbody),N.TRUSTED_TYPES_POLICY){if(typeof N.TRUSTED_TYPES_POLICY.createHTML!="function")throw Wo('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof N.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Wo('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');te=N.TRUSTED_TYPES_POLICY,ae=te.createHTML("")}else te===void 0&&(te=vC(X,c)),te!==null&&typeof ae=="string"&&(ae=te.createHTML(""));ir&&ir(N),pt=N}},si=We({},[...Pl,...Hl,...sC]),en=We({},[...Jl,...lC]),li=function(N){let K=q(N);(!K||!K.tagName)&&(K={namespaceURI:Sr,tagName:"template"});let be=ys(N.tagName),Ye=ys(K.tagName);return yr[N.namespaceURI]?N.namespaceURI===vn?K.namespaceURI===Ne?be==="svg":K.namespaceURI===vr?be==="svg"&&(Ye==="annotation-xml"||Ke[Ye]):!!si[be]:N.namespaceURI===vr?K.namespaceURI===Ne?be==="math":K.namespaceURI===vn?be==="math"&&$e[Ye]:!!en[be]:N.namespaceURI===Ne?K.namespaceURI===vn&&!$e[Ye]||K.namespaceURI===vr&&!Ke[Ye]?!1:!en[be]&&(sr[be]||!si[be]):!!(yt==="application/xhtml+xml"&&yr[N.namespaceURI]):!1},Pt=function(N){Go(n.removed,{element:N});try{q(N).removeChild(N)}catch{_(N)}},Ht=function(N,K){try{Go(n.removed,{attribute:K.getAttributeNode(N),from:K})}catch{Go(n.removed,{attribute:null,from:K})}if(K.removeAttribute(N),N==="is")if(Te||It)try{Pt(K)}catch{}else try{K.setAttribute(N,"")}catch{}},jt=function(N){let K=null,be=null;if(Ve)N="<remove></remove>"+N;else{let Ue=Ql(N,/^[\r\n\t ]+/);be=Ue&&Ue[0]}yt==="application/xhtml+xml"&&Sr===Ne&&(N='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+N+"</body></html>");let Ye=te?te.createHTML(N):N;if(Sr===Ne)try{K=new M().parseFromString(Ye,yt)}catch{}if(!K||!K.documentElement){K=R.createDocument(Sr,"template",null);try{K.documentElement.innerHTML=Ie?ae:Ye}catch{}}let dt=K.body||K.documentElement;return N&&be&&dt.insertBefore(a.createTextNode(be),dt.childNodes[0]||null),Sr===Ne?$.call(K,De?"html":"body")[0]:De?K.documentElement:dt},wr=function(N){return w.call(N.ownerDocument||N,N,U.SHOW_ELEMENT|U.SHOW_COMMENT|U.SHOW_TEXT|U.SHOW_PROCESSING_INSTRUCTION|U.SHOW_CDATA_SECTION,null)},xn=function(N){return N instanceof F&&(typeof N.nodeName!="string"||typeof N.textContent!="string"||typeof N.removeChild!="function"||!(N.attributes instanceof A)||typeof N.removeAttribute!="function"||typeof N.setAttribute!="function"||typeof N.namespaceURI!="string"||typeof N.insertBefore!="function"||typeof N.hasChildNodes!="function")},lr=function(N){return typeof y=="function"&&N instanceof y};function Tr(xe,N,K){bs(xe,be=>{be.call(n,N,K,pt)})}let tn=function(N){let K=null;if(Tr(k.beforeSanitizeElements,N,null),xn(N))return Pt(N),!0;let be=rt(N.nodeName);if(Tr(k.uponSanitizeElement,N,{tagName:be,allowedTags:re}),Re&&N.hasChildNodes()&&!lr(N.firstElementChild)&&nr(/<[/\w!]/g,N.innerHTML)&&nr(/<[/\w!]/g,N.textContent)||N.nodeType===Zo.progressingInstruction||Re&&N.nodeType===Zo.comment&&nr(/<[/\w]/g,N.data))return Pt(N),!0;if(!(Ge.tagCheck instanceof Function&&Ge.tagCheck(be))&&(!re[be]||le[be])){if(!le[be]&&fr(be)&&(se.tagNameCheck instanceof RegExp&&nr(se.tagNameCheck,be)||se.tagNameCheck instanceof Function&&se.tagNameCheck(be)))return!1;if(ze&&!ut[be]){let Ye=q(N)||N.parentNode,dt=J(N)||N.childNodes;if(dt&&Ye){let Ue=dt.length;for(let he=Ue-1;he>=0;--he){let Rt=Z(dt[he],!0);Rt.__removalCount=(N.__removalCount||0)+1,Ye.insertBefore(Rt,G(N))}}}return Pt(N),!0}return N instanceof T&&!li(N)||(be==="noscript"||be==="noembed"||be==="noframes")&&nr(/<\/no(script|embed|frames)/i,N.innerHTML)?(Pt(N),!0):(Le&&N.nodeType===Zo.text&&(K=N.textContent,bs([oe,x,ee],Ye=>{K=Oo(K,Ye," ")}),N.textContent!==K&&(Go(n.removed,{element:N.cloneNode()}),N.textContent=K)),Tr(k.afterSanitizeElements,N,null),!1)},ur=function(N,K,be){if(mr&&(K==="id"||K==="name")&&(be in a||be in Wr))return!1;if(!(Fe&&!ye[K]&&nr(D,K))){if(!(ue&&nr(de,K))){if(!(Ge.attributeCheck instanceof Function&&Ge.attributeCheck(K,N))){if(!Ce[K]||ye[K]){if(!(fr(N)&&(se.tagNameCheck instanceof RegExp&&nr(se.tagNameCheck,N)||se.tagNameCheck instanceof Function&&se.tagNameCheck(N))&&(se.attributeNameCheck instanceof RegExp&&nr(se.attributeNameCheck,K)||se.attributeNameCheck instanceof Function&&se.attributeNameCheck(K,N))||K==="is"&&se.allowCustomizedBuiltInElements&&(se.tagNameCheck instanceof RegExp&&nr(se.tagNameCheck,be)||se.tagNameCheck instanceof Function&&se.tagNameCheck(be))))return!1}else if(!Mt[K]){if(!nr(we,Oo(be,Oe,""))){if(!((K==="src"||K==="xlink:href"||K==="href")&&N!=="script"&&nC(be,"data:")===0&&kt[N])){if(!(Je&&!nr(ge,Oo(be,Oe,"")))){if(be)return!1}}}}}}}return!0},fr=function(N){return N!=="annotation-xml"&&Ql(N,_e)},Dr=function(N){Tr(k.beforeSanitizeAttributes,N,null);let{attributes:K}=N;if(!K||xn(N))return;let be={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Ce,forceKeepAttr:void 0},Ye=K.length;for(;Ye--;){let dt=K[Ye],{name:Ue,namespaceURI:he,value:Rt}=dt,Cr=rt(Ue),Dt=Rt,v=Ue==="value"?Dt:iC(Dt);if(be.attrName=Cr,be.attrValue=v,be.keepAttr=!0,be.forceKeepAttr=void 0,Tr(k.uponSanitizeAttribute,N,be),v=be.attrValue,lt&&(Cr==="id"||Cr==="name")&&(Ht(Ue,N),v=Qt+v),Re&&nr(/((--!?|])>)|<\/(style|title|textarea)/i,v)){Ht(Ue,N);continue}if(Cr==="attributename"&&Ql(v,"href")){Ht(Ue,N);continue}if(be.forceKeepAttr)continue;if(!be.keepAttr){Ht(Ue,N);continue}if(!Me&&nr(/\/>/i,v)){Ht(Ue,N);continue}Le&&bs([oe,x,ee],V=>{v=Oo(v,V," ")});let E=rt(N.nodeName);if(!ur(E,Cr,v)){Ht(Ue,N);continue}if(te&&typeof X=="object"&&typeof X.getAttributeType=="function"&&!he)switch(X.getAttributeType(E,Cr)){case"TrustedHTML":{v=te.createHTML(v);break}case"TrustedScriptURL":{v=te.createScriptURL(v);break}}if(v!==Dt)try{he?N.setAttributeNS(he,Ue,v):N.setAttribute(Ue,v),xn(N)?Pt(N):yp(n.removed)}catch{Ht(Ue,N)}}Tr(k.afterSanitizeAttributes,N,null)},Tn=function xe(N){let K=null,be=wr(N);for(Tr(k.beforeSanitizeShadowDOM,N,null);K=be.nextNode();)Tr(k.uponSanitizeShadowNode,K,null),tn(K),Dr(K),K.content instanceof p&&xe(K.content);Tr(k.afterSanitizeShadowDOM,N,null)};return n.sanitize=function(xe){let N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},K=null,be=null,Ye=null,dt=null;if(Ie=!xe,Ie&&(xe="<!-->"),typeof xe!="string"&&!lr(xe))if(typeof xe.toString=="function"){if(xe=xe.toString(),typeof xe!="string")throw Wo("dirty is not a string, aborting")}else throw Wo("toString is not a function");if(!n.isSupported)return xe;if(Be||Yt(N),n.removed=[],typeof xe=="string"&&(Xe=!1),Xe){if(xe.nodeName){let Rt=rt(xe.nodeName);if(!re[Rt]||le[Rt])throw Wo("root node is forbidden and cannot be sanitized in-place")}}else if(xe instanceof y)K=jt("<!---->"),be=K.ownerDocument.importNode(xe,!0),be.nodeType===Zo.element&&be.nodeName==="BODY"||be.nodeName==="HTML"?K=be:K.appendChild(be);else{if(!Te&&!Le&&!De&&xe.indexOf("<")===-1)return te&&Et?te.createHTML(xe):xe;if(K=jt(xe),!K)return Te?null:Et?ae:""}K&&Ve&&Pt(K.firstChild);let Ue=wr(Xe?xe:K);for(;Ye=Ue.nextNode();)tn(Ye),Dr(Ye),Ye.content instanceof p&&Tn(Ye.content);if(Xe)return xe;if(Te){if(It)for(dt=P.call(K.ownerDocument);K.firstChild;)dt.appendChild(K.firstChild);else dt=K;return(Ce.shadowroot||Ce.shadowrootmode)&&(dt=fe.call(l,dt,!0)),dt}let he=De?K.outerHTML:K.innerHTML;return De&&re["!doctype"]&&K.ownerDocument&&K.ownerDocument.doctype&&K.ownerDocument.doctype.name&&nr(Np,K.ownerDocument.doctype.name)&&(he="<!DOCTYPE "+K.ownerDocument.doctype.name+`>
40
+ `+he),Le&&bs([oe,x,ee],Rt=>{he=Oo(he,Rt," ")}),te&&Et?te.createHTML(he):he},n.setConfig=function(){let xe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Yt(xe),Be=!0},n.clearConfig=function(){pt=null,Be=!1},n.isValidAttribute=function(xe,N,K){pt||Yt({});let be=rt(xe),Ye=rt(N);return ur(be,Ye,K)},n.addHook=function(xe,N){typeof N=="function"&&Go(k[xe],N)},n.removeHook=function(xe,N){if(N!==void 0){let K=tC(k[xe],N);return K===-1?void 0:rC(k[xe],K,1)[0]}return yp(k[xe])},n.removeHooks=function(xe){k[xe]=[]},n.removeAllHooks=function(){k=Ap()},n}var Vo=Sp();var Or=Ar(ag()),ri=class{constructor(n){this.namespace=n}set(n,a,l,c){if(Or.default.enabled&&(this.removeExpiredKeys(),n&&a!==void 0)){a.documentElement&&(a=new XMLSerializer().serializeToString(a.documentElement));try{Or.default.set(n,{namespace:this.namespace,val:a,exp:l,time:new Date().getTime()/1e3})}catch(p){if(p instanceof Error){let g=p;if(g.quotaExceeded=IA(p),g.quotaExceeded&&c)c(p);else throw g}throw p}}}remove(n){Or.default.enabled&&n&&Or.default.remove(n)}removeExpiredKeys(){Or.default.enabled&&Or.default.each((n,a)=>{n&&n.exp&&new Date().getTime()/1e3-n.time>n.exp&&this.remove(a)})}removeAll(){Or.default.enabled}removeNamespace(){Or.default.each((n,a)=>{n.namespace&&n.namespace===this.namespace&&this.remove(a)})}get(n){if(Or.default.enabled&&n)if(this.removeExpiredKeys(),n){var a=Or.default.get(n);return a?a.val:void 0}else return}};function IA(r){var n=!1;if(r)if(r.code)switch(r.code){case 22:n=!0;break;case 1014:r.name==="NS_ERROR_DOM_QUOTA_REACHED"&&(n=!0);break}else r.number===-2147024882&&(n=!0);return n}var{sanitize:Ck}=Vo;function Xo(r,n){if(r)return r.classList?r.classList.contains(n):!!r.className.match(new RegExp("(\\s|^)"+n+"(\\s|$)"))}function Qe(r,...n){if(r)for(let a of n)r.classList?r.classList.add(a):Xo(r,a)||(r.className+=" "+a)}function hn(r,n){if(r){if(r.classList)r.classList.remove(n);else if(Xo(r,n)){var a=new RegExp("(\\s|^)"+n+"(\\s|$)");r.className=r.className.replace(a," ")}}}function au(r,n){if(typeof r=="string"){let a=JSON.parse(r);if(n&&a.results)for(let l in a.results.bindings)a.results.bindings[l]=n(a.results.bindings[l]);return a}if(typeof r=="object"&&r.constructor==={}.constructor){if(n&&r.results)for(let a in r.results.bindings)r.results.bindings[a]=n(r.results.bindings[a]);return r}throw new Error("Could not parse json")}var Sg=Ar(_g());var jo="http://www.w3.org/1999/02/22-rdf-syntax-ns#",zo="http://www.w3.org/2001/XMLSchema#",Es="http://www.w3.org/2000/10/swap/",gr={xsd:{decimal:`${zo}decimal`,boolean:`${zo}boolean`,double:`${zo}double`,integer:`${zo}integer`,string:`${zo}string`},rdf:{type:`${jo}type`,nil:`${jo}nil`,first:`${jo}first`,rest:`${jo}rest`,langString:`${jo}langString`},owl:{sameAs:"http://www.w3.org/2002/07/owl#sameAs"},r:{forSome:`${Es}reify#forSome`,forAll:`${Es}reify#forAll`},log:{implies:`${Es}log#implies`,isImpliedBy:`${Es}log#isImpliedBy`}};var{xsd:Cs}=gr,tR=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{8})|\\([^])/g,Ng={"\\":"\\","'":"'",'"':'"',n:`
41
+ `,r:"\r",t:" ",f:"\f",b:"\b",_:"_","~":"~",".":".","-":"-","!":"!",$:"$","&":"&","(":"(",")":")","*":"*","+":"+",",":",",";":";","=":"=","/":"/","?":"?","#":"#","@":"@","%":"%"},rR=/[\x00-\x20<>\\"\{\}\|\^\`]/,nR={_iri:!0,_unescapedIri:!0,_simpleQuotedString:!0,_langcode:!0,_blank:!0,_newline:!0,_comment:!0,_whitespace:!0,_endOfFile:!0},iR=/$0^/,qo=class{constructor(n){if(this._iri=/^<((?:[^ <>{}\\]|\\[uU])+)>[ \t]*/,this._unescapedIri=/^<([^\x00-\x20<>\\"\{\}\|\^\`]*)>[ \t]*/,this._simpleQuotedString=/^"([^"\\\r\n]*)"(?=[^"])/,this._simpleApostropheString=/^'([^'\\\r\n]*)'(?=[^'])/,this._langcode=/^@([a-z]+(?:-[a-z0-9]+)*)(?=[^a-z0-9\-])/i,this._prefix=/^((?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)?:(?=[#\s<])/,this._prefixed=/^((?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)?:((?:(?:[0-:A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~])(?:(?:[\.\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~])*(?:[\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~]))?)?)(?:[ \t]+|(?=\.?[,;!\^\s#()\[\]\{\}"'<>]))/,this._variable=/^\?(?:(?:[A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:[\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)(?=[.,;!\^\s#()\[\]\{\}"'<>])/,this._blank=/^_:((?:[0-9A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)(?:[ \t]+|(?=\.?[,;:\s#()\[\]\{\}"'<>]))/,this._number=/^[\-+]?(?:(\d+\.\d*|\.?\d+)[eE][\-+]?|\d*(\.)?)\d+(?=\.?[,;:\s#()\[\]\{\}"'<>])/,this._boolean=/^(?:true|false)(?=[.,;\s#()\[\]\{\}"'<>])/,this._keyword=/^@[a-z]+(?=[\s#<:])/i,this._sparqlKeyword=/^(?:PREFIX|BASE|GRAPH)(?=[\s#<])/i,this._shortPredicates=/^a(?=[\s#()\[\]\{\}"'<>])/,this._newline=/^[ \t]*(?:#[^\n\r]*)?(?:\r\n|\n|\r)[ \t]*/,this._comment=/#([^\n\r]*)/,this._whitespace=/^[ \t]+/,this._endOfFile=/^(?:#[^\n\r]*)?$/,n=n||{},this._isImpliedBy=n.isImpliedBy,this._lineMode=!!n.lineMode){this._n3Mode=!1;for(let a in this)!(a in nR)&&this[a]instanceof RegExp&&(this[a]=iR)}else this._n3Mode=n.n3!==!1;this.comments=!!n.comments,this._literalClosingPos=0}_tokenizeToEnd(n,a){let l=this._input,c=l.length;for(;;){let y,T;for(;y=this._newline.exec(l);)this.comments&&(T=this._comment.exec(y[0]))&&p("comment",T[1],"",this._line,y[0].length),l=l.substr(y[0].length,l.length),c=l.length,this._line++;if(!y&&(y=this._whitespace.exec(l))&&(l=l.substr(y[0].length,l.length)),this._endOfFile.test(l))return a&&(this.comments&&(T=this._comment.exec(l))&&p("comment",T[1],"",this._line,l.length),l=null,p("eof","","",this._line,0)),this._input=l;let U=this._line,A=l[0],F="",M="",X="",S=null,Z=0,_=!1;switch(A){case"^":if(l.length<3)break;if(l[1]==="^"){if(this._previousMarker="^^",l=l.substr(2),l[0]!=="<"){_=!0;break}}else{this._n3Mode&&(Z=1,F="^");break}case"<":if(S=this._unescapedIri.exec(l))F="IRI",M=S[1];else if(S=this._iri.exec(l)){if(M=this._unescape(S[1]),M===null||rR.test(M))return g(this);F="IRI"}else l.length>1&&l[1]==="<"?(F="<<",Z=2):this._n3Mode&&l.length>1&&l[1]==="="&&(Z=2,this._isImpliedBy?(F="abbreviation",M="<"):(F="inverse",M=">"));break;case">":l.length>1&&l[1]===">"&&(F=">>",Z=2);break;case"_":((S=this._blank.exec(l))||a&&(S=this._blank.exec(`${l} `)))&&(F="blank",X="_",M=S[1]);break;case'"':if(S=this._simpleQuotedString.exec(l))M=S[1];else if({value:M,matchLength:Z}=this._parseLiteral(l),M===null)return g(this);(S!==null||Z!==0)&&(F="literal",this._literalClosingPos=0);break;case"'":if(!this._lineMode){if(S=this._simpleApostropheString.exec(l))M=S[1];else if({value:M,matchLength:Z}=this._parseLiteral(l),M===null)return g(this);(S!==null||Z!==0)&&(F="literal",this._literalClosingPos=0)}break;case"?":this._n3Mode&&(S=this._variable.exec(l))&&(F="var",M=S[0]);break;case"@":this._previousMarker==="literal"&&(S=this._langcode.exec(l))?(F="langcode",M=S[1]):(S=this._keyword.exec(l))&&(F=S[0]);break;case".":if(l.length===1?a:l[1]<"0"||l[1]>"9"){F=".",Z=1;break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"+":case"-":(S=this._number.exec(l)||a&&(S=this._number.exec(`${l} `)))&&(F="literal",M=S[0],X=typeof S[1]=="string"?Cs.double:typeof S[2]=="string"?Cs.decimal:Cs.integer);break;case"B":case"b":case"p":case"P":case"G":case"g":(S=this._sparqlKeyword.exec(l))?F=S[0].toUpperCase():_=!0;break;case"f":case"t":(S=this._boolean.exec(l))?(F="literal",M=S[0],X=Cs.boolean):_=!0;break;case"a":(S=this._shortPredicates.exec(l))?(F="abbreviation",M="a"):_=!0;break;case"=":this._n3Mode&&l.length>1&&(F="abbreviation",l[1]!==">"?(Z=1,M="="):(Z=2,M=">"));break;case"!":if(!this._n3Mode)break;case",":case";":case"[":case"]":case"(":case")":case"}":this._lineMode||(Z=1,F=A);break;case"{":!this._lineMode&&l.length>=2&&(l[1]==="|"?(F="{|",Z=2):(F=A,Z=1));break;case"|":l.length>=2&&l[1]==="}"&&(F="|}",Z=2);break;default:_=!0}if(_&&((this._previousMarker==="@prefix"||this._previousMarker==="PREFIX")&&(S=this._prefix.exec(l))?(F="prefix",M=S[1]||""):((S=this._prefixed.exec(l))||a&&(S=this._prefixed.exec(`${l} `)))&&(F="prefixed",X=S[1]||"",M=this._unescape(S[2]))),this._previousMarker==="^^")switch(F){case"prefixed":F="type";break;case"IRI":F="typeIRI";break;default:F=""}if(!F)return a||!/^'''|^"""/.test(l)&&/\n|\r/.test(l)?g(this):this._input=l;let G=Z||S[0].length,J=p(F,M,X,U,G);this.previousToken=J,this._previousMarker=F,l=l.substr(G,l.length)}function p(y,T,U,A,F){let M=l?c-l.length:c,X=M+F,S={type:y,value:T,prefix:U,line:A,start:M,end:X};return n(null,S),S}function g(y){n(y._syntaxError(/^\S*/.exec(l)[0]))}}_unescape(n){let a=!1,l=n.replace(tR,(c,p,g,y)=>{if(typeof p=="string")return String.fromCharCode(Number.parseInt(p,16));if(typeof g=="string"){let T=Number.parseInt(g,16);return T<=65535?String.fromCharCode(Number.parseInt(g,16)):String.fromCharCode(55296+((T-=65536)>>10),56320+(T&1023))}return y in Ng?Ng[y]:(a=!0,"")});return a?null:l}_parseLiteral(n){if(n.length>=3){let a=n.match(/^(?:"""|"|'''|'|)/)[0],l=a.length,c=Math.max(this._literalClosingPos,l);for(;(c=n.indexOf(a,c))>0;){let p=0;for(;n[c-p-1]==="\\";)p++;if(p%2===0){let g=n.substring(l,c),y=g.split(/\r\n|\r|\n/).length-1,T=c+l;if(l===1&&y!==0||l===3&&this._lineMode)break;return this._line+=y,{value:this._unescape(g),matchLength:T}}c++}this._literalClosingPos=n.length-l+1}return{value:"",matchLength:0}}_syntaxError(n){this._input=null;let a=new Error(`Unexpected "${n}" on line ${this._line}.`);return a.context={token:void 0,line:this._line,previousToken:this.previousToken},a}_readStartingBom(n){return n.startsWith("\uFEFF")?n.substr(1):n}tokenize(n,a){if(this._line=1,typeof n=="string")if(this._input=this._readStartingBom(n),typeof a=="function")queueMicrotask(()=>this._tokenizeToEnd(a,!0));else{let l=[],c;if(this._tokenizeToEnd((p,g)=>p?c=p:l.push(g),!0),c)throw c;return l}else this._pendingBuffer=null,typeof n.setEncoding=="function"&&n.setEncoding("utf8"),n.on("data",l=>{this._input!==null&&l.length!==0&&(this._pendingBuffer&&(l=Sg.Buffer.concat([this._pendingBuffer,l]),this._pendingBuffer=null),l[l.length-1]&128?this._pendingBuffer=l:(typeof this._input>"u"?this._input=this._readStartingBom(typeof l=="string"?l:l.toString()):this._input+=l,this._tokenizeToEnd(a,!1)))}),n.on("end",()=>{typeof this._input=="string"&&this._tokenizeToEnd(a,!0)}),n.on("error",a)}};var{rdf:oR,xsd:eo}=gr,ea,aR=0;var sR={namedNode:Lg,blankNode:Fg,variable:Ug,literal:Bg,defaultGraph:lR,quad:xu,triple:xu,fromTerm:Ko,fromQuad:kg},wg=sR,gn=class r{constructor(n){this.id=n}get value(){return this.id}equals(n){return n instanceof r?this.id===n.id:!!n&&this.termType===n.termType&&this.value===n.value}hashCode(){return 0}toJSON(){return{termType:this.termType,value:this.value}}},As=class extends gn{get termType(){return"NamedNode"}},$o=class r extends gn{get termType(){return"Literal"}get value(){return this.id.substring(1,this.id.lastIndexOf('"'))}get language(){let n=this.id,a=n.lastIndexOf('"')+1;return a<n.length&&n[a++]==="@"?n.substr(a).toLowerCase():""}get datatype(){return new As(this.datatypeString)}get datatypeString(){let n=this.id,a=n.lastIndexOf('"')+1,l=a<n.length?n[a]:"";return l==="^"?n.substr(a+2):l!=="@"?eo.string:oR.langString}equals(n){return n instanceof r?this.id===n.id:!!n&&!!n.datatype&&this.termType===n.termType&&this.value===n.value&&this.language===n.language&&this.datatype.value===n.datatype.value}toJSON(){return{termType:this.termType,value:this.value,language:this.language,datatype:{termType:"NamedNode",value:this.datatypeString}}}},bu=class extends gn{constructor(n){super(`_:${n}`)}get termType(){return"BlankNode"}get value(){return this.id.substr(2)}},vu=class extends gn{constructor(n){super(`?${n}`)}get termType(){return"Variable"}get value(){return this.id.substr(1)}},yu=class extends gn{constructor(){return super(""),ea||this}get termType(){return"DefaultGraph"}equals(n){return this===n||!!n&&this.termType===n.termType}};ea=new yu;var Rs=class extends gn{constructor(n,a,l,c){super(""),this._subject=n,this._predicate=a,this._object=l,this._graph=c||ea}get termType(){return"Quad"}get subject(){return this._subject}get predicate(){return this._predicate}get object(){return this._object}get graph(){return this._graph}toJSON(){return{termType:this.termType,subject:this._subject.toJSON(),predicate:this._predicate.toJSON(),object:this._object.toJSON(),graph:this._graph.toJSON()}}equals(n){return!!n&&this._subject.equals(n.subject)&&this._predicate.equals(n.predicate)&&this._object.equals(n.object)&&this._graph.equals(n.graph)}};function Lg(r){return new As(r)}function Fg(r){return new bu(r||`n3-${aR++}`)}function Bg(r,n){if(typeof n=="string")return new $o(`"${r}"@${n.toLowerCase()}`);let a=n?n.value:"";return a===""&&(typeof r=="boolean"?a=eo.boolean:typeof r=="number"&&(Number.isFinite(r)?a=Number.isInteger(r)?eo.integer:eo.double:(a=eo.double,Number.isNaN(r)||(r=r>0?"INF":"-INF")))),a===""||a===eo.string?new $o(`"${r}"`):new $o(`"${r}"^^${a}`)}function Ug(r){return new vu(r)}function lR(){return ea}function xu(r,n,a,l){return new Rs(r,n,a,l)}function Ko(r){if(r instanceof gn)return r;switch(r.termType){case"NamedNode":return Lg(r.value);case"BlankNode":return Fg(r.value);case"Variable":return Ug(r.value);case"DefaultGraph":return ea;case"Literal":return Bg(r.value,r.language||r.datatype);case"Quad":return kg(r);default:throw new Error(`Unexpected termType: ${r.termType}`)}}function kg(r){if(r instanceof Rs)return r;if(r.termType!=="Quad")throw new Error(`Unexpected termType: ${r.termType}`);return xu(Ko(r.subject),Ko(r.predicate),Ko(r.object),Ko(r.graph))}var Mg=0,oi=class{constructor(n){this._contextStack=[],this._graph=null,n=n||{},this._setBase(n.baseIRI),n.factory&&Gg(this,n.factory);let a=typeof n.format=="string"?n.format.match(/\w*$/)[0].toLowerCase():"",l=/turtle/.test(a),c=/trig/.test(a),p=/triple/.test(a),g=/quad/.test(a),y=this._n3Mode=/n3/.test(a),T=p||g;(this._supportsNamedGraphs=!(l||y))||(this._readPredicateOrNamedGraph=this._readPredicate),this._supportsQuads=!(l||c||p||y),this._isImpliedBy=n.isImpliedBy,this._supportsRDFStar=a===""||/star|\*$/.test(a),T&&(this._resolveRelativeIRI=U=>null),this._blankNodePrefix=typeof n.blankNodePrefix!="string"?"":n.blankNodePrefix.replace(/^(?!_:)/,"_:"),this._lexer=n.lexer||new qo({lineMode:T,n3:y,isImpliedBy:this._isImpliedBy}),this._explicitQuantifiers=!!n.explicitQuantifiers}static _resetBlankNodePrefix(){Mg=0}_setBase(n){if(!n)this._base="",this._basePath="";else{let a=n.indexOf("#");a>=0&&(n=n.substr(0,a)),this._base=n,this._basePath=n.indexOf("/")<0?n:n.replace(/[^\/?]*(?:\?.*)?$/,""),n=n.match(/^(?:([a-z][a-z0-9+.-]*:))?(?:\/\/[^\/]*)?/i),this._baseRoot=n[0],this._baseScheme=n[1]}}_saveContext(n,a,l,c,p){let g=this._n3Mode;this._contextStack.push({type:n,subject:l,predicate:c,object:p,graph:a,inverse:g?this._inversePredicate:!1,blankPrefix:g?this._prefixes._:"",quantified:g?this._quantified:null}),g&&(this._inversePredicate=!1,this._prefixes._=this._graph?`${this._graph.value}.`:".",this._quantified=Object.create(this._quantified))}_restoreContext(n,a){let l=this._contextStack.pop();if(!l||l.type!==n)return this._error(`Unexpected ${a.type}`,a);this._subject=l.subject,this._predicate=l.predicate,this._object=l.object,this._graph=l.graph,this._n3Mode&&(this._inversePredicate=l.inverse,this._prefixes._=l.blankPrefix,this._quantified=l.quantified)}_readInTopContext(n){switch(n.type){case"eof":return this._graph!==null?this._error("Unclosed graph",n):(delete this._prefixes._,this._callback(null,null,this._prefixes));case"PREFIX":this._sparqlStyle=!0;case"@prefix":return this._readPrefix;case"BASE":this._sparqlStyle=!0;case"@base":return this._readBaseIRI;case"{":if(this._supportsNamedGraphs)return this._graph="",this._subject=null,this._readSubject;case"GRAPH":if(this._supportsNamedGraphs)return this._readNamedGraphLabel;default:return this._readSubject(n)}}_readEntity(n,a){let l;switch(n.type){case"IRI":case"typeIRI":let c=this._resolveIRI(n.value);if(c===null)return this._error("Invalid IRI",n);l=this._factory.namedNode(c);break;case"type":case"prefixed":let p=this._prefixes[n.prefix];if(p===void 0)return this._error(`Undefined prefix "${n.prefix}:"`,n);l=this._factory.namedNode(p+n.value);break;case"blank":l=this._factory.blankNode(this._prefixes[n.prefix]+n.value);break;case"var":l=this._factory.variable(n.value.substr(1));break;default:return this._error(`Expected entity but got ${n.type}`,n)}return!a&&this._n3Mode&&l.id in this._quantified&&(l=this._quantified[l.id]),l}_readSubject(n){switch(this._predicate=null,n.type){case"[":return this._saveContext("blank",this._graph,this._subject=this._factory.blankNode(),null,null),this._readBlankNodeHead;case"(":return this._saveContext("list",this._graph,this.RDF_NIL,null,null),this._subject=null,this._readListItem;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._graph=this._factory.blankNode(),null,null),this._readSubject):this._error("Unexpected graph",n);case"}":return this._readPunctuation(n);case"@forSome":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORSOME,this._quantifier="blankNode",this._readQuantifierList):this._error('Unexpected "@forSome"',n);case"@forAll":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORALL,this._quantifier="variable",this._readQuantifierList):this._error('Unexpected "@forAll"',n);case"literal":if(!this._n3Mode)return this._error("Unexpected literal",n);if(n.prefix.length===0)return this._literalValue=n.value,this._completeSubjectLiteral;this._subject=this._factory.literal(n.value,this._factory.namedNode(n.prefix));break;case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,null,null,null),this._graph=null,this._readSubject):this._error("Unexpected RDF-star syntax",n);default:if((this._subject=this._readEntity(n))===void 0)return;if(this._n3Mode)return this._getPathReader(this._readPredicateOrNamedGraph)}return this._readPredicateOrNamedGraph}_readPredicate(n){let a=n.type;switch(a){case"inverse":this._inversePredicate=!0;case"abbreviation":this._predicate=this.ABBREVIATIONS[n.value];break;case".":case"]":case"}":return this._predicate===null?this._error(`Unexpected ${a}`,n):(this._subject=null,a==="]"?this._readBlankNodeTail(n):this._readPunctuation(n));case";":return this._predicate!==null?this._readPredicate:this._error("Expected predicate but got ;",n);case"[":if(this._n3Mode)return this._saveContext("blank",this._graph,this._subject,this._subject=this._factory.blankNode(),null),this._readBlankNodeHead;case"blank":if(!this._n3Mode)return this._error("Disallowed blank node as predicate",n);default:if((this._predicate=this._readEntity(n))===void 0)return}return this._readObject}_readObject(n){switch(n.type){case"literal":if(n.prefix.length===0)return this._literalValue=n.value,this._readDataTypeOrLang;this._object=this._factory.literal(n.value,this._factory.namedNode(n.prefix));break;case"[":return this._saveContext("blank",this._graph,this._subject,this._predicate,this._subject=this._factory.blankNode()),this._readBlankNodeHead;case"(":return this._saveContext("list",this._graph,this._subject,this._predicate,this.RDF_NIL),this._subject=null,this._readListItem;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._factory.blankNode()),this._readSubject):this._error("Unexpected graph",n);case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,this._subject,this._predicate,null),this._graph=null,this._readSubject):this._error("Unexpected RDF-star syntax",n);default:if((this._object=this._readEntity(n))===void 0)return;if(this._n3Mode)return this._getPathReader(this._getContextEndReader())}return this._getContextEndReader()}_readPredicateOrNamedGraph(n){return n.type==="{"?this._readGraph(n):this._readPredicate(n)}_readGraph(n){return n.type!=="{"?this._error(`Expected graph but got ${n.type}`,n):(this._graph=this._subject,this._subject=null,this._readSubject)}_readBlankNodeHead(n){return n.type==="]"?(this._subject=null,this._readBlankNodeTail(n)):(this._predicate=null,this._readPredicate(n))}_readBlankNodeTail(n){if(n.type!=="]")return this._readBlankNodePunctuation(n);this._subject!==null&&this._emit(this._subject,this._predicate,this._object,this._graph);let a=this._predicate===null;return this._restoreContext("blank",n),this._object!==null?this._getContextEndReader():this._predicate!==null?this._readObject:a?this._readPredicateOrNamedGraph:this._readPredicateAfterBlank}_readPredicateAfterBlank(n){switch(n.type){case".":case"}":return this._subject=null,this._readPunctuation(n);default:return this._readPredicate(n)}}_readListItem(n){let a=null,l=null,c=this._readListItem,p=this._subject,g=this._contextStack,y=g[g.length-1];switch(n.type){case"[":this._saveContext("blank",this._graph,l=this._factory.blankNode(),this.RDF_FIRST,this._subject=a=this._factory.blankNode()),c=this._readBlankNodeHead;break;case"(":this._saveContext("list",this._graph,l=this._factory.blankNode(),this.RDF_FIRST,this.RDF_NIL),this._subject=null;break;case")":if(this._restoreContext("list",n),g.length!==0&&g[g.length-1].type==="list"&&this._emit(this._subject,this._predicate,this._object,this._graph),this._predicate===null){if(c=this._readPredicate,this._subject===this.RDF_NIL)return c}else if(c=this._getContextEndReader(),this._object===this.RDF_NIL)return c;l=this.RDF_NIL;break;case"literal":n.prefix.length===0?(this._literalValue=n.value,c=this._readListItemDataTypeOrLang):(a=this._factory.literal(n.value,this._factory.namedNode(n.prefix)),c=this._getContextEndReader());break;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._factory.blankNode()),this._readSubject):this._error("Unexpected graph",n);default:if((a=this._readEntity(n))===void 0)return}if(l===null&&(this._subject=l=this._factory.blankNode()),p===null?y.predicate===null?y.subject=l:y.object=l:this._emit(p,this.RDF_REST,l,this._graph),a!==null){if(this._n3Mode&&(n.type==="IRI"||n.type==="prefixed"))return this._saveContext("item",this._graph,l,this.RDF_FIRST,a),this._subject=a,this._predicate=null,this._getPathReader(this._readListItem);this._emit(l,this.RDF_FIRST,a,this._graph)}return c}_readDataTypeOrLang(n){return this._completeObjectLiteral(n,!1)}_readListItemDataTypeOrLang(n){return this._completeObjectLiteral(n,!0)}_completeLiteral(n){let a=this._factory.literal(this._literalValue);switch(n.type){case"type":case"typeIRI":let l=this._readEntity(n);if(l===void 0)return;a=this._factory.literal(this._literalValue,l),n=null;break;case"langcode":a=this._factory.literal(this._literalValue,n.value),n=null;break}return{token:n,literal:a}}_completeSubjectLiteral(n){return this._subject=this._completeLiteral(n).literal,this._readPredicateOrNamedGraph}_completeObjectLiteral(n,a){let l=this._completeLiteral(n);if(l)return this._object=l.literal,a&&this._emit(this._subject,this.RDF_FIRST,this._object,this._graph),l.token===null?this._getContextEndReader():(this._readCallback=this._getContextEndReader(),this._readCallback(l.token))}_readFormulaTail(n){return n.type!=="}"?this._readPunctuation(n):(this._subject!==null&&this._emit(this._subject,this._predicate,this._object,this._graph),this._restoreContext("formula",n),this._object===null?this._readPredicate:this._getContextEndReader())}_readPunctuation(n){let a,l=this._graph,c=this._subject,p=this._inversePredicate;switch(n.type){case"}":if(this._graph===null)return this._error("Unexpected graph closing",n);if(this._n3Mode)return this._readFormulaTail(n);this._graph=null;case".":this._subject=null,a=this._contextStack.length?this._readSubject:this._readInTopContext,p&&(this._inversePredicate=!1);break;case";":a=this._readPredicate;break;case",":a=this._readObject;break;case"{|":if(!this._supportsRDFStar)return this._error("Unexpected RDF-star syntax",n);let g=this._predicate,y=this._object;this._subject=this._factory.quad(c,g,y,this.DEFAULTGRAPH),a=this._readPredicate;break;case"|}":if(this._subject.termType!=="Quad")return this._error("Unexpected asserted triple closing",n);this._subject=null,a=this._readPunctuation;break;default:if(this._supportsQuads&&this._graph===null&&(l=this._readEntity(n))!==void 0){a=this._readQuadPunctuation;break}return this._error(`Expected punctuation to follow "${this._object.id}"`,n)}if(c!==null){let g=this._predicate,y=this._object;p?this._emit(y,g,c,l):this._emit(c,g,y,l)}return a}_readBlankNodePunctuation(n){let a;switch(n.type){case";":a=this._readPredicate;break;case",":a=this._readObject;break;default:return this._error(`Expected punctuation to follow "${this._object.id}"`,n)}return this._emit(this._subject,this._predicate,this._object,this._graph),a}_readQuadPunctuation(n){return n.type!=="."?this._error("Expected dot to follow quad",n):this._readInTopContext}_readPrefix(n){return n.type!=="prefix"?this._error("Expected prefix to follow @prefix",n):(this._prefix=n.value,this._readPrefixIRI)}_readPrefixIRI(n){if(n.type!=="IRI")return this._error(`Expected IRI to follow prefix "${this._prefix}:"`,n);let a=this._readEntity(n);return this._prefixes[this._prefix]=a.value,this._prefixCallback(this._prefix,a),this._readDeclarationPunctuation}_readBaseIRI(n){let a=n.type==="IRI"&&this._resolveIRI(n.value);return a?(this._setBase(a),this._readDeclarationPunctuation):this._error("Expected valid IRI to follow base declaration",n)}_readNamedGraphLabel(n){switch(n.type){case"IRI":case"blank":case"prefixed":return this._readSubject(n),this._readGraph;case"[":return this._readNamedGraphBlankLabel;default:return this._error("Invalid graph label",n)}}_readNamedGraphBlankLabel(n){return n.type!=="]"?this._error("Invalid graph label",n):(this._subject=this._factory.blankNode(),this._readGraph)}_readDeclarationPunctuation(n){return this._sparqlStyle?(this._sparqlStyle=!1,this._readInTopContext(n)):n.type!=="."?this._error("Expected declaration to end with a dot",n):this._readInTopContext}_readQuantifierList(n){let a;switch(n.type){case"IRI":case"prefixed":if((a=this._readEntity(n,!0))!==void 0)break;default:return this._error(`Unexpected ${n.type}`,n)}return this._explicitQuantifiers?(this._subject===null?this._emit(this._graph||this.DEFAULTGRAPH,this._predicate,this._subject=this._factory.blankNode(),this.QUANTIFIERS_GRAPH):this._emit(this._subject,this.RDF_REST,this._subject=this._factory.blankNode(),this.QUANTIFIERS_GRAPH),this._emit(this._subject,this.RDF_FIRST,a,this.QUANTIFIERS_GRAPH)):this._quantified[a.id]=this._factory[this._quantifier](this._factory.blankNode().value),this._readQuantifierPunctuation}_readQuantifierPunctuation(n){return n.type===","?this._readQuantifierList:(this._explicitQuantifiers&&(this._emit(this._subject,this.RDF_REST,this.RDF_NIL,this.QUANTIFIERS_GRAPH),this._subject=null),this._readCallback=this._getContextEndReader(),this._readCallback(n))}_getPathReader(n){return this._afterPath=n,this._readPath}_readPath(n){switch(n.type){case"!":return this._readForwardPath;case"^":return this._readBackwardPath;default:let a=this._contextStack,l=a.length&&a[a.length-1];if(l&&l.type==="item"){let c=this._subject;this._restoreContext("item",n),this._emit(this._subject,this.RDF_FIRST,c,this._graph)}return this._afterPath(n)}}_readForwardPath(n){let a,l,c=this._factory.blankNode();if((l=this._readEntity(n))!==void 0)return this._predicate===null?(a=this._subject,this._subject=c):(a=this._object,this._object=c),this._emit(a,l,c,this._graph),this._readPath}_readBackwardPath(n){let a=this._factory.blankNode(),l,c;if((l=this._readEntity(n))!==void 0)return this._predicate===null?(c=this._subject,this._subject=a):(c=this._object,this._object=a),this._emit(a,l,c,this._graph),this._readPath}_readRDFStarTailOrGraph(n){return n.type!==">>"?this._supportsQuads&&this._graph===null&&(this._graph=this._readEntity(n))!==void 0?this._readRDFStarTail:this._error(`Expected >> to follow "${this._object.id}"`,n):this._readRDFStarTail(n)}_readRDFStarTail(n){if(n.type!==">>")return this._error(`Expected >> but got ${n.type}`,n);let a=this._factory.quad(this._subject,this._predicate,this._object,this._graph||this.DEFAULTGRAPH);return this._restoreContext("<<",n),this._subject===null?(this._subject=a,this._readPredicate):(this._object=a,this._getContextEndReader())}_getContextEndReader(){let n=this._contextStack;if(!n.length)return this._readPunctuation;switch(n[n.length-1].type){case"blank":return this._readBlankNodeTail;case"list":return this._readListItem;case"formula":return this._readFormulaTail;case"<<":return this._readRDFStarTailOrGraph}}_emit(n,a,l,c){this._callback(null,this._factory.quad(n,a,l,c||this.DEFAULTGRAPH))}_error(n,a){let l=new Error(`${n} on line ${a.line}.`);l.context={token:a,line:a.line,previousToken:this._lexer.previousToken},this._callback(l),this._callback=_s}_resolveIRI(n){return/^[a-z][a-z0-9+.-]*:/i.test(n)?n:this._resolveRelativeIRI(n)}_resolveRelativeIRI(n){if(!n.length)return this._base;switch(n[0]){case"#":return this._base+n;case"?":return this._base.replace(/(?:\?.*)?$/,n);case"/":return(n[1]==="/"?this._baseScheme:this._baseRoot)+this._removeDotSegments(n);default:return/^[^/:]*:/.test(n)?null:this._removeDotSegments(this._basePath+n)}}_removeDotSegments(n){if(!/(^|\/)\.\.?($|[/#?])/.test(n))return n;let a=n.length,l="",c=-1,p=-1,g=0,y="/";for(;c<a;){switch(y){case":":if(p<0&&n[++c]==="/"&&n[++c]==="/")for(;(p=c+1)<a&&n[p]!=="/";)c=p;break;case"?":case"#":c=a;break;case"/":if(n[c+1]===".")switch(y=n[++c+1],y){case"/":l+=n.substring(g,c-1),g=c+1;break;case void 0:case"?":case"#":return l+n.substring(g,c)+n.substr(c+1);case".":if(y=n[++c+1],y===void 0||y==="/"||y==="?"||y==="#"){if(l+=n.substring(g,c-2),(g=l.lastIndexOf("/"))>=p&&(l=l.substr(0,g)),y!=="/")return`${l}/${n.substr(c+1)}`;g=c+1}}}y=n[++c]}return l+n.substring(g)}parse(n,a,l){let c,p,g;if(a&&(a.onQuad||a.onPrefix||a.onComment)?(c=a.onQuad,p=a.onPrefix,g=a.onComment):(c=a,p=l),this._readCallback=this._readInTopContext,this._sparqlStyle=!1,this._prefixes=Object.create(null),this._prefixes._=this._blankNodePrefix?this._blankNodePrefix.substr(2):`b${Mg++}_`,this._prefixCallback=p||_s,this._inversePredicate=!1,this._quantified=Object.create(null),!c){let T=[],U;if(this._callback=(A,F)=>{A?U=A:F&&T.push(F)},this._lexer.tokenize(n).every(A=>this._readCallback=this._readCallback(A)),U)throw U;return T}let y=(T,U)=>{T!==null?(this._callback(T),this._callback=_s):this._readCallback&&(this._readCallback=this._readCallback(U))};g&&(this._lexer.comments=!0,y=(T,U)=>{T!==null?(this._callback(T),this._callback=_s):this._readCallback&&(U.type==="comment"?g(U.value):this._readCallback=this._readCallback(U))}),this._callback=c,this._lexer.tokenize(n,y)}};function _s(){}function Gg(r,n){r._factory=n,r.DEFAULTGRAPH=n.defaultGraph(),r.RDF_FIRST=n.namedNode(gr.rdf.first),r.RDF_REST=n.namedNode(gr.rdf.rest),r.RDF_NIL=n.namedNode(gr.rdf.nil),r.N3_FORALL=n.namedNode(gr.r.forAll),r.N3_FORSOME=n.namedNode(gr.r.forSome),r.ABBREVIATIONS={a:n.namedNode(gr.rdf.type),"=":n.namedNode(gr.owl.sameAs),">":n.namedNode(gr.log.implies),"<":n.namedNode(gr.log.isImpliedBy)},r.QUANTIFIERS_GRAPH=n.namedNode("urn:n3:quantifiers")}Gg(oi.prototype,wg);function Tu(r){if(r.termType==="NamedNode")return{value:r.value,type:"uri"};if(r.termType==="Literal"){let n={value:r.value,type:"literal"},a=r.language;a&&(n["xml:lang"]=a);let l=r.datatypeString;return l&&(n.datatype=l),n}return r.termType==="BlankNode"?{value:r.value,type:"bnode"}:{value:r.value,type:"uri"}}function Og(r){let n=Iu(r),a=["subject","predicate","object"],l=n.map(c=>({subject:Tu(c.subject),predicate:Tu(c.predicate),object:Tu(c.object)}));return{head:{vars:a},results:{bindings:l}}}function Iu(r){return new oi().parse(r||"")}function fR(r){let n={vars:[]};for(let a=0;a<r.childNodes.length;a++){let l=r.childNodes[a];if(l.nodeName=="variable"){let c=l.getAttribute("name");c&&n.vars.push(c)}}return n}var cR=["uri","literal","bnode","typed-literal"];function dR(r,n){let a={bindings:[]};for(let l=0;l<r.childNodes.length;l++){let c=r.childNodes[l],p={};for(let g=0;g<c.childNodes.length;g++){let y=c.childNodes[g];if(y.nodeName=="binding"){let T=y.getAttribute("name");if(T)for(let U=0;U<y.childNodes.length;U++){let A=y.childNodes[U];if(A.nodeName==="#text"||cR.indexOf(A.nodeName)<0)continue;let F={type:A.nodeName,value:Wl(A.innerHTML)},M=A.getAttribute("datatype");M&&(F.datatype=M),p[T]=F}}}ms(p)||a.bindings.push(n(p))}return a}function hR(r){return r.innerHTML==="true"}function Eu(r,n){if(typeof r!="string")return;let l=new DOMParser().parseFromString(r,"text/xml");if(!l.childNodes.length)return;let c=l.childNodes[0],p={};for(let g=0;g<c.childNodes.length;g++){let y=c.childNodes[g];y.nodeName=="head"&&(p.head=fR(y)),y.nodeName=="results"&&(p.results=dR(y,n)),y.nodeName=="boolean"&&(p.boolean=hR(y))}return p}var Dg=Ar(Wg());function Zg(r){let n=Dg.parse(r,{header:!0,skipEmptyLines:!0});if(n.meta.fields===void 0)throw new Error("Could not parse CSV, no headers found!");let a=n.meta.fields,c=n.data.map(g=>{let y={};for(let T in g)y[T]={value:g[T],type:"literal"};return y});return{head:{vars:a},results:{bindings:c}}}function Vg(r){let n=r.split(`
42
+ `);n.pop();let[a,...l]=n,c=a.split(" ").map(y=>y.substring(1)),p=l.map(y=>{let T={};for(let[U,A]of y.split(" ").entries()){let F=c[U];if(A[0]==="<")T[F]={value:A.substring(1,A.length-1),type:"uri"};else if(A[0]==='"'){let M=A.lastIndexOf('"'),X=A.substring(1,M);if(M===A.length-1)T[F]={value:X,type:"literal"};else if(M<A.lastIndexOf("@")){let S=A.substring(A.lastIndexOf("@")+1);T[F]={value:X,type:"literal","xml:lang":S}}else if(M<A.lastIndexOf("^^")){let S=A.substring(A.lastIndexOf("^^")+2);T[F]={value:X,type:"typed-literal",datatype:S}}}}return T});return{head:{vars:c},results:{bindings:p}}}function to(r){return r==null?"":`${r}`}function Ns(r={}){let{separator:n,decimals:a}=r;return n?a?l=>l.toFixed(a).replace(".",n):l=>`${l}`.replace(".",n):a?l=>l.toFixed(a):l=>`${l}`}function mn(r={}){let n=typeof r.quote=="string"?r.quote:'"',a=typeof r.escapedQuote=="string"?r.escapedQuote:`${n}${n}`;if(!n||n===a)return c=>c;let l=new RegExp(n,"g");return c=>(c.includes(n)&&(c=c.replace(l,a)),`${n}${c}${n}`)}var pR='"';var Kk=new RegExp(pR,"g");function Ss(r={stringFormatter:mn()}){return n=>r.stringFormatter(n.toString().slice(7,-1))}function ws(r={stringFormatter:mn()}){return n=>{if(n===null)return"";let a=JSON.stringify(n);return a===void 0?"":(a[0]==='"'&&(a=a.replace(/^"(.+)"$/,"$1")),r.stringFormatter(a))}}var gR=RegExp(`[^.[\\]]+|\\[(?:([^"'][^[]*)|(["'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))`,"g");function mR(r){var n,a,l;let c=[],p;for(;p=gR.exec(r);)c.push((l=(n=p[3])!==null&&n!==void 0?n:(a=p[1])===null||a===void 0?void 0:a.trim())!==null&&l!==void 0?l:p[0]);return c}function Ru(r,n,a){if(n in r){let p=r[n];return p===void 0?a:p}let l=Array.isArray(n)?n:mR(n,r),c=r;for(let p of l)if(c=c?.[p],c===void 0)return a;return c}function Ls(r,n){try{return Array.isArray(n)?r.push(...n):r.push(n),r}catch{return r.concat(n)}}function ta(r,n){let a=!0;return r.reduce((l,c)=>(c==null&&(c=""),a?(a=!1,`${c}`):`${l}${n}${c}`),"")}var _u;(function(r){r.header="header",r.undefined="undefined",r.boolean="boolean",r.number="number",r.bigint="bigint",r.string="string",r.symbol="symbol",r.function="function",r.object="object"})(_u||(_u={}));var ai=class{constructor(n){this.opts=this.preprocessOpts(n)}preprocessOpts(n){let a=Object.assign({},n);a.fields&&(a.fields=this.preprocessFieldsInfo(a.fields,a.defaultValue)),a.transforms=a.transforms||[];let l=a.formatters&&a.formatters.string||mn(),c=ws({stringFormatter:l}),p={header:l,undefined:to,boolean:to,number:Ns(),bigint:to,string:l,symbol:Ss({stringFormatter:l}),function:c,object:c};return a.formatters=Object.assign(Object.assign({},p),a.formatters),a.delimiter=a.delimiter||",",a.eol=a.eol||`
43
+ `,a.header=a.header!==!1,a.includeEmptyRows=a.includeEmptyRows||!1,a.withBOM=a.withBOM||!1,a}preprocessFieldsInfo(n,a){return n.map(l=>{if(typeof l=="string")return{label:l,value:c=>Ru(c,l,a)};if(typeof l=="object"){let c="default"in l?l.default:a;if(typeof l.value=="string"){let p=l.value;return{label:l.label||l.value,value:g=>Ru(g,p,c)}}if(typeof l.value=="function"){let p=l.label||l.value.name||"",g={label:p,default:c},y=l.value;return{label:p,value(T){let U=y(T,g);return U===void 0?c:U}}}}throw new Error("Invalid field info option. "+JSON.stringify(l))})}getHeader(){return ta(this.opts.fields.map(n=>this.opts.formatters.header(n.label)),this.opts.delimiter)}preprocessRow(n){return this.opts.transforms.reduce((a,l)=>a.map(c=>l(c)).reduce(Ls,[]),[n])}processRow(n){if(!n)return;let a=this.opts.fields.map(l=>this.processCell(n,l));if(!(!this.opts.includeEmptyRows&&a.every(l=>l==="")))return ta(a,this.opts.delimiter)}processCell(n,a){return this.processValue(a.value(n))}processValue(n){let a=this.opts.formatters[typeof n];return a(n)}};var ro=class extends ai{constructor(n){super(n)}parse(n){let a=this.preprocessData(n);this.opts.fields=this.opts.fields||this.preprocessFieldsInfo(a.reduce((g,y)=>(Object.keys(y).forEach(T=>{g.includes(T)||g.push(T)}),g),[]),this.opts.defaultValue);let l=this.opts.header?this.getHeader():"",c=this.processData(a);return(this.opts.withBOM?"\uFEFF":"")+l+(l&&c?this.opts.eol:"")+c}preprocessData(n){let a=Array.isArray(n)?n:[n];if(!this.opts.fields){if(n==null||a.length===0)throw new Error('Data should not be empty or the "fields" option should be included');if(typeof a[0]!="object")throw new Error('Data items should be objects or the "fields" option should be included')}return this.opts.transforms.length===0?a:a.map(l=>this.preprocessRow(l)).reduce(Ls,[])}processData(n){return ta(n.map(a=>this.processRow(a)).filter(a=>a),this.opts.eol)}};var Ut;(function(r){r[r.BACKSPACE=8]="BACKSPACE",r[r.FORM_FEED=12]="FORM_FEED",r[r.NEWLINE=10]="NEWLINE",r[r.CARRIAGE_RETURN=13]="CARRIAGE_RETURN",r[r.TAB=9]="TAB",r[r.SPACE=32]="SPACE",r[r.EXCLAMATION_MARK=33]="EXCLAMATION_MARK",r[r.QUOTATION_MARK=34]="QUOTATION_MARK",r[r.NUMBER_SIGN=35]="NUMBER_SIGN",r[r.DOLLAR_SIGN=36]="DOLLAR_SIGN",r[r.PERCENT_SIGN=37]="PERCENT_SIGN",r[r.AMPERSAND=38]="AMPERSAND",r[r.APOSTROPHE=39]="APOSTROPHE",r[r.LEFT_PARENTHESIS=40]="LEFT_PARENTHESIS",r[r.RIGHT_PARENTHESIS=41]="RIGHT_PARENTHESIS",r[r.ASTERISK=42]="ASTERISK",r[r.PLUS_SIGN=43]="PLUS_SIGN",r[r.COMMA=44]="COMMA",r[r.HYPHEN_MINUS=45]="HYPHEN_MINUS",r[r.FULL_STOP=46]="FULL_STOP",r[r.SOLIDUS=47]="SOLIDUS",r[r.DIGIT_ZERO=48]="DIGIT_ZERO",r[r.DIGIT_ONE=49]="DIGIT_ONE",r[r.DIGIT_TWO=50]="DIGIT_TWO",r[r.DIGIT_THREE=51]="DIGIT_THREE",r[r.DIGIT_FOUR=52]="DIGIT_FOUR",r[r.DIGIT_FIVE=53]="DIGIT_FIVE",r[r.DIGIT_SIX=54]="DIGIT_SIX",r[r.DIGIT_SEVEN=55]="DIGIT_SEVEN",r[r.DIGIT_EIGHT=56]="DIGIT_EIGHT",r[r.DIGIT_NINE=57]="DIGIT_NINE",r[r.COLON=58]="COLON",r[r.SEMICOLON=59]="SEMICOLON",r[r.LESS_THAN_SIGN=60]="LESS_THAN_SIGN",r[r.EQUALS_SIGN=61]="EQUALS_SIGN",r[r.GREATER_THAN_SIGN=62]="GREATER_THAN_SIGN",r[r.QUESTION_MARK=63]="QUESTION_MARK",r[r.COMMERCIAL_AT=64]="COMMERCIAL_AT",r[r.LATIN_CAPITAL_LETTER_A=65]="LATIN_CAPITAL_LETTER_A",r[r.LATIN_CAPITAL_LETTER_B=66]="LATIN_CAPITAL_LETTER_B",r[r.LATIN_CAPITAL_LETTER_C=67]="LATIN_CAPITAL_LETTER_C",r[r.LATIN_CAPITAL_LETTER_D=68]="LATIN_CAPITAL_LETTER_D",r[r.LATIN_CAPITAL_LETTER_E=69]="LATIN_CAPITAL_LETTER_E",r[r.LATIN_CAPITAL_LETTER_F=70]="LATIN_CAPITAL_LETTER_F",r[r.LATIN_CAPITAL_LETTER_G=71]="LATIN_CAPITAL_LETTER_G",r[r.LATIN_CAPITAL_LETTER_H=72]="LATIN_CAPITAL_LETTER_H",r[r.LATIN_CAPITAL_LETTER_I=73]="LATIN_CAPITAL_LETTER_I",r[r.LATIN_CAPITAL_LETTER_J=74]="LATIN_CAPITAL_LETTER_J",r[r.LATIN_CAPITAL_LETTER_K=75]="LATIN_CAPITAL_LETTER_K",r[r.LATIN_CAPITAL_LETTER_L=76]="LATIN_CAPITAL_LETTER_L",r[r.LATIN_CAPITAL_LETTER_M=77]="LATIN_CAPITAL_LETTER_M",r[r.LATIN_CAPITAL_LETTER_N=78]="LATIN_CAPITAL_LETTER_N",r[r.LATIN_CAPITAL_LETTER_O=79]="LATIN_CAPITAL_LETTER_O",r[r.LATIN_CAPITAL_LETTER_P=80]="LATIN_CAPITAL_LETTER_P",r[r.LATIN_CAPITAL_LETTER_Q=81]="LATIN_CAPITAL_LETTER_Q",r[r.LATIN_CAPITAL_LETTER_R=82]="LATIN_CAPITAL_LETTER_R",r[r.LATIN_CAPITAL_LETTER_S=83]="LATIN_CAPITAL_LETTER_S",r[r.LATIN_CAPITAL_LETTER_T=84]="LATIN_CAPITAL_LETTER_T",r[r.LATIN_CAPITAL_LETTER_U=85]="LATIN_CAPITAL_LETTER_U",r[r.LATIN_CAPITAL_LETTER_V=86]="LATIN_CAPITAL_LETTER_V",r[r.LATIN_CAPITAL_LETTER_W=87]="LATIN_CAPITAL_LETTER_W",r[r.LATIN_CAPITAL_LETTER_X=88]="LATIN_CAPITAL_LETTER_X",r[r.LATIN_CAPITAL_LETTER_Y=89]="LATIN_CAPITAL_LETTER_Y",r[r.LATIN_CAPITAL_LETTER_Z=90]="LATIN_CAPITAL_LETTER_Z",r[r.LEFT_SQUARE_BRACKET=91]="LEFT_SQUARE_BRACKET",r[r.REVERSE_SOLIDUS=92]="REVERSE_SOLIDUS",r[r.RIGHT_SQUARE_BRACKET=93]="RIGHT_SQUARE_BRACKET",r[r.CIRCUMFLEX_ACCENT=94]="CIRCUMFLEX_ACCENT",r[r.LOW_LINE=95]="LOW_LINE",r[r.GRAVE_ACCENT=96]="GRAVE_ACCENT",r[r.LATIN_SMALL_LETTER_A=97]="LATIN_SMALL_LETTER_A",r[r.LATIN_SMALL_LETTER_B=98]="LATIN_SMALL_LETTER_B",r[r.LATIN_SMALL_LETTER_C=99]="LATIN_SMALL_LETTER_C",r[r.LATIN_SMALL_LETTER_D=100]="LATIN_SMALL_LETTER_D",r[r.LATIN_SMALL_LETTER_E=101]="LATIN_SMALL_LETTER_E",r[r.LATIN_SMALL_LETTER_F=102]="LATIN_SMALL_LETTER_F",r[r.LATIN_SMALL_LETTER_G=103]="LATIN_SMALL_LETTER_G",r[r.LATIN_SMALL_LETTER_H=104]="LATIN_SMALL_LETTER_H",r[r.LATIN_SMALL_LETTER_I=105]="LATIN_SMALL_LETTER_I",r[r.LATIN_SMALL_LETTER_J=106]="LATIN_SMALL_LETTER_J",r[r.LATIN_SMALL_LETTER_K=107]="LATIN_SMALL_LETTER_K",r[r.LATIN_SMALL_LETTER_L=108]="LATIN_SMALL_LETTER_L",r[r.LATIN_SMALL_LETTER_M=109]="LATIN_SMALL_LETTER_M",r[r.LATIN_SMALL_LETTER_N=110]="LATIN_SMALL_LETTER_N",r[r.LATIN_SMALL_LETTER_O=111]="LATIN_SMALL_LETTER_O",r[r.LATIN_SMALL_LETTER_P=112]="LATIN_SMALL_LETTER_P",r[r.LATIN_SMALL_LETTER_Q=113]="LATIN_SMALL_LETTER_Q",r[r.LATIN_SMALL_LETTER_R=114]="LATIN_SMALL_LETTER_R",r[r.LATIN_SMALL_LETTER_S=115]="LATIN_SMALL_LETTER_S",r[r.LATIN_SMALL_LETTER_T=116]="LATIN_SMALL_LETTER_T",r[r.LATIN_SMALL_LETTER_U=117]="LATIN_SMALL_LETTER_U",r[r.LATIN_SMALL_LETTER_V=118]="LATIN_SMALL_LETTER_V",r[r.LATIN_SMALL_LETTER_W=119]="LATIN_SMALL_LETTER_W",r[r.LATIN_SMALL_LETTER_X=120]="LATIN_SMALL_LETTER_X",r[r.LATIN_SMALL_LETTER_Y=121]="LATIN_SMALL_LETTER_Y",r[r.LATIN_SMALL_LETTER_Z=122]="LATIN_SMALL_LETTER_Z",r[r.LEFT_CURLY_BRACKET=123]="LEFT_CURLY_BRACKET",r[r.VERTICAL_LINE=124]="VERTICAL_LINE",r[r.RIGHT_CURLY_BRACKET=125]="RIGHT_CURLY_BRACKET",r[r.TILDE=126]="TILDE"})(Ut||(Ut={}));var bR={[Ut.QUOTATION_MARK]:Ut.QUOTATION_MARK,[Ut.REVERSE_SOLIDUS]:Ut.REVERSE_SOLIDUS,[Ut.SOLIDUS]:Ut.SOLIDUS,[Ut.LATIN_SMALL_LETTER_B]:Ut.BACKSPACE,[Ut.LATIN_SMALL_LETTER_F]:Ut.FORM_FEED,[Ut.LATIN_SMALL_LETTER_N]:Ut.NEWLINE,[Ut.LATIN_SMALL_LETTER_R]:Ut.CARRIAGE_RETURN,[Ut.LATIN_SMALL_LETTER_T]:Ut.TAB};var Qg;(function(r){r[r.LEFT_BRACE=0]="LEFT_BRACE",r[r.RIGHT_BRACE=1]="RIGHT_BRACE",r[r.LEFT_BRACKET=2]="LEFT_BRACKET",r[r.RIGHT_BRACKET=3]="RIGHT_BRACKET",r[r.COLON=4]="COLON",r[r.COMMA=5]="COMMA",r[r.TRUE=6]="TRUE",r[r.FALSE=7]="FALSE",r[r.NULL=8]="NULL",r[r.STRING=9]="STRING",r[r.NUMBER=10]="NUMBER",r[r.SEPARATOR=11]="SEPARATOR"})(Qg||(Qg={}));var Pg;(function(r){r[r.START=0]="START",r[r.ENDED=1]="ENDED",r[r.ERROR=2]="ERROR",r[r.TRUE1=3]="TRUE1",r[r.TRUE2=4]="TRUE2",r[r.TRUE3=5]="TRUE3",r[r.FALSE1=6]="FALSE1",r[r.FALSE2=7]="FALSE2",r[r.FALSE3=8]="FALSE3",r[r.FALSE4=9]="FALSE4",r[r.NULL1=10]="NULL1",r[r.NULL2=11]="NULL2",r[r.NULL3=12]="NULL3",r[r.STRING_DEFAULT=13]="STRING_DEFAULT",r[r.STRING_AFTER_BACKSLASH=14]="STRING_AFTER_BACKSLASH",r[r.STRING_UNICODE_DIGIT_1=15]="STRING_UNICODE_DIGIT_1",r[r.STRING_UNICODE_DIGIT_2=16]="STRING_UNICODE_DIGIT_2",r[r.STRING_UNICODE_DIGIT_3=17]="STRING_UNICODE_DIGIT_3",r[r.STRING_UNICODE_DIGIT_4=18]="STRING_UNICODE_DIGIT_4",r[r.STRING_INCOMPLETE_CHAR=19]="STRING_INCOMPLETE_CHAR",r[r.NUMBER_AFTER_INITIAL_MINUS=20]="NUMBER_AFTER_INITIAL_MINUS",r[r.NUMBER_AFTER_INITIAL_ZERO=21]="NUMBER_AFTER_INITIAL_ZERO",r[r.NUMBER_AFTER_INITIAL_NON_ZERO=22]="NUMBER_AFTER_INITIAL_NON_ZERO",r[r.NUMBER_AFTER_FULL_STOP=23]="NUMBER_AFTER_FULL_STOP",r[r.NUMBER_AFTER_DECIMAL=24]="NUMBER_AFTER_DECIMAL",r[r.NUMBER_AFTER_E=25]="NUMBER_AFTER_E",r[r.NUMBER_AFTER_E_AND_SIGN=26]="NUMBER_AFTER_E_AND_SIGN",r[r.NUMBER_AFTER_E_AND_DIGIT=27]="NUMBER_AFTER_E_AND_DIGIT",r[r.SEPARATOR=28]="SEPARATOR",r[r.BOM_OR_START=29]="BOM_OR_START",r[r.BOM=30]="BOM"})(Pg||(Pg={}));var Fs;(function(r){r[r.OBJECT=0]="OBJECT",r[r.ARRAY=1]="ARRAY"})(Fs||(Fs={}));var Hg;(function(r){r[r.VALUE=0]="VALUE",r[r.KEY=1]="KEY",r[r.COLON=2]="COLON",r[r.COMMA=3]="COMMA",r[r.ENDED=4]="ENDED",r[r.ERROR=5]="ERROR",r[r.SEPARATOR=6]="SEPARATOR"})(Hg||(Hg={}));function Yg(r){let n=r.head.vars,a=r.results?.bindings;return new ro({fields:n}).parse(a?a.map(c=>Mo(c,p=>p.value)):[])}var Bs=r=>{for(let n in r)r[n].type!=="uri"&&(r[n].value=r[n].value.replace(/{{(.*?)}}/g,a=>(a=a.substring(2,a.length-2).trim(),r[a]?r[a].value:a)));return r},Su=class{constructor(n,a){n.executionTime&&(this.executionTime=n.executionTime),a&&(this.executionTime=a),n instanceof Error?this.error=n:n.content?this.setResponse(n):this.setSummary(n)}setResponse(n){this.res=n}setSummary(n){!n.data&&!n.error?this.summary={data:n}:this.summary=n}hasError(){return!!(this.res&&this.res.status>=400||this.errorSummary||this.error||this.summary&&this.summary.error)}getError(){if(!this.errorSummary){if(this.res&&this.res.status>=400){let n=this.res.content||this.res.statusText;this.errorSummary={text:n,status:this.res.status,statusText:this.res.ok?void 0:this.res.statusText}}if(this.summary&&this.summary.error&&(this.errorSummary=this.summary.error),this.error){let n=this.error;this.errorSummary={text:this.error.message,status:n.status,statusText:n.statusText}}}return this.errorSummary}getContentType(){if(this.res)return this.res.headers.get("content-type")||void 0;if(this.summary)return this.summary.contentType}getAsJson(){if(this.json)return this.json;if(!(this.json===!1||this.hasError()))return this.getParserFromContentType()?this.json:this.doLuckyGuess()?this.json:(this.json||(this.json=!1),this.json)}getData(){if(this.res){if(this.res.content)return this.res.content;if(this.res.body)return this.res.body;if(this.res.text)return this.res.text}if(this.summary)return this.summary.data}getResponseTime(){return this.executionTime}getParserFromContentType(){let n=this.getContentType();if(n){let a=as(this.getData());try{if(n.indexOf("json")>-1){if(n.indexOf("sparql-results+json")>=0)return this.json=au(a,Bs),this.type="json",!0;if(n.indexOf("application/rdf+json")>-1)return this.type="json",!0;this.type="json"}else{if(n.indexOf("xml")>-1)return this.json=Eu(a,Bs),this.type="xml",!0;if(n.indexOf("csv")>-1)return this.json=Zg(a),this.type="csv",!0;if(n.indexOf("tab-separated")>-1)return this.json=Vg(a),this.type="tsv",!0;if(n.indexOf("turtle")>0||n.indexOf("trig")>0||n.indexOf("triple")>0||n.indexOf("quad")>0)return this.json=Og(a),this.type="ttl",!0}}catch(l){l instanceof Error?this.errorSummary={text:l.message}:this.errorSummary={text:l}}}return!1}doLuckyGuess(){let n=as(this.getData());try{return this.json=au(n,Bs),this.type="json",!0}catch{}try{return this.json=Eu(n,Bs),this.type="xml",!0}catch{}return!1}getVariables(){let n=this.getAsJson();return n&&n.head?n.head.vars:[]}getBoolean(){let n=this.getAsJson();if(n&&"boolean"in n)return n.boolean}getBindings(){let n=this.getAsJson();return n&&n.results?n.results.bindings:null}getStatements(){return!this.statements&&this.type==="ttl"&&(this.statements=Iu(this.getData())),this.statements?this.statements:null}getOriginalResponseAsString(){let n=this.getData();return typeof n=="string"?n:this.type==="json"?JSON.stringify(n,void 0,2):n}getType(){return this.type||this.getAsJson(),this.type}getStatus(){if(this.res)return this.res.status;if(this.summary)return this.summary.status}getAsStoreObject(n){let a=this.summary;if(!a&&this.res&&(a={contentType:this.getContentType(),data:this.getOriginalResponseAsString(),error:this.getError(),status:this.getStatus(),executionTime:this.getResponseTime()}),a)return a.data&&a.data.length>n?void 0:a;if(this.error)return{error:this.getError(),executionTime:this.getResponseTime()}}asCsv(){let n=this.getAsJson();if(this.type==="csv")return this.getOriginalResponseAsString();if(n&&n.results)return Yg(n)}},Us=Su;function ks(r){var n=document.createElement("link");n.setAttribute("rel","stylesheet"),n.setAttribute("type","text/css"),n.setAttribute("href",r),document.getElementsByTagName("head")[0].appendChild(n)}function Ms(r,n){return new Promise((a,l)=>{var c=document.createElement("script");c.setAttribute("type","text/javascript"),c.setAttribute("async",""),c.setAttribute("src",r),n&&(c.innerHTML=n),c.onload=()=>a(),document.getElementsByTagName("head")[0].appendChild(c)})}Vo.addHook("afterSanitizeAttributes",r=>{r instanceof HTMLAnchorElement&&(r.target="_blank",r.rel="noopener noreferrer")});var wu=Vo.sanitize;var ra=class{constructor(n){this.priority=10;this.hideFromSelection=!0;this.yasr=n}draw(){let n=document.createElement("div");n.className="booleanResult";let a=this.yasr.results?.getBoolean(),l=document.createElement("i");l.className=a?"fas fa-check":"fas fa-xmark",n.appendChild(l);let c=document.createElement("span");c.textContent=a?"True":"False",n.appendChild(c),this.yasr.resultsEl.appendChild(n)}canHandleResults(){return!!this.yasr.results?.getBoolean&&(this.yasr.results.getBoolean()===!0||this.yasr.results.getBoolean()==!1)}getIcon(){return document.createElement("")}};var gm=Ar(bn()),FG=Ar(Bu()),BG=Ar($g()),UG=Ar(rm()),kG=Ar(om()),MG=Ar(lm()),GG=Ar(cm()),OG=Ar(pm());var Gs=class Gs{constructor(n){this.label="Response";this.priority=2;this.helpReference="https://docs.triply.cc/yasgui/#response";this.yasr=n,this.config=Gs.defaults,n.config.plugins.response&&n.config.plugins.response.dynamicConfig&&(this.config={...this.config,...n.config.plugins.response.dynamicConfig})}canHandleResults(){if(!this.yasr.results||!this.yasr.results.getOriginalResponseAsString)return!1;var n=this.yasr.results.getOriginalResponseAsString();return!((!n||n.length==0)&&this.yasr.results.getError())}getIcon(){let n=document.createElement("i");return n.className="fas fa-align-left",n}download(n){if(!this.yasr.results)return;let a=this.yasr.results.getContentType(),l=this.yasr.results.getType(),c=l==="xml"?"rdf":l;return{getData:()=>this.yasr.results?.getOriginalResponseAsString()||"",filename:`${n||"queryResults"}${c?"."+c:""}`,contentType:a||"text/plain",title:"Download result"}}draw(n){let a={...this.config,...n},l=this.yasr.results?.getOriginalResponseAsString()||"",c=l.split(`
44
44
  `);c.length>a.maxLines&&(l=c.slice(0,a.maxLines).join(`
45
45
  `));let g=document.documentElement.getAttribute("data-theme")==="dark"?"material-palenight":"default",y={readOnly:!0,lineNumbers:!0,lineWrapping:!0,foldGutter:!0,gutters:["CodeMirror-linenumbers","CodeMirror-foldgutter"],value:l,extraKeys:{Tab:!1},theme:g};this.yasr.results?.getType()==="json"&&(y.mode={name:"javascript",json:!0}),this.cm=(0,gm.default)(this.yasr.resultsEl,y),c.length>a.maxLines&&this.showLess(!1)}limitData(n){let a=n.split(`
46
46
  `);return a.length>this.config.maxLines&&(n=a.slice(0,this.config.maxLines).join(`
47
- `)),n}showLess(n=!0){if(!this.cm)return;Qe(this.cm.getWrapperElement(),"overflow"),this.overLay&&(this.overLay.remove(),this.overLay=void 0),this.overLay=document.createElement("div"),Qe(this.overLay,"overlay");let a=document.createElement("div");Qe(a,"overlay_content");let l=document.createElement("button");l.title="Show all",Qe(l,"yasr_btn","overlay_btn"),l.textContent="Show all",l.addEventListener("click",()=>this.showMore()),a.append(l);let c=document.createElement("button");c.title="Download result",Qe(c,"yasr_btn","overlay_btn");let p=document.createElement("span");p.innerText="Download result",c.appendChild(p);let g=document.createElement("i");Qe(g,"fas"),Qe(g,"fa-download"),c.appendChild(g),c.addEventListener("click",()=>this.yasr.download()),c.addEventListener("keydown",y=>{(y.code==="Space"||y.code==="Enter")&&this.yasr.download()}),a.appendChild(c),this.overLay.appendChild(a),this.cm.getWrapperElement().appendChild(this.overLay),n&&this.cm.setValue(this.limitData(this.yasr.results?.getOriginalResponseAsString()||""))}showMore(){this.cm&&(hn(this.cm.getWrapperElement(),"overflow"),this.overLay?.remove(),this.overLay=void 0,this.cm.setValue(this.yasr.results?.getOriginalResponseAsString()||""),this.cm.refresh())}};Gs.defaults={maxLines:30};var na=Gs;var ia=class{constructor(n){this.priority=20;this.hideFromSelection=!0;this.yasr=n}canHandleResults(){return!!this.yasr.results&&!!this.yasr.results.getError()}getTryBtn(n){let a=document.createElement("a");return a.href=n,a.rel="noopener noreferrer",a.target="_blank",a.className="yasr_tryQuery",a.textContent="Try query in a new browser window",a}getCorsMessage(){let n=document.createElement("div");n.className="redOutline";let a=document.createElement("p");a.textContent="Unable to get response from endpoint. Possible reasons:",n.appendChild(a);let l=document.createElement("ul"),c=document.createElement("li");c.textContent="Incorrect endpoint URL",l.appendChild(c);let p=document.createElement("li");p.textContent="Endpoint is down",l.appendChild(p);let g=document.createElement("li");g.textContent="Credentials have expired",l.appendChild(g);let y=document.createElement("li"),T=document.createElement("span");T.textContent="Endpoint is not accessible from the YASGUI server and website, and the endpoint is not ",y.appendChild(T);let U=document.createElement("a");return U.textContent="CORS-enabled",U.href="http://enable-cors.org/",U.target="_blank",U.rel="noopener noreferrer",y.appendChild(U),l.appendChild(y),n.appendChild(l),n}getStatusSpecificGuidance(n){let a=document.createElement("div");a.className="statusGuidance";let l=document.createElement("h4"),c=document.createElement("ul");switch(n){case 401:l.textContent="Authentication Required",a.appendChild(l);let p=document.createElement("li");p.textContent="The endpoint requires authentication credentials",c.appendChild(p);let g=document.createElement("li");g.textContent="Check if you need to provide an API key, username/password, or bearer token",c.appendChild(g);let y=document.createElement("li");return y.textContent="Verify your credentials are correct and not expired",c.appendChild(y),a.appendChild(c),a;case 403:l.textContent="Access Forbidden",a.appendChild(l);let T=document.createElement("li");T.textContent="You don't have permission to access this endpoint",c.appendChild(T);let U=document.createElement("li");U.textContent="Your credentials may be valid but lack sufficient privileges",c.appendChild(U);let A=document.createElement("li");return A.textContent="Contact the endpoint administrator to request access",c.appendChild(A),a.appendChild(c),a;case 404:l.textContent="Endpoint Not Found",a.appendChild(l);let F=document.createElement("li");F.textContent="The endpoint URL may be incorrect or has changed",c.appendChild(F);let M=document.createElement("li");M.textContent="Check for typos in the endpoint address",c.appendChild(M);let X=document.createElement("li");return X.textContent="Verify the endpoint is still active and hasn't been moved",c.appendChild(X),a.appendChild(c),a;case 429:l.textContent="Too Many Requests",a.appendChild(l);let S=document.createElement("li");S.textContent="You've exceeded the rate limit for this endpoint",c.appendChild(S);let Z=document.createElement("li");Z.textContent="Wait a few moments before trying again",c.appendChild(Z);let R=document.createElement("li");return R.textContent="Consider reducing query frequency or contacting the endpoint provider for higher limits",c.appendChild(R),a.appendChild(c),a;case 500:l.textContent="Internal Server Error",a.appendChild(l);let G=document.createElement("li");G.textContent="The SPARQL endpoint encountered an error while processing your query",c.appendChild(G);let J=document.createElement("li");J.textContent="Try simplifying your query or reducing the result limit",c.appendChild(J);let q=document.createElement("li");q.textContent="Check the error message below for specific details",c.appendChild(q);let te=document.createElement("li");return te.textContent="If the problem persists, contact the endpoint administrator",c.appendChild(te),a.appendChild(c),a;case 502:case 503:case 504:l.textContent=n===502?"Bad Gateway":n===503?"Service Unavailable":"Gateway Timeout",a.appendChild(l);let ae=document.createElement("li");ae.textContent="The endpoint is temporarily unavailable or overloaded",c.appendChild(ae);let _=document.createElement("li");_.textContent="Try again in a few moments",c.appendChild(_);let w=document.createElement("li");return w.textContent="The service may be undergoing maintenance",c.appendChild(w),a.appendChild(c),a;default:if(n>=400&&n<500){l.textContent="Client Error",a.appendChild(l);let P=document.createElement("li");P.textContent="There's an issue with the request",c.appendChild(P);let $=document.createElement("li");return $.textContent="Check the error message below for details",c.appendChild($),a.appendChild(c),a}return null}}async draw(){let n=document.createElement("div");n.className="errorResult",this.yasr.resultsEl.appendChild(n);let a=this.yasr.results?.getError();if(!a)return;let l=document.createElement("div");l.className="errorHeader",n.appendChild(l);let c=await this.yasr.renderError(a);if(c){let g=document.createElement("div");g.className="redOutline",g.appendChild(c),n.appendChild(g);return}if(a.status){var p="Error";a.statusText&&a.statusText.length<100&&(p=a.statusText),p+=` (#${a.status})`;let g=document.createElement("span");if(g.className="status",g.textContent=p,l.appendChild(g),this.yasr.config.getPlainQueryLinkToEndpoint){let T=this.yasr.config.getPlainQueryLinkToEndpoint();T&&l.appendChild(this.getTryBtn(T))}let y=this.getStatusSpecificGuidance(a.status);if(y&&n.appendChild(y),a.text){let T=document.createElement("div");Qe(T,"errorMessageContainer"),n.appendChild(T);let U=document.createElement("pre");Qe(U,"errorMessage"),U.textContent=a.text,T.appendChild(U)}}else{if(this.yasr.config.getPlainQueryLinkToEndpoint){let y=this.yasr.config.getPlainQueryLinkToEndpoint();y&&l.appendChild(this.getTryBtn(y))}if(!a.text||a.text.indexOf("Request has been terminated")>=0||a.text.indexOf("Failed to fetch")>=0||a.text.indexOf("NetworkError")>=0||a.text.indexOf("Network request failed")>=0)n.appendChild(this.getCorsMessage());else{let y=document.createElement("pre");y.textContent=a.text,n.appendChild(y)}}}getIcon(){return document.createElement("")}};var ar=class ar extends mm.EventEmitter{constructor(a,l={},c){super();this.plugins={};this.helpDrawn=!1;this.isFullscreen=!1;this.isLoading=!1;this.utils={addScript:Ms,addCSS:ks,sanitize:wu};if(!a)throw new Error("No parent passed as argument. Dont know where to draw YASR");this.rootEl=document.createElement("div"),this.rootEl.className="yasr",a.appendChild(this.rootEl),this.config=Ol({},ar.defaults,l),this.storage=new ri(ar.storageNamespace),this.getConfigFromStorage(),this.headerEl=document.createElement("div"),this.headerEl.className="yasr_header",this.rootEl.appendChild(this.headerEl),this.fallbackInfoEl=document.createElement("div"),this.fallbackInfoEl.className="yasr_fallback_info",this.rootEl.appendChild(this.fallbackInfoEl),this.resultsEl=document.createElement("div"),this.resultsEl.className="yasr_results",this.resultsEl.id=Dl("resultsId"),this.rootEl.appendChild(this.resultsEl),this.createLoadingElement(),this.initializePlugins(),this.drawHeader();let p=c||this.getResponseFromStorage();p&&this.setResponse(p)}getConfigFromStorage(){let a=this.getStorageId(this.config.persistenceLabelConfig);if(a){let l=this.storage.get(a);if(l){this.selectedPlugin=l.selectedPlugin;for(let c in l.pluginsConfig){let p=l.pluginsConfig[c];p&&this.config.plugins[c]&&(this.config.plugins[c].dynamicConfig=p)}}}}async renderError(a){let l;if(this.config.errorRenderers!==void 0){for(let c of this.config.errorRenderers)if(l=await c(a),l!==void 0)break}return l}getStorageId(a,l){let c=l||this.config.persistenceId;if(c)return typeof c=="string"?c+"_"+a:c(this)+"_"+a}somethingDrawn(){return!!this.resultsEl.children.length}emptyFallbackElement(){for(;this.fallbackInfoEl.firstChild;)this.fallbackInfoEl.removeChild(this.fallbackInfoEl.firstChild)}getSelectedPluginName(){return this.selectedPlugin||this.config.defaultPlugin}getSelectedPlugin(){if(this.plugins[this.getSelectedPluginName()])return this.plugins[this.getSelectedPluginName()];console.warn(`Tried using plugin ${this.getSelectedPluginName()}, but seems this plugin isnt registered in yasr.`)}updatePluginSelectors(a){if(this.pluginSelectorsEl)for(let l in this.config.plugins){let c=this.plugins[l];c&&!c.hideFromSelection&&(a&&(a.indexOf(l)>=0?hn(this.pluginSelectorsEl.querySelector(".select_"+l),"disabled"):Qe(this.pluginSelectorsEl.querySelector(".select_"+l),"disabled")),l===this.getSelectedPluginName()?Qe(this.pluginSelectorsEl.querySelector(".select_"+l),"selected"):hn(this.pluginSelectorsEl.querySelector(".select_"+l),"selected"))}}getCompatiblePlugins(){if(!this.results)return Object.keys(Gl(this.config.plugins,l=>typeof l=="object"&&l.enabled||l===!0));let a=[];for(let l in this.plugins)this.plugins[l].canHandleResults()&&a.push({name:l,priority:this.plugins[l].priority});return a.sort((l,c)=>c.priority-l.priority).map(l=>l.name)}draw(){if(this.updateHelpButton(),this.updateResponseInfo(),!this.results)return;let a=this.getCompatiblePlugins();if(this.drawnPlugin&&this.getSelectedPluginName()!==this.drawnPlugin){for(;this.pluginControls.firstChild;)this.pluginControls.firstChild.remove();this.plugins[this.drawnPlugin].destroy?.()}let l;if(this.getSelectedPlugin()&&this.getSelectedPlugin()?.canHandleResults()?(l=this.getSelectedPluginName(),this.emptyFallbackElement()):a[0]&&(this.drawnPlugin&&this.plugins[this.drawnPlugin].destroy?.(),l=a[0],this.fillFallbackBox(l)),l){this.drawnPlugin=l,this.emit("draw",this,this.plugins[l]);let c=this.plugins[l];(c.initialize?c.initialize():Promise.resolve()).then(async()=>{if(l){for(;this.resultsEl.firstChild;)this.resultsEl.firstChild.remove();await this.plugins[l].draw(this.config.plugins[l].dynamicConfig),this.emit("drawn",this,this.plugins[l]),this.updateExportHeaders(),this.updatePluginSelectors(a)}},g=>console.error)}else this.resultsEl.textContent="cannot render result",this.updateExportHeaders(),this.updatePluginSelectors(a)}refresh(){this.draw()}destroy(){this.drawnPlugin&&this.plugins[this.drawnPlugin]?.destroy?.(),this.removeAllListeners(),this.rootEl.remove()}getPrefixes(){return this.config.prefixes?typeof this.config.prefixes=="function"?this.config.prefixes(this):this.config.prefixes:{}}selectPlugin(a){this.selectedPlugin!==a&&(this.config.plugins[a]?this.selectedPlugin=a:(console.warn(`Plugin ${a} does not exist.`),this.selectedPlugin=this.config.defaultPlugin),this.storeConfig(),this.emit("change",this),this.updatePluginSelectors(),this.draw())}drawPluginSelectors(){this.pluginSelectorsEl=document.createElement("ul"),this.pluginSelectorsEl.className="yasr_btnGroup";let a=this.config.pluginOrder;Object.keys(this.config.plugins).sort().forEach(l=>{a.indexOf(l)===-1&&a.push(l)});for(let l of a){if(!this.config.plugins[l]||!this.config.plugins[l].enabled)continue;let c=this.plugins[l];if(!c||c.hideFromSelection)continue;let p=c.label||l,g=document.createElement("button");if(Qe(g,"yasr_btn","select_"+l),g.title=p,g.type="button",g.setAttribute("aria-label",`Shows ${p} view`),c.getIcon){let U=c.getIcon();U&&(Qe(U,"plugin_icon"),g.appendChild(U))}let y=document.createElement("span");y.textContent=p,g.appendChild(y),g.addEventListener("click",()=>this.selectPlugin(l));let T=document.createElement("li");T.appendChild(g),this.pluginSelectorsEl.appendChild(T)}this.pluginSelectorsEl.children.length>=1&&this.headerEl.appendChild(this.pluginSelectorsEl),this.updatePluginSelectors()}fillFallbackBox(a){if(this.emptyFallbackElement(),this.plugins[a||this.drawnPlugin||""]?.hideFromSelection)return;let l=this.getSelectedPlugin(),c=this.plugins[a||this.drawnPlugin||""]?.label||a||this.drawnPlugin,p=l?.label||this.getSelectedPluginName(),g=document.createElement("p");if(g.innerText=`Could not render results with the ${p} plugin, the results currently are rendered with the ${c} plugin. ${this.getSelectedPlugin()?.helpReference?"See ":""}`,l?.helpReference){let y=document.createElement("a");y.innerText=`${p} documentation`,y.href=l.helpReference,y.rel="noopener noreferrer",y.target="_blank",g.append(y),g.innerHTML+=" for more information."}this.fallbackInfoEl.appendChild(g)}drawPluginElement(){let a=document.createElement("div");Qe(a,"space_element"),this.headerEl.appendChild(a),this.pluginControls=document.createElement("div"),this.pluginControls.setAttribute("id","yasr_plugin_control"),Qe(this.pluginControls,"yasr_plugin_control"),this.pluginControls.setAttribute("aria-controls",this.resultsEl.id),this.headerEl.appendChild(this.pluginControls)}drawHeader(){this.drawPluginSelectors(),this.drawResponseInfo(),this.drawPluginElement(),this.drawDownloadIcon(),this.drawFullscreenButton(),this.loadingEl&&this.headerEl.appendChild(this.loadingEl),this.drawDocumentationButton()}drawDownloadIcon(){this.downloadBtn=document.createElement("a"),Qe(this.downloadBtn,"yasr_btn","yasr_downloadIcon","btn_icon"),this.downloadBtn.download="",this.downloadBtn.setAttribute("aria-label","Download Results"),this.downloadBtn.setAttribute("tabindex","0"),this.downloadBtn.setAttribute("role","button");let a=document.createElement("i");Qe(a,"fas","fa-download"),a.setAttribute("aria-hidden","true"),this.downloadBtn.appendChild(a),this.downloadBtn.addEventListener("click",()=>{Xo(this.downloadBtn,"disabled")||this.download()}),this.downloadBtn.addEventListener("keydown",l=>{if(l.code==="Space"||l.code==="Enter"){if(Xo(this.downloadBtn,"disabled"))return;this.download()}}),this.headerEl.appendChild(this.downloadBtn)}drawResponseInfo(){this.dataElement=document.createElement("div"),Qe(this.dataElement,"yasr_response_chip"),this.headerEl.appendChild(this.dataElement),this.updateResponseInfo()}updateResponseInfo(){let a="";if(this.results){hn(this.dataElement,"empty");let l=this.results.getBindings();l&&(a+=`${l.length} result${l.length===1?"":"s"}`);let c=this.results.getResponseTime();if(c){a||(a="Response");let p=c/1e3;a+=` in ${p} second${p===1?"":"s"}`}}else Qe(this.dataElement,"empty");this.dataElement.innerText=a}updateHelpButton(){let a=this.getSelectedPlugin();if(a?.helpReference){let l=`View documentation of ${a.label||this.getSelectedPluginName()}`;this.documentationLink.href=a.helpReference,this.documentationLink.title=l,this.documentationLink.setAttribute("aria-label",l),hn(this.documentationLink,"disabled")}else Qe(this.documentationLink,"disabled"),this.documentationLink.title="This plugin doesn't have a help reference yet. Please contact the maintainer to fix this"}updateExportHeaders(){if(this.downloadBtn&&this.drawnPlugin){this.downloadBtn.title="";let a=this.plugins[this.drawnPlugin];if(a&&a.download){let l=a.download(this.config.getDownloadFileName?.());if(hn(this.downloadBtn,"disabled"),l){l.title&&(this.downloadBtn.title=l.title);return}}this.downloadBtn.title="Download not supported",Qe(this.downloadBtn,"disabled")}}drawFullscreenButton(){this.fullscreenBtn=document.createElement("button"),Qe(this.fullscreenBtn,"yasr_btn","yasr_fullscreenButton","btn_icon"),this.fullscreenBtn.setAttribute("aria-label","Toggle fullscreen"),this.fullscreenBtn.setAttribute("tabindex","0"),this.fullscreenBtn.setAttribute("role","button");let a=document.createElement("i");Qe(a,"fas"),Qe(a,"fa-expand"),Qe(a,"fullscreenIcon"),a.setAttribute("aria-hidden","true"),this.fullscreenBtn.appendChild(a);let l=document.createElement("i");Qe(l,"fas"),Qe(l,"fa-compress"),Qe(l,"fullscreenExitIcon"),l.setAttribute("aria-hidden","true"),this.fullscreenBtn.appendChild(l),this.fullscreenBtn.title="Toggle fullscreen (F10)",this.fullscreenBtn.addEventListener("click",()=>{this.toggleFullscreen()}),this.fullscreenBtn.addEventListener("keydown",c=>{(c.code==="Space"||c.code==="Enter")&&this.toggleFullscreen()}),this.headerEl.appendChild(this.fullscreenBtn)}toggleFullscreen(){this.isFullscreen=!this.isFullscreen,this.isFullscreen?(Qe(this.rootEl,"fullscreen"),this.fullscreenBtn&&(this.fullscreenBtn.title="Exit fullscreen (F10)")):(hn(this.rootEl,"fullscreen"),this.fullscreenBtn&&(this.fullscreenBtn.title="Toggle fullscreen (F10)"))}getIsFullscreen(){return this.isFullscreen}createLoadingElement(){this.loadingEl=document.createElement("div"),this.loadingEl.className="yasr_loading_indicator",this.loadingEl.title="Executing query...",this.loadingEl.innerHTML='<div class="yasr_loading_spinner"></div>',this.loadingEl.style.display="none"}showLoading(){this.isLoading=!0,this.loadingEl&&(this.loadingEl.style.display="flex")}hideLoading(){this.isLoading=!1,this.loadingEl&&(this.loadingEl.style.display="none")}drawDocumentationButton(){this.documentationLink=document.createElement("a"),Qe(this.documentationLink,"yasr_btn","yasr_external_ref_btn");let a=document.createElement("i");Qe(a,"fas","fa-circle-question"),this.documentationLink.appendChild(a),this.documentationLink.href="https://docs.triply.cc/yasgui/",this.documentationLink.target="_blank",this.documentationLink.rel="noopener noreferrer",this.headerEl.appendChild(this.documentationLink)}download(){if(!this.drawnPlugin)return;let a=this.plugins[this.drawnPlugin];if(a&&a.download){let l=a.download(this.config.getDownloadFileName?.());if(!l)return;let c=l.getData(),p;if(c.startsWith("data:"))p=c;else{let y=new Blob([c],{type:l.contentType??"text/plain"});p=window.URL.createObjectURL(y)}let g=document.createElement("a");g.href=p,g.download=l.filename,g.click()}}handleLocalStorageQuotaFull(a){console.warn("Localstorage quota exceeded. Clearing all queries"),ar.clearStorage()}getResponseFromStorage(){let a=this.getStorageId(this.config.persistenceLabelResponse);if(a)return this.storage.get(a)}getPersistentConfig(){return{selectedPlugin:this.getSelectedPluginName(),pluginsConfig:Mo(this.config.plugins,a=>a.dynamicConfig)}}storePluginConfig(a,l){this.config.plugins[a].dynamicConfig=l,this.storeConfig(),this.emit("change",this)}storeConfig(){let a=this.getStorageId(this.config.persistenceLabelConfig);a&&this.storage.set(a,this.getPersistentConfig(),this.config.persistencyExpire,this.handleLocalStorageQuotaFull)}storeResponse(){let a=this.getStorageId(this.config.persistenceLabelResponse);if(a&&this.results){let l=this.results.getAsStoreObject(this.config.maxPersistentResponseSize);l&&!l.error?this.storage.set(a,l,this.config.persistencyExpire,this.handleLocalStorageQuotaFull):this.storage.remove(a)}}setResponse(a,l){a&&(this.hideLoading(),this.results=new Us(a,l),this.draw(),this.storeResponse())}initializePlugins(){for(let a in this.config.plugins)this.config.plugins[a]&&(ar.plugins[a]?this.plugins[a]=new ar.plugins[a](this):console.warn("Wanted to initialize plugin "+a+" but could not find a matching registered plugin"))}static registerPlugin(a,l,c=!0){ar.plugins[a]=l,c?ar.defaults.plugins[a]={enabled:!0}:ar.defaults.plugins[a]={enabled:!1}}static clearStorage(){new ri(ar.storageNamespace).removeNamespace()}};ar.defaults=Zl(),ar.plugins={},ar.Dependencies={},ar.storageNamespace="triply";var $r=ar;function C_(r,n,a=!0){$r.plugins[r]=n,a?$r.defaults.plugins[r]={enabled:!0}:$r.defaults.plugins[r]={enabled:!1}}$r.registerPlugin("boolean",ra);$r.registerPlugin("response",na);$r.registerPlugin("error",ia);var A_=$r;return Ib(__);})();
47
+ `)),n}showLess(n=!0){if(!this.cm)return;Qe(this.cm.getWrapperElement(),"overflow"),this.overLay&&(this.overLay.remove(),this.overLay=void 0),this.overLay=document.createElement("div"),Qe(this.overLay,"overlay");let a=document.createElement("div");Qe(a,"overlay_content");let l=document.createElement("button");l.title="Show all",Qe(l,"yasr_btn","overlay_btn"),l.textContent="Show all",l.addEventListener("click",()=>this.showMore()),a.append(l);let c=document.createElement("button");c.title="Download result",Qe(c,"yasr_btn","overlay_btn");let p=document.createElement("span");p.innerText="Download result",c.appendChild(p);let g=document.createElement("i");Qe(g,"fas"),Qe(g,"fa-download"),c.appendChild(g),c.addEventListener("click",()=>this.yasr.download()),c.addEventListener("keydown",y=>{(y.code==="Space"||y.code==="Enter")&&this.yasr.download()}),a.appendChild(c),this.overLay.appendChild(a),this.cm.getWrapperElement().appendChild(this.overLay),n&&this.cm.setValue(this.limitData(this.yasr.results?.getOriginalResponseAsString()||""))}showMore(){this.cm&&(hn(this.cm.getWrapperElement(),"overflow"),this.overLay?.remove(),this.overLay=void 0,this.cm.setValue(this.yasr.results?.getOriginalResponseAsString()||""),this.cm.refresh())}};Gs.defaults={maxLines:30};var na=Gs;var ia=class{constructor(n){this.priority=20;this.hideFromSelection=!0;this.yasr=n}canHandleResults(){return!!this.yasr.results&&!!this.yasr.results.getError()}getTryBtn(n){let a=document.createElement("a");return a.href=n,a.rel="noopener noreferrer",a.target="_blank",a.className="yasr_tryQuery",a.textContent="Try query in a new browser window",a}getCorsMessage(){let n=document.createElement("div");n.className="redOutline";let a=document.createElement("p");a.textContent="Unable to get response from endpoint. Possible reasons:",n.appendChild(a);let l=document.createElement("ul"),c=document.createElement("li");c.textContent="Incorrect endpoint URL",l.appendChild(c);let p=document.createElement("li");p.textContent="Endpoint is down",l.appendChild(p);let g=document.createElement("li");g.textContent="Credentials have expired",l.appendChild(g);let y=document.createElement("li"),T=document.createElement("span");T.textContent="Endpoint is not accessible from the YASGUI server and website, and the endpoint is not ",y.appendChild(T);let U=document.createElement("a");return U.textContent="CORS-enabled",U.href="http://enable-cors.org/",U.target="_blank",U.rel="noopener noreferrer",y.appendChild(U),l.appendChild(y),n.appendChild(l),n}getStatusSpecificGuidance(n){let a=document.createElement("div");a.className="statusGuidance";let l=document.createElement("h4"),c=document.createElement("ul");switch(n){case 401:l.textContent="Authentication Required",a.appendChild(l);let p=document.createElement("li");p.textContent="The endpoint requires authentication credentials",c.appendChild(p);let g=document.createElement("li");g.textContent="Check if you need to provide an API key, username/password, or bearer token",c.appendChild(g);let y=document.createElement("li");return y.textContent="Verify your credentials are correct and not expired",c.appendChild(y),a.appendChild(c),a;case 403:l.textContent="Access Forbidden",a.appendChild(l);let T=document.createElement("li");T.textContent="You don't have permission to access this endpoint",c.appendChild(T);let U=document.createElement("li");U.textContent="Your credentials may be valid but lack sufficient privileges",c.appendChild(U);let A=document.createElement("li");A.textContent="Contact the endpoint administrator to request access",c.appendChild(A);let F=document.createElement("li");return F.textContent="A firewall such as OWASP is blocking is blocking SPARQL queries because they resemble SQL injection attempts. Contact the endpoint administrator to whitelist your queries or adjust firewall settings",c.appendChild(F),a.appendChild(c),a;case 404:l.textContent="Endpoint Not Found",a.appendChild(l);let M=document.createElement("li");M.textContent="The endpoint URL may be incorrect or has changed",c.appendChild(M);let X=document.createElement("li");X.textContent="Check for typos in the endpoint address",c.appendChild(X);let S=document.createElement("li");return S.textContent="Verify the endpoint is still active and hasn't been moved",c.appendChild(S),a.appendChild(c),a;case 429:l.textContent="Too Many Requests",a.appendChild(l);let Z=document.createElement("li");Z.textContent="You've exceeded the rate limit for this endpoint",c.appendChild(Z);let _=document.createElement("li");_.textContent="Wait a few moments before trying again",c.appendChild(_);let G=document.createElement("li");return G.textContent="Consider reducing query frequency or contacting the endpoint provider for higher limits",c.appendChild(G),a.appendChild(c),a;case 500:l.textContent="Internal Server Error",a.appendChild(l);let J=document.createElement("li");J.textContent="The SPARQL endpoint encountered an error while processing your query",c.appendChild(J);let q=document.createElement("li");q.textContent="Try simplifying your query or reducing the result limit",c.appendChild(q);let te=document.createElement("li");te.textContent="Check the error message below for specific details",c.appendChild(te);let ae=document.createElement("li");return ae.textContent="If the problem persists, contact the endpoint administrator",c.appendChild(ae),a.appendChild(c),a;case 502:case 503:case 504:l.textContent=n===502?"Bad Gateway":n===503?"Service Unavailable":"Gateway Timeout",a.appendChild(l);let R=document.createElement("li");R.textContent="The endpoint is temporarily unavailable or overloaded",c.appendChild(R);let w=document.createElement("li");w.textContent="Try again in a few moments",c.appendChild(w);let P=document.createElement("li");return P.textContent="The service may be undergoing maintenance",c.appendChild(P),a.appendChild(c),a;default:if(n>=400&&n<500){l.textContent="Client Error",a.appendChild(l);let $=document.createElement("li");$.textContent="There's an issue with the request",c.appendChild($);let fe=document.createElement("li");return fe.textContent="Check the error message below for details",c.appendChild(fe),a.appendChild(c),a}return null}}async draw(){let n=document.createElement("div");n.className="errorResult",this.yasr.resultsEl.appendChild(n);let a=this.yasr.results?.getError();if(!a)return;let l=document.createElement("div");l.className="errorHeader",n.appendChild(l);let c=await this.yasr.renderError(a);if(c){let g=document.createElement("div");g.className="redOutline",g.appendChild(c),n.appendChild(g);return}if(a.status){var p="Error";a.statusText&&a.statusText.length<100&&(p=a.statusText),p+=` (#${a.status})`;let g=document.createElement("span");if(g.className="status",g.textContent=p,l.appendChild(g),this.yasr.config.getPlainQueryLinkToEndpoint){let T=this.yasr.config.getPlainQueryLinkToEndpoint();T&&l.appendChild(this.getTryBtn(T))}let y=this.getStatusSpecificGuidance(a.status);if(y&&n.appendChild(y),a.text){let T=document.createElement("div");Qe(T,"errorMessageContainer"),n.appendChild(T);let U=document.createElement("pre");Qe(U,"errorMessage"),U.textContent=a.text,T.appendChild(U)}}else{if(this.yasr.config.getPlainQueryLinkToEndpoint){let y=this.yasr.config.getPlainQueryLinkToEndpoint();y&&l.appendChild(this.getTryBtn(y))}if(!a.text||a.text.indexOf("Request has been terminated")>=0||a.text.indexOf("Failed to fetch")>=0||a.text.indexOf("NetworkError")>=0||a.text.indexOf("Network request failed")>=0)n.appendChild(this.getCorsMessage());else{let y=document.createElement("pre");y.textContent=a.text,n.appendChild(y)}}}getIcon(){return document.createElement("")}};var ar=class ar extends mm.EventEmitter{constructor(a,l={},c){super();this.plugins={};this.helpDrawn=!1;this.isFullscreen=!1;this.isLoading=!1;this.utils={addScript:Ms,addCSS:ks,sanitize:wu};if(!a)throw new Error("No parent passed as argument. Dont know where to draw YASR");this.rootEl=document.createElement("div"),this.rootEl.className="yasr",a.appendChild(this.rootEl),this.config=Ol({},ar.defaults,l),this.storage=new ri(ar.storageNamespace),this.getConfigFromStorage(),this.headerEl=document.createElement("div"),this.headerEl.className="yasr_header",this.rootEl.appendChild(this.headerEl),this.fallbackInfoEl=document.createElement("div"),this.fallbackInfoEl.className="yasr_fallback_info",this.rootEl.appendChild(this.fallbackInfoEl),this.resultsEl=document.createElement("div"),this.resultsEl.className="yasr_results",this.resultsEl.id=Dl("resultsId"),this.rootEl.appendChild(this.resultsEl),this.createLoadingElement(),this.initializePlugins(),this.drawHeader();let p=c||this.getResponseFromStorage();p&&this.setResponse(p)}getConfigFromStorage(){let a=this.getStorageId(this.config.persistenceLabelConfig);if(a){let l=this.storage.get(a);if(l){this.selectedPlugin=l.selectedPlugin;for(let c in l.pluginsConfig){let p=l.pluginsConfig[c];p&&this.config.plugins[c]&&(this.config.plugins[c].dynamicConfig=p)}}}}async renderError(a){let l;if(this.config.errorRenderers!==void 0){for(let c of this.config.errorRenderers)if(l=await c(a),l!==void 0)break}return l}getStorageId(a,l){let c=l||this.config.persistenceId;if(c)return typeof c=="string"?c+"_"+a:c(this)+"_"+a}somethingDrawn(){return!!this.resultsEl.children.length}emptyFallbackElement(){for(;this.fallbackInfoEl.firstChild;)this.fallbackInfoEl.removeChild(this.fallbackInfoEl.firstChild)}getSelectedPluginName(){return this.selectedPlugin||this.config.defaultPlugin}getSelectedPlugin(){if(this.plugins[this.getSelectedPluginName()])return this.plugins[this.getSelectedPluginName()];console.warn(`Tried using plugin ${this.getSelectedPluginName()}, but seems this plugin isnt registered in yasr.`)}updatePluginSelectors(a){if(this.pluginSelectorsEl)for(let l in this.config.plugins){let c=this.plugins[l];c&&!c.hideFromSelection&&(a&&(a.indexOf(l)>=0?hn(this.pluginSelectorsEl.querySelector(".select_"+l),"disabled"):Qe(this.pluginSelectorsEl.querySelector(".select_"+l),"disabled")),l===this.getSelectedPluginName()?Qe(this.pluginSelectorsEl.querySelector(".select_"+l),"selected"):hn(this.pluginSelectorsEl.querySelector(".select_"+l),"selected"))}}getCompatiblePlugins(){if(!this.results)return Object.keys(Gl(this.config.plugins,l=>typeof l=="object"&&l.enabled||l===!0));let a=[];for(let l in this.plugins)this.plugins[l].canHandleResults()&&a.push({name:l,priority:this.plugins[l].priority});return a.sort((l,c)=>c.priority-l.priority).map(l=>l.name)}draw(){if(this.updateHelpButton(),this.updateResponseInfo(),!this.results)return;let a=this.getCompatiblePlugins();if(this.drawnPlugin&&this.getSelectedPluginName()!==this.drawnPlugin){for(;this.pluginControls.firstChild;)this.pluginControls.firstChild.remove();this.plugins[this.drawnPlugin].destroy?.()}let l;if(this.getSelectedPlugin()&&this.getSelectedPlugin()?.canHandleResults()?(l=this.getSelectedPluginName(),this.emptyFallbackElement()):a[0]&&(this.drawnPlugin&&this.plugins[this.drawnPlugin].destroy?.(),l=a[0],this.fillFallbackBox(l)),l){this.drawnPlugin=l,this.emit("draw",this,this.plugins[l]);let c=this.plugins[l];(c.initialize?c.initialize():Promise.resolve()).then(async()=>{if(l){for(;this.resultsEl.firstChild;)this.resultsEl.firstChild.remove();await this.plugins[l].draw(this.config.plugins[l].dynamicConfig),this.emit("drawn",this,this.plugins[l]),this.updateExportHeaders(),this.updatePluginSelectors(a)}},g=>console.error)}else this.resultsEl.textContent="cannot render result",this.updateExportHeaders(),this.updatePluginSelectors(a)}refresh(){this.draw()}destroy(){this.drawnPlugin&&this.plugins[this.drawnPlugin]?.destroy?.(),this.removeAllListeners(),this.rootEl.remove()}getPrefixes(){return this.config.prefixes?typeof this.config.prefixes=="function"?this.config.prefixes(this):this.config.prefixes:{}}selectPlugin(a){this.selectedPlugin!==a&&(this.config.plugins[a]?this.selectedPlugin=a:(console.warn(`Plugin ${a} does not exist.`),this.selectedPlugin=this.config.defaultPlugin),this.storeConfig(),this.emit("change",this),this.updatePluginSelectors(),this.draw())}drawPluginSelectors(){this.pluginSelectorsEl=document.createElement("ul"),this.pluginSelectorsEl.className="yasr_btnGroup";let a=this.config.pluginOrder;Object.keys(this.config.plugins).sort().forEach(l=>{a.indexOf(l)===-1&&a.push(l)});for(let l of a){if(!this.config.plugins[l]||!this.config.plugins[l].enabled)continue;let c=this.plugins[l];if(!c||c.hideFromSelection)continue;let p=c.label||l,g=document.createElement("button");if(Qe(g,"yasr_btn","select_"+l),g.title=p,g.type="button",g.setAttribute("aria-label",`Shows ${p} view`),c.getIcon){let U=c.getIcon();U&&(Qe(U,"plugin_icon"),g.appendChild(U))}let y=document.createElement("span");y.textContent=p,g.appendChild(y),g.addEventListener("click",()=>this.selectPlugin(l));let T=document.createElement("li");T.appendChild(g),this.pluginSelectorsEl.appendChild(T)}this.pluginSelectorsEl.children.length>=1&&this.headerEl.appendChild(this.pluginSelectorsEl),this.updatePluginSelectors()}fillFallbackBox(a){if(this.emptyFallbackElement(),this.plugins[a||this.drawnPlugin||""]?.hideFromSelection)return;let l=this.getSelectedPlugin(),c=this.plugins[a||this.drawnPlugin||""]?.label||a||this.drawnPlugin,p=l?.label||this.getSelectedPluginName(),g=document.createElement("p");if(g.innerText=`Could not render results with the ${p} plugin, the results currently are rendered with the ${c} plugin. ${this.getSelectedPlugin()?.helpReference?"See ":""}`,l?.helpReference){let y=document.createElement("a");y.innerText=`${p} documentation`,y.href=l.helpReference,y.rel="noopener noreferrer",y.target="_blank",g.append(y),g.innerHTML+=" for more information."}this.fallbackInfoEl.appendChild(g)}drawPluginElement(){let a=document.createElement("div");Qe(a,"space_element"),this.headerEl.appendChild(a),this.pluginControls=document.createElement("div"),this.pluginControls.setAttribute("id","yasr_plugin_control"),Qe(this.pluginControls,"yasr_plugin_control"),this.pluginControls.setAttribute("aria-controls",this.resultsEl.id),this.headerEl.appendChild(this.pluginControls)}drawHeader(){this.drawPluginSelectors(),this.drawResponseInfo(),this.drawPluginElement(),this.drawDownloadIcon(),this.drawFullscreenButton(),this.loadingEl&&this.headerEl.appendChild(this.loadingEl),this.drawDocumentationButton()}drawDownloadIcon(){this.downloadBtn=document.createElement("a"),Qe(this.downloadBtn,"yasr_btn","yasr_downloadIcon","btn_icon"),this.downloadBtn.download="",this.downloadBtn.setAttribute("aria-label","Download Results"),this.downloadBtn.setAttribute("tabindex","0"),this.downloadBtn.setAttribute("role","button");let a=document.createElement("i");Qe(a,"fas","fa-download"),a.setAttribute("aria-hidden","true"),this.downloadBtn.appendChild(a),this.downloadBtn.addEventListener("click",()=>{Xo(this.downloadBtn,"disabled")||this.download()}),this.downloadBtn.addEventListener("keydown",l=>{if(l.code==="Space"||l.code==="Enter"){if(Xo(this.downloadBtn,"disabled"))return;this.download()}}),this.headerEl.appendChild(this.downloadBtn)}drawResponseInfo(){this.dataElement=document.createElement("div"),Qe(this.dataElement,"yasr_response_chip"),this.headerEl.appendChild(this.dataElement),this.updateResponseInfo()}updateResponseInfo(){let a="";if(this.results){hn(this.dataElement,"empty");let l=this.results.getBindings();l&&(a+=`${l.length} result${l.length===1?"":"s"}`);let c=this.results.getResponseTime();if(c){a||(a="Response");let p=c/1e3;a+=` in ${p} second${p===1?"":"s"}`}}else Qe(this.dataElement,"empty");this.dataElement.innerText=a}updateHelpButton(){let a=this.getSelectedPlugin();if(a?.helpReference){let l=`View documentation of ${a.label||this.getSelectedPluginName()}`;this.documentationLink.href=a.helpReference,this.documentationLink.title=l,this.documentationLink.setAttribute("aria-label",l),hn(this.documentationLink,"disabled")}else Qe(this.documentationLink,"disabled"),this.documentationLink.title="This plugin doesn't have a help reference yet. Please contact the maintainer to fix this"}updateExportHeaders(){if(this.downloadBtn&&this.drawnPlugin){this.downloadBtn.title="";let a=this.plugins[this.drawnPlugin];if(a&&a.download){let l=a.download(this.config.getDownloadFileName?.());if(hn(this.downloadBtn,"disabled"),l){l.title&&(this.downloadBtn.title=l.title);return}}this.downloadBtn.title="Download not supported",Qe(this.downloadBtn,"disabled")}}drawFullscreenButton(){this.fullscreenBtn=document.createElement("button"),Qe(this.fullscreenBtn,"yasr_btn","yasr_fullscreenButton","btn_icon"),this.fullscreenBtn.setAttribute("aria-label","Toggle fullscreen"),this.fullscreenBtn.setAttribute("tabindex","0"),this.fullscreenBtn.setAttribute("role","button");let a=document.createElement("i");Qe(a,"fas"),Qe(a,"fa-expand"),Qe(a,"fullscreenIcon"),a.setAttribute("aria-hidden","true"),this.fullscreenBtn.appendChild(a);let l=document.createElement("i");Qe(l,"fas"),Qe(l,"fa-compress"),Qe(l,"fullscreenExitIcon"),l.setAttribute("aria-hidden","true"),this.fullscreenBtn.appendChild(l),this.fullscreenBtn.title="Toggle fullscreen (F10)",this.fullscreenBtn.addEventListener("click",()=>{this.toggleFullscreen()}),this.fullscreenBtn.addEventListener("keydown",c=>{(c.code==="Space"||c.code==="Enter")&&this.toggleFullscreen()}),this.headerEl.appendChild(this.fullscreenBtn)}toggleFullscreen(){this.isFullscreen=!this.isFullscreen,this.isFullscreen?(Qe(this.rootEl,"fullscreen"),this.fullscreenBtn&&(this.fullscreenBtn.title="Exit fullscreen (F10)")):(hn(this.rootEl,"fullscreen"),this.fullscreenBtn&&(this.fullscreenBtn.title="Toggle fullscreen (F10)"))}getIsFullscreen(){return this.isFullscreen}createLoadingElement(){this.loadingEl=document.createElement("div"),this.loadingEl.className="yasr_loading_indicator",this.loadingEl.title="Executing query...",this.loadingEl.innerHTML='<div class="yasr_loading_spinner"></div>',this.loadingEl.style.display="none"}showLoading(){this.isLoading=!0,this.loadingEl&&(this.loadingEl.style.display="flex")}hideLoading(){this.isLoading=!1,this.loadingEl&&(this.loadingEl.style.display="none")}drawDocumentationButton(){this.documentationLink=document.createElement("a"),Qe(this.documentationLink,"yasr_btn","yasr_external_ref_btn");let a=document.createElement("i");Qe(a,"fas","fa-circle-question"),this.documentationLink.appendChild(a),this.documentationLink.href="https://docs.triply.cc/yasgui/",this.documentationLink.target="_blank",this.documentationLink.rel="noopener noreferrer",this.headerEl.appendChild(this.documentationLink)}download(){if(!this.drawnPlugin)return;let a=this.plugins[this.drawnPlugin];if(a&&a.download){let l=a.download(this.config.getDownloadFileName?.());if(!l)return;let c=l.getData(),p;if(c.startsWith("data:"))p=c;else{let y=new Blob([c],{type:l.contentType??"text/plain"});p=window.URL.createObjectURL(y)}let g=document.createElement("a");g.href=p,g.download=l.filename,g.click()}}handleLocalStorageQuotaFull(a){console.warn("Localstorage quota exceeded. Clearing all queries"),ar.clearStorage()}getResponseFromStorage(){let a=this.getStorageId(this.config.persistenceLabelResponse);if(a)return this.storage.get(a)}getPersistentConfig(){return{selectedPlugin:this.getSelectedPluginName(),pluginsConfig:Mo(this.config.plugins,a=>a.dynamicConfig)}}storePluginConfig(a,l){this.config.plugins[a].dynamicConfig=l,this.storeConfig(),this.emit("change",this)}storeConfig(){let a=this.getStorageId(this.config.persistenceLabelConfig);a&&this.storage.set(a,this.getPersistentConfig(),this.config.persistencyExpire,this.handleLocalStorageQuotaFull)}storeResponse(){let a=this.getStorageId(this.config.persistenceLabelResponse);if(a&&this.results){let l=this.results.getAsStoreObject(this.config.maxPersistentResponseSize);l&&!l.error?this.storage.set(a,l,this.config.persistencyExpire,this.handleLocalStorageQuotaFull):this.storage.remove(a)}}setResponse(a,l){a&&(this.hideLoading(),this.results=new Us(a,l),this.draw(),this.storeResponse())}executeQuery(a,l){return this.config.executeQuery?this.config.executeQuery(a,l):Promise.reject(new Error("No executeQuery handler configured on this Yasr instance"))}initializePlugins(){for(let a in this.config.plugins)this.config.plugins[a]&&(ar.plugins[a]?this.plugins[a]=new ar.plugins[a](this):console.warn("Wanted to initialize plugin "+a+" but could not find a matching registered plugin"))}static registerPlugin(a,l,c=!0){ar.plugins[a]=l,c?ar.defaults.plugins[a]={enabled:!0}:ar.defaults.plugins[a]={enabled:!1}}static clearStorage(){new ri(ar.storageNamespace).removeNamespace()}};ar.defaults=Zl(),ar.plugins={},ar.Dependencies={},ar.storageNamespace="triply";var $r=ar;function CR(r,n,a=!0){$r.plugins[r]=n,a?$r.defaults.plugins[r]={enabled:!0}:$r.defaults.plugins[r]={enabled:!1}}$r.registerPlugin("boolean",ra);$r.registerPlugin("response",na);$r.registerPlugin("error",ia);var AR=$r;return Ib(RR);})();
48
48
  /*! Bundled license information:
49
49
 
50
50
  ieee754/index.js: