camunda-dmn-js
Version:
Embeddable Camunda modeling distributions based on dmn-js
6 lines • 1.19 MB
JavaScript
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).DmnModeler=t()}(this,(function(){"use strict";function e(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n<t;n++)i[n]=e[n];return i}function t(e,t,n){return t=r(t),function(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,a()?Reflect.construct(t,n||[],r(e).constructor):t.apply(e,n))}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,d(i.key),i)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function o(e,t,n){return(t=d(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e){return r=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},r(e)}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&u(e,t)}function a(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(a=function(){return!!e})()}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){o(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function u(e,t){return u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},u(e,t)}function h(t){return function(t){if(Array.isArray(t))return e(t)}(t)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(t,n){if(t){if("string"==typeof t)return e(t,n);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?e(t,n):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t);if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}var p,f,g,m,v,y,b,_,x={name:"Camunda",uri:"http://camunda.org/schema/1.0/dmn",prefix:"camunda",xml:{tagAlias:"lowerCase"},associations:[],types:[{name:"Definitions",isAbstract:!0,extends:["dmn:Definitions"],properties:[{name:"diagramRelationId",isAttr:!0,type:"String"}]},{name:"Decision",isAbstract:!0,extends:["dmn:Decision"],properties:[{name:"versionTag",isAttr:!0,type:"String"},{name:"historyTimeToLive",isAttr:!0,type:"String"}]},{name:"InputClause",extends:["dmn:InputClause"],properties:[{name:"inputVariable",isAttr:!0,type:"String"}]}],emumerations:[]},w={},C=[],k=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,O=Array.isArray;function E(e,t){for(var n in t)e[n]=t[n];return e}function S(e){var t=e.parentNode;t&&t.removeChild(e)}function P(e,t,n){var i,o,r,s={};for(r in t)"key"==r?i=t[r]:"ref"==r?o=t[r]:s[r]=t[r];if(arguments.length>2&&(s.children=arguments.length>3?p.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(r in e.defaultProps)void 0===s[r]&&(s[r]=e.defaultProps[r]);return T(e,s,i,o,null)}function T(e,t,n,i,o){var r={type:e,props:t,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==o?++g:o,__i:-1,__u:0};return null==o&&null!=f.vnode&&f.vnode(r),r}function R(e){return e.children}function A(e,t){this.props=e,this.context=t}function M(e,t){if(null==t)return e.__?M(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?M(e):null}function D(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return D(e)}}function $(e){(!e.__d&&(e.__d=!0)&&m.push(e)&&!I.__r++||v!==f.debounceRendering)&&((v=f.debounceRendering)||y)(I)}function I(){var e,t,n,i,o,r,s,a,l;for(m.sort(b);e=m.shift();)e.__d&&(t=m.length,i=void 0,r=(o=(n=e).__v).__e,a=[],l=[],(s=n.__P)&&((i=E({},o)).__v=o.__v+1,f.vnode&&f.vnode(i),H(s,i,o,n.__n,void 0!==s.ownerSVGElement,32&o.__u?[r]:null,a,null==r?M(o):r,!!(32&o.__u),l),i.__.__k[i.__i]=i,W(a,i,l),i.__e!=r&&D(i)),m.length>t&&m.sort(b));I.__r=0}function L(e,t,n,i,o,r,s,a,l,c,u){var h,d,p,f,g,m=i&&i.__k||C,v=t.length;for(n.__d=l,function(e,t,n){var i,o,r,s,a,l=t.length,c=n.length,u=c,h=0;for(e.__k=[],i=0;i<l;i++)null!=(o=e.__k[i]=null==(o=t[i])||"boolean"==typeof o||"function"==typeof o?null:"string"==typeof o||"number"==typeof o||"bigint"==typeof o||o.constructor==String?T(null,o,null,null,o):O(o)?T(R,{children:o},null,null,null):void 0===o.constructor&&o.__b>0?T(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o)?(o.__=e,o.__b=e.__b+1,a=N(o,n,s=i+h,u),o.__i=a,r=null,-1!==a&&(u--,(r=n[a])&&(r.__u|=131072)),null==r||null===r.__v?(-1==a&&h--,"function"!=typeof o.type&&(o.__u|=65536)):a!==s&&(a===s+1?h++:a>s?u>l-s?h+=a-s:h--:h=a<s&&a==s-1?a-s:0,a!==i+h&&(o.__u|=65536))):(r=n[i])&&null==r.key&&r.__e&&(r.__e==e.__d&&(e.__d=M(r)),U(r,r,!1),n[i]=null,u--);if(u)for(i=0;i<c;i++)null!=(r=n[i])&&!(131072&r.__u)&&(r.__e==e.__d&&(e.__d=M(r)),U(r,r))}(n,t,m),l=n.__d,h=0;h<v;h++)null!=(p=n.__k[h])&&"boolean"!=typeof p&&"function"!=typeof p&&(d=-1===p.__i?w:m[p.__i]||w,p.__i=h,H(e,p,d,o,r,s,a,l,c,u),f=p.__e,p.ref&&d.ref!=p.ref&&(d.ref&&Q(d.ref,null,p),u.push(p.ref,p.__c||f,p)),null==g&&null!=f&&(g=f),65536&p.__u||d.__k===p.__k?l=B(p,l,e):"function"==typeof p.type&&void 0!==p.__d?l=p.__d:f&&(l=f.nextSibling),p.__d=void 0,p.__u&=-196609);n.__d=l,n.__e=g}function B(e,t,n){var i,o;if("function"==typeof e.type){for(i=e.__k,o=0;i&&o<i.length;o++)i[o]&&(i[o].__=e,t=B(i[o],t,n));return t}return e.__e!=t&&(n.insertBefore(e.__e,t||null),t=e.__e),t&&t.nextSibling}function j(e,t){return t=t||[],null==e||"boolean"==typeof e||(O(e)?e.some((function(e){j(e,t)})):t.push(e)),t}function N(e,t,n,i){var o=e.key,r=e.type,s=n-1,a=n+1,l=t[n];if(null===l||l&&o==l.key&&r===l.type)return n;if(i>(null==l||131072&l.__u?0:1))for(;s>=0||a<t.length;){if(s>=0){if((l=t[s])&&!(131072&l.__u)&&o==l.key&&r===l.type)return s;s--}if(a<t.length){if((l=t[a])&&!(131072&l.__u)&&o==l.key&&r===l.type)return a;a++}}return-1}function q(e,t,n){"-"===t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||k.test(t)?n:n+"px"}function V(e,t,n,i,o){var r;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof i&&(e.style.cssText=i=""),i)for(t in i)n&&t in n||q(e.style,t,"");if(n)for(t in n)i&&n[t]===i[t]||q(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])r=t!==(t=t.replace(/(PointerCapture)$|Capture$/,"$1")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+r]=n,n?i?n.u=i.u:(n.u=Date.now(),e.addEventListener(t,r?z:F,r)):e.removeEventListener(t,r?z:F,r);else{if(o)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==t&&"height"!==t&&"href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&"rowSpan"!==t&&"colSpan"!==t&&"role"!==t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&"-"!==t[4]?e.removeAttribute(t):e.setAttribute(t,n))}}function F(e){var t=this.l[e.type+!1];if(e.t){if(e.t<=t.u)return}else e.t=Date.now();return t(f.event?f.event(e):e)}function z(e){return this.l[e.type+!0](f.event?f.event(e):e)}function H(e,t,n,i,o,r,s,a,l,c){var u,h,d,g,m,v,y,b,_,x,C,k,P,T,D,$=t.type;if(void 0!==t.constructor)return null;128&n.__u&&(l=!!(32&n.__u),r=[a=t.__e=n.__e]),(u=f.__b)&&u(t);e:if("function"==typeof $)try{if(b=t.props,_=(u=$.contextType)&&i[u.__c],x=u?_?_.props.value:u.__:i,n.__c?y=(h=t.__c=n.__c).__=h.__E:("prototype"in $&&$.prototype.render?t.__c=h=new $(b,x):(t.__c=h=new A(b,x),h.constructor=$,h.render=X),_&&_.sub(h),h.props=b,h.state||(h.state={}),h.context=x,h.__n=i,d=h.__d=!0,h.__h=[],h._sb=[]),null==h.__s&&(h.__s=h.state),null!=$.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=E({},h.__s)),E(h.__s,$.getDerivedStateFromProps(b,h.__s))),g=h.props,m=h.state,h.__v=t,d)null==$.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else{if(null==$.getDerivedStateFromProps&&b!==g&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(b,x),!h.__e&&(null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(b,h.__s,x)||t.__v===n.__v)){for(t.__v!==n.__v&&(h.props=b,h.state=h.__s,h.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.forEach((function(e){e&&(e.__=t)})),C=0;C<h._sb.length;C++)h.__h.push(h._sb[C]);h._sb=[],h.__h.length&&s.push(h);break e}null!=h.componentWillUpdate&&h.componentWillUpdate(b,h.__s,x),null!=h.componentDidUpdate&&h.__h.push((function(){h.componentDidUpdate(g,m,v)}))}if(h.context=x,h.props=b,h.__P=e,h.__e=!1,k=f.__r,P=0,"prototype"in $&&$.prototype.render){for(h.state=h.__s,h.__d=!1,k&&k(t),u=h.render(h.props,h.state,h.context),T=0;T<h._sb.length;T++)h.__h.push(h._sb[T]);h._sb=[]}else do{h.__d=!1,k&&k(t),u=h.render(h.props,h.state,h.context),h.state=h.__s}while(h.__d&&++P<25);h.state=h.__s,null!=h.getChildContext&&(i=E(E({},i),h.getChildContext())),d||null==h.getSnapshotBeforeUpdate||(v=h.getSnapshotBeforeUpdate(g,m)),L(e,O(D=null!=u&&u.type===R&&null==u.key?u.props.children:u)?D:[D],t,n,i,o,r,s,a,l,c),h.base=t.__e,t.__u&=-161,h.__h.length&&s.push(h),y&&(h.__E=h.__=null)}catch(e){t.__v=null,l||null!=r?(t.__e=a,t.__u|=l?160:32,r[r.indexOf(a)]=null):(t.__e=n.__e,t.__k=n.__k),f.__e(e,t,n)}else null==r&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=function(e,t,n,i,o,r,s,a,l){var c,u,h,d,f,g,m,v=n.props,y=t.props,b=t.type;if("svg"===b&&(o=!0),null!=r)for(c=0;c<r.length;c++)if((f=r[c])&&"setAttribute"in f==!!b&&(b?f.localName===b:3===f.nodeType)){e=f,r[c]=null;break}if(null==e){if(null===b)return document.createTextNode(y);e=o?document.createElementNS("http://www.w3.org/2000/svg",b):document.createElement(b,y.is&&y),r=null,a=!1}if(null===b)v===y||a&&e.data===y||(e.data=y);else{if(r=r&&p.call(e.childNodes),v=n.props||w,!a&&null!=r)for(v={},c=0;c<e.attributes.length;c++)v[(f=e.attributes[c]).name]=f.value;for(c in v)f=v[c],"children"==c||("dangerouslySetInnerHTML"==c?h=f:"key"===c||c in y||V(e,c,null,f,o));for(c in y)f=y[c],"children"==c?d=f:"dangerouslySetInnerHTML"==c?u=f:"value"==c?g=f:"checked"==c?m=f:"key"===c||a&&"function"!=typeof f||v[c]===f||V(e,c,f,v[c],o);if(u)a||h&&(u.__html===h.__html||u.__html===e.innerHTML)||(e.innerHTML=u.__html),t.__k=[];else if(h&&(e.innerHTML=""),L(e,O(d)?d:[d],t,n,i,o&&"foreignObject"!==b,r,s,r?r[0]:n.__k&&M(n,0),a,l),null!=r)for(c=r.length;c--;)null!=r[c]&&S(r[c]);a||(c="value",void 0!==g&&(g!==e[c]||"progress"===b&&!g||"option"===b&&g!==v[c])&&V(e,c,g,v[c],!1),c="checked",void 0!==m&&m!==e[c]&&V(e,c,m,v[c],!1))}return e}(n.__e,t,n,i,o,r,s,l,c);(u=f.diffed)&&u(t)}function W(e,t,n){t.__d=void 0;for(var i=0;i<n.length;i++)Q(n[i],n[++i],n[++i]);f.__c&&f.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){f.__e(e,t.__v)}}))}function Q(e,t,n){try{"function"==typeof e?e(t):e.current=t}catch(e){f.__e(e,n)}}function U(e,t,n){var i,o;if(f.unmount&&f.unmount(e),(i=e.ref)&&(i.current&&i.current!==e.__e||Q(i,null,t)),null!=(i=e.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(e){f.__e(e,t)}i.base=i.__P=null,e.__c=void 0}if(i=e.__k)for(o=0;o<i.length;o++)i[o]&&U(i[o],t,n||"function"!=typeof e.type);n||null==e.__e||S(e.__e),e.__=e.__e=e.__d=void 0}function X(e,t,n){return this.constructor(e,n)}function G(e,t,n){var i,o,r;f.__&&f.__(e,t),i=!1?null:t.__k,o=[],r=[],H(t,e=t.__k=P(R,null,[e]),i||w,w,void 0!==t.ownerSVGElement,i?null:t.firstChild?p.call(t.childNodes):null,o,i?i.__e:t.firstChild,false,r),W(o,e,r)}function K(e,t){var n={__c:t="__cC"+_++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var n,i;return this.getChildContext||(n=[],(i={})[t]=this,this.getChildContext=function(){return i},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&n.some((function(e){e.__e=!0,$(e)}))},this.sub=function(e){n.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n.splice(n.indexOf(e),1),t&&t.call(e)}}),e.children}};return n.Provider.__=n.Consumer.contextType=n}p=C.slice,f={__e:function(e,t,n,i){for(var o,r,s;t=t.__;)if((o=t.__c)&&!o.__)try{if((r=o.constructor)&&null!=r.getDerivedStateFromError&&(o.setState(r.getDerivedStateFromError(e)),s=o.__d),null!=o.componentDidCatch&&(o.componentDidCatch(e,i||{}),s=o.__d),s)return o.__E=o}catch(t){e=t}throw e}},g=0,A.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=E({},this.state),"function"==typeof e&&(e=e(E({},n),this.props)),e&&E(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),$(this))},A.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),$(this))},A.prototype.render=R,m=[],y="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,b=function(e,t){return e.__v.__b-t.__v.__b},I.__r=0,_=0;var Y,Z,J,ee,te=0,ne=[],ie=[],oe=f.__b,re=f.__r,se=f.diffed,ae=f.__c,le=f.unmount;function ce(e,t){f.__h&&f.__h(Z,e,te||t),te=0;var n=Z.__H||(Z.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({__V:ie}),n.__[e]}function ue(e){return te=1,function(e,t,n){var i=ce(Y++,2);if(i.t=e,!i.__c&&(i.__=[n?n(t):Ce(void 0,t),function(e){var t=i.__N?i.__N[0]:i.__[0],n=i.t(t,e);t!==n&&(i.__N=[n,i.__[1]],i.__c.setState({}))}],i.__c=Z,!Z.u)){var o=function(e,t,n){if(!i.__c.__H)return!0;var o=i.__c.__H.__.filter((function(e){return e.__c}));if(o.every((function(e){return!e.__N})))return!r||r.call(this,e,t,n);var s=!1;return o.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(s=!0)}})),!(!s&&i.__c.props===e)&&(!r||r.call(this,e,t,n))};Z.u=!0;var r=Z.shouldComponentUpdate,s=Z.componentWillUpdate;Z.componentWillUpdate=function(e,t,n){if(this.__e){var i=r;r=void 0,o(e,t,n),r=i}s&&s.call(this,e,t,n)},Z.shouldComponentUpdate=o}return i.__N||i.__}(Ce,e)}function he(e,t){var n=ce(Y++,3);!f.__s&&we(n.__H,t)&&(n.__=e,n.i=t,Z.__H.__h.push(n))}function de(e,t){var n=ce(Y++,4);!f.__s&&we(n.__H,t)&&(n.__=e,n.i=t,Z.__h.push(n))}function pe(e){return te=5,fe((function(){return{current:e}}),[])}function fe(e,t){var n=ce(Y++,7);return we(n.__H,t)?(n.__V=e(),n.i=t,n.__h=e,n.__V):n.__}function ge(e,t){return te=8,fe((function(){return e}),t)}function me(e){var t=Z.context[e.__c],n=ce(Y++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(Z)),t.props.value):e.__}function ve(){for(var e;e=ne.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(_e),e.__H.__h.forEach(xe),e.__H.__h=[]}catch(t){e.__H.__h=[],f.__e(t,e.__v)}}f.__b=function(e){Z=null,oe&&oe(e)},f.__r=function(e){re&&re(e),Y=0;var t=(Z=e.__c).__H;t&&(J===Z?(t.__h=[],Z.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.__V=ie,e.__N=e.i=void 0}))):(t.__h.forEach(_e),t.__h.forEach(xe),t.__h=[],Y=0)),J=Z},f.diffed=function(e){se&&se(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==ne.push(t)&&ee===f.requestAnimationFrame||((ee=f.requestAnimationFrame)||be)(ve)),t.__H.__.forEach((function(e){e.i&&(e.__H=e.i),e.__V!==ie&&(e.__=e.__V),e.i=void 0,e.__V=ie}))),J=Z=null},f.__c=function(e,t){t.some((function(e){try{e.__h.forEach(_e),e.__h=e.__h.filter((function(e){return!e.__||xe(e)}))}catch(n){t.some((function(e){e.__h&&(e.__h=[])})),t=[],f.__e(n,e.__v)}})),ae&&ae(e,t)},f.unmount=function(e){le&&le(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach((function(e){try{_e(e)}catch(e){t=e}})),n.__H=void 0,t&&f.__e(t,n.__v))};var ye="function"==typeof requestAnimationFrame;function be(e){var t,n=function(){clearTimeout(i),ye&&cancelAnimationFrame(t),setTimeout(e)},i=setTimeout(n,100);ye&&(t=requestAnimationFrame(n))}function _e(e){var t=Z,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),Z=t}function xe(e){var t=Z;e.__c=e.__(),Z=t}function we(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function Ce(e,t){return"function"==typeof t?t(e):t}const ke=Object.prototype.toString,Oe=Object.prototype.hasOwnProperty;function Ee(e){return void 0===e}function Se(e){return void 0!==e}function Pe(e){return null==e}function Te(e){return"[object Array]"===ke.call(e)}function Re(e){return"[object Object]"===ke.call(e)}function Ae(e){return"[object Number]"===ke.call(e)}function Me(e){const t=ke.call(e);return"[object Function]"===t||"[object AsyncFunction]"===t||"[object GeneratorFunction]"===t||"[object AsyncGeneratorFunction]"===t||"[object Proxy]"===t}function De(e){return"[object String]"===ke.call(e)}function $e(e,t){return!Pe(e)&&Oe.call(e,t)}function Ie(e,t){const n=Ke(t);let i;return je(e,(function(e,t){if(n(e,t))return i=e,!1})),i}function Le(e,t){const n=Ke(t);let i=Te(e)?-1:void 0;return je(e,(function(e,t){if(n(e,t))return i=t,!1})),i}function Be(e,t){const n=Ke(t);let i=[];return je(e,(function(e,t){n(e,t)&&i.push(e)})),i}function je(e,t){let n,i;if(Ee(e))return;const o=Te(e)?Ze:Ye;for(let r in e)if($e(e,r)&&(n=e[r],i=t(n,o(r)),!1===i))return n}function Ne(e,t,n){return je(e,(function(e,i){n=t(n,e,i)})),n}function qe(e,t){return!!Ne(e,(function(e,n,i){return e&&t(n,i)}),!0)}function Ve(e,t){return!!Ie(e,t)}function Fe(e,t){let n=[];return je(e,(function(e,i){n.push(t(e,i))})),n}function ze(e){return e&&Object.keys(e)||[]}function He(e){return Fe(e,(e=>e))}function We(e,t,n={}){return t=Ge(t),je(e,(function(e){let i=t(e)||"_",o=n[i];o||(o=n[i]=[]),o.push(e)})),n}function Qe(e,...t){e=Ge(e);let n={};return je(t,(t=>We(t,e,n))),Fe(n,(function(e,t){return e[0]}))}function Ue(e,t){t=Ge(t);let n=[];return je(e,(function(e,i){let o=t(e,i),r={d:o,v:e};for(var s=0;s<n.length;s++){let{d:e}=n[s];if(o<e)return void n.splice(s,0,r)}n.push(r)})),Fe(n,(e=>e.v))}function Xe(e){return function(t){return qe(e,(function(e,n){return t[n]===e}))}}function Ge(e){return Me(e)?e:t=>t[e]}function Ke(e){return Me(e)?e:t=>t===e}function Ye(e){return e}function Ze(e){return Number(e)}function Je(e,t){let n,i,o,r;function s(n){let s=Date.now(),c=n?0:r+t-s;if(c>0)return a(c);e.apply(o,i),l()}function a(e){n=setTimeout(s,e)}function l(){n&&clearTimeout(n),n=r=i=o=void 0}function c(...e){r=Date.now(),i=e,o=this,n||a(t)}return c.flush=function(){n&&s(!0),l()},c.cancel=l,c}function et(e,t){return e.bind(t)}function tt(e,...t){return Object.assign(e,...t)}function nt(e,t,n){let i=e;return je(t,(function(e,o){if("number"!=typeof e&&"string"!=typeof e)throw new Error("illegal key type: "+typeof e+". Key should be of type number or string.");if("constructor"===e)throw new Error("illegal key: constructor");if("__proto__"===e)throw new Error("illegal key: __proto__");let r=t[o+1],s=i[e];Se(r)&&Pe(s)&&(s=i[e]=isNaN(+r)?{}:[]),Ee(r)?Ee(n)?delete i[e]:i[e]=n:i=s})),e}function it(e,t){let n={},i=Object(e);return je(t,(function(t){t in i&&(n[t]=e[t])})),n}function ot(e,t){let n={};return je(Object(e),(function(e,i){-1===t.indexOf(i)&&(n[i]=e)})),n}function rt(e,t){for(var n in t)e[n]=t[n];return e}function st(e,t){for(var n in e)if("__source"!==n&&!(n in t))return!0;for(var i in t)if("__source"!==i&&e[i]!==t[i])return!0;return!1}function at(e){this.props=e}(at.prototype=new A).isPureReactComponent=!0,at.prototype.shouldComponentUpdate=function(e,t){return st(this.props,e)||st(this.state,t)};var lt=f.__b;f.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),lt&<(e)};var ct="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function ut(e){function t(t){var n=rt({},t);return delete n.ref,e(n,t.ref||null)}return t.$$typeof=ct,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var ht=f.__e;f.__e=function(e,t,n,i){if(e.then)for(var o,r=t;r=r.__;)if((o=r.__c)&&o.__c)return null==t.__e&&(t.__e=n.__e,t.__k=n.__k),o.__c(e,t);ht(e,t,n,i)};var dt=f.unmount;function pt(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach((function(e){"function"==typeof e.__c&&e.__c()})),e.__c.__H=null),null!=(e=rt({},e)).__c&&(e.__c.__P===n&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map((function(e){return pt(e,t,n)}))),e}function ft(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map((function(e){return ft(e,t,n)})),e.__c&&e.__c.__P===t&&(e.__e&&n.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=n)),e}function gt(){this.__u=0,this.t=null,this.__b=null}function mt(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function vt(){this.u=null,this.o=null}f.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),dt&&dt(e)},(gt.prototype=new A).__c=function(e,t){var n=t.__c,i=this;null==i.t&&(i.t=[]),i.t.push(n);var o=mt(i.__v),r=!1,s=function(){r||(r=!0,n.__R=null,o?o(a):a())};n.__R=s;var a=function(){if(! --i.__u){if(i.state.__a){var e=i.state.__a;i.__v.__k[0]=ft(e,e.__c.__P,e.__c.__O)}var t;for(i.setState({__a:i.__b=null});t=i.t.pop();)t.forceUpdate()}};i.__u++||32&t.__u||i.setState({__a:i.__b=i.__v.__k[0]}),e.then(s,s)},gt.prototype.componentWillUnmount=function(){this.t=[]},gt.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),i=this.__v.__k[0].__c;this.__v.__k[0]=pt(this.__b,n,i.__O=i.__P)}this.__b=null}var o=t.__a&&P(R,null,e.fallback);return o&&(o.__u&=-33),[P(R,null,t.__a?null:e.children),o]};var yt=function(e,t,n){if(++n[1]===n[0]&&e.o.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.o.size))for(n=e.u;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.u=n=n[2]}};function bt(e){return this.getChildContext=function(){return e.context},e.children}function _t(e){var t=this,n=e.i;t.componentWillUnmount=function(){G(null,t.l),t.l=null,t.i=null},t.i&&t.i!==n&&t.componentWillUnmount(),t.l||(t.i=n,t.l={nodeType:1,parentNode:n,childNodes:[],appendChild:function(e){this.childNodes.push(e),t.i.appendChild(e)},insertBefore:function(e,n){this.childNodes.push(e),t.i.appendChild(e)},removeChild:function(e){this.childNodes.splice(this.childNodes.indexOf(e)>>>1,1),t.i.removeChild(e)}}),G(P(bt,{context:t.context},e.__v),t.l)}function xt(e,t){var n=P(_t,{__v:e,i:t});return n.containerInfo=t,n}(vt.prototype=new A).__a=function(e){var t=this,n=mt(t.__v),i=t.o.get(e);return i[0]++,function(o){var r=function(){t.props.revealOrder?(i.push(o),yt(t,e,i)):o()};n?n(r):r()}},vt.prototype.render=function(e){this.u=null,this.o=new Map;var t=j(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var n=t.length;n--;)this.o.set(t[n],this.u=[1,0,this.u]);return e.children},vt.prototype.componentDidUpdate=vt.prototype.componentDidMount=function(){var e=this;this.o.forEach((function(t,n){yt(e,n,t)}))};var wt="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,Ct=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,kt=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Ot=/[A-Z0-9]/g,Et="undefined"!=typeof document,St=function(e){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(e)};A.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(e){Object.defineProperty(A.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})}));var Pt=f.event;function Tt(){}function Rt(){return this.cancelBubble}function At(){return this.defaultPrevented}f.event=function(e){return Pt&&(e=Pt(e)),e.persist=Tt,e.isPropagationStopped=Rt,e.isDefaultPrevented=At,e.nativeEvent=e};var Mt={enumerable:!1,configurable:!0,get:function(){return this.class}},Dt=f.vnode;f.vnode=function(e){"string"==typeof e.type&&function(e){var t=e.props,n=e.type,i={};for(var o in t){var r=t[o];if(!("value"===o&&"defaultValue"in t&&null==r||Et&&"children"===o&&"noscript"===n||"class"===o||"className"===o)){var s=o.toLowerCase();"defaultValue"===o&&"value"in t&&null==t.value?o="value":"download"===o&&!0===r?r="":"ondoubleclick"===s?o="ondblclick":"onchange"!==s||"input"!==n&&"textarea"!==n||St(t.type)?"onfocus"===s?o="onfocusin":"onblur"===s?o="onfocusout":kt.test(o)?o=s:-1===n.indexOf("-")&&Ct.test(o)?o=o.replace(Ot,"-$&").toLowerCase():null===r&&(r=void 0):s=o="oninput","oninput"===s&&i[o=s]&&(o="oninputCapture"),i[o]=r}}"select"==n&&i.multiple&&Array.isArray(i.value)&&(i.value=j(t.children).forEach((function(e){e.props.selected=-1!=i.value.indexOf(e.props.value)}))),"select"==n&&null!=i.defaultValue&&(i.value=j(t.children).forEach((function(e){e.props.selected=i.multiple?-1!=i.defaultValue.indexOf(e.props.value):i.defaultValue==e.props.value}))),t.class&&!t.className?(i.class=t.class,Object.defineProperty(i,"className",Mt)):(t.className&&!t.class||t.class&&t.className)&&(i.class=i.className=t.className),e.props=i}(e),e.$$typeof=wt,Dt&&Dt(e)};var $t=f.__r;f.__r=function(e){$t&&$t(e),e.__c};var It=f.diffed;f.diffed=function(e){It&&It(e);var t=e.props,n=e.__e;null!=n&&"textarea"===e.type&&"value"in t&&t.value!==n.value&&(n.value=null==t.value?"":t.value)};var Lt=0;function Bt(e,t,n,i,o,r){var s,a,l={};for(a in t)"ref"==a?s=t[a]:l[a]=t[a];var c={type:e,props:l,key:n,ref:s,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--Lt,__i:-1,__u:0,__source:o,__self:r};if("function"==typeof e&&(s=e.defaultProps))for(a in s)void 0===l[a]&&(l[a]=s[a]);return f.vnode&&f.vnode(c),c}var jt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Nt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var qt,Vt={exports:{}};
/*!
Copyright (c) 2018 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/var Ft,zt,Ht=(qt||(qt=1,function(e){!function(){var t={}.hasOwnProperty;function n(){for(var e="",t=0;t<arguments.length;t++){var n=arguments[t];n&&(e=o(e,i(n)))}return e}function i(e){if("string"==typeof e||"number"==typeof e)return e;if("object"!=typeof e)return"";if(Array.isArray(e))return n.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var i="";for(var r in e)t.call(e,r)&&e[r]&&(i=o(i,r));return i}function o(e,t){return t?e?e+" "+t:e+t:e}e.exports?(n.default=n,e.exports=n):window.classNames=n}()}(Vt)),Vt.exports),Wt=Nt(Ht);function Qt(){if(zt)return Ft;zt=1;const e={legend:[1,"<fieldset>","</fieldset>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],_default:[0,"",""]};return e.td=e.th=[3,"<table><tbody><tr>","</tr></tbody></table>"],e.option=e.optgroup=[1,'<select multiple="multiple">',"</select>"],e.thead=e.tbody=e.colgroup=e.caption=e.tfoot=[1,"<table>","</table>"],e.polyline=e.ellipse=e.polygon=e.circle=e.text=e.line=e.path=e.rect=e.g=[1,'<svg xmlns="http://www.w3.org/2000/svg" version="1.1">',"</svg>"],Ft=function(t,n=globalThis.document){if("string"!=typeof t)throw new TypeError("String expected");const i=/^<!--(.*?)-->$/s.exec(t);if(i)return n.createComment(i[1]);const o=/<([\w:]+)/.exec(t)?.[1];if(!o)return n.createTextNode(t);if(t=t.trim(),"body"===o){const e=n.createElement("html");e.innerHTML=t;const{lastChild:i}=e;return i.remove(),i}let[r,s,a]=Object.hasOwn(e,o)?e[o]:e._default,l=n.createElement("div");for(l.innerHTML=s+t+a;r--;)l=l.lastChild;if(l.firstChild===l.lastChild){const{firstChild:e}=l;return e.remove(),e}const c=n.createDocumentFragment();return c.append(...l.childNodes),c},Ft}var Ut=Nt(Qt());function Xt(e,t){return t.forEach((function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach((function(n){if("default"!==n&&!(n in e)){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}}))})),Object.freeze(e)}function Gt(e,...t){const n=e.style;return je(t,(function(e){e&&je(e,(function(e,t){n[t]=e}))})),e}function Kt(e,t,n){return 2==arguments.length?e.getAttribute(t):null===n?e.removeAttribute(t):(e.setAttribute(t,n),e)}const Yt=Object.prototype.toString;function Zt(e){return new Jt(e)}function Jt(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}function en(e){for(var t;t=e.firstChild;)e.removeChild(t);return e}function tn(e,t,n){var i=n?e:e.parentNode;return i&&"function"==typeof i.closest&&i.closest(t)||null}function nn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}Jt.prototype.add=function(e){return this.list.add(e),this},Jt.prototype.remove=function(e){return"[object RegExp]"==Yt.call(e)?this.removeMatching(e):(this.list.remove(e),this)},Jt.prototype.removeMatching=function(e){const t=this.array();for(let n=0;n<t.length;n++)e.test(t[n])&&this.remove(t[n]);return this},Jt.prototype.toggle=function(e,t){return void 0!==t?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this},Jt.prototype.array=function(){return Array.from(this.list)},Jt.prototype.has=Jt.prototype.contains=function(e){return this.list.contains(e)};var on,rn={};var sn=function(){if(on)return rn;var e,t,n;function i(){e=window.addEventListener?"addEventListener":"attachEvent",t=window.removeEventListener?"removeEventListener":"detachEvent",n="addEventListener"!==e?"on":""}return on=1,rn.bind=function(t,o,r,s){return e||i(),t[e](n+o,r,s||!1),r},rn.unbind=function(e,o,r,s){return t||i(),e[t](n+o,r,s||!1),r},rn}(),an=Xt({__proto__:null,default:nn(sn)},[sn]),ln=["focus","blur"];var cn={bind:function(e,t,n,i,o){return-1!==ln.indexOf(n)&&(o=!0),an.bind(e,n,(function(n){var o=n.target||n.srcElement;n.delegateTarget=tn(o,t,!0),n.delegateTarget&&i.call(e,n)}),o)},unbind:function(e,t,n,i){return-1!==ln.indexOf(t)&&(i=!0),an.unbind(e,t,n,i)}};function un(e,t){return e&&"function"==typeof e.matches&&e.matches(t)||!1}function hn(e,t){return(t=t||document).querySelector(e)}function dn(e,t){return(t=t||document).querySelectorAll(e)}function pn(e){e.parentNode&&e.parentNode.removeChild(e)}const fn=1024;let gn=0,mn=class{constructor(e,t){this.from=e,this.to=t}};class vn{constructor(e={}){this.id=gn++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=e.combine||null}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return"function"!=typeof e&&(e=_n.match(e)),t=>{let n=e(t);return void 0===n?null:[this,n]}}}vn.closedBy=new vn({deserialize:e=>e.split(" ")}),vn.openedBy=new vn({deserialize:e=>e.split(" ")}),vn.group=new vn({deserialize:e=>e.split(" ")}),vn.isolate=new vn({deserialize:e=>{if(e&&"rtl"!=e&&"ltr"!=e&&"auto"!=e)throw new RangeError("Invalid value for isolate: "+e);return e||"auto"}}),vn.contextHash=new vn({perNode:!0}),vn.lookAhead=new vn({perNode:!0}),vn.mounted=new vn({perNode:!0});class yn{constructor(e,t,n,i=!1){this.tree=e,this.overlay=t,this.parser=n,this.bracketed=i}static get(e){return e&&e.props&&e.props[vn.mounted.id]}}const bn=Object.create(null);class _n{constructor(e,t,n,i=0){this.name=e,this.props=t,this.id=n,this.flags=i}static define(e){let t=e.props&&e.props.length?Object.create(null):bn,n=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(null==e.name?8:0),i=new _n(e.name||"",t,e.id,n);if(e.props)for(let n of e.props)if(Array.isArray(n)||(n=n(i)),n){if(n[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[n[0].id]=n[1]}return i}prop(e){return this.props[e.id]}get isTop(){return(1&this.flags)>0}get isSkipped(){return(2&this.flags)>0}get isError(){return(4&this.flags)>0}get isAnonymous(){return(8&this.flags)>0}is(e){if("string"==typeof e){if(this.name==e)return!0;let t=this.prop(vn.group);return!!t&&t.indexOf(e)>-1}return this.id==e}static match(e){let t=Object.create(null);for(let n in e)for(let i of n.split(" "))t[i]=e[n];return e=>{for(let n=e.prop(vn.group),i=-1;i<(n?n.length:0);i++){let o=t[i<0?e.name:n[i]];if(o)return o}}}}_n.none=new _n("",Object.create(null),0,8);class xn{constructor(e){this.types=e;for(let t=0;t<e.length;t++)if(e[t].id!=t)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...e){let t=[];for(let n of this.types){let i=null;for(let t of e){let e=t(n);if(e){i||(i=Object.assign({},n.props));let t=e[1],o=e[0];o.combine&&o.id in i&&(t=o.combine(i[o.id],t)),i[o.id]=t}}t.push(i?new _n(n.name,i,n.id,n.flags):n)}return new xn(t)}}const wn=new WeakMap,Cn=new WeakMap;var kn;!function(e){e[e.ExcludeBuffers=1]="ExcludeBuffers",e[e.IncludeAnonymous=2]="IncludeAnonymous",e[e.IgnoreMounts=4]="IgnoreMounts",e[e.IgnoreOverlays=8]="IgnoreOverlays",e[e.EnterBracketed=16]="EnterBracketed"}(kn||(kn={}));class On{constructor(e,t,n,i,o){if(this.type=e,this.children=t,this.positions=n,this.length=i,this.props=null,o&&o.length){this.props=Object.create(null);for(let[e,t]of o)this.props["number"==typeof e?e:e.id]=t}}toString(){let e=yn.get(this);if(e&&!e.overlay)return e.tree.toString();let t="";for(let e of this.children){let n=e.toString();n&&(t&&(t+=","),t+=n)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(t.length?"("+t+")":""):t}cursor(e=0){return new jn(this.topNode,e)}cursorAt(e,t=0,n=0){let i=wn.get(this)||this.topNode,o=new jn(i);return o.moveTo(e,t),wn.set(this,o._tree),o}get topNode(){return new An(this,0,0,null)}resolve(e,t=0){let n=Tn(wn.get(this)||this.topNode,e,t,!1);return wn.set(this,n),n}resolveInner(e,t=0){let n=Tn(Cn.get(this)||this.topNode,e,t,!0);return Cn.set(this,n),n}resolveStack(e,t=0){return function(e,t,n){let i=e.resolveInner(t,n),o=null;for(let e=i instanceof An?i:i.context.parent;e;e=e.parent)if(e.index<0){let r=e.parent;(o||(o=[i])).push(r.resolve(t,n)),e=r}else{let r=yn.get(e.tree);if(r&&r.overlay&&r.overlay[0].from<=t&&r.overlay[r.overlay.length-1].to>=t){let s=new An(r.tree,r.overlay[0].from+e.from,-1,e);(o||(o=[i])).push(Tn(s,t,n,!1))}}return o?Ln(o):i}(this,e,t)}iterate(e){let{enter:t,leave:n,from:i=0,to:o=this.length}=e,r=e.mode||0,s=(r&kn.IncludeAnonymous)>0;for(let e=this.cursor(r|kn.IncludeAnonymous);;){let r=!1;if(e.from<=o&&e.to>=i&&(!s&&e.type.isAnonymous||!1!==t(e))){if(e.firstChild())continue;r=!0}for(;r&&n&&(s||!e.type.isAnonymous)&&n(e),!e.nextSibling();){if(!e.parent())return;r=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:Fn(_n.none,this.children,this.positions,0,this.children.length,0,this.length,((e,t,n)=>new On(this.type,e,t,n,this.propValues)),e.makeTree||((e,t,n)=>new On(_n.none,e,t,n)))}static build(e){return function(e){var t;let{buffer:n,nodeSet:i,maxBufferLength:o=fn,reused:r=[],minRepeatType:s=i.types.length}=e,a=Array.isArray(n)?new En(n,n.length):n,l=i.types,c=0,u=0;function h(e,t,n,y,b,_){let{id:x,start:w,end:C,size:k}=a,O=u,E=c;if(k<0){if(a.next(),-1==k){let t=r[x];return n.push(t),void y.push(w-e)}if(-3==k)return void(c=x);if(-4==k)return void(u=x);throw new RangeError(`Unrecognized record size: ${k}`)}let S,P,T=l[x],R=w-e;if(C-w<=o&&(P=m(a.pos-t,b))){let t=new Uint16Array(P.size-P.skip),n=a.pos-P.size,o=t.length;for(;a.pos>n;)o=v(P.start,t,o);S=new Sn(t,C-P.start,i),R=P.start-e}else{let e=a.pos-k;a.next();let t=[],n=[],i=x>=s?x:-1,r=0,l=C;for(;a.pos>e;)i>=0&&a.id==i&&a.size>=0?(a.end<=l-o&&(f(t,n,w,r,a.end,l,i,O,E),r=t.length,l=a.end),a.next()):_>2500?d(w,e,t,n):h(w,e,t,n,i,_+1);if(i>=0&&r>0&&r<t.length&&f(t,n,w,r,w,l,i,O,E),t.reverse(),n.reverse(),i>-1&&r>0){let e=p(T,E);S=Fn(T,t,n,0,t.length,0,C-w,e,e)}else S=g(T,t,n,C-w,O-C,E)}n.push(S),y.push(R)}function d(e,t,n,r){let s=[],l=0,c=-1;for(;a.pos>t;){let{id:e,start:t,end:n,size:i}=a;if(i>4)a.next();else{if(c>-1&&t<c)break;c<0&&(c=n-o),s.push(e,t,n),l++,a.next()}}if(l){let t=new Uint16Array(4*l),o=s[s.length-2];for(let e=s.length-3,n=0;e>=0;e-=3)t[n++]=s[e],t[n++]=s[e+1]-o,t[n++]=s[e+2]-o,t[n++]=n;n.push(new Sn(t,s[2]-o,i)),r.push(o-e)}}function p(e,t){return(n,i,o)=>{let r,s,a=0,l=n.length-1;if(l>=0&&(r=n[l])instanceof On){if(!l&&r.type==e&&r.length==o)return r;(s=r.prop(vn.lookAhead))&&(a=i[l]+r.length+s)}return g(e,n,i,o,a,t)}}function f(e,t,n,o,r,s,a,l,c){let u=[],h=[];for(;e.length>o;)u.push(e.pop()),h.push(t.pop()+n-r);e.push(g(i.types[a],u,h,s-r,l-s,c)),t.push(r-n)}function g(e,t,n,i,o,r,s){if(r){let e=[vn.contextHash,r];s=s?[e].concat(s):[e]}if(o>25){let e=[vn.lookAhead,o];s=s?[e].concat(s):[e]}return new On(e,t,n,i,s)}function m(e,t){let n=a.fork(),i=0,r=0,l=0,c=n.end-o,u={size:0,start:0,skip:0};e:for(let o=n.pos-e;n.pos>o;){let e=n.size;if(n.id==t&&e>=0){u.size=i,u.start=r,u.skip=l,l+=4,i+=4,n.next();continue}let a=n.pos-e;if(e<0||a<o||n.start<c)break;let h=n.id>=s?4:0,d=n.start;for(n.next();n.pos>a;){if(n.size<0){if(-3!=n.size&&-4!=n.size)break e;h+=4}else n.id>=s&&(h+=4);n.next()}r=d,i+=e,l+=h}return(t<0||i==e)&&(u.size=i,u.start=r,u.skip=l),u.size>4?u:void 0}function v(e,t,n){let{id:i,start:o,end:r,size:l}=a;if(a.next(),l>=0&&i<s){let s=n;if(l>4){let i=a.pos-(l-4);for(;a.pos>i;)n=v(e,t,n)}t[--n]=s,t[--n]=r-e,t[--n]=o-e,t[--n]=i}else-3==l?c=i:-4==l&&(u=i);return n}let y=[],b=[];for(;a.pos>0;)h(e.start||0,e.bufferStart||0,y,b,-1,0);let _=null!==(t=e.length)&&void 0!==t?t:y.length?b[0]+y[0].length:0;return new On(l[e.topID],y.reverse(),b.reverse(),_)}(e)}}On.empty=new On(_n.none,[],[],0);class En{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new En(this.buffer,this.index)}}class Sn{constructor(e,t,n){this.buffer=e,this.length=t,this.set=n}get type(){return _n.none}toString(){let e=[];for(let t=0;t<this.buffer.length;)e.push(this.childString(t)),t=this.buffer[t+3];return e.join(",")}childString(e){let t=this.buffer[e],n=this.buffer[e+3],i=this.set.types[t],o=i.name;if(/\W/.test(o)&&!i.isError&&(o=JSON.stringify(o)),n==(e+=4))return o;let r=[];for(;e<n;)r.push(this.childString(e)),e=this.buffer[e+3];return o+"("+r.join(",")+")"}findChild(e,t,n,i,o){let{buffer:r}=this,s=-1;for(let a=e;a!=t&&!(Pn(o,i,r[a+1],r[a+2])&&(s=a,n>0));a=r[a+3]);return s}slice(e,t,n){let i=this.buffer,o=new Uint16Array(t-e),r=0;for(let s=e,a=0;s<t;){o[a++]=i[s++],o[a++]=i[s++]-n;let t=o[a++]=i[s++]-n;o[a++]=i[s++]-e,r=Math.max(r,t)}return new Sn(o,r,this.set)}}function Pn(e,t,n,i){switch(e){case-2:return n<t;case-1:return i>=t&&n<t;case 0:return n<t&&i>t;case 1:return n<=t&&i>t;case 2:return i>t;case 4:return!0}}function Tn(e,t,n,i){for(var o;e.from==e.to||(n<1?e.from>=t:e.from>t)||(n>-1?e.to<=t:e.to<t);){let t=!i&&e instanceof An&&e.index<0?null:e.parent;if(!t)return e;e=t}let r=i?0:kn.IgnoreOverlays;if(i)for(let i=e,s=i.parent;s;i=s,s=i.parent)i instanceof An&&i.index<0&&(null===(o=s.enter(t,n,r))||void 0===o?void 0:o.from)!=i.from&&(e=s);for(;;){let i=e.enter(t,n,r);if(!i)return e;e=i}}class Rn{cursor(e=0){return new jn(this,e)}getChild(e,t=null,n=null){let i=Mn(this,e,t,n);return i.length?i[0]:null}getChildren(e,t=null,n=null){return Mn(this,e,t,n)}resolve(e,t=0){return Tn(this,e,t,!1)}resolveInner(e,t=0){return Tn(this,e,t,!0)}matchContext(e){return Dn(this.parent,e)}enterUnfinishedNodesBefore(e){let t=this.childBefore(e),n=this;for(;t;){let e=t.lastChild;if(!e||e.to!=t.to)break;e.type.isError&&e.from==e.to?(n=t,t=e.prevSibling):t=e}return n}get node(){return this}get next(){return this.parent}}class An extends Rn{constructor(e,t,n,i){super(),this._tree=e,this.from=t,this.index=n,this._parent=i}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,t,n,i,o=0){for(let r=this;;){for(let{children:s,positions:a}=r._tree,l=t>0?s.length:-1;e!=l;e+=t){let l,c=s[e],u=a[e]+r.from;if(o&kn.EnterBracketed&&c instanceof On&&(l=yn.get(c))&&!l.overlay&&l.bracketed&&n>=u&&n<=u+c.length||Pn(i,n,u,u+c.length))if(c instanceof Sn){if(o&kn.ExcludeBuffers)continue;let s=c.findChild(0,c.buffer.length,t,n-u,i);if(s>-1)return new In(new $n(r,c,e,u),null,s)}else if(o&kn.IncludeAnonymous||!c.type.isAnonymous||Nn(c)){let s;if(!(o&kn.IgnoreMounts)&&(s=yn.get(c))&&!s.overlay)return new An(s.tree,u,e,r);let a=new An(c,u,e,r);return o&kn.IncludeAnonymous||!a.type.isAnonymous?a:a.nextChild(t<0?c.children.length-1:0,t,n,i,o)}}if(o&kn.IncludeAnonymous||!r.type.isAnonymous)return null;if(e=r.index>=0?r.index+t:t<0?-1:r._parent._tree.children.length,r=r._parent,!r)return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}prop(e){return this._tree.prop(e)}enter(e,t,n=0){let i;if(!(n&kn.IgnoreOverlays)&&(i=yn.get(this._tree))&&i.overlay){let o=e-this.from,r=n&kn.EnterBracketed&&i.bracketed;for(let{from:e,to:n}of i.overlay)if((t>0||r?e<=o:e<o)&&(t<0||r?n>=o:n>o))return new An(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,n)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function Mn(e,t,n,i){let o=e.cursor(),r=[];if(!o.firstChild())return r;if(null!=n)for(let e=!1;!e;)if(e=o.type.is(n),!o.nextSibling())return r;for(;;){if(null!=i&&o.type.is(i))return r;if(o.type.is(t)&&r.push(o.node),!o.nextSibling())return null==i?r:[]}}function Dn(e,t,n=t.length-1){for(let i=e;n>=0;i=i.parent){if(!i)return!1;if(!i.type.isAnonymous){if(t[n]&&t[n]!=i.name)return!1;n--}}return!0}class $n{constructor(e,t,n,i){this.parent=e,this.buffer=t,this.index=n,this.start=i}}class In extends Rn{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,n){super(),this.context=e,this._parent=t,this.index=n,this.type=e.buffer.set.types[e.buffer.buffer[n]]}child(e,t,n){let{buffer:i}=this.context,o=i.findChild(this.index+4,i.buffer[this.index+3],e,t-this.context.start,n);return o<0?null:new In(this.context,this,o)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}prop(e){return this.type.prop(e)}enter(e,t,n=0){if(n&kn.ExcludeBuffers)return null;let{buffer:i}=this.context,o=i.findChild(this.index+4,i.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return o<0?null:new In(this.context,this,o)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new In(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new In(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:n}=this.context,i=this.index+4,o=n.buffer[this.index+3];if(o>i){let r=n.buffer[this.index+1];e.push(n.slice(i,o,r)),t.push(0)}return new On(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function Ln(e){if(!e.length)return null;let t=0,n=e[0];for(let i=1;i<e.length;i++){let o=e[i];(o.from>n.from||o.to<n.to)&&(n=o,t=i)}let i=n instanceof An&&n.index<0?null:n.parent,o=e.slice();return i?o[t]=i:o.splice(t,1),new Bn(o,n)}class Bn{constructor(e,t){this.heads=e,this.node=t}get next(){return Ln(this.heads)}}class jn{get name(){return this.type.name}constructor(e,t=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=t&~kn.EnterBracketed,e instanceof An)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let t=e._parent;t;t=t._parent)this.stack.unshift(t.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return!!e&&(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0)}yieldBuf(e,t){this.index=e;let{start:n,buffer:i}=this.buffer;return this.type=t||i.set.types[i.buffer[e]],this.from=n+i.buffer[e+1],this.to=n+i.buffer[e+2],!0}yield(e){return!!e&&(e instanceof An?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)))}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,n){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,n,this.mode));let{buffer:i}=this.buffer,o=i.findChild(this.index+4,i.buffer[this.index+3],e,t-this.buffer.start,n);return!(o<0)&&(this.stack.push(this.index),this.yieldBuf(o))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,n=this.mode){return this.buffer?!(n&kn.ExcludeBuffers)&&this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,n))}parent(){if(!this.buffer)return this.yieldNode(this.mode&kn.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&kn.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return!!this._tree._parent&&this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode));let{buffer:t}=this.buffer,n=this.stack.length-1;if(e<0){let e=n<0?0:this.stack[n]+4;if(this.index!=e)return this.yieldBuf(t.findChild(e,this.index,-1,0,4))}else{let e=t.buffer[this.index+3];if(e<(n<0?t.buffer.length:t.buffer[this.stack[n]+3]))return this.yieldBuf(e)}return n<0&&this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode))}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,n,{buffer:i}=this;if(i){if(e>0){if(this.index<i.buffer.buffer.length)return!1}else for(let e=0;e<this.index;e++)if(i.buffer.buffer[e+3]<this.index)return!1;({index:t,parent:n}=i)}else({index:t,_parent:n}=this._tree);for(;n;({index:t,_parent:n}=n))if(t>-1)for(let i=t+e,o=e<0?-1:n._tree.children.length;i!=o;i+=e){let e=n._tree.children[i];if(this.mode&kn.IncludeAnonymous||e instanceof Sn||!e.type.isAnonymous||Nn(e))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,t););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,t=null,n=0;if(e&&e.context==this.buffer)e:for(let i=this.index,o=this.stack.length;o>=0;){for(let r=e;r;r=r._parent)if(r.index==i){if(i==this.index)return r;t=r,n=o+1;break e}i=this.stack[--o]}for(let e=n;e<this.stack.length;e++)t=new In(this.buffer,t,this.stack[e]);return this.bufferNode=new In(this.buffer,t,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,t){for(let n=0;;){let i=!1;if(this.type.isAnonymous||!1!==e(this)){if(this.firstChild()){n++;continue}this.type.isAnonymous||(i=!0)}for(;;){if(i&&t&&t(this),i=this.type.isAnonymous,!n)return;if(this.nextSibling())break;this.parent(),n--,i=!0}}}matchContext(e){if(!this.buffer)return Dn(this.node.parent,e);let{buffer:t}=this.buffer,{types:n}=t.set;for(let i=e.length-1,o=this.stack.length-1;i>=0;o--){if(o<0)return Dn(this._tree,e,i);let r=n[t.buffer[this.stack[o]]];if(!r.isAnonymous){if(e[i]&&e[i]!=r.name)return!1;i--}}return!0}}function Nn(e){return e.children.some((e=>e instanceof Sn||!e.type.isAnonymous||Nn(e)))}const qn=new WeakMap;function Vn(e,t){if(!e.isAnonymous||t instanceof Sn||t.type!=e)return 1;let n=qn.get(t);if(null==n)