UNPKG

@minofrk/xelto-diagram-canvas

Version:

An implementation of <xelto-diagram> in TypeScript.

163 lines 59.1 kB
/*!
 * @minofrk/xelto-diagram-canvas v0.1.0
 * https://github.com/minofrk/xelto-diagram-canvas.js
 * 
 * © 2019 古城みの <minofrk@gmail.com>
 * license: MIT
 * 
 * https://cdn.jsdelivr.net/npm/@minofrk/xelto-diagram-canvas@0.1.0/umd/third-party-licenses.txt
 */
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.XeltoDiagramCanvas=e():t.XeltoDiagramCanvas=e()}(window,function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=7)}([function(t,e,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0});var i=n(4),o=n(5);function u(t){return{_tag:"Left",left:t}}function c(t){return{_tag:"Right",right:t}}function a(t,e){try{return c(t())}catch(t){return u(e(t))}}function s(t){return{concat:function(e,n){return l(e)?e:l(n)?n:c(t.concat(e.right,n.right))}}}function l(t){switch(t._tag){case"Left":return!0;case"Right":return!1}}function f(t){return!l(t)}e.URI="Either",e.left=u,e.right=c,e.fromNullable=function(t){return function(e){return null==e?u(t):c(e)}},e.toError=function(t){return t instanceof Error?t:new Error(String(t))},e.tryCatch=a,e.fold=function(t,e){return function(n){return l(n)?t(n.left):e(n.right)}},e.getShow=function(t,e){return{show:function(n){return l(n)?"left("+t.show(n.left)+")":"right("+e.show(n.right)+")"}}},e.getEq=function(t,e){return{equals:function(n,r){return n===r||(l(n)?l(r)&&t.equals(n.left,r.left):f(r)&&e.equals(n.right,r.right))}}},e.getSemigroup=function(t){return{concat:function(e,n){return l(n)?e:l(e)?n:c(t.concat(e.right,n.right))}}},e.getApplySemigroup=s,e.getApplyMonoid=function(t){return r({},s(t),{empty:c(t.empty)})},e.isLeft=l,e.isRight=f,e.swap=function(t){return l(t)?c(t.left):u(t.right)},e.orElse=function(t){return function(e){return l(e)?t(e.left):e}},e.getOrElse=function(t){return function(e){return l(e)?t(e.left):e.right}},e.elem=function(t){return function(e,n){return!l(n)&&t.equals(e,n.right)}},e.exists=function(t){return function(e){return!l(e)&&t(e.right)}},e.parseJSON=function(t,e){return a(function(){return JSON.parse(t)},e)},e.stringifyJSON=function(t,e){return a(function(){return JSON.stringify(t)},e)};var p=void 0;function h(t,e){return{concat:function(n,r){return l(n)?l(r)?u(t.concat(n.left,r.left)):n:l(r)?r:c(e.concat(n.right,r.right))}}}e.getWitherable=function(t){var n=u(t.empty),r=function(e){return l(e)?e:"None"===e.right._tag?u(t.empty):c(e.right.value)},i=function(t){return l(t)?{left:t,right:t}:l(t.right)?{left:c(t.right.left),right:n}:{left:n,right:c(t.right.right)}};return{URI:e.URI,_E:p,map:e.either.map,compact:r,separate:i,filter:function(e,n){return l(e)?e:n(e.right)?e:u(t.empty)},filterMap:function(e,n){if(l(e))return e;var r=n(e.right);return"None"===r._tag?u(t.empty):c(r.value)},partition:function(t,e){return l(t)?{left:t,right:t}:e(t.right)?{left:n,right:c(t.right)}:{left:c(t.right),right:n}},partitionMap:function(t,e){if(l(t))return{left:t,right:t};var r=e(t.right);return l(r)?{left:c(r.left),right:n}:{left:n,right:c(r.right)}},traverse:e.either.traverse,sequence:e.either.sequence,reduce:e.either.reduce,foldMap:e.either.foldMap,reduceRight:e.either.reduceRight,wither:function(t){var n=e.either.traverse(t);return function(e,i){return t.map(n(e,i),r)}},wilt:function(t){var n=e.either.traverse(t);return function(e,r){return t.map(n(e,r),i)}}}},e.getValidation=function(t){return{URI:e.URI,_E:p,map:e.either.map,of:e.either.of,ap:function(e,n){return l(e)?l(n)?u(t.concat(e.left,n.left)):e:l(n)?n:c(e.right(n.right))},chain:e.either.chain,alt:function(e,n){if(f(e))return e;var r=n();return l(r)?u(t.concat(e.left,r.left)):r}}},e.getValidationSemigroup=h,e.getValidationMonoid=function(t,e){return{concat:h(t,e).concat,empty:c(e.empty)}},e.either={URI:e.URI,map:function(t,e){return l(t)?t:c(e(t.right))},of:c,ap:function(t,e){return l(t)?t:l(e)?e:c(t.right(e.right))},chain:function(t,e){return l(t)?t:e(t.right)},reduce:function(t,e,n){return l(t)?e:n(e,t.right)},foldMap:function(t){return function(e,n){return l(e)?t.empty:n(e.right)}},reduceRight:function(t,e,n){return l(t)?e:n(t.right,e)},traverse:function(t){return function(e,n){return l(e)?t.of(u(e.left)):t.map(n(e.right),c)}},sequence:function(t){return function(e){return l(e)?t.of(u(e.left)):t.map(e.right,c)}},bimap:function(t,e,n){return l(t)?u(e(t.left)):c(n(t.right))},mapLeft:function(t,e){return l(t)?u(e(t.left)):t},alt:function(t,e){return l(t)?e():t},extend:function(t,e){return l(t)?t:c(e(t))},chainRec:function(t,e){return i.tailRec(e(t),function(t){return l(t)?c(u(t.left)):l(t.right)?u(e(t.right.left)):c(c(t.right.right))})},throwError:u};var d=o.pipeable(e.either),v=d.alt,y=d.ap,g=d.apFirst,m=d.apSecond,_=d.bimap,x=d.chain,b=d.chainFirst,w=d.duplicate,S=d.extend,j=d.flatten,T=d.foldMap,O=d.map,N=d.mapLeft,A=d.reduce,E=d.reduceRight,M=d.fromOption,k=d.fromPredicate,z=d.filterOrElse;e.alt=v,e.ap=y,e.apFirst=g,e.apSecond=m,e.bimap=_,e.chain=x,e.chainFirst=b,e.duplicate=w,e.extend=S,e.flatten=j,e.foldMap=T,e.map=O,e.mapLeft=N,e.reduce=A,e.reduceRight=E,e.fromOption=M,e.fromPredicate=k,e.filterOrElse=z},function(t,e,n){(function(t,n){var r=200,i="__lodash_hash_undefined__",o=9007199254740991,u="[object Arguments]",c="[object Boolean]",a="[object Date]",s="[object Function]",l="[object GeneratorFunction]",f="[object Map]",p="[object Number]",h="[object Object]",d="[object RegExp]",v="[object Set]",y="[object String]",g="[object Symbol]",m="[object ArrayBuffer]",_="[object DataView]",x="[object Float32Array]",b="[object Float64Array]",w="[object Int8Array]",S="[object Int16Array]",j="[object Int32Array]",T="[object Uint8Array]",O="[object Uint8ClampedArray]",N="[object Uint16Array]",A="[object Uint32Array]",E=/\w*$/,M=/^\[object .+?Constructor\]$/,k=/^(?:0|[1-9]\d*)$/,z={};z[u]=z["[object Array]"]=z[m]=z[_]=z[c]=z[a]=z[x]=z[b]=z[w]=z[S]=z[j]=z[f]=z[p]=z[h]=z[d]=z[v]=z[y]=z[g]=z[T]=z[O]=z[N]=z[A]=!0,z["[object Error]"]=z[s]=z["[object WeakMap]"]=!1;var C="object"==typeof t&&t&&t.Object===Object&&t,I="object"==typeof self&&self&&self.Object===Object&&self,P=C||I||Function("return this")(),V=e&&!e.nodeType&&e,R=V&&"object"==typeof n&&n&&!n.nodeType&&n,W=R&&R.exports===V;function F(t,e){return t.set(e[0],e[1]),t}function L(t,e){return t.add(e),t}function $(t,e,n,r){var i=-1,o=t?t.length:0;for(r&&o&&(n=t[++i]);++i<o;)n=e(n,t[i],i,t);return n}function U(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(t){}return e}function B(t){var e=-1,n=Array(t.size);return t.forEach(function(t,r){n[++e]=[r,t]}),n}function D(t,e){return function(n){return t(e(n))}}function q(t){var e=-1,n=Array(t.size);return t.forEach(function(t){n[++e]=t}),n}var H,J=Array.prototype,K=Function.prototype,X=Object.prototype,G=P["__core-js_shared__"],Z=(H=/[^.]+$/.exec(G&&G.keys&&G.keys.IE_PROTO||""))?"Symbol(src)_1."+H:"",Q=K.toString,Y=X.hasOwnProperty,tt=X.toString,et=RegExp("^"+Q.call(Y).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),nt=W?P.Buffer:void 0,rt=P.Symbol,it=P.Uint8Array,ot=D(Object.getPrototypeOf,Object),ut=Object.create,ct=X.propertyIsEnumerable,at=J.splice,st=Object.getOwnPropertySymbols,lt=nt?nt.isBuffer:void 0,ft=D(Object.keys,Object),pt=Rt(P,"DataView"),ht=Rt(P,"Map"),dt=Rt(P,"Promise"),vt=Rt(P,"Set"),yt=Rt(P,"WeakMap"),gt=Rt(Object,"create"),mt=Ut(pt),_t=Ut(ht),xt=Ut(dt),bt=Ut(vt),wt=Ut(yt),St=rt?rt.prototype:void 0,jt=St?St.valueOf:void 0;function Tt(t){var e=-1,n=t?t.length:0;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Ot(t){var e=-1,n=t?t.length:0;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Nt(t){var e=-1,n=t?t.length:0;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function At(t){this.__data__=new Ot(t)}function Et(t,e){var n=Dt(t)||function(t){return function(t){return function(t){return!!t&&"object"==typeof t}(t)&&qt(t)}(t)&&Y.call(t,"callee")&&(!ct.call(t,"callee")||tt.call(t)==u)}(t)?function(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}(t.length,String):[],r=n.length,i=!!r;for(var o in t)!e&&!Y.call(t,o)||i&&("length"==o||Lt(o,r))||n.push(o);return n}function Mt(t,e,n){var r=t[e];Y.call(t,e)&&Bt(r,n)&&(void 0!==n||e in t)||(t[e]=n)}function kt(t,e){for(var n=t.length;n--;)if(Bt(t[n][0],e))return n;return-1}function zt(t,e,n,r,i,o,M){var k;if(r&&(k=o?r(t,i,o,M):r(t)),void 0!==k)return k;if(!Kt(t))return t;var C=Dt(t);if(C){if(k=function(t){var e=t.length,n=t.constructor(e);e&&"string"==typeof t[0]&&Y.call(t,"index")&&(n.index=t.index,n.input=t.input);return n}(t),!e)return function(t,e){var n=-1,r=t.length;e||(e=Array(r));for(;++n<r;)e[n]=t[n];return e}(t,k)}else{var I=Ft(t),P=I==s||I==l;if(Ht(t))return function(t,e){if(e)return t.slice();var n=new t.constructor(t.length);return t.copy(n),n}(t,e);if(I==h||I==u||P&&!o){if(U(t))return o?t:{};if(k=function(t){return"function"!=typeof t.constructor||$t(t)?{}:(e=ot(t),Kt(e)?ut(e):{});var e}(P?{}:t),!e)return function(t,e){return Pt(t,Wt(t),e)}(t,function(t,e){return t&&Pt(e,Xt(e),t)}(k,t))}else{if(!z[I])return o?t:{};k=function(t,e,n,r){var i=t.constructor;switch(e){case m:return It(t);case c:case a:return new i(+t);case _:return function(t,e){var n=e?It(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,r);case x:case b:case w:case S:case j:case T:case O:case N:case A:return function(t,e){var n=e?It(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}(t,r);case f:return function(t,e,n){return $(e?n(B(t),!0):B(t),F,new t.constructor)}(t,r,n);case p:case y:return new i(t);case d:return(s=new(u=t).constructor(u.source,E.exec(u))).lastIndex=u.lastIndex,s;case v:return function(t,e,n){return $(e?n(q(t),!0):q(t),L,new t.constructor)}(t,r,n);case g:return o=t,jt?Object(jt.call(o)):{}}var o;var u,s}(t,I,zt,e)}}M||(M=new At);var V=M.get(t);if(V)return V;if(M.set(t,k),!C)var R=n?function(t){return function(t,e,n){var r=e(t);return Dt(t)?r:function(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}(r,n(t))}(t,Xt,Wt)}(t):Xt(t);return function(t,e){for(var n=-1,r=t?t.length:0;++n<r&&!1!==e(t[n],n,t););}(R||t,function(i,o){R&&(i=t[o=i]),Mt(k,o,zt(i,e,n,r,o,t,M))}),k}function Ct(t){return!(!Kt(t)||(e=t,Z&&Z in e))&&(Jt(t)||U(t)?et:M).test(Ut(t));var e}function It(t){var e=new t.constructor(t.byteLength);return new it(e).set(new it(t)),e}function Pt(t,e,n,r){n||(n={});for(var i=-1,o=e.length;++i<o;){var u=e[i],c=r?r(n[u],t[u],u,n,t):void 0;Mt(n,u,void 0===c?t[u]:c)}return n}function Vt(t,e){var n,r,i=t.__data__;return("string"==(r=typeof(n=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof e?"string":"hash"]:i.map}function Rt(t,e){var n=function(t,e){return null==t?void 0:t[e]}(t,e);return Ct(n)?n:void 0}Tt.prototype.clear=function(){this.__data__=gt?gt(null):{}},Tt.prototype.delete=function(t){return this.has(t)&&delete this.__data__[t]},Tt.prototype.get=function(t){var e=this.__data__;if(gt){var n=e[t];return n===i?void 0:n}return Y.call(e,t)?e[t]:void 0},Tt.prototype.has=function(t){var e=this.__data__;return gt?void 0!==e[t]:Y.call(e,t)},Tt.prototype.set=function(t,e){return this.__data__[t]=gt&&void 0===e?i:e,this},Ot.prototype.clear=function(){this.__data__=[]},Ot.prototype.delete=function(t){var e=this.__data__,n=kt(e,t);return!(n<0||(n==e.length-1?e.pop():at.call(e,n,1),0))},Ot.prototype.get=function(t){var e=this.__data__,n=kt(e,t);return n<0?void 0:e[n][1]},Ot.prototype.has=function(t){return kt(this.__data__,t)>-1},Ot.prototype.set=function(t,e){var n=this.__data__,r=kt(n,t);return r<0?n.push([t,e]):n[r][1]=e,this},Nt.prototype.clear=function(){this.__data__={hash:new Tt,map:new(ht||Ot),string:new Tt}},Nt.prototype.delete=function(t){return Vt(this,t).delete(t)},Nt.prototype.get=function(t){return Vt(this,t).get(t)},Nt.prototype.has=function(t){return Vt(this,t).has(t)},Nt.prototype.set=function(t,e){return Vt(this,t).set(t,e),this},At.prototype.clear=function(){this.__data__=new Ot},At.prototype.delete=function(t){return this.__data__.delete(t)},At.prototype.get=function(t){return this.__data__.get(t)},At.prototype.has=function(t){return this.__data__.has(t)},At.prototype.set=function(t,e){var n=this.__data__;if(n instanceof Ot){var i=n.__data__;if(!ht||i.length<r-1)return i.push([t,e]),this;n=this.__data__=new Nt(i)}return n.set(t,e),this};var Wt=st?D(st,Object):function(){return[]},Ft=function(t){return tt.call(t)};function Lt(t,e){return!!(e=null==e?o:e)&&("number"==typeof t||k.test(t))&&t>-1&&t%1==0&&t<e}function $t(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||X)}function Ut(t){if(null!=t){try{return Q.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function Bt(t,e){return t===e||t!=t&&e!=e}(pt&&Ft(new pt(new ArrayBuffer(1)))!=_||ht&&Ft(new ht)!=f||dt&&"[object Promise]"!=Ft(dt.resolve())||vt&&Ft(new vt)!=v||yt&&"[object WeakMap]"!=Ft(new yt))&&(Ft=function(t){var e=tt.call(t),n=e==h?t.constructor:void 0,r=n?Ut(n):void 0;if(r)switch(r){case mt:return _;case _t:return f;case xt:return"[object Promise]";case bt:return v;case wt:return"[object WeakMap]"}return e});var Dt=Array.isArray;function qt(t){return null!=t&&function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=o}(t.length)&&!Jt(t)}var Ht=lt||function(){return!1};function Jt(t){var e=Kt(t)?tt.call(t):"";return e==s||e==l}function Kt(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function Xt(t){return qt(t)?Et(t):function(t){if(!$t(t))return ft(t);var e=[];for(var n in Object(t))Y.call(t,n)&&"constructor"!=n&&e.push(n);return e}(t)}n.exports=function(t){return zt(t,!0,!0)}}).call(this,n(2),n(3)(t))},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.tailRec=function(t,e){for(var n=e(t);"Left"===n._tag;)n=e(n.left);return n.right}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(6);var i=function(t){return"function"==typeof t.map},o=function(t){return"function"==typeof t.contramap},u=function(t){return"function"==typeof t.mapWithIndex},c=function(t){return"function"==typeof t.ap},a=function(t){return"function"==typeof t.chain},s=function(t){return"function"==typeof t.bimap},l=function(t){return"function"==typeof t.extend},f=function(t){return"function"==typeof t.reduce},p=function(t){return"function"==typeof t.reduceWithIndex},h=function(t){return"function"==typeof t.alt},d=function(t){return"function"==typeof t.compact},v=function(t){return"function"==typeof t.filter},y=function(t){return"function"==typeof t.filterWithIndex},g=function(t){return"function"==typeof t.promap},m=function(t){return"function"==typeof t.compose},_=function(t){return"function"==typeof t.throwError};e.pipeable=function(t){var e={};i(t)&&(e.map=function(e){return function(n){return t.map(n,e)}});o(t)&&(e.contramap=function(e){return function(n){return t.contramap(n,e)}});u(t)&&(e.mapWithIndex=function(e){return function(n){return t.mapWithIndex(n,e)}});c(t)&&(e.ap=function(e){return function(n){return t.ap(n,e)}},e.apFirst=function(e){return function(n){return t.ap(t.map(n,function(t){return function(){return t}}),e)}},e.apSecond=function(e){return function(n){return t.ap(t.map(n,function(){return function(t){return t}}),e)}});a(t)&&(e.chain=function(e){return function(n){return t.chain(n,e)}},e.chainFirst=function(e){return function(n){return t.chain(n,function(n){return t.map(e(n),function(){return n})})}},e.flatten=function(e){return t.chain(e,r.identity)});s(t)&&(e.bimap=function(e,n){return function(r){return t.bimap(r,e,n)}},e.mapLeft=function(e){return function(n){return t.mapLeft(n,e)}});l(t)&&(e.extend=function(e){return function(n){return t.extend(n,e)}},e.duplicate=function(e){return t.extend(e,r.identity)});f(t)&&(e.reduce=function(e,n){return function(r){return t.reduce(r,e,n)}},e.foldMap=function(e){var n=t.foldMap(e);return function(t){return function(e){return n(e,t)}}},e.reduceRight=function(e,n){return function(r){return t.reduceRight(r,e,n)}});p(t)&&(e.reduceWithIndex=function(e,n){return function(r){return t.reduceWithIndex(r,e,n)}},e.foldMapWithIndex=function(e){var n=t.foldMapWithIndex(e);return function(t){return function(e){return n(e,t)}}},e.reduceRightWithIndex=function(e,n){return function(r){return t.reduceRightWithIndex(r,e,n)}});h(t)&&(e.alt=function(e){return function(n){return t.alt(n,e)}});d(t)&&(e.compact=t.compact,e.separate=t.separate),v(t)&&(e.filter=function(e){return function(n){return t.filter(n,e)}},e.filterMap=function(e){return function(n){return t.filterMap(n,e)}},e.partition=function(e){return function(n){return t.partition(n,e)}},e.partitionMap=function(e){return function(n){return t.partitionMap(n,e)}});y(t)&&(e.filterWithIndex=function(e){return function(n){return t.filterWithIndex(n,e)}},e.filterMapWithIndex=function(e){return function(n){return t.filterMapWithIndex(n,e)}},e.partitionWithIndex=function(e){return function(n){return t.partitionWithIndex(n,e)}},e.partitionMapWithIndex=function(e){return function(n){return t.partitionMapWithIndex(n,e)}});g(t)&&(e.promap=function(e,n){return function(r){return t.promap(r,e,n)}});m(t)&&(e.compose=function(e){return function(n){return t.compose(n,e)}});_(t)&&(e.fromOption=function(e){return function(n){return"None"===n._tag?t.throwError(e()):t.of(n.value)}},e.fromEither=function(e){return"Left"===e._tag?t.throwError(e.left):t.of(e.right)},e.fromPredicate=function(e,n){return function(r){return e(r)?t.of(r):t.throwError(n(r))}},e.filterOrElse=function(e,n){return function(r){return t.chain(r,function(r){return e(r)?t.of(r):t.throwError(n(r))})}});return e}},function(t,e,n){"use strict";function r(t){return t}Object.defineProperty(e,"__esModule",{value:!0}),e.identity=r},function(t,e,n){"use strict";n.r(e);var r=n(1),i=n.n(r),o='Consolas, "Courier New", monospace';function u(t,e){const n=t.getContext("2d");if(null===n)throw new Error;return{canvasContext:n,canvasSize:{x:t.width,y:t.height},options:Object.assign({fontFamily:o,reversed:!1},e)}}function c(t,...e){for(const n of e)for(const e of n)e(t)}function a(t,e){return{x:t.x+e.x,y:t.y+e.y}}function s(t,e){return{x:t.x-e.x,y:t.y-e.y}}function l({x:t,y:e},n){return{x:t*n,y:e*n}}function f(t,e){return{x:t.x*e.x,y:t.y*e.y}}function p({x:t,y:e}){return{x:Math.floor(t),y:Math.floor(e)}}function h(t){return{x:t,y:t}}const d={x:24,y:16};function v(t){return{x:t.x/d.x,y:t.y/d.y}}function y(t){const{x:e,y:n}=v(t);return Math.max(e,n)}function g(t,{center:e,rotate:n=0,scale:r={x:1,y:1}}){t.setTransform(r.x,0,0,r.y,0,0);const i=Math.cos(n),o=Math.sin(n);t.transform(i,o,-o,i,e.x,e.y)}function m({value:t,color:e,rotate:n,virtualArea:r,virtualFontSize:i,fontFamily:o}){return u=>{const{canvasContext:c,canvasSize:f}=u,p=function({virtualArea:t,virtualFontSize:e},n){const r=y(n),i=l(t.size,r);return{size:i,center:a(l(t.leftTop,r),l(i,.5)),scale:r,fontSize:e*r}}({virtualArea:r,virtualFontSize:i},f);c.fillStyle=e,c.textAlign="center",c.textBaseline="middle",c.font=`${p.fontSize}px ${o||u.options.fontFamily}`,g(c,{center:u.options.reversed?s(f,p.center):p.center,rotate:n,scale:l(v(f),1/p.scale)}),c.fillText(t,0,0,.9*p.size.x)}}function _(t,e){const n=l(s(f(t.size,e),h(1)),.5),r=a(f(t.leftTop,e),n),i=p(s(r,n)),o=a(p(a(r,n)),h(1)),u=s(o,i);return{leftTop:l(u,-.5),center:l(a(i,o),.5),size:u}}function x({color:t,virtualArea:e}){return n=>{const r=v(n.canvasSize),i=_(e,r);n.canvasContext.fillStyle=t,g(n.canvasContext,{center:n.options.reversed?s(n.canvasSize,i.center):i.center}),n.canvasContext.fillRect(i.leftTop.x,i.leftTop.y,i.size.x,i.size.y)}}function b({color:t,virtualArea:e}){return n=>{const r=function(t,e){const n=v(e),r=l(s(f(t.size,n),h(1)),.5),i=a(f(t.leftTop,n),r),o=Math.max(1,Math.ceil(Math.max(n.x,n.y)/15)),u=h(Math.floor(o-1)/2),c=a(a(p(s(i,r)),h(.5)),u),d=s(a(p(a(i,r)),h(.5)),u),y=s(d,c);return{leftTop:l(y,-.5),center:l(a(c,d),.5),size:y,lineWidth:o}}(e,n.canvasSize);n.canvasContext.lineWidth=r.lineWidth,n.canvasContext.strokeStyle=t,g(n.canvasContext,{center:n.options.reversed?s(n.canvasSize,r.center):r.center}),n.canvasContext.strokeRect(r.leftTop.x,r.leftTop.y,r.size.x,r.size.y)}}function*w(){for(let t=0;t<7;t++)for(let e=0;e<7;e++)yield{leftTop:{x:5+2*e,y:1+2*t},index:{x:e,y:t}}}const S=["1","2","3","4","5","6","7"],j=["v","e","s","t","b","i","p"],T={color:"#000",rotate:0,virtualFontSize:.9};function O(t,e){return m(Object.assign({},T,{value:S[t],virtualArea:{leftTop:e,size:{x:2,y:1}}}))}function N(t,e){return m(Object.assign({},T,{value:j[t],virtualArea:{leftTop:e,size:{x:1,y:2}}}))}var A,E=[...function*(){yield x({color:"#fff",virtualArea:{leftTop:{x:0,y:0},size:{x:24,y:16}}});for(const{leftTop:t,index:e}of w())e.x+e.y&1||(yield x({color:"#eaeaea",virtualArea:{leftTop:t,size:{x:2,y:2}}}));yield b({color:"#000",virtualArea:{leftTop:{x:5,y:1},size:{x:14,y:14}}});const t=t=>b({color:"#000",virtualArea:{leftTop:t,size:{x:2,y:2}}});yield t({x:2,y:1}),yield t({x:20,y:13})}(),...function*(){for(let t=0;t<7;t++){const e=5+2*t,n=1+2*t;yield O(t,{x:e,y:0}),yield N(t,{x:4,y:n}),yield O(t,{x:e,y:15}),yield N(t,{x:19,y:n})}}()],M=n(0),k=(A=function(t,e){return(A=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])})(t,e)},function(t,e){function n(){this.constructor=t}A(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),z=function(){return(z=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)},C=(M.either.map,M.either.chain),I=function(){function t(t,e,n,r){this.name=t,this.is=e,this.validate=n,this.encode=r,this.decode=this.decode.bind(this)}return t.prototype.pipe=function(e,n){var r=this;return void 0===n&&(n="pipe("+this.name+", "+e.name+")"),new t(n,e.is,function(t,n){return C(r.validate(t,n),function(t){return e.validate(t,n)})},this.encode===P&&e.encode===P?P:function(t){return r.encode(e.encode(t))})},t.prototype.asDecoder=function(){return this},t.prototype.asEncoder=function(){return this},t.prototype.decode=function(t){return this.validate(t,[{key:"",type:this,actual:t}])},t}(),P=function(t){return t},V=function(t){return t.displayName||t.name||"<function"+t.length+">"},R=function(t,e,n,r){for(var i=t.length,o=Array(i+1),u=0;u<i;u++)o[u]=t[u];return o[i]={key:e,type:n,actual:r},o},W=M.left,F=function(t,e,n){return W([{value:t,context:e,message:n}])},L=M.right,$=function(t,e){for(var n=e.length,r=0;r<n;r++)t.push(e[r])},U=function(t){return function(e){return e._tag===t}},B=U("UnknownType"),D=U("AnyType"),q=(U("InterfaceType"),U("PartialType"),new(function(t){function e(){var e=t.call(this,"null",function(t){return null===t},function(t,n){return e.is(t)?L(t):F(t,n)},P)||this;return e._tag="NullType",e}return k(e,t),e}(I))),H=new(function(t){function e(){var e=t.call(this,"undefined",function(t){return void 0===t},function(t,n){return e.is(t)?L(t):F(t,n)},P)||this;return e._tag="UndefinedType",e}return k(e,t),e}(I)),J=(new(function(t){function e(){var e=t.call(this,"void",H.is,H.validate,P)||this;return e._tag="VoidType",e}return k(e,t),e}(I)),new(function(t){function e(){var e=t.call(this,"unknown",function(t){return!0},L,P)||this;return e._tag="UnknownType",e}return k(e,t),e}(I)),new(function(t){function e(){var e=t.call(this,"string",function(t){return"string"==typeof t},function(t,n){return e.is(t)?L(t):F(t,n)},P)||this;return e._tag="StringType",e}return k(e,t),e}(I))),K=new(function(t){function e(){var e=t.call(this,"number",function(t){return"number"==typeof t},function(t,n){return e.is(t)?L(t):F(t,n)},P)||this;return e._tag="NumberType",e}return k(e,t),e}(I)),X=(new(function(t){function e(){var e=t.call(this,"boolean",function(t){return"boolean"==typeof t},function(t,n){return e.is(t)?L(t):F(t,n)},P)||this;return e._tag="BooleanType",e}return k(e,t),e}(I)),new(function(t){function e(){var e=t.call(this,"UnknownArray",Array.isArray,function(t,n){return e.is(t)?L(t):F(t,n)},P)||this;return e._tag="AnyArrayType",e}return k(e,t),e}(I))),G=new(function(t){function e(){var e=t.call(this,"UnknownRecord",function(t){return null!==t&&"object"==typeof t},function(t,n){return e.is(t)?L(t):F(t,n)},P)||this;return e._tag="AnyDictionaryType",e}return k(e,t),e}(I)),Z=(new(function(t){function e(){var e=t.call(this,"Function",function(t){return"function"==typeof t},function(t,n){return e.is(t)?L(t):F(t,n)},P)||this;return e._tag="FunctionType",e}return k(e,t),e}(I)),function(t){function e(e,n,r,i,o,u){var c=t.call(this,e,n,r,i)||this;return c.type=o,c.predicate=u,c._tag="RefinementType",c}return k(e,t),e}(I)),Q=function(t,e,n){return Nt(t,e,n)},Y=Q(K,function(t){return Number.isInteger(t)},"Int"),tt=function(t){function e(e,n,r,i,o){var u=t.call(this,e,n,r,i)||this;return u.value=o,u._tag="LiteralType",u}return k(e,t),e}(I),et=function(t,e){void 0===e&&(e=JSON.stringify(t));var n=function(e){return e===t};return new tt(e,n,function(e,r){return n(e)?L(t):F(e,r)},P,t)},nt=function(t){function e(e,n,r,i,o){var u=t.call(this,e,n,r,i)||this;return u.keys=o,u._tag="KeyofType",u}return k(e,t),e}(I),rt=Object.prototype.hasOwnProperty,it=function(t,e){void 0===e&&(e=Object.keys(t).map(function(t){return JSON.stringify(t)}).join(" | "));var n=function(e){return J.is(e)&&rt.call(t,e)};return new nt(e,n,function(t,e){return n(t)?L(t):F(t,e)},P,t)},ot=function(t){function e(e,n,r,i,o){var u=t.call(this,e,n,r,i)||this;return u.runDefinition=o,u._tag="RecursiveType",u}return k(e,t),Object.defineProperty(e.prototype,"type",{get:function(){return this.runDefinition()},enumerable:!0,configurable:!0}),e}(I),ut=function(t,e){var n,r=function(){return n||((n=e(i)).name=t),n},i=new ot(t,function(t){return r().is(t)},function(t,e){return r().validate(t,e)},function(t){return r().encode(t)},r);return i},ct=function(t){function e(e,n,r,i,o){var u=t.call(this,e,n,r,i)||this;return u.type=o,u._tag="ArrayType",u}return k(e,t),e}(I),at=function(t,e){return void 0===e&&(e="Array<"+t.name+">"),new ct(e,function(e){return X.is(e)&&e.every(t.is)},function(e,n){return C(X.validate(e,n),function(e){for(var r=e.length,i=e,o=[],u=0;u<r;u++){var c=e[u],a=t.validate(c,R(n,String(u),t,c));if(Object(M.isLeft)(a))$(o,a.left);else{var s=a.right;s!==c&&(i===e&&(i=e.slice()),i[u]=s)}}return o.length>0?W(o):L(i)})},t.encode===P?P:function(e){return e.map(t.encode)},t)},st=function(t){function e(e,n,r,i,o){var u=t.call(this,e,n,r,i)||this;return u.props=o,u._tag="InterfaceType",u}return k(e,t),e}(I),lt=function(t){return Object.keys(t).map(function(e){return e+": "+t[e].name}).join(", ")},ft=function(t){for(var e=0;e<t.length;e++)if(t[e].encode!==P)return!1;return!0},pt=function(t){return"{ "+lt(t)+" }"},ht=function(t,e){void 0===e&&(e=pt(t));var n=Object.keys(t),r=n.map(function(e){return t[e]}),i=n.length;return new st(e,function(t){if(!G.is(t))return!1;for(var e=0;e<i;e++){var o=n[e];if(!rt.call(t,o)||!r[e].is(t[o]))return!1}return!0},function(t,e){return C(G.validate(t,e),function(t){for(var o=t,u=[],c=0;c<i;c++){var a=n[c];rt.call(o,a)||(o===t&&(o=z({},t)),o[a]=o[a]);var s=o[a],l=r[c],f=l.validate(s,R(e,a,l,s));if(Object(M.isLeft)(f))$(u,f.left);else{var p=f.right;p!==s&&(o===t&&(o=z({},t)),o[a]=p)}}return u.length>0?W(u):L(o)})},ft(r)?P:function(t){for(var e=z({},t),o=0;o<i;o++){var u=n[o],c=r[o].encode;c!==P&&(e[u]=c(t[u]))}return e},t)},dt=function(t){function e(e,n,r,i,o){var u=t.call(this,e,n,r,i)||this;return u.props=o,u._tag="PartialType",u}return k(e,t),e}(I),vt=function(t){return"Partial<"+t+">"},yt=function(t){function e(e,n,r,i,o,u){var c=t.call(this,e,n,r,i)||this;return c.domain=o,c.codomain=u,c._tag="DictionaryType",c}return k(e,t),e}(I),gt=function(t){return"[object Object]"===Object.prototype.toString.call(t)},mt=function(t){function e(e,n,r,i,o){var u=t.call(this,e,n,r,i)||this;return u.types=o,u._tag="UnionType",u}return k(e,t),e}(I),_t=function(t){return"("+t.map(function(t){return t.name}).join(" | ")+")"},xt=function(t,e){void 0===e&&(e=_t(t));var n=function(t){var e=It(t[0]),n=Object.keys(e),r=t.length,i=function(n){for(var i=e[n].slice(),o=[e[n]],u=1;u<r;u++){var c=t[u],a=It(c),s=a[n];if(void 0===s)return"continue-keys";if(s.some(function(t){return-1!==i.indexOf(t)}))return"continue-keys";i.push.apply(i,s),o.push(s)}return{value:[n,o]}};t:for(var o=0,u=n;o<u.length;o++){var c=u[o],a=i(c);if("object"==typeof a)return a.value;switch(a){case"continue-keys":continue t}}return}(t);if(void 0!==n&&t.length>0){var r=n[0],i=n[1],o=i.length,u=function(t){for(var e=0;e<o;e++)if(-1!==i[e].indexOf(t))return e};return new Ot(e,function(e){if(!G.is(e))return!1;var n=u(e[r]);return void 0!==n&&t[n].is(e)},function(e,n){return C(G.validate(e,n),function(i){var o=u(i[r]);if(void 0===o)return F(e,n);var c=t[o];return c.validate(i,R(n,String(o),c,i))})},ft(t)?P:function(n){var i=u(n[r]);if(void 0===i)throw new Error("no codec found to encode value in union codec "+e);return t[i].encode(n)},t,r)}return new mt(e,function(e){return t.some(function(t){return t.is(e)})},function(e,n){for(var r=[],i=0;i<t.length;i++){var o=t[i],u=o.validate(e,R(n,String(i),o,e));if(!Object(M.isLeft)(u))return L(u.right);$(r,u.left)}return W(r)},ft(t)?P:function(n){for(var r=0,i=t;r<i.length;r++){var o=i[r];if(o.is(n))return o.encode(n)}throw new Error("no codec found to encode value in union type "+e)},t)},bt=function(t){function e(e,n,r,i,o){var u=t.call(this,e,n,r,i)||this;return u.types=o,u._tag="IntersectionType",u}return k(e,t),e}(I),wt=function(t,e){for(var n=t,r=0;r<e.length;r++){var i=e[r];if(i!==t){if(n===t){n=Object.assign({},i);continue}for(var o in i)i[o]===t[o]&&n.hasOwnProperty(o)||(n[o]=i[o])}}return n};function St(t,e){void 0===e&&(e="("+t.map(function(t){return t.name}).join(" & ")+")");var n=t.length;return new bt(e,function(e){return t.every(function(t){return t.is(e)})},0===t.length?L:function(e,r){for(var i=[],o=[],u=0;u<n;u++){var c=t[u],a=c.validate(e,R(r,String(u),c,e));Object(M.isLeft)(a)?$(o,a.left):i.push(a.right)}return o.length>0?W(o):L(wt(e,i))},0===t.length?P:function(e){return wt(e,t.map(function(t){return t.encode(e)}))},t)}var jt=function(t){function e(e,n,r,i,o){var u=t.call(this,e,n,r,i)||this;return u.types=o,u._tag="TupleType",u}return k(e,t),e}(I);function Tt(t,e){void 0===e&&(e="["+t.map(function(t){return t.name}).join(", ")+"]");var n=t.length;return new jt(e,function(e){return X.is(e)&&e.length===n&&t.every(function(t,n){return t.is(e[n])})},function(e,r){return C(X.validate(e,r),function(e){for(var i=e.length>n?e.slice(0,n):e,o=[],u=0;u<n;u++){var c=e[u],a=t[u],s=a.validate(c,R(r,String(u),a,c));if(Object(M.isLeft)(s))$(o,s.left);else{var l=s.right;l!==c&&(i===e&&(i=e.slice()),i[u]=l)}}return o.length>0?W(o):L(i)})},ft(t)?P:function(e){return t.map(function(t,n){return t.encode(e[n])})},t)}(function(t){function e(e,n,r,i,o){var u=t.call(this,e,n,r,i)||this;return u.type=o,u._tag="ReadonlyType",u}k(e,t)})(I),function(t){function e(e,n,r,i,o){var u=t.call(this,e,n,r,i)||this;return u.type=o,u._tag="ReadonlyArrayType",u}k(e,t)}(I);var Ot=function(t){function e(e,n,r,i,o,u){var c=t.call(this,e,n,r,i,o)||this;return c.tag=u,c}return k(e,t),e}(mt);(function(t){function e(e,n,r,i,o){var u=t.call(this,e,n,r,i)||this;return u.type=o,u._tag="ExactType",u}k(e,t)})(I),new(function(t){function e(){var e=t.call(this,"never",function(t){return!1},function(t,e){return F(t,e)},function(){throw new Error("cannot encode never")})||this;return e._tag="NeverType",e}return k(e,t),e}(I)),new(function(t){function e(){var e=t.call(this,"any",function(t){return!0},L,P)||this;return e._tag="AnyType",e}return k(e,t),e}(I)),new(function(t){function e(){var e=t.call(this,"object",G.is,G.validate,P)||this;return e._tag="ObjectType",e}return k(e,t),e}(I));function Nt(t,e,n){return void 0===n&&(n="("+t.name+" | "+V(e)+")"),new Z(n,function(n){return t.is(n)&&e(n)},function(n,r){return C(t.validate(n,r),function(t){return e(t)?L(t):F(t,r)})},t.encode,t,e)}Nt(K,Number.isInteger,"Integer");var At=function(t,e,n){return void 0===n&&(n="{ [K in "+t.name+"]: "+e.name+" }"),new yt(n,function(n){return!!G.is(n)&&!!(B(e)||D(e)||gt(n))&&Object.keys(n).every(function(r){return t.is(r)&&e.is(n[r])})},function(n,r){return C(G.validate(n,r),function(i){if(!B(e)&&!D(e)&&!gt(i))return F(n,r);for(var o={},u=[],c=Object.keys(i),a=c.length,s=!1,l=0;l<a;l++){var f=c[l],p=i[f],h=t.validate(f,R(r,f,t,f));if(Object(M.isLeft)(h))$(u,h.left);else{var d=h.right;s=s||d!==f,f=d;var v=e.validate(p,R(r,f,e,p));if(Object(M.isLeft)(v))$(u,v.left);else{var y=v.right;s=s||y!==p,o[f]=y}}}return u.length>0?W(u):L(s?o:i)})},t.encode===P&&e.encode===P?P:function(n){for(var r={},i=Object.keys(n),o=i.length,u=0;u<o;u++){var c=i[u];r[String(t.encode(c))]=e.encode(n[c])}return r},t,e)};!function(t){function e(e,n,r,i,o){var u=t.call(this,e,n,r,i)||this;return u.props=o,u._tag="StrictType",u}k(e,t)}(I);var Et=function(t){return t.length>0},Mt={};function kt(t,e){for(var n=[],r=0,i=t;r<i.length;r++){var o=i[r];-1!==e.indexOf(o)&&n.push(o)}return n}function zt(t){return"LiteralType"===t._tag}var Ct=null;function It(t){if(t===Ct)return Mt;if(function(t){return"InterfaceType"===t._tag}(t)||function(t){return"StrictType"===t._tag}(t)){var e=Mt;for(var n in t.props){var r=t.props[n];zt(r)&&(e===Mt&&(e={}),e[n]=[r.value])}return e}if(function(t){return"ExactType"===t._tag}(t)||function(t){return"RefinementType"===t._tag}(t))return It(t.type);if(function(t){return"IntersectionType"===t._tag}(t))return t.types.reduce(function(t,e){return function(t,e){if(t===Mt)return e;if(e===Mt)return t;var n=Object.assign({},t);for(var r in e)if(t.hasOwnProperty(r)){var i=kt(t[r],e[r]);if(!Et(i)){n=Mt;break}n[r]=i}else n[r]=e[r];return n}(t,It(e))},Mt);if(function(t){return"UnionType"===t._tag}(t))return t.types.slice(1).reduce(function(t,e){return function(t,e){if(t===Mt||e===Mt)return Mt;var n=Mt;for(var r in t)e.hasOwnProperty(r)&&0===kt(t[r],e[r]).length&&(n===Mt&&(n={}),n[r]=t[r].concat(e[r]));return n}(t,It(e))},It(t.types[0]));if(function(t){return"RecursiveType"===t._tag}(t)){Ct=t;var i=It(t.type);return Ct=null,i}return Mt}var Pt=xt([et("arxe"),et("sorn")]),Vt=it({dia:null,vio:null,lis:null,gil:null,ful:null,dyu:null,mel:null,ral:null,zan:null,pal:null,mik:null,fav:null,ruj:null,ser:null}),Rt=it({rav:null,tan:null,lin:null,rez:null,jil:null,din:null,ket:null,len:null,lax:null,nen:null,pin:null,mat:null,kun:null,mir:null}),Wt=et("tem"),Ft=xt([Vt,Rt,Wt]),Lt=it({pal:null,ful:null,mik:null,fav:null,zan:null,gil:null,ruj:null,tan:null,jil:null,lax:null,mat:null,kun:null,rez:null,din:null,tem:null});function $t(t){return Tt([t,t,t,t,t,t,t])}var Ut=ht({sast:Pt,arxe:ht({txifol:at(Rt),evol:xt([q,Rt])}),sorn:ht({txifol:at(Vt),evol:xt([q,Vt])}),ele:$t($t(xt([q,Ft]))),korol:at(Lt)});var Bt=xt([et(0),et(1),et(2),et(3),et(4),et(5),et(6)]),Dt=ht({alsia:Bt,soom:Bt}),qt=ht({i:Dt,a:Dt}),Ht=xt([ht({pit:et("leim"),luul:Tt([qt])}),ht({pit:et("okke"),luul:Tt([qt,qt])}),ht({pit:et("kor"),ka:Dt}),ht({pit:et("ev"),evol:xt([Vt,Rt])}),ht({pit:et("sed")})]),Jt=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),u=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)u.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return u};var Kt=function(t,e){void 0===e&&(e=vt(pt(t)));var n=Object.keys(t),r=n.map(function(e){return t[e]}),i=n.length;return new dt(e,function(e){if(!G.is(e))return!1;for(var r=0;r<i;r++){var o=n[r],u=e[o];if(void 0!==u&&!t[o].is(u))return!1}return!0},function(e,r){return C(G.validate(e,r),function(e){for(var o=e,u=[],c=0;c<i;c++){var a=n[c],s=o[a],l=t[a],f=l.validate(s,R(r,a,l,s));if(Object(M.isLeft)(f))void 0!==s&&$(u,f.left);else{var p=f.right;p!==s&&(o===e&&(o=z({},e)),o[a]=p)}}return u.length>0?W(u):L(o)})},ft(r)?P:function(t){for(var e=z({},t),o=0;o<i;o++){var u=n[o],c=t[u];void 0!==c&&(e[u]=r[o].encode(c))}return e},t)}({im:Q(J,function(t){return function(t){var e=t.match(/^(\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])T(?:[01][0-9]|2[0-3]):(?:[0-5][0-9]):(?:[0-5][0-9]|60)(?:\.[0-9]+)?(?:Z|(?:\+|-)(?:[01][0-9]|2[0-3]):[0-5][0-9])$/i);if(null===e)return!1;var n=Jt(e.map(Number),4),r=n[1],i=n[2],o=n[3];return new Date(r,i-1,o).getDate()===o}(t)},"DateTimeString"),oprens:J}),Xt=St([Kt,xt([ht({pit:xt([et("xeltsoldes"),et("teomsast")]),vastan:Pt}),ht({pit:et("artansoldes"),vastan:Pt,ito:xt([et(0),et(1),et(2),et(3),et(4)])}),ht({pit:et("daim")})])]),Gt=ut("NonRootNode",function(){return St([Kt,ht({ov:Ht,slax:Ut,mit:at(Zt)})])}),Zt=ut("Variation",function(){return ht({fixt:Xt,seslax:at(Gt)})}),Qt=xt([et(0),Q(Y,function(t){return 0<=t&&t<=2147483647},"FalaType")]),Yt=St([Kt,ht({fala:Qt,slax:Ut,mit:at(Zt)})]);ht({aptex:At(J,xt([J,H])),kit:Yt,fixt:Xt,seslax:at(Gt)});function*te(t,e,n){yield m({value:t,color:Wt.is(t)?"#000":Vt.is(t)?"#55d":"#d55",rotate:n,virtualArea:e,virtualFontSize:1})}function*ee(t){yield m({value:"###",color:"#f00",rotate:0,virtualArea:t,virtualFontSize:1,fontFamily:o})}const ne=1/Math.sqrt(2),re=h((2-ne)/2),ie={x:0,y:1},oe={x:22,y:13},ue=t=>(function({color:t,virtualArea:e}){return n=>{const r=y(n.canvasSize),i=_(e,h(r));n.canvasContext.fillStyle=t,g(n.canvasContext,{center:n.options.reversed?s(n.canvasSize,i.center):i.center,rotate:Math.PI/4,scale:l(v(n.canvasSize),1/r)}),n.canvasContext.fillRect(i.leftTop.x,i.leftTop.y,i.size.x,i.size.y)}})({color:"#000",virtualArea:{leftTop:a(t,re),size:h(ne)}});const ce={txifol:function*(){for(let t=0;t<7;t++)yield{x:2,y:3+12/7*t,i:t};for(let t=0;t<7;t++)yield{x:0,y:3+12/7*t,i:t+7}},evol:{x:2,y:1}},ae={txifol:function*(){for(let t=0;t<7;t++)yield{x:20,y:13-12/7*(t+1),i:t};for(let t=0;t<7;t++)yield{x:22,y:13-12/7*(t+1),i:t+7}},evol:{x:20,y:13}},se={x:2,y:12/7};function*le({txifol:t,evol:e},n){for(const{x:e,y:r,i:i}of n.txifol())t[i]&&(yield*te(t[i],{leftTop:{x:e,y:r},size:se},0));e&&(yield*te(e,{leftTop:n.evol,size:{x:2,y:2}},0))}function*fe(t){for(const{leftTop:e,index:n}of w()){const r=t.ele[n.y][n.x];if(null===r)continue;const i=t.korol.find(t=>t===r)?Math.PI/2:0;yield*te(r,{leftTop:e,size:{x:2,y:2}},i)}yield*function*(t){yield*le(t,ce)}(t.sorn),yield*function*(t){yield*le(t,ae)}(t.arxe),yield*function*(t){"arxe"===t?yield ue(oe):yield ue(ie)}(t.sast)}const pe=[...function*(){for(const{leftTop:t}of w())yield*ee({leftTop:t,size:{x:2,y:2}});yield*function*(){for(const t of ce.txifol())yield*ee({leftTop:t,size:se});for(const t of ae.txifol())yield*ee({leftTop:t,size:se});yield*ee({leftTop:ce.evol,size:{x:2,y:2}}),yield*ee({leftTop:ae.evol,size:{x:2,y:2}})}(),yield*function*(){yield*ee({leftTop:ie,size:{x:2,y:2}}),yield*ee({leftTop:oe,size:{x:2,y:2}})}()}()];
/**
 * @license
 * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
 * This code may only be used under the BSD style license found at
 * http://polymer.github.io/LICENSE.txt
 * The complete set of authors may be found at
 * http://polymer.github.io/AUTHORS.txt
 * The complete set of contributors may be found at
 * http://polymer.github.io/CONTRIBUTORS.txt
 * Code distributed by Google as part of the polymer project is also
 * subject to an additional IP rights grant found at
 * http://polymer.github.io/PATENTS.txt
 */
const he=void 0!==window.customElements&&void 0!==window.customElements.polyfillWrapFlushCallback,de=(t,e,n=null)=>{for(;e!==n;){const n=e.nextSibling;t.removeChild(e),e=n}},ve=`{{lit-${String(Math.random()).slice(2)}}}`,ye=`\x3c!--${ve}--\x3e`,ge=new RegExp(`${ve}|${ye}`),me="$lit$";class _e{constructor(t,e){this.parts=[],this.element=e;const n=[],r=[],i=document.createTreeWalker(e.content,133,null,!1);let o=0,u=-1,c=0;const{strings:a,values:{length:s}}=t;for(;c<s;){const t=i.nextNode();if(null!==t){if(u++,1===t.nodeType){if(t.hasAttributes()){const e=t.attributes,{length:n}=e;let r=0;for(let t=0;t<n;t++)xe(e[t].name,me)&&r++;for(;r-- >0;){const e=a[c],n=Se.exec(e)[2],r=n.toLowerCase()+me,i=t.getAttribute(r);t.removeAttribute(r);const o=i.split(ge);this.parts.push({type:"attribute",index:u,name:n,strings:o}),c+=o.length-1}}"TEMPLATE"===t.tagName&&(r.push(t),i.currentNode=t.content)}else if(3===t.nodeType){const e=t.data;if(e.indexOf(ve)>=0){const r=t.parentNode,i=e.split(ge),o=i.length-1;for(let e=0;e<o;e++){let n,o=i[e];if(""===o)n=we();else{const t=Se.exec(o);null!==t&&xe(t[2],me)&&(o=o.slice(0,t.index)+t[1]+t[2].slice(0,-me.length)+t[3]),n=document.createTextNode(o)}r.insertBefore(n,t),this.parts.push({type:"node",index:++u})}""===i[o]?(r.insertBefore(we(),t),n.push(t)):t.data=i[o],c+=o}}else if(8===t.nodeType)if(t.data===ve){const e=t.parentNode;null!==t.previousSibling&&u!==o||(u++,e.insertBefore(we(),t)),o=u,this.parts.push({type:"node",index:u}),null===t.nextSibling?t.data="":(n.push(t),u--),c++}else{let e=-1;for(;-1!==(e=t.data.indexOf(ve,e+1));)this.parts.push({type:"node",index:-1}),c++}}else i.currentNode=r.pop()}for(const t of n)t.parentNode.removeChild(t)}}const xe=(t,e)=>{const n=t.length-e.length;return n>=0&&t.slice(n)===e},be=t=>-1!==t.index,we=()=>document.createComment(""),Se=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=\/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/,je=133;function Te(t,e){const{element:{content:n},parts:r}=t,i=document.createTreeWalker(n,je,null,!1);let o=Ne(r),u=r[o],c=-1,a=0;const s=[];let l=null;for(;i.nextNode();){c++;const t=i.currentNode;for(t.previousSibling===l&&(l=null),e.has(t)&&(s.push(t),null===l&&(l=t)),null!==l&&a++;void 0!==u&&u.index===c;)u.index=null!==l?-1:u.index-a,u=r[o=Ne(r,o)]}s.forEach(t=>t.parentNode.removeChild(t))}const Oe=t=>{let e=11===t.nodeType?0:1;const n=document.createTreeWalker(t,je,null,!1);for(;n.nextNode();)e++;return e},Ne=(t,e=-1)=>{for(let n=e+1;n<t.length;n++){const e=t[n];if(be(e))return n}return-1};
/**
 * @license
 * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
 * This code may only be used under the BSD style license found at
 * http://polymer.github.io/LICENSE.txt
 * The complete set of authors may be found at
 * http://polymer.github.io/AUTHORS.txt
 * The complete set of contributors may be found at
 * http://polymer.github.io/CONTRIBUTORS.txt
 * Code distributed by Google as part of the polymer project is also
 * subject to an additional IP rights grant found at
 * http://polymer.github.io/PATENTS.txt
 */
const Ae=new WeakMap,Ee=t=>"function"==typeof t&&Ae.has(t),Me={},ke={};
/**
 * @license
 * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
 * This code may only be used under the BSD style license found at
 * http://polymer.github.io/LICENSE.txt
 * The complete set of authors may be found at
 * http://polymer.github.io/AUTHORS.txt
 * The complete set of contributors may be found at
 * http://polymer.github.io/CONTRIBUTORS.txt
 * Code distributed by Google as part of the polymer project is also
 * subject to an additional IP rights grant found at
 * http://polymer.github.io/PATENTS.txt
 */
class ze{constructor(t,e,n){this.__parts=[],this.template=t,this.processor=e,this.options=n}update(t){let e=0;for(const n of this.__parts)void 0!==n&&n.setValue(t[e]),e++;for(const t of this.__parts)void 0!==t&&t.commit()}_clone(){const t=he?this.template.element.content.cloneNode(!0):document.importNode(this.template.element.content,!0),e=[],n=this.template.parts,r=document.createTreeWalker(t,133,null,!1);let i,o=0,u=0,c=r.nextNode();for(;o<n.length;)if(i=n[o],be(i)){for(;u<i.index;)u++,"TEMPLATE"===c.nodeName&&(e.push(c),r.currentNode=c.content),null===(c=r.nextNode())&&(r.currentNode=e.pop(),c=r.nextNode());if("node"===i.type){const t=this.processor.handleTextExpression(this.options);t.insertAfterNode(c.previousSibling),this.__parts.push(t)}else this.__parts.push(...this.processor.handleAttributeExpressions(c,i.name,i.strings,this.options));o++}else this.__parts.push(void 0),o++;return he&&(document.adoptNode(t),customElements.upgrade(t)),t}}
/**
 * @license
 * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
 * This code may only be used under the BSD style license found at
 * http://polymer.github.io/LICENSE.txt
 * The complete set of authors may be found at
 * http://polymer.github.io/AUTHORS.txt
 * The complete set of contributors may be found at
 * http://polymer.github.io/CONTRIBUTORS.txt
 * Code distributed by Google as part of the polymer project is also
 * subject to an additional IP rights grant found at
 * http://polymer.github.io/PATENTS.txt
 */class Ce{constructor(t,e,n,r){this.strings=t,this.values=e,this.type=n,this.processor=r}getHTML(){const t=this.strings.length-1;let e="",n=!1;for(let r=0;r<t;r++){const t=this.strings[r],i=t.lastIndexOf("\x3c!--");n=(i>-1||n)&&-1===t.indexOf("--\x3e",i+1);const o=Se.exec(t);e+=null===o?t+(n?ve:ye):t.substr(0,o.index)+o[1]+o[2]+me+o[3]+ve}return e+=this.strings[t]}getTemplateElement(){const t=document.createElement("template");return t.innerHTML=this.getHTML(),t}}
/**
 * @license
 * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
 * This code may only be used under the BSD style license found at
 * http://polymer.github.io/LICENSE.txt
 * The complete set of authors may be found at
 * http://polymer.github.io/AUTHORS.txt
 * The complete set of contributors may be found at
 * http://polymer.github.io/CONTRIBUTORS.txt
 * Code distributed by Google as part of the polymer project is also
 * subject to an additional IP rights grant found at
 * http://polymer.github.io/PATENTS.txt
 */
const Ie=t=>null===t||!("object"==typeof t||"function"==typeof t),Pe=t=>Array.isArray(t)||!(!t||!t[Symbol.iterator]);class Ve{constructor(t,e,n){this.dirty=!0,this.element=t,this.name=e,this.strings=n,this.parts=[];for(let t=0;t<n.length-1;t++)this.parts[t]=this._createPart()}_createPart(){return new Re(this)}_getValue(){const t=this.strings,e=t.length-1;let n="";for(let r=0;r<e;r++){n+=t[r];const e=this.parts[r];if(void 0!==e){const t=e.value;if(Ie(t)||!Pe(t))n+="string"==typeof t?t:String(t);else for(const e of t)n+="string"==typeof e?e:String(e)}}return n+=t[e]}commit(){this.dirty&&(this.dirty=!1,this.element.setAttribute(this.name,this._getValue()))}}class Re{constructor(t){this.value=void 0,this.committer=t}setValue(t){t===Me||Ie(t)&&t===this.value||(this.value=t,Ee(t)||(this.committer.dirty=!0))}commit(){for(;Ee(this.value);){const t=this.value;this.value=Me,t(this)}this.value!==Me&&this.committer.commit()}}class We{constructor(t){this.value=void 0,this.__pendingValue=void 0,this.options=t}appendInto(t){this.startNode=t.appendChild(we()),this.endNode=t.appendChild(we())}insertAfterNode(t){this.startNode=t,this.endNode=t.nextSibling}appendIntoPart(t){t.__insert(this.startNode=we()),t.__insert(this.endNode=we())}insertAfterPart(t){t.__insert(this.startNode=we()),this.endNode=t.endNode,t.endNode=this.startNode}setValue(t){this.__pendingValue=t}commit(){for(;Ee(this.__pendingValue);){const t=this.__pendingValue;this.__pendingValue=Me,t(this)}const t=this.__pendingValue;t!==Me&&(Ie(t)?t!==this.value&&this.__commitText(t):t instanceof Ce?this.__commitTemplateResult(t):t instanceof Node?this.__commitNode(t):Pe(t)?this.__commitIterable(t):t===ke?(this.value=ke,this.clear()):this.__commitText(t))}__insert(t){this.endNode.parentNode.insertBefore(t,this.endNode)}__commitNode(t){this.value!==t&&(this.clear(),this.__insert(t),this.value=t)}__commitText(t){const e=this.startNode.nextSibling,n="string"==typeof(t=null==t?"":t)?t:String(t);e===this.endNode.previousSibling&&3===e.nodeType?e.data=n:this.__commitNode(document.createTextNode(n)),this.value=t}__commitTemplateResult(t){const e=this.options.templateFactory(t);if(this.value instanceof ze&&this.value.template===e)this.value.update(t.values);else{const n=new ze(e,t.processor,this.options),r=n._clone();n.update(t.values),this.__commitNode(r),this.value=n}}__commitIterable(t){Array.isArray(this.value)||(this.value=[],this.clear());const e=this.value;let n,r=0;for(const i of t)void 0===(n=e[r])&&(n=new We(this.options),e.push(n),0===r?n.appendIntoPart(this):n.insertAfterPart(e[r-1])),n.setValue(i),n.commit(),r++;r<e.length&&(e.length=r,this.clear(n&&n.endNode))}clear(t=this.startNode){de(this.startNode.parentNode,t.nextSibling,this.endNode)}}class Fe{constructor(t,e,n){if(this.value=void 0,this.__pendingValue=void 0,2!==n.length||""!==n[0]||""!==n[1])throw new Error("Boolean attributes can only contain a single expression");this.element=t,this.name=e,this.strings=n}setValue(t){this.__pendingValue=t}commit(){for(;Ee(this.__pendingValue);){const t=this.__pendingValue;this.__pendingValue=Me,t(this)}if(this.__pendingValue===Me)return;const t=!!this.__pendingValue;this.value!==t&&(t?this.element.setAttribute(this.name,""):this.element.removeAttribute(this.name),this.value=t),this.__pendingValue=Me}}class Le extends Ve{constructor(t,e,n){super(t,e,n),this.single=2===n.length&&""===n[0]&&""===n[1]}_createPart(){return new $e(this)}_getValue(){return this.single?this.parts[0].value:super._getValue()}commit(){this.dirty&&(this.dirty=!1,this.element[this.name]=this._getValue())}}class $e extends Re{}let Ue=!1;try{const t={get capture(){return Ue=!0,!1}};window.addEventListener("test",t,t),window.removeEventListener("test",t,t)}catch(t){}class Be{constructor(t,e,n){this.value=void 0,this.__pendingValue=void 0,this.element=t,this.eventName=e,this.eventContext=n,this.__boundHandleEvent=t=>this.handleEvent(t)}setValue(t){this.__pendingValue=t}commit(){for(;Ee(this.__pendingValue);){const t=this.__pendingValue;this.__pendingValue=Me,t(this)}if(this.__pendingValue===Me)return;const t=this.__pendingValue,e=this.value,n=null==t||null!=e&&(t.capture!==e.capture||t.once!==e.once||t.passive!==e.passive),r=null!=t&&(null==e||n);n&&this.element.removeEventListener(this.eventName,this.__boundHandleEvent,this.__options),r&&(this.__options=De(t),this.element.addEventListener(this.eventName,this.__boundHandleEvent,this.__options)),this.value=t,this.__pendingValue=Me}handleEvent(t){"function"==typeof this.value?this.value.call(this.eventContext||this.element,t):this.value.handleEvent(t)}}const De=t=>t&&(Ue?{capture:t.capture,passive:t.passive,once:t.once}:t.capture);
/**
 * @license
 * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
 * This code may only be used under the BSD style license found at
 * http://polymer.github.io/LICENSE.txt
 * The complete set of authors may be found at
 * http://polymer.github.io/AUTHORS.txt
 * The complete set of contributors may be found at
 * http://polymer.github.io/CONTRIBUTORS.txt
 * Code distributed by Google as part of the polymer project is also
 * subject to an additional IP rights grant found at
 * http://polymer.github.io/PATENTS.txt
 */function qe(t){let e=He.get(t.type);void 0===e&&(e={stringsArray:new WeakMap,keyString:new Map},He.set(t.type,e));let n=e.stringsArray.get(t.strings);if(void 0!==n)return n;const r=t.strings.join(ve);return void 0===(n=e.keyString.get(r))&&(n=new _e(t,t.getTemplateElement()),e.keyString.set(r,n)),e.stringsArray.set(t.strings,n),n}const He=new Map,Je=new WeakMap;
/**
 * @license
 * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
 * This code may only be used under the BSD style license found at
 * http://polymer.github.io/LICENSE.txt
 * The complete set of authors may be found at
 * http://polymer.github.io/AUTHORS.txt
 * The complete set of contributors may be found at
 * http://polymer.github.io/CONTRIBUTORS.txt
 * Code distributed by Google as part of the polymer project is also
 * subject to an additional IP rights grant found at
 * http://polymer.github.io/PATENTS.txt
 */const Ke=new
/**
 * @license
 * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
 * This code may only be used under the BSD style license found at
 * http://polymer.github.io/LICENSE.txt
 * The complete set of authors may be found at
 * http://polymer.github.io/AUTHORS.txt
 * The complete set of contributors may be found at
 * http://polymer.github.io/CONTRIBUTORS.txt
 * Code distributed by Google as part of the polymer project is also
 * subject to an additional IP rights grant found at
 * http://polymer.github.io/PATENTS.txt
 */
class{handleAttributeExpressions(t,e,n,r){const i=e[0];return"."===i?new Le(t,e.slice(1),n).parts:"@"===i?[new Be(t,e.slice(1),r.eventContext)]:"?"===i?[new Fe(t,e.slice(1),n)]:new Ve(t,e,n).parts}handleTextExpression(t){return new We(t)}};
/**
 * @license
 * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
 * This code may only be used under the BSD style license found at
 * http://polymer.github.io/LICENSE.txt
 * The complete set of authors may be found at
 * http://polymer.github.io/AUTHORS.txt
 * The complete set of contributors may be found at
 * http://polymer.github.io/CONTRIBUTORS.txt
 * Code distributed by Google as part of the polymer project is also
 * subject to an additional IP rights grant found at
 * http://polymer.github.io/PATENTS.txt
 */
/**
 * @license
 * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
 * This code may only be used under the BSD style license found at
 * http://polymer.github.io/LICENSE.txt
 * The complete set of authors may be found at
 * http://polymer.github.io/AUTHORS.txt
 * The complete set of contributors may be found at
 * http://polymer.github.io/CONTRIBUTORS.txt
 * Code distributed by Google as part of the polymer project is also
 * subject to an additional IP rights grant found at
 * http://polymer.github.io/PATENTS.txt
 */
(window.litHtmlVersions||(window.litHtmlVersions=[])).push("1.1.1");const Xe=(t,e)=>`${t}--${e}`;let Ge=!0;void 0===window.ShadyCSS?Ge=!1:void 0===window.ShadyCSS.prepareTemplateDom&&(console.warn("Incompatible ShadyCSS version detected. Please update to at least @webcomponents/webcomponentsjs@2.0.2 and @webcomponents/shadycss@1.3.1."),Ge=!1);const Ze=t=>e=>{const n=Xe(e.type,t);let r=He.get(n);void 0===r&&(r={stringsArray:new WeakMap,keyString:new Map},He.set(n,r));let i=r.stringsArray.get(e.strings);if(void 0!==i)return i;const o=e.strings.join(ve);if(void 0===(i=r.keyString.get(o))){const n=e.getTemplateElement();Ge&&window.ShadyCSS.prepareTemplateDom(n,t),i=new _e(e,n),r.keyString.set(o,i)}return r.stringsArray.set(e.strings,i),i},Qe=["html","svg"],Ye=new Set,tn=(t,e,n)=>{Ye.add(t);const r=n?n.element:document.createElement("template"),i=e.querySelectorAll("style"),{length:o}=i;if(0===o)return void window.ShadyCSS.prepareTemplateStyles(r,t);const u=document.createElement("style");for(let t=0;t<o;t++){const e=i[t];e.parentNode.removeChild(e),u.textContent+=e.textContent}(t=>{Qe.forEach(e=>{const n=He.get(Xe(e,t));void 0!==n&&n.keyString.forEach(t=>{const{element:{content:e}}=t,n=new Set;Array.from(e.querySelectorAll("style")).forEach(t=>{n.add(t)}),Te(t,n)})})})(t);const c=r.content;n?function(t,e,n=null){const{element:{content:r},parts:i}=t;if(null==n)return void r.appendChild(e);const o=document.createTreeWalker(r,je,null,!1);let u=Ne(i),c=0,a=-1;for(;o.nextNode();)for(a++,o.currentNode===n&&(c=Oe(e),n.parentNode.insertBefore(e,n));-1!==u&&i[u].index===a;){if(c>0){for(;-1!==u;)i[u].index+=c,u=Ne(i,u);return}u=Ne(i,u)}}(n,u,c.firstChild):c.insertBefore(u,c.firstChild),window.ShadyCSS.prepareTemplateStyles(r,t);const a=c.querySelector("style");if(window.ShadyCSS.nativeShadow&&null!==a)e.insertBefore(a.cloneNode(!0),e.firstChild);else if(n){c.insertBefore(u,c.firstChild);const t=new Set;t.add(u),Te(n,t)}},en=(t,e,n)=>{if(!n||"object"!=typeof n||!n.scopeName)throw new Error("The `scopeName` option is required.");const r=n.scopeName,i=Je.has(e),o=Ge&&11===e.nodeType&&!!e.host,u=o&&!Ye.has(r),c=u?document.createDocumentFragment():e;if(((t,e,n)=>{let r=Je.get(e);void 0===r&&(de(e,e.firstChild),Je.set(e,r=new We(Object.assign({templateFactory:qe},n))),r.appendInto(e)),r.setValue(t),r.commit()})(t,c,Object.assign({templateFactory:Ze(r)},n)),u){const t=Je.get(c);Je.delete(c);const n=t.value instanceof ze?t.value.template:void 0;tn(r,c,n),de(e,e.firstChild),e.appendChild(c),Je.set(e,t)}!i&&o&&window.ShadyCSS.styleElement(e.host)},nn=((t,...e)=>new Ce(t,e,"html",Ke))`
    <style>
        :host {
            font-family: ${o};
            width: 360px;
            height: 240px;
            display: inline-block;
        }

        canvas {
            width: inherit;
            height: inherit;
        }
    </style>

    <canvas></canvas>
`;const rn=new class{constructor(){this.mapOfMap=new WeakMap}init(t,e){this.mapOfMap.set(t,e)}of(t){const e=this.mapOfMap.get(t);if(!e)throw new TypeError;return e}};e.default=class extends HTMLElement{constructor(){super();const t=function(t){if(t)try{const e=JSON.parse(t);if(Ut.is(e))return e}catch(t){return}}(this.textContent),e=this.attachShadow({mode:"open"});!function(t,e){en(nn,t,{scopeName:e})}(e,this.tagName.toLowerCase());const n=e.querySelector("canvas");if(!n)throw new Error;rn.init(this,{canvas:n}),t&&this.setState(t)}get reversed(){return this.hasAttribute("reversed")}set reversed(t){t?this.setAttribute("reversed",""):this.removeAttribute("reversed")}setState(t){rn.of(this).state=i()(t)}refresh(){const{canvas:t,state:e}=rn.of(this);t.width=Math.ceil(t.clientWidth*devicePixelRatio),t.height=Math.ceil(t.clientHeight*devicePixelRatio);const n={reversed:this.reversed,fontFamily:getComputedStyle(this).fontFamily||o};e?function(t,e,n={}){c(u(e,n),E,fe(t))}(e,t,n):function(t,e={}){c(u(t,e),E,pe)}(t,n)}}}]).default});
//# sourceMappingURL=xelto-diagram-canvas.js.map