@gramlot/gramlot 0.2.15 → 0.2.16

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.
@@ -6,29 +6,29 @@
6
6
  *
7
7
  * @module
8
8
  */
9
- var ql=Object.create;var As=Object.defineProperty;var jl=Object.getOwnPropertyDescriptor;var Vl=Object.getOwnPropertyNames;var Hl=Object.getPrototypeOf,zl=Object.prototype.hasOwnProperty;var et=(r,e)=>()=>{try{return e||r((e={exports:{}}).exports,e),e.exports}catch(t){throw e=0,t}},Gl=(r,e)=>{for(var t in e)As(r,t,{get:e[t],enumerable:!0})},Wl=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of Vl(e))!zl.call(r,s)&&s!==t&&As(r,s,{get:()=>e[s],enumerable:!(n=jl(e,s))||n.enumerable});return r};var ji=(r,e,t)=>(t=r!=null?ql(Hl(r)):{},Wl(e||!r||!r.__esModule?As(t,"default",{value:r,enumerable:!0}):t,r));var vt=et(ae=>{"use strict";function gc(r,e,t){if(t===void 0&&(t=Array.prototype),r&&typeof t.find=="function")return t.find.call(r,e);for(var n=0;n<r.length;n++)if(yt(r,n)){var s=r[n];if(e.call(void 0,s,n,r))return s}}function Ut(r,e){return e===void 0&&(e=Object),e&&typeof e.getOwnPropertyDescriptors=="function"&&(r=e.create(null,e.getOwnPropertyDescriptors(r))),e&&typeof e.freeze=="function"?e.freeze(r):r}function yt(r,e){return Object.prototype.hasOwnProperty.call(r,e)}function _c(r,e){if(r===null||typeof r!="object")throw new TypeError("target is not an object");for(var t in e)yt(e,t)&&(r[t]=e[t]);return r}var Ea=Ut({allowfullscreen:!0,async:!0,autofocus:!0,autoplay:!0,checked:!0,controls:!0,default:!0,defer:!0,disabled:!0,formnovalidate:!0,hidden:!0,ismap:!0,itemscope:!0,loop:!0,multiple:!0,muted:!0,nomodule:!0,novalidate:!0,open:!0,playsinline:!0,readonly:!0,required:!0,reversed:!0,selected:!0});function bc(r){return yt(Ea,r.toLowerCase())}var ka=Ut({area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function wc(r){return yt(ka,r.toLowerCase())}var yr=Ut({script:!1,style:!1,textarea:!0,title:!0});function yc(r){var e=r.toLowerCase();return yt(yr,e)&&!yr[e]}function vc(r){var e=r.toLowerCase();return yt(yr,e)&&yr[e]}function Aa(r){return r===vr.HTML}function Ec(r){return Aa(r)||r===vr.XML_XHTML_APPLICATION}var vr=Ut({HTML:"text/html",XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),kc=Object.keys(vr).map(function(r){return vr[r]});function Ac(r){return kc.indexOf(r)>-1}var Dc=Ut({HTML:"http://www.w3.org/1999/xhtml",SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});ae.assign=_c;ae.find=gc;ae.freeze=Ut;ae.HTML_BOOLEAN_ATTRIBUTES=Ea;ae.HTML_RAW_TEXT_ELEMENTS=yr;ae.HTML_VOID_ELEMENTS=ka;ae.hasDefaultHTMLNamespace=Ec;ae.hasOwn=yt;ae.isHTMLBooleanAttribute=bc;ae.isHTMLRawTextElement=yc;ae.isHTMLEscapableRawTextElement=vc;ae.isHTMLMimeType=Aa;ae.isHTMLVoidElement=wc;ae.isValidMimeType=Ac;ae.MIME_TYPE=vr;ae.NAMESPACE=Dc});var Tr=et(Dr=>{"use strict";var Tc=vt();function Ta(r,e){r.prototype=Object.create(Error.prototype,{constructor:{value:r},name:{value:r.name,enumerable:!0,writable:e}})}var kr=Tc.freeze({Error:"Error",IndexSizeError:"IndexSizeError",DomstringSizeError:"DomstringSizeError",HierarchyRequestError:"HierarchyRequestError",WrongDocumentError:"WrongDocumentError",InvalidCharacterError:"InvalidCharacterError",NoDataAllowedError:"NoDataAllowedError",NoModificationAllowedError:"NoModificationAllowedError",NotFoundError:"NotFoundError",NotSupportedError:"NotSupportedError",InUseAttributeError:"InUseAttributeError",InvalidStateError:"InvalidStateError",SyntaxError:"SyntaxError",InvalidModificationError:"InvalidModificationError",NamespaceError:"NamespaceError",InvalidAccessError:"InvalidAccessError",ValidationError:"ValidationError",TypeMismatchError:"TypeMismatchError",SecurityError:"SecurityError",NetworkError:"NetworkError",AbortError:"AbortError",URLMismatchError:"URLMismatchError",QuotaExceededError:"QuotaExceededError",TimeoutError:"TimeoutError",InvalidNodeTypeError:"InvalidNodeTypeError",DataCloneError:"DataCloneError",EncodingError:"EncodingError",NotReadableError:"NotReadableError",UnknownError:"UnknownError",ConstraintError:"ConstraintError",DataError:"DataError",TransactionInactiveError:"TransactionInactiveError",ReadOnlyError:"ReadOnlyError",VersionError:"VersionError",OperationError:"OperationError",NotAllowedError:"NotAllowedError",OptOutError:"OptOutError"}),xa=Object.keys(kr);function Sa(r){return typeof r=="number"&&r>=1&&r<=25}function xc(r){return typeof r=="string"&&r.substring(r.length-kr.Error.length)===kr.Error}function Ar(r,e){Sa(r)?(this.name=xa[r],this.message=e||""):(this.message=r,this.name=xc(e)?e:kr.Error),Error.captureStackTrace&&Error.captureStackTrace(this,Ar)}Ta(Ar,!0);Object.defineProperties(Ar.prototype,{code:{enumerable:!0,get:function(){var r=xa.indexOf(this.name);return Sa(r)?r:0}}});var Na={INDEX_SIZE_ERR:1,DOMSTRING_SIZE_ERR:2,HIERARCHY_REQUEST_ERR:3,WRONG_DOCUMENT_ERR:4,INVALID_CHARACTER_ERR:5,NO_DATA_ALLOWED_ERR:6,NO_MODIFICATION_ALLOWED_ERR:7,NOT_FOUND_ERR:8,NOT_SUPPORTED_ERR:9,INUSE_ATTRIBUTE_ERR:10,INVALID_STATE_ERR:11,SYNTAX_ERR:12,INVALID_MODIFICATION_ERR:13,NAMESPACE_ERR:14,INVALID_ACCESS_ERR:15,VALIDATION_ERR:16,TYPE_MISMATCH_ERR:17,SECURITY_ERR:18,NETWORK_ERR:19,ABORT_ERR:20,URL_MISMATCH_ERR:21,QUOTA_EXCEEDED_ERR:22,TIMEOUT_ERR:23,INVALID_NODE_TYPE_ERR:24,DATA_CLONE_ERR:25},qs=Object.entries(Na);for(Er=0;Er<qs.length;Er++)Da=qs[Er][0],Ar[Da]=qs[Er][1];var Da,Er;function js(r,e,t){this.message=r,this.locator=e,this.cause=t,Error.captureStackTrace&&Error.captureStackTrace(this,js)}Ta(js);Dr.DOMException=Ar;Dr.DOMExceptionName=kr;Dr.ExceptionCode=Na;Dr.ParseError=js});var Ys=et(N=>{"use strict";function Ma(r){try{typeof r!="function"&&(r=RegExp);var e=new r("\u{1D306}","u").exec("\u{1D306}");return!!e&&e[0].length===2}catch{}return!1}var jt=Ma();function at(r){if(r.source[0]!=="[")throw new Error(r+" can not be used with chars");return r.source.slice(1,r.source.lastIndexOf("]"))}function Pt(r,e){if(r.source[0]!=="[")throw new Error("/"+r.source+"/ can not be used with chars_without");if(!e||typeof e!="string")throw new Error(JSON.stringify(e)+" is not a valid search");if(r.source.indexOf(e)===-1)throw new Error('"'+e+'" is not is /'+r.source+"/");if(e==="-"&&r.source.indexOf(e)!==1)throw new Error('"'+e+'" is not at the first postion of /'+r.source+"/");return new RegExp(r.source.replace(e,""),jt?"u":"")}function B(r){var e=this;return new RegExp(Array.prototype.slice.call(arguments).map(function(t){var n=typeof t=="string";if(n&&e===void 0&&t==="|")throw new Error("use regg instead of reg to wrap expressions with `|`!");return n?t:t.source}).join(""),jt?"u":"")}function x(r){if(arguments.length===0)throw new Error("no parameters provided");return B.apply(x,["(?:"].concat(Array.prototype.slice.call(arguments),[")"]))}var Sc="\uFFFD",ot=/[-\x09\x0A\x0D\x20-\x2C\x2E-\uD7FF\uE000-\uFFFD]/;jt&&(ot=B("[",at(ot),"\\u{10000}-\\u{10FFFF}","]"));var Nc=new RegExp("[^"+at(ot)+"]",jt?"u":""),Bn=/[\x20\x09\x0D\x0A]/,Cc=at(Bn),U=B(Bn,"+"),V=B(Bn,"*"),xr=/[:_a-zA-Z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/;jt&&(xr=B("[",at(xr),"\\u{10000}-\\u{10FFFF}","]"));var Oc=at(xr),zs=B("[",Oc,at(/[-.0-9\xB7]/),at(/[\u0300-\u036F\u203F-\u2040]/),"]"),ve=B(xr,zs,"*"),Bc=B("^",ve,"$"),Ca=B(zs,"+"),Ic=B("&",ve,";"),Rc=x(/&#[0-9]+;|&#x[0-9a-fA-F]+;/),Sr=x(Ic,"|",Rc),Nr=B("%",ve,";"),Gs=x(B('"',x(/[^%&"]/,"|",Nr,"|",Sr),"*",'"'),"|",B("'",x(/[^%&']/,"|",Nr,"|",Sr),"*","'")),Mc=x('"',x(/[^<&"]/,"|",Sr),"*",'"',"|","'",x(/[^<&']/,"|",Sr),"*","'"),$c=Pt(xr,":"),Lc=Pt(zs,":"),Vs=B($c,Lc,"*"),Fc=B("^",Vs,"$"),Cr=B(Vs,x(":",Vs),"?"),Uc=B("^",Cr,"$"),Pc=B("(",Cr,")"),qt=x(/"[^"]*"|'[^']*'/),qc=B(/^<\?/,"(",ve,")",x(U,"(?!",Bn,")(",ot,"*?)"),"?",/\?>/),Oa=/[\x20\x0D\x0Aa-zA-Z0-9-'()+,./:=?;!*#@$_%]/,Or=x('"',Oa,'*"',"|","'",Pt(Oa,"'"),"*'"),$a="<!--",La="-->",jc=B($a,x(Pt(ot,"-"),"|",B("-",Pt(ot,"-"))),"*",La),Ba="#PCDATA",Vc=x(B(/\(/,V,Ba,x(V,/\|/,V,Cr),"*",V,/\)\*/),"|",B(/\(/,V,Ba,V,/\)/)),Hc=/[?*+]?/,zc=B(/\([^>]+\)/,Hc),Gc=x("EMPTY","|","ANY","|",Vc,"|",zc),Wc="<!ELEMENT",Xc=B(Wc,U,x(Cr,"|",Nr),U,x(Gc,"|",Nr),V,">"),Yc=B("NOTATION",U,/\(/,V,ve,x(V,/\|/,V,ve),"*",V,/\)/),Zc=B(/\(/,V,Ca,x(V,/\|/,V,Ca),"*",V,/\)/),Jc=x(Yc,"|",Zc),Kc=x(/CDATA|ID|IDREF|IDREFS|ENTITY|ENTITIES|NMTOKEN|NMTOKENS/,"|",Jc),Qc=x(/#REQUIRED|#IMPLIED/,"|",x(x("#FIXED",U),"?",Mc)),ed=x(U,ve,U,Kc,U,Qc),td="<!ATTLIST",rd=B(td,U,ve,ed,"*",V,">"),Hs="about:legacy-compat",nd=x('"'+Hs+'"',"|","'"+Hs+"'"),Ws="SYSTEM",In="PUBLIC",Rn=x(x(Ws,U,qt),"|",x(In,U,Or,U,qt)),sd=B("^",x(x(Ws,U,"(?<SystemLiteralOnly>",qt,")"),"|",x(In,U,"(?<PubidLiteral>",Or,")",U,"(?<SystemLiteral>",qt,")"))),id=B("^",Or,"$"),ad=B("^",qt,"$"),od=x(U,"NDATA",U,ve),ld=x(Gs,"|",x(Rn,od,"?")),Fa="<!ENTITY",ud=B(Fa,U,ve,U,ld,V,">"),cd=x(Gs,"|",Rn),dd=B(Fa,U,"%",U,ve,U,cd,V,">"),fd=x(ud,"|",dd),pd=B(In,U,Or),hd=B("<!NOTATION",U,ve,U,x(Rn,"|",pd),V,">"),Xs=B(V,"=",V),Ia=/1[.]\d+/,md=B(U,"version",Xs,x("'",Ia,"'","|",'"',Ia,'"')),Ra=/[A-Za-z][-A-Za-z0-9._]*/,gd=x(U,"encoding",Xs,x('"',Ra,'"',"|","'",Ra,"'")),_d=x(U,"standalone",Xs,x("'",x("yes","|","no"),"'","|",'"',x("yes","|","no"),'"')),bd=B(/^<\?xml/,md,gd,"?",_d,"?",V,/\?>/),wd="<!DOCTYPE",yd="<![CDATA[",vd="]]>",Ed=/<!\[CDATA\[/,kd=/\]\]>/,Ad=B(ot,"*?",kd),Dd=B(Ed,Ad);N.chars=at;N.chars_without=Pt;N.detectUnicodeSupport=Ma;N.reg=B;N.regg=x;N.ABOUT_LEGACY_COMPAT=Hs;N.ABOUT_LEGACY_COMPAT_SystemLiteral=nd;N.AttlistDecl=rd;N.CDATA_START=yd;N.CDATA_END=vd;N.CDSect=Dd;N.Char=ot;N.Comment=jc;N.COMMENT_START=$a;N.COMMENT_END=La;N.DOCTYPE_DECL_START=wd;N.elementdecl=Xc;N.EntityDecl=fd;N.EntityValue=Gs;N.ExternalID=Rn;N.ExternalID_match=sd;N.Name=ve;N.Name_exact=Bc;N.NCName_exact=Fc;N.NotationDecl=hd;N.Reference=Sr;N.PEReference=Nr;N.PI=qc;N.PUBLIC=In;N.PubidLiteral=Or;N.PubidLiteral_match=id;N.QName=Cr;N.QName_exact=Uc;N.QName_group=Pc;N.S=U;N.SChar_s=Cc;N.S_OPT=V;N.SYSTEM=Ws;N.SystemLiteral=qt;N.SystemLiteral_match=ad;N.InvalidChar=Nc;N.UNICODE_REPLACEMENT_CHARACTER=Sc;N.UNICODE_SUPPORT=jt;N.XMLDecl=bd});var ii=et(W=>{"use strict";var Te=vt(),Pe=Te.find,Td=Te.hasDefaultHTMLNamespace,Ht=Te.hasOwn,xd=Te.isHTMLMimeType,Sd=Te.isHTMLRawTextElement,Nd=Te.isHTMLVoidElement,Br=Te.MIME_TYPE,qe=Te.NAMESPACE,pe=Symbol(),za=Tr(),y=za.DOMException,de=za.DOMExceptionName,G=Ys();function _e(r){if(r!==pe)throw new TypeError("Illegal constructor")}function Cd(r){return r!==""}function Od(r){return r?r.split(/[\t\n\f\r ]+/).filter(Cd):[]}function Bd(r,e){return Ht(r,e)||(r[e]=!0),r}function Ua(r){if(!r)return[];var e=Od(r);return Object.keys(e.reduce(Bd,{}))}function Id(r){return function(e){return r&&r.indexOf(e)!==-1}}function Ga(r){if(!G.QName_exact.test(r))throw new y(y.INVALID_CHARACTER_ERR,'invalid character in qualified name "'+r+'"')}function Js(r,e){Ga(e),r=r||null;var t=null,n=e;if(e.indexOf(":")>=0){var s=e.split(":");t=s[0],n=s[1]}if(t!==null&&r===null)throw new y(y.NAMESPACE_ERR,"prefix is non-null and namespace is null");if(t==="xml"&&r!==Te.NAMESPACE.XML)throw new y(y.NAMESPACE_ERR,'prefix is "xml" and namespace is not the XML namespace');if((t==="xmlns"||e==="xmlns")&&r!==Te.NAMESPACE.XMLNS)throw new y(y.NAMESPACE_ERR,'either qualifiedName or prefix is "xmlns" and namespace is not the XMLNS namespace');if(r===Te.NAMESPACE.XMLNS&&t!=="xmlns"&&e!=="xmlns")throw new y(y.NAMESPACE_ERR,'namespace is the XMLNS namespace and neither qualifiedName nor prefix is "xmlns"');return[r,t,n]}function Wt(r,e){for(var t in r)Ht(r,t)&&(e[t]=r[t])}function be(r,e){var t=r.prototype;if(!(t instanceof e)){let n=function(){};n.prototype=e.prototype,n=new n,Wt(t,n),r.prototype=t=n}t.constructor!=r&&(typeof r!="function"&&console.error("unknown Class:"+r),t.constructor=r)}var we={},De=we.ELEMENT_NODE=1,zt=we.ATTRIBUTE_NODE=2,Ir=we.TEXT_NODE=3,Wa=we.CDATA_SECTION_NODE=4,Xa=we.ENTITY_REFERENCE_NODE=5,Rd=we.ENTITY_NODE=6,Ks=we.PROCESSING_INSTRUCTION_NODE=7,Qs=we.COMMENT_NODE=8,Vt=we.DOCUMENT_NODE=9,Ya=we.DOCUMENT_TYPE_NODE=10,lt=we.DOCUMENT_FRAGMENT_NODE=11,Md=we.NOTATION_NODE=12,z=Te.freeze({DOCUMENT_POSITION_DISCONNECTED:1,DOCUMENT_POSITION_PRECEDING:2,DOCUMENT_POSITION_FOLLOWING:4,DOCUMENT_POSITION_CONTAINS:8,DOCUMENT_POSITION_CONTAINED_BY:16,DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:32});function Za(r,e){if(e.length<r.length)return Za(e,r);var t=null;for(var n in r){if(r[n]!==e[n])return t;t=r[n]}return t}function Pa(r){return r.guid||(r.guid=Math.random()),r.guid}function ee(){}ee.prototype={length:0,item:function(r){return r>=0&&r<this.length?this[r]:null},toString:function(r){var e;typeof r=="function"?e={requireWellFormed:!1,splitCDATASections:!0,nodeFilter:r}:r?e={requireWellFormed:!!r.requireWellFormed,splitCDATASections:r.splitCDATASections!==!1,nodeFilter:r.nodeFilter||null}:e={requireWellFormed:!1,splitCDATASections:!0,nodeFilter:null};for(var t=[],n=0;n<this.length;n++)si(this[n],t,null,e);return t.join("")},filter:function(r){return Array.prototype.filter.call(this,r)},indexOf:function(r){return Array.prototype.indexOf.call(this,r)}};ee.prototype[Symbol.iterator]=function(){var r=this,e=0;return{next:function(){return e<r.length?{value:r[e++],done:!1}:{done:!0}},return:function(){return{done:!0}}}};function Ue(r,e){this._node=r,this._refresh=e,Fn(this)}function Fn(r){var e=r._node._inc||r._node.ownerDocument._inc;if(r._inc!==e){var t=r._refresh(r._node);if(oo(r,"length",t.length),!r.$$length||t.length<r.$$length)for(var n=t.length;n in r;n++)Ht(r,n)&&delete r[n];Wt(t,r),r._inc=e}}Ue.prototype.item=function(r){return Fn(this),this[r]||null};be(Ue,ee);function Gt(){this._nsIndex=Object.create(null),this._noNsIndex=Object.create(null)}function Ja(r,e){for(var t=0;t<r.length;){if(r[t]===e)return t;t++}}function ei(r,e,t){if(!e)return r._noNsIndex;var n=r._nsIndex[e];return!n&&t&&(n=r._nsIndex[e]=Object.create(null)),n}function $d(r,e,t){var n=ei(r,e,!1),s=n&&n[t];return s||null}function Ld(r,e){ei(r,e.namespaceURI,!0)[e.localName]=e}function Fd(r,e){var t=ei(r,e.namespaceURI,!1);t&&delete t[e.localName]}function Ud(r,e,t,n){if(n?e[Ja(e,n)]=t:(e[e.length]=t,e.length++),Ld(e,t),r){t.ownerElement=r;var s=r.ownerDocument;s&&(n&&eo(s,r,n),Pd(s,r,t))}}function qa(r,e,t){var n=Ja(e,t);if(n>=0){for(var s=e.length-1;n<=s;)e[n]=e[++n];if(e.length=s,Fd(e,t),r){var i=r.ownerDocument;i&&eo(i,r,t),t.ownerElement=null}}}Gt.prototype={length:0,item:ee.prototype.item,getNamedItem:function(r){this._ownerElement&&this._ownerElement._isInHTMLDocumentAndNamespace()&&(r=r.toLowerCase());for(var e=0;e<this.length;){var t=this[e];if(t.nodeName===r)return t;e++}return null},setNamedItem:function(r){var e=r.ownerElement;if(e&&e!==this._ownerElement)throw new y(y.INUSE_ATTRIBUTE_ERR);var t=$d(this,r.namespaceURI,r.localName);return t===r?r:(Ud(this._ownerElement,this,r,t),t)},setNamedItemNS:function(r){return this.setNamedItem(r)},removeNamedItem:function(r){var e=this.getNamedItem(r);if(!e)throw new y(y.NOT_FOUND_ERR,r);return qa(this._ownerElement,this,e),e},removeNamedItemNS:function(r,e){var t=this.getNamedItemNS(r,e);if(!t)throw new y(y.NOT_FOUND_ERR,r?r+" : "+e:e);return qa(this._ownerElement,this,t),t},getNamedItemNS:function(r,e){r||(r=null);for(var t=0;t<this.length;){var n=this[t];if(n.localName===e&&n.namespaceURI===r)return n;t++}return null}};Gt.prototype[Symbol.iterator]=function(){var r=this,e=0;return{next:function(){return e<r.length?{value:r[e++],done:!1}:{done:!0}},return:function(){return{done:!0}}}};function Ka(){}Ka.prototype={hasFeature:function(r,e){return!0},createDocument:function(r,e,t){var n=Br.XML_APPLICATION;r===qe.HTML?n=Br.XML_XHTML_APPLICATION:r===qe.SVG&&(n=Br.XML_SVG_IMAGE);var s=new Ye(pe,{contentType:n});if(s.implementation=this,s.childNodes=new ee,s.doctype=t||null,t&&s.appendChild(t),e){var i=s.createElementNS(r,e);s.appendChild(i)}return s},createDocumentType:function(r,e,t,n){Ga(r);var s=new qn(pe);return s.name=r,s.nodeName=r,s.publicId=e||"",s.systemId=t||"",s.internalSubset=n||"",s.childNodes=new ee,s},createHTMLDocument:function(r){var e=new Ye(pe,{contentType:Br.HTML});if(e.implementation=this,e.childNodes=new ee,r!==!1){e.doctype=this.createDocumentType("html"),e.doctype.ownerDocument=e,e.appendChild(e.doctype);var t=e.createElement("html");e.appendChild(t);var n=e.createElement("head");if(t.appendChild(n),typeof r=="string"){var s=e.createElement("title");s.appendChild(e.createTextNode(r)),n.appendChild(s)}t.appendChild(e.createElement("body"))}return e}};function R(r){_e(r)}R.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,parentNode:null,get parentElement(){return this.parentNode&&this.parentNode.nodeType===this.ELEMENT_NODE?this.parentNode:null},childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,baseURI:"about:blank",get isConnected(){var r=this.getRootNode();return r&&r.nodeType===r.DOCUMENT_NODE},contains:function(r){if(!r)return!1;var e=r;do{if(this===e)return!0;e=e.parentNode}while(e);return!1},getRootNode:function(r){var e=this;do{if(!e.parentNode)return e;e=e.parentNode}while(e)},isEqualNode:function(r){if(!r)return!1;for(var e=[{node:this,other:r}];e.length>0;){var t=e.pop(),n=t.node,s=t.other;if(n.nodeType!==s.nodeType)return!1;switch(n.nodeType){case n.DOCUMENT_TYPE_NODE:if(n.name!==s.name||n.publicId!==s.publicId||n.systemId!==s.systemId)return!1;break;case n.ELEMENT_NODE:if(n.namespaceURI!==s.namespaceURI||n.prefix!==s.prefix||n.localName!==s.localName||n.attributes.length!==s.attributes.length)return!1;for(var i=0;i<n.attributes.length;i++){var a=n.attributes.item(i),o=s.getAttributeNodeNS(a.namespaceURI,a.localName);if(!o)return!1;e.push({node:a,other:o})}break;case n.ATTRIBUTE_NODE:if(n.namespaceURI!==s.namespaceURI||n.localName!==s.localName||n.value!==s.value)return!1;break;case n.PROCESSING_INSTRUCTION_NODE:if(n.target!==s.target||n.data!==s.data)return!1;break;case n.TEXT_NODE:case n.CDATA_SECTION_NODE:case n.COMMENT_NODE:if(n.data!==s.data)return!1;break}if(n.childNodes.length!==s.childNodes.length)return!1;for(var i=n.childNodes.length-1;i>=0;i--)e.push({node:n.childNodes[i],other:s.childNodes[i]})}return!0},isSameNode:function(r){return this===r},insertBefore:function(r,e){return Ln(this,r,e)},replaceChild:function(r,e){Ln(this,r,e,no),e&&this.removeChild(e)},removeChild:function(r){return to(this,r)},appendChild:function(r){return this.insertBefore(r,null)},hasChildNodes:function(){return this.firstChild!=null},cloneNode:function(r){return ao(this.ownerDocument||this,this,r)},normalize:function(){oe(this,null,{enter:function(r){for(var e=r.firstChild;e;){var t=e.nextSibling;if(t!==null&&t.nodeType===Ir&&e.nodeType===Ir){for(var n=[],s=t;s!==null&&s.nodeType===Ir;)n.push(s.data),s=s.nextSibling;for(var i=e.nextSibling;i!==s;){var a=i.nextSibling;i.parentNode=null,i.previousSibling=null,i.nextSibling=null,i=a}e.nextSibling=s,s!==null?s.previousSibling=e:r.lastChild=e,e.appendData(n.join("")),ti(r.ownerDocument,r),e=s}else e=t}return!0}})},isSupported:function(r,e){return this.ownerDocument.implementation.hasFeature(r,e)},lookupPrefix:function(r){for(var e=this;e;){var t=e._nsMap;if(t){for(var n in t)if(Ht(t,n)&&t[n]===r)return n}e=e.nodeType==zt?e.ownerDocument:e.parentNode}return null},lookupNamespaceURI:function(r){for(var e=this;e;){var t=e._nsMap;if(t&&Ht(t,r))return t[r];e=e.nodeType==zt?e.ownerDocument:e.parentNode}return null},isDefaultNamespace:function(r){var e=this.lookupPrefix(r);return e==null},compareDocumentPosition:function(r){if(this===r)return 0;var e=r,t=this,n=null,s=null;if(e instanceof Et&&(n=e,e=n.ownerElement),t instanceof Et&&(s=t,t=s.ownerElement,n&&e&&t===e))for(var i=0,a;a=t.attributes[i];i++){if(a===n)return z.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC+z.DOCUMENT_POSITION_PRECEDING;if(a===s)return z.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC+z.DOCUMENT_POSITION_FOLLOWING}if(!e||!t||t.ownerDocument!==e.ownerDocument)return z.DOCUMENT_POSITION_DISCONNECTED+z.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC+(Pa(t.ownerDocument)>Pa(e.ownerDocument)?z.DOCUMENT_POSITION_FOLLOWING:z.DOCUMENT_POSITION_PRECEDING);if(s&&e===t)return z.DOCUMENT_POSITION_CONTAINS+z.DOCUMENT_POSITION_PRECEDING;if(n&&e===t)return z.DOCUMENT_POSITION_CONTAINED_BY+z.DOCUMENT_POSITION_FOLLOWING;for(var o=[],u=e.parentNode;u;){if(!s&&u===t)return z.DOCUMENT_POSITION_CONTAINED_BY+z.DOCUMENT_POSITION_FOLLOWING;o.push(u),u=u.parentNode}o.reverse();for(var l=[],c=t.parentNode;c;){if(!n&&c===e)return z.DOCUMENT_POSITION_CONTAINS+z.DOCUMENT_POSITION_PRECEDING;l.push(c),c=c.parentNode}l.reverse();var d=Za(o,l);for(var f in d.childNodes){var p=d.childNodes[f];if(p===t)return z.DOCUMENT_POSITION_FOLLOWING;if(p===e)return z.DOCUMENT_POSITION_PRECEDING;if(l.indexOf(p)>=0)return z.DOCUMENT_POSITION_FOLLOWING;if(o.indexOf(p)>=0)return z.DOCUMENT_POSITION_PRECEDING}return 0}};function Qa(r){return r=="<"&&"&lt;"||r==">"&&"&gt;"||r=="&"&&"&amp;"||r=='"'&&"&quot;"||"&#"+r.charCodeAt()+";"}Wt(we,R);Wt(we,R.prototype);Wt(z,R);Wt(z,R.prototype);function $n(r,e){oe(r,null,{enter:function(t){return e(t)?oe.STOP:!0}})}function oe(r,e,t){for(var n=[{node:r,context:e,phase:oe.ENTER}];n.length>0;){var s=n.pop();if(s.phase===oe.ENTER){var i=t.enter(s.node,s.context);if(i===oe.STOP)return oe.STOP;if(n.push({node:s.node,context:i,phase:oe.EXIT}),i==null)continue;for(var a=s.node.lastChild;a;)n.push({node:a,context:i,phase:oe.ENTER}),a=a.previousSibling}else t.exit&&t.exit(s.node,s.context)}}oe.STOP=Symbol("walkDOM.STOP");oe.ENTER=0;oe.EXIT=1;function Ye(r,e){_e(r);var t=e||{};this.ownerDocument=this,this.contentType=t.contentType||Br.XML_APPLICATION,this.type=xd(this.contentType)?"html":"xml"}function Pd(r,e,t){r&&r._inc++;var n=t.namespaceURI;n===qe.XMLNS&&(e._nsMap[t.prefix?t.localName:""]=t.value)}function eo(r,e,t,n){r&&r._inc++;var s=t.namespaceURI;s===qe.XMLNS&&delete e._nsMap[t.prefix?t.localName:""]}function ti(r,e,t){if(r&&r._inc){r._inc++;var n=e.childNodes;if(t&&!t.nextSibling)n[n.length++]=t;else{for(var s=e.firstChild,i=0;s;)n[i++]=s,s=s.nextSibling;n.length=i,delete n[n.length]}}}function to(r,e){if(r!==e.parentNode)throw new y(y.NOT_FOUND_ERR,"child's parent is not parent");var t=e.previousSibling,n=e.nextSibling;return t?t.nextSibling=n:r.firstChild=n,n?n.previousSibling=t:r.lastChild=t,ti(r.ownerDocument,r),e.parentNode=null,e.previousSibling=null,e.nextSibling=null,e}function qd(r){return r&&(r.nodeType===R.DOCUMENT_NODE||r.nodeType===R.DOCUMENT_FRAGMENT_NODE||r.nodeType===R.ELEMENT_NODE)}function jd(r){return r&&(r.nodeType===R.CDATA_SECTION_NODE||r.nodeType===R.COMMENT_NODE||r.nodeType===R.DOCUMENT_FRAGMENT_NODE||r.nodeType===R.DOCUMENT_TYPE_NODE||r.nodeType===R.ELEMENT_NODE||r.nodeType===R.PROCESSING_INSTRUCTION_NODE||r.nodeType===R.TEXT_NODE)}function ut(r){return r&&r.nodeType===R.DOCUMENT_TYPE_NODE}function Xe(r){return r&&r.nodeType===R.ELEMENT_NODE}function ro(r){return r&&r.nodeType===R.TEXT_NODE}function ja(r,e){var t=r.childNodes||[];if(Pe(t,Xe)||ut(e))return!1;var n=Pe(t,ut);return!(e&&n&&t.indexOf(n)>t.indexOf(e))}function Va(r,e){var t=r.childNodes||[];function n(i){return Xe(i)&&i!==e}if(Pe(t,n))return!1;var s=Pe(t,ut);return!(e&&s&&t.indexOf(s)>t.indexOf(e))}function Vd(r,e,t){if(!qd(r))throw new y(y.HIERARCHY_REQUEST_ERR,"Unexpected parent node type "+r.nodeType);if(t&&t.parentNode!==r)throw new y(y.NOT_FOUND_ERR,"child not in parent");if(!jd(e)||ut(e)&&r.nodeType!==R.DOCUMENT_NODE)throw new y(y.HIERARCHY_REQUEST_ERR,"Unexpected node type "+e.nodeType+" for parent node type "+r.nodeType)}function Hd(r,e,t){var n=r.childNodes||[],s=e.childNodes||[];if(e.nodeType===R.DOCUMENT_FRAGMENT_NODE){var i=s.filter(Xe);if(i.length>1||Pe(s,ro))throw new y(y.HIERARCHY_REQUEST_ERR,"More than one element or text in fragment");if(i.length===1&&!ja(r,t))throw new y(y.HIERARCHY_REQUEST_ERR,"Element in fragment can not be inserted before doctype")}if(Xe(e)&&!ja(r,t))throw new y(y.HIERARCHY_REQUEST_ERR,"Only one element can be added and only after doctype");if(ut(e)){if(Pe(n,ut))throw new y(y.HIERARCHY_REQUEST_ERR,"Only one doctype is allowed");var a=Pe(n,Xe);if(t&&n.indexOf(a)<n.indexOf(t))throw new y(y.HIERARCHY_REQUEST_ERR,"Doctype can only be inserted before an element");if(!t&&a)throw new y(y.HIERARCHY_REQUEST_ERR,"Doctype can not be appended since element is present")}}function no(r,e,t){var n=r.childNodes||[],s=e.childNodes||[];if(e.nodeType===R.DOCUMENT_FRAGMENT_NODE){var i=s.filter(Xe);if(i.length>1||Pe(s,ro))throw new y(y.HIERARCHY_REQUEST_ERR,"More than one element or text in fragment");if(i.length===1&&!Va(r,t))throw new y(y.HIERARCHY_REQUEST_ERR,"Element in fragment can not be inserted before doctype")}if(Xe(e)&&!Va(r,t))throw new y(y.HIERARCHY_REQUEST_ERR,"Only one element can be added and only after doctype");if(ut(e)){if(Pe(n,function(u){return ut(u)&&u!==t}))throw new y(y.HIERARCHY_REQUEST_ERR,"Only one doctype is allowed");var a=Pe(n,Xe);if(t&&n.indexOf(a)<n.indexOf(t))throw new y(y.HIERARCHY_REQUEST_ERR,"Doctype can only be inserted before an element")}}function Ln(r,e,t,n){Vd(r,e,t),r.nodeType===R.DOCUMENT_NODE&&(n||Hd)(r,e,t);var s=e.parentNode;if(s&&s.removeChild(e),e.nodeType===lt){var i=e.firstChild;if(i==null)return e;var a=e.lastChild}else i=a=e;var o=t?t.previousSibling:r.lastChild;i.previousSibling=o,a.nextSibling=t,o?o.nextSibling=i:r.firstChild=i,t==null?r.lastChild=a:t.previousSibling=a;do i.parentNode=r;while(i!==a&&(i=i.nextSibling));return ti(r.ownerDocument||r,r,e),e.nodeType==lt&&(e.firstChild=e.lastChild=null),e}Ye.prototype={implementation:null,nodeName:"#document",nodeType:Vt,doctype:null,documentElement:null,_inc:1,insertBefore:function(r,e){if(r.nodeType===lt){for(var t=r.firstChild;t;){var n=t.nextSibling;this.insertBefore(t,e),t=n}return r}return Ln(this,r,e),r.ownerDocument=this,this.documentElement===null&&r.nodeType===De&&(this.documentElement=r),r},removeChild:function(r){var e=to(this,r);return e===this.documentElement&&(this.documentElement=null),e},replaceChild:function(r,e){Ln(this,r,e,no),r.ownerDocument=this,e&&this.removeChild(e),Xe(r)&&(this.documentElement=r)},importNode:function(r,e){return zd(this,r,e)},getElementById:function(r){var e=null;return $n(this.documentElement,function(t){if(t.nodeType==De&&t.getAttribute("id")==r)return e=t,!0}),e},createElement:function(r){var e=new Ze(pe);e.ownerDocument=this,this.type==="html"&&(r=r.toLowerCase()),Td(this.contentType)&&(e.namespaceURI=qe.HTML),e.nodeName=r,e.tagName=r,e.localName=r,e.childNodes=new ee;var t=e.attributes=new Gt;return t._ownerElement=e,e},createDocumentFragment:function(){var r=new Xt(pe);return r.ownerDocument=this,r.childNodes=new ee,r},createTextNode:function(r){var e=new Rr(pe);return e.ownerDocument=this,e.childNodes=new ee,e.appendData(r),e},createComment:function(r){var e=new Un(pe);return e.ownerDocument=this,e.childNodes=new ee,e.appendData(r),e},createCDATASection:function(r){if(r.indexOf("]]>")!==-1)throw new y(y.INVALID_CHARACTER_ERR,'data contains "]]>"');var e=new Pn(pe);return e.ownerDocument=this,e.childNodes=new ee,e.appendData(r),e},createProcessingInstruction:function(r,e){var t=new Vn(pe);return t.ownerDocument=this,t.childNodes=new ee,t.nodeName=t.target=r,t.nodeValue=t.data=e,t},createAttribute:function(r){if(!G.QName_exact.test(r))throw new y(y.INVALID_CHARACTER_ERR,'invalid character in name "'+r+'"');return this.type==="html"&&(r=r.toLowerCase()),this._createAttribute(r)},_createAttribute:function(r){var e=new Et(pe);return e.ownerDocument=this,e.childNodes=new ee,e.name=r,e.nodeName=r,e.localName=r,e.specified=!0,e},createEntityReference:function(r){if(!G.Name_exact.test(r))throw new y(y.INVALID_CHARACTER_ERR,'not a valid xml name "'+r+'"');if(this.type==="html")throw new y("document is an html document",de.NotSupportedError);var e=new jn(pe);return e.ownerDocument=this,e.childNodes=new ee,e.nodeName=r,e},createElementNS:function(r,e){var t=Js(r,e),n=new Ze(pe),s=n.attributes=new Gt;return n.childNodes=new ee,n.ownerDocument=this,n.nodeName=e,n.tagName=e,n.namespaceURI=t[0],n.prefix=t[1],n.localName=t[2],s._ownerElement=n,n},createAttributeNS:function(r,e){var t=Js(r,e),n=new Et(pe);return n.ownerDocument=this,n.childNodes=new ee,n.nodeName=e,n.name=e,n.specified=!0,n.namespaceURI=t[0],n.prefix=t[1],n.localName=t[2],n}};be(Ye,R);function Ze(r){_e(r),this._nsMap=Object.create(null)}Ze.prototype={nodeType:De,attributes:null,getQualifiedName:function(){return this.prefix?this.prefix+":"+this.localName:this.localName},_isInHTMLDocumentAndNamespace:function(){return this.ownerDocument.type==="html"&&this.namespaceURI===qe.HTML},hasAttributes:function(){return!!(this.attributes&&this.attributes.length)},hasAttribute:function(r){return!!this.getAttributeNode(r)},getAttribute:function(r){var e=this.getAttributeNode(r);return e?e.value:null},getAttributeNode:function(r){return this._isInHTMLDocumentAndNamespace()&&(r=r.toLowerCase()),this.attributes.getNamedItem(r)},setAttribute:function(r,e){this._isInHTMLDocumentAndNamespace()&&(r=r.toLowerCase());var t=this.getAttributeNode(r);t?t.value=t.nodeValue=""+e:(t=this.ownerDocument._createAttribute(r),t.value=t.nodeValue=""+e,this.setAttributeNode(t))},removeAttribute:function(r){var e=this.getAttributeNode(r);e&&this.removeAttributeNode(e)},setAttributeNode:function(r){return this.attributes.setNamedItem(r)},setAttributeNodeNS:function(r){return this.attributes.setNamedItemNS(r)},removeAttributeNode:function(r){return this.attributes.removeNamedItem(r.nodeName)},removeAttributeNS:function(r,e){var t=this.getAttributeNodeNS(r,e);t&&this.removeAttributeNode(t)},hasAttributeNS:function(r,e){return this.getAttributeNodeNS(r,e)!=null},getAttributeNS:function(r,e){var t=this.getAttributeNodeNS(r,e);return t?t.value:null},setAttributeNS:function(r,e,t){var n=Js(r,e),s=n[2],i=this.getAttributeNodeNS(r,s);i?i.value=i.nodeValue=""+t:(i=this.ownerDocument.createAttributeNS(r,e),i.value=i.nodeValue=""+t,this.setAttributeNode(i))},getAttributeNodeNS:function(r,e){return this.attributes.getNamedItemNS(r,e)},getElementsByClassName:function(r){var e=Ua(r);return new Ue(this,function(t){var n=[];return e.length>0&&$n(t,function(s){if(s!==t&&s.nodeType===De){var i=s.getAttribute("class");if(i){var a=r===i;if(!a){var o=Ua(i);a=e.every(Id(o))}a&&n.push(s)}}}),n})},getElementsByTagName:function(r){var e=(this.nodeType===Vt?this:this.ownerDocument).type==="html",t=r.toLowerCase();return new Ue(this,function(n){var s=[];return $n(n,function(i){if(!(i===n||i.nodeType!==De))if(r==="*")s.push(i);else{var a=i.getQualifiedName(),o=e&&i.namespaceURI===qe.HTML?t:r;a===o&&s.push(i)}}),s})},getElementsByTagNameNS:function(r,e){return new Ue(this,function(t){var n=[];return $n(t,function(s){s!==t&&s.nodeType===De&&(r==="*"||s.namespaceURI===r)&&(e==="*"||s.localName==e)&&n.push(s)}),n})}};Ye.prototype.getElementsByClassName=Ze.prototype.getElementsByClassName;Ye.prototype.getElementsByTagName=Ze.prototype.getElementsByTagName;Ye.prototype.getElementsByTagNameNS=Ze.prototype.getElementsByTagNameNS;be(Ze,R);function Et(r){_e(r),this.namespaceURI=null,this.prefix=null,this.ownerElement=null}Et.prototype.nodeType=zt;be(Et,R);function ct(r){_e(r)}ct.prototype={data:"",substringData:function(r,e){return this.data.substring(r,r+e)},appendData:function(r){r=this.data+r,this.nodeValue=this.data=r,this.length=r.length},insertData:function(r,e){this.replaceData(r,0,e)},deleteData:function(r,e){this.replaceData(r,e,"")},replaceData:function(r,e,t){var n=this.data.substring(0,r),s=this.data.substring(r+e);t=n+t+s,this.nodeValue=this.data=t,this.length=t.length}};be(ct,R);function Rr(r){_e(r)}Rr.prototype={nodeName:"#text",nodeType:Ir,splitText:function(r){var e=this.data,t=e.substring(r);e=e.substring(0,r),this.data=this.nodeValue=e,this.length=e.length;var n=this.ownerDocument.createTextNode(t);return this.parentNode&&this.parentNode.insertBefore(n,this.nextSibling),n}};be(Rr,ct);function Un(r){_e(r)}Un.prototype={nodeName:"#comment",nodeType:Qs};be(Un,ct);function Pn(r){_e(r)}Pn.prototype={nodeName:"#cdata-section",nodeType:Wa};be(Pn,Rr);function qn(r){_e(r)}qn.prototype.nodeType=Ya;be(qn,R);function ri(r){_e(r)}ri.prototype.nodeType=Md;be(ri,R);function ni(r){_e(r)}ni.prototype.nodeType=Rd;be(ni,R);function jn(r){_e(r)}jn.prototype.nodeType=Xa;be(jn,R);function Xt(r){_e(r)}Xt.prototype.nodeName="#document-fragment";Xt.prototype.nodeType=lt;be(Xt,R);function Vn(r){_e(r)}Vn.prototype.nodeType=Ks;be(Vn,ct);function so(){}so.prototype.serializeToString=function(r,e){return io.call(r,e)};R.prototype.toString=io;function io(r){var e;typeof r=="function"?e={requireWellFormed:!1,splitCDATASections:!0,nodeFilter:r}:r!=null?e={requireWellFormed:!!r.requireWellFormed,splitCDATASections:r.splitCDATASections!==!1,nodeFilter:r.nodeFilter||null}:e={requireWellFormed:!1,splitCDATASections:!0,nodeFilter:null};var t=[],n=this.nodeType===Vt&&this.documentElement||this,s=n.prefix,i=n.namespaceURI;if(i&&s==null){var s=n.lookupPrefix(i);if(s==null)var a=[{namespace:i,prefix:null}]}return si(this,t,a,e),t.join("")}function Ha(r,e,t){var n=r.prefix||"",s=r.namespaceURI;if(!s||n==="xml"&&s===qe.XML||s===qe.XMLNS)return!1;for(var i=t.length;i--;){var a=t[i];if(a.prefix===n)return a.namespace!==s}return!0}function Mn(r,e,t,n){if(n&&!G.QName_exact.test(e))throw new y('The attribute name "'+e+'" is not a valid XML QName',de.InvalidStateError);r.push(" ",e,'="',t.replace(/[<>&"\t\n\r]/g,Qa),'"')}function si(r,e,t,n){t||(t=[]);var s=n.nodeFilter,i=n.requireWellFormed,a=n.splitCDATASections,o=r.nodeType===Vt?r:r.ownerDocument,u=o.type==="html";oe(r,{ns:t},{enter:function(l,c){var d=c.ns;if(s)if(l=s(l),l){if(typeof l=="string")return e.push(l),null}else return null;switch(l.nodeType){case De:var f=l.attributes,p=f.length,h=l.tagName,m=h;if(!u&&!l.prefix&&l.namespaceURI){for(var g,b=0;b<f.length;b++)if(f.item(b).name==="xmlns"){g=f.item(b).value;break}if(!g)for(var v=d.length-1;v>=0;v--){var w=d[v];if(w.prefix===""&&w.namespace===l.namespaceURI){g=w.namespace;break}}if(g!==l.namespaceURI)for(var v=d.length-1;v>=0;v--){var w=d[v];if(w.namespace===l.namespaceURI){w.prefix&&(m=w.prefix+":"+h);break}}}if(i&&!G.QName_exact.test(m))throw new y('The element name "'+m+'" is not a valid XML QName',de.InvalidStateError);e.push("<",m);for(var k=d.slice(),I=0;I<p;I++){var L=f.item(I);L.prefix=="xmlns"?k.push({prefix:L.localName,namespace:L.value}):L.nodeName=="xmlns"&&k.push({prefix:"",namespace:L.value})}for(var I=0;I<p;I++){var L=f.item(I);if(Ha(L,u,k)){var Y=L.prefix||"",X=L.namespaceURI;Mn(e,Y?"xmlns:"+Y:"xmlns",X,i),k.push({prefix:Y,namespace:X})}var re=s?s(L):L;re&&(typeof re=="string"?e.push(re):Mn(e,re.name,re.value,i))}if(h===m&&Ha(l,u,k)){var ze=l.prefix||"",X=l.namespaceURI;Mn(e,ze?"xmlns:"+ze:"xmlns",X,i),k.push({prefix:ze,namespace:X})}var K=!l.firstChild;if(K&&(u||l.namespaceURI===qe.HTML)&&(K=Nd(h)),K)return e.push("/>"),null;if(e.push(">"),u&&Sd(h)){for(var fe=l.firstChild;fe;)fe.data?e.push(fe.data):si(fe,e,k.slice(),n),fe=fe.nextSibling;return e.push("</",m,">"),null}return{ns:k,tag:m};case Vt:case lt:if(i&&l.nodeType===Vt&&l.documentElement==null)throw new y("The Document has no documentElement",de.InvalidStateError);return{ns:d};case zt:return Mn(e,l.name,l.value,i),null;case Ir:if(i&&G.InvalidChar.test(l.data))throw new y("The Text node data contains characters outside the XML Char production",de.InvalidStateError);return e.push(l.data.replace(/[<&>]/g,Qa)),null;case Wa:if(i&&l.data.indexOf("]]>")!==-1)throw new y('The CDATASection data contains "]]>"',de.InvalidStateError);return a?e.push(G.CDATA_START,l.data.replace(/]]>/g,"]]]]><![CDATA[>"),G.CDATA_END):e.push(G.CDATA_START,l.data,G.CDATA_END),null;case Qs:if(i){if(G.InvalidChar.test(l.data))throw new y("The comment node data contains characters outside the XML Char production",de.InvalidStateError);if(l.data.indexOf("--")!==-1||l.data[l.data.length-1]==="-")throw new y('The comment node data contains "--" or ends with "-"',de.InvalidStateError)}return e.push(G.COMMENT_START,l.data,G.COMMENT_END),null;case Ya:var ke=l.publicId,q=l.systemId;if(i){if(!G.Name_exact.test(l.name))throw new y('The doctype name "'+l.name+'" is not a valid XML Name',de.InvalidStateError);if(ke&&!G.PubidLiteral_match.test(ke))throw new y("DocumentType publicId is not a valid PubidLiteral",de.InvalidStateError);if(q&&q!=="."&&!G.SystemLiteral_match.test(q))throw new y("DocumentType systemId is not a valid SystemLiteral",de.InvalidStateError);if(l.internalSubset&&l.internalSubset.indexOf("]>")!==-1)throw new y('DocumentType internalSubset contains "]>"',de.InvalidStateError)}return e.push(G.DOCTYPE_DECL_START," ",l.name),ke?(e.push(" ",G.PUBLIC," ",ke),q&&q!=="."&&e.push(" ",q)):q&&q!=="."&&e.push(" ",G.SYSTEM," ",q),l.internalSubset&&e.push(" [",l.internalSubset,"]"),e.push(">"),null;case Ks:if(i){if(!G.NCName_exact.test(l.target)||l.target.toLowerCase()==="xml")throw new y('The processing instruction target "'+l.target+'" is not a valid XML NCName or is reserved',de.InvalidStateError);if(G.InvalidChar.test(l.data))throw new y("The ProcessingInstruction data contains characters outside the XML Char production",de.InvalidStateError);if(l.data.indexOf("?>")!==-1)throw new y('The ProcessingInstruction data contains "?>"',de.InvalidStateError)}return e.push("<?",l.target," ",l.data,"?>"),null;case Xa:if(i&&!G.Name_exact.test(l.nodeName))throw new y('The entity reference name "'+l.nodeName+'" is not a valid XML Name',de.InvalidStateError);return e.push("&",l.nodeName,";"),null;default:return e.push("??",l.nodeName),null}},exit:function(l,c){c&&c.tag&&e.push("</",c.tag,">")}})}function zd(r,e,t){var n;return oe(e,null,{enter:function(s,i){var a=s.cloneNode(!1);a.ownerDocument=r,a.parentNode=null,i===null?n=a:i.appendChild(a);var o=s.nodeType===zt||t;return o?a:null}}),n}function ao(r,e,t){var n;return oe(e,null,{enter:function(s,i){var a=new s.constructor(pe);for(var o in s)if(Ht(s,o)){var u=s[o];typeof u!="object"&&u!=a[o]&&(a[o]=u)}s.childNodes&&(a.childNodes=new ee),a.ownerDocument=r;var l=t;switch(a.nodeType){case De:var c=s.attributes,d=a.attributes=new Gt,f=c.length;d._ownerElement=a;for(var p=0;p<f;p++)a.setAttributeNode(ao(r,c.item(p),!0));break;case zt:l=!0}return i!==null?i.appendChild(a):n=a,l?a:null}}),n}function oo(r,e,t){r[e]=t}function Zs(r){for(var e=[],t=r.firstChild;t;)t.nodeType===De&&e.push(t),t=t.nextSibling;return e}try{Object.defineProperty&&(Object.defineProperty(Ue.prototype,"length",{get:function(){return Fn(this),this.$$length}}),Object.defineProperty(R.prototype,"textContent",{get:function(){if(this.nodeType===De||this.nodeType===lt){var r=[];return oe(this,null,{enter:function(e){if(e.nodeType===De||e.nodeType===lt)return!0;if(e.nodeType===Ks||e.nodeType===Qs)return null;r.push(e.nodeValue)}}),r.join("")}return this.nodeValue},set:function(r){switch(this.nodeType){case De:case lt:for(;this.firstChild;)this.removeChild(this.firstChild);(r||String(r))&&this.appendChild(this.ownerDocument.createTextNode(r));break;default:this.data=r,this.value=r,this.nodeValue=r}}}),Object.defineProperty(ct.prototype,"data",{get:function(){return this._data!=null?this._data:""},set:function(r){this._data=r,this.length=typeof r=="string"?r.length:0}}),Object.defineProperty(ct.prototype,"nodeValue",{get:function(){return this.data},set:function(r){this.data=r},enumerable:!0,configurable:!0}),Object.defineProperty(Ze.prototype,"children",{get:function(){return new Ue(this,Zs)}}),Object.defineProperty(Ye.prototype,"children",{get:function(){return new Ue(this,Zs)}}),Object.defineProperty(Xt.prototype,"children",{get:function(){return new Ue(this,Zs)}}),oo=function(r,e,t){r["$$"+e]=t})}catch{}W._updateLiveList=Fn;W.Attr=Et;W.CDATASection=Pn;W.CharacterData=ct;W.Comment=Un;W.Document=Ye;W.DocumentFragment=Xt;W.DocumentType=qn;W.DOMImplementation=Ka;W.Element=Ze;W.Entity=ni;W.EntityReference=jn;W.LiveNodeList=Ue;W.NamedNodeMap=Gt;W.Node=R;W.NodeList=ee;W.Notation=ri;W.Text=Rr;W.ProcessingInstruction=Vn;W.walkDOM=oe;W.XMLSerializer=so});var uo=et(Mr=>{"use strict";var lo=vt().freeze;Mr.XML_ENTITIES=lo({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'});Mr.HTML_ENTITIES=lo({Aacute:"\xC1",aacute:"\xE1",Abreve:"\u0102",abreve:"\u0103",ac:"\u223E",acd:"\u223F",acE:"\u223E\u0333",Acirc:"\xC2",acirc:"\xE2",acute:"\xB4",Acy:"\u0410",acy:"\u0430",AElig:"\xC6",aelig:"\xE6",af:"\u2061",Afr:"\u{1D504}",afr:"\u{1D51E}",Agrave:"\xC0",agrave:"\xE0",alefsym:"\u2135",aleph:"\u2135",Alpha:"\u0391",alpha:"\u03B1",Amacr:"\u0100",amacr:"\u0101",amalg:"\u2A3F",AMP:"&",amp:"&",And:"\u2A53",and:"\u2227",andand:"\u2A55",andd:"\u2A5C",andslope:"\u2A58",andv:"\u2A5A",ang:"\u2220",ange:"\u29A4",angle:"\u2220",angmsd:"\u2221",angmsdaa:"\u29A8",angmsdab:"\u29A9",angmsdac:"\u29AA",angmsdad:"\u29AB",angmsdae:"\u29AC",angmsdaf:"\u29AD",angmsdag:"\u29AE",angmsdah:"\u29AF",angrt:"\u221F",angrtvb:"\u22BE",angrtvbd:"\u299D",angsph:"\u2222",angst:"\xC5",angzarr:"\u237C",Aogon:"\u0104",aogon:"\u0105",Aopf:"\u{1D538}",aopf:"\u{1D552}",ap:"\u2248",apacir:"\u2A6F",apE:"\u2A70",ape:"\u224A",apid:"\u224B",apos:"'",ApplyFunction:"\u2061",approx:"\u2248",approxeq:"\u224A",Aring:"\xC5",aring:"\xE5",Ascr:"\u{1D49C}",ascr:"\u{1D4B6}",Assign:"\u2254",ast:"*",asymp:"\u2248",asympeq:"\u224D",Atilde:"\xC3",atilde:"\xE3",Auml:"\xC4",auml:"\xE4",awconint:"\u2233",awint:"\u2A11",backcong:"\u224C",backepsilon:"\u03F6",backprime:"\u2035",backsim:"\u223D",backsimeq:"\u22CD",Backslash:"\u2216",Barv:"\u2AE7",barvee:"\u22BD",Barwed:"\u2306",barwed:"\u2305",barwedge:"\u2305",bbrk:"\u23B5",bbrktbrk:"\u23B6",bcong:"\u224C",Bcy:"\u0411",bcy:"\u0431",bdquo:"\u201E",becaus:"\u2235",Because:"\u2235",because:"\u2235",bemptyv:"\u29B0",bepsi:"\u03F6",bernou:"\u212C",Bernoullis:"\u212C",Beta:"\u0392",beta:"\u03B2",beth:"\u2136",between:"\u226C",Bfr:"\u{1D505}",bfr:"\u{1D51F}",bigcap:"\u22C2",bigcirc:"\u25EF",bigcup:"\u22C3",bigodot:"\u2A00",bigoplus:"\u2A01",bigotimes:"\u2A02",bigsqcup:"\u2A06",bigstar:"\u2605",bigtriangledown:"\u25BD",bigtriangleup:"\u25B3",biguplus:"\u2A04",bigvee:"\u22C1",bigwedge:"\u22C0",bkarow:"\u290D",blacklozenge:"\u29EB",blacksquare:"\u25AA",blacktriangle:"\u25B4",blacktriangledown:"\u25BE",blacktriangleleft:"\u25C2",blacktriangleright:"\u25B8",blank:"\u2423",blk12:"\u2592",blk14:"\u2591",blk34:"\u2593",block:"\u2588",bne:"=\u20E5",bnequiv:"\u2261\u20E5",bNot:"\u2AED",bnot:"\u2310",Bopf:"\u{1D539}",bopf:"\u{1D553}",bot:"\u22A5",bottom:"\u22A5",bowtie:"\u22C8",boxbox:"\u29C9",boxDL:"\u2557",boxDl:"\u2556",boxdL:"\u2555",boxdl:"\u2510",boxDR:"\u2554",boxDr:"\u2553",boxdR:"\u2552",boxdr:"\u250C",boxH:"\u2550",boxh:"\u2500",boxHD:"\u2566",boxHd:"\u2564",boxhD:"\u2565",boxhd:"\u252C",boxHU:"\u2569",boxHu:"\u2567",boxhU:"\u2568",boxhu:"\u2534",boxminus:"\u229F",boxplus:"\u229E",boxtimes:"\u22A0",boxUL:"\u255D",boxUl:"\u255C",boxuL:"\u255B",boxul:"\u2518",boxUR:"\u255A",boxUr:"\u2559",boxuR:"\u2558",boxur:"\u2514",boxV:"\u2551",boxv:"\u2502",boxVH:"\u256C",boxVh:"\u256B",boxvH:"\u256A",boxvh:"\u253C",boxVL:"\u2563",boxVl:"\u2562",boxvL:"\u2561",boxvl:"\u2524",boxVR:"\u2560",boxVr:"\u255F",boxvR:"\u255E",boxvr:"\u251C",bprime:"\u2035",Breve:"\u02D8",breve:"\u02D8",brvbar:"\xA6",Bscr:"\u212C",bscr:"\u{1D4B7}",bsemi:"\u204F",bsim:"\u223D",bsime:"\u22CD",bsol:"\\",bsolb:"\u29C5",bsolhsub:"\u27C8",bull:"\u2022",bullet:"\u2022",bump:"\u224E",bumpE:"\u2AAE",bumpe:"\u224F",Bumpeq:"\u224E",bumpeq:"\u224F",Cacute:"\u0106",cacute:"\u0107",Cap:"\u22D2",cap:"\u2229",capand:"\u2A44",capbrcup:"\u2A49",capcap:"\u2A4B",capcup:"\u2A47",capdot:"\u2A40",CapitalDifferentialD:"\u2145",caps:"\u2229\uFE00",caret:"\u2041",caron:"\u02C7",Cayleys:"\u212D",ccaps:"\u2A4D",Ccaron:"\u010C",ccaron:"\u010D",Ccedil:"\xC7",ccedil:"\xE7",Ccirc:"\u0108",ccirc:"\u0109",Cconint:"\u2230",ccups:"\u2A4C",ccupssm:"\u2A50",Cdot:"\u010A",cdot:"\u010B",cedil:"\xB8",Cedilla:"\xB8",cemptyv:"\u29B2",cent:"\xA2",CenterDot:"\xB7",centerdot:"\xB7",Cfr:"\u212D",cfr:"\u{1D520}",CHcy:"\u0427",chcy:"\u0447",check:"\u2713",checkmark:"\u2713",Chi:"\u03A7",chi:"\u03C7",cir:"\u25CB",circ:"\u02C6",circeq:"\u2257",circlearrowleft:"\u21BA",circlearrowright:"\u21BB",circledast:"\u229B",circledcirc:"\u229A",circleddash:"\u229D",CircleDot:"\u2299",circledR:"\xAE",circledS:"\u24C8",CircleMinus:"\u2296",CirclePlus:"\u2295",CircleTimes:"\u2297",cirE:"\u29C3",cire:"\u2257",cirfnint:"\u2A10",cirmid:"\u2AEF",cirscir:"\u29C2",ClockwiseContourIntegral:"\u2232",CloseCurlyDoubleQuote:"\u201D",CloseCurlyQuote:"\u2019",clubs:"\u2663",clubsuit:"\u2663",Colon:"\u2237",colon:":",Colone:"\u2A74",colone:"\u2254",coloneq:"\u2254",comma:",",commat:"@",comp:"\u2201",compfn:"\u2218",complement:"\u2201",complexes:"\u2102",cong:"\u2245",congdot:"\u2A6D",Congruent:"\u2261",Conint:"\u222F",conint:"\u222E",ContourIntegral:"\u222E",Copf:"\u2102",copf:"\u{1D554}",coprod:"\u2210",Coproduct:"\u2210",COPY:"\xA9",copy:"\xA9",copysr:"\u2117",CounterClockwiseContourIntegral:"\u2233",crarr:"\u21B5",Cross:"\u2A2F",cross:"\u2717",Cscr:"\u{1D49E}",cscr:"\u{1D4B8}",csub:"\u2ACF",csube:"\u2AD1",csup:"\u2AD0",csupe:"\u2AD2",ctdot:"\u22EF",cudarrl:"\u2938",cudarrr:"\u2935",cuepr:"\u22DE",cuesc:"\u22DF",cularr:"\u21B6",cularrp:"\u293D",Cup:"\u22D3",cup:"\u222A",cupbrcap:"\u2A48",CupCap:"\u224D",cupcap:"\u2A46",cupcup:"\u2A4A",cupdot:"\u228D",cupor:"\u2A45",cups:"\u222A\uFE00",curarr:"\u21B7",curarrm:"\u293C",curlyeqprec:"\u22DE",curlyeqsucc:"\u22DF",curlyvee:"\u22CE",curlywedge:"\u22CF",curren:"\xA4",curvearrowleft:"\u21B6",curvearrowright:"\u21B7",cuvee:"\u22CE",cuwed:"\u22CF",cwconint:"\u2232",cwint:"\u2231",cylcty:"\u232D",Dagger:"\u2021",dagger:"\u2020",daleth:"\u2138",Darr:"\u21A1",dArr:"\u21D3",darr:"\u2193",dash:"\u2010",Dashv:"\u2AE4",dashv:"\u22A3",dbkarow:"\u290F",dblac:"\u02DD",Dcaron:"\u010E",dcaron:"\u010F",Dcy:"\u0414",dcy:"\u0434",DD:"\u2145",dd:"\u2146",ddagger:"\u2021",ddarr:"\u21CA",DDotrahd:"\u2911",ddotseq:"\u2A77",deg:"\xB0",Del:"\u2207",Delta:"\u0394",delta:"\u03B4",demptyv:"\u29B1",dfisht:"\u297F",Dfr:"\u{1D507}",dfr:"\u{1D521}",dHar:"\u2965",dharl:"\u21C3",dharr:"\u21C2",DiacriticalAcute:"\xB4",DiacriticalDot:"\u02D9",DiacriticalDoubleAcute:"\u02DD",DiacriticalGrave:"`",DiacriticalTilde:"\u02DC",diam:"\u22C4",Diamond:"\u22C4",diamond:"\u22C4",diamondsuit:"\u2666",diams:"\u2666",die:"\xA8",DifferentialD:"\u2146",digamma:"\u03DD",disin:"\u22F2",div:"\xF7",divide:"\xF7",divideontimes:"\u22C7",divonx:"\u22C7",DJcy:"\u0402",djcy:"\u0452",dlcorn:"\u231E",dlcrop:"\u230D",dollar:"$",Dopf:"\u{1D53B}",dopf:"\u{1D555}",Dot:"\xA8",dot:"\u02D9",DotDot:"\u20DC",doteq:"\u2250",doteqdot:"\u2251",DotEqual:"\u2250",dotminus:"\u2238",dotplus:"\u2214",dotsquare:"\u22A1",doublebarwedge:"\u2306",DoubleContourIntegral:"\u222F",DoubleDot:"\xA8",DoubleDownArrow:"\u21D3",DoubleLeftArrow:"\u21D0",DoubleLeftRightArrow:"\u21D4",DoubleLeftTee:"\u2AE4",DoubleLongLeftArrow:"\u27F8",DoubleLongLeftRightArrow:"\u27FA",DoubleLongRightArrow:"\u27F9",DoubleRightArrow:"\u21D2",DoubleRightTee:"\u22A8",DoubleUpArrow:"\u21D1",DoubleUpDownArrow:"\u21D5",DoubleVerticalBar:"\u2225",DownArrow:"\u2193",Downarrow:"\u21D3",downarrow:"\u2193",DownArrowBar:"\u2913",DownArrowUpArrow:"\u21F5",DownBreve:"\u0311",downdownarrows:"\u21CA",downharpoonleft:"\u21C3",downharpoonright:"\u21C2",DownLeftRightVector:"\u2950",DownLeftTeeVector:"\u295E",DownLeftVector:"\u21BD",DownLeftVectorBar:"\u2956",DownRightTeeVector:"\u295F",DownRightVector:"\u21C1",DownRightVectorBar:"\u2957",DownTee:"\u22A4",DownTeeArrow:"\u21A7",drbkarow:"\u2910",drcorn:"\u231F",drcrop:"\u230C",Dscr:"\u{1D49F}",dscr:"\u{1D4B9}",DScy:"\u0405",dscy:"\u0455",dsol:"\u29F6",Dstrok:"\u0110",dstrok:"\u0111",dtdot:"\u22F1",dtri:"\u25BF",dtrif:"\u25BE",duarr:"\u21F5",duhar:"\u296F",dwangle:"\u29A6",DZcy:"\u040F",dzcy:"\u045F",dzigrarr:"\u27FF",Eacute:"\xC9",eacute:"\xE9",easter:"\u2A6E",Ecaron:"\u011A",ecaron:"\u011B",ecir:"\u2256",Ecirc:"\xCA",ecirc:"\xEA",ecolon:"\u2255",Ecy:"\u042D",ecy:"\u044D",eDDot:"\u2A77",Edot:"\u0116",eDot:"\u2251",edot:"\u0117",ee:"\u2147",efDot:"\u2252",Efr:"\u{1D508}",efr:"\u{1D522}",eg:"\u2A9A",Egrave:"\xC8",egrave:"\xE8",egs:"\u2A96",egsdot:"\u2A98",el:"\u2A99",Element:"\u2208",elinters:"\u23E7",ell:"\u2113",els:"\u2A95",elsdot:"\u2A97",Emacr:"\u0112",emacr:"\u0113",empty:"\u2205",emptyset:"\u2205",EmptySmallSquare:"\u25FB",emptyv:"\u2205",EmptyVerySmallSquare:"\u25AB",emsp:"\u2003",emsp13:"\u2004",emsp14:"\u2005",ENG:"\u014A",eng:"\u014B",ensp:"\u2002",Eogon:"\u0118",eogon:"\u0119",Eopf:"\u{1D53C}",eopf:"\u{1D556}",epar:"\u22D5",eparsl:"\u29E3",eplus:"\u2A71",epsi:"\u03B5",Epsilon:"\u0395",epsilon:"\u03B5",epsiv:"\u03F5",eqcirc:"\u2256",eqcolon:"\u2255",eqsim:"\u2242",eqslantgtr:"\u2A96",eqslantless:"\u2A95",Equal:"\u2A75",equals:"=",EqualTilde:"\u2242",equest:"\u225F",Equilibrium:"\u21CC",equiv:"\u2261",equivDD:"\u2A78",eqvparsl:"\u29E5",erarr:"\u2971",erDot:"\u2253",Escr:"\u2130",escr:"\u212F",esdot:"\u2250",Esim:"\u2A73",esim:"\u2242",Eta:"\u0397",eta:"\u03B7",ETH:"\xD0",eth:"\xF0",Euml:"\xCB",euml:"\xEB",euro:"\u20AC",excl:"!",exist:"\u2203",Exists:"\u2203",expectation:"\u2130",ExponentialE:"\u2147",exponentiale:"\u2147",fallingdotseq:"\u2252",Fcy:"\u0424",fcy:"\u0444",female:"\u2640",ffilig:"\uFB03",fflig:"\uFB00",ffllig:"\uFB04",Ffr:"\u{1D509}",ffr:"\u{1D523}",filig:"\uFB01",FilledSmallSquare:"\u25FC",FilledVerySmallSquare:"\u25AA",fjlig:"fj",flat:"\u266D",fllig:"\uFB02",fltns:"\u25B1",fnof:"\u0192",Fopf:"\u{1D53D}",fopf:"\u{1D557}",ForAll:"\u2200",forall:"\u2200",fork:"\u22D4",forkv:"\u2AD9",Fouriertrf:"\u2131",fpartint:"\u2A0D",frac12:"\xBD",frac13:"\u2153",frac14:"\xBC",frac15:"\u2155",frac16:"\u2159",frac18:"\u215B",frac23:"\u2154",frac25:"\u2156",frac34:"\xBE",frac35:"\u2157",frac38:"\u215C",frac45:"\u2158",frac56:"\u215A",frac58:"\u215D",frac78:"\u215E",frasl:"\u2044",frown:"\u2322",Fscr:"\u2131",fscr:"\u{1D4BB}",gacute:"\u01F5",Gamma:"\u0393",gamma:"\u03B3",Gammad:"\u03DC",gammad:"\u03DD",gap:"\u2A86",Gbreve:"\u011E",gbreve:"\u011F",Gcedil:"\u0122",Gcirc:"\u011C",gcirc:"\u011D",Gcy:"\u0413",gcy:"\u0433",Gdot:"\u0120",gdot:"\u0121",gE:"\u2267",ge:"\u2265",gEl:"\u2A8C",gel:"\u22DB",geq:"\u2265",geqq:"\u2267",geqslant:"\u2A7E",ges:"\u2A7E",gescc:"\u2AA9",gesdot:"\u2A80",gesdoto:"\u2A82",gesdotol:"\u2A84",gesl:"\u22DB\uFE00",gesles:"\u2A94",Gfr:"\u{1D50A}",gfr:"\u{1D524}",Gg:"\u22D9",gg:"\u226B",ggg:"\u22D9",gimel:"\u2137",GJcy:"\u0403",gjcy:"\u0453",gl:"\u2277",gla:"\u2AA5",glE:"\u2A92",glj:"\u2AA4",gnap:"\u2A8A",gnapprox:"\u2A8A",gnE:"\u2269",gne:"\u2A88",gneq:"\u2A88",gneqq:"\u2269",gnsim:"\u22E7",Gopf:"\u{1D53E}",gopf:"\u{1D558}",grave:"`",GreaterEqual:"\u2265",GreaterEqualLess:"\u22DB",GreaterFullEqual:"\u2267",GreaterGreater:"\u2AA2",GreaterLess:"\u2277",GreaterSlantEqual:"\u2A7E",GreaterTilde:"\u2273",Gscr:"\u{1D4A2}",gscr:"\u210A",gsim:"\u2273",gsime:"\u2A8E",gsiml:"\u2A90",Gt:"\u226B",GT:">",gt:">",gtcc:"\u2AA7",gtcir:"\u2A7A",gtdot:"\u22D7",gtlPar:"\u2995",gtquest:"\u2A7C",gtrapprox:"\u2A86",gtrarr:"\u2978",gtrdot:"\u22D7",gtreqless:"\u22DB",gtreqqless:"\u2A8C",gtrless:"\u2277",gtrsim:"\u2273",gvertneqq:"\u2269\uFE00",gvnE:"\u2269\uFE00",Hacek:"\u02C7",hairsp:"\u200A",half:"\xBD",hamilt:"\u210B",HARDcy:"\u042A",hardcy:"\u044A",hArr:"\u21D4",harr:"\u2194",harrcir:"\u2948",harrw:"\u21AD",Hat:"^",hbar:"\u210F",Hcirc:"\u0124",hcirc:"\u0125",hearts:"\u2665",heartsuit:"\u2665",hellip:"\u2026",hercon:"\u22B9",Hfr:"\u210C",hfr:"\u{1D525}",HilbertSpace:"\u210B",hksearow:"\u2925",hkswarow:"\u2926",hoarr:"\u21FF",homtht:"\u223B",hookleftarrow:"\u21A9",hookrightarrow:"\u21AA",Hopf:"\u210D",hopf:"\u{1D559}",horbar:"\u2015",HorizontalLine:"\u2500",Hscr:"\u210B",hscr:"\u{1D4BD}",hslash:"\u210F",Hstrok:"\u0126",hstrok:"\u0127",HumpDownHump:"\u224E",HumpEqual:"\u224F",hybull:"\u2043",hyphen:"\u2010",Iacute:"\xCD",iacute:"\xED",ic:"\u2063",Icirc:"\xCE",icirc:"\xEE",Icy:"\u0418",icy:"\u0438",Idot:"\u0130",IEcy:"\u0415",iecy:"\u0435",iexcl:"\xA1",iff:"\u21D4",Ifr:"\u2111",ifr:"\u{1D526}",Igrave:"\xCC",igrave:"\xEC",ii:"\u2148",iiiint:"\u2A0C",iiint:"\u222D",iinfin:"\u29DC",iiota:"\u2129",IJlig:"\u0132",ijlig:"\u0133",Im:"\u2111",Imacr:"\u012A",imacr:"\u012B",image:"\u2111",ImaginaryI:"\u2148",imagline:"\u2110",imagpart:"\u2111",imath:"\u0131",imof:"\u22B7",imped:"\u01B5",Implies:"\u21D2",in:"\u2208",incare:"\u2105",infin:"\u221E",infintie:"\u29DD",inodot:"\u0131",Int:"\u222C",int:"\u222B",intcal:"\u22BA",integers:"\u2124",Integral:"\u222B",intercal:"\u22BA",Intersection:"\u22C2",intlarhk:"\u2A17",intprod:"\u2A3C",InvisibleComma:"\u2063",InvisibleTimes:"\u2062",IOcy:"\u0401",iocy:"\u0451",Iogon:"\u012E",iogon:"\u012F",Iopf:"\u{1D540}",iopf:"\u{1D55A}",Iota:"\u0399",iota:"\u03B9",iprod:"\u2A3C",iquest:"\xBF",Iscr:"\u2110",iscr:"\u{1D4BE}",isin:"\u2208",isindot:"\u22F5",isinE:"\u22F9",isins:"\u22F4",isinsv:"\u22F3",isinv:"\u2208",it:"\u2062",Itilde:"\u0128",itilde:"\u0129",Iukcy:"\u0406",iukcy:"\u0456",Iuml:"\xCF",iuml:"\xEF",Jcirc:"\u0134",jcirc:"\u0135",Jcy:"\u0419",jcy:"\u0439",Jfr:"\u{1D50D}",jfr:"\u{1D527}",jmath:"\u0237",Jopf:"\u{1D541}",jopf:"\u{1D55B}",Jscr:"\u{1D4A5}",jscr:"\u{1D4BF}",Jsercy:"\u0408",jsercy:"\u0458",Jukcy:"\u0404",jukcy:"\u0454",Kappa:"\u039A",kappa:"\u03BA",kappav:"\u03F0",Kcedil:"\u0136",kcedil:"\u0137",Kcy:"\u041A",kcy:"\u043A",Kfr:"\u{1D50E}",kfr:"\u{1D528}",kgreen:"\u0138",KHcy:"\u0425",khcy:"\u0445",KJcy:"\u040C",kjcy:"\u045C",Kopf:"\u{1D542}",kopf:"\u{1D55C}",Kscr:"\u{1D4A6}",kscr:"\u{1D4C0}",lAarr:"\u21DA",Lacute:"\u0139",lacute:"\u013A",laemptyv:"\u29B4",lagran:"\u2112",Lambda:"\u039B",lambda:"\u03BB",Lang:"\u27EA",lang:"\u27E8",langd:"\u2991",langle:"\u27E8",lap:"\u2A85",Laplacetrf:"\u2112",laquo:"\xAB",Larr:"\u219E",lArr:"\u21D0",larr:"\u2190",larrb:"\u21E4",larrbfs:"\u291F",larrfs:"\u291D",larrhk:"\u21A9",larrlp:"\u21AB",larrpl:"\u2939",larrsim:"\u2973",larrtl:"\u21A2",lat:"\u2AAB",lAtail:"\u291B",latail:"\u2919",late:"\u2AAD",lates:"\u2AAD\uFE00",lBarr:"\u290E",lbarr:"\u290C",lbbrk:"\u2772",lbrace:"{",lbrack:"[",lbrke:"\u298B",lbrksld:"\u298F",lbrkslu:"\u298D",Lcaron:"\u013D",lcaron:"\u013E",Lcedil:"\u013B",lcedil:"\u013C",lceil:"\u2308",lcub:"{",Lcy:"\u041B",lcy:"\u043B",ldca:"\u2936",ldquo:"\u201C",ldquor:"\u201E",ldrdhar:"\u2967",ldrushar:"\u294B",ldsh:"\u21B2",lE:"\u2266",le:"\u2264",LeftAngleBracket:"\u27E8",LeftArrow:"\u2190",Leftarrow:"\u21D0",leftarrow:"\u2190",LeftArrowBar:"\u21E4",LeftArrowRightArrow:"\u21C6",leftarrowtail:"\u21A2",LeftCeiling:"\u2308",LeftDoubleBracket:"\u27E6",LeftDownTeeVector:"\u2961",LeftDownVector:"\u21C3",LeftDownVectorBar:"\u2959",LeftFloor:"\u230A",leftharpoondown:"\u21BD",leftharpoonup:"\u21BC",leftleftarrows:"\u21C7",LeftRightArrow:"\u2194",Leftrightarrow:"\u21D4",leftrightarrow:"\u2194",leftrightarrows:"\u21C6",leftrightharpoons:"\u21CB",leftrightsquigarrow:"\u21AD",LeftRightVector:"\u294E",LeftTee:"\u22A3",LeftTeeArrow:"\u21A4",LeftTeeVector:"\u295A",leftthreetimes:"\u22CB",LeftTriangle:"\u22B2",LeftTriangleBar:"\u29CF",LeftTriangleEqual:"\u22B4",LeftUpDownVector:"\u2951",LeftUpTeeVector:"\u2960",LeftUpVector:"\u21BF",LeftUpVectorBar:"\u2958",LeftVector:"\u21BC",LeftVectorBar:"\u2952",lEg:"\u2A8B",leg:"\u22DA",leq:"\u2264",leqq:"\u2266",leqslant:"\u2A7D",les:"\u2A7D",lescc:"\u2AA8",lesdot:"\u2A7F",lesdoto:"\u2A81",lesdotor:"\u2A83",lesg:"\u22DA\uFE00",lesges:"\u2A93",lessapprox:"\u2A85",lessdot:"\u22D6",lesseqgtr:"\u22DA",lesseqqgtr:"\u2A8B",LessEqualGreater:"\u22DA",LessFullEqual:"\u2266",LessGreater:"\u2276",lessgtr:"\u2276",LessLess:"\u2AA1",lesssim:"\u2272",LessSlantEqual:"\u2A7D",LessTilde:"\u2272",lfisht:"\u297C",lfloor:"\u230A",Lfr:"\u{1D50F}",lfr:"\u{1D529}",lg:"\u2276",lgE:"\u2A91",lHar:"\u2962",lhard:"\u21BD",lharu:"\u21BC",lharul:"\u296A",lhblk:"\u2584",LJcy:"\u0409",ljcy:"\u0459",Ll:"\u22D8",ll:"\u226A",llarr:"\u21C7",llcorner:"\u231E",Lleftarrow:"\u21DA",llhard:"\u296B",lltri:"\u25FA",Lmidot:"\u013F",lmidot:"\u0140",lmoust:"\u23B0",lmoustache:"\u23B0",lnap:"\u2A89",lnapprox:"\u2A89",lnE:"\u2268",lne:"\u2A87",lneq:"\u2A87",lneqq:"\u2268",lnsim:"\u22E6",loang:"\u27EC",loarr:"\u21FD",lobrk:"\u27E6",LongLeftArrow:"\u27F5",Longleftarrow:"\u27F8",longleftarrow:"\u27F5",LongLeftRightArrow:"\u27F7",Longleftrightarrow:"\u27FA",longleftrightarrow:"\u27F7",longmapsto:"\u27FC",LongRightArrow:"\u27F6",Longrightarrow:"\u27F9",longrightarrow:"\u27F6",looparrowleft:"\u21AB",looparrowright:"\u21AC",lopar:"\u2985",Lopf:"\u{1D543}",lopf:"\u{1D55D}",loplus:"\u2A2D",lotimes:"\u2A34",lowast:"\u2217",lowbar:"_",LowerLeftArrow:"\u2199",LowerRightArrow:"\u2198",loz:"\u25CA",lozenge:"\u25CA",lozf:"\u29EB",lpar:"(",lparlt:"\u2993",lrarr:"\u21C6",lrcorner:"\u231F",lrhar:"\u21CB",lrhard:"\u296D",lrm:"\u200E",lrtri:"\u22BF",lsaquo:"\u2039",Lscr:"\u2112",lscr:"\u{1D4C1}",Lsh:"\u21B0",lsh:"\u21B0",lsim:"\u2272",lsime:"\u2A8D",lsimg:"\u2A8F",lsqb:"[",lsquo:"\u2018",lsquor:"\u201A",Lstrok:"\u0141",lstrok:"\u0142",Lt:"\u226A",LT:"<",lt:"<",ltcc:"\u2AA6",ltcir:"\u2A79",ltdot:"\u22D6",lthree:"\u22CB",ltimes:"\u22C9",ltlarr:"\u2976",ltquest:"\u2A7B",ltri:"\u25C3",ltrie:"\u22B4",ltrif:"\u25C2",ltrPar:"\u2996",lurdshar:"\u294A",luruhar:"\u2966",lvertneqq:"\u2268\uFE00",lvnE:"\u2268\uFE00",macr:"\xAF",male:"\u2642",malt:"\u2720",maltese:"\u2720",Map:"\u2905",map:"\u21A6",mapsto:"\u21A6",mapstodown:"\u21A7",mapstoleft:"\u21A4",mapstoup:"\u21A5",marker:"\u25AE",mcomma:"\u2A29",Mcy:"\u041C",mcy:"\u043C",mdash:"\u2014",mDDot:"\u223A",measuredangle:"\u2221",MediumSpace:"\u205F",Mellintrf:"\u2133",Mfr:"\u{1D510}",mfr:"\u{1D52A}",mho:"\u2127",micro:"\xB5",mid:"\u2223",midast:"*",midcir:"\u2AF0",middot:"\xB7",minus:"\u2212",minusb:"\u229F",minusd:"\u2238",minusdu:"\u2A2A",MinusPlus:"\u2213",mlcp:"\u2ADB",mldr:"\u2026",mnplus:"\u2213",models:"\u22A7",Mopf:"\u{1D544}",mopf:"\u{1D55E}",mp:"\u2213",Mscr:"\u2133",mscr:"\u{1D4C2}",mstpos:"\u223E",Mu:"\u039C",mu:"\u03BC",multimap:"\u22B8",mumap:"\u22B8",nabla:"\u2207",Nacute:"\u0143",nacute:"\u0144",nang:"\u2220\u20D2",nap:"\u2249",napE:"\u2A70\u0338",napid:"\u224B\u0338",napos:"\u0149",napprox:"\u2249",natur:"\u266E",natural:"\u266E",naturals:"\u2115",nbsp:"\xA0",nbump:"\u224E\u0338",nbumpe:"\u224F\u0338",ncap:"\u2A43",Ncaron:"\u0147",ncaron:"\u0148",Ncedil:"\u0145",ncedil:"\u0146",ncong:"\u2247",ncongdot:"\u2A6D\u0338",ncup:"\u2A42",Ncy:"\u041D",ncy:"\u043D",ndash:"\u2013",ne:"\u2260",nearhk:"\u2924",neArr:"\u21D7",nearr:"\u2197",nearrow:"\u2197",nedot:"\u2250\u0338",NegativeMediumSpace:"\u200B",NegativeThickSpace:"\u200B",NegativeThinSpace:"\u200B",NegativeVeryThinSpace:"\u200B",nequiv:"\u2262",nesear:"\u2928",nesim:"\u2242\u0338",NestedGreaterGreater:"\u226B",NestedLessLess:"\u226A",NewLine:`
10
- `,nexist:"\u2204",nexists:"\u2204",Nfr:"\u{1D511}",nfr:"\u{1D52B}",ngE:"\u2267\u0338",nge:"\u2271",ngeq:"\u2271",ngeqq:"\u2267\u0338",ngeqslant:"\u2A7E\u0338",nges:"\u2A7E\u0338",nGg:"\u22D9\u0338",ngsim:"\u2275",nGt:"\u226B\u20D2",ngt:"\u226F",ngtr:"\u226F",nGtv:"\u226B\u0338",nhArr:"\u21CE",nharr:"\u21AE",nhpar:"\u2AF2",ni:"\u220B",nis:"\u22FC",nisd:"\u22FA",niv:"\u220B",NJcy:"\u040A",njcy:"\u045A",nlArr:"\u21CD",nlarr:"\u219A",nldr:"\u2025",nlE:"\u2266\u0338",nle:"\u2270",nLeftarrow:"\u21CD",nleftarrow:"\u219A",nLeftrightarrow:"\u21CE",nleftrightarrow:"\u21AE",nleq:"\u2270",nleqq:"\u2266\u0338",nleqslant:"\u2A7D\u0338",nles:"\u2A7D\u0338",nless:"\u226E",nLl:"\u22D8\u0338",nlsim:"\u2274",nLt:"\u226A\u20D2",nlt:"\u226E",nltri:"\u22EA",nltrie:"\u22EC",nLtv:"\u226A\u0338",nmid:"\u2224",NoBreak:"\u2060",NonBreakingSpace:"\xA0",Nopf:"\u2115",nopf:"\u{1D55F}",Not:"\u2AEC",not:"\xAC",NotCongruent:"\u2262",NotCupCap:"\u226D",NotDoubleVerticalBar:"\u2226",NotElement:"\u2209",NotEqual:"\u2260",NotEqualTilde:"\u2242\u0338",NotExists:"\u2204",NotGreater:"\u226F",NotGreaterEqual:"\u2271",NotGreaterFullEqual:"\u2267\u0338",NotGreaterGreater:"\u226B\u0338",NotGreaterLess:"\u2279",NotGreaterSlantEqual:"\u2A7E\u0338",NotGreaterTilde:"\u2275",NotHumpDownHump:"\u224E\u0338",NotHumpEqual:"\u224F\u0338",notin:"\u2209",notindot:"\u22F5\u0338",notinE:"\u22F9\u0338",notinva:"\u2209",notinvb:"\u22F7",notinvc:"\u22F6",NotLeftTriangle:"\u22EA",NotLeftTriangleBar:"\u29CF\u0338",NotLeftTriangleEqual:"\u22EC",NotLess:"\u226E",NotLessEqual:"\u2270",NotLessGreater:"\u2278",NotLessLess:"\u226A\u0338",NotLessSlantEqual:"\u2A7D\u0338",NotLessTilde:"\u2274",NotNestedGreaterGreater:"\u2AA2\u0338",NotNestedLessLess:"\u2AA1\u0338",notni:"\u220C",notniva:"\u220C",notnivb:"\u22FE",notnivc:"\u22FD",NotPrecedes:"\u2280",NotPrecedesEqual:"\u2AAF\u0338",NotPrecedesSlantEqual:"\u22E0",NotReverseElement:"\u220C",NotRightTriangle:"\u22EB",NotRightTriangleBar:"\u29D0\u0338",NotRightTriangleEqual:"\u22ED",NotSquareSubset:"\u228F\u0338",NotSquareSubsetEqual:"\u22E2",NotSquareSuperset:"\u2290\u0338",NotSquareSupersetEqual:"\u22E3",NotSubset:"\u2282\u20D2",NotSubsetEqual:"\u2288",NotSucceeds:"\u2281",NotSucceedsEqual:"\u2AB0\u0338",NotSucceedsSlantEqual:"\u22E1",NotSucceedsTilde:"\u227F\u0338",NotSuperset:"\u2283\u20D2",NotSupersetEqual:"\u2289",NotTilde:"\u2241",NotTildeEqual:"\u2244",NotTildeFullEqual:"\u2247",NotTildeTilde:"\u2249",NotVerticalBar:"\u2224",npar:"\u2226",nparallel:"\u2226",nparsl:"\u2AFD\u20E5",npart:"\u2202\u0338",npolint:"\u2A14",npr:"\u2280",nprcue:"\u22E0",npre:"\u2AAF\u0338",nprec:"\u2280",npreceq:"\u2AAF\u0338",nrArr:"\u21CF",nrarr:"\u219B",nrarrc:"\u2933\u0338",nrarrw:"\u219D\u0338",nRightarrow:"\u21CF",nrightarrow:"\u219B",nrtri:"\u22EB",nrtrie:"\u22ED",nsc:"\u2281",nsccue:"\u22E1",nsce:"\u2AB0\u0338",Nscr:"\u{1D4A9}",nscr:"\u{1D4C3}",nshortmid:"\u2224",nshortparallel:"\u2226",nsim:"\u2241",nsime:"\u2244",nsimeq:"\u2244",nsmid:"\u2224",nspar:"\u2226",nsqsube:"\u22E2",nsqsupe:"\u22E3",nsub:"\u2284",nsubE:"\u2AC5\u0338",nsube:"\u2288",nsubset:"\u2282\u20D2",nsubseteq:"\u2288",nsubseteqq:"\u2AC5\u0338",nsucc:"\u2281",nsucceq:"\u2AB0\u0338",nsup:"\u2285",nsupE:"\u2AC6\u0338",nsupe:"\u2289",nsupset:"\u2283\u20D2",nsupseteq:"\u2289",nsupseteqq:"\u2AC6\u0338",ntgl:"\u2279",Ntilde:"\xD1",ntilde:"\xF1",ntlg:"\u2278",ntriangleleft:"\u22EA",ntrianglelefteq:"\u22EC",ntriangleright:"\u22EB",ntrianglerighteq:"\u22ED",Nu:"\u039D",nu:"\u03BD",num:"#",numero:"\u2116",numsp:"\u2007",nvap:"\u224D\u20D2",nVDash:"\u22AF",nVdash:"\u22AE",nvDash:"\u22AD",nvdash:"\u22AC",nvge:"\u2265\u20D2",nvgt:">\u20D2",nvHarr:"\u2904",nvinfin:"\u29DE",nvlArr:"\u2902",nvle:"\u2264\u20D2",nvlt:"<\u20D2",nvltrie:"\u22B4\u20D2",nvrArr:"\u2903",nvrtrie:"\u22B5\u20D2",nvsim:"\u223C\u20D2",nwarhk:"\u2923",nwArr:"\u21D6",nwarr:"\u2196",nwarrow:"\u2196",nwnear:"\u2927",Oacute:"\xD3",oacute:"\xF3",oast:"\u229B",ocir:"\u229A",Ocirc:"\xD4",ocirc:"\xF4",Ocy:"\u041E",ocy:"\u043E",odash:"\u229D",Odblac:"\u0150",odblac:"\u0151",odiv:"\u2A38",odot:"\u2299",odsold:"\u29BC",OElig:"\u0152",oelig:"\u0153",ofcir:"\u29BF",Ofr:"\u{1D512}",ofr:"\u{1D52C}",ogon:"\u02DB",Ograve:"\xD2",ograve:"\xF2",ogt:"\u29C1",ohbar:"\u29B5",ohm:"\u03A9",oint:"\u222E",olarr:"\u21BA",olcir:"\u29BE",olcross:"\u29BB",oline:"\u203E",olt:"\u29C0",Omacr:"\u014C",omacr:"\u014D",Omega:"\u03A9",omega:"\u03C9",Omicron:"\u039F",omicron:"\u03BF",omid:"\u29B6",ominus:"\u2296",Oopf:"\u{1D546}",oopf:"\u{1D560}",opar:"\u29B7",OpenCurlyDoubleQuote:"\u201C",OpenCurlyQuote:"\u2018",operp:"\u29B9",oplus:"\u2295",Or:"\u2A54",or:"\u2228",orarr:"\u21BB",ord:"\u2A5D",order:"\u2134",orderof:"\u2134",ordf:"\xAA",ordm:"\xBA",origof:"\u22B6",oror:"\u2A56",orslope:"\u2A57",orv:"\u2A5B",oS:"\u24C8",Oscr:"\u{1D4AA}",oscr:"\u2134",Oslash:"\xD8",oslash:"\xF8",osol:"\u2298",Otilde:"\xD5",otilde:"\xF5",Otimes:"\u2A37",otimes:"\u2297",otimesas:"\u2A36",Ouml:"\xD6",ouml:"\xF6",ovbar:"\u233D",OverBar:"\u203E",OverBrace:"\u23DE",OverBracket:"\u23B4",OverParenthesis:"\u23DC",par:"\u2225",para:"\xB6",parallel:"\u2225",parsim:"\u2AF3",parsl:"\u2AFD",part:"\u2202",PartialD:"\u2202",Pcy:"\u041F",pcy:"\u043F",percnt:"%",period:".",permil:"\u2030",perp:"\u22A5",pertenk:"\u2031",Pfr:"\u{1D513}",pfr:"\u{1D52D}",Phi:"\u03A6",phi:"\u03C6",phiv:"\u03D5",phmmat:"\u2133",phone:"\u260E",Pi:"\u03A0",pi:"\u03C0",pitchfork:"\u22D4",piv:"\u03D6",planck:"\u210F",planckh:"\u210E",plankv:"\u210F",plus:"+",plusacir:"\u2A23",plusb:"\u229E",pluscir:"\u2A22",plusdo:"\u2214",plusdu:"\u2A25",pluse:"\u2A72",PlusMinus:"\xB1",plusmn:"\xB1",plussim:"\u2A26",plustwo:"\u2A27",pm:"\xB1",Poincareplane:"\u210C",pointint:"\u2A15",Popf:"\u2119",popf:"\u{1D561}",pound:"\xA3",Pr:"\u2ABB",pr:"\u227A",prap:"\u2AB7",prcue:"\u227C",prE:"\u2AB3",pre:"\u2AAF",prec:"\u227A",precapprox:"\u2AB7",preccurlyeq:"\u227C",Precedes:"\u227A",PrecedesEqual:"\u2AAF",PrecedesSlantEqual:"\u227C",PrecedesTilde:"\u227E",preceq:"\u2AAF",precnapprox:"\u2AB9",precneqq:"\u2AB5",precnsim:"\u22E8",precsim:"\u227E",Prime:"\u2033",prime:"\u2032",primes:"\u2119",prnap:"\u2AB9",prnE:"\u2AB5",prnsim:"\u22E8",prod:"\u220F",Product:"\u220F",profalar:"\u232E",profline:"\u2312",profsurf:"\u2313",prop:"\u221D",Proportion:"\u2237",Proportional:"\u221D",propto:"\u221D",prsim:"\u227E",prurel:"\u22B0",Pscr:"\u{1D4AB}",pscr:"\u{1D4C5}",Psi:"\u03A8",psi:"\u03C8",puncsp:"\u2008",Qfr:"\u{1D514}",qfr:"\u{1D52E}",qint:"\u2A0C",Qopf:"\u211A",qopf:"\u{1D562}",qprime:"\u2057",Qscr:"\u{1D4AC}",qscr:"\u{1D4C6}",quaternions:"\u210D",quatint:"\u2A16",quest:"?",questeq:"\u225F",QUOT:'"',quot:'"',rAarr:"\u21DB",race:"\u223D\u0331",Racute:"\u0154",racute:"\u0155",radic:"\u221A",raemptyv:"\u29B3",Rang:"\u27EB",rang:"\u27E9",rangd:"\u2992",range:"\u29A5",rangle:"\u27E9",raquo:"\xBB",Rarr:"\u21A0",rArr:"\u21D2",rarr:"\u2192",rarrap:"\u2975",rarrb:"\u21E5",rarrbfs:"\u2920",rarrc:"\u2933",rarrfs:"\u291E",rarrhk:"\u21AA",rarrlp:"\u21AC",rarrpl:"\u2945",rarrsim:"\u2974",Rarrtl:"\u2916",rarrtl:"\u21A3",rarrw:"\u219D",rAtail:"\u291C",ratail:"\u291A",ratio:"\u2236",rationals:"\u211A",RBarr:"\u2910",rBarr:"\u290F",rbarr:"\u290D",rbbrk:"\u2773",rbrace:"}",rbrack:"]",rbrke:"\u298C",rbrksld:"\u298E",rbrkslu:"\u2990",Rcaron:"\u0158",rcaron:"\u0159",Rcedil:"\u0156",rcedil:"\u0157",rceil:"\u2309",rcub:"}",Rcy:"\u0420",rcy:"\u0440",rdca:"\u2937",rdldhar:"\u2969",rdquo:"\u201D",rdquor:"\u201D",rdsh:"\u21B3",Re:"\u211C",real:"\u211C",realine:"\u211B",realpart:"\u211C",reals:"\u211D",rect:"\u25AD",REG:"\xAE",reg:"\xAE",ReverseElement:"\u220B",ReverseEquilibrium:"\u21CB",ReverseUpEquilibrium:"\u296F",rfisht:"\u297D",rfloor:"\u230B",Rfr:"\u211C",rfr:"\u{1D52F}",rHar:"\u2964",rhard:"\u21C1",rharu:"\u21C0",rharul:"\u296C",Rho:"\u03A1",rho:"\u03C1",rhov:"\u03F1",RightAngleBracket:"\u27E9",RightArrow:"\u2192",Rightarrow:"\u21D2",rightarrow:"\u2192",RightArrowBar:"\u21E5",RightArrowLeftArrow:"\u21C4",rightarrowtail:"\u21A3",RightCeiling:"\u2309",RightDoubleBracket:"\u27E7",RightDownTeeVector:"\u295D",RightDownVector:"\u21C2",RightDownVectorBar:"\u2955",RightFloor:"\u230B",rightharpoondown:"\u21C1",rightharpoonup:"\u21C0",rightleftarrows:"\u21C4",rightleftharpoons:"\u21CC",rightrightarrows:"\u21C9",rightsquigarrow:"\u219D",RightTee:"\u22A2",RightTeeArrow:"\u21A6",RightTeeVector:"\u295B",rightthreetimes:"\u22CC",RightTriangle:"\u22B3",RightTriangleBar:"\u29D0",RightTriangleEqual:"\u22B5",RightUpDownVector:"\u294F",RightUpTeeVector:"\u295C",RightUpVector:"\u21BE",RightUpVectorBar:"\u2954",RightVector:"\u21C0",RightVectorBar:"\u2953",ring:"\u02DA",risingdotseq:"\u2253",rlarr:"\u21C4",rlhar:"\u21CC",rlm:"\u200F",rmoust:"\u23B1",rmoustache:"\u23B1",rnmid:"\u2AEE",roang:"\u27ED",roarr:"\u21FE",robrk:"\u27E7",ropar:"\u2986",Ropf:"\u211D",ropf:"\u{1D563}",roplus:"\u2A2E",rotimes:"\u2A35",RoundImplies:"\u2970",rpar:")",rpargt:"\u2994",rppolint:"\u2A12",rrarr:"\u21C9",Rrightarrow:"\u21DB",rsaquo:"\u203A",Rscr:"\u211B",rscr:"\u{1D4C7}",Rsh:"\u21B1",rsh:"\u21B1",rsqb:"]",rsquo:"\u2019",rsquor:"\u2019",rthree:"\u22CC",rtimes:"\u22CA",rtri:"\u25B9",rtrie:"\u22B5",rtrif:"\u25B8",rtriltri:"\u29CE",RuleDelayed:"\u29F4",ruluhar:"\u2968",rx:"\u211E",Sacute:"\u015A",sacute:"\u015B",sbquo:"\u201A",Sc:"\u2ABC",sc:"\u227B",scap:"\u2AB8",Scaron:"\u0160",scaron:"\u0161",sccue:"\u227D",scE:"\u2AB4",sce:"\u2AB0",Scedil:"\u015E",scedil:"\u015F",Scirc:"\u015C",scirc:"\u015D",scnap:"\u2ABA",scnE:"\u2AB6",scnsim:"\u22E9",scpolint:"\u2A13",scsim:"\u227F",Scy:"\u0421",scy:"\u0441",sdot:"\u22C5",sdotb:"\u22A1",sdote:"\u2A66",searhk:"\u2925",seArr:"\u21D8",searr:"\u2198",searrow:"\u2198",sect:"\xA7",semi:";",seswar:"\u2929",setminus:"\u2216",setmn:"\u2216",sext:"\u2736",Sfr:"\u{1D516}",sfr:"\u{1D530}",sfrown:"\u2322",sharp:"\u266F",SHCHcy:"\u0429",shchcy:"\u0449",SHcy:"\u0428",shcy:"\u0448",ShortDownArrow:"\u2193",ShortLeftArrow:"\u2190",shortmid:"\u2223",shortparallel:"\u2225",ShortRightArrow:"\u2192",ShortUpArrow:"\u2191",shy:"\xAD",Sigma:"\u03A3",sigma:"\u03C3",sigmaf:"\u03C2",sigmav:"\u03C2",sim:"\u223C",simdot:"\u2A6A",sime:"\u2243",simeq:"\u2243",simg:"\u2A9E",simgE:"\u2AA0",siml:"\u2A9D",simlE:"\u2A9F",simne:"\u2246",simplus:"\u2A24",simrarr:"\u2972",slarr:"\u2190",SmallCircle:"\u2218",smallsetminus:"\u2216",smashp:"\u2A33",smeparsl:"\u29E4",smid:"\u2223",smile:"\u2323",smt:"\u2AAA",smte:"\u2AAC",smtes:"\u2AAC\uFE00",SOFTcy:"\u042C",softcy:"\u044C",sol:"/",solb:"\u29C4",solbar:"\u233F",Sopf:"\u{1D54A}",sopf:"\u{1D564}",spades:"\u2660",spadesuit:"\u2660",spar:"\u2225",sqcap:"\u2293",sqcaps:"\u2293\uFE00",sqcup:"\u2294",sqcups:"\u2294\uFE00",Sqrt:"\u221A",sqsub:"\u228F",sqsube:"\u2291",sqsubset:"\u228F",sqsubseteq:"\u2291",sqsup:"\u2290",sqsupe:"\u2292",sqsupset:"\u2290",sqsupseteq:"\u2292",squ:"\u25A1",Square:"\u25A1",square:"\u25A1",SquareIntersection:"\u2293",SquareSubset:"\u228F",SquareSubsetEqual:"\u2291",SquareSuperset:"\u2290",SquareSupersetEqual:"\u2292",SquareUnion:"\u2294",squarf:"\u25AA",squf:"\u25AA",srarr:"\u2192",Sscr:"\u{1D4AE}",sscr:"\u{1D4C8}",ssetmn:"\u2216",ssmile:"\u2323",sstarf:"\u22C6",Star:"\u22C6",star:"\u2606",starf:"\u2605",straightepsilon:"\u03F5",straightphi:"\u03D5",strns:"\xAF",Sub:"\u22D0",sub:"\u2282",subdot:"\u2ABD",subE:"\u2AC5",sube:"\u2286",subedot:"\u2AC3",submult:"\u2AC1",subnE:"\u2ACB",subne:"\u228A",subplus:"\u2ABF",subrarr:"\u2979",Subset:"\u22D0",subset:"\u2282",subseteq:"\u2286",subseteqq:"\u2AC5",SubsetEqual:"\u2286",subsetneq:"\u228A",subsetneqq:"\u2ACB",subsim:"\u2AC7",subsub:"\u2AD5",subsup:"\u2AD3",succ:"\u227B",succapprox:"\u2AB8",succcurlyeq:"\u227D",Succeeds:"\u227B",SucceedsEqual:"\u2AB0",SucceedsSlantEqual:"\u227D",SucceedsTilde:"\u227F",succeq:"\u2AB0",succnapprox:"\u2ABA",succneqq:"\u2AB6",succnsim:"\u22E9",succsim:"\u227F",SuchThat:"\u220B",Sum:"\u2211",sum:"\u2211",sung:"\u266A",Sup:"\u22D1",sup:"\u2283",sup1:"\xB9",sup2:"\xB2",sup3:"\xB3",supdot:"\u2ABE",supdsub:"\u2AD8",supE:"\u2AC6",supe:"\u2287",supedot:"\u2AC4",Superset:"\u2283",SupersetEqual:"\u2287",suphsol:"\u27C9",suphsub:"\u2AD7",suplarr:"\u297B",supmult:"\u2AC2",supnE:"\u2ACC",supne:"\u228B",supplus:"\u2AC0",Supset:"\u22D1",supset:"\u2283",supseteq:"\u2287",supseteqq:"\u2AC6",supsetneq:"\u228B",supsetneqq:"\u2ACC",supsim:"\u2AC8",supsub:"\u2AD4",supsup:"\u2AD6",swarhk:"\u2926",swArr:"\u21D9",swarr:"\u2199",swarrow:"\u2199",swnwar:"\u292A",szlig:"\xDF",Tab:" ",target:"\u2316",Tau:"\u03A4",tau:"\u03C4",tbrk:"\u23B4",Tcaron:"\u0164",tcaron:"\u0165",Tcedil:"\u0162",tcedil:"\u0163",Tcy:"\u0422",tcy:"\u0442",tdot:"\u20DB",telrec:"\u2315",Tfr:"\u{1D517}",tfr:"\u{1D531}",there4:"\u2234",Therefore:"\u2234",therefore:"\u2234",Theta:"\u0398",theta:"\u03B8",thetasym:"\u03D1",thetav:"\u03D1",thickapprox:"\u2248",thicksim:"\u223C",ThickSpace:"\u205F\u200A",thinsp:"\u2009",ThinSpace:"\u2009",thkap:"\u2248",thksim:"\u223C",THORN:"\xDE",thorn:"\xFE",Tilde:"\u223C",tilde:"\u02DC",TildeEqual:"\u2243",TildeFullEqual:"\u2245",TildeTilde:"\u2248",times:"\xD7",timesb:"\u22A0",timesbar:"\u2A31",timesd:"\u2A30",tint:"\u222D",toea:"\u2928",top:"\u22A4",topbot:"\u2336",topcir:"\u2AF1",Topf:"\u{1D54B}",topf:"\u{1D565}",topfork:"\u2ADA",tosa:"\u2929",tprime:"\u2034",TRADE:"\u2122",trade:"\u2122",triangle:"\u25B5",triangledown:"\u25BF",triangleleft:"\u25C3",trianglelefteq:"\u22B4",triangleq:"\u225C",triangleright:"\u25B9",trianglerighteq:"\u22B5",tridot:"\u25EC",trie:"\u225C",triminus:"\u2A3A",TripleDot:"\u20DB",triplus:"\u2A39",trisb:"\u29CD",tritime:"\u2A3B",trpezium:"\u23E2",Tscr:"\u{1D4AF}",tscr:"\u{1D4C9}",TScy:"\u0426",tscy:"\u0446",TSHcy:"\u040B",tshcy:"\u045B",Tstrok:"\u0166",tstrok:"\u0167",twixt:"\u226C",twoheadleftarrow:"\u219E",twoheadrightarrow:"\u21A0",Uacute:"\xDA",uacute:"\xFA",Uarr:"\u219F",uArr:"\u21D1",uarr:"\u2191",Uarrocir:"\u2949",Ubrcy:"\u040E",ubrcy:"\u045E",Ubreve:"\u016C",ubreve:"\u016D",Ucirc:"\xDB",ucirc:"\xFB",Ucy:"\u0423",ucy:"\u0443",udarr:"\u21C5",Udblac:"\u0170",udblac:"\u0171",udhar:"\u296E",ufisht:"\u297E",Ufr:"\u{1D518}",ufr:"\u{1D532}",Ugrave:"\xD9",ugrave:"\xF9",uHar:"\u2963",uharl:"\u21BF",uharr:"\u21BE",uhblk:"\u2580",ulcorn:"\u231C",ulcorner:"\u231C",ulcrop:"\u230F",ultri:"\u25F8",Umacr:"\u016A",umacr:"\u016B",uml:"\xA8",UnderBar:"_",UnderBrace:"\u23DF",UnderBracket:"\u23B5",UnderParenthesis:"\u23DD",Union:"\u22C3",UnionPlus:"\u228E",Uogon:"\u0172",uogon:"\u0173",Uopf:"\u{1D54C}",uopf:"\u{1D566}",UpArrow:"\u2191",Uparrow:"\u21D1",uparrow:"\u2191",UpArrowBar:"\u2912",UpArrowDownArrow:"\u21C5",UpDownArrow:"\u2195",Updownarrow:"\u21D5",updownarrow:"\u2195",UpEquilibrium:"\u296E",upharpoonleft:"\u21BF",upharpoonright:"\u21BE",uplus:"\u228E",UpperLeftArrow:"\u2196",UpperRightArrow:"\u2197",Upsi:"\u03D2",upsi:"\u03C5",upsih:"\u03D2",Upsilon:"\u03A5",upsilon:"\u03C5",UpTee:"\u22A5",UpTeeArrow:"\u21A5",upuparrows:"\u21C8",urcorn:"\u231D",urcorner:"\u231D",urcrop:"\u230E",Uring:"\u016E",uring:"\u016F",urtri:"\u25F9",Uscr:"\u{1D4B0}",uscr:"\u{1D4CA}",utdot:"\u22F0",Utilde:"\u0168",utilde:"\u0169",utri:"\u25B5",utrif:"\u25B4",uuarr:"\u21C8",Uuml:"\xDC",uuml:"\xFC",uwangle:"\u29A7",vangrt:"\u299C",varepsilon:"\u03F5",varkappa:"\u03F0",varnothing:"\u2205",varphi:"\u03D5",varpi:"\u03D6",varpropto:"\u221D",vArr:"\u21D5",varr:"\u2195",varrho:"\u03F1",varsigma:"\u03C2",varsubsetneq:"\u228A\uFE00",varsubsetneqq:"\u2ACB\uFE00",varsupsetneq:"\u228B\uFE00",varsupsetneqq:"\u2ACC\uFE00",vartheta:"\u03D1",vartriangleleft:"\u22B2",vartriangleright:"\u22B3",Vbar:"\u2AEB",vBar:"\u2AE8",vBarv:"\u2AE9",Vcy:"\u0412",vcy:"\u0432",VDash:"\u22AB",Vdash:"\u22A9",vDash:"\u22A8",vdash:"\u22A2",Vdashl:"\u2AE6",Vee:"\u22C1",vee:"\u2228",veebar:"\u22BB",veeeq:"\u225A",vellip:"\u22EE",Verbar:"\u2016",verbar:"|",Vert:"\u2016",vert:"|",VerticalBar:"\u2223",VerticalLine:"|",VerticalSeparator:"\u2758",VerticalTilde:"\u2240",VeryThinSpace:"\u200A",Vfr:"\u{1D519}",vfr:"\u{1D533}",vltri:"\u22B2",vnsub:"\u2282\u20D2",vnsup:"\u2283\u20D2",Vopf:"\u{1D54D}",vopf:"\u{1D567}",vprop:"\u221D",vrtri:"\u22B3",Vscr:"\u{1D4B1}",vscr:"\u{1D4CB}",vsubnE:"\u2ACB\uFE00",vsubne:"\u228A\uFE00",vsupnE:"\u2ACC\uFE00",vsupne:"\u228B\uFE00",Vvdash:"\u22AA",vzigzag:"\u299A",Wcirc:"\u0174",wcirc:"\u0175",wedbar:"\u2A5F",Wedge:"\u22C0",wedge:"\u2227",wedgeq:"\u2259",weierp:"\u2118",Wfr:"\u{1D51A}",wfr:"\u{1D534}",Wopf:"\u{1D54E}",wopf:"\u{1D568}",wp:"\u2118",wr:"\u2240",wreath:"\u2240",Wscr:"\u{1D4B2}",wscr:"\u{1D4CC}",xcap:"\u22C2",xcirc:"\u25EF",xcup:"\u22C3",xdtri:"\u25BD",Xfr:"\u{1D51B}",xfr:"\u{1D535}",xhArr:"\u27FA",xharr:"\u27F7",Xi:"\u039E",xi:"\u03BE",xlArr:"\u27F8",xlarr:"\u27F5",xmap:"\u27FC",xnis:"\u22FB",xodot:"\u2A00",Xopf:"\u{1D54F}",xopf:"\u{1D569}",xoplus:"\u2A01",xotime:"\u2A02",xrArr:"\u27F9",xrarr:"\u27F6",Xscr:"\u{1D4B3}",xscr:"\u{1D4CD}",xsqcup:"\u2A06",xuplus:"\u2A04",xutri:"\u25B3",xvee:"\u22C1",xwedge:"\u22C0",Yacute:"\xDD",yacute:"\xFD",YAcy:"\u042F",yacy:"\u044F",Ycirc:"\u0176",ycirc:"\u0177",Ycy:"\u042B",ycy:"\u044B",yen:"\xA5",Yfr:"\u{1D51C}",yfr:"\u{1D536}",YIcy:"\u0407",yicy:"\u0457",Yopf:"\u{1D550}",yopf:"\u{1D56A}",Yscr:"\u{1D4B4}",yscr:"\u{1D4CE}",YUcy:"\u042E",yucy:"\u044E",Yuml:"\u0178",yuml:"\xFF",Zacute:"\u0179",zacute:"\u017A",Zcaron:"\u017D",zcaron:"\u017E",Zcy:"\u0417",zcy:"\u0437",Zdot:"\u017B",zdot:"\u017C",zeetrf:"\u2128",ZeroWidthSpace:"\u200B",Zeta:"\u0396",zeta:"\u03B6",Zfr:"\u2128",zfr:"\u{1D537}",ZHcy:"\u0416",zhcy:"\u0436",zigrarr:"\u21DD",Zopf:"\u2124",zopf:"\u{1D56B}",Zscr:"\u{1D4B5}",zscr:"\u{1D4CF}",zwj:"\u200D",zwnj:"\u200C"});Mr.entityMap=Mr.HTML_ENTITIES});var wo=et(zn=>{"use strict";var Qt=vt(),C=Ys(),ho=Tr(),Gd=Qt.isHTMLEscapableRawTextElement,Wd=Qt.isHTMLMimeType,Xd=Qt.isHTMLRawTextElement,Fr=Qt.hasOwn,co=Qt.NAMESPACE,Yd=ho.ParseError,Zd=ho.DOMException,Yt=0,dt=1,Zt=2,$r=3,Jt=4,Kt=5,Lr=6,Hn=7;function mo(){}mo.prototype={parse:function(r,e,t){var n=this.domBuilder;n.startDocument(),ef(e,e=Object.create(null)),Jd(r,e,t,n,this.errorHandler),n.endDocument()}};var ai=/&#?\w+;?/g;function Jd(r,e,t,n,s){var i=Wd(n.mimeType);r.indexOf(C.UNICODE_REPLACEMENT_CHARACTER)>=0&&s.warning("Unicode replacement character detected, source encoding issues?");function a($){if($>65535){$-=65536;var Ae=55296+($>>10),gn=56320+($&1023);return String.fromCharCode(Ae,gn)}else return String.fromCharCode($)}function o($){var Ae=$[$.length-1]===";"?$:$+";";if(!i&&Ae!==$)return s.error("EntityRef: expecting ;"),$;var gn=C.Reference.exec(Ae);if(!gn||gn[0].length!==Ae.length)return s.error("entity not matching Reference production: "+$),$;var _n=Ae.slice(1,-1);return Fr(t,_n)?t[_n]:_n.charAt(0)==="#"?a(parseInt(_n.substring(1).replace("x","0x"))):(s.error("entity not found:"+$),$)}function u($){if($>g){var Ae=r.substring(g,$).replace(ai,o);f&&p(g),n.characters(Ae,0,$-g),g=$}}var l=0,c=0,d=/\r\n?|\n|$/g,f=n.locator;function p($,Ae){for(;$>=c&&(Ae=d.exec(r));)l=c,c=Ae.index+Ae[0].length,f.lineNumber++;f.columnNumber=$-l+1}for(var h=[{currentNSMap:e}],m=[],g=0;;){try{var b=r.indexOf("<",g);if(b<0){if(!i&&m.length>0)return s.fatalError("unclosed xml tag(s): "+m.join(", "));if(!r.substring(g).match(/^\s*$/)){var v=n.doc,w=v.createTextNode(r.substring(g));if(v.documentElement)return s.error("Extra content at the end of the document");v.appendChild(w),n.currentElement=w}return}if(b>g){var k=r.substring(g,b);!i&&m.length===0&&(k=k.replace(new RegExp(C.S_OPT.source,"g"),""),k&&s.error("Unexpected content outside root element: '"+k+"'")),u(b)}switch(r.charAt(b+1)){case"/":var O=r.indexOf(">",b+2),I=r.substring(b+2,O>0?O:void 0);if(!I)return s.fatalError("end tag name missing");var L=C.reg("^",C.QName_group,C.S_OPT,"$"),Y=O>0&&L.exec(I);if(!Y){var X=O>0&&C.reg("^",C.QName_group).exec(I);if(i&&X)s.warning('end tag name contains invalid trailing characters: "'+I+'"'),Y=X;else if(X&&new RegExp(L.source,L.flags+"m").test(I))s.error('end tag name is followed by a line break and trailing content: "'+I+'"'),Y=X;else return s.fatalError('end tag name contains invalid characters: "'+I+'"')}if(!n.currentElement&&!n.doc.documentElement)return;var re=m[m.length-1]||n.currentElement.tagName||n.doc.documentElement.tagName||"";if(re!==Y[1]){var ze=Y[1].toLowerCase();if(!i||re.toLowerCase()!==ze)return s.fatalError('Opening and ending tag mismatch: "'+re+'" != "'+I+'"')}var K=h.pop();m.pop();var fe=K.localNSMap;if(n.endElement(K.uri,K.localName,re),fe)for(var ke in fe)Fr(fe,ke)&&n.endPrefixMapping(ke);O++;break;case"?":f&&p(b),O=rf(r,b,n,s);break;case"!":f&&p(b),O=_o(r,b,n,s,i);break;default:f&&p(b);var q=new bo,Z=h[h.length-1].currentNSMap,O=Kd(r,b,q,Z,o,s,i),Pi=q.length;if(q.closed||(i&&Qt.isHTMLVoidElement(q.tagName)?q.closed=!0:m.push(q.tagName)),f&&Pi){for(var Pl=fo(f,{}),ks=0;ks<Pi;ks++){var qi=q[ks];p(qi.offset),qi.locator=fo(f,{})}n.locator=Pl,po(q,n,Z)&&h.push(q),n.locator=f}else po(q,n,Z)&&h.push(q);i&&!q.closed?O=Qd(r,O,q.tagName,o,n):O++}}catch($){if($ instanceof Yd)throw $;if($ instanceof Zd)return s.fatalError("Error constructing the DOM: "+$.name+": "+$.message,$);s.error("element parse error: "+$),O=-1}O>g?g=O:u(Math.max(b,g)+1)}}function fo(r,e){return e.lineNumber=r.lineNumber,e.columnNumber=r.columnNumber,e}function Kd(r,e,t,n,s,i,a){function o(p,h,m){if(Fr(t.attributeNames,p))return i.fatalError("Attribute "+p+" redefined");if(!a&&h.indexOf("<")>=0)return i.fatalError("Unescaped '<' not allowed in attributes values");t.addValue(p,h.replace(/[\t\n\r]/g," ").replace(ai,s),m)}for(var u,l,c=++e,d=Yt;;){var f=r.charAt(c);if(d===Yt&&f==="<")throw new Error("unexpected < in tag name: "+r.slice(e,c));switch(f){case"=":if(d===dt)u=r.slice(e,c),d=$r;else if(d===Zt)d=$r;else throw new Error("attribute equal must after attrName");break;case"'":case'"':if(d===$r||d===dt)if(d===dt&&(i.warning('attribute value must after "="'),u=r.slice(e,c)),e=c+1,c=r.indexOf(f,e),c>0)l=r.slice(e,c),o(u,l,e-1),d=Kt;else throw new Error("attribute value no end '"+f+"' match");else if(d==Jt)l=r.slice(e,c),o(u,l,e),i.warning('attribute "'+u+'" missed start quot('+f+")!!"),e=c+1,d=Kt;else throw new Error('attribute value must after "="');break;case"/":switch(d){case Yt:t.setTagName(r.slice(e,c));case Kt:case Lr:case Hn:d=Hn,t.closed=!0;case Jt:case dt:break;case Zt:t.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return i.error("unexpected end of input"),d==Yt&&t.setTagName(r.slice(e,c)),c;case">":switch(d){case Yt:t.setTagName(r.slice(e,c));case Kt:case Lr:case Hn:break;case Jt:case dt:l=r.slice(e,c),l.slice(-1)==="/"&&(t.closed=!0,l=l.slice(0,-1));case Zt:d===Zt&&(l=u),d==Jt?(i.warning('attribute "'+l+'" missed quot(")!'),o(u,l,e)):(a||i.warning('attribute "'+l+'" missed value!! "'+l+'" instead!!'),o(l,l,e));break;case $r:if(!a)return i.fatalError(`AttValue: ' or " expected`)}return c;case"\x80":f=" ";default:if(f<=" ")switch(d){case Yt:t.setTagName(r.slice(e,c)),d=Lr;break;case dt:u=r.slice(e,c),d=Zt;break;case Jt:var l=r.slice(e,c);i.warning('attribute "'+l+'" missed quot(")!!'),o(u,l,e);case Kt:d=Lr;break}else switch(d){case Zt:a||i.warning('attribute "'+u+'" missed value!! "'+u+'" instead2!!'),o(u,u,e),e=c,d=dt;break;case Kt:i.warning('attribute space is required"'+u+'"!!');case Lr:d=dt,e=c;break;case $r:d=Jt,e=c;break;case Hn:throw new Error("elements closed character '/' and '>' must be connected to")}}c++}}function po(r,e,t){for(var n=r.tagName,s=null,d=r.length;d--;){var i=r[d],a=i.qName,o=i.value,f=a.indexOf(":");if(f>0)var u=i.prefix=a.slice(0,f),l=a.slice(f+1),c=u==="xmlns"&&l;else l=a,u=null,c=a==="xmlns"&&"";i.localName=l,c!==!1&&(s==null&&(s=Object.create(null),t=Object.create(t)),t[c]=s[c]=o,i.uri=co.XMLNS,e.startPrefixMapping(c,o))}for(var d=r.length;d--;)i=r[d],i.prefix&&(i.prefix==="xml"&&(i.uri=co.XML),i.prefix!=="xmlns"&&(i.uri=t[i.prefix]));var f=n.indexOf(":");f>0?(u=r.prefix=n.slice(0,f),l=r.localName=n.slice(f+1)):(u=null,l=r.localName=n);var p=r.uri=t[u||""];if(e.startElement(p,l,n,r),r.closed){if(e.endElement(p,l,n),s)for(u in s)Fr(s,u)&&e.endPrefixMapping(u)}else return r.currentNSMap=t,r.localNSMap=s,!0}function Qd(r,e,t,n,s){var i=Gd(t);if(i||Xd(t)){var a=new RegExp("</"+t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")+">","ig");a.lastIndex=e;var o=a.exec(r),u=o?o.index:-1;if(u<0)return e+1;var l=r.substring(e+1,u);return i&&(l=l.replace(ai,n)),s.characters(l,0,l.length),u}return e+1}function ef(r,e){for(var t in r)Fr(r,t)&&(e[t]=r[t])}function go(r,e){var t=e;function n(c){return c=c||0,r.charAt(t+c)}function s(c){c=c||1,t+=c}function i(){for(var c=0;t<r.length;){var d=n();if(d!==" "&&d!==`
11
- `&&d!==" "&&d!=="\r")return c;c++,s()}return-1}function a(){return r.substring(t)}function o(c){return r.substring(t,t+c.length)===c}function u(c){return r.substring(t,t+c.length).toUpperCase()===c.toUpperCase()}function l(c){var d=C.reg("^",c),f=d.exec(a());return f?(s(f[0].length),f[0]):null}return{char:n,getIndex:function(){return t},getMatch:l,getSource:function(){return r},skip:s,skipBlanks:i,substringFromIndex:a,substringStartsWith:o,substringStartsWithCaseInsensitive:u}}function tf(r,e){function t(o,u){var l=C.PI.exec(o.substringFromIndex());return l?l[1].toLowerCase()==="xml"?u.fatalError("xml declaration is only allowed at the start of the document, but found at position "+o.getIndex()):(o.skip(l[0].length),l[0]):u.fatalError("processing instruction is not well-formed at position "+o.getIndex())}var n=r.getSource();if(r.char()==="["){r.skip(1);for(var s=r.getIndex();r.getIndex()<n.length;){if(r.skipBlanks(),r.char()==="]"){var i=n.substring(s,r.getIndex());return r.skip(1),i}var a=null;if(r.char()==="<"&&r.char(1)==="!")switch(r.char(2)){case"E":r.char(3)==="L"?a=r.getMatch(C.elementdecl):r.char(3)==="N"&&(a=r.getMatch(C.EntityDecl));break;case"A":a=r.getMatch(C.AttlistDecl);break;case"N":a=r.getMatch(C.NotationDecl);break;case"-":a=r.getMatch(C.Comment);break}else if(r.char()==="<"&&r.char(1)==="?")a=t(r,e);else if(r.char()==="%")a=r.getMatch(C.PEReference);else return e.fatalError("Error detected in Markup declaration");if(!a)return e.fatalError("Error in internal subset at position "+r.getIndex())}return e.fatalError("doctype internal subset is not well-formed, missing ]")}}function _o(r,e,t,n,s){var i=go(r,e);switch(s?i.char(2).toUpperCase():i.char(2)){case"-":var a=i.getMatch(C.Comment);return a?(t.comment(a,C.COMMENT_START.length,a.length-C.COMMENT_START.length-C.COMMENT_END.length),i.getIndex()):n.fatalError("comment is not well-formed at position "+i.getIndex());case"[":var o=i.getMatch(C.CDSect);return o?!s&&!t.currentElement?n.fatalError("CDATA outside of element"):(t.startCDATA(),t.characters(o,C.CDATA_START.length,o.length-C.CDATA_START.length-C.CDATA_END.length),t.endCDATA(),i.getIndex()):n.fatalError("Invalid CDATA starting at position "+e);case"D":{if(t.doc&&t.doc.documentElement)return n.fatalError("Doctype not allowed inside or after documentElement at position "+i.getIndex());if(s?!i.substringStartsWithCaseInsensitive(C.DOCTYPE_DECL_START):!i.substringStartsWith(C.DOCTYPE_DECL_START))return n.fatalError("Expected "+C.DOCTYPE_DECL_START+" at position "+i.getIndex());if(i.skip(C.DOCTYPE_DECL_START.length),i.skipBlanks()<1)return n.fatalError("Expected whitespace after "+C.DOCTYPE_DECL_START+" at position "+i.getIndex());var u={name:void 0,publicId:void 0,systemId:void 0,internalSubset:void 0};if(u.name=i.getMatch(C.Name),!u.name)return n.fatalError("doctype name missing or contains unexpected characters at position "+i.getIndex());if(s&&u.name.toLowerCase()!=="html"&&n.warning("Unexpected DOCTYPE in HTML document at position "+i.getIndex()),i.skipBlanks(),i.substringStartsWith(C.PUBLIC)||i.substringStartsWith(C.SYSTEM)){var l=C.ExternalID_match.exec(i.substringFromIndex());if(!l)return n.fatalError("doctype external id is not well-formed at position "+i.getIndex());l.groups.SystemLiteralOnly!==void 0?u.systemId=l.groups.SystemLiteralOnly:(u.systemId=l.groups.SystemLiteral,u.publicId=l.groups.PubidLiteral),i.skip(l[0].length)}else if(s&&i.substringStartsWithCaseInsensitive(C.SYSTEM)){if(i.skip(C.SYSTEM.length),i.skipBlanks()<1)return n.fatalError("Expected whitespace after "+C.SYSTEM+" at position "+i.getIndex());if(u.systemId=i.getMatch(C.ABOUT_LEGACY_COMPAT_SystemLiteral),!u.systemId)return n.fatalError("Expected "+C.ABOUT_LEGACY_COMPAT+" in single or double quotes after "+C.SYSTEM+" at position "+i.getIndex())}return s&&u.systemId&&!C.ABOUT_LEGACY_COMPAT_SystemLiteral.test(u.systemId)&&n.warning("Unexpected doctype.systemId in HTML document at position "+i.getIndex()),s||(i.skipBlanks(),u.internalSubset=tf(i,n)),i.skipBlanks(),i.char()!==">"?n.fatalError("doctype not terminated with > at position "+i.getIndex()):(i.skip(1),t.startDTD(u.name,u.publicId,u.systemId,u.internalSubset),t.endDTD(),i.getIndex())}default:return n.fatalError('Not well-formed XML starting with "<!" at position '+e)}}function rf(r,e,t,n){var s=r.substring(e).match(C.PI);if(!s)return n.fatalError("Invalid processing instruction starting at position "+e);if(s[1].toLowerCase()==="xml"){if(e>0)return n.fatalError("processing instruction at position "+e+" is an xml declaration which is only at the start of the document");if(!C.XMLDecl.test(r.substring(e)))return n.fatalError("xml declaration is not well-formed")}return t.processingInstruction(s[1],s[2]),e+s[0].length}function bo(){this.attributeNames=Object.create(null)}bo.prototype={setTagName:function(r){if(!C.QName_exact.test(r))throw new Error("invalid tagName:"+r);this.tagName=r},addValue:function(r,e,t){if(!C.QName_exact.test(r))throw new Error("invalid attribute:"+r);this.attributeNames[r]=this.length,this[this.length++]={qName:r,value:e,offset:t}},length:0,getLocalName:function(r){return this[r].localName},getLocator:function(r){return this[r].locator},getQName:function(r){return this[r].qName},getURI:function(r){return this[r].uri},getValue:function(r){return this[r].value}};zn.XMLReader=mo;zn.parseUtils=go;zn.parseDoctypeCommentOrCData=_o});var To=et(tr=>{"use strict";var kt=vt(),nf=ii(),sf=Tr(),yo=uo(),af=wo(),of=nf.DOMImplementation,lf=kt.hasDefaultHTMLNamespace,uf=kt.isHTMLMimeType,cf=kt.isValidMimeType,ko=kt.MIME_TYPE,oi=kt.NAMESPACE,vo=sf.ParseError,df=af.XMLReader;function Ao(r){return r.replace(/\r[\n\u0085]/g,`
9
+ var Yl=Object.create;var Ns=Object.defineProperty;var Zl=Object.getOwnPropertyDescriptor;var Jl=Object.getOwnPropertyNames;var Kl=Object.getPrototypeOf,Ql=Object.prototype.hasOwnProperty;var et=(r,e)=>()=>{try{return e||r((e={exports:{}}).exports,e),e.exports}catch(t){throw e=0,t}},eu=(r,e)=>{for(var t in e)Ns(r,t,{get:e[t],enumerable:!0})},tu=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of Jl(e))!Ql.call(r,s)&&s!==t&&Ns(r,s,{get:()=>e[s],enumerable:!(n=Zl(e,s))||n.enumerable});return r};var Xi=(r,e,t)=>(t=r!=null?Yl(Kl(r)):{},tu(e||!r||!r.__esModule?Ns(t,"default",{value:r,enumerable:!0}):t,r));var vt=et(ae=>{"use strict";function Ac(r,e,t){if(t===void 0&&(t=Array.prototype),r&&typeof t.find=="function")return t.find.call(r,e);for(var n=0;n<r.length;n++)if(yt(r,n)){var s=r[n];if(e.call(void 0,s,n,r))return s}}function Ut(r,e){return e===void 0&&(e=Object),e&&typeof e.getOwnPropertyDescriptors=="function"&&(r=e.create(null,e.getOwnPropertyDescriptors(r))),e&&typeof e.freeze=="function"?e.freeze(r):r}function yt(r,e){return Object.prototype.hasOwnProperty.call(r,e)}function Tc(r,e){if(r===null||typeof r!="object")throw new TypeError("target is not an object");for(var t in e)yt(e,t)&&(r[t]=e[t]);return r}var Sa=Ut({allowfullscreen:!0,async:!0,autofocus:!0,autoplay:!0,checked:!0,controls:!0,default:!0,defer:!0,disabled:!0,formnovalidate:!0,hidden:!0,ismap:!0,itemscope:!0,loop:!0,multiple:!0,muted:!0,nomodule:!0,novalidate:!0,open:!0,playsinline:!0,readonly:!0,required:!0,reversed:!0,selected:!0});function Dc(r){return yt(Sa,r.toLowerCase())}var Na=Ut({area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function xc(r){return yt(Na,r.toLowerCase())}var vr=Ut({script:!1,style:!1,textarea:!0,title:!0});function Sc(r){var e=r.toLowerCase();return yt(vr,e)&&!vr[e]}function Nc(r){var e=r.toLowerCase();return yt(vr,e)&&vr[e]}function Ca(r){return r===Er.HTML}function Cc(r){return Ca(r)||r===Er.XML_XHTML_APPLICATION}var Er=Ut({HTML:"text/html",XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),Oc=Object.keys(Er).map(function(r){return Er[r]});function Bc(r){return Oc.indexOf(r)>-1}var Ic=Ut({HTML:"http://www.w3.org/1999/xhtml",SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});ae.assign=Tc;ae.find=Ac;ae.freeze=Ut;ae.HTML_BOOLEAN_ATTRIBUTES=Sa;ae.HTML_RAW_TEXT_ELEMENTS=vr;ae.HTML_VOID_ELEMENTS=Na;ae.hasDefaultHTMLNamespace=Cc;ae.hasOwn=yt;ae.isHTMLBooleanAttribute=Dc;ae.isHTMLRawTextElement=Sc;ae.isHTMLEscapableRawTextElement=Nc;ae.isHTMLMimeType=Ca;ae.isHTMLVoidElement=xc;ae.isValidMimeType=Bc;ae.MIME_TYPE=Er;ae.NAMESPACE=Ic});var xr=et(Dr=>{"use strict";var Rc=vt();function Ba(r,e){r.prototype=Object.create(Error.prototype,{constructor:{value:r},name:{value:r.name,enumerable:!0,writable:e}})}var Ar=Rc.freeze({Error:"Error",IndexSizeError:"IndexSizeError",DomstringSizeError:"DomstringSizeError",HierarchyRequestError:"HierarchyRequestError",WrongDocumentError:"WrongDocumentError",InvalidCharacterError:"InvalidCharacterError",NoDataAllowedError:"NoDataAllowedError",NoModificationAllowedError:"NoModificationAllowedError",NotFoundError:"NotFoundError",NotSupportedError:"NotSupportedError",InUseAttributeError:"InUseAttributeError",InvalidStateError:"InvalidStateError",SyntaxError:"SyntaxError",InvalidModificationError:"InvalidModificationError",NamespaceError:"NamespaceError",InvalidAccessError:"InvalidAccessError",ValidationError:"ValidationError",TypeMismatchError:"TypeMismatchError",SecurityError:"SecurityError",NetworkError:"NetworkError",AbortError:"AbortError",URLMismatchError:"URLMismatchError",QuotaExceededError:"QuotaExceededError",TimeoutError:"TimeoutError",InvalidNodeTypeError:"InvalidNodeTypeError",DataCloneError:"DataCloneError",EncodingError:"EncodingError",NotReadableError:"NotReadableError",UnknownError:"UnknownError",ConstraintError:"ConstraintError",DataError:"DataError",TransactionInactiveError:"TransactionInactiveError",ReadOnlyError:"ReadOnlyError",VersionError:"VersionError",OperationError:"OperationError",NotAllowedError:"NotAllowedError",OptOutError:"OptOutError"}),Ia=Object.keys(Ar);function Ra(r){return typeof r=="number"&&r>=1&&r<=25}function Mc(r){return typeof r=="string"&&r.substring(r.length-Ar.Error.length)===Ar.Error}function Tr(r,e){Ra(r)?(this.name=Ia[r],this.message=e||""):(this.message=r,this.name=Mc(e)?e:Ar.Error),Error.captureStackTrace&&Error.captureStackTrace(this,Tr)}Ba(Tr,!0);Object.defineProperties(Tr.prototype,{code:{enumerable:!0,get:function(){var r=Ia.indexOf(this.name);return Ra(r)?r:0}}});var Ma={INDEX_SIZE_ERR:1,DOMSTRING_SIZE_ERR:2,HIERARCHY_REQUEST_ERR:3,WRONG_DOCUMENT_ERR:4,INVALID_CHARACTER_ERR:5,NO_DATA_ALLOWED_ERR:6,NO_MODIFICATION_ALLOWED_ERR:7,NOT_FOUND_ERR:8,NOT_SUPPORTED_ERR:9,INUSE_ATTRIBUTE_ERR:10,INVALID_STATE_ERR:11,SYNTAX_ERR:12,INVALID_MODIFICATION_ERR:13,NAMESPACE_ERR:14,INVALID_ACCESS_ERR:15,VALIDATION_ERR:16,TYPE_MISMATCH_ERR:17,SECURITY_ERR:18,NETWORK_ERR:19,ABORT_ERR:20,URL_MISMATCH_ERR:21,QUOTA_EXCEEDED_ERR:22,TIMEOUT_ERR:23,INVALID_NODE_TYPE_ERR:24,DATA_CLONE_ERR:25},Gs=Object.entries(Ma);for(kr=0;kr<Gs.length;kr++)Oa=Gs[kr][0],Tr[Oa]=Gs[kr][1];var Oa,kr;function Ws(r,e,t){this.message=r,this.locator=e,this.cause=t,Error.captureStackTrace&&Error.captureStackTrace(this,Ws)}Ba(Ws);Dr.DOMException=Tr;Dr.DOMExceptionName=Ar;Dr.ExceptionCode=Ma;Dr.ParseError=Ws});var ei=et(N=>{"use strict";function qa(r){try{typeof r!="function"&&(r=RegExp);var e=new r("\u{1D306}","u").exec("\u{1D306}");return!!e&&e[0].length===2}catch{}return!1}var jt=qa();function at(r){if(r.source[0]!=="[")throw new Error(r+" can not be used with chars");return r.source.slice(1,r.source.lastIndexOf("]"))}function Pt(r,e){if(r.source[0]!=="[")throw new Error("/"+r.source+"/ can not be used with chars_without");if(!e||typeof e!="string")throw new Error(JSON.stringify(e)+" is not a valid search");if(r.source.indexOf(e)===-1)throw new Error('"'+e+'" is not is /'+r.source+"/");if(e==="-"&&r.source.indexOf(e)!==1)throw new Error('"'+e+'" is not at the first postion of /'+r.source+"/");return new RegExp(r.source.replace(e,""),jt?"u":"")}function B(r){var e=this;return new RegExp(Array.prototype.slice.call(arguments).map(function(t){var n=typeof t=="string";if(n&&e===void 0&&t==="|")throw new Error("use regg instead of reg to wrap expressions with `|`!");return n?t:t.source}).join(""),jt?"u":"")}function x(r){if(arguments.length===0)throw new Error("no parameters provided");return B.apply(x,["(?:"].concat(Array.prototype.slice.call(arguments),[")"]))}var $c="\uFFFD",ot=/[-\x09\x0A\x0D\x20-\x2C\x2E-\uD7FF\uE000-\uFFFD]/;jt&&(ot=B("[",at(ot),"\\u{10000}-\\u{10FFFF}","]"));var Lc=new RegExp("[^"+at(ot)+"]",jt?"u":""),In=/[\x20\x09\x0D\x0A]/,Fc=at(In),U=B(In,"+"),V=B(In,"*"),Sr=/[:_a-zA-Z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/;jt&&(Sr=B("[",at(Sr),"\\u{10000}-\\u{10FFFF}","]"));var Uc=at(Sr),Zs=B("[",Uc,at(/[-.0-9\xB7]/),at(/[\u0300-\u036F\u203F-\u2040]/),"]"),ve=B(Sr,Zs,"*"),Pc=B("^",ve,"$"),$a=B(Zs,"+"),qc=B("&",ve,";"),jc=x(/&#[0-9]+;|&#x[0-9a-fA-F]+;/),Nr=x(qc,"|",jc),Cr=B("%",ve,";"),Js=x(B('"',x(/[^%&"]/,"|",Cr,"|",Nr),"*",'"'),"|",B("'",x(/[^%&']/,"|",Cr,"|",Nr),"*","'")),Vc=x('"',x(/[^<&"]/,"|",Nr),"*",'"',"|","'",x(/[^<&']/,"|",Nr),"*","'"),Hc=Pt(Sr,":"),zc=Pt(Zs,":"),Xs=B(Hc,zc,"*"),Gc=B("^",Xs,"$"),Or=B(Xs,x(":",Xs),"?"),Wc=B("^",Or,"$"),Xc=B("(",Or,")"),qt=x(/"[^"]*"|'[^']*'/),Yc=B(/^<\?/,"(",ve,")",x(U,"(?!",In,")(",ot,"*?)"),"?",/\?>/),La=/[\x20\x0D\x0Aa-zA-Z0-9-'()+,./:=?;!*#@$_%]/,Br=x('"',La,'*"',"|","'",Pt(La,"'"),"*'"),ja="<!--",Va="-->",Zc=B(ja,x(Pt(ot,"-"),"|",B("-",Pt(ot,"-"))),"*",Va),Fa="#PCDATA",Jc=x(B(/\(/,V,Fa,x(V,/\|/,V,Or),"*",V,/\)\*/),"|",B(/\(/,V,Fa,V,/\)/)),Kc=/[?*+]?/,Qc=B(/\([^>]+\)/,Kc),ed=x("EMPTY","|","ANY","|",Jc,"|",Qc),td="<!ELEMENT",rd=B(td,U,x(Or,"|",Cr),U,x(ed,"|",Cr),V,">"),nd=B("NOTATION",U,/\(/,V,ve,x(V,/\|/,V,ve),"*",V,/\)/),sd=B(/\(/,V,$a,x(V,/\|/,V,$a),"*",V,/\)/),id=x(nd,"|",sd),ad=x(/CDATA|ID|IDREF|IDREFS|ENTITY|ENTITIES|NMTOKEN|NMTOKENS/,"|",id),od=x(/#REQUIRED|#IMPLIED/,"|",x(x("#FIXED",U),"?",Vc)),ld=x(U,ve,U,ad,U,od),ud="<!ATTLIST",cd=B(ud,U,ve,ld,"*",V,">"),Ys="about:legacy-compat",dd=x('"'+Ys+'"',"|","'"+Ys+"'"),Ks="SYSTEM",Rn="PUBLIC",Mn=x(x(Ks,U,qt),"|",x(Rn,U,Br,U,qt)),fd=B("^",x(x(Ks,U,"(?<SystemLiteralOnly>",qt,")"),"|",x(Rn,U,"(?<PubidLiteral>",Br,")",U,"(?<SystemLiteral>",qt,")"))),pd=B("^",Br,"$"),hd=B("^",qt,"$"),md=x(U,"NDATA",U,ve),gd=x(Js,"|",x(Mn,md,"?")),Ha="<!ENTITY",_d=B(Ha,U,ve,U,gd,V,">"),bd=x(Js,"|",Mn),wd=B(Ha,U,"%",U,ve,U,bd,V,">"),yd=x(_d,"|",wd),vd=B(Rn,U,Br),Ed=B("<!NOTATION",U,ve,U,x(Mn,"|",vd),V,">"),Qs=B(V,"=",V),Ua=/1[.]\d+/,kd=B(U,"version",Qs,x("'",Ua,"'","|",'"',Ua,'"')),Pa=/[A-Za-z][-A-Za-z0-9._]*/,Ad=x(U,"encoding",Qs,x('"',Pa,'"',"|","'",Pa,"'")),Td=x(U,"standalone",Qs,x("'",x("yes","|","no"),"'","|",'"',x("yes","|","no"),'"')),Dd=B(/^<\?xml/,kd,Ad,"?",Td,"?",V,/\?>/),xd="<!DOCTYPE",Sd="<![CDATA[",Nd="]]>",Cd=/<!\[CDATA\[/,Od=/\]\]>/,Bd=B(ot,"*?",Od),Id=B(Cd,Bd);N.chars=at;N.chars_without=Pt;N.detectUnicodeSupport=qa;N.reg=B;N.regg=x;N.ABOUT_LEGACY_COMPAT=Ys;N.ABOUT_LEGACY_COMPAT_SystemLiteral=dd;N.AttlistDecl=cd;N.CDATA_START=Sd;N.CDATA_END=Nd;N.CDSect=Id;N.Char=ot;N.Comment=Zc;N.COMMENT_START=ja;N.COMMENT_END=Va;N.DOCTYPE_DECL_START=xd;N.elementdecl=rd;N.EntityDecl=yd;N.EntityValue=Js;N.ExternalID=Mn;N.ExternalID_match=fd;N.Name=ve;N.Name_exact=Pc;N.NCName_exact=Gc;N.NotationDecl=Ed;N.Reference=Nr;N.PEReference=Cr;N.PI=Yc;N.PUBLIC=Rn;N.PubidLiteral=Br;N.PubidLiteral_match=pd;N.QName=Or;N.QName_exact=Wc;N.QName_group=Xc;N.S=U;N.SChar_s=Fc;N.S_OPT=V;N.SYSTEM=Ks;N.SystemLiteral=qt;N.SystemLiteral_match=hd;N.InvalidChar=Lc;N.UNICODE_REPLACEMENT_CHARACTER=$c;N.UNICODE_SUPPORT=jt;N.XMLDecl=Dd});var ci=et(W=>{"use strict";var De=vt(),Pe=De.find,Rd=De.hasDefaultHTMLNamespace,Ht=De.hasOwn,Md=De.isHTMLMimeType,$d=De.isHTMLRawTextElement,Ld=De.isHTMLVoidElement,Ir=De.MIME_TYPE,qe=De.NAMESPACE,pe=Symbol(),Ja=xr(),y=Ja.DOMException,de=Ja.DOMExceptionName,G=ei();function _e(r){if(r!==pe)throw new TypeError("Illegal constructor")}function Fd(r){return r!==""}function Ud(r){return r?r.split(/[\t\n\f\r ]+/).filter(Fd):[]}function Pd(r,e){return Ht(r,e)||(r[e]=!0),r}function za(r){if(!r)return[];var e=Ud(r);return Object.keys(e.reduce(Pd,{}))}function qd(r){return function(e){return r&&r.indexOf(e)!==-1}}function Ka(r){if(!G.QName_exact.test(r))throw new y(y.INVALID_CHARACTER_ERR,'invalid character in qualified name "'+r+'"')}function ri(r,e){Ka(e),r=r||null;var t=null,n=e;if(e.indexOf(":")>=0){var s=e.split(":");t=s[0],n=s[1]}if(t!==null&&r===null)throw new y(y.NAMESPACE_ERR,"prefix is non-null and namespace is null");if(t==="xml"&&r!==De.NAMESPACE.XML)throw new y(y.NAMESPACE_ERR,'prefix is "xml" and namespace is not the XML namespace');if((t==="xmlns"||e==="xmlns")&&r!==De.NAMESPACE.XMLNS)throw new y(y.NAMESPACE_ERR,'either qualifiedName or prefix is "xmlns" and namespace is not the XMLNS namespace');if(r===De.NAMESPACE.XMLNS&&t!=="xmlns"&&e!=="xmlns")throw new y(y.NAMESPACE_ERR,'namespace is the XMLNS namespace and neither qualifiedName nor prefix is "xmlns"');return[r,t,n]}function Wt(r,e){for(var t in r)Ht(r,t)&&(e[t]=r[t])}function be(r,e){var t=r.prototype;if(!(t instanceof e)){let n=function(){};n.prototype=e.prototype,n=new n,Wt(t,n),r.prototype=t=n}t.constructor!=r&&(typeof r!="function"&&console.error("unknown Class:"+r),t.constructor=r)}var we={},Te=we.ELEMENT_NODE=1,zt=we.ATTRIBUTE_NODE=2,Rr=we.TEXT_NODE=3,Qa=we.CDATA_SECTION_NODE=4,eo=we.ENTITY_REFERENCE_NODE=5,jd=we.ENTITY_NODE=6,ni=we.PROCESSING_INSTRUCTION_NODE=7,si=we.COMMENT_NODE=8,Vt=we.DOCUMENT_NODE=9,to=we.DOCUMENT_TYPE_NODE=10,lt=we.DOCUMENT_FRAGMENT_NODE=11,Vd=we.NOTATION_NODE=12,z=De.freeze({DOCUMENT_POSITION_DISCONNECTED:1,DOCUMENT_POSITION_PRECEDING:2,DOCUMENT_POSITION_FOLLOWING:4,DOCUMENT_POSITION_CONTAINS:8,DOCUMENT_POSITION_CONTAINED_BY:16,DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:32});function ro(r,e){if(e.length<r.length)return ro(e,r);var t=null;for(var n in r){if(r[n]!==e[n])return t;t=r[n]}return t}function Ga(r){return r.guid||(r.guid=Math.random()),r.guid}function te(){}te.prototype={length:0,item:function(r){return r>=0&&r<this.length?this[r]:null},toString:function(r){var e;typeof r=="function"?e={requireWellFormed:!1,splitCDATASections:!0,nodeFilter:r}:r?e={requireWellFormed:!!r.requireWellFormed,splitCDATASections:r.splitCDATASections!==!1,nodeFilter:r.nodeFilter||null}:e={requireWellFormed:!1,splitCDATASections:!0,nodeFilter:null};for(var t=[],n=0;n<this.length;n++)ui(this[n],t,null,e);return t.join("")},filter:function(r){return Array.prototype.filter.call(this,r)},indexOf:function(r){return Array.prototype.indexOf.call(this,r)}};te.prototype[Symbol.iterator]=function(){var r=this,e=0;return{next:function(){return e<r.length?{value:r[e++],done:!1}:{done:!0}},return:function(){return{done:!0}}}};function Ue(r,e){this._node=r,this._refresh=e,Un(this)}function Un(r){var e=r._node._inc||r._node.ownerDocument._inc;if(r._inc!==e){var t=r._refresh(r._node);if(ho(r,"length",t.length),!r.$$length||t.length<r.$$length)for(var n=t.length;n in r;n++)Ht(r,n)&&delete r[n];Wt(t,r),r._inc=e}}Ue.prototype.item=function(r){return Un(this),this[r]||null};be(Ue,te);function Gt(){this._nsIndex=Object.create(null),this._noNsIndex=Object.create(null)}function no(r,e){for(var t=0;t<r.length;){if(r[t]===e)return t;t++}}function ii(r,e,t){if(!e)return r._noNsIndex;var n=r._nsIndex[e];return!n&&t&&(n=r._nsIndex[e]=Object.create(null)),n}function Hd(r,e,t){var n=ii(r,e,!1),s=n&&n[t];return s||null}function zd(r,e){ii(r,e.namespaceURI,!0)[e.localName]=e}function Gd(r,e){var t=ii(r,e.namespaceURI,!1);t&&delete t[e.localName]}function Wd(r,e,t,n){if(n?e[no(e,n)]=t:(e[e.length]=t,e.length++),zd(e,t),r){t.ownerElement=r;var s=r.ownerDocument;s&&(n&&ao(s,r,n),Xd(s,r,t))}}function Wa(r,e,t){var n=no(e,t);if(n>=0){for(var s=e.length-1;n<=s;)e[n]=e[++n];if(e.length=s,Gd(e,t),r){var i=r.ownerDocument;i&&ao(i,r,t),t.ownerElement=null}}}Gt.prototype={length:0,item:te.prototype.item,getNamedItem:function(r){this._ownerElement&&this._ownerElement._isInHTMLDocumentAndNamespace()&&(r=r.toLowerCase());for(var e=0;e<this.length;){var t=this[e];if(t.nodeName===r)return t;e++}return null},setNamedItem:function(r){var e=r.ownerElement;if(e&&e!==this._ownerElement)throw new y(y.INUSE_ATTRIBUTE_ERR);var t=Hd(this,r.namespaceURI,r.localName);return t===r?r:(Wd(this._ownerElement,this,r,t),t)},setNamedItemNS:function(r){return this.setNamedItem(r)},removeNamedItem:function(r){var e=this.getNamedItem(r);if(!e)throw new y(y.NOT_FOUND_ERR,r);return Wa(this._ownerElement,this,e),e},removeNamedItemNS:function(r,e){var t=this.getNamedItemNS(r,e);if(!t)throw new y(y.NOT_FOUND_ERR,r?r+" : "+e:e);return Wa(this._ownerElement,this,t),t},getNamedItemNS:function(r,e){r||(r=null);for(var t=0;t<this.length;){var n=this[t];if(n.localName===e&&n.namespaceURI===r)return n;t++}return null}};Gt.prototype[Symbol.iterator]=function(){var r=this,e=0;return{next:function(){return e<r.length?{value:r[e++],done:!1}:{done:!0}},return:function(){return{done:!0}}}};function so(){}so.prototype={hasFeature:function(r,e){return!0},createDocument:function(r,e,t){var n=Ir.XML_APPLICATION;r===qe.HTML?n=Ir.XML_XHTML_APPLICATION:r===qe.SVG&&(n=Ir.XML_SVG_IMAGE);var s=new Ye(pe,{contentType:n});if(s.implementation=this,s.childNodes=new te,s.doctype=t||null,t&&s.appendChild(t),e){var i=s.createElementNS(r,e);s.appendChild(i)}return s},createDocumentType:function(r,e,t,n){Ka(r);var s=new jn(pe);return s.name=r,s.nodeName=r,s.publicId=e||"",s.systemId=t||"",s.internalSubset=n||"",s.childNodes=new te,s},createHTMLDocument:function(r){var e=new Ye(pe,{contentType:Ir.HTML});if(e.implementation=this,e.childNodes=new te,r!==!1){e.doctype=this.createDocumentType("html"),e.doctype.ownerDocument=e,e.appendChild(e.doctype);var t=e.createElement("html");e.appendChild(t);var n=e.createElement("head");if(t.appendChild(n),typeof r=="string"){var s=e.createElement("title");s.appendChild(e.createTextNode(r)),n.appendChild(s)}t.appendChild(e.createElement("body"))}return e}};function R(r){_e(r)}R.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,parentNode:null,get parentElement(){return this.parentNode&&this.parentNode.nodeType===this.ELEMENT_NODE?this.parentNode:null},childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,baseURI:"about:blank",get isConnected(){var r=this.getRootNode();return r&&r.nodeType===r.DOCUMENT_NODE},contains:function(r){if(!r)return!1;var e=r;do{if(this===e)return!0;e=e.parentNode}while(e);return!1},getRootNode:function(r){var e=this;do{if(!e.parentNode)return e;e=e.parentNode}while(e)},isEqualNode:function(r){if(!r)return!1;for(var e=[{node:this,other:r}];e.length>0;){var t=e.pop(),n=t.node,s=t.other;if(n.nodeType!==s.nodeType)return!1;switch(n.nodeType){case n.DOCUMENT_TYPE_NODE:if(n.name!==s.name||n.publicId!==s.publicId||n.systemId!==s.systemId)return!1;break;case n.ELEMENT_NODE:if(n.namespaceURI!==s.namespaceURI||n.prefix!==s.prefix||n.localName!==s.localName||n.attributes.length!==s.attributes.length)return!1;for(var i=0;i<n.attributes.length;i++){var a=n.attributes.item(i),o=s.getAttributeNodeNS(a.namespaceURI,a.localName);if(!o)return!1;e.push({node:a,other:o})}break;case n.ATTRIBUTE_NODE:if(n.namespaceURI!==s.namespaceURI||n.localName!==s.localName||n.value!==s.value)return!1;break;case n.PROCESSING_INSTRUCTION_NODE:if(n.target!==s.target||n.data!==s.data)return!1;break;case n.TEXT_NODE:case n.CDATA_SECTION_NODE:case n.COMMENT_NODE:if(n.data!==s.data)return!1;break}if(n.childNodes.length!==s.childNodes.length)return!1;for(var i=n.childNodes.length-1;i>=0;i--)e.push({node:n.childNodes[i],other:s.childNodes[i]})}return!0},isSameNode:function(r){return this===r},insertBefore:function(r,e){return Fn(this,r,e)},replaceChild:function(r,e){Fn(this,r,e,uo),e&&this.removeChild(e)},removeChild:function(r){return oo(this,r)},appendChild:function(r){return this.insertBefore(r,null)},hasChildNodes:function(){return this.firstChild!=null},cloneNode:function(r){return po(this.ownerDocument||this,this,r)},normalize:function(){oe(this,null,{enter:function(r){for(var e=r.firstChild;e;){var t=e.nextSibling;if(t!==null&&t.nodeType===Rr&&e.nodeType===Rr){for(var n=[],s=t;s!==null&&s.nodeType===Rr;)n.push(s.data),s=s.nextSibling;for(var i=e.nextSibling;i!==s;){var a=i.nextSibling;i.parentNode=null,i.previousSibling=null,i.nextSibling=null,i=a}e.nextSibling=s,s!==null?s.previousSibling=e:r.lastChild=e,e.appendData(n.join("")),ai(r.ownerDocument,r),e=s}else e=t}return!0}})},isSupported:function(r,e){return this.ownerDocument.implementation.hasFeature(r,e)},lookupPrefix:function(r){for(var e=this;e;){var t=e._nsMap;if(t){for(var n in t)if(Ht(t,n)&&t[n]===r)return n}e=e.nodeType==zt?e.ownerDocument:e.parentNode}return null},lookupNamespaceURI:function(r){for(var e=this;e;){var t=e._nsMap;if(t&&Ht(t,r))return t[r];e=e.nodeType==zt?e.ownerDocument:e.parentNode}return null},isDefaultNamespace:function(r){var e=this.lookupPrefix(r);return e==null},compareDocumentPosition:function(r){if(this===r)return 0;var e=r,t=this,n=null,s=null;if(e instanceof Et&&(n=e,e=n.ownerElement),t instanceof Et&&(s=t,t=s.ownerElement,n&&e&&t===e))for(var i=0,a;a=t.attributes[i];i++){if(a===n)return z.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC+z.DOCUMENT_POSITION_PRECEDING;if(a===s)return z.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC+z.DOCUMENT_POSITION_FOLLOWING}if(!e||!t||t.ownerDocument!==e.ownerDocument)return z.DOCUMENT_POSITION_DISCONNECTED+z.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC+(Ga(t.ownerDocument)>Ga(e.ownerDocument)?z.DOCUMENT_POSITION_FOLLOWING:z.DOCUMENT_POSITION_PRECEDING);if(s&&e===t)return z.DOCUMENT_POSITION_CONTAINS+z.DOCUMENT_POSITION_PRECEDING;if(n&&e===t)return z.DOCUMENT_POSITION_CONTAINED_BY+z.DOCUMENT_POSITION_FOLLOWING;for(var o=[],l=e.parentNode;l;){if(!s&&l===t)return z.DOCUMENT_POSITION_CONTAINED_BY+z.DOCUMENT_POSITION_FOLLOWING;o.push(l),l=l.parentNode}o.reverse();for(var u=[],c=t.parentNode;c;){if(!n&&c===e)return z.DOCUMENT_POSITION_CONTAINS+z.DOCUMENT_POSITION_PRECEDING;u.push(c),c=c.parentNode}u.reverse();var d=ro(o,u);for(var f in d.childNodes){var p=d.childNodes[f];if(p===t)return z.DOCUMENT_POSITION_FOLLOWING;if(p===e)return z.DOCUMENT_POSITION_PRECEDING;if(u.indexOf(p)>=0)return z.DOCUMENT_POSITION_FOLLOWING;if(o.indexOf(p)>=0)return z.DOCUMENT_POSITION_PRECEDING}return 0}};function io(r){return r=="<"&&"&lt;"||r==">"&&"&gt;"||r=="&"&&"&amp;"||r=='"'&&"&quot;"||"&#"+r.charCodeAt()+";"}Wt(we,R);Wt(we,R.prototype);Wt(z,R);Wt(z,R.prototype);function Ln(r,e){oe(r,null,{enter:function(t){return e(t)?oe.STOP:!0}})}function oe(r,e,t){for(var n=[{node:r,context:e,phase:oe.ENTER}];n.length>0;){var s=n.pop();if(s.phase===oe.ENTER){var i=t.enter(s.node,s.context);if(i===oe.STOP)return oe.STOP;if(n.push({node:s.node,context:i,phase:oe.EXIT}),i==null)continue;for(var a=s.node.lastChild;a;)n.push({node:a,context:i,phase:oe.ENTER}),a=a.previousSibling}else t.exit&&t.exit(s.node,s.context)}}oe.STOP=Symbol("walkDOM.STOP");oe.ENTER=0;oe.EXIT=1;function Ye(r,e){_e(r);var t=e||{};this.ownerDocument=this,this.contentType=t.contentType||Ir.XML_APPLICATION,this.type=Md(this.contentType)?"html":"xml"}function Xd(r,e,t){r&&r._inc++;var n=t.namespaceURI;n===qe.XMLNS&&(e._nsMap[t.prefix?t.localName:""]=t.value)}function ao(r,e,t,n){r&&r._inc++;var s=t.namespaceURI;s===qe.XMLNS&&delete e._nsMap[t.prefix?t.localName:""]}function ai(r,e,t){if(r&&r._inc){r._inc++;var n=e.childNodes;if(t&&!t.nextSibling)n[n.length++]=t;else{for(var s=e.firstChild,i=0;s;)n[i++]=s,s=s.nextSibling;n.length=i,delete n[n.length]}}}function oo(r,e){if(r!==e.parentNode)throw new y(y.NOT_FOUND_ERR,"child's parent is not parent");var t=e.previousSibling,n=e.nextSibling;return t?t.nextSibling=n:r.firstChild=n,n?n.previousSibling=t:r.lastChild=t,ai(r.ownerDocument,r),e.parentNode=null,e.previousSibling=null,e.nextSibling=null,e}function Yd(r){return r&&(r.nodeType===R.DOCUMENT_NODE||r.nodeType===R.DOCUMENT_FRAGMENT_NODE||r.nodeType===R.ELEMENT_NODE)}function Zd(r){return r&&(r.nodeType===R.CDATA_SECTION_NODE||r.nodeType===R.COMMENT_NODE||r.nodeType===R.DOCUMENT_FRAGMENT_NODE||r.nodeType===R.DOCUMENT_TYPE_NODE||r.nodeType===R.ELEMENT_NODE||r.nodeType===R.PROCESSING_INSTRUCTION_NODE||r.nodeType===R.TEXT_NODE)}function ut(r){return r&&r.nodeType===R.DOCUMENT_TYPE_NODE}function Xe(r){return r&&r.nodeType===R.ELEMENT_NODE}function lo(r){return r&&r.nodeType===R.TEXT_NODE}function Xa(r,e){var t=r.childNodes||[];if(Pe(t,Xe)||ut(e))return!1;var n=Pe(t,ut);return!(e&&n&&t.indexOf(n)>t.indexOf(e))}function Ya(r,e){var t=r.childNodes||[];function n(i){return Xe(i)&&i!==e}if(Pe(t,n))return!1;var s=Pe(t,ut);return!(e&&s&&t.indexOf(s)>t.indexOf(e))}function Jd(r,e,t){if(!Yd(r))throw new y(y.HIERARCHY_REQUEST_ERR,"Unexpected parent node type "+r.nodeType);if(t&&t.parentNode!==r)throw new y(y.NOT_FOUND_ERR,"child not in parent");if(!Zd(e)||ut(e)&&r.nodeType!==R.DOCUMENT_NODE)throw new y(y.HIERARCHY_REQUEST_ERR,"Unexpected node type "+e.nodeType+" for parent node type "+r.nodeType)}function Kd(r,e,t){var n=r.childNodes||[],s=e.childNodes||[];if(e.nodeType===R.DOCUMENT_FRAGMENT_NODE){var i=s.filter(Xe);if(i.length>1||Pe(s,lo))throw new y(y.HIERARCHY_REQUEST_ERR,"More than one element or text in fragment");if(i.length===1&&!Xa(r,t))throw new y(y.HIERARCHY_REQUEST_ERR,"Element in fragment can not be inserted before doctype")}if(Xe(e)&&!Xa(r,t))throw new y(y.HIERARCHY_REQUEST_ERR,"Only one element can be added and only after doctype");if(ut(e)){if(Pe(n,ut))throw new y(y.HIERARCHY_REQUEST_ERR,"Only one doctype is allowed");var a=Pe(n,Xe);if(t&&n.indexOf(a)<n.indexOf(t))throw new y(y.HIERARCHY_REQUEST_ERR,"Doctype can only be inserted before an element");if(!t&&a)throw new y(y.HIERARCHY_REQUEST_ERR,"Doctype can not be appended since element is present")}}function uo(r,e,t){var n=r.childNodes||[],s=e.childNodes||[];if(e.nodeType===R.DOCUMENT_FRAGMENT_NODE){var i=s.filter(Xe);if(i.length>1||Pe(s,lo))throw new y(y.HIERARCHY_REQUEST_ERR,"More than one element or text in fragment");if(i.length===1&&!Ya(r,t))throw new y(y.HIERARCHY_REQUEST_ERR,"Element in fragment can not be inserted before doctype")}if(Xe(e)&&!Ya(r,t))throw new y(y.HIERARCHY_REQUEST_ERR,"Only one element can be added and only after doctype");if(ut(e)){if(Pe(n,function(l){return ut(l)&&l!==t}))throw new y(y.HIERARCHY_REQUEST_ERR,"Only one doctype is allowed");var a=Pe(n,Xe);if(t&&n.indexOf(a)<n.indexOf(t))throw new y(y.HIERARCHY_REQUEST_ERR,"Doctype can only be inserted before an element")}}function Fn(r,e,t,n){Jd(r,e,t),r.nodeType===R.DOCUMENT_NODE&&(n||Kd)(r,e,t);var s=e.parentNode;if(s&&s.removeChild(e),e.nodeType===lt){var i=e.firstChild;if(i==null)return e;var a=e.lastChild}else i=a=e;var o=t?t.previousSibling:r.lastChild;i.previousSibling=o,a.nextSibling=t,o?o.nextSibling=i:r.firstChild=i,t==null?r.lastChild=a:t.previousSibling=a;do i.parentNode=r;while(i!==a&&(i=i.nextSibling));return ai(r.ownerDocument||r,r,e),e.nodeType==lt&&(e.firstChild=e.lastChild=null),e}Ye.prototype={implementation:null,nodeName:"#document",nodeType:Vt,doctype:null,documentElement:null,_inc:1,insertBefore:function(r,e){if(r.nodeType===lt){for(var t=r.firstChild;t;){var n=t.nextSibling;this.insertBefore(t,e),t=n}return r}return Fn(this,r,e),r.ownerDocument=this,this.documentElement===null&&r.nodeType===Te&&(this.documentElement=r),r},removeChild:function(r){var e=oo(this,r);return e===this.documentElement&&(this.documentElement=null),e},replaceChild:function(r,e){Fn(this,r,e,uo),r.ownerDocument=this,e&&this.removeChild(e),Xe(r)&&(this.documentElement=r)},importNode:function(r,e){return Qd(this,r,e)},getElementById:function(r){var e=null;return Ln(this.documentElement,function(t){if(t.nodeType==Te&&t.getAttribute("id")==r)return e=t,!0}),e},createElement:function(r){var e=new Ze(pe);e.ownerDocument=this,this.type==="html"&&(r=r.toLowerCase()),Rd(this.contentType)&&(e.namespaceURI=qe.HTML),e.nodeName=r,e.tagName=r,e.localName=r,e.childNodes=new te;var t=e.attributes=new Gt;return t._ownerElement=e,e},createDocumentFragment:function(){var r=new Xt(pe);return r.ownerDocument=this,r.childNodes=new te,r},createTextNode:function(r){var e=new Mr(pe);return e.ownerDocument=this,e.childNodes=new te,e.appendData(r),e},createComment:function(r){var e=new Pn(pe);return e.ownerDocument=this,e.childNodes=new te,e.appendData(r),e},createCDATASection:function(r){if(r.indexOf("]]>")!==-1)throw new y(y.INVALID_CHARACTER_ERR,'data contains "]]>"');var e=new qn(pe);return e.ownerDocument=this,e.childNodes=new te,e.appendData(r),e},createProcessingInstruction:function(r,e){var t=new Hn(pe);return t.ownerDocument=this,t.childNodes=new te,t.nodeName=t.target=r,t.nodeValue=t.data=e,t},createAttribute:function(r){if(!G.QName_exact.test(r))throw new y(y.INVALID_CHARACTER_ERR,'invalid character in name "'+r+'"');return this.type==="html"&&(r=r.toLowerCase()),this._createAttribute(r)},_createAttribute:function(r){var e=new Et(pe);return e.ownerDocument=this,e.childNodes=new te,e.name=r,e.nodeName=r,e.localName=r,e.specified=!0,e},createEntityReference:function(r){if(!G.Name_exact.test(r))throw new y(y.INVALID_CHARACTER_ERR,'not a valid xml name "'+r+'"');if(this.type==="html")throw new y("document is an html document",de.NotSupportedError);var e=new Vn(pe);return e.ownerDocument=this,e.childNodes=new te,e.nodeName=r,e},createElementNS:function(r,e){var t=ri(r,e),n=new Ze(pe),s=n.attributes=new Gt;return n.childNodes=new te,n.ownerDocument=this,n.nodeName=e,n.tagName=e,n.namespaceURI=t[0],n.prefix=t[1],n.localName=t[2],s._ownerElement=n,n},createAttributeNS:function(r,e){var t=ri(r,e),n=new Et(pe);return n.ownerDocument=this,n.childNodes=new te,n.nodeName=e,n.name=e,n.specified=!0,n.namespaceURI=t[0],n.prefix=t[1],n.localName=t[2],n}};be(Ye,R);function Ze(r){_e(r),this._nsMap=Object.create(null)}Ze.prototype={nodeType:Te,attributes:null,getQualifiedName:function(){return this.prefix?this.prefix+":"+this.localName:this.localName},_isInHTMLDocumentAndNamespace:function(){return this.ownerDocument.type==="html"&&this.namespaceURI===qe.HTML},hasAttributes:function(){return!!(this.attributes&&this.attributes.length)},hasAttribute:function(r){return!!this.getAttributeNode(r)},getAttribute:function(r){var e=this.getAttributeNode(r);return e?e.value:null},getAttributeNode:function(r){return this._isInHTMLDocumentAndNamespace()&&(r=r.toLowerCase()),this.attributes.getNamedItem(r)},setAttribute:function(r,e){this._isInHTMLDocumentAndNamespace()&&(r=r.toLowerCase());var t=this.getAttributeNode(r);t?t.value=t.nodeValue=""+e:(t=this.ownerDocument._createAttribute(r),t.value=t.nodeValue=""+e,this.setAttributeNode(t))},removeAttribute:function(r){var e=this.getAttributeNode(r);e&&this.removeAttributeNode(e)},setAttributeNode:function(r){return this.attributes.setNamedItem(r)},setAttributeNodeNS:function(r){return this.attributes.setNamedItemNS(r)},removeAttributeNode:function(r){return this.attributes.removeNamedItem(r.nodeName)},removeAttributeNS:function(r,e){var t=this.getAttributeNodeNS(r,e);t&&this.removeAttributeNode(t)},hasAttributeNS:function(r,e){return this.getAttributeNodeNS(r,e)!=null},getAttributeNS:function(r,e){var t=this.getAttributeNodeNS(r,e);return t?t.value:null},setAttributeNS:function(r,e,t){var n=ri(r,e),s=n[2],i=this.getAttributeNodeNS(r,s);i?i.value=i.nodeValue=""+t:(i=this.ownerDocument.createAttributeNS(r,e),i.value=i.nodeValue=""+t,this.setAttributeNode(i))},getAttributeNodeNS:function(r,e){return this.attributes.getNamedItemNS(r,e)},getElementsByClassName:function(r){var e=za(r);return new Ue(this,function(t){var n=[];return e.length>0&&Ln(t,function(s){if(s!==t&&s.nodeType===Te){var i=s.getAttribute("class");if(i){var a=r===i;if(!a){var o=za(i);a=e.every(qd(o))}a&&n.push(s)}}}),n})},getElementsByTagName:function(r){var e=(this.nodeType===Vt?this:this.ownerDocument).type==="html",t=r.toLowerCase();return new Ue(this,function(n){var s=[];return Ln(n,function(i){if(!(i===n||i.nodeType!==Te))if(r==="*")s.push(i);else{var a=i.getQualifiedName(),o=e&&i.namespaceURI===qe.HTML?t:r;a===o&&s.push(i)}}),s})},getElementsByTagNameNS:function(r,e){return new Ue(this,function(t){var n=[];return Ln(t,function(s){s!==t&&s.nodeType===Te&&(r==="*"||s.namespaceURI===r)&&(e==="*"||s.localName==e)&&n.push(s)}),n})}};Ye.prototype.getElementsByClassName=Ze.prototype.getElementsByClassName;Ye.prototype.getElementsByTagName=Ze.prototype.getElementsByTagName;Ye.prototype.getElementsByTagNameNS=Ze.prototype.getElementsByTagNameNS;be(Ze,R);function Et(r){_e(r),this.namespaceURI=null,this.prefix=null,this.ownerElement=null}Et.prototype.nodeType=zt;be(Et,R);function ct(r){_e(r)}ct.prototype={data:"",substringData:function(r,e){return this.data.substring(r,r+e)},appendData:function(r){r=this.data+r,this.nodeValue=this.data=r,this.length=r.length},insertData:function(r,e){this.replaceData(r,0,e)},deleteData:function(r,e){this.replaceData(r,e,"")},replaceData:function(r,e,t){var n=this.data.substring(0,r),s=this.data.substring(r+e);t=n+t+s,this.nodeValue=this.data=t,this.length=t.length}};be(ct,R);function Mr(r){_e(r)}Mr.prototype={nodeName:"#text",nodeType:Rr,splitText:function(r){var e=this.data,t=e.substring(r);e=e.substring(0,r),this.data=this.nodeValue=e,this.length=e.length;var n=this.ownerDocument.createTextNode(t);return this.parentNode&&this.parentNode.insertBefore(n,this.nextSibling),n}};be(Mr,ct);function Pn(r){_e(r)}Pn.prototype={nodeName:"#comment",nodeType:si};be(Pn,ct);function qn(r){_e(r)}qn.prototype={nodeName:"#cdata-section",nodeType:Qa};be(qn,Mr);function jn(r){_e(r)}jn.prototype.nodeType=to;be(jn,R);function oi(r){_e(r)}oi.prototype.nodeType=Vd;be(oi,R);function li(r){_e(r)}li.prototype.nodeType=jd;be(li,R);function Vn(r){_e(r)}Vn.prototype.nodeType=eo;be(Vn,R);function Xt(r){_e(r)}Xt.prototype.nodeName="#document-fragment";Xt.prototype.nodeType=lt;be(Xt,R);function Hn(r){_e(r)}Hn.prototype.nodeType=ni;be(Hn,ct);function co(){}co.prototype.serializeToString=function(r,e){return fo.call(r,e)};R.prototype.toString=fo;function fo(r){var e;typeof r=="function"?e={requireWellFormed:!1,splitCDATASections:!0,nodeFilter:r}:r!=null?e={requireWellFormed:!!r.requireWellFormed,splitCDATASections:r.splitCDATASections!==!1,nodeFilter:r.nodeFilter||null}:e={requireWellFormed:!1,splitCDATASections:!0,nodeFilter:null};var t=[],n=this.nodeType===Vt&&this.documentElement||this,s=n.prefix,i=n.namespaceURI;if(i&&s==null){var s=n.lookupPrefix(i);if(s==null)var a=[{namespace:i,prefix:null}]}return ui(this,t,a,e),t.join("")}function Za(r,e,t){var n=r.prefix||"",s=r.namespaceURI;if(!s||n==="xml"&&s===qe.XML||s===qe.XMLNS)return!1;for(var i=t.length;i--;){var a=t[i];if(a.prefix===n)return a.namespace!==s}return!0}function $n(r,e,t,n){if(n&&!G.QName_exact.test(e))throw new y('The attribute name "'+e+'" is not a valid XML QName',de.InvalidStateError);r.push(" ",e,'="',t.replace(/[<>&"\t\n\r]/g,io),'"')}function ui(r,e,t,n){t||(t=[]);var s=n.nodeFilter,i=n.requireWellFormed,a=n.splitCDATASections,o=r.nodeType===Vt?r:r.ownerDocument,l=o.type==="html";oe(r,{ns:t},{enter:function(u,c){var d=c.ns;if(s)if(u=s(u),u){if(typeof u=="string")return e.push(u),null}else return null;switch(u.nodeType){case Te:var f=u.attributes,p=f.length,h=u.tagName,m=h;if(!l&&!u.prefix&&u.namespaceURI){for(var g,b=0;b<f.length;b++)if(f.item(b).name==="xmlns"){g=f.item(b).value;break}if(!g)for(var v=d.length-1;v>=0;v--){var w=d[v];if(w.prefix===""&&w.namespace===u.namespaceURI){g=w.namespace;break}}if(g!==u.namespaceURI)for(var v=d.length-1;v>=0;v--){var w=d[v];if(w.namespace===u.namespaceURI){w.prefix&&(m=w.prefix+":"+h);break}}}if(i&&!G.QName_exact.test(m))throw new y('The element name "'+m+'" is not a valid XML QName',de.InvalidStateError);e.push("<",m);for(var k=d.slice(),I=0;I<p;I++){var L=f.item(I);L.prefix=="xmlns"?k.push({prefix:L.localName,namespace:L.value}):L.nodeName=="xmlns"&&k.push({prefix:"",namespace:L.value})}for(var I=0;I<p;I++){var L=f.item(I);if(Za(L,l,k)){var Z=L.prefix||"",Y=L.namespaceURI;$n(e,Z?"xmlns:"+Z:"xmlns",Y,i),k.push({prefix:Z,namespace:Y})}var ne=s?s(L):L;ne&&(typeof ne=="string"?e.push(ne):$n(e,ne.name,ne.value,i))}if(h===m&&Za(u,l,k)){var ze=u.prefix||"",Y=u.namespaceURI;$n(e,ze?"xmlns:"+ze:"xmlns",Y,i),k.push({prefix:ze,namespace:Y})}var Q=!u.firstChild;if(Q&&(l||u.namespaceURI===qe.HTML)&&(Q=Ld(h)),Q)return e.push("/>"),null;if(e.push(">"),l&&$d(h)){for(var fe=u.firstChild;fe;)fe.data?e.push(fe.data):ui(fe,e,k.slice(),n),fe=fe.nextSibling;return e.push("</",m,">"),null}return{ns:k,tag:m};case Vt:case lt:if(i&&u.nodeType===Vt&&u.documentElement==null)throw new y("The Document has no documentElement",de.InvalidStateError);return{ns:d};case zt:return $n(e,u.name,u.value,i),null;case Rr:if(i&&G.InvalidChar.test(u.data))throw new y("The Text node data contains characters outside the XML Char production",de.InvalidStateError);return e.push(u.data.replace(/[<&>]/g,io)),null;case Qa:if(i&&u.data.indexOf("]]>")!==-1)throw new y('The CDATASection data contains "]]>"',de.InvalidStateError);return a?e.push(G.CDATA_START,u.data.replace(/]]>/g,"]]]]><![CDATA[>"),G.CDATA_END):e.push(G.CDATA_START,u.data,G.CDATA_END),null;case si:if(i){if(G.InvalidChar.test(u.data))throw new y("The comment node data contains characters outside the XML Char production",de.InvalidStateError);if(u.data.indexOf("--")!==-1||u.data[u.data.length-1]==="-")throw new y('The comment node data contains "--" or ends with "-"',de.InvalidStateError)}return e.push(G.COMMENT_START,u.data,G.COMMENT_END),null;case to:var ke=u.publicId,q=u.systemId;if(i){if(!G.Name_exact.test(u.name))throw new y('The doctype name "'+u.name+'" is not a valid XML Name',de.InvalidStateError);if(ke&&!G.PubidLiteral_match.test(ke))throw new y("DocumentType publicId is not a valid PubidLiteral",de.InvalidStateError);if(q&&q!=="."&&!G.SystemLiteral_match.test(q))throw new y("DocumentType systemId is not a valid SystemLiteral",de.InvalidStateError);if(u.internalSubset&&u.internalSubset.indexOf("]>")!==-1)throw new y('DocumentType internalSubset contains "]>"',de.InvalidStateError)}return e.push(G.DOCTYPE_DECL_START," ",u.name),ke?(e.push(" ",G.PUBLIC," ",ke),q&&q!=="."&&e.push(" ",q)):q&&q!=="."&&e.push(" ",G.SYSTEM," ",q),u.internalSubset&&e.push(" [",u.internalSubset,"]"),e.push(">"),null;case ni:if(i){if(!G.NCName_exact.test(u.target)||u.target.toLowerCase()==="xml")throw new y('The processing instruction target "'+u.target+'" is not a valid XML NCName or is reserved',de.InvalidStateError);if(G.InvalidChar.test(u.data))throw new y("The ProcessingInstruction data contains characters outside the XML Char production",de.InvalidStateError);if(u.data.indexOf("?>")!==-1)throw new y('The ProcessingInstruction data contains "?>"',de.InvalidStateError)}return e.push("<?",u.target," ",u.data,"?>"),null;case eo:if(i&&!G.Name_exact.test(u.nodeName))throw new y('The entity reference name "'+u.nodeName+'" is not a valid XML Name',de.InvalidStateError);return e.push("&",u.nodeName,";"),null;default:return e.push("??",u.nodeName),null}},exit:function(u,c){c&&c.tag&&e.push("</",c.tag,">")}})}function Qd(r,e,t){var n;return oe(e,null,{enter:function(s,i){var a=s.cloneNode(!1);a.ownerDocument=r,a.parentNode=null,i===null?n=a:i.appendChild(a);var o=s.nodeType===zt||t;return o?a:null}}),n}function po(r,e,t){var n;return oe(e,null,{enter:function(s,i){var a=new s.constructor(pe);for(var o in s)if(Ht(s,o)){var l=s[o];typeof l!="object"&&l!=a[o]&&(a[o]=l)}s.childNodes&&(a.childNodes=new te),a.ownerDocument=r;var u=t;switch(a.nodeType){case Te:var c=s.attributes,d=a.attributes=new Gt,f=c.length;d._ownerElement=a;for(var p=0;p<f;p++)a.setAttributeNode(po(r,c.item(p),!0));break;case zt:u=!0}return i!==null?i.appendChild(a):n=a,u?a:null}}),n}function ho(r,e,t){r[e]=t}function ti(r){for(var e=[],t=r.firstChild;t;)t.nodeType===Te&&e.push(t),t=t.nextSibling;return e}try{Object.defineProperty&&(Object.defineProperty(Ue.prototype,"length",{get:function(){return Un(this),this.$$length}}),Object.defineProperty(R.prototype,"textContent",{get:function(){if(this.nodeType===Te||this.nodeType===lt){var r=[];return oe(this,null,{enter:function(e){if(e.nodeType===Te||e.nodeType===lt)return!0;if(e.nodeType===ni||e.nodeType===si)return null;r.push(e.nodeValue)}}),r.join("")}return this.nodeValue},set:function(r){switch(this.nodeType){case Te:case lt:for(;this.firstChild;)this.removeChild(this.firstChild);(r||String(r))&&this.appendChild(this.ownerDocument.createTextNode(r));break;default:this.data=r,this.value=r,this.nodeValue=r}}}),Object.defineProperty(ct.prototype,"data",{get:function(){return this._data!=null?this._data:""},set:function(r){this._data=r,this.length=typeof r=="string"?r.length:0}}),Object.defineProperty(ct.prototype,"nodeValue",{get:function(){return this.data},set:function(r){this.data=r},enumerable:!0,configurable:!0}),Object.defineProperty(Ze.prototype,"children",{get:function(){return new Ue(this,ti)}}),Object.defineProperty(Ye.prototype,"children",{get:function(){return new Ue(this,ti)}}),Object.defineProperty(Xt.prototype,"children",{get:function(){return new Ue(this,ti)}}),ho=function(r,e,t){r["$$"+e]=t})}catch{}W._updateLiveList=Un;W.Attr=Et;W.CDATASection=qn;W.CharacterData=ct;W.Comment=Pn;W.Document=Ye;W.DocumentFragment=Xt;W.DocumentType=jn;W.DOMImplementation=so;W.Element=Ze;W.Entity=li;W.EntityReference=Vn;W.LiveNodeList=Ue;W.NamedNodeMap=Gt;W.Node=R;W.NodeList=te;W.Notation=oi;W.Text=Mr;W.ProcessingInstruction=Hn;W.walkDOM=oe;W.XMLSerializer=co});var go=et($r=>{"use strict";var mo=vt().freeze;$r.XML_ENTITIES=mo({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'});$r.HTML_ENTITIES=mo({Aacute:"\xC1",aacute:"\xE1",Abreve:"\u0102",abreve:"\u0103",ac:"\u223E",acd:"\u223F",acE:"\u223E\u0333",Acirc:"\xC2",acirc:"\xE2",acute:"\xB4",Acy:"\u0410",acy:"\u0430",AElig:"\xC6",aelig:"\xE6",af:"\u2061",Afr:"\u{1D504}",afr:"\u{1D51E}",Agrave:"\xC0",agrave:"\xE0",alefsym:"\u2135",aleph:"\u2135",Alpha:"\u0391",alpha:"\u03B1",Amacr:"\u0100",amacr:"\u0101",amalg:"\u2A3F",AMP:"&",amp:"&",And:"\u2A53",and:"\u2227",andand:"\u2A55",andd:"\u2A5C",andslope:"\u2A58",andv:"\u2A5A",ang:"\u2220",ange:"\u29A4",angle:"\u2220",angmsd:"\u2221",angmsdaa:"\u29A8",angmsdab:"\u29A9",angmsdac:"\u29AA",angmsdad:"\u29AB",angmsdae:"\u29AC",angmsdaf:"\u29AD",angmsdag:"\u29AE",angmsdah:"\u29AF",angrt:"\u221F",angrtvb:"\u22BE",angrtvbd:"\u299D",angsph:"\u2222",angst:"\xC5",angzarr:"\u237C",Aogon:"\u0104",aogon:"\u0105",Aopf:"\u{1D538}",aopf:"\u{1D552}",ap:"\u2248",apacir:"\u2A6F",apE:"\u2A70",ape:"\u224A",apid:"\u224B",apos:"'",ApplyFunction:"\u2061",approx:"\u2248",approxeq:"\u224A",Aring:"\xC5",aring:"\xE5",Ascr:"\u{1D49C}",ascr:"\u{1D4B6}",Assign:"\u2254",ast:"*",asymp:"\u2248",asympeq:"\u224D",Atilde:"\xC3",atilde:"\xE3",Auml:"\xC4",auml:"\xE4",awconint:"\u2233",awint:"\u2A11",backcong:"\u224C",backepsilon:"\u03F6",backprime:"\u2035",backsim:"\u223D",backsimeq:"\u22CD",Backslash:"\u2216",Barv:"\u2AE7",barvee:"\u22BD",Barwed:"\u2306",barwed:"\u2305",barwedge:"\u2305",bbrk:"\u23B5",bbrktbrk:"\u23B6",bcong:"\u224C",Bcy:"\u0411",bcy:"\u0431",bdquo:"\u201E",becaus:"\u2235",Because:"\u2235",because:"\u2235",bemptyv:"\u29B0",bepsi:"\u03F6",bernou:"\u212C",Bernoullis:"\u212C",Beta:"\u0392",beta:"\u03B2",beth:"\u2136",between:"\u226C",Bfr:"\u{1D505}",bfr:"\u{1D51F}",bigcap:"\u22C2",bigcirc:"\u25EF",bigcup:"\u22C3",bigodot:"\u2A00",bigoplus:"\u2A01",bigotimes:"\u2A02",bigsqcup:"\u2A06",bigstar:"\u2605",bigtriangledown:"\u25BD",bigtriangleup:"\u25B3",biguplus:"\u2A04",bigvee:"\u22C1",bigwedge:"\u22C0",bkarow:"\u290D",blacklozenge:"\u29EB",blacksquare:"\u25AA",blacktriangle:"\u25B4",blacktriangledown:"\u25BE",blacktriangleleft:"\u25C2",blacktriangleright:"\u25B8",blank:"\u2423",blk12:"\u2592",blk14:"\u2591",blk34:"\u2593",block:"\u2588",bne:"=\u20E5",bnequiv:"\u2261\u20E5",bNot:"\u2AED",bnot:"\u2310",Bopf:"\u{1D539}",bopf:"\u{1D553}",bot:"\u22A5",bottom:"\u22A5",bowtie:"\u22C8",boxbox:"\u29C9",boxDL:"\u2557",boxDl:"\u2556",boxdL:"\u2555",boxdl:"\u2510",boxDR:"\u2554",boxDr:"\u2553",boxdR:"\u2552",boxdr:"\u250C",boxH:"\u2550",boxh:"\u2500",boxHD:"\u2566",boxHd:"\u2564",boxhD:"\u2565",boxhd:"\u252C",boxHU:"\u2569",boxHu:"\u2567",boxhU:"\u2568",boxhu:"\u2534",boxminus:"\u229F",boxplus:"\u229E",boxtimes:"\u22A0",boxUL:"\u255D",boxUl:"\u255C",boxuL:"\u255B",boxul:"\u2518",boxUR:"\u255A",boxUr:"\u2559",boxuR:"\u2558",boxur:"\u2514",boxV:"\u2551",boxv:"\u2502",boxVH:"\u256C",boxVh:"\u256B",boxvH:"\u256A",boxvh:"\u253C",boxVL:"\u2563",boxVl:"\u2562",boxvL:"\u2561",boxvl:"\u2524",boxVR:"\u2560",boxVr:"\u255F",boxvR:"\u255E",boxvr:"\u251C",bprime:"\u2035",Breve:"\u02D8",breve:"\u02D8",brvbar:"\xA6",Bscr:"\u212C",bscr:"\u{1D4B7}",bsemi:"\u204F",bsim:"\u223D",bsime:"\u22CD",bsol:"\\",bsolb:"\u29C5",bsolhsub:"\u27C8",bull:"\u2022",bullet:"\u2022",bump:"\u224E",bumpE:"\u2AAE",bumpe:"\u224F",Bumpeq:"\u224E",bumpeq:"\u224F",Cacute:"\u0106",cacute:"\u0107",Cap:"\u22D2",cap:"\u2229",capand:"\u2A44",capbrcup:"\u2A49",capcap:"\u2A4B",capcup:"\u2A47",capdot:"\u2A40",CapitalDifferentialD:"\u2145",caps:"\u2229\uFE00",caret:"\u2041",caron:"\u02C7",Cayleys:"\u212D",ccaps:"\u2A4D",Ccaron:"\u010C",ccaron:"\u010D",Ccedil:"\xC7",ccedil:"\xE7",Ccirc:"\u0108",ccirc:"\u0109",Cconint:"\u2230",ccups:"\u2A4C",ccupssm:"\u2A50",Cdot:"\u010A",cdot:"\u010B",cedil:"\xB8",Cedilla:"\xB8",cemptyv:"\u29B2",cent:"\xA2",CenterDot:"\xB7",centerdot:"\xB7",Cfr:"\u212D",cfr:"\u{1D520}",CHcy:"\u0427",chcy:"\u0447",check:"\u2713",checkmark:"\u2713",Chi:"\u03A7",chi:"\u03C7",cir:"\u25CB",circ:"\u02C6",circeq:"\u2257",circlearrowleft:"\u21BA",circlearrowright:"\u21BB",circledast:"\u229B",circledcirc:"\u229A",circleddash:"\u229D",CircleDot:"\u2299",circledR:"\xAE",circledS:"\u24C8",CircleMinus:"\u2296",CirclePlus:"\u2295",CircleTimes:"\u2297",cirE:"\u29C3",cire:"\u2257",cirfnint:"\u2A10",cirmid:"\u2AEF",cirscir:"\u29C2",ClockwiseContourIntegral:"\u2232",CloseCurlyDoubleQuote:"\u201D",CloseCurlyQuote:"\u2019",clubs:"\u2663",clubsuit:"\u2663",Colon:"\u2237",colon:":",Colone:"\u2A74",colone:"\u2254",coloneq:"\u2254",comma:",",commat:"@",comp:"\u2201",compfn:"\u2218",complement:"\u2201",complexes:"\u2102",cong:"\u2245",congdot:"\u2A6D",Congruent:"\u2261",Conint:"\u222F",conint:"\u222E",ContourIntegral:"\u222E",Copf:"\u2102",copf:"\u{1D554}",coprod:"\u2210",Coproduct:"\u2210",COPY:"\xA9",copy:"\xA9",copysr:"\u2117",CounterClockwiseContourIntegral:"\u2233",crarr:"\u21B5",Cross:"\u2A2F",cross:"\u2717",Cscr:"\u{1D49E}",cscr:"\u{1D4B8}",csub:"\u2ACF",csube:"\u2AD1",csup:"\u2AD0",csupe:"\u2AD2",ctdot:"\u22EF",cudarrl:"\u2938",cudarrr:"\u2935",cuepr:"\u22DE",cuesc:"\u22DF",cularr:"\u21B6",cularrp:"\u293D",Cup:"\u22D3",cup:"\u222A",cupbrcap:"\u2A48",CupCap:"\u224D",cupcap:"\u2A46",cupcup:"\u2A4A",cupdot:"\u228D",cupor:"\u2A45",cups:"\u222A\uFE00",curarr:"\u21B7",curarrm:"\u293C",curlyeqprec:"\u22DE",curlyeqsucc:"\u22DF",curlyvee:"\u22CE",curlywedge:"\u22CF",curren:"\xA4",curvearrowleft:"\u21B6",curvearrowright:"\u21B7",cuvee:"\u22CE",cuwed:"\u22CF",cwconint:"\u2232",cwint:"\u2231",cylcty:"\u232D",Dagger:"\u2021",dagger:"\u2020",daleth:"\u2138",Darr:"\u21A1",dArr:"\u21D3",darr:"\u2193",dash:"\u2010",Dashv:"\u2AE4",dashv:"\u22A3",dbkarow:"\u290F",dblac:"\u02DD",Dcaron:"\u010E",dcaron:"\u010F",Dcy:"\u0414",dcy:"\u0434",DD:"\u2145",dd:"\u2146",ddagger:"\u2021",ddarr:"\u21CA",DDotrahd:"\u2911",ddotseq:"\u2A77",deg:"\xB0",Del:"\u2207",Delta:"\u0394",delta:"\u03B4",demptyv:"\u29B1",dfisht:"\u297F",Dfr:"\u{1D507}",dfr:"\u{1D521}",dHar:"\u2965",dharl:"\u21C3",dharr:"\u21C2",DiacriticalAcute:"\xB4",DiacriticalDot:"\u02D9",DiacriticalDoubleAcute:"\u02DD",DiacriticalGrave:"`",DiacriticalTilde:"\u02DC",diam:"\u22C4",Diamond:"\u22C4",diamond:"\u22C4",diamondsuit:"\u2666",diams:"\u2666",die:"\xA8",DifferentialD:"\u2146",digamma:"\u03DD",disin:"\u22F2",div:"\xF7",divide:"\xF7",divideontimes:"\u22C7",divonx:"\u22C7",DJcy:"\u0402",djcy:"\u0452",dlcorn:"\u231E",dlcrop:"\u230D",dollar:"$",Dopf:"\u{1D53B}",dopf:"\u{1D555}",Dot:"\xA8",dot:"\u02D9",DotDot:"\u20DC",doteq:"\u2250",doteqdot:"\u2251",DotEqual:"\u2250",dotminus:"\u2238",dotplus:"\u2214",dotsquare:"\u22A1",doublebarwedge:"\u2306",DoubleContourIntegral:"\u222F",DoubleDot:"\xA8",DoubleDownArrow:"\u21D3",DoubleLeftArrow:"\u21D0",DoubleLeftRightArrow:"\u21D4",DoubleLeftTee:"\u2AE4",DoubleLongLeftArrow:"\u27F8",DoubleLongLeftRightArrow:"\u27FA",DoubleLongRightArrow:"\u27F9",DoubleRightArrow:"\u21D2",DoubleRightTee:"\u22A8",DoubleUpArrow:"\u21D1",DoubleUpDownArrow:"\u21D5",DoubleVerticalBar:"\u2225",DownArrow:"\u2193",Downarrow:"\u21D3",downarrow:"\u2193",DownArrowBar:"\u2913",DownArrowUpArrow:"\u21F5",DownBreve:"\u0311",downdownarrows:"\u21CA",downharpoonleft:"\u21C3",downharpoonright:"\u21C2",DownLeftRightVector:"\u2950",DownLeftTeeVector:"\u295E",DownLeftVector:"\u21BD",DownLeftVectorBar:"\u2956",DownRightTeeVector:"\u295F",DownRightVector:"\u21C1",DownRightVectorBar:"\u2957",DownTee:"\u22A4",DownTeeArrow:"\u21A7",drbkarow:"\u2910",drcorn:"\u231F",drcrop:"\u230C",Dscr:"\u{1D49F}",dscr:"\u{1D4B9}",DScy:"\u0405",dscy:"\u0455",dsol:"\u29F6",Dstrok:"\u0110",dstrok:"\u0111",dtdot:"\u22F1",dtri:"\u25BF",dtrif:"\u25BE",duarr:"\u21F5",duhar:"\u296F",dwangle:"\u29A6",DZcy:"\u040F",dzcy:"\u045F",dzigrarr:"\u27FF",Eacute:"\xC9",eacute:"\xE9",easter:"\u2A6E",Ecaron:"\u011A",ecaron:"\u011B",ecir:"\u2256",Ecirc:"\xCA",ecirc:"\xEA",ecolon:"\u2255",Ecy:"\u042D",ecy:"\u044D",eDDot:"\u2A77",Edot:"\u0116",eDot:"\u2251",edot:"\u0117",ee:"\u2147",efDot:"\u2252",Efr:"\u{1D508}",efr:"\u{1D522}",eg:"\u2A9A",Egrave:"\xC8",egrave:"\xE8",egs:"\u2A96",egsdot:"\u2A98",el:"\u2A99",Element:"\u2208",elinters:"\u23E7",ell:"\u2113",els:"\u2A95",elsdot:"\u2A97",Emacr:"\u0112",emacr:"\u0113",empty:"\u2205",emptyset:"\u2205",EmptySmallSquare:"\u25FB",emptyv:"\u2205",EmptyVerySmallSquare:"\u25AB",emsp:"\u2003",emsp13:"\u2004",emsp14:"\u2005",ENG:"\u014A",eng:"\u014B",ensp:"\u2002",Eogon:"\u0118",eogon:"\u0119",Eopf:"\u{1D53C}",eopf:"\u{1D556}",epar:"\u22D5",eparsl:"\u29E3",eplus:"\u2A71",epsi:"\u03B5",Epsilon:"\u0395",epsilon:"\u03B5",epsiv:"\u03F5",eqcirc:"\u2256",eqcolon:"\u2255",eqsim:"\u2242",eqslantgtr:"\u2A96",eqslantless:"\u2A95",Equal:"\u2A75",equals:"=",EqualTilde:"\u2242",equest:"\u225F",Equilibrium:"\u21CC",equiv:"\u2261",equivDD:"\u2A78",eqvparsl:"\u29E5",erarr:"\u2971",erDot:"\u2253",Escr:"\u2130",escr:"\u212F",esdot:"\u2250",Esim:"\u2A73",esim:"\u2242",Eta:"\u0397",eta:"\u03B7",ETH:"\xD0",eth:"\xF0",Euml:"\xCB",euml:"\xEB",euro:"\u20AC",excl:"!",exist:"\u2203",Exists:"\u2203",expectation:"\u2130",ExponentialE:"\u2147",exponentiale:"\u2147",fallingdotseq:"\u2252",Fcy:"\u0424",fcy:"\u0444",female:"\u2640",ffilig:"\uFB03",fflig:"\uFB00",ffllig:"\uFB04",Ffr:"\u{1D509}",ffr:"\u{1D523}",filig:"\uFB01",FilledSmallSquare:"\u25FC",FilledVerySmallSquare:"\u25AA",fjlig:"fj",flat:"\u266D",fllig:"\uFB02",fltns:"\u25B1",fnof:"\u0192",Fopf:"\u{1D53D}",fopf:"\u{1D557}",ForAll:"\u2200",forall:"\u2200",fork:"\u22D4",forkv:"\u2AD9",Fouriertrf:"\u2131",fpartint:"\u2A0D",frac12:"\xBD",frac13:"\u2153",frac14:"\xBC",frac15:"\u2155",frac16:"\u2159",frac18:"\u215B",frac23:"\u2154",frac25:"\u2156",frac34:"\xBE",frac35:"\u2157",frac38:"\u215C",frac45:"\u2158",frac56:"\u215A",frac58:"\u215D",frac78:"\u215E",frasl:"\u2044",frown:"\u2322",Fscr:"\u2131",fscr:"\u{1D4BB}",gacute:"\u01F5",Gamma:"\u0393",gamma:"\u03B3",Gammad:"\u03DC",gammad:"\u03DD",gap:"\u2A86",Gbreve:"\u011E",gbreve:"\u011F",Gcedil:"\u0122",Gcirc:"\u011C",gcirc:"\u011D",Gcy:"\u0413",gcy:"\u0433",Gdot:"\u0120",gdot:"\u0121",gE:"\u2267",ge:"\u2265",gEl:"\u2A8C",gel:"\u22DB",geq:"\u2265",geqq:"\u2267",geqslant:"\u2A7E",ges:"\u2A7E",gescc:"\u2AA9",gesdot:"\u2A80",gesdoto:"\u2A82",gesdotol:"\u2A84",gesl:"\u22DB\uFE00",gesles:"\u2A94",Gfr:"\u{1D50A}",gfr:"\u{1D524}",Gg:"\u22D9",gg:"\u226B",ggg:"\u22D9",gimel:"\u2137",GJcy:"\u0403",gjcy:"\u0453",gl:"\u2277",gla:"\u2AA5",glE:"\u2A92",glj:"\u2AA4",gnap:"\u2A8A",gnapprox:"\u2A8A",gnE:"\u2269",gne:"\u2A88",gneq:"\u2A88",gneqq:"\u2269",gnsim:"\u22E7",Gopf:"\u{1D53E}",gopf:"\u{1D558}",grave:"`",GreaterEqual:"\u2265",GreaterEqualLess:"\u22DB",GreaterFullEqual:"\u2267",GreaterGreater:"\u2AA2",GreaterLess:"\u2277",GreaterSlantEqual:"\u2A7E",GreaterTilde:"\u2273",Gscr:"\u{1D4A2}",gscr:"\u210A",gsim:"\u2273",gsime:"\u2A8E",gsiml:"\u2A90",Gt:"\u226B",GT:">",gt:">",gtcc:"\u2AA7",gtcir:"\u2A7A",gtdot:"\u22D7",gtlPar:"\u2995",gtquest:"\u2A7C",gtrapprox:"\u2A86",gtrarr:"\u2978",gtrdot:"\u22D7",gtreqless:"\u22DB",gtreqqless:"\u2A8C",gtrless:"\u2277",gtrsim:"\u2273",gvertneqq:"\u2269\uFE00",gvnE:"\u2269\uFE00",Hacek:"\u02C7",hairsp:"\u200A",half:"\xBD",hamilt:"\u210B",HARDcy:"\u042A",hardcy:"\u044A",hArr:"\u21D4",harr:"\u2194",harrcir:"\u2948",harrw:"\u21AD",Hat:"^",hbar:"\u210F",Hcirc:"\u0124",hcirc:"\u0125",hearts:"\u2665",heartsuit:"\u2665",hellip:"\u2026",hercon:"\u22B9",Hfr:"\u210C",hfr:"\u{1D525}",HilbertSpace:"\u210B",hksearow:"\u2925",hkswarow:"\u2926",hoarr:"\u21FF",homtht:"\u223B",hookleftarrow:"\u21A9",hookrightarrow:"\u21AA",Hopf:"\u210D",hopf:"\u{1D559}",horbar:"\u2015",HorizontalLine:"\u2500",Hscr:"\u210B",hscr:"\u{1D4BD}",hslash:"\u210F",Hstrok:"\u0126",hstrok:"\u0127",HumpDownHump:"\u224E",HumpEqual:"\u224F",hybull:"\u2043",hyphen:"\u2010",Iacute:"\xCD",iacute:"\xED",ic:"\u2063",Icirc:"\xCE",icirc:"\xEE",Icy:"\u0418",icy:"\u0438",Idot:"\u0130",IEcy:"\u0415",iecy:"\u0435",iexcl:"\xA1",iff:"\u21D4",Ifr:"\u2111",ifr:"\u{1D526}",Igrave:"\xCC",igrave:"\xEC",ii:"\u2148",iiiint:"\u2A0C",iiint:"\u222D",iinfin:"\u29DC",iiota:"\u2129",IJlig:"\u0132",ijlig:"\u0133",Im:"\u2111",Imacr:"\u012A",imacr:"\u012B",image:"\u2111",ImaginaryI:"\u2148",imagline:"\u2110",imagpart:"\u2111",imath:"\u0131",imof:"\u22B7",imped:"\u01B5",Implies:"\u21D2",in:"\u2208",incare:"\u2105",infin:"\u221E",infintie:"\u29DD",inodot:"\u0131",Int:"\u222C",int:"\u222B",intcal:"\u22BA",integers:"\u2124",Integral:"\u222B",intercal:"\u22BA",Intersection:"\u22C2",intlarhk:"\u2A17",intprod:"\u2A3C",InvisibleComma:"\u2063",InvisibleTimes:"\u2062",IOcy:"\u0401",iocy:"\u0451",Iogon:"\u012E",iogon:"\u012F",Iopf:"\u{1D540}",iopf:"\u{1D55A}",Iota:"\u0399",iota:"\u03B9",iprod:"\u2A3C",iquest:"\xBF",Iscr:"\u2110",iscr:"\u{1D4BE}",isin:"\u2208",isindot:"\u22F5",isinE:"\u22F9",isins:"\u22F4",isinsv:"\u22F3",isinv:"\u2208",it:"\u2062",Itilde:"\u0128",itilde:"\u0129",Iukcy:"\u0406",iukcy:"\u0456",Iuml:"\xCF",iuml:"\xEF",Jcirc:"\u0134",jcirc:"\u0135",Jcy:"\u0419",jcy:"\u0439",Jfr:"\u{1D50D}",jfr:"\u{1D527}",jmath:"\u0237",Jopf:"\u{1D541}",jopf:"\u{1D55B}",Jscr:"\u{1D4A5}",jscr:"\u{1D4BF}",Jsercy:"\u0408",jsercy:"\u0458",Jukcy:"\u0404",jukcy:"\u0454",Kappa:"\u039A",kappa:"\u03BA",kappav:"\u03F0",Kcedil:"\u0136",kcedil:"\u0137",Kcy:"\u041A",kcy:"\u043A",Kfr:"\u{1D50E}",kfr:"\u{1D528}",kgreen:"\u0138",KHcy:"\u0425",khcy:"\u0445",KJcy:"\u040C",kjcy:"\u045C",Kopf:"\u{1D542}",kopf:"\u{1D55C}",Kscr:"\u{1D4A6}",kscr:"\u{1D4C0}",lAarr:"\u21DA",Lacute:"\u0139",lacute:"\u013A",laemptyv:"\u29B4",lagran:"\u2112",Lambda:"\u039B",lambda:"\u03BB",Lang:"\u27EA",lang:"\u27E8",langd:"\u2991",langle:"\u27E8",lap:"\u2A85",Laplacetrf:"\u2112",laquo:"\xAB",Larr:"\u219E",lArr:"\u21D0",larr:"\u2190",larrb:"\u21E4",larrbfs:"\u291F",larrfs:"\u291D",larrhk:"\u21A9",larrlp:"\u21AB",larrpl:"\u2939",larrsim:"\u2973",larrtl:"\u21A2",lat:"\u2AAB",lAtail:"\u291B",latail:"\u2919",late:"\u2AAD",lates:"\u2AAD\uFE00",lBarr:"\u290E",lbarr:"\u290C",lbbrk:"\u2772",lbrace:"{",lbrack:"[",lbrke:"\u298B",lbrksld:"\u298F",lbrkslu:"\u298D",Lcaron:"\u013D",lcaron:"\u013E",Lcedil:"\u013B",lcedil:"\u013C",lceil:"\u2308",lcub:"{",Lcy:"\u041B",lcy:"\u043B",ldca:"\u2936",ldquo:"\u201C",ldquor:"\u201E",ldrdhar:"\u2967",ldrushar:"\u294B",ldsh:"\u21B2",lE:"\u2266",le:"\u2264",LeftAngleBracket:"\u27E8",LeftArrow:"\u2190",Leftarrow:"\u21D0",leftarrow:"\u2190",LeftArrowBar:"\u21E4",LeftArrowRightArrow:"\u21C6",leftarrowtail:"\u21A2",LeftCeiling:"\u2308",LeftDoubleBracket:"\u27E6",LeftDownTeeVector:"\u2961",LeftDownVector:"\u21C3",LeftDownVectorBar:"\u2959",LeftFloor:"\u230A",leftharpoondown:"\u21BD",leftharpoonup:"\u21BC",leftleftarrows:"\u21C7",LeftRightArrow:"\u2194",Leftrightarrow:"\u21D4",leftrightarrow:"\u2194",leftrightarrows:"\u21C6",leftrightharpoons:"\u21CB",leftrightsquigarrow:"\u21AD",LeftRightVector:"\u294E",LeftTee:"\u22A3",LeftTeeArrow:"\u21A4",LeftTeeVector:"\u295A",leftthreetimes:"\u22CB",LeftTriangle:"\u22B2",LeftTriangleBar:"\u29CF",LeftTriangleEqual:"\u22B4",LeftUpDownVector:"\u2951",LeftUpTeeVector:"\u2960",LeftUpVector:"\u21BF",LeftUpVectorBar:"\u2958",LeftVector:"\u21BC",LeftVectorBar:"\u2952",lEg:"\u2A8B",leg:"\u22DA",leq:"\u2264",leqq:"\u2266",leqslant:"\u2A7D",les:"\u2A7D",lescc:"\u2AA8",lesdot:"\u2A7F",lesdoto:"\u2A81",lesdotor:"\u2A83",lesg:"\u22DA\uFE00",lesges:"\u2A93",lessapprox:"\u2A85",lessdot:"\u22D6",lesseqgtr:"\u22DA",lesseqqgtr:"\u2A8B",LessEqualGreater:"\u22DA",LessFullEqual:"\u2266",LessGreater:"\u2276",lessgtr:"\u2276",LessLess:"\u2AA1",lesssim:"\u2272",LessSlantEqual:"\u2A7D",LessTilde:"\u2272",lfisht:"\u297C",lfloor:"\u230A",Lfr:"\u{1D50F}",lfr:"\u{1D529}",lg:"\u2276",lgE:"\u2A91",lHar:"\u2962",lhard:"\u21BD",lharu:"\u21BC",lharul:"\u296A",lhblk:"\u2584",LJcy:"\u0409",ljcy:"\u0459",Ll:"\u22D8",ll:"\u226A",llarr:"\u21C7",llcorner:"\u231E",Lleftarrow:"\u21DA",llhard:"\u296B",lltri:"\u25FA",Lmidot:"\u013F",lmidot:"\u0140",lmoust:"\u23B0",lmoustache:"\u23B0",lnap:"\u2A89",lnapprox:"\u2A89",lnE:"\u2268",lne:"\u2A87",lneq:"\u2A87",lneqq:"\u2268",lnsim:"\u22E6",loang:"\u27EC",loarr:"\u21FD",lobrk:"\u27E6",LongLeftArrow:"\u27F5",Longleftarrow:"\u27F8",longleftarrow:"\u27F5",LongLeftRightArrow:"\u27F7",Longleftrightarrow:"\u27FA",longleftrightarrow:"\u27F7",longmapsto:"\u27FC",LongRightArrow:"\u27F6",Longrightarrow:"\u27F9",longrightarrow:"\u27F6",looparrowleft:"\u21AB",looparrowright:"\u21AC",lopar:"\u2985",Lopf:"\u{1D543}",lopf:"\u{1D55D}",loplus:"\u2A2D",lotimes:"\u2A34",lowast:"\u2217",lowbar:"_",LowerLeftArrow:"\u2199",LowerRightArrow:"\u2198",loz:"\u25CA",lozenge:"\u25CA",lozf:"\u29EB",lpar:"(",lparlt:"\u2993",lrarr:"\u21C6",lrcorner:"\u231F",lrhar:"\u21CB",lrhard:"\u296D",lrm:"\u200E",lrtri:"\u22BF",lsaquo:"\u2039",Lscr:"\u2112",lscr:"\u{1D4C1}",Lsh:"\u21B0",lsh:"\u21B0",lsim:"\u2272",lsime:"\u2A8D",lsimg:"\u2A8F",lsqb:"[",lsquo:"\u2018",lsquor:"\u201A",Lstrok:"\u0141",lstrok:"\u0142",Lt:"\u226A",LT:"<",lt:"<",ltcc:"\u2AA6",ltcir:"\u2A79",ltdot:"\u22D6",lthree:"\u22CB",ltimes:"\u22C9",ltlarr:"\u2976",ltquest:"\u2A7B",ltri:"\u25C3",ltrie:"\u22B4",ltrif:"\u25C2",ltrPar:"\u2996",lurdshar:"\u294A",luruhar:"\u2966",lvertneqq:"\u2268\uFE00",lvnE:"\u2268\uFE00",macr:"\xAF",male:"\u2642",malt:"\u2720",maltese:"\u2720",Map:"\u2905",map:"\u21A6",mapsto:"\u21A6",mapstodown:"\u21A7",mapstoleft:"\u21A4",mapstoup:"\u21A5",marker:"\u25AE",mcomma:"\u2A29",Mcy:"\u041C",mcy:"\u043C",mdash:"\u2014",mDDot:"\u223A",measuredangle:"\u2221",MediumSpace:"\u205F",Mellintrf:"\u2133",Mfr:"\u{1D510}",mfr:"\u{1D52A}",mho:"\u2127",micro:"\xB5",mid:"\u2223",midast:"*",midcir:"\u2AF0",middot:"\xB7",minus:"\u2212",minusb:"\u229F",minusd:"\u2238",minusdu:"\u2A2A",MinusPlus:"\u2213",mlcp:"\u2ADB",mldr:"\u2026",mnplus:"\u2213",models:"\u22A7",Mopf:"\u{1D544}",mopf:"\u{1D55E}",mp:"\u2213",Mscr:"\u2133",mscr:"\u{1D4C2}",mstpos:"\u223E",Mu:"\u039C",mu:"\u03BC",multimap:"\u22B8",mumap:"\u22B8",nabla:"\u2207",Nacute:"\u0143",nacute:"\u0144",nang:"\u2220\u20D2",nap:"\u2249",napE:"\u2A70\u0338",napid:"\u224B\u0338",napos:"\u0149",napprox:"\u2249",natur:"\u266E",natural:"\u266E",naturals:"\u2115",nbsp:"\xA0",nbump:"\u224E\u0338",nbumpe:"\u224F\u0338",ncap:"\u2A43",Ncaron:"\u0147",ncaron:"\u0148",Ncedil:"\u0145",ncedil:"\u0146",ncong:"\u2247",ncongdot:"\u2A6D\u0338",ncup:"\u2A42",Ncy:"\u041D",ncy:"\u043D",ndash:"\u2013",ne:"\u2260",nearhk:"\u2924",neArr:"\u21D7",nearr:"\u2197",nearrow:"\u2197",nedot:"\u2250\u0338",NegativeMediumSpace:"\u200B",NegativeThickSpace:"\u200B",NegativeThinSpace:"\u200B",NegativeVeryThinSpace:"\u200B",nequiv:"\u2262",nesear:"\u2928",nesim:"\u2242\u0338",NestedGreaterGreater:"\u226B",NestedLessLess:"\u226A",NewLine:`
10
+ `,nexist:"\u2204",nexists:"\u2204",Nfr:"\u{1D511}",nfr:"\u{1D52B}",ngE:"\u2267\u0338",nge:"\u2271",ngeq:"\u2271",ngeqq:"\u2267\u0338",ngeqslant:"\u2A7E\u0338",nges:"\u2A7E\u0338",nGg:"\u22D9\u0338",ngsim:"\u2275",nGt:"\u226B\u20D2",ngt:"\u226F",ngtr:"\u226F",nGtv:"\u226B\u0338",nhArr:"\u21CE",nharr:"\u21AE",nhpar:"\u2AF2",ni:"\u220B",nis:"\u22FC",nisd:"\u22FA",niv:"\u220B",NJcy:"\u040A",njcy:"\u045A",nlArr:"\u21CD",nlarr:"\u219A",nldr:"\u2025",nlE:"\u2266\u0338",nle:"\u2270",nLeftarrow:"\u21CD",nleftarrow:"\u219A",nLeftrightarrow:"\u21CE",nleftrightarrow:"\u21AE",nleq:"\u2270",nleqq:"\u2266\u0338",nleqslant:"\u2A7D\u0338",nles:"\u2A7D\u0338",nless:"\u226E",nLl:"\u22D8\u0338",nlsim:"\u2274",nLt:"\u226A\u20D2",nlt:"\u226E",nltri:"\u22EA",nltrie:"\u22EC",nLtv:"\u226A\u0338",nmid:"\u2224",NoBreak:"\u2060",NonBreakingSpace:"\xA0",Nopf:"\u2115",nopf:"\u{1D55F}",Not:"\u2AEC",not:"\xAC",NotCongruent:"\u2262",NotCupCap:"\u226D",NotDoubleVerticalBar:"\u2226",NotElement:"\u2209",NotEqual:"\u2260",NotEqualTilde:"\u2242\u0338",NotExists:"\u2204",NotGreater:"\u226F",NotGreaterEqual:"\u2271",NotGreaterFullEqual:"\u2267\u0338",NotGreaterGreater:"\u226B\u0338",NotGreaterLess:"\u2279",NotGreaterSlantEqual:"\u2A7E\u0338",NotGreaterTilde:"\u2275",NotHumpDownHump:"\u224E\u0338",NotHumpEqual:"\u224F\u0338",notin:"\u2209",notindot:"\u22F5\u0338",notinE:"\u22F9\u0338",notinva:"\u2209",notinvb:"\u22F7",notinvc:"\u22F6",NotLeftTriangle:"\u22EA",NotLeftTriangleBar:"\u29CF\u0338",NotLeftTriangleEqual:"\u22EC",NotLess:"\u226E",NotLessEqual:"\u2270",NotLessGreater:"\u2278",NotLessLess:"\u226A\u0338",NotLessSlantEqual:"\u2A7D\u0338",NotLessTilde:"\u2274",NotNestedGreaterGreater:"\u2AA2\u0338",NotNestedLessLess:"\u2AA1\u0338",notni:"\u220C",notniva:"\u220C",notnivb:"\u22FE",notnivc:"\u22FD",NotPrecedes:"\u2280",NotPrecedesEqual:"\u2AAF\u0338",NotPrecedesSlantEqual:"\u22E0",NotReverseElement:"\u220C",NotRightTriangle:"\u22EB",NotRightTriangleBar:"\u29D0\u0338",NotRightTriangleEqual:"\u22ED",NotSquareSubset:"\u228F\u0338",NotSquareSubsetEqual:"\u22E2",NotSquareSuperset:"\u2290\u0338",NotSquareSupersetEqual:"\u22E3",NotSubset:"\u2282\u20D2",NotSubsetEqual:"\u2288",NotSucceeds:"\u2281",NotSucceedsEqual:"\u2AB0\u0338",NotSucceedsSlantEqual:"\u22E1",NotSucceedsTilde:"\u227F\u0338",NotSuperset:"\u2283\u20D2",NotSupersetEqual:"\u2289",NotTilde:"\u2241",NotTildeEqual:"\u2244",NotTildeFullEqual:"\u2247",NotTildeTilde:"\u2249",NotVerticalBar:"\u2224",npar:"\u2226",nparallel:"\u2226",nparsl:"\u2AFD\u20E5",npart:"\u2202\u0338",npolint:"\u2A14",npr:"\u2280",nprcue:"\u22E0",npre:"\u2AAF\u0338",nprec:"\u2280",npreceq:"\u2AAF\u0338",nrArr:"\u21CF",nrarr:"\u219B",nrarrc:"\u2933\u0338",nrarrw:"\u219D\u0338",nRightarrow:"\u21CF",nrightarrow:"\u219B",nrtri:"\u22EB",nrtrie:"\u22ED",nsc:"\u2281",nsccue:"\u22E1",nsce:"\u2AB0\u0338",Nscr:"\u{1D4A9}",nscr:"\u{1D4C3}",nshortmid:"\u2224",nshortparallel:"\u2226",nsim:"\u2241",nsime:"\u2244",nsimeq:"\u2244",nsmid:"\u2224",nspar:"\u2226",nsqsube:"\u22E2",nsqsupe:"\u22E3",nsub:"\u2284",nsubE:"\u2AC5\u0338",nsube:"\u2288",nsubset:"\u2282\u20D2",nsubseteq:"\u2288",nsubseteqq:"\u2AC5\u0338",nsucc:"\u2281",nsucceq:"\u2AB0\u0338",nsup:"\u2285",nsupE:"\u2AC6\u0338",nsupe:"\u2289",nsupset:"\u2283\u20D2",nsupseteq:"\u2289",nsupseteqq:"\u2AC6\u0338",ntgl:"\u2279",Ntilde:"\xD1",ntilde:"\xF1",ntlg:"\u2278",ntriangleleft:"\u22EA",ntrianglelefteq:"\u22EC",ntriangleright:"\u22EB",ntrianglerighteq:"\u22ED",Nu:"\u039D",nu:"\u03BD",num:"#",numero:"\u2116",numsp:"\u2007",nvap:"\u224D\u20D2",nVDash:"\u22AF",nVdash:"\u22AE",nvDash:"\u22AD",nvdash:"\u22AC",nvge:"\u2265\u20D2",nvgt:">\u20D2",nvHarr:"\u2904",nvinfin:"\u29DE",nvlArr:"\u2902",nvle:"\u2264\u20D2",nvlt:"<\u20D2",nvltrie:"\u22B4\u20D2",nvrArr:"\u2903",nvrtrie:"\u22B5\u20D2",nvsim:"\u223C\u20D2",nwarhk:"\u2923",nwArr:"\u21D6",nwarr:"\u2196",nwarrow:"\u2196",nwnear:"\u2927",Oacute:"\xD3",oacute:"\xF3",oast:"\u229B",ocir:"\u229A",Ocirc:"\xD4",ocirc:"\xF4",Ocy:"\u041E",ocy:"\u043E",odash:"\u229D",Odblac:"\u0150",odblac:"\u0151",odiv:"\u2A38",odot:"\u2299",odsold:"\u29BC",OElig:"\u0152",oelig:"\u0153",ofcir:"\u29BF",Ofr:"\u{1D512}",ofr:"\u{1D52C}",ogon:"\u02DB",Ograve:"\xD2",ograve:"\xF2",ogt:"\u29C1",ohbar:"\u29B5",ohm:"\u03A9",oint:"\u222E",olarr:"\u21BA",olcir:"\u29BE",olcross:"\u29BB",oline:"\u203E",olt:"\u29C0",Omacr:"\u014C",omacr:"\u014D",Omega:"\u03A9",omega:"\u03C9",Omicron:"\u039F",omicron:"\u03BF",omid:"\u29B6",ominus:"\u2296",Oopf:"\u{1D546}",oopf:"\u{1D560}",opar:"\u29B7",OpenCurlyDoubleQuote:"\u201C",OpenCurlyQuote:"\u2018",operp:"\u29B9",oplus:"\u2295",Or:"\u2A54",or:"\u2228",orarr:"\u21BB",ord:"\u2A5D",order:"\u2134",orderof:"\u2134",ordf:"\xAA",ordm:"\xBA",origof:"\u22B6",oror:"\u2A56",orslope:"\u2A57",orv:"\u2A5B",oS:"\u24C8",Oscr:"\u{1D4AA}",oscr:"\u2134",Oslash:"\xD8",oslash:"\xF8",osol:"\u2298",Otilde:"\xD5",otilde:"\xF5",Otimes:"\u2A37",otimes:"\u2297",otimesas:"\u2A36",Ouml:"\xD6",ouml:"\xF6",ovbar:"\u233D",OverBar:"\u203E",OverBrace:"\u23DE",OverBracket:"\u23B4",OverParenthesis:"\u23DC",par:"\u2225",para:"\xB6",parallel:"\u2225",parsim:"\u2AF3",parsl:"\u2AFD",part:"\u2202",PartialD:"\u2202",Pcy:"\u041F",pcy:"\u043F",percnt:"%",period:".",permil:"\u2030",perp:"\u22A5",pertenk:"\u2031",Pfr:"\u{1D513}",pfr:"\u{1D52D}",Phi:"\u03A6",phi:"\u03C6",phiv:"\u03D5",phmmat:"\u2133",phone:"\u260E",Pi:"\u03A0",pi:"\u03C0",pitchfork:"\u22D4",piv:"\u03D6",planck:"\u210F",planckh:"\u210E",plankv:"\u210F",plus:"+",plusacir:"\u2A23",plusb:"\u229E",pluscir:"\u2A22",plusdo:"\u2214",plusdu:"\u2A25",pluse:"\u2A72",PlusMinus:"\xB1",plusmn:"\xB1",plussim:"\u2A26",plustwo:"\u2A27",pm:"\xB1",Poincareplane:"\u210C",pointint:"\u2A15",Popf:"\u2119",popf:"\u{1D561}",pound:"\xA3",Pr:"\u2ABB",pr:"\u227A",prap:"\u2AB7",prcue:"\u227C",prE:"\u2AB3",pre:"\u2AAF",prec:"\u227A",precapprox:"\u2AB7",preccurlyeq:"\u227C",Precedes:"\u227A",PrecedesEqual:"\u2AAF",PrecedesSlantEqual:"\u227C",PrecedesTilde:"\u227E",preceq:"\u2AAF",precnapprox:"\u2AB9",precneqq:"\u2AB5",precnsim:"\u22E8",precsim:"\u227E",Prime:"\u2033",prime:"\u2032",primes:"\u2119",prnap:"\u2AB9",prnE:"\u2AB5",prnsim:"\u22E8",prod:"\u220F",Product:"\u220F",profalar:"\u232E",profline:"\u2312",profsurf:"\u2313",prop:"\u221D",Proportion:"\u2237",Proportional:"\u221D",propto:"\u221D",prsim:"\u227E",prurel:"\u22B0",Pscr:"\u{1D4AB}",pscr:"\u{1D4C5}",Psi:"\u03A8",psi:"\u03C8",puncsp:"\u2008",Qfr:"\u{1D514}",qfr:"\u{1D52E}",qint:"\u2A0C",Qopf:"\u211A",qopf:"\u{1D562}",qprime:"\u2057",Qscr:"\u{1D4AC}",qscr:"\u{1D4C6}",quaternions:"\u210D",quatint:"\u2A16",quest:"?",questeq:"\u225F",QUOT:'"',quot:'"',rAarr:"\u21DB",race:"\u223D\u0331",Racute:"\u0154",racute:"\u0155",radic:"\u221A",raemptyv:"\u29B3",Rang:"\u27EB",rang:"\u27E9",rangd:"\u2992",range:"\u29A5",rangle:"\u27E9",raquo:"\xBB",Rarr:"\u21A0",rArr:"\u21D2",rarr:"\u2192",rarrap:"\u2975",rarrb:"\u21E5",rarrbfs:"\u2920",rarrc:"\u2933",rarrfs:"\u291E",rarrhk:"\u21AA",rarrlp:"\u21AC",rarrpl:"\u2945",rarrsim:"\u2974",Rarrtl:"\u2916",rarrtl:"\u21A3",rarrw:"\u219D",rAtail:"\u291C",ratail:"\u291A",ratio:"\u2236",rationals:"\u211A",RBarr:"\u2910",rBarr:"\u290F",rbarr:"\u290D",rbbrk:"\u2773",rbrace:"}",rbrack:"]",rbrke:"\u298C",rbrksld:"\u298E",rbrkslu:"\u2990",Rcaron:"\u0158",rcaron:"\u0159",Rcedil:"\u0156",rcedil:"\u0157",rceil:"\u2309",rcub:"}",Rcy:"\u0420",rcy:"\u0440",rdca:"\u2937",rdldhar:"\u2969",rdquo:"\u201D",rdquor:"\u201D",rdsh:"\u21B3",Re:"\u211C",real:"\u211C",realine:"\u211B",realpart:"\u211C",reals:"\u211D",rect:"\u25AD",REG:"\xAE",reg:"\xAE",ReverseElement:"\u220B",ReverseEquilibrium:"\u21CB",ReverseUpEquilibrium:"\u296F",rfisht:"\u297D",rfloor:"\u230B",Rfr:"\u211C",rfr:"\u{1D52F}",rHar:"\u2964",rhard:"\u21C1",rharu:"\u21C0",rharul:"\u296C",Rho:"\u03A1",rho:"\u03C1",rhov:"\u03F1",RightAngleBracket:"\u27E9",RightArrow:"\u2192",Rightarrow:"\u21D2",rightarrow:"\u2192",RightArrowBar:"\u21E5",RightArrowLeftArrow:"\u21C4",rightarrowtail:"\u21A3",RightCeiling:"\u2309",RightDoubleBracket:"\u27E7",RightDownTeeVector:"\u295D",RightDownVector:"\u21C2",RightDownVectorBar:"\u2955",RightFloor:"\u230B",rightharpoondown:"\u21C1",rightharpoonup:"\u21C0",rightleftarrows:"\u21C4",rightleftharpoons:"\u21CC",rightrightarrows:"\u21C9",rightsquigarrow:"\u219D",RightTee:"\u22A2",RightTeeArrow:"\u21A6",RightTeeVector:"\u295B",rightthreetimes:"\u22CC",RightTriangle:"\u22B3",RightTriangleBar:"\u29D0",RightTriangleEqual:"\u22B5",RightUpDownVector:"\u294F",RightUpTeeVector:"\u295C",RightUpVector:"\u21BE",RightUpVectorBar:"\u2954",RightVector:"\u21C0",RightVectorBar:"\u2953",ring:"\u02DA",risingdotseq:"\u2253",rlarr:"\u21C4",rlhar:"\u21CC",rlm:"\u200F",rmoust:"\u23B1",rmoustache:"\u23B1",rnmid:"\u2AEE",roang:"\u27ED",roarr:"\u21FE",robrk:"\u27E7",ropar:"\u2986",Ropf:"\u211D",ropf:"\u{1D563}",roplus:"\u2A2E",rotimes:"\u2A35",RoundImplies:"\u2970",rpar:")",rpargt:"\u2994",rppolint:"\u2A12",rrarr:"\u21C9",Rrightarrow:"\u21DB",rsaquo:"\u203A",Rscr:"\u211B",rscr:"\u{1D4C7}",Rsh:"\u21B1",rsh:"\u21B1",rsqb:"]",rsquo:"\u2019",rsquor:"\u2019",rthree:"\u22CC",rtimes:"\u22CA",rtri:"\u25B9",rtrie:"\u22B5",rtrif:"\u25B8",rtriltri:"\u29CE",RuleDelayed:"\u29F4",ruluhar:"\u2968",rx:"\u211E",Sacute:"\u015A",sacute:"\u015B",sbquo:"\u201A",Sc:"\u2ABC",sc:"\u227B",scap:"\u2AB8",Scaron:"\u0160",scaron:"\u0161",sccue:"\u227D",scE:"\u2AB4",sce:"\u2AB0",Scedil:"\u015E",scedil:"\u015F",Scirc:"\u015C",scirc:"\u015D",scnap:"\u2ABA",scnE:"\u2AB6",scnsim:"\u22E9",scpolint:"\u2A13",scsim:"\u227F",Scy:"\u0421",scy:"\u0441",sdot:"\u22C5",sdotb:"\u22A1",sdote:"\u2A66",searhk:"\u2925",seArr:"\u21D8",searr:"\u2198",searrow:"\u2198",sect:"\xA7",semi:";",seswar:"\u2929",setminus:"\u2216",setmn:"\u2216",sext:"\u2736",Sfr:"\u{1D516}",sfr:"\u{1D530}",sfrown:"\u2322",sharp:"\u266F",SHCHcy:"\u0429",shchcy:"\u0449",SHcy:"\u0428",shcy:"\u0448",ShortDownArrow:"\u2193",ShortLeftArrow:"\u2190",shortmid:"\u2223",shortparallel:"\u2225",ShortRightArrow:"\u2192",ShortUpArrow:"\u2191",shy:"\xAD",Sigma:"\u03A3",sigma:"\u03C3",sigmaf:"\u03C2",sigmav:"\u03C2",sim:"\u223C",simdot:"\u2A6A",sime:"\u2243",simeq:"\u2243",simg:"\u2A9E",simgE:"\u2AA0",siml:"\u2A9D",simlE:"\u2A9F",simne:"\u2246",simplus:"\u2A24",simrarr:"\u2972",slarr:"\u2190",SmallCircle:"\u2218",smallsetminus:"\u2216",smashp:"\u2A33",smeparsl:"\u29E4",smid:"\u2223",smile:"\u2323",smt:"\u2AAA",smte:"\u2AAC",smtes:"\u2AAC\uFE00",SOFTcy:"\u042C",softcy:"\u044C",sol:"/",solb:"\u29C4",solbar:"\u233F",Sopf:"\u{1D54A}",sopf:"\u{1D564}",spades:"\u2660",spadesuit:"\u2660",spar:"\u2225",sqcap:"\u2293",sqcaps:"\u2293\uFE00",sqcup:"\u2294",sqcups:"\u2294\uFE00",Sqrt:"\u221A",sqsub:"\u228F",sqsube:"\u2291",sqsubset:"\u228F",sqsubseteq:"\u2291",sqsup:"\u2290",sqsupe:"\u2292",sqsupset:"\u2290",sqsupseteq:"\u2292",squ:"\u25A1",Square:"\u25A1",square:"\u25A1",SquareIntersection:"\u2293",SquareSubset:"\u228F",SquareSubsetEqual:"\u2291",SquareSuperset:"\u2290",SquareSupersetEqual:"\u2292",SquareUnion:"\u2294",squarf:"\u25AA",squf:"\u25AA",srarr:"\u2192",Sscr:"\u{1D4AE}",sscr:"\u{1D4C8}",ssetmn:"\u2216",ssmile:"\u2323",sstarf:"\u22C6",Star:"\u22C6",star:"\u2606",starf:"\u2605",straightepsilon:"\u03F5",straightphi:"\u03D5",strns:"\xAF",Sub:"\u22D0",sub:"\u2282",subdot:"\u2ABD",subE:"\u2AC5",sube:"\u2286",subedot:"\u2AC3",submult:"\u2AC1",subnE:"\u2ACB",subne:"\u228A",subplus:"\u2ABF",subrarr:"\u2979",Subset:"\u22D0",subset:"\u2282",subseteq:"\u2286",subseteqq:"\u2AC5",SubsetEqual:"\u2286",subsetneq:"\u228A",subsetneqq:"\u2ACB",subsim:"\u2AC7",subsub:"\u2AD5",subsup:"\u2AD3",succ:"\u227B",succapprox:"\u2AB8",succcurlyeq:"\u227D",Succeeds:"\u227B",SucceedsEqual:"\u2AB0",SucceedsSlantEqual:"\u227D",SucceedsTilde:"\u227F",succeq:"\u2AB0",succnapprox:"\u2ABA",succneqq:"\u2AB6",succnsim:"\u22E9",succsim:"\u227F",SuchThat:"\u220B",Sum:"\u2211",sum:"\u2211",sung:"\u266A",Sup:"\u22D1",sup:"\u2283",sup1:"\xB9",sup2:"\xB2",sup3:"\xB3",supdot:"\u2ABE",supdsub:"\u2AD8",supE:"\u2AC6",supe:"\u2287",supedot:"\u2AC4",Superset:"\u2283",SupersetEqual:"\u2287",suphsol:"\u27C9",suphsub:"\u2AD7",suplarr:"\u297B",supmult:"\u2AC2",supnE:"\u2ACC",supne:"\u228B",supplus:"\u2AC0",Supset:"\u22D1",supset:"\u2283",supseteq:"\u2287",supseteqq:"\u2AC6",supsetneq:"\u228B",supsetneqq:"\u2ACC",supsim:"\u2AC8",supsub:"\u2AD4",supsup:"\u2AD6",swarhk:"\u2926",swArr:"\u21D9",swarr:"\u2199",swarrow:"\u2199",swnwar:"\u292A",szlig:"\xDF",Tab:" ",target:"\u2316",Tau:"\u03A4",tau:"\u03C4",tbrk:"\u23B4",Tcaron:"\u0164",tcaron:"\u0165",Tcedil:"\u0162",tcedil:"\u0163",Tcy:"\u0422",tcy:"\u0442",tdot:"\u20DB",telrec:"\u2315",Tfr:"\u{1D517}",tfr:"\u{1D531}",there4:"\u2234",Therefore:"\u2234",therefore:"\u2234",Theta:"\u0398",theta:"\u03B8",thetasym:"\u03D1",thetav:"\u03D1",thickapprox:"\u2248",thicksim:"\u223C",ThickSpace:"\u205F\u200A",thinsp:"\u2009",ThinSpace:"\u2009",thkap:"\u2248",thksim:"\u223C",THORN:"\xDE",thorn:"\xFE",Tilde:"\u223C",tilde:"\u02DC",TildeEqual:"\u2243",TildeFullEqual:"\u2245",TildeTilde:"\u2248",times:"\xD7",timesb:"\u22A0",timesbar:"\u2A31",timesd:"\u2A30",tint:"\u222D",toea:"\u2928",top:"\u22A4",topbot:"\u2336",topcir:"\u2AF1",Topf:"\u{1D54B}",topf:"\u{1D565}",topfork:"\u2ADA",tosa:"\u2929",tprime:"\u2034",TRADE:"\u2122",trade:"\u2122",triangle:"\u25B5",triangledown:"\u25BF",triangleleft:"\u25C3",trianglelefteq:"\u22B4",triangleq:"\u225C",triangleright:"\u25B9",trianglerighteq:"\u22B5",tridot:"\u25EC",trie:"\u225C",triminus:"\u2A3A",TripleDot:"\u20DB",triplus:"\u2A39",trisb:"\u29CD",tritime:"\u2A3B",trpezium:"\u23E2",Tscr:"\u{1D4AF}",tscr:"\u{1D4C9}",TScy:"\u0426",tscy:"\u0446",TSHcy:"\u040B",tshcy:"\u045B",Tstrok:"\u0166",tstrok:"\u0167",twixt:"\u226C",twoheadleftarrow:"\u219E",twoheadrightarrow:"\u21A0",Uacute:"\xDA",uacute:"\xFA",Uarr:"\u219F",uArr:"\u21D1",uarr:"\u2191",Uarrocir:"\u2949",Ubrcy:"\u040E",ubrcy:"\u045E",Ubreve:"\u016C",ubreve:"\u016D",Ucirc:"\xDB",ucirc:"\xFB",Ucy:"\u0423",ucy:"\u0443",udarr:"\u21C5",Udblac:"\u0170",udblac:"\u0171",udhar:"\u296E",ufisht:"\u297E",Ufr:"\u{1D518}",ufr:"\u{1D532}",Ugrave:"\xD9",ugrave:"\xF9",uHar:"\u2963",uharl:"\u21BF",uharr:"\u21BE",uhblk:"\u2580",ulcorn:"\u231C",ulcorner:"\u231C",ulcrop:"\u230F",ultri:"\u25F8",Umacr:"\u016A",umacr:"\u016B",uml:"\xA8",UnderBar:"_",UnderBrace:"\u23DF",UnderBracket:"\u23B5",UnderParenthesis:"\u23DD",Union:"\u22C3",UnionPlus:"\u228E",Uogon:"\u0172",uogon:"\u0173",Uopf:"\u{1D54C}",uopf:"\u{1D566}",UpArrow:"\u2191",Uparrow:"\u21D1",uparrow:"\u2191",UpArrowBar:"\u2912",UpArrowDownArrow:"\u21C5",UpDownArrow:"\u2195",Updownarrow:"\u21D5",updownarrow:"\u2195",UpEquilibrium:"\u296E",upharpoonleft:"\u21BF",upharpoonright:"\u21BE",uplus:"\u228E",UpperLeftArrow:"\u2196",UpperRightArrow:"\u2197",Upsi:"\u03D2",upsi:"\u03C5",upsih:"\u03D2",Upsilon:"\u03A5",upsilon:"\u03C5",UpTee:"\u22A5",UpTeeArrow:"\u21A5",upuparrows:"\u21C8",urcorn:"\u231D",urcorner:"\u231D",urcrop:"\u230E",Uring:"\u016E",uring:"\u016F",urtri:"\u25F9",Uscr:"\u{1D4B0}",uscr:"\u{1D4CA}",utdot:"\u22F0",Utilde:"\u0168",utilde:"\u0169",utri:"\u25B5",utrif:"\u25B4",uuarr:"\u21C8",Uuml:"\xDC",uuml:"\xFC",uwangle:"\u29A7",vangrt:"\u299C",varepsilon:"\u03F5",varkappa:"\u03F0",varnothing:"\u2205",varphi:"\u03D5",varpi:"\u03D6",varpropto:"\u221D",vArr:"\u21D5",varr:"\u2195",varrho:"\u03F1",varsigma:"\u03C2",varsubsetneq:"\u228A\uFE00",varsubsetneqq:"\u2ACB\uFE00",varsupsetneq:"\u228B\uFE00",varsupsetneqq:"\u2ACC\uFE00",vartheta:"\u03D1",vartriangleleft:"\u22B2",vartriangleright:"\u22B3",Vbar:"\u2AEB",vBar:"\u2AE8",vBarv:"\u2AE9",Vcy:"\u0412",vcy:"\u0432",VDash:"\u22AB",Vdash:"\u22A9",vDash:"\u22A8",vdash:"\u22A2",Vdashl:"\u2AE6",Vee:"\u22C1",vee:"\u2228",veebar:"\u22BB",veeeq:"\u225A",vellip:"\u22EE",Verbar:"\u2016",verbar:"|",Vert:"\u2016",vert:"|",VerticalBar:"\u2223",VerticalLine:"|",VerticalSeparator:"\u2758",VerticalTilde:"\u2240",VeryThinSpace:"\u200A",Vfr:"\u{1D519}",vfr:"\u{1D533}",vltri:"\u22B2",vnsub:"\u2282\u20D2",vnsup:"\u2283\u20D2",Vopf:"\u{1D54D}",vopf:"\u{1D567}",vprop:"\u221D",vrtri:"\u22B3",Vscr:"\u{1D4B1}",vscr:"\u{1D4CB}",vsubnE:"\u2ACB\uFE00",vsubne:"\u228A\uFE00",vsupnE:"\u2ACC\uFE00",vsupne:"\u228B\uFE00",Vvdash:"\u22AA",vzigzag:"\u299A",Wcirc:"\u0174",wcirc:"\u0175",wedbar:"\u2A5F",Wedge:"\u22C0",wedge:"\u2227",wedgeq:"\u2259",weierp:"\u2118",Wfr:"\u{1D51A}",wfr:"\u{1D534}",Wopf:"\u{1D54E}",wopf:"\u{1D568}",wp:"\u2118",wr:"\u2240",wreath:"\u2240",Wscr:"\u{1D4B2}",wscr:"\u{1D4CC}",xcap:"\u22C2",xcirc:"\u25EF",xcup:"\u22C3",xdtri:"\u25BD",Xfr:"\u{1D51B}",xfr:"\u{1D535}",xhArr:"\u27FA",xharr:"\u27F7",Xi:"\u039E",xi:"\u03BE",xlArr:"\u27F8",xlarr:"\u27F5",xmap:"\u27FC",xnis:"\u22FB",xodot:"\u2A00",Xopf:"\u{1D54F}",xopf:"\u{1D569}",xoplus:"\u2A01",xotime:"\u2A02",xrArr:"\u27F9",xrarr:"\u27F6",Xscr:"\u{1D4B3}",xscr:"\u{1D4CD}",xsqcup:"\u2A06",xuplus:"\u2A04",xutri:"\u25B3",xvee:"\u22C1",xwedge:"\u22C0",Yacute:"\xDD",yacute:"\xFD",YAcy:"\u042F",yacy:"\u044F",Ycirc:"\u0176",ycirc:"\u0177",Ycy:"\u042B",ycy:"\u044B",yen:"\xA5",Yfr:"\u{1D51C}",yfr:"\u{1D536}",YIcy:"\u0407",yicy:"\u0457",Yopf:"\u{1D550}",yopf:"\u{1D56A}",Yscr:"\u{1D4B4}",yscr:"\u{1D4CE}",YUcy:"\u042E",yucy:"\u044E",Yuml:"\u0178",yuml:"\xFF",Zacute:"\u0179",zacute:"\u017A",Zcaron:"\u017D",zcaron:"\u017E",Zcy:"\u0417",zcy:"\u0437",Zdot:"\u017B",zdot:"\u017C",zeetrf:"\u2128",ZeroWidthSpace:"\u200B",Zeta:"\u0396",zeta:"\u03B6",Zfr:"\u2128",zfr:"\u{1D537}",ZHcy:"\u0416",zhcy:"\u0436",zigrarr:"\u21DD",Zopf:"\u2124",zopf:"\u{1D56B}",Zscr:"\u{1D4B5}",zscr:"\u{1D4CF}",zwj:"\u200D",zwnj:"\u200C"});$r.entityMap=$r.HTML_ENTITIES});var To=et(Gn=>{"use strict";var Qt=vt(),C=ei(),yo=xr(),ef=Qt.isHTMLEscapableRawTextElement,tf=Qt.isHTMLMimeType,rf=Qt.isHTMLRawTextElement,Ur=Qt.hasOwn,_o=Qt.NAMESPACE,nf=yo.ParseError,sf=yo.DOMException,Yt=0,dt=1,Zt=2,Lr=3,Jt=4,Kt=5,Fr=6,zn=7;function vo(){}vo.prototype={parse:function(r,e,t){var n=this.domBuilder;n.startDocument(),uf(e,e=Object.create(null)),af(r,e,t,n,this.errorHandler),n.endDocument()}};var di=/&#?\w+;?/g;function af(r,e,t,n,s){var i=tf(n.mimeType);r.indexOf(C.UNICODE_REPLACEMENT_CHARACTER)>=0&&s.warning("Unicode replacement character detected, source encoding issues?");function a($){if($>65535){$-=65536;var Ae=55296+($>>10),_n=56320+($&1023);return String.fromCharCode(Ae,_n)}else return String.fromCharCode($)}function o($){var Ae=$[$.length-1]===";"?$:$+";";if(!i&&Ae!==$)return s.error("EntityRef: expecting ;"),$;var _n=C.Reference.exec(Ae);if(!_n||_n[0].length!==Ae.length)return s.error("entity not matching Reference production: "+$),$;var bn=Ae.slice(1,-1);return Ur(t,bn)?t[bn]:bn.charAt(0)==="#"?a(parseInt(bn.substring(1).replace("x","0x"))):(s.error("entity not found:"+$),$)}function l($){if($>g){var Ae=r.substring(g,$).replace(di,o);f&&p(g),n.characters(Ae,0,$-g),g=$}}var u=0,c=0,d=/\r\n?|\n|$/g,f=n.locator;function p($,Ae){for(;$>=c&&(Ae=d.exec(r));)u=c,c=Ae.index+Ae[0].length,f.lineNumber++;f.columnNumber=$-u+1}for(var h=[{currentNSMap:e}],m=[],g=0;;){try{var b=r.indexOf("<",g);if(b<0){if(!i&&m.length>0)return s.fatalError("unclosed xml tag(s): "+m.join(", "));if(!r.substring(g).match(/^\s*$/)){var v=n.doc,w=v.createTextNode(r.substring(g));if(v.documentElement)return s.error("Extra content at the end of the document");v.appendChild(w),n.currentElement=w}return}if(b>g){var k=r.substring(g,b);!i&&m.length===0&&(k=k.replace(new RegExp(C.S_OPT.source,"g"),""),k&&s.error("Unexpected content outside root element: '"+k+"'")),l(b)}switch(r.charAt(b+1)){case"/":var O=r.indexOf(">",b+2),I=r.substring(b+2,O>0?O:void 0);if(!I)return s.fatalError("end tag name missing");var L=C.reg("^",C.QName_group,C.S_OPT,"$"),Z=O>0&&L.exec(I);if(!Z){var Y=O>0&&C.reg("^",C.QName_group).exec(I);if(i&&Y)s.warning('end tag name contains invalid trailing characters: "'+I+'"'),Z=Y;else if(Y&&new RegExp(L.source,L.flags+"m").test(I))s.error('end tag name is followed by a line break and trailing content: "'+I+'"'),Z=Y;else return s.fatalError('end tag name contains invalid characters: "'+I+'"')}if(!n.currentElement&&!n.doc.documentElement)return;var ne=m[m.length-1]||n.currentElement.tagName||n.doc.documentElement.tagName||"";if(ne!==Z[1]){var ze=Z[1].toLowerCase();if(!i||ne.toLowerCase()!==ze)return s.fatalError('Opening and ending tag mismatch: "'+ne+'" != "'+I+'"')}var Q=h.pop();m.pop();var fe=Q.localNSMap;if(n.endElement(Q.uri,Q.localName,ne),fe)for(var ke in fe)Ur(fe,ke)&&n.endPrefixMapping(ke);O++;break;case"?":f&&p(b),O=df(r,b,n,s);break;case"!":f&&p(b),O=ko(r,b,n,s,i);break;default:f&&p(b);var q=new Ao,J=h[h.length-1].currentNSMap,O=of(r,b,q,J,o,s,i),Gi=q.length;if(q.closed||(i&&Qt.isHTMLVoidElement(q.tagName)?q.closed=!0:m.push(q.tagName)),f&&Gi){for(var Xl=bo(f,{}),Ss=0;Ss<Gi;Ss++){var Wi=q[Ss];p(Wi.offset),Wi.locator=bo(f,{})}n.locator=Xl,wo(q,n,J)&&h.push(q),n.locator=f}else wo(q,n,J)&&h.push(q);i&&!q.closed?O=lf(r,O,q.tagName,o,n):O++}}catch($){if($ instanceof nf)throw $;if($ instanceof sf)return s.fatalError("Error constructing the DOM: "+$.name+": "+$.message,$);s.error("element parse error: "+$),O=-1}O>g?g=O:l(Math.max(b,g)+1)}}function bo(r,e){return e.lineNumber=r.lineNumber,e.columnNumber=r.columnNumber,e}function of(r,e,t,n,s,i,a){function o(p,h,m){if(Ur(t.attributeNames,p))return i.fatalError("Attribute "+p+" redefined");if(!a&&h.indexOf("<")>=0)return i.fatalError("Unescaped '<' not allowed in attributes values");t.addValue(p,h.replace(/[\t\n\r]/g," ").replace(di,s),m)}for(var l,u,c=++e,d=Yt;;){var f=r.charAt(c);if(d===Yt&&f==="<")throw new Error("unexpected < in tag name: "+r.slice(e,c));switch(f){case"=":if(d===dt)l=r.slice(e,c),d=Lr;else if(d===Zt)d=Lr;else throw new Error("attribute equal must after attrName");break;case"'":case'"':if(d===Lr||d===dt)if(d===dt&&(i.warning('attribute value must after "="'),l=r.slice(e,c)),e=c+1,c=r.indexOf(f,e),c>0)u=r.slice(e,c),o(l,u,e-1),d=Kt;else throw new Error("attribute value no end '"+f+"' match");else if(d==Jt)u=r.slice(e,c),o(l,u,e),i.warning('attribute "'+l+'" missed start quot('+f+")!!"),e=c+1,d=Kt;else throw new Error('attribute value must after "="');break;case"/":switch(d){case Yt:t.setTagName(r.slice(e,c));case Kt:case Fr:case zn:d=zn,t.closed=!0;case Jt:case dt:break;case Zt:t.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return i.error("unexpected end of input"),d==Yt&&t.setTagName(r.slice(e,c)),c;case">":switch(d){case Yt:t.setTagName(r.slice(e,c));case Kt:case Fr:case zn:break;case Jt:case dt:u=r.slice(e,c),u.slice(-1)==="/"&&(t.closed=!0,u=u.slice(0,-1));case Zt:d===Zt&&(u=l),d==Jt?(i.warning('attribute "'+u+'" missed quot(")!'),o(l,u,e)):(a||i.warning('attribute "'+u+'" missed value!! "'+u+'" instead!!'),o(u,u,e));break;case Lr:if(!a)return i.fatalError(`AttValue: ' or " expected`)}return c;case"\x80":f=" ";default:if(f<=" ")switch(d){case Yt:t.setTagName(r.slice(e,c)),d=Fr;break;case dt:l=r.slice(e,c),d=Zt;break;case Jt:var u=r.slice(e,c);i.warning('attribute "'+u+'" missed quot(")!!'),o(l,u,e);case Kt:d=Fr;break}else switch(d){case Zt:a||i.warning('attribute "'+l+'" missed value!! "'+l+'" instead2!!'),o(l,l,e),e=c,d=dt;break;case Kt:i.warning('attribute space is required"'+l+'"!!');case Fr:d=dt,e=c;break;case Lr:d=Jt,e=c;break;case zn:throw new Error("elements closed character '/' and '>' must be connected to")}}c++}}function wo(r,e,t){for(var n=r.tagName,s=null,d=r.length;d--;){var i=r[d],a=i.qName,o=i.value,f=a.indexOf(":");if(f>0)var l=i.prefix=a.slice(0,f),u=a.slice(f+1),c=l==="xmlns"&&u;else u=a,l=null,c=a==="xmlns"&&"";i.localName=u,c!==!1&&(s==null&&(s=Object.create(null),t=Object.create(t)),t[c]=s[c]=o,i.uri=_o.XMLNS,e.startPrefixMapping(c,o))}for(var d=r.length;d--;)i=r[d],i.prefix&&(i.prefix==="xml"&&(i.uri=_o.XML),i.prefix!=="xmlns"&&(i.uri=t[i.prefix]));var f=n.indexOf(":");f>0?(l=r.prefix=n.slice(0,f),u=r.localName=n.slice(f+1)):(l=null,u=r.localName=n);var p=r.uri=t[l||""];if(e.startElement(p,u,n,r),r.closed){if(e.endElement(p,u,n),s)for(l in s)Ur(s,l)&&e.endPrefixMapping(l)}else return r.currentNSMap=t,r.localNSMap=s,!0}function lf(r,e,t,n,s){var i=ef(t);if(i||rf(t)){var a=new RegExp("</"+t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")+">","ig");a.lastIndex=e;var o=a.exec(r),l=o?o.index:-1;if(l<0)return e+1;var u=r.substring(e+1,l);return i&&(u=u.replace(di,n)),s.characters(u,0,u.length),l}return e+1}function uf(r,e){for(var t in r)Ur(r,t)&&(e[t]=r[t])}function Eo(r,e){var t=e;function n(c){return c=c||0,r.charAt(t+c)}function s(c){c=c||1,t+=c}function i(){for(var c=0;t<r.length;){var d=n();if(d!==" "&&d!==`
11
+ `&&d!==" "&&d!=="\r")return c;c++,s()}return-1}function a(){return r.substring(t)}function o(c){return r.substring(t,t+c.length)===c}function l(c){return r.substring(t,t+c.length).toUpperCase()===c.toUpperCase()}function u(c){var d=C.reg("^",c),f=d.exec(a());return f?(s(f[0].length),f[0]):null}return{char:n,getIndex:function(){return t},getMatch:u,getSource:function(){return r},skip:s,skipBlanks:i,substringFromIndex:a,substringStartsWith:o,substringStartsWithCaseInsensitive:l}}function cf(r,e){function t(o,l){var u=C.PI.exec(o.substringFromIndex());return u?u[1].toLowerCase()==="xml"?l.fatalError("xml declaration is only allowed at the start of the document, but found at position "+o.getIndex()):(o.skip(u[0].length),u[0]):l.fatalError("processing instruction is not well-formed at position "+o.getIndex())}var n=r.getSource();if(r.char()==="["){r.skip(1);for(var s=r.getIndex();r.getIndex()<n.length;){if(r.skipBlanks(),r.char()==="]"){var i=n.substring(s,r.getIndex());return r.skip(1),i}var a=null;if(r.char()==="<"&&r.char(1)==="!")switch(r.char(2)){case"E":r.char(3)==="L"?a=r.getMatch(C.elementdecl):r.char(3)==="N"&&(a=r.getMatch(C.EntityDecl));break;case"A":a=r.getMatch(C.AttlistDecl);break;case"N":a=r.getMatch(C.NotationDecl);break;case"-":a=r.getMatch(C.Comment);break}else if(r.char()==="<"&&r.char(1)==="?")a=t(r,e);else if(r.char()==="%")a=r.getMatch(C.PEReference);else return e.fatalError("Error detected in Markup declaration");if(!a)return e.fatalError("Error in internal subset at position "+r.getIndex())}return e.fatalError("doctype internal subset is not well-formed, missing ]")}}function ko(r,e,t,n,s){var i=Eo(r,e);switch(s?i.char(2).toUpperCase():i.char(2)){case"-":var a=i.getMatch(C.Comment);return a?(t.comment(a,C.COMMENT_START.length,a.length-C.COMMENT_START.length-C.COMMENT_END.length),i.getIndex()):n.fatalError("comment is not well-formed at position "+i.getIndex());case"[":var o=i.getMatch(C.CDSect);return o?!s&&!t.currentElement?n.fatalError("CDATA outside of element"):(t.startCDATA(),t.characters(o,C.CDATA_START.length,o.length-C.CDATA_START.length-C.CDATA_END.length),t.endCDATA(),i.getIndex()):n.fatalError("Invalid CDATA starting at position "+e);case"D":{if(t.doc&&t.doc.documentElement)return n.fatalError("Doctype not allowed inside or after documentElement at position "+i.getIndex());if(s?!i.substringStartsWithCaseInsensitive(C.DOCTYPE_DECL_START):!i.substringStartsWith(C.DOCTYPE_DECL_START))return n.fatalError("Expected "+C.DOCTYPE_DECL_START+" at position "+i.getIndex());if(i.skip(C.DOCTYPE_DECL_START.length),i.skipBlanks()<1)return n.fatalError("Expected whitespace after "+C.DOCTYPE_DECL_START+" at position "+i.getIndex());var l={name:void 0,publicId:void 0,systemId:void 0,internalSubset:void 0};if(l.name=i.getMatch(C.Name),!l.name)return n.fatalError("doctype name missing or contains unexpected characters at position "+i.getIndex());if(s&&l.name.toLowerCase()!=="html"&&n.warning("Unexpected DOCTYPE in HTML document at position "+i.getIndex()),i.skipBlanks(),i.substringStartsWith(C.PUBLIC)||i.substringStartsWith(C.SYSTEM)){var u=C.ExternalID_match.exec(i.substringFromIndex());if(!u)return n.fatalError("doctype external id is not well-formed at position "+i.getIndex());u.groups.SystemLiteralOnly!==void 0?l.systemId=u.groups.SystemLiteralOnly:(l.systemId=u.groups.SystemLiteral,l.publicId=u.groups.PubidLiteral),i.skip(u[0].length)}else if(s&&i.substringStartsWithCaseInsensitive(C.SYSTEM)){if(i.skip(C.SYSTEM.length),i.skipBlanks()<1)return n.fatalError("Expected whitespace after "+C.SYSTEM+" at position "+i.getIndex());if(l.systemId=i.getMatch(C.ABOUT_LEGACY_COMPAT_SystemLiteral),!l.systemId)return n.fatalError("Expected "+C.ABOUT_LEGACY_COMPAT+" in single or double quotes after "+C.SYSTEM+" at position "+i.getIndex())}return s&&l.systemId&&!C.ABOUT_LEGACY_COMPAT_SystemLiteral.test(l.systemId)&&n.warning("Unexpected doctype.systemId in HTML document at position "+i.getIndex()),s||(i.skipBlanks(),l.internalSubset=cf(i,n)),i.skipBlanks(),i.char()!==">"?n.fatalError("doctype not terminated with > at position "+i.getIndex()):(i.skip(1),t.startDTD(l.name,l.publicId,l.systemId,l.internalSubset),t.endDTD(),i.getIndex())}default:return n.fatalError('Not well-formed XML starting with "<!" at position '+e)}}function df(r,e,t,n){var s=r.substring(e).match(C.PI);if(!s)return n.fatalError("Invalid processing instruction starting at position "+e);if(s[1].toLowerCase()==="xml"){if(e>0)return n.fatalError("processing instruction at position "+e+" is an xml declaration which is only at the start of the document");if(!C.XMLDecl.test(r.substring(e)))return n.fatalError("xml declaration is not well-formed")}return t.processingInstruction(s[1],s[2]),e+s[0].length}function Ao(){this.attributeNames=Object.create(null)}Ao.prototype={setTagName:function(r){if(!C.QName_exact.test(r))throw new Error("invalid tagName:"+r);this.tagName=r},addValue:function(r,e,t){if(!C.QName_exact.test(r))throw new Error("invalid attribute:"+r);this.attributeNames[r]=this.length,this[this.length++]={qName:r,value:e,offset:t}},length:0,getLocalName:function(r){return this[r].localName},getLocator:function(r){return this[r].locator},getQName:function(r){return this[r].qName},getURI:function(r){return this[r].uri},getValue:function(r){return this[r].value}};Gn.XMLReader=vo;Gn.parseUtils=Eo;Gn.parseDoctypeCommentOrCData=ko});var Bo=et(tr=>{"use strict";var kt=vt(),ff=ci(),pf=xr(),Do=go(),hf=To(),mf=ff.DOMImplementation,gf=kt.hasDefaultHTMLNamespace,_f=kt.isHTMLMimeType,bf=kt.isValidMimeType,No=kt.MIME_TYPE,fi=kt.NAMESPACE,xo=pf.ParseError,wf=hf.XMLReader;function Co(r){return r.replace(/\r[\n\u0085]/g,`
12
12
  `).replace(/[\r\u0085\u2028\u2029]/g,`
13
- `)}function Do(r){if(r=r||{},r.locator===void 0&&(r.locator=!0),this.assign=r.assign||kt.assign,this.domHandler=r.domHandler||Wn,this.onError=r.onError||r.errorHandler,r.errorHandler&&typeof r.errorHandler!="function")throw new TypeError("errorHandler object is no longer supported, switch to onError!");r.errorHandler&&r.errorHandler("warning","The `errorHandler` option has been deprecated, use `onError` instead!",this),this.normalizeLineEndings=r.normalizeLineEndings||Ao,this.locator=!!r.locator,this.xmlns=this.assign(Object.create(null),r.xmlns)}Do.prototype.parseFromString=function(r,e){if(!cf(e))throw new TypeError('DOMParser.parseFromString: the provided mimeType "'+e+'" is not valid.');var t=this.assign(Object.create(null),this.xmlns),n=yo.XML_ENTITIES,s=t[""]||null;lf(e)?(n=yo.HTML_ENTITIES,s=oi.HTML):e===ko.XML_SVG_IMAGE&&(s=oi.SVG),t[""]=s,t.xml=t.xml||oi.XML;var i=new this.domHandler({mimeType:e,defaultNamespace:s,onError:this.onError}),a=this.locator?{}:void 0;this.locator&&i.setDocumentLocator(a);var o=new df;o.errorHandler=i,o.domBuilder=i;var u=!kt.isHTMLMimeType(e);return u&&typeof r!="string"&&o.errorHandler.fatalError("source is not a string"),o.parse(this.normalizeLineEndings(String(r)),t,n),i.doc.documentElement||o.errorHandler.fatalError("missing root element"),i.doc};function Wn(r){var e=r||{};this.mimeType=e.mimeType||ko.XML_APPLICATION,this.defaultNamespace=e.defaultNamespace||null,this.cdata=!1,this.currentElement=void 0,this.doc=void 0,this.locator=void 0,this.onError=e.onError}function er(r,e){e.lineNumber=r.lineNumber,e.columnNumber=r.columnNumber}Wn.prototype={startDocument:function(){var r=new of;this.doc=uf(this.mimeType)?r.createHTMLDocument(!1):r.createDocument(this.defaultNamespace,"")},startElement:function(r,e,t,n){var s=this.doc,i=s.createElementNS(r,t||e),a=n.length;Gn(this,i),this.currentElement=i,this.locator&&er(this.locator,i);for(var o=0;o<a;o++){var r=n.getURI(o),u=n.getValue(o),t=n.getQName(o),l=s.createAttributeNS(r,t);this.locator&&er(n.getLocator(o),l),l.value=l.nodeValue=u,i.setAttributeNode(l)}},endElement:function(r,e,t){this.currentElement=this.currentElement.parentNode},startPrefixMapping:function(r,e){},endPrefixMapping:function(r){},processingInstruction:function(r,e){var t=this.doc.createProcessingInstruction(r,e);this.locator&&er(this.locator,t),Gn(this,t)},ignorableWhitespace:function(r,e,t){},characters:function(r,e,t){if(r=Eo.apply(this,arguments),r){if(this.cdata)var n=this.doc.createCDATASection(r);else var n=this.doc.createTextNode(r);this.currentElement?this.currentElement.appendChild(n):/^\s*$/.test(r)&&this.doc.appendChild(n),this.locator&&er(this.locator,n)}},skippedEntity:function(r){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(r){r&&(r.lineNumber=0),this.locator=r},comment:function(r,e,t){r=Eo.apply(this,arguments);var n=this.doc.createComment(r);this.locator&&er(this.locator,n),Gn(this,n)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(r,e,t,n){var s=this.doc.implementation;if(s&&s.createDocumentType){var i=s.createDocumentType(r,e,t,n);this.locator&&er(this.locator,i),Gn(this,i),this.doc.doctype=i}},reportError:function(r,e){if(typeof this.onError=="function")try{this.onError(r,e,this)}catch(t){throw new vo("Reporting "+r+' "'+e+'" caused '+t,this.locator)}else console.error("[xmldom "+r+"] "+e,ff(this.locator))},warning:function(r){this.reportError("warning",r)},error:function(r){this.reportError("error",r)},fatalError:function(r,e){throw this.reportError("fatalError",r),new vo(r,this.locator,e)}};function ff(r){if(r)return`
14
- @#[line:`+r.lineNumber+",col:"+r.columnNumber+"]"}function Eo(r,e,t){return typeof r=="string"?r.substr(e,t):r.length>=e+t||e?new java.lang.String(r,e,t)+"":r}"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(r){Wn.prototype[r]=function(){return null}});function Gn(r,e){r.currentElement?r.currentElement.appendChild(e):r.doc.appendChild(e)}function pf(r){if(r==="error")throw"onErrorStopParsing"}function hf(){throw"onWarningStopParsing"}tr.__DOMHandler=Wn;tr.DOMParser=Do;tr.normalizeLineEndings=Ao;tr.onErrorStopParsing=pf;tr.onWarningStopParsing=hf});var li=et(M=>{"use strict";var rr=vt();M.assign=rr.assign;M.hasDefaultHTMLNamespace=rr.hasDefaultHTMLNamespace;M.isHTMLMimeType=rr.isHTMLMimeType;M.isValidMimeType=rr.isValidMimeType;M.MIME_TYPE=rr.MIME_TYPE;M.NAMESPACE=rr.NAMESPACE;var Xn=Tr();M.DOMException=Xn.DOMException;M.DOMExceptionName=Xn.DOMExceptionName;M.ExceptionCode=Xn.ExceptionCode;M.ParseError=Xn.ParseError;var te=ii();M.Attr=te.Attr;M.CDATASection=te.CDATASection;M.CharacterData=te.CharacterData;M.Comment=te.Comment;M.Document=te.Document;M.DocumentFragment=te.DocumentFragment;M.DocumentType=te.DocumentType;M.DOMImplementation=te.DOMImplementation;M.Element=te.Element;M.Entity=te.Entity;M.EntityReference=te.EntityReference;M.LiveNodeList=te.LiveNodeList;M.NamedNodeMap=te.NamedNodeMap;M.Node=te.Node;M.NodeList=te.NodeList;M.Notation=te.Notation;M.ProcessingInstruction=te.ProcessingInstruction;M.Text=te.Text;M.XMLSerializer=te.XMLSerializer;var Yn=To();M.DOMParser=Yn.DOMParser;M.normalizeLineEndings=Yn.normalizeLineEndings;M.onErrorStopParsing=Yn.onErrorStopParsing;M.onWarningStopParsing=Yn.onWarningStopParsing});var Me=class{constructor(e,{fetcher:t=globalThis.fetch?.bind(globalThis),closeUrl:n="/gramlot/close",navigator:s=globalThis.navigator}={}){this.rpcUrl=e,this.fetcher=t,this.closeUrl=n,this.navigator=s}async call(e,t){let n=await this.fetcher(this.rpcUrl,{method:"POST",credentials:"same-origin",signal:t,headers:{"Content-Type":"application/json"},body:e});if(n.status!==200)throw new Error(`rpc failed: HTTP ${n.status}`);return n.text()}close(e,{beacon:t=!1}={}){let n=JSON.stringify({pageId:e});if(t)try{this.navigator.sendBeacon(this.closeUrl,new Blob([n],{type:"application/json"}))}catch{}else try{Promise.resolve(this.fetcher(this.closeUrl,{method:"POST",credentials:"same-origin",keepalive:!0,headers:{"Content-Type":"application/json"},body:n})).catch(()=>{})}catch{}}};var $t=9e15,st=1e9,Ds="0123456789abcdef",yn="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",vn="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",Ts={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-$t,maxE:$t,crypto:!1},Gi,Ge,S=!0,kn="[DecimalError] ",nt=kn+"Invalid argument: ",Wi=kn+"Precision limit exceeded",Xi=kn+"crypto unavailable",Yi="[object Decimal]",ue=Math.floor,Q=Math.pow,Xl=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,Yl=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,Zl=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,Zi=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Ne=1e7,A=7,Jl=9007199254740991,Kl=yn.length-1,xs=vn.length-1,_={toStringTag:Yi};_.absoluteValue=_.abs=function(){var r=new this.constructor(this);return r.s<0&&(r.s=1),E(r)};_.ceil=function(){return E(new this.constructor(this),this.e+1,2)};_.clampedTo=_.clamp=function(r,e){var t,n=this,s=n.constructor;if(r=new s(r),e=new s(e),!r.s||!e.s)return new s(NaN);if(r.gt(e))throw Error(nt+e);return t=n.cmp(r),t<0?r:n.cmp(e)>0?e:new s(n)};_.comparedTo=_.cmp=function(r){var e,t,n,s,i=this,a=i.d,o=(r=new i.constructor(r)).d,u=i.s,l=r.s;if(!a||!o)return!u||!l?NaN:u!==l?u:a===o?0:!a^u<0?1:-1;if(!a[0]||!o[0])return a[0]?u:o[0]?-l:0;if(u!==l)return u;if(i.e!==r.e)return i.e>r.e^u<0?1:-1;for(n=a.length,s=o.length,e=0,t=n<s?n:s;e<t;++e)if(a[e]!==o[e])return a[e]>o[e]^u<0?1:-1;return n===s?0:n>s^u<0?1:-1};_.cosine=_.cos=function(){var r,e,t=this,n=t.constructor;return t.d?t.d[0]?(r=n.precision,e=n.rounding,n.precision=r+Math.max(t.e,t.sd())+A,n.rounding=1,t=Ql(n,ta(n,t)),n.precision=r,n.rounding=e,E(Ge==2||Ge==3?t.neg():t,r,e,!0)):new n(1):new n(NaN)};_.cubeRoot=_.cbrt=function(){var r,e,t,n,s,i,a,o,u,l,c=this,d=c.constructor;if(!c.isFinite()||c.isZero())return new d(c);for(S=!1,i=c.s*Q(c.s*c,1/3),!i||Math.abs(i)==1/0?(t=ie(c.d),r=c.e,(i=(r-t.length+1)%3)&&(t+=i==1||i==-2?"0":"00"),i=Q(t,1/3),r=ue((r+1)/3)-(r%3==(r<0?-1:2)),i==1/0?t="5e"+r:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+r),n=new d(t),n.s=c.s):n=new d(i.toString()),a=(r=d.precision)+3;;)if(o=n,u=o.times(o).times(o),l=u.plus(c),n=j(l.plus(c).times(o),l.plus(u),a+2,1),ie(o.d).slice(0,a)===(t=ie(n.d)).slice(0,a))if(t=t.slice(a-3,a+1),t=="9999"||!s&&t=="4999"){if(!s&&(E(o,r+1,0),o.times(o).times(o).eq(c))){n=o;break}a+=4,s=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(E(n,r+1,1),e=!n.times(n).times(n).eq(c));break}return S=!0,E(n,r,d.rounding,e)};_.decimalPlaces=_.dp=function(){var r,e=this.d,t=NaN;if(e){if(r=e.length-1,t=(r-ue(this.e/A))*A,r=e[r],r)for(;r%10==0;r/=10)t--;t<0&&(t=0)}return t};_.dividedBy=_.div=function(r){return j(this,new this.constructor(r))};_.dividedToIntegerBy=_.divToInt=function(r){var e=this,t=e.constructor;return E(j(e,new t(r),0,1,1),t.precision,t.rounding)};_.equals=_.eq=function(r){return this.cmp(r)===0};_.floor=function(){return E(new this.constructor(this),this.e+1,3)};_.greaterThan=_.gt=function(r){return this.cmp(r)>0};_.greaterThanOrEqualTo=_.gte=function(r){var e=this.cmp(r);return e==1||e===0};_.hyperbolicCosine=_.cosh=function(){var r,e,t,n,s,i=this,a=i.constructor,o=new a(1);if(!i.isFinite())return new a(i.s?1/0:NaN);if(i.isZero())return o;t=a.precision,n=a.rounding,a.precision=t+Math.max(i.e,i.sd())+4,a.rounding=1,s=i.d.length,s<32?(r=Math.ceil(s/3),e=(1/Dn(4,r)).toString()):(r=16,e="2.3283064365386962890625e-10"),i=Lt(a,1,i.times(e),new a(1),!0);for(var u,l=r,c=new a(8);l--;)u=i.times(i),i=o.minus(u.times(c.minus(u.times(c))));return E(i,a.precision=t,a.rounding=n,!0)};_.hyperbolicSine=_.sinh=function(){var r,e,t,n,s=this,i=s.constructor;if(!s.isFinite()||s.isZero())return new i(s);if(e=i.precision,t=i.rounding,i.precision=e+Math.max(s.e,s.sd())+4,i.rounding=1,n=s.d.length,n<3)s=Lt(i,2,s,s,!0);else{r=1.4*Math.sqrt(n),r=r>16?16:r|0,s=s.times(1/Dn(5,r)),s=Lt(i,2,s,s,!0);for(var a,o=new i(5),u=new i(16),l=new i(20);r--;)a=s.times(s),s=s.times(o.plus(a.times(u.times(a).plus(l))))}return i.precision=e,i.rounding=t,E(s,e,t,!0)};_.hyperbolicTangent=_.tanh=function(){var r,e,t=this,n=t.constructor;return t.isFinite()?t.isZero()?new n(t):(r=n.precision,e=n.rounding,n.precision=r+7,n.rounding=1,j(t.sinh(),t.cosh(),n.precision=r,n.rounding=e)):new n(t.s)};_.inverseCosine=_.acos=function(){var r=this,e=r.constructor,t=r.abs().cmp(1),n=e.precision,s=e.rounding;return t!==-1?t===0?r.isNeg()?$e(e,n,s):new e(0):new e(NaN):r.isZero()?$e(e,n+4,s).times(.5):(e.precision=n+6,e.rounding=1,r=new e(1).minus(r).div(r.plus(1)).sqrt().atan(),e.precision=n,e.rounding=s,r.times(2))};_.inverseHyperbolicCosine=_.acosh=function(){var r,e,t=this,n=t.constructor;return t.lte(1)?new n(t.eq(1)?0:NaN):t.isFinite()?(r=n.precision,e=n.rounding,n.precision=r+Math.max(Math.abs(t.e),t.sd())+4,n.rounding=1,S=!1,t=t.times(t).minus(1).sqrt().plus(t),S=!0,n.precision=r,n.rounding=e,t.ln()):new n(t)};_.inverseHyperbolicSine=_.asinh=function(){var r,e,t=this,n=t.constructor;return!t.isFinite()||t.isZero()?new n(t):(r=n.precision,e=n.rounding,n.precision=r+2*Math.max(Math.abs(t.e),t.sd())+6,n.rounding=1,S=!1,t=t.times(t).plus(1).sqrt().plus(t),S=!0,n.precision=r,n.rounding=e,t.ln())};_.inverseHyperbolicTangent=_.atanh=function(){var r,e,t,n,s=this,i=s.constructor;return s.isFinite()?s.e>=0?new i(s.abs().eq(1)?s.s/0:s.isZero()?s:NaN):(r=i.precision,e=i.rounding,n=s.sd(),Math.max(n,r)<2*-s.e-1?E(new i(s),r,e,!0):(i.precision=t=n-s.e,s=j(s.plus(1),new i(1).minus(s),t+r,1),i.precision=r+4,i.rounding=1,s=s.ln(),i.precision=r,i.rounding=e,s.times(.5))):new i(NaN)};_.inverseSine=_.asin=function(){var r,e,t,n,s=this,i=s.constructor;return s.isZero()?new i(s):(e=s.abs().cmp(1),t=i.precision,n=i.rounding,e!==-1?e===0?(r=$e(i,t+4,n).times(.5),r.s=s.s,r):new i(NaN):(i.precision=t+6,i.rounding=1,s=s.div(new i(1).minus(s.times(s)).sqrt().plus(1)).atan(),i.precision=t,i.rounding=n,s.times(2)))};_.inverseTangent=_.atan=function(){var r,e,t,n,s,i,a,o,u,l=this,c=l.constructor,d=c.precision,f=c.rounding;if(l.isFinite()){if(l.isZero())return new c(l);if(l.abs().eq(1)&&d+4<=xs)return a=$e(c,d+4,f).times(.25),a.s=l.s,a}else{if(!l.s)return new c(NaN);if(d+4<=xs)return a=$e(c,d+4,f).times(.5),a.s=l.s,a}for(c.precision=o=d+10,c.rounding=1,t=Math.min(28,o/A+2|0),r=t;r;--r)l=l.div(l.times(l).plus(1).sqrt().plus(1));for(S=!1,e=Math.ceil(o/A),n=1,u=l.times(l),a=new c(l),s=l;r!==-1;)if(s=s.times(u),i=a.minus(s.div(n+=2)),s=s.times(u),a=i.plus(s.div(n+=2)),a.d[e]!==void 0)for(r=e;a.d[r]===i.d[r]&&r--;);return t&&(a=a.times(2<<t-1)),S=!0,E(a,c.precision=d,c.rounding=f,!0)};_.isFinite=function(){return!!this.d};_.isInteger=_.isInt=function(){return!!this.d&&ue(this.e/A)>this.d.length-2};_.isNaN=function(){return!this.s};_.isNegative=_.isNeg=function(){return this.s<0};_.isPositive=_.isPos=function(){return this.s>0};_.isZero=function(){return!!this.d&&this.d[0]===0};_.lessThan=_.lt=function(r){return this.cmp(r)<0};_.lessThanOrEqualTo=_.lte=function(r){return this.cmp(r)<1};_.logarithm=_.log=function(r){var e,t,n,s,i,a,o,u,l=this,c=l.constructor,d=c.precision,f=c.rounding,p=5;if(r==null)r=new c(10),e=!0;else{if(r=new c(r),t=r.d,r.s<0||!t||!t[0]||r.eq(1))return new c(NaN);e=r.eq(10)}if(t=l.d,l.s<0||!t||!t[0]||l.eq(1))return new c(t&&!t[0]?-1/0:l.s!=1?NaN:t?0:1/0);if(e)if(t.length>1)i=!0;else{for(s=t[0];s%10===0;)s/=10;i=s!==1}if(S=!1,o=d+p,a=rt(l,o),n=e?En(c,o+10):rt(r,o),u=j(a,n,o,1),pr(u.d,s=d,f))do if(o+=10,a=rt(l,o),n=e?En(c,o+10):rt(r,o),u=j(a,n,o,1),!i){+ie(u.d).slice(s+1,s+15)+1==1e14&&(u=E(u,d+1,0));break}while(pr(u.d,s+=10,f));return S=!0,E(u,d,f)};_.minus=_.sub=function(r){var e,t,n,s,i,a,o,u,l,c,d,f,p=this,h=p.constructor;if(r=new h(r),!p.d||!r.d)return!p.s||!r.s?r=new h(NaN):p.d?r.s=-r.s:r=new h(r.d||p.s!==r.s?p:NaN),r;if(p.s!=r.s)return r.s=-r.s,p.plus(r);if(l=p.d,f=r.d,o=h.precision,u=h.rounding,!l[0]||!f[0]){if(f[0])r.s=-r.s;else if(l[0])r=new h(p);else return new h(u===3?-0:0);return S?E(r,o,u):r}if(t=ue(r.e/A),c=ue(p.e/A),l=l.slice(),i=c-t,i){for(d=i<0,d?(e=l,i=-i,a=f.length):(e=f,t=c,a=l.length),n=Math.max(Math.ceil(o/A),a)+2,i>n&&(i=n,e.length=1),e.reverse(),n=i;n--;)e.push(0);e.reverse()}else{for(n=l.length,a=f.length,d=n<a,d&&(a=n),n=0;n<a;n++)if(l[n]!=f[n]){d=l[n]<f[n];break}i=0}for(d&&(e=l,l=f,f=e,r.s=-r.s),a=l.length,n=f.length-a;n>0;--n)l[a++]=0;for(n=f.length;n>i;){if(l[--n]<f[n]){for(s=n;s&&l[--s]===0;)l[s]=Ne-1;--l[s],l[n]+=Ne}l[n]-=f[n]}for(;l[--a]===0;)l.pop();for(;l[0]===0;l.shift())--t;return l[0]?(r.d=l,r.e=An(l,t),S?E(r,o,u):r):new h(u===3?-0:0)};_.modulo=_.mod=function(r){var e,t=this,n=t.constructor;return r=new n(r),!t.d||!r.s||r.d&&!r.d[0]?new n(NaN):!r.d||t.d&&!t.d[0]?E(new n(t),n.precision,n.rounding):(S=!1,n.modulo==9?(e=j(t,r.abs(),0,3,1),e.s*=r.s):e=j(t,r,0,n.modulo,1),e=e.times(r),S=!0,t.minus(e))};_.naturalExponential=_.exp=function(){return Ss(this)};_.naturalLogarithm=_.ln=function(){return rt(this)};_.negated=_.neg=function(){var r=new this.constructor(this);return r.s=-r.s,E(r)};_.plus=_.add=function(r){var e,t,n,s,i,a,o,u,l,c,d=this,f=d.constructor;if(r=new f(r),!d.d||!r.d)return!d.s||!r.s?r=new f(NaN):d.d||(r=new f(r.d||d.s===r.s?d:NaN)),r;if(d.s!=r.s)return r.s=-r.s,d.minus(r);if(l=d.d,c=r.d,o=f.precision,u=f.rounding,!l[0]||!c[0])return c[0]||(r=new f(d)),S?E(r,o,u):r;if(i=ue(d.e/A),n=ue(r.e/A),l=l.slice(),s=i-n,s){for(s<0?(t=l,s=-s,a=c.length):(t=c,n=i,a=l.length),i=Math.ceil(o/A),a=i>a?i+1:a+1,s>a&&(s=a,t.length=1),t.reverse();s--;)t.push(0);t.reverse()}for(a=l.length,s=c.length,a-s<0&&(s=a,t=c,c=l,l=t),e=0;s;)e=(l[--s]=l[s]+c[s]+e)/Ne|0,l[s]%=Ne;for(e&&(l.unshift(e),++n),a=l.length;l[--a]==0;)l.pop();return r.d=l,r.e=An(l,n),S?E(r,o,u):r};_.precision=_.sd=function(r){var e,t=this;if(r!==void 0&&r!==!!r&&r!==1&&r!==0)throw Error(nt+r);return t.d?(e=Ji(t.d),r&&t.e+1>e&&(e=t.e+1)):e=NaN,e};_.round=function(){var r=this,e=r.constructor;return E(new e(r),r.e+1,e.rounding)};_.sine=_.sin=function(){var r,e,t=this,n=t.constructor;return t.isFinite()?t.isZero()?new n(t):(r=n.precision,e=n.rounding,n.precision=r+Math.max(t.e,t.sd())+A,n.rounding=1,t=tu(n,ta(n,t)),n.precision=r,n.rounding=e,E(Ge>2?t.neg():t,r,e,!0)):new n(NaN)};_.squareRoot=_.sqrt=function(){var r,e,t,n,s,i,a=this,o=a.d,u=a.e,l=a.s,c=a.constructor;if(l!==1||!o||!o[0])return new c(!l||l<0&&(!o||o[0])?NaN:o?a:1/0);for(S=!1,l=Math.sqrt(+a),l==0||l==1/0?(e=ie(o),(e.length+u)%2==0&&(e+="0"),l=Math.sqrt(e),u=ue((u+1)/2)-(u<0||u%2),l==1/0?e="5e"+u:(e=l.toExponential(),e=e.slice(0,e.indexOf("e")+1)+u),n=new c(e)):n=new c(l.toString()),t=(u=c.precision)+3;;)if(i=n,n=i.plus(j(a,i,t+2,1)).times(.5),ie(i.d).slice(0,t)===(e=ie(n.d)).slice(0,t))if(e=e.slice(t-3,t+1),e=="9999"||!s&&e=="4999"){if(!s&&(E(i,u+1,0),i.times(i).eq(a))){n=i;break}t+=4,s=1}else{(!+e||!+e.slice(1)&&e.charAt(0)=="5")&&(E(n,u+1,1),r=!n.times(n).eq(a));break}return S=!0,E(n,u,c.rounding,r)};_.tangent=_.tan=function(){var r,e,t=this,n=t.constructor;return t.isFinite()?t.isZero()?new n(t):(r=n.precision,e=n.rounding,n.precision=r+10,n.rounding=1,t=t.sin(),t.s=1,t=j(t,new n(1).minus(t.times(t)).sqrt(),r+10,0),n.precision=r,n.rounding=e,E(Ge==2||Ge==4?t.neg():t,r,e,!0)):new n(NaN)};_.times=_.mul=function(r){var e,t,n,s,i,a,o,u,l,c=this,d=c.constructor,f=c.d,p=(r=new d(r)).d;if(r.s*=c.s,!f||!f[0]||!p||!p[0])return new d(!r.s||f&&!f[0]&&!p||p&&!p[0]&&!f?NaN:!f||!p?r.s/0:r.s*0);for(t=ue(c.e/A)+ue(r.e/A),u=f.length,l=p.length,u<l&&(i=f,f=p,p=i,a=u,u=l,l=a),i=[],a=u+l,n=a;n--;)i.push(0);for(n=l;--n>=0;){for(e=0,s=u+n;s>n;)o=i[s]+p[n]*f[s-n-1]+e,i[s--]=o%Ne|0,e=o/Ne|0;i[s]=(i[s]+e)%Ne|0}for(;!i[--a];)i.pop();return e?++t:i.shift(),r.d=i,r.e=An(i,t),S?E(r,d.precision,d.rounding):r};_.toBinary=function(r,e){return Ns(this,2,r,e)};_.toDecimalPlaces=_.toDP=function(r,e){var t=this,n=t.constructor;return t=new n(t),r===void 0?t:(ge(r,0,st),e===void 0?e=n.rounding:ge(e,0,8),E(t,r+t.e+1,e))};_.toExponential=function(r,e){var t,n=this,s=n.constructor;return r===void 0?t=Le(n,!0):(ge(r,0,st),e===void 0?e=s.rounding:ge(e,0,8),n=E(new s(n),r+1,e),t=Le(n,!0,r+1)),n.isNeg()&&!n.isZero()?"-"+t:t};_.toFixed=function(r,e){var t,n,s=this,i=s.constructor;return r===void 0?t=Le(s):(ge(r,0,st),e===void 0?e=i.rounding:ge(e,0,8),n=E(new i(s),r+s.e+1,e),t=Le(n,!1,r+n.e+1)),s.isNeg()&&!s.isZero()?"-"+t:t};_.toFraction=function(r){var e,t,n,s,i,a,o,u,l,c,d,f,p=this,h=p.d,m=p.constructor;if(!h)return new m(p);if(l=t=new m(1),n=u=new m(0),e=new m(n),i=e.e=Ji(h)-p.e-1,a=i%A,e.d[0]=Q(10,a<0?A+a:a),r==null)r=i>0?e:l;else{if(o=new m(r),!o.isInt()||o.lt(l))throw Error(nt+o);r=o.gt(e)?i>0?e:l:o}for(S=!1,o=new m(ie(h)),c=m.precision,m.precision=i=h.length*A*2;d=j(o,e,0,1,1),s=t.plus(d.times(n)),s.cmp(r)!=1;)t=n,n=s,s=l,l=u.plus(d.times(s)),u=s,s=e,e=o.minus(d.times(s)),o=s;return s=j(r.minus(t),n,0,1,1),u=u.plus(s.times(l)),t=t.plus(s.times(n)),u.s=l.s=p.s,f=j(l,n,i,1).minus(p).abs().cmp(j(u,t,i,1).minus(p).abs())<1?[l,n]:[u,t],m.precision=c,S=!0,f};_.toHexadecimal=_.toHex=function(r,e){return Ns(this,16,r,e)};_.toNearest=function(r,e){var t=this,n=t.constructor;if(t=new n(t),r==null){if(!t.d)return t;r=new n(1),e=n.rounding}else{if(r=new n(r),e===void 0?e=n.rounding:ge(e,0,8),!t.d)return r.s?t:r;if(!r.d)return r.s&&(r.s=t.s),r}return r.d[0]?(S=!1,t=j(t,r,0,e,1).times(r),S=!0,E(t)):(r.s=t.s,t=r),t};_.toNumber=function(){return+this};_.toOctal=function(r,e){return Ns(this,8,r,e)};_.toPower=_.pow=function(r){var e,t,n,s,i,a,o=this,u=o.constructor,l=+(r=new u(r));if(!o.d||!r.d||!o.d[0]||!r.d[0])return new u(Q(+o,l));if(o=new u(o),o.eq(1))return o;if(n=u.precision,i=u.rounding,r.eq(1))return E(o,n,i);if(e=ue(r.e/A),e>=r.d.length-1&&(t=l<0?-l:l)<=Jl)return s=Ki(u,o,t,n),r.s<0?new u(1).div(s):E(s,n,i);if(a=o.s,a<0){if(e<r.d.length-1)return new u(NaN);if((r.d[e]&1)==0&&(a=1),o.e==0&&o.d[0]==1&&o.d.length==1)return o.s=a,o}return t=Q(+o,l),e=t==0||!isFinite(t)?ue(l*(Math.log("0."+ie(o.d))/Math.LN10+o.e+1)):new u(t+"").e,e>u.maxE+1||e<u.minE-1?new u(e>0?a/0:0):(S=!1,u.rounding=o.s=1,t=Math.min(12,(e+"").length),s=Ss(r.times(rt(o,n+t)),n),s.d&&(s=E(s,n+5,1),pr(s.d,n,i)&&(e=n+10,s=E(Ss(r.times(rt(o,e+t)),e),e+5,1),+ie(s.d).slice(n+1,n+15)+1==1e14&&(s=E(s,n+1,0)))),s.s=a,S=!0,u.rounding=i,E(s,n,i))};_.toPrecision=function(r,e){var t,n=this,s=n.constructor;return r===void 0?t=Le(n,n.e<=s.toExpNeg||n.e>=s.toExpPos):(ge(r,1,st),e===void 0?e=s.rounding:ge(e,0,8),n=E(new s(n),r,e),t=Le(n,r<=n.e||n.e<=s.toExpNeg,r)),n.isNeg()&&!n.isZero()?"-"+t:t};_.toSignificantDigits=_.toSD=function(r,e){var t=this,n=t.constructor;return r===void 0?(r=n.precision,e=n.rounding):(ge(r,1,st),e===void 0?e=n.rounding:ge(e,0,8)),E(new n(t),r,e)};_.toString=function(){var r=this,e=r.constructor,t=Le(r,r.e<=e.toExpNeg||r.e>=e.toExpPos);return r.isNeg()&&!r.isZero()?"-"+t:t};_.truncated=_.trunc=function(){return E(new this.constructor(this),this.e+1,1)};_.valueOf=_.toJSON=function(){var r=this,e=r.constructor,t=Le(r,r.e<=e.toExpNeg||r.e>=e.toExpPos);return r.isNeg()?"-"+t:t};function ie(r){var e,t,n,s=r.length-1,i="",a=r[0];if(s>0){for(i+=a,e=1;e<s;e++)n=r[e]+"",t=A-n.length,t&&(i+=tt(t)),i+=n;a=r[e],n=a+"",t=A-n.length,t&&(i+=tt(t))}else if(a===0)return"0";for(;a%10===0;)a/=10;return i+a}function ge(r,e,t){if(r!==~~r||r<e||r>t)throw Error(nt+r)}function pr(r,e,t,n){var s,i,a,o;for(i=r[0];i>=10;i/=10)--e;return--e<0?(e+=A,s=0):(s=Math.ceil((e+1)/A),e%=A),i=Q(10,A-e),o=r[s]%i|0,n==null?e<3?(e==0?o=o/100|0:e==1&&(o=o/10|0),a=t<4&&o==99999||t>3&&o==49999||o==5e4||o==0):a=(t<4&&o+1==i||t>3&&o+1==i/2)&&(r[s+1]/i/100|0)==Q(10,e-2)-1||(o==i/2||o==0)&&(r[s+1]/i/100|0)==0:e<4?(e==0?o=o/1e3|0:e==1?o=o/100|0:e==2&&(o=o/10|0),a=(n||t<4)&&o==9999||!n&&t>3&&o==4999):a=((n||t<4)&&o+1==i||!n&&t>3&&o+1==i/2)&&(r[s+1]/i/1e3|0)==Q(10,e-3)-1,a}function bn(r,e,t){for(var n,s=[0],i,a=0,o=r.length;a<o;){for(i=s.length;i--;)s[i]*=e;for(s[0]+=Ds.indexOf(r.charAt(a++)),n=0;n<s.length;n++)s[n]>t-1&&(s[n+1]===void 0&&(s[n+1]=0),s[n+1]+=s[n]/t|0,s[n]%=t)}return s.reverse()}function Ql(r,e){var t,n,s;if(e.isZero())return e;n=e.d.length,n<32?(t=Math.ceil(n/3),s=(1/Dn(4,t)).toString()):(t=16,s="2.3283064365386962890625e-10"),r.precision+=t,e=Lt(r,1,e.times(s),new r(1));for(var i=t;i--;){var a=e.times(e);e=a.times(a).minus(a).times(8).plus(1)}return r.precision-=t,e}var j=(function(){function r(n,s,i){var a,o=0,u=n.length;for(n=n.slice();u--;)a=n[u]*s+o,n[u]=a%i|0,o=a/i|0;return o&&n.unshift(o),n}function e(n,s,i,a){var o,u;if(i!=a)u=i>a?1:-1;else for(o=u=0;o<i;o++)if(n[o]!=s[o]){u=n[o]>s[o]?1:-1;break}return u}function t(n,s,i,a){for(var o=0;i--;)n[i]-=o,o=n[i]<s[i]?1:0,n[i]=o*a+n[i]-s[i];for(;!n[0]&&n.length>1;)n.shift()}return function(n,s,i,a,o,u){var l,c,d,f,p,h,m,g,b,v,w,k,I,L,Y,X,re,ze,K,fe,ke=n.constructor,q=n.s==s.s?1:-1,Z=n.d,O=s.d;if(!Z||!Z[0]||!O||!O[0])return new ke(!n.s||!s.s||(Z?O&&Z[0]==O[0]:!O)?NaN:Z&&Z[0]==0||!O?q*0:q/0);for(u?(p=1,c=n.e-s.e):(u=Ne,p=A,c=ue(n.e/p)-ue(s.e/p)),K=O.length,re=Z.length,b=new ke(q),v=b.d=[],d=0;O[d]==(Z[d]||0);d++);if(O[d]>(Z[d]||0)&&c--,i==null?(L=i=ke.precision,a=ke.rounding):o?L=i+(n.e-s.e)+1:L=i,L<0)v.push(1),h=!0;else{if(L=L/p+2|0,d=0,K==1){for(f=0,O=O[0],L++;(d<re||f)&&L--;d++)Y=f*u+(Z[d]||0),v[d]=Y/O|0,f=Y%O|0;h=f||d<re}else{for(f=u/(O[0]+1)|0,f>1&&(O=r(O,f,u),Z=r(Z,f,u),K=O.length,re=Z.length),X=K,w=Z.slice(0,K),k=w.length;k<K;)w[k++]=0;fe=O.slice(),fe.unshift(0),ze=O[0],O[1]>=u/2&&++ze;do f=0,l=e(O,w,K,k),l<0?(I=w[0],K!=k&&(I=I*u+(w[1]||0)),f=I/ze|0,f>1?(f>=u&&(f=u-1),m=r(O,f,u),g=m.length,k=w.length,l=e(m,w,g,k),l==1&&(f--,t(m,K<g?fe:O,g,u))):(f==0&&(l=f=1),m=O.slice()),g=m.length,g<k&&m.unshift(0),t(w,m,k,u),l==-1&&(k=w.length,l=e(O,w,K,k),l<1&&(f++,t(w,K<k?fe:O,k,u))),k=w.length):l===0&&(f++,w=[0]),v[d++]=f,l&&w[0]?w[k++]=Z[X]||0:(w=[Z[X]],k=1);while((X++<re||w[0]!==void 0)&&L--);h=w[0]!==void 0}v[0]||v.shift()}if(p==1)b.e=c,Gi=h;else{for(d=1,f=v[0];f>=10;f/=10)d++;b.e=d+c*p-1,E(b,o?i+b.e+1:i,a,h)}return b}})();function E(r,e,t,n){var s,i,a,o,u,l,c,d,f,p=r.constructor;e:if(e!=null){if(d=r.d,!d)return r;for(s=1,o=d[0];o>=10;o/=10)s++;if(i=e-s,i<0)i+=A,a=e,c=d[f=0],u=c/Q(10,s-a-1)%10|0;else if(f=Math.ceil((i+1)/A),o=d.length,f>=o)if(n){for(;o++<=f;)d.push(0);c=u=0,s=1,i%=A,a=i-A+1}else break e;else{for(c=o=d[f],s=1;o>=10;o/=10)s++;i%=A,a=i-A+s,u=a<0?0:c/Q(10,s-a-1)%10|0}if(n=n||e<0||d[f+1]!==void 0||(a<0?c:c%Q(10,s-a-1)),l=t<4?(u||n)&&(t==0||t==(r.s<0?3:2)):u>5||u==5&&(t==4||n||t==6&&(i>0?a>0?c/Q(10,s-a):0:d[f-1])%10&1||t==(r.s<0?8:7)),e<1||!d[0])return d.length=0,l?(e-=r.e+1,d[0]=Q(10,(A-e%A)%A),r.e=-e||0):d[0]=r.e=0,r;if(i==0?(d.length=f,o=1,f--):(d.length=f+1,o=Q(10,A-i),d[f]=a>0?(c/Q(10,s-a)%Q(10,a)|0)*o:0),l)for(;;)if(f==0){for(i=1,a=d[0];a>=10;a/=10)i++;for(a=d[0]+=o,o=1;a>=10;a/=10)o++;i!=o&&(r.e++,d[0]==Ne&&(d[0]=1));break}else{if(d[f]+=o,d[f]!=Ne)break;d[f--]=0,o=1}for(i=d.length;d[--i]===0;)d.pop()}return S&&(r.e>p.maxE?(r.d=null,r.e=NaN):r.e<p.minE&&(r.e=0,r.d=[0])),r}function Le(r,e,t){if(!r.isFinite())return ea(r);var n,s=r.e,i=ie(r.d),a=i.length;return e?(t&&(n=t-a)>0?i=i.charAt(0)+"."+i.slice(1)+tt(n):a>1&&(i=i.charAt(0)+"."+i.slice(1)),i=i+(r.e<0?"e":"e+")+r.e):s<0?(i="0."+tt(-s-1)+i,t&&(n=t-a)>0&&(i+=tt(n))):s>=a?(i+=tt(s+1-a),t&&(n=t-s-1)>0&&(i=i+"."+tt(n))):((n=s+1)<a&&(i=i.slice(0,n)+"."+i.slice(n)),t&&(n=t-a)>0&&(s+1===a&&(i+="."),i+=tt(n))),i}function An(r,e){var t=r[0];for(e*=A;t>=10;t/=10)e++;return e}function En(r,e,t){if(e>Kl)throw S=!0,t&&(r.precision=t),Error(Wi);return E(new r(yn),e,1,!0)}function $e(r,e,t){if(e>xs)throw Error(Wi);return E(new r(vn),e,t,!0)}function Ji(r){var e=r.length-1,t=e*A+1;if(e=r[e],e){for(;e%10==0;e/=10)t--;for(e=r[0];e>=10;e/=10)t++}return t}function tt(r){for(var e="";r--;)e+="0";return e}function Ki(r,e,t,n){var s,i=new r(1),a=Math.ceil(n/A+4);for(S=!1;;){if(t%2&&(i=i.times(e),Hi(i.d,a)&&(s=!0)),t=ue(t/2),t===0){t=i.d.length-1,s&&i.d[t]===0&&++i.d[t];break}e=e.times(e),Hi(e.d,a)}return S=!0,i}function Vi(r){return r.d[r.d.length-1]&1}function Qi(r,e,t){for(var n,s,i=new r(e[0]),a=0;++a<e.length;){if(s=new r(e[a]),!s.s){i=s;break}n=i.cmp(s),(n===t||n===0&&i.s===t)&&(i=s)}return i}function Ss(r,e){var t,n,s,i,a,o,u,l=0,c=0,d=0,f=r.constructor,p=f.rounding,h=f.precision;if(!r.d||!r.d[0]||r.e>17)return new f(r.d?r.d[0]?r.s<0?0:1/0:1:r.s?r.s<0?0:r:NaN);for(e==null?(S=!1,u=h):u=e,o=new f(.03125);r.e>-2;)r=r.times(o),d+=5;for(n=Math.log(Q(2,d))/Math.LN10*2+5|0,u+=n,t=i=a=new f(1),f.precision=u;;){if(i=E(i.times(r),u,1),t=t.times(++c),o=a.plus(j(i,t,u,1)),ie(o.d).slice(0,u)===ie(a.d).slice(0,u)){for(s=d;s--;)a=E(a.times(a),u,1);if(e==null)if(l<3&&pr(a.d,u-n,p,l))f.precision=u+=10,t=i=o=new f(1),c=0,l++;else return E(a,f.precision=h,p,S=!0);else return f.precision=h,a}a=o}}function rt(r,e){var t,n,s,i,a,o,u,l,c,d,f,p=1,h=10,m=r,g=m.d,b=m.constructor,v=b.rounding,w=b.precision;if(m.s<0||!g||!g[0]||!m.e&&g[0]==1&&g.length==1)return new b(g&&!g[0]?-1/0:m.s!=1?NaN:g?0:m);if(e==null?(S=!1,c=w):c=e,b.precision=c+=h,t=ie(g),n=t.charAt(0),Math.abs(i=m.e)<15e14){for(;n<7&&n!=1||n==1&&t.charAt(1)>3;)m=m.times(r),t=ie(m.d),n=t.charAt(0),p++;i=m.e,n>1?(m=new b("0."+t),i++):m=new b(n+"."+t.slice(1))}else return l=En(b,c+2,w).times(i+""),m=rt(new b(n+"."+t.slice(1)),c-h).plus(l),b.precision=w,e==null?E(m,w,v,S=!0):m;for(d=m,u=a=m=j(m.minus(1),m.plus(1),c,1),f=E(m.times(m),c,1),s=3;;){if(a=E(a.times(f),c,1),l=u.plus(j(a,new b(s),c,1)),ie(l.d).slice(0,c)===ie(u.d).slice(0,c))if(u=u.times(2),i!==0&&(u=u.plus(En(b,c+2,w).times(i+""))),u=j(u,new b(p),c,1),e==null)if(pr(u.d,c-h,v,o))b.precision=c+=h,l=a=m=j(d.minus(1),d.plus(1),c,1),f=E(m.times(m),c,1),s=o=1;else return E(u,b.precision=w,v,S=!0);else return b.precision=w,u;u=l,s+=2}}function ea(r){return String(r.s*r.s/0)}function wn(r,e){var t,n,s;for((t=e.indexOf("."))>-1&&(e=e.replace(".","")),(n=e.search(/e/i))>0?(t<0&&(t=n),t+=+e.slice(n+1),e=e.substring(0,n)):t<0&&(t=e.length),n=0;e.charCodeAt(n)===48;n++);for(s=e.length;e.charCodeAt(s-1)===48;--s);if(e=e.slice(n,s),e){if(s-=n,r.e=t=t-n-1,r.d=[],n=(t+1)%A,t<0&&(n+=A),n<s){for(n&&r.d.push(+e.slice(0,n)),s-=A;n<s;)r.d.push(+e.slice(n,n+=A));e=e.slice(n),n=A-e.length}else n-=s;for(;n--;)e+="0";r.d.push(+e),S&&(r.e>r.constructor.maxE?(r.d=null,r.e=NaN):r.e<r.constructor.minE&&(r.e=0,r.d=[0]))}else r.e=0,r.d=[0];return r}function eu(r,e){var t,n,s,i,a,o,u,l,c;if(e.indexOf("_")>-1){if(e=e.replace(/(\d)_(?=\d)/g,"$1"),Zi.test(e))return wn(r,e)}else if(e==="Infinity"||e==="NaN")return+e||(r.s=NaN),r.e=NaN,r.d=null,r;if(Yl.test(e))t=16,e=e.toLowerCase();else if(Xl.test(e))t=2;else if(Zl.test(e))t=8;else throw Error(nt+e);for(i=e.search(/p/i),i>0?(u=+e.slice(i+1),e=e.substring(2,i)):e=e.slice(2),i=e.indexOf("."),a=i>=0,n=r.constructor,a&&(e=e.replace(".",""),o=e.length,i=o-i,s=Ki(n,new n(t),i,i*2)),l=bn(e,t,Ne),c=l.length-1,i=c;l[i]===0;--i)l.pop();return i<0?new n(r.s*0):(r.e=An(l,c),r.d=l,S=!1,a&&(r=j(r,s,o*4)),u&&(r=r.times(Math.abs(u)<54?Q(2,u):hr.pow(2,u))),S=!0,r)}function tu(r,e){var t,n=e.d.length;if(n<3)return e.isZero()?e:Lt(r,2,e,e);t=1.4*Math.sqrt(n),t=t>16?16:t|0,e=e.times(1/Dn(5,t)),e=Lt(r,2,e,e);for(var s,i=new r(5),a=new r(16),o=new r(20);t--;)s=e.times(e),e=e.times(i.plus(s.times(a.times(s).minus(o))));return e}function Lt(r,e,t,n,s){var i,a,o,u,l=1,c=r.precision,d=Math.ceil(c/A);for(S=!1,u=t.times(t),o=new r(n);;){if(a=j(o.times(u),new r(e++*e++),c,1),o=s?n.plus(a):n.minus(a),n=j(a.times(u),new r(e++*e++),c,1),a=o.plus(n),a.d[d]!==void 0){for(i=d;a.d[i]===o.d[i]&&i--;);if(i==-1)break}i=o,o=n,n=a,a=i,l++}return S=!0,a.d.length=d+1,a}function Dn(r,e){for(var t=r;--e;)t*=r;return t}function ta(r,e){var t,n=e.s<0,s=$e(r,r.precision,1),i=s.times(.5);if(e=e.abs(),e.lte(i))return Ge=n?4:1,e;if(t=e.divToInt(s),t.isZero())Ge=n?3:2;else{if(e=e.minus(t.times(s)),e.lte(i))return Ge=Vi(t)?n?2:3:n?4:1,e;Ge=Vi(t)?n?1:4:n?3:2}return e.minus(s).abs()}function Ns(r,e,t,n){var s,i,a,o,u,l,c,d,f,p=r.constructor,h=t!==void 0;if(h?(ge(t,1,st),n===void 0?n=p.rounding:ge(n,0,8)):(t=p.precision,n=p.rounding),!r.isFinite())c=ea(r);else{for(c=Le(r),a=c.indexOf("."),h?(s=2,e==16?t=t*4-3:e==8&&(t=t*3-2)):s=e,a>=0&&(c=c.replace(".",""),f=new p(1),f.e=c.length-a,f.d=bn(Le(f),10,s),f.e=f.d.length),d=bn(c,10,s),i=u=d.length;d[--u]==0;)d.pop();if(!d[0])c=h?"0p+0":"0";else{if(a<0?i--:(r=new p(r),r.d=d,r.e=i,r=j(r,f,t,n,0,s),d=r.d,i=r.e,l=Gi),a=d[t],o=s/2,l=l||d[t+1]!==void 0,l=n<4?(a!==void 0||l)&&(n===0||n===(r.s<0?3:2)):a>o||a===o&&(n===4||l||n===6&&d[t-1]&1||n===(r.s<0?8:7)),d.length=t,l)for(;++d[--t]>s-1;)d[t]=0,t||(++i,d.unshift(1));for(u=d.length;!d[u-1];--u);for(a=0,c="";a<u;a++)c+=Ds.charAt(d[a]);if(h){if(u>1)if(e==16||e==8){for(a=e==16?4:3,--u;u%a;u++)c+="0";for(d=bn(c,s,e),u=d.length;!d[u-1];--u);for(a=1,c="1.";a<u;a++)c+=Ds.charAt(d[a])}else c=c.charAt(0)+"."+c.slice(1);c=c+(i<0?"p":"p+")+i}else if(i<0){for(;++i;)c="0"+c;c="0."+c}else if(++i>u)for(i-=u;i--;)c+="0";else i<u&&(c=c.slice(0,i)+"."+c.slice(i))}c=(e==16?"0x":e==2?"0b":e==8?"0o":"")+c}return r.s<0?"-"+c:c}function Hi(r,e){if(r.length>e)return r.length=e,!0}function ru(r){return new this(r).abs()}function nu(r){return new this(r).acos()}function su(r){return new this(r).acosh()}function iu(r,e){return new this(r).plus(e)}function au(r){return new this(r).asin()}function ou(r){return new this(r).asinh()}function lu(r){return new this(r).atan()}function uu(r){return new this(r).atanh()}function cu(r,e){r=new this(r),e=new this(e);var t,n=this.precision,s=this.rounding,i=n+4;return!r.s||!e.s?t=new this(NaN):!r.d&&!e.d?(t=$e(this,i,1).times(e.s>0?.25:.75),t.s=r.s):!e.d||r.isZero()?(t=e.s<0?$e(this,n,s):new this(0),t.s=r.s):!r.d||e.isZero()?(t=$e(this,i,1).times(.5),t.s=r.s):e.s<0?(this.precision=i,this.rounding=1,t=this.atan(j(r,e,i,1)),e=$e(this,i,1),this.precision=n,this.rounding=s,t=r.s<0?t.minus(e):t.plus(e)):t=this.atan(j(r,e,i,1)),t}function du(r){return new this(r).cbrt()}function fu(r){return E(r=new this(r),r.e+1,2)}function pu(r,e,t){return new this(r).clamp(e,t)}function hu(r){if(!r||typeof r!="object")throw Error(kn+"Object expected");var e,t,n,s=r.defaults===!0,i=["precision",1,st,"rounding",0,8,"toExpNeg",-$t,0,"toExpPos",0,$t,"maxE",0,$t,"minE",-$t,0,"modulo",0,9];for(e=0;e<i.length;e+=3)if(t=i[e],s&&(this[t]=Ts[t]),(n=r[t])!==void 0)if(ue(n)===n&&n>=i[e+1]&&n<=i[e+2])this[t]=n;else throw Error(nt+t+": "+n);if(t="crypto",s&&(this[t]=Ts[t]),(n=r[t])!==void 0)if(n===!0||n===!1||n===0||n===1)if(n)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[t]=!0;else throw Error(Xi);else this[t]=!1;else throw Error(nt+t+": "+n);return this}function mu(r){return new this(r).cos()}function gu(r){return new this(r).cosh()}function ra(r){var e,t,n;function s(i){var a,o,u,l=this;if(!(l instanceof s))return new s(i);if(l.constructor=s,zi(i)){l.s=i.s,S?!i.d||i.e>s.maxE?(l.e=NaN,l.d=null):i.e<s.minE?(l.e=0,l.d=[0]):(l.e=i.e,l.d=i.d.slice()):(l.e=i.e,l.d=i.d?i.d.slice():i.d);return}if(u=typeof i,u==="number"){if(i===0){l.s=1/i<0?-1:1,l.e=0,l.d=[0];return}if(i<0?(i=-i,l.s=-1):l.s=1,i===~~i&&i<1e7){for(a=0,o=i;o>=10;o/=10)a++;S?a>s.maxE?(l.e=NaN,l.d=null):a<s.minE?(l.e=0,l.d=[0]):(l.e=a,l.d=[i]):(l.e=a,l.d=[i]);return}if(i*0!==0){i||(l.s=NaN),l.e=NaN,l.d=null;return}return wn(l,i.toString())}if(u==="string")return(o=i.charCodeAt(0))===45?(i=i.slice(1),l.s=-1):(o===43&&(i=i.slice(1)),l.s=1),Zi.test(i)?wn(l,i):eu(l,i);if(u==="bigint")return i<0?(i=-i,l.s=-1):l.s=1,wn(l,i.toString());throw Error(nt+i)}if(s.prototype=_,s.ROUND_UP=0,s.ROUND_DOWN=1,s.ROUND_CEIL=2,s.ROUND_FLOOR=3,s.ROUND_HALF_UP=4,s.ROUND_HALF_DOWN=5,s.ROUND_HALF_EVEN=6,s.ROUND_HALF_CEIL=7,s.ROUND_HALF_FLOOR=8,s.EUCLID=9,s.config=s.set=hu,s.clone=ra,s.isDecimal=zi,s.abs=ru,s.acos=nu,s.acosh=su,s.add=iu,s.asin=au,s.asinh=ou,s.atan=lu,s.atanh=uu,s.atan2=cu,s.cbrt=du,s.ceil=fu,s.clamp=pu,s.cos=mu,s.cosh=gu,s.div=_u,s.exp=bu,s.floor=wu,s.hypot=yu,s.ln=vu,s.log=Eu,s.log10=Au,s.log2=ku,s.max=Du,s.min=Tu,s.mod=xu,s.mul=Su,s.pow=Nu,s.random=Cu,s.round=Ou,s.sign=Bu,s.sin=Iu,s.sinh=Ru,s.sqrt=Mu,s.sub=$u,s.sum=Lu,s.tan=Fu,s.tanh=Uu,s.trunc=Pu,r===void 0&&(r={}),r&&r.defaults!==!0)for(n=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],e=0;e<n.length;)r.hasOwnProperty(t=n[e++])||(r[t]=this[t]);return s.config(r),s}function _u(r,e){return new this(r).div(e)}function bu(r){return new this(r).exp()}function wu(r){return E(r=new this(r),r.e+1,3)}function yu(){var r,e,t=new this(0);for(S=!1,r=0;r<arguments.length;)if(e=new this(arguments[r++]),e.d)t.d&&(t=t.plus(e.times(e)));else{if(e.s)return S=!0,new this(1/0);t=e}return S=!0,t.sqrt()}function zi(r){return r instanceof hr||r&&r.toStringTag===Yi||!1}function vu(r){return new this(r).ln()}function Eu(r,e){return new this(r).log(e)}function ku(r){return new this(r).log(2)}function Au(r){return new this(r).log(10)}function Du(){return Qi(this,arguments,-1)}function Tu(){return Qi(this,arguments,1)}function xu(r,e){return new this(r).mod(e)}function Su(r,e){return new this(r).mul(e)}function Nu(r,e){return new this(r).pow(e)}function Cu(r){var e,t,n,s,i=0,a=new this(1),o=[];if(r===void 0?r=this.precision:ge(r,1,st),n=Math.ceil(r/A),this.crypto)if(crypto.getRandomValues)for(e=crypto.getRandomValues(new Uint32Array(n));i<n;)s=e[i],s>=429e7?e[i]=crypto.getRandomValues(new Uint32Array(1))[0]:o[i++]=s%1e7;else if(crypto.randomBytes){for(e=crypto.randomBytes(n*=4);i<n;)s=e[i]+(e[i+1]<<8)+(e[i+2]<<16)+((e[i+3]&127)<<24),s>=214e7?crypto.randomBytes(4).copy(e,i):(o.push(s%1e7),i+=4);i=n/4}else throw Error(Xi);else for(;i<n;)o[i++]=Math.random()*1e7|0;for(n=o[--i],r%=A,n&&r&&(s=Q(10,A-r),o[i]=(n/s|0)*s);o[i]===0;i--)o.pop();if(i<0)t=0,o=[0];else{for(t=-1;o[0]===0;t-=A)o.shift();for(n=1,s=o[0];s>=10;s/=10)n++;n<A&&(t-=A-n)}return a.e=t,a.d=o,a}function Ou(r){return E(r=new this(r),r.e+1,this.rounding)}function Bu(r){return r=new this(r),r.d?r.d[0]?r.s:0*r.s:r.s||NaN}function Iu(r){return new this(r).sin()}function Ru(r){return new this(r).sinh()}function Mu(r){return new this(r).sqrt()}function $u(r,e){return new this(r).sub(e)}function Lu(){var r=0,e=arguments,t=new this(e[r]);for(S=!1;t.s&&++r<e.length;)t=t.plus(e[r]);return S=!0,E(t,this.precision,this.rounding)}function Fu(r){return new this(r).tan()}function Uu(r){return new this(r).tanh()}function Pu(r){return E(r=new this(r),r.e+1,1)}_[Symbol.for("nodejs.util.inspect.custom")]=_.toString;_[Symbol.toStringTag]="Decimal";var hr=_.constructor=ra(Ts);yn=new hr(yn);vn=new hr(vn);var na=hr;var qu=20,ju=1,gt=1e6,sa=1e6,Vu=-7,Hu=21,zu=!1,mr="[big.js] ",_t=mr+"Invalid ",Tn=_t+"decimal places",Gu=_t+"rounding mode",ia=mr+"Division by zero",F={},Fe=void 0,Wu=/^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i;function aa(){function r(e){var t=this;if(!(t instanceof r))return e===Fe?aa():new r(e);if(e instanceof r)t.s=e.s,t.e=e.e,t.c=e.c.slice();else{if(typeof e!="string"){if(r.strict===!0&&typeof e!="bigint")throw TypeError(_t+"value");e=e===0&&1/e<0?"-0":String(e)}Xu(t,e)}t.constructor=r}return r.prototype=F,r.DP=qu,r.RM=ju,r.NE=Vu,r.PE=Hu,r.strict=zu,r.roundDown=0,r.roundHalfUp=1,r.roundHalfEven=2,r.roundUp=3,r}function Xu(r,e){var t,n,s;if(!Wu.test(e))throw Error(_t+"number");for(r.s=e.charAt(0)=="-"?(e=e.slice(1),-1):1,(t=e.indexOf("."))>-1&&(e=e.replace(".","")),(n=e.search(/e/i))>0?(t<0&&(t=n),t+=+e.slice(n+1),e=e.substring(0,n)):t<0&&(t=e.length),s=e.length,n=0;n<s&&e.charAt(n)=="0";)++n;if(n==s)r.c=[r.e=0];else{for(;s>0&&e.charAt(--s)=="0";);for(r.e=t-n-1,r.c=[],t=0;n<=s;)r.c[t++]=+e.charAt(n++)}return r}function bt(r,e,t,n){var s=r.c;if(t===Fe&&(t=r.constructor.RM),t!==0&&t!==1&&t!==2&&t!==3)throw Error(Gu);if(e<1)n=t===3&&(n||!!s[0])||e===0&&(t===1&&s[0]>=5||t===2&&(s[0]>5||s[0]===5&&(n||s[1]!==Fe))),s.length=1,n?(r.e=r.e-e+1,s[0]=1):s[0]=r.e=0;else if(e<s.length){if(n=t===1&&s[e]>=5||t===2&&(s[e]>5||s[e]===5&&(n||s[e+1]!==Fe||s[e-1]&1))||t===3&&(n||!!s[0]),s.length=e,n){for(;++s[--e]>9;)if(s[e]=0,e===0){++r.e,s.unshift(1);break}}for(e=s.length;!s[--e];)s.pop()}return r}function wt(r,e,t){var n=r.e,s=r.c.join(""),i=s.length;if(e)s=s.charAt(0)+(i>1?"."+s.slice(1):"")+(n<0?"e":"e+")+n;else if(n<0){for(;++n;)s="0"+s;s="0."+s}else if(n>0)if(++n>i)for(n-=i;n--;)s+="0";else n<i&&(s=s.slice(0,n)+"."+s.slice(n));else i>1&&(s=s.charAt(0)+"."+s.slice(1));return r.s<0&&t?"-"+s:s}F.abs=function(){var r=new this.constructor(this);return r.s=1,r};F.cmp=function(r){var e,t=this,n=t.c,s=(r=new t.constructor(r)).c,i=t.s,a=r.s,o=t.e,u=r.e;if(!n[0]||!s[0])return n[0]?i:s[0]?-a:0;if(i!=a)return i;if(e=i<0,o!=u)return o>u^e?1:-1;for(a=(o=n.length)<(u=s.length)?o:u,i=-1;++i<a;)if(n[i]!=s[i])return n[i]>s[i]^e?1:-1;return o==u?0:o>u^e?1:-1};F.div=function(r){var e=this,t=e.constructor,n=e.c,s=(r=new t(r)).c,i=e.s==r.s?1:-1,a=t.DP;if(a!==~~a||a<0||a>gt)throw Error(Tn);if(!s[0])throw Error(ia);if(!n[0])return r.s=i,r.c=[r.e=0],r;var o,u,l,c,d,f=s.slice(),p=o=s.length,h=n.length,m=n.slice(0,o),g=m.length,b=r,v=b.c=[],w=0,k=a+(b.e=e.e-r.e)+1;for(b.s=i,i=k<0?0:k,f.unshift(0);g++<o;)m.push(0);do{for(l=0;l<10;l++){if(o!=(g=m.length))c=o>g?1:-1;else for(d=-1,c=0;++d<o;)if(s[d]!=m[d]){c=s[d]>m[d]?1:-1;break}if(c<0){for(u=g==o?s:f;g;){if(m[--g]<u[g]){for(d=g;d&&!m[--d];)m[d]=9;--m[d],m[g]+=10}m[g]-=u[g]}for(;!m[0];)m.shift()}else break}v[w++]=c?l:++l,m[0]&&c?m[g]=n[p]||0:m=[n[p]]}while((p++<h||m[0]!==Fe)&&i--);return!v[0]&&w!=1&&(v.shift(),b.e--,k--),w>k&&bt(b,k,t.RM,m[0]!==Fe),b};F.eq=function(r){return this.cmp(r)===0};F.gt=function(r){return this.cmp(r)>0};F.gte=function(r){return this.cmp(r)>-1};F.lt=function(r){return this.cmp(r)<0};F.lte=function(r){return this.cmp(r)<1};F.minus=F.sub=function(r){var e,t,n,s,i=this,a=i.constructor,o=i.s,u=(r=new a(r)).s;if(o!=u)return r.s=-u,i.plus(r);var l=i.c.slice(),c=i.e,d=r.c,f=r.e;if(!l[0]||!d[0])return d[0]?r.s=-u:l[0]?r=new a(i):r.s=1,r;if(o=c-f){for((s=o<0)?(o=-o,n=l):(f=c,n=d),n.reverse(),u=o;u--;)n.push(0);n.reverse()}else for(t=((s=l.length<d.length)?l:d).length,o=u=0;u<t;u++)if(l[u]!=d[u]){s=l[u]<d[u];break}if(s&&(n=l,l=d,d=n,r.s=-r.s),(u=(t=d.length)-(e=l.length))>0)for(;u--;)l[e++]=0;for(u=e;t>o;){if(l[--t]<d[t]){for(e=t;e&&!l[--e];)l[e]=9;--l[e],l[t]+=10}l[t]-=d[t]}for(;l[--u]===0;)l.pop();for(;l[0]===0;)l.shift(),--f;return l[0]||(r.s=1,l=[f=0]),r.c=l,r.e=f,r};F.mod=function(r){var e,t=this,n=t.constructor,s=t.s,i=(r=new n(r)).s;if(!r.c[0])throw Error(ia);return t.s=r.s=1,e=r.cmp(t)==1,t.s=s,r.s=i,e?new n(t):(s=n.DP,i=n.RM,n.DP=n.RM=0,t=t.div(r),n.DP=s,n.RM=i,this.minus(t.times(r)))};F.neg=function(){var r=new this.constructor(this);return r.s=-r.s,r};F.plus=F.add=function(r){var e,t,n,s=this,i=s.constructor;if(r=new i(r),s.s!=r.s)return r.s=-r.s,s.minus(r);var a=s.e,o=s.c,u=r.e,l=r.c;if(!o[0]||!l[0])return l[0]||(o[0]?r=new i(s):r.s=s.s),r;if(o=o.slice(),e=a-u){for(e>0?(u=a,n=l):(e=-e,n=o),n.reverse();e--;)n.push(0);n.reverse()}for(o.length-l.length<0&&(n=l,l=o,o=n),e=l.length,t=0;e;o[e]%=10)t=(o[--e]=o[e]+l[e]+t)/10|0;for(t&&(o.unshift(t),++u),e=o.length;o[--e]===0;)o.pop();return r.c=o,r.e=u,r};F.pow=function(r){var e=this,t=new e.constructor("1"),n=t,s=r<0;if(r!==~~r||r<-sa||r>sa)throw Error(_t+"exponent");for(s&&(r=-r);r&1&&(n=n.times(e)),r>>=1,!!r;)e=e.times(e);return s?t.div(n):n};F.prec=function(r,e){if(r!==~~r||r<1||r>gt)throw Error(_t+"precision");return bt(new this.constructor(this),r,e)};F.round=function(r,e){if(r===Fe)r=0;else if(r!==~~r||r<-gt||r>gt)throw Error(Tn);return bt(new this.constructor(this),r+this.e+1,e)};F.sqrt=function(){var r,e,t,n=this,s=n.constructor,i=n.s,a=n.e,o=new s("0.5");if(!n.c[0])return new s(n);if(i<0)throw Error(mr+"No square root");i=Math.sqrt(+wt(n,!0,!0)),i===0||i===1/0?(e=n.c.join(""),e.length+a&1||(e+="0"),i=Math.sqrt(e),a=((a+1)/2|0)-(a<0||a&1),r=new s((i==1/0?"5e":(i=i.toExponential()).slice(0,i.indexOf("e")+1))+a)):r=new s(i+""),a=r.e+(s.DP+=4);do t=r,r=o.times(t.plus(n.div(t)));while(t.c.slice(0,a).join("")!==r.c.slice(0,a).join(""));return bt(r,(s.DP-=4)+r.e+1,s.RM)};F.times=F.mul=function(r){var e,t=this,n=t.constructor,s=t.c,i=(r=new n(r)).c,a=s.length,o=i.length,u=t.e,l=r.e;if(r.s=t.s==r.s?1:-1,!s[0]||!i[0])return r.c=[r.e=0],r;for(r.e=u+l,a<o&&(e=s,s=i,i=e,l=a,a=o,o=l),e=new Array(l=a+o);l--;)e[l]=0;for(u=o;u--;){for(o=0,l=a+u;l>u;)o=e[l]+i[u]*s[l-u-1]+o,e[l--]=o%10,o=o/10|0;e[l]=o}for(o?++r.e:e.shift(),u=e.length;!e[--u];)e.pop();return r.c=e,r};F.toExponential=function(r,e){var t=this,n=t.c[0];if(r!==Fe){if(r!==~~r||r<0||r>gt)throw Error(Tn);for(t=bt(new t.constructor(t),++r,e);t.c.length<r;)t.c.push(0)}return wt(t,!0,!!n)};F.toFixed=function(r,e){var t=this,n=t.c[0];if(r!==Fe){if(r!==~~r||r<0||r>gt)throw Error(Tn);for(t=bt(new t.constructor(t),r+t.e+1,e),r=r+t.e+1;t.c.length<r;)t.c.push(0)}return wt(t,!1,!!n)};F[Symbol.for("nodejs.util.inspect.custom")]=F.toJSON=F.toString=function(){var r=this,e=r.constructor;return wt(r,r.e<=e.NE||r.e>=e.PE,!!r.c[0])};F.toNumber=function(){var r=+wt(this,!0,!0);if(this.constructor.strict===!0&&!this.eq(r.toString()))throw Error(mr+"Imprecise conversion");return r};F.toPrecision=function(r,e){var t=this,n=t.constructor,s=t.c[0];if(r!==Fe){if(r!==~~r||r<1||r>gt)throw Error(_t+"precision");for(t=bt(new n(t),r,e);t.c.length<r;)t.c.push(0)}return wt(t,r<=t.e||t.e<=n.NE||t.e>=n.PE,!!s)};F.valueOf=function(){var r=this,e=r.constructor;if(e.strict===!0)throw Error(mr+"valueOf disallowed");return wt(r,r.e<=e.NE||r.e>=e.PE,!0)};var Yu=aa(),oa=Yu;var Ps={};Gl(Ps,{DecodeError:()=>ce,Decoder:()=>Ce,EXT_TIMESTAMP:()=>Os,Encoder:()=>Ft,ExtData:()=>We,ExtensionCodec:()=>it,decode:()=>_a,decodeArrayStream:()=>ya,decodeAsync:()=>wa,decodeMulti:()=>ba,decodeMultiStream:()=>va,decodeTimestampExtension:()=>$s,decodeTimestampToTimeSpec:()=>Ms,encode:()=>ha,encodeDateToTimeSpec:()=>Is,encodeTimeSpecToTimestamp:()=>Bs,encodeTimestampExtension:()=>Rs});function la(r){let e=r.length,t=0,n=0;for(;n<e;){let s=r.charCodeAt(n++);if((s&4294967168)===0){t++;continue}else if((s&4294965248)===0)t+=2;else{if(s>=55296&&s<=56319&&n<e){let i=r.charCodeAt(n);(i&64512)===56320&&(++n,s=((s&1023)<<10)+(i&1023)+65536)}(s&4294901760)===0?t+=3:t+=4}}return t}function Zu(r,e,t){let n=r.length,s=t,i=0;for(;i<n;){let a=r.charCodeAt(i++);if((a&4294967168)===0){e[s++]=a;continue}else if((a&4294965248)===0)e[s++]=a>>6&31|192;else{if(a>=55296&&a<=56319&&i<n){let o=r.charCodeAt(i);(o&64512)===56320&&(++i,a=((a&1023)<<10)+(o&1023)+65536)}(a&4294901760)===0?(e[s++]=a>>12&15|224,e[s++]=a>>6&63|128):(e[s++]=a>>18&7|240,e[s++]=a>>12&63|128,e[s++]=a>>6&63|128)}e[s++]=a&63|128}}var Ju=new TextEncoder,Ku=50;function Qu(r,e,t){Ju.encodeInto(r,e.subarray(t))}function ua(r,e,t){r.length>Ku?Qu(r,e,t):Zu(r,e,t)}var ec=4096;function Cs(r,e,t){let n=e,s=n+t,i=[],a="";for(;n<s;){let o=r[n++];if((o&128)===0)i.push(o);else if((o&224)===192){let u=r[n++]&63;i.push((o&31)<<6|u)}else if((o&240)===224){let u=r[n++]&63,l=r[n++]&63;i.push((o&31)<<12|u<<6|l)}else if((o&248)===240){let u=r[n++]&63,l=r[n++]&63,c=r[n++]&63,d=(o&7)<<18|u<<12|l<<6|c;d>65535&&(d-=65536,i.push(d>>>10&1023|55296),d=56320|d&1023),i.push(d)}else i.push(o);i.length>=ec&&(a+=String.fromCharCode(...i),i.length=0)}return i.length>0&&(a+=String.fromCharCode(...i)),a}var tc=new TextDecoder,rc=200;function nc(r,e,t){let n=r.subarray(e,e+t);return tc.decode(n)}function ca(r,e,t){return t>rc?nc(r,e,t):Cs(r,e,t)}var We=class{type;data;constructor(e,t){this.type=e,this.data=t}};var ce=class r extends Error{constructor(e){super(e);let t=Object.create(r.prototype);Object.setPrototypeOf(this,t),Object.defineProperty(this,"name",{configurable:!0,enumerable:!1,value:r.name})}};function da(r,e,t){let n=t/4294967296,s=t;r.setUint32(e,n),r.setUint32(e+4,s)}function xn(r,e,t){let n=Math.floor(t/4294967296),s=t;r.setUint32(e,n),r.setUint32(e+4,s)}function Sn(r,e){let t=r.getInt32(e),n=r.getUint32(e+4);return t*4294967296+n}function fa(r,e){let t=r.getUint32(e),n=r.getUint32(e+4);return t*4294967296+n}var Os=-1,sc=4294967296-1,ic=17179869184-1;function Bs({sec:r,nsec:e}){if(r>=0&&e>=0&&r<=ic)if(e===0&&r<=sc){let t=new Uint8Array(4);return new DataView(t.buffer).setUint32(0,r),t}else{let t=r/4294967296,n=r&4294967295,s=new Uint8Array(8),i=new DataView(s.buffer);return i.setUint32(0,e<<2|t&3),i.setUint32(4,n),s}else{let t=new Uint8Array(12),n=new DataView(t.buffer);return n.setUint32(0,e),xn(n,4,r),t}}function Is(r){let e=r.getTime(),t=Math.floor(e/1e3),n=(e-t*1e3)*1e6,s=Math.floor(n/1e9);return{sec:t+s,nsec:n-s*1e9}}function Rs(r){if(r instanceof Date){let e=Is(r);return Bs(e)}else return null}function Ms(r){let e=new DataView(r.buffer,r.byteOffset,r.byteLength);switch(r.byteLength){case 4:return{sec:e.getUint32(0),nsec:0};case 8:{let t=e.getUint32(0),n=e.getUint32(4),s=(t&3)*4294967296+n,i=t>>>2;return{sec:s,nsec:i}}case 12:{let t=Sn(e,4),n=e.getUint32(0);return{sec:t,nsec:n}}default:throw new ce(`Unrecognized data size for timestamp (expected 4, 8, or 12): ${r.length}`)}}function $s(r){let e=Ms(r);return new Date(e.sec*1e3+e.nsec/1e6)}var pa={type:Os,encode:Rs,decode:$s};var it=class r{static defaultCodec=new r;__brand;builtInEncoders=[];builtInDecoders=[];encoders=[];decoders=[];constructor(){this.register(pa)}register({type:e,encode:t,decode:n}){if(e>=0)this.encoders[e]=t,this.decoders[e]=n;else{let s=-1-e;this.builtInEncoders[s]=t,this.builtInDecoders[s]=n}}tryToEncode(e,t){for(let n=0;n<this.builtInEncoders.length;n++){let s=this.builtInEncoders[n];if(s!=null){let i=s(e,t);if(i!=null){let a=-1-n;return new We(a,i)}}}for(let n=0;n<this.encoders.length;n++){let s=this.encoders[n];if(s!=null){let i=s(e,t);if(i!=null){let a=n;return new We(a,i)}}}return e instanceof We?e:null}decode(e,t,n){let s=t<0?this.builtInDecoders[-1-t]:this.decoders[t];return s?s(e,t,n):new We(t,e)}};function ac(r){return r instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&r instanceof SharedArrayBuffer}function gr(r){return r instanceof Uint8Array?r:ArrayBuffer.isView(r)?new Uint8Array(r.buffer,r.byteOffset,r.byteLength):ac(r)?new Uint8Array(r):Uint8Array.from(r)}var oc=100,lc=2048,Ft=class r{extensionCodec;context;useBigInt64;maxDepth;initialBufferSize;sortKeys;forceFloat32;ignoreUndefined;forceIntegerToFloat;pos;view;bytes;entered=!1;constructor(e){this.extensionCodec=e?.extensionCodec??it.defaultCodec,this.context=e?.context,this.useBigInt64=e?.useBigInt64??!1,this.maxDepth=e?.maxDepth??oc,this.initialBufferSize=e?.initialBufferSize??lc,this.sortKeys=e?.sortKeys??!1,this.forceFloat32=e?.forceFloat32??!1,this.ignoreUndefined=e?.ignoreUndefined??!1,this.forceIntegerToFloat=e?.forceIntegerToFloat??!1,this.pos=0,this.view=new DataView(new ArrayBuffer(this.initialBufferSize)),this.bytes=new Uint8Array(this.view.buffer)}clone(){return new r({extensionCodec:this.extensionCodec,context:this.context,useBigInt64:this.useBigInt64,maxDepth:this.maxDepth,initialBufferSize:this.initialBufferSize,sortKeys:this.sortKeys,forceFloat32:this.forceFloat32,ignoreUndefined:this.ignoreUndefined,forceIntegerToFloat:this.forceIntegerToFloat})}reinitializeState(){this.pos=0}encodeSharedRef(e){if(this.entered)return this.clone().encodeSharedRef(e);try{return this.entered=!0,this.reinitializeState(),this.doEncode(e,1),this.bytes.subarray(0,this.pos)}finally{this.entered=!1}}encode(e){if(this.entered)return this.clone().encode(e);try{return this.entered=!0,this.reinitializeState(),this.doEncode(e,1),this.bytes.slice(0,this.pos)}finally{this.entered=!1}}doEncode(e,t){if(t>this.maxDepth)throw new Error(`Too deep objects in depth ${t}`);e==null?this.encodeNil():typeof e=="boolean"?this.encodeBoolean(e):typeof e=="number"?this.forceIntegerToFloat?this.encodeNumberAsFloat(e):this.encodeNumber(e):typeof e=="string"?this.encodeString(e):this.useBigInt64&&typeof e=="bigint"?this.encodeBigInt64(e):this.encodeObject(e,t)}ensureBufferSizeToWrite(e){let t=this.pos+e;this.view.byteLength<t&&this.resizeBuffer(t*2)}resizeBuffer(e){let t=new ArrayBuffer(e),n=new Uint8Array(t),s=new DataView(t);n.set(this.bytes),this.view=s,this.bytes=n}encodeNil(){this.writeU8(192)}encodeBoolean(e){e===!1?this.writeU8(194):this.writeU8(195)}encodeNumber(e){!this.forceIntegerToFloat&&Number.isSafeInteger(e)?e>=0?e<128?this.writeU8(e):e<256?(this.writeU8(204),this.writeU8(e)):e<65536?(this.writeU8(205),this.writeU16(e)):e<4294967296?(this.writeU8(206),this.writeU32(e)):this.useBigInt64?this.encodeNumberAsFloat(e):(this.writeU8(207),this.writeU64(e)):e>=-32?this.writeU8(224|e+32):e>=-128?(this.writeU8(208),this.writeI8(e)):e>=-32768?(this.writeU8(209),this.writeI16(e)):e>=-2147483648?(this.writeU8(210),this.writeI32(e)):this.useBigInt64?this.encodeNumberAsFloat(e):(this.writeU8(211),this.writeI64(e)):this.encodeNumberAsFloat(e)}encodeNumberAsFloat(e){this.forceFloat32?(this.writeU8(202),this.writeF32(e)):(this.writeU8(203),this.writeF64(e))}encodeBigInt64(e){e>=BigInt(0)?(this.writeU8(207),this.writeBigUint64(e)):(this.writeU8(211),this.writeBigInt64(e))}writeStringHeader(e){if(e<32)this.writeU8(160+e);else if(e<256)this.writeU8(217),this.writeU8(e);else if(e<65536)this.writeU8(218),this.writeU16(e);else if(e<4294967296)this.writeU8(219),this.writeU32(e);else throw new Error(`Too long string: ${e} bytes in UTF-8`)}encodeString(e){let n=la(e);this.ensureBufferSizeToWrite(5+n),this.writeStringHeader(n),ua(e,this.bytes,this.pos),this.pos+=n}encodeObject(e,t){let n=this.extensionCodec.tryToEncode(e,this.context);if(n!=null)this.encodeExtension(n);else if(Array.isArray(e))this.encodeArray(e,t);else if(ArrayBuffer.isView(e))this.encodeBinary(e);else if(typeof e=="object")this.encodeMap(e,t);else throw new Error(`Unrecognized object: ${Object.prototype.toString.apply(e)}`)}encodeBinary(e){let t=e.byteLength;if(t<256)this.writeU8(196),this.writeU8(t);else if(t<65536)this.writeU8(197),this.writeU16(t);else if(t<4294967296)this.writeU8(198),this.writeU32(t);else throw new Error(`Too large binary: ${t}`);let n=gr(e);this.writeU8a(n)}encodeArray(e,t){let n=e.length;if(n<16)this.writeU8(144+n);else if(n<65536)this.writeU8(220),this.writeU16(n);else if(n<4294967296)this.writeU8(221),this.writeU32(n);else throw new Error(`Too large array: ${n}`);for(let s of e)this.doEncode(s,t+1)}countWithoutUndefined(e,t){let n=0;for(let s of t)e[s]!==void 0&&n++;return n}encodeMap(e,t){let n=Object.keys(e);this.sortKeys&&n.sort();let s=this.ignoreUndefined?this.countWithoutUndefined(e,n):n.length;if(s<16)this.writeU8(128+s);else if(s<65536)this.writeU8(222),this.writeU16(s);else if(s<4294967296)this.writeU8(223),this.writeU32(s);else throw new Error(`Too large map object: ${s}`);for(let i of n){let a=e[i];this.ignoreUndefined&&a===void 0||(this.encodeString(i),this.doEncode(a,t+1))}}encodeExtension(e){if(typeof e.data=="function"){let n=e.data(this.pos+6),s=n.length;if(s>=4294967296)throw new Error(`Too large extension object: ${s}`);this.writeU8(201),this.writeU32(s),this.writeI8(e.type),this.writeU8a(n);return}let t=e.data.length;if(t===1)this.writeU8(212);else if(t===2)this.writeU8(213);else if(t===4)this.writeU8(214);else if(t===8)this.writeU8(215);else if(t===16)this.writeU8(216);else if(t<256)this.writeU8(199),this.writeU8(t);else if(t<65536)this.writeU8(200),this.writeU16(t);else if(t<4294967296)this.writeU8(201),this.writeU32(t);else throw new Error(`Too large extension object: ${t}`);this.writeI8(e.type),this.writeU8a(e.data)}writeU8(e){this.ensureBufferSizeToWrite(1),this.view.setUint8(this.pos,e),this.pos++}writeU8a(e){let t=e.length;this.ensureBufferSizeToWrite(t),this.bytes.set(e,this.pos),this.pos+=t}writeI8(e){this.ensureBufferSizeToWrite(1),this.view.setInt8(this.pos,e),this.pos++}writeU16(e){this.ensureBufferSizeToWrite(2),this.view.setUint16(this.pos,e),this.pos+=2}writeI16(e){this.ensureBufferSizeToWrite(2),this.view.setInt16(this.pos,e),this.pos+=2}writeU32(e){this.ensureBufferSizeToWrite(4),this.view.setUint32(this.pos,e),this.pos+=4}writeI32(e){this.ensureBufferSizeToWrite(4),this.view.setInt32(this.pos,e),this.pos+=4}writeF32(e){this.ensureBufferSizeToWrite(4),this.view.setFloat32(this.pos,e),this.pos+=4}writeF64(e){this.ensureBufferSizeToWrite(8),this.view.setFloat64(this.pos,e),this.pos+=8}writeU64(e){this.ensureBufferSizeToWrite(8),da(this.view,this.pos,e),this.pos+=8}writeI64(e){this.ensureBufferSizeToWrite(8),xn(this.view,this.pos,e),this.pos+=8}writeBigUint64(e){this.ensureBufferSizeToWrite(8),this.view.setBigUint64(this.pos,e),this.pos+=8}writeBigInt64(e){this.ensureBufferSizeToWrite(8),this.view.setBigInt64(this.pos,e),this.pos+=8}};function ha(r,e){return new Ft(e).encodeSharedRef(r)}function Nn(r){return`${r<0?"-":""}0x${Math.abs(r).toString(16).padStart(2,"0")}`}var uc=16,cc=16,Cn=class{hit=0;miss=0;caches;maxKeyLength;maxLengthPerKey;constructor(e=uc,t=cc){this.maxKeyLength=e,this.maxLengthPerKey=t,this.caches=[];for(let n=0;n<this.maxKeyLength;n++)this.caches.push([])}canBeCached(e){return e>0&&e<=this.maxKeyLength}find(e,t,n){let s=this.caches[n-1];e:for(let i of s){let a=i.bytes;for(let o=0;o<n;o++)if(a[o]!==e[t+o])continue e;return i.str}return null}store(e,t){let n=this.caches[e.length-1],s={bytes:e,str:t};n.length>=this.maxLengthPerKey?n[Math.random()*n.length|0]=s:n.push(s)}decode(e,t,n){let s=this.find(e,t,n);if(s!=null)return this.hit++,s;this.miss++;let i=Cs(e,t,n),a=Uint8Array.prototype.slice.call(e,t,t+n);return this.store(a,i),i}};var Ls="array",wr="map_key",ga="map_value",dc=r=>{if(typeof r=="string"||typeof r=="number")return r;throw new ce("The type of key must be string or number but "+typeof r)},Fs=class{stack=[];stackHeadPosition=-1;get length(){return this.stackHeadPosition+1}top(){return this.stack[this.stackHeadPosition]}pushArrayState(e){let t=this.getUninitializedStateFromPool();t.type=Ls,t.position=0,t.size=e,t.array=new Array(e)}pushMapState(e){let t=this.getUninitializedStateFromPool();t.type=wr,t.readCount=0,t.size=e,t.map={}}getUninitializedStateFromPool(){if(this.stackHeadPosition++,this.stackHeadPosition===this.stack.length){let e={type:void 0,size:0,array:void 0,position:0,readCount:0,map:void 0,key:null};this.stack.push(e)}return this.stack[this.stackHeadPosition]}release(e){if(this.stack[this.stackHeadPosition]!==e)throw new Error("Invalid stack state. Released state is not on top of the stack.");if(e.type===Ls){let n=e;n.size=0,n.array=void 0,n.position=0,n.type=void 0}if(e.type===wr||e.type===ga){let n=e;n.size=0,n.map=void 0,n.readCount=0,n.type=void 0}this.stackHeadPosition--}reset(){this.stack.length=0,this.stackHeadPosition=-1}},br=-1,Us=new DataView(new ArrayBuffer(0)),fc=new Uint8Array(Us.buffer);try{Us.getInt8(0)}catch(r){if(!(r instanceof RangeError))throw new Error("This module is not supported in the current JavaScript engine because DataView does not throw RangeError on out-of-bounds access")}var ma=new RangeError("Insufficient data"),pc=new Cn,Ce=class r{extensionCodec;context;useBigInt64;rawStrings;maxStrLength;maxBinLength;maxArrayLength;maxMapLength;maxExtLength;keyDecoder;mapKeyConverter;totalPos=0;pos=0;view=Us;bytes=fc;headByte=br;stack=new Fs;entered=!1;constructor(e){this.extensionCodec=e?.extensionCodec??it.defaultCodec,this.context=e?.context,this.useBigInt64=e?.useBigInt64??!1,this.rawStrings=e?.rawStrings??!1,this.maxStrLength=e?.maxStrLength??4294967295,this.maxBinLength=e?.maxBinLength??4294967295,this.maxArrayLength=e?.maxArrayLength??4294967295,this.maxMapLength=e?.maxMapLength??4294967295,this.maxExtLength=e?.maxExtLength??4294967295,this.keyDecoder=e?.keyDecoder!==void 0?e.keyDecoder:pc,this.mapKeyConverter=e?.mapKeyConverter??dc}clone(){return new r({extensionCodec:this.extensionCodec,context:this.context,useBigInt64:this.useBigInt64,rawStrings:this.rawStrings,maxStrLength:this.maxStrLength,maxBinLength:this.maxBinLength,maxArrayLength:this.maxArrayLength,maxMapLength:this.maxMapLength,maxExtLength:this.maxExtLength,keyDecoder:this.keyDecoder})}reinitializeState(){this.totalPos=0,this.headByte=br,this.stack.reset()}setBuffer(e){let t=gr(e);this.bytes=t,this.view=new DataView(t.buffer,t.byteOffset,t.byteLength),this.pos=0}appendBuffer(e){if(this.headByte===br&&!this.hasRemaining(1))this.setBuffer(e);else{let t=this.bytes.subarray(this.pos),n=gr(e),s=new Uint8Array(t.length+n.length);s.set(t),s.set(n,t.length),this.setBuffer(s)}}hasRemaining(e){return this.view.byteLength-this.pos>=e}createExtraByteError(e){let{view:t,pos:n}=this;return new RangeError(`Extra ${t.byteLength-n} of ${t.byteLength} byte(s) found at buffer[${e}]`)}decode(e){if(this.entered)return this.clone().decode(e);try{this.entered=!0,this.reinitializeState(),this.setBuffer(e);let t=this.doDecodeSync();if(this.hasRemaining(1))throw this.createExtraByteError(this.pos);return t}finally{this.entered=!1}}*decodeMulti(e){if(this.entered){yield*this.clone().decodeMulti(e);return}try{for(this.entered=!0,this.reinitializeState(),this.setBuffer(e);this.hasRemaining(1);)yield this.doDecodeSync()}finally{this.entered=!1}}async decodeAsync(e){if(this.entered)return this.clone().decodeAsync(e);try{this.entered=!0;let t=!1,n;for await(let o of e){if(t)throw this.entered=!1,this.createExtraByteError(this.totalPos);this.appendBuffer(o);try{n=this.doDecodeSync(),t=!0}catch(u){if(!(u instanceof RangeError))throw u}this.totalPos+=this.pos}if(t){if(this.hasRemaining(1))throw this.createExtraByteError(this.totalPos);return n}let{headByte:s,pos:i,totalPos:a}=this;throw new RangeError(`Insufficient data in parsing ${Nn(s)} at ${a} (${i} in the current buffer)`)}finally{this.entered=!1}}decodeArrayStream(e){return this.decodeMultiAsync(e,!0)}decodeStream(e){return this.decodeMultiAsync(e,!1)}async*decodeMultiAsync(e,t){if(this.entered){yield*this.clone().decodeMultiAsync(e,t);return}try{this.entered=!0;let n=t,s=-1;for await(let i of e){if(t&&s===0)throw this.createExtraByteError(this.totalPos);this.appendBuffer(i),n&&(s=this.readArraySize(),n=!1,this.complete());try{for(;yield this.doDecodeSync(),--s!==0;);}catch(a){if(!(a instanceof RangeError))throw a}this.totalPos+=this.pos}}finally{this.entered=!1}}doDecodeSync(){e:for(;;){let e=this.readHeadByte(),t;if(e>=224)t=e-256;else if(e<192)if(e<128)t=e;else if(e<144){let s=e-128;if(s!==0){this.pushMapState(s),this.complete();continue e}else t={}}else if(e<160){let s=e-144;if(s!==0){this.pushArrayState(s),this.complete();continue e}else t=[]}else{let s=e-160;t=this.decodeString(s,0)}else if(e===192)t=null;else if(e===194)t=!1;else if(e===195)t=!0;else if(e===202)t=this.readF32();else if(e===203)t=this.readF64();else if(e===204)t=this.readU8();else if(e===205)t=this.readU16();else if(e===206)t=this.readU32();else if(e===207)this.useBigInt64?t=this.readU64AsBigInt():t=this.readU64();else if(e===208)t=this.readI8();else if(e===209)t=this.readI16();else if(e===210)t=this.readI32();else if(e===211)this.useBigInt64?t=this.readI64AsBigInt():t=this.readI64();else if(e===217){let s=this.lookU8();t=this.decodeString(s,1)}else if(e===218){let s=this.lookU16();t=this.decodeString(s,2)}else if(e===219){let s=this.lookU32();t=this.decodeString(s,4)}else if(e===220){let s=this.readU16();if(s!==0){this.pushArrayState(s),this.complete();continue e}else t=[]}else if(e===221){let s=this.readU32();if(s!==0){this.pushArrayState(s),this.complete();continue e}else t=[]}else if(e===222){let s=this.readU16();if(s!==0){this.pushMapState(s),this.complete();continue e}else t={}}else if(e===223){let s=this.readU32();if(s!==0){this.pushMapState(s),this.complete();continue e}else t={}}else if(e===196){let s=this.lookU8();t=this.decodeBinary(s,1)}else if(e===197){let s=this.lookU16();t=this.decodeBinary(s,2)}else if(e===198){let s=this.lookU32();t=this.decodeBinary(s,4)}else if(e===212)t=this.decodeExtension(1,0);else if(e===213)t=this.decodeExtension(2,0);else if(e===214)t=this.decodeExtension(4,0);else if(e===215)t=this.decodeExtension(8,0);else if(e===216)t=this.decodeExtension(16,0);else if(e===199){let s=this.lookU8();t=this.decodeExtension(s,1)}else if(e===200){let s=this.lookU16();t=this.decodeExtension(s,2)}else if(e===201){let s=this.lookU32();t=this.decodeExtension(s,4)}else throw new ce(`Unrecognized type byte: ${Nn(e)}`);this.complete();let n=this.stack;for(;n.length>0;){let s=n.top();if(s.type===Ls)if(s.array[s.position]=t,s.position++,s.position===s.size)t=s.array,n.release(s);else continue e;else if(s.type===wr){if(t==="__proto__")throw new ce("The key __proto__ is not allowed");s.key=this.mapKeyConverter(t),s.type=ga;continue e}else if(s.map[s.key]=t,s.readCount++,s.readCount===s.size)t=s.map,n.release(s);else{s.key=null,s.type=wr;continue e}}return t}}readHeadByte(){return this.headByte===br&&(this.headByte=this.readU8()),this.headByte}complete(){this.headByte=br}readArraySize(){let e=this.readHeadByte();switch(e){case 220:return this.readU16();case 221:return this.readU32();default:{if(e<160)return e-144;throw new ce(`Unrecognized array type byte: ${Nn(e)}`)}}}pushMapState(e){if(e>this.maxMapLength)throw new ce(`Max length exceeded: map length (${e}) > maxMapLengthLength (${this.maxMapLength})`);this.stack.pushMapState(e)}pushArrayState(e){if(e>this.maxArrayLength)throw new ce(`Max length exceeded: array length (${e}) > maxArrayLength (${this.maxArrayLength})`);this.stack.pushArrayState(e)}decodeString(e,t){return!this.rawStrings||this.stateIsMapKey()?this.decodeUtf8String(e,t):this.decodeBinary(e,t)}decodeUtf8String(e,t){if(e>this.maxStrLength)throw new ce(`Max length exceeded: UTF-8 byte length (${e}) > maxStrLength (${this.maxStrLength})`);if(this.bytes.byteLength<this.pos+t+e)throw ma;let n=this.pos+t,s;return this.stateIsMapKey()&&this.keyDecoder?.canBeCached(e)?s=this.keyDecoder.decode(this.bytes,n,e):s=ca(this.bytes,n,e),this.pos+=t+e,s}stateIsMapKey(){return this.stack.length>0?this.stack.top().type===wr:!1}decodeBinary(e,t){if(e>this.maxBinLength)throw new ce(`Max length exceeded: bin length (${e}) > maxBinLength (${this.maxBinLength})`);if(!this.hasRemaining(e+t))throw ma;let n=this.pos+t,s=this.bytes.subarray(n,n+e);return this.pos+=t+e,s}decodeExtension(e,t){if(e>this.maxExtLength)throw new ce(`Max length exceeded: ext length (${e}) > maxExtLength (${this.maxExtLength})`);let n=this.view.getInt8(this.pos+t),s=this.decodeBinary(e,t+1);return this.extensionCodec.decode(s,n,this.context)}lookU8(){return this.view.getUint8(this.pos)}lookU16(){return this.view.getUint16(this.pos)}lookU32(){return this.view.getUint32(this.pos)}readU8(){let e=this.view.getUint8(this.pos);return this.pos++,e}readI8(){let e=this.view.getInt8(this.pos);return this.pos++,e}readU16(){let e=this.view.getUint16(this.pos);return this.pos+=2,e}readI16(){let e=this.view.getInt16(this.pos);return this.pos+=2,e}readU32(){let e=this.view.getUint32(this.pos);return this.pos+=4,e}readI32(){let e=this.view.getInt32(this.pos);return this.pos+=4,e}readU64(){let e=fa(this.view,this.pos);return this.pos+=8,e}readI64(){let e=Sn(this.view,this.pos);return this.pos+=8,e}readU64AsBigInt(){let e=this.view.getBigUint64(this.pos);return this.pos+=8,e}readI64AsBigInt(){let e=this.view.getBigInt64(this.pos);return this.pos+=8,e}readF32(){let e=this.view.getFloat32(this.pos);return this.pos+=4,e}readF64(){let e=this.view.getFloat64(this.pos);return this.pos+=8,e}};function _a(r,e){return new Ce(e).decode(r)}function ba(r,e){return new Ce(e).decodeMulti(r)}function hc(r){return r[Symbol.asyncIterator]!=null}async function*mc(r){let e=r.getReader();try{for(;;){let{done:t,value:n}=await e.read();if(t)return;yield n}}finally{e.releaseLock()}}function On(r){return hc(r)?r:mc(r)}async function wa(r,e){let t=On(r);return new Ce(e).decodeAsync(t)}function ya(r,e){let t=On(r);return new Ce(e).decodeArrayStream(t)}function va(r,e){let t=On(r);return new Ce(e).decodeStream(t)}var Zn=ji(li(),1),ui=na,ci=oa,je=Ps,xo=Zn.DOMParser,So=Zn.XMLSerializer;var No=je!==null;function Co(){if(!No)throw new Error("@msgpack/msgpack is required for MessagePack support. Install with: npm install @msgpack/msgpack")}var Oo=mf();function mf(){if(!No)return null;let r=new TextEncoder,e=new TextDecoder,t=new je.ExtensionCodec;return t.register({type:-1,encode:n=>{if(n instanceof Date){let s=Ur(n);if(s==="D"||s==="H")return null}return je.encodeTimestampExtension(n)},decode:n=>je.decodeTimestampExtension(n)}),t.register({type:1,encode:n=>Je(n)?r.encode(n.toString()):null,decode:n=>Jn(e.decode(n))}),t.register({type:2,encode:n=>{if(n instanceof Date&&Ur(n)==="D"){let s=n.getUTCFullYear(),i=String(n.getUTCMonth()+1).padStart(2,"0"),a=String(n.getUTCDate()).padStart(2,"0");return r.encode(`${s}-${i}-${a}`)}return null},decode:n=>new Date(e.decode(n)+"T00:00:00.000Z")}),t.register({type:3,encode:n=>{if(n instanceof Date&&Ur(n)==="H"){let s=String(n.getUTCHours()).padStart(2,"0"),i=String(n.getUTCMinutes()).padStart(2,"0"),a=String(n.getUTCSeconds()).padStart(2,"0"),o=String(n.getUTCMilliseconds()).padStart(3,"0");return r.encode(`${s}:${i}:${a}.${o}`)}return null},decode:n=>{let s=e.decode(n),i=s.indexOf("."),a=i>=0?s.substring(0,i):s,o=i>=0?s.substring(i+1):"0",[u,l,c]=a.split(":"),d=Math.round(+o.substring(0,3));return new Date(Date.UTC(1970,0,1,+u,+l,+c,d))}}),t.register({type:4,encode:n=>{let s=di(n);if(s!==null){let[i,a]=s;return r.encode(`${i}:${a(n)}`)}return null},decode:n=>{let s=e.decode(n),i=s.indexOf(":"),a=s.slice(0,i),o=s.slice(i+1),u=ft[a];if(u!==void 0){let[,l]=u;return l(o)}return`${o}::${a}`}}),t}function Bo(r){return Co(),je.encode(r,{extensionCodec:Oo})}function Io(r){return Co(),je.decode(r,{extensionCodec:Oo})}function Qn(r,e=!1){let t=es(r);if(t===null)return[!1,String(r)];let[n,s,i]=t;return i&&!e?[!1,String(r)]:[!0,`${s(r)}::${n}`]}function fi(r){if(!r.includes("::"))return[!1,r];let e=r.lastIndexOf("::"),t=r.slice(0,e),n=r.slice(e+2),s=ft[n];if(s===void 0)return[!1,r];let[,i]=s;return[!0,i(t)]}function Kn(r,e,t){if(r!==null&&typeof r=="object"&&!Array.isArray(r)){let n={};for(let[s,i]of Object.entries(r))n[s]=Kn(i,e,t);return n}return Array.isArray(r)?r.map(n=>Kn(n,e,t)):t(r)?e(r):r}function pi(r){let e=es(r);if(e!==null){let[t,n,s]=e;return s?[r,!1]:[`${n(r)}::${t}`,!0]}if(Array.isArray(r)){let t=!1;return[r.map(s=>{let[i,a]=pi(s);return a&&(t=!0),i}),t]}if(r!==null&&typeof r=="object"){let t=!1,n={};for(let[s,i]of Object.entries(r)){let[a,o]=pi(i);o&&(t=!0),n[s]=a}return[n,t]}return[r,!1]}function gf(r,e=!1){let[t,n]=Qn(r,e);if(t)return n;let[s,i]=pi(r),a=JSON.stringify(s);return i?`${a}::JS`:a}function _f(r){return JSON.stringify(r)}function bf(r){if(!je)throw new Error("@msgpack/msgpack is required for MessagePack support");return je.encode(r)}function le(r,e=null,{raw:t=!1,qs:n=!1,_forceSuffix:s=!1}={}){if(n)return`${Mo(r)}::QS`;if(t){if(e===null||e==="json")return _f(r);if(e==="msgpack")return bf(r);throw e==="xml"?new Error("raw=true is not supported for XML transport"):new Error(`Unknown transport: ${e}`)}if(e===null||e==="json"){let i=gf(r,s);return e==="json"?`"${i}"`:i}else{if(e==="xml")return`<?xml version="1.0" ?><tytx_root>${Ro(r)}</tytx_root>`;if(e==="msgpack")return Bo(r);throw new Error(`Unknown transport: ${e}`)}}var nr,hi;typeof window<"u"&&window.DOMParser?(nr=window.DOMParser,hi=window.XMLSerializer):(nr=xo,hi=So);function $o(r){if(r===null||typeof r!="object"||Array.isArray(r))return!1;let e=Object.keys(r);if(e.length!==1)return!1;let t=r[e[0]];return t!==null&&typeof t=="object"&&"value"in t}function Lo(r,e,t){let n=r.createElement(e),s=t.attrs||{},i=t.value;for(let[a,o]of Object.entries(s))n.setAttribute(a,le(o,null,{_forceSuffix:!0}));if(Array.isArray(i))for(let a of i)if($o(a)){let[o]=Object.keys(a),u=a[o],l=Lo(r,o,u);n.appendChild(l)}else{n.textContent=le(i);break}else n.textContent=le(i);return n}function Ro(r){if(!nr)throw new Error("XML support requires @xmldom/xmldom package in Node.js");if($o(r)){let[e]=Object.keys(r),t=r[e],n=new nr().parseFromString("<root/>","text/xml"),s=Lo(n,e,t);return new hi().serializeToString(s)}else return le(r)}function mi(r){let e={};for(let n=0;n<r.attributes.length;n++){let s=r.attributes[n];e[s.name]=H(s.value)}let t=[];for(let n=0;n<r.childNodes.length;n++){let s=r.childNodes[n];s.nodeType===1&&t.push(s)}if(t.length>0)if(t.length===1){let n=t[0],s=mi(n);return{attrs:e,value:{[n.tagName]:s}}}else{let n=[];for(let s of t){let i=mi(s);n.push({[s.tagName]:i})}return{attrs:e,value:n}}return{attrs:e,value:H(r.textContent)}}function Fo(r){if(!nr)throw new Error("XML support requires @xmldom/xmldom package in Node.js");let n=new nr().parseFromString(r,"text/xml").documentElement;if(n.tagName==="tytx_root"){let i=null;for(let a=0;a<n.childNodes.length;a++)if(n.childNodes[a].nodeType===1){i=n.childNodes[a];break}if(!i)return H(n.textContent);n=i}let s=mi(n);return{[n.tagName]:s}}function wf(r){return typeof r=="string"}function yf(r){let[e,t]=fi(r);if(e)return t;let n=r;n.endsWith("::JS")&&(n=n.slice(0,-4));let s;try{s=JSON.parse(n)}catch{return r}return Kn(s,vf,wf)}function vf(r){return r.includes("::")?fi(r)[1]:r}function Ef(r){let e=Fo(r);return typeof e=="string"?H(e):e}function kf(r){return Io(r)}function H(r,e=null){if(r===null)return null;if(e===null||e==="json"){let t=r;return e==="json"&&r.startsWith('"')&&r.endsWith('"')&&(t=r.slice(1,-1)),yf(t)}else{if(e==="xml")return Ef(r);if(e==="msgpack")return kf(r);throw new Error(`Unknown transport: ${e}`)}}function Mo(r){if(Array.isArray(r))return r.map(e=>String(e)).join("&");if(r!==null&&typeof r=="object"){let e=[];for(let[t,n]of Object.entries(r)){let[s,i]=Qn(n,!0);s?e.push(`${t}=${i}`):e.push(`${t}=${n}`)}return e.join("&")}throw new TypeError(`toQs expects object or array, got ${typeof r}`)}function Uo(r){if(!r)return[];let e=r.split("&"),t=e.map(a=>a.includes("=")),n=t.every(Boolean),s=!t.some(Boolean);if(!n&&!s)throw new Error("QS format error: mixed items with and without '='");if(s)return e.map(a=>H(a));let i={};for(let a of e){let o=a.indexOf("="),u=a.slice(0,o),l=a.slice(o+1);i[u]=H(l)}return i}var qo=ui||ci||Number,Af=ui?"decimal.js":ci?"big.js":"number";function Jn(r){return new qo(r)}function Je(r){return Af==="number"?!1:r instanceof qo}function Ur(r){let e=r.getUTCFullYear()===1970&&r.getUTCMonth()===0&&r.getUTCDate()===1,t=r.getUTCHours()===0&&r.getUTCMinutes()===0&&r.getUTCSeconds()===0&&r.getUTCMilliseconds()===0;return e&&!t?"H":t&&!e?"D":"DHZ"}function Df(r){return r.toString()}function Tf(r){let e=r.getUTCFullYear(),t=String(r.getUTCMonth()+1).padStart(2,"0"),n=String(r.getUTCDate()).padStart(2,"0");return`${e}-${t}-${n}`}function xf(r){return r.toISOString()}function Sf(r){let e=String(r.getUTCHours()).padStart(2,"0"),t=String(r.getUTCMinutes()).padStart(2,"0"),n=String(r.getUTCSeconds()).padStart(2,"0"),s=String(r.getUTCMilliseconds()).padStart(3,"0");return`${e}:${t}:${n}.${s}`}function Nf(r){return r?"true":"false"}function Cf(r){return r.toString()}function Of(r){return r.toString()}function Bf(r){let e="";for(let t=0;t<r.length;t+=32768)e+=String.fromCharCode.apply(null,r.subarray(t,t+32768));return btoa(e)}var ts=[],gi=new Map;function di(r){if(r===null||typeof r!="object")return null;for(let e=Object.getPrototypeOf(r);e!==null;e=Object.getPrototypeOf(e))for(let[t,n,s,i]of ts)if(t.prototype===e)return[n,s,i];return null}function es(r){if(r===null)return["NN",()=>"",!0];if(Je(r))return["N",Df,!1];if(r instanceof Uint8Array)return["RAW",Bf,!1];if(r instanceof Date){let e=Ur(r);return e==="D"?["D",Tf,!1]:e==="H"?["H",Sf,!1]:["DHZ",xf,!1]}return typeof r=="boolean"?["B",Nf,!0]:typeof r=="number"?Number.isInteger(r)?["L",Cf,!0]:["R",Of,!0]:di(r)}function If(r){return Jn(r)}function Rf(r){let[e,t,n]=r.split("-").map(Number);return new Date(Date.UTC(e,t-1,n,0,0,0,0))}function Po(r){return new Date(r)}function Mf(r){let[e,t,n]=r.split(":"),[s,i]=n.split(".");return new Date(Date.UTC(1970,0,1,Number(e),Number(t),Number(s),Number(i||0)))}function $f(r){return r.toLowerCase()==="true"}function Lf(r){return parseInt(r,10)}function Ff(r){return parseFloat(r)}function Uf(r){return r}function Pf(r){return null}var qf=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/;function jf(r){if(!qf.test(r))throw new Error(`RAW payload is not standard padded base64: '${r}'`);let e=atob(r),t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t}function Vf(r){return Uo(r)}var Hf=/^[A-Z]+$/,ft={N:[Object,If],D:[Date,Rf],DH:[Date,Po],DHZ:[Date,Po],H:[Date,Mf],L:[Number,Lf],R:[Number,Ff],T:[String,Uf],B:[Boolean,$f],QS:[Object,Vf],NN:[null,Pf],RAW:[Uint8Array,jf]};function Pr(r){return Object.hasOwn(ft,r)?ft[r][0]:null}function jo(r,e,t,n,s=!1){if(typeof e!="string"||!Hf.test(e))throw new Error(`TYTX suffix '${e}' is invalid: expected uppercase ASCII letters only`);let i=ft[e];if(i!==void 0&&i[0]!==r){let a=i[0]===null?"null":i[0].name;throw new Error(`TYTX suffix '${e}' is already registered for ${a}`)}ts=ts.filter(([a])=>a!==r),ts.push([r,e,t,s]),ft[e]=[r,n]}function _i(r){if(!r.tytxSuffix)throw new Error(`registerClass: ${r.name} is missing a static tytxSuffix`);if(typeof r.prototype?.toTytx!="function")throw new Error(`registerClass: ${r.name} is missing a toTytx method`);if(typeof r.fromTytx!="function")throw new Error(`registerClass: ${r.name} is missing a static fromTytx method`);return jo(r,r.tytxSuffix,e=>e.toTytx(),e=>r.fromTytx(e),r.tytxJsonNative||!1),r}function At(r,e){gi.set(r,e)}function xe(r){return gi.has(r)?gi.get(r):{}}var Vo={network:{maxAttempts:3,delay:1,backoff:2,jitter:!0,on:["TypeError","NetworkError","AbortError"]},aggressive:{maxAttempts:5,delay:.5,backoff:2,jitter:!0,on:["Error"]},gentle:{maxAttempts:2,delay:2,backoff:1.5,jitter:!1,on:["TypeError","NetworkError"]}};function Gf(r){let e=r._retryPolicy;return e==null?null:typeof e=="string"?Vo[e]||null:e}function Wf(r,e){return e.some(t=>t==="Error"?!0:r.name===t||r.constructor.name===t)}function Xf(r){return new Promise(e=>setTimeout(e,r))}async function Yf(r,e){if(!e)return r();let t=e.maxAttempts||3,n=e.delay||1,s=e.backoff||2,i=e.jitter!==!1,a=e.on||["Error"],o=null,u=n*1e3;for(let l=0;l<t;l++)try{let c=r();return c instanceof Promise?await c:c}catch(c){if(o=c,l<t-1&&Wf(c,a)){let d=u;i&&(d*=1+Math.random()*.1),await Xf(d),u*=s}else throw c}throw o}var ne=class r{static classKwargs={cacheTime:0,readOnly:!1,asBag:null,retryPolicy:null};static classArgs=[];static internalParams=new Set(["cacheTime","readOnly","asBag","retryPolicy"]);constructor(e={}){let n={...this.constructor.classKwargs,...e};this.cacheTime=n.cacheTime,this._readOnly=n.readOnly,this._asBag=n.asBag,this._retryPolicy=n.retryPolicy,this._kw={};let s=this.constructor.internalParams;for(let[i,a]of Object.entries(n))s.has(i)||(this._kw[i]=a);this._lastUpdate=null,this._node=null,this._lastEffectiveFingerprint=null,this._cachedValue=null,this.init()}init(){}setNode(e){e!==this._node&&!this.readOnly&&this._lastUpdate!==null&&this.reset(),this._node=e,this.onSetResolver(e)}onSetResolver(e){}get node(){return this._node}get cacheTime(){return this._cacheTime}set cacheTime(e){if(typeof e=="boolean")throw new TypeError("cacheTime must be numeric; use a negative value for infinite caching");this._cacheTime=e}get readOnly(){return this._readOnly}get expired(){return this._cacheTime<0?this._lastUpdate===null:this._cacheTime===0||this._lastUpdate===null?!0:(Date.now()-this._lastUpdate)/1e3>this._cacheTime}reset(){this._lastUpdate=null,this._lastEffectiveFingerprint=null}get cachedValue(){return!this.readOnly&&this._node?this._node._value:this._cachedValue}set cachedValue(e){!this.readOnly&&this._node?this._node.setValue(e,!1):this._cachedValue=e}_computeEffectiveFingerprint(e){return JSON.stringify(Object.entries(e).sort())}resolve(e={}){let{static:t=!1,...n}=e;if(t)return this._node?this._node._value:this.cachedValue;let s={...this._kw};if(this._node&&this._node.attr){let l=this.constructor.internalParams;for(let[c,d]of Object.entries(this._node.attr))!l.has(c)&&!(c in s)&&(s[c]=d)}Object.assign(s,n);let i=this._computeEffectiveFingerprint(s);if(i===this._lastEffectiveFingerprint&&!this.expired)return this.cachedValue;this._lastEffectiveFingerprint=i;let a=Gf(this),o=()=>this.load(s);if(a)return Yf(o,a).then(l=>this._finalize(l));let u=o();return u&&typeof u.then=="function"?u.then(l=>this._finalize(l)):this._finalize(u)}_finalize(e){let t;return this._asBag===!0?t=!0:this._asBag===!1?t=!1:t=!this._readOnly,t&&e!==null&&e!==void 0&&(e=this._convertToBag(e)),this._lastUpdate=Date.now(),(!this.readOnly||this.cacheTime!==0)&&(this.cachedValue=e),e}_convertToBag(e){let t=r._BagClass;if(!t||e&&typeof e._htraverse=="function")return e;if(typeof e=="string"){if(e=e.trim(),e.startsWith("<")&&t.fromXml)return t.fromXml(e);if((e.startsWith("{")||e.startsWith("["))&&t.fromJson)return t.fromJson(e)}return e}static registerBagClass(e){r._BagClass=e}load(e){return null}};ne._BagClass=null;var qr=class extends ne{static classKwargs={cacheTime:0,readOnly:!1,asBag:!1,retryPolicy:null,callback:null};static classArgs=["callback"];static internalParams=new Set(["cacheTime","readOnly","asBag","retryPolicy","callback"]);constructor(e={}){typeof e=="function"&&(e={callback:e}),super(e),this._callback=e.callback||null}load(e){return this._callback?this._callback.call(this,e):null}};var Oe=class r{constructor(e,t,n=null,s=null,i=null,a=null,o=null,u=!0){this.label=t,this._value=null,this._attr={},this._parentBag=null,this._resolver=null,this._nodeSubscribers={},this._onChangedValue=null,this.nodeTag=a,this.xmlTag=o,this._compiled=null,this.parentBag=e,s&&this.setAttr(s,!1,!0,u),n!==null&&this.setValue(n,!1),i&&(this.resolver=i)}get parentBag(){return this._parentBag}set parentBag(e){e===null&&this._value?.parentNode===this&&this._value.setBackref(),this._parentBag=e,e?.backref&&this._value&&typeof this._value._htraverse=="function"&&this._value.setBackref(this,e)}get value(){return this.getValue()}set value(e){this.setValue(e)}getValue(e=!1,t=null,n={}){if(t!==null){let s=H(`${t}::QS`);if(Array.isArray(s)){let i=s.length?s:Object.keys(this._attr),a=i.map(u=>{let l=this.getAttr(u);return!e&&l instanceof ne?l.resolve():l}),o=u=>s.length===0?Object.fromEntries(i.map((l,c)=>[l,u[c]])):u.length===1?u[0]:u;return a.some(u=>u&&typeof u.then=="function")?Promise.all(a).then(o):o(a)}else{if(!this._resolver)throw new Error("Cannot use kwargs syntax without resolver");n={...n,...s}}}return this._resolver!==null?this._resolver.resolve({static:e,...n}):this._value}setValue(e,t=!0,n=null,s=null,i=!0,a=null,o=!1){e instanceof ne?(this.resolver=e,e=null):e instanceof r&&(n=n||{},Object.assign(n,e._attr),e.resolver&&(this.resolver=e.resolver),e=e._value);let u=this._value;u!==e&&u?.parentNode===this&&u.setBackref(),this._value=e;let l=u!==this._value,c=t??!0,d=null;if(n!==null){let p={...this._attr};this.setAttr(n,!1,s,i);let h=this._buildAttrDiff(p,this._attr);d=Object.keys(h).length>0?h:null}t=c&&(l||d!==null);let f=d?l?"upd_value_attr":"upd_attrs":"upd_value";if(this._onChangedValue&&this._onChangedValue(this,e,u,c),t){let p=d!==null?{oldvalue:u,attrs_diff:d}:{oldvalue:u};for(let h of Object.values(this._nodeSubscribers))h({node:this,info:p,evt:f})}this._parentBag!==null&&this._parentBag.backref&&(e&&typeof e._htraverse=="function"&&e.setBackref(this,this._parentBag),t&&this._parentBag._onNodeChanged(this,[this.label],f,u,d,a,o))}replace(e){if(!(e instanceof r))throw new TypeError("BagNode.replace expects a BagNode");if(e===this)return this;let t=e.staticValue;t&&typeof t._htraverse=="function"&&(t=t.createChildBag().replace(t));let n=null;e.resolver&&(n=Object.create(Object.getPrototypeOf(e.resolver),Object.getOwnPropertyDescriptors(e.resolver)),n._node=null,n._kw={...e.resolver._kw});let s=this._value,i={...this._attr},a=this.resolver;a&&a._node===this&&(a._node=null),this.resolver=n,this.setValue(t,!1,{...e.attr},!1,!1,null);let o=this._buildAttrDiff(i,this._attr),u=Object.keys(o).length?o:null,l=s!==t||a!==n;if(l||u){let c=u?l?"upd_value_attr":"upd_attrs":"upd_value",d=u?{oldvalue:s,attrs_diff:u}:{oldvalue:s};for(let f of Object.values(this._nodeSubscribers))f({node:this,info:d,evt:c});this._parentBag!==null&&this._parentBag.backref&&this._parentBag._onNodeChanged(this,[this.label],c,s,u)}return this}get staticValue(){return this._value}set staticValue(e){this._value=e}get resolver(){return this._resolver}set resolver(e){this._resolver=e,e&&e.setNode&&e.setNode(this)}resetResolver(){if(!this._resolver)throw new Error("Cannot reset resolver: node has no resolver");this._resolver.reset(),this.setValue(null)}get attr(){return this._attr}getAttr(e=null,t=null){return e?e in this._attr?this._attr[e]:t:this._attr}_buildAttrDiff(e,t){let n={},s=new Set([...Object.keys(e),...Object.keys(t)]);for(let i of s){let a=i in e?e[i]:null,o=i in t?t[i]:null;a!==o&&(n[i]={old:a,new:o})}return n}setAttr(e=null,t=!0,n=!0,s=!0){let i=e||{},a=Object.keys(this._nodeSubscribers).length>0,u=t&&(a||this._parentBag!==null&&this._parentBag.backref)?{...this._attr}:null;if(n?Object.assign(this._attr,i):this._attr={...i},s)for(let l of Object.keys(this._attr))this._attr[l]===null&&delete this._attr[l];if(t&&u!==null){let l=this._buildAttrDiff(u,this._attr);if(Object.keys(l).length>0&&a)for(let c of Object.values(this._nodeSubscribers))c({node:this,info:{attrs_diff:l},evt:"upd_attrs"});if(Object.keys(l).length>0&&this._parentBag!==null&&this._parentBag.backref){let c=t===!0?"true":String(t);this._parentBag._onNodeChanged(this,[this.label],"upd_attrs",null,l,c)}}}delAttr(...e){for(let t of e)if(typeof t=="string"&&t.includes(","))for(let n of t.split(","))delete this._attr[n.trim()];else delete this._attr[t]}hasAttr(e,t=null){return e in this._attr?t!==null?this._attr[e]===t:!0:!1}getInheritedAttributes(){let e={};return this._parentBag&&this._parentBag.parentNode&&(e=this._parentBag.parentNode.getInheritedAttributes()),{...e,...this._attr}}subscribe(e,t){this._nodeSubscribers[e]=t}unsubscribe(e){delete this._nodeSubscribers[e]}get compiled(){return this._compiled||(this._compiled={}),this._compiled}get isBranch(){return this._value!=null&&typeof this._value._htraverse=="function"}get position(){return this._parentBag===null?null:this._parentBag._nodes.index(this.label)}get fullpath(){if(this._parentBag!==null){let e=this._parentBag.fullpath;return e?`${e}.${this.label}`:this.label}return null}get parentNode(){return this._parentBag?this._parentBag.parentNode:null}attributeOwnerNode(e,t=null){let n=this;if(t===null)for(;n&&!(e in n._attr);)n=n.parentNode;else for(;n&&n._attr[e]!==t;)n=n.parentNode;return n}asTuple(){return[this.label,this.value,this._attr,this._resolver||null]}isEqual(e){if(!(e instanceof r)||this.label!==e.label)return!1;let t=Object.keys(this._attr),n=Object.keys(e._attr);if(t.length!==n.length)return!1;for(let s of t)if(this._attr[s]!==e._attr[s])return!1;return this._resolver!==null?this._resolver===e._resolver:this._value&&typeof this._value.equalTo=="function"?this._value.equalTo(e._value):this._value&&typeof this._value.isEqual=="function"?this._value.isEqual(e._value):this._value===e._value}diff(e){if(this.label!==e.label)return`Other label: ${e.label}`;let t=Object.keys(this._attr),n=Object.keys(e._attr);return t.length!==n.length||t.some(s=>this._attr[s]!==e._attr[s])?`attributes self:${JSON.stringify(this._attr)} --- other:${JSON.stringify(e._attr)}`:this._value!==e._value?`value self:${this._value} --- other:${e._value}`:null}toJson(e=!0){let t=this.value;return t&&typeof t.toJson=="function"&&(t=t.toJson(e,!0)),{label:this.label,value:t,attr:this._attr}}toString(){return`BagNode : ${this.label}`}};var jr=class r{constructor(){this._dict=Object.create(null),this._list=[],this._parentBag=null}index(e){if(e in this._dict)return this._list.findIndex(n=>n.label===e);let t=e.match(/^#(\d+)$/);if(t){let n=parseInt(t[1],10);return n<this._list.length?n:-1}if(t=e.match(/^#(\w*)=(.*)$/),t){let[,n,s]=t,i=s.includes("::")?H(s):s;return n?this._list.findIndex(a=>a.getAttr(n)===i):this._list.findIndex(a=>a._value===i)}return-1}_parsePosition(e){let t=this._list.length;if(e==null||e===">")return t;if(typeof e=="number")return e<0&&(e=t+e),Math.max(0,Math.min(e,t));if(e==="<")return 0;if(e.startsWith("#")){let n=this._parseSharpIndex(e.slice(1),e);return Math.min(n,t)}if(e.startsWith("<")){let n=e.slice(1);if(n.startsWith("#")){let i=this._parseSharpIndex(n.slice(1),e);return Math.min(i,t)}let s=this.index(n);if(s<0)throw new Error(`Invalid node_position '${e}': label '${n}' not found`);return s}if(e.startsWith(">")){let n=e.slice(1);if(n.startsWith("#")){let i=this._parseSharpIndex(n.slice(1),e);return Math.min(i+1,t)}let s=this.index(n);if(s<0)throw new Error(`Invalid node_position '${e}': label '${n}' not found`);return s+1}throw new Error(`Invalid node_position '${e}': unrecognized syntax`)}_parseSharpIndex(e,t){if(!/^-?\d+$/.test(e))throw new Error(`Invalid node_position '${t}': '${e}' is not an integer`);let n=parseInt(e,10);if(n<0)throw new Error(`Invalid node_position '${t}': negative index not allowed in '#n' syntax`);return n}get(e){if(typeof e=="number")return e>=0&&e<this._list.length?this._list[e]:null;if(e.startsWith("#")){let t=this.index(e);return t>=0?this._list[t]:null}return this._dict[e]||null}set(e,t,n=">",s=null,i=null,a=null,o=!1,u=!0,l=null,c=!0,d=!1,f=null){let p=null;if(e.includes("?")&&([e,p]=e.split("?",2)),e==null||e.startsWith("#"))throw new Error("Cannot create new node with #n syntax");if(p){let m=p.split("&");if(m.length===1)s={[m[0]]:t};else{if(!Array.isArray(t)||t.length!==m.length)throw new Error("Wrong attributes assignment");s={};for(let g=0;g<m.length;g++)s[m[g]]=t[g]}t=null}let h=this._dict[e];if(h)f&&(h.nodeTag=f),a!==null&&(a===!1?h.resolver=null:h.resolver=a),p?h.setAttr(s,c,!0,u):h.setValue(t,c,s,o,u,l,d);else{let m=i&&i.nodeClass?i.nodeClass:Oe;h=new m(i,e,p?null:t,s,a,f,null,u);let g=this._parsePosition(n);this._dict[e]=h,this._list.splice(g,0,h),c&&i&&i.backref&&i._onNodeInserted(h,g,null,l,d)}return d&&h.setValue(null,!1),h}pop(e){let t=this.get(e);if(t){delete this._dict[t.label];let n=this._list.indexOf(t);return n>=0&&this._list.splice(n,1),t}return null}has(e){return e in this._dict}get length(){return this._list.length}clear(){this._dict=Object.create(null),this._list=[]}keys(){return this._list.map(e=>e.label)}values(){return this._list.map(e=>e.getValue())}items(){return this._list.map(e=>[e.label,e.getValue()])}[Symbol.iterator](){return this._list[Symbol.iterator]()}move(e,t,n=!0){if(t<0)return;let s=Array.isArray(e)?e:[e];if(s.length===0||t>=this._list.length)return;let i=this._list[t].label;if(s.length>1){let a=[...s].sort((c,d)=>c-d),o=a[0]<t?1:0,u=[];for(let c=a.length-1;c>=0;c--){let d=a[c];if(d>=0&&d<this._list.length){let f=this._list[d];this._list.splice(d,1),u.push(f),n&&this._parentBag&&this._parentBag.backref&&this._parentBag._onNodeDeleted(f,d)}}let l=this.index(i);l<0&&(l=this._list.length),l+=o;for(let c of u)this._list.splice(l,0,c),n&&this._parentBag&&this._parentBag.backref&&this._parentBag._onNodeInserted(c,l)}else{let a=s[0];if(a===t||a<0||a>=this._list.length)return;let o=this._list[a];this._list.splice(a,1),n&&this._parentBag&&this._parentBag.backref&&this._parentBag._onNodeDeleted(o,a),this._list.splice(t,0,o),n&&this._parentBag&&this._parentBag.backref&&this._parentBag._onNodeInserted(o,t)}}isEqual(e){if(!(e instanceof r)||this._list.length!==e._list.length)return!1;for(let t=0;t<this._list.length;t++){let n=this._list[t],s=e._list[t];if(!n.isEqual(s))return!1}return!0}};var Go=ji(li(),1);var bi="::RSLV:",Zf=new Map,Jf=new Map,rs=new WeakMap,J=class extends Error{constructor(e){super(e),this.name="BagSerializationError"}},Vr=class extends ne{constructor(e){super({asBag:!1}),rs.set(this,e)}get payload(){return rs.get(this)}load(){throw new J("This resolver is opaque; local execution is unavailable")}};function Ho(r){if(!r||typeof r!="object"||Array.isArray(r)||typeof r.resolver_module!="string"||typeof r.resolver_class!="string"||!Array.isArray(r.args??[])||!r.kwargs||typeof r.kwargs!="object"||Array.isArray(r.kwargs))throw new J("Invalid resolver description")}function zo(r,e=new Set){if(!(r===null||typeof r=="string"||typeof r=="boolean")&&!(typeof r=="number"&&Number.isFinite(r))){if(typeof r!="object"||e.has(r)||!Array.isArray(r)&&Object.getPrototypeOf(r)!==Object.prototype&&Object.getPrototypeOf(r)!==null)throw new J("Resolver parameters must be JSON data; callbacks cannot travel");e.add(r);for(let t of Object.values(r))zo(t,e);e.delete(r)}}function Hr(r){if(rs.has(r))return rs.get(r);let e=Jf.get(r.constructor);if(!e)throw new J(`Unregistered resolver: ${r.constructor.name}`);let t=e.encode(r),n={resolver_module:e.module,resolver_class:e.name,args:t.args??[],kwargs:t.kwargs??{}};return Ho(n),zo(n),bi+JSON.stringify(n)}function zr(r){if(typeof r!="string"||!r.startsWith(bi))return null;let e=r.slice(bi.length);if(/^[A-Za-z0-9_-]+\.[A-Za-z0-9_-]*\.[A-Za-z0-9_-]+$/.test(e))return new Vr(r);let t;try{t=JSON.parse(e)}catch{throw new J("Invalid resolver JSON or signed token")}Ho(t);let n=Zf.get(JSON.stringify([t.resolver_module,t.resolver_class]));if(!n)return new Vr(r);let s=n.decode({args:t.args??[],kwargs:t.kwargs});if(!(s instanceof n.cls))throw new J("Resolver decoder returned an incompatible instance");return s}function ns(r){return Object.fromEntries(Object.entries(r||{}).map(([e,t])=>[e,t instanceof ne?Hr(t):t]))}function ss(r){return Object.fromEntries(Object.entries(r||{}).map(([e,t])=>[e,zr(t)??t]))}var Be="__cls";function sr(r,e){return r!==null&&r.tytxSuffix===e?r:Pr(e)}function Kf(r){let e=r.tytxSuffix,t=Object.entries(xe(e)).filter(([,n])=>n===r).map(([n])=>n);if(t.length===0)throw new J(`${r.name} is not in the TYTX subtype dictionary of '${e}'`);if(t.length>1)throw new J(`${r.name} is in the TYTX subtype dictionary of '${e}' under several names: ${t.sort().join(", ")}`);return t[0]}function wi(r,e){let t=xe(r);if(!Object.hasOwn(t,e))throw new J(`Unknown Bag class '${e}' for TYTX type '${r}'`);return t[e]}function yi(r,e){return r===e?null:Kf(r)}function*Wo(r,e=""){for(let t of r){let n=e?`${e}.${t.label}`:t.label;yield[n,t];let s=t.getValue(!0);!t.resolver&&s instanceof P&&(yield*Wo(s,n))}}function Qf(r){let e=r.toISOString(),t=r.getUTCFullYear()===1970&&r.getUTCMonth()===0&&r.getUTCDate()===1,n=r.getUTCHours()===0&&r.getUTCMinutes()===0&&r.getUTCSeconds()===0&&r.getUTCMilliseconds()===0;if(n&&!t)return e.slice(0,e.indexOf("T"));let s=e.replace(/\.000Z$/,"Z");return t&&!n?s.slice(s.indexOf("T")+1):s}var P=class r{static tytxSuffix="X";constructor(e=null){this._nodes=new jr,this._backref=!1,this._parent=null,this._parentNode=null,this._rootAttributes=null,this._updSubscribers={},this._insSubscribers={},this._delSubscribers={},e&&this._loadSource(e)}get parent(){return this._parent}set parent(e){this._parent=e}get parentNode(){return this._parentNode}set parentNode(e){this._parentNode=e}get backref(){return!!this._backref}get nodeClass(){return Oe}createChildBag(){return new this.constructor}get fullpath(){if(this._parent!==null&&this._parentNode!==null){let e=this._parent.fullpath;return e?`${e}.${this._parentNode.label}`:this._parentNode.label}return null}relativePath(e){let t=[],n=e;for(;n!==null;){if(n.parentBag===this)return t.push(n.label),t.reverse(),t.join(".");t.push(n.label),n=n.parentNode}return null}get length(){return this._nodes.length}get root(){let e=this;for(;e.parent!==null;)e=e.parent;return e}get attributes(){return this._parentNode!==null?this._parentNode.getAttr():{}}get rootAttributes(){return this._rootAttributes}set rootAttributes(e){this._rootAttributes=e!==null?{...e}:null}_htraverseBefore(e){let t=this,n;for(typeof e=="string"?(e=e.replace(/\.\.\//g,"#parent."),n=e.split(".").filter(s=>s)):n=[...e];n.length&&n[0]==="#parent"&&t!==null;)n.shift(),t=t.parent;return[t,n]}_htraverse(e,t=!1,n=!0){let[s,i]=this._htraverseBefore(e);if(s===null)return[null,null];if(i.length===0)return[s,""];for(;i.length>1&&s instanceof r;){let a=i[0];if(a==="#parent"){if(s.parent===null||s.parent===void 0)break;i.shift(),s=s.parent;continue}let o=s._nodes.get(a);if(!o)break;let u=o.getValue(n);if(u instanceof r)i.shift(),s=u;else if(t){let l=s.createChildBag();o.setValue(l,!0,null,!0,!0,"autocreate"),i.shift(),s=l}else break}if(!t)return i.length>1?[null,null]:[s,i[0]];for(;i.length>1;){let a=i.shift();if(a.startsWith("#"))throw new Gr("Not existing index in #n syntax");let o=s.createChildBag();s._nodes.set(a,o,">",null,s,null,!1,!0,"autocreate"),s=o}return[s,i[0]]}get(e,t=null,n=!0,s={}){if(!e)return this;if(e==="#parent")return this.parent;let i=null;e.includes("?")&&([e,i]=e.split("?",2));let a=this._nodes.get(e);return a?a.getValue(n,i,s):t}getItem(e,t=null,n=!1,s={}){if(!e)return this;let[i,a]=this._htraverse(e,!1,n);return i instanceof r?i.get(a,t,n,s):t}setItem(e,t,n=null,s=">",i=!1,a=!0,o=null,u=!1,l=!0,c=null,d=null){if(e==="")throw new RangeError("setItem requires a non-empty path");let[f,p]=this._htraverse(e,!0);return f._nodes.set(p,t,s,n,f,c,i,a,o,l,u,d)}_pop(e,t=null){let n=this._nodes.index(e);if(n>=0){let s=this._nodes.pop(n);return this.backref&&this._onNodeDeleted(s,n,t),s}return null}pop(e,t=null,n=null){let s=this.popNode(e,n);return s?s.value:t}delItem(e,t=null,n=null){return this.pop(e,t,n)}popNode(e,t=null){let[n,s]=this._htraverse(e,!1,!0);if(!n||!s)return null;let i=n._nodes.get(s);if(!i)return null;try{return n._pop(s,t)}finally{i.parentBag===n&&n._nodes._dict[i.label]!==i&&(i.parentBag=null)}}clear(){let e=[...this._nodes];this._nodes.clear(),this.backref&&this._onNodeDeleted(e,-1);for(let t of e)t.parentBag=null}getNode(e,t=!0,n=!1,s=null){if(e==null||e==="")return this.parentNode;if(typeof e=="number")return this._nodes.get(e);typeof e=="string"&&(e=e.split("?",1)[0]);let[i,a]=this._htraverse(e,n,t);if(i instanceof r&&a){let o=i._nodes.get(a);if(o)return o;if(n)return i._nodes.set(a,s,">",null,i,null,!1,!0,"autocreate"),i._nodes.get(a)}return null}setBackref(e=null,t=null){let n=this._backref;if(this._backref=!0,this._parent=t,this._parentNode=e,!n){this._nodes._parentBag=this;for(let s of this)s.parentBag=this}}delParentRef(){this._parent=null,this._parentNode=null,this._backref=!1}clearBackref(){if(this._backref){this._backref=!1,this._parent=null,this._parentNode=null,this._nodes._parentBag=null;for(let e of this){e.parentBag=null;let t=e.getValue(!0);t instanceof r&&t.clearBackref()}}}_onNodeChanged(e,t,n,s=null,i=null,a=null,o=!1){for(let u of Object.values(this._updSubscribers))u({node:e,pathlist:t,oldvalue:s,attrs_diff:i,evt:n,reason:a,fired:o});this._parent&&this._parentNode&&this._parent._onNodeChanged(e,[this._parentNode.label,...t],n,s,i,a,o)}_onNodeInserted(e,t,n=null,s=null,i=!1){let a=e.parentBag,o=e.getValue(!0);a!==null&&a.backref&&o instanceof r&&o.setBackref(e,a),n===null&&(n=[]);for(let u of Object.values(this._insSubscribers))u({node:e,pathlist:n,ind:t,evt:"ins",reason:s,fired:i});this._parent&&this._parentNode&&this._parent._onNodeInserted(e,t,[this._parentNode.label,...n],s,i)}_onNodeDeleted(e,t,n=null,s=null){for(let i of Object.values(this._delSubscribers))i({node:e,pathlist:n,ind:t,evt:"del",reason:s});this._parent&&this._parentNode&&(n===null&&(n=[]),this._parent._onNodeDeleted(e,t,[this._parentNode.label,...n],s))}_subscribe(e,t,n){n!=null&&(t[e]=n)}subscribe(e,{update:t=null,insert:n=null,delete:s=null,any:i=null}={}){this.backref||this.setBackref(),this._subscribe(e,this._updSubscribers,t||i),this._subscribe(e,this._insSubscribers,n||i),this._subscribe(e,this._delSubscribers,s||i)}unsubscribe(e,{update:t=!1,insert:n=!1,delete:s=!1,any:i=!1}={}){(t||i)&&delete this._updSubscribers[e],(n||i)&&delete this._insSubscribers[e],(s||i)&&delete this._delSubscribers[e]}[Symbol.iterator](){return this._nodes[Symbol.iterator]()}keys(){return this._nodes.keys()}values(){return this._nodes.values()}items(){return[...this._nodes].map(e=>({key:e.label,value:e.getValue()}))}get nodes(){return this.getNodes()}node(e){return this._nodes.get(e)}setAttr(e=null,t=null,n=!0){let s=r.prototype.getNode.call(this,e,!0,!0);s&&s.setAttr(t,!0,!0,n)}getAttr(e=null,t=null,n=null){let s=this.getNode(e);return s?s.getAttr(t,n):n}delAttr(e=null,...t){let n=this.getNode(e);n&&n.delAttr(...t)}getInheritedAttributes(){return this._parentNode?this._parentNode.getInheritedAttributes():{}}getNodes(e=null){return e?[...this._nodes].filter(t=>e(t)):[...this._nodes]}getNodeByValue(e,t){for(let n of this._nodes){let s=n.value;if(s instanceof r){if(s.getItem(e)===t)return n}else if(s&&s.get&&s.get(e)===t)return n}return null}getNodeByAttr(e,t,n=!1,s=!1){let i=t===void 0,a=n&&typeof t=="string"?t.toLowerCase():t,o=u=>{let l=[];for(let c of u._nodes){if(e in c.attr){let d=n&&typeof c.attr[e]=="string"?c.attr[e].toLowerCase():c.attr[e];if(i||d==a)return c}if(c._value instanceof r)if(s){let d=o(c._value);if(d)return d}else l.push(c._value)}for(let c of l){let d=o(c);if(d)return d}return null};return o(this)}isEmpty(e=!1,t=!1){if(this._nodes.length===0)return!0;for(let n of this._nodes){if(n._resolver!==null)return!1;let s=n.getValue(!0);if(s!=null&&!(e&&s===0)&&!(t&&s===""))return!1}return!0}query(e=null,t=null,n=!1,s=!1,i=!0,a=!0,o=null,u=!0){e||(e="#k,#v,#a");let l=this,c;if(typeof e=="string"){if(e.includes(":")){let[p,h]=e.split(":");l=this.getItem(p),e=h}c=e.split(",").map(p=>p.trim())}else c=e;let d=(p,h,m,g,b)=>{if(h==="#k")return p.label;if(h==="#p")return m;if(h==="#n")return p;if(typeof h=="function")return h(p);if(h==="#v"){let v=b();return g&&v instanceof r?null:v}else if(h.startsWith("#v.")){let v=h.split(".").slice(1).join("."),w=b();return w&&w.getItem?w.getItem(v):null}else{if(h==="#__v")return p.getValue(!0);if(h.startsWith("#a")){let v=h.includes(".")?h.split(".").slice(1).join("."):null;return p.getAttr(v)}else{let v=b();return v&&v.getItem?v.getItem(h):null}}};function*f(){let p=0;function*h(m,g){for(let b of m._nodes){let v=g?`${g}.${b.label}`:b.label,w=!1,k,I=()=>(w||(k=b.getValue(u),w=!0),k);if((i&&a||(I()instanceof r?a:i))&&(t===null||t(b))&&(yield c.length===1?d(b,c[0],v,s,I):c.map(Y=>d(b,Y,v,s,I)),p++,o!==null&&p>=o))return;if(s){let Y=I();if(Y instanceof r&&(yield*h(Y,v),o!==null&&p>=o))return}}}yield*h(l,"")}return n?f():[...f()]}getLeaves(){let e=[],t=(n,s)=>{for(let i of n._nodes){let a=s?`${s}.${i.label}`:i.label,o=i.getValue(!1);o instanceof r?t(o,a):e.push([a,o])}};return t(this,""),e}digest(e=null,t=null,n=!1){typeof t=="boolean"&&(console.warn("Bag.digest(what, asColumns) is deprecated; use digest(what, null, asColumns)."),n=t,t=null);let s=this.query(e,t,!1,!1,!0,!0,null,!1);if(n){if(!s||s.length===0)return(typeof e=="string"?e:"#k,#v,#a").split(",").map(u=>u.trim()).map(()=>[]);let i=[...s];if(i.length&&Array.isArray(i[0])){let a=i[0].length,o=[];for(let u=0;u<a;u++)o.push(i.map(l=>l[u]));return o}return[i]}return[...s]}columns(e,t=!1){typeof e=="string"&&(e=e.split(","));let n=t?"#a.":"",s=e.map(i=>`${n}${i}`).join(",");return this.digest(s,null,!0)}sum(e="#v",t=!1,n=null){if(t!=null&&typeof t!="boolean")throw new TypeError("sum strict must be a boolean; pass condition as the third argument");if(n!=null&&typeof n!="function")throw new TypeError("sum condition must be callable; deep is no longer supported");let s=i=>{let a=0,o=!1;for(let u of this.query(i,n)){if(u==null||u===""){o=!0;continue}if(typeof u!="number"&&typeof u!="boolean"){if(t)throw new TypeError(`sum encountered non-numeric value: ${typeof u}`);continue}a+=u}return t&&o?null:a};return e.includes(",")?e.split(",").map(i=>s(i.trim())):s(e)}sort(e="#k:a"){let t=(s,i)=>s==null?[-1,""]:i&&typeof s=="string"?[0,s.toLowerCase()]:[0,s],n=(s,i)=>s[0]!==i[0]?s[0]-i[0]:s[1]<i[1]?-1:s[1]>i[1]?1:0;if(typeof e=="function")this._nodes._list.sort((s,i)=>{let a=e(s),o=e(i);return a<o?-1:a>o?1:0});else{let s=e.split(",");s.reverse();for(let i of s){let a,o;i.includes(":")?[a,o]=i.split(":",2):(a=i,o="a"),a=a.trim(),o=o.trim();let u=o==="d"||o==="D",l=o==="a"||o==="d",c;if(a.toLowerCase()==="#k")c=d=>t(d.label,l);else if(a.toLowerCase()==="#v")c=d=>t(d.value,l);else if(a.toLowerCase().startsWith("#a.")){let d=a.slice(3);c=f=>t(f.getAttr(d),l)}else c=d=>{let f=d.value,p=f instanceof r?f.getItem(a):f?f[a]:null;return t(p,l)};this._nodes._list.sort((d,f)=>{let p=n(c(d),c(f));return u?-p:p})}}return this}equalTo(e){return e instanceof r?this._nodes.isEqual(e._nodes):!1}has(e){if(typeof e=="string"){let t=null;e.includes("?")&&([e,t]=e.split("?",2));let n=this.getNode(e);return n===null?!1:t===null?!0:t.split("&").every(s=>s in n.attr)}else if(e&&e.label!==void 0)return[...this._nodes].includes(e);return!1}getResolver(e){let t=this.getNode(e);return t?t.resolver:null}setResolver(e,t){let n=this.getNode(e);n||(this.setItem(e,null),n=this.getNode(e)),n.resolver=t}setCallbackItem(e,t,n={}){let s=new qr({callback:t,...n});this.setResolver(e,s)}move(e,t,n=!0){this._nodes.move(e,t,n)}asDict(e=!1,t=!1,n=!1,s=!1){let i={};for(let a of this._nodes){let o=a.value;if(s&&o==null)continue;let u=a.label;e&&(u=String(u)),t&&(u=u.toLowerCase()),n&&o instanceof r&&(o=r.prototype.asDict.call(o,e,t,n,s)),Object.defineProperty(i,u,{value:o,enumerable:!0,writable:!0,configurable:!0})}return i}setdefault(e,t=null){let n=this.getNode(e);return n?n.value:(this.setItem(e,t),t)}deepcopy(e=!1){let t=this.createChildBag();for(let n of this._nodes){let s=n.getValue(!e);s instanceof r&&(s=s.deepcopy(e));let i=new t.nodeClass(t,n.label,s);i.setAttr({...n.attr},!1,!1,!1),i.nodeTag=n.nodeTag,i.xmlTag=n.xmlTag,t._nodes._list.push(i),t._nodes._dict[i.label]=i}return t}update(e,t=null,n=null,s=!1){if(!(e instanceof r)){for(let i in e){let a=e[i];(!s||a!==null||!this._nodes.has(i))&&this.setItem(i,a,null,">",!1,!1,n,!1,n!==!1)}return}for(let i of[...e]){let a=i.label,o=t==="static"?i.resolver:null,u=o?null:i.getValue(),l=i.attr.__replace;delete i.attr.__replace;let c=this._nodes.get(a);if(c)if(c.setAttr(i.attr,n===null?!0:n,!0,!1),i.nodeTag!=null&&(c.nodeTag=i.nodeTag),i.xmlTag!=null&&(c.xmlTag=i.xmlTag),o)c.resolver=o,c.setValue(null,n===null?!0:n,null,null,!1,n);else{i.resolver&&(c.resolver=null);let d=c.getValue();u instanceof r&&d instanceof r&&!l?d.update(u,t,n,s):(!s||u!==null)&&c.setValue(u,n===null?!0:n,null,null,!1,n)}else{let d=this.setItem(a,o||u,i.attr,">",!1,!1,n,!1,n!==!1);d.nodeTag=i.nodeTag,d.xmlTag=i.xmlTag}}}_fillFromBag(e){this.clear();for(let t of e){let n=new this.nodeClass(this,t.label);n.replace(t),n.nodeTag=t.nodeTag,n.xmlTag=t.xmlTag,this._nodes._list.push(n),this._nodes._dict[n.label]=n}}_fillFromDict(e){this.clear();for(let[t,n]of Object.entries(e))n!==null&&typeof n=="object"&&!Array.isArray(n)&&!(n instanceof r)&&!(n instanceof Oe)?this.setItem(t,this.createChildBag()._loadSource(n)):this.setItem(t,n)}_loadSource(e){if(e==null)return this;let t=this.createChildBag();if(e instanceof r)t._fillFromBag(e);else if(typeof e=="object"&&!Array.isArray(e))t._fillFromDict(e);else return this;return this._replacePrepared(t)}replace(e){if(!(e instanceof r))throw new TypeError("Bag.replace expects a Bag");if(e===this)return this;let t=this.createChildBag();return t._fillFromBag(e),this._replacePrepared(t)}_replacePrepared(e){for(let n of this._nodes){n.parentBag=null;let s=n.getValue(!0);s instanceof r&&s.clearBackref()}let t=this._nodes;this._nodes=e._nodes,e._nodes=t,this._nodes._parentBag=this.backref?this:null,e._nodes._parentBag=null;for(let n of this._nodes)n.parentBag=this;for(let n of e._nodes)n._parentBag=e;return this.backref&&this.parent&&this.parentNode&&this.parent._onNodeChanged(this.parentNode,[this.parentNode.label],"upd_value",e),this}forEach(e,{static:t=!0,deep:n=!1,kwargs:s={}}={}){if(typeof e!="function")throw new TypeError("forEach requires a callback");let i=(a,o)=>{for(let u=0;u<a._nodes.length;u++){let l=a._nodes._list[u],c={...o};"_pathlist"in o&&(c._pathlist=[...o._pathlist,l.label]),"_indexlist"in o&&(c._indexlist=[...o._indexlist,u]);let d=e(l,c,u);if(d)return d;if(d==null&&n){let f=l.getValue(t);if(f instanceof r){let p=i(f,c);if(p)return p}}}return null};return i(this,s)}*traverse(){for(let e of this._nodes){yield e;let t=e.getValue(!0);t instanceof r&&(yield*t.traverse())}}*_iterNodesWithPaths(e=!0,t=""){for(let n of this._nodes){let s=t?`${t}.${n.label}`:n.label;yield[s,n];let i=n.getValue(e);i instanceof r&&(yield*i._iterNodesWithPaths(e,s))}}*_nodeFlattener(e=null){let t=e!==null,n=t?Object.create(null):null,s=0,i=new Map([["",this.constructor]]);for(let[a,o]of Wo(this)){let u=a.lastIndexOf("."),l=u>=0?a.slice(0,u):"",c=o.getValue(!0),d,f=null;if(o.resolver)d=Hr(o.resolver);else if(c instanceof r){let m=c.constructor,g=m.tytxSuffix;i.set(a,m),f=yi(m,sr(i.get(l),g)),d=`::${g}`}else c===null?d="::NN":d=c;if(o.attr&&Object.hasOwn(o.attr,Be))throw new J(`node '${a}': the attribute '${Be}' is reserved for the Bag class name`);let p=ns(o.attr);f!==null&&(p[Be]=f);let h=o.nodeTag;t?(yield[l?n[l]:null,o.label,h,d,p],c instanceof r&&(n[a]=s,e[s]=a,s++)):yield[l,o.label,h,d,p]}}toTytx(e="json",t=!1){let n;if(t){let o={};n={rows:[...this._nodeFlattener(o)],paths:o}}else n={rows:[...this._nodeFlattener(null)]};let s=this.constructor,i=yi(s,sr(null,s.tytxSuffix));return i!==null&&(n[Be]=i),le(n,e==="json"?null:e)}static fromTytx(e,t="json"){let n=this.tytxSuffix;if(e==="")return new(sr(null,n));let s=H(e,t==="json"?null:t);if(!s||!Array.isArray(s.rows))throw new J("Invalid TYTX Bag: expected rows");let i=s.paths,a=i!=null,o=Object.hasOwn(s,Be)?wi(n,s[Be]):sr(null,n),u=new o,l=new Map([["",u]]);for(let c of s.rows){if(!Array.isArray(c)||c.length!==5)throw new J("Invalid TYTX Bag row");let[d,f,p,h,m]=c,g=d??"";if(a){if(d!==null&&!Object.hasOwn(i,d))throw new J(`Unknown TYTX parent reference: ${d}`);g=d===null?"":i[d]}if(!l.has(g))throw new J(`Missing or undecodable TYTX parent branch: ${g}`);let b=l.get(g),v=g?`${g}.${f}`:f,w=h;if(t==="msgpack"&&typeof w=="string"&&w.startsWith("::")){let X=Pr(w.slice(2));(X===r||X?.prototype instanceof r)&&(w=H(w))}let k=zr(w),I=ss(m),L=Object.hasOwn(I,Be)?I[Be]:null;if(delete I[Be],w instanceof r){let X=w.constructor.tytxSuffix,re=L!==null?wi(X,L):sr(b.constructor,X);w=new re,l.set(v,w)}else{if(L!==null)throw new J(`node '${v}': the attribute '${Be}' is reserved for the Bag class name of a branch`);w==="::NN"&&(w=null)}let Y=b.setItem(f,k||w,I);Y.nodeTag=p??null}return u}toXml(e={}){let{pretty:t=!1,encoding:n="UTF-8",docHeader:s=null,selfClosedTags:i=null}=e,a=this._bagToXml(i,t);return s===!0?a=`<?xml version='1.0' encoding='${n}'?>
13
+ `)}function Oo(r){if(r=r||{},r.locator===void 0&&(r.locator=!0),this.assign=r.assign||kt.assign,this.domHandler=r.domHandler||Xn,this.onError=r.onError||r.errorHandler,r.errorHandler&&typeof r.errorHandler!="function")throw new TypeError("errorHandler object is no longer supported, switch to onError!");r.errorHandler&&r.errorHandler("warning","The `errorHandler` option has been deprecated, use `onError` instead!",this),this.normalizeLineEndings=r.normalizeLineEndings||Co,this.locator=!!r.locator,this.xmlns=this.assign(Object.create(null),r.xmlns)}Oo.prototype.parseFromString=function(r,e){if(!bf(e))throw new TypeError('DOMParser.parseFromString: the provided mimeType "'+e+'" is not valid.');var t=this.assign(Object.create(null),this.xmlns),n=Do.XML_ENTITIES,s=t[""]||null;gf(e)?(n=Do.HTML_ENTITIES,s=fi.HTML):e===No.XML_SVG_IMAGE&&(s=fi.SVG),t[""]=s,t.xml=t.xml||fi.XML;var i=new this.domHandler({mimeType:e,defaultNamespace:s,onError:this.onError}),a=this.locator?{}:void 0;this.locator&&i.setDocumentLocator(a);var o=new wf;o.errorHandler=i,o.domBuilder=i;var l=!kt.isHTMLMimeType(e);return l&&typeof r!="string"&&o.errorHandler.fatalError("source is not a string"),o.parse(this.normalizeLineEndings(String(r)),t,n),i.doc.documentElement||o.errorHandler.fatalError("missing root element"),i.doc};function Xn(r){var e=r||{};this.mimeType=e.mimeType||No.XML_APPLICATION,this.defaultNamespace=e.defaultNamespace||null,this.cdata=!1,this.currentElement=void 0,this.doc=void 0,this.locator=void 0,this.onError=e.onError}function er(r,e){e.lineNumber=r.lineNumber,e.columnNumber=r.columnNumber}Xn.prototype={startDocument:function(){var r=new mf;this.doc=_f(this.mimeType)?r.createHTMLDocument(!1):r.createDocument(this.defaultNamespace,"")},startElement:function(r,e,t,n){var s=this.doc,i=s.createElementNS(r,t||e),a=n.length;Wn(this,i),this.currentElement=i,this.locator&&er(this.locator,i);for(var o=0;o<a;o++){var r=n.getURI(o),l=n.getValue(o),t=n.getQName(o),u=s.createAttributeNS(r,t);this.locator&&er(n.getLocator(o),u),u.value=u.nodeValue=l,i.setAttributeNode(u)}},endElement:function(r,e,t){this.currentElement=this.currentElement.parentNode},startPrefixMapping:function(r,e){},endPrefixMapping:function(r){},processingInstruction:function(r,e){var t=this.doc.createProcessingInstruction(r,e);this.locator&&er(this.locator,t),Wn(this,t)},ignorableWhitespace:function(r,e,t){},characters:function(r,e,t){if(r=So.apply(this,arguments),r){if(this.cdata)var n=this.doc.createCDATASection(r);else var n=this.doc.createTextNode(r);this.currentElement?this.currentElement.appendChild(n):/^\s*$/.test(r)&&this.doc.appendChild(n),this.locator&&er(this.locator,n)}},skippedEntity:function(r){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(r){r&&(r.lineNumber=0),this.locator=r},comment:function(r,e,t){r=So.apply(this,arguments);var n=this.doc.createComment(r);this.locator&&er(this.locator,n),Wn(this,n)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(r,e,t,n){var s=this.doc.implementation;if(s&&s.createDocumentType){var i=s.createDocumentType(r,e,t,n);this.locator&&er(this.locator,i),Wn(this,i),this.doc.doctype=i}},reportError:function(r,e){if(typeof this.onError=="function")try{this.onError(r,e,this)}catch(t){throw new xo("Reporting "+r+' "'+e+'" caused '+t,this.locator)}else console.error("[xmldom "+r+"] "+e,yf(this.locator))},warning:function(r){this.reportError("warning",r)},error:function(r){this.reportError("error",r)},fatalError:function(r,e){throw this.reportError("fatalError",r),new xo(r,this.locator,e)}};function yf(r){if(r)return`
14
+ @#[line:`+r.lineNumber+",col:"+r.columnNumber+"]"}function So(r,e,t){return typeof r=="string"?r.substr(e,t):r.length>=e+t||e?new java.lang.String(r,e,t)+"":r}"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(r){Xn.prototype[r]=function(){return null}});function Wn(r,e){r.currentElement?r.currentElement.appendChild(e):r.doc.appendChild(e)}function vf(r){if(r==="error")throw"onErrorStopParsing"}function Ef(){throw"onWarningStopParsing"}tr.__DOMHandler=Xn;tr.DOMParser=Oo;tr.normalizeLineEndings=Co;tr.onErrorStopParsing=vf;tr.onWarningStopParsing=Ef});var pi=et(M=>{"use strict";var rr=vt();M.assign=rr.assign;M.hasDefaultHTMLNamespace=rr.hasDefaultHTMLNamespace;M.isHTMLMimeType=rr.isHTMLMimeType;M.isValidMimeType=rr.isValidMimeType;M.MIME_TYPE=rr.MIME_TYPE;M.NAMESPACE=rr.NAMESPACE;var Yn=xr();M.DOMException=Yn.DOMException;M.DOMExceptionName=Yn.DOMExceptionName;M.ExceptionCode=Yn.ExceptionCode;M.ParseError=Yn.ParseError;var re=ci();M.Attr=re.Attr;M.CDATASection=re.CDATASection;M.CharacterData=re.CharacterData;M.Comment=re.Comment;M.Document=re.Document;M.DocumentFragment=re.DocumentFragment;M.DocumentType=re.DocumentType;M.DOMImplementation=re.DOMImplementation;M.Element=re.Element;M.Entity=re.Entity;M.EntityReference=re.EntityReference;M.LiveNodeList=re.LiveNodeList;M.NamedNodeMap=re.NamedNodeMap;M.Node=re.Node;M.NodeList=re.NodeList;M.Notation=re.Notation;M.ProcessingInstruction=re.ProcessingInstruction;M.Text=re.Text;M.XMLSerializer=re.XMLSerializer;var Zn=Bo();M.DOMParser=Zn.DOMParser;M.normalizeLineEndings=Zn.normalizeLineEndings;M.onErrorStopParsing=Zn.onErrorStopParsing;M.onWarningStopParsing=Zn.onWarningStopParsing});var Me=class{constructor(e,{fetcher:t=globalThis.fetch?.bind(globalThis),closeUrl:n="/gramlot/close",navigator:s=globalThis.navigator}={}){this.rpcUrl=e,this.fetcher=t,this.closeUrl=n,this.navigator=s}async call(e,t){let n=await this.fetcher(this.rpcUrl,{method:"POST",credentials:"same-origin",signal:t,headers:{"Content-Type":"application/json"},body:e});if(n.status!==200)throw new Error(`rpc failed: HTTP ${n.status}`);return n.text()}close(e,{beacon:t=!1}={}){let n=JSON.stringify({pageId:e});if(t)try{this.navigator.sendBeacon(this.closeUrl,new Blob([n],{type:"application/json"}))}catch{}else try{Promise.resolve(this.fetcher(this.closeUrl,{method:"POST",credentials:"same-origin",keepalive:!0,headers:{"Content-Type":"application/json"},body:n})).catch(()=>{})}catch{}}};var $t=9e15,st=1e9,Cs="0123456789abcdef",vn="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",En="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",Os={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-$t,maxE:$t,crypto:!1},Ki,Ge,S=!0,An="[DecimalError] ",nt=An+"Invalid argument: ",Qi=An+"Precision limit exceeded",ea=An+"crypto unavailable",ta="[object Decimal]",ue=Math.floor,ee=Math.pow,ru=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,nu=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,su=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,ra=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Ne=1e7,A=7,iu=9007199254740991,au=vn.length-1,Bs=En.length-1,_={toStringTag:ta};_.absoluteValue=_.abs=function(){var r=new this.constructor(this);return r.s<0&&(r.s=1),E(r)};_.ceil=function(){return E(new this.constructor(this),this.e+1,2)};_.clampedTo=_.clamp=function(r,e){var t,n=this,s=n.constructor;if(r=new s(r),e=new s(e),!r.s||!e.s)return new s(NaN);if(r.gt(e))throw Error(nt+e);return t=n.cmp(r),t<0?r:n.cmp(e)>0?e:new s(n)};_.comparedTo=_.cmp=function(r){var e,t,n,s,i=this,a=i.d,o=(r=new i.constructor(r)).d,l=i.s,u=r.s;if(!a||!o)return!l||!u?NaN:l!==u?l:a===o?0:!a^l<0?1:-1;if(!a[0]||!o[0])return a[0]?l:o[0]?-u:0;if(l!==u)return l;if(i.e!==r.e)return i.e>r.e^l<0?1:-1;for(n=a.length,s=o.length,e=0,t=n<s?n:s;e<t;++e)if(a[e]!==o[e])return a[e]>o[e]^l<0?1:-1;return n===s?0:n>s^l<0?1:-1};_.cosine=_.cos=function(){var r,e,t=this,n=t.constructor;return t.d?t.d[0]?(r=n.precision,e=n.rounding,n.precision=r+Math.max(t.e,t.sd())+A,n.rounding=1,t=ou(n,oa(n,t)),n.precision=r,n.rounding=e,E(Ge==2||Ge==3?t.neg():t,r,e,!0)):new n(1):new n(NaN)};_.cubeRoot=_.cbrt=function(){var r,e,t,n,s,i,a,o,l,u,c=this,d=c.constructor;if(!c.isFinite()||c.isZero())return new d(c);for(S=!1,i=c.s*ee(c.s*c,1/3),!i||Math.abs(i)==1/0?(t=ie(c.d),r=c.e,(i=(r-t.length+1)%3)&&(t+=i==1||i==-2?"0":"00"),i=ee(t,1/3),r=ue((r+1)/3)-(r%3==(r<0?-1:2)),i==1/0?t="5e"+r:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+r),n=new d(t),n.s=c.s):n=new d(i.toString()),a=(r=d.precision)+3;;)if(o=n,l=o.times(o).times(o),u=l.plus(c),n=j(u.plus(c).times(o),u.plus(l),a+2,1),ie(o.d).slice(0,a)===(t=ie(n.d)).slice(0,a))if(t=t.slice(a-3,a+1),t=="9999"||!s&&t=="4999"){if(!s&&(E(o,r+1,0),o.times(o).times(o).eq(c))){n=o;break}a+=4,s=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(E(n,r+1,1),e=!n.times(n).times(n).eq(c));break}return S=!0,E(n,r,d.rounding,e)};_.decimalPlaces=_.dp=function(){var r,e=this.d,t=NaN;if(e){if(r=e.length-1,t=(r-ue(this.e/A))*A,r=e[r],r)for(;r%10==0;r/=10)t--;t<0&&(t=0)}return t};_.dividedBy=_.div=function(r){return j(this,new this.constructor(r))};_.dividedToIntegerBy=_.divToInt=function(r){var e=this,t=e.constructor;return E(j(e,new t(r),0,1,1),t.precision,t.rounding)};_.equals=_.eq=function(r){return this.cmp(r)===0};_.floor=function(){return E(new this.constructor(this),this.e+1,3)};_.greaterThan=_.gt=function(r){return this.cmp(r)>0};_.greaterThanOrEqualTo=_.gte=function(r){var e=this.cmp(r);return e==1||e===0};_.hyperbolicCosine=_.cosh=function(){var r,e,t,n,s,i=this,a=i.constructor,o=new a(1);if(!i.isFinite())return new a(i.s?1/0:NaN);if(i.isZero())return o;t=a.precision,n=a.rounding,a.precision=t+Math.max(i.e,i.sd())+4,a.rounding=1,s=i.d.length,s<32?(r=Math.ceil(s/3),e=(1/Dn(4,r)).toString()):(r=16,e="2.3283064365386962890625e-10"),i=Lt(a,1,i.times(e),new a(1),!0);for(var l,u=r,c=new a(8);u--;)l=i.times(i),i=o.minus(l.times(c.minus(l.times(c))));return E(i,a.precision=t,a.rounding=n,!0)};_.hyperbolicSine=_.sinh=function(){var r,e,t,n,s=this,i=s.constructor;if(!s.isFinite()||s.isZero())return new i(s);if(e=i.precision,t=i.rounding,i.precision=e+Math.max(s.e,s.sd())+4,i.rounding=1,n=s.d.length,n<3)s=Lt(i,2,s,s,!0);else{r=1.4*Math.sqrt(n),r=r>16?16:r|0,s=s.times(1/Dn(5,r)),s=Lt(i,2,s,s,!0);for(var a,o=new i(5),l=new i(16),u=new i(20);r--;)a=s.times(s),s=s.times(o.plus(a.times(l.times(a).plus(u))))}return i.precision=e,i.rounding=t,E(s,e,t,!0)};_.hyperbolicTangent=_.tanh=function(){var r,e,t=this,n=t.constructor;return t.isFinite()?t.isZero()?new n(t):(r=n.precision,e=n.rounding,n.precision=r+7,n.rounding=1,j(t.sinh(),t.cosh(),n.precision=r,n.rounding=e)):new n(t.s)};_.inverseCosine=_.acos=function(){var r=this,e=r.constructor,t=r.abs().cmp(1),n=e.precision,s=e.rounding;return t!==-1?t===0?r.isNeg()?$e(e,n,s):new e(0):new e(NaN):r.isZero()?$e(e,n+4,s).times(.5):(e.precision=n+6,e.rounding=1,r=new e(1).minus(r).div(r.plus(1)).sqrt().atan(),e.precision=n,e.rounding=s,r.times(2))};_.inverseHyperbolicCosine=_.acosh=function(){var r,e,t=this,n=t.constructor;return t.lte(1)?new n(t.eq(1)?0:NaN):t.isFinite()?(r=n.precision,e=n.rounding,n.precision=r+Math.max(Math.abs(t.e),t.sd())+4,n.rounding=1,S=!1,t=t.times(t).minus(1).sqrt().plus(t),S=!0,n.precision=r,n.rounding=e,t.ln()):new n(t)};_.inverseHyperbolicSine=_.asinh=function(){var r,e,t=this,n=t.constructor;return!t.isFinite()||t.isZero()?new n(t):(r=n.precision,e=n.rounding,n.precision=r+2*Math.max(Math.abs(t.e),t.sd())+6,n.rounding=1,S=!1,t=t.times(t).plus(1).sqrt().plus(t),S=!0,n.precision=r,n.rounding=e,t.ln())};_.inverseHyperbolicTangent=_.atanh=function(){var r,e,t,n,s=this,i=s.constructor;return s.isFinite()?s.e>=0?new i(s.abs().eq(1)?s.s/0:s.isZero()?s:NaN):(r=i.precision,e=i.rounding,n=s.sd(),Math.max(n,r)<2*-s.e-1?E(new i(s),r,e,!0):(i.precision=t=n-s.e,s=j(s.plus(1),new i(1).minus(s),t+r,1),i.precision=r+4,i.rounding=1,s=s.ln(),i.precision=r,i.rounding=e,s.times(.5))):new i(NaN)};_.inverseSine=_.asin=function(){var r,e,t,n,s=this,i=s.constructor;return s.isZero()?new i(s):(e=s.abs().cmp(1),t=i.precision,n=i.rounding,e!==-1?e===0?(r=$e(i,t+4,n).times(.5),r.s=s.s,r):new i(NaN):(i.precision=t+6,i.rounding=1,s=s.div(new i(1).minus(s.times(s)).sqrt().plus(1)).atan(),i.precision=t,i.rounding=n,s.times(2)))};_.inverseTangent=_.atan=function(){var r,e,t,n,s,i,a,o,l,u=this,c=u.constructor,d=c.precision,f=c.rounding;if(u.isFinite()){if(u.isZero())return new c(u);if(u.abs().eq(1)&&d+4<=Bs)return a=$e(c,d+4,f).times(.25),a.s=u.s,a}else{if(!u.s)return new c(NaN);if(d+4<=Bs)return a=$e(c,d+4,f).times(.5),a.s=u.s,a}for(c.precision=o=d+10,c.rounding=1,t=Math.min(28,o/A+2|0),r=t;r;--r)u=u.div(u.times(u).plus(1).sqrt().plus(1));for(S=!1,e=Math.ceil(o/A),n=1,l=u.times(u),a=new c(u),s=u;r!==-1;)if(s=s.times(l),i=a.minus(s.div(n+=2)),s=s.times(l),a=i.plus(s.div(n+=2)),a.d[e]!==void 0)for(r=e;a.d[r]===i.d[r]&&r--;);return t&&(a=a.times(2<<t-1)),S=!0,E(a,c.precision=d,c.rounding=f,!0)};_.isFinite=function(){return!!this.d};_.isInteger=_.isInt=function(){return!!this.d&&ue(this.e/A)>this.d.length-2};_.isNaN=function(){return!this.s};_.isNegative=_.isNeg=function(){return this.s<0};_.isPositive=_.isPos=function(){return this.s>0};_.isZero=function(){return!!this.d&&this.d[0]===0};_.lessThan=_.lt=function(r){return this.cmp(r)<0};_.lessThanOrEqualTo=_.lte=function(r){return this.cmp(r)<1};_.logarithm=_.log=function(r){var e,t,n,s,i,a,o,l,u=this,c=u.constructor,d=c.precision,f=c.rounding,p=5;if(r==null)r=new c(10),e=!0;else{if(r=new c(r),t=r.d,r.s<0||!t||!t[0]||r.eq(1))return new c(NaN);e=r.eq(10)}if(t=u.d,u.s<0||!t||!t[0]||u.eq(1))return new c(t&&!t[0]?-1/0:u.s!=1?NaN:t?0:1/0);if(e)if(t.length>1)i=!0;else{for(s=t[0];s%10===0;)s/=10;i=s!==1}if(S=!1,o=d+p,a=rt(u,o),n=e?kn(c,o+10):rt(r,o),l=j(a,n,o,1),hr(l.d,s=d,f))do if(o+=10,a=rt(u,o),n=e?kn(c,o+10):rt(r,o),l=j(a,n,o,1),!i){+ie(l.d).slice(s+1,s+15)+1==1e14&&(l=E(l,d+1,0));break}while(hr(l.d,s+=10,f));return S=!0,E(l,d,f)};_.minus=_.sub=function(r){var e,t,n,s,i,a,o,l,u,c,d,f,p=this,h=p.constructor;if(r=new h(r),!p.d||!r.d)return!p.s||!r.s?r=new h(NaN):p.d?r.s=-r.s:r=new h(r.d||p.s!==r.s?p:NaN),r;if(p.s!=r.s)return r.s=-r.s,p.plus(r);if(u=p.d,f=r.d,o=h.precision,l=h.rounding,!u[0]||!f[0]){if(f[0])r.s=-r.s;else if(u[0])r=new h(p);else return new h(l===3?-0:0);return S?E(r,o,l):r}if(t=ue(r.e/A),c=ue(p.e/A),u=u.slice(),i=c-t,i){for(d=i<0,d?(e=u,i=-i,a=f.length):(e=f,t=c,a=u.length),n=Math.max(Math.ceil(o/A),a)+2,i>n&&(i=n,e.length=1),e.reverse(),n=i;n--;)e.push(0);e.reverse()}else{for(n=u.length,a=f.length,d=n<a,d&&(a=n),n=0;n<a;n++)if(u[n]!=f[n]){d=u[n]<f[n];break}i=0}for(d&&(e=u,u=f,f=e,r.s=-r.s),a=u.length,n=f.length-a;n>0;--n)u[a++]=0;for(n=f.length;n>i;){if(u[--n]<f[n]){for(s=n;s&&u[--s]===0;)u[s]=Ne-1;--u[s],u[n]+=Ne}u[n]-=f[n]}for(;u[--a]===0;)u.pop();for(;u[0]===0;u.shift())--t;return u[0]?(r.d=u,r.e=Tn(u,t),S?E(r,o,l):r):new h(l===3?-0:0)};_.modulo=_.mod=function(r){var e,t=this,n=t.constructor;return r=new n(r),!t.d||!r.s||r.d&&!r.d[0]?new n(NaN):!r.d||t.d&&!t.d[0]?E(new n(t),n.precision,n.rounding):(S=!1,n.modulo==9?(e=j(t,r.abs(),0,3,1),e.s*=r.s):e=j(t,r,0,n.modulo,1),e=e.times(r),S=!0,t.minus(e))};_.naturalExponential=_.exp=function(){return Is(this)};_.naturalLogarithm=_.ln=function(){return rt(this)};_.negated=_.neg=function(){var r=new this.constructor(this);return r.s=-r.s,E(r)};_.plus=_.add=function(r){var e,t,n,s,i,a,o,l,u,c,d=this,f=d.constructor;if(r=new f(r),!d.d||!r.d)return!d.s||!r.s?r=new f(NaN):d.d||(r=new f(r.d||d.s===r.s?d:NaN)),r;if(d.s!=r.s)return r.s=-r.s,d.minus(r);if(u=d.d,c=r.d,o=f.precision,l=f.rounding,!u[0]||!c[0])return c[0]||(r=new f(d)),S?E(r,o,l):r;if(i=ue(d.e/A),n=ue(r.e/A),u=u.slice(),s=i-n,s){for(s<0?(t=u,s=-s,a=c.length):(t=c,n=i,a=u.length),i=Math.ceil(o/A),a=i>a?i+1:a+1,s>a&&(s=a,t.length=1),t.reverse();s--;)t.push(0);t.reverse()}for(a=u.length,s=c.length,a-s<0&&(s=a,t=c,c=u,u=t),e=0;s;)e=(u[--s]=u[s]+c[s]+e)/Ne|0,u[s]%=Ne;for(e&&(u.unshift(e),++n),a=u.length;u[--a]==0;)u.pop();return r.d=u,r.e=Tn(u,n),S?E(r,o,l):r};_.precision=_.sd=function(r){var e,t=this;if(r!==void 0&&r!==!!r&&r!==1&&r!==0)throw Error(nt+r);return t.d?(e=na(t.d),r&&t.e+1>e&&(e=t.e+1)):e=NaN,e};_.round=function(){var r=this,e=r.constructor;return E(new e(r),r.e+1,e.rounding)};_.sine=_.sin=function(){var r,e,t=this,n=t.constructor;return t.isFinite()?t.isZero()?new n(t):(r=n.precision,e=n.rounding,n.precision=r+Math.max(t.e,t.sd())+A,n.rounding=1,t=uu(n,oa(n,t)),n.precision=r,n.rounding=e,E(Ge>2?t.neg():t,r,e,!0)):new n(NaN)};_.squareRoot=_.sqrt=function(){var r,e,t,n,s,i,a=this,o=a.d,l=a.e,u=a.s,c=a.constructor;if(u!==1||!o||!o[0])return new c(!u||u<0&&(!o||o[0])?NaN:o?a:1/0);for(S=!1,u=Math.sqrt(+a),u==0||u==1/0?(e=ie(o),(e.length+l)%2==0&&(e+="0"),u=Math.sqrt(e),l=ue((l+1)/2)-(l<0||l%2),u==1/0?e="5e"+l:(e=u.toExponential(),e=e.slice(0,e.indexOf("e")+1)+l),n=new c(e)):n=new c(u.toString()),t=(l=c.precision)+3;;)if(i=n,n=i.plus(j(a,i,t+2,1)).times(.5),ie(i.d).slice(0,t)===(e=ie(n.d)).slice(0,t))if(e=e.slice(t-3,t+1),e=="9999"||!s&&e=="4999"){if(!s&&(E(i,l+1,0),i.times(i).eq(a))){n=i;break}t+=4,s=1}else{(!+e||!+e.slice(1)&&e.charAt(0)=="5")&&(E(n,l+1,1),r=!n.times(n).eq(a));break}return S=!0,E(n,l,c.rounding,r)};_.tangent=_.tan=function(){var r,e,t=this,n=t.constructor;return t.isFinite()?t.isZero()?new n(t):(r=n.precision,e=n.rounding,n.precision=r+10,n.rounding=1,t=t.sin(),t.s=1,t=j(t,new n(1).minus(t.times(t)).sqrt(),r+10,0),n.precision=r,n.rounding=e,E(Ge==2||Ge==4?t.neg():t,r,e,!0)):new n(NaN)};_.times=_.mul=function(r){var e,t,n,s,i,a,o,l,u,c=this,d=c.constructor,f=c.d,p=(r=new d(r)).d;if(r.s*=c.s,!f||!f[0]||!p||!p[0])return new d(!r.s||f&&!f[0]&&!p||p&&!p[0]&&!f?NaN:!f||!p?r.s/0:r.s*0);for(t=ue(c.e/A)+ue(r.e/A),l=f.length,u=p.length,l<u&&(i=f,f=p,p=i,a=l,l=u,u=a),i=[],a=l+u,n=a;n--;)i.push(0);for(n=u;--n>=0;){for(e=0,s=l+n;s>n;)o=i[s]+p[n]*f[s-n-1]+e,i[s--]=o%Ne|0,e=o/Ne|0;i[s]=(i[s]+e)%Ne|0}for(;!i[--a];)i.pop();return e?++t:i.shift(),r.d=i,r.e=Tn(i,t),S?E(r,d.precision,d.rounding):r};_.toBinary=function(r,e){return Rs(this,2,r,e)};_.toDecimalPlaces=_.toDP=function(r,e){var t=this,n=t.constructor;return t=new n(t),r===void 0?t:(ge(r,0,st),e===void 0?e=n.rounding:ge(e,0,8),E(t,r+t.e+1,e))};_.toExponential=function(r,e){var t,n=this,s=n.constructor;return r===void 0?t=Le(n,!0):(ge(r,0,st),e===void 0?e=s.rounding:ge(e,0,8),n=E(new s(n),r+1,e),t=Le(n,!0,r+1)),n.isNeg()&&!n.isZero()?"-"+t:t};_.toFixed=function(r,e){var t,n,s=this,i=s.constructor;return r===void 0?t=Le(s):(ge(r,0,st),e===void 0?e=i.rounding:ge(e,0,8),n=E(new i(s),r+s.e+1,e),t=Le(n,!1,r+n.e+1)),s.isNeg()&&!s.isZero()?"-"+t:t};_.toFraction=function(r){var e,t,n,s,i,a,o,l,u,c,d,f,p=this,h=p.d,m=p.constructor;if(!h)return new m(p);if(u=t=new m(1),n=l=new m(0),e=new m(n),i=e.e=na(h)-p.e-1,a=i%A,e.d[0]=ee(10,a<0?A+a:a),r==null)r=i>0?e:u;else{if(o=new m(r),!o.isInt()||o.lt(u))throw Error(nt+o);r=o.gt(e)?i>0?e:u:o}for(S=!1,o=new m(ie(h)),c=m.precision,m.precision=i=h.length*A*2;d=j(o,e,0,1,1),s=t.plus(d.times(n)),s.cmp(r)!=1;)t=n,n=s,s=u,u=l.plus(d.times(s)),l=s,s=e,e=o.minus(d.times(s)),o=s;return s=j(r.minus(t),n,0,1,1),l=l.plus(s.times(u)),t=t.plus(s.times(n)),l.s=u.s=p.s,f=j(u,n,i,1).minus(p).abs().cmp(j(l,t,i,1).minus(p).abs())<1?[u,n]:[l,t],m.precision=c,S=!0,f};_.toHexadecimal=_.toHex=function(r,e){return Rs(this,16,r,e)};_.toNearest=function(r,e){var t=this,n=t.constructor;if(t=new n(t),r==null){if(!t.d)return t;r=new n(1),e=n.rounding}else{if(r=new n(r),e===void 0?e=n.rounding:ge(e,0,8),!t.d)return r.s?t:r;if(!r.d)return r.s&&(r.s=t.s),r}return r.d[0]?(S=!1,t=j(t,r,0,e,1).times(r),S=!0,E(t)):(r.s=t.s,t=r),t};_.toNumber=function(){return+this};_.toOctal=function(r,e){return Rs(this,8,r,e)};_.toPower=_.pow=function(r){var e,t,n,s,i,a,o=this,l=o.constructor,u=+(r=new l(r));if(!o.d||!r.d||!o.d[0]||!r.d[0])return new l(ee(+o,u));if(o=new l(o),o.eq(1))return o;if(n=l.precision,i=l.rounding,r.eq(1))return E(o,n,i);if(e=ue(r.e/A),e>=r.d.length-1&&(t=u<0?-u:u)<=iu)return s=sa(l,o,t,n),r.s<0?new l(1).div(s):E(s,n,i);if(a=o.s,a<0){if(e<r.d.length-1)return new l(NaN);if((r.d[e]&1)==0&&(a=1),o.e==0&&o.d[0]==1&&o.d.length==1)return o.s=a,o}return t=ee(+o,u),e=t==0||!isFinite(t)?ue(u*(Math.log("0."+ie(o.d))/Math.LN10+o.e+1)):new l(t+"").e,e>l.maxE+1||e<l.minE-1?new l(e>0?a/0:0):(S=!1,l.rounding=o.s=1,t=Math.min(12,(e+"").length),s=Is(r.times(rt(o,n+t)),n),s.d&&(s=E(s,n+5,1),hr(s.d,n,i)&&(e=n+10,s=E(Is(r.times(rt(o,e+t)),e),e+5,1),+ie(s.d).slice(n+1,n+15)+1==1e14&&(s=E(s,n+1,0)))),s.s=a,S=!0,l.rounding=i,E(s,n,i))};_.toPrecision=function(r,e){var t,n=this,s=n.constructor;return r===void 0?t=Le(n,n.e<=s.toExpNeg||n.e>=s.toExpPos):(ge(r,1,st),e===void 0?e=s.rounding:ge(e,0,8),n=E(new s(n),r,e),t=Le(n,r<=n.e||n.e<=s.toExpNeg,r)),n.isNeg()&&!n.isZero()?"-"+t:t};_.toSignificantDigits=_.toSD=function(r,e){var t=this,n=t.constructor;return r===void 0?(r=n.precision,e=n.rounding):(ge(r,1,st),e===void 0?e=n.rounding:ge(e,0,8)),E(new n(t),r,e)};_.toString=function(){var r=this,e=r.constructor,t=Le(r,r.e<=e.toExpNeg||r.e>=e.toExpPos);return r.isNeg()&&!r.isZero()?"-"+t:t};_.truncated=_.trunc=function(){return E(new this.constructor(this),this.e+1,1)};_.valueOf=_.toJSON=function(){var r=this,e=r.constructor,t=Le(r,r.e<=e.toExpNeg||r.e>=e.toExpPos);return r.isNeg()?"-"+t:t};function ie(r){var e,t,n,s=r.length-1,i="",a=r[0];if(s>0){for(i+=a,e=1;e<s;e++)n=r[e]+"",t=A-n.length,t&&(i+=tt(t)),i+=n;a=r[e],n=a+"",t=A-n.length,t&&(i+=tt(t))}else if(a===0)return"0";for(;a%10===0;)a/=10;return i+a}function ge(r,e,t){if(r!==~~r||r<e||r>t)throw Error(nt+r)}function hr(r,e,t,n){var s,i,a,o;for(i=r[0];i>=10;i/=10)--e;return--e<0?(e+=A,s=0):(s=Math.ceil((e+1)/A),e%=A),i=ee(10,A-e),o=r[s]%i|0,n==null?e<3?(e==0?o=o/100|0:e==1&&(o=o/10|0),a=t<4&&o==99999||t>3&&o==49999||o==5e4||o==0):a=(t<4&&o+1==i||t>3&&o+1==i/2)&&(r[s+1]/i/100|0)==ee(10,e-2)-1||(o==i/2||o==0)&&(r[s+1]/i/100|0)==0:e<4?(e==0?o=o/1e3|0:e==1?o=o/100|0:e==2&&(o=o/10|0),a=(n||t<4)&&o==9999||!n&&t>3&&o==4999):a=((n||t<4)&&o+1==i||!n&&t>3&&o+1==i/2)&&(r[s+1]/i/1e3|0)==ee(10,e-3)-1,a}function wn(r,e,t){for(var n,s=[0],i,a=0,o=r.length;a<o;){for(i=s.length;i--;)s[i]*=e;for(s[0]+=Cs.indexOf(r.charAt(a++)),n=0;n<s.length;n++)s[n]>t-1&&(s[n+1]===void 0&&(s[n+1]=0),s[n+1]+=s[n]/t|0,s[n]%=t)}return s.reverse()}function ou(r,e){var t,n,s;if(e.isZero())return e;n=e.d.length,n<32?(t=Math.ceil(n/3),s=(1/Dn(4,t)).toString()):(t=16,s="2.3283064365386962890625e-10"),r.precision+=t,e=Lt(r,1,e.times(s),new r(1));for(var i=t;i--;){var a=e.times(e);e=a.times(a).minus(a).times(8).plus(1)}return r.precision-=t,e}var j=(function(){function r(n,s,i){var a,o=0,l=n.length;for(n=n.slice();l--;)a=n[l]*s+o,n[l]=a%i|0,o=a/i|0;return o&&n.unshift(o),n}function e(n,s,i,a){var o,l;if(i!=a)l=i>a?1:-1;else for(o=l=0;o<i;o++)if(n[o]!=s[o]){l=n[o]>s[o]?1:-1;break}return l}function t(n,s,i,a){for(var o=0;i--;)n[i]-=o,o=n[i]<s[i]?1:0,n[i]=o*a+n[i]-s[i];for(;!n[0]&&n.length>1;)n.shift()}return function(n,s,i,a,o,l){var u,c,d,f,p,h,m,g,b,v,w,k,I,L,Z,Y,ne,ze,Q,fe,ke=n.constructor,q=n.s==s.s?1:-1,J=n.d,O=s.d;if(!J||!J[0]||!O||!O[0])return new ke(!n.s||!s.s||(J?O&&J[0]==O[0]:!O)?NaN:J&&J[0]==0||!O?q*0:q/0);for(l?(p=1,c=n.e-s.e):(l=Ne,p=A,c=ue(n.e/p)-ue(s.e/p)),Q=O.length,ne=J.length,b=new ke(q),v=b.d=[],d=0;O[d]==(J[d]||0);d++);if(O[d]>(J[d]||0)&&c--,i==null?(L=i=ke.precision,a=ke.rounding):o?L=i+(n.e-s.e)+1:L=i,L<0)v.push(1),h=!0;else{if(L=L/p+2|0,d=0,Q==1){for(f=0,O=O[0],L++;(d<ne||f)&&L--;d++)Z=f*l+(J[d]||0),v[d]=Z/O|0,f=Z%O|0;h=f||d<ne}else{for(f=l/(O[0]+1)|0,f>1&&(O=r(O,f,l),J=r(J,f,l),Q=O.length,ne=J.length),Y=Q,w=J.slice(0,Q),k=w.length;k<Q;)w[k++]=0;fe=O.slice(),fe.unshift(0),ze=O[0],O[1]>=l/2&&++ze;do f=0,u=e(O,w,Q,k),u<0?(I=w[0],Q!=k&&(I=I*l+(w[1]||0)),f=I/ze|0,f>1?(f>=l&&(f=l-1),m=r(O,f,l),g=m.length,k=w.length,u=e(m,w,g,k),u==1&&(f--,t(m,Q<g?fe:O,g,l))):(f==0&&(u=f=1),m=O.slice()),g=m.length,g<k&&m.unshift(0),t(w,m,k,l),u==-1&&(k=w.length,u=e(O,w,Q,k),u<1&&(f++,t(w,Q<k?fe:O,k,l))),k=w.length):u===0&&(f++,w=[0]),v[d++]=f,u&&w[0]?w[k++]=J[Y]||0:(w=[J[Y]],k=1);while((Y++<ne||w[0]!==void 0)&&L--);h=w[0]!==void 0}v[0]||v.shift()}if(p==1)b.e=c,Ki=h;else{for(d=1,f=v[0];f>=10;f/=10)d++;b.e=d+c*p-1,E(b,o?i+b.e+1:i,a,h)}return b}})();function E(r,e,t,n){var s,i,a,o,l,u,c,d,f,p=r.constructor;e:if(e!=null){if(d=r.d,!d)return r;for(s=1,o=d[0];o>=10;o/=10)s++;if(i=e-s,i<0)i+=A,a=e,c=d[f=0],l=c/ee(10,s-a-1)%10|0;else if(f=Math.ceil((i+1)/A),o=d.length,f>=o)if(n){for(;o++<=f;)d.push(0);c=l=0,s=1,i%=A,a=i-A+1}else break e;else{for(c=o=d[f],s=1;o>=10;o/=10)s++;i%=A,a=i-A+s,l=a<0?0:c/ee(10,s-a-1)%10|0}if(n=n||e<0||d[f+1]!==void 0||(a<0?c:c%ee(10,s-a-1)),u=t<4?(l||n)&&(t==0||t==(r.s<0?3:2)):l>5||l==5&&(t==4||n||t==6&&(i>0?a>0?c/ee(10,s-a):0:d[f-1])%10&1||t==(r.s<0?8:7)),e<1||!d[0])return d.length=0,u?(e-=r.e+1,d[0]=ee(10,(A-e%A)%A),r.e=-e||0):d[0]=r.e=0,r;if(i==0?(d.length=f,o=1,f--):(d.length=f+1,o=ee(10,A-i),d[f]=a>0?(c/ee(10,s-a)%ee(10,a)|0)*o:0),u)for(;;)if(f==0){for(i=1,a=d[0];a>=10;a/=10)i++;for(a=d[0]+=o,o=1;a>=10;a/=10)o++;i!=o&&(r.e++,d[0]==Ne&&(d[0]=1));break}else{if(d[f]+=o,d[f]!=Ne)break;d[f--]=0,o=1}for(i=d.length;d[--i]===0;)d.pop()}return S&&(r.e>p.maxE?(r.d=null,r.e=NaN):r.e<p.minE&&(r.e=0,r.d=[0])),r}function Le(r,e,t){if(!r.isFinite())return aa(r);var n,s=r.e,i=ie(r.d),a=i.length;return e?(t&&(n=t-a)>0?i=i.charAt(0)+"."+i.slice(1)+tt(n):a>1&&(i=i.charAt(0)+"."+i.slice(1)),i=i+(r.e<0?"e":"e+")+r.e):s<0?(i="0."+tt(-s-1)+i,t&&(n=t-a)>0&&(i+=tt(n))):s>=a?(i+=tt(s+1-a),t&&(n=t-s-1)>0&&(i=i+"."+tt(n))):((n=s+1)<a&&(i=i.slice(0,n)+"."+i.slice(n)),t&&(n=t-a)>0&&(s+1===a&&(i+="."),i+=tt(n))),i}function Tn(r,e){var t=r[0];for(e*=A;t>=10;t/=10)e++;return e}function kn(r,e,t){if(e>au)throw S=!0,t&&(r.precision=t),Error(Qi);return E(new r(vn),e,1,!0)}function $e(r,e,t){if(e>Bs)throw Error(Qi);return E(new r(En),e,t,!0)}function na(r){var e=r.length-1,t=e*A+1;if(e=r[e],e){for(;e%10==0;e/=10)t--;for(e=r[0];e>=10;e/=10)t++}return t}function tt(r){for(var e="";r--;)e+="0";return e}function sa(r,e,t,n){var s,i=new r(1),a=Math.ceil(n/A+4);for(S=!1;;){if(t%2&&(i=i.times(e),Zi(i.d,a)&&(s=!0)),t=ue(t/2),t===0){t=i.d.length-1,s&&i.d[t]===0&&++i.d[t];break}e=e.times(e),Zi(e.d,a)}return S=!0,i}function Yi(r){return r.d[r.d.length-1]&1}function ia(r,e,t){for(var n,s,i=new r(e[0]),a=0;++a<e.length;){if(s=new r(e[a]),!s.s){i=s;break}n=i.cmp(s),(n===t||n===0&&i.s===t)&&(i=s)}return i}function Is(r,e){var t,n,s,i,a,o,l,u=0,c=0,d=0,f=r.constructor,p=f.rounding,h=f.precision;if(!r.d||!r.d[0]||r.e>17)return new f(r.d?r.d[0]?r.s<0?0:1/0:1:r.s?r.s<0?0:r:NaN);for(e==null?(S=!1,l=h):l=e,o=new f(.03125);r.e>-2;)r=r.times(o),d+=5;for(n=Math.log(ee(2,d))/Math.LN10*2+5|0,l+=n,t=i=a=new f(1),f.precision=l;;){if(i=E(i.times(r),l,1),t=t.times(++c),o=a.plus(j(i,t,l,1)),ie(o.d).slice(0,l)===ie(a.d).slice(0,l)){for(s=d;s--;)a=E(a.times(a),l,1);if(e==null)if(u<3&&hr(a.d,l-n,p,u))f.precision=l+=10,t=i=o=new f(1),c=0,u++;else return E(a,f.precision=h,p,S=!0);else return f.precision=h,a}a=o}}function rt(r,e){var t,n,s,i,a,o,l,u,c,d,f,p=1,h=10,m=r,g=m.d,b=m.constructor,v=b.rounding,w=b.precision;if(m.s<0||!g||!g[0]||!m.e&&g[0]==1&&g.length==1)return new b(g&&!g[0]?-1/0:m.s!=1?NaN:g?0:m);if(e==null?(S=!1,c=w):c=e,b.precision=c+=h,t=ie(g),n=t.charAt(0),Math.abs(i=m.e)<15e14){for(;n<7&&n!=1||n==1&&t.charAt(1)>3;)m=m.times(r),t=ie(m.d),n=t.charAt(0),p++;i=m.e,n>1?(m=new b("0."+t),i++):m=new b(n+"."+t.slice(1))}else return u=kn(b,c+2,w).times(i+""),m=rt(new b(n+"."+t.slice(1)),c-h).plus(u),b.precision=w,e==null?E(m,w,v,S=!0):m;for(d=m,l=a=m=j(m.minus(1),m.plus(1),c,1),f=E(m.times(m),c,1),s=3;;){if(a=E(a.times(f),c,1),u=l.plus(j(a,new b(s),c,1)),ie(u.d).slice(0,c)===ie(l.d).slice(0,c))if(l=l.times(2),i!==0&&(l=l.plus(kn(b,c+2,w).times(i+""))),l=j(l,new b(p),c,1),e==null)if(hr(l.d,c-h,v,o))b.precision=c+=h,u=a=m=j(d.minus(1),d.plus(1),c,1),f=E(m.times(m),c,1),s=o=1;else return E(l,b.precision=w,v,S=!0);else return b.precision=w,l;l=u,s+=2}}function aa(r){return String(r.s*r.s/0)}function yn(r,e){var t,n,s;for((t=e.indexOf("."))>-1&&(e=e.replace(".","")),(n=e.search(/e/i))>0?(t<0&&(t=n),t+=+e.slice(n+1),e=e.substring(0,n)):t<0&&(t=e.length),n=0;e.charCodeAt(n)===48;n++);for(s=e.length;e.charCodeAt(s-1)===48;--s);if(e=e.slice(n,s),e){if(s-=n,r.e=t=t-n-1,r.d=[],n=(t+1)%A,t<0&&(n+=A),n<s){for(n&&r.d.push(+e.slice(0,n)),s-=A;n<s;)r.d.push(+e.slice(n,n+=A));e=e.slice(n),n=A-e.length}else n-=s;for(;n--;)e+="0";r.d.push(+e),S&&(r.e>r.constructor.maxE?(r.d=null,r.e=NaN):r.e<r.constructor.minE&&(r.e=0,r.d=[0]))}else r.e=0,r.d=[0];return r}function lu(r,e){var t,n,s,i,a,o,l,u,c;if(e.indexOf("_")>-1){if(e=e.replace(/(\d)_(?=\d)/g,"$1"),ra.test(e))return yn(r,e)}else if(e==="Infinity"||e==="NaN")return+e||(r.s=NaN),r.e=NaN,r.d=null,r;if(nu.test(e))t=16,e=e.toLowerCase();else if(ru.test(e))t=2;else if(su.test(e))t=8;else throw Error(nt+e);for(i=e.search(/p/i),i>0?(l=+e.slice(i+1),e=e.substring(2,i)):e=e.slice(2),i=e.indexOf("."),a=i>=0,n=r.constructor,a&&(e=e.replace(".",""),o=e.length,i=o-i,s=sa(n,new n(t),i,i*2)),u=wn(e,t,Ne),c=u.length-1,i=c;u[i]===0;--i)u.pop();return i<0?new n(r.s*0):(r.e=Tn(u,c),r.d=u,S=!1,a&&(r=j(r,s,o*4)),l&&(r=r.times(Math.abs(l)<54?ee(2,l):mr.pow(2,l))),S=!0,r)}function uu(r,e){var t,n=e.d.length;if(n<3)return e.isZero()?e:Lt(r,2,e,e);t=1.4*Math.sqrt(n),t=t>16?16:t|0,e=e.times(1/Dn(5,t)),e=Lt(r,2,e,e);for(var s,i=new r(5),a=new r(16),o=new r(20);t--;)s=e.times(e),e=e.times(i.plus(s.times(a.times(s).minus(o))));return e}function Lt(r,e,t,n,s){var i,a,o,l,u=1,c=r.precision,d=Math.ceil(c/A);for(S=!1,l=t.times(t),o=new r(n);;){if(a=j(o.times(l),new r(e++*e++),c,1),o=s?n.plus(a):n.minus(a),n=j(a.times(l),new r(e++*e++),c,1),a=o.plus(n),a.d[d]!==void 0){for(i=d;a.d[i]===o.d[i]&&i--;);if(i==-1)break}i=o,o=n,n=a,a=i,u++}return S=!0,a.d.length=d+1,a}function Dn(r,e){for(var t=r;--e;)t*=r;return t}function oa(r,e){var t,n=e.s<0,s=$e(r,r.precision,1),i=s.times(.5);if(e=e.abs(),e.lte(i))return Ge=n?4:1,e;if(t=e.divToInt(s),t.isZero())Ge=n?3:2;else{if(e=e.minus(t.times(s)),e.lte(i))return Ge=Yi(t)?n?2:3:n?4:1,e;Ge=Yi(t)?n?1:4:n?3:2}return e.minus(s).abs()}function Rs(r,e,t,n){var s,i,a,o,l,u,c,d,f,p=r.constructor,h=t!==void 0;if(h?(ge(t,1,st),n===void 0?n=p.rounding:ge(n,0,8)):(t=p.precision,n=p.rounding),!r.isFinite())c=aa(r);else{for(c=Le(r),a=c.indexOf("."),h?(s=2,e==16?t=t*4-3:e==8&&(t=t*3-2)):s=e,a>=0&&(c=c.replace(".",""),f=new p(1),f.e=c.length-a,f.d=wn(Le(f),10,s),f.e=f.d.length),d=wn(c,10,s),i=l=d.length;d[--l]==0;)d.pop();if(!d[0])c=h?"0p+0":"0";else{if(a<0?i--:(r=new p(r),r.d=d,r.e=i,r=j(r,f,t,n,0,s),d=r.d,i=r.e,u=Ki),a=d[t],o=s/2,u=u||d[t+1]!==void 0,u=n<4?(a!==void 0||u)&&(n===0||n===(r.s<0?3:2)):a>o||a===o&&(n===4||u||n===6&&d[t-1]&1||n===(r.s<0?8:7)),d.length=t,u)for(;++d[--t]>s-1;)d[t]=0,t||(++i,d.unshift(1));for(l=d.length;!d[l-1];--l);for(a=0,c="";a<l;a++)c+=Cs.charAt(d[a]);if(h){if(l>1)if(e==16||e==8){for(a=e==16?4:3,--l;l%a;l++)c+="0";for(d=wn(c,s,e),l=d.length;!d[l-1];--l);for(a=1,c="1.";a<l;a++)c+=Cs.charAt(d[a])}else c=c.charAt(0)+"."+c.slice(1);c=c+(i<0?"p":"p+")+i}else if(i<0){for(;++i;)c="0"+c;c="0."+c}else if(++i>l)for(i-=l;i--;)c+="0";else i<l&&(c=c.slice(0,i)+"."+c.slice(i))}c=(e==16?"0x":e==2?"0b":e==8?"0o":"")+c}return r.s<0?"-"+c:c}function Zi(r,e){if(r.length>e)return r.length=e,!0}function cu(r){return new this(r).abs()}function du(r){return new this(r).acos()}function fu(r){return new this(r).acosh()}function pu(r,e){return new this(r).plus(e)}function hu(r){return new this(r).asin()}function mu(r){return new this(r).asinh()}function gu(r){return new this(r).atan()}function _u(r){return new this(r).atanh()}function bu(r,e){r=new this(r),e=new this(e);var t,n=this.precision,s=this.rounding,i=n+4;return!r.s||!e.s?t=new this(NaN):!r.d&&!e.d?(t=$e(this,i,1).times(e.s>0?.25:.75),t.s=r.s):!e.d||r.isZero()?(t=e.s<0?$e(this,n,s):new this(0),t.s=r.s):!r.d||e.isZero()?(t=$e(this,i,1).times(.5),t.s=r.s):e.s<0?(this.precision=i,this.rounding=1,t=this.atan(j(r,e,i,1)),e=$e(this,i,1),this.precision=n,this.rounding=s,t=r.s<0?t.minus(e):t.plus(e)):t=this.atan(j(r,e,i,1)),t}function wu(r){return new this(r).cbrt()}function yu(r){return E(r=new this(r),r.e+1,2)}function vu(r,e,t){return new this(r).clamp(e,t)}function Eu(r){if(!r||typeof r!="object")throw Error(An+"Object expected");var e,t,n,s=r.defaults===!0,i=["precision",1,st,"rounding",0,8,"toExpNeg",-$t,0,"toExpPos",0,$t,"maxE",0,$t,"minE",-$t,0,"modulo",0,9];for(e=0;e<i.length;e+=3)if(t=i[e],s&&(this[t]=Os[t]),(n=r[t])!==void 0)if(ue(n)===n&&n>=i[e+1]&&n<=i[e+2])this[t]=n;else throw Error(nt+t+": "+n);if(t="crypto",s&&(this[t]=Os[t]),(n=r[t])!==void 0)if(n===!0||n===!1||n===0||n===1)if(n)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[t]=!0;else throw Error(ea);else this[t]=!1;else throw Error(nt+t+": "+n);return this}function ku(r){return new this(r).cos()}function Au(r){return new this(r).cosh()}function la(r){var e,t,n;function s(i){var a,o,l,u=this;if(!(u instanceof s))return new s(i);if(u.constructor=s,Ji(i)){u.s=i.s,S?!i.d||i.e>s.maxE?(u.e=NaN,u.d=null):i.e<s.minE?(u.e=0,u.d=[0]):(u.e=i.e,u.d=i.d.slice()):(u.e=i.e,u.d=i.d?i.d.slice():i.d);return}if(l=typeof i,l==="number"){if(i===0){u.s=1/i<0?-1:1,u.e=0,u.d=[0];return}if(i<0?(i=-i,u.s=-1):u.s=1,i===~~i&&i<1e7){for(a=0,o=i;o>=10;o/=10)a++;S?a>s.maxE?(u.e=NaN,u.d=null):a<s.minE?(u.e=0,u.d=[0]):(u.e=a,u.d=[i]):(u.e=a,u.d=[i]);return}if(i*0!==0){i||(u.s=NaN),u.e=NaN,u.d=null;return}return yn(u,i.toString())}if(l==="string")return(o=i.charCodeAt(0))===45?(i=i.slice(1),u.s=-1):(o===43&&(i=i.slice(1)),u.s=1),ra.test(i)?yn(u,i):lu(u,i);if(l==="bigint")return i<0?(i=-i,u.s=-1):u.s=1,yn(u,i.toString());throw Error(nt+i)}if(s.prototype=_,s.ROUND_UP=0,s.ROUND_DOWN=1,s.ROUND_CEIL=2,s.ROUND_FLOOR=3,s.ROUND_HALF_UP=4,s.ROUND_HALF_DOWN=5,s.ROUND_HALF_EVEN=6,s.ROUND_HALF_CEIL=7,s.ROUND_HALF_FLOOR=8,s.EUCLID=9,s.config=s.set=Eu,s.clone=la,s.isDecimal=Ji,s.abs=cu,s.acos=du,s.acosh=fu,s.add=pu,s.asin=hu,s.asinh=mu,s.atan=gu,s.atanh=_u,s.atan2=bu,s.cbrt=wu,s.ceil=yu,s.clamp=vu,s.cos=ku,s.cosh=Au,s.div=Tu,s.exp=Du,s.floor=xu,s.hypot=Su,s.ln=Nu,s.log=Cu,s.log10=Bu,s.log2=Ou,s.max=Iu,s.min=Ru,s.mod=Mu,s.mul=$u,s.pow=Lu,s.random=Fu,s.round=Uu,s.sign=Pu,s.sin=qu,s.sinh=ju,s.sqrt=Vu,s.sub=Hu,s.sum=zu,s.tan=Gu,s.tanh=Wu,s.trunc=Xu,r===void 0&&(r={}),r&&r.defaults!==!0)for(n=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],e=0;e<n.length;)r.hasOwnProperty(t=n[e++])||(r[t]=this[t]);return s.config(r),s}function Tu(r,e){return new this(r).div(e)}function Du(r){return new this(r).exp()}function xu(r){return E(r=new this(r),r.e+1,3)}function Su(){var r,e,t=new this(0);for(S=!1,r=0;r<arguments.length;)if(e=new this(arguments[r++]),e.d)t.d&&(t=t.plus(e.times(e)));else{if(e.s)return S=!0,new this(1/0);t=e}return S=!0,t.sqrt()}function Ji(r){return r instanceof mr||r&&r.toStringTag===ta||!1}function Nu(r){return new this(r).ln()}function Cu(r,e){return new this(r).log(e)}function Ou(r){return new this(r).log(2)}function Bu(r){return new this(r).log(10)}function Iu(){return ia(this,arguments,-1)}function Ru(){return ia(this,arguments,1)}function Mu(r,e){return new this(r).mod(e)}function $u(r,e){return new this(r).mul(e)}function Lu(r,e){return new this(r).pow(e)}function Fu(r){var e,t,n,s,i=0,a=new this(1),o=[];if(r===void 0?r=this.precision:ge(r,1,st),n=Math.ceil(r/A),this.crypto)if(crypto.getRandomValues)for(e=crypto.getRandomValues(new Uint32Array(n));i<n;)s=e[i],s>=429e7?e[i]=crypto.getRandomValues(new Uint32Array(1))[0]:o[i++]=s%1e7;else if(crypto.randomBytes){for(e=crypto.randomBytes(n*=4);i<n;)s=e[i]+(e[i+1]<<8)+(e[i+2]<<16)+((e[i+3]&127)<<24),s>=214e7?crypto.randomBytes(4).copy(e,i):(o.push(s%1e7),i+=4);i=n/4}else throw Error(ea);else for(;i<n;)o[i++]=Math.random()*1e7|0;for(n=o[--i],r%=A,n&&r&&(s=ee(10,A-r),o[i]=(n/s|0)*s);o[i]===0;i--)o.pop();if(i<0)t=0,o=[0];else{for(t=-1;o[0]===0;t-=A)o.shift();for(n=1,s=o[0];s>=10;s/=10)n++;n<A&&(t-=A-n)}return a.e=t,a.d=o,a}function Uu(r){return E(r=new this(r),r.e+1,this.rounding)}function Pu(r){return r=new this(r),r.d?r.d[0]?r.s:0*r.s:r.s||NaN}function qu(r){return new this(r).sin()}function ju(r){return new this(r).sinh()}function Vu(r){return new this(r).sqrt()}function Hu(r,e){return new this(r).sub(e)}function zu(){var r=0,e=arguments,t=new this(e[r]);for(S=!1;t.s&&++r<e.length;)t=t.plus(e[r]);return S=!0,E(t,this.precision,this.rounding)}function Gu(r){return new this(r).tan()}function Wu(r){return new this(r).tanh()}function Xu(r){return E(r=new this(r),r.e+1,1)}_[Symbol.for("nodejs.util.inspect.custom")]=_.toString;_[Symbol.toStringTag]="Decimal";var mr=_.constructor=la(Os);vn=new mr(vn);En=new mr(En);var ua=mr;var Yu=20,Zu=1,gt=1e6,ca=1e6,Ju=-7,Ku=21,Qu=!1,gr="[big.js] ",_t=gr+"Invalid ",xn=_t+"decimal places",ec=_t+"rounding mode",da=gr+"Division by zero",F={},Fe=void 0,tc=/^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i;function fa(){function r(e){var t=this;if(!(t instanceof r))return e===Fe?fa():new r(e);if(e instanceof r)t.s=e.s,t.e=e.e,t.c=e.c.slice();else{if(typeof e!="string"){if(r.strict===!0&&typeof e!="bigint")throw TypeError(_t+"value");e=e===0&&1/e<0?"-0":String(e)}rc(t,e)}t.constructor=r}return r.prototype=F,r.DP=Yu,r.RM=Zu,r.NE=Ju,r.PE=Ku,r.strict=Qu,r.roundDown=0,r.roundHalfUp=1,r.roundHalfEven=2,r.roundUp=3,r}function rc(r,e){var t,n,s;if(!tc.test(e))throw Error(_t+"number");for(r.s=e.charAt(0)=="-"?(e=e.slice(1),-1):1,(t=e.indexOf("."))>-1&&(e=e.replace(".","")),(n=e.search(/e/i))>0?(t<0&&(t=n),t+=+e.slice(n+1),e=e.substring(0,n)):t<0&&(t=e.length),s=e.length,n=0;n<s&&e.charAt(n)=="0";)++n;if(n==s)r.c=[r.e=0];else{for(;s>0&&e.charAt(--s)=="0";);for(r.e=t-n-1,r.c=[],t=0;n<=s;)r.c[t++]=+e.charAt(n++)}return r}function bt(r,e,t,n){var s=r.c;if(t===Fe&&(t=r.constructor.RM),t!==0&&t!==1&&t!==2&&t!==3)throw Error(ec);if(e<1)n=t===3&&(n||!!s[0])||e===0&&(t===1&&s[0]>=5||t===2&&(s[0]>5||s[0]===5&&(n||s[1]!==Fe))),s.length=1,n?(r.e=r.e-e+1,s[0]=1):s[0]=r.e=0;else if(e<s.length){if(n=t===1&&s[e]>=5||t===2&&(s[e]>5||s[e]===5&&(n||s[e+1]!==Fe||s[e-1]&1))||t===3&&(n||!!s[0]),s.length=e,n){for(;++s[--e]>9;)if(s[e]=0,e===0){++r.e,s.unshift(1);break}}for(e=s.length;!s[--e];)s.pop()}return r}function wt(r,e,t){var n=r.e,s=r.c.join(""),i=s.length;if(e)s=s.charAt(0)+(i>1?"."+s.slice(1):"")+(n<0?"e":"e+")+n;else if(n<0){for(;++n;)s="0"+s;s="0."+s}else if(n>0)if(++n>i)for(n-=i;n--;)s+="0";else n<i&&(s=s.slice(0,n)+"."+s.slice(n));else i>1&&(s=s.charAt(0)+"."+s.slice(1));return r.s<0&&t?"-"+s:s}F.abs=function(){var r=new this.constructor(this);return r.s=1,r};F.cmp=function(r){var e,t=this,n=t.c,s=(r=new t.constructor(r)).c,i=t.s,a=r.s,o=t.e,l=r.e;if(!n[0]||!s[0])return n[0]?i:s[0]?-a:0;if(i!=a)return i;if(e=i<0,o!=l)return o>l^e?1:-1;for(a=(o=n.length)<(l=s.length)?o:l,i=-1;++i<a;)if(n[i]!=s[i])return n[i]>s[i]^e?1:-1;return o==l?0:o>l^e?1:-1};F.div=function(r){var e=this,t=e.constructor,n=e.c,s=(r=new t(r)).c,i=e.s==r.s?1:-1,a=t.DP;if(a!==~~a||a<0||a>gt)throw Error(xn);if(!s[0])throw Error(da);if(!n[0])return r.s=i,r.c=[r.e=0],r;var o,l,u,c,d,f=s.slice(),p=o=s.length,h=n.length,m=n.slice(0,o),g=m.length,b=r,v=b.c=[],w=0,k=a+(b.e=e.e-r.e)+1;for(b.s=i,i=k<0?0:k,f.unshift(0);g++<o;)m.push(0);do{for(u=0;u<10;u++){if(o!=(g=m.length))c=o>g?1:-1;else for(d=-1,c=0;++d<o;)if(s[d]!=m[d]){c=s[d]>m[d]?1:-1;break}if(c<0){for(l=g==o?s:f;g;){if(m[--g]<l[g]){for(d=g;d&&!m[--d];)m[d]=9;--m[d],m[g]+=10}m[g]-=l[g]}for(;!m[0];)m.shift()}else break}v[w++]=c?u:++u,m[0]&&c?m[g]=n[p]||0:m=[n[p]]}while((p++<h||m[0]!==Fe)&&i--);return!v[0]&&w!=1&&(v.shift(),b.e--,k--),w>k&&bt(b,k,t.RM,m[0]!==Fe),b};F.eq=function(r){return this.cmp(r)===0};F.gt=function(r){return this.cmp(r)>0};F.gte=function(r){return this.cmp(r)>-1};F.lt=function(r){return this.cmp(r)<0};F.lte=function(r){return this.cmp(r)<1};F.minus=F.sub=function(r){var e,t,n,s,i=this,a=i.constructor,o=i.s,l=(r=new a(r)).s;if(o!=l)return r.s=-l,i.plus(r);var u=i.c.slice(),c=i.e,d=r.c,f=r.e;if(!u[0]||!d[0])return d[0]?r.s=-l:u[0]?r=new a(i):r.s=1,r;if(o=c-f){for((s=o<0)?(o=-o,n=u):(f=c,n=d),n.reverse(),l=o;l--;)n.push(0);n.reverse()}else for(t=((s=u.length<d.length)?u:d).length,o=l=0;l<t;l++)if(u[l]!=d[l]){s=u[l]<d[l];break}if(s&&(n=u,u=d,d=n,r.s=-r.s),(l=(t=d.length)-(e=u.length))>0)for(;l--;)u[e++]=0;for(l=e;t>o;){if(u[--t]<d[t]){for(e=t;e&&!u[--e];)u[e]=9;--u[e],u[t]+=10}u[t]-=d[t]}for(;u[--l]===0;)u.pop();for(;u[0]===0;)u.shift(),--f;return u[0]||(r.s=1,u=[f=0]),r.c=u,r.e=f,r};F.mod=function(r){var e,t=this,n=t.constructor,s=t.s,i=(r=new n(r)).s;if(!r.c[0])throw Error(da);return t.s=r.s=1,e=r.cmp(t)==1,t.s=s,r.s=i,e?new n(t):(s=n.DP,i=n.RM,n.DP=n.RM=0,t=t.div(r),n.DP=s,n.RM=i,this.minus(t.times(r)))};F.neg=function(){var r=new this.constructor(this);return r.s=-r.s,r};F.plus=F.add=function(r){var e,t,n,s=this,i=s.constructor;if(r=new i(r),s.s!=r.s)return r.s=-r.s,s.minus(r);var a=s.e,o=s.c,l=r.e,u=r.c;if(!o[0]||!u[0])return u[0]||(o[0]?r=new i(s):r.s=s.s),r;if(o=o.slice(),e=a-l){for(e>0?(l=a,n=u):(e=-e,n=o),n.reverse();e--;)n.push(0);n.reverse()}for(o.length-u.length<0&&(n=u,u=o,o=n),e=u.length,t=0;e;o[e]%=10)t=(o[--e]=o[e]+u[e]+t)/10|0;for(t&&(o.unshift(t),++l),e=o.length;o[--e]===0;)o.pop();return r.c=o,r.e=l,r};F.pow=function(r){var e=this,t=new e.constructor("1"),n=t,s=r<0;if(r!==~~r||r<-ca||r>ca)throw Error(_t+"exponent");for(s&&(r=-r);r&1&&(n=n.times(e)),r>>=1,!!r;)e=e.times(e);return s?t.div(n):n};F.prec=function(r,e){if(r!==~~r||r<1||r>gt)throw Error(_t+"precision");return bt(new this.constructor(this),r,e)};F.round=function(r,e){if(r===Fe)r=0;else if(r!==~~r||r<-gt||r>gt)throw Error(xn);return bt(new this.constructor(this),r+this.e+1,e)};F.sqrt=function(){var r,e,t,n=this,s=n.constructor,i=n.s,a=n.e,o=new s("0.5");if(!n.c[0])return new s(n);if(i<0)throw Error(gr+"No square root");i=Math.sqrt(+wt(n,!0,!0)),i===0||i===1/0?(e=n.c.join(""),e.length+a&1||(e+="0"),i=Math.sqrt(e),a=((a+1)/2|0)-(a<0||a&1),r=new s((i==1/0?"5e":(i=i.toExponential()).slice(0,i.indexOf("e")+1))+a)):r=new s(i+""),a=r.e+(s.DP+=4);do t=r,r=o.times(t.plus(n.div(t)));while(t.c.slice(0,a).join("")!==r.c.slice(0,a).join(""));return bt(r,(s.DP-=4)+r.e+1,s.RM)};F.times=F.mul=function(r){var e,t=this,n=t.constructor,s=t.c,i=(r=new n(r)).c,a=s.length,o=i.length,l=t.e,u=r.e;if(r.s=t.s==r.s?1:-1,!s[0]||!i[0])return r.c=[r.e=0],r;for(r.e=l+u,a<o&&(e=s,s=i,i=e,u=a,a=o,o=u),e=new Array(u=a+o);u--;)e[u]=0;for(l=o;l--;){for(o=0,u=a+l;u>l;)o=e[u]+i[l]*s[u-l-1]+o,e[u--]=o%10,o=o/10|0;e[u]=o}for(o?++r.e:e.shift(),l=e.length;!e[--l];)e.pop();return r.c=e,r};F.toExponential=function(r,e){var t=this,n=t.c[0];if(r!==Fe){if(r!==~~r||r<0||r>gt)throw Error(xn);for(t=bt(new t.constructor(t),++r,e);t.c.length<r;)t.c.push(0)}return wt(t,!0,!!n)};F.toFixed=function(r,e){var t=this,n=t.c[0];if(r!==Fe){if(r!==~~r||r<0||r>gt)throw Error(xn);for(t=bt(new t.constructor(t),r+t.e+1,e),r=r+t.e+1;t.c.length<r;)t.c.push(0)}return wt(t,!1,!!n)};F[Symbol.for("nodejs.util.inspect.custom")]=F.toJSON=F.toString=function(){var r=this,e=r.constructor;return wt(r,r.e<=e.NE||r.e>=e.PE,!!r.c[0])};F.toNumber=function(){var r=+wt(this,!0,!0);if(this.constructor.strict===!0&&!this.eq(r.toString()))throw Error(gr+"Imprecise conversion");return r};F.toPrecision=function(r,e){var t=this,n=t.constructor,s=t.c[0];if(r!==Fe){if(r!==~~r||r<1||r>gt)throw Error(_t+"precision");for(t=bt(new n(t),r,e);t.c.length<r;)t.c.push(0)}return wt(t,r<=t.e||t.e<=n.NE||t.e>=n.PE,!!s)};F.valueOf=function(){var r=this,e=r.constructor;if(e.strict===!0)throw Error(gr+"valueOf disallowed");return wt(r,r.e<=e.NE||r.e>=e.PE,!0)};var nc=fa(),pa=nc;var zs={};eu(zs,{DecodeError:()=>ce,Decoder:()=>Ce,EXT_TIMESTAMP:()=>$s,Encoder:()=>Ft,ExtData:()=>We,ExtensionCodec:()=>it,decode:()=>ka,decodeArrayStream:()=>Da,decodeAsync:()=>Ta,decodeMulti:()=>Aa,decodeMultiStream:()=>xa,decodeTimestampExtension:()=>qs,decodeTimestampToTimeSpec:()=>Ps,encode:()=>ya,encodeDateToTimeSpec:()=>Fs,encodeTimeSpecToTimestamp:()=>Ls,encodeTimestampExtension:()=>Us});function ha(r){let e=r.length,t=0,n=0;for(;n<e;){let s=r.charCodeAt(n++);if((s&4294967168)===0){t++;continue}else if((s&4294965248)===0)t+=2;else{if(s>=55296&&s<=56319&&n<e){let i=r.charCodeAt(n);(i&64512)===56320&&(++n,s=((s&1023)<<10)+(i&1023)+65536)}(s&4294901760)===0?t+=3:t+=4}}return t}function sc(r,e,t){let n=r.length,s=t,i=0;for(;i<n;){let a=r.charCodeAt(i++);if((a&4294967168)===0){e[s++]=a;continue}else if((a&4294965248)===0)e[s++]=a>>6&31|192;else{if(a>=55296&&a<=56319&&i<n){let o=r.charCodeAt(i);(o&64512)===56320&&(++i,a=((a&1023)<<10)+(o&1023)+65536)}(a&4294901760)===0?(e[s++]=a>>12&15|224,e[s++]=a>>6&63|128):(e[s++]=a>>18&7|240,e[s++]=a>>12&63|128,e[s++]=a>>6&63|128)}e[s++]=a&63|128}}var ic=new TextEncoder,ac=50;function oc(r,e,t){ic.encodeInto(r,e.subarray(t))}function ma(r,e,t){r.length>ac?oc(r,e,t):sc(r,e,t)}var lc=4096;function Ms(r,e,t){let n=e,s=n+t,i=[],a="";for(;n<s;){let o=r[n++];if((o&128)===0)i.push(o);else if((o&224)===192){let l=r[n++]&63;i.push((o&31)<<6|l)}else if((o&240)===224){let l=r[n++]&63,u=r[n++]&63;i.push((o&31)<<12|l<<6|u)}else if((o&248)===240){let l=r[n++]&63,u=r[n++]&63,c=r[n++]&63,d=(o&7)<<18|l<<12|u<<6|c;d>65535&&(d-=65536,i.push(d>>>10&1023|55296),d=56320|d&1023),i.push(d)}else i.push(o);i.length>=lc&&(a+=String.fromCharCode(...i),i.length=0)}return i.length>0&&(a+=String.fromCharCode(...i)),a}var uc=new TextDecoder,cc=200;function dc(r,e,t){let n=r.subarray(e,e+t);return uc.decode(n)}function ga(r,e,t){return t>cc?dc(r,e,t):Ms(r,e,t)}var We=class{type;data;constructor(e,t){this.type=e,this.data=t}};var ce=class r extends Error{constructor(e){super(e);let t=Object.create(r.prototype);Object.setPrototypeOf(this,t),Object.defineProperty(this,"name",{configurable:!0,enumerable:!1,value:r.name})}};function _a(r,e,t){let n=t/4294967296,s=t;r.setUint32(e,n),r.setUint32(e+4,s)}function Sn(r,e,t){let n=Math.floor(t/4294967296),s=t;r.setUint32(e,n),r.setUint32(e+4,s)}function Nn(r,e){let t=r.getInt32(e),n=r.getUint32(e+4);return t*4294967296+n}function ba(r,e){let t=r.getUint32(e),n=r.getUint32(e+4);return t*4294967296+n}var $s=-1,fc=4294967296-1,pc=17179869184-1;function Ls({sec:r,nsec:e}){if(r>=0&&e>=0&&r<=pc)if(e===0&&r<=fc){let t=new Uint8Array(4);return new DataView(t.buffer).setUint32(0,r),t}else{let t=r/4294967296,n=r&4294967295,s=new Uint8Array(8),i=new DataView(s.buffer);return i.setUint32(0,e<<2|t&3),i.setUint32(4,n),s}else{let t=new Uint8Array(12),n=new DataView(t.buffer);return n.setUint32(0,e),Sn(n,4,r),t}}function Fs(r){let e=r.getTime(),t=Math.floor(e/1e3),n=(e-t*1e3)*1e6,s=Math.floor(n/1e9);return{sec:t+s,nsec:n-s*1e9}}function Us(r){if(r instanceof Date){let e=Fs(r);return Ls(e)}else return null}function Ps(r){let e=new DataView(r.buffer,r.byteOffset,r.byteLength);switch(r.byteLength){case 4:return{sec:e.getUint32(0),nsec:0};case 8:{let t=e.getUint32(0),n=e.getUint32(4),s=(t&3)*4294967296+n,i=t>>>2;return{sec:s,nsec:i}}case 12:{let t=Nn(e,4),n=e.getUint32(0);return{sec:t,nsec:n}}default:throw new ce(`Unrecognized data size for timestamp (expected 4, 8, or 12): ${r.length}`)}}function qs(r){let e=Ps(r);return new Date(e.sec*1e3+e.nsec/1e6)}var wa={type:$s,encode:Us,decode:qs};var it=class r{static defaultCodec=new r;__brand;builtInEncoders=[];builtInDecoders=[];encoders=[];decoders=[];constructor(){this.register(wa)}register({type:e,encode:t,decode:n}){if(e>=0)this.encoders[e]=t,this.decoders[e]=n;else{let s=-1-e;this.builtInEncoders[s]=t,this.builtInDecoders[s]=n}}tryToEncode(e,t){for(let n=0;n<this.builtInEncoders.length;n++){let s=this.builtInEncoders[n];if(s!=null){let i=s(e,t);if(i!=null){let a=-1-n;return new We(a,i)}}}for(let n=0;n<this.encoders.length;n++){let s=this.encoders[n];if(s!=null){let i=s(e,t);if(i!=null){let a=n;return new We(a,i)}}}return e instanceof We?e:null}decode(e,t,n){let s=t<0?this.builtInDecoders[-1-t]:this.decoders[t];return s?s(e,t,n):new We(t,e)}};function hc(r){return r instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&r instanceof SharedArrayBuffer}function _r(r){return r instanceof Uint8Array?r:ArrayBuffer.isView(r)?new Uint8Array(r.buffer,r.byteOffset,r.byteLength):hc(r)?new Uint8Array(r):Uint8Array.from(r)}var mc=100,gc=2048,Ft=class r{extensionCodec;context;useBigInt64;maxDepth;initialBufferSize;sortKeys;forceFloat32;ignoreUndefined;forceIntegerToFloat;pos;view;bytes;entered=!1;constructor(e){this.extensionCodec=e?.extensionCodec??it.defaultCodec,this.context=e?.context,this.useBigInt64=e?.useBigInt64??!1,this.maxDepth=e?.maxDepth??mc,this.initialBufferSize=e?.initialBufferSize??gc,this.sortKeys=e?.sortKeys??!1,this.forceFloat32=e?.forceFloat32??!1,this.ignoreUndefined=e?.ignoreUndefined??!1,this.forceIntegerToFloat=e?.forceIntegerToFloat??!1,this.pos=0,this.view=new DataView(new ArrayBuffer(this.initialBufferSize)),this.bytes=new Uint8Array(this.view.buffer)}clone(){return new r({extensionCodec:this.extensionCodec,context:this.context,useBigInt64:this.useBigInt64,maxDepth:this.maxDepth,initialBufferSize:this.initialBufferSize,sortKeys:this.sortKeys,forceFloat32:this.forceFloat32,ignoreUndefined:this.ignoreUndefined,forceIntegerToFloat:this.forceIntegerToFloat})}reinitializeState(){this.pos=0}encodeSharedRef(e){if(this.entered)return this.clone().encodeSharedRef(e);try{return this.entered=!0,this.reinitializeState(),this.doEncode(e,1),this.bytes.subarray(0,this.pos)}finally{this.entered=!1}}encode(e){if(this.entered)return this.clone().encode(e);try{return this.entered=!0,this.reinitializeState(),this.doEncode(e,1),this.bytes.slice(0,this.pos)}finally{this.entered=!1}}doEncode(e,t){if(t>this.maxDepth)throw new Error(`Too deep objects in depth ${t}`);e==null?this.encodeNil():typeof e=="boolean"?this.encodeBoolean(e):typeof e=="number"?this.forceIntegerToFloat?this.encodeNumberAsFloat(e):this.encodeNumber(e):typeof e=="string"?this.encodeString(e):this.useBigInt64&&typeof e=="bigint"?this.encodeBigInt64(e):this.encodeObject(e,t)}ensureBufferSizeToWrite(e){let t=this.pos+e;this.view.byteLength<t&&this.resizeBuffer(t*2)}resizeBuffer(e){let t=new ArrayBuffer(e),n=new Uint8Array(t),s=new DataView(t);n.set(this.bytes),this.view=s,this.bytes=n}encodeNil(){this.writeU8(192)}encodeBoolean(e){e===!1?this.writeU8(194):this.writeU8(195)}encodeNumber(e){!this.forceIntegerToFloat&&Number.isSafeInteger(e)?e>=0?e<128?this.writeU8(e):e<256?(this.writeU8(204),this.writeU8(e)):e<65536?(this.writeU8(205),this.writeU16(e)):e<4294967296?(this.writeU8(206),this.writeU32(e)):this.useBigInt64?this.encodeNumberAsFloat(e):(this.writeU8(207),this.writeU64(e)):e>=-32?this.writeU8(224|e+32):e>=-128?(this.writeU8(208),this.writeI8(e)):e>=-32768?(this.writeU8(209),this.writeI16(e)):e>=-2147483648?(this.writeU8(210),this.writeI32(e)):this.useBigInt64?this.encodeNumberAsFloat(e):(this.writeU8(211),this.writeI64(e)):this.encodeNumberAsFloat(e)}encodeNumberAsFloat(e){this.forceFloat32?(this.writeU8(202),this.writeF32(e)):(this.writeU8(203),this.writeF64(e))}encodeBigInt64(e){e>=BigInt(0)?(this.writeU8(207),this.writeBigUint64(e)):(this.writeU8(211),this.writeBigInt64(e))}writeStringHeader(e){if(e<32)this.writeU8(160+e);else if(e<256)this.writeU8(217),this.writeU8(e);else if(e<65536)this.writeU8(218),this.writeU16(e);else if(e<4294967296)this.writeU8(219),this.writeU32(e);else throw new Error(`Too long string: ${e} bytes in UTF-8`)}encodeString(e){let n=ha(e);this.ensureBufferSizeToWrite(5+n),this.writeStringHeader(n),ma(e,this.bytes,this.pos),this.pos+=n}encodeObject(e,t){let n=this.extensionCodec.tryToEncode(e,this.context);if(n!=null)this.encodeExtension(n);else if(Array.isArray(e))this.encodeArray(e,t);else if(ArrayBuffer.isView(e))this.encodeBinary(e);else if(typeof e=="object")this.encodeMap(e,t);else throw new Error(`Unrecognized object: ${Object.prototype.toString.apply(e)}`)}encodeBinary(e){let t=e.byteLength;if(t<256)this.writeU8(196),this.writeU8(t);else if(t<65536)this.writeU8(197),this.writeU16(t);else if(t<4294967296)this.writeU8(198),this.writeU32(t);else throw new Error(`Too large binary: ${t}`);let n=_r(e);this.writeU8a(n)}encodeArray(e,t){let n=e.length;if(n<16)this.writeU8(144+n);else if(n<65536)this.writeU8(220),this.writeU16(n);else if(n<4294967296)this.writeU8(221),this.writeU32(n);else throw new Error(`Too large array: ${n}`);for(let s of e)this.doEncode(s,t+1)}countWithoutUndefined(e,t){let n=0;for(let s of t)e[s]!==void 0&&n++;return n}encodeMap(e,t){let n=Object.keys(e);this.sortKeys&&n.sort();let s=this.ignoreUndefined?this.countWithoutUndefined(e,n):n.length;if(s<16)this.writeU8(128+s);else if(s<65536)this.writeU8(222),this.writeU16(s);else if(s<4294967296)this.writeU8(223),this.writeU32(s);else throw new Error(`Too large map object: ${s}`);for(let i of n){let a=e[i];this.ignoreUndefined&&a===void 0||(this.encodeString(i),this.doEncode(a,t+1))}}encodeExtension(e){if(typeof e.data=="function"){let n=e.data(this.pos+6),s=n.length;if(s>=4294967296)throw new Error(`Too large extension object: ${s}`);this.writeU8(201),this.writeU32(s),this.writeI8(e.type),this.writeU8a(n);return}let t=e.data.length;if(t===1)this.writeU8(212);else if(t===2)this.writeU8(213);else if(t===4)this.writeU8(214);else if(t===8)this.writeU8(215);else if(t===16)this.writeU8(216);else if(t<256)this.writeU8(199),this.writeU8(t);else if(t<65536)this.writeU8(200),this.writeU16(t);else if(t<4294967296)this.writeU8(201),this.writeU32(t);else throw new Error(`Too large extension object: ${t}`);this.writeI8(e.type),this.writeU8a(e.data)}writeU8(e){this.ensureBufferSizeToWrite(1),this.view.setUint8(this.pos,e),this.pos++}writeU8a(e){let t=e.length;this.ensureBufferSizeToWrite(t),this.bytes.set(e,this.pos),this.pos+=t}writeI8(e){this.ensureBufferSizeToWrite(1),this.view.setInt8(this.pos,e),this.pos++}writeU16(e){this.ensureBufferSizeToWrite(2),this.view.setUint16(this.pos,e),this.pos+=2}writeI16(e){this.ensureBufferSizeToWrite(2),this.view.setInt16(this.pos,e),this.pos+=2}writeU32(e){this.ensureBufferSizeToWrite(4),this.view.setUint32(this.pos,e),this.pos+=4}writeI32(e){this.ensureBufferSizeToWrite(4),this.view.setInt32(this.pos,e),this.pos+=4}writeF32(e){this.ensureBufferSizeToWrite(4),this.view.setFloat32(this.pos,e),this.pos+=4}writeF64(e){this.ensureBufferSizeToWrite(8),this.view.setFloat64(this.pos,e),this.pos+=8}writeU64(e){this.ensureBufferSizeToWrite(8),_a(this.view,this.pos,e),this.pos+=8}writeI64(e){this.ensureBufferSizeToWrite(8),Sn(this.view,this.pos,e),this.pos+=8}writeBigUint64(e){this.ensureBufferSizeToWrite(8),this.view.setBigUint64(this.pos,e),this.pos+=8}writeBigInt64(e){this.ensureBufferSizeToWrite(8),this.view.setBigInt64(this.pos,e),this.pos+=8}};function ya(r,e){return new Ft(e).encodeSharedRef(r)}function Cn(r){return`${r<0?"-":""}0x${Math.abs(r).toString(16).padStart(2,"0")}`}var _c=16,bc=16,On=class{hit=0;miss=0;caches;maxKeyLength;maxLengthPerKey;constructor(e=_c,t=bc){this.maxKeyLength=e,this.maxLengthPerKey=t,this.caches=[];for(let n=0;n<this.maxKeyLength;n++)this.caches.push([])}canBeCached(e){return e>0&&e<=this.maxKeyLength}find(e,t,n){let s=this.caches[n-1];e:for(let i of s){let a=i.bytes;for(let o=0;o<n;o++)if(a[o]!==e[t+o])continue e;return i.str}return null}store(e,t){let n=this.caches[e.length-1],s={bytes:e,str:t};n.length>=this.maxLengthPerKey?n[Math.random()*n.length|0]=s:n.push(s)}decode(e,t,n){let s=this.find(e,t,n);if(s!=null)return this.hit++,s;this.miss++;let i=Ms(e,t,n),a=Uint8Array.prototype.slice.call(e,t,t+n);return this.store(a,i),i}};var js="array",yr="map_key",Ea="map_value",wc=r=>{if(typeof r=="string"||typeof r=="number")return r;throw new ce("The type of key must be string or number but "+typeof r)},Vs=class{stack=[];stackHeadPosition=-1;get length(){return this.stackHeadPosition+1}top(){return this.stack[this.stackHeadPosition]}pushArrayState(e){let t=this.getUninitializedStateFromPool();t.type=js,t.position=0,t.size=e,t.array=new Array(e)}pushMapState(e){let t=this.getUninitializedStateFromPool();t.type=yr,t.readCount=0,t.size=e,t.map={}}getUninitializedStateFromPool(){if(this.stackHeadPosition++,this.stackHeadPosition===this.stack.length){let e={type:void 0,size:0,array:void 0,position:0,readCount:0,map:void 0,key:null};this.stack.push(e)}return this.stack[this.stackHeadPosition]}release(e){if(this.stack[this.stackHeadPosition]!==e)throw new Error("Invalid stack state. Released state is not on top of the stack.");if(e.type===js){let n=e;n.size=0,n.array=void 0,n.position=0,n.type=void 0}if(e.type===yr||e.type===Ea){let n=e;n.size=0,n.map=void 0,n.readCount=0,n.type=void 0}this.stackHeadPosition--}reset(){this.stack.length=0,this.stackHeadPosition=-1}},wr=-1,Hs=new DataView(new ArrayBuffer(0)),yc=new Uint8Array(Hs.buffer);try{Hs.getInt8(0)}catch(r){if(!(r instanceof RangeError))throw new Error("This module is not supported in the current JavaScript engine because DataView does not throw RangeError on out-of-bounds access")}var va=new RangeError("Insufficient data"),vc=new On,Ce=class r{extensionCodec;context;useBigInt64;rawStrings;maxStrLength;maxBinLength;maxArrayLength;maxMapLength;maxExtLength;keyDecoder;mapKeyConverter;totalPos=0;pos=0;view=Hs;bytes=yc;headByte=wr;stack=new Vs;entered=!1;constructor(e){this.extensionCodec=e?.extensionCodec??it.defaultCodec,this.context=e?.context,this.useBigInt64=e?.useBigInt64??!1,this.rawStrings=e?.rawStrings??!1,this.maxStrLength=e?.maxStrLength??4294967295,this.maxBinLength=e?.maxBinLength??4294967295,this.maxArrayLength=e?.maxArrayLength??4294967295,this.maxMapLength=e?.maxMapLength??4294967295,this.maxExtLength=e?.maxExtLength??4294967295,this.keyDecoder=e?.keyDecoder!==void 0?e.keyDecoder:vc,this.mapKeyConverter=e?.mapKeyConverter??wc}clone(){return new r({extensionCodec:this.extensionCodec,context:this.context,useBigInt64:this.useBigInt64,rawStrings:this.rawStrings,maxStrLength:this.maxStrLength,maxBinLength:this.maxBinLength,maxArrayLength:this.maxArrayLength,maxMapLength:this.maxMapLength,maxExtLength:this.maxExtLength,keyDecoder:this.keyDecoder})}reinitializeState(){this.totalPos=0,this.headByte=wr,this.stack.reset()}setBuffer(e){let t=_r(e);this.bytes=t,this.view=new DataView(t.buffer,t.byteOffset,t.byteLength),this.pos=0}appendBuffer(e){if(this.headByte===wr&&!this.hasRemaining(1))this.setBuffer(e);else{let t=this.bytes.subarray(this.pos),n=_r(e),s=new Uint8Array(t.length+n.length);s.set(t),s.set(n,t.length),this.setBuffer(s)}}hasRemaining(e){return this.view.byteLength-this.pos>=e}createExtraByteError(e){let{view:t,pos:n}=this;return new RangeError(`Extra ${t.byteLength-n} of ${t.byteLength} byte(s) found at buffer[${e}]`)}decode(e){if(this.entered)return this.clone().decode(e);try{this.entered=!0,this.reinitializeState(),this.setBuffer(e);let t=this.doDecodeSync();if(this.hasRemaining(1))throw this.createExtraByteError(this.pos);return t}finally{this.entered=!1}}*decodeMulti(e){if(this.entered){yield*this.clone().decodeMulti(e);return}try{for(this.entered=!0,this.reinitializeState(),this.setBuffer(e);this.hasRemaining(1);)yield this.doDecodeSync()}finally{this.entered=!1}}async decodeAsync(e){if(this.entered)return this.clone().decodeAsync(e);try{this.entered=!0;let t=!1,n;for await(let o of e){if(t)throw this.entered=!1,this.createExtraByteError(this.totalPos);this.appendBuffer(o);try{n=this.doDecodeSync(),t=!0}catch(l){if(!(l instanceof RangeError))throw l}this.totalPos+=this.pos}if(t){if(this.hasRemaining(1))throw this.createExtraByteError(this.totalPos);return n}let{headByte:s,pos:i,totalPos:a}=this;throw new RangeError(`Insufficient data in parsing ${Cn(s)} at ${a} (${i} in the current buffer)`)}finally{this.entered=!1}}decodeArrayStream(e){return this.decodeMultiAsync(e,!0)}decodeStream(e){return this.decodeMultiAsync(e,!1)}async*decodeMultiAsync(e,t){if(this.entered){yield*this.clone().decodeMultiAsync(e,t);return}try{this.entered=!0;let n=t,s=-1;for await(let i of e){if(t&&s===0)throw this.createExtraByteError(this.totalPos);this.appendBuffer(i),n&&(s=this.readArraySize(),n=!1,this.complete());try{for(;yield this.doDecodeSync(),--s!==0;);}catch(a){if(!(a instanceof RangeError))throw a}this.totalPos+=this.pos}}finally{this.entered=!1}}doDecodeSync(){e:for(;;){let e=this.readHeadByte(),t;if(e>=224)t=e-256;else if(e<192)if(e<128)t=e;else if(e<144){let s=e-128;if(s!==0){this.pushMapState(s),this.complete();continue e}else t={}}else if(e<160){let s=e-144;if(s!==0){this.pushArrayState(s),this.complete();continue e}else t=[]}else{let s=e-160;t=this.decodeString(s,0)}else if(e===192)t=null;else if(e===194)t=!1;else if(e===195)t=!0;else if(e===202)t=this.readF32();else if(e===203)t=this.readF64();else if(e===204)t=this.readU8();else if(e===205)t=this.readU16();else if(e===206)t=this.readU32();else if(e===207)this.useBigInt64?t=this.readU64AsBigInt():t=this.readU64();else if(e===208)t=this.readI8();else if(e===209)t=this.readI16();else if(e===210)t=this.readI32();else if(e===211)this.useBigInt64?t=this.readI64AsBigInt():t=this.readI64();else if(e===217){let s=this.lookU8();t=this.decodeString(s,1)}else if(e===218){let s=this.lookU16();t=this.decodeString(s,2)}else if(e===219){let s=this.lookU32();t=this.decodeString(s,4)}else if(e===220){let s=this.readU16();if(s!==0){this.pushArrayState(s),this.complete();continue e}else t=[]}else if(e===221){let s=this.readU32();if(s!==0){this.pushArrayState(s),this.complete();continue e}else t=[]}else if(e===222){let s=this.readU16();if(s!==0){this.pushMapState(s),this.complete();continue e}else t={}}else if(e===223){let s=this.readU32();if(s!==0){this.pushMapState(s),this.complete();continue e}else t={}}else if(e===196){let s=this.lookU8();t=this.decodeBinary(s,1)}else if(e===197){let s=this.lookU16();t=this.decodeBinary(s,2)}else if(e===198){let s=this.lookU32();t=this.decodeBinary(s,4)}else if(e===212)t=this.decodeExtension(1,0);else if(e===213)t=this.decodeExtension(2,0);else if(e===214)t=this.decodeExtension(4,0);else if(e===215)t=this.decodeExtension(8,0);else if(e===216)t=this.decodeExtension(16,0);else if(e===199){let s=this.lookU8();t=this.decodeExtension(s,1)}else if(e===200){let s=this.lookU16();t=this.decodeExtension(s,2)}else if(e===201){let s=this.lookU32();t=this.decodeExtension(s,4)}else throw new ce(`Unrecognized type byte: ${Cn(e)}`);this.complete();let n=this.stack;for(;n.length>0;){let s=n.top();if(s.type===js)if(s.array[s.position]=t,s.position++,s.position===s.size)t=s.array,n.release(s);else continue e;else if(s.type===yr){if(t==="__proto__")throw new ce("The key __proto__ is not allowed");s.key=this.mapKeyConverter(t),s.type=Ea;continue e}else if(s.map[s.key]=t,s.readCount++,s.readCount===s.size)t=s.map,n.release(s);else{s.key=null,s.type=yr;continue e}}return t}}readHeadByte(){return this.headByte===wr&&(this.headByte=this.readU8()),this.headByte}complete(){this.headByte=wr}readArraySize(){let e=this.readHeadByte();switch(e){case 220:return this.readU16();case 221:return this.readU32();default:{if(e<160)return e-144;throw new ce(`Unrecognized array type byte: ${Cn(e)}`)}}}pushMapState(e){if(e>this.maxMapLength)throw new ce(`Max length exceeded: map length (${e}) > maxMapLengthLength (${this.maxMapLength})`);this.stack.pushMapState(e)}pushArrayState(e){if(e>this.maxArrayLength)throw new ce(`Max length exceeded: array length (${e}) > maxArrayLength (${this.maxArrayLength})`);this.stack.pushArrayState(e)}decodeString(e,t){return!this.rawStrings||this.stateIsMapKey()?this.decodeUtf8String(e,t):this.decodeBinary(e,t)}decodeUtf8String(e,t){if(e>this.maxStrLength)throw new ce(`Max length exceeded: UTF-8 byte length (${e}) > maxStrLength (${this.maxStrLength})`);if(this.bytes.byteLength<this.pos+t+e)throw va;let n=this.pos+t,s;return this.stateIsMapKey()&&this.keyDecoder?.canBeCached(e)?s=this.keyDecoder.decode(this.bytes,n,e):s=ga(this.bytes,n,e),this.pos+=t+e,s}stateIsMapKey(){return this.stack.length>0?this.stack.top().type===yr:!1}decodeBinary(e,t){if(e>this.maxBinLength)throw new ce(`Max length exceeded: bin length (${e}) > maxBinLength (${this.maxBinLength})`);if(!this.hasRemaining(e+t))throw va;let n=this.pos+t,s=this.bytes.subarray(n,n+e);return this.pos+=t+e,s}decodeExtension(e,t){if(e>this.maxExtLength)throw new ce(`Max length exceeded: ext length (${e}) > maxExtLength (${this.maxExtLength})`);let n=this.view.getInt8(this.pos+t),s=this.decodeBinary(e,t+1);return this.extensionCodec.decode(s,n,this.context)}lookU8(){return this.view.getUint8(this.pos)}lookU16(){return this.view.getUint16(this.pos)}lookU32(){return this.view.getUint32(this.pos)}readU8(){let e=this.view.getUint8(this.pos);return this.pos++,e}readI8(){let e=this.view.getInt8(this.pos);return this.pos++,e}readU16(){let e=this.view.getUint16(this.pos);return this.pos+=2,e}readI16(){let e=this.view.getInt16(this.pos);return this.pos+=2,e}readU32(){let e=this.view.getUint32(this.pos);return this.pos+=4,e}readI32(){let e=this.view.getInt32(this.pos);return this.pos+=4,e}readU64(){let e=ba(this.view,this.pos);return this.pos+=8,e}readI64(){let e=Nn(this.view,this.pos);return this.pos+=8,e}readU64AsBigInt(){let e=this.view.getBigUint64(this.pos);return this.pos+=8,e}readI64AsBigInt(){let e=this.view.getBigInt64(this.pos);return this.pos+=8,e}readF32(){let e=this.view.getFloat32(this.pos);return this.pos+=4,e}readF64(){let e=this.view.getFloat64(this.pos);return this.pos+=8,e}};function ka(r,e){return new Ce(e).decode(r)}function Aa(r,e){return new Ce(e).decodeMulti(r)}function Ec(r){return r[Symbol.asyncIterator]!=null}async function*kc(r){let e=r.getReader();try{for(;;){let{done:t,value:n}=await e.read();if(t)return;yield n}}finally{e.releaseLock()}}function Bn(r){return Ec(r)?r:kc(r)}async function Ta(r,e){let t=Bn(r);return new Ce(e).decodeAsync(t)}function Da(r,e){let t=Bn(r);return new Ce(e).decodeArrayStream(t)}function xa(r,e){let t=Bn(r);return new Ce(e).decodeStream(t)}var Jn=Xi(pi(),1),hi=ua,mi=pa,je=zs,Io=Jn.DOMParser,Ro=Jn.XMLSerializer;var Mo=je!==null;function $o(){if(!Mo)throw new Error("@msgpack/msgpack is required for MessagePack support. Install with: npm install @msgpack/msgpack")}var Lo=kf();function kf(){if(!Mo)return null;let r=new TextEncoder,e=new TextDecoder,t=new je.ExtensionCodec;return t.register({type:-1,encode:n=>{if(n instanceof Date){let s=Pr(n);if(s==="D"||s==="H")return null}return je.encodeTimestampExtension(n)},decode:n=>je.decodeTimestampExtension(n)}),t.register({type:1,encode:n=>Je(n)?r.encode(n.toString()):null,decode:n=>Kn(e.decode(n))}),t.register({type:2,encode:n=>{if(n instanceof Date&&Pr(n)==="D"){let s=n.getUTCFullYear(),i=String(n.getUTCMonth()+1).padStart(2,"0"),a=String(n.getUTCDate()).padStart(2,"0");return r.encode(`${s}-${i}-${a}`)}return null},decode:n=>new Date(e.decode(n)+"T00:00:00.000Z")}),t.register({type:3,encode:n=>{if(n instanceof Date&&Pr(n)==="H"){let s=String(n.getUTCHours()).padStart(2,"0"),i=String(n.getUTCMinutes()).padStart(2,"0"),a=String(n.getUTCSeconds()).padStart(2,"0"),o=String(n.getUTCMilliseconds()).padStart(3,"0");return r.encode(`${s}:${i}:${a}.${o}`)}return null},decode:n=>{let s=e.decode(n),i=s.indexOf("."),a=i>=0?s.substring(0,i):s,o=i>=0?s.substring(i+1):"0",[l,u,c]=a.split(":"),d=Math.round(+o.substring(0,3));return new Date(Date.UTC(1970,0,1,+l,+u,+c,d))}}),t.register({type:4,encode:n=>{let s=gi(n);if(s!==null){let[i,a]=s;return r.encode(`${i}:${a(n)}`)}return null},decode:n=>{let s=e.decode(n),i=s.indexOf(":"),a=s.slice(0,i),o=s.slice(i+1),l=ft[a];if(l!==void 0){let[,u]=l;return u(o)}return`${o}::${a}`}}),t}function Fo(r){return $o(),je.encode(r,{extensionCodec:Lo})}function Uo(r){return $o(),je.decode(r,{extensionCodec:Lo})}function es(r,e=!1){let t=ts(r);if(t===null)return[!1,String(r)];let[n,s,i]=t;return i&&!e?[!1,String(r)]:[!0,`${s(r)}::${n}`]}function _i(r){if(!r.includes("::"))return[!1,r];let e=r.lastIndexOf("::"),t=r.slice(0,e),n=r.slice(e+2),s=ft[n];if(s===void 0)return[!1,r];let[,i]=s;return[!0,i(t)]}function Qn(r,e,t){if(r!==null&&typeof r=="object"&&!Array.isArray(r)){let n={};for(let[s,i]of Object.entries(r))n[s]=Qn(i,e,t);return n}return Array.isArray(r)?r.map(n=>Qn(n,e,t)):t(r)?e(r):r}function bi(r){let e=ts(r);if(e!==null){let[t,n,s]=e;return s?[r,!1]:[`${n(r)}::${t}`,!0]}if(Array.isArray(r)){let t=!1;return[r.map(s=>{let[i,a]=bi(s);return a&&(t=!0),i}),t]}if(r!==null&&typeof r=="object"){let t=!1,n={};for(let[s,i]of Object.entries(r)){let[a,o]=bi(i);o&&(t=!0),n[s]=a}return[n,t]}return[r,!1]}function Af(r,e=!1){let[t,n]=es(r,e);if(t)return n;let[s,i]=bi(r),a=JSON.stringify(s);return i?`${a}::JS`:a}function Tf(r){return JSON.stringify(r)}function Df(r){if(!je)throw new Error("@msgpack/msgpack is required for MessagePack support");return je.encode(r)}function le(r,e=null,{raw:t=!1,qs:n=!1,_forceSuffix:s=!1}={}){if(n)return`${qo(r)}::QS`;if(t){if(e===null||e==="json")return Tf(r);if(e==="msgpack")return Df(r);throw e==="xml"?new Error("raw=true is not supported for XML transport"):new Error(`Unknown transport: ${e}`)}if(e===null||e==="json"){let i=Af(r,s);return e==="json"?`"${i}"`:i}else{if(e==="xml")return`<?xml version="1.0" ?><tytx_root>${Po(r)}</tytx_root>`;if(e==="msgpack")return Fo(r);throw new Error(`Unknown transport: ${e}`)}}var nr,wi;typeof window<"u"&&window.DOMParser?(nr=window.DOMParser,wi=window.XMLSerializer):(nr=Io,wi=Ro);function jo(r){if(r===null||typeof r!="object"||Array.isArray(r))return!1;let e=Object.keys(r);if(e.length!==1)return!1;let t=r[e[0]];return t!==null&&typeof t=="object"&&"value"in t}function Vo(r,e,t){let n=r.createElement(e),s=t.attrs||{},i=t.value;for(let[a,o]of Object.entries(s))n.setAttribute(a,le(o,null,{_forceSuffix:!0}));if(Array.isArray(i))for(let a of i)if(jo(a)){let[o]=Object.keys(a),l=a[o],u=Vo(r,o,l);n.appendChild(u)}else{n.textContent=le(i);break}else n.textContent=le(i);return n}function Po(r){if(!nr)throw new Error("XML support requires @xmldom/xmldom package in Node.js");if(jo(r)){let[e]=Object.keys(r),t=r[e],n=new nr().parseFromString("<root/>","text/xml"),s=Vo(n,e,t);return new wi().serializeToString(s)}else return le(r)}function yi(r){let e={};for(let n=0;n<r.attributes.length;n++){let s=r.attributes[n];e[s.name]=H(s.value)}let t=[];for(let n=0;n<r.childNodes.length;n++){let s=r.childNodes[n];s.nodeType===1&&t.push(s)}if(t.length>0)if(t.length===1){let n=t[0],s=yi(n);return{attrs:e,value:{[n.tagName]:s}}}else{let n=[];for(let s of t){let i=yi(s);n.push({[s.tagName]:i})}return{attrs:e,value:n}}return{attrs:e,value:H(r.textContent)}}function Ho(r){if(!nr)throw new Error("XML support requires @xmldom/xmldom package in Node.js");let n=new nr().parseFromString(r,"text/xml").documentElement;if(n.tagName==="tytx_root"){let i=null;for(let a=0;a<n.childNodes.length;a++)if(n.childNodes[a].nodeType===1){i=n.childNodes[a];break}if(!i)return H(n.textContent);n=i}let s=yi(n);return{[n.tagName]:s}}function xf(r){return typeof r=="string"}function Sf(r){let[e,t]=_i(r);if(e)return t;let n=r;n.endsWith("::JS")&&(n=n.slice(0,-4));let s;try{s=JSON.parse(n)}catch{return r}return Qn(s,Nf,xf)}function Nf(r){return r.includes("::")?_i(r)[1]:r}function Cf(r){let e=Ho(r);return typeof e=="string"?H(e):e}function Of(r){return Uo(r)}function H(r,e=null){if(r===null)return null;if(e===null||e==="json"){let t=r;return e==="json"&&r.startsWith('"')&&r.endsWith('"')&&(t=r.slice(1,-1)),Sf(t)}else{if(e==="xml")return Cf(r);if(e==="msgpack")return Of(r);throw new Error(`Unknown transport: ${e}`)}}function qo(r){if(Array.isArray(r))return r.map(e=>String(e)).join("&");if(r!==null&&typeof r=="object"){let e=[];for(let[t,n]of Object.entries(r)){let[s,i]=es(n,!0);s?e.push(`${t}=${i}`):e.push(`${t}=${n}`)}return e.join("&")}throw new TypeError(`toQs expects object or array, got ${typeof r}`)}function zo(r){if(!r)return[];let e=r.split("&"),t=e.map(a=>a.includes("=")),n=t.every(Boolean),s=!t.some(Boolean);if(!n&&!s)throw new Error("QS format error: mixed items with and without '='");if(s)return e.map(a=>H(a));let i={};for(let a of e){let o=a.indexOf("="),l=a.slice(0,o),u=a.slice(o+1);i[l]=H(u)}return i}var Wo=hi||mi||Number,Bf=hi?"decimal.js":mi?"big.js":"number";function Kn(r){return new Wo(r)}function Je(r){return Bf==="number"?!1:r instanceof Wo}function Pr(r){let e=r.getUTCFullYear()===1970&&r.getUTCMonth()===0&&r.getUTCDate()===1,t=r.getUTCHours()===0&&r.getUTCMinutes()===0&&r.getUTCSeconds()===0&&r.getUTCMilliseconds()===0;return e&&!t?"H":t&&!e?"D":"DHZ"}function If(r){return r.toString()}function Rf(r){let e=r.getUTCFullYear(),t=String(r.getUTCMonth()+1).padStart(2,"0"),n=String(r.getUTCDate()).padStart(2,"0");return`${e}-${t}-${n}`}function Mf(r){return r.toISOString()}function $f(r){let e=String(r.getUTCHours()).padStart(2,"0"),t=String(r.getUTCMinutes()).padStart(2,"0"),n=String(r.getUTCSeconds()).padStart(2,"0"),s=String(r.getUTCMilliseconds()).padStart(3,"0");return`${e}:${t}:${n}.${s}`}function Lf(r){return r?"true":"false"}function Ff(r){return r.toString()}function Uf(r){return r.toString()}function Pf(r){let e="";for(let t=0;t<r.length;t+=32768)e+=String.fromCharCode.apply(null,r.subarray(t,t+32768));return btoa(e)}var rs=[],vi=new Map;function gi(r){if(r===null||typeof r!="object")return null;for(let e=Object.getPrototypeOf(r);e!==null;e=Object.getPrototypeOf(e))for(let[t,n,s,i]of rs)if(t.prototype===e)return[n,s,i];return null}function ts(r){if(r===null)return["NN",()=>"",!0];if(Je(r))return["N",If,!1];if(r instanceof Uint8Array)return["RAW",Pf,!1];if(r instanceof Date){let e=Pr(r);return e==="D"?["D",Rf,!1]:e==="H"?["H",$f,!1]:["DHZ",Mf,!1]}return typeof r=="boolean"?["B",Lf,!0]:typeof r=="number"?Number.isInteger(r)?["L",Ff,!0]:["R",Uf,!0]:gi(r)}function qf(r){return Kn(r)}function jf(r){let[e,t,n]=r.split("-").map(Number);return new Date(Date.UTC(e,t-1,n,0,0,0,0))}function Go(r){return new Date(r)}function Vf(r){let[e,t,n]=r.split(":"),[s,i]=n.split(".");return new Date(Date.UTC(1970,0,1,Number(e),Number(t),Number(s),Number(i||0)))}function Hf(r){return r.toLowerCase()==="true"}function zf(r){return parseInt(r,10)}function Gf(r){return parseFloat(r)}function Wf(r){return r}function Xf(r){return null}var Yf=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/;function Zf(r){if(!Yf.test(r))throw new Error(`RAW payload is not standard padded base64: '${r}'`);let e=atob(r),t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t}function Jf(r){return zo(r)}var Kf=/^[A-Z]+$/,ft={N:[Object,qf],D:[Date,jf],DH:[Date,Go],DHZ:[Date,Go],H:[Date,Vf],L:[Number,zf],R:[Number,Gf],T:[String,Wf],B:[Boolean,Hf],QS:[Object,Jf],NN:[null,Xf],RAW:[Uint8Array,Zf]};function qr(r){return Object.hasOwn(ft,r)?ft[r][0]:null}function Xo(r,e,t,n,s=!1){if(typeof e!="string"||!Kf.test(e))throw new Error(`TYTX suffix '${e}' is invalid: expected uppercase ASCII letters only`);let i=ft[e];if(i!==void 0&&i[0]!==r){let a=i[0]===null?"null":i[0].name;throw new Error(`TYTX suffix '${e}' is already registered for ${a}`)}rs=rs.filter(([a])=>a!==r),rs.push([r,e,t,s]),ft[e]=[r,n]}function Ei(r){if(!r.tytxSuffix)throw new Error(`registerClass: ${r.name} is missing a static tytxSuffix`);if(typeof r.prototype?.toTytx!="function")throw new Error(`registerClass: ${r.name} is missing a toTytx method`);if(typeof r.fromTytx!="function")throw new Error(`registerClass: ${r.name} is missing a static fromTytx method`);return Xo(r,r.tytxSuffix,e=>e.toTytx(),e=>r.fromTytx(e),r.tytxJsonNative||!1),r}function At(r,e){vi.set(r,e)}function xe(r){return vi.has(r)?vi.get(r):{}}var Yo={network:{maxAttempts:3,delay:1,backoff:2,jitter:!0,on:["TypeError","NetworkError","AbortError"]},aggressive:{maxAttempts:5,delay:.5,backoff:2,jitter:!0,on:["Error"]},gentle:{maxAttempts:2,delay:2,backoff:1.5,jitter:!1,on:["TypeError","NetworkError"]}};function ep(r){let e=r._retryPolicy;return e==null?null:typeof e=="string"?Yo[e]||null:e}function tp(r,e){return e.some(t=>t==="Error"?!0:r.name===t||r.constructor.name===t)}function rp(r){return new Promise(e=>setTimeout(e,r))}async function np(r,e){if(!e)return r();let t=e.maxAttempts||3,n=e.delay||1,s=e.backoff||2,i=e.jitter!==!1,a=e.on||["Error"],o=null,l=n*1e3;for(let u=0;u<t;u++)try{let c=r();return c instanceof Promise?await c:c}catch(c){if(o=c,u<t-1&&tp(c,a)){let d=l;i&&(d*=1+Math.random()*.1),await rp(d),l*=s}else throw c}throw o}var X=class r{static classKwargs={cacheTime:0,readOnly:!1,asBag:null,retryPolicy:null};static classArgs=[];static internalParams=new Set(["cacheTime","readOnly","asBag","retryPolicy"]);constructor(e={}){let n={...this.constructor.classKwargs,...e};this.cacheTime=n.cacheTime,this._readOnly=n.readOnly,this._asBag=n.asBag,this._retryPolicy=n.retryPolicy,this._kw={};let s=this.constructor.internalParams;for(let[i,a]of Object.entries(n))s.has(i)||(this._kw[i]=a);this._lastUpdate=null,this._node=null,this._lastEffectiveFingerprint=null,this._cachedValue=null,this.init()}init(){}setNode(e){e!==this._node&&!this.readOnly&&this._lastUpdate!==null&&this.reset(),this._node=e,this.onSetResolver(e)}onSetResolver(e){}get node(){return this._node}get cacheTime(){return this._cacheTime}set cacheTime(e){if(typeof e=="boolean")throw new TypeError("cacheTime must be numeric; use a negative value for infinite caching");this._cacheTime=e}get readOnly(){return this._readOnly}get expired(){return this._cacheTime<0?this._lastUpdate===null:this._cacheTime===0||this._lastUpdate===null?!0:(Date.now()-this._lastUpdate)/1e3>this._cacheTime}reset(){this._lastUpdate=null,this._lastEffectiveFingerprint=null}get cachedValue(){return!this.readOnly&&this._node?this._node._value:this._cachedValue}set cachedValue(e){!this.readOnly&&this._node?this._node.setValue(e,!1):this._cachedValue=e}_computeEffectiveFingerprint(e){return JSON.stringify(Object.entries(e).sort())}resolve(e={}){let{static:t=!1,...n}=e;if(t)return this._node?this._node._value:this.cachedValue;let s={...this._kw};if(this._node&&this._node.attr){let u=this.constructor.internalParams;for(let[c,d]of Object.entries(this._node.attr))!u.has(c)&&!(c in s)&&(s[c]=d)}Object.assign(s,n);let i=this._computeEffectiveFingerprint(s);if(i===this._lastEffectiveFingerprint&&!this.expired)return this.cachedValue;this._lastEffectiveFingerprint=i;let a=ep(this),o=()=>this.load(s);if(a)return np(o,a).then(u=>this._finalize(u));let l=o();return l&&typeof l.then=="function"?l.then(u=>this._finalize(u)):this._finalize(l)}_finalize(e){let t;return this._asBag===!0?t=!0:this._asBag===!1?t=!1:t=!this._readOnly,t&&e!==null&&e!==void 0&&(e=this._convertToBag(e)),this._lastUpdate=Date.now(),(!this.readOnly||this.cacheTime!==0)&&(this.cachedValue=e),e}_convertToBag(e){let t=r._BagClass;if(!t||e&&typeof e._htraverse=="function")return e;if(typeof e=="string"){if(e=e.trim(),e.startsWith("<")&&t.fromXml)return t.fromXml(e);if((e.startsWith("{")||e.startsWith("["))&&t.fromJson)return t.fromJson(e)}return e}static registerBagClass(e){r._BagClass=e}load(e){return null}};X._BagClass=null;var jr=class extends X{static classKwargs={cacheTime:0,readOnly:!1,asBag:!1,retryPolicy:null,callback:null};static classArgs=["callback"];static internalParams=new Set(["cacheTime","readOnly","asBag","retryPolicy","callback"]);constructor(e={}){typeof e=="function"&&(e={callback:e}),super(e),this._callback=e.callback||null}load(e){return this._callback?this._callback.call(this,e):null}};var Oe=class r{constructor(e,t,n=null,s=null,i=null,a=null,o=null,l=!0){this.label=t,this._value=null,this._attr={},this._parentBag=null,this._resolver=null,this._nodeSubscribers={},this._onChangedValue=null,this.nodeTag=a,this.xmlTag=o,this._compiled=null,this.parentBag=e,s&&this.setAttr(s,!1,!0,l),n!==null&&this.setValue(n,!1),i&&(this.resolver=i)}get parentBag(){return this._parentBag}set parentBag(e){e===null&&this._value?.parentNode===this&&this._value.setBackref(),this._parentBag=e,e?.backref&&this._value&&typeof this._value._htraverse=="function"&&this._value.setBackref(this,e)}get value(){return this.getValue()}set value(e){this.setValue(e)}getValue(e=!1,t=null,n={}){if(t!==null){let s=H(`${t}::QS`);if(Array.isArray(s)){let i=s.length?s:Object.keys(this._attr),a=i.map(l=>{let u=this.getAttr(l);return!e&&u instanceof X?u.resolve():u}),o=l=>s.length===0?Object.fromEntries(i.map((u,c)=>[u,l[c]])):l.length===1?l[0]:l;return a.some(l=>l&&typeof l.then=="function")?Promise.all(a).then(o):o(a)}else{if(!this._resolver)throw new Error("Cannot use kwargs syntax without resolver");n={...n,...s}}}return this._resolver!==null?this._resolver.resolve({static:e,...n}):this._value}setValue(e,t=!0,n=null,s=null,i=!0,a=null,o=!1){e instanceof X?(this.resolver=e,e=null):e instanceof r&&(n=n||{},Object.assign(n,e._attr),e.resolver&&(this.resolver=e.resolver),e=e._value);let l=this._value;l!==e&&l?.parentNode===this&&l.setBackref(),this._value=e;let u=l!==this._value,c=t??!0,d=null;if(n!==null){let p={...this._attr};this.setAttr(n,!1,s,i);let h=this._buildAttrDiff(p,this._attr);d=Object.keys(h).length>0?h:null}t=c&&(u||d!==null);let f=d?u?"upd_value_attr":"upd_attrs":"upd_value";if(this._onChangedValue&&this._onChangedValue(this,e,l,c),t){let p=d!==null?{oldvalue:l,attrs_diff:d}:{oldvalue:l};for(let h of Object.values(this._nodeSubscribers))h({node:this,info:p,evt:f})}this._parentBag!==null&&this._parentBag.backref&&(e&&typeof e._htraverse=="function"&&e.setBackref(this,this._parentBag),t&&this._parentBag._onNodeChanged(this,[this.label],f,l,d,a,o))}replace(e){if(!(e instanceof r))throw new TypeError("BagNode.replace expects a BagNode");if(e===this)return this;let t=e.staticValue;t&&typeof t._htraverse=="function"&&(t=t.createChildBag().replace(t));let n=null;e.resolver&&(n=Object.create(Object.getPrototypeOf(e.resolver),Object.getOwnPropertyDescriptors(e.resolver)),n._node=null,n._kw={...e.resolver._kw});let s=this._value,i={...this._attr},a=this.resolver;a&&a._node===this&&(a._node=null),this.resolver=n,this.setValue(t,!1,{...e.attr},!1,!1,null);let o=this._buildAttrDiff(i,this._attr),l=Object.keys(o).length?o:null,u=s!==t||a!==n;if(u||l){let c=l?u?"upd_value_attr":"upd_attrs":"upd_value",d=l?{oldvalue:s,attrs_diff:l}:{oldvalue:s};for(let f of Object.values(this._nodeSubscribers))f({node:this,info:d,evt:c});this._parentBag!==null&&this._parentBag.backref&&this._parentBag._onNodeChanged(this,[this.label],c,s,l)}return this}get staticValue(){return this._value}set staticValue(e){this._value=e}get resolver(){return this._resolver}set resolver(e){this._resolver=e,e&&e.setNode&&e.setNode(this)}resetResolver(){if(!this._resolver)throw new Error("Cannot reset resolver: node has no resolver");this._resolver.reset(),this.setValue(null)}get attr(){return this._attr}getAttr(e=null,t=null){return e?e in this._attr?this._attr[e]:t:this._attr}_buildAttrDiff(e,t){let n={},s=new Set([...Object.keys(e),...Object.keys(t)]);for(let i of s){let a=i in e?e[i]:null,o=i in t?t[i]:null;a!==o&&(n[i]={old:a,new:o})}return n}setAttr(e=null,t=!0,n=!0,s=!0){let i=e||{},a=Object.keys(this._nodeSubscribers).length>0,l=t&&(a||this._parentBag!==null&&this._parentBag.backref)?{...this._attr}:null;if(n?Object.assign(this._attr,i):this._attr={...i},s)for(let u of Object.keys(this._attr))this._attr[u]===null&&delete this._attr[u];if(t&&l!==null){let u=this._buildAttrDiff(l,this._attr);if(Object.keys(u).length>0&&a)for(let c of Object.values(this._nodeSubscribers))c({node:this,info:{attrs_diff:u},evt:"upd_attrs"});if(Object.keys(u).length>0&&this._parentBag!==null&&this._parentBag.backref){let c=t===!0?"true":String(t);this._parentBag._onNodeChanged(this,[this.label],"upd_attrs",null,u,c)}}}delAttr(...e){for(let t of e)if(typeof t=="string"&&t.includes(","))for(let n of t.split(","))delete this._attr[n.trim()];else delete this._attr[t]}hasAttr(e,t=null){return e in this._attr?t!==null?this._attr[e]===t:!0:!1}getInheritedAttributes(){let e={};return this._parentBag&&this._parentBag.parentNode&&(e=this._parentBag.parentNode.getInheritedAttributes()),{...e,...this._attr}}subscribe(e,t){this._nodeSubscribers[e]=t}unsubscribe(e){delete this._nodeSubscribers[e]}get compiled(){return this._compiled||(this._compiled={}),this._compiled}get isBranch(){return this._value!=null&&typeof this._value._htraverse=="function"}get position(){return this._parentBag===null?null:this._parentBag._nodes.index(this.label)}get fullpath(){if(this._parentBag!==null){let e=this._parentBag.fullpath;return e?`${e}.${this.label}`:this.label}return null}get parentNode(){return this._parentBag?this._parentBag.parentNode:null}attributeOwnerNode(e,t=null){let n=this;if(t===null)for(;n&&!(e in n._attr);)n=n.parentNode;else for(;n&&n._attr[e]!==t;)n=n.parentNode;return n}asTuple(){return[this.label,this.value,this._attr,this._resolver||null]}isEqual(e){if(!(e instanceof r)||this.label!==e.label)return!1;let t=Object.keys(this._attr),n=Object.keys(e._attr);if(t.length!==n.length)return!1;for(let s of t)if(this._attr[s]!==e._attr[s])return!1;return this._resolver!==null?this._resolver===e._resolver:this._value&&typeof this._value.equalTo=="function"?this._value.equalTo(e._value):this._value&&typeof this._value.isEqual=="function"?this._value.isEqual(e._value):this._value===e._value}diff(e){if(this.label!==e.label)return`Other label: ${e.label}`;let t=Object.keys(this._attr),n=Object.keys(e._attr);return t.length!==n.length||t.some(s=>this._attr[s]!==e._attr[s])?`attributes self:${JSON.stringify(this._attr)} --- other:${JSON.stringify(e._attr)}`:this._value!==e._value?`value self:${this._value} --- other:${e._value}`:null}toJson(e=!0){let t=this.value;return t&&typeof t.toJson=="function"&&(t=t.toJson(e,!0)),{label:this.label,value:t,attr:this._attr}}toString(){return`BagNode : ${this.label}`}};var Vr=class r{constructor(){this._dict=Object.create(null),this._list=[],this._parentBag=null}index(e){if(e in this._dict)return this._list.findIndex(n=>n.label===e);let t=e.match(/^#(\d+)$/);if(t){let n=parseInt(t[1],10);return n<this._list.length?n:-1}if(t=e.match(/^#(\w*)=(.*)$/),t){let[,n,s]=t,i=s.includes("::")?H(s):s;return n?this._list.findIndex(a=>a.getAttr(n)===i):this._list.findIndex(a=>a._value===i)}return-1}_parsePosition(e){let t=this._list.length;if(e==null||e===">")return t;if(typeof e=="number")return e<0&&(e=t+e),Math.max(0,Math.min(e,t));if(e==="<")return 0;if(e.startsWith("#")){let n=this._parseSharpIndex(e.slice(1),e);return Math.min(n,t)}if(e.startsWith("<")){let n=e.slice(1);if(n.startsWith("#")){let i=this._parseSharpIndex(n.slice(1),e);return Math.min(i,t)}let s=this.index(n);if(s<0)throw new Error(`Invalid node_position '${e}': label '${n}' not found`);return s}if(e.startsWith(">")){let n=e.slice(1);if(n.startsWith("#")){let i=this._parseSharpIndex(n.slice(1),e);return Math.min(i+1,t)}let s=this.index(n);if(s<0)throw new Error(`Invalid node_position '${e}': label '${n}' not found`);return s+1}throw new Error(`Invalid node_position '${e}': unrecognized syntax`)}_parseSharpIndex(e,t){if(!/^-?\d+$/.test(e))throw new Error(`Invalid node_position '${t}': '${e}' is not an integer`);let n=parseInt(e,10);if(n<0)throw new Error(`Invalid node_position '${t}': negative index not allowed in '#n' syntax`);return n}get(e){if(typeof e=="number")return e>=0&&e<this._list.length?this._list[e]:null;if(e.startsWith("#")){let t=this.index(e);return t>=0?this._list[t]:null}return this._dict[e]||null}set(e,t,n=">",s=null,i=null,a=null,o=!1,l=!0,u=null,c=!0,d=!1,f=null){let p=null;if(e.includes("?")&&([e,p]=e.split("?",2)),e==null||e.startsWith("#"))throw new Error("Cannot create new node with #n syntax");if(p){let m=p.split("&");if(m.length===1)s={[m[0]]:t};else{if(!Array.isArray(t)||t.length!==m.length)throw new Error("Wrong attributes assignment");s={};for(let g=0;g<m.length;g++)s[m[g]]=t[g]}t=null}let h=this._dict[e];if(h)f&&(h.nodeTag=f),a!==null&&(a===!1?h.resolver=null:h.resolver=a),p?h.setAttr(s,c,!0,l):h.setValue(t,c,s,o,l,u,d);else{let m=i&&i.nodeClass?i.nodeClass:Oe;h=new m(i,e,p?null:t,s,a,f,null,l);let g=this._parsePosition(n);this._dict[e]=h,this._list.splice(g,0,h),c&&i&&i.backref&&i._onNodeInserted(h,g,null,u,d)}return d&&h.setValue(null,!1),h}pop(e){let t=this.get(e);if(t){delete this._dict[t.label];let n=this._list.indexOf(t);return n>=0&&this._list.splice(n,1),t}return null}has(e){return e in this._dict}get length(){return this._list.length}clear(){this._dict=Object.create(null),this._list=[]}keys(){return this._list.map(e=>e.label)}values(){return this._list.map(e=>e.getValue())}items(){return this._list.map(e=>[e.label,e.getValue()])}[Symbol.iterator](){return this._list[Symbol.iterator]()}move(e,t,n=!0){if(t<0)return;let s=Array.isArray(e)?e:[e];if(s.length===0||t>=this._list.length)return;let i=this._list[t].label;if(s.length>1){let a=[...s].sort((c,d)=>c-d),o=a[0]<t?1:0,l=[];for(let c=a.length-1;c>=0;c--){let d=a[c];if(d>=0&&d<this._list.length){let f=this._list[d];this._list.splice(d,1),l.push(f),n&&this._parentBag&&this._parentBag.backref&&this._parentBag._onNodeDeleted(f,d)}}let u=this.index(i);u<0&&(u=this._list.length),u+=o;for(let c of l)this._list.splice(u,0,c),n&&this._parentBag&&this._parentBag.backref&&this._parentBag._onNodeInserted(c,u)}else{let a=s[0];if(a===t||a<0||a>=this._list.length)return;let o=this._list[a];this._list.splice(a,1),n&&this._parentBag&&this._parentBag.backref&&this._parentBag._onNodeDeleted(o,a),this._list.splice(t,0,o),n&&this._parentBag&&this._parentBag.backref&&this._parentBag._onNodeInserted(o,t)}}isEqual(e){if(!(e instanceof r)||this._list.length!==e._list.length)return!1;for(let t=0;t<this._list.length;t++){let n=this._list[t],s=e._list[t];if(!n.isEqual(s))return!1}return!0}};var Ko=Xi(pi(),1);var ki="::RSLV:",sp=new Map,ip=new Map,ns=new WeakMap,K=class extends Error{constructor(e){super(e),this.name="BagSerializationError"}},Hr=class extends X{constructor(e){super({asBag:!1}),ns.set(this,e)}get payload(){return ns.get(this)}load(){throw new K("This resolver is opaque; local execution is unavailable")}};function Zo(r){if(!r||typeof r!="object"||Array.isArray(r)||typeof r.resolver_module!="string"||typeof r.resolver_class!="string"||!Array.isArray(r.args??[])||!r.kwargs||typeof r.kwargs!="object"||Array.isArray(r.kwargs))throw new K("Invalid resolver description")}function Jo(r,e=new Set){if(!(r===null||typeof r=="string"||typeof r=="boolean")&&!(typeof r=="number"&&Number.isFinite(r))){if(typeof r!="object"||e.has(r)||!Array.isArray(r)&&Object.getPrototypeOf(r)!==Object.prototype&&Object.getPrototypeOf(r)!==null)throw new K("Resolver parameters must be JSON data; callbacks cannot travel");e.add(r);for(let t of Object.values(r))Jo(t,e);e.delete(r)}}function zr(r){if(ns.has(r))return ns.get(r);let e=ip.get(r.constructor);if(!e)throw new K(`Unregistered resolver: ${r.constructor.name}`);let t=e.encode(r),n={resolver_module:e.module,resolver_class:e.name,args:t.args??[],kwargs:t.kwargs??{}};return Zo(n),Jo(n),ki+JSON.stringify(n)}function Gr(r){if(typeof r!="string"||!r.startsWith(ki))return null;let e=r.slice(ki.length);if(/^[A-Za-z0-9_-]+\.[A-Za-z0-9_-]*\.[A-Za-z0-9_-]+$/.test(e))return new Hr(r);let t;try{t=JSON.parse(e)}catch{throw new K("Invalid resolver JSON or signed token")}Zo(t);let n=sp.get(JSON.stringify([t.resolver_module,t.resolver_class]));if(!n)return new Hr(r);let s=n.decode({args:t.args??[],kwargs:t.kwargs});if(!(s instanceof n.cls))throw new K("Resolver decoder returned an incompatible instance");return s}function ss(r){return Object.fromEntries(Object.entries(r||{}).map(([e,t])=>[e,t instanceof X?zr(t):t]))}function is(r){return Object.fromEntries(Object.entries(r||{}).map(([e,t])=>[e,Gr(t)??t]))}var Be="__cls";function sr(r,e){return r!==null&&r.tytxSuffix===e?r:qr(e)}function ap(r){let e=r.tytxSuffix,t=Object.entries(xe(e)).filter(([,n])=>n===r).map(([n])=>n);if(t.length===0)throw new K(`${r.name} is not in the TYTX subtype dictionary of '${e}'`);if(t.length>1)throw new K(`${r.name} is in the TYTX subtype dictionary of '${e}' under several names: ${t.sort().join(", ")}`);return t[0]}function Ai(r,e){let t=xe(r);if(!Object.hasOwn(t,e))throw new K(`Unknown Bag class '${e}' for TYTX type '${r}'`);return t[e]}function Ti(r,e){return r===e?null:ap(r)}function*Qo(r,e=""){for(let t of r){let n=e?`${e}.${t.label}`:t.label;yield[n,t];let s=t.getValue(!0);!t.resolver&&s instanceof P&&(yield*Qo(s,n))}}function op(r){let e=r.toISOString(),t=r.getUTCFullYear()===1970&&r.getUTCMonth()===0&&r.getUTCDate()===1,n=r.getUTCHours()===0&&r.getUTCMinutes()===0&&r.getUTCSeconds()===0&&r.getUTCMilliseconds()===0;if(n&&!t)return e.slice(0,e.indexOf("T"));let s=e.replace(/\.000Z$/,"Z");return t&&!n?s.slice(s.indexOf("T")+1):s}var P=class r{static tytxSuffix="X";constructor(e=null){this._nodes=new Vr,this._backref=!1,this._parent=null,this._parentNode=null,this._rootAttributes=null,this._updSubscribers={},this._insSubscribers={},this._delSubscribers={},e&&this._loadSource(e)}get parent(){return this._parent}set parent(e){this._parent=e}get parentNode(){return this._parentNode}set parentNode(e){this._parentNode=e}get backref(){return!!this._backref}get nodeClass(){return Oe}createChildBag(){return new this.constructor}get fullpath(){if(this._parent!==null&&this._parentNode!==null){let e=this._parent.fullpath;return e?`${e}.${this._parentNode.label}`:this._parentNode.label}return null}relativePath(e){let t=[],n=e;for(;n!==null;){if(n.parentBag===this)return t.push(n.label),t.reverse(),t.join(".");t.push(n.label),n=n.parentNode}return null}get length(){return this._nodes.length}get root(){let e=this;for(;e.parent!==null;)e=e.parent;return e}get attributes(){return this._parentNode!==null?this._parentNode.getAttr():{}}get rootAttributes(){return this._rootAttributes}set rootAttributes(e){this._rootAttributes=e!==null?{...e}:null}_htraverseBefore(e){let t=this,n;for(typeof e=="string"?(e=e.replace(/\.\.\//g,"#parent."),n=e.split(".").filter(s=>s)):n=[...e];n.length&&n[0]==="#parent"&&t!==null;)n.shift(),t=t.parent;return[t,n]}_htraverse(e,t=!1,n=!0){let[s,i]=this._htraverseBefore(e);if(s===null)return[null,null];if(i.length===0)return[s,""];for(;i.length>1&&s instanceof r;){let a=i[0];if(a==="#parent"){if(s.parent===null||s.parent===void 0)break;i.shift(),s=s.parent;continue}let o=s._nodes.get(a);if(!o)break;let l=o.getValue(n);if(l instanceof r)i.shift(),s=l;else if(t){let u=s.createChildBag();o.setValue(u,!0,null,!0,!0,"autocreate"),i.shift(),s=u}else break}if(!t)return i.length>1?[null,null]:[s,i[0]];for(;i.length>1;){let a=i.shift();if(a.startsWith("#"))throw new Wr("Not existing index in #n syntax");let o=s.createChildBag();s._nodes.set(a,o,">",null,s,null,!1,!0,"autocreate"),s=o}return[s,i[0]]}get(e,t=null,n=!0,s={}){if(!e)return this;if(e==="#parent")return this.parent;let i=null;e.includes("?")&&([e,i]=e.split("?",2));let a=this._nodes.get(e);return a?a.getValue(n,i,s):t}getItem(e,t=null,n=!1,s={}){if(!e)return this;let[i,a]=this._htraverse(e,!1,n);return i instanceof r?i.get(a,t,n,s):t}setItem(e,t,n=null,s=">",i=!1,a=!0,o=null,l=!1,u=!0,c=null,d=null){if(e==="")throw new RangeError("setItem requires a non-empty path");let[f,p]=this._htraverse(e,!0);return f._nodes.set(p,t,s,n,f,c,i,a,o,u,l,d)}_pop(e,t=null){let n=this._nodes.index(e);if(n>=0){let s=this._nodes.pop(n);return this.backref&&this._onNodeDeleted(s,n,t),s}return null}pop(e,t=null,n=null){let s=this.popNode(e,n);return s?s.value:t}delItem(e,t=null,n=null){return this.pop(e,t,n)}popNode(e,t=null){let[n,s]=this._htraverse(e,!1,!0);if(!n||!s)return null;let i=n._nodes.get(s);if(!i)return null;try{return n._pop(s,t)}finally{i.parentBag===n&&n._nodes._dict[i.label]!==i&&(i.parentBag=null)}}clear(){let e=[...this._nodes];this._nodes.clear(),this.backref&&this._onNodeDeleted(e,-1);for(let t of e)t.parentBag=null}getNode(e,t=!0,n=!1,s=null){if(e==null||e==="")return this.parentNode;if(typeof e=="number")return this._nodes.get(e);typeof e=="string"&&(e=e.split("?",1)[0]);let[i,a]=this._htraverse(e,n,t);if(i instanceof r&&a){let o=i._nodes.get(a);if(o)return o;if(n)return i._nodes.set(a,s,">",null,i,null,!1,!0,"autocreate"),i._nodes.get(a)}return null}setBackref(e=null,t=null){let n=this._backref;if(this._backref=!0,this._parent=t,this._parentNode=e,!n){this._nodes._parentBag=this;for(let s of this)s.parentBag=this}}delParentRef(){this._parent=null,this._parentNode=null,this._backref=!1}clearBackref(){if(this._backref){this._backref=!1,this._parent=null,this._parentNode=null,this._nodes._parentBag=null;for(let e of this){e.parentBag=null;let t=e.getValue(!0);t instanceof r&&t.clearBackref()}}}_onNodeChanged(e,t,n,s=null,i=null,a=null,o=!1){for(let l of Object.values(this._updSubscribers))l({node:e,pathlist:t,oldvalue:s,attrs_diff:i,evt:n,reason:a,fired:o});this._parent&&this._parentNode&&this._parent._onNodeChanged(e,[this._parentNode.label,...t],n,s,i,a,o)}_onNodeInserted(e,t,n=null,s=null,i=!1){let a=e.parentBag,o=e.getValue(!0);a!==null&&a.backref&&o instanceof r&&o.setBackref(e,a),n===null&&(n=[]);for(let l of Object.values(this._insSubscribers))l({node:e,pathlist:n,ind:t,evt:"ins",reason:s,fired:i});this._parent&&this._parentNode&&this._parent._onNodeInserted(e,t,[this._parentNode.label,...n],s,i)}_onNodeDeleted(e,t,n=null,s=null){for(let i of Object.values(this._delSubscribers))i({node:e,pathlist:n,ind:t,evt:"del",reason:s});this._parent&&this._parentNode&&(n===null&&(n=[]),this._parent._onNodeDeleted(e,t,[this._parentNode.label,...n],s))}_subscribe(e,t,n){n!=null&&(t[e]=n)}subscribe(e,{update:t=null,insert:n=null,delete:s=null,any:i=null}={}){this.backref||this.setBackref(),this._subscribe(e,this._updSubscribers,t||i),this._subscribe(e,this._insSubscribers,n||i),this._subscribe(e,this._delSubscribers,s||i)}unsubscribe(e,{update:t=!1,insert:n=!1,delete:s=!1,any:i=!1}={}){(t||i)&&delete this._updSubscribers[e],(n||i)&&delete this._insSubscribers[e],(s||i)&&delete this._delSubscribers[e]}[Symbol.iterator](){return this._nodes[Symbol.iterator]()}keys(){return this._nodes.keys()}values(){return this._nodes.values()}items(){return[...this._nodes].map(e=>({key:e.label,value:e.getValue()}))}get nodes(){return this.getNodes()}node(e){return this._nodes.get(e)}setAttr(e=null,t=null,n=!0){let s=r.prototype.getNode.call(this,e,!0,!0);s&&s.setAttr(t,!0,!0,n)}getAttr(e=null,t=null,n=null){let s=this.getNode(e);return s?s.getAttr(t,n):n}delAttr(e=null,...t){let n=this.getNode(e);n&&n.delAttr(...t)}getInheritedAttributes(){return this._parentNode?this._parentNode.getInheritedAttributes():{}}getNodes(e=null){return e?[...this._nodes].filter(t=>e(t)):[...this._nodes]}getNodeByValue(e,t){for(let n of this._nodes){let s=n.value;if(s instanceof r){if(s.getItem(e)===t)return n}else if(s&&s.get&&s.get(e)===t)return n}return null}getNodeByAttr(e,t,n=!1,s=!1){let i=t===void 0,a=n&&typeof t=="string"?t.toLowerCase():t,o=l=>{let u=[];for(let c of l._nodes){if(e in c.attr){let d=n&&typeof c.attr[e]=="string"?c.attr[e].toLowerCase():c.attr[e];if(i||d==a)return c}if(c._value instanceof r)if(s){let d=o(c._value);if(d)return d}else u.push(c._value)}for(let c of u){let d=o(c);if(d)return d}return null};return o(this)}isEmpty(e=!1,t=!1){if(this._nodes.length===0)return!0;for(let n of this._nodes){if(n._resolver!==null)return!1;let s=n.getValue(!0);if(s!=null&&!(e&&s===0)&&!(t&&s===""))return!1}return!0}query(e=null,t=null,n=!1,s=!1,i=!0,a=!0,o=null,l=!0){e||(e="#k,#v,#a");let u=this,c;if(typeof e=="string"){if(e.includes(":")){let[p,h]=e.split(":");u=this.getItem(p),e=h}c=e.split(",").map(p=>p.trim())}else c=e;let d=(p,h,m,g,b)=>{if(h==="#k")return p.label;if(h==="#p")return m;if(h==="#n")return p;if(typeof h=="function")return h(p);if(h==="#v"){let v=b();return g&&v instanceof r?null:v}else if(h.startsWith("#v.")){let v=h.split(".").slice(1).join("."),w=b();return w&&w.getItem?w.getItem(v):null}else{if(h==="#__v")return p.getValue(!0);if(h.startsWith("#a")){let v=h.includes(".")?h.split(".").slice(1).join("."):null;return p.getAttr(v)}else{let v=b();return v&&v.getItem?v.getItem(h):null}}};function*f(){let p=0;function*h(m,g){for(let b of m._nodes){let v=g?`${g}.${b.label}`:b.label,w=!1,k,I=()=>(w||(k=b.getValue(l),w=!0),k);if((i&&a||(I()instanceof r?a:i))&&(t===null||t(b))&&(yield c.length===1?d(b,c[0],v,s,I):c.map(Z=>d(b,Z,v,s,I)),p++,o!==null&&p>=o))return;if(s){let Z=I();if(Z instanceof r&&(yield*h(Z,v),o!==null&&p>=o))return}}}yield*h(u,"")}return n?f():[...f()]}getLeaves(){let e=[],t=(n,s)=>{for(let i of n._nodes){let a=s?`${s}.${i.label}`:i.label,o=i.getValue(!1);o instanceof r?t(o,a):e.push([a,o])}};return t(this,""),e}digest(e=null,t=null,n=!1){typeof t=="boolean"&&(console.warn("Bag.digest(what, asColumns) is deprecated; use digest(what, null, asColumns)."),n=t,t=null);let s=this.query(e,t,!1,!1,!0,!0,null,!1);if(n){if(!s||s.length===0)return(typeof e=="string"?e:"#k,#v,#a").split(",").map(l=>l.trim()).map(()=>[]);let i=[...s];if(i.length&&Array.isArray(i[0])){let a=i[0].length,o=[];for(let l=0;l<a;l++)o.push(i.map(u=>u[l]));return o}return[i]}return[...s]}columns(e,t=!1){typeof e=="string"&&(e=e.split(","));let n=t?"#a.":"",s=e.map(i=>`${n}${i}`).join(",");return this.digest(s,null,!0)}sum(e="#v",t=!1,n=null){if(t!=null&&typeof t!="boolean")throw new TypeError("sum strict must be a boolean; pass condition as the third argument");if(n!=null&&typeof n!="function")throw new TypeError("sum condition must be callable; deep is no longer supported");let s=i=>{let a=0,o=!1;for(let l of this.query(i,n)){if(l==null||l===""){o=!0;continue}if(typeof l!="number"&&typeof l!="boolean"){if(t)throw new TypeError(`sum encountered non-numeric value: ${typeof l}`);continue}a+=l}return t&&o?null:a};return e.includes(",")?e.split(",").map(i=>s(i.trim())):s(e)}sort(e="#k:a"){let t=(s,i)=>s==null?[-1,""]:i&&typeof s=="string"?[0,s.toLowerCase()]:[0,s],n=(s,i)=>s[0]!==i[0]?s[0]-i[0]:s[1]<i[1]?-1:s[1]>i[1]?1:0;if(typeof e=="function")this._nodes._list.sort((s,i)=>{let a=e(s),o=e(i);return a<o?-1:a>o?1:0});else{let s=e.split(",");s.reverse();for(let i of s){let a,o;i.includes(":")?[a,o]=i.split(":",2):(a=i,o="a"),a=a.trim(),o=o.trim();let l=o==="d"||o==="D",u=o==="a"||o==="d",c;if(a.toLowerCase()==="#k")c=d=>t(d.label,u);else if(a.toLowerCase()==="#v")c=d=>t(d.value,u);else if(a.toLowerCase().startsWith("#a.")){let d=a.slice(3);c=f=>t(f.getAttr(d),u)}else c=d=>{let f=d.value,p=f instanceof r?f.getItem(a):f?f[a]:null;return t(p,u)};this._nodes._list.sort((d,f)=>{let p=n(c(d),c(f));return l?-p:p})}}return this}equalTo(e){return e instanceof r?this._nodes.isEqual(e._nodes):!1}has(e){if(typeof e=="string"){let t=null;e.includes("?")&&([e,t]=e.split("?",2));let n=this.getNode(e);return n===null?!1:t===null?!0:t.split("&").every(s=>s in n.attr)}else if(e&&e.label!==void 0)return[...this._nodes].includes(e);return!1}getResolver(e){let t=this.getNode(e);return t?t.resolver:null}setResolver(e,t){let n=this.getNode(e);n||(this.setItem(e,null),n=this.getNode(e)),n.resolver=t}setCallbackItem(e,t,n={}){let s=new jr({callback:t,...n});this.setResolver(e,s)}move(e,t,n=!0){this._nodes.move(e,t,n)}asDict(e=!1,t=!1,n=!1,s=!1){let i={};for(let a of this._nodes){let o=a.value;if(s&&o==null)continue;let l=a.label;e&&(l=String(l)),t&&(l=l.toLowerCase()),n&&o instanceof r&&(o=r.prototype.asDict.call(o,e,t,n,s)),Object.defineProperty(i,l,{value:o,enumerable:!0,writable:!0,configurable:!0})}return i}setdefault(e,t=null){let n=this.getNode(e);return n?n.value:(this.setItem(e,t),t)}deepcopy(e=!1){let t=this.createChildBag();for(let n of this._nodes){let s=n.getValue(!e);s instanceof r&&(s=s.deepcopy(e));let i=new t.nodeClass(t,n.label,s);i.setAttr({...n.attr},!1,!1,!1),i.nodeTag=n.nodeTag,i.xmlTag=n.xmlTag,t._nodes._list.push(i),t._nodes._dict[i.label]=i}return t}update(e,t=null,n=null,s=!1){if(!(e instanceof r)){for(let i in e){let a=e[i];(!s||a!==null||!this._nodes.has(i))&&this.setItem(i,a,null,">",!1,!1,n,!1,n!==!1)}return}for(let i of[...e]){let a=i.label,o=t==="static"?i.resolver:null,l=o?null:i.getValue(),u=i.attr.__replace;delete i.attr.__replace;let c=this._nodes.get(a);if(c)if(c.setAttr(i.attr,n===null?!0:n,!0,!1),i.nodeTag!=null&&(c.nodeTag=i.nodeTag),i.xmlTag!=null&&(c.xmlTag=i.xmlTag),o)c.resolver=o,c.setValue(null,n===null?!0:n,null,null,!1,n);else{i.resolver&&(c.resolver=null);let d=c.getValue();l instanceof r&&d instanceof r&&!u?d.update(l,t,n,s):(!s||l!==null)&&c.setValue(l,n===null?!0:n,null,null,!1,n)}else{let d=this.setItem(a,o||l,i.attr,">",!1,!1,n,!1,n!==!1);d.nodeTag=i.nodeTag,d.xmlTag=i.xmlTag}}}_fillFromBag(e){this.clear();for(let t of e){let n=new this.nodeClass(this,t.label);n.replace(t),n.nodeTag=t.nodeTag,n.xmlTag=t.xmlTag,this._nodes._list.push(n),this._nodes._dict[n.label]=n}}_fillFromDict(e){this.clear();for(let[t,n]of Object.entries(e))n!==null&&typeof n=="object"&&!Array.isArray(n)&&!(n instanceof r)&&!(n instanceof Oe)?this.setItem(t,this.createChildBag()._loadSource(n)):this.setItem(t,n)}_loadSource(e){if(e==null)return this;let t=this.createChildBag();if(e instanceof r)t._fillFromBag(e);else if(typeof e=="object"&&!Array.isArray(e))t._fillFromDict(e);else return this;return this._replacePrepared(t)}replace(e){if(!(e instanceof r))throw new TypeError("Bag.replace expects a Bag");if(e===this)return this;let t=this.createChildBag();return t._fillFromBag(e),this._replacePrepared(t)}_replacePrepared(e){for(let n of this._nodes){n.parentBag=null;let s=n.getValue(!0);s instanceof r&&s.clearBackref()}let t=this._nodes;this._nodes=e._nodes,e._nodes=t,this._nodes._parentBag=this.backref?this:null,e._nodes._parentBag=null;for(let n of this._nodes)n.parentBag=this;for(let n of e._nodes)n._parentBag=e;return this.backref&&this.parent&&this.parentNode&&this.parent._onNodeChanged(this.parentNode,[this.parentNode.label],"upd_value",e),this}forEach(e,{static:t=!0,deep:n=!1,kwargs:s={}}={}){if(typeof e!="function")throw new TypeError("forEach requires a callback");let i=(a,o)=>{for(let l=0;l<a._nodes.length;l++){let u=a._nodes._list[l],c={...o};"_pathlist"in o&&(c._pathlist=[...o._pathlist,u.label]),"_indexlist"in o&&(c._indexlist=[...o._indexlist,l]);let d=e(u,c,l);if(d)return d;if(d==null&&n){let f=u.getValue(t);if(f instanceof r){let p=i(f,c);if(p)return p}}}return null};return i(this,s)}*traverse(){for(let e of this._nodes){yield e;let t=e.getValue(!0);t instanceof r&&(yield*t.traverse())}}*_iterNodesWithPaths(e=!0,t=""){for(let n of this._nodes){let s=t?`${t}.${n.label}`:n.label;yield[s,n];let i=n.getValue(e);i instanceof r&&(yield*i._iterNodesWithPaths(e,s))}}*_nodeFlattener(e=null){let t=e!==null,n=t?Object.create(null):null,s=0,i=new Map([["",this.constructor]]);for(let[a,o]of Qo(this)){let l=a.lastIndexOf("."),u=l>=0?a.slice(0,l):"",c=o.getValue(!0),d,f=null;if(o.resolver)d=zr(o.resolver);else if(c instanceof r){let m=c.constructor,g=m.tytxSuffix;i.set(a,m),f=Ti(m,sr(i.get(u),g)),d=`::${g}`}else c===null?d="::NN":d=c;if(o.attr&&Object.hasOwn(o.attr,Be))throw new K(`node '${a}': the attribute '${Be}' is reserved for the Bag class name`);let p=ss(o.attr);f!==null&&(p[Be]=f);let h=o.nodeTag;t?(yield[u?n[u]:null,o.label,h,d,p],c instanceof r&&(n[a]=s,e[s]=a,s++)):yield[u,o.label,h,d,p]}}toTytx(e="json",t=!1){let n;if(t){let o={};n={rows:[...this._nodeFlattener(o)],paths:o}}else n={rows:[...this._nodeFlattener(null)]};let s=this.constructor,i=Ti(s,sr(null,s.tytxSuffix));return i!==null&&(n[Be]=i),le(n,e==="json"?null:e)}static fromTytx(e,t="json"){let n=this.tytxSuffix;if(e==="")return new(sr(null,n));let s=H(e,t==="json"?null:t);if(!s||!Array.isArray(s.rows))throw new K("Invalid TYTX Bag: expected rows");let i=s.paths,a=i!=null,o=Object.hasOwn(s,Be)?Ai(n,s[Be]):sr(null,n),l=new o,u=new Map([["",l]]);for(let c of s.rows){if(!Array.isArray(c)||c.length!==5)throw new K("Invalid TYTX Bag row");let[d,f,p,h,m]=c,g=d??"";if(a){if(d!==null&&!Object.hasOwn(i,d))throw new K(`Unknown TYTX parent reference: ${d}`);g=d===null?"":i[d]}if(!u.has(g))throw new K(`Missing or undecodable TYTX parent branch: ${g}`);let b=u.get(g),v=g?`${g}.${f}`:f,w=h;if(t==="msgpack"&&typeof w=="string"&&w.startsWith("::")){let Y=qr(w.slice(2));(Y===r||Y?.prototype instanceof r)&&(w=H(w))}let k=Gr(w),I=is(m),L=Object.hasOwn(I,Be)?I[Be]:null;if(delete I[Be],w instanceof r){let Y=w.constructor.tytxSuffix,ne=L!==null?Ai(Y,L):sr(b.constructor,Y);w=new ne,u.set(v,w)}else{if(L!==null)throw new K(`node '${v}': the attribute '${Be}' is reserved for the Bag class name of a branch`);w==="::NN"&&(w=null)}let Z=b.setItem(f,k||w,I);Z.nodeTag=p??null}return l}toXml(e={}){let{pretty:t=!1,encoding:n="UTF-8",docHeader:s=null,selfClosedTags:i=null}=e,a=this._bagToXml(i,t);return s===!0?a=`<?xml version='1.0' encoding='${n}'?>
15
15
  ${a}`:typeof s=="string"&&(a=`${s}
16
16
  ${a}`),a}_bagToXml(e=null,t=!1,n=0){let s=[];for(let i of this._nodes)s.push((t?" ".repeat(n):"")+this._nodeToXml(i,e,t,n));return s.join(t?`
17
- `:"")}_nodeToXml(e,t=null,n=!1,s=0){let i=e.xmlTag||e.nodeTag||e.label,a=this._sanitizeTag(i),o=[];if(a!==i&&o.push(`_tag="${this._escapeAttr(i)}"`),e.resolver&&o.push(`_resolver="${this._escapeAttr(Hr(e.resolver))}"`),e.attr)for(let[f,p]of Object.entries(ns(e.attr)))p!==null&&p!==!1&&p!==void 0&&o.push(`${f}="${this._escapeAttr(String(p))}"`);let u=o.length?" "+o.join(" "):"",l=e.resolver?null:e.getValue(!0);if(l&&typeof l._bagToXml=="function"){n=n&&e.attr?.["xml:space"]!=="preserve";let f=l._bagToXml(t,n,s+1);return f?n?`<${a}${u}>
17
+ `:"")}_nodeToXml(e,t=null,n=!1,s=0){let i=e.xmlTag||e.nodeTag||e.label,a=this._sanitizeTag(i),o=[];if(a!==i&&o.push(`_tag="${this._escapeAttr(i)}"`),e.resolver&&o.push(`_resolver="${this._escapeAttr(zr(e.resolver))}"`),e.attr)for(let[f,p]of Object.entries(ss(e.attr)))p!==null&&p!==!1&&p!==void 0&&o.push(`${f}="${this._escapeAttr(String(p))}"`);let l=o.length?" "+o.join(" "):"",u=e.resolver?null:e.getValue(!0);if(u&&typeof u._bagToXml=="function"){n=n&&e.attr?.["xml:space"]!=="preserve";let f=u._bagToXml(t,n,s+1);return f?n?`<${a}${l}>
18
18
  ${f}
19
- ${" ".repeat(s)}</${a}>`:`<${a}${u}>${f}</${a}>`:t===null||t.includes(a)?`<${a}${u}/>`:`<${a}${u}></${a}>`}if(l==null||l==="")return t===null||t.includes(a)?`<${a}${u}/>`:`<${a}${u}></${a}>`;let c=l instanceof Date&&!Number.isNaN(l.getTime())?Qf(l):String(l),d=this._escapeXml(c);return`<${a}${u}>${d}</${a}>`}_sanitizeTag(e){return e?e.replace(/[^a-zA-Z0-9_\-.:]/g,"_"):"_none_"}_escapeXml(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}_escapeAttr(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}static fromXml(e,t={}){let{tagAttribute:n=null}=t,s;if(typeof DOMParser<"u"){s=new DOMParser().parseFromString(e,"application/xml");let a=s.querySelector("parsererror");if(a)throw new Error(`XML parse error: ${a.textContent}`)}else s=new Go.DOMParser().parseFromString(e,"application/xml");return this._xmlElementToBag(s.documentElement,n)}static _xmlElementToBag(e,t=null){let n=new this,s=Array.from(e.childNodes).filter(i=>i.nodeType===1);for(let i of s){let a=i.tagName,o={};for(let m=0;m<i.attributes.length;m++){let g=i.attributes[m];o[g.name]=g.value}let u=zr(o._resolver);u&&delete o._resolver;let l=String(o._T||"").toUpperCase()==="BAG";Object.assign(o,ss(o));let c=a;"_tag"in o&&(c=o._tag,delete o._tag),t&&t in o&&(c=o[t],delete o[t]);let d=c,f=1;for(;n.getNode(c);)c=`${d}_${f++}`;let p=Array.from(i.childNodes).filter(m=>m.nodeType===1),h;if(p.length>0||l){let m=this._xmlElementToBag(i,t);h=n.setItem(c,m,Object.keys(o).length>0?o:null)}else{let m=i.textContent||"";h=n.setItem(c,m,Object.keys(o).length>0?o:null)}u&&(h.resolver=u),h.xmlTag=a}return n}static async fromUrl(e,t={}){let{timeout:n=30}=t,s={};n&&(s.signal=AbortSignal.timeout(n*1e3));let i=await fetch(e,s),a=i.headers.get("content-type")||"",o=await i.text();if(a.includes("json"))return r.fromJson(o);if(a.includes("xml"))return r.fromXml(o);let u=o.trim();if(u.startsWith("<"))return r.fromXml(o);if(u.startsWith("{")||u.startsWith("["))return r.fromJson(o);throw new Gr(`Unsupported content-type: ${a}`)}toJson(e=!0){let t=[];for(let n of this._nodes)t.push(this._nodeToJsonDict(n,e));return e?le(t):JSON.stringify(t)}_nodeToJsonDict(e,t){let n=e.resolver?null:e.getValue(!0);if(n&&typeof n._nodeToJsonDict=="function"){let i=[];for(let a of n._nodes)i.push(n._nodeToJsonDict(a,t));n=i}let s={label:e.label,value:n,attr:ns(e.attr)};return e.nodeTag!==null&&(s.tag=e.nodeTag),e.resolver&&(s.resolver=Hr(e.resolver)),s}static fromJson(e,t=null){return typeof e=="string"&&(e=H(e)),!Array.isArray(e)&&typeof e!="object"&&(e={value:e}),r._fromJsonRecursive(e,t)}static _fromJsonRecursive(e,t=null){if(e instanceof r)return e;if(Array.isArray(e)){if(t!==null&&e.every(s=>typeof s=="string"))return e.join(t);if(e.length===0)return new r;if(typeof e[0]=="object"&&e[0]!==null&&"label"in e[0]){let s=new r;for(let i of e){let a=i.label,o=r._fromJsonRecursive(i.value,t),u=ss(i.attr),l=s.setItem(a,o,u);l.nodeTag=i.tag??null;let c=zr(i.resolver);c&&(l.resolver=c)}return s}let n=new r;for(let s=0;s<e.length;s++)n.setItem(`r_${s}`,r._fromJsonRecursive(e[s],t));return n}if(typeof e=="object"&&e!==null){if(Object.keys(e).length===0)return new r;let n=new r;for(let[s,i]of Object.entries(e))n.setItem(s,r._fromJsonRecursive(i,t));return n}return e}toStringTree(e=!0,t=null,n="",s=!0){t===null&&(t=new Map);let i=[],a=[...this._nodes];for(let o=0;o<a.length;o++){let u=a[o],l=o===a.length-1,c=u.getValue(e),d=u.getAttr(),f="",p=Object.keys(d);p.length>0&&(f=" ["+p.map(b=>`${b}=${JSON.stringify(d[b])}`).join(", ")+"]");let h=l?"\u2514\u2500\u2500 ":"\u251C\u2500\u2500 ",m=n+(l?" ":"\u2502 ");if(c instanceof r){let g=u,b=c.backref?"(*)":"";if(t.has(g))i.push(`${n}${h}${u.label}${b}${f} \u2192 (circular ref)`);else{t.set(g,u.label),i.push(`${n}${h}${u.label}${b}${f}`);let v=c.toStringTree(e,t,m,l);v&&i.push(v)}}else{let g;if(c===null)g="null";else if(c===void 0)g="undefined";else if(c instanceof ArrayBuffer||c instanceof Uint8Array){let b=new TextDecoder("utf-8",{fatal:!1}),v=c instanceof ArrayBuffer?new Uint8Array(c):c;g=b.decode(v)}else typeof c=="string"?c.length>50?g=JSON.stringify(c.slice(0,47)+"..."):g=JSON.stringify(c):g=String(c);i.push(`${n}${h}${u.label}: ${g}${f}`)}}return i.join(`
20
- `)}toString(e=!0,t=null,n=""){t||(t=new Set);let s=[],i=[...this._nodes];for(let a=0;a<i.length;a++){let o=i[a],u=a===i.length-1,l=o.getValue(e),c="",d=o.attr;d&&Object.keys(d).length>0&&(c=` [${Object.entries(d).map(([m,g])=>`${m}=${JSON.stringify(g)}`).join(", ")}]`);let f=u?"\u2514\u2500\u2500 ":"\u251C\u2500\u2500 ",p=n+(u?" ":"\u2502 ");if(l&&typeof l._htraverse=="function"){let h=o;if(t.has(h))s.push(`${n}${f}${o.label}${c} \u2192 (circular ref)`);else{t.add(h),s.push(`${n}${f}${o.label}${c}`);let m=l.toString(e,t,p);m&&s.push(m)}}else{let h;l==null?h="null":typeof l=="string"&&l.length>50?h=JSON.stringify(l.slice(0,47)+"..."):typeof l=="string"?h=JSON.stringify(l):h=String(l),s.push(`${n}${f}${o.label}: ${h}${c}`)}}return s.join(`
21
- `)}},Gr=class extends Error{constructor(e){super(e),this.name="BagException"}};ne.registerBagClass(P);_i(P);At(P.tytxSuffix,{...xe(P.tytxSuffix),Bag:P});var Xo=new Set(["False","None","True","and","as","assert","async","await","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","nonlocal","not","or","pass","raise","return","try","while","with","yield"]);function Yo(r){return r.endsWith("_")&&Xo.has(r.slice(0,-1))?r.slice(0,-1):r}function Zo(r){let e=Yo(r);return e!==r?e:r.startsWith("_")&&Xo.has(r.slice(1))?r.slice(1):r}function Wr(r,{renderTag:e=null,ns:t=null,dialectName:n=null}={}){let s=e||r;if(!s)return s;if(s=Yo(s),t&&!e){let i=`${n}_`;s.startsWith(i)&&(s=s.slice(i.length)),s=`${t}:${s}`}return s}var Dt=Symbol("value"),Tt=new Set(["_meta","datapath","node_id","ns","form","formId","_anchor","updateOn"]);function ye(r){return Object.entries(r||{}).filter(([e])=>!Tt.has(e)).map(([e,t])=>[Zo(e),t])}var Ve=class extends Oe{constructor(e,t,n=null,s=null,i=null,a=null,o=null){super(e,t,n,s,i,a,o),this._builder=e?._insertingBuilder??e?._builder??null,this._targetId=null}get builder(){if(this._builder)return this._builder;let e=this.parentBag;return e?e._builder:null}get data(){return this.builder.data}get rootBuilder(){return this.parentBag.root._builder}_getMeta(e){let t=this.getAttr("_meta")||{},n=e.split(",").map(s=>s.trim());return n.length===1?t[n[0]]!==void 0?t[n[0]]:null:n.map(s=>t[s]!==void 0?t[s]:null)}pointerType(e){return typeof e=="string"&&(e[0]==="^"||e[0]==="=")?e[0]:null}pointers(){let e=[];for(let[t,n]of Object.entries(this.getAttr()||{}))this.pointerType(n)==="^"&&e.push([t,n]);return this.pointerType(this.value)==="^"&&e.push(["",this.value]),e}fixedAttrItems(){return ye(this.getAttr())}runtimeToEvaluate(){let e=new Map(this.fixedAttrItems());return e.set(Dt,this.value),e}absDatapath(e){let t=e;this.pointerType(e)&&(e=e.slice(1));let n=null;return e.includes("?")&&([e,n]=e.split("?",2)),e.startsWith("#")?this._resolveSymbolicDatapath(e,t):(e.startsWith(".")&&(e=this._composeRelativeDatapath(e,t)),this._finalizeAbsPath(e,n))}_finalizeAbsPath(e,t){return e=this._collapseParentDatapath(e,e),t?`${e}?${t}`:e}_composeRelativeDatapath(e,t){let n=this;for(;n!==null&&e.startsWith(".");){let s=n.getAttr("datapath");s!=null&&(e=e==="."?s:s+e),n=n.parentNode}if(e.startsWith("."))throw new Error(`unresolved relative datapath: ${t}`);return e}_collapseParentDatapath(e,t){let n=[];for(let s of e.split("."))if(s==="#parent"){if(n.length===0)throw new Error(`#parent has no segment to cancel: ${t}`);n.pop()}else n.push(s);return n.join(".")}_resolveSymbolicDatapath(e,t){let n=e.slice(1),s=n.indexOf("."),i=s===-1?n:n.slice(0,s),a=s===-1?"":n.slice(s+1),o;if(i==="FORM")o=this._findMarkedDatapathAncestor(!0,!1,t);else if(i==="ANCHOR")o=this._findMarkedDatapathAncestor(!1,!0,t);else{let u=this.rootBuilder;if(!u)throw new Error(`#<id>: cannot resolve ${t} on a node without builder`);if(o=u.source.getNodeByAttr("node_id",i),o==null)throw new Error(`#<id>: cannot resolve ${t}`)}return o.absDatapath(a?`.${a}`:".")}_findMarkedDatapathAncestor(e,t,n){let s=this;for(;s!=null;){let a=s.getAttr()||{};if(e&&(a.formId!=null||a.form===!0)||t&&"_anchor"in a)return s;s=s.parentNode}let i=e?"FORM":"ANCHOR";throw new Error(`#${i}: no marked ancestor found for ${n}`)}getRelativeData(e,t=null,{autocreate:n=!1}={}){let s=this.data,i=this.absDatapath(e);return n&&s.getItem(i)==null&&s.setItem(i,t),s.getItem(i,t)}setRelativeData(e,t,{attributes:n=null,fired:s=!1,reason:i=null}={}){let a=this.data,o=this.absDatapath(e);a.setItem(o,t,n,">",!1,!0,i===null?!0:i,s)}fireEvent(e,t=!0,{attributes:n=null,reason:s=null}={}){this.setRelativeData(e,t,{attributes:n,fired:!0,reason:s})}SET(e,t){this.setRelativeData(e,t)}GET(e){return this.getRelativeData(e)}PUT(e,t){this.setRelativeData(e,t,{reason:!1})}FIRE(e,t=!0){this.setRelativeData(e,t,{fired:!0})}},D=class r extends P{constructor(e=null,t=null){super(e),this._builder=t,this._insertingBuilder=null}get nodeClass(){return Ve}_setBuilderItem(e,t,n,...s){let i=t?.map(([o])=>[o,o._builder])||null;if(t)for(let[o,u]of t)o._builder=u;let a=this._insertingBuilder;this._insertingBuilder=e;try{return this.setItem(n,...s)}catch(o){if(this.node(n)==null&&i)for(let[u,l]of i)u._builder=l;throw o}finally{this._insertingBuilder=a}}bindBuilder(e){if(!e)throw new Error("SourceBag.bindBuilder requires a builder");let t=this._builderBindingPlan(e);for(let[n,s]of t)n._builder=s;return this.setBackref(),this}_builderBindingPlan(e){let t=[],n=new WeakSet,s=(i,a)=>{if(n.has(i))throw new Error("source contains a cyclic or shared SourceBag branch");n.add(i),t.push([i,a]);for(let o of i.getNodes()){let u=a,l=o._getMeta("subbuilder");l!=null&&(u=a._resolveSubbuilderReference(l,o.getAttr()||{},o.nodeTag)),t.push([o,u]);let c=o.getValue(!0);c instanceof r&&s(c,u)}};return s(this,e),t}};if((xe(D.tytxSuffix).SourceBag??D)!==D)throw new Error("TYTX subtype name 'SourceBag' is already registered for another class");At(D.tytxSuffix,{...xe(D.tytxSuffix),SourceBag:D});function np(r){if(r.length===0)return{value:null,attrs:{}};let e=r[0];if(e!==null&&typeof e=="object"){let t=Object.getPrototypeOf(e);if(t===Object.prototype||t===null)return{value:null,attrs:e}}return{value:e,attrs:r[1]||{}}}var sp=new Set(["then","toJSON"]),Ko=new WeakMap;function Ie(r){return Ko.get(r)||r}function vi(r){if(r==null)return r;r=Ie(r);let e=r._builder||r.parentBag&&r.parentBag._builder;return e?e.wrapSource(r):r}function Qo(r,e){let t=e instanceof P,n=new Proxy(e,{get(s,i){if(typeof i=="symbol"||i.startsWith("_")||sp.has(i))return Reflect.get(s,i,s);let a=r.schemaTag(i);if(t&&a)return Jo(r,s,a,t);if(i in s){let u=Reflect.get(s,i,s);return typeof u=="function"?u.bind(s):u}if(a)return Jo(r,s,a,t);let o=r.containerMethod(i);if(o)return(...u)=>r[o](r.wrapSource(s),...u)}});return Ko.set(n,e),n}function Jo(r,e,t,n){return(...s)=>{let{value:i,attrs:a}=np(s),o=n?r.bagCall(e,t,i,a):r.commandOnNode(e,t,i,a);return o.builder.wrapSource(o)}}function Ei(r,e,{transport:t="json"}={}){let n=H(r,t==="json"?null:t);if(!(n instanceof D))throw new TypeError("TYTX payload did not decode to SourceBag");return n.bindBuilder(e)}var tl=/^[A-Za-z_][A-Za-z0-9_]*$/,ip=new Set(["positional_only","positional_or_keyword","keyword_only","var_positional","var_keyword"]),ap=new Set(["framework","value","attribute"]),op=new Map([["builtins.str",r=>typeof r=="string"],["builtins.int",r=>Number.isInteger(r)],["builtins.float",r=>typeof r=="number"&&Number.isFinite(r)],["builtins.bool",r=>typeof r=="boolean"],["builtins.list",r=>Array.isArray(r)],["builtins.dict",r=>r!==null&&typeof r=="object"&&!Array.isArray(r)],["builtins.tuple",r=>Array.isArray(r)],["builtins.set",r=>Array.isArray(r)||r instanceof Set],["builtins.NoneType",r=>r===null],["builtins.object",r=>!0]]);function Xr(r){return r!==null&&typeof r=="object"&&!Array.isArray(r)}function T(r,e){throw new TypeError(`${r}: ${e}`)}function xt(r,e,t,n){Xr(r)||T(n,"must be an object");for(let s of Object.keys(r))e.includes(s)||T(n,`unknown field '${s}'`);for(let s of t)Object.hasOwn(r,s)||T(n,`missing field '${s}'`)}function ar(r,e){if(!(r===null||typeof r=="string"||typeof r=="boolean")&&!(typeof r=="number"&&Number.isFinite(r))){if(Array.isArray(r))return r.forEach((t,n)=>ar(t,`${e}[${n}]`));if(Xr(r))return Object.entries(r).forEach(([t,n])=>ar(n,`${e}.${t}`));T(e,"must be lossless JSON data")}}function ir(r,e,t=!1){if(r===null)return null;switch(xt(r,["kind","module","name","origin","arguments","items","values","base","metadata","pattern","flags","ge","le","gt","lt","value"],["kind"],e),r.kind){case"any":return{...r,test:n=>!0};case"type":{(typeof r.module!="string"||typeof r.name!="string")&&T(e,"type requires string module/name");let n=`${r.module}.${r.name}`;if(n==="collections.abc.Callable")return{...r,test:i=>typeof i=="function",portable:!1};let s=op.get(n);return s||T(e,`unsupported type '${n}'`),{...r,test:s}}case"union":{(!Array.isArray(r.items)||!r.items.length)&&T(e,"union items must be non-empty");let n=r.items.map((s,i)=>ir(s,`${e}.items[${i}]`,!0));return{...r,items:n,test:s=>n.some(i=>i.test&&i.test(s))}}case"literal":return Array.isArray(r.values)||T(e,"literal values must be an array"),r.values.forEach((n,s)=>ar(n,`${e}.values[${s}]`)),{...r,test:n=>r.values.some(s=>Object.is(s,n))};case"annotated":{Array.isArray(r.metadata)||T(e,"annotated metadata must be an array");let n=ir(r.base,`${e}.base`,!0),s=r.metadata.map((i,a)=>ir(i,`${e}.metadata[${a}]`,!0));return{...r,base:n,metadata:s,test:i=>n.test(i)&&s.every(a=>!a.test||a.test(i))}}case"range":{for(let n of["ge","le","gt","lt"])Object.hasOwn(r,n)||T(e,`range missing '${n}'`);for(let n of["ge","le","gt","lt"])r[n]!==null&&(typeof r[n]!="number"||!Number.isFinite(r[n]))&&T(e,`${n} must be finite number or null`);return{...r,test:n=>typeof n=="number"&&(r.ge===null||n>=r.ge)&&(r.le===null||n<=r.le)&&(r.gt===null||n>r.gt)&&(r.lt===null||n<r.lt)}}case"regex":{(typeof r.pattern!="string"||!Number.isInteger(r.flags)||r.flags<0)&&T(e,"regex requires pattern and non-negative integer flags");let n=r.flags&-59;n&&T(e,`unsupported Python regex flags ${n}`),r.flags&2&&T(e,"IGNORECASE is not portable across Python and JavaScript Unicode rules"),/\\[AZwWdDsS]|\(\?P[<=!]|\(\?\(|\(\?>/.test(r.pattern)&&T(e,"regex uses a non-portable construct or character class");let s="uy";r.flags&8&&(s+="m"),r.flags&16&&(s+="s");let i;try{i=new RegExp(`(?:${r.pattern})(?![\\s\\S])`,s)}catch(a){T(e,`invalid portable regex: ${a.message}`)}return{...r,test:a=>typeof a!="string"?!1:(i.lastIndex=0,i.test(a))}}case"value":return ar(r.value,`${e}.value`),{...r};case"generic":{let n=ir(r.origin,`${e}.origin`,!0);(r.origin?.kind!=="type"||r.origin.module!=="builtins"||!["list","dict","tuple","set"].includes(r.origin.name))&&T(e,"only list, dict, tuple and set generic origins are supported"),Array.isArray(r.arguments)||T(e,"generic arguments must be an array");let s=r.arguments.map((i,a)=>ir(i,`${e}.arguments[${a}]`,!0));return{...r,origin:n,arguments:s,test:i=>n.test(i)&&lp(r.origin,s,i)}}case"arguments":T(e,"Callable argument-list descriptors are not supported by Python validation");case"ellipsis":return t||T(e,"ellipsis is only valid as a nested descriptor"),{...r};default:T(e,`unknown annotation kind '${r.kind}'`)}}function lp(r,e,t){let n=`${r.module}.${r.name}`;return n==="builtins.tuple"&&e.length&&e[1]?.kind!=="ellipsis"?t.length===e.length&&t.every((s,i)=>e[i].test(s)):n==="builtins.list"||n==="builtins.set"||n==="builtins.tuple"?[...t].every(s=>!e[0]?.test||e[0].test(s)):n==="builtins.dict"?Object.entries(t).every(([s,i])=>(!e[0]?.test||e[0].test(s))&&(!e[1]?.test||e[1].test(i))):!1}function rl(r,e){if(r===null)return null;if(typeof r!="string"&&T(e,"must be string or null"),r==="")return new Map;let t=new Map;for(let n of r.split(",")){let s=n.trim();/^[A-Za-z_][A-Za-z0-9_]*\[\]$/.test(s)&&T(e,`invalid cardinality item '${n}'`);let i=s.match(/^([A-Za-z_][A-Za-z0-9_]*|\*)(?:\[(?:(\d+)|(?:(\d*):(\d*)))\])?$/);i||T(e,`invalid cardinality item '${n}'`);let[,a,o,u,l]=i;t.has(a)&&T(e,`duplicate tag '${a}'`);let c=0,d=1/0;s.includes("[")&&(s.includes(":")?(c=u?Number(u):0,d=l?Number(l):1/0):c=d=Number(o)),d<c&&T(e,`maximum ${d} is below minimum ${c}`),t.set(a,{min:c,max:d})}return t.has("*")&&t.size>1&&T(e,"wildcard '*' cannot be combined with named tags"),t}function nl(r,e){if(r===null)return null;typeof r!="string"&&T(e,"must be string or null");let t=new Set;for(let n of r.split(",")){let s=n.trim();s&&((!tl.test(s)||t.has(s))&&T(e,`invalid or duplicate parent '${n}'`),t.add(s))}return t}function up(r,e){if(r===null)return null;xt(r,["parameters","accepts_var_keyword","accepts_var_positional"],[],e);let t=r.parameters??[];Array.isArray(t)||T(e,"parameters must be an array"),r={parameters:t,accepts_var_keyword:t.some(o=>o.kind==="var_keyword"),accepts_var_positional:t.some(o=>o.kind==="var_positional"),...r},(!Array.isArray(r.parameters)||typeof r.accepts_var_keyword!="boolean"||typeof r.accepts_var_positional!="boolean")&&T(e,"invalid signature descriptor");let n=new Set,s=!1,i=!1,a=r.parameters.map((o,u)=>{let l=`${e}.parameters[${u}]`;return xt(o,["name","kind","role","annotation","has_default","default"],["name","kind","role","annotation","has_default"],l),(typeof o.name!="string"||!tl.test(o.name)||n.has(o.name))&&T(l,"invalid or duplicate parameter name"),n.add(o.name),(!ip.has(o.kind)||!ap.has(o.role)||typeof o.has_default!="boolean")&&T(l,"invalid kind, role, or has_default"),o.has_default!==Object.hasOwn(o,"default")&&T(l,"default presence must equal has_default"),o.has_default&&ar(o.default,`${l}.default`),s||=o.kind==="var_keyword",i||=o.kind==="var_positional",{...o,annotation:ir(o.annotation,`${l}.annotation`)}});return(s!==r.accepts_var_keyword||i!==r.accepts_var_positional)&&T(e,"variadic summary flags do not match parameters"),{...r,parameters:a}}function el(r,e,t){let n=["doc","sub_tags","parent_tags","inherits_from","ns","attributes",...t?["node_label","collection_key"]:[],"_meta"];xt(r,n,[],e),r={...Object.fromEntries(n.map(s=>[s,null])),...r};for(let s of["doc","inherits_from","ns",...t?["node_label","collection_key"]:[]])r[s]!==null&&typeof r[s]!="string"&&T(e,`${s} must be string or null`);return r._meta!==null&&(Xr(r._meta)||T(e,"_meta must be object or null"),ar(r._meta,`${e}._meta`)),rl(r.sub_tags,`${e}.sub_tags`),nl(r.parent_tags,`${e}.parent_tags`),{...r,attributes:up(r.attributes,`${e}.attributes`)}}function sl(r){return r?r.split(",").map(e=>e.trim()).filter(Boolean):[]}function il(r,e){let t={...e};for(let[n,s]of Object.entries(r))n==="inherits_from"||n.startsWith("_")||t[n]||(t[n]=s);return t._meta={...r._meta||{},...e._meta||{}},t}function al(r){let e={...r};return e._subSpec=Object.hasOwn(e,"sub_tags")?rl(e.sub_tags,"resolved.sub_tags"):null,e._parentSpec=Object.hasOwn(e,"parent_tags")?nl(e.parent_tags,"resolved.parent_tags"):null,e}function ol(r,e,t,n){if(t.get(r)===1&&T(n,`inheritance cycle at '${r}'`),t.get(r)===2)return e[r];let s=e[r];s||T(n,`unknown abstract '${r}'`),t.set(r,1);let i={...s};for(let a of sl(s.inherits_from))i=il(ol(a,e,t,n),i);return i=al(i),t.set(r,2),e[r]=i,i}function ki({abstracts:r={},elements:e={}}){let t={...r},n=new Map;for(let i of Object.keys(t))ol(i,t,n,`abstracts.${i}.inherits_from`);let s={};for(let[i,a]of Object.entries(e)){let o={...a};for(let u of sl(a.inherits_from)){let l=t[u];l||T(`elements.${i}.inherits_from`,`unknown abstract '${u}'`),o=il(l,o)}s[i]=al(o)}return{abstracts:t,elements:s}}function Ai(r){xt(r,["document_format","grammar","abstracts","elements"],["document_format","grammar","abstracts","elements"],"grammar document"),xt(r.document_format,["name","version"],["name","version"],"document_format"),(r.document_format.name!=="builder_grammar"||r.document_format.version!=="1.1")&&T("document_format","expected builder_grammar version 1.1"),xt(r.grammar,["name","version","title","description"],["name","version","title","description"],"grammar"),(typeof r.grammar.name!="string"||!r.grammar.name)&&T("grammar.name","must be non-empty string");for(let n of["version","title","description"])r.grammar[n]!==null&&typeof r.grammar[n]!="string"&&T(`grammar.${n}`,"must be string or null");(!Xr(r.abstracts)||!Xr(r.elements))&&T("grammar document","abstracts/elements must be objects");let e={};for(let[n,s]of Object.entries(r.abstracts))(!n||n.startsWith("_"))&&T("abstracts",`invalid public name '${n}'`),e[n]=el(s,`abstracts.${n}`,!1);let t={};for(let[n,s]of Object.entries(r.elements))(!n||n.startsWith("_"))&&T("elements",`invalid public name '${n}'`),t[n]=el(s,`elements.${n}`,!0);return{grammar:structuredClone(r.grammar),abstracts:e,elements:t}}function ll(r,e,t,n){let s=e.attributes;if(!s)return;let i={...n};t!=null&&(i.node_value=t);let a=new Set(s.parameters.filter(l=>l.role==="attribute").map(l=>l.name)),o=new Set(["node_label","node_position","node_id","target_id","datapath","iterate","store","_tag","_meta","ns"]);if(!s.accepts_var_keyword)for(let l of Object.keys(n))!a.has(l)&&!o.has(l)&&T(r,`unknown attribute '${l}'`);let u=e._meta?.component?s.parameters.find(l=>l.role!=="framework"&&["positional_only","positional_or_keyword"].includes(l.kind))?.name:null;for(let l of s.parameters){if(l.name===u||l.role==="framework"||l.kind.startsWith("var_"))continue;let c=Object.hasOwn(i,l.name);!c&&!l.has_default&&T(r,`missing required ${l.role} '${l.name}'`),c&&l.annotation!==null&&(!l.annotation.test||!l.annotation.test(i[l.name]))&&T(r,`invalid value for ${l.role} '${l.name}'`)}}function ul(r,e,t=[]){if(e===null)return structuredClone(r);if(t.length===2&&["abstracts","elements"].includes(t[0]))return structuredClone(e);if(or(r)&&or(e)){let n=structuredClone(r);for(let[s,i]of Object.entries(e))i!==null&&Object.defineProperty(n,s,{value:ul(n[s],i,[...t,s]),enumerable:!0,writable:!0,configurable:!0});return n}return structuredClone(e)}function or(r){return r!==null&&typeof r=="object"&&!Array.isArray(r)&&Object.getPrototypeOf(r)===Object.prototype}function Di(r){if(!(r===null||typeof r=="string"||typeof r=="boolean")&&!(typeof r=="number"&&Number.isFinite(r))){if(Array.isArray(r)){r.forEach(Di);return}if(or(r)){Object.values(r).forEach(Di);return}throw new TypeError("collection must contain only finite JSON values")}}var Ke=class r{#e;constructor(e){Di(e);let t=["document_format","grammar","abstracts","elements"];if(!or(e)||Object.keys(e).length!==t.length||t.some(s=>!Object.hasOwn(e,s)))throw new TypeError("collection requires document_format, grammar, abstracts and elements");let n=e.document_format;if(!or(n)||Object.keys(n).length!==2||n.name!=="builder_grammar"||n.version!=="1.1")throw new TypeError("expected builder_grammar version 1.1");for(let s of["grammar","abstracts","elements"])if(!or(e[s]))throw new TypeError(`${s} must be an object`);this.#e=structuredClone(e)}update(e){let t=new r(e);return this.#e=ul(this.#e,t.#e),this}toDocument(){return structuredClone(this.#e)}};var St=class{static renderType="string";static mode=null;constructor(e){this._builder=e,this.renders=new Map([[e,this]])}get builder(){return this._builder}get renderType(){return this.constructor.renderType}get mode(){return this.constructor.mode}addRender(e,t){this.renders.set(e,t)}getRender(e){let t=this.renders.get(e);if(t!==void 0)return t;let n=e.getRenderer();return this.renders.set(e,n),n}render(e,t={}){let n=e.builder,[s,i]=n.runtimeValues(e);if(e._getMeta("data_element"))return null;if(e._getMeta("component"))return this._renderComponent(e,i,t);let a=this.getRender(n),o;return[o,i]=a._handleMeta(e,i),e._getMeta("subbuilder")||(i=a.adaptAttrs(i)),e.value instanceof D&&(s=this.renderChildren(e.value,t)),a.renderedItem(e,s,i,{tag:o,...t})}renderChildren(e,t={}){let n=[];for(let s of e.getNodes()){let i=this.render(s,t);i!==null&&(Array.isArray(i)?n.push(...i):n.push(i))}return n}_renderComponent(e,t,n){let[s,i,a,o]=this._expansionInputs(e,t);if(!Object.hasOwn(e.getAttr(),"iterate"))return this._expandBlock(e,s,a,o,n);if(i==null)return[];if(!(i instanceof P))throw new TypeError(`component '${e.nodeTag}': iterate must resolve to a Bag, got ${i?.constructor?.name||typeof i}`);return i.getNodes().map(u=>this._expandBlock(e,s,a,{node_label:u.label},n))}_expansionInputs(e,t){let n=e.builder,s=n.componentMethod(e.nodeTag),i=s&&n[s];if(typeof i!="function")throw new Error(`component '${e.nodeTag}' has no implementation`);let a=t.iterate;delete t.iterate,delete t.store;let o=e.getAttr("iterate")||e.getAttr("store");o!=null?(e.pointerType(o)&&(o=o.slice(1)),o.startsWith(".")&&(o=e._composeRelativeDatapath(o,o))):o=null;for(let u of Object.keys(t)){let l=e.getAttr(u);e.pointerType(l)==="^"&&(t[u]=`^${e.absDatapath(l)}`)}return[i,a,o,t]}_expandBlock(e,t,n,s,i){let a=e.builder._expansionRoot(n);t.call(e.builder,vi(a),s);let o=a.getNodes();if(o.length!==1)throw new Error(`component '${e.nodeTag}' must build a tree, not a forest: ${o.length} root nodes`);let u={...i,depthOffset:this._nodeDepth(e,i.depthOffset||0)};return this.render(o[0],u)}preprocess(e){return e}renderedItem(e,t,n,s){throw new Error(`${this.constructor.name} does not implement renderedItem`)}_handleMeta(e,t){let[n,s]=e._getMeta("render_tag,render_attributes"),i=Wr(e.nodeTag,{renderTag:n,ns:e.getAttr("ns"),dialectName:e.builder?.constructor._name});if(!i)throw new Error(`node ${e.label} has no tag to render (no render_tag, no node_tag)`);return s&&(t={...t,...s}),[i,t]}adaptAttrs(e){return e}adapt(e){let t=`${this.builder.constructor._name}_`;return e.startsWith(t)?e.slice(t.length):e}finalize(e,t=null,n={}){let s=this._composeStringFragments(e);if(t==null)return s;if(typeof t=="string")throw new TypeError("string render targets require filesystem support, which is unavailable in the portable renderer; pass a callable or writable target instead");if(typeof t.full=="function"&&typeof t.write!="function")return t.full(s),null;if(typeof t.write=="function")return t.write(s),null;if(typeof t=="function")return t(s),null;throw new TypeError("render target must be writable (.write), callable, or expose .full")}_composeStringFragments(e){if(!Array.isArray(e))return e;if(e.some(t=>typeof t!="string"))throw new TypeError("String composition requires string fragments; object renderers must define their own composition");return e.join("")}_escapeText(e){return String(e).replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;")}_escapeAttr(e){return this._escapeText(e).replaceAll('"',"&quot;")}_nodeDepth(e,t=0){let s=((e.fullpath||"").match(/\./g)||[]).length;return Math.max(s-1,0)+t}};var Nt=class extends St{static mode="xml";renderedItem(e,t,n,{tag:s,pretty:i=!1,depthOffset:a=0}={}){let o=this._formatAttrs(n),u=i?" ".repeat(this._nodeDepth(e,a)):"",l=i?`
22
- `:"";if(Array.isArray(t)){let c=this._composeStringFragments(t);return`${u}<${s}${o}>${l}${c}${u}</${s}>${l}`}return t==null?`${u}<${s}${o}></${s}>${l}`:`${u}<${s}${o}>${this._escapeText(t)}</${s}>${l}`}finalize(e,t=null,{docHeader:n=null}={}){let s=this._composeStringFragments(e);return n===!0?s=`<?xml version='1.0' encoding='UTF-8'?>${s}`:typeof n=="string"&&(s=n+s),super.finalize(s,t)}_formatAttrs(e){return Object.entries(e||{}).map(([t,n])=>` ${t.startsWith("xmlns_")?`xmlns:${t.slice(6)}`:t}="${this._escapeAttr(n)}"`).join("")}};var cl={document_format:{name:"builder_grammar",version:"1.1"},grammar:{name:"base",version:null,title:null,description:null},abstracts:{},elements:{dataSetter:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"destination",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"type",module:"builtins",name:"str"},has_default:!1},{name:"value",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"any"},has_default:!1},{name:"attr",kind:"var_keyword",role:"attribute",annotation:{kind:"any"},has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{data_element:!0}},dataFormula:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"destination",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"type",module:"builtins",name:"str"},has_default:!1},{name:"func",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"union",items:[{kind:"type",module:"builtins",name:"str"},{kind:"type",module:"collections.abc",name:"Callable"}]},has_default:!1},{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{data_element:!0}},dataController:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"func",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"union",items:[{kind:"type",module:"builtins",name:"str"},{kind:"type",module:"collections.abc",name:"Callable"}]},has_default:!1},{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{data_element:!0}}}};function dl(r){let e=[];for(;r&&r!==Function.prototype;)e.push(r),r=Object.getPrototypeOf(r);return e.reverse()}function dp(r){let e=Object.create(null),t=(n,s)=>{let i=n.toLowerCase(),a=e[i];if(a!==void 0&&a!==s)throw new Error(`container '${n}' is already tied to implementation method '${a}' (cannot rebind to '${s}')`);e[i]=s};for(let n of dl(r))if(Object.hasOwn(n,"containers"))for(let s of n.containers||[])t(s,s);return e}function Yr(r){let e=Object.create(null);for(let t of Object.keys(r)){let n=t.toLowerCase();if(Object.hasOwn(e,n))throw new Error(`element declaration '${t}' has a case-insensitive collision with '${e[n]}'`);e[n]=t}return e}var Zr="_root_",Ti="_root_",fl=new Set(["destination","func","value","_on_start"]),he=class r{static _sourceClass=D;static registerBuilder(e){if(typeof e!="function"||!(e.prototype instanceof r))throw new TypeError("registerBuilder requires a BuilderBase subclass");let t=e._name;if(typeof t!="string"||!t)throw new TypeError("registered builders require a non-empty static _name");let n=r._registry.get(t);if(n&&n!==e)throw new Error(`Builder name '${t}' is already registered to ${n.name}; cannot register ${e.name}`);return r._registry.set(t,e),e}static getBuilderClass(e){let t=r._registry.get(e);if(!t)throw new Error(`No builder registered with name '${e}'`);return t}constructor(e=null){this.name=e||this.constructor._name,this._dataroot=new P,this._dataroot.setBackref(),this._dataroot.setItem(Ti,new P),this.data=this._dataroot.getItem(Ti),this._defaultTargets=new Map,this.materialized=Object.create(null),this._collection=null,this._schemaOverride=null,this._tagNamesOverride=null,this._componentMap=null,this._targetSerial=0,this._subbuilders=new Map,this._sourceHandles=new WeakMap;let t=this.constructor._sourceClass;this._sourceroot=new t(null,this),this._sourceroot.setBackref(),this._sourceroot.setItem(Zr,new t(null,this)),this.source=this._sourceroot.getItem(Zr)}wrapSource(e){if(e=Ie(e),!(e instanceof D)&&!(e instanceof Ve))throw new TypeError("wrapSource requires a SourceBag or SourceBagNode");let t=this._sourceHandles.get(e);return t||(t=Qo(this,e),this._sourceHandles.set(e,t)),t}get root(){return this.wrapSource(this.source)}getSubbuilder(e){if(typeof e!="string"||!e||e.includes(":"))throw new Error(`unsupported subbuilder reference '${e}'`);let t=this._subbuilders.get(e);if(!t){let n=r.getBuilderClass(e);t=new n,this._subbuilders.set(e,t)}return t._dataroot=this._dataroot,t.data=this.data,t}_resolveSubbuilderReference(e,t,n){if(typeof e!="string"||!e)throw new Error(`'${n}': subbuilder declaration must be a non-empty string`);if(e.includes(":"))throw new Error(`'${n}': runtime subbuilder reference '${e}' is unsupported`);return this.getSubbuilder(e)}static defineGrammar(e){let t=this._classCollection,n=t?new Ke(t.toDocument()).update(e):new Ke(e),s=Ai(n.toDocument()),i=ki(s),a=Yr(i.elements);this._classCollection=n,this._classSchema=i.elements,this._abstracts=i.abstracts,this._tagNames=a}static{this.defineGrammar(cl)}get _containers(){return dp(this.constructor)}containerMethod(e){return this._containers[e.toLowerCase()]||null}componentMethod(e){return this._componentMap?.[e.toLowerCase()]||null}get schema(){return this._schemaOverride||this.constructor._classSchema||{}}get schemaTagNames(){return this._schemaOverride?this._tagNamesOverride??=Yr(this.schema):this.constructor._tagNames??=Yr(this.schema)}schemaTag(e){let t=e.toLowerCase(),n=this.schemaTagNames[t];if(n)return n;let s=`${this.constructor._name}_`;return t.startsWith(s)&&this.schemaTagNames[t.slice(s.length)]||null}loadGrammar(e,{replace:t=!1}={}){let n=this._collection||this.constructor._classCollection,s=t?new Ke(e):new Ke(n.toDocument()).update(e),i=Ai(s.toDocument()),a=ki(i),o=Yr(a.elements);return this._collection=s,this._schemaOverride=a.elements,this._tagNamesOverride=o,this}validateNodeValues(e,t,n={}){let s=this.schemaTag(e);if(!s)throw new Error(`unknown element '${e}'`);return ll(s,this.schema[s],t,n),!0}validateNode(e,{value:t,attrs:n,childTags:s}={}){if(!e||typeof e.nodeTag!="string")throw new TypeError("validateNode requires a source node");let i=t!==void 0?t:e.value instanceof D?null:e.value;this.validateNodeValues(e.nodeTag,i,n||e.getAttr?.()||{});let a=this.schema[this.schemaTag(e.nodeTag)],o=s||(e.value instanceof D?e.value.getNodes().map(u=>u.nodeTag):null);return o&&this._validateChildren(e.nodeTag,a,o,!1),!0}validateChildren(e,t,{includeMinimum:n=!1}={}){let s=this.schemaTag(e);if(!s)throw new Error(`unknown element '${e}'`);if(!Array.isArray(t)||t.some(i=>typeof i!="string"))throw new TypeError("childTags must be an array of strings");return this._validateChildren(s,this.schema[s],t,n)}validateParent(e,t=null){let n=this.schemaTag(e);if(!n)throw new Error(`unknown element '${e}'`);let s=this.schema[n];if(!this._countsForGrammar(s))return!0;let i=s._parentSpec;if(i==null||i.has("*"))return!0;if(t===null)throw new Error(`'${n}' requires a declared parent`);let a=this.schemaTag(t);if(!a)throw new Error(`unknown parent element '${t}'`);return this._validateParent(n,s,a),!0}bagCall(e,t,n,s){return this.setChild(e,t,n,s)}commandOnNode(e,t,n,s){if(e=Ie(e),e.value instanceof D)return this.setChild(e.value,t,n,s);let i=e.value,a=new e.parentBag.constructor(null,e.builder||this),o=this.setChild(a,t,n,s,e);return this.promoteNodeValue(e,i,a),o}promoteNodeValue(e,t,n){e.setValue(n)}setChild(e,t,n,s,i=null){let a={...s},o=this.schema[t];if(!o)throw new Error(`unknown element '${t}'`);this.validateNodeValues(t,n,a);let u=o._meta?.subbuilder,c=(u==null?null:this._resolveSubbuilderReference(u,a,t))||this,d=n instanceof D?n._builderBindingPlan(c):null,f=i?.rootBuilder||e.root._builder||this;if(a.node_id!=null&&f.source.getNodeByAttr("node_id",a.node_id))throw new Error(`Duplicate node_id '${a.node_id}'`);n instanceof D&&this._validateChildren(t,o,n.getNodes().map(w=>w.nodeTag),!1);let p=i||e.parentNode,h=p?.nodeTag?this.schema[p.nodeTag]:null;if(h&&!p._getMeta("subbuilder")&&this._countsForGrammar(o))this._validateParent(t,o,p.nodeTag),this._validateChildren(p.nodeTag,h,[...e.getNodes().map(w=>w.nodeTag),t],!1);else if(!h&&!p?._getMeta("subbuilder")&&o._parentSpec!=null&&this._countsForGrammar(o))throw new Error(`'${t}' requires a declared parent`);o._meta&&!("_meta"in a)&&(a._meta=o._meta),o.ns&&!("ns"in a)&&(a.ns=o.ns);let m=a.node_position;delete a.node_position;let g=a.node_label;delete a.node_label;let b;if(h?.collection_key){if(g!=null)throw new Error(`'${t}': node_label is not allowed in a collection`);b=this._collectionLabel(h.collection_key,t,a)}else{let w=h?._subSpec?.get(t);if(w&&w.max===1){if(g!=null)throw new Error(`'${t}': node_label is not allowed on a singleton`);b=t}else b=g||o.node_label||this._autoLabel(e,t)}if(e.node(b)!=null)throw new Error(`duplicate node label '${b}'`);return e._setBuilderItem(c,d,b,n,a,m||">",!1,!0,null,!1,!0,null,t)}_countsForGrammar(e){let t=e?._meta||{};return!(t.data_element||t.subbuilder||t.component)}_validateParent(e,t,n){let s=t._parentSpec;if(!(s==null||s.has("*")||!this._countsForGrammar(t))&&!s.has(n))throw new Error(`'${e}' not allowed as child of '${n}'`)}_validateChildren(e,t,n,s){let i=t._subSpec;if(i==null||i.has("*")||t._meta?.subbuilder)return[];let a=new Map;for(let o of n){let u=this.schema[o];if(u&&!this._countsForGrammar(u))continue;let l=i.get(o);if(!l)throw new Error(`'${o}' not allowed as child of '${e}'`);let c=(a.get(o)||0)+1;if(a.set(o,c),c>l.max)throw new Error(`too many '${o}' in '${e}'`)}return s?[...i].filter(([o,u])=>(a.get(o)||0)<u.min).map(([o])=>o):[]}_collectionLabel(e,t,n){let s=i=>{if(n[i]===null||n[i]===void 0)throw new Error(`'${t}': collection key needs attribute '${i}'`);return String(n[i])};return e.includes("${")?e.replace(/\$\{([^}]+)\}/g,(i,a)=>s(a)):s(e)}validateSource(){let e=[],t=(n,s="")=>{for(let i of n.getNodes()){let a=s?`${s}.${i.label}`:i.label,o=i.builder,u=o.schema[i.nodeTag];if(u&&!i._getMeta("data_element,subbuilder,component").some(Boolean)){let l=i.value instanceof D?i.value.getNodes().map(d=>d.nodeTag):[],c=o._validateChildren(i.nodeTag,u,l,!0);c.length&&e.push([a,c])}i.value instanceof D&&t(i.value,a)}};return t(this.source),e}_autoLabel(e,t){let n=0;for(;e.node(`${t}_${n}`)!==null&&e.node(`${t}_${n}`)!==void 0;)n+=1;return`${t}_${n}`}nodeById(e){let t=this.source.getNodeByAttr("node_id",e);if(t==null)throw new Error(`node_id not found: ${e}`);return t.builder.wrapSource(t)}runtimeValues(e){let t=new Map,n={},s=e._getMeta("data_element");for(let[o,u]of e.runtimeToEvaluate()){if(u instanceof ne){t.set(o,u.resolve());continue}if(!e.pointerType(u)){t.set(o,u);continue}let l=e.absDatapath(u);if(t.set(o,this.data.getItem(l)),!s&&!l.includes("?")&&o===Dt){let c=this.data.getNode(l);c&&Object.assign(n,c.getAttr("_wdg"))}}let i=new Set;for(let[o,u]of t)s||o===Dt||typeof u!="string"||t.set(o,u.replace(/(\\)?\$\{([a-zA-Z_][a-zA-Z0-9_]*)\}/g,(l,c,d)=>{if(c)return l.slice(1);if(!t.has(d))throw new Error(`Unknown template parameter '${d}'`);i.add(d);let f=t.get(d);return f===null?"":String(f)}));let a=t.get(Dt);t.delete(Dt);for(let o of i)t.delete(o);return[a,{...Object.fromEntries(t),...n}]}targetId(e){if(e._targetId)return e._targetId;let t=e.rootBuilder;return e.parentBag.root!==t.source.root?null:(t._targetSerial+=1,e._targetId=`n${t._targetSerial}`,e._targetId)}get dataLogic(){if(!this._dataLogic){let e=this._buildDataLogic();this._dataLogic=Array.isArray(e)?e:[e]}return this._dataLogic}_buildDataLogic(){return this}_resolveLogicFunc(e){if(typeof e=="function")return e;if(typeof e!="string")throw new Error("data-element func must be a name or a function");for(let t of this.dataLogic){let s=(typeof t=="function"?t:t.constructor)[e];if(typeof s=="function")return s}throw new Error(`data-element func '${e}' not found on any data_logic source`)}_bindings(e){let[,t]=this.runtimeValues(e),n={};for(let[s,i]of Object.entries(t))fl.has(s)||(n[s]=i);return n}computeLogic(e){for(let t of e)this._computeNode(t)}_computeNode(e){let t=e.getAttr()||{};if(e.nodeTag==="dataSetter"){let n={};for(let[s,i]of Object.entries(t))s!=="destination"&&s!=="value"&&!s.startsWith("_")&&(n[s]=i);e.setRelativeData(t.destination,t.value,{attributes:Object.keys(n).length?n:null})}else if(e.nodeTag==="dataFormula"){let n=this._resolveLogicFunc(t.func);e.setRelativeData(t.destination,n(this._bindings(e)))}else e.nodeTag==="dataController"&&this._resolveLogicFunc(t.func)(e,this._bindings(e))}_dataElementNodes(){let e=[],t=n=>{for(let s of n.getNodes())s._getMeta("data_element")&&e.push(s),s.value instanceof D&&t(s.value)};return t(this.source),e}setup(e){}main(e){throw new Error(`${this.constructor.name}.main() not implemented: a bare builder is grammar, not a renderable page`)}_resolveComponents(){let e={};for(let o of dl(this.constructor))if(Object.hasOwn(o,"components"))for(let u of o.components||[])e[u]=u;if(!Object.keys(e).length)return;let t={...this.schema},n={};for(let[o,u]of Object.entries(e))t[o]={sub_tags:"",_meta:{component:!0}},n[o.toLowerCase()]=u;let s=Yr(t),i=this._collection||this.constructor._classCollection,a=i.toDocument();a.abstracts={},a.elements=Object.fromEntries(Object.keys(e).map(o=>[o,t[o]])),this._collection=new Ke(i.toDocument()).update(a),this._schemaOverride=t,this._componentMap=n,this._tagNamesOverride=s}_expansionRoot(e=null){let t=this.constructor._sourceClass,n=new t(null,this);return n.setBackref(),n.setItem(Zr,new t(null,this),e?{datapath:e}:null),n.getItem(Zr)}create(){this.setup(this.data),this._resolveComponents(),this.main(this.root),this.computeLogic(this._dataElementNodes())}get renderer_xml(){return new Nt(this)}getRenderer(e=null){e??=this.constructor._defaultRenderMode;let t=this[`renderer_${e}`];if(!t)throw new Error(`${this.constructor.name} does not expose renderer_${e}`);return t}materialize(e=null,t={}){e??=this.constructor._defaultRenderMode;let n=this.getRenderer(e),s=n.renderChildren(n.preprocess(this.source),t);return this.materialized[e]=s,s}setRenderTarget(e,t=null){t??=this.constructor._defaultRenderMode,this._defaultTargets.set(t,e)}render({mode:e=null,target:t=null,...n}={}){e??=this.constructor._defaultRenderMode;let s=this.getRenderer(e);if(t===!1&&s.renderType!=="string")throw new TypeError("target=false is not valid for an object renderer");let i=t===!1?null:t||this._defaultTargets.get(s.mode)||null,a={...i?.renderOpts,...n};return s.finalize(this.materialize(e,a),i,a)}};he._registry=new Map;var fp=new Set(["short","medium","long","full"]),pp=/('(?:[^']|'')*'|[a-zA-Z]+|[^a-zA-Z']+)/g;function hp(r,e){if(!(r instanceof Date))throw new TypeError("Temporal formats require a typed Date value");if(!Number.isFinite(r.getTime()))throw new RangeError("Invalid date");let t=e||le(r).split("::").at(-1);if(!["D","H","DH","DHZ"].includes(t))throw new RangeError(`Unsupported temporal dtype: ${t}`);return t}function mp(r,e,t,n){let s=e.match(pp)||[];if(s.join("")!==e)throw new RangeError("Unclosed format literal");let i=(c,d=2)=>String(c).padStart(d,"0"),a=c=>new Intl.DateTimeFormat(t,{timeZone:"UTC",...c}).format(r),l={...n==="H"?{}:{y:()=>String(r.getUTCFullYear()),yy:()=>i(r.getUTCFullYear()%100),yyyy:()=>i(r.getUTCFullYear(),4),M:()=>String(r.getUTCMonth()+1),MM:()=>i(r.getUTCMonth()+1),MMM:()=>a({month:"short"}),MMMM:()=>a({month:"long"}),d:()=>String(r.getUTCDate()),dd:()=>i(r.getUTCDate()),EEE:()=>a({weekday:"short"}),EEEE:()=>a({weekday:"long"})},...n==="D"?{}:{H:()=>String(r.getUTCHours()),HH:()=>i(r.getUTCHours()),h:()=>String(r.getUTCHours()%12||12),hh:()=>i(r.getUTCHours()%12||12),m:()=>String(r.getUTCMinutes()),mm:()=>i(r.getUTCMinutes()),s:()=>String(r.getUTCSeconds()),ss:()=>i(r.getUTCSeconds()),a:()=>new Intl.DateTimeFormat(t,{hour:"numeric",hour12:!0,timeZone:"UTC"}).formatToParts(r).find(c=>c.type==="dayPeriod").value}};return s.map(c=>{if(c.startsWith("'"))return c==="''"?"'":c.slice(1,-1).replaceAll("''","'");if(!/^[a-zA-Z]/.test(c))return c;if(!l[c])throw new RangeError(`Unsupported date format token: ${c}`);return l[c]()}).join("")}function pl(r,{format:e,mask:t,locale:n,dtype:s,places:i}={}){let a=r==null?"":String(r);if(r!=null&&r!==""&&(e!=null&&e!==""||i!=null))if(typeof r=="number"||Je(r))a=_p(r,{format:e,locale:n,places:i});else{let o=hp(r,s);if(fp.has(e)){let u={timeZone:"UTC"};o!=="H"&&(u.dateStyle=e),o!=="D"&&(u.timeStyle=e),a=new Intl.DateTimeFormat(n||void 0,u).format(r)}else a=mp(r,String(e),n||void 0,o)}return t==null?a:String(t).replaceAll("%s",()=>a)}function gp({format:r="decimal",places:e}={}){let t={maximumFractionDigits:20};if(!r||r==="decimal")t.style="decimal";else if(r==="percent")t.style="percent";else if(r==="scientific")t.notation="scientific";else{let n=/^(0|#,##0)(?:\.(0*)(#*))?$/.exec(r);if(!n||r.includes(".")&&!n[2]&&!n[3])throw new RangeError(`Unsupported number format: ${r}`);t.useGrouping=n[1].includes(","),t.minimumFractionDigits=(n[2]||"").length,t.maximumFractionDigits=(n[2]||"").length+(n[3]||"").length}if(e!=null&&e!==""){let n=Number(e);if(!Number.isInteger(n)||n<0||n>20)throw new RangeError("places must be an integer from 0 to 20");t.minimumFractionDigits=n,t.maximumFractionDigits=n}return t}function _p(r,e={}){if(typeof r!="number"&&!Je(r))throw new TypeError("Number formatting requires a Number or Decimal");if(!Number.isFinite(Number(r)))throw new RangeError("Number must be finite");let t=new Intl.NumberFormat(e.locale||void 0,gp(e));if(Je(r)&&new Intl.NumberFormat("en",{useGrouping:!1}).format("9007199254740993")!=="9007199254740993")throw new Error("This browser cannot format Decimal values without precision loss");return t.format(Je(r)?r.toString():r)}var bp=new Set(["style","script"]),wp=new Set(["allowfullscreen","async","autofocus","autoplay","checked","controls","default","defer","disabled","formnovalidate","inert","ismap","itemscope","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected"]),hl=new Set(["width","height","top","left","right","bottom","padding","margin","border","position","display","overflow","float","clear","resize","z_index","min_width","min_height","max_width","max_height","color","background","font","text","line_height","white_space","vertical_align","flex","gap","row_gap","column_gap","grid","align_content","justify_content","align_items","justify_items","visibility","opacity","cursor"]),Jr=new Set(["rounded","gradient","shadow","transform","transition","zoom","filter"]),ml=r=>r===!0?"true":r===!1?"false":String(r),is=r=>typeof r=="number"&&Number.isFinite(r)?`${r}px`:String(r);function yp(r){if(hl.has(r))return!0;for(let e of hl)if(r.startsWith(`${e}_`))return!0;return!1}function vp(r){let e=new Map;if(!r)return e;let t=[],n=0,s=null,i=!1,a=!1,o=0,u=String(r);for(let l=0;l<u.length;l+=1){let c=u[l],d=u[l+1];if(a){c==="*"&&d==="/"&&(a=!1,l+=1);continue}if(i){i=!1;continue}if(c==="\\"){i=!0;continue}if(s){c===s&&(s=null);continue}c==='"'||c==="'"?s=c:c==="/"&&d==="*"?(a=!0,l+=1):"([{".includes(c)?o+=1:")]}".includes(c)&&o>0?o-=1:c===";"&&o===0&&(t.push(u.slice(n,l)),n=l+1)}t.push(u.slice(n));for(let l of t){let c=l.trim();if(!c)continue;let d=c.indexOf(":");if(d<0)throw new TypeError(`malformed style declaration '${c}'`);e.set(c.slice(0,d).trim(),c.slice(d+1).trim())}return e}var Ct=class extends St{static mode="html";renderedItem(e,t,n,{tag:s,xml:i=!0,pretty:a=!1,depthOffset:o=0,includeDatapath:u=!1}={}){e.parentNode?._getMeta("subbuilder")==="html"&&(n={xmlns:"http://www.w3.org/1999/xhtml",...n});let{format:c,mask:d,locale:f,places:p,dtype:h,...m}=n;!Array.isArray(t)&&(c!=null||d!=null||p!=null)&&(t=pl(t,{format:c,mask:d,places:p,dtype:h,locale:this._displayLocale(e,f)}));let g=this._formatAttrs(m);if(u){if(!Object.hasOwn(n,"id")){let k=this.builder.targetId(e);k!==null&&(g+=` id="${this._htmlAttrValue(k)}"`)}for(let[k,I]of Object.entries(e.getAttr()))e.pointerType(I)&&(g+=` data-${this.adapt(k)}-pointer="${this._htmlAttrValue(e.absDatapath(I))}"`)}let b=a?" ".repeat(this._nodeDepth(e,o)):"",v=a?`
23
- `:"";if(e._getMeta("void"))return`${b}<${s}${g}${i?"/":""}>${v}`;if(Array.isArray(t)){let k=this._composeStringFragments(t);return`${b}<${s}${g}>${v}${k}${b}</${s}>${v}`}if(t==null)return`${b}<${s}${g}></${s}>${v}`;let w=typeof t=="string"&&t.endsWith("::HTML")?t.slice(0,-6):bp.has(s)?String(t):this._escapeText(t);return`${b}<${s}${g}>${w}</${s}>${v}`}_displayLocale(e,t){if(t)return t;for(let n=e.parentNode;n;n=n.parentNode){let s=n.getAttr("locale");if(s==null)continue;let i=n.pointerType(s)?n.data.getItem(n.absDatapath(s)):s;if(i)return i}}adaptAttrs(e){let t={},n={};for(let[i,a]of Object.entries(e||{}))if(i.startsWith(`${this.builder.constructor._name}_`))t[this.adapt(i)]=a;else if(i==="dtype")t.dtype=a;else{if(this.builder.constructor.retainedAttrPrefixes.some(o=>i.startsWith(o)))continue;this._isStyleContribution(i)?n[i]=a:t[i]=a}let s=this._adaptStyle(n);return s&&(t.style=s),t}_isStyleContribution(e){if(e==="style"||e.startsWith("style_")||Jr.has(e))return!0;let t=e.includes("_")?e.slice(0,e.indexOf("_")):null;return t!==null&&Jr.has(t)||yp(e)}_adaptStyle(e){let t=vp(e.style),n=new Map,s=new Map;for(let[i,a]of Object.entries(e))if(i!=="style")if(i.startsWith("style_"))t.set(i.slice(6).replaceAll("_","-"),ml(a));else if(Jr.has(i))n.set(i,a);else{let o=i.indexOf("_"),u=o<0?i:i.slice(0,o);o>=0&&Jr.has(u)?(s.has(u)||s.set(u,{}),s.get(u)[i.slice(o+1)]=a):t.set(i.replaceAll("_","-"),ml(a))}for(let i of Jr)(n.has(i)||s.has(i))&&this[`_macro_${i}`](n.get(i),s.get(i)||{},t);return[...t].map(([i,a])=>`${i}: ${a}`).join("; ")}_formatAttrs(e){let t=[];for(let[n,s]of Object.entries(e||{}))wp.has(n)?s&&t.push(` ${n}`):t.push(` ${n}="${this._htmlAttrValue(s)}"`);return t.join("")}_htmlAttrValue(e){return(e===!0?"true":e===!1?"false":String(e)).replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;")}_macro_rounded(e,t,n){let s=e===void 0?{}:{top_left:e,top_right:e,bottom_left:e,bottom_right:e};for(let[i,a]of Object.entries(t))if(i==="top"||i==="bottom")s[`${i}_left`]=a,s[`${i}_right`]=a;else if(i==="left"||i==="right")s[`top_${i}`]=a,s[`bottom_${i}`]=a;else if(["top_left","top_right","bottom_left","bottom_right"].includes(i))s[i]=a;else throw new TypeError(`rounded: unknown sub-kwarg '${i}'`);for(let[i,a]of Object.entries(s))n.set(`border-${i.replaceAll("_","-")}-radius`,is(a))}_macro_transform(e,t,n){let s=e===void 0?[]:[String(e)];for(let[i,a]of Object.entries(t))i==="rotate"?s.push(`rotate(${a}deg)`):i==="scale"||i==="translate"?s.push(`${i}(${a})`):i==="translate_x"?s.push(`translateX(${is(a)})`):i==="translate_y"?s.push(`translateY(${is(a)})`):i==="skew_x"?s.push(`skewX(${a}deg)`):i==="skew_y"?s.push(`skewY(${a}deg)`):s.push(`${i.replaceAll("_","-")}(${a})`);s.length&&n.set("transform",s.join(" "))}_macro_filter(e,t,n){let s=e===void 0?[]:[String(e)];for(let[i,a]of Object.entries(t))i==="rotate"?s.push(`hue-rotate(${a}deg)`):i==="blur"?s.push(`blur(${is(a)})`):i==="drop_shadow"?s.push(`drop-shadow(${a})`):s.push(`${i.replaceAll("_","-")}(${a})`);s.length&&n.set("filter",s.join(" "))}_macro_transition(e,t,n){e!==void 0&&n.set("transition",String(e));for(let[s,i]of Object.entries(t))n.set(`transition-${s.replaceAll("_","-")}`,String(i))}_macro_zoom(e,t,n){e!==void 0&&n.set("zoom",String(e))}_macro_shadow(e,t,n){e!==void 0&&n.set("box-shadow",String(e));for(let[s,i]of Object.entries(t))n.set(`box-shadow-${s.replaceAll("_","-")}`,String(i))}_macro_gradient(e,t,n){e!==void 0&&n.set("background-image",String(e))}};var Ep=new Set(["alignment_baseline","baseline_shift","clip_path","clip_rule","color_interpolation","color_interpolation_filters","dominant_baseline","fill_opacity","fill_rule","flood_color","flood_opacity","font_family","font_size","font_size_adjust","font_stretch","font_style","font_variant","font_weight","glyph_orientation_horizontal","glyph_orientation_vertical","image_rendering","letter_spacing","lighting_color","marker_end","marker_mid","marker_start","overline_position","overline_thickness","paint_order","pointer_events","shape_rendering","stop_color","stop_opacity","strikethrough_position","strikethrough_thickness","stroke_dasharray","stroke_dashoffset","stroke_linecap","stroke_linejoin","stroke_miterlimit","stroke_opacity","stroke_width","text_anchor","text_decoration","text_rendering","underline_position","underline_thickness","unicode_bidi","word_spacing","writing_mode"]);function as(r){return Object.fromEntries(Object.entries(r||{}).map(([e,t])=>[Ep.has(e)?e.replaceAll("_","-"):e,t]))}var Ot=class extends Nt{static mode="svg";adaptAttrs(e){return as(e)}};var gl={document_format:{name:"builder_grammar",version:"1.1"},grammar:{name:"html",version:null,title:null,description:null},abstracts:{},elements:{svg:{doc:"Switch to the SVG dialect from this node down (BLD.2).\n\n A sub-builder element: ``_meta['subbuilder']`` switches the active\n dialect to SVG from this node down. No ``render_tag``: ``<svg>`` is\n emitted verbatim (HTML5 has a native ``<svg>`` tag).",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{subbuilder:"svg"}},a:{doc:null,sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},abbr:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},address:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},area:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{void:!0}},article:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},aside:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},audio:{doc:null,sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},b:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},base:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{void:!0}},bdi:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},bdo:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},blockquote:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},body:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},br:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{void:!0}},button:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},canvas:{doc:null,sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},caption:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},cite:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},code:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},col:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{void:!0}},colgroup:{doc:null,sub_tags:"col,script,template",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},data:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},datalist:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,option,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},dd:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},del_:{doc:null,sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},details:{doc:null,sub_tags:"summary[0:1],a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},dfn:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},dialog:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},div:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},dl:{doc:null,sub_tags:"dd,div,dt,script,template",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},dt:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},em:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},embed:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{void:!0}},fieldset:{doc:null,sub_tags:"legend[0:1],a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},figcaption:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},figure:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figcaption[0:1],figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},footer:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},form:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},h1:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},h2:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},h3:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},h4:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},h5:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},h6:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},head:{doc:null,sub_tags:"base[0:1],link,meta,noscript,script,style,template,title[0:1]",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},header:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},hgroup:{doc:null,sub_tags:"h1,h2,h3,h4,h5,h6,p,script,template",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},hr:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{void:!0}},html:{doc:null,sub_tags:"head[0:1],body[0:1]",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},i:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},iframe:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},img:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{void:!0}},input:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{void:!0}},ins:{doc:null,sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},kbd:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},label:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},legend:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,h1,h2,h3,h4,h5,h6,hgroup,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},li:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},link:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{void:!0}},main:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},map:{doc:null,sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},mark:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},menu:{doc:null,sub_tags:"li,script,template",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},meta:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{void:!0}},meter:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},nav:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},noscript:{doc:null,sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},object:{doc:null,sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},ol:{doc:null,sub_tags:"li,script,template",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},optgroup:{doc:null,sub_tags:"div,legend,noscript,option,script,template",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},option:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,div,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},output:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},p:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},picture:{doc:null,sub_tags:"img[0:1],script,source,template",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},pre:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},progress:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},q:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},rp:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},rt:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},ruby:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},s:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},samp:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},script:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},search:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},section:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},select:{doc:null,sub_tags:"button,div,hr,noscript,optgroup,option,script,template",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},slot:{doc:null,sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},small:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},source:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{void:!0}},span:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},strong:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},style:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},sub:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},summary:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,h1,h2,h3,h4,h5,h6,hgroup,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},sup:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},table:{doc:null,sub_tags:"caption[0:1],colgroup,script,tbody,template,tfoot[0:1],thead[0:1],tr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},tbody:{doc:null,sub_tags:"script,template,tr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},td:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},template:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,caption,cite,code,col,colgroup,data,datalist,del_,details,dfn,dialog,div,dl,dt,em,embed,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,legend,li,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,optgroup,option,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,source,span,strong,style,sub,summary,sup,table,tbody,td,template,textarea,tfoot,th,thead,time,tr,track,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},textarea:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},tfoot:{doc:null,sub_tags:"script,template,tr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},th:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},thead:{doc:null,sub_tags:"script,template,tr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},time:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},title:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},tr:{doc:null,sub_tags:"script,td,template,th",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},track:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{void:!0}},u:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},ul:{doc:null,sub_tags:"li,script,template",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},var:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},video:{doc:null,sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},wbr:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{void:!0}},selectedcontent:{doc:"Mirror of the selected option for Customizable Select (HTML 2024).",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},dataSetter:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"destination",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"type",module:"builtins",name:"str"},has_default:!1},{name:"value",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"any"},has_default:!1},{name:"attr",kind:"var_keyword",role:"attribute",annotation:{kind:"any"},has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{data_element:!0}},dataFormula:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"destination",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"type",module:"builtins",name:"str"},has_default:!1},{name:"func",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"union",items:[{kind:"type",module:"builtins",name:"str"},{kind:"type",module:"collections.abc",name:"Callable"}]},has_default:!1},{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{data_element:!0}},dataController:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"func",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"union",items:[{kind:"type",module:"builtins",name:"str"},{kind:"type",module:"collections.abc",name:"Callable"}]},has_default:!1},{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{data_element:!0}}}};var pt=class extends he{static _name="html";static _defaultRenderMode="html";static retainedAttrPrefixes=["validate_","dtype"];static{this.defineGrammar(gl)}get renderer_html(){return new Ct(this)}};he.registerBuilder(pt);var _l={document_format:{name:"builder_grammar",version:"1.1"},grammar:{name:"svg",version:null,title:null,description:null},abstracts:{graphics:{doc:"SVG graphics content: any graphical element.",sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},_meta:null},containerElement:{doc:"SVG container content: elements that can hold children.",sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},_meta:null}},elements:{html:{doc:"Switch to the HTML dialect from this node down (BLD.2).\n\n A sub-builder element: ``_meta['subbuilder']`` switches the active\n dialect to HTML from this node down. The source tag ``html`` is\n rendered as ``_meta['render_tag']`` (``<foreignObject>``) carrying\n ``_meta['render_attributes']`` (the SVG namespace). The immediate\n HTML child declares XHTML so both sides of the XML boundary retain\n their native namespace.\n ",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{subbuilder:"html",render_tag:"foreignObject",render_attributes:{xmlns:"http://www.w3.org/2000/svg"}}},svg:{doc:"Root SVG container or nested SVG viewport.",sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},g:{doc:"Group container for applying transforms and styles.",sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},defs:{doc:"Container for referenced elements (gradients, patterns, etc.).",sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},symbol:{doc:"Reusable graphical template, rendered only when referenced by <use>.",sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},use:{doc:"Reference and render a <symbol> or other element.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},rect:{doc:"Rectangle.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},circle:{doc:"Circle.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},ellipse:{doc:"Ellipse.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},line:{doc:"Line segment between two points.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},polyline:{doc:"Open shape of connected line segments.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},polygon:{doc:"Closed shape of connected line segments.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},path:{doc:"Arbitrary shape defined by path commands (d attribute).",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},image:{doc:"Embedded raster image.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},text:{doc:"Text block. Contains text content and optional <tspan>/<textPath>.",sub_tags:"tspan,textPath",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},tspan:{doc:"Inline text span within <text>.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},textPath:{doc:"Text rendered along a path shape.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},linearGradient:{doc:"Linear gradient definition. Place inside <defs>.",sub_tags:"stop",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},radialGradient:{doc:"Radial gradient definition. Place inside <defs>.",sub_tags:"stop",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},stop:{doc:"Gradient stop (color and offset).",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},pattern:{doc:"Tile pattern definition. Place inside <defs>.",sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},clipPath:{doc:"Clipping path definition.",sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},mask:{doc:"Alpha mask definition.",sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},marker:{doc:"Marker symbol for line endpoints or vertices.",sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},filter:{doc:"Filter effect container. Place inside <defs>.",sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},feGaussianBlur:{doc:"Gaussian blur filter primitive.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},feOffset:{doc:"Offset filter primitive.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},feBlend:{doc:"Blend filter primitive.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},feColorMatrix:{doc:"Color matrix filter primitive.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},feComposite:{doc:"Composite filter primitive.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},feFlood:{doc:"Flood fill filter primitive.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},feMerge:{doc:"Merge filter primitive (container for feMergeNode).",sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},feMergeNode:{doc:"Single input for feMerge.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},feDropShadow:{doc:"Drop shadow filter primitive (SVG 2).",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},feDiffuseLighting:{doc:"Diffuse lighting filter primitive.",sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},feSpecularLighting:{doc:"Specular lighting filter primitive.",sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},fePointLight:{doc:"Point light source for lighting filters.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},feDistantLight:{doc:"Distant light source for lighting filters.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},feSpotLight:{doc:"Spot light source for lighting filters.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},feMorphology:{doc:"Morphology filter primitive (erode/dilate).",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},feTurbulence:{doc:"Turbulence noise filter primitive.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},feDisplacementMap:{doc:"Displacement map filter primitive.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},feConvolveMatrix:{doc:"Convolution matrix filter primitive.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},feImage:{doc:"Image filter primitive.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},feTile:{doc:"Tile filter primitive.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},animate:{doc:"Animate an attribute over time.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},animateTransform:{doc:"Animate a transform attribute.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},animateMotion:{doc:"Animate motion along a path.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},set:{doc:"Set an attribute to a value for a duration.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},title:{doc:"Accessible title (tooltip in browsers).",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},desc:{doc:"Accessible description.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},metadata:{doc:"Metadata container (RDF, Dublin Core, etc.).",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},a:{doc:"Hyperlink wrapper.",sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},foreignObject:{doc:"Container for non-SVG content (HTML, MathML).",sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},switch:{doc:"Conditional processing (renders first matching child).",sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},dataSetter:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"destination",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"type",module:"builtins",name:"str"},has_default:!1},{name:"value",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"any"},has_default:!1},{name:"attr",kind:"var_keyword",role:"attribute",annotation:{kind:"any"},has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{data_element:!0}},dataFormula:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"destination",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"type",module:"builtins",name:"str"},has_default:!1},{name:"func",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"union",items:[{kind:"type",module:"builtins",name:"str"},{kind:"type",module:"collections.abc",name:"Callable"}]},has_default:!1},{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{data_element:!0}},dataController:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"func",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"union",items:[{kind:"type",module:"builtins",name:"str"},{kind:"type",module:"collections.abc",name:"Callable"}]},has_default:!1},{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{data_element:!0}}}};var ht=class extends he{static _name="svg";static _defaultRenderMode="svg";static{this.defineGrammar(_l)}get renderer_svg(){return new Ot(this)}};he.registerBuilder(ht);var Re=class{constructor(e){this.gramlot=e}};var Dp={dataFormula:["formula","_if","_else"],dataController:["script","_if","_else"],dataRpc:["_if","_else","_onCalling","_onResult","_onError"],button:["action"]};function bl(r){return typeof r=="string"&&r.startsWith("==")}var Bt=class extends Ve{#e=new Set;#t=null;codeAttributes(){let e=Dp[this.nodeTag]??[],t=[];for(let[n,s]of Object.entries(this.getAttr()??{}))typeof s=="string"&&(e.includes(n)||n.startsWith("connect_on"))&&t.push([n,s]);for(let[n,s]of ye(this.getAttr()))bl(s)&&t.push([n,s]);return bl(this.staticValue)&&t.push(["",this.staticValue]),t}activateCode(){let e=new Map;for(let[t,n]of this.codeAttributes()){if(this.pointerType(n))throw new Error(`${this.nodeTag} '${this.label}': '${t}' is inline code and cannot be the pointer '${n}'; inline code is never read from Data`);e.set(t,n)}this.#t=e}activatedCode(e){return this.#t?.get(e)??null}pointerType(e){return typeof e=="string"&&e.startsWith("==")?null:super.pointerType(e)}pointers(){return super.pointers().filter(([e,t])=>!this.#n(e,t))}runtimeToEvaluate(){let e=super.runtimeToEvaluate();for(let[t,n]of e)this.pointerType(n)&&(this.#n(t,n)?e.set(t,n.slice(1)):this.absDatapath(n)===null&&e.set(t,null));return e}pathAttribute(e){let t=this.getAttr(e);return this.pointerType(t)&&this.#n(e,t)?t.slice(1):t}getRelativeData(e,t=null,n={}){return this.absDatapath(e)===null?null:super.getRelativeData(e,t,n)}setRelativeData(e,t,n={}){this.#i(e),super.setRelativeData(e,t,n)}PUT(e,t){this.#i(e),this.data.setItem(this.absDatapath(e),t,null,">",!1,!0,this,!1,!1)}FIRE(e,t=!0,n=null){t===null&&(t=!0),this.#i(e);let s=this.absDatapath(e);if(s.includes("?")){this.#r(s,t);return}this.data.getNode(s)?.setValue(null,!1);try{this.fireEvent(e,t,{attributes:n})}finally{this.data.getNode(s)?.setValue(null,!1)}}#r(e,t){let[n,s]=e.split("?",2),i=this.data;i.getNode(n)?.setAttr({[s]:null},!1);try{let a=i.getNode(n);a?a.setValue(a.staticValue,!0,{[s]:t},!0,!0,!0,!0):i.setItem(n,null,{[s]:t},">",!0,!0,!0,!0)}finally{i.getNode(n)?.setAttr({[s]:null},!1)}}FIRE_AFTER(e,t=!0,n=10){this.#i(e);let s=this.rootBuilder?.binding?.bindingFor(this)??null,i=null,a=setTimeout(()=>{i?.(),this.FIRE(e,t)},n);return i=s?.track(()=>clearTimeout(a))??null,()=>{clearTimeout(a),i?.()}}absDatapath(e){let t=this.pointerType(e)?e.slice(1):e;if(t.startsWith("#")&&t.includes("?")){let[n,s]=t.split("?",2),i=super.absDatapath(n);return i===null?null:`${i}?${s}`}return super.absDatapath(e)}_composeRelativeDatapath(e,t){let n=this;for(;n!==null&&e.startsWith(".");){let s=n.getAttr("datapath");if(this.pointerType(s)&&(s=this.#s(n,s),s===null))return null;if(s!=null&&(e=e==="."?s:s+e),e.startsWith("#"))return n.parentNode._resolveSymbolicDatapath(e,t);n=n.parentNode}if(e.startsWith("."))throw new Error(`unresolved relative datapath: ${t}`);return e}_finalizeAbsPath(e,t){return e===null?null:super._finalizeAbsPath(e,t)}_resolveSymbolicDatapath(e,t){let n=e.slice(1).split(".",1)[0];if(n==="FORM"||n==="ANCHOR")return super._resolveSymbolicDatapath(e,t);let s=this.rootBuilder?.binding;if(!s)return super._resolveSymbolicDatapath(e,t);let i=s.nodeIds.get(n);if(!i)throw new Error(`#<id>: cannot resolve ${t}`);let a=e.slice(n.length+2);return i.absDatapath(a?`.${a}`:".")}#s(e,t){let n=e.parentNode.absDatapath(t);if(n===null)return null;let s=this.data.getItem(n);return s==null||s===""?null:s}#n(e,t){return typeof e!="string"||!e.endsWith("_path")?!1:(this.#e.has(e)||(this.#e.add(e),console.warn(`${this.nodeTag} '${this.label}': '${e}' holds a bare Data path; the pointer symbol of '${t}' is removed`)),!0)}#i(e){if(this.absDatapath(e)===null)throw new Error(`${this.nodeTag} '${this.label}': write on a null path: '${e}'`)}},se=class r extends D{get nodeClass(){return Bt}authorizedCopy(e){let t=new this.constructor;for(let n of this.getNodes()){let s=n.getAttr("auth")??null;if(s!==null){if(typeof s!="string")throw new TypeError(`${n.nodeTag} '${n.label}': 'auth' must be a string rule, not ${typeof s}`);if(e(s)!==null)continue}let i=n.staticValue;i instanceof r&&(i=i.authorizedCopy(e));let{auth:a,...o}=n.getAttr(),u=t.setItem(n.label,i,o,">",!1,!1,null,!1,!0,null,n.nodeTag);u.xmlTag=n.xmlTag}return t}activateCode(){for(let e of this.getNodes())e.activateCode(),e.staticValue instanceof r&&e.staticValue.activateCode();return this}};if((xe(se.tytxSuffix).GramlotBuilderBag??se)!==se)throw new Error("TYTX subtype name 'GramlotBuilderBag' is already registered for another class");At(se.tytxSuffix,{...xe(se.tytxSuffix),GramlotBuilderBag:se});var Ee="http://www.w3.org/1999/xhtml",Kr="http://www.w3.org/2000/svg",Tp=new Set(["default","default_value","live","group","visible","action","fire","if","else","_init","_onStart","_onBuilt","_delay","_timing","_userChanges"]),xp=["default_","attr_","fire_","connect_on"],Sp={table:["width","border"],editor:["height"],embed:["width","height"],img:["width","height"],canvas:["width","height"]},Np=/(?<!\\)\$\{([a-zA-Z_][a-zA-Z0-9_]*)\}/g,Cp=["format","mask","locale","places","dtype"],Op=new Set(["href","src","formaction","xlink:href","xlink_href"]);function mt(r){return Object.fromEntries(Object.entries(r).filter(([e])=>!Tp.has(e)&&!xp.some(t=>e.startsWith(t))))}function os(r,e,t=[]){for(let[n,s]of Object.entries(cr(mt(e)))){let i=t.find(o=>n.startsWith(o)),a=i?n.slice(i.length):n;if(/^on./i.test(a))throw new Error(`${r.nodeTag} '${r.label}': '${n}' has the form of a native event handler, run by the browser outside Gramlot; write connect_${a} for an event, or rename the attribute`);if(Op.has(a.toLowerCase())&&Bp(s))throw new Error(`${r.nodeTag} '${r.label}': '${n}' holds a javascript: URL, run by the browser as code; write connect_onclick or the action of a button instead`)}}function Bp(r){return typeof r=="string"&&/^javascript:/i.test(r.replace(/[\t\n\r]/g,"").replace(/^[\u0000-\u0020]+/,""))}function wl(r,e,t=[]){if(r.nodeTag!=="iframe")return e;let n=u=>{let l=t.find(c=>u.startsWith(c))??"";return[l,u.slice(l.length).toLowerCase()]},s=Object.fromEntries(ye(r.getAttr())),i=[...Object.keys(s),...Object.keys(e)].find(u=>n(u)[1]==="srcdoc");if(i===void 0||Object.keys(s).some(u=>n(u)[1]==="sandbox"))return e;let a=(u,l)=>{let c=s[u];return l.add(u),r.pointerType(c)!==null||Se(c)||lr(c).some(d=>Object.hasOwn(s,d)&&!l.has(d)&&a(d,l))};if(r.pointerType(r.value)===null&&!(Object.hasOwn(s,i)&&a(i,new Set)))return e;let o=Object.fromEntries(Object.entries(e).filter(([u])=>n(u)[1]!=="sandbox"));return{[`${n(i)[0]}sandbox`]:"",...o}}function cr(r){return Object.fromEntries(Object.entries(r).filter(([,e])=>e!=null))}function Qr(r){return Object.fromEntries(Object.entries(r).map(([e,t])=>e.startsWith("xmlns_")?[`xmlns:${e.slice(6)}`,t]:e.startsWith("data_")||e.startsWith("aria_")?[e.replaceAll("_","-"),t]:[e,t]))}function ls(r){let{_meta:e,...t}=r;return Qr(cr(mt(t)))}function yl(r,e){let t=Sp[String(r).toLowerCase()]??[],n={},s={};for(let[i,a]of Object.entries(e))t.includes(i)?s[i]=a:n[i]=a;return[n,s]}function ur(r){return String(r)}function en(r,e){let t={...e},n=t.mask;for(let i of Cp)delete t[i];if(Array.isArray(r))return[r,t];if(typeof r=="boolean"&&(r=ur(r)),n==null)return[r,t];let s=r==null?"":ur(r);return[s===""?s:String(n).replaceAll("%s",()=>s),t]}function lr(r){return typeof r=="string"?[...r.matchAll(Np)].map(([,e])=>e):[]}function Se(r){return typeof r=="string"&&r.startsWith("==")}function vl(r){if(Se(r.value)&&lr(r.value).length)throw new Error(`${r.nodeTag} '${r.label}': the == node value contains a \${\u2026} template, not accepted in a == expression`);let e=Object.fromEntries(ye(r.getAttr()));for(let[t,n]of Object.entries(e)){if(Se(n)&&lr(n).length)throw new Error(`${r.nodeTag} '${r.label}': '${t}' contains a \${\u2026} template, not accepted in a == expression`);for(let s of lr(n))if(Se(e[s]))throw new Error(`${r.nodeTag} '${r.label}': the template of '${t}' uses '${s}', a == expression`)}}var Ip=new Set(["animate","animateMotion","animateTransform","circle","ellipse","feBlend","feColorMatrix","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feGaussianBlur","feImage","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","image","line","metadata","path","polygon","polyline","rect","set","stop","use"]),tn=class extends Ot{constructor(e,t){super(e),this._owner=t}get owner(){return this._owner}_handleMeta(e,t){let n=this.owner.evaluateExpressions(e,t);os(e,n);let[s,i]=super._handleMeta(e,n);return e._getMeta("subbuilder")?[s,as(ls(i))]:[s,i]}adaptAttrs(e){let{_meta:t,...n}=e;return Qr(super.adaptAttrs(cr(mt(n))))}renderedItem(e,t,n,s={}){if(this.owner.renderType==="object")return this.owner.renderedItem(e,t,n,s);let{_text:i,...a}=n;return t=this.owner.expressionValue(e,t),Array.isArray(t)&&i!=null&&(t=[this._escapeText(ur(i)),...t]),Ip.has(s.tag)?`${s.pretty?" ".repeat(this._nodeDepth(e,s.depthOffset??0)):""}<${s.tag}${this._formatAttrs(a)} />${s.pretty?`
24
- `:""}`:super.renderedItem(e,t,a,s)}};var It=class extends Ct{#e=new WeakMap;#t=new WeakMap;get inlineCompiler(){return null}getRender(e){return this.renders.has(e)||(e instanceof pt?this.addRender(e,this):e instanceof ht&&this.addRender(e,new tn(e,this))),super.getRender(e)}render(e,t={}){return e._getMeta("data_element")?null:super.render(e,t)}_handleMeta(e,t){let n=this.builder.constructor.dialectPrefixes,s=this.evaluateExpressions(e,t);os(e,s,n);let[i,a]=super._handleMeta(e,wl(e,s,n));if(e._getMeta("subbuilder")){let l=ls(a);return e._getMeta("subbuilder")==="html"&&(l.xmlns=Kr),[i,l]}let[o,u]=yl(i,a);return Object.keys(u).length&&this.#e.set(e,u),[i,o]}evaluateExpressions(e,t){vl(e);let n=this.inlineCompiler,s=(a,o)=>n?n.compileExpression(e,a,o)(t):null,i={...t};for(let[a,o]of ye(e.getAttr()))Se(o)&&Object.hasOwn(i,a)&&(i[a]=s(a,o));return Se(e.value)&&this.#t.set(e,s("",e.value)),i}expressionValue(e,t){return Se(e.value)?this.#t.get(e)??null:t}restoreNativeAttributes(e,t){let n=this.#e.get(e);return n?(this.#e.delete(e),{...t,...cr(n)}):t}adaptAttrs(e){let{_meta:t,...n}=e,s=`${this.builder.constructor._name}_`,i=this.builder.constructor.dialectPrefixes,a={},o={};for(let[u,l]of Object.entries(mt(n))){if(l==null)continue;if(u.startsWith(s))throw new Error(`${u}: the attribute prefix '${s}' is not accepted; use the prefix '${i[0]}'`);let c=i.find(d=>u.startsWith(d));c?a[u.slice(c.length)]=l:o[u]=l}return Qr({...super.adaptAttrs(o),...a})}renderedItem(e,t,n,s={}){let i;[t,i]=en(this.expressionValue(e,t),this.restoreNativeAttributes(e,n));let{_text:a,...o}=i;Array.isArray(t)&&a!=null&&(t=[this._escapeText(ur(a)),...t]);let u=e.parentNode?._getMeta("subbuilder")==="html"?{xmlns:Ee,...o}:o;return super.renderedItem(e,t,u,s)}finalize(e,t=null,n={}){if(!n.doctype)return super.finalize(e,t,n);let s=this._composeStringFragments(e),i=this.builder.source.getNodes().filter(a=>!a._getMeta("data_element"));return i.length===1&&i[0].nodeTag==="html"||(s=`<html>${s}</html>`),super.finalize(`<!doctype html>${s}`,t,n)}};var El={document_format:{name:"builder_grammar",version:"1.1"},grammar:{name:"binding",version:null,title:"Gramlot binding",description:"Data-elements of Gramlot 0.2.0 with the signatures of decision P18; loaded after the HTML grammar."},abstracts:{},elements:{dataSetter:{doc:"Initial Data value, written literally at destination_path.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"destination_path",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"type",module:"builtins",name:"str"},has_default:!1},{name:"value",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"any"},has_default:!0,default:null},{name:"attr",kind:"var_keyword",role:"attribute",annotation:{kind:"any"},has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{data_element:!0}},dataFormula:{doc:"Computed Data value written at result_path; formula is inline, func is a name.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"result_path",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"type",module:"builtins",name:"str"},has_default:!1},{name:"formula",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"union",items:[{kind:"type",module:"builtins",name:"str"},{kind:"type",module:"builtins",name:"NoneType"}]},has_default:!0,default:null},{name:"func",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"union",items:[{kind:"type",module:"builtins",name:"str"},{kind:"type",module:"builtins",name:"NoneType"}]},has_default:!0,default:null},{name:"params",kind:"var_keyword",role:"attribute",annotation:{kind:"any"},has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{data_element:!0}},dataController:{doc:"Side effects on Data; script is inline, func is a name.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"script",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"union",items:[{kind:"type",module:"builtins",name:"str"},{kind:"type",module:"builtins",name:"NoneType"}]},has_default:!0,default:null},{name:"func",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"union",items:[{kind:"type",module:"builtins",name:"str"},{kind:"type",module:"builtins",name:"NoneType"}]},has_default:!0,default:null},{name:"params",kind:"var_keyword",role:"attribute",annotation:{kind:"any"},has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{data_element:!0}},dataRpc:{doc:"Server endpoint called through gramlot.rpc; the value is written at result_path when given.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"method",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"type",module:"builtins",name:"str"},has_default:!1},{name:"result_path",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"union",items:[{kind:"type",module:"builtins",name:"str"},{kind:"type",module:"builtins",name:"NoneType"}]},has_default:!0,default:null},{name:"timeout",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"union",items:[{kind:"type",module:"builtins",name:"int"},{kind:"type",module:"builtins",name:"float"},{kind:"type",module:"builtins",name:"NoneType"}]},has_default:!0,default:null},{name:"params",kind:"var_keyword",role:"attribute",annotation:{kind:"any"},has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{data_element:!0}}}};var Mp="data is forbidden: write dataSetter for a Data value or html_data for the HTML5 <data> element",$p=new Set(["dataremote"]),Lp=new Set(["serverpath","dbenv","shared_id","remote","_ask","ask"]),Fp=["subscribe_","selfsubscribe_","formsubscribe_"],Up={dataSetter:"destination_path",dataFormula:"result_path",dataRpc:"result_path"},Pp={dataFormula:"formula",dataController:"script"};function kl(r,e){let t=Up[r];if(t&&String(e[t]??"").includes("?"))return`'${t}' does not accept '?attr': '${e[t]}'`;let n=Pp[r];return n&&e[n]!=null&&e.func!=null?`'func' and '${n}' cannot be declared on the same node`:n&&e._if!=null&&e.func!=null?"'_if' is inline and cannot be declared with 'func': write the condition in the method":null}function Al(r){return Object.keys(r).find(e=>Lp.has(e)||Fp.some(t=>e.startsWith(t)))}var Qe=class r extends pt{static _name="gramlot";static _sourceClass=se;static{this.defineGrammar(El)}static get dialectPrefixes(){let e=[];for(let t=Object.getPrototypeOf(r);t&&t!==Function.prototype;t=Object.getPrototypeOf(t))Object.hasOwn(t,"_name")&&t._name&&e.push(`${t._name}_`);return e}constructor(e=null,{collections:t=[],auth:n=null}={}){super(e),this._binding=null,this._auth=n;for(let s of t)this.loadCollection(s)}get auth(){return this._auth}get binding(){return this._binding}set binding(e){this._binding=e}nodeById(e){if(!this.binding)return super.nodeById(e);let t=this.binding.nodeIds.get(e);if(!t)throw new Error(`node_id not found: ${e}`);return t.builder.wrapSource(t)}loadCollection(e){return this.loadGrammar(e),this}schemaTag(e){let t=e.toLowerCase(),n=r.dialectPrefixes;if(t.startsWith(`${r._name}_`))throw new Error(`${e}: the tag prefix '${r._name}_' is not accepted; use the prefix '${n[0]}'`);if($p.has(t))throw new Error(`${e}: excluded from Gramlot 0.2.0`);let s=this.schemaTagNames[t];if(s)return s;for(let i of n)if(t.startsWith(i)&&this.schemaTagNames[t.slice(i.length)])return t;return null}bagCall(e,t,n,s){return super.bagCall(e,this.#e(t),n,s)}commandOnNode(e,t,n,s){return super.commandOnNode(e,this.#e(t),n,s)}validateNodeValues(e,t,n={}){let s=Al(n);if(s)throw new Error(`${e}: attribute '${s}' is excluded from Gramlot 0.2.0`);let i=kl(e,n);if(i)throw new Error(`${e}: ${i}`);return super.validateNodeValues(e,t,n)}validateNode(e,t={}){let n=Al(t.attrs??e.getAttr());if(n)throw new Error(`${e.nodeTag} '${e.label}': attribute '${n}' is excluded from Gramlot 0.2.0`);let s=kl(e.nodeTag,t.attrs??e.getAttr());if(s)throw new Error(`${e.nodeTag} '${e.label}': ${s}`);return super.validateNode(e,t)}setChild(e,t,n,s,i=null){let o=t==="dataSetter"&&s?.value!==null&&typeof s?.value=="object"&&Object.getPrototypeOf(s.value)===Object.prototype?{...s,value:new P(s.value)}:s;return super.setChild(e,t,n,o,i)}#e(e){if(e==="data")throw new Error(Mp);if(this.schemaTagNames[e.toLowerCase()]===e)return e;let t=r.dialectPrefixes.find(n=>e.startsWith(n));return this.schemaTagNames[e.slice(t.length)]}get renderer_html(){return new It(this)}create(){this.setup(this.data),this.main(this.root)}computeLogic(){}promoteNodeValue(e,t,n){let s=t!=null?{_text:t}:null;e.setValue(n,!0,s,!0)}reference(e,t="node"){if(e=Ie(e),!(e instanceof Ve)||!["node","dom"].includes(t))throw new TypeError("Reference requires an element and node/dom kind");let n=e.getAttr("__ref");return n==null&&(n=crypto.randomUUID().replaceAll("-",""),e.setAttr({__ref:n})),{$gramlotRef:n,kind:t}}toTytx(){return le(this.auth===null?this.source:this.source.authorizedCopy(this.auth))}};var qp=new Set(["input","select","textarea"]),jp=["type","multiple","group"];function Dl(r,e){let t=r.getAttr(e);return r.pointerType(t)?r.getRelativeData(t):t}var me=class r{static liveWrites=!1;static writesDefault=!0;#e;#t;#r=!1;#s=!1;#n=!1;static for(e,t){let n=r.classFor(t.element,t.attrs);return n?new n(e,t):null}static classFor(e,t){if(e.namespaceURI!==Ee)return null;if(e.localName==="textarea")return He;if(e.localName==="select")return rn;if(e.localName!=="input")return null;let n=t.type==null?"text":String(t.type).toLowerCase();return Object.hasOwn(xl,n)?xl[n]:He}static shape(e,t){return e?.namespaceURI!==Ee||!qp.has(e.localName)?null:JSON.stringify(jp.map(n=>t[n]??null))}constructor(e,t){this.#e=e,this.#t=t}get binding(){return this.#e}get element(){return this.#t.element}get node(){return this.binding.node}get resolved(){return this.#t.resolved}get live(){return!!this.resolved.live}get writeEvent(){return this.constructor.liveWrites&&this.live?"input":"change"}project(e,t){if(this.#s){this.#n=!0;return}this.#r&&this.same(this.read(),e)||(this.constructor.writesDefault&&!this.node.pointerType(this.node.getAttr("value"))&&this.writeDefault(e),this.write(e))}read(){return this.element.value}write(e){let t=e==null?"":String(e);this.element.value!==t&&(this.element.value=t)}writeDefault(e){let t=e==null?"":String(e);this.element.localName==="textarea"?this.#t.text.data!==t&&(this.#t.text.data=t):this.element.defaultValue!==t&&(this.element.defaultValue=t)}same(e,t){return Object.is(e,t)}commit(e){if(this.binding.closed)return;let t=this.node.getAttr("value");if(this.node.pointerType(t)==="^"){this.#r=!0;try{this.node.setRelativeData(t.slice(1),this.read())}finally{this.#r=!1}}}attach(){for(let e of["input","change","compositionstart","compositionend"])this.element.addEventListener(e,this)}detach(){for(let e of["input","change","compositionstart","compositionend"])this.element.removeEventListener(e,this);this.#n=!1}refresh(){}handleEvent(e){if(!this.binding.closed){if(e.type==="compositionstart"){this.#s=!0;return}if(e.type==="compositionend"){this.#s=!1,this.writeEvent==="input"&&this.commit(e),this.#n&&(this.#n=!1,this.binding.runtime.renderer.project(this.node));return}this.#s||e.isComposing||e.type===this.writeEvent&&this.commit(e)}}},He=class extends me{static liveWrites=!0},xi=class extends me{static liveWrites=!0;read(){return this.element.value===""?null:Number(this.element.value)}commit(e){this.element.validity.badInput||super.commit(e)}},Si=class extends me{static liveWrites=!0;read(){return Number(this.element.value)}},rn=class extends me{static writesDefault=!1;read(){return this.element.multiple?[...this.element.selectedOptions].map(e=>e.value):this.element.selectedIndex===-1?null:this.element.value}write(e){let t=this.element;if(t.multiple){if(e!=null&&!Array.isArray(e))throw new TypeError(`${this.node.nodeTag} '${this.node.label}': a multiple select requires an array`);let n=new Set((e??[]).map(String));for(let s of t.options){let i=n.has(s.value);s.selected!==i&&(s.selected=i)}}else e==null?t.selectedIndex!==-1&&(t.selectedIndex=-1):(t.selectedIndex===-1||t.value!==String(e))&&(t.value=String(e))}same(e,t){return Array.isArray(e)?Array.isArray(t)&&t.length===e.length&&t.every((n,s)=>Object.is(n,e[s])):super.same(e,t)}},Rt=class extends me{read(){return this.element.value===""?null:this.element.value}},Ni=class extends me{},us=class extends me{static writesDefault=!1;read(){return this.element.checked}write(e){let t=!!e;this.element.checked!==t&&(this.element.checked=t)}same(e,t){return e===!!t}attach(){let e=this.node;if(e.getAttr("checked")!=null&&e.pointerType(e.getAttr("value"))==="^")throw new TypeError(`${e.nodeTag} '${e.label}': checked and a ^ value are two sources`);super.attach()}},Ci=class extends us{#e=null;#t=!1;get groups(){return this.binding.runtime.renderer.radioGroups}attach(){let e=this.node,t=this.resolved.group??null,n=Tl(e);if(t!=null){if(e.getAttr("name")!=null)throw new TypeError(`${e.nodeTag} '${e.label}': name and group are two names`);this.#r(t,n)}super.attach(),t!=null&&(this.#e=this.groups.join(this,t,n),this.element.setAttribute("name",this.#e))}detach(){this.#e!==null&&(this.groups.leave(this),this.element.removeAttribute("name"),this.#e=null),super.detach()}refresh(){if(this.#e===null)return;let e=this.resolved.group,t=Tl(this.node);this.groups.nameOf(e,t)!==this.#e&&(this.#r(e,t),this.groups.leave(this),this.#e=this.groups.join(this,e,t),this.element.setAttribute("name",this.#e))}#r(e,t){let n=this.node;if(Dl(n,"value")&&this.groups.peersOf(e,t).some(s=>!s.binding.closed&&s.read()))throw new Error(`${n.nodeTag} '${n.label}': several true values in radio group '${e}'`)}project(e,t){let n=!this.#t;this.#t=!0;let s=this.read();super.project(e,t),!n&&!s&&this.read()&&this.turnOffPeers()}commit(e){let t=this.read();super.commit(e),t&&!this.binding.closed&&this.turnOffPeers()}turnOffPeers(){if(this.#e!==null)for(let e of this.groups.peers(this)){if(this.binding.closed)return;e.binding.closed||(e.element.checked&&(e.element.checked=!1),Dl(e.node,"value")&&e.commit(null))}}},cs=class{#e;#t=new Map;#r=new Map;#s=new WeakMap;#n=0;constructor(e){this.#e=e}join(e,t,n){let s=this.nameOf(t,n);return this.#t.has(s)||this.#t.set(s,new Set),this.#t.get(s).add(e),this.#r.set(e,s),s}leave(e){let t=this.#r.get(e);this.#r.delete(e);let n=this.#t.get(t);n?.delete(e),n?.size===0&&this.#t.delete(t)}peers(e){let t=this.#r.get(e);return[...this.#t.get(t)??[]].filter(n=>n!==e)}peersOf(e,t){return[...this.#t.get(this.nameOf(e,t))??[]]}nameOf(e,t){t!==null&&!this.#s.has(t)&&this.#s.set(t,this.#n++);let n=t===null?"page":`form${this.#s.get(t)}`;return`gramlot-${this.#e.instanceId}-${n}-${e}`}};function Tl(r){for(let e=r;e;e=e.parentNode){let t=e.getAttr()??{};if(t.formId!=null||t.form===!0)return e}return null}var xl={text:He,password:He,email:He,url:He,tel:He,search:He,number:xi,range:Si,color:Ni,date:Rt,time:Rt,month:Rt,week:Rt,"datetime-local":Rt,checkbox:us,radio:Ci,hidden:null,file:null,button:null,submit:null,reset:null,image:null};var Oi=Symbol("source text"),Sl={xmlns:"http://www.w3.org/2000/xmlns/",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"},Vp=new Set(["allowFullscreen","async","autofocus","autoplay","checked","controls","default","defer","disabled","formNoValidate","hidden","inert","isMap","itemscope","loop","multiple","muted","noModule","noValidate","open","playsInline","readOnly","required","reversed","selected"]),Hp=new Set(["checked","muted","selected","value"]),zp=new Map([["allowfullscreen","allowFullscreen"],["formnovalidate","formNoValidate"],["ismap","isMap"],["nomodule","noModule"],["novalidate","noValidate"],["playsinline","playsInline"],["readonly","readOnly"]]);function Gp(r){let e=r.replace(/-([a-z])/g,(t,n)=>n.toUpperCase());return zp.get(e.toLowerCase())??e}var ds=class{constructor({metadataAttributes:e=[]}={}){this.metadataAttributes=new Set([...Tt,"_text",...e])}definition(e){let t=e.builder,s={...t.schema[t.schemaTag(e.nodeTag)]._meta,...e.getAttr("_meta")},i=Wr(e.nodeTag,{renderTag:s.render_tag,ns:e.getAttr("ns"),dialectName:t.constructor._name}),a=i==="foreignObject"?Kr:s.render_attributes?.xmlns??e.getAttr("xmlns")??(t instanceof ht?Kr:Ee);return{meta:s,namespace:a,tag:i}}validate(e,t=e.builder){let n=e.value instanceof D,s=n?e.getAttr("_text"):e.value;if(s!=null&&!["string","number","boolean"].includes(typeof s))throw new TypeError("HTML text must be scalar");for(let[o,u]of Object.entries(e.attr))if(!this.metadataAttributes.has(o)&&u!=null&&!["string","number","boolean"].includes(typeof u))throw new TypeError(`HTML attribute ${o} must be scalar`);let i=Object.fromEntries(Object.entries(e.attr).filter(([o])=>!this.metadataAttributes.has(o))),a=n?e.value.getNodes().map(o=>o.nodeTag).filter(Boolean):[];t.validateNode(e,{value:s,attrs:i,childTags:a})}create(e,t,n=null,s=e.attr,i=null){let{tag:a,namespace:o,meta:u}=this.definition(e);n??=a;let l=o===Ee?t.createElement(n):t.createElementNS(o,n),c=t.createTextNode(this.text(e));(o!==Ee||!u.void)&&l.append(c);let d={element:l,text:c,tag:n};return this.update(d,e,s,Oi,i),d}matches(e,t){let{tag:n,namespace:s}=this.definition(t);return(s===Ee?e.tag.toLowerCase()===n.toLowerCase():e.tag===n)&&e.element.namespaceURI===s}compose(e,t,n){e.text.data=t??"";for(let s of n)e.element.append(s)}update(e,t,n=t.attr,s=Oi,i=null){let{element:a,text:o}=e,u=a.namespaceURI===Ee,l=this.definition(t).meta.render_attributes??{},c=e.attrs??{};n=Object.fromEntries(ye({...n,...l}));let d=me.classFor(a,n)!==null;s===Oi&&(s=this.text(t));let f=s==null?"":String(s);o.data!==f&&(o.data=f);let p=[...new Set([...Object.keys(c),...Object.keys(n)])];p.sort((h,m)=>(m==="sandbox")-(h==="sandbox"));for(let h of p){if(this.metadataAttributes.has(h)||d&&h==="value")continue;let m=n[h],g=h,b=Gp(g),v=u&&Vp.has(b)&&typeof a[b]=="boolean",w=g==="xmlns"?"xmlns":g.includes(":")?g.split(":")[0]:"",k=Object.hasOwn(Sl,w)?Sl[w]:null;if(Object.is(c[h],m)||(m==null||v&&!m?k?a.removeAttributeNS(k,g.split(":").at(-1)):a.removeAttribute(g):k?a.setAttributeNS(k,g,String(m)):a.setAttribute(g,v?"":String(m))),u&&(v||Hp.has(b))&&b in a){let I=b==="value"?m==null?"":String(m):!!m;a[b]!==I&&(a[b]=I)}}i===!1?a.style.visibility!=="hidden"&&(a.style.visibility="hidden"):e.visible===!1&&(n.style==null?a.removeAttribute("style"):a.setAttribute("style",String(n.style))),e.visible=i,e.attrs=n}text(e){return e.value instanceof D?e.getAttr("_text")==null?"":String(e.attr._text):e.value==null?"":String(e.value)}};var fs=class r{#e;#t;static for(e,t){let n=t.element;return n?.namespaceURI!==Ee||n.localName!=="button"?null:new r(e,t)}constructor(e,t){this.#e=e,this.#t=t}get binding(){return this.#e}get node(){return this.binding.node}get element(){return this.#t.element}get controllers(){let e=this.node.value;return e?.getNodes?e.getNodes().filter(t=>t.nodeTag==="dataController"||t.nodeTag==="dataRpc"):[]}get mechanism(){let e=this.node,t=this.controllers;if(t.length>1)throw new Error(`${e.nodeTag} '${e.label}': several dataController or dataRpc children; a button has one click mechanism`);let n=e.getAttr()??{},s=[];if(t.length&&s.push("controller"),n.action!=null&&s.push("action"),Nl(n).length&&s.push("fire"),s.length>1)throw new Error(`${e.nodeTag} '${e.label}': ${s.join(" and ")} together; a button has one click mechanism`);return s[0]??null}attach(){this.refresh(),this.element.addEventListener("click",this)}refresh(){this.mechanism&&this.node.getAttr("type")==null&&this.element.getAttribute("type")!=="button"&&this.element.setAttribute("type","button")}detach(){this.element.removeEventListener("click",this)}handleEvent(e){this.onClick(e)}onClick(e){if(this.binding.closed)return;let t=this.mechanism;if(!t||(e.stopPropagation(),this.element.disabled))return;let n=this.binding.countClick(),s=this.node,i=Wp(e);if(t==="controller")this.binding.runtime.bindingFor(this.controllers[0])?.providers[0]?.invoke({kind:"click",event:e,counter:n});else if(t==="action"){let[,a]=s.builder.runtimeValues(s),o={...a,event:e,_counter:n,modifiers:i};this.binding.runtime.inlineCompiler.compile(s,"action",s.getAttr("action"),Object.keys(o))(o)}else{let a={modifier:i,_counter:n},o=s.getAttr("fire");if(o!=null){s.FIRE(o,i||!0,a);return}for(let[u,l]of Nl(s.getAttr())){if(this.binding.closed)return;s.FIRE(l,u.slice(5),a)}}}};function Nl(r){return Object.entries(r??{}).filter(([e,t])=>t!=null&&(e==="fire"||e.startsWith("fire_")))}function Wp(r){return["shift","ctrl","alt","meta"].filter(e=>r[`${e}Key`]).map(e=>e[0].toUpperCase()+e.slice(1)).join("")}var ps="connect_on",Xp=/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)+$/,nn=class{#e;#t;#r;#s;#n;static declared(e){return Object.entries(e.getAttr()??{}).filter(([t,n])=>t.startsWith(ps)&&t.length>ps.length&&n!=null).map(([t,n])=>[t,t.slice(ps.length).toLowerCase(),n])}constructor(e,t,n,s,i=`${ps}${n}`){this.#e=e,this.#t=t,this.#r=n,this.#s=s,this.#n=i}get binding(){return this.#e}get node(){return this.binding.node}get element(){return this.#t.element}get eventName(){return this.#r}get handler(){return this.#s}get attribute(){return this.#n}attach(){this.element.addEventListener(this.eventName,this)}detach(){this.element.removeEventListener(this.eventName,this)}handleEvent(e){if(this.binding.closed)return;let t=this.node,n=this.binding.runtime;if(Xp.test(this.handler)){let{group:s,method:i}=n.logicRegistry.resolve(this.handler,t);i.call(s,t,e);return}n.inlineCompiler.compile(t,this.attribute,this.handler,["event"])({event:e})}};var sn=class{constructor(e=null){this.entries=new Map,this.sourceRoot=e}validate(e,t=new Set){let n=new Map,s=i=>{for(let a of i.getNodes()){let o=a.getAttr("__ref");if(o){if(n.has(o))throw new Error("Duplicate Source reference");let u=this.entries.get(o);if(e!==this.sourceRoot&&u&&u.node!==a&&!t.has(u.node))throw new Error("Duplicate Source reference");n.set(o,a)}a.value instanceof D&&s(a.value)}};s(e)}register(e,t){let n=e.getAttr("__ref");if(n){if(this.entries.has(n))throw new Error(`Duplicate Source reference: ${n}`);this.entries.set(n,{node:e,dom:t})}}remove(e){for(let[t,n]of this.entries)n.node===e&&this.entries.delete(t)}resolve(e){if(!e||!["node","dom"].includes(e.kind))throw new TypeError("Expected a node or DOM reference");let t=this.entries.get(e.$gramlotRef);if(!t)throw new Error("Source reference is not mounted");return t[e.kind]}};var Yp="_root_",hs=class{constructor(e=null,t=null){this.parent=e,this.segment=t,this.children=new Map,this.registrations=new Set}},Bi=class{#e;#t;#r;#s;#n;#i=!0;constructor(e,{path:t,attr:n,recipient:s,order:i}){this.#e=e,this.#t=t,this.#r=n,this.#s=s,this.#n=i}get router(){return this.#e}get path(){return this.#t}get attr(){return this.#r}get recipient(){return this.#s}get active(){return this.#i}get order(){return this.#n}close(){this.active&&(this.#i=!1,this.router.unregister(this))}},Ii=class{constructor({evt:e,node:t,path:n,oldvalue:s,attrsDiff:i,reason:a,fired:o,level:u,registration:l}){this.evt=e,this.node=t,this.path=n,this.oldvalue=s,this.attrsDiff=i,this.reason=a,this.fired=o,this.level=u,this.registration=l}},ms=class{#e;#t=new hs;#r=new Map;#s=0;#n=0;constructor(e){this.#e=e}get runtime(){return this.#e}get size(){return this.#s}register({path:e,attr:t=null,recipient:n}){if(typeof e!="string"||e==="")throw new TypeError(`A Data registration requires a path: ${e}`);let s=this.#t;for(let a of e.split(".")){let o=s.children.get(a);o||(o=new hs(s,a),s.children.set(a,o)),s=o}this.#n+=1;let i=new Bi(this,{path:e,attr:t,recipient:n,order:this.#n});return s.registrations.add(i),this.#r.set(i,s),this.#s+=1,i}unregister(e){let t=this.#r.get(e);if(t)for(this.#r.delete(e),t.registrations.delete(e),this.#s-=1;t.parent&&!t.children.size&&!t.registrations.size;)t.parent.children.delete(t.segment),t=t.parent}deliver(e){let{pathlist:t}=e;if(!t?.length||t[0]!==Yp||e.reason==="autocreate")return;let n=t.slice(1),s=e.evt==="ins"||e.evt==="del";for(let i of Array.isArray(e.node)?e.node:[e.node]){let a=s?[...n,i.label]:n,o=a.join(".");for(let[u,l]of this.#i(a,e))u.active&&u.recipient.receive(new Ii({evt:e.evt,node:i,path:o,oldvalue:e.oldvalue??null,attrsDiff:e.attrs_diff??null,reason:e.reason??null,fired:e.fired??!1,level:l,registration:u}))}}#i(e,t){let n=[],s=this.#t;for(let a of e){for(let o of s.registrations)s!==this.#t&&this.#a(o,"child",t)&&n.push([o,"child"]);if(s=s.children.get(a),!s)return n.sort(([o],[u])=>o.order-u.order)}for(let a of s.registrations)this.#a(a,"node",t)&&n.push([a,"node"]);let i=[...s.children.values()];for(;i.length;){let a=i.pop();for(let o of a.registrations)this.#a(o,"container",t)&&n.push([o,"container"]);i.push(...a.children.values())}return n.sort(([a],[o])=>a.order-o.order)}#a(e,t,n){let{evt:s}=n;return e.attr===null?s==="upd_attrs"?!1:!(t==="child"&&n.fired):t==="child"?!1:t==="container"?s!=="upd_attrs":s==="ins"||s==="del"?!0:Object.hasOwn(n.attrs_diff??{},e.attr)}};var gs=class{#e;constructor(e){this.#e=e}get runtime(){return this.#e}install(e){let t=an(e),n=this.setterNodes(e);Ri(e);for(let s of n){let i=this.runtime.openBinding(s);i.hasStamp("installed")||(this.applySetter(s),i.stamp("installed"))}this.applyDefaults(t.filter(s=>s.nodeTag&&!s._getMeta("data_element")))}setterNodes(e){return an(e).filter(t=>t.nodeTag==="dataSetter")}applySetter(e){let t=e.absDatapath(e.pathAttribute("destination_path"));if(t===null)return;let n=e.getAttr("value")??null,s=Jp(e.getAttr()),i=this.runtime.data;if(n!==null)i.setItem(t,n,s,">",!1,!0,e),n instanceof P&&e.setAttr({value:null},!1);else{let a=i.getNode(t);a?s&&a.setAttr(s,!0):i.setItem(t,null,s,">",!1,!0,e)}}applyDefaults(e){for(let t of e){let n=t.getAttr();for(let[s,i]of Object.entries(n)){if(!Zp(t,s,i))continue;let a=s==="value"?n.default_value??n.default:n[`default_${s}`];a!=null&&this.#t(t,i,a)}this.#r(t,n)}}#t(e,t,n){let s=e.absDatapath(t);if(s===null)return;let[i,a=null]=s.split("?",2),o=this.runtime.data,u=o.getNode(i);if(a===null){if(u&&u.value!==null&&u.value!==void 0)return;o.setItem(i,n,null,">",!1,!0,e)}else if(u){let l=u.getAttr(a);l==null&&u.setAttr({[a]:n},!0)}else o.setItem(i,null,{[a]:n},">",!1,!0,e)}#r(e,t){let n={};for(let[a,o]of Object.entries(t))a.startsWith("attr_")&&(n[a.slice(5)]=e.pointerType(o)?e.getRelativeData(o):o);if(!Object.keys(n).length)return;let s=[t.value,t.src].find(a=>e.pointerType(a));if(!s)return;let i=e.absDatapath(s);i!==null&&this.runtime.data.getNode(i.split("?",1)[0])?.setAttr(n,!0,!0,!1)}};function Zp(r,e,t){return e==="_meta"||Tt.has(e)||e==="default"||e.startsWith("default_")||e.startsWith("attr_")||e.endsWith("_path")?!1:r.pointerType(t)!==null}function Jp(r){let e={};for(let[t,n]of Object.entries(mt(r??{})))Tt.has(t)||t.startsWith("_")||t==="destination_path"||t==="value"||n!=null&&(e[t]=n);return Object.keys(e).length?e:null}function Kp(r){let e=r.builder;if(!(e instanceof Qe))throw new Error(`dataSetter '${r.label}': dataSetter is not supported inside ${e.constructor._name}`)}function Ri(r){for(let e of an(r))e.nodeTag==="dataSetter"&&Kp(e),nh(e)}var Qp=["_init","_onStart","_onBuilt","_delay","_timing","_userChanges"],eh=new Set(["dataFormula","dataController","dataRpc"]),th=["_onCalling","_onResult","_onError"],rh=["_init","_onBuilt","_onStart"];function nh(r){let e=n=>r.getAttr(n)!==null&&r.getAttr(n)!==void 0;if(r.nodeTag!=="dataRpc"){let n=th.find(e);if(n)throw new Error(`${r.nodeTag??"fragment"} '${r.label}': '${n}' is allowed only on dataRpc`)}if(eh.has(r.nodeTag)){let n=Object.entries(r.getAttr()).find(([,s])=>Se(s));if(n)throw new Error(`${r.nodeTag} '${r.label}': '${n[0]}' is a == expression, not accepted on ${r.nodeTag}`);for(let s of rh){let i=r.getAttr(s);if(!(i==null||typeof i=="boolean"||typeof i=="number"))throw new Error(`${r.nodeTag} '${r.label}': '${s}' accepts true, false, null or a number, not ${JSON.stringify(i)}`)}return}let t=Qp.find(e);if(t)throw new Error(`${r.nodeTag??"fragment"} '${r.label}': '${t}' is allowed only on dataFormula, dataController and dataRpc`)}function an(r){if(r instanceof D)return r.getNodes().flatMap(t=>an(t));let e=[r];return r.value instanceof D&&e.push(...an(r.value)),e}var sh=new Set(["destination_path","result_path","func","formula","script","if","else","_init","_onStart","_onBuilt","_delay","_timing","_userChanges","method","timeout","_onCalling","_onResult","_onError"]),on=class{#e;#t=[];#r=null;#s=null;#n=null;#i=null;constructor(e){this.#e=e,e.track(()=>{this.cancel(),this.#c()})}get binding(){return this.#e}get node(){return this.binding.node}get kind(){throw new Error("Provider.kind is defined by FormulaProvider, ControllerProvider and RpcProvider")}register(){let e=this.node,t=e.getAttr("_onStart");if(typeof t=="number"&&!(Number.isFinite(t)&&t>=0))throw new Error(`${e.nodeTag} '${e.label}': _onStart must be true or a delay in ms not below 0: ${t}`);this.#c();let n=this.binding.runtime.router;for(let[s,i]of e.pointers()){if(s==="datapath")continue;let a=e.absDatapath(i);if(a===null)continue;let[o,u=null]=a.split("?",2),l=n.register({path:o,attr:u,recipient:this});this.#t.push(l),s==="_timing"&&(this.#r=l)}this.#a()}receive(e){if(e.registration===this.#r){this.#a();return}if(this.#l("_userChanges")&&e.level!=="node")return;let t={kind:"data",change:e},n=this.#l("_delay");n>0?this.#u(t,n):this.invoke(t)}invoke(e){if(this.binding.closed)return;let t=this.node,n=this.kind==="formula",s=this.kind==="rpc",i=this.readArguments(e),[a,o]=[n?"formula":"script",t.getAttr(n?"formula":"script")],u=t.getAttr("_if");if(u&&!this.#o("_if",u,`return (${u})`,i,!1)){if([a,o]=["_else",t.getAttr("_else")],!o)return;if(s){this.#o(a,o,o,i,!0);return}}if(s)return this.#f(i);let l=t.getAttr("func"),c;if(o)c=this.#o(a,o,n?`return ${o}`:o,i,!0);else if(l==null){if(!n)return;c=new P(Mi(i))}else{let{group:d,method:f}=this.binding.runtime.logicRegistry.resolve(l,t);c=n?f.call(d,i):f.call(d,t,i)}n&&t.setRelativeData(t.pathAttribute("result_path"),c)}readArguments(e){let t=this.node,[,n]=t.builder.runtimeValues(t),s={};for(let[o,u]of Object.entries(n))sh.has(o)||(s[o]=u);let i=e.change??null,a=i?i.level:e.kind;return s._node=i?i.node:null,s._triggerpars={kw:i,trigger_reason:a},s._reason=a,e.kind==="click"&&Object.assign(s,ih(e)),s}cancel(){this.#n?.(),this.#s?.()}#a(){this.#s?.();let e=this.#l("_timing");if(!(e>0))return;let t=setInterval(()=>this.invoke({kind:"timing",change:null}),e*1e3),n=this.binding.track(()=>clearInterval(t));this.#s=()=>{clearInterval(t),n(),this.#s=null}}#u(e,t){this.#n?.();let n=null,s=setTimeout(()=>{n(),this.#n=null,this.invoke(e)},t);n=this.binding.track(()=>clearTimeout(s)),this.#n=()=>{clearTimeout(s),n(),this.#n=null}}#l(e){let t=this.node,n=t.getAttr(e);return t.pointerType(n)?t.getRelativeData(n):n??null}#o(e,t,n,s,i){let a=[...i?["_kwargs"]:[],...Cl,...Ol,...Object.keys(Mi(s))];return this.binding.runtime.inlineCompiler.compile(this.node,e,t,a,n)({...s,_kwargs:s})}async#f(e){let t=this.node,[n,s,i]=["_onCalling","_onResult","_onError"].map(h=>t.getAttr(h));n&&this.#o("_onCalling",n,n,e,!0),this.#i?.abort();let a=new AbortController;this.#i=a;let o=this.binding.track(()=>a.abort()),u=this.#l("timeout"),l=u>0?setTimeout(()=>{let h=new Error(`${t.nodeTag} '${t.label}': no answer within ${u} ms`);h.name="TimeoutError",a.abort(h)},u):null,c=new Promise((h,m)=>{a.signal.addEventListener("abort",()=>m(a.signal.reason),{once:!0})}),d;try{let h=this.binding.runtime.gramlot.rpc.call("data",this.#l("method"),Mi(e),{signal:a.signal});d={result:await Promise.race([h,c])}}catch(h){d={error:h}}clearTimeout(l),o();let f=this.#i===a&&!this.binding.closed;if(this.#i===a&&(this.#i=null),!f)return;if("error"in d){if(!i)throw d.error;this.#o("_onError",i,i,{...e,error:d.error},!0);return}let{result:p}=d;t.getAttr("result_path")!=null&&t.setRelativeData(t.pathAttribute("result_path"),p),s&&this.#o("_onResult",s,s,{...e,result:p},!0)}#c(){for(let e of this.#t.splice(0))e.close();this.#r=null}},_s=class extends on{get kind(){return"formula"}},bs=class extends on{get kind(){return"controller"}},ws=class extends on{get kind(){return"rpc"}},Cl=["_node","_triggerpars","_reason"],Ol=["_evt","button_counter","button_shift","button_ctrl","button_alt","button_meta"];function Mi(r){let e={...r};for(let t of[...Cl,...Ol])delete e[t];return e}function ih({event:r,counter:e}){return{_evt:r,button_counter:e,button_shift:!!r.shiftKey,button_ctrl:!!r.ctrlKey,button_alt:!!r.altKey,button_meta:!!r.metaKey}}var ah=[[null,/(\W|^)GET (?:\s*)(\^?[\w.#@$?-]+)/g,"$1this.GET('$2')"],[/;SET/g,/(\W|^)SET (?:\s*)(\^?[\w.#@$?-]+)(?:\s*)=(?:\s*)([^;\r\n]*)(;?)/gm,"$1this.SET('$2', $3)$4 "],[/;PUT/g,/(\W|^)PUT (?:\s*)(\^?[\w.#@$?-]+)(?:\s*)=(?:\s*)([^;\r\n]*)(;?)/gm,"$1this.PUT('$2', $3)$4 "],[/;FIRE_AFTER/g,/(\W|^)FIRE_AFTER (?:\s*)(\^?[\w.#@$?-]+)(?:\s*)=(?:\s*)([^;\r\n]*)(;?)/g,"$1this.FIRE_AFTER('$2', $3)$4 "],[/;FIRE_AFTER/g,/(\W|^)FIRE_AFTER (?:\s*)(\^?[\w.#@$?-]+)(?:\s*)(;?)/g,"$1this.FIRE_AFTER('$2')$3 "],[/;FIRE/g,/(\W|^)FIRE (?:\s*)(\^?[\w.#@$?-]+)(?:\s*)=(?:\s*)([^;\r\n]*)(;?)/g,"$1this.FIRE('$2', $3)$4 "],[/;FIRE/g,/(\W|^)FIRE (?:\s*)(\^?[\w.#@$?-]+)(?:\s*)(;?)/g,"$1this.FIRE('$2')$3 "]],oh=/(\W|^)PUBLISH (?:\s*)(\^?[\w.#@$?-]+)/,lh=new Set(["arguments","await","break","case","catch","class","const","continue","debugger","default","delete","do","else","enum","eval","export","extends","false","finally","for","function","if","implements","import","in","instanceof","interface","let","new","null","package","private","protected","public","return","static","super","switch","this","throw","true","try","typeof","var","void","while","with","yield"]),ys=class{#e;#t=new Map;constructor(e){this.#e=e}get runtime(){return this.#e}get size(){return[...this.#t.values()].reduce((e,t)=>e+t.size,0)}preprocess(e,t,n){let s=n.trim();if(oh.test(s))throw new Error(`${ln(e,t)}: the PUBLISH macro is excluded from Gramlot 0.2.0`);let i=s.replace(/\$(\d+)/g,(a,o)=>`arguments[${parseInt(o,10)-1}]`);for(let[a,o,u]of ah)a&&(i=i.replace(a,`; ${a.source.slice(1)}`)),i=i.replace(o,u);return i!==s&&console.warn(`${ln(e,t)}: legacy macros are deprecated; write this.GET(path), this.SET(path, value), this.PUT(path, value), this.FIRE(path, value), this.FIRE_AFTER(path, value) and arguments[n] in place of GET, SET, PUT, FIRE, FIRE_AFTER and $n`),i}compile(e,t,n,s,i=n){if(e.activatedCode(t)!==n)throw new Error(`${ln(e,t)}: inline code runs only as received with the Source (main or a remote Source); a text written later is not run: use named logic`);let a=this.#t.get(e);a||(a=new Map,this.#t.set(e,a),this.runtime.bindingFor(e).track(()=>this.release(e)));let o=a.get(t);o?.source!==i&&(o={source:i,text:this.preprocess(e,t,i),key:null,run:null},a.set(t,o));let u=s.filter(Bl),l=u.join(",");if(o.key!==l){let c=uh(e,t,o.text,u);o.key=l,o.run=d=>c.apply(e,u.map(f=>d[f]))}return o.run}compileExpression(e,t,n){let s=n.slice(2),i=ye(e.getAttr()).filter(([,o])=>!Se(o)),a=this.compile(e,t,n,i.map(([o])=>o),`return ${s}`);return o=>{let u={};for(let[l,c]of i)if(Object.hasOwn(o,l))u[l]=o[l];else if(lr(c).length){if(Bl(l)&&new RegExp(`(?<![\\w$])${l.replaceAll("$","\\$")}(?![\\w$])`).test(s))throw new Error(`${e.nodeTag} '${e.label}': '${t}' uses '${l}', a template consumed by another template, whose value is not available; write a dataFormula`)}else u[l]=e.pointerType(c)?e.getRelativeData(c):c;return a(u)}}release(e,t=null){if(t===null){this.#t.delete(e);return}let n=this.#t.get(e);if(n)for(let s of t){n.delete(s);for(let[i]of ye({[s]:null}))n.delete(i)}}};function Bl(r){return/^[A-Za-z_$][\w$]*$/.test(r)&&!lh.has(r)}function ln(r,e){return`${r.nodeTag} '${r.label}' ${e?`'${e}'`:"node value"}`}function uh(r,e,t,n){try{return t.startsWith("function")?new Function(`return (${t}
19
+ ${" ".repeat(s)}</${a}>`:`<${a}${l}>${f}</${a}>`:t===null||t.includes(a)?`<${a}${l}/>`:`<${a}${l}></${a}>`}if(u==null||u==="")return t===null||t.includes(a)?`<${a}${l}/>`:`<${a}${l}></${a}>`;let c=u instanceof Date&&!Number.isNaN(u.getTime())?op(u):String(u),d=this._escapeXml(c);return`<${a}${l}>${d}</${a}>`}_sanitizeTag(e){return e?e.replace(/[^a-zA-Z0-9_\-.:]/g,"_"):"_none_"}_escapeXml(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}_escapeAttr(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}static fromXml(e,t={}){let{tagAttribute:n=null}=t,s;if(typeof DOMParser<"u"){s=new DOMParser().parseFromString(e,"application/xml");let a=s.querySelector("parsererror");if(a)throw new Error(`XML parse error: ${a.textContent}`)}else s=new Ko.DOMParser().parseFromString(e,"application/xml");return this._xmlElementToBag(s.documentElement,n)}static _xmlElementToBag(e,t=null){let n=new this,s=Array.from(e.childNodes).filter(i=>i.nodeType===1);for(let i of s){let a=i.tagName,o={};for(let m=0;m<i.attributes.length;m++){let g=i.attributes[m];o[g.name]=g.value}let l=Gr(o._resolver);l&&delete o._resolver;let u=String(o._T||"").toUpperCase()==="BAG";Object.assign(o,is(o));let c=a;"_tag"in o&&(c=o._tag,delete o._tag),t&&t in o&&(c=o[t],delete o[t]);let d=c,f=1;for(;n.getNode(c);)c=`${d}_${f++}`;let p=Array.from(i.childNodes).filter(m=>m.nodeType===1),h;if(p.length>0||u){let m=this._xmlElementToBag(i,t);h=n.setItem(c,m,Object.keys(o).length>0?o:null)}else{let m=i.textContent||"";h=n.setItem(c,m,Object.keys(o).length>0?o:null)}l&&(h.resolver=l),h.xmlTag=a}return n}static async fromUrl(e,t={}){let{timeout:n=30}=t,s={};n&&(s.signal=AbortSignal.timeout(n*1e3));let i=await fetch(e,s),a=i.headers.get("content-type")||"",o=await i.text();if(a.includes("json"))return r.fromJson(o);if(a.includes("xml"))return r.fromXml(o);let l=o.trim();if(l.startsWith("<"))return r.fromXml(o);if(l.startsWith("{")||l.startsWith("["))return r.fromJson(o);throw new Wr(`Unsupported content-type: ${a}`)}toJson(e=!0){let t=[];for(let n of this._nodes)t.push(this._nodeToJsonDict(n,e));return e?le(t):JSON.stringify(t)}_nodeToJsonDict(e,t){let n=e.resolver?null:e.getValue(!0);if(n&&typeof n._nodeToJsonDict=="function"){let i=[];for(let a of n._nodes)i.push(n._nodeToJsonDict(a,t));n=i}let s={label:e.label,value:n,attr:ss(e.attr)};return e.nodeTag!==null&&(s.tag=e.nodeTag),e.resolver&&(s.resolver=zr(e.resolver)),s}static fromJson(e,t=null){return typeof e=="string"&&(e=H(e)),!Array.isArray(e)&&typeof e!="object"&&(e={value:e}),r._fromJsonRecursive(e,t)}static _fromJsonRecursive(e,t=null){if(e instanceof r)return e;if(Array.isArray(e)){if(t!==null&&e.every(s=>typeof s=="string"))return e.join(t);if(e.length===0)return new r;if(typeof e[0]=="object"&&e[0]!==null&&"label"in e[0]){let s=new r;for(let i of e){let a=i.label,o=r._fromJsonRecursive(i.value,t),l=is(i.attr),u=s.setItem(a,o,l);u.nodeTag=i.tag??null;let c=Gr(i.resolver);c&&(u.resolver=c)}return s}let n=new r;for(let s=0;s<e.length;s++)n.setItem(`r_${s}`,r._fromJsonRecursive(e[s],t));return n}if(typeof e=="object"&&e!==null){if(Object.keys(e).length===0)return new r;let n=new r;for(let[s,i]of Object.entries(e))n.setItem(s,r._fromJsonRecursive(i,t));return n}return e}toStringTree(e=!0,t=null,n="",s=!0){t===null&&(t=new Map);let i=[],a=[...this._nodes];for(let o=0;o<a.length;o++){let l=a[o],u=o===a.length-1,c=l.getValue(e),d=l.getAttr(),f="",p=Object.keys(d);p.length>0&&(f=" ["+p.map(b=>`${b}=${JSON.stringify(d[b])}`).join(", ")+"]");let h=u?"\u2514\u2500\u2500 ":"\u251C\u2500\u2500 ",m=n+(u?" ":"\u2502 ");if(c instanceof r){let g=l,b=c.backref?"(*)":"";if(t.has(g))i.push(`${n}${h}${l.label}${b}${f} \u2192 (circular ref)`);else{t.set(g,l.label),i.push(`${n}${h}${l.label}${b}${f}`);let v=c.toStringTree(e,t,m,u);v&&i.push(v)}}else{let g;if(c===null)g="null";else if(c===void 0)g="undefined";else if(c instanceof ArrayBuffer||c instanceof Uint8Array){let b=new TextDecoder("utf-8",{fatal:!1}),v=c instanceof ArrayBuffer?new Uint8Array(c):c;g=b.decode(v)}else typeof c=="string"?c.length>50?g=JSON.stringify(c.slice(0,47)+"..."):g=JSON.stringify(c):g=String(c);i.push(`${n}${h}${l.label}: ${g}${f}`)}}return i.join(`
20
+ `)}toString(e=!0,t=null,n=""){t||(t=new Set);let s=[],i=[...this._nodes];for(let a=0;a<i.length;a++){let o=i[a],l=a===i.length-1,u=o.getValue(e),c="",d=o.attr;d&&Object.keys(d).length>0&&(c=` [${Object.entries(d).map(([m,g])=>`${m}=${JSON.stringify(g)}`).join(", ")}]`);let f=l?"\u2514\u2500\u2500 ":"\u251C\u2500\u2500 ",p=n+(l?" ":"\u2502 ");if(u&&typeof u._htraverse=="function"){let h=o;if(t.has(h))s.push(`${n}${f}${o.label}${c} \u2192 (circular ref)`);else{t.add(h),s.push(`${n}${f}${o.label}${c}`);let m=u.toString(e,t,p);m&&s.push(m)}}else{let h;u==null?h="null":typeof u=="string"&&u.length>50?h=JSON.stringify(u.slice(0,47)+"..."):typeof u=="string"?h=JSON.stringify(u):h=String(u),s.push(`${n}${f}${o.label}: ${h}${c}`)}}return s.join(`
21
+ `)}},Wr=class extends Error{constructor(e){super(e),this.name="BagException"}};X.registerBagClass(P);Ei(P);At(P.tytxSuffix,{...xe(P.tytxSuffix),Bag:P});var el=new Set(["False","None","True","and","as","assert","async","await","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","nonlocal","not","or","pass","raise","return","try","while","with","yield"]);function tl(r){return r.endsWith("_")&&el.has(r.slice(0,-1))?r.slice(0,-1):r}function rl(r){let e=tl(r);return e!==r?e:r.startsWith("_")&&el.has(r.slice(1))?r.slice(1):r}function Xr(r,{renderTag:e=null,ns:t=null,dialectName:n=null}={}){let s=e||r;if(!s)return s;if(s=tl(s),t&&!e){let i=`${n}_`;s.startsWith(i)&&(s=s.slice(i.length)),s=`${t}:${s}`}return s}var Tt=Symbol("value"),Dt=new Set(["_meta","datapath","node_id","ns","form","formId","_anchor","updateOn"]);function ye(r){return Object.entries(r||{}).filter(([e])=>!Dt.has(e)).map(([e,t])=>[rl(e),t])}var Ve=class extends Oe{constructor(e,t,n=null,s=null,i=null,a=null,o=null){super(e,t,n,s,i,a,o),this._builder=e?._insertingBuilder??e?._builder??null,this._targetId=null}get builder(){if(this._builder)return this._builder;let e=this.parentBag;return e?e._builder:null}get data(){return this.builder.data}get rootBuilder(){return this.parentBag.root._builder}_getMeta(e){let t=this.getAttr("_meta")||{},n=e.split(",").map(s=>s.trim());return n.length===1?t[n[0]]!==void 0?t[n[0]]:null:n.map(s=>t[s]!==void 0?t[s]:null)}pointerType(e){return typeof e=="string"&&(e[0]==="^"||e[0]==="=")?e[0]:null}pointers(){let e=[];for(let[t,n]of Object.entries(this.getAttr()||{}))this.pointerType(n)==="^"&&e.push([t,n]);return this.pointerType(this.value)==="^"&&e.push(["",this.value]),e}fixedAttrItems(){return ye(this.getAttr())}runtimeToEvaluate(){let e=new Map(this.fixedAttrItems());return e.set(Tt,this.value),e}absDatapath(e){let t=e;this.pointerType(e)&&(e=e.slice(1));let n=null;return e.includes("?")&&([e,n]=e.split("?",2)),e.startsWith("#")?this._resolveSymbolicDatapath(e,t):(e.startsWith(".")&&(e=this._composeRelativeDatapath(e,t)),this._finalizeAbsPath(e,n))}_finalizeAbsPath(e,t){return e=this._collapseParentDatapath(e,e),t?`${e}?${t}`:e}_composeRelativeDatapath(e,t){let n=this;for(;n!==null&&e.startsWith(".");){let s=n.getAttr("datapath");s!=null&&(e=e==="."?s:s+e),n=n.parentNode}if(e.startsWith("."))throw new Error(`unresolved relative datapath: ${t}`);return e}_collapseParentDatapath(e,t){let n=[];for(let s of e.split("."))if(s==="#parent"){if(n.length===0)throw new Error(`#parent has no segment to cancel: ${t}`);n.pop()}else n.push(s);return n.join(".")}_resolveSymbolicDatapath(e,t){let n=e.slice(1),s=n.indexOf("."),i=s===-1?n:n.slice(0,s),a=s===-1?"":n.slice(s+1),o;if(i==="FORM")o=this._findMarkedDatapathAncestor(!0,!1,t);else if(i==="ANCHOR")o=this._findMarkedDatapathAncestor(!1,!0,t);else{let l=this.rootBuilder;if(!l)throw new Error(`#<id>: cannot resolve ${t} on a node without builder`);if(o=l.source.getNodeByAttr("node_id",i),o==null)throw new Error(`#<id>: cannot resolve ${t}`)}return o.absDatapath(a?`.${a}`:".")}_findMarkedDatapathAncestor(e,t,n){let s=this;for(;s!=null;){let a=s.getAttr()||{};if(e&&(a.formId!=null||a.form===!0)||t&&"_anchor"in a)return s;s=s.parentNode}let i=e?"FORM":"ANCHOR";throw new Error(`#${i}: no marked ancestor found for ${n}`)}getRelativeData(e,t=null,{autocreate:n=!1}={}){let s=this.data,i=this.absDatapath(e);return n&&s.getItem(i)==null&&s.setItem(i,t),s.getItem(i,t)}setRelativeData(e,t,{attributes:n=null,fired:s=!1,reason:i=null}={}){let a=this.data,o=this.absDatapath(e);a.setItem(o,t,n,">",!1,!0,i===null?!0:i,s)}fireEvent(e,t=!0,{attributes:n=null,reason:s=null}={}){this.setRelativeData(e,t,{attributes:n,fired:!0,reason:s})}SET(e,t){this.setRelativeData(e,t)}GET(e){return this.getRelativeData(e)}PUT(e,t){this.setRelativeData(e,t,{reason:!1})}FIRE(e,t=!0){this.setRelativeData(e,t,{fired:!0})}},T=class r extends P{constructor(e=null,t=null){super(e),this._builder=t,this._insertingBuilder=null}get nodeClass(){return Ve}_setBuilderItem(e,t,n,...s){let i=t?.map(([o])=>[o,o._builder])||null;if(t)for(let[o,l]of t)o._builder=l;let a=this._insertingBuilder;this._insertingBuilder=e;try{return this.setItem(n,...s)}catch(o){if(this.node(n)==null&&i)for(let[l,u]of i)l._builder=u;throw o}finally{this._insertingBuilder=a}}bindBuilder(e){if(!e)throw new Error("SourceBag.bindBuilder requires a builder");let t=this._builderBindingPlan(e);for(let[n,s]of t)n._builder=s;return this.setBackref(),this}_builderBindingPlan(e){let t=[],n=new WeakSet,s=(i,a)=>{if(n.has(i))throw new Error("source contains a cyclic or shared SourceBag branch");n.add(i),t.push([i,a]);for(let o of i.getNodes()){let l=a,u=o._getMeta("subbuilder");u!=null&&(l=a._resolveSubbuilderReference(u,o.getAttr()||{},o.nodeTag)),t.push([o,l]);let c=o.getValue(!0);c instanceof r&&s(c,l)}};return s(this,e),t}};if((xe(T.tytxSuffix).SourceBag??T)!==T)throw new Error("TYTX subtype name 'SourceBag' is already registered for another class");At(T.tytxSuffix,{...xe(T.tytxSuffix),SourceBag:T});function dp(r){if(r.length===0)return{value:null,attrs:{}};let e=r[0];if(e!==null&&typeof e=="object"){let t=Object.getPrototypeOf(e);if(t===Object.prototype||t===null)return{value:null,attrs:e}}return{value:e,attrs:r[1]||{}}}var fp=new Set(["then","toJSON"]),sl=new WeakMap;function Ie(r){return sl.get(r)||r}function Yr(r){if(r==null)return r;r=Ie(r);let e=r._builder||r.parentBag&&r.parentBag._builder;return e?e.wrapSource(r):r}function il(r,e){let t=e instanceof P,n=new Proxy(e,{get(s,i){if(typeof i=="symbol"||i.startsWith("_")||fp.has(i))return Reflect.get(s,i,s);let a=r.schemaTag(i);if(t&&a)return nl(r,s,a,t);if(i in s){let l=Reflect.get(s,i,s);return typeof l=="function"?l.bind(s):l}if(a)return nl(r,s,a,t);let o=r.containerMethod(i);if(o)return(...l)=>r[o](r.wrapSource(s),...l)}});return sl.set(n,e),n}function nl(r,e,t,n){return(...s)=>{let{value:i,attrs:a}=dp(s),o=n?r.bagCall(e,t,i,a):r.commandOnNode(e,t,i,a);return o.builder.wrapSource(o)}}function Di(r,e,{transport:t="json"}={}){let n=H(r,t==="json"?null:t);if(!(n instanceof T))throw new TypeError("TYTX payload did not decode to SourceBag");return n.bindBuilder(e)}var ol=/^[A-Za-z_][A-Za-z0-9_]*$/,pp=new Set(["positional_only","positional_or_keyword","keyword_only","var_positional","var_keyword"]),hp=new Set(["framework","value","attribute"]),mp=new Map([["builtins.str",r=>typeof r=="string"],["builtins.int",r=>Number.isInteger(r)],["builtins.float",r=>typeof r=="number"&&Number.isFinite(r)],["builtins.bool",r=>typeof r=="boolean"],["builtins.list",r=>Array.isArray(r)],["builtins.dict",r=>r!==null&&typeof r=="object"&&!Array.isArray(r)],["builtins.tuple",r=>Array.isArray(r)],["builtins.set",r=>Array.isArray(r)||r instanceof Set],["builtins.NoneType",r=>r===null],["builtins.object",r=>!0]]);function Zr(r){return r!==null&&typeof r=="object"&&!Array.isArray(r)}function D(r,e){throw new TypeError(`${r}: ${e}`)}function xt(r,e,t,n){Zr(r)||D(n,"must be an object");for(let s of Object.keys(r))e.includes(s)||D(n,`unknown field '${s}'`);for(let s of t)Object.hasOwn(r,s)||D(n,`missing field '${s}'`)}function ar(r,e){if(!(r===null||typeof r=="string"||typeof r=="boolean")&&!(typeof r=="number"&&Number.isFinite(r))){if(Array.isArray(r))return r.forEach((t,n)=>ar(t,`${e}[${n}]`));if(Zr(r))return Object.entries(r).forEach(([t,n])=>ar(n,`${e}.${t}`));D(e,"must be lossless JSON data")}}function ir(r,e,t=!1){if(r===null)return null;switch(xt(r,["kind","module","name","origin","arguments","items","values","base","metadata","pattern","flags","ge","le","gt","lt","value"],["kind"],e),r.kind){case"any":return{...r,test:n=>!0};case"type":{(typeof r.module!="string"||typeof r.name!="string")&&D(e,"type requires string module/name");let n=`${r.module}.${r.name}`;if(n==="collections.abc.Callable")return{...r,test:i=>typeof i=="function",portable:!1};let s=mp.get(n);return s||D(e,`unsupported type '${n}'`),{...r,test:s}}case"union":{(!Array.isArray(r.items)||!r.items.length)&&D(e,"union items must be non-empty");let n=r.items.map((s,i)=>ir(s,`${e}.items[${i}]`,!0));return{...r,items:n,test:s=>n.some(i=>i.test&&i.test(s))}}case"literal":return Array.isArray(r.values)||D(e,"literal values must be an array"),r.values.forEach((n,s)=>ar(n,`${e}.values[${s}]`)),{...r,test:n=>r.values.some(s=>Object.is(s,n))};case"annotated":{Array.isArray(r.metadata)||D(e,"annotated metadata must be an array");let n=ir(r.base,`${e}.base`,!0),s=r.metadata.map((i,a)=>ir(i,`${e}.metadata[${a}]`,!0));return{...r,base:n,metadata:s,test:i=>n.test(i)&&s.every(a=>!a.test||a.test(i))}}case"range":{for(let n of["ge","le","gt","lt"])Object.hasOwn(r,n)||D(e,`range missing '${n}'`);for(let n of["ge","le","gt","lt"])r[n]!==null&&(typeof r[n]!="number"||!Number.isFinite(r[n]))&&D(e,`${n} must be finite number or null`);return{...r,test:n=>typeof n=="number"&&(r.ge===null||n>=r.ge)&&(r.le===null||n<=r.le)&&(r.gt===null||n>r.gt)&&(r.lt===null||n<r.lt)}}case"regex":{(typeof r.pattern!="string"||!Number.isInteger(r.flags)||r.flags<0)&&D(e,"regex requires pattern and non-negative integer flags");let n=r.flags&-59;n&&D(e,`unsupported Python regex flags ${n}`),r.flags&2&&D(e,"IGNORECASE is not portable across Python and JavaScript Unicode rules"),/\\[AZwWdDsS]|\(\?P[<=!]|\(\?\(|\(\?>/.test(r.pattern)&&D(e,"regex uses a non-portable construct or character class");let s="uy";r.flags&8&&(s+="m"),r.flags&16&&(s+="s");let i;try{i=new RegExp(`(?:${r.pattern})(?![\\s\\S])`,s)}catch(a){D(e,`invalid portable regex: ${a.message}`)}return{...r,test:a=>typeof a!="string"?!1:(i.lastIndex=0,i.test(a))}}case"value":return ar(r.value,`${e}.value`),{...r};case"generic":{let n=ir(r.origin,`${e}.origin`,!0);(r.origin?.kind!=="type"||r.origin.module!=="builtins"||!["list","dict","tuple","set"].includes(r.origin.name))&&D(e,"only list, dict, tuple and set generic origins are supported"),Array.isArray(r.arguments)||D(e,"generic arguments must be an array");let s=r.arguments.map((i,a)=>ir(i,`${e}.arguments[${a}]`,!0));return{...r,origin:n,arguments:s,test:i=>n.test(i)&&gp(r.origin,s,i)}}case"arguments":D(e,"Callable argument-list descriptors are not supported by Python validation");case"ellipsis":return t||D(e,"ellipsis is only valid as a nested descriptor"),{...r};default:D(e,`unknown annotation kind '${r.kind}'`)}}function gp(r,e,t){let n=`${r.module}.${r.name}`;return n==="builtins.tuple"&&e.length&&e[1]?.kind!=="ellipsis"?t.length===e.length&&t.every((s,i)=>e[i].test(s)):n==="builtins.list"||n==="builtins.set"||n==="builtins.tuple"?[...t].every(s=>!e[0]?.test||e[0].test(s)):n==="builtins.dict"?Object.entries(t).every(([s,i])=>(!e[0]?.test||e[0].test(s))&&(!e[1]?.test||e[1].test(i))):!1}function ll(r,e){if(r===null)return null;if(typeof r!="string"&&D(e,"must be string or null"),r==="")return new Map;let t=new Map;for(let n of r.split(",")){let s=n.trim();/^[A-Za-z_][A-Za-z0-9_]*\[\]$/.test(s)&&D(e,`invalid cardinality item '${n}'`);let i=s.match(/^([A-Za-z_][A-Za-z0-9_]*|\*)(?:\[(?:(\d+)|(?:(\d*):(\d*)))\])?$/);i||D(e,`invalid cardinality item '${n}'`);let[,a,o,l,u]=i;t.has(a)&&D(e,`duplicate tag '${a}'`);let c=0,d=1/0;s.includes("[")&&(s.includes(":")?(c=l?Number(l):0,d=u?Number(u):1/0):c=d=Number(o)),d<c&&D(e,`maximum ${d} is below minimum ${c}`),t.set(a,{min:c,max:d})}return t.has("*")&&t.size>1&&D(e,"wildcard '*' cannot be combined with named tags"),t}function ul(r,e){if(r===null)return null;typeof r!="string"&&D(e,"must be string or null");let t=new Set;for(let n of r.split(",")){let s=n.trim();s&&((!ol.test(s)||t.has(s))&&D(e,`invalid or duplicate parent '${n}'`),t.add(s))}return t}function _p(r,e){if(r===null)return null;xt(r,["parameters","accepts_var_keyword","accepts_var_positional"],[],e);let t=r.parameters??[];Array.isArray(t)||D(e,"parameters must be an array"),r={parameters:t,accepts_var_keyword:t.some(o=>o.kind==="var_keyword"),accepts_var_positional:t.some(o=>o.kind==="var_positional"),...r},(!Array.isArray(r.parameters)||typeof r.accepts_var_keyword!="boolean"||typeof r.accepts_var_positional!="boolean")&&D(e,"invalid signature descriptor");let n=new Set,s=!1,i=!1,a=r.parameters.map((o,l)=>{let u=`${e}.parameters[${l}]`;return xt(o,["name","kind","role","annotation","has_default","default"],["name","kind","role","annotation","has_default"],u),(typeof o.name!="string"||!ol.test(o.name)||n.has(o.name))&&D(u,"invalid or duplicate parameter name"),n.add(o.name),(!pp.has(o.kind)||!hp.has(o.role)||typeof o.has_default!="boolean")&&D(u,"invalid kind, role, or has_default"),o.has_default!==Object.hasOwn(o,"default")&&D(u,"default presence must equal has_default"),o.has_default&&ar(o.default,`${u}.default`),s||=o.kind==="var_keyword",i||=o.kind==="var_positional",{...o,annotation:ir(o.annotation,`${u}.annotation`)}});return(s!==r.accepts_var_keyword||i!==r.accepts_var_positional)&&D(e,"variadic summary flags do not match parameters"),{...r,parameters:a}}function al(r,e,t){let n=["doc","sub_tags","parent_tags","inherits_from","ns","attributes",...t?["node_label","collection_key"]:[],"_meta"];xt(r,n,[],e),r={...Object.fromEntries(n.map(s=>[s,null])),...r};for(let s of["doc","inherits_from","ns",...t?["node_label","collection_key"]:[]])r[s]!==null&&typeof r[s]!="string"&&D(e,`${s} must be string or null`);return r._meta!==null&&(Zr(r._meta)||D(e,"_meta must be object or null"),ar(r._meta,`${e}._meta`)),ll(r.sub_tags,`${e}.sub_tags`),ul(r.parent_tags,`${e}.parent_tags`),{...r,attributes:_p(r.attributes,`${e}.attributes`)}}function cl(r){return r?r.split(",").map(e=>e.trim()).filter(Boolean):[]}function dl(r,e){let t={...e};for(let[n,s]of Object.entries(r))n==="inherits_from"||n.startsWith("_")||t[n]||(t[n]=s);return t._meta={...r._meta||{},...e._meta||{}},t}function fl(r){let e={...r};return e._subSpec=Object.hasOwn(e,"sub_tags")?ll(e.sub_tags,"resolved.sub_tags"):null,e._parentSpec=Object.hasOwn(e,"parent_tags")?ul(e.parent_tags,"resolved.parent_tags"):null,e}function pl(r,e,t,n){if(t.get(r)===1&&D(n,`inheritance cycle at '${r}'`),t.get(r)===2)return e[r];let s=e[r];s||D(n,`unknown abstract '${r}'`),t.set(r,1);let i={...s};for(let a of cl(s.inherits_from))i=dl(pl(a,e,t,n),i);return i=fl(i),t.set(r,2),e[r]=i,i}function xi({abstracts:r={},elements:e={}}){let t={...r},n=new Map;for(let i of Object.keys(t))pl(i,t,n,`abstracts.${i}.inherits_from`);let s={};for(let[i,a]of Object.entries(e)){let o={...a};for(let l of cl(a.inherits_from)){let u=t[l];u||D(`elements.${i}.inherits_from`,`unknown abstract '${l}'`),o=dl(u,o)}s[i]=fl(o)}return{abstracts:t,elements:s}}function Si(r){xt(r,["document_format","grammar","abstracts","elements"],["document_format","grammar","abstracts","elements"],"grammar document"),xt(r.document_format,["name","version"],["name","version"],"document_format"),(r.document_format.name!=="builder_grammar"||r.document_format.version!=="1.1")&&D("document_format","expected builder_grammar version 1.1"),xt(r.grammar,["name","version","title","description"],["name","version","title","description"],"grammar"),(typeof r.grammar.name!="string"||!r.grammar.name)&&D("grammar.name","must be non-empty string");for(let n of["version","title","description"])r.grammar[n]!==null&&typeof r.grammar[n]!="string"&&D(`grammar.${n}`,"must be string or null");(!Zr(r.abstracts)||!Zr(r.elements))&&D("grammar document","abstracts/elements must be objects");let e={};for(let[n,s]of Object.entries(r.abstracts))(!n||n.startsWith("_"))&&D("abstracts",`invalid public name '${n}'`),e[n]=al(s,`abstracts.${n}`,!1);let t={};for(let[n,s]of Object.entries(r.elements))(!n||n.startsWith("_"))&&D("elements",`invalid public name '${n}'`),t[n]=al(s,`elements.${n}`,!0);return{grammar:structuredClone(r.grammar),abstracts:e,elements:t}}function hl(r,e,t,n){let s=e.attributes;if(!s)return;let i={...n};t!=null&&(i.node_value=t);let a=new Set(s.parameters.filter(u=>u.role==="attribute").map(u=>u.name)),o=new Set(["node_label","node_position","node_id","target_id","datapath","iterate","store","_tag","_meta","ns"]);if(!s.accepts_var_keyword)for(let u of Object.keys(n))!a.has(u)&&!o.has(u)&&D(r,`unknown attribute '${u}'`);let l=e._meta?.component?s.parameters.find(u=>u.role!=="framework"&&["positional_only","positional_or_keyword"].includes(u.kind))?.name:null;for(let u of s.parameters){if(u.name===l||u.role==="framework"||u.kind.startsWith("var_"))continue;let c=Object.hasOwn(i,u.name);!c&&!u.has_default&&D(r,`missing required ${u.role} '${u.name}'`),c&&u.annotation!==null&&(!u.annotation.test||!u.annotation.test(i[u.name]))&&D(r,`invalid value for ${u.role} '${u.name}'`)}}function ml(r,e,t=[]){if(e===null)return structuredClone(r);if(t.length===2&&["abstracts","elements"].includes(t[0]))return structuredClone(e);if(or(r)&&or(e)){let n=structuredClone(r);for(let[s,i]of Object.entries(e))i!==null&&Object.defineProperty(n,s,{value:ml(n[s],i,[...t,s]),enumerable:!0,writable:!0,configurable:!0});return n}return structuredClone(e)}function or(r){return r!==null&&typeof r=="object"&&!Array.isArray(r)&&Object.getPrototypeOf(r)===Object.prototype}function Ni(r){if(!(r===null||typeof r=="string"||typeof r=="boolean")&&!(typeof r=="number"&&Number.isFinite(r))){if(Array.isArray(r)){r.forEach(Ni);return}if(or(r)){Object.values(r).forEach(Ni);return}throw new TypeError("collection must contain only finite JSON values")}}var Ke=class r{#e;constructor(e){Ni(e);let t=["document_format","grammar","abstracts","elements"];if(!or(e)||Object.keys(e).length!==t.length||t.some(s=>!Object.hasOwn(e,s)))throw new TypeError("collection requires document_format, grammar, abstracts and elements");let n=e.document_format;if(!or(n)||Object.keys(n).length!==2||n.name!=="builder_grammar"||n.version!=="1.1")throw new TypeError("expected builder_grammar version 1.1");for(let s of["grammar","abstracts","elements"])if(!or(e[s]))throw new TypeError(`${s} must be an object`);this.#e=structuredClone(e)}update(e){let t=new r(e);return this.#e=ml(this.#e,t.#e),this}toDocument(){return structuredClone(this.#e)}};var St=class{static renderType="string";static mode=null;constructor(e){this._builder=e,this.renders=new Map([[e,this]])}get builder(){return this._builder}get renderType(){return this.constructor.renderType}get mode(){return this.constructor.mode}addRender(e,t){this.renders.set(e,t)}getRender(e){let t=this.renders.get(e);if(t!==void 0)return t;let n=e.getRenderer();return this.renders.set(e,n),n}render(e,t={}){let n=e.builder,[s,i]=n.runtimeValues(e);if(e._getMeta("data_element"))return null;if(e._getMeta("component"))return this._renderComponent(e,i,t);let a=this.getRender(n),o;return[o,i]=a._handleMeta(e,i),e._getMeta("subbuilder")||(i=a.adaptAttrs(i)),e.value instanceof T&&(s=this.renderChildren(e.value,t)),a.renderedItem(e,s,i,{tag:o,...t})}renderChildren(e,t={}){let n=[];for(let s of e.getNodes()){let i=this.render(s,t);i!==null&&(Array.isArray(i)?n.push(...i):n.push(i))}return n}_renderComponent(e,t,n){let[s,i,a,o]=this._expansionInputs(e,t);if(!Object.hasOwn(e.getAttr(),"iterate"))return this._expandBlock(e,s,a,o,n);if(i==null)return[];if(!(i instanceof P))throw new TypeError(`component '${e.nodeTag}': iterate must resolve to a Bag, got ${i?.constructor?.name||typeof i}`);return i.getNodes().map(l=>this._expandBlock(e,s,a,{node_label:l.label},n))}_expansionInputs(e,t){let n=e.builder,s=n.componentMethod(e.nodeTag),i=s&&n[s];if(typeof i!="function")throw new Error(`component '${e.nodeTag}' has no implementation`);let a=t.iterate;delete t.iterate,delete t.store;let o=e.getAttr("iterate")||e.getAttr("store");o!=null?(e.pointerType(o)&&(o=o.slice(1)),o.startsWith(".")&&(o=e._composeRelativeDatapath(o,o))):o=null;for(let l of Object.keys(t)){let u=e.getAttr(l);e.pointerType(u)==="^"&&(t[l]=`^${e.absDatapath(u)}`)}return[i,a,o,t]}_expandBlock(e,t,n,s,i){let a=e.builder._expansionRoot(n);t.call(e.builder,Yr(a),s);let o=a.getNodes();if(o.length!==1)throw new Error(`component '${e.nodeTag}' must build a tree, not a forest: ${o.length} root nodes`);let l={...i,depthOffset:this._nodeDepth(e,i.depthOffset||0)};return this.render(o[0],l)}preprocess(e){return e}renderedItem(e,t,n,s){throw new Error(`${this.constructor.name} does not implement renderedItem`)}_handleMeta(e,t){let[n,s]=e._getMeta("render_tag,render_attributes"),i=Xr(e.nodeTag,{renderTag:n,ns:e.getAttr("ns"),dialectName:e.builder?.constructor._name});if(!i)throw new Error(`node ${e.label} has no tag to render (no render_tag, no node_tag)`);return s&&(t={...t,...s}),[i,t]}adaptAttrs(e){return e}adapt(e){let t=`${this.builder.constructor._name}_`;return e.startsWith(t)?e.slice(t.length):e}finalize(e,t=null,n={}){let s=this._composeStringFragments(e);if(t==null)return s;if(typeof t=="string")throw new TypeError("string render targets require filesystem support, which is unavailable in the portable renderer; pass a callable or writable target instead");if(typeof t.full=="function"&&typeof t.write!="function")return t.full(s),null;if(typeof t.write=="function")return t.write(s),null;if(typeof t=="function")return t(s),null;throw new TypeError("render target must be writable (.write), callable, or expose .full")}_composeStringFragments(e){if(!Array.isArray(e))return e;if(e.some(t=>typeof t!="string"))throw new TypeError("String composition requires string fragments; object renderers must define their own composition");return e.join("")}_escapeText(e){return String(e).replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;")}_escapeAttr(e){return this._escapeText(e).replaceAll('"',"&quot;")}_nodeDepth(e,t=0){let s=((e.fullpath||"").match(/\./g)||[]).length;return Math.max(s-1,0)+t}};var Nt=class extends St{static mode="xml";renderedItem(e,t,n,{tag:s,pretty:i=!1,depthOffset:a=0}={}){let o=this._formatAttrs(n),l=i?" ".repeat(this._nodeDepth(e,a)):"",u=i?`
22
+ `:"";if(Array.isArray(t)){let c=this._composeStringFragments(t);return`${l}<${s}${o}>${u}${c}${l}</${s}>${u}`}return t==null?`${l}<${s}${o}></${s}>${u}`:`${l}<${s}${o}>${this._escapeText(t)}</${s}>${u}`}finalize(e,t=null,{docHeader:n=null}={}){let s=this._composeStringFragments(e);return n===!0?s=`<?xml version='1.0' encoding='UTF-8'?>${s}`:typeof n=="string"&&(s=n+s),super.finalize(s,t)}_formatAttrs(e){return Object.entries(e||{}).map(([t,n])=>` ${t.startsWith("xmlns_")?`xmlns:${t.slice(6)}`:t}="${this._escapeAttr(n)}"`).join("")}};var gl={document_format:{name:"builder_grammar",version:"1.1"},grammar:{name:"base",version:null,title:null,description:null},abstracts:{},elements:{dataSetter:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"destination",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"type",module:"builtins",name:"str"},has_default:!1},{name:"value",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"any"},has_default:!1},{name:"attr",kind:"var_keyword",role:"attribute",annotation:{kind:"any"},has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{data_element:!0}},dataFormula:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"destination",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"type",module:"builtins",name:"str"},has_default:!1},{name:"func",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"union",items:[{kind:"type",module:"builtins",name:"str"},{kind:"type",module:"collections.abc",name:"Callable"}]},has_default:!1},{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{data_element:!0}},dataController:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"func",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"union",items:[{kind:"type",module:"builtins",name:"str"},{kind:"type",module:"collections.abc",name:"Callable"}]},has_default:!1},{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{data_element:!0}}}};function _l(r){let e=[];for(;r&&r!==Function.prototype;)e.push(r),r=Object.getPrototypeOf(r);return e.reverse()}function wp(r){let e=Object.create(null),t=(n,s)=>{let i=n.toLowerCase(),a=e[i];if(a!==void 0&&a!==s)throw new Error(`container '${n}' is already tied to implementation method '${a}' (cannot rebind to '${s}')`);e[i]=s};for(let n of _l(r))if(Object.hasOwn(n,"containers"))for(let s of n.containers||[])t(s,s);return e}function Jr(r){let e=Object.create(null);for(let t of Object.keys(r)){let n=t.toLowerCase();if(Object.hasOwn(e,n))throw new Error(`element declaration '${t}' has a case-insensitive collision with '${e[n]}'`);e[n]=t}return e}var Kr="_root_",Ci="_root_",bl=new Set(["destination","func","value","_on_start"]),he=class r{static _sourceClass=T;static registerBuilder(e){if(typeof e!="function"||!(e.prototype instanceof r))throw new TypeError("registerBuilder requires a BuilderBase subclass");let t=e._name;if(typeof t!="string"||!t)throw new TypeError("registered builders require a non-empty static _name");let n=r._registry.get(t);if(n&&n!==e)throw new Error(`Builder name '${t}' is already registered to ${n.name}; cannot register ${e.name}`);return r._registry.set(t,e),e}static getBuilderClass(e){let t=r._registry.get(e);if(!t)throw new Error(`No builder registered with name '${e}'`);return t}constructor(e=null){this.name=e||this.constructor._name,this._dataroot=new P,this._dataroot.setBackref(),this._dataroot.setItem(Ci,new P),this.data=this._dataroot.getItem(Ci),this._defaultTargets=new Map,this.materialized=Object.create(null),this._collection=null,this._schemaOverride=null,this._tagNamesOverride=null,this._componentMap=null,this._targetSerial=0,this._subbuilders=new Map,this._sourceHandles=new WeakMap;let t=this.constructor._sourceClass;this._sourceroot=new t(null,this),this._sourceroot.setBackref(),this._sourceroot.setItem(Kr,new t(null,this)),this.source=this._sourceroot.getItem(Kr)}wrapSource(e){if(e=Ie(e),!(e instanceof T)&&!(e instanceof Ve))throw new TypeError("wrapSource requires a SourceBag or SourceBagNode");let t=this._sourceHandles.get(e);return t||(t=il(this,e),this._sourceHandles.set(e,t)),t}get root(){return this.wrapSource(this.source)}getSubbuilder(e){if(typeof e!="string"||!e||e.includes(":"))throw new Error(`unsupported subbuilder reference '${e}'`);let t=this._subbuilders.get(e);if(!t){let n=r.getBuilderClass(e);t=new n,this._subbuilders.set(e,t)}return t._dataroot=this._dataroot,t.data=this.data,t}_resolveSubbuilderReference(e,t,n){if(typeof e!="string"||!e)throw new Error(`'${n}': subbuilder declaration must be a non-empty string`);if(e.includes(":"))throw new Error(`'${n}': runtime subbuilder reference '${e}' is unsupported`);return this.getSubbuilder(e)}static defineGrammar(e){let t=this._classCollection,n=t?new Ke(t.toDocument()).update(e):new Ke(e),s=Si(n.toDocument()),i=xi(s),a=Jr(i.elements);this._classCollection=n,this._classSchema=i.elements,this._abstracts=i.abstracts,this._tagNames=a}static{this.defineGrammar(gl)}get _containers(){return wp(this.constructor)}containerMethod(e){return this._containers[e.toLowerCase()]||null}componentMethod(e){return this._componentMap?.[e.toLowerCase()]||null}get schema(){return this._schemaOverride||this.constructor._classSchema||{}}get schemaTagNames(){return this._schemaOverride?this._tagNamesOverride??=Jr(this.schema):this.constructor._tagNames??=Jr(this.schema)}schemaTag(e){let t=e.toLowerCase(),n=this.schemaTagNames[t];if(n)return n;let s=`${this.constructor._name}_`;return t.startsWith(s)&&this.schemaTagNames[t.slice(s.length)]||null}loadGrammar(e,{replace:t=!1}={}){let n=this._collection||this.constructor._classCollection,s=t?new Ke(e):new Ke(n.toDocument()).update(e),i=Si(s.toDocument()),a=xi(i),o=Jr(a.elements);return this._collection=s,this._schemaOverride=a.elements,this._tagNamesOverride=o,this}validateNodeValues(e,t,n={}){let s=this.schemaTag(e);if(!s)throw new Error(`unknown element '${e}'`);return hl(s,this.schema[s],t,n),!0}validateNode(e,{value:t,attrs:n,childTags:s}={}){if(!e||typeof e.nodeTag!="string")throw new TypeError("validateNode requires a source node");let i=t!==void 0?t:e.value instanceof T?null:e.value;this.validateNodeValues(e.nodeTag,i,n||e.getAttr?.()||{});let a=this.schema[this.schemaTag(e.nodeTag)],o=s||(e.value instanceof T?e.value.getNodes().map(l=>l.nodeTag):null);return o&&this._validateChildren(e.nodeTag,a,o,!1),!0}validateChildren(e,t,{includeMinimum:n=!1}={}){let s=this.schemaTag(e);if(!s)throw new Error(`unknown element '${e}'`);if(!Array.isArray(t)||t.some(i=>typeof i!="string"))throw new TypeError("childTags must be an array of strings");return this._validateChildren(s,this.schema[s],t,n)}validateParent(e,t=null){let n=this.schemaTag(e);if(!n)throw new Error(`unknown element '${e}'`);let s=this.schema[n];if(!this._countsForGrammar(s))return!0;let i=s._parentSpec;if(i==null||i.has("*"))return!0;if(t===null)throw new Error(`'${n}' requires a declared parent`);let a=this.schemaTag(t);if(!a)throw new Error(`unknown parent element '${t}'`);return this._validateParent(n,s,a),!0}bagCall(e,t,n,s){return this.setChild(e,t,n,s)}commandOnNode(e,t,n,s){if(e=Ie(e),e.value instanceof T)return this.setChild(e.value,t,n,s);let i=e.value,a=new e.parentBag.constructor(null,e.builder||this),o=this.setChild(a,t,n,s,e);return this.promoteNodeValue(e,i,a),o}promoteNodeValue(e,t,n){e.setValue(n)}setChild(e,t,n,s,i=null){let a={...s},o=this.schema[t];if(!o)throw new Error(`unknown element '${t}'`);this.validateNodeValues(t,n,a);let l=o._meta?.subbuilder,c=(l==null?null:this._resolveSubbuilderReference(l,a,t))||this,d=n instanceof T?n._builderBindingPlan(c):null,f=i?.rootBuilder||e.root._builder||this;if(a.node_id!=null&&f.source.getNodeByAttr("node_id",a.node_id))throw new Error(`Duplicate node_id '${a.node_id}'`);n instanceof T&&this._validateChildren(t,o,n.getNodes().map(w=>w.nodeTag),!1);let p=i||e.parentNode,h=p?.nodeTag?this.schema[p.nodeTag]:null;if(h&&!p._getMeta("subbuilder")&&this._countsForGrammar(o))this._validateParent(t,o,p.nodeTag),this._validateChildren(p.nodeTag,h,[...e.getNodes().map(w=>w.nodeTag),t],!1);else if(!h&&!p?._getMeta("subbuilder")&&o._parentSpec!=null&&this._countsForGrammar(o))throw new Error(`'${t}' requires a declared parent`);o._meta&&!("_meta"in a)&&(a._meta=o._meta),o.ns&&!("ns"in a)&&(a.ns=o.ns);let m=a.node_position;delete a.node_position;let g=a.node_label;delete a.node_label;let b;if(h?.collection_key){if(g!=null)throw new Error(`'${t}': node_label is not allowed in a collection`);b=this._collectionLabel(h.collection_key,t,a)}else{let w=h?._subSpec?.get(t);if(w&&w.max===1){if(g!=null)throw new Error(`'${t}': node_label is not allowed on a singleton`);b=t}else b=g||o.node_label||this._autoLabel(e,t)}if(e.node(b)!=null)throw new Error(`duplicate node label '${b}'`);return e._setBuilderItem(c,d,b,n,a,m||">",!1,!0,null,!1,!0,null,t)}_countsForGrammar(e){let t=e?._meta||{};return!(t.data_element||t.subbuilder||t.component)}_validateParent(e,t,n){let s=t._parentSpec;if(!(s==null||s.has("*")||!this._countsForGrammar(t))&&!s.has(n))throw new Error(`'${e}' not allowed as child of '${n}'`)}_validateChildren(e,t,n,s){let i=t._subSpec;if(i==null||i.has("*")||t._meta?.subbuilder)return[];let a=new Map;for(let o of n){let l=this.schema[o];if(l&&!this._countsForGrammar(l))continue;let u=i.get(o);if(!u)throw new Error(`'${o}' not allowed as child of '${e}'`);let c=(a.get(o)||0)+1;if(a.set(o,c),c>u.max)throw new Error(`too many '${o}' in '${e}'`)}return s?[...i].filter(([o,l])=>(a.get(o)||0)<l.min).map(([o])=>o):[]}_collectionLabel(e,t,n){let s=i=>{if(n[i]===null||n[i]===void 0)throw new Error(`'${t}': collection key needs attribute '${i}'`);return String(n[i])};return e.includes("${")?e.replace(/\$\{([^}]+)\}/g,(i,a)=>s(a)):s(e)}validateSource(){let e=[],t=(n,s="")=>{for(let i of n.getNodes()){let a=s?`${s}.${i.label}`:i.label,o=i.builder,l=o.schema[i.nodeTag];if(l&&!i._getMeta("data_element,subbuilder,component").some(Boolean)){let u=i.value instanceof T?i.value.getNodes().map(d=>d.nodeTag):[],c=o._validateChildren(i.nodeTag,l,u,!0);c.length&&e.push([a,c])}i.value instanceof T&&t(i.value,a)}};return t(this.source),e}_autoLabel(e,t){let n=0;for(;e.node(`${t}_${n}`)!==null&&e.node(`${t}_${n}`)!==void 0;)n+=1;return`${t}_${n}`}nodeById(e){let t=this.source.getNodeByAttr("node_id",e);if(t==null)throw new Error(`node_id not found: ${e}`);return t.builder.wrapSource(t)}runtimeValues(e){let t=new Map,n={},s=e._getMeta("data_element");for(let[o,l]of e.runtimeToEvaluate()){if(l instanceof X){t.set(o,l.resolve());continue}if(!e.pointerType(l)){t.set(o,l);continue}let u=e.absDatapath(l);if(t.set(o,this.data.getItem(u)),!s&&!u.includes("?")&&o===Tt){let c=this.data.getNode(u);c&&Object.assign(n,c.getAttr("_wdg"))}}let i=new Set;for(let[o,l]of t)s||o===Tt||typeof l!="string"||t.set(o,l.replace(/(\\)?\$\{([a-zA-Z_][a-zA-Z0-9_]*)\}/g,(u,c,d)=>{if(c)return u.slice(1);if(!t.has(d))throw new Error(`Unknown template parameter '${d}'`);i.add(d);let f=t.get(d);return f===null?"":String(f)}));let a=t.get(Tt);t.delete(Tt);for(let o of i)t.delete(o);return[a,{...Object.fromEntries(t),...n}]}targetId(e){if(e._targetId)return e._targetId;let t=e.rootBuilder;return e.parentBag.root!==t.source.root?null:(t._targetSerial+=1,e._targetId=`n${t._targetSerial}`,e._targetId)}get dataLogic(){if(!this._dataLogic){let e=this._buildDataLogic();this._dataLogic=Array.isArray(e)?e:[e]}return this._dataLogic}_buildDataLogic(){return this}_resolveLogicFunc(e){if(typeof e=="function")return e;if(typeof e!="string")throw new Error("data-element func must be a name or a function");for(let t of this.dataLogic){let s=(typeof t=="function"?t:t.constructor)[e];if(typeof s=="function")return s}throw new Error(`data-element func '${e}' not found on any data_logic source`)}_bindings(e){let[,t]=this.runtimeValues(e),n={};for(let[s,i]of Object.entries(t))bl.has(s)||(n[s]=i);return n}computeLogic(e){for(let t of e)this._computeNode(t)}_computeNode(e){let t=e.getAttr()||{};if(e.nodeTag==="dataSetter"){let n={};for(let[s,i]of Object.entries(t))s!=="destination"&&s!=="value"&&!s.startsWith("_")&&(n[s]=i);e.setRelativeData(t.destination,t.value,{attributes:Object.keys(n).length?n:null})}else if(e.nodeTag==="dataFormula"){let n=this._resolveLogicFunc(t.func);e.setRelativeData(t.destination,n(this._bindings(e)))}else e.nodeTag==="dataController"&&this._resolveLogicFunc(t.func)(e,this._bindings(e))}_dataElementNodes(){let e=[],t=n=>{for(let s of n.getNodes())s._getMeta("data_element")&&e.push(s),s.value instanceof T&&t(s.value)};return t(this.source),e}setup(e){}main(e){throw new Error(`${this.constructor.name}.main() not implemented: a bare builder is grammar, not a renderable page`)}_resolveComponents(){let e={};for(let o of _l(this.constructor))if(Object.hasOwn(o,"components"))for(let l of o.components||[])e[l]=l;if(!Object.keys(e).length)return;let t={...this.schema},n={};for(let[o,l]of Object.entries(e))t[o]={sub_tags:"",_meta:{component:!0}},n[o.toLowerCase()]=l;let s=Jr(t),i=this._collection||this.constructor._classCollection,a=i.toDocument();a.abstracts={},a.elements=Object.fromEntries(Object.keys(e).map(o=>[o,t[o]])),this._collection=new Ke(i.toDocument()).update(a),this._schemaOverride=t,this._componentMap=n,this._tagNamesOverride=s}_expansionRoot(e=null){let t=this.constructor._sourceClass,n=new t(null,this);return n.setBackref(),n.setItem(Kr,new t(null,this),e?{datapath:e}:null),n.getItem(Kr)}create(){this.setup(this.data),this._resolveComponents(),this.main(this.root),this.computeLogic(this._dataElementNodes())}get renderer_xml(){return new Nt(this)}getRenderer(e=null){e??=this.constructor._defaultRenderMode;let t=this[`renderer_${e}`];if(!t)throw new Error(`${this.constructor.name} does not expose renderer_${e}`);return t}materialize(e=null,t={}){e??=this.constructor._defaultRenderMode;let n=this.getRenderer(e),s=n.renderChildren(n.preprocess(this.source),t);return this.materialized[e]=s,s}setRenderTarget(e,t=null){t??=this.constructor._defaultRenderMode,this._defaultTargets.set(t,e)}render({mode:e=null,target:t=null,...n}={}){e??=this.constructor._defaultRenderMode;let s=this.getRenderer(e);if(t===!1&&s.renderType!=="string")throw new TypeError("target=false is not valid for an object renderer");let i=t===!1?null:t||this._defaultTargets.get(s.mode)||null,a={...i?.renderOpts,...n};return s.finalize(this.materialize(e,a),i,a)}};he._registry=new Map;var yp=new Set(["short","medium","long","full"]),vp=/('(?:[^']|'')*'|[a-zA-Z]+|[^a-zA-Z']+)/g;function Ep(r,e){if(!(r instanceof Date))throw new TypeError("Temporal formats require a typed Date value");if(!Number.isFinite(r.getTime()))throw new RangeError("Invalid date");let t=e||le(r).split("::").at(-1);if(!["D","H","DH","DHZ"].includes(t))throw new RangeError(`Unsupported temporal dtype: ${t}`);return t}function kp(r,e,t,n){let s=e.match(vp)||[];if(s.join("")!==e)throw new RangeError("Unclosed format literal");let i=(c,d=2)=>String(c).padStart(d,"0"),a=c=>new Intl.DateTimeFormat(t,{timeZone:"UTC",...c}).format(r),u={...n==="H"?{}:{y:()=>String(r.getUTCFullYear()),yy:()=>i(r.getUTCFullYear()%100),yyyy:()=>i(r.getUTCFullYear(),4),M:()=>String(r.getUTCMonth()+1),MM:()=>i(r.getUTCMonth()+1),MMM:()=>a({month:"short"}),MMMM:()=>a({month:"long"}),d:()=>String(r.getUTCDate()),dd:()=>i(r.getUTCDate()),EEE:()=>a({weekday:"short"}),EEEE:()=>a({weekday:"long"})},...n==="D"?{}:{H:()=>String(r.getUTCHours()),HH:()=>i(r.getUTCHours()),h:()=>String(r.getUTCHours()%12||12),hh:()=>i(r.getUTCHours()%12||12),m:()=>String(r.getUTCMinutes()),mm:()=>i(r.getUTCMinutes()),s:()=>String(r.getUTCSeconds()),ss:()=>i(r.getUTCSeconds()),a:()=>new Intl.DateTimeFormat(t,{hour:"numeric",hour12:!0,timeZone:"UTC"}).formatToParts(r).find(c=>c.type==="dayPeriod").value}};return s.map(c=>{if(c.startsWith("'"))return c==="''"?"'":c.slice(1,-1).replaceAll("''","'");if(!/^[a-zA-Z]/.test(c))return c;if(!u[c])throw new RangeError(`Unsupported date format token: ${c}`);return u[c]()}).join("")}function wl(r,{format:e,mask:t,locale:n,dtype:s,places:i}={}){let a=r==null?"":String(r);if(r!=null&&r!==""&&(e!=null&&e!==""||i!=null))if(typeof r=="number"||Je(r))a=Tp(r,{format:e,locale:n,places:i});else{let o=Ep(r,s);if(yp.has(e)){let l={timeZone:"UTC"};o!=="H"&&(l.dateStyle=e),o!=="D"&&(l.timeStyle=e),a=new Intl.DateTimeFormat(n||void 0,l).format(r)}else a=kp(r,String(e),n||void 0,o)}return t==null?a:String(t).replaceAll("%s",()=>a)}function Ap({format:r="decimal",places:e}={}){let t={maximumFractionDigits:20};if(!r||r==="decimal")t.style="decimal";else if(r==="percent")t.style="percent";else if(r==="scientific")t.notation="scientific";else{let n=/^(0|#,##0)(?:\.(0*)(#*))?$/.exec(r);if(!n||r.includes(".")&&!n[2]&&!n[3])throw new RangeError(`Unsupported number format: ${r}`);t.useGrouping=n[1].includes(","),t.minimumFractionDigits=(n[2]||"").length,t.maximumFractionDigits=(n[2]||"").length+(n[3]||"").length}if(e!=null&&e!==""){let n=Number(e);if(!Number.isInteger(n)||n<0||n>20)throw new RangeError("places must be an integer from 0 to 20");t.minimumFractionDigits=n,t.maximumFractionDigits=n}return t}function Tp(r,e={}){if(typeof r!="number"&&!Je(r))throw new TypeError("Number formatting requires a Number or Decimal");if(!Number.isFinite(Number(r)))throw new RangeError("Number must be finite");let t=new Intl.NumberFormat(e.locale||void 0,Ap(e));if(Je(r)&&new Intl.NumberFormat("en",{useGrouping:!1}).format("9007199254740993")!=="9007199254740993")throw new Error("This browser cannot format Decimal values without precision loss");return t.format(Je(r)?r.toString():r)}var Dp=new Set(["style","script"]),xp=new Set(["allowfullscreen","async","autofocus","autoplay","checked","controls","default","defer","disabled","formnovalidate","inert","ismap","itemscope","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected"]),yl=new Set(["width","height","top","left","right","bottom","padding","margin","border","position","display","overflow","float","clear","resize","z_index","min_width","min_height","max_width","max_height","color","background","font","text","line_height","white_space","vertical_align","flex","gap","row_gap","column_gap","grid","align_content","justify_content","align_items","justify_items","visibility","opacity","cursor"]),Qr=new Set(["rounded","gradient","shadow","transform","transition","zoom","filter"]),vl=r=>r===!0?"true":r===!1?"false":String(r),as=r=>typeof r=="number"&&Number.isFinite(r)?`${r}px`:String(r);function Sp(r){if(yl.has(r))return!0;for(let e of yl)if(r.startsWith(`${e}_`))return!0;return!1}function Np(r){let e=new Map;if(!r)return e;let t=[],n=0,s=null,i=!1,a=!1,o=0,l=String(r);for(let u=0;u<l.length;u+=1){let c=l[u],d=l[u+1];if(a){c==="*"&&d==="/"&&(a=!1,u+=1);continue}if(i){i=!1;continue}if(c==="\\"){i=!0;continue}if(s){c===s&&(s=null);continue}c==='"'||c==="'"?s=c:c==="/"&&d==="*"?(a=!0,u+=1):"([{".includes(c)?o+=1:")]}".includes(c)&&o>0?o-=1:c===";"&&o===0&&(t.push(l.slice(n,u)),n=u+1)}t.push(l.slice(n));for(let u of t){let c=u.trim();if(!c)continue;let d=c.indexOf(":");if(d<0)throw new TypeError(`malformed style declaration '${c}'`);e.set(c.slice(0,d).trim(),c.slice(d+1).trim())}return e}var Ct=class extends St{static mode="html";renderedItem(e,t,n,{tag:s,xml:i=!0,pretty:a=!1,depthOffset:o=0,includeDatapath:l=!1}={}){e.parentNode?._getMeta("subbuilder")==="html"&&(n={xmlns:"http://www.w3.org/1999/xhtml",...n});let{format:c,mask:d,locale:f,places:p,dtype:h,...m}=n;!Array.isArray(t)&&(c!=null||d!=null||p!=null)&&(t=wl(t,{format:c,mask:d,places:p,dtype:h,locale:this._displayLocale(e,f)}));let g=this._formatAttrs(m);if(l){if(!Object.hasOwn(n,"id")){let k=this.builder.targetId(e);k!==null&&(g+=` id="${this._htmlAttrValue(k)}"`)}for(let[k,I]of Object.entries(e.getAttr()))e.pointerType(I)&&(g+=` data-${this.adapt(k)}-pointer="${this._htmlAttrValue(e.absDatapath(I))}"`)}let b=a?" ".repeat(this._nodeDepth(e,o)):"",v=a?`
23
+ `:"";if(e._getMeta("void"))return`${b}<${s}${g}${i?"/":""}>${v}`;if(Array.isArray(t)){let k=this._composeStringFragments(t);return`${b}<${s}${g}>${v}${k}${b}</${s}>${v}`}if(t==null)return`${b}<${s}${g}></${s}>${v}`;let w=typeof t=="string"&&t.endsWith("::HTML")?t.slice(0,-6):Dp.has(s)?String(t):this._escapeText(t);return`${b}<${s}${g}>${w}</${s}>${v}`}_displayLocale(e,t){if(t)return t;for(let n=e.parentNode;n;n=n.parentNode){let s=n.getAttr("locale");if(s==null)continue;let i=n.pointerType(s)?n.data.getItem(n.absDatapath(s)):s;if(i)return i}}adaptAttrs(e){let t={},n={};for(let[i,a]of Object.entries(e||{}))if(i.startsWith(`${this.builder.constructor._name}_`))t[this.adapt(i)]=a;else if(i==="dtype")t.dtype=a;else{if(this.builder.constructor.retainedAttrPrefixes.some(o=>i.startsWith(o)))continue;this._isStyleContribution(i)?n[i]=a:t[i]=a}let s=this._adaptStyle(n);return s&&(t.style=s),t}_isStyleContribution(e){if(e==="style"||e.startsWith("style_")||Qr.has(e))return!0;let t=e.includes("_")?e.slice(0,e.indexOf("_")):null;return t!==null&&Qr.has(t)||Sp(e)}_adaptStyle(e){let t=Np(e.style),n=new Map,s=new Map;for(let[i,a]of Object.entries(e))if(i!=="style")if(i.startsWith("style_"))t.set(i.slice(6).replaceAll("_","-"),vl(a));else if(Qr.has(i))n.set(i,a);else{let o=i.indexOf("_"),l=o<0?i:i.slice(0,o);o>=0&&Qr.has(l)?(s.has(l)||s.set(l,{}),s.get(l)[i.slice(o+1)]=a):t.set(i.replaceAll("_","-"),vl(a))}for(let i of Qr)(n.has(i)||s.has(i))&&this[`_macro_${i}`](n.get(i),s.get(i)||{},t);return[...t].map(([i,a])=>`${i}: ${a}`).join("; ")}_formatAttrs(e){let t=[];for(let[n,s]of Object.entries(e||{}))xp.has(n)?s&&t.push(` ${n}`):t.push(` ${n}="${this._htmlAttrValue(s)}"`);return t.join("")}_htmlAttrValue(e){return(e===!0?"true":e===!1?"false":String(e)).replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;")}_macro_rounded(e,t,n){let s=e===void 0?{}:{top_left:e,top_right:e,bottom_left:e,bottom_right:e};for(let[i,a]of Object.entries(t))if(i==="top"||i==="bottom")s[`${i}_left`]=a,s[`${i}_right`]=a;else if(i==="left"||i==="right")s[`top_${i}`]=a,s[`bottom_${i}`]=a;else if(["top_left","top_right","bottom_left","bottom_right"].includes(i))s[i]=a;else throw new TypeError(`rounded: unknown sub-kwarg '${i}'`);for(let[i,a]of Object.entries(s))n.set(`border-${i.replaceAll("_","-")}-radius`,as(a))}_macro_transform(e,t,n){let s=e===void 0?[]:[String(e)];for(let[i,a]of Object.entries(t))i==="rotate"?s.push(`rotate(${a}deg)`):i==="scale"||i==="translate"?s.push(`${i}(${a})`):i==="translate_x"?s.push(`translateX(${as(a)})`):i==="translate_y"?s.push(`translateY(${as(a)})`):i==="skew_x"?s.push(`skewX(${a}deg)`):i==="skew_y"?s.push(`skewY(${a}deg)`):s.push(`${i.replaceAll("_","-")}(${a})`);s.length&&n.set("transform",s.join(" "))}_macro_filter(e,t,n){let s=e===void 0?[]:[String(e)];for(let[i,a]of Object.entries(t))i==="rotate"?s.push(`hue-rotate(${a}deg)`):i==="blur"?s.push(`blur(${as(a)})`):i==="drop_shadow"?s.push(`drop-shadow(${a})`):s.push(`${i.replaceAll("_","-")}(${a})`);s.length&&n.set("filter",s.join(" "))}_macro_transition(e,t,n){e!==void 0&&n.set("transition",String(e));for(let[s,i]of Object.entries(t))n.set(`transition-${s.replaceAll("_","-")}`,String(i))}_macro_zoom(e,t,n){e!==void 0&&n.set("zoom",String(e))}_macro_shadow(e,t,n){e!==void 0&&n.set("box-shadow",String(e));for(let[s,i]of Object.entries(t))n.set(`box-shadow-${s.replaceAll("_","-")}`,String(i))}_macro_gradient(e,t,n){e!==void 0&&n.set("background-image",String(e))}};var Cp=new Set(["alignment_baseline","baseline_shift","clip_path","clip_rule","color_interpolation","color_interpolation_filters","dominant_baseline","fill_opacity","fill_rule","flood_color","flood_opacity","font_family","font_size","font_size_adjust","font_stretch","font_style","font_variant","font_weight","glyph_orientation_horizontal","glyph_orientation_vertical","image_rendering","letter_spacing","lighting_color","marker_end","marker_mid","marker_start","overline_position","overline_thickness","paint_order","pointer_events","shape_rendering","stop_color","stop_opacity","strikethrough_position","strikethrough_thickness","stroke_dasharray","stroke_dashoffset","stroke_linecap","stroke_linejoin","stroke_miterlimit","stroke_opacity","stroke_width","text_anchor","text_decoration","text_rendering","underline_position","underline_thickness","unicode_bidi","word_spacing","writing_mode"]);function os(r){return Object.fromEntries(Object.entries(r||{}).map(([e,t])=>[Cp.has(e)?e.replaceAll("_","-"):e,t]))}var Ot=class extends Nt{static mode="svg";adaptAttrs(e){return os(e)}};var El={document_format:{name:"builder_grammar",version:"1.1"},grammar:{name:"html",version:null,title:null,description:null},abstracts:{},elements:{svg:{doc:"Switch to the SVG dialect from this node down (BLD.2).\n\n A sub-builder element: ``_meta['subbuilder']`` switches the active\n dialect to SVG from this node down. No ``render_tag``: ``<svg>`` is\n emitted verbatim (HTML5 has a native ``<svg>`` tag).",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{subbuilder:"svg"}},a:{doc:null,sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},abbr:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},address:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},area:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{void:!0}},article:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},aside:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},audio:{doc:null,sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},b:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},base:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{void:!0}},bdi:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},bdo:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},blockquote:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},body:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},br:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{void:!0}},button:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},canvas:{doc:null,sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},caption:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},cite:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},code:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},col:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{void:!0}},colgroup:{doc:null,sub_tags:"col,script,template",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},data:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},datalist:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,option,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},dd:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},del_:{doc:null,sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},details:{doc:null,sub_tags:"summary[0:1],a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},dfn:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},dialog:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},div:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},dl:{doc:null,sub_tags:"dd,div,dt,script,template",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},dt:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},em:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},embed:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{void:!0}},fieldset:{doc:null,sub_tags:"legend[0:1],a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},figcaption:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},figure:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figcaption[0:1],figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},footer:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},form:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},h1:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},h2:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},h3:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},h4:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},h5:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},h6:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},head:{doc:null,sub_tags:"base[0:1],link,meta,noscript,script,style,template,title[0:1]",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},header:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},hgroup:{doc:null,sub_tags:"h1,h2,h3,h4,h5,h6,p,script,template",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},hr:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{void:!0}},html:{doc:null,sub_tags:"head[0:1],body[0:1]",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},i:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},iframe:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},img:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{void:!0}},input:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{void:!0}},ins:{doc:null,sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},kbd:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},label:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},legend:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,h1,h2,h3,h4,h5,h6,hgroup,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},li:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},link:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{void:!0}},main:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},map:{doc:null,sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},mark:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},menu:{doc:null,sub_tags:"li,script,template",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},meta:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{void:!0}},meter:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},nav:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},noscript:{doc:null,sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},object:{doc:null,sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},ol:{doc:null,sub_tags:"li,script,template",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},optgroup:{doc:null,sub_tags:"div,legend,noscript,option,script,template",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},option:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,div,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},output:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},p:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},picture:{doc:null,sub_tags:"img[0:1],script,source,template",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},pre:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},progress:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},q:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},rp:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},rt:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},ruby:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},s:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},samp:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},script:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},search:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},section:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},select:{doc:null,sub_tags:"button,div,hr,noscript,optgroup,option,script,template",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},slot:{doc:null,sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},small:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},source:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{void:!0}},span:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},strong:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},style:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},sub:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},summary:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,h1,h2,h3,h4,h5,h6,hgroup,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},sup:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},table:{doc:null,sub_tags:"caption[0:1],colgroup,script,tbody,template,tfoot[0:1],thead[0:1],tr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},tbody:{doc:null,sub_tags:"script,template,tr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},td:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},template:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,caption,cite,code,col,colgroup,data,datalist,del_,details,dfn,dialog,div,dl,dt,em,embed,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,legend,li,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,optgroup,option,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,source,span,strong,style,sub,summary,sup,table,tbody,td,template,textarea,tfoot,th,thead,time,tr,track,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},textarea:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},tfoot:{doc:null,sub_tags:"script,template,tr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},th:{doc:null,sub_tags:"a,abbr,address,area,article,aside,audio,b,bdi,bdo,blockquote,br,button,canvas,cite,code,data,datalist,del_,details,dfn,dialog,div,dl,em,embed,fieldset,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,iframe,img,input,ins,kbd,label,link,main,map,mark,menu,meta,meter,nav,noscript,object,ol,output,p,picture,pre,progress,q,ruby,s,samp,script,search,section,select,selectedcontent,slot,small,span,strong,style,sub,sup,table,template,textarea,time,u,ul,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},thead:{doc:null,sub_tags:"script,template,tr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},time:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},title:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},tr:{doc:null,sub_tags:"script,td,template,th",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},track:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{void:!0}},u:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},ul:{doc:null,sub_tags:"li,script,template",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},var:{doc:null,sub_tags:"a,abbr,area,audio,b,bdi,bdo,br,button,canvas,cite,code,data,datalist,del_,dfn,em,embed,i,iframe,img,input,ins,kbd,label,link,map,mark,meta,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,selectedcontent,slot,small,span,strong,sub,sup,template,textarea,time,u,var,video,wbr",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},video:{doc:null,sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},wbr:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{void:!0}},selectedcontent:{doc:"Mirror of the selected option for Customizable Select (HTML 2024).",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},dataSetter:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"destination",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"type",module:"builtins",name:"str"},has_default:!1},{name:"value",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"any"},has_default:!1},{name:"attr",kind:"var_keyword",role:"attribute",annotation:{kind:"any"},has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{data_element:!0}},dataFormula:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"destination",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"type",module:"builtins",name:"str"},has_default:!1},{name:"func",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"union",items:[{kind:"type",module:"builtins",name:"str"},{kind:"type",module:"collections.abc",name:"Callable"}]},has_default:!1},{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{data_element:!0}},dataController:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"func",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"union",items:[{kind:"type",module:"builtins",name:"str"},{kind:"type",module:"collections.abc",name:"Callable"}]},has_default:!1},{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{data_element:!0}}}};var pt=class extends he{static _name="html";static _defaultRenderMode="html";static retainedAttrPrefixes=["validate_","dtype"];static{this.defineGrammar(El)}get renderer_html(){return new Ct(this)}};he.registerBuilder(pt);var kl={document_format:{name:"builder_grammar",version:"1.1"},grammar:{name:"svg",version:null,title:null,description:null},abstracts:{graphics:{doc:"SVG graphics content: any graphical element.",sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},_meta:null},containerElement:{doc:"SVG container content: elements that can hold children.",sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},_meta:null}},elements:{html:{doc:"Switch to the HTML dialect from this node down (BLD.2).\n\n A sub-builder element: ``_meta['subbuilder']`` switches the active\n dialect to HTML from this node down. The source tag ``html`` is\n rendered as ``_meta['render_tag']`` (``<foreignObject>``) carrying\n ``_meta['render_attributes']`` (the SVG namespace). The immediate\n HTML child declares XHTML so both sides of the XML boundary retain\n their native namespace.\n ",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{subbuilder:"html",render_tag:"foreignObject",render_attributes:{xmlns:"http://www.w3.org/2000/svg"}}},svg:{doc:"Root SVG container or nested SVG viewport.",sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},g:{doc:"Group container for applying transforms and styles.",sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},defs:{doc:"Container for referenced elements (gradients, patterns, etc.).",sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},symbol:{doc:"Reusable graphical template, rendered only when referenced by <use>.",sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},use:{doc:"Reference and render a <symbol> or other element.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},rect:{doc:"Rectangle.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},circle:{doc:"Circle.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},ellipse:{doc:"Ellipse.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},line:{doc:"Line segment between two points.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},polyline:{doc:"Open shape of connected line segments.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},polygon:{doc:"Closed shape of connected line segments.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},path:{doc:"Arbitrary shape defined by path commands (d attribute).",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},image:{doc:"Embedded raster image.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},text:{doc:"Text block. Contains text content and optional <tspan>/<textPath>.",sub_tags:"tspan,textPath",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},tspan:{doc:"Inline text span within <text>.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},textPath:{doc:"Text rendered along a path shape.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},linearGradient:{doc:"Linear gradient definition. Place inside <defs>.",sub_tags:"stop",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},radialGradient:{doc:"Radial gradient definition. Place inside <defs>.",sub_tags:"stop",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},stop:{doc:"Gradient stop (color and offset).",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},pattern:{doc:"Tile pattern definition. Place inside <defs>.",sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},clipPath:{doc:"Clipping path definition.",sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},mask:{doc:"Alpha mask definition.",sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},marker:{doc:"Marker symbol for line endpoints or vertices.",sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},filter:{doc:"Filter effect container. Place inside <defs>.",sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},feGaussianBlur:{doc:"Gaussian blur filter primitive.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},feOffset:{doc:"Offset filter primitive.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},feBlend:{doc:"Blend filter primitive.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},feColorMatrix:{doc:"Color matrix filter primitive.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},feComposite:{doc:"Composite filter primitive.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},feFlood:{doc:"Flood fill filter primitive.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},feMerge:{doc:"Merge filter primitive (container for feMergeNode).",sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},feMergeNode:{doc:"Single input for feMerge.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},feDropShadow:{doc:"Drop shadow filter primitive (SVG 2).",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},feDiffuseLighting:{doc:"Diffuse lighting filter primitive.",sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},feSpecularLighting:{doc:"Specular lighting filter primitive.",sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},fePointLight:{doc:"Point light source for lighting filters.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},feDistantLight:{doc:"Distant light source for lighting filters.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},feSpotLight:{doc:"Spot light source for lighting filters.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},feMorphology:{doc:"Morphology filter primitive (erode/dilate).",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},feTurbulence:{doc:"Turbulence noise filter primitive.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},feDisplacementMap:{doc:"Displacement map filter primitive.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},feConvolveMatrix:{doc:"Convolution matrix filter primitive.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},feImage:{doc:"Image filter primitive.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},feTile:{doc:"Tile filter primitive.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},animate:{doc:"Animate an attribute over time.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},animateTransform:{doc:"Animate a transform attribute.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},animateMotion:{doc:"Animate motion along a path.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},set:{doc:"Set an attribute to a value for a duration.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},title:{doc:"Accessible title (tooltip in browsers).",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},desc:{doc:"Accessible description.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},metadata:{doc:"Metadata container (RDF, Dublin Core, etc.).",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},a:{doc:"Hyperlink wrapper.",sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},foreignObject:{doc:"Container for non-SVG content (HTML, MathML).",sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},switch:{doc:"Conditional processing (renders first matching child).",sub_tags:"*",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:null},dataSetter:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"destination",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"type",module:"builtins",name:"str"},has_default:!1},{name:"value",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"any"},has_default:!1},{name:"attr",kind:"var_keyword",role:"attribute",annotation:{kind:"any"},has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{data_element:!0}},dataFormula:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"destination",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"type",module:"builtins",name:"str"},has_default:!1},{name:"func",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"union",items:[{kind:"type",module:"builtins",name:"str"},{kind:"type",module:"collections.abc",name:"Callable"}]},has_default:!1},{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{data_element:!0}},dataController:{doc:null,sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"func",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"union",items:[{kind:"type",module:"builtins",name:"str"},{kind:"type",module:"collections.abc",name:"Callable"}]},has_default:!1},{name:"kwargs",kind:"var_keyword",role:"attribute",annotation:null,has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{data_element:!0}}}};var ht=class extends he{static _name="svg";static _defaultRenderMode="svg";static{this.defineGrammar(kl)}get renderer_svg(){return new Ot(this)}};he.registerBuilder(ht);var Re=class{constructor(e){this.gramlot=e}};var Ip={dataFormula:["formula","_if","_else"],dataController:["script","_if","_else"],dataRpc:["_if","_else","_onCalling","_onResult","_onError"],dataRemote:["_if","_else"],button:["action"]},Oi=["_cachedRemote","_if","_else","_onRemote"],Rp=["_if","_else","_onRemote"],Al=/^[A-Za-z]\w*$/;function Tl(r){return typeof r=="string"&&r.startsWith("==")}var Bt=class extends Ve{#e=new Set;#t=null;codeAttributes(){let e=[...Ip[this.nodeTag]??[],...typeof this.getAttr("remote")=="string"?Rp:[]],t=[];for(let[n,s]of Object.entries(this.getAttr()??{}))typeof s=="string"&&(e.includes(n)||n.startsWith("connect_on"))&&t.push([n,s]);for(let[n,s]of ye(this.getAttr()))Tl(s)&&t.push([n,s]);return Tl(this.staticValue)&&t.push(["",this.staticValue]),t}activateCode(){let e=new Map;for(let[t,n]of this.codeAttributes()){if(this.pointerType(n))throw new Error(`${this.nodeTag} '${this.label}': '${t}' is inline code and cannot be the pointer '${n}'; inline code is never read from Data`);e.set(t,n)}this.#t=e}activatedCode(e){return this.#t?.get(e)??null}remote(e,t={}){if(typeof e!="string"||!Al.test(e))throw new TypeError(`${this.nodeTag} '${this.label}': remote name must match ${Al.source}, not ${JSON.stringify(e)}`);let n=Object.keys(t).find(i=>i.startsWith("_")&&!Oi.includes(i));if(n)throw new TypeError(`${this.nodeTag} '${this.label}': remote parameter '${n}' is not accepted; the control attributes are ${Oi.join(", ")}`);let s={remote:e};for(let[i,a]of Object.entries(t))s[Oi.includes(i)?i:`remote_${i}`]=a;return this.setAttr(s),Yr(this)}pointerType(e){return typeof e=="string"&&e.startsWith("==")?null:super.pointerType(e)}pointers(){return super.pointers().filter(([e,t])=>!this.#n(e,t))}runtimeToEvaluate(){let e=super.runtimeToEvaluate();for(let[t,n]of e)this.pointerType(n)&&(this.#n(t,n)?e.set(t,n.slice(1)):this.absDatapath(n)===null&&e.set(t,null));return e}pathAttribute(e){let t=this.getAttr(e);return this.pointerType(t)&&this.#n(e,t)?t.slice(1):t}getRelativeData(e,t=null,n={}){return this.absDatapath(e)===null?null:super.getRelativeData(e,t,n)}setRelativeData(e,t,n={}){this.#i(e),super.setRelativeData(e,t,n)}PUT(e,t){this.#i(e),this.data.setItem(this.absDatapath(e),t,null,">",!1,!0,this,!1,!1)}FIRE(e,t=!0,n=null){t===null&&(t=!0),this.#i(e);let s=this.absDatapath(e);if(s.includes("?")){this.#r(s,t);return}this.data.getNode(s)?.setValue(null,!1);try{this.fireEvent(e,t,{attributes:n})}finally{this.data.getNode(s)?.setValue(null,!1)}}#r(e,t){let[n,s]=e.split("?",2),i=this.data;i.getNode(n)?.setAttr({[s]:null},!1);try{let a=i.getNode(n);a?a.setValue(a.staticValue,!0,{[s]:t},!0,!0,!0,!0):i.setItem(n,null,{[s]:t},">",!0,!0,!0,!0)}finally{i.getNode(n)?.setAttr({[s]:null},!1)}}FIRE_AFTER(e,t=!0,n=10){this.#i(e);let s=this.rootBuilder?.binding?.bindingFor(this)??null,i=null,a=setTimeout(()=>{i?.(),this.FIRE(e,t)},n);return i=s?.track(()=>clearTimeout(a))??null,()=>{clearTimeout(a),i?.()}}absDatapath(e){let t=this.pointerType(e)?e.slice(1):e;if(t.startsWith("#")&&t.includes("?")){let[n,s]=t.split("?",2),i=super.absDatapath(n);return i===null?null:`${i}?${s}`}return super.absDatapath(e)}_composeRelativeDatapath(e,t){let n=this;for(;n!==null&&e.startsWith(".");){let s=n.getAttr("datapath");if(this.pointerType(s)&&(s=this.#s(n,s),s===null))return null;if(s!=null&&(e=e==="."?s:s+e),e.startsWith("#"))return n.parentNode._resolveSymbolicDatapath(e,t);n=n.parentNode}if(e.startsWith("."))throw new Error(`unresolved relative datapath: ${t}`);return e}_finalizeAbsPath(e,t){return e===null?null:super._finalizeAbsPath(e,t)}_resolveSymbolicDatapath(e,t){let n=e.slice(1).split(".",1)[0];if(n==="FORM"||n==="ANCHOR")return super._resolveSymbolicDatapath(e,t);let s=this.rootBuilder?.binding;if(!s)return super._resolveSymbolicDatapath(e,t);let i=s.nodeIds.get(n);if(!i)throw new Error(`#<id>: cannot resolve ${t}`);let a=e.slice(n.length+2);return i.absDatapath(a?`.${a}`:".")}#s(e,t){let n=e.parentNode.absDatapath(t);if(n===null)return null;let s=this.data.getItem(n);return s==null||s===""?null:s}#n(e,t){return typeof e!="string"||!e.endsWith("_path")?!1:(this.#e.has(e)||(this.#e.add(e),console.warn(`${this.nodeTag} '${this.label}': '${e}' holds a bare Data path; the pointer symbol of '${t}' is removed`)),!0)}#i(e){if(this.absDatapath(e)===null)throw new Error(`${this.nodeTag} '${this.label}': write on a null path: '${e}'`)}},se=class r extends T{get nodeClass(){return Bt}authorizedCopy(e){let t=new this.constructor;for(let n of this.getNodes()){let s=n.getAttr("auth")??null;if(s!==null){if(typeof s!="string")throw new TypeError(`${n.nodeTag} '${n.label}': 'auth' must be a string rule, not ${typeof s}`);if(e(s)!==null)continue}let i=n.staticValue;i instanceof r&&(i=i.authorizedCopy(e));let{auth:a,...o}=n.getAttr(),l=t.setItem(n.label,i,o,">",!1,!1,null,!1,!0,null,n.nodeTag);l.xmlTag=n.xmlTag}return t}activateCode(){for(let e of this.getNodes())e.activateCode(),e.staticValue instanceof r&&e.staticValue.activateCode();return this}};if((xe(se.tytxSuffix).GramlotBuilderBag??se)!==se)throw new Error("TYTX subtype name 'GramlotBuilderBag' is already registered for another class");At(se.tytxSuffix,{...xe(se.tytxSuffix),GramlotBuilderBag:se});var Ee="http://www.w3.org/1999/xhtml",en="http://www.w3.org/2000/svg",Mp=new Set(["default","default_value","live","group","visible","action","fire","if","else","_init","_onStart","_onBuilt","_delay","_timing","_userChanges","remote","_cachedRemote","_onRemote"]),$p=["default_","attr_","fire_","connect_on","remote_"],Lp={table:["width","border"],editor:["height"],embed:["width","height"],img:["width","height"],canvas:["width","height"]},Fp=/(?<!\\)\$\{([a-zA-Z_][a-zA-Z0-9_]*)\}/g,Up=["format","mask","locale","places","dtype"],Pp=new Set(["href","src","formaction","xlink:href","xlink_href"]);function mt(r){return Object.fromEntries(Object.entries(r).filter(([e])=>!Mp.has(e)&&!$p.some(t=>e.startsWith(t))))}function ls(r,e,t=[]){for(let[n,s]of Object.entries(cr(mt(e)))){let i=t.find(o=>n.startsWith(o)),a=i?n.slice(i.length):n;if(/^on./i.test(a))throw new Error(`${r.nodeTag} '${r.label}': '${n}' has the form of a native event handler, run by the browser outside Gramlot; write connect_${a} for an event, or rename the attribute`);if(Pp.has(a.toLowerCase())&&qp(s))throw new Error(`${r.nodeTag} '${r.label}': '${n}' holds a javascript: URL, run by the browser as code; write connect_onclick or the action of a button instead`)}}function qp(r){return typeof r=="string"&&/^javascript:/i.test(r.replace(/[\t\n\r]/g,"").replace(/^[\u0000-\u0020]+/,""))}function Dl(r,e,t=[]){if(r.nodeTag!=="iframe")return e;let n=l=>{let u=t.find(c=>l.startsWith(c))??"";return[u,l.slice(u.length).toLowerCase()]},s=Object.fromEntries(ye(r.getAttr())),i=[...Object.keys(s),...Object.keys(e)].find(l=>n(l)[1]==="srcdoc");if(i===void 0||Object.keys(s).some(l=>n(l)[1]==="sandbox"))return e;let a=(l,u)=>{let c=s[l];return u.add(l),r.pointerType(c)!==null||Se(c)||lr(c).some(d=>Object.hasOwn(s,d)&&!u.has(d)&&a(d,u))};if(r.pointerType(r.value)===null&&!(Object.hasOwn(s,i)&&a(i,new Set)))return e;let o=Object.fromEntries(Object.entries(e).filter(([l])=>n(l)[1]!=="sandbox"));return{[`${n(i)[0]}sandbox`]:"",...o}}function cr(r){return Object.fromEntries(Object.entries(r).filter(([,e])=>e!=null))}function tn(r){return Object.fromEntries(Object.entries(r).map(([e,t])=>e.startsWith("xmlns_")?[`xmlns:${e.slice(6)}`,t]:e.startsWith("data_")||e.startsWith("aria_")?[e.replaceAll("_","-"),t]:[e,t]))}function us(r){let{_meta:e,...t}=r;return tn(cr(mt(t)))}function xl(r,e){let t=Lp[String(r).toLowerCase()]??[],n={},s={};for(let[i,a]of Object.entries(e))t.includes(i)?s[i]=a:n[i]=a;return[n,s]}function ur(r){return String(r)}function rn(r,e){let t={...e},n=t.mask;for(let i of Up)delete t[i];if(Array.isArray(r))return[r,t];if(typeof r=="boolean"&&(r=ur(r)),n==null)return[r,t];let s=r==null?"":ur(r);return[s===""?s:String(n).replaceAll("%s",()=>s),t]}function lr(r){return typeof r=="string"?[...r.matchAll(Fp)].map(([,e])=>e):[]}function Se(r){return typeof r=="string"&&r.startsWith("==")}function Sl(r){if(Se(r.value)&&lr(r.value).length)throw new Error(`${r.nodeTag} '${r.label}': the == node value contains a \${\u2026} template, not accepted in a == expression`);let e=Object.fromEntries(ye(r.getAttr()));for(let[t,n]of Object.entries(e)){if(Se(n)&&lr(n).length)throw new Error(`${r.nodeTag} '${r.label}': '${t}' contains a \${\u2026} template, not accepted in a == expression`);for(let s of lr(n))if(Se(e[s]))throw new Error(`${r.nodeTag} '${r.label}': the template of '${t}' uses '${s}', a == expression`)}}var jp=new Set(["animate","animateMotion","animateTransform","circle","ellipse","feBlend","feColorMatrix","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feGaussianBlur","feImage","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","image","line","metadata","path","polygon","polyline","rect","set","stop","use"]),nn=class extends Ot{constructor(e,t){super(e),this._owner=t}get owner(){return this._owner}_handleMeta(e,t){let n=this.owner.evaluateExpressions(e,t);ls(e,n);let[s,i]=super._handleMeta(e,n);return e._getMeta("subbuilder")?[s,os(us(i))]:[s,i]}adaptAttrs(e){let{_meta:t,...n}=e;return tn(super.adaptAttrs(cr(mt(n))))}renderedItem(e,t,n,s={}){if(this.owner.renderType==="object")return this.owner.renderedItem(e,t,n,s);let{_text:i,...a}=n;return t=this.owner.expressionValue(e,t),Array.isArray(t)&&i!=null&&(t=[this._escapeText(ur(i)),...t]),jp.has(s.tag)?`${s.pretty?" ".repeat(this._nodeDepth(e,s.depthOffset??0)):""}<${s.tag}${this._formatAttrs(a)} />${s.pretty?`
24
+ `:""}`:super.renderedItem(e,t,a,s)}};var It=class extends Ct{#e=new WeakMap;#t=new WeakMap;get inlineCompiler(){return null}getRender(e){return this.renders.has(e)||(e instanceof pt?this.addRender(e,this):e instanceof ht&&this.addRender(e,new nn(e,this))),super.getRender(e)}render(e,t={}){return e._getMeta("data_element")?null:super.render(e,t)}_handleMeta(e,t){let n=this.builder.constructor.dialectPrefixes,s=this.evaluateExpressions(e,t);ls(e,s,n);let[i,a]=super._handleMeta(e,Dl(e,s,n));if(e._getMeta("subbuilder")){let u=us(a);return e._getMeta("subbuilder")==="html"&&(u.xmlns=en),[i,u]}let[o,l]=xl(i,a);return Object.keys(l).length&&this.#e.set(e,l),[i,o]}evaluateExpressions(e,t){Sl(e);let n=this.inlineCompiler,s=(a,o)=>n?n.compileExpression(e,a,o)(t):null,i={...t};for(let[a,o]of ye(e.getAttr()))Se(o)&&Object.hasOwn(i,a)&&(i[a]=s(a,o));return Se(e.value)&&this.#t.set(e,s("",e.value)),i}expressionValue(e,t){return Se(e.value)?this.#t.get(e)??null:t}restoreNativeAttributes(e,t){let n=this.#e.get(e);return n?(this.#e.delete(e),{...t,...cr(n)}):t}adaptAttrs(e){let{_meta:t,...n}=e,s=`${this.builder.constructor._name}_`,i=this.builder.constructor.dialectPrefixes,a={},o={};for(let[l,u]of Object.entries(mt(n))){if(u==null)continue;if(l.startsWith(s))throw new Error(`${l}: the attribute prefix '${s}' is not accepted; use the prefix '${i[0]}'`);let c=i.find(d=>l.startsWith(d));c?a[l.slice(c.length)]=u:o[l]=u}return tn({...super.adaptAttrs(o),...a})}renderedItem(e,t,n,s={}){let i;[t,i]=rn(this.expressionValue(e,t),this.restoreNativeAttributes(e,n));let{_text:a,...o}=i;Array.isArray(t)&&a!=null&&(t=[this._escapeText(ur(a)),...t]);let l=e.parentNode?._getMeta("subbuilder")==="html"?{xmlns:Ee,...o}:o;return super.renderedItem(e,t,l,s)}finalize(e,t=null,n={}){if(!n.doctype)return super.finalize(e,t,n);let s=this._composeStringFragments(e),i=this.builder.source.getNodes().filter(a=>!a._getMeta("data_element"));return i.length===1&&i[0].nodeTag==="html"||(s=`<html>${s}</html>`),super.finalize(`<!doctype html>${s}`,t,n)}};var Nl={document_format:{name:"builder_grammar",version:"1.1"},grammar:{name:"binding",version:null,title:"Gramlot binding",description:"Data-elements of Gramlot 0.2.0 with the signatures of decision P18; loaded after the HTML grammar."},abstracts:{},elements:{dataSetter:{doc:"Initial Data value, written literally at destination_path.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"destination_path",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"type",module:"builtins",name:"str"},has_default:!1},{name:"value",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"any"},has_default:!0,default:null},{name:"attr",kind:"var_keyword",role:"attribute",annotation:{kind:"any"},has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{data_element:!0}},dataFormula:{doc:"Computed Data value written at result_path; formula is inline, func is a name.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"result_path",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"type",module:"builtins",name:"str"},has_default:!1},{name:"formula",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"union",items:[{kind:"type",module:"builtins",name:"str"},{kind:"type",module:"builtins",name:"NoneType"}]},has_default:!0,default:null},{name:"func",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"union",items:[{kind:"type",module:"builtins",name:"str"},{kind:"type",module:"builtins",name:"NoneType"}]},has_default:!0,default:null},{name:"params",kind:"var_keyword",role:"attribute",annotation:{kind:"any"},has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{data_element:!0}},dataController:{doc:"Side effects on Data; script is inline, func is a name.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"script",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"union",items:[{kind:"type",module:"builtins",name:"str"},{kind:"type",module:"builtins",name:"NoneType"}]},has_default:!0,default:null},{name:"func",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"union",items:[{kind:"type",module:"builtins",name:"str"},{kind:"type",module:"builtins",name:"NoneType"}]},has_default:!0,default:null},{name:"params",kind:"var_keyword",role:"attribute",annotation:{kind:"any"},has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{data_element:!0}},dataRpc:{doc:"Server endpoint called through gramlot.rpc; the value is written at result_path when given.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"method",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"type",module:"builtins",name:"str"},has_default:!1},{name:"result_path",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"union",items:[{kind:"type",module:"builtins",name:"str"},{kind:"type",module:"builtins",name:"NoneType"}]},has_default:!0,default:null},{name:"timeout",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"union",items:[{kind:"type",module:"builtins",name:"int"},{kind:"type",module:"builtins",name:"float"},{kind:"type",module:"builtins",name:"NoneType"}]},has_default:!0,default:null},{name:"params",kind:"var_keyword",role:"attribute",annotation:{kind:"any"},has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{data_element:!0}},dataRemote:{doc:"Data node resolved by a server endpoint through gramlot.rpc, on first read and again when cacheTime expires.",sub_tags:"",parent_tags:null,inherits_from:null,ns:null,attributes:{parameters:[{name:"destination_path",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"type",module:"builtins",name:"str"},has_default:!1},{name:"method",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"type",module:"builtins",name:"str"},has_default:!1},{name:"cacheTime",kind:"positional_or_keyword",role:"attribute",annotation:{kind:"union",items:[{kind:"type",module:"builtins",name:"int"},{kind:"type",module:"builtins",name:"float"},{kind:"type",module:"builtins",name:"NoneType"}]},has_default:!0,default:null},{name:"params",kind:"var_keyword",role:"attribute",annotation:{kind:"any"},has_default:!1}],accepts_var_keyword:!0,accepts_var_positional:!1},node_label:null,collection_key:null,_meta:{data_element:!0}}}};var Hp="data is forbidden: write dataSetter for a Data value or html_data for the HTML5 <data> element",zp=new Set,Gp=new Set(["serverpath","dbenv","shared_id","_ask","ask"]),Wp=["subscribe_","selfsubscribe_","formsubscribe_"],Xp={dataSetter:"destination_path",dataFormula:"result_path",dataRpc:"result_path",dataRemote:"destination_path"},Yp={dataFormula:"formula",dataController:"script"};function Cl(r,e){let t=Xp[r];if(t&&String(e[t]??"").includes("?"))return`'${t}' does not accept '?attr': '${e[t]}'`;let n=Yp[r];return n&&e[n]!=null&&e.func!=null?`'func' and '${n}' cannot be declared on the same node`:n&&e._if!=null&&e.func!=null?"'_if' is inline and cannot be declared with 'func': write the condition in the method":null}function Ol(r){return Object.keys(r).find(e=>Gp.has(e)||Wp.some(t=>e.startsWith(t)))}var Qe=class r extends pt{static _name="gramlot";static _sourceClass=se;static{this.defineGrammar(Nl)}static get dialectPrefixes(){let e=[];for(let t=Object.getPrototypeOf(r);t&&t!==Function.prototype;t=Object.getPrototypeOf(t))Object.hasOwn(t,"_name")&&t._name&&e.push(`${t._name}_`);return e}constructor(e=null,{collections:t=[],auth:n=null}={}){super(e),this._binding=null,this._auth=n;for(let s of t)this.loadCollection(s)}get auth(){return this._auth}get binding(){return this._binding}set binding(e){this._binding=e}nodeById(e){if(!this.binding)return super.nodeById(e);let t=this.binding.nodeIds.get(e);if(!t)throw new Error(`node_id not found: ${e}`);return t.builder.wrapSource(t)}loadCollection(e){return this.loadGrammar(e),this}schemaTag(e){let t=e.toLowerCase(),n=r.dialectPrefixes;if(t.startsWith(`${r._name}_`))throw new Error(`${e}: the tag prefix '${r._name}_' is not accepted; use the prefix '${n[0]}'`);if(zp.has(t))throw new Error(`${e}: excluded from Gramlot 0.2.0`);let s=this.schemaTagNames[t];if(s)return s;for(let i of n)if(t.startsWith(i)&&this.schemaTagNames[t.slice(i.length)])return t;return null}bagCall(e,t,n,s){return super.bagCall(e,this.#e(t),n,s)}commandOnNode(e,t,n,s){return super.commandOnNode(e,this.#e(t),n,s)}validateNodeValues(e,t,n={}){let s=Ol(n);if(s)throw new Error(`${e}: attribute '${s}' is excluded from Gramlot 0.2.0`);let i=Cl(e,n);if(i)throw new Error(`${e}: ${i}`);return super.validateNodeValues(e,t,n)}validateNode(e,t={}){let n=Ol(t.attrs??e.getAttr());if(n)throw new Error(`${e.nodeTag} '${e.label}': attribute '${n}' is excluded from Gramlot 0.2.0`);let s=Cl(e.nodeTag,t.attrs??e.getAttr());if(s)throw new Error(`${e.nodeTag} '${e.label}': ${s}`);return super.validateNode(e,t)}setChild(e,t,n,s,i=null){let o=t==="dataSetter"&&s?.value!==null&&typeof s?.value=="object"&&Object.getPrototypeOf(s.value)===Object.prototype?{...s,value:new P(s.value)}:s;return super.setChild(e,t,n,o,i)}#e(e){if(e==="data")throw new Error(Hp);if(this.schemaTagNames[e.toLowerCase()]===e)return e;let t=r.dialectPrefixes.find(n=>e.startsWith(n));return this.schemaTagNames[e.slice(t.length)]}get renderer_html(){return new It(this)}create(){this.setup(this.data),this.main(this.root)}computeLogic(){}promoteNodeValue(e,t,n){let s=t!=null?{_text:t}:null;e.setValue(n,!0,s,!0)}reference(e,t="node"){if(e=Ie(e),!(e instanceof Ve)||!["node","dom"].includes(t))throw new TypeError("Reference requires an element and node/dom kind");let n=e.getAttr("__ref");return n==null&&(n=crypto.randomUUID().replaceAll("-",""),e.setAttr({__ref:n})),{$gramlotRef:n,kind:t}}toTytx(){return le(this.auth===null?this.source:this.source.authorizedCopy(this.auth))}};var Zp=new Set(["input","select","textarea"]),Jp=["type","multiple","group"];function Bl(r,e){let t=r.getAttr(e);return r.pointerType(t)?r.getRelativeData(t):t}var me=class r{static liveWrites=!1;static writesDefault=!0;#e;#t;#r=!1;#s=!1;#n=!1;static for(e,t){let n=r.classFor(t.element,t.attrs);return n?new n(e,t):null}static classFor(e,t){if(e.namespaceURI!==Ee)return null;if(e.localName==="textarea")return He;if(e.localName==="select")return sn;if(e.localName!=="input")return null;let n=t.type==null?"text":String(t.type).toLowerCase();return Object.hasOwn(Rl,n)?Rl[n]:He}static shape(e,t){return e?.namespaceURI!==Ee||!Zp.has(e.localName)?null:JSON.stringify(Jp.map(n=>t[n]??null))}constructor(e,t){this.#e=e,this.#t=t}get binding(){return this.#e}get element(){return this.#t.element}get node(){return this.binding.node}get resolved(){return this.#t.resolved}get live(){return!!this.resolved.live}get writeEvent(){return this.constructor.liveWrites&&this.live?"input":"change"}project(e,t){if(this.#s){this.#n=!0;return}this.#r&&this.same(this.read(),e)||(this.constructor.writesDefault&&!this.node.pointerType(this.node.getAttr("value"))&&this.writeDefault(e),this.write(e))}read(){return this.element.value}write(e){let t=e==null?"":String(e);this.element.value!==t&&(this.element.value=t)}writeDefault(e){let t=e==null?"":String(e);this.element.localName==="textarea"?this.#t.text.data!==t&&(this.#t.text.data=t):this.element.defaultValue!==t&&(this.element.defaultValue=t)}same(e,t){return Object.is(e,t)}commit(e){if(this.binding.closed)return;let t=this.node.getAttr("value");if(this.node.pointerType(t)==="^"){this.#r=!0;try{this.node.setRelativeData(t.slice(1),this.read())}finally{this.#r=!1}}}attach(){for(let e of["input","change","compositionstart","compositionend"])this.element.addEventListener(e,this)}detach(){for(let e of["input","change","compositionstart","compositionend"])this.element.removeEventListener(e,this);this.#n=!1}refresh(){}handleEvent(e){if(!this.binding.closed){if(e.type==="compositionstart"){this.#s=!0;return}if(e.type==="compositionend"){this.#s=!1,this.writeEvent==="input"&&this.commit(e),this.#n&&(this.#n=!1,this.binding.runtime.renderer.project(this.node));return}this.#s||e.isComposing||e.type===this.writeEvent&&this.commit(e)}}},He=class extends me{static liveWrites=!0},Bi=class extends me{static liveWrites=!0;read(){return this.element.value===""?null:Number(this.element.value)}commit(e){this.element.validity.badInput||super.commit(e)}},Ii=class extends me{static liveWrites=!0;read(){return Number(this.element.value)}},sn=class extends me{static writesDefault=!1;read(){return this.element.multiple?[...this.element.selectedOptions].map(e=>e.value):this.element.selectedIndex===-1?null:this.element.value}write(e){let t=this.element;if(t.multiple){if(e!=null&&!Array.isArray(e))throw new TypeError(`${this.node.nodeTag} '${this.node.label}': a multiple select requires an array`);let n=new Set((e??[]).map(String));for(let s of t.options){let i=n.has(s.value);s.selected!==i&&(s.selected=i)}}else e==null?t.selectedIndex!==-1&&(t.selectedIndex=-1):(t.selectedIndex===-1||t.value!==String(e))&&(t.value=String(e))}same(e,t){return Array.isArray(e)?Array.isArray(t)&&t.length===e.length&&t.every((n,s)=>Object.is(n,e[s])):super.same(e,t)}},Rt=class extends me{read(){return this.element.value===""?null:this.element.value}},Ri=class extends me{},cs=class extends me{static writesDefault=!1;read(){return this.element.checked}write(e){let t=!!e;this.element.checked!==t&&(this.element.checked=t)}same(e,t){return e===!!t}attach(){let e=this.node;if(e.getAttr("checked")!=null&&e.pointerType(e.getAttr("value"))==="^")throw new TypeError(`${e.nodeTag} '${e.label}': checked and a ^ value are two sources`);super.attach()}},Mi=class extends cs{#e=null;#t=!1;get groups(){return this.binding.runtime.renderer.radioGroups}attach(){let e=this.node,t=this.resolved.group??null,n=Il(e);if(t!=null){if(e.getAttr("name")!=null)throw new TypeError(`${e.nodeTag} '${e.label}': name and group are two names`);this.#r(t,n)}super.attach(),t!=null&&(this.#e=this.groups.join(this,t,n),this.element.setAttribute("name",this.#e))}detach(){this.#e!==null&&(this.groups.leave(this),this.element.removeAttribute("name"),this.#e=null),super.detach()}refresh(){if(this.#e===null)return;let e=this.resolved.group,t=Il(this.node);this.groups.nameOf(e,t)!==this.#e&&(this.#r(e,t),this.groups.leave(this),this.#e=this.groups.join(this,e,t),this.element.setAttribute("name",this.#e))}#r(e,t){let n=this.node;if(Bl(n,"value")&&this.groups.peersOf(e,t).some(s=>!s.binding.closed&&s.read()))throw new Error(`${n.nodeTag} '${n.label}': several true values in radio group '${e}'`)}project(e,t){let n=!this.#t;this.#t=!0;let s=this.read();super.project(e,t),!n&&!s&&this.read()&&this.turnOffPeers()}commit(e){let t=this.read();super.commit(e),t&&!this.binding.closed&&this.turnOffPeers()}turnOffPeers(){if(this.#e!==null)for(let e of this.groups.peers(this)){if(this.binding.closed)return;e.binding.closed||(e.element.checked&&(e.element.checked=!1),Bl(e.node,"value")&&e.commit(null))}}},ds=class{#e;#t=new Map;#r=new Map;#s=new WeakMap;#n=0;constructor(e){this.#e=e}join(e,t,n){let s=this.nameOf(t,n);return this.#t.has(s)||this.#t.set(s,new Set),this.#t.get(s).add(e),this.#r.set(e,s),s}leave(e){let t=this.#r.get(e);this.#r.delete(e);let n=this.#t.get(t);n?.delete(e),n?.size===0&&this.#t.delete(t)}peers(e){let t=this.#r.get(e);return[...this.#t.get(t)??[]].filter(n=>n!==e)}peersOf(e,t){return[...this.#t.get(this.nameOf(e,t))??[]]}nameOf(e,t){t!==null&&!this.#s.has(t)&&this.#s.set(t,this.#n++);let n=t===null?"page":`form${this.#s.get(t)}`;return`gramlot-${this.#e.instanceId}-${n}-${e}`}};function Il(r){for(let e=r;e;e=e.parentNode){let t=e.getAttr()??{};if(t.formId!=null||t.form===!0)return e}return null}var Rl={text:He,password:He,email:He,url:He,tel:He,search:He,number:Bi,range:Ii,color:Ri,date:Rt,time:Rt,month:Rt,week:Rt,"datetime-local":Rt,checkbox:cs,radio:Mi,hidden:null,file:null,button:null,submit:null,reset:null,image:null};var $i=Symbol("source text"),Ml={xmlns:"http://www.w3.org/2000/xmlns/",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"},Kp=new Set(["allowFullscreen","async","autofocus","autoplay","checked","controls","default","defer","disabled","formNoValidate","hidden","inert","isMap","itemscope","loop","multiple","muted","noModule","noValidate","open","playsInline","readOnly","required","reversed","selected"]),Qp=new Set(["checked","muted","selected","value"]),eh=new Map([["allowfullscreen","allowFullscreen"],["formnovalidate","formNoValidate"],["ismap","isMap"],["nomodule","noModule"],["novalidate","noValidate"],["playsinline","playsInline"],["readonly","readOnly"]]);function th(r){let e=r.replace(/-([a-z])/g,(t,n)=>n.toUpperCase());return eh.get(e.toLowerCase())??e}var fs=class{constructor({metadataAttributes:e=[]}={}){this.metadataAttributes=new Set([...Dt,"_text",...e])}definition(e){let t=e.builder,s={...t.schema[t.schemaTag(e.nodeTag)]._meta,...e.getAttr("_meta")},i=Xr(e.nodeTag,{renderTag:s.render_tag,ns:e.getAttr("ns"),dialectName:t.constructor._name}),a=i==="foreignObject"?en:s.render_attributes?.xmlns??e.getAttr("xmlns")??(t instanceof ht?en:Ee);return{meta:s,namespace:a,tag:i}}validate(e,t=e.builder){let n=e.value instanceof T,s=n?e.getAttr("_text"):e.value;if(s!=null&&!["string","number","boolean"].includes(typeof s))throw new TypeError("HTML text must be scalar");for(let[o,l]of Object.entries(e.attr))if(!this.metadataAttributes.has(o)&&l!=null&&!["string","number","boolean"].includes(typeof l))throw new TypeError(`HTML attribute ${o} must be scalar`);let i=Object.fromEntries(Object.entries(e.attr).filter(([o])=>!this.metadataAttributes.has(o))),a=n?e.value.getNodes().map(o=>o.nodeTag).filter(Boolean):[];t.validateNode(e,{value:s,attrs:i,childTags:a})}create(e,t,n=null,s=e.attr,i=null){let{tag:a,namespace:o,meta:l}=this.definition(e);n??=a;let u=o===Ee?t.createElement(n):t.createElementNS(o,n),c=t.createTextNode(this.text(e));(o!==Ee||!l.void)&&u.append(c);let d={element:u,text:c,tag:n};return this.update(d,e,s,$i,i),d}matches(e,t){let{tag:n,namespace:s}=this.definition(t);return(s===Ee?e.tag.toLowerCase()===n.toLowerCase():e.tag===n)&&e.element.namespaceURI===s}compose(e,t,n){e.text.data=t??"";for(let s of n)e.element.append(s)}update(e,t,n=t.attr,s=$i,i=null){let{element:a,text:o}=e,l=a.namespaceURI===Ee,u=this.definition(t).meta.render_attributes??{},c=e.attrs??{};n=Object.fromEntries(ye({...n,...u}));let d=me.classFor(a,n)!==null;s===$i&&(s=this.text(t));let f=s==null?"":String(s);o.data!==f&&(o.data=f);let p=[...new Set([...Object.keys(c),...Object.keys(n)])];p.sort((h,m)=>(m==="sandbox")-(h==="sandbox"));for(let h of p){if(this.metadataAttributes.has(h)||d&&h==="value")continue;let m=n[h],g=h,b=th(g),v=l&&Kp.has(b)&&typeof a[b]=="boolean",w=g==="xmlns"?"xmlns":g.includes(":")?g.split(":")[0]:"",k=Object.hasOwn(Ml,w)?Ml[w]:null;if(Object.is(c[h],m)||(m==null||v&&!m?k?a.removeAttributeNS(k,g.split(":").at(-1)):a.removeAttribute(g):k?a.setAttributeNS(k,g,String(m)):a.setAttribute(g,v?"":String(m))),l&&(v||Qp.has(b))&&b in a){let I=b==="value"?m==null?"":String(m):!!m;a[b]!==I&&(a[b]=I)}}i===!1?a.style.visibility!=="hidden"&&(a.style.visibility="hidden"):e.visible===!1&&(n.style==null?a.removeAttribute("style"):a.setAttribute("style",String(n.style))),e.visible=i,e.attrs=n}text(e){return e.value instanceof T?e.getAttr("_text")==null?"":String(e.attr._text):e.value==null?"":String(e.value)}};var ps=class r{#e;#t;static for(e,t){let n=t.element;return n?.namespaceURI!==Ee||n.localName!=="button"?null:new r(e,t)}constructor(e,t){this.#e=e,this.#t=t}get binding(){return this.#e}get node(){return this.binding.node}get element(){return this.#t.element}get controllers(){let e=this.node.value;return e?.getNodes?e.getNodes().filter(t=>t.nodeTag==="dataController"||t.nodeTag==="dataRpc"):[]}get mechanism(){let e=this.node,t=this.controllers;if(t.length>1)throw new Error(`${e.nodeTag} '${e.label}': several dataController or dataRpc children; a button has one click mechanism`);let n=e.getAttr()??{},s=[];if(t.length&&s.push("controller"),n.action!=null&&s.push("action"),$l(n).length&&s.push("fire"),s.length>1)throw new Error(`${e.nodeTag} '${e.label}': ${s.join(" and ")} together; a button has one click mechanism`);return s[0]??null}attach(){this.refresh(),this.element.addEventListener("click",this)}refresh(){this.mechanism&&this.node.getAttr("type")==null&&this.element.getAttribute("type")!=="button"&&this.element.setAttribute("type","button")}detach(){this.element.removeEventListener("click",this)}handleEvent(e){this.onClick(e)}onClick(e){if(this.binding.closed)return;let t=this.mechanism;if(!t||(e.stopPropagation(),this.element.disabled))return;let n=this.binding.countClick(),s=this.node,i=rh(e);if(t==="controller")this.binding.runtime.bindingFor(this.controllers[0])?.providers[0]?.invoke({kind:"click",event:e,counter:n});else if(t==="action"){let[,a]=s.builder.runtimeValues(s),o={...a,event:e,_counter:n,modifiers:i};this.binding.runtime.inlineCompiler.compile(s,"action",s.getAttr("action"),Object.keys(o))(o)}else{let a={modifier:i,_counter:n},o=s.getAttr("fire");if(o!=null){s.FIRE(o,i||!0,a);return}for(let[l,u]of $l(s.getAttr())){if(this.binding.closed)return;s.FIRE(u,l.slice(5),a)}}}};function $l(r){return Object.entries(r??{}).filter(([e,t])=>t!=null&&(e==="fire"||e.startsWith("fire_")))}function rh(r){return["shift","ctrl","alt","meta"].filter(e=>r[`${e}Key`]).map(e=>e[0].toUpperCase()+e.slice(1)).join("")}var hs="connect_on",nh=/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)+$/,an=class{#e;#t;#r;#s;#n;static declared(e){return Object.entries(e.getAttr()??{}).filter(([t,n])=>t.startsWith(hs)&&t.length>hs.length&&n!=null).map(([t,n])=>[t,t.slice(hs.length).toLowerCase(),n])}constructor(e,t,n,s,i=`${hs}${n}`){this.#e=e,this.#t=t,this.#r=n,this.#s=s,this.#n=i}get binding(){return this.#e}get node(){return this.binding.node}get element(){return this.#t.element}get eventName(){return this.#r}get handler(){return this.#s}get attribute(){return this.#n}attach(){this.element.addEventListener(this.eventName,this)}detach(){this.element.removeEventListener(this.eventName,this)}handleEvent(e){if(this.binding.closed)return;let t=this.node,n=this.binding.runtime;if(nh.test(this.handler)){let{group:s,method:i}=n.logicRegistry.resolve(this.handler,t);i.call(s,t,e);return}n.inlineCompiler.compile(t,this.attribute,this.handler,["event"])({event:e})}};var on=class{constructor(e=null){this.entries=new Map,this.sourceRoot=e}validate(e,t=new Set){let n=new Map,s=i=>{for(let a of i.getNodes()){let o=a.getAttr("__ref");if(o){if(n.has(o))throw new Error("Duplicate Source reference");let l=this.entries.get(o);if(e!==this.sourceRoot&&l&&l.node!==a&&!t.has(l.node))throw new Error("Duplicate Source reference");n.set(o,a)}a.value instanceof T&&s(a.value)}};s(e)}register(e,t){let n=e.getAttr("__ref");if(n){if(this.entries.has(n))throw new Error(`Duplicate Source reference: ${n}`);this.entries.set(n,{node:e,dom:t})}}remove(e){for(let[t,n]of this.entries)n.node===e&&this.entries.delete(t)}resolve(e){if(!e||!["node","dom"].includes(e.kind))throw new TypeError("Expected a node or DOM reference");let t=this.entries.get(e.$gramlotRef);if(!t)throw new Error("Source reference is not mounted");return t[e.kind]}};var sh="_root_",ms=class{constructor(e=null,t=null){this.parent=e,this.segment=t,this.children=new Map,this.registrations=new Set}},Li=class{#e;#t;#r;#s;#n;#i=!0;constructor(e,{path:t,attr:n,recipient:s,order:i}){this.#e=e,this.#t=t,this.#r=n,this.#s=s,this.#n=i}get router(){return this.#e}get path(){return this.#t}get attr(){return this.#r}get recipient(){return this.#s}get active(){return this.#i}get order(){return this.#n}close(){this.active&&(this.#i=!1,this.router.unregister(this))}},Fi=class{constructor({evt:e,node:t,path:n,oldvalue:s,attrsDiff:i,reason:a,fired:o,level:l,registration:u}){this.evt=e,this.node=t,this.path=n,this.oldvalue=s,this.attrsDiff=i,this.reason=a,this.fired=o,this.level=l,this.registration=u}},gs=class{#e;#t=new ms;#r=new Map;#s=0;#n=0;constructor(e){this.#e=e}get runtime(){return this.#e}get size(){return this.#s}register({path:e,attr:t=null,recipient:n}){if(typeof e!="string"||e==="")throw new TypeError(`A Data registration requires a path: ${e}`);let s=this.#t;for(let a of e.split(".")){let o=s.children.get(a);o||(o=new ms(s,a),s.children.set(a,o)),s=o}this.#n+=1;let i=new Li(this,{path:e,attr:t,recipient:n,order:this.#n});return s.registrations.add(i),this.#r.set(i,s),this.#s+=1,i}unregister(e){let t=this.#r.get(e);if(t)for(this.#r.delete(e),t.registrations.delete(e),this.#s-=1;t.parent&&!t.children.size&&!t.registrations.size;)t.parent.children.delete(t.segment),t=t.parent}deliver(e){let{pathlist:t}=e;if(!t?.length||t[0]!==sh||e.reason==="autocreate")return;let n=t.slice(1),s=e.evt==="ins"||e.evt==="del";for(let i of Array.isArray(e.node)?e.node:[e.node]){let a=s?[...n,i.label]:n,o=a.join(".");for(let[l,u]of this.#i(a,e))l.active&&l.recipient.receive(new Fi({evt:e.evt,node:i,path:o,oldvalue:e.oldvalue??null,attrsDiff:e.attrs_diff??null,reason:e.reason??null,fired:e.fired??!1,level:u,registration:l}))}}#i(e,t){let n=[],s=this.#t;for(let a of e){for(let o of s.registrations)s!==this.#t&&this.#a(o,"child",t)&&n.push([o,"child"]);if(s=s.children.get(a),!s)return n.sort(([o],[l])=>o.order-l.order)}for(let a of s.registrations)this.#a(a,"node",t)&&n.push([a,"node"]);let i=[...s.children.values()];for(;i.length;){let a=i.pop();for(let o of a.registrations)this.#a(o,"container",t)&&n.push([o,"container"]);i.push(...a.children.values())}return n.sort(([a],[o])=>a.order-o.order)}#a(e,t,n){let{evt:s}=n;return e.attr===null?s==="upd_attrs"?!1:!(t==="child"&&n.fired):t==="child"?!1:t==="container"?s!=="upd_attrs":s==="ins"||s==="del"?!0:Object.hasOwn(n.attrs_diff??{},e.attr)}};var _s=class{#e;constructor(e){this.#e=e}get runtime(){return this.#e}install(e){let t=ln(e),n=this.setterNodes(e);Pi(e);for(let s of n){let i=this.runtime.openBinding(s);i.hasStamp("installed")||(this.applySetter(s),i.stamp("installed"))}this.applyDefaults(t.filter(s=>s.nodeTag&&!s._getMeta("data_element")))}setterNodes(e){return ln(e).filter(t=>t.nodeTag==="dataSetter")}applySetter(e){let t=e.absDatapath(e.pathAttribute("destination_path"));if(t===null)return;let n=e.getAttr("value")??null,s=ah(e.getAttr()),i=this.runtime.data;if(n!==null)i.setItem(t,n,s,">",!1,!0,e),n instanceof P&&e.setAttr({value:null},!1);else{let a=i.getNode(t);a?s&&a.setAttr(s,!0):i.setItem(t,null,s,">",!1,!0,e)}}applyDefaults(e){for(let t of e){let n=t.getAttr();for(let[s,i]of Object.entries(n)){if(!ih(t,s,i))continue;let a=s==="value"?n.default_value??n.default:n[`default_${s}`];a!=null&&this.#t(t,i,a)}this.#r(t,n)}}#t(e,t,n){let s=e.absDatapath(t);if(s===null)return;let[i,a=null]=s.split("?",2),o=this.runtime.data,l=o.getNode(i);if(a===null){if(l&&l.value!==null&&l.value!==void 0)return;o.setItem(i,n,null,">",!1,!0,e)}else if(l){let u=l.getAttr(a);u==null&&l.setAttr({[a]:n},!0)}else o.setItem(i,null,{[a]:n},">",!1,!0,e)}#r(e,t){let n={};for(let[a,o]of Object.entries(t))a.startsWith("attr_")&&(n[a.slice(5)]=e.pointerType(o)?e.getRelativeData(o):o);if(!Object.keys(n).length)return;let s=[t.value,t.src].find(a=>e.pointerType(a));if(!s)return;let i=e.absDatapath(s);i!==null&&this.runtime.data.getNode(i.split("?",1)[0])?.setAttr(n,!0,!0,!1)}};function ih(r,e,t){return e==="_meta"||Dt.has(e)||e==="default"||e.startsWith("default_")||e.startsWith("attr_")||e.endsWith("_path")?!1:r.pointerType(t)!==null}function ah(r){let e={};for(let[t,n]of Object.entries(mt(r??{})))Dt.has(t)||t.startsWith("_")||t==="destination_path"||t==="value"||n!=null&&(e[t]=n);return Object.keys(e).length?e:null}function oh(r){let e=r.builder;if(!(e instanceof Qe))throw new Error(`dataSetter '${r.label}': dataSetter is not supported inside ${e.constructor._name}`)}function Pi(r){for(let e of ln(r))e.nodeTag==="dataSetter"&&oh(e),dh(e)}var lh=["_init","_onStart","_onBuilt","_delay","_timing","_userChanges"],uh=new Set(["dataFormula","dataController","dataRpc","dataRemote"]),ch=["_onCalling","_onResult","_onError"],Ui=["_init","_onBuilt","_onStart"];function dh(r){let e=s=>r.getAttr(s)!==null&&r.getAttr(s)!==void 0;if(r.nodeTag!=="dataRpc"){let s=ch.find(e);if(s)throw new Error(`${r.nodeTag??"fragment"} '${r.label}': '${s}' is allowed only on dataRpc`)}if(uh.has(r.nodeTag)){let s=Object.entries(r.getAttr()).find(([,a])=>Se(a));if(s)throw new Error(`${r.nodeTag} '${r.label}': '${s[0]}' is a == expression, not accepted on ${r.nodeTag}`);let i=r.nodeTag==="dataRemote"?Ui.find(e):null;if(i)throw new Error(`dataRemote '${r.label}': '${i}' is not accepted on dataRemote, its resolver loads when the Data is read`);for(let a of Ui){let o=r.getAttr(a);if(!(o==null||typeof o=="boolean"||typeof o=="number"))throw new Error(`${r.nodeTag} '${r.label}': '${a}' accepts true, false, null or a number, not ${JSON.stringify(o)}`)}return}let t=lh.find(e);if(!t)return;let n=Ui.includes(t)?"dataFormula, dataController and dataRpc":"dataFormula, dataController, dataRpc and dataRemote";throw new Error(`${r.nodeTag??"fragment"} '${r.label}': '${t}' is allowed only on ${n}`)}function ln(r){if(r instanceof T)return r.getNodes().flatMap(t=>ln(t));let e=[r];return r.value instanceof T&&e.push(...ln(r.value)),e}var bs=class extends X{static classKwargs={...X.classKwargs,asBag:!1};static internalParams=new Set([...X.internalParams,"gramlot","method","params","onError"]);constructor({gramlot:e,method:t,params:n,cacheTime:s,onError:i}){super({cacheTime:s??-1}),this.gramlot=e,this.method=t,this.params=n,this.onError=i,this.controller=null,this.loading=null,this.loaded=!1,this.writing=!1}resolve({static:e=!1}={}){return!e&&!this.loading&&!this.writing&&this.expired&&this.refresh(),this.cachedValue}refresh(){let e=()=>{this.loading===s&&(this.controller=null,this.loading=null)},t=this.load(),{signal:n}=this.controller,s=t.then(i=>{if(e(),n.aborted)throw n.reason;this._lastUpdate=Date.now(),this.loaded=!0,this.writing=!0;try{this._node?this._node.setValue(i,this.cacheTime!==0):this.cachedValue=i}finally{this.writing=!1}return i},i=>{throw e(),i});return this.loading=s,s.catch(i=>{i?.name!=="AbortError"&&this.onError(i)}),s}load(){let e=new AbortController,t=new Promise((s,i)=>{e.signal.addEventListener("abort",()=>i(e.signal.reason),{once:!0})}),n=this.gramlot.rpc.call("data",this.method,this.params,{signal:e.signal});return this.controller=e,Promise.race([n,t])}abort(){this.controller?.abort()}};var fh=new Set(["destination_path","result_path","func","formula","script","if","else","_init","_onStart","_onBuilt","_delay","_timing","_userChanges","method","timeout","_onCalling","_onResult","_onError","cacheTime"]),dr=class{#e;#t=[];#r=null;#s=null;#n=null;#i=null;#a=null;#u=!1;constructor(e){this.#e=e,e.track(()=>{this.cancel(),this.#m(),this.#h()})}get binding(){return this.#e}get node(){return this.binding.node}get kind(){throw new Error("Provider.kind is defined by FormulaProvider, ControllerProvider, RpcProvider and RemoteProvider")}register(){let e=this.node,t=e.getAttr("_onStart");if(typeof t=="number"&&!(Number.isFinite(t)&&t>=0))throw new Error(`${e.nodeTag} '${e.label}': _onStart must be true or a delay in ms not below 0: ${t}`);this.#m();let n=this.binding.runtime.router;for(let[s,i]of e.pointers()){if(s==="datapath")continue;let a=e.absDatapath(i);if(a===null)continue;let[o,l=null]=a.split("?",2),u=n.register({path:o,attr:l,recipient:this});this.#t.push(u),s==="_timing"&&(this.#r=u)}this.#c(),this.kind==="remote"&&this.invoke({kind:"install",change:null})}receive(e){if(e.registration===this.#r){this.#c();return}if(this.#o("_userChanges")&&e.level!=="node")return;let t={kind:"data",change:e},n=this.#o("_delay");n>0?this.#f(t,n):this.invoke(t)}invoke(e){if(this.binding.closed)return;let t=this.node,n=this.kind==="formula",s=this.kind==="rpc",i=this.kind==="remote",a=this.readArguments(e),[o,l]=[n?"formula":"script",t.getAttr(n?"formula":"script")],u=t.getAttr("_if");if(u&&!this.#l("_if",u,`return (${u})`,a,!1)){if(i&&this.#h(),[o,l]=["_else",t.getAttr("_else")],!l)return;if(s||i){this.#l(o,l,l,a,!0);return}}if(s)return this.#p(a);if(i)return this.#d(a);let c=t.getAttr("func"),d;if(l)d=this.#l(o,l,n?`return ${l}`:l,a,!0);else if(c==null){if(!n)return;d=new P(ws(a))}else{let{group:f,method:p}=this.binding.runtime.logicRegistry.resolve(c,t);d=n?p.call(f,a):p.call(f,t,a)}n&&t.setRelativeData(t.pathAttribute("result_path"),d)}readArguments(e){let t=this.node,[,n]=t.builder.runtimeValues(t),s={};for(let[o,l]of Object.entries(n))fh.has(o)||(s[o]=l);let i=e.change??null,a=i?i.level:e.kind;return s._node=i?i.node:null,s._triggerpars={kw:i,trigger_reason:a},s._reason=a,e.kind==="click"&&Object.assign(s,ph(e)),s}cancel(){this.#n?.(),this.#s?.()}#c(){this.#s?.();let e=this.#o("_timing");if(!(e>0))return;let t=setInterval(()=>this.invoke({kind:"timing",change:null}),e*1e3),n=this.binding.track(()=>clearInterval(t));this.#s=()=>{clearInterval(t),n(),this.#s=null}}#f(e,t){this.#n?.();let n=null,s=setTimeout(()=>{n(),this.#n=null,this.invoke(e)},t);n=this.binding.track(()=>clearTimeout(s)),this.#n=()=>{clearTimeout(s),n(),this.#n=null}}#o(e){let t=this.node,n=t.getAttr(e);return t.pointerType(n)?t.getRelativeData(n):n??null}#l(e,t,n,s,i){let a=[...i?["_kwargs"]:[],...Ll,...Fl,...Object.keys(ws(s))];return this.binding.runtime.inlineCompiler.compile(this.node,e,t,a,n)({...s,_kwargs:s})}async#p(e){let t=this.node,[n,s,i]=["_onCalling","_onResult","_onError"].map(h=>t.getAttr(h));n&&this.#l("_onCalling",n,n,e,!0),this.#i?.abort();let a=new AbortController;this.#i=a;let o=this.binding.track(()=>a.abort()),l=this.#o("timeout"),u=l>0?setTimeout(()=>{let h=new Error(`${t.nodeTag} '${t.label}': no answer within ${l} ms`);h.name="TimeoutError",a.abort(h)},l):null,c=new Promise((h,m)=>{a.signal.addEventListener("abort",()=>m(a.signal.reason),{once:!0})}),d;try{let h=this.binding.runtime.gramlot.rpc.call("data",this.#o("method"),ws(e),{signal:a.signal});d={result:await Promise.race([h,c])}}catch(h){d={error:h}}clearTimeout(u),o();let f=this.#i===a&&!this.binding.closed;if(this.#i===a&&(this.#i=null),!f)return;if("error"in d){if(!i)throw d.error;this.#l("_onError",i,i,{...e,error:d.error},!0);return}let{result:p}=d;t.getAttr("result_path")!=null&&t.setRelativeData(t.pathAttribute("result_path"),p),s&&this.#l("_onResult",s,s,{...e,result:p},!0)}#d(e){this.#h();let t=this.#u;this.#u=!1;let n=this.node,s=n.absDatapath(n.pathAttribute("destination_path"));if(s===null)return;let i=new bs({gramlot:this.binding.runtime.gramlot,method:this.#o("method"),params:ws(e),cacheTime:this.#o("cacheTime"),onError:a=>{throw new Error(`${n.nodeTag} '${n.label}': dataRemote '${i.method}' failed: ${a.message}`,{cause:a})}});this.binding.runtime.data.setResolver(s,i),this.#a={path:s,resolver:i},t&&i.refresh()}#h(){if(!this.#a)return;let{path:e,resolver:t}=this.#a;this.#a=null,this.#u=t.loaded||t.loading!==null,t.abort();let n=this.binding.runtime.data.getNode(e);n?.resolver===t&&(n.resolver=null)}#m(){for(let e of this.#t.splice(0))e.close();this.#r=null}},ys=class extends dr{get kind(){return"formula"}},vs=class extends dr{get kind(){return"controller"}},Es=class extends dr{get kind(){return"rpc"}},ks=class extends dr{get kind(){return"remote"}},Ll=["_node","_triggerpars","_reason"],Fl=["_evt","button_counter","button_shift","button_ctrl","button_alt","button_meta"];function ws(r){let e={...r};for(let t of[...Ll,...Fl])delete e[t];return e}function ph({event:r,counter:e}){return{_evt:r,button_counter:e,button_shift:!!r.shiftKey,button_ctrl:!!r.ctrlKey,button_alt:!!r.altKey,button_meta:!!r.metaKey}}var hh=[[null,/(\W|^)GET (?:\s*)(\^?[\w.#@$?-]+)/g,"$1this.GET('$2')"],[/;SET/g,/(\W|^)SET (?:\s*)(\^?[\w.#@$?-]+)(?:\s*)=(?:\s*)([^;\r\n]*)(;?)/gm,"$1this.SET('$2', $3)$4 "],[/;PUT/g,/(\W|^)PUT (?:\s*)(\^?[\w.#@$?-]+)(?:\s*)=(?:\s*)([^;\r\n]*)(;?)/gm,"$1this.PUT('$2', $3)$4 "],[/;FIRE_AFTER/g,/(\W|^)FIRE_AFTER (?:\s*)(\^?[\w.#@$?-]+)(?:\s*)=(?:\s*)([^;\r\n]*)(;?)/g,"$1this.FIRE_AFTER('$2', $3)$4 "],[/;FIRE_AFTER/g,/(\W|^)FIRE_AFTER (?:\s*)(\^?[\w.#@$?-]+)(?:\s*)(;?)/g,"$1this.FIRE_AFTER('$2')$3 "],[/;FIRE/g,/(\W|^)FIRE (?:\s*)(\^?[\w.#@$?-]+)(?:\s*)=(?:\s*)([^;\r\n]*)(;?)/g,"$1this.FIRE('$2', $3)$4 "],[/;FIRE/g,/(\W|^)FIRE (?:\s*)(\^?[\w.#@$?-]+)(?:\s*)(;?)/g,"$1this.FIRE('$2')$3 "]],mh=/(\W|^)PUBLISH (?:\s*)(\^?[\w.#@$?-]+)/,gh=new Set(["arguments","await","break","case","catch","class","const","continue","debugger","default","delete","do","else","enum","eval","export","extends","false","finally","for","function","if","implements","import","in","instanceof","interface","let","new","null","package","private","protected","public","return","static","super","switch","this","throw","true","try","typeof","var","void","while","with","yield"]),As=class{#e;#t=new Map;constructor(e){this.#e=e}get runtime(){return this.#e}get size(){return[...this.#t.values()].reduce((e,t)=>e+t.size,0)}preprocess(e,t,n){let s=n.trim();if(mh.test(s))throw new Error(`${un(e,t)}: the PUBLISH macro is excluded from Gramlot 0.2.0`);let i=s.replace(/\$(\d+)/g,(a,o)=>`arguments[${parseInt(o,10)-1}]`);for(let[a,o,l]of hh)a&&(i=i.replace(a,`; ${a.source.slice(1)}`)),i=i.replace(o,l);return i!==s&&console.warn(`${un(e,t)}: legacy macros are deprecated; write this.GET(path), this.SET(path, value), this.PUT(path, value), this.FIRE(path, value), this.FIRE_AFTER(path, value) and arguments[n] in place of GET, SET, PUT, FIRE, FIRE_AFTER and $n`),i}compile(e,t,n,s,i=n){if(e.activatedCode(t)!==n)throw new Error(`${un(e,t)}: inline code runs only as received with the Source (main or a remote Source); a text written later is not run: use named logic`);let a=this.#t.get(e);a||(a=new Map,this.#t.set(e,a),this.runtime.bindingFor(e).track(()=>this.release(e)));let o=a.get(t);o?.source!==i&&(o={source:i,text:this.preprocess(e,t,i),key:null,run:null},a.set(t,o));let l=s.filter(Ul),u=l.join(",");if(o.key!==u){let c=_h(e,t,o.text,l);o.key=u,o.run=d=>c.apply(e,l.map(f=>d[f]))}return o.run}compileExpression(e,t,n){let s=n.slice(2),i=ye(e.getAttr()).filter(([,o])=>!Se(o)),a=this.compile(e,t,n,i.map(([o])=>o),`return ${s}`);return o=>{let l={};for(let[u,c]of i)if(Object.hasOwn(o,u))l[u]=o[u];else if(lr(c).length){if(Ul(u)&&new RegExp(`(?<![\\w$])${u.replaceAll("$","\\$")}(?![\\w$])`).test(s))throw new Error(`${e.nodeTag} '${e.label}': '${t}' uses '${u}', a template consumed by another template, whose value is not available; write a dataFormula`)}else l[u]=e.pointerType(c)?e.getRelativeData(c):c;return a(l)}}release(e,t=null){if(t===null){this.#t.delete(e);return}let n=this.#t.get(e);if(n)for(let s of t){n.delete(s);for(let[i]of ye({[s]:null}))n.delete(i)}}};function Ul(r){return/^[A-Za-z_$][\w$]*$/.test(r)&&!gh.has(r)}function un(r,e){return`${r.nodeTag} '${r.label}' ${e?`'${e}'`:"node value"}`}function _h(r,e,t,n){try{return t.startsWith("function")?new Function(`return (${t}
25
25
  )`)():new Function(...n,`${t}
26
- `)}catch(s){throw s instanceof EvalError?new EvalError(`${ln(r,e)}: inline code blocked by the Content Security Policy of the page (no 'unsafe-eval'); move the code to named logic (a method of the page's class Logic) or serve the page with the permissive CSP profile, which allows 'unsafe-eval'`,{cause:s}):new SyntaxError(`${ln(r,e)}: ${s.message} in the inline code:
27
- ${t}`,{cause:s})}}var Il={dataFormula:_s,dataController:bs,dataRpc:ws},ch=["datapath","_anchor","node_id","form","formId"],dr=class{#e;#t=new Map;#r=new Map;#s;#n;#i;#a=`gramlot-data-${crypto.randomUUID()}`;#u=!1;constructor(e){this.#e=e,this.#s=new ms(this),this.#n=new gs(this),this.#i=new ys(this)}get gramlot(){return this.#e}get builder(){return this.gramlot.src.builder}get renderer(){return this.gramlot.src.renderer}get logicRegistry(){return this.gramlot.src.logicRegistry}get data(){return this.builder.data}get root(){return this.data.parent}get size(){return this.#t.size}get disposed(){return this.#u}get router(){return this.#s}get installer(){return this.#n}get inlineCompiler(){return this.#i}get nodeIds(){return this.#r}attach(){this.root.subscribe(this.#a,{any:e=>this.receiveData(e)})}receiveData(e){this.router.deliver(e)}bindingFor(e){return this.#t.get(e)??null}openBinding(e){if(this.disposed)throw new Error("BindingRuntime is disposed");let t=this.bindingFor(e);return t||(t=new $i(this,e),this.#t.set(e,t)),t}closeBranch(e){let t=[];if(e.value instanceof D)for(let s of e.value.getNodes())try{this.closeBranch(s)}catch(i){t.push(i)}let n=this.bindingFor(e);if(n){this.#t.delete(e);let s=e.getAttr("node_id");this.nodeIds.get(s)===e&&this.nodeIds.delete(s);try{n.close()}catch(i){t.push(i)}}if(t.length)throw new AggregateError(t,"Source branch close failed")}rebindBranch(e){let t=this.#d(e);for(let n of t)this.bindingFor(n)?.rebind();for(let n of t)this.renderer.project(n)}handleSourceEvent(e){let{evt:t,node:n}=e,s=[],i=a=>{try{this.closeBranch(a)}catch(o){s.push(o)}};try{if(t==="ins")this.#l(n);else if(t==="del")for(let a of Array.isArray(n)?n:[n])i(a);else if(t==="upd_value"||t==="upd_value_attr"){if(e.oldvalue instanceof D)for(let a of e.oldvalue.getNodes())i(a);this.inlineCompiler.release(n,[""]),t==="upd_value_attr"?this.#c(n,e.attrs_diff):this.#p(n).rebind(),n.value instanceof D&&this.#l(n.value)}else if(t==="upd_attrs")this.#c(n,e.attrs_diff);else throw new Error(`Unsupported Source event: ${t}`)}catch(a){throw s.length?new AggregateError([...s,a],"Source event failed"):a}return s}branchBuilt(e){let t=[];for(let n of this.#d(e)){let s=this.bindingFor(n);!s||s.hasStamp("built")||!this.renderer.attached(n)||(s.stamp("built"),t.push(s))}for(let n of t)this.renderer.attached(n.node)&&this.#f(n,"built","_onBuilt");if(this.gramlot.state==="started")for(let n of t)this.renderer.attached(n.node)&&this.#o(n)}pageStarted(){for(let e of[...this.#t.values()])!e.closed&&e.hasStamp("built")&&this.#o(e)}dispose(){if(this.disposed)return;this.#u=!0,this.root.unsubscribe(this.#a,{any:!0}),this.nodeIds.clear();let e=[];for(let[t,n]of[...this.#t.entries()].reverse()){this.#t.delete(t);try{n.close()}catch(s){e.push(s)}}if(e.length)throw new AggregateError(e,"Binding cleanup failed")}#l(e){if(!(e instanceof D)&&this.bindingFor(e))return;let t=e instanceof D?e.getNodes().flatMap(i=>this.#d(i)):this.#d(e),n=new Set(t.filter(i=>this.bindingFor(i))),s=new Map;for(let i of t){let a=i.getAttr("node_id");if(a!=null){if(s.has(a)||this.nodeIds.has(a)&&this.nodeIds.get(a)!==i)throw new Error(`Duplicate node_id '${a}'`);s.set(a,i)}}for(let[i,a]of s)this.nodeIds.set(i,a);try{this.installer.install(e);for(let i of t)this.openBinding(i);for(let i of t)this.bindingFor(i).registerPointers()}catch(i){let a=[i];for(let o of t.filter(u=>!n.has(u)).reverse()){let u=o.getAttr("node_id");s.get(u)===o&&this.nodeIds.get(u)===o&&this.nodeIds.delete(u);let l=this.bindingFor(o);if(l){this.#t.delete(o);try{l.close()}catch(c){a.push(c)}}}throw a.length>1?new AggregateError(a,"Source branch installation failed"):i}for(let i of t){let a=this.bindingFor(i);if(!(!a||a.hasStamp("init")||!this.renderer.attached(i))&&(a.stamp("init"),Rl(i.getAttr("_init"))))for(let o of a.providers)o.invoke({kind:"init",change:null})}}#o(e){e.hasStamp("start")||(e.stamp("start"),this.#f(e,"start","_onStart"))}#f(e,t,n){let s=e.node.getAttr(n);if(Rl(s))for(let i of e.providers){if(typeof s!="number"||s<=0){i.invoke({kind:t,change:null});continue}let a=null,o=setTimeout(()=>{a(),i.invoke({kind:t,change:null})},s);a=e.track(()=>clearTimeout(o))}}#c(e,t){let n=this.#p(e);if(this.inlineCompiler.release(e,Object.keys(t)),Object.hasOwn(t,"node_id")){let{old:s,new:i}=t.node_id;if(i!=null&&this.nodeIds.has(i)&&this.nodeIds.get(i)!==e)throw new Error(`Duplicate node_id '${i}'`);this.nodeIds.get(s)===e&&this.nodeIds.delete(s),i!=null&&this.nodeIds.set(i,e)}ch.some(s=>Object.hasOwn(t,s))?this.rebindBranch(e):n.rebind()}#p(e){let t=this.bindingFor(e);if(!t)throw new Error(`${e.nodeTag??"fragment"} '${e.label}': the node has no NodeBinding (its installation failed); remove it from the Source and insert it again`);return t}#d(e){let t=[e];if(e.value instanceof D)for(let n of e.value.getNodes())t.push(...this.#d(n));return t}};function Rl(r){return r===!0||typeof r=="number"}var $i=class{#e;#t;#r=!1;#s=[];#n=[];#i=new Set;#a=null;#u=0;#l=null;constructor(e,t){this.#e=e,this.#t=t}get runtime(){return this.#e}get node(){return this.#t}get closed(){return this.#r}get registrations(){return[...this.#n]}get providers(){return this.#a?[this.#a]:[]}get clickCount(){return this.#u}countClick(){return++this.#u}hasStamp(e){return this.#i.has(e)}stamp(e){this.#i.add(e)}registerPointers(){let e=this.node,t=e._getMeta("data_element");if(!(t&&!Il[e.nodeTag])){for(let[n,s]of e.pointers()){if(t&&n!=="datapath")continue;let a=(n==="datapath"?e.parentNode:e).absDatapath(s);if(a===null)continue;let[o,u=null]=a.split("?",2),l=this.runtime.router.register({path:o,attr:u,recipient:this});this.#n.push(l),n==="datapath"&&(this.#l=l)}t&&(this.#a??=new Il[e.nodeTag](this),this.#a.register())}}rebind(){this.#o(),this.registerPointers()}receive(e){e.registration===this.#l?this.runtime.rebindBranch(this.node):this.runtime.renderer.project(this.node,e)}track(e){if(this.closed)throw new Error(`NodeBinding of '${this.node.label}' is closed`);return this.#s.push(e),()=>{let t=this.#s.indexOf(e);t!==-1&&this.#s.splice(t,1)}}close(){if(this.closed)return;this.#r=!0,this.#o();let e=[];for(let t of this.#s.splice(0).reverse())try{t()}catch(n){e.push(n)}if(e.length)throw new AggregateError(e,`NodeBinding of '${this.node.label}' cleanup failed`)}#o(){for(let e of this.#n.splice(0))e.close();this.#l=null}};var un=class extends It{static renderType="object";#e=new Set;#t=new WeakMap;#r=new WeakMap;constructor(e,t,n,{binding:s}={}){if(super(e),!(e instanceof he)||!(t instanceof se)||n?.nodeType!==1)throw new TypeError("GramlotRenderer requires a BuilderBase, GramlotBuilderBag and HTML destination");if(!(s instanceof dr))throw new TypeError("GramlotRenderer requires a BindingRuntime");if(!(t._builder instanceof he))throw new TypeError("SourceBag requires builder ownership");this._binding=s,this.source=t,this.destination=n,this.html=new ds({metadataAttributes:["__ref"]}),this.records=new Map,this.references=new sn(t),this.pending=[],this.building=!1,this.disposed=!1,this.elements=new WeakMap,this.instanceId=crypto.randomUUID(),this.radioGroups=new cs(this),this.subscription=`html-source-renderer-${this.instanceId}`,t.subscribe(this.subscription,{any:i=>this.receive(i)})}get binding(){return this._binding}get inlineCompiler(){return this.binding.inlineCompiler}evaluateExpressions(e,t){let n=this.#r.get(e)??super.evaluateExpressions(e,t);return this.#r.delete(e),this.#t.set(e,n),n}render(e,t={}){if(!(e instanceof Bt))throw new TypeError("Source children must be GramlotBuilderBagNodes");if(e._getMeta("data_element")||!this.binding.bindingFor(e)&&this.#a(e))return null;if(e.nodeTag)this.html.validate(e,e._getMeta("subbuilder")?e.parentBag._builder:e.builder);else if(!(e.value instanceof D))throw new TypeError("Source fragments must contain child SourceBags");return e.nodeTag?super.render(e,t):this.renderFragment(e,t)}renderFragment(e,{document:t=this.destination.ownerDocument,...n}={}){let s=t.createDocumentFragment(),i={node:e,binding:this.#p(e),container:null,parent:null,children:new Set,cleanup:[],start:t.createComment("source-fragment"),end:t.createComment("/source-fragment")};this.records.set(e,i),this.elements.set(s,i),s.append(i.start);for(let a of e.value.getNodes()){let o=this.render(a,{document:t,...n});if(o===null)continue;s.append(o);let u=this.elements.get(o);u&&(u.parent=i,i.children.add(a))}return s.append(i.end),s}renderedItem(e,t,n,{tag:s,document:i=this.destination.ownerDocument}={}){let a=n;t=this.expressionValue(e,t),this.getRender(e.builder)===this&&([t,a]=en(t,this.restoreNativeAttributes(e,n)));let o=Array.isArray(t)?t:[],u=Array.isArray(t)?a._text:t,l=this.#t.get(e),c={node:e,binding:this.#p(e),container:null,parent:null,children:new Set,cleanup:[],resolved:l,...this.html.create(e,i,s,a,l.visible??null)};this.html.compose(c,u,o),c.shape=me.shape(c.element,l),this.records.set(e,c),this.elements.set(c.element,c);let d=me.for(c.binding,c);d&&(c.control=d,d.attach(),c.cleanup.push(()=>d.detach()),this.#o(c,e,a,null));let f=fs.for(c.binding,c);f&&(c.button=f,f.attach(),c.cleanup.push(()=>f.detach())),this.#f(c),this.references?.register(e,c.element);for(let p of o){let h=this.elements.get(p);h&&(h.parent=c,h.container=c.element,c.children.add(h.node))}return c.element}validateCandidate(e,{replacingNode:t=null}={}){if(!(e instanceof se))throw new TypeError("Source values must be GramlotBuilderBags");let n=new Set,s=i=>{n.add(i);for(let a of this.records.get(i)?.children??[])s(a)};for(let i of this.records.get(t)?.children??[])s(i);return this.#s(e,t?t.nodeTag:null),Ri(e),this.references?.validate(e,n),e}#s(e,t=null){let n=new Set,s=(i,a=null)=>{if(!(i instanceof se)||n.has(i))throw new TypeError("Source values must be unshared, acyclic GramlotBuilderBags");if(!(i._builder instanceof he))throw new TypeError("SourceBag requires builder ownership");n.add(i);for(let o of i.getNodes()){if(!(o instanceof Bt))throw new TypeError("Source children must be GramlotBuilderBagNodes");if(!(o.builder instanceof he))throw new TypeError("SourceBagNode requires builder ownership");if(o.resolver)throw new TypeError("Source resolvers are outside this port");if(o._getMeta("data_element"))o.builder.validateNode(o);else if(o.nodeTag){let u=o._getMeta("subbuilder")?i._builder:o.builder;this.html.validate(o,u),o._getMeta("subbuilder")||o.builder.validateParent(o.nodeTag,a)}else{if(!(o.value instanceof D))throw new TypeError("Source fragments must contain child SourceBags");if(Object.keys(o.attr).some(u=>u!=="_meta"))throw new TypeError("Fragment attributes are unsupported")}o.value instanceof D&&s(o.value,o._getMeta("subbuilder")?null:o.nodeTag??a)}};s(e,t)}freeze(e){e=Ie(e);let t=this.records.get(e);if(!t||this.disposed)throw new Error("Freeze requires a mounted Source node");t.frozen=!0}unfreeze(e){e=Ie(e);let t=this.records.get(e);if(!t||this.disposed)throw new Error("Unfreeze requires a mounted Source node");let n=s=>{delete s.frozen;for(let i of s.children)n(this.records.get(i))};n(t),!this.#n(e)&&(this.attached(e)?this.#d(e):this.remove(e))}#n(e){for(;e;){let t=this.records.get(e);if(t?.frozen)return!0;e=e.parentBag?.parentNode??t?.parent?.node}return!1}receive(e){if(!this.disposed){if(Array.isArray(e.node)){let t=e.node.filter(n=>!this.#e.has(n));if(!t.length)return;e={...e,node:t}}else if(this.#e.has(e.node))return;if(this.pending.push(e),!this.building){this.building=!0;try{for(;this.pending.length;){let t=this.pending.shift();if(t.evt!=="del"&&!this.attached(t.node))continue;t.evt!=="del"&&t.evt!=="upd_attrs"&&this.#u(t);let n=this.binding.handleSourceEvent(t);try{this.#i(t,n)}catch(s){if(!n.length)throw s;n.push(s)}if(n.length)throw n.length===1?n[0]:new AggregateError(n,"Source cleanup failed")}}catch(t){throw this.pending.length=0,t}finally{this.building=!1}}}}#i(e,t){if(e.evt==="del"){for(let n of Array.isArray(e.node)?e.node:[e.node]){if(this.#n(n))continue;let s=this.records.get(n)?.parent??null;try{this.remove(n)}catch(i){t.push(i)}this.#c(s)}return}if(!this.#n(e.node))if(e.evt==="ins")this.insert(e.node);else if(e.evt.startsWith("upd_"))this.update(e.node,e.evt);else throw new Error(`Unsupported Source event: ${e.evt}`)}attached(e){let t=e.parentBag;for(;t&&t!==this.source;)t=t.parentNode?.parentBag;return t===this.source}#a(e){let t=new Set(this.pending.flatMap(n=>Array.isArray(n.node)?n.node:[n.node]));for(let n=e;n;n=n.parentBag?.parentNode)if(t.has(n))return!0;return!1}#u(e){let t=n=>{if(!(n instanceof Bt))throw new TypeError("Source children must be GramlotBuilderBagNodes");if(n.value instanceof D){if(!(n.value instanceof se))throw new TypeError("Source values must be GramlotBuilderBags");for(let s of n.value.getNodes())t(s)}};t(e.node)}insert(e){if(!this.attached(e)||this.records.has(e))return;if(e._getMeta("data_element")){this.records.get(e.parentBag?.parentNode)?.button?.refresh(),this.binding.branchBuilt(e);return}let t=this.records.get(e.parentBag?.parentNode),n=t?.element??t?.container??this.destination,s=e.parentBag.getNodes(),i=t?.end??null;for(let a=s.indexOf(e)+1;a<s.length;a++){let o=this.records.get(s[a]);if(o){i=o.element??o.start;break}}this.buildNode(e,n,i,t)}buildNode(e,t,n=null,s=null){this.#e.add(e);let i;try{i=this.render(e,{document:t.ownerDocument})}catch(o){this.#l(e,o)}finally{this.#e.delete(e)}let a=this.records.get(e);return t.insertBefore(i,n),a.parent=s,this.assignContainer(a,t),s?.children.add(e),this.#c(s),this.binding.branchBuilt(e),a}#l(e,t){let n=[t],s=[],i=a=>{if(s.push(a),a.value instanceof D)for(let o of a.value.getNodes())i(o)};i(e);for(let a of s.reverse())try{this.remove(a)}catch(o){n.push(o)}throw n.length===1?t:new AggregateError(n,"Source build and cleanup failed")}assignContainer(e,t){e.container=t;let n=e.element??t;for(let s of e.children){let i=this.records.get(s);i&&this.assignContainer(i,n)}}update(e,t){let n=this.records.get(e);if(!n){this.insert(e);return}let s=e.value==null||["string","number","boolean"].includes(typeof e.value),i=t==="upd_value"&&s&&n.element&&n.children.size===0&&this.html.matches(n,e);(t==="upd_attrs"||i)&&n.element&&this.html.matches(n,e)?(e.nodeTag&&this.html.validate(e,e._getMeta("subbuilder")?e.parentBag._builder:e.builder),this.project(e),t==="upd_attrs"&&this.records.get(e)===n&&(this.references?.remove(e),this.references?.register(e,n.element))):this.#d(e)}project(e,t=null){let n=this.records.get(e);if(!n?.element)return;let s=this.getRender(e.builder),[i,a]=e.builder.runtimeValues(e),[,o]=s._handleMeta(e,a),u=this.#t.get(e);if(n.shape!==me.shape(n.element,u)){if(this.#n(e))return;this.#r.set(e,u);try{this.#d(e)}finally{this.#r.delete(e)}return}n.resolved=u;let l=e._getMeta("subbuilder")?o:s.adaptAttrs(o),c=e.value instanceof D,d=c?[]:this.expressionValue(e,i);s===this&&([d,l]=en(d,this.restoreNativeAttributes(e,l))),this.html.update(n,e,l,c?l._text:d,u.visible??null),this.#o(n,e,l,t),n.control?.refresh(),n.button?.refresh(),this.#f(n),(n.element.localName==="option"||n.element.localName==="optgroup")&&this.#c(n.parent)}#o(e,t,n,s){if(!e.control)return;let i=t.getAttr("value")!=null;(i||e.valueDeclared)&&e.control.project(n.value??null,s),e.valueDeclared=i}#f(e){let t=new Map(nn.declared(e.node).map(n=>[n[0],n]));if(!e.events){if(!t.size)return;e.events=new Map,e.cleanup.push(()=>{for(let n of e.events.values())n.detach();e.events.clear()})}for(let[n,s]of[...e.events])t.get(n)?.[2]!==s.handler&&(s.detach(),e.events.delete(n));for(let[n,[,s,i]]of t){if(e.events.has(n))continue;let a=new nn(e.binding,e,s,i,n);a.attach(),e.events.set(n,a)}}#c(e){for(let t=e;t;t=t.parent){if(t.control instanceof rn){this.project(t.node);return}if(t.element&&t.element.localName!=="optgroup")return}}getDomNode(e){let t=Ie(e),n=this.records.get(t);return n&&this.attached(t)?n.element??null:null}getBaseSourceNode(e){for(let t=e;t;t=t.parentNode){let n=t.nodeType===1?this.elements.get(t):null;if(n)return this.attached(n.node)?n.node:null}return null}#p(e){let t=this.binding.bindingFor(e);if(!t)throw new Error(`${e.nodeTag??"fragment"} '${e.label}': rendered without an open NodeBinding`);return t}#d(e){let t=this.records.get(e),n=t.element?.nextSibling??t.end?.nextSibling??null,s=t.container,i=t.parent,a=null;try{this.remove(e)}catch(o){a=o}try{this.buildNode(e,s,n,i)}catch(o){throw a?new AggregateError([a,o],"Source replacement cleanup and commit failed"):o}if(a)throw a}onDispose(e,t){let n=this.records.get(e);if(!n)throw new Error("Source node is not mounted");return n.cleanup.push(t),()=>{let s=n.cleanup.indexOf(t);s!==-1&&n.cleanup.splice(s,1)}}remove(e){let t=this.records.get(e);if(!t)return;let n=[];for(let s of[...t.children])try{this.remove(s)}catch(i){n.push(i)}for(let s of t.cleanup.splice(0).reverse())try{s()}catch(i){n.push(i)}if(this.references?.remove(e),t.element&&this.elements.delete(t.element),t.element?.remove(),t.start?.remove(),t.end?.remove(),t.parent?.children.delete(e),this.records.delete(e),n.length)throw new AggregateError(n,"Source cleanup failed")}dispose(){if(this.disposed)return;this.disposed=!0,this.source.unsubscribe(this.subscription,{any:!0}),this.pending.length=0;let e=[],t=[...this.records.entries()].filter(([,n])=>!n.parent).map(([n])=>n);for(let n of t)try{this.remove(n)}catch(s){e.push(s)}if(e.length)throw new AggregateError(e,"Renderer cleanup failed")}};var dh=new Set(["page","constructor"]);function Ml(r,e){if(r===null)return[];let t=r.split("/");for(let n of t)if(dh.has(n))throw new Error(`${e}: a logic group cannot be named '${n}' (group '${r}')`);return t}var fh=new Set(["return","typeof","instanceof","in","of","new","delete","void","throw","case","do","else","yield","await"]);function ph(r){return/^[\w$]/.test(r)?fh.has(r):r!==")"&&r!=="]"}function hh(r,e){let t=!1;for(let n=e+1;n<r.length;n++){let s=r[n];if(s===`
28
- `)return-1;if(s==="\\"){n++;continue}if(s==="[")t=!0;else if(s==="]")t=!1;else if(s==="/"&&!t)return n}return-1}function mh(r){let e=0,t="",n="";for(let s=r.indexOf("{");s<r.length;s++){let i=r[s];if(i==="/"&&r[s+1]==="/"){if(s=r.indexOf(`
29
- `,s),s<0)break;continue}if(i==="/"&&r[s+1]==="*"){let a=r.indexOf("*/",s+2);if(a>=0){s=a+1;continue}}if(i==="/"&&ph(n)){let a=hh(r,s);if(a>=0){s=a,n=")";continue}}if(i==='"'||i==="'"||i==="`"){let a=s+1;for(;a<r.length&&r[a]!==i;)a+=r[a]==="\\"?2:1;e===1&&(t+=r.slice(s+1,a)==="constructor"?" constructor":' ""'),s=a,n=")";continue}if(/[\w$]/.test(i)){let a=s+1;for(;a<r.length&&/[\w$]/.test(r[a]);)a++;e===1&&(t+=r.slice(s,a)),n=r.slice(s,a),s=a-1;continue}if(/\s/.test(i)||(n=i),i==="{"){++e===2&&(t+=" {}");continue}if(i==="}"){e--;continue}e===1&&(t+=i)}return/(?<![\w$.#])(?<!\bstatic\s+)constructor\s*\(/.test(t)}function $l(r,e){if(typeof r!="function"||!/^class\b/.test(Function.prototype.toString.call(r)))throw new Error(`${e}: the module exports no class Logic`);if(Object.getPrototypeOf(r)!==Function.prototype||Object.getPrototypeOf(r.prototype)!==Object.prototype)throw new Error(`${e}: class Logic cannot extend another class`);if(mh(Function.prototype.toString.call(r)))throw new Error(`${e}: class Logic cannot declare a constructor; state lives on the group or the page`);let t=[];for(let n of Reflect.ownKeys(r.prototype)){if(n==="constructor")continue;if(typeof n=="symbol")throw new Error(`${e}: class Logic cannot declare symbol keys (${String(n)})`);let s=Object.getOwnPropertyDescriptor(r.prototype,n);if(s.get||s.set)throw new Error(`${e}: class Logic cannot declare the accessor '${n}'`);if(typeof s.value!="function")throw new Error(`${e}: Logic.prototype.${n} is not a method`);if(n==="page")throw new Error(`${e}: a logic method cannot be named 'page'`);t.push([n,s.value])}return t}function Ll(r,e,t){Object.defineProperty(r,e,{value:t,writable:!0,enumerable:!0,configurable:!0})}var Mt=class{#e;#t;constructor(e,t){this.#e=e,this.#t=t}get page(){return this.#t}},fr=class{#e;#t=new Map;constructor(e){this.#e=e,e.logic=new Mt(this,e)}get gramlot(){return this.#e}static check(e){let t=new Map;for(let{group:n,resource:s}of e){let i=Ml(n,s);for(let a=0;a<i.length;a++){let o=i.slice(0,a).join("/");t.has(o)||t.set(o,new Set),t.get(o).add(i[a])}}for(let{logicClass:n,group:s,resource:i}of e){let a=t.get(s??"")??new Set;for(let[o]of $l(n,i))if(a.has(o))throw new Error(`${i}: the logic method '${o}' has the name of a child group`)}}register(e,{group:t=null,resource:n}){let s=Ml(t,n),i=$l(e,n),a=this.#e.logic;for(let o of s){let u=Object.getOwnPropertyDescriptor(a,o)?.value;if(u===void 0){let l=new Mt(this,this.#e);Ll(a,o,l),a=l}else if(u instanceof Mt)a=u;else throw new Error(`${n}: the group '${o}' has the name of a logic method`)}for(let[o,u]of i){if(Object.getOwnPropertyDescriptor(a,o)?.value instanceof Mt)throw new Error(`${n}: the logic method '${o}' has the name of a child group`);Ll(a,o,u)}this.#t.has(a)||this.#t.set(a,[]),this.#t.get(a).push(n)}resolve(e,t){let n=e.split("."),s=n.pop(),i=this.#e.logic;for(let o=0;o<n.length;o++)if(i=Object.getOwnPropertyDescriptor(i,n[o])?.value,!(i instanceof Mt))throw new Error(`${t.nodeTag} '${t.label}': named logic '${e}' not found: no resource was registered for the group '${n.slice(0,o+1).join("/")}'`);let a=Object.getOwnPropertyDescriptor(i,s)?.value;if(typeof a!="function"){let o=this.#t.get(i)??[],u=n.length?`the group '${n.join("/")}'`:"the page logic";throw new Error(`${t.nodeTag} '${t.label}': named logic '${e}' not found: ${u} has no method '${s}' (resources: ${o.join(", ")||"none"})`)}return{group:i,method:a}}};var cn=class extends Re{constructor(e,{collections:t,destination:n}){super(e),e.src=this,this.logicRegistry=new fr(e),this.builder=new Qe(null,{collections:t}),this.binding=new dr(e),this.builder.binding=this.binding,this.binding.attach(),this.source=this.builder.source,this.renderer=new un(this.builder,this.source,n,{binding:this.binding})}startSource(e){if(!["ready","failed"].includes(this.gramlot.state))throw new Error(`Cannot start embedded Source while Gramlot is ${this.gramlot.state}`);try{return this.mountMainSource(e)}catch(t){throw this.gramlot.state="failed",t}}mountMainSource(e){let t=this.prepareSource(e);this.renderer.validateCandidate(t);try{this.source.setItem("main",t)}catch(n){throw this.binding.bindingFor(this.source.getNode("main"))||this.source.popNode("main"),n}return this.gramlot.state="started",this.binding.pageStarted(),this.gramlot}prepareSource(e,t=this.builder){if(e instanceof D){if(!(e instanceof se))throw new TypeError("Source values must be GramlotBuilderBags");return e.bindBuilder(t).activateCode()}if(typeof e!="string")throw new TypeError("Source value did not decode to SourceBag");let n=Ei(e,t);if(!(n instanceof se))throw new TypeError("Source values must be GramlotBuilderBags");return n.activateCode()}async remoteSource(e,t,n={}){let s=this.gramlot.rpc;if(!s.transport?.call)throw new Error("Remote Source is unavailable without a server transport");let i=this.binding.bindingFor(e);if(this.gramlot.state!=="started"||!i)throw new Error("Remote Source target is not mounted");s.remoteRequests.get(e)?.controller.abort();let a={controller:new AbortController};s.remoteRequests.set(e,a);let o=i.track(()=>a.controller.abort()),u=!1,l=()=>this.gramlot.state!=="disposed"&&!a.controller.signal.aborted&&s.remoteRequests.get(e)===a&&!i.closed;try{let c=await s.call("source",t,n,{signal:a.controller.signal});if(!l())return!1;let d=this.prepareSource(c,e.builder);return l()?(this.renderer.validateCandidate(d,{replacingNode:e}),u=!0,o(),e.setValue(d,!0,{_text:null},!0),!0):!1}catch(c){if(!u&&!l())return!1;throw c}finally{o(),s.remoteRequests.get(e)===a&&s.remoteRequests.delete(e)}}};var gh=()=>Array.from(globalThis.crypto.getRandomValues(new Uint8Array(16)),r=>r.toString(16).padStart(2,"0")).join(""),vs=class extends Error{name="RpcError";constructor({code:e,name:t,message:n,details:s}){super(n),this.code=e,this.remoteName=t,s!==void 0&&(this.details=s)}},dn=class extends Re{constructor(e,{rpcUrl:t,closeUrl:n,document:s,transport:i}){super(e),this.transport=i===!1?null:i??new Me(t,{closeUrl:n,navigator:s.defaultView.navigator}),this.remoteRequests=new Map}async call(e,t,n={},{signal:s}={}){if(!this.transport?.call)throw new Error(`rpc '${t}' is unavailable without a server transport`);let i=gh(),a=le({id:i,pageId:this.gramlot.pageId,contentType:e,name:t,params:n}),o=H(await this.transport.call(a,s));if(o.id!==i)throw new Error("rpc response id mismatch");if(o.error)throw new vs(o.error);return o.value}};var fn=class extends Re{reference(e){return this.gramlot.src.renderer.references.resolve(e)}getBaseSourceNode(e){return this.gramlot.src.renderer.getBaseSourceNode(e)}getDomNode(e){return this.gramlot.src.renderer.getDomNode(e)}};var Fl=2e3;function _h(r){if(!(r instanceof Date))return String(r??"");let e=r.toISOString();return e.endsWith("T00:00:00.000Z")?e.slice(0,10):e}var pn=class{constructor(e,t){this.gramlot=e,this.document=t}branch(e){let t=this.gramlot.data.getItem(e);if(!(t instanceof P))throw new Error(`gramlot.utl.inout: no data Bag at '${e}'`);return t}mailText(e){let t=[],n=(s,i)=>{for(let a of s.getNodes()){let o=i+a.label;a.value instanceof P?n(a.value,`${o}.`):t.push(`${o}: ${_h(a.value)}`)}};return n(this.branch(e),""),t.join(`
30
- `)}mailtoUrl(e,t){let n=`mailto:${encodeURIComponent(t)}?subject=${encodeURIComponent(this.document.title)}&body=${encodeURIComponent(this.mailText(e))}`;if(n.length>Fl)throw new Error(`gramlot.utl.inout.sendMail: the email of '${e}' is ${n.length} characters long, over the mailto: limit of ${Fl}; send it with sendHttp or save it as a file`);return n}sendMail(e,t){this.open(this.mailtoUrl(e,t))}async sendHttp(e,t){let n=JSON.stringify(this.branch(e).asDict(!1,!1,!0)),s=await this.document.defaultView.fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:n});if(!s.ok)throw new Error(`gramlot.utl.inout.sendHttp: ${t} answered ${s.status}`);return s}save(e,t){this.saveText(this.branch(e).toTytx(),t,"application/json")}restore(e){let t=this.document.createElement("input");return t.type="file",t.accept=".json,application/json",new Promise((n,s)=>{t.addEventListener("change",async()=>{try{let i=P.fromTytx(await t.files[0].text());this.gramlot.data.setItem(e,i),n(i)}catch(i){s(new Error(`gramlot.utl.inout.restore: the file is not a saved Gramlot branch: ${i.message}`,{cause:i}))}},{once:!0}),t.click()})}download(e,t,n){if(!["json","xml"].includes(n))throw new Error(`gramlot.utl.inout.download: format '${n}' is not 'json' or 'xml'`);let s=this.branch(e);if(n==="json")this.saveText(s.toJson(!1),t,"application/json");else{let i=e.split(".").at(-1);this.saveText(`<?xml version='1.0' encoding='UTF-8'?>
31
- <${i}>${s.toXml()}</${i}>`,t,"application/xml")}}saveText(e,t,n){let s=this.document.defaultView,i=s.URL.createObjectURL(new s.Blob([e],{type:n}));this.open(i,t),s.setTimeout(()=>s.URL.revokeObjectURL(i),1e3)}open(e,t=null){let n=this.document.createElement("a");n.href=e,t!==null&&(n.download=t),n.click()}};var hn=class extends Re{constructor(e,t){super(e),this.inout=new pn(e,t)}};var mn=class{constructor({pageId:e,rpcUrl:t="/gramlot/rpc",closeUrl:n="/gramlot/close",rootId:s="gramlot-root",capabilities:i=[],element:a=null,document:o=globalThis.document,transport:u=null,collections:l=[]}={}){this.pageId=e,this.capabilities=Object.freeze([...i]),this.src=new cn(this,{collections:l,destination:a??o.getElementById(s)}),this.data=this.src.builder.data,this.rpc=new dn(this,{rpcUrl:t,closeUrl:n,document:o,transport:u}),this.dom=new fn(this),this.utl=new hn(this,o),this.state="ready",this.abort=new AbortController,this.rpc.transport instanceof Me&&(this.pagehide=c=>{c.persisted||this.dispose({beacon:!0})},o.defaultView.addEventListener("pagehide",this.pagehide),this.window=o.defaultView)}start(){return this.state==="disposed"?Promise.reject(new Error("Gramlot is disposed")):this.rpc.transport?this.loading?this.loading:this.state==="started"?Promise.resolve(this):(this.state="loading",this.loading=this.loadMain().finally(()=>{this.loading=null}),this.loading):Promise.reject(new Error("This Gramlot instance has no server transport"))}async loadMain(){try{let e=await this.rpc.call("source","main",{},{signal:this.abort.signal});if(this.state==="disposed")throw new Error("Gramlot was disposed during main");return this.src.mountMainSource(e)}catch(e){throw this.state!=="disposed"&&(this.state="failed"),e}}dispose({beacon:e=!1}={}){if(this.state!=="disposed"){this.state="disposed",this.pagehide&&this.window.removeEventListener("pagehide",this.pagehide),this.abort.abort();for(let t of this.rpc.remoteRequests.values())t.controller.abort();this.rpc.remoteRequests.clear();try{try{this.src.binding.dispose()}finally{this.src.renderer.dispose()}}finally{this.rpc.transport instanceof Me&&this.rpc.transport.close(this.pageId,{beacon:e}),this.rpc.transport?.dispose?.()}}}};var Li=class{constructor({config:e,resources:t,document:n=globalThis.document}){this.config=e,this.resources=t,this.document=n}async run(){let{config:e,resources:t,document:n}=this,s=n.defaultView;for(let l of t.css){let c=n.createElement("link");c.rel="stylesheet",c.href=l,n.head.append(c)}let i=!1,a=l=>{l.persisted||i||(i=!0,this.closePage())};s.addEventListener("pagehide",a);let o;try{let l=await Promise.allSettled(t.js.map(({url:c})=>import(new URL(c,n.baseURI).href)));if(i)return null;o=t.js.map(({url:c,group:d},f)=>{let p=l[f];if(p.status==="rejected")throw new Error(`${c}: import failed: ${p.reason?.message??p.reason}`,{cause:p.reason});return{logicClass:p.value.Logic,group:d,resource:c}}),fr.check(o)}catch(l){throw this.closePage(),l}finally{s.removeEventListener("pagehide",a)}let u=new mn({...e,document:n});for(let{logicClass:l,group:c,resource:d}of o)u.src.logicRegistry.register(l,{group:c,resource:d});return s.gramlot=u,await u.start(),u}closePage(){let{rpcUrl:e,closeUrl:t,pageId:n}=this.config;new Me(e,{closeUrl:t,navigator:this.document.defaultView.navigator}).close(n,{beacon:!0})}};var Es=Symbol("gramlot.source"),Ui=Symbol("gramlot.endpoint"),bh=new Map([[Es,"registerSource"],[Ui,"registerEndpoint"]]);function Ul(r,e,t,n){let s=bh.get(t);if(e==="main")throw new TypeError(`${s} cannot declare main`);let i=Object.getOwnPropertyDescriptor(r.prototype,e)?.value;if(typeof i!="function")throw new TypeError(`${s} requires an own method of ${r.name}: ${String(e)}`);if(i[t])throw new TypeError(`${t===Es?"Source method":"Endpoint"} already registered: ${e}`);if(i[Es]||i[Ui])throw new TypeError(`${e} is declared both as Source method and endpoint`);i[t]={auth:n}}var Fi=class{static title="Gramlot";static css=[];static css_requires="";static js_requires="";static sourceBuilder=Qe;main(e){throw new Error("Page.main(root) must be implemented")}static registerSource(e,{auth:t=null}={}){Ul(this,e,Es,t)}static registerEndpoint(e,{auth:t=null}={}){Ul(this,e,Ui,t)}};export{P as Bag,Oe as BagNode,fn as DomHandler,mn as Gramlot,Qe as GramlotBuilder,It as GramlotHtmlRenderer,un as GramlotRenderer,tn as GramlotSvgRenderer,Re as Handler,Me as HttpTransport,pn as InOut,Fi as Page,Li as PageBootstrap,sn as References,vs as RpcError,dn as RpcHandler,cn as SourceHandler,hn as UtilitiesHandler};
26
+ `)}catch(s){throw s instanceof EvalError?new EvalError(`${un(r,e)}: inline code blocked by the Content Security Policy of the page (no 'unsafe-eval'); move the code to named logic (a method of the page's class Logic) or serve the page with the permissive CSP profile, which allows 'unsafe-eval'`,{cause:s}):new SyntaxError(`${un(r,e)}: ${s.message} in the inline code:
27
+ ${t}`,{cause:s})}}var Ts=class{#e;#t=null;constructor(e){this.#e=e}get binding(){return this.#e}get node(){return this.binding.node}get closed(){return this.binding.closed}async update(){if(this.closed||!this.binding.hasStamp("start"))return;let e=this.node,[,t]=e.builder.runtimeValues(e),n=t.remote;if(!n)return;let s={};for(let[l,u]of Object.entries(t))l.startsWith("remote_")&&(s[l.slice(7)]=u);let i=e.getAttr("_if");if(i&&!this.#r("_if",i,`return (${i})`,s)){this.binding.runtime.gramlot.rpc.remoteRequests.get(e)?.controller.abort();let l=e.getAttr("_else");l&&this.#r("_else",l,l,s);return}if(t._cachedRemote&&this.#t&&qi(s,this.#t))return;let a;try{a=await this.binding.runtime.gramlot.src.remoteSource(e,n,s)}catch(l){throw new Error(`${e.nodeTag} '${e.label}': remote '${n}' failed: ${l.message}`,{cause:l})}a&&(this.#t=s);let o=e.getAttr("_onRemote");a&&o&&this.#r("_onRemote",o,o,s)}#r(e,t,n,s){return this.binding.runtime.inlineCompiler.compile(this.node,e,t,Object.keys(s),n)(s)}};function qi(r,e){if(Object.is(r,e))return!0;if(r instanceof Date&&e instanceof Date)return r.getTime()===e.getTime();if(Array.isArray(r)&&Array.isArray(e))return r.length===e.length&&r.every((n,s)=>qi(n,e[s]));if(!Pl(r)||!Pl(e))return!1;let t=Object.keys(r);return t.length===Object.keys(e).length&&t.every(n=>Object.hasOwn(e,n)&&qi(r[n],e[n]))}function Pl(r){return r!==null&&typeof r=="object"&&Object.getPrototypeOf(r)===Object.prototype}var ql={dataFormula:ys,dataController:vs,dataRpc:Es,dataRemote:ks},bh=["datapath","_anchor","node_id","form","formId"],fr=class{#e;#t=new Map;#r=new Map;#s;#n;#i;#a=`gramlot-data-${crypto.randomUUID()}`;#u=!1;constructor(e){this.#e=e,this.#s=new gs(this),this.#n=new _s(this),this.#i=new As(this)}get gramlot(){return this.#e}get builder(){return this.gramlot.src.builder}get renderer(){return this.gramlot.src.renderer}get logicRegistry(){return this.gramlot.src.logicRegistry}get data(){return this.builder.data}get root(){return this.data.parent}get size(){return this.#t.size}get disposed(){return this.#u}get router(){return this.#s}get installer(){return this.#n}get inlineCompiler(){return this.#i}get nodeIds(){return this.#r}attach(){this.root.subscribe(this.#a,{any:e=>this.receiveData(e)})}receiveData(e){this.router.deliver(e)}bindingFor(e){return this.#t.get(e)??null}openBinding(e){if(this.disposed)throw new Error("BindingRuntime is disposed");let t=this.bindingFor(e);return t||(t=new ji(this,e),this.#t.set(e,t)),t}closeBranch(e){let t=[];if(e.value instanceof T)for(let s of e.value.getNodes())try{this.closeBranch(s)}catch(i){t.push(i)}let n=this.bindingFor(e);if(n){this.#t.delete(e);let s=e.getAttr("node_id");this.nodeIds.get(s)===e&&this.nodeIds.delete(s);try{n.close()}catch(i){t.push(i)}}if(t.length)throw new AggregateError(t,"Source branch close failed")}rebindBranch(e){let t=this.#d(e);for(let n of t)this.bindingFor(n)?.rebind();for(let n of t)this.renderer.project(n);for(let n of t)this.bindingFor(n)?.remote?.update()}handleSourceEvent(e){let{evt:t,node:n}=e,s=[],i=a=>{try{this.closeBranch(a)}catch(o){s.push(o)}};try{if(t==="ins")this.#c(n);else if(t==="del")for(let a of Array.isArray(n)?n:[n])i(a);else if(t==="upd_value"||t==="upd_value_attr"){if(e.oldvalue instanceof T)for(let a of e.oldvalue.getNodes())i(a);this.inlineCompiler.release(n,[""]),t==="upd_value_attr"?this.#l(n,e.attrs_diff):this.#p(n).rebind(),n.value instanceof T&&this.#c(n.value)}else if(t==="upd_attrs")this.#l(n,e.attrs_diff);else throw new Error(`Unsupported Source event: ${t}`)}catch(a){throw s.length?new AggregateError([...s,a],"Source event failed"):a}return s}branchBuilt(e){let t=[];for(let n of this.#d(e)){let s=this.bindingFor(n);!s||s.hasStamp("built")||!this.renderer.attached(n)||(s.stamp("built"),t.push(s))}for(let n of t)this.renderer.attached(n.node)&&this.#o(n,"built","_onBuilt");if(this.gramlot.state==="started")for(let n of t)this.renderer.attached(n.node)&&this.#f(n)}pageStarted(){for(let e of[...this.#t.values()])!e.closed&&e.hasStamp("built")&&this.#f(e)}dispose(){if(this.disposed)return;this.#u=!0,this.root.unsubscribe(this.#a,{any:!0}),this.nodeIds.clear();let e=[];for(let[t,n]of[...this.#t.entries()].reverse()){this.#t.delete(t);try{n.close()}catch(s){e.push(s)}}if(e.length)throw new AggregateError(e,"Binding cleanup failed")}#c(e){if(!(e instanceof T)&&this.bindingFor(e))return;let t=e instanceof T?e.getNodes().flatMap(i=>this.#d(i)):this.#d(e),n=new Set(t.filter(i=>this.bindingFor(i))),s=new Map;for(let i of t){let a=i.getAttr("node_id");if(a!=null){if(s.has(a)||this.nodeIds.has(a)&&this.nodeIds.get(a)!==i)throw new Error(`Duplicate node_id '${a}'`);s.set(a,i)}}for(let[i,a]of s)this.nodeIds.set(i,a);try{this.installer.install(e);for(let i of t)this.openBinding(i);for(let i of t)this.bindingFor(i).registerPointers()}catch(i){let a=[i];for(let o of t.filter(l=>!n.has(l)).reverse()){let l=o.getAttr("node_id");s.get(l)===o&&this.nodeIds.get(l)===o&&this.nodeIds.delete(l);let u=this.bindingFor(o);if(u){this.#t.delete(o);try{u.close()}catch(c){a.push(c)}}}throw a.length>1?new AggregateError(a,"Source branch installation failed"):i}for(let i of t){let a=this.bindingFor(i);if(!(!a||a.hasStamp("init")||!this.renderer.attached(i))&&(a.stamp("init"),jl(i.getAttr("_init"))))for(let o of a.providers)o.invoke({kind:"init",change:null})}}#f(e){e.hasStamp("start")||(e.stamp("start"),this.#o(e,"start","_onStart"),e.remote?.update())}#o(e,t,n){let s=e.node.getAttr(n);if(jl(s))for(let i of e.providers){if(typeof s!="number"||s<=0){i.invoke({kind:t,change:null});continue}let a=null,o=setTimeout(()=>{a(),i.invoke({kind:t,change:null})},s);a=e.track(()=>clearTimeout(o))}}#l(e,t){let n=this.#p(e);if(this.inlineCompiler.release(e,Object.keys(t)),Object.hasOwn(t,"node_id")){let{old:s,new:i}=t.node_id;if(i!=null&&this.nodeIds.has(i)&&this.nodeIds.get(i)!==e)throw new Error(`Duplicate node_id '${i}'`);this.nodeIds.get(s)===e&&this.nodeIds.delete(s),i!=null&&this.nodeIds.set(i,e)}bh.some(s=>Object.hasOwn(t,s))?this.rebindBranch(e):n.rebind()}#p(e){let t=this.bindingFor(e);if(!t)throw new Error(`${e.nodeTag??"fragment"} '${e.label}': the node has no NodeBinding (its installation failed); remove it from the Source and insert it again`);return t}#d(e){let t=[e];if(e.value instanceof T)for(let n of e.value.getNodes())t.push(...this.#d(n));return t}};function jl(r){return r===!0||typeof r=="number"}var ji=class{#e;#t;#r=!1;#s=[];#n=[];#i=new Set;#a=null;#u=null;#c=new Set;#f=0;#o=null;constructor(e,t){this.#e=e,this.#t=t}get runtime(){return this.#e}get node(){return this.#t}get closed(){return this.#r}get registrations(){return[...this.#n]}get providers(){return this.#a?[this.#a]:[]}get remote(){return this.#u}get clickCount(){return this.#f}countClick(){return++this.#f}hasStamp(e){return this.#i.has(e)}stamp(e){this.#i.add(e)}registerPointers(){let e=this.node,t=e._getMeta("data_element");if(!(t&&!ql[e.nodeTag])){!t&&typeof e.getAttr("remote")=="string"&&(this.#u??=new Ts(this));for(let[n,s]of e.pointers()){if(t&&n!=="datapath")continue;let a=(n==="datapath"?e.parentNode:e).absDatapath(s);if(a===null)continue;let[o,l=null]=a.split("?",2),u=this.runtime.router.register({path:o,attr:l,recipient:this});this.#n.push(u),n==="datapath"&&(this.#o=u),this.remote&&(n==="remote"||n.startsWith("remote_"))&&this.#c.add(u)}t&&(this.#a??=new ql[e.nodeTag](this),this.#a.register())}}rebind(){this.#l(),this.registerPointers()}receive(e){if(e.registration===this.#o){this.runtime.rebindBranch(this.node);return}this.#c.has(e.registration)&&this.remote.update(),this.runtime.renderer.project(this.node,e)}track(e){if(this.closed)throw new Error(`NodeBinding of '${this.node.label}' is closed`);return this.#s.push(e),()=>{let t=this.#s.indexOf(e);t!==-1&&this.#s.splice(t,1)}}close(){if(this.closed)return;this.#r=!0,this.#l();let e=[];for(let t of this.#s.splice(0).reverse())try{t()}catch(n){e.push(n)}if(e.length)throw new AggregateError(e,`NodeBinding of '${this.node.label}' cleanup failed`)}#l(){for(let e of this.#n.splice(0))e.close();this.#o=null,this.#c.clear()}};var cn=class extends It{static renderType="object";#e=new Set;#t=new WeakMap;#r=new WeakMap;constructor(e,t,n,{binding:s}={}){if(super(e),!(e instanceof he)||!(t instanceof se)||n?.nodeType!==1)throw new TypeError("GramlotRenderer requires a BuilderBase, GramlotBuilderBag and HTML destination");if(!(s instanceof fr))throw new TypeError("GramlotRenderer requires a BindingRuntime");if(!(t._builder instanceof he))throw new TypeError("SourceBag requires builder ownership");this._binding=s,this.source=t,this.destination=n,this.html=new fs({metadataAttributes:["__ref"]}),this.records=new Map,this.references=new on(t),this.pending=[],this.building=!1,this.disposed=!1,this.elements=new WeakMap,this.instanceId=crypto.randomUUID(),this.radioGroups=new ds(this),this.subscription=`html-source-renderer-${this.instanceId}`,t.subscribe(this.subscription,{any:i=>this.receive(i)})}get binding(){return this._binding}get inlineCompiler(){return this.binding.inlineCompiler}evaluateExpressions(e,t){let n=this.#r.get(e)??super.evaluateExpressions(e,t);return this.#r.delete(e),this.#t.set(e,n),n}render(e,t={}){if(!(e instanceof Bt))throw new TypeError("Source children must be GramlotBuilderBagNodes");if(e._getMeta("data_element")||!this.binding.bindingFor(e)&&this.#a(e))return null;if(e.nodeTag)this.html.validate(e,e._getMeta("subbuilder")?e.parentBag._builder:e.builder);else if(!(e.value instanceof T))throw new TypeError("Source fragments must contain child SourceBags");return e.nodeTag?super.render(e,t):this.renderFragment(e,t)}renderFragment(e,{document:t=this.destination.ownerDocument,...n}={}){let s=t.createDocumentFragment(),i={node:e,binding:this.#p(e),container:null,parent:null,children:new Set,cleanup:[],start:t.createComment("source-fragment"),end:t.createComment("/source-fragment")};this.records.set(e,i),this.elements.set(s,i),s.append(i.start);for(let a of e.value.getNodes()){let o=this.render(a,{document:t,...n});if(o===null)continue;s.append(o);let l=this.elements.get(o);l&&(l.parent=i,i.children.add(a))}return s.append(i.end),s}renderedItem(e,t,n,{tag:s,document:i=this.destination.ownerDocument}={}){let a=n;t=this.expressionValue(e,t),this.getRender(e.builder)===this&&([t,a]=rn(t,this.restoreNativeAttributes(e,n)));let o=Array.isArray(t)?t:[],l=Array.isArray(t)?a._text:t,u=this.#t.get(e),c={node:e,binding:this.#p(e),container:null,parent:null,children:new Set,cleanup:[],resolved:u,...this.html.create(e,i,s,a,u.visible??null)};this.html.compose(c,l,o),c.shape=me.shape(c.element,u),this.records.set(e,c),this.elements.set(c.element,c);let d=me.for(c.binding,c);d&&(c.control=d,d.attach(),c.cleanup.push(()=>d.detach()),this.#f(c,e,a,null));let f=ps.for(c.binding,c);f&&(c.button=f,f.attach(),c.cleanup.push(()=>f.detach())),this.#o(c),this.references?.register(e,c.element);for(let p of o){let h=this.elements.get(p);h&&(h.parent=c,h.container=c.element,c.children.add(h.node))}return c.element}validateCandidate(e,{replacingNode:t=null}={}){if(!(e instanceof se))throw new TypeError("Source values must be GramlotBuilderBags");let n=new Set,s=i=>{n.add(i);for(let a of this.records.get(i)?.children??[])s(a)};for(let i of this.records.get(t)?.children??[])s(i);return this.#s(e,t?t.nodeTag:null),Pi(e),this.references?.validate(e,n),e}#s(e,t=null){let n=new Set,s=(i,a=null)=>{if(!(i instanceof se)||n.has(i))throw new TypeError("Source values must be unshared, acyclic GramlotBuilderBags");if(!(i._builder instanceof he))throw new TypeError("SourceBag requires builder ownership");n.add(i);for(let o of i.getNodes()){if(!(o instanceof Bt))throw new TypeError("Source children must be GramlotBuilderBagNodes");if(!(o.builder instanceof he))throw new TypeError("SourceBagNode requires builder ownership");if(o.resolver)throw new TypeError("Source resolvers are outside this port");if(o._getMeta("data_element"))o.builder.validateNode(o);else if(o.nodeTag){let l=o._getMeta("subbuilder")?i._builder:o.builder;this.html.validate(o,l),o._getMeta("subbuilder")||o.builder.validateParent(o.nodeTag,a)}else{if(!(o.value instanceof T))throw new TypeError("Source fragments must contain child SourceBags");if(Object.keys(o.attr).some(l=>l!=="_meta"))throw new TypeError("Fragment attributes are unsupported")}o.value instanceof T&&s(o.value,o._getMeta("subbuilder")?null:o.nodeTag??a)}};s(e,t)}freeze(e){e=Ie(e);let t=this.records.get(e);if(!t||this.disposed)throw new Error("Freeze requires a mounted Source node");t.frozen=!0}unfreeze(e){e=Ie(e);let t=this.records.get(e);if(!t||this.disposed)throw new Error("Unfreeze requires a mounted Source node");let n=s=>{delete s.frozen;for(let i of s.children)n(this.records.get(i))};n(t),!this.#n(e)&&(this.attached(e)?this.#d(e):this.remove(e))}#n(e){for(;e;){let t=this.records.get(e);if(t?.frozen)return!0;e=e.parentBag?.parentNode??t?.parent?.node}return!1}receive(e){if(!this.disposed){if(Array.isArray(e.node)){let t=e.node.filter(n=>!this.#e.has(n));if(!t.length)return;e={...e,node:t}}else if(this.#e.has(e.node))return;if(this.pending.push(e),!this.building){this.building=!0;try{for(;this.pending.length;){let t=this.pending.shift();if(t.evt!=="del"&&!this.attached(t.node))continue;t.evt!=="del"&&t.evt!=="upd_attrs"&&this.#u(t);let n=this.binding.handleSourceEvent(t);try{this.#i(t,n)}catch(s){if(!n.length)throw s;n.push(s)}if(n.length)throw n.length===1?n[0]:new AggregateError(n,"Source cleanup failed")}}catch(t){throw this.pending.length=0,t}finally{this.building=!1}}}}#i(e,t){if(e.evt==="del"){for(let n of Array.isArray(e.node)?e.node:[e.node]){if(this.#n(n))continue;let s=this.records.get(n)?.parent??null;try{this.remove(n)}catch(i){t.push(i)}this.#l(s)}return}if(!this.#n(e.node))if(e.evt==="ins")this.insert(e.node);else if(e.evt.startsWith("upd_"))this.update(e.node,e.evt);else throw new Error(`Unsupported Source event: ${e.evt}`)}attached(e){let t=e.parentBag;for(;t&&t!==this.source;)t=t.parentNode?.parentBag;return t===this.source}#a(e){let t=new Set(this.pending.flatMap(n=>Array.isArray(n.node)?n.node:[n.node]));for(let n=e;n;n=n.parentBag?.parentNode)if(t.has(n))return!0;return!1}#u(e){let t=n=>{if(!(n instanceof Bt))throw new TypeError("Source children must be GramlotBuilderBagNodes");if(n.value instanceof T){if(!(n.value instanceof se))throw new TypeError("Source values must be GramlotBuilderBags");for(let s of n.value.getNodes())t(s)}};t(e.node)}insert(e){if(!this.attached(e)||this.records.has(e))return;if(e._getMeta("data_element")){this.records.get(e.parentBag?.parentNode)?.button?.refresh(),this.binding.branchBuilt(e);return}let t=this.records.get(e.parentBag?.parentNode),n=t?.element??t?.container??this.destination,s=e.parentBag.getNodes(),i=t?.end??null;for(let a=s.indexOf(e)+1;a<s.length;a++){let o=this.records.get(s[a]);if(o){i=o.element??o.start;break}}this.buildNode(e,n,i,t)}buildNode(e,t,n=null,s=null){this.#e.add(e);let i;try{i=this.render(e,{document:t.ownerDocument})}catch(o){this.#c(e,o)}finally{this.#e.delete(e)}let a=this.records.get(e);return t.insertBefore(i,n),a.parent=s,this.assignContainer(a,t),s?.children.add(e),this.#l(s),this.binding.branchBuilt(e),a}#c(e,t){let n=[t],s=[],i=a=>{if(s.push(a),a.value instanceof T)for(let o of a.value.getNodes())i(o)};i(e);for(let a of s.reverse())try{this.remove(a)}catch(o){n.push(o)}throw n.length===1?t:new AggregateError(n,"Source build and cleanup failed")}assignContainer(e,t){e.container=t;let n=e.element??t;for(let s of e.children){let i=this.records.get(s);i&&this.assignContainer(i,n)}}update(e,t){let n=this.records.get(e);if(!n){this.insert(e);return}let s=e.value==null||["string","number","boolean"].includes(typeof e.value),i=t==="upd_value"&&s&&n.element&&n.children.size===0&&this.html.matches(n,e);(t==="upd_attrs"||i)&&n.element&&this.html.matches(n,e)?(e.nodeTag&&this.html.validate(e,e._getMeta("subbuilder")?e.parentBag._builder:e.builder),this.project(e),t==="upd_attrs"&&this.records.get(e)===n&&(this.references?.remove(e),this.references?.register(e,n.element))):this.#d(e)}project(e,t=null){let n=this.records.get(e);if(!n?.element)return;let s=this.getRender(e.builder),[i,a]=e.builder.runtimeValues(e),[,o]=s._handleMeta(e,a),l=this.#t.get(e);if(n.shape!==me.shape(n.element,l)){if(this.#n(e))return;this.#r.set(e,l);try{this.#d(e)}finally{this.#r.delete(e)}return}n.resolved=l;let u=e._getMeta("subbuilder")?o:s.adaptAttrs(o),c=e.value instanceof T,d=c?[]:this.expressionValue(e,i);s===this&&([d,u]=rn(d,this.restoreNativeAttributes(e,u))),this.html.update(n,e,u,c?u._text:d,l.visible??null),this.#f(n,e,u,t),n.control?.refresh(),n.button?.refresh(),this.#o(n),(n.element.localName==="option"||n.element.localName==="optgroup")&&this.#l(n.parent)}#f(e,t,n,s){if(!e.control)return;let i=t.getAttr("value")!=null;(i||e.valueDeclared)&&e.control.project(n.value??null,s),e.valueDeclared=i}#o(e){let t=new Map(an.declared(e.node).map(n=>[n[0],n]));if(!e.events){if(!t.size)return;e.events=new Map,e.cleanup.push(()=>{for(let n of e.events.values())n.detach();e.events.clear()})}for(let[n,s]of[...e.events])t.get(n)?.[2]!==s.handler&&(s.detach(),e.events.delete(n));for(let[n,[,s,i]]of t){if(e.events.has(n))continue;let a=new an(e.binding,e,s,i,n);a.attach(),e.events.set(n,a)}}#l(e){for(let t=e;t;t=t.parent){if(t.control instanceof sn){this.project(t.node);return}if(t.element&&t.element.localName!=="optgroup")return}}getDomNode(e){let t=Ie(e),n=this.records.get(t);return n&&this.attached(t)?n.element??null:null}getBaseSourceNode(e){for(let t=e;t;t=t.parentNode){let n=t.nodeType===1?this.elements.get(t):null;if(n)return this.attached(n.node)?n.node:null}return null}#p(e){let t=this.binding.bindingFor(e);if(!t)throw new Error(`${e.nodeTag??"fragment"} '${e.label}': rendered without an open NodeBinding`);return t}#d(e){let t=this.records.get(e),n=t.element?.nextSibling??t.end?.nextSibling??null,s=t.container,i=t.parent,a=null;try{this.remove(e)}catch(o){a=o}try{this.buildNode(e,s,n,i)}catch(o){throw a?new AggregateError([a,o],"Source replacement cleanup and commit failed"):o}if(a)throw a}onDispose(e,t){let n=this.records.get(e);if(!n)throw new Error("Source node is not mounted");return n.cleanup.push(t),()=>{let s=n.cleanup.indexOf(t);s!==-1&&n.cleanup.splice(s,1)}}remove(e){let t=this.records.get(e);if(!t)return;let n=[];for(let s of[...t.children])try{this.remove(s)}catch(i){n.push(i)}for(let s of t.cleanup.splice(0).reverse())try{s()}catch(i){n.push(i)}if(this.references?.remove(e),t.element&&this.elements.delete(t.element),t.element?.remove(),t.start?.remove(),t.end?.remove(),t.parent?.children.delete(e),this.records.delete(e),n.length)throw new AggregateError(n,"Source cleanup failed")}dispose(){if(this.disposed)return;this.disposed=!0,this.source.unsubscribe(this.subscription,{any:!0}),this.pending.length=0;let e=[],t=[...this.records.entries()].filter(([,n])=>!n.parent).map(([n])=>n);for(let n of t)try{this.remove(n)}catch(s){e.push(s)}if(e.length)throw new AggregateError(e,"Renderer cleanup failed")}};var wh=new Set(["page","constructor"]);function Vl(r,e){if(r===null)return[];let t=r.split("/");for(let n of t)if(wh.has(n))throw new Error(`${e}: a logic group cannot be named '${n}' (group '${r}')`);return t}var yh=new Set(["return","typeof","instanceof","in","of","new","delete","void","throw","case","do","else","yield","await"]);function vh(r){return/^[\w$]/.test(r)?yh.has(r):r!==")"&&r!=="]"}function Eh(r,e){let t=!1;for(let n=e+1;n<r.length;n++){let s=r[n];if(s===`
28
+ `)return-1;if(s==="\\"){n++;continue}if(s==="[")t=!0;else if(s==="]")t=!1;else if(s==="/"&&!t)return n}return-1}function kh(r){let e=0,t="",n="";for(let s=r.indexOf("{");s<r.length;s++){let i=r[s];if(i==="/"&&r[s+1]==="/"){if(s=r.indexOf(`
29
+ `,s),s<0)break;continue}if(i==="/"&&r[s+1]==="*"){let a=r.indexOf("*/",s+2);if(a>=0){s=a+1;continue}}if(i==="/"&&vh(n)){let a=Eh(r,s);if(a>=0){s=a,n=")";continue}}if(i==='"'||i==="'"||i==="`"){let a=s+1;for(;a<r.length&&r[a]!==i;)a+=r[a]==="\\"?2:1;e===1&&(t+=r.slice(s+1,a)==="constructor"?" constructor":' ""'),s=a,n=")";continue}if(/[\w$]/.test(i)){let a=s+1;for(;a<r.length&&/[\w$]/.test(r[a]);)a++;e===1&&(t+=r.slice(s,a)),n=r.slice(s,a),s=a-1;continue}if(/\s/.test(i)||(n=i),i==="{"){++e===2&&(t+=" {}");continue}if(i==="}"){e--;continue}e===1&&(t+=i)}return/(?<![\w$.#])(?<!\bstatic\s+)constructor\s*\(/.test(t)}function Hl(r,e){if(typeof r!="function"||!/^class\b/.test(Function.prototype.toString.call(r)))throw new Error(`${e}: the module exports no class Logic`);if(Object.getPrototypeOf(r)!==Function.prototype||Object.getPrototypeOf(r.prototype)!==Object.prototype)throw new Error(`${e}: class Logic cannot extend another class`);if(kh(Function.prototype.toString.call(r)))throw new Error(`${e}: class Logic cannot declare a constructor; state lives on the group or the page`);let t=[];for(let n of Reflect.ownKeys(r.prototype)){if(n==="constructor")continue;if(typeof n=="symbol")throw new Error(`${e}: class Logic cannot declare symbol keys (${String(n)})`);let s=Object.getOwnPropertyDescriptor(r.prototype,n);if(s.get||s.set)throw new Error(`${e}: class Logic cannot declare the accessor '${n}'`);if(typeof s.value!="function")throw new Error(`${e}: Logic.prototype.${n} is not a method`);if(n==="page")throw new Error(`${e}: a logic method cannot be named 'page'`);t.push([n,s.value])}return t}function zl(r,e,t){Object.defineProperty(r,e,{value:t,writable:!0,enumerable:!0,configurable:!0})}var Mt=class{#e;#t;constructor(e,t){this.#e=e,this.#t=t}get page(){return this.#t}},pr=class{#e;#t=new Map;constructor(e){this.#e=e,e.logic=new Mt(this,e)}get gramlot(){return this.#e}static check(e){let t=new Map;for(let{group:n,resource:s}of e){let i=Vl(n,s);for(let a=0;a<i.length;a++){let o=i.slice(0,a).join("/");t.has(o)||t.set(o,new Set),t.get(o).add(i[a])}}for(let{logicClass:n,group:s,resource:i}of e){let a=t.get(s??"")??new Set;for(let[o]of Hl(n,i))if(a.has(o))throw new Error(`${i}: the logic method '${o}' has the name of a child group`)}}register(e,{group:t=null,resource:n}){let s=Vl(t,n),i=Hl(e,n),a=this.#e.logic;for(let o of s){let l=Object.getOwnPropertyDescriptor(a,o)?.value;if(l===void 0){let u=new Mt(this,this.#e);zl(a,o,u),a=u}else if(l instanceof Mt)a=l;else throw new Error(`${n}: the group '${o}' has the name of a logic method`)}for(let[o,l]of i){if(Object.getOwnPropertyDescriptor(a,o)?.value instanceof Mt)throw new Error(`${n}: the logic method '${o}' has the name of a child group`);zl(a,o,l)}this.#t.has(a)||this.#t.set(a,[]),this.#t.get(a).push(n)}resolve(e,t){let n=e.split("."),s=n.pop(),i=this.#e.logic;for(let o=0;o<n.length;o++)if(i=Object.getOwnPropertyDescriptor(i,n[o])?.value,!(i instanceof Mt))throw new Error(`${t.nodeTag} '${t.label}': named logic '${e}' not found: no resource was registered for the group '${n.slice(0,o+1).join("/")}'`);let a=Object.getOwnPropertyDescriptor(i,s)?.value;if(typeof a!="function"){let o=this.#t.get(i)??[],l=n.length?`the group '${n.join("/")}'`:"the page logic";throw new Error(`${t.nodeTag} '${t.label}': named logic '${e}' not found: ${l} has no method '${s}' (resources: ${o.join(", ")||"none"})`)}return{group:i,method:a}}};var dn=class extends Re{constructor(e,{collections:t,destination:n}){super(e),e.src=this,this.logicRegistry=new pr(e),this.builder=new Qe(null,{collections:t}),this.binding=new fr(e),this.builder.binding=this.binding,this.binding.attach(),this.source=this.builder.source,this.renderer=new cn(this.builder,this.source,n,{binding:this.binding})}startSource(e){if(!["ready","failed"].includes(this.gramlot.state))throw new Error(`Cannot start embedded Source while Gramlot is ${this.gramlot.state}`);try{return this.mountMainSource(e)}catch(t){throw this.gramlot.state="failed",t}}mountMainSource(e){let t=this.prepareSource(e);this.renderer.validateCandidate(t);try{this.source.setItem("main",t)}catch(n){throw this.binding.bindingFor(this.source.getNode("main"))||this.source.popNode("main"),n}return this.gramlot.state="started",this.binding.pageStarted(),this.gramlot}prepareSource(e,t=this.builder){if(e instanceof T){if(!(e instanceof se))throw new TypeError("Source values must be GramlotBuilderBags");return e.bindBuilder(t).activateCode()}if(typeof e!="string")throw new TypeError("Source value did not decode to SourceBag");let n=Di(e,t);if(!(n instanceof se))throw new TypeError("Source values must be GramlotBuilderBags");return n.activateCode()}async remoteSource(e,t,n={}){let s=this.gramlot.rpc;if(!s.transport?.call)throw new Error("Remote Source is unavailable without a server transport");let i=this.binding.bindingFor(e);if(this.gramlot.state!=="started"||!i)throw new Error("Remote Source target is not mounted");s.remoteRequests.get(e)?.controller.abort();let a={controller:new AbortController};s.remoteRequests.set(e,a);let o=i.track(()=>a.controller.abort()),l=!1,u=()=>this.gramlot.state!=="disposed"&&!a.controller.signal.aborted&&s.remoteRequests.get(e)===a&&!i.closed;try{let c=await s.call("source",t,n,{signal:a.controller.signal});if(!u())return!1;let d=this.prepareSource(c,e.builder);return u()?(this.renderer.validateCandidate(d,{replacingNode:e}),l=!0,o(),e.setValue(d,!0,{_text:null},!0),!0):!1}catch(c){if(!l&&!u())return!1;throw c}finally{o(),s.remoteRequests.get(e)===a&&s.remoteRequests.delete(e)}}};var Ah=()=>Array.from(globalThis.crypto.getRandomValues(new Uint8Array(16)),r=>r.toString(16).padStart(2,"0")).join(""),Ds=class extends Error{name="RpcError";constructor({code:e,name:t,message:n,details:s}){super(n),this.code=e,this.remoteName=t,s!==void 0&&(this.details=s)}},fn=class extends Re{constructor(e,{rpcUrl:t,closeUrl:n,document:s,transport:i}){super(e),this.transport=i===!1?null:i??new Me(t,{closeUrl:n,navigator:s.defaultView.navigator}),this.remoteRequests=new Map}async call(e,t,n={},{signal:s}={}){if(!this.transport?.call)throw new Error(`rpc '${t}' is unavailable without a server transport`);let i=Ah(),a=le({id:i,pageId:this.gramlot.pageId,contentType:e,name:t,params:n}),o=H(await this.transport.call(a,s));if(o.id!==i)throw new Error("rpc response id mismatch");if(o.error)throw new Ds(o.error);return o.value}};var pn=class extends Re{reference(e){return this.gramlot.src.renderer.references.resolve(e)}getBaseSourceNode(e){return this.gramlot.src.renderer.getBaseSourceNode(e)}getDomNode(e){return this.gramlot.src.renderer.getDomNode(e)}};var Gl=2e3;function Th(r){if(!(r instanceof Date))return String(r??"");let e=r.toISOString();return e.endsWith("T00:00:00.000Z")?e.slice(0,10):e}var hn=class{constructor(e,t){this.gramlot=e,this.document=t}branch(e){let t=this.gramlot.data.getItem(e);if(!(t instanceof P))throw new Error(`gramlot.utl.inout: no data Bag at '${e}'`);return t}mailText(e){let t=[],n=(s,i)=>{for(let a of s.getNodes()){let o=i+a.label;a.value instanceof P?n(a.value,`${o}.`):t.push(`${o}: ${Th(a.value)}`)}};return n(this.branch(e),""),t.join(`
30
+ `)}mailtoUrl(e,t){let n=`mailto:${encodeURIComponent(t)}?subject=${encodeURIComponent(this.document.title)}&body=${encodeURIComponent(this.mailText(e))}`;if(n.length>Gl)throw new Error(`gramlot.utl.inout.sendMail: the email of '${e}' is ${n.length} characters long, over the mailto: limit of ${Gl}; send it with sendHttp or save it as a file`);return n}sendMail(e,t){this.open(this.mailtoUrl(e,t))}async sendHttp(e,t){let n=JSON.stringify(this.branch(e).asDict(!1,!1,!0)),s=await this.document.defaultView.fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:n});if(!s.ok)throw new Error(`gramlot.utl.inout.sendHttp: ${t} answered ${s.status}`);return s}save(e,t){this.saveText(this.branch(e).toTytx(),t,"application/json")}restore(e){let t=this.document.createElement("input");return t.type="file",t.accept=".json,application/json",new Promise((n,s)=>{t.addEventListener("change",async()=>{try{let i=P.fromTytx(await t.files[0].text());this.gramlot.data.setItem(e,i),n(i)}catch(i){s(new Error(`gramlot.utl.inout.restore: the file is not a saved Gramlot branch: ${i.message}`,{cause:i}))}},{once:!0}),t.click()})}download(e,t,n){if(!["json","xml"].includes(n))throw new Error(`gramlot.utl.inout.download: format '${n}' is not 'json' or 'xml'`);let s=this.branch(e);if(n==="json")this.saveText(s.toJson(!1),t,"application/json");else{let i=e.split(".").at(-1);this.saveText(`<?xml version='1.0' encoding='UTF-8'?>
31
+ <${i}>${s.toXml()}</${i}>`,t,"application/xml")}}saveText(e,t,n){let s=this.document.defaultView,i=s.URL.createObjectURL(new s.Blob([e],{type:n}));this.open(i,t),s.setTimeout(()=>s.URL.revokeObjectURL(i),1e3)}open(e,t=null){let n=this.document.createElement("a");n.href=e,t!==null&&(n.download=t),n.click()}};var mn=class extends Re{constructor(e,t){super(e),this.inout=new hn(e,t)}};var gn=class{constructor({pageId:e,rpcUrl:t="/gramlot/rpc",closeUrl:n="/gramlot/close",rootId:s="gramlot-root",capabilities:i=[],element:a=null,document:o=globalThis.document,transport:l=null,collections:u=[]}={}){this.pageId=e,this.capabilities=Object.freeze([...i]),this.src=new dn(this,{collections:u,destination:a??o.getElementById(s)}),this.data=this.src.builder.data,this.rpc=new fn(this,{rpcUrl:t,closeUrl:n,document:o,transport:l}),this.dom=new pn(this),this.utl=new mn(this,o),this.state="ready",this.abort=new AbortController,this.rpc.transport instanceof Me&&(this.pagehide=c=>{c.persisted||this.dispose({beacon:!0})},o.defaultView.addEventListener("pagehide",this.pagehide),this.window=o.defaultView)}start(){return this.state==="disposed"?Promise.reject(new Error("Gramlot is disposed")):this.rpc.transport?this.loading?this.loading:this.state==="started"?Promise.resolve(this):(this.state="loading",this.loading=this.loadMain().finally(()=>{this.loading=null}),this.loading):Promise.reject(new Error("This Gramlot instance has no server transport"))}async loadMain(){try{let e=await this.rpc.call("source","main",{},{signal:this.abort.signal});if(this.state==="disposed")throw new Error("Gramlot was disposed during main");return this.src.mountMainSource(e)}catch(e){throw this.state!=="disposed"&&(this.state="failed"),e}}dispose({beacon:e=!1}={}){if(this.state!=="disposed"){this.state="disposed",this.pagehide&&this.window.removeEventListener("pagehide",this.pagehide),this.abort.abort();for(let t of this.rpc.remoteRequests.values())t.controller.abort();this.rpc.remoteRequests.clear();try{try{this.src.binding.dispose()}finally{this.src.renderer.dispose()}}finally{this.rpc.transport instanceof Me&&this.rpc.transport.close(this.pageId,{beacon:e}),this.rpc.transport?.dispose?.()}}}};var Vi=class{constructor({config:e,resources:t,document:n=globalThis.document}){this.config=e,this.resources=t,this.document=n}async run(){let{config:e,resources:t,document:n}=this,s=n.defaultView;for(let u of t.css){let c=n.createElement("link");c.rel="stylesheet",c.href=u,n.head.append(c)}let i=!1,a=u=>{u.persisted||i||(i=!0,this.closePage())};s.addEventListener("pagehide",a);let o;try{let u=await Promise.allSettled(t.js.map(({url:c})=>import(new URL(c,n.baseURI).href)));if(i)return null;o=t.js.map(({url:c,group:d},f)=>{let p=u[f];if(p.status==="rejected")throw new Error(`${c}: import failed: ${p.reason?.message??p.reason}`,{cause:p.reason});return{logicClass:p.value.Logic,group:d,resource:c}}),pr.check(o)}catch(u){throw this.closePage(),u}finally{s.removeEventListener("pagehide",a)}let l=new gn({...e,document:n});for(let{logicClass:u,group:c,resource:d}of o)l.src.logicRegistry.register(u,{group:c,resource:d});return s.gramlot=l,await l.start(),l}closePage(){let{rpcUrl:e,closeUrl:t,pageId:n}=this.config;new Me(e,{closeUrl:t,navigator:this.document.defaultView.navigator}).close(n,{beacon:!0})}};var xs=Symbol("gramlot.source"),zi=Symbol("gramlot.endpoint"),Dh=new Map([[xs,"registerSource"],[zi,"registerEndpoint"]]);function Wl(r,e,t,n){let s=Dh.get(t);if(e==="main")throw new TypeError(`${s} cannot declare main`);let i=Object.getOwnPropertyDescriptor(r.prototype,e)?.value;if(typeof i!="function")throw new TypeError(`${s} requires an own method of ${r.name}: ${String(e)}`);if(i[t])throw new TypeError(`${t===xs?"Source method":"Endpoint"} already registered: ${e}`);if(i[xs]||i[zi])throw new TypeError(`${e} is declared both as Source method and endpoint`);i[t]={auth:n}}var Hi=class{static title="Gramlot";static css=[];static css_requires="";static js_requires="";static sourceBuilder=Qe;main(e){throw new Error("Page.main(root) must be implemented")}static registerSource(e,{auth:t=null}={}){Wl(this,e,xs,t)}static registerEndpoint(e,{auth:t=null}={}){Wl(this,e,zi,t)}};export{P as Bag,Oe as BagNode,pn as DomHandler,gn as Gramlot,Qe as GramlotBuilder,It as GramlotHtmlRenderer,cn as GramlotRenderer,nn as GramlotSvgRenderer,Re as Handler,Me as HttpTransport,hn as InOut,Hi as Page,Vi as PageBootstrap,on as References,Ds as RpcError,fn as RpcHandler,dn as SourceHandler,mn as UtilitiesHandler};
32
32
  /*! Bundled license information:
33
33
 
34
34
  decimal.js/decimal.mjs: