/*! For license information please see yasgui.min.js.LICENSE.txt */
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("Yasgui",[],t):"object"==typeof exports?exports.Yasgui=t():e.Yasgui=t()}(self,()=>(()=>{var __webpack_modules__={3111:(e,t,r)=>{"use strict";r.d(t,{wc:()=>s,iQ:()=>p,uZ:()=>u,Mg:()=>l,_A:()=>f,nB:()=>c,vy:()=>d});var n=r(4996),i=r(9121),o=r(4758),a=r(5043),s=function(){return(0,o.A)((function e(t){(0,i.A)(this,e),this.namespace=t}),[{key:"set",value:function(e,t,r,n){if(a.enabled&&(this.removeExpiredKeys(),e&&void 0!==t)){t.documentElement&&(t=(new XMLSerializer).serializeToString(t.documentElement));try{a.set(e,{namespace:this.namespace,val:t,exp:r,time:(new Date).getTime()/1e3})}catch(e){if(e instanceof Error){var i=e;if(i.quotaExceeded=function(e){var t=!1;if(e)if(e.code)switch(e.code){case 22:t=!0;break;case 1014:"NS_ERROR_DOM_QUOTA_REACHED"===e.name&&(t=!0)}else-2147024882===e.number&&(t=!0);return t}(e),!i.quotaExceeded||!n)throw i;n(e)}throw e}}}},{key:"remove",value:function(e){a.enabled&&e&&a.remove(e)}},{key:"removeExpiredKeys",value:function(){var e=this;a.enabled&&a.each((function(t,r){t&&t.exp&&(new Date).getTime()/1e3-t.time>t.exp&&e.remove(r)}))}},{key:"removeAll",value:function(){a.enabled}},{key:"removeNamespace",value:function(){var e=this;a.each((function(t,r){t.namespace&&t.namespace===e.namespace&&e.remove(r)}))}},{key:"get",value:function(e){if(a.enabled&&e&&(this.removeExpiredKeys(),e)){var t=a.get(e);if(!t)return;return t.val}}}])}();function l(e){if(e&&0==e.trim().indexOf("')}function c(e,t){if(e)return e.classList?e.classList.contains(t):!!e.className.match(new RegExp("(\\s|^)"+t+"(\\s|$)"))}function p(e){if(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n{"use strict";r.d(t,{default:()=>Te});var n={};r.r(n),r.d(n,{executeQuery:()=>C,getAcceptHeader:()=>_,getAjaxConfig:()=>N,getAsCurlString:()=>w,getUrlArguments:()=>I});var i=r(9121),o=r(4758),a=r(365),s=r(8782),l=r(9604),u=r(6863),c=r(1719),p=r.n(c);function d(e,t,r){return r||(r=e.getDoc().getCursor()),t||(t=e.getTokenAt(r)),function e(t,r,n){if(r.string.indexOf(" ")>=0){var i=r.string.indexOf(" ");return r.string=r.string.substr(0,i),r.end=r.start+r.string.length,r}if(!r.type)return r;var o=t.getTokenAt({line:n.line,ch:r.end+1});return"ws"!==o.type&&r.state.possibleFullIri&&null!==r.type&&"ws"!==r.type&&o.end!==r.end?(r.end=o.end,r.string=r.string+o.string,e(t,r,{line:n.line,ch:o.end})):"ws"===r.type?(r.end=r.end+1,r.string=r.string.substring(r.string.length-1),r):r}(e,function e(t,r,n){var i=t.getTokenAt({line:n.line,ch:r.start});if(!("punc"!==r.type&&"error"!==r.type||r.state.possibleFullIri||r.state.inPrefixDecl))return r.state.possibleCurrent=r.state.possibleNext,r;if("punc"===i.type&&!i.state.possibleFullIri&&!i.state.inPrefixDecl)return r;return null!=i.type&&"ws"!=i.type&&null!=r.type&&"ws"!=r.type?(r.start=i.start,r.string=i.string+r.string,e(t,r,{line:n.line,ch:i.start})):null!=r.type&&"ws"==r.type?(r.start=r.start+1,r.string=r.string.substring(1),r):r}(e,t,r),r)}function f(e,t,r){null==r&&(r=1);var n=e.getTokenAt({line:t,ch:r});if(!(null==n||null==n||n.end=0)return r}}function g(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3?arguments[3]:void 0;n||(n=e.getDoc().getLine(t));var i=(n=n.toUpperCase()).indexOf("PREFIX ",r);if(i>=0){var o=e.getTokenTypeAt(p().Pos(t,i+1));if("keyword"===o)return i}}function m(e,t){e.getDoc().replaceRange("PREFIX "+t+"\n",{line:0,ch:0}),e.collapsePrefixes(!1)}var v=r(3111),y=r(2928);function E(e,t,r){var n;t.onmouseover=function(){n||((n=document.createElement("div")).className="yasqe_tooltip"),n.style.display="block",n.innerHTML=r,t.appendChild(n)},t.onmouseout=function(){n&&(n.style.display="none"),n.innerHTML=r}}var b=r(232),x=r.n(b),T=r(9790),A=r(7440),S=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{l(n.next(e))}catch(e){o(e)}}function s(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}l((n=n.apply(e,t||[])).next())}))};function L(e,t){return(0,T.A)(t)?t(e):t}function N(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=(0,A.A)({},L(e,e.config.requestConfig),L(e,t));if(r.endpoint&&0!=r.endpoint.length){var n=e.getQueryMode(),i=(0,T.A)(r.endpoint)?r.endpoint(e):r.endpoint,o="update"==n?"POST":(0,T.A)(r.method)?r.method(e):r.method,a=(0,T.A)(r.headers)?r.headers(e):r.headers,s=(0,T.A)(r.withCredentials)?r.withCredentials(e):r.withCredentials;return{reqMethod:o,url:i,args:I(e,r),headers:a,accept:_(e,r),withCredentials:s}}}function C(e,t){return S(this,void 0,void 0,x().mark((function r(){var n,i,o;return x().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(r.prev=0,N(e,t),i=N(e,t)){r.next=5;break}return r.abrupt("return");case 5:return o=Date.now(),(n="POST"===i.reqMethod?u.post(i.url).type("form").send(i.args):u.get(i.url).query(i.args)).accept(i.accept).set(i.headers||{}),i.withCredentials&&n.withCredentials(),e.emit("query",n,i),r.next=12,n.then((function(t){return e.emit("queryResponse",t,Date.now()-o),e.emit("queryResults",t.body,Date.now()-o),t.body}),(function(t){throw t instanceof Error&&"Aborted"===t.message||e.emit("queryResponse",t,Date.now()-o),e.emit("error",t),t}));case 12:return r.abrupt("return",r.sent);case 15:r.prev=15,r.t0=r.catch(0),console.error(r.t0);case 18:case"end":return r.stop()}}),r,null,[[0,15]])})))}function I(e,t){var r=e.getQueryMode(),n={},i=L(e,t),o=(0,T.A)(i.queryArgument)?i.queryArgument(e):i.queryArgument;o||(o=e.getQueryMode()),n[o]=i.adjustQueryBeforeRequest?i.adjustQueryBeforeRequest(e):e.getValue();var a=(0,T.A)(i.namedGraphs)?i.namedGraphs(e):i.namedGraphs;a&&a.length>0&&(n["query"===r?"named-graph-uri":"using-named-graph-uri "]=a);var s=(0,T.A)(i.defaultGraphs)?i.defaultGraphs(e):i.defaultGraphs;s&&s.length>0&&(n["query"==r?"default-graph-uri":"using-graph-uri "]=a);var l=(0,T.A)(i.args)?i.args(e):i.args;return l&&l.length>0&&(0,A.A)(n,l.reduce((function(e,t){return e[t.name]?e[t.name].push(t.value):e[t.name]=[t.value],e}),{})),n}function _(e,t){var r=L(e,t),n=null;if("update"==e.getQueryMode())n=(0,T.A)(r.acceptHeaderUpdate)?r.acceptHeaderUpdate(e):r.acceptHeaderUpdate;else{var i=e.getQueryType();n="DESCRIBE"==i||"CONSTRUCT"==i?(0,T.A)(r.acceptHeaderGraph)?r.acceptHeaderGraph(e):r.acceptHeaderGraph:(0,T.A)(r.acceptHeaderSelect)?r.acceptHeaderSelect(e):r.acceptHeaderSelect}return n}function w(e,t){var r=N(e,L(e,t));if(!r)return"";var n=r.url;0!==r.url.indexOf("http")&&(n="".concat(window.location.protocol,"//").concat(window.location.host),0===r.url.indexOf("/")?n+=r.url:n+=window.location.pathname+r.url);var i=["curl"];for(var o in"GET"===r.reqMethod?(n+="?".concat(y.stringify(r.args)),i.push(n)):"POST"===r.reqMethod?(i.push(n),i.push("--data",y.stringify(r.args))):(console.warn("Unexpected request-method",r.reqMethod),i.push(n)),i.push("-X",r.reqMethod),r.headers)i.push("-H '".concat(o,": ").concat(r.headers[o],"'"));return i.join(" ")}var R='',O=function(){function e(){(0,i.A)(this,e),this.words=0,this.prefixes=0,this.children={}}return(0,o.A)(e,[{key:"insert",value:function(t,r){if(0!=t.length){var n,i=this;void 0===r&&(r=0),r!==t.length?(i.prefixes++,n=t[r],void 0===i.children[n]&&(i.children[n]=new e),i.children[n].insert(t,r+1)):i.words++}}},{key:"remove",value:function(e,t){if(0!=e.length){var r,n=this;void 0===t&&(t=0),void 0!==n&&(t!==e.length?(n.prefixes--,r=e[t],n.children[r].remove(e,t+1)):n.words--)}}},{key:"update",value:function(e,t){0!=e.length&&0!=t.length&&(this.remove(e),this.insert(t))}},{key:"countWord",value:function(e,t){if(0==e.length)return 0;var r,n,i=0;return void 0===t&&(t=0),t===e.length?this.words:(r=e[t],void 0!==(n=this.children[r])&&(i=n.countWord(e,t+1)),i)}},{key:"countPrefix",value:function(e,t){if(0==e.length)return 0;var r,n=0;if(void 0===t&&(t=0),t===e.length)return this.prefixes;var i=e[t];return void 0!==(r=this.children[i])&&(n=r.countPrefix(e,t+1)),n}},{key:"find",value:function(e){return 0!=e.length&&this.countWord(e)>0}},{key:"getAllWords",value:function(e){var t,r,n=this,i=[];if(void 0===e&&(e=""),void 0===n)return[];for(t in n.words>0&&i.push(e),n.children)n.children.hasOwnProperty(t)&&(r=n.children[t],i=i.concat(r.getAllWords(e+t)));return i}},{key:"autoComplete",value:function(e,t){var r,n;return 0==e.length?void 0===t?this.getAllWords(e):[]:(void 0===t&&(t=0),r=e[t],void 0===(n=this.children[r])?[]:t===e.length-1?n.getAllWords(e):n.autoComplete(e,t+1))}}])}(),D=r(4785);const P=function(e,t,r){var n=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(r=r>i?i:r)<0&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var o=Array(i);++n=0&&(s+=l.innerText),r[s])continue;if(s.length<=1)continue;if(0!==s.indexOf(t.string))continue;if(s===t.string)continue;r[s]=!0,n.push(s)}}return n.sort()},bulk:!1,autoShow:!0};var j=r(4560),G=r(8272),B=r(6074),U=r(5955),H=r(3074),q=r(7242);const V=function(e,t){var r=-1,n=(0,q.A)(e)?Array(e.length):[];return(0,H.A)(e,(function(e,i,o){n[++r]=t(e,i,o)})),n};const W=function(e,t){var r=e.length;for(e.sort(t);r--;)e[r]=e[r].value;return e};var z=r(9161),Q=r(8086);const X=function(e,t){if(e!==t){var r=void 0!==e,n=null===e,i=e==e,o=(0,Q.A)(e),a=void 0!==t,s=null===t,l=t==t,u=(0,Q.A)(t);if(!s&&!u&&!o&&e>t||o&&a&&l&&!s&&!u||n&&a&&l||!r&&l||!i)return 1;if(!n&&!o&&!u&&e=s?l:l*("desc"==r[n]?-1:1)}return e.index-t.index};var Y=r(1100),K=r(8285);const J=function(e,t,r){t=t.length?(0,G.A)(t,(function(e){return(0,K.A)(e)?function(t){return(0,B.A)(t,1===e.length?e[0]:e)}:e})):[Y.A];var n=-1;t=(0,G.A)(t,(0,z.A)(U.A));var i=V(e,(function(e,r,i){return{criteria:(0,G.A)(t,(function(t){return t(e)})),index:++n,value:e}}));return W(i,(function(e,t){return $(e,t,r)}))};var Z=r(5186),ee=r(6988);const te=(0,Z.A)((function(e,t){if(null==e)return[];var r=t.length;return r>1&&(0,ee.A)(e,t[0],t[1])?t=[]:r>2&&(0,ee.A)(t[0],t[1],t[2])&&(t=[t[0]]),J(e,(0,j.A)(t,1),[])}));var re={"string-2":"prefixed",atom:"var"};const ne={postprocessHints:function(e,t){return te(t,(function(e){return e.text.split(":")[0]}))},onInitialize:function(e){var t=this;e.on("change",(function(){var r;if(e.config.autocompleters&&-1!=e.config.autocompleters.indexOf(t.name)){var n=e.getDoc().getCursor(),i=e.getTokenAt(n);if(i.type&&"prefixed"==re[i.type]){var o=i.string.indexOf(":");if(-1!==o){var a=e.getPreviousNonWsToken(n.line,i).string.toUpperCase(),s=e.getTokenAt({line:n.line,ch:i.start});if("PREFIX"!==a&&("ws"==s.type||null==s.type||"punc"===s.type&&("|"===s.string||"/"===s.string||"^^"==s.string||"{"==s.string||"("===s.string))){var l=i.string.substring(0,o+1);null==e.getPrefixesFromQuery()[l.slice(0,-1)]&&(i.autocompletionString=l,null===(r=e.autocompleters[t.name])||void 0===r||r.getCompletions(i).then((function(t){t.length&&(e.addPrefixes(t[0]),e.autocomplete())}),console.warn))}}}}}))},isValidCompletionPosition:function(e){var t=e.getDoc().getCursor(),r=e.getTokenAt(t);if(e.getDoc().getLine(t.line).length>t.ch)return!1;if("ws"!=r.type&&(r=e.getCompleteToken()),0!==r.string.indexOf("a")&&r.state.possibleCurrent.indexOf("PNAME_NS")<0)return!1;var n=e.getPreviousNonWsToken(t.line,r);return!(!n||"PREFIX"!=n.string.toUpperCase())},get:function(e){return u.get(e.config.prefixCcApi).then((function(e){var t=[];for(var r in e.body){var n=r+": <"+e.body[r]+">";t.push(n)}return t.sort()}))},preProcessToken:function(e,t){var r=e.getPreviousNonWsToken(e.getDoc().getCursor().line,t);return r&&r.string&&":"==r.string.slice(-1)&&(t={start:r.start,end:t.end,string:r.string+" "+t.string,state:t.state,type:t.type}),t},bulk:!0,autoShow:!0,persistenceId:"prefixes",name:"prefixes"};const ie={onInitialize:function(e){},get:function(e,t){return fe(e,"property",t)},isValidCompletionPosition:function(e){var t=e.getCompleteToken();return 0!=t.string.length&&("?"!==t.string[0]&&"$"!==t.string[0]&&t.state.possibleCurrent.indexOf("a")>=0)},preProcessToken:function(e,t){return pe(e,t)},postProcessSuggestion:function(e,t,r){return de(e,t,r)},bulk:!1,name:"property"};const oe={onInitialize:function(e){},get:function(e,t){return fe(e,"class",t)},isValidCompletionPosition:function(e){var t=e.getCompleteToken();if("?"===t.string[0]||"$"===t.string[0])return!1;var r=e.getDoc().getCursor(),n=e.getPreviousNonWsToken(r.line,t);return"a"===n.state.lastProperty||("rdf:type"===n.state.lastProperty||("rdfs:domain"===n.state.lastProperty||"rdfs:range"===n.state.lastProperty))},preProcessToken:function(e,t){return pe(e,t)},postProcessSuggestion:function(e,t,r){return de(e,t,r)},bulk:!1,name:"class"};function ae(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return se(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return se(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function se(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0?(this.storeBulkCompletions(t),Promise.resolve()):this.getCompletions().then((function(t){return e.storeBulkCompletions(t)}))}return Promise.resolve()}},{key:"isValidPosition",value:function(){return!!this.config.isValidCompletionPosition&&(this.config.isValidCompletionPosition(this.yasqe)?(this.config.autoShow||this.yasqe.showNotification(this.config.name,"Press CTRL - to autocomplete"),this.emit("validPosition",this),!0):(this.emit("invalidPosition",this),this.yasqe.hideNotification(this.config.name),!1))}},{key:"getHint",value:function(e,t){var r,n;this.config.postProcessSuggestion&&(t=this.config.postProcessSuggestion(this.yasqe,e,t));var i=this.yasqe.getDoc().getCursor();e.from&&(n=Object.assign(Object.assign({},i),e.from));var o=this.yasqe.getDoc().getCursor().line;return{text:t,displayText:t,from:n,to:e.to?{ch:(null===(r=null==e?void 0:e.to)||void 0===r?void 0:r.ch)||this.yasqe.getCompleteToken().end,line:o}:e.string.length>0?{ch:this.yasqe.getCompleteToken().end,line:o}:e.from}}},{key:"getHints",value:function(e){var t=this;return this.config.preProcessToken&&(e=this.config.preProcessToken(this.yasqe,e)),e?this.getCompletions(e).then((function(r){return r.map((function(r){return t.getHint(e,r)}))})).then((function(e){return t.config.postprocessHints?t.config.postprocessHints(t.yasqe,e):e})):Promise.resolve([])}},{key:"autocomplete",value:function(e){var t=this;if(!this.isValidPosition())return!1;var r=this.yasqe.state.completionActive,n=this.yasqe.getDoc().getCursor();if(r&&n.sticky&&n.ch!==r.startPos.ch?this.yasqe.state.completionActive.startPos=n:r&&!n.sticky&&n.ch"]/,completeSingle:!1,hint:i,container:this.yasqe.rootEl,extraKeys:{Home:function(e,t){e.getDoc().setCursor({ch:0,line:t.data.from.line})},End:function(e,t){e.getDoc().setCursor({ch:e.getLine(t.data.to.line).length,line:t.data.to.line})}}},this.yasqe.config.hintConfig);return this.yasqe.showHint(o),!0}}])}(D.EventEmitter);function pe(e,t){var r=e.getPrefixesFromQuery(),n=t.string;if(n.indexOf("<")<0&&(t.tokenPrefix=n.substring(0,n.indexOf(":")+1),null!=r[t.tokenPrefix.slice(0,-1)]&&(t.tokenPrefixUri=r[t.tokenPrefix.slice(0,-1)])),t.autocompletionString=n.trim(),n.indexOf("<")<0&&n.indexOf(":")>-1)for(var i in r)if(t.tokenPrefix===i+":"){t.autocompletionString=r[i],t.autocompletionString+=n.substring(i.length+1);break}return 0==t.autocompletionString.indexOf("<")&&(t.autocompletionString=t.autocompletionString.substring(1)),t.autocompletionString.indexOf(">",t.autocompletionString.length-1)>0&&(t.autocompletionString=t.autocompletionString.substring(0,t.autocompletionString.length-1)),t}function de(e,t,r){return r=t.tokenPrefix&&t.autocompletionString&&t.tokenPrefixUri?t.tokenPrefix+r.substring(t.tokenPrefixUri.length):"<"+r+">"}var fe=function(e,t,r){var n=0===window.location.protocol.indexOf("http")?"https://":"http://",i="autocomplete_"+t;return r&&r.string&&0!=r.string.trim().length?u.get(n+"lov.linkeddata.es/dataset/lov/api/v2/autocomplete/terms").query({q:r.autocompletionString,page_size:50,type:t}).then((function(e){return e.body.results?e.body.results.map((function(e){return e.uri[0]})):[]}),(function(t){e.showNotification(i,"Failed fetching suggestions")})):(e.showNotification(i,"Nothing to autocomplete yet!"),Promise.resolve([]))},he=[F,ne,ie,oe],ge=r(6691);var me=r(1719);r(9754),r(2448),r(7623),r(666),r(5397),r(404),r(9082),r(8709),r(7899),r(9436),r(5851),r(6824),me.registerHelper("fold","prefix",(function(e,t){var r=t.line,n=e.getDoc().getLine(r),i=function(t,r){var n=e.getTokenAt(p().Pos(t,r+1));if(!n||"keyword"!=n.type)return-1;var i=f(e,t,n.end+1);if(!i||"string-2"!=i.type)return-1;var o=f(e,t,i.end+1);return o&&"variable-3"==o.type?o.end:-1};if(!function(){for(var t=!1,n=r-1;n>=0;n--)if(e.getDoc().getLine(n).toUpperCase().indexOf("PREFIX ")>=0){t=!0;break}return t}()){var o=g(e,r,t.ch,n);if(null!=o){for(var a,s=!1,l=e.getDoc().lastLine(),u=i(r,o),c=r,d=r;d<=l&&!s;++d)for(var h=e.getDoc().getLine(d),m=d==r?o+1:0;;){!s&&h.indexOf("{")>=0&&(s=!0);var v=h.toUpperCase().indexOf("PREFIX ",m);if(!(v>=0))break;(a=i(d,v))>0&&(c=d,m=u=a),m++}return{from:p().Pos(r,o+"PREFIX ".length),to:p().Pos(c,u)}}}})),me.defineMode("sparql11",(function(e){var t=r(5406),n=t.table,i="[0-9A-Fa-f]",o="(([A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD])(((([A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD]|_|-|[0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]))|\\.)*(([A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD]|_|-|[0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040])))?)?:",a="[eE][\\+-]?[0-9]+",s="[0-9]*\\.[0-9]+",l="(([0-9]+\\.[0-9]*"+a+")|(\\.[0-9]+"+a+")|([0-9]+"+a+"))",u="\\\\[tbnrf\\\\\"']",c=i+"{4}",p="(\\\\u"+c+"|\\\\U00(10|0"+i+")"+c+")",d={SINGLE:{CAT:"STRING_LITERAL_LONG1",QUOTES:"'''",CONTENTS:"(('|'')?([^'\\\\]|"+u+"|"+p+"))*"},DOUBLE:{CAT:"STRING_LITERAL_LONG2",QUOTES:'"""',CONTENTS:'(("|"")?([^"\\\\]|'+u+"|"+p+"))*"}};for(var f in d)d[f].COMPLETE=d[f].QUOTES+d[f].CONTENTS+d[f].QUOTES;var h={};for(var g in d)h[g]={complete:{name:"STRING_LITERAL_LONG_"+g,regex:new RegExp("^"+d[g].COMPLETE),style:"string"},contents:{name:"STRING_LITERAL_LONG_"+g,regex:new RegExp("^"+d[g].CONTENTS),style:"string"},closing:{name:"STRING_LITERAL_LONG_"+g,regex:new RegExp("^"+d[g].CONTENTS+d[g].QUOTES),style:"string"},quotes:{name:"STRING_LITERAL_LONG_QUOTES_"+g,regex:new RegExp("^"+d[g].QUOTES),style:"string"}};var m="[\\x20\\x09\\x0D\\x0A]",v="#([^\\n\\r]*[\\n\\r]|[^\\n\\r]*$)",y=[{name:"WS",regex:new RegExp("^"+m+"+"),style:"ws"},{name:"COMMENT",regex:new RegExp("^"+v),style:"comment"},{name:"IRI_REF",regex:new RegExp('^<[^<>"`|{}^\\\0- ]*>'),style:"variable-3"},{name:"VAR1",regex:new RegExp("^\\?([A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD]|_|[0-9])([A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD]|_|[0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040])*"),style:"atom"},{name:"VAR2",regex:new RegExp("^\\$([A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD]|_|[0-9])([A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD]|_|[0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040])*"),style:"atom"},{name:"LANGTAG",regex:new RegExp("^@[a-zA-Z]+(-[a-zA-Z0-9]+)*"),style:"meta"},{name:"DOUBLE",regex:new RegExp("^"+l),style:"number"},{name:"DECIMAL",regex:new RegExp("^"+s),style:"number"},{name:"INTEGER",regex:new RegExp("^[0-9]+"),style:"number"},{name:"DOUBLE_POSITIVE",regex:new RegExp("^\\+(([0-9]+\\.[0-9]*[eE][\\+-]?[0-9]+)|(\\.[0-9]+[eE][\\+-]?[0-9]+)|([0-9]+[eE][\\+-]?[0-9]+))"),style:"number"},{name:"DECIMAL_POSITIVE",regex:new RegExp("^\\+[0-9]*\\.[0-9]+"),style:"number"},{name:"INTEGER_POSITIVE",regex:new RegExp("^\\+[0-9]+"),style:"number"},{name:"DOUBLE_NEGATIVE",regex:new RegExp("^-(([0-9]+\\.[0-9]*[eE][\\+-]?[0-9]+)|(\\.[0-9]+[eE][\\+-]?[0-9]+)|([0-9]+[eE][\\+-]?[0-9]+))"),style:"number"},{name:"DECIMAL_NEGATIVE",regex:new RegExp("^-[0-9]*\\.[0-9]+"),style:"number"},{name:"INTEGER_NEGATIVE",regex:new RegExp("^-[0-9]+"),style:"number"},{name:"STRING_LITERAL1",regex:new RegExp("^'(([^\\x27\\x5C\\x0A\\x0D])|\\\\[tbnrf\\\\\"']|(\\\\u[0-9A-Fa-f]{4}|\\\\U00(10|0[0-9A-Fa-f])[0-9A-Fa-f]{4}))*'"),style:"string"},{name:"STRING_LITERAL2",regex:new RegExp('^"(([^\\x22\\x5C\\x0A\\x0D])|\\\\[tbnrf\\\\"\']|(\\\\u[0-9A-Fa-f]{4}|\\\\U00(10|0[0-9A-Fa-f])[0-9A-Fa-f]{4}))*"'),style:"string"},{name:"NIL",regex:new RegExp("^\\(([\\x20\\x09\\x0D\\x0A]|(#([^\\n\\r]*[\\n\\r]|[^\\n\\r]*$)))*\\)"),style:"punc"},{name:"ANON",regex:new RegExp("^\\[([\\x20\\x09\\x0D\\x0A]|(#([^\\n\\r]*[\\n\\r]|[^\\n\\r]*$)))*\\]"),style:"punc"},{name:"PNAME_LN",regex:new RegExp("^(([A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD])(((([A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD]|_|-|[0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]))|\\.)*(([A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD]|_|-|[0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040])))?)?:([A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD]|_|:|[0-9]|((%[0-9A-Fa-f][0-9A-Fa-f])|(\\\\[_~\\.\\-!\\$&'\\(\\)\\*\\+,;=/\\?#@%])))((([A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD]|_|-|[0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040])|\\.|:|((%[0-9A-Fa-f][0-9A-Fa-f])|(\\\\[_~\\.\\-!\\$&'\\(\\)\\*\\+,;=/\\?#@%])))*(([A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD]|_|-|[0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040])|:|((%[0-9A-Fa-f][0-9A-Fa-f])|(\\\\[_~\\.\\-!\\$&'\\(\\)\\*\\+,;=/\\?#@%]))))?"),style:"string-2"},{name:"PNAME_NS",regex:new RegExp("^"+o),style:"string-2"},{name:"BLANK_NODE_LABEL",regex:new RegExp("^_:([A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD]|_|[0-9])((([A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD]|_|-|[0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040])|\\.)*([A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD]|_|-|[0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]))?"),style:"string-2"}];function E(e){var t=[],r=n[e];if(null!=r)for(var i in r)t.push(i.toString());else t.push(e);return t}function b(e,r){function i(){var t=e.column();r.errorStartPos=t,r.errorEndPos=t+l.string.length}function o(e){if(null==r.queryType)switch(e){case"SELECT":case"CONSTRUCT":case"ASK":case"DESCRIBE":case"INSERT":case"DELETE":case"LOAD":case"CLEAR":case"CREATE":case"DROP":case"COPY":case"MOVE":case"ADD":r.queryType=e}}function a(e){switch(r.inPrefixDecl="prefixDecl"===e,e){case"disallowVars":r.allowVars=!1;break;case"allowVars":r.allowVars=!0;break;case"disallowBnodes":r.allowBnodes=!1;break;case"allowBnodes":r.allowBnodes=!0;break;case"storeProperty":r.storeProperty=!0}}function s(e){return(r.allowVars||"var"!=e)&&(r.allowBnodes||"blankNode"!=e&&"blankNodePropertyList"!=e&&"blankNodePropertyListPath"!=e)}0==e.pos&&(r.possibleCurrent=r.possibleNext);var l=function(){var n;if(r.inLiteral){var i=!1;if((n=e.match(h[r.inLiteral].contents.regex,!0,!1))&&0==n[0].length&&(n=e.match(h[r.inLiteral].closing.regex,!0,!1),i=!0),n&&n[0].length>0){var o={quotePos:i?"end":"content",cat:d[r.inLiteral].CAT,style:h[r.inLiteral].complete.style,string:n[0],start:e.start};return i&&(r.inLiteral=void 0),o}}for(var a in h){var s;if(n=e.match(h[a].quotes.regex,!0,!1))return r.inLiteral?(r.inLiteral=void 0,s="end"):(r.inLiteral=a,s="start"),{cat:d[a].CAT,style:h[a].quotes.style,string:n[0],quotePos:s,start:e.start}}for(var l=0;l",style:"error",string:(n=e.match(/^.[A-Za-z0-9]*/,!0,!1))[0],start:e.start,quotePos:void 0}}();if(""==l.cat)return 1==r.OK&&(r.OK=!1,i()),r.complete=!1,l.style;if("WS"===l.cat||"COMMENT"===l.cat||l.quotePos&&"end"!=l.quotePos)return r.possibleCurrent=r.possibleNext,r.possibleFullIri=!1,l.style;var u,c=!1,p=l.cat;if(r.possibleFullIri&&">"===l.string&&(r.possibleFullIri=!1),r.possibleFullIri||"<"!==l.string||(r.possibleFullIri=!0),!l.quotePos||"end"==l.quotePos)for(;r.stack.length>0&&p&&r.OK&&!c;)if("var"===(u=r.stack.pop())&&l.string&&(r.variables[l.string]=l.string),n[u]){var f=n[u][p];if(null!=f&&s(u)){for(var g=f.length-1;g>=0;--g)r.stack.push(f[g]);a(u)}else r.OK=!1,r.complete=!1,i(),r.stack.push(u)}else if(u==p){r.inPrefixDecl&&("PNAME_NS"===u&&l.string.length>0?r.currentPnameNs=l.string.slice(0,-1):"string"==typeof r.currentPnameNs&&l.string.length>1&&(r.prefixes[r.currentPnameNs]=l.string.slice(1,-1),r.currentPnameNs=void 0)),c=!0,o(u);for(var m=!0,v=r.stack.length;v>0;--v){var b=n[r.stack[v-1]];b&&b.$||(m=!1)}if(r.complete=m,r.storeProperty&&"punc"!=p?(r.lastProperty=l.string,r.lastPropertyIndex=l.start,r.storeProperty=!1):"."!==p&&";"!==p||(r.lastProperty="",r.lastPropertyIndex=0),!r.inPrefixDecl&&("PNAME_NS"===p||"PNAME_LN"===p)){var x=l.string.indexOf(":");if(x>=0){var T=l.string.slice(0,x);void 0===r.prefixes[T]&&(r.OK=!1,i(),r.errorMsg="Prefix '"+T+"' is not defined")}}}else r.OK=!1,r.complete=!1,i();if(!c&&r.OK&&(r.OK=!1,r.complete=!1,i()),r.possibleNext.indexOf("a")>=0)for(var A=e.string,S=l.start;S>=0;S--)if(" "!==A[S-1]){"|"===A[S-1]||"/"===A[S-1]||"punc"===l.style||(r.lastPredicateOffset=l.start);break}return r.possibleCurrent=r.possibleNext,r.possibleNext=E(r.stack[r.stack.length-1]),l.style}var x={"*[,, object]":3,"*[(,),object]":3,"*[(,),objectPath]":3,"*[/,pathEltOrInverse]":2,object:2,objectPath:2,objectList:2,objectListPath:2,storeProperty:2,pathMod:2,"?pathMod":2,propertyListNotEmpty:1,propertyList:1,propertyListPath:1,propertyListPathNotEmpty:1,"?[verb,objectList]":1},T={"}":1,"]":1,")":1,"{":-1,"(":-1,"[":-1};return{token:b,startState:function(){return{tokenize:b,OK:!0,complete:t.acceptEmpty,errorStartPos:void 0,errorEndPos:void 0,queryType:void 0,possibleCurrent:E(t.startSymbol),possibleNext:E(t.startSymbol),allowVars:!0,allowBnodes:!0,storeProperty:!1,lastProperty:"",lastPropertyIndex:0,inLiteral:void 0,stack:[t.startSymbol],lastPredicateOffset:e.indentUnit||2,prefixes:{},variables:{},currentPnameNs:void 0,errorMsg:void 0,inPrefixDecl:!1,possibleFullIri:!1}},indent:function(t,r){var n;if(t.inLiteral)return 0;if(void 0!==t.lastPredicateOffset&&t.stack.length&&"?[or([verbPath,verbSimple]),objectListPath]"==t.stack[t.stack.length-1])return t.lastPredicateOffset;var i=0,o=t.stack.length-1;if(/^[\}\]\)]/.test(r)){for(var a=r.substr(0,1);o>=0;--o)if(t.stack[o]==a){--o;break}}else{var s=x[t.stack[o]];s&&(i+=s,--o)}for(;o>=0;--o){var l=T[t.stack[o]];l&&(i+=l)}return i*(null!==(n=e.indentUnit)&&void 0!==n?n:2)},electricChars:"}])"}}));const ve=me;function ye(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Ee(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ee(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function Ee(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&void 0!==arguments[1]?arguments[1]:{};if((0,i.A)(this,t),(r=be(this,t)).autocompleters={},r.prevQueryValid=!1,r.queryValid=!0,r.superagent=u,r.handleHashChange=function(){var e,t;null===(t=(e=r.config).consumeShareLink)||void 0===t||t.call(e,r)},r.notificationEls={},!e)throw new Error("No parent passed as argument. Dont know where to draw YASQE");r.rootEl=document.createElement("div"),r.rootEl.className="yasqe",e.appendChild(r.rootEl),r.config=(0,A.A)({},t.defaults,n);var o,a=ve(r.rootEl,r.config),s=ye(Object.getOwnPropertyNames(t.prototype));try{for(s.s();!(o=s.n()).done;){var l=o.value;a[l]=t.prototype[l].bind(r)}}catch(e){s.e(e)}finally{s.f()}Object.assign(r,ve.prototype,a),r.storage=new v.wc(t.storageNamespace),r.drawButtons();var c=r.getStorageId();if(c){var p=r.storage.get(c);r.persistentConfig=p&&"string"==typeof p?{query:p,editorHeight:r.config.editorHeight}:p,r.persistentConfig||(r.persistentConfig={query:r.getValue(),editorHeight:r.config.editorHeight}),r.persistentConfig&&r.persistentConfig.query&&r.setValue(r.persistentConfig.query)}return r.config.autocompleters.forEach((function(e){return r.enableCompleter(e).then((function(){}),console.warn)})),r.config.consumeShareLink&&(r.config.consumeShareLink(r),window.addEventListener("hashchange",r.handleHashChange)),r.checkSyntax(),r.persistentConfig&&r.persistentConfig.editorHeight?r.getWrapperElement().style.height=r.persistentConfig.editorHeight:r.config.editorHeight&&(r.getWrapperElement().style.height=r.config.editorHeight),r.config.resizeable&&r.drawResizer(),r.config.collapsePrefixesOnLoad&&r.collapsePrefixes(!0),r.registerEventListeners(),r}return(0,l.A)(t,e),(0,o.A)(t,[{key:"handleChange",value:function(){this.checkSyntax(),this.updateQueryButton()}},{key:"handleBlur",value:function(){this.saveQuery()}},{key:"handleChanges",value:function(){this.checkSyntax(),this.updateQueryButton()}},{key:"handleCursorActivity",value:function(){this.autocomplete(!0)}},{key:"handleQuery",value:function(e,t){this.req=t,this.updateQueryButton()}},{key:"handleQueryResponse",value:function(e,t,r){this.lastQueryDuration=r,this.req=void 0,this.updateQueryButton()}},{key:"handleQueryAbort",value:function(e,t){this.req=void 0,this.updateQueryButton()}},{key:"registerEventListeners",value:function(){this.on("change",this.handleChange),this.on("blur",this.handleBlur),this.on("changes",this.handleChanges),this.on("cursorActivity",this.handleCursorActivity),this.on("query",this.handleQuery),this.on("queryResponse",this.handleQueryResponse),this.on("queryAbort",this.handleQueryAbort)}},{key:"unregisterEventListeners",value:function(){this.off("change",this.handleChange),this.off("blur",this.handleBlur),this.off("changes",this.handleChanges),this.off("cursorActivity",this.handleCursorActivity),this.off("query",this.handleQuery),this.off("queryResponse",this.handleQueryResponse),this.off("queryAbort",this.handleQueryAbort)}},{key:"emit",value:function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n'),s=document.createElement("button");s.className="yasqe_share",s.title="Share query",s.setAttribute("aria-label","Share query"),s.appendChild(a),t.appendChild(s),s.addEventListener("click",(function(e){return l(e)})),s.addEventListener("keydown",(function(e){"Enter"===e.code&&l(e)}));var l=function(r){r.stopPropagation();var n=document.createElement("div");n.className="yasqe_sharePopup",t.appendChild(n),document.body.addEventListener("click",(function(e){n&&e.target!==n&&!n.contains(e.target)&&(n.remove(),n=void 0)}),!0);var i=document.createElement("input");i.type="text",i.value=e.config.createShareableLink(e),i.onfocus=function(){i.select()},i.onmouseup=function(){return!1},n.innerHTML="";var o=document.createElement("div");o.className="inputWrapper",o.appendChild(i),n.appendChild(o);var s=[],l=e.config.createShortLink;if(l){n.className=n.className+=" enableShort";var u=document.createElement("button");s.push(u),u.innerHTML="Shorten",u.className="yasqe_btn yasqe_btn-sm shorten",n.appendChild(u),u.onclick=function(){s.forEach((function(e){return e.disabled=!0})),l(e,i.value).then((function(e){i.value=e,i.focus()}),(function(e){var t=document.createElement("span");t.className="shortlinkErr";var r="An error has occurred";"string"==typeof e&&0!==e.length?r=e:e.message&&0!==e.message.length&&(r=e.message),t.textContent=r,i.replaceWith(t)}))}}var c=document.createElement("button");s.push(c),c.innerText="cURL",c.className="yasqe_btn yasqe_btn-sm curl",n.appendChild(c),c.onclick=function(){s.forEach((function(e){return e.disabled=!0})),i.value=e.getAsCurlString(),i.focus(),null==n||n.appendChild(c)};var p=a.getBoundingClientRect();n.style.top=a.offsetTop+p.height+"px",n.style.left=a.offsetLeft+a.clientWidth-n.clientWidth+"px",i.focus()}}if(this.config.showQueryButton){this.queryBtn=document.createElement("button"),(0,v.iQ)(this.queryBtn,"yasqe_queryButton");var u=(0,v.Mg)('');(0,v.iQ)(u,"queryIcon"),this.queryBtn.appendChild(u);var c=(0,v.Mg)(R);(0,v.iQ)(c,"warningIcon"),this.queryBtn.appendChild(c),this.queryBtn.onclick=function(){e.config.queryingDisabled||(e.req?e.abortQuery():e.query().catch((function(){})))},this.queryBtn.title="Run query",this.queryBtn.setAttribute("aria-label","Run query"),t.appendChild(this.queryBtn),this.updateQueryButton()}}},{key:"drawResizer",value:function(){if(!this.resizeWrapper){this.resizeWrapper=document.createElement("div"),(0,v.iQ)(this.resizeWrapper,"resizeWrapper");var e=document.createElement("div");(0,v.iQ)(e,"resizeChip"),this.resizeWrapper.appendChild(e),this.resizeWrapper.addEventListener("mousedown",this.initDrag,!1),this.resizeWrapper.addEventListener("dblclick",this.expandEditor),this.rootEl.appendChild(this.resizeWrapper)}}},{key:"initDrag",value:function(){document.documentElement.addEventListener("mousemove",this.doDrag,!1),document.documentElement.addEventListener("mouseup",this.stopDrag,!1)}},{key:"calculateDragOffset",value:function(e,t){var r=0;t.offsetParent&&(r=t.offsetParent.offsetTop);for(var n=0,i=t.parentElement;i;)n+=i.scrollTop,i=i.parentElement;return e.clientY-r-this.rootEl.offsetTop+n}},{key:"doDrag",value:function(e){this.getWrapperElement().style.height=this.calculateDragOffset(e,this.rootEl)+"px"}},{key:"stopDrag",value:function(){document.documentElement.removeEventListener("mousemove",this.doDrag,!1),document.documentElement.removeEventListener("mouseup",this.stopDrag,!1),this.emit("resize",this.getWrapperElement().style.height),this.getStorageId()&&this.persistentConfig&&(this.persistentConfig.editorHeight=this.getWrapperElement().style.height,this.saveQuery()),this.refresh()}},{key:"duplicateLine",value:function(){var e=this.getDoc().getCursor();if(e){var t=this.getDoc().getLine(e.line);this.getDoc().replaceRange(t+"\n"+t,{ch:0,line:e.line},{ch:t.length,line:e.line})}}},{key:"updateQueryButton",value:function(e){this.queryBtn&&(this.config.queryingDisabled?((0,v.iQ)(this.queryBtn,"query_disabled"),this.queryBtn.title=this.config.queryingDisabled):((0,v.vy)(this.queryBtn,"query_disabled"),this.queryBtn.title="Run query",this.queryBtn.setAttribute("aria-label","Run query")),e||(e=this.queryValid?"valid":"error"),e!=this.queryStatus&&((0,v.vy)(this.queryBtn,"query_"+this.queryStatus),(0,v.iQ)(this.queryBtn,"query_"+e),this.queryStatus=e),this.req&&this.queryBtn.className.indexOf("busy")<0&&(this.queryBtn.className=this.queryBtn.className+=" busy"),!this.req&&this.queryBtn.className.indexOf("busy")>=0&&(this.queryBtn.className=this.queryBtn.className.replace("busy","")))}},{key:"handleLocalStorageQuotaFull",value:function(e){console.warn("Localstorage quota exceeded. Clearing all queries"),t.clearStorage()}},{key:"saveQuery",value:function(){var e=this.getStorageId();e&&this.persistentConfig&&(this.persistentConfig.query=this.getValue(),this.storage.set(e,this.persistentConfig,this.config.persistencyExpire,this.handleLocalStorageQuotaFull))}},{key:"getQueryType",value:function(){return this.getOption("queryType")}},{key:"getQueryMode",value:function(){switch(this.getQueryType()){case"INSERT":case"DELETE":case"LOAD":case"CLEAR":case"CREATE":case"DROP":case"COPY":case"MOVE":case"ADD":return"update";default:return"query"}}},{key:"getVariablesFromQuery",value:function(){var e=this.getTokenAt({line:this.getDoc().lastLine(),ch:this.getDoc().getLine(this.getDoc().lastLine()).length},!0),t=[];for(var r in e.state.variables)t.push(r);return t.sort()}},{key:"autoformatSelection",value:function(e,r){var n=this.getValue();return n=n.substring(e,r),t.autoformatString(n)}},{key:"commentLines",value:function(){for(var e=this.getDoc().getCursor("start").line,t=this.getDoc().getCursor("end").line,r=Math.min(e,t),n=Math.max(e,t),i=!0,o=r;o<=n;o++){var a=this.getDoc().getLine(o);if(0==a.length||"#"!=a.substring(0,1)){i=!1;break}}for(o=r;o<=n;o++)i?this.getDoc().replaceRange("",{line:o,ch:0},{line:o,ch:1}):this.getDoc().replaceRange("#",{line:o,ch:0})}},{key:"autoformat",value:function(){var e=this;this.getDoc().somethingSelected()||this.execCommand("selectAll");var t=this.getDoc().getCursor("start"),r={line:this.getDoc().getCursor("end").line,ch:this.getDoc().getSelection().length},n=this.getDoc().indexFromPos(t),i=this.getDoc().indexFromPos(r),o=this.autoformatSelection(n,i);this.operation((function(){e.getDoc().replaceRange(o,t,r);for(var i=e.getDoc().posFromIndex(n).line,a=e.getDoc().posFromIndex(n+o.length).line,s=i;s<=a;s++)e.indentLine(s,"smart")}))}},{key:"getQueryWithValues",value:function(e){if(!e)return this.getValue();var r;if("string"==typeof e)r=e;else{e instanceof Array||(e=[e]);var n=e.reduce((function(e,t){for(var r in t)e[r]=r;return e}),{}),i=[];for(var o in n)i.push(o);if(!i.length)return this.getValue();r="VALUES ("+i.join(" ")+") {\n",e.forEach((function(e){r+="( ",i.forEach((function(t){r+=e[t]||"UNDEF"})),r+=" )\n"})),r+="}\n"}if(!r)return this.getValue();var a="",s=!1,l=!1;return t.runMode(this.getValue(),"sparql11",(function(e,t,n,i,o){"keyword"===t&&"select"===e.toLowerCase()&&(l=!0),a+=e,l&&!s&&"punc"===t&&"{"===e&&(s=!0,a+="\n"+r)})),a}},{key:"getValueWithoutComments",value:function(){var e="";return t.runMode(this.getValue(),"sparql11",(function(t,r){"comment"!=r&&(e+=t)})),e}},{key:"setCheckSyntaxErrors",value:function(e){this.config.syntaxErrorCheck=e,this.checkSyntax()}},{key:"checkSyntax",value:function(){this.queryValid=!0,this.clearGutter("gutterErrorBar");for(var e=0;e0){var l=[];n.possibleCurrent.forEach((function(e){l.push(""+(0,ge.A)(e)+"")})),E(0,s,"This line is invalid. Expected: "+l.join(", "))}s.className="parseErrorIcon",this.setGutterMarker(e,"gutterErrorBar",s),this.queryValid=!1;break}}}},{key:"getCompleteToken",value:function(e,t){return d(this,e,t)}},{key:"getPreviousNonWsToken",value:function(e,t){return function e(t,r,n){var i=t.getTokenAt({line:r,ch:n.start});return null!=i&&"ws"==i.type&&(i=e(t,r,i)),i}(this,e,t)}},{key:"getNextNonWsToken",value:function(e,t){return f(this,e,t)}},{key:"showNotification",value:function(e,t){if(!this.notificationEls[e]){var r=document.createElement("div");(0,v.iQ)(r,"notificationContainer"),this.getWrapperElement().appendChild(r),this.notificationEls[e]=document.createElement("div"),(0,v.iQ)(this.notificationEls[e],"notification","notif_"+e),r.appendChild(this.notificationEls[e])}for(var n in this.notificationEls)n!==e&&this.hideNotification(n);var i=this.notificationEls[e];(0,v.iQ)(i,"active"),i.innerText=t}},{key:"hideNotification",value:function(e){this.notificationEls[e]&&(0,v.vy)(this.notificationEls[e],"active")}},{key:"enableCompleter",value:function(e){return t.Autocompleters[e]?(this.config.autocompleters.indexOf(e)<0&&this.config.autocompleters.push(e),(this.autocompleters[e]=new ce(this,t.Autocompleters[e])).initialize()):Promise.reject(new Error("Autocompleter "+e+" is not a registered autocompleter"))}},{key:"disableCompleter",value:function(e){this.config.autocompleters=this.config.autocompleters.filter((function(t){return t!==e})),this.autocompleters[e]=void 0}},{key:"autocomplete",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this.getDoc().somethingSelected())for(var t in this.config.autocompleters){var r=this.autocompleters[this.config.autocompleters[t]];r&&r.autocomplete(e)}}},{key:"collapsePrefixes",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=h(this);void 0!==t&&this.foldCode(t,ve.fold.prefix,e?"fold":"unfold")}},{key:"getPrefixesFromQuery",value:function(){return(e=this).getTokenAt({line:e.getDoc().lastLine(),ch:e.getDoc().getLine(e.getDoc().lastLine()).length},!0).state.prefixes;var e}},{key:"addPrefixes",value:function(e){return function(e,t){var r=e.getPrefixesFromQuery();if("string"==typeof t)m(e,t);else for(var n in t)n in r||m(e,n+": <"+t[n]+">");e.collapsePrefixes(!1)}(this,e)}},{key:"removePrefixes",value:function(e){return function(e,t){for(var r in t)e.setValue(e.getValue().replace(new RegExp("PREFIX\\s*"+r+":\\s*"+(("<"+t[r]+">").replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")+"\\s*"),"ig"),""));e.collapsePrefixes(!1)}(this,e)}},{key:"updateWidget",value:function(){if(this.cursorCoords&&this.state.completionActive&&this.state.completionActive.widget){var e=this.cursorCoords(null).bottom;this.state.completionActive.widget.hints.style.top=e+"px"}}},{key:"query",value:function(e){return this.config.queryingDisabled?Promise.reject("Querying is disabled."):(this.abortQuery(),C(this,e))}},{key:"getUrlParams",value:function(){var e={};return window.location.hash.length>1&&(e=y.parse(location.hash)),e&&"query"in e||!(window.location.search.length>1)||(e=y.parse(window.location.search)),e}},{key:"configToQueryParams",value:function(){var e={};return window.location.hash.length>1&&(e=y.parse(window.location.hash)),e.query=this.getValue(),e}},{key:"queryParamsToConfig",value:function(e){e&&e.query&&"string"==typeof e.query&&this.setValue(e.query)}},{key:"getAsCurlString",value:function(e){return w(this,e)}},{key:"abortQuery",value:function(){this.req&&(this.req.abort(),this.emit("queryAbort",this,this.req))}},{key:"expandEditor",value:function(){this.setSize(null,"100%")}},{key:"destroy",value:function(){var e,t;for(var r in this.abortQuery(),this.unregisterEventListeners(),null===(e=this.resizeWrapper)||void 0===e||e.removeEventListener("mousedown",this.initDrag,!1),null===(t=this.resizeWrapper)||void 0===t||t.removeEventListener("dblclick",this.expandEditor),this.autocompleters)this.disableCompleter(r);window.removeEventListener("hashchange",this.handleHashChange),this.rootEl.remove()}}],[{key:"autoformatString",value:function(e){var r=[["keyword","ws","string-2","ws","variable-3"],["keyword","ws","variable-3"]],n=["}"],i="",o="",a=[];return t.runMode(e,"sparql11",(function(e,t){a.push(t);var s=function(e){if("{"===e)return 1;if("."===e)return 1;if(";"===e)return a.length>2&&"punc"===a[a.length-2]?0:1;for(var t=0;t1&&void 0!==arguments[1])||arguments[1],n=e.name;t.Autocompleters[n]=e,r&&t.defaults.autocompleters.indexOf(n)<0&&t.defaults.autocompleters.push(n)}},{key:"forkAutocompleter",value:function(e,r){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(!t.Autocompleters[e])throw new Error("Autocompleter "+e+" does not exist");if(!(null==r?void 0:r.name))throw new Error("Expected a name for newly registered autocompleter");var i=r.name;t.Autocompleters[i]=Object.assign(Object.assign({},t.Autocompleters[e]),r),n&&t.defaults.autocompleters.indexOf(i)<0&&t.defaults.autocompleters.push(i)}}])}(ve);xe.storageNamespace="triply",xe.Sparql=n,xe.runMode=ve.runMode,xe.Autocompleters={},xe.defaults=function(){var e=(0===window.location.protocol.indexOf("http")?"//":"http://")+"prefix.cc/popular/all.file.json",t=r(1719),n={mode:"sparql11",value:"PREFIX rdf: \nPREFIX rdfs: \nSELECT * WHERE {\n ?sub ?pred ?obj .\n} LIMIT 10",highlightSelectionMatches:{showToken:/\w/},tabMode:"indent",lineNumbers:!0,lineWrapping:!0,foldGutter:{rangeFinder:new t.fold.combine(t.fold.brace,t.fold.prefix)},collapsePrefixesOnLoad:!1,gutters:["gutterErrorBar","CodeMirror-linenumbers","CodeMirror-foldgutter"],matchBrackets:!0,fixedGutter:!0,syntaxErrorCheck:!0,autocompleters:[],extraKeys:{"Ctrl-Space":function(e){e.autocomplete()},"Shift-Ctrl-K":function(e){var t=e,r=t.getDoc().getCursor().line;return r===t.getDoc().lastLine()&&r>1?t.getDoc().replaceRange("",{ch:t.getDoc().getLine(r-1).length,line:r-1},{ch:t.getDoc().getLine(r).length,line:r}):t.getDoc().replaceRange("",{ch:0,line:r},{ch:0,line:r+1})},"Ctrl-/":function(e){e.commentLines()},"Shift-Ctrl-D":function(e){e.duplicateLine()},"Shift-Ctrl-F":function(e){e.autoformat()},"Ctrl-S":function(e){e.saveQuery()},"Cmd-Enter":function(e){e.query().catch((function(){}))},"Ctrl-Enter":function(e){e.query().catch((function(){}))},Esc:function(e){e.getInputField().blur()}},createShareableLink:function(e){return document.location.protocol+"//"+document.location.host+document.location.pathname+document.location.search+"#"+y.stringify(e.configToQueryParams())},pluginButtons:void 0,createShortLink:void 0,consumeShareLink:function(e){e.queryParamsToConfig(e.getUrlParams())},persistenceId:function(e){var t="",r=e.rootEl;for(r.id&&(t=r.id);r&&r!==document;r=r.parentNode)if(r){r.id&&(t=r.id);break}return"yasqe_"+t+"_query"},persistencyExpire:2592e3,showQueryButton:!0,hintConfig:{},resizeable:!0,editorHeight:"300px",queryingDisabled:void 0,prefixCcApi:e},i={queryArgument:void 0,endpoint:"https://dbpedia.org/sparql",method:"POST",acceptHeaderGraph:"application/n-triples,*/*;q=0.9",acceptHeaderSelect:"application/sparql-results+json,*/*;q=0.9",acceptHeaderUpdate:"text/plain,*/*;q=0.9",namedGraphs:[],defaultGraphs:[],args:[],headers:{},withCredentials:!1,adjustQueryBeforeRequest:!1};return Object.assign(Object.assign({},n),{requestConfig:i})}(),Object.assign(ve.prototype,xe.prototype),he.forEach((function(e){xe.registerAutocompleter(e)}));const Te=xe},4175:(e,t,r)=>{"use strict";r.d(t,{default:()=>Gt});var n=r(4360),i=r(9121),o=r(4758),a=r(365),s=r(8782),l=r(9604),u=r(232),c=r.n(u),p=r(4785),d=r(7440),f=r(2965),h=0;const g=function(e){var t=++h;return(0,f.A)(e)+t};var m=r(6422),v=r(3074);const y=function(e,t){var r=[];return(0,v.A)(e,(function(e,n,i){t(e,n,i)&&r.push(e)})),r};var E=r(5955),b=r(8285);const x=function(e,t){return((0,b.A)(e)?m.A:y)(e,(0,E.A)(t,3))};var T=r(5200);var A=r(3111);function S(e,t){if("string"==typeof e){var r=JSON.parse(e);if(t)for(var i in r.results.bindings)r.results.bindings[i]=t(r.results.bindings[i]);return r}if("object"==(0,n.A)(e)&&e.constructor==={}.constructor){if(t&&e.results)for(var o in e.results.bindings)e.results.bindings[o]=t(e.results.bindings[o]);return e}throw new Error("Could not parse json")}var L=r(5582),N=r.n(L),C="http://www.w3.org/1999/02/22-rdf-syntax-ns#",I="http://www.w3.org/2001/XMLSchema#",_="http://www.w3.org/2000/10/swap/";const w={xsd:{decimal:"".concat(I,"decimal"),boolean:"".concat(I,"boolean"),double:"".concat(I,"double"),integer:"".concat(I,"integer"),string:"".concat(I,"string")},rdf:{type:"".concat(C,"type"),nil:"".concat(C,"nil"),first:"".concat(C,"first"),rest:"".concat(C,"rest"),langString:"".concat(C,"langString")},owl:{sameAs:"http://www.w3.org/2002/07/owl#sameAs"},r:{forSome:"".concat(_,"reify#forSome"),forAll:"".concat(_,"reify#forAll")},log:{implies:"".concat(_,"log#implies")}};function R(e){return(R="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function O(e,t){for(var r=0;r\\"\{\}\|\^\`]/,j={_iri:!0,_unescapedIri:!0,_simpleQuotedString:!0,_langcode:!0,_blank:!0,_newline:!0,_comment:!0,_whitespace:!0,_endOfFile:!0},G=/$0^/,B=function(){return e=function e(t){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),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]*)?$/,t=t||{},this._lineMode=!!t.lineMode)for(var r in this._n3Mode=!1,this)!(r in j)&&this[r]instanceof RegExp&&(this[r]=G);else this._n3Mode=!1!==t.n3;this._comments=!!t.comments,this._literalClosingPos=0},(t=[{key:"_tokenizeToEnd",value:function(e,t){for(var r=this._input,n=r.length;;){for(var i=void 0,o=void 0;i=this._newline.exec(r);)this._comments&&(o=this._comment.exec(i[0]))&&y("comment",o[1],"",this._line,i[0].length),r=r.substr(i[0].length,r.length),n=r.length,this._line++;if(!i&&(i=this._whitespace.exec(r))&&(r=r.substr(i[0].length,r.length)),this._endOfFile.test(r))return t&&(this._comments&&(o=this._comment.exec(r))&&y("comment",o[1],"",this._line,r.length),r=null,y("eof","","",this._line,0)),this._input=r;var a=this._line,s=r[0],l="",u="",c="",p=null,d=0,f=!1;switch(s){case"^":if(r.length<3)break;if("^"!==r[1]){this._n3Mode&&(d=1,l="^");break}if(this._previousMarker="^^","<"!==(r=r.substr(2))[0]){f=!0;break}case"<":if(p=this._unescapedIri.exec(r))l="IRI",u=p[1];else if(p=this._iri.exec(r)){if(null===(u=this._unescape(p[1]))||F.test(u))return E(this);l="IRI"}else r.length>1&&"<"===r[1]?(l="<<",d=2):this._n3Mode&&r.length>1&&"="===r[1]&&(l="inverse",d=2,u=">");break;case">":r.length>1&&">"===r[1]&&(l=">>",d=2);break;case"_":((p=this._blank.exec(r))||t&&(p=this._blank.exec("".concat(r," "))))&&(l="blank",c="_",u=p[1]);break;case'"':if(p=this._simpleQuotedString.exec(r))u=p[1];else{var h=this._parseLiteral(r);if(u=h.value,d=h.matchLength,null===u)return E(this)}null===p&&0===d||(l="literal",this._literalClosingPos=0);break;case"'":if(!this._lineMode){if(p=this._simpleApostropheString.exec(r))u=p[1];else{var g=this._parseLiteral(r);if(u=g.value,d=g.matchLength,null===u)return E(this)}null===p&&0===d||(l="literal",this._literalClosingPos=0)}break;case"?":this._n3Mode&&(p=this._variable.exec(r))&&(l="var",u=p[0]);break;case"@":"literal"===this._previousMarker&&(p=this._langcode.exec(r))?(l="langcode",u=p[1]):(p=this._keyword.exec(r))&&(l=p[0]);break;case".":if(1===r.length?t:r[1]<"0"||r[1]>"9"){l=".",d=1;break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"+":case"-":(p=this._number.exec(r)||t&&(p=this._number.exec("".concat(r," "))))&&(l="literal",u=p[0],c="string"==typeof p[1]?P.double:"string"==typeof p[2]?P.decimal:P.integer);break;case"B":case"b":case"p":case"P":case"G":case"g":(p=this._sparqlKeyword.exec(r))?l=p[0].toUpperCase():f=!0;break;case"f":case"t":(p=this._boolean.exec(r))?(l="literal",u=p[0],c=P.boolean):f=!0;break;case"a":(p=this._shortPredicates.exec(r))?(l="abbreviation",u="a"):f=!0;break;case"=":this._n3Mode&&r.length>1&&(l="abbreviation",">"!==r[1]?(d=1,u="="):(d=2,u=">"));break;case"!":if(!this._n3Mode)break;case",":case";":case"[":case"]":case"(":case")":case"}":this._lineMode||(d=1,l=s);break;case"{":!this._lineMode&&r.length>=2&&("|"===r[1]?(l="{|",d=2):(l=s,d=1));break;case"|":r.length>=2&&"}"===r[1]&&(l="|}",d=2);break;default:f=!0}if(f&&("@prefix"!==this._previousMarker&&"PREFIX"!==this._previousMarker||!(p=this._prefix.exec(r))?((p=this._prefixed.exec(r))||t&&(p=this._prefixed.exec("".concat(r," "))))&&(l="prefixed",c=p[1]||"",u=this._unescape(p[2])):(l="prefix",u=p[1]||"")),"^^"===this._previousMarker)switch(l){case"prefixed":l="type";break;case"IRI":l="typeIRI";break;default:l=""}if(!l)return t||!/^'''|^"""/.test(r)&&/\n|\r/.test(r)?E(this):this._input=r;var m=d||p[0].length,v=y(l,u,c,a,m);this.previousToken=v,this._previousMarker=l,r=r.substr(m,r.length)}function y(t,i,o,a,s){var l=r?n-r.length:n,u={type:t,value:i,prefix:o,line:a,start:l,end:l+s};return e(null,u),u}function E(t){e(t._syntaxError(/^\S*/.exec(r)[0]))}}},{key:"_unescape",value:function(e){var t=!1,r=e.replace(k,(function(e,r,n,i){if("string"==typeof r)return String.fromCharCode(Number.parseInt(r,16));if("string"==typeof n){var o=Number.parseInt(n,16);return o<=65535?String.fromCharCode(Number.parseInt(n,16)):String.fromCharCode(55296+((o-=65536)>>10),56320+(1023&o))}return i in M?M[i]:(t=!0,"")}));return t?null:r}},{key:"_parseLiteral",value:function(e){if(e.length>=3){for(var t=e.match(/^(?:"""|"|'''|'|)/)[0],r=t.length,n=Math.max(this._literalClosingPos,r);(n=e.indexOf(t,n))>0;){for(var i=0;"\\"===e[n-i-1];)i++;if(i%2==0){var o=e.substring(r,n),a=o.split(/\r\n|\r|\n/).length-1,s=n+r;if(1===r&&0!==a||3===r&&this._lineMode)break;return this._line+=a,{value:this._unescape(o),matchLength:s}}n++}this._literalClosingPos=e.length-r+1}return{value:"",matchLength:0}}},{key:"_syntaxError",value:function(e){this._input=null;var t=new Error('Unexpected "'.concat(e,'" on line ').concat(this._line,"."));return t.context={token:void 0,line:this._line,previousToken:this.previousToken},t}},{key:"_readStartingBom",value:function(e){return e.startsWith("\ufeff")?e.substr(1):e}},{key:"tokenize",value:function(e,t){var r=this;if(this._line=1,"string"==typeof e){if(this._input=this._readStartingBom(e),"function"!=typeof t){var n,i=[];if(this._tokenizeToEnd((function(e,t){return e?n=e:i.push(t)}),!0),n)throw n;return i}N()((function(){return r._tokenizeToEnd(t,!0)}))}else this._pendingBuffer=null,"function"==typeof e.setEncoding&&e.setEncoding("utf8"),e.on("data",(function(e){null!==r._input&&0!==e.length&&(r._pendingBuffer&&(e=Buffer.concat([r._pendingBuffer,e]),r._pendingBuffer=null),128&e[e.length-1]?r._pendingBuffer=e:(void 0===r._input?r._input=r._readStartingBom("string"==typeof e?e:e.toString()):r._input+=e,r._tokenizeToEnd(t,!1)))})),e.on("end",(function(){"string"==typeof r._input&&r._tokenizeToEnd(t,!0)})),e.on("error",t)}}])&&O(e.prototype,t),r&&O(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}();function U(e){return(U="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function H(e,t,r){return t=V(t),q(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,r||[],V(e).constructor):t.apply(e,r))}function q(e,t){if(t&&("object"===U(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function V(e){return(V=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function W(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&z(e,t)}function z(e,t){return(z=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function Q(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function X(e,t){for(var r=0;r0?"INF":"-INF"))));return""===r||r===Z.string?new oe('"'.concat(e,'"')):new oe('"'.concat(e,'"^^').concat(r))},defaultGraph:function(){return K},quad:ue,triple:ue};const re=te;var ne=function(){function e(t){Q(this,e),this.id=t}return $(e,[{key:"value",get:function(){return this.id}},{key:"equals",value:function(t){return t instanceof e?this.id===t.id:!!t&&this.termType===t.termType&&this.value===t.value}},{key:"hashCode",value:function(){return 0}},{key:"toJSON",value:function(){return{termType:this.termType,value:this.value}}}])}(),ie=function(e){function t(){return Q(this,t),H(this,t,arguments)}return W(t,e),$(t,[{key:"termType",get:function(){return"NamedNode"}}])}(ne),oe=function(e){function t(){return Q(this,t),H(this,t,arguments)}return W(t,e),$(t,[{key:"termType",get:function(){return"Literal"}},{key:"value",get:function(){return this.id.substring(1,this.id.lastIndexOf('"'))}},{key:"language",get:function(){var e=this.id,t=e.lastIndexOf('"')+1;return t=0&&(e=e.substr(0,t)),this._base=e,this._basePath=e.indexOf("/")<0?e:e.replace(/[^\/?]*(?:\?.*)?$/,""),e=e.match(/^(?:([a-z][a-z0-9+.-]*:))?(?:\/\/[^\/]*)?/i),this._baseRoot=e[0],this._baseScheme=e[1]}else this._base="",this._basePath=""}},{key:"_saveContext",value:function(e,t,r,n,i){var o=this._n3Mode;this._contextStack.push({type:e,subject:r,predicate:n,object:i,graph:t,inverse:!!o&&this._inversePredicate,blankPrefix:o?this._prefixes._:"",quantified:o?this._quantified:null}),o&&(this._inversePredicate=!1,this._prefixes._=this._graph?"".concat(this._graph.value,"."):".",this._quantified=Object.create(this._quantified))}},{key:"_restoreContext",value:function(e,t){var r=this._contextStack.pop();if(!r||r.type!==e)return this._error("Unexpected ".concat(t.type),t);this._subject=r.subject,this._predicate=r.predicate,this._object=r.object,this._graph=r.graph,this._n3Mode&&(this._inversePredicate=r.inverse,this._prefixes._=r.blankPrefix,this._quantified=r.quantified)}},{key:"_readInTopContext",value:function(e){switch(e.type){case"eof":return null!==this._graph?this._error("Unclosed graph",e):(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(e)}}},{key:"_readEntity",value:function(e,t){var r;switch(e.type){case"IRI":case"typeIRI":var n=this._resolveIRI(e.value);if(null===n)return this._error("Invalid IRI",e);r=this._namedNode(n);break;case"type":case"prefixed":var i=this._prefixes[e.prefix];if(void 0===i)return this._error('Undefined prefix "'.concat(e.prefix,':"'),e);r=this._namedNode(i+e.value);break;case"blank":r=this._blankNode(this._prefixes[e.prefix]+e.value);break;case"var":r=this._variable(e.value.substr(1));break;default:return this._error("Expected entity but got ".concat(e.type),e)}return!t&&this._n3Mode&&r.id in this._quantified&&(r=this._quantified[r.id]),r}},{key:"_readSubject",value:function(e){switch(this._predicate=null,e.type){case"[":return this._saveContext("blank",this._graph,this._subject=this._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._blankNode(),null,null),this._readSubject):this._error("Unexpected graph",e);case"}":return this._readPunctuation(e);case"@forSome":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORSOME,this._quantifier=this._blankNode,this._readQuantifierList):this._error('Unexpected "@forSome"',e);case"@forAll":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORALL,this._quantifier=this._variable,this._readQuantifierList):this._error('Unexpected "@forAll"',e);case"literal":if(!this._n3Mode)return this._error("Unexpected literal",e);if(0===e.prefix.length)return this._literalValue=e.value,this._completeSubjectLiteral;this._subject=this._literal(e.value,this._namedNode(e.prefix));break;case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,null,null,null),this._graph=null,this._readSubject):this._error("Unexpected RDF* syntax",e);default:if(void 0===(this._subject=this._readEntity(e)))return;if(this._n3Mode)return this._getPathReader(this._readPredicateOrNamedGraph)}return this._readPredicateOrNamedGraph}},{key:"_readPredicate",value:function(e){var t=e.type;switch(t){case"inverse":this._inversePredicate=!0;case"abbreviation":this._predicate=this.ABBREVIATIONS[e.value];break;case".":case"]":case"}":return null===this._predicate?this._error("Unexpected ".concat(t),e):(this._subject=null,"]"===t?this._readBlankNodeTail(e):this._readPunctuation(e));case";":return null!==this._predicate?this._readPredicate:this._error("Expected predicate but got ;",e);case"[":if(this._n3Mode)return this._saveContext("blank",this._graph,this._subject,this._subject=this._blankNode(),null),this._readBlankNodeHead;case"blank":if(!this._n3Mode)return this._error("Disallowed blank node as predicate",e);default:if(void 0===(this._predicate=this._readEntity(e)))return}return this._readObject}},{key:"_readObject",value:function(e){switch(e.type){case"literal":if(0===e.prefix.length)return this._literalValue=e.value,this._readDataTypeOrLang;this._object=this._literal(e.value,this._namedNode(e.prefix));break;case"[":return this._saveContext("blank",this._graph,this._subject,this._predicate,this._subject=this._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._blankNode()),this._readSubject):this._error("Unexpected graph",e);case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,this._subject,this._predicate,null),this._graph=null,this._readSubject):this._error("Unexpected RDF* syntax",e);default:if(void 0===(this._object=this._readEntity(e)))return;if(this._n3Mode)return this._getPathReader(this._getContextEndReader())}return this._getContextEndReader()}},{key:"_readPredicateOrNamedGraph",value:function(e){return"{"===e.type?this._readGraph(e):this._readPredicate(e)}},{key:"_readGraph",value:function(e){return"{"!==e.type?this._error("Expected graph but got ".concat(e.type),e):(this._graph=this._subject,this._subject=null,this._readSubject)}},{key:"_readBlankNodeHead",value:function(e){return"]"===e.type?(this._subject=null,this._readBlankNodeTail(e)):(this._predicate=null,this._readPredicate(e))}},{key:"_readBlankNodeTail",value:function(e){if("]"!==e.type)return this._readBlankNodePunctuation(e);null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph);var t=null===this._predicate;return this._restoreContext("blank",e),null!==this._object?this._getContextEndReader():null!==this._predicate?this._readObject:t?this._readPredicateOrNamedGraph:this._readPredicateAfterBlank}},{key:"_readPredicateAfterBlank",value:function(e){switch(e.type){case".":case"}":return this._subject=null,this._readPunctuation(e);default:return this._readPredicate(e)}}},{key:"_readListItem",value:function(e){var t=null,r=null,n=this._readListItem,i=this._subject,o=this._contextStack,a=o[o.length-1];switch(e.type){case"[":this._saveContext("blank",this._graph,r=this._blankNode(),this.RDF_FIRST,this._subject=t=this._blankNode()),n=this._readBlankNodeHead;break;case"(":this._saveContext("list",this._graph,r=this._blankNode(),this.RDF_FIRST,this.RDF_NIL),this._subject=null;break;case")":if(this._restoreContext("list",e),0!==o.length&&"list"===o[o.length-1].type&&this._emit(this._subject,this._predicate,this._object,this._graph),null===this._predicate){if(n=this._readPredicate,this._subject===this.RDF_NIL)return n}else if(n=this._getContextEndReader(),this._object===this.RDF_NIL)return n;r=this.RDF_NIL;break;case"literal":0===e.prefix.length?(this._literalValue=e.value,n=this._readListItemDataTypeOrLang):(t=this._literal(e.value,this._namedNode(e.prefix)),n=this._getContextEndReader());break;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._blankNode()),this._readSubject):this._error("Unexpected graph",e);default:if(void 0===(t=this._readEntity(e)))return}if(null===r&&(this._subject=r=this._blankNode()),null===i?null===a.predicate?a.subject=r:a.object=r:this._emit(i,this.RDF_REST,r,this._graph),null!==t){if(this._n3Mode&&("IRI"===e.type||"prefixed"===e.type))return this._saveContext("item",this._graph,r,this.RDF_FIRST,t),this._subject=t,this._predicate=null,this._getPathReader(this._readListItem);this._emit(r,this.RDF_FIRST,t,this._graph)}return n}},{key:"_readDataTypeOrLang",value:function(e){return this._completeObjectLiteral(e,!1)}},{key:"_readListItemDataTypeOrLang",value:function(e){return this._completeObjectLiteral(e,!0)}},{key:"_completeLiteral",value:function(e){var t=this._literal(this._literalValue);switch(e.type){case"type":case"typeIRI":var r=this._readEntity(e);if(void 0===r)return;t=this._literal(this._literalValue,r),e=null;break;case"langcode":t=this._literal(this._literalValue,e.value),e=null}return{token:e,literal:t}}},{key:"_completeSubjectLiteral",value:function(e){return this._subject=this._completeLiteral(e).literal,this._readPredicateOrNamedGraph}},{key:"_completeObjectLiteral",value:function(e,t){var r=this._completeLiteral(e);if(r)return this._object=r.literal,t&&this._emit(this._subject,this.RDF_FIRST,this._object,this._graph),null===r.token?this._getContextEndReader():(this._readCallback=this._getContextEndReader(),this._readCallback(r.token))}},{key:"_readFormulaTail",value:function(e){return"}"!==e.type?this._readPunctuation(e):(null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph),this._restoreContext("formula",e),null===this._object?this._readPredicate:this._getContextEndReader())}},{key:"_readPunctuation",value:function(e){var t,r=this._graph,n=this._subject,i=this._inversePredicate;switch(e.type){case"}":if(null===this._graph)return this._error("Unexpected graph closing",e);if(this._n3Mode)return this._readFormulaTail(e);this._graph=null;case".":this._subject=null,t=this._contextStack.length?this._readSubject:this._readInTopContext,i&&(this._inversePredicate=!1);break;case";":t=this._readPredicate;break;case",":t=this._readObject;break;case"{|":if(!this._supportsRDFStar)return this._error("Unexpected RDF* syntax",e);var o=this._predicate,a=this._object;this._subject=this._quad(n,o,a,this.DEFAULTGRAPH),t=this._readPredicate;break;case"|}":if("Quad"!==this._subject.termType)return this._error("Unexpected asserted triple closing",e);this._subject=null,t=this._readPunctuation;break;default:if(this._supportsQuads&&null===this._graph&&void 0!==(r=this._readEntity(e))){t=this._readQuadPunctuation;break}return this._error('Expected punctuation to follow "'.concat(this._object.id,'"'),e)}if(null!==n){var s=this._predicate,l=this._object;i?this._emit(l,s,n,r):this._emit(n,s,l,r)}return t}},{key:"_readBlankNodePunctuation",value:function(e){var t;switch(e.type){case";":t=this._readPredicate;break;case",":t=this._readObject;break;default:return this._error('Expected punctuation to follow "'.concat(this._object.id,'"'),e)}return this._emit(this._subject,this._predicate,this._object,this._graph),t}},{key:"_readQuadPunctuation",value:function(e){return"."!==e.type?this._error("Expected dot to follow quad",e):this._readInTopContext}},{key:"_readPrefix",value:function(e){return"prefix"!==e.type?this._error("Expected prefix to follow @prefix",e):(this._prefix=e.value,this._readPrefixIRI)}},{key:"_readPrefixIRI",value:function(e){if("IRI"!==e.type)return this._error('Expected IRI to follow prefix "'.concat(this._prefix,':"'),e);var t=this._readEntity(e);return this._prefixes[this._prefix]=t.value,this._prefixCallback(this._prefix,t),this._readDeclarationPunctuation}},{key:"_readBaseIRI",value:function(e){var t="IRI"===e.type&&this._resolveIRI(e.value);return t?(this._setBase(t),this._readDeclarationPunctuation):this._error("Expected valid IRI to follow base declaration",e)}},{key:"_readNamedGraphLabel",value:function(e){switch(e.type){case"IRI":case"blank":case"prefixed":return this._readSubject(e),this._readGraph;case"[":return this._readNamedGraphBlankLabel;default:return this._error("Invalid graph label",e)}}},{key:"_readNamedGraphBlankLabel",value:function(e){return"]"!==e.type?this._error("Invalid graph label",e):(this._subject=this._blankNode(),this._readGraph)}},{key:"_readDeclarationPunctuation",value:function(e){return this._sparqlStyle?(this._sparqlStyle=!1,this._readInTopContext(e)):"."!==e.type?this._error("Expected declaration to end with a dot",e):this._readInTopContext}},{key:"_readQuantifierList",value:function(e){var t;switch(e.type){case"IRI":case"prefixed":if(void 0!==(t=this._readEntity(e,!0)))break;default:return this._error("Unexpected ".concat(e.type),e)}return this._explicitQuantifiers?(null===this._subject?this._emit(this._graph||this.DEFAULTGRAPH,this._predicate,this._subject=this._blankNode(),this.QUANTIFIERS_GRAPH):this._emit(this._subject,this.RDF_REST,this._subject=this._blankNode(),this.QUANTIFIERS_GRAPH),this._emit(this._subject,this.RDF_FIRST,t,this.QUANTIFIERS_GRAPH)):this._quantified[t.id]=this._quantifier(this._blankNode().value),this._readQuantifierPunctuation}},{key:"_readQuantifierPunctuation",value:function(e){return","===e.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(e))}},{key:"_getPathReader",value:function(e){return this._afterPath=e,this._readPath}},{key:"_readPath",value:function(e){switch(e.type){case"!":return this._readForwardPath;case"^":return this._readBackwardPath;default:var t=this._contextStack,r=t.length&&t[t.length-1];if(r&&"item"===r.type){var n=this._subject;this._restoreContext("item",e),this._emit(this._subject,this.RDF_FIRST,n,this._graph)}return this._afterPath(e)}}},{key:"_readForwardPath",value:function(e){var t,r,n=this._blankNode();if(void 0!==(r=this._readEntity(e)))return null===this._predicate?(t=this._subject,this._subject=n):(t=this._object,this._object=n),this._emit(t,r,n,this._graph),this._readPath}},{key:"_readBackwardPath",value:function(e){var t,r,n=this._blankNode();if(void 0!==(t=this._readEntity(e)))return null===this._predicate?(r=this._subject,this._subject=n):(r=this._object,this._object=n),this._emit(n,t,r,this._graph),this._readPath}},{key:"_readRDFStarTailOrGraph",value:function(e){return">>"!==e.type?this._supportsQuads&&null===this._graph&&void 0!==(this._graph=this._readEntity(e))?this._readRDFStarTail:this._error('Expected >> to follow "'.concat(this._object.id,'"'),e):this._readRDFStarTail(e)}},{key:"_readRDFStarTail",value:function(e){if(">>"!==e.type)return this._error("Expected >> but got ".concat(e.type),e);var t=this._quad(this._subject,this._predicate,this._object,this._graph||this.DEFAULTGRAPH);return this._restoreContext("<<",e),null===this._subject?(this._subject=t,this._readPredicate):(this._object=t,this._getContextEndReader())}},{key:"_getContextEndReader",value:function(){var e=this._contextStack;if(!e.length)return this._readPunctuation;switch(e[e.length-1].type){case"blank":return this._readBlankNodeTail;case"list":return this._readListItem;case"formula":return this._readFormulaTail;case"<<":return this._readRDFStarTailOrGraph}}},{key:"_emit",value:function(e,t,r,n){this._callback(null,this._quad(e,t,r,n||this.DEFAULTGRAPH))}},{key:"_error",value:function(e,t){var r=new Error("".concat(e," on line ").concat(t.line,"."));r.context={token:t,line:t.line,previousToken:this._lexer.previousToken},this._callback(r),this._callback=ge}},{key:"_resolveIRI",value:function(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)?e:this._resolveRelativeIRI(e)}},{key:"_resolveRelativeIRI",value:function(e){if(!e.length)return this._base;switch(e[0]){case"#":return this._base+e;case"?":return this._base.replace(/(?:\?.*)?$/,e);case"/":return("/"===e[1]?this._baseScheme:this._baseRoot)+this._removeDotSegments(e);default:return/^[^/:]*:/.test(e)?null:this._removeDotSegments(this._basePath+e)}}},{key:"_removeDotSegments",value:function(e){if(!/(^|\/)\.\.?($|[/#?])/.test(e))return e;for(var t=e.length,r="",n=-1,i=-1,o=0,a="/";n=i&&(r=r.substr(0,o)),"/"!==a)return"".concat(r,"/").concat(e.substr(n+1));o=n+1}}}a=e[++n]}return r+e.substring(o)}},{key:"parse",value:function(e,t,r){var n=this;if(this._readCallback=this._readInTopContext,this._sparqlStyle=!1,this._prefixes=Object.create(null),this._prefixes._=this._blankNodePrefix?this._blankNodePrefix.substr(2):"b".concat(fe++,"_"),this._prefixCallback=r||ge,this._inversePredicate=!1,this._quantified=Object.create(null),!t){var i,o=[];if(this._callback=function(e,t){e?i=e:t&&o.push(t)},this._lexer.tokenize(e).every((function(e){return n._readCallback=n._readCallback(e)})),i)throw i;return o}this._callback=t,this._lexer.tokenize(e,(function(e,t){null!==e?(n._callback(e),n._callback=ge):n._readCallback&&(n._readCallback=n._readCallback(t))}))}}])&&pe(e.prototype,t),r&&pe(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}();function ge(){}function me(e,t){var r=t.namedNode;e._namedNode=r,e._blankNode=t.blankNode,e._literal=t.literal,e._variable=t.variable,e._quad=t.quad,e.DEFAULTGRAPH=t.defaultGraph(),e.RDF_FIRST=r(w.rdf.first),e.RDF_REST=r(w.rdf.rest),e.RDF_NIL=r(w.rdf.nil),e.N3_FORALL=r(w.r.forAll),e.N3_FORSOME=r(w.r.forSome),e.ABBREVIATIONS={a:r(w.rdf.type),"=":r(w.owl.sameAs),">":r(w.log.implies)},e.QUANTIFIERS_GRAPH=r("urn:n3:quantifiers")}function ve(e){if("NamedNode"===e.termType)return{value:e.value,type:"uri"};if("Literal"===e.termType){var t={value:e.value,type:"literal"},r=e.language;r&&(t["xml:lang"]=r);var n=e.datatypeString;return n&&(t.datatype=n),t}return"BlankNode"===e.termType?{value:e.value,type:"bnode"}:{value:e.value,type:"uri"}}function ye(e){return(new he).parse(e||"")}me(he.prototype,re);const Ee=(0,r(4636).A)({"&":"&","<":"<",">":">",""":'"',"'":"'"});var be=/&(?:amp|lt|gt|quot|#39);/g,xe=RegExp(be.source);const Te=function(e){return(e=(0,f.A)(e))&&xe.test(e)?e.replace(be,Ee):e};var Ae=r(3001),Se=r(4889),Le=r(2078),Ne=r(7242),Ce=r(6118),Ie=r(4603),_e=r(4249),we=Object.prototype.hasOwnProperty;const Re=function(e){if(null==e)return!0;if((0,Ne.A)(e)&&((0,b.A)(e)||"string"==typeof e||"function"==typeof e.splice||(0,Ce.A)(e)||(0,_e.A)(e)||(0,Le.A)(e)))return!e.length;var t=(0,Se.A)(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if((0,Ie.A)(e))return!(0,Ae.A)(e).length;for(var r in e)if(we.call(e,r))return!1;return!0};function Oe(e){for(var t={vars:[]},r=0;r=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function Ve(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);re.toFixed(r).replace(".",t):e=>(""+e).replace(".",t):r?e=>e.toFixed(r):e=>""+e}function Xe(e={}){const t="string"==typeof e.quote?e.quote:'"',r="string"==typeof e.escapedQuote?e.escapedQuote:`${t}${t}`;if(!t||t===r)return e=>e;const n=new RegExp(t,"g");return e=>(e.includes(t)&&(e=e.replace(n,r)),`${t}${e}${t}`)}new RegExp('"',"g");function $e(e={stringFormatter:Xe()}){return t=>e.stringFormatter(t.toString().slice(7,-1))}const Ye=RegExp("[^.[\\]]+|\\[(?:([^\"'][^[]*)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))","g");function Ke(e,t,r){if(t in e){const n=e[t];return void 0===n?r:n}const n=Array.isArray(t)?t:function(e){var t,r,n;const i=[];let o;for(;o=Ye.exec(e);)i.push(null!==(n=null!==(t=o[3])&&void 0!==t?t:null===(r=o[1])||void 0===r?void 0:r.trim())&&void 0!==n?n:o[0]);return i}(t);let i=e;for(const e of n)if(i=null==i?void 0:i[e],void 0===i)return r;return i}function Je(e,t){try{return Array.isArray(t)?e.push(...t):e.push(t),e}catch(r){return e.concat(t)}}function Ze(e,t){let r=!0;return e.reduce((e,n)=>(null==n&&(n=""),r?(r=!1,""+n):`${e}${t}${n}`),"")}var et,tt;!function(e){e.header="header",e[void 0]="undefined",e.boolean="boolean",e.number="number",e.bigint="bigint",e.string="string",e.symbol="symbol",e.function="function",e.object="object"}(et||(et={}));class rt{constructor(e){this.opts=this.preprocessOpts(e)}preprocessOpts(e){const t=Object.assign({},e);t.fields&&(t.fields=this.preprocessFieldsInfo(t.fields,t.defaultValue)),t.transforms=t.transforms||[];const r=t.formatters&&t.formatters.string||Xe(),n=function(e={stringFormatter:Xe()}){return t=>{if(null===t)return"";let r=JSON.stringify(t);return void 0===r?"":('"'===r[0]&&(r=r.replace(/^"(.+)"$/,"$1")),e.stringFormatter(r))}}({stringFormatter:r}),i={header:r,undefined:ze,boolean:ze,number:Qe(),bigint:ze,string:r,symbol:$e({stringFormatter:r}),function:n,object:n};return t.formatters=Object.assign(Object.assign({},i),t.formatters),t.delimiter=t.delimiter||",",t.eol=t.eol||"\n",t.header=!1!==t.header,t.includeEmptyRows=t.includeEmptyRows||!1,t.withBOM=t.withBOM||!1,t}preprocessFieldsInfo(e,t){return e.map(e=>{if("string"==typeof e)return{label:e,value:r=>Ke(r,e,t)};if("object"==typeof e){const r="default"in e?e.default:t;if("string"==typeof e.value){const t=e.value;return{label:e.label||e.value,value:e=>Ke(e,t,r)}}if("function"==typeof e.value){const t=e.label||e.value.name||"",n={label:t,default:r},i=e.value;return{label:t,value(e){const t=i(e,n);return void 0===t?r:t}}}}throw new Error("Invalid field info option. "+JSON.stringify(e))})}getHeader(){return Ze(this.opts.fields.map(e=>this.opts.formatters.header(e.label)),this.opts.delimiter)}preprocessRow(e){return this.opts.transforms.reduce((e,t)=>e.map(e=>t(e)).reduce(Je,[]),[e])}processRow(e){if(!e)return;const t=this.opts.fields.map(t=>this.processCell(e,t));return this.opts.includeEmptyRows||!t.every(e=>""===e)?Ze(t,this.opts.delimiter):void 0}processCell(e,t){return this.processValue(t.value(e))}processValue(e){return(0,this.opts.formatters[typeof e])(e)}}class nt extends rt{constructor(e){super(e)}parse(e){const t=this.preprocessData(e);this.opts.fields=this.opts.fields||this.preprocessFieldsInfo(t.reduce((e,t)=>(Object.keys(t).forEach(t=>{e.includes(t)||e.push(t)}),e),[]),this.opts.defaultValue);const r=this.opts.header?this.getHeader():"",n=this.processData(t);return(this.opts.withBOM?"\ufeff":"")+r+(r&&n?this.opts.eol:"")+n}preprocessData(e){const t=Array.isArray(e)?e:[e];if(!this.opts.fields){if(null==e||0===t.length)throw new Error('Data should not be empty or the "fields" option should be included');if("object"!=typeof t[0])throw new Error('Data items should be objects or the "fields" option should be included')}return 0===this.opts.transforms.length?t:t.map(e=>this.preprocessRow(e)).reduce(Je,[])}processData(e){return Ze(e.map(e=>this.processRow(e)).filter(e=>e),this.opts.eol)}}!function(e){e[e.BACKSPACE=8]="BACKSPACE",e[e.FORM_FEED=12]="FORM_FEED",e[e.NEWLINE=10]="NEWLINE",e[e.CARRIAGE_RETURN=13]="CARRIAGE_RETURN",e[e.TAB=9]="TAB",e[e.SPACE=32]="SPACE",e[e.EXCLAMATION_MARK=33]="EXCLAMATION_MARK",e[e.QUOTATION_MARK=34]="QUOTATION_MARK",e[e.NUMBER_SIGN=35]="NUMBER_SIGN",e[e.DOLLAR_SIGN=36]="DOLLAR_SIGN",e[e.PERCENT_SIGN=37]="PERCENT_SIGN",e[e.AMPERSAND=38]="AMPERSAND",e[e.APOSTROPHE=39]="APOSTROPHE",e[e.LEFT_PARENTHESIS=40]="LEFT_PARENTHESIS",e[e.RIGHT_PARENTHESIS=41]="RIGHT_PARENTHESIS",e[e.ASTERISK=42]="ASTERISK",e[e.PLUS_SIGN=43]="PLUS_SIGN",e[e.COMMA=44]="COMMA",e[e.HYPHEN_MINUS=45]="HYPHEN_MINUS",e[e.FULL_STOP=46]="FULL_STOP",e[e.SOLIDUS=47]="SOLIDUS",e[e.DIGIT_ZERO=48]="DIGIT_ZERO",e[e.DIGIT_ONE=49]="DIGIT_ONE",e[e.DIGIT_TWO=50]="DIGIT_TWO",e[e.DIGIT_THREE=51]="DIGIT_THREE",e[e.DIGIT_FOUR=52]="DIGIT_FOUR",e[e.DIGIT_FIVE=53]="DIGIT_FIVE",e[e.DIGIT_SIX=54]="DIGIT_SIX",e[e.DIGIT_SEVEN=55]="DIGIT_SEVEN",e[e.DIGIT_EIGHT=56]="DIGIT_EIGHT",e[e.DIGIT_NINE=57]="DIGIT_NINE",e[e.COLON=58]="COLON",e[e.SEMICOLON=59]="SEMICOLON",e[e.LESS_THAN_SIGN=60]="LESS_THAN_SIGN",e[e.EQUALS_SIGN=61]="EQUALS_SIGN",e[e.GREATER_THAN_SIGN=62]="GREATER_THAN_SIGN",e[e.QUESTION_MARK=63]="QUESTION_MARK",e[e.COMMERCIAL_AT=64]="COMMERCIAL_AT",e[e.LATIN_CAPITAL_LETTER_A=65]="LATIN_CAPITAL_LETTER_A",e[e.LATIN_CAPITAL_LETTER_B=66]="LATIN_CAPITAL_LETTER_B",e[e.LATIN_CAPITAL_LETTER_C=67]="LATIN_CAPITAL_LETTER_C",e[e.LATIN_CAPITAL_LETTER_D=68]="LATIN_CAPITAL_LETTER_D",e[e.LATIN_CAPITAL_LETTER_E=69]="LATIN_CAPITAL_LETTER_E",e[e.LATIN_CAPITAL_LETTER_F=70]="LATIN_CAPITAL_LETTER_F",e[e.LATIN_CAPITAL_LETTER_G=71]="LATIN_CAPITAL_LETTER_G",e[e.LATIN_CAPITAL_LETTER_H=72]="LATIN_CAPITAL_LETTER_H",e[e.LATIN_CAPITAL_LETTER_I=73]="LATIN_CAPITAL_LETTER_I",e[e.LATIN_CAPITAL_LETTER_J=74]="LATIN_CAPITAL_LETTER_J",e[e.LATIN_CAPITAL_LETTER_K=75]="LATIN_CAPITAL_LETTER_K",e[e.LATIN_CAPITAL_LETTER_L=76]="LATIN_CAPITAL_LETTER_L",e[e.LATIN_CAPITAL_LETTER_M=77]="LATIN_CAPITAL_LETTER_M",e[e.LATIN_CAPITAL_LETTER_N=78]="LATIN_CAPITAL_LETTER_N",e[e.LATIN_CAPITAL_LETTER_O=79]="LATIN_CAPITAL_LETTER_O",e[e.LATIN_CAPITAL_LETTER_P=80]="LATIN_CAPITAL_LETTER_P",e[e.LATIN_CAPITAL_LETTER_Q=81]="LATIN_CAPITAL_LETTER_Q",e[e.LATIN_CAPITAL_LETTER_R=82]="LATIN_CAPITAL_LETTER_R",e[e.LATIN_CAPITAL_LETTER_S=83]="LATIN_CAPITAL_LETTER_S",e[e.LATIN_CAPITAL_LETTER_T=84]="LATIN_CAPITAL_LETTER_T",e[e.LATIN_CAPITAL_LETTER_U=85]="LATIN_CAPITAL_LETTER_U",e[e.LATIN_CAPITAL_LETTER_V=86]="LATIN_CAPITAL_LETTER_V",e[e.LATIN_CAPITAL_LETTER_W=87]="LATIN_CAPITAL_LETTER_W",e[e.LATIN_CAPITAL_LETTER_X=88]="LATIN_CAPITAL_LETTER_X",e[e.LATIN_CAPITAL_LETTER_Y=89]="LATIN_CAPITAL_LETTER_Y",e[e.LATIN_CAPITAL_LETTER_Z=90]="LATIN_CAPITAL_LETTER_Z",e[e.LEFT_SQUARE_BRACKET=91]="LEFT_SQUARE_BRACKET",e[e.REVERSE_SOLIDUS=92]="REVERSE_SOLIDUS",e[e.RIGHT_SQUARE_BRACKET=93]="RIGHT_SQUARE_BRACKET",e[e.CIRCUMFLEX_ACCENT=94]="CIRCUMFLEX_ACCENT",e[e.LOW_LINE=95]="LOW_LINE",e[e.GRAVE_ACCENT=96]="GRAVE_ACCENT",e[e.LATIN_SMALL_LETTER_A=97]="LATIN_SMALL_LETTER_A",e[e.LATIN_SMALL_LETTER_B=98]="LATIN_SMALL_LETTER_B",e[e.LATIN_SMALL_LETTER_C=99]="LATIN_SMALL_LETTER_C",e[e.LATIN_SMALL_LETTER_D=100]="LATIN_SMALL_LETTER_D",e[e.LATIN_SMALL_LETTER_E=101]="LATIN_SMALL_LETTER_E",e[e.LATIN_SMALL_LETTER_F=102]="LATIN_SMALL_LETTER_F",e[e.LATIN_SMALL_LETTER_G=103]="LATIN_SMALL_LETTER_G",e[e.LATIN_SMALL_LETTER_H=104]="LATIN_SMALL_LETTER_H",e[e.LATIN_SMALL_LETTER_I=105]="LATIN_SMALL_LETTER_I",e[e.LATIN_SMALL_LETTER_J=106]="LATIN_SMALL_LETTER_J",e[e.LATIN_SMALL_LETTER_K=107]="LATIN_SMALL_LETTER_K",e[e.LATIN_SMALL_LETTER_L=108]="LATIN_SMALL_LETTER_L",e[e.LATIN_SMALL_LETTER_M=109]="LATIN_SMALL_LETTER_M",e[e.LATIN_SMALL_LETTER_N=110]="LATIN_SMALL_LETTER_N",e[e.LATIN_SMALL_LETTER_O=111]="LATIN_SMALL_LETTER_O",e[e.LATIN_SMALL_LETTER_P=112]="LATIN_SMALL_LETTER_P",e[e.LATIN_SMALL_LETTER_Q=113]="LATIN_SMALL_LETTER_Q",e[e.LATIN_SMALL_LETTER_R=114]="LATIN_SMALL_LETTER_R",e[e.LATIN_SMALL_LETTER_S=115]="LATIN_SMALL_LETTER_S",e[e.LATIN_SMALL_LETTER_T=116]="LATIN_SMALL_LETTER_T",e[e.LATIN_SMALL_LETTER_U=117]="LATIN_SMALL_LETTER_U",e[e.LATIN_SMALL_LETTER_V=118]="LATIN_SMALL_LETTER_V",e[e.LATIN_SMALL_LETTER_W=119]="LATIN_SMALL_LETTER_W",e[e.LATIN_SMALL_LETTER_X=120]="LATIN_SMALL_LETTER_X",e[e.LATIN_SMALL_LETTER_Y=121]="LATIN_SMALL_LETTER_Y",e[e.LATIN_SMALL_LETTER_Z=122]="LATIN_SMALL_LETTER_Z",e[e.LEFT_CURLY_BRACKET=123]="LEFT_CURLY_BRACKET",e[e.VERTICAL_LINE=124]="VERTICAL_LINE",e[e.RIGHT_CURLY_BRACKET=125]="RIGHT_CURLY_BRACKET",e[e.TILDE=126]="TILDE"}(tt||(tt={}));tt.QUOTATION_MARK,tt.QUOTATION_MARK,tt.REVERSE_SOLIDUS,tt.REVERSE_SOLIDUS,tt.SOLIDUS,tt.SOLIDUS,tt.LATIN_SMALL_LETTER_B,tt.BACKSPACE,tt.LATIN_SMALL_LETTER_F,tt.FORM_FEED,tt.LATIN_SMALL_LETTER_N,tt.NEWLINE,tt.LATIN_SMALL_LETTER_R,tt.CARRIAGE_RETURN,tt.LATIN_SMALL_LETTER_T,tt.TAB;var it;!function(e){e[e.LEFT_BRACE=0]="LEFT_BRACE",e[e.RIGHT_BRACE=1]="RIGHT_BRACE",e[e.LEFT_BRACKET=2]="LEFT_BRACKET",e[e.RIGHT_BRACKET=3]="RIGHT_BRACKET",e[e.COLON=4]="COLON",e[e.COMMA=5]="COMMA",e[e.TRUE=6]="TRUE",e[e.FALSE=7]="FALSE",e[e.NULL=8]="NULL",e[e.STRING=9]="STRING",e[e.NUMBER=10]="NUMBER",e[e.SEPARATOR=11]="SEPARATOR"}(it||(it={}));var ot;!function(e){e[e.START=0]="START",e[e.ENDED=1]="ENDED",e[e.ERROR=2]="ERROR",e[e.TRUE1=3]="TRUE1",e[e.TRUE2=4]="TRUE2",e[e.TRUE3=5]="TRUE3",e[e.FALSE1=6]="FALSE1",e[e.FALSE2=7]="FALSE2",e[e.FALSE3=8]="FALSE3",e[e.FALSE4=9]="FALSE4",e[e.NULL1=10]="NULL1",e[e.NULL2=11]="NULL2",e[e.NULL3=12]="NULL3",e[e.STRING_DEFAULT=13]="STRING_DEFAULT",e[e.STRING_AFTER_BACKSLASH=14]="STRING_AFTER_BACKSLASH",e[e.STRING_UNICODE_DIGIT_1=15]="STRING_UNICODE_DIGIT_1",e[e.STRING_UNICODE_DIGIT_2=16]="STRING_UNICODE_DIGIT_2",e[e.STRING_UNICODE_DIGIT_3=17]="STRING_UNICODE_DIGIT_3",e[e.STRING_UNICODE_DIGIT_4=18]="STRING_UNICODE_DIGIT_4",e[e.STRING_INCOMPLETE_CHAR=19]="STRING_INCOMPLETE_CHAR",e[e.NUMBER_AFTER_INITIAL_MINUS=20]="NUMBER_AFTER_INITIAL_MINUS",e[e.NUMBER_AFTER_INITIAL_ZERO=21]="NUMBER_AFTER_INITIAL_ZERO",e[e.NUMBER_AFTER_INITIAL_NON_ZERO=22]="NUMBER_AFTER_INITIAL_NON_ZERO",e[e.NUMBER_AFTER_FULL_STOP=23]="NUMBER_AFTER_FULL_STOP",e[e.NUMBER_AFTER_DECIMAL=24]="NUMBER_AFTER_DECIMAL",e[e.NUMBER_AFTER_E=25]="NUMBER_AFTER_E",e[e.NUMBER_AFTER_E_AND_SIGN=26]="NUMBER_AFTER_E_AND_SIGN",e[e.NUMBER_AFTER_E_AND_DIGIT=27]="NUMBER_AFTER_E_AND_DIGIT",e[e.SEPARATOR=28]="SEPARATOR",e[e.BOM_OR_START=29]="BOM_OR_START",e[e.BOM=30]="BOM"}(ot||(ot={}));Error;var at,st;!function(e){e[e.OBJECT=0]="OBJECT",e[e.ARRAY=1]="ARRAY"}(at||(at={})),function(e){e[e.VALUE=0]="VALUE",e[e.KEY=1]="KEY",e[e.COLON=2]="COLON",e[e.COMMA=3]="COMMA",e[e.ENDED=4]="ENDED",e[e.ERROR=5]="ERROR",e[e.SEPARATOR=6]="SEPARATOR"}(st||(st={}));Error;var lt=r(6425),ut=function(e){for(var t in e)"uri"!==e[t].type&&(e[t].value=e[t].value.replace(/{{(.*?)}}/g,(function(t){return t=t.substring(2,t.length-2).trim(),e[t]?e[t].value:t})));return e};const ct=function(){return(0,o.A)((function e(t,r){(0,i.A)(this,e),t.executionTime&&(this.executionTime=t.executionTime),r&&(this.executionTime=r),t instanceof Error?this.error=t:t.xhr?this.setResponse(t):this.setSummary(t)}),[{key:"setResponse",value:function(e){this.res=e}},{key:"setSummary",value:function(e){e.data||e.error?this.summary=e:this.summary={data:e}}},{key:"hasError",value:function(){return!!(this.res&&this.res.status>=400)||(!!this.errorSummary||(!!this.error||!(!this.summary||!this.summary.error)))}},{key:"getError",value:function(){return this.errorSummary||(this.res&&this.res.status>=400&&(this.errorSummary={text:this.res.text,status:this.res.status,statusText:this.res.error?this.res.error.text:void 0}),this.summary&&this.summary.error&&(this.errorSummary=this.summary.error),this.error&&("response"in this.error&&void 0!==this.error.response?(this.errorSummary={text:this.error.response.text,status:this.error.response.status,statusText:this.error.response.statusText},this.error.response.body&&"object"===(0,n.A)(this.error.response.body)&&"message"in this.error.response.body&&(this.errorSummary.text=this.error.response.body.message)):this.errorSummary={text:this.error.message})),this.errorSummary}},{key:"getContentType",value:function(){return this.res?this.res.header["content-type"]:this.summary?this.summary.contentType:void 0}},{key:"getAsJson",value:function(){return this.json?this.json:!1===this.json||this.hasError()?void 0:(this.getParserFromContentType()||this.doLuckyGuess()||this.json||(this.json=!1),this.json)}},{key:"getData",value:function(){if(this.res){if(this.res.body)return this.res.body;if(this.res.text)return this.res.text}if(this.summary)return this.summary.data}},{key:"getResponseTime",value:function(){return this.executionTime}},{key:"getParserFromContentType",value:function(){var e=this.getContentType();if(e){var t=(0,lt.A)(this.getData());try{if(e.indexOf("json")>-1){if(e.indexOf("sparql-results+json")>=0)return this.json=S(t,ut),this.type="json",!0;if(e.indexOf("application/rdf+json")>-1)return this.type="json",!0;this.type="json"}else{if(e.indexOf("xml")>-1)return this.json=Me(t,ut),this.type="xml",!0;if(e.indexOf("csv")>-1)return this.json=function(e){var t=Fe.parse(e,{header:!0,skipEmptyLines:!0});if(void 0===t.meta.fields)throw new Error("Could not parse CSV, no headers found!");return{head:{vars:t.meta.fields},results:{bindings:t.data.map((function(e){var t={};for(var r in e)t[r]={value:e[r],type:"literal"};return t}))}}}(t),this.type="csv",!0;if(e.indexOf("tab-separated")>-1)return this.json=We(t),this.type="tsv",!0;if(e.indexOf("turtle")>0||e.indexOf("trig")>0||e.indexOf("triple")>0||e.indexOf("quad")>0)return this.json={head:{vars:["subject","predicate","object"]},results:{bindings:ye(t).map((function(e){return{subject:ve(e.subject),predicate:ve(e.predicate),object:ve(e.object)}}))}},this.type="ttl",!0}}catch(e){e instanceof Error?this.errorSummary={text:e.message}:this.errorSummary={text:e}}}return!1}},{key:"doLuckyGuess",value:function(){var e=(0,lt.A)(this.getData());try{return this.json=S(e,ut),this.type="json",!0}catch(e){}try{return this.json=Me(e,ut),this.type="xml",!0}catch(e){}return!1}},{key:"getVariables",value:function(){var e=this.getAsJson();return e&&e.head?e.head.vars:[]}},{key:"getBoolean",value:function(){var e=this.getAsJson();if(e&&"boolean"in e)return e.boolean}},{key:"getBindings",value:function(){var e=this.getAsJson();return e&&e.results?e.results.bindings:null}},{key:"getStatements",value:function(){return this.statements||"ttl"!==this.type||(this.statements=ye(this.getData())),this.statements?this.statements:null}},{key:"getOriginalResponseAsString",value:function(){var e=this.getData();return"string"==typeof e?e:"json"===this.type?JSON.stringify(e,void 0,2):e}},{key:"getOriginalResponse",value:function(){var e;return null===(e=this.res)||void 0===e?void 0:e.body}},{key:"getType",value:function(){return this.type||this.getAsJson(),this.type}},{key:"getStatus",value:function(){return this.res?this.res.status:this.summary?this.summary.status:void 0}},{key:"getAsStoreObject",value:function(e){var t=this.summary;if(!t&&this.res&&(t={contentType:this.getContentType(),data:this.getOriginalResponseAsString(),error:this.getError(),status:this.getStatus(),executionTime:this.getResponseTime()}),t){if(t.data&&t.data.length>e)return;return t}if(this.error)return{error:this.getError(),executionTime:this.getResponseTime()}}},{key:"asCsv",value:function(){var e,t,r,n,i=this.getAsJson();return"csv"===this.type?this.getOriginalResponseAsString():i&&i.results?(r=(e=i).head.vars,n=null===(t=e.results)||void 0===t?void 0:t.bindings,new nt({fields:r}).parse(n?n.map((function(e){return(0,T.A)(e,(function(e){return e.value}))})):[])):void 0}}])}();function pt(e){var t=document.createElement("link");t.setAttribute("rel","stylesheet"),t.setAttribute("type","text/css"),t.setAttribute("href",e),document.getElementsByTagName("head")[0].appendChild(t)}function dt(e,t){return new Promise((function(r,n){var i=document.createElement("script");i.setAttribute("type","text/javascript"),i.setAttribute("async",""),i.setAttribute("src",e),t&&(i.innerHTML=t),i.onload=function(){return r()},document.getElementsByTagName("head")[0].appendChild(i)}))}var ft=r(4996);ft.addHook("afterSanitizeAttributes",(function(e){e instanceof HTMLAnchorElement&&(e.target="_blank",e.rel="noopener noreferrer")}));const ht=ft.sanitize;var gt=r(1475),mt=r(4179),vt=r(3322),yt=r(9602),Et=r.n(yt),bt=r(6691),xt=r(6095);r(3614),r(4023),r(1602);var Tt=r(3252);function At(e){(0,A.iQ)(this,"expanded"),e.preventDefault()}var St=function(){return(0,o.A)((function e(t){var r=this;(0,i.A)(this,e),this.persistentConfig={},this.helpReference="https://triply.cc/docs/yasgui#table",this.label="Table",this.priority=10,this.setEllipsisHandlers=function(){var e;null===(e=r.dataTable)||void 0===e||e.cells({page:"current"}).every((function(e,t){var n,i,o=null===(n=r.dataTable)||void 0===n?void 0:n.cell(e,t);if(""!==(null==o?void 0:o.data())){var a=null==o?void 0:o.node();if(a){var s=a.firstChild;((null===(i=s.firstElementChild)||void 0===i?void 0:i.getBoundingClientRect().width)||0)>s.getBoundingClientRect().width?s.classList.contains("expandable")||((0,A.iQ)(s,"expandable"),s.addEventListener("click",At,{once:!0})):s.classList.contains("expandable")&&((0,A.vy)(s,"expandable"),s.removeEventListener("click",At))}}}))},this.handleTableSearch=function(e){var t;null===(t=r.dataTable)||void 0===t||t.search(e.target.value).draw("page")},this.handleTableSizeSelect=function(e){var t,n=parseInt(e.target.value);null===(t=r.dataTable)||void 0===t||t.page.len(n).draw("page"),r.persistentConfig.pageSize=n,r.yasr.storePluginConfig("table",r.persistentConfig)},this.handleSetCompactToggle=function(e){r.persistentConfig.compact=e.target.checked,r.draw(r.persistentConfig),r.yasr.storePluginConfig("table",r.persistentConfig)},this.handleSetEllipsisToggle=function(e){r.persistentConfig.isEllipsed=e.target.checked,r.draw(r.persistentConfig),r.yasr.storePluginConfig("table",r.persistentConfig)},this.yasr=t,this.config=e.defaults}),[{key:"getIcon",value:function(){return(0,A.Mg)((0,A.uZ)(xt))}},{key:"getRows",value:function(){if(!this.yasr.results)return[];var e=this.yasr.results.getBindings();if(!e)return[];var t=this.yasr.results.getVariables();return e.map((function(e,r){return[r+1].concat((0,vt.A)(t.map((function(t){var r;return null!==(r=e[t])&&void 0!==r?r:""}))))}))}},{key:"getUriLinkFromBinding",value:function(e,t){var r=ht(e.value),n=r,i=!1;if(t)for(var o in t)if(0==n.indexOf(t[o])){n=o+":"+r.substring(t[o].length),i=!0;break}var a=i||this.persistentConfig.compact,s="".concat(a?"":"<","").concat(ht(n),"").concat(a?"":">");return ht(s)}},{key:"getCellContent",value:function(e,t){var r;return r="uri"==e.type?"".concat(this.getUriLinkFromBinding(e,t),""):"".concat(this.formatLiteral(e,t),""),"".concat(r,"
")}},{key:"formatLiteral",value:function(e,t){var r=ht((0,bt.A)(e.value));if(this.persistentConfig.compact)return r;if(e["xml:lang"])r='"'.concat(r,'"@').concat(e["xml:lang"],"");else if(e.datatype){var n=this.getUriLinkFromBinding({type:"uri",value:e.datatype},t);r='"'.concat(r,'"^^').concat(n,"")}return r}},{key:"getColumns",value:function(){var e,t=this;if(!this.yasr.results)return[];var r=this.yasr.getPrefixes();return[{name:"",searchable:!1,width:"".concat(this.getSizeFirstColumn(),"px"),type:"num",orderable:!1,visible:!0!==this.persistentConfig.compact,render:function(e,t){return"filter"!==t&&"sort"!==t&&t?''.concat(e,"
"):e}}].concat((0,vt.A)(null===(e=this.yasr.results)||void 0===e?void 0:e.getVariables().map((function(e){return{name:e,title:ht(e),render:function(e,n,i,o){return""===e?e:"filter"!==n&&"sort"!==n&&n?t.getCellContent(e,r):ht(e.value)}}}))))}},{key:"getSizeFirstColumn",value:function(){var e,t;return 8*((null===(t=null===(e=this.yasr.results)||void 0===e?void 0:e.getBindings())||void 0===t?void 0:t.length)||0).toString().length}},{key:"draw",value:function(e){var t,r,n=this;this.persistentConfig=Object.assign(Object.assign({},this.persistentConfig),e),this.tableEl=document.createElement("table");var i=this.getRows(),o=this.getColumns();i.length<=((null==e?void 0:e.pageSize)||50)?(this.yasr.pluginControls,(0,A.iQ)(this.yasr.rootEl,"isSinglePage")):(0,A.vy)(this.yasr.rootEl,"isSinglePage"),this.dataTable&&(this.destroyResizer(),this.dataTable.destroy(!0),this.dataTable=void 0),this.yasr.resultsEl.appendChild(this.tableEl);var a=Object.assign(Object.assign({},(0,lt.A)(this.config.tableConfig)),{pageLength:(null==e?void 0:e.pageSize)?e.pageSize:50,data:i,columns:o});this.dataTable=Et()(this.tableEl).DataTable(a),this.tableEl.style.removeProperty("width"),this.tableEl.style.width=this.tableEl.clientWidth+"px";var s=Array.from(this.tableEl.querySelectorAll("th")).map((function(e){return e.offsetWidth-26}));this.tableResizer=new Tt.default(this.tableEl,{widths:!0===this.persistentConfig.compact?s:[this.getSizeFirstColumn()].concat((0,vt.A)(s.slice(1))),partialRefresh:!0,onResize:!1!==this.persistentConfig.isEllipsed&&this.setEllipsisHandlers,headerOnly:!0}),!1!==this.persistentConfig.isEllipsed&&(null===(t=this.dataTable)||void 0===t||t.on("preDraw",(function(){var e,t,r;return null===(e=n.tableResizer)||void 0===e||e.reset({disable:!0}),(0,A.vy)(n.tableEl,"ellipseTable"),null===(t=n.tableEl)||void 0===t||t.style.removeProperty("width"),null===(r=n.tableEl)||void 0===r||r.style.setProperty("width",n.tableEl.clientWidth+"px"),!0})),null===(r=this.dataTable)||void 0===r||r.on("draw",(function(){var e,t;if(n.tableEl){var r=n.tableEl.clientWidth;n.tableEl.style.removeProperty("width"),r>n.tableEl.clientWidth&&(r=n.tableEl.clientWidth),null===(e=n.tableEl)||void 0===e||e.style.setProperty("width","".concat(r,"px")),null===(t=n.tableResizer)||void 0===t||t.reset({disable:!1,partialRefresh:!0,onResize:n.setEllipsisHandlers,headerOnly:!0}),(0,A.iQ)(n.tableEl,"ellipseTable"),n.setEllipsisHandlers()}}))),this.drawControls(),!1!==this.persistentConfig.isEllipsed&&((0,A.iQ)(this.tableEl,"ellipseTable"),this.setEllipsisHandlers())}},{key:"drawControls",value:function(){var e;this.removeControls(),this.tableControls=document.createElement("div"),this.tableControls.className="tableControls";var t=document.createElement("div"),r=document.createElement("label"),n=document.createElement("span");n.innerText="Simple view",(0,A.iQ)(n,"label"),r.appendChild(n),(0,A.iQ)(r,"switch"),t.appendChild(r),this.tableCompactSwitch=document.createElement("input"),r.addEventListener("change",this.handleSetCompactToggle),this.tableCompactSwitch.type="checkbox",r.appendChild(this.tableCompactSwitch),this.tableCompactSwitch.defaultChecked=!!this.persistentConfig.compact,this.tableControls.appendChild(t);var i=document.createElement("div"),o=document.createElement("label"),a=document.createElement("span");a.innerText="Ellipse",(0,A.iQ)(a,"label"),o.appendChild(a),(0,A.iQ)(o,"switch"),i.appendChild(o),this.tableEllipseSwitch=document.createElement("input"),o.addEventListener("change",this.handleSetEllipsisToggle),this.tableEllipseSwitch.type="checkbox",o.appendChild(this.tableEllipseSwitch),this.tableEllipseSwitch.defaultChecked=!1!==this.persistentConfig.isEllipsed,this.tableControls.appendChild(i),this.tableFilterField=document.createElement("input"),this.tableFilterField.className="tableFilter",this.tableFilterField.placeholder="Filter query results",this.tableFilterField.setAttribute("aria-label","Filter query results"),this.tableControls.appendChild(this.tableFilterField),this.tableFilterField.addEventListener("keyup",this.handleTableSearch);var s=document.createElement("div");s.className="pageSizeWrapper";var l=document.createElement("span");l.textContent="Page size: ",l.className="pageSizerLabel",s.appendChild(l),this.tableSizeField=document.createElement("select"),this.tableSizeField.className="tableSizer";for(var u=0,c=[10,50,100,1e3,-1];u0?p+"":"All",(null===(e=this.dataTable)||void 0===e?void 0:e.page.len())===p&&(d.selected=!0),this.tableSizeField.appendChild(d)}s.appendChild(this.tableSizeField),this.tableSizeField.addEventListener("change",this.handleTableSizeSelect),this.tableControls.appendChild(s),this.yasr.pluginControls.appendChild(this.tableControls)}},{key:"download",value:function(e){var t=this;return{getData:function(){var e;return(null===(e=t.yasr.results)||void 0===e?void 0:e.asCsv())||""},contentType:"text/csv",title:"Download result",filename:"".concat(e||"queryResults",".csv")}}},{key:"canHandleResults",value:function(){return!!this.yasr.results&&this.yasr.results.getVariables()&&this.yasr.results.getVariables().length>0}},{key:"removeControls",value:function(){var e,t,r,n,i,o;for(null===(e=this.tableFilterField)||void 0===e||e.removeEventListener("keyup",this.handleTableSearch),this.tableFilterField=void 0,null===(t=this.tableSizeField)||void 0===t||t.removeEventListener("change",this.handleTableSizeSelect),this.tableSizeField=void 0,null===(r=this.tableCompactSwitch)||void 0===r||r.removeEventListener("change",this.handleSetCompactToggle),this.tableCompactSwitch=void 0,null===(n=this.tableEllipseSwitch)||void 0===n||n.removeEventListener("change",this.handleSetEllipsisToggle),this.tableEllipseSwitch=void 0;null===(i=this.tableControls)||void 0===i?void 0:i.firstChild;)this.tableControls.firstChild.remove();null===(o=this.tableControls)||void 0===o||o.remove()}},{key:"destroyResizer",value:function(){this.tableResizer&&(this.tableResizer.reset({disable:!0}),window.removeEventListener("resize",this.tableResizer.onResize),this.tableResizer=void 0)}},{key:"destroy",value:function(){var e;this.removeControls(),this.destroyResizer(),null===(e=this.dataTable)||void 0===e||e.destroy(!0),this.dataTable=void 0,(0,A.vy)(this.yasr.rootEl,"isSinglePage")}}])}();St.defaults={openIriInNewWindow:!0,tableConfig:{layout:{top:null,topStart:null,topEnd:null},pageLength:50,lengthChange:!0,data:[],columns:[],order:[],deferRender:!0,orderClasses:!1,language:{paginate:{first:"<<",last:">>",next:">",previous:"<"}}}};const Lt=St;r(1710);var Nt=function(){return(0,o.A)((function e(t){(0,i.A)(this,e),this.priority=10,this.hideFromSelection=!0,this.yasr=t}),[{key:"draw",value:function(){var e,t=document.createElement("div");t.className="booleanResult";var r=null===(e=this.yasr.results)||void 0===e?void 0:e.getBoolean();t.appendChild((0,A.Mg)(r?'':''));var n=document.createElement("span");n.textContent=r?"True":"False",t.appendChild(n),this.yasr.resultsEl.appendChild(t)}},{key:"canHandleResults",value:function(){var e;return!!(null===(e=this.yasr.results)||void 0===e?void 0:e.getBoolean)&&(!0===this.yasr.results.getBoolean()||0==this.yasr.results.getBoolean())}},{key:"getIcon",value:function(){return document.createElement("")}}])}(),Ct=r(4779),It='';r(9715);var _t=r(1719);r(9754),r(2448),r(7623),r(666),r(8709),r(1262),r(7518),r(9436);var wt=function(){return(0,o.A)((function e(t){(0,i.A)(this,e),this.label="Response",this.priority=2,this.helpReference="https://triply.cc/docs/yasgui#response",this.yasr=t,this.config=e.defaults,t.config.plugins.response&&t.config.plugins.response.dynamicConfig&&(this.config=Object.assign(Object.assign({},this.config),t.config.plugins.response.dynamicConfig))}),[{key:"canHandleResults",value:function(){if(!this.yasr.results)return!1;if(!this.yasr.results.getOriginalResponseAsString)return!1;var e=this.yasr.results.getOriginalResponseAsString();return!((!e||0==e.length)&&this.yasr.results.getError())}},{key:"getIcon",value:function(){return(0,A.Mg)((0,A.uZ)(Ct))}},{key:"download",value:function(e){var t=this;if(this.yasr.results){var r=this.yasr.results.getContentType(),n=this.yasr.results.getType(),i="xml"===n?"rdf":n;return{getData:function(){var e;return(null===(e=t.yasr.results)||void 0===e?void 0:e.getOriginalResponseAsString())||""},filename:"".concat(e||"queryResults").concat(i?"."+i:""),contentType:r||"text/plain",title:"Download result"}}}},{key:"draw",value:function(e){var t,r,n=Object.assign(Object.assign({},this.config),e),i=(null===(t=this.yasr.results)||void 0===t?void 0:t.getOriginalResponseAsString())||"",o=i.split("\n");o.length>n.maxLines&&(i=o.slice(0,n.maxLines).join("\n"));var a={readOnly:!0,lineNumbers:!0,lineWrapping:!0,foldGutter:!0,gutters:["CodeMirror-linenumbers","CodeMirror-foldgutter"],value:i,extraKeys:{Tab:!1}};"json"===(null===(r=this.yasr.results)||void 0===r?void 0:r.getType())&&(a.mode={name:"javascript",json:!0}),this.cm=_t(this.yasr.resultsEl,a),o.length>n.maxLines&&this.showLess(!1)}},{key:"limitData",value:function(e){var t=e.split("\n");return t.length>this.config.maxLines&&(e=t.slice(0,this.config.maxLines).join("\n")),e}},{key:"showLess",value:function(){var e,t=this,r=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this.cm){(0,A.iQ)(this.cm.getWrapperElement(),"overflow"),this.overLay&&(this.overLay.remove(),this.overLay=void 0),this.overLay=document.createElement("div"),(0,A.iQ)(this.overLay,"overlay");var n=document.createElement("div");(0,A.iQ)(n,"overlay_content");var i=document.createElement("button");i.title="Show all",(0,A.iQ)(i,"yasr_btn","overlay_btn"),i.textContent="Show all",i.addEventListener("click",(function(){return t.showMore()})),n.append(i);var o=document.createElement("button");o.title="Download result",(0,A.iQ)(o,"yasr_btn","overlay_btn");var a=document.createElement("span");a.innerText="Download result",o.appendChild(a),o.appendChild((0,A.Mg)(It)),o.addEventListener("click",(function(){return t.yasr.download()})),o.addEventListener("keydown",(function(e){"Space"!==e.code&&"Enter"!==e.code||t.yasr.download()})),n.appendChild(o),this.overLay.appendChild(n),this.cm.getWrapperElement().appendChild(this.overLay),r&&this.cm.setValue(this.limitData((null===(e=this.yasr.results)||void 0===e?void 0:e.getOriginalResponseAsString())||""))}}},{key:"showMore",value:function(){var e,t;this.cm&&((0,A.vy)(this.cm.getWrapperElement(),"overflow"),null===(e=this.overLay)||void 0===e||e.remove(),this.overLay=void 0,this.cm.setValue((null===(t=this.yasr.results)||void 0===t?void 0:t.getOriginalResponseAsString())||""),this.cm.refresh())}}])}();wt.defaults={maxLines:30};const Rt=wt;var Ot=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{l(n.next(e))}catch(e){o(e)}}function s(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}l((n=n.apply(e,t||[])).next())}))};r(8956);var Dt=function(){return(0,o.A)((function e(t){(0,i.A)(this,e),this.priority=20,this.hideFromSelection=!0,this.yasr=t}),[{key:"canHandleResults",value:function(){return!!this.yasr.results&&!!this.yasr.results.getError()}},{key:"getTryBtn",value:function(e){var t=document.createElement("a");return t.href=e,t.rel="noopener noreferrer",t.target="_blank",t.className="yasr_tryQuery",t.textContent="Try query in a new browser window",t}},{key:"getCorsMessage",value:function(){var e=document.createElement("div");e.className="redOutline";var t=document.createElement("p");t.textContent="Unable to get response from endpoint. Possible reasons:",e.appendChild(t);var r=document.createElement("ul"),n=document.createElement("li");n.textContent="Incorrect endpoint URL",r.appendChild(n);var i=document.createElement("li");i.textContent="Endpoint is down",r.appendChild(i);var o=document.createElement("li"),a=document.createElement("span");a.textContent="Endpoint is not accessible from the YASGUI server and website, and the endpoint is not ",o.appendChild(a);var s=document.createElement("a");return s.textContent="CORS-enabled",s.href="http://enable-cors.org/",s.target="_blank",s.rel="noopener noreferrer",o.appendChild(s),r.appendChild(o),e.appendChild(r),e}},{key:"draw",value:function(){return Ot(this,void 0,void 0,c().mark((function e(){var t,r,n,i,o,a,s,l,u,p,d,f,h;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((r=document.createElement("div")).className="errorResult",this.yasr.resultsEl.appendChild(r),n=null===(t=this.yasr.results)||void 0===t?void 0:t.getError()){e.next=6;break}return e.abrupt("return");case 6:return(i=document.createElement("div")).className="errorHeader",r.appendChild(i),e.next=11,this.yasr.renderError(n);case 11:if(!(o=e.sent)){e.next=18;break}return(a=document.createElement("div")).className="redOutline",a.appendChild(o),r.appendChild(a),e.abrupt("return");case 18:n.status?(s="Error",n.statusText&&n.statusText.length<100&&(s=n.statusText),s+=" (#".concat(n.status,")"),(l=document.createElement("span")).className="status",l.textContent=s,i.appendChild(l),this.yasr.config.getPlainQueryLinkToEndpoint&&(u=this.yasr.config.getPlainQueryLinkToEndpoint())&&i.appendChild(this.getTryBtn(u)),n.text&&(p=document.createElement("div"),(0,A.iQ)(p,"errorMessageContainer"),r.appendChild(p),d=document.createElement("pre"),(0,A.iQ)(d,"errorMessage"),d.textContent=n.text,p.appendChild(d))):(this.yasr.config.getPlainQueryLinkToEndpoint&&(f=this.yasr.config.getPlainQueryLinkToEndpoint())&&i.appendChild(this.getTryBtn(f)),!n.text||n.text.indexOf("Request has been terminated")>=0?r.appendChild(this.getCorsMessage()):((h=document.createElement("pre")).textContent=n.text,r.appendChild(h)));case 19:case"end":return e.stop()}}),e,this)})))}},{key:"getIcon",value:function(){return document.createElement("")}}])}();function Pt(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return kt(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return kt(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function kt(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2?arguments[2]:void 0;if((0,i.A)(this,t),(r=Mt(this,t)).plugins={},r.helpDrawn=!1,r.utils={addScript:dt,addCSS:pt,sanitize:ht},!e)throw new Error("No parent passed as argument. Dont know where to draw YASR");r.rootEl=document.createElement("div"),r.rootEl.className="yasr",e.appendChild(r.rootEl),r.config=(0,d.A)({},t.defaults,n),r.storage=new A.wc(t.storageNamespace),r.getConfigFromStorage(),r.headerEl=document.createElement("div"),r.headerEl.className="yasr_header",r.rootEl.appendChild(r.headerEl),r.fallbackInfoEl=document.createElement("div"),r.fallbackInfoEl.className="yasr_fallback_info",r.rootEl.appendChild(r.fallbackInfoEl),r.resultsEl=document.createElement("div"),r.resultsEl.className="yasr_results",r.resultsEl.id=g("resultsId"),r.rootEl.appendChild(r.resultsEl),r.initializePlugins(),r.drawHeader();var a=o||r.getResponseFromStorage();return a&&r.setResponse(a),r}return(0,l.A)(t,e),(0,o.A)(t,[{key:"getConfigFromStorage",value:function(){var e=this.getStorageId(this.config.persistenceLabelConfig);if(e){var t=this.storage.get(e);if(t)for(var r in this.selectedPlugin=t.selectedPlugin,t.pluginsConfig){var n=t.pluginsConfig[r];n&&this.config.plugins[r]&&(this.config.plugins[r].dynamicConfig=n)}}}},{key:"renderError",value:function(e){return Ft(this,void 0,void 0,c().mark((function t(){var r,n,i,o;return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=void 0,void 0===this.config.errorRenderers){t.next=22;break}n=Pt(this.config.errorRenderers),t.prev=3,n.s();case 5:if((i=n.n()).done){t.next=14;break}return o=i.value,t.next=9,o(e);case 9:if(void 0===(r=t.sent)){t.next=12;break}return t.abrupt("break",14);case 12:t.next=5;break;case 14:t.next=19;break;case 16:t.prev=16,t.t0=t.catch(3),n.e(t.t0);case 19:return t.prev=19,n.f(),t.finish(19);case 22:return t.abrupt("return",r);case 23:case"end":return t.stop()}}),t,this,[[3,16,19,22]])})))}},{key:"getStorageId",value:function(e,t){var r=t||this.config.persistenceId;if(r)return"string"==typeof r?r+"_"+e:r(this)+"_"+e}},{key:"somethingDrawn",value:function(){return!!this.resultsEl.children.length}},{key:"emptyFallbackElement",value:function(){for(;this.fallbackInfoEl.firstChild;)this.fallbackInfoEl.removeChild(this.fallbackInfoEl.firstChild)}},{key:"getSelectedPluginName",value:function(){return this.selectedPlugin||this.config.defaultPlugin}},{key:"getSelectedPlugin",value:function(){if(this.plugins[this.getSelectedPluginName()])return this.plugins[this.getSelectedPluginName()];console.warn("Tried using plugin ".concat(this.getSelectedPluginName(),", but seems this plugin isnt registered in yasr."))}},{key:"updatePluginSelectors",value:function(e){if(this.pluginSelectorsEl)for(var t in this.config.plugins){var r=this.plugins[t];r&&!r.hideFromSelection&&(e&&(e.indexOf(t)>=0?(0,A.vy)(this.pluginSelectorsEl.querySelector(".select_"+t),"disabled"):(0,A.iQ)(this.pluginSelectorsEl.querySelector(".select_"+t),"disabled")),t===this.getSelectedPluginName()?(0,A.iQ)(this.pluginSelectorsEl.querySelector(".select_"+t),"selected"):(0,A.vy)(this.pluginSelectorsEl.querySelector(".select_"+t),"selected"))}}},{key:"getCompatiblePlugins",value:function(){if(!this.results)return Object.keys(x(this.config.plugins,(function(e){return"object"===(0,n.A)(e)&&e.enabled||!0===e})));var e=[];for(var t in this.plugins)this.plugins[t].canHandleResults()&&e.push({name:t,priority:this.plugins[t].priority});return e.sort((function(e,t){return t.priority-e.priority})).map((function(e){return e.name}))}},{key:"draw",value:function(){var e,t,r,n,i,o=this;if(this.updateHelpButton(),this.updateResponseInfo(),this.results){var a,s=this.getCompatiblePlugins();if(this.drawnPlugin&&this.getSelectedPluginName()!==this.drawnPlugin){for(;this.pluginControls.firstChild;)this.pluginControls.firstChild.remove();null===(t=(e=this.plugins[this.drawnPlugin]).destroy)||void 0===t||t.call(e)}if(this.getSelectedPlugin()&&(null===(r=this.getSelectedPlugin())||void 0===r?void 0:r.canHandleResults())?(a=this.getSelectedPluginName(),this.emptyFallbackElement()):s[0]&&(this.drawnPlugin&&(null===(i=(n=this.plugins[this.drawnPlugin]).destroy)||void 0===i||i.call(n)),a=s[0],this.fillFallbackBox(a)),a){this.drawnPlugin=a,this.emit("draw",this,this.plugins[a]);var l=this.plugins[a];(l.initialize?l.initialize():Promise.resolve()).then((function(){return Ft(o,void 0,void 0,c().mark((function e(){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!a){e.next=7;break}for(;this.resultsEl.firstChild;)this.resultsEl.firstChild.remove();return e.next=4,this.plugins[a].draw(this.config.plugins[a].dynamicConfig);case 4:this.emit("drawn",this,this.plugins[a]),this.updateExportHeaders(),this.updatePluginSelectors(s);case 7:case"end":return e.stop()}}),e,this)})))}),(function(e){return console.error}))}else this.resultsEl.textContent="cannot render result",this.updateExportHeaders(),this.updatePluginSelectors(s)}}},{key:"refresh",value:function(){this.draw()}},{key:"destroy",value:function(){var e,t;this.drawnPlugin&&(null===(t=null===(e=this.plugins[this.drawnPlugin])||void 0===e?void 0:e.destroy)||void 0===t||t.call(e)),this.removeAllListeners(),this.rootEl.remove()}},{key:"getPrefixes",value:function(){return this.config.prefixes?"function"==typeof this.config.prefixes?this.config.prefixes(this):this.config.prefixes:{}}},{key:"selectPlugin",value:function(e){this.selectedPlugin!==e&&(this.config.plugins[e]?this.selectedPlugin=e:(console.warn("Plugin ".concat(e," does not exist.")),this.selectedPlugin=this.config.defaultPlugin),this.storeConfig(),this.emit("change",this),this.updatePluginSelectors(),this.draw())}},{key:"drawPluginSelectors",value:function(){var e=this;this.pluginSelectorsEl=document.createElement("ul"),this.pluginSelectorsEl.className="yasr_btnGroup";var t=this.config.pluginOrder;Object.keys(this.config.plugins).sort().forEach((function(e){-1===t.indexOf(e)&&t.push(e)}));var r,n=Pt(t);try{var i=function(){var t=r.value;if(!e.config.plugins[t]||!e.config.plugins[t].enabled)return 0;var n=e.plugins[t];if(!n)return 0;if(n.hideFromSelection)return 0;var i=n.label||t,o=document.createElement("button");if((0,A.iQ)(o,"yasr_btn","select_"+t),o.title=i,o.type="button",o.setAttribute("aria-label","Shows ".concat(i," view")),n.getIcon){var a=n.getIcon();a&&((0,A.iQ)(a,"plugin_icon"),o.appendChild(a))}var s=document.createElement("span");s.textContent=i,o.appendChild(s),o.addEventListener("click",(function(){return e.selectPlugin(t)}));var l=document.createElement("li");l.appendChild(o),e.pluginSelectorsEl.appendChild(l)};for(n.s();!(r=n.n()).done;)i()}catch(e){n.e(e)}finally{n.f()}this.pluginSelectorsEl.children.length>=1&&this.headerEl.appendChild(this.pluginSelectorsEl),this.updatePluginSelectors()}},{key:"fillFallbackBox",value:function(e){var t,r,n;if(this.emptyFallbackElement(),!(null===(t=this.plugins[e||this.drawnPlugin||""])||void 0===t?void 0:t.hideFromSelection)){var i=this.getSelectedPlugin(),o=(null===(r=this.plugins[e||this.drawnPlugin||""])||void 0===r?void 0:r.label)||e||this.drawnPlugin,a=(null==i?void 0:i.label)||this.getSelectedPluginName(),s=document.createElement("p");if(s.innerText="Could not render results with the ".concat(a," plugin, the results currently are rendered with the ").concat(o," plugin. ").concat((null===(n=this.getSelectedPlugin())||void 0===n?void 0:n.helpReference)?"See ":""),null==i?void 0:i.helpReference){var l=document.createElement("a");l.innerText="".concat(a," documentation"),l.href=i.helpReference,l.rel="noopener noreferrer",l.target="_blank",s.append(l),s.innerHTML+=" for more information."}this.fallbackInfoEl.appendChild(s)}}},{key:"drawPluginElement",value:function(){var e=document.createElement("div");(0,A.iQ)(e,"space_element"),this.headerEl.appendChild(e),this.pluginControls=document.createElement("div"),this.pluginControls.setAttribute("id","yasr_plugin_control"),(0,A.iQ)(this.pluginControls,"yasr_plugin_control"),this.pluginControls.setAttribute("aria-controls",this.resultsEl.id),this.headerEl.appendChild(this.pluginControls)}},{key:"drawHeader",value:function(){this.drawPluginSelectors(),this.drawResponseInfo(),this.drawPluginElement(),this.drawDownloadIcon(),this.drawDocumentationButton()}},{key:"drawDownloadIcon",value:function(){var e=this;this.downloadBtn=document.createElement("a"),(0,A.iQ)(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");var t=(0,A.Mg)((0,A.uZ)(gt));t.setAttribute("aria-hidden","true"),this.downloadBtn.appendChild(t),this.downloadBtn.addEventListener("click",(function(){(0,A.nB)(e.downloadBtn,"disabled")||e.download()})),this.downloadBtn.addEventListener("keydown",(function(t){if("Space"===t.code||"Enter"===t.code){if((0,A.nB)(e.downloadBtn,"disabled"))return;e.download()}})),this.headerEl.appendChild(this.downloadBtn)}},{key:"drawResponseInfo",value:function(){this.dataElement=document.createElement("div"),(0,A.iQ)(this.dataElement,"yasr_response_chip"),this.headerEl.appendChild(this.dataElement),this.updateResponseInfo()}},{key:"updateResponseInfo",value:function(){var e="";if(this.results){(0,A.vy)(this.dataElement,"empty");var t=this.results.getBindings();t&&(e+="".concat(t.length," result").concat(1===t.length?"":"s"));var r=this.results.getResponseTime();if(r){e||(e="Response");var n=r/1e3;e+=" in ".concat(n," second").concat(1===n?"":"s")}}else(0,A.iQ)(this.dataElement,"empty");this.dataElement.innerText=e}},{key:"updateHelpButton",value:function(){var e=this.getSelectedPlugin();if(null==e?void 0:e.helpReference){var t="View documentation of ".concat(e.label||this.getSelectedPluginName());this.documentationLink.href=e.helpReference,this.documentationLink.title=t,this.documentationLink.setAttribute("aria-label",t),(0,A.vy)(this.documentationLink,"disabled")}else(0,A.iQ)(this.documentationLink,"disabled"),this.documentationLink.title="This plugin doesn't have a help reference yet. Please contact the maintainer to fix this"}},{key:"updateExportHeaders",value:function(){var e,t;if(this.downloadBtn&&this.drawnPlugin){this.downloadBtn.title="";var r=this.plugins[this.drawnPlugin];if(r&&r.download){var n=r.download(null===(t=(e=this.config).getDownloadFileName)||void 0===t?void 0:t.call(e));if((0,A.vy)(this.downloadBtn,"disabled"),n)return void(n.title&&(this.downloadBtn.title=n.title))}this.downloadBtn.title="Download not supported",(0,A.iQ)(this.downloadBtn,"disabled")}}},{key:"drawDocumentationButton",value:function(){this.documentationLink=document.createElement("a"),(0,A.iQ)(this.documentationLink,"yasr_btn","yasr_external_ref_btn"),this.documentationLink.appendChild((0,A.Mg)((0,A.uZ)(mt))),this.documentationLink.href="//triply.cc/docs/yasgui",this.documentationLink.target="_blank",this.documentationLink.rel="noopener noreferrer",this.headerEl.appendChild(this.documentationLink)}},{key:"download",value:function(){var e,t,r;if(this.drawnPlugin){var n=this.plugins[this.drawnPlugin];if(n&&n.download){var i=n.download(null===(t=(e=this.config).getDownloadFileName)||void 0===t?void 0:t.call(e));if(!i)return;var o,a=i.getData();if(a.startsWith("data:"))o=a;else{var s=new Blob([a],{type:null!==(r=i.contentType)&&void 0!==r?r:"text/plain"});o=window.URL.createObjectURL(s)}var l=document.createElement("a");l.href=o,l.download=i.filename,l.click()}}}},{key:"handleLocalStorageQuotaFull",value:function(e){console.warn("Localstorage quota exceeded. Clearing all queries"),t.clearStorage()}},{key:"getResponseFromStorage",value:function(){var e=this.getStorageId(this.config.persistenceLabelResponse);if(e)return this.storage.get(e)}},{key:"getPersistentConfig",value:function(){return{selectedPlugin:this.getSelectedPluginName(),pluginsConfig:(0,T.A)(this.config.plugins,(function(e){return e.dynamicConfig}))}}},{key:"storePluginConfig",value:function(e,t){this.config.plugins[e].dynamicConfig=t,this.storeConfig(),this.emit("change",this)}},{key:"storeConfig",value:function(){var e=this.getStorageId(this.config.persistenceLabelConfig);e&&this.storage.set(e,this.getPersistentConfig(),this.config.persistencyExpire,this.handleLocalStorageQuotaFull)}},{key:"storeResponse",value:function(){var e=this.getStorageId(this.config.persistenceLabelResponse);if(e&&this.results){var t=this.results.getAsStoreObject(this.config.maxPersistentResponseSize);t&&!t.error?this.storage.set(e,t,this.config.persistencyExpire,this.handleLocalStorageQuotaFull):this.storage.remove(e)}}},{key:"setResponse",value:function(e,t){e&&(this.results=new ct(e,t),this.draw(),this.storeResponse())}},{key:"initializePlugins",value:function(){for(var e in this.config.plugins)this.config.plugins[e]&&(t.plugins[e]?this.plugins[e]=new t.plugins[e](this):console.warn("Wanted to initialize plugin "+e+" but could not find a matching registered plugin"))}}],[{key:"registerPlugin",value:function(e,r){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];t.plugins[e]=r,t.defaults.plugins[e]=n?{enabled:!0}:{enabled:!1}}},{key:"clearStorage",value:function(){new A.wc(t.storageNamespace).removeNamespace()}}])}(p.EventEmitter);jt.defaults={persistenceId:function(e){var t="",r=e.rootEl;for(r.id&&(t=r.id);r&&r!==document;r=r.parentNode)if(r){r.id&&(t=r.id);break}return"yasr_"+t},getPlainQueryLinkToEndpoint:void 0,persistencyExpire:2592e3,persistenceLabelResponse:"response",persistenceLabelConfig:"config",maxPersistentResponseSize:1e5,prefixes:{},plugins:{},pluginOrder:["table","response"],defaultPlugin:"table"},jt.plugins={},jt.Dependencies={},jt.storageNamespace="triply",jt.registerPlugin("table",Lt),jt.registerPlugin("boolean",Nt),jt.registerPlugin("response",Rt),jt.registerPlugin("error",Dt);const Gt=jt},2928:(e,t,r)=>{"use strict";function n(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,s=[],l=!0,u=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){u=!0,i=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}(e,t)||a(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e){return function(e){if(Array.isArray(e))return s(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||a(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(e,t){if(e){if("string"==typeof e)return s(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?s(e,t):void 0}}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,l=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return s=e.done,e},e:function(e){l=!0,o=e},f:function(){try{s||null==r.return||r.return()}finally{if(l)throw o}}}}(e.split("&"));try{for(l.s();!(s=l.n()).done;){var u=s.value;if(""!==u){var p=n(c(t.decode?u.replace(/\+/g," "):u,"="),2),f=p[0],g=p[1];g=void 0===g?null:["comma","separator"].includes(t.arrayFormat)?g:h(g,t),r(h(f,t),g,o)}}}catch(e){l.e(e)}finally{l.f()}for(var m=0,y=Object.keys(o);m0})).join("&")},t.parseUrl=function(e,t){t=Object.assign({decode:!0},t);var r=n(c(e,"#"),2),i=r[0],o=r[1];return Object.assign({url:i.split("?")[0]||"",query:y(m(e),t)},t&&t.parseFragmentIdentifier&&o?{fragmentIdentifier:h(o,t)}:{})},t.stringifyUrl=function(e,r){r=Object.assign({encode:!0,strict:!0},r);var n=g(e.url).split("?")[0]||"",i=t.extract(e.url),o=t.parse(i,{sort:!1}),a=Object.assign(o,e.query),s=t.stringify(a,r);s&&(s="?".concat(s));var l=function(e){var t="",r=e.indexOf("#");return-1!==r&&(t=e.slice(r)),t}(e.url);return e.fragmentIdentifier&&(l="#".concat(f(e.fragmentIdentifier,r))),"".concat(n).concat(s).concat(l)},t.pick=function(e,r,n){n=Object.assign({parseFragmentIdentifier:!0},n);var i=t.parseUrl(e,n),o=i.url,a=i.query,s=i.fragmentIdentifier;return t.stringifyUrl({url:o,query:p(a,r),fragmentIdentifier:s},n)},t.exclude=function(e,r,n){var i=Array.isArray(r)?function(e){return!r.includes(e)}:function(e,t){return!r(e,t)};return t.pick(e,i,n)}},8723:e=>{"use strict";e.exports=function(e,t){if("string"!=typeof e||"string"!=typeof t)throw new TypeError("Expected the arguments to be of type `string`");if(""===t)return[e];var r=e.indexOf(t);return-1===r?[e]:[e.slice(0,r),e.slice(r+t.length)]}},7781:e=>{"use strict";e.exports=function(e){return encodeURIComponent(e).replace(/[!'()*]/g,(function(e){return"%".concat(e.charCodeAt(0).toString(16).toUpperCase())}))}},65:e=>{"use strict";function t(e){return function(e){if(Array.isArray(e))return r(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return r(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,l=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return s=e.done,e},e:function(e){l=!0,a=e},f:function(){try{s||null==r.return||r.return()}finally{if(l)throw a}}}}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r{"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return o(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return o(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,l=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return s=e.done,e},e:function(e){l=!0,a=e},f:function(){try{s||null==r.return||r.return()}finally{if(l)throw a}}}}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0||e instanceof Object)?t(e):null)},S.prototype.toError=function(){var e=this.req,t=e.method,r=e.url,n="cannot ".concat(t," ").concat(r," (").concat(this.status,")"),i=new Error(n);return i.status=this.status,i.method=t,i.url=r,i},y.Response=S,s(L.prototype),f(L.prototype,c.prototype),L.prototype.type=function(e){return this.set("Content-Type",y.types[e]||e),this},L.prototype.accept=function(e){return this.set("Accept",y.types[e]||e),this},L.prototype.auth=function(e,t,r){1===arguments.length&&(t=""),"object"===n(t)&&null!==t&&(r=t,t=""),r||(r={type:"function"==typeof btoa?"basic":"auto"});var i=r.encoder?r.encoder:function(e){if("function"==typeof btoa)return btoa(e);throw new Error("Cannot use basic auth, btoa is not a function")};return this._auth(e,t,r,i)},L.prototype.query=function(e){return"string"!=typeof e&&(e=b(e)),e&&this._query.push(e),this},L.prototype.attach=function(e,t,r){if(t){if(this._data)throw new Error("superagent can't mix .send() and .attach()");this._getFormData().append(e,t,r||t.name)}return this},L.prototype._getFormData=function(){return this._formData||(this._formData=new a.FormData),this._formData},L.prototype.callback=function(e,t){if(this._shouldRetry(e,t))return this._retry();var r=this._callback;this.clearTimeout(),e&&(this._maxRetries&&(e.retries=this._retries-1),this.emit("error",e)),r(e,t)},L.prototype.crossDomainError=function(){var e=new Error("Request has been terminated\nPossible causes: the network is offline, Origin is not allowed by Access-Control-Allow-Origin, the page is being unloaded, etc.");e.crossDomain=!0,e.status=this.status,e.method=this.method,e.url=this.url,this.callback(e)},L.prototype.agent=function(){return console.warn("This is not supported in browser version of superagent"),this},L.prototype.ca=L.prototype.agent,L.prototype.buffer=L.prototype.ca,L.prototype.write=function(){throw new Error("Streaming is not supported in browser version of superagent")},L.prototype.pipe=L.prototype.write,L.prototype._isHost=function(e){return e&&"object"===n(e)&&!Array.isArray(e)&&"[object Object]"!==Object.prototype.toString.call(e)},L.prototype.end=function(e){this._endCalled&&console.warn("Warning: .end() was called twice. This is not supported in superagent"),this._endCalled=!0,this._callback=e||v,this._finalizeQueryString(),this._end()},L.prototype._setUploadTimeout=function(){var e=this;this._uploadTimeout&&!this._uploadTimeoutTimer&&(this._uploadTimeoutTimer=setTimeout((function(){e._timeoutError("Upload timeout of ",e._uploadTimeout,"ETIMEDOUT")}),this._uploadTimeout))},L.prototype._end=function(){if(this._aborted)return this.callback(new Error("The request has been aborted even before .end() was called"));var e=this;this.xhr=y.getXHR();var t=this.xhr,r=this._formData||this._data;this._setTimeouts(),t.addEventListener("readystatechange",(function(){var r=t.readyState;if(r>=2&&e._responseTimeoutTimer&&clearTimeout(e._responseTimeoutTimer),4===r){var n;try{n=t.status}catch(e){n=0}if(!n){if(e.timedout||e._aborted)return;return e.crossDomainError()}e.emit("end")}}));var n=function(t,r){r.total>0&&(r.percent=r.loaded/r.total*100,100===r.percent&&clearTimeout(e._uploadTimeoutTimer)),r.direction=t,e.emit("progress",r)};if(this.hasListeners("progress"))try{t.addEventListener("progress",n.bind(null,"download")),t.upload&&t.upload.addEventListener("progress",n.bind(null,"upload"))}catch(e){}t.upload&&this._setUploadTimeout();try{this.username&&this.password?t.open(this.method,this.url,!0,this.username,this.password):t.open(this.method,this.url,!0)}catch(e){return this.callback(e)}if(this._withCredentials&&(t.withCredentials=!0),!this._formData&&"GET"!==this.method&&"HEAD"!==this.method&&"string"!=typeof r&&!this._isHost(r)){var i=this._header["content-type"],o=this._serializer||y.serialize[i?i.split(";")[0]:""];!o&&A(i)&&(o=y.serialize["application/json"]),o&&(r=o(r))}for(var a in this.header)null!==this.header[a]&&h(this.header,a)&&t.setRequestHeader(a,this.header[a]);this._responseType&&(t.responseType=this._responseType),this.emit("request",this),t.send(void 0===r?null:r)},y.agent=function(){return new m};for(var N=function(){var e=I[C];m.prototype[e.toLowerCase()]=function(t,r){var n=new y.Request(e,t);return this._setDefaults(n),r&&n.end(r),n}},C=0,I=["GET","POST","OPTIONS","PATCH","PUT","DELETE"];C{"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var i=r(2623),o=r(4711),a=o.isObject,s=o.hasOwn;function l(){}e.exports=l,l.prototype.clearTimeout=function(){return clearTimeout(this._timer),clearTimeout(this._responseTimeoutTimer),clearTimeout(this._uploadTimeoutTimer),delete this._timer,delete this._responseTimeoutTimer,delete this._uploadTimeoutTimer,this},l.prototype.parse=function(e){return this._parser=e,this},l.prototype.responseType=function(e){return this._responseType=e,this},l.prototype.serialize=function(e){return this._serializer=e,this},l.prototype.timeout=function(e){if(!e||"object"!==n(e))return this._timeout=e,this._responseTimeout=0,this._uploadTimeout=0,this;for(var t in e)if(s(e,t))switch(t){case"deadline":this._timeout=e.deadline;break;case"response":this._responseTimeout=e.response;break;case"upload":this._uploadTimeout=e.upload;break;default:console.warn("Unknown timeout option",t)}return this},l.prototype.retry=function(e,t){return 0!==arguments.length&&!0!==e||(e=1),e<=0&&(e=0),this._maxRetries=e,this._retries=0,this._retryCallback=t,this};var u=new Set(["ETIMEDOUT","ECONNRESET","EADDRINUSE","ECONNREFUSED","EPIPE","ENOTFOUND","ENETUNREACH","EAI_AGAIN"]),c=new Set([408,413,429,500,502,503,504,521,522,524]);l.prototype._shouldRetry=function(e,t){if(!this._maxRetries||this._retries++>=this._maxRetries)return!1;if(this._retryCallback)try{var r=this._retryCallback(e,t);if(!0===r)return!0;if(!1===r)return!1}catch(e){console.error(e)}if(t&&t.status&&c.has(t.status))return!0;if(e){if(e.code&&u.has(e.code))return!0;if(e.timeout&&"ECONNABORTED"===e.code)return!0;if(e.crossDomain)return!0}return!1},l.prototype._retry=function(){return this.clearTimeout(),this.req&&(this.req=null,this.req=this.request()),this._aborted=!1,this.timedout=!1,this.timedoutError=null,this._end()},l.prototype.then=function(e,t){var r=this;if(!this._fullfilledPromise){var n=this;this._endCalled&&console.warn("Warning: superagent request was sent twice, because both .end() and .then() were called. Never call .end() if you use promises"),this._fullfilledPromise=new Promise((function(e,t){n.on("abort",(function(){if(!(r._maxRetries&&r._maxRetries>r._retries))if(r.timedout&&r.timedoutError)t(r.timedoutError);else{var e=new Error("Aborted");e.code="ABORTED",e.status=r.status,e.method=r.method,e.url=r.url,t(e)}})),n.end((function(r,n){r?t(r):e(n)}))}))}return this._fullfilledPromise.then(e,t)},l.prototype.catch=function(e){return this.then(void 0,e)},l.prototype.use=function(e){return e(this),this},l.prototype.ok=function(e){if("function"!=typeof e)throw new Error("Callback required");return this._okCallback=e,this},l.prototype._isResponseOK=function(e){return!!e&&(this._okCallback?this._okCallback(e):e.status>=200&&e.status<300)},l.prototype.get=function(e){return this._header[e.toLowerCase()]},l.prototype.getHeader=l.prototype.get,l.prototype.set=function(e,t){if(a(e)){for(var r in e)s(e,r)&&this.set(r,e[r]);return this}return this._header[e.toLowerCase()]=t,this.header[e]=t,this},l.prototype.unset=function(e){return delete this._header[e.toLowerCase()],delete this.header[e],this},l.prototype.field=function(e,t,r){if(null==e)throw new Error(".field(name, val) name can not be empty");if(this._data)throw new Error(".field() can't be used if .send() is used. Please use only .send() or only .field() & .attach()");if(a(e)){for(var n in e)s(e,n)&&this.field(n,e[n]);return this}if(Array.isArray(t)){for(var i in t)s(t,i)&&this.field(e,t[i]);return this}if(null==t)throw new Error(".field(name, val) val can not be empty");return"boolean"==typeof t&&(t=String(t)),r?this._getFormData().append(e,t,r):this._getFormData().append(e,t),this},l.prototype.abort=function(){if(this._aborted)return this;if(this._aborted=!0,this.xhr&&this.xhr.abort(),this.req){if(i.gte(process.version,"v13.0.0")&&i.lt(process.version,"v14.0.0"))throw new Error("Superagent does not work in v13 properly with abort() due to Node.js core changes");this.req.abort()}return this.clearTimeout(),this.emit("abort"),this},l.prototype._auth=function(e,t,r,n){switch(r.type){case"basic":this.set("Authorization","Basic ".concat(n("".concat(e,":").concat(t))));break;case"auto":this.username=e,this.password=t;break;case"bearer":this.set("Authorization","Bearer ".concat(e))}return this},l.prototype.withCredentials=function(e){return void 0===e&&(e=!0),this._withCredentials=e,this},l.prototype.redirects=function(e){return this._maxRedirects=e,this},l.prototype.maxResponseSize=function(e){if("number"!=typeof e)throw new TypeError("Invalid argument");return this._maxResponseSize=e,this},l.prototype.toJSON=function(){return{method:this.method,url:this.url,data:this._data,headers:this._header}},l.prototype.send=function(e){var t=a(e),r=this._header["content-type"];if(this._formData)throw new Error(".send() can't be used if .attach() or .field() is used. Please use only .send() or only .field() & .attach()");if(t&&!this._data)Array.isArray(e)?this._data=[]:this._isHost(e)||(this._data={});else if(e&&this._data&&this._isHost(this._data))throw new Error("Can't merge these send calls");if(t&&a(this._data))for(var n in e){if("bigint"==typeof e[n]&&!e[n].toJSON)throw new Error("Cannot serialize BigInt value to json");s(e,n)&&(this._data[n]=e[n])}else{if("bigint"==typeof e)throw new Error("Cannot send value of type BigInt");"string"==typeof e?(r||this.type("form"),(r=this._header["content-type"])&&(r=r.toLowerCase().trim()),this._data="application/x-www-form-urlencoded"===r?this._data?"".concat(this._data,"&").concat(e):e:(this._data||"")+e):this._data=e}return!t||this._isHost(e)||r||this.type("json"),this},l.prototype.sortQuery=function(e){return this._sort=void 0===e||e,this},l.prototype._finalizeQueryString=function(){var e=this._query.join("&");if(e&&(this.url+=(this.url.includes("?")?"&":"?")+e),this._query.length=0,this._sort){var t=this.url.indexOf("?");if(t>=0){var r=this.url.slice(t+1).split("&");"function"==typeof this._sort?r.sort(this._sort):r.sort(),this.url=this.url.slice(0,t)+"?"+r.join("&")}}},l.prototype._appendQueryString=function(){console.warn("Unsupported")},l.prototype._timeoutError=function(e,t,r){if(!this._aborted){var n=new Error("".concat(e+t,"ms exceeded"));n.timeout=t,n.code="ECONNABORTED",n.errno=r,this.timedout=!0,this.timedoutError=n,this.abort(),this.callback(n)}},l.prototype._setTimeouts=function(){var e=this;this._timeout&&!this._timer&&(this._timer=setTimeout((function(){e._timeoutError("Timeout of ",e._timeout,"ETIME")}),this._timeout)),this._responseTimeout&&!this._responseTimeoutTimer&&(this._responseTimeoutTimer=setTimeout((function(){e._timeoutError("Response timeout of ",e._responseTimeout,"ETIMEDOUT")}),this._responseTimeout))}},9473:(e,t,r)=>{"use strict";var n=r(4711);function i(){}e.exports=i,i.prototype.get=function(e){return this.header[e.toLowerCase()]},i.prototype._setHeaderProperties=function(e){var t=e["content-type"]||"";this.type=n.type(t);var r=n.params(t);for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(this[i]=r[i]);this.links={};try{e.link&&(this.links=n.parseLinks(e.link))}catch(e){}},i.prototype._setStatusProperties=function(e){var t=Math.trunc(e/100);this.statusCode=e,this.status=this.statusCode,this.statusType=t,this.info=1===t,this.ok=2===t,this.redirect=3===t,this.clientError=4===t,this.serverError=5===t,this.error=(4===t||5===t)&&this.toError(),this.created=201===e,this.accepted=202===e,this.noContent=204===e,this.badRequest=400===e,this.unauthorized=401===e,this.notAcceptable=406===e,this.forbidden=403===e,this.notFound=404===e,this.unprocessableEntity=422===e}},4711:(e,t)=>{"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function n(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return i(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return i(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,l=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return s=e.done,e},e:function(e){l=!0,a=e},f:function(){try{s||null==r.return||r.return()}finally{if(l)throw a}}}}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r(()=>{"use strict";var e={887:e=>{e.exports=function(e){for(var t=5381,r=e.length;r;)t=33*t^e.charCodeAt(--r);return t>>>0}}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var o=t[n]={exports:{}};return e[n](o,o.exports,r),o.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};return(()=>{r.r(n),r.d(n,{default:()=>p});var e=r(887),t=r.n(e);function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:{};a(this,e),s(this,"ID","id"),s(this,"PX","px"),s(this,"RESIZABLE","grip-resizable"),s(this,"FLEX","grip-flex"),s(this,"legacyIE",navigator.userAgent.indexOf("Trident/4.0")>0),s(this,"reset",(function(e){return n.init(e)})),s(this,"onResize",(function(){var e=n.tb;if(e.classList.remove(n.RESIZABLE),e.opt.fixed){e.tableWidth=Number(window.getComputedStyle(e).width.replace(/px/,"")).valueOf();for(var t=0,r=0;r tbody > tr > td, .grip-resizable > tbody > tr > th{overflow:hidden} .grip-padding > tbody > tr > td, .grip-padding > tbody > tr > th{padding-left:0!important; padding-right:0!important;} .grip-container{ height:0px; position:relative;} .grip-handle{margin-left:-5px; position:absolute; z-index:5; } .grip-handle .grip-resizable{position:absolute;background-color:red;filter:alpha(opacity=1);opacity:0;width:10px;height:100%;cursor: col-resize;top:0px} .grip-lastgrip{position:absolute; width:1px; } .grip-drag{ border-left:1px dotted black;\t} .grip-flex{width:auto!important;} .grip-handle.grip-disabledgrip .grip-resizable{cursor:default; display:none;}"),e.hoverCursor&&"col-resize"!==e.hoverCursor){var o=".grip-handle .grip-resizable:hover{cursor:"+e.hoverCursor+"!important}";n.createStyle(i,o)}t.setAttribute(n.ID,r);var a=t.opt;t.opt=n.extendOptions(e);var s=n.getTableHeaders(t);if(n.extendTable(s),e.remoteTable&&e.remoteTable.matches("table")){var l=n.getTableHeaders(t.opt.remoteTable);s.length===l.length?n.extendRemoteTable(t.opt.remoteTable,l,t):console.warn("column count for remote table did not match")}return a})),s(this,"applyBounds",(function(){var e=n.tb,t=e.columns.map((function(e){return window.getComputedStyle(e).width}));e.style.width=window.getComputedStyle(e).width,e.tableWidth=Number(e.style.width.replace(/px/,"")).valueOf(),e.classList.remove(n.FLEX),e.columns.forEach((function(r,n){r.style.width=t[n];var i=Number(t[n].replace(/px/,"")).valueOf();r.w=i,e.opt.currentWidths[n]=i})),e.classList.add(n.FLEX)})),s(this,"serializeStore",(function(){var e=n.store,t=n.tb;e[t.getAttribute(n.ID)]="";for(var r=0,i=0;ithead>tr:nth-of-type(1)>th"));return(r=r.concat(Array.from(e.querySelectorAll(t+">thead>tr:nth-of-type(1)>td")))).length||(r=(r=(r=(r=Array.from(e.querySelectorAll(t+">tbody>tr:nth-of-type(1)>th"))).concat(Array.from(e.querySelectorAll(t+">tr:nth-of-type(1)>th")))).concat(Array.from(e.querySelectorAll(t+">tbody>tr:nth-of-type(1)>td")))).concat(Array.from(e.querySelectorAll(t+">tr:nth-of-type(1)>td")))),n.filterInvisible(r,!1)})),s(this,"filterInvisible",(function(e,t){return e.filter((function(e){var r=t?-1:e.offsetWidth,n=t?-1:e.offsetHeight;return!(0===r&&0===n||e.style&&e.style.display&&"none"===window.getComputedStyle(e).display)}))})),s(this,"extendTable",(function(e){var t=n.tb;t.opt.removePadding&&t.classList.add("grip-padding"),t.classList.add(n.RESIZABLE),t.insertAdjacentHTML("beforebegin",''),t.grips=[],t.columns=[],t.tableWidth=Number(window.getComputedStyle(t).width.replace(/px/,"")).valueOf(),t.gripContainer=t.previousElementSibling,t.opt.marginLeft&&(t.gripContainer.style.marginLeft=t.opt.marginLeft),t.opt.marginRight&&(t.gripContainer.style.marginRight=t.opt.marginRight),t.cellSpace=parseInt(n.legacyIE?t.cellSpacing||t.currentStyle.borderSpacing:window.getComputedStyle(t).borderSpacing.split(" ")[0].replace(/px/,""))||2,t.borderSpace=parseInt(n.legacyIE?t.border||t.currentStyle.borderLeftWidth:window.getComputedStyle(t).borderLeftWidth.replace(/px/,""))||1,t.extended=!0,n.createGrips(e)})),s(this,"extendRemoteTable",(function(e,t,r){r.opt.removePadding&&e.classList.add("grip-padding"),e.classList.add(n.RESIZABLE),e.getAttribute(n.ID)||e.setAttribute(n.ID,r.getAttribute(n.ID)+"remote"),e.columns=[],t.forEach((function(i,o){var a=t[o];a.w=r.columns[o].w,a.style.width=a.w+n.PX,a.removeAttribute("width"),e.columns.push(a)})),e.tableWidth=r.tableWidth,e.cellSpace=r.cellSpace,e.borderSpace=r.borderSpace;var i=Array.from(e.querySelectorAll("col"));e.columnGrp=n.filterInvisible(i,!0),e.columnGrp.forEach((function(e,t){e.removeAttribute("width"),e.style.width=r.columnGrp[t].style.width})),r.remote=e})),s(this,"createGrips",(function(e){var t=n.tb;t.columnGrp=n.filterInvisible(Array.from(t.querySelectorAll("col")),!0),t.columnGrp.forEach((function(e){e.removeAttribute("width")})),t.columnCnt=e.length;var r=!1;n.store[t.getAttribute(n.ID)]&&(n.deserializeStore(e),r=!0),e.forEach((function(i,o){var a=e[o],s=-1!==t.opt.disabledColumns.indexOf(o);n.createDiv(t.gripContainer,"grip-handle");var l=t.gripContainer.lastChild;!s&&t.opt.gripInnerHtml&&(l.innerHTML=t.opt.gripInnerHtml),n.createDiv(l,n.RESIZABLE),o===t.columnCnt-1&&(l.classList.add("grip-lastgrip"),t.opt.fixed&&(l.innerHTML="")),l.addEventListener("touchstart",n.onGripMouseDown,{capture:!0,passive:!0}),l.addEventListener("mousedown",n.onGripMouseDown,!0),s?l.classList.add("grip-disabledgrip"):(l.classList.remove("grip-disabledgrip"),l.addEventListener("touchstart",n.onGripMouseDown,{capture:!0,passive:!0}),l.addEventListener("mousedown",n.onGripMouseDown,!0)),l.t=t,l.i=o,t.opt.widths[o]?a.w=t.opt.widths[o]:a.w=r?Number(a.style.width.replace(/px/,"")).valueOf():Number(window.getComputedStyle(a).width.replace(/px/,"")).valueOf(),t.opt.currentWidths[o]=a.w,a.style.width=a.w+n.PX,a.removeAttribute("width"),l.data={i:o,t:t.getAttribute(n.ID),last:o===t.columnCnt-1},t.grips.push(l),t.columns.push(a)}));var i=Array.from(t.querySelectorAll("td"));i.concat(Array.from(t.querySelectorAll("th"))),(i=(i=i.filter((function(t){for(var r=0;r{"use strict";r.r(t)},2357:(e,t,r)=>{"use strict";r.r(t)},2144:(e,t,r)=>{"use strict";r.r(t)},6855:(e,t,r)=>{"use strict";r.r(t)},2276:(e,t,r)=>{"use strict";r.r(t)},991:(e,t,r)=>{"use strict";r.r(t)},3380:(e,t,r)=>{"use strict";r.r(t)},6824:(e,t,r)=>{"use strict";r.r(t)},2700:(e,t,r)=>{"use strict";r.r(t)},8839:(e,t,r)=>{"use strict";r.r(t)},1710:(e,t,r)=>{"use strict";r.r(t)},8956:(e,t,r)=>{"use strict";r.r(t)},9715:(e,t,r)=>{"use strict";r.r(t)},3614:(e,t,r)=>{"use strict";r.r(t)},7392:(e,t,r)=>{"use strict";r.r(t)},5851:(e,t,r)=>{"use strict";r.r(t)},9436:(e,t,r)=>{"use strict";r.r(t)},4023:(e,t,r)=>{"use strict";r.r(t)},4779:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=[],n="M12.83 352h262.34A12.82 12.82 0 0 0 288 339.17v-38.34A12.82 12.82 0 0 0 275.17 288H12.83A12.82 12.82 0 0 0 0 300.83v38.34A12.82 12.82 0 0 0 12.83 352zm0-256h262.34A12.82 12.82 0 0 0 288 83.17V44.83A12.82 12.82 0 0 0 275.17 32H12.83A12.82 12.82 0 0 0 0 44.83v38.34A12.82 12.82 0 0 0 12.83 96zM432 160H16a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zm0 256H16a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16z";t.definition={prefix:"fas",iconName:"align-left",icon:[448,512,r,"f036",n]},t.faAlignLeft=t.definition,t.prefix="fas",t.iconName="align-left",t.width=448,t.height=512,t.ligatures=r,t.unicode="f036",t.svgPathData=n},1475:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=[],n="M216 0h80c13.3 0 24 10.7 24 24v168h87.7c17.8 0 26.7 21.5 14.1 34.1L269.7 378.3c-7.5 7.5-19.8 7.5-27.3 0L90.1 226.1c-12.6-12.6-3.7-34.1 14.1-34.1H192V24c0-13.3 10.7-24 24-24zm296 376v112c0 13.3-10.7 24-24 24H24c-13.3 0-24-10.7-24-24V376c0-13.3 10.7-24 24-24h146.7l49 49c20.1 20.1 52.5 20.1 72.6 0l49-49H488c13.3 0 24 10.7 24 24zm-124 88c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20zm64 0c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20z";t.definition={prefix:"fas",iconName:"download",icon:[512,512,r,"f019",n]},t.faDownload=t.definition,t.prefix="fas",t.iconName="download",t.width=512,t.height=512,t.ligatures=r,t.unicode="f019",t.svgPathData=n},4179:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=[],n="M504 256c0 136.997-111.043 248-248 248S8 392.997 8 256C8 119.083 119.043 8 256 8s248 111.083 248 248zM262.655 90c-54.497 0-89.255 22.957-116.549 63.758-3.536 5.286-2.353 12.415 2.715 16.258l34.699 26.31c5.205 3.947 12.621 3.008 16.665-2.122 17.864-22.658 30.113-35.797 57.303-35.797 20.429 0 45.698 13.148 45.698 32.958 0 14.976-12.363 22.667-32.534 33.976C247.128 238.528 216 254.941 216 296v4c0 6.627 5.373 12 12 12h56c6.627 0 12-5.373 12-12v-1.333c0-28.462 83.186-29.647 83.186-106.667 0-58.002-60.165-102-116.531-102zM256 338c-25.365 0-46 20.635-46 46 0 25.364 20.635 46 46 46s46-20.636 46-46c0-25.365-20.635-46-46-46z";t.definition={prefix:"fas",iconName:"question-circle",icon:[512,512,r,"f059",n]},t.faQuestionCircle=t.definition,t.prefix="fas",t.iconName="question-circle",t.width=512,t.height=512,t.ligatures=r,t.unicode="f059",t.svgPathData=n},6095:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=[],n="M464 32H48C21.49 32 0 53.49 0 80v352c0 26.51 21.49 48 48 48h416c26.51 0 48-21.49 48-48V80c0-26.51-21.49-48-48-48zM224 416H64v-96h160v96zm0-160H64v-96h160v96zm224 160H288v-96h160v96zm0-160H288v-96h160v96z";t.definition={prefix:"fas",iconName:"table",icon:[512,512,r,"f0ce",n]},t.faTable=t.definition,t.prefix="fas",t.iconName="table",t.width=512,t.height=512,t.ligatures=r,t.unicode="f0ce",t.svgPathData=n},2980:function(e){var t;t=function(){"use strict";function e(e,t){for(var r=0;r").concat(e,"")},c=function(e,t,r){var n=document.createDocumentFragment();t.forEach((function(e,o){var a=document.createElement(r.element),s=t[o].index;a.setAttribute(i,s),a.setAttribute("class","autoComplete_result"),r.content?r.content(e,a):a.innerHTML=e.match||e,n.appendChild(a)})),e.appendChild(n)},p=t;n.prototype=window.Event.prototype;var d={CustomEventWrapper:"function"==typeof window.CustomEvent&&window.CustomEvent||n,initElementClosestPolyfill:function(){Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector),Element.prototype.closest||(Element.prototype.closest=function(e){var t=this;do{if(t.matches(e))return t;t=t.parentElement||t.parentNode}while(null!==t&&1===t.nodeType);return null})}};return function(){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var r=e.selector,n=void 0===r?"#autoComplete":r,i=e.data,o=i.key,a=i.src,u=i.cache,c=void 0===u||u,p=e.query,d=e.trigger,f=(d=void 0===d?{}:d).event,h=void 0===f?["input"]:f,g=d.condition,m=void 0!==g&&g,v=e.searchEngine,y=void 0===v?"strict":v,E=e.threshold,b=void 0===E?0:E,x=e.debounce,T=void 0===x?0:x,A=e.resultsList,S=(A=void 0===A?{}:A).render,L=void 0!==S&&S,N=A.container,C=void 0!==N&&N,I=A.destination,_=A.position,w=void 0===_?"afterend":_,R=A.element,O=void 0===R?"ul":R,D=A.navigation,P=void 0!==D&&D,k=e.sort,M=void 0!==k&&k,F=e.placeHolder,j=e.maxResults,G=void 0===j?5:j,B=e.resultItem,U=(B=void 0===B?{}:B).content,H=void 0!==U&&U,q=B.element,V=void 0===q?"li":q,W=e.noResults,z=e.highlight,Q=void 0!==z&&z,X=e.onSelection,$=L?l({container:C,destination:I||s(n),position:w,element:O}):null;this.selector=n,this.data={src:function(){return"function"==typeof a?a():a},key:o,cache:c},this.query=p,this.trigger={event:h,condition:m},this.searchEngine="loose"===y?"loose":"function"==typeof y?y:"strict",this.threshold=b,this.debounce=T,this.resultsList={render:L,view:$,navigation:P},this.sort=M,this.placeHolder=F,this.maxResults=G,this.resultItem={content:H,element:V},this.noResults=W,this.highlight=Q,this.onSelection=X,this.init()}return function(t,r,n){r&&e(t.prototype,r)}(t,[{key:"search",value:function(e,t){var r=t.toLowerCase();if("loose"===this.searchEngine){e=e.replace(/ /g,"");for(var n=[],i=0,o=0;oe.threshold&&l.replace(/ /g,"").length;if(u){var h=e.resultsList.view;p(h),f?e.listMatchedResults(e.dataStream,n).then((function(s){i(n,s),e.resultsList.render&&(0===s.list.length&&e.noResults?e.noResults():(c(h,s.list,e.resultItem),e.onSelection&&(e.resultsList.navigation?e.resultsList.navigation(n,t,h,e.onSelection,s):function(e,t,n,i){function s(e){d.classList.remove(o),u=1===e?d.nextSibling:d.previousSibling}function l(e){(d=e).classList.add(o)}var u,c=t.childNodes,p=c.length-1,d=void 0;e.onkeydown=function(o){if(0{e.exports=function(e,t){const r=[];return 0===t.length?r.push({text:e,highlight:!1}):t[0][0]>0&&r.push({text:e.slice(0,t[0][0]),highlight:!1}),t.forEach((n,i)=>{const o=n[0],a=n[1];r.push({text:e.slice(o,a),highlight:!0}),i===t.length-1?a{"use strict";var n=r(8651),i=r(6601),o=i(n("String.prototype.indexOf"));e.exports=function(e,t){var r=n(e,!!t);return"function"==typeof r&&o(e,".prototype.")>-1?i(r):r}},6601:(e,t,r)=>{"use strict";var n=r(5049),i=r(8651),o=r(6255),a=r(6785),s=i("%Function.prototype.apply%"),l=i("%Function.prototype.call%"),u=i("%Reflect.apply%",!0)||n.call(l,s),c=r(6649),p=i("%Math.max%");e.exports=function(e){if("function"!=typeof e)throw new a("a function is required");var t=u(n,l,arguments);return o(t,1+p(0,e.length-(arguments.length-1)),!0)};var d=function(){return u(n,s,arguments)};c?c(e.exports,"apply",{value:d}):e.exports.apply=d},8709:(e,t,r)=>{!function(e){var t=/MSIE \d/.test(navigator.userAgent)&&(null==document.documentMode||document.documentMode<8),r=e.Pos,n={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<","<":">>",">":"<<"};function i(e){return e&&e.bracketRegex||/[(){}[\]]/}function o(e,t,o){var s=e.getLineHandle(t.line),l=t.ch-1,u=o&&o.afterCursor;null==u&&(u=/(^| )cm-fat-cursor($| )/.test(e.getWrapperElement().className));var c=i(o),p=!u&&l>=0&&c.test(s.text.charAt(l))&&n[s.text.charAt(l)]||c.test(s.text.charAt(l+1))&&n[s.text.charAt(++l)];if(!p)return null;var d=">"==p.charAt(1)?1:-1;if(o&&o.strict&&d>0!=(l==t.ch))return null;var f=e.getTokenTypeAt(r(t.line,l+1)),h=a(e,r(t.line,l+(d>0?1:0)),d,f,o);return null==h?null:{from:r(t.line,l),to:h&&h.pos,match:h&&h.ch==p.charAt(0),forward:d>0}}function a(e,t,o,a,s){for(var l=s&&s.maxScanLineLength||1e4,u=s&&s.maxScanLines||1e3,c=[],p=i(s),d=o>0?Math.min(t.line+u,e.lastLine()+1):Math.max(e.firstLine()-1,t.line-u),f=t.line;f!=d;f+=o){var h=e.getLine(f);if(h){var g=o>0?0:h.length-1,m=o>0?h.length:-1;if(!(h.length>l))for(f==t.line&&(g=t.ch-(o<0?1:0));g!=m;g+=o){var v=h.charAt(g);if(p.test(v)&&(void 0===a||(e.getTokenTypeAt(r(f,g+1))||"")==(a||""))){var y=n[v];if(y&&">"==y.charAt(1)==o>0)c.push(v);else{if(!c.length)return{pos:r(f,g),ch:v};c.pop()}}}}}return f-o!=(o>0?e.lastLine():e.firstLine())&&null}function s(e,n,i){for(var a=e.state.matchBrackets.maxHighlightLineLength||1e3,s=i&&i.highlightNonMatching,l=[],u=e.listSelections(),c=0;c{!function(e){"use strict";function t(t){return function(r,n){var i=n.line,o=r.getLine(i);function a(t){for(var a,s=n.ch,l=0;;){var u=s<=0?-1:o.lastIndexOf(t[0],s-1);if(-1!=u){if(1==l&&ut.lastLine())return null;var n=t.getTokenAt(e.Pos(r,1));if(/\S/.test(n.string)||(n=t.getTokenAt(e.Pos(r,n.end+1))),"keyword"!=n.type||"import"!=n.string)return null;for(var i=r,o=Math.min(t.lastLine(),r+10);i<=o;++i){var a=t.getLine(i).indexOf(";");if(-1!=a)return{startCh:n.end,end:e.Pos(i,a)}}}var i,o=r.line,a=n(o);if(!a||n(o-1)||(i=n(o-2))&&i.end.line==o-1)return null;for(var s=a.end;;){var l=n(s.line+1);if(null==l)break;s=l.end}return{from:t.clipPos(e.Pos(o,a.startCh+1)),to:s}})),e.registerHelper("fold","include",(function(t,r){function n(r){if(rt.lastLine())return null;var n=t.getTokenAt(e.Pos(r,1));return/\S/.test(n.string)||(n=t.getTokenAt(e.Pos(r,n.end+1))),"meta"==n.type&&"#include"==n.string.slice(0,8)?n.start+8:void 0}var i=r.line,o=n(i);if(null==o||null!=n(i-1))return null;for(var a=i;null!=n(a+1);)++a;return{from:e.Pos(i,o+1),to:t.clipPos(e.Pos(a))}}))}(r(1719))},9754:(e,t,r)=>{!function(e){"use strict";function t(t,r,i,o){if(i&&i.call){var a=i;i=null}else a=n(t,i,"rangeFinder");"number"==typeof r&&(r=e.Pos(r,0));var s=n(t,i,"minFoldSize");function l(e){var n=a(t,r);if(!n||n.to.line-n.from.linet.firstLine();)r=e.Pos(r.line-1,0),u=l(!1);if(u&&!u.cleared&&"unfold"!==o){var c=function(e,t,r){var i=n(e,t,"widget");if("function"==typeof i&&(i=i(r.from,r.to)),"string"==typeof i){var o=document.createTextNode(i);(i=document.createElement("span")).appendChild(o),i.className="CodeMirror-foldmarker"}else i&&(i=i.cloneNode(!0));return i}(t,i,u);e.on(c,"mousedown",(function(t){p.clear(),e.e_preventDefault(t)}));var p=t.markText(u.from,u.to,{replacedWith:c,clearOnEnter:n(t,i,"clearOnEnter"),__isFold:!0});p.on("clear",(function(r,n){e.signal(t,"unfold",t,r,n)})),e.signal(t,"fold",t,u.from,u.to)}}e.newFoldFunction=function(e,r){return function(n,i){t(n,i,{rangeFinder:e,widget:r})}},e.defineExtension("foldCode",(function(e,r,n){t(this,e,r,n)})),e.defineExtension("isFolded",(function(e){for(var t=this.findMarksAt(e),r=0;r{!function(e){"use strict";e.defineOption("foldGutter",!1,(function(t,n,i){var o;i&&i!=e.Init&&(t.clearGutter(t.state.foldGutter.options.gutter),t.state.foldGutter=null,t.off("gutterClick",l),t.off("changes",c),t.off("viewportChange",p),t.off("fold",d),t.off("unfold",d),t.off("swapDoc",c),t.off("optionChange",u)),n&&(t.state.foldGutter=new r((!0===(o=n)&&(o={}),null==o.gutter&&(o.gutter="CodeMirror-foldgutter"),null==o.indicatorOpen&&(o.indicatorOpen="CodeMirror-foldgutter-open"),null==o.indicatorFolded&&(o.indicatorFolded="CodeMirror-foldgutter-folded"),o)),s(t),t.on("gutterClick",l),t.on("changes",c),t.on("viewportChange",p),t.on("fold",d),t.on("unfold",d),t.on("swapDoc",c),t.on("optionChange",u))}));var t=e.Pos;function r(e){this.options=e,this.from=this.to=0}function n(e,r){for(var n=e.findMarks(t(r,0),t(r+1,0)),i=0;i=u){if(d&&a&&d.test(a.className))return;o=i(s.indicatorOpen)}}(o||a)&&e.setGutterMarker(r,s.gutter,o)}))}function a(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}function s(e){var t=e.getViewport(),r=e.state.foldGutter;r&&(e.operation((function(){o(e,t.from,t.to)})),r.from=t.from,r.to=t.to)}function l(e,r,i){var o=e.state.foldGutter;if(o){var a=o.options;if(i==a.gutter){var s=n(e,r);s?s.clear():e.foldCode(t(r,0),a)}}}function u(e,t){"mode"==t&&c(e)}function c(e){var t=e.state.foldGutter;if(t){var r=t.options;t.from=t.to=0,clearTimeout(t.changeUpdate),t.changeUpdate=setTimeout((function(){s(e)}),r.foldOnChangeTimeSpan||600)}}function p(e){var t=e.state.foldGutter;if(t){var r=t.options;clearTimeout(t.changeUpdate),t.changeUpdate=setTimeout((function(){var r=e.getViewport();t.from==t.to||r.from-t.to>20||t.from-r.to>20?s(e):e.operation((function(){r.fromt.to&&(o(e,t.to,r.to),t.to=r.to)}))}),r.updateViewportTimeSpan||400)}}function d(e,t){var r=e.state.foldGutter;if(r){var n=t.line;n>=r.from&&n{!function(e){"use strict";var t=e.Pos;function r(e,t){return e.line-t.line||e.ch-t.ch}var n="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",i=new RegExp("<(/?)(["+n+"]["+n+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*)","g");function o(e,t,r,n){this.line=t,this.ch=r,this.cm=e,this.text=e.getLine(t),this.min=n?Math.max(n.from,e.firstLine()):e.firstLine(),this.max=n?Math.min(n.to-1,e.lastLine()):e.lastLine()}function a(e,r){var n=e.cm.getTokenTypeAt(t(e.line,r));return n&&/\btag\b/.test(n)}function s(e){if(!(e.line>=e.max))return e.ch=0,e.text=e.cm.getLine(++e.line),!0}function l(e){if(!(e.line<=e.min))return e.text=e.cm.getLine(--e.line),e.ch=e.text.length,!0}function u(e){for(;;){var t=e.text.indexOf(">",e.ch);if(-1==t){if(s(e))continue;return}if(a(e,t+1)){var r=e.text.lastIndexOf("/",t),n=r>-1&&!/\S/.test(e.text.slice(r+1,t));return e.ch=t+1,n?"selfClose":"regular"}e.ch=t+1}}function c(e){for(;;){var t=e.ch?e.text.lastIndexOf("<",e.ch-1):-1;if(-1==t){if(l(e))continue;return}if(a(e,t+1)){i.lastIndex=t,e.ch=t;var r=i.exec(e.text);if(r&&r.index==t)return r}else e.ch=t}}function p(e){for(;;){i.lastIndex=e.ch;var t=i.exec(e.text);if(!t){if(s(e))continue;return}if(a(e,t.index+1))return e.ch=t.index+t[0].length,t;e.ch=t.index+1}}function d(e){for(;;){var t=e.ch?e.text.lastIndexOf(">",e.ch-1):-1;if(-1==t){if(l(e))continue;return}if(a(e,t+1)){var r=e.text.lastIndexOf("/",t),n=r>-1&&!/\S/.test(e.text.slice(r+1,t));return e.ch=t+1,n?"selfClose":"regular"}e.ch=t}}function f(e,r){for(var n=[];;){var i,o=p(e),a=e.line,s=e.ch-(o?o[0].length:0);if(!o||!(i=u(e)))return;if("selfClose"!=i)if(o[1]){for(var l=n.length-1;l>=0;--l)if(n[l]==o[2]){n.length=l;break}if(l<0&&(!r||r==o[2]))return{tag:o[2],from:t(a,s),to:t(e.line,e.ch)}}else n.push(o[2])}}function h(e,r){for(var n=[];;){var i=d(e);if(!i)return;if("selfClose"!=i){var o=e.line,a=e.ch,s=c(e);if(!s)return;if(s[1])n.push(s[2]);else{for(var l=n.length-1;l>=0;--l)if(n[l]==s[2]){n.length=l;break}if(l<0&&(!r||r==s[2]))return{tag:s[2],from:t(e.line,e.ch),to:t(o,a)}}}else c(e)}}e.registerHelper("fold","xml",(function(e,n){for(var i=new o(e,n.line,0);;){var a=p(i);if(!a||i.line!=n.line)return;var s=u(i);if(!s)return;if(!a[1]&&"selfClose"!=s){var l=t(i.line,i.ch),c=f(i,a[2]);return c&&r(c.from,l)>0?{from:l,to:c.from}:null}}})),e.findMatchingTag=function(e,n,i){var a=new o(e,n.line,n.ch,i);if(-1!=a.text.indexOf(">")||-1!=a.text.indexOf("<")){var s=u(a),l=s&&t(a.line,a.ch),p=s&&c(a);if(s&&p&&!(r(a,n)>0)){var d={from:t(a.line,a.ch),to:l,tag:p[2]};return"selfClose"==s?{open:d,close:null,at:"open"}:p[1]?{open:h(a,p[2]),close:d,at:"close"}:{open:d,close:f(a=new o(e,l.line,l.ch,i),p[2]),at:"open"}}}},e.findEnclosingTag=function(e,t,r,n){for(var i=new o(e,t.line,t.ch,r);;){var a=h(i,n);if(!a)break;var s=f(new o(e,t.line,t.ch,r),a.tag);if(s)return{open:a,close:s}}},e.scanForClosingTag=function(e,t,r,n){return f(new o(e,t.line,t.ch,n?{from:0,to:n}:null),r)}}(r(1719))},5397:(e,t,r)=>{!function(e){"use strict";function t(e,t){if(this.cm=e,this.options=t,this.widget=null,this.debounce=0,this.tick=0,this.startPos=this.cm.getCursor("start"),this.startLen=this.cm.getLine(this.startPos.line).length-this.cm.getSelection().length,this.options.updateOnCursorActivity){var r=this;e.on("cursorActivity",this.activityFunc=function(){r.cursorActivity()})}}e.showHint=function(e,t,r){if(!t)return e.showHint(r);r&&r.async&&(t.async=!0);var n={hint:t};if(r)for(var i in r)n[i]=r[i];return e.showHint(n)},e.defineExtension("showHint",(function(r){r=function(e,t,r){var n=e.options.hintOptions,i={};for(var o in l)i[o]=l[o];if(n)for(var o in n)void 0!==n[o]&&(i[o]=n[o]);if(r)for(var o in r)void 0!==r[o]&&(i[o]=r[o]);return i.hint.resolve&&(i.hint=i.hint.resolve(e,t)),i}(this,this.getCursor("start"),r);var n=this.listSelections();if(!(n.length>1)){if(this.somethingSelected()){if(!r.hint.supportsSelection)return;for(var i=0;iu.clientHeight+1;if(setTimeout((function(){I=a.getScrollInfo()})),_.bottom-C>0){var R=_.bottom-_.top,O=_.top-(v.bottom-v.top)-2;C-_.topO&&(u.style.height=(R=O)+"px"),u.style.top=(E=v.top-R)+T+"px",b=!1):u.style.height=C-_.top-2+"px"}var D,P=_.right-N;if(w&&(P+=a.display.nativeBarWidth),P>0&&(_.right-_.left>N&&(u.style.width=N-5+"px",P-=_.right-_.left-N),u.style.left=(y=Math.max(v.left-P-x,0))+"px"),w)for(var k=u.firstChild;k;k=k.nextSibling)k.style.paddingRight=a.display.nativeBarWidth+"px";a.addKeyMap(this.keyMap=function(e,t){var r={Up:function(){t.moveFocus(-1)},Down:function(){t.moveFocus(1)},PageUp:function(){t.moveFocus(1-t.menuSize(),!0)},PageDown:function(){t.moveFocus(t.menuSize()-1,!0)},Home:function(){t.setFocus(0)},End:function(){t.setFocus(t.length-1)},Enter:t.pick,Tab:t.pick,Esc:t.close};/Mac/.test(navigator.platform)&&(r["Ctrl-P"]=function(){t.moveFocus(-1)},r["Ctrl-N"]=function(){t.moveFocus(1)});var n=e.options.customKeys,i=n?{}:r;function o(e,n){var o;o="string"!=typeof n?function(e){return n(e,t)}:r.hasOwnProperty(n)?r[n]:n,i[e]=o}if(n)for(var a in n)n.hasOwnProperty(a)&&o(a,n[a]);var s=e.options.extraKeys;if(s)for(var a in s)s.hasOwnProperty(a)&&o(a,s[a]);return i}(t,{moveFocus:function(e,t){n.changeActive(n.selectedHint+e,t)},setFocus:function(e){n.changeActive(e)},menuSize:function(){return n.screenAmount()},length:p.length,close:function(){t.close()},pick:function(){n.pick()},data:r})),t.options.closeOnUnfocus&&(a.on("blur",this.onBlur=function(){D=setTimeout((function(){t.close()}),100)}),a.on("focus",this.onFocus=function(){clearTimeout(D)})),a.on("scroll",this.onScroll=function(){var e=a.getScrollInfo(),r=a.getWrapperElement().getBoundingClientRect();I||(I=a.getScrollInfo());var n=E+I.top-e.top,i=n-(l.pageYOffset||(s.documentElement||s.body).scrollTop);if(b||(i+=u.offsetHeight),i<=r.top||i>=r.bottom)return t.close();u.style.top=n+"px",u.style.left=y+I.left-e.left+"px"}),e.on(u,"dblclick",(function(e){var t=o(u,e.target||e.srcElement);t&&null!=t.hintId&&(n.changeActive(t.hintId),n.pick())})),e.on(u,"click",(function(e){var r=o(u,e.target||e.srcElement);r&&null!=r.hintId&&(n.changeActive(r.hintId),t.options.completeOnSingleClick&&n.pick())})),e.on(u,"mousedown",(function(){setTimeout((function(){a.focus()}),20)}));var M=this.getSelectedHintRange();return 0===M.from&&0===M.to||this.scrollToActive(),e.signal(r,"select",p[this.selectedHint],u.childNodes[this.selectedHint]),!0}function s(e,t,r,n){if(e.async)e(t,n,r);else{var i=e(t,r);i&&i.then?i.then(n):n(i)}}t.prototype={close:function(){this.active()&&(this.cm.state.completionActive=null,this.tick=null,this.options.updateOnCursorActivity&&this.cm.off("cursorActivity",this.activityFunc),this.widget&&this.data&&e.signal(this.data,"close"),this.widget&&this.widget.close(),e.signal(this.cm,"endCompletion",this.cm))},active:function(){return this.cm.state.completionActive==this},pick:function(t,r){var n=t.list[r],o=this;this.cm.operation((function(){n.hint?n.hint(o.cm,t,n):o.cm.replaceRange(i(n),n.from||t.from,n.to||t.to,"complete"),e.signal(t,"pick",n),o.cm.scrollIntoView()})),this.options.closeOnPick&&this.close()},cursorActivity:function(){this.debounce&&(n(this.debounce),this.debounce=0);var e=this.startPos;this.data&&(e=this.data.from);var t=this.cm.getCursor(),i=this.cm.getLine(t.line);if(t.line!=this.startPos.line||i.length-t.ch!=this.startLen-this.startPos.ch||t.ch=this.data.list.length?t=r?this.data.list.length-1:0:t<0&&(t=r?0:this.data.list.length-1),this.selectedHint!=t){var n=this.hints.childNodes[this.selectedHint];n&&(n.className=n.className.replace(" CodeMirror-hint-active",""),n.removeAttribute("aria-selected")),(n=this.hints.childNodes[this.selectedHint=t]).className+=" CodeMirror-hint-active",n.setAttribute("aria-selected","true"),this.completion.cm.getInputField().setAttribute("aria-activedescendant",n.id),this.scrollToActive(),e.signal(this.data,"select",this.data.list[this.selectedHint],n)}},scrollToActive:function(){var e=this.getSelectedHintRange(),t=this.hints.childNodes[e.from],r=this.hints.childNodes[e.to],n=this.hints.firstChild;t.offsetTopthis.hints.scrollTop+this.hints.clientHeight&&(this.hints.scrollTop=r.offsetTop+r.offsetHeight-this.hints.clientHeight+n.offsetTop)},screenAmount:function(){return Math.floor(this.hints.clientHeight/this.hints.firstChild.offsetHeight)||1},getSelectedHintRange:function(){var e=this.completion.options.scrollMargin||0;return{from:Math.max(0,this.selectedHint-e),to:Math.min(this.data.list.length-1,this.selectedHint+e)}}},e.registerHelper("hint","auto",{resolve:function(t,r){var n,i=t.getHelpers(r,"hint");if(i.length){var o=function(e,t,r){var n=function(e,t){if(!e.somethingSelected())return t;for(var r=[],n=0;n0?t(e):i(o+1)}))}(0)};return o.async=!0,o.supportsSelection=!0,o}return(n=t.getHelper(t.getCursor(),"hintWords"))?function(t){return e.hint.fromList(t,{words:n})}:e.hint.anyword?function(t,r){return e.hint.anyword(t,r)}:function(){}}}),e.registerHelper("hint","fromList",(function(t,r){var n,i=t.getCursor(),o=t.getTokenAt(i),a=e.Pos(i.line,o.start),s=i;o.start,]/,closeOnPick:!0,closeOnUnfocus:!0,updateOnCursorActivity:!0,completeOnSingleClick:!0,container:null,customKeys:null,extraKeys:null,paddingForScrollbar:!0,moveOnOverlap:!0};e.defineOption("hintOptions",null)}(r(1719))},7899:(e,t,r)=>{!function(e){"use strict";e.runMode=function(t,r,n,i){var o=e.getMode(e.defaults,r),a=i&&i.tabSize||e.defaults.tabSize;if(n.appendChild){var s=/MSIE \d/.test(navigator.userAgent)&&(null==document.documentMode||document.documentMode<9),l=n,u=0;l.textContent="",n=function(e,t){if("\n"==e)return l.appendChild(document.createTextNode(s?"\r":e)),void(u=0);for(var r="",n=0;;){var i=e.indexOf("\t",n);if(-1==i){r+=e.slice(n),u+=e.length-n;break}u+=i-n,r+=e.slice(n,i);var o=a-u%a;u+=o;for(var c=0;c{!function(e){"use strict";function t(e,t){function r(e){clearTimeout(n.doRedraw),n.doRedraw=setTimeout((function(){n.redraw()}),e)}this.cm=e,this.options=t,this.buttonHeight=t.scrollButtonHeight||e.getOption("scrollButtonHeight"),this.annotations=[],this.doRedraw=this.doUpdate=null,this.div=e.getWrapperElement().appendChild(document.createElement("div")),this.div.style.cssText="position: absolute; right: 0; top: 0; z-index: 7; pointer-events: none",this.computeScale();var n=this;e.on("refresh",this.resizeHandler=function(){clearTimeout(n.doUpdate),n.doUpdate=setTimeout((function(){n.computeScale()&&r(20)}),100)}),e.on("markerAdded",this.resizeHandler),e.on("markerCleared",this.resizeHandler),!1!==t.listenForChanges&&e.on("changes",this.changeHandler=function(){r(250)})}e.defineExtension("annotateScrollbar",(function(e){return"string"==typeof e&&(e={className:e}),new t(this,e)})),e.defineOption("scrollButtonHeight",0),t.prototype.computeScale=function(){var e=this.cm,t=(e.getWrapperElement().clientHeight-e.display.barHeight-2*this.buttonHeight)/e.getScrollerElement().scrollHeight;if(t!=this.hScale)return this.hScale=t,!0},t.prototype.update=function(e){this.annotations=e,this.redraw()},t.prototype.redraw=function(e){!1!==e&&this.computeScale();var t=this.cm,r=this.hScale,n=document.createDocumentFragment(),i=this.annotations,o=t.getOption("lineWrapping"),a=o&&1.5*t.defaultTextHeight(),s=null,l=null;function u(e,r){if(s!=e.line){s=e.line,l=t.getLineHandle(e.line);var n=t.getLineHandleVisualStart(l);n!=l&&(s=t.getLineNumber(n),l=n)}return l.widgets&&l.widgets.length||o&&l.height>a?t.charCoords(e,"local")[r?"top":"bottom"]:t.heightAtLine(l,"local")+(r?0:l.height)}var c=t.lastLine();if(t.display.barWidth)for(var p,d=0;dc)){for(var h=p||u(f.from,!0)*r,g=u(f.to,!1)*r;dc)&&!((p=u(i[d+1].from,!0)*r)>g+.9);)g=u((f=i[++d]).to,!1)*r;if(g!=h){var m=Math.max(g-h,3),v=n.appendChild(document.createElement("div"));v.style.cssText="position: absolute; right: 0px; width: "+Math.max(t.display.barWidth-1,2)+"px; top: "+(h+this.buttonHeight)+"px; height: "+m+"px",v.className=this.options.className,f.id&&v.setAttribute("annotation-id",f.id)}}}this.div.textContent="",this.div.appendChild(n)},t.prototype.clear=function(){this.cm.off("refresh",this.resizeHandler),this.cm.off("markerAdded",this.resizeHandler),this.cm.off("markerCleared",this.resizeHandler),this.changeHandler&&this.cm.off("changes",this.changeHandler),this.div.parentNode.removeChild(this.div)}}(r(1719))},9082:(e,t,r)=>{!function(e){"use strict";var t={style:"matchhighlight",minChars:2,delay:100,wordsOnly:!1,annotateScrollbar:!1,showToken:!1,trim:!0};function r(e){for(var r in this.options={},t)this.options[r]=(e&&e.hasOwnProperty(r)?e:t)[r];this.overlay=this.timeout=null,this.matchesonscroll=null,this.active=!1}function n(e){var t=e.state.matchHighlighter;(t.active||e.hasFocus())&&o(e,t)}function i(e){var t=e.state.matchHighlighter;t.active||(t.active=!0,o(e,t))}function o(e,t){clearTimeout(t.timeout),t.timeout=setTimeout((function(){l(e)}),t.options.delay)}function a(e,t,r,n){var i=e.state.matchHighlighter;if(e.addOverlay(i.overlay=function(e,t,r){return{token:function(n){if(n.match(e)&&(!t||function(e,t){return!(e.start&&t.test(e.string.charAt(e.start-1))||e.pos!=e.string.length&&t.test(e.string.charAt(e.pos)))}(n,t)))return r;n.next(),n.skipTo(e.charAt(0))||n.skipToEnd()}}}(t,r,n)),i.options.annotateScrollbar&&e.showMatchesOnScrollbar){var o=r?new RegExp((/\w/.test(t.charAt(0))?"\\b":"")+t.replace(/[\\\[.+*?(){|^$]/g,"\\$&")+(/\w/.test(t.charAt(t.length-1))?"\\b":"")):t;i.matchesonscroll=e.showMatchesOnScrollbar(o,!1,{className:"CodeMirror-selection-highlight-scrollbar"})}}function s(e){var t=e.state.matchHighlighter;t.overlay&&(e.removeOverlay(t.overlay),t.overlay=null,t.matchesonscroll&&(t.matchesonscroll.clear(),t.matchesonscroll=null))}function l(e){e.operation((function(){var t=e.state.matchHighlighter;if(s(e),e.somethingSelected()||!t.options.showToken){var r=e.getCursor("from"),n=e.getCursor("to");if(r.line==n.line&&(!t.options.wordsOnly||function(e,t,r){if(null!==e.getRange(t,r).match(/^\w+$/)){if(t.ch>0){var n={line:t.line,ch:t.ch-1};if(null===e.getRange(n,t).match(/\W/))return!1}return!(r.ch=t.options.minChars&&a(e,i,!1,t.options.style)}}else{for(var o=!0===t.options.showToken?/[\w$]/:t.options.showToken,l=e.getCursor(),u=e.getLine(l.line),c=l.ch,p=c;c&&o.test(u.charAt(c-1));)--c;for(;p{!function(e){"use strict";function t(e,t,r,n){this.cm=e,this.options=n;var i={listenForChanges:!1};for(var o in n)i[o]=n[o];i.className||(i.className="CodeMirror-search-match"),this.annotation=e.annotateScrollbar(i),this.query=t,this.caseFold=r,this.gap={from:e.firstLine(),to:e.lastLine()+1},this.matches=[],this.update=null,this.findMatches(),this.annotation.update(this.matches);var a=this;e.on("change",this.changeHandler=function(e,t){a.onChange(t)})}function r(e,t,r){return e<=t?e:Math.max(t,e+r)}e.defineExtension("showMatchesOnScrollbar",(function(e,r,n){return"string"==typeof n&&(n={className:n}),n||(n={}),new t(this,e,r,n)})),t.prototype.findMatches=function(){if(this.gap){for(var t=0;t=this.gap.to);t++)i.to.line>=this.gap.from&&this.matches.splice(t--,1);for(var r=this.cm.getSearchCursor(this.query,e.Pos(this.gap.from,0),{caseFold:this.caseFold,multiline:this.options.multiline}),n=this.options&&this.options.maxMatches||1e3;r.findNext();){var i;if((i={from:r.from(),to:r.to()}).from.line>=this.gap.to)break;if(this.matches.splice(t++,0,i),this.matches.length>n)break}this.gap=null}},t.prototype.onChange=function(t){var n=t.from.line,i=e.changeEnd(t).line,o=i-t.to.line;if(this.gap?(this.gap.from=Math.min(r(this.gap.from,n,o),t.from.line),this.gap.to=Math.max(r(this.gap.to,n,o),t.from.line)):this.gap={from:t.from.line,to:i+1},o)for(var a=0;a{!function(e){"use strict";var t,r,n=e.Pos;function i(e,t){for(var r=function(e){var t=e.flags;return null!=t?t:(e.ignoreCase?"i":"")+(e.global?"g":"")+(e.multiline?"m":"")}(e),n=r,i=0;ic);p++){var d=e.getLine(u++);s=null==s?d:s+"\n"+d}l*=2,t.lastIndex=r.ch;var f=t.exec(s);if(f){var h=s.slice(0,f.index).split("\n"),g=f[0].split("\n"),m=r.line+h.length-1,v=h[h.length-1].length;return{from:n(m,v),to:n(m+g.length-1,1==g.length?v+g[0].length:g[g.length-1].length),match:f}}}}function l(e,t,r){for(var n,i=0;i<=e.length;){t.lastIndex=i;var o=t.exec(e);if(!o)break;var a=o.index+o[0].length;if(a>e.length-r)break;(!n||a>n.index+n[0].length)&&(n=o),i=o.index+1}return n}function u(e,t,r){t=i(t,"g");for(var o=r.line,a=r.ch,s=e.firstLine();o>=s;o--,a=-1){var u=e.getLine(o),c=l(u,t,a<0?0:u.length-a);if(c)return{from:n(o,c.index),to:n(o,c.index+c[0].length),match:c}}}function c(e,t,r){if(!o(t))return u(e,t,r);t=i(t,"gm");for(var a,s=1,c=e.getLine(r.line).length-r.ch,p=r.line,d=e.firstLine();p>=d;){for(var f=0;f=d;f++){var h=e.getLine(p--);a=null==a?h:h+"\n"+a}s*=2;var g=l(a,t,c);if(g){var m=a.slice(0,g.index).split("\n"),v=g[0].split("\n"),y=p+m.length,E=m[m.length-1].length;return{from:n(y,E),to:n(y+v.length-1,1==v.length?E+v[0].length:v[v.length-1].length),match:g}}}}function p(e,t,r,n){if(e.length==t.length)return r;for(var i=0,o=r+Math.max(0,e.length-t.length);;){if(i==o)return i;var a=i+o>>1,s=n(e.slice(0,a)).length;if(s==r)return a;s>r?o=a:i=a+1}}function d(e,i,o,a){if(!i.length)return null;var s=a?t:r,l=s(i).split(/\r|\n\r?/);e:for(var u=o.line,c=o.ch,d=e.lastLine()+1-l.length;u<=d;u++,c=0){var f=e.getLine(u).slice(c),h=s(f);if(1==l.length){var g=h.indexOf(l[0]);if(-1==g)continue e;return o=p(f,h,g,s)+c,{from:n(u,p(f,h,g,s)+c),to:n(u,p(f,h,g+l[0].length,s)+c)}}var m=h.length-l[0].length;if(h.slice(m)==l[0]){for(var v=1;v=d;u--,c=-1){var f=e.getLine(u);c>-1&&(f=f.slice(0,c));var h=s(f);if(1==l.length){var g=h.lastIndexOf(l[0]);if(-1==g)continue e;return{from:n(u,p(f,h,g,s)),to:n(u,p(f,h,g+l[0].length,s))}}var m=l[l.length-1];if(h.slice(0,m.length)==m){var v=1;for(o=u-l.length+1;v(this.doc.getLine(r.line)||"").length&&(r.ch=0,r.line++)),0!=e.cmpPos(r,this.doc.clipPos(r))))return this.atOccurrence=!1;var i=this.matches(t,r);if(this.afterEmptyMatch=i&&0==e.cmpPos(i.from,i.to),i)return this.pos=i,this.atOccurrence=!0,this.pos.match||!0;var o=n(t?this.doc.firstLine():this.doc.lastLine()+1,0);return this.pos={from:o,to:o},this.atOccurrence=!1},from:function(){if(this.atOccurrence)return this.pos.from},to:function(){if(this.atOccurrence)return this.pos.to},replace:function(t,r){if(this.atOccurrence){var i=e.splitLines(t);this.doc.replaceRange(i,this.pos.from,this.pos.to,r),this.pos.to=n(this.pos.from.line+i.length-1,i[i.length-1].length+(1==i.length?this.pos.from.ch:0))}}},e.defineExtension("getSearchCursor",(function(e,t,r){return new h(this.doc,e,t,r)})),e.defineDocExtension("getSearchCursor",(function(e,t,r){return new h(this,e,t,r)})),e.defineExtension("selectMatches",(function(t,r){for(var n=[],i=this.getSearchCursor(t,this.getCursor("from"),r);i.findNext()&&!(e.cmpPos(i.to(),this.getCursor("to"))>0);)n.push({anchor:i.from(),head:i.to()});n.length&&this.setSelections(n,0)}))}(r(1719))},1719:function(e){e.exports=function(){"use strict";var e=navigator.userAgent,t=navigator.platform,r=/gecko\/\d/i.test(e),n=/MSIE \d/.test(e),i=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e),o=/Edge\/(\d+)/.exec(e),a=n||i||o,s=a&&(n?document.documentMode||6:+(o||i)[1]),l=!o&&/WebKit\//.test(e),u=l&&/Qt\/\d+\.\d+/.test(e),c=!o&&/Chrome\/(\d+)/.exec(e),p=c&&+c[1],d=/Opera\//.test(e),f=/Apple Computer/.test(navigator.vendor),h=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),g=/PhantomJS/.test(e),m=f&&(/Mobile\/\w+/.test(e)||navigator.maxTouchPoints>2),v=/Android/.test(e),y=m||v||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),E=m||/Mac/.test(t),b=/\bCrOS\b/.test(e),x=/win/i.test(t),T=d&&e.match(/Version\/(\d*\.\d*)/);T&&(T=Number(T[1])),T&&T>=15&&(d=!1,l=!0);var A=E&&(u||d&&(null==T||T<12.11)),S=r||a&&s>=9;function L(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var N,C=function(e,t){var r=e.className,n=L(t).exec(r);if(n){var i=r.slice(n.index+n[0].length);e.className=r.slice(0,n.index)+(i?n[1]+i:"")}};function I(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function _(e,t){return I(e).appendChild(t)}function w(e,t,r,n){var i=document.createElement(e);if(r&&(i.className=r),n&&(i.style.cssText=n),"string"==typeof t)i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o=t)return a+(t-o);a+=s-o,a+=r-a%r,o=s+1}}m?M=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:a&&(M=function(e){try{e.select()}catch(e){}});var V=function(){this.id=null,this.f=null,this.time=0,this.handler=U(this.onTimeout,this)};function W(e,t){for(var r=0;r=t)return n+Math.min(a,t-i);if(i+=o-n,n=o+1,(i+=r-i%r)>=t)return n}}var K=[""];function J(e){for(;K.length<=e;)K.push(Z(K)+" ");return K[e]}function Z(e){return e[e.length-1]}function ee(e,t){for(var r=[],n=0;n""&&(e.toUpperCase()!=e.toLowerCase()||ne.test(e))}function oe(e,t){return t?!!(t.source.indexOf("\\w")>-1&&ie(e))||t.test(e):ie(e)}function ae(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var se=/[\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 le(e){return e.charCodeAt(0)>=768&&se.test(e)}function ue(e,t,r){for(;(r<0?t>0:tr?-1:1;;){if(t==r)return t;var i=(t+r)/2,o=n<0?Math.ceil(i):Math.floor(i);if(o==t)return e(o)?t:r;e(o)?r=o:t=o+n}}var pe=null;function de(e,t,r){var n;pe=null;for(var i=0;it)return i;o.to==t&&(o.from!=o.to&&"before"==r?n=i:pe=i),o.from==t&&(o.from!=o.to&&"before"!=r?n=i:pe=i)}return null!=n?n:pe}var fe=function(){var e=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,t=/[stwN]/,r=/[LRr]/,n=/[Lb1n]/,i=/[1n]/;function o(e,t,r){this.level=e,this.from=t,this.to=r}return function(a,s){var l="ltr"==s?"L":"R";if(0==a.length||"ltr"==s&&!e.test(a))return!1;for(var u,c=a.length,p=[],d=0;d-1&&(n[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function Ee(e,t){var r=ve(e,t);if(r.length)for(var n=Array.prototype.slice.call(arguments,2),i=0;i0}function Ae(e){e.prototype.on=function(e,t){me(this,e,t)},e.prototype.off=function(e,t){ye(this,e,t)}}function Se(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Le(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Ne(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function Ce(e){Se(e),Le(e)}function Ie(e){return e.target||e.srcElement}function _e(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),E&&e.ctrlKey&&1==t&&(t=3),t}var we,Re,Oe=function(){if(a&&s<9)return!1;var e=w("div");return"draggable"in e||"dragDrop"in e}();function De(e){if(null==we){var t=w("span","");_(e,w("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(we=t.offsetWidth<=1&&t.offsetHeight>2&&!(a&&s<8))}var r=we?w("span",""):w("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return r.setAttribute("cm-text",""),r}function Pe(e){if(null!=Re)return Re;var t=_(e,document.createTextNode("AخA")),r=N(t,0,1).getBoundingClientRect(),n=N(t,1,2).getBoundingClientRect();return I(e),!(!r||r.left==r.right)&&(Re=n.right-r.right<3)}var ke,Me=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,r=[],n=e.length;t<=n;){var i=e.indexOf("\n",t);-1==i&&(i=e.length);var o=e.slice(t,"\r"==e.charAt(i-1)?i-1:i),a=o.indexOf("\r");-1!=a?(r.push(o.slice(0,a)),t+=a+1):(r.push(o),t=i+1)}return r}:function(e){return e.split(/\r\n?|\n/)},Fe=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(e){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(e){}return!(!t||t.parentElement()!=e)&&0!=t.compareEndPoints("StartToEnd",t)},je="oncopy"in(ke=w("div"))||(ke.setAttribute("oncopy","return;"),"function"==typeof ke.oncopy),Ge=null,Be={},Ue={};function He(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Be[e]=t}function qe(e){if("string"==typeof e&&Ue.hasOwnProperty(e))e=Ue[e];else if(e&&"string"==typeof e.name&&Ue.hasOwnProperty(e.name)){var t=Ue[e.name];"string"==typeof t&&(t={name:t}),(e=re(t,e)).name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return qe("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return qe("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function Ve(e,t){t=qe(t);var r=Be[t.name];if(!r)return Ve(e,"text/plain");var n=r(e,t);if(We.hasOwnProperty(t.name)){var i=We[t.name];for(var o in i)i.hasOwnProperty(o)&&(n.hasOwnProperty(o)&&(n["_"+o]=n[o]),n[o]=i[o])}if(n.name=t.name,t.helperType&&(n.helperType=t.helperType),t.modeProps)for(var a in t.modeProps)n[a]=t.modeProps[a];return n}var We={};function ze(e,t){H(t,We.hasOwnProperty(e)?We[e]:We[e]={})}function Qe(e,t){if(!0===t)return t;if(e.copyState)return e.copyState(t);var r={};for(var n in t){var i=t[n];i instanceof Array&&(i=i.concat([])),r[n]=i}return r}function Xe(e,t){for(var r;e.innerMode&&(r=e.innerMode(t))&&r.mode!=e;)t=r.state,e=r.mode;return r||{mode:e,state:t}}function $e(e,t,r){return!e.startState||e.startState(t,r)}var Ye=function(e,t,r){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=r};function Ke(e,t){if((t-=e.first)<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var r=e;!r.lines;)for(var n=0;;++n){var i=r.children[n],o=i.chunkSize();if(t=e.first&&tr?ot(r,Ke(e,r).text.length):function(e,t){var r=e.ch;return null==r||r>t?ot(e.line,t):r<0?ot(e.line,0):e}(t,Ke(e,t.line).text.length)}function ft(e,t){for(var r=[],n=0;n=this.string.length},Ye.prototype.sol=function(){return this.pos==this.lineStart},Ye.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Ye.prototype.next=function(){if(this.post},Ye.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Ye.prototype.skipToEnd=function(){this.pos=this.string.length},Ye.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Ye.prototype.backUp=function(e){this.pos-=e},Ye.prototype.column=function(){return this.lastColumnPos0?null:(n&&!1!==t&&(this.pos+=n[0].length),n)}var i=function(e){return r?e.toLowerCase():e};if(i(this.string.substr(this.pos,e.length))==i(e))return!1!==t&&(this.pos+=e.length),!0},Ye.prototype.current=function(){return this.string.slice(this.start,this.pos)},Ye.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Ye.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Ye.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var ht=function(e,t){this.state=e,this.lookAhead=t},gt=function(e,t,r,n){this.state=t,this.doc=e,this.line=r,this.maxLookAhead=n||0,this.baseTokens=null,this.baseTokenPos=1};function mt(e,t,r,n){var i=[e.state.modeGen],o={};Lt(e,t.text,e.doc.mode,r,(function(e,t){return i.push(e,t)}),o,n);for(var a=r.state,s=function(n){r.baseTokens=i;var s=e.state.overlays[n],l=1,u=0;r.state=!0,Lt(e,t.text,s.mode,r,(function(e,t){for(var r=l;ue&&i.splice(l,1,e,i[l+1],n),l+=2,u=Math.min(e,n)}if(t)if(s.opaque)i.splice(r,l-r,e,"overlay "+t),l=r+2;else for(;re.options.maxHighlightLength&&Qe(e.doc.mode,n.state),o=mt(e,t,n);i&&(n.state=i),t.stateAfter=n.save(!i),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),r===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function yt(e,t,r){var n=e.doc,i=e.display;if(!n.mode.startState)return new gt(n,!0,t);var o=function(e,t,r){for(var n,i,o=e.doc,a=r?-1:t-(e.doc.mode.innerMode?1e3:100),s=t;s>a;--s){if(s<=o.first)return o.first;var l=Ke(o,s-1),u=l.stateAfter;if(u&&(!r||s+(u instanceof ht?u.lookAhead:0)<=o.modeFrontier))return s;var c=q(l.text,null,e.options.tabSize);(null==i||n>c)&&(i=s-1,n=c)}return i}(e,t,r),a=o>n.first&&Ke(n,o-1).stateAfter,s=a?gt.fromSaved(n,a,o):new gt(n,$e(n.mode),o);return n.iter(o,t,(function(r){Et(e,r.text,s);var n=s.line;r.stateAfter=n==t-1||n%5==0||n>=i.viewFrom&&nt.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}gt.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},gt.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}},gt.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},gt.fromSaved=function(e,t,r){return t instanceof ht?new gt(e,Qe(e.mode,t.state),r,t.lookAhead):new gt(e,Qe(e.mode,t),r)},gt.prototype.save=function(e){var t=!1!==e?Qe(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new ht(t,this.maxLookAhead):t};var Tt=function(e,t,r){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=r};function At(e,t,r,n){var i,o,a=e.doc,s=a.mode,l=Ke(a,(t=dt(a,t)).line),u=yt(e,t.line,r),c=new Ye(l.text,e.options.tabSize,u);for(n&&(o=[]);(n||c.pose.options.maxHighlightLength?(s=!1,a&&Et(e,t,n,p.pos),p.pos=t.length,l=null):l=St(xt(r,p,n.state,d),o),d){var f=d[0].name;f&&(l="m-"+(l?f+" "+l:f))}if(!s||c!=l){for(;u=t:o.to>t);(n||(n=[])).push(new It(a,o.from,s?null:o.to))}}return n}(r,i,a),l=function(e,t,r){var n;if(e)for(var i=0;i=t:o.to>t)||o.from==t&&"bookmark"==a.type&&(!r||o.marker.insertLeft)){var s=null==o.from||(a.inclusiveLeft?o.from<=t:o.from0&&s)for(var E=0;Et)&&(!r||Ft(r,o.marker)<0)&&(r=o.marker)}return r}function Ht(e,t,r,n,i){var o=Ke(e,t),a=Ct&&o.markedSpans;if(a)for(var s=0;s=0&&p<=0||c<=0&&p>=0)&&(c<=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?at(u.to,r)>=0:at(u.to,r)>0)||c>=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?at(u.from,n)<=0:at(u.from,n)<0)))return!0}}}function qt(e){for(var t;t=Gt(e);)e=t.find(-1,!0).line;return e}function Vt(e,t){var r=Ke(e,t),n=qt(r);return r==n?t:tt(n)}function Wt(e,t){if(t>e.lastLine())return t;var r,n=Ke(e,t);if(!zt(e,n))return t;for(;r=Bt(n);)n=r.find(1,!0).line;return tt(n)+1}function zt(e,t){var r=Ct&&t.markedSpans;if(r)for(var n=void 0,i=0;it.maxLineLength&&(t.maxLineLength=r,t.maxLine=e)}))}var Kt=function(e,t,r){this.text=e,Pt(this,t),this.height=r?r(this):1};function Jt(e){e.parent=null,Dt(e)}Kt.prototype.lineNo=function(){return tt(this)},Ae(Kt);var Zt={},er={};function tr(e,t){if(!e||/^\s*$/.test(e))return null;var r=t.addModeClass?er:Zt;return r[e]||(r[e]=e.replace(/\S+/g,"cm-$&"))}function rr(e,t){var r=R("span",null,null,l?"padding-right: .1px":null),n={pre:R("pre",[r],"CodeMirror-line"),content:r,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var o=i?t.rest[i-1]:t.line,a=void 0;n.pos=0,n.addToken=ir,Pe(e.display.measure)&&(a=he(o,e.doc.direction))&&(n.addToken=or(n.addToken,a)),n.map=[],sr(o,n,vt(e,o,t!=e.display.externalMeasured&&tt(o))),o.styleClasses&&(o.styleClasses.bgClass&&(n.bgClass=k(o.styleClasses.bgClass,n.bgClass||"")),o.styleClasses.textClass&&(n.textClass=k(o.styleClasses.textClass,n.textClass||""))),0==n.map.length&&n.map.push(0,0,n.content.appendChild(De(e.display.measure))),0==i?(t.measure.map=n.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(n.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(l){var s=n.content.lastChild;(/\bcm-tab\b/.test(s.className)||s.querySelector&&s.querySelector(".cm-tab"))&&(n.content.className="cm-tab-wrap-hack")}return Ee(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=k(n.pre.className,n.textClass||"")),n}function nr(e){var t=w("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function ir(e,t,r,n,i,o,l){if(t){var u,c=e.splitSpaces?function(e,t){if(e.length>1&&!/ /.test(e))return e;for(var r=t,n="",i=0;iu&&p.from<=u);d++);if(p.to>=c)return e(r,n,i,o,a,s,l);e(r,n.slice(0,p.to-u),i,o,null,s,l),o=null,n=n.slice(p.to-u),u=p.to}}}function ar(e,t,r,n){var i=!n&&r.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!n&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",r.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function sr(e,t,r){var n=e.markedSpans,i=e.text,o=0;if(n)for(var a,s,l,u,c,p,d,f=i.length,h=0,g=1,m="",v=0;;){if(v==h){l=u=c=s="",d=null,p=null,v=1/0;for(var y=[],E=void 0,b=0;bh||T.collapsed&&x.to==h&&x.from==h)){if(null!=x.to&&x.to!=h&&v>x.to&&(v=x.to,u=""),T.className&&(l+=" "+T.className),T.css&&(s=(s?s+";":"")+T.css),T.startStyle&&x.from==h&&(c+=" "+T.startStyle),T.endStyle&&x.to==v&&(E||(E=[])).push(T.endStyle,x.to),T.title&&((d||(d={})).title=T.title),T.attributes)for(var A in T.attributes)(d||(d={}))[A]=T.attributes[A];T.collapsed&&(!p||Ft(p.marker,T)<0)&&(p=x)}else x.from>h&&v>x.from&&(v=x.from)}if(E)for(var S=0;S=f)break;for(var N=Math.min(f,v);;){if(m){var C=h+m.length;if(!p){var I=C>N?m.slice(0,N-h):m;t.addToken(t,I,a?a+l:l,c,h+I.length==v?u:"",s,d)}if(C>=N){m=m.slice(N-h),h=N;break}h=C,c=""}m=i.slice(o,o=r[g++]),a=tr(r[g++],t.cm.options)}}else for(var _=1;_r)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}}function Pr(e,t,r,n){return Fr(e,Mr(e,t),r,n)}function kr(e,t){if(t>=e.display.viewFrom&&t=r.lineN&&t2&&o.push((l.bottom+u.top)/2-r.top)}}o.push(r.bottom-r.top)}}(e,t.view,t.rect),t.hasHeights=!0),(o=function(e,t,r,n){var i,o=Br(t.map,r,n),l=o.node,u=o.start,c=o.end,p=o.collapse;if(3==l.nodeType){for(var d=0;d<4;d++){for(;u&&le(t.line.text.charAt(o.coverStart+u));)--u;for(;o.coverStart+c1}(e))return t;var r=screen.logicalXDPI/screen.deviceXDPI,n=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*r,right:t.right*r,top:t.top*n,bottom:t.bottom*n}}(e.display.measure,i))}else{var f;u>0&&(p=n="right"),i=e.options.lineWrapping&&(f=l.getClientRects()).length>1?f["right"==n?f.length-1:0]:l.getBoundingClientRect()}if(a&&s<9&&!u&&(!i||!i.left&&!i.right)){var h=l.parentNode.getClientRects()[0];i=h?{left:h.left,right:h.left+un(e.display),top:h.top,bottom:h.bottom}:Gr}for(var g=i.top-t.rect.top,m=i.bottom-t.rect.top,v=(g+m)/2,y=t.view.measure.heights,E=0;Et)&&(i=(o=l-s)-1,t>=l&&(a="right")),null!=i){if(n=e[u+2],s==l&&r==(n.insertLeft?"left":"right")&&(a=r),"left"==r&&0==i)for(;u&&e[u-2]==e[u-3]&&e[u-1].insertLeft;)n=e[2+(u-=3)],a="left";if("right"==r&&i==l-s)for(;u=0&&(r=e[i]).left==r.right;i--);return r}function Hr(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t=n.text.length?(l=n.text.length,u="before"):l<=0&&(l=0,u="after"),!s)return a("before"==u?l-1:l,"before"==u);function c(e,t,r){return a(r?e-1:e,1==s[t].level!=r)}var p=de(s,l,u),d=pe,f=c(l,p,"before"==u);return null!=d&&(f.other=c(l,d,"before"!=u)),f}function Jr(e,t){var r=0;t=dt(e.doc,t),e.options.lineWrapping||(r=un(e.display)*t.ch);var n=Ke(e.doc,t.line),i=Xt(n)+Cr(e.display);return{left:r,right:r,top:i,bottom:i+n.height}}function Zr(e,t,r,n,i){var o=ot(e,t,r);return o.xRel=i,n&&(o.outside=n),o}function en(e,t,r){var n=e.doc;if((r+=e.display.viewOffset)<0)return Zr(n.first,0,null,-1,-1);var i=rt(n,r),o=n.first+n.size-1;if(i>o)return Zr(n.first+n.size-1,Ke(n,o).text.length,null,1,1);t<0&&(t=0);for(var a=Ke(n,i);;){var s=on(e,a,i,t,r),l=Ut(a,s.ch+(s.xRel>0||s.outside>0?1:0));if(!l)return s;var u=l.find(1);if(u.line==i)return u;a=Ke(n,i=u.line)}}function tn(e,t,r,n){n-=Qr(t);var i=t.text.length,o=ce((function(t){return Fr(e,r,t-1).bottom<=n}),i,0);return{begin:o,end:i=ce((function(t){return Fr(e,r,t).top>n}),o,i)}}function rn(e,t,r,n){return r||(r=Mr(e,t)),tn(e,t,r,Xr(e,t,Fr(e,r,n),"line").top)}function nn(e,t,r,n){return!(e.bottom<=r)&&(e.top>r||(n?e.left:e.right)>t)}function on(e,t,r,n,i){i-=Xt(t);var o=Mr(e,t),a=Qr(t),s=0,l=t.text.length,u=!0,c=he(t,e.doc.direction);if(c){var p=(e.options.lineWrapping?sn:an)(e,t,r,o,c,n,i);s=(u=1!=p.level)?p.from:p.to-1,l=u?p.to:p.from-1}var d,f,h=null,g=null,m=ce((function(t){var r=Fr(e,o,t);return r.top+=a,r.bottom+=a,!!nn(r,n,i,!1)&&(r.top<=i&&r.left<=n&&(h=t,g=r),!0)}),s,l),v=!1;if(g){var y=n-g.left=b.bottom?1:0}return Zr(r,m=ue(t.text,m,1),f,v,n-d)}function an(e,t,r,n,i,o,a){var s=ce((function(s){var l=i[s],u=1!=l.level;return nn(Kr(e,ot(r,u?l.to:l.from,u?"before":"after"),"line",t,n),o,a,!0)}),0,i.length-1),l=i[s];if(s>0){var u=1!=l.level,c=Kr(e,ot(r,u?l.from:l.to,u?"after":"before"),"line",t,n);nn(c,o,a,!0)&&c.top>a&&(l=i[s-1])}return l}function sn(e,t,r,n,i,o,a){var s=tn(e,t,n,a),l=s.begin,u=s.end;/\s/.test(t.text.charAt(u-1))&&u--;for(var c=null,p=null,d=0;d=u||f.to<=l)){var h=Fr(e,n,1!=f.level?Math.min(u,f.to)-1:Math.max(l,f.from)).right,g=hg)&&(c=f,p=g)}}return c||(c=i[i.length-1]),c.fromu&&(c={from:c.from,to:u,level:c.level}),c}function ln(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==jr){jr=w("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)jr.appendChild(document.createTextNode("x")),jr.appendChild(w("br"));jr.appendChild(document.createTextNode("x"))}_(e.measure,jr);var r=jr.offsetHeight/50;return r>3&&(e.cachedTextHeight=r),I(e.measure),r||1}function un(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=w("span","xxxxxxxxxx"),r=w("pre",[t],"CodeMirror-line-like");_(e.measure,r);var n=t.getBoundingClientRect(),i=(n.right-n.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function cn(e){for(var t=e.display,r={},n={},i=t.gutters.clientLeft,o=t.gutters.firstChild,a=0;o;o=o.nextSibling,++a){var s=e.display.gutterSpecs[a].className;r[s]=o.offsetLeft+o.clientLeft+i,n[s]=o.clientWidth}return{fixedPos:pn(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:r,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function pn(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function dn(e){var t=ln(e.display),r=e.options.lineWrapping,n=r&&Math.max(5,e.display.scroller.clientWidth/un(e.display)-3);return function(i){if(zt(e.doc,i))return 0;var o=0;if(i.widgets)for(var a=0;a0&&(l=Ke(e.doc,u.line).text).length==u.ch){var c=q(l,l.length,e.options.tabSize)-l.length;u=ot(u.line,Math.max(0,Math.round((o-_r(e.display).left)/un(e.display))-c))}return u}function gn(e,t){if(t>=e.display.viewTo)return null;if((t-=e.display.viewFrom)<0)return null;for(var r=e.display.view,n=0;nt)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)Ct&&Vt(e.doc,t)i.viewFrom?yn(e):(i.viewFrom+=n,i.viewTo+=n);else if(t<=i.viewFrom&&r>=i.viewTo)yn(e);else if(t<=i.viewFrom){var o=En(e,r,r+n,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=n):yn(e)}else if(r>=i.viewTo){var a=En(e,t,t,-1);a?(i.view=i.view.slice(0,a.index),i.viewTo=a.lineN):yn(e)}else{var s=En(e,t,t,-1),l=En(e,r,r+n,1);s&&l?(i.view=i.view.slice(0,s.index).concat(ur(e,s.lineN,l.lineN)).concat(i.view.slice(l.index)),i.viewTo+=n):yn(e)}var u=i.externalMeasured;u&&(r=i.lineN&&t=n.viewTo)){var o=n.view[gn(e,t)];if(null!=o.node){var a=o.changes||(o.changes=[]);-1==W(a,r)&&a.push(r)}}}function yn(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function En(e,t,r,n){var i,o=gn(e,t),a=e.display.view;if(!Ct||r==e.doc.first+e.doc.size)return{index:o,lineN:r};for(var s=e.display.viewFrom,l=0;l0){if(o==a.length-1)return null;i=s+a[o].size-t,o++}else i=s-t;t+=i,r+=i}for(;Vt(e.doc,r)!=r;){if(o==(n<0?0:a.length-1))return null;r+=n*a[o-(n<0?1:0)].size,o+=n}return{index:o,lineN:r}}function bn(e){for(var t=e.display.view,r=0,n=0;n=e.display.viewTo||l.to().line0?a:e.defaultCharWidth())+"px"}if(n.other){var s=r.appendChild(w("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));s.style.display="",s.style.left=n.other.left+"px",s.style.top=n.other.top+"px",s.style.height=.85*(n.other.bottom-n.other.top)+"px"}}function Sn(e,t){return e.top-t.top||e.left-t.left}function Ln(e,t,r){var n=e.display,i=e.doc,o=document.createDocumentFragment(),a=_r(e.display),s=a.left,l=Math.max(n.sizerWidth,Rr(e)-n.sizer.offsetLeft)-a.right,u="ltr"==i.direction;function c(e,t,r,n){t<0&&(t=0),t=Math.round(t),n=Math.round(n),o.appendChild(w("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px;\n top: "+t+"px; width: "+(null==r?l-e:r)+"px;\n height: "+(n-t)+"px"))}function p(t,r,n){var o,a,p=Ke(i,t),d=p.text.length;function f(r,n){return Yr(e,ot(t,r),"div",p,n)}function h(t,r,n){var i=rn(e,p,null,t),o="ltr"==r==("after"==n)?"left":"right";return f("after"==n?i.begin:i.end-(/\s/.test(p.text.charAt(i.end-1))?2:1),o)[o]}var g=he(p,i.direction);return function(e,t,r,n){if(!e)return n(t,r,"ltr",0);for(var i=!1,o=0;ot||t==r&&a.to==t)&&(n(Math.max(a.from,t),Math.min(a.to,r),1==a.level?"rtl":"ltr",o),i=!0)}i||n(t,r,"ltr")}(g,r||0,null==n?d:n,(function(e,t,i,p){var m="ltr"==i,v=f(e,m?"left":"right"),y=f(t-1,m?"right":"left"),E=null==r&&0==e,b=null==n&&t==d,x=0==p,T=!g||p==g.length-1;if(y.top-v.top<=3){var A=(u?b:E)&&T,S=(u?E:b)&&x?s:(m?v:y).left,L=A?l:(m?y:v).right;c(S,v.top,L-S,v.bottom)}else{var N,C,I,_;m?(N=u&&E&&x?s:v.left,C=u?l:h(e,i,"before"),I=u?s:h(t,i,"after"),_=u&&b&&T?l:y.right):(N=u?h(e,i,"before"):s,C=!u&&E&&x?l:v.right,I=!u&&b&&T?s:y.left,_=u?h(t,i,"after"):l),c(N,v.top,C-N,v.bottom),v.bottom0?t.blinker=setInterval((function(){e.hasFocus()||wn(e),t.cursorDiv.style.visibility=(r=!r)?"":"hidden"}),e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function Cn(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||_n(e))}function In(e){e.state.delayingBlurEvent=!0,setTimeout((function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&wn(e))}),100)}function _n(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(Ee(e,"focus",e,t),e.state.focused=!0,P(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),l&&setTimeout((function(){return e.display.input.reset(!0)}),20)),e.display.input.receivedFocus()),Nn(e))}function wn(e,t){e.state.delayingBlurEvent||(e.state.focused&&(Ee(e,"blur",e,t),e.state.focused=!1,C(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout((function(){e.state.focused||(e.display.shift=!1)}),150))}function Rn(e){for(var t=e.display,r=t.lineDiv.offsetTop,n=Math.max(0,t.scroller.getBoundingClientRect().top),i=t.lineDiv.getBoundingClientRect().top,o=0,l=0;l.005||g<-.005)&&(ie.display.sizerWidth){var v=Math.ceil(d/un(e.display));v>e.display.maxLineLength&&(e.display.maxLineLength=v,e.display.maxLine=u.line,e.display.maxLineChanged=!0)}}}Math.abs(o)>2&&(t.scroller.scrollTop+=o)}function On(e){if(e.widgets)for(var t=0;t=a&&(o=rt(t,Xt(Ke(t,l))-e.wrapper.clientHeight),a=l)}return{from:o,to:Math.max(a,o+1)}}function Pn(e,t){var r=e.display,n=ln(e.display);t.top<0&&(t.top=0);var i=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:r.scroller.scrollTop,o=Or(e),a={};t.bottom-t.top>o&&(t.bottom=t.top+o);var s=e.doc.height+Ir(r),l=t.tops-n;if(t.topi+o){var c=Math.min(t.top,(u?s:t.bottom)-o);c!=i&&(a.scrollTop=c)}var p=e.options.fixedGutter?0:r.gutters.offsetWidth,d=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:r.scroller.scrollLeft-p,f=Rr(e)-r.gutters.offsetWidth,h=t.right-t.left>f;return h&&(t.right=t.left+f),t.left<10?a.scrollLeft=0:t.leftf+d-3&&(a.scrollLeft=t.right+(h?0:10)-f),a}function kn(e,t){null!=t&&(jn(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function Mn(e){jn(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Fn(e,t,r){null==t&&null==r||jn(e),null!=t&&(e.curOp.scrollLeft=t),null!=r&&(e.curOp.scrollTop=r)}function jn(e){var t=e.curOp.scrollToPos;t&&(e.curOp.scrollToPos=null,Gn(e,Jr(e,t.from),Jr(e,t.to),t.margin))}function Gn(e,t,r,n){var i=Pn(e,{left:Math.min(t.left,r.left),top:Math.min(t.top,r.top)-n,right:Math.max(t.right,r.right),bottom:Math.max(t.bottom,r.bottom)+n});Fn(e,i.scrollLeft,i.scrollTop)}function Bn(e,t){Math.abs(e.doc.scrollTop-t)<2||(r||fi(e,{top:t}),Un(e,t,!0),r&&fi(e),li(e,100))}function Un(e,t,r){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),(e.display.scroller.scrollTop!=t||r)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function Hn(e,t,r,n){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(r?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!n||(e.doc.scrollLeft=t,mi(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function qn(e){var t=e.display,r=t.gutters.offsetWidth,n=Math.round(e.doc.height+Ir(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?r:0,docHeight:n,scrollHeight:n+wr(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:r}}var Vn=function(e,t,r){this.cm=r;var n=this.vert=w("div",[w("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=w("div",[w("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");n.tabIndex=i.tabIndex=-1,e(n),e(i),me(n,"scroll",(function(){n.clientHeight&&t(n.scrollTop,"vertical")})),me(i,"scroll",(function(){i.clientWidth&&t(i.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,a&&s<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Vn.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,r=e.scrollHeight>e.clientHeight+1,n=e.nativeBarWidth;if(r){this.vert.style.display="block",this.vert.style.bottom=t?n+"px":"0";var i=e.viewHeight-(t?n:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"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=r?n+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(r?n:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==n&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:r?n:0,bottom:t?n:0}},Vn.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Vn.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Vn.prototype.zeroWidthHack=function(){var e=E&&!h?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.visibility=this.vert.style.visibility="hidden",this.disableHoriz=new V,this.disableVert=new V},Vn.prototype.enableZeroWidthBar=function(e,t,r){e.style.visibility="",t.set(1e3,(function n(){var i=e.getBoundingClientRect();("vert"==r?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1))!=e?e.style.visibility="hidden":t.set(1e3,n)}))},Vn.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Wn=function(){};function zn(e,t){t||(t=qn(e));var r=e.display.barWidth,n=e.display.barHeight;Qn(e,t);for(var i=0;i<4&&r!=e.display.barWidth||n!=e.display.barHeight;i++)r!=e.display.barWidth&&e.options.lineWrapping&&Rn(e),Qn(e,qn(e)),r=e.display.barWidth,n=e.display.barHeight}function Qn(e,t){var r=e.display,n=r.scrollbars.update(t);r.sizer.style.paddingRight=(r.barWidth=n.right)+"px",r.sizer.style.paddingBottom=(r.barHeight=n.bottom)+"px",r.heightForcer.style.borderBottom=n.bottom+"px solid transparent",n.right&&n.bottom?(r.scrollbarFiller.style.display="block",r.scrollbarFiller.style.height=n.bottom+"px",r.scrollbarFiller.style.width=n.right+"px"):r.scrollbarFiller.style.display="",n.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(r.gutterFiller.style.display="block",r.gutterFiller.style.height=n.bottom+"px",r.gutterFiller.style.width=t.gutterWidth+"px"):r.gutterFiller.style.display=""}Wn.prototype.update=function(){return{bottom:0,right:0}},Wn.prototype.setScrollLeft=function(){},Wn.prototype.setScrollTop=function(){},Wn.prototype.clear=function(){};var Xn={native:Vn,null:Wn};function $n(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&C(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Xn[e.options.scrollbarStyle]((function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),me(t,"mousedown",(function(){e.state.focused&&setTimeout((function(){return e.display.input.focus()}),0)})),t.setAttribute("cm-not-content","true")}),(function(t,r){"horizontal"==r?Hn(e,t):Bn(e,t)}),e),e.display.scrollbars.addClass&&P(e.display.wrapper,e.display.scrollbars.addClass)}var Yn=0;function Kn(e){var t;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:++Yn,markArrays:null},t=e.curOp,cr?cr.ops.push(t):t.ownsGroup=cr={ops:[t],delayedCallbacks:[]}}function Jn(e){var t=e.curOp;t&&function(e,t){var r=e.ownsGroup;if(r)try{!function(e){var t=e.delayedCallbacks,r=0;do{for(;r=r.viewTo)||r.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new ci(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function ei(e){e.updatedDisplay=e.mustUpdate&&pi(e.cm,e.update)}function ti(e){var t=e.cm,r=t.display;e.updatedDisplay&&Rn(t),e.barMeasure=qn(t),r.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Pr(t,r.maxLine,r.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(r.scroller.clientWidth,r.sizer.offsetLeft+e.adjustWidthTo+wr(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,r.sizer.offsetLeft+e.adjustWidthTo-Rr(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=r.input.prepareSelection())}function ri(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft(o.defaultView.innerHeight||o.documentElement.clientHeight)&&(i=!1),null!=i&&!g){var a=w("div","",null,"position: absolute;\n top: "+(t.top-r.viewOffset-Cr(e.display))+"px;\n height: "+(t.bottom-t.top+wr(e)+r.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(a),a.scrollIntoView(i),e.display.lineSpace.removeChild(a)}}}(t,function(e,t,r,n){var i;null==n&&(n=0),e.options.lineWrapping||t!=r||(r="before"==t.sticky?ot(t.line,t.ch+1,"before"):t,t=t.ch?ot(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t);for(var o=0;o<5;o++){var a=!1,s=Kr(e,t),l=r&&r!=t?Kr(e,r):s,u=Pn(e,i={left:Math.min(s.left,l.left),top:Math.min(s.top,l.top)-n,right:Math.max(s.left,l.left),bottom:Math.max(s.bottom,l.bottom)+n}),c=e.doc.scrollTop,p=e.doc.scrollLeft;if(null!=u.scrollTop&&(Bn(e,u.scrollTop),Math.abs(e.doc.scrollTop-c)>1&&(a=!0)),null!=u.scrollLeft&&(Hn(e,u.scrollLeft),Math.abs(e.doc.scrollLeft-p)>1&&(a=!0)),!a)break}return i}(t,dt(n,e.scrollToPos.from),dt(n,e.scrollToPos.to),e.scrollToPos.margin));var i=e.maybeHiddenMarkers,o=e.maybeUnhiddenMarkers;if(i)for(var a=0;a=e.display.viewTo)){var r=+new Date+e.options.workTime,n=yt(e,t.highlightFrontier),i=[];t.iter(n.line,Math.min(t.first+t.size,e.display.viewTo+500),(function(o){if(n.line>=e.display.viewFrom){var a=o.styles,s=o.text.length>e.options.maxHighlightLength?Qe(t.mode,n.state):null,l=mt(e,o,n,!0);s&&(n.state=s),o.styles=l.styles;var u=o.styleClasses,c=l.classes;c?o.styleClasses=c:u&&(o.styleClasses=null);for(var p=!a||a.length!=o.styles.length||u!=c&&(!u||!c||u.bgClass!=c.bgClass||u.textClass!=c.textClass),d=0;!p&&dr)return li(e,e.options.workDelay),!0})),t.highlightFrontier=n.line,t.modeFrontier=Math.max(t.modeFrontier,n.line),i.length&&ii(e,(function(){for(var t=0;t=r.viewFrom&&t.visible.to<=r.viewTo&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo)&&r.renderedView==r.view&&0==bn(e))return!1;vi(e)&&(yn(e),t.dims=cn(e));var i=n.first+n.size,o=Math.max(t.visible.from-e.options.viewportMargin,n.first),a=Math.min(i,t.visible.to+e.options.viewportMargin);r.viewFroma&&r.viewTo-a<20&&(a=Math.min(i,r.viewTo)),Ct&&(o=Vt(e.doc,o),a=Wt(e.doc,a));var s=o!=r.viewFrom||a!=r.viewTo||r.lastWrapHeight!=t.wrapperHeight||r.lastWrapWidth!=t.wrapperWidth;!function(e,t,r){var n=e.display;0==n.view.length||t>=n.viewTo||r<=n.viewFrom?(n.view=ur(e,t,r),n.viewFrom=t):(n.viewFrom>t?n.view=ur(e,t,n.viewFrom).concat(n.view):n.viewFromr&&(n.view=n.view.slice(0,gn(e,r)))),n.viewTo=r}(e,o,a),r.viewOffset=Xt(Ke(e.doc,r.viewFrom)),e.display.mover.style.top=r.viewOffset+"px";var u=bn(e);if(!s&&0==u&&!t.force&&r.renderedView==r.view&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo))return!1;var c=function(e){if(e.hasFocus())return null;var t=D(j(e));if(!t||!O(e.display.lineDiv,t))return null;var r={activeElt:t};if(window.getSelection){var n=B(e).getSelection();n.anchorNode&&n.extend&&O(e.display.lineDiv,n.anchorNode)&&(r.anchorNode=n.anchorNode,r.anchorOffset=n.anchorOffset,r.focusNode=n.focusNode,r.focusOffset=n.focusOffset)}return r}(e);return u>4&&(r.lineDiv.style.display="none"),function(e,t,r){var n=e.display,i=e.options.lineNumbers,o=n.lineDiv,a=o.firstChild;function s(t){var r=t.nextSibling;return l&&E&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),r}for(var u=n.view,c=n.viewFrom,p=0;p-1&&(f=!1),hr(e,d,c,r)),f&&(I(d.lineNumber),d.lineNumber.appendChild(document.createTextNode(it(e.options,c)))),a=d.node.nextSibling}else{var h=xr(e,d,c,r);o.insertBefore(h,a)}c+=d.size}for(;a;)a=s(a)}(e,r.updateLineNumbers,t.dims),u>4&&(r.lineDiv.style.display=""),r.renderedView=r.view,function(e){if(e&&e.activeElt&&e.activeElt!=D(G(e.activeElt))&&(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&O(document.body,e.anchorNode)&&O(document.body,e.focusNode))){var t=e.activeElt.ownerDocument,r=t.defaultView.getSelection(),n=t.createRange();n.setEnd(e.anchorNode,e.anchorOffset),n.collapse(!1),r.removeAllRanges(),r.addRange(n),r.extend(e.focusNode,e.focusOffset)}}(c),I(r.cursorDiv),I(r.selectionDiv),r.gutters.style.height=r.sizer.style.minHeight=0,s&&(r.lastWrapHeight=t.wrapperHeight,r.lastWrapWidth=t.wrapperWidth,li(e,400)),r.updateLineNumbers=null,!0}function di(e,t){for(var r=t.viewport,n=!0;;n=!1){if(n&&e.options.lineWrapping&&t.oldDisplayWidth!=Rr(e))n&&(t.visible=Dn(e.display,e.doc,r));else if(r&&null!=r.top&&(r={top:Math.min(e.doc.height+Ir(e.display)-Or(e),r.top)}),t.visible=Dn(e.display,e.doc,r),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break;if(!pi(e,t))break;Rn(e);var i=qn(e);xn(e),zn(e,i),gi(e,i),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 fi(e,t){var r=new ci(e,t);if(pi(e,r)){Rn(e),di(e,r);var n=qn(e);xn(e),zn(e,n),gi(e,n),r.finish()}}function hi(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px",dr(e,"gutterChanged",e)}function gi(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+wr(e)+"px"}function mi(e){var t=e.display,r=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var n=pn(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=n+"px",a=0;a=105&&(o.wrapper.style.clipPath="inset(0px)"),o.wrapper.setAttribute("translate","no"),a&&s<8&&(o.gutters.style.zIndex=-1,o.scroller.style.paddingRight=0),l||r&&y||(o.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(o.wrapper):e(o.wrapper)),o.viewFrom=o.viewTo=t.first,o.reportedViewFrom=o.reportedViewTo=t.first,o.view=[],o.renderedView=null,o.externalMeasured=null,o.viewOffset=0,o.lastWrapHeight=o.lastWrapWidth=0,o.updateLineNumbers=null,o.nativeBarWidth=o.barHeight=o.barWidth=0,o.scrollbarsClipped=!1,o.lineNumWidth=o.lineNumInnerWidth=o.lineNumChars=null,o.alignWidgets=!1,o.cachedCharWidth=o.cachedTextHeight=o.cachedPaddingH=null,o.maxLine=null,o.maxLineLength=0,o.maxLineChanged=!1,o.wheelDX=o.wheelDY=o.wheelStartX=o.wheelStartY=null,o.shift=!1,o.selForContextMenu=null,o.activeTouch=null,o.gutterSpecs=yi(i.gutters,i.lineNumbers),Ei(o),n.init(o)}ci.prototype.signal=function(e,t){Te(e,t)&&this.events.push(arguments)},ci.prototype.finish=function(){for(var e=0;eu.clientWidth,h=u.scrollHeight>u.clientHeight;if(i&&f||o&&h){if(o&&E&&l)e:for(var g=t.target,m=s.view;g!=u;g=g.parentNode)for(var v=0;v=0&&at(e,n.to())<=0)return r}return-1};var Ii=function(e,t){this.anchor=e,this.head=t};function _i(e,t,r){var n=e&&e.options.selectionsMayTouch,i=t[r];t.sort((function(e,t){return at(e.from(),t.from())})),r=W(t,i);for(var o=1;o0:l>=0){var u=ct(s.from(),a.from()),c=ut(s.to(),a.to()),p=s.empty()?a.from()==a.head:s.from()==s.head;o<=r&&--r,t.splice(--o,2,new Ii(p?c:u,p?u:c))}}return new Ci(t,r)}function wi(e,t){return new Ci([new Ii(e,t||e)],0)}function Ri(e){return e.text?ot(e.from.line+e.text.length-1,Z(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function Oi(e,t){if(at(e,t.from)<0)return e;if(at(e,t.to)<=0)return Ri(t);var r=e.line+t.text.length-(t.to.line-t.from.line)-1,n=e.ch;return e.line==t.to.line&&(n+=Ri(t).ch-t.to.ch),ot(r,n)}function Di(e,t){for(var r=[],n=0;n1&&e.remove(s.line+1,h-1),e.insert(s.line+1,v)}dr(e,"change",e,t)}function Gi(e,t,r){!function e(n,i,o){if(n.linked)for(var a=0;as-(e.cm?e.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(o=function(e,t){return t?(Vi(e.done),Z(e.done)):e.done.length&&!Z(e.done).ranges?Z(e.done):e.done.length>1&&!e.done[e.done.length-2].ranges?(e.done.pop(),Z(e.done)):void 0}(i,i.lastOp==n)))a=Z(o.changes),0==at(t.from,t.to)&&0==at(t.from,a.to)?a.to=Ri(t):o.changes.push(qi(e,t));else{var l=Z(i.done);for(l&&l.ranges||Qi(e.sel,i.done),o={changes:[qi(e,t)],generation:i.generation},i.done.push(o);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(r),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=s,i.lastOp=i.lastSelOp=n,i.lastOrigin=i.lastSelOrigin=t.origin,a||Ee(e,"historyAdded")}function zi(e,t,r,n){var i=e.history,o=n&&n.origin;r==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||function(e,t,r,n){var i=t.charAt(0);return"*"==i||"+"==i&&r.ranges.length==n.ranges.length&&r.somethingSelected()==n.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}(e,o,Z(i.done),t))?i.done[i.done.length-1]=t:Qi(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=r,n&&!1!==n.clearRedo&&Vi(i.undone)}function Qi(e,t){var r=Z(t);r&&r.ranges&&r.equals(e)||t.push(e)}function Xi(e,t,r,n){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,r),Math.min(e.first+e.size,n),(function(r){r.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=r.markedSpans),++o}))}function $i(e){if(!e)return null;for(var t,r=0;r-1&&(Z(s)[p]=u[p],delete u[p])}}}return n}function Ji(e,t,r,n){if(n){var i=e.anchor;if(r){var o=at(t,i)<0;o!=at(r,i)<0?(i=t,t=r):o!=at(t,r)<0&&(t=r)}return new Ii(i,t)}return new Ii(r||t,t)}function Zi(e,t,r,n,i){null==i&&(i=e.cm&&(e.cm.display.shift||e.extend)),io(e,new Ci([Ji(e.sel.primary(),t,r,i)],0),n)}function eo(e,t,r){for(var n=[],i=e.cm&&(e.cm.display.shift||e.extend),o=0;o=t.ch:s.to>t.ch))){if(i&&(Ee(l,"beforeCursorEnter"),l.explicitlyCleared)){if(o.markedSpans){--a;continue}break}if(!l.atomic)continue;if(r){var p=l.find(n<0?1:-1),d=void 0;if((n<0?c:u)&&(p=po(e,p,-n,p&&p.line==t.line?o:null)),p&&p.line==t.line&&(d=at(p,r))&&(n<0?d<0:d>0))return uo(e,p,t,n,i)}var f=l.find(n<0?-1:1);return(n<0?u:c)&&(f=po(e,f,n,f.line==t.line?o:null)),f?uo(e,f,t,n,i):null}}return t}function co(e,t,r,n,i){var o=n||1,a=uo(e,t,r,o,i)||!i&&uo(e,t,r,o,!0)||uo(e,t,r,-o,i)||!i&&uo(e,t,r,-o,!0);return a||(e.cantEdit=!0,ot(e.first,0))}function po(e,t,r,n){return r<0&&0==t.ch?t.line>e.first?dt(e,ot(t.line-1)):null:r>0&&t.ch==(n||Ke(e,t.line)).text.length?t.line0)){var c=[l,1],p=at(u.from,s.from),d=at(u.to,s.to);(p<0||!a.inclusiveLeft&&!p)&&c.push({from:u.from,to:s.from}),(d>0||!a.inclusiveRight&&!d)&&c.push({from:s.to,to:u.to}),i.splice.apply(i,c),l+=c.length-3}}return i}(e,t.from,t.to);if(n)for(var i=n.length-1;i>=0;--i)mo(e,{from:n[i].from,to:n[i].to,text:i?[""]:t.text,origin:t.origin});else mo(e,t)}}function mo(e,t){if(1!=t.text.length||""!=t.text[0]||0!=at(t.from,t.to)){var r=Di(e,t);Wi(e,t,r,e.cm?e.cm.curOp.id:NaN),Eo(e,t,r,Rt(e,t));var n=[];Gi(e,(function(e,r){r||-1!=W(n,e.history)||(Ao(e.history,t),n.push(e.history)),Eo(e,t,null,Rt(e,t))}))}}function vo(e,t,r){var n=e.cm&&e.cm.state.suppressEdits;if(!n||r){for(var i,o=e.history,a=e.sel,s="undo"==t?o.done:o.undone,l="undo"==t?o.undone:o.done,u=0;u=0;--f){var h=d(f);if(h)return h.v}}}}function yo(e,t){if(0!=t&&(e.first+=t,e.sel=new Ci(ee(e.sel.ranges,(function(e){return new Ii(ot(e.anchor.line+t,e.anchor.ch),ot(e.head.line+t,e.head.ch))})),e.sel.primIndex),e.cm)){mn(e.cm,e.first,e.first-t,t);for(var r=e.cm.display,n=r.viewFrom;ne.lastLine())){if(t.from.lineo&&(t={from:t.from,to:ot(o,Ke(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Je(e,t.from,t.to),r||(r=Di(e,t)),e.cm?function(e,t,r){var n=e.doc,i=e.display,o=t.from,a=t.to,s=!1,l=o.line;e.options.lineWrapping||(l=tt(qt(Ke(n,o.line))),n.iter(l,a.line+1,(function(e){if(e==i.maxLine)return s=!0,!0}))),n.sel.contains(t.from,t.to)>-1&&xe(e),ji(n,t,r,dn(e)),e.options.lineWrapping||(n.iter(l,o.line+t.text.length,(function(e){var t=$t(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,s=!1)})),s&&(e.curOp.updateMaxLine=!0)),function(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontierr;n--){var i=Ke(e,n).stateAfter;if(i&&(!(i instanceof ht)||n+i.lookAhead1||!(this.children[0]instanceof Lo))){var s=[];this.collapse(s),this.children=[new Lo(s)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t50){for(var a=i.lines.length%25+25,s=a;s10);e.parent.maybeSpill()}},iterN:function(e,t,r){for(var n=0;n0||0==a&&!1!==o.clearWhenEmpty)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=R("span",[o.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(Ht(e,t.line,t,r,o)||t.line!=r.line&&Ht(e,r.line,t,r,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");Ct=!0}o.addToHistory&&Wi(e,{from:t,to:r,origin:"markText"},e.sel,NaN);var s,l=t.line,u=e.cm;if(e.iter(l,r.line+1,(function(n){u&&o.collapsed&&!u.options.lineWrapping&&qt(n)==u.display.maxLine&&(s=!0),o.collapsed&&l!=t.line&&et(n,0),function(e,t,r){var n=r&&window.WeakSet&&(r.markedSpans||(r.markedSpans=new WeakSet));n&&e.markedSpans&&n.has(e.markedSpans)?e.markedSpans.push(t):(e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],n&&n.add(e.markedSpans)),t.marker.attachLine(e)}(n,new It(o,l==t.line?t.ch:null,l==r.line?r.ch:null),e.cm&&e.cm.curOp),++l})),o.collapsed&&e.iter(t.line,r.line+1,(function(t){zt(e,t)&&et(t,0)})),o.clearOnEnter&&me(o,"beforeCursorEnter",(function(){return o.clear()})),o.readOnly&&(Nt=!0,(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++_o,o.atomic=!0),u){if(s&&(u.curOp.updateMaxLine=!0),o.collapsed)mn(u,t.line,r.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var c=t.line;c<=r.line;c++)vn(u,c,"text");o.atomic&&so(u.doc),dr(u,"markerAdded",u,o)}return o}wo.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&Kn(e),Te(this,"clear")){var r=this.find();r&&dr(this,"clear",r.from,r.to)}for(var n=null,i=null,o=0;oe.display.maxLineLength&&(e.display.maxLine=u,e.display.maxLineLength=c,e.display.maxLineChanged=!0)}null!=n&&e&&this.collapsed&&mn(e,n,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&so(e.doc)),e&&dr(e,"markerCleared",e,this,n,i),t&&Jn(e),this.parent&&this.parent.clear()}},wo.prototype.find=function(e,t){var r,n;null==e&&"bookmark"==this.type&&(e=1);for(var i=0;i=0;l--)go(this,n[l]);s?no(this,s):this.cm&&Mn(this.cm)})),undo:si((function(){vo(this,"undo")})),redo:si((function(){vo(this,"redo")})),undoSelection:si((function(){vo(this,"undo",!0)})),redoSelection:si((function(){vo(this,"redo",!0)})),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,r=0,n=0;n=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,r){e=dt(this,e),t=dt(this,t);var n=[],i=e.line;return this.iter(e.line,t.line+1,(function(o){var a=o.markedSpans;if(a)for(var s=0;s=l.to||null==l.from&&i!=e.line||null!=l.from&&i==t.line&&l.from>=t.ch||r&&!r(l.marker)||n.push(l.marker.parent||l.marker)}++i})),n},getAllMarks:function(){var e=[];return this.iter((function(t){var r=t.markedSpans;if(r)for(var n=0;ne)return t=e,!0;e-=o,++r})),dt(this,ot(r,t))},indexFromPos:function(e){var t=(e=dt(this,e)).ch;if(e.linet&&(t=e.from),null!=e.to&&e.to-1)return t.state.draggingText(e),void setTimeout((function(){return t.display.input.focus()}),20);try{var p=e.dataTransfer.getData("Text");if(p){var d;if(t.state.draggingText&&!t.state.draggingText.copy&&(d=t.listSelections()),oo(t.doc,wi(r,r)),d)for(var f=0;f=0;t--)bo(e.doc,"",n[t].from,n[t].to,"+delete");Mn(e)}))}function na(e,t,r){var n=ue(e.text,t+r,r);return n<0||n>e.text.length?null:n}function ia(e,t,r){var n=na(e,t.ch,r);return null==n?null:new ot(t.line,n,r<0?"after":"before")}function oa(e,t,r,n,i){if(e){"rtl"==t.doc.direction&&(i=-i);var o=he(r,t.doc.direction);if(o){var a,s=i<0?Z(o):o[0],l=i<0==(1==s.level)?"after":"before";if(s.level>0||"rtl"==t.doc.direction){var u=Mr(t,r);a=i<0?r.text.length-1:0;var c=Fr(t,u,a).top;a=ce((function(e){return Fr(t,u,e).top==c}),i<0==(1==s.level)?s.from:s.to-1,a),"before"==l&&(a=na(r,a,1))}else a=i<0?s.to:s.from;return new ot(n,a,l)}}return new ot(n,i<0?r.text.length:0,i<0?"before":"after")}Xo.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"},Xo.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"},Xo.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"},Xo.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"]},Xo.default=E?Xo.macDefault:Xo.pcDefault;var aa={selectAll:fo,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Q)},killLine:function(e){return ra(e,(function(t){if(t.empty()){var r=Ke(e.doc,t.head.line).text.length;return t.head.ch==r&&t.head.line0)i=new ot(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),ot(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var a=Ke(e.doc,i.line-1).text;a&&(i=new ot(i.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+a.charAt(a.length-1),ot(i.line-1,a.length-1),i,"+transpose"))}r.push(new Ii(i,i))}e.setSelections(r)}))},newlineAndIndent:function(e){return ii(e,(function(){for(var t=e.listSelections(),r=t.length-1;r>=0;r--)e.replaceRange(e.doc.lineSeparator(),t[r].anchor,t[r].head,"+input");t=e.listSelections();for(var n=0;n-1&&(at((i=u.ranges[i]).from(),t)<0||t.xRel>0)&&(at(i.to(),t)>0||t.xRel<0)?function(e,t,r,n){var i=e.display,o=!1,u=oi(e,(function(t){l&&(i.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:In(e)),ye(i.wrapper.ownerDocument,"mouseup",u),ye(i.wrapper.ownerDocument,"mousemove",c),ye(i.scroller,"dragstart",p),ye(i.scroller,"drop",u),o||(Se(t),n.addNew||Zi(e.doc,r,null,null,n.extend),l&&!f||a&&9==s?setTimeout((function(){i.wrapper.ownerDocument.body.focus({preventScroll:!0}),i.input.focus()}),20):i.input.focus())})),c=function(e){o=o||Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10},p=function(){return o=!0};l&&(i.scroller.draggable=!0),e.state.draggingText=u,u.copy=!n.moveOnDrag,me(i.wrapper.ownerDocument,"mouseup",u),me(i.wrapper.ownerDocument,"mousemove",c),me(i.scroller,"dragstart",p),me(i.scroller,"drop",u),e.state.delayingBlurEvent=!0,setTimeout((function(){return i.input.focus()}),20),i.scroller.dragDrop&&i.scroller.dragDrop()}(e,n,t,o):function(e,t,r,n){a&&In(e);var i=e.display,o=e.doc;Se(t);var s,l,u=o.sel,c=u.ranges;if(n.addNew&&!n.extend?(l=o.sel.contains(r),s=l>-1?c[l]:new Ii(r,r)):(s=o.sel.primary(),l=o.sel.primIndex),"rectangle"==n.unit)n.addNew||(s=new Ii(r,r)),r=hn(e,t,!0,!0),l=-1;else{var p=Ta(e,r,n.unit);s=n.extend?Ji(s,p.anchor,p.head,n.extend):p}n.addNew?-1==l?(l=c.length,io(o,_i(e,c.concat([s]),l),{scroll:!1,origin:"*mouse"})):c.length>1&&c[l].empty()&&"char"==n.unit&&!n.extend?(io(o,_i(e,c.slice(0,l).concat(c.slice(l+1)),0),{scroll:!1,origin:"*mouse"}),u=o.sel):to(o,l,s,X):(l=0,io(o,new Ci([s],0),X),u=o.sel);var d=r;function f(t){if(0!=at(d,t))if(d=t,"rectangle"==n.unit){for(var i=[],a=e.options.tabSize,c=q(Ke(o,r.line).text,r.ch,a),p=q(Ke(o,t.line).text,t.ch,a),f=Math.min(c,p),h=Math.max(c,p),g=Math.min(r.line,t.line),m=Math.min(e.lastLine(),Math.max(r.line,t.line));g<=m;g++){var v=Ke(o,g).text,y=Y(v,f,a);f==h?i.push(new Ii(ot(g,y),ot(g,y))):v.length>y&&i.push(new Ii(ot(g,y),ot(g,Y(v,h,a))))}i.length||i.push(new Ii(r,r)),io(o,_i(e,u.ranges.slice(0,l).concat(i),l),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var E,b=s,x=Ta(e,t,n.unit),T=b.anchor;at(x.anchor,T)>0?(E=x.head,T=ct(b.from(),x.anchor)):(E=x.anchor,T=ut(b.to(),x.head));var A=u.ranges.slice(0);A[l]=function(e,t){var r=t.anchor,n=t.head,i=Ke(e.doc,r.line);if(0==at(r,n)&&r.sticky==n.sticky)return t;var o=he(i);if(!o)return t;var a=de(o,r.ch,r.sticky),s=o[a];if(s.from!=r.ch&&s.to!=r.ch)return t;var l,u=a+(s.from==r.ch==(1!=s.level)?0:1);if(0==u||u==o.length)return t;if(n.line!=r.line)l=(n.line-r.line)*("ltr"==e.doc.direction?1:-1)>0;else{var c=de(o,n.ch,n.sticky),p=c-a||(n.ch-r.ch)*(1==s.level?-1:1);l=c==u-1||c==u?p<0:p>0}var d=o[u+(l?-1:0)],f=l==(1==d.level),h=f?d.from:d.to,g=f?"after":"before";return r.ch==h&&r.sticky==g?t:new Ii(new ot(r.line,h,g),n)}(e,new Ii(dt(o,T),E)),io(o,_i(e,A,l),X)}}var h=i.wrapper.getBoundingClientRect(),g=0;function m(t){e.state.selectingText=!1,g=1/0,t&&(Se(t),i.input.focus()),ye(i.wrapper.ownerDocument,"mousemove",v),ye(i.wrapper.ownerDocument,"mouseup",y),o.history.lastSelOrigin=null}var v=oi(e,(function(t){0!==t.buttons&&_e(t)?function t(r){var a=++g,s=hn(e,r,!0,"rectangle"==n.unit);if(s)if(0!=at(s,d)){e.curOp.focus=D(j(e)),f(s);var l=Dn(i,o);(s.line>=l.to||s.lineh.bottom?20:0;u&&setTimeout(oi(e,(function(){g==a&&(i.scroller.scrollTop+=u,t(r))})),50)}}(t):m(t)})),y=oi(e,m);e.state.selectingText=y,me(i.wrapper.ownerDocument,"mousemove",v),me(i.wrapper.ownerDocument,"mouseup",y)}(e,n,t,o)}(t,n,o,e):Ie(e)==r.scroller&&Se(e):2==i?(n&&Zi(t.doc,n),setTimeout((function(){return r.input.focus()}),20)):3==i&&(S?t.display.input.onContextMenu(e):In(t)))}}function Ta(e,t,r){if("char"==r)return new Ii(t,t);if("word"==r)return e.findWordAt(t);if("line"==r)return new Ii(ot(t.line,0),dt(e.doc,ot(t.line+1,0)));var n=r(e,t);return new Ii(n.from,n.to)}function Aa(e,t,r,n){var i,o;if(t.touches)i=t.touches[0].clientX,o=t.touches[0].clientY;else try{i=t.clientX,o=t.clientY}catch(e){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&Se(t);var a=e.display,s=a.lineDiv.getBoundingClientRect();if(o>s.bottom||!Te(e,r))return Ne(t);o-=s.top-a.viewOffset;for(var l=0;l=i)return Ee(e,r,e,rt(e.doc,o),e.display.gutterSpecs[l].className,t),Ne(t)}}function Sa(e,t){return Aa(e,t,"gutterClick",!0)}function La(e,t){Nr(e.display,t)||function(e,t){return!!Te(e,"gutterContextMenu")&&Aa(e,t,"gutterContextMenu",!1)}(e,t)||be(e,t,"contextmenu")||S||e.display.input.onContextMenu(t)}function Na(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Vr(e)}ba.prototype.compare=function(e,t,r){return this.time+400>e&&0==at(t,this.pos)&&r==this.button};var Ca={toString:function(){return"CodeMirror.Init"}},Ia={},_a={};function wa(e,t,r){if(!t!=!(r&&r!=Ca)){var n=e.display.dragFunctions,i=t?me:ye;i(e.display.scroller,"dragstart",n.start),i(e.display.scroller,"dragenter",n.enter),i(e.display.scroller,"dragover",n.over),i(e.display.scroller,"dragleave",n.leave),i(e.display.scroller,"drop",n.drop)}}function Ra(e){e.options.lineWrapping?(P(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(C(e.display.wrapper,"CodeMirror-wrap"),Yt(e)),fn(e),mn(e),Vr(e),setTimeout((function(){return zn(e)}),100)}function Oa(e,t){var r=this;if(!(this instanceof Oa))return new Oa(e,t);this.options=t=t?H(t):{},H(Ia,t,!1);var n=t.value;"string"==typeof n?n=new Mo(n,t.mode,null,t.lineSeparator,t.direction):t.mode&&(n.modeOption=t.mode),this.doc=n;var i=new Oa.inputStyles[t.inputStyle](this),o=this.display=new xi(e,n,i,t);for(var u in o.wrapper.CodeMirror=this,Na(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),$n(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 V,keySeq:null,specialChars:null},t.autofocus&&!y&&o.input.focus(),a&&s<11&&setTimeout((function(){return r.display.input.reset(!0)}),20),function(e){var t=e.display;me(t.scroller,"mousedown",oi(e,xa)),me(t.scroller,"dblclick",a&&s<11?oi(e,(function(t){if(!be(e,t)){var r=hn(e,t);if(r&&!Sa(e,t)&&!Nr(e.display,t)){Se(t);var n=e.findWordAt(r);Zi(e.doc,n.anchor,n.head)}}})):function(t){return be(e,t)||Se(t)}),me(t.scroller,"contextmenu",(function(t){return La(e,t)})),me(t.input.getField(),"contextmenu",(function(r){t.scroller.contains(r.target)||La(e,r)}));var r,n={end:0};function i(){t.activeTouch&&(r=setTimeout((function(){return t.activeTouch=null}),1e3),(n=t.activeTouch).end=+new Date)}function o(e,t){if(null==t.left)return!0;var r=t.left-e.left,n=t.top-e.top;return r*r+n*n>400}me(t.scroller,"touchstart",(function(i){if(!be(e,i)&&!function(e){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}(i)&&!Sa(e,i)){t.input.ensurePolled(),clearTimeout(r);var o=+new Date;t.activeTouch={start:o,moved:!1,prev:o-n.end<=300?n:null},1==i.touches.length&&(t.activeTouch.left=i.touches[0].pageX,t.activeTouch.top=i.touches[0].pageY)}})),me(t.scroller,"touchmove",(function(){t.activeTouch&&(t.activeTouch.moved=!0)})),me(t.scroller,"touchend",(function(r){var n=t.activeTouch;if(n&&!Nr(t,r)&&null!=n.left&&!n.moved&&new Date-n.start<300){var a,s=e.coordsChar(t.activeTouch,"page");a=!n.prev||o(n,n.prev)?new Ii(s,s):!n.prev.prev||o(n,n.prev.prev)?e.findWordAt(s):new Ii(ot(s.line,0),dt(e.doc,ot(s.line+1,0))),e.setSelection(a.anchor,a.head),e.focus(),Se(r)}i()})),me(t.scroller,"touchcancel",i),me(t.scroller,"scroll",(function(){t.scroller.clientHeight&&(Bn(e,t.scroller.scrollTop),Hn(e,t.scroller.scrollLeft,!0),Ee(e,"scroll",e))})),me(t.scroller,"mousewheel",(function(t){return Ni(e,t)})),me(t.scroller,"DOMMouseScroll",(function(t){return Ni(e,t)})),me(t.wrapper,"scroll",(function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0})),t.dragFunctions={enter:function(t){be(e,t)||Ce(t)},over:function(t){be(e,t)||(function(e,t){var r=hn(e,t);if(r){var n=document.createDocumentFragment();An(e,r,n),e.display.dragCursor||(e.display.dragCursor=w("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),_(e.display.dragCursor,n)}}(e,t),Ce(t))},start:function(t){return function(e,t){if(a&&(!e.state.draggingText||+new Date-Fo<100))Ce(t);else if(!be(e,t)&&!Nr(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!f)){var r=w("img",null,null,"position: fixed; left: 0; top: 0;");r.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",d&&(r.width=r.height=1,e.display.wrapper.appendChild(r),r._top=r.offsetTop),t.dataTransfer.setDragImage(r,0,0),d&&r.parentNode.removeChild(r)}}(e,t)},drop:oi(e,jo),leave:function(t){be(e,t)||Go(e)}};var l=t.input.getField();me(l,"keyup",(function(t){return ma.call(e,t)})),me(l,"keydown",oi(e,ga)),me(l,"keypress",oi(e,va)),me(l,"focus",(function(t){return _n(e,t)})),me(l,"blur",(function(t){return wn(e,t)}))}(this),Ho(),Kn(this),this.curOp.forceUpdate=!0,Bi(this,n),t.autofocus&&!y||this.hasFocus()?setTimeout((function(){r.hasFocus()&&!r.state.focused&&_n(r)}),20):wn(this),_a)_a.hasOwnProperty(u)&&_a[u](this,t[u],Ca);vi(this),t.finishInit&&t.finishInit(this);for(var c=0;c150)){if(!n)return;r="prev"}}else u=0,r="not";"prev"==r?u=t>o.first?q(Ke(o,t-1).text,null,a):0:"add"==r?u=l+e.options.indentUnit:"subtract"==r?u=l-e.options.indentUnit:"number"==typeof r&&(u=l+r),u=Math.max(0,u);var p="",d=0;if(e.options.indentWithTabs)for(var f=Math.floor(u/a);f;--f)d+=a,p+="\t";if(da,l=Me(t),u=null;if(s&&n.ranges.length>1)if(ka&&ka.text.join("\n")==t){if(n.ranges.length%ka.text.length==0){u=[];for(var c=0;c=0;d--){var f=n.ranges[d],h=f.from(),g=f.to();f.empty()&&(r&&r>0?h=ot(h.line,h.ch-r):e.state.overwrite&&!s?g=ot(g.line,Math.min(Ke(o,g.line).text.length,g.ch+Z(l).length)):s&&ka&&ka.lineWise&&ka.text.join("\n")==l.join("\n")&&(h=g=ot(h.line,0)));var m={from:h,to:g,text:u?u[d%u.length]:l,origin:i||(s?"paste":e.state.cutIncoming>a?"cut":"+input")};go(e.doc,m),dr(e,"inputRead",e,m)}t&&!s&&Ga(e,t),Mn(e),e.curOp.updateInput<2&&(e.curOp.updateInput=p),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function ja(e,t){var r=e.clipboardData&&e.clipboardData.getData("Text");if(r)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||!t.hasFocus()||ii(t,(function(){return Fa(t,r,0,null,"paste")})),!0}function Ga(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var r=e.doc.sel,n=r.ranges.length-1;n>=0;n--){var i=r.ranges[n];if(!(i.head.ch>100||n&&r.ranges[n-1].head.line==i.head.line)){var o=e.getModeAt(i.head),a=!1;if(o.electricChars){for(var s=0;s-1){a=Pa(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(Ke(e.doc,i.head.line).text.slice(0,i.head.ch))&&(a=Pa(e,i.head.line,"smart"));a&&dr(e,"electricInput",e,i.head.line)}}}function Ba(e){for(var t=[],r=[],n=0;n0?0:-1));if(isNaN(c))a=null;else{var p=r>0?c>=55296&&c<56320:c>=56320&&c<57343;a=new ot(t.line,Math.max(0,Math.min(s.text.length,t.ch+r*(p?2:1))),-r)}}else a=i?function(e,t,r,n){var i=he(t,e.doc.direction);if(!i)return ia(t,r,n);r.ch>=t.text.length?(r.ch=t.text.length,r.sticky="before"):r.ch<=0&&(r.ch=0,r.sticky="after");var o=de(i,r.ch,r.sticky),a=i[o];if("ltr"==e.doc.direction&&a.level%2==0&&(n>0?a.to>r.ch:a.from=a.from&&d>=c.begin)){var f=p?"before":"after";return new ot(r.line,d,f)}}var h=function(e,t,n){for(var o=function(e,t){return t?new ot(r.line,l(e,1),"before"):new ot(r.line,e,"after")};e>=0&&e0==(1!=a.level),u=s?n.begin:l(n.end,-1);if(a.from<=u&&u0?c.end:l(c.begin,-1);return null==m||n>0&&m==t.text.length||!(g=h(n>0?0:i.length-1,n,u(m)))?null:g}(e.cm,s,t,r):ia(s,t,r);if(null==a){if(o||(u=t.line+l)=e.first+e.size||(t=new ot(u,t.ch,t.sticky),!(s=Ke(e,u))))return!1;t=oa(i,e.cm,s,t.line,l)}else t=a;return!0}if("char"==n||"codepoint"==n)u();else if("column"==n)u(!0);else if("word"==n||"group"==n)for(var c=null,p="group"==n,d=e.cm&&e.cm.getHelper(t,"wordChars"),f=!0;!(r<0)||u(!f);f=!1){var h=s.text.charAt(t.ch)||"\n",g=oe(h,d)?"w":p&&"\n"==h?"n":!p||/\s/.test(h)?null:"p";if(!p||f||g||(g="s"),c&&c!=g){r<0&&(r=1,u(),t.sticky="after");break}if(g&&(c=g),r>0&&!u(!f))break}var m=co(e,t,o,a,!0);return st(o,m)&&(m.hitSide=!0),m}function Va(e,t,r,n){var i,o,a=e.doc,s=t.left;if("page"==n){var l=Math.min(e.display.wrapper.clientHeight,B(e).innerHeight||a(e).documentElement.clientHeight),u=Math.max(l-.5*ln(e.display),3);i=(r>0?t.bottom:t.top)+r*u}else"line"==n&&(i=r>0?t.bottom+3:t.top-3);for(;(o=en(e,s,i)).outside;){if(r<0?i<=0:i>=a.height){o.hitSide=!0;break}i+=5*r}return o}var Wa=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new V,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function za(e,t){var r=kr(e,t.line);if(!r||r.hidden)return null;var n=Ke(e.doc,t.line),i=Dr(r,n,t.line),o=he(n,e.doc.direction),a="left";o&&(a=de(o,t.ch)%2?"right":"left");var s=Br(i.map,t.ch,a);return s.offset="right"==s.collapse?s.end:s.start,s}function Qa(e,t){return t&&(e.bad=!0),e}function Xa(e,t,r){var n;if(t==e.display.lineDiv){if(!(n=e.display.lineDiv.childNodes[r]))return Qa(e.clipPos(ot(e.display.viewTo-1)),!0);t=null,r=0}else for(n=t;;n=n.parentNode){if(!n||n==e.display.lineDiv)return null;if(n.parentNode&&n.parentNode==e.display.lineDiv)break}for(var i=0;i=t.display.viewTo||o.line=t.display.viewFrom&&za(t,i)||{node:l[0].measure.map[2],offset:0},c=o.linen.firstLine()&&(a=ot(a.line-1,Ke(n.doc,a.line-1).length)),s.ch==Ke(n.doc,s.line).text.length&&s.linei.viewTo-1)return!1;a.line==i.viewFrom||0==(e=gn(n,a.line))?(t=tt(i.view[0].line),r=i.view[0].node):(t=tt(i.view[e].line),r=i.view[e-1].node.nextSibling);var l,u,c=gn(n,s.line);if(c==i.view.length-1?(l=i.viewTo-1,u=i.lineDiv.lastChild):(l=tt(i.view[c+1].line)-1,u=i.view[c+1].node.previousSibling),!r)return!1;for(var p=n.doc.splitLines(function(e,t,r,n,i){var o="",a=!1,s=e.doc.lineSeparator(),l=!1;function u(){a&&(o+=s,l&&(o+=s),a=l=!1)}function c(e){e&&(u(),o+=e)}function p(t){if(1==t.nodeType){var r=t.getAttribute("cm-text");if(r)return void c(r);var o,d=t.getAttribute("cm-marker");if(d){var f=e.findMarks(ot(n,0),ot(i+1,0),(m=+d,function(e){return e.id==m}));return void(f.length&&(o=f[0].find(0))&&c(Je(e.doc,o.from,o.to).join(s)))}if("false"==t.getAttribute("contenteditable"))return;var h=/^(pre|div|p|li|table|br)$/i.test(t.nodeName);if(!/^br$/i.test(t.nodeName)&&0==t.textContent.length)return;h&&u();for(var g=0;g1&&d.length>1;)if(Z(p)==Z(d))p.pop(),d.pop(),l--;else{if(p[0]!=d[0])break;p.shift(),d.shift(),t++}for(var f=0,h=0,g=p[0],m=d[0],v=Math.min(g.length,m.length);fa.ch&&y.charCodeAt(y.length-h-1)==E.charCodeAt(E.length-h-1);)f--,h++;p[p.length-1]=y.slice(0,y.length-h).replace(/^\u200b+/,""),p[0]=p[0].slice(f).replace(/\u200b+$/,"");var x=ot(t,f),T=ot(l,d.length?Z(d).length-h:0);return p.length>1||p[0]||at(x,T)?(bo(n.doc,p,x,T,"+input"),!0):void 0},Wa.prototype.ensurePolled=function(){this.forceCompositionEnd()},Wa.prototype.reset=function(){this.forceCompositionEnd()},Wa.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Wa.prototype.readFromDOMSoon=function(){var e=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout((function(){if(e.readDOMTimeout=null,e.composing){if(!e.composing.done)return;e.composing=null}e.updateFromDOM()}),80))},Wa.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||ii(this.cm,(function(){return mn(e.cm)}))},Wa.prototype.setUneditable=function(e){e.contentEditable="false"},Wa.prototype.onKeyPress=function(e){0==e.charCode||this.composing||(e.preventDefault(),this.cm.isReadOnly()||oi(this.cm,Fa)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},Wa.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},Wa.prototype.onContextMenu=function(){},Wa.prototype.resetPosition=function(){},Wa.prototype.needsContentAttribute=!0;var Ya=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new V,this.hasSelection=!1,this.composing=null,this.resetting=!1};Ya.prototype.init=function(e){var t=this,r=this,n=this.cm;this.createField(e);var i=this.textarea;function o(e){if(!be(n,e)){if(n.somethingSelected())Ma({lineWise:!1,text:n.getSelections()});else{if(!n.options.lineWiseCopyCut)return;var t=Ba(n);Ma({lineWise:!0,text:t.text}),"cut"==e.type?n.setSelections(t.ranges,null,Q):(r.prevInput="",i.value=t.text.join("\n"),M(i))}"cut"==e.type&&(n.state.cutIncoming=+new Date)}}e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),m&&(i.style.width="0px"),me(i,"input",(function(){a&&s>=9&&t.hasSelection&&(t.hasSelection=null),r.poll()})),me(i,"paste",(function(e){be(n,e)||ja(e,n)||(n.state.pasteIncoming=+new Date,r.fastPoll())})),me(i,"cut",o),me(i,"copy",o),me(e.scroller,"paste",(function(t){if(!Nr(e,t)&&!be(n,t)){if(!i.dispatchEvent)return n.state.pasteIncoming=+new Date,void r.focus();var o=new Event("paste");o.clipboardData=t.clipboardData,i.dispatchEvent(o)}})),me(e.lineSpace,"selectstart",(function(t){Nr(e,t)||Se(t)})),me(i,"compositionstart",(function(){var e=n.getCursor("from");r.composing&&r.composing.range.clear(),r.composing={start:e,range:n.markText(e,n.getCursor("to"),{className:"CodeMirror-composing"})}})),me(i,"compositionend",(function(){r.composing&&(r.poll(),r.composing.range.clear(),r.composing=null)}))},Ya.prototype.createField=function(e){this.wrapper=Ha(),this.textarea=this.wrapper.firstChild;var t=this.cm.options;Ua(this.textarea,t.spellcheck,t.autocorrect,t.autocapitalize)},Ya.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Ya.prototype.prepareSelection=function(){var e=this.cm,t=e.display,r=e.doc,n=Tn(e);if(e.options.moveInputWithCursor){var i=Kr(e,r.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),a=t.lineDiv.getBoundingClientRect();n.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+a.top-o.top)),n.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+a.left-o.left))}return n},Ya.prototype.showSelection=function(e){var t=this.cm.display;_(t.cursorDiv,e.cursors),_(t.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Ya.prototype.reset=function(e){if(!(this.contextMenuPending||this.composing&&e)){var t=this.cm;if(this.resetting=!0,t.somethingSelected()){this.prevInput="";var r=t.getSelection();this.textarea.value=r,t.state.focused&&M(this.textarea),a&&s>=9&&(this.hasSelection=r)}else e||(this.prevInput=this.textarea.value="",a&&s>=9&&(this.hasSelection=null));this.resetting=!1}},Ya.prototype.getField=function(){return this.textarea},Ya.prototype.supportsTouch=function(){return!1},Ya.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!y||D(G(this.textarea))!=this.textarea))try{this.textarea.focus()}catch(e){}},Ya.prototype.blur=function(){this.textarea.blur()},Ya.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Ya.prototype.receivedFocus=function(){this.slowPoll()},Ya.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,(function(){e.poll(),e.cm.state.focused&&e.slowPoll()}))},Ya.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0,t.polling.set(20,(function r(){t.poll()||e?(t.pollingFast=!1,t.slowPoll()):(e=!0,t.polling.set(60,r))}))},Ya.prototype.poll=function(){var e=this,t=this.cm,r=this.textarea,n=this.prevInput;if(this.contextMenuPending||this.resetting||!t.state.focused||Fe(r)&&!n&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=r.value;if(i==n&&!t.somethingSelected())return!1;if(a&&s>=9&&this.hasSelection===i||E&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var o=i.charCodeAt(0);if(8203!=o||n||(n=""),8666==o)return this.reset(),this.cm.execCommand("undo")}for(var l=0,u=Math.min(n.length,i.length);l1e3||i.indexOf("\n")>-1?r.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))})),!0},Ya.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Ya.prototype.onKeyPress=function(){a&&s>=9&&(this.hasSelection=null),this.fastPoll()},Ya.prototype.onContextMenu=function(e){var t=this,r=t.cm,n=r.display,i=t.textarea;t.contextMenuPending&&t.contextMenuPending();var o=hn(r,e),u=n.scroller.scrollTop;if(o&&!d){r.options.resetSelectionOnContextMenu&&-1==r.doc.sel.contains(o)&&oi(r,io)(r.doc,wi(o),Q);var c,p=i.style.cssText,f=t.wrapper.style.cssText,h=t.wrapper.offsetParent.getBoundingClientRect();if(t.wrapper.style.cssText="position: static",i.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-h.top-5)+"px; left: "+(e.clientX-h.left-5)+"px;\n z-index: 1000; background: "+(a?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",l&&(c=i.ownerDocument.defaultView.scrollY),n.input.focus(),l&&i.ownerDocument.defaultView.scrollTo(null,c),n.input.reset(),r.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=v,n.selForContextMenu=r.doc.sel,clearTimeout(n.detectingSelectAll),a&&s>=9&&m(),S){Ce(e);var g=function(){ye(window,"mouseup",g),setTimeout(v,20)};me(window,"mouseup",g)}else setTimeout(v,50)}function m(){if(null!=i.selectionStart){var e=r.somethingSelected(),o=""+(e?i.value:"");i.value="⇚",i.value=o,t.prevInput=e?"":"",i.selectionStart=1,i.selectionEnd=o.length,n.selForContextMenu=r.doc.sel}}function v(){if(t.contextMenuPending==v&&(t.contextMenuPending=!1,t.wrapper.style.cssText=f,i.style.cssText=p,a&&s<9&&n.scrollbars.setScrollTop(n.scroller.scrollTop=u),null!=i.selectionStart)){(!a||a&&s<9)&&m();var e=0,o=function(){n.selForContextMenu==r.doc.sel&&0==i.selectionStart&&i.selectionEnd>0&&""==t.prevInput?oi(r,fo)(r):e++<10?n.detectingSelectAll=setTimeout(o,500):(n.selForContextMenu=null,n.input.reset())};n.detectingSelectAll=setTimeout(o,200)}}},Ya.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e,this.textarea.readOnly=!!e},Ya.prototype.setUneditable=function(){},Ya.prototype.needsContentAttribute=!1,function(e){var t=e.optionHandlers;function r(r,n,i,o){e.defaults[r]=n,i&&(t[r]=o?function(e,t,r){r!=Ca&&i(e,t,r)}:i)}e.defineOption=r,e.Init=Ca,r("value","",(function(e,t){return e.setValue(t)}),!0),r("mode",null,(function(e,t){e.doc.modeOption=t,ki(e)}),!0),r("indentUnit",2,ki,!0),r("indentWithTabs",!1),r("smartIndent",!0),r("tabSize",4,(function(e){Mi(e),Vr(e),mn(e)}),!0),r("lineSeparator",null,(function(e,t){if(e.doc.lineSep=t,t){var r=[],n=e.doc.first;e.doc.iter((function(e){for(var i=0;;){var o=e.text.indexOf(t,i);if(-1==o)break;i=o+t.length,r.push(ot(n,o))}n++}));for(var i=r.length-1;i>=0;i--)bo(e.doc,t,r[i],ot(r[i].line,r[i].ch+t.length))}})),r("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\u202d\u202e\u2066\u2067\u2069\ufeff\ufff9-\ufffc]/g,(function(e,t,r){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),r!=Ca&&e.refresh()})),r("specialCharPlaceholder",nr,(function(e){return e.refresh()}),!0),r("electricChars",!0),r("inputStyle",y?"contenteditable":"textarea",(function(){throw new Error("inputStyle can not (yet) be changed in a running editor")}),!0),r("spellcheck",!1,(function(e,t){return e.getInputField().spellcheck=t}),!0),r("autocorrect",!1,(function(e,t){return e.getInputField().autocorrect=t}),!0),r("autocapitalize",!1,(function(e,t){return e.getInputField().autocapitalize=t}),!0),r("rtlMoveVisually",!x),r("wholeLineUpdateBefore",!0),r("theme","default",(function(e){Na(e),bi(e)}),!0),r("keyMap","default",(function(e,t,r){var n=ta(t),i=r!=Ca&&ta(r);i&&i.detach&&i.detach(e,n),n.attach&&n.attach(e,i||null)})),r("extraKeys",null),r("configureMouse",null),r("lineWrapping",!1,Ra,!0),r("gutters",[],(function(e,t){e.display.gutterSpecs=yi(t,e.options.lineNumbers),bi(e)}),!0),r("fixedGutter",!0,(function(e,t){e.display.gutters.style.left=t?pn(e.display)+"px":"0",e.refresh()}),!0),r("coverGutterNextToScrollbar",!1,(function(e){return zn(e)}),!0),r("scrollbarStyle","native",(function(e){$n(e),zn(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)}),!0),r("lineNumbers",!1,(function(e,t){e.display.gutterSpecs=yi(e.options.gutters,t),bi(e)}),!0),r("firstLineNumber",1,bi,!0),r("lineNumberFormatter",(function(e){return e}),bi,!0),r("showCursorWhenSelecting",!1,xn,!0),r("resetSelectionOnContextMenu",!0),r("lineWiseCopyCut",!0),r("pasteLinesPerSelection",!0),r("selectionsMayTouch",!1),r("readOnly",!1,(function(e,t){"nocursor"==t&&(wn(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)})),r("screenReaderLabel",null,(function(e,t){t=""===t?null:t,e.display.input.screenReaderLabelChanged(t)})),r("disableInput",!1,(function(e,t){t||e.display.input.reset()}),!0),r("dragDrop",!0,wa),r("allowDropFileTypes",null),r("cursorBlinkRate",530),r("cursorScrollMargin",0),r("cursorHeight",1,xn,!0),r("singleCursorHeightPerLine",!0,xn,!0),r("workTime",100),r("workDelay",100),r("flattenSpans",!0,Mi,!0),r("addModeClass",!1,Mi,!0),r("pollInterval",100),r("undoDepth",200,(function(e,t){return e.doc.history.undoDepth=t})),r("historyEventDelay",1250),r("viewportMargin",10,(function(e){return e.refresh()}),!0),r("maxHighlightLength",1e4,Mi,!0),r("moveInputWithCursor",!0,(function(e,t){t||e.display.input.resetPosition()})),r("tabindex",null,(function(e,t){return e.display.input.getField().tabIndex=t||""})),r("autofocus",null),r("direction","ltr",(function(e,t){return e.doc.setDirection(t)}),!0),r("phrases",null)}(Oa),function(e){var t=e.optionHandlers,r=e.helpers={};e.prototype={constructor:e,focus:function(){B(this).focus(),this.display.input.focus()},setOption:function(e,r){var n=this.options,i=n[e];n[e]==r&&"mode"!=e||(n[e]=r,t.hasOwnProperty(e)&&oi(this,t[e])(this,r,i),Ee(this,"optionChange",this,e))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](ta(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,r=0;rr&&(Pa(this,i.head.line,e,!0),r=i.head.line,n==this.doc.sel.primIndex&&Mn(this));else{var o=i.from(),a=i.to(),s=Math.max(r,o.line);r=Math.min(this.lastLine(),a.line-(a.ch?0:1))+1;for(var l=s;l0&&to(this.doc,n,new Ii(o,u[n].to()),Q)}}})),getTokenAt:function(e,t){return At(this,e,t)},getLineTokens:function(e,t){return At(this,ot(e),t,!0)},getTokenTypeAt:function(e){e=dt(this.doc,e);var t,r=vt(this,Ke(this.doc,e.line)),n=0,i=(r.length-1)/2,o=e.ch;if(0==o)t=r[2];else for(;;){var a=n+i>>1;if((a?r[2*a-1]:0)>=o)i=a;else{if(!(r[2*a+1]o&&(e=o,i=!0),n=Ke(this.doc,e)}else n=e;return Xr(this,n,{top:0,left:0},t||"page",r||i).top+(i?this.doc.height-Xt(n):0)},defaultTextHeight:function(){return ln(this.display)},defaultCharWidth:function(){return un(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,r,n,i){var o,a,s,l=this.display,u=(e=Kr(this,dt(this.doc,e))).bottom,c=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),l.sizer.appendChild(t),"over"==n)u=e.top;else if("above"==n||"near"==n){var p=Math.max(l.wrapper.clientHeight,this.doc.height),d=Math.max(l.sizer.clientWidth,l.lineSpace.clientWidth);("above"==n||e.bottom+t.offsetHeight>p)&&e.top>t.offsetHeight?u=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=p&&(u=e.bottom),c+t.offsetWidth>d&&(c=d-t.offsetWidth)}t.style.top=u+"px",t.style.left=t.style.right="","right"==i?(c=l.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?c=0:"middle"==i&&(c=(l.sizer.clientWidth-t.offsetWidth)/2),t.style.left=c+"px"),r&&(o=this,a={left:c,top:u,right:c+t.offsetWidth,bottom:u+t.offsetHeight},null!=(s=Pn(o,a)).scrollTop&&Bn(o,s.scrollTop),null!=s.scrollLeft&&Hn(o,s.scrollLeft))},triggerOnKeyDown:ai(ga),triggerOnKeyPress:ai(va),triggerOnKeyUp:ma,triggerOnMouseDown:ai(xa),execCommand:function(e){if(aa.hasOwnProperty(e))return aa[e].call(null,this)},triggerElectric:ai((function(e){Ga(this,e)})),findPosH:function(e,t,r,n){var i=1;t<0&&(i=-1,t=-t);for(var o=dt(this.doc,e),a=0;a0&&a(t.charAt(r-1));)--r;for(;n.5||this.options.lineWrapping)&&fn(this),Ee(this,"refresh",this)})),swapDoc:ai((function(e){var t=this.doc;return t.cm=null,this.state.selectingText&&this.state.selectingText(),Bi(this,e),Vr(this),this.display.input.reset(),Fn(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,dr(this,"swapDoc",this,t),t})),phrase:function(e){var t=this.options.phrases;return t&&Object.prototype.hasOwnProperty.call(t,e)?t[e]:e},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}},Ae(e),e.registerHelper=function(t,n,i){r.hasOwnProperty(t)||(r[t]=e[t]={_global:[]}),r[t][n]=i},e.registerGlobalHelper=function(t,n,i,o){e.registerHelper(t,n,o),r[t]._global.push({pred:i,val:o})}}(Oa);var Ka="iter insert remove copy getEditor constructor".split(" ");for(var Ja in Mo.prototype)Mo.prototype.hasOwnProperty(Ja)&&W(Ka,Ja)<0&&(Oa.prototype[Ja]=function(e){return function(){return e.apply(this.doc,arguments)}}(Mo.prototype[Ja]));return Ae(Mo),Oa.inputStyles={textarea:Ya,contenteditable:Wa},Oa.defineMode=function(e){Oa.defaults.mode||"null"==e||(Oa.defaults.mode=e),He.apply(this,arguments)},Oa.defineMIME=function(e,t){Ue[e]=t},Oa.defineMode("null",(function(){return{token:function(e){return e.skipToEnd()}}})),Oa.defineMIME("text/plain","null"),Oa.defineExtension=function(e,t){Oa.prototype[e]=t},Oa.defineDocExtension=function(e,t){Mo.prototype[e]=t},Oa.fromTextArea=function(e,t){if((t=t?H(t):{}).value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),null==t.autofocus){var r=D(G(e));t.autofocus=r==e||null!=e.getAttribute("autofocus")&&r==document.body}function n(){e.value=s.getValue()}var i;if(e.form&&(me(e.form,"submit",n),!t.leaveSubmitMethodAlone)){var o=e.form;i=o.submit;try{var a=o.submit=function(){n(),o.submit=i,o.submit(),o.submit=a}}catch(e){}}t.finishInit=function(r){r.save=n,r.getTextArea=function(){return e},r.toTextArea=function(){r.toTextArea=isNaN,n(),e.parentNode.removeChild(r.getWrapperElement()),e.style.display="",e.form&&(ye(e.form,"submit",n),t.leaveSubmitMethodAlone||"function"!=typeof e.form.submit||(e.form.submit=i))}},e.style.display="none";var s=Oa((function(t){return e.parentNode.insertBefore(t,e.nextSibling)}),t);return s},function(e){e.off=ye,e.on=me,e.wheelEventPixels=Li,e.Doc=Mo,e.splitLines=Me,e.countColumn=q,e.findColumn=Y,e.isWordChar=ie,e.Pass=z,e.signal=Ee,e.Line=Kt,e.changeEnd=Ri,e.scrollbarModel=Xn,e.Pos=ot,e.cmpPos=at,e.modes=Be,e.mimeModes=Ue,e.resolveMode=qe,e.getMode=Ve,e.modeExtensions=We,e.extendMode=ze,e.copyState=Qe,e.startState=$e,e.innerMode=Xe,e.commands=aa,e.keyMap=Xo,e.keyName=ea,e.isModifierKey=Jo,e.lookupKey=Ko,e.normalizeKeyMap=Yo,e.StringStream=Ye,e.SharedTextMarker=Oo,e.TextMarker=wo,e.LineWidget=Co,e.e_preventDefault=Se,e.e_stopPropagation=Le,e.e_stop=Ce,e.addClass=P,e.contains=O,e.rmClass=C,e.keyNames=Vo}(Oa),Oa.version="5.65.16",Oa}()},7518:(e,t,r)=>{!function(e){"use strict";e.defineMode("javascript",(function(t,r){var n,i,o=t.indentUnit,a=r.statementIndent,s=r.jsonld,l=r.json||s,u=!1!==r.trackScope,c=r.typescript,p=r.wordCharacters||/[\w$\xa1-\uffff]/,d=function(){function e(e){return{type:e,style:"keyword"}}var t=e("keyword a"),r=e("keyword b"),n=e("keyword c"),i=e("keyword d"),o=e("operator"),a={type:"atom",style:"atom"};return{if:e("if"),while:t,with:t,else:r,do:r,try:r,finally:r,return:i,break:i,continue:i,new:e("new"),delete:n,void:n,throw:n,debugger:e("debugger"),var:e("var"),const:e("var"),let:e("var"),function:e("function"),catch:e("catch"),for:e("for"),switch:e("switch"),case:e("case"),default:e("default"),in:o,typeof:o,instanceof:o,true:a,false:a,null:a,undefined:a,NaN:a,Infinity:a,this:e("this"),class:e("class"),super:e("atom"),yield:n,export:e("export"),import:e("import"),extends:n,await:n}}(),f=/[+\-*&%=<>!?|~^@]/,h=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function g(e,t,r){return n=e,i=r,t}function m(e,t){var r,n=e.next();if('"'==n||"'"==n)return t.tokenize=(r=n,function(e,t){var n,i=!1;if(s&&"@"==e.peek()&&e.match(h))return t.tokenize=m,g("jsonld-keyword","meta");for(;null!=(n=e.next())&&(n!=r||i);)i=!i&&"\\"==n;return i||(t.tokenize=m),g("string","string")}),t.tokenize(e,t);if("."==n&&e.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return g("number","number");if("."==n&&e.match(".."))return g("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(n))return g(n);if("="==n&&e.eat(">"))return g("=>","operator");if("0"==n&&e.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return g("number","number");if(/\d/.test(n))return e.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),g("number","number");if("/"==n)return e.eat("*")?(t.tokenize=v,v(e,t)):e.eat("/")?(e.skipToEnd(),g("comment","comment")):Je(e,t,1)?(function(e){for(var t,r=!1,n=!1;null!=(t=e.next());){if(!r){if("/"==t&&!n)return;"["==t?n=!0:n&&"]"==t&&(n=!1)}r=!r&&"\\"==t}}(e),e.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),g("regexp","string-2")):(e.eat("="),g("operator","operator",e.current()));if("`"==n)return t.tokenize=y,y(e,t);if("#"==n&&"!"==e.peek())return e.skipToEnd(),g("meta","meta");if("#"==n&&e.eatWhile(p))return g("variable","property");if("<"==n&&e.match("!--")||"-"==n&&e.match("->")&&!/\S/.test(e.string.slice(0,e.start)))return e.skipToEnd(),g("comment","comment");if(f.test(n))return">"==n&&t.lexical&&">"==t.lexical.type||(e.eat("=")?"!"!=n&&"="!=n||e.eat("="):/[<>*+\-|&?]/.test(n)&&(e.eat(n),">"==n&&e.eat(n))),"?"==n&&e.eat(".")?g("."):g("operator","operator",e.current());if(p.test(n)){e.eatWhile(p);var i=e.current();if("."!=t.lastType){if(d.propertyIsEnumerable(i)){var o=d[i];return g(o.type,o.style,i)}if("async"==i&&e.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,!1))return g("async","keyword",i)}return g("variable","variable",i)}}function v(e,t){for(var r,n=!1;r=e.next();){if("/"==r&&n){t.tokenize=m;break}n="*"==r}return g("comment","comment")}function y(e,t){for(var r,n=!1;null!=(r=e.next());){if(!n&&("`"==r||"$"==r&&e.eat("{"))){t.tokenize=m;break}n=!n&&"\\"==r}return g("quasi","string-2",e.current())}function E(e,t){t.fatArrowAt&&(t.fatArrowAt=null);var r=e.string.indexOf("=>",e.start);if(!(r<0)){if(c){var n=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(e.string.slice(e.start,r));n&&(r=n.index)}for(var i=0,o=!1,a=r-1;a>=0;--a){var s=e.string.charAt(a),l="([{}])".indexOf(s);if(l>=0&&l<3){if(!i){++a;break}if(0==--i){"("==s&&(o=!0);break}}else if(l>=3&&l<6)++i;else if(p.test(s))o=!0;else if(/["'\/`]/.test(s))for(;;--a){if(0==a)return;if(e.string.charAt(a-1)==s&&"\\"!=e.string.charAt(a-2)){a--;break}}else if(o&&!i){++a;break}}o&&!i&&(t.fatArrowAt=a)}}var b={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,import:!0,"jsonld-keyword":!0};function x(e,t,r,n,i,o){this.indented=e,this.column=t,this.type=r,this.prev=i,this.info=o,null!=n&&(this.align=n)}function T(e,t){if(!u)return!1;for(var r=e.localVars;r;r=r.next)if(r.name==t)return!0;for(var n=e.context;n;n=n.prev)for(r=n.vars;r;r=r.next)if(r.name==t)return!0}function A(e,t,r,n,i){var o=e.cc;for(S.state=e,S.stream=i,S.marked=null,S.cc=o,S.style=t,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;)if((o.length?o.pop():l?U:G)(r,n)){for(;o.length&&o[o.length-1].lex;)o.pop()();return S.marked?S.marked:"variable"==r&&T(e,n)?"variable-2":t}}var S={state:null,column:null,marked:null,cc:null};function L(){for(var e=arguments.length-1;e>=0;e--)S.cc.push(arguments[e])}function N(){return L.apply(null,arguments),!0}function C(e,t){for(var r=t;r;r=r.next)if(r.name==e)return!0;return!1}function I(e){var t=S.state;if(S.marked="def",u){if(t.context)if("var"==t.lexical.info&&t.context&&t.context.block){var n=function e(t,r){if(r){if(r.block){var n=e(t,r.prev);return n?n==r.prev?r:new w(n,r.vars,!0):null}return C(t,r.vars)?r:new w(r.prev,new R(t,r.vars),!1)}return null}(e,t.context);if(null!=n)return void(t.context=n)}else if(!C(e,t.localVars))return void(t.localVars=new R(e,t.localVars));r.globalVars&&!C(e,t.globalVars)&&(t.globalVars=new R(e,t.globalVars))}}function _(e){return"public"==e||"private"==e||"protected"==e||"abstract"==e||"readonly"==e}function w(e,t,r){this.prev=e,this.vars=t,this.block=r}function R(e,t){this.name=e,this.next=t}var O=new R("this",new R("arguments",null));function D(){S.state.context=new w(S.state.context,S.state.localVars,!1),S.state.localVars=O}function P(){S.state.context=new w(S.state.context,S.state.localVars,!0),S.state.localVars=null}function k(){S.state.localVars=S.state.context.vars,S.state.context=S.state.context.prev}function M(e,t){var r=function(){var r=S.state,n=r.indented;if("stat"==r.lexical.type)n=r.lexical.indented;else for(var i=r.lexical;i&&")"==i.type&&i.align;i=i.prev)n=i.indented;r.lexical=new x(n,S.stream.column(),e,null,r.lexical,t)};return r.lex=!0,r}function F(){var e=S.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function j(e){return function t(r){return r==e?N():";"==e||"}"==r||")"==r||"]"==r?L():N(t)}}function G(e,t){return"var"==e?N(M("vardef",t),Ae,j(";"),F):"keyword a"==e?N(M("form"),q,G,F):"keyword b"==e?N(M("form"),G,F):"keyword d"==e?S.stream.match(/^\s*$/,!1)?N():N(M("stat"),W,j(";"),F):"debugger"==e?N(j(";")):"{"==e?N(M("}"),P,se,F,k):";"==e?N():"if"==e?("else"==S.state.lexical.info&&S.state.cc[S.state.cc.length-1]==F&&S.state.cc.pop()(),N(M("form"),q,G,F,_e)):"function"==e?N(De):"for"==e?N(M("form"),P,we,G,k,F):"class"==e||c&&"interface"==t?(S.marked="keyword",N(M("form","class"==e?e:t),je,F)):"variable"==e?c&&"declare"==t?(S.marked="keyword",N(G)):c&&("module"==t||"enum"==t||"type"==t)&&S.stream.match(/^\s*\w/,!1)?(S.marked="keyword","enum"==t?N(Ye):"type"==t?N(ke,j("operator"),de,j(";")):N(M("form"),Se,j("{"),M("}"),se,F,F)):c&&"namespace"==t?(S.marked="keyword",N(M("form"),U,G,F)):c&&"abstract"==t?(S.marked="keyword",N(G)):N(M("stat"),ee):"switch"==e?N(M("form"),q,j("{"),M("}","switch"),P,se,F,F,k):"case"==e?N(U,j(":")):"default"==e?N(j(":")):"catch"==e?N(M("form"),D,B,G,F,k):"export"==e?N(M("stat"),He,F):"import"==e?N(M("stat"),Ve,F):"async"==e?N(G):"@"==t?N(U,G):L(M("stat"),U,j(";"),F)}function B(e){if("("==e)return N(Me,j(")"))}function U(e,t){return V(e,t,!1)}function H(e,t){return V(e,t,!0)}function q(e){return"("!=e?L():N(M(")"),W,j(")"),F)}function V(e,t,r){if(S.state.fatArrowAt==S.stream.start){var n=r?K:Y;if("("==e)return N(D,M(")"),oe(Me,")"),F,j("=>"),n,k);if("variable"==e)return L(D,Se,j("=>"),n,k)}var i=r?Q:z;return b.hasOwnProperty(e)?N(i):"function"==e?N(De,i):"class"==e||c&&"interface"==t?(S.marked="keyword",N(M("form"),Fe,F)):"keyword c"==e||"async"==e?N(r?H:U):"("==e?N(M(")"),W,j(")"),F,i):"operator"==e||"spread"==e?N(r?H:U):"["==e?N(M("]"),$e,F,i):"{"==e?ae(re,"}",null,i):"quasi"==e?L(X,i):"new"==e?N(function(e){return function(t){return"."==t?N(e?Z:J):"variable"==t&&c?N(be,e?Q:z):L(e?H:U)}}(r)):N()}function W(e){return e.match(/[;\}\)\],]/)?L():L(U)}function z(e,t){return","==e?N(W):Q(e,t,!1)}function Q(e,t,r){var n=0==r?z:Q,i=0==r?U:H;return"=>"==e?N(D,r?K:Y,k):"operator"==e?/\+\+|--/.test(t)||c&&"!"==t?N(n):c&&"<"==t&&S.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?N(M(">"),oe(de,">"),F,n):"?"==t?N(U,j(":"),i):N(i):"quasi"==e?L(X,n):";"!=e?"("==e?ae(H,")","call",n):"."==e?N(te,n):"["==e?N(M("]"),W,j("]"),F,n):c&&"as"==t?(S.marked="keyword",N(de,n)):"regexp"==e?(S.state.lastType=S.marked="operator",S.stream.backUp(S.stream.pos-S.stream.start-1),N(i)):void 0:void 0}function X(e,t){return"quasi"!=e?L():"${"!=t.slice(t.length-2)?N(X):N(W,$)}function $(e){if("}"==e)return S.marked="string-2",S.state.tokenize=y,N(X)}function Y(e){return E(S.stream,S.state),L("{"==e?G:U)}function K(e){return E(S.stream,S.state),L("{"==e?G:H)}function J(e,t){if("target"==t)return S.marked="keyword",N(z)}function Z(e,t){if("target"==t)return S.marked="keyword",N(Q)}function ee(e){return":"==e?N(F,G):L(z,j(";"),F)}function te(e){if("variable"==e)return S.marked="property",N()}function re(e,t){return"async"==e?(S.marked="property",N(re)):"variable"==e||"keyword"==S.style?(S.marked="property","get"==t||"set"==t?N(ne):(c&&S.state.fatArrowAt==S.stream.start&&(r=S.stream.match(/^\s*:\s*/,!1))&&(S.state.fatArrowAt=S.stream.pos+r[0].length),N(ie))):"number"==e||"string"==e?(S.marked=s?"property":S.style+" property",N(ie)):"jsonld-keyword"==e?N(ie):c&&_(t)?(S.marked="keyword",N(re)):"["==e?N(U,le,j("]"),ie):"spread"==e?N(H,ie):"*"==t?(S.marked="keyword",N(re)):":"==e?L(ie):void 0;var r}function ne(e){return"variable"!=e?L(ie):(S.marked="property",N(De))}function ie(e){return":"==e?N(H):"("==e?L(De):void 0}function oe(e,t,r){function n(i,o){if(r?r.indexOf(i)>-1:","==i){var a=S.state.lexical;return"call"==a.info&&(a.pos=(a.pos||0)+1),N((function(r,n){return r==t||n==t?L():L(e)}),n)}return i==t||o==t?N():r&&r.indexOf(";")>-1?L(e):N(j(t))}return function(r,i){return r==t||i==t?N():L(e,n)}}function ae(e,t,r){for(var n=3;n"),de):"quasi"==e?L(me,Ee):void 0}function fe(e){if("=>"==e)return N(de)}function he(e){return e.match(/[\}\)\]]/)?N():","==e||";"==e?N(he):L(ge,he)}function ge(e,t){return"variable"==e||"keyword"==S.style?(S.marked="property",N(ge)):"?"==t||"number"==e||"string"==e?N(ge):":"==e?N(de):"["==e?N(j("variable"),ue,j("]"),ge):"("==e?L(Pe,ge):e.match(/[;\}\)\],]/)?void 0:N()}function me(e,t){return"quasi"!=e?L():"${"!=t.slice(t.length-2)?N(me):N(de,ve)}function ve(e){if("}"==e)return S.marked="string-2",S.state.tokenize=y,N(me)}function ye(e,t){return"variable"==e&&S.stream.match(/^\s*[?:]/,!1)||"?"==t?N(ye):":"==e?N(de):"spread"==e?N(ye):L(de)}function Ee(e,t){return"<"==t?N(M(">"),oe(de,">"),F,Ee):"|"==t||"."==e||"&"==t?N(de):"["==e?N(de,j("]"),Ee):"extends"==t||"implements"==t?(S.marked="keyword",N(de)):"?"==t?N(de,j(":"),de):void 0}function be(e,t){if("<"==t)return N(M(">"),oe(de,">"),F,Ee)}function xe(){return L(de,Te)}function Te(e,t){if("="==t)return N(de)}function Ae(e,t){return"enum"==t?(S.marked="keyword",N(Ye)):L(Se,le,Ce,Ie)}function Se(e,t){return c&&_(t)?(S.marked="keyword",N(Se)):"variable"==e?(I(t),N()):"spread"==e?N(Se):"["==e?ae(Ne,"]"):"{"==e?ae(Le,"}"):void 0}function Le(e,t){return"variable"!=e||S.stream.match(/^\s*:/,!1)?("variable"==e&&(S.marked="property"),"spread"==e?N(Se):"}"==e?L():"["==e?N(U,j("]"),j(":"),Le):N(j(":"),Se,Ce)):(I(t),N(Ce))}function Ne(){return L(Se,Ce)}function Ce(e,t){if("="==t)return N(H)}function Ie(e){if(","==e)return N(Ae)}function _e(e,t){if("keyword b"==e&&"else"==t)return N(M("form","else"),G,F)}function we(e,t){return"await"==t?N(we):"("==e?N(M(")"),Re,F):void 0}function Re(e){return"var"==e?N(Ae,Oe):"variable"==e?N(Oe):L(Oe)}function Oe(e,t){return")"==e?N():";"==e?N(Oe):"in"==t||"of"==t?(S.marked="keyword",N(U,Oe)):L(U,Oe)}function De(e,t){return"*"==t?(S.marked="keyword",N(De)):"variable"==e?(I(t),N(De)):"("==e?N(D,M(")"),oe(Me,")"),F,ce,G,k):c&&"<"==t?N(M(">"),oe(xe,">"),F,De):void 0}function Pe(e,t){return"*"==t?(S.marked="keyword",N(Pe)):"variable"==e?(I(t),N(Pe)):"("==e?N(D,M(")"),oe(Me,")"),F,ce,k):c&&"<"==t?N(M(">"),oe(xe,">"),F,Pe):void 0}function ke(e,t){return"keyword"==e||"variable"==e?(S.marked="type",N(ke)):"<"==t?N(M(">"),oe(xe,">"),F):void 0}function Me(e,t){return"@"==t&&N(U,Me),"spread"==e?N(Me):c&&_(t)?(S.marked="keyword",N(Me)):c&&"this"==e?N(le,Ce):L(Se,le,Ce)}function Fe(e,t){return"variable"==e?je(e,t):Ge(e,t)}function je(e,t){if("variable"==e)return I(t),N(Ge)}function Ge(e,t){return"<"==t?N(M(">"),oe(xe,">"),F,Ge):"extends"==t||"implements"==t||c&&","==e?("implements"==t&&(S.marked="keyword"),N(c?de:U,Ge)):"{"==e?N(M("}"),Be,F):void 0}function Be(e,t){return"async"==e||"variable"==e&&("static"==t||"get"==t||"set"==t||c&&_(t))&&S.stream.match(/^\s+#?[\w$\xa1-\uffff]/,!1)?(S.marked="keyword",N(Be)):"variable"==e||"keyword"==S.style?(S.marked="property",N(Ue,Be)):"number"==e||"string"==e?N(Ue,Be):"["==e?N(U,le,j("]"),Ue,Be):"*"==t?(S.marked="keyword",N(Be)):c&&"("==e?L(Pe,Be):";"==e||","==e?N(Be):"}"==e?N():"@"==t?N(U,Be):void 0}function Ue(e,t){if("!"==t)return N(Ue);if("?"==t)return N(Ue);if(":"==e)return N(de,Ce);if("="==t)return N(H);var r=S.state.lexical.prev;return L(r&&"interface"==r.info?Pe:De)}function He(e,t){return"*"==t?(S.marked="keyword",N(Xe,j(";"))):"default"==t?(S.marked="keyword",N(U,j(";"))):"{"==e?N(oe(qe,"}"),Xe,j(";")):L(G)}function qe(e,t){return"as"==t?(S.marked="keyword",N(j("variable"))):"variable"==e?L(H,qe):void 0}function Ve(e){return"string"==e?N():"("==e?L(U):"."==e?L(z):L(We,ze,Xe)}function We(e,t){return"{"==e?ae(We,"}"):("variable"==e&&I(t),"*"==t&&(S.marked="keyword"),N(Qe))}function ze(e){if(","==e)return N(We,ze)}function Qe(e,t){if("as"==t)return S.marked="keyword",N(We)}function Xe(e,t){if("from"==t)return S.marked="keyword",N(U)}function $e(e){return"]"==e?N():L(oe(H,"]"))}function Ye(){return L(M("form"),Se,j("{"),M("}"),oe(Ke,"}"),F,F)}function Ke(){return L(Se,Ce)}function Je(e,t,r){return t.tokenize==m&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(t.lastType)||"quasi"==t.lastType&&/\{\s*$/.test(e.string.slice(0,e.pos-(r||0)))}return D.lex=P.lex=!0,k.lex=!0,F.lex=!0,{startState:function(e){var t={tokenize:m,lastType:"sof",cc:[],lexical:new x((e||0)-o,0,"block",!1),localVars:r.localVars,context:r.localVars&&new w(null,null,!1),indented:e||0};return r.globalVars&&"object"==typeof r.globalVars&&(t.globalVars=r.globalVars),t},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation(),E(e,t)),t.tokenize!=v&&e.eatSpace())return null;var r=t.tokenize(e,t);return"comment"==n?r:(t.lastType="operator"!=n||"++"!=i&&"--"!=i?n:"incdec",A(t,r,n,i,e))},indent:function(t,n){if(t.tokenize==v||t.tokenize==y)return e.Pass;if(t.tokenize!=m)return 0;var i,s=n&&n.charAt(0),l=t.lexical;if(!/^\s*else\b/.test(n))for(var u=t.cc.length-1;u>=0;--u){var c=t.cc[u];if(c==F)l=l.prev;else if(c!=_e&&c!=k)break}for(;("stat"==l.type||"form"==l.type)&&("}"==s||(i=t.cc[t.cc.length-1])&&(i==z||i==Q)&&!/^[,\.=+\-*:?[\(]/.test(n));)l=l.prev;a&&")"==l.type&&"stat"==l.prev.type&&(l=l.prev);var p=l.type,d=s==p;return"vardef"==p?l.indented+("operator"==t.lastType||","==t.lastType?l.info.length+1:0):"form"==p&&"{"==s?l.indented:"form"==p?l.indented+o:"stat"==p?l.indented+(function(e,t){return"operator"==e.lastType||","==e.lastType||f.test(t.charAt(0))||/[,.]/.test(t.charAt(0))}(t,n)?a||o:0):"switch"!=l.info||d||0==r.doubleIndentSwitch?l.align?l.column+(d?0:1):l.indented+(d?0:o):l.indented+(/^(?:case|default)\b/.test(n)?o:2*o)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:l?null:"/*",blockCommentEnd:l?null:"*/",blockCommentContinue:l?null:" * ",lineComment:l?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:l?"json":"javascript",jsonldMode:s,jsonMode:l,expressionAllowed:Je,skipExpression:function(t){A(t,"atom","atom","true",new e.StringStream("",2,null))}}})),e.registerHelper("wordChars","javascript",/[\w$]/),e.defineMIME("text/javascript","javascript"),e.defineMIME("text/ecmascript","javascript"),e.defineMIME("application/javascript","javascript"),e.defineMIME("application/x-javascript","javascript"),e.defineMIME("application/ecmascript","javascript"),e.defineMIME("application/json",{name:"javascript",json:!0}),e.defineMIME("application/x-json",{name:"javascript",json:!0}),e.defineMIME("application/manifest+json",{name:"javascript",json:!0}),e.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),e.defineMIME("text/typescript",{name:"javascript",typescript:!0}),e.defineMIME("application/typescript",{name:"javascript",typescript:!0})}(r(1719))},1262:(e,t,r)=>{!function(e){"use strict";var t={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},r={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};e.defineMode("xml",(function(n,i){var o,a,s=n.indentUnit,l={},u=i.htmlMode?t:r;for(var c in u)l[c]=u[c];for(var c in i)l[c]=i[c];function p(e,t){function r(r){return t.tokenize=r,r(e,t)}var n=e.next();return"<"==n?e.eat("!")?e.eat("[")?e.match("CDATA[")?r(f("atom","]]>")):null:e.match("--")?r(f("comment","--\x3e")):e.match("DOCTYPE",!0,!0)?(e.eatWhile(/[\w\._\-]/),r(function e(t){return function(r,n){for(var i;null!=(i=r.next());){if("<"==i)return n.tokenize=e(t+1),n.tokenize(r,n);if(">"==i){if(1==t){n.tokenize=p;break}return n.tokenize=e(t-1),n.tokenize(r,n)}}return"meta"}}(1))):null:e.eat("?")?(e.eatWhile(/[\w\._\-]/),t.tokenize=f("meta","?>"),"meta"):(o=e.eat("/")?"closeTag":"openTag",t.tokenize=d,"tag bracket"):"&"==n?(e.eat("#")?e.eat("x")?e.eatWhile(/[a-fA-F\d]/)&&e.eat(";"):e.eatWhile(/[\d]/)&&e.eat(";"):e.eatWhile(/[\w\.\-:]/)&&e.eat(";"))?"atom":"error":(e.eatWhile(/[^&<]/),null)}function d(e,t){var r,n,i=e.next();if(">"==i||"/"==i&&e.eat(">"))return t.tokenize=p,o=">"==i?"endTag":"selfcloseTag","tag bracket";if("="==i)return o="equals",null;if("<"==i){t.tokenize=p,t.state=y,t.tagName=t.tagStart=null;var a=t.tokenize(e,t);return a?a+" tag error":"tag error"}return/[\'\"]/.test(i)?(t.tokenize=(r=i,(n=function(e,t){for(;!e.eol();)if(e.next()==r){t.tokenize=d;break}return"string"}).isInAttribute=!0,n),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function f(e,t){return function(r,n){for(;!r.eol();){if(r.match(t)){n.tokenize=p;break}r.next()}return e}}function h(e){return e&&e.toLowerCase()}function g(e,t,r){this.prev=e.context,this.tagName=t||"",this.indent=e.indented,this.startOfLine=r,(l.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0)}function m(e){e.context&&(e.context=e.context.prev)}function v(e,t){for(var r;;){if(!e.context)return;if(r=e.context.tagName,!l.contextGrabbers.hasOwnProperty(h(r))||!l.contextGrabbers[h(r)].hasOwnProperty(h(t)))return;m(e)}}function y(e,t,r){return"openTag"==e?(r.tagStart=t.column(),E):"closeTag"==e?b:y}function E(e,t,r){return"word"==e?(r.tagName=t.current(),a="tag",A):l.allowMissingTagName&&"endTag"==e?(a="tag bracket",A(e,0,r)):(a="error",E)}function b(e,t,r){if("word"==e){var n=t.current();return r.context&&r.context.tagName!=n&&l.implicitlyClosed.hasOwnProperty(h(r.context.tagName))&&m(r),r.context&&r.context.tagName==n||!1===l.matchClosing?(a="tag",x):(a="tag error",T)}return l.allowMissingTagName&&"endTag"==e?(a="tag bracket",x(e,0,r)):(a="error",T)}function x(e,t,r){return"endTag"!=e?(a="error",x):(m(r),y)}function T(e,t,r){return a="error",x(e,0,r)}function A(e,t,r){if("word"==e)return a="attribute",S;if("endTag"==e||"selfcloseTag"==e){var n=r.tagName,i=r.tagStart;return r.tagName=r.tagStart=null,"selfcloseTag"==e||l.autoSelfClosers.hasOwnProperty(h(n))?v(r,n):(v(r,n),r.context=new g(r,n,i==r.indented)),y}return a="error",A}function S(e,t,r){return"equals"==e?L:(l.allowMissing||(a="error"),A(e,0,r))}function L(e,t,r){return"string"==e?N:"word"==e&&l.allowUnquoted?(a="string",A):(a="error",A(e,0,r))}function N(e,t,r){return"string"==e?N:A(e,0,r)}return p.isInText=!0,{startState:function(e){var t={tokenize:p,state:y,indented:e||0,tagName:null,tagStart:null,context:null};return null!=e&&(t.baseIndent=e),t},token:function(e,t){if(!t.tagName&&e.sol()&&(t.indented=e.indentation()),e.eatSpace())return null;o=null;var r=t.tokenize(e,t);return(r||o)&&"comment"!=r&&(a=null,t.state=t.state(o||r,e,t),a&&(r="error"==a?r+" error":a)),r},indent:function(t,r,n){var i=t.context;if(t.tokenize.isInAttribute)return t.tagStart==t.indented?t.stringStartCol+1:t.indented+s;if(i&&i.noIndent)return e.Pass;if(t.tokenize!=d&&t.tokenize!=p)return n?n.match(/^(\s*)/)[0].length:0;if(t.tagName)return!1!==l.multilineTagIndentPastTag?t.tagStart+t.tagName.length+2:t.tagStart+s*(l.multilineTagIndentFactor||1);if(l.alignCDATA&&/$/,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",configuration:l.htmlMode?"html":"xml",helperType:l.htmlMode?"html":"xml",skipAttribute:function(e){e.state==L&&(e.state=A)},xmlCurrentTag:function(e){return e.tagName?{name:e.tagName,close:"closeTag"==e.type}:null},xmlCurrentContext:function(e){for(var t=[],r=e.context;r;r=r.prev)t.push(r.tagName);return t.reverse()}}})),e.defineMIME("text/xml","xml"),e.defineMIME("application/xml","xml"),e.mimeModes.hasOwnProperty("text/html")||e.defineMIME("text/html",{name:"xml",htmlMode:!0})}(r(1719))},7777:e=>{function t(e){if(e)return function(e){for(var r in t.prototype)e[r]=t.prototype[r];return e}(e)}e.exports=t,t.prototype.on=t.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},t.prototype.once=function(e,t){function r(){this.off(e,r),t.apply(this,arguments)}return r.fn=t,this.on(e,r),this},t.prototype.off=t.prototype.removeListener=t.prototype.removeAllListeners=t.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var r,n=this._callbacks["$"+e];if(!n)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var i=0;i{"use strict";var t=new RegExp("(%[a-f0-9]{2})|([^%]+?)","gi"),r=new RegExp("(%[a-f0-9]{2})+","gi");function n(e,t){try{return[decodeURIComponent(e.join(""))]}catch(e){}if(1===e.length)return e;t=t||1;var r=e.slice(0,t),i=e.slice(t);return Array.prototype.concat.call([],n(r),n(i))}function i(e){try{return decodeURIComponent(e)}catch(o){for(var r=e.match(t)||[],i=1;i{"use strict";var n=r(6649),i=r(7770),o=r(6785),a=r(8109);e.exports=function(e,t,r){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new o("`obj` must be an object or a function`");if("string"!=typeof t&&"symbol"!=typeof t)throw new o("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new o("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new o("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new o("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new o("`loose`, if provided, must be a boolean");var s=arguments.length>3?arguments[3]:null,l=arguments.length>4?arguments[4]:null,u=arguments.length>5?arguments[5]:null,c=arguments.length>6&&arguments[6],p=!!a&&a(e,t);if(n)n(e,t,{configurable:null===u&&p?p.configurable:!u,enumerable:null===s&&p?p.enumerable:!s,value:r,writable:null===l&&p?p.writable:!l});else{if(!c&&(s||l||u))throw new i("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");e[t]=r}}},4996:function(e){e.exports=function(){"use strict";function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}function t(e,r){return(t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,r)}function r(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function n(e,i,o){return(n=r()?Reflect.construct:function(e,r,n){var i=[null];i.push.apply(i,r);var o=new(Function.bind.apply(e,i));return n&&t(o,n.prototype),o}).apply(null,arguments)}function i(e){return function(e){if(Array.isArray(e))return o(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return o(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r1?r-1:0),i=1;i/gm),z=d(/\${[\w\W]*}/gm),Q=d(/^data-[\-\w.\u00B7-\uFFFF]/),X=d(/^aria-[\-\w]+$/),$=d(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Y=d(/^(?:\w+script|data):/i),K=d(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),J=d(/^html$/i),Z=d(/^[a-z][.\w]*(-[.\w]+)+$/i),ee=function(){return"undefined"==typeof window?null:window},te=function(t,r){if("object"!==e(t)||"function"!=typeof t.createPolicy)return null;var n=null;r.currentScript&&r.currentScript.hasAttribute("data-tt-policy-suffix")&&(n=r.currentScript.getAttribute("data-tt-policy-suffix"));var i="dompurify"+(n?"#"+n:"");try{return t.createPolicy(i,{createHTML:function(e){return e},createScriptURL:function(e){return e}})}catch(e){return console.warn("TrustedTypes policy "+i+" could not be created."),null}};return function t(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ee(),n=function(e){return t(e)};if(n.version="2.5.0",n.removed=[],!r||!r.document||9!==r.document.nodeType)return n.isSupported=!1,n;var o=r.document,a=r.document,s=r.DocumentFragment,l=r.HTMLTemplateElement,u=r.Node,c=r.Element,d=r.NodeFilter,f=r.NamedNodeMap,h=void 0===f?r.NamedNodeMap||r.MozNamedAttrMap:f,g=r.HTMLFormElement,m=r.DOMParser,v=r.trustedTypes,_=c.prototype,re=O(_,"cloneNode"),ne=O(_,"nextSibling"),ie=O(_,"childNodes"),oe=O(_,"parentNode");if("function"==typeof l){var ae=a.createElement("template");ae.content&&ae.content.ownerDocument&&(a=ae.content.ownerDocument)}var se=te(v,o),le=se?se.createHTML(""):"",ue=a,ce=ue.implementation,pe=ue.createNodeIterator,de=ue.createDocumentFragment,fe=ue.getElementsByTagName,he=o.importNode,ge={};try{ge=R(a).documentMode?a.documentMode:{}}catch(e){}var me={};n.isSupported="function"==typeof oe&&ce&&void 0!==ce.createHTMLDocument&&9!==ge;var ve,ye,Ee=V,be=W,xe=z,Te=Q,Ae=X,Se=Y,Le=K,Ne=Z,Ce=$,Ie=null,_e=w({},[].concat(i(D),i(P),i(k),i(F),i(G))),we=null,Re=w({},[].concat(i(B),i(U),i(H),i(q))),Oe=Object.seal(Object.create(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}})),De=null,Pe=null,ke=!0,Me=!0,Fe=!1,je=!0,Ge=!1,Be=!0,Ue=!1,He=!1,qe=!1,Ve=!1,We=!1,ze=!1,Qe=!0,Xe=!1,$e="user-content-",Ye=!0,Ke=!1,Je={},Ze=null,et=w({},["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"]),tt=null,rt=w({},["audio","video","img","source","image","track"]),nt=null,it=w({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ot="http://www.w3.org/1998/Math/MathML",at="http://www.w3.org/2000/svg",st="http://www.w3.org/1999/xhtml",lt=st,ut=!1,ct=null,pt=w({},[ot,at,st],T),dt=["application/xhtml+xml","text/html"],ft="text/html",ht=null,gt=a.createElement("form"),mt=function(e){return e instanceof RegExp||e instanceof Function},vt=function(t){ht&&ht===t||(t&&"object"===e(t)||(t={}),t=R(t),ve=ve=-1===dt.indexOf(t.PARSER_MEDIA_TYPE)?ft:t.PARSER_MEDIA_TYPE,ye="application/xhtml+xml"===ve?T:x,Ie="ALLOWED_TAGS"in t?w({},t.ALLOWED_TAGS,ye):_e,we="ALLOWED_ATTR"in t?w({},t.ALLOWED_ATTR,ye):Re,ct="ALLOWED_NAMESPACES"in t?w({},t.ALLOWED_NAMESPACES,T):pt,nt="ADD_URI_SAFE_ATTR"in t?w(R(it),t.ADD_URI_SAFE_ATTR,ye):it,tt="ADD_DATA_URI_TAGS"in t?w(R(rt),t.ADD_DATA_URI_TAGS,ye):rt,Ze="FORBID_CONTENTS"in t?w({},t.FORBID_CONTENTS,ye):et,De="FORBID_TAGS"in t?w({},t.FORBID_TAGS,ye):{},Pe="FORBID_ATTR"in t?w({},t.FORBID_ATTR,ye):{},Je="USE_PROFILES"in t&&t.USE_PROFILES,ke=!1!==t.ALLOW_ARIA_ATTR,Me=!1!==t.ALLOW_DATA_ATTR,Fe=t.ALLOW_UNKNOWN_PROTOCOLS||!1,je=!1!==t.ALLOW_SELF_CLOSE_IN_ATTR,Ge=t.SAFE_FOR_TEMPLATES||!1,Be=!1!==t.SAFE_FOR_XML,Ue=t.WHOLE_DOCUMENT||!1,Ve=t.RETURN_DOM||!1,We=t.RETURN_DOM_FRAGMENT||!1,ze=t.RETURN_TRUSTED_TYPE||!1,qe=t.FORCE_BODY||!1,Qe=!1!==t.SANITIZE_DOM,Xe=t.SANITIZE_NAMED_PROPS||!1,Ye=!1!==t.KEEP_CONTENT,Ke=t.IN_PLACE||!1,Ce=t.ALLOWED_URI_REGEXP||Ce,lt=t.NAMESPACE||st,Oe=t.CUSTOM_ELEMENT_HANDLING||{},t.CUSTOM_ELEMENT_HANDLING&&mt(t.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Oe.tagNameCheck=t.CUSTOM_ELEMENT_HANDLING.tagNameCheck),t.CUSTOM_ELEMENT_HANDLING&&mt(t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Oe.attributeNameCheck=t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),t.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(Oe.allowCustomizedBuiltInElements=t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Ge&&(Me=!1),We&&(Ve=!0),Je&&(Ie=w({},i(G)),we=[],!0===Je.html&&(w(Ie,D),w(we,B)),!0===Je.svg&&(w(Ie,P),w(we,U),w(we,q)),!0===Je.svgFilters&&(w(Ie,k),w(we,U),w(we,q)),!0===Je.mathMl&&(w(Ie,F),w(we,H),w(we,q))),t.ADD_TAGS&&(Ie===_e&&(Ie=R(Ie)),w(Ie,t.ADD_TAGS,ye)),t.ADD_ATTR&&(we===Re&&(we=R(we)),w(we,t.ADD_ATTR,ye)),t.ADD_URI_SAFE_ATTR&&w(nt,t.ADD_URI_SAFE_ATTR,ye),t.FORBID_CONTENTS&&(Ze===et&&(Ze=R(Ze)),w(Ze,t.FORBID_CONTENTS,ye)),Ye&&(Ie["#text"]=!0),Ue&&w(Ie,["html","head","body"]),Ie.table&&(w(Ie,["tbody"]),delete De.tbody),p&&p(t),ht=t)},yt=w({},["mi","mo","mn","ms","mtext"]),Et=w({},["foreignobject","desc","title","annotation-xml"]),bt=w({},["title","style","font","a","script"]),xt=w({},P);w(xt,k),w(xt,M);var Tt=w({},F);w(Tt,j);var At=function(e){var t=oe(e);t&&t.tagName||(t={namespaceURI:lt,tagName:"template"});var r=x(e.tagName),n=x(t.tagName);return!!ct[e.namespaceURI]&&(e.namespaceURI===at?t.namespaceURI===st?"svg"===r:t.namespaceURI===ot?"svg"===r&&("annotation-xml"===n||yt[n]):Boolean(xt[r]):e.namespaceURI===ot?t.namespaceURI===st?"math"===r:t.namespaceURI===at?"math"===r&&Et[n]:Boolean(Tt[r]):e.namespaceURI===st?!(t.namespaceURI===at&&!Et[n])&&!(t.namespaceURI===ot&&!yt[n])&&!Tt[r]&&(bt[r]||!xt[r]):!("application/xhtml+xml"!==ve||!ct[e.namespaceURI]))},St=function(e){b(n.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){try{e.outerHTML=le}catch(t){e.remove()}}},Lt=function(e,t){try{b(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){b(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!we[e])if(Ve||We)try{St(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},Nt=function(e){var t,r;if(qe)e=""+e;else{var n=A(e,/^[\r\n\t ]+/);r=n&&n[0]}"application/xhtml+xml"===ve&<===st&&(e=''+e+"");var i=se?se.createHTML(e):e;if(lt===st)try{t=(new m).parseFromString(i,ve)}catch(e){}if(!t||!t.documentElement){t=ce.createDocument(lt,"template",null);try{t.documentElement.innerHTML=ut?le:i}catch(e){}}var o=t.body||t.documentElement;return e&&r&&o.insertBefore(a.createTextNode(r),o.childNodes[0]||null),lt===st?fe.call(t,Ue?"html":"body")[0]:Ue?t.documentElement:o},Ct=function(e){return pe.call(e.ownerDocument||e,e,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT|d.SHOW_PROCESSING_INSTRUCTION|d.SHOW_CDATA_SECTION,null,!1)},It=function(e){return e instanceof g&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof h)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},_t=function(t){return"object"===e(u)?t instanceof u:t&&"object"===e(t)&&"number"==typeof t.nodeType&&"string"==typeof t.nodeName},wt=function(e,t,r){me[e]&&y(me[e],(function(e){e.call(n,t,r,ht)}))},Rt=function(e){var t;if(wt("beforeSanitizeElements",e,null),It(e))return St(e),!0;if(C(/[\u0080-\uFFFF]/,e.nodeName))return St(e),!0;var r=ye(e.nodeName);if(wt("uponSanitizeElement",e,{tagName:r,allowedTags:Ie}),e.hasChildNodes()&&!_t(e.firstElementChild)&&(!_t(e.content)||!_t(e.content.firstElementChild))&&C(/<[/\w]/g,e.innerHTML)&&C(/<[/\w]/g,e.textContent))return St(e),!0;if("select"===r&&C(/=0;--a)i.insertBefore(re(o[a],!0),ne(e))}return St(e),!0}return e instanceof c&&!At(e)?(St(e),!0):"noscript"!==r&&"noembed"!==r&&"noframes"!==r||!C(/<\/no(script|embed|frames)/i,e.innerHTML)?(Ge&&3===e.nodeType&&(t=e.textContent,t=S(t,Ee," "),t=S(t,be," "),t=S(t,xe," "),e.textContent!==t&&(b(n.removed,{element:e.cloneNode()}),e.textContent=t)),wt("afterSanitizeElements",e,null),!1):(St(e),!0)},Ot=function(e,t,r){if(Qe&&("id"===t||"name"===t)&&(r in a||r in gt))return!1;if(Me&&!Pe[t]&&C(Te,t));else if(ke&&C(Ae,t));else if(!we[t]||Pe[t]){if(!(Dt(e)&&(Oe.tagNameCheck instanceof RegExp&&C(Oe.tagNameCheck,e)||Oe.tagNameCheck instanceof Function&&Oe.tagNameCheck(e))&&(Oe.attributeNameCheck instanceof RegExp&&C(Oe.attributeNameCheck,t)||Oe.attributeNameCheck instanceof Function&&Oe.attributeNameCheck(t))||"is"===t&&Oe.allowCustomizedBuiltInElements&&(Oe.tagNameCheck instanceof RegExp&&C(Oe.tagNameCheck,r)||Oe.tagNameCheck instanceof Function&&Oe.tagNameCheck(r))))return!1}else if(nt[t]);else if(C(Ce,S(r,Le,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==L(r,"data:")||!tt[e])if(Fe&&!C(Se,S(r,Le,"")));else if(r)return!1;return!0},Dt=function(e){return"annotation-xml"!==e&&A(e,Ne)},Pt=function(t){var r,i,o,a;wt("beforeSanitizeAttributes",t,null);var s=t.attributes;if(s){var l={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:we};for(a=s.length;a--;){var u=r=s[a],c=u.name,p=u.namespaceURI;if(i="value"===c?r.value:N(r.value),o=ye(c),l.attrName=o,l.attrValue=i,l.keepAttr=!0,l.forceKeepAttr=void 0,wt("uponSanitizeAttribute",t,l),i=l.attrValue,!l.forceKeepAttr&&(Lt(c,t),l.keepAttr))if(je||!C(/\/>/i,i)){Ge&&(i=S(i,Ee," "),i=S(i,be," "),i=S(i,xe," "));var d=ye(t.nodeName);if(Ot(d,o,i)){if(!Xe||"id"!==o&&"name"!==o||(Lt(c,t),i=$e+i),se&&"object"===e(v)&&"function"==typeof v.getAttributeType)if(p);else switch(v.getAttributeType(d,o)){case"TrustedHTML":i=se.createHTML(i);break;case"TrustedScriptURL":i=se.createScriptURL(i)}try{p?t.setAttributeNS(p,c,i):t.setAttribute(c,i),E(n.removed)}catch(e){}}}else Lt(c,t)}wt("afterSanitizeAttributes",t,null)}},kt=function e(t){var r,n=Ct(t);for(wt("beforeSanitizeShadowDOM",t,null);r=n.nextNode();)wt("uponSanitizeShadowNode",r,null),Rt(r)||(r.content instanceof s&&e(r.content),Pt(r));wt("afterSanitizeShadowDOM",t,null)};return n.sanitize=function(t){var i,a,l,c,p,d=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if((ut=!t)&&(t="\x3c!--\x3e"),"string"!=typeof t&&!_t(t)){if("function"!=typeof t.toString)throw I("toString is not a function");if("string"!=typeof(t=t.toString()))throw I("dirty is not a string, aborting")}if(!n.isSupported){if("object"===e(r.toStaticHTML)||"function"==typeof r.toStaticHTML){if("string"==typeof t)return r.toStaticHTML(t);if(_t(t))return r.toStaticHTML(t.outerHTML)}return t}if(He||vt(d),n.removed=[],"string"==typeof t&&(Ke=!1),Ke){if(t.nodeName){var f=ye(t.nodeName);if(!Ie[f]||De[f])throw I("root node is forbidden and cannot be sanitized in-place")}}else if(t instanceof u)1===(a=(i=Nt("\x3c!----\x3e")).ownerDocument.importNode(t,!0)).nodeType&&"BODY"===a.nodeName||"HTML"===a.nodeName?i=a:i.appendChild(a);else{if(!Ve&&!Ge&&!Ue&&-1===t.indexOf("<"))return se&&ze?se.createHTML(t):t;if(!(i=Nt(t)))return Ve?null:ze?le:""}i&&qe&&St(i.firstChild);for(var h=Ct(Ke?t:i);l=h.nextNode();)3===l.nodeType&&l===c||Rt(l)||(l.content instanceof s&&kt(l.content),Pt(l),c=l);if(c=null,Ke)return t;if(Ve){if(We)for(p=de.call(i.ownerDocument);i.firstChild;)p.appendChild(i.firstChild);else p=i;return(we.shadowroot||we.shadowrootmod)&&(p=he.call(o,p,!0)),p}var g=Ue?i.outerHTML:i.innerHTML;return Ue&&Ie["!doctype"]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&C(J,i.ownerDocument.doctype.name)&&(g="\n"+g),Ge&&(g=S(g,Ee," "),g=S(g,be," "),g=S(g,xe," ")),se&&ze?se.createHTML(g):g},n.setConfig=function(e){vt(e),He=!0},n.clearConfig=function(){ht=null,He=!1},n.isValidAttribute=function(e,t,r){ht||vt({});var n=ye(e),i=ye(t);return Ot(n,i,r)},n.addHook=function(e,t){"function"==typeof t&&(me[e]=me[e]||[],b(me[e],t))},n.removeHook=function(e){if(me[e])return E(me[e])},n.removeHooks=function(e){me[e]&&(me[e]=[])},n.removeAllHooks=function(){me={}},n}()}()},6649:(e,t,r)=>{"use strict";var n=r(8651)("%Object.defineProperty%",!0)||!1;if(n)try{n({},"a",{value:1})}catch(e){n=!1}e.exports=n},9055:e=>{"use strict";e.exports=EvalError},5293:e=>{"use strict";e.exports=Error},8888:e=>{"use strict";e.exports=RangeError},7900:e=>{"use strict";e.exports=ReferenceError},7770:e=>{"use strict";e.exports=SyntaxError},6785:e=>{"use strict";e.exports=TypeError},4055:e=>{"use strict";e.exports=URIError},4785:e=>{"use strict";var t,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};t=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var i=Number.isNaN||function(e){return e!=e};function o(){o.init.call(this)}e.exports=o,e.exports.once=function(e,t){return new Promise((function(r,n){function i(r){e.removeListener(t,o),n(r)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",i),r([].slice.call(arguments))}g(e,t,o,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&g(e,"error",t,r)}(e,i,{once:!0})}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var a=10;function s(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function l(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function u(e,t,r,n){var i,o,a,u;if(s(r),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),a=o[t]),void 0===a)a=o[t]=r,++e._eventsCount;else if("function"==typeof a?a=o[t]=n?[r,a]:[a,r]:n?a.unshift(r):a.push(r),(i=l(e))>0&&a.length>i&&!a.warned){a.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=a.length,u=c,console&&console.warn&&console.warn(u)}return e}function c(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=c.bind(n);return i.listener=r,n.wrapFn=i,i}function d(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r0&&(a=t[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var l=o[e];if(void 0===l)return!1;if("function"==typeof l)n(l,this,t);else{var u=l.length,c=h(l,u);for(r=0;r=0;o--)if(r[o]===t||r[o].listener===t){a=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1=0;n--)this.removeListener(e,t[n]);return this},o.prototype.listeners=function(e){return d(this,e,!0)},o.prototype.rawListeners=function(e){return d(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):f.call(e,t)},o.prototype.listenerCount=f,o.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},4617:e=>{e.exports=i,i.default=i,i.stable=s,i.stableStringify=s;var t=[],r=[];function n(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function i(e,i,a,s){var u;void 0===s&&(s=n()),function e(t,r,n,i,a,s,l){var u;if(s+=1,"object"==typeof t&&null!==t){for(u=0;ul.depthLimit)return void o("[...]",t,r,a);if(void 0!==l.edgesLimit&&n+1>l.edgesLimit)return void o("[...]",t,r,a);if(i.push(t),Array.isArray(t))for(u=0;ut?1:0}function s(e,i,s,u){void 0===u&&(u=n());var c,p=function e(r,n,i,s,l,u,c){var p;if(u+=1,"object"==typeof r&&null!==r){for(p=0;pc.depthLimit)return void o("[...]",r,n,l);if(void 0!==c.edgesLimit&&i+1>c.edgesLimit)return void o("[...]",r,n,l);if(s.push(r),Array.isArray(r))for(p=0;p0)for(var i=0;i{"use strict";e.exports=function(e,t){for(var r={},n=Object.keys(e),i=Array.isArray(t),o=0;o{"use strict";var t="Function.prototype.bind called on incompatible ",r=Object.prototype.toString,n=Math.max,i=function(e,t){for(var r=[],n=0;n{"use strict";var n=r(2719);e.exports=Function.prototype.bind||n},8651:(e,t,r)=>{"use strict";var n=r(5293),i=r(9055),o=r(8888),a=r(7900),s=r(7770),l=r(6785),u=r(4055),c=Function,p=function(e){try{return c('"use strict"; return ('+e+").constructor;")()}catch(e){}},d=Object.getOwnPropertyDescriptor;if(d)try{d({},"")}catch(e){d=null}var f=function(){throw new l},h=d?function(){try{return f}catch(e){try{return d(arguments,"callee").get}catch(e){return f}}}():f,g=r(3257)(),m=r(5726)(),v=Object.getPrototypeOf||(m?function(e){return e.__proto__}:null),y={},E="undefined"!=typeof Uint8Array&&v?v(Uint8Array):void 0,b={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?void 0:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?void 0:ArrayBuffer,"%ArrayIteratorPrototype%":g&&v?v([][Symbol.iterator]()):void 0,"%AsyncFromSyncIteratorPrototype%":void 0,"%AsyncFunction%":y,"%AsyncGenerator%":y,"%AsyncGeneratorFunction%":y,"%AsyncIteratorPrototype%":y,"%Atomics%":"undefined"==typeof Atomics?void 0:Atomics,"%BigInt%":"undefined"==typeof BigInt?void 0:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?void 0:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?void 0:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?void 0:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":n,"%eval%":eval,"%EvalError%":i,"%Float32Array%":"undefined"==typeof Float32Array?void 0:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?void 0:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?void 0:FinalizationRegistry,"%Function%":c,"%GeneratorFunction%":y,"%Int8Array%":"undefined"==typeof Int8Array?void 0:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?void 0:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?void 0:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":g&&v?v(v([][Symbol.iterator]())):void 0,"%JSON%":"object"==typeof JSON?JSON:void 0,"%Map%":"undefined"==typeof Map?void 0:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&g&&v?v((new Map)[Symbol.iterator]()):void 0,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?void 0:Promise,"%Proxy%":"undefined"==typeof Proxy?void 0:Proxy,"%RangeError%":o,"%ReferenceError%":a,"%Reflect%":"undefined"==typeof Reflect?void 0:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?void 0:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&g&&v?v((new Set)[Symbol.iterator]()):void 0,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?void 0:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":g&&v?v(""[Symbol.iterator]()):void 0,"%Symbol%":g?Symbol:void 0,"%SyntaxError%":s,"%ThrowTypeError%":h,"%TypedArray%":E,"%TypeError%":l,"%Uint8Array%":"undefined"==typeof Uint8Array?void 0:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?void 0:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?void 0:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?void 0:Uint32Array,"%URIError%":u,"%WeakMap%":"undefined"==typeof WeakMap?void 0:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?void 0:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?void 0:WeakSet};if(v)try{null.error}catch(e){var x=v(v(e));b["%Error.prototype%"]=x}var T={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},A=r(5049),S=r(5215),L=A.call(Function.call,Array.prototype.concat),N=A.call(Function.apply,Array.prototype.splice),C=A.call(Function.call,String.prototype.replace),I=A.call(Function.call,String.prototype.slice),_=A.call(Function.call,RegExp.prototype.exec),w=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,R=/\\(\\)?/g,O=function(e){var t=I(e,0,1),r=I(e,-1);if("%"===t&&"%"!==r)throw new s("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==t)throw new s("invalid intrinsic syntax, expected opening `%`");var n=[];return C(e,w,(function(e,t,r,i){n[n.length]=r?C(i,R,"$1"):t||e})),n},D=function(e,t){var r,n=e;if(S(T,n)&&(n="%"+(r=T[n])[0]+"%"),S(b,n)){var i=b[n];if(i===y&&(i=function e(t){var r;if("%AsyncFunction%"===t)r=p("async function () {}");else if("%GeneratorFunction%"===t)r=p("function* () {}");else if("%AsyncGeneratorFunction%"===t)r=p("async function* () {}");else if("%AsyncGenerator%"===t){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===t){var i=e("%AsyncGenerator%");i&&v&&(r=v(i.prototype))}return b[t]=r,r}(n)),void 0===i&&!t)throw new l("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:i}}throw new s("intrinsic "+e+" does not exist!")};e.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new l("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new l('"allowMissing" argument must be a boolean');if(null===_(/^%?[^%]*%?$/,e))throw new s("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=O(e),n=r.length>0?r[0]:"",i=D("%"+n+"%",t),o=i.name,a=i.value,u=!1,c=i.alias;c&&(n=c[0],N(r,L([0,1],c)));for(var p=1,f=!0;p=r.length){var v=d(a,h);a=(f=!!v)&&"get"in v&&!("originalValue"in v.get)?v.get:a[h]}else f=S(a,h),a=a[h];f&&!u&&(b[o]=a)}}return a}},8109:(e,t,r)=>{"use strict";var n=r(8651)("%Object.getOwnPropertyDescriptor%",!0);if(n)try{n([],"length")}catch(e){n=null}e.exports=n},8890:(e,t,r)=>{"use strict";var n=r(6649),i=function(){return!!n};i.hasArrayLengthDefineBug=function(){if(!n)return null;try{return 1!==n([],"length",{value:1}).length}catch(e){return!0}},e.exports=i},5726:e=>{"use strict";var t={__proto__:null,foo:{}},r=Object;e.exports=function(){return{__proto__:t}.foo===t.foo&&!(t instanceof r)}},3257:(e,t,r)=>{"use strict";var n="undefined"!=typeof Symbol&&Symbol,i=r(2843);e.exports=function(){return"function"==typeof n&&("function"==typeof Symbol&&("symbol"==typeof n("foo")&&("symbol"==typeof Symbol("bar")&&i())))}},2843:e=>{"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),r=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(t in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var n=Object.getOwnPropertySymbols(e);if(1!==n.length||n[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(e,t);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},5215:(e,t,r)=>{"use strict";var n=Function.prototype.call,i=Object.prototype.hasOwnProperty,o=r(5049);e.exports=o.call(n,i)},9602:function(e,t){var r;!function(t,r){"use strict";"object"==typeof e.exports?e.exports=t.document?r(t,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return r(e)}:r(t)}("undefined"!=typeof window?window:this,(function(n,i){"use strict";var o=[],a=Object.getPrototypeOf,s=o.slice,l=o.flat?function(e){return o.flat.call(e)}:function(e){return o.concat.apply([],e)},u=o.push,c=o.indexOf,p={},d=p.toString,f=p.hasOwnProperty,h=f.toString,g=h.call(Object),m={},v=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},y=function(e){return null!=e&&e===e.window},E=n.document,b={type:!0,src:!0,nonce:!0,noModule:!0};function x(e,t,r){var n,i,o=(r=r||E).createElement("script");if(o.text=e,t)for(n in b)(i=t[n]||t.getAttribute&&t.getAttribute(n))&&o.setAttribute(n,i);r.head.appendChild(o).parentNode.removeChild(o)}function T(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?p[d.call(e)]||"object":typeof e}var A=/HTML$/i,S=function(e,t){return new S.fn.init(e,t)};function L(e){var t=!!e&&"length"in e&&e.length,r=T(e);return!v(e)&&!y(e)&&("array"===r||0===t||"number"==typeof t&&t>0&&t-1 in e)}function N(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}S.fn=S.prototype={jquery:"3.7.1",constructor:S,length:0,toArray:function(){return s.call(this)},get:function(e){return null==e?s.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=S.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return S.each(this,e)},map:function(e){return this.pushStack(S.map(this,(function(t,r){return e.call(t,r,t)})))},slice:function(){return this.pushStack(s.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(S.grep(this,(function(e,t){return(t+1)%2})))},odd:function(){return this.pushStack(S.grep(this,(function(e,t){return t%2})))},eq:function(e){var t=this.length,r=+e+(e<0?t:0);return this.pushStack(r>=0&&r+~]|"+w+")"+w+"*"),U=new RegExp(w+"|>"),H=new RegExp(F),q=new RegExp("^"+D+"$"),V={ID:new RegExp("^#("+D+")"),CLASS:new RegExp("^\\.("+D+")"),TAG:new RegExp("^("+D+"|[*])"),ATTR:new RegExp("^"+M),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+w+"*(even|odd|(([+-]|)(\\d*)n|)"+w+"*(?:([+-]|)"+w+"*(\\d+)|))"+w+"*\\)|)","i"),bool:new RegExp("^(?:"+O+")$","i"),needsContext:new RegExp("^"+w+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+w+"*((?:-\\d)?\\d*)"+w+"*\\)|)(?=[^-]|$)","i")},W=/^(?:input|select|textarea|button)$/i,z=/^h\d$/i,Q=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,X=/[+~]/,$=new RegExp("\\\\[\\da-fA-F]{1,6}"+w+"?|\\\\([^\\r\\n\\f])","g"),Y=function(e,t){var r="0x"+e.slice(1)-65536;return t||(r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320))},K=function(){le()},J=de((function(e){return!0===e.disabled&&N(e,"fieldset")}),{dir:"parentNode",next:"legend"});try{g.apply(o=s.call(P.childNodes),P.childNodes),o[P.childNodes.length].nodeType}catch(e){g={apply:function(e,t){k.apply(e,s.call(t))},call:function(e){k.apply(e,s.call(arguments,1))}}}function Z(e,t,r,n){var i,o,a,s,u,c,f,h=t&&t.ownerDocument,y=t?t.nodeType:9;if(r=r||[],"string"!=typeof e||!e||1!==y&&9!==y&&11!==y)return r;if(!n&&(le(t),t=t||l,p)){if(11!==y&&(u=Q.exec(e)))if(i=u[1]){if(9===y){if(!(a=t.getElementById(i)))return r;if(a.id===i)return g.call(r,a),r}else if(h&&(a=h.getElementById(i))&&Z.contains(t,a)&&a.id===i)return g.call(r,a),r}else{if(u[2])return g.apply(r,t.getElementsByTagName(e)),r;if((i=u[3])&&t.getElementsByClassName)return g.apply(r,t.getElementsByClassName(i)),r}if(!(A[e+" "]||d&&d.test(e))){if(f=e,h=t,1===y&&(U.test(e)||B.test(e))){for((h=X.test(e)&&se(t.parentNode)||t)==t&&m.scope||((s=t.getAttribute("id"))?s=S.escapeSelector(s):t.setAttribute("id",s=v)),o=(c=ce(e)).length;o--;)c[o]=(s?"#"+s:":scope")+" "+pe(c[o]);f=c.join(",")}try{return g.apply(r,h.querySelectorAll(f)),r}catch(t){A(e,!0)}finally{s===v&&t.removeAttribute("id")}}}return ye(e.replace(R,"$1"),t,r,n)}function ee(){var e=[];return function r(n,i){return e.push(n+" ")>t.cacheLength&&delete r[e.shift()],r[n+" "]=i}}function te(e){return e[v]=!0,e}function re(e){var t=l.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function ne(e){return function(t){return N(t,"input")&&t.type===e}}function ie(e){return function(t){return(N(t,"input")||N(t,"button"))&&t.type===e}}function oe(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&J(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function ae(e){return te((function(t){return t=+t,te((function(r,n){for(var i,o=e([],r.length,t),a=o.length;a--;)r[i=o[a]]&&(r[i]=!(n[i]=r[i]))}))}))}function se(e){return e&&void 0!==e.getElementsByTagName&&e}function le(e){var r,n=e?e.ownerDocument||e:P;return n!=l&&9===n.nodeType&&n.documentElement?(u=(l=n).documentElement,p=!S.isXMLDoc(l),h=u.matches||u.webkitMatchesSelector||u.msMatchesSelector,u.msMatchesSelector&&P!=l&&(r=l.defaultView)&&r.top!==r&&r.addEventListener("unload",K),m.getById=re((function(e){return u.appendChild(e).id=S.expando,!l.getElementsByName||!l.getElementsByName(S.expando).length})),m.disconnectedMatch=re((function(e){return h.call(e,"*")})),m.scope=re((function(){return l.querySelectorAll(":scope")})),m.cssHas=re((function(){try{return l.querySelector(":has(*,:jqfake)"),!1}catch(e){return!0}})),m.getById?(t.filter.ID=function(e){var t=e.replace($,Y);return function(e){return e.getAttribute("id")===t}},t.find.ID=function(e,t){if(void 0!==t.getElementById&&p){var r=t.getElementById(e);return r?[r]:[]}}):(t.filter.ID=function(e){var t=e.replace($,Y);return function(e){var r=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return r&&r.value===t}},t.find.ID=function(e,t){if(void 0!==t.getElementById&&p){var r,n,i,o=t.getElementById(e);if(o){if((r=o.getAttributeNode("id"))&&r.value===e)return[o];for(i=t.getElementsByName(e),n=0;o=i[n++];)if((r=o.getAttributeNode("id"))&&r.value===e)return[o]}return[]}}),t.find.TAG=function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):t.querySelectorAll(e)},t.find.CLASS=function(e,t){if(void 0!==t.getElementsByClassName&&p)return t.getElementsByClassName(e)},d=[],re((function(e){var t;u.appendChild(e).innerHTML="",e.querySelectorAll("[selected]").length||d.push("\\["+w+"*(?:value|"+O+")"),e.querySelectorAll("[id~="+v+"-]").length||d.push("~="),e.querySelectorAll("a#"+v+"+*").length||d.push(".#.+[+~]"),e.querySelectorAll(":checked").length||d.push(":checked"),(t=l.createElement("input")).setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),u.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&d.push(":enabled",":disabled"),(t=l.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||d.push("\\["+w+"*name"+w+"*="+w+"*(?:''|\"\")")})),m.cssHas||d.push(":has"),d=d.length&&new RegExp(d.join("|")),L=function(e,t){if(e===t)return a=!0,0;var r=!e.compareDocumentPosition-!t.compareDocumentPosition;return r||(1&(r=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!m.sortDetached&&t.compareDocumentPosition(e)===r?e===l||e.ownerDocument==P&&Z.contains(P,e)?-1:t===l||t.ownerDocument==P&&Z.contains(P,t)?1:i?c.call(i,e)-c.call(i,t):0:4&r?-1:1)},l):l}for(e in Z.matches=function(e,t){return Z(e,null,null,t)},Z.matchesSelector=function(e,t){if(le(e),p&&!A[t+" "]&&(!d||!d.test(t)))try{var r=h.call(e,t);if(r||m.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(e){A(t,!0)}return Z(t,l,null,[e]).length>0},Z.contains=function(e,t){return(e.ownerDocument||e)!=l&&le(e),S.contains(e,t)},Z.attr=function(e,r){(e.ownerDocument||e)!=l&&le(e);var n=t.attrHandle[r.toLowerCase()],i=n&&f.call(t.attrHandle,r.toLowerCase())?n(e,r,!p):void 0;return void 0!==i?i:e.getAttribute(r)},Z.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},S.uniqueSort=function(e){var t,r=[],n=0,o=0;if(a=!m.sortStable,i=!m.sortStable&&s.call(e,0),I.call(e,L),a){for(;t=e[o++];)t===e[o]&&(n=r.push(o));for(;n--;)_.call(e,r[n],1)}return i=null,e},S.fn.uniqueSort=function(){return this.pushStack(S.uniqueSort(s.apply(this)))},(t=S.expr={cacheLength:50,createPseudo:te,match:V,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace($,Y),e[3]=(e[3]||e[4]||e[5]||"").replace($,Y),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||Z.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&Z.error(e[0]),e},PSEUDO:function(e){var t,r=!e[6]&&e[2];return V.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":r&&H.test(r)&&(t=ce(r,!0))&&(t=r.indexOf(")",r.length-t)-r.length)&&(e[0]=e[0].slice(0,t),e[2]=r.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace($,Y).toLowerCase();return"*"===e?function(){return!0}:function(e){return N(e,t)}},CLASS:function(e){var t=b[e+" "];return t||(t=new RegExp("(^|"+w+")"+e+"("+w+"|$)"))&&b(e,(function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")}))},ATTR:function(e,t,r){return function(n){var i=Z.attr(n,e);return null==i?"!="===t:!t||(i+="","="===t?i===r:"!="===t?i!==r:"^="===t?r&&0===i.indexOf(r):"*="===t?r&&i.indexOf(r)>-1:"$="===t?r&&i.slice(-r.length)===r:"~="===t?(" "+i.replace(j," ")+" ").indexOf(r)>-1:"|="===t&&(i===r||i.slice(0,r.length+1)===r+"-"))}},CHILD:function(e,t,r,n,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===n&&0===i?function(e){return!!e.parentNode}:function(t,r,l){var u,c,p,d,f,h=o!==a?"nextSibling":"previousSibling",g=t.parentNode,m=s&&t.nodeName.toLowerCase(),E=!l&&!s,b=!1;if(g){if(o){for(;h;){for(p=t;p=p[h];)if(s?N(p,m):1===p.nodeType)return!1;f=h="only"===e&&!f&&"nextSibling"}return!0}if(f=[a?g.firstChild:g.lastChild],a&&E){for(b=(d=(u=(c=g[v]||(g[v]={}))[e]||[])[0]===y&&u[1])&&u[2],p=d&&g.childNodes[d];p=++d&&p&&p[h]||(b=d=0)||f.pop();)if(1===p.nodeType&&++b&&p===t){c[e]=[y,d,b];break}}else if(E&&(b=d=(u=(c=t[v]||(t[v]={}))[e]||[])[0]===y&&u[1]),!1===b)for(;(p=++d&&p&&p[h]||(b=d=0)||f.pop())&&(!(s?N(p,m):1===p.nodeType)||!++b||(E&&((c=p[v]||(p[v]={}))[e]=[y,b]),p!==t)););return(b-=i)===n||b%n==0&&b/n>=0}}},PSEUDO:function(e,r){var n,i=t.pseudos[e]||t.setFilters[e.toLowerCase()]||Z.error("unsupported pseudo: "+e);return i[v]?i(r):i.length>1?(n=[e,e,"",r],t.setFilters.hasOwnProperty(e.toLowerCase())?te((function(e,t){for(var n,o=i(e,r),a=o.length;a--;)e[n=c.call(e,o[a])]=!(t[n]=o[a])})):function(e){return i(e,0,n)}):i}},pseudos:{not:te((function(e){var t=[],r=[],n=ve(e.replace(R,"$1"));return n[v]?te((function(e,t,r,i){for(var o,a=n(e,null,i,[]),s=e.length;s--;)(o=a[s])&&(e[s]=!(t[s]=o))})):function(e,i,o){return t[0]=e,n(t,null,o,r),t[0]=null,!r.pop()}})),has:te((function(e){return function(t){return Z(e,t).length>0}})),contains:te((function(e){return e=e.replace($,Y),function(t){return(t.textContent||S.text(t)).indexOf(e)>-1}})),lang:te((function(e){return q.test(e||"")||Z.error("unsupported lang: "+e),e=e.replace($,Y).toLowerCase(),function(t){var r;do{if(r=p?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(r=r.toLowerCase())===e||0===r.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}})),target:function(e){var t=n.location&&n.location.hash;return t&&t.slice(1)===e.id},root:function(e){return e===u},focus:function(e){return e===function(){try{return l.activeElement}catch(e){}}()&&l.hasFocus()&&!!(e.type||e.href||~e.tabIndex)},enabled:oe(!1),disabled:oe(!0),checked:function(e){return N(e,"input")&&!!e.checked||N(e,"option")&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!t.pseudos.empty(e)},header:function(e){return z.test(e.nodeName)},input:function(e){return W.test(e.nodeName)},button:function(e){return N(e,"input")&&"button"===e.type||N(e,"button")},text:function(e){var t;return N(e,"input")&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:ae((function(){return[0]})),last:ae((function(e,t){return[t-1]})),eq:ae((function(e,t,r){return[r<0?r+t:r]})),even:ae((function(e,t){for(var r=0;rt?t:r;--n>=0;)e.push(n);return e})),gt:ae((function(e,t,r){for(var n=r<0?r+t:r;++n1?function(t,r,n){for(var i=e.length;i--;)if(!e[i](t,r,n))return!1;return!0}:e[0]}function he(e,t,r,n,i){for(var o,a=[],s=0,l=e.length,u=null!=t;s-1&&(o[u]=!(a[u]=d))}}else f=he(f===a?f.splice(v,f.length):f),i?i(null,a,f,l):g.apply(a,f)}))}function me(e){for(var n,i,o,a=e.length,s=t.relative[e[0].type],l=s||t.relative[" "],u=s?1:0,p=de((function(e){return e===n}),l,!0),d=de((function(e){return c.call(n,e)>-1}),l,!0),f=[function(e,t,i){var o=!s&&(i||t!=r)||((n=t).nodeType?p(e,t,i):d(e,t,i));return n=null,o}];u1&&fe(f),u>1&&pe(e.slice(0,u-1).concat({value:" "===e[u-2].type?"*":""})).replace(R,"$1"),i,u0,o=e.length>0,a=function(a,s,u,c,d){var f,h,m,v=0,E="0",b=a&&[],x=[],T=r,A=a||o&&t.find.TAG("*",d),L=y+=null==T?1:Math.random()||.1,N=A.length;for(d&&(r=s==l||s||d);E!==N&&null!=(f=A[E]);E++){if(o&&f){for(h=0,s||f.ownerDocument==l||(le(f),u=!p);m=e[h++];)if(m(f,s||l,u)){g.call(c,f);break}d&&(y=L)}i&&((f=!m&&f)&&v--,a&&b.push(f))}if(v+=E,i&&E!==v){for(h=0;m=n[h++];)m(b,x,s,u);if(a){if(v>0)for(;E--;)b[E]||x[E]||(x[E]=C.call(c));x=he(x)}g.apply(c,x),d&&!a&&x.length>0&&v+n.length>1&&S.uniqueSort(c)}return d&&(y=L,r=T),b};return i?te(a):a}(a,o))).selector=e}return s}function ye(e,r,n,i){var o,a,s,l,u,c="function"==typeof e&&e,d=!i&&ce(e=c.selector||e);if(n=n||[],1===d.length){if((a=d[0]=d[0].slice(0)).length>2&&"ID"===(s=a[0]).type&&9===r.nodeType&&p&&t.relative[a[1].type]){if(!(r=(t.find.ID(s.matches[0].replace($,Y),r)||[])[0]))return n;c&&(r=r.parentNode),e=e.slice(a.shift().value.length)}for(o=V.needsContext.test(e)?0:a.length;o--&&(s=a[o],!t.relative[l=s.type]);)if((u=t.find[l])&&(i=u(s.matches[0].replace($,Y),X.test(a[0].type)&&se(r.parentNode)||r))){if(a.splice(o,1),!(e=i.length&&pe(a)))return g.apply(n,i),n;break}}return(c||ve(e,d))(i,r,!p,n,!r||X.test(e)&&se(r.parentNode)||r),n}ue.prototype=t.filters=t.pseudos,t.setFilters=new ue,m.sortStable=v.split("").sort(L).join("")===v,le(),m.sortDetached=re((function(e){return 1&e.compareDocumentPosition(l.createElement("fieldset"))})),S.find=Z,S.expr[":"]=S.expr.pseudos,S.unique=S.uniqueSort,Z.compile=ve,Z.select=ye,Z.setDocument=le,Z.tokenize=ce,Z.escape=S.escapeSelector,Z.getText=S.text,Z.isXML=S.isXMLDoc,Z.selectors=S.expr,Z.support=S.support,Z.uniqueSort=S.uniqueSort}();var M=function(e,t,r){for(var n=[],i=void 0!==r;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(i&&S(e).is(r))break;n.push(e)}return n},F=function(e,t){for(var r=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&r.push(e);return r},j=S.expr.match.needsContext,G=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function B(e,t,r){return v(t)?S.grep(e,(function(e,n){return!!t.call(e,n,e)!==r})):t.nodeType?S.grep(e,(function(e){return e===t!==r})):"string"!=typeof t?S.grep(e,(function(e){return c.call(t,e)>-1!==r})):S.filter(t,e,r)}S.filter=function(e,t,r){var n=t[0];return r&&(e=":not("+e+")"),1===t.length&&1===n.nodeType?S.find.matchesSelector(n,e)?[n]:[]:S.find.matches(e,S.grep(t,(function(e){return 1===e.nodeType})))},S.fn.extend({find:function(e){var t,r,n=this.length,i=this;if("string"!=typeof e)return this.pushStack(S(e).filter((function(){for(t=0;t1?S.uniqueSort(r):r},filter:function(e){return this.pushStack(B(this,e||[],!1))},not:function(e){return this.pushStack(B(this,e||[],!0))},is:function(e){return!!B(this,"string"==typeof e&&j.test(e)?S(e):e||[],!1).length}});var U,H=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,r){var n,i;if(!e)return this;if(r=r||U,"string"==typeof e){if(!(n="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:H.exec(e))||!n[1]&&t)return!t||t.jquery?(t||r).find(e):this.constructor(t).find(e);if(n[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(n[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),G.test(n[1])&&S.isPlainObject(t))for(n in t)v(this[n])?this[n](t[n]):this.attr(n,t[n]);return this}return(i=E.getElementById(n[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):v(e)?void 0!==r.ready?r.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,U=S(E);var q=/^(?:parents|prev(?:Until|All))/,V={children:!0,contents:!0,next:!0,prev:!0};function W(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}S.fn.extend({has:function(e){var t=S(e,this),r=t.length;return this.filter((function(){for(var e=0;e-1:1===r.nodeType&&S.find.matchesSelector(r,e))){o.push(r);break}return this.pushStack(o.length>1?S.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?c.call(S(e),this[0]):c.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(S.uniqueSort(S.merge(this.get(),S(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),S.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return M(e,"parentNode")},parentsUntil:function(e,t,r){return M(e,"parentNode",r)},next:function(e){return W(e,"nextSibling")},prev:function(e){return W(e,"previousSibling")},nextAll:function(e){return M(e,"nextSibling")},prevAll:function(e){return M(e,"previousSibling")},nextUntil:function(e,t,r){return M(e,"nextSibling",r)},prevUntil:function(e,t,r){return M(e,"previousSibling",r)},siblings:function(e){return F((e.parentNode||{}).firstChild,e)},children:function(e){return F(e.firstChild)},contents:function(e){return null!=e.contentDocument&&a(e.contentDocument)?e.contentDocument:(N(e,"template")&&(e=e.content||e),S.merge([],e.childNodes))}},(function(e,t){S.fn[e]=function(r,n){var i=S.map(this,t,r);return"Until"!==e.slice(-5)&&(n=r),n&&"string"==typeof n&&(i=S.filter(n,i)),this.length>1&&(V[e]||S.uniqueSort(i),q.test(e)&&i.reverse()),this.pushStack(i)}}));var z=/[^\x20\t\r\n\f]+/g;function Q(e){return e}function X(e){throw e}function $(e,t,r,n){var i;try{e&&v(i=e.promise)?i.call(e).done(t).fail(r):e&&v(i=e.then)?i.call(e,t,r):t.apply(void 0,[e].slice(n))}catch(e){r.apply(void 0,[e])}}S.Callbacks=function(e){e="string"==typeof e?function(e){var t={};return S.each(e.match(z)||[],(function(e,r){t[r]=!0})),t}(e):S.extend({},e);var t,r,n,i,o=[],a=[],s=-1,l=function(){for(i=i||e.once,n=t=!0;a.length;s=-1)for(r=a.shift();++s-1;)o.splice(r,1),r<=s&&s--})),this},has:function(e){return e?S.inArray(e,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return i=a=[],o=r="",this},disabled:function(){return!o},lock:function(){return i=a=[],r||t||(o=r=""),this},locked:function(){return!!i},fireWith:function(e,r){return i||(r=[e,(r=r||[]).slice?r.slice():r],a.push(r),t||l()),this},fire:function(){return u.fireWith(this,arguments),this},fired:function(){return!!n}};return u},S.extend({Deferred:function(e){var t=[["notify","progress",S.Callbacks("memory"),S.Callbacks("memory"),2],["resolve","done",S.Callbacks("once memory"),S.Callbacks("once memory"),0,"resolved"],["reject","fail",S.Callbacks("once memory"),S.Callbacks("once memory"),1,"rejected"]],r="pending",i={state:function(){return r},always:function(){return o.done(arguments).fail(arguments),this},catch:function(e){return i.then(null,e)},pipe:function(){var e=arguments;return S.Deferred((function(r){S.each(t,(function(t,n){var i=v(e[n[4]])&&e[n[4]];o[n[1]]((function(){var e=i&&i.apply(this,arguments);e&&v(e.promise)?e.promise().progress(r.notify).done(r.resolve).fail(r.reject):r[n[0]+"With"](this,i?[e]:arguments)}))})),e=null})).promise()},then:function(e,r,i){var o=0;function a(e,t,r,i){return function(){var s=this,l=arguments,u=function(){var n,u;if(!(e=o&&(r!==X&&(s=void 0,l=[n]),t.rejectWith(s,l))}};e?c():(S.Deferred.getErrorHook?c.error=S.Deferred.getErrorHook():S.Deferred.getStackHook&&(c.error=S.Deferred.getStackHook()),n.setTimeout(c))}}return S.Deferred((function(n){t[0][3].add(a(0,n,v(i)?i:Q,n.notifyWith)),t[1][3].add(a(0,n,v(e)?e:Q)),t[2][3].add(a(0,n,v(r)?r:X))})).promise()},promise:function(e){return null!=e?S.extend(e,i):i}},o={};return S.each(t,(function(e,n){var a=n[2],s=n[5];i[n[1]]=a.add,s&&a.add((function(){r=s}),t[3-e][2].disable,t[3-e][3].disable,t[0][2].lock,t[0][3].lock),a.add(n[3].fire),o[n[0]]=function(){return o[n[0]+"With"](this===o?void 0:this,arguments),this},o[n[0]+"With"]=a.fireWith})),i.promise(o),e&&e.call(o,o),o},when:function(e){var t=arguments.length,r=t,n=Array(r),i=s.call(arguments),o=S.Deferred(),a=function(e){return function(r){n[e]=this,i[e]=arguments.length>1?s.call(arguments):r,--t||o.resolveWith(n,i)}};if(t<=1&&($(e,o.done(a(r)).resolve,o.reject,!t),"pending"===o.state()||v(i[r]&&i[r].then)))return o.then();for(;r--;)$(i[r],a(r),o.reject);return o.promise()}});var Y=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;S.Deferred.exceptionHook=function(e,t){n.console&&n.console.warn&&e&&Y.test(e.name)&&n.console.warn("jQuery.Deferred exception: "+e.message,e.stack,t)},S.readyException=function(e){n.setTimeout((function(){throw e}))};var K=S.Deferred();function J(){E.removeEventListener("DOMContentLoaded",J),n.removeEventListener("load",J),S.ready()}S.fn.ready=function(e){return K.then(e).catch((function(e){S.readyException(e)})),this},S.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--S.readyWait:S.isReady)||(S.isReady=!0,!0!==e&&--S.readyWait>0||K.resolveWith(E,[S]))}}),S.ready.then=K.then,"complete"===E.readyState||"loading"!==E.readyState&&!E.documentElement.doScroll?n.setTimeout(S.ready):(E.addEventListener("DOMContentLoaded",J),n.addEventListener("load",J));var Z=function(e,t,r,n,i,o,a){var s=0,l=e.length,u=null==r;if("object"===T(r))for(s in i=!0,r)Z(e,t,s,r[s],!0,o,a);else if(void 0!==n&&(i=!0,v(n)||(a=!0),u&&(a?(t.call(e,n),t=null):(u=t,t=function(e,t,r){return u.call(S(e),r)})),t))for(;s1,null,!0)},removeData:function(e){return this.each((function(){se.remove(this,e)}))}}),S.extend({queue:function(e,t,r){var n;if(e)return t=(t||"fx")+"queue",n=ae.get(e,t),r&&(!n||Array.isArray(r)?n=ae.access(e,t,S.makeArray(r)):n.push(r)),n||[]},dequeue:function(e,t){t=t||"fx";var r=S.queue(e,t),n=r.length,i=r.shift(),o=S._queueHooks(e,t);"inprogress"===i&&(i=r.shift(),n--),i&&("fx"===t&&r.unshift("inprogress"),delete o.stop,i.call(e,(function(){S.dequeue(e,t)}),o)),!n&&o&&o.empty.fire()},_queueHooks:function(e,t){var r=t+"queueHooks";return ae.get(e,r)||ae.access(e,r,{empty:S.Callbacks("once memory").add((function(){ae.remove(e,[t+"queue",r])}))})}}),S.fn.extend({queue:function(e,t){var r=2;return"string"!=typeof e&&(t=e,e="fx",r--),arguments.length\x20\t\r\n\f]*)/i,Ne=/^$|^module$|\/(?:java|ecma)script/i;Te=E.createDocumentFragment().appendChild(E.createElement("div")),(Ae=E.createElement("input")).setAttribute("type","radio"),Ae.setAttribute("checked","checked"),Ae.setAttribute("name","t"),Te.appendChild(Ae),m.checkClone=Te.cloneNode(!0).cloneNode(!0).lastChild.checked,Te.innerHTML="",m.noCloneChecked=!!Te.cloneNode(!0).lastChild.defaultValue,Te.innerHTML="",m.option=!!Te.lastChild;var Ce={thead:[1,""],col:[2,""],tr:[2,""],td:[3,""],_default:[0,"",""]};function Ie(e,t){var r;return r=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&N(e,t)?S.merge([e],r):r}function _e(e,t){for(var r=0,n=e.length;r",""]);var we=/<|?\w+;/;function Re(e,t,r,n,i){for(var o,a,s,l,u,c,p=t.createDocumentFragment(),d=[],f=0,h=e.length;f-1)i&&i.push(o);else if(u=ge(o),a=Ie(p.appendChild(o),"script"),u&&_e(a),r)for(c=0;o=a[c++];)Ne.test(o.type||"")&&r.push(o);return p}var Oe=/^([^.]*)(?:\.(.+)|)/;function De(){return!0}function Pe(){return!1}function ke(e,t,r,n,i,o){var a,s;if("object"==typeof t){for(s in"string"!=typeof r&&(n=n||r,r=void 0),t)ke(e,s,r,n,t[s],o);return e}if(null==n&&null==i?(i=r,n=r=void 0):null==i&&("string"==typeof r?(i=n,n=void 0):(i=n,n=r,r=void 0)),!1===i)i=Pe;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return S().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=S.guid++)),e.each((function(){S.event.add(this,t,i,n,r)}))}function Me(e,t,r){r?(ae.set(e,t,!1),S.event.add(e,t,{namespace:!1,handler:function(e){var r,n=ae.get(this,t);if(1&e.isTrigger&&this[t]){if(n)(S.event.special[t]||{}).delegateType&&e.stopPropagation();else if(n=s.call(arguments),ae.set(this,t,n),this[t](),r=ae.get(this,t),ae.set(this,t,!1),n!==r)return e.stopImmediatePropagation(),e.preventDefault(),r}else n&&(ae.set(this,t,S.event.trigger(n[0],n.slice(1),this)),e.stopPropagation(),e.isImmediatePropagationStopped=De)}})):void 0===ae.get(e,t)&&S.event.add(e,t,De)}S.event={global:{},add:function(e,t,r,n,i){var o,a,s,l,u,c,p,d,f,h,g,m=ae.get(e);if(ie(e))for(r.handler&&(r=(o=r).handler,i=o.selector),i&&S.find.matchesSelector(he,i),r.guid||(r.guid=S.guid++),(l=m.events)||(l=m.events=Object.create(null)),(a=m.handle)||(a=m.handle=function(t){return void 0!==S&&S.event.triggered!==t.type?S.event.dispatch.apply(e,arguments):void 0}),u=(t=(t||"").match(z)||[""]).length;u--;)f=g=(s=Oe.exec(t[u])||[])[1],h=(s[2]||"").split(".").sort(),f&&(p=S.event.special[f]||{},f=(i?p.delegateType:p.bindType)||f,p=S.event.special[f]||{},c=S.extend({type:f,origType:g,data:n,handler:r,guid:r.guid,selector:i,needsContext:i&&S.expr.match.needsContext.test(i),namespace:h.join(".")},o),(d=l[f])||((d=l[f]=[]).delegateCount=0,p.setup&&!1!==p.setup.call(e,n,h,a)||e.addEventListener&&e.addEventListener(f,a)),p.add&&(p.add.call(e,c),c.handler.guid||(c.handler.guid=r.guid)),i?d.splice(d.delegateCount++,0,c):d.push(c),S.event.global[f]=!0)},remove:function(e,t,r,n,i){var o,a,s,l,u,c,p,d,f,h,g,m=ae.hasData(e)&&ae.get(e);if(m&&(l=m.events)){for(u=(t=(t||"").match(z)||[""]).length;u--;)if(f=g=(s=Oe.exec(t[u])||[])[1],h=(s[2]||"").split(".").sort(),f){for(p=S.event.special[f]||{},d=l[f=(n?p.delegateType:p.bindType)||f]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=d.length;o--;)c=d[o],!i&&g!==c.origType||r&&r.guid!==c.guid||s&&!s.test(c.namespace)||n&&n!==c.selector&&("**"!==n||!c.selector)||(d.splice(o,1),c.selector&&d.delegateCount--,p.remove&&p.remove.call(e,c));a&&!d.length&&(p.teardown&&!1!==p.teardown.call(e,h,m.handle)||S.removeEvent(e,f,m.handle),delete l[f])}else for(f in l)S.event.remove(e,f+t[u],r,n,!0);S.isEmptyObject(l)&&ae.remove(e,"handle events")}},dispatch:function(e){var t,r,n,i,o,a,s=new Array(arguments.length),l=S.event.fix(e),u=(ae.get(this,"events")||Object.create(null))[l.type]||[],c=S.event.special[l.type]||{};for(s[0]=l,t=1;t=1))for(;u!==this;u=u.parentNode||this)if(1===u.nodeType&&("click"!==e.type||!0!==u.disabled)){for(o=[],a={},r=0;r-1:S.find(i,this,null,[u]).length),a[i]&&o.push(n);o.length&&s.push({elem:u,handlers:o})}return u=this,l\s*$/g;function Be(e,t){return N(e,"table")&&N(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function Ue(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function He(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function qe(e,t){var r,n,i,o,a,s;if(1===t.nodeType){if(ae.hasData(e)&&(s=ae.get(e).events))for(i in ae.remove(t,"handle events"),s)for(r=0,n=s[i].length;r1&&"string"==typeof h&&!m.checkClone&&je.test(h))return e.each((function(i){var o=e.eq(i);g&&(t[0]=h.call(this,i,o.html())),We(o,t,r,n)}));if(d&&(o=(i=Re(t,e[0].ownerDocument,!1,e,n)).firstChild,1===i.childNodes.length&&(i=o),o||n)){for(s=(a=S.map(Ie(i,"script"),Ue)).length;p0&&_e(a,!l&&Ie(e,"script")),s},cleanData:function(e){for(var t,r,n,i=S.event.special,o=0;void 0!==(r=e[o]);o++)if(ie(r)){if(t=r[ae.expando]){if(t.events)for(n in t.events)i[n]?S.event.remove(r,n):S.removeEvent(r,n,t.handle);r[ae.expando]=void 0}r[se.expando]&&(r[se.expando]=void 0)}}}),S.fn.extend({detach:function(e){return ze(this,e,!0)},remove:function(e){return ze(this,e)},text:function(e){return Z(this,(function(e){return void 0===e?S.text(this):this.empty().each((function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)}))}),null,e,arguments.length)},append:function(){return We(this,arguments,(function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Be(this,e).appendChild(e)}))},prepend:function(){return We(this,arguments,(function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Be(this,e);t.insertBefore(e,t.firstChild)}}))},before:function(){return We(this,arguments,(function(e){this.parentNode&&this.parentNode.insertBefore(e,this)}))},after:function(){return We(this,arguments,(function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)}))},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(S.cleanData(Ie(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map((function(){return S.clone(this,e,t)}))},html:function(e){return Z(this,(function(e){var t=this[0]||{},r=0,n=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!Fe.test(e)&&!Ce[(Le.exec(e)||["",""])[1].toLowerCase()]){e=S.htmlPrefilter(e);try{for(;r=0&&(l+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-l-s-.5))||0),l+u}function ut(e,t,r){var n=$e(e),i=(!m.boxSizingReliable()||r)&&"border-box"===S.css(e,"boxSizing",!1,n),o=i,a=Je(e,t,n),s="offset"+t[0].toUpperCase()+t.slice(1);if(Qe.test(a)){if(!r)return a;a="auto"}return(!m.boxSizingReliable()&&i||!m.reliableTrDimensions()&&N(e,"tr")||"auto"===a||!parseFloat(a)&&"inline"===S.css(e,"display",!1,n))&&e.getClientRects().length&&(i="border-box"===S.css(e,"boxSizing",!1,n),(o=s in e)&&(a=e[s])),(a=parseFloat(a)||0)+lt(e,t,r||(i?"border":"content"),o,n,a)+"px"}function ct(e,t,r,n,i){return new ct.prototype.init(e,t,r,n,i)}S.extend({cssHooks:{opacity:{get:function(e,t){if(t){var r=Je(e,"opacity");return""===r?"1":r}}}},cssNumber:{animationIterationCount:!0,aspectRatio:!0,borderImageSlice:!0,columnCount:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,scale:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeMiterlimit:!0,strokeOpacity:!0},cssProps:{},style:function(e,t,r,n){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,s=ne(t),l=Xe.test(t),u=e.style;if(l||(t=nt(s)),a=S.cssHooks[t]||S.cssHooks[s],void 0===r)return a&&"get"in a&&void 0!==(i=a.get(e,!1,n))?i:u[t];"string"===(o=typeof r)&&(i=de.exec(r))&&i[1]&&(r=ye(e,t,i),o="number"),null!=r&&r==r&&("number"!==o||l||(r+=i&&i[3]||(S.cssNumber[s]?"":"px")),m.clearCloneStyle||""!==r||0!==t.indexOf("background")||(u[t]="inherit"),a&&"set"in a&&void 0===(r=a.set(e,r,n))||(l?u.setProperty(t,r):u[t]=r))}},css:function(e,t,r,n){var i,o,a,s=ne(t);return Xe.test(t)||(t=nt(s)),(a=S.cssHooks[t]||S.cssHooks[s])&&"get"in a&&(i=a.get(e,!0,r)),void 0===i&&(i=Je(e,t,n)),"normal"===i&&t in at&&(i=at[t]),""===r||r?(o=parseFloat(i),!0===r||isFinite(o)?o||0:i):i}}),S.each(["height","width"],(function(e,t){S.cssHooks[t]={get:function(e,r,n){if(r)return!it.test(S.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?ut(e,t,n):Ye(e,ot,(function(){return ut(e,t,n)}))},set:function(e,r,n){var i,o=$e(e),a=!m.scrollboxSize()&&"absolute"===o.position,s=(a||n)&&"border-box"===S.css(e,"boxSizing",!1,o),l=n?lt(e,t,n,s,o):0;return s&&a&&(l-=Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-parseFloat(o[t])-lt(e,t,"border",!1,o)-.5)),l&&(i=de.exec(r))&&"px"!==(i[3]||"px")&&(e.style[t]=r,r=S.css(e,t)),st(0,r,l)}}})),S.cssHooks.marginLeft=Ze(m.reliableMarginLeft,(function(e,t){if(t)return(parseFloat(Je(e,"marginLeft"))||e.getBoundingClientRect().left-Ye(e,{marginLeft:0},(function(){return e.getBoundingClientRect().left})))+"px"})),S.each({margin:"",padding:"",border:"Width"},(function(e,t){S.cssHooks[e+t]={expand:function(r){for(var n=0,i={},o="string"==typeof r?r.split(" "):[r];n<4;n++)i[e+fe[n]+t]=o[n]||o[n-2]||o[0];return i}},"margin"!==e&&(S.cssHooks[e+t].set=st)})),S.fn.extend({css:function(e,t){return Z(this,(function(e,t,r){var n,i,o={},a=0;if(Array.isArray(t)){for(n=$e(e),i=t.length;a1)}}),S.Tween=ct,ct.prototype={constructor:ct,init:function(e,t,r,n,i,o){this.elem=e,this.prop=r,this.easing=i||S.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=n,this.unit=o||(S.cssNumber[r]?"":"px")},cur:function(){var e=ct.propHooks[this.prop];return e&&e.get?e.get(this):ct.propHooks._default.get(this)},run:function(e){var t,r=ct.propHooks[this.prop];return this.options.duration?this.pos=t=S.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),r&&r.set?r.set(this):ct.propHooks._default.set(this),this}},ct.prototype.init.prototype=ct.prototype,ct.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=S.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){S.fx.step[e.prop]?S.fx.step[e.prop](e):1!==e.elem.nodeType||!S.cssHooks[e.prop]&&null==e.elem.style[nt(e.prop)]?e.elem[e.prop]=e.now:S.style(e.elem,e.prop,e.now+e.unit)}}},ct.propHooks.scrollTop=ct.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},S.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},S.fx=ct.prototype.init,S.fx.step={};var pt,dt,ft=/^(?:toggle|show|hide)$/,ht=/queueHooks$/;function gt(){dt&&(!1===E.hidden&&n.requestAnimationFrame?n.requestAnimationFrame(gt):n.setTimeout(gt,S.fx.interval),S.fx.tick())}function mt(){return n.setTimeout((function(){pt=void 0})),pt=Date.now()}function vt(e,t){var r,n=0,i={height:e};for(t=t?1:0;n<4;n+=2-t)i["margin"+(r=fe[n])]=i["padding"+r]=e;return t&&(i.opacity=i.width=e),i}function yt(e,t,r){for(var n,i=(Et.tweeners[t]||[]).concat(Et.tweeners["*"]),o=0,a=i.length;o1)},removeAttr:function(e){return this.each((function(){S.removeAttr(this,e)}))}}),S.extend({attr:function(e,t,r){var n,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return void 0===e.getAttribute?S.prop(e,t,r):(1===o&&S.isXMLDoc(e)||(i=S.attrHooks[t.toLowerCase()]||(S.expr.match.bool.test(t)?bt:void 0)),void 0!==r?null===r?void S.removeAttr(e,t):i&&"set"in i&&void 0!==(n=i.set(e,r,t))?n:(e.setAttribute(t,r+""),r):i&&"get"in i&&null!==(n=i.get(e,t))?n:null==(n=S.find.attr(e,t))?void 0:n)},attrHooks:{type:{set:function(e,t){if(!m.radioValue&&"radio"===t&&N(e,"input")){var r=e.value;return e.setAttribute("type",t),r&&(e.value=r),t}}}},removeAttr:function(e,t){var r,n=0,i=t&&t.match(z);if(i&&1===e.nodeType)for(;r=i[n++];)e.removeAttribute(r)}}),bt={set:function(e,t,r){return!1===t?S.removeAttr(e,r):e.setAttribute(r,r),r}},S.each(S.expr.match.bool.source.match(/\w+/g),(function(e,t){var r=xt[t]||S.find.attr;xt[t]=function(e,t,n){var i,o,a=t.toLowerCase();return n||(o=xt[a],xt[a]=i,i=null!=r(e,t,n)?a:null,xt[a]=o),i}}));var Tt=/^(?:input|select|textarea|button)$/i,At=/^(?:a|area)$/i;function St(e){return(e.match(z)||[]).join(" ")}function Lt(e){return e.getAttribute&&e.getAttribute("class")||""}function Nt(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(z)||[]}S.fn.extend({prop:function(e,t){return Z(this,S.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each((function(){delete this[S.propFix[e]||e]}))}}),S.extend({prop:function(e,t,r){var n,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&S.isXMLDoc(e)||(t=S.propFix[t]||t,i=S.propHooks[t]),void 0!==r?i&&"set"in i&&void 0!==(n=i.set(e,r,t))?n:e[t]=r:i&&"get"in i&&null!==(n=i.get(e,t))?n:e[t]},propHooks:{tabIndex:{get:function(e){var t=S.find.attr(e,"tabindex");return t?parseInt(t,10):Tt.test(e.nodeName)||At.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),m.optSelected||(S.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),S.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],(function(){S.propFix[this.toLowerCase()]=this})),S.fn.extend({addClass:function(e){var t,r,n,i,o,a;return v(e)?this.each((function(t){S(this).addClass(e.call(this,t,Lt(this)))})):(t=Nt(e)).length?this.each((function(){if(n=Lt(this),r=1===this.nodeType&&" "+St(n)+" "){for(o=0;o-1;)r=r.replace(" "+i+" "," ");a=St(r),n!==a&&this.setAttribute("class",a)}})):this:this.attr("class","")},toggleClass:function(e,t){var r,n,i,o,a=typeof e,s="string"===a||Array.isArray(e);return v(e)?this.each((function(r){S(this).toggleClass(e.call(this,r,Lt(this),t),t)})):"boolean"==typeof t&&s?t?this.addClass(e):this.removeClass(e):(r=Nt(e),this.each((function(){if(s)for(o=S(this),i=0;i-1)return!0;return!1}});var Ct=/\r/g;S.fn.extend({val:function(e){var t,r,n,i=this[0];return arguments.length?(n=v(e),this.each((function(r){var i;1===this.nodeType&&(null==(i=n?e.call(this,r,S(this).val()):e)?i="":"number"==typeof i?i+="":Array.isArray(i)&&(i=S.map(i,(function(e){return null==e?"":e+""}))),(t=S.valHooks[this.type]||S.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))}))):i?(t=S.valHooks[i.type]||S.valHooks[i.nodeName.toLowerCase()])&&"get"in t&&void 0!==(r=t.get(i,"value"))?r:"string"==typeof(r=i.value)?r.replace(Ct,""):null==r?"":r:void 0}}),S.extend({valHooks:{option:{get:function(e){var t=S.find.attr(e,"value");return null!=t?t:St(S.text(e))}},select:{get:function(e){var t,r,n,i=e.options,o=e.selectedIndex,a="select-one"===e.type,s=a?null:[],l=a?o+1:i.length;for(n=o<0?l:a?o:0;n-1)&&(r=!0);return r||(e.selectedIndex=-1),o}}}}),S.each(["radio","checkbox"],(function(){S.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=S.inArray(S(e).val(),t)>-1}},m.checkOn||(S.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}));var It=n.location,_t={guid:Date.now()},wt=/\?/;S.parseXML=function(e){var t,r;if(!e||"string"!=typeof e)return null;try{t=(new n.DOMParser).parseFromString(e,"text/xml")}catch(e){}return r=t&&t.getElementsByTagName("parsererror")[0],t&&!r||S.error("Invalid XML: "+(r?S.map(r.childNodes,(function(e){return e.textContent})).join("\n"):e)),t};var Rt=/^(?:focusinfocus|focusoutblur)$/,Ot=function(e){e.stopPropagation()};S.extend(S.event,{trigger:function(e,t,r,i){var o,a,s,l,u,c,p,d,h=[r||E],g=f.call(e,"type")?e.type:e,m=f.call(e,"namespace")?e.namespace.split("."):[];if(a=d=s=r=r||E,3!==r.nodeType&&8!==r.nodeType&&!Rt.test(g+S.event.triggered)&&(g.indexOf(".")>-1&&(m=g.split("."),g=m.shift(),m.sort()),u=g.indexOf(":")<0&&"on"+g,(e=e[S.expando]?e:new S.Event(g,"object"==typeof e&&e)).isTrigger=i?2:3,e.namespace=m.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=r),t=null==t?[e]:S.makeArray(t,[e]),p=S.event.special[g]||{},i||!p.trigger||!1!==p.trigger.apply(r,t))){if(!i&&!p.noBubble&&!y(r)){for(l=p.delegateType||g,Rt.test(l+g)||(a=a.parentNode);a;a=a.parentNode)h.push(a),s=a;s===(r.ownerDocument||E)&&h.push(s.defaultView||s.parentWindow||n)}for(o=0;(a=h[o++])&&!e.isPropagationStopped();)d=a,e.type=o>1?l:p.bindType||g,(c=(ae.get(a,"events")||Object.create(null))[e.type]&&ae.get(a,"handle"))&&c.apply(a,t),(c=u&&a[u])&&c.apply&&ie(a)&&(e.result=c.apply(a,t),!1===e.result&&e.preventDefault());return e.type=g,i||e.isDefaultPrevented()||p._default&&!1!==p._default.apply(h.pop(),t)||!ie(r)||u&&v(r[g])&&!y(r)&&((s=r[u])&&(r[u]=null),S.event.triggered=g,e.isPropagationStopped()&&d.addEventListener(g,Ot),r[g](),e.isPropagationStopped()&&d.removeEventListener(g,Ot),S.event.triggered=void 0,s&&(r[u]=s)),e.result}},simulate:function(e,t,r){var n=S.extend(new S.Event,r,{type:e,isSimulated:!0});S.event.trigger(n,null,t)}}),S.fn.extend({trigger:function(e,t){return this.each((function(){S.event.trigger(e,t,this)}))},triggerHandler:function(e,t){var r=this[0];if(r)return S.event.trigger(e,t,r,!0)}});var Dt=/\[\]$/,Pt=/\r?\n/g,kt=/^(?:submit|button|image|reset|file)$/i,Mt=/^(?:input|select|textarea|keygen)/i;function Ft(e,t,r,n){var i;if(Array.isArray(t))S.each(t,(function(t,i){r||Dt.test(e)?n(e,i):Ft(e+"["+("object"==typeof i&&null!=i?t:"")+"]",i,r,n)}));else if(r||"object"!==T(t))n(e,t);else for(i in t)Ft(e+"["+i+"]",t[i],r,n)}S.param=function(e,t){var r,n=[],i=function(e,t){var r=v(t)?t():t;n[n.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==r?"":r)};if(null==e)return"";if(Array.isArray(e)||e.jquery&&!S.isPlainObject(e))S.each(e,(function(){i(this.name,this.value)}));else for(r in e)Ft(r,e[r],t,i);return n.join("&")},S.fn.extend({serialize:function(){return S.param(this.serializeArray())},serializeArray:function(){return this.map((function(){var e=S.prop(this,"elements");return e?S.makeArray(e):this})).filter((function(){var e=this.type;return this.name&&!S(this).is(":disabled")&&Mt.test(this.nodeName)&&!kt.test(e)&&(this.checked||!Se.test(e))})).map((function(e,t){var r=S(this).val();return null==r?null:Array.isArray(r)?S.map(r,(function(e){return{name:t.name,value:e.replace(Pt,"\r\n")}})):{name:t.name,value:r.replace(Pt,"\r\n")}})).get()}});var jt=/%20/g,Gt=/#.*$/,Bt=/([?&])_=[^&]*/,Ut=/^(.*?):[ \t]*([^\r\n]*)$/gm,Ht=/^(?:GET|HEAD)$/,qt=/^\/\//,Vt={},Wt={},zt="*/".concat("*"),Qt=E.createElement("a");function Xt(e){return function(t,r){"string"!=typeof t&&(r=t,t="*");var n,i=0,o=t.toLowerCase().match(z)||[];if(v(r))for(;n=o[i++];)"+"===n[0]?(n=n.slice(1)||"*",(e[n]=e[n]||[]).unshift(r)):(e[n]=e[n]||[]).push(r)}}function $t(e,t,r,n){var i={},o=e===Wt;function a(s){var l;return i[s]=!0,S.each(e[s]||[],(function(e,s){var u=s(t,r,n);return"string"!=typeof u||o||i[u]?o?!(l=u):void 0:(t.dataTypes.unshift(u),a(u),!1)})),l}return a(t.dataTypes[0])||!i["*"]&&a("*")}function Yt(e,t){var r,n,i=S.ajaxSettings.flatOptions||{};for(r in t)void 0!==t[r]&&((i[r]?e:n||(n={}))[r]=t[r]);return n&&S.extend(!0,e,n),e}Qt.href=It.href,S.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:It.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(It.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":zt,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":S.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Yt(Yt(e,S.ajaxSettings),t):Yt(S.ajaxSettings,e)},ajaxPrefilter:Xt(Vt),ajaxTransport:Xt(Wt),ajax:function(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};var r,i,o,a,s,l,u,c,p,d,f=S.ajaxSetup({},t),h=f.context||f,g=f.context&&(h.nodeType||h.jquery)?S(h):S.event,m=S.Deferred(),v=S.Callbacks("once memory"),y=f.statusCode||{},b={},x={},T="canceled",A={readyState:0,getResponseHeader:function(e){var t;if(u){if(!a)for(a={};t=Ut.exec(o);)a[t[1].toLowerCase()+" "]=(a[t[1].toLowerCase()+" "]||[]).concat(t[2]);t=a[e.toLowerCase()+" "]}return null==t?null:t.join(", ")},getAllResponseHeaders:function(){return u?o:null},setRequestHeader:function(e,t){return null==u&&(e=x[e.toLowerCase()]=x[e.toLowerCase()]||e,b[e]=t),this},overrideMimeType:function(e){return null==u&&(f.mimeType=e),this},statusCode:function(e){var t;if(e)if(u)A.always(e[A.status]);else for(t in e)y[t]=[y[t],e[t]];return this},abort:function(e){var t=e||T;return r&&r.abort(t),L(0,t),this}};if(m.promise(A),f.url=((e||f.url||It.href)+"").replace(qt,It.protocol+"//"),f.type=t.method||t.type||f.method||f.type,f.dataTypes=(f.dataType||"*").toLowerCase().match(z)||[""],null==f.crossDomain){l=E.createElement("a");try{l.href=f.url,l.href=l.href,f.crossDomain=Qt.protocol+"//"+Qt.host!=l.protocol+"//"+l.host}catch(e){f.crossDomain=!0}}if(f.data&&f.processData&&"string"!=typeof f.data&&(f.data=S.param(f.data,f.traditional)),$t(Vt,f,t,A),u)return A;for(p in(c=S.event&&f.global)&&0==S.active++&&S.event.trigger("ajaxStart"),f.type=f.type.toUpperCase(),f.hasContent=!Ht.test(f.type),i=f.url.replace(Gt,""),f.hasContent?f.data&&f.processData&&0===(f.contentType||"").indexOf("application/x-www-form-urlencoded")&&(f.data=f.data.replace(jt,"+")):(d=f.url.slice(i.length),f.data&&(f.processData||"string"==typeof f.data)&&(i+=(wt.test(i)?"&":"?")+f.data,delete f.data),!1===f.cache&&(i=i.replace(Bt,"$1"),d=(wt.test(i)?"&":"?")+"_="+_t.guid+++d),f.url=i+d),f.ifModified&&(S.lastModified[i]&&A.setRequestHeader("If-Modified-Since",S.lastModified[i]),S.etag[i]&&A.setRequestHeader("If-None-Match",S.etag[i])),(f.data&&f.hasContent&&!1!==f.contentType||t.contentType)&&A.setRequestHeader("Content-Type",f.contentType),A.setRequestHeader("Accept",f.dataTypes[0]&&f.accepts[f.dataTypes[0]]?f.accepts[f.dataTypes[0]]+("*"!==f.dataTypes[0]?", "+zt+"; q=0.01":""):f.accepts["*"]),f.headers)A.setRequestHeader(p,f.headers[p]);if(f.beforeSend&&(!1===f.beforeSend.call(h,A,f)||u))return A.abort();if(T="abort",v.add(f.complete),A.done(f.success),A.fail(f.error),r=$t(Wt,f,t,A)){if(A.readyState=1,c&&g.trigger("ajaxSend",[A,f]),u)return A;f.async&&f.timeout>0&&(s=n.setTimeout((function(){A.abort("timeout")}),f.timeout));try{u=!1,r.send(b,L)}catch(e){if(u)throw e;L(-1,e)}}else L(-1,"No Transport");function L(e,t,a,l){var p,d,E,b,x,T=t;u||(u=!0,s&&n.clearTimeout(s),r=void 0,o=l||"",A.readyState=e>0?4:0,p=e>=200&&e<300||304===e,a&&(b=function(e,t,r){for(var n,i,o,a,s=e.contents,l=e.dataTypes;"*"===l[0];)l.shift(),void 0===n&&(n=e.mimeType||t.getResponseHeader("Content-Type"));if(n)for(i in s)if(s[i]&&s[i].test(n)){l.unshift(i);break}if(l[0]in r)o=l[0];else{for(i in r){if(!l[0]||e.converters[i+" "+l[0]]){o=i;break}a||(a=i)}o=o||a}if(o)return o!==l[0]&&l.unshift(o),r[o]}(f,A,a)),!p&&S.inArray("script",f.dataTypes)>-1&&S.inArray("json",f.dataTypes)<0&&(f.converters["text script"]=function(){}),b=function(e,t,r,n){var i,o,a,s,l,u={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)u[a.toLowerCase()]=e.converters[a];for(o=c.shift();o;)if(e.responseFields[o]&&(r[e.responseFields[o]]=t),!l&&n&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),l=o,o=c.shift())if("*"===o)o=l;else if("*"!==l&&l!==o){if(!(a=u[l+" "+o]||u["* "+o]))for(i in u)if((s=i.split(" "))[1]===o&&(a=u[l+" "+s[0]]||u["* "+s[0]])){!0===a?a=u[i]:!0!==u[i]&&(o=s[0],c.unshift(s[1]));break}if(!0!==a)if(a&&e.throws)t=a(t);else try{t=a(t)}catch(e){return{state:"parsererror",error:a?e:"No conversion from "+l+" to "+o}}}return{state:"success",data:t}}(f,b,A,p),p?(f.ifModified&&((x=A.getResponseHeader("Last-Modified"))&&(S.lastModified[i]=x),(x=A.getResponseHeader("etag"))&&(S.etag[i]=x)),204===e||"HEAD"===f.type?T="nocontent":304===e?T="notmodified":(T=b.state,d=b.data,p=!(E=b.error))):(E=T,!e&&T||(T="error",e<0&&(e=0))),A.status=e,A.statusText=(t||T)+"",p?m.resolveWith(h,[d,T,A]):m.rejectWith(h,[A,T,E]),A.statusCode(y),y=void 0,c&&g.trigger(p?"ajaxSuccess":"ajaxError",[A,f,p?d:E]),v.fireWith(h,[A,T]),c&&(g.trigger("ajaxComplete",[A,f]),--S.active||S.event.trigger("ajaxStop")))}return A},getJSON:function(e,t,r){return S.get(e,t,r,"json")},getScript:function(e,t){return S.get(e,void 0,t,"script")}}),S.each(["get","post"],(function(e,t){S[t]=function(e,r,n,i){return v(r)&&(i=i||n,n=r,r=void 0),S.ajax(S.extend({url:e,type:t,dataType:i,data:r,success:n},S.isPlainObject(e)&&e))}})),S.ajaxPrefilter((function(e){var t;for(t in e.headers)"content-type"===t.toLowerCase()&&(e.contentType=e.headers[t]||"")})),S._evalUrl=function(e,t,r){return S.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(e){S.globalEval(e,t,r)}})},S.fn.extend({wrapAll:function(e){var t;return this[0]&&(v(e)&&(e=e.call(this[0])),t=S(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map((function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e})).append(this)),this},wrapInner:function(e){return v(e)?this.each((function(t){S(this).wrapInner(e.call(this,t))})):this.each((function(){var t=S(this),r=t.contents();r.length?r.wrapAll(e):t.append(e)}))},wrap:function(e){var t=v(e);return this.each((function(r){S(this).wrapAll(t?e.call(this,r):e)}))},unwrap:function(e){return this.parent(e).not("body").each((function(){S(this).replaceWith(this.childNodes)})),this}}),S.expr.pseudos.hidden=function(e){return!S.expr.pseudos.visible(e)},S.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},S.ajaxSettings.xhr=function(){try{return new n.XMLHttpRequest}catch(e){}};var Kt={0:200,1223:204},Jt=S.ajaxSettings.xhr();m.cors=!!Jt&&"withCredentials"in Jt,m.ajax=Jt=!!Jt,S.ajaxTransport((function(e){var t,r;if(m.cors||Jt&&!e.crossDomain)return{send:function(i,o){var a,s=e.xhr();if(s.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(a in e.xhrFields)s[a]=e.xhrFields[a];for(a in e.mimeType&&s.overrideMimeType&&s.overrideMimeType(e.mimeType),e.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest"),i)s.setRequestHeader(a,i[a]);t=function(e){return function(){t&&(t=r=s.onload=s.onerror=s.onabort=s.ontimeout=s.onreadystatechange=null,"abort"===e?s.abort():"error"===e?"number"!=typeof s.status?o(0,"error"):o(s.status,s.statusText):o(Kt[s.status]||s.status,s.statusText,"text"!==(s.responseType||"text")||"string"!=typeof s.responseText?{binary:s.response}:{text:s.responseText},s.getAllResponseHeaders()))}},s.onload=t(),r=s.onerror=s.ontimeout=t("error"),void 0!==s.onabort?s.onabort=r:s.onreadystatechange=function(){4===s.readyState&&n.setTimeout((function(){t&&r()}))},t=t("abort");try{s.send(e.hasContent&&e.data||null)}catch(e){if(t)throw e}},abort:function(){t&&t()}}})),S.ajaxPrefilter((function(e){e.crossDomain&&(e.contents.script=!1)})),S.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return S.globalEval(e),e}}}),S.ajaxPrefilter("script",(function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")})),S.ajaxTransport("script",(function(e){var t,r;if(e.crossDomain||e.scriptAttrs)return{send:function(n,i){t=S("