diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..7b0a7ed --- /dev/null +++ b/.editorconfig @@ -0,0 +1,11 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true + +[*.js] +indent_style = space +indent_size = 2 diff --git a/.gitignore b/.gitignore index 5a2323a..69b6ce8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ *~ # Node +package-lock.json /build /node_modules /bower_components diff --git a/dist/flow.compat.min.js b/dist/flow.compat.min.js new file mode 100644 index 0000000..beabb5a --- /dev/null +++ b/dist/flow.compat.min.js @@ -0,0 +1,3 @@ +/*! @flowjs/flow.js 3.0.0-alpha.0 */ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).Flow=t()}(this,(function(){"use strict";function e(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function t(t){for(var r=1;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}var k="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function x(e){var t={exports:{}};return e(t,t.exports),t.exports}x((function(e){var t=function(e){var t,n=Object.prototype,i=n.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,r){return e[t]=r}}function l(e,t,r,n){var i=t&&t.prototype instanceof g?t:g,o=Object.create(i.prototype),a=new T(n||[]);return o._invoke=function(e,t,r){var n=h;return function(i,o){if(n===d)throw new Error("Generator is already running");if(n===v){if("throw"===i)throw o;return I()}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var s=E(a,r);if(s){if(s===y)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===h)throw n=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=d;var u=f(e,t,r);if("normal"===u.type){if(n=r.done?v:p,u.arg===y)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n=v,r.method="throw",r.arg=u.arg)}}}(e,r,a),o}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=l;var h="suspendedStart",p="suspendedYield",d="executing",v="completed",y={};function g(){}function b(){}function m(){}var w={};c(w,a,(function(){return this}));var k=Object.getPrototypeOf,x=k&&k(k(_([])));x&&x!==n&&i.call(x,a)&&(w=x);var O=m.prototype=g.prototype=Object.create(w);function S(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function j(e,t){function n(o,a,s,u){var c=f(e[o],e,a);if("throw"!==c.type){var l=c.arg,h=l.value;return h&&"object"===r(h)&&i.call(h,"__await")?t.resolve(h.__await).then((function(e){n("next",e,s,u)}),(function(e){n("throw",e,s,u)})):t.resolve(h).then((function(e){l.value=e,s(l)}),(function(e){return n("throw",e,s,u)}))}u(c.arg)}var o;this._invoke=function(e,r){function i(){return new t((function(t,i){n(e,r,t,i)}))}return o=o?o.then(i,i):i()}}function E(e,r){var n=e.iterator[r.method];if(n===t){if(r.delegate=null,"throw"===r.method){if(e.iterator.return&&(r.method="return",r.arg=t,E(e,r),"throw"===r.method))return y;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return y}var i=f(n,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var o=i.arg;return o?o.done?(r[e.resultName]=o.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function R(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function T(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(R,this),this.reset(!0)}function _(e){if(e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,o=function r(){for(;++n=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=i.call(a,"catchLoc"),c=i.call(a,"finallyLoc");if(u&&c){if(this.prev=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),P(r),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;P(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:_(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y}},e}(e.exports);try{regeneratorRuntime=t}catch(e){"object"===("undefined"==typeof globalThis?"undefined":r(globalThis))?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}}));var O,S,j=function(e){return e&&e.Math==Math&&e},E=j("object"==("undefined"==typeof globalThis?"undefined":r(globalThis))&&globalThis)||j("object"==("undefined"==typeof window?"undefined":r(window))&&window)||j("object"==("undefined"==typeof self?"undefined":r(self))&&self)||j("object"==r(k)&&k)||function(){return this}()||Function("return this")(),R=function(e){try{return!!e()}catch(e){return!0}},P=!R((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),T={}.propertyIsEnumerable,_=Object.getOwnPropertyDescriptor,I={f:_&&!T.call({1:2},1)?function(e){var t=_(this,e);return!!t&&t.enumerable}:T},A=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},L={}.toString,C=function(e){return L.call(e).slice(8,-1)},F="".split,N=R((function(){return!Object("z").propertyIsEnumerable(0)}))?function(e){return"String"==C(e)?F.call(e,""):Object(e)}:Object,z=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e},M=function(e){return N(z(e))},D=function(e){return"object"===r(e)?null!==e:"function"==typeof e},U=function(e){return"function"==typeof e?e:void 0},B=function(e,t){return arguments.length<2?U(E[e]):E[e]&&E[e][t]},G=B("navigator","userAgent")||"",H=E.process,q=E.Deno,$=H&&H.versions||q&&q.version,V=$&&$.v8;V?S=(O=V.split("."))[0]<4?1:O[0]+O[1]:G&&(!(O=G.match(/Edge\/(\d+)/))||O[1]>=74)&&(O=G.match(/Chrome\/(\d+)/))&&(S=O[1]);var Y=S&&+S,X=!!Object.getOwnPropertySymbols&&!R((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&Y&&Y<41})),W=X&&!Symbol.sham&&"symbol"==r(Symbol.iterator),J=W?function(e){return"symbol"==r(e)}:function(e){var t=B("Symbol");return"function"==typeof t&&Object(e)instanceof t},K=function(e,t){try{Object.defineProperty(E,e,{value:t,configurable:!0,writable:!0})}catch(r){E[e]=t}return t},Z="__core-js_shared__",Q=E[Z]||K(Z,{}),ee=x((function(e){(e.exports=function(e,t){return Q[e]||(Q[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.17.3",mode:"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"})})),te=function(e){return Object(z(e))},re={}.hasOwnProperty,ne=Object.hasOwn||function(e,t){return re.call(te(e),t)},ie=0,oe=Math.random(),ae=function(e){return"Symbol("+String(void 0===e?"":e)+")_"+(++ie+oe).toString(36)},se=ee("wks"),ue=E.Symbol,ce=W?ue:ue&&ue.withoutSetter||ae,le=function(e){return ne(se,e)&&(X||"string"==typeof se[e])||(X&&ne(ue,e)?se[e]=ue[e]:se[e]=ce("Symbol."+e)),se[e]},fe=le("toPrimitive"),he=function(e,t){if(!D(e)||J(e))return e;var r,n=e[fe];if(void 0!==n){if(void 0===t&&(t="default"),r=n.call(e,t),!D(r)||J(r))return r;throw TypeError("Can't convert object to primitive value")}return void 0===t&&(t="number"),function(e,t){var r,n;if("string"===t&&"function"==typeof(r=e.toString)&&!D(n=r.call(e)))return n;if("function"==typeof(r=e.valueOf)&&!D(n=r.call(e)))return n;if("string"!==t&&"function"==typeof(r=e.toString)&&!D(n=r.call(e)))return n;throw TypeError("Can't convert object to primitive value")}(e,t)},pe=function(e){var t=he(e,"string");return J(t)?t:String(t)},de=E.document,ve=D(de)&&D(de.createElement),ye=function(e){return ve?de.createElement(e):{}},ge=!P&&!R((function(){return 7!=Object.defineProperty(ye("div"),"a",{get:function(){return 7}}).a})),be=Object.getOwnPropertyDescriptor,me={f:P?be:function(e,t){if(e=M(e),t=pe(t),ge)try{return be(e,t)}catch(e){}if(ne(e,t))return A(!I.f.call(e,t),e[t])}},we=function(e){if(!D(e))throw TypeError(String(e)+" is not an object");return e},ke=Object.defineProperty,xe={f:P?ke:function(e,t,r){if(we(e),t=pe(t),we(r),ge)try{return ke(e,t,r)}catch(e){}if("get"in r||"set"in r)throw TypeError("Accessors not supported");return"value"in r&&(e[t]=r.value),e}},Oe=P?function(e,t,r){return xe.f(e,t,A(1,r))}:function(e,t,r){return e[t]=r,e},Se=Function.toString;"function"!=typeof Q.inspectSource&&(Q.inspectSource=function(e){return Se.call(e)});var je,Ee,Re,Pe=Q.inspectSource,Te=E.WeakMap,_e="function"==typeof Te&&/native code/.test(Pe(Te)),Ie=ee("keys"),Ae=function(e){return Ie[e]||(Ie[e]=ae(e))},Le={},Ce="Object already initialized",Fe=E.WeakMap;if(_e||Q.state){var Ne=Q.state||(Q.state=new Fe),ze=Ne.get,Me=Ne.has,De=Ne.set;je=function(e,t){if(Me.call(Ne,e))throw new TypeError(Ce);return t.facade=e,De.call(Ne,e,t),t},Ee=function(e){return ze.call(Ne,e)||{}},Re=function(e){return Me.call(Ne,e)}}else{var Ue=Ae("state");Le[Ue]=!0,je=function(e,t){if(ne(e,Ue))throw new TypeError(Ce);return t.facade=e,Oe(e,Ue,t),t},Ee=function(e){return ne(e,Ue)?e[Ue]:{}},Re=function(e){return ne(e,Ue)}}var Be={set:je,get:Ee,has:Re,enforce:function(e){return Re(e)?Ee(e):je(e,{})},getterFor:function(e){return function(t){var r;if(!D(t)||(r=Ee(t)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return r}}},Ge=x((function(e){var t=Be.get,r=Be.enforce,n=String(String).split("String");(e.exports=function(e,t,i,o){var a,s=!!o&&!!o.unsafe,u=!!o&&!!o.enumerable,c=!!o&&!!o.noTargetGet;"function"==typeof i&&("string"!=typeof t||ne(i,"name")||Oe(i,"name",t),(a=r(i)).source||(a.source=n.join("string"==typeof t?t:""))),e!==E?(s?!c&&e[t]&&(u=!0):delete e[t],u?e[t]=i:Oe(e,t,i)):u?e[t]=i:K(t,i)})(Function.prototype,"toString",(function(){return"function"==typeof this&&t(this).source||Pe(this)}))})),He=Math.ceil,qe=Math.floor,$e=function(e){return isNaN(e=+e)?0:(e>0?qe:He)(e)},Ve=Math.min,Ye=function(e){return e>0?Ve($e(e),9007199254740991):0},Xe=Math.max,We=Math.min,Je=function(e,t){var r=$e(e);return r<0?Xe(r+t,0):We(r,t)},Ke=function(e){return function(t,r,n){var i,o=M(t),a=Ye(o.length),s=Je(n,a);if(e&&r!=r){for(;a>s;)if((i=o[s++])!=i)return!0}else for(;a>s;s++)if((e||s in o)&&o[s]===r)return e||s||0;return!e&&-1}},Ze={includes:Ke(!0),indexOf:Ke(!1)},Qe=Ze.indexOf,et=function(e,t){var r,n=M(e),i=0,o=[];for(r in n)!ne(Le,r)&&ne(n,r)&&o.push(r);for(;t.length>i;)ne(n,r=t[i++])&&(~Qe(o,r)||o.push(r));return o},tt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],rt=tt.concat("length","prototype"),nt={f:Object.getOwnPropertyNames||function(e){return et(e,rt)}},it={f:Object.getOwnPropertySymbols},ot=B("Reflect","ownKeys")||function(e){var t=nt.f(we(e)),r=it.f;return r?t.concat(r(e)):t},at=function(e,t){for(var r=ot(t),n=xe.f,i=me.f,o=0;oi;)for(var s,u=N(arguments[i++]),c=o?yt(u).concat(o(u)):yt(u),l=c.length,f=0;l>f;)s=c[f++],P&&!a.call(u,s)||(r[s]=u[s]);return r}:gt;vt({target:"Object",stat:!0,forced:Object.assign!==mt},{assign:mt});var wt=xe.f,kt=Function.prototype,xt=kt.toString,Ot=/^\s*function ([^ (]*)/,St="name";P&&!(St in kt)&&wt(kt,St,{configurable:!0,get:function(){try{return xt.call(this).match(Ot)[1]}catch(e){return""}}});var jt,Et=function(e){if(J(e))throw TypeError("Cannot convert a Symbol value to a string");return String(e)},Rt=function(){var e=we(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t},Pt=E.RegExp,Tt={UNSUPPORTED_Y:R((function(){var e=Pt("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),BROKEN_CARET:R((function(){var e=Pt("^r","gy");return e.lastIndex=2,null!=e.exec("str")}))},_t=P?Object.defineProperties:function(e,t){we(e);for(var r,n=yt(t),i=n.length,o=0;i>o;)xe.f(e,r=n[o++],t[r]);return e},It=B("document","documentElement"),At=Ae("IE_PROTO"),Lt=function(){},Ct=function(e){return"