xml-explorer 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of xml-explorer might be problematic. Click here for more details.

package/README.md ADDED
@@ -0,0 +1,76 @@
1
+ # xml-explorer
2
+
3
+ React XML explorer component with:
4
+
5
+ - Monaco XML editor
6
+ - worker-based XPath indexing and cursor lookup
7
+ - EN16931 BT/BG tree synchronization
8
+ - strict vs nearest mapping mode
9
+
10
+ ## Local development
11
+
12
+ ```bash
13
+ npm install
14
+ npm run dev
15
+ ```
16
+
17
+ The Vite app in this repo is a demo host for the package.
18
+
19
+ ## Install (consumer app)
20
+
21
+ ```bash
22
+ npm install xml-explorer
23
+ ```
24
+
25
+ Required peer dependencies in the consumer app:
26
+
27
+ - `react`
28
+ - `react-dom`
29
+ - `@monaco-editor/react`
30
+ - `monaco-editor`
31
+
32
+ ## Usage
33
+
34
+ ```tsx
35
+ import { XMLExplorer } from "xml-explorer";
36
+
37
+ export function Example() {
38
+ return <XMLExplorer xml={xmlString} syntax="cii" />;
39
+ }
40
+ ```
41
+
42
+ ## Package API
43
+
44
+ - `XMLExplorer` (named export)
45
+ - `btTree`
46
+ - `buildRuntimeTree`
47
+ - `buildMappingsForSyntax`
48
+ - types: `XmlSyntax`, `TreeNode`, `RuntimeTreeNode`, `NodeMapping`, `MatchLocation`
49
+
50
+ ## Build package
51
+
52
+ ```bash
53
+ npm run build
54
+ ```
55
+
56
+ Outputs are written to `dist/`:
57
+
58
+ - `dist/index.js` (ESM)
59
+ - `dist/index.cjs` (CJS)
60
+ - `dist/index.d.ts` (types)
61
+
62
+ ## Dry-run before publish
63
+
64
+ ```bash
65
+ npm pack
66
+ ```
67
+
68
+ Inspect the generated `.tgz` to confirm package contents.
69
+
70
+ ## Publish to npm
71
+
72
+ 1. Ensure package name/version in `package.json` are correct.
73
+ 2. Login once: `npm login`
74
+ 3. Publish: `npm publish --access public`
75
+
76
+ If the package name is already taken, use a scoped name like `@your-scope/xml-explorer`.
@@ -0,0 +1,11 @@
1
+ import type { RuntimeTreeNode } from "./btTree";
2
+ export default function TreeView(props: {
3
+ root: RuntimeTreeNode;
4
+ expanded: Record<string, boolean>;
5
+ selectedKey: string | null;
6
+ onToggle: (key: string) => void;
7
+ onClickNode: (node: RuntimeTreeNode) => void | Promise<void>;
8
+ getNodeXpath: (node: RuntimeTreeNode) => string | undefined;
9
+ getMatchCount: (node: RuntimeTreeNode) => number | undefined;
10
+ }): import("react/jsx-runtime").JSX.Element;
11
+ //# sourceMappingURL=TreeView.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TreeView.d.ts","sourceRoot":"","sources":["../src/xmlExplorer/TreeView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAEhD,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,KAAK,EAAE;IACtC,IAAI,EAAE,eAAe,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,WAAW,EAAE,CAAC,IAAI,EAAE,eAAe,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7D,YAAY,EAAE,CAAC,IAAI,EAAE,eAAe,KAAK,MAAM,GAAG,SAAS,CAAC;IAC5D,aAAa,EAAE,CAAC,IAAI,EAAE,eAAe,KAAK,MAAM,GAAG,SAAS,CAAC;CAC9D,2CAOA"}
@@ -0,0 +1,8 @@
1
+ import type { XmlSyntax } from "./btTree";
2
+ interface XMLExplorerProps {
3
+ xml: string;
4
+ syntax?: XmlSyntax;
5
+ }
6
+ export default function XMLExplorer({ xml, syntax }: XMLExplorerProps): import("react/jsx-runtime").JSX.Element;
7
+ export {};
8
+ //# sourceMappingURL=XMLExplorer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"XMLExplorer.d.ts","sourceRoot":"","sources":["../src/xmlExplorer/XMLExplorer.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAmB,SAAS,EAAE,MAAM,UAAU,CAAC;AAM3D,UAAU,gBAAgB;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,SAAS,CAAC;CACpB;AAYD,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAAE,GAAG,EAAE,MAAc,EAAE,EAAE,gBAAgB,2CA4iB5E"}
@@ -0,0 +1,4 @@
1
+ (function(){"use strict";var Gt={},zt={},te;function Ee(){return te||(te=1,zt.entityMap={lt:"<",gt:">",amp:"&",quot:'"',apos:"'",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",times:"×",divide:"÷",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",fnof:"ƒ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",bull:"•",hellip:"…",permil:"‰",prime:"′",Prime:"″",lsaquo:"‹",rsaquo:"›",oline:"‾",euro:"€",trade:"™",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦"}),zt}var Jt={},ee;function me(){if(ee)return Jt;ee=1;var h=/[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]/,d=new RegExp("[\\-\\.0-9"+h.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),A=new RegExp("^"+h.source+d.source+"*(?::"+h.source+d.source+"*)?$"),O=0,F=1,V=2,W=3,it=4,pt=5,mt=6,at=7;function St(f,x){this.message=f,this.locator=x,Error.captureStackTrace&&Error.captureStackTrace(this,St)}St.prototype=new Error,St.prototype.name=St.name;function y(){}y.prototype={parse:function(f,x,N){var U=this.domBuilder;U.startDocument(),ft(x,x={}),$(f,x,N,U,this.errorHandler),U.endDocument()}};function $(f,x,N,U,L){function C(G){if(G>65535){G-=65536;var v=55296+(G>>10),R=56320+(G&1023);return String.fromCharCode(v,R)}else return String.fromCharCode(G)}function _(G){var v=G.slice(1,-1);return v in N?N[v]:v.charAt(0)==="#"?C(parseInt(v.substr(1).replace("x","0x"))):(L.error("entity not found:"+G),G)}function H(G){if(G>lt){var v=f.substring(lt,G).replace(/&#?\w+;/g,_);Q&&P(lt),U.characters(v,0,G-lt),lt=G}}function P(G,v){for(;G>=k&&(v=nt.exec(f));)M=v.index,k=M+v[0].length,Q.lineNumber++;Q.columnNumber=G-M+1}for(var M=0,k=0,nt=/.*(?:\r\n?|\n)|.*$/g,Q=U.locator,ut=[{currentNSMap:x}],wt={},lt=0;;){try{var z=f.indexOf("<",lt);if(z<0){if(!f.substr(lt).match(/^\s*$/)){var vt=U.doc,xt=vt.createTextNode(f.substr(lt));vt.appendChild(xt),U.currentElement=xt}return}switch(z>lt&&H(z),f.charAt(z+1)){case"/":var c=f.indexOf(">",z+3),ot=f.substring(z+2,c),q=ut.pop();c<0?(ot=f.substring(z+2).replace(/[\s<].*/,""),L.error("end tag name: "+ot+" is not complete:"+q.tagName),c=z+1+ot.length):ot.match(/\s</)&&(ot=ot.replace(/[\s<].*/,""),L.error("end tag name: "+ot+" maybe not complete"),c=z+1+ot.length);var Mt=q.localNSMap,Ft=q.tagName==ot,Ht=Ft||q.tagName&&q.tagName.toLowerCase()==ot.toLowerCase();if(Ht){if(U.endElement(q.uri,q.localName,ot),Mt)for(var Yt in Mt)U.endPrefixMapping(Yt);Ft||L.fatalError("end tag name: "+ot+" is not match the current start tagName:"+q.tagName)}else ut.push(q);c++;break;case"?":Q&&P(z),c=ht(f,z,U);break;case"!":Q&&P(z),c=Ct(f,z,U,L);break;default:Q&&P(z);var Nt=new b,At=ut[ut.length-1].currentNSMap,c=J(f,z,Nt,At,_,L),Vt=Nt.length;if(!Nt.closed&&bt(f,c,Nt.tagName,wt)&&(Nt.closed=!0,N.nbsp||L.warning("unclosed xml attribute")),Q&&Vt){for(var g=X(Q,{}),Ot=0;Ot<Vt;Ot++){var dt=Nt[Ot];P(dt.offset),dt.locator=X(Q,{})}U.locator=g,j(Nt,U,At)&&ut.push(Nt),U.locator=Q}else j(Nt,U,At)&&ut.push(Nt);Nt.uri==="http://www.w3.org/1999/xhtml"&&!Nt.closed?c=rt(f,c,Nt.tagName,_,U):c++}}catch(G){if(G instanceof St)throw G;L.error("element parse error: "+G),c=-1}c>lt?lt=c:H(Math.max(z,lt)+1)}}function X(f,x){return x.lineNumber=f.lineNumber,x.columnNumber=f.columnNumber,x}function J(f,x,N,U,L,C){function _(Q,ut,wt){Q in N.attributeNames&&C.fatalError("Attribute "+Q+" redefined"),N.addValue(Q,ut,wt)}for(var H,P,M=++x,k=O;;){var nt=f.charAt(M);switch(nt){case"=":if(k===F)H=f.slice(x,M),k=W;else if(k===V)k=W;else throw new Error("attribute equal must after attrName");break;case"'":case'"':if(k===W||k===F)if(k===F&&(C.warning('attribute value must after "="'),H=f.slice(x,M)),x=M+1,M=f.indexOf(nt,x),M>0)P=f.slice(x,M).replace(/&#?\w+;/g,L),_(H,P,x-1),k=pt;else throw new Error("attribute value no end '"+nt+"' match");else if(k==it)P=f.slice(x,M).replace(/&#?\w+;/g,L),_(H,P,x),C.warning('attribute "'+H+'" missed start quot('+nt+")!!"),x=M+1,k=pt;else throw new Error('attribute value must after "="');break;case"/":switch(k){case O:N.setTagName(f.slice(x,M));case pt:case mt:case at:k=at,N.closed=!0;case it:case F:case V:break;default:throw new Error("attribute invalid close char('/')")}break;case"":return C.error("unexpected end of input"),k==O&&N.setTagName(f.slice(x,M)),M;case">":switch(k){case O:N.setTagName(f.slice(x,M));case pt:case mt:case at:break;case it:case F:P=f.slice(x,M),P.slice(-1)==="/"&&(N.closed=!0,P=P.slice(0,-1));case V:k===V&&(P=H),k==it?(C.warning('attribute "'+P+'" missed quot(")!'),_(H,P.replace(/&#?\w+;/g,L),x)):((U[""]!=="http://www.w3.org/1999/xhtml"||!P.match(/^(?:disabled|checked|selected)$/i))&&C.warning('attribute "'+P+'" missed value!! "'+P+'" instead!!'),_(P,P,x));break;case W:throw new Error("attribute value missed!!")}return M;case"€":nt=" ";default:if(nt<=" ")switch(k){case O:N.setTagName(f.slice(x,M)),k=mt;break;case F:H=f.slice(x,M),k=V;break;case it:var P=f.slice(x,M).replace(/&#?\w+;/g,L);C.warning('attribute "'+P+'" missed quot(")!!'),_(H,P,x);case pt:k=mt;break}else switch(k){case V:N.tagName,(U[""]!=="http://www.w3.org/1999/xhtml"||!H.match(/^(?:disabled|checked|selected)$/i))&&C.warning('attribute "'+H+'" missed value!! "'+H+'" instead2!!'),_(H,H,x),x=M,k=F;break;case pt:C.warning('attribute space is required"'+H+'"!!');case mt:k=F,x=M;break;case W:k=it,x=M;break;case at:throw new Error("elements closed character '/' and '>' must be connected to")}}M++}}function j(f,x,N){for(var U=f.tagName,L=null,nt=f.length;nt--;){var C=f[nt],_=C.qName,H=C.value,Q=_.indexOf(":");if(Q>0)var P=C.prefix=_.slice(0,Q),M=_.slice(Q+1),k=P==="xmlns"&&M;else M=_,P=null,k=_==="xmlns"&&"";C.localName=M,k!==!1&&(L==null&&(L={},ft(N,N={})),N[k]=L[k]=H,C.uri="http://www.w3.org/2000/xmlns/",x.startPrefixMapping(k,H))}for(var nt=f.length;nt--;){C=f[nt];var P=C.prefix;P&&(P==="xml"&&(C.uri="http://www.w3.org/XML/1998/namespace"),P!=="xmlns"&&(C.uri=N[P||""]))}var Q=U.indexOf(":");Q>0?(P=f.prefix=U.slice(0,Q),M=f.localName=U.slice(Q+1)):(P=null,M=f.localName=U);var ut=f.uri=N[P||""];if(x.startElement(ut,M,U,f),f.closed){if(x.endElement(ut,M,U),L)for(P in L)x.endPrefixMapping(P)}else return f.currentNSMap=N,f.localNSMap=L,!0}function rt(f,x,N,U,L){if(/^(?:script|textarea)$/i.test(N)){var C=f.indexOf("</"+N+">",x),_=f.substring(x+1,C);if(/[&<]/.test(_))return/^script$/i.test(N)?(L.characters(_,0,_.length),C):(_=_.replace(/&#?\w+;/g,U),L.characters(_,0,_.length),C)}return x+1}function bt(f,x,N,U){var L=U[N];return L==null&&(L=f.lastIndexOf("</"+N+">"),L<x&&(L=f.lastIndexOf("</"+N)),U[N]=L),L<x}function ft(f,x){for(var N in f)x[N]=f[N]}function Ct(f,x,N,U){var L=f.charAt(x+2);switch(L){case"-":if(f.charAt(x+3)==="-"){var C=f.indexOf("-->",x+4);return C>x?(N.comment(f,x+4,C-x-4),C+3):(U.error("Unclosed comment"),-1)}else return-1;default:if(f.substr(x+3,6)=="CDATA["){var C=f.indexOf("]]>",x+9);return N.startCDATA(),N.characters(f,x+9,C-x-9),N.endCDATA(),C+3}var _=l(f,x),H=_.length;if(H>1&&/!doctype/i.test(_[0][0])){var P=_[1][0],M=!1,k=!1;H>3&&(/^public$/i.test(_[2][0])?(M=_[3][0],k=H>4&&_[4][0]):/^system$/i.test(_[2][0])&&(k=_[3][0]));var nt=_[H-1];return N.startDTD(P,M,k),N.endDTD(),nt.index+nt[0].length}}return-1}function ht(f,x,N){var U=f.indexOf("?>",x);if(U){var L=f.substring(x,U).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);return L?(L[0].length,N.processingInstruction(L[1],L[2]),U+2):-1}return-1}function b(){this.attributeNames={}}b.prototype={setTagName:function(f){if(!A.test(f))throw new Error("invalid tagName:"+f);this.tagName=f},addValue:function(f,x,N){if(!A.test(f))throw new Error("invalid attribute:"+f);this.attributeNames[f]=this.length,this[this.length++]={qName:f,value:x,offset:N}},length:0,getLocalName:function(f){return this[f].localName},getLocator:function(f){return this[f].locator},getQName:function(f){return this[f].qName},getURI:function(f){return this[f].uri},getValue:function(f){return this[f].value}};function l(f,x){var N,U=[],L=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(L.lastIndex=x,L.exec(f);N=L.exec(f);)if(U.push(N),N[1])return U}return Jt.XMLReader=y,Jt.ParseError=St,Jt}var Xt={},re;function ne(){if(re)return Xt;re=1;function h(n,i){for(var s in n)i[s]=n[s]}function d(n,i){var s=n.prototype;if(!(s instanceof i)){let p=function(){};p.prototype=i.prototype,p=new p,h(s,p),n.prototype=s=p}s.constructor!=n&&(typeof n!="function"&&console.error("unknow Class:"+n),s.constructor=n)}var A="http://www.w3.org/1999/xhtml",O={},F=O.ELEMENT_NODE=1,V=O.ATTRIBUTE_NODE=2,W=O.TEXT_NODE=3,it=O.CDATA_SECTION_NODE=4,pt=O.ENTITY_REFERENCE_NODE=5,mt=O.ENTITY_NODE=6,at=O.PROCESSING_INSTRUCTION_NODE=7,St=O.COMMENT_NODE=8,y=O.DOCUMENT_NODE=9,$=O.DOCUMENT_TYPE_NODE=10,X=O.DOCUMENT_FRAGMENT_NODE=11,J=O.NOTATION_NODE=12,j={},rt={};j.INDEX_SIZE_ERR=(rt[1]="Index size error",1),j.DOMSTRING_SIZE_ERR=(rt[2]="DOMString size error",2);var bt=j.HIERARCHY_REQUEST_ERR=(rt[3]="Hierarchy request error",3);j.WRONG_DOCUMENT_ERR=(rt[4]="Wrong document",4),j.INVALID_CHARACTER_ERR=(rt[5]="Invalid character",5),j.NO_DATA_ALLOWED_ERR=(rt[6]="No data allowed",6),j.NO_MODIFICATION_ALLOWED_ERR=(rt[7]="No modification allowed",7);var ft=j.NOT_FOUND_ERR=(rt[8]="Not found",8);j.NOT_SUPPORTED_ERR=(rt[9]="Not supported",9);var Ct=j.INUSE_ATTRIBUTE_ERR=(rt[10]="Attribute in use",10);j.INVALID_STATE_ERR=(rt[11]="Invalid state",11),j.SYNTAX_ERR=(rt[12]="Syntax error",12),j.INVALID_MODIFICATION_ERR=(rt[13]="Invalid modification",13),j.NAMESPACE_ERR=(rt[14]="Invalid namespace",14),j.INVALID_ACCESS_ERR=(rt[15]="Invalid access",15);function ht(n,i){if(i instanceof Error)var s=i;else s=this,Error.call(this,rt[n]),this.message=rt[n],Error.captureStackTrace&&Error.captureStackTrace(this,ht);return s.code=n,i&&(this.message=this.message+": "+i),s}ht.prototype=Error.prototype,h(j,ht);function b(){}b.prototype={length:0,item:function(n){return this[n]||null},toString:function(n,i){for(var s=[],p=0;p<this.length;p++)dt(this[p],s,n,i);return s.join("")}};function l(n,i){this._node=n,this._refresh=i,f(this)}function f(n){var i=n._node._inc||n._node.ownerDocument._inc;if(n._inc!=i){var s=n._refresh(n._node);R(n,"length",s.length),h(s,n),n._inc=i}}l.prototype.item=function(n){return f(this),this[n]},d(l,b);function x(){}function N(n,i){for(var s=n.length;s--;)if(n[s]===i)return s}function U(n,i,s,p){if(p?i[N(i,p)]=s:i[i.length++]=s,n){s.ownerElement=n;var T=n.ownerDocument;T&&(p&&nt(T,n,p),k(T,n,s))}}function L(n,i,s){var p=N(i,s);if(p>=0){for(var T=i.length-1;p<T;)i[p]=i[++p];if(i.length=T,n){var E=n.ownerDocument;E&&(nt(E,n,s),s.ownerElement=null)}}else throw ht(ft,new Error(n.tagName+"@"+s))}x.prototype={length:0,item:b.prototype.item,getNamedItem:function(n){for(var i=this.length;i--;){var s=this[i];if(s.nodeName==n)return s}},setNamedItem:function(n){var i=n.ownerElement;if(i&&i!=this._ownerElement)throw new ht(Ct);var s=this.getNamedItem(n.nodeName);return U(this._ownerElement,this,n,s),s},setNamedItemNS:function(n){var i=n.ownerElement,s;if(i&&i!=this._ownerElement)throw new ht(Ct);return s=this.getNamedItemNS(n.namespaceURI,n.localName),U(this._ownerElement,this,n,s),s},removeNamedItem:function(n){var i=this.getNamedItem(n);return L(this._ownerElement,this,i),i},removeNamedItemNS:function(n,i){var s=this.getNamedItemNS(n,i);return L(this._ownerElement,this,s),s},getNamedItemNS:function(n,i){for(var s=this.length;s--;){var p=this[s];if(p.localName==i&&p.namespaceURI==n)return p}return null}};function C(n){if(this._features={},n)for(var i in n)this._features=n[i]}C.prototype={hasFeature:function(n,i){var s=this._features[n.toLowerCase()];return!!(s&&(!i||i in s))},createDocument:function(n,i,s){var p=new M;if(p.implementation=this,p.childNodes=new b,p.doctype=s,s&&p.appendChild(s),i){var T=p.createElementNS(n,i);p.appendChild(T)}return p},createDocumentType:function(n,i,s){var p=new Ft;return p.name=n,p.nodeName=n,p.publicId=i,p.systemId=s,p}};function _(){}_.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,attributes:null,parentNode:null,childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,insertBefore:function(n,i){return wt(this,n,i)},replaceChild:function(n,i){this.insertBefore(n,i),i&&this.removeChild(i)},removeChild:function(n){return ut(this,n)},appendChild:function(n){return this.insertBefore(n,null)},hasChildNodes:function(){return this.firstChild!=null},cloneNode:function(n){return v(this.ownerDocument||this,this,n)},normalize:function(){for(var n=this.firstChild;n;){var i=n.nextSibling;i&&i.nodeType==W&&n.nodeType==W?(this.removeChild(i),n.appendData(i.data)):(n.normalize(),n=i)}},isSupported:function(n,i){return this.ownerDocument.implementation.hasFeature(n,i)},hasAttributes:function(){return this.attributes.length>0},lookupPrefix:function(n){for(var i=this;i;){var s=i._nsMap;if(s){for(var p in s)if(s[p]==n)return p}i=i.nodeType==V?i.ownerDocument:i.parentNode}return null},lookupNamespaceURI:function(n){for(var i=this;i;){var s=i._nsMap;if(s&&n in s)return s[n];i=i.nodeType==V?i.ownerDocument:i.parentNode}return null},isDefaultNamespace:function(n){var i=this.lookupPrefix(n);return i==null}};function H(n){return n=="<"&&"&lt;"||n==">"&&"&gt;"||n=="&"&&"&amp;"||n=='"'&&"&quot;"||"&#"+n.charCodeAt()+";"}h(O,_),h(O,_.prototype);function P(n,i){if(i(n))return!0;if(n=n.firstChild)do if(P(n,i))return!0;while(n=n.nextSibling)}function M(){}function k(n,i,s){n&&n._inc++;var p=s.namespaceURI;p=="http://www.w3.org/2000/xmlns/"&&(i._nsMap[s.prefix?s.localName:""]=s.value)}function nt(n,i,s,p){n&&n._inc++;var T=s.namespaceURI;T=="http://www.w3.org/2000/xmlns/"&&delete i._nsMap[s.prefix?s.localName:""]}function Q(n,i,s){if(n&&n._inc){n._inc++;var p=i.childNodes;if(s)p[p.length++]=s;else{for(var T=i.firstChild,E=0;T;)p[E++]=T,T=T.nextSibling;p.length=E}}}function ut(n,i){var s=i.previousSibling,p=i.nextSibling;return s?s.nextSibling=p:n.firstChild=p,p?p.previousSibling=s:n.lastChild=s,Q(n.ownerDocument,n),i}function wt(n,i,s){var p=i.parentNode;if(p&&p.removeChild(i),i.nodeType===X){var T=i.firstChild;if(T==null)return i;var E=i.lastChild}else T=E=i;var ct=s?s.previousSibling:n.lastChild;T.previousSibling=ct,E.nextSibling=s,ct?ct.nextSibling=T:n.firstChild=T,s==null?n.lastChild=E:s.previousSibling=E;do T.parentNode=n;while(T!==E&&(T=T.nextSibling));return Q(n.ownerDocument||n,n),i.nodeType==X&&(i.firstChild=i.lastChild=null),i}function lt(n,i){var s=i.parentNode;if(s){var p=n.lastChild;s.removeChild(i);var p=n.lastChild}var p=n.lastChild;return i.parentNode=n,i.previousSibling=p,i.nextSibling=null,p?p.nextSibling=i:n.firstChild=i,n.lastChild=i,Q(n.ownerDocument,n,i),i}M.prototype={nodeName:"#document",nodeType:y,doctype:null,documentElement:null,_inc:1,insertBefore:function(n,i){if(n.nodeType==X){for(var s=n.firstChild;s;){var p=s.nextSibling;this.insertBefore(s,i),s=p}return n}return this.documentElement==null&&n.nodeType==F&&(this.documentElement=n),wt(this,n,i),n.ownerDocument=this,n},removeChild:function(n){return this.documentElement==n&&(this.documentElement=null),ut(this,n)},importNode:function(n,i){return G(this,n,i)},getElementById:function(n){var i=null;return P(this.documentElement,function(s){if(s.nodeType==F&&s.getAttribute("id")==n)return i=s,!0}),i},getElementsByClassName:function(n){var i=new RegExp("(^|\\s)"+n+"(\\s|$)");return new l(this,function(s){var p=[];return P(s.documentElement,function(T){T!==s&&T.nodeType==F&&i.test(T.getAttribute("class"))&&p.push(T)}),p})},createElement:function(n){var i=new z;i.ownerDocument=this,i.nodeName=n,i.tagName=n,i.childNodes=new b;var s=i.attributes=new x;return s._ownerElement=i,i},createDocumentFragment:function(){var n=new At;return n.ownerDocument=this,n.childNodes=new b,n},createTextNode:function(n){var i=new ot;return i.ownerDocument=this,i.appendData(n),i},createComment:function(n){var i=new q;return i.ownerDocument=this,i.appendData(n),i},createCDATASection:function(n){var i=new Mt;return i.ownerDocument=this,i.appendData(n),i},createProcessingInstruction:function(n,i){var s=new c;return s.ownerDocument=this,s.tagName=s.target=n,s.nodeValue=s.data=i,s},createAttribute:function(n){var i=new vt;return i.ownerDocument=this,i.name=n,i.nodeName=n,i.localName=n,i.specified=!0,i},createEntityReference:function(n){var i=new Nt;return i.ownerDocument=this,i.nodeName=n,i},createElementNS:function(n,i){var s=new z,p=i.split(":"),T=s.attributes=new x;return s.childNodes=new b,s.ownerDocument=this,s.nodeName=i,s.tagName=i,s.namespaceURI=n,p.length==2?(s.prefix=p[0],s.localName=p[1]):s.localName=i,T._ownerElement=s,s},createAttributeNS:function(n,i){var s=new vt,p=i.split(":");return s.ownerDocument=this,s.nodeName=i,s.name=i,s.namespaceURI=n,s.specified=!0,p.length==2?(s.prefix=p[0],s.localName=p[1]):s.localName=i,s}},d(M,_);function z(){this._nsMap={}}z.prototype={nodeType:F,hasAttribute:function(n){return this.getAttributeNode(n)!=null},getAttribute:function(n){var i=this.getAttributeNode(n);return i&&i.value||""},getAttributeNode:function(n){return this.attributes.getNamedItem(n)},setAttribute:function(n,i){var s=this.ownerDocument.createAttribute(n);s.value=s.nodeValue=""+i,this.setAttributeNode(s)},removeAttribute:function(n){var i=this.getAttributeNode(n);i&&this.removeAttributeNode(i)},appendChild:function(n){return n.nodeType===X?this.insertBefore(n,null):lt(this,n)},setAttributeNode:function(n){return this.attributes.setNamedItem(n)},setAttributeNodeNS:function(n){return this.attributes.setNamedItemNS(n)},removeAttributeNode:function(n){return this.attributes.removeNamedItem(n.nodeName)},removeAttributeNS:function(n,i){var s=this.getAttributeNodeNS(n,i);s&&this.removeAttributeNode(s)},hasAttributeNS:function(n,i){return this.getAttributeNodeNS(n,i)!=null},getAttributeNS:function(n,i){var s=this.getAttributeNodeNS(n,i);return s&&s.value||""},setAttributeNS:function(n,i,s){var p=this.ownerDocument.createAttributeNS(n,i);p.value=p.nodeValue=""+s,this.setAttributeNode(p)},getAttributeNodeNS:function(n,i){return this.attributes.getNamedItemNS(n,i)},getElementsByTagName:function(n){return new l(this,function(i){var s=[];return P(i,function(p){p!==i&&p.nodeType==F&&(n==="*"||p.tagName==n)&&s.push(p)}),s})},getElementsByTagNameNS:function(n,i){return new l(this,function(s){var p=[];return P(s,function(T){T!==s&&T.nodeType===F&&(n==="*"||T.namespaceURI===n)&&(i==="*"||T.localName==i)&&p.push(T)}),p})}},M.prototype.getElementsByTagName=z.prototype.getElementsByTagName,M.prototype.getElementsByTagNameNS=z.prototype.getElementsByTagNameNS,d(z,_);function vt(){}vt.prototype.nodeType=V,d(vt,_);function xt(){}xt.prototype={data:"",substringData:function(n,i){return this.data.substring(n,n+i)},appendData:function(n){n=this.data+n,this.nodeValue=this.data=n,this.length=n.length},insertData:function(n,i){this.replaceData(n,0,i)},appendChild:function(n){throw new Error(rt[bt])},deleteData:function(n,i){this.replaceData(n,i,"")},replaceData:function(n,i,s){var p=this.data.substring(0,n),T=this.data.substring(n+i);s=p+s+T,this.nodeValue=this.data=s,this.length=s.length}},d(xt,_);function ot(){}ot.prototype={nodeName:"#text",nodeType:W,splitText:function(n){var i=this.data,s=i.substring(n);i=i.substring(0,n),this.data=this.nodeValue=i,this.length=i.length;var p=this.ownerDocument.createTextNode(s);return this.parentNode&&this.parentNode.insertBefore(p,this.nextSibling),p}},d(ot,xt);function q(){}q.prototype={nodeName:"#comment",nodeType:St},d(q,xt);function Mt(){}Mt.prototype={nodeName:"#cdata-section",nodeType:it},d(Mt,xt);function Ft(){}Ft.prototype.nodeType=$,d(Ft,_);function Ht(){}Ht.prototype.nodeType=J,d(Ht,_);function Yt(){}Yt.prototype.nodeType=mt,d(Yt,_);function Nt(){}Nt.prototype.nodeType=pt,d(Nt,_);function At(){}At.prototype.nodeName="#document-fragment",At.prototype.nodeType=X,d(At,_);function c(){}c.prototype.nodeType=at,d(c,_);function Vt(){}Vt.prototype.serializeToString=function(n,i,s){return g.call(n,i,s)},_.prototype.toString=g;function g(n,i){var s=[],p=this.nodeType==9&&this.documentElement||this,T=p.prefix,E=p.namespaceURI;if(E&&T==null){var T=p.lookupPrefix(E);if(T==null)var ct=[{namespace:E,prefix:null}]}return dt(this,s,n,i,ct),s.join("")}function Ot(n,i,s){var p=n.prefix||"",T=n.namespaceURI;if(!p&&!T||p==="xml"&&T==="http://www.w3.org/XML/1998/namespace"||T=="http://www.w3.org/2000/xmlns/")return!1;for(var E=s.length;E--;){var ct=s[E];if(ct.prefix==p)return ct.namespace!=T}return!0}function dt(n,i,s,p,T){if(p)if(n=p(n),n){if(typeof n=="string"){i.push(n);return}}else return;switch(n.nodeType){case F:T||(T=[]),T.length;var E=n.attributes,ct=E.length,gt=n.firstChild,Dt=n.tagName;s=A===n.namespaceURI||s,i.push("<",Dt);for(var Tt=0;Tt<ct;Tt++){var st=E.item(Tt);st.prefix=="xmlns"?T.push({prefix:st.localName,namespace:st.value}):st.nodeName=="xmlns"&&T.push({prefix:"",namespace:st.value})}for(var Tt=0;Tt<ct;Tt++){var st=E.item(Tt);if(Ot(st,s,T)){var Et=st.prefix||"",I=st.namespaceURI,S=Et?" xmlns:"+Et:" xmlns";i.push(S,'="',I,'"'),T.push({prefix:Et,namespace:I})}dt(st,i,s,p,T)}if(Ot(n,s,T)){var Et=n.prefix||"",I=n.namespaceURI;if(I){var S=Et?" xmlns:"+Et:" xmlns";i.push(S,'="',I,'"'),T.push({prefix:Et,namespace:I})}}if(gt||s&&!/^(?:meta|link|img|br|hr|input)$/i.test(Dt)){if(i.push(">"),s&&/^script$/i.test(Dt))for(;gt;)gt.data?i.push(gt.data):dt(gt,i,s,p,T),gt=gt.nextSibling;else for(;gt;)dt(gt,i,s,p,T),gt=gt.nextSibling;i.push("</",Dt,">")}else i.push("/>");return;case y:case X:for(var gt=n.firstChild;gt;)dt(gt,i,s,p,T),gt=gt.nextSibling;return;case V:return i.push(" ",n.name,'="',n.value.replace(/[<&"]/g,H),'"');case W:return i.push(n.data.replace(/[<&]/g,H).replace(/]]>/g,"]]&gt;"));case it:return i.push("<![CDATA[",n.data,"]]>");case St:return i.push("<!--",n.data,"-->");case $:var _t=n.publicId,yt=n.systemId;if(i.push("<!DOCTYPE ",n.name),_t)i.push(" PUBLIC ",_t),yt&&yt!="."&&i.push(" ",yt),i.push(">");else if(yt&&yt!=".")i.push(" SYSTEM ",yt,">");else{var Bt=n.internalSubset;Bt&&i.push(" [",Bt,"]"),i.push(">")}return;case at:return i.push("<?",n.target," ",n.data,"?>");case pt:return i.push("&",n.nodeName,";");default:i.push("??",n.nodeName)}}function G(n,i,s){var p;switch(i.nodeType){case F:p=i.cloneNode(!1),p.ownerDocument=n;case X:break;case V:s=!0;break}if(p||(p=i.cloneNode(!1)),p.ownerDocument=n,p.parentNode=null,s)for(var T=i.firstChild;T;)p.appendChild(G(n,T,s)),T=T.nextSibling;return p}function v(n,i,s){var p=new i.constructor;for(var T in i){var E=i[T];typeof E!="object"&&E!=p[T]&&(p[T]=E)}switch(i.childNodes&&(p.childNodes=new b),p.ownerDocument=n,p.nodeType){case F:var ct=i.attributes,Dt=p.attributes=new x,Tt=ct.length;Dt._ownerElement=p;for(var st=0;st<Tt;st++)p.setAttributeNode(v(n,ct.item(st),!0));break;case V:s=!0}if(s)for(var Et=i.firstChild;Et;)p.appendChild(v(n,Et,s)),Et=Et.nextSibling;return p}function R(n,i,s){n[i]=s}try{if(Object.defineProperty){let n=function(i){switch(i.nodeType){case F:case X:var s=[];for(i=i.firstChild;i;)i.nodeType!==7&&i.nodeType!==8&&s.push(n(i)),i=i.nextSibling;return s.join("");default:return i.nodeValue}};Object.defineProperty(l.prototype,"length",{get:function(){return f(this),this.$$length}}),Object.defineProperty(_.prototype,"textContent",{get:function(){return n(this)},set:function(i){switch(this.nodeType){case F:case X:for(;this.firstChild;)this.removeChild(this.firstChild);(i||String(i))&&this.appendChild(this.ownerDocument.createTextNode(i));break;default:this.data=i,this.value=i,this.nodeValue=i}}}),R=function(i,s,p){i["$$"+s]=p}}}catch{}return Xt.Node=_,Xt.DOMException=ht,Xt.DOMImplementation=C,Xt.XMLSerializer=Vt,Xt}var ie;function de(){if(ie)return Gt;ie=1;function h(y){this.options=y||{locator:{}}}h.prototype.parseFromString=function(y,$){var X=this.options,J=new mt,j=X.domBuilder||new A,rt=X.errorHandler,bt=X.locator,ft=X.xmlns||{},Ct=/\/x?html?$/.test($),ht=Ct?it.entityMap:{lt:"<",gt:">",amp:"&",quot:'"',apos:"'"};return bt&&j.setDocumentLocator(bt),J.errorHandler=d(rt,j,bt),J.domBuilder=X.domBuilder||j,Ct&&(ft[""]="http://www.w3.org/1999/xhtml"),ft.xml=ft.xml||"http://www.w3.org/XML/1998/namespace",y&&typeof y=="string"?J.parse(y,ft,ht):J.errorHandler.error("invalid doc source"),j.doc};function d(y,$,X){if(!y){if($ instanceof A)return $;y=$}var J={},j=y instanceof Function;X=X||{};function rt(bt){var ft=y[bt];!ft&&j&&(ft=y.length==2?function(Ct){y(bt,Ct)}:y),J[bt]=ft&&function(Ct){ft("[xmldom "+bt+"] "+Ct+F(X))}||function(){}}return rt("warning"),rt("error"),rt("fatalError"),J}function A(){this.cdata=!1}function O(y,$){$.lineNumber=y.lineNumber,$.columnNumber=y.columnNumber}A.prototype={startDocument:function(){this.doc=new St().createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(y,$,X,J){var j=this.doc,rt=j.createElementNS(y,X||$),bt=J.length;W(this,rt),this.currentElement=rt,this.locator&&O(this.locator,rt);for(var ft=0;ft<bt;ft++){var y=J.getURI(ft),Ct=J.getValue(ft),X=J.getQName(ft),ht=j.createAttributeNS(y,X);this.locator&&O(J.getLocator(ft),ht),ht.value=ht.nodeValue=Ct,rt.setAttributeNode(ht)}},endElement:function(y,$,X){var J=this.currentElement;J.tagName,this.currentElement=J.parentNode},startPrefixMapping:function(y,$){},endPrefixMapping:function(y){},processingInstruction:function(y,$){var X=this.doc.createProcessingInstruction(y,$);this.locator&&O(this.locator,X),W(this,X)},ignorableWhitespace:function(y,$,X){},characters:function(y,$,X){if(y=V.apply(this,arguments),y){if(this.cdata)var J=this.doc.createCDATASection(y);else var J=this.doc.createTextNode(y);this.currentElement?this.currentElement.appendChild(J):/^\s*$/.test(y)&&this.doc.appendChild(J),this.locator&&O(this.locator,J)}},skippedEntity:function(y){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(y){(this.locator=y)&&(y.lineNumber=0)},comment:function(y,$,X){y=V.apply(this,arguments);var J=this.doc.createComment(y);this.locator&&O(this.locator,J),W(this,J)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(y,$,X){var J=this.doc.implementation;if(J&&J.createDocumentType){var j=J.createDocumentType(y,$,X);this.locator&&O(this.locator,j),W(this,j)}},warning:function(y){console.warn("[xmldom warning] "+y,F(this.locator))},error:function(y){console.error("[xmldom error] "+y,F(this.locator))},fatalError:function(y){throw new at(y,this.locator)}};function F(y){if(y)return`
2
+ @`+(y.systemId||"")+"#[line:"+y.lineNumber+",col:"+y.columnNumber+"]"}function V(y,$,X){return typeof y=="string"?y.substr($,X):y.length>=$+X||$?new java.lang.String(y,$,X)+"":y}"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(y){A.prototype[y]=function(){return null}});function W(y,$){y.currentElement?y.currentElement.appendChild($):y.doc.appendChild($)}var it=Ee(),pt=me(),mt=pt.XMLReader,at=pt.ParseError,St=Gt.DOMImplementation=ne().DOMImplementation;return Gt.XMLSerializer=ne().XMLSerializer,Gt.DOMParser=h,Gt.__DOMHandler=A,Gt}var xe=de(),Zt={},oe;function Ne(){return oe||(oe=1,(function(h){var d=h;(function(A){var O="__namespace",F=function(t){return t==null},V=function(t){return t===O||Number.isInteger(t)&&t>=1&&t<=11},W=function(t){return t&&V(t.nodeType)&&typeof t.nodeName=="string"};function it(t){var e=Array.prototype.slice,r=t.length,a=function(u,D){return function(){return D.apply(this,u.concat(e.call(arguments)))}},o=function(){var u=e.call(arguments);return u.length<r?a(u,o):t.apply(this,e.apply(arguments,[0,r]))};return o}var pt=function(t,e){for(var r=0;r<e.length;r+=1)t(e[r],r,e)},mt=function(t,e,r){var a=e;return pt(function(o,u){a=t(a,o,u)},r),a},at=function(t,e){var r=new Array(e.length);return pt(function(a,o){r[o]=t(a)},e),r},St=function(t,e){var r=[];return pt(function(a,o){t(a,o)&&r.push(a)},e),r},y=function(t,e){for(var r=0;r<t.length;r+=1)if(t[r]===e)return!0;return!1};function $(t){return function(){return t}}function X(t){return t.toString()}var J=function(t,e){return e.join(t)},j=function(t,e,r){return t+r+e},rt=Array.prototype.concat,bt=function(t,e){var r=new E;r.addArray(t);var a=r.toArray();return e?a.reverse():a},ft=32767;function Ct(t){for(var e=[],r=0;r<t.length;r+=ft){var a=t.slice(r,r+ft);e=rt.apply(e,a)}return e}function ht(t,e){for(var r=Object(t),a=1;a<arguments.length;a++){var o=arguments[a];if(o!=null)for(var u in o)Object.prototype.hasOwnProperty.call(o,u)&&(r[u]=o[u])}return r}var b={ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3,CDATA_SECTION_NODE:4,PROCESSING_INSTRUCTION_NODE:7,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_TYPE_NODE:10,DOCUMENT_FRAGMENT_NODE:11,NAMESPACE_NODE:O};l.prototype=new Object,l.prototype.constructor=l,l.superclass=Object.prototype;function l(){this.init()}l.prototype.init=function(){this.reduceActions=[],this.reduceActions[3]=function(t){return new _(t[0],t[2])},this.reduceActions[5]=function(t){return new H(t[0],t[2])},this.reduceActions[7]=function(t){return new P(t[0],t[2])},this.reduceActions[8]=function(t){return new M(t[0],t[2])},this.reduceActions[10]=function(t){return new k(t[0],t[2])},this.reduceActions[11]=function(t){return new nt(t[0],t[2])},this.reduceActions[12]=function(t){return new Q(t[0],t[2])},this.reduceActions[13]=function(t){return new ut(t[0],t[2])},this.reduceActions[15]=function(t){return new wt(t[0],t[2])},this.reduceActions[16]=function(t){return new lt(t[0],t[2])},this.reduceActions[18]=function(t){return new z(t[0],t[2])},this.reduceActions[19]=function(t){return new vt(t[0],t[2])},this.reduceActions[20]=function(t){return new xt(t[0],t[2])},this.reduceActions[22]=function(t){return new L(t[1])},this.reduceActions[24]=function(t){return new ot(t[0],t[2])},this.reduceActions[25]=function(t){return new q(void 0,void 0,t[0])},this.reduceActions[27]=function(t){return t[0].locationPath=t[2],t[0]},this.reduceActions[28]=function(t){return t[0].locationPath=t[2],t[0].locationPath.steps.unshift(new c(c.DESCENDANTORSELF,g.nodeTest,[])),t[0]},this.reduceActions[29]=function(t){return new q(t[0],[],void 0)},this.reduceActions[30]=function(t){return S.instance_of(t[0],q)?(t[0].filterPredicates==null&&(t[0].filterPredicates=[]),t[0].filterPredicates.push(t[1]),t[0]):new q(t[0],[t[1]],void 0)},this.reduceActions[32]=function(t){return t[1]},this.reduceActions[33]=function(t){return new v(t[0])},this.reduceActions[34]=function(t){return new R(t[0])},this.reduceActions[36]=function(t){return new dt(t[0],[])},this.reduceActions[37]=function(t){return new dt(t[0],t[2])},this.reduceActions[38]=function(t){return[t[0]]},this.reduceActions[39]=function(t){return t[2].unshift(t[0]),t[2]},this.reduceActions[43]=function(t){return new At(!0,[])},this.reduceActions[44]=function(t){return t[1].absolute=!0,t[1]},this.reduceActions[46]=function(t){return new At(!1,[t[0]])},this.reduceActions[47]=function(t){return t[0].steps.push(t[2]),t[0]},this.reduceActions[49]=function(t){return new c(t[0],t[1],[])},this.reduceActions[50]=function(t){return new c(c.CHILD,t[0],[])},this.reduceActions[51]=function(t){return new c(t[0],t[1],t[2])},this.reduceActions[52]=function(t){return new c(c.CHILD,t[0],t[1])},this.reduceActions[54]=function(t){return[t[0]]},this.reduceActions[55]=function(t){return t[1].unshift(t[0]),t[1]},this.reduceActions[56]=function(t){return t[0]=="ancestor"?c.ANCESTOR:t[0]=="ancestor-or-self"?c.ANCESTORORSELF:t[0]=="attribute"?c.ATTRIBUTE:t[0]=="child"?c.CHILD:t[0]=="descendant"?c.DESCENDANT:t[0]=="descendant-or-self"?c.DESCENDANTORSELF:t[0]=="following"?c.FOLLOWING:t[0]=="following-sibling"?c.FOLLOWINGSIBLING:t[0]=="namespace"?c.NAMESPACE:t[0]=="parent"?c.PARENT:t[0]=="preceding"?c.PRECEDING:t[0]=="preceding-sibling"?c.PRECEDINGSIBLING:t[0]=="self"?c.SELF:-1},this.reduceActions[57]=function(t){return c.ATTRIBUTE},this.reduceActions[59]=function(t){return t[0]=="comment"?g.commentTest:t[0]=="text"?g.textTest:t[0]=="processing-instruction"?g.anyPiTest:t[0]=="node"?g.nodeTest:new g(-1,void 0)},this.reduceActions[60]=function(t){return new g.PITest(t[2])},this.reduceActions[61]=function(t){return t[1]},this.reduceActions[63]=function(t){return t[1].absolute=!0,t[1].steps.unshift(new c(c.DESCENDANTORSELF,g.nodeTest,[])),t[1]},this.reduceActions[64]=function(t){return t[0].steps.push(new c(c.DESCENDANTORSELF,g.nodeTest,[])),t[0].steps.push(t[2]),t[0]},this.reduceActions[65]=function(t){return new c(c.SELF,g.nodeTest,[])},this.reduceActions[66]=function(t){return new c(c.PARENT,g.nodeTest,[])},this.reduceActions[67]=function(t){return new Ot(t[1])},this.reduceActions[68]=function(t){return g.nameTestAny},this.reduceActions[69]=function(t){return new g.NameTestPrefixAny(t[0].split(":")[0])},this.reduceActions[70]=function(t){return new g.NameTestQName(t[0])}},l.actionTable=[" s s sssssssss s ss s ss"," s ","r rrrrrrrrr rrrrrrr rr r "," rrrrr "," s s sssssssss s ss s ss","rs rrrrrrrr s sssssrrrrrr rrs rs "," s s sssssssss s ss s ss"," s "," s ","r rrrrrrrrr rrrrrrr rr rr ","r rrrrrrrrr rrrrrrr rr rr ","r rrrrrrrrr rrrrrrr rr rr ","r rrrrrrrrr rrrrrrr rr rr ","r rrrrrrrrr rrrrrrr rr rr "," s "," s "," s s sssss s s ","r rrrrrrrrr rrrrrrr rr r ","a ","r s rr r ","r sr rr r ","r s rr s rr r ","r rssrr rss rr r ","r rrrrr rrrss rr r ","r rrrrrsss rrrrr rr r ","r rrrrrrrr rrrrr rr r ","r rrrrrrrr rrrrrs rr r ","r rrrrrrrr rrrrrr rr r ","r rrrrrrrr rrrrrr rr r ","r srrrrrrrr rrrrrrs rr sr ","r srrrrrrrr rrrrrrs rr r ","r rrrrrrrrr rrrrrrr rr rr ","r rrrrrrrrr rrrrrrr rr rr ","r rrrrrrrrr rrrrrrr rr rr ","r rrrrrrrr rrrrrr rr r ","r rrrrrrrr rrrrrr rr r ","r rrrrrrrrr rrrrrrr rr r ","r rrrrrrrrr rrrrrrr rr r "," sssss ","r rrrrrrrrr rrrrrrr rr sr ","r rrrrrrrrr rrrrrrr rr r ","r rrrrrrrrr rrrrrrr rr rr ","r rrrrrrrrr rrrrrrr rr rr "," s ","r srrrrrrrr rrrrrrs rr r ","r rrrrrrrr rrrrr rr r "," s "," s "," rrrrr "," s s sssssssss s sss s ss","r srrrrrrrr rrrrrrs rr r "," s s sssssssss s ss s ss"," s s sssssssss s ss s ss"," s s sssssssss s ss s ss"," s s sssssssss s ss s ss"," s s sssssssss s ss s ss"," s s sssssssss s ss s ss"," s s sssssssss s ss s ss"," s s sssssssss s ss s ss"," s s sssssssss s ss s ss"," s s sssssssss s ss s ss"," s s sssssssss s ss s ss"," s s sssssssss s ss s ss"," s s sssssssss s ss s ss"," s s sssssssss ss s ss"," s s sssssssss s ss s ss"," s s sssss s s "," s s sssss s s ","r rrrrrrrrr rrrrrrr rr rr "," s s sssss s s "," s s sssss s s ","r rrrrrrrrr rrrrrrr rr sr ","r rrrrrrrrr rrrrrrr rr sr ","r rrrrrrrrr rrrrrrr rr r ","r rrrrrrrrr rrrrrrr rr rr "," s ","r rrrrrrrrr rrrrrrr rr rr ","r rrrrrrrrr rrrrrrr rr rr "," rr "," s "," rs ","r sr rr r ","r s rr s rr r ","r rssrr rss rr r ","r rssrr rss rr r ","r rrrrr rrrss rr r ","r rrrrr rrrss rr r ","r rrrrr rrrss rr r ","r rrrrr rrrss rr r ","r rrrrrsss rrrrr rr r ","r rrrrrsss rrrrr rr r ","r rrrrrrrr rrrrr rr r ","r rrrrrrrr rrrrr rr r ","r rrrrrrrr rrrrr rr r ","r rrrrrrrr rrrrrr rr r "," r "," s ","r srrrrrrrr rrrrrrs rr r ","r srrrrrrrr rrrrrrs rr r ","r rrrrrrrrr rrrrrrr rr r ","r rrrrrrrrr rrrrrrr rr r ","r rrrrrrrrr rrrrrrr rr r ","r rrrrrrrrr rrrrrrr rr r ","r rrrrrrrrr rrrrrrr rr rr ","r rrrrrrrrr rrrrrrr rr rr "," s s sssssssss s ss s ss","r rrrrrrrrr rrrrrrr rr rr "," r "],l.actionTableNumber=[` 1 0 /.-,+*)(' & %$ # "!`," J ","a aaaaaaaaa aaaaaaa aa a "," YYYYY ",` 1 0 /.-,+*)(' & %$ # "!`,`K1 KKKKKKKK . +*)('KKKKKK KK# K" `,` 1 0 /.-,+*)(' & %$ # "!`," N "," O ","e eeeeeeeee eeeeeee ee ee ","f fffffffff fffffff ff ff ","d ddddddddd ddddddd dd dd ","B BBBBBBBBB BBBBBBB BB BB ","A AAAAAAAAA AAAAAAA AA AA "," P "," Q ",` 1 . +*)(' # " `,"b bbbbbbbbb bbbbbbb bb b "," ","! S !! ! ",'" T" "" " ',"$ V $$ U $$ $ ","& &ZY&& &XW && & ",") ))))) )))\\[ )) ) ",". ....._^] ..... .. . ","1 11111111 11111 11 1 ","5 55555555 55555` 55 5 ","7 77777777 777777 77 7 ","9 99999999 999999 99 9 ",": c:::::::: ::::::b :: a: ","I fIIIIIIII IIIIIIe II I ","= ========= ======= == == ","? ????????? ??????? ?? ?? ","C CCCCCCCCC CCCCCCC CC CC ","J JJJJJJJJ JJJJJJ JJ J ","M MMMMMMMM MMMMMM MM M ","N NNNNNNNNN NNNNNNN NN N ","P PPPPPPPPP PPPPPPP PP P "," +*)(' ","R RRRRRRRRR RRRRRRR RR aR ","U UUUUUUUUU UUUUUUU UU U ","Z ZZZZZZZZZ ZZZZZZZ ZZ ZZ ","c ccccccccc ccccccc cc cc "," j ","L fLLLLLLLL LLLLLLe LL L ","6 66666666 66666 66 6 "," k "," l "," XXXXX ",` 1 0 /.-,+*)(' & %$m # "!`,"_ f________ ______e __ _ ",` 1 0 /.-,+*)(' & %$ # "!`,` 1 0 /.-,+*)(' & %$ # "!`,` 1 0 /.-,+*)(' & %$ # "!`,` 1 0 /.-,+*)(' & %$ # "!`,` 1 0 /.-,+*)(' & %$ # "!`,` 1 0 /.-,+*)(' & %$ # "!`,` 1 0 /.-,+*)(' & %$ # "!`,` 1 0 /.-,+*)(' & %$ # "!`,` 1 0 /.-,+*)(' & %$ # "!`,` 1 0 /.-,+*)(' & %$ # "!`,` 1 0 /.-,+*)(' & %$ # "!`,` 1 0 /.-,+*)(' & %$ # "!`,` 1 0 /.-,+*)(' & %$ # "!`,` 1 0 /.-,+*)(' %$ # "!`,` 1 0 /.-,+*)(' & %$ # "!`,` 1 . +*)(' # " `,` 1 . +*)(' # " `,"> >>>>>>>>> >>>>>>> >> >> ",` 1 . +*)(' # " `,` 1 . +*)(' # " `,"Q QQQQQQQQQ QQQQQQQ QQ aQ ","V VVVVVVVVV VVVVVVV VV aV ","T TTTTTTTTT TTTTTTT TT T ","@ @@@@@@@@@ @@@@@@@ @@ @@ "," ‡ ","[ [[[[[[[[[ [[[[[[[ [[ [[ ","D DDDDDDDDD DDDDDDD DD DD "," HH "," ˆ "," F‰ ","# T# ## # ","% V %% U %% % ","' 'ZY'' 'XW '' ' ","( (ZY(( (XW (( ( ","+ +++++ +++\\[ ++ + ","* ***** ***\\[ ** * ","- ----- ---\\[ -- - ",", ,,,,, ,,,\\[ ,, , ","0 00000_^] 00000 00 0 ","/ /////_^] ///// // / ","2 22222222 22222 22 2 ","3 33333333 33333 33 3 ","4 44444444 44444 44 4 ","8 88888888 888888 88 8 "," ^ "," Š ","; f;;;;;;;; ;;;;;;e ;; ; ","< f<<<<<<<< <<<<<<e << < ","O OOOOOOOOO OOOOOOO OO O ","` ````````` ``````` `` ` ","S SSSSSSSSS SSSSSSS SS S ","W WWWWWWWWW WWWWWWW WW W ","\\ \\\\\\\\\\\\\\\\\\ \\\\\\\\\\\\\\ \\\\ \\\\ ","E EEEEEEEEE EEEEEEE EE EE ",` 1 0 /.-,+*)(' & %$ # "!`,"] ]]]]]]]]] ]]]]]]] ]] ]] "," G "],l.gotoTable=["3456789:;<=>?@ AB CDEFGH IJ "," "," "," ","L456789:;<=>?@ AB CDEFGH IJ "," M EFGH IJ "," N;<=>?@ AB CDEFGH IJ "," "," "," "," "," "," "," "," "," "," S EFGH IJ "," "," "," "," "," "," "," "," "," "," "," "," "," e "," "," "," "," "," "," "," "," "," h J "," i j "," "," "," "," "," "," "," "," "," ","o456789:;<=>?@ ABpqCDEFGH IJ "," "," r6789:;<=>?@ AB CDEFGH IJ "," s789:;<=>?@ AB CDEFGH IJ "," t89:;<=>?@ AB CDEFGH IJ "," u89:;<=>?@ AB CDEFGH IJ "," v9:;<=>?@ AB CDEFGH IJ "," w9:;<=>?@ AB CDEFGH IJ "," x9:;<=>?@ AB CDEFGH IJ "," y9:;<=>?@ AB CDEFGH IJ "," z:;<=>?@ AB CDEFGH IJ "," {:;<=>?@ AB CDEFGH IJ "," |;<=>?@ AB CDEFGH IJ "," };<=>?@ AB CDEFGH IJ "," ~;<=>?@ AB CDEFGH IJ "," =>?@ AB CDEFGH IJ ","€456789:;<=>?@ AB CDEFGH IJ"," ‚ EFGH IJ "," ƒ EFGH IJ "," "," „ GH IJ "," … GH IJ "," i † "," i ‡ "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," ","o456789:;<=>?@ ABŒqCDEFGH IJ "," "," "],l.productions=[[1,1,2],[2,1,3],[3,1,4],[3,3,3,-9,4],[4,1,5],[4,3,4,-8,5],[5,1,6],[5,3,5,-22,6],[5,3,5,-5,6],[6,1,7],[6,3,6,-23,7],[6,3,6,-24,7],[6,3,6,-6,7],[6,3,6,-7,7],[7,1,8],[7,3,7,-25,8],[7,3,7,-26,8],[8,1,9],[8,3,8,-12,9],[8,3,8,-11,9],[8,3,8,-10,9],[9,1,10],[9,2,-26,9],[10,1,11],[10,3,10,-27,11],[11,1,12],[11,1,13],[11,3,13,-28,14],[11,3,13,-4,14],[13,1,15],[13,2,13,16],[15,1,17],[15,3,-29,2,-30],[15,1,-15],[15,1,-16],[15,1,18],[18,3,-13,-29,-30],[18,4,-13,-29,19,-30],[19,1,20],[19,3,20,-31,19],[20,1,2],[12,1,14],[12,1,21],[21,1,-28],[21,2,-28,14],[21,1,22],[14,1,23],[14,3,14,-28,23],[14,1,24],[23,2,25,26],[23,1,26],[23,3,25,26,27],[23,2,26,27],[23,1,28],[27,1,16],[27,2,16,27],[25,2,-14,-3],[25,1,-32],[26,1,29],[26,3,-20,-29,-30],[26,4,-21,-29,-15,-30],[16,3,-33,30,-34],[30,1,2],[22,2,-4,14],[24,3,14,-4,23],[28,1,-35],[28,1,-2],[17,2,-36,-18],[29,1,-17],[29,1,-19],[29,1,-18]],l.DOUBLEDOT=2,l.DOUBLECOLON=3,l.DOUBLESLASH=4,l.NOTEQUAL=5,l.LESSTHANOREQUAL=6,l.GREATERTHANOREQUAL=7,l.AND=8,l.OR=9,l.MOD=10,l.DIV=11,l.MULTIPLYOPERATOR=12,l.FUNCTIONNAME=13,l.AXISNAME=14,l.LITERAL=15,l.NUMBER=16,l.ASTERISKNAMETEST=17,l.QNAME=18,l.NCNAMECOLONASTERISK=19,l.NODETYPE=20,l.PROCESSINGINSTRUCTIONWITHLITERAL=21,l.EQUALS=22,l.LESSTHAN=23,l.GREATERTHAN=24,l.PLUS=25,l.MINUS=26,l.BAR=27,l.SLASH=28,l.LEFTPARENTHESIS=29,l.RIGHTPARENTHESIS=30,l.COMMA=31,l.AT=32,l.LEFTBRACKET=33,l.RIGHTBRACKET=34,l.DOT=35,l.DOLLAR=36,l.prototype.tokenize=function(t){for(var e=[],r=[],a=t+"\0",o=0,u=a.charAt(o++);;){for(;u==" "||u==" "||u=="\r"||u==`
3
+ `;)u=a.charAt(o++);if(u=="\0"||o>=a.length)break;if(u=="("){e.push(l.LEFTPARENTHESIS),r.push(u),u=a.charAt(o++);continue}if(u==")"){e.push(l.RIGHTPARENTHESIS),r.push(u),u=a.charAt(o++);continue}if(u=="["){e.push(l.LEFTBRACKET),r.push(u),u=a.charAt(o++);continue}if(u=="]"){e.push(l.RIGHTBRACKET),r.push(u),u=a.charAt(o++);continue}if(u=="@"){e.push(l.AT),r.push(u),u=a.charAt(o++);continue}if(u==","){e.push(l.COMMA),r.push(u),u=a.charAt(o++);continue}if(u=="|"){e.push(l.BAR),r.push(u),u=a.charAt(o++);continue}if(u=="+"){e.push(l.PLUS),r.push(u),u=a.charAt(o++);continue}if(u=="-"){e.push(l.MINUS),r.push(u),u=a.charAt(o++);continue}if(u=="="){e.push(l.EQUALS),r.push(u),u=a.charAt(o++);continue}if(u=="$"){e.push(l.DOLLAR),r.push(u),u=a.charAt(o++);continue}if(u=="."){if(u=a.charAt(o++),u=="."){e.push(l.DOUBLEDOT),r.push(".."),u=a.charAt(o++);continue}if(u>="0"&&u<="9"){var D="."+u;for(u=a.charAt(o++);u>="0"&&u<="9";)D+=u,u=a.charAt(o++);e.push(l.NUMBER),r.push(D);continue}e.push(l.DOT),r.push(".");continue}if(u=="'"||u=='"'){for(var Z=u,tt="";o<a.length&&(u=a.charAt(o))!==Z;)tt+=u,o+=1;if(u!==Z)throw _t.fromMessage("Unterminated string literal: "+Z+tt);o+=1,e.push(l.LITERAL),r.push(tt),u=a.charAt(o++);continue}if(u>="0"&&u<="9"){var D=u;for(u=a.charAt(o++);u>="0"&&u<="9";)D+=u,u=a.charAt(o++);if(u=="."&&a.charAt(o)>="0"&&a.charAt(o)<="9")for(D+=u,D+=a.charAt(o++),u=a.charAt(o++);u>="0"&&u<="9";)D+=u,u=a.charAt(o++);e.push(l.NUMBER),r.push(D);continue}if(u=="*"){if(e.length>0){var w=e[e.length-1];if(w!=l.AT&&w!=l.DOUBLECOLON&&w!=l.LEFTPARENTHESIS&&w!=l.LEFTBRACKET&&w!=l.AND&&w!=l.OR&&w!=l.MOD&&w!=l.DIV&&w!=l.MULTIPLYOPERATOR&&w!=l.SLASH&&w!=l.DOUBLESLASH&&w!=l.BAR&&w!=l.PLUS&&w!=l.MINUS&&w!=l.EQUALS&&w!=l.NOTEQUAL&&w!=l.LESSTHAN&&w!=l.LESSTHANOREQUAL&&w!=l.GREATERTHAN&&w!=l.GREATERTHANOREQUAL){e.push(l.MULTIPLYOPERATOR),r.push(u),u=a.charAt(o++);continue}}e.push(l.ASTERISKNAMETEST),r.push(u),u=a.charAt(o++);continue}if(u==":"&&a.charAt(o)==":"){e.push(l.DOUBLECOLON),r.push("::"),o++,u=a.charAt(o++);continue}if(u=="/"){if(u=a.charAt(o++),u=="/"){e.push(l.DOUBLESLASH),r.push("//"),u=a.charAt(o++);continue}e.push(l.SLASH),r.push("/");continue}if(u=="!"&&a.charAt(o)=="="){e.push(l.NOTEQUAL),r.push("!="),o++,u=a.charAt(o++);continue}if(u=="<"){if(a.charAt(o)=="="){e.push(l.LESSTHANOREQUAL),r.push("<="),o++,u=a.charAt(o++);continue}e.push(l.LESSTHAN),r.push("<"),u=a.charAt(o++);continue}if(u==">"){if(a.charAt(o)=="="){e.push(l.GREATERTHANOREQUAL),r.push(">="),o++,u=a.charAt(o++);continue}e.push(l.GREATERTHAN),r.push(">"),u=a.charAt(o++);continue}if(u=="_"||S.isLetter(u.charCodeAt(0))){var B=u;for(u=a.charAt(o++);S.isNCNameChar(u.charCodeAt(0));)B+=u,u=a.charAt(o++);if(e.length>0){var w=e[e.length-1];if(w!=l.AT&&w!=l.DOUBLECOLON&&w!=l.LEFTPARENTHESIS&&w!=l.LEFTBRACKET&&w!=l.AND&&w!=l.OR&&w!=l.MOD&&w!=l.DIV&&w!=l.MULTIPLYOPERATOR&&w!=l.SLASH&&w!=l.DOUBLESLASH&&w!=l.BAR&&w!=l.PLUS&&w!=l.MINUS&&w!=l.EQUALS&&w!=l.NOTEQUAL&&w!=l.LESSTHAN&&w!=l.LESSTHANOREQUAL&&w!=l.GREATERTHAN&&w!=l.GREATERTHANOREQUAL){if(B=="and"){e.push(l.AND),r.push(B);continue}if(B=="or"){e.push(l.OR),r.push(B);continue}if(B=="mod"){e.push(l.MOD),r.push(B);continue}if(B=="div"){e.push(l.DIV),r.push(B);continue}}}if(u==":"){if(a.charAt(o)=="*"){e.push(l.NCNAMECOLONASTERISK),r.push(B+":*"),o++,u=a.charAt(o++);continue}if(a.charAt(o)=="_"||S.isLetter(a.charCodeAt(o))){for(B+=":",u=a.charAt(o++);S.isNCNameChar(u.charCodeAt(0));)B+=u,u=a.charAt(o++);if(u=="("){e.push(l.FUNCTIONNAME),r.push(B);continue}e.push(l.QNAME),r.push(B);continue}if(a.charAt(o)==":"){e.push(l.AXISNAME),r.push(B);continue}}if(u=="("){if(B=="comment"||B=="text"||B=="node"){e.push(l.NODETYPE),r.push(B);continue}if(B=="processing-instruction"){a.charAt(o)==")"?e.push(l.NODETYPE):e.push(l.PROCESSINGINSTRUCTIONWITHLITERAL),r.push(B);continue}e.push(l.FUNCTIONNAME),r.push(B);continue}e.push(l.QNAME),r.push(B);continue}throw new Error("Unexpected character "+u)}return e.push(1),r.push("[EOF]"),[e,r]},l.SHIFT="s",l.REDUCE="r",l.ACCEPT="a",l.prototype.parse=function(tt){if(!tt)throw new Error("XPath expression unspecified.");if(typeof tt!="string")throw new Error("XPath expression must be a string.");var e,r,a=this.tokenize(tt);if(a!=null){e=a[0],r=a[1];var o=0,u=[],D=[],Z=[],tt,w,B;for(u.push(0),D.push(1),Z.push("_S"),w=e[o],B=r[o++];;)switch(tt=u[u.length-1],l.actionTable[tt].charAt(w-1)){case l.SHIFT:D.push(-w),Z.push(B),u.push(l.actionTableNumber[tt].charCodeAt(w-1)-32),w=e[o],B=r[o++];break;case l.REDUCE:for(var Lt=l.productions[l.actionTableNumber[tt].charCodeAt(w-1)-32][1],kt=[],jt=0;jt<Lt;jt++)D.pop(),kt.unshift(Z.pop()),u.pop();var qt=u[u.length-1];D.push(l.productions[l.actionTableNumber[tt].charCodeAt(w-1)-32][0]),this.reduceActions[l.actionTableNumber[tt].charCodeAt(w-1)-32]==null?Z.push(kt[0]):Z.push(this.reduceActions[l.actionTableNumber[tt].charCodeAt(w-1)-32](kt)),u.push(l.gotoTable[qt].charCodeAt(l.productions[l.actionTableNumber[tt].charCodeAt(w-1)-32][0]-2)-33);break;case l.ACCEPT:return new f(Z.pop());default:throw new Error("XPath parse error")}}},f.prototype=new Object,f.prototype.constructor=f,f.superclass=Object.prototype;function f(t){this.expression=t}f.prototype.toString=function(){return this.expression.toString()};function x(t,e,r){e in t||(t[e]=r)}f.prototype.evaluate=function(t){var e=t.expressionContextNode;if(!(F(e)||W(e)))throw new Error("Context node does not appear to be a valid DOM node.");return t.contextNode=t.expressionContextNode,t.contextSize=1,t.contextPosition=1,t.isHtml&&(x(t,"caseInsensitive",!0),x(t,"allowAnyNamespaceForNoPrefix",!0)),x(t,"caseInsensitive",!1),this.expression.evaluate(t)},f.XML_NAMESPACE_URI="http://www.w3.org/XML/1998/namespace",f.XMLNS_NAMESPACE_URI="http://www.w3.org/2000/xmlns/",N.prototype=new Object,N.prototype.constructor=N,N.superclass=Object.prototype;function N(){}N.prototype.init=function(){},N.prototype.toString=function(){return"<Expression>"},N.prototype.evaluate=function(t){throw new Error("Could not evaluate expression.")},U.prototype=new N,U.prototype.constructor=U,U.superclass=N.prototype;function U(t){arguments.length>0&&this.init(t)}U.prototype.init=function(t){this.rhs=t},L.prototype=new U,L.prototype.constructor=L,L.superclass=U.prototype;function L(t){arguments.length>0&&this.init(t)}L.prototype.init=function(t){L.superclass.init.call(this,t)},L.prototype.evaluate=function(t){return this.rhs.evaluate(t).number().negate()},L.prototype.toString=function(){return"-"+this.rhs.toString()},C.prototype=new N,C.prototype.constructor=C,C.superclass=N.prototype;function C(t,e){arguments.length>0&&this.init(t,e)}C.prototype.init=function(t,e){this.lhs=t,this.rhs=e},_.prototype=new C,_.prototype.constructor=_,_.superclass=C.prototype;function _(t,e){arguments.length>0&&this.init(t,e)}_.prototype.init=function(t,e){_.superclass.init.call(this,t,e)},_.prototype.toString=function(){return"("+this.lhs.toString()+" or "+this.rhs.toString()+")"},_.prototype.evaluate=function(t){var e=this.lhs.evaluate(t).bool();return e.booleanValue()?e:this.rhs.evaluate(t).bool()},H.prototype=new C,H.prototype.constructor=H,H.superclass=C.prototype;function H(t,e){arguments.length>0&&this.init(t,e)}H.prototype.init=function(t,e){H.superclass.init.call(this,t,e)},H.prototype.toString=function(){return"("+this.lhs.toString()+" and "+this.rhs.toString()+")"},H.prototype.evaluate=function(t){var e=this.lhs.evaluate(t).bool();return e.booleanValue()?this.rhs.evaluate(t).bool():e},P.prototype=new C,P.prototype.constructor=P,P.superclass=C.prototype;function P(t,e){arguments.length>0&&this.init(t,e)}P.prototype.init=function(t,e){P.superclass.init.call(this,t,e)},P.prototype.toString=function(){return"("+this.lhs.toString()+" = "+this.rhs.toString()+")"},P.prototype.evaluate=function(t){return this.lhs.evaluate(t).equals(this.rhs.evaluate(t))},M.prototype=new C,M.prototype.constructor=M,M.superclass=C.prototype;function M(t,e){arguments.length>0&&this.init(t,e)}M.prototype.init=function(t,e){M.superclass.init.call(this,t,e)},M.prototype.toString=function(){return"("+this.lhs.toString()+" != "+this.rhs.toString()+")"},M.prototype.evaluate=function(t){return this.lhs.evaluate(t).notequal(this.rhs.evaluate(t))},k.prototype=new C,k.prototype.constructor=k,k.superclass=C.prototype;function k(t,e){arguments.length>0&&this.init(t,e)}k.prototype.init=function(t,e){k.superclass.init.call(this,t,e)},k.prototype.evaluate=function(t){return this.lhs.evaluate(t).lessthan(this.rhs.evaluate(t))},k.prototype.toString=function(){return"("+this.lhs.toString()+" < "+this.rhs.toString()+")"},nt.prototype=new C,nt.prototype.constructor=nt,nt.superclass=C.prototype;function nt(t,e){arguments.length>0&&this.init(t,e)}nt.prototype.init=function(t,e){nt.superclass.init.call(this,t,e)},nt.prototype.evaluate=function(t){return this.lhs.evaluate(t).greaterthan(this.rhs.evaluate(t))},nt.prototype.toString=function(){return"("+this.lhs.toString()+" > "+this.rhs.toString()+")"},Q.prototype=new C,Q.prototype.constructor=Q,Q.superclass=C.prototype;function Q(t,e){arguments.length>0&&this.init(t,e)}Q.prototype.init=function(t,e){Q.superclass.init.call(this,t,e)},Q.prototype.evaluate=function(t){return this.lhs.evaluate(t).lessthanorequal(this.rhs.evaluate(t))},Q.prototype.toString=function(){return"("+this.lhs.toString()+" <= "+this.rhs.toString()+")"},ut.prototype=new C,ut.prototype.constructor=ut,ut.superclass=C.prototype;function ut(t,e){arguments.length>0&&this.init(t,e)}ut.prototype.init=function(t,e){ut.superclass.init.call(this,t,e)},ut.prototype.evaluate=function(t){return this.lhs.evaluate(t).greaterthanorequal(this.rhs.evaluate(t))},ut.prototype.toString=function(){return"("+this.lhs.toString()+" >= "+this.rhs.toString()+")"},wt.prototype=new C,wt.prototype.constructor=wt,wt.superclass=C.prototype;function wt(t,e){arguments.length>0&&this.init(t,e)}wt.prototype.init=function(t,e){wt.superclass.init.call(this,t,e)},wt.prototype.evaluate=function(t){return this.lhs.evaluate(t).number().plus(this.rhs.evaluate(t).number())},wt.prototype.toString=function(){return"("+this.lhs.toString()+" + "+this.rhs.toString()+")"},lt.prototype=new C,lt.prototype.constructor=lt,lt.superclass=C.prototype;function lt(t,e){arguments.length>0&&this.init(t,e)}lt.prototype.init=function(t,e){lt.superclass.init.call(this,t,e)},lt.prototype.evaluate=function(t){return this.lhs.evaluate(t).number().minus(this.rhs.evaluate(t).number())},lt.prototype.toString=function(){return"("+this.lhs.toString()+" - "+this.rhs.toString()+")"},z.prototype=new C,z.prototype.constructor=z,z.superclass=C.prototype;function z(t,e){arguments.length>0&&this.init(t,e)}z.prototype.init=function(t,e){z.superclass.init.call(this,t,e)},z.prototype.evaluate=function(t){return this.lhs.evaluate(t).number().multiply(this.rhs.evaluate(t).number())},z.prototype.toString=function(){return"("+this.lhs.toString()+" * "+this.rhs.toString()+")"},vt.prototype=new C,vt.prototype.constructor=vt,vt.superclass=C.prototype;function vt(t,e){arguments.length>0&&this.init(t,e)}vt.prototype.init=function(t,e){vt.superclass.init.call(this,t,e)},vt.prototype.evaluate=function(t){return this.lhs.evaluate(t).number().div(this.rhs.evaluate(t).number())},vt.prototype.toString=function(){return"("+this.lhs.toString()+" div "+this.rhs.toString()+")"},xt.prototype=new C,xt.prototype.constructor=xt,xt.superclass=C.prototype;function xt(t,e){arguments.length>0&&this.init(t,e)}xt.prototype.init=function(t,e){xt.superclass.init.call(this,t,e)},xt.prototype.evaluate=function(t){return this.lhs.evaluate(t).number().mod(this.rhs.evaluate(t).number())},xt.prototype.toString=function(){return"("+this.lhs.toString()+" mod "+this.rhs.toString()+")"},ot.prototype=new C,ot.prototype.constructor=ot,ot.superclass=C.prototype;function ot(t,e){arguments.length>0&&this.init(t,e)}ot.prototype.init=function(t,e){ot.superclass.init.call(this,t,e)},ot.prototype.evaluate=function(t){return this.lhs.evaluate(t).nodeset().union(this.rhs.evaluate(t).nodeset())},ot.prototype.toString=function(){return at(X,[this.lhs,this.rhs]).join(" | ")},q.prototype=new N,q.prototype.constructor=q,q.superclass=N.prototype;function q(t,e,r){arguments.length>0&&this.init(t,e,r)}q.prototype.init=function(t,e,r){q.superclass.init.call(this),this.filter=t,this.filterPredicates=e,this.locationPath=r};function Mt(t){for(;t&&t.parentNode;)t=t.parentNode;return t}var Ft=function(t,e,r,a){if(t.length===0)return r;var o=e.extend({});return mt(function(u,D){return o.contextSize=u.length,St(function(Z,tt){return o.contextNode=Z,o.contextPosition=tt+1,q.predicateMatches(D,o)},u)},bt(r,a),t)};q.getRoot=function(t,e){var r=e[0];if(r&&r.nodeType===b.DOCUMENT_NODE)return r;if(t.virtualRoot)return t.virtualRoot;if(!r)throw new Error("Context node not found when determining document root.");var a=r.ownerDocument;if(a)return a;for(var o=r;o.parentNode!=null;)o=o.parentNode;return o};var Ht=function(t){var e=String(t.name);return e==="xmlns"?"":e.substring(0,6)==="xmlns:"?e.substring(6,e.length):null};q.applyStep=function(t,e,r){if(!r)throw new Error("Context node not found when evaluating XPath step: "+t);var a=[];switch(e.contextNode=r,t.axis){case c.ANCESTOR:if(e.contextNode===e.virtualRoot)break;var o;for(e.contextNode.nodeType==b.ATTRIBUTE_NODE?o=q.getOwnerElement(e.contextNode):o=e.contextNode.parentNode;o!=null&&(t.nodeTest.matches(o,e)&&a.push(o),o!==e.virtualRoot);)o=o.parentNode;break;case c.ANCESTORORSELF:for(var o=e.contextNode;o!=null&&(t.nodeTest.matches(o,e)&&a.push(o),o!==e.virtualRoot);o=o.nodeType==b.ATTRIBUTE_NODE?q.getOwnerElement(o):o.parentNode);break;case c.ATTRIBUTE:var u=e.contextNode.attributes;if(u!=null)for(var D=0;D<u.length;D++){var o=u.item(D);t.nodeTest.matches(o,e)&&a.push(o)}break;case c.CHILD:for(var o=e.contextNode.firstChild;o!=null;o=o.nextSibling)t.nodeTest.matches(o,e)&&a.push(o);break;case c.DESCENDANT:for(var B=[e.contextNode.firstChild];B.length>0;)for(var o=B.pop();o!=null;)t.nodeTest.matches(o,e)&&a.push(o),o.firstChild!=null?(B.push(o.nextSibling),o=o.firstChild):o=o.nextSibling;break;case c.DESCENDANTORSELF:t.nodeTest.matches(e.contextNode,e)&&a.push(e.contextNode);for(var B=[e.contextNode.firstChild];B.length>0;)for(var o=B.pop();o!=null;)t.nodeTest.matches(o,e)&&a.push(o),o.firstChild!=null?(B.push(o.nextSibling),o=o.firstChild):o=o.nextSibling;break;case c.FOLLOWING:if(e.contextNode===e.virtualRoot)break;var B=[];e.contextNode.firstChild!=null?B.unshift(e.contextNode.firstChild):B.unshift(e.contextNode.nextSibling);for(var o=e.contextNode.parentNode;o!=null&&o.nodeType!=b.DOCUMENT_NODE&&o!==e.virtualRoot;o=o.parentNode)B.unshift(o.nextSibling);do for(var o=B.pop();o!=null;)t.nodeTest.matches(o,e)&&a.push(o),o.firstChild!=null?(B.push(o.nextSibling),o=o.firstChild):o=o.nextSibling;while(B.length>0);break;case c.FOLLOWINGSIBLING:if(e.contextNode===e.virtualRoot)break;for(var o=e.contextNode.nextSibling;o!=null;o=o.nextSibling)t.nodeTest.matches(o,e)&&a.push(o);break;case c.NAMESPACE:var Z={};if(e.contextNode.nodeType==b.ELEMENT_NODE){Z.xml=new ct("xml",null,f.XML_NAMESPACE_URI,e.contextNode);for(var o=e.contextNode;o!=null&&o.nodeType==b.ELEMENT_NODE;o=o.parentNode)for(var D=0;D<o.attributes.length;D++){var tt=o.attributes.item(D),w=Ht(tt);w!=null&&Z[w]==null&&(Z[w]=new ct(w,tt,tt.value,e.contextNode))}for(var w in Z){var r=Z[w];t.nodeTest.matches(r,e)&&a.push(r)}}break;case c.PARENT:o=null,e.contextNode!==e.virtualRoot&&(e.contextNode.nodeType==b.ATTRIBUTE_NODE?o=q.getOwnerElement(e.contextNode):o=e.contextNode.parentNode),o!=null&&t.nodeTest.matches(o,e)&&a.push(o);break;case c.PRECEDING:var B;e.virtualRoot!=null?B=[e.virtualRoot]:B=[Mt(e.contextNode)];t:for(;B.length>0;)for(var o=B.pop();o!=null;){if(o==e.contextNode)break t;t.nodeTest.matches(o,e)&&a.unshift(o),o.firstChild!=null?(B.push(o.nextSibling),o=o.firstChild):o=o.nextSibling}break;case c.PRECEDINGSIBLING:if(e.contextNode===e.virtualRoot)break;for(var o=e.contextNode.previousSibling;o!=null;o=o.previousSibling)t.nodeTest.matches(o,e)&&a.push(o);break;case c.SELF:t.nodeTest.matches(e.contextNode,e)&&a.push(e.contextNode);break}return a};function Yt(t,e,r){return Ft(t.predicates,e,q.applyStep(t,e,r),y(Vt,t.axis))}function Nt(t,e,r){return Ct(at(Yt.bind(null,r,t),e))}q.applySteps=function(t,e,r){return mt(Nt.bind(null,e),r,t)},q.prototype.applyFilter=function(t,e){if(!this.filter)return{nodes:[t.contextNode]};var r=this.filter.evaluate(t);if(!S.instance_of(r,E)){if(this.filterPredicates!=null&&this.filterPredicates.length>0||this.locationPath!=null)throw new Error("Path expression filter must evaluate to a nodeset if predicates or location path are used");return{nonNodes:r}}return{nodes:Ft(this.filterPredicates||[],e,r.toUnsortedArray(),!1)}},q.applyLocationPath=function(t,e,r){if(!t)return r;var a=t.absolute?[q.getRoot(e,r)]:r;return q.applySteps(t.steps,e,a)},q.prototype.evaluate=function(t){var e=ht(new Dt,t),r=this.applyFilter(t,e);if("nonNodes"in r)return r.nonNodes;var a=new E;return a.addArray(q.applyLocationPath(this.locationPath,e,r.nodes)),a},q.predicateMatches=function(t,e){var r=t.evaluate(e);return S.instance_of(r,R)?e.contextPosition===r.numberValue():r.booleanValue()},q.predicateString=function(t){return j("[","]",t.toString())},q.predicatesString=function(t){return J("",at(q.predicateString,t))},q.prototype.toString=function(){if(this.filter!=null){var t=X(this.filter);return S.instance_of(this.filter,v)?j("'","'",t):this.filterPredicates!=null&&this.filterPredicates.length?j("(",")",t)+q.predicatesString(this.filterPredicates):this.locationPath!=null?t+(this.locationPath.absolute?"":"/")+X(this.locationPath):t}return X(this.locationPath)},q.getOwnerElement=function(t){if(t.ownerElement)return t.ownerElement;try{if(t.selectSingleNode)return t.selectSingleNode("..")}catch{}for(var e=t.nodeType==b.DOCUMENT_NODE?t:t.ownerDocument,r=e.getElementsByTagName("*"),a=0;a<r.length;a++)for(var o=r.item(a),u=o.attributes,D=0;D<u.length;D++){var Z=u.item(D);if(Z===t)return o}return null},At.prototype=new Object,At.prototype.constructor=At,At.superclass=Object.prototype;function At(t,e){arguments.length>0&&this.init(t,e)}At.prototype.init=function(t,e){this.absolute=t,this.steps=e},At.prototype.toString=function(){return(this.absolute?"/":"")+at(X,this.steps).join("/")},c.prototype=new Object,c.prototype.constructor=c,c.superclass=Object.prototype;function c(t,e,r){arguments.length>0&&this.init(t,e,r)}c.prototype.init=function(t,e,r){this.axis=t,this.nodeTest=e,this.predicates=r},c.prototype.toString=function(){return c.STEPNAMES[this.axis]+"::"+this.nodeTest.toString()+q.predicatesString(this.predicates)},c.ANCESTOR=0,c.ANCESTORORSELF=1,c.ATTRIBUTE=2,c.CHILD=3,c.DESCENDANT=4,c.DESCENDANTORSELF=5,c.FOLLOWING=6,c.FOLLOWINGSIBLING=7,c.NAMESPACE=8,c.PARENT=9,c.PRECEDING=10,c.PRECEDINGSIBLING=11,c.SELF=12,c.STEPNAMES=mt(function(t,e){return t[e[0]]=e[1],t},{},[[c.ANCESTOR,"ancestor"],[c.ANCESTORORSELF,"ancestor-or-self"],[c.ATTRIBUTE,"attribute"],[c.CHILD,"child"],[c.DESCENDANT,"descendant"],[c.DESCENDANTORSELF,"descendant-or-self"],[c.FOLLOWING,"following"],[c.FOLLOWINGSIBLING,"following-sibling"],[c.NAMESPACE,"namespace"],[c.PARENT,"parent"],[c.PRECEDING,"preceding"],[c.PRECEDINGSIBLING,"preceding-sibling"],[c.SELF,"self"]]);var Vt=[c.ANCESTOR,c.ANCESTORORSELF,c.PARENT,c.PRECEDING,c.PRECEDINGSIBLING];g.prototype=new Object,g.prototype.constructor=g,g.superclass=Object.prototype;function g(t,e){arguments.length>0&&this.init(t,e)}g.prototype.init=function(t,e){this.type=t,this.value=e},g.prototype.toString=function(){return"<unknown nodetest type>"},g.prototype.matches=function(t,e){console.warn("unknown node test type")},g.NAMETESTANY=0,g.NAMETESTPREFIXANY=1,g.NAMETESTQNAME=2,g.COMMENT=3,g.TEXT=4,g.PI=5,g.NODE=6,g.isNodeType=function(t){return function(e){return y(t,e.nodeType)}},g.makeNodeTestType=function(t,e,r){var a=r||function(){};return a.prototype=new g(t),a.prototype.constructor=a,ht(a.prototype,e),a},g.makeNodeTypeTest=function(t,e,r){return new(g.makeNodeTestType(t,{matches:g.isNodeType(e),toString:$(r)}))},g.hasPrefix=function(t){return t.prefix||(t.nodeName||t.tagName).indexOf(":")!==-1},g.isElementOrAttribute=g.isNodeType([1,2]),g.nameSpaceMatches=function(t,e,r){var a=r.namespaceURI||"";if(!t)return!a||e.allowAnyNamespaceForNoPrefix&&!g.hasPrefix(r);var o=e.namespaceResolver.getNamespace(t,e.expressionContextNode);if(o==null)throw new Error("Cannot resolve QName "+t);return o===a},g.localNameMatches=function(t,e,r){var a=r.localName||r.nodeName;return e.caseInsensitive?t.toLowerCase()===a.toLowerCase():t===a},g.NameTestPrefixAny=g.makeNodeTestType(g.NAMETESTPREFIXANY,{matches:function(t,e){return g.isElementOrAttribute(t)&&g.nameSpaceMatches(this.prefix,e,t)},toString:function(){return this.prefix+":*"}},function(e){this.prefix=e}),g.NameTestQName=g.makeNodeTestType(g.NAMETESTQNAME,{matches:function(t,e){return g.isNodeType([b.ELEMENT_NODE,b.ATTRIBUTE_NODE,b.NAMESPACE_NODE])(t)&&g.nameSpaceMatches(this.prefix,e,t)&&g.localNameMatches(this.localName,e,t)},toString:function(){return this.name}},function(e){var r=e.split(":");this.name=e,this.prefix=r.length>1?r[0]:null,this.localName=r[r.length>1?1:0]}),g.PITest=g.makeNodeTestType(g.PI,{matches:function(t,e){return g.isNodeType([b.PROCESSING_INSTRUCTION_NODE])(t)&&(t.target||t.nodeName)===this.name},toString:function(){return j('processing-instruction("','")',this.name)}},function(t){this.name=t}),g.nameTestAny=g.makeNodeTypeTest(g.NAMETESTANY,[b.ELEMENT_NODE,b.ATTRIBUTE_NODE,b.NAMESPACE_NODE],"*"),g.textTest=g.makeNodeTypeTest(g.TEXT,[b.TEXT_NODE,b.CDATA_SECTION_NODE],"text()"),g.commentTest=g.makeNodeTypeTest(g.COMMENT,[b.COMMENT_NODE],"comment()"),g.nodeTest=g.makeNodeTypeTest(g.NODE,[b.ELEMENT_NODE,b.ATTRIBUTE_NODE,b.TEXT_NODE,b.CDATA_SECTION_NODE,b.PROCESSING_INSTRUCTION_NODE,b.COMMENT_NODE,b.DOCUMENT_NODE],"node()"),g.anyPiTest=g.makeNodeTypeTest(g.PI,[b.PROCESSING_INSTRUCTION_NODE],"processing-instruction()"),Ot.prototype=new N,Ot.prototype.constructor=Ot,Ot.superclass=N.prototype;function Ot(t){arguments.length>0&&this.init(t)}Ot.prototype.init=function(t){this.variable=t},Ot.prototype.toString=function(){return"$"+this.variable},Ot.prototype.evaluate=function(t){var e=S.resolveQName(this.variable,t.namespaceResolver,t.contextNode,!1);if(e[0]==null)throw new Error("Cannot resolve QName "+fn);var r=t.variableResolver.getVariable(e[1],e[0]);if(!r)throw _t.fromMessage("Undeclared variable: "+this.toString());return r},dt.prototype=new N,dt.prototype.constructor=dt,dt.superclass=N.prototype;function dt(t,e){arguments.length>0&&this.init(t,e)}dt.prototype.init=function(t,e){this.functionName=t,this.arguments=e},dt.prototype.toString=function(){for(var t=this.functionName+"(",e=0;e<this.arguments.length;e++)e>0&&(t+=", "),t+=this.arguments[e].toString();return t+")"},dt.prototype.evaluate=function(t){var e=st.getFunctionFromContext(this.functionName,t);if(!e)throw new Error("Unknown function "+this.functionName);var r=[t].concat(this.arguments);return e.apply(t.functionResolver.thisArg,r)};var G=new Object;G.equals=function(t,e){return t.equals(e)},G.notequal=function(t,e){return t.notequal(e)},G.lessthan=function(t,e){return t.lessthan(e)},G.greaterthan=function(t,e){return t.greaterthan(e)},G.lessthanorequal=function(t,e){return t.lessthanorequal(e)},G.greaterthanorequal=function(t,e){return t.greaterthanorequal(e)},v.prototype=new N,v.prototype.constructor=v,v.superclass=N.prototype;function v(t){arguments.length>0&&this.init(t)}v.prototype.init=function(t){this.str=String(t)},v.prototype.toString=function(){return this.str},v.prototype.evaluate=function(t){return this},v.prototype.string=function(){return this},v.prototype.number=function(){return new R(this.str)},v.prototype.bool=function(){return new s(this.str)},v.prototype.nodeset=function(){throw new Error("Cannot convert string to nodeset")},v.prototype.stringValue=function(){return this.str},v.prototype.numberValue=function(){return this.number().numberValue()},v.prototype.booleanValue=function(){return this.bool().booleanValue()},v.prototype.equals=function(t){return S.instance_of(t,s)?this.bool().equals(t):S.instance_of(t,R)?this.number().equals(t):S.instance_of(t,E)?t.compareWithString(this,G.equals):new s(this.str==t.str)},v.prototype.notequal=function(t){return S.instance_of(t,s)?this.bool().notequal(t):S.instance_of(t,R)?this.number().notequal(t):S.instance_of(t,E)?t.compareWithString(this,G.notequal):new s(this.str!=t.str)},v.prototype.lessthan=function(t){return this.number().lessthan(t)},v.prototype.greaterthan=function(t){return this.number().greaterthan(t)},v.prototype.lessthanorequal=function(t){return this.number().lessthanorequal(t)},v.prototype.greaterthanorequal=function(t){return this.number().greaterthanorequal(t)},R.prototype=new N,R.prototype.constructor=R,R.superclass=N.prototype;function R(t){arguments.length>0&&this.init(t)}R.prototype.init=function(t){this.num=typeof t=="string"?this.parse(t):Number(t)},R.prototype.numberFormat=/^\s*-?[0-9]*\.?[0-9]+\s*$/,R.prototype.parse=function(t){return this.numberFormat.test(t)?parseFloat(t):Number.NaN};function n(t){for(var e=t.split("e-"),r=e[0].replace(".",""),a=Number(e[1]),o=0;o<a-1;o+=1)r="0"+r;return"0."+r}function i(t){for(var e=t.split("e"),r=e[0].replace(".",""),a=Number(e[1]),o=a+1-r.length,u=0;u<o;u+=1)r+="0";return r}R.prototype.toString=function(){var t=this.num.toString();return t.indexOf("e-")!==-1?n(t):t.indexOf("e")!==-1?i(t):t},R.prototype.evaluate=function(t){return this},R.prototype.string=function(){return new v(this.toString())},R.prototype.number=function(){return this},R.prototype.bool=function(){return new s(this.num)},R.prototype.nodeset=function(){throw new Error("Cannot convert number to nodeset")},R.prototype.stringValue=function(){return this.string().stringValue()},R.prototype.numberValue=function(){return this.num},R.prototype.booleanValue=function(){return this.bool().booleanValue()},R.prototype.negate=function(){return new R(-this.num)},R.prototype.equals=function(t){return S.instance_of(t,s)?this.bool().equals(t):S.instance_of(t,v)?this.equals(t.number()):S.instance_of(t,E)?t.compareWithNumber(this,G.equals):new s(this.num==t.num)},R.prototype.notequal=function(t){return S.instance_of(t,s)?this.bool().notequal(t):S.instance_of(t,v)?this.notequal(t.number()):S.instance_of(t,E)?t.compareWithNumber(this,G.notequal):new s(this.num!=t.num)},R.prototype.lessthan=function(t){return S.instance_of(t,E)?t.compareWithNumber(this,G.greaterthan):S.instance_of(t,s)||S.instance_of(t,v)?this.lessthan(t.number()):new s(this.num<t.num)},R.prototype.greaterthan=function(t){return S.instance_of(t,E)?t.compareWithNumber(this,G.lessthan):S.instance_of(t,s)||S.instance_of(t,v)?this.greaterthan(t.number()):new s(this.num>t.num)},R.prototype.lessthanorequal=function(t){return S.instance_of(t,E)?t.compareWithNumber(this,G.greaterthanorequal):S.instance_of(t,s)||S.instance_of(t,v)?this.lessthanorequal(t.number()):new s(this.num<=t.num)},R.prototype.greaterthanorequal=function(t){return S.instance_of(t,E)?t.compareWithNumber(this,G.lessthanorequal):S.instance_of(t,s)||S.instance_of(t,v)?this.greaterthanorequal(t.number()):new s(this.num>=t.num)},R.prototype.plus=function(t){return new R(this.num+t.num)},R.prototype.minus=function(t){return new R(this.num-t.num)},R.prototype.multiply=function(t){return new R(this.num*t.num)},R.prototype.div=function(t){return new R(this.num/t.num)},R.prototype.mod=function(t){return new R(this.num%t.num)},s.prototype=new N,s.prototype.constructor=s,s.superclass=N.prototype;function s(t){arguments.length>0&&this.init(t)}s.prototype.init=function(t){this.b=!!t},s.prototype.toString=function(){return this.b.toString()},s.prototype.evaluate=function(t){return this},s.prototype.string=function(){return new v(this.b)},s.prototype.number=function(){return new R(this.b)},s.prototype.bool=function(){return this},s.prototype.nodeset=function(){throw new Error("Cannot convert boolean to nodeset")},s.prototype.stringValue=function(){return this.string().stringValue()},s.prototype.numberValue=function(){return this.number().numberValue()},s.prototype.booleanValue=function(){return this.b},s.prototype.not=function(){return new s(!this.b)},s.prototype.equals=function(t){return S.instance_of(t,v)||S.instance_of(t,R)?this.equals(t.bool()):S.instance_of(t,E)?t.compareWithBoolean(this,G.equals):new s(this.b==t.b)},s.prototype.notequal=function(t){return S.instance_of(t,v)||S.instance_of(t,R)?this.notequal(t.bool()):S.instance_of(t,E)?t.compareWithBoolean(this,G.notequal):new s(this.b!=t.b)},s.prototype.lessthan=function(t){return this.number().lessthan(t)},s.prototype.greaterthan=function(t){return this.number().greaterthan(t)},s.prototype.lessthanorequal=function(t){return this.number().lessthanorequal(t)},s.prototype.greaterthanorequal=function(t){return this.number().greaterthanorequal(t)},s.true_=new s(!0),s.false_=new s(!1),p.prototype=new Object,p.prototype.constructor=p,p.superclass=Object.prototype;function p(t){this.init(t)}p.prototype.init=function(t){this.left=null,this.right=null,this.node=t,this.depth=1},p.prototype.balance=function(){var t=this.left==null?0:this.left.depth,e=this.right==null?0:this.right.depth;if(t>e+1){var r=this.left.left==null?0:this.left.left.depth,a=this.left.right==null?0:this.left.right.depth;r<a&&this.left.rotateRR(),this.rotateLL()}else if(t+1<e){var o=this.right.right==null?0:this.right.right.depth,u=this.right.left==null?0:this.right.left.depth;u>o&&this.right.rotateLL(),this.rotateRR()}},p.prototype.rotateLL=function(){var t=this.node,e=this.right;this.node=this.left.node,this.right=this.left,this.left=this.left.left,this.right.left=this.right.right,this.right.right=e,this.right.node=t,this.right.updateInNewLocation(),this.updateInNewLocation()},p.prototype.rotateRR=function(){var t=this.node,e=this.left;this.node=this.right.node,this.left=this.right,this.right=this.right.right,this.left.right=this.left.left,this.left.left=e,this.left.node=t,this.left.updateInNewLocation(),this.updateInNewLocation()},p.prototype.updateInNewLocation=function(){this.getDepthFromChildren()},p.prototype.getDepthFromChildren=function(){this.depth=this.node==null?0:1,this.left!=null&&(this.depth=this.left.depth+1),this.right!=null&&this.depth<=this.right.depth&&(this.depth=this.right.depth+1)};function T(t,e){if(t===e)return 0;if(t.compareDocumentPosition){var r=t.compareDocumentPosition(e);return r&1||r&10?1:r&20?-1:0}for(var a=0,o=0,u=t;u!=null;u=u.parentNode||u.ownerElement)a++;for(var D=e;D!=null;D=D.parentNode||D.ownerElement)o++;if(a>o){for(;a>o;)t=t.parentNode||t.ownerElement,a--;if(t===e)return 1}else if(o>a){for(;o>a;)e=e.parentNode||e.ownerElement,o--;if(t===e)return-1}for(var Z=t.parentNode||t.ownerElement,tt=e.parentNode||e.ownerElement;Z!==tt;)t=Z,e=tt,Z=t.parentNode||t.ownerElement,tt=e.parentNode||e.ownerElement;var w=gt(t),B=gt(e);if(w&&!B)return-1;if(!w&&B)return 1;if(t.isXPathNamespace){if(t.nodeValue===f.XML_NAMESPACE_URI||!e.isXPathNamespace)return-1;if(e.nodeValue===f.XML_NAMESPACE_URI)return 1}else if(e.isXPathNamespace)return 1;if(Z)for(var Lt=w?Z.attributes:Z.childNodes,kt=Lt.length,jt=t.baseNode||t,qt=e.baseNode||e,Qt=0;Qt<kt;Qt+=1){var Kt=Lt[Qt];if(Kt===jt)return-1;if(Kt===qt)return 1}throw new Error("Unexpected: could not determine node order")}p.prototype.add=function(t){if(t===this.node)return!1;var e=T(t,this.node),r=!1;return e==-1?this.left==null?(this.left=new p(t),r=!0):(r=this.left.add(t),r&&this.balance()):e==1&&(this.right==null?(this.right=new p(t),r=!0):(r=this.right.add(t),r&&this.balance())),r&&this.getDepthFromChildren(),r},E.prototype=new N,E.prototype.constructor=E,E.superclass=N.prototype;function E(){this.init()}E.prototype.init=function(){this.tree=null,this.nodes=[],this.size=0},E.prototype.toString=function(){var t=this.first();return t==null?"":this.stringForNode(t)},E.prototype.evaluate=function(t){return this},E.prototype.string=function(){return new v(this.toString())},E.prototype.stringValue=function(){return this.toString()},E.prototype.number=function(){return new R(this.string())},E.prototype.numberValue=function(){return Number(this.string())},E.prototype.bool=function(){return new s(this.booleanValue())},E.prototype.booleanValue=function(){return!!this.size},E.prototype.nodeset=function(){return this},E.prototype.stringForNode=function(t){return t.nodeType==b.DOCUMENT_NODE||t.nodeType==b.ELEMENT_NODE||t.nodeType===b.DOCUMENT_FRAGMENT_NODE?this.stringForContainerNode(t):t.nodeType===b.ATTRIBUTE_NODE?t.value||t.nodeValue:t.isNamespaceNode?t.namespace:t.nodeValue},E.prototype.stringForContainerNode=function(t){for(var e="",r=t.firstChild;r!=null;r=r.nextSibling){var a=r.nodeType;(a===1||a===3||a===4||a===9||a===11)&&(e+=this.stringForNode(r))}return e},E.prototype.buildTree=function(){if(!this.tree&&this.nodes.length){this.tree=new p(this.nodes[0]);for(var t=1;t<this.nodes.length;t+=1)this.tree.add(this.nodes[t])}return this.tree},E.prototype.first=function(){var t=this.buildTree();if(t==null)return null;for(;t.left!=null;)t=t.left;return t.node},E.prototype.add=function(t){for(var e=0;e<this.nodes.length;e+=1)if(t===this.nodes[e])return;this.tree=null,this.nodes.push(t),this.size+=1},E.prototype.addArray=function(t){var e=this;pt(function(r){e.add(r)},t)},E.prototype.toArray=function(){var t=[];return this.toArrayRec(this.buildTree(),t),t},E.prototype.toArrayRec=function(t,e){t!=null&&(this.toArrayRec(t.left,e),e.push(t.node),this.toArrayRec(t.right,e))},E.prototype.toUnsortedArray=function(){return this.nodes.slice()},E.prototype.compareWithString=function(t,e){for(var r=this.toUnsortedArray(),a=0;a<r.length;a++){var o=r[a],u=new v(this.stringForNode(o)),D=e(u,t);if(D.booleanValue())return D}return new s(!1)},E.prototype.compareWithNumber=function(t,e){for(var r=this.toUnsortedArray(),a=0;a<r.length;a++){var o=r[a],u=new R(this.stringForNode(o)),D=e(u,t);if(D.booleanValue())return D}return new s(!1)},E.prototype.compareWithBoolean=function(t,e){return e(this.bool(),t)},E.prototype.compareWithNodeSet=function(t,e){for(var r=this.toUnsortedArray(),a=function(Z,tt){return e(tt,Z)},o=0;o<r.length;o++){var u=new v(this.stringForNode(r[o])),D=t.compareWithString(u,a);if(D.booleanValue())return D}return new s(!1)},E.compareWith=it(function(t,e){return S.instance_of(e,v)?this.compareWithString(e,t):S.instance_of(e,R)?this.compareWithNumber(e,t):S.instance_of(e,s)?this.compareWithBoolean(e,t):this.compareWithNodeSet(e,t)}),E.prototype.equals=E.compareWith(G.equals),E.prototype.notequal=E.compareWith(G.notequal),E.prototype.lessthan=E.compareWith(G.lessthan),E.prototype.greaterthan=E.compareWith(G.greaterthan),E.prototype.lessthanorequal=E.compareWith(G.lessthanorequal),E.prototype.greaterthanorequal=E.compareWith(G.greaterthanorequal),E.prototype.union=function(t){var e=new E;return e.addArray(this.toUnsortedArray()),e.addArray(t.toUnsortedArray()),e},ct.prototype=new Object,ct.prototype.constructor=ct,ct.superclass=Object.prototype;function ct(t,e,r,a){this.isXPathNamespace=!0,this.baseNode=e,this.ownerDocument=a.ownerDocument,this.nodeName=t,this.prefix=t,this.localName=t,this.namespaceURI=null,this.nodeValue=r,this.ownerElement=a,this.nodeType=b.NAMESPACE_NODE}ct.prototype.toString=function(){return'{ "'+this.prefix+'", "'+this.namespaceURI+'" }'},Dt.prototype=new Object,Dt.prototype.constructor=Dt,Dt.superclass=Object.prototype;function Dt(t,e,r){this.variableResolver=t??new Tt,this.namespaceResolver=e??new Et,this.functionResolver=r??new st}Dt.prototype.extend=function(t){return ht(new Dt,this,t)},Tt.prototype=new Object,Tt.prototype.constructor=Tt,Tt.superclass=Object.prototype;function Tt(){}Tt.prototype.getVariable=function(t,e){return null},st.prototype=new Object,st.prototype.constructor=st,st.superclass=Object.prototype;function st(t){this.thisArg=t??I,this.functions=new Object,this.addStandardFunctions()}st.prototype.addStandardFunctions=function(){this.functions["{}last"]=I.last,this.functions["{}position"]=I.position,this.functions["{}count"]=I.count,this.functions["{}id"]=I.id,this.functions["{}local-name"]=I.localName,this.functions["{}namespace-uri"]=I.namespaceURI,this.functions["{}name"]=I.name,this.functions["{}string"]=I.string,this.functions["{}concat"]=I.concat,this.functions["{}starts-with"]=I.startsWith,this.functions["{}contains"]=I.contains,this.functions["{}substring-before"]=I.substringBefore,this.functions["{}substring-after"]=I.substringAfter,this.functions["{}substring"]=I.substring,this.functions["{}string-length"]=I.stringLength,this.functions["{}normalize-space"]=I.normalizeSpace,this.functions["{}translate"]=I.translate,this.functions["{}boolean"]=I.boolean_,this.functions["{}not"]=I.not,this.functions["{}true"]=I.true_,this.functions["{}false"]=I.false_,this.functions["{}lang"]=I.lang,this.functions["{}number"]=I.number,this.functions["{}sum"]=I.sum,this.functions["{}floor"]=I.floor,this.functions["{}ceiling"]=I.ceiling,this.functions["{}round"]=I.round},st.prototype.addFunction=function(t,e,r){this.functions["{"+t+"}"+e]=r},st.getFunctionFromContext=function(t,e){var r=S.resolveQName(t,e.namespaceResolver,e.contextNode,!1);if(r[0]===null)throw new Error("Cannot resolve QName "+name);return e.functionResolver.getFunction(r[1],r[0])},st.prototype.getFunction=function(t,e){return this.functions["{"+e+"}"+t]},Et.prototype=new Object,Et.prototype.constructor=Et,Et.superclass=Object.prototype;function Et(){}Et.prototype.getNamespace=function(t,e){if(t=="xml")return f.XML_NAMESPACE_URI;if(t=="xmlns")return f.XMLNS_NAMESPACE_URI;for(e.nodeType==b.DOCUMENT_NODE?e=e.documentElement:e.nodeType==b.ATTRIBUTE_NODE?e=q.getOwnerElement(e):e.nodeType!=b.ELEMENT_NODE&&(e=e.parentNode);e!=null&&e.nodeType==b.ELEMENT_NODE;){for(var r=e.attributes,a=0;a<r.length;a++){var o=r.item(a),u=o.name||o.nodeName;if(u==="xmlns"&&t===""||u==="xmlns:"+t)return String(o.value||o.nodeValue)}e=e.parentNode}return null};var I=new Object;I.last=function(t){if(arguments.length!=1)throw new Error("Function last expects ()");return new R(t.contextSize)},I.position=function(t){if(arguments.length!=1)throw new Error("Function position expects ()");return new R(t.contextPosition)},I.count=function(){var t=arguments[0],e;if(arguments.length!=2||!S.instance_of(e=arguments[1].evaluate(t),E))throw new Error("Function count expects (node-set)");return new R(e.size)},I.id=function(){var t=arguments[0],e;if(arguments.length!=2)throw new Error("Function id expects (object)");e=arguments[1].evaluate(t),S.instance_of(e,E)?e=e.toArray().join(" "):e=e.stringValue();for(var r=e.split(/[\x0d\x0a\x09\x20]+/),a=new E,o=t.contextNode.nodeType==b.DOCUMENT_NODE?t.contextNode:t.contextNode.ownerDocument,u=0;u<r.length;u++){var D;o.getElementById?D=o.getElementById(r[u]):D=S.getElementById(o,r[u]),D!=null&&a.add(D)}return a},I.localName=function(t,e){var r;if(arguments.length==1)r=t.contextNode;else if(arguments.length==2)r=e.evaluate(t).first();else throw new Error("Function local-name expects (node-set?)");return r==null?new v(""):new v(r.localName||r.baseName||r.target||r.nodeName||"")},I.namespaceURI=function(){var t=arguments[0],e;if(arguments.length==1)e=t.contextNode;else if(arguments.length==2)e=arguments[1].evaluate(t).first();else throw new Error("Function namespace-uri expects (node-set?)");return e==null?new v(""):new v(e.namespaceURI||"")},I.name=function(){var t=arguments[0],e;if(arguments.length==1)e=t.contextNode;else if(arguments.length==2)e=arguments[1].evaluate(t).first();else throw new Error("Function name expects (node-set?)");return e==null?new v(""):e.nodeType==b.ELEMENT_NODE?new v(e.nodeName):e.nodeType==b.ATTRIBUTE_NODE?new v(e.name||e.nodeName):e.nodeType===b.PROCESSING_INSTRUCTION_NODE?new v(e.target||e.nodeName):e.localName==null?new v(""):new v(e.localName)},I.string=function(){var t=arguments[0];if(arguments.length==1)return new v(E.prototype.stringForNode(t.contextNode));if(arguments.length==2)return arguments[1].evaluate(t).string();throw new Error("Function string expects (object?)")},I.concat=function(t){if(arguments.length<3)throw new Error("Function concat expects (string, string[, string]*)");for(var e="",r=1;r<arguments.length;r++)e+=arguments[r].evaluate(t).stringValue();return new v(e)},I.startsWith=function(){var t=arguments[0];if(arguments.length!=3)throw new Error("Function startsWith expects (string, string)");var e=arguments[1].evaluate(t).stringValue(),r=arguments[2].evaluate(t).stringValue();return new s(e.substring(0,r.length)==r)},I.contains=function(){var t=arguments[0];if(arguments.length!=3)throw new Error("Function contains expects (string, string)");var e=arguments[1].evaluate(t).stringValue(),r=arguments[2].evaluate(t).stringValue();return new s(e.indexOf(r)!==-1)},I.substringBefore=function(){var t=arguments[0];if(arguments.length!=3)throw new Error("Function substring-before expects (string, string)");var e=arguments[1].evaluate(t).stringValue(),r=arguments[2].evaluate(t).stringValue();return new v(e.substring(0,e.indexOf(r)))},I.substringAfter=function(){var t=arguments[0];if(arguments.length!=3)throw new Error("Function substring-after expects (string, string)");var e=arguments[1].evaluate(t).stringValue(),r=arguments[2].evaluate(t).stringValue();if(r.length==0)return new v(e);var a=e.indexOf(r);return a==-1?new v(""):new v(e.substring(a+r.length))},I.substring=function(){var t=arguments[0];if(!(arguments.length==3||arguments.length==4))throw new Error("Function substring expects (string, number, number?)");var e=arguments[1].evaluate(t).stringValue(),r=Math.round(arguments[2].evaluate(t).numberValue())-1,a=arguments.length==4?r+Math.round(arguments[3].evaluate(t).numberValue()):void 0;return new v(e.substring(r,a))},I.stringLength=function(){var t=arguments[0],e;if(arguments.length==1)e=E.prototype.stringForNode(t.contextNode);else if(arguments.length==2)e=arguments[1].evaluate(t).stringValue();else throw new Error("Function string-length expects (string?)");return new R(e.length)},I.normalizeSpace=function(){var t=arguments[0],e;if(arguments.length==1)e=E.prototype.stringForNode(t.contextNode);else if(arguments.length==2)e=arguments[1].evaluate(t).stringValue();else throw new Error("Function normalize-space expects (string?)");for(var r=0,a=e.length-1;S.isSpace(e.charCodeAt(a));)a--;for(var o="";r<=a&&S.isSpace(e.charCodeAt(r));)r++;for(;r<=a;)if(S.isSpace(e.charCodeAt(r)))for(o+=" ";r<=a&&S.isSpace(e.charCodeAt(r));)r++;else o+=e.charAt(r),r++;return new v(o)},I.translate=function(t,e,r,a){if(arguments.length!=4)throw new Error("Function translate expects (string, string, string)");var o=e.evaluate(t).stringValue(),u=r.evaluate(t).stringValue(),D=a.evaluate(t).stringValue(),Z=mt(function(w,B,Lt){return B in w||(w[B]=Lt>D.length?"":D[Lt]),w},{},u),tt=J("",at(function(w){return w in Z?Z[w]:w},o));return new v(tt)},I.boolean_=function(){var t=arguments[0];if(arguments.length!=2)throw new Error("Function boolean expects (object)");return arguments[1].evaluate(t).bool()},I.not=function(t,e){if(arguments.length!=2)throw new Error("Function not expects (object)");return e.evaluate(t).bool().not()},I.true_=function(){if(arguments.length!=1)throw new Error("Function true expects ()");return s.true_},I.false_=function(){if(arguments.length!=1)throw new Error("Function false expects ()");return s.false_},I.lang=function(){var t=arguments[0];if(arguments.length!=2)throw new Error("Function lang expects (string)");for(var e,r=t.contextNode;r!=null&&r.nodeType!=b.DOCUMENT_NODE;r=r.parentNode){var a=r.getAttributeNS(f.XML_NAMESPACE_URI,"lang");if(a!=null){e=String(a);break}}if(e==null)return s.false_;var o=arguments[1].evaluate(t).stringValue();return new s(e.substring(0,o.length)==o&&(e.length==o.length||e.charAt(o.length)=="-"))},I.number=function(){var t=arguments[0];if(!(arguments.length==1||arguments.length==2))throw new Error("Function number expects (object?)");return arguments.length==1?new R(E.prototype.stringForNode(t.contextNode)):arguments[1].evaluate(t).number()},I.sum=function(){var t=arguments[0],e;if(arguments.length!=2||!S.instance_of(e=arguments[1].evaluate(t),E))throw new Error("Function sum expects (node-set)");e=e.toUnsortedArray();for(var r=0,a=0;a<e.length;a++)r+=new R(E.prototype.stringForNode(e[a])).numberValue();return new R(r)},I.floor=function(){var t=arguments[0];if(arguments.length!=2)throw new Error("Function floor expects (number)");return new R(Math.floor(arguments[1].evaluate(t).numberValue()))},I.ceiling=function(){var t=arguments[0];if(arguments.length!=2)throw new Error("Function ceiling expects (number)");return new R(Math.ceil(arguments[1].evaluate(t).numberValue()))},I.round=function(){var t=arguments[0];if(arguments.length!=2)throw new Error("Function round expects (number)");return new R(Math.round(arguments[1].evaluate(t).numberValue()))};var S=new Object,gt=function(t){return t&&(t.nodeType===b.ATTRIBUTE_NODE||t.ownerElement||t.isXPathNamespace)};S.splitQName=function(t){var e=t.indexOf(":");return e==-1?[null,t]:[t.substring(0,e),t.substring(e+1)]},S.resolveQName=function(t,e,r,a){var o=S.splitQName(t);return o[0]!=null?o[0]=e.getNamespace(o[0],r):a?(o[0]=e.getNamespace("",r),o[0]==null&&(o[0]="")):o[0]="",o},S.isSpace=function(t){return t==9||t==13||t==10||t==32},S.isLetter=function(t){return t>=65&&t<=90||t>=97&&t<=122||t>=192&&t<=214||t>=216&&t<=246||t>=248&&t<=255||t>=256&&t<=305||t>=308&&t<=318||t>=321&&t<=328||t>=330&&t<=382||t>=384&&t<=451||t>=461&&t<=496||t>=500&&t<=501||t>=506&&t<=535||t>=592&&t<=680||t>=699&&t<=705||t==902||t>=904&&t<=906||t==908||t>=910&&t<=929||t>=931&&t<=974||t>=976&&t<=982||t==986||t==988||t==990||t==992||t>=994&&t<=1011||t>=1025&&t<=1036||t>=1038&&t<=1103||t>=1105&&t<=1116||t>=1118&&t<=1153||t>=1168&&t<=1220||t>=1223&&t<=1224||t>=1227&&t<=1228||t>=1232&&t<=1259||t>=1262&&t<=1269||t>=1272&&t<=1273||t>=1329&&t<=1366||t==1369||t>=1377&&t<=1414||t>=1488&&t<=1514||t>=1520&&t<=1522||t>=1569&&t<=1594||t>=1601&&t<=1610||t>=1649&&t<=1719||t>=1722&&t<=1726||t>=1728&&t<=1742||t>=1744&&t<=1747||t==1749||t>=1765&&t<=1766||t>=2309&&t<=2361||t==2365||t>=2392&&t<=2401||t>=2437&&t<=2444||t>=2447&&t<=2448||t>=2451&&t<=2472||t>=2474&&t<=2480||t==2482||t>=2486&&t<=2489||t>=2524&&t<=2525||t>=2527&&t<=2529||t>=2544&&t<=2545||t>=2565&&t<=2570||t>=2575&&t<=2576||t>=2579&&t<=2600||t>=2602&&t<=2608||t>=2610&&t<=2611||t>=2613&&t<=2614||t>=2616&&t<=2617||t>=2649&&t<=2652||t==2654||t>=2674&&t<=2676||t>=2693&&t<=2699||t==2701||t>=2703&&t<=2705||t>=2707&&t<=2728||t>=2730&&t<=2736||t>=2738&&t<=2739||t>=2741&&t<=2745||t==2749||t==2784||t>=2821&&t<=2828||t>=2831&&t<=2832||t>=2835&&t<=2856||t>=2858&&t<=2864||t>=2866&&t<=2867||t>=2870&&t<=2873||t==2877||t>=2908&&t<=2909||t>=2911&&t<=2913||t>=2949&&t<=2954||t>=2958&&t<=2960||t>=2962&&t<=2965||t>=2969&&t<=2970||t==2972||t>=2974&&t<=2975||t>=2979&&t<=2980||t>=2984&&t<=2986||t>=2990&&t<=2997||t>=2999&&t<=3001||t>=3077&&t<=3084||t>=3086&&t<=3088||t>=3090&&t<=3112||t>=3114&&t<=3123||t>=3125&&t<=3129||t>=3168&&t<=3169||t>=3205&&t<=3212||t>=3214&&t<=3216||t>=3218&&t<=3240||t>=3242&&t<=3251||t>=3253&&t<=3257||t==3294||t>=3296&&t<=3297||t>=3333&&t<=3340||t>=3342&&t<=3344||t>=3346&&t<=3368||t>=3370&&t<=3385||t>=3424&&t<=3425||t>=3585&&t<=3630||t==3632||t>=3634&&t<=3635||t>=3648&&t<=3653||t>=3713&&t<=3714||t==3716||t>=3719&&t<=3720||t==3722||t==3725||t>=3732&&t<=3735||t>=3737&&t<=3743||t>=3745&&t<=3747||t==3749||t==3751||t>=3754&&t<=3755||t>=3757&&t<=3758||t==3760||t>=3762&&t<=3763||t==3773||t>=3776&&t<=3780||t>=3904&&t<=3911||t>=3913&&t<=3945||t>=4256&&t<=4293||t>=4304&&t<=4342||t==4352||t>=4354&&t<=4355||t>=4357&&t<=4359||t==4361||t>=4363&&t<=4364||t>=4366&&t<=4370||t==4412||t==4414||t==4416||t==4428||t==4430||t==4432||t>=4436&&t<=4437||t==4441||t>=4447&&t<=4449||t==4451||t==4453||t==4455||t==4457||t>=4461&&t<=4462||t>=4466&&t<=4467||t==4469||t==4510||t==4520||t==4523||t>=4526&&t<=4527||t>=4535&&t<=4536||t==4538||t>=4540&&t<=4546||t==4587||t==4592||t==4601||t>=7680&&t<=7835||t>=7840&&t<=7929||t>=7936&&t<=7957||t>=7960&&t<=7965||t>=7968&&t<=8005||t>=8008&&t<=8013||t>=8016&&t<=8023||t==8025||t==8027||t==8029||t>=8031&&t<=8061||t>=8064&&t<=8116||t>=8118&&t<=8124||t==8126||t>=8130&&t<=8132||t>=8134&&t<=8140||t>=8144&&t<=8147||t>=8150&&t<=8155||t>=8160&&t<=8172||t>=8178&&t<=8180||t>=8182&&t<=8188||t==8486||t>=8490&&t<=8491||t==8494||t>=8576&&t<=8578||t>=12353&&t<=12436||t>=12449&&t<=12538||t>=12549&&t<=12588||t>=44032&&t<=55203||t>=19968&&t<=40869||t==12295||t>=12321&&t<=12329},S.isNCNameChar=function(t){return t>=48&&t<=57||t>=1632&&t<=1641||t>=1776&&t<=1785||t>=2406&&t<=2415||t>=2534&&t<=2543||t>=2662&&t<=2671||t>=2790&&t<=2799||t>=2918&&t<=2927||t>=3047&&t<=3055||t>=3174&&t<=3183||t>=3302&&t<=3311||t>=3430&&t<=3439||t>=3664&&t<=3673||t>=3792&&t<=3801||t>=3872&&t<=3881||t==46||t==45||t==95||S.isLetter(t)||t>=768&&t<=837||t>=864&&t<=865||t>=1155&&t<=1158||t>=1425&&t<=1441||t>=1443&&t<=1465||t>=1467&&t<=1469||t==1471||t>=1473&&t<=1474||t==1476||t>=1611&&t<=1618||t==1648||t>=1750&&t<=1756||t>=1757&&t<=1759||t>=1760&&t<=1764||t>=1767&&t<=1768||t>=1770&&t<=1773||t>=2305&&t<=2307||t==2364||t>=2366&&t<=2380||t==2381||t>=2385&&t<=2388||t>=2402&&t<=2403||t>=2433&&t<=2435||t==2492||t==2494||t==2495||t>=2496&&t<=2500||t>=2503&&t<=2504||t>=2507&&t<=2509||t==2519||t>=2530&&t<=2531||t==2562||t==2620||t==2622||t==2623||t>=2624&&t<=2626||t>=2631&&t<=2632||t>=2635&&t<=2637||t>=2672&&t<=2673||t>=2689&&t<=2691||t==2748||t>=2750&&t<=2757||t>=2759&&t<=2761||t>=2763&&t<=2765||t>=2817&&t<=2819||t==2876||t>=2878&&t<=2883||t>=2887&&t<=2888||t>=2891&&t<=2893||t>=2902&&t<=2903||t>=2946&&t<=2947||t>=3006&&t<=3010||t>=3014&&t<=3016||t>=3018&&t<=3021||t==3031||t>=3073&&t<=3075||t>=3134&&t<=3140||t>=3142&&t<=3144||t>=3146&&t<=3149||t>=3157&&t<=3158||t>=3202&&t<=3203||t>=3262&&t<=3268||t>=3270&&t<=3272||t>=3274&&t<=3277||t>=3285&&t<=3286||t>=3330&&t<=3331||t>=3390&&t<=3395||t>=3398&&t<=3400||t>=3402&&t<=3405||t==3415||t==3633||t>=3636&&t<=3642||t>=3655&&t<=3662||t==3761||t>=3764&&t<=3769||t>=3771&&t<=3772||t>=3784&&t<=3789||t>=3864&&t<=3865||t==3893||t==3895||t==3897||t==3902||t==3903||t>=3953&&t<=3972||t>=3974&&t<=3979||t>=3984&&t<=3989||t==3991||t>=3993&&t<=4013||t>=4017&&t<=4023||t==4025||t>=8400&&t<=8412||t==8417||t>=12330&&t<=12335||t==12441||t==12442||t==183||t==720||t==721||t==903||t==1600||t==3654||t==3782||t==12293||t>=12337&&t<=12341||t>=12445&&t<=12446||t>=12540&&t<=12542},S.coalesceText=function(t){for(var e=t.firstChild;e!=null;e=e.nextSibling)if(e.nodeType==b.TEXT_NODE||e.nodeType==b.CDATA_SECTION_NODE){var r=e.nodeValue,a=e;for(e=e.nextSibling;e!=null&&(e.nodeType==b.TEXT_NODE||e.nodeType==b.CDATA_SECTION_NODE);){r+=e.nodeValue;var o=e;e=e.nextSibling,o.parentNode.removeChild(o)}if(a.nodeType==b.CDATA_SECTION_NODE){var u=a.parentNode;if(a.nextSibling==null)u.removeChild(a),u.appendChild(u.ownerDocument.createTextNode(r));else{var D=a.nextSibling;u.removeChild(a),u.insertBefore(u.ownerDocument.createTextNode(r),D)}}else a.nodeValue=r;if(e==null)break}else e.nodeType==b.ELEMENT_NODE&&S.coalesceText(e)},S.instance_of=function(t,e){for(;t!=null;){if(t.constructor===e)return!0;if(t===Object)return!1;t=t.constructor.superclass}return!1},S.getElementById=function(t,e){if(t.nodeType==b.ELEMENT_NODE&&(t.getAttribute("id")==e||t.getAttributeNS(null,"id")==e))return t;for(var r=t.firstChild;r!=null;r=r.nextSibling){var a=S.getElementById(r,e);if(a!=null)return a}return null};var _t=(function(){function t(r,a){var o=a?": "+a.toString():"";switch(r){case e.INVALID_EXPRESSION_ERR:return"Invalid expression"+o;case e.TYPE_ERR:return"Type error"+o}return null}function e(r,a,o){var u=Error.call(this,t(r,a)||o);return u.code=r,u.exception=a,u}return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e.superclass=Error,e.prototype.toString=function(){return this.message},e.fromMessage=function(r,a){return new e(null,a,r)},e.INVALID_EXPRESSION_ERR=51,e.TYPE_ERR=52,e})();yt.prototype={},yt.prototype.constructor=yt,yt.superclass=Object.prototype;function yt(t,e,r){this.xpath=r.parse(t),this.context=new Dt,this.context.namespaceResolver=new Bt(e)}yt.getOwnerDocument=function(t){return t.nodeType===b.DOCUMENT_NODE?t:t.ownerDocument},yt.detectHtmlDom=function(t){if(!t)return!1;var e=yt.getOwnerDocument(t);try{return e.implementation.hasFeature("HTML","2.0")}catch{return!0}},yt.prototype.evaluate=function(t,e,r){this.context.expressionContextNode=t,this.context.caseInsensitive=yt.detectHtmlDom(t);var a=this.xpath.evaluate(this.context);return new Y(a,e)},Bt.prototype={},Bt.prototype.constructor=Bt,Bt.superclass=Object.prototype;function Bt(t){this.xpathNSResolver=t}Bt.prototype.getNamespace=function(t,e){return this.xpathNSResolver==null?null:this.xpathNSResolver.lookupNamespaceURI(t)},Wt.prototype={},Wt.prototype.constructor=Wt,Wt.superclass=Object.prototype;function Wt(t){this.node=t,this.namespaceResolver=new Et}Wt.prototype.lookupNamespaceURI=function(t){return this.namespaceResolver.getNamespace(t,this.node)},Y.prototype={},Y.prototype.constructor=Y,Y.superclass=Object.prototype;function Y(t,e){switch(e==Y.ANY_TYPE&&(t.constructor===v?e=Y.STRING_TYPE:t.constructor===R?e=Y.NUMBER_TYPE:t.constructor===s?e=Y.BOOLEAN_TYPE:t.constructor===E&&(e=Y.UNORDERED_NODE_ITERATOR_TYPE)),this.resultType=e,e){case Y.NUMBER_TYPE:this.numberValue=t.numberValue();return;case Y.STRING_TYPE:this.stringValue=t.stringValue();return;case Y.BOOLEAN_TYPE:this.booleanValue=t.booleanValue();return;case Y.ANY_UNORDERED_NODE_TYPE:case Y.FIRST_ORDERED_NODE_TYPE:if(t.constructor===E){this.singleNodeValue=t.first();return}break;case Y.UNORDERED_NODE_ITERATOR_TYPE:case Y.ORDERED_NODE_ITERATOR_TYPE:if(t.constructor===E){this.invalidIteratorState=!1,this.nodes=t.toArray(),this.iteratorIndex=0;return}break;case Y.UNORDERED_NODE_SNAPSHOT_TYPE:case Y.ORDERED_NODE_SNAPSHOT_TYPE:if(t.constructor===E){this.nodes=t.toArray(),this.snapshotLength=this.nodes.length;return}break}throw new _t(_t.TYPE_ERR)}Y.prototype.iterateNext=function(){if(this.resultType!=Y.UNORDERED_NODE_ITERATOR_TYPE&&this.resultType!=Y.ORDERED_NODE_ITERATOR_TYPE)throw new _t(_t.TYPE_ERR);return this.nodes[this.iteratorIndex++]},Y.prototype.snapshotItem=function(t){if(this.resultType!=Y.UNORDERED_NODE_SNAPSHOT_TYPE&&this.resultType!=Y.ORDERED_NODE_SNAPSHOT_TYPE)throw new _t(_t.TYPE_ERR);return this.nodes[t]},Y.ANY_TYPE=0,Y.NUMBER_TYPE=1,Y.STRING_TYPE=2,Y.BOOLEAN_TYPE=3,Y.UNORDERED_NODE_ITERATOR_TYPE=4,Y.ORDERED_NODE_ITERATOR_TYPE=5,Y.UNORDERED_NODE_SNAPSHOT_TYPE=6,Y.ORDERED_NODE_SNAPSHOT_TYPE=7,Y.ANY_UNORDERED_NODE_TYPE=8,Y.FIRST_ORDERED_NODE_TYPE=9;function he(t,e){t.createExpression=function(r,a){try{return new yt(r,a,e)}catch(o){throw new _t(_t.INVALID_EXPRESSION_ERR,o)}},t.createNSResolver=function(r){return new Wt(r)},t.evaluate=function(r,a,o,u,D){if(u<0||u>9)throw{code:0,toString:function(){return"Request type not supported"}};return t.createExpression(r,o,e).evaluate(a,u,D)}}try{var ce=!0;try{document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("XPath",null)&&(ce=!1)}catch{}ce&&he(document,new l)}catch{}he(A,new l),(function(){var t=new l,e=new Et,r=new st,a=new Tt;function o(m){return{getNamespace:function(et,Rt){var Ut=m(et,Rt);return Ut||e.getNamespace(et,Rt)}}}function u(m){return o(m.getNamespace.bind(m))}function D(m){return o(function(et){return m[et]})}function Z(m){return m&&typeof m.getNamespace=="function"?u(m):typeof m=="function"?o(m):typeof m=="object"?D(m):e}function tt(m){if(m===null||typeof m>"u"||m instanceof v||m instanceof s||m instanceof R||m instanceof E)return m;switch(typeof m){case"string":return new v(m);case"boolean":return new s(m);case"number":return new R(m)}var et=new E;return et.addArray([].concat(m)),et}function w(m){return function(et){var Rt=Array.prototype.slice.call(arguments,1).map(function(Ue){return Ue.evaluate(et)}),Ut=m.apply(this,[].concat(et,Rt));return tt(Ut)}}function B(m){return{getFunction:function(et,Rt){var Ut=m(et,Rt);return Ut?w(Ut):r.getFunction(et,Rt)}}}function Lt(m){return B(m.getFunction.bind(m))}function kt(m){return B(function(et){return m[et]})}function jt(m){return m&&typeof m.getFunction=="function"?Lt(m):typeof m=="function"?B(m):typeof m=="object"?kt(m):r}function qt(m){return{getVariable:function(et,Rt){var Ut=m(et,Rt);return tt(Ut)}}}function Qt(m){if(m){if(typeof m.getVariable=="function")return qt(m.getVariable.bind(m));if(typeof m=="function")return qt(m);if(typeof m=="object")return qt(function(et){return m[et]})}return a}function Kt(m,et,Rt){m in Rt&&(et[m]=Rt[m])}function Be(m){var et=new Dt;return m?(et.namespaceResolver=Z(m.namespaces),et.functionResolver=jt(m.functions),et.variableResolver=Qt(m.variables),et.expressionContextNode=m.node,Kt("allowAnyNamespaceForNoPrefix",et,m),Kt("isHtml",et,m)):et.namespaceResolver=e,et}function Pe(m,et){var Rt=Be(et);return m.evaluate(Rt)}var Le={evaluate:function(m){return Pe(this.expression,m)},evaluateNumber:function(m){return this.evaluate(m).numberValue()},evaluateString:function(m){return this.evaluate(m).stringValue()},evaluateBoolean:function(m){return this.evaluate(m).booleanValue()},evaluateNodeSet:function(m){return this.evaluate(m).nodeset()},select:function(m){return this.evaluateNodeSet(m).toArray()},select1:function(m){return this.select(m)[0]}};function Me(m){var et=t.parse(m);return Object.create(Le,{expression:{value:et}})}A.parse=Me})(),ht(A,{XPath:f,XPathParser:l,XPathResult:Y,Step:c,PathExpr:q,NodeTest:g,LocationPath:At,OrOperation:_,AndOperation:H,BarOperation:ot,EqualsOperation:P,NotEqualOperation:M,LessThanOperation:k,GreaterThanOperation:nt,LessThanOrEqualOperation:Q,GreaterThanOrEqualOperation:ut,PlusOperation:wt,MinusOperation:lt,MultiplyOperation:z,DivOperation:vt,ModOperation:xt,UnaryMinusOperation:L,FunctionCall:dt,VariableReference:Ot,XPathContext:Dt,XNodeSet:E,XBoolean:s,XString:v,XNumber:R,NamespaceResolver:Et,FunctionResolver:st,VariableResolver:Tt,Utilities:S}),A.select=function(t,e,r){return A.selectWithResolver(t,e,null,r)},A.useNamespaces=function(t){var e={mappings:t||{},lookupNamespaceURI:function(r){return this.mappings[r]}};return function(r,a,o){return A.selectWithResolver(r,a,e,o)}},A.selectWithResolver=function(t,e,r,a){var o=new yt(t,r,new l),u=Y.ANY_TYPE,D=o.evaluate(e,u,null);return D.resultType==Y.STRING_TYPE?D=D.stringValue:D.resultType==Y.NUMBER_TYPE?D=D.numberValue:D.resultType==Y.BOOLEAN_TYPE?D=D.booleanValue:(D=D.nodes,a&&(D=D[0])),D},A.select1=function(t,e){return A.select(t,e,!0)};var Fe=function(t){return Array.isArray(t)&&t.every(W)},Pt=function(t){return function(e){return W(e)&&e.nodeType===t}};ht(A,{isNodeLike:W,isArrayOfNodes:Fe,isElement:Pt(b.ELEMENT_NODE),isAttribute:Pt(b.ATTRIBUTE_NODE),isTextNode:Pt(b.TEXT_NODE),isCDATASection:Pt(b.CDATA_SECTION_NODE),isProcessingInstruction:Pt(b.PROCESSING_INSTRUCTION_NODE),isComment:Pt(b.COMMENT_NODE),isDocumentNode:Pt(b.DOCUMENT_NODE),isDocumentTypeNode:Pt(b.DOCUMENT_TYPE_NODE),isDocumentFragment:Pt(b.DOCUMENT_FRAGMENT_NODE)})})(d)})(Zt)),Zt}var ge=Ne();const se=self,ve={ubl:"urn:oasis:names:specification:ubl:schema:xsd:Invoice-2",cbc:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2",cac:"urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2",rsm:"urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100",ram:"urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100",udt:"urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100",qdt:"urn:un:unece:uncefact:data:standard:QualifiedDataType:100"},Ae=ge.useNamespaces(ve),K={xmlVersion:0,doc:null,xmlLines:[],mappings:[],mappingByKey:new Map,sortedCursorMappings:[],elementIndex:[],countByKey:new Map,matchesCache:new Map,nodeCache:new Map},Te={"urn:oasis:names:specification:ubl:schema:xsd:Invoice-2":"ubl","urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2":"cac","urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2":"cbc","urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100":"rsm","urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100":"ram","urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100":"udt","urn:un:unece:uncefact:data:standard:QualifiedDataType:100":"qdt"};function It(h){se.postMessage(h)}function ae(h,d){return h.line!==d.line?h.line-d.line:h.column-d.column}function ye(h){const d=[];let A=h;for(;A&&A.nodeType===1;){const O=A.namespaceURI,F=A.localName||A.tagName,V=O?Te[O]:null,W=V?`${V}:${F}`:A.tagName;d.unshift(W),A=A.parentNode}return d.length?`/${d.join("/")}`:""}function we(h){return h?h.nodeType===1?h:h.nodeType===2&&h.ownerElement?h.ownerElement:h.parentNode??null:null}function ue(h){const d=we(h);if(!d)return null;const A=typeof d.lineNumber=="number"?d.lineNumber:1,O=typeof d.columnNumber=="number"?d.columnNumber:1,F=typeof h?.nodeType=="number"?h.nodeType:1,V=typeof d.toString=="function"?String(d.toString()):"",W=V.split(`
4
+ `),it=A+Math.max(0,W.length-1),pt=W.length>1?(W[W.length-1]?.length??0)+1:Math.max(O+Math.max(0,V.length),O+1);return{line:A,column:O,nodeType:F,endLine:it,endColumn:pt}}function le(h){if(!K.doc)return[];try{const d=Ae(h,K.doc);return Array.isArray(d)?d:d!=null?[d]:[]}catch{return[]}}function pe(h,d){let A=d;for(;A;){if(A===h)return!0;A=A.parentNode}return!1}function fe(h,d){if(!d?.length)return h;const A=De(d);if(!A.length)return[];let O=h;for(const F of A)O=O.filter(V=>pe(F,V));return O}function De(h){const d=[];for(const A of h){let O=$t(A.nodeKey);for(const V of d)O=O.filter(W=>pe(V,W));const F=O[A.occurrenceIndex];if(!F)return[];d.push(F)}return d}function $t(h){const d=K.nodeCache.get(h);if(d)return d;const A=K.mappingByKey.get(h);if(!A)return[];const O=le(A.xpath);return K.nodeCache.set(h,O),O}function be(h,d){if(!h||!d)return h;const A=d.match(/<\/\s*([A-Za-z_][\w.-]*(?::[\w.-]+)?)\s*>/);if(!A)return h;const O=A[1],F=h.split("/").filter(Boolean);if(!F.length)return h;for(let V=F.length-1;V>=0;V--)if(F[V]===O)return`/${F.slice(0,V+1).join("/")}`;return h}function Oe(h,d){const A=[];let O=0;const F=V=>{if(!V)return;V.nodeType===1&&typeof V.lineNumber=="number"&&typeof V.columnNumber=="number"&&(O+=1,A.push({line:V.lineNumber,column:V.columnNumber,absolutePath:ye(V)}),O%5e3===0&&It({type:"INIT_PROGRESS",xmlVersion:d,scannedElements:O}));const W=V.childNodes;if(W)for(let it=0;it<W.length;it++)F(W[it])};return F(h),A.sort((V,W)=>ae(V,W)),A}function Ce(h){const d=K.mappings.length,A=[];for(let O=0;O<d;O++){const F=K.mappings[O],V=le(F.xpath).length;K.countByKey.set(F.key,V),A.push({key:F.key,count:V}),(A.length>=25||O===d-1)&&(It({type:"COUNT_BATCH",xmlVersion:h,entries:[...A],done:O+1,total:d}),A.length=0)}}function Se(h){K.xmlVersion=h.xmlVersion,K.xmlLines=h.xmlText.split(/\r?\n/),K.mappings=h.mappings,K.mappingByKey=new Map(h.mappings.map(A=>[A.key,A])),K.sortedCursorMappings=[...h.mappings].sort((A,O)=>O.cursorXpath.length-A.cursorXpath.length),K.countByKey.clear(),K.matchesCache.clear(),K.nodeCache.clear();const d=new xe.DOMParser().parseFromString(h.xmlText,"application/xml");K.doc=d,K.elementIndex=Oe(d,h.xmlVersion),Ce(h.xmlVersion),It({type:"INIT_READY",xmlVersion:h.xmlVersion,scannedElements:K.elementIndex.length})}function Re(h){if(h.xmlVersion!==K.xmlVersion||!K.elementIndex.length){It({type:"CURSOR_RESULT",xmlVersion:h.xmlVersion,requestId:h.requestId,key:null});return}const d={line:h.line,column:h.column};let A=0,O=K.elementIndex.length-1,F=-1;for(;A<=O;){const at=A+O>>1;ae({line:K.elementIndex[at].line,column:K.elementIndex[at].column},d)<=0?(F=at,A=at+1):O=at-1}const V=F>=0?K.elementIndex[F].absolutePath:"",W=h.line>=1&&h.line<=K.xmlLines.length?K.xmlLines[h.line-1]:"",it=be(V,W);let pt=null,mt=null;for(const at of K.sortedCursorMappings)if(it.startsWith(at.cursorXpath)){pt=at.key,mt=at.cursorXpath;break}It({type:"CURSOR_RESULT",xmlVersion:h.xmlVersion,requestId:h.requestId,key:pt,debug:{targetLine:h.line,targetColumn:h.column,bestIndex:F,bestLine:F>=0?K.elementIndex[F].line:null,bestColumn:F>=0?K.elementIndex[F].column:null,absolutePath:it,matchedCursorXpath:mt}})}function _e(h){if(h.xmlVersion!==K.xmlVersion)return;if(!K.mappingByKey.get(h.nodeKey)){It({type:"MATCH_RESULT",xmlVersion:h.xmlVersion,requestId:h.requestId,nodeKey:h.nodeKey,total:0,matches:[]});return}if(!K.matchesCache.get(h.nodeKey)){const pt=$t(h.nodeKey).map(mt=>ue(mt)).filter(mt=>!!mt);K.matchesCache.set(h.nodeKey,pt)}const O=fe($t(h.nodeKey),h.context).map(it=>ue(it)).filter(it=>!!it),F=Math.max(0,h.offset),V=Math.max(F,F+Math.max(1,h.limit)),W=O.slice(F,V);It({type:"MATCH_RESULT",xmlVersion:h.xmlVersion,requestId:h.requestId,nodeKey:h.nodeKey,total:O.length,matches:W})}function Ie(h){if(h.xmlVersion!==K.xmlVersion)return;if(!K.mappingByKey.get(h.nodeKey)){It({type:"COUNT_RESULT",xmlVersion:h.xmlVersion,requestId:h.requestId,nodeKey:h.nodeKey,count:0});return}const A=fe($t(h.nodeKey),h.context);It({type:"COUNT_RESULT",xmlVersion:h.xmlVersion,requestId:h.requestId,nodeKey:h.nodeKey,count:A.length})}se.onmessage=h=>{const d=h.data;try{if(d.type==="INIT"){Se(d);return}if(d.type==="CURSOR_LOOKUP"){Re(d);return}if(d.type==="GET_MATCHES"){_e(d);return}d.type==="GET_COUNT"&&Ie(d)}catch(A){It({type:"ERROR",xmlVersion:d.xmlVersion,requestId:"requestId"in d?d.requestId:void 0,message:A instanceof Error?A.message:"Unknown worker error"})}}})();
@@ -0,0 +1,19 @@
1
+ export type XmlSyntax = "ubl" | "cii";
2
+ export type TreeNode = {
3
+ id: string;
4
+ title: string;
5
+ xpaths?: Partial<Record<XmlSyntax, string>>;
6
+ children?: TreeNode[];
7
+ };
8
+ export type RuntimeTreeNode = {
9
+ key: string;
10
+ id: string;
11
+ title: string;
12
+ xpaths?: Partial<Record<XmlSyntax, string>>;
13
+ children?: RuntimeTreeNode[];
14
+ matchedNodes?: any[];
15
+ matchCount?: number;
16
+ isOccurrence?: boolean;
17
+ };
18
+ export declare const btTree: TreeNode;
19
+ //# sourceMappingURL=btTree.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"btTree.d.ts","sourceRoot":"","sources":["../src/xmlExplorer/btTree.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GAAG,KAAK,GAAG,KAAK,CAAC;AAEtC,MAAM,MAAM,QAAQ,GAAG;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC;IAC5C,QAAQ,CAAC,EAAE,QAAQ,EAAE,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,GAAG,EAAE,MAAM,CAAC;IACZ,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC;IAC5C,QAAQ,CAAC,EAAE,eAAe,EAAE,CAAC;IAC7B,YAAY,CAAC,EAAE,GAAG,EAAE,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,QA09CpB,CAAC"}