UNPKG

mubot-server

Version:
2 lines 528 kB
var SolidClient=function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return e[r].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}(function(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))switch(typeof e[t]){case"function":break;case"object":e[t]=function(t){var n=t.slice(1),r=e[t[0]];return function(e,t,i){r.apply(this,[e,t,i].concat(n))}}(e[t]);break;default:e[t]=e[e[t]]}return e}([function(e,t,n){e.exports=n(1)},function(e,t,n){"use strict";var r=n(2),i=n(89),o=new i,a=n(140)(r,{auth:o}),s=n(153),u=new s(a),l=n(155),c=n(161)(r),f=n(167),h={acl:f,AppRegistration:n(158),appRegistry:n(157),auth:o,tls:u,config:n(171),currentUser:u.currentUser.bind(u),identity:n(155),login:u.login.bind(u),meta:n(172),rdflib:r,signup:u.signup.bind(u),status:n(174),typeRegistry:n(165),vocab:c,web:a};h.clearPermissions=function(e){return f.clearPermissions(e,a)},h.discoverWebID=function(e){return l.discoverWebID(e,a,c)},h.getPermissions=function(e){return f.getPermissions(e,a,r)},h.getProfile=function(e,t){return l.getProfile(e,t,a,r)},e.exports=h},function(e,t,n){"use strict";var r;r="undefined"!=typeof $rdf?$rdf:"undefined"!=typeof tabulator?tabulator.rdf:n(3),e.exports=r},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=n(4),o=r(i),a={BlankNode:n(12),Collection:n(11),convert:n(22),DataFactory:n(75),Empty:n(83),Fetcher:n(77),Formula:n(20),IndexedFormula:o.default,jsonParser:n(84),Literal:n(13),log:n(15),N3Parser:n(78),NamedNode:n(8),Namespace:n(73),Node:n(10),parse:n(79),Query:n(74).Query,queryToSPARQL:n(85),RDFaProcessor:n(80),RDFParser:n(81),serialize:n(21),Serializer:n(70),SPARQLToQuery:n(86),sparqlUpdateParser:n(82),Statement:n(71),term:n(10).fromValue,UpdateManager:n(87),UpdatesSocket:n(88).UpdatesSocket,UpdatesVia:n(88).UpdatesVia,uri:n(7),Util:n(5),Variable:n(72)};a.NextId=a.BlankNode.nextId,a.fromNT=a.Formula.prototype.fromNT,a.fetcher=a.DataFactory.fetcher,a.graph=a.DataFactory.graph,a.lit=a.DataFactory.lit,a.st=a.DataFactory.st,a.sym=a.DataFactory.namedNode,a.variable=a.DataFactory.variable,a.blankNode=a.DataFactory.blankNode,a.defaultGraph=a.DataFactory.defaultGraph,a.literal=a.DataFactory.literal,a.namedNode=a.DataFactory.namedNode,a.quad=a.DataFactory.quad,a.triple=a.DataFactory.triple,e.exports=a},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function a(e,t,n,r){var i=e.any(t,n,void 0);return!!i&&(e.equate(i,r),!0)}function s(e,t,n,r){var i=e.any(void 0,n,r);return!!i&&(e.equate(i,t),!0)}function u(e,t,n,r,i){e.typeCallback&&e.typeCallback(e,r,i);var o=e.classActions[r.hashString()],a=!1;if(o)for(var s=0;s<o.length;s++)a=a||o[s](e,t,n,r,i);return a}Object.defineProperty(t,"__esModule",{value:!0});var l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),c=n(5).ArrayIndexOf,f=n(20),h=n(5).RDFArrayRemove,d=n(71),p=n(10),v=n(72),g="http://www.w3.org/2002/07/owl#",y=function(e){function t(e){r(this,t);var n=i(this,Object.getPrototypeOf(t).call(this));return n.propertyActions=[],n.classActions=[],n.redirections=[],n.aliases=[],n.HTTPRedirects=[],n.subjectIndex=[],n.predicateIndex=[],n.objectIndex=[],n.whyIndex=[],n.index=[n.subjectIndex,n.predicateIndex,n.objectIndex,n.whyIndex],n.namespaces={},n.features=e||["sameAs","InverseFunctionalProperty","FunctionalProperty"],n.initPropertyActions(n.features),n}return o(t,e),l(t,[{key:"substitute",value:function(e){var n=this.statements.map(function(t){return t.substitute(e)}),r=new t;return r.add(n),r}},{key:"applyPatch",value:function(e,t,r){var i,o=n(74).Query,a=this,s=null,u=function(n){if(e.delete){i=e.delete,s&&(i=i.substitute(s)),i=i.statements;var o=[],u=i.map(function(e){var n=a.statementsMatching(e.subject,e.predicate,e.object,t);return 0===n.length?(o.push(e),null):n[0]});if(o.length)return r("Could not find to delete: "+o.join("\n or "));u.map(function(e){a.remove(e)})}e.insert&&(i=e.insert,s&&(i=i.substitute(s)),i=i.statements,i.map(function(e){e.why=t,a.add(e.subject,e.predicate,e.object,e.why)})),n()};if(e.where){var l=new o("patch");l.pat=e.where,l.pat.statements.map(function(e){e.why=t});var c=[];a.query(l,function(e){c.push(e)},a.fetcher,function(){return 0===c.length?r("No match found to be patched:"+e.where):c.length>1?r("Patch ambiguous. No patch done."):(s=c[0],void u(r))})}else u(r)}},{key:"declareExistential",value:function(e){return this._existentialVariables||(this._existentialVariables=[]),this._existentialVariables.push(e),e}},{key:"initPropertyActions",value:function(e){this.propertyActions["<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>"]=[u],c(e,"sameAs")>=0&&(this.propertyActions["<http://www.w3.org/2002/07/owl#sameAs>"]=[function(e,t,n,r,i){return e.equate(t,r),!0}]),c(e,"InverseFunctionalProperty")>=0&&(this.classActions["<"+g+"InverseFunctionalProperty>"]=[function(e,t,n,r,i){return e.newPropertyAction(t,s)}]),c(e,"FunctionalProperty")>=0&&(this.classActions["<"+g+"FunctionalProperty>"]=[function(e,t,n,r,i){return e.newPropertyAction(t,a)}])}},{key:"add",value:function(e,n,r,i){var o;if(1===arguments.length){if(e instanceof Array)for(o=0;o<e.length;o++)this.add(e[o]);else e instanceof d?this.add(e.subject,e.predicate,e.object,e.why):e instanceof t&&this.add(e.statements);return this}var a,s;i||(i=this.fetcher?this.fetcher.appNode:this.sym("chrome:theSession")),e=p.fromValue(e),n=p.fromValue(n),r=p.fromValue(r),i=p.fromValue(i),this.predicateCallback&&this.predicateCallback(this,n,i);var u=this.canon(n).hashString();a=this.propertyActions[u];var l=!1;if(a)for(o=0;o<a.length;o++)l=l||a[o](this,e,n,r,i);if(this.holds(e,n,r,i))return null;var c=[this.canon(e).hashString(),u,this.canon(r).hashString(),this.canon(i).hashString()];for(s=new d(e,n,r,i),o=0;o<4;o++){var f=this.index[o],h=c[o];f[h]||(f[h]=[]),f[h].push(s)}return this.statements.push(s),s}},{key:"addAll",value:function(e){var t=this;e.forEach(function(e){t.add(e.subject,e.predicate,e.object,e.graph)})}},{key:"any",value:function(e,t,n,r){var i=this.anyStatementMatching(e,t,n,r);if(null!=i)return null==e?i.subject:null==t?i.predicate:null==n?i.object:void 0}},{key:"anyValue",value:function(e,t,n,r){var i=this.any(e,t,n,r);return i?i.value:void 0}},{key:"anyStatementMatching",value:function(e,t,n,r){var i=this.statementsMatching(e,t,n,r,!0);if(i&&0!==i.length)return i[0]}},{key:"canon",value:function(e){if(!e)return e;var t=this.redirections[e.hashString()];return t?t:e}},{key:"check",value:function(){this.checkStatementList(this.statements);for(var e=0;e<4;e++){var t=this.index[e];for(var n in t)t.hasOwnProperty(n)&&this.checkStatementList(t[n],e)}}},{key:"checkStatementList",value:function(e,t){for(var n,r=["subject","predicate","object","why"],i=" found in "+r[t]+" index.",o=0;o<e.length;o++){n=e[o];for(var a=[n.subject,n.predicate,n.object,n.why],s=function(e,t){for(var n=0;n<e.length;n++)if(e[n].subject.sameTerm(t.subject)&&e[n].predicate.sameTerm(t.predicate)&&e[n].object.sameTerm(t.object)&&e[n].why.sameTerm(t.why))return!0},u=0;u<4;u++){var l=this.canon(a[u]),c=l.hashString();this.index[u][c]&&!s(this.index[u][c],n)}if(!s(this.statements,n))throw new Error("Statement list does not statement "+n+"@"+n.why+i)}}},{key:"close",value:function(){return this}},{key:"copyTo",value:function(e,t,n){n||(n=[]);var r=this.statementsMatching(e);c(n,"two-direction")!==-1&&r.concat(this.statementsMatching(void 0,void 0,e));for(var i=0;i<r.length;i++){var o=r[i];switch(o.object.termType){case"NamedNode":this.add(t,o.predicate,o.object);break;case"Literal":case"BlankNode":case"collection":this.add(t,o.predicate,o.object.copy(this))}c(n,"delete")!==-1&&this.remove(o)}}},{key:"equate",value:function(e,t){e=this.canon(e),t=this.canon(t);var n=e.compareTerm(t);return!n||(n<0?this.replaceWith(t,e):this.replaceWith(e,t))}},{key:"formula",value:function(e){return new t(e)}},{key:"match",value:function(e,t,n,r){return this.statementsMatching(p.fromValue(e),p.fromValue(t),p.fromValue(n),p.fromValue(r))}},{key:"mentionsURI",value:function(e){var t="<"+e+">";return!!this.subjectIndex[t]||!!this.objectIndex[t]||!!this.predicateIndex[t]}},{key:"newExistential",value:function(e){if(!e)return this.bnode();var t=this.sym(e);return this.declareExistential(t)}},{key:"newPropertyAction",value:function(e,t){var n=e.hashString();this.propertyActions[n]||(this.propertyActions[n]=[]),this.propertyActions[n].push(t);for(var r=this.statementsMatching(void 0,e,void 0),i=!1,o=0;o<r.length;o++)i=i||t(this,r[o].subject,e,r[o].object);return i}},{key:"newUniversal",value:function(e){var t=this.sym(e);return this._universalVariables||(this._universalVariables=[]),this._universalVariables.push(t),t}},{key:"variable",value:function(e){return new v(e)}},{key:"nextSymbol",value:function(e){for(var t=0;;t++){var n=e.uri+"#n"+t;if(!this.mentionsURI(n))return this.sym(n)}}},{key:"query",value:function(e,t,r,i){var o=n(74).indexedFormulaQuery;return o.call(this,e,t,r,i)}},{key:"remove",value:function(e){if(e instanceof Array){for(var n=0;n<e.length;n++)this.remove(e[n]);return this}if(e instanceof t)return this.remove(e.statements);var r=this.statementsMatching(e.subject,e.predicate,e.object,e.why);if(!r.length)throw new Error("Statement to be removed is not on store: "+e);return this.removeStatement(r[0]),this}},{key:"removeDocument",value:function(e){for(var t=this.statementsMatching(void 0,void 0,void 0,e).slice(),n=0;n<t.length;n++)this.removeStatement(t[n]);return this}},{key:"removeMany",value:function(e,t,n,r,i){for(var o=this.statementsMatching(e,t,n,r,!1),a=[],s=0;s<o.length;s++)a.push(o[s]);for(i&&(a=a.slice(0,i)),s=0;s<a.length;s++)this.remove(a[s])}},{key:"removeMatches",value:function(e,t,n,r){return this.removeStatements(this.statementsMatching(e,t,n,r)),this}},{key:"removeStatement",value:function(e){for(var t=[e.subject,e.predicate,e.object,e.why],n=0;n<4;n++){var r=this.canon(t[n]),i=r.hashString();this.index[n][i]&&h(this.index[n][i],e)}return h(this.statements,e),this}},{key:"removeStatements",value:function(e){for(var t=0;t<e.length;t++)this.remove(e[t]);return this}},{key:"replaceWith",value:function(e,t){for(var n=e.hashString(),r=t.hashString(),i=function(e){var t=e[n];if(t){var i=e[r];i?e[r]=t.concat(i):e[r]=t,delete e[n]}},o=0;o<4;o++)i(this.index[o]);if(this.redirections[n]=t,e.uri){if(this.aliases[r]||(this.aliases[r]=[]),this.aliases[r].push(e),this.aliases[n])for(o=0;o<this.aliases[n].length;o++)this.redirections[this.aliases[n][o].hashString()]=t,this.aliases[r].push(this.aliases[n][o]);this.add(t,this.sym("http://www.w3.org/2007/ont/link#uri"),e.uri),this.fetcher&&this.fetcher.nowKnownAs(e,t)}return i(this.classActions),i(this.propertyActions),!0}},{key:"allAliases",value:function(e){var t=this.aliases[this.canon(e).hashString()]||[];return t.push(this.canon(e)),t}},{key:"sameThings",value:function(e,t){if(e.sameTerm(t))return!0;var n=this.canon(e);if(!n)return!1;var r=this.canon(t);return!!r&&n.uri===r.uri}},{key:"setPrefixForURI",value:function(e,t){"tab"===e&&this.namespaces.tab||"ns"!==e.slice(0,2)&&"default"!==e.slice(0,7)&&(this.namespaces[e]=t)}},{key:"statementsMatching",value:function(e,t,n,r,i){var o,a,s=[e,t,n,r],u=[],l=[],c=[],f=[];for(o=0;o<4;o++)u[o]=this.canon(p.fromValue(s[o])),u[o]?(f.push(o),l[o]=u[o].hashString()):c.push(o);if(0===f.length)return this.statements;if(1===f.length)return o=f[0],a=this.index[o][l[o]],a&&i&&a.length>1&&(a=a.slice(0,1)),a=a||[];var h,d,v=1e10;for(d=0;d<f.length;d++){if(o=f[d],a=this.index[o][l[o]],!a)return[];a.length<v&&(v=a.length,h=d)}for(var g=f[h],y=this.index[g][l[g]],m=f.slice(0,h).concat(f.slice(h+1)),w=[],b=["subject","predicate","object","why"],x=0;x<y.length;x++){var k=y[x];for(d=0;d<m.length;d++)if(o=m[d],!this.canon(k[b[o]]).sameTerm(u[o])){k=null;break}if(null!=k&&(w.push(k),i))break}return w}},{key:"uris",value:function(e){var t=this.canon(e),n=this.aliases[t.hashString()];if(!t.uri)return[];var r=[t.uri];if(n)for(var i=0;i<n.length;i++)r.push(n[i].uri);return r}},{key:"length",get:function(){return this.statements.length}}]),t}(f);t.default=y,y.handleRDFType=u},function(e,t,n){(function(e){"use strict";function t(e,t,n){var r=null;if("undefined"!=typeof e.fetcher&&(r=e.fetcher,"NamedNode"===t.termType)){var i,o=w(t.uri);if(t.uri.indexOf("#")<0){if(v(t.uri,"http://dbpedia.org/resource/Category:"))return;v(t.uri,"http://purl.org/dc/elements/1.1/")||v(t.uri,"http://purl.org/dc/terms/")?i="http://dublincore.org/2005/06/13/dcq":v(t.uri,"http://xmlns.com/wot/0.1/")?i="http://xmlns.com/wot/0.1/index.rdf":v(t.uri,"http://web.resource.org/cc/")&&(i="http://web.resource.org/cc/schema.rdf")}i&&(o=i),r&&"unrequested"!==r.getState(o)||(i&&b.warn("Assuming server still broken, faking redirect of <"+t.uri+"> to <"+o+">"),r.requestURI(o,n))}}function r(e,t,n){n||(n=0);var r=e.length;for(n<0&&(n=r+n);n<r;n++)if(e[n]===t)return n;return-1}function i(e,t){e.callbacks={};for(var n=t.length-1;n>=0;n--)e.callbacks[t[n]]=[];e.addHook=function(t){e.callbacks[t]||(e.callbacks[t]=[])},e.addCallback=function(t,n){e.callbacks[t].push(n)},e.removeCallback=function(t,n){for(var r=0;r<e.callbacks[t].length;r++)if(e.callbacks[t][r].name===n)return e.callbacks[t].splice(r,1),!0;return!1},e.insertCallback=function(t,n){e.callbacks[t].unshift(n)},e.fireCallbacks=function(t,n){var r,i=[],o=[],a=e.callbacks[t].length;for(r=a-1;r>=0;r--)e.callbacks[t][r].apply(e,n)&&i.push(e.callbacks[t][r]);for(r=i.length-1;r>=0;r--)o.push(i[r]);for(r=a;r<e.callbacks[t].length;r++)o.push(e.callbacks[t][r]);e.callbacks[t]=o}}function o(){return tabulator&&tabulator.isExtension?Components.classes["@mozilla.org/xmlextras/domparser;1"].getService(Components.interfaces.nsIDOMParser):window.DOMParser?new DOMParser:!!window.ActiveXObject&&new ActiveXObject("Microsoft.XMLDOM")}function a(e,t){t=t||{};var n=[];"selfClosing"in t&&t.selfClosing.split(" ").forEach(function(e){n[e]=!0});var r=[];return"skipAttributes"in t&&t.skipAttributes.split(" ").forEach(function(e){r[e]=!0}),s(e,t,n,r)}function s(e,t,n,r){var i,o="",a=[!1];if("undefined"==typeof e.nodeType)return o;if(1===e.nodeType){if(e.hasAttribute("class")&&"classWithChildText"in t&&e.matches(t.classWithChildText.class))o+=e.querySelector(t.classWithChildText.element).textContent;else if(!("skipNodeWithClass"in t&&e.matches("."+t.skipNodeWithClass))){var u=e.nodeName.toLowerCase();o+="<"+u;var l=[];for(i=e.attributes.length-1;i>=0;i--){var c=e.attributes[i];if(!(r.length>0&&r[c.name]||/^\d+$/.test(c.name))){if("class"===c.name&&"replaceClassItemWith"in t&&c.value.split(" ").indexOf(t.replaceClassItemWith.source)>-1){var f=new RegExp(t.replaceClassItemWith.source,"g");c.value=c.value.replace(f,t.replaceClassItemWith.target).trim()}"class"===c.name&&"skipClassWithValue"in t&&t.skipClassWithValue===c.value||l.push(c.name+"='"+c.value.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/'/g,"&quot;")+"'")}}if(l.length>0&&("sortAttributes"in t&&t.sortAttributes&&l.sort(function(e,t){return e.toLowerCase().localeCompare(t.toLowerCase())}),o+=" "+l.join(" ")),n[u])o+=" />";else{for(o+=">",o+="html"===u?"\n ":"",a.push("style"===u||"script"===u),i=0;i<e.childNodes.length;i++)o+=s(e.childNodes[i]);a.pop(),o+="body"===u?"</"+u+">\n":"</"+u+">"}}}else if(8===e.nodeType)o+="<!--"+e.nodeValue+"-->";else if(3===e.nodeType||4===e.nodeType){var h=e.nodeValue.replace(/\n+$/,"");o+=a[a.length-1]?h:h.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}else console.log("Warning; Cannot handle serialising nodes of type: "+e.nodeType),console.log(e);return o}function u(){var e=new Date,t=e.getYear()+1900,n=e.getMonth()+1,r=e.getDate(),i=e.getUTCHours(),o=e.getUTCMinutes(),a=e.getSeconds();return n<10&&(n="0"+n),r<10&&(r="0"+r),i<10&&(i="0"+i),o<10&&(o="0"+o),a<10&&(a="0"+a),t+"-"+n+"-"+r+"T"+i+":"+o+":"+a+"Z"}function l(e){for(var t,n=e.getAllResponseHeaders().split("\n"),r={},i=0;i<n.length;i++)if(n[i].length>0){var o=n[i].split(": ");"undefined"==typeof o[1]?r[t]+="\n"+o[0]:(t=o[0].toLowerCase(),r[t]=o[1])}return r}function c(e,t,n){var r=function(e){return"BlankNode"===e.termType?null:e},i=function(t){var i=n.statementsMatching(e).map(function(e){return""+r(e.subject)+" "+r(e.predicate)+" "+r(e.object)}).concat(n.statementsMatching(void 0,void 0,e).map(function(e){return""+r(e.subject)+" "+r(e.predicate)+" "+r(e.object)}));return i.sort(),i.join("\n")};return"BlankNode"===e.termType||"BlankNode"===t.termType?0===e.compareTerm(t)?0:i(e)>i(t)?1:i(e)<i(t)?-1:e.compareTerm(t):e.compareTerm(t)}function f(e,t,n){var r=c(e.subject,t.subject,n);return r?r:(r=c(e.predicate,t.predicate,n),r?r:c(e.object,t.object,n))}function h(e){var t=document.createElement("div");t.textContent=e,document.body.appendChild(t)}function d(t,r){var i;if(r=r||{},"undefined"!=typeof tabulator&&tabulator.isExtension)i=Components.classes["@mozilla.org/xmlextras/domparser;1"].getService(Components.interfaces.nsIDOMParser);else{if("undefined"!=typeof e&&e&&e.exports){var o=n(16).DOMParser,a=(new o).parseFromString(t,r.contentType||"application/xhtml+xml");return a}i="undefined"!=typeof window&&window.DOMParser?new window.DOMParser:new o}return i.parseFromString(t,"application/xml")}function p(e,t){for(var n=0;n<e.length;n++)if(e[n].subject.sameTerm(t.subject)&&e[n].predicate.sameTerm(t.predicate)&&e[n].object.sameTerm(t.object)&&e[n].why.sameTerm(t.why))return void e.splice(n,1);throw new Error("RDFArrayRemove: Array did not contain "+t+" "+t.why)}function v(e,t){return e.slice(0,t.length)===t}function g(e,t){for(var n=e.split("%s"),r="",i=0;i<t.length;i++)t[i]+="",r+=n[i]+t[i];return r+n.slice(t.length).join()}function y(e){var t=""+e+"\n";if(!e.stack)return t+"No stack available.\n";for(var n=e.stack.toString().split("\n"),r=[],i=0;i<n.length;i++){var o=n[i];if(o.indexOf("ecmaunit.js")>-1)break;"("==o.charAt(0)&&(o="function"+o);var a=o.split("@");r.push(a)}for(var i=0;i<r.length;i++)t+=" "+r[i][1]+"\n "+r[i][0];return t}function m(){var t;if("undefined"!=typeof tabulator&&tabulator.isExtension)return Components.classes["@mozilla.org/xmlextras/xmlhttprequest;1"].createInstance().QueryInterface(Components.interfaces.nsIXMLHttpRequest);if("undefined"!=typeof window&&"XMLHttpRequest"in window)return new(t=window.XMLHttpRequest);if("undefined"!=typeof e&&e&&e.exports)return new(t=n(19).XMLHttpRequest);if(!window.ActiveXObject)return!1;try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(e){return new ActiveXObject("Microsoft.XMLHTTP")}}var w=n(7).docpart,b=n(15),x=n(8);e.exports.AJAR_handleNewTerm=t,e.exports.ArrayIndexOf=r,e.exports.callbackify=i,e.exports.dtstamp=u,e.exports.DOMParserFactory=o,e.exports.domToString=a,e.exports.dumpNode=s,e.exports.getHTTPHeaders=l,e.exports.heavyCompare=c,e.exports.heavyCompareSPO=f,e.exports.output=h,e.exports.parseXML=d,e.exports.RDFArrayRemove=p,e.exports.stackString=y,e.exports.string_startswith=v,e.exports.string={},e.exports.string.template=g,e.exports.uri=n(7),e.exports.XMLHTTPFactory=m,e.exports.log=b,e.exports.mediaTypeClass=function(e){return new x("http://www.w3.org/ns/iana/media-types/"+e+"#Resource")}}).call(t,n(6)(e))},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children=[],e.webpackPolyfill=1),e}},function(e,t,n){"use strict";function r(e){var t;return t=e.indexOf("#"),t<0?e:e.slice(0,t)}function i(e){return new c(r(e.uri))}function o(e){var t=/[^\/]*\/\/([^\/]*)\//.exec(e);return t?t[1]:""}function a(e,t){var n,r,i,o,a,s,u=t.indexOf("#");if(u>0&&(t=t.slice(0,u)),0===e.length)return t;if(0===e.indexOf("#"))return t+e;if(o=e.indexOf(":"),o>=0)return e;if(n=t.indexOf(":"),0===t.length)return e;if(n<0)return l("Invalid base: "+t+" in join with given: "+e),e;if(r=t.slice(0,+n+1||9e9),0===e.indexOf("//"))return r+e;if(t.indexOf("//",n)===n+1){if(i=t.indexOf("/",n+3),i<0)return t.length-n-3>0?t+"/"+e:r+e}else if(i=t.indexOf("/",n+1),i<0)return t.length-n-1>0?t+"/"+e:r+e;if(0===e.indexOf("/"))return t.slice(0,i)+e;if(s=t.slice(i),a=s.lastIndexOf("/"),a<0)return r+e;for(a>=0&&a<s.length-1&&(s=s.slice(0,+a+1||9e9)),s+=e;s.match(/[^\/]*\/\.\.\//);)s=s.replace(/[^\/]*\/\.\.\//,"");return s=s.replace(/\.\//g,""),s=s.replace(/\/\.$/,"/"),t.slice(0,i)+s}function s(e){var t;return t=e.indexOf(":"),t<0?null:e.slice(0,t)}function u(e,t){var n,r,i,o,a,s,u,l,c,f,h,d,p,v=new RegExp("^[-_a-zA-Z0-9.]+:(//[^/]*)?/[^/]*$");if(!e)return t;if(e===t)return"";for(r=l=0,a=t.length;l<a&&(n=t[r],n===e[r]);r=++l);if(e.slice(0,r).match(v)&&(i=t.indexOf("//"),i<0&&(i=-2),o=t.indexOf("/",i+2),"/"!==t[o+1]&&"/"!==e[o+1]&&t.slice(0,o)===e.slice(0,o)))return t.slice(o);if("#"===t[r]&&e.length===r)return t.slice(r);for(;r>0&&"/"!==t[r-1];)r--;if(r<3)return t;if(e.indexOf("//",r-2)>0||t.indexOf("//",r-2)>0)return t;if(e.indexOf(":",r)>0)return t;for(u=0,h=e.slice(r),c=0,s=h.length;c<s;c++)n=h[c],"/"===n&&u++;if(0===u&&r<t.length&&"#"===t[r])return"./"+t.slice(r);if(0===u&&r===t.length)return"./";if(p="",u>0)for(f=1,d=u;d>=1?f<=d:f>=d;d>=1?++f:--f)p+="../";return p+t.slice(r)}var l=l||console.log;e.exports.docpart=r,e.exports.document=i,e.exports.hostpart=o,e.exports.join=a,e.exports.protocol=s,e.exports.refTo=u;var c=n(8)},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=n(9),u=n(10),l=function(e){function t(e){r(this,t);var n=i(this,Object.getPrototypeOf(t).call(this));return n.termType=t.termType,e.indexOf(":")<0&&console.log('Warning: NamedNode IRI "'+e+'" must be absolute. Relative URIs will fail in future versions'),n.value=e,n}return o(t,e),a(t,[{key:"dir",value:function(){var e=this.uri.split("#")[0],n=e.slice(0,-1).lastIndexOf("/"),r=e.indexOf("//");return r>=0&&n<r+2||n<0?null:new t(e.slice(0,n+1))}},{key:"site",value:function(){var e=this.uri.split("#")[0],n=e.indexOf("//");if(n<0)throw new Error("This URI does not have a web site part (origin)");var r=e.indexOf("/",n+2);if(r<0)throw new Error("This URI does not have a web site part. (origin)");return new t(e.slice(0,r+1))}},{key:"doc",value:function(){return this.uri.indexOf("#")<0?this:new t(this.uri.split("#")[0])}},{key:"toString",value:function(){return"<"+this.uri+">"}},{key:"uri",get:function(){return this.value},set:function(e){this.value=e}}],[{key:"fromValue",value:function(e){if("undefined"==typeof e||null===e)return e;var n=e&&e.termType;return n?e:new t(e)}}]),t}(u);l.termType="NamedNode",l.prototype.classOrder=s.NamedNode,l.prototype.isVar=0,e.exports=l},function(e,t){"use strict";var n={Literal:1,Collection:3,Formula:4,NamedNode:5,BlankNode:6,Variable:7};e.exports=n},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=function(){function e(){r(this,e)}return i(e,[{key:"substitute",value:function(e){return console.log("@@@ node substitute"+this),this}},{key:"compareTerm",value:function(e){return this.classOrder<e.classOrder?-1:this.classOrder>e.classOrder?1:this.value<e.value?-1:this.value>e.value?1:0}},{key:"equals",value:function(e){return!!e&&(this.termType===e.termType&&this.value===e.value)}},{key:"hashString",value:function(){return this.toCanonical()}},{key:"sameTerm",value:function(e){return this.equals(e)}},{key:"toCanonical",value:function(){return this.toNT()}},{key:"toNT",value:function(){return this.toString()}},{key:"toString",value:function(){throw new Error("Node.toString() is abstract - see the subclasses instead")}}]),e}();e.exports=o,o.fromValue=function(e){var t=n(11),r=n(13);n(8);if("undefined"==typeof e||null===e)return e;var i=e&&e.termType;return i?e:Array.isArray(e)?new t(e):r.fromValue(e)}},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=n(12),u=n(9),l=n(10),c=function(e){function t(e){r(this,t);var n=i(this,Object.getPrototypeOf(t).call(this));return n.termType=t.termType,n.id=s.nextId++,n.elements=[],n.closed=!1,e&&e.length>0&&e.forEach(function(e){n.elements.push(l.fromValue(e))}),n}return o(t,e),a(t,[{key:"append",value:function(e){return this.elements.push(e)}},{key:"close",value:function(){return this.closed=!0,this.closed}},{key:"shift",value:function(){return this.elements.shift()}},{key:"substitute",value:function(e){var n=this.elements.map(function(t){t.substitute(e)});return new t(n)}},{key:"toNT",value:function(){return s.NTAnonymousNodePrefix+this.id}},{key:"toString",value:function(){return"("+this.elements.join(" ")+")"}},{key:"unshift",value:function(e){return this.elements.unshift(e)}}]),t}(l);c.termType="collection",c.prototype.classOrder=u.Collection,c.prototype.compareTerm=s.prototype.compareTerm,c.prototype.isVar=0,e.exports=c},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=n(9),u=n(10),l=function(e){function t(e){r(this,t);var n=i(this,Object.getPrototypeOf(t).call(this));return n.termType=t.termType,n.id=t.nextId++,n.value=e||n.id.toString(),n}return o(t,e),a(t,[{key:"compareTerm",value:function(e){return this.classOrder<e.classOrder?-1:this.classOrder>e.classOrder?1:this.id<e.id?-1:this.id>e.id?1:0}},{key:"copy",value:function(e){var n=new t;return e.copyTo(this,n),n}},{key:"toCanonical",value:function(){return"_:"+this.value}},{key:"toString",value:function(){return t.NTAnonymousNodePrefix+this.id}}]),t}(u);l.nextId=0,l.termType="BlankNode",l.NTAnonymousNodePrefix="_:n",l.prototype.classOrder=s.BlankNode,l.prototype.isBlank=1,l.prototype.isVar=1,e.exports=l},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e},s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(9),l=n(8),c=n(10),f=n(14),h=function(e){function t(e,n,o){r(this,t);var a=i(this,Object.getPrototypeOf(t).call(this));return a.termType=t.termType,a.value=e,n&&(a.lang=n,o=f.langString),o&&(a.datatype=l.fromValue(o)),a}return o(t,e),s(t,[{key:"copy",value:function(){return new t(this.value,this.lang,this.datatype)}},{key:"equals",value:function(e){return!!e&&(this.termType===e.termType&&this.value===e.value&&this.language===e.language&&(!this.datatype&&!e.datatype||this.datatype&&this.datatype.equals(e.datatype)))}},{key:"toNT",value:function(){if("number"==typeof this.value)return this.toString();if("string"!=typeof this.value)throw new Error("Value of RDF literal is not string or number: "+this.value);var e=this.value;return e=e.replace(/\\/g,"\\\\"),e=e.replace(/\"/g,'\\"'),e=e.replace(/\n/g,"\\n"),e='"'+e+'"',this.language?e+="@"+this.language:this.datatype.equals(f.string)||(e+="^^"+this.datatype.toCanonical()),e}},{key:"toString",value:function(){return""+this.value}},{key:"language",get:function(){return this.lang},set:function(e){this.lang=e||""}}],[{key:"fromBoolean",value:function(e){var n=e?"1":"0";return new t(n,null,f.boolean)}},{key:"fromDate",value:function(e){if(!(e instanceof Date))throw new TypeError("Invalid argument to Literal.fromDate()");var n=function(e){return(""+(100+e)).slice(1,3)},r=""+e.getUTCFullYear()+"-"+n(e.getUTCMonth()+1)+"-"+n(e.getUTCDate())+"T"+n(e.getUTCHours())+":"+n(e.getUTCMinutes())+":"+n(e.getUTCSeconds())+"Z";return new t(r,null,f.dateTime)}},{key:"fromNumber",value:function(e){if("number"!=typeof e)throw new TypeError("Invalid argument to Literal.fromNumber()");var n=void 0,r=e.toString();return n=r.indexOf("e")<0&&Math.abs(e)<=Number.MAX_SAFE_INTEGER?Number.isInteger(e)?f.integer:f.decimal:f.double,new t(r,null,n)}},{key:"fromValue",value:function(e){if("undefined"==typeof e||null===e)return e;if("object"===("undefined"==typeof e?"undefined":a(e))&&e.termType)return e;switch("undefined"==typeof e?"undefined":a(e)){case"object":if(e instanceof Date)return t.fromDate(e);case"boolean":return t.fromBoolean(e);case"number":return t.fromNumber(e);case"string":return new t(e)}throw new Error("Can't make literal from "+e+" of type "+("undefined"==typeof e?"undefined":a(e)))}}]),t}(c);h.termType="Literal", h.prototype.classOrder=u.Literal,h.prototype.datatype=f.string,h.prototype.lang="",h.prototype.isVar=0,e.exports=h},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var i=n(8),o=function e(){r(this,e)};o.boolean=new i("http://www.w3.org/2001/XMLSchema#boolean"),o.dateTime=new i("http://www.w3.org/2001/XMLSchema#dateTime"),o.decimal=new i("http://www.w3.org/2001/XMLSchema#decimal"),o.double=new i("http://www.w3.org/2001/XMLSchema#double"),o.integer=new i("http://www.w3.org/2001/XMLSchema#integer"),o.langString=new i("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),o.string=new i("http://www.w3.org/2001/XMLSchema#string"),e.exports=o},function(e,t){"use strict";e.exports={debug:function(e){},warn:function(e){},info:function(e){},error:function(e){},success:function(e){},msg:function(e){}}},function(e,t,n){function r(e){this.options=e||{locator:{}}}function i(e,t,n){function r(t){var r=e[t];!r&&a&&(r=2==e.length?function(n){e(t,n)}:e),i[t]=r&&function(e){r("[xmldom "+t+"]\t"+e+s(n))}||function(){}}if(!e){if(t instanceof o)return t;e=t}var i={},a=e instanceof Function;return n=n||{},r("warning"),r("error"),r("fatalError"),i}function o(){this.cdata=!1}function a(e,t){t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber}function s(e){if(e)return"\n@"+(e.systemId||"")+"#[line:"+e.lineNumber+",col:"+e.columnNumber+"]"}function u(e,t,n){return"string"==typeof e?e.substr(t,n):e.length>=t+n||t?new java.lang.String(e,t,n)+"":e}function l(e,t){e.currentElement?e.currentElement.appendChild(t):e.doc.appendChild(t)}r.prototype.parseFromString=function(e,t){var n=this.options,r=new c,a=n.domBuilder||new o,s=n.errorHandler,u=n.locator,l=n.xmlns||{},f={lt:"<",gt:">",amp:"&",quot:'"',apos:"'"};return u&&a.setDocumentLocator(u),r.errorHandler=i(s,a,u),r.domBuilder=n.domBuilder||a,/\/x?html?$/.test(t)&&(f.nbsp=" ",f.copy="©",l[""]="http://www.w3.org/1999/xhtml"),l.xml=l.xml||"http://www.w3.org/XML/1998/namespace",e?r.parse(e,l,f):r.errorHandler.error("invalid doc source"),a.doc},o.prototype={startDocument:function(){this.doc=(new f).createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(e,t,n,r){var i=this.doc,o=i.createElementNS(e,n||t),s=r.length;l(this,o),this.currentElement=o,this.locator&&a(this.locator,o);for(var u=0;u<s;u++){var e=r.getURI(u),c=r.getValue(u),n=r.getQName(u),f=i.createAttributeNS(e,n);this.locator&&a(r.getLocator(u),f),f.value=f.nodeValue=c,o.setAttributeNode(f)}},endElement:function(e,t,n){var r=this.currentElement;r.tagName;this.currentElement=r.parentNode},startPrefixMapping:function(e,t){},endPrefixMapping:function(e){},processingInstruction:function(e,t){var n=this.doc.createProcessingInstruction(e,t);this.locator&&a(this.locator,n),l(this,n)},ignorableWhitespace:function(e,t,n){},characters:function(e,t,n){if(e=u.apply(this,arguments)){if(this.cdata)var r=this.doc.createCDATASection(e);else var r=this.doc.createTextNode(e);this.currentElement?this.currentElement.appendChild(r):/^\s*$/.test(e)&&this.doc.appendChild(r),this.locator&&a(this.locator,r)}},skippedEntity:function(e){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(e){(this.locator=e)&&(e.lineNumber=0)},comment:function(e,t,n){e=u.apply(this,arguments);var r=this.doc.createComment(e);this.locator&&a(this.locator,r),l(this,r)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(e,t,n){var r=this.doc.implementation;if(r&&r.createDocumentType){var i=r.createDocumentType(e,t,n);this.locator&&a(this.locator,i),l(this,i)}},warning:function(e){console.warn("[xmldom warning]\t"+e,s(this.locator))},error:function(e){console.error("[xmldom error]\t"+e,s(this.locator))},fatalError:function(e){throw console.error("[xmldom fatalError]\t"+e,s(this.locator)),e}},"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(e){o.prototype[e]=function(){return null}});var c=n(17).XMLReader,f=t.DOMImplementation=n(18).DOMImplementation;t.XMLSerializer=n(18).XMLSerializer,t.DOMParser=r},function(e,t){function n(){}function r(e,t,n,r,l){function d(e){if(e>65535){e-=65536;var t=55296+(e>>10),n=56320+(1023&e);return String.fromCharCode(t,n)}return String.fromCharCode(e)}function p(e){var t=e.slice(1,-1);return t in n?n[t]:"#"===t.charAt(0)?d(parseInt(t.substr(1).replace("x","0x"))):(l.error("entity not found:"+e),e)}function v(t){if(t>_){var n=e.substring(_,t).replace(/&#?\w+;/g,p);b&&g(_),r.characters(n,0,t-_),_=t}}function g(t,n){for(;t>=m&&(n=w.exec(e));)y=n.index,m=y+n[0].length,b.lineNumber++;b.columnNumber=t-y+1}for(var y=0,m=0,w=/.*(?:\r\n?|\n)|.*$/g,b=r.locator,x=[{currentNSMap:t}],k={},_=0;;){try{var T=e.indexOf("<",_);if(T<0){if(!e.substr(_).match(/^\s*$/)){var E=r.doc,S=E.createTextNode(e.substr(_));E.appendChild(S),r.currentElement=S}return}switch(T>_&&v(T),e.charAt(T+1)){case"/":var N=e.indexOf(">",T+3),O=e.substring(T+2,N),R=x.pop();N<0?(O=e.substring(T+2).replace(/[\s<].*/,""),l.error("end tag name: "+O+" is not complete:"+R.tagName),N=T+1+O.length):O.match(/\s</)&&(O=O.replace(/[\s<].*/,""),l.error("end tag name: "+O+" maybe not complete"),N=T+1+O.length);var j=R.localNSMap,I=R.tagName==O,C=I||R.tagName&&R.tagName.toLowerCase()==O.toLowerCase();if(C){if(r.endElement(R.uri,R.localName,O),j)for(var A in j)r.endPrefixMapping(A);I||l.fatalError("end tag name: "+O+" is not match the current start tagName:"+R.tagName)}else x.push(R);N++;break;case"?":b&&g(T),N=f(e,T,r);break;case"!":b&&g(T),N=c(e,T,r,l);break;default:b&&g(T);var L=new h,P=x[x.length-1].currentNSMap,N=o(e,T,L,P,p,l),U=L.length;if(!L.closed&&u(e,N,L.tagName,k)&&(L.closed=!0,n.nbsp||l.warning("unclosed xml attribute")),b&&U){for(var D=i(b,{}),M=0;M<U;M++){var F=L[M];g(F.offset),F.locator=i(b,{})}r.locator=D,a(L,r,P)&&x.push(L),r.locator=b}else a(L,r,P)&&x.push(L);"http://www.w3.org/1999/xhtml"!==L.uri||L.closed?N++:N=s(e,N,L.tagName,p,r)}}catch(e){l.error("element parse error: "+e),N=-1}N>_?_=N:v(Math.max(T,_)+1)}}function i(e,t){return t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber,t}function o(e,t,n,r,i,o){for(var a,s,u=++t,l=m;;){var c=e.charAt(u);switch(c){case"=":if(l===w)a=e.slice(t,u),l=x;else{if(l!==b)throw new Error("attribute equal must after attrName");l=x}break;case"'":case'"':if(l===x||l===w){if(l===w&&(o.warning('attribute value must after "="'),a=e.slice(t,u)),t=u+1,u=e.indexOf(c,t),!(u>0))throw new Error("attribute value no end '"+c+"' match");s=e.slice(t,u).replace(/&#?\w+;/g,i),n.add(a,s,t-1),l=_}else{if(l!=k)throw new Error('attribute value must after "="');s=e.slice(t,u).replace(/&#?\w+;/g,i),n.add(a,s,t),o.warning('attribute "'+a+'" missed start quot('+c+")!!"),t=u+1,l=_}break;case"/":switch(l){case m:n.setTagName(e.slice(t,u));case _:case T:case E:l=E,n.closed=!0;case k:case w:case b:break;default:throw new Error("attribute invalid close char('/')")}break;case"":return o.error("unexpected end of input"),l==m&&n.setTagName(e.slice(t,u)),u;case">":switch(l){case m:n.setTagName(e.slice(t,u));case _:case T:case E:break;case k:case w:s=e.slice(t,u),"/"===s.slice(-1)&&(n.closed=!0,s=s.slice(0,-1));case b:l===b&&(s=a),l==k?(o.warning('attribute "'+s+'" missed quot(")!!'),n.add(a,s.replace(/&#?\w+;/g,i),t)):("http://www.w3.org/1999/xhtml"===r[""]&&s.match(/^(?:disabled|checked|selected)$/i)||o.warning('attribute "'+s+'" missed value!! "'+s+'" instead!!'),n.add(s,s,t));break;case x:throw new Error("attribute value missed!!")}return u;case"€":c=" ";default:if(c<=" ")switch(l){case m:n.setTagName(e.slice(t,u)),l=T;break;case w:a=e.slice(t,u),l=b;break;case k:var s=e.slice(t,u).replace(/&#?\w+;/g,i);o.warning('attribute "'+s+'" missed quot(")!!'),n.add(a,s,t);case _:l=T}else switch(l){case b:n.tagName;"http://www.w3.org/1999/xhtml"===r[""]&&a.match(/^(?:disabled|checked|selected)$/i)||o.warning('attribute "'+a+'" missed value!! "'+a+'" instead2!!'),n.add(a,a,t),t=u,l=w;break;case _:o.warning('attribute space is required"'+a+'"!!');case T:l=w,t=u;break;case x:l=k,t=u;break;case E:throw new Error("elements closed character '/' and '>' must be connected to")}}u++}}function a(e,t,n){for(var r=e.tagName,i=null,o=e.length;o--;){var a=e[o],s=a.qName,u=a.value,c=s.indexOf(":");if(c>0)var f=a.prefix=s.slice(0,c),h=s.slice(c+1),d="xmlns"===f&&h;else h=s,f=null,d="xmlns"===s&&"";a.localName=h,d!==!1&&(null==i&&(i={},l(n,n={})),n[d]=i[d]=u,a.uri="http://www.w3.org/2000/xmlns/",t.startPrefixMapping(d,u))}for(var o=e.length;o--;){a=e[o];var f=a.prefix;f&&("xml"===f&&(a.uri="http://www.w3.org/XML/1998/namespace"),"xmlns"!==f&&(a.uri=n[f||""]))}var c=r.indexOf(":");c>0?(f=e.prefix=r.slice(0,c),h=e.localName=r.slice(c+1)):(f=null,h=e.localName=r);var p=e.uri=n[f||""];if(t.startElement(p,h,r,e),!e.closed)return e.currentNSMap=n,e.localNSMap=i,!0;if(t.endElement(p,h,r),i)for(f in i)t.endPrefixMapping(f)}function s(e,t,n,r,i){if(/^(?:script|textarea)$/i.test(n)){var o=e.indexOf("</"+n+">",t),a=e.substring(t+1,o);if(/[&<]/.test(a))return/^script$/i.test(n)?(i.characters(a,0,a.length),o):(a=a.replace(/&#?\w+;/g,r),i.characters(a,0,a.length),o)}return t+1}function u(e,t,n,r){var i=r[n];return null==i&&(i=e.lastIndexOf("</"+n+">"),i<t&&(i=e.lastIndexOf("</"+n)),r[n]=i),i<t}function l(e,t){for(var n in e)t[n]=e[n]}function c(e,t,n,r){var i=e.charAt(t+2);switch(i){case"-":if("-"===e.charAt(t+3)){var o=e.indexOf("-->",t+4);return o>t?(n.comment(e,t+4,o-t-4),o+3):(r.error("Unclosed comment"),-1)}return-1;default:if("CDATA["==e.substr(t+3,6)){var o=e.indexOf("]]>",t+9);return n.startCDATA(),n.characters(e,t+9,o-t-9),n.endCDATA(),o+3}var a=p(e,t),s=a.length;if(s>1&&/!doctype/i.test(a[0][0])){var u=a[1][0],l=s>3&&/^public$/i.test(a[2][0])&&a[3][0],c=s>4&&a[4][0],f=a[s-1];return n.startDTD(u,l&&l.replace(/^(['"])(.*?)\1$/,"$2"),c&&c.replace(/^(['"])(.*?)\1$/,"$2")),n.endDTD(),f.index+f[0].length}}return-1}function f(e,t,n){var r=e.indexOf("?>",t);if(r){var i=e.substring(t,r).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);if(i){i[0].length;return n.processingInstruction(i[1],i[2]),r+2}return-1}return-1}function h(e){}function d(e,t){return e.__proto__=t,e}function p(e,t){var n,r=[],i=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(i.lastIndex=t,i.exec(e);n=i.exec(e);)if(r.push(n),n[1])return r}var v=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,g=new RegExp("[\\-\\.0-9"+v.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),y=new RegExp("^"+v.source+g.source+"*(?::"+v.source+g.source+"*)?$"),m=0,w=1,b=2,x=3,k=4,_=5,T=6,E=7;n.prototype={parse:function(e,t,n){var i=this.domBuilder;i.startDocument(),l(t,t={}),r(e,t,n,i,this.errorHandler),i.endDocument()}},h.prototype={setTagName:function(e){if(!y.test(e))throw new Error("invalid tagName:"+e);this.tagName=e},add:function(e,t,n){if(!y.test(e))throw new Error("invalid attribute:"+e);this[this.length++]={qName:e,value:t,offset:n}},length:0,getLocalName:function(e){return this[e].localName},getLocator:function(e){return this[e].locator},getQName:function(e){return this[e].qName},getURI:function(e){return this[e].uri},getValue:function(e){return this[e].value}},d({},d.prototype)instanceof d||(d=function(e,t){function n(){}n.prototype=t,n=new n;for(t in e)n[t]=e[t];return n}),t.XMLReader=n},function(e,t){function n(e,t){for(var n in e)t[n]=e[n]}function r(e,t){function r(){}var i=e.prototype;if(Object.create){var o=Object.create(t.prototype);i.__proto__=o}i instanceof t||(r.prototype=t.prototype,r=new r,n(i,r),e.prototype=i=r),i.constructor!=e&&("function"!=typeof e&&console.error("unknow Class:"+e),i.constructor=e)}function i(e,t){if(t instanceof Error)var n=t;else n=this,Error.call(this,ie[e]),this.message=ie[e],Error.captureStackTrace&&Error.captureStackTrace(this,i);return n.code=e,t&&(this.message=this.message+": "+t),n}function o(){}function a(e,t){this._node=e,this._refresh=t,s(this)}function s(e){var t=e._node._inc||e._node.ownerDocument._inc;if(e._inc!=t){var r=e._refresh(e._node);H(e,"length",r.length),n(r,e),e._inc=t}}function u(){}function l(e,t){for(var n=e.length;n--;)if(e[n]===t)return n}function c(e,t,n,r){if(r?t[l(t,r)]=n:t[t.length++]=n,e){n.ownerElement=e;var i=e.ownerDocument;i&&(r&&m(i,e,r),y(i,e,n))}}function f(e,t,n){var r=l(t,n);if(!(r>=0))throw i(ae,new Error(e.tagName+"@"+n));for(var o=t.length-1;r<o;)t[r]=t[++r];if(t.length=o,e){var a=e.ownerDocument;a&&(m(a,e,n),n.ownerElement=null)}}function h(e){if(this._features={},e)for(var t in e)this._features=e[t]}function d(){}function p(e){return"<"==e&&"&lt;"||">"==e&&"&gt;"||"&"==e&&"&amp;"||'"'==e&&"&quot;"||"&#"+e.charCodeAt()+";"}function v(e,t){if(t(e))return!0;if(e=e.firstChild)do if(v(e,t))return!0;while(e=e.nextSibling)}function g(){}function y(e,t,n){e&&e._inc++;var r=n.namespaceURI;"http://www.w3.org/2000/xmlns/"==r&&(t._nsMap[n.prefix?n.localName:""]=n.value)}function m(e,t,n,r){e&&e._inc++;var i=n.namespaceURI;"http://www.w3.org/2000/xmlns/"==i&&delete t._nsMap[n.prefix?n.localName:""]}function w(e,t,n){if(e&&e._inc){e._inc++;var r=t.childNodes;if(n)r[r.length++]=n;else{for(var i=t.firstChild,o=0;i;)r[o++]=i,i=i.nextSibling;r.length=o}}}function b(e,t){var n=t.previousSibling,r=t.nextSibling;return n?n.nextSibling=r:e.firstChild=r,r?r.previousSibling=n:e.lastChild=n,w(e.ownerDocument,e),t}function x(e,t,n){var r=t.parentNode;if(r&&r.removeChild(t),t.nodeType===te){var i=t.firstChild;if(null==i)return t;var o=t.lastChild}else i=o=t;var a=n?n.previousSibling:e.lastChild;i.previousSibling=a,o.nextSibling=n,a?a.nextSibling=i:e.firstChild=i,null==n?e.lastChild=o:n.previousSibling=o;do i.parentNode=e;while(i!==o&&(i=i.nextSibling));return w(e.ownerDocument||e,e),t.nodeType==te&&(t.firstChild=t.lastChild=null),t}function k(e,t){var n=t.parentNode;if(n){var r=e.lastChild;n.removeChild(t);var r=e.lastChild}var r=e.lastChild;return t.parentNode=e,t.previousSibling=r,t.nextSibling=null,r?r.nextSibling=t:e.firstChild=t,e.lastChild=t,w(e.ownerDocument,e,t),t}function _(){this._nsMap={}}function T(){}function E(){}function S(){}function N(){}function O(){}function R(){}function j(){}function I(){}function C(){}function A(){}function L(){}function P(){}function U(e,t){var n=[],r=9==this.nodeType?this.documentElement:this,i=r.prefix,o=r.namespaceURI;if(o&&null==i){var i=r.lookupPrefix(o);if(null==i)var a=[{namespace:o,prefix:null}]}return M(this,n,e,t,a),n.join("")}function D(e,t,n){var r=e.prefix||"",i=e.namespaceURI;if(!r&&!i)return!1;if("xml"===r&&"http://www.w3.org/XML/1998/namespace"===i||"http://www.w3.org/2000/xmlns/"==i)return!1;for(var o=n.length;o--;){var a=n[o];if(a.prefix==r)return a.namespace!=i}return!0}function M(e,t,n,r,i){if(r){if(e=r(e),!e)return;if("string"==typeof e)return void t.push(e)}switch(e.nodeType){case W:i||(i=[]);var o=(i.length,e.attributes),a=o.length,s=e.firstChild,u=e.tagName;n=z===e.namespaceURI||n,t.push("<",u);for(var l=0;l<a;l++){var c=o.item(l);"xmlns"==c.prefix?i.push({prefix:c.localName,namespace:c.value}):"xmlns"==c.nodeName&&i.push({prefix:"",namespace:c.value})}for(var l=0;l<a;l++){var c=o.item(l);if(D(c,n,i)){var f=c.prefix||"",h=c.namespaceURI,d=f?" xmlns:"+f:" xmlns";t.push(d,'="',h,'"'),i.push({prefix:f,namespace:h})}M(c,t,n,r,i)}if(D(e,n,i)){var f=e.prefix||"",h=e.namespaceURI,d=f?" xmlns:"+f:" xmlns";t.push(d,'="',h,'"'),i.push({prefix:f,namespace:h})}if(s||n&&!/^(?:meta|link|img|br|hr|input)$/i.test(u)){if(t.push(">"),n&&/^script$/i.test(u))for(;s;)s.data?t.push(s.data):M(s,t,n,r,i),s=s.nextSibling;else for(;s;)M(s,t,n,r,i),s=s.nextSibling;t.push("</",u,">")}else t.push("/>");return;case Z:case te:for(var s=e.firstChild;s;)M(s,t,n,r,i),s=s.nextSibling;return;case X:return t.push(" ",e.name,'="',e.value.replace(/[<&"]/g,p),'"');case J:return t.push(e.data.replace(/[<&]/g,p));case G:return t.push("<![CDATA[",e.data,"]]>");case K:return t.push("<!--",e.data,"-->");case ee:var v=e.publicId,g=e.systemId;if(t.push("<!DOCTYPE ",e.name),v)t.push(' PUBLIC "',v),g&&"."!=g&&t.push('" "',g),t.push('">');else if(g&&"."!=g)t.push(' SYSTEM "',g,'">');else{var y=e.internalSubset;y&&t.push(" [",y,"]"),t.push(">")}return;case Q:return t.push("<?",e.target," ",e.data,"?>");case $:return t.push("&",e.nodeName,";");default:t.push("??",e.nodeName)}}function F(e,t,n){var r;switch(t.nodeType){case W:r=t.cloneNode(!1),r.ownerDocument=e;case te:break;case X:n=!0}if(r||(r=t.cloneNode(!1)),r.ownerDocument=e,r.parentNode=null,n)for(var i=t.firstChild;i;)r.appendChild(F(e,i,n)),i=i.nextSibling;return r}function q(e,t,n){var r=new t.constructor;for(var i in t){var a=t[i];"object"!=typeof a&&a!=r[i]&&(r[i]=a)}switch(t.childNodes&&(r.childNodes=new o),r.ownerDocument=e,r.nodeType){case W:var s=t.attributes,l=r.attributes=new u,c=s.length;l._ownerElement=r;for(var f=0;f<c;f++)r.setAttributeNode(q(e,s.item(f),!0));break;case X:n=!0}if(n)for(var h=t.firstChild;h;)r.appendChild(q(e,h,n)),h=h.nextSibling;return r}function H(e,t,n){e[t]=n}function B(e){switch(e.nodeType){case W:case te:var t=[];for(e=e.firstChild;e;)7!==e.nodeType&&8!==e.nodeType&&t.push(B(e)),e=e.nextSibling;return t.join("");default:return e.nodeValue}}var z="http://www.w3.org/1999/xhtml",V={},W=V.ELEMENT_NODE=1,X=V.ATTRIBUTE_NODE=2,J=V.TEXT_NODE=3,G=V.CDATA_SECTION_NODE=4,$=V.ENTITY_REFERENCE_NODE=5,Y=V.ENTITY_NODE=6,Q=V.PROCESSING_INSTRUCTION_NODE=7,K=V.COMMENT_NODE=8,Z=V.DOCUMENT_NODE=9,ee=V.DOCUMENT_TYPE_NODE=10,te=V.DOCUMENT_FRAGMENT_NODE=11,ne=V.NOTATION_NODE=12,re={},ie={},oe=(re.INDEX_SIZE_ERR=(ie[1]="Index size error",1),re.DOMSTRING_SIZE_ERR=(ie[2]="DOMString size error",2),re.HIERARCHY_REQUEST_ERR=(ie[3]="Hierarchy request error",3)),ae=(re.WRONG_DOCUMENT_ERR=(ie[4]="Wrong document",4),re.INVALID_CHARACTER_ERR=(ie[5]="Invalid character",5),re.NO_DATA_ALLOWED_ERR=(ie[6]="No data allowed",6),re.NO_MODIFICATION_ALLOWED_ERR=(i