graphwise-reactodia 0.0.1-TR1

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.
Files changed (42) hide show
  1. package/README.md +2 -0
  2. package/dist/cjs/app-globals-CcJr5lkF.js +23 -0
  3. package/dist/cjs/graphwise-reactodia.cjs.entry.js +45058 -0
  4. package/dist/cjs/graphwise-reactodia.cjs.js +25 -0
  5. package/dist/cjs/index-CII9aUQC.js +1212 -0
  6. package/dist/cjs/index.cjs.js +2 -0
  7. package/dist/cjs/loader.cjs.js +13 -0
  8. package/dist/collection/collection-manifest.json +13 -0
  9. package/dist/collection/components/graphwise-reactodia/graphwise-reactodia.css +10 -0
  10. package/dist/collection/components/graphwise-reactodia/graphwise-reactodia.js +182 -0
  11. package/dist/collection/components/graphwise-reactodia/i18n/translations.js +4 -0
  12. package/dist/collection/components/graphwise-reactodia/models/reactodia-app-props.js +1 -0
  13. package/dist/collection/components/graphwise-reactodia/reactodia-app.js +109 -0
  14. package/dist/collection/index.js +1 -0
  15. package/dist/collection/polyfill/polyfill-node.js +17 -0
  16. package/dist/esm/app-globals-CalY52z6.js +21 -0
  17. package/dist/esm/graphwise-reactodia.entry.js +45056 -0
  18. package/dist/esm/graphwise-reactodia.js +21 -0
  19. package/dist/esm/index-Cypw7ydc.js +1204 -0
  20. package/dist/esm/index.js +1 -0
  21. package/dist/esm/loader.js +11 -0
  22. package/dist/graphwise-reactodia/graphwise-reactodia.esm.js +1 -0
  23. package/dist/graphwise-reactodia/index.esm.js +0 -0
  24. package/dist/graphwise-reactodia/p-CalY52z6.js +1 -0
  25. package/dist/graphwise-reactodia/p-Cypw7ydc.js +2 -0
  26. package/dist/graphwise-reactodia/p-bafd6be5.entry.js +1 -0
  27. package/dist/index.cjs.js +1 -0
  28. package/dist/index.js +1 -0
  29. package/dist/types/components/graphwise-reactodia/graphwise-reactodia.d.ts +44 -0
  30. package/dist/types/components/graphwise-reactodia/i18n/translations.d.ts +343 -0
  31. package/dist/types/components/graphwise-reactodia/models/reactodia-app-props.d.ts +34 -0
  32. package/dist/types/components/graphwise-reactodia/reactodia-app.d.ts +21 -0
  33. package/dist/types/components.d.ts +109 -0
  34. package/dist/types/index.d.ts +1 -0
  35. package/dist/types/polyfill/polyfill-node.d.ts +9 -0
  36. package/dist/types/stencil-public-runtime.d.ts +1702 -0
  37. package/loader/cdn.js +1 -0
  38. package/loader/index.cjs.js +1 -0
  39. package/loader/index.d.ts +24 -0
  40. package/loader/index.es2017.js +1 -0
  41. package/loader/index.js +2 -0
  42. package/package.json +30 -0
@@ -0,0 +1 @@
1
+ import{r as t,h as e,H as n,g as r}from"./p-Cypw7ydc.js";var i,o,a="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function s(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function l(t){if(t.__esModule)return t;var e=t.default;if("function"==typeof e){var n=function t(){return this instanceof t?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach((function(e){var r=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(n,e,r.get?r:{enumerable:!0,get:function(){return t[e]}})})),n}function c(){return o?i:(o=1,i=a.process)}var u,d,h=c(),f=s(h),p={exports:{}},g={};function v(){if(u)return g;u=1;var t=Symbol.for("react.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),a=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),c=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),h=Symbol.iterator,f={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},p=Object.assign,v={};function m(t,e,n){this.props=t,this.context=e,this.refs=v,this.updater=n||f}function b(){}function w(t,e,n){this.props=t,this.context=e,this.refs=v,this.updater=n||f}m.prototype.isReactComponent={},m.prototype.setState=function(t,e){if("object"!=typeof t&&"function"!=typeof t&&null!=t)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")},m.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")},b.prototype=m.prototype;var y=w.prototype=new b;y.constructor=w,p(y,m.prototype),y.isPureReactComponent=!0;var _=Array.isArray,k=Object.prototype.hasOwnProperty,x={current:null},S={key:!0,ref:!0,__self:!0,__source:!0};function E(e,n,r){var i,o={},a=null,s=null;if(null!=n)for(i in void 0!==n.ref&&(s=n.ref),void 0!==n.key&&(a=""+n.key),n)k.call(n,i)&&!S.hasOwnProperty(i)&&(o[i]=n[i]);var l=arguments.length-2;if(1===l)o.children=r;else if(1<l){for(var c=Array(l),u=0;u<l;u++)c[u]=arguments[u+2];o.children=c}if(e&&e.defaultProps)for(i in l=e.defaultProps)void 0===o[i]&&(o[i]=l[i]);return{$$typeof:t,type:e,key:a,ref:s,props:o,_owner:x.current}}function C(e){return"object"==typeof e&&null!==e&&e.$$typeof===t}var M=/\/+/g;function L(t,e){return"object"==typeof t&&null!==t&&null!=t.key?function(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,(function(t){return e[t]}))}(""+t.key):e.toString(36)}function $(n,r,i,o,a){var s=typeof n;"undefined"!==s&&"boolean"!==s||(n=null);var l=!1;if(null===n)l=!0;else switch(s){case"string":case"number":l=!0;break;case"object":switch(n.$$typeof){case t:case e:l=!0}}if(l)return a=a(l=n),n=""===o?"."+L(l,0):o,_(a)?(i="",null!=n&&(i=n.replace(M,"$&/")+"/"),$(a,r,i,"",(function(t){return t}))):null!=a&&(C(a)&&(a=function(e,n){return{$$typeof:t,type:e.type,key:n,ref:e.ref,props:e.props,_owner:e._owner}}(a,i+(!a.key||l&&l.key===a.key?"":(""+a.key).replace(M,"$&/")+"/")+n)),r.push(a)),1;if(l=0,o=""===o?".":o+":",_(n))for(var c=0;c<n.length;c++){var u=o+L(s=n[c],c);l+=$(s,r,i,u,a)}else if(u=function(t){return null===t||"object"!=typeof t?null:"function"==typeof(t=h&&t[h]||t["@@iterator"])?t:null}(n),"function"==typeof u)for(n=u.call(n),c=0;!(s=n.next()).done;)l+=$(s=s.value,r,i,u=o+L(s,c++),a);else if("object"===s)throw r=String(n),Error("Objects are not valid as a React child (found: "+("[object Object]"===r?"object with keys {"+Object.keys(n).join(", ")+"}":r)+"). If you meant to render a collection of children, use an array instead.");return l}function N(t,e,n){if(null==t)return t;var r=[],i=0;return $(t,r,"","",(function(t){return e.call(n,t,i++)})),r}function T(t){if(-1===t._status){var e=t._result;(e=e()).then((function(e){0!==t._status&&-1!==t._status||(t._status=1,t._result=e)}),(function(e){0!==t._status&&-1!==t._status||(t._status=2,t._result=e)})),-1===t._status&&(t._status=0,t._result=e)}if(1===t._status)return t._result.default;throw t._result}var A={current:null},z={transition:null},I={ReactCurrentDispatcher:A,ReactCurrentBatchConfig:z,ReactCurrentOwner:x};function R(){throw Error("act(...) is not supported in production builds of React.")}return g.Children={map:N,forEach:function(t,e,n){N(t,(function(){e.apply(this,arguments)}),n)},count:function(t){var e=0;return N(t,(function(){e++})),e},toArray:function(t){return N(t,(function(t){return t}))||[]},only:function(t){if(!C(t))throw Error("React.Children.only expected to receive a single React element child.");return t}},g.Component=m,g.Fragment=n,g.Profiler=i,g.PureComponent=w,g.StrictMode=r,g.Suspense=l,g.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=I,g.act=R,g.cloneElement=function(e,n,r){if(null==e)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var i=p({},e.props),o=e.key,a=e.ref,s=e._owner;if(null!=n){if(void 0!==n.ref&&(a=n.ref,s=x.current),void 0!==n.key&&(o=""+n.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(c in n)k.call(n,c)&&!S.hasOwnProperty(c)&&(i[c]=void 0===n[c]&&void 0!==l?l[c]:n[c])}var c=arguments.length-2;if(1===c)i.children=r;else if(1<c){l=Array(c);for(var u=0;u<c;u++)l[u]=arguments[u+2];i.children=l}return{$$typeof:t,type:e.type,key:o,ref:a,props:i,_owner:s}},g.createContext=function(t){return(t={$$typeof:a,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null}).Provider={$$typeof:o,_context:t},t.Consumer=t},g.createElement=E,g.createFactory=function(t){var e=E.bind(null,t);return e.type=t,e},g.createRef=function(){return{current:null}},g.forwardRef=function(t){return{$$typeof:s,render:t}},g.isValidElement=C,g.lazy=function(t){return{$$typeof:d,_payload:{_status:-1,_result:t},_init:T}},g.memo=function(t,e){return{$$typeof:c,type:t,compare:void 0===e?null:e}},g.startTransition=function(t){var e=z.transition;z.transition={};try{t()}finally{z.transition=e}},g.unstable_act=R,g.useCallback=function(t,e){return A.current.useCallback(t,e)},g.useContext=function(t){return A.current.useContext(t)},g.useDebugValue=function(){},g.useDeferredValue=function(t){return A.current.useDeferredValue(t)},g.useEffect=function(t,e){return A.current.useEffect(t,e)},g.useId=function(){return A.current.useId()},g.useImperativeHandle=function(t,e,n){return A.current.useImperativeHandle(t,e,n)},g.useInsertionEffect=function(t,e){return A.current.useInsertionEffect(t,e)},g.useLayoutEffect=function(t,e){return A.current.useLayoutEffect(t,e)},g.useMemo=function(t,e){return A.current.useMemo(t,e)},g.useReducer=function(t,e,n){return A.current.useReducer(t,e,n)},g.useRef=function(t){return A.current.useRef(t)},g.useState=function(t){return A.current.useState(t)},g.useSyncExternalStore=function(t,e,n){return A.current.useSyncExternalStore(t,e,n)},g.useTransition=function(){return A.current.useTransition()},g.version="18.3.1",g}function m(){return d||(d=1,p.exports=v()),p.exports}var b,w,y,_,k,x=m(),S=s(x),E={},C={exports:{}},M={},L={exports:{}},$={};function N(){if(y)return M;y=1;var t=m(),e=(w||(w=1,L.exports=(b||(b=1,function(t){function e(t,e){var n=t.length;t.push(e);t:for(;0<n;){var r=n-1>>>1,o=t[r];if(!(0<i(o,e)))break t;t[r]=e,t[n]=o,n=r}}function n(t){return 0===t.length?null:t[0]}function r(t){if(0===t.length)return null;var e=t[0],n=t.pop();if(n!==e){t[0]=n;t:for(var r=0,o=t.length,a=o>>>1;r<a;){var s=2*(r+1)-1,l=t[s],c=s+1,u=t[c];if(0>i(l,n))c<o&&0>i(u,l)?(t[r]=u,t[c]=n,r=c):(t[r]=l,t[s]=n,r=s);else{if(!(c<o&&0>i(u,n)))break t;t[r]=u,t[c]=n,r=c}}}return e}function i(t,e){var n=t.sortIndex-e.sortIndex;return 0!==n?n:t.id-e.id}if("object"==typeof performance&&"function"==typeof performance.now){var o=performance;t.unstable_now=function(){return o.now()}}else{var a=Date,s=a.now();t.unstable_now=function(){return a.now()-s}}var l=[],c=[],u=1,d=null,h=3,f=!1,p=!1,g=!1,v="function"==typeof setTimeout?setTimeout:null,m="function"==typeof clearTimeout?clearTimeout:null,b="undefined"!=typeof setImmediate?setImmediate:null;function w(t){for(var i=n(c);null!==i;){if(null===i.callback)r(c);else{if(!(i.startTime<=t))break;r(c),i.sortIndex=i.expirationTime,e(l,i)}i=n(c)}}function y(t){if(g=!1,w(t),!p)if(null!==n(l))p=!0,A(_);else{var e=n(c);null!==e&&z(y,e.startTime-t)}}function _(e,i){p=!1,g&&(g=!1,m(E),E=-1),f=!0;var o=h;try{for(w(i),d=n(l);null!==d&&(!(d.expirationTime>i)||e&&!L());){var a=d.callback;if("function"==typeof a){d.callback=null,h=d.priorityLevel;var s=a(d.expirationTime<=i);i=t.unstable_now(),"function"==typeof s?d.callback=s:d===n(l)&&r(l),w(i)}else r(l);d=n(l)}if(null!==d)var u=!0;else{var v=n(c);null!==v&&z(y,v.startTime-i),u=!1}return u}finally{d=null,h=o,f=!1}}"undefined"!=typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var k,x=!1,S=null,E=-1,C=5,M=-1;function L(){return!(t.unstable_now()-M<C)}function $(){if(null!==S){var e=t.unstable_now();M=e;var n=!0;try{n=S(!0,e)}finally{n?k():(x=!1,S=null)}}else x=!1}if("function"==typeof b)k=function(){b($)};else if("undefined"!=typeof MessageChannel){var N=new MessageChannel,T=N.port2;N.port1.onmessage=$,k=function(){T.postMessage(null)}}else k=function(){v($,0)};function A(t){S=t,x||(x=!0,k())}function z(e,n){E=v((function(){e(t.unstable_now())}),n)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(t){t.callback=null},t.unstable_continueExecution=function(){p||f||(p=!0,A(_))},t.unstable_forceFrameRate=function(t){0>t||125<t?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):C=0<t?Math.floor(1e3/t):5},t.unstable_getCurrentPriorityLevel=function(){return h},t.unstable_getFirstCallbackNode=function(){return n(l)},t.unstable_next=function(t){switch(h){case 1:case 2:case 3:var e=3;break;default:e=h}var n=h;h=e;try{return t()}finally{h=n}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(t,e){switch(t){case 1:case 2:case 3:case 4:case 5:break;default:t=3}var n=h;h=t;try{return e()}finally{h=n}},t.unstable_scheduleCallback=function(r,i,o){var a=t.unstable_now();switch(o="object"==typeof o&&null!==o&&"number"==typeof(o=o.delay)&&0<o?a+o:a,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return r={id:u++,callback:i,priorityLevel:r,startTime:o,expirationTime:s=o+s,sortIndex:-1},o>a?(r.sortIndex=o,e(c,r),null===n(l)&&r===n(c)&&(g?(m(E),E=-1):g=!0,z(y,o-a))):(r.sortIndex=s,e(l,r),p||f||(p=!0,A(_))),r},t.unstable_shouldYield=L,t.unstable_wrapCallback=function(t){var e=h;return function(){var n=h;h=e;try{return t.apply(this,arguments)}finally{h=n}}}}($)),$)),L.exports);function n(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n<arguments.length;n++)e+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var r=new Set,i={};function o(t,e){a(t,e),a(t+"Capture",e)}function a(t,e){for(i[t]=e,t=0;t<e.length;t++)r.add(e[t])}var s=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement),l=Object.prototype.hasOwnProperty,c=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,u={},d={};function h(t,e,n,r,i,o,a){this.acceptsBooleans=2===e||3===e||4===e,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=t,this.type=e,this.sanitizeURL=o,this.removeEmptyString=a}var f={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach((function(t){f[t]=new h(t,0,!1,t,null,!1,!1)})),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach((function(t){var e=t[0];f[e]=new h(e,1,!1,t[1],null,!1,!1)})),["contentEditable","draggable","spellCheck","value"].forEach((function(t){f[t]=new h(t,2,!1,t.toLowerCase(),null,!1,!1)})),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach((function(t){f[t]=new h(t,2,!1,t,null,!1,!1)})),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach((function(t){f[t]=new h(t,3,!1,t.toLowerCase(),null,!1,!1)})),["checked","multiple","muted","selected"].forEach((function(t){f[t]=new h(t,3,!0,t,null,!1,!1)})),["capture","download"].forEach((function(t){f[t]=new h(t,4,!1,t,null,!1,!1)})),["cols","rows","size","span"].forEach((function(t){f[t]=new h(t,6,!1,t,null,!1,!1)})),["rowSpan","start"].forEach((function(t){f[t]=new h(t,5,!1,t.toLowerCase(),null,!1,!1)}));var p=/[\-:]([a-z])/g;function g(t){return t[1].toUpperCase()}function v(t,e,n,r){var i=f.hasOwnProperty(e)?f[e]:null;(null!==i?0!==i.type:r||!(2<e.length)||"o"!==e[0]&&"O"!==e[0]||"n"!==e[1]&&"N"!==e[1])&&(function(t,e,n,r){if(null==e||function(t,e,n,r){if(null!==n&&0===n.type)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return!r&&(null!==n?!n.acceptsBooleans:"data-"!==(t=t.toLowerCase().slice(0,5))&&"aria-"!==t);default:return!1}}(t,e,n,r))return!0;if(r)return!1;if(null!==n)switch(n.type){case 3:return!e;case 4:return!1===e;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}(e,n,i,r)&&(n=null),r||null===i?function(t){return!!l.call(d,t)||!l.call(u,t)&&(c.test(t)?d[t]=!0:(u[t]=!0,!1))}(e)&&(null===n?t.removeAttribute(e):t.setAttribute(e,""+n)):i.mustUseProperty?t[i.propertyName]=null===n?3!==i.type&&"":n:(e=i.attributeName,r=i.attributeNamespace,null===n?t.removeAttribute(e):(n=3===(i=i.type)||4===i&&!0===n?"":""+n,r?t.setAttributeNS(r,e,n):t.setAttribute(e,n))))}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent 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 unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach((function(t){var e=t.replace(p,g);f[e]=new h(e,1,!1,t,null,!1,!1)})),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach((function(t){var e=t.replace(p,g);f[e]=new h(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)})),["xml:base","xml:lang","xml:space"].forEach((function(t){var e=t.replace(p,g);f[e]=new h(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)})),["tabIndex","crossOrigin"].forEach((function(t){f[t]=new h(t,1,!1,t.toLowerCase(),null,!1,!1)})),f.xlinkHref=new h("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach((function(t){f[t]=new h(t,1,!1,t.toLowerCase(),null,!0,!0)}));var _=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,k=Symbol.for("react.element"),x=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),N=Symbol.for("react.provider"),T=Symbol.for("react.context"),A=Symbol.for("react.forward_ref"),z=Symbol.for("react.suspense"),I=Symbol.for("react.suspense_list"),R=Symbol.for("react.memo"),O=Symbol.for("react.lazy"),P=Symbol.for("react.offscreen"),V=Symbol.iterator;function j(t){return null===t||"object"!=typeof t?null:"function"==typeof(t=V&&t[V]||t["@@iterator"])?t:null}var D,H=Object.assign;function B(t){if(void 0===D)try{throw Error()}catch(t){var e=t.stack.trim().match(/\n( *(at )?)/);D=e&&e[1]||""}return"\n"+D+t}var F=!1;function U(t,e){if(!t||F)return"";F=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(e)if(e=function(){throw Error()},Object.defineProperty(e.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(e,[])}catch(t){var r=t}Reflect.construct(t,[],e)}else{try{e.call()}catch(t){r=t}t.call(e.prototype)}else{try{throw Error()}catch(t){r=t}t()}}catch(e){if(e&&r&&"string"==typeof e.stack){for(var i=e.stack.split("\n"),o=r.stack.split("\n"),a=i.length-1,s=o.length-1;1<=a&&0<=s&&i[a]!==o[s];)s--;for(;1<=a&&0<=s;a--,s--)if(i[a]!==o[s]){if(1!==a||1!==s)do{if(a--,0>--s||i[a]!==o[s]){var l="\n"+i[a].replace(" at new "," at ");return t.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",t.displayName)),l}}while(1<=a&&0<=s);break}}}finally{F=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?B(t):""}function W(t){switch(t.tag){case 5:return B(t.type);case 16:return B("Lazy");case 13:return B("Suspense");case 19:return B("SuspenseList");case 0:case 2:case 15:return U(t.type,!1);case 11:return U(t.type.render,!1);case 1:return U(t.type,!0);default:return""}}function q(t){if(null==t)return null;if("function"==typeof t)return t.displayName||t.name||null;if("string"==typeof t)return t;switch(t){case S:return"Fragment";case x:return"Portal";case C:return"Profiler";case E:return"StrictMode";case z:return"Suspense";case I:return"SuspenseList"}if("object"==typeof t)switch(t.$$typeof){case T:return(t.displayName||"Context")+".Consumer";case N:return(t._context.displayName||"Context")+".Provider";case A:var e=t.render;return(t=t.displayName)||(t=""!==(t=e.displayName||e.name||"")?"ForwardRef("+t+")":"ForwardRef"),t;case R:return null!==(e=t.displayName||null)?e:q(t.type)||"Memo";case O:e=t._payload,t=t._init;try{return q(t(e))}catch(t){}}return null}function G(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=(t=e.render).displayName||t.name||"",e.displayName||(""!==t?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return q(e);case 8:return e===E?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if("function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e}return null}function Z(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":case"object":return t;default:return""}}function K(t){var e=t.type;return(t=t.nodeName)&&"input"===t.toLowerCase()&&("checkbox"===e||"radio"===e)}function Q(t){t._valueTracker||(t._valueTracker=function(t){var e=K(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),r=""+t[e];if(!t.hasOwnProperty(e)&&void 0!==n&&"function"==typeof n.get&&"function"==typeof n.set){var i=n.get,o=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(t){r=""+t,o.call(this,t)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(t){r=""+t},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}(t))}function X(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=K(t)?t.checked?"true":"false":t.value),(t=r)!==n&&(e.setValue(t),!0)}function Y(t){if(void 0===(t=t||("undefined"!=typeof document?document:void 0)))return null;try{return t.activeElement||t.body}catch(e){return t.body}}function J(t,e){var n=e.checked;return H({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=n?n:t._wrapperState.initialChecked})}function tt(t,e){var n=null==e.defaultValue?"":e.defaultValue,r=null!=e.checked?e.checked:e.defaultChecked;n=Z(null!=e.value?e.value:n),t._wrapperState={initialChecked:r,initialValue:n,controlled:"checkbox"===e.type||"radio"===e.type?null!=e.checked:null!=e.value}}function et(t,e){null!=(e=e.checked)&&v(t,"checked",e,!1)}function nt(t,e){et(t,e);var n=Z(e.value),r=e.type;if(null!=n)"number"===r?(0===n&&""===t.value||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if("submit"===r||"reset"===r)return void t.removeAttribute("value");e.hasOwnProperty("value")?it(t,e.type,n):e.hasOwnProperty("defaultValue")&&it(t,e.type,Z(e.defaultValue)),null==e.checked&&null!=e.defaultChecked&&(t.defaultChecked=!!e.defaultChecked)}function rt(t,e,n){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var r=e.type;if(("submit"===r||"reset"===r)&&null==e.value)return;e=""+t._wrapperState.initialValue,n||e===t.value||(t.value=e),t.defaultValue=e}""!==(n=t.name)&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,""!==n&&(t.name=n)}function it(t,e,n){"number"===e&&Y(t.ownerDocument)===t||(null==n?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var ot=Array.isArray;function at(t,e,n,r){if(t=t.options,e){e={};for(var i=0;i<n.length;i++)e["$"+n[i]]=!0;for(n=0;n<t.length;n++)i=e.hasOwnProperty("$"+t[n].value),t[n].selected!==i&&(t[n].selected=i),i&&r&&(t[n].defaultSelected=!0)}else{for(n=""+Z(n),e=null,i=0;i<t.length;i++){if(t[i].value===n)return t[i].selected=!0,void(r&&(t[i].defaultSelected=!0));null!==e||t[i].disabled||(e=t[i])}null!==e&&(e.selected=!0)}}function st(t,e){if(null!=e.dangerouslySetInnerHTML)throw Error(n(91));return H({},e,{value:void 0,defaultValue:void 0,children:""+t._wrapperState.initialValue})}function lt(t,e){var r=e.value;if(null==r){if(r=e.children,e=e.defaultValue,null!=r){if(null!=e)throw Error(n(92));if(ot(r)){if(1<r.length)throw Error(n(93));r=r[0]}e=r}null==e&&(e=""),r=e}t._wrapperState={initialValue:Z(r)}}function ct(t,e){var n=Z(e.value),r=Z(e.defaultValue);null!=n&&((n=""+n)!==t.value&&(t.value=n),null==e.defaultValue&&t.defaultValue!==n&&(t.defaultValue=n)),null!=r&&(t.defaultValue=""+r)}function ut(t){var e=t.textContent;e===t._wrapperState.initialValue&&""!==e&&null!==e&&(t.value=e)}function dt(t){switch(t){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function ht(t,e){return null==t||"http://www.w3.org/1999/xhtml"===t?dt(e):"http://www.w3.org/2000/svg"===t&&"foreignObject"===e?"http://www.w3.org/1999/xhtml":t}var ft,pt,gt=(pt=function(t,e){if("http://www.w3.org/2000/svg"!==t.namespaceURI||"innerHTML"in t)t.innerHTML=e;else{for((ft=ft||document.createElement("div")).innerHTML="<svg>"+e.valueOf().toString()+"</svg>",e=ft.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}},"undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction?function(t,e){MSApp.execUnsafeLocalFunction((function(){return pt(t,e)}))}:pt);function vt(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&3===n.nodeType)return void(n.nodeValue=e)}t.textContent=e}var mt={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},bt=["Webkit","ms","Moz","O"];function wt(t,e,n){return null==e||"boolean"==typeof e||""===e?"":n||"number"!=typeof e||0===e||mt.hasOwnProperty(t)&&mt[t]?(""+e).trim():e+"px"}function yt(t,e){for(var n in t=t.style,e)if(e.hasOwnProperty(n)){var r=0===n.indexOf("--"),i=wt(n,e[n],r);"float"===n&&(n="cssFloat"),r?t.setProperty(n,i):t[n]=i}}Object.keys(mt).forEach((function(t){bt.forEach((function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),mt[e]=mt[t]}))}));var _t=H({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function kt(t,e){if(e){if(_t[t]&&(null!=e.children||null!=e.dangerouslySetInnerHTML))throw Error(n(137,t));if(null!=e.dangerouslySetInnerHTML){if(null!=e.children)throw Error(n(60));if("object"!=typeof e.dangerouslySetInnerHTML||!("__html"in e.dangerouslySetInnerHTML))throw Error(n(61))}if(null!=e.style&&"object"!=typeof e.style)throw Error(n(62))}}function xt(t,e){if(-1===t.indexOf("-"))return"string"==typeof e.is;switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var St=null;function Et(t){return(t=t.target||t.srcElement||window).correspondingUseElement&&(t=t.correspondingUseElement),3===t.nodeType?t.parentNode:t}var Ct=null,Mt=null,Lt=null;function $t(t){if(t=xi(t)){if("function"!=typeof Ct)throw Error(n(280));var e=t.stateNode;e&&(e=Ei(e),Ct(t.stateNode,t.type,e))}}function Nt(t){Mt?Lt?Lt.push(t):Lt=[t]:Mt=t}function Tt(){if(Mt){var t=Mt,e=Lt;if(Lt=Mt=null,$t(t),e)for(t=0;t<e.length;t++)$t(e[t])}}function At(t,e){return t(e)}function zt(){}var It=!1;function Rt(t,e,n){if(It)return t(e,n);It=!0;try{return At(t,e,n)}finally{It=!1,(null!==Mt||null!==Lt)&&(zt(),Tt())}}function Ot(t,e){var r=t.stateNode;if(null===r)return null;var i=Ei(r);if(null===i)return null;r=i[e];t:switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(i=!i.disabled)||(i=!("button"===(t=t.type)||"input"===t||"select"===t||"textarea"===t)),t=!i;break t;default:t=!1}if(t)return null;if(r&&"function"!=typeof r)throw Error(n(231,e,typeof r));return r}var Pt=!1;if(s)try{var Vt={};Object.defineProperty(Vt,"passive",{get:function(){Pt=!0}}),window.addEventListener("test",Vt,Vt),window.removeEventListener("test",Vt,Vt)}catch(pt){Pt=!1}function jt(t,e,n,r,i,o,a,s,l){var c=Array.prototype.slice.call(arguments,3);try{e.apply(n,c)}catch(t){this.onError(t)}}var Dt=!1,Ht=null,Bt=!1,Ft=null,Ut={onError:function(t){Dt=!0,Ht=t}};function Wt(t,e,n,r,i,o,a,s,l){Dt=!1,Ht=null,jt.apply(Ut,arguments)}function qt(t){var e=t,n=t;if(t.alternate)for(;e.return;)e=e.return;else{t=e;do{!!(4098&(e=t).flags)&&(n=e.return),t=e.return}while(t)}return 3===e.tag?n:null}function Gt(t){if(13===t.tag){var e=t.memoizedState;if(null===e&&null!==(t=t.alternate)&&(e=t.memoizedState),null!==e)return e.dehydrated}return null}function Zt(t){if(qt(t)!==t)throw Error(n(188))}function Kt(t){return t=function(t){var e=t.alternate;if(!e){if(null===(e=qt(t)))throw Error(n(188));return e!==t?null:t}for(var r=t,i=e;;){var o=r.return;if(null===o)break;var a=o.alternate;if(null===a){if(null!==(i=o.return)){r=i;continue}break}if(o.child===a.child){for(a=o.child;a;){if(a===r)return Zt(o),t;if(a===i)return Zt(o),e;a=a.sibling}throw Error(n(188))}if(r.return!==i.return)r=o,i=a;else{for(var s=!1,l=o.child;l;){if(l===r){s=!0,r=o,i=a;break}if(l===i){s=!0,i=o,r=a;break}l=l.sibling}if(!s){for(l=a.child;l;){if(l===r){s=!0,r=a,i=o;break}if(l===i){s=!0,i=a,r=o;break}l=l.sibling}if(!s)throw Error(n(189))}}if(r.alternate!==i)throw Error(n(190))}if(3!==r.tag)throw Error(n(188));return r.stateNode.current===r?t:e}(t),null!==t?Qt(t):null}function Qt(t){if(5===t.tag||6===t.tag)return t;for(t=t.child;null!==t;){var e=Qt(t);if(null!==e)return e;t=t.sibling}return null}var Xt=e.unstable_scheduleCallback,Yt=e.unstable_cancelCallback,Jt=e.unstable_shouldYield,te=e.unstable_requestPaint,ee=e.unstable_now,ne=e.unstable_getCurrentPriorityLevel,re=e.unstable_ImmediatePriority,ie=e.unstable_UserBlockingPriority,oe=e.unstable_NormalPriority,ae=e.unstable_LowPriority,se=e.unstable_IdlePriority,le=null,ce=null,ue=Math.clz32?Math.clz32:function(t){return 0===(t>>>=0)?32:31-(de(t)/he|0)|0},de=Math.log,he=Math.LN2,fe=64,pe=4194304;function ge(t){switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return 4194240&t;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return 130023424&t;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function ve(t,e){var n=t.pendingLanes;if(0===n)return 0;var r=0,i=t.suspendedLanes,o=t.pingedLanes,a=268435455&n;if(0!==a){var s=a&~i;0!==s?r=ge(s):0!=(o&=a)&&(r=ge(o))}else 0!=(a=n&~i)?r=ge(a):0!==o&&(r=ge(o));if(0===r)return 0;if(0!==e&&e!==r&&!(e&i)&&((i=r&-r)>=(o=e&-e)||16===i&&4194240&o))return e;if(4&r&&(r|=16&n),0!==(e=t.entangledLanes))for(t=t.entanglements,e&=r;0<e;)r|=t[n=31-ue(e)],e&=~(i=1<<n);return r}function me(t,e){switch(t){case 1:case 2:case 4:return e+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e+5e3;default:return-1}}function be(t){return 0!=(t=-1073741825&t.pendingLanes)?t:1073741824&t?1073741824:0}function we(){var t=fe;return!(4194240&(fe<<=1))&&(fe=64),t}function ye(t){for(var e=[],n=0;31>n;n++)e.push(t);return e}function _e(t,e,n){t.pendingLanes|=e,536870912!==e&&(t.suspendedLanes=0,t.pingedLanes=0),(t=t.eventTimes)[e=31-ue(e)]=n}function ke(t,e){var n=t.entangledLanes|=e;for(t=t.entanglements;n;){var r=31-ue(n),i=1<<r;i&e|t[r]&e&&(t[r]|=e),n&=~i}}var xe=0;function Se(t){return 1<(t&=-t)?4<t?268435455&t?16:536870912:4:1}var Ee,Ce,Me,Le,$e,Ne=!1,Te=[],Ae=null,ze=null,Ie=null,Re=new Map,Oe=new Map,Pe=[],Ve="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function je(t,e){switch(t){case"focusin":case"focusout":Ae=null;break;case"dragenter":case"dragleave":ze=null;break;case"mouseover":case"mouseout":Ie=null;break;case"pointerover":case"pointerout":Re.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":Oe.delete(e.pointerId)}}function De(t,e,n,r,i,o){return null===t||t.nativeEvent!==o?(t={blockedOn:e,domEventName:n,eventSystemFlags:r,nativeEvent:o,targetContainers:[i]},null!==e&&null!==(e=xi(e))&&Ce(e),t):(t.eventSystemFlags|=r,e=t.targetContainers,null!==i&&-1===e.indexOf(i)&&e.push(i),t)}function He(t){var e=ki(t.target);if(null!==e){var n=qt(e);if(null!==n)if(13===(e=n.tag)){if(null!==(e=Gt(n)))return t.blockedOn=e,void $e(t.priority,(function(){Me(n)}))}else if(3===e&&n.stateNode.current.memoizedState.isDehydrated)return void(t.blockedOn=3===n.tag?n.stateNode.containerInfo:null)}t.blockedOn=null}function Be(t){if(null!==t.blockedOn)return!1;for(var e=t.targetContainers;0<e.length;){var n=Je(t.domEventName,t.eventSystemFlags,e[0],t.nativeEvent);if(null!==n)return null!==(e=xi(n))&&Ce(e),t.blockedOn=n,!1;var r=new(n=t.nativeEvent).constructor(n.type,n);St=r,n.target.dispatchEvent(r),St=null,e.shift()}return!0}function Fe(t,e,n){Be(t)&&n.delete(e)}function Ue(){Ne=!1,null!==Ae&&Be(Ae)&&(Ae=null),null!==ze&&Be(ze)&&(ze=null),null!==Ie&&Be(Ie)&&(Ie=null),Re.forEach(Fe),Oe.forEach(Fe)}function We(t,n){t.blockedOn===n&&(t.blockedOn=null,Ne||(Ne=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,Ue)))}function qe(t){function e(e){return We(e,t)}if(0<Te.length){We(Te[0],t);for(var n=1;n<Te.length;n++){var r=Te[n];r.blockedOn===t&&(r.blockedOn=null)}}for(null!==Ae&&We(Ae,t),null!==ze&&We(ze,t),null!==Ie&&We(Ie,t),Re.forEach(e),Oe.forEach(e),n=0;n<Pe.length;n++)(r=Pe[n]).blockedOn===t&&(r.blockedOn=null);for(;0<Pe.length&&null===(n=Pe[0]).blockedOn;)He(n),null===n.blockedOn&&Pe.shift()}var Ge=_.ReactCurrentBatchConfig,Ze=!0;function Ke(t,e,n,r){var i=xe,o=Ge.transition;Ge.transition=null;try{xe=1,Xe(t,e,n,r)}finally{xe=i,Ge.transition=o}}function Qe(t,e,n,r){var i=xe,o=Ge.transition;Ge.transition=null;try{xe=4,Xe(t,e,n,r)}finally{xe=i,Ge.transition=o}}function Xe(t,e,n,r){if(Ze){var i=Je(t,e,n,r);if(null===i)Zr(t,e,r,Ye,n),je(t,r);else if(function(t,e,n,r,i){switch(e){case"focusin":return Ae=De(Ae,t,e,n,r,i),!0;case"dragenter":return ze=De(ze,t,e,n,r,i),!0;case"mouseover":return Ie=De(Ie,t,e,n,r,i),!0;case"pointerover":var o=i.pointerId;return Re.set(o,De(Re.get(o)||null,t,e,n,r,i)),!0;case"gotpointercapture":return Oe.set(o=i.pointerId,De(Oe.get(o)||null,t,e,n,r,i)),!0}return!1}(i,t,e,n,r))r.stopPropagation();else if(je(t,r),4&e&&-1<Ve.indexOf(t)){for(;null!==i;){var o=xi(i);if(null!==o&&Ee(o),null===(o=Je(t,e,n,r))&&Zr(t,e,r,Ye,n),o===i)break;i=o}null!==i&&r.stopPropagation()}else Zr(t,e,r,null,n)}}var Ye=null;function Je(t,e,n,r){if(Ye=null,null!==(t=ki(t=Et(r))))if(null===(e=qt(t)))t=null;else if(13===(n=e.tag)){if(null!==(t=Gt(e)))return t;t=null}else if(3===n){if(e.stateNode.current.memoizedState.isDehydrated)return 3===e.tag?e.stateNode.containerInfo:null;t=null}else e!==t&&(t=null);return Ye=t,null}function tn(t){switch(t){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(ne()){case re:return 1;case ie:return 4;case oe:case ae:return 16;case se:return 536870912;default:return 16}default:return 16}}var en=null,nn=null,rn=null;function on(){if(rn)return rn;var t,e,n=nn,r=n.length,i="value"in en?en.value:en.textContent,o=i.length;for(t=0;t<r&&n[t]===i[t];t++);var a=r-t;for(e=1;e<=a&&n[r-e]===i[o-e];e++);return rn=i.slice(t,1<e?1-e:void 0)}function an(t){var e=t.keyCode;return"charCode"in t?0===(t=t.charCode)&&13===e&&(t=13):t=e,10===t&&(t=13),32<=t||13===t?t:0}function sn(){return!0}function ln(){return!1}function cn(t){function e(e,n,r,i,o){for(var a in this._reactName=e,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=o,this.currentTarget=null,t)t.hasOwnProperty(a)&&(this[a]=(e=t[a])?e(i):i[a]);return this.isDefaultPrevented=(null!=i.defaultPrevented?i.defaultPrevented:!1===i.returnValue)?sn:ln,this.isPropagationStopped=ln,this}return H(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var t=this.nativeEvent;t&&(t.preventDefault?t.preventDefault():"unknown"!=typeof t.returnValue&&(t.returnValue=!1),this.isDefaultPrevented=sn)},stopPropagation:function(){var t=this.nativeEvent;t&&(t.stopPropagation?t.stopPropagation():"unknown"!=typeof t.cancelBubble&&(t.cancelBubble=!0),this.isPropagationStopped=sn)},persist:function(){},isPersistent:sn}),e}var un,dn,hn,fn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},pn=cn(fn),gn=H({},fn,{view:0,detail:0}),vn=cn(gn),mn=H({},gn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:$n,button:0,buttons:0,relatedTarget:function(t){return void 0===t.relatedTarget?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==hn&&(hn&&"mousemove"===t.type?(un=t.screenX-hn.screenX,dn=t.screenY-hn.screenY):dn=un=0,hn=t),un)},movementY:function(t){return"movementY"in t?t.movementY:dn}}),bn=cn(mn),wn=cn(H({},mn,{dataTransfer:0})),yn=cn(H({},gn,{relatedTarget:0})),_n=cn(H({},fn,{animationName:0,elapsedTime:0,pseudoElement:0})),kn=H({},fn,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),xn=cn(kn),Sn=cn(H({},fn,{data:0})),En={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Cn={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Mn={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Ln(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):!!(t=Mn[t])&&!!e[t]}function $n(){return Ln}var Nn=H({},gn,{key:function(t){if(t.key){var e=En[t.key]||t.key;if("Unidentified"!==e)return e}return"keypress"===t.type?13===(t=an(t))?"Enter":String.fromCharCode(t):"keydown"===t.type||"keyup"===t.type?Cn[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:$n,charCode:function(t){return"keypress"===t.type?an(t):0},keyCode:function(t){return"keydown"===t.type||"keyup"===t.type?t.keyCode:0},which:function(t){return"keypress"===t.type?an(t):"keydown"===t.type||"keyup"===t.type?t.keyCode:0}}),Tn=cn(Nn),An=cn(H({},mn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),zn=cn(H({},gn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:$n})),In=cn(H({},fn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Rn=H({},mn,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),On=cn(Rn),Pn=[9,13,27,32],Vn=s&&"CompositionEvent"in window,jn=null;s&&"documentMode"in document&&(jn=document.documentMode);var Dn=s&&"TextEvent"in window&&!jn,Hn=s&&(!Vn||jn&&8<jn&&11>=jn),Bn=String.fromCharCode(32),Fn=!1;function Un(t,e){switch(t){case"keyup":return-1!==Pn.indexOf(e.keyCode);case"keydown":return 229!==e.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Wn(t){return"object"==typeof(t=t.detail)&&"data"in t?t.data:null}var qn=!1,Gn={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Zn(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return"input"===e?!!Gn[t.type]:"textarea"===e}function Kn(t,e,n,r){Nt(r),0<(e=Qr(e,"onChange")).length&&(n=new pn("onChange","change",null,n,r),t.push({event:n,listeners:e}))}var Qn=null,Xn=null;function Yn(t){Br(t,0)}function Jn(t){if(X(Si(t)))return t}function tr(t,e){if("change"===t)return e}var er=!1;if(s){var nr;if(s){var rr="oninput"in document;if(!rr){var ir=document.createElement("div");ir.setAttribute("oninput","return;"),rr="function"==typeof ir.oninput}nr=rr}else nr=!1;er=nr&&(!document.documentMode||9<document.documentMode)}function or(){Qn&&(Qn.detachEvent("onpropertychange",ar),Xn=Qn=null)}function ar(t){if("value"===t.propertyName&&Jn(Xn)){var e=[];Kn(e,Xn,t,Et(t)),Rt(Yn,e)}}function sr(t,e,n){"focusin"===t?(or(),Xn=n,(Qn=e).attachEvent("onpropertychange",ar)):"focusout"===t&&or()}function lr(t){if("selectionchange"===t||"keyup"===t||"keydown"===t)return Jn(Xn)}function cr(t,e){if("click"===t)return Jn(e)}function ur(t,e){if("input"===t||"change"===t)return Jn(e)}var dr="function"==typeof Object.is?Object.is:function(t,e){return t===e&&(0!==t||1/t==1/e)||t!=t&&e!=e};function hr(t,e){if(dr(t,e))return!0;if("object"!=typeof t||null===t||"object"!=typeof e||null===e)return!1;var n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!l.call(e,i)||!dr(t[i],e[i]))return!1}return!0}function fr(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function pr(t,e){var n,r=fr(t);for(t=0;r;){if(3===r.nodeType){if(n=t+r.textContent.length,t<=e&&n>=e)return{node:r,offset:e-t};t=n}t:{for(;r;){if(r.nextSibling){r=r.nextSibling;break t}r=r.parentNode}r=void 0}r=fr(r)}}function gr(t,e){return!(!t||!e)&&(t===e||(!t||3!==t.nodeType)&&(e&&3===e.nodeType?gr(t,e.parentNode):"contains"in t?t.contains(e):!!t.compareDocumentPosition&&!!(16&t.compareDocumentPosition(e))))}function vr(){for(var t=window,e=Y();e instanceof t.HTMLIFrameElement;){try{var n="string"==typeof e.contentWindow.location.href}catch(t){n=!1}if(!n)break;e=Y((t=e.contentWindow).document)}return e}function mr(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&("input"===e&&("text"===t.type||"search"===t.type||"tel"===t.type||"url"===t.type||"password"===t.type)||"textarea"===e||"true"===t.contentEditable)}function br(t){var e=vr(),n=t.focusedElem,r=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&gr(n.ownerDocument.documentElement,n)){if(null!==r&&mr(n))if(e=r.start,void 0===(t=r.end)&&(t=e),"selectionStart"in n)n.selectionStart=e,n.selectionEnd=Math.min(t,n.value.length);else if((t=(e=n.ownerDocument||document)&&e.defaultView||window).getSelection){t=t.getSelection();var i=n.textContent.length,o=Math.min(r.start,i);r=void 0===r.end?o:Math.min(r.end,i),!t.extend&&o>r&&(i=r,r=o,o=i),i=pr(n,o);var a=pr(n,r);i&&a&&(1!==t.rangeCount||t.anchorNode!==i.node||t.anchorOffset!==i.offset||t.focusNode!==a.node||t.focusOffset!==a.offset)&&((e=e.createRange()).setStart(i.node,i.offset),t.removeAllRanges(),o>r?(t.addRange(e),t.extend(a.node,a.offset)):(e.setEnd(a.node,a.offset),t.addRange(e)))}for(e=[],t=n;t=t.parentNode;)1===t.nodeType&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for("function"==typeof n.focus&&n.focus(),n=0;n<e.length;n++)(t=e[n]).element.scrollLeft=t.left,t.element.scrollTop=t.top}}var wr=s&&"documentMode"in document&&11>=document.documentMode,yr=null,_r=null,kr=null,xr=!1;function Sr(t,e,n){var r=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;xr||null==yr||yr!==Y(r)||(r="selectionStart"in(r=yr)&&mr(r)?{start:r.selectionStart,end:r.selectionEnd}:{anchorNode:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset},kr&&hr(kr,r)||(kr=r,0<(r=Qr(_r,"onSelect")).length&&(e=new pn("onSelect","select",null,e,n),t.push({event:e,listeners:r}),e.target=yr)))}function Er(t,e){var n={};return n[t.toLowerCase()]=e.toLowerCase(),n["Webkit"+t]="webkit"+e,n["Moz"+t]="moz"+e,n}var Cr={animationend:Er("Animation","AnimationEnd"),animationiteration:Er("Animation","AnimationIteration"),animationstart:Er("Animation","AnimationStart"),transitionend:Er("Transition","TransitionEnd")},Mr={},Lr={};function $r(t){if(Mr[t])return Mr[t];if(!Cr[t])return t;var e,n=Cr[t];for(e in n)if(n.hasOwnProperty(e)&&e in Lr)return Mr[t]=n[e];return t}s&&(Lr=document.createElement("div").style,"AnimationEvent"in window||(delete Cr.animationend.animation,delete Cr.animationiteration.animation,delete Cr.animationstart.animation),"TransitionEvent"in window||delete Cr.transitionend.transition);var Nr=$r("animationend"),Tr=$r("animationiteration"),Ar=$r("animationstart"),zr=$r("transitionend"),Ir=new Map,Rr="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Or(t,e){Ir.set(t,e),o(e,[t])}for(var Pr=0;Pr<Rr.length;Pr++){var Vr=Rr[Pr];Or(Vr.toLowerCase(),"on"+(Vr[0].toUpperCase()+Vr.slice(1)))}Or(Nr,"onAnimationEnd"),Or(Tr,"onAnimationIteration"),Or(Ar,"onAnimationStart"),Or("dblclick","onDoubleClick"),Or("focusin","onFocus"),Or("focusout","onBlur"),Or(zr,"onTransitionEnd"),a("onMouseEnter",["mouseout","mouseover"]),a("onMouseLeave",["mouseout","mouseover"]),a("onPointerEnter",["pointerout","pointerover"]),a("onPointerLeave",["pointerout","pointerover"]),o("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),o("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),o("onBeforeInput",["compositionend","keypress","textInput","paste"]),o("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),o("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),o("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var jr="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Dr=new Set("cancel close invalid load scroll toggle".split(" ").concat(jr));function Hr(t,e,r){var i=t.type||"unknown-event";t.currentTarget=r,function(t,e,r,i,o,a,s,l,c){if(Wt.apply(this,arguments),Dt){if(!Dt)throw Error(n(198));var u=Ht;Dt=!1,Ht=null,Bt||(Bt=!0,Ft=u)}}(i,e,void 0,t),t.currentTarget=null}function Br(t,e){e=!!(4&e);for(var n=0;n<t.length;n++){var r=t[n],i=r.event;r=r.listeners;t:{var o=void 0;if(e)for(var a=r.length-1;0<=a;a--){var s=r[a],l=s.instance,c=s.currentTarget;if(s=s.listener,l!==o&&i.isPropagationStopped())break t;Hr(i,s,c),o=l}else for(a=0;a<r.length;a++){if(l=(s=r[a]).instance,c=s.currentTarget,s=s.listener,l!==o&&i.isPropagationStopped())break t;Hr(i,s,c),o=l}}}if(Bt)throw t=Ft,Bt=!1,Ft=null,t}function Fr(t,e){var n=e[wi];void 0===n&&(n=e[wi]=new Set);var r=t+"__bubble";n.has(r)||(Gr(e,t,2,!1),n.add(r))}function Ur(t,e,n){var r=0;e&&(r|=4),Gr(n,t,r,e)}var Wr="_reactListening"+Math.random().toString(36).slice(2);function qr(t){if(!t[Wr]){t[Wr]=!0,r.forEach((function(e){"selectionchange"!==e&&(Dr.has(e)||Ur(e,!1,t),Ur(e,!0,t))}));var e=9===t.nodeType?t:t.ownerDocument;null===e||e[Wr]||(e[Wr]=!0,Ur("selectionchange",!1,e))}}function Gr(t,e,n,r){switch(tn(e)){case 1:var i=Ke;break;case 4:i=Qe;break;default:i=Xe}n=i.bind(null,e,n,t),i=void 0,!Pt||"touchstart"!==e&&"touchmove"!==e&&"wheel"!==e||(i=!0),t.addEventListener(e,n,r?void 0===i||{capture:!0,passive:i}:void 0!==i&&{passive:i})}function Zr(t,e,n,r,i){var o=r;if(!(1&e||2&e||null===r))t:for(;;){if(null===r)return;var a=r.tag;if(3===a||4===a){var s=r.stateNode.containerInfo;if(s===i||8===s.nodeType&&s.parentNode===i)break;if(4===a)for(a=r.return;null!==a;){var l=a.tag;if((3===l||4===l)&&((l=a.stateNode.containerInfo)===i||8===l.nodeType&&l.parentNode===i))return;a=a.return}for(;null!==s;){if(null===(a=ki(s)))return;if(5===(l=a.tag)||6===l){r=o=a;continue t}s=s.parentNode}}r=r.return}Rt((function(){var r=o,i=Et(n),a=[];t:{var s=Ir.get(t);if(void 0!==s){var l=pn,c=t;switch(t){case"keypress":if(0===an(n))break t;case"keydown":case"keyup":l=Tn;break;case"focusin":c="focus",l=yn;break;case"focusout":c="blur",l=yn;break;case"beforeblur":case"afterblur":l=yn;break;case"click":if(2===n.button)break t;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":l=bn;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":l=wn;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":l=zn;break;case Nr:case Tr:case Ar:l=_n;break;case zr:l=In;break;case"scroll":l=vn;break;case"wheel":l=On;break;case"copy":case"cut":case"paste":l=xn;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":l=An}var u=!!(4&e),d=!u&&"scroll"===t,h=u?null!==s?s+"Capture":null:s;u=[];for(var f,p=r;null!==p;){var g=(f=p).stateNode;if(5===f.tag&&null!==g&&(f=g,null!==h&&null!=(g=Ot(p,h))&&u.push(Kr(p,g,f))),d)break;p=p.return}0<u.length&&(s=new l(s,c,null,n,i),a.push({event:s,listeners:u}))}}if(!(7&e)){if(l="mouseout"===t||"pointerout"===t,(!(s="mouseover"===t||"pointerover"===t)||n===St||!(c=n.relatedTarget||n.fromElement)||!ki(c)&&!c[bi])&&(l||s)&&(s=i.window===i?i:(s=i.ownerDocument)?s.defaultView||s.parentWindow:window,l?(l=r,null!==(c=(c=n.relatedTarget||n.toElement)?ki(c):null)&&(c!==(d=qt(c))||5!==c.tag&&6!==c.tag)&&(c=null)):(l=null,c=r),l!==c)){if(u=bn,g="onMouseLeave",h="onMouseEnter",p="mouse","pointerout"!==t&&"pointerover"!==t||(u=An,g="onPointerLeave",h="onPointerEnter",p="pointer"),d=null==l?s:Si(l),f=null==c?s:Si(c),(s=new u(g,p+"leave",l,n,i)).target=d,s.relatedTarget=f,g=null,ki(i)===r&&((u=new u(h,p+"enter",c,n,i)).target=f,u.relatedTarget=d,g=u),d=g,l&&c)t:{for(h=c,p=0,f=u=l;f;f=Xr(f))p++;for(f=0,g=h;g;g=Xr(g))f++;for(;0<p-f;)u=Xr(u),p--;for(;0<f-p;)h=Xr(h),f--;for(;p--;){if(u===h||null!==h&&u===h.alternate)break t;u=Xr(u),h=Xr(h)}u=null}else u=null;null!==l&&Yr(a,s,l,u,!1),null!==c&&null!==d&&Yr(a,d,c,u,!0)}if("select"===(l=(s=r?Si(r):window).nodeName&&s.nodeName.toLowerCase())||"input"===l&&"file"===s.type)var v=tr;else if(Zn(s))if(er)v=ur;else{v=lr;var m=sr}else(l=s.nodeName)&&"input"===l.toLowerCase()&&("checkbox"===s.type||"radio"===s.type)&&(v=cr);switch(v&&(v=v(t,r))?Kn(a,v,n,i):(m&&m(t,s,r),"focusout"===t&&(m=s._wrapperState)&&m.controlled&&"number"===s.type&&it(s,"number",s.value)),m=r?Si(r):window,t){case"focusin":(Zn(m)||"true"===m.contentEditable)&&(yr=m,_r=r,kr=null);break;case"focusout":kr=_r=yr=null;break;case"mousedown":xr=!0;break;case"contextmenu":case"mouseup":case"dragend":xr=!1,Sr(a,n,i);break;case"selectionchange":if(wr)break;case"keydown":case"keyup":Sr(a,n,i)}var b;if(Vn)t:{switch(t){case"compositionstart":var w="onCompositionStart";break t;case"compositionend":w="onCompositionEnd";break t;case"compositionupdate":w="onCompositionUpdate";break t}w=void 0}else qn?Un(t,n)&&(w="onCompositionEnd"):"keydown"===t&&229===n.keyCode&&(w="onCompositionStart");w&&(Hn&&"ko"!==n.locale&&(qn||"onCompositionStart"!==w?"onCompositionEnd"===w&&qn&&(b=on()):(nn="value"in(en=i)?en.value:en.textContent,qn=!0)),0<(m=Qr(r,w)).length&&(w=new Sn(w,t,null,n,i),a.push({event:w,listeners:m}),(b||null!==(b=Wn(n)))&&(w.data=b))),(b=Dn?function(t,e){switch(t){case"compositionend":return Wn(e);case"keypress":return 32!==e.which?null:(Fn=!0,Bn);case"textInput":return(t=e.data)===Bn&&Fn?null:t;default:return null}}(t,n):function(t,e){if(qn)return"compositionend"===t||!Vn&&Un(t,e)?(t=on(),rn=nn=en=null,qn=!1,t):null;switch(t){case"paste":default:return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1<e.char.length)return e.char;if(e.which)return String.fromCharCode(e.which)}return null;case"compositionend":return Hn&&"ko"!==e.locale?null:e.data}}(t,n))&&0<(r=Qr(r,"onBeforeInput")).length&&(i=new Sn("onBeforeInput","beforeinput",null,n,i),a.push({event:i,listeners:r}),i.data=b)}Br(a,e)}))}function Kr(t,e,n){return{instance:t,listener:e,currentTarget:n}}function Qr(t,e){for(var n=e+"Capture",r=[];null!==t;){var i=t,o=i.stateNode;5===i.tag&&null!==o&&(i=o,null!=(o=Ot(t,n))&&r.unshift(Kr(t,o,i)),null!=(o=Ot(t,e))&&r.push(Kr(t,o,i))),t=t.return}return r}function Xr(t){if(null===t)return null;do{t=t.return}while(t&&5!==t.tag);return t||null}function Yr(t,e,n,r,i){for(var o=e._reactName,a=[];null!==n&&n!==r;){var s=n,l=s.alternate,c=s.stateNode;if(null!==l&&l===r)break;5===s.tag&&null!==c&&(s=c,i?null!=(l=Ot(n,o))&&a.unshift(Kr(n,l,s)):i||null!=(l=Ot(n,o))&&a.push(Kr(n,l,s))),n=n.return}0!==a.length&&t.push({event:e,listeners:a})}var Jr=/\r\n?/g,ti=/\u0000|\uFFFD/g;function ei(t){return("string"==typeof t?t:""+t).replace(Jr,"\n").replace(ti,"")}function ni(t,e,r){if(e=ei(e),ei(t)!==e&&r)throw Error(n(425))}function ri(){}var ii=null,oi=null;function ai(t,e){return"textarea"===t||"noscript"===t||"string"==typeof e.children||"number"==typeof e.children||"object"==typeof e.dangerouslySetInnerHTML&&null!==e.dangerouslySetInnerHTML&&null!=e.dangerouslySetInnerHTML.__html}var si="function"==typeof setTimeout?setTimeout:void 0,li="function"==typeof clearTimeout?clearTimeout:void 0,ci="function"==typeof Promise?Promise:void 0,ui="function"==typeof queueMicrotask?queueMicrotask:void 0!==ci?function(t){return ci.resolve(null).then(t).catch(di)}:si;function di(t){setTimeout((function(){throw t}))}function hi(t,e){var n=e,r=0;do{var i=n.nextSibling;if(t.removeChild(n),i&&8===i.nodeType)if("/$"===(n=i.data)){if(0===r)return t.removeChild(i),void qe(e);r--}else"$"!==n&&"$?"!==n&&"$!"!==n||r++;n=i}while(n);qe(e)}function fi(t){for(;null!=t;t=t.nextSibling){var e=t.nodeType;if(1===e||3===e)break;if(8===e){if("$"===(e=t.data)||"$!"===e||"$?"===e)break;if("/$"===e)return null}}return t}function pi(t){t=t.previousSibling;for(var e=0;t;){if(8===t.nodeType){var n=t.data;if("$"===n||"$!"===n||"$?"===n){if(0===e)return t;e--}else"/$"===n&&e++}t=t.previousSibling}return null}var gi=Math.random().toString(36).slice(2),vi="__reactFiber$"+gi,mi="__reactProps$"+gi,bi="__reactContainer$"+gi,wi="__reactEvents$"+gi,yi="__reactListeners$"+gi,_i="__reactHandles$"+gi;function ki(t){var e=t[vi];if(e)return e;for(var n=t.parentNode;n;){if(e=n[bi]||n[vi]){if(n=e.alternate,null!==e.child||null!==n&&null!==n.child)for(t=pi(t);null!==t;){if(n=t[vi])return n;t=pi(t)}return e}n=(t=n).parentNode}return null}function xi(t){return!(t=t[vi]||t[bi])||5!==t.tag&&6!==t.tag&&13!==t.tag&&3!==t.tag?null:t}function Si(t){if(5===t.tag||6===t.tag)return t.stateNode;throw Error(n(33))}function Ei(t){return t[mi]||null}var Ci=[],Mi=-1;function Li(t){return{current:t}}function $i(t){0>Mi||(t.current=Ci[Mi],Ci[Mi]=null,Mi--)}function Ni(t,e){Mi++,Ci[Mi]=t.current,t.current=e}var Ti={},Ai=Li(Ti),zi=Li(!1),Ii=Ti;function Ri(t,e){var n=t.type.contextTypes;if(!n)return Ti;var r=t.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var i,o={};for(i in n)o[i]=e[i];return r&&((t=t.stateNode).__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=o),o}function Oi(t){return null!=t.childContextTypes}function Pi(){$i(zi),$i(Ai)}function Vi(t,e,r){if(Ai.current!==Ti)throw Error(n(168));Ni(Ai,e),Ni(zi,r)}function ji(t,e,r){var i=t.stateNode;if(e=e.childContextTypes,"function"!=typeof i.getChildContext)return r;for(var o in i=i.getChildContext())if(!(o in e))throw Error(n(108,G(t)||"Unknown",o));return H({},r,i)}function Di(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||Ti,Ii=Ai.current,Ni(Ai,t),Ni(zi,zi.current),!0}function Hi(t,e,r){var i=t.stateNode;if(!i)throw Error(n(169));r?(t=ji(t,e,Ii),i.__reactInternalMemoizedMergedChildContext=t,$i(zi),$i(Ai),Ni(Ai,t)):$i(zi),Ni(zi,r)}var Bi=null,Fi=!1,Ui=!1;function Wi(t){null===Bi?Bi=[t]:Bi.push(t)}function qi(){if(!Ui&&null!==Bi){Ui=!0;var t=0,e=xe;try{var n=Bi;for(xe=1;t<n.length;t++){var r=n[t];do{r=r(!0)}while(null!==r)}Bi=null,Fi=!1}catch(e){throw null!==Bi&&(Bi=Bi.slice(t+1)),Xt(re,qi),e}finally{xe=e,Ui=!1}}return null}var Gi=[],Zi=0,Ki=null,Qi=0,Xi=[],Yi=0,Ji=null,to=1,eo="";function no(t,e){Gi[Zi++]=Qi,Gi[Zi++]=Ki,Ki=t,Qi=e}function ro(t,e,n){Xi[Yi++]=to,Xi[Yi++]=eo,Xi[Yi++]=Ji,Ji=t;var r=to;t=eo;var i=32-ue(r)-1;r&=~(1<<i),n+=1;var o=32-ue(e)+i;if(30<o){var a=i-i%5;o=(r&(1<<a)-1).toString(32),r>>=a,i-=a,to=1<<32-ue(e)+i|n<<i|r,eo=o+t}else to=1<<o|n<<i|r,eo=t}function io(t){null!==t.return&&(no(t,1),ro(t,1,0))}function oo(t){for(;t===Ki;)Ki=Gi[--Zi],Gi[Zi]=null,Qi=Gi[--Zi],Gi[Zi]=null;for(;t===Ji;)Ji=Xi[--Yi],Xi[Yi]=null,eo=Xi[--Yi],Xi[Yi]=null,to=Xi[--Yi],Xi[Yi]=null}var ao=null,so=null,lo=!1,co=null;function uo(t,e){var n=Rc(5,null,null,0);n.elementType="DELETED",n.stateNode=e,n.return=t,null===(e=t.deletions)?(t.deletions=[n],t.flags|=16):e.push(n)}function ho(t,e){switch(t.tag){case 5:var n=t.type;return null!==(e=1!==e.nodeType||n.toLowerCase()!==e.nodeName.toLowerCase()?null:e)&&(t.stateNode=e,ao=t,so=fi(e.firstChild),!0);case 6:return null!==(e=""===t.pendingProps||3!==e.nodeType?null:e)&&(t.stateNode=e,ao=t,so=null,!0);case 13:return null!==(e=8!==e.nodeType?null:e)&&(t.memoizedState={dehydrated:e,treeContext:n=null!==Ji?{id:to,overflow:eo}:null,retryLane:1073741824},(n=Rc(18,null,null,0)).stateNode=e,n.return=t,t.child=n,ao=t,so=null,!0);default:return!1}}function fo(t){return!(!(1&t.mode)||128&t.flags)}function po(t){if(lo){var e=so;if(e){var r=e;if(!ho(t,e)){if(fo(t))throw Error(n(418));e=fi(r.nextSibling);var i=ao;e&&ho(t,e)?uo(i,r):(t.flags=-4097&t.flags|2,lo=!1,ao=t)}}else{if(fo(t))throw Error(n(418));t.flags=-4097&t.flags|2,lo=!1,ao=t}}}function go(t){for(t=t.return;null!==t&&5!==t.tag&&3!==t.tag&&13!==t.tag;)t=t.return;ao=t}function vo(t){if(t!==ao)return!1;if(!lo)return go(t),lo=!0,!1;var e;if((e=3!==t.tag)&&!(e=5!==t.tag)&&(e="head"!==(e=t.type)&&"body"!==e&&!ai(t.type,t.memoizedProps)),e&&(e=so)){if(fo(t))throw mo(),Error(n(418));for(;e;)uo(t,e),e=fi(e.nextSibling)}if(go(t),13===t.tag){if(!(t=null!==(t=t.memoizedState)?t.dehydrated:null))throw Error(n(317));t:{for(t=t.nextSibling,e=0;t;){if(8===t.nodeType){var r=t.data;if("/$"===r){if(0===e){so=fi(t.nextSibling);break t}e--}else"$"!==r&&"$!"!==r&&"$?"!==r||e++}t=t.nextSibling}so=null}}else so=ao?fi(t.stateNode.nextSibling):null;return!0}function mo(){for(var t=so;t;)t=fi(t.nextSibling)}function bo(){so=ao=null,lo=!1}function wo(t){null===co?co=[t]:co.push(t)}var yo=_.ReactCurrentBatchConfig;function _o(t,e,r){if(null!==(t=r.ref)&&"function"!=typeof t&&"object"!=typeof t){if(r._owner){if(r=r._owner){if(1!==r.tag)throw Error(n(309));var i=r.stateNode}if(!i)throw Error(n(147,t));var o=i,a=""+t;return null!==e&&null!==e.ref&&"function"==typeof e.ref&&e.ref._stringRef===a?e.ref:(e=function(t){var e=o.refs;null===t?delete e[a]:e[a]=t},e._stringRef=a,e)}if("string"!=typeof t)throw Error(n(284));if(!r._owner)throw Error(n(290,t))}return t}function ko(t,e){throw t=Object.prototype.toString.call(e),Error(n(31,"[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t))}function xo(t){return(0,t._init)(t._payload)}function So(t){function e(e,n){if(t){var r=e.deletions;null===r?(e.deletions=[n],e.flags|=16):r.push(n)}}function r(n,r){if(!t)return null;for(;null!==r;)e(n,r),r=r.sibling;return null}function i(t,e){for(t=new Map;null!==e;)t.set(null!==e.key?e.key:e.index,e),e=e.sibling;return t}function o(t,e){return(t=Pc(t,e)).index=0,t.sibling=null,t}function a(e,n,r){return e.index=r,t?null!==(r=e.alternate)?(r=r.index)<n?(e.flags|=2,n):r:(e.flags|=2,n):(e.flags|=1048576,n)}function s(e){return t&&null===e.alternate&&(e.flags|=2),e}function l(t,e,n,r){return null===e||6!==e.tag?((e=Hc(n,t.mode,r)).return=t,e):((e=o(e,n)).return=t,e)}function c(t,e,n,r){var i=n.type;return i===S?d(t,e,n.props.children,r,n.key):null!==e&&(e.elementType===i||"object"==typeof i&&null!==i&&i.$$typeof===O&&xo(i)===e.type)?((r=o(e,n.props)).ref=_o(t,e,n),r.return=t,r):((r=Vc(n.type,n.key,n.props,null,t.mode,r)).ref=_o(t,e,n),r.return=t,r)}function u(t,e,n,r){return null===e||4!==e.tag||e.stateNode.containerInfo!==n.containerInfo||e.stateNode.implementation!==n.implementation?((e=Bc(n,t.mode,r)).return=t,e):((e=o(e,n.children||[])).return=t,e)}function d(t,e,n,r,i){return null===e||7!==e.tag?((e=jc(n,t.mode,r,i)).return=t,e):((e=o(e,n)).return=t,e)}function h(t,e,n){if("string"==typeof e&&""!==e||"number"==typeof e)return(e=Hc(""+e,t.mode,n)).return=t,e;if("object"==typeof e&&null!==e){switch(e.$$typeof){case k:return(n=Vc(e.type,e.key,e.props,null,t.mode,n)).ref=_o(t,null,e),n.return=t,n;case x:return(e=Bc(e,t.mode,n)).return=t,e;case O:return h(t,(0,e._init)(e._payload),n)}if(ot(e)||j(e))return(e=jc(e,t.mode,n,null)).return=t,e;ko(t,e)}return null}function f(t,e,n,r){var i=null!==e?e.key:null;if("string"==typeof n&&""!==n||"number"==typeof n)return null!==i?null:l(t,e,""+n,r);if("object"==typeof n&&null!==n){switch(n.$$typeof){case k:return n.key===i?c(t,e,n,r):null;case x:return n.key===i?u(t,e,n,r):null;case O:return f(t,e,(i=n._init)(n._payload),r)}if(ot(n)||j(n))return null!==i?null:d(t,e,n,r,null);ko(t,n)}return null}function p(t,e,n,r,i){if("string"==typeof r&&""!==r||"number"==typeof r)return l(e,t=t.get(n)||null,""+r,i);if("object"==typeof r&&null!==r){switch(r.$$typeof){case k:return c(e,t=t.get(null===r.key?n:r.key)||null,r,i);case x:return u(e,t=t.get(null===r.key?n:r.key)||null,r,i);case O:return p(t,e,n,(0,r._init)(r._payload),i)}if(ot(r)||j(r))return d(e,t=t.get(n)||null,r,i,null);ko(e,r)}return null}function g(n,o,s,l){for(var c=null,u=null,d=o,g=o=0,v=null;null!==d&&g<s.length;g++){d.index>g?(v=d,d=null):v=d.sibling;var m=f(n,d,s[g],l);if(null===m){null===d&&(d=v);break}t&&d&&null===m.alternate&&e(n,d),o=a(m,o,g),null===u?c=m:u.sibling=m,u=m,d=v}if(g===s.length)return r(n,d),lo&&no(n,g),c;if(null===d){for(;g<s.length;g++)null!==(d=h(n,s[g],l))&&(o=a(d,o,g),null===u?c=d:u.sibling=d,u=d);return lo&&no(n,g),c}for(d=i(n,d);g<s.length;g++)null!==(v=p(d,n,g,s[g],l))&&(t&&null!==v.alternate&&d.delete(null===v.key?g:v.key),o=a(v,o,g),null===u?c=v:u.sibling=v,u=v);return t&&d.forEach((function(t){return e(n,t)})),lo&&no(n,g),c}function v(o,s,l,c){var u=j(l);if("function"!=typeof u)throw Error(n(150));if(null==(l=u.call(l)))throw Error(n(151));for(var d=u=null,g=s,v=s=0,m=null,b=l.next();null!==g&&!b.done;v++,b=l.next()){g.index>v?(m=g,g=null):m=g.sibling;var w=f(o,g,b.value,c);if(null===w){null===g&&(g=m);break}t&&g&&null===w.alternate&&e(o,g),s=a(w,s,v),null===d?u=w:d.sibling=w,d=w,g=m}if(b.done)return r(o,g),lo&&no(o,v),u;if(null===g){for(;!b.done;v++,b=l.next())null!==(b=h(o,b.value,c))&&(s=a(b,s,v),null===d?u=b:d.sibling=b,d=b);return lo&&no(o,v),u}for(g=i(o,g);!b.done;v++,b=l.next())null!==(b=p(g,o,v,b.value,c))&&(t&&null!==b.alternate&&g.delete(null===b.key?v:b.key),s=a(b,s,v),null===d?u=b:d.sibling=b,d=b);return t&&g.forEach((function(t){return e(o,t)})),lo&&no(o,v),u}return function t(n,i,a,l){if("object"==typeof a&&null!==a&&a.type===S&&null===a.key&&(a=a.props.children),"object"==typeof a&&null!==a){switch(a.$$typeof){case k:t:{for(var c=a.key,u=i;null!==u;){if(u.key===c){if((c=a.type)===S){if(7===u.tag){r(n,u.sibling),(i=o(u,a.props.children)).return=n,n=i;break t}}else if(u.elementType===c||"object"==typeof c&&null!==c&&c.$$typeof===O&&xo(c)===u.type){r(n,u.sibling),(i=o(u,a.props)).ref=_o(n,u,a),i.return=n,n=i;break t}r(n,u);break}e(n,u),u=u.sibling}a.type===S?((i=jc(a.props.children,n.mode,l,a.key)).return=n,n=i):((l=Vc(a.type,a.key,a.props,null,n.mode,l)).ref=_o(n,i,a),l.return=n,n=l)}return s(n);case x:t:{for(u=a.key;null!==i;){if(i.key===u){if(4===i.tag&&i.stateNode.containerInfo===a.containerInfo&&i.stateNode.implementation===a.implementation){r(n,i.sibling),(i=o(i,a.children||[])).return=n,n=i;break t}r(n,i);break}e(n,i),i=i.sibling}(i=Bc(a,n.mode,l)).return=n,n=i}return s(n);case O:return t(n,i,(u=a._init)(a._payload),l)}if(ot(a))return g(n,i,a,l);if(j(a))return v(n,i,a,l);ko(n,a)}return"string"==typeof a&&""!==a||"number"==typeof a?(a=""+a,null!==i&&6===i.tag?(r(n,i.sibling),(i=o(i,a)).return=n,n=i):(r(n,i),(i=Hc(a,n.mode,l)).return=n,n=i),s(n)):r(n,i)}}var Eo=So(!0),Co=So(!1),Mo=Li(null),Lo=null,$o=null,No=null;function To(){No=$o=Lo=null}function Ao(t){var e=Mo.current;$i(Mo),t._currentValue=e}function zo(t,e,n){for(;null!==t;){var r=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,null!==r&&(r.childLanes|=e)):null!==r&&(r.childLanes&e)!==e&&(r.childLanes|=e),t===n)break;t=t.return}}function Io(t,e){Lo=t,No=$o=null,null!==(t=t.dependencies)&&null!==t.firstContext&&(!!(t.lanes&e)&&(xs=!0),t.firstContext=null)}function Ro(t){var e=t._currentValue;if(No!==t)if(t={context:t,memoizedValue:e,next:null},null===$o){if(null===Lo)throw Error(n(308));$o=t,Lo.dependencies={lanes:0,firstContext:t}}else $o=$o.next=t;return e}var Oo=null;function Po(t){null===Oo?Oo=[t]:Oo.push(t)}function Vo(t,e,n,r){var i=e.interleaved;return null===i?(n.next=n,Po(e)):(n.next=i.next,i.next=n),e.interleaved=n,jo(t,r)}function jo(t,e){t.lanes|=e;var n=t.alternate;for(null!==n&&(n.lanes|=e),n=t,t=t.return;null!==t;)t.childLanes|=e,null!==(n=t.alternate)&&(n.childLanes|=e),n=t,t=t.return;return 3===n.tag?n.stateNode:null}var Do=!1;function Ho(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Bo(t,e){e.updateQueue===(t=t.updateQueue)&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function Fo(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function Uo(t,e,n){var r=t.updateQueue;if(null===r)return null;if(r=r.shared,2&Al){var i=r.pending;return null===i?e.next=e:(e.next=i.next,i.next=e),r.pending=e,jo(t,n)}return null===(i=r.interleaved)?(e.next=e,Po(r)):(e.next=i.next,i.next=e),r.interleaved=e,jo(t,n)}function Wo(t,e,n){if(null!==(e=e.updateQueue)&&(e=e.shared,4194240&n)){var r=e.lanes;e.lanes=n|=r&=t.pendingLanes,ke(t,n)}}function qo(t,e){var n=t.updateQueue,r=t.alternate;if(null===r||n!==(r=r.updateQueue))null===(t=n.lastBaseUpdate)?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e;else{var i=null,o=null;if(null!==(n=n.firstBaseUpdate)){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};null===o?i=o=a:o=o.next=a,n=n.next}while(null!==n);null===o?i=o=e:o=o.next=e}else i=o=e;t.updateQueue=n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:r.shared,effects:r.effects}}}function Go(t,e,n,r){var i=t.updateQueue;Do=!1;var o=i.firstBaseUpdate,a=i.lastBaseUpdate,s=i.shared.pending;if(null!==s){i.shared.pending=null;var l=s,c=l.next;l.next=null,null===a?o=c:a.next=c,a=l;var u=t.alternate;null!==u&&(s=(u=u.updateQueue).lastBaseUpdate)!==a&&(null===s?u.firstBaseUpdate=c:s.next=c,u.lastBaseUpdate=l)}if(null!==o){var d=i.baseState;for(a=0,u=c=l=null,s=o;;){var h=s.lane,f=s.eventTime;if((r&h)===h){null!==u&&(u=u.next={eventTime:f,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});t:{var p=t,g=s;switch(h=e,f=n,g.tag){case 1:if("function"==typeof(p=g.payload)){d=p.call(f,d,h);break t}d=p;break t;case 3:p.flags=-65537&p.flags|128;case 0:if(null==(h="function"==typeof(p=g.payload)?p.call(f,d,h):p))break t;d=H({},d,h);break t;case 2:Do=!0}}null!==s.callback&&0!==s.lane&&(t.flags|=64,null===(h=i.effects)?i.effects=[s]:h.push(s))}else f={eventTime:f,lane:h,tag:s.tag,payload:s.payload,callback:s.callback,next:null},null===u?(c=u=f,l=d):u=u.next=f,a|=h;if(null===(s=s.next)){if(null===(s=i.shared.pending))break;s=(h=s).next,h.next=null,i.lastBaseUpdate=h,i.shared.pending=null}}if(null===u&&(l=d),i.baseState=l,i.firstBaseUpdate=c,i.lastBaseUpdate=u,null!==(e=i.shared.interleaved)){i=e;do{a|=i.lane,i=i.next}while(i!==e)}else null===o&&(i.shared.lanes=0);Dl|=a,t.lanes=a,t.memoizedState=d}}function Zo(t,e,r){if(t=e.effects,e.effects=null,null!==t)for(e=0;e<t.length;e++){var i=t[e],o=i.callback;if(null!==o){if(i.callback=null,i=r,"function"!=typeof o)throw Error(n(191,o));o.call(i)}}}var Ko={},Qo=Li(Ko),Xo=Li(Ko),Yo=Li(Ko);function Jo(t){if(t===Ko)throw Error(n(174));return t}function ta(t,e){switch(Ni(Yo,e),Ni(Xo,t),Ni(Qo,Ko),t=e.nodeType){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:ht(null,"");break;default:e=ht(e=(t=8===t?e.parentNode:e).namespaceURI||null,t=t.tagName)}$i(Qo),Ni(Qo,e)}function ea(){$i(Qo),$i(Xo),$i(Yo)}function na(t){Jo(Yo.current);var e=Jo(Qo.current),n=ht(e,t.type);e!==n&&(Ni(Xo,t),Ni(Qo,n))}function ra(t){Xo.current===t&&($i(Qo),$i(Xo))}var ia=Li(0);function oa(t){for(var e=t;null!==e;){if(13===e.tag){var n=e.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||"$?"===n.data||"$!"===n.data))return e}else if(19===e.tag&&void 0!==e.memoizedProps.revealOrder){if(128&e.flags)return e}else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break;for(;null===e.sibling;){if(null===e.return||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var aa=[];function sa(){for(var t=0;t<aa.length;t++)aa[t]._workInProgressVersionPrimary=null;aa.length=0}var la=_.ReactCurrentDispatcher,ca=_.ReactCurrentBatchConfig,ua=0,da=null,ha=null,fa=null,pa=!1,ga=!1,va=0,ma=0;function ba(){throw Error(n(321))}function wa(t,e){if(null===e)return!1;for(var n=0;n<e.length&&n<t.length;n++)if(!dr(t[n],e[n]))return!1;return!0}function ya(t,e,r,i,o,a){if(ua=a,da=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,la.current=null===t||null===t.memoizedState?rs:is,t=r(i,o),ga){a=0;do{if(ga=!1,va=0,25<=a)throw Error(n(301));a+=1,fa=ha=null,e.updateQueue=null,la.current=os,t=r(i,o)}while(ga)}if(la.current=ns,e=null!==ha&&null!==ha.next,ua=0,fa=ha=da=null,pa=!1,e)throw Error(n(300));return t}function _a(){var t=0!==va;return va=0,t}function ka(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===fa?da.memoizedState=fa=t:fa=fa.next=t,fa}function xa(){if(null===ha){var t=da.alternate;t=null!==t?t.memoizedState:null}else t=ha.next;var e=null===fa?da.memoizedState:fa.next;if(null!==e)fa=e,ha=t;else{if(null===t)throw Error(n(310));t={memoizedState:(ha=t).memoizedState,baseState:ha.baseState,baseQueue:ha.baseQueue,queue:ha.queue,next:null},null===fa?da.memoizedState=fa=t:fa=fa.next=t}return fa}function Sa(t,e){return"function"==typeof e?e(t):e}function Ea(t){var e=xa(),r=e.queue;if(null===r)throw Error(n(311));r.lastRenderedReducer=t;var i=ha,o=i.baseQueue,a=r.pending;if(null!==a){if(null!==o){var s=o.next;o.next=a.next,a.next=s}i.baseQueue=o=a,r.pending=null}if(null!==o){i=i.baseState;var l=s=null,c=null,u=a=o.next;do{var d=u.lane;if((ua&d)===d)null!==c&&(c=c.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),i=u.hasEagerState?u.eagerState:t(i,u.action);else{var h={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};null===c?(l=c=h,s=i):c=c.next=h,da.lanes|=d,Dl|=d}u=u.next}while(null!==u&&u!==a);null===c?s=i:c.next=l,dr(i,e.memoizedState)||(xs=!0),e.memoizedState=i,e.baseState=s,e.baseQueue=c,r.lastRenderedState=i}if(null!==(t=r.interleaved)){o=t;do{da.lanes|=a=o.lane,Dl|=a,o=o.next}while(o!==t)}else null===o&&(r.lanes=0);return[e.memoizedState,r.dispatch]}function Ca(t){var e=xa(),r=e.queue;if(null===r)throw Error(n(311));r.lastRenderedReducer=t;var i=r.dispatch,o=r.pending,a=e.memoizedState;if(null!==o){r.pending=null;var s=o=o.next;do{a=t(a,s.action),s=s.next}while(s!==o);dr(a,e.memoizedState)||(xs=!0),e.memoizedState=a,null===e.baseQueue&&(e.baseState=a),r.lastRenderedState=a}return[a,i]}function Ma(){}function La(t,e){var r=da,i=xa(),o=e(),a=!dr(i.memoizedState,o);if(a&&(i.memoizedState=o,xs=!0),Da(Ta.bind(null,r,i=i.queue,t),[t]),i.getSnapshot!==e||a||null!==fa&&1&fa.memoizedState.tag){if(r.flags|=2048,Ra(9,Na.bind(null,r,i,o,e),void 0,null),null===zl)throw Error(n(349));30&ua||$a(r,e,o)}return o}function $a(t,e,n){t.flags|=16384,t={getSnapshot:e,value:n},null===(e=da.updateQueue)?(da.updateQueue=e={lastEffect:null,stores:null},e.stores=[t]):null===(n=e.stores)?e.stores=[t]:n.push(t)}function Na(t,e,n,r){e.value=n,e.getSnapshot=r,Aa(e)&&za(t)}function Ta(t,e,n){return n((function(){Aa(e)&&za(t)}))}function Aa(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!dr(t,n)}catch(t){return!0}}function za(t){var e=jo(t,1);null!==e&&ac(e,t,1,-1)}function Ia(t){var e=ka();return"function"==typeof t&&(t=t()),e.memoizedState=e.baseState=t,e.queue=t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Sa,lastRenderedState:t},t=t.dispatch=Ya.bind(null,da,t),[e.memoizedState,t]}function Ra(t,e,n,r){return t={tag:t,create:e,destroy:n,deps:r,next:null},null===(e=da.updateQueue)?(da.updateQueue=e={lastEffect:null,stores:null},e.lastEffect=t.next=t):null===(n=e.lastEffect)?e.lastEffect=t.next=t:(r=n.next,n.next=t,t.next=r,e.lastEffect=t),t}function Oa(){return xa().memoizedState}function Pa(t,e,n,r){var i=ka();da.flags|=t,i.memoizedState=Ra(1|e,n,void 0,void 0===r?null:r)}function Va(t,e,n,r){var i=xa();r=void 0===r?null:r;var o=void 0;if(null!==ha){var a=ha.memoizedState;if(o=a.destroy,null!==r&&wa(r,a.deps))return void(i.memoizedState=Ra(e,n,o,r))}da.flags|=t,i.memoizedState=Ra(1|e,n,o,r)}function ja(t,e){return Pa(8390656,8,t,e)}function Da(t,e){return Va(2048,8,t,e)}function Ha(t,e){return Va(4,2,t,e)}function Ba(t,e){return Va(4,4,t,e)}function Fa(t,e){return"function"==typeof e?(t=t(),e(t),function(){e(null)}):null!=e?(t=t(),e.current=t,function(){e.current=null}):void 0}function Ua(t,e,n){return n=null!=n?n.concat([t]):null,Va(4,4,Fa.bind(null,e,t),n)}function Wa(){}function qa(t,e){var n=xa();e=void 0===e?null:e;var r=n.memoizedState;return null!==r&&null!==e&&wa(e,r[1])?r[0]:(n.memoizedState=[t,e],t)}function Ga(t,e){var n=xa();e=void 0===e?null:e;var r=n.memoizedState;return null!==r&&null!==e&&wa(e,r[1])?r[0]:(t=t(),n.memoizedState=[t,e],t)}function Za(t,e,n){return 21&ua?(dr(n,e)||(n=we(),da.lanes|=n,Dl|=n,t.baseState=!0),e):(t.baseState&&(t.baseState=!1,xs=!0),t.memoizedState=n)}function Ka(t,e){var n=xe;xe=0!==n&&4>n?n:4,t(!0);var r=ca.transition;ca.transition={};try{t(!1),e()}finally{xe=n,ca.transition=r}}function Qa(){return xa().memoizedState}function Xa(t,e,n){var r=oc(t);n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Ja(t)?ts(e,n):null!==(n=Vo(t,e,n,r))&&(ac(n,t,r,ic()),es(n,e,r))}function Ya(t,e,n){var r=oc(t),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ja(t))ts(e,i);else{var o=t.alternate;if(0===t.lanes&&(null===o||0===o.lanes)&&null!==(o=e.lastRenderedReducer))try{var a=e.lastRenderedState,s=o(a,n);if(i.hasEagerState=!0,i.eagerState=s,dr(s,a)){var l=e.interleaved;return null===l?(i.next=i,Po(e)):(i.next=l.next,l.next=i),void(e.interleaved=i)}}catch(t){}null!==(n=Vo(t,e,i,r))&&(ac(n,t,r,i=ic()),es(n,e,r))}}function Ja(t){var e=t.alternate;return t===da||null!==e&&e===da}function ts(t,e){ga=pa=!0;var n=t.pending;null===n?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function es(t,e,n){if(4194240&n){var r=e.lanes;e.lanes=n|=r&=t.pendingLanes,ke(t,n)}}var ns={readContext:Ro,useCallback:ba,useContext:ba,useEffect:ba,useImperativeHandle:ba,useInsertionEffect:ba,useLayoutEffect:ba,useMemo:ba,useReducer:ba,useRef:ba,useState:ba,useDebugValue:ba,useDeferredValue:ba,useTransition:ba,useMutableSource:ba,useSyncExternalStore:ba,useId:ba,unstable_isNewReconciler:!1},rs={readContext:Ro,useCallback:function(t,e){return ka().memoizedState=[t,void 0===e?null:e],t},useContext:Ro,useEffect:ja,useImperativeHandle:function(t,e,n){return n=null!=n?n.concat([t]):null,Pa(4194308,4,Fa.bind(null,e,t),n)},useLayoutEffect:function(t,e){return Pa(4194308,4,t,e)},useInsertionEffect:function(t,e){return Pa(4,2,t,e)},useMemo:function(t,e){var n=ka();return e=void 0===e?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var r=ka();return e=void 0!==n?n(e):e,r.memoizedState=r.baseState=e,r.queue=t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},t=t.dispatch=Xa.bind(null,da,t),[r.memoizedState,t]},useRef:function(t){return ka().memoizedState={current:t}},useState:Ia,useDebugValue:Wa,useDeferredValue:function(t){return ka().memoizedState=t},useTransition:function(){var t=Ia(!1),e=t[0];return t=Ka.bind(null,t[1]),ka().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,r){var i=da,o=ka();if(lo){if(void 0===r)throw Error(n(407));r=r()}else{if(r=e(),null===zl)throw Error(n(349));30&ua||$a(i,e,r)}o.memoizedState=r;var a={value:r,getSnapshot:e};return o.queue=a,ja(Ta.bind(null,i,a,t),[t]),i.flags|=2048,Ra(9,Na.bind(null,i,a,r,e),void 0,null),r},useId:function(){var t=ka(),e=zl.identifierPrefix;if(lo){var n=eo;e=":"+e+"R"+(n=(to&~(1<<32-ue(to)-1)).toString(32)+n),0<(n=va++)&&(e+="H"+n.toString(32)),e+=":"}else e=":"+e+"r"+(n=ma++).toString(32)+":";return t.memoizedState=e},unstable_isNewReconciler:!1},is={readContext:Ro,useCallback:qa,useContext:Ro,useEffect:Da,useImperativeHandle:Ua,useInsertionEffect:Ha,useLayoutEffect:Ba,useMemo:Ga,useReducer:Ea,useRef:Oa,useState:function(){return Ea(Sa)},useDebugValue:Wa,useDeferredValue:function(t){return Za(xa(),ha.memoizedState,t)},useTransition:function(){return[Ea(Sa)[0],xa().memoizedState]},useMutableSource:Ma,useSyncExternalStore:La,useId:Qa,unstable_isNewReconciler:!1},os={readContext:Ro,useCallback:qa,useContext:Ro,useEffect:Da,useImperativeHandle:Ua,useInsertionEffect:Ha,useLayoutEffect:Ba,useMemo:Ga,useReducer:Ca,useRef:Oa,useState:function(){return Ca(Sa)},useDebugValue:Wa,useDeferredValue:function(t){var e=xa();return null===ha?e.memoizedState=t:Za(e,ha.memoizedState,t)},useTransition:function(){return[Ca(Sa)[0],xa().memoizedState]},useMutableSource:Ma,useSyncExternalStore:La,useId:Qa,unstable_isNewReconciler:!1};function as(t,e){if(t&&t.defaultProps){for(var n in e=H({},e),t=t.defaultProps)void 0===e[n]&&(e[n]=t[n]);return e}return e}function ss(t,e,n,r){n=null==(n=n(r,e=t.memoizedState))?e:H({},e,n),t.memoizedState=n,0===t.lanes&&(t.updateQueue.baseState=n)}var ls={isMounted:function(t){return!!(t=t._reactInternals)&&qt(t)===t},enqueueSetState:function(t,e,n){t=t._reactInternals;var r=ic(),i=oc(t),o=Fo(r,i);o.payload=e,null!=n&&(o.callback=n),null!==(e=Uo(t,o,i))&&(ac(e,t,i,r),Wo(e,t,i))},enqueueReplaceState:function(t,e,n){t=t._reactInternals;var r=ic(),i=oc(t),o=Fo(r,i);o.tag=1,o.payload=e,null!=n&&(o.callback=n),null!==(e=Uo(t,o,i))&&(ac(e,t,i,r),Wo(e,t,i))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var n=ic(),r=oc(t),i=Fo(n,r);i.tag=2,null!=e&&(i.callback=e),null!==(e=Uo(t,i,r))&&(ac(e,t,r,n),Wo(e,t,r))}};function cs(t,e,n,r,i,o,a){return"function"==typeof(t=t.stateNode).shouldComponentUpdate?t.shouldComponentUpdate(r,o,a):!(e.prototype&&e.prototype.isPureReactComponent&&hr(n,r)&&hr(i,o))}function us(t,e,n){var r=!1,i=Ti,o=e.contextType;return"object"==typeof o&&null!==o?o=Ro(o):(i=Oi(e)?Ii:Ai.current,o=(r=null!=(r=e.contextTypes))?Ri(t,i):Ti),e=new e(n,o),t.memoizedState=null!=e.state?e.state:null,e.updater=ls,t.stateNode=e,e._reactInternals=t,r&&((t=t.stateNode).__reactInternalMemoizedUnmaskedChildContext=i,t.__reactInternalMemoizedMaskedChildContext=o),e}function ds(t,e,n,r){t=e.state,"function"==typeof e.componentWillReceiveProps&&e.componentWillReceiveProps(n,r),"function"==typeof e.UNSAFE_componentWillReceiveProps&&e.UNSAFE_componentWillReceiveProps(n,r),e.state!==t&&ls.enqueueReplaceState(e,e.state,null)}function hs(t,e,n,r){var i=t.stateNode;i.props=n,i.state=t.memoizedState,i.refs={},Ho(t);var o=e.contextType;"object"==typeof o&&null!==o?i.context=Ro(o):(o=Oi(e)?Ii:Ai.current,i.context=Ri(t,o)),i.state=t.memoizedState,"function"==typeof(o=e.getDerivedStateFromProps)&&(ss(t,e,o,n),i.state=t.memoizedState),"function"==typeof e.getDerivedStateFromProps||"function"==typeof i.getSnapshotBeforeUpdate||"function"!=typeof i.UNSAFE_componentWillMount&&"function"!=typeof i.componentWillMount||(e=i.state,"function"==typeof i.componentWillMount&&i.componentWillMount(),"function"==typeof i.UNSAFE_componentWillMount&&i.UNSAFE_componentWillMount(),e!==i.state&&ls.enqueueReplaceState(i,i.state,null),Go(t,n,i,r),i.state=t.memoizedState),"function"==typeof i.componentDidMount&&(t.flags|=4194308)}function fs(t,e){try{var n="",r=e;do{n+=W(r),r=r.return}while(r);var i=n}catch(t){i="\nError generating stack: "+t.message+"\n"+t.stack}return{value:t,source:e,stack:i,digest:null}}function ps(t,e,n){return{value:t,source:null,stack:null!=n?n:null,digest:null!=e?e:null}}function gs(t,e){try{console.error(e.value)}catch(t){setTimeout((function(){throw t}))}}var vs="function"==typeof WeakMap?WeakMap:Map;function ms(t,e,n){(n=Fo(-1,n)).tag=3,n.payload={element:null};var r=e.value;return n.callback=function(){Zl||(Zl=!0,Kl=r),gs(0,e)},n}function bs(t,e,n){(n=Fo(-1,n)).tag=3;var r=t.type.getDerivedStateFromError;if("function"==typeof r){var i=e.value;n.payload=function(){return r(i)},n.callback=function(){gs(0,e)}}var o=t.stateNode;return null!==o&&"function"==typeof o.componentDidCatch&&(n.callback=function(){gs(0,e),"function"!=typeof r&&(null===Ql?Ql=new Set([this]):Ql.add(this));var t=e.stack;this.componentDidCatch(e.value,{componentStack:null!==t?t:""})}),n}function ws(t,e,n){var r=t.pingCache;if(null===r){r=t.pingCache=new vs;var i=new Set;r.set(e,i)}else void 0===(i=r.get(e))&&(i=new Set,r.set(e,i));i.has(n)||(i.add(n),t=$c.bind(null,t,e,n),e.then(t,t))}function ys(t){do{var e;if((e=13===t.tag)&&(e=null===(e=t.memoizedState)||null!==e.dehydrated),e)return t;t=t.return}while(null!==t);return null}function _s(t,e,n,r,i){return 1&t.mode?(t.flags|=65536,t.lanes=i,t):(t===e?t.flags|=65536:(t.flags|=128,n.flags|=131072,n.flags&=-52805,1===n.tag&&(null===n.alternate?n.tag=17:((e=Fo(-1,1)).tag=2,Uo(n,e,1))),n.lanes|=1),t)}var ks=_.ReactCurrentOwner,xs=!1;function Ss(t,e,n,r){e.child=null===t?Co(e,null,n,r):Eo(e,t.child,n,r)}function Es(t,e,n,r,i){n=n.render;var o=e.ref;return Io(e,i),r=ya(t,e,n,r,o,i),n=_a(),null===t||xs?(lo&&n&&io(e),e.flags|=1,Ss(t,e,r,i),e.child):(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,Zs(t,e,i))}function Cs(t,e,n,r,i){if(null===t){var o=n.type;return"function"!=typeof o||Oc(o)||void 0!==o.defaultProps||null!==n.compare||void 0!==n.defaultProps?((t=Vc(n.type,null,r,e,e.mode,i)).ref=e.ref,t.return=e,e.child=t):(e.tag=15,e.type=o,Ms(t,e,o,r,i))}return o=t.child,t.lanes&i||!(n=null!==(n=n.compare)?n:hr)(o.memoizedProps,r)||t.ref!==e.ref?(e.flags|=1,(t=Pc(o,r)).ref=e.ref,t.return=e,e.child=t):Zs(t,e,i)}function Ms(t,e,n,r,i){if(null!==t){var o=t.memoizedProps;if(hr(o,r)&&t.ref===e.ref){if(xs=!1,e.pendingProps=r=o,!(t.lanes&i))return e.lanes=t.lanes,Zs(t,e,i);131072&t.flags&&(xs=!0)}}return Ns(t,e,n,r,i)}function Ls(t,e,n){var r=e.pendingProps,i=r.children,o=null!==t?t.memoizedState:null;if("hidden"===r.mode)if(1&e.mode){if(!(1073741824&n))return t=null!==o?o.baseLanes|n:n,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:t,cachePool:null,transitions:null},e.updateQueue=null,Ni(Pl,Ol),Ol|=t,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=null!==o?o.baseLanes:n,Ni(Pl,Ol),Ol|=r}else e.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ni(Pl,Ol),Ol|=n;else null!==o?(r=o.baseLanes|n,e.memoizedState=null):r=n,Ni(Pl,Ol),Ol|=r;return Ss(t,e,i,n),e.child}function $s(t,e){var n=e.ref;(null===t&&null!==n||null!==t&&t.ref!==n)&&(e.flags|=512,e.flags|=2097152)}function Ns(t,e,n,r,i){var o=Oi(n)?Ii:Ai.current;return o=Ri(e,o),Io(e,i),n=ya(t,e,n,r,o,i),r=_a(),null===t||xs?(lo&&r&&io(e),e.flags|=1,Ss(t,e,n,i),e.child):(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,Zs(t,e,i))}function Ts(t,e,n,r,i){if(Oi(n)){var o=!0;Di(e)}else o=!1;if(Io(e,i),null===e.stateNode)Gs(t,e),us(e,n,r),hs(e,n,r,i),r=!0;else if(null===t){var a=e.stateNode,s=e.memoizedProps;a.props=s;var l=a.context,c=n.contextType;c="object"==typeof c&&null!==c?Ro(c):Ri(e,c=Oi(n)?Ii:Ai.current);var u=n.getDerivedStateFromProps,d="function"==typeof u||"function"==typeof a.getSnapshotBeforeUpdate;d||"function"!=typeof a.UNSAFE_componentWillReceiveProps&&"function"!=typeof a.componentWillReceiveProps||(s!==r||l!==c)&&ds(e,a,r,c),Do=!1;var h=e.memoizedState;a.state=h,Go(e,r,a,i),l=e.memoizedState,s!==r||h!==l||zi.current||Do?("function"==typeof u&&(ss(e,n,u,r),l=e.memoizedState),(s=Do||cs(e,n,s,r,h,l,c))?(d||"function"!=typeof a.UNSAFE_componentWillMount&&"function"!=typeof a.componentWillMount||("function"==typeof a.componentWillMount&&a.componentWillMount(),"function"==typeof a.UNSAFE_componentWillMount&&a.UNSAFE_componentWillMount()),"function"==typeof a.componentDidMount&&(e.flags|=4194308)):("function"==typeof a.componentDidMount&&(e.flags|=4194308),e.memoizedProps=r,e.memoizedState=l),a.props=r,a.state=l,a.context=c,r=s):("function"==typeof a.componentDidMount&&(e.flags|=4194308),r=!1)}else{a=e.stateNode,Bo(t,e),s=e.memoizedProps,c=e.type===e.elementType?s:as(e.type,s),a.props=c,d=e.pendingProps,h=a.context,l="object"==typeof(l=n.contextType)&&null!==l?Ro(l):Ri(e,l=Oi(n)?Ii:Ai.current);var f=n.getDerivedStateFromProps;(u="function"==typeof f||"function"==typeof a.getSnapshotBeforeUpdate)||"function"!=typeof a.UNSAFE_componentWillReceiveProps&&"function"!=typeof a.componentWillReceiveProps||(s!==d||h!==l)&&ds(e,a,r,l),Do=!1,a.state=h=e.memoizedState,Go(e,r,a,i);var p=e.memoizedState;s!==d||h!==p||zi.current||Do?("function"==typeof f&&(ss(e,n,f,r),p=e.memoizedState),(c=Do||cs(e,n,c,r,h,p,l)||!1)?(u||"function"!=typeof a.UNSAFE_componentWillUpdate&&"function"!=typeof a.componentWillUpdate||("function"==typeof a.componentWillUpdate&&a.componentWillUpdate(r,p,l),"function"==typeof a.UNSAFE_componentWillUpdate&&a.UNSAFE_componentWillUpdate(r,p,l)),"function"==typeof a.componentDidUpdate&&(e.flags|=4),"function"==typeof a.getSnapshotBeforeUpdate&&(e.flags|=1024)):("function"!=typeof a.componentDidUpdate||s===t.memoizedProps&&h===t.memoizedState||(e.flags|=4),"function"!=typeof a.getSnapshotBeforeUpdate||s===t.memoizedProps&&h===t.memoizedState||(e.flags|=1024),e.memoizedProps=r,e.memoizedState=p),a.props=r,a.state=p,a.context=l,r=c):("function"!=typeof a.componentDidUpdate||s===t.memoizedProps&&h===t.memoizedState||(e.flags|=4),"function"!=typeof a.getSnapshotBeforeUpdate||s===t.memoizedProps&&h===t.memoizedState||(e.flags|=1024),r=!1)}return As(t,e,n,r,o,i)}function As(t,e,n,r,i,o){$s(t,e);var a=!!(128&e.flags);if(!r&&!a)return i&&Hi(e,n,!1),Zs(t,e,o);r=e.stateNode,ks.current=e;var s=a&&"function"!=typeof n.getDerivedStateFromError?null:r.render();return e.flags|=1,null!==t&&a?(e.child=Eo(e,t.child,null,o),e.child=Eo(e,null,s,o)):Ss(t,e,s,o),e.memoizedState=r.state,i&&Hi(e,n,!0),e.child}function zs(t){var e=t.stateNode;e.pendingContext?Vi(0,e.pendingContext,e.pendingContext!==e.context):e.context&&Vi(0,e.context,!1),ta(t,e.containerInfo)}function Is(t,e,n,r,i){return bo(),wo(i),e.flags|=256,Ss(t,e,n,r),e.child}var Rs,Os,Ps,Vs,js={dehydrated:null,treeContext:null,retryLane:0};function Ds(t){return{baseLanes:t,cachePool:null,transitions:null}}function Hs(t,e,r){var i,o=e.pendingProps,a=ia.current,s=!1,l=!!(128&e.flags);if((i=l)||(i=(null===t||null!==t.memoizedState)&&!!(2&a)),i?(s=!0,e.flags&=-129):null!==t&&null===t.memoizedState||(a|=1),Ni(ia,1&a),null===t)return po(e),null!==(t=e.memoizedState)&&null!==(t=t.dehydrated)?(e.lanes=1&e.mode?"$!"===t.data?8:1073741824:1,null):(l=o.children,t=o.fallback,s?(s=e.child,l={mode:"hidden",children:l},1&(o=e.mode)||null===s?s=Dc(l,o,0,null):(s.childLanes=0,s.pendingProps=l),t=jc(t,o,r,null),s.return=e,t.return=e,s.sibling=t,e.child=s,e.child.memoizedState=Ds(r),e.memoizedState=js,t):Bs(e,l));if(null!==(a=t.memoizedState)&&null!==(i=a.dehydrated))return function(t,e,r,i,o,a,s){if(r)return 256&e.flags?(e.flags&=-257,Fs(t,e,s,i=ps(Error(n(422))))):null!==e.memoizedState?(e.child=t.child,e.flags|=128,null):(a=i.fallback,i=Dc({mode:"visible",children:i.children},o=e.mode,0,null),(a=jc(a,o,s,null)).flags|=2,i.return=e,a.return=e,i.sibling=a,e.child=i,1&e.mode&&Eo(e,t.child,null,s),e.child.memoizedState=Ds(s),e.memoizedState=js,a);if(!(1&e.mode))return Fs(t,e,s,null);if("$!"===o.data){if(i=o.nextSibling&&o.nextSibling.dataset)var l=i.dgst;return i=l,Fs(t,e,s,i=ps(a=Error(n(419)),i,void 0))}if(l=!!(s&t.childLanes),xs||l){if(null!==(i=zl)){switch(s&-s){case 4:o=2;break;case 16:o=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:o=32;break;case 536870912:o=268435456;break;default:o=0}0!==(o=o&(i.suspendedLanes|s)?0:o)&&o!==a.retryLane&&(a.retryLane=o,jo(t,o),ac(i,t,o,-1))}return wc(),Fs(t,e,s,i=ps(Error(n(421))))}return"$?"===o.data?(e.flags|=128,e.child=t.child,e=Tc.bind(null,t),o._reactRetry=e,null):(t=a.treeContext,so=fi(o.nextSibling),ao=e,lo=!0,co=null,null!==t&&(Xi[Yi++]=to,Xi[Yi++]=eo,Xi[Yi++]=Ji,to=t.id,eo=t.overflow,Ji=e),(e=Bs(e,i.children)).flags|=4096,e)}(t,e,l,o,i,a,r);if(s){s=o.fallback,i=(a=t.child).sibling;var c={mode:"hidden",children:o.children};return 1&(l=e.mode)||e.child===a?(o=Pc(a,c)).subtreeFlags=14680064&a.subtreeFlags:((o=e.child).childLanes=0,o.pendingProps=c,e.deletions=null),null!==i?s=Pc(i,s):(s=jc(s,l,r,null)).flags|=2,s.return=e,o.return=e,o.sibling=s,e.child=o,o=s,s=e.child,l=null===(l=t.child.memoizedState)?Ds(r):{baseLanes:l.baseLanes|r,cachePool:null,transitions:l.transitions},s.memoizedState=l,s.childLanes=t.childLanes&~r,e.memoizedState=js,o}return t=(s=t.child).sibling,o=Pc(s,{mode:"visible",children:o.children}),!(1&e.mode)&&(o.lanes=r),o.return=e,o.sibling=null,null!==t&&(null===(r=e.deletions)?(e.deletions=[t],e.flags|=16):r.push(t)),e.child=o,e.memoizedState=null,o}function Bs(t,e){return(e=Dc({mode:"visible",children:e},t.mode,0,null)).return=t,t.child=e}function Fs(t,e,n,r){return null!==r&&wo(r),Eo(e,t.child,null,n),(t=Bs(e,e.pendingProps.children)).flags|=2,e.memoizedState=null,t}function Us(t,e,n){t.lanes|=e;var r=t.alternate;null!==r&&(r.lanes|=e),zo(t.return,e,n)}function Ws(t,e,n,r,i){var o=t.memoizedState;null===o?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(o.isBackwards=e,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i)}function qs(t,e,n){var r=e.pendingProps,i=r.revealOrder,o=r.tail;if(Ss(t,e,r.children,n),2&(r=ia.current))r=1&r|2,e.flags|=128;else{if(null!==t&&128&t.flags)t:for(t=e.child;null!==t;){if(13===t.tag)null!==t.memoizedState&&Us(t,n,e);else if(19===t.tag)Us(t,n,e);else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break t;for(;null===t.sibling;){if(null===t.return||t.return===e)break t;t=t.return}t.sibling.return=t.return,t=t.sibling}r&=1}if(Ni(ia,r),1&e.mode)switch(i){case"forwards":for(n=e.child,i=null;null!==n;)null!==(t=n.alternate)&&null===oa(t)&&(i=n),n=n.sibling;null===(n=i)?(i=e.child,e.child=null):(i=n.sibling,n.sibling=null),Ws(e,!1,i,n,o);break;case"backwards":for(n=null,i=e.child,e.child=null;null!==i;){if(null!==(t=i.alternate)&&null===oa(t)){e.child=i;break}t=i.sibling,i.sibling=n,n=i,i=t}Ws(e,!0,n,null,o);break;case"together":Ws(e,!1,null,null,void 0);break;default:e.memoizedState=null}else e.memoizedState=null;return e.child}function Gs(t,e){!(1&e.mode)&&null!==t&&(t.alternate=null,e.alternate=null,e.flags|=2)}function Zs(t,e,r){if(null!==t&&(e.dependencies=t.dependencies),Dl|=e.lanes,!(r&e.childLanes))return null;if(null!==t&&e.child!==t.child)throw Error(n(153));if(null!==e.child){for(r=Pc(t=e.child,t.pendingProps),e.child=r,r.return=e;null!==t.sibling;)(r=r.sibling=Pc(t=t.sibling,t.pendingProps)).return=e;r.sibling=null}return e.child}function Ks(t,e){if(!lo)switch(t.tailMode){case"hidden":e=t.tail;for(var n=null;null!==e;)null!==e.alternate&&(n=e),e=e.sibling;null===n?t.tail=null:n.sibling=null;break;case"collapsed":n=t.tail;for(var r=null;null!==n;)null!==n.alternate&&(r=n),n=n.sibling;null===r?e||null===t.tail?t.tail=null:t.tail.sibling=null:r.sibling=null}}function Qs(t){var e=null!==t.alternate&&t.alternate.child===t.child,n=0,r=0;if(e)for(var i=t.child;null!==i;)n|=i.lanes|i.childLanes,r|=14680064&i.subtreeFlags,r|=14680064&i.flags,i.return=t,i=i.sibling;else for(i=t.child;null!==i;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=t,i=i.sibling;return t.subtreeFlags|=r,t.childLanes=n,e}function Xs(t,e,r){var o=e.pendingProps;switch(oo(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Qs(e),null;case 1:case 17:return Oi(e.type)&&Pi(),Qs(e),null;case 3:return o=e.stateNode,ea(),$i(zi),$i(Ai),sa(),o.pendingContext&&(o.context=o.pendingContext,o.pendingContext=null),null!==t&&null!==t.child||(vo(e)?e.flags|=4:null===t||t.memoizedState.isDehydrated&&!(256&e.flags)||(e.flags|=1024,null!==co&&(uc(co),co=null))),Os(t,e),Qs(e),null;case 5:ra(e);var a=Jo(Yo.current);if(r=e.type,null!==t&&null!=e.stateNode)Ps(t,e,r,o,a),t.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!o){if(null===e.stateNode)throw Error(n(166));return Qs(e),null}if(t=Jo(Qo.current),vo(e)){r=e.type;var s=e.memoizedProps;switch((o=e.stateNode)[vi]=e,o[mi]=s,t=!!(1&e.mode),r){case"dialog":Fr("cancel",o),Fr("close",o);break;case"iframe":case"object":case"embed":Fr("load",o);break;case"video":case"audio":for(a=0;a<jr.length;a++)Fr(jr[a],o);break;case"source":Fr("error",o);break;case"img":case"image":case"link":Fr("error",o),Fr("load",o);break;case"details":Fr("toggle",o);break;case"input":tt(o,s),Fr("invalid",o);break;case"select":o._wrapperState={wasMultiple:!!s.multiple},Fr("invalid",o);break;case"textarea":lt(o,s),Fr("invalid",o)}for(var l in kt(r,s),a=null,s)if(s.hasOwnProperty(l)){var c=s[l];"children"===l?"string"==typeof c?o.textContent!==c&&(!0!==s.suppressHydrationWarning&&ni(o.textContent,c,t),a=["children",c]):"number"==typeof c&&o.textContent!==""+c&&(!0!==s.suppressHydrationWarning&&ni(o.textContent,c,t),a=["children",""+c]):i.hasOwnProperty(l)&&null!=c&&"onScroll"===l&&Fr("scroll",o)}switch(r){case"input":Q(o),rt(o,s,!0);break;case"textarea":Q(o),ut(o);break;case"select":case"option":break;default:"function"==typeof s.onClick&&(o.onclick=ri)}e.updateQueue=o=a,null!==o&&(e.flags|=4)}else{l=9===a.nodeType?a:a.ownerDocument,"http://www.w3.org/1999/xhtml"===t&&(t=dt(r)),"http://www.w3.org/1999/xhtml"===t?"script"===r?((t=l.createElement("div")).innerHTML="<script><\/script>",t=t.removeChild(t.firstChild)):"string"==typeof o.is?t=l.createElement(r,{is:o.is}):(t=l.createElement(r),"select"===r&&(l=t,o.multiple?l.multiple=!0:o.size&&(l.size=o.size))):t=l.createElementNS(t,r),t[vi]=e,t[mi]=o,Rs(t,e,!1,!1),e.stateNode=t;t:{switch(l=xt(r,o),r){case"dialog":Fr("cancel",t),Fr("close",t),a=o;break;case"iframe":case"object":case"embed":Fr("load",t),a=o;break;case"video":case"audio":for(a=0;a<jr.length;a++)Fr(jr[a],t);a=o;break;case"source":Fr("error",t),a=o;break;case"img":case"image":case"link":Fr("error",t),Fr("load",t),a=o;break;case"details":Fr("toggle",t),a=o;break;case"input":tt(t,o),a=J(t,o),Fr("invalid",t);break;case"option":default:a=o;break;case"select":t._wrapperState={wasMultiple:!!o.multiple},a=H({},o,{value:void 0}),Fr("invalid",t);break;case"textarea":lt(t,o),a=st(t,o),Fr("invalid",t)}for(s in kt(r,a),c=a)if(c.hasOwnProperty(s)){var u=c[s];"style"===s?yt(t,u):"dangerouslySetInnerHTML"===s?null!=(u=u?u.__html:void 0)&&gt(t,u):"children"===s?"string"==typeof u?("textarea"!==r||""!==u)&&vt(t,u):"number"==typeof u&&vt(t,""+u):"suppressContentEditableWarning"!==s&&"suppressHydrationWarning"!==s&&"autoFocus"!==s&&(i.hasOwnProperty(s)?null!=u&&"onScroll"===s&&Fr("scroll",t):null!=u&&v(t,s,u,l))}switch(r){case"input":Q(t),rt(t,o,!1);break;case"textarea":Q(t),ut(t);break;case"option":null!=o.value&&t.setAttribute("value",""+Z(o.value));break;case"select":t.multiple=!!o.multiple,null!=(s=o.value)?at(t,!!o.multiple,s,!1):null!=o.defaultValue&&at(t,!!o.multiple,o.defaultValue,!0);break;default:"function"==typeof a.onClick&&(t.onclick=ri)}switch(r){case"button":case"input":case"select":case"textarea":o=!!o.autoFocus;break t;case"img":o=!0;break t;default:o=!1}}o&&(e.flags|=4)}null!==e.ref&&(e.flags|=512,e.flags|=2097152)}return Qs(e),null;case 6:if(t&&null!=e.stateNode)Vs(t,e,t.memoizedProps,o);else{if("string"!=typeof o&&null===e.stateNode)throw Error(n(166));if(r=Jo(Yo.current),Jo(Qo.current),vo(e)){if(r=e.memoizedProps,(o=e.stateNode)[vi]=e,(s=o.nodeValue!==r)&&null!==(t=ao))switch(t.tag){case 3:ni(o.nodeValue,r,!!(1&t.mode));break;case 5:!0!==t.memoizedProps.suppressHydrationWarning&&ni(o.nodeValue,r,!!(1&t.mode))}s&&(e.flags|=4)}else(o=(9===r.nodeType?r:r.ownerDocument).createTextNode(o))[vi]=e,e.stateNode=o}return Qs(e),null;case 13:if($i(ia),o=e.memoizedState,null===t||null!==t.memoizedState&&null!==t.memoizedState.dehydrated){if(lo&&null!==so&&1&e.mode&&!(128&e.flags))mo(),bo(),e.flags|=98560,s=!1;else if(s=vo(e),null!==o&&null!==o.dehydrated){if(null===t){if(!s)throw Error(n(318));if(!(s=null!==(s=e.memoizedState)?s.dehydrated:null))throw Error(n(317));s[vi]=e}else bo(),!(128&e.flags)&&(e.memoizedState=null),e.flags|=4;Qs(e),s=!1}else null!==co&&(uc(co),co=null),s=!0;if(!s)return 65536&e.flags?e:null}return 128&e.flags?(e.lanes=r,e):((o=null!==o)!=(null!==t&&null!==t.memoizedState)&&o&&(e.child.flags|=8192,1&e.mode&&(null===t||1&ia.current?0===Vl&&(Vl=3):wc())),null!==e.updateQueue&&(e.flags|=4),Qs(e),null);case 4:return ea(),Os(t,e),null===t&&qr(e.stateNode.containerInfo),Qs(e),null;case 10:return Ao(e.type._context),Qs(e),null;case 19:if($i(ia),null===(s=e.memoizedState))return Qs(e),null;if(o=!!(128&e.flags),null===(l=s.rendering))if(o)Ks(s,!1);else{if(0!==Vl||null!==t&&128&t.flags)for(t=e.child;null!==t;){if(null!==(l=oa(t))){for(e.flags|=128,Ks(s,!1),null!==(o=l.updateQueue)&&(e.updateQueue=o,e.flags|=4),e.subtreeFlags=0,o=r,r=e.child;null!==r;)t=o,(s=r).flags&=14680066,null===(l=s.alternate)?(s.childLanes=0,s.lanes=t,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=l.childLanes,s.lanes=l.lanes,s.child=l.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=l.memoizedProps,s.memoizedState=l.memoizedState,s.updateQueue=l.updateQueue,s.type=l.type,s.dependencies=null===(t=l.dependencies)?null:{lanes:t.lanes,firstContext:t.firstContext}),r=r.sibling;return Ni(ia,1&ia.current|2),e.child}t=t.sibling}null!==s.tail&&ee()>ql&&(e.flags|=128,o=!0,Ks(s,!1),e.lanes=4194304)}else{if(!o)if(null!==(t=oa(l))){if(e.flags|=128,o=!0,null!==(r=t.updateQueue)&&(e.updateQueue=r,e.flags|=4),Ks(s,!0),null===s.tail&&"hidden"===s.tailMode&&!l.alternate&&!lo)return Qs(e),null}else 2*ee()-s.renderingStartTime>ql&&1073741824!==r&&(e.flags|=128,o=!0,Ks(s,!1),e.lanes=4194304);s.isBackwards?(l.sibling=e.child,e.child=l):(null!==(r=s.last)?r.sibling=l:e.child=l,s.last=l)}return null!==s.tail?(s.rendering=e=s.tail,s.tail=e.sibling,s.renderingStartTime=ee(),e.sibling=null,r=ia.current,Ni(ia,o?1&r|2:1&r),e):(Qs(e),null);case 22:case 23:return gc(),o=null!==e.memoizedState,null!==t&&null!==t.memoizedState!==o&&(e.flags|=8192),o&&1&e.mode?!!(1073741824&Ol)&&(Qs(e),6&e.subtreeFlags&&(e.flags|=8192)):Qs(e),null;case 24:case 25:return null}throw Error(n(156,e.tag))}function Ys(t,e){switch(oo(e),e.tag){case 1:return Oi(e.type)&&Pi(),65536&(t=e.flags)?(e.flags=-65537&t|128,e):null;case 3:return ea(),$i(zi),$i(Ai),sa(),65536&(t=e.flags)&&!(128&t)?(e.flags=-65537&t|128,e):null;case 5:return ra(e),null;case 13:if($i(ia),null!==(t=e.memoizedState)&&null!==t.dehydrated){if(null===e.alternate)throw Error(n(340));bo()}return 65536&(t=e.flags)?(e.flags=-65537&t|128,e):null;case 19:return $i(ia),null;case 4:return ea(),null;case 10:return Ao(e.type._context),null;case 22:case 23:return gc(),null;default:return null}}Rs=function(t,e){for(var n=e.child;null!==n;){if(5===n.tag||6===n.tag)t.appendChild(n.stateNode);else if(4!==n.tag&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===e)break;for(;null===n.sibling;){if(null===n.return||n.return===e)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},Os=function(){},Ps=function(t,e,n,r){var o=t.memoizedProps;if(o!==r){t=e.stateNode,Jo(Qo.current);var a,s=null;switch(n){case"input":o=J(t,o),r=J(t,r),s=[];break;case"select":o=H({},o,{value:void 0}),r=H({},r,{value:void 0}),s=[];break;case"textarea":o=st(t,o),r=st(t,r),s=[];break;default:"function"!=typeof o.onClick&&"function"==typeof r.onClick&&(t.onclick=ri)}for(u in kt(n,r),n=null,o)if(!r.hasOwnProperty(u)&&o.hasOwnProperty(u)&&null!=o[u])if("style"===u){var l=o[u];for(a in l)l.hasOwnProperty(a)&&(n||(n={}),n[a]="")}else"dangerouslySetInnerHTML"!==u&&"children"!==u&&"suppressContentEditableWarning"!==u&&"suppressHydrationWarning"!==u&&"autoFocus"!==u&&(i.hasOwnProperty(u)?s||(s=[]):(s=s||[]).push(u,null));for(u in r){var c=r[u];if(l=null!=o?o[u]:void 0,r.hasOwnProperty(u)&&c!==l&&(null!=c||null!=l))if("style"===u)if(l){for(a in l)!l.hasOwnProperty(a)||c&&c.hasOwnProperty(a)||(n||(n={}),n[a]="");for(a in c)c.hasOwnProperty(a)&&l[a]!==c[a]&&(n||(n={}),n[a]=c[a])}else n||(s||(s=[]),s.push(u,n)),n=c;else"dangerouslySetInnerHTML"===u?(l=l?l.__html:void 0,null!=(c=c?c.__html:void 0)&&l!==c&&(s=s||[]).push(u,c)):"children"===u?"string"!=typeof c&&"number"!=typeof c||(s=s||[]).push(u,""+c):"suppressContentEditableWarning"!==u&&"suppressHydrationWarning"!==u&&(i.hasOwnProperty(u)?(null!=c&&"onScroll"===u&&Fr("scroll",t),s||l===c||(s=[])):(s=s||[]).push(u,c))}n&&(s=s||[]).push("style",n);var u=s;(e.updateQueue=u)&&(e.flags|=4)}},Vs=function(t,e,n,r){n!==r&&(e.flags|=4)};var Js=!1,tl=!1,el="function"==typeof WeakSet?WeakSet:Set,nl=null;function rl(t,e){var n=t.ref;if(null!==n)if("function"==typeof n)try{n(null)}catch(n){Lc(t,e,n)}else n.current=null}function il(t,e,n){try{n()}catch(n){Lc(t,e,n)}}var ol=!1;function al(t,e,n){var r=e.updateQueue;if(null!==(r=null!==r?r.lastEffect:null)){var i=r=r.next;do{if((i.tag&t)===t){var o=i.destroy;i.destroy=void 0,void 0!==o&&il(e,n,o)}i=i.next}while(i!==r)}}function sl(t,e){if(null!==(e=null!==(e=e.updateQueue)?e.lastEffect:null)){var n=e=e.next;do{(n.tag&t)===t&&(n.destroy=(0,n.create)()),n=n.next}while(n!==e)}}function ll(t){var e=t.ref;null!==e&&(t=t.stateNode,"function"==typeof e?e(t):e.current=t)}function cl(t){var e=t.alternate;null!==e&&(t.alternate=null,cl(e)),t.child=null,t.deletions=null,t.sibling=null,5===t.tag&&null!==(e=t.stateNode)&&(delete e[vi],delete e[mi],delete e[wi],delete e[yi],delete e[_i]),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function ul(t){return 5===t.tag||3===t.tag||4===t.tag}function dl(t){t:for(;;){for(;null===t.sibling;){if(null===t.return||ul(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;5!==t.tag&&6!==t.tag&&18!==t.tag;){if(2&t.flags)continue t;if(null===t.child||4===t.tag)continue t;t.child.return=t,t=t.child}if(!(2&t.flags))return t.stateNode}}function hl(t,e,n){var r=t.tag;if(5===r||6===r)t=t.stateNode,e?8===n.nodeType?n.parentNode.insertBefore(t,e):n.insertBefore(t,e):(8===n.nodeType?(e=n.parentNode).insertBefore(t,n):(e=n).appendChild(t),null!=(n=n._reactRootContainer)||null!==e.onclick||(e.onclick=ri));else if(4!==r&&null!==(t=t.child))for(hl(t,e,n),t=t.sibling;null!==t;)hl(t,e,n),t=t.sibling}function fl(t,e,n){var r=t.tag;if(5===r||6===r)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(4!==r&&null!==(t=t.child))for(fl(t,e,n),t=t.sibling;null!==t;)fl(t,e,n),t=t.sibling}var pl=null,gl=!1;function vl(t,e,n){for(n=n.child;null!==n;)ml(t,e,n),n=n.sibling}function ml(t,e,n){if(ce&&"function"==typeof ce.onCommitFiberUnmount)try{ce.onCommitFiberUnmount(le,n)}catch(t){}switch(n.tag){case 5:tl||rl(n,e);case 6:var r=pl,i=gl;pl=null,vl(t,e,n),gl=i,null!==(pl=r)&&(gl?(n=n.stateNode,8===(t=pl).nodeType?t.parentNode.removeChild(n):t.removeChild(n)):pl.removeChild(n.stateNode));break;case 18:null!==pl&&(gl?(n=n.stateNode,8===(t=pl).nodeType?hi(t.parentNode,n):1===t.nodeType&&hi(t,n),qe(t)):hi(pl,n.stateNode));break;case 4:r=pl,i=gl,pl=n.stateNode.containerInfo,gl=!0,vl(t,e,n),pl=r,gl=i;break;case 0:case 11:case 14:case 15:if(!tl&&null!==(r=n.updateQueue)&&null!==(r=r.lastEffect)){i=r=r.next;do{var o=i,a=o.destroy;o=o.tag,void 0!==a&&(2&o||4&o)&&il(n,e,a),i=i.next}while(i!==r)}vl(t,e,n);break;case 1:if(!tl&&(rl(n,e),"function"==typeof(r=n.stateNode).componentWillUnmount))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(t){Lc(n,e,t)}vl(t,e,n);break;case 21:vl(t,e,n);break;case 22:1&n.mode?(tl=(r=tl)||null!==n.memoizedState,vl(t,e,n),tl=r):vl(t,e,n);break;default:vl(t,e,n)}}function bl(t){var e=t.updateQueue;if(null!==e){t.updateQueue=null;var n=t.stateNode;null===n&&(n=t.stateNode=new el),e.forEach((function(e){var r=Ac.bind(null,t,e);n.has(e)||(n.add(e),e.then(r,r))}))}}function wl(t,e){var r=e.deletions;if(null!==r)for(var i=0;i<r.length;i++){var o=r[i];try{var a=t,s=e,l=s;t:for(;null!==l;){switch(l.tag){case 5:pl=l.stateNode,gl=!1;break t;case 3:case 4:pl=l.stateNode.containerInfo,gl=!0;break t}l=l.return}if(null===pl)throw Error(n(160));ml(a,s,o),pl=null,gl=!1;var c=o.alternate;null!==c&&(c.return=null),o.return=null}catch(t){Lc(o,e,t)}}if(12854&e.subtreeFlags)for(e=e.child;null!==e;)yl(e,t),e=e.sibling}function yl(t,e){var r=t.alternate,i=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(wl(e,t),_l(t),4&i){try{al(3,t,t.return),sl(3,t)}catch(e){Lc(t,t.return,e)}try{al(5,t,t.return)}catch(e){Lc(t,t.return,e)}}break;case 1:wl(e,t),_l(t),512&i&&null!==r&&rl(r,r.return);break;case 5:if(wl(e,t),_l(t),512&i&&null!==r&&rl(r,r.return),32&t.flags){var o=t.stateNode;try{vt(o,"")}catch(e){Lc(t,t.return,e)}}if(4&i&&null!=(o=t.stateNode)){var a=t.memoizedProps,s=null!==r?r.memoizedProps:a,l=t.type,c=t.updateQueue;if(t.updateQueue=null,null!==c)try{"input"===l&&"radio"===a.type&&null!=a.name&&et(o,a),xt(l,s);var u=xt(l,a);for(s=0;s<c.length;s+=2){var d=c[s],h=c[s+1];"style"===d?yt(o,h):"dangerouslySetInnerHTML"===d?gt(o,h):"children"===d?vt(o,h):v(o,d,h,u)}switch(l){case"input":nt(o,a);break;case"textarea":ct(o,a);break;case"select":var f=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!a.multiple;var p=a.value;null!=p?at(o,!!a.multiple,p,!1):f!==!!a.multiple&&(null!=a.defaultValue?at(o,!!a.multiple,a.defaultValue,!0):at(o,!!a.multiple,a.multiple?[]:"",!1))}o[mi]=a}catch(e){Lc(t,t.return,e)}}break;case 6:if(wl(e,t),_l(t),4&i){if(null===t.stateNode)throw Error(n(162));o=t.stateNode,a=t.memoizedProps;try{o.nodeValue=a}catch(e){Lc(t,t.return,e)}}break;case 3:if(wl(e,t),_l(t),4&i&&null!==r&&r.memoizedState.isDehydrated)try{qe(e.containerInfo)}catch(e){Lc(t,t.return,e)}break;case 4:default:wl(e,t),_l(t);break;case 13:wl(e,t),_l(t),8192&(o=t.child).flags&&(o.stateNode.isHidden=a=null!==o.memoizedState,!a||null!==o.alternate&&null!==o.alternate.memoizedState||(Wl=ee())),4&i&&bl(t);break;case 22:if(d=null!==r&&null!==r.memoizedState,1&t.mode?(tl=(u=tl)||d,wl(e,t),tl=u):wl(e,t),_l(t),8192&i){if((t.stateNode.isHidden=u=null!==t.memoizedState)&&!d&&1&t.mode)for(nl=t,d=t.child;null!==d;){for(h=nl=d;null!==nl;){switch(p=(f=nl).child,f.tag){case 0:case 11:case 14:case 15:al(4,f,f.return);break;case 1:rl(f,f.return);var g=f.stateNode;if("function"==typeof g.componentWillUnmount){i=f,r=f.return;try{g.props=(e=i).memoizedProps,g.state=e.memoizedState,g.componentWillUnmount()}catch(t){Lc(i,r,t)}}break;case 5:rl(f,f.return);break;case 22:if(null!==f.memoizedState){El(h);continue}}null!==p?(p.return=f,nl=p):El(h)}d=d.sibling}t:for(d=null,h=t;;){if(5===h.tag){if(null===d){d=h;try{o=h.stateNode,u?"function"==typeof(a=o.style).setProperty?a.setProperty("display","none","important"):a.display="none":(l=h.stateNode,s=null!=(c=h.memoizedProps.style)&&c.hasOwnProperty("display")?c.display:null,l.style.display=wt("display",s))}catch(e){Lc(t,t.return,e)}}}else if(6===h.tag){if(null===d)try{h.stateNode.nodeValue=u?"":h.memoizedProps}catch(e){Lc(t,t.return,e)}}else if((22!==h.tag&&23!==h.tag||null===h.memoizedState||h===t)&&null!==h.child){h.child.return=h,h=h.child;continue}if(h===t)break t;for(;null===h.sibling;){if(null===h.return||h.return===t)break t;d===h&&(d=null),h=h.return}d===h&&(d=null),h.sibling.return=h.return,h=h.sibling}}break;case 19:wl(e,t),_l(t),4&i&&bl(t);case 21:}}function _l(t){var e=t.flags;if(2&e){try{t:{for(var r=t.return;null!==r;){if(ul(r)){var i=r;break t}r=r.return}throw Error(n(160))}switch(i.tag){case 5:var o=i.stateNode;32&i.flags&&(vt(o,""),i.flags&=-33),fl(t,dl(t),o);break;case 3:case 4:var a=i.stateNode.containerInfo;hl(t,dl(t),a);break;default:throw Error(n(161))}}catch(e){Lc(t,t.return,e)}t.flags&=-3}4096&e&&(t.flags&=-4097)}function kl(t){nl=t,xl(t)}function xl(t){for(var e=!!(1&t.mode);null!==nl;){var n=nl,r=n.child;if(22===n.tag&&e){var i=null!==n.memoizedState||Js;if(!i){var o=n.alternate,a=null!==o&&null!==o.memoizedState||tl;o=Js;var s=tl;if(Js=i,(tl=a)&&!s)for(nl=n;null!==nl;)a=(i=nl).child,22===i.tag&&null!==i.memoizedState?Cl(n):null!==a?(a.return=i,nl=a):Cl(n);for(;null!==r;)nl=r,xl(r),r=r.sibling;nl=n,Js=o,tl=s}Sl(t)}else 8772&n.subtreeFlags&&null!==r?(r.return=n,nl=r):Sl(t)}}function Sl(t){for(;null!==nl;){var e=nl;if(8772&e.flags){var r=e.alternate;try{if(8772&e.flags)switch(e.tag){case 0:case 11:case 15:tl||sl(5,e);break;case 1:var i=e.stateNode;if(4&e.flags&&!tl)if(null===r)i.componentDidMount();else{var o=e.elementType===e.type?r.memoizedProps:as(e.type,r.memoizedProps);i.componentDidUpdate(o,r.memoizedState,i.__reactInternalSnapshotBeforeUpdate)}var a=e.updateQueue;null!==a&&Zo(e,a,i);break;case 3:var s=e.updateQueue;if(null!==s){if(r=null,null!==e.child)switch(e.child.tag){case 5:case 1:r=e.child.stateNode}Zo(e,s,r)}break;case 5:if(null===r&&4&e.flags){r=e.stateNode;var l=e.memoizedProps;switch(e.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&r.focus();break;case"img":l.src&&(r.src=l.src)}}break;case 6:case 4:case 12:case 19:case 17:case 21:case 22:case 23:case 25:break;case 13:if(null===e.memoizedState){var c=e.alternate;if(null!==c){var u=c.memoizedState;if(null!==u){var d=u.dehydrated;null!==d&&qe(d)}}}break;default:throw Error(n(163))}tl||512&e.flags&&ll(e)}catch(t){Lc(e,e.return,t)}}if(e===t){nl=null;break}if(null!==(r=e.sibling)){r.return=e.return,nl=r;break}nl=e.return}}function El(t){for(;null!==nl;){var e=nl;if(e===t){nl=null;break}var n=e.sibling;if(null!==n){n.return=e.return,nl=n;break}nl=e.return}}function Cl(t){for(;null!==nl;){var e=nl;try{switch(e.tag){case 0:case 11:case 15:var n=e.return;try{sl(4,e)}catch(t){Lc(e,n,t)}break;case 1:var r=e.stateNode;if("function"==typeof r.componentDidMount){var i=e.return;try{r.componentDidMount()}catch(t){Lc(e,i,t)}}var o=e.return;try{ll(e)}catch(t){Lc(e,o,t)}break;case 5:var a=e.return;try{ll(e)}catch(t){Lc(e,a,t)}}}catch(t){Lc(e,e.return,t)}if(e===t){nl=null;break}var s=e.sibling;if(null!==s){s.return=e.return,nl=s;break}nl=e.return}}var Ml,Ll=Math.ceil,$l=_.ReactCurrentDispatcher,Nl=_.ReactCurrentOwner,Tl=_.ReactCurrentBatchConfig,Al=0,zl=null,Il=null,Rl=0,Ol=0,Pl=Li(0),Vl=0,jl=null,Dl=0,Hl=0,Bl=0,Fl=null,Ul=null,Wl=0,ql=1/0,Gl=null,Zl=!1,Kl=null,Ql=null,Xl=!1,Yl=null,Jl=0,tc=0,ec=null,nc=-1,rc=0;function ic(){return 6&Al?ee():-1!==nc?nc:nc=ee()}function oc(t){return 1&t.mode?2&Al&&0!==Rl?Rl&-Rl:null!==yo.transition?(0===rc&&(rc=we()),rc):0!==(t=xe)?t:t=void 0===(t=window.event)?16:tn(t.type):1}function ac(t,e,r,i){if(50<tc)throw tc=0,ec=null,Error(n(185));_e(t,r,i),2&Al&&t===zl||(t===zl&&(!(2&Al)&&(Hl|=r),4===Vl&&dc(t,Rl)),sc(t,i),1===r&&0===Al&&!(1&e.mode)&&(ql=ee()+500,Fi&&qi()))}function sc(t,e){var n=t.callbackNode;!function(t,e){for(var n=t.suspendedLanes,r=t.pingedLanes,i=t.expirationTimes,o=t.pendingLanes;0<o;){var a=31-ue(o),s=1<<a,l=i[a];-1===l?s&n&&!(s&r)||(i[a]=me(s,e)):l<=e&&(t.expiredLanes|=s),o&=~s}}(t,e);var r=ve(t,t===zl?Rl:0);if(0===r)null!==n&&Yt(n),t.callbackNode=null,t.callbackPriority=0;else if(t.callbackPriority!==(e=r&-r)){if(null!=n&&Yt(n),1===e)0===t.tag?function(t){Fi=!0,Wi(t)}(hc.bind(null,t)):Wi(hc.bind(null,t)),ui((function(){!(6&Al)&&qi()})),n=null;else{switch(Se(r)){case 1:n=re;break;case 4:n=ie;break;case 16:default:n=oe;break;case 536870912:n=se}n=zc(n,lc.bind(null,t))}t.callbackPriority=e,t.callbackNode=n}}function lc(t,e){if(nc=-1,rc=0,6&Al)throw Error(n(327));var r=t.callbackNode;if(Cc()&&t.callbackNode!==r)return null;var i=ve(t,t===zl?Rl:0);if(0===i)return null;if(30&i||i&t.expiredLanes||e)e=yc(t,i);else{e=i;var o=Al;Al|=2;var a=bc();for(zl===t&&Rl===e||(Gl=null,ql=ee()+500,vc(t,e));;)try{kc();break}catch(e){mc(t,e)}To(),$l.current=a,Al=o,null!==Il?e=0:(zl=null,Rl=0,e=Vl)}if(0!==e){if(2===e&&0!==(o=be(t))&&(i=o,e=cc(t,o)),1===e)throw r=jl,vc(t,0),dc(t,i),sc(t,ee()),r;if(6===e)dc(t,i);else{if(o=t.current.alternate,!(30&i||function(t){for(var e=t;;){if(16384&e.flags){var n=e.updateQueue;if(null!==n&&null!==(n=n.stores))for(var r=0;r<n.length;r++){var i=n[r],o=i.getSnapshot;i=i.value;try{if(!dr(o(),i))return!1}catch(t){return!1}}}if(n=e.child,16384&e.subtreeFlags&&null!==n)n.return=e,e=n;else{if(e===t)break;for(;null===e.sibling;){if(null===e.return||e.return===t)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}(o)||(e=yc(t,i),2===e&&(a=be(t),0!==a&&(i=a,e=cc(t,a))),1!==e)))throw r=jl,vc(t,0),dc(t,i),sc(t,ee()),r;switch(t.finishedWork=o,t.finishedLanes=i,e){case 0:case 1:throw Error(n(345));case 2:case 5:Ec(t,Ul,Gl);break;case 3:if(dc(t,i),(130023424&i)===i&&10<(e=Wl+500-ee())){if(0!==ve(t,0))break;if(((o=t.suspendedLanes)&i)!==i){ic(),t.pingedLanes|=t.suspendedLanes&o;break}t.timeoutHandle=si(Ec.bind(null,t,Ul,Gl),e);break}Ec(t,Ul,Gl);break;case 4:if(dc(t,i),(4194240&i)===i)break;for(e=t.eventTimes,o=-1;0<i;){var s=31-ue(i);a=1<<s,(s=e[s])>o&&(o=s),i&=~a}if(i=o,10<(i=(120>(i=ee()-i)?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*Ll(i/1960))-i)){t.timeoutHandle=si(Ec.bind(null,t,Ul,Gl),i);break}Ec(t,Ul,Gl);break;default:throw Error(n(329))}}}return sc(t,ee()),t.callbackNode===r?lc.bind(null,t):null}function cc(t,e){var n=Fl;return t.current.memoizedState.isDehydrated&&(vc(t,e).flags|=256),2!==(t=yc(t,e))&&(e=Ul,Ul=n,null!==e&&uc(e)),t}function uc(t){null===Ul?Ul=t:Ul.push.apply(Ul,t)}function dc(t,e){for(e&=~Bl,t.suspendedLanes|=e&=~Hl,t.pingedLanes&=~e,t=t.expirationTimes;0<e;){var n=31-ue(e),r=1<<n;t[n]=-1,e&=~r}}function hc(t){if(6&Al)throw Error(n(327));Cc();var e=ve(t,0);if(!(1&e))return sc(t,ee()),null;var r=yc(t,e);if(0!==t.tag&&2===r){var i=be(t);0!==i&&(e=i,r=cc(t,i))}if(1===r)throw r=jl,vc(t,0),dc(t,e),sc(t,ee()),r;if(6===r)throw Error(n(345));return t.finishedWork=t.current.alternate,t.finishedLanes=e,Ec(t,Ul,Gl),sc(t,ee()),null}function fc(t,e){var n=Al;Al|=1;try{return t(e)}finally{0===(Al=n)&&(ql=ee()+500,Fi&&qi())}}function pc(t){null!==Yl&&0===Yl.tag&&!(6&Al)&&Cc();var e=Al;Al|=1;var n=Tl.transition,r=xe;try{if(Tl.transition=null,xe=1,t)return t()}finally{xe=r,Tl.transition=n,!(6&(Al=e))&&qi()}}function gc(){Ol=Pl.current,$i(Pl)}function vc(t,e){t.finishedWork=null,t.finishedLanes=0;var n=t.timeoutHandle;if(-1!==n&&(t.timeoutHandle=-1,li(n)),null!==Il)for(n=Il.return;null!==n;){var r=n;switch(oo(r),r.tag){case 1:null!=(r=r.type.childContextTypes)&&Pi();break;case 3:ea(),$i(zi),$i(Ai),sa();break;case 5:ra(r);break;case 4:ea();break;case 13:case 19:$i(ia);break;case 10:Ao(r.type._context);break;case 22:case 23:gc()}n=n.return}if(zl=t,Il=t=Pc(t.current,null),Rl=Ol=e,Vl=0,jl=null,Bl=Hl=Dl=0,Ul=Fl=null,null!==Oo){for(e=0;e<Oo.length;e++)if(null!==(r=(n=Oo[e]).interleaved)){n.interleaved=null;var i=n.pending;if(null!==i){var o=i.next;i.next=r.next,r.next=o}n.pending=r}Oo=null}return t}function mc(t,e){for(;;){var r=Il;try{if(To(),la.current=ns,pa){for(var i=da.memoizedState;null!==i;){var o=i.queue;null!==o&&(o.pending=null),i=i.next}pa=!1}if(ua=0,fa=ha=da=null,ga=!1,va=0,Nl.current=null,null===r||null===r.return){Vl=1,jl=e,Il=null;break}t:{var a=t,s=r.return,l=r,c=e;if(e=Rl,l.flags|=32768,null!==c&&"object"==typeof c&&"function"==typeof c.then){var u=c,d=l,h=d.tag;if(!(1&d.mode||0!==h&&11!==h&&15!==h)){var f=d.alternate;f?(d.updateQueue=f.updateQueue,d.memoizedState=f.memoizedState,d.lanes=f.lanes):(d.updateQueue=null,d.memoizedState=null)}var p=ys(s);if(null!==p){p.flags&=-257,_s(p,s,l,0,e),1&p.mode&&ws(a,u,e),c=u;var g=(e=p).updateQueue;if(null===g){var v=new Set;v.add(c),e.updateQueue=v}else g.add(c);break t}if(!(1&e)){ws(a,u,e),wc();break t}c=Error(n(426))}else if(lo&&1&l.mode){var m=ys(s);if(null!==m){!(65536&m.flags)&&(m.flags|=256),_s(m,s,l,0,e),wo(fs(c,l));break t}}a=c=fs(c,l),4!==Vl&&(Vl=2),null===Fl?Fl=[a]:Fl.push(a),a=s;do{switch(a.tag){case 3:a.flags|=65536,a.lanes|=e&=-e,qo(a,ms(0,c,e));break t;case 1:l=c;var b=a.stateNode;if(!(128&a.flags||"function"!=typeof a.type.getDerivedStateFromError&&(null===b||"function"!=typeof b.componentDidCatch||null!==Ql&&Ql.has(b)))){a.flags|=65536,a.lanes|=e&=-e,qo(a,bs(a,l,e));break t}}a=a.return}while(null!==a)}Sc(r)}catch(t){e=t,Il===r&&null!==r&&(Il=r=r.return);continue}break}}function bc(){var t=$l.current;return $l.current=ns,null===t?ns:t}function wc(){0!==Vl&&3!==Vl&&2!==Vl||(Vl=4),null===zl||!(268435455&Dl)&&!(268435455&Hl)||dc(zl,Rl)}function yc(t,e){var r=Al;Al|=2;var i=bc();for(zl===t&&Rl===e||(Gl=null,vc(t,e));;)try{_c();break}catch(e){mc(t,e)}if(To(),Al=r,$l.current=i,null!==Il)throw Error(n(261));return zl=null,Rl=0,Vl}function _c(){for(;null!==Il;)xc(Il)}function kc(){for(;null!==Il&&!Jt();)xc(Il)}function xc(t){var e=Ml(t.alternate,t,Ol);t.memoizedProps=t.pendingProps,null===e?Sc(t):Il=e,Nl.current=null}function Sc(t){var e=t;do{var n=e.alternate;if(t=e.return,32768&e.flags){if(null!==(n=Ys(n,e)))return n.flags&=32767,void(Il=n);if(null===t)return Vl=6,void(Il=null);t.flags|=32768,t.subtreeFlags=0,t.deletions=null}else if(null!==(n=Xs(n,e,Ol)))return void(Il=n);if(null!==(e=e.sibling))return void(Il=e);Il=e=t}while(null!==e);0===Vl&&(Vl=5)}function Ec(t,e,r){var i=xe,o=Tl.transition;try{Tl.transition=null,xe=1,function(t,e,r,i){do{Cc()}while(null!==Yl);if(6&Al)throw Error(n(327));var o=t.finishedLanes;if(null===(r=t.finishedWork))return null;if(t.finishedWork=null,t.finishedLanes=0,r===t.current)throw Error(n(177));t.callbackNode=null,t.callbackPriority=0;var a=r.lanes|r.childLanes;if(function(t,e){var n=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var r=t.eventTimes;for(t=t.expirationTimes;0<n;){var i=31-ue(n),o=1<<i;e[i]=0,r[i]=-1,t[i]=-1,n&=~o}}(t,a),t===zl&&(Il=zl=null,Rl=0),!(2064&r.subtreeFlags)&&!(2064&r.flags)||Xl||(Xl=!0,zc(oe,(function(){return Cc(),null}))),a=!!(15990&r.flags),15990&r.subtreeFlags||a){a=Tl.transition,Tl.transition=null;var s=xe;xe=1;var l=Al;Al|=4,Nl.current=null,function(t,e){if(ii=Ze,mr(t=vr())){if("selectionStart"in t)var r={start:t.selectionStart,end:t.selectionEnd};else{var i=(r=(r=t.ownerDocument)&&r.defaultView||window).getSelection&&r.getSelection();if(i&&0!==i.rangeCount){r=i.anchorNode;var o=i.anchorOffset,a=i.focusNode;i=i.focusOffset;var s=0,l=-1,c=-1,u=0,d=0,h=t,f=null;t:for(;;){for(var p;h!==r||0!==o&&3!==h.nodeType||(l=s+o),h!==a||0!==i&&3!==h.nodeType||(c=s+i),3===h.nodeType&&(s+=h.nodeValue.length),null!==(p=h.firstChild);)f=h,h=p;for(;;){if(h===t)break t;if(f===r&&++u===o&&(l=s),f===a&&++d===i&&(c=s),null!==(p=h.nextSibling))break;f=(h=f).parentNode}h=p}r=-1===l||-1===c?null:{start:l,end:c}}else r=null}r=r||{start:0,end:0}}else r=null;for(oi={focusedElem:t,selectionRange:r},Ze=!1,nl=e;null!==nl;)if(t=(e=nl).child,1028&e.subtreeFlags&&null!==t)t.return=e,nl=t;else for(;null!==nl;){e=nl;try{var g=e.alternate;if(1024&e.flags)switch(e.tag){case 0:case 11:case 15:case 5:case 6:case 4:case 17:break;case 1:if(null!==g){var v=g.memoizedProps,m=g.memoizedState,b=e.stateNode,w=b.getSnapshotBeforeUpdate(e.elementType===e.type?v:as(e.type,v),m);b.__reactInternalSnapshotBeforeUpdate=w}break;case 3:var y=e.stateNode.containerInfo;1===y.nodeType?y.textContent="":9===y.nodeType&&y.documentElement&&y.removeChild(y.documentElement);break;default:throw Error(n(163))}}catch(t){Lc(e,e.return,t)}if(null!==(t=e.sibling)){t.return=e.return,nl=t;break}nl=e.return}g=ol,ol=!1}(t,r),yl(r,t),br(oi),Ze=!!ii,oi=ii=null,t.current=r,kl(r),te(),Al=l,xe=s,Tl.transition=a}else t.current=r;if(Xl&&(Xl=!1,Yl=t,Jl=o),0===(a=t.pendingLanes)&&(Ql=null),function(t){if(ce&&"function"==typeof ce.onCommitFiberRoot)try{ce.onCommitFiberRoot(le,t,void 0,!(128&~t.current.flags))}catch(t){}}(r.stateNode),sc(t,ee()),null!==e)for(i=t.onRecoverableError,r=0;r<e.length;r++)i((o=e[r]).value,{componentStack:o.stack,digest:o.digest});if(Zl)throw Zl=!1,t=Kl,Kl=null,t;!!(1&Jl)&&0!==t.tag&&Cc(),1&(a=t.pendingLanes)?t===ec?tc++:(tc=0,ec=t):tc=0,qi()}(t,e,r,i)}finally{Tl.transition=o,xe=i}return null}function Cc(){if(null!==Yl){var t=Se(Jl),e=Tl.transition,r=xe;try{if(Tl.transition=null,xe=16>t?16:t,null===Yl)var i=!1;else{if(t=Yl,Yl=null,Jl=0,6&Al)throw Error(n(331));var o=Al;for(Al|=4,nl=t.current;null!==nl;){var a=nl,s=a.child;if(16&nl.flags){var l=a.deletions;if(null!==l){for(var c=0;c<l.length;c++){var u=l[c];for(nl=u;null!==nl;){var d=nl;switch(d.tag){case 0:case 11:case 15:al(8,d,a)}var h=d.child;if(null!==h)h.return=d,nl=h;else for(;null!==nl;){var f=(d=nl).sibling,p=d.return;if(cl(d),d===u){nl=null;break}if(null!==f){f.return=p,nl=f;break}nl=p}}}var g=a.alternate;if(null!==g){var v=g.child;if(null!==v){g.child=null;do{var m=v.sibling;v.sibling=null,v=m}while(null!==v)}}nl=a}}if(2064&a.subtreeFlags&&null!==s)s.return=a,nl=s;else t:for(;null!==nl;){if(2048&(a=nl).flags)switch(a.tag){case 0:case 11:case 15:al(9,a,a.return)}var b=a.sibling;if(null!==b){b.return=a.return,nl=b;break t}nl=a.return}}var w=t.current;for(nl=w;null!==nl;){var y=(s=nl).child;if(2064&s.subtreeFlags&&null!==y)y.return=s,nl=y;else t:for(s=w;null!==nl;){if(2048&(l=nl).flags)try{switch(l.tag){case 0:case 11:case 15:sl(9,l)}}catch(t){Lc(l,l.return,t)}if(l===s){nl=null;break t}var _=l.sibling;if(null!==_){_.return=l.return,nl=_;break t}nl=l.return}}if(Al=o,qi(),ce&&"function"==typeof ce.onPostCommitFiberRoot)try{ce.onPostCommitFiberRoot(le,t)}catch(t){}i=!0}return i}finally{xe=r,Tl.transition=e}}return!1}function Mc(t,e,n){t=Uo(t,e=ms(0,e=fs(n,e),1),1),e=ic(),null!==t&&(_e(t,1,e),sc(t,e))}function Lc(t,e,n){if(3===t.tag)Mc(t,t,n);else for(;null!==e;){if(3===e.tag){Mc(e,t,n);break}if(1===e.tag){var r=e.stateNode;if("function"==typeof e.type.getDerivedStateFromError||"function"==typeof r.componentDidCatch&&(null===Ql||!Ql.has(r))){e=Uo(e,t=bs(e,t=fs(n,t),1),1),t=ic(),null!==e&&(_e(e,1,t),sc(e,t));break}}e=e.return}}function $c(t,e,n){var r=t.pingCache;null!==r&&r.delete(e),e=ic(),t.pingedLanes|=t.suspendedLanes&n,zl===t&&(Rl&n)===n&&(4===Vl||3===Vl&&(130023424&Rl)===Rl&&500>ee()-Wl?vc(t,0):Bl|=n),sc(t,e)}function Nc(t,e){0===e&&(1&t.mode?(e=pe,!(130023424&(pe<<=1))&&(pe=4194304)):e=1);var n=ic();null!==(t=jo(t,e))&&(_e(t,e,n),sc(t,n))}function Tc(t){var e=t.memoizedState,n=0;null!==e&&(n=e.retryLane),Nc(t,n)}function Ac(t,e){var r=0;switch(t.tag){case 13:var i=t.stateNode,o=t.memoizedState;null!==o&&(r=o.retryLane);break;case 19:i=t.stateNode;break;default:throw Error(n(314))}null!==i&&i.delete(e),Nc(t,r)}function zc(t,e){return Xt(t,e)}function Ic(t,e,n,r){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Rc(t,e,n,r){return new Ic(t,e,n,r)}function Oc(t){return!(!(t=t.prototype)||!t.isReactComponent)}function Pc(t,e){var n=t.alternate;return null===n?((n=Rc(t.tag,e,t.key,t.mode)).elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=14680064&t.flags,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,n.dependencies=null===(e=t.dependencies)?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n}function Vc(t,e,r,i,o,a){var s=2;if(i=t,"function"==typeof t)Oc(t)&&(s=1);else if("string"==typeof t)s=5;else t:switch(t){case S:return jc(r.children,o,a,e);case E:s=8,o|=8;break;case C:return(t=Rc(12,r,e,2|o)).elementType=C,t.lanes=a,t;case z:return(t=Rc(13,r,e,o)).elementType=z,t.lanes=a,t;case I:return(t=Rc(19,r,e,o)).elementType=I,t.lanes=a,t;case P:return Dc(r,o,a,e);default:if("object"==typeof t&&null!==t)switch(t.$$typeof){case N:s=10;break t;case T:s=9;break t;case A:s=11;break t;case R:s=14;break t;case O:s=16,i=null;break t}throw Error(n(130,null==t?t:typeof t,""))}return(e=Rc(s,r,e,o)).elementType=t,e.type=i,e.lanes=a,e}function jc(t,e,n,r){return(t=Rc(7,t,r,e)).lanes=n,t}function Dc(t,e,n,r){return(t=Rc(22,t,r,e)).elementType=P,t.lanes=n,t.stateNode={isHidden:!1},t}function Hc(t,e,n){return(t=Rc(6,t,null,e)).lanes=n,t}function Bc(t,e,n){return(e=Rc(4,null!==t.children?t.children:[],t.key,e)).lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function Fc(t,e,n,r,i){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ye(0),this.expirationTimes=ye(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ye(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Uc(t,e,n,r,i,o,a,s,l){return t=new Fc(t,e,n,s,l),1===e?(e=1,!0===o&&(e|=8)):e=0,o=Rc(3,null,null,e),t.current=o,o.stateNode=t,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ho(o),t}function Wc(t){if(!t)return Ti;t:{if(qt(t=t._reactInternals)!==t||1!==t.tag)throw Error(n(170));var e=t;do{switch(e.tag){case 3:e=e.stateNode.context;break t;case 1:if(Oi(e.type)){e=e.stateNode.__reactInternalMemoizedMergedChildContext;break t}}e=e.return}while(null!==e);throw Error(n(171))}if(1===t.tag){var r=t.type;if(Oi(r))return ji(t,r,e)}return e}function qc(t,e,n,r,i,o,a,s,l){return(t=Uc(n,r,!0,t,0,o,0,s,l)).context=Wc(null),n=t.current,(o=Fo(r=ic(),i=oc(n))).callback=null!=e?e:null,Uo(n,o,i),t.current.lanes=i,_e(t,i,r),sc(t,r),t}function Gc(t,e,n,r){var i=e.current,o=ic(),a=oc(i);return n=Wc(n),null===e.context?e.context=n:e.pendingContext=n,(e=Fo(o,a)).payload={element:t},null!==(r=void 0===r?null:r)&&(e.callback=r),null!==(t=Uo(i,e,a))&&(ac(t,i,a,o),Wo(t,i,a)),a}function Zc(t){return(t=t.current).child?t.child.stateNode:null}function Kc(t,e){if(null!==(t=t.memoizedState)&&null!==t.dehydrated){var n=t.retryLane;t.retryLane=0!==n&&n<e?n:e}}function Qc(t,e){Kc(t,e),(t=t.alternate)&&Kc(t,e)}Ml=function(t,e,r){if(null!==t)if(t.memoizedProps!==e.pendingProps||zi.current)xs=!0;else{if(!(t.lanes&r||128&e.flags))return xs=!1,function(t,e,n){switch(e.tag){case 3:zs(e),bo();break;case 5:na(e);break;case 1:Oi(e.type)&&Di(e);break;case 4:ta(e,e.stateNode.containerInfo);break;case 10:var r=e.type._context,i=e.memoizedProps.value;Ni(Mo,r._currentValue),r._currentValue=i;break;case 13:if(null!==(r=e.memoizedState))return null!==r.dehydrated?(Ni(ia,1&ia.current),e.flags|=128,null):n&e.child.childLanes?Hs(t,e,n):(Ni(ia,1&ia.current),null!==(t=Zs(t,e,n))?t.sibling:null);Ni(ia,1&ia.current);break;case 19:if(r=!!(n&e.childLanes),128&t.flags){if(r)return qs(t,e,n);e.flags|=128}if(null!==(i=e.memoizedState)&&(i.rendering=null,i.tail=null,i.lastEffect=null),Ni(ia,ia.current),r)break;return null;case 22:case 23:return e.lanes=0,Ls(t,e,n)}return Zs(t,e,n)}(t,e,r);xs=!!(131072&t.flags)}else xs=!1,lo&&1048576&e.flags&&ro(e,Qi,e.index);switch(e.lanes=0,e.tag){case 2:var i=e.type;Gs(t,e),t=e.pendingProps;var o=Ri(e,Ai.current);Io(e,r),o=ya(null,e,i,t,o,r);var a=_a();return e.flags|=1,"object"==typeof o&&null!==o&&"function"==typeof o.render&&void 0===o.$$typeof?(e.tag=1,e.memoizedState=null,e.updateQueue=null,Oi(i)?(a=!0,Di(e)):a=!1,e.memoizedState=null!=o.state?o.state:null,Ho(e),o.updater=ls,e.stateNode=o,o._reactInternals=e,hs(e,i,t,r),e=As(null,e,i,!0,a,r)):(e.tag=0,lo&&a&&io(e),Ss(null,e,o,r),e=e.child),e;case 16:i=e.elementType;t:{switch(Gs(t,e),t=e.pendingProps,i=(o=i._init)(i._payload),e.type=i,o=e.tag=function(t){if("function"==typeof t)return Oc(t)?1:0;if(null!=t){if((t=t.$$typeof)===A)return 11;if(t===R)return 14}return 2}(i),t=as(i,t),o){case 0:e=Ns(null,e,i,t,r);break t;case 1:e=Ts(null,e,i,t,r);break t;case 11:e=Es(null,e,i,t,r);break t;case 14:e=Cs(null,e,i,as(i.type,t),r);break t}throw Error(n(306,i,""))}return e;case 0:return o=e.pendingProps,Ns(t,e,i=e.type,o=e.elementType===i?o:as(i,o),r);case 1:return o=e.pendingProps,Ts(t,e,i=e.type,o=e.elementType===i?o:as(i,o),r);case 3:t:{if(zs(e),null===t)throw Error(n(387));i=e.pendingProps,o=(a=e.memoizedState).element,Bo(t,e),Go(e,i,null,r);var s=e.memoizedState;if(i=s.element,a.isDehydrated){if(e.updateQueue.baseState=a={element:i,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},e.memoizedState=a,256&e.flags){e=Is(t,e,i,r,o=fs(Error(n(423)),e));break t}if(i!==o){e=Is(t,e,i,r,o=fs(Error(n(424)),e));break t}for(so=fi(e.stateNode.containerInfo.firstChild),ao=e,lo=!0,co=null,r=Co(e,null,i,r),e.child=r;r;)r.flags=-3&r.flags|4096,r=r.sibling}else{if(bo(),i===o){e=Zs(t,e,r);break t}Ss(t,e,i,r)}e=e.child}return e;case 5:return na(e),null===t&&po(e),a=null!==t?t.memoizedProps:null,s=(o=e.pendingProps).children,ai(i=e.type,o)?s=null:null!==a&&ai(i,a)&&(e.flags|=32),$s(t,e),Ss(t,e,s,r),e.child;case 6:return null===t&&po(e),null;case 13:return Hs(t,e,r);case 4:return ta(e,e.stateNode.containerInfo),i=e.pendingProps,null===t?e.child=Eo(e,null,i,r):Ss(t,e,i,r),e.child;case 11:return o=e.pendingProps,Es(t,e,i=e.type,o=e.elementType===i?o:as(i,o),r);case 7:return Ss(t,e,e.pendingProps,r),e.child;case 8:case 12:return Ss(t,e,e.pendingProps.children,r),e.child;case 10:t:{if(a=e.memoizedProps,s=(o=e.pendingProps).value,Ni(Mo,(i=e.type._context)._currentValue),i._currentValue=s,null!==a)if(dr(a.value,s)){if(a.children===o.children&&!zi.current){e=Zs(t,e,r);break t}}else for(null!==(a=e.child)&&(a.return=e);null!==a;){var l=a.dependencies;if(null!==l){s=a.child;for(var c=l.firstContext;null!==c;){if(c.context===i){if(1===a.tag){(c=Fo(-1,r&-r)).tag=2;var u=a.updateQueue;if(null!==u){var d=(u=u.shared).pending;null===d?c.next=c:(c.next=d.next,d.next=c),u.pending=c}}a.lanes|=r,null!==(c=a.alternate)&&(c.lanes|=r),zo(a.return,r,e),l.lanes|=r;break}c=c.next}}else if(10===a.tag)s=a.type===e.type?null:a.child;else if(18===a.tag){if(null===(s=a.return))throw Error(n(341));s.lanes|=r,null!==(l=s.alternate)&&(l.lanes|=r),zo(s,r,e),s=a.sibling}else s=a.child;if(null!==s)s.return=a;else for(s=a;null!==s;){if(s===e){s=null;break}if(null!==(a=s.sibling)){a.return=s.return,s=a;break}s=s.return}a=s}Ss(t,e,o.children,r),e=e.child}return e;case 9:return o=e.type,i=e.pendingProps.children,Io(e,r),i=i(o=Ro(o)),e.flags|=1,Ss(t,e,i,r),e.child;case 14:return o=as(i=e.type,e.pendingProps),Cs(t,e,i,o=as(i.type,o),r);case 15:return Ms(t,e,e.type,e.pendingProps,r);case 17:return o=e.pendingProps,o=e.elementType===(i=e.type)?o:as(i,o),Gs(t,e),e.tag=1,Oi(i)?(t=!0,Di(e)):t=!1,Io(e,r),us(e,i,o),hs(e,i,o,r),As(null,e,i,!0,t,r);case 19:return qs(t,e,r);case 22:return Ls(t,e,r)}throw Error(n(156,e.tag))};var Xc="function"==typeof reportError?reportError:function(t){console.error(t)};function Yc(t){this._internalRoot=t}function Jc(t){this._internalRoot=t}function tu(t){return!(!t||1!==t.nodeType&&9!==t.nodeType&&11!==t.nodeType)}function eu(t){return!(!t||1!==t.nodeType&&9!==t.nodeType&&11!==t.nodeType&&(8!==t.nodeType||" react-mount-point-unstable "!==t.nodeValue))}function nu(){}function ru(t,e,n,r,i){var o=n._reactRootContainer;if(o){var a=o;if("function"==typeof i){var s=i;i=function(){var t=Zc(a);s.call(t)}}Gc(e,a,t,i)}else a=function(t,e,n,r,i){if(i){if("function"==typeof r){var o=r;r=function(){var t=Zc(a);o.call(t)}}var a=qc(e,r,t,0,null,!1,0,"",nu);return t._reactRootContainer=a,t[bi]=a.current,qr(8===t.nodeType?t.parentNode:t),pc(),a}for(;i=t.lastChild;)t.removeChild(i);if("function"==typeof r){var s=r;r=function(){var t=Zc(l);s.call(t)}}var l=Uc(t,0,!1,null,0,!1,0,"",nu);return t._reactRootContainer=l,t[bi]=l.current,qr(8===t.nodeType?t.parentNode:t),pc((function(){Gc(e,l,n,r)})),l}(n,e,t,i,r);return Zc(a)}Jc.prototype.render=Yc.prototype.render=function(t){var e=this._internalRoot;if(null===e)throw Error(n(409));Gc(t,e,null,null)},Jc.prototype.unmount=Yc.prototype.unmount=function(){var t=this._internalRoot;if(null!==t){this._internalRoot=null;var e=t.containerInfo;pc((function(){Gc(null,t,null,null)})),e[bi]=null}},Jc.prototype.unstable_scheduleHydration=function(t){if(t){var e=Le();t={blockedOn:null,target:t,priority:e};for(var n=0;n<Pe.length&&0!==e&&e<Pe[n].priority;n++);Pe.splice(n,0,t),0===n&&He(t)}},Ee=function(t){switch(t.tag){case 3:var e=t.stateNode;if(e.current.memoizedState.isDehydrated){var n=ge(e.pendingLanes);0!==n&&(ke(e,1|n),sc(e,ee()),!(6&Al)&&(ql=ee()+500,qi()))}break;case 13:pc((function(){var e=jo(t,1);if(null!==e){var n=ic();ac(e,t,1,n)}})),Qc(t,1)}},Ce=function(t){if(13===t.tag){var e=jo(t,134217728);null!==e&&ac(e,t,134217728,ic()),Qc(t,134217728)}},Me=function(t){if(13===t.tag){var e=oc(t),n=jo(t,e);null!==n&&ac(n,t,e,ic()),Qc(t,e)}},Le=function(){return xe},$e=function(t,e){var n=xe;try{return xe=t,e()}finally{xe=n}},Ct=function(t,e,r){switch(e){case"input":if(nt(t,r),e=r.name,"radio"===r.type&&null!=e){for(r=t;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+e)+'][type="radio"]'),e=0;e<r.length;e++){var i=r[e];if(i!==t&&i.form===t.form){var o=Ei(i);if(!o)throw Error(n(90));X(i),nt(i,o)}}}break;case"textarea":ct(t,r);break;case"select":null!=(e=r.value)&&at(t,!!r.multiple,e,!1)}},At=fc,zt=pc;var iu={usingClientEntryPoint:!1,Events:[xi,Si,Ei,Nt,Tt,fc]},ou={findFiberByHostInstance:ki,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},au={bundleType:ou.bundleType,version:ou.version,rendererPackageName:ou.rendererPackageName,rendererConfig:ou.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:_.ReactCurrentDispatcher,findHostInstanceByFiber:function(t){return null===(t=Kt(t))?null:t.stateNode},findFiberByHostInstance:ou.findFiberByHostInstance||function(){return null},findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__){var su=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!su.isDisabled&&su.supportsFiber)try{le=su.inject(au),ce=su}catch(pt){}}return M.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=iu,M.createPortal=function(t,e){var r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!tu(e))throw Error(n(200));return function(t,e,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:x,key:null==r?null:""+r,children:t,containerInfo:e,implementation:n}}(t,e,null,r)},M.createRoot=function(t,e){if(!tu(t))throw Error(n(299));var r=!1,i="",o=Xc;return null!=e&&(!0===e.unstable_strictMode&&(r=!0),void 0!==e.identifierPrefix&&(i=e.identifierPrefix),void 0!==e.onRecoverableError&&(o=e.onRecoverableError)),e=Uc(t,1,!1,null,0,r,0,i,o),t[bi]=e.current,qr(8===t.nodeType?t.parentNode:t),new Yc(e)},M.findDOMNode=function(t){if(null==t)return null;if(1===t.nodeType)return t;var e=t._reactInternals;if(void 0===e){if("function"==typeof t.render)throw Error(n(188));throw t=Object.keys(t).join(","),Error(n(268,t))}return null===(t=Kt(e))?null:t.stateNode},M.flushSync=function(t){return pc(t)},M.hydrate=function(t,e,r){if(!eu(e))throw Error(n(200));return ru(null,t,e,!0,r)},M.hydrateRoot=function(t,e,r){if(!tu(t))throw Error(n(405));var i=null!=r&&r.hydratedSources||null,o=!1,a="",s=Xc;if(null!=r&&(!0===r.unstable_strictMode&&(o=!0),void 0!==r.identifierPrefix&&(a=r.identifierPrefix),void 0!==r.onRecoverableError&&(s=r.onRecoverableError)),e=qc(e,null,t,1,null!=r?r:null,o,0,a,s),t[bi]=e.current,qr(t),i)for(t=0;t<i.length;t++)o=(o=(r=i[t])._getVersion)(r._source),null==e.mutableSourceEagerHydrationData?e.mutableSourceEagerHydrationData=[r,o]:e.mutableSourceEagerHydrationData.push(r,o);return new Jc(e)},M.render=function(t,e,r){if(!eu(e))throw Error(n(200));return ru(null,t,e,!1,r)},M.unmountComponentAtNode=function(t){if(!eu(t))throw Error(n(40));return!!t._reactRootContainer&&(pc((function(){ru(null,null,t,!1,(function(){t._reactRootContainer=null,t[bi]=null}))})),!0)},M.unstable_batchedUpdates=fc,M.unstable_renderSubtreeIntoContainer=function(t,e,r,i){if(!eu(r))throw Error(n(200));if(null==t||void 0===t._reactInternals)throw Error(n(38));return ru(t,e,r,!1,i)},M.version="18.3.1-next-f1338f8080-20240426",M}function T(){return _||(_=1,function t(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(t){console.error(t)}}(),C.exports=N()),C.exports}var A,z,I=function(){if(k)return E;k=1;var t=T();return E.createRoot=t.createRoot,E.hydrateRoot=t.hydrateRoot,E}(),R={exports:{}},O={},P=(z||(z=1,R.exports=function(){if(A)return O;A=1;var t=m(),e=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,i=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function a(t,n,a){var s,l={},c=null,u=null;for(s in void 0!==a&&(c=""+a),void 0!==n.key&&(c=""+n.key),void 0!==n.ref&&(u=n.ref),n)r.call(n,s)&&!o.hasOwnProperty(s)&&(l[s]=n[s]);if(t&&t.defaultProps)for(s in n=t.defaultProps)void 0===l[s]&&(l[s]=n[s]);return{$$typeof:e,type:t,key:c,ref:u,props:l,_owner:i.current}}return O.Fragment=n,O.jsx=a,O.jsxs=a,O}()),R.exports);function V(t,e){return Math.imul(t,31)+e|0}function j(t){return t>>>1&1073741824|3221225471&t}function D(t,e){return function(t,e=2166136261){let n,r,i=2147483647&e;for(n=0,r=t.length;n<r;n++)i^=t.charCodeAt(n),i+=(i<<1)+(i<<4)+(i<<7)+(i<<8)+(i<<24);return i>>>0}(t,e)}const H=new ArrayBuffer(8),B=new Uint32Array(H),F=new Float64Array(H);class U{constructor(t,e,n){if(this._hashKey=t,this._equalKeys=e,this._keys=new Map,this._map=new Map,n)for(const[t,e]of n)this.set(t,e)}get size(){return this._map.size}has(t){const{_hashKey:e,_equalKeys:n}=this,r=this._keys.get(e(t));if(r)for(const e of r)if(n(e,t))return!0;return!1}get(t){const{_hashKey:e,_equalKeys:n}=this,r=this._keys.get(e(t));if(r)for(const e of r)if(n(e,t))return this._map.get(e)}set(t,e){const{_hashKey:n,_equalKeys:r}=this,i=n(t);let o=this._keys.get(i);if(o){let n=-1;for(let e=0;e<o.length;e++)if(r(o[e],t)){n=e;break}n>=0?this._map.set(o[n],e):(o.push(t),this._map.set(t,e))}else o=[t],this._keys.set(i,o),this._map.set(t,e);return this}delete(t){const{_hashKey:e,_equalKeys:n}=this,r=e(t),i=this._keys.get(r);if(i)for(let e=0;e<i.length;e++)if(n(i[e],t)){const[t]=i.splice(e,1);return this._map.delete(t),0===i.length&&this._keys.delete(r),!0}return!1}clear(){this._keys.clear(),this._map.clear()}clone(){return new U(this._hashKey,this._equalKeys,this)}forEach(t){for(const[e,n]of this)t(n,e,this)}keys(){return this._map.keys()}values(){return this._map.values()}entries(){return this._map.entries()}[Symbol.iterator](){return this.entries()}}class W{constructor(t,e,n){if(this._hashCode=t,this._equals=e,this._map=new U(t,e),n)for(const t of n)this.add(t)}get size(){return this._map.size}has(t){return this._map.has(t)}add(t){return this._map.set(t,!0),this}delete(t){return this._map.delete(t)}clear(){this._map.clear()}clone(){const t=new W(this._hashCode,this._equals);return this.forEach((e=>t.add(e))),t}forEach(t){this._map.forEach(((e,n)=>t(n,n,this)))}keys(){return this._map.keys()}values(){return this._map.keys()}*entries(){for(const t of this.keys())yield[t,t]}[Symbol.iterator](){return this._map.keys()}}var q={},G={},Z="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},K=[],Q=[],X="undefined"!=typeof Uint8Array?Uint8Array:Array,Y=!1;function J(){Y=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=0;e<64;++e)K[e]=t[e],Q[t.charCodeAt(e)]=e;Q["-".charCodeAt(0)]=62,Q["_".charCodeAt(0)]=63}function tt(t,e,n){for(var r,i=[],o=e;o<n;o+=3)i.push(K[(r=(t[o]<<16)+(t[o+1]<<8)+t[o+2])>>18&63]+K[r>>12&63]+K[r>>6&63]+K[63&r]);return i.join("")}function et(t,e,n,r,i){var o,a,s=8*i-r-1,l=(1<<s)-1,c=l>>1,u=-7,d=n?i-1:0,h=n?-1:1,f=t[e+d];for(d+=h,o=f&(1<<-u)-1,f>>=-u,u+=s;u>0;o=256*o+t[e+d],d+=h,u-=8);for(a=o&(1<<-u)-1,o>>=-u,u+=r;u>0;a=256*a+t[e+d],d+=h,u-=8);if(0===o)o=1-c;else{if(o===l)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,r),o-=c}return(f?-1:1)*a*Math.pow(2,o-r)}function nt(t,e,n,r,i,o){var a,s,l,c=8*o-i-1,u=(1<<c)-1,d=u>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=r?0:o-1,p=r?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=u):(a=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-a))<1&&(a--,l*=2),(e+=a+d>=1?h/l:h*Math.pow(2,1-d))*l>=2&&(a++,l/=2),a+d>=u?(s=0,a=u):a+d>=1?(s=(e*l-1)*Math.pow(2,i),a+=d):(s=e*Math.pow(2,d-1)*Math.pow(2,i),a=0));i>=8;t[n+f]=255&s,f+=p,s/=256,i-=8);for(a=a<<i|s,c+=i;c>0;t[n+f]=255&a,f+=p,a/=256,c-=8);t[n+f-p]|=128*g}var rt={}.toString,it=Array.isArray||function(t){return"[object Array]"==rt.call(t)};lt.TYPED_ARRAY_SUPPORT=void 0===Z.TYPED_ARRAY_SUPPORT||Z.TYPED_ARRAY_SUPPORT;var ot=at();function at(){return lt.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function st(t,e){if(at()<e)throw new RangeError("Invalid typed array length");return lt.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=lt.prototype:(null===t&&(t=new lt(e)),t.length=e),t}function lt(t,e,n){if(!(lt.TYPED_ARRAY_SUPPORT||this instanceof lt))return new lt(t,e,n);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return dt(this,t)}return ct(this,t,e,n)}function ct(t,e,n,r){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,n,r){if(n<0||e.byteLength<n)throw new RangeError("'offset' is out of bounds");if(e.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");return e=void 0===n&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,n):new Uint8Array(e,n,r),lt.TYPED_ARRAY_SUPPORT?(t=e).__proto__=lt.prototype:t=ht(t,e),t}(t,e,n,r):"string"==typeof e?function(t,e,n){if("string"==typeof n&&""!==n||(n="utf8"),!lt.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|gt(e,n),i=(t=st(t,r)).write(e,n);return i!==r&&(t=t.slice(0,i)),t}(t,e,n):function(t,e){if(pt(e)){var n=0|ft(e.length);return 0===(t=st(t,n)).length||e.copy(t,0,0,n),t}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(r=e.length)!=r?st(t,0):ht(t,e);if("Buffer"===e.type&&it(e.data))return ht(t,e.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function ut(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function dt(t,e){if(ut(e),t=st(t,e<0?0:0|ft(e)),!lt.TYPED_ARRAY_SUPPORT)for(var n=0;n<e;++n)t[n]=0;return t}function ht(t,e){var n=e.length<0?0:0|ft(e.length);t=st(t,n);for(var r=0;r<n;r+=1)t[r]=255&e[r];return t}function ft(t){if(t>=at())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+at().toString(16)+" bytes");return 0|t}function pt(t){return!(null==t||!t._isBuffer)}function gt(t,e){if(pt(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var n=t.length;if(0===n)return 0;for(var r=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return Ht(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return Bt(t).length;default:if(r)return Ht(t).length;e=(""+e).toLowerCase(),r=!0}}function vt(t,e,n){var r=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return Tt(this,e,n);case"utf8":case"utf-8":return Mt(this,e,n);case"ascii":return $t(this,e,n);case"latin1":case"binary":return Nt(this,e,n);case"base64":return Ct(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return At(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}function mt(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function bt(t,e,n,r,i){if(0===t.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(i)return-1;n=t.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof e&&(e=lt.from(e,r)),pt(e))return 0===e.length?-1:wt(t,e,n,r,i);if("number"==typeof e)return e&=255,lt.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):wt(t,[e],n,r,i);throw new TypeError("val must be string, number or Buffer")}function wt(t,e,n,r,i){var o,a=1,s=t.length,l=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;a=2,s/=2,l/=2,n/=2}function c(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(i){var u=-1;for(o=n;o<s;o++)if(c(t,o)===c(e,-1===u?0:o-u)){if(-1===u&&(u=o),o-u+1===l)return u*a}else-1!==u&&(o-=o-u),u=-1}else for(n+l>s&&(n=s-l),o=n;o>=0;o--){for(var d=!0,h=0;h<l;h++)if(c(t,o+h)!==c(e,h)){d=!1;break}if(d)return o}return-1}function yt(t,e,n,r){n=Number(n)||0;var i=t.length-n;r?(r=Number(r))>i&&(r=i):r=i;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var a=0;a<r;++a){var s=parseInt(e.substr(2*a,2),16);if(isNaN(s))return a;t[n+a]=s}return a}function _t(t,e,n,r){return Ft(Ht(e,t.length-n),t,n,r)}function kt(t,e,n,r){return Ft(function(t){for(var e=[],n=0;n<t.length;++n)e.push(255&t.charCodeAt(n));return e}(e),t,n,r)}function xt(t,e,n,r){return kt(t,e,n,r)}function St(t,e,n,r){return Ft(Bt(e),t,n,r)}function Et(t,e,n,r){return Ft(function(t,e){for(var n,r,i=[],o=0;o<t.length&&!((e-=2)<0);++o)r=(n=t.charCodeAt(o))>>8,i.push(n%256),i.push(r);return i}(e,t.length-n),t,n,r)}function Ct(t,e,n){return function(t){var e;Y||J();for(var n=t.length,r=n%3,i="",o=[],a=16383,s=0,l=n-r;s<l;s+=a)o.push(tt(t,s,s+a>l?l:s+a));return 1===r?(i+=K[(e=t[n-1])>>2],i+=K[e<<4&63],i+="=="):2===r&&(i+=K[(e=(t[n-2]<<8)+t[n-1])>>10],i+=K[e>>4&63],i+=K[e<<2&63],i+="="),o.push(i),o.join("")}(0===e&&n===t.length?t:t.slice(e,n))}function Mt(t,e,n){n=Math.min(t.length,n);for(var r=[],i=e;i<n;){var o,a,s,l,c=t[i],u=null,d=c>239?4:c>223?3:c>191?2:1;if(i+d<=n)switch(d){case 1:c<128&&(u=c);break;case 2:128==(192&(o=t[i+1]))&&(l=(31&c)<<6|63&o)>127&&(u=l);break;case 3:a=t[i+2],128==(192&(o=t[i+1]))&&128==(192&a)&&(l=(15&c)<<12|(63&o)<<6|63&a)>2047&&(l<55296||l>57343)&&(u=l);break;case 4:a=t[i+2],s=t[i+3],128==(192&(o=t[i+1]))&&128==(192&a)&&128==(192&s)&&(l=(15&c)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&l<1114112&&(u=l)}null===u?(u=65533,d=1):u>65535&&(r.push((u-=65536)>>>10&1023|55296),u=56320|1023&u),r.push(u),i+=d}return function(t){var e=t.length;if(e<=Lt)return String.fromCharCode.apply(String,t);for(var n="",r=0;r<e;)n+=String.fromCharCode.apply(String,t.slice(r,r+=Lt));return n}(r)}lt.poolSize=8192,lt._augment=function(t){return t.__proto__=lt.prototype,t},lt.from=function(t,e,n){return ct(null,t,e,n)},lt.TYPED_ARRAY_SUPPORT&&(lt.prototype.__proto__=Uint8Array.prototype,lt.__proto__=Uint8Array),lt.alloc=function(t,e,n){return function(t,e,n,r){return ut(e),e<=0?st(t,e):void 0!==n?"string"==typeof r?st(t,e).fill(n,r):st(t,e).fill(n):st(t,e)}(null,t,e,n)},lt.allocUnsafe=function(t){return dt(null,t)},lt.allocUnsafeSlow=function(t){return dt(null,t)},lt.isBuffer=Ut,lt.compare=function(t,e){if(!pt(t)||!pt(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var n=t.length,r=e.length,i=0,o=Math.min(n,r);i<o;++i)if(t[i]!==e[i]){n=t[i],r=e[i];break}return n<r?-1:r<n?1:0},lt.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},lt.concat=function(t,e){if(!it(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return lt.alloc(0);var n;if(void 0===e)for(e=0,n=0;n<t.length;++n)e+=t[n].length;var r=lt.allocUnsafe(e),i=0;for(n=0;n<t.length;++n){var o=t[n];if(!pt(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(r,i),i+=o.length}return r},lt.byteLength=gt,lt.prototype._isBuffer=!0,lt.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)mt(this,e,e+1);return this},lt.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)mt(this,e,e+3),mt(this,e+1,e+2);return this},lt.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)mt(this,e,e+7),mt(this,e+1,e+6),mt(this,e+2,e+5),mt(this,e+3,e+4);return this},lt.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?Mt(this,0,t):vt.apply(this,arguments)},lt.prototype.equals=function(t){if(!pt(t))throw new TypeError("Argument must be a Buffer");return this===t||0===lt.compare(this,t)},lt.prototype.inspect=function(){var t="";return this.length>0&&(t=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(t+=" ... ")),"<Buffer "+t+">"},lt.prototype.compare=function(t,e,n,r,i){if(!pt(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),e<0||n>t.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&e>=n)return 0;if(r>=i)return-1;if(e>=n)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(r>>>=0),a=(n>>>=0)-(e>>>=0),s=Math.min(o,a),l=this.slice(r,i),c=t.slice(e,n),u=0;u<s;++u)if(l[u]!==c[u]){o=l[u],a=c[u];break}return o<a?-1:a<o?1:0},lt.prototype.includes=function(t,e,n){return-1!==this.indexOf(t,e,n)},lt.prototype.indexOf=function(t,e,n){return bt(this,t,e,n,!0)},lt.prototype.lastIndexOf=function(t,e,n){return bt(this,t,e,n,!1)},lt.prototype.write=function(t,e,n,r){if(void 0===e)r="utf8",n=this.length,e=0;else if(void 0===n&&"string"==typeof e)r=e,n=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-e;if((void 0===n||n>i)&&(n=i),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return yt(this,t,e,n);case"utf8":case"utf-8":return _t(this,t,e,n);case"ascii":return kt(this,t,e,n);case"latin1":case"binary":return xt(this,t,e,n);case"base64":return St(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Et(this,t,e,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},lt.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var Lt=4096;function $t(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;i<n;++i)r+=String.fromCharCode(127&t[i]);return r}function Nt(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;i<n;++i)r+=String.fromCharCode(t[i]);return r}function Tt(t,e,n){var r,i=t.length;(!e||e<0)&&(e=0),(!n||n<0||n>i)&&(n=i);for(var o="",a=e;a<n;++a)o+=(r=t[a])<16?"0"+r.toString(16):r.toString(16);return o}function At(t,e,n){for(var r=t.slice(e,n),i="",o=0;o<r.length;o+=2)i+=String.fromCharCode(r[o]+256*r[o+1]);return i}function zt(t,e,n){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>n)throw new RangeError("Trying to access beyond buffer length")}function It(t,e,n,r,i,o){if(!pt(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(n+r>t.length)throw new RangeError("Index out of range")}function Rt(t,e,n,r){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-n,2);i<o;++i)t[n+i]=(e&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function Ot(t,e,n,r){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-n,4);i<o;++i)t[n+i]=e>>>8*(r?i:3-i)&255}function Pt(t,e,n,r){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function Vt(t,e,n,r,i){return i||Pt(t,0,n,4),nt(t,e,n,r,23,4),n+4}function jt(t,e,n,r,i){return i||Pt(t,0,n,8),nt(t,e,n,r,52,8),n+8}lt.prototype.slice=function(t,e){var n,r=this.length;if((t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t),lt.TYPED_ARRAY_SUPPORT)(n=this.subarray(t,e)).__proto__=lt.prototype;else{var i=e-t;n=new lt(i,void 0);for(var o=0;o<i;++o)n[o]=this[o+t]}return n},lt.prototype.readUIntLE=function(t,e,n){t|=0,e|=0,n||zt(t,e,this.length);for(var r=this[t],i=1,o=0;++o<e&&(i*=256);)r+=this[t+o]*i;return r},lt.prototype.readUIntBE=function(t,e,n){t|=0,e|=0,n||zt(t,e,this.length);for(var r=this[t+--e],i=1;e>0&&(i*=256);)r+=this[t+--e]*i;return r},lt.prototype.readUInt8=function(t,e){return e||zt(t,1,this.length),this[t]},lt.prototype.readUInt16LE=function(t,e){return e||zt(t,2,this.length),this[t]|this[t+1]<<8},lt.prototype.readUInt16BE=function(t,e){return e||zt(t,2,this.length),this[t]<<8|this[t+1]},lt.prototype.readUInt32LE=function(t,e){return e||zt(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},lt.prototype.readUInt32BE=function(t,e){return e||zt(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},lt.prototype.readIntLE=function(t,e,n){t|=0,e|=0,n||zt(t,e,this.length);for(var r=this[t],i=1,o=0;++o<e&&(i*=256);)r+=this[t+o]*i;return r>=(i*=128)&&(r-=Math.pow(2,8*e)),r},lt.prototype.readIntBE=function(t,e,n){t|=0,e|=0,n||zt(t,e,this.length);for(var r=e,i=1,o=this[t+--r];r>0&&(i*=256);)o+=this[t+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},lt.prototype.readInt8=function(t,e){return e||zt(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},lt.prototype.readInt16LE=function(t,e){e||zt(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},lt.prototype.readInt16BE=function(t,e){e||zt(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},lt.prototype.readInt32LE=function(t,e){return e||zt(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},lt.prototype.readInt32BE=function(t,e){return e||zt(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},lt.prototype.readFloatLE=function(t,e){return e||zt(t,4,this.length),et(this,t,!0,23,4)},lt.prototype.readFloatBE=function(t,e){return e||zt(t,4,this.length),et(this,t,!1,23,4)},lt.prototype.readDoubleLE=function(t,e){return e||zt(t,8,this.length),et(this,t,!0,52,8)},lt.prototype.readDoubleBE=function(t,e){return e||zt(t,8,this.length),et(this,t,!1,52,8)},lt.prototype.writeUIntLE=function(t,e,n,r){t=+t,e|=0,n|=0,r||It(this,t,e,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[e]=255&t;++o<n&&(i*=256);)this[e+o]=t/i&255;return e+n},lt.prototype.writeUIntBE=function(t,e,n,r){t=+t,e|=0,n|=0,r||It(this,t,e,n,Math.pow(2,8*n)-1,0);var i=n-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+n},lt.prototype.writeUInt8=function(t,e,n){return t=+t,e|=0,n||It(this,t,e,1,255,0),lt.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},lt.prototype.writeUInt16LE=function(t,e,n){return t=+t,e|=0,n||It(this,t,e,2,65535,0),lt.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):Rt(this,t,e,!0),e+2},lt.prototype.writeUInt16BE=function(t,e,n){return t=+t,e|=0,n||It(this,t,e,2,65535,0),lt.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):Rt(this,t,e,!1),e+2},lt.prototype.writeUInt32LE=function(t,e,n){return t=+t,e|=0,n||It(this,t,e,4,4294967295,0),lt.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):Ot(this,t,e,!0),e+4},lt.prototype.writeUInt32BE=function(t,e,n){return t=+t,e|=0,n||It(this,t,e,4,4294967295,0),lt.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):Ot(this,t,e,!1),e+4},lt.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);It(this,t,e,n,i-1,-i)}var o=0,a=1,s=0;for(this[e]=255&t;++o<n&&(a*=256);)t<0&&0===s&&0!==this[e+o-1]&&(s=1),this[e+o]=(t/a|0)-s&255;return e+n},lt.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);It(this,t,e,n,i-1,-i)}var o=n-1,a=1,s=0;for(this[e+o]=255&t;--o>=0&&(a*=256);)t<0&&0===s&&0!==this[e+o+1]&&(s=1),this[e+o]=(t/a|0)-s&255;return e+n},lt.prototype.writeInt8=function(t,e,n){return t=+t,e|=0,n||It(this,t,e,1,127,-128),lt.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},lt.prototype.writeInt16LE=function(t,e,n){return t=+t,e|=0,n||It(this,t,e,2,32767,-32768),lt.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):Rt(this,t,e,!0),e+2},lt.prototype.writeInt16BE=function(t,e,n){return t=+t,e|=0,n||It(this,t,e,2,32767,-32768),lt.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):Rt(this,t,e,!1),e+2},lt.prototype.writeInt32LE=function(t,e,n){return t=+t,e|=0,n||It(this,t,e,4,2147483647,-2147483648),lt.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):Ot(this,t,e,!0),e+4},lt.prototype.writeInt32BE=function(t,e,n){return t=+t,e|=0,n||It(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),lt.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):Ot(this,t,e,!1),e+4},lt.prototype.writeFloatLE=function(t,e,n){return Vt(this,t,e,!0,n)},lt.prototype.writeFloatBE=function(t,e,n){return Vt(this,t,e,!1,n)},lt.prototype.writeDoubleLE=function(t,e,n){return jt(this,t,e,!0,n)},lt.prototype.writeDoubleBE=function(t,e,n){return jt(this,t,e,!1,n)},lt.prototype.copy=function(t,e,n,r){if(n||(n=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e<r-n&&(r=t.length-e+n);var i,o=r-n;if(this===t&&n<e&&e<r)for(i=o-1;i>=0;--i)t[i+e]=this[i+n];else if(o<1e3||!lt.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)t[i+e]=this[i+n];else Uint8Array.prototype.set.call(t,this.subarray(n,n+o),e);return o},lt.prototype.fill=function(t,e,n,r){if("string"==typeof t){if("string"==typeof e?(r=e,e=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===t.length){var i=t.charCodeAt(0);i<256&&(t=i)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!lt.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;var o;if(e>>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(o=e;o<n;++o)this[o]=t;else{var a=pt(t)?t:Ht(new lt(t,r).toString()),s=a.length;for(o=0;o<n-e;++o)this[o+e]=a[o%s]}return this};var Dt=/[^+\/0-9A-Za-z-_]/g;function Ht(t,e){var n;e=e||1/0;for(var r=t.length,i=null,o=[],a=0;a<r;++a){if((n=t.charCodeAt(a))>55295&&n<57344){if(!i){if(n>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(e-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(e-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((e-=1)<0)break;o.push(n)}else if(n<2048){if((e-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function Bt(t){return function(t){var e,n,r,i,o,a;Y||J();var s=t.length;if(s%4>0)throw new Error("Invalid string. Length must be a multiple of 4");a=new X(3*s/4-(o="="===t[s-2]?2:"="===t[s-1]?1:0)),r=o>0?s-4:s;var l=0;for(e=0,n=0;e<r;e+=4,n+=3)i=Q[t.charCodeAt(e)]<<18|Q[t.charCodeAt(e+1)]<<12|Q[t.charCodeAt(e+2)]<<6|Q[t.charCodeAt(e+3)],a[l++]=i>>16&255,a[l++]=i>>8&255,a[l++]=255&i;return 2===o?(i=Q[t.charCodeAt(e)]<<2|Q[t.charCodeAt(e+1)]>>4,a[l++]=255&i):1===o&&(i=Q[t.charCodeAt(e)]<<10|Q[t.charCodeAt(e+1)]<<4|Q[t.charCodeAt(e+2)]>>2,a[l++]=i>>8&255,a[l++]=255&i),a}(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(Dt,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function Ft(t,e,n,r){for(var i=0;i<r&&!(i+n>=e.length||i>=t.length);++i)e[i+n]=t[i];return i}function Ut(t){return null!=t&&(!!t._isBuffer||Wt(t)||function(t){return"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&Wt(t.slice(0,0))}(t))}function Wt(t){return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}var qt,Gt,Zt=l(Object.freeze({__proto__:null,Buffer:lt,INSPECT_MAX_BYTES:50,SlowBuffer:function(t){return+t!=t&&(t=0),lt.alloc(+t)},isBuffer:Ut,kMaxLength:ot})),Kt={};function Qt(){if(qt)return Kt;qt=1,Object.defineProperty(Kt,"__esModule",{value:!0}),Kt.default=void 0;const t="http://www.w3.org/1999/02/22-rdf-syntax-ns#",e="http://www.w3.org/2001/XMLSchema#",n="http://www.w3.org/2000/10/swap/";return Kt.default={xsd:{decimal:`${e}decimal`,boolean:`${e}boolean`,double:`${e}double`,integer:`${e}integer`,string:`${e}string`},rdf:{type:`${t}type`,nil:`${t}nil`,first:`${t}first`,rest:`${t}rest`,langString:`${t}langString`},owl:{sameAs:"http://www.w3.org/2002/07/owl#sameAs"},r:{forSome:`${n}reify#forSome`,forAll:`${n}reify#forAll`},log:{implies:`${n}log#implies`,isImpliedBy:`${n}log#isImpliedBy`}},Kt}function Xt(){if(Gt)return G;Gt=1,Object.defineProperty(G,"__esModule",{value:!0}),G.default=void 0;var t,e=Zt,n=(t=Qt())&&t.__esModule?t:{default:t};const{xsd:r}=n.default,i=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{8})|\\([^])/g,o={"\\":"\\","'":"'",'"':'"',n:"\n",r:"\r",t:"\t",f:"\f",b:"\b",_:"_","~":"~",".":".","-":"-","!":"!",$:"$","&":"&","(":"(",")":")","*":"*","+":"+",",":",",";":";","=":"=","/":"/","?":"?","#":"#","@":"@","%":"%"},a=/[\x00-\x20<>\\"\{\}\|\^\`]/,s={_iri:!0,_unescapedIri:!0,_simpleQuotedString:!0,_langcode:!0,_blank:!0,_newline:!0,_comment:!0,_whitespace:!0,_endOfFile:!0},l=/$0^/;return G.default=class{constructor(t){if(this._iri=/^<((?:[^ <>{}\\]|\\[uU])+)>[ \t]*/,this._unescapedIri=/^<([^\x00-\x20<>\\"\{\}\|\^\`]*)>[ \t]*/,this._simpleQuotedString=/^"([^"\\\r\n]*)"(?=[^"])/,this._simpleApostropheString=/^'([^'\\\r\n]*)'(?=[^'])/,this._langcode=/^@([a-z]+(?:-[a-z0-9]+)*)(?=[^a-z0-9\-])/i,this._prefix=/^((?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)?:(?=[#\s<])/,this._prefixed=/^((?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)?:((?:(?:[0-:A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~])(?:(?:[\.\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~])*(?:[\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~]))?)?)(?:[ \t]+|(?=\.?[,;!\^\s#()\[\]\{\}"'<>]))/,this._variable=/^\?(?:(?:[A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:[\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)(?=[.,;!\^\s#()\[\]\{\}"'<>])/,this._blank=/^_:((?:[0-9A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)(?:[ \t]+|(?=\.?[,;:\s#()\[\]\{\}"'<>]))/,this._number=/^[\-+]?(?:(\d+\.\d*|\.?\d+)[eE][\-+]?|\d*(\.)?)\d+(?=\.?[,;:\s#()\[\]\{\}"'<>])/,this._boolean=/^(?:true|false)(?=[.,;\s#()\[\]\{\}"'<>])/,this._keyword=/^@[a-z]+(?=[\s#<:])/i,this._sparqlKeyword=/^(?:PREFIX|BASE|GRAPH)(?=[\s#<])/i,this._shortPredicates=/^a(?=[\s#()\[\]\{\}"'<>])/,this._newline=/^[ \t]*(?:#[^\n\r]*)?(?:\r\n|\n|\r)[ \t]*/,this._comment=/#([^\n\r]*)/,this._whitespace=/^[ \t]+/,this._endOfFile=/^(?:#[^\n\r]*)?$/,this._isImpliedBy=(t=t||{}).isImpliedBy,this._lineMode=!!t.lineMode){this._n3Mode=!1;for(const t in this)!(t in s)&&this[t]instanceof RegExp&&(this[t]=l)}else this._n3Mode=!1!==t.n3;this.comments=!!t.comments,this._literalClosingPos=0}_tokenizeToEnd(t,e){let n=this._input,i=n.length;for(;;){let t,l;for(;t=this._newline.exec(n);)this.comments&&(l=this._comment.exec(t[0]))&&o("comment",l[1],"",this._line,t[0].length),n=n.substr(t[0].length,n.length),i=n.length,this._line++;if(!t&&(t=this._whitespace.exec(n))&&(n=n.substr(t[0].length,n.length)),this._endOfFile.test(n))return e&&(this.comments&&(l=this._comment.exec(n))&&o("comment",l[1],"",this._line,n.length),n=null,o("eof","","",this._line,0)),this._input=n;const c=this._line,u=n[0];let d="",h="",f="",p=null,g=0,v=!1;switch(u){case"^":if(n.length<3)break;if("^"!==n[1]){this._n3Mode&&(g=1,d="^");break}if(this._previousMarker="^^",n=n.substr(2),"<"!==n[0]){v=!0;break}case"<":if(p=this._unescapedIri.exec(n))d="IRI",h=p[1];else if(p=this._iri.exec(n)){if(h=this._unescape(p[1]),null===h||a.test(h))return s(this);d="IRI"}else n.length>1&&"<"===n[1]?(d="<<",g=2):this._n3Mode&&n.length>1&&"="===n[1]&&(g=2,this._isImpliedBy?(d="abbreviation",h="<"):(d="inverse",h=">"));break;case">":n.length>1&&">"===n[1]&&(d=">>",g=2);break;case"_":((p=this._blank.exec(n))||e&&(p=this._blank.exec(`${n} `)))&&(d="blank",f="_",h=p[1]);break;case'"':if(p=this._simpleQuotedString.exec(n))h=p[1];else if(({value:h,matchLength:g}=this._parseLiteral(n)),null===h)return s(this);null===p&&0===g||(d="literal",this._literalClosingPos=0);break;case"'":if(!this._lineMode){if(p=this._simpleApostropheString.exec(n))h=p[1];else if(({value:h,matchLength:g}=this._parseLiteral(n)),null===h)return s(this);null===p&&0===g||(d="literal",this._literalClosingPos=0)}break;case"?":this._n3Mode&&(p=this._variable.exec(n))&&(d="var",h=p[0]);break;case"@":"literal"===this._previousMarker&&(p=this._langcode.exec(n))?(d="langcode",h=p[1]):(p=this._keyword.exec(n))&&(d=p[0]);break;case".":if(1===n.length?e:n[1]<"0"||n[1]>"9"){d=".",g=1;break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"+":case"-":(p=this._number.exec(n)||e&&(p=this._number.exec(`${n} `)))&&(d="literal",h=p[0],f="string"==typeof p[1]?r.double:"string"==typeof p[2]?r.decimal:r.integer);break;case"B":case"b":case"p":case"P":case"G":case"g":(p=this._sparqlKeyword.exec(n))?d=p[0].toUpperCase():v=!0;break;case"f":case"t":(p=this._boolean.exec(n))?(d="literal",h=p[0],f=r.boolean):v=!0;break;case"a":(p=this._shortPredicates.exec(n))?(d="abbreviation",h="a"):v=!0;break;case"=":this._n3Mode&&n.length>1&&(d="abbreviation",">"!==n[1]?(g=1,h="="):(g=2,h=">"));break;case"!":if(!this._n3Mode)break;case",":case";":case"[":case"]":case"(":case")":case"}":this._lineMode||(g=1,d=u);break;case"{":!this._lineMode&&n.length>=2&&("|"===n[1]?(d="{|",g=2):(d=u,g=1));break;case"|":n.length>=2&&"}"===n[1]&&(d="|}",g=2);break;default:v=!0}if(v&&("@prefix"!==this._previousMarker&&"PREFIX"!==this._previousMarker||!(p=this._prefix.exec(n))?((p=this._prefixed.exec(n))||e&&(p=this._prefixed.exec(`${n} `)))&&(d="prefixed",f=p[1]||"",h=this._unescape(p[2])):(d="prefix",h=p[1]||"")),"^^"===this._previousMarker)switch(d){case"prefixed":d="type";break;case"IRI":d="typeIRI";break;default:d=""}if(!d)return e||!/^'''|^"""/.test(n)&&/\n|\r/.test(n)?s(this):this._input=n;const m=g||p[0].length,b=o(d,h,f,c,m);this.previousToken=b,this._previousMarker=d,n=n.substr(m,n.length)}function o(e,r,o,a,s){const l=n?i-n.length:i,c={type:e,value:r,prefix:o,line:a,start:l,end:l+s};return t(null,c),c}function s(e){t(e._syntaxError(/^\S*/.exec(n)[0]))}}_unescape(t){let e=!1;const n=t.replace(i,((t,n,r,i)=>{if("string"==typeof n)return String.fromCharCode(Number.parseInt(n,16));if("string"==typeof r){let t=Number.parseInt(r,16);return t<=65535?String.fromCharCode(Number.parseInt(r,16)):String.fromCharCode(55296+((t-=65536)>>10),56320+(1023&t))}return i in o?o[i]:(e=!0,"")}));return e?null:n}_parseLiteral(t){if(t.length>=3){const e=t.match(/^(?:"""|"|'''|'|)/)[0],n=e.length;let r=Math.max(this._literalClosingPos,n);for(;(r=t.indexOf(e,r))>0;){let e=0;for(;"\\"===t[r-e-1];)e++;if(e%2==0){const e=t.substring(n,r),i=e.split(/\r\n|\r|\n/).length-1,o=r+n;if(1===n&&0!==i||3===n&&this._lineMode)break;return this._line+=i,{value:this._unescape(e),matchLength:o}}r++}this._literalClosingPos=t.length-n+1}return{value:"",matchLength:0}}_syntaxError(t){this._input=null;const e=new Error(`Unexpected "${t}" on line ${this._line}.`);return e.context={token:void 0,line:this._line,previousToken:this.previousToken},e}_readStartingBom(t){return t.startsWith("\ufeff")?t.substr(1):t}tokenize(t,n){if(this._line=1,"string"==typeof t){if(this._input=this._readStartingBom(t),"function"!=typeof n){const t=[];let e;if(this._tokenizeToEnd(((n,r)=>n?e=n:t.push(r)),!0),e)throw e;return t}queueMicrotask((()=>this._tokenizeToEnd(n,!0)))}else this._pendingBuffer=null,"function"==typeof t.setEncoding&&t.setEncoding("utf8"),t.on("data",(t=>{null!==this._input&&0!==t.length&&(this._pendingBuffer&&(t=e.Buffer.concat([this._pendingBuffer,t]),this._pendingBuffer=null),128&t[t.length-1]?this._pendingBuffer=t:(void 0===this._input?this._input=this._readStartingBom("string"==typeof t?t:t.toString()):this._input+=t,this._tokenizeToEnd(n,!1)))})),t.on("end",(()=>{"string"==typeof this._input&&this._tokenizeToEnd(n,!0)})),t.on("error",n)}},G}var Yt,Jt,te={},ee={};function ne(){if(Yt)return ee;Yt=1,Object.defineProperty(ee,"__esModule",{value:!0}),ee.default=ee.Variable=ee.Triple=ee.Term=ee.Quad=ee.NamedNode=ee.Literal=ee.DefaultGraph=ee.BlankNode=void 0,ee.escapeQuotes=function(t){return t.replace(a,((t,e)=>`"${e.replace(/"/g,'""')}`))},ee.fromQuad=_,ee.fromTerm=y,ee.termFromId=function t(e,n,r){if(n=n||s,!e)return n.defaultGraph();switch(e[0]){case"?":return n.variable(e.substr(1));case"_":return n.blankNode(e.substr(2));case'"':if(n===s)return new u(e);if('"'===e[e.length-1])return n.literal(e.substr(1,e.length-2));const t=e.lastIndexOf('"',e.length-1);return n.literal(e.substr(1,t-1),"@"===e[t+1]?e.substr(t+2):n.namedNode(e.substr(t+3)));case"[":e=JSON.parse(e);break;default:if(!r||!Array.isArray(e))return n.namedNode(e)}return n.quad(t(e[0],n,!0),t(e[1],n,!0),t(e[2],n,!0),e[3]&&t(e[3],n,!0))},ee.termToId=function t(e,n){if("string"==typeof e)return e;if(e instanceof l&&"Quad"!==e.termType)return e.id;if(!e)return i.id;switch(e.termType){case"NamedNode":return e.value;case"BlankNode":return`_:${e.value}`;case"Variable":return`?${e.value}`;case"DefaultGraph":return"";case"Literal":return`"${e.value}"${e.language?`@${e.language}`:e.datatype&&e.datatype.value!==r.string?`^^${e.datatype.value}`:""}`;case"Quad":const i=[t(e.subject,!0),t(e.predicate,!0),t(e.object,!0)];return e.graph&&"DefaultGraph"!==e.graph.termType&&i.push(t(e.graph,!0)),n?i:JSON.stringify(i);default:throw new Error(`Unexpected termType: ${e.termType}`)}},ee.unescapeQuotes=function(t){return t.replace(a,((t,e)=>`"${e.replace(/""/g,'"')}`))};var t,e=(t=Qt())&&t.__esModule?t:{default:t};const{rdf:n,xsd:r}=e.default;let i,o=0;const a=/^"(.*".*)(?="[^"]*$)/,s={namedNode:g,blankNode:v,variable:b,literal:m,defaultGraph:function(){return i},quad:w,triple:w,fromTerm:y,fromQuad:_};ee.default=s;class l{constructor(t){this.id=t}get value(){return this.id}equals(t){return t instanceof l?this.id===t.id:!!t&&this.termType===t.termType&&this.value===t.value}hashCode(){return 0}toJSON(){return{termType:this.termType,value:this.value}}}ee.Term=l;class c extends l{get termType(){return"NamedNode"}}ee.NamedNode=c;class u extends l{get termType(){return"Literal"}get value(){return this.id.substring(1,this.id.lastIndexOf('"'))}get language(){const t=this.id;let e=t.lastIndexOf('"')+1;return e<t.length&&"@"===t[e++]?t.substr(e).toLowerCase():""}get datatype(){return new c(this.datatypeString)}get datatypeString(){const t=this.id,e=t.lastIndexOf('"')+1,i=e<t.length?t[e]:"";return"^"===i?t.substr(e+2):"@"!==i?r.string:n.langString}equals(t){return t instanceof u?this.id===t.id:!!t&&!!t.datatype&&this.termType===t.termType&&this.value===t.value&&this.language===t.language&&this.datatype.value===t.datatype.value}toJSON(){return{termType:this.termType,value:this.value,language:this.language,datatype:{termType:"NamedNode",value:this.datatypeString}}}}ee.Literal=u;class d extends l{constructor(t){super(`_:${t}`)}get termType(){return"BlankNode"}get value(){return this.id.substr(2)}}ee.BlankNode=d;class h extends l{constructor(t){super(`?${t}`)}get termType(){return"Variable"}get value(){return this.id.substr(1)}}ee.Variable=h;class f extends l{constructor(){return super(""),i||this}get termType(){return"DefaultGraph"}equals(t){return this===t||!!t&&this.termType===t.termType}}ee.DefaultGraph=f,i=new f;class p extends l{constructor(t,e,n,r){super(""),this._subject=t,this._predicate=e,this._object=n,this._graph=r||i}get termType(){return"Quad"}get subject(){return this._subject}get predicate(){return this._predicate}get object(){return this._object}get graph(){return this._graph}toJSON(){return{termType:this.termType,subject:this._subject.toJSON(),predicate:this._predicate.toJSON(),object:this._object.toJSON(),graph:this._graph.toJSON()}}equals(t){return!!t&&this._subject.equals(t.subject)&&this._predicate.equals(t.predicate)&&this._object.equals(t.object)&&this._graph.equals(t.graph)}}function g(t){return new c(t)}function v(t){return new d(t||"n3-"+o++)}function m(t,e){if("string"==typeof e)return new u(`"${t}"@${e.toLowerCase()}`);let n=e?e.value:"";return""===n&&("boolean"==typeof t?n=r.boolean:"number"==typeof t&&(Number.isFinite(t)?n=Number.isInteger(t)?r.integer:r.double:(n=r.double,Number.isNaN(t)||(t=t>0?"INF":"-INF")))),new u(""===n||n===r.string?`"${t}"`:`"${t}"^^${n}`)}function b(t){return new h(t)}function w(t,e,n,r){return new p(t,e,n,r)}function y(t){if(t instanceof l)return t;switch(t.termType){case"NamedNode":return g(t.value);case"BlankNode":return v(t.value);case"Variable":return b(t.value);case"DefaultGraph":return i;case"Literal":return m(t.value,t.language||t.datatype);case"Quad":return _(t);default:throw new Error(`Unexpected termType: ${t.termType}`)}}function _(t){if(t instanceof p)return t;if("Quad"!==t.termType)throw new Error(`Unexpected termType: ${t.termType}`);return w(y(t.subject),y(t.predicate),y(t.object),y(t.graph))}return ee.Triple=ee.Quad=p,ee}function re(){if(Jt)return te;Jt=1,Object.defineProperty(te,"__esModule",{value:!0}),te.default=void 0;var t=r(Xt()),e=r(ne()),n=r(Qt());function r(t){return t&&t.__esModule?t:{default:t}}let i=0,o=class{constructor(e){this._contextStack=[],this._graph=null,this._setBase((e=e||{}).baseIRI),e.factory&&s(this,e.factory);const n="string"==typeof e.format?e.format.match(/\w*$/)[0].toLowerCase():"",r=/turtle/.test(n),i=/trig/.test(n),o=/triple/.test(n),a=/quad/.test(n),l=this._n3Mode=/n3/.test(n),c=o||a;(this._supportsNamedGraphs=!(r||l))||(this._readPredicateOrNamedGraph=this._readPredicate),this._supportsQuads=!(r||i||o||l),this._isImpliedBy=e.isImpliedBy,this._supportsRDFStar=""===n||/star|\*$/.test(n),c&&(this._resolveRelativeIRI=()=>null),this._blankNodePrefix="string"!=typeof e.blankNodePrefix?"":e.blankNodePrefix.replace(/^(?!_:)/,"_:"),this._lexer=e.lexer||new t.default({lineMode:c,n3:l,isImpliedBy:this._isImpliedBy}),this._explicitQuantifiers=!!e.explicitQuantifiers}static _resetBlankNodePrefix(){i=0}_setBase(t){if(t){const e=t.indexOf("#");e>=0&&(t=t.substr(0,e)),this._base=t,this._basePath=t.indexOf("/")<0?t:t.replace(/[^\/?]*(?:\?.*)?$/,""),t=t.match(/^(?:([a-z][a-z0-9+.-]*:))?(?:\/\/[^\/]*)?/i),this._baseRoot=t[0],this._baseScheme=t[1]}else this._base="",this._basePath=""}_saveContext(t,e,n,r,i){const o=this._n3Mode;this._contextStack.push({type:t,subject:n,predicate:r,object:i,graph:e,inverse:!!o&&this._inversePredicate,blankPrefix:o?this._prefixes._:"",quantified:o?this._quantified:null}),o&&(this._inversePredicate=!1,this._prefixes._=this._graph?`${this._graph.value}.`:".",this._quantified=Object.create(this._quantified))}_restoreContext(t,e){const n=this._contextStack.pop();if(!n||n.type!==t)return this._error(`Unexpected ${e.type}`,e);this._subject=n.subject,this._predicate=n.predicate,this._object=n.object,this._graph=n.graph,this._n3Mode&&(this._inversePredicate=n.inverse,this._prefixes._=n.blankPrefix,this._quantified=n.quantified)}_readInTopContext(t){switch(t.type){case"eof":return null!==this._graph?this._error("Unclosed graph",t):(delete this._prefixes._,this._callback(null,null,this._prefixes));case"PREFIX":this._sparqlStyle=!0;case"@prefix":return this._readPrefix;case"BASE":this._sparqlStyle=!0;case"@base":return this._readBaseIRI;case"{":if(this._supportsNamedGraphs)return this._graph="",this._subject=null,this._readSubject;case"GRAPH":if(this._supportsNamedGraphs)return this._readNamedGraphLabel;default:return this._readSubject(t)}}_readEntity(t,e){let n;switch(t.type){case"IRI":case"typeIRI":const e=this._resolveIRI(t.value);if(null===e)return this._error("Invalid IRI",t);n=this._factory.namedNode(e);break;case"type":case"prefixed":const r=this._prefixes[t.prefix];if(void 0===r)return this._error(`Undefined prefix "${t.prefix}:"`,t);n=this._factory.namedNode(r+t.value);break;case"blank":n=this._factory.blankNode(this._prefixes[t.prefix]+t.value);break;case"var":n=this._factory.variable(t.value.substr(1));break;default:return this._error(`Expected entity but got ${t.type}`,t)}return!e&&this._n3Mode&&n.id in this._quantified&&(n=this._quantified[n.id]),n}_readSubject(t){switch(this._predicate=null,t.type){case"[":return this._saveContext("blank",this._graph,this._subject=this._factory.blankNode(),null,null),this._readBlankNodeHead;case"(":return this._saveContext("list",this._graph,this.RDF_NIL,null,null),this._subject=null,this._readListItem;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._graph=this._factory.blankNode(),null,null),this._readSubject):this._error("Unexpected graph",t);case"}":return this._readPunctuation(t);case"@forSome":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORSOME,this._quantifier="blankNode",this._readQuantifierList):this._error('Unexpected "@forSome"',t);case"@forAll":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORALL,this._quantifier="variable",this._readQuantifierList):this._error('Unexpected "@forAll"',t);case"literal":if(!this._n3Mode)return this._error("Unexpected literal",t);if(0===t.prefix.length)return this._literalValue=t.value,this._completeSubjectLiteral;this._subject=this._factory.literal(t.value,this._factory.namedNode(t.prefix));break;case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,null,null,null),this._graph=null,this._readSubject):this._error("Unexpected RDF-star syntax",t);default:if(void 0===(this._subject=this._readEntity(t)))return;if(this._n3Mode)return this._getPathReader(this._readPredicateOrNamedGraph)}return this._readPredicateOrNamedGraph}_readPredicate(t){const e=t.type;switch(e){case"inverse":this._inversePredicate=!0;case"abbreviation":this._predicate=this.ABBREVIATIONS[t.value];break;case".":case"]":case"}":return null===this._predicate?this._error(`Unexpected ${e}`,t):(this._subject=null,"]"===e?this._readBlankNodeTail(t):this._readPunctuation(t));case";":return null!==this._predicate?this._readPredicate:this._error("Expected predicate but got ;",t);case"[":if(this._n3Mode)return this._saveContext("blank",this._graph,this._subject,this._subject=this._factory.blankNode(),null),this._readBlankNodeHead;case"blank":if(!this._n3Mode)return this._error("Disallowed blank node as predicate",t);default:if(void 0===(this._predicate=this._readEntity(t)))return}return this._readObject}_readObject(t){switch(t.type){case"literal":if(0===t.prefix.length)return this._literalValue=t.value,this._readDataTypeOrLang;this._object=this._factory.literal(t.value,this._factory.namedNode(t.prefix));break;case"[":return this._saveContext("blank",this._graph,this._subject,this._predicate,this._subject=this._factory.blankNode()),this._readBlankNodeHead;case"(":return this._saveContext("list",this._graph,this._subject,this._predicate,this.RDF_NIL),this._subject=null,this._readListItem;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._factory.blankNode()),this._readSubject):this._error("Unexpected graph",t);case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,this._subject,this._predicate,null),this._graph=null,this._readSubject):this._error("Unexpected RDF-star syntax",t);default:if(void 0===(this._object=this._readEntity(t)))return;if(this._n3Mode)return this._getPathReader(this._getContextEndReader())}return this._getContextEndReader()}_readPredicateOrNamedGraph(t){return"{"===t.type?this._readGraph(t):this._readPredicate(t)}_readGraph(t){return"{"!==t.type?this._error(`Expected graph but got ${t.type}`,t):(this._graph=this._subject,this._subject=null,this._readSubject)}_readBlankNodeHead(t){return"]"===t.type?(this._subject=null,this._readBlankNodeTail(t)):(this._predicate=null,this._readPredicate(t))}_readBlankNodeTail(t){if("]"!==t.type)return this._readBlankNodePunctuation(t);null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph);const e=null===this._predicate;return this._restoreContext("blank",t),null!==this._object?this._getContextEndReader():null!==this._predicate?this._readObject:e?this._readPredicateOrNamedGraph:this._readPredicateAfterBlank}_readPredicateAfterBlank(t){switch(t.type){case".":case"}":return this._subject=null,this._readPunctuation(t);default:return this._readPredicate(t)}}_readListItem(t){let e=null,n=null,r=this._readListItem;const i=this._subject,o=this._contextStack,a=o[o.length-1];switch(t.type){case"[":this._saveContext("blank",this._graph,n=this._factory.blankNode(),this.RDF_FIRST,this._subject=e=this._factory.blankNode()),r=this._readBlankNodeHead;break;case"(":this._saveContext("list",this._graph,n=this._factory.blankNode(),this.RDF_FIRST,this.RDF_NIL),this._subject=null;break;case")":if(this._restoreContext("list",t),0!==o.length&&"list"===o[o.length-1].type&&this._emit(this._subject,this._predicate,this._object,this._graph),null===this._predicate){if(r=this._readPredicate,this._subject===this.RDF_NIL)return r}else if(r=this._getContextEndReader(),this._object===this.RDF_NIL)return r;n=this.RDF_NIL;break;case"literal":0===t.prefix.length?(this._literalValue=t.value,r=this._readListItemDataTypeOrLang):(e=this._factory.literal(t.value,this._factory.namedNode(t.prefix)),r=this._getContextEndReader());break;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._factory.blankNode()),this._readSubject):this._error("Unexpected graph",t);default:if(void 0===(e=this._readEntity(t)))return}if(null===n&&(this._subject=n=this._factory.blankNode()),null===i?null===a.predicate?a.subject=n:a.object=n:this._emit(i,this.RDF_REST,n,this._graph),null!==e){if(this._n3Mode&&("IRI"===t.type||"prefixed"===t.type))return this._saveContext("item",this._graph,n,this.RDF_FIRST,e),this._subject=e,this._predicate=null,this._getPathReader(this._readListItem);this._emit(n,this.RDF_FIRST,e,this._graph)}return r}_readDataTypeOrLang(t){return this._completeObjectLiteral(t,!1)}_readListItemDataTypeOrLang(t){return this._completeObjectLiteral(t,!0)}_completeLiteral(t){let e=this._factory.literal(this._literalValue);switch(t.type){case"type":case"typeIRI":const n=this._readEntity(t);if(void 0===n)return;e=this._factory.literal(this._literalValue,n),t=null;break;case"langcode":e=this._factory.literal(this._literalValue,t.value),t=null}return{token:t,literal:e}}_completeSubjectLiteral(t){return this._subject=this._completeLiteral(t).literal,this._readPredicateOrNamedGraph}_completeObjectLiteral(t,e){const n=this._completeLiteral(t);if(n)return this._object=n.literal,e&&this._emit(this._subject,this.RDF_FIRST,this._object,this._graph),null===n.token?this._getContextEndReader():(this._readCallback=this._getContextEndReader(),this._readCallback(n.token))}_readFormulaTail(t){return"}"!==t.type?this._readPunctuation(t):(null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph),this._restoreContext("formula",t),null===this._object?this._readPredicate:this._getContextEndReader())}_readPunctuation(t){let e,n=this._graph;const r=this._subject,i=this._inversePredicate;switch(t.type){case"}":if(null===this._graph)return this._error("Unexpected graph closing",t);if(this._n3Mode)return this._readFormulaTail(t);this._graph=null;case".":this._subject=null,e=this._contextStack.length?this._readSubject:this._readInTopContext,i&&(this._inversePredicate=!1);break;case";":e=this._readPredicate;break;case",":e=this._readObject;break;case"{|":if(!this._supportsRDFStar)return this._error("Unexpected RDF-star syntax",t);this._subject=this._factory.quad(r,this._predicate,this._object,this.DEFAULTGRAPH),e=this._readPredicate;break;case"|}":if("Quad"!==this._subject.termType)return this._error("Unexpected asserted triple closing",t);this._subject=null,e=this._readPunctuation;break;default:if(this._supportsQuads&&null===this._graph&&void 0!==(n=this._readEntity(t))){e=this._readQuadPunctuation;break}return this._error(`Expected punctuation to follow "${this._object.id}"`,t)}if(null!==r){const t=this._predicate,e=this._object;i?this._emit(e,t,r,n):this._emit(r,t,e,n)}return e}_readBlankNodePunctuation(t){let e;switch(t.type){case";":e=this._readPredicate;break;case",":e=this._readObject;break;default:return this._error(`Expected punctuation to follow "${this._object.id}"`,t)}return this._emit(this._subject,this._predicate,this._object,this._graph),e}_readQuadPunctuation(t){return"."!==t.type?this._error("Expected dot to follow quad",t):this._readInTopContext}_readPrefix(t){return"prefix"!==t.type?this._error("Expected prefix to follow @prefix",t):(this._prefix=t.value,this._readPrefixIRI)}_readPrefixIRI(t){if("IRI"!==t.type)return this._error(`Expected IRI to follow prefix "${this._prefix}:"`,t);const e=this._readEntity(t);return this._prefixes[this._prefix]=e.value,this._prefixCallback(this._prefix,e),this._readDeclarationPunctuation}_readBaseIRI(t){const e="IRI"===t.type&&this._resolveIRI(t.value);return e?(this._setBase(e),this._readDeclarationPunctuation):this._error("Expected valid IRI to follow base declaration",t)}_readNamedGraphLabel(t){switch(t.type){case"IRI":case"blank":case"prefixed":return this._readSubject(t),this._readGraph;case"[":return this._readNamedGraphBlankLabel;default:return this._error("Invalid graph label",t)}}_readNamedGraphBlankLabel(t){return"]"!==t.type?this._error("Invalid graph label",t):(this._subject=this._factory.blankNode(),this._readGraph)}_readDeclarationPunctuation(t){return this._sparqlStyle?(this._sparqlStyle=!1,this._readInTopContext(t)):"."!==t.type?this._error("Expected declaration to end with a dot",t):this._readInTopContext}_readQuantifierList(t){let e;switch(t.type){case"IRI":case"prefixed":if(void 0!==(e=this._readEntity(t,!0)))break;default:return this._error(`Unexpected ${t.type}`,t)}return this._explicitQuantifiers?(null===this._subject?this._emit(this._graph||this.DEFAULTGRAPH,this._predicate,this._subject=this._factory.blankNode(),this.QUANTIFIERS_GRAPH):this._emit(this._subject,this.RDF_REST,this._subject=this._factory.blankNode(),this.QUANTIFIERS_GRAPH),this._emit(this._subject,this.RDF_FIRST,e,this.QUANTIFIERS_GRAPH)):this._quantified[e.id]=this._factory[this._quantifier](this._factory.blankNode().value),this._readQuantifierPunctuation}_readQuantifierPunctuation(t){return","===t.type?this._readQuantifierList:(this._explicitQuantifiers&&(this._emit(this._subject,this.RDF_REST,this.RDF_NIL,this.QUANTIFIERS_GRAPH),this._subject=null),this._readCallback=this._getContextEndReader(),this._readCallback(t))}_getPathReader(t){return this._afterPath=t,this._readPath}_readPath(t){switch(t.type){case"!":return this._readForwardPath;case"^":return this._readBackwardPath;default:const e=this._contextStack,n=e.length&&e[e.length-1];if(n&&"item"===n.type){const e=this._subject;this._restoreContext("item",t),this._emit(this._subject,this.RDF_FIRST,e,this._graph)}return this._afterPath(t)}}_readForwardPath(t){let e,n;const r=this._factory.blankNode();if(void 0!==(n=this._readEntity(t)))return null===this._predicate?(e=this._subject,this._subject=r):(e=this._object,this._object=r),this._emit(e,n,r,this._graph),this._readPath}_readBackwardPath(t){const e=this._factory.blankNode();let n,r;if(void 0!==(n=this._readEntity(t)))return null===this._predicate?(r=this._subject,this._subject=e):(r=this._object,this._object=e),this._emit(e,n,r,this._graph),this._readPath}_readRDFStarTailOrGraph(t){return">>"!==t.type?this._supportsQuads&&null===this._graph&&void 0!==(this._graph=this._readEntity(t))?this._readRDFStarTail:this._error(`Expected >> to follow "${this._object.id}"`,t):this._readRDFStarTail(t)}_readRDFStarTail(t){if(">>"!==t.type)return this._error(`Expected >> but got ${t.type}`,t);const e=this._factory.quad(this._subject,this._predicate,this._object,this._graph||this.DEFAULTGRAPH);return this._restoreContext("<<",t),null===this._subject?(this._subject=e,this._readPredicate):(this._object=e,this._getContextEndReader())}_getContextEndReader(){const t=this._contextStack;if(!t.length)return this._readPunctuation;switch(t[t.length-1].type){case"blank":return this._readBlankNodeTail;case"list":return this._readListItem;case"formula":return this._readFormulaTail;case"<<":return this._readRDFStarTailOrGraph}}_emit(t,e,n,r){this._callback(null,this._factory.quad(t,e,n,r||this.DEFAULTGRAPH))}_error(t,e){const n=new Error(`${t} on line ${e.line}.`);n.context={token:e,line:e.line,previousToken:this._lexer.previousToken},this._callback(n),this._callback=a}_resolveIRI(t){return/^[a-z][a-z0-9+.-]*:/i.test(t)?t:this._resolveRelativeIRI(t)}_resolveRelativeIRI(t){if(!t.length)return this._base;switch(t[0]){case"#":return this._base+t;case"?":return this._base.replace(/(?:\?.*)?$/,t);case"/":return("/"===t[1]?this._baseScheme:this._baseRoot)+this._removeDotSegments(t);default:return/^[^/:]*:/.test(t)?null:this._removeDotSegments(this._basePath+t)}}_removeDotSegments(t){if(!/(^|\/)\.\.?($|[/#?])/.test(t))return t;const e=t.length;let n="",r=-1,i=-1,o=0,a="/";for(;r<e;){switch(a){case":":if(i<0&&"/"===t[++r]&&"/"===t[++r])for(;(i=r+1)<e&&"/"!==t[i];)r=i;break;case"?":case"#":r=e;break;case"/":if("."===t[r+1])switch(a=t[1+ ++r],a){case"/":n+=t.substring(o,r-1),o=r+1;break;case void 0:case"?":case"#":return n+t.substring(o,r)+t.substr(r+1);case".":if(a=t[1+ ++r],void 0===a||"/"===a||"?"===a||"#"===a){if(n+=t.substring(o,r-2),(o=n.lastIndexOf("/"))>=i&&(n=n.substr(0,o)),"/"!==a)return`${n}/${t.substr(r+1)}`;o=r+1}}}a=t[++r]}return n+t.substring(o)}parse(t,e,n){let r,o,s;if(e&&(e.onQuad||e.onPrefix||e.onComment)?(r=e.onQuad,o=e.onPrefix,s=e.onComment):(r=e,o=n),this._readCallback=this._readInTopContext,this._sparqlStyle=!1,this._prefixes=Object.create(null),this._prefixes._=this._blankNodePrefix?this._blankNodePrefix.substr(2):`b${i++}_`,this._prefixCallback=o||a,this._inversePredicate=!1,this._quantified=Object.create(null),!r){const e=[];let n;if(this._callback=(t,r)=>{t?n=t:r&&e.push(r)},this._lexer.tokenize(t).every((t=>this._readCallback=this._readCallback(t))),n)throw n;return e}let l=(t,e)=>{null!==t?(this._callback(t),this._callback=a):this._readCallback&&(this._readCallback=this._readCallback(e))};s&&(this._lexer.comments=!0,l=(t,e)=>{null!==t?(this._callback(t),this._callback=a):this._readCallback&&("comment"===e.type?s(e.value):this._readCallback=this._readCallback(e))}),this._callback=r,this._lexer.tokenize(t,l)}};function a(){}function s(t,e){t._factory=e,t.DEFAULTGRAPH=e.defaultGraph(),t.RDF_FIRST=e.namedNode(n.default.rdf.first),t.RDF_REST=e.namedNode(n.default.rdf.rest),t.RDF_NIL=e.namedNode(n.default.rdf.nil),t.N3_FORALL=e.namedNode(n.default.r.forAll),t.N3_FORSOME=e.namedNode(n.default.r.forSome),t.ABBREVIATIONS={a:e.namedNode(n.default.rdf.type),"=":e.namedNode(n.default.owl.sameAs),">":e.namedNode(n.default.log.implies),"<":e.namedNode(n.default.log.isImpliedBy)},t.QUANTIFIERS_GRAPH=e.namedNode("urn:n3:quantifiers")}return te.default=o,s(o.prototype,e.default),te}var ie,oe={},ae={};function se(){if(ie)return ae;ie=1,Object.defineProperty(ae,"__esModule",{value:!0}),ae.inDefaultGraph=function(t){return n(t.graph)},ae.isBlankNode=function(t){return!!t&&"BlankNode"===t.termType},ae.isDefaultGraph=n,ae.isLiteral=function(t){return!!t&&"Literal"===t.termType},ae.isNamedNode=function(t){return!!t&&"NamedNode"===t.termType},ae.isQuad=function(t){return!!t&&"Quad"===t.termType},ae.isVariable=function(t){return!!t&&"Variable"===t.termType},ae.prefix=function(t,e){return r({"":t.value||t},e)("")},ae.prefixes=r;var t,e=(t=ne())&&t.__esModule?t:{default:t};function n(t){return!!t&&"DefaultGraph"===t.termType}function r(t,n){const r=Object.create(null);for(const e in t)i(e,t[e]);function i(t,e){if("string"==typeof e){const i=Object.create(null);r[t]=t=>i[t]||(i[t]=n.namedNode(e+t))}else if(!(t in r))throw new Error(`Unknown prefix: ${t}`);return r[t]}return n=n||e.default,i}return ae}var le,ce,ue,de={},he={};function fe(){return le||(le=1,Object.defineProperty(he,"__esModule",{value:!0}),he.escapeRegex=function(t){return t.replace(/[\]\/\(\)\*\+\?\.\\\$]/g,"\\$&")}),he}function pe(){if(ce)return de;ce=1,Object.defineProperty(de,"__esModule",{value:!0}),de.default=void 0;var t=fe();const e=/^:?[^:?#]*(?:[?#]|$)|^file:|^[^:]*:\/*[^?#]+?\/(?:\.\.?(?:\/|$)|\/)/i,n=/^(?:(?:[^/?#]{3,}|\.?[^/?#.]\.?)(?:\/[^/?#]{3,}|\.?[^/?#.]\.?)*\/?)?(?:[?#]|$)/;return de.default=class r{constructor(t){this.base=t,this._baseLength=0,this._baseMatcher=null,this._pathReplacements=new Array(t.length+1)}static supports(t){return!e.test(t)}_getBaseMatcher(){if(this._baseMatcher)return this._baseMatcher;if(!r.supports(this.base))return this._baseMatcher=/.^/;const e=/^[^:]*:\/*/.exec(this.base)[0],n=["^",(0,t.escapeRegex)(e)],i=[],o=[],a=/[^/?#]*([/?#])/y;let s,l=0,c=0,u=a.lastIndex=e.length;for(;!l&&!c&&(s=a.exec(this.base));)"#"===s[1]?c=a.lastIndex-1:(n.push((0,t.escapeRegex)(s[0]),"(?:"),i.push(")?"),"?"!==s[1]?o.push(u=a.lastIndex):(l=u=a.lastIndex,c=this.base.indexOf("#",l),this._pathReplacements[l]="?"));for(let t=0;t<o.length;t++)this._pathReplacements[o[t]]="../".repeat(o.length-t-1);return this._pathReplacements[o[o.length-1]]="./",this._baseLength=c>0?c:this.base.length,n.push((0,t.escapeRegex)(this.base.substring(u,this._baseLength)),l?"(?:#|$)":"(?:[?#]|$)"),this._baseMatcher=new RegExp([...n,...i].join(""))}toRelative(t){const e=this._getBaseMatcher().exec(t);if(!e)return t;const r=e[0].length;if(r===this._baseLength&&r===t.length)return"";const i=this._pathReplacements[r];if(i){const e=t.substring(r);return"?"===i||n.test(e)?"./"===i&&/^[^?#]/.test(e)?e:i+e:t}return t.substring(r-1)}},de}function ge(){if(ue)return oe;ue=1,Object.defineProperty(oe,"__esModule",{value:!0}),oe.default=void 0;var t=o(Qt()),e=function(t){if("function"==typeof WeakMap){var e=new WeakMap;new WeakMap}return function(t){if(t&&t.__esModule)return t;var n,r,i={__proto__:null,default:t};if(null===t||"object"!=typeof t&&"function"!=typeof t)return i;if(n=e){if(n.has(t))return n.get(t);n.set(t,i)}for(const e in t)"default"!==e&&{}.hasOwnProperty.call(t,e)&&((r=(n=Object.defineProperty)&&Object.getOwnPropertyDescriptor(t,e))&&(r.get||r.set)?n(i,e,r):i[e]=t[e]);return i}(t)}(ne()),n=se(),r=o(pe()),i=fe();function o(t){return t&&t.__esModule?t:{default:t}}const a=e.default.defaultGraph(),{rdf:s,xsd:l}=t.default,c=/["\\\t\n\r\b\f\u0000-\u0019\ud800-\udbff]/,u=/["\\\t\n\r\b\f\u0000-\u0019]|[\ud800-\udbff][\udc00-\udfff]/g,d={"\\":"\\\\",'"':'\\"',"\t":"\\t","\n":"\\n","\r":"\\r","\b":"\\b","\f":"\\f"};class h extends e.Term{equals(t){return t===this}}function f(t){let e=d[t];return void 0===e&&(1===t.length?(e=t.charCodeAt(0).toString(16),e="\\u0000".substr(0,6-e.length)+e):(e=(1024*(t.charCodeAt(0)-55296)+t.charCodeAt(1)+9216).toString(16),e="\\U00000000".substr(0,10-e.length)+e)),e}return oe.default=class{constructor(t,e){if(this._prefixRegex=/$0^/,t&&"function"!=typeof t.write&&(e=t,t=null),this._lists=(e=e||{}).lists,t)this._outputStream=t,this._endStream=void 0===e.end||!!e.end;else{let t="";this._outputStream={write(e,n,r){t+=e,r&&r()},end:e=>{e&&e(null,t)}},this._endStream=!0}this._subject=null,/triple|quad/i.test(e.format)?(this._lineMode=!0,this._writeQuad=this._writeQuadLine):(this._lineMode=!1,this._graph=a,this._prefixIRIs=Object.create(null),e.prefixes&&this.addPrefixes(e.prefixes),e.baseIRI&&(this._baseIri=new r.default(e.baseIRI)))}get _inDefaultGraph(){return a.equals(this._graph)}_write(t,e){this._outputStream.write(t,"utf8",e)}_writeQuad(t,e,n,r,i){try{r.equals(this._graph)||(this._write((null===this._subject?"":this._inDefaultGraph?".\n":"\n}\n")+(a.equals(r)?"":`${this._encodeIriOrBlank(r)} {\n`)),this._graph=r,this._subject=null),t.equals(this._subject)?e.equals(this._predicate)?this._write(`, ${this._encodeObject(n)}`,i):this._write(`;\n ${this._encodePredicate(this._predicate=e)} ${this._encodeObject(n)}`,i):this._write(`${(null===this._subject?"":".\n")+this._encodeSubject(this._subject=t)} ${this._encodePredicate(this._predicate=e)} ${this._encodeObject(n)}`,i)}catch(t){i&&i(t)}}_writeQuadLine(t,e,n,r,i){delete this._prefixMatch,this._write(this.quadToString(t,e,n,r),i)}quadToString(t,e,n,r){return`${this._encodeSubject(t)} ${this._encodeIriOrBlank(e)} ${this._encodeObject(n)}${r&&r.value?` ${this._encodeIriOrBlank(r)} .\n`:" .\n"}`}quadsToString(t){let e="";for(const n of t)e+=this.quadToString(n.subject,n.predicate,n.object,n.graph);return e}_encodeSubject(t){return"Quad"===t.termType?this._encodeQuad(t):this._encodeIriOrBlank(t)}_encodeIriOrBlank(t){if("NamedNode"!==t.termType)return this._lists&&t.value in this._lists&&(t=this.list(this._lists[t.value])),"id"in t?t.id:`_:${t.value}`;let e=t.value;this._baseIri&&(e=this._baseIri.toRelative(e)),c.test(e)&&(e=e.replace(u,f));const n=this._prefixRegex.exec(e);return n?n[1]?this._prefixIRIs[n[1]]+n[2]:e:`<${e}>`}_encodeLiteral(t){let e=t.value;if(c.test(e)&&(e=e.replace(u,f)),t.language)return`"${e}"@${t.language}`;if(this._lineMode){if(t.datatype.value===l.string)return`"${e}"`}else switch(t.datatype.value){case l.string:return`"${e}"`;case l.boolean:if("true"===e||"false"===e)return e;break;case l.integer:if(/^[+-]?\d+$/.test(e))return e;break;case l.decimal:if(/^[+-]?\d*\.\d+$/.test(e))return e;break;case l.double:if(/^[+-]?(?:\d+\.\d*|\.?\d+)[eE][+-]?\d+$/.test(e))return e}return`"${e}"^^${this._encodeIriOrBlank(t.datatype)}`}_encodePredicate(t){return t.value===s.type?"a":this._encodeIriOrBlank(t)}_encodeObject(t){switch(t.termType){case"Quad":return this._encodeQuad(t);case"Literal":return this._encodeLiteral(t);default:return this._encodeIriOrBlank(t)}}_encodeQuad({subject:t,predicate:e,object:r,graph:i}){return`<<${this._encodeSubject(t)} ${this._encodePredicate(e)} ${this._encodeObject(r)}${(0,n.isDefaultGraph)(i)?"":` ${this._encodeIriOrBlank(i)}`}>>`}_blockedWrite(){throw new Error("Cannot write because the writer has been closed.")}addQuad(t,e,n,r,i){void 0===n?this._writeQuad(t.subject,t.predicate,t.object,t.graph,e):"function"==typeof r?this._writeQuad(t,e,n,a,r):this._writeQuad(t,e,n,r||a,i)}addQuads(t){for(let e=0;e<t.length;e++)this.addQuad(t[e])}addPrefix(t,e,n){const r={};r[t]=e,this.addPrefixes(r,n)}addPrefixes(t,e){if(!this._prefixIRIs)return e&&e();let n=!1;for(let e in t){let r=t[e];"string"!=typeof r&&(r=r.value),n=!0,null!==this._subject&&(this._write(this._inDefaultGraph?".\n":"\n}\n"),this._subject=null,this._graph=""),this._prefixIRIs[r]=e+=":",this._write(`@prefix ${e} <${r}>.\n`)}if(n){let t="",e="";for(const n in this._prefixIRIs)t+=t?`|${n}`:n,e+=(e?"|":"")+this._prefixIRIs[n];t=(0,i.escapeRegex)(t,/[\]\/\(\)\*\+\?\.\\\$]/g,"\\$&"),this._prefixRegex=new RegExp(`^(?:${e})[^/]*$|^(${t})([_a-zA-Z0-9][\\-_a-zA-Z0-9]*)$`)}this._write(n?"\n":"",e)}blank(t,e){let n,r,i=t;switch(void 0===t?i=[]:t.termType?i=[{predicate:t,object:e}]:"length"in t||(i=[t]),r=i.length){case 0:return new h("[]");case 1:if(n=i[0],!(n.object instanceof h))return new h(`[ ${this._encodePredicate(n.predicate)} ${this._encodeObject(n.object)} ]`);default:let e="[";for(let o=0;o<r;o++)n=i[o],n.predicate.equals(t)?e+=`, ${this._encodeObject(n.object)}`:(e+=`${(o?";\n ":"\n ")+this._encodePredicate(n.predicate)} ${this._encodeObject(n.object)}`,t=n.predicate);return new h(`${e}\n]`)}}list(t){const e=t&&t.length||0,n=new Array(e);for(let r=0;r<e;r++)n[r]=this._encodeObject(t[r]);return new h(`(${n.join(" ")})`)}end(t){null!==this._subject&&(this._write(this._inDefaultGraph?".\n":"\n}\n"),this._subject=null),this._write=this._blockedWrite;let e=t&&((n,r)=>{e=null,t(n,r)});if(this._endStream)try{return this._outputStream.end(e)}catch(t){}e&&e()}},oe}var ve,me={},be={exports:{}},we={exports:{}};function ye(){if(ve)return we.exports;ve=1;var t,e="object"==typeof Reflect?Reflect:null,n=e&&"function"==typeof e.apply?e.apply:function(t,e,n){return Function.prototype.apply.call(t,e,n)};t=e&&"function"==typeof e.ownKeys?e.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var r=Number.isNaN||function(t){return t!=t};function i(){i.init.call(this)}we.exports=i,we.exports.once=function(t,e){return new Promise((function(n,r){function i(n){t.removeListener(e,o),r(n)}function o(){"function"==typeof t.removeListener&&t.removeListener("error",i),n([].slice.call(arguments))}p(t,e,o,{once:!0}),"error"!==e&&function(t,e){"function"==typeof t.on&&p(t,"error",e,{once:!0})}(t,i)}))},i.EventEmitter=i,i.prototype._events=void 0,i.prototype._eventsCount=0,i.prototype._maxListeners=void 0;var o=10;function a(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function s(t){return void 0===t._maxListeners?i.defaultMaxListeners:t._maxListeners}function l(t,e,n,r){var i,o,l;if(a(n),void 0===(o=t._events)?(o=t._events=Object.create(null),t._eventsCount=0):(void 0!==o.newListener&&(t.emit("newListener",e,n.listener?n.listener:n),o=t._events),l=o[e]),void 0===l)l=o[e]=n,++t._eventsCount;else if("function"==typeof l?l=o[e]=r?[n,l]:[l,n]:r?l.unshift(n):l.push(n),(i=s(t))>0&&l.length>i&&!l.warned){l.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+l.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=t,c.type=e,c.count=l.length,console&&console.warn&&console.warn(c)}return t}function c(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function u(t,e,n){var r={fired:!1,wrapFn:void 0,target:t,type:e,listener:n},i=c.bind(r);return i.listener=n,r.wrapFn=i,i}function d(t,e,n){var r=t._events;if(void 0===r)return[];var i=r[e];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(t){for(var e=new Array(t.length),n=0;n<e.length;++n)e[n]=t[n].listener||t[n];return e}(i):f(i,i.length)}function h(t){var e=this._events;if(void 0!==e){var n=e[t];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function f(t,e){for(var n=new Array(e),r=0;r<e;++r)n[r]=t[r];return n}function p(t,e,n,r){if("function"==typeof t.on)r.once?t.once(e,n):t.on(e,n);else{if("function"!=typeof t.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t);t.addEventListener(e,(function i(o){r.once&&t.removeEventListener(e,i),n(o)}))}}return Object.defineProperty(i,"defaultMaxListeners",{enumerable:!0,get:function(){return o},set:function(t){if("number"!=typeof t||t<0||r(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");o=t}}),i.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},i.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||r(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},i.prototype.getMaxListeners=function(){return s(this)},i.prototype.emit=function(t){for(var e=[],r=1;r<arguments.length;r++)e.push(arguments[r]);var i="error"===t,o=this._events;if(void 0!==o)i=i&&void 0===o.error;else if(!i)return!1;if(i){var a;if(e.length>0&&(a=e[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var l=o[t];if(void 0===l)return!1;if("function"==typeof l)n(l,this,e);else{var c=l.length,u=f(l,c);for(r=0;r<c;++r)n(u[r],this,e)}return!0},i.prototype.on=i.prototype.addListener=function(t,e){return l(this,t,e,!1)},i.prototype.prependListener=function(t,e){return l(this,t,e,!0)},i.prototype.once=function(t,e){return a(e),this.on(t,u(this,t,e)),this},i.prototype.prependOnceListener=function(t,e){return a(e),this.prependListener(t,u(this,t,e)),this},i.prototype.removeListener=function(t,e){var n,r,i,o,s;if(a(e),void 0===(r=this._events))return this;if(void 0===(n=r[t]))return this;if(n===e||n.listener===e)0==--this._eventsCount?this._events=Object.create(null):(delete r[t],r.removeListener&&this.emit("removeListener",t,n.listener||e));else if("function"!=typeof n){for(i=-1,o=n.length-1;o>=0;o--)if(n[o]===e||n[o].listener===e){s=n[o].listener,i=o;break}if(i<0)return this;0===i?n.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}(n,i),1===n.length&&(r[t]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",t,s||e)}return this},i.prototype.off=i.prototype.removeListener,i.prototype.removeAllListeners=function(t){var e,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[t]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[t]),this;if(0===arguments.length){var i,o=Object.keys(n);for(r=0;r<o.length;++r)"removeListener"!==(i=o[r])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(e=n[t]))this.removeListener(t,e);else if(void 0!==e)for(r=e.length-1;r>=0;r--)this.removeListener(t,e[r]);return this},i.prototype.listeners=function(t){return d(this,t,!0)},i.prototype.rawListeners=function(t){return d(this,t,!1)},i.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):h.call(t,e)},i.prototype.listenerCount=h,i.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]},we.exports}var _e=ye(),ke=s(_e),xe="function"==typeof Object.create?function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:function(t,e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t},Se=/%[sdj%]/g;function Ee(t){if(!Pe(t)){for(var e=[],n=0;n<arguments.length;n++)e.push($e(arguments[n]));return e.join(" ")}n=1;for(var r=arguments,i=r.length,o=String(t).replace(Se,(function(t){if("%%"===t)return"%";if(n>=i)return t;switch(t){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(t){return"[Circular]"}default:return t}})),a=r[n];n<i;a=r[++n])Oe(a)||!De(a)?o+=" "+a:o+=" "+$e(a);return o}function Ce(t,e){if(Ve(Z.process))return function(){return Ce(t,e).apply(this,arguments)};if(!0===f.noDeprecation)return t;var n=!1;return function(){if(!n){if(f.throwDeprecation)throw new Error(e);f.traceDeprecation?console.trace(e):console.error(e),n=!0}return t.apply(this,arguments)}}var Me,Le={};function $e(t,e){var n={seen:[],stylize:Te};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),Re(e)?n.showHidden=e:e&&function(t,e){if(!e||!De(e))return t;for(var n=Object.keys(e),r=n.length;r--;)t[n[r]]=e[n[r]]}(n,e),Ve(n.showHidden)&&(n.showHidden=!1),Ve(n.depth)&&(n.depth=2),Ve(n.colors)&&(n.colors=!1),Ve(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=Ne),Ae(n,t,n.depth)}function Ne(t,e){var n=$e.styles[e];return n?"["+$e.colors[n][0]+"m"+t+"["+$e.colors[n][1]+"m":t}function Te(t){return t}function Ae(t,e,n){if(t.customInspect&&e&&Fe(e.inspect)&&e.inspect!==$e&&(!e.constructor||e.constructor.prototype!==e)){var r=e.inspect(n,t);return Pe(r)||(r=Ae(t,r,n)),r}var i=function(t,e){if(Ve(e))return t.stylize("undefined","undefined");if(Pe(e)){var n="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(n,"string")}return"number"==typeof e?t.stylize(""+e,"number"):Re(e)?t.stylize(""+e,"boolean"):Oe(e)?t.stylize("null","null"):void 0}(t,e);if(i)return i;var o=Object.keys(e),a=function(t){var e={};return t.forEach((function(t){e[t]=!0})),e}(o);if(t.showHidden&&(o=Object.getOwnPropertyNames(e)),Be(e)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return ze(e);if(0===o.length){if(Fe(e))return t.stylize("[Function"+(e.name?": "+e.name:"")+"]","special");if(je(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(He(e))return t.stylize(Date.prototype.toString.call(e),"date");if(Be(e))return ze(e)}var s,l="",c=!1,u=["{","}"];return Array.isArray(e)&&(c=!0,u=["[","]"]),Fe(e)&&(l=" [Function"+(e.name?": "+e.name:"")+"]"),je(e)&&(l=" "+RegExp.prototype.toString.call(e)),He(e)&&(l=" "+Date.prototype.toUTCString.call(e)),Be(e)&&(l=" "+ze(e)),0!==o.length||c&&0!=e.length?n<0?je(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special"):(t.seen.push(e),s=c?function(t,e,n,r,i){for(var o=[],a=0,s=e.length;a<s;++a)We(e,String(a))?o.push(Ie(t,e,n,r,String(a),!0)):o.push("");return i.forEach((function(i){i.match(/^\d+$/)||o.push(Ie(t,e,n,r,i,!0))})),o}(t,e,n,a,o):o.map((function(r){return Ie(t,e,n,a,r,c)})),t.seen.pop(),function(t,e,n){return t.reduce((function(t,e){return e.indexOf("\n"),t+e.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60?n[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+n[1]:n[0]+e+" "+t.join(", ")+" "+n[1]}(s,l,u)):u[0]+l+u[1]}function ze(t){return"["+Error.prototype.toString.call(t)+"]"}function Ie(t,e,n,r,i,o){var a,s,l;if((l=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?s=t.stylize(l.set?"[Getter/Setter]":"[Getter]","special"):l.set&&(s=t.stylize("[Setter]","special")),We(r,i)||(a="["+i+"]"),s||(t.seen.indexOf(l.value)<0?(s=Oe(n)?Ae(t,l.value,null):Ae(t,l.value,n-1)).indexOf("\n")>-1&&(s=o?s.split("\n").map((function(t){return" "+t})).join("\n").substr(2):"\n"+s.split("\n").map((function(t){return" "+t})).join("\n")):s=t.stylize("[Circular]","special")),Ve(a)){if(o&&i.match(/^\d+$/))return s;(a=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=t.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=t.stylize(a,"string"))}return a+": "+s}function Re(t){return"boolean"==typeof t}function Oe(t){return null===t}function Pe(t){return"string"==typeof t}function Ve(t){return void 0===t}function je(t){return De(t)&&"[object RegExp]"===Ue(t)}function De(t){return"object"==typeof t&&null!==t}function He(t){return De(t)&&"[object Date]"===Ue(t)}function Be(t){return De(t)&&("[object Error]"===Ue(t)||t instanceof Error)}function Fe(t){return"function"==typeof t}function Ue(t){return Object.prototype.toString.call(t)}function We(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function qe(){this.head=null,this.tail=null,this.length=0}$e.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},$e.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},qe.prototype.push=function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length},qe.prototype.unshift=function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length},qe.prototype.shift=function(){if(0!==this.length){var t=this.head.data;return this.head=1===this.length?this.tail=null:this.head.next,--this.length,t}},qe.prototype.clear=function(){this.head=this.tail=null,this.length=0},qe.prototype.join=function(t){if(0===this.length)return"";for(var e=this.head,n=""+e.data;e=e.next;)n+=t+e.data;return n},qe.prototype.concat=function(t){if(0===this.length)return lt.alloc(0);if(1===this.length)return this.head.data;for(var e=lt.allocUnsafe(t>>>0),n=this.head,r=0;n;)n.data.copy(e,r),r+=n.data.length,n=n.next;return e};var Ge,Ze,Ke={},Qe={exports:{}};function Xe(){if(Ze)return Ke;Ze=1;var t=(Ge||(Ge=1,function(t,e){var n=Zt,r=n.Buffer;function i(t,e){for(var n in t)e[n]=t[n]}function o(t,e,n){return r(t,e,n)}r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow?Qe.exports=n:(i(n,e),e.Buffer=o),o.prototype=Object.create(r.prototype),i(r,o),o.from=function(t,e,n){if("number"==typeof t)throw new TypeError("Argument must not be a number");return r(t,e,n)},o.alloc=function(t,e,n){if("number"!=typeof t)throw new TypeError("Argument must be a number");var i=r(t);return void 0!==e?"string"==typeof n?i.fill(e,n):i.fill(e):i.fill(0),i},o.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return r(t)},o.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n.SlowBuffer(t)}}(0,Qe.exports)),Qe.exports).Buffer,e=t.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function n(n){var r;switch(this.encoding=function(n){var r=function(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(n);if("string"!=typeof r&&(t.isEncoding===e||!e(n)))throw new Error("Unknown encoding: "+n);return r||n}(n),this.encoding){case"utf16le":this.text=o,this.end=a,r=4;break;case"utf8":this.fillLast=i,r=4;break;case"base64":this.text=s,this.end=l,r=3;break;default:return this.write=c,void(this.end=u)}this.lastNeed=0,this.lastTotal=0,this.lastChar=t.allocUnsafe(r)}function r(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function i(t){var e=this.lastTotal-this.lastNeed,n=function(t,e){if(128!=(192&e[0]))return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"�"}}(this,t);return void 0!==n?n:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function o(t,e){if((t.length-e)%2==0){var n=t.toString("utf16le",e);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function a(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("utf16le",0,this.lastTotal-this.lastNeed):e}function s(t,e){var n=(t.length-e)%3;return 0===n?t.toString("base64",e):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-n))}function l(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function c(t){return t.toString(this.encoding)}function u(t){return t&&t.length?this.write(t):""}return Ke.StringDecoder=n,n.prototype.write=function(t){if(0===t.length)return"";var e,n;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n<t.length?e?e+this.text(t,n):this.text(t,n):e||""},n.prototype.end=function(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"�":e},n.prototype.text=function(t,e){var n=function(t,e,n){var i=e.length-1;if(i<n)return 0;var o=r(e[i]);return o>=0?(o>0&&(t.lastNeed=o-1),o):--i<n||-2===o?0:(o=r(e[i]))>=0?(o>0&&(t.lastNeed=o-2),o):--i<n||-2===o?0:(o=r(e[i]))>=0?(o>0&&(2===o?o=0:t.lastNeed=o-3),o):0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=n;var i=t.length-(n-this.lastNeed);return t.copy(this.lastChar,0,i),t.toString("utf8",e,i)},n.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length},Ke}var Ye=Xe();nn.ReadableState=en;var Je,tn=(Je="stream",Ve(Me)&&(Me=f.env.NODE_DEBUG||""),Je=Je.toUpperCase(),Le[Je]||(Le[Je]=new RegExp("\\b"+Je+"\\b","i").test(Me)?function(){var t=Ee.apply(null,arguments);console.error("%s %d: %s",Je,0,t)}:function(){}),Le[Je]);function en(t,e){this.objectMode=!!(t=t||{}).objectMode,e instanceof Tn&&(this.objectMode=this.objectMode||!!t.readableObjectMode);var n=t.highWaterMark;this.highWaterMark=n||0===n?n:this.objectMode?16:16384,this.highWaterMark=~~this.highWaterMark,this.buffer=new qe,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(this.decoder=new Ye.StringDecoder(t.encoding),this.encoding=t.encoding)}function nn(t){if(!(this instanceof nn))return new nn(t);this._readableState=new en(t,this),this.readable=!0,t&&"function"==typeof t.read&&(this._read=t.read),ke.call(this)}function rn(t,e,n,r,i){var o=function(t,e){var n=null;return lt.isBuffer(e)||"string"==typeof e||null==e||t.objectMode||(n=new TypeError("Invalid non-string/buffer chunk")),n}(e,n);if(o)t.emit("error",o);else if(null===n)e.reading=!1,function(t,e){if(!e.ended){if(e.decoder){var n=e.decoder.end();n&&n.length&&(e.buffer.push(n),e.length+=e.objectMode?1:n.length)}e.ended=!0,sn(t)}}(t,e);else if(e.objectMode||n&&n.length>0)if(e.ended&&!i){var a=new Error("stream.push() after EOF");t.emit("error",a)}else if(e.endEmitted&&i){var s=new Error("stream.unshift() after end event");t.emit("error",s)}else{var l;!e.decoder||i||r||(n=e.decoder.write(n),l=!e.objectMode&&0===n.length),i||(e.reading=!1),l||(e.flowing&&0===e.length&&!e.sync?(t.emit("data",n),t.read(0)):(e.length+=e.objectMode?1:n.length,i?e.buffer.unshift(n):e.buffer.push(n),e.needReadable&&sn(t))),function(t,e){e.readingMore||(e.readingMore=!0,h.nextTick(cn,t,e))}(t,e)}else i||(e.reading=!1);return function(t){return!t.ended&&(t.needReadable||t.length<t.highWaterMark||0===t.length)}(e)}xe(nn,ke),nn.prototype.push=function(t,e){var n=this._readableState;return n.objectMode||"string"!=typeof t||(e=e||n.defaultEncoding)!==n.encoding&&(t=lt.from(t,e),e=""),rn(this,n,t,e,!1)},nn.prototype.unshift=function(t){return rn(this,this._readableState,t,"",!0)},nn.prototype.isPaused=function(){return!1===this._readableState.flowing},nn.prototype.setEncoding=function(t){return this._readableState.decoder=new Ye.StringDecoder(t),this._readableState.encoding=t,this};var on=8388608;function an(t,e){return t<=0||0===e.length&&e.ended?0:e.objectMode?1:t!=t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=function(t){return t>=on?t=on:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function sn(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(tn("emitReadable",e.flowing),e.emittedReadable=!0,e.sync?h.nextTick(ln,t):ln(t))}function ln(t){tn("emit readable"),t.emit("readable"),hn(t)}function cn(t,e){for(var n=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length<e.highWaterMark&&(tn("maybeReadMore read 0"),t.read(0),n!==e.length);)n=e.length;e.readingMore=!1}function un(t){tn("readable nexttick read 0"),t.read(0)}function dn(t,e){e.reading||(tn("resume read 0"),t.read(0)),e.resumeScheduled=!1,e.awaitDrain=0,t.emit("resume"),hn(t),e.flowing&&!e.reading&&t.read(0)}function hn(t){var e=t._readableState;for(tn("flow",e.flowing);e.flowing&&null!==t.read(););}function fn(t,e){return 0===e.length?null:(e.objectMode?n=e.buffer.shift():!t||t>=e.length?(n=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.head.data:e.buffer.concat(e.length),e.buffer.clear()):n=function(t,e,n){var r;return t<e.head.data.length?(r=e.head.data.slice(0,t),e.head.data=e.head.data.slice(t)):r=t===e.head.data.length?e.shift():n?function(t,e){var n=e.head,r=1,i=n.data;for(t-=i.length;n=n.next;){var o=n.data,a=t>o.length?o.length:t;if(i+=a===o.length?o:o.slice(0,t),0==(t-=a)){a===o.length?(++r,e.head=n.next?n.next:e.tail=null):(e.head=n,n.data=o.slice(a));break}++r}return e.length-=r,i}(t,e):function(t,e){var n=lt.allocUnsafe(t),r=e.head,i=1;for(r.data.copy(n),t-=r.data.length;r=r.next;){var o=r.data,a=t>o.length?o.length:t;if(o.copy(n,n.length-t,0,a),0==(t-=a)){a===o.length?(++i,e.head=r.next?r.next:e.tail=null):(e.head=r,r.data=o.slice(a));break}++i}return e.length-=i,n}(t,e),r}(t,e.buffer,e.decoder),n);var n}function pn(t){var e=t._readableState;if(e.length>0)throw new Error('"endReadable()" called on non-empty stream');e.endEmitted||(e.ended=!0,h.nextTick(gn,e,t))}function gn(t,e){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}function vn(t,e){for(var n=0,r=t.length;n<r;n++)if(t[n]===e)return n;return-1}function mn(){}function bn(t,e,n){this.chunk=t,this.encoding=e,this.callback=n,this.next=null}function wn(t,e){Object.defineProperty(this,"buffer",{get:Ce((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.")}),this.objectMode=!!(t=t||{}).objectMode,e instanceof Tn&&(this.objectMode=this.objectMode||!!t.writableObjectMode);var n=t.highWaterMark;this.highWaterMark=n||0===n?n:this.objectMode?16:16384,this.highWaterMark=~~this.highWaterMark,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.decodeStrings=!(!1===t.decodeStrings),this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var n=t._writableState,r=n.sync,i=n.writecb;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(n),e)!function(t,e,n,r,i){--e.pendingcb,n?h.nextTick(i,r):i(r),t._writableState.errorEmitted=!0,t.emit("error",r)}(t,n,r,e,i);else{var o=Sn(n);o||n.corked||n.bufferProcessing||!n.bufferedRequest||xn(t,n),r?h.nextTick(kn,t,n,o,i):kn(t,n,o,i)}}(e,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new Mn(this)}function yn(t){if(!(this instanceof yn||this instanceof Tn))return new yn(t);this._writableState=new wn(t,this),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev)),_e.EventEmitter.call(this)}function _n(t,e,n,r,i,o,a){e.writelen=r,e.writecb=a,e.writing=!0,e.sync=!0,n?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function kn(t,e,n,r){n||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,r(),Cn(t,e)}function xn(t,e){e.bufferProcessing=!0;var n=e.bufferedRequest;if(t._writev&&n&&n.next){var r=new Array(e.bufferedRequestCount),i=e.corkedRequestsFree;i.entry=n;for(var o=0;n;)r[o]=n,n=n.next,o+=1;_n(t,e,!0,e.length,r,"",i.finish),e.pendingcb++,e.lastBufferedRequest=null,i.next?(e.corkedRequestsFree=i.next,i.next=null):e.corkedRequestsFree=new Mn(e)}else{for(;n;){var a=n.chunk;if(_n(t,e,!1,e.objectMode?1:a.length,a,n.encoding,n.callback),n=n.next,e.writing)break}null===n&&(e.lastBufferedRequest=null)}e.bufferedRequestCount=0,e.bufferedRequest=n,e.bufferProcessing=!1}function Sn(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function En(t,e){e.prefinished||(e.prefinished=!0,t.emit("prefinish"))}function Cn(t,e){var n=Sn(e);return n&&(0===e.pendingcb?(En(t,e),e.finished=!0,t.emit("finish")):En(t,e)),n}function Mn(t){var e=this;this.next=null,this.entry=null,this.finish=function(n){var r=e.entry;for(e.entry=null;r;){var i=r.callback;t.pendingcb--,i(n),r=r.next}t.corkedRequestsFree?t.corkedRequestsFree.next=e:t.corkedRequestsFree=e}}nn.prototype.read=function(t){tn("read",t),t=parseInt(t,10);var e=this._readableState,n=t;if(0!==t&&(e.emittedReadable=!1),0===t&&e.needReadable&&(e.length>=e.highWaterMark||e.ended))return tn("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?pn(this):sn(this),null;if(0===(t=an(t,e))&&e.ended)return 0===e.length&&pn(this),null;var r,i=e.needReadable;return tn("need readable",i),(0===e.length||e.length-t<e.highWaterMark)&&tn("length less than watermark",i=!0),e.ended||e.reading?tn("reading or ended",i=!1):i&&(tn("do read"),e.reading=!0,e.sync=!0,0===e.length&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=an(n,e))),null===(r=t>0?fn(t,e):null)?(e.needReadable=!0,t=0):e.length-=t,0===e.length&&(e.ended||(e.needReadable=!0),n!==t&&e.ended&&pn(this)),null!==r&&this.emit("data",r),r},nn.prototype._read=function(){this.emit("error",new Error("not implemented"))},nn.prototype.pipe=function(t,e){var n=this,r=this._readableState;switch(r.pipesCount){case 0:r.pipes=t;break;case 1:r.pipes=[r.pipes,t];break;default:r.pipes.push(t)}r.pipesCount+=1,tn("pipe count=%d opts=%j",r.pipesCount,e);var i=e&&!1===e.end?c:a;function o(t){tn("onunpipe"),t===n&&c()}function a(){tn("onend"),t.end()}r.endEmitted?h.nextTick(i):n.once("end",i),t.on("unpipe",o);var s=function(t){return function(){var e=t._readableState;tn("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&t.listeners("data").length&&(e.flowing=!0,hn(t))}}(n);t.on("drain",s);var l=!1;function c(){tn("cleanup"),t.removeListener("close",p),t.removeListener("finish",g),t.removeListener("drain",s),t.removeListener("error",f),t.removeListener("unpipe",o),n.removeListener("end",a),n.removeListener("end",c),n.removeListener("data",d),l=!0,!r.awaitDrain||t._writableState&&!t._writableState.needDrain||s()}var u=!1;function d(e){tn("ondata"),u=!1,!1!==t.write(e)||u||((1===r.pipesCount&&r.pipes===t||r.pipesCount>1&&-1!==vn(r.pipes,t))&&!l&&(tn("false write response, pause",n._readableState.awaitDrain),n._readableState.awaitDrain++,u=!0),n.pause())}function f(e){tn("onerror",e),v(),t.removeListener("error",f),0===t.listeners("error").length&&t.emit("error",e)}function p(){t.removeListener("finish",g),v()}function g(){tn("onfinish"),t.removeListener("close",p),v()}function v(){tn("unpipe"),n.unpipe(t)}return n.on("data",d),function(t,e,n){if("function"==typeof t.prependListener)return t.prependListener(e,n);t._events&&t._events[e]?Array.isArray(t._events[e])?t._events[e].unshift(n):t._events[e]=[n,t._events[e]]:t.on(e,n)}(t,"error",f),t.once("close",p),t.once("finish",g),t.emit("pipe",n),r.flowing||(tn("pipe resume"),n.resume()),t},nn.prototype.unpipe=function(t){var e=this._readableState;if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this)),this;if(!t){var n=e.pipes,r=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var i=0;i<r;i++)n[i].emit("unpipe",this);return this}var o=vn(e.pipes,t);return-1===o||(e.pipes.splice(o,1),e.pipesCount-=1,1===e.pipesCount&&(e.pipes=e.pipes[0]),t.emit("unpipe",this)),this},nn.prototype.on=function(t,e){var n=ke.prototype.on.call(this,t,e);if("data"===t)!1!==this._readableState.flowing&&this.resume();else if("readable"===t){var r=this._readableState;r.endEmitted||r.readableListening||(r.readableListening=r.needReadable=!0,r.emittedReadable=!1,r.reading?r.length&&sn(this):h.nextTick(un,this))}return n},nn.prototype.addListener=nn.prototype.on,nn.prototype.resume=function(){var t=this._readableState;return t.flowing||(tn("resume"),t.flowing=!0,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,h.nextTick(dn,t,e))}(this,t)),this},nn.prototype.pause=function(){return tn("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(tn("pause"),this._readableState.flowing=!1,this.emit("pause")),this},nn.prototype.wrap=function(t){var e=this._readableState,n=!1,r=this;for(var i in t.on("end",(function(){if(tn("wrapped end"),e.decoder&&!e.ended){var t=e.decoder.end();t&&t.length&&r.push(t)}r.push(null)})),t.on("data",(function(i){tn("wrapped data"),e.decoder&&(i=e.decoder.write(i)),e.objectMode&&null==i||(e.objectMode||i&&i.length)&&(r.push(i)||(n=!0,t.pause()))})),t)void 0===this[i]&&"function"==typeof t[i]&&(this[i]=function(e){return function(){return t[e].apply(t,arguments)}}(i));return function(e){for(var n=0,i=e.length;n<i;n++)t.on(o=e[n],r.emit.bind(r,o));var o}(["error","close","destroy","pause","resume"]),r._read=function(e){tn("wrapped _read",e),n&&(n=!1,t.resume())},r},nn._fromList=fn,yn.WritableState=wn,xe(yn,_e.EventEmitter),wn.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},yn.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},yn.prototype.write=function(t,e,n){var r=this._writableState,i=!1;return"function"==typeof e&&(n=e,e=null),lt.isBuffer(t)?e="buffer":e||(e=r.defaultEncoding),"function"!=typeof n&&(n=mn),r.ended?function(t,e){var n=new Error("write after end");t.emit("error",n),h.nextTick(e,n)}(this,n):function(t,e,n,r){var i=!0,o=!1;return null===n?o=new TypeError("May not write null values to stream"):lt.isBuffer(n)||"string"==typeof n||void 0===n||e.objectMode||(o=new TypeError("Invalid non-string/buffer chunk")),o&&(t.emit("error",o),h.nextTick(r,o),i=!1),i}(this,r,t,n)&&(r.pendingcb++,i=function(t,e,n,r,i){n=function(t,e,n){return t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=lt.from(e,n)),e}(e,n,r),lt.isBuffer(n)&&(r="buffer");var o=e.objectMode?1:n.length;e.length+=o;var a=e.length<e.highWaterMark;if(a||(e.needDrain=!0),e.writing||e.corked){var s=e.lastBufferedRequest;e.lastBufferedRequest=new bn(n,r,i),s?s.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else _n(t,e,!1,o,n,r,i);return a}(this,r,t,e,n)),i},yn.prototype.cork=function(){this._writableState.corked++},yn.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,t.writing||t.corked||t.finished||t.bufferProcessing||!t.bufferedRequest||xn(this,t))},yn.prototype.setDefaultEncoding=function(t){if("string"==typeof t&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this},yn.prototype._write=function(t,e,n){n(new Error("not implemented"))},yn.prototype._writev=null,yn.prototype.end=function(t,e,n){var r=this._writableState;"function"==typeof t?(n=t,t=null,e=null):"function"==typeof e&&(n=e,e=null),null!=t&&this.write(t,e),r.corked&&(r.corked=1,this.uncork()),r.ending||r.finished||function(t,e,n){e.ending=!0,Cn(t,e),n&&(e.finished?h.nextTick(n):t.once("finish",n)),e.ended=!0,t.writable=!1}(this,r,n)},xe(Tn,nn);for(var Ln=Object.keys(yn.prototype),$n=0;$n<Ln.length;$n++){var Nn=Ln[$n];Tn.prototype[Nn]||(Tn.prototype[Nn]=yn.prototype[Nn])}function Tn(t){if(!(this instanceof Tn))return new Tn(t);nn.call(this,t),yn.call(this,t),t&&!1===t.readable&&(this.readable=!1),t&&!1===t.writable&&(this.writable=!1),this.allowHalfOpen=!0,t&&!1===t.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",An)}function An(){this.allowHalfOpen||this._writableState.ended||h.nextTick(zn,this)}function zn(t){t.end()}function In(t){this.afterTransform=function(e,n){return function(t,e,n){var r=t._transformState;r.transforming=!1;var i=r.writecb;if(!i)return t.emit("error",new Error("no writecb in Transform class"));r.writechunk=null,r.writecb=null,null!=n&&t.push(n),i(e);var o=t._readableState;o.reading=!1,(o.needReadable||o.length<o.highWaterMark)&&t._read(o.highWaterMark)}(t,e,n)},this.needTransform=!1,this.transforming=!1,this.writecb=null,this.writechunk=null,this.writeencoding=null}function Rn(t){if(!(this instanceof Rn))return new Rn(t);Tn.call(this,t),this._transformState=new In(this);var e=this;this._readableState.needReadable=!0,this._readableState.sync=!1,t&&("function"==typeof t.transform&&(this._transform=t.transform),"function"==typeof t.flush&&(this._flush=t.flush)),this.once("prefinish",(function(){"function"==typeof this._flush?this._flush((function(t){On(e,t)})):On(e)}))}function On(t,e){if(e)return t.emit("error",e);var n=t._transformState;if(t._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(n.transforming)throw new Error("Calling transform done when still transforming");return t.push(null)}function Pn(t){if(!(this instanceof Pn))return new Pn(t);Rn.call(this,t)}function Vn(){ke.call(this)}xe(Rn,Tn),Rn.prototype.push=function(t,e){return this._transformState.needTransform=!1,Tn.prototype.push.call(this,t,e)},Rn.prototype._transform=function(){throw new Error("Not implemented")},Rn.prototype._write=function(t,e,n){var r=this._transformState;if(r.writecb=n,r.writechunk=t,r.writeencoding=e,!r.transforming){var i=this._readableState;(r.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},Rn.prototype._read=function(){var t=this._transformState;null!==t.writechunk&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0},xe(Pn,Rn),Pn.prototype._transform=function(t,e,n){n(null,t)},xe(Vn,ke),Vn.Readable=nn,Vn.Writable=yn,Vn.Duplex=Tn,Vn.Transform=Rn,Vn.PassThrough=Pn,Vn.Stream=Vn,Vn.prototype.pipe=function(t,e){var n=this;function r(e){t.writable&&!1===t.write(e)&&n.pause&&n.pause()}function i(){n.readable&&n.resume&&n.resume()}n.on("data",r),t.on("drain",i),t._isStdio||e&&!1===e.end||(n.on("end",a),n.on("close",s));var o=!1;function a(){o||(o=!0,t.end())}function s(){o||(o=!0,"function"==typeof t.destroy&&t.destroy())}function l(t){if(c(),0===ke.listenerCount(this,"error"))throw t}function c(){n.removeListener("data",r),t.removeListener("drain",i),n.removeListener("end",a),n.removeListener("close",s),n.removeListener("error",l),t.removeListener("error",l),n.removeListener("end",c),n.removeListener("close",c),t.removeListener("close",c)}return n.on("error",l),t.on("error",l),n.on("end",c),n.on("close",c),t.on("close",c),t.emit("pipe",n),t};var jn,Dn,Hn=l(Object.freeze({__proto__:null,Duplex:Tn,PassThrough:Pn,Readable:nn,Stream:Vn,Transform:Rn,Writable:yn,default:Vn})),Bn={exports:{}};function Fn(){if(Dn)return jn;Dn=1;class t extends Error{constructor(t){if(!Array.isArray(t))throw new TypeError("Expected input to be an Array, got "+typeof t);let e="";for(let n=0;n<t.length;n++)e+=` ${t[n].stack}\n`;super(e),this.name="AggregateError",this.errors=t}}return jn={AggregateError:t,ArrayIsArray:t=>Array.isArray(t),ArrayPrototypeIncludes:(t,e)=>t.includes(e),ArrayPrototypeIndexOf:(t,e)=>t.indexOf(e),ArrayPrototypeJoin:(t,e)=>t.join(e),ArrayPrototypeMap:(t,e)=>t.map(e),ArrayPrototypePop:(t,e)=>t.pop(e),ArrayPrototypePush:(t,e)=>t.push(e),ArrayPrototypeSlice:(t,e,n)=>t.slice(e,n),Error,FunctionPrototypeCall:(t,e,...n)=>t.call(e,...n),FunctionPrototypeSymbolHasInstance:(t,e)=>Function.prototype[Symbol.hasInstance].call(t,e),MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties:(t,e)=>Object.defineProperties(t,e),ObjectDefineProperty:(t,e,n)=>Object.defineProperty(t,e,n),ObjectGetOwnPropertyDescriptor:(t,e)=>Object.getOwnPropertyDescriptor(t,e),ObjectKeys:t=>Object.keys(t),ObjectSetPrototypeOf:(t,e)=>Object.setPrototypeOf(t,e),Promise,PromisePrototypeCatch:(t,e)=>t.catch(e),PromisePrototypeThen:(t,e,n)=>t.then(e,n),PromiseReject:t=>Promise.reject(t),PromiseResolve:t=>Promise.resolve(t),ReflectApply:Reflect.apply,RegExpPrototypeTest:(t,e)=>t.test(e),SafeSet:Set,String,StringPrototypeSlice:(t,e,n)=>t.slice(e,n),StringPrototypeToLowerCase:t=>t.toLowerCase(),StringPrototypeToUpperCase:t=>t.toUpperCase(),StringPrototypeTrim:t=>t.trim(),Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet:(t,e,n)=>t.set(e,n),Boolean,Uint8Array}}var Un,Wn,qn,Gn,Zn={exports:{}};function Kn(){return Wn||(Wn=1,Un={format:(t,...e)=>t.replace(/%([sdifj])/g,(function(...[t,n]){const r=e.shift();return"f"===n?r.toFixed(6):"j"===n?JSON.stringify(r):"s"===n&&"object"==typeof r?`${r.constructor!==Object?r.constructor.name:""} {}`.trim():r.toString()})),inspect(t){switch(typeof t){case"string":if(t.includes("'")){if(!t.includes('"'))return`"${t}"`;if(!t.includes("`")&&!t.includes("${"))return`\`${t}\``}return`'${t}'`;case"number":return isNaN(t)?"NaN":Object.is(t,-0)?String(t):t;case"bigint":return`${String(t)}n`;case"boolean":case"undefined":return String(t);case"object":return"{}"}}}),Un}function Qn(){if(Gn)return qn;Gn=1;const{format:t,inspect:e}=Kn(),{AggregateError:n}=Fn(),r=globalThis.AggregateError||n,i=Symbol("kIsNodeError"),o=["string","function","number","object","Function","Object","boolean","bigint","symbol"],a=/^([A-Z][a-z0-9]*)+$/,s={};function l(t,e){if(!t)throw new s.ERR_INTERNAL_ASSERTION(e)}function c(t){let e="",n=t.length;const r="-"===t[0]?1:0;for(;n>=r+4;n-=3)e=`_${t.slice(n-3,n)}${e}`;return`${t.slice(0,n)}${e}`}function u(e,n,r){r||(r=Error);class o extends r{constructor(...r){super(function(e,n,r){if("function"==typeof n)return l(n.length<=r.length,`Code: ${e}; The provided arguments length (${r.length}) does not match the required ones (${n.length}).`),n(...r);const i=(n.match(/%[dfijoOs]/g)||[]).length;return l(i===r.length,`Code: ${e}; The provided arguments length (${r.length}) does not match the required ones (${i}).`),0===r.length?n:t(n,...r)}(e,n,r))}toString(){return`${this.name} [${e}]: ${this.message}`}}Object.defineProperties(o.prototype,{name:{value:r.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${e}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),o.prototype.code=e,o.prototype[i]=!0,s[e]=o}function d(t){return Object.defineProperty(t,"name",{value:"__node_internal_"+t.name}),t}class h extends Error{constructor(t="The operation was aborted",e){if(void 0!==e&&"object"!=typeof e)throw new s.ERR_INVALID_ARG_TYPE("options","Object",e);super(t,e),this.code="ABORT_ERR",this.name="AbortError"}}return u("ERR_ASSERTION","%s",Error),u("ERR_INVALID_ARG_TYPE",((t,n,r)=>{l("string"==typeof t,"'name' must be a string"),Array.isArray(n)||(n=[n]);let i="The ";t.endsWith(" argument")?i+=`${t} `:i+=`"${t}" ${t.includes(".")?"property":"argument"} `,i+="must be ";const s=[],c=[],u=[];for(const t of n)l("string"==typeof t,"All expected entries have to be of type string"),o.includes(t)?s.push(t.toLowerCase()):a.test(t)?c.push(t):(l("object"!==t,'The value "object" should be written as "Object"'),u.push(t));if(c.length>0){const t=s.indexOf("object");-1!==t&&(s.splice(s,t,1),c.push("Object"))}if(s.length>0){switch(s.length){case 1:i+=`of type ${s[0]}`;break;case 2:i+=`one of type ${s[0]} or ${s[1]}`;break;default:{const t=s.pop();i+=`one of type ${s.join(", ")}, or ${t}`}}(c.length>0||u.length>0)&&(i+=" or ")}if(c.length>0){switch(c.length){case 1:i+=`an instance of ${c[0]}`;break;case 2:i+=`an instance of ${c[0]} or ${c[1]}`;break;default:{const t=c.pop();i+=`an instance of ${c.join(", ")}, or ${t}`}}u.length>0&&(i+=" or ")}switch(u.length){case 0:break;case 1:u[0].toLowerCase()!==u[0]&&(i+="an "),i+=`${u[0]}`;break;case 2:i+=`one of ${u[0]} or ${u[1]}`;break;default:{const t=u.pop();i+=`one of ${u.join(", ")}, or ${t}`}}if(null==r)i+=`. Received ${r}`;else if("function"==typeof r&&r.name)i+=`. Received function ${r.name}`;else if("object"==typeof r){var d;null!==(d=r.constructor)&&void 0!==d&&d.name?i+=`. Received an instance of ${r.constructor.name}`:i+=`. Received ${e(r,{depth:-1})}`}else{let t=e(r,{colors:!1});t.length>25&&(t=`${t.slice(0,25)}...`),i+=`. Received type ${typeof r} (${t})`}return i}),TypeError),u("ERR_INVALID_ARG_VALUE",((t,n,r="is invalid")=>{let i=e(n);return i.length>128&&(i=i.slice(0,128)+"..."),`The ${t.includes(".")?"property":"argument"} '${t}' ${r}. Received ${i}`}),TypeError),u("ERR_INVALID_RETURN_VALUE",((t,e,n)=>{var r;return`Expected ${t} to be returned from the "${e}" function but got ${null!=n&&null!==(r=n.constructor)&&void 0!==r&&r.name?`instance of ${n.constructor.name}`:"type "+typeof n}.`}),TypeError),u("ERR_MISSING_ARGS",((...t)=>{let e;l(t.length>0,"At least one arg needs to be specified");const n=t.length;switch(t=(Array.isArray(t)?t:[t]).map((t=>`"${t}"`)).join(" or "),n){case 1:e+=`The ${t[0]} argument`;break;case 2:e+=`The ${t[0]} and ${t[1]} arguments`;break;default:{const n=t.pop();e+=`The ${t.join(", ")}, and ${n} arguments`}}return`${e} must be specified`}),TypeError),u("ERR_OUT_OF_RANGE",((t,n,r)=>{let i;if(l(n,'Missing "range" argument'),Number.isInteger(r)&&Math.abs(r)>2**32)i=c(String(r));else if("bigint"==typeof r){i=String(r);const t=BigInt(2)**BigInt(32);(r>t||r<-t)&&(i=c(i)),i+="n"}else i=e(r);return`The value of "${t}" is out of range. It must be ${n}. Received ${i}`}),RangeError),u("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),u("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),u("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),u("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),u("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),u("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),u("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),u("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),u("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),u("ERR_STREAM_WRITE_AFTER_END","write after end",Error),u("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),qn={AbortError:h,aggregateTwoErrors:d((function(t,e){if(t&&e&&t!==e){if(Array.isArray(e.errors))return e.errors.push(t),e;const n=new r([e,t],e.message);return n.code=e.code,n}return t||e})),hideStackFrames:d,codes:s}}var Xn,Yn,Jn={exports:{}};function tr(){if(Xn)return Jn.exports;Xn=1;const{AbortController:t,AbortSignal:e}="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0;return Jn.exports=t,Jn.exports.AbortSignal=e,Jn.exports.default=t,Jn.exports}function er(){return Yn||(Yn=1,function(t){const e=Zt,{format:n,inspect:r}=Kn(),{codes:{ERR_INVALID_ARG_TYPE:i}}=Qn(),{kResistStopPropagation:o,AggregateError:a,SymbolDispose:s}=Fn(),l=globalThis.AbortSignal||tr().AbortSignal,c=globalThis.AbortController||tr().AbortController,u=Object.getPrototypeOf((async function(){})).constructor,d=globalThis.Blob||e.Blob,h=void 0!==d?function(t){return t instanceof d}:function(){return!1},f=(t,e)=>{if(void 0!==t&&(null===t||"object"!=typeof t||!("aborted"in t)))throw new i(e,"AbortSignal",t)};t.exports={AggregateError:a,kEmptyObject:Object.freeze({}),once(t){let e=!1;return function(...n){e||(e=!0,t.apply(this,n))}},createDeferredPromise:function(){let t,e;return{promise:new Promise(((n,r)=>{t=n,e=r})),resolve:t,reject:e}},promisify:t=>new Promise(((e,n)=>{t(((t,...r)=>t?n(t):e(...r)))})),debuglog:()=>function(){},format:n,inspect:r,types:{isAsyncFunction:t=>t instanceof u,isArrayBufferView:t=>ArrayBuffer.isView(t)},isBlob:h,deprecate:t=>t,addAbortListener:ye().addAbortListener||function(t,e){if(void 0===t)throw new i("signal","AbortSignal",t);let n;return f(t,"signal"),(t=>{if("function"!=typeof t)throw new i("listener","Function",t)})(e),t.aborted?queueMicrotask((()=>e())):(t.addEventListener("abort",e,{__proto__:null,once:!0,[o]:!0}),n=()=>{t.removeEventListener("abort",e)}),{__proto__:null,[s](){var t;null===(t=n)||void 0===t||t()}}},AbortSignalAny:l.any||function(t){if(1===t.length)return t[0];const e=new c,n=()=>e.abort();return t.forEach((t=>{f(t,"signals"),t.addEventListener("abort",n,{once:!0})})),e.signal.addEventListener("abort",(()=>{t.forEach((t=>t.removeEventListener("abort",n)))}),{once:!0}),e.signal}},t.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")}(Zn)),Zn.exports}var nr,rr,ir={};function or(){if(rr)return nr;rr=1;const{ArrayIsArray:t,ArrayPrototypeIncludes:e,ArrayPrototypeJoin:n,ArrayPrototypeMap:r,NumberIsInteger:i,NumberIsNaN:o,NumberMAX_SAFE_INTEGER:a,NumberMIN_SAFE_INTEGER:s,NumberParseInt:l,ObjectPrototypeHasOwnProperty:c,RegExpPrototypeExec:u,String:d,StringPrototypeToUpperCase:h,StringPrototypeTrim:f}=Fn(),{hideStackFrames:p,codes:{ERR_SOCKET_BAD_PORT:g,ERR_INVALID_ARG_TYPE:v,ERR_INVALID_ARG_VALUE:m,ERR_OUT_OF_RANGE:b,ERR_UNKNOWN_SIGNAL:w}}=Qn(),{normalizeEncoding:y}=er(),{isAsyncFunction:_,isArrayBufferView:k}=er().types,x={},S=/^[0-7]+$/,E=p(((t,e,n=s,r=a)=>{if("number"!=typeof t)throw new v(e,"number",t);if(!i(t))throw new b(e,"an integer",t);if(t<n||t>r)throw new b(e,`>= ${n} && <= ${r}`,t)})),C=p(((t,e,n=-2147483648,r=2147483647)=>{if("number"!=typeof t)throw new v(e,"number",t);if(!i(t))throw new b(e,"an integer",t);if(t<n||t>r)throw new b(e,`>= ${n} && <= ${r}`,t)})),M=p(((t,e,n=!1)=>{if("number"!=typeof t)throw new v(e,"number",t);if(!i(t))throw new b(e,"an integer",t);const r=n?1:0,o=4294967295;if(t<r||t>o)throw new b(e,`>= ${r} && <= ${o}`,t)}));function L(t,e){if("string"!=typeof t)throw new v(e,"string",t)}const $=p(((t,i,o)=>{if(!e(o,t)){const e=n(r(o,(t=>"string"==typeof t?`'${t}'`:d(t))),", ");throw new m(i,t,"must be one of: "+e)}}));function N(t,e){if("boolean"!=typeof t)throw new v(e,"boolean",t)}function T(t,e,n){return null!=t&&c(t,e)?t[e]:n}const A=p(((e,n,r=null)=>{const i=T(r,"allowArray",!1),o=T(r,"allowFunction",!1);if(!T(r,"nullable",!1)&&null===e||!i&&t(e)||"object"!=typeof e&&(!o||"function"!=typeof e))throw new v(n,"Object",e)})),z=p(((t,e)=>{if(null!=t&&"object"!=typeof t&&"function"!=typeof t)throw new v(e,"a dictionary",t)})),I=p(((e,n,r=0)=>{if(!t(e))throw new v(n,"Array",e);if(e.length<r)throw new m(n,e,`must be longer than ${r}`)})),R=p(((t,e="buffer")=>{if(!k(t))throw new v(e,["Buffer","TypedArray","DataView"],t)})),O=p(((t,e)=>{if(void 0!==t&&(null===t||"object"!=typeof t||!("aborted"in t)))throw new v(e,"AbortSignal",t)})),P=p(((t,e)=>{if("function"!=typeof t)throw new v(e,"Function",t)})),V=p(((t,e)=>{if("function"!=typeof t||_(t))throw new v(e,"Function",t)})),j=p(((t,e)=>{if(void 0!==t)throw new v(e,"undefined",t)})),D=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function H(t,e){if(void 0===t||!u(D,t))throw new m(e,t,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}return nr={isInt32:function(t){return t===(0|t)},isUint32:function(t){return t===t>>>0},parseFileMode:function(t,e,n){if(void 0===t&&(t=n),"string"==typeof t){if(null===u(S,t))throw new m(e,t,"must be a 32-bit unsigned integer or an octal string");t=l(t,8)}return M(t,e),t},validateArray:I,validateStringArray:function(t,e){I(t,e);for(let n=0;n<t.length;n++)L(t[n],`${e}[${n}]`)},validateBooleanArray:function(t,e){I(t,e);for(let n=0;n<t.length;n++)N(t[n],`${e}[${n}]`)},validateAbortSignalArray:function(t,e){I(t,e);for(let n=0;n<t.length;n++){const r=t[n],i=`${e}[${n}]`;if(null==r)throw new v(i,"AbortSignal",r);O(r,i)}},validateBoolean:N,validateBuffer:R,validateDictionary:z,validateEncoding:function(t,e){const n=y(e),r=t.length;if("hex"===n&&r%2!=0)throw new m("encoding",e,`is invalid for data of length ${r}`)},validateFunction:P,validateInt32:C,validateInteger:E,validateNumber:function(t,e,n,r){if("number"!=typeof t)throw new v(e,"number",t);if(null!=n&&t<n||null!=r&&t>r||(null!=n||null!=r)&&o(t))throw new b(e,`${null!=n?`>= ${n}`:""}${null!=n&&null!=r?" && ":""}${null!=r?`<= ${r}`:""}`,t)},validateObject:A,validateOneOf:$,validatePlainFunction:V,validatePort:function(t,e="Port",n=!0){if("number"!=typeof t&&"string"!=typeof t||"string"==typeof t&&0===f(t).length||+t!=+t>>>0||t>65535||0===t&&!n)throw new g(e,t,n);return 0|t},validateSignalName:function(t,e="signal"){if(L(t,e),void 0===x[t]){if(void 0!==x[h(t)])throw new w(t+" (signals must use all capital letters)");throw new w(t)}},validateString:L,validateUint32:M,validateUndefined:j,validateUnion:function(t,r,i){if(!e(i,t))throw new v(r,`('${n(i,"|")}')`,t)},validateAbortSignal:O,validateLinkHeaderValue:function(e){if("string"==typeof e)return H(e,"hints"),e;if(t(e)){const t=e.length;let n="";if(0===t)return n;for(let r=0;r<t;r++){const i=e[r];H(i,"hints"),n+=i,r!==t-1&&(n+=", ")}return n}throw new m("hints",e,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}}}var ar,sr,lr,cr,ur,dr,hr,fr={exports:{}};function pr(){if(sr)return ar;sr=1;const{SymbolAsyncIterator:t,SymbolIterator:e,SymbolFor:n}=Fn(),r=n("nodejs.stream.destroyed"),i=n("nodejs.stream.errored"),o=n("nodejs.stream.readable"),a=n("nodejs.stream.writable"),s=n("nodejs.stream.disturbed"),l=n("nodejs.webstream.isClosedPromise"),c=n("nodejs.webstream.controllerErrorFunction");function u(t,e=!1){var n;return!(!t||"function"!=typeof t.pipe||"function"!=typeof t.on||e&&("function"!=typeof t.pause||"function"!=typeof t.resume)||t._writableState&&!1===(null===(n=t._readableState)||void 0===n?void 0:n.readable)||t._writableState&&!t._readableState)}function d(t){var e;return!(!t||"function"!=typeof t.write||"function"!=typeof t.on||t._readableState&&!1===(null===(e=t._writableState)||void 0===e?void 0:e.writable))}function h(t){return t&&(t._readableState||t._writableState||"function"==typeof t.write&&"function"==typeof t.on||"function"==typeof t.pipe&&"function"==typeof t.on)}function f(t){return!(!t||h(t)||"function"!=typeof t.pipeThrough||"function"!=typeof t.getReader||"function"!=typeof t.cancel)}function p(t){return!(!t||h(t)||"function"!=typeof t.getWriter||"function"!=typeof t.abort)}function g(t){return!(!t||h(t)||"object"!=typeof t.readable||"object"!=typeof t.writable)}function v(t){if(!h(t))return null;const e=t._writableState||t._readableState;return!!(t.destroyed||t[r]||null!=e&&e.destroyed)}function m(t){if(!d(t))return null;if(!0===t.writableEnded)return!0;const e=t._writableState;return(null==e||!e.errored)&&("boolean"!=typeof(null==e?void 0:e.ended)?null:e.ended)}function b(t,e){if(!u(t))return null;const n=t._readableState;return(null==n||!n.errored)&&("boolean"!=typeof(null==n?void 0:n.endEmitted)?null:!!(n.endEmitted||!1===e&&!0===n.ended&&0===n.length))}function w(t){return t&&null!=t[o]?t[o]:"boolean"!=typeof(null==t?void 0:t.readable)?null:!v(t)&&u(t)&&t.readable&&!b(t)}function y(t){return t&&null!=t[a]?t[a]:"boolean"!=typeof(null==t?void 0:t.writable)?null:!v(t)&&d(t)&&t.writable&&!m(t)}function _(t){return"boolean"==typeof t._closed&&"boolean"==typeof t._defaultKeepAlive&&"boolean"==typeof t._removedConnection&&"boolean"==typeof t._removedContLen}function k(t){return"boolean"==typeof t._sent100&&_(t)}return ar={isDestroyed:v,kIsDestroyed:r,isDisturbed:function(t){var e;return!(!t||!(null!==(e=t[s])&&void 0!==e?e:t.readableDidRead||t.readableAborted))},kIsDisturbed:s,isErrored:function(t){var e,n,r,o,a,s,l,c,u,d;return!(!t||!(null!==(e=null!==(n=null!==(r=null!==(o=null!==(a=null!==(s=t[i])&&void 0!==s?s:t.readableErrored)&&void 0!==a?a:t.writableErrored)&&void 0!==o?o:null===(l=t._readableState)||void 0===l?void 0:l.errorEmitted)&&void 0!==r?r:null===(c=t._writableState)||void 0===c?void 0:c.errorEmitted)&&void 0!==n?n:null===(u=t._readableState)||void 0===u?void 0:u.errored)&&void 0!==e?e:null===(d=t._writableState)||void 0===d?void 0:d.errored))},kIsErrored:i,isReadable:w,kIsReadable:o,kIsClosedPromise:l,kControllerErrorFunction:c,kIsWritable:a,isClosed:function(t){if(!h(t))return null;if("boolean"==typeof t.closed)return t.closed;const e=t._writableState,n=t._readableState;return"boolean"==typeof(null==e?void 0:e.closed)||"boolean"==typeof(null==n?void 0:n.closed)?(null==e?void 0:e.closed)||(null==n?void 0:n.closed):"boolean"==typeof t._closed&&_(t)?t._closed:null},isDuplexNodeStream:function(t){return!(!t||"function"!=typeof t.pipe||!t._readableState||"function"!=typeof t.on||"function"!=typeof t.write)},isFinished:function(t,e){return h(t)?!(!v(t)&&(!1!==(null==e?void 0:e.readable)&&w(t)||!1!==(null==e?void 0:e.writable)&&y(t))):null},isIterable:function(n,r){return null!=n&&(!0===r?"function"==typeof n[t]:!1===r?"function"==typeof n[e]:"function"==typeof n[t]||"function"==typeof n[e])},isReadableNodeStream:u,isReadableStream:f,isReadableEnded:function(t){if(!u(t))return null;if(!0===t.readableEnded)return!0;const e=t._readableState;return!(!e||e.errored)&&("boolean"!=typeof(null==e?void 0:e.ended)?null:e.ended)},isReadableFinished:b,isReadableErrored:function(t){var e,n;return h(t)?t.readableErrored?t.readableErrored:null!==(e=null===(n=t._readableState)||void 0===n?void 0:n.errored)&&void 0!==e?e:null:null},isNodeStream:h,isWebStream:function(t){return f(t)||p(t)||g(t)},isWritable:y,isWritableNodeStream:d,isWritableStream:p,isWritableEnded:m,isWritableFinished:function(t,e){if(!d(t))return null;if(!0===t.writableFinished)return!0;const n=t._writableState;return(null==n||!n.errored)&&("boolean"!=typeof(null==n?void 0:n.finished)?null:!!(n.finished||!1===e&&!0===n.ended&&0===n.length))},isWritableErrored:function(t){var e,n;return h(t)?t.writableErrored?t.writableErrored:null!==(e=null===(n=t._writableState)||void 0===n?void 0:n.errored)&&void 0!==e?e:null:null},isServerRequest:function(t){var e;return"boolean"==typeof t._consuming&&"boolean"==typeof t._dumped&&void 0===(null===(e=t.req)||void 0===e?void 0:e.upgradeOrConnect)},isServerResponse:k,willEmitClose:function(t){if(!h(t))return null;const e=t._writableState||t._readableState;return!e&&k(t)||!!(e&&e.autoDestroy&&e.emitClose&&!1===e.closed)},isTransformStream:g},ar}function gr(){if(lr)return fr.exports;lr=1;const t=c(),{AbortError:e,codes:n}=Qn(),{ERR_INVALID_ARG_TYPE:r,ERR_STREAM_PREMATURE_CLOSE:i}=n,{kEmptyObject:o,once:a}=er(),{validateAbortSignal:s,validateFunction:l,validateObject:u,validateBoolean:d}=or(),{Promise:h,PromisePrototypeThen:f,SymbolDispose:p}=Fn(),{isClosed:g,isReadable:v,isReadableNodeStream:m,isReadableStream:b,isReadableFinished:w,isReadableErrored:y,isWritable:_,isWritableNodeStream:k,isWritableStream:x,isWritableFinished:S,isWritableErrored:E,isNodeStream:C,willEmitClose:M,kIsClosedPromise:L}=pr();let $;const N=()=>{};function T(n,c,d){var h,T;if(2===arguments.length?(d=c,c=o):null==c?c=o:u(c,"options"),l(d,"callback"),s(c.signal,"options.signal"),d=a(d),b(n)||x(n))return function(n,r,i){let o=!1,s=N;if(r.signal)if(s=()=>{o=!0,i.call(n,new e(void 0,{cause:r.signal.reason}))},r.signal.aborted)t.nextTick(s);else{$=$||er().addAbortListener;const t=$(r.signal,s),e=i;i=a(((...r)=>{t[p](),e.apply(n,r)}))}const l=(...e)=>{o||t.nextTick((()=>i.apply(n,e)))};return f(n[L].promise,l,l),N}(n,c,d);if(!C(n))throw new r("stream",["ReadableStream","WritableStream","Stream"],n);const A=null!==(h=c.readable)&&void 0!==h?h:m(n),z=null!==(T=c.writable)&&void 0!==T?T:k(n),I=n._writableState,R=n._readableState,O=()=>{n.writable||j()};let P=M(n)&&m(n)===A&&k(n)===z,V=S(n,!1);const j=()=>{V=!0,n.destroyed&&(P=!1),(!P||n.readable&&!A)&&(A&&!D||d.call(n))};let D=w(n,!1);const H=()=>{D=!0,n.destroyed&&(P=!1),(!P||n.writable&&!z)&&(z&&!V||d.call(n))},B=t=>{d.call(n,t)};let F=g(n);const U=()=>{F=!0;const t=E(n)||y(n);return t&&"boolean"!=typeof t?d.call(n,t):A&&!D&&m(n,!0)&&!w(n,!1)?d.call(n,new i):!z||V||S(n,!1)?void d.call(n):d.call(n,new i)},W=()=>{F=!0;const t=E(n)||y(n);if(t&&"boolean"!=typeof t)return d.call(n,t);d.call(n)},q=()=>{n.req.on("finish",j)};!function(t){return t.setHeader&&"function"==typeof t.abort}(n)?z&&!I&&(n.on("end",O),n.on("close",O)):(n.on("complete",j),P||n.on("abort",U),n.req?q():n.on("request",q)),P||"boolean"!=typeof n.aborted||n.on("aborted",U),n.on("end",H),n.on("finish",j),!1!==c.error&&n.on("error",B),n.on("close",U),F?t.nextTick(U):null!=I&&I.errorEmitted||null!=R&&R.errorEmitted?P||t.nextTick(W):(A||P&&!v(n)||!V&&!1!==_(n))&&(z||P&&!_(n)||!D&&!1!==v(n))?R&&n.req&&n.aborted&&t.nextTick(W):t.nextTick(W);const G=()=>{d=N,n.removeListener("aborted",U),n.removeListener("complete",j),n.removeListener("abort",U),n.removeListener("request",q),n.req&&n.req.removeListener("finish",j),n.removeListener("end",O),n.removeListener("close",O),n.removeListener("finish",j),n.removeListener("end",H),n.removeListener("error",B),n.removeListener("close",U)};if(c.signal&&!F){const r=()=>{const t=d;G(),t.call(n,new e(void 0,{cause:c.signal.reason}))};if(c.signal.aborted)t.nextTick(r);else{$=$||er().addAbortListener;const t=$(c.signal,r),e=d;d=a(((...r)=>{t[p](),e.apply(n,r)}))}}return G}return fr.exports=T,fr.exports.finished=function(t,e){var n;let r=!1;return null===e&&(e=o),null!==(n=e)&&void 0!==n&&n.cleanup&&(d(e.cleanup,"cleanup"),r=e.cleanup),new h(((n,i)=>{const o=T(t,e,(t=>{r&&o(),t?i(t):n()}))}))},fr.exports}function vr(){if(ur)return cr;ur=1;const t=c(),{aggregateTwoErrors:e,codes:{ERR_MULTIPLE_CALLBACK:n},AbortError:r}=Qn(),{Symbol:i}=Fn(),{kIsDestroyed:o,isDestroyed:a,isFinished:s,isServerRequest:l}=pr(),u=i("kDestroy"),d=i("kConstruct");function h(t,e,n){t&&(e&&!e.errored&&(e.errored=t),n&&!n.errored&&(n.errored=t))}function f(e,n,r){let i=!1;function o(n){if(i)return;i=!0;const o=e._readableState,a=e._writableState;h(n,a,o),a&&(a.closed=!0),o&&(o.closed=!0),"function"==typeof r&&r(n),n?t.nextTick(p,e,n):t.nextTick(g,e)}try{e._destroy(n||null,o)}catch(n){o(n)}}function p(t,e){v(t,e),g(t)}function g(t){const e=t._readableState,n=t._writableState;n&&(n.closeEmitted=!0),e&&(e.closeEmitted=!0),(null!=n&&n.emitClose||null!=e&&e.emitClose)&&t.emit("close")}function v(t,e){const n=t._readableState,r=t._writableState;null!=r&&r.errorEmitted||null!=n&&n.errorEmitted||(r&&(r.errorEmitted=!0),n&&(n.errorEmitted=!0),t.emit("error",e))}function m(e,n,r){const i=e._readableState,o=e._writableState;if(null!=o&&o.destroyed||null!=i&&i.destroyed)return this;null!=i&&i.autoDestroy||null!=o&&o.autoDestroy?e.destroy(n):n&&(o&&!o.errored&&(o.errored=n),i&&!i.errored&&(i.errored=n),r?t.nextTick(v,e,n):v(e,n))}function b(e){let r=!1;function i(i){if(r)return void m(e,null!=i?i:new n);r=!0;const o=e._readableState,a=e._writableState,s=a||o;o&&(o.constructed=!0),a&&(a.constructed=!0),s.destroyed?e.emit(u,i):i?m(e,i,!0):t.nextTick(w,e)}try{e._construct((e=>{t.nextTick(i,e)}))}catch(e){t.nextTick(i,e)}}function w(t){t.emit(d)}function y(t){return(null==t?void 0:t.setHeader)&&"function"==typeof t.abort}function _(t){t.emit("close")}function k(e,n){e.emit("error",n),t.nextTick(_,e)}return cr={construct:function(e,n){if("function"!=typeof e._construct)return;const r=e._readableState,i=e._writableState;r&&(r.constructed=!1),i&&(i.constructed=!1),e.once(d,n),e.listenerCount(d)>1||t.nextTick(b,e)},destroyer:function(e,n){e&&!a(e)&&(n||s(e)||(n=new r),l(e)?(e.socket=null,e.destroy(n)):y(e)?e.abort():y(e.req)?e.req.abort():"function"==typeof e.destroy?e.destroy(n):"function"==typeof e.close?e.close():n?t.nextTick(k,e,n):t.nextTick(_,e),e.destroyed||(e[o]=!0))},destroy:function(t,n){const r=this._readableState,i=this._writableState,o=i||r;return null!=i&&i.destroyed||null!=r&&r.destroyed?("function"==typeof n&&n(),this):(h(t,i,r),i&&(i.destroyed=!0),r&&(r.destroyed=!0),o.constructed?f(this,t,n):this.once(u,(function(r){f(this,e(r,t),n)})),this)},undestroy:function(){const t=this._readableState,e=this._writableState;t&&(t.constructed=!0,t.closed=!1,t.closeEmitted=!1,t.destroyed=!1,t.errored=null,t.errorEmitted=!1,t.reading=!1,t.ended=!1===t.readable,t.endEmitted=!1===t.readable),e&&(e.constructed=!0,e.destroyed=!1,e.closed=!1,e.closeEmitted=!1,e.errored=null,e.errorEmitted=!1,e.finalCalled=!1,e.prefinished=!1,e.ended=!1===e.writable,e.ending=!1===e.writable,e.finished=!1===e.writable)},errorOrDestroy:m},cr}function mr(){if(hr)return dr;hr=1;const{ArrayIsArray:t,ObjectSetPrototypeOf:e}=Fn(),{EventEmitter:n}=ye();function r(t){n.call(this,t)}function i(e,n,r){if("function"==typeof e.prependListener)return e.prependListener(n,r);e._events&&e._events[n]?t(e._events[n])?e._events[n].unshift(r):e._events[n]=[r,e._events[n]]:e.on(n,r)}return e(r.prototype,n.prototype),e(r,n),r.prototype.pipe=function(t,e){const r=this;function o(e){t.writable&&!1===t.write(e)&&r.pause&&r.pause()}function a(){r.readable&&r.resume&&r.resume()}r.on("data",o),t.on("drain",a),t._isStdio||e&&!1===e.end||(r.on("end",l),r.on("close",c));let s=!1;function l(){s||(s=!0,t.end())}function c(){s||(s=!0,"function"==typeof t.destroy&&t.destroy())}function u(t){d(),0===n.listenerCount(this,"error")&&this.emit("error",t)}function d(){r.removeListener("data",o),t.removeListener("drain",a),r.removeListener("end",l),r.removeListener("close",c),r.removeListener("error",u),t.removeListener("error",u),r.removeListener("end",d),r.removeListener("close",d),t.removeListener("close",d)}return i(r,"error",u),i(t,"error",u),r.on("end",d),r.on("close",d),t.on("close",d),t.emit("pipe",r),t},dr={Stream:r,prependListener:i}}var br,wr,yr,_r,kr,xr,Sr,Er,Cr,Mr,Lr,$r,Nr,Tr,Ar,zr,Ir,Rr,Or,Pr,Vr,jr,Dr,Hr,Br,Fr,Ur,Wr,qr,Gr={exports:{}};function Zr(){return br||(br=1,function(t){const{SymbolDispose:e}=Fn(),{AbortError:n,codes:r}=Qn(),{isNodeStream:i,isWebStream:o,kControllerErrorFunction:a}=pr(),s=gr(),{ERR_INVALID_ARG_TYPE:l}=r;let c;t.exports.addAbortSignal=function(e,n){if((t=>{if("object"!=typeof t||!("aborted"in t))throw new l("signal","AbortSignal",t)})(e),!i(n)&&!o(n))throw new l("stream",["ReadableStream","WritableStream","Stream"],n);return t.exports.addAbortSignalNoValidate(e,n)},t.exports.addAbortSignalNoValidate=function(t,r){if("object"!=typeof t||!("aborted"in t))return r;const o=i(r)?()=>{r.destroy(new n(void 0,{cause:t.reason}))}:()=>{r[a](new n(void 0,{cause:t.reason}))};if(t.aborted)o();else{c=c||er().addAbortListener;const n=c(t,o);s(r,n[e])}return r}}(Gr)),Gr.exports}function Kr(){if(yr)return wr;yr=1;const{StringPrototypeSlice:t,SymbolIterator:e,TypedArrayPrototypeSet:n,Uint8Array:r}=Fn(),{Buffer:i}=Zt,{inspect:o}=er();return wr=class{constructor(){this.head=null,this.tail=null,this.length=0}push(t){const e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length}unshift(t){const e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length}shift(){if(0===this.length)return;const t=this.head.data;return this.head=1===this.length?this.tail=null:this.head.next,--this.length,t}clear(){this.head=this.tail=null,this.length=0}join(t){if(0===this.length)return"";let e=this.head,n=""+e.data;for(;null!==(e=e.next);)n+=t+e.data;return n}concat(t){if(0===this.length)return i.alloc(0);const e=i.allocUnsafe(t>>>0);let r=this.head,o=0;for(;r;)n(e,r.data,o),o+=r.data.length,r=r.next;return e}consume(t,e){const n=this.head.data;if(t<n.length){const e=n.slice(0,t);return this.head.data=n.slice(t),e}return t===n.length?this.shift():e?this._getString(t):this._getBuffer(t)}first(){return this.head.data}*[e](){for(let t=this.head;t;t=t.next)yield t.data}_getString(e){let n="",r=this.head,i=0;do{const o=r.data;if(!(e>o.length)){e===o.length?(n+=o,++i,this.head=r.next?r.next:this.tail=null):(n+=t(o,0,e),this.head=r,r.data=t(o,e));break}n+=o,e-=o.length,++i}while(null!==(r=r.next));return this.length-=i,n}_getBuffer(t){const e=i.allocUnsafe(t),o=t;let a=this.head,s=0;do{const i=a.data;if(!(t>i.length)){t===i.length?(n(e,i,o-t),++s,this.head=a.next?a.next:this.tail=null):(n(e,new r(i.buffer,i.byteOffset,t),o-t),this.head=a,a.data=i.slice(t));break}n(e,i,o-t),t-=i.length,++s}while(null!==(a=a.next));return this.length-=s,e}[Symbol.for("nodejs.util.inspect.custom")](t,e){return o(this,{...e,depth:0,customInspect:!1})}},wr}function Qr(){if(kr)return _r;kr=1;const{MathFloor:t,NumberIsInteger:e}=Fn(),{validateInteger:n}=or(),{ERR_INVALID_ARG_VALUE:r}=Qn().codes;let i=16384,o=16;function a(t){return t?o:i}return _r={getHighWaterMark:function(n,i,o,s){const l=function(t,e,n){return null!=t.highWaterMark?t.highWaterMark:e?t[n]:null}(i,s,o);if(null!=l){if(!e(l)||l<0)throw new r(s?`options.${o}`:"options.highWaterMark",l);return t(l)}return a(n.objectMode)},getDefaultHighWaterMark:a,setDefaultHighWaterMark:function(t,e){n(e,"value",0),t?o=e:i=e}}}function Xr(){if(Sr)return xr;Sr=1;const t=c(),{PromisePrototypeThen:e,SymbolAsyncIterator:n,SymbolIterator:r}=Fn(),{Buffer:i}=Zt,{ERR_INVALID_ARG_TYPE:o,ERR_STREAM_NULL_VALUES:a}=Qn().codes;return xr=function(s,l,c){let u,d;if("string"==typeof l||l instanceof i)return new s({objectMode:!0,...c,read(){this.push(l),this.push(null)}});if(l&&l[n])d=!0,u=l[n]();else{if(!l||!l[r])throw new o("iterable",["Iterable"],l);d=!1,u=l[r]()}const h=new s({objectMode:!0,highWaterMark:1,...c});let f=!1;return h._read=function(){f||(f=!0,async function(){for(;;){try{const{value:t,done:e}=d?await u.next():u.next();if(e)h.push(null);else{const e=t&&"function"==typeof t.then?await t:t;if(null===e)throw f=!1,new a;if(h.push(e))continue;f=!1}}catch(t){h.destroy(t)}break}}())},h._destroy=function(n,r){e(async function(t){if(null!=t&&"function"==typeof u.throw){const{value:e,done:n}=await u.throw(t);if(await e,n)return}if("function"==typeof u.return){const{value:t}=await u.return();await t}}(n),(()=>t.nextTick(r,n)),(e=>t.nextTick(r,e||n)))},h},xr}function Yr(){if(Cr)return Er;Cr=1;const t=c(),{ArrayPrototypeIndexOf:e,NumberIsInteger:n,NumberIsNaN:r,NumberParseInt:i,ObjectDefineProperties:o,ObjectKeys:a,ObjectSetPrototypeOf:s,Promise:l,SafeSet:u,SymbolAsyncDispose:d,SymbolAsyncIterator:h,Symbol:f}=Fn();Er=W,W.ReadableState=U;const{EventEmitter:p}=ye(),{Stream:g,prependListener:v}=mr(),{Buffer:m}=Zt,{addAbortSignal:b}=Zr(),w=gr();let y=er().debuglog("stream",(t=>{y=t}));const _=Kr(),k=vr(),{getHighWaterMark:x,getDefaultHighWaterMark:S}=Qr(),{aggregateTwoErrors:E,codes:{ERR_INVALID_ARG_TYPE:C,ERR_METHOD_NOT_IMPLEMENTED:M,ERR_OUT_OF_RANGE:L,ERR_STREAM_PUSH_AFTER_EOF:$,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:N},AbortError:T}=Qn(),{validateObject:A}=or(),z=f("kPaused"),{StringDecoder:I}=Xe(),R=Xr();s(W.prototype,g.prototype),s(W,g);const O=()=>{},{errorOrDestroy:P}=k,V=1,j=16,D=32,H=2048,B=4096;function F(t){return{enumerable:!1,get(){return!!(this.state&t)},set(e){e?this.state|=t:this.state&=~t}}}function U(t,e,n){"boolean"!=typeof n&&(n=e instanceof ei()),this.state=H|B|j|D,t&&t.objectMode&&(this.state|=V),n&&t&&t.readableObjectMode&&(this.state|=V),this.highWaterMark=t?x(this,t,"readableHighWaterMark",n):S(!1),this.buffer=new _,this.length=0,this.pipes=[],this.flowing=null,this[z]=null,t&&!1===t.emitClose&&(this.state&=-2049),t&&!1===t.autoDestroy&&(this.state&=-4097),this.errored=null,this.defaultEncoding=t&&t.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,t&&t.encoding&&(this.decoder=new I(t.encoding),this.encoding=t.encoding)}function W(t){if(!(this instanceof W))return new W(t);const e=this instanceof ei();this._readableState=new U(t,this,e),t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.construct&&(this._construct=t.construct),t.signal&&!e&&b(t.signal,this)),g.call(this,t),k.construct(this,(()=>{this._readableState.needReadable&&X(this,this._readableState)}))}function q(t,e,n,r){y("readableAddChunk",e);const i=t._readableState;let o;if(i.state&V||("string"==typeof e?i.encoding!==(n=n||i.defaultEncoding)&&(r&&i.encoding?e=m.from(e,n).toString(i.encoding):(e=m.from(e,n),n="")):e instanceof m?n="":g._isUint8Array(e)?(e=g._uint8ArrayToBuffer(e),n=""):null!=e&&(o=new C("chunk",["string","Buffer","Uint8Array"],e))),o)P(t,o);else if(null===e)i.state&=-9,function(t,e){if(y("onEofChunk"),!e.ended){if(e.decoder){const t=e.decoder.end();t&&t.length&&(e.buffer.push(t),e.length+=e.objectMode?1:t.length)}e.ended=!0,e.sync?K(t):(e.needReadable=!1,e.emittedReadable=!0,Q(t))}}(t,i);else if(i.state&V||e&&e.length>0)if(r)if(4&i.state)P(t,new N);else{if(i.destroyed||i.errored)return!1;G(t,i,e,!0)}else if(i.ended)P(t,new $);else{if(i.destroyed||i.errored)return!1;i.state&=-9,i.decoder&&!n?(e=i.decoder.write(e),i.objectMode||0!==e.length?G(t,i,e,!1):X(t,i)):G(t,i,e,!1)}else r||(i.state&=-9,X(t,i));return!i.ended&&(i.length<i.highWaterMark||0===i.length)}function G(t,e,n,r){e.flowing&&0===e.length&&!e.sync&&t.listenerCount("data")>0?(65536&e.state?e.awaitDrainWriters.clear():e.awaitDrainWriters=null,e.dataEmitted=!0,t.emit("data",n)):(e.length+=e.objectMode?1:n.length,r?e.buffer.unshift(n):e.buffer.push(n),64&e.state&&K(t)),X(t,e)}function Z(t,e){return t<=0||0===e.length&&e.ended?0:e.state&V?1:r(t)?e.flowing&&e.length?e.buffer.first().length:e.length:t<=e.length?t:e.ended?e.length:0}function K(e){const n=e._readableState;y("emitReadable",n.needReadable,n.emittedReadable),n.needReadable=!1,n.emittedReadable||(y("emitReadable",n.flowing),n.emittedReadable=!0,t.nextTick(Q,e))}function Q(t){const e=t._readableState;y("emitReadable_",e.destroyed,e.length,e.ended),e.destroyed||e.errored||!e.length&&!e.ended||(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,nt(t)}function X(e,n){!n.readingMore&&n.constructed&&(n.readingMore=!0,t.nextTick(Y,e,n))}function Y(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&0===e.length);){const n=e.length;if(y("maybeReadMore read 0"),t.read(0),n===e.length)break}e.readingMore=!1}function J(t){const e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&!1===e[z]?e.flowing=!0:t.listenerCount("data")>0?t.resume():e.readableListening||(e.flowing=null)}function tt(t){y("readable nexttick read 0"),t.read(0)}function et(t,e){y("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),nt(t),e.flowing&&!e.reading&&t.read(0)}function nt(t){const e=t._readableState;for(y("flow",e.flowing);e.flowing&&null!==t.read(););}function rt(t,e){"function"!=typeof t.read&&(t=W.wrap(t,{objectMode:!0}));const n=async function*(t,e){let n,r=O;function i(e){this===t?(r(),r=O):r=e}t.on("readable",i);const o=w(t,{writable:!1},(t=>{n=t?E(n,t):null,r(),r=O}));try{for(;;){const e=t.destroyed?null:t.read();if(null!==e)yield e;else{if(n)throw n;if(null===n)return;await new l(i)}}}catch(t){throw n=E(n,t),n}finally{!n&&!1===(null==e?void 0:e.destroyOnReturn)||void 0!==n&&!t._readableState.autoDestroy?(t.off("readable",i),o()):k.destroyer(t,null)}}(t,e);return n.stream=t,n}function it(t,e){if(0===e.length)return null;let n;return e.objectMode?n=e.buffer.shift():!t||t>=e.length?(n=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):n=e.buffer.consume(t,e.decoder),n}function ot(e){const n=e._readableState;y("endReadable",n.endEmitted),n.endEmitted||(n.ended=!0,t.nextTick(at,n,e))}function at(e,n){if(y("endReadableNT",e.endEmitted,e.length),!e.errored&&!e.closeEmitted&&!e.endEmitted&&0===e.length)if(e.endEmitted=!0,n.emit("end"),n.writable&&!1===n.allowHalfOpen)t.nextTick(st,n);else if(e.autoDestroy){const t=n._writableState;(!t||t.autoDestroy&&(t.finished||!1===t.writable))&&n.destroy()}}function st(t){t.writable&&!t.writableEnded&&!t.destroyed&&t.end()}let lt;function ct(){return void 0===lt&&(lt={}),lt}return o(U.prototype,{objectMode:F(V),ended:F(2),endEmitted:F(4),reading:F(8),constructed:F(j),sync:F(D),needReadable:F(64),emittedReadable:F(128),readableListening:F(256),resumeScheduled:F(512),errorEmitted:F(1024),emitClose:F(H),autoDestroy:F(B),destroyed:F(8192),closed:F(16384),closeEmitted:F(32768),multiAwaitDrain:F(65536),readingMore:F(1<<17),dataEmitted:F(1<<18)}),W.prototype.destroy=k.destroy,W.prototype._undestroy=k.undestroy,W.prototype._destroy=function(t,e){e(t)},W.prototype[p.captureRejectionSymbol]=function(t){this.destroy(t)},W.prototype[d]=function(){let t;return this.destroyed||(t=this.readableEnded?null:new T,this.destroy(t)),new l(((e,n)=>w(this,(r=>r&&r!==t?n(r):e(null)))))},W.prototype.push=function(t,e){return q(this,t,e,!1)},W.prototype.unshift=function(t,e){return q(this,t,e,!0)},W.prototype.isPaused=function(){const t=this._readableState;return!0===t[z]||!1===t.flowing},W.prototype.setEncoding=function(t){const e=new I(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;const n=this._readableState.buffer;let r="";for(const t of n)r+=e.write(t);return n.clear(),""!==r&&n.push(r),this._readableState.length=r.length,this},W.prototype.read=function(t){y("read",t),void 0===t?t=NaN:n(t)||(t=i(t,10));const e=this._readableState,r=t;if(t>e.highWaterMark&&(e.highWaterMark=function(t){if(t>1073741824)throw new L("size","<= 1GiB",t);return t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,++t}(t)),0!==t&&(e.state&=-129),0===t&&e.needReadable&&((0!==e.highWaterMark?e.length>=e.highWaterMark:e.length>0)||e.ended))return y("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?ot(this):K(this),null;if(0===(t=Z(t,e))&&e.ended)return 0===e.length&&ot(this),null;let o,a=!!(64&e.state);if(y("need readable",a),(0===e.length||e.length-t<e.highWaterMark)&&(a=!0,y("length less than watermark",a)),e.ended||e.reading||e.destroyed||e.errored||!e.constructed)a=!1,y("reading, ended or constructing",a);else if(a){y("do read"),e.state|=8|D,0===e.length&&(e.state|=64);try{this._read(e.highWaterMark)}catch(t){P(this,t)}e.state&=-33,e.reading||(t=Z(r,e))}return o=t>0?it(t,e):null,null===o?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.multiAwaitDrain?e.awaitDrainWriters.clear():e.awaitDrainWriters=null),0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&ot(this)),null===o||e.errorEmitted||e.closeEmitted||(e.dataEmitted=!0,this.emit("data",o)),o},W.prototype._read=function(){throw new M("_read()")},W.prototype.pipe=function(e,n){const r=this,i=this._readableState;1===i.pipes.length&&(i.multiAwaitDrain||(i.multiAwaitDrain=!0,i.awaitDrainWriters=new u(i.awaitDrainWriters?[i.awaitDrainWriters]:[]))),i.pipes.push(e),y("pipe count=%d opts=%j",i.pipes.length,n);const o=n&&!1===n.end||e===t.stdout||e===t.stderr?g:a;function a(){y("onend"),e.end()}let s;i.endEmitted?t.nextTick(o):r.once("end",o),e.on("unpipe",(function t(n,o){y("onunpipe"),n===r&&o&&!1===o.hasUnpiped&&(o.hasUnpiped=!0,y("cleanup"),e.removeListener("close",f),e.removeListener("finish",p),s&&e.removeListener("drain",s),e.removeListener("error",h),e.removeListener("unpipe",t),r.removeListener("end",a),r.removeListener("end",g),r.removeListener("data",d),l=!0,s&&i.awaitDrainWriters&&(!e._writableState||e._writableState.needDrain)&&s())}));let l=!1;function c(){l||(1===i.pipes.length&&i.pipes[0]===e?(y("false write response, pause",0),i.awaitDrainWriters=e,i.multiAwaitDrain=!1):i.pipes.length>1&&i.pipes.includes(e)&&(y("false write response, pause",i.awaitDrainWriters.size),i.awaitDrainWriters.add(e)),r.pause()),s||(s=function(t,e){return function(){const n=t._readableState;n.awaitDrainWriters===e?(y("pipeOnDrain",1),n.awaitDrainWriters=null):n.multiAwaitDrain&&(y("pipeOnDrain",n.awaitDrainWriters.size),n.awaitDrainWriters.delete(e)),n.awaitDrainWriters&&0!==n.awaitDrainWriters.size||!t.listenerCount("data")||t.resume()}}(r,e),e.on("drain",s))}function d(t){y("ondata");const n=e.write(t);y("dest.write",n),!1===n&&c()}function h(t){if(y("onerror",t),g(),e.removeListener("error",h),0===e.listenerCount("error")){const n=e._writableState||e._readableState;n&&!n.errorEmitted?P(e,t):e.emit("error",t)}}function f(){e.removeListener("finish",p),g()}function p(){y("onfinish"),e.removeListener("close",f),g()}function g(){y("unpipe"),r.unpipe(e)}return r.on("data",d),v(e,"error",h),e.once("close",f),e.once("finish",p),e.emit("pipe",r),!0===e.writableNeedDrain?c():i.flowing||(y("pipe resume"),r.resume()),e},W.prototype.unpipe=function(t){const n=this._readableState;if(0===n.pipes.length)return this;if(!t){const t=n.pipes;n.pipes=[],this.pause();for(let e=0;e<t.length;e++)t[e].emit("unpipe",this,{hasUnpiped:!1});return this}const r=e(n.pipes,t);return-1===r||(n.pipes.splice(r,1),0===n.pipes.length&&this.pause(),t.emit("unpipe",this,{hasUnpiped:!1})),this},W.prototype.on=function(e,n){const r=g.prototype.on.call(this,e,n),i=this._readableState;return"data"===e?(i.readableListening=this.listenerCount("readable")>0,!1!==i.flowing&&this.resume()):"readable"===e&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,y("on readable",i.length,i.reading),i.length?K(this):i.reading||t.nextTick(tt,this))),r},W.prototype.addListener=W.prototype.on,W.prototype.off=W.prototype.removeListener=function(e,n){const r=g.prototype.removeListener.call(this,e,n);return"readable"===e&&t.nextTick(J,this),r},W.prototype.removeAllListeners=function(e){const n=g.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||t.nextTick(J,this),n},W.prototype.resume=function(){const e=this._readableState;return e.flowing||(y("resume"),e.flowing=!e.readableListening,function(e,n){n.resumeScheduled||(n.resumeScheduled=!0,t.nextTick(et,e,n))}(this,e)),e[z]=!1,this},W.prototype.pause=function(){return y("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(y("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[z]=!0,this},W.prototype.wrap=function(t){let e=!1;t.on("data",(n=>{!this.push(n)&&t.pause&&(e=!0,t.pause())})),t.on("end",(()=>{this.push(null)})),t.on("error",(t=>{P(this,t)})),t.on("close",(()=>{this.destroy()})),t.on("destroy",(()=>{this.destroy()})),this._read=()=>{e&&t.resume&&(e=!1,t.resume())};const n=a(t);for(let e=1;e<n.length;e++){const r=n[e];void 0===this[r]&&"function"==typeof t[r]&&(this[r]=t[r].bind(t))}return this},W.prototype[h]=function(){return rt(this)},W.prototype.iterator=function(t){return void 0!==t&&A(t,"options"),rt(this,t)},o(W.prototype,{readable:{__proto__:null,get(){const t=this._readableState;return!(!t||!1===t.readable||t.destroyed||t.errorEmitted||t.endEmitted)},set(t){this._readableState&&(this._readableState.readable=!!t)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!(!1===this._readableState.readable||!this._readableState.destroyed&&!this._readableState.errored||this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return!!this._readableState&&this._readableState.objectMode}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return!!this._readableState&&this._readableState.closed}},destroyed:{__proto__:null,enumerable:!1,get(){return!!this._readableState&&this._readableState.destroyed},set(t){this._readableState&&(this._readableState.destroyed=t)}},readableEnded:{__proto__:null,enumerable:!1,get(){return!!this._readableState&&this._readableState.endEmitted}}}),o(U.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return!1!==this[z]},set(t){this[z]=!!t}}}),W._fromList=it,W.from=function(t,e){return R(W,t,e)},W.fromWeb=function(t,e){return ct().newStreamReadableFromReadableStream(t,e)},W.toWeb=function(t,e){return ct().newReadableStreamFromStreamReadable(t,e)},W.wrap=function(t,e){var n,r;return new W({objectMode:null===(n=null!==(r=t.readableObjectMode)&&void 0!==r?r:t.objectMode)||void 0===n||n,...e,destroy(e,n){k.destroyer(t,e),n(e)}}).wrap(t)},Er}function Jr(){if(Lr)return Mr;Lr=1;const t=c(),{ArrayPrototypeSlice:e,Error:n,FunctionPrototypeSymbolHasInstance:r,ObjectDefineProperty:i,ObjectDefineProperties:o,ObjectSetPrototypeOf:a,StringPrototypeToLowerCase:s,Symbol:l,SymbolHasInstance:u}=Fn();Mr=A,A.WritableState=N;const{EventEmitter:d}=ye(),h=mr().Stream,{Buffer:f}=Zt,p=vr(),{addAbortSignal:g}=Zr(),{getHighWaterMark:v,getDefaultHighWaterMark:m}=Qr(),{ERR_INVALID_ARG_TYPE:b,ERR_METHOD_NOT_IMPLEMENTED:w,ERR_MULTIPLE_CALLBACK:y,ERR_STREAM_CANNOT_PIPE:_,ERR_STREAM_DESTROYED:k,ERR_STREAM_ALREADY_FINISHED:x,ERR_STREAM_NULL_VALUES:S,ERR_STREAM_WRITE_AFTER_END:E,ERR_UNKNOWN_ENCODING:C}=Qn().codes,{errorOrDestroy:M}=p;function L(){}a(A.prototype,h.prototype),a(A,h);const $=l("kOnFinished");function N(t,e,n){"boolean"!=typeof n&&(n=e instanceof ei()),this.objectMode=!(!t||!t.objectMode),n&&(this.objectMode=this.objectMode||!(!t||!t.writableObjectMode)),this.highWaterMark=t?v(this,t,"writableHighWaterMark",n):m(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1,this.decodeStrings=!(t&&!1===t.decodeStrings),this.defaultEncoding=t&&t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=O.bind(void 0,e),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,T(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!t||!1!==t.emitClose,this.autoDestroy=!t||!1!==t.autoDestroy,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[$]=[]}function T(t){t.buffered=[],t.bufferedIndex=0,t.allBuffers=!0,t.allNoop=!0}function A(t){const e=this instanceof ei();if(!e&&!r(A,this))return new A(t);this._writableState=new N(t,this,e),t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final),"function"==typeof t.construct&&(this._construct=t.construct),t.signal&&g(t.signal,this)),h.call(this,t),p.construct(this,(()=>{const t=this._writableState;t.writing||D(this,t),B(this,t)}))}function z(e,n,r,i){const o=e._writableState;if("function"==typeof r)i=r,r=o.defaultEncoding;else{if(r){if("buffer"!==r&&!f.isEncoding(r))throw new C(r)}else r=o.defaultEncoding;"function"!=typeof i&&(i=L)}if(null===n)throw new S;if(!o.objectMode)if("string"==typeof n)!1!==o.decodeStrings&&(n=f.from(n,r),r="buffer");else if(n instanceof f)r="buffer";else{if(!h._isUint8Array(n))throw new b("chunk",["string","Buffer","Uint8Array"],n);n=h._uint8ArrayToBuffer(n),r="buffer"}let a;return o.ending?a=new E:o.destroyed&&(a=new k("write")),a?(t.nextTick(i,a),M(e,a,!0),a):(o.pendingcb++,function(t,e,n,r,i){const o=e.objectMode?1:n.length;e.length+=o;const a=e.length<e.highWaterMark;return a||(e.needDrain=!0),e.writing||e.corked||e.errored||!e.constructed?(e.buffered.push({chunk:n,encoding:r,callback:i}),e.allBuffers&&"buffer"!==r&&(e.allBuffers=!1),e.allNoop&&i!==L&&(e.allNoop=!1)):(e.writelen=o,e.writecb=i,e.writing=!0,e.sync=!0,t._write(n,r,e.onwrite),e.sync=!1),a&&!e.errored&&!e.destroyed}(e,o,n,r,i))}function I(t,e,n,r,i,o,a){e.writelen=r,e.writecb=a,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new k("write")):n?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function R(t,e,n,r){--e.pendingcb,r(n),j(e),M(t,n)}function O(e,n){const r=e._writableState,i=r.sync,o=r.writecb;"function"==typeof o?(r.writing=!1,r.writecb=null,r.length-=r.writelen,r.writelen=0,n?(r.errored||(r.errored=n),e._readableState&&!e._readableState.errored&&(e._readableState.errored=n),i?t.nextTick(R,e,r,n,o):R(e,r,n,o)):(r.buffered.length>r.bufferedIndex&&D(e,r),i?null!==r.afterWriteTickInfo&&r.afterWriteTickInfo.cb===o?r.afterWriteTickInfo.count++:(r.afterWriteTickInfo={count:1,cb:o,stream:e,state:r},t.nextTick(P,r.afterWriteTickInfo)):V(e,r,1,o))):M(e,new y)}function P({stream:t,state:e,count:n,cb:r}){return e.afterWriteTickInfo=null,V(t,e,n,r)}function V(t,e,n,r){for(!e.ending&&!t.destroyed&&0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"));n-- >0;)e.pendingcb--,r();e.destroyed&&j(e),B(t,e)}function j(t){if(t.writing)return;for(let n=t.bufferedIndex;n<t.buffered.length;++n){var e;const{chunk:r,callback:i}=t.buffered[n];t.length-=t.objectMode?1:r.length,i(null!==(e=t.errored)&&void 0!==e?e:new k("write"))}const n=t[$].splice(0);for(let e=0;e<n.length;e++){var r;n[e](null!==(r=t.errored)&&void 0!==r?r:new k("end"))}T(t)}function D(t,n){if(n.corked||n.bufferProcessing||n.destroyed||!n.constructed)return;const{buffered:r,bufferedIndex:i,objectMode:o}=n,a=r.length-i;if(!a)return;let s=i;if(n.bufferProcessing=!0,a>1&&t._writev){n.pendingcb-=a-1;const i=n.allNoop?L:t=>{for(let e=s;e<r.length;++e)r[e].callback(t)},o=n.allNoop&&0===s?r:e(r,s);o.allBuffers=n.allBuffers,I(t,n,!0,n.length,o,"",i),T(n)}else{do{const{chunk:e,encoding:i,callback:a}=r[s];r[s++]=null,I(t,n,!1,o?1:e.length,e,i,a)}while(s<r.length&&!n.writing);s===r.length?T(n):s>256?(r.splice(0,s),n.bufferedIndex=0):n.bufferedIndex=s}n.bufferProcessing=!1}function H(t){return t.ending&&!t.destroyed&&t.constructed&&0===t.length&&!t.errored&&0===t.buffered.length&&!t.finished&&!t.writing&&!t.errorEmitted&&!t.closeEmitted}function B(e,n,r){H(n)&&(function(e,n){n.prefinished||n.finalCalled||("function"!=typeof e._final||n.destroyed?(n.prefinished=!0,e.emit("prefinish")):(n.finalCalled=!0,function(e,n){let r=!1;function i(i){if(r)M(e,null!=i?i:y());else if(r=!0,n.pendingcb--,i){const t=n[$].splice(0);for(let e=0;e<t.length;e++)t[e](i);M(e,i,n.sync)}else H(n)&&(n.prefinished=!0,e.emit("prefinish"),n.pendingcb++,t.nextTick(F,e,n))}n.sync=!0,n.pendingcb++;try{e._final(i)}catch(t){i(t)}n.sync=!1}(e,n)))}(e,n),0===n.pendingcb&&(r?(n.pendingcb++,t.nextTick(((t,e)=>{H(e)?F(t,e):e.pendingcb--}),e,n)):H(n)&&(n.pendingcb++,F(e,n))))}function F(t,e){e.pendingcb--,e.finished=!0;const n=e[$].splice(0);for(let t=0;t<n.length;t++)n[t]();if(t.emit("finish"),e.autoDestroy){const e=t._readableState;(!e||e.autoDestroy&&(e.endEmitted||!1===e.readable))&&t.destroy()}}N.prototype.getBuffer=function(){return e(this.buffered,this.bufferedIndex)},i(N.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}}),i(A,u,{__proto__:null,value:function(t){return!!r(this,t)||this===A&&t&&t._writableState instanceof N}}),A.prototype.pipe=function(){M(this,new _)},A.prototype.write=function(t,e,n){return!0===z(this,t,e,n)},A.prototype.cork=function(){this._writableState.corked++},A.prototype.uncork=function(){const t=this._writableState;t.corked&&(t.corked--,t.writing||D(this,t))},A.prototype.setDefaultEncoding=function(t){if("string"==typeof t&&(t=s(t)),!f.isEncoding(t))throw new C(t);return this._writableState.defaultEncoding=t,this},A.prototype._write=function(t,e,n){if(!this._writev)throw new w("_write()");this._writev([{chunk:t,encoding:e}],n)},A.prototype._writev=null,A.prototype.end=function(e,r,i){const o=this._writableState;let a;if("function"==typeof e?(i=e,e=null,r=null):"function"==typeof r&&(i=r,r=null),null!=e){const t=z(this,e,r);t instanceof n&&(a=t)}return o.corked&&(o.corked=1,this.uncork()),a||(o.errored||o.ending?o.finished?a=new x("end"):o.destroyed&&(a=new k("end")):(o.ending=!0,B(this,o,!0),o.ended=!0)),"function"==typeof i&&(a||o.finished?t.nextTick(i,a):o[$].push(i)),this},o(A.prototype,{closed:{__proto__:null,get(){return!!this._writableState&&this._writableState.closed}},destroyed:{__proto__:null,get(){return!!this._writableState&&this._writableState.destroyed},set(t){this._writableState&&(this._writableState.destroyed=t)}},writable:{__proto__:null,get(){const t=this._writableState;return!(!t||!1===t.writable||t.destroyed||t.errored||t.ending||t.ended)},set(t){this._writableState&&(this._writableState.writable=!!t)}},writableFinished:{__proto__:null,get(){return!!this._writableState&&this._writableState.finished}},writableObjectMode:{__proto__:null,get(){return!!this._writableState&&this._writableState.objectMode}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return!!this._writableState&&this._writableState.ending}},writableNeedDrain:{__proto__:null,get(){const t=this._writableState;return!!t&&!t.destroyed&&!t.ending&&t.needDrain}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!(!1===this._writableState.writable||!this._writableState.destroyed&&!this._writableState.errored||this._writableState.finished)}}});const U=p.destroy;let W;function q(){return void 0===W&&(W={}),W}return A.prototype.destroy=function(e,n){const r=this._writableState;return!r.destroyed&&(r.bufferedIndex<r.buffered.length||r[$].length)&&t.nextTick(j,r),U.call(this,e,n),this},A.prototype._undestroy=p.undestroy,A.prototype._destroy=function(t,e){e(t)},A.prototype[d.captureRejectionSymbol]=function(t){this.destroy(t)},A.fromWeb=function(t,e){return q().newStreamWritableFromWritableStream(t,e)},A.toWeb=function(t){return q().newWritableStreamFromStreamWritable(t)},Mr}function ti(){if(Nr)return $r;Nr=1;const t=c(),e=Zt,{isReadable:n,isWritable:r,isIterable:i,isNodeStream:o,isReadableNodeStream:a,isWritableNodeStream:s,isDuplexNodeStream:l,isReadableStream:u,isWritableStream:d}=pr(),h=gr(),{AbortError:f,codes:{ERR_INVALID_ARG_TYPE:p,ERR_INVALID_RETURN_VALUE:g}}=Qn(),{destroyer:v}=vr(),m=ei(),b=Yr(),w=Jr(),{createDeferredPromise:y}=er(),_=Xr(),k=globalThis.Blob||e.Blob,x=void 0!==k?function(t){return t instanceof k}:function(){return!1},S=globalThis.AbortController||tr().AbortController,{FunctionPrototypeCall:E}=Fn();class C extends m{constructor(t){super(t),!1===(null==t?void 0:t.readable)&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),!1===(null==t?void 0:t.writable)&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}}function M(t){const e=t.readable&&"function"!=typeof t.readable.read?b.wrap(t.readable):t.readable,i=t.writable;let o,a,s,l,c,u=!!n(e),d=!!r(i);function p(t){const e=l;l=null,e?e(t):t&&c.destroy(t)}return c=new C({readableObjectMode:!(null==e||!e.readableObjectMode),writableObjectMode:!(null==i||!i.writableObjectMode),readable:u,writable:d}),d&&(h(i,(t=>{d=!1,t&&v(e,t),p(t)})),c._write=function(t,e,n){i.write(t,e)?n():o=n},c._final=function(t){i.end(),a=t},i.on("drain",(function(){if(o){const t=o;o=null,t()}})),i.on("finish",(function(){if(a){const t=a;a=null,t()}}))),u&&(h(e,(t=>{u=!1,t&&v(e,t),p(t)})),e.on("readable",(function(){if(s){const t=s;s=null,t()}})),e.on("end",(function(){c.push(null)})),c._read=function(){for(;;){const t=e.read();if(null===t)return void(s=c._read);if(!c.push(t))return}}),c._destroy=function(t,n){t||null===l||(t=new f),s=null,o=null,a=null,null===l?n(t):(l=n,v(i,t),v(e,t))},c}return $r=function e(n,r){if(l(n))return n;if(a(n))return M({readable:n});if(s(n))return M({writable:n});if(o(n))return M({writable:!1,readable:!1});if(u(n))return M({readable:b.fromWeb(n)});if(d(n))return M({writable:w.fromWeb(n)});if("function"==typeof n){const{value:e,write:o,final:a,destroy:s}=function(e){let{promise:n,resolve:r}=y();const i=new S,o=i.signal,a=e(async function*(){for(;;){const e=n;n=null;const{chunk:i,done:a,cb:s}=await e;if(t.nextTick(s),a)return;if(o.aborted)throw new f(void 0,{cause:o.reason});({promise:n,resolve:r}=y()),yield i}}(),{signal:o});return{value:a,write(t,e,n){const i=r;r=null,i({chunk:t,done:!1,cb:n})},final(t){const e=r;r=null,e({done:!0,cb:t})},destroy(t,e){i.abort(),e(t)}}}(n);if(i(e))return _(C,e,{objectMode:!0,write:o,final:a,destroy:s});const l=null==e?void 0:e.then;if("function"==typeof l){let n;const r=E(l,e,(t=>{if(null!=t)throw new g("nully","body",t)}),(t=>{v(n,t)}));return n=new C({objectMode:!0,readable:!1,write:o,final(e){a((async()=>{try{await r,t.nextTick(e,null)}catch(n){t.nextTick(e,n)}}))},destroy:s})}throw new g("Iterable, AsyncIterable or AsyncFunction",r,e)}if(x(n))return e(n.arrayBuffer());if(i(n))return _(C,n,{objectMode:!0,writable:!1});if(u(null==n?void 0:n.readable)&&d(null==n?void 0:n.writable))return C.fromWeb(n);if("object"==typeof(null==n?void 0:n.writable)||"object"==typeof(null==n?void 0:n.readable))return M({readable:null!=n&&n.readable?a(null==n?void 0:n.readable)?null==n?void 0:n.readable:e(n.readable):void 0,writable:null!=n&&n.writable?s(null==n?void 0:n.writable)?null==n?void 0:n.writable:e(n.writable):void 0});const c=null==n?void 0:n.then;if("function"==typeof c){let t;return E(c,n,(e=>{null!=e&&t.push(e),t.push(null)}),(e=>{v(t,e)})),t=new C({objectMode:!0,writable:!1,read(){}})}throw new p(r,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],n)},$r}function ei(){if(Ar)return Tr;Ar=1;const{ObjectDefineProperties:t,ObjectGetOwnPropertyDescriptor:e,ObjectKeys:n,ObjectSetPrototypeOf:r}=Fn();Tr=a;const i=Yr(),o=Jr();r(a.prototype,i.prototype),r(a,i);{const t=n(o.prototype);for(let e=0;e<t.length;e++){const n=t[e];a.prototype[n]||(a.prototype[n]=o.prototype[n])}}function a(t){if(!(this instanceof a))return new a(t);i.call(this,t),o.call(this,t),t?(this.allowHalfOpen=!1!==t.allowHalfOpen,!1===t.readable&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),!1===t.writable&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}let s,l;function c(){return void 0===s&&(s={}),s}return t(a.prototype,{writable:{__proto__:null,...e(o.prototype,"writable")},writableHighWaterMark:{__proto__:null,...e(o.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...e(o.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...e(o.prototype,"writableBuffer")},writableLength:{__proto__:null,...e(o.prototype,"writableLength")},writableFinished:{__proto__:null,...e(o.prototype,"writableFinished")},writableCorked:{__proto__:null,...e(o.prototype,"writableCorked")},writableEnded:{__proto__:null,...e(o.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...e(o.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set(t){this._readableState&&this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}}}),a.fromWeb=function(t,e){return c().newStreamDuplexFromReadableWritablePair(t,e)},a.toWeb=function(t){return c().newReadableWritablePairFromDuplex(t)},a.from=function(t){return l||(l=ti()),l(t,"body")},Tr}function ni(){if(Ir)return zr;Ir=1;const{ObjectSetPrototypeOf:t,Symbol:e}=Fn();zr=a;const{ERR_METHOD_NOT_IMPLEMENTED:n}=Qn().codes,r=ei(),{getHighWaterMark:i}=Qr();t(a.prototype,r.prototype),t(a,r);const o=e("kCallback");function a(t){if(!(this instanceof a))return new a(t);const e=t?i(this,t,"readableHighWaterMark",!0):null;0===e&&(t={...t,highWaterMark:null,readableHighWaterMark:e,writableHighWaterMark:t.writableHighWaterMark||0}),r.call(this,t),this._readableState.sync=!1,this[o]=null,t&&("function"==typeof t.transform&&(this._transform=t.transform),"function"==typeof t.flush&&(this._flush=t.flush)),this.on("prefinish",l)}function s(t){"function"!=typeof this._flush||this.destroyed?(this.push(null),t&&t()):this._flush(((e,n)=>{e?t?t(e):this.destroy(e):(null!=n&&this.push(n),this.push(null),t&&t())}))}function l(){this._final!==s&&s.call(this)}return a.prototype._final=s,a.prototype._transform=function(){throw new n("_transform()")},a.prototype._write=function(t,e,n){const r=this._readableState,i=this._writableState,a=r.length;this._transform(t,e,((t,e)=>{t?n(t):(null!=e&&this.push(e),i.ended||a===r.length||r.length<r.highWaterMark?n():this[o]=n)}))},a.prototype._read=function(){if(this[o]){const t=this[o];this[o]=null,t()}},zr}function ri(){if(Or)return Rr;Or=1;const{ObjectSetPrototypeOf:t}=Fn();Rr=n;const e=ni();function n(t){if(!(this instanceof n))return new n(t);e.call(this,t)}return t(n.prototype,e.prototype),t(n,e),n.prototype._transform=function(t,e,n){n(null,t)},Rr}function ii(){if(Vr)return Pr;Vr=1;const t=c(),{ArrayIsArray:e,Promise:n,SymbolAsyncIterator:r,SymbolDispose:i}=Fn(),o=gr(),{once:a}=er(),s=vr(),l=ei(),{aggregateTwoErrors:u,codes:{ERR_INVALID_ARG_TYPE:d,ERR_INVALID_RETURN_VALUE:h,ERR_MISSING_ARGS:f,ERR_STREAM_DESTROYED:p,ERR_STREAM_PREMATURE_CLOSE:g},AbortError:v}=Qn(),{validateFunction:m,validateAbortSignal:b}=or(),{isIterable:w,isReadable:y,isReadableNodeStream:_,isNodeStream:k,isTransformStream:x,isWebStream:S,isReadableStream:E,isReadableFinished:C}=pr(),M=globalThis.AbortController||tr().AbortController;let L,$,N;function T(t,e,n){let r=!1;return t.on("close",(()=>{r=!0})),{destroy:e=>{r||(r=!0,s.destroyer(t,e||new p("pipe")))},cleanup:o(t,{readable:e,writable:n},(t=>{r=!t}))}}function A(t){if(w(t))return t;if(_(t))return async function*(t){$||($=Yr()),yield*$.prototype[r].call(t)}(t);throw new d("val",["Readable","Iterable","AsyncIterable"],t)}async function z(t,e,r,{end:i}){let a,s=null;const l=t=>{if(t&&(a=t),s){const t=s;s=null,t()}},c=()=>new n(((t,e)=>{a?e(a):s=()=>{a?e(a):t()}}));e.on("drain",l);const d=o(e,{readable:!1},l);try{e.writableNeedDrain&&await c();for await(const n of t)e.write(n)||await c();i&&(e.end(),await c()),r()}catch(t){r(a!==t?u(a,t):t)}finally{d(),e.off("drain",l)}}async function I(t,e,n,{end:r}){x(e)&&(e=e.writable);const i=e.getWriter();try{for await(const e of t)await i.ready,i.write(e).catch((()=>{}));await i.ready,r&&await i.close(),n()}catch(t){try{await i.abort(t),n(t)}catch(t){n(t)}}}function R(n,r,o){if(1===n.length&&e(n[0])&&(n=n[0]),n.length<2)throw new f("streams");const a=new M,s=a.signal,c=null==o?void 0:o.signal,u=[];function p(){j(new v)}let g,m,C;b(c,"options.signal"),N=N||er().addAbortListener,c&&(g=N(c,p));const $=[];let R,P=0;function V(t){j(t,0==--P)}function j(e,n){var o;if(!e||m&&"ERR_STREAM_PREMATURE_CLOSE"!==m.code||(m=e),m||n){for(;$.length;)$.shift()(m);null===(o=g)||void 0===o||o[i](),a.abort(),n&&(m||u.forEach((t=>t())),t.nextTick(r,m,C))}}for(let B=0;B<n.length;B++){const F=n[B],U=B<n.length-1,W=B>0,q=U||!1!==(null==o?void 0:o.end),G=B===n.length-1;if(k(F)){if(q){const{destroy:K,cleanup:Q}=T(F,U,W);$.push(K),y(F)&&G&&u.push(Q)}function Z(t){t&&"AbortError"!==t.name&&"ERR_STREAM_PREMATURE_CLOSE"!==t.code&&V(t)}F.on("error",Z),y(F)&&G&&u.push((()=>{F.removeListener("error",Z)}))}if(0===B)if("function"==typeof F){if(R=F({signal:s}),!w(R))throw new h("Iterable, AsyncIterable or Stream","source",R)}else R=w(F)||_(F)||x(F)?F:l.from(F);else if("function"==typeof F){var D;if(R=x(R)?A(null===(D=R)||void 0===D?void 0:D.readable):A(R),R=F(R,{signal:s}),U){if(!w(R,!0))throw new h("AsyncIterable",`transform[${B-1}]`,R)}else{var H;L||(L=ri());const X=new L({objectMode:!0}),Y=null===(H=R)||void 0===H?void 0:H.then;if("function"==typeof Y)P++,Y.call(R,(e=>{C=e,null!=e&&X.write(e),q&&X.end(),t.nextTick(V)}),(e=>{X.destroy(e),t.nextTick(V,e)}));else if(w(R,!0))P++,z(R,X,V,{end:q});else{if(!E(R)&&!x(R))throw new h("AsyncIterable or Promise","destination",R);P++,z(R.readable||R,X,V,{end:q})}R=X;const{destroy:J,cleanup:tt}=T(R,!1,!0);$.push(J),G&&u.push(tt)}}else if(k(F)){if(_(R)){P+=2;const et=O(R,F,V,{end:q});y(F)&&G&&u.push(et)}else if(x(R)||E(R))P++,z(R.readable||R,F,V,{end:q});else{if(!w(R))throw new d("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],R);P++,z(R,F,V,{end:q})}R=F}else if(S(F)){if(_(R))P++,I(A(R),F,V,{end:q});else if(E(R)||w(R))P++,I(R,F,V,{end:q});else{if(!x(R))throw new d("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],R);P++,I(R.readable,F,V,{end:q})}R=F}else R=l.from(F)}return(null!=s&&s.aborted||null!=c&&c.aborted)&&t.nextTick(p),R}function O(e,n,r,{end:i}){let a=!1;if(n.on("close",(()=>{a||r(new g)})),e.pipe(n,{end:!1}),i){function s(){a=!0,n.end()}C(e)?t.nextTick(s):e.once("end",s)}else r();return o(e,{readable:!0,writable:!1},(t=>{const n=e._readableState;t&&"ERR_STREAM_PREMATURE_CLOSE"===t.code&&n&&n.ended&&!n.errored&&!n.errorEmitted?e.once("end",r).once("error",r):r(t)})),o(n,{readable:!1,writable:!0},r)}return Pr={pipelineImpl:R,pipeline:function(...t){return R(t,a(function(t){return m(t[t.length-1],"streams[stream.length - 1]"),t.pop()}(t)))}}}function oi(){if(Dr)return jr;Dr=1;const{pipeline:t}=ii(),e=ei(),{destroyer:n}=vr(),{isNodeStream:r,isReadable:i,isWritable:o,isWebStream:a,isTransformStream:s,isWritableStream:l,isReadableStream:c}=pr(),{AbortError:u,codes:{ERR_INVALID_ARG_VALUE:d,ERR_MISSING_ARGS:h}}=Qn(),f=gr();return jr=function(...p){if(0===p.length)throw new h("streams");if(1===p.length)return e.from(p[0]);const g=[...p];if("function"==typeof p[0]&&(p[0]=e.from(p[0])),"function"==typeof p[p.length-1]){const t=p.length-1;p[t]=e.from(p[t])}for(let t=0;t<p.length;++t)if(r(p[t])||a(p[t])){if(t<p.length-1&&!(i(p[t])||c(p[t])||s(p[t])))throw new d(`streams[${t}]`,g[t],"must be readable");if(t>0&&!(o(p[t])||l(p[t])||s(p[t])))throw new d(`streams[${t}]`,g[t],"must be writable")}let v,m,b,w,y;const _=p[0],k=t(p,(function(t){const e=w;w=null,e?e(t):t?y.destroy(t):S||x||y.destroy()})),x=!!(o(_)||l(_)||s(_)),S=!!(i(k)||c(k)||s(k));if(y=new e({writableObjectMode:!(null==_||!_.writableObjectMode),readableObjectMode:!(null==k||!k.readableObjectMode),writable:x,readable:S}),x){if(r(_))y._write=function(t,e,n){_.write(t,e)?n():v=n},y._final=function(t){_.end(),m=t},_.on("drain",(function(){if(v){const t=v;v=null,t()}}));else if(a(_)){const t=(s(_)?_.writable:_).getWriter();y._write=async function(e,n,r){try{await t.ready,t.write(e).catch((()=>{})),r()}catch(t){r(t)}},y._final=async function(e){try{await t.ready,t.close().catch((()=>{})),m=e}catch(t){e(t)}}}const t=s(k)?k.readable:k;f(t,(()=>{if(m){const t=m;m=null,t()}}))}if(S)if(r(k))k.on("readable",(function(){if(b){const t=b;b=null,t()}})),k.on("end",(function(){y.push(null)})),y._read=function(){for(;;){const t=k.read();if(null===t)return void(b=y._read);if(!y.push(t))return}};else if(a(k)){const t=(s(k)?k.readable:k).getReader();y._read=async function(){for(;;)try{const{value:e,done:n}=await t.read();if(!y.push(e))return;if(n)return void y.push(null)}catch{return}}}return y._destroy=function(t,e){t||null===w||(t=new u),b=null,v=null,m=null,null===w?e(t):(w=e,r(k)&&n(k,t))},y},jr}function ai(){if(Fr)return Br;Fr=1;const{ArrayPrototypePop:t,Promise:e}=Fn(),{isIterable:n,isNodeStream:r,isWebStream:i}=pr(),{pipelineImpl:o}=ii(),{finished:a}=gr();return si(),Br={finished:a,pipeline:function(...a){return new e(((e,s)=>{let l,c;const u=a[a.length-1];if(u&&"object"==typeof u&&!r(u)&&!n(u)&&!i(u)){const e=t(a);l=e.signal,c=e.end}o(a,((t,n)=>{t?s(t):e(n)}),{signal:l,end:c})}))}}}function si(){if(Ur)return Bn.exports;Ur=1;const{Buffer:t}=Zt,{ObjectDefineProperty:e,ObjectKeys:n,ReflectApply:r}=Fn(),{promisify:{custom:i}}=er(),{streamReturningOperators:o,promiseReturningOperators:a}=function(){if(Hr)return ir;Hr=1;const t=globalThis.AbortController||tr().AbortController,{codes:{ERR_INVALID_ARG_VALUE:e,ERR_INVALID_ARG_TYPE:n,ERR_MISSING_ARGS:r,ERR_OUT_OF_RANGE:i},AbortError:o}=Qn(),{validateAbortSignal:a,validateInteger:s,validateObject:l}=or(),c=Fn().Symbol("kWeak"),u=Fn().Symbol("kResistStopPropagation"),{finished:d}=gr(),h=oi(),{addAbortSignalNoValidate:f}=Zr(),{isWritable:p,isNodeStream:g}=pr(),{deprecate:v}=er(),{ArrayPrototypePush:m,Boolean:b,MathFloor:w,Number:y,NumberIsNaN:_,Promise:k,PromiseReject:x,PromiseResolve:S,PromisePrototypeThen:E,Symbol:C}=Fn(),M=C("kEmpty"),L=C("kEof");function $(t,e){if("function"!=typeof t)throw new n("fn",["Function","AsyncFunction"],t);null!=e&&l(e,"options"),null!=(null==e?void 0:e.signal)&&a(e.signal,"options.signal");let r=1;null!=(null==e?void 0:e.concurrency)&&(r=w(e.concurrency));let i=r-1;return null!=(null==e?void 0:e.highWaterMark)&&(i=w(e.highWaterMark)),s(r,"options.concurrency",1),s(i,"options.highWaterMark",0),i+=r,async function*(){const n=er().AbortSignalAny([null==e?void 0:e.signal].filter(b)),a=this,s=[],l={signal:n};let c,u,d=!1,h=0;function f(){d=!0,p()}function p(){h-=1,g()}function g(){u&&!d&&h<r&&s.length<i&&(u(),u=null)}!async function(){try{for await(let e of a){if(d)return;if(n.aborted)throw new o;try{if(e=t(e,l),e===M)continue;e=S(e)}catch(t){e=x(t)}h+=1,E(e,p,f),s.push(e),c&&(c(),c=null),!d&&(s.length>=i||h>=r)&&await new k((t=>{u=t}))}s.push(L)}catch(t){const e=x(t);E(e,p,f),s.push(e)}finally{d=!0,c&&(c(),c=null)}}();try{for(;;){for(;s.length>0;){const t=await s[0];if(t===L)return;if(n.aborted)throw new o;t!==M&&(yield t),s.shift(),g()}await new k((t=>{c=t}))}}finally{d=!0,u&&(u(),u=null)}}.call(this)}async function N(t,e){for await(const n of T.call(this,t,e))return!0;return!1}function T(t,e){if("function"!=typeof t)throw new n("fn",["Function","AsyncFunction"],t);return $.call(this,(async function(e,n){return await t(e,n)?e:M}),e)}class A extends r{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}}function z(t){if(t=y(t),_(t))return 0;if(t<0)throw new i("number",">= 0",t);return t}return ir.streamReturningOperators={asIndexedPairs:v((function(t){return null!=t&&l(t,"options"),null!=(null==t?void 0:t.signal)&&a(t.signal,"options.signal"),async function*(){let e=0;for await(const r of this){var n;if(null!=t&&null!==(n=t.signal)&&void 0!==n&&n.aborted)throw new o({cause:t.signal.reason});yield[e++,r]}}.call(this)}),"readable.asIndexedPairs will be removed in a future version."),drop:function(t,e){return null!=e&&l(e,"options"),null!=(null==e?void 0:e.signal)&&a(e.signal,"options.signal"),t=z(t),async function*(){var n;if(null!=e&&null!==(n=e.signal)&&void 0!==n&&n.aborted)throw new o;for await(const n of this){var r;if(null!=e&&null!==(r=e.signal)&&void 0!==r&&r.aborted)throw new o;t--<=0&&(yield n)}}.call(this)},filter:T,flatMap:function(t,e){const n=$.call(this,t,e);return async function*(){for await(const t of n)yield*t}.call(this)},map:$,take:function(t,e){return null!=e&&l(e,"options"),null!=(null==e?void 0:e.signal)&&a(e.signal,"options.signal"),t=z(t),async function*(){var n;if(null!=e&&null!==(n=e.signal)&&void 0!==n&&n.aborted)throw new o;for await(const n of this){var r;if(null!=e&&null!==(r=e.signal)&&void 0!==r&&r.aborted)throw new o;if(t-- >0&&(yield n),t<=0)return}}.call(this)},compose:function(t,n){if(null!=n&&l(n,"options"),null!=(null==n?void 0:n.signal)&&a(n.signal,"options.signal"),g(t)&&!p(t))throw new e("stream",t,"must be writable");const r=h(this,t);return null!=n&&n.signal&&f(n.signal,r),r}},ir.promiseReturningOperators={every:async function(t,e){if("function"!=typeof t)throw new n("fn",["Function","AsyncFunction"],t);return!await N.call(this,(async(...e)=>!await t(...e)),e)},forEach:async function(t,e){if("function"!=typeof t)throw new n("fn",["Function","AsyncFunction"],t);for await(const n of $.call(this,(async function(e,n){return await t(e,n),M}),e));},reduce:async function(e,r,i){var s;if("function"!=typeof e)throw new n("reducer",["Function","AsyncFunction"],e);null!=i&&l(i,"options"),null!=(null==i?void 0:i.signal)&&a(i.signal,"options.signal");let h=arguments.length>1;if(null!=i&&null!==(s=i.signal)&&void 0!==s&&s.aborted){const t=new o(void 0,{cause:i.signal.reason});throw this.once("error",(()=>{})),await d(this.destroy(t)),t}const f=new t,p=f.signal;null!=i&&i.signal&&i.signal.addEventListener("abort",(()=>f.abort()),{once:!0,[c]:this,[u]:!0});let g=!1;try{for await(const t of this){var v;if(g=!0,null!=i&&null!==(v=i.signal)&&void 0!==v&&v.aborted)throw new o;h?r=await e(r,t,{signal:p}):(r=t,h=!0)}if(!g&&!h)throw new A}finally{f.abort()}return r},toArray:async function(t){null!=t&&l(t,"options"),null!=(null==t?void 0:t.signal)&&a(t.signal,"options.signal");const e=[];for await(const r of this){var n;if(null!=t&&null!==(n=t.signal)&&void 0!==n&&n.aborted)throw new o(void 0,{cause:t.signal.reason});m(e,r)}return e},some:N,find:async function(t,e){for await(const n of T.call(this,t,e))return n}},ir}(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:s}}=Qn(),l=oi(),{setDefaultHighWaterMark:c,getDefaultHighWaterMark:u}=Qr(),{pipeline:d}=ii(),{destroyer:h}=vr(),f=gr(),p=ai(),g=pr(),v=Bn.exports=mr().Stream;v.isDestroyed=g.isDestroyed,v.isDisturbed=g.isDisturbed,v.isErrored=g.isErrored,v.isReadable=g.isReadable,v.isWritable=g.isWritable,v.Readable=Yr();for(const b of n(o)){const w=o[b];function y(...t){if(new.target)throw s();return v.Readable.from(r(w,this,t))}e(y,"name",{__proto__:null,value:w.name}),e(y,"length",{__proto__:null,value:w.length}),e(v.Readable.prototype,b,{__proto__:null,value:y,enumerable:!1,configurable:!0,writable:!0})}for(const _ of n(a)){const k=a[_];function x(...t){if(new.target)throw s();return r(k,this,t)}e(x,"name",{__proto__:null,value:k.name}),e(x,"length",{__proto__:null,value:k.length}),e(v.Readable.prototype,_,{__proto__:null,value:x,enumerable:!1,configurable:!0,writable:!0})}v.Writable=Jr(),v.Duplex=ei(),v.Transform=ni(),v.PassThrough=ri(),v.pipeline=d;const{addAbortSignal:m}=Zr();return v.addAbortSignal=m,v.finished=f,v.destroy=h,v.compose=l,v.setDefaultHighWaterMark=c,v.getDefaultHighWaterMark=u,e(v,"promises",{__proto__:null,configurable:!0,enumerable:!0,get:()=>p}),e(d,i,{__proto__:null,enumerable:!0,get:()=>p.pipeline}),e(f,i,{__proto__:null,enumerable:!0,get:()=>p.finished}),v.Stream=v,v._isUint8Array=function(t){return t instanceof Uint8Array},v._uint8ArrayToBuffer=function(e){return t.from(e.buffer,e.byteOffset,e.byteLength)},Bn.exports}function li(){return Wr||(Wr=1,function(t){const e=Hn;if(e&&"disable"===f.env.READABLE_STREAM){const n=e.promises;t.exports._uint8ArrayToBuffer=e._uint8ArrayToBuffer,t.exports._isUint8Array=e._isUint8Array,t.exports.isDisturbed=e.isDisturbed,t.exports.isErrored=e.isErrored,t.exports.isReadable=e.isReadable,t.exports.Readable=e.Readable,t.exports.Writable=e.Writable,t.exports.Duplex=e.Duplex,t.exports.Transform=e.Transform,t.exports.PassThrough=e.PassThrough,t.exports.addAbortSignal=e.addAbortSignal,t.exports.finished=e.finished,t.exports.destroy=e.destroy,t.exports.pipeline=e.pipeline,t.exports.compose=e.compose,Object.defineProperty(e,"promises",{configurable:!0,enumerable:!0,get:()=>n}),t.exports.Stream=e.Stream}else{const e=si(),n=ai(),r=e.Readable.destroy;t.exports=e.Readable,t.exports._uint8ArrayToBuffer=e._uint8ArrayToBuffer,t.exports._isUint8Array=e._isUint8Array,t.exports.isDisturbed=e.isDisturbed,t.exports.isErrored=e.isErrored,t.exports.isReadable=e.isReadable,t.exports.Readable=e.Readable,t.exports.Writable=e.Writable,t.exports.Duplex=e.Duplex,t.exports.Transform=e.Transform,t.exports.PassThrough=e.PassThrough,t.exports.addAbortSignal=e.addAbortSignal,t.exports.finished=e.finished,t.exports.destroy=e.destroy,t.exports.destroy=r,t.exports.pipeline=e.pipeline,t.exports.compose=e.compose,Object.defineProperty(e,"promises",{configurable:!0,enumerable:!0,get:()=>n}),t.exports.Stream=e.Stream}t.exports.default=t.exports}(be)),be.exports}function ci(){if(qr)return me;qr=1,Object.defineProperty(me,"__esModule",{value:!0}),me.default=me.N3EntityIndex=void 0;var t=li(),e=function(t){if("function"==typeof WeakMap){var e=new WeakMap;new WeakMap}return function(t){if(t&&t.__esModule)return t;var n,r,i={__proto__:null,default:t};if(null===t||"object"!=typeof t&&"function"!=typeof t)return i;if(n=e){if(n.has(t))return n.get(t);n.set(t,i)}for(const e in t)"default"!==e&&{}.hasOwnProperty.call(t,e)&&((r=(n=Object.defineProperty)&&Object.getOwnPropertyDescriptor(t,e))&&(r.get||r.set)?n(i,e,r):i[e]=t[e]);return i}(t)}(ne()),n=o(Qt()),r=se(),i=o(ge());function o(t){return t&&t.__esModule?t:{default:t}}const a=Symbol("iter");function s(t,e,n=4){if(0===n)return Object.assign(t,e);for(const r in e)t[r]=s(t[r]||Object.create(null),e[r],n-1);return t}function l(t,e,n=4){let r=!1;for(const i in t)if(i in e){const o=0===n?null:l(t[i],e[i],n-1);if(!1!==o)r=r||Object.create(null),r[i]=o;else if(3===n)return!1}return r}function c(t,e,n=4){let r=!1;for(const i in t)if(i in e){if(0!==n){const o=c(t[i],e[i],n-1);if(!1!==o)r=r||Object.create(null),r[i]=o;else if(3===n)return!1}}else r=r||Object.create(null),r[i]=0===n?null:s({},t[i],n-1);return r}class u{constructor(t={}){this._id=1,this._ids=Object.create(null),this._ids[""]=1,this._entities=Object.create(null),this._entities[1]="",this._blankNodeIndex=0,this._factory=t.factory||e.default}_termFromId(t){if("."===t[0]){const e=this._entities,n=t.split(".");return this._factory.quad(this._termFromId(e[n[1]]),this._termFromId(e[n[2]]),this._termFromId(e[n[3]]),n[4]&&this._termFromId(e[n[4]]))}return(0,e.termFromId)(t,this._factory)}_termToNumericId(t){if("Quad"===t.termType){const e=this._termToNumericId(t.subject),n=this._termToNumericId(t.predicate),i=this._termToNumericId(t.object);let o;return e&&n&&i&&((0,r.isDefaultGraph)(t.graph)||(o=this._termToNumericId(t.graph)))&&this._ids[o?`.${e}.${n}.${i}.${o}`:`.${e}.${n}.${i}`]}return this._ids[(0,e.termToId)(t)]}_termToNewNumericId(t){const n=t&&"Quad"===t.termType?`.${this._termToNewNumericId(t.subject)}.${this._termToNewNumericId(t.predicate)}.${this._termToNewNumericId(t.object)}${(0,r.isDefaultGraph)(t.graph)?"":`.${this._termToNewNumericId(t.graph)}`}`:(0,e.termToId)(t);return this._ids[n]||(this._ids[this._entities[++this._id]=n]=this._id)}createBlankNode(t){let e,n;if(t)for(e=t=`_:${t}`,n=1;this._ids[e];)e=t+n++;else do{e="_:b"+this._blankNodeIndex++}while(this._ids[e]);return this._ids[e]=++this._id,this._entities[this._id]=e,this._factory.blankNode(e.substr(2))}}me.N3EntityIndex=u;let d=class r{constructor(t,n){this._size=0,this._graphs=Object.create(null),n||!t||t[0]||"function"==typeof t.match||(n=t,t=null),this._factory=(n=n||{}).factory||e.default,this._entityIndex=n.entityIndex||new u({factory:this._factory}),this._entities=this._entityIndex._entities,this._termFromId=this._entityIndex._termFromId.bind(this._entityIndex),this._termToNumericId=this._entityIndex._termToNumericId.bind(this._entityIndex),this._termToNewNumericId=this._entityIndex._termToNewNumericId.bind(this._entityIndex),t&&this.addAll(t)}get size(){let t=this._size;if(null!==t)return t;t=0;const e=this._graphs;let n,r;for(const i in e)for(const o in n=e[i].subjects)for(const e in r=n[o])t+=Object.keys(r[e]).length;return this._size=t}_addToIndex(t,e,n,r){const i=t[e]||(t[e]={}),o=i[n]||(i[n]={}),a=r in o;return a||(o[r]=null),!a}_removeFromIndex(t,e,n,r){const i=t[e],o=i[n];delete o[r];for(const t in o)return;delete i[n];for(const t in i)return;delete t[e]}*_findInIndex(t,e,n,r,i,o,a,s){let l,c,u;const d=this._entities,h=this._termFromId(d[s]),f={subject:null,predicate:null,object:null};e&&((l=t,t={})[e]=l[e]);for(const e in t)if(c=t[e]){f[i]=this._termFromId(d[e]),n&&((l=c,c={})[n]=l[n]);for(const t in c)if(u=c[t]){f[o]=this._termFromId(d[t]);const e=r?r in u?[r]:[]:Object.keys(u);for(let t=0;t<e.length;t++)f[a]=this._termFromId(d[e[t]]),yield this._factory.quad(f.subject,f.predicate,f.object,h)}}}_loop(t,e){for(const n in t)e(n)}_loopByKey0(t,e,n){let r,i;if(r=t[e])for(i in r)n(i)}_loopByKey1(t,e,n){let r,i;for(r in t)i=t[r],i[e]&&n(r)}_loopBy2Keys(t,e,n,r){let i,o,a;if((i=t[e])&&(o=i[n]))for(a in o)r(a)}_countInIndex(t,e,n,r){let i,o,a,s=0;e&&((i=t,t={})[e]=i[e]);for(const e in t)if(o=t[e]){n&&((i=o,o={})[n]=i[n]);for(const t in o)(a=o[t])&&(r?r in a&&s++:s+=Object.keys(a).length)}return s}_getGraphs(t){return"number"!=typeof(t=""===t?1:t&&(this._termToNumericId(t)||-1))?this._graphs:{[t]:this._graphs[t]}}_uniqueEntities(t){const e=Object.create(null);return n=>{n in e||(e[n]=!0,t(this._termFromId(this._entities[n],this._factory)))}}add(t){return this.addQuad(t),this}addQuad(t,e,n,r){e||(r=t.graph,n=t.object,e=t.predicate,t=t.subject),r=r?this._termToNewNumericId(r):1;let i=this._graphs[r];return i||(i=this._graphs[r]={subjects:{},predicates:{},objects:{}},Object.freeze(i)),t=this._termToNewNumericId(t),e=this._termToNewNumericId(e),n=this._termToNewNumericId(n),!!this._addToIndex(i.subjects,t,e,n)&&(this._addToIndex(i.predicates,e,n,t),this._addToIndex(i.objects,n,t,e),this._size=null,!0)}addQuads(t){for(let e=0;e<t.length;e++)this.addQuad(t[e])}delete(t){return this.removeQuad(t),this}has(t,e,n,r){return t&&t.subject&&({subject:t,predicate:e,object:n,graph:r}=t),!this.readQuads(t,e,n,r).next().done}import(t){return t.on("data",(t=>{this.addQuad(t)})),t}removeQuad(t,e,n,r){e||({subject:t,predicate:e,object:n,graph:r}=t),r=r?this._termToNumericId(r):1;const i=this._graphs;let o,a,s;if(!((t=t&&this._termToNumericId(t))&&(e=e&&this._termToNumericId(e))&&(n=n&&this._termToNumericId(n))&&(o=i[r])&&(a=o.subjects[t])&&(s=a[e])&&n in s))return!1;for(t in this._removeFromIndex(o.subjects,t,e,n),this._removeFromIndex(o.predicates,e,n,t),this._removeFromIndex(o.objects,n,t,e),null!==this._size&&this._size--,o.subjects)return!0;return delete i[r],!0}removeQuads(t){for(let e=0;e<t.length;e++)this.removeQuad(t[e])}remove(t){return t.on("data",(t=>{this.removeQuad(t)})),t}removeMatches(e,n,r,i){const o=new t.Readable({objectMode:!0}),a=this.readQuads(e,n,r,i);return o._read=t=>{for(;--t>=0;){const{done:t,value:e}=a.next();if(t)return void o.push(null);o.push(e)}},this.remove(o)}deleteGraph(t){return this.removeMatches(null,null,null,t)}getQuads(t,e,n,r){return[...this.readQuads(t,e,n,r)]}*readQuads(t,e,n,r){const i=this._getGraphs(r);let o,a,s,l;if(!(t&&!(a=this._termToNumericId(t))||e&&!(s=this._termToNumericId(e))||n&&!(l=this._termToNumericId(n))))for(const t in i)(o=i[t])&&(a?l?yield*this._findInIndex(o.objects,l,a,s,"object","subject","predicate",t):yield*this._findInIndex(o.subjects,a,s,null,"subject","predicate","object",t):s?yield*this._findInIndex(o.predicates,s,l,null,"predicate","object","subject",t):l?yield*this._findInIndex(o.objects,l,null,null,"object","subject","predicate",t):yield*this._findInIndex(o.subjects,null,null,null,"subject","predicate","object",t))}match(t,e,n,r){return new f(this,t,e,n,r,{entityIndex:this._entityIndex})}countQuads(t,e,n,r){const i=this._getGraphs(r);let o,a,s,l,c=0;if(t&&!(a=this._termToNumericId(t))||e&&!(s=this._termToNumericId(e))||n&&!(l=this._termToNumericId(n)))return 0;for(const r in i)(o=i[r])&&(c+=t?n?this._countInIndex(o.objects,l,a,s):this._countInIndex(o.subjects,a,s,l):e?this._countInIndex(o.predicates,s,l,a):this._countInIndex(o.objects,l,a,s));return c}forEach(t,e,n,r,i){this.some((e=>(t(e,this),!1)),e,n,r,i)}every(t,e,n,r,i){return!this.some((e=>!t(e,this)),e,n,r,i)}some(t,e,n,r,i){for(const o of this.readQuads(e,n,r,i))if(t(o,this))return!0;return!1}getSubjects(t,e,n){const r=[];return this.forSubjects((t=>{r.push(t)}),t,e,n),r}forSubjects(t,e,n,r){const i=this._getGraphs(r);let o,a,s;if(t=this._uniqueEntities(t),!(e&&!(a=this._termToNumericId(e))||n&&!(s=this._termToNumericId(n))))for(r in i)(o=i[r])&&(a?s?this._loopBy2Keys(o.predicates,a,s,t):this._loopByKey1(o.subjects,a,t):s?this._loopByKey0(o.objects,s,t):this._loop(o.subjects,t))}getPredicates(t,e,n){const r=[];return this.forPredicates((t=>{r.push(t)}),t,e,n),r}forPredicates(t,e,n,r){const i=this._getGraphs(r);let o,a,s;if(t=this._uniqueEntities(t),!(e&&!(a=this._termToNumericId(e))||n&&!(s=this._termToNumericId(n))))for(r in i)(o=i[r])&&(a?s?this._loopBy2Keys(o.objects,s,a,t):this._loopByKey0(o.subjects,a,t):s?this._loopByKey1(o.predicates,s,t):this._loop(o.predicates,t))}getObjects(t,e,n){const r=[];return this.forObjects((t=>{r.push(t)}),t,e,n),r}forObjects(t,e,n,r){const i=this._getGraphs(r);let o,a,s;if(t=this._uniqueEntities(t),!(e&&!(a=this._termToNumericId(e))||n&&!(s=this._termToNumericId(n))))for(r in i)(o=i[r])&&(a?s?this._loopBy2Keys(o.subjects,a,s,t):this._loopByKey1(o.objects,a,t):s?this._loopByKey0(o.predicates,s,t):this._loop(o.objects,t))}getGraphs(t,e,n){const r=[];return this.forGraphs((t=>{r.push(t)}),t,e,n),r}forGraphs(t,e,n,r){for(const i in this._graphs)this.some((e=>(t(e.graph),!0)),e,n,r,this._termFromId(this._entities[i]))}createBlankNode(t){return this._entityIndex.createBlankNode(t)}extractLists({remove:t=!1,ignoreErrors:e=!1}={}){const r={},i=e?()=>!0:(t,e)=>{throw new Error(`${t.value} ${e}`)},o=this.getQuads(null,n.default.rdf.rest,n.default.rdf.nil,null),a=t?[...o]:[];return o.forEach((e=>{const o=[];let s,l,c=!1;const u=e.graph;let d=e.subject;for(;d&&!c;){const t=this.getQuads(null,null,d,null),e=this.getQuads(d,null,null,null);let r,h=null,f=null,p=null;for(let o=0;o<e.length&&!c;o++)r=e[o],r.graph.equals(u)?s?c=i(d,"has non-list arcs out"):r.predicate.value===n.default.rdf.first?h?c=i(d,"has multiple rdf:first arcs"):a.push(h=r):r.predicate.value===n.default.rdf.rest?f?c=i(d,"has multiple rdf:rest arcs"):a.push(f=r):t.length?c=i(d,"can't be subject and object"):(s=r,l="subject"):c=i(d,"not confined to single graph");for(let e=0;e<t.length&&!c;++e)r=t[e],s?c=i(d,"can't have coreferences"):r.predicate.value===n.default.rdf.rest?p?c=i(d,"has incoming rdf:rest arcs"):p=r:(s=r,l="object");h?o.unshift(h.object):c=i(d,"has no list head"),d=p&&p.subject}c?t=!1:s&&(r[s[l].value]=o)})),t&&this.removeQuads(a),r}addAll(t){if(t instanceof f&&(t=t.filtered),Array.isArray(t))this.addQuads(t);else if(t instanceof r&&t._entityIndex===this._entityIndex)0!==t._size&&(this._graphs=s(this._graphs,t._graphs),this._size=null);else for(const e of t)this.add(e);return this}contains(t){if(t instanceof f&&(t=t.filtered),t===this)return!0;if(!(t instanceof r)||this._entityIndex!==t._entityIndex)return t.every((t=>this.has(t)));const e=this._graphs,n=t._graphs;let i,o,a,s,l;for(const t in n){if(!(i=e[t]))return!1;i=i.subjects;for(const e in o=n[t].subjects){if(!(a=i[e]))return!1;for(const t in s=o[e]){if(!(l=a[t]))return!1;for(const e in s[t])if(!(e in l))return!1}}}return!0}deleteMatches(t,e,n,r){for(const i of this.match(t,e,n,r))this.removeQuad(i);return this}difference(t){if(t&&t instanceof f&&(t=t.filtered),t===this)return new r({entityIndex:this._entityIndex});if(t instanceof r&&t._entityIndex===this._entityIndex){const e=new r({entityIndex:this._entityIndex}),n=c(this._graphs,t._graphs);return n&&(e._graphs=n,e._size=null),e}return this.filter((e=>!t.has(e)))}equals(t){return t instanceof f&&(t=t.filtered),t===this||this.size===t.size&&this.contains(t)}filter(t){const e=new r({entityIndex:this._entityIndex});for(const n of this)t(n,this)&&e.add(n);return e}intersection(t){if(t instanceof f&&(t=t.filtered),t===this){const t=new r({entityIndex:this._entityIndex});return t._graphs=s(Object.create(null),this._graphs),t._size=this._size,t}if(t instanceof r&&this._entityIndex===t._entityIndex){const e=new r({entityIndex:this._entityIndex}),n=l(t._graphs,this._graphs);return n&&(e._graphs=n,e._size=null),e}return this.filter((e=>t.has(e)))}map(t){const e=new r({entityIndex:this._entityIndex});for(const n of this)e.add(t(n,this));return e}reduce(t,e){const n=this.readQuads();let r=void 0===e?n.next().value:e;for(const e of n)r=t(r,e,this);return r}toArray(){return this.getQuads()}toCanonical(){throw new Error("not implemented")}toStream(){return this.match()}toString(){return(new i.default).quadsToString(this)}union(t){const e=new r({entityIndex:this._entityIndex});return e._graphs=s(Object.create(null),this._graphs),e._size=this._size,e.addAll(t),e}*[Symbol.iterator](){yield*this.readQuads()}};function h(t,e,n=0){const r=e[n];if(r&&!(r in t))return!1;let i=!1;for(const o in r?{[r]:t[r]}:t){const r=2===n?null:h(t[o],e,n+1);!1!==r&&(i=i||Object.create(null),i[o]=r)}return i}me.default=d;class f extends t.Readable{constructor(t,e,n,r,i,o){super({objectMode:!0}),Object.assign(this,{n3Store:t,subject:e,predicate:n,object:r,graph:i,options:o})}get filtered(){if(!this._filtered){const{n3Store:t,graph:e,object:n,predicate:r,subject:i}=this,o=this._filtered=new d({factory:t._factory,entityIndex:this.options.entityIndex});let a,s,l;if(i&&!(a=o._termToNumericId(i))||r&&!(s=o._termToNumericId(r))||n&&!(l=o._termToNumericId(n)))return o;const c=t._getGraphs(e);for(const t in c){let e,n,r,i;(i=c[t])&&(!a&&s?(n=h(i.predicates,[s,l,a]))&&(e=h(i.subjects,[a,s,l]),r=h(i.objects,[l,a,s])):l?(r=h(i.objects,[l,a,s]))&&(e=h(i.subjects,[a,s,l]),n=h(i.predicates,[s,l,a])):(e=h(i.subjects,[a,s,l]))&&(n=h(i.predicates,[s,l,a]),r=h(i.objects,[l,a,s])),e&&(o._graphs[t]={subjects:e,predicates:n,objects:r}))}o._size=null}return this._filtered}get size(){return this.filtered.size}_read(t){t>0&&!this[a]&&(this[a]=this[Symbol.iterator]());const e=this[a];for(;--t>=0;){const{done:t,value:n}=e.next();if(t)return void this.push(null);this.push(n)}}addAll(t){return this.filtered.addAll(t)}contains(t){return this.filtered.contains(t)}deleteMatches(t,e,n,r){return this.filtered.deleteMatches(t,e,n,r)}difference(t){return this.filtered.difference(t)}equals(t){return this.filtered.equals(t)}every(t,e,n,r,i){return this.filtered.every(t,e,n,r,i)}filter(t){return this.filtered.filter(t)}forEach(t,e,n,r,i){return this.filtered.forEach(t,e,n,r,i)}import(t){return this.filtered.import(t)}intersection(t){return this.filtered.intersection(t)}map(t){return this.filtered.map(t)}some(t,e,n,r,i){return this.filtered.some(t,e,n,r,i)}toCanonical(){return this.filtered.toCanonical()}toStream(){return this._filtered?this._filtered.toStream():this.n3Store.match(this.subject,this.predicate,this.object,this.graph)}union(t){return this._filtered?this._filtered.union(t):this.n3Store.match(this.subject,this.predicate,this.object,this.graph).addAll(t)}toArray(){return this._filtered?this._filtered.toArray():this.n3Store.getQuads(this.subject,this.predicate,this.object,this.graph)}reduce(t,e){return this.filtered.reduce(t,e)}toString(){return(new i.default).quadsToString(this)}add(t){return this.filtered.add(t)}delete(t){return this.filtered.delete(t)}has(t){return this.filtered.has(t)}match(t,e,n,r){return new f(this.filtered,t,e,n,r,this.options)}*[Symbol.iterator](){yield*this._filtered||this.n3Store.readQuads(this.subject,this.predicate,this.object,this.graph)}}return me}var ui,di,hi,fi,pi,gi={},vi={},mi={},bi={},wi=(pi||(pi=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"BaseIRI",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(t,"BlankNode",{enumerable:!0,get:function(){return d.BlankNode}}),Object.defineProperty(t,"DataFactory",{enumerable:!0,get:function(){return d.default}}),Object.defineProperty(t,"DefaultGraph",{enumerable:!0,get:function(){return d.DefaultGraph}}),Object.defineProperty(t,"EntityIndex",{enumerable:!0,get:function(){return i.N3EntityIndex}}),Object.defineProperty(t,"Lexer",{enumerable:!0,get:function(){return e.default}}),Object.defineProperty(t,"Literal",{enumerable:!0,get:function(){return d.Literal}}),Object.defineProperty(t,"NamedNode",{enumerable:!0,get:function(){return d.NamedNode}}),Object.defineProperty(t,"Parser",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(t,"Quad",{enumerable:!0,get:function(){return d.Quad}}),Object.defineProperty(t,"Reasoner",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"Store",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(t,"StoreFactory",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"StreamParser",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(t,"StreamWriter",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(t,"Term",{enumerable:!0,get:function(){return d.Term}}),Object.defineProperty(t,"Triple",{enumerable:!0,get:function(){return d.Triple}}),t.Util=void 0,Object.defineProperty(t,"Variable",{enumerable:!0,get:function(){return d.Variable}}),Object.defineProperty(t,"Writer",{enumerable:!0,get:function(){return r.default}}),t.default=void 0,Object.defineProperty(t,"getRulesFromDataset",{enumerable:!0,get:function(){return a.getRulesFromDataset}}),Object.defineProperty(t,"termFromId",{enumerable:!0,get:function(){return d.termFromId}}),Object.defineProperty(t,"termToId",{enumerable:!0,get:function(){return d.termToId}});var e=f(Xt()),n=f(re()),r=f(ge()),i=h(ci()),o=f(function(){if(ui)return gi;ui=1,Object.defineProperty(gi,"__esModule",{value:!0}),gi.default=void 0;var t,e=(t=ci())&&t.__esModule?t:{default:t};return gi.default=class{dataset(t){return new e.default(t)}},gi}()),a=h(function(){if(di)return vi;di=1,Object.defineProperty(vi,"__esModule",{value:!0}),vi.default=void 0,vi.getRulesFromDataset=n;var t,e=(t=ne())&&t.__esModule?t:{default:t};function n(t){const n=[];for(const{subject:r,object:i}of t.match(null,e.default.namedNode("http://www.w3.org/2000/10/swap/log#implies"),null,e.default.defaultGraph())){const e=[...t.match(null,null,null,r)],o=[...t.match(null,null,null,i)];n.push({premise:e,conclusion:o})}return n}function r({subject:t,predicate:e,object:n},r){const i=t.value||r.has(t)||(r.add(t),!1),o=e.value||r.has(e)||(r.add(e),!1),a=n.value||r.has(n)||(r.add(n),!1);return!i&&o?{content:"predicates",value:[e,n,t]}:a?{content:"objects",value:[n,t,e]}:{content:"subjects",value:[t,e,n]}}function i(t,e){return null===t.value&&(t.value=e.value),t.value===e.value}return vi.default=class{constructor(t){this._store=t}_add(t,e,n,r,i){this._store._addToIndex(r.subjects,t,e,n)&&(this._store._addToIndex(r.predicates,e,n,t),this._store._addToIndex(r.objects,n,t,e),i())}_evaluatePremise(t,e,n,r=0){let i,o,a,s,l;const[c,u,d]=t.premise[r].value,h=e[t.premise[r].content],f=!(a=c.value);for(a in f?h:{[a]:h[a]})if(s=h[a]){for(a in f&&(c.value=Number(a)),i=!(a=u.value),i?s:{[a]:s[a]})if(l=s[a]){for(a in i&&(u.value=Number(a)),o=!(a=d.value),o?l:{[a]:l[a]})o&&(d.value=Number(a)),r===t.premise.length-1?t.conclusion.forEach((t=>{this._add(t.subject.value,t.predicate.value,t.object.value,e,(()=>{n(t)}))})):this._evaluatePremise(t,e,n,r+1);o&&(d.value=null)}i&&(u.value=null)}f&&(c.value=null)}_evaluateRules(t,e,n){for(let r=0;r<t.length;r++)this._evaluatePremise(t[r],e,n)}_reasonGraphNaive(t,e){const n=[];function r(t){t.next&&t.next.forEach((e=>{n.push([t.subject.value,t.predicate.value,t.object.value,e])}))}const i=t=>{t.forEach((t=>{this._add(t.subject.value,t.predicate.value,t.object.value,e,(()=>{r(t)}))}))};let o;for(this._evaluateRules(t,e,r);void 0!==(o=n.pop());){const[t,n,a,s]=o,l=s.basePremise.subject.value;l||(s.basePremise.subject.value=t);const c=s.basePremise.predicate.value;c||(s.basePremise.predicate.value=n);const u=s.basePremise.object.value;u||(s.basePremise.object.value=a),0===s.premise.length?i(s.conclusion):this._evaluatePremise(s,e,r),l||(s.basePremise.subject.value=null),c||(s.basePremise.predicate.value=null),u||(s.basePremise.object.value=null)}}_createRule({premise:t,conclusion:e}){const n={},r=t=>"Variable"===t.termType?n[t.value]=n[t.value]||{}:{value:this._store._termToNewNumericId(t)},i=t=>({subject:r(t.subject),predicate:r(t.predicate),object:r(t.object)});return{premise:t.map((t=>i(t))),conclusion:e.map((t=>i(t))),variables:Object.values(n)}}reason(t){Array.isArray(t)||(t=n(t)),t=t.map((t=>this._createRule(t)));for(const e of t)for(const n of t)for(let t=0;t<n.premise.length;t++){const o=n.premise[t];for(const a of e.conclusion){if(i(o.subject,a.subject)&&i(o.predicate,a.predicate)&&i(o.object,a.object)){const e=new Set,i=[];o.subject.value=o.subject.value||1,o.object.value=o.object.value||1,o.predicate.value=o.predicate.value||1;for(let o=0;o<n.premise.length;o++)o!==t&&i.push(r(n.premise[o],e));(a.next=a.next||[]).push({premise:i,conclusion:n.conclusion,basePremise:o})}n.variables.forEach((t=>{t.value=null}))}}for(const e of t){const t=new Set;e.premise=e.premise.map((e=>r(e,t)))}const e=this._store._getGraphs();for(const n in e)this._reasonGraphNaive(t,e[n]);this._store._size=null}},vi}()),s=f(function(){if(hi)return mi;hi=1,Object.defineProperty(mi,"__esModule",{value:!0}),mi.default=void 0;var t,e=li(),n=(t=re())&&t.__esModule?t:{default:t};return mi.default=class extends e.Transform{constructor(t){super({decodeStrings:!0}),this._readableState.objectMode=!0;const e=new n.default(t);let r,i;const o={onQuad:(t,e)=>{t&&this.emit("error",t)||e&&this.push(e)},onPrefix:(t,e)=>{this.emit("prefix",t,e)}};t&&t.comments&&(o.onComment=t=>{this.emit("comment",t)}),e.parse({on:(t,e)=>{switch(t){case"data":r=e;break;case"end":i=e}}},o),this._transform=(t,e,n)=>{r(t),n()},this._flush=t=>{i(),t()}}import(t){return t.on("data",(t=>{this.write(t)})),t.on("end",(()=>{this.end()})),t.on("error",(t=>{this.emit("error",t)})),this}},mi}()),l=f(function(){if(fi)return bi;fi=1,Object.defineProperty(bi,"__esModule",{value:!0}),bi.default=void 0;var t,e=li(),n=(t=ge())&&t.__esModule?t:{default:t};return bi.default=class extends e.Transform{constructor(t){super({encoding:"utf8",writableObjectMode:!0});const e=this._writer=new n.default({write:(t,e,n)=>{this.push(t),n&&n()},end:t=>{this.push(null),t&&t()}},t);this._transform=(t,n,r)=>{e.addQuad(t,r)},this._flush=t=>{e.end(t)}}import(t){return t.on("data",(t=>{this.write(t)})),t.on("end",(()=>{this.end()})),t.on("error",(t=>{this.emit("error",t)})),t.on("prefix",((t,e)=>{this._writer.addPrefix(t,e)})),this}},bi}()),c=h(se());t.Util=c;var u=f(pe()),d=h(ne());function h(t,e){if("function"==typeof WeakMap)var n=new WeakMap,r=new WeakMap;return(h=function(t,e){if(!e&&t&&t.__esModule)return t;var i,o,a={__proto__:null,default:t};if(null===t||"object"!=typeof t&&"function"!=typeof t)return a;if(i=e?r:n){if(i.has(t))return i.get(t);i.set(t,a)}for(const e in t)"default"!==e&&{}.hasOwnProperty.call(t,e)&&((o=(i=Object.defineProperty)&&Object.getOwnPropertyDescriptor(t,e))&&(o.get||o.set)?i(a,e,o):a[e]=t[e]);return a})(t,e)}function f(t){return t&&t.__esModule?t:{default:t}}t.default={Lexer:e.default,Parser:n.default,Writer:r.default,Store:i.default,StoreFactory:o.default,EntityIndex:i.N3EntityIndex,StreamParser:s.default,StreamWriter:l.default,Util:c,Reasoner:a.default,BaseIRI:u.default,DataFactory:d.default,Term:d.Term,NamedNode:d.NamedNode,Literal:d.Literal,BlankNode:d.BlankNode,Variable:d.Variable,DefaultGraph:d.DefaultGraph,Quad:d.Quad,Triple:d.Triple,termFromId:d.termFromId,termToId:d.termToId}}(q)),q);function yi(t,e,n){let r=t.get(e);r||(r=[],t.set(e,r)),r.push(n)}function _i(t,e,n){let r=t.get(e);r||(r=new Set,t.set(e,r)),r.add(n)}function ki(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}class xi{mapping=new Map;ordered=[];reorder(t){this.ordered.sort(t)}get items(){return this.ordered}get(t){return this.mapping.get(t)}push(t,e){if(this.mapping.has(t)){const n=this.mapping.get(t);if(n===e)return;const r=this.ordered.indexOf(n);this.ordered.splice(r,1)}this.mapping.set(t,e),this.ordered.push(e)}delete(t){if(!this.mapping.has(t))return;const e=this.mapping.get(t),n=this.ordered.indexOf(e);return this.ordered.splice(n,1),this.mapping.delete(t),e}}var Si,Ei,Ci={exports:{}},Mi={},Li=(Ei||(Ei=1,Ci.exports=function(){if(Si)return Mi;Si=1;var t="function"==typeof Object.is?Object.is:function(t,e){return t===e&&(0!==t||1/t==1/e)||t!=t&&e!=e},e=S.useState,n=S.useEffect,r=S.useLayoutEffect,i=S.useDebugValue;function o(e){var n=e.getSnapshot;e=e.value;try{var r=n();return!t(e,r)}catch(t){return!0}}var a="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(t,e){return e()}:function(t,a){var s=a(),l=e({inst:{value:s,getSnapshot:a}}),c=l[0].inst,u=l[1];return r((function(){c.value=s,c.getSnapshot=a,o(c)&&u({inst:c})}),[t,s,a]),n((function(){return o(c)&&u({inst:c}),t((function(){o(c)&&u({inst:c})}))}),[t]),i(s),s};return Mi.useSyncExternalStore=void 0!==S.useSyncExternalStore?S.useSyncExternalStore:a,Mi}()),Ci.exports);function $i(t,e,n,r){return Ai(Ti(t,e,r),n)}const Ni=()=>{};function Ti(t,e,n){return x.useCallback((n=>t?(t.on(e,n),()=>t.off(e,n)):Ni),n?[t,e,...n]:[t,e])}function Ai(t,e){return Li.useSyncExternalStore(t,e)}function zi(t,e,n){const r=x.useRef(void 0);return Li.useSyncExternalStore(t,(()=>{const t=e();if(r.current){const[e]=r.current;if(n(e,t))return e}return r.current=[t],t}))}function Ii(t){const{input:e,load:n}=t,r=x.useRef(n),[i,o]=x.useState({data:void 0,status:"loading"});return x.useEffect((()=>{r.current=n})),x.useEffect((()=>{const t=new AbortController,n=t.signal,i=r.current(e,{signal:n});return i?(o((t=>({...t,status:"loading",error:void 0}))),i.then((t=>{n.aborted||o({data:t,status:"completed",error:void 0})}),(t=>{n.aborted||o((e=>({...e,status:"error",error:t})))}))):o({data:void 0,status:"completed",error:void 0}),()=>t.abort()}),e),i}const Ri=x.createContext(null);function Oi(){const t=x.useContext(Ri);if(!t)throw new Error("Reactodia: missing translation context");return t}class Pi{constructor(t,e){this.key=t,this.placeholders=e}static text(t,e){return new Pi(t,e)}resolve(t){return t.text(this.key,this.placeholders)}}class Vi{constructor(t){this.subscribe=t}observedKeys=new Map;setSubscribe(t){this.subscribe=t}observe(t){if(0===t.length&&0===this.observedKeys.size)return;const e=new Map;for(const n of t){if(e.has(n))continue;let t=this.observedKeys.get(n);t||(t=this.subscribe(n)),t&&e.set(n,t)}this.observedKeys.forEach(((t,n)=>{e.has(n)||t()})),this.observedKeys=e}stopListening(){this.observe([])}}function ji(t,e,n){const[,r]=x.useState(0),i=x.useRef(void 0);let o=i.current;if(!o){const e=()=>r((t=>t+1));o={observer:new Vi((r=>t(r,n,e))),forceUpdate:e,lastStore:t},i.current=o}if(o.lastStore!==t){const{observer:e,forceUpdate:r}=o;e.setSubscribe((e=>t(e,n,r))),o.lastStore=t}o.observer.observe(e),x.useEffect((()=>()=>i.current?.observer.stopListening()),[])}const Di=wi.DataFactory;function Hi(t){let e=0;switch(t.termType){case"NamedNode":case"BlankNode":case"Variable":e=D(t.value);break;case"Literal":e=D(t.value),t.datatype&&(e=V(e,D(t.datatype.value))),t.language&&(e=V(e,D(t.language)));break;case"Quad":e=V(e,Hi(t.subject)),e=V(e,Hi(t.predicate)),e=V(e,Hi(t.object)),e=V(e,Hi(t.graph))}return j(e)}function Bi(t,e){if(t.termType!==e.termType)return!1;switch(t.termType){case"NamedNode":case"BlankNode":case"Variable":case"DefaultGraph":{const{value:n}=e;return t.value===n}case"Literal":{const{value:n,language:r,datatype:i}=e;return t.value===n&&t.datatype.value===i.value&&t.language===r}case"Quad":{const{subject:n,predicate:r,object:i,graph:o}=e;return Bi(t.subject,n)&&Bi(t.predicate,r)&&Bi(t.object,i)&&Bi(t.graph,o)}}}function Fi(t){return t.startsWith("urn:reactodia:blank:")}function Ui(t){const[e,n]=t;let r=D(e);return r=V(r,D(n)),j(r)}function Wi(t,e){const[n,r]=t,[i,o]=e;return n===i&&r===o}function qi(t,e){return t.linkTypeId===e.linkTypeId&&t.sourceId===e.sourceId&&t.targetId===e.targetId}function Gi(t){const{linkTypeId:e,sourceId:n,targetId:r}=t;let i=D(e);return i=V(i,D(n)),i=V(i,D(r)),i}const Zi={label:"http://www.w3.org/2000/01/rdf-schema#label"},Ki={thumbnailUrl:"http://schema.org/thumbnailUrl"},Qi="reactodia-spinner";function Xi(t){const{position:e={x:0,y:0},size:n=50,statusText:r,errorOccurred:i}=t;return P.jsxs("g",{className:Qi,"data-error":i,transform:`translate(${e.x},${e.y})`,children:[P.jsx("g",{className:`${Qi}__arrow`,children:P.jsx("path",{d:"m3.47,-19.7 a20,20 0 1,1 -6.95,0 m0,0 l-6,5 m6,-5 l-8,-0"+(i?"M-8,-8L8,8M-8,8L8,-8":""),transform:`scale(0.02)scale(${n})`,fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round"})}),P.jsx("text",{className:`${Qi}__text`,style:{dominantBaseline:"middle"},fill:"currentColor",x:n/2+5,children:r})]})}function Yi(t){const{width:e,height:n,errorOccurred:r}=t,i=Math.min(e,n);return P.jsx("svg",{width:e,height:n,children:P.jsx(Xi,{size:i,position:{x:e/2,y:n/2},errorOccurred:r})})}class Ji{model;translation;labelProperties;imageProperties;EMPTY_LABELS=[];constructor(t){const{model:e,translation:n,labelProperties:r=[Zi.label],imageProperties:i=[Ki.thumbnailUrl]}=t;this.model=e,this.translation=n,this.labelProperties=r,this.imageProperties=i}selectEntityLabel(t){for(const e of this.labelProperties)if(Object.prototype.hasOwnProperty.call(t.properties,e)){const n=t.properties[e],r=n?to(n):this.EMPTY_LABELS;if(r.length>0)return r}return this.EMPTY_LABELS}selectEntityImageUrl(t){for(const e of this.imageProperties)if(Object.prototype.hasOwnProperty.call(t.properties,e)){const n=t.properties[e];if(n&&n.length>0)return n[0].value}}formatIri(t){return Fi(t)?this.translation.text("default_data_locale.iri_blank",{value:t}):this.translation.text("default_data_locale.iri",{value:t})}formatEntityLabel(t,e){const n=this.selectEntityLabel(t);return this.translation.formatLabel(n,t.id,e)}formatEntityTypeList(t,e){const n=t.types.map((t=>{const n=this.model.getElementType(t)?.data?.label;return this.translation.formatLabel(n,t,e)}));return n.sort(),n.join(", ")}prepareAnchor(t){return{href:t,target:"_blank",rel:"noreferrer"}}resolveAssetUrl(t,e){return Promise.resolve(t)}}function to(t){for(const e of t)if("Literal"!==e.termType)return t.filter((t=>"Literal"===t.termType));return t}const eo=(t,e,n)=>{const r=e.createElementType(t);return r.events.on("changeData",n),()=>r.events.off("changeData",n)},no=(t,e,n)=>{const r=e.createPropertyType(t);return r.events.on("changeData",n),()=>r.events.off("changeData",n)},ro=(t,e,n)=>{const r=e.createLinkType(t);return r.events.on("changeData",n),()=>r.events.off("changeData",n)};var io=(t=>(t.searchUpdateCriteria="search:updateCriteria",t.searchQueryItem="search:queryItems",t.connectionsLoadLinks="connections:loadLinks",t.connectionsExpandLink="connections:expandLink",t.connectionsLoadElements="connections:loadElements",t.editorChangeSelection="editor:changeSelection",t.editorToggleDialog="editor:toggleDialog",t.editorAddElements="editor:addElements",t))(io||{});const oo=x.createContext(null);function ao(){const t=x.useContext(oo);if(!t)throw new Error("Reactodia: missing workspace context");return t}function so(t){var e,n,r="";if("string"==typeof t||"number"==typeof t)r+=t;else if("object"==typeof t)if(Array.isArray(t)){var i=t.length;for(e=0;e<i;e++)t[e]&&(n=so(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function lo(){for(var t,e,n=0,r="",i=arguments.length;n<i;n++)(t=arguments[n])&&(e=so(t))&&(r&&(r+=" "),r+=e);return r}var co=T();function uo(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function ho(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function fo(){}var po=.7,go=1/po,vo="\\s*([+-]?\\d+)\\s*",mo="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",bo="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",wo=/^#([0-9a-f]{3,8})$/,yo=new RegExp(`^rgb\\(${vo},${vo},${vo}\\)$`),_o=new RegExp(`^rgb\\(${bo},${bo},${bo}\\)$`),ko=new RegExp(`^rgba\\(${vo},${vo},${vo},${mo}\\)$`),xo=new RegExp(`^rgba\\(${bo},${bo},${bo},${mo}\\)$`),So=new RegExp(`^hsl\\(${mo},${bo},${bo}\\)$`),Eo=new RegExp(`^hsla\\(${mo},${bo},${bo},${mo}\\)$`),Co={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function Mo(){return this.rgb().formatHex()}function Lo(){return this.rgb().formatRgb()}function $o(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=wo.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?No(e):3===n?new zo(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?To(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?To(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=yo.exec(t))?new zo(e[1],e[2],e[3],1):(e=_o.exec(t))?new zo(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=ko.exec(t))?To(e[1],e[2],e[3],e[4]):(e=xo.exec(t))?To(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=So.exec(t))?jo(e[1],e[2]/100,e[3]/100,1):(e=Eo.exec(t))?jo(e[1],e[2]/100,e[3]/100,e[4]):Co.hasOwnProperty(t)?No(Co[t]):"transparent"===t?new zo(NaN,NaN,NaN,0):null}function No(t){return new zo(t>>16&255,t>>8&255,255&t,1)}function To(t,e,n,r){return r<=0&&(t=e=n=NaN),new zo(t,e,n,r)}function Ao(t){return t instanceof fo||(t=$o(t)),t?new zo((t=t.rgb()).r,t.g,t.b,t.opacity):new zo}function zo(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function Io(){return`#${Vo(this.r)}${Vo(this.g)}${Vo(this.b)}`}function Ro(){const t=Oo(this.opacity);return`${1===t?"rgb(":"rgba("}${Po(this.r)}, ${Po(this.g)}, ${Po(this.b)}${1===t?")":`, ${t})`}`}function Oo(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Po(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Vo(t){return((t=Po(t))<16?"0":"")+t.toString(16)}function jo(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Ho(t,e,n,r)}function Do(t){if(t instanceof Ho)return new Ho(t.h,t.s,t.l,t.opacity);if(t instanceof fo||(t=$o(t)),!t)return new Ho;if(t instanceof Ho)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),a=NaN,s=o-i,l=(o+i)/2;return s?(a=e===o?(n-r)/s+6*(n<r):n===o?(r-e)/s+2:(e-n)/s+4,s/=l<.5?o+i:2-o-i,a*=60):s=l>0&&l<1?0:a,new Ho(a,s,l,t.opacity)}function Ho(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function Bo(t){return(t=(t||0)%360)<0?t+360:t}function Fo(t){return Math.max(0,Math.min(1,t||0))}function Uo(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}uo(fo,$o,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:Mo,formatHex:Mo,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Do(this).formatHsl()},formatRgb:Lo,toString:Lo}),uo(zo,(function(t,e,n,r){return 1===arguments.length?Ao(t):new zo(t,e,n,null==r?1:r)}),ho(fo,{brighter(t){return t=null==t?go:Math.pow(go,t),new zo(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?po:Math.pow(po,t),new zo(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new zo(Po(this.r),Po(this.g),Po(this.b),Oo(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Io,formatHex:Io,formatHex8:function(){return`#${Vo(this.r)}${Vo(this.g)}${Vo(this.b)}${Vo(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Ro,toString:Ro})),uo(Ho,(function(t,e,n,r){return 1===arguments.length?Do(t):new Ho(t,e,n,null==r?1:r)}),ho(fo,{brighter(t){return t=null==t?go:Math.pow(go,t),new Ho(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?po:Math.pow(po,t),new Ho(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new zo(Uo(t>=240?t-240:t+120,i,r),Uo(t,i,r),Uo(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new Ho(Bo(this.h),Fo(this.s),Fo(this.l),Oo(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=Oo(this.opacity);return`${1===t?"hsl(":"hsla("}${Bo(this.h)}, ${100*Fo(this.s)}%, ${100*Fo(this.l)}%${1===t?")":`, ${t})`}`}}));const Wo=Math.PI/180,qo=180/Math.PI,Go=.96422,Zo=.82521,Ko=4/29,Qo=6/29,Xo=3*Qo*Qo,Yo=Qo*Qo*Qo;function Jo(t){if(t instanceof ta)return new ta(t.l,t.a,t.b,t.opacity);if(t instanceof aa)return sa(t);t instanceof zo||(t=Ao(t));var e,n,r=ia(t.r),i=ia(t.g),o=ia(t.b),a=ea((.2225045*r+.7168786*i+.0606169*o)/1);return r===i&&i===o?e=n=a:(e=ea((.4360747*r+.3850649*i+.1430804*o)/Go),n=ea((.0139322*r+.0971045*i+.7141733*o)/Zo)),new ta(116*a-16,500*(e-a),200*(a-n),t.opacity)}function ta(t,e,n,r){this.l=+t,this.a=+e,this.b=+n,this.opacity=+r}function ea(t){return t>Yo?Math.pow(t,1/3):t/Xo+Ko}function na(t){return t>Qo?t*t*t:Xo*(t-Ko)}function ra(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function ia(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function oa(t,e,n,r){return 1===arguments.length?function(t){if(t instanceof aa)return new aa(t.h,t.c,t.l,t.opacity);if(t instanceof ta||(t=Jo(t)),0===t.a&&0===t.b)return new aa(NaN,0<t.l&&t.l<100?0:NaN,t.l,t.opacity);var e=Math.atan2(t.b,t.a)*qo;return new aa(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}(t):new aa(t,e,n,null==r?1:r)}function aa(t,e,n,r){this.h=+t,this.c=+e,this.l=+n,this.opacity=+r}function sa(t){if(isNaN(t.h))return new ta(t.l,0,0,t.opacity);var e=t.h*Wo;return new ta(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}uo(ta,(function(t,e,n,r){return 1===arguments.length?Jo(t):new ta(t,e,n,null==r?1:r)}),ho(fo,{brighter(t){return new ta(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker(t){return new ta(this.l-18*(null==t?1:t),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,n=isNaN(this.b)?t:t-this.b/200;return new zo(ra(3.1338561*(e=Go*na(e))-1.6168667*(t=1*na(t))-.4906146*(n=Zo*na(n))),ra(-.9787684*e+1.9161415*t+.033454*n),ra(.0719453*e-.2289914*t+1.4052427*n),this.opacity)}})),uo(aa,oa,ho(fo,{brighter(t){return new aa(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker(t){return new aa(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb(){return sa(this).rgb()}}));var la=-.14861,ca=1.78277,ua=-.29227,da=-.90649,ha=1.97294,fa=ha*da,pa=ha*ca,ga=ca*ua-da*la;function va(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}uo(va,(function(t,e,n,r){return 1===arguments.length?function(t){if(t instanceof va)return new va(t.h,t.s,t.l,t.opacity);t instanceof zo||(t=Ao(t));var e=t.g/255,n=t.b/255,r=(ga*n+fa*(t.r/255)-pa*e)/(ga+fa-pa),i=n-r,o=(ha*(e-r)-ua*i)/da,a=Math.sqrt(o*o+i*i)/(ha*r*(1-r)),s=a?Math.atan2(o,i)*qo-120:NaN;return new va(s<0?s+360:s,a,r,t.opacity)}(t):new va(t,e,n,null==r?1:r)}),ho(fo,{brighter(t){return t=null==t?go:Math.pow(go,t),new va(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?po:Math.pow(po,t),new va(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=isNaN(this.h)?0:(this.h+120)*Wo,e=+this.l,n=isNaN(this.s)?0:this.s*e*(1-e),r=Math.cos(t),i=Math.sin(t);return new zo(255*(e+n*(la*r+ca*i)),255*(e+n*(ua*r+da*i)),255*(e+n*(ha*r)),this.opacity)}}));var ma,ba,wa={exports:{}},ya=(ma||(ma=1,ba=wa,function(){function t(t,e,n){var r=new XMLHttpRequest;r.open("GET",t),r.responseType="blob",r.onload=function(){o(r.response,e,n)},r.onerror=function(){console.error("could not download file")},r.send()}function e(t){var e=new XMLHttpRequest;e.open("HEAD",t,!1);try{e.send()}catch(t){}return 200<=e.status&&299>=e.status}function n(t){try{t.dispatchEvent(new MouseEvent("click"))}catch(n){var e=document.createEvent("MouseEvents");e.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),t.dispatchEvent(e)}}var r="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof a&&a.global===a?a:void 0,i=r.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),o=r.saveAs||("object"!=typeof window||window!==r?function(){}:"download"in HTMLAnchorElement.prototype&&!i?function(i,o,a){var s=r.URL||r.webkitURL,l=document.createElement("a");l.download=o=o||i.name||"download",l.rel="noopener","string"==typeof i?(l.href=i,l.origin===location.origin?n(l):e(l.href)?t(i,o,a):n(l,l.target="_blank")):(l.href=s.createObjectURL(i),setTimeout((function(){s.revokeObjectURL(l.href)}),4e4),setTimeout((function(){n(l)}),0))}:"msSaveOrOpenBlob"in navigator?function(r,i,o){if(i=i||r.name||"download","string"!=typeof r)navigator.msSaveOrOpenBlob(function(t,e){return void 0===e?e={autoBom:!1}:"object"!=typeof e&&(console.warn("Deprecated: Expected third argument to be a object"),e={autoBom:!e}),e.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(t.type)?new Blob(["\ufeff",t],{type:t.type}):t}(r,o),i);else if(e(r))t(r,i,o);else{var a=document.createElement("a");a.href=r,a.target="_blank",setTimeout((function(){n(a)}))}}:function(e,n,o,a){if((a=a||open("","_blank"))&&(a.document.title=a.document.body.innerText="downloading..."),"string"==typeof e)return t(e,n,o);var s="application/octet-stream"===e.type,l=/constructor/i.test(r.HTMLElement)||r.safari,c=/CriOS\/[\d]+/.test(navigator.userAgent);if((c||s&&l||i)&&"undefined"!=typeof FileReader){var u=new FileReader;u.onloadend=function(){var t=u.result;t=c?t:t.replace(/^data:[^;]*;/,"data:attachment/file;"),a?a.location.href=t:location=t,a=null},u.readAsDataURL(e)}else{var d=r.URL||r.webkitURL,h=d.createObjectURL(e);a?a.location=h:location.href=h,a=null,setTimeout((function(){d.revokeObjectURL(h)}),4e4)}});r.saveAs=o.saveAs=o,ba.exports=o}()),wa.exports);function _a(t,e){return t.then((t=>e&&e.aborted?null:t),(t=>e&&e.aborted?null:Promise.reject(t)))}function ka(t){return new Promise((e=>{setTimeout((()=>{e()}),t)}))}!function(){try{if("undefined"!=typeof document){var t=document.createElement("style");t.appendChild(document.createTextNode("@charset \"UTF-8\";.reactodia-badge{display:inline-block;min-width:10px;font-size:12px;font-weight:700;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:middle;background-color:#777;padding:3px 7px;border-radius:10px}.reactodia-btn{display:inline-block;padding:6px 12px;margin-bottom:0;font-size:14px;font-weight:400;line-height:var(--reactodia-line-height-base);text-transform:none;text-align:center;vertical-align:middle;white-space:nowrap;background-image:none;border:var(--reactodia-button-border-width) solid transparent;border-radius:var(--reactodia-button-border-radius);transition:background-color var(--reactodia-transition-duration);touch-action:manipulation;-webkit-user-select:none;user-select:none;cursor:pointer}.reactodia-btn[disabled]{cursor:not-allowed;opacity:.65}.reactodia-btn-default{color:var(--reactodia-button-default-color);background-color:var(--reactodia-button-default-background-color);border-color:var(--reactodia-button-default-border-color)}.reactodia-btn-default:hover{color:var(--reactodia-button-default-color-focus);background-color:var(--reactodia-button-default-background-color-focus)}.reactodia-btn-default:active,.reactodia-btn-default.active{color:var(--reactodia-button-default-color-focus);background-color:var(--reactodia-button-default-background-color-active)}.reactodia-btn-default[disabled],.reactodia-btn-default[disabled]:hover,.reactodia-btn-default[disabled]:focus,.reactodia-btn-default[disabled]:active,.reactodia-btn-default[disabled].active{color:var(--reactodia-button-default-color);background-color:var(--reactodia-input-background-color-disabled)}.reactodia-btn-primary{color:var(--reactodia-color-emphasis-0);background-color:var(--reactodia-color-primary);border-color:var(--reactodia-color-primary-darker)}.reactodia-btn-primary:hover{border-color:var(--reactodia-color-primary-darkest);background-color:var(--reactodia-color-primary-dark)}.reactodia-btn-primary:active,.reactodia-btn-primary.active{border-color:var(--reactodia-color-primary-darker);background-color:var(--reactodia-color-primary-darkest)}.reactodia-btn-primary[disabled],.reactodia-btn-primary[disabled]:hover,.reactodia-btn-primary[disabled]:focus,.reactodia-btn-primary[disabled]:active,.reactodia-btn-primary[disabled].active{background-color:var(--reactodia-color-primary-dark)}.reactodia-btn-secondary{color:var(--reactodia-color-gray-900);background-color:var(--reactodia-color-secondary);border-color:var(--reactodia-color-secondary-darker)}.reactodia-btn-secondary:hover{border-color:var(--reactodia-color-secondary-darkest);background-color:var(--reactodia-color-secondary-dark)}.reactodia-btn-secondary:active,.reactodia-btn-secondary.active{border-color:var(--reactodia-color-secondary-darker);background-color:var(--reactodia-color-secondary-darkest)}.reactodia-btn-secondary[disabled],.reactodia-btn-secondary[disabled]:hover,.reactodia-btn-secondary[disabled]:focus,.reactodia-btn-secondary[disabled]:active,.reactodia-btn-secondary[disabled].active{background-color:var(--reactodia-color-secondary-dark)}.reactodia-btn-success{color:var(--reactodia-color-emphasis-0);background-color:var(--reactodia-color-success);border-color:var(--reactodia-color-success-darker)}.reactodia-btn-success:hover{border-color:var(--reactodia-color-success-darkest);background-color:var(--reactodia-color-success-dark)}.reactodia-btn-success:active,.reactodia-btn-success.active{border-color:var(--reactodia-color-success-darker);background-color:var(--reactodia-color-success-darkest)}.reactodia-btn-success[disabled],.reactodia-btn-success[disabled]:hover,.reactodia-btn-success[disabled]:focus,.reactodia-btn-success[disabled]:active,.reactodia-btn-success[disabled].active{background-color:var(--reactodia-color-success-dark)}.reactodia-btn-info{color:var(--reactodia-color-emphasis-0);background-color:var(--reactodia-color-info);border-color:var(--reactodia-color-info-darker)}.reactodia-btn-info:hover{border-color:var(--reactodia-color-info-darkest);background-color:var(--reactodia-color-info-dark)}.reactodia-btn-info:active,.reactodia-btn-info.active{border-color:var(--reactodia-color-info-darker);background-color:var(--reactodia-color-info-darkest)}.reactodia-btn-info[disabled],.reactodia-btn-info[disabled]:hover,.reactodia-btn-info[disabled]:focus,.reactodia-btn-info[disabled]:active,.reactodia-btn-info[disabled].active{background-color:var(--reactodia-color-info-dark)}.reactodia-btn-warning{color:var(--reactodia-color-emphasis-0);background-color:var(--reactodia-color-warning);border-color:var(--reactodia-color-warning-darker)}.reactodia-btn-warning:hover{border-color:var(--reactodia-color-warning-darkest);background-color:var(--reactodia-color-warning-dark)}.reactodia-btn-warning:active,.reactodia-btn-warning.active{border-color:var(--reactodia-color-warning-darker);background-color:var(--reactodia-color-warning-darkest)}.reactodia-btn-warning[disabled],.reactodia-btn-warning[disabled]:hover,.reactodia-btn-warning[disabled]:focus,.reactodia-btn-warning[disabled]:active,.reactodia-btn-warning[disabled].active{background-color:var(--reactodia-color-warning-dark)}.reactodia-btn-danger{color:var(--reactodia-color-emphasis-0);background-color:var(--reactodia-color-danger);border-color:var(--reactodia-color-danger-darker)}.reactodia-btn-danger:hover{border-color:var(--reactodia-color-danger-darkest);background-color:var(--reactodia-color-danger-dark)}.reactodia-btn-danger:active,.reactodia-btn-danger.active{border-color:var(--reactodia-color-danger-darker);background-color:var(--reactodia-color-danger-darkest)}.reactodia-btn-danger[disabled],.reactodia-btn-danger[disabled]:hover,.reactodia-btn-danger[disabled]:focus,.reactodia-btn-danger[disabled]:active,.reactodia-btn-danger[disabled].active{background-color:var(--reactodia-color-danger-dark)}.reactodia-btn-group{position:relative;display:inline-block;vertical-align:middle}.reactodia-btn-group>.reactodia-btn,.reactodia-btn-group>.reactodia-btn-group{position:relative;float:left}.reactodia-btn-group>.reactodia-btn:hover,.reactodia-btn-group>.reactodia-btn:focus,.reactodia-btn-group>.reactodia-btn.active,.reactodia-btn-group>.reactodia-btn.active:hover{z-index:2}.reactodia-btn-group .reactodia-btn+.reactodia-btn,.reactodia-btn-group .reactodia-btn+.reactodia-btn-group,.reactodia-btn-group .reactodia-btn-group+.reactodia-btn,.reactodia-btn-group .reactodia-btn-group+.reactodia-btn-group{margin-left:calc(-1 * var(--reactodia-button-border-width))}.reactodia-btn-group>.reactodia-btn{border-radius:unset}.reactodia-btn-group>.reactodia-btn:first-of-type{margin-left:0;border-top-left-radius:var(--reactodia-button-border-radius);border-bottom-left-radius:var(--reactodia-button-border-radius)}.reactodia-btn-group>.reactodia-btn:last-of-type{border-top-right-radius:var(--reactodia-button-border-radius);border-bottom-right-radius:var(--reactodia-button-border-radius)}.reactodia-btn-group-sm>.reactodia-btn{font-size:12px;line-height:1.5;padding:5px 10px}.reactodia-btn-group-xs>.reactodia-btn{font-size:12px;line-height:1.5;padding:1px 5px}.reactodia-form{flex:auto;display:flex;flex-direction:column}.reactodia-form__body{flex:auto;display:flex;flex-direction:column;position:relative;padding:8px}.reactodia-form__controls{border-top:1px solid var(--reactodia-border-color-base);padding:8px;text-align:right;flex:0 0 auto}.reactodia-form__controls button+button{margin-left:var(--reactodia-spacing-horizontal)}.reactodia-form__row{display:block;margin-bottom:8px}.reactodia-form__progress{position:absolute;bottom:0;left:0;right:0}.reactodia-form__control-row{position:relative;padding-bottom:18px}.reactodia-form__control-error{color:var(--reactodia-color-danger);position:absolute;bottom:0;left:0}.reactodia-form-control{display:block;width:100%;height:34px;margin:0;padding:6px 12px;font-family:var(--reactodia-font-family-base);line-height:var(--reactodia-line-height-base);font-size:14px;color:var(--reactodia-input-color);background-color:var(--reactodia-input-background-color);border:var(--reactodia-input-border-width) solid var(--reactodia-input-border-color);border-radius:var(--reactodia-input-border-radius);transition:border-color ease-in-out .15s}.reactodia-form-control:focus{border-color:var(--reactodia-input-border-color-focus);outline:0}.reactodia-form-control:disabled{background-color:var(--reactodia-input-background-color-disabled);cursor:not-allowed;opacity:.6}.reactodia-canvas-area{--reactodia-paper-panning-overlay-z-index: zIndex.$panning-overlay;flex:auto;width:0;background-color:var(--reactodia-canvas-background-color)}.reactodia-canvas-area__widgets{position:absolute;left:0;top:0}.reactodia-canvas-area__watermark{background-size:cover;width:8%;max-width:130px;min-width:50px;position:absolute;top:15px;right:25px;cursor:pointer;opacity:.3;transition:opacity var(--reactodia-transition-duration)}.reactodia-canvas-area__watermark:hover{opacity:.5}.reactodia-canvas-area--animated .reactodia-overlaid-element,.reactodia-canvas-area--animated .reactodia-element-decorations{transition:transform var(--reactodia-canvas-animation-duration) ease-in-out}.reactodia-canvas-area--animated .reactodia-link-layer,.reactodia-canvas-area--animated .reactodia-label-layer,.reactodia-canvas-area--animated .reactodia-canvas-area__widgets{transition:none;opacity:0}.reactodia-exported-watermark{opacity:.3;transition:opacity var(--reactodia-transition-duration)}.reactodia-exported-canvas{box-sizing:border-box;white-space:initial;color:var(--reactodia-font-color-base);font-family:var(--reactodia-font-family-base);font-size:var(--reactodia-font-size-base);line-height:var(--reactodia-line-height-base)}.reactodia-exported-canvas *,.reactodia-exported-canvas *:before,.reactodia-exported-canvas *:after{box-sizing:inherit}.reactodia-exported-layer{position:absolute}.reactodia-overlaid-element{cursor:move;outline:none}.reactodia-overlaid-element img{vertical-align:middle}.reactodia-overlaid-element--blurred{filter:grayscale(100%);opacity:.5}.reactodia-overlaid-element--only-selected{touch-action:none}.reactodia-element-decorations{pointer-events:none}.reactodia-element-decorations>div>*{pointer-events:initial}.reactodia-link--blurred{opacity:.5}.reactodia-link--only-selected{touch-action:none}.reactodia-link-path__wrap{stroke-width:12px;stroke-linejoin:round;stroke-linecap:round;stroke:transparent;fill:none}.reactodia-link:hover .reactodia-link-path__wrap{stroke:var(--reactodia-color-emphasis-400);opacity:.44}.reactodia-link-vertices__vertex{cursor:all-scroll}.reactodia-link-vertices__vertex:not([fill]){fill:var(--reactodia-link-stroke-color)}.reactodia-link:not(:hover):not(.reactodia-link--only-selected) .reactodia-link-vertices__vertex{fill:transparent}.reactodia-link-vertices__handle{opacity:0;transition:opacity var(--reactodia-transition-duration);cursor:pointer}.reactodia-link-vertices__handle>circle{fill:var(--reactodia-color-emphasis-500)}.reactodia-link-vertices__handle>path{stroke:var(--reactodia-color-emphasis-200)}.reactodia-link-vertices__handle:hover>circle{fill:var(--reactodia-color-emphasis-900)}.reactodia-link:hover .reactodia-link-vertices__handle,.reactodia-link--only-selected .reactodia-link-vertices__handle{opacity:.8}.reactodia-link-marker__path:not([fill]){fill:var(--reactodia-link-stroke-color)}.reactodia-link-label{margin-top:calc(1.5em * var(--reactodia-link-label-line, 0));padding:0 2px;border-radius:var(--reactodia-border-radius-s);color:var(--reactodia-font-color-base);background-color:var(--reactodia-canvas-background-color);white-space:nowrap}.reactodia-spinner__arrow{animation-name:reactodia-spinner-rotation;animation-duration:1.5s;animation-timing-function:cubic-bezier(.645,.045,.355,1);animation-iteration-count:infinite}.reactodia-spinner__text{color:var(--reactodia-font-color-base)}.reactodia-spinner[data-error=true] .reactodia-spinner__arrow{color:var(--reactodia-color-danger);animation-iteration-count:1}@keyframes reactodia-spinner-rotation{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.reactodia-authoring-state__element-outlines{position:absolute;pointer-events:none;overflow:visible}.reactodia-authoring-state__outline-overlay{fill:var(--reactodia-color-emphasis-0);fill-opacity:.3}.reactodia-authoring-state__outline-stripe-line{stroke:var(--reactodia-color-emphasis-300);stroke-width:10;stroke-opacity:.2}.reactodia-authoring-state__outline-cross-line{stroke:var(--reactodia-color-danger)}.reactodia-authoring-state__link-temporary,.reactodia-authoring-state__link-added,.reactodia-authoring-state__link-changed,.reactodia-authoring-state__link-deleted,.reactodia-authoring-state__link-uncertain{stroke-width:5;stroke-opacity:.5;fill:none}.reactodia-authoring-state__link-temporary{stroke:var(--reactodia-color-gray-600);stroke-dasharray:8 8}.reactodia-authoring-state__link-added{stroke:var(--reactodia-color-success)}.reactodia-authoring-state__link-changed{stroke:var(--reactodia-color-primary)}.reactodia-authoring-state__link-deleted{stroke:var(--reactodia-color-danger)}.reactodia-authoring-state__link-uncertain{stroke:var(--reactodia-color-primary)}.reactodia-authoring-state__item-validation{align-self:flex-end;display:flex;align-items:center;cursor:help}.reactodia-authoring-state__item-validation-icon{height:15px;width:17px;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat}.reactodia-authoring-state--severity-info .reactodia-authoring-state__item-validation-icon{background:var(--reactodia-color-info);-webkit-mask-image:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M8.568%201.031A6.8%206.8%200%200%201%2012.76%203.05a7.06%207.06%200%200%201%20.46%209.39%206.85%206.85%200%200%201-8.58%201.74%207%207%200%200%201-3.12-3.5%207.12%207.12%200%200%201-.23-4.71%207%207%200%200%201%202.77-3.79%206.8%206.8%200%200%201%204.508-1.149zM9.04%2013.88a5.89%205.89%200%200%200%203.41-2.07%206.07%206.07%200%200%200-.4-8.06%205.82%205.82%200%200%200-7.43-.74%206.06%206.06%200%200%200%20.5%2010.29%205.81%205.81%200%200%200%203.92.58zM7.375%206h1.25V5h-1.25v1zm1.25%201v4h-1.25V7h1.25z'/%3e%3c/svg%3e\");mask-image:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M8.568%201.031A6.8%206.8%200%200%201%2012.76%203.05a7.06%207.06%200%200%201%20.46%209.39%206.85%206.85%200%200%201-8.58%201.74%207%207%200%200%201-3.12-3.5%207.12%207.12%200%200%201-.23-4.71%207%207%200%200%201%202.77-3.79%206.8%206.8%200%200%201%204.508-1.149zM9.04%2013.88a5.89%205.89%200%200%200%203.41-2.07%206.07%206.07%200%200%200-.4-8.06%205.82%205.82%200%200%200-7.43-.74%206.06%206.06%200%200%200%20.5%2010.29%205.81%205.81%200%200%200%203.92.58zM7.375%206h1.25V5h-1.25v1zm1.25%201v4h-1.25V7h1.25z'/%3e%3c/svg%3e\")}.reactodia-authoring-state--severity-warning .reactodia-authoring-state__item-validation-icon{background:var(--reactodia-color-warning);-webkit-mask-image:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M7.56%201h.88l6.54%2012.26-.44.74H1.44L1%2013.26%207.56%201zM8%202.28L2.28%2013H13.7L8%202.28zM8.625%2012v-1h-1.25v1h1.25zm-1.25-2V6h1.25v4h-1.25z'/%3e%3c/svg%3e\");mask-image:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M7.56%201h.88l6.54%2012.26-.44.74H1.44L1%2013.26%207.56%201zM8%202.28L2.28%2013H13.7L8%202.28zM8.625%2012v-1h-1.25v1h1.25zm-1.25-2V6h1.25v4h-1.25z'/%3e%3c/svg%3e\")}.reactodia-authoring-state--severity-error .reactodia-authoring-state__item-validation-icon{background:var(--reactodia-color-danger);-webkit-mask-image:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M7.56%201h.88l6.54%2012.26-.44.74H1.44L1%2013.26%207.56%201zM8%202.28L2.28%2013H13.7L8%202.28zM8.625%2012v-1h-1.25v1h1.25zm-1.25-2V6h1.25v4h-1.25z'/%3e%3c/svg%3e\");mask-image:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M7.56%201h.88l6.54%2012.26-.44.74H1.44L1%2013.26%207.56%201zM8%202.28L2.28%2013H13.7L8%202.28zM8.625%2012v-1h-1.25v1h1.25zm-1.25-2V6h1.25v4h-1.25z'/%3e%3c/svg%3e\")}.reactodia-authoring-state__state-label{font-weight:700}.reactodia-authoring-state__state-indicator{position:relative}.reactodia-authoring-state__state-indicator-body{position:absolute;white-space:nowrap;display:flex;align-items:center;gap:var(--reactodia-spacing-horizontal);bottom:0;background:var(--reactodia-canvas-underlay-color);border-radius:var(--reactodia-border-radius-s);padding:1px;height:22px}.reactodia-authoring-state__actions{display:flex;gap:var(--reactodia-spacing-horizontal)}.reactodia-authoring-state__action{background:none;border:0 none;padding:0;cursor:pointer;opacity:.5;transition:opacity var(--reactodia-transition-duration)}.reactodia-authoring-state__action:hover{opacity:1}.reactodia-authoring-state__action[disabled]{cursor:not-allowed;opacity:.2}.reactodia-authoring-state__action-edit{display:flex;align-items:center}.reactodia-authoring-state__action-edit:before{-webkit-mask:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20d='M13.23%201h-1.46L3.52%209.25l-.16.22L1%2013.59%202.41%2015l4.12-2.36.22-.16L15%204.23V2.77L13.23%201zM2.41%2013.59l1.51-3%201.45%201.45-2.96%201.55zm3.83-2.06L4.47%209.76l8-8%201.77%201.77-8%208z'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;mask:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20d='M13.23%201h-1.46L3.52%209.25l-.16.22L1%2013.59%202.41%2015l4.12-2.36.22-.16L15%204.23V2.77L13.23%201zM2.41%2013.59l1.51-3%201.45%201.45-2.96%201.55zm3.83-2.06L4.47%209.76l8-8%201.77%201.77-8%208z'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;background-color:currentColor;content:\"\";display:block;height:16px;width:16px}.reactodia-authoring-state__action-edit:not(:empty):before{margin-right:3px}.reactodia-authoring-state__action-delete{display:flex;align-items:center}.reactodia-authoring-state__action-delete:before{-webkit-mask:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M10%203h3v1h-1v9l-1%201H4l-1-1V4H2V3h3V2a1%201%200%200%201%201-1h3a1%201%200%200%201%201%201v1zM9%202H6v1h3V2zM4%2013h7V4H4v9zm2-8H5v7h1V5zm1%200h1v7H7V5zm2%200h1v7H9V5z'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;mask:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M10%203h3v1h-1v9l-1%201H4l-1-1V4H2V3h3V2a1%201%200%200%201%201-1h3a1%201%200%200%201%201%201v1zM9%202H6v1h3V2zM4%2013h7V4H4v9zm2-8H5v7h1V5zm1%200h1v7H7V5zm2%200h1v7H9V5z'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;background-color:currentColor;content:\"\";display:block;height:16px;width:16px}.reactodia-authoring-state__action-delete:not(:empty):before{margin-right:3px}.reactodia-authoring-state__action-discard{display:flex;align-items:center}.reactodia-authoring-state__action-discard:before{-webkit-mask:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M3.5%202v3.5L4%206h3.5V5H4.979l.941-.941a3.552%203.552%200%201%201%205.023%205.023L5.746%2014.28l.72.72%205.198-5.198A4.57%204.57%200%200%200%205.2%203.339l-.7.7V2h-1z'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;mask:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M3.5%202v3.5L4%206h3.5V5H4.979l.941-.941a3.552%203.552%200%201%201%205.023%205.023L5.746%2014.28l.72.72%205.198-5.198A4.57%204.57%200%200%200%205.2%203.339l-.7.7V2h-1z'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;background-color:currentColor;content:\"\";display:block;height:16px;width:16px}.reactodia-authoring-state__action-discard:not(:empty):before{margin-right:3px}.reactodia-authoring-state__decorator .reactodia-authoring-state__state-indicator{transition:opacity var(--reactodia-transition-duration)}.reactodia-authoring-state__decorator--optional .reactodia-authoring-state__state-indicator{opacity:0}.reactodia-overlaid-element:hover+.reactodia-element-decorations .reactodia-authoring-state__state-indicator,.reactodia-authoring-state__decorator--selected .reactodia-authoring-state__state-indicator,.reactodia-authoring-state__decorator:hover .reactodia-authoring-state__state-indicator{opacity:1}.reactodia-edit-entity-form--loading{align-items:center;justify-content:center}.reactodia-edit-entity-form label .reactodia-form-control+.reactodia-form-control{margin-top:var(--reactodia-spacing-vertical)}.reactodia-edit-relation-form--loading{align-items:center;justify-content:center}.reactodia-element-selector{display:flex;flex-direction:column}.reactodia-element-selector--search-existing{flex:auto}.reactodia-element-selector__search{flex-shrink:0;position:relative}.reactodia-element-selector__search-icon{-webkit-mask:url(\"data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20d='M15.25%200a8.25%208.25%200%200%200-6.18%2013.72L1%2022.88l1.12%201%208.05-9.12A8.251%208.251%200%201%200%2015.25.01V0zm0%2015a6.75%206.75%200%201%201%200-13.5%206.75%206.75%200%200%201%200%2013.5z'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;mask:url(\"data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20d='M15.25%200a8.25%208.25%200%200%200-6.18%2013.72L1%2022.88l1.12%201%208.05-9.12A8.251%208.251%200%201%200%2015.25.01V0zm0%2015a6.75%206.75%200%201%201%200-13.5%206.75%206.75%200%200%201%200%2013.5z'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;background-color:currentColor;content:\"\";display:block;height:16px;width:16px;opacity:.6;position:absolute;top:50%;left:10px;margin-top:-7px}.reactodia-element-selector__search-input{padding-left:33px}.reactodia-element-selector__existing-elements-list{flex:1 1 0;margin-top:7px;padding-right:10px;overflow-y:scroll}.reactodia-element-selector__results-spinner{height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center}.reactodia-element-selector__separator{margin:7px 0;overflow:hidden;text-align:center}.reactodia-element-selector__separator-text{color:var(--reactodia-border-color-base);display:inline-block;font-size:13px;position:relative}.reactodia-element-selector__separator-text:before,.reactodia-element-selector__separator-text:after{content:\"\";border-top:1px solid;position:absolute;top:50%;margin:0 10px;width:500px}.reactodia-element-selector__separator-text:before{left:100%}.reactodia-element-selector__separator-text:after{right:100%}.reactodia-loading-widget{inset:0;margin:auto;position:absolute;display:flex;align-items:center;justify-content:center;color:var(--reactodia-color-emphasis-1000);background-color:var(--reactodia-canvas-overlay-color);z-index:calc(var(--reactodia-z-index-base) + 30)}.reactodia-fetch-status--loading{animation:reactodia-loading-pulse 2s linear infinite}.reactodia-fetch-status--error:before{content:\"⚠ \";color:#ff000080}@keyframes reactodia-loading-pulse{0%{opacity:1;stroke-opacity:1}50%{opacity:.3;stroke-opacity:.3}to{opacity:1;stroke-opacity:1}}.reactodia-inline-diagnostic__icon{display:inline-block;width:16px;height:16px;vertical-align:middle;margin-right:2px}.reactodia-inline-diagnostic[data-reactodia-severity=info]{color:var(--reactodia-color-info)}.reactodia-inline-diagnostic[data-reactodia-severity=info] .reactodia-inline-diagnostic__icon{background:var(--reactodia-color-info);-webkit-mask-image:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M8.568%201.031A6.8%206.8%200%200%201%2012.76%203.05a7.06%207.06%200%200%201%20.46%209.39%206.85%206.85%200%200%201-8.58%201.74%207%207%200%200%201-3.12-3.5%207.12%207.12%200%200%201-.23-4.71%207%207%200%200%201%202.77-3.79%206.8%206.8%200%200%201%204.508-1.149zM9.04%2013.88a5.89%205.89%200%200%200%203.41-2.07%206.07%206.07%200%200%200-.4-8.06%205.82%205.82%200%200%200-7.43-.74%206.06%206.06%200%200%200%20.5%2010.29%205.81%205.81%200%200%200%203.92.58zM7.375%206h1.25V5h-1.25v1zm1.25%201v4h-1.25V7h1.25z'/%3e%3c/svg%3e\");mask-image:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M8.568%201.031A6.8%206.8%200%200%201%2012.76%203.05a7.06%207.06%200%200%201%20.46%209.39%206.85%206.85%200%200%201-8.58%201.74%207%207%200%200%201-3.12-3.5%207.12%207.12%200%200%201-.23-4.71%207%207%200%200%201%202.77-3.79%206.8%206.8%200%200%201%204.508-1.149zM9.04%2013.88a5.89%205.89%200%200%200%203.41-2.07%206.07%206.07%200%200%200-.4-8.06%205.82%205.82%200%200%200-7.43-.74%206.06%206.06%200%200%200%20.5%2010.29%205.81%205.81%200%200%200%203.92.58zM7.375%206h1.25V5h-1.25v1zm1.25%201v4h-1.25V7h1.25z'/%3e%3c/svg%3e\")}.reactodia-inline-diagnostic[data-reactodia-severity=warning]{color:var(--reactodia-color-warning)}.reactodia-inline-diagnostic[data-reactodia-severity=warning] .reactodia-inline-diagnostic__icon{background:var(--reactodia-color-warning);-webkit-mask-image:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M7.56%201h.88l6.54%2012.26-.44.74H1.44L1%2013.26%207.56%201zM8%202.28L2.28%2013H13.7L8%202.28zM8.625%2012v-1h-1.25v1h1.25zm-1.25-2V6h1.25v4h-1.25z'/%3e%3c/svg%3e\");mask-image:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M7.56%201h.88l6.54%2012.26-.44.74H1.44L1%2013.26%207.56%201zM8%202.28L2.28%2013H13.7L8%202.28zM8.625%2012v-1h-1.25v1h1.25zm-1.25-2V6h1.25v4h-1.25z'/%3e%3c/svg%3e\")}.reactodia-inline-diagnostic[data-reactodia-severity=error]{color:var(--reactodia-color-danger)}.reactodia-inline-diagnostic[data-reactodia-severity=error] .reactodia-inline-diagnostic__icon{background:var(--reactodia-color-danger);-webkit-mask-image:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M7.56%201h.88l6.54%2012.26-.44.74H1.44L1%2013.26%207.56%201zM8%202.28L2.28%2013H13.7L8%202.28zM8.625%2012v-1h-1.25v1h1.25zm-1.25-2V6h1.25v4h-1.25z'/%3e%3c/svg%3e\");mask-image:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M7.56%201h.88l6.54%2012.26-.44.74H1.44L1%2013.26%207.56%201zM8%202.28L2.28%2013H13.7L8%202.28zM8.625%2012v-1h-1.25v1h1.25zm-1.25-2V6h1.25v4h-1.25z'/%3e%3c/svg%3e\")}.reactodia-property-input-file{display:flex;flex-direction:column;gap:4px;padding:6px;border:2px dashed var(--reactodia-border-color-base)}.reactodia-property-input-file[data-reactodia-drag-state=accept]{background-color:var(--reactodia-color-success-contrast-background);border-color:var(--reactodia-color-success)}.reactodia-property-input-file[data-reactodia-drag-state=reject]{background-color:var(--reactodia-color-danger-contrast-background);border-color:var(--reactodia-color-danger)}.reactodia-property-input-file__input{display:none}.reactodia-property-input-file__spinner{flex:auto;display:grid;justify-content:center}.reactodia-property-input-file__placeholder{flex:auto;text-align:center}.reactodia-property-input-file__hint{color:var(--reactodia-color-emphasis-600);margin-bottom:4px}.reactodia-property-input-file__item{border:var(--reactodia-border-width-base) solid var(--reactodia-border-color-base);border-radius:var(--reactodia-border-radius-s);display:flex;gap:4px;padding:2px;color:var(--reactodia-color-primary-contrast-foreground)}.reactodia-property-input-file__item-file{-webkit-mask:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M13.71%204.29l-3-3L10%201H4L3%202v12l1%201h9l1-1V5l-.29-.71zM13%2014H4V2h5v4h4v8zm-3-9V2l3%203h-3z'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;mask:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M13.71%204.29l-3-3L10%201H4L3%202v12l1%201h9l1-1V5l-.29-.71zM13%2014H4V2h5v4h4v8zm-3-9V2l3%203h-3z'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;background-color:currentColor;content:\"\";display:block;height:16px;width:16px;flex:0 0 auto;display:grid;align-items:center;justify-content:center}.reactodia-property-input-file__item-image,.reactodia-property-input-file__item-file{width:60px;height:60px;background-color:var(--reactodia-color-primary-contrast-background)}.reactodia-property-input-file__item-properties{flex:auto;display:flex;flex-direction:column;overflow:hidden;white-space:nowrap;justify-content:center}.reactodia-property-input-file__item-label{font-weight:700}.reactodia-property-input-file__item-label,.reactodia-property-input-file__item-property{text-overflow:ellipsis;overflow:hidden}.reactodia-property-input-file__item-remove[class]{display:flex;align-items:center}.reactodia-property-input-file__item-remove[class]:before{-webkit-mask:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M10%203h3v1h-1v9l-1%201H4l-1-1V4H2V3h3V2a1%201%200%200%201%201-1h3a1%201%200%200%201%201%201v1zM9%202H6v1h3V2zM4%2013h7V4H4v9zm2-8H5v7h1V5zm1%200h1v7H7V5zm2%200h1v7H9V5z'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;mask:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M10%203h3v1h-1v9l-1%201H4l-1-1V4H2V3h3V2a1%201%200%200%201%201-1h3a1%201%200%200%201%201%201v1zM9%202H6v1h3V2zM4%2013h7V4H4v9zm2-8H5v7h1V5zm1%200h1v7H7V5zm2%200h1v7H9V5z'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;background-color:currentColor;content:\"\";display:block;height:16px;width:16px}.reactodia-property-input-file__item-remove[class]:not(:empty):before{margin-right:3px}.reactodia-property-input-file__item-remove[class]{align-self:stretch;border:none;padding:6px 4px}.reactodia-property-input-list__row{display:flex;gap:var(--reactodia-spacing-horizontal)}.reactodia-property-input-list__row+.reactodia-property-input-list__row{margin-top:var(--reactodia-spacing-vertical)}.reactodia-property-input-list__value-remove{display:flex;align-items:center}.reactodia-property-input-list__value-remove:before{-webkit-mask:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M10%203h3v1h-1v9l-1%201H4l-1-1V4H2V3h3V2a1%201%200%200%201%201-1h3a1%201%200%200%201%201%201v1zM9%202H6v1h3V2zM4%2013h7V4H4v9zm2-8H5v7h1V5zm1%200h1v7H7V5zm2%200h1v7H9V5z'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;mask:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M10%203h3v1h-1v9l-1%201H4l-1-1V4H2V3h3V2a1%201%200%200%201%201-1h3a1%201%200%200%201%201%201v1zM9%202H6v1h3V2zM4%2013h7V4H4v9zm2-8H5v7h1V5zm1%200h1v7H7V5zm2%200h1v7H9V5z'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;background-color:currentColor;content:\"\";display:block;height:16px;width:16px}.reactodia-property-input-list__value-remove:not(:empty):before{margin-right:3px}.reactodia-property-input-list__value-remove{align-self:flex-start;border:none;height:34px;padding:6px 4px}.reactodia-property-input-list__value-add{display:flex;align-items:center}.reactodia-property-input-list__value-add:before{-webkit-mask:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20d='M14%207v1H8v6H7V8H1V7h6V1h1v6h6z'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;mask:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20d='M14%207v1H8v6H7V8H1V7h6V1h1v6h6z'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;background-color:currentColor;content:\"\";display:block;height:16px;width:16px}.reactodia-property-input-list__value-add:not(:empty):before{margin-right:3px}.reactodia-property-input-list__value-add{padding:6px}.reactodia-property-input-text__language{width:unset;padding:0 2px}textarea.reactodia-property-input-text{height:4em;resize:vertical}.reactodia-paper{display:flex;position:relative;cursor:default}.reactodia-paper__pane{flex:auto;overflow:scroll;touch-action:none;will-change:scroll-position}.reactodia-paper--pan-on-touch .reactodia-paper__pane{touch-action:pan-x pan-y}.reactodia-paper--hide-scrollbars .reactodia-paper__pane{scrollbar-width:none}.reactodia-paper--hide-scrollbars .reactodia-paper__pane::-webkit-scrollbar{display:none}.reactodia-paper__layers{position:relative}.reactodia-paper--panning{cursor:grabbing}.reactodia-paper--panning:before{display:block;position:fixed;width:100%;height:100%;content:\" \";z-index:var(--reactodia-paper-panning-overlay-z-index, 1)}.reactodia-workspace-dark{color-scheme:dark;--reactodia-color-gray-0: #ffffff;--reactodia-color-gray-100: #f5f6f7;--reactodia-color-gray-200: #ebedf0;--reactodia-color-gray-300: #dadde1;--reactodia-color-gray-400: #ccd0d5;--reactodia-color-gray-500: #bec3c9;--reactodia-color-gray-600: #8d949e;--reactodia-color-gray-700: #606770;--reactodia-color-gray-800: #444950;--reactodia-color-gray-900: #1c1e21;--reactodia-color-gray-1000: #000000;--reactodia-color-primary: #337ab7;--reactodia-color-primary-dark: #306cce;--reactodia-color-primary-darker: #2d66c3;--reactodia-color-primary-darkest: #2554a0;--reactodia-color-primary-light: #538ce9;--reactodia-color-primary-lighter: #72a1ed;--reactodia-color-primary-lightest: #9abcf2;--reactodia-color-secondary: #ebedf0;--reactodia-color-secondary-dark: #d4d5d8;--reactodia-color-secondary-darker: #c8c9cc;--reactodia-color-secondary-darkest: #a4a6a8;--reactodia-color-secondary-light: #eef0f2;--reactodia-color-secondary-lighter: #f1f2f5;--reactodia-color-secondary-lightest: #f5f6f8;--reactodia-color-success: #5cb85c;--reactodia-color-success-dark: #009400;--reactodia-color-success-darker: #008b00;--reactodia-color-success-darkest: #007300;--reactodia-color-success-light: #26b226;--reactodia-color-success-lighter: #4dbf4d;--reactodia-color-success-lightest: #80d280;--reactodia-color-info: #54c7ec;--reactodia-color-info-dark: #4cb3d4;--reactodia-color-info-darker: #47a9c9;--reactodia-color-info-darkest: #3b8ba5;--reactodia-color-info-light: #6ecfef;--reactodia-color-info-lighter: #87d8f2;--reactodia-color-info-lightest: #aae3f6;--reactodia-color-warning: #ffba00;--reactodia-color-warning-dark: #e6a700;--reactodia-color-warning-darker: #d99e00;--reactodia-color-warning-darkest: #b38200;--reactodia-color-warning-light: #ffc426;--reactodia-color-warning-lighter: #ffcf4d;--reactodia-color-warning-lightest: #ffdd80;--reactodia-color-danger: #c9302c;--reactodia-color-danger-dark: #e13238;--reactodia-color-danger-darker: #d53035;--reactodia-color-danger-darkest: #af272b;--reactodia-color-danger-light: #fb565b;--reactodia-color-danger-lighter: #fb7478;--reactodia-color-danger-lightest: #fd9c9f;--reactodia-font-family-base: \"Helvetica Neue\", \"Helvetica\", \"Arial\", sans-serif;--reactodia-font-family-monospace: \"Menlo\", \"Monaco\", \"Consolas\", \"Liberation Mono\", \"Courier New\", monospace;--reactodia-font-size-base: 87.5%;--reactodia-line-height-base: 1.42857;--reactodia-font-color-base: var(--reactodia-color-content);--reactodia-font-color-base-inverse: var(--reactodia-color-content-inverse);--reactodia-spacing-base: 5px;--reactodia-spacing-vertical: var(--reactodia-spacing-base);--reactodia-spacing-horizontal: var(--reactodia-spacing-base);--reactodia-z-index-base: 0;--reactodia-border-radius-base: 4px;--reactodia-border-radius-s: 2px;--reactodia-border-width-base: 1px;--reactodia-transition-duration: .3s;--reactodia-input-border-color: var(--reactodia-border-color-base);--reactodia-input-border-color-focus: var(--reactodia-color-primary-lighter);--reactodia-input-border-radius: var(--reactodia-border-radius-base);--reactodia-input-border-width: var(--reactodia-border-width-base);--reactodia-button-border-radius: var(--reactodia-border-radius-base);--reactodia-button-border-width: var(--reactodia-border-width-base);--reactodia-button-default-border-color: var(--reactodia-border-color-base);--reactodia-draggable-handle-corner-width: 10px;--reactodia-draggable-handle-side-width: 5px;--reactodia-tree-background-color-active: rgba(101, 166, 255, .3);--reactodia-tree-background-color-focus: rgba(189, 217, 255, .3);--reactodia-tree-border-color-active: rgba(115, 211, 255, .5);--reactodia-tree-border-color-focus: rgba(115, 211, 255, .3);--reactodia-dialog-border-color: var(--reactodia-border-color-base);--reactodia-dialog-border-radius: var(--reactodia-border-radius-base);--reactodia-dialog-border-width: var(--reactodia-border-width-base);--reactodia-dialog-viewport-breakpoint-s: 600px;--reactodia-canvas-background-color: var(--reactodia-background-color);--reactodia-viewport-dock-margin: 10px;--reactodia-selection-link-color: #d8956d;--reactodia-selection-single-box-margin: 5px;--reactodia-selection-single-box-color: #d8956d;--reactodia-selection-single-box-shadow: 0 0 5px 0 var(--reactodia-selection-single-box-color) inset;--reactodia-navigator-scrollable-pane-fill: var(--reactodia-navigator-background-fill);--reactodia-navigator-viewport-fill: var(--reactodia-canvas-background-color);--reactodia-navigator-viewport-stroke-width: 2;--reactodia-navigator-overflow-stroke-color: var(--reactodia-navigator-viewport-stroke-color);--reactodia-navigator-overflow-stroke-width: 2;--reactodia-navigator-overflow-stroke-dash: 5 5;--reactodia-toolbar-height: 30px;--reactodia-accordion-transition-duration: var(--reactodia-transition-duration);--reactodia-color-emphasis-0: var(--reactodia-color-gray-1000);--reactodia-color-emphasis-100: var(--reactodia-color-gray-900);--reactodia-color-emphasis-200: var(--reactodia-color-gray-800);--reactodia-color-emphasis-300: var(--reactodia-color-gray-700);--reactodia-color-emphasis-400: var(--reactodia-color-gray-600);--reactodia-color-emphasis-500: var(--reactodia-color-gray-500);--reactodia-color-emphasis-600: var(--reactodia-color-gray-400);--reactodia-color-emphasis-700: var(--reactodia-color-gray-300);--reactodia-color-emphasis-800: var(--reactodia-color-gray-200);--reactodia-color-emphasis-900: var(--reactodia-color-gray-100);--reactodia-color-emphasis-1000: var(--reactodia-color-gray-0);--reactodia-color-primary-contrast-background: #102445;--reactodia-color-primary-contrast-foreground: #ebf2fc;--reactodia-color-secondary-contrast-background: #474748;--reactodia-color-secondary-contrast-foreground: #fdfdfe;--reactodia-color-success-contrast-background: #003100;--reactodia-color-success-contrast-foreground: #e6f6e6;--reactodia-color-info-contrast-background: #193c47;--reactodia-color-info-contrast-foreground: #eef9fd;--reactodia-color-warning-contrast-background: #4d3800;--reactodia-color-warning-contrast-foreground: #fff8e6;--reactodia-color-danger-contrast-background: #4b1113;--reactodia-color-danger-contrast-foreground: #ffebec;--reactodia-color-content: #e3e3e3;--reactodia-color-content-inverse: var(--reactodia-color-gray-0);--reactodia-color-content-contrast: var(--reactodia-color-gray-900);--reactodia-background-color: #1b1b1d;--reactodia-background-color-surface: #242526;--reactodia-border-color-base: #555;--reactodia-input-color: #ddd;--reactodia-input-color-placeholder: #878787;--reactodia-input-background-color: #393c3e;--reactodia-input-background-color-disabled: #2f2f2f;--reactodia-button-default-background-color: var(--reactodia-background-color-surface);--reactodia-button-default-background-color-active: #a4a6a8;--reactodia-button-default-background-color-focus: var(--reactodia-button-default-color);--reactodia-button-default-color: #ebedf0;--reactodia-button-default-color-focus: var(--reactodia-background-color-surface);--reactodia-draggable-handle-corner-color: rgba(255, 255, 255, .38);--reactodia-draggable-handle-corner-color-focus: rgba(255, 255, 255, .5);--reactodia-draggable-handle-side-color: #fff;--reactodia-canvas-box-shadow: 0 4px 15px 7px rgba(170, 170, 170, .05);--reactodia-canvas-overlay-color: rgba(0, 0, 0, .7);--reactodia-canvas-underlay-color: rgba(28, 28, 28, .6);--reactodia-element-background-color: #242526;--reactodia-link-stroke-color: var(--reactodia-color-emphasis-1000);--reactodia-monochrome-icon-filter: invert(1);--reactodia-selection-icon-filter: invert(1);--reactodia-selection-multiple-box-shadow: 0 0 7px 7px rgba(170, 170, 170, .13);--reactodia-navigator-background-fill: var(--reactodia-color-gray-900);--reactodia-navigator-viewport-stroke-color: var(--reactodia-color-gray-800)}.reactodia-workspace-light{color-scheme:light;--reactodia-color-gray-0: #ffffff;--reactodia-color-gray-100: #f5f6f7;--reactodia-color-gray-200: #ebedf0;--reactodia-color-gray-300: #dadde1;--reactodia-color-gray-400: #ccd0d5;--reactodia-color-gray-500: #bec3c9;--reactodia-color-gray-600: #8d949e;--reactodia-color-gray-700: #606770;--reactodia-color-gray-800: #444950;--reactodia-color-gray-900: #1c1e21;--reactodia-color-gray-1000: #000000;--reactodia-color-primary: #337ab7;--reactodia-color-primary-dark: #306cce;--reactodia-color-primary-darker: #2d66c3;--reactodia-color-primary-darkest: #2554a0;--reactodia-color-primary-light: #538ce9;--reactodia-color-primary-lighter: #72a1ed;--reactodia-color-primary-lightest: #9abcf2;--reactodia-color-secondary: #ebedf0;--reactodia-color-secondary-dark: #d4d5d8;--reactodia-color-secondary-darker: #c8c9cc;--reactodia-color-secondary-darkest: #a4a6a8;--reactodia-color-secondary-light: #eef0f2;--reactodia-color-secondary-lighter: #f1f2f5;--reactodia-color-secondary-lightest: #f5f6f8;--reactodia-color-success: #5cb85c;--reactodia-color-success-dark: #009400;--reactodia-color-success-darker: #008b00;--reactodia-color-success-darkest: #007300;--reactodia-color-success-light: #26b226;--reactodia-color-success-lighter: #4dbf4d;--reactodia-color-success-lightest: #80d280;--reactodia-color-info: #54c7ec;--reactodia-color-info-dark: #4cb3d4;--reactodia-color-info-darker: #47a9c9;--reactodia-color-info-darkest: #3b8ba5;--reactodia-color-info-light: #6ecfef;--reactodia-color-info-lighter: #87d8f2;--reactodia-color-info-lightest: #aae3f6;--reactodia-color-warning: #ffba00;--reactodia-color-warning-dark: #e6a700;--reactodia-color-warning-darker: #d99e00;--reactodia-color-warning-darkest: #b38200;--reactodia-color-warning-light: #ffc426;--reactodia-color-warning-lighter: #ffcf4d;--reactodia-color-warning-lightest: #ffdd80;--reactodia-color-danger: #c9302c;--reactodia-color-danger-dark: #e13238;--reactodia-color-danger-darker: #d53035;--reactodia-color-danger-darkest: #af272b;--reactodia-color-danger-light: #fb565b;--reactodia-color-danger-lighter: #fb7478;--reactodia-color-danger-lightest: #fd9c9f;--reactodia-font-family-base: \"Helvetica Neue\", \"Helvetica\", \"Arial\", sans-serif;--reactodia-font-family-monospace: \"Menlo\", \"Monaco\", \"Consolas\", \"Liberation Mono\", \"Courier New\", monospace;--reactodia-font-size-base: 87.5%;--reactodia-line-height-base: 1.42857;--reactodia-font-color-base: var(--reactodia-color-content);--reactodia-font-color-base-inverse: var(--reactodia-color-content-inverse);--reactodia-spacing-base: 5px;--reactodia-spacing-vertical: var(--reactodia-spacing-base);--reactodia-spacing-horizontal: var(--reactodia-spacing-base);--reactodia-z-index-base: 0;--reactodia-border-radius-base: 4px;--reactodia-border-radius-s: 2px;--reactodia-border-width-base: 1px;--reactodia-transition-duration: .3s;--reactodia-input-border-color: var(--reactodia-border-color-base);--reactodia-input-border-color-focus: var(--reactodia-color-primary-lighter);--reactodia-input-border-radius: var(--reactodia-border-radius-base);--reactodia-input-border-width: var(--reactodia-border-width-base);--reactodia-button-border-radius: var(--reactodia-border-radius-base);--reactodia-button-border-width: var(--reactodia-border-width-base);--reactodia-button-default-border-color: var(--reactodia-border-color-base);--reactodia-draggable-handle-corner-width: 10px;--reactodia-draggable-handle-side-width: 5px;--reactodia-tree-background-color-active: rgba(101, 166, 255, .3);--reactodia-tree-background-color-focus: rgba(189, 217, 255, .3);--reactodia-tree-border-color-active: rgba(115, 211, 255, .5);--reactodia-tree-border-color-focus: rgba(115, 211, 255, .3);--reactodia-dialog-border-color: var(--reactodia-border-color-base);--reactodia-dialog-border-radius: var(--reactodia-border-radius-base);--reactodia-dialog-border-width: var(--reactodia-border-width-base);--reactodia-dialog-viewport-breakpoint-s: 600px;--reactodia-canvas-background-color: var(--reactodia-background-color);--reactodia-viewport-dock-margin: 10px;--reactodia-selection-link-color: #d8956d;--reactodia-selection-single-box-margin: 5px;--reactodia-selection-single-box-color: #d8956d;--reactodia-selection-single-box-shadow: 0 0 5px 0 var(--reactodia-selection-single-box-color) inset;--reactodia-navigator-scrollable-pane-fill: var(--reactodia-navigator-background-fill);--reactodia-navigator-viewport-fill: var(--reactodia-canvas-background-color);--reactodia-navigator-viewport-stroke-width: 2;--reactodia-navigator-overflow-stroke-color: var(--reactodia-navigator-viewport-stroke-color);--reactodia-navigator-overflow-stroke-width: 2;--reactodia-navigator-overflow-stroke-dash: 5 5;--reactodia-toolbar-height: 30px;--reactodia-accordion-transition-duration: var(--reactodia-transition-duration);--reactodia-color-emphasis-0: var(--reactodia-color-gray-0);--reactodia-color-emphasis-100: var(--reactodia-color-gray-100);--reactodia-color-emphasis-200: var(--reactodia-color-gray-200);--reactodia-color-emphasis-300: var(--reactodia-color-gray-300);--reactodia-color-emphasis-400: var(--reactodia-color-gray-400);--reactodia-color-emphasis-500: var(--reactodia-color-gray-500);--reactodia-color-emphasis-600: var(--reactodia-color-gray-600);--reactodia-color-emphasis-700: var(--reactodia-color-gray-700);--reactodia-color-emphasis-800: var(--reactodia-color-gray-800);--reactodia-color-emphasis-900: var(--reactodia-color-gray-900);--reactodia-color-emphasis-1000: var(--reactodia-color-gray-1000);--reactodia-color-primary-contrast-background: #ebf2fc;--reactodia-color-primary-contrast-foreground: #102445;--reactodia-color-secondary-contrast-background: #fdfdfe;--reactodia-color-secondary-contrast-foreground: #474748;--reactodia-color-success-contrast-background: #e6f6e6;--reactodia-color-success-contrast-foreground: #003100;--reactodia-color-info-contrast-background: #eef9fd;--reactodia-color-info-contrast-foreground: #193c47;--reactodia-color-warning-contrast-background: #fff8e6;--reactodia-color-warning-contrast-foreground: #4d3800;--reactodia-color-danger-contrast-background: #ffebec;--reactodia-color-danger-contrast-foreground: #4b1113;--reactodia-color-content: var(--reactodia-color-emphasis-900);--reactodia-color-content-inverse: var(--reactodia-color-emphasis-0);--reactodia-color-content-contrast: var(--reactodia-color-content);--reactodia-background-color: var(--reactodia-color-emphasis-0);--reactodia-background-color-surface: var(--reactodia-color-content-inverse);--reactodia-border-color-base: #ccc;--reactodia-input-color: #555;--reactodia-input-color-placeholder: var(--reactodia-color-emphasis-600);--reactodia-input-background-color: var(--reactodia-background-color-surface);--reactodia-input-background-color-disabled: var(--reactodia-color-emphasis-400);--reactodia-button-default-background-color: var(--reactodia-background-color-surface);--reactodia-button-default-background-color-active: #e0e0e0;--reactodia-button-default-background-color-focus: #d4d4d4;--reactodia-button-default-color: #333333;--reactodia-button-default-color-focus: var(--reactodia-button-default-color);--reactodia-draggable-handle-corner-color: rgba(0, 0, 0, .38);--reactodia-draggable-handle-corner-color-focus: rgba(0, 0, 0, .5);--reactodia-draggable-handle-side-color: #000;--reactodia-canvas-box-shadow: 0 4px 15px 7px rgba(51, 51, 51, .05);--reactodia-canvas-overlay-color: rgba(255, 255, 255, .7);--reactodia-canvas-underlay-color: rgba(255, 255, 255, .7);--reactodia-element-background-color: #fafaf9;--reactodia-link-stroke-color: var(--reactodia-color-emphasis-1000);--reactodia-monochrome-icon-filter: ;--reactodia-selection-icon-filter: ;--reactodia-selection-multiple-box-shadow: 0 0 7px 7px rgba(51, 51, 51, .13);--reactodia-navigator-background-fill: var(--reactodia-color-gray-100);--reactodia-navigator-viewport-stroke-color: var(--reactodia-color-gray-200)}.reactodia-draggable-handle--dock-n,.reactodia-draggable-handle--dock-s{position:absolute;background-color:var(--reactodia-draggable-handle-side-color)}.reactodia-draggable-handle--dock-n:empty,.reactodia-draggable-handle--dock-s:empty{opacity:0}.reactodia-draggable-handle--dock-n:empty:hover,.reactodia-draggable-handle--dock-s:empty:hover{opacity:.1}.reactodia-draggable-handle--dock-n,.reactodia-draggable-handle--dock-s{width:100%;cursor:ns-resize}.reactodia-draggable-handle--dock-n:empty,.reactodia-draggable-handle--dock-s:empty{height:var(--reactodia-draggable-handle-side-width)}.reactodia-draggable-handle--dock-n{top:0}.reactodia-draggable-handle--dock-s{bottom:0}.reactodia-draggable-handle--dock-w,.reactodia-draggable-handle--dock-e{position:absolute;background-color:var(--reactodia-draggable-handle-side-color)}.reactodia-draggable-handle--dock-w:empty,.reactodia-draggable-handle--dock-e:empty{opacity:0}.reactodia-draggable-handle--dock-w:empty:hover,.reactodia-draggable-handle--dock-e:empty:hover{opacity:.1}.reactodia-draggable-handle--dock-w,.reactodia-draggable-handle--dock-e{top:0;height:100%;cursor:ew-resize}.reactodia-draggable-handle--dock-w:empty,.reactodia-draggable-handle--dock-e:empty{width:var(--reactodia-draggable-handle-side-width)}.reactodia-draggable-handle--dock-w{left:0}.reactodia-draggable-handle--dock-e{right:0}.reactodia-draggable-handle--dock-nw,.reactodia-draggable-handle--dock-ne,.reactodia-draggable-handle--dock-sw,.reactodia-draggable-handle--dock-se{position:absolute;width:0;height:0}.reactodia-draggable-handle--dock-nw:empty,.reactodia-draggable-handle--dock-ne:empty,.reactodia-draggable-handle--dock-sw:empty,.reactodia-draggable-handle--dock-se:empty{border-style:solid;border-radius:var(--reactodia-border-radius-base)}.reactodia-draggable-handle--dock-nw:empty:before,.reactodia-draggable-handle--dock-ne:empty:before,.reactodia-draggable-handle--dock-sw:empty:before,.reactodia-draggable-handle--dock-se:empty:before{content:\"\";position:absolute;width:0;height:0;border-style:solid;border-radius:var(--reactodia-border-radius-base)}.reactodia-draggable-handle--dock-nw,.reactodia-draggable-handle--dock-ne{border-color:var(--reactodia-draggable-handle-corner-color) transparent transparent transparent}.reactodia-draggable-handle--dock-nw:before,.reactodia-draggable-handle--dock-ne:before{top:calc(-1 * var(--reactodia-draggable-handle-corner-width));border-color:var(--reactodia-draggable-handle-corner-color) transparent transparent transparent}.reactodia-draggable-handle--dock-nw:hover,.reactodia-draggable-handle--dock-ne:hover{border-color:var(--reactodia-draggable-handle-corner-color-focus) transparent transparent transparent}.reactodia-draggable-handle--dock-nw{top:0;left:0;border-width:var(--reactodia-draggable-handle-corner-width) var(--reactodia-draggable-handle-corner-width) 0 0;cursor:nwse-resize}.reactodia-draggable-handle--dock-nw:before{left:0;border-width:calc(var(--reactodia-draggable-handle-corner-width) / 2) calc(var(--reactodia-draggable-handle-corner-width) / 2) 0 0}.reactodia-draggable-handle--dock-ne{top:0;right:0;border-width:var(--reactodia-draggable-handle-corner-width) 0 0 var(--reactodia-draggable-handle-corner-width);cursor:nesw-resize}.reactodia-draggable-handle--dock-ne:before{right:0;border-width:calc(var(--reactodia-draggable-handle-corner-width) / 2) 0 0 calc(var(--reactodia-draggable-handle-corner-width) / 2)}.reactodia-draggable-handle--dock-sw,.reactodia-draggable-handle--dock-se{border-color:transparent transparent var(--reactodia-draggable-handle-corner-color) transparent}.reactodia-draggable-handle--dock-sw:before,.reactodia-draggable-handle--dock-se:before{bottom:calc(-1 * var(--reactodia-draggable-handle-corner-width));border-color:transparent transparent var(--reactodia-draggable-handle-corner-color) transparent}.reactodia-draggable-handle--dock-sw:hover,.reactodia-draggable-handle--dock-se:hover{border-color:transparent transparent var(--reactodia-draggable-handle-corner-color-focus) transparent}.reactodia-draggable-handle--dock-sw{bottom:0;left:0;border-width:0 var(--reactodia-draggable-handle-corner-width) var(--reactodia-draggable-handle-corner-width) 0;cursor:nesw-resize}.reactodia-draggable-handle--dock-sw:before{left:0;border-width:0 calc(var(--reactodia-draggable-handle-corner-width) / 2) calc(var(--reactodia-draggable-handle-corner-width) / 2) 0}.reactodia-draggable-handle--dock-se{bottom:0;right:0;border-width:0 0 var(--reactodia-draggable-handle-corner-width) var(--reactodia-draggable-handle-corner-width);cursor:nwse-resize}.reactodia-draggable-handle--dock-se:before{right:0;border-width:0 0 calc(var(--reactodia-draggable-handle-corner-width) / 2) calc(var(--reactodia-draggable-handle-corner-width) / 2)}.reactodia-drag-link-mover{overflow:visible}.reactodia-drag-link-mover__highlight-overlay{fill:var(--reactodia-color-emphasis-0);fill-opacity:.3}.reactodia-drag-link-mover__highlight-allow,.reactodia-drag-link-mover__highlight-deny{stroke-width:3;fill:transparent}.reactodia-drag-link-mover__highlight-allow{stroke:var(--reactodia-color-success)}.reactodia-drag-link-mover__highlight-deny{stroke:var(--reactodia-color-danger)}.reactodia-drag-link-mover__drop-underlay{fill:var(--reactodia-color-emphasis-1000);fill-opacity:.1}.reactodia-drag-link-mover__drop-allow{stroke:var(--reactodia-color-success)}.reactodia-drag-link-mover__drop-deny>*{stroke:var(--reactodia-color-danger)}.reactodia-dropdown{position:relative;float:left;z-index:calc(var(--reactodia-z-index-base) + 40)}.reactodia-dropdown__content{position:absolute;opacity:1;display:flex;flex-direction:column;transition:opacity .1s ease-in-out}.reactodia-dropdown--up .reactodia-dropdown__content{bottom:100%}.reactodia-dropdown--expanded .reactodia-dropdown__content{box-shadow:var(--reactodia-canvas-box-shadow)}.reactodia-dropdown--collapsed .reactodia-dropdown__content{height:0;opacity:0;pointer-events:none;transition:none}.reactodia-dropdown--down.reactodia-dropdown--expanded .reactodia-dropdown-menu__toggle{border-bottom:none;border-bottom-left-radius:unset;border-bottom-right-radius:unset}.reactodia-dropdown--up.reactodia-dropdown--expanded .reactodia-dropdown-menu__toggle{border-top:none;border-top-left-radius:unset;border-top-right-radius:unset}.reactodia-dropdown-menu__toggle:before{-webkit-mask:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20d='M16%205H0V4h16v1zm0%208H0v-1h16v1zm0-4.008H0V8h16v.992z'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;mask:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20d='M16%205H0V4h16v1zm0%208H0v-1h16v1zm0-4.008H0V8h16v.992z'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;background-color:currentColor;content:\"\";display:block;height:16px;width:16px}.reactodia-dropdown-menu__items{margin:0;padding:0;list-style:none;display:flex;background-color:var(--reactodia-background-color-surface)}.reactodia-dropdown--down .reactodia-dropdown-menu__items{flex-direction:column}.reactodia-dropdown--up .reactodia-dropdown-menu__items{flex-direction:column-reverse}.reactodia-dropdown-menu-item{display:flex;border-radius:unset}.reactodia-dropdown--down .reactodia-dropdown-menu-item:first-child{border-top-right-radius:var(--reactodia-button-border-radius)}.reactodia-dropdown--down .reactodia-dropdown-menu-item:last-child{border-bottom-left-radius:var(--reactodia-button-border-radius);border-bottom-right-radius:var(--reactodia-button-border-radius)}.reactodia-dropdown--down .reactodia-dropdown-menu-item~.reactodia-dropdown-menu-item{margin-top:calc(-1 * var(--reactodia-button-border-width));border-top-color:var(--reactodia-button-default-border-color)}.reactodia-dropdown--up .reactodia-dropdown-menu-item:first-child{border-bottom-right-radius:var(--reactodia-button-border-radius)}.reactodia-dropdown--up .reactodia-dropdown-menu-item:last-child{border-top-left-radius:var(--reactodia-button-border-radius);border-top-right-radius:var(--reactodia-button-border-radius)}.reactodia-dropdown--up .reactodia-dropdown-menu-item~.reactodia-dropdown-menu-item{margin-bottom:calc(-1 * var(--reactodia-button-border-width));border-bottom-color:var(--reactodia-button-default-border-color)}.reactodia-dropdown-menu-item--disabled,.reactodia-dropdown-menu-item--disabled:hover{color:var(--reactodia-button-default-color);background-color:var(--reactodia-input-background-color-disabled);cursor:not-allowed;opacity:.65}.reactodia-inline-entity{border:1px solid var(--reactodia-inline-entity-color);background:var(--reactodia-inline-entity-color);padding-left:5px;word-wrap:break-word;line-height:1.3}.reactodia-inline-entity__label{background:var(--reactodia-element-background-color);padding:0 2px}.reactodia-list-element-view{position:relative;display:block;background:var(--reactodia-element-style-color);padding:1px 1px 1px 10px;border-radius:var(--reactodia-border-radius-s);margin:0 0 2px;opacity:1;cursor:move;-webkit-user-select:none;user-select:none}.reactodia-list-element-view--disabled{opacity:.4;cursor:default}.reactodia-list-element-view__label{background:var(--reactodia-element-background-color);border-radius:0 var(--reactodia-border-radius-s) var(--reactodia-border-radius-s) 0;font-family:var(--reactodia-font-family-base);font-size:15px;min-height:1.3em;padding-left:7px;padding-right:5px;overflow-wrap:break-word}.reactodia-list-element-view--selected .reactodia-list-element-view__label{color:var(--reactodia-color-content-contrast)}.reactodia-text-highlight{font-weight:700}.reactodia-no-search-results{text-align:center;font-style:italic;color:var(--reactodia-input-color-placeholder)}@keyframes reactodia-progress-bar-stripes{0%{background-position:40px 0}to{background-position:0 0}}.reactodia-progress-bar{flex-shrink:0;width:100%;overflow:hidden;background-color:var(--reactodia-color-emphasis-200);box-shadow:inset 0 1px 2px #0000001a}.reactodia-progress-bar__bar{float:left;height:100%;transition:width .6s ease;background-color:var(--reactodia-color-primary);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-repeat:repeat-x;background-size:40px 40px;animation:reactodia-progress-bar-stripes 2s linear infinite}.reactodia-progress-bar--error .reactodia-progress-bar__bar{background-color:var(--reactodia-color-danger)}.reactodia-progress-bar--loading,.reactodia-progress-bar--error{transition:height var(--reactodia-transition-duration) .3s}.reactodia-progress-bar--completed{transition:height var(--reactodia-transition-duration) 0ms}.reactodia-resizable-box{border:var(--reactodia-resizable-box-border-width) solid var(--reactodia-resizable-box-color)}.reactodia-resizable-box__handle{background-color:unset;touch-action:none}.reactodia-resizable-box__handle.reactodia-draggable-handle--dock-n,.reactodia-resizable-box__handle.reactodia-draggable-handle--dock-s,.reactodia-resizable-box__handle.reactodia-draggable-handle--dock-w,.reactodia-resizable-box__handle.reactodia-draggable-handle--dock-e{display:flex;justify-content:center;align-items:center}.reactodia-resizable-box__handle.reactodia-draggable-handle--dock-n{margin-top:calc(-.5 * var(--reactodia-resizable-box-border-width))}.reactodia-resizable-box__handle.reactodia-draggable-handle--dock-s{margin-bottom:calc(-.5 * var(--reactodia-resizable-box-border-width))}.reactodia-resizable-box__handle.reactodia-draggable-handle--dock-w{margin-left:calc(-.5 * var(--reactodia-resizable-box-border-width))}.reactodia-resizable-box__handle.reactodia-draggable-handle--dock-e{margin-right:calc(-.5 * var(--reactodia-resizable-box-border-width))}.reactodia-resizable-box__handle rect{stroke-width:2}.reactodia-resizable-box__handle circle,.reactodia-resizable-box__handle rect{stroke:var(--reactodia-resizable-box-color);fill:var(--reactodia-canvas-background-color)}.reactodia-resizable-box__handle:hover circle,.reactodia-resizable-box__handle:hover rect{fill:var(--reactodia-resizable-box-color)}.reactodia-resizable-box__corner{position:absolute;left:-10px;top:-10px;width:20px;height:20px}.reactodia-resizable-box__vertical{position:absolute;width:30px;height:10px}.reactodia-resizable-box__horizontal{position:absolute;width:10px;height:30px}.reactodia-search-input{display:flex}.reactodia-search-input__input::placeholder{color:var(--reactodia-input-color-placeholder)}.reactodia-search-input--has-submit .reactodia-search-input__input{border-top-right-radius:unset;border-bottom-right-radius:unset}.reactodia-search-input__clear-container{width:0;overflow:visible;display:flex;align-items:center}.reactodia-search-input__clear{position:relative;left:-33px;padding:8px;cursor:pointer;color:var(--reactodia-button-default-color);background:transparent;border:0;border-top-right-radius:var(--reactodia-input-border-radius);border-bottom-right-radius:var(--reactodia-input-border-radius);transition:background-color var(--reactodia-transition-duration)}.reactodia-search-input__clear:hover{color:var(--reactodia-button-default-color-focus);background-color:var(--reactodia-button-default-background-color-focus)}.reactodia-search-input__clear:after{-webkit-mask:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M8%208.707l3.646%203.647.708-.707L8.707%208l3.647-3.646-.707-.708L8%207.293%204.354%203.646l-.707.708L7.293%208l-3.646%203.646.707.708L8%208.707z'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;mask:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M8%208.707l3.646%203.647.708-.707L8.707%208l3.647-3.646-.707-.708L8%207.293%204.354%203.646l-.707.708L7.293%208l-3.646%203.646.707.708L8%208.707z'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;background-color:currentColor;content:\"\";display:block;height:16px;width:16px}.reactodia-search-input--has-submit .reactodia-search-input__clear{border-top-right-radius:unset;border-bottom-right-radius:unset}.reactodia-search-input__submit{margin-left:-1px;border-top-left-radius:unset;border-bottom-left-radius:unset}.reactodia-search-input__submit:before{-webkit-mask:url(\"data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20d='M15.25%200a8.25%208.25%200%200%200-6.18%2013.72L1%2022.88l1.12%201%208.05-9.12A8.251%208.251%200%201%200%2015.25.01V0zm0%2015a6.75%206.75%200%201%201%200-13.5%206.75%206.75%200%200%201%200%2013.5z'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;mask:url(\"data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20d='M15.25%200a8.25%208.25%200%200%200-6.18%2013.72L1%2022.88l1.12%201%208.05-9.12A8.251%208.251%200%201%200%2015.25.01V0zm0%2015a6.75%206.75%200%201%201%200-13.5%206.75%206.75%200%200%201%200%2013.5z'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;background-color:currentColor;content:\"\";display:block;height:16px;width:16px}.reactodia-search-results{margin:0;padding:0;outline:none}.reactodia-viewport-dock--row-n,.reactodia-viewport-dock--row-s,.reactodia-viewport-dock--column-w,.reactodia-viewport-dock--column-e{pointer-events:none}.reactodia-viewport-dock--row-n>*,.reactodia-viewport-dock--row-s>*,.reactodia-viewport-dock--column-w>*,.reactodia-viewport-dock--column-e>*{pointer-events:auto}.reactodia-viewport-dock--row-n,.reactodia-viewport-dock--row-s{position:absolute;left:0;right:0;display:flex;justify-content:center}.reactodia-viewport-dock--row-n{top:calc(var(--reactodia-viewport-dock-margin) + var(--reactodia-viewport-dock-offset-y, 0px))}.reactodia-viewport-dock--row-s{bottom:calc(var(--reactodia-viewport-dock-margin) + var(--reactodia-viewport-dock-offset-y, 0px))}.reactodia-viewport-dock--column-w,.reactodia-viewport-dock--column-e{position:absolute;top:0;bottom:0;display:flex;flex-direction:column;justify-content:center}.reactodia-viewport-dock--column-w{left:calc(var(--reactodia-viewport-dock-margin) + var(--reactodia-viewport-dock-offset-x, 0px))}.reactodia-viewport-dock--column-e{right:calc(var(--reactodia-viewport-dock-margin) + var(--reactodia-viewport-dock-offset-x, 0px))}.reactodia-viewport-dock--corner{display:contents}.reactodia-viewport-dock--dock-nw{position:absolute;left:calc(var(--reactodia-viewport-dock-margin) + var(--reactodia-viewport-dock-offset-x, 0px));top:calc(var(--reactodia-viewport-dock-margin) + var(--reactodia-viewport-dock-offset-y, 0px))}.reactodia-viewport-dock--dock-ne{position:absolute;right:calc(var(--reactodia-viewport-dock-margin) + var(--reactodia-viewport-dock-offset-x, 0px));top:calc(var(--reactodia-viewport-dock-margin) + var(--reactodia-viewport-dock-offset-y, 0px))}.reactodia-viewport-dock--dock-se{position:absolute;right:calc(var(--reactodia-viewport-dock-margin) + var(--reactodia-viewport-dock-offset-x, 0px));bottom:calc(var(--reactodia-viewport-dock-margin) + var(--reactodia-viewport-dock-offset-y, 0px))}.reactodia-viewport-dock--dock-sw{position:absolute;left:calc(var(--reactodia-viewport-dock-margin) + var(--reactodia-viewport-dock-offset-x, 0px));bottom:calc(var(--reactodia-viewport-dock-margin) + var(--reactodia-viewport-dock-offset-y, 0px))}.reactodia-canvas{flex:1 1 0px;width:100%;display:flex;overflow:hidden}.reactodia-class-tree{flex:auto;display:flex;flex-direction:column}.reactodia-class-tree__filter{flex-shrink:0;margin:10px 0}.reactodia-class-tree--controlled .reactodia-class-tree__filter{margin-top:0}.reactodia-class-tree__filter-group{margin-left:10px;margin-right:10px}.reactodia-class-tree__only-creatable{display:block;margin-top:5px}.reactodia-class-tree__tree{border-top:1px solid var(--reactodia-border-color-base)}.reactodia-class-tree__no-results{margin-top:10px}.reactodia-class-tree__spinner{align-self:center;margin:auto}.reactodia-class-tree-item{margin:1px 0}.reactodia-class-tree-item__row{display:flex;align-items:center;white-space:nowrap;-webkit-user-select:none;user-select:none}.reactodia-class-tree-item__row>*{flex-shrink:0}.reactodia-class-tree-item__body{display:flex;align-items:center;text-decoration:none;font-size:15px;padding:1px;border:1px solid;border-color:transparent;border-radius:var(--reactodia-border-radius-s)}.reactodia-class-tree-item__body:hover{background:var(--reactodia-tree-background-color-focus);border-color:var(--reactodia-tree-border-color-focus);cursor:pointer}.reactodia-class-tree-item__body--selected{background-color:var(--reactodia-tree-background-color-active);border-color:var(--reactodia-tree-border-color-active)}.reactodia-class-tree-item__icon-container{height:20px}.reactodia-class-tree-item__icon{display:block;height:100%}.reactodia-class-tree-item__icon--monochrome{filter:var(--reactodia-monochrome-icon-filter)}.reactodia-class-tree-item__default-icon-leaf,.reactodia-class-tree-item__default-icon-parent{-webkit-mask:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20d='M13.51%204l-5-3h-1l-5%203-.49.86v6l.49.85%205%203h1l5-3%20.49-.85v-6L13.51%204zm-6%209.56l-4.5-2.7V5.7l4.5%202.45v5.41zM3.27%204.7l4.74-2.84%204.74%202.84-4.74%202.59L3.27%204.7zm9.74%206.16l-4.5%202.7V8.15l4.5-2.45v5.16z'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;mask:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20d='M13.51%204l-5-3h-1l-5%203-.49.86v6l.49.85%205%203h1l5-3%20.49-.85v-6L13.51%204zm-6%209.56l-4.5-2.7V5.7l4.5%202.45v5.41zM3.27%204.7l4.74-2.84%204.74%202.84-4.74%202.59L3.27%204.7zm9.74%206.16l-4.5%202.7V8.15l4.5-2.45v5.16z'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;background-color:currentColor;content:\"\";display:block;height:16px;width:16px;width:20px;height:20px;color:var(--reactodia-element-style-color)}.reactodia-class-tree-item__label{margin-left:5px;color:var(--reactodia-font-color-base)}.reactodia-class-tree-item__highlighted-term{font-weight:700}.reactodia-class-tree-item__count{margin-left:5px}.reactodia-class-tree-item__children{margin-left:20px}.reactodia-class-tree-item__toggle,.reactodia-class-tree-item__toggle-expanded,.reactodia-class-tree-item__toggle-collapsed{margin:2px}.reactodia-class-tree-item__toggle-expanded,.reactodia-class-tree-item__toggle-collapsed{opacity:.5}.reactodia-class-tree-item__toggle-expanded:hover,.reactodia-class-tree-item__toggle-collapsed:hover{cursor:pointer;opacity:1;transition:opacity var(--reactodia-transition-duration)}.reactodia-class-tree-item__toggle:before{display:block;content:\"\";width:16px;height:16px}.reactodia-class-tree-item__toggle-expanded:before{-webkit-mask:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20d='M2%205.56L2.413%205h11.194l.393.54L8.373%2011h-.827L2%205.56z'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;mask:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20d='M2%205.56L2.413%205h11.194l.393.54L8.373%2011h-.827L2%205.56z'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;background-color:currentColor;content:\"\";display:block;height:16px;width:16px}.reactodia-class-tree-item__toggle-collapsed:before{-webkit-mask:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20d='M5.56%2014L5%2013.587V2.393L5.54%202%2011%207.627v.827L5.56%2014z'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;mask:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20d='M5.56%2014L5%2013.587V2.393L5.54%202%2011%207.627v.827L5.56%2014z'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;background-color:currentColor;content:\"\";display:block;height:16px;width:16px}.reactodia-class-tree-item__create-button{margin-left:5px;padding:5px 4px 5px 5px;cursor:move}.reactodia-class-tree-item__create-button:before{-webkit-mask:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20d='M14%207v1H8v6H7V8H1V7h6V1h1v6h6z'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;mask:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20d='M14%207v1H8v6H7V8H1V7h6V1h1v6h6z'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;background-color:currentColor;content:\"\";display:block;height:16px;width:16px;width:12px;height:12px}.reactodia-connections-menu{flex:auto;display:flex;flex-direction:column}.reactodia-connections-menu__breadcrumbs{padding:10px 10px 0;overflow:hidden;text-overflow:ellipsis;height:30px;min-height:30px;flex-grow:0}.reactodia-connections-menu__breadcrumbs-link{color:var(--reactodia-color-primary);cursor:pointer;text-decoration:none}.reactodia-connections-menu__breadcrumbs-link:hover{text-decoration:underline}.reactodia-connections-menu__search{padding:10px;align-items:center;flex:0 0 auto}.reactodia-connections-menu__sort-switches{flex:0 0 20px;margin-left:10px}.reactodia-connections-menu__sort-switch{display:none}.reactodia-connections-menu__sort-switch:checked+.reactodia-connections-menu__sort-switch-label{color:var(--reactodia-color-primary-light);opacity:1}.reactodia-connections-menu__sort-switch-label{cursor:pointer;display:block;margin:0;opacity:.4;text-align:center}.reactodia-connections-menu__sort-switch-label:hover{opacity:1}.reactodia-connections-menu__sort-label-alpha:before{-webkit-mask:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M7.223%2010.933c.326.192.699.29%201.077.282a2.159%202.159%200%200%200%201.754-.842%203.291%203.291%200%200%200%20.654-2.113%202.886%202.886%200%200%200-.576-1.877%201.99%201.99%200%200%200-1.634-.733%202.294%202.294%200%200%200-1.523.567V3.475h-.991V11.1h.995v-.344c.076.066.158.125.244.177zM7.85%206.7c.186-.079.388-.113.59-.1a1.08%201.08%200%200%201%20.896.428c.257.363.382.802.357%201.245a2.485%202.485%200%200%201-.4%201.484%201.133%201.133%200%200%201-.96.508%201.224%201.224%200%200%201-.976-.417A1.522%201.522%200%200%201%206.975%208.8v-.6a1.722%201.722%200%200%201%20.393-1.145c.13-.154.296-.276.482-.355zM3.289%205.675a3.03%203.03%200%200%200-.937.162%202.59%202.59%200%200%200-.8.4l-.1.077v1.2l.423-.359a2.1%202.1%200%200%201%201.366-.572.758.758%200%200%201%20.661.282c.15.232.23.503.231.779L2.9%207.825a2.6%202.6%200%200%200-1.378.575%201.65%201.65%200%200%200-.022%202.336%201.737%201.737%200%200%200%201.253.454%201.96%201.96%200%200%200%201.107-.332c.102-.068.197-.145.286-.229v.444h.941V7.715a2.193%202.193%200%200%200-.469-1.5%201.687%201.687%200%200%200-1.329-.54zm.857%203.041c.02.418-.12.829-.391%201.148a1.221%201.221%200%200%201-.955.422.832.832%200%200%201-.608-.2.833.833%200%200%201%200-1.091c.281-.174.6-.277.93-.3l1.02-.148.004.169zm8.313%202.317c.307.13.64.193.973.182.495.012.983-.114%201.41-.365l.123-.075.013-.007V9.615l-.446.32c-.316.224-.696.34-1.084.329A1.3%201.3%200%200%201%2012.4%209.8a1.975%201.975%200%200%201-.4-1.312%202.01%202.01%200%200%201%20.453-1.381A1.432%201.432%200%200%201%2013.6%206.6a1.8%201.8%200%200%201%20.971.279l.43.265V5.97l-.17-.073a2.9%202.9%200%200%200-1.17-.247%202.52%202.52%200%200%200-1.929.817%202.9%202.9%200%200%200-.747%202.049c-.028.707.21%201.4.67%201.939.222.249.497.446.804.578z'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;mask:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M7.223%2010.933c.326.192.699.29%201.077.282a2.159%202.159%200%200%200%201.754-.842%203.291%203.291%200%200%200%20.654-2.113%202.886%202.886%200%200%200-.576-1.877%201.99%201.99%200%200%200-1.634-.733%202.294%202.294%200%200%200-1.523.567V3.475h-.991V11.1h.995v-.344c.076.066.158.125.244.177zM7.85%206.7c.186-.079.388-.113.59-.1a1.08%201.08%200%200%201%20.896.428c.257.363.382.802.357%201.245a2.485%202.485%200%200%201-.4%201.484%201.133%201.133%200%200%201-.96.508%201.224%201.224%200%200%201-.976-.417A1.522%201.522%200%200%201%206.975%208.8v-.6a1.722%201.722%200%200%201%20.393-1.145c.13-.154.296-.276.482-.355zM3.289%205.675a3.03%203.03%200%200%200-.937.162%202.59%202.59%200%200%200-.8.4l-.1.077v1.2l.423-.359a2.1%202.1%200%200%201%201.366-.572.758.758%200%200%201%20.661.282c.15.232.23.503.231.779L2.9%207.825a2.6%202.6%200%200%200-1.378.575%201.65%201.65%200%200%200-.022%202.336%201.737%201.737%200%200%200%201.253.454%201.96%201.96%200%200%200%201.107-.332c.102-.068.197-.145.286-.229v.444h.941V7.715a2.193%202.193%200%200%200-.469-1.5%201.687%201.687%200%200%200-1.329-.54zm.857%203.041c.02.418-.12.829-.391%201.148a1.221%201.221%200%200%201-.955.422.832.832%200%200%201-.608-.2.833.833%200%200%201%200-1.091c.281-.174.6-.277.93-.3l1.02-.148.004.169zm8.313%202.317c.307.13.64.193.973.182.495.012.983-.114%201.41-.365l.123-.075.013-.007V9.615l-.446.32c-.316.224-.696.34-1.084.329A1.3%201.3%200%200%201%2012.4%209.8a1.975%201.975%200%200%201-.4-1.312%202.01%202.01%200%200%201%20.453-1.381A1.432%201.432%200%200%201%2013.6%206.6a1.8%201.8%200%200%201%20.971.279l.43.265V5.97l-.17-.073a2.9%202.9%200%200%200-1.17-.247%202.52%202.52%200%200%200-1.929.817%202.9%202.9%200%200%200-.747%202.049c-.028.707.21%201.4.67%201.939.222.249.497.446.804.578z'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;background-color:currentColor;content:\"\";display:block;height:16px;width:16px}.reactodia-connections-menu__sort-label-smart:before{-webkit-mask:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M11.67%208.658a3.661%203.661%200%200%200-.781%201.114%203.28%203.28%200%200%200-.268%201.329v1.6a1.304%201.304%200%200%201-.794%201.197%201.282%201.282%200%200%201-.509.102H7.712a1.285%201.285%200%200%201-.922-.379%201.303%201.303%200%200%201-.38-.92v-1.6c0-.479-.092-.921-.274-1.329a3.556%203.556%200%200%200-.776-1.114%204.689%204.689%200%200%201-1.006-1.437A4.187%204.187%200%200%201%204%205.5a4.432%204.432%200%200%201%20.616-2.27c.197-.336.432-.64.705-.914a4.6%204.6%200%200%201%20.911-.702c.338-.196.7-.348%201.084-.454a4.45%204.45%200%200%201%201.2-.16%204.476%204.476%200%200%201%202.276.614%204.475%204.475%200%200%201%201.622%201.616%204.438%204.438%200%200%201%20.616%202.27c0%20.617-.117%201.191-.353%201.721a4.69%204.69%200%200%201-1.006%201.437zM9.623%2010.5H7.409v2.201c0%20.081.028.15.09.212a.29.29%200%200%200%20.213.09h1.606a.289.289%200%200%200%20.213-.09.286.286%200%200%200%20.09-.212V10.5z'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;mask:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M11.67%208.658a3.661%203.661%200%200%200-.781%201.114%203.28%203.28%200%200%200-.268%201.329v1.6a1.304%201.304%200%200%201-.794%201.197%201.282%201.282%200%200%201-.509.102H7.712a1.285%201.285%200%200%201-.922-.379%201.303%201.303%200%200%201-.38-.92v-1.6c0-.479-.092-.921-.274-1.329a3.556%203.556%200%200%200-.776-1.114%204.689%204.689%200%200%201-1.006-1.437A4.187%204.187%200%200%201%204%205.5a4.432%204.432%200%200%201%20.616-2.27c.197-.336.432-.64.705-.914a4.6%204.6%200%200%201%20.911-.702c.338-.196.7-.348%201.084-.454a4.45%204.45%200%200%201%201.2-.16%204.476%204.476%200%200%201%202.276.614%204.475%204.475%200%200%201%201.622%201.616%204.438%204.438%200%200%201%20.616%202.27c0%20.617-.117%201.191-.353%201.721a4.69%204.69%200%200%201-1.006%201.437zM9.623%2010.5H7.409v2.201c0%20.081.028.15.09.212a.29.29%200%200%200%20.213.09h1.606a.289.289%200%200%200%20.213-.09.286.286%200%200%200%20.09-.212V10.5z'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;background-color:currentColor;content:\"\";display:block;height:16px;width:16px}.reactodia-connections-menu__spinner{align-self:center;margin:auto}.reactodia-connections-menu__links-list{padding:5px;overflow-x:hidden;overflow-y:auto;border-top:1px solid var(--reactodia-border-color-base);flex-grow:1;margin:0}.reactodia-connections-menu__links-list-empty{display:flex;align-items:center}.reactodia-connections-menu__links-no-results{width:100%;font-size:x-large;font-weight:700;color:var(--reactodia-color-emphasis-400);text-align:center}.reactodia-connections-menu__links-probably-label{font-weight:700;margin:5px 0}.reactodia-connections-menu__links-list-hr{border:0;border-top:1px solid var(--reactodia-border-color-base);height:0;margin-top:6px;margin-bottom:6px}.reactodia-connections-menu__link{display:flex;overflow:hidden;padding:0 5px 0 0;align-items:center;margin-bottom:4px;background:var(--reactodia-color-emphasis-200);border-radius:var(--reactodia-border-radius-s)}.reactodia-connections-menu__link:hover{background-color:var(--reactodia-color-emphasis-400)}.reactodia-connections-menu__link-direction{flex-shrink:0;min-height:30px;padding:5px 0 5px 10px;display:flex;align-items:center}.reactodia-connections-menu__link:not(:hover) .reactodia-connections-menu__link-direction{background:var(--reactodia-color-emphasis-300)}.reactodia-connections-menu__link-direction-in,.reactodia-connections-menu__link-direction-out{-webkit-mask-position:0 0;mask-position:0 0;-webkit-mask-size:contain;mask-size:contain;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;flex-shrink:0;width:20px;height:20px;opacity:.5;background-color:currentColor}.reactodia-connections-menu__link-direction-in{-webkit-mask-image:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20d='m%205.9,6%20h%20-1%20V%203%20h%2010%20v%2010%20h%20-10%20v%20-3%20h%201%20v%202%20h%208%20V%204%20h%20-8%20z'%20/%3e%3cpath%20d='M%201.5,7.5%20H%207.771919%20L%206.44298,6%207.10745,5.25%209.4,7.8376461%20V%208.1623539%20L%207.10745,10.75%206.44298,10%207.771919,8.5%20H%201.5%20Z'%20/%3e%3c/svg%3e\");mask-image:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20d='m%205.9,6%20h%20-1%20V%203%20h%2010%20v%2010%20h%20-10%20v%20-3%20h%201%20v%202%20h%208%20V%204%20h%20-8%20z'%20/%3e%3cpath%20d='M%201.5,7.5%20H%207.771919%20L%206.44298,6%207.10745,5.25%209.4,7.8376461%20V%208.1623539%20L%207.10745,10.75%206.44298,10%207.771919,8.5%20H%201.5%20Z'%20/%3e%3c/svg%3e\");margin:0 14px 0 0}.reactodia-connections-menu__link-direction-out{-webkit-mask-image:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20d='m%2010.5,6%20h%201%20V%203%20h%20-10%20v%2010%20h%2010%20v%20-3%20h%20-1%20v%202%20h%20-8%20V%204%20h%208%20z'%20/%3e%3cpath%20d='m%207,7.5%20h%206.271919%20L%2011.94298,6%2012.60745,5.25%2014.9,7.8376461%20V%208.1623539%20L%2012.60745,10.75%2011.94298,10%2013.271919,8.5%20H%207%20Z'%20/%3e%3c/svg%3e\");mask-image:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20d='m%2010.5,6%20h%201%20V%203%20h%20-10%20v%2010%20h%2010%20v%20-3%20h%20-1%20v%202%20h%20-8%20V%204%20h%208%20z'%20/%3e%3cpath%20d='m%207,7.5%20h%206.271919%20L%2011.94298,6%2012.60745,5.25%2014.9,7.8376461%20V%208.1623539%20L%2012.60745,10.75%2011.94298,10%2013.271919,8.5%20H%207%20Z'%20/%3e%3c/svg%3e\");margin:0 8px 0 6px}.reactodia-connections-menu__link-title{flex-grow:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin:5px 0 5px 5px}.reactodia-connections-menu__link-count{flex-shrink:0;margin-left:10px}.reactodia-connections-menu__link-navigate-button{flex-shrink:0;float:right;-webkit-mask-image:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M10.072%208.024L5.715%203.667l.618-.62L11%207.716v.618L6.333%2013l-.618-.619%204.357-4.357z'/%3e%3c/svg%3e\");mask-image:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M10.072%208.024L5.715%203.667l.618-.62L11%207.716v.618L6.333%2013l-.618-.619%204.357-4.357z'/%3e%3c/svg%3e\");-webkit-mask-size:cover;mask-size:cover;width:20px;height:20px;opacity:.5;margin-left:10px;min-width:16px;background-color:currentColor}.reactodia-connections-menu__link-navigate-button:hover{opacity:1}.reactodia-connections-menu__link-filter-button{flex-shrink:0;-webkit-mask-image:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20d='m%2014.5,3.5%20-1,-1%20m%200,0%20H%202.5%20V%203.0652324%20L%206.9861526,8%207.5,8.5652322%20V%2012.5103%20l%201,-0.733333%20V%208.5489178%20l%205,-5.4999998%20z%20m%200,0.548918%20V%204.6%20m%200,0%20-4,4.4%20v%203.3%20l%20-3,2.2%20V%209%20l%20-5,-5.5%20v%20-2%20h%2013%20v%202'%20/%3e%3cpath%20d='M%203.0187424,8%20H%204%20v%201.5%20h%201.5%20v%201%20L%204,10.467287%20V%2012%20H%203%20V%2010.5%20H%201.5%20v%20-1%20H%203%20Z'%20/%3e%3c/svg%3e\");mask-image:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20d='m%2014.5,3.5%20-1,-1%20m%200,0%20H%202.5%20V%203.0652324%20L%206.9861526,8%207.5,8.5652322%20V%2012.5103%20l%201,-0.733333%20V%208.5489178%20l%205,-5.4999998%20z%20m%200,0.548918%20V%204.6%20m%200,0%20-4,4.4%20v%203.3%20l%20-3,2.2%20V%209%20l%20-5,-5.5%20v%20-2%20h%2013%20v%202'%20/%3e%3cpath%20d='M%203.0187424,8%20H%204%20v%201.5%20h%201.5%20v%201%20L%204,10.467287%20V%2012%20H%203%20V%2010.5%20H%201.5%20v%20-1%20H%203%20Z'%20/%3e%3c/svg%3e\");-webkit-mask-size:20px 20px;mask-size:20px 20px;width:20px;height:20px;opacity:.4;margin-left:10px;background-color:currentColor}.reactodia-connections-menu__link-filter-button:hover{opacity:1}.reactodia-connections-menu__move-to-filter{display:flex;padding:5px 10px;cursor:pointer;-webkit-user-select:none;user-select:none}.reactodia-connections-menu__move-to-filter:hover{color:var(--reactodia-button-default-color-focus);background-color:var(--reactodia-button-default-background-color-focus)}.reactodia-connections-menu__objects{flex-grow:1;padding:0 10px 10px;position:relative;display:flex;flex-direction:column}.reactodia-connections-menu__objects-select-all{white-space:nowrap;margin-bottom:5px;display:flex}.reactodia-connections-menu__objects-select-all input{margin-right:5px}.reactodia-connections-menu__objects-select-all input:disabled{opacity:.3}.reactodia-connections-menu__objects-loading,.reactodia-connections-menu__objects-no-results{flex-grow:1;display:flex;align-items:center;justify-content:center;border:1px solid var(--reactodia-color-emphasis-400);margin-bottom:5px}.reactodia-connections-menu__objects-no-results{position:relative;font-size:x-large;font-weight:700;color:var(--reactodia-color-emphasis-400)}.reactodia-connections-menu__objects-list{border:var(--reactodia-border-width-base) solid var(--reactodia-border-color-base);border-radius:var(--reactodia-border-radius-base);height:0;flex-grow:1;overflow-x:hidden;overflow-y:scroll;padding:5px;margin-bottom:5px}.reactodia-connections-menu__objects-statusbar{display:flex;justify-content:flex-end;height:25px;white-space:nowrap}.reactodia-connections-menu__objects-extra{color:var(--reactodia-color-emphasis-600);cursor:help}.reactodia-connections-menu__objects-spacer{flex:auto}.reactodia-connections-menu__objects-add-button{height:25px;padding-top:1px;padding-bottom:2px}.reactodia-connections-menu__objects-add-button:not(:last-child){margin-right:var(--reactodia-spacing-horizontal)}.reactodia-dialog{background:var(--reactodia-background-color-surface);border:var(--reactodia-dialog-border-width) solid var(--reactodia-dialog-border-color);border-radius:var(--reactodia-dialog-border-radius);box-shadow:var(--reactodia-canvas-box-shadow);position:absolute;display:flex;flex-direction:column}.reactodia-dialog__header{display:flex}.reactodia-dialog__caption{flex:auto;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;font-weight:700;margin:8px 0 0 8px}.reactodia-dialog__close-button{padding:6px;background:none;color:var(--reactodia-button-default-color);border:none;border-top-left-radius:unset;border-bottom-right-radius:unset;transition:background-color var(--reactodia-transition-duration)}.reactodia-dialog__close-button:before{-webkit-mask:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M8%208.707l3.646%203.647.708-.707L8.707%208l3.647-3.646-.707-.708L8%207.293%204.354%203.646l-.707.708L7.293%208l-3.646%203.646.707.708L8%208.707z'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;mask:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M8%208.707l3.646%203.647.708-.707L8.707%208l3.647-3.646-.707-.708L8%207.293%204.354%203.646l-.707.708L7.293%208l-3.646%203.646.707.708L8%208.707z'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;background-color:currentColor;content:\"\";display:block;height:16px;width:16px}.reactodia-dialog__close-button:hover{color:var(--reactodia-button-default-color-focus);background-color:var(--reactodia-button-default-background-color-focus)}.reactodia-viewport-dialog-overlay{position:absolute;inset:0;z-index:calc(var(--reactodia-z-index-base) + 60);display:flex;align-items:center;justify-content:center;background-color:var(--reactodia-canvas-overlay-color)}.reactodia-halo{position:absolute;left:calc(var(--reactodia-halo-left) - var(--reactodia-selection-single-box-margin));top:calc(var(--reactodia-halo-top) - var(--reactodia-selection-single-box-margin));width:calc(var(--reactodia-halo-width) + 2 * var(--reactodia-selection-single-box-margin));height:calc(var(--reactodia-halo-height) + 2 * var(--reactodia-selection-single-box-margin));pointer-events:none;border:1.5px dashed var(--reactodia-selection-single-box-color);border-radius:var(--reactodia-border-radius-s);box-shadow:var(--reactodia-selection-single-box-shadow)}.reactodia-halo--resizable{border:unset;box-shadow:unset}.reactodia-halo__resizer{--reactodia-resizable-box-border-width: 3px;--reactodia-resizable-box-color: var(--reactodia-color-primary-lighter);position:absolute;left:var(--reactodia-selection-single-box-margin);top:var(--reactodia-selection-single-box-margin);right:var(--reactodia-selection-single-box-margin);bottom:var(--reactodia-selection-single-box-margin)}.reactodia-halo__resizer>*{pointer-events:all}.reactodia-halo-link__label-highlight{position:absolute;pointer-events:none;border-bottom:2px solid var(--reactodia-selection-link-color)}.reactodia-halo-link__path-highlight{fill:none;stroke:var(--reactodia-selection-link-color);stroke-width:4;opacity:.3}.reactodia-instances-search{flex:auto;display:flex;flex-direction:column;overflow:hidden}.reactodia-instances-search__criteria{flex-shrink:0;margin:10px 0}.reactodia-instances-search--controlled .reactodia-instances-search__criteria{margin-top:0;margin-bottom:0}.reactodia-instances-search__criterions{padding-left:15px;margin-bottom:10px}.reactodia-instances-search__criterions:empty{margin-bottom:0}.reactodia-instances-search__criterion{display:block;position:relative;width:100%}.reactodia-instances-search__criterion-class,.reactodia-instances-search__criterion-element,.reactodia-instances-search__criterion-link-type{border:var(--reactodia-color-primary) 1px dashed;color:var(--reactodia-color-primary-contrast-foreground);background-color:var(--reactodia-color-primary-contrast-background);padding:0 .5em;word-wrap:break-word}.reactodia-instances-search__link-direction-in,.reactodia-instances-search__link-direction-out{display:inline-block;width:1em;height:1em;opacity:.5;vertical-align:middle;-webkit-mask-position:0 0;mask-position:0 0;-webkit-mask-size:contain;mask-size:contain;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;background-color:currentColor}.reactodia-instances-search__link-direction-in{-webkit-mask-image:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20d='m%205.9,6%20h%20-1%20V%203%20h%2010%20v%2010%20h%20-10%20v%20-3%20h%201%20v%202%20h%208%20V%204%20h%20-8%20z'%20/%3e%3cpath%20d='M%201.5,7.5%20H%207.771919%20L%206.44298,6%207.10745,5.25%209.4,7.8376461%20V%208.1623539%20L%207.10745,10.75%206.44298,10%207.771919,8.5%20H%201.5%20Z'%20/%3e%3c/svg%3e\");mask-image:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20d='m%205.9,6%20h%20-1%20V%203%20h%2010%20v%2010%20h%20-10%20v%20-3%20h%201%20v%202%20h%208%20V%204%20h%20-8%20z'%20/%3e%3cpath%20d='M%201.5,7.5%20H%207.771919%20L%206.44298,6%207.10745,5.25%209.4,7.8376461%20V%208.1623539%20L%207.10745,10.75%206.44298,10%207.771919,8.5%20H%201.5%20Z'%20/%3e%3c/svg%3e\")}.reactodia-instances-search__link-direction-out{-webkit-mask-image:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20d='m%2010.5,6%20h%201%20V%203%20h%20-10%20v%2010%20h%2010%20v%20-3%20h%20-1%20v%202%20h%20-8%20V%204%20h%208%20z'%20/%3e%3cpath%20d='m%207,7.5%20h%206.271919%20L%2011.94298,6%2012.60745,5.25%2014.9,7.8376461%20V%208.1623539%20L%2012.60745,10.75%2011.94298,10%2013.271919,8.5%20H%207%20Z'%20/%3e%3c/svg%3e\");mask-image:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20d='m%2010.5,6%20h%201%20V%203%20h%20-10%20v%2010%20h%2010%20v%20-3%20h%20-1%20v%202%20h%20-8%20V%204%20h%208%20z'%20/%3e%3cpath%20d='m%207,7.5%20h%206.271919%20L%2011.94298,6%2012.60745,5.25%2014.9,7.8376461%20V%208.1623539%20L%2012.60745,10.75%2011.94298,10%2013.271919,8.5%20H%207%20Z'%20/%3e%3c/svg%3e\")}.reactodia-instances-search__criterion-remove{float:right;margin:0 10px 4px 4px}.reactodia-instances-search__criterion-remove-button:before{-webkit-mask:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M8%208.707l3.646%203.647.708-.707L8.707%208l3.647-3.646-.707-.708L8%207.293%204.354%203.646l-.707.708L7.293%208l-3.646%203.646.707.708L8%208.707z'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;mask:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M8%208.707l3.646%203.647.708-.707L8.707%208l3.647-3.646-.707-.708L8%207.293%204.354%203.646l-.707.708L7.293%208l-3.646%203.646.707.708L8%208.707z'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;background-color:currentColor;content:\"\";display:block;height:16px;width:16px}.reactodia-instances-search__text-criteria{margin:0 10px}.reactodia-instances-search__search-button{height:34px}.reactodia-instances-search__search-button:before{-webkit-mask:url(\"data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20d='M15.25%200a8.25%208.25%200%200%200-6.18%2013.72L1%2022.88l1.12%201%208.05-9.12A8.251%208.251%200%201%200%2015.25.01V0zm0%2015a6.75%206.75%200%201%201%200-13.5%206.75%206.75%200%200%201%200%2013.5z'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;mask:url(\"data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20d='M15.25%200a8.25%208.25%200%200%200-6.18%2013.72L1%2022.88l1.12%201%208.05-9.12A8.251%208.251%200%201%200%2015.25.01V0zm0%2015a6.75%206.75%200%201%201%200-13.5%206.75%206.75%200%200%201%200%2013.5z'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;background-color:currentColor;content:\"\";display:block;height:16px;width:16px}.reactodia-instances-search__rest{padding:10px 10px 0;border-top:1px solid var(--reactodia-border-color-base)}.reactodia-instances-search__results{padding-left:0;padding-top:10px;margin:0 10px;outline:none}.reactodia-instances-search__rest-end{margin:5px 0 10px}.reactodia-instances-search__load-more{width:100%;display:flex;align-items:center;justify-content:center}.reactodia-instances-search__load-more:before{-webkit-mask:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M7.976%2010.072l4.357-4.357.62.618L8.284%2011h-.618L3%206.333l.619-.618%204.357%204.357z'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;mask:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M7.976%2010.072l4.357-4.357.62.618L8.284%2011h-.618L3%206.333l.619-.618%204.357%204.357z'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;background-color:currentColor;content:\"\";display:block;height:16px;width:16px;margin-right:5px}.reactodia-instances-search__actions{display:flex;justify-content:flex-end;gap:var(--reactodia-spacing-horizontal);height:40px;border-top:1px solid var(--reactodia-border-color-base);transition:height .2s 0ms}.reactodia-instances-search__actions-hidden{height:0;padding:0;visibility:hidden}.reactodia-instances-search__action{padding-top:1px;padding-bottom:2px;margin-top:6px;margin-bottom:6px;margin-left:6px}.reactodia-instances-search__action:last-child{margin-right:6px}.reactodia-link-action{position:absolute;cursor:pointer;border:0 none;padding:0;opacity:.8;outline:none;transition:opacity var(--reactodia-transition-duration)}.reactodia-link-action:hover{opacity:1}.reactodia-link-action[disabled]{cursor:not-allowed;opacity:.5}.reactodia-link-action__spinner{position:absolute}.reactodia-link-action__button{background-color:var(--reactodia-color-gray-400);background-position:50%;background-repeat:no-repeat;background-size:65%;border-radius:calc(var(--reactodia-link-button-size) * .5);height:var(--reactodia-link-button-size);width:var(--reactodia-link-button-size)}.reactodia-link-action__endpoint{touch-action:none;color:var(--reactodia-color-primary);background:transparent}.reactodia-link-action__edit{background-image:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20d='M13.23%201h-1.46L3.52%209.25l-.16.22L1%2013.59%202.41%2015l4.12-2.36.22-.16L15%204.23V2.77L13.23%201zM2.41%2013.59l1.51-3%201.45%201.45-2.96%201.55zm3.83-2.06L4.47%209.76l8-8%201.77%201.77-8%208z'/%3e%3c/svg%3e\")}.reactodia-link-action__delete{background-image:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M10%203h3v1h-1v9l-1%201H4l-1-1V4H2V3h3V2a1%201%200%200%201%201-1h3a1%201%200%200%201%201%201v1zM9%202H6v1h3V2zM4%2013h7V4H4v9zm2-8H5v7h1V5zm1%200h1v7H7V5zm2%200h1v7H9V5z'/%3e%3c/svg%3e\")}.reactodia-link-action__rename{background:#fff url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20d='M13.23%201h-1.46L3.52%209.25l-.16.22L1%2013.59%202.41%2015l4.12-2.36.22-.16L15%204.23V2.77L13.23%201zM2.41%2013.59l1.51-3%201.45%201.45-2.96%201.55zm3.83-2.06L4.47%209.76l8-8%201.77%201.77-8%208z'/%3e%3c/svg%3e\") no-repeat;background-size:80%;background-position:center;filter:invert(100%) var(--reactodia-selection-icon-filter);position:absolute;margin-left:5px;padding:0;border:0 none;border-radius:var(--reactodia-border-radius-s);outline:none;cursor:pointer;opacity:.5;transition:opacity var(--reactodia-transition-duration)}.reactodia-link-action__rename:hover{opacity:1}.reactodia-links-toolbox{flex:auto;display:flex;flex-direction:column;margin-bottom:0}.reactodia-links-toolbox__heading{padding:10px}.reactodia-links-toolbox__filter{margin-bottom:5px}.reactodia-links-toolbox__rest{border-top:1px solid var(--reactodia-border-color-base);flex:auto;display:flex;flex-direction:column}.reactodia-links-toolbox__toggle-invisible:before{-webkit-mask:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20d='M1.47978%201.4797C1.30227%201.65721%201.28614%201.93498%201.43137%202.13072L1.47978%202.1868L4.1695%204.87652C2.88817%205.77616%201.93052%207.11985%201.53259%208.70952C1.46554%208.97738%201.62834%209.24892%201.89621%209.31598C2.16409%209.38298%202.4356%209.22025%202.50266%208.95232C2.85564%207.54225%203.72742%206.35956%204.88944%205.59626L6.09586%206.80278C5.62419%207.28378%205.33334%207.94278%205.33334%208.66965C5.33334%2010.1424%206.52724%2011.3363%208%2011.3363C8.72694%2011.3363%209.38587%2011.0454%209.86694%2010.5738L13.8131%2014.5201C14.0084%2014.7154%2014.3249%2014.7154%2014.5202%2014.5201C14.6977%2014.3426%2014.7139%2014.0649%2014.5686%2013.8691L14.5202%2013.813L10.4445%209.73692L10.4453%209.73592L9.64527%208.93732L7.732%207.02445L7.73334%207.02392L5.81252%205.10513L5.81334%205.10392L5.05782%204.35024L2.18689%201.4797C1.99163%201.28444%201.67504%201.28444%201.47978%201.4797ZM6.80274%207.51025L9.15947%209.86698C8.85947%2010.1575%208.4506%2010.3363%208%2010.3363C7.07954%2010.3363%206.33334%209.59012%206.33334%208.66965C6.33334%208.21905%206.51216%207.81018%206.80274%207.51025ZM8%203.66658C7.33314%203.66658%206.68607%203.7653%206.07406%203.94992L6.89874%204.77404C7.25594%204.70346%207.62427%204.66658%208%204.66658C10.6154%204.66658%2012.8733%206.45342%2013.4981%208.95538C13.565%209.22325%2013.8364%209.38618%2014.1043%209.31932C14.3723%209.25238%2014.5352%208.98098%2014.4683%208.71305C13.7329%205.7684%2011.077%203.66658%208%203.66658ZM8.1298%206.0061L10.664%208.53992C10.5961%207.16865%209.49814%206.07168%208.1298%206.0061Z'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;mask:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20d='M1.47978%201.4797C1.30227%201.65721%201.28614%201.93498%201.43137%202.13072L1.47978%202.1868L4.1695%204.87652C2.88817%205.77616%201.93052%207.11985%201.53259%208.70952C1.46554%208.97738%201.62834%209.24892%201.89621%209.31598C2.16409%209.38298%202.4356%209.22025%202.50266%208.95232C2.85564%207.54225%203.72742%206.35956%204.88944%205.59626L6.09586%206.80278C5.62419%207.28378%205.33334%207.94278%205.33334%208.66965C5.33334%2010.1424%206.52724%2011.3363%208%2011.3363C8.72694%2011.3363%209.38587%2011.0454%209.86694%2010.5738L13.8131%2014.5201C14.0084%2014.7154%2014.3249%2014.7154%2014.5202%2014.5201C14.6977%2014.3426%2014.7139%2014.0649%2014.5686%2013.8691L14.5202%2013.813L10.4445%209.73692L10.4453%209.73592L9.64527%208.93732L7.732%207.02445L7.73334%207.02392L5.81252%205.10513L5.81334%205.10392L5.05782%204.35024L2.18689%201.4797C1.99163%201.28444%201.67504%201.28444%201.47978%201.4797ZM6.80274%207.51025L9.15947%209.86698C8.85947%2010.1575%208.4506%2010.3363%208%2010.3363C7.07954%2010.3363%206.33334%209.59012%206.33334%208.66965C6.33334%208.21905%206.51216%207.81018%206.80274%207.51025ZM8%203.66658C7.33314%203.66658%206.68607%203.7653%206.07406%203.94992L6.89874%204.77404C7.25594%204.70346%207.62427%204.66658%208%204.66658C10.6154%204.66658%2012.8733%206.45342%2013.4981%208.95538C13.565%209.22325%2013.8364%209.38618%2014.1043%209.31932C14.3723%209.25238%2014.5352%208.98098%2014.4683%208.71305C13.7329%205.7684%2011.077%203.66658%208%203.66658ZM8.1298%206.0061L10.664%208.53992C10.5961%207.16865%209.49814%206.07168%208.1298%206.0061Z'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;background-color:currentColor;content:\"\";display:block;height:16px;width:16px}.reactodia-links-toolbox__toggle-lines-only:before{-webkit-mask:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M3%209l2.146%202.146-.707.708-3-3v-.708l3-3%20.707.708L3%208h10l-2.146-2.146.707-.708%203%203v.708l-3%203-.707-.707L13%209H3z'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;mask:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M3%209l2.146%202.146-.707.708-3-3v-.708l3-3%20.707.708L3%208h10l-2.146-2.146.707-.708%203%203v.708l-3%203-.707-.707L13%209H3z'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;background-color:currentColor;content:\"\";display:block;height:16px;width:16px}.reactodia-links-toolbox__toggle-visible:before{-webkit-mask:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20d='M7.99993%206.00316C9.47266%206.00316%2010.6666%207.19708%2010.6666%208.66981C10.6666%2010.1426%209.47266%2011.3365%207.99993%2011.3365C6.52715%2011.3365%205.33324%2010.1426%205.33324%208.66981C5.33324%207.19708%206.52715%206.00316%207.99993%206.00316ZM7.99993%207.00315C7.07946%207.00315%206.33324%207.74935%206.33324%208.66981C6.33324%209.59028%207.07946%2010.3365%207.99993%2010.3365C8.9204%2010.3365%209.6666%209.59028%209.6666%208.66981C9.6666%207.74935%208.9204%207.00315%207.99993%207.00315ZM7.99993%203.66675C11.0756%203.66675%2013.7307%205.76675%2014.4673%208.70968C14.5344%208.97755%2014.3716%209.24908%2014.1037%209.31615C13.8358%209.38315%2013.5643%209.22041%2013.4973%208.95248C12.8713%206.45205%2010.6141%204.66675%207.99993%204.66675C5.38454%204.66675%203.12664%206.45359%202.50182%208.95555C2.43491%209.22341%202.16348%209.38635%201.89557%209.31948C1.62766%209.25255%201.46471%208.98115%201.53162%208.71321C2.26701%205.76856%204.9229%203.66675%207.99993%203.66675Z'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;mask:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20d='M7.99993%206.00316C9.47266%206.00316%2010.6666%207.19708%2010.6666%208.66981C10.6666%2010.1426%209.47266%2011.3365%207.99993%2011.3365C6.52715%2011.3365%205.33324%2010.1426%205.33324%208.66981C5.33324%207.19708%206.52715%206.00316%207.99993%206.00316ZM7.99993%207.00315C7.07946%207.00315%206.33324%207.74935%206.33324%208.66981C6.33324%209.59028%207.07946%2010.3365%207.99993%2010.3365C8.9204%2010.3365%209.6666%209.59028%209.6666%208.66981C9.6666%207.74935%208.9204%207.00315%207.99993%207.00315ZM7.99993%203.66675C11.0756%203.66675%2013.7307%205.76675%2014.4673%208.70968C14.5344%208.97755%2014.3716%209.24908%2014.1037%209.31615C13.8358%209.38315%2013.5643%209.22041%2013.4973%208.95248C12.8713%206.45205%2010.6141%204.66675%207.99993%204.66675C5.38454%204.66675%203.12664%206.45359%202.50182%208.95555C2.43491%209.22341%202.16348%209.38635%201.89557%209.31948C1.62766%209.25255%201.46471%208.98115%201.53162%208.71321C2.26701%205.76856%204.9229%203.66675%207.99993%203.66675Z'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;background-color:currentColor;content:\"\";display:block;height:16px;width:16px}.reactodia-links-toolbox__links-heading{font-size:14px;margin:4px 6px;font-weight:700}.reactodia-links-toolbox__links-heading>*{font-weight:400}.reactodia-links-toolbox__links{display:flex;flex-direction:column;list-style:none;margin:0;padding:0}.reactodia-links-toolbox__link-item{padding:0 0 0 5px;word-break:break-word}.reactodia-links-toolbox__link-item:last-child{margin-bottom:0}.reactodia-links-toolbox__link-item>div{display:inline}.reactodia-links-toolbox__link-title{font-size:16px;display:inline}.reactodia-links-toolbox__link-buttons{float:left;margin-top:2px;margin-right:6px;margin-bottom:2px}.reactodia-links-toolbox__filter-button{display:none;float:right;width:20px;height:20px;margin:3px;-webkit-mask-image:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20d='m%2014.5,3.5%20-1,-1%20m%200,0%20H%202.5%20V%203.0652324%20L%206.9861526,8%207.5,8.5652322%20V%2012.5103%20l%201,-0.733333%20V%208.5489178%20l%205,-5.4999998%20z%20m%200,0.548918%20V%204.6%20m%200,0%20-4,4.4%20v%203.3%20l%20-3,2.2%20V%209%20l%20-5,-5.5%20v%20-2%20h%2013%20v%202'%20/%3e%3cpath%20d='M%203.0187424,8%20H%204%20v%201.5%20h%201.5%20v%201%20L%204,10.467287%20V%2012%20H%203%20V%2010.5%20H%201.5%20v%20-1%20H%203%20Z'%20/%3e%3c/svg%3e\");mask-image:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20d='m%2014.5,3.5%20-1,-1%20m%200,0%20H%202.5%20V%203.0652324%20L%206.9861526,8%207.5,8.5652322%20V%2012.5103%20l%201,-0.733333%20V%208.5489178%20l%205,-5.4999998%20z%20m%200,0.548918%20V%204.6%20m%200,0%20-4,4.4%20v%203.3%20l%20-3,2.2%20V%209%20l%20-5,-5.5%20v%20-2%20h%2013%20v%202'%20/%3e%3cpath%20d='M%203.0187424,8%20H%204%20v%201.5%20h%201.5%20v%201%20L%204,10.467287%20V%2012%20H%203%20V%2010.5%20H%201.5%20v%20-1%20H%203%20Z'%20/%3e%3c/svg%3e\");-webkit-mask-size:20px 20px;mask-size:20px 20px;background-color:currentColor;cursor:pointer;opacity:.4;transition:opacity var(--reactodia-transition-duration)}.reactodia-links-toolbox__link-item:hover .reactodia-links-toolbox__filter-button{opacity:1}.reactodia-links-toolbox__no-results{margin-top:10px}.reactodia-navigator{display:block;overflow:hidden;background:var(--reactodia-navigator-background-fill);border:var(--reactodia-border-width-base) solid var(--reactodia-border-color-base);border-radius:var(--reactodia-border-radius-s);box-shadow:var(--reactodia-canvas-box-shadow);transition:width var(--reactodia-transition-duration),height var(--reactodia-transition-duration)}.reactodia-navigator--collapsed{width:24px;height:24px}.reactodia-navigator>canvas{transition:opacity var(--reactodia-transition-duration)}.reactodia-navigator--expanded>canvas{opacity:1}.reactodia-navigator--collapsed>canvas{opacity:0}.reactodia-navigator__toggle{position:absolute;background:transparent;border:none;outline:none;padding:4px;opacity:.5;transition:opacity var(--reactodia-transition-duration)}.reactodia-navigator__toggle:not(:disabled):hover{opacity:1}.reactodia-navigator__toggle:disabled{opacity:.2}.reactodia-navigator--expanded .reactodia-navigator__toggle{top:5px;left:5px}.reactodia-navigator--collapsed .reactodia-navigator__toggle{top:0;left:0}.reactodia-navigator__toggle-icon{width:18px;height:18px;-webkit-mask-size:18px 18px;mask-size:18px 18px;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat}.reactodia-navigator--expanded .reactodia-navigator__toggle-icon{-webkit-mask:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20d='M10%207v1H5V7h5z'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M1.5%201h12l.5.5v12l-.5.5h-12l-.5-.5v-12l.5-.5zM2%2013h11V2H2v11z'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;mask:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20d='M10%207v1H5V7h5z'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M1.5%201h12l.5.5v12l-.5.5h-12l-.5-.5v-12l.5-.5zM2%2013h11V2H2v11z'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;background-color:currentColor;content:\"\";display:block;height:16px;width:16px}.reactodia-navigator--collapsed .reactodia-navigator__toggle-icon{-webkit-mask:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M1.5%201h12l.5.5v12l-.5.5h-12l-.5-.5v-12l.5-.5zM2%2013h11V2H2v11z'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M8%204H7v3H4v1h3v3h1V8h3V7H8V4z'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;mask:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M1.5%201h12l.5.5v12l-.5.5h-12l-.5-.5v-12l.5-.5zM2%2013h11V2H2v11z'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M8%204H7v3H4v1h3v3h1V8h3V7H8V4z'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;background-color:currentColor;content:\"\";display:block;height:16px;width:16px}.reactodia-selection{position:absolute;--reactodia-dock-margin-x: 2px;--reactodia-dock-margin-y: 2px}.reactodia-selection__selectedBox{position:absolute;touch-action:none;background-color:#ffa6000f;border:1px solid orange;border-radius:var(--reactodia-border-radius-s);box-shadow:var(--reactodia-selection-multiple-box-shadow);cursor:move;user-select:none;-webkit-user-select:none}.reactodia-selection__selectedActions{position:absolute}.reactodia-selection__selectedItem{position:absolute;border:1px dashed orange;background-color:#ffa60029}.reactodia-selection__highlightedBox{position:absolute;background-color:#00dbff21;border:2px dashed rgb(0,179,209);border-radius:var(--reactodia-border-radius-s)}.reactodia-selection__highlightedItem{position:absolute;border:1px dashed rgb(0,188,126);background:#00bc7e54}.reactodia-selection-action{position:absolute;background-color:transparent;background-size:contain;background-repeat:no-repeat;background-position:center;border:0 none;cursor:pointer;outline:none;padding:0;pointer-events:auto;width:20px;height:20px;filter:var(--reactodia-selection-icon-filter);opacity:.5;transition:opacity var(--reactodia-transition-duration)}.reactodia-selection-action:hover{opacity:1}.reactodia-selection-action[disabled]{cursor:not-allowed;opacity:.2}.reactodia-selection-action--dock-nw{left:calc(-22px - var(--reactodia-dock-margin-x, 0px) + var(--reactodia-dock-x) * 22px);top:calc(-22px - var(--reactodia-dock-margin-y, 0px) + var(--reactodia-dock-y) * 22px)}.reactodia-selection-action--dock-n{left:50%;margin-left:calc(-11px - var(--reactodia-dock-margin-x, 0px) + var(--reactodia-dock-x) * 22px);top:calc(-11px - var(--reactodia-dock-margin-y, 0px) + var(--reactodia-dock-y) * 22px)}.reactodia-selection-action--dock-ne{right:calc(-22px - var(--reactodia-dock-margin-x, 0px) + var(--reactodia-dock-x) * 22px);top:calc(-22px - var(--reactodia-dock-margin-y, 0px) + var(--reactodia-dock-y) * 22px)}.reactodia-selection-action--dock-e{right:calc(-22px - var(--reactodia-dock-margin-x, 0px) + var(--reactodia-dock-x) * 22px);top:50%;margin-top:calc(-11px - var(--reactodia-dock-margin-y, 0px) + var(--reactodia-dock-y) * 22px)}.reactodia-selection-action--dock-se{right:calc(-22px - var(--reactodia-dock-margin-x, 0px) + var(--reactodia-dock-x) * 22px);bottom:calc(-22px - var(--reactodia-dock-margin-y, 0px) + var(--reactodia-dock-y) * 22px)}.reactodia-selection-action--dock-s{left:50%;margin-left:calc(-11px - var(--reactodia-dock-margin-x, 0px) + var(--reactodia-dock-x) * 22px);bottom:calc(-22px - var(--reactodia-dock-margin-y, 0px) + var(--reactodia-dock-y) * 22px)}.reactodia-selection-action--dock-sw{left:calc(-22px - var(--reactodia-dock-margin-x, 0px) + var(--reactodia-dock-x) * 22px);bottom:calc(-22px - var(--reactodia-dock-margin-y, 0px) + var(--reactodia-dock-y) * 22px)}.reactodia-selection-action--dock-w{left:calc(-22px - var(--reactodia-dock-margin-x, 0px) + var(--reactodia-dock-x) * 22px);top:50%;margin-top:calc(-11px - var(--reactodia-dock-margin-y, 0px) + var(--reactodia-dock-y) * 22px)}.reactodia-selection-action__spinner{position:absolute;width:20px;height:20px}.reactodia-selection-action__remove{background-image:url(\"data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'%20standalone='no'?%3e%3csvg%20xmlns:svg='http://www.w3.org/2000/svg'%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20110%20110'%20version='1.1'%20width='500'%20height='500'%3e%3cpath%20d='M%2082.182422,8.0521107%20C%2056.44775,-6.9018137%2023.463185,1.8377258%208.5092706,27.57238%20-6.4446434,53.307034%202.2948357,86.291616%2028.029508,101.24554%2053.76418,116.19946%2086.748746,107.45993%20101.70266,81.725271%20116.65657,55.990616%20107.91709,23.006035%2082.182422,8.0521107%20Z%20M%2071.75602,28.578553%2082.28685,38.846984%2065.453479,56.373296%2083.064738,73.314301%2072.796937,83.844485%2055.169736,66.657039%2039.010998,83.228711%2028.480167,72.96028%2044.639378,56.389069%2028.415211,40.568631%2038.683013,30.038446%2054.938893,45.85871%20Z'%20style='fill:%23000000;stroke-width:1.06812763'%20/%3e%3c/svg%3e\")}.reactodia-selection-action__delete{background-image:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M10%203h3v1h-1v9l-1%201H4l-1-1V4H2V3h3V2a1%201%200%200%201%201-1h3a1%201%200%200%201%201%201v1zM9%202H6v1h3V2zM4%2013h7V4H4v9zm2-8H5v7h1V5zm1%200h1v7H7V5zm2%200h1v7H9V5z'/%3e%3c/svg%3e\")}.reactodia-selection-action__zoomToFit{background-image:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20d='M%201.5,6%20V%201.5%20H%206%20v%201%20H%202.5%20V%206%20Z'%20/%3e%3cpath%20d='m%2010,2.5%20v%20-1%20h%204.5%20V%206%20h%20-1%20V%202.5%20Z'%20/%3e%3cpath%20d='m%201.5,10%20v%204.5%20H%206%20v%20-1%20H%202.5%20V%2010%20Z'%20/%3e%3cpath%20d='m%2010,13.5%20v%201%20h%204.5%20V%2010%20h%20-1%20v%203.5%20z'%20/%3e%3c/svg%3e\")}.reactodia-selection-action__layout{background-image:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20d='M13.5%2011h-1.729L8.438%206H9.5l.5-.5v-4L9.5%201h-4l-.5.5v4l.5.5h1.062l-3.333%205H1.5l-.5.5v3l.5.5h3l.5-.5v-3l-.5-.5h-.068L7.5%206.4l3.068%204.6H10.5l-.5.5v3l.5.5h3l.5-.5v-3l-.5-.5zM6%205V2h3v3H6zm-2%207v2H2v-2h2zm9%202h-2v-2h2v2z'/%3e%3c/svg%3e\")}.reactodia-selection-action__expand{background-image:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M7.976%2010.072l4.357-4.357.62.618L8.284%2011h-.618L3%206.333l.619-.618%204.357%204.357z'/%3e%3c/svg%3e\")}.reactodia-selection-action__collapse{background-image:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M8.024%205.928l-4.357%204.357-.62-.618L7.716%205h.618L13%209.667l-.619.618-4.357-4.357z'/%3e%3c/svg%3e\")}.reactodia-selection-action__link{background-image:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M4.4%203h3.085a3.4%203.4%200%200%201%203.4%203.4v.205A3.4%203.4%200%200%201%207.485%2010H7V9h.485A2.4%202.4%200%200%200%209.88%206.61V6.4A2.4%202.4%200%200%200%207.49%204H4.4A2.4%202.4%200%200%200%202%206.4v.205A2.394%202.394%200%200%200%204%208.96v1a3.4%203.4%200%200%201-3-3.35V6.4A3.405%203.405%200%200%201%204.4%203zM12%207.04v-1a3.4%203.4%200%200%201%203%203.36v.205A3.405%203.405%200%200%201%2011.605%2013h-3.09A3.4%203.4%200%200%201%205.12%209.61V9.4A3.4%203.4%200%200%201%208.515%206H9v1h-.485A2.4%202.4%200%200%200%206.12%209.4v.205A2.4%202.4%200%200%200%208.515%2012h3.09A2.4%202.4%200%200%200%2014%209.61V9.4a2.394%202.394%200%200%200-2-2.36z'/%3e%3c/svg%3e\")}.reactodia-selection-action__navigate-open{background-image:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20d='M9.00885%206.99103L11.0333%2011.0332L6.99114%209.00874L4.96666%204.96655L9.00885%206.99103ZM9.43541%209.4353L8.48072%207.51916L6.56458%206.56447L7.51926%208.48062L9.43541%209.4353Z'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M13.9795%208.5C13.739%2011.4149%2011.4149%2013.739%208.49999%2013.9795V13H7.49999V13.9795C4.57233%2013.7379%202.24067%2011.3945%202.0175%208.46167H3V7.46167H2.02382C2.28141%204.56475%204.59788%202.25996%207.49999%202.02054V3H8.49999V2.02054C11.4149%202.26101%2013.739%204.5851%2013.9795%207.5H13V8.5H13.9795ZM8%2015C11.866%2015%2015%2011.866%2015%208C15%204.13401%2011.866%201%208%201C4.13401%201%201%204.13401%201%208C1%2011.866%204.13401%2015%208%2015Z'/%3e%3c/svg%3e\")}.reactodia-selection-action__navigate-close{background-image:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M8.6%201c1.6.1%203.1.9%204.2%202%201.3%201.4%202%203.1%202%205.1%200%201.6-.6%203.1-1.6%204.4-1%201.2-2.4%202.1-4%202.4-1.6.3-3.2.1-4.6-.7-1.4-.8-2.5-2-3.1-3.5C.9%209.2.8%207.5%201.3%206c.5-1.6%201.4-2.9%202.8-3.8C5.4%201.3%207%20.9%208.6%201zm.5%2012.9c1.3-.3%202.5-1%203.4-2.1.8-1.1%201.3-2.4%201.2-3.8%200-1.6-.6-3.2-1.7-4.3-1-1-2.2-1.6-3.6-1.7-1.3-.1-2.7.2-3.8%201-1.1.8-1.9%201.9-2.3%203.3-.4%201.3-.4%202.7.2%204%20.6%201.3%201.5%202.3%202.7%203%201.2.7%202.6.9%203.9.6zM7.9%207.5L10.3%205l.7.7-2.4%202.5%202.4%202.5-.7.7-2.4-2.5-2.4%202.5-.7-.7%202.4-2.5-2.4-2.5.7-.7%202.4%202.5z'/%3e%3c/svg%3e\")}.reactodia-selection-action__add-to-filter{background-image:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20d='m%2014.5,3.5%20-1,-1%20m%200,0%20H%202.5%20V%203.0652324%20L%206.9861526,8%207.5,8.5652322%20V%2012.5103%20l%201,-0.733333%20V%208.5489178%20l%205,-5.4999998%20z%20m%200,0.548918%20V%204.6%20m%200,0%20-4,4.4%20v%203.3%20l%20-3,2.2%20V%209%20l%20-5,-5.5%20v%20-2%20h%2013%20v%202'%20/%3e%3cpath%20d='M%203.0187424,8%20H%204%20v%201.5%20h%201.5%20v%201%20L%204,10.467287%20V%2012%20H%203%20V%2010.5%20H%201.5%20v%20-1%20H%203%20Z'%20/%3e%3c/svg%3e\")}.reactodia-selection-action__group{background-image:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M1.5%201h2v1H2v12h1.5v1h-2l-.5-.5v-13l.5-.5zm6%206h-2L5%206.5v-2l.5-.5h2l.5.5v2l-.5.5zM6%206h1V5H6v1zm7.5%201h-3l-.5-.5v-3l.5-.5h3l.5.5v3l-.5.5zM11%206h2V4h-2v2zm-3.5%206h-2l-.5-.5v-2l.5-.5h2l.5.5v2l-.5.5zM6%2011h1v-1H6v1zm7.5%202h-3l-.5-.5v-3l.5-.5h3l.5.5v3l-.5.5zM11%2012h2v-2h-2v2zm-1-2H8v1h2v-1zm0-5H8v1h2V5z'/%3e%3c/svg%3e\")}.reactodia-selection-action__ungroup{background-image:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M2.9%201L5%203.1l-.8.7L3%202.6V7H2V2.5L.8%203.8l-.7-.7L2.2%201h.7zM3%2013.4V9H2v4.4L.8%2012.2l-.7.7L2.2%2015h.7L5%2012.9l-.7-.7L3%2013.4zM8.5%207h-2L6%206.5v-2l.5-.5h2l.5.5v2l-.5.5zM7%206h1V5H7v1zm7.5%201h-3l-.5-.5v-3l.5-.5h3l.5.5v3l-.5.5zM12%206h2V4h-2v2zm-3.5%206h-2l-.5-.5v-2l.5-.5h2l.5.5v2l-.5.5zM7%2011h1v-1H7v1zm7.5%202h-3l-.5-.5v-3l.5-.5h3l.5.5v3l-.5.5zM12%2012h2v-2h-2v2zm-1-2H9v1h2v-1zm0-5H9v1h2V5z'/%3e%3c/svg%3e\")}.reactodia-selection-action__establish-link{touch-action:none;background-image:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M7%201H6v3H4.5l-.5.5V8a4%204%200%200%200%203.5%203.969V15h1v-3.031A4%204%200%200%200%2012%208V4.5l-.5-.5H10V1H9v3H7V1zm3.121%209.121A3%203%200%200%201%205%208V5h6v3a3%203%200%200%201-.879%202.121z'/%3e%3c/svg%3e\")}.reactodia-selection-action__annotate{background-image:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M1.5%202h13l.5.5v10l-.5.5h-13l-.5-.5v-10l.5-.5zM2%203v9h12V3H2zm2%202h8v1H4V5zm6%202H4v1h6V7zM4%209h4v1H4V9z'/%3e%3c/svg%3e\")}.reactodia-toolbar{display:flex;white-space:nowrap;pointer-events:none}.reactodia-toolbar>*{pointer-events:auto;white-space:normal}.reactodia-toolbar--drop-up{align-items:flex-end}.reactodia-toolbar__menu{margin-right:5px;z-index:calc(var(--reactodia-z-index-base) + 50)}.reactodia-toolbar-action__spacer{flex:auto;min-width:8px}.reactodia-toolbar-action__hotkey{color:var(--reactodia-color-secondary-darkest)}.reactodia-toolbar-action__open{display:flex;align-items:center}.reactodia-toolbar-action__open:before{-webkit-mask:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20d='M1.5%2014h11l.48-.37%202.63-7-.48-.63H14V3.5l-.5-.5H7.71l-.86-.85L6.5%202h-5l-.5.5v11l.5.5zM2%203h4.29l.86.85.35.15H13v2H8.5l-.35.15-.86.85H3.5l-.47.34-1%203.08L2%203zm10.13%2010H2.19l1.67-5H7.5l.35-.15.86-.85h5.79l-2.37%206z'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;mask:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20d='M1.5%2014h11l.48-.37%202.63-7-.48-.63H14V3.5l-.5-.5H7.71l-.86-.85L6.5%202h-5l-.5.5v11l.5.5zM2%203h4.29l.86.85.35.15H13v2H8.5l-.35.15-.86.85H3.5l-.47.34-1%203.08L2%203zm10.13%2010H2.19l1.67-5H7.5l.35-.15.86-.85h5.79l-2.37%206z'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;background-color:currentColor;content:\"\";display:block;height:16px;width:16px}.reactodia-toolbar-action__open:not(:empty):before{margin-right:3px}.reactodia-toolbar-action__open-input{display:none}.reactodia-toolbar-action__save{display:flex;align-items:center}.reactodia-toolbar-action__save:before{-webkit-mask:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M13.353%201.146l1.5%201.5L15%203v11.5l-.5.5h-13l-.5-.5v-13l.5-.5H13l.353.146zM2%202v12h12V3.208L12.793%202H11v4H4V2H2zm6%200v3h2V2H8z'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;mask:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M13.353%201.146l1.5%201.5L15%203v11.5l-.5.5h-13l-.5-.5v-13l.5-.5H13l.353.146zM2%202v12h12V3.208L12.793%202H11v4H4V2H2zm6%200v3h2V2H8z'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;background-color:currentColor;content:\"\";display:block;height:16px;width:16px}.reactodia-toolbar-action__save:not(:empty):before{margin-right:3px}.reactodia-toolbar-action__clear-all{display:flex;align-items:center}.reactodia-toolbar-action__clear-all:before{-webkit-mask:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M10%203h3v1h-1v9l-1%201H4l-1-1V4H2V3h3V2a1%201%200%200%201%201-1h3a1%201%200%200%201%201%201v1zM9%202H6v1h3V2zM4%2013h7V4H4v9zm2-8H5v7h1V5zm1%200h1v7H7V5zm2%200h1v7H9V5z'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;mask:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M10%203h3v1h-1v9l-1%201H4l-1-1V4H2V3h3V2a1%201%200%200%201%201-1h3a1%201%200%200%201%201%201v1zM9%202H6v1h3V2zM4%2013h7V4H4v9zm2-8H5v7h1V5zm1%200h1v7H7V5zm2%200h1v7H9V5z'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;background-color:currentColor;content:\"\";display:block;height:16px;width:16px}.reactodia-toolbar-action__clear-all:not(:empty):before{margin-right:3px}.reactodia-toolbar-action__export-image{display:flex;align-items:center}.reactodia-toolbar-action__export-image:before{-webkit-mask:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M2%202h6v3.5l.5.5H12v1h1V4.8l-.15-.36-3.28-3.3L9.22%201H1.5l-.5.5v13l.5.5H5v-1H2V2zm7%200l3%203H9V2zm5.5%206h-8l-.5.5v6l.5.5h8l.5-.5v-6l-.5-.5zM14%209v4l-1.63-1.6h-.71l-1.16%201.17-2.13-2.13h-.71L7%2011.1V9h7zm-2.8%204.27l.81-.81L13.55%2014h-1.62l-.73-.73zM7%2014v-1.49l1-1L10.52%2014H7zm5.5-3.5a.5.5%200%201%200%200-1%20.5.5%200%200%200%200%201z'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;mask:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M2%202h6v3.5l.5.5H12v1h1V4.8l-.15-.36-3.28-3.3L9.22%201H1.5l-.5.5v13l.5.5H5v-1H2V2zm7%200l3%203H9V2zm5.5%206h-8l-.5.5v6l.5.5h8l.5-.5v-6l-.5-.5zM14%209v4l-1.63-1.6h-.71l-1.16%201.17-2.13-2.13h-.71L7%2011.1V9h7zm-2.8%204.27l.81-.81L13.55%2014h-1.62l-.73-.73zM7%2014v-1.49l1-1L10.52%2014H7zm5.5-3.5a.5.5%200%201%200%200-1%20.5.5%200%200%200%200%201z'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;background-color:currentColor;content:\"\";display:block;height:16px;width:16px}.reactodia-toolbar-action__export-image:not(:empty):before{margin-right:3px}.reactodia-toolbar-action__print{display:flex;align-items:center}.reactodia-toolbar-action__print:before{-webkit-mask:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M13.85%204.44l-3.28-3.3-.35-.14H2.5l-.5.5V7h1V2h6v3.5l.5.5H13v1h1V4.8l-.15-.36zM10%205V2l3%203h-3zM2.5%208l-.5.5v6l.5.5h11l.5-.5v-6l-.5-.5h-11zM13%2013v1H3V9h10v4zm-8-1h-.32v1H4v-3h1.06c.75%200%201.13.36%201.13%201a.94.94%200%200%201-.32.72A1.33%201.33%200%200%201%205%2012zm-.06-1.45h-.26v.93h.26c.36%200%20.54-.16.54-.47%200-.31-.18-.46-.54-.46zM9%2012.58a1.48%201.48%200%200%200%20.44-1.12c0-1-.53-1.46-1.6-1.46H6.78v3h1.06A1.6%201.6%200%200%200%209%2012.58zm-1.55-.13v-1.9h.33a.94.94%200%200%201%20.7.25.91.91%200%200%201%20.25.67%201%201%200%200%201-.25.72.94.94%200%200%201-.69.26h-.34zm4.45-.61h-.97V13h-.68v-3h1.74v.55h-1.06v.74h.97v.55z'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;mask:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M13.85%204.44l-3.28-3.3-.35-.14H2.5l-.5.5V7h1V2h6v3.5l.5.5H13v1h1V4.8l-.15-.36zM10%205V2l3%203h-3zM2.5%208l-.5.5v6l.5.5h11l.5-.5v-6l-.5-.5h-11zM13%2013v1H3V9h10v4zm-8-1h-.32v1H4v-3h1.06c.75%200%201.13.36%201.13%201a.94.94%200%200%201-.32.72A1.33%201.33%200%200%201%205%2012zm-.06-1.45h-.26v.93h.26c.36%200%20.54-.16.54-.47%200-.31-.18-.46-.54-.46zM9%2012.58a1.48%201.48%200%200%200%20.44-1.12c0-1-.53-1.46-1.6-1.46H6.78v3h1.06A1.6%201.6%200%200%200%209%2012.58zm-1.55-.13v-1.9h.33a.94.94%200%200%201%20.7.25.91.91%200%200%201%20.25.67%201%201%200%200%201-.25.72.94.94%200%200%201-.69.26h-.34zm4.45-.61h-.97V13h-.68v-3h1.74v.55h-1.06v.74h.97v.55z'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;background-color:currentColor;content:\"\";display:block;height:16px;width:16px}.reactodia-toolbar-action__print:not(:empty):before{margin-right:3px}.reactodia-toolbar-action__undo:empty:before{-webkit-mask:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M3.5%202v3.5L4%206h3.5V5H4.979l.941-.941a3.552%203.552%200%201%201%205.023%205.023L5.746%2014.28l.72.72%205.198-5.198A4.57%204.57%200%200%200%205.2%203.339l-.7.7V2h-1z'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;mask:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M3.5%202v3.5L4%206h3.5V5H4.979l.941-.941a3.552%203.552%200%201%201%205.023%205.023L5.746%2014.28l.72.72%205.198-5.198A4.57%204.57%200%200%200%205.2%203.339l-.7.7V2h-1z'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;background-color:currentColor;content:\"\";display:block;height:16px;width:16px;width:18px;height:18px}.reactodia-toolbar-action__undo:not(:empty){display:flex;align-items:center}.reactodia-toolbar-action__undo:not(:empty):before{-webkit-mask:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M3.5%202v3.5L4%206h3.5V5H4.979l.941-.941a3.552%203.552%200%201%201%205.023%205.023L5.746%2014.28l.72.72%205.198-5.198A4.57%204.57%200%200%200%205.2%203.339l-.7.7V2h-1z'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;mask:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M3.5%202v3.5L4%206h3.5V5H4.979l.941-.941a3.552%203.552%200%201%201%205.023%205.023L5.746%2014.28l.72.72%205.198-5.198A4.57%204.57%200%200%200%205.2%203.339l-.7.7V2h-1z'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;background-color:currentColor;content:\"\";display:block;height:16px;width:16px}.reactodia-toolbar-action__undo:not(:empty):not(:empty):before{margin-right:3px}.reactodia-toolbar-action__redo:empty:before{-webkit-mask:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M12.5%202v3.5L12%206H8.5V5h2.521l-.941-.941a3.552%203.552%200%201%200-5.023%205.023l5.197%205.198-.72.72-5.198-5.198A4.57%204.57%200%200%201%2010.8%203.339l.7.7V2h1z'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;mask:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M12.5%202v3.5L12%206H8.5V5h2.521l-.941-.941a3.552%203.552%200%201%200-5.023%205.023l5.197%205.198-.72.72-5.198-5.198A4.57%204.57%200%200%201%2010.8%203.339l.7.7V2h1z'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;background-color:currentColor;content:\"\";display:block;height:16px;width:16px;width:18px;height:18px}.reactodia-toolbar-action__redo:not(:empty){display:flex;align-items:center}.reactodia-toolbar-action__redo:not(:empty):before{-webkit-mask:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M12.5%202v3.5L12%206H8.5V5h2.521l-.941-.941a3.552%203.552%200%201%200-5.023%205.023l5.197%205.198-.72.72-5.198-5.198A4.57%204.57%200%200%201%2010.8%203.339l.7.7V2h1z'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;mask:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M12.5%202v3.5L12%206H8.5V5h2.521l-.941-.941a3.552%203.552%200%201%200-5.023%205.023l5.197%205.198-.72.72-5.198-5.198A4.57%204.57%200%200%201%2010.8%203.339l.7.7V2h1z'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;background-color:currentColor;content:\"\";display:block;height:16px;width:16px}.reactodia-toolbar-action__redo:not(:empty):not(:empty):before{margin-right:3px}.reactodia-toolbar-action__layout{display:flex;align-items:center}.reactodia-toolbar-action__layout:before{-webkit-mask:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20d='M13.5%2011h-1.729L8.438%206H9.5l.5-.5v-4L9.5%201h-4l-.5.5v4l.5.5h1.062l-3.333%205H1.5l-.5.5v3l.5.5h3l.5-.5v-3l-.5-.5h-.068L7.5%206.4l3.068%204.6H10.5l-.5.5v3l.5.5h3l.5-.5v-3l-.5-.5zM6%205V2h3v3H6zm-2%207v2H2v-2h2zm9%202h-2v-2h2v2z'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;mask:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20d='M13.5%2011h-1.729L8.438%206H9.5l.5-.5v-4L9.5%201h-4l-.5.5v4l.5.5h1.062l-3.333%205H1.5l-.5.5v3l.5.5h3l.5-.5v-3l-.5-.5h-.068L7.5%206.4l3.068%204.6H10.5l-.5.5v3l.5.5h3l.5-.5v-3l-.5-.5zM6%205V2h3v3H6zm-2%207v2H2v-2h2zm9%202h-2v-2h2v2z'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;background-color:currentColor;content:\"\";display:block;height:16px;width:16px}.reactodia-toolbar-action__layout:not(:empty):before{margin-right:3px}.reactodia-toolbar-action__language-selector{float:left;position:relative;height:var(--reactodia-toolbar-height);background:var(--reactodia-button-default-background-color);border:var(--reactodia-button-border-width) solid var(--reactodia-button-default-border-color);border-radius:var(--reactodia-button-border-radius);padding:0 5px;display:flex;align-items:center}.reactodia-toolbar-action__language-selector:focus-within{border-color:var(--reactodia-input-border-color-focus)}.reactodia-toolbar-action__language-selector select{height:var(--reactodia-toolbar-height);background-color:var(--reactodia-button-default-background-color);border:none;outline:none;color:inherit;margin:0;font:inherit;line-height:inherit;height:calc(var(--reactodia-toolbar-height) - 4px)}.reactodia-toolbar-action__language-selector label{display:inline-block;margin-right:5px}.reactodia-toolbar-action__language-selector label:before{-webkit-mask:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M8.5%201a6.5%206.5%200%201%201%200%2013%206.5%206.5%200%200%201%200-13zm4.894%204a5.527%205.527%200%200%200-3.053-2.676c.444.84.765%201.74.953%202.676h2.1zm.582%202.995A5.11%205.11%200%200%200%2014%207.5a5.464%205.464%200%200%200-.213-1.5h-2.342c.032.331.055.664.055%201a10.114%2010.114%200%200%201-.206%202h2.493c.095-.329.158-.665.19-1.005zm-3.535%200l.006-.051A9.04%209.04%200%200%200%2010.5%207a8.994%208.994%200%200%200-.076-1H6.576A8.82%208.82%200%200%200%206.5%207a8.98%208.98%200%200%200%20.233%202h3.534c.077-.332.135-.667.174-1.005zM10.249%205a8.974%208.974%200%200%200-1.255-2.97C8.83%202.016%208.666%202%208.5%202a3.62%203.62%200%200%200-.312.015l-.182.015L8%202.04A8.97%208.97%200%200%200%206.751%205h3.498zM5.706%205a9.959%209.959%200%200%201%20.966-2.681A5.527%205.527%200%200%200%203.606%205h2.1zM3.213%206A5.48%205.48%200%200%200%203%207.5%205.48%205.48%200%200%200%203.213%209h2.493A10.016%2010.016%200%200%201%205.5%207c0-.336.023-.669.055-1H3.213zm2.754%204h-2.36a5.515%205.515%200%200%200%203.819%202.893A10.023%2010.023%200%200%201%205.967%2010zM8.5%2012.644A8.942%208.942%200%200%200%209.978%2010H7.022A8.943%208.943%200%200%200%208.5%2012.644zM11.033%2010a10.024%2010.024%200%200%201-1.459%202.893A5.517%205.517%200%200%200%2013.393%2010h-2.36z'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;mask:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M8.5%201a6.5%206.5%200%201%201%200%2013%206.5%206.5%200%200%201%200-13zm4.894%204a5.527%205.527%200%200%200-3.053-2.676c.444.84.765%201.74.953%202.676h2.1zm.582%202.995A5.11%205.11%200%200%200%2014%207.5a5.464%205.464%200%200%200-.213-1.5h-2.342c.032.331.055.664.055%201a10.114%2010.114%200%200%201-.206%202h2.493c.095-.329.158-.665.19-1.005zm-3.535%200l.006-.051A9.04%209.04%200%200%200%2010.5%207a8.994%208.994%200%200%200-.076-1H6.576A8.82%208.82%200%200%200%206.5%207a8.98%208.98%200%200%200%20.233%202h3.534c.077-.332.135-.667.174-1.005zM10.249%205a8.974%208.974%200%200%200-1.255-2.97C8.83%202.016%208.666%202%208.5%202a3.62%203.62%200%200%200-.312.015l-.182.015L8%202.04A8.97%208.97%200%200%200%206.751%205h3.498zM5.706%205a9.959%209.959%200%200%201%20.966-2.681A5.527%205.527%200%200%200%203.606%205h2.1zM3.213%206A5.48%205.48%200%200%200%203%207.5%205.48%205.48%200%200%200%203.213%209h2.493A10.016%2010.016%200%200%201%205.5%207c0-.336.023-.669.055-1H3.213zm2.754%204h-2.36a5.515%205.515%200%200%200%203.819%202.893A10.023%2010.023%200%200%201%205.967%2010zM8.5%2012.644A8.942%208.942%200%200%200%209.978%2010H7.022A8.943%208.943%200%200%200%208.5%2012.644zM11.033%2010a10.024%2010.024%200%200%201-1.459%202.893A5.517%205.517%200%200%200%2013.393%2010h-2.36z'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;background-color:currentColor;content:\"\";display:block;height:16px;width:16px}.reactodia-btn+.reactodia-toolbar-action__language-selector{margin-left:5px}.reactodia-unified-search{border:var(--reactodia-input-border-width) solid var(--reactodia-input-border-color);border-radius:var(--reactodia-input-border-radius);background-color:var(--reactodia-background-color-surface);transition:border-color ease-in-out .15s}.reactodia-unified-search:focus-within{border-color:var(--reactodia-input-border-color-focus)}.reactodia-unified-search.reactodia-dropdown--expanded{box-shadow:var(--reactodia-canvas-box-shadow)}.reactodia-unified-search__toggle{height:28px;display:flex;align-items:stretch;border:var(--reactodia-input-border-width) solid transparent;border-radius:var(--reactodia-input-border-radius)}.reactodia-unified-search .reactodia-dropdown__content{border-bottom-left-radius:var(--reactodia-input-border-radius);border-bottom-right-radius:var(--reactodia-input-border-radius)}.reactodia-unified-search__search-input{flex:auto;display:block;margin:0;padding:6px 44px 6px 12px;color:var(--reactodia-input-color);background-color:var(--reactodia-background-color-surface);border:none}.reactodia-unified-search__search-input::placeholder{color:var(--reactodia-input-color-placeholder)}.reactodia-unified-search__search-input:focus{outline:0}.reactodia-unified-search__search-icon{position:absolute;right:0;padding:0 8px;align-self:center;border:none;background:none;cursor:text}.reactodia-unified-search__search-icon:before{-webkit-mask:url(\"data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20d='M15.25%200a8.25%208.25%200%200%200-6.18%2013.72L1%2022.88l1.12%201%208.05-9.12A8.251%208.251%200%201%200%2015.25.01V0zm0%2015a6.75%206.75%200%201%201%200-13.5%206.75%206.75%200%200%201%200%2013.5z'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;mask:url(\"data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20d='M15.25%200a8.25%208.25%200%200%200-6.18%2013.72L1%2022.88l1.12%201%208.05-9.12A8.251%208.251%200%201%200%2015.25.01V0zm0%2015a6.75%206.75%200%201%201%200-13.5%206.75%206.75%200%200%201%200%2013.5z'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;background-color:currentColor;content:\"\";display:block;height:16px;width:16px}.reactodia-unified-search__collapse-button,.reactodia-unified-search__clear-button{position:absolute;right:0;padding:6px;align-self:center;color:var(--reactodia-button-default-color);background:0 0;border:0;border-radius:var(--reactodia-input-border-radius);transition:background-color var(--reactodia-transition-duration)}.reactodia-unified-search__collapse-button:hover,.reactodia-unified-search__clear-button:hover{color:var(--reactodia-button-default-color-focus);background-color:var(--reactodia-button-default-background-color-focus)}.reactodia-dropdown--down .reactodia-unified-search__collapse-button,.reactodia-dropdown--down .reactodia-unified-search__clear-button{border-top-left-radius:unset}.reactodia-dropdown--down.reactodia-dropdown--expanded .reactodia-unified-search__collapse-button,.reactodia-dropdown--down.reactodia-dropdown--expanded .reactodia-unified-search__clear-button{border-bottom-right-radius:unset}.reactodia-dropdown--up .reactodia-unified-search__collapse-button,.reactodia-dropdown--up .reactodia-unified-search__clear-button{border-bottom-left-radius:unset}.reactodia-dropdown--up.reactodia-dropdown--expanded .reactodia-unified-search__collapse-button,.reactodia-dropdown--up.reactodia-dropdown--expanded .reactodia-unified-search__clear-button{border-top-right-radius:unset}.reactodia-dropdown--down .reactodia-unified-search__collapse-button:after{-webkit-mask:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M8.024%205.928l-4.357%204.357-.62-.618L7.716%205h.618L13%209.667l-.619.618-4.357-4.357z'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;mask:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M8.024%205.928l-4.357%204.357-.62-.618L7.716%205h.618L13%209.667l-.619.618-4.357-4.357z'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;background-color:currentColor;content:\"\";display:block;height:16px;width:16px}.reactodia-dropdown--up .reactodia-unified-search__collapse-button:after{-webkit-mask:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M7.976%2010.072l4.357-4.357.62.618L8.284%2011h-.618L3%206.333l.619-.618%204.357%204.357z'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;mask:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M7.976%2010.072l4.357-4.357.62.618L8.284%2011h-.618L3%206.333l.619-.618%204.357%204.357z'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;background-color:currentColor;content:\"\";display:block;height:16px;width:16px}.reactodia-unified-search__clear-button:after{-webkit-mask:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M8%208.707l3.646%203.647.708-.707L8.707%208l3.647-3.646-.707-.708L8%207.293%204.354%203.646l-.707.708L7.293%208l-3.646%203.646.707.708L8%208.707z'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;mask:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M8%208.707l3.646%203.647.708-.707L8.707%208l3.647-3.646-.707-.708L8%207.293%204.354%203.646l-.707.708L7.293%208l-3.646%203.646.707.708L8%208.707z'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;background-color:currentColor;content:\"\";display:block;height:16px;width:16px}.reactodia-unified-search .reactodia-dropdown__content{position:unset;box-shadow:unset}.reactodia-unified-search__panel{display:flex;flex-direction:column}.reactodia-unified-search__section-tabs{display:flex;flex-wrap:wrap;gap:6px;margin:8px 10px}.reactodia-unified-search__section-tab{padding:4px;font-size:13px;text-align:center;white-space:nowrap;vertical-align:middle;touch-action:manipulation;cursor:pointer;-webkit-user-select:none;user-select:none;border-width:var(--reactodia-button-border-width);border-style:solid;transition:background-color var(--reactodia-transition-duration)}.reactodia-unified-search__section{flex:auto;display:flex;flex-direction:column}.reactodia-unified-search__section:not(.reactodia-unified-search__section--active){display:none}.reactodia-zoom-control{display:flex;flex-direction:column;box-shadow:var(--reactodia-canvas-box-shadow)}.reactodia-zoom-control .reactodia-btn{padding:3px;border-radius:unset}.reactodia-zoom-control .reactodia-btn+.reactodia-btn{margin-top:calc(-1 * var(--reactodia-button-border-width))}.reactodia-zoom-control>.reactodia-btn:first-child{border-top-left-radius:var(--reactodia-button-border-radius);border-top-right-radius:var(--reactodia-button-border-radius)}.reactodia-zoom-control>.reactodia-btn:last-child{border-bottom-left-radius:var(--reactodia-button-border-radius);border-bottom-right-radius:var(--reactodia-button-border-radius)}.reactodia-zoom-control__zoom-in-button:before{-webkit-mask:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M12.027%206.149a5.52%205.52%200%200%201-1.27%203.908l4.26%204.26-.7.71-4.26-4.27a5.52%205.52%200%201%201%201.97-4.608zm-5.45%204.888a4.51%204.51%200%200%200%203.18-1.32l-.04.02a4.51%204.51%200%200%200%201.36-3.2%204.5%204.5%200%201%200-4.5%204.5zm2.44-4v-1h-2v-2h-1v2h-2v1h2v2h1v-2h2z'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;mask:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M12.027%206.149a5.52%205.52%200%200%201-1.27%203.908l4.26%204.26-.7.71-4.26-4.27a5.52%205.52%200%201%201%201.97-4.608zm-5.45%204.888a4.51%204.51%200%200%200%203.18-1.32l-.04.02a4.51%204.51%200%200%200%201.36-3.2%204.5%204.5%200%201%200-4.5%204.5zm2.44-4v-1h-2v-2h-1v2h-2v1h2v2h1v-2h2z'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;background-color:currentColor;content:\"\";display:block;height:16px;width:16px}.reactodia-zoom-control__zoom-out-button:before{-webkit-mask:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M12.027%206.149a5.52%205.52%200%200%201-1.27%203.908l4.26%204.26-.7.71-4.26-4.27a5.52%205.52%200%201%201%201.97-4.608zm-5.45%204.888a4.51%204.51%200%200%200%203.18-1.32l-.04.02a4.51%204.51%200%200%200%201.36-3.2%204.5%204.5%200%201%200-4.5%204.5zm-2.54-4.98h5v1h-5v-1z'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;mask:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M12.027%206.149a5.52%205.52%200%200%201-1.27%203.908l4.26%204.26-.7.71-4.26-4.27a5.52%205.52%200%201%201%201.97-4.608zm-5.45%204.888a4.51%204.51%200%200%200%203.18-1.32l-.04.02a4.51%204.51%200%200%200%201.36-3.2%204.5%204.5%200%201%200-4.5%204.5zm-2.54-4.98h5v1h-5v-1z'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;background-color:currentColor;content:\"\";display:block;height:16px;width:16px}.reactodia-zoom-control__zoom-fit-button:before{-webkit-mask:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20d='M%201.5,6%20V%201.5%20H%206%20v%201%20H%202.5%20V%206%20Z'%20/%3e%3cpath%20d='m%2010,2.5%20v%20-1%20h%204.5%20V%206%20h%20-1%20V%202.5%20Z'%20/%3e%3cpath%20d='m%201.5,10%20v%204.5%20H%206%20v%20-1%20H%202.5%20V%2010%20Z'%20/%3e%3cpath%20d='m%2010,13.5%20v%201%20h%204.5%20V%2010%20h%20-1%20v%203.5%20z'%20/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;mask:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20d='M%201.5,6%20V%201.5%20H%206%20v%201%20H%202.5%20V%206%20Z'%20/%3e%3cpath%20d='m%2010,2.5%20v%20-1%20h%204.5%20V%206%20h%20-1%20V%202.5%20Z'%20/%3e%3cpath%20d='m%201.5,10%20v%204.5%20H%206%20v%20-1%20H%202.5%20V%2010%20Z'%20/%3e%3cpath%20d='m%2010,13.5%20v%201%20h%204.5%20V%2010%20h%20-1%20v%203.5%20z'%20/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;background-color:currentColor;content:\"\";display:block;height:16px;width:16px}.reactodia-zoom-control__selection-mode-button:before{-webkit-mask:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M1%203l1-1h12l1%201v6h-1V3H2v8h5v1H2l-1-1V3zm14.707%209.707L9%206v9.414l2.707-2.707h4zM10%2013V8.414l3.293%203.293h-2L10%2013z'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;mask:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M1%203l1-1h12l1%201v6h-1V3H2v8h5v1H2l-1-1V3zm14.707%209.707L9%206v9.414l2.707-2.707h4zM10%2013V8.414l3.293%203.293h-2L10%2013z'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;background-color:currentColor;content:\"\";display:block;height:16px;width:16px}.reactodia-accordion{flex:auto;display:flex;height:100%;width:100%}.reactodia-accordion--scrollable{overflow:auto}.reactodia-accordion--vertical{flex-direction:column}.reactodia-accordion--vertical:not(.reactodia-accordion--resizing):not(:has(.reactodia-accordion-item__handle:focus))>.reactodia-accordion-item{transition:height var(--reactodia-accordion-transition-duration) ease-in-out}.reactodia-accordion-item{display:flex;position:relative;flex:auto}.reactodia-accordion-item--resizing>.reactodia-accordion-item__handle,.reactodia-accordion-item__handle:hover{background:#0000001a}.reactodia-accordion-item--vertical{border-top:var(--reactodia-border-width-base) solid var(--reactodia-border-color-base)}.reactodia-accordion-item--vertical:first-child{border-top-width:0}.reactodia-accordion-item--horizontal{border-right:var(--reactodia-border-width-base) solid var(--reactodia-border-color-base)}.reactodia-accordion-item--horizontal:last-child{border-right-width:0}.reactodia-accordion-item__handle{position:absolute;z-index:calc(var(--reactodia-z-index-base) + 10)}.reactodia-accordion-item__handle-vertical{height:5px;bottom:-2.5px;left:0;width:100%;cursor:ns-resize}.reactodia-accordion-item__handle-horizontal{height:100%;top:0;right:-2.5px;width:5px;cursor:ew-resize}.reactodia-accordion-item__handle-btn{position:absolute;width:20px;height:20px;top:50%;margin-top:-10px;padding:0;background-color:var(--reactodia-button-default-background-color);border:2px solid var(--reactodia-color-primary);box-shadow:0 0 0 1px #091e4214,0 2px 4px 1px #091e4214;border-radius:10px;cursor:pointer;z-index:calc(var(--reactodia-z-index-base) + 20);transition:var(--reactodia-accordion-transition-duration);display:flex;align-items:center;justify-content:center}.reactodia-accordion-item__handle-btn:before{-webkit-mask-position:0 0;mask-position:0 0;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:cover;mask-size:cover;content:\"\";height:16px;width:16px;transition:opacity filter var(--reactodia-accordion-transition-duration);color:var(--reactodia-color-emphasis-700);background-color:currentColor}.reactodia-accordion-item__handle-btn:hover{background-color:var(--reactodia-color-primary)}.reactodia-accordion-item__handle-btn:hover:before{opacity:1;color:var(--reactodia-color-gray-0)}.reactodia-accordion-item__handle-btn-left{left:100%;margin-left:-10px}.reactodia-accordion-item__handle-btn-left:before{-webkit-mask-image:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M5.928%207.976l4.357%204.357-.618.62L5%208.284v-.618L9.667%203l.618.619-4.357%204.357z'/%3e%3c/svg%3e\");mask-image:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M5.928%207.976l4.357%204.357-.618.62L5%208.284v-.618L9.667%203l.618.619-4.357%204.357z'/%3e%3c/svg%3e\")}.reactodia-accordion-item__handle-btn-right{right:100%;margin-right:-10px}.reactodia-accordion-item__handle-btn-right:before{-webkit-mask-image:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M10.072%208.024L5.715%203.667l.618-.62L11%207.716v.618L6.333%2013l-.618-.619%204.357-4.357z'/%3e%3c/svg%3e\");mask-image:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M10.072%208.024L5.715%203.667l.618-.62L11%207.716v.618L6.333%2013l-.618-.619%204.357-4.357z'/%3e%3c/svg%3e\")}.reactodia-accordion-item--collapsed .reactodia-accordion-item__handle-btn:before{transform:rotate(180deg)}.reactodia-accordion-item__inner{flex:auto;display:flex;flex-direction:column;overflow:hidden}.reactodia-accordion-item__body{flex:1 1 0px;display:flex;flex-direction:column;background-color:var(--reactodia-background-color)}.reactodia-accordion-item__header{padding:0 0 0 20px;text-align:unset;border:none;position:relative;flex-shrink:0;font-size:16px;background-color:var(--reactodia-color-emphasis-200);cursor:default;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.reactodia-accordion-item__header:before{border-top:6px solid var(--reactodia-color-emphasis-700);border-left:3.5px solid transparent;border-right:3.5px solid transparent;content:\"\";position:absolute;top:50%;left:7px;margin-top:-3px;-webkit-transition:.1s;-moz-transition:.1s;transition:.1s}.reactodia-accordion-item--collapsed .reactodia-accordion-item__inner{background-color:var(--reactodia-background-color-surface)}.reactodia-accordion-item--collapsed .reactodia-accordion-item__header:before{-webkit-transform:rotate(-90deg);-moz-transform:rotate(-90deg);-ms-transform:rotate(-90deg);transform:rotate(-90deg)}.reactodia-accordion-item--collapsed .reactodia-accordion-item__body{display:none}.reactodia-workspace{display:flex;flex-direction:column;height:100%;box-sizing:border-box;white-space:initial;color:var(--reactodia-font-color-base);font-family:var(--reactodia-font-family-base);font-size:var(--reactodia-font-size-base);line-height:var(--reactodia-line-height-base)}.reactodia-workspace *,.reactodia-workspace *:before,.reactodia-workspace *:after{box-sizing:inherit}.reactodia-scrollable{flex:1 1 0px;overflow-y:scroll}.reactodia-scrollable>*{position:relative}.reactodia-classic-template{max-width:450px;float:left;border-radius:12px;border-style:solid;border-width:1px}.reactodia-classic-template__thumbnail{text-align:center}.reactodia-classic-template__thumbnail-image{max-width:200px}.reactodia-classic-template--expanded .reactodia-classic-template__thumbnail-image{max-width:350px}.reactodia-classic-template__type-line{padding:0 7px;color:#fff;height:18px;margin-bottom:2px;overflow:hidden;display:flex;align-items:baseline;margin-top:-3px}.reactodia-classic-template__type-line-icon{position:inherit!important;margin-right:4px}.reactodia-classic-template__type-line-text-container{flex-grow:1;overflow:hidden;text-overflow:ellipsis;width:0}.reactodia-classic-template__type-line-text{display:inline;white-space:nowrap;font-size:12px}.reactodia-classic-template__body{border-bottom-left-radius:12px;border-bottom-right-radius:12px;border-top-style:solid;border-top-width:1px;background:var(--reactodia-element-background-color);padding:7px 10px 8px;overflow:hidden;display:flex;flex-direction:column}.reactodia-classic-template__label{font-size:19px;font-weight:100;overflow:hidden;text-overflow:ellipsis;margin-bottom:0;white-space:nowrap;word-wrap:break-word}.reactodia-classic-template__expander{width:100%;overflow:hidden;display:flex}.reactodia-classic-template__iri-heading{font-size:12px;font-weight:100;margin-right:15px;color:var(--reactodia-color-emphasis-500)}.reactodia-classic-template__iri-container{font-size:12px;width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.reactodia-classic-template__iri{color:var(--reactodia-color-emphasis-500)}.reactodia-classic-template__divider{border:0;border-top:1px solid var(--reactodia-border-color-base);height:0;margin:5px 0}.reactodia-classic-template__property-table{font-size:15px;font-weight:100;margin-bottom:5px;max-height:200px;overflow-y:scroll;overflow-x:hidden}.reactodia-classic-template__property-row{white-space:nowrap}.reactodia-classic-template__property-label{display:inline-block;width:50%;text-overflow:ellipsis;overflow:hidden;vertical-align:top}.reactodia-classic-template__property-values{display:inline-block;width:50%;text-overflow:ellipsis;overflow:hidden}.reactodia-classic-template__property-value{width:100%;overflow:hidden;text-overflow:ellipsis;white-space:initial;padding-right:10px}.reactodia-group-paginator{display:flex}.reactodia-group-paginator__previous,.reactodia-group-paginator__next{height:22px;padding:0 5px}.reactodia-group-paginator__previous{display:flex;align-items:center}.reactodia-group-paginator__previous:before{-webkit-mask:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M5.928%207.976l4.357%204.357-.618.62L5%208.284v-.618L9.667%203l.618.619-4.357%204.357z'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;mask:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M5.928%207.976l4.357%204.357-.618.62L5%208.284v-.618L9.667%203l.618.619-4.357%204.357z'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;background-color:currentColor;content:\"\";display:block;height:16px;width:16px}.reactodia-group-paginator__previous:not(:empty):before{margin-right:3px}.reactodia-group-paginator__previous{border-top-right-radius:unset;border-bottom-right-radius:unset}.reactodia-group-paginator__next{display:flex;align-items:center}.reactodia-group-paginator__next:before{-webkit-mask:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M10.072%208.024L5.715%203.667l.618-.62L11%207.716v.618L6.333%2013l-.618-.619%204.357-4.357z'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;mask:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M10.072%208.024L5.715%203.667l.618-.62L11%207.716v.618L6.333%2013l-.618-.619%204.357-4.357z'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;background-color:currentColor;content:\"\";display:block;height:16px;width:16px}.reactodia-group-paginator__next:not(:empty):before{margin-right:3px}.reactodia-group-paginator__next{border-top-left-radius:unset;border-bottom-left-radius:unset}.reactodia-group-paginator__status{flex:60px 0 0;text-align:center;border-top:var(--reactodia-button-border-width) solid var(--reactodia-button-default-border-color);border-bottom:var(--reactodia-button-border-width) solid var(--reactodia-button-default-border-color)}.reactodia-group-paginator__page-size{margin-left:4px}.reactodia-note-annotation{width:200px;height:120px;display:grid;align-content:center;border:2px solid var(--reactodia-color-gray-500);border-radius:var(--reactodia-border-radius-s)}.reactodia-note-annotation--variant-default{color:var(--reactodia-font-color-base);background-color:var(--reactodia-element-background-color);border-color:var(--reactodia-color-gray-500)}.reactodia-note-annotation--variant-primary{color:var(--reactodia-color-primary-contrast-foreground);background-color:var(--reactodia-color-primary-contrast-background);border-color:var(--reactodia-color-primary)}.reactodia-note-annotation--variant-success{color:var(--reactodia-color-success-contrast-foreground);background-color:var(--reactodia-color-success-contrast-background);border-color:var(--reactodia-color-success)}.reactodia-note-annotation--variant-info{color:var(--reactodia-color-info-contrast-foreground);background-color:var(--reactodia-color-info-contrast-background);border-color:var(--reactodia-color-info)}.reactodia-note-annotation--variant-warning{color:var(--reactodia-color-warning-contrast-foreground);background-color:var(--reactodia-color-warning-contrast-background);border-color:var(--reactodia-color-warning)}.reactodia-note-annotation--variant-danger{color:var(--reactodia-color-danger-contrast-foreground);background-color:var(--reactodia-color-danger-contrast-background);border-color:var(--reactodia-color-danger)}.reactodia-note-annotation--editing{align-content:unset}.reactodia-note-annotation__editor{margin:0;padding:10px;font-size:18px;outline:none;overflow-wrap:break-word;pointer-events:none;text-align:center}.reactodia-note-annotation--editing .reactodia-note-annotation__editor{cursor:text;pointer-events:all}.reactodia-note-annotation__controls{position:absolute;top:10px;right:-10px;transform:translate(100%);width:max-content;display:flex;flex-direction:column;gap:var(--reactodia-spacing-base)}.reactodia-note-annotation__style-bold{display:flex;align-items:center}.reactodia-note-annotation__style-bold:before{-webkit-mask:url(\"data:image/svg+xml,%3csvg%20id='icon'%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2032%2032'%3e%3cdefs%3e%3cstyle%3e.cls-1{fill:none;}%3c/style%3e%3c/defs%3e%3ctitle%3etext-bold%3c/title%3e%3cpath%20d='M18.25,25H9V7h8.5a5.25,5.25,0,0,1,4,8.65A5.25,5.25,0,0,1,18.25,25ZM12,22h6.23a2.25,2.25,0,1,0,0-4.5H12Zm0-7.5h5.5a2.25,2.25,0,1,0,0-4.5H12Z'/%3e%3crect%20id='_Transparent_Rectangle_'%20data-name='&lt;Transparent%20Rectangle&gt;'%20class='cls-1'%20width='32'%20height='32'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;mask:url(\"data:image/svg+xml,%3csvg%20id='icon'%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2032%2032'%3e%3cdefs%3e%3cstyle%3e.cls-1{fill:none;}%3c/style%3e%3c/defs%3e%3ctitle%3etext-bold%3c/title%3e%3cpath%20d='M18.25,25H9V7h8.5a5.25,5.25,0,0,1,4,8.65A5.25,5.25,0,0,1,18.25,25ZM12,22h6.23a2.25,2.25,0,1,0,0-4.5H12Zm0-7.5h5.5a2.25,2.25,0,1,0,0-4.5H12Z'/%3e%3crect%20id='_Transparent_Rectangle_'%20data-name='&lt;Transparent%20Rectangle&gt;'%20class='cls-1'%20width='32'%20height='32'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;background-color:currentColor;content:\"\";display:block;height:16px;width:16px}.reactodia-note-annotation__style-bold:not(:empty):before{margin-right:3px}.reactodia-note-annotation__style-italic{display:flex;align-items:center}.reactodia-note-annotation__style-italic:before{-webkit-mask:url(\"data:image/svg+xml,%3csvg%20id='icon'%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2032%2032'%3e%3cdefs%3e%3cstyle%3e.cls-1{fill:none;}%3c/style%3e%3c/defs%3e%3ctitle%3etext-italic%3c/title%3e%3cpolygon%20points='25%209%2025%207%2012%207%2012%209%2017.14%209%2012.77%2023%207%2023%207%2025%2020%2025%2020%2023%2014.86%2023%2019.23%209%2025%209'/%3e%3crect%20id='_Transparent_Rectangle_'%20data-name='&lt;Transparent%20Rectangle&gt;'%20class='cls-1'%20width='32'%20height='32'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;mask:url(\"data:image/svg+xml,%3csvg%20id='icon'%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2032%2032'%3e%3cdefs%3e%3cstyle%3e.cls-1{fill:none;}%3c/style%3e%3c/defs%3e%3ctitle%3etext-italic%3c/title%3e%3cpolygon%20points='25%209%2025%207%2012%207%2012%209%2017.14%209%2012.77%2023%207%2023%207%2025%2020%2025%2020%2023%2014.86%2023%2019.23%209%2025%209'/%3e%3crect%20id='_Transparent_Rectangle_'%20data-name='&lt;Transparent%20Rectangle&gt;'%20class='cls-1'%20width='32'%20height='32'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;background-color:currentColor;content:\"\";display:block;height:16px;width:16px}.reactodia-note-annotation__style-italic:not(:empty):before{margin-right:3px}.reactodia-note-annotation__style-underline{display:flex;align-items:center}.reactodia-note-annotation__style-underline:before{-webkit-mask:url(\"data:image/svg+xml,%3csvg%20id='icon'%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2032%2032'%3e%3cdefs%3e%3cstyle%3e.cls-1{fill:none;}%3c/style%3e%3c/defs%3e%3ctitle%3etext-underline%3c/title%3e%3crect%20x='4'%20y='26'%20width='24'%20height='2'/%3e%3cpath%20d='M16,23a7,7,0,0,1-7-7V5h2V16a5,5,0,0,0,10,0V5h2V16A7,7,0,0,1,16,23Z'/%3e%3crect%20id='_Transparent_Rectangle_'%20data-name='&lt;Transparent%20Rectangle&gt;'%20class='cls-1'%20width='32'%20height='32'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;mask:url(\"data:image/svg+xml,%3csvg%20id='icon'%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2032%2032'%3e%3cdefs%3e%3cstyle%3e.cls-1{fill:none;}%3c/style%3e%3c/defs%3e%3ctitle%3etext-underline%3c/title%3e%3crect%20x='4'%20y='26'%20width='24'%20height='2'/%3e%3cpath%20d='M16,23a7,7,0,0,1-7-7V5h2V16a5,5,0,0,0,10,0V5h2V16A7,7,0,0,1,16,23Z'/%3e%3crect%20id='_Transparent_Rectangle_'%20data-name='&lt;Transparent%20Rectangle&gt;'%20class='cls-1'%20width='32'%20height='32'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;background-color:currentColor;content:\"\";display:block;height:16px;width:16px}.reactodia-note-annotation__style-underline:not(:empty):before{margin-right:3px}.reactodia-note-annotation__style-strikethrough{display:flex;align-items:center}.reactodia-note-annotation__style-strikethrough:before{-webkit-mask:url(\"data:image/svg+xml,%3csvg%20id='icon'%20xmlns='http://www.w3.org/2000/svg'%20width='32'%20height='32'%20viewBox='0%200%2032%2032'%3e%3cdefs%3e%3cstyle%3e.cls-1{fill:none;}%3c/style%3e%3c/defs%3e%3ctitle%3etext--strikethrough%3c/title%3e%3cpath%20d='M28,15H17.9563c-.4522-.1237-.9037-.2324-1.3381-.3352-2.8077-.6641-4.396-1.1506-4.396-3.4231a2.8684,2.8684,0,0,1,.7866-2.145,4.7888,4.7888,0,0,1,3.0137-1.09c2.8291-.07,4.1347.8894,5.2011,2.35l1.6153-1.1792a7.4727,7.4727,0,0,0-6.83-3.1706,6.7726,6.7726,0,0,0-4.4,1.6611,4.8274,4.8274,0,0,0-1.3862,3.5735A4.3723,4.3723,0,0,0,11.9573,15H4v2H17.6519c1.9668.57,3.1432,1.3123,3.1733,3.3579a3.119,3.119,0,0,1-.8623,2.3931A5.8241,5.8241,0,0,1,16.2432,24a6.6344,6.6344,0,0,1-5.1451-2.6912L9.5649,22.593A8.5262,8.5262,0,0,0,16.2119,26c.0088-.0012.042,0,.1,0A7.67,7.67,0,0,0,21.36,24.1812a5.0779,5.0779,0,0,0,1.4648-3.8531A4.952,4.952,0,0,0,21.6753,17H28Z'/%3e%3crect%20id='_Transparent_Rectangle_'%20data-name='&lt;Transparent%20Rectangle&gt;'%20class='cls-1'%20width='32'%20height='32'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;mask:url(\"data:image/svg+xml,%3csvg%20id='icon'%20xmlns='http://www.w3.org/2000/svg'%20width='32'%20height='32'%20viewBox='0%200%2032%2032'%3e%3cdefs%3e%3cstyle%3e.cls-1{fill:none;}%3c/style%3e%3c/defs%3e%3ctitle%3etext--strikethrough%3c/title%3e%3cpath%20d='M28,15H17.9563c-.4522-.1237-.9037-.2324-1.3381-.3352-2.8077-.6641-4.396-1.1506-4.396-3.4231a2.8684,2.8684,0,0,1,.7866-2.145,4.7888,4.7888,0,0,1,3.0137-1.09c2.8291-.07,4.1347.8894,5.2011,2.35l1.6153-1.1792a7.4727,7.4727,0,0,0-6.83-3.1706,6.7726,6.7726,0,0,0-4.4,1.6611,4.8274,4.8274,0,0,0-1.3862,3.5735A4.3723,4.3723,0,0,0,11.9573,15H4v2H17.6519c1.9668.57,3.1432,1.3123,3.1733,3.3579a3.119,3.119,0,0,1-.8623,2.3931A5.8241,5.8241,0,0,1,16.2432,24a6.6344,6.6344,0,0,1-5.1451-2.6912L9.5649,22.593A8.5262,8.5262,0,0,0,16.2119,26c.0088-.0012.042,0,.1,0A7.67,7.67,0,0,0,21.36,24.1812a5.0779,5.0779,0,0,0,1.4648-3.8531A4.952,4.952,0,0,0,21.6753,17H28Z'/%3e%3crect%20id='_Transparent_Rectangle_'%20data-name='&lt;Transparent%20Rectangle&gt;'%20class='cls-1'%20width='32'%20height='32'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;background-color:currentColor;content:\"\";display:block;height:16px;width:16px}.reactodia-note-annotation__style-strikethrough:not(:empty):before{margin-right:3px}.reactodia-note-annotation__align-left{display:flex;align-items:center}.reactodia-note-annotation__align-left:before{-webkit-mask:url(\"data:image/svg+xml,%3csvg%20id='icon'%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2032%2032'%3e%3cdefs%3e%3cstyle%3e.cls-1{fill:none;}%3c/style%3e%3c/defs%3e%3ctitle%3ealign--left%3c/title%3e%3crect%20x='12'%20y='6'%20width='14'%20height='2'/%3e%3crect%20x='12'%20y='12'%20width='10'%20height='2'/%3e%3crect%20x='12'%20y='18'%20width='14'%20height='2'/%3e%3crect%20x='12'%20y='24'%20width='10'%20height='2'/%3e%3crect%20x='6'%20y='4'%20width='2'%20height='24'/%3e%3crect%20id='_Transparent_Rectangle_'%20data-name='&lt;Transparent%20Rectangle&gt;'%20class='cls-1'%20width='32'%20height='32'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;mask:url(\"data:image/svg+xml,%3csvg%20id='icon'%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2032%2032'%3e%3cdefs%3e%3cstyle%3e.cls-1{fill:none;}%3c/style%3e%3c/defs%3e%3ctitle%3ealign--left%3c/title%3e%3crect%20x='12'%20y='6'%20width='14'%20height='2'/%3e%3crect%20x='12'%20y='12'%20width='10'%20height='2'/%3e%3crect%20x='12'%20y='18'%20width='14'%20height='2'/%3e%3crect%20x='12'%20y='24'%20width='10'%20height='2'/%3e%3crect%20x='6'%20y='4'%20width='2'%20height='24'/%3e%3crect%20id='_Transparent_Rectangle_'%20data-name='&lt;Transparent%20Rectangle&gt;'%20class='cls-1'%20width='32'%20height='32'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;background-color:currentColor;content:\"\";display:block;height:16px;width:16px}.reactodia-note-annotation__align-left:not(:empty):before{margin-right:3px}.reactodia-note-annotation__align-center{display:flex;align-items:center}.reactodia-note-annotation__align-center:before{-webkit-mask:url(\"data:image/svg+xml,%3csvg%20id='icon'%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2032%2032'%3e%3cdefs%3e%3cstyle%3e.cls-1{fill:none;}%3c/style%3e%3c/defs%3e%3ctitle%3ealign--center%3c/title%3e%3crect%20x='6'%20y='6'%20width='20'%20height='2'/%3e%3crect%20x='10'%20y='12'%20width='12'%20height='2'/%3e%3crect%20x='6'%20y='18'%20width='20'%20height='2'/%3e%3crect%20x='10'%20y='24'%20width='12'%20height='2'/%3e%3crect%20id='_Transparent_Rectangle_'%20data-name='&lt;Transparent%20Rectangle&gt;'%20class='cls-1'%20width='32'%20height='32'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;mask:url(\"data:image/svg+xml,%3csvg%20id='icon'%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2032%2032'%3e%3cdefs%3e%3cstyle%3e.cls-1{fill:none;}%3c/style%3e%3c/defs%3e%3ctitle%3ealign--center%3c/title%3e%3crect%20x='6'%20y='6'%20width='20'%20height='2'/%3e%3crect%20x='10'%20y='12'%20width='12'%20height='2'/%3e%3crect%20x='6'%20y='18'%20width='20'%20height='2'/%3e%3crect%20x='10'%20y='24'%20width='12'%20height='2'/%3e%3crect%20id='_Transparent_Rectangle_'%20data-name='&lt;Transparent%20Rectangle&gt;'%20class='cls-1'%20width='32'%20height='32'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;background-color:currentColor;content:\"\";display:block;height:16px;width:16px}.reactodia-note-annotation__align-center:not(:empty):before{margin-right:3px}.reactodia-note-annotation__align-right{display:flex;align-items:center}.reactodia-note-annotation__align-right:before{-webkit-mask:url(\"data:image/svg+xml,%3csvg%20id='icon'%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2032%2032'%3e%3cdefs%3e%3cstyle%3e.cls-1{fill:none;}%3c/style%3e%3c/defs%3e%3ctitle%3ealign--right%3c/title%3e%3crect%20x='6'%20y='6'%20width='14'%20height='2'/%3e%3crect%20x='10'%20y='12'%20width='10'%20height='2'/%3e%3crect%20x='6'%20y='18'%20width='14'%20height='2'/%3e%3crect%20x='10'%20y='24'%20width='10'%20height='2'/%3e%3crect%20x='24'%20y='4'%20width='2'%20height='24'/%3e%3crect%20id='_Transparent_Rectangle_'%20data-name='&lt;Transparent%20Rectangle&gt;'%20class='cls-1'%20width='32'%20height='32'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;mask:url(\"data:image/svg+xml,%3csvg%20id='icon'%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2032%2032'%3e%3cdefs%3e%3cstyle%3e.cls-1{fill:none;}%3c/style%3e%3c/defs%3e%3ctitle%3ealign--right%3c/title%3e%3crect%20x='6'%20y='6'%20width='14'%20height='2'/%3e%3crect%20x='10'%20y='12'%20width='10'%20height='2'/%3e%3crect%20x='6'%20y='18'%20width='14'%20height='2'/%3e%3crect%20x='10'%20y='24'%20width='10'%20height='2'/%3e%3crect%20x='24'%20y='4'%20width='2'%20height='24'/%3e%3crect%20id='_Transparent_Rectangle_'%20data-name='&lt;Transparent%20Rectangle&gt;'%20class='cls-1'%20width='32'%20height='32'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;background-color:currentColor;content:\"\";display:block;height:16px;width:16px}.reactodia-note-annotation__align-right:not(:empty):before{margin-right:3px}.reactodia-note-annotation__variant{width:16px;height:16px;border-radius:var(--reactodia-border-radius-s);border-top-style:solid;border-top-width:16px}.reactodia-note-link__path:not([stroke]){stroke:var(--reactodia-color-gray-500)}.reactodia-note-link__path:not([stroke-width]){stroke-width:2}.reactodia-note-link__label{color:var(--reactodia-color-emphasis-600);font-weight:700}.reactodia-round-entity{width:120px;height:120px;background-color:var(--reactodia-element-background-color);border:4px solid var(--reactodia-element-style-color);border-radius:50%;display:grid;grid-template-rows:1fr 1fr 1fr;align-items:center;text-align:center}.reactodia-round-entity__types{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:11px;font-style:italic;color:#999;width:65%;justify-self:center;align-self:end}.reactodia-round-entity__label{font-size:18px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;margin:0 10px}.reactodia-standard-element{min-width:180px;max-width:400px;float:left}.reactodia-standard-element--group{border-radius:var(--reactodia-border-radius-s);border:1px solid;border-color:var(--reactodia-standard-group-color);background:var(--reactodia-element-background-color);padding:4px}.reactodia-standard-element__main{border-radius:var(--reactodia-border-radius-s);border:1px solid;border-color:var(--reactodia-element-style-color);background-color:var(--reactodia-element-style-color)}.reactodia-standard-element__body{margin-left:8px;border-radius:0 var(--reactodia-border-radius-s) var(--reactodia-border-radius-s) 0;border-left:1px solid;border-left-color:var(--reactodia-element-style-color);padding:3px 0;background:var(--reactodia-element-background-color)}.reactodia-standard-element--new .reactodia-standard-element__main{background-color:var(--reactodia-element-background-color)}.reactodia-standard-element__body-horizontal{display:flex;align-items:center;justify-content:space-between;overflow:hidden}.reactodia-standard-element__body-content{flex-grow:1;min-width:0;margin-right:12px}.reactodia-standard-element__item{display:flex;border-radius:var(--reactodia-border-radius-s);border:0px}.reactodia-standard-element__item-filler{font-size:15px;padding:3px}.reactodia-standard-element__item:not(:first-child),.reactodia-standard-element__item-filler:not(:first-child){margin-top:4px}.reactodia-standard-element__item-stripe{width:6px;background:var(--reactodia-element-style-color)}.reactodia-standard-element--new .reactodia-standard-element__item-stripe{background:var(--reactodia-element-background-color);border:1px solid var(--reactodia-element-style-color)}.reactodia-standard-element__item-body{flex:auto;display:flex;padding:3px;overflow:hidden;text-overflow:ellipsis;background:var(--reactodia-element-background-color)}.reactodia-standard-element__label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.reactodia-standard-element--standalone .reactodia-standard-element__label{font-size:19px}.reactodia-standard-element--group .reactodia-standard-element__label{font-size:15px;flex:auto}.reactodia-standard-element--group .reactodia-standard-element--changed .reactodia-standard-element__label{font-style:italic;color:#09f}.reactodia-standard-element--group .reactodia-standard-element--deleted .reactodia-standard-element__label{text-decoration:line-through;color:#ff3b3b}.reactodia-standard-element__thumbnail{font-size:26px;margin:5px 10px;flex-shrink:0;width:50px;height:50px;display:flex;justify-content:center;align-items:center;color:var(--reactodia-element-style-color)}.reactodia-standard-element__thumbnail-image{max-height:100%;max-width:100%}.reactodia-standard-element__thumbnail-icon{width:26px;height:26px;object-fit:contain}.reactodia-standard-element__thumbnail-icon--monochrome{filter:var(--reactodia-monochrome-icon-filter)}.reactodia-standard-element__photo{border-bottom:1px solid;border-color:var(--reactodia-element-style-color)}.reactodia-standard-element__photo-image{width:100%;border-radius:var(--reactodia-border-radius-s) var(--reactodia-border-radius-s) 0 0}.reactodia-standard-element__type{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:11px;font-style:italic;color:#999;display:flex}.reactodia-standard-element__type-value{width:0;flex-grow:1;overflow:hidden;text-overflow:ellipsis}.reactodia-standard-element__iri{width:100%;overflow:hidden;display:flex}.reactodia-standard-element__iri-key{font-size:12px;margin-right:4px;color:var(--reactodia-color-emphasis-500)}.reactodia-standard-element__iri-value{font-size:12px;width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.reactodia-standard-element__iri-value a{color:var(--reactodia-color-emphasis-500)}.reactodia-standard-element__hr{border:0;border-top:1px solid var(--reactodia-border-color-base);height:0;margin:5px 0}.reactodia-standard-element__properties{font-size:15px;max-height:200px;overflow-y:scroll;overflow-x:hidden}.reactodia-standard-element__properties-row{display:grid;grid-template-columns:1fr 1fr;white-space:nowrap}.reactodia-standard-element__properties-key{display:inline-block;text-overflow:ellipsis;overflow:hidden;vertical-align:top}.reactodia-standard-element__properties-values{display:inline-block;text-overflow:ellipsis;overflow:hidden}.reactodia-standard-element__properties-value{width:100%;overflow:hidden;text-overflow:ellipsis;white-space:initial;padding-right:10px}.reactodia-standard-element__pinned-props{border-top:1px solid;border-color:var(--reactodia-element-style-color);margin:0 5px}.reactodia-standard-element__dropdown{border:1px solid;border-color:var(--reactodia-element-style-color);border-radius:var(--reactodia-border-radius-s);background-color:var(--reactodia-element-background-color);margin-top:5px}.reactodia-standard-element__dropdown-content{width:100%;padding:9px}.reactodia-standard-element__actions{display:flex;justify-content:space-between}.reactodia-standard-element__delete-button,.reactodia-standard-element__edit-button{display:flex;align-items:center;padding:5px;min-width:60px}.reactodia-standard-element__delete-button{display:flex;align-items:center}.reactodia-standard-element__delete-button:before{-webkit-mask:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M10%203h3v1h-1v9l-1%201H4l-1-1V4H2V3h3V2a1%201%200%200%201%201-1h3a1%201%200%200%201%201%201v1zM9%202H6v1h3V2zM4%2013h7V4H4v9zm2-8H5v7h1V5zm1%200h1v7H7V5zm2%200h1v7H9V5z'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;mask:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M10%203h3v1h-1v9l-1%201H4l-1-1V4H2V3h3V2a1%201%200%200%201%201-1h3a1%201%200%200%201%201%201v1zM9%202H6v1h3V2zM4%2013h7V4H4v9zm2-8H5v7h1V5zm1%200h1v7H7V5zm2%200h1v7H9V5z'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;background-color:currentColor;content:\"\";display:block;height:16px;width:16px}.reactodia-standard-element__delete-button:not(:empty):before{margin-right:3px}.reactodia-standard-element__edit-button{display:flex;align-items:center}.reactodia-standard-element__edit-button:before{-webkit-mask:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20d='M13.23%201h-1.46L3.52%209.25l-.16.22L1%2013.59%202.41%2015l4.12-2.36.22-.16L15%204.23V2.77L13.23%201zM2.41%2013.59l1.51-3%201.45%201.45-2.96%201.55zm3.83-2.06L4.47%209.76l8-8%201.77%201.77-8%208z'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;mask:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20d='M13.23%201h-1.46L3.52%209.25l-.16.22L1%2013.59%202.41%2015l4.12-2.36.22-.16L15%204.23V2.77L13.23%201zM2.41%2013.59l1.51-3%201.45%201.45-2.96%201.55zm3.83-2.06L4.47%209.76l8-8%201.77%201.77-8%208z'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;background-color:currentColor;content:\"\";display:block;height:16px;width:16px}.reactodia-standard-element__edit-button:not(:empty):before{margin-right:3px}.reactodia-standard-element__ungroup-one-button{display:flex;align-items:center}.reactodia-standard-element__ungroup-one-button:before{-webkit-mask:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M10.072%208.024L5.715%203.667l.618-.62L11%207.716v.618L6.333%2013l-.618-.619%204.357-4.357z'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;mask:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%20fill='currentColor'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M10.072%208.024L5.715%203.667l.618-.62L11%207.716v.618L6.333%2013l-.618-.619%204.357-4.357z'/%3e%3c/svg%3e\") 0px 0px/contain no-repeat;background-color:currentColor;content:\"\";display:block;height:16px;width:16px}.reactodia-standard-element__ungroup-one-button:not(:empty):before{margin-right:3px}.reactodia-standard-element__ungroup-one-button{width:18px;height:18px;padding:0;align-self:center;margin-left:2px;display:block;opacity:0;transition:opacity .2s 0ms}.reactodia-standard-element:hover .reactodia-standard-element__ungroup-one-button,.reactodia-standard-element:focus .reactodia-standard-element__ungroup-one-button{opacity:1}.reactodia-standard-element--group .reactodia-group-paginator{margin-top:4px;opacity:.4;transition:opacity .2s 0ms}.reactodia-standard-element--group .reactodia-group-paginator:hover{opacity:1}.reactodia-standard-link--group .reactodia-link-path{stroke-width:2px}.reactodia-standard-link__path:not([stroke]){stroke:var(--reactodia-link-stroke-color)}.reactodia-standard-link__label{font-weight:700}.reactodia-standard-link__label--renamed{font-style:italic;font-weight:400}.reactodia-standard-link__property{font-style:normal;font-weight:400;font-size:90%;max-width:150px;overflow:hidden;text-overflow:ellipsis}.reactodia-standard-link__source-count,.reactodia-standard-link__target-count{color:var(--reactodia-color-emphasis-600);font-size:12px;font-weight:700;opacity:80%}")),document.head.appendChild(t)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}}();const xa=x.createContext("light"),Sa=x.createContext({actInColorScheme:()=>{}});class Ea{listeners=new Map;anyListeners;on(t,e){let n=this.listeners.get(t);n||(n=new Set,this.listeners.set(t,n)),n.add(e)}onAny(t){let e=this.anyListeners;e||(e=new Set,this.anyListeners=e),e.add(t)}off(t,e){const n=this.listeners.get(t);n&&n.delete(e)}offAny(t){const e=this.anyListeners;e&&e.delete(t)}trigger(t,e){const n=this.listeners.get(t);if(n)for(const t of n)t(e);if(this.anyListeners)for(const n of this.anyListeners)n({[t]:e})}}class Ca{onDispose=new Set;listen(t,e,n){t.on(e,n),this.onDispose.add((()=>t.off(e,n)))}listenAny(t,e){t.onAny(e),this.onDispose.add((()=>t.offAny(e)))}listenOnce(t,e,n){let r;const i=o=>{t.off(e,i),this.onDispose.delete(r),n(o)};r=()=>{t.off(e,i),this.onDispose.delete(r)},t.on(e,i),this.onDispose.add(r)}stopListening(){for(const t of this.onDispose)t();this.onDispose.clear()}}class Ma{scheduled;_timeout;callback;constructor(t="frame"){this._timeout=t,this.runSynchronously=this.runSynchronously.bind(this)}get timeout(){return this._timeout}setTimeout(t){this._timeout=t}call(t){this.callback=t,this.schedule()}schedule(){void 0===this.scheduled&&(this.scheduled="frame"===this.timeout?requestAnimationFrame(this.runSynchronously):setTimeout(this.runSynchronously,this.timeout))}run(){const t=this.callback;t?.()}runSynchronously=()=>{this.cancelScheduledTimeout()&&this.run()};dispose(){this.cancelScheduledTimeout()}cancelScheduledTimeout(){return void 0!==this.scheduled&&("frame"===this.timeout?cancelAnimationFrame(this.scheduled):clearTimeout(this.scheduled),this.scheduled=void 0,!0)}}class La{constructor(t,e=200){this.onFetch=t,this.debouncer=new Ma(e)}debouncer;queuedItems=new Set;has(t){return this.queuedItems.has(t)}push(t){this.queuedItems.add(t),this.debouncer.call(this.run)}clear(){this.queuedItems.clear()}run=()=>{const{queuedItems:t,onFetch:e}=this,n=Array.from(t);t.clear(),e(n)}}const $a="urn:reactodia:isPlaceholder",Na="urn:reactodia:newElement",Ta="urn:reactodia:newLink";class Aa{constructor(t){this.value=t}static empty=new Aa(void 0);static property(t){return{of:()=>t}}get(t){return this.value?.[t]}set(t,e){const n=this.value;if(void 0!==e){if(n?.[t]!==e)return new Aa({...n,[t]:e})}else if(void 0!==n?.[t]){const{[t]:e,...r}=n;return new Aa(r)}return this}static fromJSON(t){return void 0===t?Aa.empty:new Aa(t)}toJSON(){return this.value?{...this.value}:void 0}}var za,Ia;(Ia=za||(za={})).Expanded=Aa.property("urn:reactodia:expanded").of(),Ia.ElementSize=Aa.property("urn:reactodia:elementSize").of(),Ia.PinnedProperties=Aa.property("urn:reactodia:pinnedProperties").of(),Ia.CustomLabel=Aa.property("urn:reactodia:customLabel").of(),Ia.LayoutOnly=Aa.property("urn:reactodia:layoutOnly").of(),Ia.GroupPageIndex=Aa.property("urn:reactodia:groupPageIndex").of(),Ia.GroupPageSize=Aa.property("urn:reactodia:groupPageSize").of(),Ia.AnnotationContent=Aa.property("urn:reactodia:annotationContent").of(),Ia.ColorVariant=Aa.property("urn:reactodia:colorVariant").of();const Ra=["default","primary","success","info","warning","danger"];class Oa{get factory(){return Di}knownElementTypes(t){return Promise.resolve({elementTypes:[],subtypeOf:[]})}knownLinkTypes(t){return Promise.resolve([])}elementTypes(t){return Promise.resolve(new Map)}propertyTypes(t){return Promise.resolve(new Map)}linkTypes(t){return Promise.resolve(new Map)}elements(t){return Promise.resolve(new Map)}links(t){return Promise.resolve([])}connectedLinkStats(t){return Promise.resolve([])}lookup(t){return Promise.resolve([])}}var Pa,Va;function ja(){function t(){return Math.floor(4294967296*(1+Math.random())).toString(16).substring(1)}return t()+t()+t()+t()}function Da(t){const e=new RegExp(function(t){return t.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&")}(t),"i");return t=>e.test(t)}function*Ha(t,e,n,r,i){const o=Math.ceil(r/2),a=new Set,s=[];let l=0,c=0;function u(){const t={sources:[...a],targets:[...s]};return s.length=0,c=0,t}for(let d=0;d<t.length;d++){const h=t[d];if(a.add(h),l+=n(h),l>=o||d===t.length-1){for(const t of e){if(i&&i.has(t))continue;const e=n(t);c>0&&l+c+e>r&&(yield u()),s.push(t),c+=e}c>0&&(yield u()),a.clear(),l=0}}}function Ba(t){return Boolean(t&&"NamedNode"===t.termType)}function Fa(t){return Boolean(t&&"Literal"===t.termType)}(Va=Pa||(Pa={})).hashCode=function(t){return j(Math.imul(Hi(t.source),31)+Hi(t.predicate)|0)},Va.equals=function(t,e){return Bi(t.source,e.source)&&Bi(t.predicate,e.predicate)};const Ua="urn:reactodia:sparql:label",Wa=new Map,qa=new Set;function Ga(t,e){for(const n of t.results.bindings){const t=n.link.value,r=e.get(t);r?es(r.label,n.label):e.set(t,os(n))}}function Za(t,e,n,r){const i={};for(const o in t.properties){if(!Object.hasOwnProperty.call(t.properties,o))continue;const a=n.get(o);if(a&&a.length>0)for(const n of a)Ja(n,e)&&(i[n.id]=t.properties[o]);else r&&(i[o]=t.properties[o])}return i}function Ka(t,e,n){if(!e)return!0;const r=Qa(t,e,n,!1);for(const t of r)return!0;return!1}function*Qa(t,e,n,r){for(const i of e){const e=n.get(i);if(e)for(const n of e)Ja(n,t)&&(yield n.id);else r&&(yield i)}}function Xa(t){return!/[?$][a-zA-Z]+\b/.test(t.path)}function Ya(t){return!/[?$][a-zA-Z]+\b/.test(t.path)}function Ja(t,e){if(t.domain&&0!==t.domain.length){if(e){for(const n of t.domain)if(e.has(n))return!0;return!1}return!1}return!0}function ts(t,e,n){t&&(e.label&&ns(t.properties,n,e.label),e.class&&t.types.indexOf(e.class.value)<0&&t.types.push(e.class.value),e.propType&&e.propValue&&e.propType.value!==Ua&&ns(t.properties,e.propType.value,e.propValue))}function es(t,e){if(e){for(const n of t)if(Bi(n,e))return;t.push(e)}}function ns(t,e,n){let r=Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0;if(r){for(const t of r)if(Bi(t,n))return}else r=[],t[e]=r;r.push(n)}function rs(t){const e=+t.value;return Number.isFinite(e)?e:0}function is(t){return{id:t,types:[],properties:{}}}function os(t){return{id:t.link.value,label:t.label?[t.label]:[],count:t.instcount?rs(t.instcount):void 0}}const as={linkConfigurations:[],openWorldLinks:!1,propertyConfigurations:[],openWorldProperties:!1,linksInfoQuery:"SELECT ?source ?type ?target\n WHERE {\n ${linkConfigurations}\n VALUES (?source) {${sourceIris}}\n VALUES (?target) {${targetIris}}\n }",defaultPrefix:"",schemaLabelProperty:"rdfs:label",dataLabelProperty:"rdfs:label",fullTextSearch:{prefix:"",queryPattern:""},classTreeQuery:"",classInfoQuery:'SELECT ?class ?label ?instcount WHERE {\n VALUES(?class) {${ids}}\n OPTIONAL {\n ?class ${schemaLabelProperty} ?label\n ${labelLanguageFilter}\n }\n BIND("" as ?instcount)\n}',linkTypesQuery:"SELECT DISTINCT ?link ?instcount ?label WHERE {\n ${linkTypesPattern}\n OPTIONAL {\n ?link ${schemaLabelProperty} ?label\n ${labelLanguageFilter}\n }\n}",linkTypesPattern:"",linkTypesInfoQuery:"SELECT ?link ?label WHERE {\n VALUES(?link) {${ids}}\n OPTIONAL {\n ?link ${schemaLabelProperty} ?label\n ${labelLanguageFilter}\n }\n}",propertyInfoQuery:"SELECT ?property ?label WHERE {\n VALUES(?property) {${ids}}\n OPTIONAL {\n ?property ${schemaLabelProperty} ?label\n ${labelLanguageFilter}\n }\n}",elementInfoQuery:"",imageQueryPattern:"",linkTypesOfQuery:"",linkTypesStatisticsQuery:"",lookupQuery:"SELECT ${outerProjection} WHERE {\n ${filterInnerPrelude}\n {\n SELECT DISTINCT ${innerProjection} WHERE {\n ${filterByType}\n ${filterByRefElementLink}\n ${filterByText}\n ${filterAdditionalRestriction}\n } ${orderBy} ${limit}\n }\n ${queryTypes}\n ${queryElementInfo}\n} ${orderBy}",filterRefElementLinkPattern:"",filterTypePattern:"",filterAdditionalRestriction:"",filterElementInfoPattern:"",defaultPrefix:"PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>\n PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>\n PREFIX owl: <http://www.w3.org/2002/07/owl#>\n",schemaLabelProperty:"rdfs:label",dataLabelProperty:"rdfs:label",fullTextSearch:{prefix:"",queryPattern:'?inst ${dataLabelProperty} ?search1\n FILTER regex(COALESCE(str(?search1)), "${text}", "i")\n BIND(0 as ?score)\n',extractLabel:!0},classTreeQuery:"\n SELECT ?class ?label ?parent\n WHERE {\n {\n ?class a rdfs:Class\n } UNION {\n ?class a owl:Class\n }\n FILTER ISIRI(?class)\n OPTIONAL {\n ?class rdfs:label ?label\n ${labelLanguageFilter}\n }\n OPTIONAL {?class rdfs:subClassOf ?parent. FILTER ISIRI(?parent)}\n }\n ",linkTypesPattern:"\n { ?link a rdf:Property }\n UNION\n { ?link a owl:ObjectProperty }\n BIND('' as ?instcount)\n ",elementInfoQuery:"\n CONSTRUCT {\n ?inst <urn:reactodia:sparql:type> ?class .\n ?inst <urn:reactodia:sparql:label> ?label .\n ?inst ?propType ?propValue.\n } WHERE {\n VALUES (?inst) {${ids}}\n OPTIONAL { ?inst a ?class }\n OPTIONAL {\n ?inst ${dataLabelProperty} ?label\n ${labelLanguageFilter}\n }\n OPTIONAL {\n ${propertyConfigurations}\n FILTER (isLiteral(?propValue))\n ${valueLanguageFilter}\n }\n }\n ",imageQueryPattern:"{ ?inst ?linkType ?image } UNION { [] ?linkType ?inst. BIND(?inst as ?image) }",linkTypesOfQuery:"\n SELECT DISTINCT ?link ?direction\n WHERE {\n ${linkConfigurations}\n }\n ",linkTypesStatisticsQuery:"\n SELECT ?link ?outCount ?inCount\n WHERE {\n {\n SELECT (${linkId} as ?link) (count(?outObject) as ?outCount) WHERE {\n ${linkConfigurationOut}\n ${navigateElementFilterOut}\n } LIMIT 101\n } {\n SELECT (${linkId} as ?link) (count(?inObject) as ?inCount) WHERE {\n ${linkConfigurationIn}\n ${navigateElementFilterIn}\n } LIMIT 101\n }\n }\n ",filterRefElementLinkPattern:"",filterTypePattern:"?inst a ?instType. ?instType rdfs:subClassOf* ?class",filterElementInfoPattern:"\n OPTIONAL {?inst rdf:type ?foundClass}\n BIND (coalesce(?foundClass, owl:Thing) as ?class)\n OPTIONAL {\n ?inst ${dataLabelProperty} ?label\n ${labelLanguageFilter}\n }\n ",filterAdditionalRestriction:"",classTreeQuery:"\n SELECT ?class ?instcount ?label ?parent\n WHERE {\n {SELECT ?class (count(?inst) as ?instcount)\n WHERE {\n ?inst rdf:type ?class.\n FILTER ISIRI(?class)\n } GROUP BY ?class } UNION\n {\n ?class rdf:type rdfs:Class\n } UNION {\n ?class rdf:type owl:Class\n }\n OPTIONAL {\n ?class rdfs:label ?label\n ${labelLanguageFilter}\n }\n OPTIONAL {?class rdfs:subClassOf ?parent. FILTER ISIRI(?parent)}\n }\n "};class ss{factory;options;settings;queryFunction;acceptBlankNodes=!1;chunkMeasure;linkByPredicate=new Map;linkById=new Map;openWorldLinks;propertyByPredicate=new Map;openWorldProperties;labelPredicate;imagePredicate;constructor(t,e=as){const{factory:n=Di,queryFunction:r=fs}=t;this.factory=n,this.options=t,this.settings=e,this.queryFunction=r;const{chunk:i,queryMethod:o="GET",prepareLabelPredicate:a,prepareImagePredicate:s}=this.options;if(i&&!Number.isSafeInteger(i.maxSize))throw new Error("SparqlDataProviderOptions.chunk.maxSize should be a non-negative number");this.chunkMeasure=i?{maxSize:i.maxSize,measure:ls(i.unit)}:void 0===i&&"GET"===o?{maxSize:2500,measure:ls("totalLength")}:{maxSize:1/0,measure:ls("itemCount")};for(const t of e.linkConfigurations){this.linkById.set(t.id,t);const e=Xa(t)?t.path:t.id;yi(this.linkByPredicate,e,t)}this.openWorldLinks=0===e.linkConfigurations.length||Boolean(e.openWorldLinks);for(const t of e.propertyConfigurations){const e=Ya(t)?t.path:t.id;yi(this.propertyByPredicate,e,t)}this.openWorldProperties=0===e.propertyConfigurations.length||Boolean(e.openWorldProperties),this.labelPredicate=a??Zi.label,this.imagePredicate=s??Ki.thumbnailUrl}async queryChunked(t,e){const{maxSize:n,measure:r}=this.chunkMeasure,i=[];for(const o of function*(t,e,n){if(!Number.isFinite(n))return void(yield t);const r=[];let i=0;for(const o of t){const t=e(o);i>0&&i+t>n&&(yield[...r],r.length=0,i=0),r.push(o),i+=t}i>0&&(yield r)}(t,r,n))i.push(e(o));await Promise.all(i)}async knownElementTypes(t){const{signal:e}=t,{defaultPrefix:n,schemaLabelProperty:r,filterOnlyLanguages:i,classTreeQuery:o}=this.settings;if(!o)return{elementTypes:[],subtypeOf:[]};const a=n+ds(o,{schemaLabelProperty:r,labelLanguageFilter:ps("?label",i)}),s=function(t){const e=new Map,n=new W(Ui,Wi);for(const i of t.results.bindings){if(!Ba(i.class))continue;const t=i.class.value;let o=e.get(t);o||(o=r(t),e.set(t,o)),es(o.label,i.label),i.parent&&n.add([t,i.parent.value]),i.instcount&&(o.count=rs(i.instcount))}for(const n of t.results.bindings)if(n.parent){const t=n.parent.value;e.has(t)||e.set(t,r(t))}function r(t){return{id:t,label:[],count:void 0}}return{elementTypes:Array.from(e.values()),subtypeOf:Array.from(n.values())}}(await this.executeSparqlSelect(a,{signal:e}));return this.options.prepareLabels&&await cs(s.elementTypes,this.options.prepareLabels,e),s}async propertyTypes(t){const{propertyIds:e,signal:n}=t,{defaultPrefix:r,schemaLabelProperty:i,filterOnlyLanguages:o,propertyInfoQuery:a}=this.settings,s=new Map;if(a)await this.queryChunked(e,(async t=>{const e=t.map(vs).map((t=>` ( ${t} )`)).join(" "),l=r+ds(a,{ids:e,schemaLabelProperty:i,labelLanguageFilter:ps("?label",o)});!function(t,e){for(const n of t.results.bindings){const t=n.property.value,r=e.get(t);r?es(r.label,n.label):e.set(t,{id:n.property.value,label:n.label?[n.label]:[]})}}(await this.executeSparqlSelect(l,{signal:n}),s)}));else for(const t of e)s.set(t,{id:t,label:[]});return this.options.prepareLabels&&await cs(Array.from(s.values()),this.options.prepareLabels,n),s}async elementTypes(t){const{classIds:e,signal:n}=t,{defaultPrefix:r,schemaLabelProperty:i,filterOnlyLanguages:o,classInfoQuery:a}=this.settings,s=new Map;if(a)await this.queryChunked(e,(async t=>{const e=t.map(vs).map((t=>` ( ${t} )`)).join(" "),l=r+ds(a,{ids:e,schemaLabelProperty:i,labelLanguageFilter:ps("?label",o)});!function(t,e){for(const n of t.results.bindings){if(!n.class)continue;const t=n.class.value,r=e.get(t);if(r){if(es(r.label,n.label),n.instcount){const t=rs(n.instcount);void 0!==t&&(r.count=void 0===r.count?t:Math.max(r.count,t))}}else e.set(t,{id:t,label:n.label?[n.label]:[],count:n.instcount?rs(n.instcount):void 0})}}(await this.executeSparqlSelect(l,{signal:n}),s)}));else for(const t of e)s.set(t,{id:t,label:[]});return this.options.prepareLabels&&await cs(Array.from(s.values()),this.options.prepareLabels,n),s}async linkTypes(t){const{linkTypeIds:e,signal:n}=t,{defaultPrefix:r,schemaLabelProperty:i,filterOnlyLanguages:o,linkTypesInfoQuery:a}=this.settings,s=new Map;if(a)await this.queryChunked(e,(async t=>{const e=t.map(vs).map((t=>` ( ${t} )`)).join(" "),l=r+ds(a,{ids:e,schemaLabelProperty:i,labelLanguageFilter:ps("?label",o)});Ga(await this.executeSparqlSelect(l,{signal:n}),s)}));else for(const t of e)s.set(t,{id:t,label:[]});return this.options.prepareLabels&&await cs(Array.from(s.values()),this.options.prepareLabels,n),s}async knownLinkTypes(t){const{signal:e}=t,{defaultPrefix:n,schemaLabelProperty:r,filterOnlyLanguages:i,linkTypesQuery:o,linkTypesPattern:a}=this.settings;if(!o)return[];const s=n+ds(o,{linkTypesPattern:a,schemaLabelProperty:r,labelLanguageFilter:ps("?label",i)}),l=function(t){const e=new Map;return Ga(t,e),e}(await this.executeSparqlSelect(s,{signal:e}));return this.options.prepareLabels&&await cs(Array.from(l.values()),this.options.prepareLabels,e),Array.from(l.values())}async elements(t){const{elementIds:e,signal:n}=t,r=[];e.length>0&&await this.queryChunked(e,(async t=>{const e=t.map(vs).map((t=>` (${t})`)).join(" "),{defaultPrefix:n,dataLabelProperty:i,filterOnlyLanguages:o,elementInfoQuery:a}=this.settings,s=n+ds(a,{ids:e,dataLabelProperty:i,labelLanguageFilter:ps("?label",o),valueLanguageFilter:ps("?propValue",o),propertyConfigurations:this.formatPropertyInfo()}),l=await this.executeSparqlConstruct(s);for(const t of l)r.push(t)}));const i=this.queryManyElementTypes(this.settings.propertyConfigurations.length>0?e:[],n),o=function(t){const e=new Map,n={head:{vars:["inst","class","label","blankType","propType","propValue"]},results:{bindings:[]}};for(const n of t){if(!Ba(n.subject))continue;const t=n.subject.value;e.has(t)||e.set(t,r(n)),n.predicate.value===Ua&&Fa(n.object)?(e.get(t).label&&e.set(t,r(n)),e.get(t).label=n.object):"urn:reactodia:sparql:type"===n.predicate.value&&Ba(n.object)&&Ba(n.predicate)?(e.get(t).class&&e.set(t,r(n)),e.get(t).class=n.object):(Ba(n.object)||Fa(n.object))&&Ba(n.predicate)&&(e.get(t).propType&&e.set(t,r(n)),e.get(t).propType=n.predicate,e.get(t).propValue=n.object)}function r(t){const e={inst:t.subject};return n.results.bindings.push(e),e}return n}(r),a=function(t,e=Wa,n=Wa,r,i){const o=new Map;for(const e of t.results.bindings){if(!Ba(e.inst))continue;const t=e.inst.value;let n=o.get(t);n||(n=is(t),o.set(t,n)),ts(n,e,r)}if(!i||n.size>0)for(const t of o.values()){const r=e.get(t.id);t.properties=Za(t,r,n,i)}for(const t of o.values())t.types.sort();return o}(o,await i,this.propertyByPredicate,this.labelPredicate,this.openWorldProperties);return this.options.prepareLabels&&await us(Array.from(a.values()),this.options.prepareLabels,this.labelPredicate,n),this.options.prepareImages?await function(t,e,n,r,i){return e(t.values(),i).then((e=>{for(const[i,o]of e){const e=t.get(i);e&&ns(e.properties,n,r.namedNode(o))}}))}(a,this.options.prepareImages,this.imagePredicate,this.factory,n):this.options.imagePropertyUris&&this.options.imagePropertyUris.length&&await this.attachImages(a,this.options.imagePropertyUris,n),a}async attachImages(t,e,n){const r=e.map(vs).map((t=>` ( ${t} )`)).join(" ");await this.queryChunked(Array.from(t.keys()),(async e=>{const i=e.map((t=>` ( ${vs(t)} )`)).join(" "),o=this.settings.defaultPrefix+`\n SELECT ?inst ?linkType ?image\n WHERE {\n VALUES (?inst) {${i}}\n VALUES (?linkType) {${r}}\n ${this.settings.imageQueryPattern}\n }\n `;try{!function(t,e,n){for(const r of t.results.bindings){if(!Ba(r.inst))continue;const t=e.get(r.inst.value);t&&ns(t.properties,n,r.image)}}(await this.executeSparqlSelect(o,{signal:n}),t,this.imagePredicate)}catch(t){console.warn("Failed to load entity image URLs",t)}}))}async links(t){const{primary:e,secondary:n,linkTypeIds:r,signal:i}=t,{filterOnlyLanguages:o,linksInfoQuery:a}=this.settings,s=ps("?propValue",o),l=this.formatLinkLinks();let c,u;if(c=e.length>0&&n.length>0?a.includes("${ids}")?this.queryUndirectedLinks(e,n,{propLanguageFilter:s,linkConfigurations:l},i):this.queryDirectedLinks(e,n,{propLanguageFilter:s,linkConfigurations:l},i):Promise.resolve([]),this.linkByPredicate.size>0){u=new Set(e);for(const t of n)u.add(t)}const d=this.queryManyElementTypes(u?Array.from(u):[],i);let h=function(t,e=Wa,n=Wa,r=!0){const i=new U(Gi,qi);for(const o of t){const t={sourceId:o.source.value,linkTypeId:o.type.value,targetId:o.target.value,properties:{}},a=i.get(t);if(a)o.propType&&o.propValue&&ns(a.properties,o.propType.value,o.propValue);else{o.propType&&o.propValue&&ns(t.properties,o.propType.value,o.propValue);const a=n.get(t.linkTypeId);if(a&&a.length>0){for(const n of a)if(Ja(n,e.get(t.sourceId))){const e=Xa(n)?{...t,linkTypeId:n.id}:t;i.set(e,e)}}else r&&i.set(t,t)}}return Array.from(i.values())}(await c,await d,this.linkByPredicate,this.openWorldLinks);if(r){const t=new Set(r);h=h.filter((e=>t.has(e.linkTypeId)))}return h}async queryUndirectedLinks(t,e,n,r){const{propLanguageFilter:i,linkConfigurations:o}=n,{defaultPrefix:a,linksInfoQuery:s}=this.settings,l=new Set(t);for(const t of e)l.add(t);const c=a+ds(s,{ids:gs(l),propLanguageFilter:i,linkConfigurations:o});return(await this.executeSparqlSelect(c,{signal:r})).results.bindings}async queryDirectedLinks(t,e,n,r){const{propLanguageFilter:i,linkConfigurations:o}=n,{defaultPrefix:a,linksInfoQuery:s}=this.settings,{maxSize:l,measure:c}=this.chunkMeasure,u=[],d=Array.from(function*(t,e,n,r){t.length<e.length&&([t,e]=[e,t]);const i=new Set(e),o=new Set;for(const e of t)i.has(e)&&o.add(e);yield*Ha(t,e,n,r),yield*Ha(e,t,n,r,i.size===o.size?o:void 0)}(t,e,c,l),(async t=>{const e=a+ds(s,{sourceIris:gs(t.sources),targetIris:gs(t.targets),propLanguageFilter:i,linkConfigurations:o}),n=await this.executeSparqlSelect(e,{signal:r});for(const t of n.results.bindings)u.push(t)}));return await Promise.all(d),u}async connectedLinkStats(t){const{elementId:e,inexactCount:n,signal:r}=t,{defaultPrefix:i,linkTypesOfQuery:o,linkTypesStatisticsQuery:a,filterTypePattern:s}=this.settings,l=/\?direction\b/.test(o),c=vs(e),u=this.formatLinkUnion(e,void 0,void 0,"?outObject","?inObject",l);u.usePredicatePart&&(u.unionParts.push(`{ ${c} ?link ?outObject ${l?'BIND("out" AS ?direction)':""} }`),u.unionParts.push(`{ ?inObject ?link ${c} ${l?'BIND("in" AS ?direction)':""} }`));const d=i+ds(o,{elementIri:c,linkConfigurations:u.unionParts.join("\nUNION\n")}),h=await this.executeSparqlSelect(d,{signal:r}),f=h.head.vars.includes("direction"),p=function(t,e=Wa,n=!0){const r=new Map,i=(t,e)=>{let n=r.get(t);n||(n={linkType:t},r.set(t,n)),Fa(e)&&("in"===e.value?n.hasInLink=!0:"out"===e.value&&(n.hasOutLink=!0))};for(const r of t.results.bindings){if(!Ba(r.link))continue;const t=e.get(r.link.value);if(t&&t.length>0)for(const e of t)i(Xa(e)?e.id:r.link.value,r.direction);else n&&i(r.link.value,r.direction)}return Array.from(r.values())}(h,this.linkByPredicate,this.openWorldLinks),g=this.acceptBlankNodes?"FILTER (IsIri(?outObject) || IsBlank(?outObject))":"FILTER IsIri(?outObject)",v=this.acceptBlankNodes?"FILTER (IsIri(?inObject) || IsBlank(?inObject))":"FILTER IsIri(?inObject)",m=[];return await Promise.all(p.map((async({linkType:t,hasInLink:e,hasOutLink:o})=>{const l=this.linkById.get(t);let u,d;if(!l||Xa(l)){const e=vs(l&&Xa(l)?l.path:t);u=`${c} ${e} ?outObject`,d=`?inObject ${e} ${c}`}else u=this.formatLinkPath(l.path,c,"?outObject"),d=this.formatLinkPath(l.path,"?inObject",c);if(l&&l.domain&&l.domain.length>0){const t=l.domain.map(vs).join(", ");u+=` { ${s.replace(/[?$]inst\b/g,c)} FILTER(?class IN (${t})) }`,d+=` { ${s.replace(/[?$]inst\b/g,"?inObject")} FILTER(?class IN (${t})) }`}if(!a||n&&f)m.push({id:t,inCount:e?1:0,outCount:o?1:0,inexact:!0});else{const e=i+ds(a,{linkId:vs(t),elementIri:c,linkConfigurationOut:u,linkConfigurationIn:d,navigateElementFilterOut:g,navigateElementFilterIn:v}),n=function(t){for(const n of t.results.bindings)if(Ba(n.link))return{id:(e=n).link.value,inCount:rs(e.inCount),outCount:rs(e.outCount)};var e}(await this.executeSparqlSelect(e,{signal:r}));n&&m.push(n)}}))),m}async lookup(t){const{signal:e}=t,n={...t,limit:void 0===t.limit?100:t.limit},r=this.querySingleElementTypes(n.refElementId&&this.settings.linkConfigurations.length>0?n.refElementId:void 0,e),i=this.createFilterQuery(n),o=function(t,e,n,r,i){const o=n??Wa,a=new Map,s=new Map,l=new Map,c=new Map;for(const e of t.results.bindings){if(!Ba(e.inst)&&(u=e.inst,!Boolean(u&&"BlankNode"===u.termType)))continue;const t=e.inst.value;let n=a.get(t);if(n||(n=is(t),a.set(t,n)),ts(n,e,r),Ba(e.classAll)&&_i(s,t,e.classAll.value),!i&&e.link&&e.direction){const t="in"===e.direction.value?c:"out"===e.direction.value?l:void 0;t&&_i(t,n.id,e.link.value)}}var u;const d=[];for(const t of a.values()){const n=s.get(t.id);if(i||Ka(e,l.get(t.id),o)&&Ka(n,c.get(t.id),o)){t.types.sort();const r=new Set(Qa(e,l.get(t.id)??qa,o,i)),a=new Set(Qa(n,c.get(t.id)??qa,o,i));d.push({element:t,outLinks:r,inLinks:a})}}return d}(await this.executeSparqlSelect(i,{signal:e}),await r,this.linkByPredicate,this.labelPredicate,this.openWorldLinks);if(this.options.prepareLabels){const t=o.map((t=>t.element));await us(t,this.options.prepareLabels,this.labelPredicate,e)}return o}createFilterQuery(t){if(!t.refElementId&&t.refElementLinkId)throw new Error("Cannot execute refElementLink filter without refElement");let e="?inst ?class ?label",n="?inst",r="",i="";t.refElementId&&(e+=" ?link ?direction",n+=" ?link ?direction",r=this.createRefQueryPart({elementId:t.refElementId,linkId:t.refElementLinkId,direction:t.linkDirection}),this.settings.linkConfigurations.length>0&&(e+=" ?classAll",i=this.settings.filterTypePattern.replace(/[?$]class\b/g,"?classAll")));let o="";if(t.elementTypeId){const e=vs(t.elementTypeId);o=this.settings.filterTypePattern.replace(/[?$]class\b/g,e)}const{defaultPrefix:a,dataLabelProperty:s,lookupQuery:l,filterOnlyLanguages:c,filterElementInfoPattern:u,fullTextSearch:d}=this.settings,h=ds(u,{dataLabelProperty:s,labelLanguageFilter:ps("?label",c)});let f="",p="";t.text&&(n+=" ?score",this.settings.fullTextSearch.extractLabel&&(f+='\n BIND ( str( ?inst ) as ?uriStr)\n BIND ( strafter(?uriStr, "#") as ?label3)\n BIND ( strafter(strafter(?uriStr, "//"), "/") as ?label6)\n BIND ( strafter(?label6, "/") as ?label5)\n BIND ( strafter(?label5, "/") as ?label4)\n BIND (if (?label3 != "", ?label3,\n if (?label4 != "", ?label4,\n if (?label5 != "", ?label5, ?label6))) as ?extractedLabel)\n '),f=ds(d.queryPattern,{text:t.text,dataLabelProperty:s}),f&&(p="ORDER BY DESC(?score)"));let g="";return"number"==typeof t.limit&&(g=`LIMIT ${t.limit}`),a+"\n"+d.prefix+"\n"+ds(l,{innerProjection:n,outerProjection:e,filterInnerPrelude:this.settings.filterInnerPrelude,filterByType:o,filterByRefElementLink:r,filterByText:f,filterAdditionalRestriction:this.settings.filterAdditionalRestriction,orderBy:p,limit:g,queryTypes:i,queryElementInfo:h})}executeSparqlSelect(t,e){const n=this.options.queryMethod??"GET",{signal:r}=e??{};return async function(t,e,n,r,i,o){let a;a=r("GET"===n?{url:hs(t,{query:e}),headers:{Accept:"application/sparql-results+json"},method:"GET",signal:o}:{url:t,body:e,headers:{Accept:"application/sparql-results+json","Content-Type":"application/sparql-query; charset=UTF-8"},method:"POST",signal:o});const s=await a;if(s.ok)return function(t,e){return{...t,results:{...t.results,bindings:t.results.bindings.map((function(t){const n={};for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)){const i=t[r];switch(i.type){case"uri":n[r]=e.namedNode(i.value);break;case"bnode":n[r]=e.blankNode(i.value);break;case"literal":case"typed-literal":n[r]=e.literal(i.value,i["xml:lang"]?i["xml:lang"]:i.datatype?e.namedNode(i.datatype):void 0);break;default:throw new Error(`Unexpected SPARQL term type: "${i.type}"`)}}return n}))}}}(await s.json(),i);{const t=new Error(s.statusText);throw t.response=s,t}}(this.options.endpointUrl,t,n,this.queryFunction,this.factory,r)}executeSparqlConstruct(t,e){const n=this.options.queryMethod??"GET",{signal:r}=e??{};return async function(t,e,n,r,i){let o;o=r("GET"===n?{url:hs(t,{query:e}),headers:{Accept:"text/turtle"},method:"GET",signal:i}:{url:t,body:e,headers:{Accept:"text/turtle","Content-Type":"application/sparql-query; charset=UTF-8"},method:"POST",signal:i});const a=await o;if(a.ok){const t=await a.text();return(new wi.Parser).parse(t)}{const t=new Error(a.statusText);throw t.response=a,t}}(this.options.endpointUrl,t,n,this.queryFunction,r)}createRefQueryPart(t){const{elementId:e,linkId:n,direction:r}=t,{unionParts:i,usePredicatePart:o}=this.formatLinkUnion(e,n,r,"?inst","?inst",!0);if(o){const e=vs(t.elementId);let o;if(n){const t=this.linkById.get(n);o=t&&Xa(t)?vs(t.path):vs(n)}const a=o||"?link",s=o?`BIND(${o} as ?link)`:"",l=this.acceptBlankNodes?"FILTER(isIri(?inst) || isBlank(?inst))":"FILTER(isIri(?inst))";r&&"out"!==r||i.push(`{ ${e} ${a} ?inst BIND("out" as ?direction) ${s} ${l} }`),r&&"in"!==r||i.push(`{ ?inst ${a} ${e} BIND("in" as ?direction) ${s} ${l} }`)}let a=0===i.length?"FILTER(false)":i.join("\nUNION\n");return!n&&this.settings.filterRefElementLinkPattern.length>0&&(a+=`\n${this.settings.filterRefElementLinkPattern}`),a}formatLinkUnion(t,e,n,r,i,o){const{linkConfigurations:a}=this.settings,s=vs(t),l=[];let c=!1;for(const t of a)if(!e||t.id===e)if(Xa(t))c=!0;else{const e=vs(t.id);if(!n||"out"===n){const n=this.formatLinkPath(t.path,s,r);l.push(`{ ${n} BIND(${e} as ?link) ${o?'BIND("out" as ?direction) ':""}}`)}if(!n||"in"===n){const n=this.formatLinkPath(t.path,i,s);l.push(`{ ${n} BIND(${e} as ?link) ${o?'BIND("in" as ?direction) ':""}}`)}}return{unionParts:l,usePredicatePart:this.openWorldLinks||c}}formatLinkLinks(){const t=[];let e=!1;for(const n of this.settings.linkConfigurations)if(Xa(n))e=!0;else{const e=vs(n.id);t.push(`${this.formatLinkPath(n.path,"?source","?target")} BIND(${e} as ?type)`)}return(this.openWorldLinks||e)&&t.push("?source ?type ?target"),0===t.length?"":1===t.length?t[0]:"{ "+t.join(" }\nUNION\n{ ")+" }"}formatLinkPath(t,e,n){return t.replace(/[?$]source\b/g,e).replace(/[?$]target\b/g,n)}formatPropertyInfo(){const t=[];let e=!1;for(const n of this.settings.propertyConfigurations)if(Ya(n))e=!0;else{const e=vs(n.id),r=this.formatPropertyPath(n.path,"?inst","?propValue");t.push(`{ ${r} BIND(${e} as ?propType) }`)}return(this.openWorldProperties||e)&&t.push("{ ?inst ?propType ?propValue }"),t.join("\nUNION\n")}formatPropertyPath(t,e,n){return t.replace(/[?$]inst\b/g,e).replace(/[?$]value\b/g,n)}async querySingleElementTypes(t,e){if(t)return(await this.queryManyElementTypes([t],e)).get(t)}async queryManyElementTypes(t,e){if(0===t.length)return new Map;const{filterTypePattern:n}=this.settings,r=new Map;return await this.queryChunked(t,(async t=>{const i=ds("SELECT ?inst ?class { VALUES(?inst) { ${ids} } ${filterTypePattern} }",{ids:t.map((t=>`(${vs(t)})`)).join(" "),filterTypePattern:n});!function(t,e){for(const n of t.results.bindings)Ba(n.inst)&&Ba(n.class)&&_i(e,n.inst.value,n.class.value)}(await this.executeSparqlSelect(i,{signal:e}),r)})),r}}function ls(t){return"totalLength"===t?t=>vs(t).length+3:()=>1}async function cs(t,e,n){const r=new Set(t.map((t=>t.id))),i=await e(r,n);for(const e of t){const t=i.get(e.id);t&&(e.label=t)}}async function us(t,e,n,r){const i=new Set(t.map((t=>t.id))),o=await e(i,r);for(const e of t){const t=o.get(e.id);t&&(e.properties[n]=t)}}function ds(t,e){let n=t;for(const t in e){if(!Object.prototype.hasOwnProperty.call(e,t))continue;const r=e[t]||"";n=n.replace(new RegExp("\\${"+t+"}","g"),r)}return n}function hs(t,e={}){const n=t.indexOf("?")<0?"?":"&";return t+(n+Object.keys(e).map((t=>`${t}=${encodeURIComponent(e[t])}`)).join("&"))}function fs(t){return fetch(t.url,{method:t.method,body:t.body,credentials:"same-origin",mode:"cors",cache:"default",headers:t.headers,signal:t.signal})}function ps(t,e){if(!e)return"";const n=[`FILTER(!isLiteral(${t}) || lang(${t}) = ""`];for(const r of e)n.push(` || lang(${t}) = "${r}"`);return n.push(")"),n.join("")}function gs(t){return Array.from(t,(t=>`(${vs(t)})`)).join(" ")}function vs(t){if("string"!=typeof t)throw new Error(`Cannot escape IRI of type "${typeof t}"`);return`<${t}>`}const ms=x.createContext(null);function bs(){const t=x.useContext(ms);if(!t)throw new Error("Reactodia: missing canvas context");return t}const ws=/Mac|iPhone|iPad/.test(window?.navigator?.platform||"");function ys(t){const{modifiers:e,key:n}=t;let r="";return 1&e&&(r+="Ctrl+"),2&e&&(r+=ws?"⌘+":"Meta+"),4&e&&(r+="Alt+"),8&e&&(r+="Shift+"),r+=1===n.length?n.toUpperCase():n,r}function _s(t,e){return t.modifiers===e.modifiers&&t.key===e.key}function ks(t){return j(V(function(t){if((0|t)===t)return t;{F[0]=t;const e=V(B[0],B[1]);return F[0]=0,e}}(t.modifiers),D(t.key)))}function xs(t,e){const{canvas:n}=bs(),r=x.useMemo((()=>{if(t){const e=function(t){const e=t.split("+");let n=0;for(let t=0;t<e.length-1;t++){const r=e[t];switch(r){case"Ctrl":n|=1;break;case"Meta":n|=2;break;case"Alt":n|=4;break;case"Shift":n|=8;break;case"Mod":n|=ws?2:1;break;case"None":break;default:throw new Error(`Unknown hotkey modifier "${r}"`)}}const r=e[e.length-1];if(!r)throw new Error("Missing main key for a hotkey");return{modifiers:n,key:1===r.length?r.toLowerCase():r}}(t);return{_ast:e,text:ys(e)}}}),[t]),i=x.useRef();return i.current=e,x.useEffect((()=>{if(r)return n.renderingState.listenHotkey(r._ast,(()=>{i.current?.()}))}),[r]),r}var Ss,Es,Cs,Ms,Ls,$s;function Ns(t,e,n){if("number"!=typeof e&&"number"!=typeof n)return{width:t.width,height:t.height};const r=t.width/t.height;return e="number"==typeof e?e:n*r,(n="number"==typeof n?n:e/r)*r<=e?{width:n*r,height:n}:{width:e,height:e/r}}function Ts(t,e){const{x:n,y:r}=t.position,i=e.getElementSize(t);return{x:n,y:r,width:i?i.width:0,height:i?i.height:0}}function As(t,e){return"ellipse"===t.type?function(t,e){const n=Cs.center(t),r=Ss.subtract(e,n),i=Ss.normalize(r),o={x:i.x*t.width*.5,y:i.y*t.height*.5};return Ss.length(r)>=Ss.length(o)?Ss.add(n,o):void 0}(t.bounds,e):function(t,e){if(0===t.width||0===t.height||e.x>t.x&&e.x<t.x+t.width&&e.y>t.y&&e.y<t.y+t.height)return;const n=t.width/2,r=t.height/2,i=t.x+n,o=t.y+r,a=Ss.normalize({x:e.x-i,y:e.y-o}),s={x:Math.abs(a.x),y:a.y};return Ss.cross2D({x:n,y:-r},s)>0&&Ss.cross2D({x:n,y:r},s)<0?{x:i+n*Math.sign(a.x),y:o+n*a.y/Math.abs(a.x)}:{x:i+r*a.x/Math.abs(a.y),y:o+r*Math.sign(a.y)}}(t.bounds,e)}function zs(t,e){if(t===e)return!0;if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++){const r=t[n],i=e[n];if(r.x!==i.x||r.y!==i.y)return!1}return!0}function Is(t,e,n){const r="type"in t?t:{type:"rect",bounds:t},i="type"in e?e:{type:"rect",bounds:e};let o,a;for(let t=0;t<n.length&&(o=As(r,n[t]),!o);t++);o||(o=As(r,Cs.center(i.bounds))??Cs.center(r.bounds));for(let t=n.length-1;t>=0&&(a=As(i,n[t]),!a);t--);return a||(a=As(i,Cs.center(r.bounds))??Cs.center(i.bounds)),[o,...n,a]}function Rs(t){let e;return t.reduce(((t,n)=>{const r=e?Ss.length({x:n.x-e.x,y:n.y-e.y}):0;return e=n,t+r}),0)}function Os(t,e){if(0===t.length)throw new Error("Cannot compute a point for an empty polyline");if(e<0)return t[0];let n=0;for(let r=1;r<t.length;r++){const i=t[r-1],o=t[r],a={x:o.x-i.x,y:o.y-i.y},s=Ss.length(a),l=n+s;if(e<l){const t=(e-n)/s;return{x:i.x+t*a.x,y:i.y+t*a.y}}n=l}return t[t.length-1]}(Es=Ss||(Ss={})).add=function(t,e){return{x:t.x+e.x,y:t.y+e.y}},Es.subtract=function(t,e){return{x:t.x-e.x,y:t.y-e.y}},Es.scale=function(t,e){return{x:t.x*e,y:t.y*e}},Es.equals=function(t,e){return t.x===e.x&&t.y===e.y},Es.length=function({x:t,y:e}){return Math.sqrt(t*t+e*e)},Es.normalize=function({x:t,y:e}){if(0===t&&0===e)return{x:t,y:e};const n=1/Math.sqrt(t*t+e*e);return{x:t*n,y:e*n}},Es.dot=function({x:t,y:e},{x:n,y:r}){return t*n+e*r},Es.cross2D=function({x:t,y:e},{x:n,y:r}){return t*r-e*n},(Ms=Cs||(Cs={})).equals=function(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height},Ms.center=function({x:t,y:e,width:n,height:r}){return{x:t+n/2,y:e+r/2}},Ms.intersects=function(t,e){return t.x<=e.x+e.width&&t.y<=e.y+e.height&&e.x<=t.x+t.width&&e.y<=t.y+t.height};class Ps{constructor(t){if(this.geometry=t,t.points.length<2)throw new Error("Spline must consists of at least two points")}static defaultType="smooth";static create(t){return new Ps(t)}toPath(){const{type:t,points:e,source:n,target:r}=this.geometry;if("smooth"===t&&e.length>=3){const t=.25,i=[`M${e[0].x} ${e[0].y}`];let o=Ss.normalize(Ss.subtract(n,e[0]));for(let n=1;n<e.length;n++){const a=e[n-1],s=e[n],l=e[n+1],c=Ss.normalize(l?Ss.subtract(a,l):Ss.subtract(s,r)),u=Ss.length(Ss.subtract(a,s)),d=Ss.subtract(a,Ss.scale(o,u*t)),h=Ss.add(s,Ss.scale(c,u*t));o=c,i.push(` C${d.x} ${d.y} ${h.x} ${h.y} ${s.x} ${s.y}`)}return i.join("")}return"M"+e.map((({x:t,y:e})=>`${t} ${e}`)).join(" L")}}function Vs(t,e,n){for(let r=t.length-1;r>=0;r--){const i=t[r],{x:o,y:a,width:s,height:l}=Ts(i,n);if((0!==s||0!==l)&&e.x>=o&&e.x<=o+s&&e.y>=a&&e.y<=a+l)return i}}function js(t,e,n){let r=1/0,i=1/0,o=-1/0,a=-1/0;for(const e of t){const{x:t,y:s}=e.position,l=n.getElementSize(e);r=Math.min(r,t),i=Math.min(i,s),o=Math.max(o,t+(l?l.width:0)),a=Math.max(a,s+(l?l.height:0))}for(const t of e){const e=t.vertices||[];for(const{x:t,y:n}of e)r=Math.min(r,t),i=Math.min(i,n),o=Math.max(o,t),a=Math.max(a,n)}return{x:Number.isFinite(r)?r:0,y:Number.isFinite(i)?i:0,width:Number.isFinite(r)&&Number.isFinite(o)?o-r:0,height:Number.isFinite(i)&&Number.isFinite(a)?a-i:0}}function Ds(t,e){if(0===t.length)return{x:0,y:0};let n=0,r=0;for(const i of t){const{x:t,y:o,width:a,height:s}=Ts(i,e);n+=t+a/2,r+=o+s/2}return{x:n/t.length,y:r/t.length}}($s=Ls||(Ls={})).create=function(t,e){return new Hs(t,e)},$s.effect=function(t,e){return new Bs(t,e)},$s.compound=function(t,e){return new Us(t,e)};class Hs{constructor(t,e){this.title=t,this.invoke=e}}class Bs{constructor(t,e){this.title=t,this.body=e,this.skip=new Fs(t,this)}skip;invoke(){const{body:t}=this;return t(),this.skip}}class Fs{constructor(t,e){this.title=t,this.effect=e}invoke(){return this.effect}}class Us{constructor(t,e){this.title=t,this.commands=e}invoke(){const t=[];for(const e of this.commands)t.push(e.invoke());return t.reverse(),new Us(this.title,t)}}class Ws{source=new Ea;events=this.source;_undoStack=[];_redoStack=[];batches=[];get undoStack(){return this._undoStack}get redoStack(){return this._redoStack}hasChanges(){return this._undoStack.length>0}reset(){this._undoStack.length=0,this._redoStack.length=0,this.source.trigger("historyChanged",{hasChanges:this.hasChanges()})}undo(){const t=this._undoStack.pop();if(t){const e=t.invoke();this._redoStack.push(e),this.source.trigger("historyChanged",{hasChanges:this.hasChanges()})}}redo(){const t=this._redoStack.pop();if(t){const e=t.invoke();this._undoStack.push(e),this.source.trigger("historyChanged",{hasChanges:this.hasChanges()})}}execute(t){const e=t.invoke();this.registerToUndo(e)}registerToUndo(t){const e=this.topBatch();e?e._inverses.push(t):(this._undoStack.push(t),this._redoStack.length=0,this.source.trigger("historyChanged",{hasChanges:this.hasChanges()}))}topBatch(){return 0===this.batches.length?void 0:this.batches[this.batches.length-1]}startBatch(t){const e={_title:t,_inverses:[],history:this,store:()=>{if(this.batches.includes(e))for(;this.batches.length>0;){const t=this.batches.pop();if(t!==e&&console.warn("Storing other unclosed batch on top",t),t._inverses.length>0){const n=[...t._inverses].reverse();this.registerToUndo(Ls.compound(e._title,n))}if(t===e)break}else console.warn("Failed to find batch to store (already stored or discarded?)",e)},discard:()=>{if(this.batches.includes(e))for(;this.batches.length>0;){const t=this.batches.pop();if(t!==e&&console.warn("Discarding other unclosed batch on top",t),t===e)break}else console.warn("Failed to find batch to store (already stored or discarded?)")}};return this.batches.push(e),e}}class qs{constructor(t,e){this.elementState=t,this.linkState=e}static _title=Pi.text("commands.restore_geometry.title");static capture(t){return qs.capturePartial(t.elements,t.links)}static capturePartial(t,e){return new qs(t.map((t=>({element:t,position:t.position,size:Gs(t)}))),e.map((t=>({link:t,vertices:t.vertices}))))}get title(){return qs._title}hasChanges(){return this.elementState.length>0||this.linkState.length>0}filterOutUnchanged(){return new qs(this.elementState.filter((({element:t,position:e,size:n})=>!(Ss.equals(t.position,e)&&Gs(t)===n))),this.linkState.filter((({link:t,vertices:e})=>!zs(t.vertices,e))))}invoke(){const t=qs.capturePartial(this.elementState.map((t=>t.element)),this.linkState.map((t=>t.link)));for(const{element:t,position:e,size:n}of[...this.elementState].reverse())t.setPosition(e),t.setElementState(t.elementState.set(za.ElementSize,n));for(const{link:t,vertices:e}of this.linkState)t.setVertices(e);return t}}function Gs(t){return t.elementState.get(za.ElementSize)}function Zs(t){const e=t.vertices;return Ls.create(Pi.text("commands.restore_link_vertices.title"),(()=>{const n=Zs(t);return t.setVertices(e),n}))}function Ks(t,e){return Ls.create(Pi.text("commands.set_element_state.title"),(()=>{const n=t.elementState;return t.setElementState(e),Ks(t,n)}))}function Qs(t,e){return Ls.create(Pi.text(e?"commands.expand_element.title":"commands.collapse_element.title"),(()=>(t.setExpanded(e),Qs(t,!e))))}function Xs(t,e){return Ls.create(Pi.text("commands.set_link_state.title"),(()=>{const n=t.linkState;return t.setLinkState(e),Xs(t,n)}))}function Ys(t,e,n){return Ls.create(Pi.text("commands.change_link_type_visibility.title"),(()=>{const r=t.getLinkVisibility(e);return t.setLinkVisibility(e,n),Ys(t,e,r)}))}function Js(t){const{elements:e,target:n,graph:r,sizeProvider:i,distance:o=300}=t;return Ls.create(Pi.text("commands.place_elements_around.title"),(()=>{const t=qs.capture(r),a=Ts(n,i),s=a.x+a.width/2,l=a.y+a.height/2;let c=0;const u=r.getElementLinks(n);if(u.length>0){const t=Ds(u.map((t=>{const e=r.sourceOf(t);return e!==n?e:r.targetOf(t)})),i),e={x:s-t.x,y:l-t.y};0===e.x&&0===e.y||(c=Math.atan2(e.y,e.x))}const d=Math.min(Math.PI/e.length,Math.PI/6),h=[...e],f=(t,e)=>{if(e){const{width:n,height:r}=Ts(e,i);e.setPosition({x:s+o*Math.cos(t)-n/2,y:l+o*Math.sin(t)-r/2})}};if(h.length%2==0)for(let t=d/2;h.length>0;t+=d)f(c-t,h.pop()),f(c+t,h.pop());else{f(c,h.pop());for(let t=d;h.length>0;t+=d)f(c-t,h.pop()),f(c+t,h.pop())}return t.filterOutUnchanged()}))}class tl{source=new Ea;events=this.source;id;_position;_elementState;constructor(t){const{id:e=tl.generateId(),position:n={x:0,y:0},expanded:r=!1,elementState:i=Aa.empty}=t;this.id=e,this._position=n,this._elementState=r?i.set(za.Expanded,r):i}static generateId(){return`urn:reactodia:e:${ja()}`}get position(){return this._position}setPosition(t){const e=this._position;e.x===t.x&&e.y===t.y||(this._position=t,this.source.trigger("changePosition",{source:this,previous:e}))}get isExpanded(){return Boolean(this._elementState.get(za.Expanded))}setExpanded(t){this.setElementState(this._elementState.set(za.Expanded,!!t||void 0))}get elementState(){return this._elementState}setElementState(t){const e=this._elementState;e!==t&&(this._elementState=t,this.source.trigger("changeElementState",{source:this,previous:e}))}focus(){this.source.trigger("requestedFocus",{source:this})}redraw(t){this.source.trigger("requestedRedraw",{source:this,level:t})}}class el extends tl{constructor(t){super(t)}}class nl{source=new Ea;events=this.source;id;_sourceId;_targetId;_vertices;_linkState;constructor(t){const{id:e=nl.generateId(),sourceId:n,targetId:r,vertices:i=[],linkState:o=Aa.empty}=t;this.id=e,this._sourceId=n,this._targetId=r,this._vertices=i,this._linkState=o}static generateId(){return`urn:reactodia:l:${ja()}`}get sourceId(){return this._sourceId}get targetId(){return this._targetId}get typeId(){return this.getTypeId()}get vertices(){return this._vertices}setVertices(t){const e=this._vertices;zs(this._vertices,t)||(this._vertices=t,this.source.trigger("changeVertices",{source:this,previous:e}))}get linkState(){return this._linkState}setLinkState(t){const e=this._linkState;e!==t&&(this._linkState=t,this.source.trigger("changeLinkState",{source:this,previous:e}))}redraw(){this.source.trigger("requestedRedraw",{source:this})}}class rl{constructor(t,e){this.link=t,this.vertexIndex=e}createAt(t){const e=[...this.link.vertices];e.splice(this.vertexIndex,0,t),this.link.setVertices(e)}moveTo(t){const e=[...this.link.vertices];e.splice(this.vertexIndex,1,t),this.link.setVertices(e)}remove(){const t=[...this.link.vertices];t.splice(this.vertexIndex,1),this.link.setVertices(t)}}function il(t){const{paperTransform:e,layerRef:n,style:r,children:i,...o}=t,{originX:a,originY:s,scale:l}=e;let c={position:"absolute",left:0,top:0,transform:`scale(${l},${l})translate(${a}px,${s}px)`};return r&&(c={...c,...r}),P.jsx("div",{ref:n,style:c,...o,children:i})}function ol(t){const{layerRef:e,paperTransform:n,style:r,children:i,...o}=t,{width:a,height:s,originX:l,originY:c,scale:u}=n,d=a*u,h=s*u;let f={position:"absolute",top:0,left:0};return r&&(f={...f,...r}),P.jsx("svg",{ref:e,width:d,height:h,style:f,role:"none",...o,children:P.jsx("g",{transform:`scale(${u},${u})translate(${l},${c})`,children:i})})}function al(t,e){return t.width===e.width&&t.height===e.height&&t.originX===e.originX&&t.originY===e.originY&&t.paddingX===e.paddingX&&t.paddingY===e.paddingY&&t.scale===e.scale}function sl(t,e){return{x:(t.x+e.originX)*e.scale,y:(t.y+e.originY)*e.scale}}function ll(t,e){return{x:t.x/e.scale-e.originX,y:t.y/e.scale-e.originY}}class cl{gap;constructor(t={}){const{gap:e=20}=t;this.gap=e}route(t,e){const n=new Map;for(const r of t.links){if(n.has(r.id))continue;const{sourceId:i,targetId:o}=r;i&&o&&(i===o?this.routeFeedbackSiblingLinks(i,t,e,n):this.routeNormalSiblingLinks(i,o,t,e,n))}return n}routeFeedbackSiblingLinks(t,e,n,r){const i=e.getElement(t),o=n.getElementShape(i),{x:a,y:s}=o.bounds,l=Cs.center(o.bounds);let c=0;for(const t of e.getElementLinks(i)){const{sourceId:n,targetId:i}=t;if(!r.has(t.id)&&"hidden"!==e.getLinkVisibility(t.typeId)&&n===i)if(0===t.vertices.length){const e=this.gap*(c+1);r.set(t.id,{linkId:t.id,vertices:[{x:a-e,y:s+e},{x:a-e,y:s-e},{x:a+e,y:s-e}]}),c++}else if(1===t.vertices.length){const[e]=t.vertices,n={x:e.x,y:e.y,width:0,height:0},[i]=Is(o,n,[]),a=Math.min(Math.max(this.gap,.75*Ss.length(Ss.subtract(e,i))),o.bounds.width,o.bounds.height),s=Ss.normalize(Ss.subtract(e,l)),c=Ss.add(e,Ss.scale(s,-a)),u={x:-s.y,y:s.x},d=[Ss.add(c,Ss.scale(u,a)),e,Ss.add(c,Ss.scale(u,-a))];r.set(t.id,{linkId:t.id,vertices:d})}}}routeNormalSiblingLinks(t,e,n,r,i){const o=n.getElement(t),a=n.getElement(e),s=Cs.center(Ts(o,r)),l=Cs.center(Ts(a,r)),c=(s.x+l.x)/2,u=(s.y+l.y)/2,d=Ss.normalize({x:l.x-s.x,y:l.y-s.y}),h=n.getElementLinks(o).filter((t=>!(t.sourceId!==e&&t.targetId!==e||i.has(t.id)||function(t){return t.vertices.length>0}(t)||"hidden"===n.getLinkVisibility(t.typeId))));if(h.length<=1)return;const f=h.length%2?0:1;h.forEach(((t,e)=>{const n=e+f,r=this.gap*Math.ceil(n/2)-(f?this.gap/2:0),o=n%2?{x:-d.y,y:d.x}:{x:d.y,y:-d.x};i.set(t.id,{linkId:t.id,vertices:[{x:c+o.x*r,y:u+o.y*r}],labelTextAnchor:this.getLabelAlignment(d,e,h.length)})}))}getLabelAlignment(t,e,n){const r=Math.atan2(t.y,t.x),i=Math.abs(r),o=r<0,a=r>0,s=n-2,l=n-1;if(!(i<1*Math.PI/8||i>7*Math.PI/8)){if(o&&e===l||a&&e===s)return"end";if(o&&e===s||a&&e===l)return"start"}return"middle"}}var ul=(t=>(t[t.Element=1]="Element",t[t.ElementSize=2]="ElementSize",t[t.LinkRoutes=3]="LinkRoutes",t[t.PaperArea=4]="PaperArea",t[t.Link=5]="Link",t[t.LinkLabel=6]="LinkLabel",t[t.Overlay=7]="Overlay",t))(ul||{});const dl=()=>{},hl=()=>{};class fl{listener=new Ca;source=new Ea;events=this.source;scheduledByLayer=new Map;layerUpdater=new Ma;model;resolveElementTemplate;resolveLinkTemplate;mappedTemplates=new WeakMap;linkRouter;decorationContainers=new WeakMap;elementSizes=new WeakMap;linkLabelContainer=document.createElement("div");linkLabelBounds=new WeakMap;cachedLinkTemplates=new WeakMap;linkMarkerIndex=new WeakMap;static nextLinkMarkerIndex=1;routings=new Map;hotkeyHandlers=new U(ks,_s);shared;constructor(t){this.model=t.model,this.shared=t.shared,this.resolveElementTemplate=t.elementTemplateResolver??dl,this.resolveLinkTemplate=t.linkTemplateResolver??hl,this.linkRouter=t.linkRouter??new cl,this.listener.listen(this.model.events,"changeCells",(()=>this.scheduleUpdateRoutings())),this.listener.listen(this.model.events,"linkEvent",(({data:t})=>{t.changeVertices&&this.scheduleUpdateRoutings()})),this.listener.listen(this.model.events,"elementEvent",(({data:t})=>{t.changePosition&&this.scheduleUpdateRoutings()})),this.listener.listen(this.model.events,"changeLinkVisibility",(()=>{this.scheduleUpdateRoutings()})),this.listener.listen(this.model.events,"discardGraph",(()=>{this.cachedLinkTemplates=new WeakMap;const t=this.routings;this.routings=new Map,this.cancelOnLayerUpdate(3,this.updateRoutings),this.source.trigger("changeLinkTemplates",{source:this}),this.source.trigger("changeRoutings",{source:this,previous:t})})),this.listener.listen(this.events,"changeElementSize",(()=>{this.scheduleUpdateRoutings()})),this.updateRoutings()}dispose(){this.listener.stopListening(),this.layerUpdater.dispose(),this.cancelOnLayerUpdate(3,this.updateRoutings)}syncUpdate(){this.syncUpdateLayersUpTo(7)}scheduleOnLayerUpdate(t,e){_i(this.scheduledByLayer,t,e),this.layerUpdater.call(this.runLayerUpdate)}cancelOnLayerUpdate(t,e){const n=this.scheduledByLayer.get(t);n&&n.delete(e)}runLayerUpdate=()=>this.syncUpdateLayersUpTo(7);updateLayersUpTo(t){return Promise.resolve().then((()=>this.syncUpdateLayersUpTo(t)))}syncUpdateLayersUpTo(t){this.layerUpdater.dispose();let e=!1;for(let n=t+1;n<=7;n++){const t=this.scheduledByLayer.get(n);t&&t.size>0&&(e=!0)}const n=new Set;for(let e=1;e<=t;e++){const t=this.scheduledByLayer.get(e);if(t&&t.size>0){for(const e of t)n.add(e);t.clear();for(const t of n)t();n.clear()}this.source.trigger("syncUpdate",{layer:e})}e&&this.layerUpdater.call(this.runLayerUpdate)}ensureDecorationContainer(t){let e=this.decorationContainers.get(t);return e||(e=document.createElement("div"),this.decorationContainers.set(t,e)),e}getElementSize(t){return this.elementSizes.get(t)}setElementSize(t,e){const n=this.elementSizes.get(t);n&&n.width===e.width&&n.height===e.height||(this.ensureDecorationContainer(t).style=`width: ${e.width}px; height: ${e.height}px`,this.elementSizes.set(t,e),this.source.trigger("changeElementSize",{source:t,previous:n}))}attachLinkLabelContainer(t){if(t){if(this.linkLabelContainer.parentElement)throw new Error("Cannot attach link label container to multiple parents");t.appendChild(this.linkLabelContainer)}else this.linkLabelContainer.parentElement&&this.linkLabelContainer.parentElement.removeChild(this.linkLabelContainer)}getLinkLabelContainer(){return this.linkLabelContainer}getLinkLabelBounds(t){return this.linkLabelBounds.get(t)}setLinkLabelBounds(t,e){const n=this.linkLabelBounds.get(t);!n&&!e||n&&e&&Cs.equals(n,e)||(e?this.linkLabelBounds.set(t,e):this.linkLabelBounds.delete(t),this.source.trigger("changeLinkLabelBounds",{source:t,previous:n}))}getElementTemplate(t){let e=this.resolveElementTemplate(t);if("function"==typeof e){let t=this.mappedTemplates.get(e);if(!t){const n=e;t={renderElement:t=>x.createElement(n,t)},this.mappedTemplates.set(e,t)}e=t}return e??this.shared.defaultElementResolver(t)}getElementShape(t){const e=this.getElementTemplate(t),n=Ts(t,this);return{type:e.shape??"rect",bounds:n}}ensureLinkMarkerIndex(t){let e=this.linkMarkerIndex.get(t);return void 0===e&&(e=fl.nextLinkMarkerIndex++,fl.nextLinkMarkerIndex>=Number.MAX_SAFE_INTEGER&&(fl.nextLinkMarkerIndex=1),this.linkMarkerIndex.set(t,e)),e}getLinkTemplate(t){const e=this.cachedLinkTemplates.get(t);if(e)return e;const n=this.resolveLinkTemplate(t)??this.shared.defaultLinkResolver(t);return this.cachedLinkTemplates.set(t,n),this.source.trigger("changeLinkTemplates",{source:this}),n}getRoutings(){return this.routings}getRouting(t){return this.routings.get(t)}scheduleUpdateRoutings(){this.scheduleOnLayerUpdate(3,this.updateRoutings)}updateRoutings=()=>{const t=this.routings,e=this.linkRouter.route(this.model,this);t.forEach(((t,n)=>{const r=e.get(n);var i,o;r&&(i=t).linkId===(o=r).linkId&&i.labelTextAnchor===o.labelTextAnchor&&zs(i.vertices,o.vertices)&&e.set(n,t)})),this.routings=e,this.source.trigger("changeRoutings",{source:this,previous:t})};listenHotkey(t,e){return _i(this.hotkeyHandlers,t,e),2===this.hotkeyHandlers.get(t).size&&console.warn(`Reactodia: registered multiple handlers for the same hotkey "${ys(t)}" but only the first one will run if triggered.`),()=>{!function(t,e,n){const r=t.get(e);r&&(r.delete(n),0===r.size&&t.delete(e))}(this.hotkeyHandlers,t,e)}}triggerHotkey(t){if(t.repeat)return;const e=function(t){const e=1===t.key.length?t.key.toLowerCase():t.key,n=/^[a-z]$/.test(e),r=/^Key([A-Z])$/.exec(t.code),i=r?r[1].toLowerCase():void 0;return{modifiers:(t.ctrlKey?1:0)|(t.metaKey?2:0)|(t.altKey?4:0)|(t.shiftKey?8:0),key:i&&!n?i:e}}(t),n=this.hotkeyHandlers.get(e);if(n)for(const e of n){t.preventDefault(),e();break}}}function pl(t,e,n=7){return x.useCallback((r=>{const i=()=>r(),o=t((()=>{e.scheduleOnLayerUpdate(n,i)}));return()=>{e.cancelOnLayerUpdate(n,i),o()}}),[t,e,n])}class gl extends x.Component{listener=new Ca;redrawBatch={requests:new Map,forAll:0};memoizedElements=new WeakMap;sizeRequests=new Map;constructor(t){super(t);const{model:e,renderingState:n}=this.props;this.state={version:0,elementStates:vl(e,n.shared,this.redrawBatch,new Map)}}render(){const{model:t,renderingState:e,paperTransform:n,layerRef:r}=this.props,{version:i,elementStates:o}=this.state,{memoizedElements:a}=this,s=[];for(const e of t.elements){const t=o.get(e);t&&s.push(t)}return P.jsx(il,{layerRef:r,className:"reactodia-element-layer",paperTransform:n,role:"figure",children:s.map((n=>{let r=a.get(n);return r||(r=P.jsx(wl,{state:n,model:t,renderingState:e,onResize:this.requestSizeUpdate},n.element.id),a.set(n,r)),r}))},i)}componentDidMount(){const{model:t,renderingState:e}=this.props;this.listener.listen(t.events,"changeCells",(t=>{t.updateAll?this.requestRedrawAll(1):t.changedElement&&this.requestRedraw(t.changedElement,1)})),this.listener.listen(t.events,"changeCellOrder",(()=>{this.requestRedrawAll(0)})),this.listener.listen(t.events,"changeSelection",(({previous:e})=>{const n=1===e.length?e[0]:void 0,r=1===t.selection.length?t.selection[0]:void 0,i=n instanceof tl?n:void 0,o=r instanceof tl?r:void 0;o!==i&&(i&&this.requestRedraw(i,6),o&&this.requestRedraw(o,6))})),this.listener.listen(t.events,"elementEvent",(({data:t})=>{const e=t.changeElementState;e&&this.requestRedraw(e.source,6);const n=t.changePosition;if(n&&this.requestRedraw(n.source,2),t.requestedRedraw){let e=2;"template"===t.requestedRedraw.level&&(e=6),this.requestRedraw(t.requestedRedraw.source,e)}})),this.listener.listen(t.events,"changeLanguage",(()=>{this.requestRedrawAll(6)})),this.listener.listen(t.events,"discardGraph",(()=>{this.requestRedrawAll(31)})),this.listener.listen(e.shared.events,"changeHighlight",(()=>{this.requestRedrawAll(10)}))}componentWillUnmount(){this.listener.stopListening(),this.props.renderingState.cancelOnLayerUpdate(ul.Element,this.redrawElements),this.props.renderingState.cancelOnLayerUpdate(ul.ElementSize,this.recomputeQueuedSizes)}requestRedraw=(t,e)=>{if((this.redrawBatch.forAll|e)===this.redrawBatch.forAll)return;const n=this.redrawBatch.requests.get(t.id)||0;this.redrawBatch.requests.set(t.id,n|e),this.props.renderingState.scheduleOnLayerUpdate(ul.Element,this.redrawElements)};requestRedrawAll(t){this.redrawBatch.forAll|=t,this.props.renderingState.scheduleOnLayerUpdate(ul.Element,this.redrawElements)}redrawElements=()=>{const t=this.redrawBatch;this.redrawBatch={forAll:0,requests:new Map},co.flushSync((()=>{this.setState(((e,n)=>({version:31===t.forAll?e.version+1:e.version,elementStates:vl(n.model,n.renderingState.shared,t,e.elementStates)})))}))};requestSizeUpdate=(t,e)=>{this.sizeRequests.set(t.id,{element:t,node:e}),this.props.renderingState.scheduleOnLayerUpdate(ul.ElementSize,this.recomputeQueuedSizes)};recomputeQueuedSizes=()=>{const{renderingState:t}=this.props,e=this.sizeRequests;this.sizeRequests=new Map;for(const t of e.values()){const{clientWidth:e,clientHeight:n}=t.node;t.computedSize={width:e,height:n}}for(const n of e.values())n.computedSize&&t.setElementSize(n.element,n.computedSize)}}function vl(t,e,n,r){if(0===n.forAll&&0===n.requests.size)return r;const i=1===t.selection.length?t.selection[0]:void 0,o=i instanceof tl?i:void 0,a=new Map;for(const i of t.elements){const t=i.id;let s=r.get(i);if(s){const r=(n.requests.get(t)||0)|n.forAll;2&r&&(s={element:i,templateProps:6&~r?s.templateProps:ml(s.element,o),blurred:10&~r?s.blurred:_l(s.element,e)}),a.set(i,s),n.requests.delete(t)}else a.set(i,{element:i,templateProps:ml(i,o),blurred:_l(i,e)})}return n.forAll=0,a}function ml(t,e){return{elementId:t.id,element:t,isExpanded:t.isExpanded,elementState:t.elementState,onlySelected:t===e}}const bl="reactodia-overlaid-element";class wl extends x.Component{elementRef=x.createRef();decorationsRef=x.createRef();listener=new Ca;render(){const{state:{element:t,blurred:e,templateProps:n}}=this.props;if(t instanceof el)return P.jsx("div",{});const{x:r,y:i}=t.position,o={position:"absolute",transform:`translate(${r}px,${i}px)`};return P.jsxs(P.Fragment,{children:[P.jsx("div",{className:lo(bl,e?`${bl}--blurred`:void 0,n.onlySelected?`${bl}--only-selected`:void 0),style:o,"data-element-id":t.id,tabIndex:0,ref:this.elementRef,onLoad:this.onLoadOrErrorEvent,onError:this.onLoadOrErrorEvent,children:P.jsx(yl,{...this.props})}),P.jsx("div",{className:"reactodia-element-decorations",style:o,ref:this.decorationsRef})]})}onLoadOrErrorEvent=()=>{const{state:t,onResize:e}=this.props;this.elementRef.current&&e(t.element,this.elementRef.current)};componentDidMount(){const{state:t,onResize:e,renderingState:n}=this.props;this.decorationsRef.current&&this.decorationsRef.current.appendChild(n.ensureDecorationContainer(t.element)),this.listener.listen(t.element.events,"requestedFocus",(()=>{this.elementRef.current?.focus()})),this.elementRef.current&&e(t.element,this.elementRef.current)}componentWillUnmount(){const{state:t,renderingState:e}=this.props,n=e.ensureDecorationContainer(t.element);n.parentElement?.removeChild(n),this.listener.stopListening()}shouldComponentUpdate(t){return this.props.state!==t.state}componentDidUpdate(){const{state:t,onResize:e}=this.props;this.elementRef.current&&e(t.element,this.elementRef.current)}}class yl extends x.Component{cachedTemplate;cachedTemplateProps;render(){const{state:t,renderingState:e}=this.props,{element:n,templateProps:r}=t,i=e.getElementTemplate(n);return this.cachedTemplate=i,this.cachedTemplateProps=r,i.renderElement(r)}shouldComponentUpdate(t){const e=t.renderingState.getElementTemplate(t.state.element);return!(this.cachedTemplate===e&&this.cachedTemplateProps===t.state.templateProps)}}function _l(t,e){return Boolean(e.highlighter&&!e.highlighter(t))}function kl(t){const{target:e,children:n}=t,{canvas:r}=bs();return co.createPortal(n,r.renderingState.ensureDecorationContainer(e))}function xl(t,e){const{positions:n,sizes:r,nestedLayouts:i}=t,o=new Sl(r),a=e.elements.filter((({id:t})=>n.has(t)));for(const t of i)xl(t,e);const s=Ds(a,o);for(const t of a){const e=n.get(t.id);e&&t.setPosition(e)}const l=Ds(a,o),c=s.x-l.x,u=s.y-l.y;for(const[t,r]of n)e.getElement(t).setPosition({x:r.x+c,y:r.y+u})}class Sl{constructor(t){this.sizes=t}getElementSize(t){return this.sizes.get(t.id)}getElementShape(t){return{type:"rect",bounds:Ts(t,this)}}}class El extends x.Component{listener=new Ca;providedContext;updateState=1;scheduledToUpdate=new Set;labelMeasureRequests=new Set;memoizedLinks=new WeakMap;constructor(t){super(t),this.providedContext={scheduleLabelMeasure:this.scheduleLabelMeasure,clearLabelMeasure:this.clearLabelMeasure},this.state={version:0,shouldUpdateLink:this.popShouldUpdatePredicate()}}componentDidMount(){const{model:t,renderingState:e}=this.props,n=e=>{for(const n of t.getElementLinks(e))this.scheduleUpdateLink(n.id)};this.listener.listen(t.events,"changeLanguage",this.scheduleUpdateAll),this.listener.listen(t.events,"changeCells",(t=>{if(t.updateAll)this.scheduleUpdateAll();else if(t.changedElement&&n(t.changedElement),t.changedLinks)for(const e of t.changedLinks)this.scheduleUpdateLink(e.id)})),this.listener.listen(t.events,"changeSelection",(({previous:e})=>{const n=1===e.length?e[0]:void 0,r=1===t.selection.length?t.selection[0]:void 0,i=n instanceof nl?n:void 0,o=r instanceof nl?r:void 0;o!==i&&(i&&this.scheduleUpdateLink(i.id),o&&this.scheduleUpdateLink(o.id))})),this.listener.listen(t.events,"elementEvent",(({data:t})=>{t.changePosition&&n(t.changePosition.source)})),this.listener.listen(t.events,"linkEvent",(({data:t})=>{const e=t.changeVertices||t.changeLinkState||t.requestedRedraw;e&&this.scheduleUpdateLink(e.source.id)})),this.listener.listen(t.events,"changeLinkVisibility",(e=>{for(const n of t.links.filter((t=>t.typeId===e.source)))this.scheduleUpdateLink(n.id)})),this.listener.listen(t.events,"discardGraph",(()=>{this.setState((t=>({version:t.version+1}))),this.scheduleUpdateAll()})),this.listener.listen(e.shared.events,"changeHighlight",this.scheduleUpdateAll),this.listener.listen(e.events,"changeElementSize",(t=>{n(t.source)}));const r=(t,e)=>{t.forEach(((t,n)=>{e.get(n)!==t&&this.scheduleUpdateLink(n)}))};this.listener.listen(e.events,"changeRoutings",(({previous:t})=>{const n=e.getRoutings();r(n,t),r(t,n)}))}shouldComponentUpdate(t,e){return!(this.props.shouldRenderLink===t.shouldRenderLink&&this.state.version===e.version&&this.state.shouldUpdateLink===e.shouldUpdateLink)}componentWillUnmount(){this.listener.stopListening(),this.props.renderingState.cancelOnLayerUpdate(ul.Link,this.performUpdate),this.props.renderingState.cancelOnLayerUpdate(ul.LinkLabel,this.measureLabels)}scheduleUpdateAll=()=>{2!==this.updateState&&(this.updateState=2,this.scheduledToUpdate=new Set),this.props.renderingState.scheduleOnLayerUpdate(ul.Link,this.performUpdate)};scheduleUpdateLink(t){1===this.updateState&&this.scheduledToUpdate.add(t),this.props.renderingState.scheduleOnLayerUpdate(ul.Link,this.performUpdate)}popShouldUpdatePredicate(){const{updateState:t,scheduledToUpdate:e}=this;return this.scheduledToUpdate=new Set,this.updateState=1,2===t?()=>!0:t=>e.has(t.id)}scheduleLabelMeasure=t=>{this.labelMeasureRequests.add(t),this.props.renderingState.scheduleOnLayerUpdate(ul.LinkLabel,this.measureLabels)};clearLabelMeasure=t=>{const{renderingState:e}=this.props;this.labelMeasureRequests.delete(t),e.setLinkLabelBounds(t.owner,void 0)};measureLabels=()=>{const{renderingState:t}=this.props,e=Array.from(this.labelMeasureRequests);this.labelMeasureRequests.clear();const n=[];for(const t of e)n.push(t.measureBounds());for(let r=0;r<e.length;r++){const i=n[r];i&&t.setLinkLabelBounds(e[r].owner,i)}};performUpdate=()=>{co.flushSync((()=>{this.setState({shouldUpdateLink:this.popShouldUpdatePredicate()})}))};render(){const{model:t,shouldRenderLink:e,renderingState:n}=this.props,{version:r,shouldUpdateLink:i}=this.state,{memoizedLinks:o}=this;for(const e of t.links)i(e)&&o.delete(e);const a=[];for(const r of t.links)if(!e||e(r)){let e=o.get(r);e||(e=P.jsx(Ll,{link:r,model:t,renderingState:n},r.id),o.set(r,e)),a.push(e)}return P.jsx(Cl.Provider,{value:this.providedContext,children:P.jsx("g",{className:"reactodia-link-layer",children:a},r)})}}const Cl=x.createContext(null),Ml="reactodia-link";function Ll(t){const{link:e,model:n,renderingState:r}=t,i=r.getLinkTemplate(e),o=r.shared.defaultLinkResolver(e),a=n.getElement(e.sourceId),s=n.getElement(e.targetId),l=n.getLinkVisibility(e.typeId);if(!a||!s||"hidden"===l)return null;const c=r.getRouting(e.id),u=c?c.vertices:e.vertices,d=r.getElementShape(a),h=r.getElementShape(s),f=Is(d,h,u),p=Ps.create({type:i.spline??Ps.defaultType,points:f,source:Cs.center(d.bounds),target:Cs.center(h.bounds)}),g=Rs(f),v=i.markerSource??o.markerSource,m=i.markerTarget??o.markerTarget,b=v?r.ensureLinkMarkerIndex(v):void 0,w=m?r.ensureLinkMarkerIndex(m):void 0,{highlighter:y}=r.shared,_=y&&!y(e),k=1===n.selection.length&&n.selection[0]===e,x=i.renderLink({link:e,markerSource:b?`url(#${jl(b,!0)})`:"",markerTarget:w?`url(#${jl(w,!1)})`:"",path:p.toPath(),getPathPosition:t=>Os(f,g*t),route:c,onlySelected:k});return P.jsx("g",{"data-link-id":e.id,"data-source-id":e.sourceId,"data-target-id":e.targetId,className:lo(Ml,_?`${Ml}--blurred`:void 0,k?`${Ml}--only-selected`:void 0),children:x})}const $l="reactodia-link-path";function Nl(t){const{path:e,pathProps:n,markerSource:r,markerTarget:i}=t;return P.jsxs(P.Fragment,{children:[P.jsx("path",{...n,className:lo($l,n?.className),d:e,markerStart:r,markerEnd:i}),P.jsx("path",{className:`${$l}__wrap`,d:e})]})}function Tl(t){const{renderingState:e,paperTransform:n,layerRef:r}=t,i=x.useRef(null),o=x.useCallback((t=>{i.current=t,r&&(r.current=t)}),[r]);return x.useEffect((()=>{const t=i.current;if(t)return e.attachLinkLabelContainer(t),()=>e.attachLinkLabelContainer(null)}),[]),P.jsx(il,{paperTransform:n,className:"reactodia-label-layer",layerRef:o,role:"figure"})}const Al="middle";function zl(t){const{link:e,position:{x:n,y:r},line:i,className:o,style:a,textAnchor:s,title:l,children:c}=t,{canvas:u}=bs(),d=x.useContext(Cl),h=x.useRef(null),f=x.useRef(void 0);x.useLayoutEffect((()=>{if(d&&t.primary){if(!f.current){const n={owner:e,measureBounds:()=>{const t=h.current?.getBoundingClientRect();if(!t)return;const e=1/u.getScale();return function(t,{width:e,height:n}){const{position:{x:r,y:i},textAnchor:o=Al}=t;let a=0;return"middle"===o?a=-e/2:"end"===o&&(a=-e),{x:r+a,y:i-n/2,width:e,height:n}}(n.latestProps,{width:t.width*e,height:t.height*e})},latestProps:t};f.current=n}f.current.latestProps=t,d.scheduleLabelMeasure(f.current)}})),x.useLayoutEffect((()=>()=>{const t=f.current;d&&t&&d.clearLabelMeasure(t)}),[]);const p={...a,position:"absolute",transform:`translate(${n}px,${r}px)${"start"===s?"translate(0,-50%)":"end"===s?"translate(-100%,-50%)":"translate(-50%,-50%)"}`,"--reactodia-link-label-line":i},g=u.renderingState;return co.createPortal(P.jsx("div",{ref:h,"data-link-id":e.id,className:lo("reactodia-link-label",o),style:p,title:l,children:c}),g.getLinkLabelContainer())}const Il="reactodia-link-vertices";function Rl(t){const{linkId:e,vertices:n,className:r,vertexRadius:i=10,fill:o}=t,{model:a}=bs();if(0===n.length)return null;const s=lo(`${Il}__vertex`,r),l=t=>{const n=a.getLink(e);if(!n)return;const r=new rl(n,t);a.history.registerToUndo(Zs(r.link)),r.remove()},c=[];for(let t=0;t<n.length;t++){const{x:e,y:r}=n[t],a=c.length;c.push(P.jsx("circle",{"data-vertex":t,className:s,cx:e,cy:r,r:i,fill:o},a)),c.push(P.jsx(Ol,{vertexIndex:t,vertexRadius:i,x:e,y:r,onRemove:l},a+1))}return P.jsx("g",{className:Il,children:c})}class Ol extends x.Component{render(){const{vertexRadius:t,x:e,y:n}=this.props;return P.jsxs("g",{className:`${Il}__handle`,"data-reactodia-no-export":"true",transform:`translate(${e+2*t},${n-2*t})scale(${t})`,onPointerDown:this.onRemoveVertex,children:[P.jsx("title",{children:"Remove vertex"}),P.jsx("circle",{r:1}),P.jsx("path",{d:"M-0.5,-0.5 L0.5,0.5 M0.5,-0.5 L-0.5,0.5",strokeWidth:2/t})]})}onRemoveVertex=t=>{if(0!==t.button)return;t.preventDefault(),t.stopPropagation();const{onRemove:e,vertexIndex:n}=this.props;e(n)}}const Pl=x.memo((function(t){const{model:e,renderingState:n}=t;Ai(pl(Ti(n.events,"changeLinkTemplates"),n,ul.Link),(()=>e.cellsVersion));const r=new Set,i=new Set;for(const t of e.links){const e=n.getLinkTemplate(t),o=n.shared.defaultLinkResolver(t),a=e.markerSource??o.markerSource;a&&r.add(a);const s=e.markerTarget??o.markerTarget;s&&i.add(s)}return P.jsxs("defs",{children:[Array.from(r,(t=>{const e=n.ensureLinkMarkerIndex(t);return P.jsx(Vl,{markerIndex:e,isStartMarker:!0,style:t},e)})),Array.from(i,(t=>{const e=n.ensureLinkMarkerIndex(t);return P.jsx(Vl,{markerIndex:e,isStartMarker:!1,style:t},e)}))]})}),(()=>!0));class Vl extends x.Component{render(){return P.jsx("marker",{ref:this.onMarkerMount})}shouldComponentUpdate(){return!1}onMarkerMount=t=>{if(!t)return;const{markerIndex:e,isStartMarker:n,style:r}=this.props,{d:i,width:o,height:a}=r;if(void 0===i||void 0===o||void 0===a)return;const s="reactodia-link-marker";t.setAttribute("class",s),t.setAttribute("id",jl(e,n)),t.setAttribute("markerWidth",String(o)),t.setAttribute("markerHeight",String(a)),t.setAttribute("orient","auto"),t.setAttribute("refX",String(n?0:o-1)),t.setAttribute("refY",String(a/2)),t.setAttribute("markerUnits","userSpaceOnUse");const l=document.createElementNS("http://www.w3.org/2000/svg","path");l.setAttribute("class",`${s}__path`),l.setAttribute("d",i),void 0!==r.fill&&l.setAttribute("fill",r.fill),void 0!==r.stroke&&l.setAttribute("stroke",r.stroke),void 0!==r.strokeWidth&&l.setAttribute("stroke-width",String(r.strokeWidth)),t.appendChild(l)}}function jl(t,e){return`reactodia-marker-${e?"start":"end"}-${t}`}const Dl=x.createContext(null);function Hl(t){const{context:e,layer:n,...r}=t,i=x.useRef(null),o=e.containers[n];return x.useLayoutEffect((()=>{const t=i.current;if(t)return t.appendChild(o),()=>{t.removeChild(o)}}),[i,o]),P.jsx("div",{...r,ref:i,"data-reactodia-place-layer":n})}function Bl(t){const{layer:e,children:n}=t,r=x.useContext(Dl);if(!r)throw new Error("Reactodia: <CanvasPlaceAt> should be rendered only inside <Canvas>");if("nested"===r)throw new Error("Reactodia: <CanvasPlaceAt> cannot be nested into another <CanvasPlaceAt>");const i=x.useMemo((()=>P.jsx(Dl.Provider,{value:"nested",children:n})),[n]);return co.createPortal(i,r.containers[e])}class Fl{listener=new Ca;source=new Ea;events=this.source;disposed=!1;dropOnPaperHandler;_highlighter;defaultElementResolver;defaultLinkResolver;defaultLayout;renameLinkProvider;constructor(t){const{defaultElementResolver:e,defaultLinkResolver:n,defaultLayout:r,renameLinkProvider:i}=t;this.defaultElementResolver=e,this.defaultLinkResolver=n,this.defaultLayout=r,this.renameLinkProvider=i}dispose(){this.disposed||(this.source.trigger("dispose",{source:this}),this.listener.stopListening(),this.disposed=!0)}findAllCanvases(){const t={canvases:[]};return this.source.trigger("findCanvas",t),t.canvases}findAnyCanvas(){const t=this.findAllCanvases();return t.length>0?t[0]:void 0}setHandlerForNextDropOnPaper(t){this.dropOnPaperHandler=t}hasHandlerForNextDropOnPaper(){return Boolean(this.dropOnPaperHandler)}tryHandleDropOnPaper(t){const{dropOnPaperHandler:e}=this;return!!e&&(this.dropOnPaperHandler=void 0,t.sourceEvent.preventDefault(),e(t),!0)}get highlighter(){return this._highlighter}setHighlighter(t){const e=this._highlighter;e!==t&&(this._highlighter=t,this.source.trigger("changeHighlight",{source:this,previous:e}))}}class Ul{canRename(t){return!0}getLabel(t){const{linkState:e}=t,n=e.get(za.CustomLabel);return"string"==typeof n?n:void 0}setLabel(t,e){t.setLinkState(t.linkState.set(za.CustomLabel,0===e.length?void 0:e))}}class Wl extends tl{static fromJSONType="Annotation";static fromJSON(t,e){const{"@id":n,position:r,elementState:i}=t;return new Wl({id:n,position:r,elementState:e.mapTemplateState(Aa.fromJSON(i))})}toJSON(){return{"@type":"Annotation","@id":this.id,position:this.position,elementState:this.elementState.toJSON()}}}class ql extends nl{static typeId="urn:reactodia:annotates";getTypeId(){return ql.typeId}static fromJSONType="AnnotationLink";static fromJSON(t,e){const{"@id":n,vertices:r,linkState:i}=t;return new ql({id:n,sourceId:e.source.id,targetId:e.target.id,vertices:r,linkState:e.mapTemplateState(Aa.fromJSON(i)).set(za.LayoutOnly,void 0)})}toJSON(){return{"@type":"AnnotationLink","@id":this.id,source:{"@id":this.sourceId},target:{"@id":this.targetId},vertices:this.vertices,linkState:this.linkState.toJSON()}}}var Gl,Zl,Kl;function Ql(t,e){return t.sourceId===e||t.targetId===e}(t=>{function e(t){return{elements:new Map(t.elements),links:t.links.clone()}}function n(t){switch(t.type){case"entityAdd":case"entityChange":case"entityDelete":return!0;default:return!1}}function r(t,e){return n(e)?t.elements.get(e.data.id)===e:t.links.get(e.data)===e}function i(t,e){const n=t.elements.get(e);return Boolean(n&&"entityAdd"===n.type)}function o(t,e){const n=t.elements.get(e);return Boolean(n&&"entityDelete"===n.type)}function a(t,e){const n=t.links.get(e);return Boolean(n&&"relationAdd"===n.type)}t.empty={elements:new Map,links:new U(Gi,qi)},t.isEmpty=function(t){return 0===t.elements.size&&0===t.links.size},t.clone=e,t.isEntityEvent=n,t.isLinkEvent=function(t){return!n(t)},t.has=r,t.discard=function(t,i){if(!r(t,i))return t;const o=e(t);if(n(i)){if(o.elements.delete(i.data.id),"entityAdd"===i.type)for(const{data:e}of t.links.values())Ql(e,i.data.id)&&o.links.delete(e)}else o.links.delete(i.data);return o},t.addEntity=function(t,n){const r=e(t);return r.elements.set(n.id,{type:"entityAdd",data:n}),r},t.addRelation=function(t,n){const r=e(t);return r.links.set(n,{type:"relationAdd",data:n}),r},t.changeEntity=function(t,n,r){const i=e(t);i.elements.delete(n.id);const o=t.elements.get(n.id);if(o&&"entityChange"!==o.type&&"entityDelete"!==o.type){if(i.elements.set(r.id,{type:"entityAdd",data:r}),n.id!==r.id)for(const e of t.links.values())if("relationChange"!==e.type&&Ql(e.data,n.id)){const t=(a=e.data,s=n.id,l=r.id,{...a,sourceId:a.sourceId===s?l:a.sourceId,targetId:a.targetId===s?l:a.targetId});i.links.delete(e.data),i.links.set(t,{type:"relationAdd",data:t})}}else{const t=r.id!==n.id;i.elements.set(n.id,{type:"entityChange",before:o&&"entityChange"===o.type?o.before:n,data:t?{...r,id:n.id}:r,newIri:t?r.id:void 0})}var a,s,l;return i},t.changeRelation=function(t,n,r){if(!qi(n,r))throw new Error("Cannot move link to another element or change its type");const i=e(t),o=t.links.get(n);return i.links.set(n,"relationAdd"===o?.type?{type:"relationAdd",data:r}:{type:"relationChange",before:o&&"relationChange"===o.type?o.before:n,data:r}),i},t.deleteEntity=function(t,n){const r=e(t);r.elements.delete(n.id);for(const{data:e}of t.links.values())Ql(e,n.id)&&r.links.delete(e);return i(t,n.id)||r.elements.set(n.id,{type:"entityDelete",data:n}),r},t.deleteRelation=function(t,n){const r=e(t);return r.links.delete(n),a(t,n)||r.links.set(n,{type:"relationDelete",data:n}),r},t.discardAddedRelations=function(t,n){const r=e(t);for(const e of t.links.values())if("relationAdd"===e.type){const t=e.data;(n.has(t.sourceId)||n.has(t.targetId))&&r.links.delete(t)}return r},t.isAddedEntity=i,t.isDeletedEntity=o,t.hasEntityChangedIri=function(t,e){const n=t.elements.get(e);return Boolean(n&&"entityChange"===n.type&&n.newIri)},t.isAddedRelation=a,t.isDeletedRelation=function(t,e){const n=t.links.get(e);return n&&"relationDelete"===n.type||o(t,e.sourceId)||o(t,e.targetId)}})(Gl||(Gl={})),(Kl=Zl||(Zl={})).empty={elements:new Set,links:new W(Gi,qi)},Kl.addEntity=function(t,e){if(t.elements.has(e.id))return t;const n=new Set(t.elements);return n.add(e.id),{...t,elements:n}},Kl.removeEntity=function(t,e){if(!t.elements.has(e.id))return t;const n=new Set(t.elements);return n.delete(e.id),{...t,elements:n}},Kl.addRelation=function(t,e){if(t.links.has(e))return t;const n=t.links.clone();return n.add(e),{...t,links:n}},Kl.removeRelation=function(t,e){if(!t.links.has(e))return t;const n=t.links.clone();return n.delete(e),{...t,links:n}};const Xl="reactodia:connectionsMenu";class Yl{source=new Ea;events=this.source;cellsVersion=Math.floor(Math.random()*Number.MAX_SAFE_INTEGER/2);elements=new xi;links=new xi;elementLinks=new WeakMap;EMPTY_LINKS=[];linkTypeVisibility=new Map;getCellsVersion(){return this.cellsVersion}getElements(){return this.elements.items}getLinks(){return this.links.items}getLink(t){return this.links.get(t)}getElementLinks(t){return this.elementLinks.get(t)??[]}*iterateLinks(t,e,n){const r=this.getElement(t),i=this.getElement(e);if(!r||!i)return;const o=this.elementLinks.get(r)??this.EMPTY_LINKS,a=this.elementLinks.get(i)??this.EMPTY_LINKS,s=o.length<=a.length?o:a;for(const r of s)r.sourceId!==t||r.targetId!==e||n&&r.typeId!==n||(yield r)}sourceOf(t){return this.getElement(t.sourceId)}targetOf(t){return this.getElement(t.targetId)}reorderElements(t){this.elements.reorder(t),this.incrementCellsVersion()}getElement(t){return this.elements.get(t)}addElement(t){if(this.getElement(t.id))throw new Error(`Element '${t.id}' already exists.`);t.events.onAny(this.onElementEvent),this.elements.push(t.id,t),this.incrementCellsVersion(),this.source.trigger("changeCells",{updateAll:!1,changedElement:t})}onElementEvent=t=>{this.source.trigger("elementEvent",{data:t})};removeElement(t){const e=this.elements.get(t);if(e){const n={silent:!0},r=[...this.getElementLinks(e)];for(const t of r)this.removeLink(t.id,n);this.elements.delete(t),e.events.offAny(this.onElementEvent),this.incrementCellsVersion(),this.source.trigger("changeCells",{updateAll:!1,changedElement:e,changedLinks:r})}}addLink(t){if(this.getLink(t.id))throw new Error(`Link already exists: ${t.id}`);const e=this.sourceOf(t);if(!e)throw new Error(`Link source not found: ${t.sourceId}`);const n=this.targetOf(t);if(!n)throw new Error(`Link target not found: ${t.targetId}`);let r=this.elementLinks.get(e);if(r||(r=[],this.elementLinks.set(e,r)),r.push(t),t.sourceId!==t.targetId){let e=this.elementLinks.get(n);e||(e=[],this.elementLinks.set(n,e)),e.push(t)}t.events.onAny(this.onLinkEvent),this.links.push(t.id,t),this.incrementCellsVersion(),this.source.trigger("changeCells",{updateAll:!1,changedLinks:[t]})}onLinkEvent=t=>{this.source.trigger("linkEvent",{data:t})};removeLink(t,e){const n=this.links.delete(t);n&&(n.events.offAny(this.onLinkEvent),this.removeLinkReferences(n),this.incrementCellsVersion(),e&&e.silent||this.source.trigger("changeCells",{updateAll:!1,changedLinks:[n]}))}removeLinkReferences(t){const e=this.getElement(t.sourceId);if(e){const n=this.elementLinks.get(e);n&&(Jl(n,t),0===n.length&&this.elementLinks.delete(e))}const n=this.getElement(t.targetId);if(n){const e=this.elementLinks.get(n);e&&(Jl(e,t),0===e.length&&this.elementLinks.delete(n))}}incrementCellsVersion(){this.cellsVersion=this.cellsVersion+1,this.cellsVersion>=Number.MAX_SAFE_INTEGER&&(this.cellsVersion=1)}get linkVisibility(){return this.linkTypeVisibility}getLinkVisibility(t){return this.linkTypeVisibility.get(t)??"visible"}setLinkVisibility(t,e){const n=this.getLinkVisibility(t);e!==n&&(this.linkTypeVisibility.set(t,e),this.source.trigger("changeLinkVisibility",{source:t,previous:n}))}}function Jl(t,e){const n=t.indexOf(e);n>=0&&t.splice(n,1)}class tc{source=new Ea;events=this.source;_language="en";_selection=[];graph=new Yl;graphListener=new Ca;history;constructor(t){const{history:e}=t;this.history=e}get language(){return this._language}setLanguage(t){if(!t)throw new Error("Cannot set empty language.");const e=this._language;e!==t&&(this._language=t,this.source.trigger("changeLanguage",{source:this,previous:e}))}get selection(){return this._selection}setSelection(t){const e=this._selection;if(e===t)return;const n=Array.from(t),r=n.filter((t=>t instanceof tl));this.bringElements(r,"front"),this._selection=n,this.source.trigger("changeSelection",{source:this,previous:e})}get factory(){return this.getTermFactory()}get cellsVersion(){return this.graph.getCellsVersion()}get elements(){return this.graph.getElements()}get links(){return this.graph.getLinks()}getTermFactory(){return Di}getElement(t){return this.graph.getElement(t)}getElementLinks(t){return this.graph.getElementLinks(t)}getLink(t){return this.graph.getLink(t)}findLink(t,e,n){for(const r of this.graph.iterateLinks(e,n,t))return r}sourceOf(t){return this.getElement(t.sourceId)}targetOf(t){return this.getElement(t.targetId)}getLinkVisibility(t){return this.graph.getLinkVisibility(t)}setLinkVisibility(t,e){this.graph.setLinkVisibility(t,e)}resetGraph(){this.graphListener&&(this.graphListener.stopListening(),this.graphListener=new Ca),this.graph=new Yl,this._selection=[],this.source.trigger("discardGraph",{source:this})}subscribeGraph(){this.graphListener.listen(this.graph.events,"changeCells",(t=>{this.triggerChangeCells(t)})),this.graphListener.listen(this.graph.events,"elementEvent",(t=>{this.triggerElementEvent(t)})),this.graphListener.listen(this.graph.events,"linkEvent",(t=>{this.triggerLinkEvent(t)})),this.graphListener.listen(this.graph.events,"changeLinkVisibility",(t=>{this.source.trigger("changeLinkVisibility",t)})),this.triggerChangeCells({updateAll:!0})}triggerChangeCells(t){if(this.selection.length>0){const t=this.selection.filter((t=>t instanceof tl?this.getElement(t.id):t instanceof nl&&this.getLink(t.id)));t.length<this.selection.length&&this.setSelection(t)}this.source.trigger("changeCells",t)}triggerElementEvent(t){this.source.trigger("elementEvent",t)}triggerLinkEvent(t){this.source.trigger("linkEvent",t)}reorderElements(t){this.graph.reorderElements(t),this.source.trigger("changeCellOrder",{source:this})}bringElements(t,e){0!==t.length&&this.reorderElements(function(t,e,n){const r=new Map,i=("start"===n?-1:1)*t.length;t.forEach(((t,e)=>{r.set(t,e)}));for(const t of e)r.set(t,i+r.get(t));return(t,e)=>{const n=r.get(t),i=r.get(e);return n>i?1:n<i?-1:0}}(this.elements,t,"front"===e?"end":"start"))}addElement(t){this.history.execute(new ec(this.graph,t,[]))}removeElement(t){const e=this.getElement(t);e&&this.history.execute(new nc(this.graph,e))}addLink(t){this.history.execute(new rc(this.graph,t))}removeLink(t){const e=this.graph.getLink(t);e&&this.history.execute(new ic(this.graph,e))}}class ec{constructor(t,e,n){this.graph=t,this.element=e,this.connectedLinks=n}get title(){return"Add element"}invoke(){const{graph:t,element:e,connectedLinks:n}=this;t.addElement(e);for(const e of n)t.getLink(e.id)||t.addLink(e);return new nc(t,e)}}class nc{constructor(t,e){this.graph=t,this.element=e}get title(){return"Remove element"}invoke(){const{graph:t,element:e}=this,n=[...t.getElementLinks(e)];return t.removeElement(e.id),new ec(t,e,n)}}class rc{constructor(t,e){this.graph=t,this.link=e}get title(){return"Add link"}invoke(){const{graph:t,link:e}=this;return t.addLink(e),new ic(t,e)}}class ic{constructor(t,e){this.graph=t,this.link=e}get title(){return"Remove link"}invoke(){const{graph:t,link:e}=this;return t.removeLink(e.id),new rc(t,e)}}class oc extends tl{_data;constructor(t){super(t),this._data=t.data}static placeholderData(t){return{id:t,types:[],properties:{[$a]:[]}}}static isPlaceholderData(t){return Object.prototype.hasOwnProperty.call(t.properties,$a)&&void 0!==t.properties[$a]}get entitySource(){return this.source}get iri(){return this._data.id}get data(){return this._data}setData(t){const e=this._data;e!==t&&(this._data=t,this.entitySource.trigger("changeData",{source:this,previous:e}),this.entitySource.trigger("requestedRedraw",{source:this,level:"template"}))}static fromJSONType="Element";static fromJSON(t,e){const{"@id":n,iri:r,position:i,isExpanded:o,elementState:a}=t;if(r){const t=e.getInitialData(r);return new oc({id:n,data:t??oc.placeholderData(r),position:i,expanded:o,elementState:e.mapTemplateState(Aa.fromJSON(a))})}}toJSON(){return{"@type":"Element","@id":this.id,iri:this.iri,position:this.position,elementState:this.elementState.toJSON()}}}class ac extends tl{_items;_itemIris=new Set;constructor(t){super(t),this._items=t.items??[],this.updateItemIris()}get entitySource(){return this.source}get items(){return this._items}setItems(t){const e=this._items;e!==t&&(this._items=t,this.updateItemIris(),this.entitySource.trigger("changeItems",{source:this,previous:e}),this.entitySource.trigger("requestedRedraw",{source:this,level:"template"}))}get itemIris(){return this._itemIris}updateItemIris(){this._itemIris.clear();for(const t of this._items)this._itemIris.add(t.data.id)}static fromJSONType="ElementGroup";static fromJSON(t,e){const{"@id":n,items:r,position:i,elementState:o}=t,a=[];for(const t of r){const n=e.getInitialData(t.iri);a.push({data:n??oc.placeholderData(t.iri),elementState:e.mapTemplateState(Aa.fromJSON(t.elementState))})}return new ac({id:n,items:a,position:i,elementState:Aa.fromJSON(o)})}toJSON(){return{"@type":"ElementGroup","@id":this.id,items:this.items.map((t=>({"@type":"ElementItem",iri:t.data.id,elementState:t.elementState?.toJSON()}))),position:this.position,elementState:this.elementState.toJSON()}}}function sc(t,e){return Ls.create(Pi.text("commands.set_entity_group_items.title"),(()=>{const n=t.items;return t.setItems(e),sc(t,n)}))}function*lc(t){if(t instanceof oc)yield t.data;else if(t instanceof ac)for(const e of t.items)yield e.data}class cc extends nl{_data;constructor(t){super(t),this._data=t.data}get relationSource(){return this.source}getTypeId(){return this._data.linkTypeId}get data(){return this._data}setData(t){const e=this._data;e!==t&&(this._data=t,this.relationSource.trigger("changeData",{source:this,previous:e}),this.relationSource.trigger("requestedRedraw",{source:this}))}withDirection(t){if(t.sourceId!==this.data.sourceId&&t.sourceId!==this.data.targetId)throw new Error("New link source IRI is unrelated to original link");if(t.targetId!==this.data.sourceId&&t.targetId!==this.data.targetId)throw new Error("New link target IRI is unrelated to original link");return new cc({sourceId:t.sourceId===this.data.sourceId?this.sourceId:this.targetId,targetId:t.targetId===this.data.targetId?this.targetId:this.sourceId,data:t})}static fromJSONType="Link";static fromJSON(t,e){const{"@id":n,property:r,vertices:i,linkState:o}=t,{source:a,target:s}=e,l=t.sourceIri??(a instanceof oc?a.data.id:void 0),c=t.targetIri??(s instanceof oc?s.data.id:void 0);if(l&&c){const t={linkTypeId:r,sourceId:l,targetId:c,properties:{}},u=e.getInitialData(t);return new cc({id:n,sourceId:a.id,targetId:s.id,data:u??t,vertices:i,linkState:e.mapTemplateState(Aa.fromJSON(o))})}}toJSON(){return{"@type":"Link","@id":this.id,property:this.typeId,source:{"@id":this.sourceId},target:{"@id":this.targetId},sourceIri:this.data.sourceId,targetIri:this.data.targetId,vertices:[...this.vertices],linkState:this.linkState.toJSON()}}}function uc(t,e){return Ls.create(Pi.text("commands.set_relation_data.title"),(()=>{const n=t.data;return t.setData(e),uc(t,n)}))}class dc extends nl{_typeId;_items;_itemKeys=new W(Gi,qi);_sources=new Set;_targets=new Set;constructor(t){super(t),this._typeId=t.typeId,this._items=t.items??[],this.updateItemKeys()}get relationSource(){return this.source}getTypeId(){return this._typeId}get items(){return this._items}setItems(t){for(const e of t)if(e.data.linkTypeId!==this._typeId)throw new Error("RelationGroup should have only items with same type IRI");const e=this._items;e!==t&&(this._items=t,this.updateItemKeys(),this.relationSource.trigger("changeItems",{source:this,previous:e}),this.relationSource.trigger("requestedRedraw",{source:this}))}get itemKeys(){return this._itemKeys}get itemSources(){return this._sources}get itemTargets(){return this._targets}updateItemKeys(){this._itemKeys.clear(),this._sources.clear(),this._targets.clear();for(const t of this._items)this._itemKeys.add(t.data),this._sources.add(t.data.sourceId),this._targets.add(t.data.targetId)}static fromJSONType="LinkGroup";static fromJSON(t,e){const{"@id":n,property:r,vertices:i,linkState:o}=t,{source:a,target:s}=e,l=[];for(const n of t.items){const r={linkTypeId:t.property,sourceId:n.sourceIri,targetId:n.targetIri,properties:{}},i=e.getInitialData(r);l.push({data:i??r,linkState:e.mapTemplateState(Aa.fromJSON(n.linkState))})}return new dc({id:n,typeId:r,sourceId:a.id,targetId:s.id,items:l,vertices:i,linkState:e.mapTemplateState(Aa.fromJSON(o)).set(za.LayoutOnly,void 0)})}toJSON(){return{"@type":"LinkGroup","@id":this.id,property:this.typeId,source:{"@id":this.sourceId},target:{"@id":this.targetId},items:this.items.map((t=>({"@type":"LinkItem",sourceIri:t.data.sourceId,targetIri:t.data.targetId,linkState:t.linkState?.toJSON()}))),vertices:[...this.vertices],linkState:this.linkState.toJSON()}}}function hc(t,e){return Ls.create(Pi.text("commands.set_relation_group_items.title"),(()=>{const n=t.items;return t.setItems(e),hc(t,n)}))}function*fc(t){if(t instanceof cc)yield t.data;else if(t instanceof dc)for(const e of t.items)yield e.data}class pc{source=new Ea;events=this.source;id;_data;constructor(t){const{id:e,data:n}=t;this.id=e,this.setData(n)}get data(){return this._data}setData(t){if(t&&t.id!==this.id)throw new Error("ElementTypeModel.id does not match ElementType.id");const e=this._data;e!==t&&(this._data=t,this.source.trigger("changeData",{source:this,previous:e}))}}class gc{source=new Ea;events=this.source;id;_data;constructor(t){const{id:e,data:n}=t;this.id=e,this.setData(n)}get data(){return this._data}setData(t){if(t&&t.id!==this.id)throw new Error("PropertyTypeModel.id does not match PropertyType.id");const e=this._data;e!==t&&(this._data=t,this.source.trigger("changeData",{source:this,previous:e}))}}class vc{source=new Ea;events=this.source;id;_data;constructor(t){const{id:e,data:n}=t;this.id=e,this.setData(n)}get data(){return this._data}setData(t){if(t&&t.id!==this.id)throw new Error("LinkTypeModel.id does not match LinkType.id");const e=this._data;e!==t&&(this._data=t,this.source.trigger("changeData",{source:this,previous:e}))}}function mc(t,e,n){const r=Ls.create(Pi.text("commands.change_entity.title"),(()=>{const i=e,o=n.id,a=new Map,s=new Map,l=new Map,c=new Map,u=e=>{for(const n of t.getElementLinks(e))if(n instanceof cc)l.set(n,n.data),n.setData(bc(n.data,i,o));else if(n instanceof dc&&(n.itemSources.has(i)||n.itemTargets.has(i))){c.set(n,n.items);const t=n.items.map((t=>({...t,data:bc(t.data,i,o)})));n.setItems(t)}};for(const r of t.elements)if(r instanceof oc)r.iri===e&&(a.set(r,r.data),r.setData(n),u(r));else if(r instanceof ac&&r.itemIris.has(e)){s.set(r,r.items);const t=r.items.map((t=>t.data.id===e?{...t,data:n}:t));r.setItems(t),u(r)}return Ls.create(Pi.text("commands.change_entity.title"),(()=>{for(const[t,e]of a)t.setData(e);for(const[t,e]of s)t.setItems(e);for(const[t,e]of l)t.setData(e);for(const[t,e]of c)t.setItems(e);return r}))}));return r}function bc(t,e,n){let r=t;return r.sourceId===e&&(r={...r,sourceId:n}),r.targetId===e&&(r={...r,targetId:n}),r}function wc(t,e,n){if(!qi(e,n))throw new Error("Cannot change typeId, sourceId or targetId when changing link data");return Ls.create(Pi.text("commands.change_relation.title"),(()=>{for(const r of t.links)r instanceof cc&&qi(r.data,e)&&r.setData(n);return wc(t,n,e)}))}class yc{constructor(t,e,n){this.graph=t,this.dataGraph=e,this.dataProvider=n}source=new Ea;events=this.source;cancellation=new AbortController;_operations=[];_failReasons=new Map;elementTypeQueue=new La((t=>{const e={type:"elementType",targets:new Set(t)},n=this.dataProvider.elementTypes({classIds:t,signal:this.signal}).then(this.onElementTypesLoaded);this.addOperation(e,n)}));linkTypeQueue=new La((t=>{const e={type:"linkType",targets:new Set(t)},n=this.dataProvider.linkTypes({linkTypeIds:t,signal:this.signal}).then(this.onLinkTypesLoaded);this.addOperation(e,n)}));propertyTypeQueue=new La((t=>{const e={type:"propertyType",targets:new Set(t)},n=this.dataProvider.propertyTypes({propertyIds:t,signal:this.signal}).then(this.onPropertyTypesLoaded);this.addOperation(e,n)}));get signal(){return this.cancellation.signal}dispose(){this.cancellation.abort()}get operations(){return this._operations}getFailReason(t,e){const n=this._failReasons.get(t);return n?.get(e)}addOperation(t,e){const n=this._operations,r=[...n,t];e.then((()=>this.onOperationComplete(t)),(e=>this.onOperationComplete(t,e))),this._operations=r,this.source.trigger("changeOperations",{previous:n})}onOperationComplete(t,e){const n=this._operations,r=n.indexOf(t);if(r>=0){const t=[...n];t.splice(r,1),this._operations=t}switch(t.type){case"element":case"elementType":case"linkType":case"propertyType":{const n=this.ensureFailReasons(t.type);for(const r of t.targets)n.set(r,e)}}(this._operations!==n||e)&&this.source.trigger("changeOperations",{previous:n,fail:e?{operation:t,error:e}:void 0})}ensureFailReasons(t){let e=this._failReasons.get(t);return e||(e=new Map,this._failReasons.set(t,e)),e}fetchElementData(t){if(0===t.size)return Promise.resolve();const e={type:"element",targets:t},n=this.dataProvider.elements({elementIds:Array.from(t),signal:this.signal}).then((e=>this.onElementInfoLoaded(t,e)));return this.addOperation(e,n),n}onElementInfoLoaded(t,e){for(const n of this.graph.getElements())if(n instanceof oc){const r=e.get(n.iri);r?n.setData(r):t.has(n.iri)&&n.setData(_c(n.data))}else if(n instanceof ac){let r=!1;for(const e of n.items)t.has(e.data.id)&&(r=!0);if(r){const t=n.items.map((t=>{const n=e.get(t.data.id)??_c(t.data);return n===t.data?t:{...t,data:n}}));n.setItems(t)}}}fetchLinks(t,e,n){const r=this.dataProvider.links({primary:t,secondary:e,linkTypeIds:n});return this.addOperation({type:"link"},r),r}fetchElementType(t){this.elementTypeQueue.push(t.id)}onElementTypesLoaded=t=>{for(const e of t.values()){const t=this.dataGraph.getElementType(e.id);t&&t.setData(e)}};fetchLinkType(t){this.linkTypeQueue.push(t.id)}onLinkTypesLoaded=t=>{for(const e of t.values()){const t=this.dataGraph.getLinkType(e.id);t&&t.setData(e)}};fetchPropertyType(t){this.propertyTypeQueue.push(t.id)}onPropertyTypesLoaded=t=>{for(const e of t.values()){const t=this.dataGraph.getPropertyType(e.id);t&&t.setData(e)}}}function _c(t){if(oc.isPlaceholderData(t)){const{[$a]:e,...n}=t.properties;return{...t,properties:n}}return t}function kc(){return{"@context":"https://ontodia.org/context/v1.json","@type":"Diagram",layoutData:{"@type":"Layout",elements:[],links:[]},linkTypeOptions:[]}}function xc(t,e){const n=[];for(const e of t)if(Ec(e)){const t=e.toJSON();Cc(t)&&n.push(t)}const r=[];for(const t of e)if(Ec(t)){const e=t.toJSON();Cc(e)&&r.push(e)}return{"@type":"Layout",elements:n,links:r}}function Sc(t,e){return t.set(za.LayoutOnly,!!e||void 0)}function Ec(t){return Boolean("function"==typeof t.toJSON)}function Cc(t){return"object"==typeof t&&t&&"string"==typeof t["@type"]}class Mc{source=new Ea;events=this.source;classesById=new Map;propertiesById=new Map;linkTypes=new Map;getLinkType(t){return this.linkTypes.get(t)}addLinkType(t){if(this.getLinkType(t.id))throw new Error(`Link type already exists: ${t.id}`);t.events.onAny(this.onLinkTypeEvent),this.linkTypes.set(t.id,t)}onLinkTypeEvent=t=>{this.source.trigger("linkTypeEvent",{data:t})};getPropertyType(t){return this.propertiesById.get(t)}addPropertyType(t){if(this.getPropertyType(t.id))throw new Error(`Property type already exists: ${t.id}`);t.events.onAny(this.onPropertyTypeEvent),this.propertiesById.set(t.id,t)}onPropertyTypeEvent=t=>{this.source.trigger("propertyTypeEvent",{data:t})};getElementType(t){return this.classesById.get(t)}getElementTypes(){const t=[];return this.classesById.forEach((e=>t.push(e))),t}addElementType(t){if(this.getElementType(t.id))throw new Error(`Element type already exists: ${t.id}`);t.events.onAny(this.onElementTypeEvent),this.classesById.set(t.id,t)}onElementTypeEvent=t=>{this.source.trigger("elementTypeEvent",{data:t})}}class Lc extends tc{translation;dataGraph=new Mc;loadingScope;_dataProvider;_locale;fetcher;discardingTask=Promise.resolve();constructor(t){super(t),this.translation=t.translation,this._dataProvider=new Oa,this.fetcher=new yc(this.graph,this.dataGraph,this._dataProvider),this._locale=new Ji({model:this,translation:this.translation}),this.subscribeGraph()}get extendedSource(){return this.source}get dataProvider(){return this._dataProvider}getTermFactory(){return this._dataProvider.factory}get locale(){return this._locale}get operations(){return this.fetcher.operations}getOperationFailReason(t,e){return this.fetcher.getFailReason(t,e)}resetGraph(){this.dataGraph=new Mc,super.resetGraph(),this.loadingScope?.abort(),this.fetcher.dispose()}subscribeGraph(){this.graphListener.listen(this.dataGraph.events,"elementTypeEvent",(t=>{this.extendedSource.trigger("elementTypeEvent",t)})),this.graphListener.listen(this.dataGraph.events,"linkTypeEvent",(t=>{this.extendedSource.trigger("linkTypeEvent",t)})),this.graphListener.listen(this.dataGraph.events,"propertyTypeEvent",(t=>{this.extendedSource.trigger("propertyTypeEvent",t)})),super.subscribeGraph()}setDataProvider(t){this._dataProvider=t,this.fetcher=new yc(this.graph,this.dataGraph,t),this.graphListener.listen(this.fetcher.events,"changeOperations",(t=>{this.extendedSource.trigger("changeOperations",t)}))}async createNewDiagram(t){const{dataProvider:e,signal:n}=t;return this.importLayout({dataProvider:e,signal:n})}async importLayout(t){const{dataProvider:e,locale:n,diagram:r=kc(),elementCellTypes:i=[oc,ac,Wl],linkCellTypes:o=[cc,dc,ql],preloadedElements:a,preloadedLinks:s,validateLinks:l=!1,hideUnusedLinkTypes:c=!1,signal:u}=t;await this.discardingTask,this.resetGraph(),this.setDataProvider(e),this._locale=n??new Ji({model:this,translation:this.translation});const d=new AbortController;this.loadingScope=d;const h=()=>d.abort();this.extendedSource.trigger("loadingStart",{source:this});const f=this.loadingScope.signal;try{if(u?.addEventListener("abort",h),f.throwIfAborted(),this.setLinkSettings(r.linkTypeOptions??[]),this.createGraphElements({diagram:r,elementCellTypes:i,linkCellTypes:o,preloadedElements:a,preloadedLinks:s,markLinksAsLayoutOnly:l}),c){const t=await this.dataProvider.knownLinkTypes({signal:f});f.throwIfAborted();const e=this.initLinkTypes(t);this.hideUnusedLinkTypes(e)}this.subscribeGraph();const e=[];for(const t of this.graph.getElements())for(const n of lc(t))a&&a.has(n.id)||e.push(n.id);const n=this.requestElementData(e),d=t.validateLinks?this.requestLinks():Promise.resolve();await Promise.all([n,d]),this.history.reset(),this.extendedSource.trigger("loadingSuccess",{source:this})}catch(t){throw this.extendedSource.trigger("loadingError",{source:this,error:t}),new Error("Reactodia: failed to import a layout",{cause:t})}finally{u?.removeEventListener("abort",h),this.loadingScope?.abort(),this.loadingScope=void 0}}discardLayout(){const t=this.discardingTask;this.discardingTask=Promise.resolve().then((async()=>{await t,this.resetGraph(),this.setDataProvider(new Oa),this.extendedSource.trigger("loadingStart",{source:this}),this.subscribeGraph(),this.history.reset(),this.extendedSource.trigger("loadingSuccess",{source:this})})).catch((t=>{console.warn("Error while discarding a layout",t)}))}exportLayout(){const t=new Set(this.graph.getLinks().filter((t=>t instanceof cc||t instanceof dc)).map((t=>t.typeId))),e=new Map;for(const n of t)e.set(n,this.getLinkVisibility(n));return function(t){const{elements:e,links:n,linkTypeVisibility:r}=t;let i;if(r){i=[];for(const[t,e]of r)"visible"!==e&&t!==Ta&&i.push({"@type":"LinkTypeOptions",property:t,visible:"hidden"!==e,showLabel:"withoutLabel"!==e})}return{...kc(),layoutData:xc(e,n),linkTypeOptions:i}}({elements:this.graph.getElements(),links:this.graph.getLinks(),linkTypeVisibility:e})}initLinkTypes(t){const e=[];for(const n of t){const t=new vc({id:n.id,data:n});this.dataGraph.addLinkType(t),e.push(t)}return e}setLinkSettings(t){for(const e of t){const{visible:t=!0,showLabel:n=!0}=e;this.setLinkVisibility(e.property,t&&n?"visible":t&&!n?"withoutLabel":"hidden")}}createGraphElements(t){const{diagram:e,elementCellTypes:n,linkCellTypes:r,preloadedElements:i,preloadedLinks:o,markLinksAsLayoutOnly:a}=t,{elements:s,links:l,linkTypeVisibility:c}=function(t,e){const{layoutData:n,linkTypeOptions:r}=t,i=new Map;if(r)for(const t of r){const{visible:e=!0,showLabel:n=!0}=t;i.set(t.property,e&&n?"visible":e&&!n?"withoutLabel":"hidden")}const{elements:o,links:a}=function(t,e){const{preloadedElements:n,preloadedLinks:r,markLinksAsLayoutOnly:i=!1}=e,o=new Map;for(const t of e.elementCellTypes)o.set(t.fromJSONType,t);const a={getInitialData:t=>n?.get(t),mapTemplateState:t=>t},s=new Map;for(const t of e.linkCellTypes)s.set(t.fromJSONType,t);const l=t=>r?.get(t),c=t=>Sc(t,i),u=new Map,d=[];for(const e of t.elements){const t=o.get(e["@type"]);if(t){const n=t.fromJSON(e,a);n&&u.set(n.id,n)}}for(const e of t.links){const{source:t,target:n}=e,r=u.get(t["@id"]),i=u.get(n["@id"]);if(!r||!i)continue;const o=s.get(e["@type"]);if(o){const t=o.fromJSON(e,{source:r,target:i,getInitialData:l,mapTemplateState:c});t&&d.push(t)}}return{elements:Array.from(u.values()),links:d}}(n,e);return{elements:o,links:a,linkTypeVisibility:i}}(e,{elementCellTypes:n,linkCellTypes:r,preloadedElements:i,preloadedLinks:o,markLinksAsLayoutOnly:a}),u=this.history.startBatch(Pi.text("data_diagram_model.import_layout.command"));for(const[t,e]of c)this.setLinkVisibility(t,e);for(const t of l)(t instanceof cc||t instanceof dc)&&this.createLinkType(t.typeId);for(const t of s)this.addElement(t);for(const t of l)this.addLink(t);u.store()}hideUnusedLinkTypes(t){const e=new Set;for(const t of this.graph.getLinks())(t instanceof cc||t instanceof dc)&&e.add(t.typeId);for(const n of t)e.has(n.id)||this.setLinkVisibility(n.id,"hidden")}async requestData(){const t=new Set;for(const e of this.elements)for(const n of lc(e))oc.isPlaceholderData(n)&&t.add(n.id);const e=Array.from(t);await Promise.all([this.fetcher.fetchElementData(t),this.requestLinks({addedElements:e})])}requestElementData(t){return this.fetcher.fetchElementData(new Set(t))}requestLinks(t={}){const{addedElements:e,linkTypes:n}=t,r=[];for(const t of this.graph.getElements())for(const e of lc(t))r.push(e.id);const i=e??r;return 0===r.length||0===i.length?Promise.resolve():this.fetcher.fetchLinks(r,i,n).then((t=>this.onLinkInfoLoaded(t)))}requestLinksOfType(t){return this.requestLinks({linkTypes:t})}createElement(t){const e="string"==typeof t?t:t.id,n=this.elements.filter((t=>t instanceof oc&&t.iri===e));if(n.length>0)return n[0];let r="string"==typeof t?oc.placeholderData(e):t;r={...r,id:r.id};const i=new oc({data:r});return this.addElement(i),i}onLinkInfoLoaded(t){let e;const n=()=>{e=!1},r=this.history.startBatch();for(const r of t)e=!0,this.extendedSource.trigger("createLoadedLink",{source:this,model:r,cancel:n}),e&&this.createLinks(r);r.discard()}createLinks(t){const e=this.graph.getElements().filter((e=>e instanceof oc&&e.iri===t.sourceId||e instanceof ac&&e.itemIris.has(t.sourceId))),n=this.graph.getElements().filter((e=>e instanceof oc&&e.iri===t.targetId||e instanceof ac&&e.itemIris.has(t.targetId))),r=this.history.startBatch(Pi.text("data_diagram_model.create_links.command")),i=[];for(const r of e)for(const e of n){const n=this.createRelation(r,e,t);i.push(n)}return r.store(),i}createRelation(t,e,n){const r=Array.from(this.graph.iterateLinks(t.id,e.id,n.linkTypeId));for(const t of r){if(t instanceof cc&&qi(t.data,n))return this.history.execute(Xs(t,Sc(t.linkState,!1))),this.history.execute(uc(t,n)),t;if(t instanceof dc&&t.itemKeys.has(n)){const e=t.items.map((t=>qi(t.data,n)?{...t,data:n,linkState:Sc(t.linkState??Aa.empty,!1)}:t));return this.history.execute(hc(t,e)),t}}for(const i of r)if(i.typeId==i.typeId){if(i instanceof cc){const r=new dc({sourceId:t.id,targetId:e.id,typeId:n.linkTypeId,items:[{data:i.data,linkState:i.linkState},{data:n}]});return this.removeLink(i.id),this.addLink(r),r}if(i instanceof dc){const t=[...i.items,{data:n}];return this.history.execute(hc(i,t)),i}}const i=new cc({sourceId:t.id,targetId:e.id,data:n});return this.addLink(i),i}getElementType(t){return this.dataGraph.getElementType(t)}createElementType(t){const e=this.dataGraph.getElementType(t);if(e)return e;const n=new pc({id:t});return this.dataGraph.addElementType(n),this.fetcher.fetchElementType(n),n}getLinkType(t){return this.dataGraph.getLinkType(t)}createLinkType(t){const e=this.dataGraph.getLinkType(t);if(e)return e;const n=new vc({id:t});return this.dataGraph.addLinkType(n),this.fetcher.fetchLinkType(n),n}getPropertyType(t){return this.dataGraph.getPropertyType(t)}createPropertyType(t){const e=this.dataGraph.getPropertyType(t);if(e)return e;const n=new gc({id:t});return this.dataGraph.addPropertyType(n),this.fetcher.fetchPropertyType(n),n}group(t){const e=this.history.startBatch(Pi.text("data_diagram_model.group_entities.command")),n=new Set;for(const e of t)n.add(e.data.id);const r=[],i=new Set;for(const e of t){r.push({data:e.data,elementState:e.elementState});for(const t of this.getElementLinks(e))i.add(t)}for(const t of i)this.removeLink(t.id);for(const e of t)this.removeElement(e.id);const o=js(t,[],{getElementSize:()=>{}}),a=new ac({items:r,position:Cs.center(o)});return this.addElement(a),this.recreateLinks(i),e.store(),a}ungroupAll(t){const e=this.history.startBatch(Pi.text("data_diagram_model.ungroup_entities.command")),n=[],r=new Set;for(const e of t){for(const t of this.getElementLinks(e))r.add(t);this.removeElement(e.id);for(const t of e.items){const r=new oc({data:t.data,position:e.position,elementState:t.elementState});this.addElement(r),n.push(r)}}return this.recreateLinks(r),e.store(),n}ungroupSome(t,e){const n=t.items.filter((t=>!e.has(t.data.id)));if(n.length<=1)return this.ungroupAll([t]);const r=this.history.startBatch(Pi.text("data_diagram_model.ungroup_entities.command")),i=new Set;for(const n of this.getElementLinks(t))n instanceof cc?(e.has(n.data.sourceId)||e.has(n.data.targetId))&&i.add(n):n instanceof dc&&n.items.some((t=>e.has(t.data.sourceId)||e.has(t.data.targetId)))&&i.add(n);for(const t of i)this.removeLink(t.id);const o=[];for(const n of t.items)if(e.has(n.data.id)){const e=new oc({data:n.data,position:t.position,elementState:n.elementState});this.addElement(e),o.push(e)}return r.history.execute(sc(t,n)),this.recreateLinks(i),r.store(),o}regroupLinks(t){const e=this.history.startBatch(Pi.text("data_diagram_model.regroup_relations.command"));for(const e of t)this.removeLink(e.id);this.recreateLinks(new Set(t)),e.store()}recreateLinks(t){for(const e of t)if(e instanceof cc)for(const t of this.createLinks(e.data))t instanceof cc&&this.history.execute(Xs(t,e.linkState));else if(e instanceof dc)for(const{data:t}of e.items)this.createLinks(t)}}function $c(t,e){return Ls.effect(Pi.text("data_diagram_model.request_entities.command"),(()=>{t.requestElementData(e)}))}function Nc(t,e={}){return Ls.effect(Pi.text("data_diagram_model.request_relations.command"),(()=>{t.requestLinks(e)}))}function Tc(t){const e=new Set;for(const n of t.elements)for(const t of lc(n))e.add(t.id);return e}var Ac;async function zc(t,e,n,r,i,o){let a;try{if(a=await t,null===a)return}catch(t){a={items:[{type:"element",target:r.target.id,severity:"error",message:o.text("editor_controller.validate_entity_failed.message"),errorCause:t}]}}const s=[],l=new U(Gi,qi);r.outboundLinks.forEach((t=>l.set(t,[])));for(const t of a.items)"element"===t.type&&t.target===r.target.id?s.push(t):"link"===t.type&&l.has(t.target)&&l.get(t.target).push(t);let c=i.validationState;c.elements.get(r.target.id)===e&&(c=Ac.setElementItems(c,r.target.id,s)),l.forEach(((t,e)=>{c.links.get(e)===n&&(c=Ac.setLinkItems(c,e,t))})),i.setValidationState(c)}(t=>{function e(){return{elements:new Map,links:new U(Gi,qi)}}t.empty=e(),t.emptyElement={loading:!1,items:[]},t.emptyLink={loading:!1,items:[]},t.createMutable=e,t.setElementItems=function(t,e,n){const r=new Map(t.elements);return n.length>0?r.set(e,{loading:!1,items:n}):r.delete(e),{...t,elements:r}},t.setLinkItems=function(t,e,n){const r=t.links.clone();return n.length>0?r.set(e,{loading:!1,items:n}):r.delete(e),{...t,links:r}}})(Ac||(Ac={}));const Ic=new Map([["info",0],["warning",1],["error",2]]);function Rc(t){let e="info",n=Ic.get(e)??-1;for(const{severity:r}of t){const t=Ic.get(r)??-1;t>n&&(n=t,e=r)}return e}class Oc{listener=new Ca;source=new Ea;events=this.source;model;translation;_inAuthoringMode=!1;_metadataProvider;_validationProvider;_authoringState=Gl.empty;_validationState=Ac.empty;_temporaryState=Zl.empty;cancellation=new AbortController;constructor(t){const{model:e,translation:n,metadataProvider:r,validationProvider:i}=t;this.model=e,this.translation=n,this._metadataProvider=r,this._validationProvider=i,this.listener.listen(this.events,"changeValidationState",(t=>{for(const e of this.model.elements){if(!(e instanceof oc))continue;const n=t.previous.elements.get(e.iri);this.validationState.elements.get(e.iri)!==n&&e.redraw()}})),this.listener.listen(this.events,"changeAuthoringState",(t=>{this.validateChangedFrom(t.previous)})),this.listener.listen(e.events,"changeCells",(t=>{this.validateChangedCells(t)}))}dispose(){this.listener.stopListening(),this.cancellation.abort()}get inAuthoringMode(){return this._inAuthoringMode&&Boolean(this._metadataProvider)}setAuthoringMode(t){const e=this._inAuthoringMode,n=t&&Boolean(this._metadataProvider);n!==e&&(this._inAuthoringMode=n,this.source.trigger("changeMode",{source:this,previous:e}))}get metadataProvider(){return this._metadataProvider}get validationProvider(){return this._validationProvider}get authoringState(){return this._authoringState}setAuthoringState(t){this._authoringState!==t&&this.model.history.execute(this.updateAuthoringState(t))}updateAuthoringState(t){const e=this._authoringState;return Ls.create(Pi.text("editor_controller.set_authoring_state.command"),(()=>(this._authoringState=t,this.source.trigger("changeAuthoringState",{source:this,previous:e}),this.updateAuthoringState(e))))}get validationState(){return this._validationState}setValidationState(t){const e=this._validationState;t!==e&&(this._validationState=t,this.source.trigger("changeValidationState",{source:this,previous:e}))}get temporaryState(){return this._temporaryState}setTemporaryState(t){const e=this._temporaryState;t!==e&&(this._temporaryState=t,this.source.trigger("changeTemporaryState",{source:this,previous:e}))}validateChangedFrom(t){if(!this.validationProvider)return;const e=function(t,e,n){const r=new U(Gi,qi);t.links.forEach(((t,e)=>r.set(e,!0))),e.links.forEach(((t,e)=>r.set(e,!0)));const i=new Set;r.forEach(((n,r)=>{e.links.get(r)!==t.links.get(r)&&i.add(r.sourceId)}));for(const r of n.elements)for(const o of lc(r)){const a=e.elements.get(o.id),s=t.elements.get(o.id);if(a!==s&&(i.add(o.id),"entityDelete"===(a||s).type))for(const t of n.getElementLinks(r))for(const e of fc(t))e.targetId===o.id&&e.sourceId!==o.id&&i.add(e.sourceId)}return i}(t,this.authoringState,this.model);this.revalidateEntities(e)}validateChangedCells(t){if(!this.validationProvider||!this.inAuthoringMode)return;if(t.updateAll)return void this.validateChangedFrom(Gl.empty);const e=this.authoringState;let n;if(t.changedElement)for(const r of lc(t.changedElement))e.elements.has(r.id)&&(n||(n=new Set),n.add(r.id));else if(t.changedLinks)for(const r of t.changedLinks)for(const t of fc(r))e.links.has(t)&&(n||(n=new Set),n.add(t.sourceId));n&&this.revalidateEntities(n)}revalidateEntities(t){this.validationProvider&&function(t,e,n,r,i,o,a){const s=r.validationState,l=Ac.createMutable();for(const c of n.elements)for(const u of lc(c)){if(l.elements.has(u.id))continue;const d=[];for(const t of n.getElementLinks(c))for(const e of fc(t))e.sourceId===u.id&&d.push(e);if(t.has(u.id)){const t={target:u,outboundLinks:d,state:r.authoringState,graph:n,translation:i,language:o,signal:a},s=_a(e.validate(t),a),c={loading:!0,items:[]},h={loading:!0,items:[]};l.elements.set(u.id,c),d.forEach((t=>l.links.set(t,h))),zc(s,c,h,t,r,i)}else{l.elements.set(u.id,s.elements.get(u.id));for(const t of d)l.links.set(t,s.links.get(t))}}r.setValidationState(l)}(t,this.validationProvider,this.model,this,this.translation,this.model.language,this.cancellation.signal)}removeSelectedElements(){const t=this.model.selection;t.length>0&&(this.model.setSelection([]),this.removeItems(t))}removeItems(t){const{model:e}=this,n=e.history.startBatch(Pi.text("editor_controller.remove_items.command")),r=new Set;for(const e of t)if(e instanceof tl){for(const t of lc(e))r.add(t.id);this.model.removeElement(e.id)}else if(e instanceof nl){for(const t of fc(e))Gl.isAddedRelation(this.authoringState,t)&&this.deleteRelation(t);e instanceof cc||e instanceof dc||this.model.removeLink(e.id)}const i=new Set;for(const t of r){const e=this.authoringState.elements.get(t);e&&this.discardChange(e),i.add(t)}if(i.size>0){const t=Gl.discardAddedRelations(this.authoringState,i);this.setAuthoringState(t)}n.store()}createEntity(t,e={}){const{model:n}=this,r=n.history.startBatch(Pi.text("editor_controller.entity_add.command")),i=n.createElement(t);return e.temporary?(this.setTemporaryState(Zl.addEntity(this.temporaryState,i.data)),r.discard()):(this.setAuthoringState(Gl.addEntity(this._authoringState,i.data)),r.store()),i}changeEntity(t,e){const{model:n}=this,r="string"==typeof t?Vc(Pc(n,t),t):t;if(!r)return;const i=n.history.startBatch(Pi.text("editor_controller.entity_change.command")),o=Gl.changeEntity(this._authoringState,r,e),a=o.elements.get(r.id)||o.elements.get(e.id);n.history.execute(mc(n,r.id,a.data)),this.setAuthoringState(o),i.store()}deleteEntity(t){const{model:e}=this,n="string"==typeof t?Vc(Pc(e,t),t):t;if(!n)return;const r=this.authoringState,i=e.history.startBatch(Pi.text("editor_controller.entity_delete.command"));for(const t of Pc(e,n.id))this.removeRelationsFromLinks(e.getElementLinks(t),(t=>Gl.isAddedRelation(r,t)));const o=r.elements.get(n.id);o&&this.discardChange(o),this.setAuthoringState(Gl.deleteEntity(r,n)),i.store()}createRelation(t,e={}){const{model:n}=this;if(n.findLink(t.typeId,t.sourceId,t.targetId))throw Error("The relation with same (source IRI, target IRI, type) already exists");const r=n.history.startBatch(Pi.text("editor_controller.relation_add.command"));return n.addLink(t),e.temporary||this.model.createLinks(t.data),function(t,e){for(const n of t.links)for(const t of fc(n))if(qi(t,e))return!0;return!1}(n,t.data)?e.temporary?(this.setTemporaryState(Zl.addRelation(this.temporaryState,t.data)),r.discard()):(this.setAuthoringState(Gl.addRelation(this._authoringState,t.data)),r.store()):r.discard(),t}changeRelation(t,e){const{model:n}=this,r=n.history.startBatch(Pi.text("editor_controller.relation_change.command"));if(qi(t,e))n.history.execute(wc(n,t,e)),this.setAuthoringState(Gl.changeRelation(this._authoringState,t,e));else{let r=this._authoringState;r=Gl.deleteRelation(r,t),r=Gl.addRelation(r,e),Gl.isAddedRelation(this._authoringState,t)&&this.removeRelationsFromLinks(n.links,(e=>qi(e,t))),n.createLinks(e),this.setAuthoringState(r)}r.store()}moveRelationSource(t){const{model:e}=this,{link:n,newSource:r}=t;if(n.data.sourceId===r.data.id)return n;const i=e.history.startBatch(Pi.text("editor_controller.relation_move_source.command"));this.changeRelation(n.data,{...n.data,sourceId:r.iri});const o=e.findLink(n.typeId,r.id,n.targetId);return o.setVertices(n.vertices),i.store(),o}moveRelationTarget(t){const{model:e}=this,{link:n,newTarget:r}=t;if(n.data.targetId===r.data.id)return n;const i=e.history.startBatch(Pi.text("editor_controller.relation_move_target.command"));this.changeRelation(n.data,{...n.data,targetId:r.iri});const o=e.findLink(n.typeId,n.sourceId,r.id);return o.setVertices(n.vertices),i.store(),o}deleteRelation(t){const{model:e}=this,n=this.authoringState;if(Gl.isDeletedRelation(n,t))return;const r=e.history.startBatch(Pi.text("editor_controller.relation_delete.command")),i=Gl.deleteRelation(n,t);Gl.isAddedRelation(n,t)&&this.removeRelationsFromLinks(e.links,(e=>qi(e,t))),this.setAuthoringState(i),r.store()}removeAllTemporaryCells(){const{temporaryState:t}=this,e=[];if(t.elements.size>0)for(const n of this.model.elements)n instanceof oc&&t.elements.has(n.iri)&&e.push(n);if(t.links.size>0)for(const n of this.model.links)n instanceof cc&&t.links.has(n.data)&&e.push(n);e.length>0&&this.removeTemporaryCells(e)}removeTemporaryCells(t){const{temporaryState:e}=this;let n=e;const r=this.model.history.startBatch();for(const r of t)r instanceof oc?e.elements.has(r.iri)&&(n=Zl.removeEntity(n,r.data),this.model.removeElement(r.id)):r instanceof cc&&e.links.has(r.data)&&(n=Zl.removeRelation(n,r.data),this.model.removeLink(r.id));r.discard(),this.setTemporaryState(n)}discardChange(t){const{model:e}=this,n=Gl.discard(this._authoringState,t);if(n===this._authoringState)return;const r=e.history.startBatch(Pi.text("editor_controller.discard_change.command"));switch(t.type){case"entityAdd":for(const n of Pc(e,t.data.id))n instanceof oc?e.removeElement(n.id):n instanceof ac&&this.discardItemFromGroup(n,t.data.id);break;case"entityChange":e.history.execute(mc(e,t.data.id,t.before));break;case"relationAdd":this.removeRelationsFromLinks(e.links,(e=>qi(e,t.data)));break;case"relationChange":e.history.execute(wc(this.model,t.data,t.before))}this.setAuthoringState(n),r.store()}discardItemFromGroup(t,e){const n=t.items.filter((t=>t.data.id!==e));this.model.history.execute(sc(t,n)),this.removeRelationsFromLinks(this.model.getElementLinks(t),(({sourceId:t,targetId:n})=>t===e||n===e)),n.length<=1&&this.model.ungroupAll([t])}removeRelationsFromLinks(t,e){const n=[],r=[];for(const i of t)if(i instanceof cc)e(i.data)&&n.push(i);else if(i instanceof dc&&i.items.some((t=>e(t.data)))){const t=i.items.filter((t=>!e(t.data)));this.model.history.execute(hc(i,t)),r.push(i)}for(const t of n)this.model.removeLink(t.id);this.model.regroupLinks(r)}applyAuthoringChanges(){const t=this.authoringState,e=this.model.history.startBatch(Pi.text("editor_controller.apply_authored_changes.command"));for(const n of t.links.values())"relationChange"===n.type&&e.history.execute(wc(this.model,n.before,n.data));const n=[];for(const e of this.model.links)e instanceof cc?Gl.isDeletedRelation(t,e.data)&&n.push(e):e instanceof dc&&e.items.some((e=>Gl.isDeletedRelation(t,e.data)))&&this.model.history.execute(hc(e,e.items.filter((e=>!Gl.isDeletedRelation(t,e.data)))));for(const t of n)this.model.removeLink(t.id);for(const e of t.elements.values())"entityChange"===e.type&&this.model.history.execute(mc(this.model,e.before.id,void 0===e.newIri?e.data:{...e.data,id:e.newIri}));const r=[];for(const n of this.model.elements)n instanceof oc?Gl.isDeletedEntity(t,n.iri)&&r.push(n):n instanceof ac&&n.items.some((e=>Gl.isDeletedEntity(t,e.data.id)))&&e.history.execute(sc(n,n.items.filter((e=>!Gl.isDeletedEntity(t,e.data.id)))));for(const t of r)this.model.removeElement(t.id);this.setAuthoringState(Gl.empty),e.store()}}function Pc(t,e){return t.elements.filter((t=>t instanceof oc&&t.iri===e||t instanceof ac&&t.itemIris.has(e)))}function Vc(t,e){for(const n of t)for(const t of lc(n))if(t.id===e)return t}async function jc(t,e){const{model:n}=t,{elements:r,canvas:i}=e,o=n.history.startBatch(Pi.text("workspace.group_entities.command")),a=qs.capturePartial(r,[]),s=js(r,[],i.renderingState),l=Cs.center(s);await i.animateGraph((()=>{for(const t of r){const e=Ts(t,i.renderingState),n={x:l.x-e.width/2,y:l.y-e.height/2},r=Ss.normalize(Ss.subtract(t.position,l));t.setPosition(Ss.add(n,Ss.scale(r,Math.min(e.width,e.height)/2)))}})),o.history.registerToUndo(a);const c=[...r].sort(((t,e)=>{const r=n.locale.formatEntityLabel(t.data,n.language),i=n.locale.formatEntityLabel(e.data,n.language);return r.localeCompare(i)})),u=n.group(c);i.renderingState.syncUpdate();const d=Ts(u,i.renderingState);return u.setPosition({x:l.x-d.width/2,y:l.y-d.height/2}),o.store(),u}async function Dc(t,e){const{model:n,performLayout:r}=t,{groups:i,canvas:o}=e,a=n.history.startBatch(Pi.text("workspace.ungroup_entities.command")),s=n.ungroupAll(i);return await r({canvas:o,selectedElements:new Set(s),animate:!0,zoomToFit:!1}),a.store(),s}async function Hc(t,e){const{model:n}=t,{group:r,entities:i,canvas:o}=e,a=n.history.startBatch(Pi.text("workspace.ungroup_entities.command")),s=n.ungroupSome(r,i);return o.renderingState.syncUpdate(),await o.animateGraph((()=>{a.history.execute(Js({target:r,elements:s.filter((t=>i.has(t.data.id))),graph:n,sizeProvider:o.renderingState}))})),a.store(),s}const Bc="reactodia-draggable-handle",Fc={nw:`${Bc}--dock-nw`,n:`${Bc}--dock-n`,ne:`${Bc}--dock-ne`,e:`${Bc}--dock-e`,se:`${Bc}--dock-se`,s:`${Bc}--dock-s`,sw:`${Bc}--dock-sw`,w:`${Bc}--dock-w`};function Uc(t){const{dock:e,axis:n="all",onBeginDragHandle:r,onDragHandle:i,onEndDragHandle:o,children:a,...s}=t,l=x.useRef(void 0),c=Wc(r),u=Wc(i),d=Wc(o);return P.jsx("div",{...s,className:lo(Bc,e?Fc[e]:void 0,s.className),onPointerDown:t=>{if(l.current)return;if(t.button)return;const{pageX:e,pageY:r,currentTarget:i,pointerId:o}=t;t.preventDefault();const a={origin:{pageX:e,pageY:r},target:i,onPointerMove:t=>{t.preventDefault();const{origin:e}=a;u.current(t,"y"===n?0:t.pageX-e.pageX,"x"===n?0:t.pageY-e.pageY)},onPointerUp:t=>{l.current=void 0;const{target:e}=a;e.releasePointerCapture(o),e.removeEventListener("pointermove",a.onPointerMove),e.removeEventListener("pointerup",a.onPointerUp),e.removeEventListener("pointercancel",a.onPointerUp),d.current?.(t)}};i.addEventListener("pointermove",a.onPointerMove),i.addEventListener("pointerup",a.onPointerUp),i.addEventListener("pointercancel",a.onPointerUp),i.setPointerCapture(o),c.current(t)},children:a})}function Wc(t){const e=x.useRef(t);return e.current=t,e}const qc="reactodia-dialog",Gc={width:300,height:320},Zc={width:250,height:250},Kc={width:800,height:800},Qc="e",Xc=40;class Yc extends x.Component{static contextType=ms;unsubscribeFromTarget=void 0;listener=new Ca;updateAll=()=>this.forceUpdate();startSize;constructor(t){super(t),this.state={}}componentDidMount(){const{canvas:t,model:e}=this.context;this.listener.listen(e.events,"changeLanguage",this.updateAll),this.listener.listen(t.events,"changeTransform",this.updateAll),this.listenToTarget(this.props.target),this.props.target&&this.focusOn()}componentDidUpdate(t){this.props.target!==t.target&&this.listenToTarget(this.props.target)}componentWillUnmount(){this.listener.stopListening(),this.listenToTarget(void 0)}listenToTarget(t){if(this.unsubscribeFromTarget&&(this.unsubscribeFromTarget(),this.unsubscribeFromTarget=void 0),t){const e=t.subscribe(this.updateAll,this.context);this.unsubscribeFromTarget=()=>{e()}}}calculatePosition(t){const{target:e,defaultSize:n=Gc,dock:r=Qc,dockMargin:i=Xc}=this.props,{canvas:o}=this.context;if(e){const a=e.getBounds(this.context);return function(t,e,n,r,i,o){let a,s;switch(n){case"w":a=t.x-o.width-r;break;case"e":a=e.x+r;break;default:a=(t.x+e.x-i.width)/2}switch(n){case"n":s=t.y-o.height-r;break;case"s":s=e.y+r;break;default:s=(t.y+e.y-i.height)/2}return{x:a,y:s}}(o.metrics.paperToScrollablePaneCoords(a.x,a.y),o.metrics.paperToScrollablePaneCoords(a.x+a.width,a.y+a.height),r,i,n,t)}}getViewPortScrollablePoints(){const{canvas:t}=this.context,{clientWidth:e,clientHeight:n}=t.metrics.pane;return{min:t.metrics.clientToScrollablePaneCoords(0,0),max:t.metrics.clientToScrollablePaneCoords(e,n)}}getDialogScrollableBounds(){const t=this.getCurrentSize(),{x:e,y:n}=this.calculatePosition(t)??{x:0,y:0},r={x:e-20,y:n-20};return{min:r,max:{x:r.x+t.width+40,y:r.y+t.height+40}}}focusOn(){const{canvas:t}=this.context,{min:e,max:n}=this.getViewPortScrollablePoints(),{min:r,max:i}=this.getDialogScrollableBounds();let o=0;r.x<e.x?o=r.x-e.x:i.x>n.x&&(o=i.x-n.x);let a=0;r.y<e.y?a=r.y-e.y:i.y>n.y&&(a=i.y-n.y);const s={x:e.x+(n.x-e.x)/2+o,y:e.y+(n.y-e.y)/2+a},l=t.metrics.scrollablePaneToPaperCoords(s.x,s.y);t.centerTo(l)}onStartDragging=()=>{const{defaultSize:t=Gc,maxSize:e=Kc}=this.props;this.startSize={x:Math.min(this.state.width||t.width,e.width),y:Math.min(this.state.height||t.height,e.height)}};calculateHeight(t){const{defaultSize:e=Gc,minSize:n=Zc,maxSize:r=Kc}=this.props,i=Math.min(e.height,n.height),o=Math.max(e.height,r.height);return Math.max(i,Math.min(o,t))}calculateWidth(t){const{defaultSize:e=Gc,minSize:n=Zc,maxSize:r=Kc}=this.props,i=Math.min(e.width,n.width),o=Math.max(e.width,r.width);return Math.max(i,Math.min(o,t))}onDragHandle=(t,e,n)=>{const{dock:r=Qc,mode:i}=this.props,o="centered"===i;let a=o?2:1,s=o?2:1;switch(r){case"n":s*=-1;break;case"w":a*=-1}const l=e?this.calculateWidth(this.startSize.x+e*a):void 0,c=n?this.calculateHeight(this.startSize.y+n*s):void 0;this.setState((t=>({width:l??t.width,height:c??t.height})))};render(){const{target:t,mode:e,dock:n=Qc,caption:r,resizableBy:i="all",closable:o=!0}=this.props,a="fillViewport"===e?"none":i,s=this.getCurrentSize(),l=this.calculatePosition(s),c={left:l?.x,top:l?.y,width:s.width,height:s.height};return P.jsxs("div",{className:lo(qc,t?"reactodia-dialog--attached":void 0,"fillViewport"===e?"reactodia-dialog--fill-viewport":void 0),role:"dialog","aria-labelledby":r?"reactodia-dialog-caption":void 0,style:c,children:[P.jsxs("div",{className:`${qc}__header`,children:[P.jsx("div",{id:"reactodia-dialog-caption",className:`${qc}__caption`,title:r,children:r}),o?P.jsx("button",{title:"Close",className:lo("reactodia-btn",`${qc}__close-button`),onClick:this.onClose}):null]}),this.props.children,"y"===a||"all"===a?P.jsx(Uc,{dock:"n"===n?"n":"s",axis:"y",onBeginDragHandle:this.onStartDragging,onDragHandle:this.onDragHandle,onEndDragHandle:this.onEndDragHandle}):null,"x"===a||"all"===a?P.jsx(Uc,{dock:"w"===n?"w":"e",axis:"x",onBeginDragHandle:this.onStartDragging,onDragHandle:this.onDragHandle,onEndDragHandle:this.onEndDragHandle}):null,"none"===a?null:P.jsx(Uc,{dock:"n"===n?"ne":"w"===n?"sw":"se",axis:a,onBeginDragHandle:this.onStartDragging,onDragHandle:this.onDragHandle,onEndDragHandle:this.onEndDragHandle})]})}getCurrentSize(){const{mode:t,defaultSize:e=Gc,maxSize:n=Kc}=this.props;return"fillViewport"===t?n:{width:Math.min(this.state.width??e.width,n.width),height:Math.min(this.state.height??e.height,n.height)}}onClose=()=>{const{canvas:t}=this.context,{onHide:e}=this.props;t.focus(),e()};onEndDragHandle=()=>{const{onResize:t}=this.props;if(!t)return;const{width:e,height:n}=this.getCurrentSize();!this.startSize||e===this.startSize.x&&n===this.startSize.y||t({width:e,height:n})}}const Jc=t=>({subscribe:(e,{canvas:n})=>{const r=new Ca;return r.listen(t.events,"changePosition",e),r.listen(n.renderingState.events,"changeElementSize",(n=>{n.source===t&&e()})),()=>r.stopListening()},getBounds:({canvas:e})=>Ts(t,e.renderingState)}),tu=t=>({subscribe:(e,{model:n,canvas:r})=>{const i=n.getElement(t.sourceId),o=n.getElement(t.targetId);if(!i||!o)throw new Error("Source and target are not specified");const a=new Ca;return a.listen(i.events,"changePosition",e),a.listen(o.events,"changePosition",e),a.listen(r.renderingState.events,"changeElementSize",(t=>{t.source!==i&&t.source!==o||e()})),a.listen(t.events,"changeVertices",e),a.listen(r.renderingState.events,"changeLinkLabelBounds",(n=>{n.source===t&&e()})),()=>a.stopListening()},getBounds:({model:e,canvas:n})=>{const r=n.renderingState.getLinkLabelBounds(t);if(r)return r;const i=e.getElement(t.sourceId),o=e.getElement(t.targetId);if(!i||!o)throw new Error("Source and target are not specified");const a=n.renderingState.getRouting(t.id),s=a?a.vertices:t.vertices||[],l=Is(n.renderingState.getElementShape(i),n.renderingState.getElementShape(o),s),c=Rs(l),{x:u,y:d}=Os(l,c/2);return{x:u,y:d,width:0,height:0}}}),eu="reactodia-viewport-dock",nu={n:`${eu}--row-n`,s:`${eu}--row-s`,w:`${eu}--column-w`,e:`${eu}--column-e`},ru={nw:`${eu}--dock-nw`,n:`${eu}--dock-n`,ne:`${eu}--dock-ne`,e:`${eu}--dock-e`,se:`${eu}--dock-se`,s:`${eu}--dock-s`,sw:`${eu}--dock-sw`,w:`${eu}--dock-w`},iu={nw:"start",n:"center",ne:"end",e:"end",se:"end",s:"center",sw:"start",w:"start"},ou={nw:"start",n:"start",ne:"start",e:"center",se:"end",s:"end",sw:"end",w:"center"};function au(t){const{dock:e,dockOffsetX:n=0,dockOffsetY:r=0,children:i}=t,o={"--reactodia-viewport-dock-offset-x":`${n}px`,"--reactodia-viewport-dock-offset-y":`${r}px`,"--reactodia-viewport-dock-align-x":iu[e],"--reactodia-viewport-dock-align-y":ou[e]};return P.jsx("div",{className:lo(eu,nu[e]??`${eu}--corner`),style:o,children:x.cloneElement(i,{className:lo(i.props.className,ru[e])})})}class su{listener=new Ca;source=new Ea;events=this.source;internalSource=new Ea;model;view;translation;dialogSettingsProvider;_openedDialog;_tasks=new Set;_taskError;constructor(t){const{model:e,view:n,translation:r,dialogSettingsProvider:i}=t;this.model=e,this.view=n,this.translation=r,this.dialogSettingsProvider=i,this[cu]={events:this.internalSource,overlays:new Set,dialog:null,spinner:null,onCanvasPointerUp:this.onAnyCanvasPointerUp,onCanvasKeydown:this.onAnyCanvasKeydown},this.listener.listen(this.model.events,"changeSelection",(()=>{this.openedDialog&&this.openedDialog.target!==(1===this.model.selection.length?this.model.selection[0]:void 0)&&this.hideDialog()})),this.listener.listen(this.model.events,"discardGraph",(()=>{this.openedDialog&&this.openedDialog.target&&this.hideDialog()}))}get openedDialog(){return this._openedDialog}dispose(){this.listener.stopListening()}onAnyCanvasPointerUp=t=>{const{source:e,sourceEvent:n,target:r,triggerAsClick:i}=t;n.ctrlKey||n.shiftKey||n.metaKey||this.openedDialog&&this.openedDialog.holdSelection||(r instanceof tl?(this.model.setSelection([r]),r.focus()):r instanceof nl?(this.model.setSelection([r]),e.focus()):r instanceof rl?(this.model.setSelection([r.link]),e.focus()):!r&&i&&(this.model.setSelection([]),this.hideDialog(),e.focus()))};onAnyCanvasKeydown=t=>{const{source:e,sourceEvent:n}=t;e.renderingState.triggerHotkey(n)};startTask(t={}){const{title:e,delay:n=0}=t;0===this._tasks.size&&this._taskError&&(this._taskError=void 0);const r=n>0&&0===this._tasks.size,i={title:e,setError:t=>{this._taskError={error:t}},end:()=>{this._tasks.delete(i),this.updateTaskSpinner()},[lu]:!r};return this._tasks.add(i),this.updateTaskSpinner(),r&&ka(n).then((()=>{if(this._tasks.has(i)){for(const t of this._tasks)t[lu]=!0;this.updateTaskSpinner()}})),i}showSpinnerWhile(t){const{translation:e}=this,n=this.startTask();(async()=>{try{await t}catch(t){console.error(t),n.setError(new Error(e.text("overlay_controller.unknown_error"),{cause:t}))}finally{n.end()}})()}updateTaskSpinner(){const{translation:t}=this;if(this._taskError){const t=function(t){if(t&&"object"==typeof t&&"message"in t){const e=t.message;if("string"==typeof e)return e}}(this._taskError.error);this.setSpinner({statusText:t,errorOccurred:!0})}else{let e,n=!1;for(const r of this._tasks)if(r[lu]&&(n=!0),r.title){if(void 0!==e){e=t.text("overlay_controller.multiple_tasks_in_progress");break}e=r.title}this.setSpinner(n?{statusText:e}:void 0)}}setSpinner(t){const e=this[cu],n=e.spinner;e.spinner=t?P.jsx(du,{spinnerProps:t}):null,this.internalSource.trigger("changeSpinner",{previous:n,source:this})}showDialog(t){const{target:e,style:n,dialogType:r,content:i,holdSelection:o=!1,onClose:a}=t;this._openedDialog&&this._openedDialog.target!==e&&this.hideDialog();const s=this._openedDialog,l={target:e,knownType:r,holdSelection:o,onClose:a};this._openedDialog=l;const c=this.view.findAnyCanvas(),u=function(t,e){for(const n of t){const t=e(n);if(void 0!==t)return t}}(this[cu].overlays,(t=>t.getDialogViewportBreakpoint())),d=Boolean(c&&void 0!==u&&c.metrics.pane.clientWidth<=u);let h=n;const f=this.dialogSettingsProvider.getDialogSize(l);f&&(h={...n,defaultSize:f.defaultSize??n.defaultSize,minSize:f.minSize??n.minSize,maxSize:f.maxSize??n.maxSize});const p=t=>{this.dialogSettingsProvider.persistDialogSize(l,t)},g=()=>this.hideDialog();this.setDialog(e&&!d?P.jsx(Bl,{layer:"overElements",children:P.jsx(Yc,{...h,target:e instanceof tl?Jc(e):e instanceof nl?tu(e):e,onResize:p,onHide:g,children:i})}):P.jsx(hu,{...h,mode:d?"fillViewport":"centered",onResize:p,onHide:g,children:i})),this.source.trigger("changeOpenedDialog",{source:this,previous:s})}hideDialog(){if(this._openedDialog){const t=this._openedDialog;this._openedDialog=void 0,t.onClose?.(),this.setDialog(null),this.source.trigger("changeOpenedDialog",{source:this,previous:t})}}setDialog(t){const e=this[cu],n=e.dialog;e.dialog=t,this.internalSource.trigger("changeDialog",{previous:n,source:this})}}const lu=Symbol("OverlayTask.active"),cu=Symbol("OverlayController.internalApi");function uu(t){const{overlay:e}=t,{canvas:n}=bs(),r=e[cu],{overlays:i,onCanvasPointerUp:o,onCanvasKeydown:a}=r,s=x.useRef(null);x.useLayoutEffect((()=>{const t=s.current;if(t){const e={getDialogViewportBreakpoint:()=>{const e=getComputedStyle(t);return e.maxWidth?parseFloat(e.maxWidth):void 0}};return i.add(e),()=>{i.delete(e)}}}),[i]),x.useEffect((()=>{const t=new Ca;return t.listen(n.events,"pointerUp",o),t.listen(n.events,"keydown",a),()=>t.stopListening()}),[o,a]);const l=$i(r.events,"changeDialog",(()=>r.dialog)),c=$i(r.events,"changeSpinner",(()=>r.spinner));return P.jsxs(P.Fragment,{children:[P.jsx("div",{ref:s,style:{display:"none",maxWidth:"var(--reactodia-dialog-viewport-breakpoint-s)"}}),l,c]})}function du(t){const{spinnerProps:e}=t,n=fu();return P.jsx("div",{className:"reactodia-loading-widget",children:P.jsx("svg",{width:n.width,height:n.height,children:P.jsx(Xi,{position:{x:e.statusText?n.width/3:n.width/2,y:n.height/2},...e})})})}function hu(t){const e=fu(),n=x.useRef(null),[r,i]=x.useState(0);x.useLayoutEffect((()=>{n.current&&i(function(t){const e=getComputedStyle(t).getPropertyValue("--reactodia-viewport-dock-margin");if(e){const t=parseFloat(e);if(Number.isFinite(t))return t}}(n.current)??0)}),[]);const o=x.useMemo((()=>({width:e.width-2*r,height:e.height-2*r})),[e,r]);return P.jsx("div",{ref:n,className:"reactodia-viewport-dialog-overlay",children:P.jsx(Yc,{...t,dock:"e",maxSize:o})})}function fu(){const{canvas:t}=bs();return zi(pl(Ti(t.events,"resize"),t.renderingState),(()=>{const{clientWidth:e,clientHeight:n}=t.metrics.pane;return{width:e,height:n}}),((t,e)=>t.width===e.width&&t.height===e.height))}class pu{lastDialogSize=new Map;getDialogSize(t){if(t.knownType){const e=this.lastDialogSize.get(t.knownType);if(e)return{defaultSize:e}}}persistDialogSize(t,e){t.knownType&&this.lastDialogSize.set(t.knownType,e)}}const gu="reactodia-fetch-status";function vu(t){const{type:e,target:n,children:r}=t,{model:i}=ao(),[o,a]=x.useState(i.getOperationFailReason(e,n)?2:0);return x.useEffect((()=>{const t=t=>{a((()=>{if(t&&mu(t.operation,e,n))return 2;for(const t of i.operations)if(mu(t,e,n))return 1;return i.getOperationFailReason(e,n)?2:0}))};t();const r=e=>{t(e.fail)};return i.events.on("changeOperations",r),()=>i.events.off("changeOperations",r)}),[e,n]),0===o?r:x.cloneElement(r,{className:lo(r.props.className,1===o?`${gu}--loading`:2===o?`${gu}--error`:void 0)})}function mu(t,e,n){return t.type===e&&t.targets.has(n)}function bu(t){const{link:e,className:n,path:r,pathProps:i,markerSource:o,markerTarget:a,children:s}=t,l=i?.stroke;return P.jsxs("g",{className:n,children:[P.jsx(Nl,{path:r,pathProps:{fill:"none",...i},markerSource:o,markerTarget:a}),0===e.vertices.length?null:P.jsx(Rl,{linkId:e.id,vertices:e.vertices,fill:l}),s]})}const wu="reactodia-group-paginator";function yu(t){const{pageIndex:e,pageCount:n,onChangePage:r,pageSize:i,pageSizes:o,onChangePageSize:a}=t,s=Oi(),l=n-1;return P.jsxs("div",{className:wu,children:[P.jsx("button",{type:"button",className:lo("reactodia-btn","reactodia-btn-default",`${wu}__previous`),name:s.text("group_paginator.go_previous.title"),disabled:e<=0,onClick:()=>r(e-1)}),P.jsx("div",{className:`${wu}__status`,children:s.text("group_paginator.current_page.label",{page:e+1,pageCount:n})}),P.jsx("button",{type:"button",className:lo("reactodia-btn","reactodia-btn-default",`${wu}__next`),title:s.text("group_paginator.go_next.title"),disabled:e>=l,onClick:()=>r(e+1)}),P.jsx("select",{className:`${wu}__page-size`,title:s.text("group_paginator.page_size.title"),value:i,onPointerDown:t=>t.stopPropagation(),onChange:t=>a(Number(t.currentTarget.value)),children:o.map((t=>P.jsx("option",{value:t,children:t},t)))})]})}function _u(t){const{className:e,style:n,text:r,setText:i,isEditing:o,setEditing:a}=t,s=x.useRef(null);return x.useLayoutEffect((()=>{const t=s.current;o&&t&&(t.focus(),window.getSelection()?.selectAllChildren(t))}),[o]),x.useLayoutEffect((()=>{const t=s.current;t&&(t.innerText=r||"\n")}),[r]),P.jsx("p",{ref:s,className:e,style:n,contentEditable:o?"plaintext-only":void 0,onPointerDown:t=>{o&&t.stopPropagation()},onKeyDown:t=>{o&&t.stopPropagation()},onKeyUp:t=>{o&&(t.stopPropagation(),"Escape"===t.key&&(document.getSelection()?.removeAllRanges(),s.current?.blur()))},onBlur:()=>{const t=(s.current?.innerText??"").trim();a(!1),i(t)}})}class ku{__commandsMarker;constructor(){}static define(){return new ku}}const xu=ku.define(),Su=ku.define(),Eu=ku.define(),Cu=ku.define(),Mu=ku.define(),Lu={canEdit:!1,canDelete:!1,onEdit:()=>{},onDelete:()=>{}};function $u(t,e){const{editor:n,getCommandBus:r}=ao(),i=n.inAuthoringMode?t:void 0,o=$i(n.events,"changeAuthoringState",(()=>i?n.authoringState.elements.get(i.id):void 0)),a=Ii({input:[n.metadataProvider,i,o,e],load:async([t,e,n,r],{signal:i})=>{if(t&&e&&r&&(!n||"entityDelete"!==n.type)){const{canEdit:n,canDelete:r}=await t.canModifyEntity(e,{signal:i});return(n?1:0)|(r?2:0)}return 0}}),s="completed"===a.status?a.data:void 0;return i?{editedIri:o&&"entityChange"===o.type?o.newIri:void 0,canEdit:void 0===s?void 0:Boolean(1&s),canDelete:void 0===s?void 0:Boolean(2&s),onEdit:t=>{t instanceof oc&&r(Mu).trigger("editEntity",{target:t})},onDelete:()=>{n.deleteEntity(i.id)}}:Lu}const Nu={renderElement:t=>t.element instanceof Wl?P.jsx(Tu,{...t}):t.element instanceof oc?P.jsx(Au,{...t}):null,supports:{[za.ColorVariant]:!0,[za.ElementSize]:!0}};function Tu(t){const{element:e,elementState:n}=t,{model:r}=bs(),i=n.get(za.AnnotationContent);return P.jsx(Iu,{...t,content:i,setContent:t=>{r.history.execute(Ls.compound(Pi.text("note_annotation.change_text.command"),[Ks(e,e.elementState.set(za.AnnotationContent,t))]))}})}function Au(t){const{element:e,textProperty:n="http://www.w3.org/ns/oa#bodyValue"}=t,{model:r,editor:i}=ao(),o=Oi(),a=e instanceof oc?e.data:void 0,s=$u(a,!0),l=x.useMemo((()=>{const t=a?.properties[n];if(t&&t.length>0){const e=o.selectValues(t,r.language).filter((t=>"Literal"===t.termType)).map((t=>t.value)).join("\n");return{type:"plaintext",text:e}}}),[a]);return P.jsx(Iu,{...t,readOnly:!0!==s.canEdit,content:l,setContent:t=>{a&&i.changeEntity(a.id,{...a,properties:{...a.properties,[n]:[r.factory.literal(t.text)]}})}})}const zu="reactodia-note-annotation";function Iu(t){const{element:e,elementState:n,onlySelected:r,readOnly:i,content:o,setContent:a}=t,{canvas:s,model:l}=bs(),[c,u]=x.useState(!1),d=n.get(za.ElementSize),h=n.get(za.ColorVariant),f=("plaintext"===o?.type?o:void 0)??{type:"plaintext",text:""};return P.jsxs(P.Fragment,{children:[P.jsx("div",{className:lo(zu,`${zu}--variant-${h??"default"}`,c?`${zu}--editing`:void 0),style:{width:d?.width,height:d?.height},onDoubleClick:async t=>{t.preventDefault(),t.stopPropagation(),i||(s.getScale()<1&&await s.centerTo(Cs.center(Ts(e,s.renderingState)),{scale:1,animate:!0}),u(!0))},children:P.jsx(_u,{className:`${zu}__editor`,style:f.style,text:f.text,setText:t=>{requestAnimationFrame((()=>a({...f,text:t})))},isEditing:c,setEditing:u})}),r&&P.jsx(kl,{target:e,children:P.jsx(Ru,{style:f.style,setStyle:t=>{a({...f,style:t})},variant:h,setVariant:t=>{l.history.execute(Ks(e,e.elementState.set(za.ColorVariant,t)))}})})]})}function Ru(t){const{style:e,setStyle:n,variant:r="default",setVariant:i}=t,o=Oi(),{fontStyle:a,fontWeight:s,textDecorationLine:l,textAlign:c="center"}=e??{},u={type:"button",onPointerDown:t=>t.stopPropagation()};return P.jsxs("div",{className:`${zu}__controls`,children:[P.jsxs("div",{className:"reactodia-btn-group reactodia-btn-group-xs",children:[P.jsx("button",{...u,className:lo(`${zu}__style-bold reactodia-btn reactodia-btn-default`,"bold"===s?"active":void 0),title:o.text("note_annotation.style_bold.title"),onClick:()=>n({...e,fontWeight:"bold"===s?void 0:"bold"})}),P.jsx("button",{...u,className:lo(`${zu}__style-italic reactodia-btn reactodia-btn-default`,"italic"===a?"active":void 0),title:o.text("note_annotation.style_italic.title"),onClick:()=>n({...e,fontStyle:"italic"===a?void 0:"italic"})}),P.jsx("button",{...u,className:lo(`${zu}__style-underline reactodia-btn reactodia-btn-default`,"underline"===l?"active":void 0),title:o.text("note_annotation.style_underline.title"),onClick:()=>n({...e,textDecorationLine:"underline"===l?void 0:"underline"})}),P.jsx("button",{...u,className:lo(`${zu}__style-strikethrough reactodia-btn reactodia-btn-default`,"line-through"===l?"active":void 0),title:o.text("note_annotation.style_strikethrough.title"),onClick:()=>n({...e,textDecorationLine:"line-through"===l?void 0:"line-through"})})]}),P.jsxs("div",{className:"reactodia-btn-group reactodia-btn-group-xs",children:[P.jsx("button",{...u,className:lo(`${zu}__align-left reactodia-btn reactodia-btn-default`,"left"===c?"active":void 0),title:o.text("note_annotation.style_align_left.title"),onClick:()=>n({...e,textAlign:"left"})}),P.jsx("button",{...u,className:lo(`${zu}__align-center reactodia-btn reactodia-btn-default`,"center"===c?"active":void 0),title:o.text("note_annotation.style_align_center.title"),onClick:()=>n({...e,textAlign:void 0})}),P.jsx("button",{...u,className:lo(`${zu}__align-right reactodia-btn reactodia-btn-default`,"right"===c?"active":void 0),title:o.text("note_annotation.style_align_right.title"),onClick:()=>n({...e,textAlign:"right"})})]}),P.jsx("div",{className:"reactodia-btn-group reactodia-btn-group-xs",children:Ra.map((t=>x.createElement("button",{...u,key:t,className:lo(`${zu}__variant-${t} reactodia-btn reactodia-btn-default`,r===t?"active":void 0),title:o.text("note_annotation.style_color_variant.title",{variant:t}),onClick:()=>i("default"===t?void 0:t)},P.jsx("div",{className:`${zu}__variant ${zu}--variant-${t}`}))))})]})}const Ou={markerTarget:{d:"M 6 1 a 5 5 0 1 0 0.0001 0 Z",width:12,height:12,fill:"context-stroke",stroke:"context-stroke",strokeWidth:2,fill:"var(--reactodia-canvas-background-color)"},renderLink:t=>t.link instanceof ql?P.jsx(Vu,{...t}):null},Pu="reactodia-note-link";function Vu(t){const{link:e,getPathPosition:n,route:r,primaryLabelProps:i}=t,{canvas:o}=bs(),{renameLinkProvider:a}=o.renderingState.shared,s=a?.getLabel(e),l=s??i?.children??(a?.canRename(e)?"":void 0);return P.jsx(bu,{...t,pathProps:{className:`${Pu}__path`},children:void 0===l?null:P.jsx(zl,{...i,primary:!0,textAnchor:r?.labelTextAnchor??i?.textAnchor,className:lo(`${Pu}__label`,i?.className),link:e,position:i?.position??n(.5),children:P.jsx("span",{children:l})})})}const ju={renderElement:t=>{const{element:e}=t;return e instanceof oc?P.jsx(Hu,{...t}):e instanceof ac?P.jsx(Uu,{...t}):null},supports:{[za.Expanded]:!0}},Du="reactodia-standard-element";function Hu(t){const{showActions:e,element:n,isExpanded:r,elementState:i}=t,{model:o,editor:a,getElementTypeStyle:s}=ao(),l=Oi(),c=n instanceof oc?n.data:void 0;ji(eo,c?c.types:[],o);const u=$u(c,r),{data:d}=Ii({input:[o.locale,c?o.locale.selectEntityImageUrl(c):void 0],load:([t,e],{signal:n})=>void 0===e?void 0:t.resolveAssetUrl(e,{signal:n})});if(!c)return null;const h=o.locale.formatEntityLabel(c,o.language),f=Zu(c,o,l),p=s(c.types),g={"--reactodia-element-style-color":p.color},v=(r?void 0:i.get(za.PinnedProperties))??{};return P.jsxs("div",{style:g,className:lo(Du,`${Du}--standalone`,Ku(c,a.authoringState)),onDoubleClick:t=>{t.preventDefault(),t.stopPropagation(),o.history.execute(Qs(n,!n.isExpanded))},children:[P.jsx("div",{className:`${Du}__main`,children:P.jsxs("div",{className:`${Du}__body`,children:[P.jsxs("div",{className:`${Du}__body-horizontal`,children:[P.jsx("div",void 0!==d?{className:`${Du}__thumbnail`,"aria-hidden":"true",children:P.jsx("img",{src:d,className:`${Du}__thumbnail-image`})}:p.icon?{className:`${Du}__thumbnail`,"aria-hidden":"true",children:P.jsx("img",{src:p.icon,className:lo(`${Du}__thumbnail-icon`,p.iconMonochrome?`${Du}__thumbnail-icon--monochrome`:void 0)})}:{className:`${Du}__thumbnail`,"aria-hidden":"true",children:f.length>0?f.charAt(0).toUpperCase():"✳"}),P.jsxs("div",{className:`${Du}__body-content`,children:[P.jsx("div",{title:f,className:`${Du}__type`,children:P.jsx("div",{className:`${Du}__type-value`,children:(m=c,0===m.types.length?l.text("standard_element.default_type"):m.types.map(((t,e)=>{const n=o.getElementType(t),r=l.formatLabel(n?.data?.label,t,o.language);return P.jsxs(x.Fragment,{children:[0===e?null:", ",P.jsx(vu,{type:"elementType",target:t,children:P.jsx("span",{children:r})})]},t)})))})}),P.jsx(vu,{type:"element",target:c.id,children:P.jsx("div",{className:`${Du}__label`,title:h,children:h})})]})]}),Gu(c,v)?P.jsx("div",{className:`${Du}__pinned-props`,children:P.jsx(Qu,{data:c,shouldInclude:t=>qu(t,v)})}):null]})}),r?P.jsxs("div",{className:`${Du}__dropdown`,children:[void 0===d?null:P.jsx("div",{className:`${Du}__photo`,children:P.jsx("img",{src:d,className:`${Du}__photo-image`})}),P.jsxs("div",{className:`${Du}__dropdown-content`,children:[function(t){const e=void 0===u.editedIri?t.id:u.editedIri;return P.jsxs("div",{children:[P.jsxs("div",{className:`${Du}__iri`,children:[P.jsx("div",{className:`${Du}__iri-key`,children:l.text(u.editedIri?"standard_element.iri.label_modified":"standard_element.iri.label")}),P.jsx("div",{className:`${Du}__iri-value`,children:Fi(e)?P.jsx("span",{children:l.text("standard_element.blank_node")}):P.jsx("a",{...o.locale.prepareAnchor(e),title:e,children:e})})]}),P.jsx("hr",{className:`${Du}__hr`})]})}(c),P.jsx(Qu,{data:c}),e&&a.inAuthoringMode?P.jsxs(P.Fragment,{children:[P.jsx("hr",{className:`${Du}__hr`,"data-reactodia-no-export":"true"}),P.jsx(Xu,{target:n,entityContext:u,translation:l})]}):null]})]}):null]});var m}const Bu=10,Fu=[5,10,15,20,30];function Uu(t){const{element:e,elementState:n,groupPageSize:r=Bu,groupPageSizes:i=Fu}=t,{canvas:o}=bs(),a=ao(),{getElementStyle:s}=a;if(!(e instanceof ac))return null;const l=e.items,{color:c}=s(e),u={"--reactodia-standard-group-color":c};let d=n.get(za.GroupPageSize)??r;d=Number.isFinite(d)?d:r;const h=Math.max(Math.ceil(l.length/d),1);let f=n.get(za.GroupPageIndex)??0;f=Number.isFinite(f)?f:0,f=Math.min(Math.max(f,0),h-1);const p=f*d,g=l.slice(p,Math.min(p+d,l.length)),v=1===h?0:p+d-l.length;return P.jsxs("div",{className:lo(Du,`${Du}--group`),style:u,role:"list",children:[g.map((n=>x.createElement(Wu,{...t,key:n.data.id,data:n.data,isExpanded:!1,target:e,canvas:o,workspace:a}))),Array.from({length:v},((t,e)=>P.jsx("div",{className:`${Du}__item-filler`,"aria-hidden":!0,children:" "},e))),P.jsx(yu,{pageIndex:f,pageCount:h,onChangePage:t=>e.setElementState(e.elementState.set(za.GroupPageIndex,t)),pageSize:d,pageSizes:i,onChangePageSize:t=>e.setElementState(e.elementState.set(za.GroupPageSize,t))})]})}function Wu(t){const{data:e,target:n,canvas:r,workspace:i}=t,o=Oi(),{model:a,editor:s,getElementTypeStyle:l}=i;ji(eo,e?e.types:[],a);const c=a.locale.formatEntityLabel(e,a.language),u=a.locale.formatIri(e.id),d=Zu(e,a,o),h=o.text("standard_element.group_item.title",{entity:c,entityIri:u,entityTypes:d}),f=Ku(e,s.authoringState),{color:p}=l(e.types),g={"--reactodia-element-style-color":p};return P.jsxs("div",{className:lo(`${Du}__item`,f),style:g,role:"listitem",children:[P.jsx("div",{className:`${Du}__item-stripe`,"aria-hidden":"true"}),P.jsxs("div",{className:`${Du}__item-body`,children:[P.jsx(vu,{type:"element",target:e.id,children:P.jsx("div",{className:`${Du}__label`,title:h,children:c})}),P.jsx("button",{type:"button",className:lo(`${Du}__ungroup-one-button`,"reactodia-btn reactodia-btn-default"),"data-reactodia-no-export":"true",title:o.text("standard_element.ungroup.title"),onClick:()=>{Hc(i,{group:n,entities:new Set([e.id]),canvas:r})}})]})]})}function qu(t,e){return Boolean(Object.prototype.hasOwnProperty.call(e,t)&&e[t])}function Gu(t,e){for(const n in t.properties)if(Object.prototype.hasOwnProperty.call(t.properties,n)&&qu(n,e))return!0;return!1}function Zu(t,e,n){return 0===t.types.length?n.text("standard_element.default_type"):e.locale.formatEntityTypeList(t,e.language)}function Ku(t,e){const n=e.elements.get(t.id);if(n)switch(n.type){case"entityAdd":return`${Du}--new`;case"entityChange":return`${Du}--changed`;case"entityDelete":return`${Du}--deleted`;default:return}}function Qu(t){const{data:e,shouldInclude:n}=t,{model:r}=ao(),i=Oi(),o=[];for(const t in e.properties)Object.prototype.hasOwnProperty.call(e.properties,t)&&e.properties[t].length>0&&(!n||n(t))&&o.push(t);if(ji(no,o,r),0===o.length)return P.jsx("div",{children:i.text("standard_element.no_properties")});const a=o.map((t=>{const n=r.getPropertyType(t),o=i.selectValues(e.properties[t],r.language);return{iri:t,label:i.formatLabel(n?.data?.label,t,r.language),values:0===o.length?e.properties[t]:o}}));return a.sort(((t,e)=>t.label.localeCompare(e.label))),P.jsx("div",{role:"list",className:`${Du}__properties`,children:a.map((({iri:t,label:e,values:n})=>P.jsxs("div",{role:"listitem",className:`${Du}__properties-row`,children:[P.jsx(vu,{type:"propertyType",target:t,children:P.jsx("div",{className:`${Du}__properties-key`,title:i.text("standard_element.property.title",{property:e,propertyIri:r.locale.formatIri(t)}),children:e})}),P.jsx("div",{className:`${Du}__properties-values`,children:n.map(((t,e)=>P.jsx("div",{className:`${Du}__properties-value`,title:t.value,lang:"Literal"===t.termType&&t.language?t.language:void 0,children:t.value},e)))})]},t)))})}function Xu(t){const{target:e,entityContext:{canEdit:n,canDelete:r,onEdit:i,onDelete:o},translation:a}=t;return P.jsxs("div",{className:`${Du}__actions`,"data-reactodia-no-export":"true",children:[P.jsx("button",{type:"button",className:lo(`${Du}__delete-button`,"reactodia-btn reactodia-btn-default"),title:a.text(r?"standard_element.delete.title":"standard_element.delete.title_disabled"),disabled:!r,onClick:o,children:void 0===r?P.jsx(Yi,{width:15,height:12}):a.text("standard_element.delete.label")}),P.jsx("button",{type:"button",className:lo(`${Du}__edit-button`,"reactodia-btn reactodia-btn-default"),title:a.text(n?"standard_element.edit.title":"standard_element.edit.title_disabled"),disabled:!n,onClick:()=>i(e),children:void 0===n?P.jsx(Yi,{width:15,height:12}):a.text("standard_element.edit.label")})]})}const Yu={markerTarget:{d:"M0,0 L0,8 L9,4 z",width:9,height:8,fill:"context-stroke"},renderLink:t=>P.jsx(nd,{...t})},Ju="reactodia-standard-link",td=`${Ju}__property`,ed=`${Ju}__label`;function nd(t){const{link:e,className:n,path:r,pathProps:i,markerSource:o,markerTarget:a,getPathPosition:s,route:l,primaryLabelProps:c,prependLabels:u=null,children:d}=t,{model:h,view:{renameLinkProvider:f}}=ao(),p=Oi();ji(ro,[e.typeId],h);const g=f?.getLabel(e);let v=null;if("visible"===h.getLinkVisibility(e.typeId)){const n=h.getLinkType(e.typeId),r=g??p.formatLabel(n?.data?.label,e.typeId,h.language);v=P.jsxs(P.Fragment,{children:[P.jsx(zl,{...c,primary:!0,textAnchor:l?.labelTextAnchor??c?.textAnchor,className:lo(ed,g?`${ed}--renamed`:void 0,c?.className),title:c?.title??p.text("standard_link.label.title",{relation:r,relationIri:h.locale.formatIri(e.typeId)}),link:e,position:s(.5),children:g?P.jsx("span",{children:r}):P.jsx(vu,{type:"linkType",target:e.typeId,children:P.jsx("span",{children:r})})}),u,e instanceof cc?P.jsx(rd,{...t}):null,e instanceof dc?P.jsxs(P.Fragment,{children:[P.jsx(zl,{className:`${Ju}__source-count`,link:e,position:s(.1),title:p.text("standard_link.group_source.title",{value:e.itemSources.size}),children:p.text("standard_link.group_source.value",{value:e.itemSources.size})}),P.jsx(zl,{className:`${Ju}__target-count`,link:e,position:s(.9),title:p.text("standard_link.group_target.title",{value:e.itemTargets.size}),children:p.text("standard_link.group_target.value",{value:e.itemTargets.size})})]}):null]})}const{linkState:m}=e,b=i?.stroke;return P.jsxs("g",{className:lo(Ju,e instanceof dc?`${Ju}--group`:void 0,n),children:[P.jsx(Nl,{path:r,pathProps:{fill:"none",...i,className:lo(`${Ju}__path`,i?.className),stroke:b,strokeDasharray:m.get(za.LayoutOnly)?"5,5":i?.strokeDasharray},markerSource:o,markerTarget:a}),v,0===e.vertices.length?null:P.jsx(Rl,{linkId:e.id,vertices:e.vertices,fill:b}),d]})}function rd(t){const{link:e,getPathPosition:n,route:r,propertyLabelProps:i,propertyLabelStartLine:o=1}=t,{model:a}=ao(),s=Oi(),{data:l}=e,c=[];for(const t in l.properties)Object.prototype.hasOwnProperty.call(l.properties,t)&&l.properties[t].length>0&&c.push(t);ji(no,c,a);const u=[];for(const t of c){const e=a.getPropertyType(t),n=s.selectValues(l.properties[t],a.language),r="function"==typeof i?i(t):i;null!==r&&u.push({iri:t,label:s.formatLabel(e?.data?.label,t,a.language),values:0===n.length?l.properties[t]:n,style:r})}return u.sort(((t,e)=>t.label.localeCompare(e.label))),P.jsx(P.Fragment,{children:u.map(((t,l)=>P.jsxs(zl,{...i,link:e,position:n(.5),line:o+l,textAnchor:r?.labelTextAnchor??t.style?.textAnchor,className:lo(td,t.style?.className),title:t.style?.title??s.text("standard_link.property.title",{property:t.label,propertyIri:a.locale.formatIri(t.iri)}),children:[P.jsx(vu,{type:"propertyType",target:t.iri,children:P.jsxs("span",{children:[t.label,": "]})}),t.values.map((t=>t.value)).join(", ")]},t.iri)))})}function id(t){const{canvas:e,model:n}=bs();return P.jsx(Bl,{layer:"overElements",children:P.jsx(sd,{...t,model:n,canvas:e})})}const od="reactodia-drag-link-mover",ad={allowed:!1,connect:()=>Promise.resolve(),moveSource:()=>Promise.resolve(),moveTarget:()=>Promise.resolve()};class sd extends x.Component{listener=new Ca;cancellation=new AbortController;canDropOnElementCancellation=new AbortController;temporaryLink;temporaryElement;oldLink;constructor(t){super(t),this.state={}}componentDidMount(){const{canvas:t,operation:e}=this.props;switch(this.cancellation=new AbortController,e.mode){case"connect":this.beginCreatingLink(e);break;case"moveSource":case"moveTarget":this.beginMovingLink(e);break;default:throw new Error(`Unknown edit mode: "${e.mode}"`)}this.forceUpdate(),this.queryCanConnectToAny(),this.listener.listen(t.events,"changeTransform",(()=>this.forceUpdate())),document.addEventListener("pointermove",this.onPointerMove),document.addEventListener("pointerup",this.onPointerUp),document.addEventListener("pointercancel",this.onPointerUp)}componentWillUnmount(){this.listener.stopListening(),this.cancellation.abort(),this.canDropOnElementCancellation.abort(),document.removeEventListener("pointermove",this.onPointerMove),document.removeEventListener("pointerup",this.onPointerUp),document.removeEventListener("pointercancel",this.onPointerUp),this.cleanup()}beginCreatingLink(t){const{createLink:e,model:n}=this.props,{source:r,point:i}=t,o=n.history.startBatch(),a=this.createTemporaryElement(i),s=e(r,a,void 0);o.discard(),this.temporaryElement=a,this.temporaryLink=s}beginMovingLink(t){const{createLink:e,model:n}=this.props,{link:r,point:i}=t,o=n.history.startBatch();this.oldLink=r,n.removeLink(r.id);const a=this.createTemporaryElement(i),s="moveSource"===t.mode?e(a,n.targetOf(r),r):e(n.sourceOf(r),a,r);o.discard(),this.temporaryElement=a,this.temporaryLink=s}createTemporaryElement(t){const{model:e}=this.props,n=new el({});return n.setPosition(t),e.addElement(n),n}onPointerMove=t=>{const{model:e,canvas:n}=this.props,{targetElement:r,waitingForMetadata:i}=this.state;if(t.preventDefault(),t.stopPropagation(),i)return;const o=n.metrics.pageToPaperCoords(t.pageX,t.pageY);this.temporaryElement.setPosition(o);const a=Vs(e.elements,o,n.renderingState);a!==r&&this.queryCanDropOnElement(a),this.setState({targetElement:a})};queryCanConnectToAny(){const{canConnect:t,model:e}=this.props;this.setState({anyConnection:void 0});const n=this.temporaryLink;_a(t(e.getElement(n.sourceId),n,void 0,this.cancellation.signal),this.cancellation.signal).then((t=>{null!==t&&this.setState({anyConnection:t})}),(t=>{console.error("Error calling canConnect() without target",t),this.setState({anyConnection:ad})}))}queryCanDropOnElement(t){const{operation:e,canConnect:n,model:r}=this.props;if(this.canDropOnElementCancellation.abort(),this.canDropOnElementCancellation=new AbortController,!t)return void this.setState({targetConnection:ad});this.setState({targetConnection:void 0});const i=this.temporaryLink;let o,a;switch(e.mode){case"connect":case"moveTarget":o=i?r.getElement(i.sourceId):void 0,a=t;break;case"moveSource":o=t,a=i?r.getElement(i.targetId):void 0}if(!(o&&a&&i))return void this.setState({targetConnection:ad});const s=this.canDropOnElementCancellation.signal;_a(n(o,i,a,s),s).then((t=>{null!==t&&this.setState({targetConnection:t})}),(t=>{console.error("Error calling canConnect() with target",t),this.setState({targetConnection:ad})}))}onPointerUp=t=>{const{canvas:e}=this.props;if(this.state.waitingForMetadata)return;this.setState({waitingForMetadata:!0});const n=e.metrics.pageToPaperCoords(t.pageX,t.pageY);this.executeEditOperation(n)};async executeEditOperation(t){const{operation:e,canvas:n,model:r}=this.props;try{const{targetElement:i,anyConnection:o,targetConnection:a}=this.state,s=r.history.startBatch(),l=this.restoreOldLink();s.discard();const c=i?a:o;if(c?.allowed)switch(e.mode){case"connect":await c.connect(e.source,i,t,n,this.cancellation.signal);break;case"moveSource":await c.moveSource(l,i,n,this.cancellation.signal);break;case"moveTarget":await c.moveTarget(l,i,n,this.cancellation.signal)}}finally{this.cleanupAndFinish()}}cleanupAndFinish(){const{onFinish:t}=this.props;this.cleanup(),t?.()}cleanup(){const{cleanupLink:t,model:e}=this.props,n=e.history.startBatch();e.removeElement(this.temporaryElement.id),e.removeLink(this.temporaryLink.id),t?.(this.temporaryLink),this.restoreOldLink(),n.discard(),this.setState({waitingForMetadata:!1})}restoreOldLink(){const{model:t}=this.props,e=this.oldLink;return this.oldLink=void 0,e&&t.addLink(e),e}render(){const{model:t,canvas:e}=this.props,{waitingForMetadata:n}=this.state;if(!this.temporaryLink)return null;const r=e.renderingState;return P.jsxs(ol,{paperTransform:e.metrics.transform,className:od,children:[P.jsx(Pl,{model:t,renderingState:r}),this.renderHighlight(),this.renderCanDropIndicator(),n?null:P.jsx(El,{model:t,renderingState:r,shouldRenderLink:t=>t===this.temporaryLink})]})}renderHighlight(){const{canvas:t}=this.props,{targetElement:e,targetConnection:n,waitingForMetadata:r}=this.state;if(!e)return null;const{x:i,y:o,width:a,height:s}=Ts(e,t.renderingState);return void 0===n||r?P.jsxs("g",{transform:`translate(${i},${o})`,children:[P.jsx("rect",{className:`${od}__highlight-overlay`,width:a,height:s}),P.jsx(Xi,{size:30,position:{x:a/2,y:s/2}})]}):P.jsx("rect",{className:n?.allowed?`${od}__highlight-allow`:`${od}__highlight-deny`,x:i,y:o,width:a,height:s})}renderCanDropIndicator(){const{targetElement:t,anyConnection:e,waitingForMetadata:n}=this.state;if(t)return null;const{x:r,y:i}=this.temporaryElement.position;let o;return o=void 0===e?P.jsx(Xi,{size:1.2,position:{x:.5,y:-.5}}):e?.allowed?P.jsx("path",{className:`${od}__drop-allow`,d:"M0.5,0 L0.5,-1 M0,-0.5 L1,-0.5",strokeWidth:.2}):P.jsxs("g",{className:`${od}__drop-deny`,children:[P.jsx("circle",{cx:"0.5",cy:"-0.5",r:"0.5",fill:"none",strokeWidth:.2}),P.jsx("path",{d:"M0.5,0 L0.5,-1",strokeWidth:.2,transform:"rotate(-45 0.5 -0.5)"})]}),P.jsxs("g",{transform:`translate(${r} ${i})scale(40)`,children:[P.jsx("rect",{className:`${od}__drop-underlay`,x:-.5,y:-.5,width:1,height:1,rx:.25,ry:.25}),n?P.jsx(Xi,{size:.8}):P.jsx("g",{transform:"translate(0.5, -0.5)scale(0.25)",children:o})]})}}function ld(t){const{operation:e,onFinish:n}=t,{model:r}=bs();return P.jsx(id,{operation:e,createLink:(t,e,n)=>{const i=new ql({sourceId:t.id,targetId:e.id,vertices:n?.vertices,linkState:n?.linkState});return r.addLink(i),i},canConnect:async(t,e,n)=>{const i=t instanceof Wl&&e instanceof ql&&void 0!==n&&!r.getElementLinks(t).some((e=>e instanceof ql&&e.sourceId===t.id&&e.targetId===n.id));return new cd(i,r)},onFinish:n})}class cd{constructor(t,e){this.allowed=t,this.model=e}async connect(t,e){e&&this.model.addLink(new ql({sourceId:t.id,targetId:e.id}))}async moveSource(t,e){const n=this.model.history.startBatch();this.model.removeLink(t.id);const r=new ql({id:t.id,sourceId:e.id,targetId:t.targetId,vertices:t.vertices,linkState:t.linkState});this.model.addLink(r),n.store(),this.model.setSelection([r])}async moveTarget(t,e){const n=this.model.history.startBatch();this.model.removeLink(t.id);const r=new ql({id:t.id,sourceId:t.sourceId,targetId:e.id,vertices:t.vertices,linkState:t.linkState});this.model.addLink(r),n.store(),this.model.setSelection([r])}}function ud(){const{getCommandBus:t}=ao(),{canvas:e,model:n}=bs(),[r,i]=x.useState(null);return x.useEffect((()=>{const r=t(xu),o=new Ca;return o.listen(r,"findCapabilities",(t=>{t.capabilities.push({})})),o.listen(r,"startDragOperation",(({operation:t})=>{i(P.jsx(ld,{operation:t,onFinish:()=>i(null)}))})),o.listen(r,"createAnnotation",(({targets:t,content:r,position:i})=>{const o=n.history.startBatch(),a=new Wl({elementState:r?Aa.empty.set(za.AnnotationContent,r):void 0});if(n.addElement(a),i)a.setPosition(i);else{const r=function(t,e){let n,r=0;for(const i of t){const t=Ts(i,e),o=Ss.length(Cs.center(t));o>=r&&(r=o,n=i)}return n}(t,e.renderingState);r&&(a.setPosition(r.position),e.renderingState.syncUpdate(),o.history.execute(Js({elements:[a],target:r,graph:n,sizeProvider:e.renderingState})))}for(const e of t)n.addLink(new ql({sourceId:a.id,targetId:e.id}));o.store(),e.renderingState.syncUpdate()})),()=>o.stopListening()}),[]),P.jsx(P.Fragment,{children:r})}const dd="reactodia-form";function hd(t){const{link:e,onFinish:n}=t,{view:{renameLinkProvider:r}}=ao(),i=Oi(),o=function(t){const{model:e}=ao(),n=Oi(),r=t instanceof cc||t instanceof dc?e.getLinkType(t.typeId):void 0,i=Ai(Ti(r?.events,"changeData"),(()=>r?.data?.label));return x.useMemo((()=>t instanceof cc||t instanceof dc?n.formatLabel(i,t.typeId,e.language):""),[t,i,e.language])}(e),[a,s]=x.useState(r?.getLabel(e)??o);return P.jsxs("div",{className:dd,children:[P.jsx("div",{className:`${dd}__body`,children:P.jsxs("div",{className:`${dd}__row`,children:[P.jsx("label",{children:i.text("visual_authoring.rename_link.label.label")}),P.jsx("input",{className:"reactodia-form-control",placeholder:o,autoFocus:!0,value:a,onChange:t=>s(t.target.value)})]})}),P.jsxs("div",{className:`${dd}__controls`,children:[P.jsx("button",{className:`reactodia-btn reactodia-btn-primary ${dd}__apply-button`,title:i.textOptional("visual_authoring.rename_link.dialog.apply.title")??i.text("visual_authoring.dialog.apply.title"),onClick:()=>{r&&r.setLabel(e,a),n()},children:i.textOptional("visual_authoring.rename_link.dialog.apply.label")??i.text("visual_authoring.dialog.apply.label")}),P.jsx("button",{className:"reactodia-btn reactodia-btn-secondary",title:i.text("visual_authoring.dialog.cancel.title"),onClick:n,children:i.text("visual_authoring.dialog.cancel.label")})]})]})}function fd(){const{overlay:t,getCommandBus:e}=ao(),n=Oi();return x.useLayoutEffect((()=>{const r=({target:e})=>{t.showDialog({target:e,dialogType:"reactodia:renameLink",style:{defaultSize:{width:300,height:165},resizableBy:"x",caption:n.text("visual_authoring.rename_link.dialog.caption")},content:P.jsx(hd,{link:e,onFinish:()=>t.hideDialog()})})},i=new Ca,o=e(xu);i.listen(o,"renameLink",r);const a=e(Mu);return i.listen(a,"renameLink",r),()=>i.stopListening()}),[]),null}const pd="reactodia-dropdown";function gd(t){const{className:e,direction:n="down",expanded:r,toggle:i,onClickOutside:o,children:a,...s}=t,l=x.useRef(null);return x.useLayoutEffect((()=>{if(o&&r){const t=t=>{t.target instanceof Node&&!l.current?.contains(t.target)&&o()};return document.body.addEventListener("pointerdown",t),()=>document.body.removeEventListener("pointerdown",t)}}),[o,r]),P.jsxs("div",{...s,ref:l,className:lo(e,pd,"down"===n?`${pd}--down`:`${pd}--up`,r?`${pd}--expanded`:`${pd}--collapsed`),children:["down"===n?i:null,P.jsx("div",{className:`${pd}__content`,"aria-hidden":!r,children:a}),"up"===n?i:null]})}const vd="reactodia-dropdown-menu";function md(t){const{className:e,direction:n,title:r,children:i,...o}=t,[a,s]=x.useState(!1),l=x.useMemo((()=>({expanded:a,setExpanded:s})),[a,s]),c=x.useCallback((()=>s(!1)),[s]);return P.jsx(bd.Provider,{value:l,children:P.jsx(gd,{...o,className:lo(e,vd),"aria-haspopup":"menu",direction:n,expanded:a,toggle:P.jsx(yd,{title:r}),onClickOutside:c,children:P.jsx("ul",{role:"menu",className:`${vd}__items`,children:i})})})}const bd=x.createContext(null);function wd(){const t=x.useContext(bd);if(!t)throw new Error("Missing Reactodia dropdown menu context");return t}function yd(t){const{title:e}=t,{expanded:n,setExpanded:r}=wd();return P.jsx("button",{type:"button",className:lo(`${vd}__toggle`,"reactodia-btn","reactodia-btn-default",n?"active":void 0),title:e,onClick:()=>r((t=>!t))})}const _d="reactodia-dropdown-menu-item";function kd(t){const{className:e,title:n,disabled:r,onSelect:i,children:o,...a}=t,s=wd(),l=x.useCallback((()=>{s?.setExpanded((()=>!1)),i?.()}),[i,s]);return P.jsx("li",{...a,role:"menuitem",className:lo(e,_d,r?`${_d}--disabled`:void 0,"reactodia-btn reactodia-btn-default"),title:n,onClick:r?void 0:l,children:o})}function xd(){const t=x.useContext(bd);return Boolean(t)}const Sd="reactodia-list-element-view";function Ed(t){const{element:e,className:n,highlightText:r,disabled:i,selected:o,onClick:a,onDragStart:s}=t,{model:l,getElementTypeStyle:c}=ao(),u=Oi();ji(eo,e.types,l);const{color:d}=c(e.types),{h,c:f,l:p}=oa(d),g=o&&!i?oa(h,f,1.2*p).toString():void 0,v=lo(Sd,o?`${Sd}--selected`:void 0,i?`${Sd}--disabled`:void 0,n),m={"--reactodia-element-style-color":d},b=l.locale.formatEntityLabel(e,l.language);return P.jsx("li",{className:v,role:"option",draggable:!i&&Boolean(s),title:Ld(e,l,u),style:m,onClick:t=>{!i&&a&&(t.persist(),a(t,e))},onDragStart:s,children:P.jsx("div",{className:`${Sd}__label`,style:{background:g},children:Md(b,r)})})}const Cd={className:"reactodia-text-highlight"};function Md(t,e,n=Cd){if(!e)return P.jsx("span",{children:t});const r=t.toLowerCase().indexOf(e.toLowerCase());if(r<0)return P.jsx("span",{children:t});const i=r+e.length,o=t.substring(0,r),a=t.substring(r,i),s=t.substring(i);return P.jsxs("span",{children:[o,P.jsx("span",{...n,children:a}),s]})}function Ld(t,e,n){const r=e.locale.formatIri(t.id),i=e.locale.formatEntityLabel(t,e.language),o=e.locale.formatEntityTypeList(t,e.language),a=n.text("inline_entity.title",{entity:i,entityIri:r,entityTypes:o}),s=n.text("inline_entity.title_extra",{entity:i,entityIri:r,entityTypes:o});return`${a}${s?`\n${s}`:""}`}const $d="reactodia-progress-bar";function Nd(t){const{state:e,title:n,percent:r=100,height:i=20}=t;return P.jsx("div",{className:`${$d} ${$d}--${e}`,style:{height:"loading"===e||"error"===e?i:0},children:P.jsx("div",{className:`${$d}__bar`,style:{width:`${r}%`},title:n,role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":r})})}const Td="reactodia-search-input";function Ad(t){const{className:e,inputProps:n={},store:r,children:i}=t,o=Oi(),a=$i(r.events,"changeValue",(()=>r.value)),s=$i(r.events,"changeMode",(()=>r.mode));return P.jsxs("div",{role:"search",className:lo(Td,"explicit"===s?`${Td}--has-submit`:void 0,e),children:[P.jsx("input",{...n,role:"searchbox",type:n.type??"text",className:lo(`${Td}__input`,"reactodia-form-control",n.className),placeholder:n.placeholder??o.text("search_defaults.input.placeholder"),value:a,onChange:t=>r.change({value:t.currentTarget.value,action:"input"}),onKeyUp:t=>{"Enter"===t.key&&r.change({value:r.value,action:"submit"})}}),r.value?P.jsx("div",{className:`${Td}__clear-container`,children:P.jsx("button",{type:"button",className:`${Td}__clear`,title:o.text("search_defaults.input_clear.title"),onClick:()=>r.change({value:"",action:"clear"}),children:P.jsx("span",{"aria-hidden":"true"})})}):null,"explicit"===s?P.jsx("button",{type:"button",title:o.text("search_defaults.input_submit.title"),className:lo(`${Td}__submit`,"reactodia-btn","reactodia-btn-default"),onClick:()=>r.change({value:r.value,action:"submit"})}):null,i]})}function zd(t){const{initialValue:e,submitTimeout:n="immediate",allowSubmit:r}=t,[i]=x.useState((()=>new Id(e)));return x.useEffect((()=>{i.setDebounceTimeout(n),i.setAllowSubmit(r)})),i}class Id{events=new Ea;_value;_mode="debounce";debouncer=new Ma(0);allowSubmit;constructor(t){this._value=t}get mode(){return this._mode}get value(){return this._value}setDebounceTimeout(t){switch(t){case"immediate":case"explicit":this.debouncer.setTimeout(0),this._mode=t;break;default:this.debouncer.setTimeout(t),this._mode="debounce"}}setAllowSubmit(t){this.allowSubmit=t}change(t){const{value:e,action:n}=t;if(this.debouncer.dispose(),e!==this._value||"input"!==n){const t=this._value;this._value=e,this.events.trigger("changeValue",{source:this,previous:t,action:n})}switch(n){case"input":"explicit"!==this._mode&&this.trySubmit(e,{debounce:"debounce"===this._mode});break;case"submit":this.trySubmit(e,{debounce:!1});break;case"clear":this.events.trigger("clearSearch",{source:this,value:e})}}trySubmit(t,e){!this.allowSubmit||this.allowSubmit(t)?e.debounce?this.debouncer.call((()=>this.events.trigger("executeSearch",{source:this,value:t}))):this.events.trigger("executeSearch",{source:this,value:t}):this.events.trigger("clearSearch",{source:this,value:t})}}function Rd(t){const e=ao();return P.jsx(Pd,{...t,workspace:e})}const Od=!0;class Pd extends x.Component{listener=new Ca;delayedChangeCells=new Ma;root;startSelection=0;endSelection=0;render(){const{items:t,footer:e,workspace:{model:n}}=this.props,r=Tc(n);return P.jsxs("ul",{ref:this.onRootMount,className:"reactodia-search-results",role:"listbox","aria-multiselectable":!0,tabIndex:-1,onFocus:this.addKeyListener,onBlur:this.removeKeyListener,children:[t.map((t=>this.renderResultItem(t,r))),e]})}onRootMount=t=>{this.root=t};renderResultItem(t,e){const{useDragAndDrop:n=Od}=this.props,r=this.canBeSelected(t,e);return P.jsx(Ed,{element:t,highlightText:this.props.highlightText,disabled:!r,selected:this.props.selection.has(t.id),onClick:r?this.onItemClick:void 0,onDragStart:n?e=>{const{selection:n}=this.props,r=[];return n.forEach((t=>r.push(t))),n.has(t.id)||r.push(t.id),function(t,e){try{t.dataTransfer.setData("application/x-reactodia-elements",JSON.stringify(e))}catch(n){t.dataTransfer.setData("text",JSON.stringify(e))}return!1}(e,r)}:void 0},t.id)}componentDidMount(){const{workspace:{model:t}}=this.props;this.listener.listen(t.events,"changeCells",(()=>{this.delayedChangeCells.call(this.onChangeCells)}))}onChangeCells=()=>{const{items:t,selection:e,workspace:{model:n}}=this.props;if(0===e.size)t.length>0&&this.forceUpdate();else{const t=new Set(e);for(const r of n.elements)r instanceof oc&&e.has(r.iri)&&t.delete(r.iri);this.updateSelection(t)}};componentWillUnmount(){this.removeKeyListener(),this.listener.stopListening(),this.delayedChangeCells.dispose()}updateSelection(t){const{onSelectionChanged:e}=this.props;e(t)}addKeyListener=()=>{document.addEventListener("keydown",this.onKeyDown)};removeKeyListener=()=>{document.removeEventListener("keydown",this.onKeyDown)};onKeyDown=t=>{const{items:e}=this.props,n=38===t.keyCode||38===t.which,r=40===t.keyCode||40===t.which;if(n||r)if(t.shiftKey){n?this.endSelection=this.getNextIndex(this.endSelection,0):r&&(this.endSelection=this.getNextIndex(this.endSelection,1));const t=Math.min(this.startSelection,this.endSelection),e=Math.max(this.startSelection,this.endSelection),i=this.selectRange(t,e);this.updateSelection(i),this.focusOn(this.endSelection)}else{const t=Math.min(this.startSelection,this.endSelection),i=Math.max(this.startSelection,this.endSelection);n?this.startSelection=this.getNextIndex(t,0):r&&(this.startSelection=this.getNextIndex(i,1)),this.endSelection=this.startSelection;const o=e[this.startSelection],a=new Set;a.add(o.id),this.updateSelection(a),this.focusOn(this.startSelection)}t.preventDefault()};onItemClick=(t,e)=>{t.preventDefault();const{items:n,selection:r,onSelectionChanged:i,singleSelectOnClick:o}=this.props,a=n.indexOf(e);let s;if(t.shiftKey&&-1!==this.startSelection){const t=Math.min(this.startSelection,a),e=Math.max(this.startSelection,a);s=this.selectRange(t,e)}else this.endSelection=this.startSelection=a,!o||t.ctrlKey||t.metaKey?(s=new Set(r),r.has(e.id)?s.delete(e.id):s.add(e.id)):(s=new Set,s.add(e.id));i(s)};selectRange(t,e){const{items:n,workspace:{model:r}}=this.props,i=Tc(r),o=new Set;for(let r=t;r<=e;r++){const t=n[r];this.canBeSelected(t,i)&&o.add(t.id)}return o}getNextIndex(t,e){const{items:n,workspace:{model:r}}=this.props;if(0===n.length)return t;const i=Tc(r),o=0===e?-1:1;for(let e=1;e<n.length;e++){let r=t+e*o;if(r<0&&(r+=n.length),r>=n.length&&(r-=n.length),this.canBeSelected(n[r],i))return r}return t}canBeSelected(t,e){const{useDragAndDrop:n=Od}=this.props;return!n||!e.has(t.id)}focusOn(t){const e=this.root.parentElement,n=e.getBoundingClientRect(),r=this.root.children.item(t),i=r.getBoundingClientRect(),o=i.top-n.top,a=i.bottom-n.top;o<0?e.scrollTop+=o:a>n.height&&(e.scrollTop+=a-n.height),r.focus()}}function Vd(t){const{className:e,hasQuery:n,minSearchTermLength:r=1,message:i}=t,o=Oi(),a=i??(n?o.text("search_defaults.no_results"):o.text(r<=1?"search_defaults.empty_input_term":"search_defaults.input_term_too_short",{termLength:r}));return P.jsx("div",{className:lo("reactodia-no-search-results",e),children:a})}const jd=(t,e)=>({...t,derived:e}),Dd=x.createContext(null),Hd="reactodia-class-tree-item";function Bd(t){const{node:e,...n}=t,{selectedNode:r,searchText:i,onSelect:o,creatableClasses:a,onClickCreate:s,onDragCreate:l,draggableItems:c}=function(){const t=x.useContext(Dd);if(!t)throw new Error("Reactodia: missing class tree context");return t}(),{getElementTypeStyle:u}=ao(),d=Oi(),[h,f]=x.useState(Boolean(i));x.useEffect((()=>{f(Boolean(i))}),[i]);const p=0===e.derived.length?`${Hd}__toggle`:h?`${Hd}__toggle-expanded`:`${Hd}__toggle-collapsed`,g=u([e.iri]),v={"--reactodia-element-style-color":g.color},m=Boolean(r&&r.iri===e.iri),b=lo(`${Hd}__body`,m?`${Hd}__body--selected`:void 0),w=Md(e.label,i,{className:`${Hd}__highlighted-term`});return P.jsxs("div",{className:Hd,style:v,role:"treeitem","aria-expanded":0===e.derived.length?void 0:h,"aria-selected":m,children:[P.jsxs("div",{className:`${Hd}__row`,children:[P.jsx("div",{className:p,onClick:()=>f((t=>!t)),role:"button"}),P.jsxs("a",{className:b,href:e.iri,onClick:t=>{t.preventDefault(),o(e)},draggable:c,children:[P.jsx("div",{className:`${Hd}__icon-container`,children:g.icon?P.jsx("img",{role:"presentation",className:lo(`${Hd}__icon`,g.iconMonochrome?`${Hd}__icon--monochrome`:void 0),src:g.icon}):P.jsx("div",{className:0===e.derived.length?`${Hd}__default-icon-leaf`:`${Hd}__default-icon-parent`})}),P.jsx("span",{className:`${Hd}__label`,children:w}),e.data?.count?P.jsx("span",{className:`${Hd}__count reactodia-badge`,children:e.data.count}):null]}),a.get(e.iri)?P.jsx("div",{role:"button",title:d.text("search_element_types.drag_create.title"),className:lo(`${Hd}__create-button`,"reactodia-btn reactodia-btn-default"),draggable:!0,onClick:()=>s(e),onDragStart:t=>{t.dataTransfer.setData("text",""),l(e)}}):null]}),h&&e.derived.length>0?P.jsx(Fd,{className:`${Hd}__children`,nodes:e.derived,...n}):null]})}function Fd(t){const{className:e,nodes:n,root:r,footer:i}=t;return P.jsxs("div",{className:e,role:r?"tree":void 0,children:[n.map((t=>P.jsx(Bd,{node:t},`node-${t.iri}`))),i]})}function Ud(t){const{searchStore:e,searchTimeout:n=200,minSearchTermLength:r=2}=t,i=zd({initialValue:"",submitTimeout:n,allowSubmit:t=>Zd(t).length>=r}),o=e??i,a=$i(o.events,"changeValue",(()=>Zd(o.value))),s=ao(),l=Oi();return P.jsx(Gd,{...t,isControlled:Boolean(e),searchStore:o,normalizedTerm:a,minSearchTermLength:r,workspace:s,translation:l})}const Wd="reactodia-class-tree",qd=new Map;class Gd extends x.Component{listener=new Ca;searchListener=new Ca;loadClassesOperation=new AbortController;refreshOperation=new AbortController;createElementCancellation=new AbortController;constructor(t){super(t),this.state={fetchedGraph:void 0,refreshingState:"none",roots:[],filteredRoots:[],appliedSearchText:"",constructibleClasses:new Map,showOnlyConstructible:!1}}render(){const{className:t,isControlled:e,searchStore:n,normalizedTerm:r,minSearchTermLength:i,draggableItems:o=!0,workspace:{editor:a},translation:s}=this.props,{fetchedGraph:l,refreshingState:c,appliedSearchText:u,roots:d,filteredRoots:h,selectedNode:f,constructibleClasses:p,showOnlyConstructible:g}=this.state,v=u?r:void 0;return P.jsxs("div",{className:lo(Wd,e?`${Wd}--controlled`:void 0,t),children:[P.jsx("div",{className:`${Wd}__filter`,children:P.jsxs("div",{className:`${Wd}__filter-group`,children:[e?null:P.jsx(Ad,{store:n,inputProps:{name:"reactodia-class-tree-filter",placeholder:s.textOptional("search_element_types.input.placeholder")}}),a.inAuthoringMode?P.jsxs("label",{className:`${Wd}__only-creatable`,children:[P.jsx("input",{type:"checkbox",name:"reactodia-class-tree-only-constructible",checked:g,onChange:this.onShowOnlyCreatableChange})," ",s.text("search_element_types.show_only_creatable")]}):null]})}),P.jsx(Nd,{state:c,title:s.text("search_element_types.refresh_progress.title")}),l?.classTree?P.jsx(Dd.Provider,{value:{searchText:v,selectedNode:f,onSelect:this.onSelectNode,creatableClasses:a.inAuthoringMode?p:qd,onClickCreate:this.onCreateInstance,onDragCreate:this.onDragCreate,draggableItems:o},children:P.jsx(Fd,{className:`${Wd}__tree reactodia-scrollable`,nodes:h,root:!0,footer:0===h.length?P.jsx(Vd,{className:`${Wd}__no-results`,hasQuery:h!==d,minSearchTermLength:i,message:0===d.length?s.text("search_element_types.no_results"):void 0}):null})}):P.jsx("div",{className:`${Wd}__spinner`,children:P.jsx(Yi,{width:30,height:30,errorOccurred:Boolean(l?.fetchError)})})]})}componentDidMount(){const{workspace:{model:t,editor:e}}=this.props;this.listener.listen(t.events,"changeLanguage",(()=>this.refreshClassTree())),this.listener.listen(t.events,"loadingStart",(()=>{this.initClassTree()})),this.listener.listen(e.events,"changeMode",(()=>this.refreshClassTree())),this.listenSearch(),this.initClassTree()}componentDidUpdate(t){this.props.searchStore.events!==t.searchStore.events&&this.listenSearch()}listenSearch(){const{searchStore:t}=this.props;this.searchListener.stopListening(),this.searchListener.listen(t.events,"executeSearch",(({value:t})=>{this.performSearch(t)})),this.searchListener.listen(t.events,"clearSearch",(()=>{this.performSearch("")}))}componentWillUnmount(){this.listener.stopListening(),this.searchListener.stopListening(),this.loadClassesOperation.abort(),this.refreshOperation.abort(),this.createElementCancellation.abort()}initClassTree(){const{workspace:{model:t}}=this.props,{fetchedGraph:e}=this.state,{dataProvider:n}=t;e&&e.dataProvider===n?this.refreshClassTree():n?this.setState({fetchedGraph:void 0},(()=>{this.fetchTypeGraph(n)})):this.refreshClassTree()}async fetchTypeGraph(t){const e=new AbortController;this.loadClassesOperation.abort(),this.loadClassesOperation=e;let n=null;try{n=await _a(t.knownElementTypes({signal:e.signal}),e.signal)}catch(e){return console.error(e),void this.setState({fetchedGraph:{dataProvider:t,fetchError:e}})}if(null===n)return;const r=function(t){const e=new Map;for(const n of t.elementTypes){const t={id:n.id,label:n.label,count:n.count,children:[]};e.set(t.id,t)}const n=new Map;for(const[e,r]of t.subtypeOf)_i(n,e,r);const r=[],i=new Set,o=new Set,a=t=>{if(o.has(t))return;i.add(t);const e=n.get(t);if(e)for(const n of e)i.has(n)?r.push([t,n]):a(n);i.delete(t)};for(const t of e.keys())a(t);for(const[t,e]of r){const r=n.get(t);r&&r.delete(e)}const s=[];for(const t of e.values()){const r=n.get(t.id);if(r&&0!==r.size)for(const n of r){const r=e.get(n);r&&r.children.push(t)}else s.push(t)}return s}(n);this.setState({fetchedGraph:{dataProvider:t,classTree:r}},(()=>{this.refreshClassTree()}))}performSearch=t=>{const e=Zd(t);this.setState((t=>Qd({...t,appliedSearchText:e})))};onShowOnlyCreatableChange=()=>{this.setState((t=>Qd({...t,showOnlyConstructible:!t.showOnlyConstructible})))};onSelectNode=t=>{const{workspace:{getCommandBus:e}}=this.props;this.setState({selectedNode:t},(()=>{e(Eu).trigger("setCriteria",{criteria:{elementType:t.iri}})}))};onCreateInstance=t=>{this.createInstanceAt(t.iri)};onDragCreate=t=>{const{workspace:{view:e}}=this.props;e.setHandlerForNextDropOnPaper((e=>{this.createInstanceAt(t.iri,e)}))};refreshClassTree=()=>{const t=new AbortController;let e;this.refreshOperation.abort(),this.refreshOperation=t,this.setState(((t,n)=>{const{workspace:{model:r,editor:i},translation:o}=n,a=t.fetchedGraph?.classTree;if(!a)return{refreshingState:"none"};let s="none";if(i.inAuthoringMode){const n=function(t,e){const n=new Set,r=e=>{t.has(e.id)||n.add(e.id),e.children.forEach(r)};return e.forEach(r),n}(t.constructibleClasses,a);n.size>0&&(s="loading",e=n)}const l=function(t,e,n){const r=t=>{const i=[];for(const o of t)i.push({iri:o.id,data:o,label:n.formatLabel(o.label,o.id,e.language),derived:r(o.children)});return i};return r(t)}(a,r,o);return Qd({...t,roots:Kd(l),refreshingState:s})}),(()=>{e&&this.queryCreatableTypes(e,t.signal)}))};async queryCreatableTypes(t,e){const{workspace:{editor:n}}=this.props,{metadataProvider:r}=n;if(r)try{const n=await _a(r.filterConstructibleTypes(t,{signal:e}),e);if(null===n)return;this.setState((e=>{const r=new Map(e.constructibleClasses);return t.forEach((t=>{r.set(t,n.has(t))})),Qd({...e,constructibleClasses:r,refreshingState:"completed"})}))}catch(t){console.error(t),this.setState((t=>Qd({...t,refreshingState:"error"})))}}async createInstanceAt(t,e){const{placeCreatedEntity:n,workspace:{model:r,view:i,editor:o,getCommandBus:a},translation:s}=this.props,l=r.history.startBatch();this.createElementCancellation.abort(),this.createElementCancellation=new AbortController;const c=this.createElementCancellation.signal,u=await _a(o.metadataProvider.createEntity(t,{translation:s,language:r.language,signal:c}),c);if(null===u)return;const d=o.createEntity(u.data);let h;if(u.elementState&&d.setElementState(u.elementState),e)h=[e.source,e.position];else{const t=i.findAnyCanvas();t&&(h=[t,Xd(t)])}if(h){const[t,e]=h;d.setPosition(e),t.renderingState.syncUpdate(),function(t,e,n){const r=n.getElementSize(t)??{width:0,height:0};t.setPosition({x:e.x-r.width/2,y:e.y-r.height/2})}(d,e,t.renderingState)}n&&await n(d,e),l.store(),r.setSelection([d]),a(Mu).trigger("editEntity",{target:d})}}function Zd(t){return t.trim().toLowerCase()}function Kd(t){function e(t){if(0===t.length)return t;const e=t.map(n);return e.sort(r),e}function n(t){return jd(t,e(t.derived))}function r(t,e){return t.label.localeCompare(e.label)}return e(t)}function Qd(t){let e=t.roots;return t.appliedSearchText&&(e=function(t,e){if(0===t.length)return t;const n=Da(e);return t.reduce((function t(e,r){const i=r.derived.reduce(t,[]);return(i.length>0||n(r.label))&&e.push(jd(r,i)),e}),[])}(e,t.appliedSearchText)),t.showOnlyConstructible&&(n=t.constructibleClasses,e=e.reduce((function t(e,r){const i=r.derived.reduce(t,[]);return(i.length>0||n.get(r.iri))&&e.push(jd(r,i)),e}),[])),{...t,filteredRoots:e};var n}function Xd(t){const e=t.metrics.pane;return t.metrics.clientToPaperCoords(e.clientWidth/2,e.clientHeight/2)}const Yd="reactodia-paper";class Jd extends x.Component{rootRef=x.createRef();paneRef=x.createRef();resizeObserver;viewportAnimation;movingState;metrics;constructor(t){var e;super(t),this.state={paneRef:this.paneRef,contentBounds:this.props.contentBounds,pageSize:this.props.pageSize,transform:(e=this.props.pageSize,{width:e.width,height:e.height,originX:0,originY:0,scale:1,paddingX:0,paddingY:0}),mounted:!1},this.resizeObserver=new ResizeObserver(this.onResize),this.metrics=new class extends th{constructor(t){super(),this.paper=t}get pane(){return this.paper.pane??nh}get transform(){return this.paper.state.transform}getClientRect(){return this.paper.pane?.getBoundingClientRect()??rh}}(this)}get root(){return this.rootRef.current}get pane(){return this.paneRef.current}render(){const{className:t,style:e,showScrollbars:n,panOnTouch:r=!0,onContextMenu:i,onKeyDown:o,onKeyUp:a,renderLayers:s,watermark:l,children:c}=this.props,{transform:u,mounted:d}=this.state,{width:h,height:f,scale:p,paddingX:g,paddingY:v}=u,m={width:h*p+g,height:f*p+v,marginLeft:g,marginTop:v,paddingRight:g,paddingBottom:v};return P.jsxs("div",{ref:this.rootRef,className:lo(Yd,t,r?`${Yd}--pan-on-touch`:void 0,n?void 0:`${Yd}--hide-scrollbars`),style:e,tabIndex:0,onKeyDown:o,onKeyUp:a,children:[P.jsxs("div",{className:`${Yd}__pane`,ref:this.paneRef,onPointerDown:this.onAreaPointerDown,children:[P.jsx("div",{className:`${Yd}__layers`,style:m,onPointerDown:this.onPointerDown,onContextMenu:i,onScrollCapture:this.onScrollCapture,children:d?s(u):null}),l]}),d?c:void 0]})}componentDidMount(){const t=this.pane;t.addEventListener("dragover",this.onDragOver),t.addEventListener("drop",this.onDragDrop),t.addEventListener("scroll",this.onScrollPassive,{passive:!0}),t.addEventListener("wheel",this.onWheel,{passive:!1}),this.resizeObserver.observe(t),this.setState({mounted:!0})}static getDerivedStateFromProps(t,e){const n=e.paneRef.current;if(n&&(!Cs.equals(t.contentBounds,e.contentBounds)||t.pageSize.width!==e.pageSize.width||t.pageSize.height!==e.pageSize.height)){const{clientWidth:r,clientHeight:i}=n,o=function(t,e,n,r){const i=t.x,o=t.y,a=t.x+t.width,s=t.y+t.height,{width:l,height:c}=n,u=Math.floor(i/l),d=Math.floor(o/c),h=Math.ceil(a/l),f=Math.ceil(s/c);return{width:Math.max(h-u,1)*l,height:Math.max(f-d,1)*c,originX:-u*l,originY:-d*c,paddingX:Math.ceil(e.width),paddingY:Math.ceil(e.height),scale:r}}(t.contentBounds,{width:r,height:i},t.pageSize,e.transform.scale);return al(e.transform,o)?null:{...e,contentBounds:t.contentBounds,pageSize:t.pageSize,transform:o}}return null}getSnapshotBeforeUpdate(t,e){const{contentBounds:n,pageSize:r}=this.props,{paneRef:i,transform:o}=this.state,a=i.current,s=Cs.equals(n,t.contentBounds)&&r.width===t.pageSize.width&&r.height===t.pageSize.height;let l;return!a||s||al(o,e.transform)||(l={left:a.scrollLeft,top:a.scrollTop}),{scroll:l}}componentDidUpdate(t,e,n){const r=this.state.paneRef.current;if(r&&n.scroll){const{scale:t,originX:i,originY:o,paddingX:a,paddingY:s}=this.state.transform,l=e.transform,c=n.scroll.top+((o-l.originY)*t+(s-l.paddingY));r.scrollLeft=n.scroll.left+((i-l.originX)*t+(a-l.paddingX)),r.scrollTop=c}al(this.state.transform,e.transform)||this.props.onChangeTransform?.(e.transform)}componentWillUnmount(){const t=this.pane;this.stopListeningToPointerMove(),t.removeEventListener("dragover",this.onDragOver),t.removeEventListener("drop",this.onDragDrop),t.removeEventListener("scroll",this.onScrollPassive),t.removeEventListener("wheel",this.onWheel),this.resizeObserver.disconnect()}onAreaPointerDown=t=>{t.target===this.pane&&this.onPointerDown(t)};onPointerDown=t=>{if(this.movingState)return void this.handleMultiPointerDown(t);const e=this.props.onPointerOperation?.(t);if(!e)return;let n;if("move"!==e.action&&"mouse"!==t.pointerType||t.preventDefault(),"panning"===e.action){const{scrollLeft:t,scrollTop:e}=this.pane;n={scrollLeft:t,scrollTop:e},function(){if(document.getSelection){const t=document.getSelection();t?.removeAllRanges?.()}}()}const{pageX:r,pageY:i}=t;this.movingState={operation:e,pointers:new Map,pointerMoved:!1,originPointerId:t.pointerId,origin:{pageX:r,pageY:i},panningOrigin:n,pinchOrigin:void 0},this.handleMultiPointerDown(t),document.addEventListener("pointermove",this.onPointerMove),document.addEventListener("pointerup",this.onPointerUp),"mouse"!==t.pointerType&&document.addEventListener("pointercancel",this.onPointerCancel),e.onPointerDown(t)};handleMultiPointerDown(t){if(!this.movingState)return;const{pointers:e}=this.movingState;e.set(t.pointerId,{x:t.pageX,y:t.pageY}),this.movingState.pinchOrigin||2!==e.size||(t.preventDefault(),this.movingState.pinchOrigin={pointers:new Map(e),metrics:this.metrics.snapshot()})}onPointerMove=t=>{if(!this.movingState)return;const{origin:e,operation:n,panningOrigin:r}=this.movingState,i=t.pageX-e.pageX,o=t.pageY-e.pageY;if(t.isPrimary&&Math.abs(i)>=1&&Math.abs(o)>=1&&(this.movingState.pointerMoved=!0),this.handleMultiPointerMove(t));else{if(t.preventDefault(),r){const t=this.pane;t.classList.add(`${Yd}--panning`),t.scrollLeft=r.scrollLeft-i,t.scrollTop=r.scrollTop-o}n.onPointerMove(t)}};handleMultiPointerMove(t){if(!this.movingState)return!1;const{pointers:e,pinchOrigin:n}=this.movingState;if(e.set(t.pointerId,{x:t.pageX,y:t.pageY}),!n)return!1;const[[r,i],[o,a]]=n.pointers,s=e.get(r),l=e.get(o);if(!s||!l)return!1;const c=Ss.scale(Ss.add(s,l),.5),u=Ss.scale(Ss.add(i,a),.5),d=Ss.length(Ss.subtract(l,s))/Math.max(Ss.length(Ss.subtract(a,i)),1),h=n.metrics,f=h.clientToPaperCoords(h.pane.clientWidth/2,h.pane.clientHeight/2),p=h.pageToPaperCoords(c.x,c.y),g=h.pageToPaperCoords(u.x,u.y),v=Ss.add(g,Ss.scale(Ss.subtract(f,p),1/d));return this.centerViewport(v,{scale:h.transform.scale*d}),!0}onPointerUp=t=>{if(this.movingState){const{originPointerId:e,pointers:n,pinchOrigin:r}=this.movingState;n.delete(t.pointerId),(t.pointerId===e||r&&n.size<2)&&this.stopListeningToPointerMove(t)}};onPointerCancel=()=>{this.stopListeningToPointerMove()};onScrollCapture=t=>{this.movingState?.operation.hasSameTarget(t)&&this.stopListeningToPointerMove()};stopListeningToPointerMove=t=>{const e=this.movingState;if(this.movingState=void 0,e){this.pane.classList.remove(`${Yd}--panning`),document.removeEventListener("pointermove",this.onPointerMove),document.removeEventListener("pointerup",this.onPointerUp),document.removeEventListener("pointercancel",this.onPointerCancel);const{operation:n,pointerMoved:r,pinchOrigin:i}=e;t&&!i?n.onPointerUp(t,{triggerAsClick:!r}):n.onPointerCancel(t)}};onWheel=t=>{const{wheelToScaleDelta:e}=this.props.scaleDefaults,n=e(t);if(void 0!==n){t.preventDefault();const e=this.metrics.pageToPaperCoords(t.pageX,t.pageY);this.setScale(this.scale+n,{pivot:e})}};onResize=()=>{this.props.onResize?.()};centerViewport(t,e){if("number"==typeof e.scale){const{min:n,max:r}=this.props.scaleDefaults;let i=e.scale;return i=Math.max(i,n),i=Math.min(i,r),this.setViewportState({center:t,scale:{x:i,y:i}},e)}return this.setViewportState({center:t},e)}get scale(){return this.state.transform.scale}setScale(t,e){let n=t;const{min:r,max:i}=this.props.scaleDefaults;let o;if(n=Math.max(n,r),n=Math.min(n,i),e&&e.pivot){const{x:t,y:r}=e.pivot,i=this.pane,a=this.metrics.clientToPaperCoords(i.clientWidth/2,i.clientHeight/2),s=n/this.state.transform.scale;o={center:{x:t-(t-a.x)/s,y:r-(r-a.y)/s},scale:{x:n,y:n}}}else o={scale:{x:n,y:n}};return this.setViewportState(o,e)}scaleToFitRect(t,e={}){const{clientWidth:n,clientHeight:r}=this.pane;if(0===t.width)return Promise.resolve();const{min:i,maxFit:o}=this.props.scaleDefaults,{width:a}=Ns(t,n,r);let s=a/t.width;return s=Math.max(s,i),s=Math.min(s,o),this.setViewportState({center:{x:t.x+t.width/2,y:t.y+t.height/2},scale:{x:s,y:s}},e)}onDragOver=t=>{const e=ih(this.pane,t),n=this.props.onDragOver?.(t,e);n?t.preventDefault():t.dataTransfer&&(t.dataTransfer.dropEffect="none")};onDragDrop=t=>{const e=ih(this.pane,t);this.props.onDragDrop?.(t,e)};onScrollPassive=t=>{this.props.onScrollPassive?.(t)};get viewportState(){const t=this.pane,{clientWidth:e,clientHeight:n,scrollLeft:r,scrollTop:i}=t,{originX:o,originY:a,paddingX:s,paddingY:l,scale:c}=this.state.transform;return{center:{x:(r+e/2-s)/c-o,y:(i+n/2-l)/c-a},scale:{x:c,y:c}}}setViewportState(t,e){this.viewportAnimation&&this.viewportAnimation.cancellation.abort();const n=this.viewportState,r={...n,...t};if(e&&(e.animate||e.duration&&e.duration>0)){const t={from:n,to:r,cancellation:new AbortController},s=(i="number"==typeof e.duration?e.duration:this.props.viewportDefaults.duration,o=t=>{const e=function(t){return t<0?0:t>1?1:t*t*(3-2*t)}(t);this.applyViewportState({center:{x:n.center.x+(r.center.x-n.center.x)*e,y:n.center.y+(r.center.y-n.center.y)*e},scale:{x:n.scale.x+(r.scale.x-n.scale.x)*e,y:n.scale.y+(r.scale.y-n.scale.y)*e}})},a=t.cancellation.signal,new Promise((t=>{let e,n,r;const s=l=>{if(a&&a.aborted)return;n=n||l;let c=l-n;c>i&&(c=i),o(c/i),c<i?e=requestAnimationFrame(s):(r?.(),t())};if(a){const n=()=>{cancelAnimationFrame(e),r?.(),t()};r=()=>{a.removeEventListener("abort",n)},a.addEventListener("abort",n)}e=requestAnimationFrame(s)})));return this.viewportAnimation=t,s.then((()=>{this.viewportAnimation=void 0}))}return this.applyViewportState(r),Promise.resolve();var i,o,a}applyViewportState(t){const e=t.scale.x,n=t.center;this.setState((t=>({transform:{...t.transform,scale:e}})),(()=>{const t=this.pane,{originX:r,originY:i,paddingX:o,paddingY:a}=this.state.transform,s=(n.x+r)*e,l=(n.y+i)*e,{clientWidth:c,clientHeight:u}=t;t.scrollLeft=s-c/2+o,t.scrollTop=l-u/2+a}))}}class th{get area(){return this.pane}snapshot(){const{clientWidth:t,clientHeight:e,offsetWidth:n,offsetHeight:r,scrollLeft:i,scrollTop:o}=this.pane,{left:a,right:s,top:l,bottom:c}=this.getClientRect();return new eh({clientWidth:t,clientHeight:e,offsetWidth:n,offsetHeight:r,scrollLeft:i,scrollTop:o},{left:a,right:s,top:l,bottom:c},this.transform)}getTransform(){return this.transform}getPaperSize(){const{width:t,height:e,scale:n}=this.transform;return{width:t/n,height:e/n}}getViewportPageRect(){const{left:t,right:e,top:n,bottom:r}=this.getClientRect();return{x:t+window.scrollX,y:n+window.scrollY,width:e-t,height:r-n}}pageToPaperCoords(t,e){const{left:n,top:r}=this.getClientRect();return this.clientToPaperCoords(t-(n+window.scrollX),e-(r+window.scrollY))}paperToPageCoords(t,e){const{x:n,y:r}=this.paperToScrollablePaneCoords(t,e),{x:i,y:o}=this.scrollablePaneToClientCoords(n,r),{left:a,top:s}=this.getClientRect();return{x:i+(a+window.scrollX),y:o+(s+window.scrollY)}}clientToPaperCoords(t,e){const{x:n,y:r}=this.clientToScrollablePaneCoords(t,e);return this.scrollablePaneToPaperCoords(n,r)}clientToScrollablePaneCoords(t,e){const{paddingX:n,paddingY:r}=this.transform,{scrollLeft:i,scrollTop:o}=this.pane;return{x:t+i-n,y:e+o-r}}scrollablePaneToClientCoords(t,e){const{paddingX:n,paddingY:r}=this.transform,{scrollLeft:i,scrollTop:o}=this.pane;return{x:t-i+n,y:e-o+r}}scrollablePaneToPaperCoords(t,e){return ll({x:t,y:e},this.transform)}paperToScrollablePaneCoords(t,e){return sl({x:t,y:e},this.transform)}}class eh extends th{constructor(t,e,n){super(),this.pane=t,this.clientRect=e,this.transform=n}getClientRect(){return this.clientRect}snapshot(){return this}}const nh={clientWidth:0,clientHeight:0,offsetWidth:0,offsetHeight:0,scrollLeft:0,scrollTop:0},rh={left:0,right:0,top:0,bottom:0};function ih(t,e){const n=(e.target instanceof SVGElement&&null!==e.target.ownerSVGElement?e.target.ownerSVGElement:e.target).getBoundingClientRect(),r=t.getBoundingClientRect();return{x:e.offsetX+(n.left-r.left),y:e.offsetY+(n.top-r.top)}}const oh="http://www.w3.org/2000/svg";async function ah(t){const{colorSchemeApi:e,contentBox:n,watermarkSvg:r,preserveDimensions:i,convertImagesToDataUris:o,removeByCssSelectors:a=[]}=t;let s,l;e.actInColorScheme("light",(()=>{s=function(t,e){const n=document.createElementNS(oh,"svg"),r=document.createElementNS(oh,"g");r.setAttribute("class","reactodia-exported-canvas"),n.appendChild(r);const i=Object.create(null);for(const n of t)if(n instanceof SVGSVGElement){const t=ch(n.cloneNode(!0));t.removeAttribute("transform"),r.appendChild(t)}else if(n instanceof HTMLElement){const t=n.cloneNode(!0);t.classList.add("reactodia-exported-layer"),t.setAttribute("style",`transform: translate(${-e.x}px,${-e.y}px)`);const o=document.createElementNS(oh,"foreignObject");o.appendChild(t),o.setAttribute("transform",`translate(${e.x},${e.y})`),o.setAttribute("width",String(e.width)),o.setAttribute("height",String(e.height));const a=document.createElementNS(oh,"g");a.appendChild(o),r.appendChild(a);const s=t.querySelectorAll("img");let l=0;for(const t of n.querySelectorAll("img")){const e=l;l++;const n=`export-key-${e}`;s[e].setAttribute("export-key",n),i[n]={width:t.clientWidth,height:t.clientHeight}}}return{composedSvg:n,imageBounds:i}}(t.layers,n);const e=new Set;var r;r=e,uh((t=>{for(let e=0;e<t.style.length;e++){const n=t.style[e];n.startsWith("--")&&!r.has(n)&&r.add(n)}})),function(t,e){const n=t=>{if(t instanceof HTMLElement)for(let n=0;n<t.style.length;n++){const r=t.style[n];r.startsWith("--")&&!e.has(r)&&e.add(r)}};dh(t,n);let r=t.parentElement;for(;r;)n(r),r=r.parentElement}(s.composedSvg,e),l=function(t,e){const n=new Map,r=getComputedStyle(t);for(const t of r)if(t.startsWith("--")){const e=r.getPropertyValue(t);n.set(t,e)}for(const t of e)if(!n.has(t)){const e=r.getPropertyValue(t);void 0!==e&&n.set(t,e)}return n}(t.styleRoot,e)}));const{composedSvg:c,imageBounds:u}=s;for(const t of a)for(const e of c.querySelectorAll(t))e.remove();const d=function(t){const e=[];return uh((n=>{const r=n.selectorText.replace(/::[a-zA-Z-]+$/,"");t.querySelector(r)&&e.push(n)})),e}(c),h=new Map;o&&(function(t,e){for(const n of t.querySelectorAll("img"))n.src&&!e.has(n.src)&&e.set(n.src,null)}(c,h),function(t,e){for(const n of t){const t=sh(n.style.getPropertyValue("mask-image"));t&&!e.has(t)&&e.set(t,null);const r=sh(n.style.getPropertyValue("background-image"));r&&!e.has(r)&&e.set(r,null)}}(d,h),function(t,e){dh(t,(t=>{if(t instanceof HTMLElement){const n=sh(t.style.maskImage);n&&!e.has(n)&&e.set(n,null);const r=sh(t.style.backgroundImage);r&&!e.has(r)&&e.set(r,null)}}))}(c,h)),i?(c.setAttribute("width",String(n.width)),c.setAttribute("height",String(n.height))):(c.setAttribute("width","100%"),c.setAttribute("height","100%")),c.setAttribute("viewBox",`${n.x} ${n.y} ${n.width} ${n.height}`),r&&function(t,e,n){const r=document.createElementNS(oh,"image");r.setAttributeNS("http://www.w3.org/1999/xlink","href",n),r.setAttribute("class","reactodia-exported-watermark");const i=Math.min(.2*e.width,120),o=e.y+20;r.setAttribute("x",(e.x+e.width-i-20).toString()),r.setAttribute("y",o.toString()),r.setAttribute("width",i.toString()),r.setAttribute("opacity","0.3"),t.insertBefore(r,t.firstChild)}(c,n,r),await async function(t){await Promise.all(Array.from(t.keys(),(async e=>{if(!e.startsWith("data:"))try{const n=await async function(t){if(!t||t.startsWith("data:"))return t;const e=t.match(/\.([a-zA-Z0-9]+)[^.a-zA-Z0-9]?[^.]*$/),n=e?e[1].toLowerCase():void 0;if("svg"===n)try{const e=await fetch(t);if(e.ok){const t=await e.text();if(t.length>0)return"data:image/svg+xml,"+encodeURIComponent(t.replace(/\r\n/g,"\n"))}}catch(t){}const r=await function(t){const e=new Image;e.crossOrigin="anonymous";const n=new Promise(((t,n)=>{e.onload=()=>t(e),e.onerror=t=>n(t)}));return e.src=t,n}(t),i=document.createElement("canvas");i.width=r.width,i.height=r.height,i.getContext("2d").drawImage(r,0,0);try{return i.toDataURL("image/"+("jpg"===n?"jpeg":"png"))}catch(e){throw new Error(`Failed to convert image to data URI: ${t}`,{cause:e})}}(e);n&&"data:image/svg+xml,"!==n&&t.set(e,n)}catch(t){console.warn("Reactodia: Failed to export image: "+e,t)}})))}(h);for(const t of c.querySelectorAll("img")){const e=t.getAttribute("export-key");if(t.removeAttribute("export-key"),e){const{width:n,height:r}=u[e];t.setAttribute("width",n.toString()),t.setAttribute("height",r.toString());const i=h.get(t.src);i&&(t.src=i)}}!function(t,e){dh(t,(t=>{if(t instanceof HTMLElement){const n=sh(t.style.maskImage),r=n?e.get(n):void 0;r&&(t.style.maskImage=lh(r));const i=sh(t.style.backgroundImage),o=i?e.get(i):void 0;o&&(t.style.backgroundImage=lh(o))}}))}(c,h);const f=document.createElementNS("http://www.w3.org/2000/svg","defs");return f.innerHTML=`<style>${function(t){const e=[":root {\n"];for(const[n,r]of t)e.push(" ",n,": ",r,";\n");return e.push("}\n"),e.join("")}(l)}</style>\n<style>${function(t,e){const n=t.map((t=>t.cssText)),r=document.createElement("style");document.body.appendChild(r);const i=r.sheet;try{for(let r=0;r<t.length;r++){const o=t[r],a=sh(o.style.getPropertyValue("mask-image")),s=a?e.get(a):void 0,l=sh(o.style.getPropertyValue("background-image")),c=l?e.get(l):void 0;if(i&&(s||c)){i.insertRule(o.cssText);const t=i.cssRules[0];t instanceof CSSStyleRule&&(s&&t.style.setProperty("mask-image",lh(s)),c&&t.style.setProperty("background-image",lh(c)),n[r]=t.cssText),i.deleteRule(0)}}}finally{document.body.removeChild(r)}return n.join("\n")}(d,h)}</style>`,c.insertBefore(f,c.firstChild),c}function sh(t){if(t){const e=t.trim();let n=/^url\(\s*'(.*)'\s*\)$/i.exec(e);if(n)return n[1];if(n=/^url\(\s*"(.*)"\s*\)$/i.exec(e),n)return n[1]}}function lh(t){return`url("${t}")`}function ch(t){let e=t.firstChild;for(;e;){if(e instanceof SVGGElement)return e;e=e.nextSibling}}function uh(t){const e=new WeakSet,n=r=>{if(!e.has(r))if(e.add(r),r instanceof CSSStyleRule)t(r);else if(r instanceof CSSLayerBlockRule)for(const t of r.cssRules)n(t)};for(let t=0;t<document.styleSheets.length;t++){let e;try{const n=document.styleSheets[t];if(e=n.cssRules||n.rules,!e)continue}catch(t){continue}for(const t of e)n(t)}}function dh(t,e){const n=new WeakSet,r=t=>{if(!n.has(t)){n.add(t),e(t);for(const e of t.children)r(e)}};r(t)}const hh={width:8192,height:8192};const fh="reactodia-canvas-area",ph={width:1500,height:800},gh={duration:500};function vh(t){const{model:e,renderingState:n,zoomOptions:r,showScrollBars:i,watermarkSvg:o,watermarkUrl:a,children:s}=t,l=x.useContext(Sa),c=x.useRef(null),u=x.useRef(null),d=x.useRef(null),h=x.useRef(null),[f]=x.useState((()=>function(){const t={underlay:document.createElement("div"),overLinkGeometry:document.createElement("div"),overLinks:document.createElement("div"),overElements:document.createElement("div")};for(const e of Object.values(t))e.style.display="contents";return{containers:t}}())),p=x.useMemo((()=>function(t={}){return{min:t.min??.2,max:t.max??2,maxFit:t.maxFit??1,step:t.step??.1,fitPadding:t.fitPadding??20,requireCtrl:t.requireCtrl??!1}}(r)),[r]),[g,v]=x.useState({x:0,y:0,width:0,height:0}),[m,b]=x.useState("panning"),[w,y]=x.useState({count:0}),_={colorSchemeApi:l,graphAnimations:w,watermarkSvg:o,zoomOptions:p},[k]=x.useState((()=>new mh(e,n,_,{setContentBounds:v,setPointerMode:b,setGraphAnimations:y},c,u,d,h)));x.useEffect((()=>k.setProvidedState(_)));const S=x.useMemo((()=>({canvas:k,model:e})),[e,k]),E=x.useMemo((()=>({min:p.min,max:p.max,maxFit:p.maxFit,wheelToScaleDelta:k.getWheelToScaleDelta})),[p]);x.useLayoutEffect((()=>(k.centerTo(),()=>k.stopListening())),[]);const C={"--reactodia-canvas-animation-duration":void 0===w.duration?void 0:`${w.duration}ms`};return P.jsx(ms.Provider,{value:S,children:P.jsx(Jd,{ref:c,className:lo(fh,w.count>0?`${fh}--animated`:void 0),style:C,panOnTouch:"panning"===m,showScrollbars:i,scaleDefaults:E,viewportDefaults:gh,onChangeTransform:k.onChangeTransform,onContextMenu:k.onContextMenu,onDragOver:k.onDragOver,onDragDrop:k.onDragDrop,onKeyDown:k.onKeyDown,onKeyUp:k.onKeyUp,onPointerOperation:k.onPointerOperation,onResize:k.onResize,onScrollPassive:k.onScrollPassive,pageSize:ph,contentBounds:g,renderLayers:t=>P.jsxs(P.Fragment,{children:[P.jsx(Hl,{layer:"underlay",context:f,className:`${fh}__widgets`}),P.jsxs(ol,{layerRef:u,className:`${fh}__linkGeometry`,style:{overflow:"visible"},paperTransform:t,role:"figure",children:[P.jsx(Pl,{model:e,renderingState:n}),P.jsx(El,{model:e,renderingState:n})]}),P.jsx(Hl,{layer:"overLinkGeometry",context:f,className:`${fh}__widgets`}),P.jsx(Tl,{renderingState:n,paperTransform:t,layerRef:d}),P.jsx(Hl,{layer:"overLinks",context:f,className:`${fh}__widgets`}),P.jsx(gl,{layerRef:h,model:e,renderingState:n,paperTransform:t}),P.jsx(Hl,{layer:"overElements",context:f,className:`${fh}__widgets`})]}),watermark:o?P.jsx("a",{href:a,target:"_blank",rel:"noreferrer",children:P.jsx("img",{className:`${fh}__watermark`,src:o,draggable:!1})}):null,children:P.jsx(Dl.Provider,{value:f,children:s})})})}class mh{constructor(t,e,n,r,i,o,a,s){this.model=t,this.renderingState=e,this.state=n,this.setters=r,this._paper=i,this.linkLayer=o,this.labelLayer=a,this.elementLayer=s;const l=()=>{e.scheduleOnLayerUpdate(ul.PaperArea,this.updateContentBounds)};this.listener.listen(t.events,"changeCells",l),this.listener.listen(t.events,"elementEvent",(({data:t})=>{t.changePosition&&l()})),this.listener.listen(t.events,"linkEvent",(({data:t})=>{t.changeVertices&&l()})),this.listener.listen(e.events,"changeElementSize",l),this.listener.listen(e.shared.events,"findCanvas",(t=>{t.canvases.push(this)}))}listener=new Ca;source=new Ea;events=this.source;_contentBounds={x:0,y:0,width:0,height:0};_pointerMode="panning";get paper(){const t=this._paper.current;if(!t)throw new Error("Reactodia: canvas paper is not initialized yet");return t}stopListening(){this.listener.stopListening()}setProvidedState(t){this.state=t}onChangeTransform=t=>{this.source.trigger("changeTransform",{previous:t,source:this}),this.paper.metrics.transform.scale!==t.scale&&this.source.trigger("changeScale",{previous:t.scale,source:this})};onContextMenu=t=>{if(!this.isEventFromCellLayer(t))return;const e=bh(t.target,t.currentTarget,this.model);this.source.trigger("contextMenu",{source:this,sourceEvent:t,target:e})};onDragOver=(t,e)=>{if(this.renderingState.shared.hasHandlerForNextDropOnPaper())return t.dataTransfer&&(t.dataTransfer.dropEffect="move"),!0;{const{x:n,y:r}=e,i=this.metrics.clientToPaperCoords(n,r);let o=!1;return this.source.trigger("dragover",{source:this,sourceEvent:t,position:i,allowDrop:()=>{o=!0}}),o}};onDragDrop=(t,e)=>{const{x:n,y:r}=e,i={source:this,sourceEvent:t,position:this.metrics.clientToPaperCoords(n,r)};this.renderingState.shared.tryHandleDropOnPaper(i)||this.source.trigger("drop",i)};onKeyDown=t=>{this.isEventFromCellLayer(t)&&this.source.trigger("keydown",{source:this,sourceEvent:t})};onKeyUp=t=>{this.isEventFromCellLayer(t)&&this.source.trigger("keyup",{source:this,sourceEvent:t})};onPointerOperation=t=>{if(0!==t.button)return;let e,n=!1,r=!1,i=!1;const o=bh(t.target,t.currentTarget,this.model);if(o)if(o instanceof tl){const{x:n,y:r}=this.metrics.pageToPaperCoords(t.pageX,t.pageY),{x:i,y:a}=o.position;e={pointerX:n,pointerY:r,elementX:i,elementY:a}}else(o instanceof nl||o instanceof rl)&&(i=!0);else n=this.shouldStartPanning(t),r=!n&&"selection"===this._pointerMode;const a=qs.capture(this.model),s=this.model.history.startBatch(a.title),l={target:o,restoreGeometry:a,batch:s,panning:n,moveElement:e};return{action:n?"panning":r||e||i?"move":void 0,hasSameTarget:t=>{const e=bh(t.target,t.currentTarget,this.model);return void 0!==e&&e===o},onPointerDown:t=>{this.source.trigger("pointerDown",{source:this,sourceEvent:t,target:o,panning:n})},onPointerMove:t=>this.onPointerMove(t,l),onPointerUp:(t,e)=>this.onPointerUp(t,e,l),onPointerCancel:()=>{l.batch.discard()}}};shouldStartPanning(t){return"mouse"===t.pointerType&&t.shiftKey===("selection"===this._pointerMode)&&!(t.ctrlKey||t.altKey)}onPointerMove(t,e){const{target:n,panning:r,moveElement:i}=e;if(n){if(n instanceof tl){if(i){const{x:e,y:o}=this.metrics.pageToPaperCoords(t.pageX,t.pageY),{pointerX:a,pointerY:s,elementX:l,elementY:c}=i;n.setPosition({x:l+e-a,y:c+o-s}),this.source.trigger("pointerMove",{source:this,sourceEvent:t,target:n,panning:r})}}else if(n instanceof nl){const r=this.metrics.pageToPaperCoords(t.pageX,t.pageY),i=this.generateLinkVertex(n,r);i.createAt(r),e.target=i}else if(n instanceof rl){const e=this.metrics.pageToPaperCoords(t.pageX,t.pageY);n.moveTo(e),this.source.trigger("pointerMove",{source:this,sourceEvent:t,target:n,panning:r})}}else this.source.trigger("pointerMove",{source:this,sourceEvent:t,target:n,panning:r})}generateLinkVertex(t,e){const{model:n,renderingState:r}=this,i=t.vertices,o=i?[...i]:[],a=n.getElement(t.sourceId),s=n.getElement(t.targetId),l=function(t,e){let n=1/0,r=0;for(let i=0;i<t.length-1;i++){const o=t[i],a=t[i+1],s={x:e.x-o.x,y:e.y-o.y},l={x:a.x-o.x,y:a.y-o.y},c=Ss.length(l),u=Ss.dot(s,l)/c;if(u<0||u>c)continue;const d=Math.abs(Ss.cross2D(s,l))/c;d<n&&(n=d,r=i)}return r}(Is(r.getElementShape(a),r.getElementShape(s),o),e);return new rl(t,l)}onPointerUp(t,e,n){const{triggerAsClick:r}=e,{target:i,restoreGeometry:o,batch:a,panning:s}=n;this.source.trigger("pointerUp",{source:this,sourceEvent:t,target:i,panning:s,triggerAsClick:r});const l=o.filterOutUnchanged();l.hasChanges()&&a.history.registerToUndo(l),a.store()}onResize=()=>{this.source.trigger("resize",{source:this})};onScrollPassive=t=>{this.isEventFromCellLayer(t)&&this.source.trigger("scroll",{source:this,sourceEvent:t})};getWheelToScaleDelta=t=>this.shouldZoom(t)?function(t,e=.1){return-1*Math.max(-1,Math.min(1,t.deltaY||t.deltaX))*e}(t):void 0;shouldZoom(t){const{requireCtrl:e}=this.zoomOptions,n=t.target;return e?t.ctrlKey:!!t.ctrlKey||this.isEventFromCellLayer(t)&&n instanceof Node&&(this.paper.root===n||this.paper.pane===n||this.paper.pane?.firstChild===n||!wh(n,this.linkLayer.current)&&!wh(n,this.labelLayer.current)&&!wh(n,this.elementLayer.current))}get metrics(){return this.paper.metrics}get pointerMode(){return this._pointerMode}setPointerMode(t){const e=this._pointerMode;e!==t&&(this._pointerMode=t,this.setters.setPointerMode(t),this.source.trigger("changePointerMode",{source:this,previous:e}))}get zoomOptions(){return this.state.zoomOptions}updateContentBounds=()=>{const{elements:t,links:e}=this.model;this._contentBounds=js(t,e,this.renderingState),this.setters.setContentBounds(this._contentBounds)};isEventFromCellLayer(t){const e=t.target;return e instanceof Node&&Boolean(this.paper.root===e||this.paper.pane===e||this.paper.pane?.firstChild===e||this.linkLayer.current?.contains(e)||this.labelLayer.current?.contains(e)||this.elementLayer.current?.contains(e))}focus(){this.paper.root?.focus({preventScroll:!0})}async centerTo(t,e={}){await this.renderingState.updateLayersUpTo(ul.PaperArea);const{width:n,height:r}=this.paper.metrics.transform;return this.paper.centerViewport(t||{x:n/2,y:r/2},e)}async centerContent(t={}){await this.renderingState.updateLayersUpTo(ul.PaperArea);const e=this._contentBounds;return this.centerTo({x:e.x+e.width/2,y:e.y+e.height/2},t)}getScale(){return this.paper.scale}setScale(t,e){return this.paper.setScale(t,e)}zoomBy(t,e){return this.setScale(this.getScale()+t,e)}zoomIn(t){return this.zoomBy(this.state.zoomOptions.step,t)}zoomOut(t){return this.zoomBy(-this.state.zoomOptions.step,t)}async zoomToFit(t={}){const{model:e,renderingState:n}=this,{elements:r,links:i}=e;if(0===r.length)return this.centerTo();await this.renderingState.updateLayersUpTo(ul.PaperArea);const o=js(r,i,n);return this.zoomToFitRect(o,t)}zoomToFitRect(t,e){const{fitPadding:n}=this.state.zoomOptions;return this.paper.scaleToFitRect({x:t.x-n,y:t.y-n,width:t.width+n,height:t.height+n},e)}makeToSVGOptions(t){const e=this._contentBounds,{contentPadding:n={x:100,y:100},removeByCssSelectors:r=[]}=t,i=this.linkLayer.current,o=this.labelLayer.current,a=this.elementLayer.current;if(!(i&&o&&a))throw new Error("Cannot find element, link or label layers to export");return{colorSchemeApi:this.state.colorSchemeApi,styleRoot:i,contentBox:{x:e.x-n.x,y:e.y-n.y,width:e.width+2*n.x,height:e.height+2*n.y},layers:[i,o,a],preserveDimensions:!0,convertImagesToDataUris:!0,removeByCssSelectors:["[data-reactodia-no-export]",...r],watermarkSvg:this.state.watermarkSvg}}exportSvg(t={}){return function(t){return ah(t).then((e=>{const n=(new XMLSerializer).serializeToString(e);return t.addXmlHeader?'<?xml version="1.0" encoding="UTF-8"?>'+n:n}))}(this.makeToSVGOptions(t))}exportRaster(t={}){return async function(t){const{mimeType:e="image/png",maxFallbackSize:n=hh}=t,r={...t,convertImagesToDataUris:!0,preserveDimensions:!0},i=await ah(r),o={width:Number(i.getAttribute("width")),height:Number(i.getAttribute("height"))},a="number"==typeof t.width||"number"==typeof t.height?{width:t.width,height:t.height}:function(t,e){const n=Math.min(e.width/t.width,e.height/t.height),r=Math.min(2,n);return{width:Math.floor(t.width*r),height:Math.floor(t.height*r)}}(o,n),{innerSize:s,outerSize:l,offset:c}=function(t,e){const n=Ns(t,e.width,e.height),r={width:Math.floor(n.width),height:Math.floor(n.height)},i={width:"number"==typeof e.width?e.width:r.width,height:"number"==typeof e.height?e.height:r.height};return{innerSize:r,outerSize:i,offset:{x:Math.round((i.width-r.width)/2),y:Math.round((i.height-r.height)/2)}}}(o,a);i.setAttribute("width",s.width.toString()),i.setAttribute("height",s.height.toString());const u=(new XMLSerializer).serializeToString(i),{canvas:d,context:h}=function(t,e,n){const r=document.createElement("canvas");r.width=t,r.height=e;const i=r.getContext("2d");return n&&(i.fillStyle=n,i.fillRect(0,0,t,e)),{canvas:r,context:i}}(l.width,l.height,t.backgroundColor),f=await(p="data:image/svg+xml,"+encodeURIComponent(u),new Promise(((t,e)=>{const n=new Image;n.onload=function(){t(n)},n.onerror=function(t){e(t)},n.src=p})));var p;return h.drawImage(f,c.x,c.y,s.width,s.height),d.toDataURL(e,t.quality)}({...t,...this.makeToSVGOptions(t)})}isAnimatingGraph(){return this.state.graphAnimations.count>0}animateGraph(t,e){const n="number"==typeof e?e:gh.duration;return this.changeGraphAnimationCount(1,n),t(),ka(n).then((()=>this.changeGraphAnimationCount(-1)))}changeGraphAnimationCount(t,e){const n=this.isAnimatingGraph();co.flushSync((()=>{this.setters.setGraphAnimations((n=>({count:n.count+t,duration:e??n.duration})))})),this.isAnimatingGraph()!==n&&this.source.trigger("changeAnimatingGraph",{source:this,previous:n})}}function bh(t,e,n){if(!(t instanceof globalThis.Element))return;let r,i=t;for(;;){if(i instanceof globalThis.Element){if(i.hasAttribute("data-element-id"))return n.getElement(i.getAttribute("data-element-id"));if(i.hasAttribute("data-link-id")){const t=n.getLink(i.getAttribute("data-link-id"));if(!t)return;return"number"==typeof r?new rl(t,r):t}i.hasAttribute("data-vertex")&&(r=Number(i.getAttribute("data-vertex")))}if(!i||i===e)break;i=i.parentNode}}function wh(t,e){if(!e||!e.contains(t))return!1;let n=t;for(;n&&n!==e;){if(n instanceof window.Element){const t=getComputedStyle(n);if("scroll"===t.overflowX||"scroll"===t.overflowY)return!0}n=n.parentNode}return!1}function yh(t){const{model:e,view:n,overlay:r}=ao(),{elementTemplateResolver:i,linkTemplateResolver:o,linkRouter:a,showScrollbars:s,zoomOptions:l,watermarkSvg:c,watermarkUrl:u,children:d}=t,[h]=x.useState((()=>new fl({model:e,shared:n,elementTemplateResolver:i?t=>{const e=t instanceof oc?t.data:void 0;return i(e?.types??[],t)}:void 0,linkTemplateResolver:o?t=>o(t instanceof cc||t instanceof dc?t.typeId:void 0,t):void 0,linkRouter:a})));return P.jsx("div",{className:"reactodia-canvas",children:P.jsxs(vh,{model:e,renderingState:h,zoomOptions:l,showScrollBars:s,watermarkSvg:c,watermarkUrl:u,children:[d,P.jsx(uu,{overlay:r}),P.jsx(fd,{})]})})}function _h(t){const e=ao(),{canvas:n}=bs(),r=Oi(),i=x.useRef("alphabet"),o=e.getCommandBus(Su);return x.useEffect((()=>{const a=new Ca;return a.listen(o,"findCapabilities",(t=>{t.capabilities.push({})})),a.listen(o,"show",(({targets:o})=>{if(0===o.length)return;const{model:a,overlay:s}=e,l=o.length>1?new kh(o,a,n):void 0,c=l??o[0],u=new Set;for(const t of o)for(const e of lc(t))u.add(e.id);s.showDialog({target:c,dialogType:Xl,style:{caption:r.text("connections_menu.dialog.caption"),defaultSize:{width:310,height:340},minSize:{width:300,height:250}},content:P.jsx(xh,{...t,placeTarget:c,targetIris:Array.from(u),initialMode:i.current,onChangeMode:t=>{i.current=t},onCancel:()=>s.hideDialog()}),onClose:()=>l?.removeFrom(a)})})),()=>a.stopListening()}),[o]),null}class kh extends el{listener=new Ca;constructor(t,e,n){super({});const r=new Set(t),i=()=>{const{x:e,y:r,width:i,height:o}=js(t,[],n.renderingState);this.setPosition({x:e+i,y:r+o/2})};i();const o=e.history.startBatch();e.addElement(this),o.discard(),this.listener.listen(e.events,"changeCells",(t=>{(t.changedElement===this||t.updateAll)&&e.getElement(this.id)!==this&&this.listener.stopListening()})),this.listener.listen(e.events,"elementEvent",(({data:t})=>{t.changePosition&&r.has(t.changePosition.source)&&i()})),this.listener.listen(n.renderingState.events,"changeElementSize",(t=>{r.has(t.source)&&i()}))}removeFrom(t){if(this.listener.stopListening(),t.getElement(this.id)===this){const e=t.history.startBatch();t.removeElement(this.id),e.discard()}}}function xh(t){const{canvas:e}=bs(),n=ao(),r=Oi(),i=zd({initialValue:"",submitTimeout:200}),o=zd({initialValue:""});return P.jsx(Ch,{...t,connectionSearch:i,objectSearch:o,canvas:e,workspace:n,translation:r})}const Sh="reactodia-connections-menu",Eh=100;class Ch extends x.Component{ALL_RELATED_ELEMENTS_LINK;handler=new Ca;linkTypesListener=new Ca;suggestionCancellation=new AbortController;linksScrolledListRef=x.createRef();linksScrollPosition;constructor(t){super(t);const{targetIris:e,initialMode:n,suggestProperties:r,workspace:{model:i},translation:o}=this.props;this.ALL_RELATED_ELEMENTS_LINK={id:"urn:reactodia:allLinks",label:[i.factory.literal(o.text("connections_menu.all_link.label"))]};const a=Boolean(r)&&1===e.length;this.state={loadingState:"none",panel:"connections",connectionSortMode:a?n:"alphabet",connectionSuggestions:{filterKey:null,scores:new Map}}}updateAll=()=>this.forceUpdate();scheduleUpdateAll=()=>{const{canvas:t}=this.props;t.renderingState.scheduleOnLayerUpdate(ul.Overlay,this.updateAll)};componentDidMount(){const{connectionSearch:t,objectSearch:e,workspace:{model:n}}=this.props;this.handler.listen(n.events,"changeLanguage",this.scheduleUpdateAll),this.handler.listen(t.events,"changeValue",this.updateAll),this.handler.listen(t.events,"executeSearch",(({value:t})=>{this.loadSuggestions(t)})),this.handler.listen(e.events,"changeValue",this.updateAll),this.loadLinks()}getSnapshotBeforeUpdate(t,e){return"objects"===this.state.panel&&"connections"===e.panel&&this.linksScrolledListRef.current&&(this.linksScrollPosition=this.linksScrolledListRef.current.scrollTop),0}componentDidUpdate(t,e){"connections"===this.state.panel&&"objects"===e.panel&&void 0!==this.linksScrollPosition&&this.linksScrolledListRef.current&&(this.linksScrolledListRef.current.scrollTop=this.linksScrollPosition)}componentWillUnmount(){const{canvas:t}=this.props;this.handler.stopListening(),this.linkTypesListener.stopListening(),t.renderingState.cancelOnLayerUpdate(ul.Overlay,this.updateAll),this.suggestionCancellation.abort()}async loadLinks(){const{targetIris:t,workspace:{model:e,triggerWorkspaceEvent:n}}=this.props;this.setState({loadingState:"loading",connections:{links:[],counts:new Map}});const r=t.length>1,i=new Map;try{await Promise.all(t.map((t=>e.dataProvider.connectedLinkStats({elementId:t,inexactCount:r}).then((t=>{for(const{id:e,inCount:n,outCount:o,inexact:a}of t){const t=i.get(e)??{inCount:0,outCount:0,inexact:!1};i.set(e,{inexact:Boolean(r||t.inexact||a),inCount:t.inCount+n,outCount:t.outCount+o})}})))))}catch(t){return console.error(t),void this.setState({loadingState:"error"})}const o=Array.from(i.keys(),(t=>e.createLinkType(t)?.data??{id:t,label:[]}));i.set(this.ALL_RELATED_ELEMENTS_LINK.id,Array.from(i.values()).reduce(((t,e)=>({inexact:Boolean(t.inexact||e.inexact),inCount:t.inCount+e.inCount,outCount:t.outCount+e.outCount})),{inCount:0,outCount:0,inexact:!1})),this.setState({loadingState:"completed",connections:{links:o,counts:i}},(()=>{this.resubscribeOnLinkTypeEvents(),n(io.connectionsLoadLinks),this.loadSuggestions("")}))}resubscribeOnLinkTypeEvents(){const{workspace:{model:t}}=this.props,{connections:e}=this.state;if(this.linkTypesListener.stopListening(),e){for(const{id:n}of e.links){const e=t.createLinkType(n);this.linkTypesListener.listen(e.events,"changeData",this.scheduleUpdateAll)}const n=new Set(e.links.map((t=>t.id)));this.linkTypesListener.listen(t.events,"changeLinkVisibility",(t=>{n.has(t.source)&&this.scheduleUpdateAll()}))}}async loadObjects(t){const{targetIris:e,workspace:{model:n,triggerWorkspaceEvent:r}}=this.props,{linkType:i,direction:o,pageCount:a}=t;this.setState({loadingState:"loading",objects:{chunk:t,elements:[]}});const s=new Map;try{await Promise.all(e.map((t=>n.dataProvider.lookup({refElementId:t,refElementLinkId:i.id===this.ALL_RELATED_ELEMENTS_LINK.id?void 0:i.id,linkDirection:o,limit:a*Eh}).then((t=>{for(const{element:e}of t)s.set(e.id,e)})))))}catch(t){return console.error(t),void this.setState({loadingState:"error"})}const l=Array.from(s.values());this.setState({loadingState:"completed",objects:{chunk:t,elements:l}},(()=>{r(io.connectionsLoadElements)}))}async loadSuggestions(t){const{targetIris:e,suggestProperties:n,workspace:{model:r}}=this.props,{loadingState:i,panel:o,connectionSortMode:a,connections:s,connectionSuggestions:l}=this.state;if(this.suggestionCancellation.abort(),n&&1===e.length&&"connections"===o&&"completed"===i&&s&&(t.length>0||"smart"===a)&&l.filterKey!==t){const i=e[0],o=r.language,a=t.trim(),l=s.links.map((t=>t.id));this.suggestionCancellation=new AbortController;const c=this.suggestionCancellation.signal,u=await n({elementId:i,token:a,properties:l,lang:o,signal:c}),d=new Map;for(const t of u)d.set(t.propertyIri,t);this.setState((e=>({connectionSuggestions:{...e.connectionSuggestions,filterKey:t,scores:d}})))}}render(){const{connectionSearch:t,objectSearch:e,translation:n}=this.props,{panel:r}=this.state;return P.jsxs("div",{className:Sh,children:[this.getBreadCrumbs(),P.jsx(Ad,{className:`${Sh}__search`,store:"connections"===r?t:e,inputProps:{name:"reactodia-connection-menu-filter",placeholder:n.textOptional("connections_menu.input.placeholder")},children:this.renderSortSwitches()}),this.getBody()]})}getBreadCrumbs(){const{workspace:{model:t},translation:e}=this.props,{objects:n,panel:r}=this.state;if(n&&"objects"===r){const{linkType:r,direction:i}=n.chunk,{label:o}=t.getLinkType(r.id)?.data??r,a=e.formatLabel(o,r.id,t.language);return P.jsxs("span",{className:`${Sh}__breadcrumbs`,children:[P.jsx("a",{className:`${Sh}__breadcrumbs-link`,onClick:this.onCollapseLink,children:e.text("connections_menu.breadcrumbs_root.label")})," / ",a," ",i?`(${i})`:null]})}return null}onExpandLink=t=>{const{objectSearch:e,workspace:{triggerWorkspaceEvent:n}}=this.props,{objects:r}=this.state;this.setState({panel:"objects"},(()=>e.change({value:"",action:"clear"}))),r&&r.chunk.linkType.id===t.linkType.id&&r.chunk.direction===t.direction||this.loadObjects(t),n(io.connectionsExpandLink)};onCollapseLink=()=>{this.setState({panel:"connections",loadingState:"completed"})};getBody(){const{targetIris:t,connectionSearch:e,objectSearch:n,workspace:r,translation:i}=this.props,{panel:o,connectionSortMode:a,loadingState:s,objects:l,connections:c,connectionSuggestions:u}=this.state;if("error"===s)return P.jsx(Nh,{error:!0});if(l&&"objects"===o)return P.jsx($h,{data:l,onMoveToFilter:this.onMoveToFilter,filterKey:n.value,loading:"loading"===s,onPressAddSelected:this.onAddSelectedElements,workspace:r,translation:i});if(c&&"connections"===o){if("loading"===s||"smart"===a&&null===u.filterKey)return P.jsx(Nh,{});const n={capabilities:[]};return r.getCommandBus(Eu).trigger("findCapabilities",n),P.jsx(Mh,{targetIris:t,data:c,suggestions:u,filterKey:e.value,sortMode:a,allRelatedLink:this.ALL_RELATED_ELEMENTS_LINK,onExpandLink:this.onExpandLink,onMoveToFilter:n.capabilities.length>0&&1===t.length?this.onMoveToFilter:void 0,scrolledListRef:this.linksScrolledListRef,workspace:r,translation:i})}return P.jsx("div",{})}onAddSelectedElements=(t,e)=>{const{onCancel:n}=this.props,{objects:r}=this.state,i=t.map((t=>t.id)),o=r?r.chunk.linkType.id:void 0;this.placeElements(i,r&&o!==this.ALL_RELATED_ELEMENTS_LINK.id?o:void 0,e),n()};placeElements(t,e,n){const{placeTarget:r,canvas:i,workspace:{model:o,triggerWorkspaceEvent:a}}=this.props,s=o.history.startBatch(Pi.text("connections_menu.place_elements.command"));let l=[];switch(n){case"separately":l=t.map((t=>o.createElement(t)));break;case"grouped":{const e=new ac({items:t.map((t=>({data:oc.placeholderData(t)})))});o.addElement(e),l=[e];break}}i.renderingState.syncUpdate(),s.history.execute(Js({target:r,elements:l,graph:o,sizeProvider:i.renderingState})),e&&"hidden"===o.getLinkVisibility(e)&&s.history.execute(Ys(o,e,"visible")),s.history.execute($c(o,t)),s.history.execute(Nc(o,{addedElements:t})),s.store(),a(io.editorAddElements)}onMoveToFilter=t=>{const{targetIris:e,workspace:{getCommandBus:n}}=this.props,{linkType:r,direction:i}=t,o=1===e.length?e[0]:void 0;if(!o)return;n(Eu).trigger("setCriteria",r.id===this.ALL_RELATED_ELEMENTS_LINK.id?{criteria:{refElement:o}}:{criteria:{refElement:o,refElementLink:r.id,linkDirection:i}})};renderSortSwitches(){const{targetIris:t,suggestProperties:e,translation:n}=this.props,{panel:r}=this.state;return"connections"===r&&e&&1===t.length?P.jsxs("div",{className:`${Sh}__sort-switches`,children:[this.renderSortSwitch("alphabet",`${Sh}__sort-label-alpha`,n.text("connections_menu.sort_alphabetically.title")),this.renderSortSwitch("smart",`${Sh}__sort-label-smart`,n.text("connections_menu.sort_smart.title"))]}):null}renderSortSwitch(t,e,n){const{connectionSortMode:r}=this.state;return P.jsxs("div",{children:[P.jsx("input",{type:"radio",name:"sort",id:t,value:t,className:`${Sh}__sort-switch`,onChange:this.onSortChange,checked:r===t}),P.jsx("label",{htmlFor:t,title:n,className:lo(`${Sh}__sort-switch-label`,e)})]})}onSortChange=t=>{const{onChangeMode:e,connectionSearch:n}=this.props,{connectionSortMode:r}=this.state,i=t.target.value;r!==i&&this.setState({connectionSortMode:i},(()=>{e(i),n.change({value:n.value,action:"submit"})}))}}class Mh extends x.Component{isSmartMode(){return"smart"===this.props.sortMode&&!this.props.filterKey}compareLinks=(t,e)=>{const{workspace:{model:n},translation:r}=this.props,i=r.formatLabel(t.label,t.id,n.language),o=r.formatLabel(e.label,e.id,n.language);return i.localeCompare(o)};compareLinksByWeight=(t,e)=>{const{workspace:{model:n},translation:r,suggestions:i}=this.props,{scores:o}=i,a=r.formatLabel(t.label,t.id,n.language),s=r.formatLabel(e.label,e.id,n.language),l=o.has(t.id)?o.get(t.id).score:0,c=o.has(e.id)?o.get(e.id).score:0;return l>c?-1:l<c?1:a.localeCompare(s)};getLinks(){const{workspace:{model:t},translation:e,data:n,filterKey:r}=this.props,i=r?Da(r):void 0;return(n.links||[]).map((e=>t.getLinkType(e.id)?.data??e)).filter((n=>{const r=e.formatLabel(n.label,n.id,t.language);return!i||i(r)})).sort(this.compareLinks)}getProbableLinks(){const{workspace:{model:t},data:e,suggestions:n}=this.props,{scores:r}=n,i=this.isSmartMode();return(e.links??[]).map((e=>t.getLinkType(e.id)?.data??e)).filter((t=>r.has(t.id)&&(r.get(t.id).score>0||i))).sort(this.compareLinksByWeight)}getViews=(t,e)=>{const{data:n,suggestions:r}=this.props,{scores:i}=r,o=[],a=(t,r)=>{const{inCount:a,outCount:s,inexact:l}=n.counts.get(t.id)??{inCount:0,outCount:0,inexact:!1},c="in"===r?a:s;if(0===c)return;const u=e?"-probable":"";o.push(P.jsx(Lh,{link:t,onExpandLink:this.props.onExpandLink,count:l&&c>0?"some":c,direction:r,filterKey:e?"":this.props.filterKey,onMoveToFilter:this.props.onMoveToFilter,probability:i.has(t.id)&&e?i.get(t.id).score:0},`${r}-${t.id}-${u}`))};for(const e of t)a(e,"in"),a(e,"out");return o};render(){const{translation:t,allRelatedLink:e,scrolledListRef:n}=this.props,r=this.isSmartMode(),i=r?[]:this.getLinks(),o=this.getProbableLinks().filter((t=>-1===i.indexOf(t))),a=this.getViews(i),s=this.getViews(o,!0);let l;if(0===a.length&&0===s.length)l=P.jsx("label",{className:`${Sh}__links-no-results`,children:t.text("connections_menu.links.no_results")});else if(l=a,a.length>1||r&&s.length>1){const t=this.props.data.counts,{inCount:n,outCount:r,inexact:i}=t.get(e.id),o=n+r;l=[P.jsx(Lh,{link:e,onExpandLink:this.props.onExpandLink,count:i&&o>0?"some":o,onMoveToFilter:this.props.onMoveToFilter},e.id),P.jsx("hr",{className:`${Sh}__links-list-hr`},"reactodia-hr-line")].concat(l)}let c=null;return 0!==s.length&&(c=[r?null:P.jsx("li",{className:`${Sh}__links-probably-label`,children:t.text("connections_menu.links.suggest_similar")},"probable-links"),s]),P.jsxs("ul",{ref:n,className:lo("reactodia-scrollable",`${Sh}__links-list`,0===a.length&&0===s.length?`${Sh}__links-list-empty`:void 0),children:[l,c]})}}function Lh(t){const{link:e,filterKey:n,direction:r,count:i,onExpandLink:o,onMoveToFilter:a,probability:s=0}=t,{model:l}=ao(),c=Oi(),u=c.formatLabel(e.label,e.id,l.language),d=l.locale.formatIri(e.id),h=Math.round(100*s),f=Md(u+(h>0?` (${h}%)`:""),n),p=c.text("in"===r?"connections_menu.link.source_title":"out"===r?"connections_menu.link.target_title":"connections_menu.link.both_title",{relation:u,relationIri:d}),g=c.text("in"===r?"connections_menu.link.source_navigate_title":"out"===r?"connections_menu.link.target_navigate_title":"connections_menu.link.both_navigate_title",{relation:u,relationIri:d});return P.jsxs("li",{"data-linktypeid":e.id,className:`${Sh}__link`,title:p,onClick:()=>{o({chunkId:ja(),linkType:e,direction:r,expectedCount:i,pageCount:1})},children:["in"===r||"out"===r?P.jsxs("div",{className:`${Sh}__link-direction`,children:["in"===r&&P.jsx("div",{className:`${Sh}__link-direction-in`}),"out"===r&&P.jsx("div",{className:`${Sh}__link-direction-out`})]}):null,P.jsx(vu,{type:"linkType",target:e.id,children:P.jsx("div",{className:`${Sh}__link-title`,children:f})}),"some"===i?null:P.jsx("span",{className:`reactodia-badge ${Sh}__link-count`,children:i<=Eh?i:"100+"}),a?P.jsx("div",{className:`${Sh}__link-filter-button`,onClick:t=>{t.stopPropagation(),a?.({chunkId:ja(),linkType:e,direction:r,expectedCount:i,pageCount:1})},title:c.text("connections_menu.link.move_to_filter.title")}):null,P.jsx("div",{className:`${Sh}__link-navigate-button`,title:g})]})}class $h extends x.Component{constructor(t){super(t),this.state=$h.makeStateFromProps(t)}static getDerivedStateFromProps(t,e){return e&&e.chunkId===t.data.chunk.chunkId?null:$h.makeStateFromProps(t)}static makeStateFromProps(t){return{chunkId:t.data.chunk.chunkId,selection:new Set}}getFilteredObjects(){const{workspace:{model:t},data:e,filterKey:n}=this.props;if(!n)return e.elements;const r=Da(n);return e.elements.filter((e=>{const n=t.locale.formatEntityLabel(e,t.language);return r(n)}))}updateSelection=t=>{this.setState({selection:t})};renderCounter(t){const{data:{chunk:e,elements:n},translation:r}=this.props,i=r.text("connections_menu.entities.counter_label",{count:t,total:n.length});let o=null;if("some"!==e.expectedCount){const t=n.length-Math.min(Eh,e.expectedCount),i=Math.abs(t)>Eh?"100+":Math.abs(t).toString();o=P.jsx("span",{className:`${Sh}__objects-extra`,title:0===t?void 0:r.text(t>0?"connections_menu.entities.extra_title":"connections_menu.entities.missing_title",{value:i}),children:0===t?null:r.text(t>0?"connections_menu.entities.extra_label":"connections_menu.entities.missing_label",{value:i})})}return P.jsxs("div",{className:`${Sh}__objects-count`,children:[P.jsx("span",{children:i}),o]})}render(){const{data:t,filterKey:e,onPressAddSelected:n,onMoveToFilter:r,workspace:{model:i},translation:o}=this.props,{selection:a}=this.state,s=this.getFilteredObjects(),l=Tc(i),c=s.every((t=>l.has(t.id)||a.has(t.id))),u=s.filter((t=>!l.has(t.id))),d=u.filter((t=>a.has(t.id))),h=d.length>0?d:u;return P.jsxs("div",{className:`${Sh}__objects`,children:[P.jsxs("div",{className:`${Sh}__objects-select-all`,children:[P.jsxs("label",{children:[P.jsx("input",{type:"checkbox",name:"reactodia-connections-menu-select-all",checked:c&&u.length>0,onChange:()=>this.updateSelection(new Set(c?[]:u.map((t=>t.id)))),disabled:0===u.length,title:o.text("connections_menu.select_all.title")}),P.jsx("span",{children:o.text("connections_menu.select_all.label")})]}),P.jsx("div",{className:`${Sh}__objects-spacer`,"aria-hidden":"true"}),this.renderCounter(d.length)]}),this.props.loading?P.jsx("div",{className:`${Sh}__objects-loading`,children:P.jsx(Nh,{})}):0===s.length?P.jsx("div",{className:`${Sh}__objects-no-results`,children:o.text("connections_menu.entities.no_results")}):P.jsxs("div",{className:`${Sh}__objects-list`,children:[P.jsx(Rd,{items:s,selection:this.state.selection,onSelectionChanged:this.updateSelection,highlightText:e}),"some"!==t.chunk.expectedCount&&t.chunk.expectedCount>Eh?P.jsx("div",r?{className:`${Sh}__move-to-filter`,onClick:()=>r(t.chunk),children:o.text("connections_menu.entities.truncated_results_expand",{limit:Eh})}:{className:`${Sh}__move-to-filter`,children:o.text("connections_menu.entities.truncated_results",{limit:Eh})}):null]}),P.jsxs("div",{className:`${Sh}__objects-statusbar`,children:[P.jsx("button",{className:lo(`${Sh}__objects-add-button`,"reactodia-btn reactodia-btn-secondary"),disabled:this.props.loading||h.length<=1,onClick:()=>n(h,"grouped"),children:o.text("connections_menu.entities.add_group")}),P.jsx("button",{className:lo(`${Sh}__objects-add-button`,"reactodia-btn reactodia-btn-primary"),disabled:this.props.loading||0===u.length,onClick:()=>n(h,"separately"),children:o.text(d.length>0?"connections_menu.entities.add_selected":"connections_menu.entities.add_all")})]})]})}}function Nh(t){return P.jsx("div",{className:`${Sh}__spinner`,children:P.jsx(Yi,{width:30,height:30,errorOccurred:Boolean(t.error)})})}function Th(t){const{allowDrop:e,getDroppedItems:n=Ah}=t,{canvas:r}=bs(),{model:i,triggerWorkspaceEvent:o}=ao();return x.useEffect((()=>{const t=new Ca;return t.listen(r.events,"dragover",(t=>{e&&!e(t)||(t.sourceEvent.dataTransfer&&(t.sourceEvent.dataTransfer.dropEffect="move"),t.allowDrop())})),t.listen(r.events,"drop",(t=>{t.sourceEvent.preventDefault();const e=n(t);if(e.length>0){const n=i.history.startBatch(Pi.text("drop_on_canvas.drop.command")),a=Tc(i),s=new Set,l=[],c=[];for(const t of e)if("element"===t.type){let e=!1,n=!1;for(const r of lc(t.element))n=!0,a.has(r.id)||s.has(r.id)||(e=!0,s.add(r.id),oc.isPlaceholderData(r)&&l.push(r.id));n&&!e||c.push(t.element)}for(const t of c)i.getElement(t.id)||i.addElement(t);!function(t,e,n){for(const n of t)n.setPosition(e);n.renderingState.syncUpdate();let{x:r,y:i}=e,o=!0;for(const e of t){let{width:t,height:a}=Ts(e,n.renderingState);0===t&&(t=100),0===a&&(a=50),o&&(o=!1,r-=t/2,i-=a/2),e.setPosition({x:r,y:i}),i+=a+20}}(c,t.position,r),n.history.execute($c(i,l)),n.history.execute(Nc(i,{addedElements:Array.from(s)})),n.store(),c.length>0&&c[c.length-1].focus(),i.setSelection(c),r.renderingState.syncUpdate(),o(io.editorAddElements)}})),()=>t.stopListening()}),[e,n]),null}function Ah(t){const e=(e,n=!1)=>{try{const r=t.sourceEvent.dataTransfer?.getData(e);if(!r)return;let i=[];try{const t=JSON.parse(r);Array.isArray(t)&&(i=t.filter((t=>"string"==typeof t)))}catch(t){i=[n?decodeURI(r):r]}if(0===i.length)return;return i.map((t=>({type:"element",element:new oc({data:oc.placeholderData(t)})})))}catch(t){return}};return e("application/x-reactodia-elements")??e("text/uri-list",!0)??e("text")??[]}const zh="reactodia-form";function Ih(t){const{link:e,onChange:n,disabled:r,error:i}=t,{editor:o}=ao(),a=Oi(),s=Ii({input:[o.metadataProvider,e.source.id,e.target.id],load:([t],{signal:n})=>async function(t){const{link:e,metadataProvider:n,signal:r}=t;if(!n)return[];const i=await _a(n.canConnect(e.source,e.target,void 0,{signal:r}),r);if(null===i)return[];const o=new Set,a=new Set;for(const{inLinks:t,outLinks:e}of i){for(const e of t)o.add(e);for(const t of e)a.add(t)}let s=1;const l=[];for(const t of a)l.push({key:s,iri:t,direction:"out"}),s++;for(const t of o)l.push({key:s,iri:t,direction:"in"}),s++;return l}({link:e,metadataProvider:t,signal:n})}),l="completed"===s.status?s.data:void 0,c=(l??[]).find((({iri:t,direction:n})=>t===e.base.linkTypeId&&n===e.direction));return P.jsxs("div",{className:`${zh}__control-row`,children:[P.jsx("label",{children:a.text("visual_authoring.select_relation.type.label")}),l&&"completed"===s.status?P.jsxs("select",{className:"reactodia-form-control",name:"reactodia-link-type-selector-select",value:c?.key??-1,onChange:t=>{const r=Number(t.currentTarget.value),i=l?.find((t=>t.key===r));if(i){const t={...e,base:{...e.base,linkTypeId:i.iri},direction:i.direction};n(t)}},disabled:r,children:[P.jsx("option",{value:-1,disabled:!0,children:a.text("visual_authoring.select_relation.type.placeholder")}),P.jsx(Rh,{link:e,linkTypes:l})]}):P.jsx("div",{children:P.jsx(Yi,{width:20,height:20,errorOccurred:"error"===s.status})}),i?P.jsx("span",{className:`${zh}__control-error`,children:i}):null]})}function Rh(t){const{link:e,linkTypes:n}=t,{model:r}=ao(),i=Oi(),o=$i(r.events,"changeLanguage",(()=>r.language));ji(ro,n.map((t=>t.iri)),r);const a=[...n].sort(function(t,e,n){return(r,i)=>{const o=t.getLinkType(r.iri),a=t.getLinkType(i.iri),s=e.formatLabel(o?.data?.label,r.iri,n),l=e.formatLabel(a?.data?.label,i.iri,n),c=s.localeCompare(l);return 0!==c?c:"out"===r.direction&&"in"===i.direction?-1:"in"===r.direction&&"out"===i.direction?1:0}}(r,i,o));return P.jsx(P.Fragment,{children:a.map((({key:t,iri:n,direction:o})=>{const a=r.getLinkType(n),s=i.formatLabel(a?.data?.label,n,r.language);let[l,c]=[e.source,e.target].map((t=>r.locale.formatEntityLabel(t,r.language)));return"in"===o&&([l,c]=[c,l]),P.jsx("option",{value:t,children:i.text("visual_authoring.select_relation.relation_type.label",{relation:s,source:l,target:c})},t)}))})}function Oh(t,e,n){let[r,i]=[e,n];return"in"===t.direction&&([r,i]=[i,r]),new cc({sourceId:r.id,targetId:i.id,data:{...t.base,sourceId:r.iri,targetId:i.iri}})}x.createContext(null);const Ph="reactodia-resizable-box";function Vh(t){const{className:e,mapCoordsFromPage:n,startResize:r,minWidth:i=0,minHeight:o=0}=t,[a,s]=x.useState(),l=t=>{t.stopPropagation(),s(r())},c=()=>{a?.end(),s(void 0)},u=(t,e,r,s)=>{if(!a)return;const{initialBounds:l}=a,c=n(0,0),{x:u,y:d}=Ss.subtract(n(t,e),c),{x:h,y:f}=Ss.subtract(n(r,s),c),p={x:Math.min(l.x+u,l.x+l.width-i),y:Math.min(l.y+d,l.y+l.height-o),width:Math.max(l.width+h,i),height:Math.max(l.height+f,o)};a.onResize(p)};x.useEffect((()=>()=>a?.end()),[]);const d=P.jsx("svg",{className:`${Ph}__corner`,viewBox:"-2 -2 14 14",children:P.jsx("circle",{cx:5,cy:5,r:5})}),h=P.jsx("svg",{className:`${Ph}__vertical`,viewBox:"-2 -2 34 14",children:P.jsx("rect",{x:0,y:0,rx:2,ry:2,width:30,height:10})}),f=P.jsx("svg",{className:`${Ph}__horizontal`,viewBox:"-2 -2 14 34",children:P.jsx("rect",{x:0,y:0,rx:2,ry:2,width:10,height:30})}),p=`${Ph}__handle`;return P.jsxs("div",{className:lo(Ph,e),children:[P.jsx(Uc,{className:p,dock:"n",onBeginDragHandle:l,onEndDragHandle:c,onDragHandle:(t,e,n)=>u(0,n,0,-n),children:h}),P.jsx(Uc,{className:p,dock:"s",onBeginDragHandle:l,onEndDragHandle:c,onDragHandle:(t,e,n)=>u(0,0,0,n),children:h}),P.jsx(Uc,{className:p,dock:"w",onBeginDragHandle:l,onEndDragHandle:c,onDragHandle:(t,e)=>u(e,0,-e,0),children:f}),P.jsx(Uc,{className:p,dock:"e",onBeginDragHandle:l,onEndDragHandle:c,onDragHandle:(t,e)=>u(0,0,e,0),children:f}),P.jsx(Uc,{className:p,dock:"nw",onBeginDragHandle:l,onEndDragHandle:c,onDragHandle:(t,e,n)=>u(e,n,-e,-n),children:d}),P.jsx(Uc,{className:p,dock:"ne",onBeginDragHandle:l,onEndDragHandle:c,onDragHandle:(t,e,n)=>u(0,n,e,-n),children:d}),P.jsx(Uc,{className:p,dock:"sw",onBeginDragHandle:l,onEndDragHandle:c,onDragHandle:(t,e,n)=>u(e,0,-e,n),children:d}),P.jsx(Uc,{className:p,dock:"se",onBeginDragHandle:l,onEndDragHandle:c,onDragHandle:(t,e,n)=>u(0,0,e,n),children:d})]})}const jh="reactodia-selection-action";function Dh(t){const{dock:e,dockRow:n,dockColumn:r,className:i,title:o,hotkey:a,disabled:s,onSelect:l,onMouseDown:c,onPointerDown:u,children:d}=t,h=xs(a,s?void 0:l),f=o&&h?`${o} (${h.text})`:o;return P.jsx("button",{type:"button",className:lo(jh,Hh(e),i),style:Bh(n,r),title:f,"aria-label":o,"aria-keyshortcuts":h?.text,disabled:s,onClick:l,onMouseDown:c,onPointerDown:u,children:d})}function Hh(t){switch(t){case"nw":return`${jh}--dock-nw`;case"n":return`${jh}--dock-n`;case"ne":return`${jh}--dock-ne`;case"e":return`${jh}--dock-e`;case"se":return`${jh}--dock-se`;case"s":return`${jh}--dock-s`;case"sw":return`${jh}--dock-sw`;case"w":return`${jh}--dock-w`;default:return}}function Bh(t,e){return{"--reactodia-dock-x":e??0,"--reactodia-dock-y":t??0}}function Fh(t){return $i(t.events,"changeSelection",(()=>{const e=1===t.selection.length?t.selection[0]:void 0;return e instanceof tl?e:void 0}))}function Uh(t){const{dock:e,dockRow:n,dockColumn:r,className:i,title:o}=t;return P.jsx("div",{role:"button",className:lo(i,Hh(e),`${jh}__spinner`),style:Bh(n,r),title:o,children:P.jsx(Yi,{width:20,height:20})})}function Wh(t){const{className:e,title:n,hotkey:r,...i}=t,{canvas:o}=bs(),{model:a,editor:s}=ao(),l=Oi(),c=$i(a.events,"changeSelection",(()=>a.selection)).filter((t=>t instanceof tl));let u=0,d=0;for(const t of c)t instanceof oc&&(d++,Gl.isAddedEntity(s.authoringState,t.iri)&&u++);const h=1===u&&1===d;return P.jsx(Dh,{...i,className:lo(e,h?`${jh}__delete`:`${jh}__remove`),title:n||l.text(h?"selection_action.remove.title_new":1===c.length?"selection_action.remove.title_single":"selection_action.remove.title"),hotkey:void 0===r?"None+Delete":r,onSelect:()=>{s.removeSelectedElements(),o.focus()}})}function qh(t){const{className:e,title:n,...r}=t,{model:i,canvas:o}=bs(),a=Oi(),s=$i(i.events,"changeSelection",(()=>i.selection)).filter((t=>t instanceof tl));return s.length<=1?null:P.jsx(Dh,{...r,className:lo(e,`${jh}__zoomToFit`),title:n??a.text("selection_action.zoom_to_fit.title"),onSelect:()=>{const t=new Set;for(const e of s)for(const n of i.getElementLinks(e))t.add(n);const e=js(s,t,o.renderingState);o.zoomToFitRect(e,{animate:!0})}})}function Gh(t){const{className:e,title:n,...r}=t,{model:i,canvas:o}=bs(),{performLayout:a}=ao(),s=Oi(),l=$i(i.events,"changeSelection",(()=>i.selection)).filter((t=>t instanceof tl));return l.length<=1?null:P.jsx(Dh,{...r,className:lo(e,`${jh}__layout`),title:n??s.text("selection_action.layout.title"),onSelect:()=>{a({canvas:o,selectedElements:new Set(l),animate:!0})}})}function Zh(t){const{className:e,title:n,...r}=t,{canvas:i}=bs(),{model:o}=ao(),a=Oi(),s=$i(o.events,"changeSelection",(()=>o.selection)).filter((t=>t instanceof tl)),l=function(t,e){return x.useCallback((n=>{if(0===e.length)return()=>{};const r=new Set(e),i=new Ca;return i.listen(t.events,"elementEvent",(({data:t})=>{if(t.changeElementState&&r.has(t.changeElementState.source)){const e=Boolean(t.changeElementState.previous.get(za.Expanded));t.changeElementState.source.isExpanded!==e&&n()}})),()=>i.stopListening()}),[t.events,e])}(o,s),c=t=>{const e=i.renderingState.getElementTemplate(t);return Boolean(e.supports?.[za.Expanded])},u=Ai(pl(l,i.renderingState),(()=>s.every((t=>!c(t)||t.isExpanded))));return s.some(c)?P.jsx(Dh,{...r,className:lo(e,u?`${jh}__collapse`:`${jh}__expand`),title:n??a.text(1===s.length?"selection_action.expand.title_single":"selection_action.expand.title"),onSelect:()=>{if(1===s.length){const t=s[0];o.history.execute(Qs(t,!t.isExpanded))}else{const t=o.history.startBatch(Pi.text(u?"selection_action.expand.collapse_command":"selection_action.expand.expand_command"));for(const e of s)c(e)&&t.history.execute(Qs(e,!u));t.store()}}}):null}function Kh(t){const{dock:e,dockRow:n,dockColumn:r,className:i,title:o,anchorProps:a,onSelect:s}=t,{model:l}=ao(),c=Oi(),u=Fh(l);if(!(u instanceof oc))return null;const d=l.locale.prepareAnchor(u.iri);return P.jsx("a",{...d,role:"button",...a,className:lo(jh,Hh(e),i,`${jh}__link`),style:Bh(n,r),title:o??c.text("selection_action.anchor.title"),onClick:t=>{s?s(u,t):d.onClick?.(t)}})}function Qh(t){const{className:e,title:n,...r}=t,{model:i,overlay:o,getCommandBus:a}=ao(),s=Oi(),l=$i(o.events,"changeOpenedDialog",(()=>o.openedDialog?.knownType===Xl)),c=$i(i.events,"changeSelection",(()=>i.selection)).filter((t=>t instanceof tl));let u=0;for(const t of c)for(const e of lc(t))u++;const d=a(Su),h={capabilities:[]};return d.trigger("findCapabilities",h),h.capabilities.length>0&&u>0?P.jsx(Dh,{...r,className:lo(e,l?`${jh}__navigate-close`:`${jh}__navigate-open`),title:n??s.text("selection_action.connections.title"),onSelect:()=>{l?o.hideDialog():d.trigger("show",{targets:c})}}):null}function Xh(t){const{className:e,title:n,...r}=t,{model:i,getCommandBus:o}=ao(),a=Oi(),s=Fh(i),l=o(Eu),c={capabilities:[]};return l.trigger("findCapabilities",c),s instanceof oc&&c.capabilities.length>0?P.jsx(Dh,{...r,className:lo(e,`${jh}__add-to-filter`),title:n??a.text("selection_action.add_to_filter.title"),onSelect:()=>{l.trigger("setCriteria",{criteria:{refElement:s.iri}})}}):null}function Yh(t){const{className:e,title:n,hotkey:r,...i}=t,{canvas:o}=bs(),a=ao(),s=Oi(),{model:l}=a,c=$i(l.events,"changeSelection",(()=>l.selection)).filter((t=>t instanceof tl)),u=c.length>0&&c.every((t=>t instanceof oc)),d=c.length>0&&c.every((t=>t instanceof ac));return 0===c.length||1===c.length&&u||c.every((t=>t instanceof Wl))?null:P.jsx(Dh,{...i,className:lo(e,d?`${jh}__ungroup`:`${jh}__group`),disabled:!(u||d),title:n??s.text(d?"selection_action.group.title_ungroup":"selection_action.group.title"),hotkey:void 0===r?"None+G":r,onSelect:async()=>{if(u){const t=await jc(a,{elements:c,canvas:o});l.setSelection([t]),t.focus()}else if(d){const t=await Dc(a,{groups:c,canvas:o});l.setSelection(t),o.focus()}}})}function Jh(t){const{model:e}=bs(),n=Fh(e);return n instanceof oc?P.jsx(tf,{...t,target:n}):n instanceof Wl?P.jsx(ef,{...t,target:n}):null}function tf(t){const{target:e,className:n,title:r,linkType:i,...o}=t,{canvas:a}=bs(),{editor:s,getCommandBus:l}=ao(),c=Oi(),u=$i(s.events,"changeMode",(()=>s.inAuthoringMode)),d=function(t,e,n){const{canvas:r}=bs(),i=e instanceof oc?e:void 0,o=Ai(Ti(i?.events,"changeData"),(()=>i?.data)),a=Ai(pl(Ti(t.events,"changeAuthoringState"),r.renderingState),(()=>t.authoringState)),s=e instanceof oc?a.elements.get(e.iri):void 0,{data:l,status:c}=Ii({input:[t.metadataProvider,o,s,n],load:async([t,e,n,r],{signal:i})=>!(!t||!e||n&&"entityDelete"===n.type)&&(await t.canConnect(e,void 0,r,{signal:i})).length>0});return"completed"===c?l:void 0}(s,u?e:void 0,i);if(!u)return null;if(void 0===d){const{dock:e,dockRow:n,dockColumn:r}=t;return P.jsx(Uh,{dock:e,dockRow:n,dockColumn:r})}return P.jsx(Dh,{...o,className:lo(n,`${jh}__establish-link`),disabled:!d,title:r??c.text(d?"selection_action.establish_relation.title":"selection_action.establish_relation.title_disabled"),onPointerDown:t=>{t.preventDefault();const n=a.metrics.pageToPaperCoords(t.pageX,t.pageY);l(Mu).trigger("startDragEdit",{operation:{mode:"connect",source:e,linkType:i,point:n}})}})}function ef(t){const{target:e,className:n,title:r,linkType:i,...o}=t,{canvas:a}=bs(),{getCommandBus:s}=ao(),l=Oi(),c={capabilities:[]};return s(xu).trigger("findCapabilities",c),0===c.capabilities.length?null:P.jsx(Dh,{...o,className:lo(n,`${jh}__establish-link`),title:r??l.text("selection_action.establish_relation.title"),onPointerDown:t=>{t.preventDefault();const n=a.metrics.pageToPaperCoords(t.pageX,t.pageY);s(xu).trigger("startDragOperation",{operation:{mode:"connect",source:e,point:n}})}})}function nf(t){const{className:e,title:n,initialContent:r,...i}=t,{model:o,getCommandBus:a}=ao(),s=Oi(),l=$i(o.events,"changeSelection",(()=>o.selection)).filter((t=>t instanceof tl)),c={capabilities:[]};return a(xu).trigger("findCapabilities",c),0===l.length||0===c.capabilities.length?null:P.jsx(Dh,{...i,className:lo(e,`${jh}__annotate`),title:n??s.text("selection_action.annotate.title"),onSelect:()=>{let t;"function"==typeof r?t=r(l):void 0===r?t={type:"plaintext",text:s.text("selection_action.annotate.defaultContent")}:null!==r&&(t=r),a(xu).trigger("createAnnotation",{targets:l,content:t})}})}function rf(t){const{model:e,canvas:n}=bs(),r=Fh(e);return r?P.jsx(Bl,{layer:"overElements",children:P.jsx(af,{...t,target:r,canvas:n,model:e})}):null}const of="reactodia-halo";class af extends x.Component{listener=new Ca;targetListener=new Ca;constructor(t){super(t),this.state={}}componentDidMount(){const{canvas:t,target:e}=this.props;this.listener.listen(t.events,"changeTransform",(()=>this.forceUpdate())),this.listenToElement(e)}componentDidUpdate(t){t.target!==this.props.target&&this.listenToElement(this.props.target)}componentWillUnmount(){this.listener.stopListening(),this.listenToElement(void 0)}listenToElement(t){const{canvas:e}=this.props;this.targetListener.stopListening(),t&&(this.targetListener.listenAny(t.events,this.onElementEvent),this.targetListener.listen(e.renderingState.events,"changeElementSize",(e=>{e.source===t&&co.flushSync((()=>{this.forceUpdate()}))})))}onElementEvent=t=>{t.changePosition&&co.flushSync((()=>{this.forceUpdate()}))};render(){const{target:t,canvas:e,model:n,margin:r,children:i}=this.props,o=e.renderingState.getElementTemplate(t),a=Boolean(o.supports?.[za.ElementSize]),s=Ts(t,e.renderingState),{x:l,y:c}=e.metrics.paperToScrollablePaneCoords(s.x,s.y),{x:u,y:d}=e.metrics.paperToScrollablePaneCoords(s.x+s.width,s.y+s.height),h={"--reactodia-selection-single-box-margin":r,"--reactodia-halo-left":`${l}px`,"--reactodia-halo-top":`${c}px`,"--reactodia-halo-width":u-l+"px","--reactodia-halo-height":d-c+"px"};return P.jsxs("div",{className:lo(of,a?`${of}--resizable`:void 0),style:h,children:[a&&P.jsx(Vh,{className:`${of}__resizer`,mapCoordsFromPage:(t,n)=>e.metrics.pageToPaperCoords(t,n),startResize:()=>(n.history.registerToUndo(Ls.compound(Pi.text("commands.transform_elements.title"),[qs.capturePartial([t],[])])),new sf(t,s)),minWidth:40,minHeight:40}),i??P.jsxs(P.Fragment,{children:[P.jsx(Yh,{dock:"nw",dockColumn:1}),P.jsx(Wh,{dock:"ne"}),P.jsx(Zh,{dock:"s"}),P.jsx(Kh,{dock:"w"}),P.jsx(Qh,{dock:"e"}),P.jsx(Xh,{dock:"se"}),P.jsx(nf,{dock:"se",dockColumn:1}),P.jsx(Jh,{dock:"sw"})]})]})}}class sf{constructor(t,e){this.target=t,this.initialBounds=e}onResize({x:t,y:e,width:n,height:r}){this.target.setPosition({x:t,y:e}),this.target.setElementState(this.target.elementState.set(za.ElementSize,{width:n,height:r}))}end(){}}const lf=x.createContext(null);function cf(){const t=x.useContext(lf);if(!t)throw new Error("Missing context for LinkAction");return t}const uf="reactodia-link-action";function df(t){const{dockSide:e,dockIndex:n,disabled:r,className:i,title:o,hotkey:a,onSelect:s,onMouseDown:l,onPointerDown:c,children:u}=t,{getPosition:d}=cf(),h=xs(a,r?void 0:s),f=o&&h?`${o} (${h.text})`:o;return P.jsx("button",{role:"button",className:lo(i,uf),style:d(e,n),disabled:r,title:f,"aria-label":o,"aria-keyshortcuts":h?.text,onClick:s,onMouseDown:l,onPointerDown:c,children:u})}function hf(t){const{dockSide:e,dockIndex:n,className:r,title:i}=t,{buttonSize:o,getPosition:a}=cf();return P.jsx("div",{className:lo(r,`${uf}__spinner`),style:a(e,n),title:i,children:P.jsx(Yi,{width:o,height:o})})}function ff(t){const{className:e,title:n,...r}=t,{link:i}=cf(),{model:o,editor:a,getCommandBus:s}=ao(),l=Oi(),c=$i(a.events,"changeMode",(()=>a.inAuthoringMode)),u=vf(c?i:void 0,o,a),d="completed"===u.status?u.data:void 0,h=$i(a.events,"changeAuthoringState",(()=>i instanceof cc&&Gl.isDeletedRelation(a.authoringState,i.data)));if(!(c&&i instanceof cc)||h)return null;if(void 0===d){const{dockSide:e,dockIndex:n}=t;return P.jsx(hf,{dockSide:e,dockIndex:n})}return P.jsx(df,{...r,className:lo(e,`${uf}__button`,`${uf}__edit`),title:n??l.text(d.canChangeType?"link_action.edit_relation.title":"link_action.edit_relation.title_disabled"),disabled:!d.canChangeType,onSelect:()=>s(Mu).trigger("editRelation",{target:i})})}function pf(t){const{link:e}=cf();return e instanceof cc?P.jsx(gf,{...t,link:e}):e instanceof ql?P.jsx(mf,{...t,link:e}):null}function gf(t){const{link:e,className:n,title:r,hotkey:i,...o}=t,{model:a,editor:s}=ao(),l=Oi(),c=vf(e,a,s),u="completed"===c.status?c.data:void 0,d=$i(s.events,"changeAuthoringState",(()=>e instanceof cc&&Gl.isDeletedRelation(s.authoringState,e.data)));if(!(s.inAuthoringMode&&e instanceof cc)||d)return null;if(void 0===u){const{dockSide:e,dockIndex:n}=t;return P.jsx(hf,{dockSide:e,dockIndex:n})}return P.jsx(df,{...o,className:lo(n,`${uf}__button`,`${uf}__delete`),title:r??l.text(u.canDelete?"link_action.delete_relation.title":"link_action.delete_relation.title_disabled"),hotkey:void 0===i?"None+Delete":i,disabled:!u.canDelete,onSelect:()=>s.deleteRelation(e.data)})}function vf(t,e,n){const{canvas:r}=bs(),i=Ai(pl(Ti(n.events,"changeAuthoringState"),r.renderingState),(()=>n.authoringState));return Ii({input:[n.metadataProvider,t,i],load:async([t,n,r],{signal:i})=>{if(t&&n instanceof cc&&!function(t,e){return Gl.isDeletedEntity(t,e.data.sourceId)||Gl.isDeletedEntity(t,e.data.targetId)}(r,n)){const r=e.getElement(n.sourceId),o=e.getElement(n.targetId);return t.canModifyRelation(n.data,r.data,o.data,{signal:i})}return{}}})}function mf(t){const{link:e,className:n,title:r,hotkey:i,...o}=t,{editor:a}=ao(),s=Oi();return P.jsx(df,{...o,className:lo(n,`${uf}__button`,`${uf}__delete`),title:r??s.text("link_action.delete_annotation.title"),hotkey:void 0===i?"None+Delete":i,onSelect:()=>a.removeItems([e])})}function bf(t){const{link:e}=cf();return e instanceof cc?P.jsx(wf,{...t,link:e}):e instanceof ql?P.jsx(yf,{...t,link:e}):null}function wf(t){const{link:e,dockSide:n,className:r,title:i,...o}=t,{buttonSize:a,getAngleInDegrees:s}=cf(),{canvas:l}=bs(),{editor:c,getCommandBus:u}=ao(),d=Oi(),h=$i(c.events,"changeMode",(()=>c.inAuthoringMode)),f=$i(c.events,"changeAuthoringState",(()=>Gl.isDeletedRelation(c.authoringState,e.data)));return h?P.jsx(df,{...o,dockSide:n,dockIndex:0,className:lo(r,`${uf}__endpoint`),title:i??d.text("source"===n?"link_action.move_relation.move_source_title":"link_action.move_relation.move_target_title"),disabled:f,onPointerDown:t=>{t.preventDefault();const r=l.metrics.pageToPaperCoords(t.pageX,t.pageY);u(Mu).trigger("startDragEdit",{operation:{mode:"source"===n?"moveSource":"moveTarget",link:e,point:r}})},children:P.jsx(_f,{dockSide:n,buttonSize:a,angle:s(n)})}):null}function yf(t){const{link:e,dockSide:n,className:r,title:i,...o}=t,{buttonSize:a,getAngleInDegrees:s}=cf(),{canvas:l}=bs(),{getCommandBus:c}=ao(),u=Oi(),d={capabilities:[]};return c(xu).trigger("findCapabilities",d),0===d.capabilities.length?null:P.jsx(df,{...o,dockSide:n,dockIndex:0,className:lo(r,`${uf}__endpoint`),title:i??u.text("source"===n?"link_action.move_relation.move_source_title":"link_action.move_relation.move_target_title"),onPointerDown:t=>{t.preventDefault();const r=l.metrics.pageToPaperCoords(t.pageX,t.pageY);c(xu).trigger("startDragOperation",{operation:{mode:"source"===n?"moveSource":"moveTarget",link:e,point:r}})},children:P.jsx(_f,{dockSide:n,buttonSize:a,angle:s(n)})})}function _f(t){const{dockSide:e,buttonSize:n,angle:r}=t;return P.jsx("svg",{width:n,height:n,style:{transform:`rotate(${r}deg)`},children:P.jsx("g",{transform:`scale(${n})`,children:"source"===e?P.jsx("circle",{r:.5,cx:.5,cy:.5,fill:"currentColor"}):P.jsx("polygon",{points:"0,0.5 1,1 1,0",fill:"currentColor"})})})}function kf(t){const{className:e,title:n}=t,{link:r}=cf(),{canvas:i}=bs(),{view:{renameLinkProvider:o},getCommandBus:a}=ao(),s=Oi(),l=Ai(Ti(i.renderingState.events,"changeLinkLabelBounds"),(()=>i.renderingState.getLinkLabelBounds(r)));if(!o?.canRename(r)||!l)return null;const{x:c,y:u,width:d,height:h}=l,{x:f,y:p}=i.metrics.paperToScrollablePaneCoords(c+d,u+h/2),g={width:15,height:17,left:f,top:p-8.5};return P.jsx("button",{className:lo(e,`${uf}__rename`),style:g,title:n??s.text("link_action.rename_link.title"),onClick:()=>a(xu).trigger("renameLink",{target:r})})}function xf(t){const{canvas:e,model:n}=bs(),r=Ai(Ti(n.events,"changeSelection"),(()=>{const t=1===n.selection.length?n.selection[0]:void 0;return t instanceof nl?t:void 0}));return r?P.jsx(Lf,{...t,target:r,model:n,canvas:e}):null}const Sf="reactodia-halo-link",Ef=0,Cf=20,Mf=5;class Lf extends x.Component{listener=new Ca;targetListener=new Ca;constructor(t){super(t),this.state={actionContext:Lf.makeActionContext(this.props)}}static makeActionContext(t){const{target:e,model:n,canvas:r,buttonSize:i=Cf,buttonMargin:o=Mf}=t,a=function(t,e,n){const r=e.getElement(t.sourceId),i=e.getElement(t.targetId);if(!r||!i)return;const o=n.getLinkTemplate(t),a=n.getRouting(t.id),s=a?a.vertices:t.vertices||[],l=n.getElementShape(r),c=n.getElementShape(i),u=Is(l,c,s);return Ps.create({type:o?.spline??Ps.defaultType,points:u,source:Cs.center(l.bounds),target:Cs.center(c.bounds)})}(e,n,r.renderingState);if(!a)return null;const s=Rs(a.geometry.points);return{link:e,spline:a,buttonSize:i,getPosition:(t,e)=>{const n=(i+o)*e,l=Os(a.geometry.points,"source"===t?n:s-n),{x:c,y:u}=r.metrics.paperToScrollablePaneCoords(l.x,l.y);return{top:u-i/2,left:c-i/2}},getAngleInDegrees:t=>{const{points:e}=a.geometry,n=Ss.normalize(Ss.subtract(e["source"===t?0:e.length-2],e["source"===t?1:e.length-1]));return Math.atan2(n.y,n.x)*(180/Math.PI)}}}componentDidMount(){const{canvas:t,target:e}=this.props;this.listener.listen(t.events,"changeTransform",(()=>this.forceUpdate())),this.listenToTarget(e)}componentDidUpdate(t){this.props.target!==t.target&&this.listenToTarget(this.props.target),this.props.target===t.target&&this.props.buttonSize===t.buttonSize&&this.props.buttonMargin===t.buttonMargin||this.updateActionContext()}componentWillUnmount(){this.listener.stopListening(),this.listenToTarget(void 0)}listenToTarget(t){const{model:e,canvas:n}=this.props;if(this.targetListener.stopListening(),t){const r=e.getElement(t.sourceId),i=e.getElement(t.targetId);this.targetListener.listen(r.events,"changePosition",this.updateActionContext),this.targetListener.listen(i.events,"changePosition",this.updateActionContext),this.targetListener.listen(t.events,"changeVertices",this.updateActionContext),this.targetListener.listen(n.renderingState.events,"changeElementSize",(t=>{t.source!==r&&t.source!==i||this.updateActionContext()})),this.targetListener.listen(n.renderingState.events,"changeRoutings",(e=>{e.previous.get(t.id)!==e.source.getRouting(t.id)&&this.updateActionContext()}))}}updateActionContext=()=>{this.setState(((t,e)=>({actionContext:Lf.makeActionContext(e)})))};render(){const{canvas:t,highlightMargin:e=Ef,buttonSize:n=Cf,buttonMargin:r=Mf,children:i}=this.props,{actionContext:o}=this.state;if(!o)return null;const a={"--reactodia-link-button-size":`${n}px`,"--reactodia-link-button-margin":`${r}px`};return P.jsxs(P.Fragment,{children:[P.jsx($f,{actionContext:o,style:a,margin:e,canvas:t}),P.jsx(Bl,{layer:"overElements",children:P.jsx("div",{className:Sf,style:a,children:P.jsx(lf.Provider,{value:o,children:i??P.jsxs(P.Fragment,{children:[P.jsx(bf,{dockSide:"target"}),P.jsx(bf,{dockSide:"source"}),P.jsx(ff,{dockSide:"target",dockIndex:1}),P.jsx(pf,{dockSide:"target",dockIndex:2}),P.jsx(kf,{})]})})})})]})}}function $f(t){const{actionContext:{link:e,spline:n},style:r,margin:i,canvas:o}=t,a=Ai(Ti(o.renderingState.events,"changeLinkLabelBounds"),(()=>o.renderingState.getLinkLabelBounds(e)));let s;if(a){const{x:t,y:e}=o.metrics.paperToScrollablePaneCoords(a.x,a.y),{x:n,y:r}=o.metrics.paperToScrollablePaneCoords(a.x+a.width,a.y+a.height);s={left:t-i,top:e-i,width:n-t+2*i,height:r-e+2*i}}return P.jsxs(P.Fragment,{children:[P.jsx(Bl,{layer:"overLinkGeometry",children:P.jsx(ol,{paperTransform:o.metrics.transform,className:Sf,style:{...r,overflow:"visible",pointerEvents:"none"},children:P.jsx("path",{className:`${Sf}__path-highlight`,d:n.toPath()})})}),s&&P.jsx(Bl,{layer:"overLinks",children:P.jsx("div",{className:Sf,style:r,children:P.jsx("div",{className:`${Sf}__label-highlight`,style:s})})})]})}const Nf="reactodia-inline-entity";function Tf(t){const{target:e}=t,{model:n,getElementTypeStyle:r}=ao(),i=Oi(),o=n.locale.formatEntityLabel(e,n.language),{color:a}=r(e.types);return P.jsx("span",{className:Nf,style:{"--reactodia-inline-entity-color":a},title:Ld(e,n,i),children:P.jsx("span",{className:`${Nf}__label`,children:o})})}function Af(t){const{searchStore:e,searchTimeout:n="explicit",minSearchTermLength:r=3}=t,i=zd({initialValue:"",submitTimeout:n,allowSubmit:t=>t.length>=r}),o=e??i,a=ao(),s=Oi();return P.jsx(If,{...t,isControlled:Boolean(e),searchStore:o,minSearchTermLength:r,workspace:a,translation:s})}const zf="reactodia-instances-search";class If extends x.Component{listener=new Ca;criteriaListener=new Ca;searchListener=new Ca;delayedUpdateAll=new Ma;requestCancellation=new AbortController;currentRequest;constructor(t){super(t),this.state={criteria:{},resultId:0,selection:new Set}}componentDidMount(){const{workspace:t}=this.props,{model:e}=t;this.listener.listen(e.events,"changeLanguage",(()=>this.forceUpdate())),this.listener.listen(e.events,"loadingStart",(()=>{this.setState({criteria:{}},(()=>this.props.searchStore.change({value:"",action:"clear"})))}));const n=t.getCommandBus(Eu);this.listener.listen(n,"findCapabilities",(t=>{t.capabilities.push({})})),this.listener.listen(n,"setCriteria",(({criteria:t})=>{const{searchStore:e,onChangeCriteria:n,workspace:{triggerWorkspaceEvent:r}}=this.props;r(io.searchUpdateCriteria),this.setState({criteria:t},(()=>{e.change({value:t.text??"",action:"clear"}),n?.(this.state.criteria)}))})),this.listenSearch(),this.resubscribeToCriteria(),this.queryItems(!1)}componentDidUpdate(t,e){this.props.searchStore.events!==t.searchStore.events&&this.listenSearch(),this.state.criteria!==e.criteria&&(this.resubscribeToCriteria(),this.queryItems(!1))}listenSearch(){const{searchStore:t}=this.props;this.searchListener.stopListening(),this.searchListener.listen(t.events,"executeSearch",(({value:t})=>{this.submitCriteriaUpdate(t,{triggerChange:!1})})),this.searchListener.listen(t.events,"clearSearch",(()=>{this.submitCriteriaUpdate("",{triggerChange:!1})}))}componentWillUnmount(){this.listener.stopListening(),this.criteriaListener.stopListening(),this.searchListener.stopListening(),this.requestCancellation.abort(),this.currentRequest=void 0}resubscribeToCriteria(){const{workspace:{model:t}}=this.props,{criteria:e}=this.state;if(this.criteriaListener.stopListening(),e.elementType){const n=t.createElementType(e.elementType);n&&this.criteriaListener.listen(n.events,"changeData",this.scheduleUpdateAll)}if(e.refElement){const n=t.elements.find((t=>t instanceof oc&&t.iri===e.refElement));n&&this.criteriaListener.listen(n.events,"changeData",this.scheduleUpdateAll)}if(e.refElementLink){const n=t.createLinkType(e.refElementLink);n&&this.criteriaListener.listen(n.events,"changeData",this.scheduleUpdateAll)}}scheduleUpdateAll=()=>{this.delayedUpdateAll.call(this.updateAll)};updateAll=()=>this.forceUpdate();render(){const{className:t,isControlled:e,searchStore:n,minSearchTermLength:r,translation:i}=this.props,o=this.state.querying?"loading":this.state.error?"error":this.state.items?"completed":"none",a=this.state.items??[],s=this.state.querying||0===this.state.selection.size;return P.jsxs("div",{className:lo(zf,e?`${zf}--controlled`:void 0,t),children:[P.jsxs("div",{className:`${zf}__criteria`,children:[this.renderCriteria(),e?null:P.jsx(Ad,{store:n,className:`${zf}__text-criteria`,inputProps:{name:"reactodia-instances-search-text",placeholder:i.textOptional("search_entities.input.placeholder")}})]}),P.jsx(Nd,{state:o,title:i.text("search_entities.query_progress.title")}),P.jsxs("div",{className:`${zf}__rest reactodia-scrollable`,children:[P.jsx(Rd,{items:a,highlightText:this.state.criteria.text,selection:this.state.selection,onSelectionChanged:this.onSelectionChanged,footer:0===a.length?P.jsx(Vd,{hasQuery:void 0!==this.state.items,minSearchTermLength:r}):null}),P.jsx("div",{className:`${zf}__rest-end`,children:P.jsx("button",{type:"button",className:`${zf}__load-more reactodia-btn reactodia-btn-primary`,disabled:this.state.querying,style:{display:this.state.moreItemsAvailable?void 0:"none"},title:i.text("search_entities.show_more_results.title"),onClick:()=>this.queryItems(!0),children:i.text("search_entities.show_more_results.label")})})]},this.state.resultId),P.jsxs("div",{className:lo(`${zf}__actions`,s?`${zf}__actions-hidden`:void 0),"aria-hidden":s?"true":void 0,children:[P.jsx("button",{type:"button",className:`${zf}__action reactodia-btn reactodia-btn-secondary`,disabled:this.state.querying||this.state.selection.size<=1,title:i.text("search_entities.add_group.title"),onClick:()=>this.placeSelectedItems("group"),children:i.text("search_entities.add_group.label")}),P.jsx("button",{type:"button",className:`${zf}__action reactodia-btn reactodia-btn-primary`,disabled:this.state.querying||0===this.state.selection.size,title:i.text("search_entities.add_selected.title"),onClick:()=>this.placeSelectedItems("separately"),children:i.text("search_entities.add_selected.label")})]})]})}onSelectionChanged=t=>{this.setState({selection:t})};renderCriteria(){const{workspace:{model:t},translation:e}=this.props,{criteria:n}=this.state,r=[];if(n.elementType){const i=t.getElementType(n.elementType),o=e.formatLabel(i?.data?.label,n.elementType,t.language);r.push(P.jsxs("div",{className:`${zf}__criterion`,children:[this.renderRemoveCriterionButtons((()=>this.setState({criteria:{...n,elementType:void 0}},(()=>this.props.onChangeCriteria?.(this.state.criteria))))),e.template("search_entities.criteria_has_type",{entityType:P.jsx("span",{className:`${zf}__criterion-class`,title:n.elementType,children:o})})]},"hasType"))}else if(n.refElement){const i=function(t,e){for(const n of t.elements)for(const t of lc(n))if(t.id===e)return t}(t,n.refElement)??oc.placeholderData(n.refElement);let o;if(n.refElementLink){const r=t.getLinkType(n.refElementLink);o=e.formatLabel(r?.data?.label,n.refElementLink,t.language)}const a=P.jsx(Tf,{target:i}),s=n.refElementLink?P.jsx("span",{className:`${zf}__criterion-link-type`,title:n.refElementLink,children:o}):void 0,l=P.jsx("span",{className:`${zf}__link-direction-in`}),c=P.jsx("span",{className:`${zf}__link-direction-out`});r.push(P.jsxs("div",{className:`${zf}__criterion`,children:[this.renderRemoveCriterionButtons((()=>this.setState({criteria:{...n,refElement:void 0,refElementLink:void 0}},(()=>this.props.onChangeCriteria?.(this.state.criteria))))),e.template(n.refElementLink?"in"===n.linkDirection?"search_entities.criteria_connected_to_source":"out"==n.linkDirection?"search_entities.criteria_connected_to_target":"search_entities.criteria_connected_via":"search_entities.criteria_connected",{entity:a,relationType:s,sourceIcon:l,targetIcon:c})]},"hasLinkedElement"))}return P.jsx("div",{className:`${zf}__criterions`,children:r})}renderRemoveCriterionButtons(t){return P.jsx("div",{className:`${zf}__criterion-remove reactodia-btn-group reactodia-btn-group-xs`,children:P.jsx("button",{type:"button",title:"Remove criteria",className:lo(`${zf}__criterion-remove-button`,"reactodia-btn reactodia-btn-default"),onClick:t})})}submitCriteriaUpdate(t,e){const{onChangeCriteria:n}=this.props;this.setState((e=>{const n=""===t?void 0:t;return e.criteria.text===n?null:{criteria:{...e.criteria,text:n}}}),e.triggerChange?()=>n?.(this.state.criteria):void 0)}queryItems(t){const{workspace:{model:e,triggerWorkspaceEvent:n}}=this.props;let r;if(this.requestCancellation.abort(),t){if(!this.currentRequest)throw new Error("Cannot request more items without initial request.");const{limit:t}=this.currentRequest;r={...this.currentRequest,limit:"number"==typeof t?t+100:t}}else r=Rf(this.state.criteria);if(!(r.text||r.elementTypeId||r.refElementId||r.refElementLinkId))return void this.setState({querying:!1,error:void 0,items:void 0,selection:new Set,moreItemsAvailable:!1});this.requestCancellation=new AbortController;const i=this.requestCancellation.signal;r={...r,signal:i},this.currentRequest=r,this.setState({querying:!0,error:void 0,moreItemsAvailable:!1}),e.dataProvider.lookup(r).then((t=>{i.aborted||(this.processFilterData(t),n(io.searchQueryItem))})).catch((t=>{i.aborted||(console.error(t),this.setState({querying:!1,error:t}))}))}processFilterData(t){const e="number"==typeof this.currentRequest.limit&&this.currentRequest.limit>100,n=new Set;if(e)for(const t of this.state.items)n.add(t.id);const r=e?[...this.state.items]:[];for(const{element:e}of t)n.has(e.id)||r.push(e);const i="number"==typeof this.currentRequest.limit&&t.length>=this.currentRequest.limit;this.setState(e?{querying:!1,items:r,error:void 0,moreItemsAvailable:i}:{querying:!1,resultId:this.state.resultId+1,items:r,selection:new Set,error:void 0,moreItemsAvailable:i})}placeSelectedItems(t){const{onAddElements:e,workspace:{model:n,view:r}}=this.props,i=r.findAnyCanvas(),{items:o,selection:a}=this.state;if(!i||0===a.size)return;const s=n.history.startBatch(Pi.text("search_entities.place_elements.command")),l=o?o.filter((t=>a.has(t.id))):Array.from(a,oc.placeholderData);let c;if("separately"===t){const t=new el({position:Of(i,.3,.5)});c=l.map((t=>n.createElement(t))),i.renderingState.syncUpdate(),s.history.execute(Js({target:t,elements:c,graph:n,sizeProvider:i.renderingState,distance:150}))}else{const t=new ac({items:l.map((t=>({data:t}))),position:Of(i,.5,.5)});c=[t],n.addElement(t),i.renderingState.syncUpdate();const{x:e,y:r,width:o,height:a}=Ts(t,i.renderingState);t.setPosition({x:e-o/2,y:r-a/2})}const u=Array.from(a);s.history.execute($c(n,u)),s.history.execute(Nc(n,{addedElements:u})),s.store(),e?.(c)}}function Rf(t){const{text:e,elementType:n,refElement:r,refElementLink:i,linkDirection:o}=t;return{text:e,elementTypeId:n,refElementId:r,refElementLinkId:i,linkDirection:o,limit:100}}function Of(t,e,n){const r=t.metrics.pane;return t.metrics.clientToPaperCoords(r.clientWidth*e,r.clientHeight*n)}function Pf(t){const{searchStore:e,searchTimeout:n=200,minSearchTermLength:r=1}=t,i=zd({initialValue:"",submitTimeout:n,allowSubmit:t=>t.length>=r}),o=e??i,a=ao(),s=Oi();return P.jsx(Df,{...t,isControlled:Boolean(e),searchStore:o,minSearchTermLength:r,workspace:a,translation:s})}const Vf="reactodia-links-toolbox",jf=!0;class Df extends x.Component{listener=new Ca;selectionListener=new Ca;searchListener=new Ca;linkListener=new Ca;debounceSelection=new Ma(50);delayedUpdateAll=new Ma;constructor(t){super(t),this.state={filteredLinks:{term:"",diagramHasLink:!1,selection:[],selectionLinks:new Set,links:[]}}}componentDidMount(){const{workspace:{model:t}}=this.props;this.listener.listen(t.events,"loadingSuccess",this.updateOnCurrentSelection),this.listener.listen(t.events,"changeLanguage",this.updateOnCurrentSelection),this.subscribeToSelectionChanges(),this.listenSearch(),this.updateOnCurrentSelection()}componentDidUpdate(t,e){const{trackSelected:n=jf,searchStore:r}=this.props;n!==t.trackSelected&&this.subscribeToSelectionChanges(),r.events!==t.searchStore.events&&this.listenSearch(),this.state.filteredLinks!==e.filteredLinks&&this.subscribeOnFilteredLinksEvents()}listenSearch(){const{searchStore:t}=this.props;this.searchListener.stopListening(),this.searchListener.listen(t.events,"executeSearch",(({value:t})=>{this.setState(((e,n)=>Hf(e,t,n)))})),this.searchListener.listen(t.events,"clearSearch",(()=>{this.setState(((t,e)=>Hf(t,"",e)))}))}componentWillUnmount(){this.listener.stopListening(),this.selectionListener.stopListening(),this.searchListener.stopListening(),this.linkListener.stopListening(),this.debounceSelection.dispose(),this.delayedUpdateAll.dispose()}subscribeToSelectionChanges(){const{trackSelected:t=jf,workspace:{model:e}}=this.props;this.selectionListener.stopListening(),t&&this.selectionListener.listen(e.events,"changeSelection",(()=>{this.debounceSelection.call(this.updateOnCurrentSelection)}))}updateOnCurrentSelection=()=>{this.setState(((t,e)=>Hf(t,e.searchStore.value,e)))};subscribeOnFilteredLinksEvents(){const{workspace:{model:t}}=this.props,{filteredLinks:e}=this.state;this.linkListener.stopListening();const n=new Set;for(const t of e.links)n.add(t.iri),this.linkListener.listen(t.type.events,"changeData",this.onLinkChanged);this.linkListener.listen(t.events,"changeLinkVisibility",(t=>{n.has(t.source)&&this.onLinkChanged()}))}onLinkChanged=()=>{this.delayedUpdateAll.call((()=>this.forceUpdate()))};render(){const{className:t,isControlled:e,searchStore:n,minSearchTermLength:r,workspace:i,translation:o}=this.props,{filteredLinks:a}=this.state,s=a.links.filter((t=>a.selectionLinks.has(t.iri))),l=a.links.filter((t=>!a.selectionLinks.has(t.iri)));return P.jsxs("div",{className:lo(Vf,e?`${Vf}--controlled`:void 0,t),children:[P.jsxs("div",{className:`${Vf}__heading`,children:[e?null:P.jsx(Ad,{store:n,className:`${Vf}__filter`,inputProps:{name:"reactodia-link-types-filter",placeholder:o.textOptional("search_link_types.input.placeholder")}}),P.jsxs("div",{className:`${Vf}__switch-all`,children:[P.jsx(Ff,{onSetVisibility:t=>Uf(a.links,t,i),disabled:0===a.links.length}),P.jsxs("span",{children:[" ",o.text("search_link_types.switch_all.label")]})]})]}),P.jsx("div",{className:`${Vf}__rest`,children:P.jsxs("div",{className:"reactodia-scrollable",children:[s.length>0?P.jsxs(P.Fragment,{children:[P.jsx("div",{role:"heading",className:`${Vf}__links-heading`,children:1===a.selection.length?o.template("search_link_types.heading_connected_single",{entity:P.jsx(Tf,{target:a.selection[0]})}):o.template("search_link_types.heading_connected",{count:a.selection.length})}),this.renderLinks(s)]}):null,s.length>0&&l.length>0?P.jsx("div",{role:"heading",className:`${Vf}__links-heading`,children:o.template("search_link_types.heading_other",{count:l.length})}):null,this.renderLinks(l),0===a.links.length?P.jsx(Vd,{className:`${Vf}__no-results`,hasQuery:a.term.length>0,minSearchTermLength:r,message:a.diagramHasLink?void 0:o.text("search_link_types.no_results")}):null]})})]})}renderLinks(t){const{workspace:{getCommandBus:e}}=this.props,{filteredLinks:n}=this.state,r=e(Eu),i={capabilities:[]};return r.trigger("findCapabilities",i),P.jsx("ul",{className:`${Vf}__links`,children:t.map((t=>P.jsx(Bf,{link:t,onAddToFilter:i.capabilities.length>0&&n.selectionLinks.has(t.iri)?this.onAddToFilter:void 0,filterKey:n.term},t.iri)))})}onAddToFilter=t=>{const{workspace:{getCommandBus:e}}=this.props,{filteredLinks:n}=this.state;1===n.selection.length&&e(Eu).trigger("setCriteria",{criteria:{refElement:n.selection[0].id,refElementLink:t}})}}function Hf(t,e,n){const{trackSelected:r=jf,workspace:{model:i},translation:o}=n,a=new Set;for(const t of i.links)(t instanceof cc||t instanceof dc)&&a.add(t.typeId);const s=Da(e),l=Array.from(a,(t=>i.createLinkType(t))).map((t=>({iri:t.id,type:t,label:o.formatLabel(t.data?.label,t.id,i.language)}))).filter((t=>s(t.label))).sort(((t,e)=>t.label.localeCompare(e.label))),c=new Map,u=new Set;if(r)for(const t of i.selection)if(t instanceof tl){for(const e of lc(t))c.set(e.id,e);for(const e of i.getElementLinks(t))u.add(e.typeId)}return{...t,filteredLinks:{term:e,diagramHasLink:a.size>0,selection:Array.from(c.values()),selectionLinks:u,links:l}}}function Bf(t){const{link:e,filterKey:n,onAddToFilter:r}=t,i=ao(),o=Oi(),{model:a}=i;return P.jsxs("li",{"data-linktypeid":e.iri,className:`${Vf}__link-item`,children:[P.jsx(Ff,{className:`${Vf}__link-buttons`,visibility:a.getLinkVisibility(e.iri),onSetVisibility:t=>Uf([e],t,i)}),P.jsx(vu,{type:"linkType",target:e.iri,children:P.jsx("div",{className:`${Vf}__link-title`,children:Md(e.label,n)})}),r?P.jsx("div",{className:`${Vf}__filter-button`,title:o.text("search_link_types.add_to_filter.title"),onClick:()=>r(e.iri)}):null]})}function Ff(t){const{className:e,visibility:n,onSetVisibility:r,disabled:i}=t,o=Oi();return P.jsxs("div",{className:lo(e,"reactodia-btn-group reactodia-btn-group-xs"),children:[P.jsx("button",{title:o.text("search_link_types.switch_hidden.title"),className:lo(`${Vf}__toggle-invisible`,"reactodia-btn reactodia-btn-default","hidden"===n?"active":void 0),disabled:i,onClick:()=>r("hidden")}),P.jsx("button",{title:o.text("search_link_types.switch_without_label.title"),className:lo(`${Vf}__toggle-lines-only`,"reactodia-btn reactodia-btn-default","withoutLabel"===n?"active":void 0),disabled:i,onClick:()=>r("withoutLabel")}),P.jsx("button",{title:o.text("search_link_types.switch_visible.title"),className:lo(`${Vf}__toggle-visible`,"reactodia-btn reactodia-btn-default","visible"===n?"active":void 0),disabled:i,onClick:()=>r("visible")})]})}function Uf(t,e,n){const{model:r}=n,i=r.history.startBatch(Pi.text("search_link_types.switch.command"));for(const n of t)r.history.execute(Ys(r,n.iri,e));i.store()}function Wf(t){const{canvas:e}=bs(),n=ao(),r=Oi(),i=x.useContext(xa);return P.jsx(Yf,{...t,canvas:e,workspace:n,translation:r,colorScheme:i})}const qf="reactodia-navigator",Gf="auto",Zf=.4,Kf=300,Qf=160,Xf=.2;class Yf extends x.Component{delayedRedraw=new Ma;delayedSizeCheck=new Ma;listener=new Ca;canvas;transform;isDraggingViewport=!1;constructor(t){super(t);const{expanded:e=Gf}=this.props;this.state={expanded:Boolean(e),autoToggle:"auto"===e,allowExpand:!0}}componentDidMount(){const{canvas:t,workspace:{model:e}}=this.props,{renderingState:n}=t;this.listener.listen(e.events,"changeCells",this.scheduleRedraw),this.listener.listen(e.events,"elementEvent",this.scheduleRedraw),this.listener.listen(t.events,"pointerMove",this.scheduleRedraw),this.listener.listen(t.events,"scroll",this.scheduleRedraw),this.listener.listen(t.events,"resize",(()=>{this.delayedSizeCheck.call(this.onCheckSize)})),this.listener.listen(n.shared.events,"changeHighlight",this.scheduleRedraw),this.listener.listen(n.events,"changeElementSize",this.scheduleRedraw),this.onCheckSize()}shouldComponentUpdate(t,e){return!(t.colorScheme===this.props.colorScheme&&t.dock===this.props.dock&&t.dockOffsetX===this.props.dockOffsetX&&t.dockOffsetY===this.props.dockOffsetY&&t.width===this.props.width&&t.height===this.props.height&&e===this.state)}componentDidUpdate(t){this.props.colorScheme!==t.colorScheme&&this.scheduleRedraw()}componentWillUnmount(){this.delayedRedraw.dispose(),this.delayedSizeCheck.dispose(),this.listener.stopListening(),this.stopDragViewport()}scheduleRedraw=()=>{this.state.expanded&&this.delayedRedraw.call(this.draw)};draw=()=>{const{canvas:t,workspace:{model:e},width:n=Kf,height:r=Qf}=this.props,i=t.metrics.transform;this.calculateTransform(i);const o=function(t,e){const{backgroundFill:n,scrollablePaneFill:r,viewportFill:i,viewportStroke:o,overflowStroke:a}=t,s=getComputedStyle(e);return{backgroundFill:n??s.getPropertyValue("--reactodia-navigator-background-fill"),scrollablePaneFill:r??s.getPropertyValue("--reactodia-navigator-scrollable-pane-fill"),viewportFill:i??s.getPropertyValue("--reactodia-navigator-viewport-fill"),viewportStroke:o??Jf(s.getPropertyValue("--reactodia-navigator-viewport-stroke-color"),s.getPropertyValue("--reactodia-navigator-viewport-stroke-width"),s.getPropertyValue("--reactodia-navigator-viewport-stroke-dash")),overflowStroke:a??Jf(s.getPropertyValue("--reactodia-navigator-overflow-stroke-color"),s.getPropertyValue("--reactodia-navigator-overflow-stroke-width"),s.getPropertyValue("--reactodia-navigator-overflow-stroke-dash"))}}(this.props,this.canvas),a=this.canvas.getContext("2d");if(a.fillStyle=o.backgroundFill,a.clearRect(0,0,n,r),a.fillRect(0,0,n,r),0===e.elements.length)return;const s=function(t){return{x:-t.paddingX,y:-t.paddingY}}(i),l=Ss.add(s,function(t){return{x:t.width*t.scale+2*t.paddingX,y:t.height*t.scale+2*t.paddingY}}(i)),c=ep(s,0,this.transform),u=ep(l,0,this.transform);a.fillStyle=o.scrollablePaneFill,a.fillRect(c.x,c.y,u.x-c.x,u.y-c.y),a.save();const{clientWidth:d,clientHeight:h}=t.metrics.pane,f=t.metrics.clientToScrollablePaneCoords(0,0),p=t.metrics.clientToScrollablePaneCoords(d,h),{x:g,y:v}=ep(f,0,this.transform),{x:m,y:b}=ep(p,0,this.transform),w={x:g,y:v,width:m-g,height:b-v};this.fillViewport(a,w,o),this.drawElements(a,i,o),this.strokeViewport(a,w,o),a.restore()};drawElements(t,e,n){const{canvas:r,workspace:{model:i}}=this.props;for(const o of i.elements){const{type:i,bounds:{x:a,y:s,width:l,height:c}}=r.renderingState.getElementShape(o);t.beginPath(),t.fillStyle=this.chooseElementColor(o,n);const{x:u,y:d}=np({x:a,y:s},e,this.transform),{x:h,y:f}=np({x:a+l,y:s+c},e,this.transform);"ellipse"===i?t.ellipse((u+h)/2,(d+f)/2,(h-u)/2,(f-d)/2,0,2*Math.PI,0):t.rect(u,d,h-u,f-d),t.fill()}}chooseElementColor(t,e){const{canvas:n,workspace:{getElementStyle:r}}=this.props,{highlighter:i}=n.renderingState.shared;if(i&&!i(t))return"lightgray";const{color:o}=r(t);return o}fillViewport(t,e,n){t.fillStyle=n.viewportFill,t.fillRect(e.x,e.y,e.width,e.height)}strokeViewport(t,e,n){const{width:r=Kf,height:i=Qf}=this.props,{x:o,y:a}=e,s=o+e.width,l=a+e.height;if(tp(t,n.viewportStroke),t.strokeRect(o,a,s-o,l-a),t.beginPath(),o<0){const e=t.lineWidth;t.moveTo(e,a),t.lineTo(e,l)}if(a<0){const e=t.lineWidth;t.moveTo(o,e),t.lineTo(s,e)}if(s>r){const e=r-t.lineWidth;t.moveTo(e,a),t.lineTo(e,l)}if(l>i){const e=i-t.lineWidth;t.moveTo(o,e),t.lineTo(s,e)}tp(t,n.overflowStroke),t.stroke()}calculateTransform(t){const{canvas:e,workspace:{model:n},width:r=Kf,height:i=Qf,scalePadding:o=Xf}=this.props,a=js(n.elements,n.links,e.renderingState),s=Math.max(a.width,r/.25)*o,l=Math.max(a.height,i/.25)*o,c=sl({x:a.x-s,y:a.y-l},t),u=sl({x:a.x+a.width+s,y:a.y+a.height+l},t),d=u.x-c.x,h=u.y-c.y,f=Math.min(r/d,i/h);this.transform={scale:f,canvasOffset:{x:(r-d*f)/2,y:(i-h*f)/2},paneOffset:c}}canvasFromPageCoords(t,e){const{top:n,left:r}=this.canvas.getBoundingClientRect();return{x:t-r-window.scrollX,y:e-n-window.scrollY}}onCheckSize=()=>{const{canvas:t,autoCollapseFraction:e=Zf,width:n=Kf,height:r=Qf}=this.props,{expanded:i,autoToggle:o,allowExpand:a}=this.state,{clientWidth:s,clientHeight:l}=t.metrics.pane,c=n<.9*s&&r<.9*l,u=c&&n<s*e&&r<l*e;o&&i!==u?this.setState({expanded:u,allowExpand:c},this.scheduleRedraw):c!==a&&this.setState({allowExpand:c})};render(){const{dock:t="se",dockOffsetX:e,dockOffsetY:n,width:r=Kf,height:i=Qf,translation:o}=this.props,{expanded:a,allowExpand:s}=this.state,l=a&&s;return P.jsx(au,{dock:t,dockOffsetX:e,dockOffsetY:n,children:P.jsxs("div",{className:`${qf} ${qf}--${l?"expanded":"collapsed"}`,style:l?{width:r,height:i}:void 0,children:[P.jsx("canvas",{ref:this.onCanvasMount,width:r,height:i,onMouseDown:t=>{this.startDragViewport(),this.onDragViewport(t)},onWheel:this.onWheel}),P.jsx("button",{type:"button",className:`${qf}__toggle`,title:o.text(a?"navigator.toggle_collapse.title":"navigator.toggle_expand.title"),disabled:!s,onClick:this.onToggleClick,children:P.jsx("div",{className:`${qf}__toggle-icon`})})]})})}onCanvasMount=t=>{this.canvas=t};startDragViewport(){this.isDraggingViewport||(this.isDraggingViewport=!0,document.addEventListener("mousemove",this.onDragViewport),document.addEventListener("mouseup",this.onMouseUp))}stopDragViewport(){this.isDraggingViewport&&(this.isDraggingViewport=!1,document.removeEventListener("mousemove",this.onDragViewport),document.removeEventListener("mouseup",this.onMouseUp))}onDragViewport=t=>{if(t.preventDefault(),this.isDraggingViewport){const{canvas:e}=this.props,n=function(t,e,n){return ll({x:n.paneOffset.x+(t.x-n.canvasOffset.x)/n.scale,y:n.paneOffset.y+(t.y-n.canvasOffset.y)/n.scale},e)}(this.canvasFromPageCoords(t.pageX,t.pageY),e.metrics.transform,this.transform);e.centerTo(n)}};onMouseUp=()=>{this.stopDragViewport()};onWheel=t=>{t.preventDefault();const{canvas:e}=this.props,n=Math.max(-1,Math.min(1,t.deltaY||t.deltaX));e.zoomBy(.1*-n)};onToggleClick=()=>{this.setState((t=>({expanded:!t.expanded,autoToggle:!1})),this.scheduleRedraw)}}function Jf(t,e,n){const r=Number(e),i=n.split(" ").map((t=>Number(t)));return{color:t||void 0,width:Number.isFinite(r)?r:void 0,dash:i.every((t=>Number.isFinite(t)))?i:void 0}}function tp(t,e){const{color:n="transparent",width:r=1,dash:i=[]}=e;t.strokeStyle=n,t.lineWidth=r,t.setLineDash(i)}function ep(t,e,n){return{x:n.canvasOffset.x+(t.x-n.paneOffset.x)*n.scale,y:n.canvasOffset.y+(t.y-n.paneOffset.y)*n.scale}}function np(t,e,n){return ep(sl(t,e),0,n)}const rp="reactodia-selection";function ip(t){const{hotkeySelectAll:e}=t,{model:n,canvas:r}=bs(),i=zi(Ti(n.events,"changeSelection"),(()=>n.selection.filter((t=>t instanceof tl))),ki),[o,a]=x.useState();return x.useEffect((()=>{let t;const e=new Ca;let i;e.listen(r.events,"pointerDown",(e=>{if(!e.target&&!e.panning&&e.sourceEvent.shiftKey===("selection"!==e.source.pointerMode)){e.sourceEvent.preventDefault();const{pageX:n,pageY:i}=e.sourceEvent;t={pageX:n,pageY:i},a(op(t,t,r.metrics)),o()}}));const o=()=>{i?.stopListening(),i=new Ca,i.listen(r.events,"pointerMove",(e=>{const{pageX:n,pageY:i}=e.sourceEvent;t&&a(op(t,{pageX:n,pageY:i},r.metrics))}))};return e.listen(r.events,"pointerUp",(e=>{const{pageX:o,pageY:s}=e.sourceEvent;i?.stopListening(),a(void 0),e.triggerAsClick?(e.sourceEvent.shiftKey===("selection"!==e.source.pointerMode)||n.selection.length>1)&&e.target instanceof tl&&(e.sourceEvent.preventDefault(),sp(e.target,n)):t&&function(t,e,n){const r=new Set(e.selection),i=Array.from(ap(e.elements,t,r,n.renderingState));i.length>0&&e.setSelection([...e.selection,...i])}(op(t,{pageX:o,pageY:s},r.metrics),n,r),t=void 0})),()=>{e.stopListening(),i?.stopListening()}}),[]),xs(void 0===e?"Mod+A":e,(()=>{n.setSelection(n.elements)})),o||i.length>1?P.jsx(Bl,{layer:"overElements",children:P.jsx(lp,{...t,model:n,canvas:r,selectedElements:i,highlightedBox:o})}):null}function op(t,e,n){const{x:r,y:i}=n.pageToPaperCoords(t.pageX,t.pageY),{x:o,y:a}=n.pageToPaperCoords(e.pageX,e.pageY);return{x:Math.min(r,o),y:Math.min(i,a),width:Math.abs(o-r),height:Math.abs(a-i)}}function*ap(t,e,n,r){for(const i of t){const t=Ts(i,r);!n.has(i)&&Cs.intersects(e,t)&&(yield i)}}function sp(t,e){const{selection:n}=e,r=n.includes(t)?n.filter((e=>e!=t)):[...n,t];e.setSelection(r)}function lp(t){const{model:e,canvas:n,selectedElements:r,highlightedBox:i,boxMargin:o=5,itemMargin:a=2,children:s}=t;Ai(Ti(n.events,"changeTransform"),(()=>n.metrics.transform));const l=function(t,e,n){return x.useCallback((r=>{if(0===n.length)return()=>{};const i=new Set(n),o=new Ca;return o.listen(t.events,"elementEvent",(({data:t})=>{t.changePosition&&i.has(t.changePosition.source)&&r()})),o.listen(e.renderingState.events,"changeElementSize",(t=>{i.has(t.source)&&r()})),()=>o.stopListening()}),[t.events,e.renderingState.events,n])}(e,n,r),c=cp(zi(pl(l,n.renderingState),(()=>js(r,[],n.renderingState)),Cs.equals),o,n.metrics),u=i?Array.from(ap(e.elements,i,new Set(r),n.renderingState)):[],d=x.useRef(void 0);d.current||(d.current=new up(n,e)),x.useEffect((()=>()=>{d.current?.onPointerUp()}),[]);const h=d.current;return h.setElements(r),P.jsxs("div",{className:rp,children:[r.length>1?P.jsxs(P.Fragment,{children:[r.map((t=>P.jsx("div",{className:`${rp}__selectedItem`,style:cp(Ts(t,n.renderingState),a,n.metrics)},t.id))),P.jsx("div",{className:`${rp}__selectedActions`,style:c,children:s??P.jsxs(P.Fragment,{children:[P.jsx(qh,{dock:"nw",dockColumn:1}),P.jsx(Gh,{dock:"nw",dockColumn:2}),P.jsx(Yh,{dock:"nw",dockColumn:3}),P.jsx(Wh,{dock:"ne"}),P.jsx(Qh,{dock:"e"}),P.jsx(Zh,{dock:"s"}),P.jsx(nf,{dock:"se",dockColumn:1})]})}),P.jsx("div",{className:`${rp}__selectedBox`,style:c,onClick:h.onClick,onPointerDown:h.onPointerDown,onPointerMove:h.onPointerMove,onPointerUp:h.onPointerUp,onPointerCancel:h.onPointerUp})]}):null,i?P.jsx("div",{className:`${rp}__highlightedBox`,style:cp(i,0,n.metrics)}):null,u.map((t=>P.jsx("div",{className:`${rp}__highlightedItem`,style:cp(Ts(t,n.renderingState),a,n.metrics)},t.id)))]})}function cp(t,e,n){const{x:r,y:i}=n.paperToScrollablePaneCoords(t.x,t.y),{x:o,y:a}=n.paperToScrollablePaneCoords(t.x+t.width,t.y+t.height);return{left:r-e,top:i-e,width:o-r+2*e,height:a-i+2*e}}class up{constructor(t,e){this.canvas=t,this.model=e}elements=[];moveState;setElements(t){this.elements=t}onClick=t=>{if(this.isToggleSelectionEvent(t)){t.preventDefault();const e=this.canvas.metrics.pageToPaperCoords(t.pageX,t.pageY),n=Vs(this.model.elements,e,this.canvas.renderingState);n&&sp(n,this.model)}};onPointerDown=t=>{const{canvas:e,model:n,elements:r}=this;if(this.isToggleSelectionEvent(t))return;t.preventDefault(),t.currentTarget.setPointerCapture(t.pointerId);const i=e.metrics.pageToPaperCoords(t.pageX,t.pageY),o=new Set;for(const t of r)o.add(t.id);const a=new Map,s=new Map;for(const t of r){a.set(t,t.position);for(const e of n.getElementLinks(t))e.vertices.length>0&&e.sourceId===t.id&&o.has(e.targetId)&&s.set(e,e.vertices)}this.moveState={origin:i,positions:a,links:s,command:qs.capturePartial(r,Array.from(s.keys()))},e.focus()};isToggleSelectionEvent(t){return t.shiftKey}onPointerMove=t=>{const{canvas:e,moveState:n}=this;if(n){t.preventDefault();const{x:r,y:i}=e.metrics.pageToPaperCoords(t.pageX,t.pageY),o=r-n.origin.x,a=i-n.origin.y;for(const[t,e]of n.positions)t.setPosition({x:e.x+o,y:e.y+a});for(const[t,e]of n.links)t.setVertices(e.map((t=>({x:t.x+o,y:t.y+a}))));e.renderingState.syncUpdate()}};onPointerUp=t=>{this.moveState&&(t?.preventDefault(),this.moveState.command.hasChanges()&&this.model.history.registerToUndo(this.moveState.command),this.moveState=void 0)}}const dp="reactodia-toolbar";function hp(t){const{dock:e,dockOffsetX:n,dockOffsetY:r,menu:i,children:o}=t,a=Oi(),s="s"===e||"sw"===e||"se"===e;return P.jsx(au,{dock:e,dockOffsetX:n,dockOffsetY:r,children:P.jsxs("div",{className:lo(dp,s?`${dp}--drop-up`:void 0),role:"toolbar",children:[i?P.jsx(md,{className:`${dp}__menu`,direction:s?"up":"down",title:a.text("toolbar.menu_toggle.title"),children:i}):null,o?P.jsx("div",{className:lo(`${dp}__quick-access-group`,"reactodia-btn-group","reactodia-btn-group-sm"),children:o}):null]})})}const fp="reactodia-toolbar-action";function pp(t){const{className:e,title:n,disabled:r,hotkey:i,onSelect:o,children:a}=t,s=xd(),l=xs(i,o),c=n&&l?`${n} (${l.text})`:n;return s?P.jsxs(kd,{className:e,title:c,"aria-label":n,"aria-keyshortcuts":l?.text,disabled:r,onSelect:o,children:[a,l?P.jsxs(P.Fragment,{children:[P.jsx("span",{className:`${fp}__spacer`}),P.jsx("span",{className:`${fp}__hotkey`,children:l.text})]}):null]}):P.jsx("button",{type:"button",className:lo(e,"reactodia-btn reactodia-btn-default"),title:c,"aria-label":n,"aria-keyshortcuts":l?.text,disabled:r,onClick:o,children:a})}function gp(t){const{className:e,title:n,...r}=t,{model:i,editor:o}=ao(),a=Oi();return P.jsx(pp,{...r,className:lo(e,`${fp}__clear-all`),title:n??a.text("toolbar_action.clear_all.title"),onSelect:()=>{const t=i.history.startBatch(Pi.text("toolbar_action.clear_all.command"));o.removeItems([...i.elements]),t.store()},children:a.text("toolbar_action.clear_all.label")})}function vp(t){const{className:e,title:n,kind:r,fileName:i="diagram",rasterOptions:o,children:a,...s}=t,{canvas:l}=bs(),c=Oi();return"exportRaster"===r?P.jsx(pp,{...s,className:lo(e,`${fp}__export-image`),title:n??c.text("toolbar_action.export_raster.title"),onSelect:async()=>{const t=o??{backgroundColor:"white"},e=function(t){const e=";base64,";if(-1===t.indexOf(e)){const e=t.split(","),n=e[0].split(":")[1],r=decodeURIComponent(e[1]);return new Blob([r],{type:n})}{const n=t.split(e),r=n[0].split(":")[1],i=window.atob(n[1]),o=i.length,a=new Uint8Array(o);for(let t=0;t<o;++t)a[t]=i.charCodeAt(t);return new Blob([a],{type:r})}}(await l.exportRaster(t));ya.saveAs(e,`${i}.png`)},children:a??c.text("toolbar_action.export_raster.label")}):"exportSvg"===r?P.jsx(pp,{...s,className:lo(e,`${fp}__export-image`),title:n??c.text("toolbar_action.export_svg.title"),onSelect:async()=>{const t=await l.exportSvg({addXmlHeader:!0}),e=new Blob([t],{type:"image/svg+xml"});ya.saveAs(e,`${i}.svg`)},children:a??c.text("toolbar_action.export_svg.label")}):"print"===r?P.jsx(pp,{...s,className:lo(e,`${fp}__print`),title:n??c.text("toolbar_action.export_print.title"),onSelect:async()=>{const t=window.open("",void 0,"width=1280,height=720");if(!t)return void console.error("Reactodia: failed to open print preview window");const e=await l.exportSvg();t.document.write(e),t.document.close(),t.print()},children:a??c.text("toolbar_action.export_print.label")}):null}function mp(t){const{className:e,title:n,hotkey:r,...i}=t,{model:{history:o}}=bs(),a=Oi(),s=xd(),l=$i(o.events,"historyChanged",(()=>{const{undoStack:t}=o;return 0===t.length?void 0:t[t.length-1]})),c=!n&&l?wp(l,a):void 0;return P.jsx(pp,{...i,className:lo(e,`${fp}__undo`),disabled:!l,title:n??(void 0===c?a.text("toolbar_action.undo.title"):a.text("toolbar_action.undo.title_named",{command:c})),hotkey:void 0===r?"Mod+Z":r,onSelect:()=>o.undo(),children:s?a.text("toolbar_action.undo.label"):null})}function bp(t){const{className:e,title:n,hotkey:r,...i}=t,{model:{history:o}}=bs(),a=Oi(),s=xd(),l=$i(o.events,"historyChanged",(()=>{const{redoStack:t}=o;return 0===o.redoStack.length?void 0:t[t.length-1]})),c=!n&&l?wp(l,a):void 0;return P.jsx(pp,{...i,className:lo(e,`${fp}__redo`),disabled:!l,title:n??(void 0===c?a.text("toolbar_action.redo.title"):a.text("toolbar_action.redo.title_named",{command:c})),hotkey:void 0===r?"Mod+Shift+Z":r,onSelect:()=>o.redo(),children:s?a.text("toolbar_action.redo.label"):null})}function wp(t,e){return"string"==typeof t.title||void 0===t.title?t.title:t.title.resolve(e)}function yp(t){const{className:e,title:n,...r}=t,{model:i,canvas:o}=bs(),{performLayout:a}=ao(),s=Oi(),l=$i(i.events,"changeCells",(()=>0===i.elements.length));return P.jsx(pp,{...r,className:lo(e,`${fp}__layout`),title:n??s.text("toolbar_action.layout.title"),disabled:l,onSelect:async()=>{await a({canvas:o,animate:!0})},children:s.text("toolbar_action.layout.label")})}function _p(t){const{className:e,title:n,languages:r}=t,{model:i}=bs(),o=Oi(),a=$i(i.events,"changeLanguage",(()=>i.language));return 0===r.length?null:P.jsxs("div",{className:lo(e,`${fp}__language-selector`),title:n??o.text("toolbar_action.language_selector.title"),children:[P.jsx("label",{htmlFor:"reactodia-language-selector"}),P.jsx("select",{id:"reactodia-language-selector",value:a,onChange:t=>i.setLanguage(t.currentTarget.value),children:r.map((({code:t,label:e})=>P.jsx("option",{value:t,children:e},t)))})]})}const kp=x.createContext(null);function xp(t={}){const e=x.useContext(kp);if(!e)throw new Error("Missing Reactodia unified search section context");const{searchStore:n,isSectionActive:r,setSectionActive:i}=e,[o,a]=x.useState(r),{searchTimeout:s=0,allowSubmit:l}=t,c=zd({initialValue:n.value,submitTimeout:s,allowSubmit:l});return x.useLayoutEffect((()=>{if(r){a(!0);const t=new Ca;return t.listen(n.events,"changeValue",(({source:t,action:e})=>{c.change({value:t.value,action:e})})),c.change({value:n.value,action:"submit"}),()=>t.stopListening()}}),[r]),x.useEffect((()=>{o&&c.change({value:n.value,action:"submit"})}),[o]),{shouldRender:o,isSectionActive:r,setSectionActive:i,searchStore:c}}function Sp(t){const{searchTimeout:e=200,minSearchTermLength:n=2,draggableItems:r,placeCreatedEntity:i}=t,{searchStore:o,shouldRender:a}=xp({searchTimeout:e,allowSubmit:t=>t.length>=n});return a?P.jsx(Ud,{className:"reactodia-search-section-element-types",searchStore:o,draggableItems:r,placeCreatedEntity:i}):null}function Ep(t){const{searchTimeout:e=600,minSearchTermLength:n=3}=t,{getCommandBus:r}=ao(),{shouldRender:i,setSectionActive:o,searchStore:a}=xp({searchTimeout:e,allowSubmit:t=>t.length>=n}),s=r(Eu);return x.useEffect((()=>{const t=new Ca;return t.listen(s,"setCriteria",(({criteria:t})=>{o(!0,Cp(t))})),()=>t.stopListening()}),[i,s]),P.jsx(Af,{className:"reactodia-search-section-entities",searchStore:a,onChangeCriteria:t=>{i&&o(!0,Cp(t))},onAddElements:()=>{o(!1)}})}function Cp(t){return t.text||t.elementType||t.refElement?t:void 0}function Mp(t){const{searchTimeout:e=200,minSearchTermLength:n=1}=t,{shouldRender:r,isSectionActive:i,searchStore:o}=xp({searchTimeout:e,allowSubmit:t=>t.length>=n});return r?P.jsx(Pf,{className:"reactodia-search-section-link-types",trackSelected:i,searchStore:o}):null}const Lp="reactodia-unified-search";function $p(t){const{sections:e,direction:n="down",defaultWidth:r=300,defaultHeight:i=350,minWidth:o=200,minHeight:a=150,offsetWithMaxWidth:s=20,offsetWithMaxHeight:l=20,hotkeyFocus:c}=t,[u,d]=x.useState(!1),[h,f]=x.useState(Np.empty),p=zd({initialValue:""}),g=$i(p.events,"changeValue",(()=>p.value));x.useEffect((()=>{const t=()=>{f((t=>t.deactivate())),d(!1)};return p.events.on("clearSearch",t),()=>p.events.off("clearSearch",t)}),[p,f,d]);const[v,m]=x.useState({width:r,height:i}),b=x.useRef({width:1/0,height:1/0}),w={width:Math.min(v.width,b.current.width),height:Math.min(v.height,b.current.height)},y=x.useMemo((()=>e.map((t=>({...t,context:{searchStore:p,isSectionActive:t.key===h?.key,setSectionActive:(e,n)=>{e?(f((e=>e.activate(t.key,n))),d(!0),k.current?.focus()):(f((t=>t.deactivate())),d(!1))}}})))),[e,p,h,f,d]),{getCommandBus:_}=ao(),k=x.useRef(null),S=x.useCallback((({sectionKey:t})=>{t&&(e.some((e=>e.key===t))?f((e=>e.activate(t))):console.warn(`Unified search: cannot activate section that does not exists: ${t}`)),k.current?.focus()}),[e,f]),E=_(Cu);x.useEffect((()=>(E.on("focus",S),()=>E.off("focus",S))),[E,S]);const C=xs(c,(()=>S({}))),M=g.length>0||void 0!==h.getSearchExtra(),L=x.useCallback((()=>{M||d(!1)}),[M,d]);return P.jsx(gd,{className:Lp,direction:n,expanded:u,"aria-keyshortcuts":C?.text,onClickOutside:L,toggle:P.jsx(Tp,{inputRef:k,searchTerm:g,setSearchTerm:t=>p.change({value:t,action:"input"}),onSubmit:()=>{},onClear:M?()=>p.change({value:"",action:"clear"}):void 0,expanded:u,setExpanded:t=>{f((n=>{if(!t)return n.deactivate();if(void 0===n.key){const t=e.some((t=>t.key===h.previousActive))?h.previousActive:e.length>0?e[0].key:void 0;if(t)return n.activate(t)}return n})),d(t)},minWidth:o,panelSize:w}),children:P.jsx(Ap,{sections:y,activeSectionKey:h.key,onActivateSection:t=>f((e=>e.switch(t))),dropUp:"up"===n,size:w,minSize:{width:o,height:a},offsetForMaxSize:{x:s,y:l},onResize:t=>{const e={width:Math.max(t.width,o),height:Math.max(t.height,a)};v.width===e.width&&v.height===e.height||m(e)},setMaxSize:t=>{b.current=t,(v.width>t.width||v.height>t.height)&&m({...v})}})})}class Np{constructor(t,e,n){this.key=t,this.previousActive=e,this.searchExtras=n}static empty=new Np(void 0,void 0,{});getSearchExtra(){const{key:t,searchExtras:e}=this;if(void 0!==t&&Object.prototype.hasOwnProperty.call(e,t))return e[t]}activate(t,e){if(this.key===t&&this.getSearchExtra()===e)return this;const n=this.key===t?this.previousActive:this.key,r={...this.searchExtras,[t]:e};return new Np(t,n,r)}deactivate(){return new Np(void 0,this.key,this.searchExtras)}switch(t){return this.key===t?this:new Np(t,this.key,this.searchExtras)}}function Tp(t){const{inputRef:e,searchTerm:n,setSearchTerm:r,onSubmit:i,onClear:o,expanded:a,setExpanded:s,minWidth:l,panelSize:c}=t,u=Oi();return P.jsxs("div",{className:lo(`${Lp}__toggle`),style:{width:c?.width},role:"search",children:[P.jsx("input",{ref:e,role:"searchbox",type:"text",className:`${Lp}__search-input`,style:{minWidth:l},placeholder:u.textOptional("unified_search.input.placeholder")??u.text("search_defaults.input.placeholder"),name:"reactodia-search",value:n,onClick:()=>s(!0),onFocus:()=>s(!0),onChange:t=>r(t.currentTarget.value),onKeyUp:t=>{switch(t.key){case"Enter":n.length>0&&s(!0),i();break;case"Escape":o?o():s(!1);break;default:s(!0)}}}),o?P.jsx("button",{type:"button",title:u.text("unified_search.input_clear.title"),className:`${Lp}__clear-button`,onClick:o}):a?P.jsx("button",{type:"button",title:u.text("unified_search.input_collapse.title"),className:`${Lp}__collapse-button`,onClick:()=>s(!1)}):P.jsx("div",{className:`${Lp}__search-icon`,onClick:()=>e.current?.focus()})]})}function Ap(t){const{sections:e,activeSectionKey:n,onActivateSection:r,dropUp:i,size:o,minSize:a,offsetForMaxSize:s,onResize:l,setMaxSize:c}=t,{canvas:u}=bs(),d=x.useRef(null),h=x.useRef(void 0),f=()=>{if(!d.current)return;const{x:t,y:e,width:n,height:r}=d.current.getBoundingClientRect(),i=t+window.scrollX,o=e+window.scrollY,[a]=function(t){const e=getComputedStyle(t);return[e.getPropertyValue("--reactodia-viewport-dock-align-x"),e.getPropertyValue("--reactodia-viewport-dock-align-y")]}(d.current),s=u.metrics.getViewportPageRect();h.current={bounds:{x:i,y:o,width:n,height:r},centeredByX:"center"===a,centerOffsetX:Math.max(2*i+n-2*s.x-s.width,0)}};!function(t){const{canvas:e}=bs(),n=x.useRef(void 0);x.useLayoutEffect((()=>{n.current=t})),x.useLayoutEffect((()=>{const t=new Ma,r=()=>{const e=n.current;e&&t.call(e)};return e.events.on("resize",r),n.current?.(),()=>{t.dispose(),e.events.off("resize",r)}}),[])}((()=>{if(h.current||f(),h.current){const{bounds:t,centeredByX:e,centerOffsetX:n}=h.current,r=u.metrics.getViewportPageRect(),o=i?t.y-r.y-s.y:r.y+r.height-t.y-s.y,l=Math.max(e?r.width-n-s.x:r.x+r.width-t.x-s.x,a.width),d=Math.max(o,a.height);c({width:l,height:d})}}));const p=(t,e,n)=>{if(h.current){const{bounds:t,centeredByX:r}=h.current;l({width:t.width+e*(r?2:1),height:t.height+(i?-n:n)})}},g=t=>`reactodia-unified-search-panel-${t.key}`;return P.jsxs("div",{ref:d,className:`${Lp}__panel`,style:{width:o.width,height:o.height},children:[P.jsx("div",{className:`${Lp}__section-tabs`,role:"tablist",children:e.map((t=>P.jsx("button",{className:lo(`${Lp}__section-tab`,"reactodia-btn","reactodia-btn-default",t.key===n?"active":void 0),role:"tab","aria-selected":t.key===n,"aria-controls":g(t),"aria-label":t.title,title:t.title,onClick:()=>r(t.key),children:t.label},t.key)))}),e.map((t=>P.jsx(kp.Provider,{value:t.context,children:P.jsx("div",{id:g(t),role:"tabpanel",className:lo(`${Lp}__section`,t.context.isSectionActive?`${Lp}__section--active`:void 0),children:t.component})},t.key))),P.jsx(Uc,{dock:i?"n":"s",axis:"y",onBeginDragHandle:f,onDragHandle:p}),P.jsx(Uc,{dock:"e",axis:"x",className:`${Lp}__right-handle`,onBeginDragHandle:f,onDragHandle:p}),P.jsx(Uc,{dock:i?"ne":"se",axis:"all",className:`${Lp}__corner-handle`,onBeginDragHandle:f,onDragHandle:p})]})}function zp(t){const e=zd({initialValue:"",submitTimeout:200}),n=ao(),r=Oi();return P.jsx(Op,{...t,searchStore:e,workspace:n,translation:r})}const Ip="reactodia-element-selector",Rp="reactodia-form";class Op extends x.Component{listener=new Ca;fetchTypesCancellation=new AbortController;filterCancellation=new AbortController;loadingItemCancellation=new AbortController;constructor(t){super(t),this.state={elementTypesState:"none",existingElements:[],existingElementsState:"none"}}componentDidMount(){const{searchStore:t}=this.props;this.listener.listen(t.events,"changeValue",(({source:t})=>{0===t.value.length?this.searchExistingElements(""):this.forceUpdate()})),this.listener.listen(t.events,"executeSearch",(({value:t})=>{this.searchExistingElements(t)})),this.fetchPossibleElementTypes()}componentWillUnmount(){this.listener.stopListening(),this.fetchTypesCancellation.abort(),this.filterCancellation.abort(),this.loadingItemCancellation.abort()}async fetchPossibleElementTypes(){const{source:t,workspace:{editor:{metadataProvider:e}}}=this.props;if(!e)return;this.fetchTypesCancellation.abort(),this.fetchTypesCancellation=new AbortController;const n=this.fetchTypesCancellation.signal,r=await _a(e.canConnect(t,void 0,void 0,{signal:n}),n);if(null===r)return;const i=new Set;for(const{targetTypes:t}of r)for(const e of t)i.add(e);this.setState({elementTypes:Array.from(i)})}async searchExistingElements(t){const{workspace:{model:e}}=this.props;if(this.filterCancellation.abort(),this.setState({existingElements:[],existingElementsState:"none"}),t.length>0){this.setState({existingElementsState:"loading"}),this.filterCancellation=new AbortController;const n=this.filterCancellation.signal,r=Rf({text:t});let i;try{if(i=await _a(e.dataProvider.lookup(r),n),null===i)return}catch(t){return console.error("Error looking up existing entities",t),void this.setState({existingElementsState:"error"})}const o=i.map((t=>t.element));this.setState({existingElements:o,existingElementsState:"none"})}}onElementTypeChange=async t=>{this.setState({elementTypesState:"loading"}),this.loadingItemCancellation.abort(),this.loadingItemCancellation=new AbortController;const e=this.loadingItemCancellation.signal,{onChange:n,workspace:{model:r,editor:{metadataProvider:i}},translation:o}=this.props,a=t.target.value;let s;try{if(s=await _a(i.createEntity(a,{translation:o,language:r.language,signal:e}),e),null===s)return}catch(t){return console.error("Error calling MetadataProvider.createEntity()",t),void this.setState({elementTypesState:"error"})}this.setState({elementTypesState:"none"}),n({value:s,isNew:!0,loading:!1})};renderElementTypeSelector(){const{elementValue:t,translation:e}=this.props,{elementTypes:n,elementTypesState:r}=this.state,i=t.value.data.types.length?t.value.data.types[0]:"";return"none"!==r?P.jsx(Yi,{width:20,height:20,errorOccurred:"error"===r}):P.jsxs("div",{className:`${Rp}__control-row`,children:[P.jsx("label",{children:e.text("visual_authoring.select_entity.type.label")}),n?P.jsxs("select",{className:"reactodia-form-control",name:"reactodia-element-type-selector-select",value:i,onChange:t=>{this.onElementTypeChange(t)},children:[P.jsx("option",{value:Na,disabled:!0,children:e.text("visual_authoring.select_entity.type.placeholder")}),P.jsx(Pp,{elementTypes:n})]}):P.jsx("div",{children:P.jsx(Yi,{width:20,height:20})}),t.error?P.jsx("span",{className:`${Rp}__control-error`,children:t.error}):""]})}renderExistingElementsList(){const{elementValue:t,workspace:{model:e,editor:n}}=this.props,{elementTypes:r,existingElements:i,existingElementsState:o}=this.state;return"none"!==o?P.jsx("div",{className:`${Ip}__results-spinner`,children:P.jsx(Yi,{width:30,height:30,errorOccurred:"error"===o})}):i.length>0?i.map((i=>{const o=!n.temporaryState.elements.has(i.id)&&Boolean(e.elements.find((t=>t instanceof oc&&t.iri===i.id))),a=Boolean(r&&r.find((t=>i.types.indexOf(t)>=0)));return P.jsx(Ed,{element:i,disabled:o||!a,selected:i.id===t.value.data.id,onClick:(t,e)=>{this.onSelectExistingItem(e)}},i.id)})):P.jsx(Vd,{hasQuery:!0})}async onSelectExistingItem(t){const{onChange:e,workspace:{model:n}}=this.props;this.loadingItemCancellation.abort(),this.loadingItemCancellation=new AbortController;const r=this.loadingItemCancellation.signal;e({value:{data:t},isNew:!1,loading:!0});const i=await n.dataProvider.elements({elementIds:[t.id]});r.aborted||e({value:{data:i.get(t.id)},isNew:!1,loading:!1})}render(){const{searchStore:t,translation:e}=this.props;return P.jsxs("div",{className:lo(`${Rp}__row`,Ip,t.value.length>0?`${Ip}--search-existing`:void 0),children:[P.jsx(Ad,{store:t,className:`${Ip}__search`,inputProps:{className:`${Ip}__search-input`,name:"reactodia-element-type-selector-search",placeholder:e.textOptional("visual_authoring.select_entity.input.placeholder"),autoFocus:!0},children:P.jsx("span",{className:`${Ip}__search-icon`})}),t.value.length>0?P.jsx("div",{className:`${Ip}__existing-elements-list`,role:"listbox","aria-label":e.text("visual_authoring.select_entity.results.aria_label"),children:this.renderExistingElementsList()}):P.jsxs("div",{children:[P.jsx("div",{className:`${Ip}__separator`,children:P.jsx("i",{className:`${Ip}__separator-text`,children:e.text("visual_authoring.select_entity.separator.label")})}),this.renderElementTypeSelector()]})]})}}function Pp(t){const{elementTypes:e}=t,{model:n}=ao(),r=Oi(),i=$i(n.events,"changeLanguage",(()=>n.language));ji(eo,e,n);const o=[...e].sort(function(t,e,n){return(r,i)=>{const o=t.getElementType(r),a=t.getElementType(i),s=e.formatLabel(o?.data?.label,r,n),l=e.formatLabel(a?.data?.label,i,n);return s.localeCompare(l)}}(n,r,i));return P.jsx(P.Fragment,{children:o.map((t=>{const e=n.getElementType(t),o=r.formatLabel(e?.data?.label,t,i);return P.jsx("option",{value:t,children:r.text("visual_authoring.select_entity.entity_type.label",{type:o,typeIri:t})},t)}))})}const Vp="reactodia-form";class jp extends x.Component{static contextType=oo;link;validationCancellation=new AbortController;constructor(t){super(t);const{source:e,target:n,initialTargetIsNew:r,originalLink:i}=this.props;this.link=i,this.state={elementValue:{value:{data:n.data},isNew:r,loading:!1,validated:!0,allowChange:!0},linkValue:{link:{base:i.data,source:e.data,target:n.data,direction:"out"},validated:!0,allowChange:!0}}}componentDidMount(){this.validate()}componentWillUnmount(){this.validationCancellation.abort()}validate(){const{originalLink:t,translation:e}=this.props,{elementValue:n,linkValue:r}=this.state;this.setState({isValidating:!0}),this.validationCancellation.abort(),this.validationCancellation=new AbortController;const i=this.validationCancellation.signal,o=function(t,e){const n=t.types.indexOf(Na)<0?void 0:e.text("visual_authoring.select_entity.validation.error_required");return Promise.resolve({error:n,allowChange:!0})}(n.value.data,e),a=async function(t,e,n,r,i){const{model:o,editor:a}=n;return t.linkTypeId===Ta?{error:r.text("visual_authoring.select_relation.validation.error_required"),allowChange:!0}:qi(t,e)?{error:void 0,allowChange:!0}:function(t,e){for(const n of t.links)for(const t of fc(n))if(qi(t,e))return!0;return!1}(o,t)?{error:r.text("visual_authoring.select_relation.validation.error_duplicate"),allowChange:a.temporaryState.links.has(t)}:(await o.dataProvider.links({primary:[t.sourceId],secondary:[t.targetId],linkTypeIds:[t.linkTypeId],signal:i})).some((e=>qi(e,t)))?{error:r.text("visual_authoring.select_relation.validation.error_duplicate"),allowChange:!1}:{error:void 0,allowChange:!0}}({...(s=r.link).base,sourceId:"out"===s.direction?s.source.id:s.target.id,targetId:"out"===s.direction?s.target.id:s.source.id},t.data,this.context,e,i);var s;Promise.all([o,a]).then((([t,e])=>{i.aborted||(this.setState({isValidating:!1}),this.setElementOrLink({elementValue:{...n,...t,validated:!0},linkValue:{...r,...e,validated:!0}}))}))}render(){const{source:t,originalLink:e,translation:n}=this.props,{elementValue:r,linkValue:i,isValidating:o}=this.state,a=!r.error&&!i.error;return P.jsxs("div",{className:Vp,children:[P.jsxs("div",{className:`${Vp}__body`,children:[P.jsx(zp,{source:t.data,elementValue:r,onChange:n=>{this.setElementOrLink({elementValue:{value:n.value,isNew:n.isNew,loading:n.loading,error:void 0,validated:!1,allowChange:!1},linkValue:{link:{base:e.data,source:t.data,target:n.value.data,direction:"out"},validated:!1,allowChange:!1}})}}),r.loading?P.jsxs("div",{style:{display:"flex"},children:[P.jsx(Yi,{width:20,height:20})," ",n.text("visual_authoring.find_or_create.loading.label")]}):P.jsx(Ih,{link:i.link,error:i.error,onChange:t=>this.setElementOrLink({linkValue:{link:t,error:void 0,validated:!1,allowChange:!1}}),disabled:void 0!==r.error}),o?P.jsx("div",{className:`${Vp}__progress`,children:P.jsx(Nd,{state:"loading",title:n.text("visual_authoring.find_or_create.validation_progress.title"),height:10})}):null]}),P.jsxs("div",{className:`${Vp}__controls`,children:[P.jsx("button",{className:`reactodia-btn reactodia-btn-primary ${Vp}__apply-button`,onClick:this.onApply,disabled:r.loading||!a||o,title:n.textOptional("visual_authoring.find_or_create.dialog.apply.title")??n.text("visual_authoring.dialog.apply.title"),children:n.textOptional("visual_authoring.find_or_create.dialog.apply.label")??n.text("visual_authoring.dialog.apply.label")}),P.jsx("button",{className:"reactodia-btn reactodia-btn-secondary",onClick:this.props.onCancel,title:n.text("visual_authoring.dialog.cancel.title"),children:n.text("visual_authoring.dialog.cancel.label")})]})]})}setElementOrLink({elementValue:t,linkValue:e}){const{model:n,editor:r}=this.context;this.setState((n=>({elementValue:t||n.elementValue,linkValue:e||n.linkValue})),(()=>{const{source:t,target:e}=this.props,{elementValue:i,linkValue:o}=this.state;if((i&&!i.validated||o&&!o.validated)&&this.validate(),i&&i.validated&&i.allowChange){let t=r.temporaryState;t=Zl.removeEntity(t,e.data),t=Zl.removeRelation(t,this.link.data),r.setTemporaryState(t);const o=n.history.startBatch();o.history.execute(mc(n,e.iri,i.value.data)),o.discard(),t=Zl.addEntity(t,e.data),t=Zl.addRelation(t,this.link.data),r.setTemporaryState(t)}if(o&&o.validated&&o.allowChange){r.removeTemporaryCells([this.link]);const n=Oh(o.link,t,e);this.link=r.createRelation(n,{temporary:!0})}}))}onApply=()=>{const{model:t,editor:e}=this.context,{source:n,target:r,onAfterApply:i}=this.props,{elementValue:o,linkValue:a}=this.state,s=this.link;o.isNew||e.setTemporaryState(Zl.removeEntity(e.temporaryState,o.value.data)),e.removeTemporaryCells([r,s]);const l=t.history.startBatch(Pi.text(o.isNew?"visual_authoring.find_or_create.create_command":"visual_authoring.find_or_create.connect_command"));o.isNew?(t.addElement(r),o.value.elementState&&r.setElementState(o.value.elementState),e.setAuthoringState(Gl.addEntity(e.authoringState,r.data))):t.requestLinks({addedElements:[o.value.data.id]});const c=Oh(a.link,n,r);e.createRelation(c),l.store(),i()}}const Dp="reactodia-authoring-state";function Hp(t){const{target:e,inlineActions:n}=t,{canvas:r}=bs(),{model:i,editor:o}=ao(),a=Oi(),s=$i(i.events,"changeSelection",(()=>1===i.selection.length&&i.selection[0]===e)),l=$i(e.events,"changeData",(()=>e.data)),c=[l],u=Ai(Ti(o.events,"changeAuthoringState",c),(()=>o.authoringState.elements.get(l.id))),d=Ai(Ti(o.events,"changeValidationState",c),(()=>o.validationState.elements.get(l.id))),h=Ai(Ti(o.events,"changeTemporaryState",c),(()=>o.temporaryState.elements.has(l.id))),[f,p]=x.useState((()=>r.renderingState.getElementShape(e)));x.useEffect((()=>{const t=new Ca;return t.listen(r.renderingState.events,"changeElementSize",(t=>{t.source===e&&p(r.renderingState.getElementShape(e))})),()=>t.stopListening()}),[e]);let g=null;if(h)g=P.jsxs(P.Fragment,{children:[P.jsx(Up,{shape:f,className:`${Dp}__outline-overlay`}),P.jsx(Up,{shape:f,fill:"url(#stripe-pattern)"})]});else if(u&&"entityDelete"===u.type){const t=f.bounds.width/2,n=f.bounds.height/2,r="rect"===f.type?t:t*Math.SQRT1_2,i="rect"===f.type?n:n*Math.SQRT1_2;g=P.jsxs("g",{children:[P.jsx(Up,{shape:f,className:`${Dp}__outline-overlay`}),P.jsx("line",{className:`${Dp}__outline-cross-line`,x1:t-r,y1:n-i,x2:t+r,y2:n+i}),P.jsx("line",{className:`${Dp}__outline-cross-line`,x1:t-r,y1:n+i,x2:t+r,y2:n-i})]},e.id)}let v=null;if(d){const t=Rc(d.items),e=d.items.map((t=>{if(t.propertyType){const e=i.getPropertyType(t.propertyType);return`${a.formatLabel(e?.data?.label,t.propertyType,i.language)}: ${t.message}`}return t.message})).join("\n");v=P.jsxs("div",{className:lo(`${Dp}__item-validation`,Bp(t)),title:e,children:[d.loading?P.jsx(Yi,{width:15,height:17}):P.jsx("div",{className:`${Dp}__item-validation-icon`}),!d.loading&&d.items.length>0?d.items.length:void 0]})}const m=P.jsx("div",{className:`${Dp}__state-indicator`,children:P.jsxs("div",{className:`${Dp}__state-indicator-body`,children:[u?P.jsx("span",{className:`${Dp}__state-label`,children:"entityAdd"===u.type?a.text("authoring_state.entity_add.label"):"entityChange"===u.type?a.text("authoring_state.entity_change.label"):"entityDelete"===u.type?a.text("authoring_state.entity_delete.label"):null}):null,h?null:P.jsx(Fp,{target:e,state:u,allActions:Boolean(n)}),v]})},e.id);return P.jsx(kl,{target:e,children:P.jsxs("div",{className:lo(`${Dp}__decorator`,u||d?void 0:`${Dp}__decorator--optional`,s?`${Dp}__decorator--selected`:void 0),"data-reactodia-no-export":"true",children:[g?P.jsxs("svg",{className:`${Dp}__element-outlines`,width:f.bounds.width,height:f.bounds.height,children:[P.jsx("defs",{children:P.jsx("pattern",{id:"stripe-pattern",patternUnits:"userSpaceOnUse",width:13,height:13,patternTransform:"rotate(45)",children:P.jsx("line",{className:`${Dp}__outline-stripe-line`,x1:0,y:0,x2:0,y2:13})})}),g]}):null,m]})})}function Bp(t){switch(t){case"info":return`${Dp}--severity-info`;case"warning":return`${Dp}--severity-warning`;case"error":return`${Dp}--severity-error`;default:return}}function Fp(t){const{target:e,state:n,allActions:r}=t,{editor:i}=ao(),o=Oi(),a=$u(e.data,r);return P.jsxs("div",{className:`${Dp}__actions`,children:[!r||n&&"entityAdd"!==n.type&&"entityChange"!==n.type?null:P.jsx("button",{className:`${Dp}__action ${Dp}__action-edit`,disabled:!a.canEdit,onClick:()=>a.onEdit(e),title:o.text(a.canEdit?"authoring_state.entity_action_edit.title":"authoring_state.entity_action_edit.title_disabled"),children:o.text("authoring_state.entity_action_edit.label")}),r&&!n||"entityAdd"===n?.type?P.jsx("button",{className:`${Dp}__action ${Dp}__action-delete`,disabled:!a.canDelete,onClick:()=>a.onDelete(),title:o.text(a.canEdit?"authoring_state.entity_action_delete.title":"authoring_state.entity_action_delete.title_disabled"),children:o.text("authoring_state.entity_action_delete.label")}):null,n&&"entityAdd"!==n.type?P.jsx("button",{className:`${Dp}__action ${Dp}__action-discard`,onClick:()=>i.discardChange(n),title:o.text("authoring_state.entity_action_discard.title"),children:o.text("authoring_state.entity_action_discard.label")}):null]})}function Up(t){const{shape:e,...n}=t;switch(e.type){case"rect":return P.jsx("rect",{x:0,y:0,width:e.bounds.width,height:e.bounds.height,...n});case"ellipse":{const t=e.bounds.width/2,r=e.bounds.height/2;return P.jsx("ellipse",{cx:t,cy:r,rx:t,ry:r,...n})}default:return null}}function Wp(t){const{canvas:e}=bs(),n=ao(),r=Oi(),{editor:i}=n;return $i(i.events,"changeMode",(()=>i.inAuthoringMode))?P.jsx(Zp,{...t,workspace:n,canvas:e,translation:r}):null}const qp="reactodia-authoring-state",Gp=5;class Zp extends x.Component{listener=new Ca;componentDidMount(){this.listenEvents()}componentWillUnmount(){const{canvas:t}=this.props;this.listener.stopListening(),t.renderingState.cancelOnLayerUpdate(ul.Overlay,this.performUpdate)}listenEvents(){const{workspace:{model:t,editor:e},canvas:n}=this.props;this.listener.listen(t.events,"elementEvent",(({data:t})=>{t.changePosition&&this.scheduleUpdate()})),this.listener.listen(t.events,"linkEvent",(({data:t})=>{t.changeVertices&&this.scheduleUpdate()})),this.listener.listen(t.events,"changeCells",this.scheduleUpdate),this.listener.listen(e.events,"changeAuthoringState",this.scheduleUpdate),this.listener.listen(e.events,"changeTemporaryState",this.scheduleUpdate),this.listener.listen(e.events,"changeValidationState",this.scheduleUpdate),this.listener.listen(n.events,"changeTransform",this.performUpdate),this.listener.listen(n.renderingState.events,"changeElementSize",this.scheduleUpdate),this.listener.listen(n.renderingState.events,"changeLinkLabelBounds",this.scheduleUpdate)}scheduleUpdate=()=>{const{canvas:t}=this.props;t.renderingState.scheduleOnLayerUpdate(ul.Overlay,this.performUpdate)};performUpdate=()=>{this.forceUpdate()};calculateLinkPath(t){return this.calculateSpline(t).toPath()}calculateSpline(t){const{workspace:{model:e},canvas:n}=this.props,r=e.getElement(t.sourceId),i=e.getElement(t.targetId),o=n.renderingState.getLinkTemplate(t),a=n.renderingState.getRouting(t.id),s=a?a.vertices:t.vertices||[],l=n.renderingState.getElementShape(r),c=n.renderingState.getElementShape(i),u=Is(l,c,s);return Ps.create({type:o?.spline??Ps.defaultType,points:u,source:Cs.center(l.bounds),target:Cs.center(c.bounds)})}renderLinkStateLabels(){const{workspace:{model:t,editor:e}}=this.props,n=[];for(const r of t.links){if(!(r instanceof cc))continue;const t=e.authoringState.links.get(r.data),i=this.renderLinkStatus(t),o=this.renderLinkValidations(r.data);if(i||o){const t=this.getLinkStateLabelPosition(r);t&&n.push(P.jsx("div",{className:`${qp}__state-indicator`,style:{left:t.x,top:t.y},children:P.jsxs("div",{className:`${qp}__state-indicator-body`,children:[i,o]})},r.id))}}return n}renderLinkStatus(t){const{workspace:{editor:e},translation:n}=this.props;return t?P.jsxs(P.Fragment,{children:[P.jsx("span",{className:`${qp}__state-label`,children:"relationAdd"===t.type?n.text("authoring_state.relation_add.label"):"relationChange"===t.type?n.text("authoring_state.relation_change.label"):"relationDelete"===t.type?n.text("authoring_state.relation_delete.label"):null}),P.jsx("span",{className:`${qp}__action ${qp}__action-discard`,onClick:()=>e.discardChange(t),title:n.text("authoring_state.relation_action_discard.title"),children:n.text("authoring_state.relation_action_discard.label")})]}):null}renderLinkStateHighlighting(){const{workspace:{model:t,editor:e}}=this.props,n=[];for(const r of t.links)if(r instanceof cc)if(e.temporaryState.links.has(r.data)){const t=this.calculateLinkPath(r);n.push(P.jsx("path",{className:`${qp}__link-temporary`,d:t},r.id))}else{const t=e.authoringState.links.get(r.data),i=Gl.isDeletedRelation(e.authoringState,r.data),o=Gl.hasEntityChangedIri(e.authoringState,r.data.sourceId)||Gl.hasEntityChangedIri(e.authoringState,r.data.targetId);if(t||i||o){const e=this.calculateLinkPath(r);n.push(P.jsx("path",{className:i?`${qp}__link-deleted`:"relationAdd"===t?.type?`${qp}__link-added`:"relationChange"===t?.type?`${qp}__link-changed`:o?`${qp}__link-uncertain`:`${qp}__link-changed`,d:e},r.id))}}return n}getLinkStateLabelPosition(t){const{canvas:e,linkLabelMargin:n=Gp}=this.props,r=e.renderingState.getLinkLabelBounds(t);if(r){const{x:t,y:e}=r;return{x:t,y:e-n/2}}{const e=this.calculateSpline(t),n=Rs(e.geometry.points);return Os(e.geometry.points,n/2)}}renderLinkValidations(t){const{workspace:{model:e,editor:n},translation:r}=this.props,{validationState:i}=n,o=i.links.get(t);if(!o)return null;const a=o.items.map((t=>{if(t.propertyType){const n=e.getPropertyType(t.propertyType);return`${r.formatLabel(n?.data?.label,t.propertyType,e.language)}: ${t.message}`}return t.message})).join("\n"),s=Rc(o.items);return P.jsxs("div",{className:lo(`${qp}__item-validation`,Kp(s)),title:a,children:[o.loading?P.jsx(Yi,{width:15,height:17}):P.jsx("div",{className:`${qp}__item-validation-icon`}),!o.loading&&o.items.length>0?o.items.length:void 0]})}render(){const{canvas:t}=this.props,e=t.metrics.transform,{scale:n,originX:r,originY:i}=e,o={position:"absolute",left:0,top:0,transform:`scale(${n},${n})translate(${r}px,${i}px)`};return P.jsxs(P.Fragment,{children:[P.jsx(Bl,{layer:"overLinkGeometry",children:P.jsx("div",{className:qp,children:P.jsx(ol,{paperTransform:e,style:{overflow:"visible",pointerEvents:"none"},children:this.renderLinkStateHighlighting()})})}),P.jsx(Bl,{layer:"overElements",children:P.jsx("div",{className:qp,children:P.jsx("div",{className:`${qp}__validation-layer`,style:o,children:this.renderLinkStateLabels()})})})]})}}function Kp(t){switch(t){case"info":return`${qp}--severity-info`;case"warning":return`${qp}--severity-warning`;case"error":return`${qp}--severity-error`;default:return}}function Qp(t){const{operation:e,onFinishEditing:n}=t,r=ao(),i=Oi(),{model:o,editor:a}=r,{metadataProvider:s}=a,l=x.useCallback(((t,e,n)=>{if(n&&!(n instanceof cc))throw new Error("DragEditLayer: cannot clone a non-relation link");const r=new cc({sourceId:t.id,targetId:e.id,data:{sourceId:t instanceof oc?t.iri:"",targetId:e instanceof oc?e.iri:"",linkTypeId:n?.data.linkTypeId??Ta,properties:n?.data.properties??{}},vertices:n?.vertices,linkState:n?.linkState}),i=a.createRelation(r,{temporary:!0});return n||o.setLinkVisibility(Ta,"withoutLabel"),i}),[e]),c=x.useCallback((async(t,e,n,l)=>{const c=n instanceof oc?a.authoringState.elements.get(n.iri):void 0;if(!(s&&e instanceof cc&&t instanceof oc&&(!n||n instanceof oc))||c&&"entityDelete"===c.type)return new Xp([],r,i);const u=e.data.linkTypeId===Ta?void 0:e.data.linkTypeId;if(n&&u&&o.findLink(u,t.id,n.id))return new Xp([],r,i);const d=await s.canConnect(t.data,n?.data,u,{signal:l});return new Xp(d,r,i)}),[s]),u=x.useCallback((t=>{t instanceof cc&&a.setTemporaryState(Zl.removeRelation(a.temporaryState,t.data))}),[]);return P.jsx(id,{operation:e,createLink:l,canConnect:c,cleanupLink:u,onFinish:n})}class Xp{constructor(t,e,n){this.connections=t,this.workspace=e,this.translation=n}get allowed(){return this.connections.length>0}async connect(t,e,n,r,i){if(!(t instanceof oc&&(!e||e instanceof oc)))return;let o=e;o||(o=await this.createNewElement(i),o.setPosition(n),r.renderingState.syncUpdate(),function(t,e,n){const{width:r,height:i}=n.getElementSize(t)??{width:0,height:0};t.setPosition({x:e.x-r/2,y:e.y-i/2})}(o,n,r.renderingState));const a=await this.createNewLink(t,o,i);this.afterCommit(e,o,a)}async moveSource(t,e,n,r){const{editor:i}=this.workspace;if(!(t instanceof cc&&e instanceof oc))return;const o=i.moveRelationSource({link:t,newSource:e});this.afterCommit(e,void 0,o)}async moveTarget(t,e,n,r){const{editor:i}=this.workspace;if(!(t instanceof cc&&e instanceof oc))return;const o=i.moveRelationTarget({link:t,newTarget:e});this.afterCommit(e,void 0,o)}async createNewElement(t){const{model:e,editor:n}=this.workspace;if(!n.metadataProvider)throw new Error("Cannot create new entity without metadata provider");const r=new Set;for(const{targetTypes:t}of this.connections)for(const e of t)r.add(e);const i=1===r.size?Array.from(r)[0]:Na,o=await n.metadataProvider.createEntity(i,{translation:this.translation,language:e.language,signal:t}),a=n.createEntity(o.data,{temporary:!0});return o.elementState&&a.setElementState(o.elementState),a}async createNewLink(t,e,n){const{model:r,editor:i}=this.workspace;if(!i.metadataProvider)throw new Error("Cannot create new relation without metadata provider");const o=new Set,a=new Set;for(const{targetTypes:t,inLinks:n,outLinks:r}of this.connections)if(e.data.types.some((e=>t.has(e)))){for(const t of n)o.add(t);for(const t of r)a.add(t)}const s=1===o.size?[...o][0]:void 0,l=1===a.size?[...a][0]:void 0;let c,u;0===o.size&&l?(c=l,u="out"):s&&0===a.size?(c=s,u="in"):s&&l&&s===l?(c=l,u=r.findLink(c,t.id,e.id)?"in":"out"):(c=Ta,u="out");let[d,h]=[t,e];"in"===u&&([d,h]=[h,d]);const f=await i.metadataProvider.createRelation(d.data,h.data,c,{translation:this.translation,language:r.language,signal:n}),p=new cc({sourceId:d.id,targetId:h.id,data:f.data,linkState:f.linkState}),g=r.findLink(p.typeId,p.sourceId,p.targetId);return g instanceof cc?g:i.createRelation(p,{temporary:!0})}afterCommit(t,e,n){const{model:r,getCommandBus:i}=this.workspace;t?(r.setSelection([n]),i(Mu).trigger("editRelation",{target:n})):e&&n&&(r.setSelection([e]),i(Mu).trigger("findOrCreateEntity",{link:n,target:e}))}}function Yp(t){const{propertyEditor:e,inlineEntityActions:n=!0}=t,{model:r,editor:i,overlay:o,getCommandBus:a}=ao(),s=Oi();return x.useLayoutEffect((()=>{const t=new Ca;return t.listen(o.events,"changeOpenedDialog",(({previous:t})=>{t&&t.target&&i.removeTemporaryCells([t.target])})),()=>{t.stopListening()}}),[]),x.useLayoutEffect((()=>{const t=a(Mu),n=new Ca;return n.listen(t,"editEntity",(({target:t})=>{let n;n=t instanceof oc?t:new oc({data:t});const r=e({type:"entity",target:n,onClose:()=>o.hideDialog()});o.showDialog({target:t instanceof oc?t:void 0,dialogType:"reactodia:editEntity",style:{caption:s.text("visual_authoring.edit_entity.dialog.caption"),defaultSize:{width:340,height:400}},content:r,holdSelection:!0})})),n.listen(t,"findOrCreateEntity",(e=>{const{link:n,target:a}=e,l=r.getElement(n.sourceId),c=i.temporaryState.elements.has(a.iri),u=P.jsx(jp,{source:l,target:a,initialTargetIsNew:c,originalLink:n,onAfterApply:()=>{o.hideDialog(),Gl.isAddedEntity(i.authoringState,a.iri)&&t.trigger("editEntity",{target:a})},onCancel:()=>o.hideDialog(),translation:s});o.showDialog({target:a,dialogType:"reactodia:findOrCreateEntity",style:{caption:s.text("visual_authoring.find_or_create.dialog.caption"),minSize:{width:250,height:320}},content:u,onClose:()=>i.removeAllTemporaryCells()})})),n.listen(t,"editRelation",(({target:n})=>{const r=i.temporaryState.links.has(n.data)?s.text("visual_authoring.edit_relation.dialog.caption_new"):s.text("visual_authoring.edit_relation.dialog.caption"),a=e({type:"relation",target:n,onChangeTarget:e=>{o.hideDialog(),t.trigger("editRelation",{target:e})},onClose:()=>o.hideDialog()});o.showDialog({target:n,dialogType:"reactodia:editRelation",style:{defaultSize:{width:340,height:300},caption:r},content:a,onClose:()=>i.removeTemporaryCells([n])})})),()=>n.stopListening()}),[]),P.jsxs(P.Fragment,{children:[P.jsx(Wp,{}),P.jsx(Jp,{inlineActions:n}),P.jsx(tg,{})]})}const Jp=x.memo((function(t){const{inlineActions:e}=t,{canvas:n}=bs(),{model:r,editor:i}=ao(),o=$i(i.events,"changeMode",(()=>i.inAuthoringMode)),a=Ai(pl(Ti(r.events,"changeCells"),n.renderingState),(()=>r.cellsVersion)),s=x.useMemo((()=>new WeakMap),[e,a]),l=[];if(o)for(const t of r.elements)if(t instanceof oc){let n=s.get(t);n||(n=P.jsx(Hp,{target:t,inlineActions:e},t.id),s.set(t,n)),l.push(n)}return l}));function tg(){const[t,e]=x.useState(null),{getCommandBus:n}=ao();return x.useLayoutEffect((()=>{const t=n(Mu),r=new Ca;return r.listen(t,"startDragEdit",(({operation:t})=>{e(P.jsx(Qp,{operation:t,onFinishEditing:()=>e(null)}))})),()=>r.stopListening()}),[]),t}const eg="reactodia-zoom-control";function ng(t){const{dock:e,dockOffsetX:n,dockOffsetY:r,showPointerModeToggle:i=!0}=t,{canvas:o}=bs(),a=Oi(),s=$i(o.events,"changePointerMode",(()=>o.pointerMode));return P.jsx(au,{dock:e,dockOffsetX:n,dockOffsetY:r,children:P.jsxs("div",{className:eg,role:"toolbar",children:[P.jsx("button",{type:"button",className:lo(`${eg}__zoom-in-button`,"reactodia-btn reactodia-btn-default"),title:a.text("zoom_control.zoom_in.title"),onClick:()=>o.zoomIn()}),P.jsx("button",{type:"button",className:lo(`${eg}__zoom-out-button`,"reactodia-btn reactodia-btn-default"),title:a.text("zoom_control.zoom_out.title"),onClick:()=>o.zoomOut()}),P.jsx("button",{type:"button",className:lo(`${eg}__zoom-fit-button`,"reactodia-btn reactodia-btn-default"),title:a.text("zoom_control.zoom_to_fit.title"),onClick:()=>o.zoomToFit({animate:!0})}),i?P.jsx("button",{type:"button",className:lo(`${eg}__selection-mode-button`,"reactodia-btn reactodia-btn-default","selection"===s?"active":void 0),title:a.text("zoom_control.pointer_mode.title"),onClick:()=>o.setPointerMode("panning"===s?"selection":"panning")}):null]})})}function rg(t){const{colorScheme:e="auto"}=t,n=function(t){const e=document.documentElement,[n,r]=x.useState((()=>e.getAttribute("data-theme")??(window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"")));return x.useLayoutEffect((()=>{if(t){const t=window.matchMedia("(prefers-color-scheme: dark)"),n=()=>{r(e.getAttribute("data-theme")??(t.matches?"dark":""))};t.addEventListener("change",n);const i=new MutationObserver(n);return e&&i.observe(e,{attributes:!0,attributeFilter:["data-theme"]}),()=>{t.removeEventListener("change",n),i.disconnect()}}}),[e,t]),n}("auto"===e);let r=e;"auto"===r&&(r="dark"===n?"dark":"light");const[i,o]=x.useState();void 0!==i&&(r=i);const a=x.useMemo((()=>({actInColorScheme:(t,e)=>{co.flushSync((()=>o(t))),e(),co.flushSync((()=>o(void 0)))}})),[o]);return P.jsx(Sa.Provider,{value:a,children:P.jsx(xa.Provider,{value:r,children:P.jsx("div",{className:lo("reactodia-workspace",t.className,"dark"===r?"reactodia-workspace-dark":"reactodia-workspace-light"),style:t.style,"data-theme":r,children:t.children})})})}function ig(t){const{className:e,style:n,colorScheme:r,children:i,canvas:o,canvasWidgets:a,annotations:s,connectionsMenu:l,dropOnCanvas:c,halo:u,haloLink:d,selection:h,navigator:f,visualAuthoring:p,zoomControl:g,menu:v,search:m,actions:b,mainToolbar:w,actionsToolbar:y,languages:_=[]}=t,k=Oi(),S=null===v?null:v??P.jsxs(P.Fragment,{children:[P.jsx(gp,{}),P.jsx(vp,{kind:"exportRaster"}),P.jsx(vp,{kind:"exportSvg"}),P.jsx(vp,{kind:"print"})]}),E=null===b?null:b??P.jsxs(P.Fragment,{children:[P.jsx(mp,{}),P.jsx(bp,{}),P.jsx(yp,{}),P.jsx(_p,{languages:_})]}),C=x.useMemo((()=>[{key:"elementTypes",label:k.text("default_workspace.search_section_entity_types.label"),title:k.text("default_workspace.search_section_entity_types.title"),component:P.jsx(Sp,{})},{key:"entities",label:k.text("default_workspace.search_section_entities.label"),title:k.text("default_workspace.search_section_entities.title"),component:P.jsx(Ep,{})},{key:"linkTypes",label:k.text("default_workspace.search_section_link_types.label"),title:k.text("default_workspace.search_section_link_types.title"),component:P.jsx(Mp,{})}]),[]),M=w?.dock??"nw",L="s"===M||"sw"===M||"se"===M;return P.jsx(rg,{className:e,style:n,colorScheme:r,children:P.jsxs(yh,{...o,children:[p?P.jsx(Yp,{...p}):null,null===s?null:P.jsx(ud,{...s}),null===l?null:P.jsx(_h,{...l}),null===c?null:P.jsx(Th,{...c}),null===u?null:P.jsx(rf,{...u}),null===d?null:P.jsx(xf,{...d}),null===h?null:P.jsx(ip,{...h}),null===g?null:P.jsx(ng,{dock:"w",...g}),null===f?null:P.jsx(Wf,{dock:"se",...f}),P.jsx(hp,{...w,dock:M,menu:S,children:null===m?null:P.jsx($p,{...m,direction:m?.direction??(L?"up":"down"),sections:m?.sections??C})}),null===E?null:P.jsx(hp,{...y,dock:y?.dock??"sw",menu:null,children:E}),a,i]})})}x.createContext(null);const og={$schema:"../i18n.schema.json",authoring_state:{"entity_action_delete.label":"delete","entity_action_delete.title":"Delete entity","entity_action_delete.title_disabled":"Cannot delete the entity","entity_action_discard.label":"cancel","entity_action_discard.title":"Discard all changes to the entity","entity_action_edit.label":"edit","entity_action_edit.title":"Edit entity","entity_action_edit.title_disabled":"Cannot edit the entity","entity_add.label":"New","entity_change.label":"Change","entity_delete.label":"Delete","relation_action_discard.label":"cancel","relation_action_discard.title":"Discard all changes to the relation","relation_add.label":"New","relation_change.label":"Change","relation_delete.label":"Delete"},classic_workspace:{"canvas.label":"Canvas","class_tree.heading":"Classes","connections.heading":"Connections","instances.heading":"Instances"},commands:{"change_entity.title":"Change entity data","change_link_type_visibility.title":"Change link type visibility","change_relation.title":"Change relation data","collapse_element.title":"Collapse element","expand_element.title":"Expand element","place_elements_around.title":"Place elements","restore_geometry.title":"Move elements and links","restore_link_vertices.title":"Change link vertices","restore_viewport.title":"Set viewport","set_element_state.title":"Change element state","set_entity_data.title":"Set entity element data","set_entity_group_items.title":"Set entity group items","set_link_state.title":"Change link state","set_relation_data.title":"Set relation link data","set_relation_group_items.title":"Set relation group items","transform_elements.title":"Resize elements"},connections_menu:{"all_link.label":"All","breadcrumbs_root.label":"Link types","dialog.caption":"Connections","entities.add_all":"Add all","entities.add_group":"Add as group","entities.add_selected":"Add selected","entities.counter_label":"{{count}} of {{total}}","entities.extra_label":" ({{value}})","entities.extra_title":"Extra entities","entities.missing_label":" ({{value}})","entities.missing_title":"Missing entities","entities.no_results":"No results","entities.truncated_results":"Only the first {{limit}} entities are shown","entities.truncated_results_expand":"Only the first {{limit}} entities are shown,\nclick here for the full results","input.placeholder":null,"link.both_navigate_title":"Navigate to all connected elements","link.both_title":"all connected","link.source_navigate_title":'Navigate to source "{{relation}}" elements',"link.source_title":'source of "{{relation}}" {{relationIri}}',"link.target_navigate_title":'Navigate to source "{{target}}" elements',"link.target_title":'target of "{{relation}}" {{relationIri}}',"link.move_to_filter.title":"Set as filter in the Instances panel","links.no_results":"No results","links.suggest_similar":"Probably, you are looking for...","place_elements.command":"Add connected elements","select_all.label":"Select all","select_all.title":"Select or unselect all entities","sort_alphabetically.title":"Sort alphabetically","sort_smart.title":"Smart sort"},data_diagram_model:{"create_links.command":"Create links","group_entities.command":"Group entities","import_layout.command":"Import layout","regroup_relations.command":"Regroup relations","request_entities.command":"Request entity data","request_relations.command":"Request relations between entities","ungroup_entities.command":"Ungroup entities"},default_data_locale:{iri:"<{{value}}>",iri_blank:"(blank node)"},default_workspace:{"search_section_entities.label":"Entities","search_section_entities.title":"Entity lookup","search_section_entity_types.label":"Types","search_section_entity_types.title":"Entity type hierarchy","search_section_link_types.label":"Links","search_section_link_types.title":"Relation types on the diagram"},drop_on_canvas:{"drop.command":"Drag and drop onto diagram"},editor_controller:{"apply_authored_changes.command":"Apply authored changes to the diagram","discard_change.command":"Discard change","entity_add.command":"Create new entity","entity_change.command":"Edit entity","entity_delete.command":"Delete entity","relation_add.command":"Create new relation","relation_change.command":"Edit relation","relation_delete.command":"Delete relation","relation_move_source.command":"Move relation source","relation_move_target.command":"Move relation target","remove_items.command":"Remove diagram items","set_authoring_state.command":"Create, change or delete entities and relations","validate_entity_failed.message":"Failed to validate entity"},forms:{"input_file.drag_hint":"Drag files over or","input_file.remove_value.title":"Remove the file","input_file.select_files.label":"Select files","input_list.add_value.title":"Add new property value","input_list.remove_value.title":"Remove the property value"},group_paginator:{"current_page.label":"{{page}} of {{pageCount}}","go_next.title":"Go to the next page","go_previous.title":"Go to the previous page","page_size.title":"Number of items to display per page"},inline_entity:{title:"{{entity}} {{entityIri}}",title_extra:"Types: {{entityTypes}}"},link_action:{"delete_annotation.title":"Remove annotation link","delete_relation.title":"Delete relation","delete_relation.title_disabled":"Cannot delete the relation","edit_relation.title":"Edit relation","edit_relation.title_disabled":"Cannot edit the relation","rename_link.title":"Rename link","move_relation.move_source_title":"Move link source","move_relation.move_target_title":"Move link target"},navigator:{"toggle_collapse.title":"Collapse navigator","toggle_expand.title":"Expand navigator"},note_annotation:{"change_text.command":"Change annotation text","style_align_center.title":"Align center","style_align_left.title":"Align left","style_align_right.title":"Align right","style_bold.title":"Bold","style_color_variant.title":"Color variant: {{variant}}","style_italic.title":"Italic","style_strikethrough.title":"Strikethrough","style_underline.title":"Underline"},overlay_controller:{multiple_tasks_in_progress:"Multiple tasks are in progress",unknown_error:"Unknown error occurred"},search_defaults:{empty_input_term:"Input a term to search.","input.placeholder":"Search for...","input_clear.title":"Clear the search","input_submit.title":"Search",input_term_too_short:"Input at least {{termLength}} characters to search.",no_results:"No results found."},search_element_types:{"drag_create.title":"Click or drag to create new entity of this type","input.placeholder":null,no_results:"No element types found.","refresh_progress.title":"Loading element type tree",show_only_creatable:"Show only constructible"},search_entities:{"add_group.label":"Add as group","add_group.title":"Place selected entities on the canvas as a group","add_selected.label":"Add selected","add_selected.title":"Place selected entities on the canvas",criteria_has_type:"Has type {{entityType}}",criteria_connected:"Connected to {{entity}}",criteria_connected_via:"Connected to {{entity}} through {{relationType}}",criteria_connected_to_source:"Connected to {{entity}} through {{relationType}} as {{sourceIcon}} source",criteria_connected_to_target:"Connected to {{entity}} through {{relationType}} as {{targetIcon}} target","input.placeholder":null,"place_elements.command":"Add selected elements","query_progress.title":"Querying for entities","show_more_results.label":"Show more","show_more_results.title":"Load more results"},search_link_types:{"add_to_filter.title":"Search for connected elements via the relation",heading_connected:"Connected to selected entities",heading_connected_single:"Connected to {{entity}}",heading_other:"Other links","input.placeholder":null,no_results:"No links found.","switch.command":"Change link types visibility","switch_all.label":"Switch all","switch_hidden.title":"Hide links and labels","switch_visible.title":"Show links with labels","switch_without_label.title":"Show only lines for links (without labels)"},selection_action:{"add_to_filter.title":"Search for connected elements","anchor.title":"Jump to resource","annotate.defaultContent":"Annotation","annotate.title":"Add annotation to this element","connections.title":"Navigate to connected elements","expand.collapse_command":"Collapse elements","expand.expand_command":"Expand elements","expand.title":"Expand selected elements to reveal additional properties","expand.title_single":"Expand an element to reveal additional properties","establish_relation.title":"Establish link","establish_relation.title_disabled":"Establishing link is not allowed for the element","group.title":"Group entities","group.title_ungroup":"Ungroup entities","layout.title":"Layout selected elements using force-directed algorithm","remove.title":"Remove selected elements from the diagram","remove.title_new":"Discard new element","remove.title_single":"Remove an element from the diagram","zoom_to_fit.title":"Zoom to fit selected elements into view"},standard_element:{blank_node:"(blank node)",default_type:"Thing","delete.label":"Delete","delete.title":"Delete entity","delete.title_disabled":"Cannot delete the entity","edit.label":"Edit","edit.title":"Edit entity","edit.title_disabled":"Cannot edit the entity","group_item.title":"{{entity}}\nIRI:{{entityIri}}\nTypes: {{entityTypes}}","iri.label":"IRI:","iri.label_modified":"IRI (edited):",no_properties:"no properties","property.title":"{{property}} {{propertyIri}}","ungroup.title":"Ungroup an entity"},standard_link:{"group_source.title":"{{value}} source elements","group_source.value":"{{value}}","group_target.title":"{{value}} target elements","group_target.value":"{{value}}","label.title":"{{relation}} {{relationIri}}","property.title":"{{property}} {{propertyIri}}"},toolbar:{"menu_toggle.title":"Open menu"},toolbar_action:{"clear_all.command":"Clear all","clear_all.title":"Remove all elements and links from the diagram","clear_all.label":"Clear All","export_print.label":"Print","export_print.title":"Print the diagram","export_raster.label":"Export as PNG","export_raster.title":"Export the diagram as a PNG image","export_svg.label":"Export as SVG","export_svg.title":"Export the diagram as an SVG image","redo.label":"Redo","redo.title":"Redo last undone command","redo.title_named":"Redo: {{command}}","save_authoring.title":"Apply authored graph changes","save_layout.title":"Save diagram layout","language_selector.title":"Select language for the data (labels, properties, etc)","layout.label":"Layout","layout.title":"Layout diagram using force-directed algorithm","undo.label":"Undo","undo.title":"Undo last command","undo.title_named":"Undo: {{command}}"},unified_search:{"input.placeholder":null,"input_clear.title":"Clear","input_collapse.title":"Close"},visual_authoring:{"dialog.apply.label":"Apply","dialog.apply.title":"Apply changes","dialog.cancel.label":"Cancel","dialog.cancel.title":"Cancel the dialog","edit_entity.dialog.apply.label":null,"edit_entity.dialog.apply.title":null,"edit_entity.dialog.caption":"Edit entity","edit_entity.iri.label":"IRI","edit_entity.iri.placeholder":"Entity IRI","edit_relation.dialog.apply.label":null,"edit_relation.dialog.apply.title":null,"edit_relation.dialog.caption":"Edit relation","edit_relation.dialog.caption_new":"Establish new relation","edit_relation.validation_progress.title":"Validating selected link type","find_or_create.connect_command":"Link to an entity","find_or_create.create_command":"Create new entity","find_or_create.dialog.apply.label":null,"find_or_create.dialog.apply.title":null,"find_or_create.dialog.caption":"Establish New Connection","find_or_create.loading.label":"Loading entity...","find_or_create.validation_progress.title":"Validating selected element and link types","property.label":"{{property}}","property.text_value.placeholder":"Property value","property.title":"{{property}} {{propertyIri}}","rename_link.dialog.apply.label":null,"rename_link.dialog.apply.title":null,"rename_link.dialog.caption":"Rename Link","rename_link.label.label":"Label","select_entity.entity_type.label":"{{type}}","select_entity.input.placeholder":null,"select_entity.type.label":"Entity Type","select_entity.type.placeholder":"Select entity type","select_entity.results.aria_label":"Select an existing element to put on a diagram","select_entity.separator.label":"or create new entity","select_entity.validation.error_required":"Required.","select_relation.relation_type.label":"{{relation}} [{{source}} → {{target}}]","select_relation.type.label":"Relation Type","select_relation.type.placeholder":"Select relation type","select_relation.validation.error_duplicate":"The relation already exists.","select_relation.validation.error_required":"Required."},workspace:{"group_entities.command":"Group entities","perform_layout.task":"Computing graph layout","perform_layout.command":"Graph layout","ungroup_entities.command":"Ungroup entities"},workspace_layout:{"toggle_collapse.title":"Collapse panel","toggle_expand.title":"Expand panel"},zoom_control:{"pointer_mode.title":"Toggle selection mode:\nDrag pointer to select, Shift + Pointer to pan the canvas","zoom_in.title":"Zoom In","zoom_out.title":"Zoom Out","zoom_to_fit.title":"Fit to Screen"}};class ag{constructor(t,e=cg){this.bundles=t,this.selectLabelLanguage=e}getString(t){const e=t.indexOf(".");if(!(e>0&&e<t.length))throw new Error(`Reactodia: Invalid translation key: ${t}`);const n=t.substring(0,e),r=t.substring(e+1);for(const t of this.bundles){const e=sg(t,n,r);if(null!=e)return e}}text(t,e){return this.textOptional(t,e)??t}textOptional(t,e){const n=this.getString(t);if(void 0!==n)return function(t,e){if(!t.includes("{{"))return t;return lg(t,(t=>e&&Object.prototype.hasOwnProperty.call(e,t)?e[t]??"":"")).join("")}(n,e)}template(t,e){return function(t,e){const n=lg(t,(t=>Object.prototype.hasOwnProperty.call(e,t)?e[t]??null:null));return x.createElement(x.Fragment,null,...n)}(this.getString(t)??t,e)}selectLabel(t,e){const{selectLabelLanguage:n}=this;return n(t,e)}selectValues(t,e){return t.filter((t=>"NamedNode"===t.termType||""===t.language||t.language===e))}formatLabel(t,e,n){return function(t,e){return t?t.value:function(t){let e=t.indexOf("#");if(e<0&&(e=t.lastIndexOf("/")),e<0&&(e=t.lastIndexOf(":")),!(e<0))return t.substring(e+1)}(e)||e}(t?this.selectLabel(t,n):void 0,e)}formatIri(t){return Fi(t)?"(blank node)":`<${t}>`}}function sg(t,e,n){if(!Object.prototype.hasOwnProperty.call(t,e))return;const r=t[e];return"object"==typeof r&&r&&Object.prototype.hasOwnProperty.call(r,n)?r[n]:void 0}function lg(t,e){const n=[],r=/\{\{([a-zA-Z0-9_]+)\}\}/g;let i,o=0;for(;i=r.exec(t);){const[a,s]=i,l=r.lastIndex-a.length;l!=o&&n.push(t.substring(o,l));const c=e(s);n.push(c),o=r.lastIndex}return o<t.length&&n.push(t.substring(o,t.length)),n}function cg(t,e){if(0===t.length)return;let n,r;for(const i of t){if(i.language===e)return i;""===i.language?n=i:"en"===i.language&&(r=i)}return void 0!==n?n:void 0!==r?r:t[0]}function ug(t){const{translation:e,children:n}=t;return P.jsx(Ri.Provider,{value:e,children:n})}const dg="en",hg=()=>{};class fg extends x.Component{listener=new Ca;cancellation=new AbortController;extensionCommands=new WeakMap;resolveTypeStyle;cachedTypeStyles;cachedGroupStyles;annotationStyles=new Map([["default",{color:"#bec3c9"}],["primary",{color:"#337ab7"}],["success",{color:"#5cb85c"}],["info",{color:"#54c7ec"}],["warning",{color:"#ffba00"}],["danger",{color:"#c9302c"}]]);layoutTypeProvider;workspaceContext;translation;constructor(t){super(t);const{history:e=new Ws,dialogSettingsProvider:n=new pu,metadataProvider:r,validationProvider:i,renameLinkProvider:o,typeStyleResolver:a,selectLabelLanguage:s,defaultLanguage:l=dg,translations:c=[],useDefaultTranslation:u=!0,defaultLayout:d,onWorkspaceEvent:h=()=>{}}=this.props,f=[...c];u&&f.push(og),this.translation=new ag(f,s),this.resolveTypeStyle=a??hg,this.cachedTypeStyles=new WeakMap,this.cachedGroupStyles=new WeakMap;const p=new Lc({history:e,translation:this.translation});p.setLanguage(l);const g=new Fl({defaultElementResolver:t=>t instanceof Wl?Nu:ju,defaultLinkResolver:t=>t instanceof ql?Ou:Yu,defaultLayout:d,renameLinkProvider:null===o?void 0:o??new gg}),v=new Oc({model:p,translation:this.translation,metadataProvider:r,validationProvider:i}),m=new su({model:p,view:g,translation:this.translation,dialogSettingsProvider:n});this.layoutTypeProvider={getElementTypes:t=>t instanceof oc?t.data.types:[]},this.workspaceContext={model:p,view:g,editor:v,overlay:m,translation:this.translation,disposeSignal:this.cancellation.signal,getCommandBus:this.getCommandBus,getElementStyle:this.getElementStyle,getElementTypeStyle:this.getElementTypeStyle,performLayout:this.onPerformLayout,group:this.onGroup,ungroupAll:this.onUngroupAll,ungroupSome:this.onUngroupSome,triggerWorkspaceEvent:h}}getContext(){return this.workspaceContext}render(){const{children:t}=this.props;return P.jsx(ug,{translation:this.translation,children:P.jsx(oo.Provider,{value:this.workspaceContext,children:t})})}componentDidMount(){const{onWorkspaceEvent:t}=this.props,{model:e,view:n,overlay:r}=this.workspaceContext;this.listener.listen(e.events,"loadingSuccess",(()=>{for(const t of n.findAllCanvases())t.renderingState.syncUpdate(),t.zoomToFit()})),t&&(this.listener.listen(e.events,"changeSelection",(()=>t(io.editorChangeSelection))),this.listener.listen(r.events,"changeOpenedDialog",(()=>t(io.editorToggleDialog))))}componentWillUnmount(){this.listener.stopListening();const{view:t,editor:e,overlay:n}=this.workspaceContext;t.dispose(),e.dispose(),n.dispose()}getCommandBus=t=>{let e=this.extensionCommands.get(t);return e||(e=new Ea,this.extensionCommands.set(t,e)),e};getElementStyle=t=>t instanceof oc?this.getElementTypeStyle(t.data.types):t instanceof ac?this.getGroupTypeStyle(t):this.tryGetColorVariantStyle(t)??this.getElementTypeStyle([]);getElementTypeStyle=t=>{let e=this.cachedTypeStyles.get(t);if(!e){const n=this.resolveTypeStyle(t);let r;if(n&&n.color)r=oa(n.color).toString();else{const e=function(t){const e=pg(t,195935983);return(void 0===e?0:e)/2147483647*360}(t);r=oa(e,40,75).toString()}e={...n,color:r},this.cachedTypeStyles.set(t,e)}return e};getGroupTypeStyle(t){const{items:e}=t;let n=this.cachedGroupStyles.get(e);if(!n){const t=new U(pg,ki);for(const n of e)t.set(n.data.types,(t.get(n.data.types)??0)+1);let r=0,i=[];for(const[e,n]of t)n>r&&(r=n,i=e);n=this.getElementTypeStyle(i),this.cachedGroupStyles.set(e,n)}return n}tryGetColorVariantStyle(t){const{elementState:e}=t,n=e.get(za.ColorVariant);if(n||t instanceof Wl)return this.annotationStyles.get(n??"default")}onPerformLayout=async t=>{const{canvas:e,layoutFunction:n,selectedElements:r,fixedElements:i,animate:o,zoomToFit:a=!0}=t,{model:s,view:l,overlay:c}=this.workspaceContext,u=this.translation,d=e??l.findAnyCanvas();if(!d)throw new Error("Failed to find any canvas to perform layout");d.renderingState.syncUpdate();const h=c.startTask({title:u.text("workspace.perform_layout.task"),delay:200});let f;try{f=await async function(t){const{layoutFunction:e,model:n,sizeProvider:r,typeProvider:i,fixedElements:o,selectedElements:a}=t;if(a&&a.size<=1)return{positions:new Map,sizes:new Map,nestedLayouts:[]};let s=n.elements;a&&(s=s.filter((t=>a.has(t))));const l=Object.create(null),c=Object.create(null);for(const t of s)l[t.id]={types:i?.getElementTypes?.(t)??[],fixed:o?.has(t)},c[t.id]=Ts(t,r);const u=[];for(const t of n.links)Object.hasOwn(l,t.sourceId)&&Object.hasOwn(l,t.targetId)&&"hidden"!==n.getLinkVisibility(t.typeId)&&u.push({type:i?.getLinkType?.(t)??t.typeId,source:t.sourceId,target:t.targetId});const d=await e({nodes:l,links:u},{bounds:c}),h=new Map,f=new Map;for(const[t,{x:e,y:n,width:r,height:i}]of Object.entries(d.bounds))h.set(t,{x:e,y:n}),f.set(t,{width:r,height:i});return{positions:h,sizes:f,nestedLayouts:[]}}({layoutFunction:n??l.defaultLayout,model:s,selectedElements:r,fixedElements:i,sizeProvider:d.renderingState,typeProvider:this.layoutTypeProvider})}catch(t){return h.setError(t),void console.error("Failed to compute graph layout",t)}finally{h.end()}const p=s.history.startBatch(Pi.text("workspace.perform_layout.command"));p.history.registerToUndo(qs.capture(s));for(const t of s.links)t.setVertices([]);p.history.registerToUndo(function(t){function e(){const{metrics:e}=t,{clientWidth:n,clientHeight:r}=t.metrics.pane,i=e.clientToPaperCoords(n/2,r/2),{scale:o}=e.transform;return{center:i,scale:o}}function n({center:e,scale:n}){t.centerTo(e,{scale:n})}const r=e(),i=Ls.create(Pi.text("commands.restore_viewport.title"),(()=>{const t=e();return n(r),Ls.create(Pi.text("commands.restore_viewport.title"),(()=>(n(t),i)))}));return i}(d)),o?await Promise.all([d.animateGraph((()=>{xl(f,s),p.store()})),a?d.zoomToFit({animate:!0}):null]):(xl(f,s),p.store(),a&&await d.zoomToFit())};onGroup=t=>jc(this.workspaceContext,t);onUngroupAll=t=>Dc(this.workspaceContext,t);onUngroupSome=t=>Hc(this.workspaceContext,t)}function pg(t,e=0){let n=0|e;for(const e of t)n=V(n,D(e,n));return 0|n}class gg extends Ul{canRename(t){return t instanceof ql}}var vg,mg={},bg={},wg={},yg={};function _g(){if(vg)return yg;vg=1,Object.defineProperty(yg,"__esModule",{value:!0});var t=function(){return function(t,e,n){this.source=t,this.target=e,this.type=n}}();yg.PowerEdge=t;var e=function(){function e(t,e,n,o){var a=this;if(this.linkAccessor=n,this.modules=new Array(t),this.roots=[],o)this.initModulesFromGroup(o);else{this.roots.push(new i);for(var s=0;s<t;++s)this.roots[0].add(this.modules[s]=new r(s))}this.R=e.length,e.forEach((function(t){var e=a.modules[n.getSourceIndex(t)],r=a.modules[n.getTargetIndex(t)],i=n.getType(t);e.outgoing.add(i,r),r.incoming.add(i,e)}))}return e.prototype.initModulesFromGroup=function(t){var e=new i;this.roots.push(e);for(var n=0;n<t.leaves.length;++n){var a=t.leaves[n],s=new r(a.id);this.modules[a.id]=s,e.add(s)}if(t.groups)for(var l=0;l<t.groups.length;++l){var c=t.groups[l],u={};for(var d in c)"leaves"!==d&&"groups"!==d&&c.hasOwnProperty(d)&&(u[d]=c[d]);e.add(new r(-1-l,new o,new o,this.initModulesFromGroup(c),u))}return e},e.prototype.merge=function(t,e,n){void 0===n&&(n=0);var o=t.incoming.intersection(e.incoming),a=t.outgoing.intersection(e.outgoing),s=new i;s.add(t),s.add(e);var l=new r(this.modules.length,a,o,s);this.modules.push(l);var c=function(n,r,i){n.forAll((function(n,o){n.forAll((function(n){var a=n[r];a.add(o,l),a.remove(o,t),a.remove(o,e),t[i].remove(o,n),e[i].remove(o,n)}))}))};return c(a,"incoming","outgoing"),c(o,"outgoing","incoming"),this.R-=o.count()+a.count(),this.roots[n].remove(t),this.roots[n].remove(e),this.roots[n].add(l),l},e.prototype.rootMerges=function(t){void 0===t&&(t=0);for(var e=this.roots[t].modules(),n=e.length,r=new Array(n*(n-1)),i=0,o=0,a=n-1;o<a;++o)for(var s=o+1;s<n;++s){var l=e[o],c=e[s];r[i]={id:i,nEdges:this.nEdges(l,c),a:l,b:c},i++}return r},e.prototype.greedyMerge=function(){for(var t=0;t<this.roots.length;++t)if(!(this.roots[t].modules().length<2)){var e=this.rootMerges(t).sort((function(t,e){return t.nEdges==e.nEdges?t.id-e.id:t.nEdges-e.nEdges}))[0];if(!(e.nEdges>=this.R))return this.merge(e.a,e.b,t),!0}},e.prototype.nEdges=function(t,e){var n=t.incoming.intersection(e.incoming),r=t.outgoing.intersection(e.outgoing);return this.R-n.count()-r.count()},e.prototype.getGroupHierarchy=function(e){var r=this,i=[];return n(this.roots[0],{},i),this.allEdges().forEach((function(n){var o=r.modules[n.source],a=r.modules[n.target];e.push(new t(void 0===o.gid?n.source:i[o.gid],void 0===a.gid?n.target:i[a.gid],n.type))})),i},e.prototype.allEdges=function(){var t=[];return e.getEdges(this.roots[0],t),t},e.getEdges=function(t,n){t.forAll((function(t){t.getEdges(n),e.getEdges(t.children,n)}))},e}();function n(t,e,r){t.forAll((function(t){if(t.isLeaf())e.leaves||(e.leaves=[]),e.leaves.push(t.id);else{var i=e;if(t.gid=r.length,!t.isIsland()||t.isPredefined()){if(i={id:t.gid},t.isPredefined())for(var o in t.definition)i[o]=t.definition[o];e.groups||(e.groups=[]),e.groups.push(t.gid),r.push(i)}n(t.children,i,r)}}))}yg.Configuration=e;var r=function(){function e(t,e,n,r,a){void 0===e&&(e=new o),void 0===n&&(n=new o),void 0===r&&(r=new i),this.id=t,this.outgoing=e,this.incoming=n,this.children=r,this.definition=a}return e.prototype.getEdges=function(e){var n=this;this.outgoing.forAll((function(r,i){r.forAll((function(r){e.push(new t(n.id,r.id,i))}))}))},e.prototype.isLeaf=function(){return 0===this.children.count()},e.prototype.isIsland=function(){return 0===this.outgoing.count()&&0===this.incoming.count()},e.prototype.isPredefined=function(){return void 0!==this.definition},e}();yg.Module=r;var i=function(){function t(){this.table={}}return t.prototype.count=function(){return Object.keys(this.table).length},t.prototype.intersection=function(e){var n=new t;return n.table=function(t,e){var n={};for(var r in t)r in e&&(n[r]=t[r]);return n}(this.table,e.table),n},t.prototype.intersectionCount=function(t){return this.intersection(t).count()},t.prototype.contains=function(t){return t in this.table},t.prototype.add=function(t){this.table[t.id]=t},t.prototype.remove=function(t){delete this.table[t.id]},t.prototype.forAll=function(t){for(var e in this.table)t(this.table[e])},t.prototype.modules=function(){var t=[];return this.forAll((function(e){e.isPredefined()||t.push(e)})),t},t}();yg.ModuleSet=i;var o=function(){function t(){this.sets={},this.n=0}return t.prototype.count=function(){return this.n},t.prototype.contains=function(t){var e=!1;return this.forAllModules((function(n){e||n.id!=t||(e=!0)})),e},t.prototype.add=function(t,e){(t in this.sets?this.sets[t]:this.sets[t]=new i).add(e),++this.n},t.prototype.remove=function(t,e){var n=this.sets[t];n.remove(e),0===n.count()&&delete this.sets[t],--this.n},t.prototype.forAll=function(t){for(var e in this.sets)t(this.sets[e],Number(e))},t.prototype.forAllModules=function(t){this.forAll((function(e){return e.forAll(t)}))},t.prototype.intersection=function(e){var n=new t;return this.forAll((function(t,r){if(r in e.sets){var i=t.intersection(e.sets[r]),o=i.count();o>0&&(n.sets[r]=i,n.n+=o)}})),n},t}();return yg.LinkSets=o,yg.getGroups=function(t,n,r,i){for(var o=new e(t.length,n,r,i);o.greedyMerge(););var a=[],s=o.getGroupHierarchy(a);return a.forEach((function(e){var n=function(n){var r=e[n];"number"==typeof r&&(e[n]=t[r])};n("source"),n("target")})),{groups:s,powerEdges:a}},yg}var kg,xg={};function Sg(){if(kg)return xg;function t(t,e){var n={};for(var r in t)n[r]={};for(var r in e)n[r]={};return Object.keys(n).length}function e(t,e){var n=0;for(var r in t)void 0!==e[r]&&++n;return n}function n(t,e,n,r){var i=function(t,e){var n={},r=function(t,e){void 0===n[t]&&(n[t]={}),n[t][e]={}};return t.forEach((function(t){var n=e.getSourceIndex(t),i=e.getTargetIndex(t);r(n,i),r(i,n)})),n}(t,r);t.forEach((function(t){var o=i[r.getSourceIndex(t)],a=i[r.getTargetIndex(t)];r.setLength(t,1+e*n(o,a))}))}function r(t,e,n){var r=[],i=0,o=[],a=[];function s(t){t.index=t.lowlink=i++,o.push(t),t.onStack=!0;for(var e=0,n=t.out;e<n.length;e++){var r=n[e];void 0===r.index?(s(r),t.lowlink=Math.min(t.lowlink,r.lowlink)):r.onStack&&(t.lowlink=Math.min(t.lowlink,r.index))}if(t.lowlink===t.index){for(var l=[];o.length&&((r=o.pop()).onStack=!1,l.push(r),r!==t););a.push(l.map((function(t){return t.id})))}}for(var l=0;l<t;l++)r.push({id:l,out:[]});for(var c=0,u=e;c<u.length;c++){var d=u[c],h=r[n.getSourceIndex(d)],f=r[n.getTargetIndex(d)];h.out.push(f)}for(var p=0,g=r;p<g.length;p++){var v=g[p];void 0===v.index&&s(v)}return a}return kg=1,Object.defineProperty(xg,"__esModule",{value:!0}),xg.symmetricDiffLinkLengths=function(r,i,o){void 0===o&&(o=1),n(r,o,(function(n,r){return Math.sqrt(t(n,r)-e(n,r))}),i)},xg.jaccardLinkLengths=function(r,i,o){void 0===o&&(o=1),n(r,o,(function(n,r){return Math.min(Object.keys(n).length,Object.keys(r).length)<1.1?0:e(n,r)/t(n,r)}),i)},xg.generateDirectedEdgeConstraints=function(t,e,n,i){var o=r(t,e,i),a={};o.forEach((function(t,e){return t.forEach((function(t){return a[t]=e}))}));var s=[];return e.forEach((function(t){var e=i.getSourceIndex(t),r=i.getTargetIndex(t);a[e]!==a[r]&&s.push({axis:n,left:e,right:r,gap:i.getMinSeparation(t)})})),s},xg.stronglyConnectedComponents=r,xg}var Eg,Cg={};function Mg(){if(Eg)return Cg;Eg=1,Object.defineProperty(Cg,"__esModule",{value:!0});var t=function(){function t(){this.locks={}}return t.prototype.add=function(t,e){this.locks[t]=e},t.prototype.clear=function(){this.locks={}},t.prototype.isEmpty=function(){for(var t in this.locks)return!1;return!0},t.prototype.apply=function(t){for(var e in this.locks)t(Number(e),this.locks[e])},t}();Cg.Locks=t;var e=function(){function e(e,r,i){void 0===i&&(i=null),this.D=r,this.G=i,this.threshold=1e-4,this.numGridSnapNodes=0,this.snapGridSize=100,this.snapStrength=1e3,this.scaleSnapByMaxH=!1,this.random=new n,this.project=null,this.x=e,this.k=e.length;var o=this.n=e[0].length;this.H=new Array(this.k),this.g=new Array(this.k),this.Hd=new Array(this.k),this.a=new Array(this.k),this.b=new Array(this.k),this.c=new Array(this.k),this.d=new Array(this.k),this.e=new Array(this.k),this.ia=new Array(this.k),this.ib=new Array(this.k),this.xtmp=new Array(this.k),this.locks=new t,this.minD=Number.MAX_VALUE;for(var a,s=o;s--;)for(a=o;--a>s;){var l=r[s][a];l>0&&l<this.minD&&(this.minD=l)}for(this.minD===Number.MAX_VALUE&&(this.minD=1),s=this.k;s--;){for(this.g[s]=new Array(o),this.H[s]=new Array(o),a=o;a--;)this.H[s][a]=new Array(o);this.Hd[s]=new Array(o),this.a[s]=new Array(o),this.b[s]=new Array(o),this.c[s]=new Array(o),this.d[s]=new Array(o),this.e[s]=new Array(o),this.ia[s]=new Array(o),this.ib[s]=new Array(o),this.xtmp[s]=new Array(o)}}return e.createSquareMatrix=function(t,e){for(var n=new Array(t),r=0;r<t;++r){n[r]=new Array(t);for(var i=0;i<t;++i)n[r][i]=e(r,i)}return n},e.prototype.offsetDir=function(){for(var t=this,e=new Array(this.k),n=0,r=0;r<this.k;++r){var i=e[r]=this.random.getNextBetween(.01,1)-.5;n+=i*i}return n=Math.sqrt(n),e.map((function(e){return e*(t.minD/n)}))},e.prototype.computeDerivatives=function(t){var e=this,n=this.n;if(!(n<1)){for(var r,i=new Array(this.k),o=new Array(this.k),a=new Array(this.k),s=0,l=0;l<n;++l){for(r=0;r<this.k;++r)a[r]=this.g[r][l]=0;for(var c=0;c<n;++c)if(l!==c){for(var u=n;u--;){var d=0;for(r=0;r<this.k;++r){var h=i[r]=t[r][l]-t[r][c];d+=o[r]=h*h}if(d>1e-9)break;var f=this.offsetDir();for(r=0;r<this.k;++r)t[r][c]+=f[r]}var p=Math.sqrt(d),g=this.D[l][c],v=null!=this.G?this.G[l][c]:1;if(v>1&&p>g||!isFinite(g))for(r=0;r<this.k;++r)this.H[r][l][c]=0;else{v>1&&(v=1);var m=g*g,b=2*v*(p-g)/(m*p),w=p*p*p,y=2*-v/(m*w);for(isFinite(b)||console.log(b),r=0;r<this.k;++r)this.g[r][l]+=i[r]*b,a[r]-=this.H[r][l][c]=y*(w+g*(o[r]-d)+p*d)}}for(r=0;r<this.k;++r)s=Math.max(s,this.H[r][l][l]=a[r])}var _=this.snapGridSize/2,k=this.snapGridSize,x=this.snapStrength/(_*_),S=this.numGridSnapNodes;for(l=0;l<S;++l)for(r=0;r<this.k;++r){var E=this.x[r][l],C=E/k,M=C%1,L=C-M;-_<(h=Math.abs(M)<=.5?E-L*k:E>0?E-(L+1)*k:E-(L-1)*k)&&h<=_&&(this.scaleSnapByMaxH?(this.g[r][l]+=s*x*h,this.H[r][l][l]+=s*x):(this.g[r][l]+=x*h,this.H[r][l][l]+=x))}this.locks.isEmpty()||this.locks.apply((function(n,i){for(r=0;r<e.k;++r)e.H[r][n][n]+=s,e.g[r][n]-=s*(i[r]-t[r][n])}))}},e.dotProd=function(t,e){for(var n=0,r=t.length;r--;)n+=t[r]*e[r];return n},e.rightMultiply=function(t,n,r){for(var i=t.length;i--;)r[i]=e.dotProd(t[i],n)},e.prototype.computeStepSize=function(t){for(var n=0,r=0,i=0;i<this.k;++i)n+=e.dotProd(this.g[i],t[i]),e.rightMultiply(this.H[i],t[i],this.Hd[i]),r+=e.dotProd(t[i],this.Hd[i]);return 0!==r&&isFinite(r)?1*n/r:0},e.prototype.reduceStress=function(){this.computeDerivatives(this.x);for(var t=this.computeStepSize(this.g),e=0;e<this.k;++e)this.takeDescentStep(this.x[e],this.g[e],t);return this.computeStress()},e.copy=function(t,e){for(var n=t.length,r=e[0].length,i=0;i<n;++i)for(var o=0;o<r;++o)e[i][o]=t[i][o]},e.prototype.stepAndProject=function(t,n,r,i){e.copy(t,n),this.takeDescentStep(n[0],r[0],i),this.project&&this.project[0](t[0],t[1],n[0]),this.takeDescentStep(n[1],r[1],i),this.project&&this.project[1](n[0],t[1],n[1]);for(var o=2;o<this.k;o++)this.takeDescentStep(n[o],r[o],i)},e.mApply=function(t,e,n){for(var r=t;r-- >0;)for(var i=e;i-- >0;)n(r,i)},e.prototype.matrixApply=function(t){e.mApply(this.k,this.n,t)},e.prototype.computeNextPosition=function(t,e){var n=this;this.computeDerivatives(t);var r=this.computeStepSize(this.g);if(this.stepAndProject(t,e,this.g,r),this.project){this.matrixApply((function(r,i){return n.e[r][i]=t[r][i]-e[r][i]}));var i=this.computeStepSize(this.e);i=Math.max(.2,Math.min(i,1)),this.stepAndProject(t,e,this.e,i)}},e.prototype.run=function(t){for(var e=Number.MAX_VALUE,n=!1;!n&&t-- >0;){var r=this.rungeKutta();n=Math.abs(e/r-1)<this.threshold,e=r}return e},e.prototype.rungeKutta=function(){var t=this;this.computeNextPosition(this.x,this.a),e.mid(this.x,this.a,this.ia),this.computeNextPosition(this.ia,this.b),e.mid(this.x,this.b,this.ib),this.computeNextPosition(this.ib,this.c),this.computeNextPosition(this.c,this.d);var n=0;return this.matrixApply((function(e,r){var i=(t.a[e][r]+2*t.b[e][r]+2*t.c[e][r]+t.d[e][r])/6,o=t.x[e][r]-i;n+=o*o,t.x[e][r]=i})),n},e.mid=function(t,n,r){e.mApply(t.length,t[0].length,(function(e,i){return r[e][i]=t[e][i]+(n[e][i]-t[e][i])/2}))},e.prototype.takeDescentStep=function(t,e,n){for(var r=0;r<this.n;++r)t[r]=t[r]-n*e[r]},e.prototype.computeStress=function(){for(var t=0,e=0,n=this.n-1;e<n;++e)for(var r=e+1,i=this.n;r<i;++r){for(var o=0,a=0;a<this.k;++a){var s=this.x[a][e]-this.x[a][r];o+=s*s}o=Math.sqrt(o);var l=this.D[e][r];if(isFinite(l)){var c=l-o;t+=c*c/(l*l)}}return t},e.zeroDistance=1e-10,e}();Cg.Descent=e;var n=function(){function t(t){void 0===t&&(t=1),this.seed=t,this.a=214013,this.c=2531011,this.m=2147483648,this.range=32767}return t.prototype.getNext=function(){return this.seed=(this.seed*this.a+this.c)%this.m,(this.seed>>16)/this.range},t.prototype.getNextBetween=function(t,e){return t+this.getNext()*(e-t)},t}();return Cg.PseudoRandom=n,Cg}var Lg,$g={},Ng={};function Tg(){if(Lg)return Ng;Lg=1,Object.defineProperty(Ng,"__esModule",{value:!0});var t=function(){function t(t){this.scale=t,this.AB=0,this.AD=0,this.A2=0}return t.prototype.addVariable=function(t){var e=this.scale/t.scale,n=t.weight;this.AB+=n*e*(t.offset/t.scale),this.AD+=n*e*t.desiredPosition,this.A2+=n*e*e},t.prototype.getPosn=function(){return(this.AD-this.AB)/this.A2},t}();Ng.PositionStats=t;var e=function(){function t(t,e,n,r){void 0===r&&(r=!1),this.left=t,this.right=e,this.gap=n,this.equality=r,this.active=!1,this.unsatisfiable=!1,this.left=t,this.right=e,this.gap=n,this.equality=r}return t.prototype.slack=function(){return this.unsatisfiable?Number.MAX_VALUE:this.right.scale*this.right.position()-this.gap-this.left.scale*this.left.position()},t}();Ng.Constraint=e;var n=function(){function t(t,e,n){void 0===e&&(e=1),void 0===n&&(n=1),this.desiredPosition=t,this.weight=e,this.scale=n,this.offset=0}return t.prototype.dfdv=function(){return 2*this.weight*(this.position()-this.desiredPosition)},t.prototype.position=function(){return(this.block.ps.scale*this.block.posn+this.offset)/this.scale},t.prototype.visitNeighbours=function(t,e){var n=function(n,r){return n.active&&t!==r&&e(n,r)};this.cOut.forEach((function(t){return n(t,t.right)})),this.cIn.forEach((function(t){return n(t,t.left)}))},t}();Ng.Variable=n;var r=function(){function e(e){this.vars=[],e.offset=0,this.ps=new t(e.scale),this.addVariable(e)}return e.prototype.addVariable=function(t){t.block=this,this.vars.push(t),this.ps.addVariable(t),this.posn=this.ps.getPosn()},e.prototype.updateWeightedPosition=function(){this.ps.AB=this.ps.AD=this.ps.A2=0;for(var t=0,e=this.vars.length;t<e;++t)this.ps.addVariable(this.vars[t]);this.posn=this.ps.getPosn()},e.prototype.compute_lm=function(t,e,n){var r=this,i=t.dfdv();return t.visitNeighbours(e,(function(e,o){var a=r.compute_lm(o,t,n);o===e.right?(i+=a*e.left.scale,e.lm=a):(i+=a*e.right.scale,e.lm=-a),n(e)})),i/t.scale},e.prototype.populateSplitBlock=function(t,e){var n=this;t.visitNeighbours(e,(function(e,r){r.offset=t.offset+(r===e.right?e.gap:-e.gap),n.addVariable(r),n.populateSplitBlock(r,t)}))},e.prototype.traverse=function(t,e,n,r){var i=this;void 0===n&&(n=this.vars[0]),void 0===r&&(r=null),n.visitNeighbours(r,(function(r,o){e.push(t(r)),i.traverse(t,e,o,n)}))},e.prototype.findMinLM=function(){var t=null;return this.compute_lm(this.vars[0],null,(function(e){!e.equality&&(null===t||e.lm<t.lm)&&(t=e)})),t},e.prototype.findMinLMBetween=function(t,e){this.compute_lm(t,null,(function(){}));var n=null;return this.findPath(t,null,e,(function(t,e){!t.equality&&t.right===e&&(null===n||t.lm<n.lm)&&(n=t)})),n},e.prototype.findPath=function(t,e,n,r){var i=this,o=!1;return t.visitNeighbours(e,(function(e,a){o||a!==n&&!i.findPath(a,t,n,r)||(o=!0,r(e,a))})),o},e.prototype.isActiveDirectedPathBetween=function(t,e){if(t===e)return!0;for(var n=t.cOut.length;n--;){var r=t.cOut[n];if(r.active&&this.isActiveDirectedPathBetween(r.right,e))return!0}return!1},e.split=function(t){return t.active=!1,[e.createSplitBlock(t.left),e.createSplitBlock(t.right)]},e.createSplitBlock=function(t){var n=new e(t);return n.populateSplitBlock(t,null),n},e.prototype.splitBetween=function(t,n){var r=this.findMinLMBetween(t,n);if(null!==r){var i=e.split(r);return{constraint:r,lb:i[0],rb:i[1]}}return null},e.prototype.mergeAcross=function(t,e,n){e.active=!0;for(var r=0,i=t.vars.length;r<i;++r){var o=t.vars[r];o.offset+=n,this.addVariable(o)}this.posn=this.ps.getPosn()},e.prototype.cost=function(){for(var t=0,e=this.vars.length;e--;){var n=this.vars[e],r=n.position()-n.desiredPosition;t+=r*r*n.weight}return t},e}();Ng.Block=r;var i=function(){function t(t){this.vs=t;var e=t.length;for(this.list=new Array(e);e--;){var n=new r(t[e]);this.list[e]=n,n.blockInd=e}}return t.prototype.cost=function(){for(var t=0,e=this.list.length;e--;)t+=this.list[e].cost();return t},t.prototype.insert=function(t){t.blockInd=this.list.length,this.list.push(t)},t.prototype.remove=function(t){var e=this.list.length-1,n=this.list[e];this.list.length=e,t!==n&&(this.list[t.blockInd]=n,n.blockInd=t.blockInd)},t.prototype.merge=function(t){var e=t.left.block,n=t.right.block,r=t.right.offset-t.left.offset-t.gap;e.vars.length<n.vars.length?(n.mergeAcross(e,t,r),this.remove(e)):(e.mergeAcross(n,t,-r),this.remove(n))},t.prototype.forEach=function(t){this.list.forEach(t)},t.prototype.updateBlockPositions=function(){this.list.forEach((function(t){return t.updateWeightedPosition()}))},t.prototype.split=function(t){var e=this;this.updateBlockPositions(),this.list.forEach((function(n){var i=n.findMinLM();null!==i&&i.lm<o.LAGRANGIAN_TOLERANCE&&(n=i.left.block,r.split(i).forEach((function(t){return e.insert(t)})),e.remove(n),t.push(i))}))},t}();Ng.Blocks=i;var o=function(){function t(t,e){this.vs=t,this.cs=e,this.vs=t,t.forEach((function(t){t.cIn=[],t.cOut=[]})),this.cs=e,e.forEach((function(t){t.left.cOut.push(t),t.right.cIn.push(t)})),this.inactive=e.map((function(t){return t.active=!1,t})),this.bs=null}return t.prototype.cost=function(){return this.bs.cost()},t.prototype.setStartingPositions=function(t){this.inactive=this.cs.map((function(t){return t.active=!1,t})),this.bs=new i(this.vs),this.bs.forEach((function(e,n){return e.posn=t[n]}))},t.prototype.setDesiredPositions=function(t){this.vs.forEach((function(e,n){return e.desiredPosition=t[n]}))},t.prototype.mostViolated=function(){for(var e=Number.MAX_VALUE,n=null,r=this.inactive,i=r.length,o=i,a=0;a<i;++a){var s=r[a];if(!s.unsatisfiable){var l=s.slack();if((s.equality||l<e)&&(e=l,n=s,o=a,s.equality))break}}return o!==i&&(e<t.ZERO_UPPERBOUND&&!n.active||n.equality)&&(r[o]=r[i-1],r.length=i-1),n},t.prototype.satisfy=function(){null==this.bs&&(this.bs=new i(this.vs)),this.bs.split(this.inactive);for(var e=null;(e=this.mostViolated())&&(e.equality||e.slack()<t.ZERO_UPPERBOUND&&!e.active);){var n=e.left.block;if(n!==e.right.block)this.bs.merge(e);else{if(n.isActiveDirectedPathBetween(e.right,e.left)){e.unsatisfiable=!0;continue}var r=n.splitBetween(e.left,e.right);if(null===r){e.unsatisfiable=!0;continue}this.bs.insert(r.lb),this.bs.insert(r.rb),this.bs.remove(n),this.inactive.push(r.constraint),e.slack()>=0?this.inactive.push(e):this.bs.merge(e)}}},t.prototype.solve=function(){this.satisfy();for(var t=Number.MAX_VALUE,e=this.bs.cost();Math.abs(t-e)>1e-4;)this.satisfy(),t=e,e=this.bs.cost();return e},t.LAGRANGIAN_TOLERANCE=-1e-4,t.ZERO_UPPERBOUND=-1e-10,t}();return Ng.Solver=o,Ng.removeOverlapInOneDimension=function(t,r,i){for(var a=t.map((function(t){return new n(t.desiredCenter)})),s=[],l=t.length,c=0;c<l-1;c++)s.push(new e(a[c],a[c+1],(t[c].size+t[c+1].size)/2));var u=a[0],d=a[l-1],h=t[0].size/2,f=t[l-1].size/2,p=null,g=null;return r&&(p=new n(r,1e3*u.weight),a.push(p),s.push(new e(p,u,h))),i&&(g=new n(i,1e3*d.weight),a.push(g),s.push(new e(d,g,f))),new o(a,s).solve(),{newCenters:a.slice(0,t.length).map((function(t){return t.position()})),lowerBound:p?p.position():u.position()-h,upperBound:g?g.position():d.position()+f}},Ng}var Ag,zg,Ig={};function Rg(){if(Ag)return Ig;Ag=1;var t,e=Ig&&Ig.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)});Object.defineProperty(Ig,"__esModule",{value:!0});var n=function(){function t(){this.findIter=function(t){for(var e=this._root,n=this.iterator();null!==e;){var r=this._comparator(t,e.data);if(0===r)return n._cursor=e,n;n._ancestors.push(e),e=e.get_child(r>0)}return null}}return t.prototype.clear=function(){this._root=null,this.size=0},t.prototype.find=function(t){for(var e=this._root;null!==e;){var n=this._comparator(t,e.data);if(0===n)return e.data;e=e.get_child(n>0)}return null},t.prototype.lowerBound=function(t){return this._bound(t,this._comparator)},t.prototype.upperBound=function(t){var e=this._comparator;return this._bound(t,(function(t,n){return e(n,t)}))},t.prototype.min=function(){var t=this._root;if(null===t)return null;for(;null!==t.left;)t=t.left;return t.data},t.prototype.max=function(){var t=this._root;if(null===t)return null;for(;null!==t.right;)t=t.right;return t.data},t.prototype.iterator=function(){return new r(this)},t.prototype.each=function(t){for(var e,n=this.iterator();null!==(e=n.next());)t(e)},t.prototype.reach=function(t){for(var e,n=this.iterator();null!==(e=n.prev());)t(e)},t.prototype._bound=function(t,e){for(var n=this._root,r=this.iterator();null!==n;){var i=this._comparator(t,n.data);if(0===i)return r._cursor=n,r;r._ancestors.push(n),n=n.get_child(i>0)}for(var o=r._ancestors.length-1;o>=0;--o)if(e(t,(n=r._ancestors[o]).data)>0)return r._cursor=n,r._ancestors.length=o,r;return r._ancestors.length=0,r},t}();Ig.TreeBase=n;var r=function(){function t(t){this._tree=t,this._ancestors=[],this._cursor=null}return t.prototype.data=function(){return null!==this._cursor?this._cursor.data:null},t.prototype.next=function(){if(null===this._cursor){var t=this._tree._root;null!==t&&this._minNode(t)}else{var e;if(null===this._cursor.right)do{if(e=this._cursor,!this._ancestors.length){this._cursor=null;break}this._cursor=this._ancestors.pop()}while(this._cursor.right===e);else this._ancestors.push(this._cursor),this._minNode(this._cursor.right)}return null!==this._cursor?this._cursor.data:null},t.prototype.prev=function(){if(null===this._cursor){var t=this._tree._root;null!==t&&this._maxNode(t)}else{var e;if(null===this._cursor.left)do{if(e=this._cursor,!this._ancestors.length){this._cursor=null;break}this._cursor=this._ancestors.pop()}while(this._cursor.left===e);else this._ancestors.push(this._cursor),this._maxNode(this._cursor.left)}return null!==this._cursor?this._cursor.data:null},t.prototype._minNode=function(t){for(;null!==t.left;)this._ancestors.push(t),t=t.left;this._cursor=t},t.prototype._maxNode=function(t){for(;null!==t.right;)this._ancestors.push(t),t=t.right;this._cursor=t},t}();Ig.Iterator=r;var i=function(){function t(t){this.data=t,this.left=null,this.right=null,this.red=!0}return t.prototype.get_child=function(t){return t?this.right:this.left},t.prototype.set_child=function(t,e){t?this.right=e:this.left=e},t}(),o=function(t){function n(e){var n=t.call(this)||this;return n._root=null,n._comparator=e,n.size=0,n}return e(n,t),n.prototype.insert=function(t){var e=!1;if(null===this._root)this._root=new i(t),e=!0,this.size++;else{var r=new i(void 0),o=!1,a=!1,s=null,l=r,c=null,u=this._root;for(l.right=this._root;;){if(null===u?(u=new i(t),c.set_child(o,u),e=!0,this.size++):n.is_red(u.left)&&n.is_red(u.right)&&(u.red=!0,u.left.red=!1,u.right.red=!1),n.is_red(u)&&n.is_red(c)){var d=l.right===s;u===c.get_child(a)?l.set_child(d,n.single_rotate(s,!a)):l.set_child(d,n.double_rotate(s,!a))}var h=this._comparator(u.data,t);if(0===h)break;a=o,null!==s&&(l=s),s=c,c=u,u=u.get_child(o=h<0)}this._root=r.right}return this._root.red=!1,e},n.prototype.remove=function(t){if(null===this._root)return!1;var e=new i(void 0),r=e;r.right=this._root;for(var o=null,a=null,s=null,l=!0;null!==r.get_child(l);){var c=l;a=o,o=r,r=r.get_child(l);var u=this._comparator(t,r.data);if(l=u>0,0===u&&(s=r),!n.is_red(r)&&!n.is_red(r.get_child(l)))if(n.is_red(r.get_child(!l))){var d=n.single_rotate(r,l);o.set_child(c,d),o=d}else if(!n.is_red(r.get_child(!l))){var h=o.get_child(!c);if(null!==h)if(n.is_red(h.get_child(!c))||n.is_red(h.get_child(c))){var f=a.right===o;n.is_red(h.get_child(c))?a.set_child(f,n.double_rotate(o,c)):n.is_red(h.get_child(!c))&&a.set_child(f,n.single_rotate(o,c));var p=a.get_child(f);p.red=!0,r.red=!0,p.left.red=!1,p.right.red=!1}else o.red=!1,h.red=!0,r.red=!0}}return null!==s&&(s.data=r.data,o.set_child(o.right===r,r.get_child(null===r.left)),this.size--),this._root=e.right,null!==this._root&&(this._root.red=!1),null!==s},n.is_red=function(t){return null!==t&&t.red},n.single_rotate=function(t,e){var n=t.get_child(!e);return t.set_child(!e,n.get_child(e)),n.set_child(e,t),t.red=!0,n.red=!1,n},n.double_rotate=function(t,e){return t.set_child(!e,n.single_rotate(t.get_child(!e),!e)),n.single_rotate(t,e)},n}(n);return Ig.RBTree=o,Ig}function Og(){if(zg)return $g;zg=1;var t,e=$g&&$g.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)});Object.defineProperty($g,"__esModule",{value:!0});var n=Tg(),r=Rg();function i(t){return t.bounds=void 0!==t.leaves?t.leaves.reduce((function(t,e){return e.bounds.union(t)}),o.empty()):o.empty(),void 0!==t.groups&&(t.bounds=t.groups.reduce((function(t,e){return i(e).union(t)}),t.bounds)),t.bounds=t.bounds.inflate(t.padding),t.bounds}$g.computeGroupBounds=i;var o=function(){function t(t,e,n,r){this.x=t,this.X=e,this.y=n,this.Y=r}return t.empty=function(){return new t(Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY)},t.prototype.cx=function(){return(this.x+this.X)/2},t.prototype.cy=function(){return(this.y+this.Y)/2},t.prototype.overlapX=function(t){var e=this.cx(),n=t.cx();return e<=n&&t.x<this.X?this.X-t.x:n<=e&&this.x<t.X?t.X-this.x:0},t.prototype.overlapY=function(t){var e=this.cy(),n=t.cy();return e<=n&&t.y<this.Y?this.Y-t.y:n<=e&&this.y<t.Y?t.Y-this.y:0},t.prototype.setXCentre=function(t){var e=t-this.cx();this.x+=e,this.X+=e},t.prototype.setYCentre=function(t){var e=t-this.cy();this.y+=e,this.Y+=e},t.prototype.width=function(){return this.X-this.x},t.prototype.height=function(){return this.Y-this.y},t.prototype.union=function(e){return new t(Math.min(this.x,e.x),Math.max(this.X,e.X),Math.min(this.y,e.y),Math.max(this.Y,e.Y))},t.prototype.lineIntersections=function(e,n,r,i){for(var o=[[this.x,this.y,this.X,this.y],[this.X,this.y,this.X,this.Y],[this.X,this.Y,this.x,this.Y],[this.x,this.Y,this.x,this.y]],a=[],s=0;s<4;++s){var l=t.lineIntersection(e,n,r,i,o[s][0],o[s][1],o[s][2],o[s][3]);null!==l&&a.push({x:l.x,y:l.y})}return a},t.prototype.rayIntersection=function(t,e){var n=this.lineIntersections(this.cx(),this.cy(),t,e);return n.length>0?n[0]:null},t.prototype.vertices=function(){return[{x:this.x,y:this.y},{x:this.X,y:this.y},{x:this.X,y:this.Y},{x:this.x,y:this.Y}]},t.lineIntersection=function(t,e,n,r,i,o,a,s){var l=n-t,c=a-i,u=r-e,d=s-o,h=d*l-c*u;if(0==h)return null;var f=t-i,p=e-o,g=(c*p-d*f)/h,v=(l*p-u*f)/h;return g>=0&&g<=1&&v>=0&&v<=1?{x:t+g*l,y:e+g*u}:null},t.prototype.inflate=function(e){return new t(this.x-e,this.X+e,this.y-e,this.Y+e)},t}();$g.Rectangle=o,$g.makeEdgeBetween=function(t,e,n){var r=t.rayIntersection(e.cx(),e.cy())||{x:t.cx(),y:t.cy()},i=e.rayIntersection(t.cx(),t.cy())||{x:e.cx(),y:e.cy()},o=i.x-r.x,a=i.y-r.y,s=Math.sqrt(o*o+a*a),l=s-n;return{sourceIntersection:r,targetIntersection:i,arrowStart:{x:r.x+l*o/s,y:r.y+l*a/s}}},$g.makeEdgeTo=function(t,e,n){var r=e.rayIntersection(t.x,t.y);r||(r={x:e.cx(),y:e.cy()});var i=r.x-t.x,o=r.y-t.y,a=Math.sqrt(i*i+o*o);return{x:r.x-n*i/a,y:r.y-n*o/a}};var a=function(){return function(t,e,n){this.v=t,this.r=e,this.pos=n,this.prev=c(),this.next=c()}}(),s=function(){return function(t,e,n){this.isOpen=t,this.v=e,this.pos=n}}();function l(t,e){return t.pos>e.pos?1:t.pos<e.pos||t.isOpen?-1:e.isOpen?1:0}function c(){return new r.RBTree((function(t,e){return t.pos-e.pos}))}var u={getCentre:function(t){return t.cx()},getOpen:function(t){return t.y},getClose:function(t){return t.Y},getSize:function(t){return t.width()},makeRect:function(t,e,n,r){return new o(n-r/2,n+r/2,t,e)},findNeighbours:function(t,e){var n=function(n,r){for(var i,o=e.findIter(t);null!==(i=o[n]());){var a=i.r.overlapX(t.r);if((a<=0||a<=i.r.overlapY(t.r))&&(t[n].insert(i),i[r].insert(t)),a<=0)break}};n("next","prev"),n("prev","next")}},d={getCentre:function(t){return t.cy()},getOpen:function(t){return t.x},getClose:function(t){return t.X},getSize:function(t){return t.height()},makeRect:function(t,e,n,r){return new o(t,e,n-r/2,n+r/2)},findNeighbours:function(t,e){var n=function(n,r){var i=e.findIter(t)[n]();null!==i&&i.r.overlapX(t.r)>0&&(t[n].insert(i),i[r].insert(t))};n("next","prev"),n("prev","next")}};function h(t,e,n,r){void 0===r&&(r=!1);var i=t.padding,o=void 0!==t.groups?t.groups.length:0,a=void 0!==t.leaves?t.leaves.length:0,s=o?t.groups.reduce((function(t,r){return t.concat(h(r,e,n,!0))}),[]):[],l=(r?2:0)+a+o,c=new Array(l),u=new Array(l),d=0,p=function(t,e){u[d]=t,c[d++]=e};if(r){var g=t.bounds,v=e.getCentre(g),m=e.getSize(g)/2,b=e.getOpen(g),w=e.getClose(g),y=v-m+i/2,_=v+m-i/2;t.minVar.desiredPosition=y,p(e.makeRect(b,w,y,i),t.minVar),t.maxVar.desiredPosition=_,p(e.makeRect(b,w,_,i),t.maxVar)}a&&t.leaves.forEach((function(t){return p(t.bounds,t.variable)})),o&&t.groups.forEach((function(t){var n=t.bounds;p(e.makeRect(e.getOpen(n),e.getClose(n),e.getCentre(n),e.getSize(n)),t.minVar)}));var k=f(u,c,e,n);return o&&(c.forEach((function(t){t.cOut=[],t.cIn=[]})),k.forEach((function(t){t.left.cOut.push(t),t.right.cIn.push(t)})),t.groups.forEach((function(t){var n=(t.padding-e.getSize(t.bounds))/2;t.minVar.cIn.forEach((function(t){return t.gap+=n})),t.minVar.cOut.forEach((function(e){e.left=t.maxVar,e.gap+=n}))}))),s.concat(k)}function f(t,e,r,i){var o,u=t.length,d=2*u;console.assert(e.length>=u);var h=new Array(d);for(o=0;o<u;++o){var f=t[o],p=new a(e[o],f,r.getCentre(f));h[o]=new s(!0,p,r.getOpen(f)),h[o+u]=new s(!1,p,r.getClose(f))}h.sort(l);var g=new Array,v=c();for(o=0;o<d;++o){var m=h[o];if(p=m.v,m.isOpen)v.insert(p),r.findNeighbours(p,v);else{v.remove(p);var b=function(t,e){var o=(r.getSize(t.r)+r.getSize(e.r))/2+i;g.push(new n.Constraint(t.v,e.v,o))},w=function(t,e,n){for(var r,i=p[t].iterator();null!==(r=i[t]());)n(r,p),r[e].remove(p)};w("prev","next",(function(t,e){return b(t,e)})),w("next","prev",(function(t,e){return b(e,t)}))}}return console.assert(0===v.size),g}function p(t,e){return f(t,e,u,1e-6)}function g(t,e){return f(t,e,d,1e-6)}function v(t){return h(t,u,1e-6)}function m(t){return h(t,d,1e-6)}$g.generateXConstraints=p,$g.generateYConstraints=g,$g.generateXGroupConstraints=v,$g.generateYGroupConstraints=m,$g.removeOverlaps=function(t){var e=t.map((function(t){return new n.Variable(t.cx())})),r=p(t,e),i=new n.Solver(e,r);i.solve(),e.forEach((function(e,n){return t[n].setXCentre(e.position())})),e=t.map((function(t){return new n.Variable(t.cy())})),r=g(t,e),(i=new n.Solver(e,r)).solve(),e.forEach((function(e,n){return t[n].setYCentre(e.position())}))};var b=function(t){function n(e,n){var r=t.call(this,0,n)||this;return r.index=e,r}return e(n,t),n}(n.Variable);$g.IndexedVariable=b;var w=function(){function t(t,e,n,r,a){void 0===n&&(n=null),void 0===r&&(r=null),void 0===a&&(a=!1);var s=this;if(this.nodes=t,this.groups=e,this.rootGroup=n,this.avoidOverlaps=a,this.variables=t.map((function(t,e){return t.variable=new b(e,1)})),r&&this.createConstraints(r),a&&n&&void 0!==n.groups){t.forEach((function(t){if(t.width&&t.height){var e=t.width/2,n=t.height/2;t.bounds=new o(t.x-e,t.x+e,t.y-n,t.y+n)}else t.bounds=new o(t.x,t.x,t.y,t.y)})),i(n);var l=t.length;e.forEach((function(t){s.variables[l]=t.minVar=new b(l++,void 0!==t.stiffness?t.stiffness:.01),s.variables[l]=t.maxVar=new b(l++,void 0!==t.stiffness?t.stiffness:.01)}))}}return t.prototype.createSeparation=function(t){return new n.Constraint(this.nodes[t.left].variable,this.nodes[t.right].variable,t.gap,void 0!==t.equality&&t.equality)},t.prototype.makeFeasible=function(t){var e=this;if(this.avoidOverlaps){var n="x",r="width";"x"===t.axis&&(n="y",r="height");var i=t.offsets.map((function(t){return e.nodes[t.node]})).sort((function(t,e){return t[n]-e[n]})),o=null;i.forEach((function(t){if(o){var e=o[n]+o[r];e>t[n]&&(t[n]=e)}o=t}))}},t.prototype.createAlignment=function(t){var e=this,r=this.nodes[t.offsets[0].node].variable;this.makeFeasible(t);var i="x"===t.axis?this.xConstraints:this.yConstraints;t.offsets.slice(1).forEach((function(t){i.push(new n.Constraint(r,e.nodes[t.node].variable,t.offset,!0))}))},t.prototype.createConstraints=function(t){var e=this,n=function(t){return void 0===t.type||"separation"===t.type};this.xConstraints=t.filter((function(t){return"x"===t.axis&&n(t)})).map((function(t){return e.createSeparation(t)})),this.yConstraints=t.filter((function(t){return"y"===t.axis&&n(t)})).map((function(t){return e.createSeparation(t)})),t.filter((function(t){return"alignment"===t.type})).forEach((function(t){return e.createAlignment(t)}))},t.prototype.setupVariablesAndBounds=function(t,e,n,r){this.nodes.forEach((function(i,a){i.fixed?(i.variable.weight=i.fixedWeight?i.fixedWeight:1e3,n[a]=r(i)):i.variable.weight=1;var s=(i.width||0)/2,l=(i.height||0)/2,c=t[a],u=e[a];i.bounds=new o(c-s,c+s,u-l,u+l)}))},t.prototype.xProject=function(t,e,n){(this.rootGroup||this.avoidOverlaps||this.xConstraints)&&this.project(t,e,t,n,(function(t){return t.px}),this.xConstraints,v,(function(t){return t.bounds.setXCentre(n[t.variable.index]=t.variable.position())}),(function(t){var e=n[t.minVar.index]=t.minVar.position(),r=n[t.maxVar.index]=t.maxVar.position(),i=t.padding/2;t.bounds.x=e-i,t.bounds.X=r+i}))},t.prototype.yProject=function(t,e,n){(this.rootGroup||this.yConstraints)&&this.project(t,e,e,n,(function(t){return t.py}),this.yConstraints,m,(function(t){return t.bounds.setYCentre(n[t.variable.index]=t.variable.position())}),(function(t){var e=n[t.minVar.index]=t.minVar.position(),r=n[t.maxVar.index]=t.maxVar.position(),i=t.padding/2;t.bounds.y=e-i,t.bounds.Y=r+i}))},t.prototype.projectFunctions=function(){var t=this;return[function(e,n,r){return t.xProject(e,n,r)},function(e,n,r){return t.yProject(e,n,r)}]},t.prototype.project=function(t,e,n,r,o,a,s,l,c){this.setupVariablesAndBounds(t,e,r,o),this.rootGroup&&this.avoidOverlaps&&(i(this.rootGroup),a=a.concat(s(this.rootGroup))),this.solve(this.variables,a,n,r),this.nodes.forEach(l),this.rootGroup&&this.avoidOverlaps&&(this.groups.forEach(c),i(this.rootGroup))},t.prototype.solve=function(t,e,r,i){var o=new n.Solver(t,e);o.setStartingPositions(r),o.setDesiredPositions(i),o.solve()},t}();return $g.Projection=w,$g}var Pg,Vg,jg={},Dg={};function Hg(){if(Pg)return Dg;Pg=1,Object.defineProperty(Dg,"__esModule",{value:!0});var t=function(){function t(t){this.elem=t,this.subheaps=[]}return t.prototype.toString=function(t){for(var e="",n=!1,r=0;r<this.subheaps.length;++r){var i=this.subheaps[r];i.elem?(n&&(e+=","),e+=i.toString(t),n=!0):n=!1}return""!==e&&(e="("+e+")"),(this.elem?t(this.elem):"")+e},t.prototype.forEach=function(t){this.empty()||(t(this.elem,this),this.subheaps.forEach((function(e){return e.forEach(t)})))},t.prototype.count=function(){return this.empty()?0:1+this.subheaps.reduce((function(t,e){return t+e.count()}),0)},t.prototype.min=function(){return this.elem},t.prototype.empty=function(){return null==this.elem},t.prototype.contains=function(t){if(this===t)return!0;for(var e=0;e<this.subheaps.length;e++)if(this.subheaps[e].contains(t))return!0;return!1},t.prototype.isHeap=function(t){var e=this;return this.subheaps.every((function(n){return t(e.elem,n.elem)&&n.isHeap(t)}))},t.prototype.insert=function(e,n){return this.merge(new t(e),n)},t.prototype.merge=function(t,e){return this.empty()?t:t.empty()?this:e(this.elem,t.elem)?(this.subheaps.push(t),this):(t.subheaps.push(this),t)},t.prototype.removeMin=function(t){return this.empty()?null:this.mergePairs(t)},t.prototype.mergePairs=function(e){if(0==this.subheaps.length)return new t(null);if(1==this.subheaps.length)return this.subheaps[0];var n=this.subheaps.pop().merge(this.subheaps.pop(),e),r=this.mergePairs(e);return n.merge(r,e)},t.prototype.decreaseKey=function(e,n,r,i){var o=e.removeMin(i);e.elem=o.elem,e.subheaps=o.subheaps,null!==r&&null!==o.elem&&r(e.elem,e);var a=new t(n);return null!==r&&r(n,a),this.merge(a,i)},t}();Dg.PairingHeap=t;var e=function(){function e(t){this.lessThan=t}return e.prototype.top=function(){return this.empty()?null:this.root.elem},e.prototype.push=function(){for(var e,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];for(var i,o=0;i=n[o];++o)e=new t(i),this.root=this.empty()?e:this.root.merge(e,this.lessThan);return e},e.prototype.empty=function(){return!this.root||!this.root.elem},e.prototype.isHeap=function(){return this.root.isHeap(this.lessThan)},e.prototype.forEach=function(t){this.root.forEach(t)},e.prototype.pop=function(){if(this.empty())return null;var t=this.root.min();return this.root=this.root.removeMin(this.lessThan),t},e.prototype.reduceKey=function(t,e,n){void 0===n&&(n=null),this.root=this.root.decreaseKey(t,e,n,this.lessThan)},e.prototype.toString=function(t){return this.root.toString(t)},e.prototype.count=function(){return this.root.count()},e}();return Dg.PriorityQueue=e,Dg}function Bg(){if(Vg)return jg;Vg=1,Object.defineProperty(jg,"__esModule",{value:!0});var t=Hg(),e=function(){return function(t,e){this.id=t,this.distance=e}}(),n=function(){return function(t){this.id=t,this.neighbours=[]}}(),r=function(){return function(t,e,n){this.node=t,this.prev=e,this.d=n}}(),i=function(){function i(t,r,i,o,a){this.n=t,this.es=r,this.neighbours=new Array(this.n);for(var s=this.n;s--;)this.neighbours[s]=new n(s);for(s=this.es.length;s--;){var l=this.es[s],c=i(l),u=o(l),d=a(l);this.neighbours[c].neighbours.push(new e(u,d)),this.neighbours[u].neighbours.push(new e(c,d))}}return i.prototype.DistanceMatrix=function(){for(var t=new Array(this.n),e=0;e<this.n;++e)t[e]=this.dijkstraNeighbours(e);return t},i.prototype.DistancesFromNode=function(t){return this.dijkstraNeighbours(t)},i.prototype.PathFromNodeToNode=function(t,e){return this.dijkstraNeighbours(t,e)},i.prototype.PathFromNodeToNodeWithPrevCost=function(e,n,i){var o=new t.PriorityQueue((function(t,e){return t.d<=e.d})),a=this.neighbours[e],s=new r(a,null,0),l={};for(o.push(s);!o.empty()&&(a=(s=o.pop()).node).id!==n;)for(var c=a.neighbours.length;c--;){var u=a.neighbours[c],d=this.neighbours[u.id];if(!s.prev||d.id!==s.prev.node.id){var h=d.id+","+a.id;if(!(h in l&&l[h]<=s.d)){var f=s.prev?i(s.prev.node.id,a.id,d.id):0,p=s.d+u.distance+f;l[h]=p,o.push(new r(d,s,p))}}}for(var g=[];s.prev;)g.push((s=s.prev).node.id);return g},i.prototype.dijkstraNeighbours=function(e,n){void 0===n&&(n=-1);for(var r=new t.PriorityQueue((function(t,e){return t.d<=e.d})),i=this.neighbours.length,o=new Array(i);i--;){var a=this.neighbours[i];a.d=i===e?0:Number.POSITIVE_INFINITY,a.q=r.push(a)}for(;!r.empty();){var s=r.pop();if(o[s.id]=s.d,s.id===n){for(var l=[],c=s;void 0!==c.prev;)l.push(c.prev.id),c=c.prev;return l}for(i=s.neighbours.length;i--;){var u=s.neighbours[i],d=(c=this.neighbours[u.id],s.d+u.distance);s.d!==Number.MAX_VALUE&&c.d>d&&(c.d=d,c.prev=s,r.reduceKey(c.q,c,(function(t,e){return t.q=e})))}}return o},i}();return jg.Calculator=i,jg}var Fg,Ug={};function Wg(){if(Fg)return Ug;Fg=1;var t,e=Ug&&Ug.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)});Object.defineProperty(Ug,"__esModule",{value:!0});var n=Og(),r=function(){return function(){}}();Ug.Point=r;var i=function(){return function(t,e,n,r){this.x1=t,this.y1=e,this.x2=n,this.y2=r}}();Ug.LineSegment=i;var o=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n}(r);function a(t,e,n){return(e.x-t.x)*(n.y-t.y)-(n.x-t.x)*(e.y-t.y)}function s(t,e,n){return a(t,e,n)>0}function l(t,e,n){return a(t,e,n)<0}function c(t,e){var n,r,i,o,a=e.length-1;if(l(t,e[1],e[0])&&!s(t,e[a-1],e[0]))return 0;for(n=0,r=a;;){if(r-n==1)return s(t,e[n],e[r])?n:r;if((o=l(t,e[(i=Math.floor((n+r)/2))+1],e[i]))&&!s(t,e[i-1],e[i]))return i;s(t,e[n+1],e[n])?o||s(t,e[n],e[i])?r=i:n=i:o&&l(t,e[n],e[i])?r=i:n=i}}function u(t,e){var n,r,i,o,a=e.length-1;if(s(t,e[a-1],e[0])&&!l(t,e[1],e[0]))return 0;for(n=0,r=a;;){if(r-n==1)return l(t,e[n],e[r])?n:r;if(o=l(t,e[(i=Math.floor((n+r)/2))+1],e[i]),s(t,e[i-1],e[i])&&!o)return i;l(t,e[n+1],e[n])?o?l(t,e[n],e[i])?r=i:n=i:r=i:o?n=i:s(t,e[n],e[i])?r=i:n=i}}function d(t,e,n,r,i,o){var a,s;s=r(t[a=n(e[0],t)],e);for(var l=!1;!l;){for(l=!0;a===t.length-1&&(a=0),!i(e[s],t[a],t[a+1]);)++a;for(;0===s&&(s=e.length-1),!o(t[a],e[s],e[s-1]);)--s,l=!1}return{t1:a,t2:s}}function h(t,e){return d(t,e,c,u,s,l)}Ug.PolyPoint=o,Ug.isLeft=a,Ug.ConvexHull=function(t){var e,n=t.slice(0).sort((function(t,e){return t.x!==e.x?e.x-t.x:e.y-t.y})),r=t.length,i=n[0].x;for(e=1;e<r&&n[e].x===i;++e);var o=e-1,s=[];if(s.push(n[0]),o===r-1)n[o].y!==n[0].y&&s.push(n[o]);else{var l,c=r-1,u=n[r-1].x;for(e=r-2;e>=0&&n[e].x===u;e--);for(l=e+1,e=o;++e<=l;)if(!(a(n[0],n[l],n[e])>=0&&e<l)){for(;s.length>1&&!(a(s[s.length-2],s[s.length-1],n[e])>0);)s.length-=1;0!=e&&s.push(n[e])}c!=l&&s.push(n[c]);var d=s.length;for(e=l;--e>=o;)if(!(a(n[c],n[o],n[e])>=0&&e>o)){for(;s.length>d&&!(a(s[s.length-2],s[s.length-1],n[e])>0);)s.length-=1;0!=e&&s.push(n[e])}}return s},Ug.clockwiseRadialSweep=function(t,e,n){e.slice(0).sort((function(e,n){return Math.atan2(e.y-t.y,e.x-t.x)-Math.atan2(n.y-t.y,n.x-t.x)})).forEach(n)},Ug.tangent_PolyPolyC=d,Ug.LRtangent_PolyPolyC=function(t,e){var n=h(e,t);return{t1:n.t2,t2:n.t1}},Ug.RLtangent_PolyPolyC=h,Ug.LLtangent_PolyPolyC=function(t,e){return d(t,e,u,u,l,l)},Ug.RRtangent_PolyPolyC=function(t,e){return d(t,e,c,c,s,s)};var f=function(){return function(t,e){this.t1=t,this.t2=e}}();Ug.BiTangent=f;var p=function(){return function(){}}();Ug.BiTangents=p;var g=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n}(r);Ug.TVGPoint=g;var v=function(){return function(t,e,n,r){this.id=t,this.polyid=e,this.polyvertid=n,this.p=r,r.vv=this}}();Ug.VisibilityVertex=v;var m=function(){function t(t,e){this.source=t,this.target=e}return t.prototype.length=function(){var t=this.source.p.x-this.target.p.x,e=this.source.p.y-this.target.p.y;return Math.sqrt(t*t+e*e)},t}();Ug.VisibilityEdge=m;var b=function(){function t(t,e){if(this.P=t,this.V=[],this.E=[],e)this.V=e.V.slice(0),this.E=e.E.slice(0);else{for(var n=t.length,r=0;r<n;r++){for(var i=t[r],o=0;o<i.length;++o){var a=new v(this.V.length,r,o,i[o]);this.V.push(a),o>0&&this.E.push(new m(i[o-1].vv,a))}i.length>1&&this.E.push(new m(i[0].vv,i[i.length-1].vv))}for(r=0;r<n-1;r++){var s=t[r];for(o=r+1;o<n;o++){var l=t[o],c=y(s,l);for(var u in c){var d=c[u];this.addEdgeIfVisible(s[d.t1],l[d.t2],r,o)}}}}}return t.prototype.addEdgeIfVisible=function(t,e,n,r){this.intersectsPolys(new i(t.x,t.y,e.x,e.y),n,r)||this.E.push(new m(t.vv,e.vv))},t.prototype.addPoint=function(t,e){var n,r,i,o=this.P.length;this.V.push(new v(this.V.length,o,0,t));for(var a=0;a<o;++a)if(a!==e){var s=this.P[a],l=(n=t,i=void 0,(i=(r=s).slice(0)).push(r[0]),{rtan:c(n,i),ltan:u(n,i)});this.addEdgeIfVisible(t,s[l.ltan],e,a),this.addEdgeIfVisible(t,s[l.rtan],e,a)}return t.vv},t.prototype.intersectsPolys=function(t,e,n){for(var r=0,i=this.P.length;r<i;++r)if(r!=e&&r!=n&&w(t,this.P[r]).length>0)return!0;return!1},t}();function w(t,e){for(var r=[],i=1,o=e.length;i<o;++i){var a=n.Rectangle.lineIntersection(t.x1,t.y1,t.x2,t.y2,e[i-1].x,e[i-1].y,e[i].x,e[i].y);a&&r.push(a)}return r}function y(t,e){for(var n=t.length-1,r=e.length-1,i=new p,o=0;o<n;++o)for(var s=0;s<r;++s){var l=t[0==o?n-1:o-1],c=t[o],u=t[o+1],d=e[0==s?r-1:s-1],h=e[s],g=e[s+1],v=a(l,c,h),m=a(c,d,h),b=a(c,h,g),w=a(d,h,c),y=a(h,l,c),_=a(h,c,u);v>=0&&m>=0&&b<0&&w>=0&&y>=0&&_<0?i.ll=new f(o,s):v<=0&&m<=0&&b>0&&w<=0&&y<=0&&_>0?i.rr=new f(o,s):v<=0&&m>0&&b<=0&&w>=0&&y<0&&_>=0?i.rl=new f(o,s):v>=0&&m<0&&b>=0&&w<=0&&y>0&&_<=0&&(i.lr=new f(o,s))}return i}function _(t,e){return!t.every((function(t){return!function(t,e){for(var n=1,r=e.length;n<r;++n)if(l(e[n-1],e[n],t))return!1;return!0}(t,e)}))}return Ug.TangentVisibilityGraph=b,Ug.tangents=y,Ug.polysOverlap=function(t,e){if(_(t,e))return!0;if(_(e,t))return!0;for(var n=1,r=t.length;n<r;++n){var o=t[n],a=t[n-1];if(w(new i(a.x,a.y,o.x,o.y),e).length>0)return!0}return!1},Ug}var qg,Gg,Zg,Kg={};function Qg(){if(qg)return Kg;qg=1,Object.defineProperty(Kg,"__esModule",{value:!0});var t=10,e=(1+Math.sqrt(5))/2,n=1e-4;return Kg.applyPacking=function(r,i,o,a,s,l){void 0===s&&(s=1),void 0===l&&(l=!0);var c=i,u=o,d=(s=void 0!==s?s:1,a=void 0!==a?a:0,0),h=0,f=0,p=0,g=[];function v(t,e){g=[],d=0,h=0,p=0;for(var n=0;n<t.length;n++)m(t[n],e);return Math.abs(d/h-s)}function m(e,r){for(var i=void 0,o=0;o<g.length;o++)if(g[o].space_left>=e.height&&g[o].x+g[o].width+e.width+t-r<=n){i=g[o];break}g.push(e),void 0!==i?(e.x=i.x+i.width+t,e.y=i.bottom,e.space_left=e.height,e.bottom=e.y,i.space_left-=e.height+t,i.bottom+=e.height+t):(e.y=p,p+=e.height+t,e.x=0,e.bottom=e.y,e.space_left=e.height),e.y+e.height-h>-1e-4&&(h=e.y+e.height-0),e.x+e.width-d>-1e-4&&(d=e.x+e.width-0)}0!=r.length&&(r.forEach((function(t){var e,n,r,i,o;e=t,n=Number.MAX_VALUE,r=Number.MAX_VALUE,i=0,o=0,e.array.forEach((function(t){var e=void 0!==t.width?t.width:a,s=void 0!==t.height?t.height:a;e/=2,s/=2,i=Math.max(t.x+e,i),n=Math.min(t.x-e,n),o=Math.max(t.y+s,o),r=Math.min(t.y-s,r)})),e.width=i-n,e.height=o-r})),function(r){var i=Number.POSITIVE_INFINITY,o=0;r.sort((function(t,e){return e.height-t.height}));for(var a=g=f=r.reduce((function(t,e){return t.width<e.width?t.width:e.width})),s=m=function(e){var n=0;return e.forEach((function(e){return n+=e.width+t})),n}(r),l=0,c=Number.MAX_VALUE,u=Number.MAX_VALUE,d=-1,h=Number.MAX_VALUE,p=Number.MAX_VALUE;h>f||p>n;){if(1!=d){var g=s-(s-a)/e;c=v(r,g)}if(0!=d){var m=a+(s-a)/e;u=v(r,m)}if(h=Math.abs(g-m),p=Math.abs(c-u),c<i&&(i=c,o=g),u<i&&(i=u,o=m),c>u?(a=g,g=m,c=u,d=1):(s=m,m=g,u=c,d=0),l++>100)break}v(r,o)}(r),l&&r.forEach((function(t){var e={x:0,y:0};t.array.forEach((function(t){e.x+=t.x,e.y+=t.y})),e.x/=t.array.length,e.y/=t.array.length;var n=t.x-(e.x-t.width/2)+c/2-d/2,r=t.y-(e.y-t.height/2)+u/2-h/2;t.array.forEach((function(t){t.x+=n,t.y+=r}))})))},Kg.separateGraphs=function(t,e){for(var n={},r={},i=[],o=0,a=0;a<e.length;a++){var s=e[a],l=s.source,c=s.target;r[l.index]?r[l.index].push(c):r[l.index]=[c],r[c.index]?r[c.index].push(l):r[c.index]=[l]}for(a=0;a<t.length;a++){var u=t[a];n[u.index]||d(u,!0)}function d(t,e){if(void 0===n[t.index]){e&&(o++,i.push({array:[]})),n[t.index]=o,i[o-1].array.push(t);var a=r[t.index];if(a)for(var s=0;s<a.length;s++)d(a[s],!1)}}return i},Kg}function Xg(){return Gg||(Gg=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});var e,n,r=_g(),i=Sg(),o=Mg(),a=Og(),s=Bg(),l=Wg(),c=Qg();function u(t){return void 0!==t.leaves||void 0!==t.groups}(n=e=t.EventType||(t.EventType={}))[n.start=0]="start",n[n.tick=1]="tick",n[n.end=2]="end";var d=function(){function t(){var e=this;this._canvasSize=[1,1],this._linkDistance=20,this._defaultNodeSize=10,this._linkLengthCalculator=null,this._linkType=null,this._avoidOverlaps=!1,this._handleDisconnected=!0,this._running=!1,this._nodes=[],this._groups=[],this._rootGroup=null,this._links=[],this._constraints=[],this._distanceMatrix=null,this._descent=null,this._directedLinkConstraints=null,this._threshold=.01,this._visibilityGraph=null,this._groupCompactness=1e-6,this.event=null,this.linkAccessor={getSourceIndex:t.getSourceIndex,getTargetIndex:t.getTargetIndex,setLength:t.setLinkLength,getType:function(t){return"function"==typeof e._linkType?e._linkType(t):0}}}return t.prototype.on=function(t,n){return this.event||(this.event={}),"string"==typeof t?this.event[e[t]]=n:this.event[t]=n,this},t.prototype.trigger=function(t){this.event&&void 0!==this.event[t.type]&&this.event[t.type](t)},t.prototype.kick=function(){for(;!this.tick(););},t.prototype.tick=function(){if(this._alpha<this._threshold)return this._running=!1,this.trigger({type:e.end,alpha:this._alpha=0,stress:this._lastStress}),!0;var t,n,r=this._nodes.length;for(this._descent.locks.clear(),n=0;n<r;++n)(t=this._nodes[n]).fixed&&(void 0!==t.px&&void 0!==t.py||(t.px=t.x,t.py=t.y),this._descent.locks.add(n,[t.px,t.py]));var i=this._descent.rungeKutta();return 0===i?this._alpha=0:void 0!==this._lastStress&&(this._alpha=i),this._lastStress=i,this.updateNodePositions(),this.trigger({type:e.tick,alpha:this._alpha,stress:this._lastStress}),!1},t.prototype.updateNodePositions=function(){for(var t,e=this._descent.x[0],n=this._descent.x[1],r=this._nodes.length;r--;)(t=this._nodes[r]).x=e[r],t.y=n[r]},t.prototype.nodes=function(t){if(!t){if(0===this._nodes.length&&this._links.length>0){var e=0;this._links.forEach((function(t){e=Math.max(e,t.source,t.target)})),this._nodes=new Array(++e);for(var n=0;n<e;++n)this._nodes[n]={}}return this._nodes}return this._nodes=t,this},t.prototype.groups=function(t){var e=this;return t?(this._groups=t,this._rootGroup={},this._groups.forEach((function(t){void 0===t.padding&&(t.padding=1),void 0!==t.leaves&&t.leaves.forEach((function(n,r){"number"==typeof n&&((t.leaves[r]=e._nodes[n]).parent=t)})),void 0!==t.groups&&t.groups.forEach((function(n,r){"number"==typeof n&&((t.groups[r]=e._groups[n]).parent=t)}))})),this._rootGroup.leaves=this._nodes.filter((function(t){return void 0===t.parent})),this._rootGroup.groups=this._groups.filter((function(t){return void 0===t.parent})),this):this._groups},t.prototype.powerGraphGroups=function(t){var e=r.getGroups(this._nodes,this._links,this.linkAccessor,this._rootGroup);return this.groups(e.groups),t(e),this},t.prototype.avoidOverlaps=function(t){return arguments.length?(this._avoidOverlaps=t,this):this._avoidOverlaps},t.prototype.handleDisconnected=function(t){return arguments.length?(this._handleDisconnected=t,this):this._handleDisconnected},t.prototype.flowLayout=function(t,e){return arguments.length||(t="y"),this._directedLinkConstraints={axis:t,getMinSeparation:"number"==typeof e?function(){return e}:e},this},t.prototype.links=function(t){return arguments.length?(this._links=t,this):this._links},t.prototype.constraints=function(t){return arguments.length?(this._constraints=t,this):this._constraints},t.prototype.distanceMatrix=function(t){return arguments.length?(this._distanceMatrix=t,this):this._distanceMatrix},t.prototype.size=function(t){return t?(this._canvasSize=t,this):this._canvasSize},t.prototype.defaultNodeSize=function(t){return t?(this._defaultNodeSize=t,this):this._defaultNodeSize},t.prototype.groupCompactness=function(t){return t?(this._groupCompactness=t,this):this._groupCompactness},t.prototype.linkDistance=function(t){return t?(this._linkDistance="function"==typeof t?t:+t,this._linkLengthCalculator=null,this):this._linkDistance},t.prototype.linkType=function(t){return this._linkType=t,this},t.prototype.convergenceThreshold=function(t){return t?(this._threshold="function"==typeof t?t:+t,this):this._threshold},t.prototype.alpha=function(t){return arguments.length?(t=+t,this._alpha?this._alpha=t>0?t:0:t>0&&(this._running||(this._running=!0,this.trigger({type:e.start,alpha:this._alpha=t}),this.kick())),this):this._alpha},t.prototype.getLinkLength=function(t){return"function"==typeof this._linkDistance?+this._linkDistance(t):this._linkDistance},t.setLinkLength=function(t,e){t.length=e},t.prototype.getLinkType=function(t){return"function"==typeof this._linkType?this._linkType(t):0},t.prototype.symmetricDiffLinkLengths=function(t,e){var n=this;return void 0===e&&(e=1),this.linkDistance((function(e){return t*e.length})),this._linkLengthCalculator=function(){return i.symmetricDiffLinkLengths(n._links,n.linkAccessor,e)},this},t.prototype.jaccardLinkLengths=function(t,e){var n=this;return void 0===e&&(e=1),this.linkDistance((function(e){return t*e.length})),this._linkLengthCalculator=function(){return i.jaccardLinkLengths(n._links,n.linkAccessor,e)},this},t.prototype.start=function(e,n,r,l,c,u){var d=this;void 0===e&&(e=0),void 0===n&&(n=0),void 0===r&&(r=0),void 0===l&&(l=0),void 0===c&&(c=!0),void 0===u&&(u=!0);var h,f=this.nodes().length,p=f+2*this._groups.length,g=this._canvasSize[0],v=this._canvasSize[1],m=new Array(p),b=new Array(p),w=null,y=this._avoidOverlaps;this._nodes.forEach((function(t,e){t.index=e,void 0===t.x&&(t.x=g/2,t.y=v/2),m[e]=t.x,b[e]=t.y})),this._linkLengthCalculator&&this._linkLengthCalculator(),this._distanceMatrix?h=this._distanceMatrix:(h=new s.Calculator(p,this._links,t.getSourceIndex,t.getTargetIndex,(function(t){return d.getLinkLength(t)})).DistanceMatrix(),w=o.Descent.createSquareMatrix(p,(function(){return 2})),this._links.forEach((function(t){"number"==typeof t.source&&(t.source=d._nodes[t.source]),"number"==typeof t.target&&(t.target=d._nodes[t.target])})),this._links.forEach((function(e){var n=t.getSourceIndex(e),r=t.getTargetIndex(e);w[n][r]=w[r][n]=e.weight||1})));var _=o.Descent.createSquareMatrix(p,(function(t,e){return h[t][e]}));if(this._rootGroup&&void 0!==this._rootGroup.groups){var k=f;this._groups.forEach((function(){var t,e;w[t=k][e=k+1]=w[e][t]=d._groupCompactness,_[t][e]=_[e][t]=.1,m[k]=0,b[k++]=0,m[k]=0,b[k++]=0}))}else this._rootGroup={leaves:this._nodes,groups:[]};var x=this._constraints||[];for(this._directedLinkConstraints&&(this.linkAccessor.getMinSeparation=this._directedLinkConstraints.getMinSeparation,x=x.concat(i.generateDirectedEdgeConstraints(f,this._links,this._directedLinkConstraints.axis,this.linkAccessor))),this.avoidOverlaps(!1),this._descent=new o.Descent([m,b],_),this._descent.locks.clear(),k=0;k<f;++k){var S=this._nodes[k];S.fixed&&(S.px=S.x,S.py=S.y,this._descent.locks.add(k,[S.x,S.y]))}if(this._descent.threshold=this._threshold,this.initialLayout(e,m,b),x.length>0&&(this._descent.project=new a.Projection(this._nodes,this._groups,this._rootGroup,x).projectFunctions()),this._descent.run(n),this.separateOverlappingComponents(g,v,u),this.avoidOverlaps(y),y&&(this._nodes.forEach((function(t,e){t.x=m[e],t.y=b[e]})),this._descent.project=new a.Projection(this._nodes,this._groups,this._rootGroup,x,!0).projectFunctions(),this._nodes.forEach((function(t,e){m[e]=t.x,b[e]=t.y}))),this._descent.G=w,this._descent.run(r),l){this._descent.snapStrength=1e3,this._descent.snapGridSize=this._nodes[0].width,this._descent.numGridSnapNodes=f,this._descent.scaleSnapByMaxH=f!=p;var E=o.Descent.createSquareMatrix(p,(function(t,e){return t>=f||e>=f?w[t][e]:0}));this._descent.G=E,this._descent.run(l)}return this.updateNodePositions(),this.separateOverlappingComponents(g,v,u),c?this.resume():this},t.prototype.initialLayout=function(e,n,r){if(this._groups.length>0&&e>0){var i=this._nodes.length,o=this._links.map((function(t){return{source:t.source.index,target:t.target.index}})),a=this._nodes.map((function(t){return{index:t.index}}));this._groups.forEach((function(t,e){a.push({index:t.index=i+e})})),this._groups.forEach((function(t){void 0!==t.leaves&&t.leaves.forEach((function(e){return o.push({source:t.index,target:e.index})})),void 0!==t.groups&&t.groups.forEach((function(e){return o.push({source:t.index,target:e.index})}))})),(new t).size(this.size()).nodes(a).links(o).avoidOverlaps(!1).linkDistance(this.linkDistance()).symmetricDiffLinkLengths(5).convergenceThreshold(1e-4).start(e,0,0,0,!1),this._nodes.forEach((function(t){n[t.index]=a[t.index].x,r[t.index]=a[t.index].y}))}else this._descent.run(e)},t.prototype.separateOverlappingComponents=function(t,e,n){var r=this;if(void 0===n&&(n=!0),!this._distanceMatrix&&this._handleDisconnected){var i=this._descent.x[0],o=this._descent.x[1];this._nodes.forEach((function(t,e){t.x=i[e],t.y=o[e]}));var a=c.separateGraphs(this._nodes,this._links);c.applyPacking(a,t,e,this._defaultNodeSize,1,n),this._nodes.forEach((function(t,e){r._descent.x[0][e]=t.x,r._descent.x[1][e]=t.y,t.bounds&&(t.bounds.setXCentre(t.x),t.bounds.setYCentre(t.y))}))}},t.prototype.resume=function(){return this.alpha(.1)},t.prototype.stop=function(){return this.alpha(0)},t.prototype.prepareEdgeRouting=function(t){void 0===t&&(t=0),this._visibilityGraph=new l.TangentVisibilityGraph(this._nodes.map((function(e){return e.bounds.inflate(-t).vertices()})))},t.prototype.routeEdge=function(t,e,n){void 0===e&&(e=5);var r=[],i=new l.TangentVisibilityGraph(this._visibilityGraph.P,{V:this._visibilityGraph.V,E:this._visibilityGraph.E}),o={x:t.source.x,y:t.source.y},c={x:t.target.x,y:t.target.y},u=i.addPoint(o,t.source.index),d=i.addPoint(c,t.target.index);i.addEdgeIfVisible(o,c,t.source.index,t.target.index),void 0!==n&&n(i);var h=new s.Calculator(i.V.length,i.E,(function(t){return t.source.id}),(function(t){return t.target.id}),(function(t){return t.length()})).PathFromNodeToNode(u.id,d.id);if(1===h.length||h.length===i.V.length){var f=a.makeEdgeBetween(t.source.innerBounds,t.target.innerBounds,e);r=[f.sourceIntersection,f.arrowStart]}else{for(var p=h.length-2,g=i.V[h[p]].p,v=i.V[h[0]].p,m=(r=[t.source.innerBounds.rayIntersection(g.x,g.y)],p);m>=0;--m)r.push(i.V[h[m]].p);r.push(a.makeEdgeTo(v,t.target.innerBounds,e))}return r},t.getSourceIndex=function(t){return"number"==typeof t.source?t.source:t.source.index},t.getTargetIndex=function(t){return"number"==typeof t.target?t.target:t.target.index},t.linkId=function(e){return t.getSourceIndex(e)+"-"+t.getTargetIndex(e)},t.dragStart=function(e){u(e)?t.storeOffset(e,t.dragOrigin(e)):(t.stopNode(e),e.fixed|=2)},t.stopNode=function(t){t.px=t.x,t.py=t.y},t.storeOffset=function(e,n){void 0!==e.leaves&&e.leaves.forEach((function(e){e.fixed|=2,t.stopNode(e),e._dragGroupOffsetX=e.x-n.x,e._dragGroupOffsetY=e.y-n.y})),void 0!==e.groups&&e.groups.forEach((function(e){return t.storeOffset(e,n)}))},t.dragOrigin=function(t){return u(t)?{x:t.bounds.cx(),y:t.bounds.cy()}:t},t.drag=function(e,n){u(e)?(void 0!==e.leaves&&e.leaves.forEach((function(t){e.bounds.setXCentre(n.x),e.bounds.setYCentre(n.y),t.px=t._dragGroupOffsetX+n.x,t.py=t._dragGroupOffsetY+n.y})),void 0!==e.groups&&e.groups.forEach((function(e){return t.drag(e,n)}))):(e.px=n.x,e.py=n.y)},t.dragEnd=function(e){u(e)?(void 0!==e.leaves&&e.leaves.forEach((function(e){t.dragEnd(e),delete e._dragGroupOffsetX,delete e._dragGroupOffsetY})),void 0!==e.groups&&e.groups.forEach(t.dragEnd)):e.fixed&=-7},t.mouseOver=function(t){t.fixed|=4,t.px=t.x,t.py=t.y},t.mouseOut=function(t){t.fixed&=-5},t}();t.Layout=d}(wg)),wg}var Yg,Jg,tv,ev={},nv={},rv={};var iv,ov={};function av(){if(iv)return ov;iv=1,Object.defineProperty(ov,"__esModule",{value:!0});var t=Og(),e=Tg(),n=Bg(),r=function(){return function(t,e,n){this.id=t,this.rect=e,this.children=n,this.leaf=void 0===n||0===n.length}}();ov.NodeWrapper=r;var i=function(){return function(t,e,n,r,i){void 0===r&&(r=null),void 0===i&&(i=null),this.id=t,this.x=e,this.y=n,this.node=r,this.line=i}}();ov.Vert=i;var o=function(){function t(e,n){this.s=e,this.t=n;var r=t.findMatch(e,n),i=n.slice(0).reverse(),o=t.findMatch(e,i);r.length>=o.length?(this.length=r.length,this.si=r.si,this.ti=r.ti,this.reversed=!1):(this.length=o.length,this.si=o.si,this.ti=n.length-o.ti-o.length,this.reversed=!0)}return t.findMatch=function(t,e){for(var n=t.length,r=e.length,i={length:0,si:-1,ti:-1},o=new Array(n),a=0;a<n;a++){o[a]=new Array(r);for(var s=0;s<r;s++)if(t[a]===e[s]){var l=o[a][s]=0===a||0===s?1:o[a-1][s-1]+1;l>i.length&&(i.length=l,i.si=a-l+1,i.ti=s-l+1)}else o[a][s]=0}return i},t.prototype.getSequence=function(){return this.length>=0?this.s.slice(this.si,this.si+this.length):[]},t}();ov.LongestCommonSubsequence=o;var a=function(){function a(e,n,o){void 0===o&&(o=12);var a=this;this.originalnodes=e,this.groupPadding=o,this.leaves=null,this.nodes=e.map((function(t,e){return new r(e,n.getBounds(t),n.getChildren(t))})),this.leaves=this.nodes.filter((function(t){return t.leaf})),this.groups=this.nodes.filter((function(t){return!t.leaf})),this.cols=this.getGridLines("x"),this.rows=this.getGridLines("y"),this.groups.forEach((function(t){return t.children.forEach((function(e){return a.nodes[e].parent=t}))})),this.root={children:[]},this.nodes.forEach((function(t){void 0===t.parent&&(t.parent=a.root,a.root.children.push(t.id)),t.ports=[]})),this.backToFront=this.nodes.slice(0),this.backToFront.sort((function(t,e){return a.getDepth(t)-a.getDepth(e)})),this.backToFront.slice(0).reverse().filter((function(t){return!t.leaf})).forEach((function(e){var n=t.Rectangle.empty();e.children.forEach((function(t){return n=n.union(a.nodes[t].rect)})),e.rect=n.inflate(a.groupPadding)}));var s=this.midPoints(this.cols.map((function(t){return t.pos}))),l=this.midPoints(this.rows.map((function(t){return t.pos}))),c=s[0],u=s[s.length-1],d=l[0],h=l[l.length-1],f=this.rows.map((function(t){return{x1:c,x2:u,y1:t.pos,y2:t.pos}})).concat(l.map((function(t){return{x1:c,x2:u,y1:t,y2:t}}))),p=this.cols.map((function(t){return{x1:t.pos,x2:t.pos,y1:d,y2:h}})).concat(s.map((function(t){return{x1:t,x2:t,y1:d,y2:h}}))),g=f.concat(p);g.forEach((function(t){return t.verts=[]})),this.verts=[],this.edges=[],f.forEach((function(t){return p.forEach((function(e){var n=new i(a.verts.length,e.x1,t.y1);t.verts.push(n),e.verts.push(n),a.verts.push(n);for(var r=a.backToFront.length;r-- >0;){var o=a.backToFront[r],s=o.rect,l=Math.abs(n.x-s.cx()),c=Math.abs(n.y-s.cy());if(l<s.width()/2&&c<s.height()/2){n.node=o;break}}}))})),g.forEach((function(t){a.nodes.forEach((function(e){e.rect.lineIntersections(t.x1,t.y1,t.x2,t.y2).forEach((function(n){var r=new i(a.verts.length,n.x,n.y,e,t);a.verts.push(r),t.verts.push(r),e.ports.push(r)}))}));var e=Math.abs(t.y1-t.y2)<.1,n=function(t,n){return e?n.x-t.x:n.y-t.y};t.verts.sort(n);for(var r=1;r<t.verts.length;r++){var o=t.verts[r-1],s=t.verts[r];o.node&&o.node===s.node&&o.node.leaf||a.edges.push({source:o.id,target:s.id,length:Math.abs(n(o,s))})}}))}return a.prototype.avg=function(t){return t.reduce((function(t,e){return t+e}))/t.length},a.prototype.getGridLines=function(t){for(var e=[],n=this.leaves.slice(0,this.leaves.length);n.length>0;){var r=n.filter((function(e){return e.rect["overlap"+t.toUpperCase()](n[0].rect)})),i={nodes:r,pos:this.avg(r.map((function(e){return e.rect["c"+t]()})))};e.push(i),i.nodes.forEach((function(t){return n.splice(n.indexOf(t),1)}))}return e.sort((function(t,e){return t.pos-e.pos})),e},a.prototype.getDepth=function(t){for(var e=0;t.parent!==this.root;)e++,t=t.parent;return e},a.prototype.midPoints=function(t){for(var e=t[1]-t[0],n=[t[0]-e/2],r=1;r<t.length;r++)n.push((t[r]+t[r-1])/2);return n.push(t[t.length-1]+e/2),n},a.prototype.findLineage=function(t){var e=[t];do{e.push(t=t.parent)}while(t!==this.root);return e.reverse()},a.prototype.findAncestorPathBetween=function(t,e){for(var n=this.findLineage(t),r=this.findLineage(e),i=0;n[i]===r[i];)i++;return{commonAncestor:n[i-1],lineages:n.slice(i).concat(r.slice(i))}},a.prototype.siblingObstacles=function(t,e){var n=this,r=this.findAncestorPathBetween(t,e),i={};r.lineages.forEach((function(t){return i[t.id]={}}));var o=r.commonAncestor.children.filter((function(t){return!(t in i)}));return r.lineages.filter((function(t){return t.parent!==r.commonAncestor})).forEach((function(t){return o=o.concat(t.parent.children.filter((function(e){return e!==t.id})))})),o.map((function(t){return n.nodes[t]}))},a.getSegmentSets=function(t,e){for(var n=[],r=0;r<t.length;r++)for(var i=t[r],o=0;o<i.length;o++)(c=i[o]).edgeid=r,c.i=o,Math.abs(c[1][e]-c[0][e])<.1&&n.push(c);n.sort((function(t,n){return t[0][e]-n[0][e]}));for(var a=[],s=null,l=0;l<n.length;l++){var c=n[l];(!s||Math.abs(c[0][e]-s.pos)>.1)&&a.push(s={pos:c[0][e],segments:[]}),s.segments.push(c)}return a},a.nudgeSegs=function(t,n,r,i,o,a){var s=i.length;if(!(s<=1)){for(var l=i.map((function(n){return new e.Variable(n[0][t])})),c=[],u=0;u<s;u++)for(var d=0;d<s;d++)if(u!==d){var h=i[u],f=h.edgeid,p=i[d].edgeid,g=-1,v=-1;"x"==t?o(f,p)&&(h[0][n]<h[1][n]?(g=d,v=u):(g=u,v=d)):o(f,p)&&(h[0][n]<h[1][n]?(g=u,v=d):(g=d,v=u)),g>=0&&c.push(new e.Constraint(l[g],l[v],a))}new e.Solver(l,c).solve(),l.forEach((function(e,n){var o=i[n],a=e.position();o[0][t]=o[1][t]=a;var s=r[o.edgeid];o.i>0&&(s[o.i-1][1][t]=a),o.i<s.length-1&&(s[o.i+1][0][t]=a)}))}},a.nudgeSegments=function(t,e,n,r,i){for(var o=a.getSegmentSets(t,e,n),s=0;s<o.length;s++){for(var l=o[s],c=[],u=0;u<l.segments.length;u++){var d=l.segments[u];c.push({type:0,s:d,pos:Math.min(d[0][n],d[1][n])}),c.push({type:1,s:d,pos:Math.max(d[0][n],d[1][n])})}c.sort((function(t,e){return t.pos-e.pos+t.type-e.type}));var h=[],f=0;c.forEach((function(o){0===o.type?(h.push(o.s),f++):f--,0==f&&(a.nudgeSegs(e,n,t,h,r,i),h=[])}))}},a.prototype.routeEdges=function(t,e,n,r){var i=this,o=t.map((function(t){return i.route(n(t),r(t))})),s=a.orderEdges(o),l=o.map((function(t){return a.makeSegments(t)}));return a.nudgeSegments(l,"x","y",s,e),a.nudgeSegments(l,"y","x",s,e),a.unreverseEdges(l,o),l},a.unreverseEdges=function(t,e){t.forEach((function(t,n){e[n].reversed&&(t.reverse(),t.forEach((function(t){t.reverse()})))}))},a.angleBetween2Lines=function(t,e){var n=Math.atan2(t[0].y-t[1].y,t[0].x-t[1].x),r=Math.atan2(e[0].y-e[1].y,e[0].x-e[1].x),i=n-r;return(i>Math.PI||i<-Math.PI)&&(i=r-n),i},a.isLeft=function(t,e,n){return(e.x-t.x)*(n.y-t.y)-(e.y-t.y)*(n.x-t.x)<=0},a.getOrder=function(t){for(var e={},n=0;n<t.length;n++){var r=t[n];void 0===e[r.l]&&(e[r.l]={}),e[r.l][r.r]=!0}return function(t,n){return void 0!==e[t]&&e[t][n]}},a.orderEdges=function(t){for(var e=[],n=0;n<t.length-1;n++)for(var r=n+1;r<t.length;r++){var i,s,l,c=t[n],u=t[r],d=new o(c,u);0!==d.length&&(d.reversed&&(u.reverse(),u.reversed=!0,d=new o(c,u)),(d.si<=0||d.ti<=0)&&(d.si+d.length>=c.length||d.ti+d.length>=u.length)?e.push({l:n,r}):(d.si+d.length>=c.length||d.ti+d.length>=u.length?(i=c[d.si+1],l=c[d.si-1],s=u[d.ti-1]):(i=c[d.si+d.length-2],s=c[d.si+d.length],l=u[d.ti+d.length]),a.isLeft(i,s,l)?e.push({l:r,r:n}):e.push({l:n,r})))}return a.getOrder(e)},a.makeSegments=function(t){function e(t){return{x:t.x,y:t.y}}for(var n,r,i,o=[],a=e(t[0]),s=1;s<t.length;s++){var l=e(t[s]),c=s<t.length-1?t[s+1]:null;c&&(n=a,r=l,i=c,Math.abs((r.x-n.x)*(i.y-n.y)-(r.y-n.y)*(i.x-n.x))<.001)||(o.push([a,l]),a=l)}return o},a.prototype.route=function(t,e){var r=this,i=this.nodes[t],o=this.nodes[e];this.obstacles=this.siblingObstacles(i,o);var a={};this.obstacles.forEach((function(t){return a[t.id]=t})),this.passableEdges=this.edges.filter((function(t){var e=r.verts[t.source],n=r.verts[t.target];return!(e.node&&e.node.id in a||n.node&&n.node.id in a)}));for(var s=1;s<i.ports.length;s++)this.passableEdges.push({source:i.ports[0].id,target:i.ports[s].id,length:0});for(s=1;s<o.ports.length;s++)this.passableEdges.push({source:o.ports[0].id,target:o.ports[s].id,length:0});var l=new n.Calculator(this.verts.length,this.passableEdges,(function(t){return t.source}),(function(t){return t.target}),(function(t){return t.length})).PathFromNodeToNodeWithPrevCost(i.ports[0].id,o.ports[0].id,(function(t,e,n){var a=r.verts[t],s=r.verts[e],l=r.verts[n],c=Math.abs(l.x-a.x),u=Math.abs(l.y-a.y);return a.node===i&&a.node===s.node||s.node===o&&s.node===l.node?0:c>1&&u>1?1e3:0})).reverse().map((function(t){return r.verts[t]}));return l.push(this.nodes[o.id].ports[0]),l.filter((function(t,e){return!(e<l.length-1&&l[e+1].node===i&&t.node===i||e>0&&t.node===o&&l[e-1].node===o)}))},a.getRoutePath=function(t,e,n,r){var i,o,s,l,c,u={routepath:"M "+t[0][0].x+" "+t[0][0].y+" ",arrowpath:""};if(t.length>1)for(var d=0;d<t.length;d++){var h=(o=(i=t[d])[1].x)-i[0].x,f=(s=i[1].y)-i[0].y;if(d<t.length-1){Math.abs(h)>0?o-=h/Math.abs(h)*e:s-=f/Math.abs(f)*e,u.routepath+="L "+o+" "+s+" ";var p=t[d+1],g=p[0].x,v=p[0].y;h=p[1].x-g,f=p[1].y-v;var m,b,w=a.angleBetween2Lines(i,p)<0?1:0;Math.abs(h)>0?(m=g+h/Math.abs(h)*e,b=v):(m=g,b=v+f/Math.abs(f)*e);var y=Math.abs(m-o),_=Math.abs(b-s);u.routepath+="A "+y+" "+_+" 0 0 "+w+" "+m+" "+b+" "}else{var k=[o,s];Math.abs(h)>0?(l=[o-=h/Math.abs(h)*r,s+n],c=[o,s-n]):(l=[o+n,s-=f/Math.abs(f)*r],c=[o-n,s]),u.routepath+="L "+o+" "+s+" ",r>0&&(u.arrowpath="M "+k[0]+" "+k[1]+" L "+l[0]+" "+l[1]+" L "+c[0]+" "+c[1])}}else h=(o=(i=t[0])[1].x)-i[0].x,f=(s=i[1].y)-i[0].y,k=[o,s],Math.abs(h)>0?(l=[o-=h/Math.abs(h)*r,s+n],c=[o,s-n]):(l=[o+n,s-=f/Math.abs(f)*r],c=[o-n,s]),u.routepath+="L "+o+" "+s+" ",r>0&&(u.arrowpath="M "+k[0]+" "+k[1]+" L "+l[0]+" "+l[1]+" L "+c[0]+" "+c[1]);return u},a}();return ov.GridRouter=a,ov}var sv,lv,cv,uv={},dv={};var hv=(cv||(cv=1,function(t){function e(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}Object.defineProperty(t,"__esModule",{value:!0}),e(function(){if(Zg)return bg;Zg=1;var t,e=bg&&bg.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)});Object.defineProperty(bg,"__esModule",{value:!0});var n=Xg(),r=function(t){function r(e){var r=t.call(this)||this,i=e;return i.trigger&&(r.trigger=i.trigger),i.kick&&(r.kick=i.kick),i.drag&&(r.drag=i.drag),i.on&&(r.on=i.on),r.dragstart=r.dragStart=n.Layout.dragStart,r.dragend=r.dragEnd=n.Layout.dragEnd,r}return e(r,t),r.prototype.trigger=function(){},r.prototype.kick=function(){},r.prototype.drag=function(){},r.prototype.on=function(){return this},r}(n.Layout);return bg.LayoutAdaptor=r,bg.adaptor=function(t){return new r(t)},bg}()),e(function(){if(tv)return ev;tv=1,Object.defineProperty(ev,"__esModule",{value:!0});var t=function(){if(Yg)return nv;Yg=1;var t,e=nv&&nv.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)});Object.defineProperty(nv,"__esModule",{value:!0});var n=Xg(),r=function(t){function r(){var e=t.call(this)||this;e.event=d3.dispatch(n.EventType[n.EventType.start],n.EventType[n.EventType.tick],n.EventType[n.EventType.end]);var r=e;return e.drag=function(){if(!t)var t=d3.behavior.drag().origin(n.Layout.dragOrigin).on("dragstart.d3adaptor",n.Layout.dragStart).on("drag.d3adaptor",(function(t){n.Layout.drag(t,d3.event),r.resume()})).on("dragend.d3adaptor",n.Layout.dragEnd);if(!arguments.length)return t;this.call(t)},e}return e(r,t),r.prototype.trigger=function(t){var e={type:n.EventType[t.type],alpha:t.alpha,stress:t.stress};this.event[e.type](e)},r.prototype.kick=function(){var e=this;d3.timer((function(){return t.prototype.tick.call(e)}))},r.prototype.on=function(t,e){return this.event.on("string"==typeof t?t:n.EventType[t],e),this},r}(n.Layout);return nv.D3StyleLayoutAdaptor=r,nv.d3adaptor=function(){return new r},nv}(),e=function(){if(Jg)return rv;Jg=1;var t,e=rv&&rv.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)});Object.defineProperty(rv,"__esModule",{value:!0});var n=Xg(),r=function(t){function r(e){var r=t.call(this)||this;r.d3Context=e,r.event=e.dispatch(n.EventType[n.EventType.start],n.EventType[n.EventType.tick],n.EventType[n.EventType.end]);var i=r;return r.drag=function(){if(!t)var t=e.drag().subject(n.Layout.dragOrigin).on("start.d3adaptor",n.Layout.dragStart).on("drag.d3adaptor",(function(t){n.Layout.drag(t,e.event),i.resume()})).on("end.d3adaptor",n.Layout.dragEnd);if(!arguments.length)return t;arguments[0].call(t)},r}return e(r,t),r.prototype.trigger=function(t){var e={type:n.EventType[t.type],alpha:t.alpha,stress:t.stress};this.event.call(e.type,e)},r.prototype.kick=function(){var e=this,n=this.d3Context.timer((function(){return t.prototype.tick.call(e)&&n.stop()}))},r.prototype.on=function(t,e){return this.event.on("string"==typeof t?t:n.EventType[t],e),this},r}(n.Layout);return rv.D3StyleLayoutAdaptor=r,rv}();return ev.d3adaptor=function(n){return!n||function(t){return t.version&&null!==t.version.match(/^3\./)}(n)?new t.D3StyleLayoutAdaptor:new e.D3StyleLayoutAdaptor(n)},ev}()),e(Mg()),e(Wg()),e(av()),e(Qg()),e(Xg()),e(function(){if(sv)return uv;sv=1,Object.defineProperty(uv,"__esModule",{value:!0});var t=Bg(),e=Mg(),n=Og(),r=Sg(),i=function(){function t(t,e){this.source=t,this.target=e}return t.prototype.actualLength=function(t){var e=this;return Math.sqrt(t.reduce((function(t,n){var r=n[e.target]-n[e.source];return t+r*r}),0))},t}();uv.Link3D=i,uv.Node3D=function(){return function(t,e,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===n&&(n=0),this.x=t,this.y=e,this.z=n}}();var o=function(){function i(t,e,n){void 0===n&&(n=1);var r=this;this.nodes=t,this.links=e,this.idealLinkLength=n,this.constraints=null,this.useJaccardLinkLengths=!0,this.result=new Array(i.k);for(var o=0;o<i.k;++o)this.result[o]=new Array(t.length);t.forEach((function(t,e){for(var n=0,o=i.dims;n<o.length;n++){var a=o[n];void 0===t[a]&&(t[a]=Math.random())}r.result[0][e]=t.x,r.result[1][e]=t.y,r.result[2][e]=t.z}))}return i.prototype.linkLength=function(t){return t.actualLength(this.result)},i.prototype.start=function(i){var o=this;void 0===i&&(i=100);var s=this.nodes.length,l=new a;this.useJaccardLinkLengths&&r.jaccardLinkLengths(this.links,l,1.5),this.links.forEach((function(t){return t.length*=o.idealLinkLength}));var c=new t.Calculator(s,this.links,(function(t){return t.source}),(function(t){return t.target}),(function(t){return t.length})).DistanceMatrix(),u=e.Descent.createSquareMatrix(s,(function(t,e){return c[t][e]})),d=e.Descent.createSquareMatrix(s,(function(){return 2}));this.links.forEach((function(t){var e=t.source,n=t.target;return d[e][n]=d[n][e]=1})),this.descent=new e.Descent(this.result,u),this.descent.threshold=.001,this.descent.G=d,this.constraints&&(this.descent.project=new n.Projection(this.nodes,null,null,this.constraints).projectFunctions());for(var h=0;h<this.nodes.length;h++){var f=this.nodes[h];f.fixed&&this.descent.locks.add(h,[f.x,f.y,f.z])}return this.descent.run(i),this},i.prototype.tick=function(){this.descent.locks.clear();for(var t=0;t<this.nodes.length;t++){var e=this.nodes[t];e.fixed&&this.descent.locks.add(t,[e.x,e.y,e.z])}return this.descent.rungeKutta()},i.k=(i.dims=["x","y","z"]).length,i}();uv.Layout3D=o;var a=function(){function t(){}return t.prototype.getSourceIndex=function(t){return t.source},t.prototype.getTargetIndex=function(t){return t.target},t.prototype.getLength=function(t){return t.length},t.prototype.setLength=function(t,e){t.length=e},t}();return uv}()),e(Sg()),e(_g()),e(Hg()),e(Rg()),e(Og()),e(Bg()),e(Tg()),e(function(){if(lv)return dv;lv=1,Object.defineProperty(dv,"__esModule",{value:!0});var t=Xg(),e=av();return dv.gridify=function(t,n,r,i){t.cola.start(0,0,0,10,!1);var o=function(t,n,r,i){t.forEach((function(t){t.routerNode={name:t.name,bounds:t.bounds.inflate(-r)}})),n.forEach((function(e){e.routerNode={bounds:e.bounds.inflate(-i),children:(void 0!==e.groups?e.groups.map((function(e){return t.length+e.id})):[]).concat(void 0!==e.leaves?e.leaves.map((function(t){return t.index})):[])}}));var o=t.concat(n).map((function(t,e){return t.routerNode.id=e,t.routerNode}));return new e.GridRouter(o,{getChildren:function(t){return t.children},getBounds:function(t){return t.bounds}},r-i)}(t.cola.nodes(),t.cola.groups(),r,i);return o.routeEdges(t.powerGraph.powerEdges,n,(function(t){return t.source.routerNode.id}),(function(t){return t.target.routerNode.id}))},dv.powerGraphGridLayout=function(e,n,r){var i;e.nodes.forEach((function(t,e){return t.index=e})),(new t.Layout).avoidOverlaps(!1).nodes(e.nodes).links(e.links).powerGraphGroups((function(t){(i=t).groups.forEach((function(t){return t.padding=r}))}));var o=e.nodes.length,a=[],s=e.nodes.slice(0);return s.forEach((function(t,e){return t.index=e})),i.groups.forEach((function(t){var e=t.index=t.id+o;s.push(t),void 0!==t.leaves&&t.leaves.forEach((function(t){return a.push({source:e,target:t.index})})),void 0!==t.groups&&t.groups.forEach((function(t){return a.push({source:e,target:t.id+o})}))})),i.powerEdges.forEach((function(t){a.push({source:t.source.index,target:t.target.index})})),(new t.Layout).size(n).nodes(s).links(a).avoidOverlaps(!1).linkDistance(30).symmetricDiffLinkLengths(5).convergenceThreshold(1e-4).start(100,0,0,0,!1),{cola:(new t.Layout).convergenceThreshold(.001).size(n).avoidOverlaps(!0).nodes(e.nodes).links(e.links).groupCompactness(1e-4).linkDistance(30).symmetricDiffLinkLengths(5).powerGraphGroups((function(t){(i=t).groups.forEach((function(t){t.padding=r}))})).start(50,0,100,0,!1),powerGraph:i}},dv}())}(mg)),mg);function fv(t,e,n){const{preferredLinkLength:r=200,avoidOverlaps:i=!0}=n??{};return function(t,e){const n=new Map,o=[];for(const[r,i]of Object.entries(t.nodes)){const t=Object.hasOwn(e.bounds,r)?e.bounds[r]:void 0;n.set(r,{x:t?t.x:0,y:t?t.y:0,width:t?t.width:void 0,height:t?t.height:void 0,fixed:i.fixed?1:0})}for(const e of t.links){const t=n.get(e.source),r=n.get(e.target);t&&r&&o.push({source:t,target:r})}((t,e)=>{(new hv.Layout).nodes(Array.from(t.values())).links(e).avoidOverlaps(i).convergenceThreshold(1e-9).jaccardLinkLengths(r).handleDisconnected(!0).start(30,0,10,void 0,!1)})(n,o);const a=Object.create(null);for(const[t,e]of n)a[t]={x:e.x,y:e.y,width:e.width??0,height:e.height??0};return{bounds:a}}(t,e)}function pv(t,e,n){const{preferredLinkLength:r=200,padding:i={x:50,y:50}}=n??{},o=function(t,e){const n=Object.create(null);let r=1/0,i=1/0;for(const[e,{x:o,y:a,width:s,height:l}]of Object.entries(t.bounds)){const t=Math.max(s,l);r=Math.min(s?t/s:1,r),i=Math.min(l?t/l:1,i),n[e]={x:o,y:a,width:t,height:t}}const o=function(t,e){if(!e)return{state:t,unwrap:t=>t};const n=Object.create(null);for(const[r,{x:i,y:o,width:a,height:s}]of Object.entries(t.bounds))n[r]={x:i-e.x,y:o-e.y,width:a+2*e.x,height:s+2*e.y};return{state:{bounds:n},unwrap:t=>{const n=Object.create(null);for(const[r,{x:i,y:o,width:a,height:s}]of Object.entries(t.bounds))n[r]={x:i+e.x,y:o+e.y,width:a-2*e.x,height:s-2*e.y};return{bounds:n}}}}({bounds:n},e);return{state:o.state,unwrap:e=>{const n=o.unwrap(e),a=function(t){let e=1/0,n=1/0,r=-1/0,i=-1/0;for(const[o,{x:a,y:s,width:l,height:c}]of Object.entries(t.bounds))e=Math.min(e,a),n=Math.min(n,s),r=Math.max(r,a+l),i=Math.max(i,s+c);return{x:Number.isFinite(e)?e:0,y:Number.isFinite(n)?n:0,width:Number.isFinite(e)&&Number.isFinite(r)?r-e:0,height:Number.isFinite(n)&&Number.isFinite(i)?i-n:0}}(n),s=Object.create(null);for(const[e,o]of Object.entries(n.bounds)){const n=Object.hasOwn(t.bounds,e)?t.bounds[e]:void 0;s[e]={x:(o.x-a.x)/r+a.x,y:(o.y-a.y)/i+a.y,width:n?n.width:o.width,height:n?n.height:o.height}}return{bounds:s}}}}(fv(t,e,{preferredLinkLength:r,avoidOverlaps:!1}),i),a=function(t){const e=new Map;for(const[n,{x:r,y:i,width:o,height:a}]of Object.entries(t.bounds))e.set(n,new hv.Rectangle(r,r+o,i,i+a));hv.removeOverlaps(Array.from(e.values()));const n=Object.create(null);for(const[r,{x:i,y:o}]of e){const e=Object.hasOwn(t.bounds,r)?t.bounds[r]:void 0;n[r]={x:i,y:o,width:e?e.width:0,height:e?e.height:0}}return{bounds:n}}(o.state),s=o.unwrap(a);return Promise.resolve(s)}const gv={fr:{authoring_state:{"entity_action_delete.label":"supprimer","entity_action_delete.title":"Supprimer l'entité","entity_action_delete.title_disabled":"Impossible de supprimer l'entité","entity_action_discard.label":"annuler","entity_action_discard.title":"Annuler toutes les modifications de l'entité","entity_action_edit.label":"modifier","entity_action_edit.title":"Modifier l'entité","entity_action_edit.title_disabled":"Impossible de modifier l'entité","entity_add.label":"Nouveau","entity_change.label":"Modifier","entity_delete.label":"Supprimer","relation_action_discard.label":"annuler","relation_action_discard.title":"Annuler toutes les modifications de la relation","relation_add.label":"Nouveau","relation_change.label":"Modifier","relation_delete.label":"Supprimer"},classic_workspace:{"canvas.label":"Canevas","class_tree.heading":"Classes","connections.heading":"Connexions","instances.heading":"Instances"},commands:{"change_entity.title":"Modifier les données de l'entité","change_link_type_visibility.title":"Modifier la visibilité du type de lien","change_relation.title":"Modifier les données de la relation","collapse_element.title":"Réduire l'élément","expand_element.title":"Développer l'élément","place_elements_around.title":"Placer les éléments","restore_geometry.title":"Déplacer les éléments et les liens","restore_link_vertices.title":"Modifier les sommets du lien","restore_viewport.title":"Définir la zone d'affichage","set_element_state.title":"Modifier l'état de l'élément","set_entity_data.title":"Définir les données de l'élément d'entité","set_entity_group_items.title":"Définir les éléments du groupe d'entités","set_link_state.title":"Modifier l'état du lien","set_relation_data.title":"Définir les données du lien de relation","set_relation_group_items.title":"Définir les éléments du groupe de relations","transform_elements.title":"Redimensionner les éléments"},connections_menu:{"all_link.label":"Tous","breadcrumbs_root.label":"Types de liens","dialog.caption":"Connexions","entities.add_all":"Tout ajouter","entities.add_group":"Ajouter en tant que groupe","entities.add_selected":"Ajouter la sélection","entities.counter_label":"{{count}} sur {{total}}","entities.extra_label":" ({{value}})","entities.extra_title":"Entités supplémentaires","entities.missing_label":" ({{value}})","entities.missing_title":"Entités manquantes","entities.no_results":"Aucun résultat","entities.truncated_results":"Seules les {{limit}} premières entités sont affichées","entities.truncated_results_expand":"Seules les {{limit}} premières entités sont affichées,\ncliquez ici pour voir tous les résultats","input.placeholder":null,"link.both_navigate_title":"Naviguer vers tous les éléments connectés","link.both_title":"tous connectés","link.source_navigate_title":"Naviguer vers les éléments source « {{relation}} »","link.source_title":"source de « {{relation}} » {{relationIri}}","link.target_navigate_title":"Naviguer vers les éléments cible « {{target}} »","link.target_title":"cible de « {{relation}} » {{relationIri}}","link.move_to_filter.title":"Définir comme filtre dans le panneau Instances","links.no_results":"Aucun résultat","links.suggest_similar":"Vous cherchez probablement...","place_elements.command":"Ajouter les éléments connectés","select_all.label":"Tout sélectionner","select_all.title":"Sélectionner ou désélectionner toutes les entités","sort_alphabetically.title":"Trier par ordre alphabétique","sort_smart.title":"Tri intelligent"},data_diagram_model:{"add_element.command":"Ajouter un élément","add_link.command":"Ajouter un lien","create_links.command":"Créer des liens","group_entities.command":"Grouper les entités","import_layout.command":"Importer la disposition","regroup_relations.command":"Regrouper les relations","request_entities.command":"Demander les données des entités","request_relations.command":"Demander les relations entre les entités","remove_element.command":"Supprimer l'élément","remove_link.command":"Supprimer le lien","ungroup_entities.command":"Dégrouper les entités"},default_data_locale:{iri:"<{{value}}>",iri_blank:"(nœud anonyme)"},default_workspace:{"search_section_entities.label":"Entités","search_section_entities.title":"Recherche d'entités","search_section_entity_types.label":"Types","search_section_entity_types.title":"Hiérarchie des types d'entités","search_section_link_types.label":"Liens","search_section_link_types.title":"Types de relations sur le diagramme"},drop_on_canvas:{"drop.command":"Glisser-déposer sur le diagramme"},editor_controller:{"apply_authored_changes.command":"Appliquer les modifications au diagramme","discard_change.command":"Annuler la modification","entity_add.command":"Créer une nouvelle entité","entity_change.command":"Modifier l'entité","entity_delete.command":"Supprimer l'entité","relation_add.command":"Créer une nouvelle relation","relation_change.command":"Modifier la relation","relation_delete.command":"Supprimer la relation","relation_move_source.command":"Déplacer la source de la relation","relation_move_target.command":"Déplacer la cible de la relation","remove_items.command":"Supprimer les éléments du diagramme","set_authoring_state.command":"Créer, modifier ou supprimer des entités et des relations","validate_entity_failed.message":"Échec de la validation de l'entité"},forms:{"input_file.drag_hint":"Glissez des fichiers ici ou","input_file.remove_value.title":"Supprimer le fichier","input_file.select_files.label":"Sélectionner des fichiers","input_list.add_value.title":"Ajouter une valeur de propriété","input_list.remove_value.title":"Supprimer la valeur de propriété"},group_paginator:{"current_page.label":"{{page}} sur {{pageCount}}","go_next.title":"Aller à la page suivante","go_previous.title":"Aller à la page précédente","page_size.title":"Nombre d'éléments à afficher par page"},inline_entity:{title:"{{entity}} {{entityIri}}",title_extra:"Types : {{entityTypes}}"},link_action:{"delete_annotation.title":"Supprimer le lien d'annotation","delete_relation.title":"Supprimer la relation","delete_relation.title_disabled":"Impossible de supprimer la relation","edit_relation.title":"Modifier la relation","edit_relation.title_disabled":"Impossible de modifier la relation","rename_link.title":"Renommer le lien","move_relation.move_source_title":"Déplacer la source du lien","move_relation.move_target_title":"Déplacer la cible du lien","vertex.remove_title":"Supprimer le sommet"},navigator:{"toggle_collapse.title":"Réduire le navigateur","toggle_expand.title":"Développer le navigateur"},note_annotation:{"change_text.command":"Modifier le texte de l'annotation","style_align_center.title":"Centrer","style_align_left.title":"Aligner à gauche","style_align_right.title":"Aligner à droite","style_bold.title":"Gras","style_color_variant.title":"Variante de couleur : {{variant}}","style_italic.title":"Italique","style_strikethrough.title":"Barré","style_underline.title":"Souligné"},overlay_controller:{multiple_tasks_in_progress:"Plusieurs tâches sont en cours",unknown_error:"Une erreur inconnue s'est produite"},search_defaults:{empty_input_term:"Saisissez un terme à rechercher.","input.placeholder":"Rechercher...","input_clear.title":"Effacer la recherche","input_submit.title":"Rechercher",input_term_too_short:"Saisissez au moins {{termLength}} caractères pour rechercher.",no_results:"Aucun résultat trouvé."},search_element_types:{"drag_create.title":"Cliquez ou glissez pour créer une nouvelle entité de ce type","input.placeholder":null,no_results:"Aucun type d'élément trouvé.","refresh_progress.title":"Chargement de l'arborescence des types d'éléments",show_only_creatable:"Afficher uniquement les constructibles"},search_entities:{"add_group.label":"Ajouter en tant que groupe","add_group.title":"Placer les entités sélectionnées sur le canevas en tant que groupe","add_selected.label":"Ajouter la sélection","add_selected.title":"Placer les entités sélectionnées sur le canevas",criteria_has_type:"A le type {{entityType}}",criteria_connected:"Connecté à {{entity}}",criteria_connected_via:"Connecté à {{entity}} via {{relationType}}",criteria_connected_to_source:"Connecté à {{entity}} via {{relationType}} en tant que {{sourceIcon}} source",criteria_connected_to_target:"Connecté à {{entity}} via {{relationType}} en tant que {{targetIcon}} cible","input.placeholder":null,"place_elements.command":"Ajouter les éléments sélectionnés","query_progress.title":"Recherche d'entités en cours","show_more_results.label":"Afficher plus","show_more_results.title":"Charger plus de résultats"},search_link_types:{"add_to_filter.title":"Rechercher les éléments connectés via la relation",heading_connected:"Connecté aux entités sélectionnées",heading_connected_single:"Connecté à {{entity}}",heading_other:"Autres liens","input.placeholder":null,no_results:"Aucun lien trouvé.","switch.command":"Modifier la visibilité des types de liens","switch_all.label":"Tout basculer","switch_hidden.title":"Masquer les liens et les étiquettes","switch_visible.title":"Afficher les liens avec étiquettes","switch_without_label.title":"Afficher uniquement les lignes des liens (sans étiquettes)"},selection_action:{"add_to_filter.title":"Rechercher les éléments connectés","anchor.title":"Accéder à la ressource","annotate.defaultContent":"Annotation","annotate.title":"Ajouter une annotation à cet élément","connections.title":"Naviguer vers les éléments connectés","expand.collapse_command":"Réduire les éléments","expand.expand_command":"Développer les éléments","expand.title":"Développer les éléments sélectionnés pour révéler des propriétés supplémentaires","expand.title_single":"Développer un élément pour révéler des propriétés supplémentaires","establish_relation.title":"Établir un lien","establish_relation.title_disabled":"L'établissement d'un lien n'est pas autorisé pour cet élément","group.title":"Grouper les entités","group.title_ungroup":"Dégrouper les entités","layout.title":"Disposer les éléments sélectionnés avec l'algorithme à forces dirigées","remove.title":"Supprimer les éléments sélectionnés du diagramme","remove.title_new":"Annuler le nouvel élément","remove.title_single":"Supprimer un élément du diagramme","zoom_to_fit.title":"Ajuster le zoom aux éléments sélectionnés"},standard_element:{blank_node:"(nœud anonyme)",default_type:"Chose","delete.label":"Supprimer","delete.title":"Supprimer l'entité","delete.title_disabled":"Impossible de supprimer l'entité","edit.label":"Modifier","edit.title":"Modifier l'entité","edit.title_disabled":"Impossible de modifier l'entité","group_item.title":"{{entity}}\nIRI : {{entityIri}}\nTypes : {{entityTypes}}","iri.label":"IRI :","iri.label_modified":"IRI (modifié) :",no_properties:"aucune propriété","property.title":"{{property}} {{propertyIri}}","ungroup.title":"Dégrouper une entité"},standard_link:{"group_source.title":"{{value}} éléments source","group_source.value":"{{value}}","group_target.title":"{{value}} éléments cible","group_target.value":"{{value}}","label.title":"{{relation}} {{relationIri}}","property.title":"{{property}} {{propertyIri}}"},toolbar:{"menu_toggle.title":"Ouvrir le menu"},toolbar_action:{"clear_all.command":"Tout effacer","clear_all.title":"Supprimer tous les éléments et liens du diagramme","clear_all.label":"Tout effacer","export_print.label":"Imprimer","export_print.title":"Imprimer le diagramme","export_raster.label":"Exporter en PNG","export_raster.title":"Exporter le diagramme en image PNG","export_svg.label":"Exporter en SVG","export_svg.title":"Exporter le diagramme en image SVG","redo.label":"Rétablir","redo.title":"Rétablir la dernière commande annulée","redo.title_named":"Rétablir : {{command}}","save_authoring.title":"Appliquer les modifications du graphe","save_layout.title":"Enregistrer la disposition du diagramme","language_selector.title":"Sélectionner la langue des données (étiquettes, propriétés, etc.)","layout.label":"Disposition","layout.title":"Disposer le diagramme avec l'algorithme à forces dirigées","undo.label":"Annuler","undo.title":"Annuler la dernière commande","undo.title_named":"Annuler : {{command}}"},unified_search:{"input.placeholder":null,"input_clear.title":"Effacer","input_collapse.title":"Fermer"},visual_authoring:{"dialog.apply.label":"Appliquer","dialog.apply.title":"Appliquer les modifications","dialog.cancel.label":"Annuler","dialog.cancel.title":"Annuler la boîte de dialogue","edit_entity.dialog.apply.label":null,"edit_entity.dialog.apply.title":null,"edit_entity.dialog.caption":"Modifier l'entité","edit_entity.iri.label":"IRI","edit_entity.iri.placeholder":"IRI de l'entité","edit_relation.dialog.apply.label":null,"edit_relation.dialog.apply.title":null,"edit_relation.dialog.caption":"Modifier la relation","edit_relation.dialog.caption_new":"Établir une nouvelle relation","edit_relation.validation_progress.title":"Validation du type de lien sélectionné","find_or_create.connect_command":"Lier à une entité","find_or_create.create_command":"Créer une nouvelle entité","find_or_create.dialog.apply.label":null,"find_or_create.dialog.apply.title":null,"find_or_create.dialog.caption":"Établir une nouvelle connexion","find_or_create.loading.label":"Chargement de l'entité...","find_or_create.validation_progress.title":"Validation des types d'élément et de lien sélectionnés","property.label":"{{property}}","property.text_value.placeholder":"Valeur de la propriété","property.title":"{{property}} {{propertyIri}}","rename_link.dialog.apply.label":null,"rename_link.dialog.apply.title":null,"rename_link.dialog.caption":"Renommer le lien","rename_link.label.label":"Étiquette","select_entity.entity_type.label":"{{type}}","select_entity.input.placeholder":null,"select_entity.type.label":"Type d'entité","select_entity.type.placeholder":"Sélectionner le type d'entité","select_entity.results.aria_label":"Sélectionner un élément existant à placer sur le diagramme","select_entity.separator.label":"ou créer une nouvelle entité","select_entity.validation.error_required":"Requis.","select_relation.relation_type.label":"{{relation}} [{{source}} → {{target}}]","select_relation.type.label":"Type de relation","select_relation.type.placeholder":"Sélectionner le type de relation","select_relation.validation.error_duplicate":"La relation existe déjà.","select_relation.validation.error_required":"Requis."},workspace:{"group_entities.command":"Grouper les entités","perform_layout.task":"Calcul de la disposition du graphe","perform_layout.command":"Disposition du graphe","ungroup_entities.command":"Dégrouper les entités"},workspace_layout:{"toggle_collapse.title":"Réduire le panneau","toggle_expand.title":"Développer le panneau"},zoom_control:{"pointer_mode.title":"Basculer le mode de sélection :\nGlissez pour sélectionner, Maj + pointeur pour déplacer le canevas","zoom_in.title":"Zoom avant","zoom_out.title":"Zoom arrière","zoom_to_fit.title":"Ajuster à l'écran"}}};function vv(t){const e=gv[t];return e?[e]:[]}let mv=null;function bv(t,e,n){return new ss({endpointUrl:t,queryMethod:"POST",queryFunction:e},n)}function wv(t){const{currentRepository:e,queryFunction:n,language:r,initialDiagram:i,providerSettings:o}=t,{onMount:a}=function(t,e){const[n,r]=x.useState(),i=x.useRef(void 0);if(i.current)i.current.latestOnLoad=t;else{const e={latestOnLoad:t,context:void 0,loadedWorkspace:{getContext:()=>{if(!e.context)throw new Error("Cannot get Reactodia Workspace context: it is not mounted yet");return e.context},onMount:t=>{const n=t?.getContext();e.context=n,r(n)}}};i.current=e}return x.useEffect((()=>{if(n){const t=i.current.latestOnLoad,e=new AbortController;return(async()=>{const r=n.overlay.startTask();try{await Promise.resolve(),await t({context:n,signal:e.signal})}catch(t){e.signal.aborted||(r.setError(t),console.error("Reactodia: failed to load a workspace",t))}finally{r.end()}e.signal.aborted||n.model.history.reset()})(),()=>{e.abort(),n.model.discardLayout()}}}),[n,...e]),i.current.loadedWorkspace}((async({context:t,signal:r})=>{mv=t;const{model:a}=t,s=bv(e,n,o);i?await a.importLayout({dataProvider:s,diagram:i,signal:r}):await a.createNewDiagram({dataProvider:s,signal:r})}),[r]);return x.createElement(fg,{ref:a,defaultLayout:pv,defaultLanguage:r,translations:vv(r)},x.createElement(ig,{}))}const yv=class{constructor(e){t(this,e),this.language="en"}onProviderSettingsChange(){this.renderGraph()}onLanguageChange(){const t=null==mv?void 0:mv.model.exportLayout();this.renderGraph(t)}componentDidLoad(){this.renderGraph()}disconnectedCallback(){this.reactRoot&&(this.reactRoot.unmount(),this.reactRoot=void 0)}render(){return e(n,{key:"3fca0e2163335fc2cb0fc3c57291e4f29234f2c2"})}renderGraph(t){if(!this.currentRepository)throw new Error("currentRepository is required");if(!this.queryFunction)throw new Error("queryFunction is required");if(!this.hostElement)return;const e={initialDiagram:t,currentRepository:this.currentRepository,queryFunction:this.queryFunction,language:this.language,providerSettings:this.providerSettings};this.reactRoot&&!t?async function(t){if(!mv)return;const{model:e}=mv,n=bv(t.currentRepository,t.queryFunction,t.providerSettings);await e.createNewDiagram({dataProvider:n})}(e):this.reactRoot=function(t,e){const n=I.createRoot(t);return n.render(x.createElement(wv,e)),n}(this.hostElement,e)}get hostElement(){return r(this)}static get watchers(){return{currentRepository:["onProviderSettingsChange"],providerSettings:["onProviderSettingsChange"],language:["onLanguageChange"]}}};yv.style="graphwise-reactodia{display:block;width:100%;height:75vh}graphwise-reactodia .reactodia-container{position:relative;width:100%;height:100%}";export{yv as graphwise_reactodia}