├── benches ├── babel │ └── out │ │ ├── babel.tree │ │ ├── babel.grammar │ │ ├── babel.strings │ │ └── babel.binjs ├── d3 │ └── out │ │ ├── d3.v5.grammar │ │ ├── d3.v5.strings │ │ ├── d3.v5.tree │ │ └── d3.v5.binjs ├── test │ ├── out │ │ ├── test.tree │ │ ├── test.grammar │ │ ├── test.strings │ │ ├── test.js │ │ └── test.binjs │ └── test.js ├── angular │ └── out │ │ ├── angular.tree │ │ ├── angular.grammar │ │ ├── angular.strings │ │ └── angular.binjs ├── wabtjs │ └── out │ │ ├── index.grammar │ │ ├── index.strings │ │ ├── index.tree │ │ └── index.binjs ├── backbone │ ├── out │ │ ├── backbone-min.tree │ │ ├── backbone-min.grammar │ │ ├── backbone-min.strings │ │ ├── backbone-min.binjs │ │ └── backbone-min.js │ └── backbone-min.js ├── fuzzball │ ├── out │ │ ├── fuzzball@1.2.tree │ │ ├── fuzzball@1.2.grammar │ │ ├── fuzzball@1.2.strings │ │ ├── fuzzball@1.2.binjs │ │ └── fuzzball@1.2.js │ └── fuzzball@1.2.0.js └── react │ ├── out │ ├── react.production.grammar │ ├── react.production.strings │ ├── react.production.tree │ ├── react.production.binjs │ └── react.production.js │ └── react.production.min.js ├── README.md ├── .github └── workflows │ └── semgrep.yml ├── test.js └── Makefile /benches/babel/out/babel.tree: -------------------------------------------------------------------------------- 1 | identity; -------------------------------------------------------------------------------- /benches/d3/out/d3.v5.grammar: -------------------------------------------------------------------------------- 1 | identity; -------------------------------------------------------------------------------- /benches/d3/out/d3.v5.strings: -------------------------------------------------------------------------------- 1 | identity; -------------------------------------------------------------------------------- /benches/d3/out/d3.v5.tree: -------------------------------------------------------------------------------- 1 | identity; -------------------------------------------------------------------------------- /benches/test/out/test.tree: -------------------------------------------------------------------------------- 1 | identity; -------------------------------------------------------------------------------- /benches/angular/out/angular.tree: -------------------------------------------------------------------------------- 1 | identity; -------------------------------------------------------------------------------- /benches/babel/out/babel.grammar: -------------------------------------------------------------------------------- 1 | identity; -------------------------------------------------------------------------------- /benches/babel/out/babel.strings: -------------------------------------------------------------------------------- 1 | identity; -------------------------------------------------------------------------------- /benches/test/out/test.grammar: -------------------------------------------------------------------------------- 1 | identity; -------------------------------------------------------------------------------- /benches/test/out/test.strings: -------------------------------------------------------------------------------- 1 | identity; -------------------------------------------------------------------------------- /benches/test/test.js: -------------------------------------------------------------------------------- 1 | console.log("hi"); 2 | -------------------------------------------------------------------------------- /benches/wabtjs/out/index.grammar: -------------------------------------------------------------------------------- 1 | identity; -------------------------------------------------------------------------------- /benches/wabtjs/out/index.strings: -------------------------------------------------------------------------------- 1 | identity; -------------------------------------------------------------------------------- /benches/wabtjs/out/index.tree: -------------------------------------------------------------------------------- 1 | identity; -------------------------------------------------------------------------------- /benches/angular/out/angular.grammar: -------------------------------------------------------------------------------- 1 | identity; -------------------------------------------------------------------------------- /benches/angular/out/angular.strings: -------------------------------------------------------------------------------- 1 | identity; -------------------------------------------------------------------------------- /benches/backbone/out/backbone-min.tree: -------------------------------------------------------------------------------- 1 | identity; -------------------------------------------------------------------------------- /benches/fuzzball/out/fuzzball@1.2.tree: -------------------------------------------------------------------------------- 1 | identity; -------------------------------------------------------------------------------- /benches/test/out/test.js: -------------------------------------------------------------------------------- 1 | console.log("hi"); 2 | -------------------------------------------------------------------------------- /benches/backbone/out/backbone-min.grammar: -------------------------------------------------------------------------------- 1 | identity; -------------------------------------------------------------------------------- /benches/backbone/out/backbone-min.strings: -------------------------------------------------------------------------------- 1 | identity; -------------------------------------------------------------------------------- /benches/fuzzball/out/fuzzball@1.2.grammar: -------------------------------------------------------------------------------- 1 | identity; -------------------------------------------------------------------------------- /benches/fuzzball/out/fuzzball@1.2.strings: -------------------------------------------------------------------------------- 1 | identity; -------------------------------------------------------------------------------- /benches/react/out/react.production.grammar: -------------------------------------------------------------------------------- 1 | identity; -------------------------------------------------------------------------------- /benches/react/out/react.production.strings: -------------------------------------------------------------------------------- 1 | identity; -------------------------------------------------------------------------------- /benches/react/out/react.production.tree: -------------------------------------------------------------------------------- 1 | identity; -------------------------------------------------------------------------------- /benches/d3/out/d3.v5.binjs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cloudflare/binast-benches/master/benches/d3/out/d3.v5.binjs -------------------------------------------------------------------------------- /benches/babel/out/babel.binjs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cloudflare/binast-benches/master/benches/babel/out/babel.binjs -------------------------------------------------------------------------------- /benches/wabtjs/out/index.binjs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cloudflare/binast-benches/master/benches/wabtjs/out/index.binjs -------------------------------------------------------------------------------- /benches/angular/out/angular.binjs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cloudflare/binast-benches/master/benches/angular/out/angular.binjs -------------------------------------------------------------------------------- /benches/backbone/out/backbone-min.binjs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cloudflare/binast-benches/master/benches/backbone/out/backbone-min.binjs -------------------------------------------------------------------------------- /benches/fuzzball/out/fuzzball@1.2.binjs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cloudflare/binast-benches/master/benches/fuzzball/out/fuzzball@1.2.binjs -------------------------------------------------------------------------------- /benches/react/out/react.production.binjs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cloudflare/binast-benches/master/benches/react/out/react.production.binjs -------------------------------------------------------------------------------- /benches/test/out/test.binjs: -------------------------------------------------------------------------------- 1 | BINJS[GRAMMAR]identity;2AssertedScriptGlobalScopeCallExpression&ExpressionStatement(IdentifierExpression.LiteralStringExpression Script,StaticMemberExpression[STRINGS]identity; consolehilog[TREE]identity; 2 |   -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # binast-benches 2 | 3 | ## Requirements 4 | 5 | ### `js` 6 | 7 | SpiderMonkey build (Firefox's JavaScript engine). You can find a prebuilt version here: https://download-origin.cdn.mozilla.net/pub/firefox/nightly/latest-mozilla-central/. 8 | 9 | Atlernatively you can build it from source: https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey/Build_Documentation. 10 | 11 | ### `binjs_encode` 12 | 13 | Download the source code: https://github.com/binast/binjs-ref and build a local version. 14 | 15 | ## Usage 16 | 17 | - `make encode`: encode JavaScript files 18 | - `make test`: run benchmarks 19 | -------------------------------------------------------------------------------- /.github/workflows/semgrep.yml: -------------------------------------------------------------------------------- 1 | on: 2 | pull_request: {} 3 | workflow_dispatch: {} 4 | push: 5 | branches: 6 | - main 7 | - master 8 | schedule: 9 | - cron: '0 0 * * *' 10 | name: Semgrep config 11 | jobs: 12 | semgrep: 13 | name: semgrep/ci 14 | runs-on: ubuntu-latest 15 | env: 16 | SEMGREP_APP_TOKEN: ${{ secrets.SEMGREP_APP_TOKEN }} 17 | SEMGREP_URL: https://cloudflare.semgrep.dev 18 | SEMGREP_APP_URL: https://cloudflare.semgrep.dev 19 | SEMGREP_VERSION_CHECK_URL: https://cloudflare.semgrep.dev/api/check-version 20 | container: 21 | image: semgrep/semgrep 22 | steps: 23 | - uses: actions/checkout@v4 24 | - run: semgrep ci 25 | -------------------------------------------------------------------------------- /test.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const jsfile = scriptArgs[0]; 4 | const binfile = jsfile.replace('.js', '.binjs'); 5 | 6 | const N = 100; 7 | 8 | { 9 | const s = read(jsfile); 10 | 11 | // preheat 12 | for (var i = 0; i < 10; i++) { 13 | parse(s, { allowSyntaxParser: false }); 14 | } 15 | 16 | const start = dateNow(); 17 | 18 | for (var i = 0; i < N; i++) { 19 | parse(s, { allowSyntaxParser: false }); 20 | } 21 | 22 | const end = dateNow(); 23 | const avg = (end - start) / N; 24 | 25 | console.log(jsfile, avg.toFixed(3), 'ms'); 26 | } 27 | 28 | { 29 | const b = read(binfile, 'binary').buffer; 30 | 31 | // preheat 32 | for (var i = 0; i < 10; i++) { 33 | parseBin(b); 34 | } 35 | 36 | const start = dateNow(); 37 | 38 | for (var i = 0; i < N; i++) { 39 | parseBin(b); 40 | } 41 | 42 | const end = dateNow(); 43 | const avg = (end - start) / N; 44 | 45 | console.log(binfile, avg.toFixed(3), 'ms'); 46 | } 47 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | JS = js 2 | BINJS_ENCODE = binjs_encode --inject-lazy 3 3 | 4 | encode: 5 | $(BINJS_ENCODE) --in benches/test/*.js -o benches/test/out 6 | $(BINJS_ENCODE) --in benches/react/*.js -o benches/react/out 7 | $(BINJS_ENCODE) --in benches/d3/*.js -o benches/d3/out 8 | $(BINJS_ENCODE) --in benches/angular/*.js -o benches/angular/out 9 | $(BINJS_ENCODE) --in benches/babel/*.js -o benches/babel/out 10 | $(BINJS_ENCODE) --in benches/backbone/*.js -o benches/backbone/out 11 | $(BINJS_ENCODE) --in benches/wabtjs/*.js -o benches/wabtjs/out 12 | $(BINJS_ENCODE) --in benches/fuzzball/*.js -o benches/fuzzball/out 13 | 14 | test: 15 | $(JS) test.js benches/test/out/*.js 16 | $(JS) test.js benches/react/out/*.js 17 | $(JS) test.js benches/d3/out/*.js 18 | $(JS) test.js benches/angular/out/*.js 19 | $(JS) test.js benches/babel/out/*.js 20 | $(JS) test.js benches/backbone/out/*.js 21 | $(JS) test.js benches/wabtjs/out/*.js 22 | $(JS) test.js benches/fuzzball/out/*.js 23 | -------------------------------------------------------------------------------- /benches/react/out/react.production.js: -------------------------------------------------------------------------------- 1 | /** @license React v16.8.6 2 | * react.production.min.js 3 | * 4 | * Copyright (c) Facebook, Inc. and its affiliates. 5 | * 6 | * This source code is licensed under the MIT license found in the 7 | * LICENSE file in the root directory of this source tree. 8 | */ 9 | 'use strict';(function(N,q){"object"===typeof exports&&"undefined"!==typeof module?module.exports=q():"function"===typeof define&&define.amd?define(q):N.React=q()})(this,function(){function N(a,b,d,g,p,c,e,h){if(!a){a=void 0;if(void 0===b)a=Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var n=[d,g,p,c,e,h],f=0;a=Error(b.replace(/%s/g,function(){return n[f++]}));a.name="Invariant Violation"}a.framesToPop=1; 10 | throw a;}}function q(a){for(var b=arguments.length-1,d="https://reactjs.org/docs/error-decoder.html?invariant="+a,g=0;g=b){d=a;break}a=a.next}while(a!==c);null===d?d=c:d=== 12 | c&&(c=n,u());b=d.previous;b.next=d.previous=n;n.next=d;n.previous=b}}function F(){if(-1===k&&null!==c&&1===c.priorityLevel){x=!0;try{do Q();while(null!==c&&1===c.priorityLevel)}finally{x=!1,null!==c?u():C=!1}}}function ta(a){x=!0;var b=G;G=a;try{if(a)for(;null!==c;){var d=l();if(c.expirationTime<=d){do Q();while(null!==c&&c.expirationTime<=d)}else break}else if(null!==c){do Q();while(null!==c&&!H())}}finally{x=!1,G=b,null!==c?u():C=!1,F()}}function ea(a,b,d){var g=void 0,p={},c=null,e=null;if(null!= 13 | b)for(g in void 0!==b.ref&&(e=b.ref),void 0!==b.key&&(c=""+b.key),b)fa.call(b,g)&&!ha.hasOwnProperty(g)&&(p[g]=b[g]);var h=arguments.length-2;if(1===h)p.children=d;else if(1I.length&&I.push(a)}function T(a,b,d,g){var c=typeof a;if("undefined"===c||"boolean"===c)a=null;var e=!1;if(null=== 15 | a)e=!0;else switch(c){case "string":case "number":e=!0;break;case "object":switch(a.$$typeof){case y:case wa:e=!0}}if(e)return d(g,a,""===b?"."+U(a,0):b),1;e=0;b=""===b?".":b+":";if(Array.isArray(a))for(var f=0;fa;a++)b["_"+String.fromCharCode(a)]=a;if("0123456789"!==Object.getOwnPropertyNames(b).map(function(a){return b[a]}).join(""))return!1;var d={};"abcdefghijklmnopqrst".split("").forEach(function(a){d[a]=a});return"abcdefghijklmnopqrst"!==Object.keys(Object.assign({},d)).join("")?!1:!0}catch(g){return!1}}()?Object.assign:function(a,b){if(null===a||void 0===a)throw new TypeError("Object.assign cannot be called with null or undefined");var d=Object(a);for(var c,e=1;e=L-d)if(-1!==b&&b<=d)c=!0;else{A||(A=!0,Y(aa));w=a;z=b;return}if(null!==a){Z=!0;try{a(c)}finally{Z=!1}}};var aa=function(a){if(null!==w){Y(aa);var b=a-L+B;bb&&(b=8),B=bb?sa.postMessage(void 0):A||(A=!0,Y(aa))};P=function(){w=null;K=!1;z=-1}}var Oa= 25 | 0,ma={current:null},R={current:null};e={ReactCurrentDispatcher:ma,ReactCurrentOwner:R,assign:J};J(e,{Scheduler:{unstable_cancelCallback:function(a){var b=a.next;if(null!==b){if(b===a)c=null;else{a===c&&(c=b);var d=a.previous;d.next=b;b.previous=d}a.next=a.previous=null}},unstable_shouldYield:function(){return!G&&(null!==c&&c.expirationTimeb){d=g;break}g=g.next}while(g!==c);null===d?d=c:d===c&&(c=a,u());b=d.previous;b.next=d.previous=a;a.next=d;a.previous=b}return a},unstable_runWithPriority:function(a,b){switch(a){case 1:case 2:case 3:case 4:case 5:break;default:a= 27 | 3}var d=f,c=k;f=a;k=l();try{return b()}finally{f=d,k=c,F()}},unstable_next:function(a){switch(f){case 1:case 2:case 3:var b=3;break;default:b=f}var d=f,c=k;f=b;k=l();try{return a()}finally{f=d,k=c,F()}},unstable_wrapCallback:function(a){var b=f;return function(){var d=f,c=k;f=b;k=l();try{return a.apply(this,arguments)}finally{f=d,k=c,F()}}},unstable_getFirstCallbackNode:function(){return c},unstable_pauseExecution:function(){},unstable_continueExecution:function(){null!==c&&u()},unstable_getCurrentPriorityLevel:function(){return f}, 28 | unstable_IdlePriority:5,unstable_ImmediatePriority:1,unstable_LowPriority:4,unstable_NormalPriority:3,unstable_UserBlockingPriority:2},SchedulerTracing:{__interactionsRef:null,__subscriberRef:null,unstable_clear:function(a){return a()},unstable_getCurrent:function(){return null},unstable_getThreadID:function(){return++Oa},unstable_subscribe:function(a){},unstable_trace:function(a,b,d){return d()},unstable_unsubscribe:function(a){},unstable_wrap:function(a){return a}}});var fa=Object.prototype.hasOwnProperty, 29 | ha={key:!0,ref:!0,__self:!0,__source:!0},la=/\/+/g,I=[];r={Children:{map:function(a,b,d){if(null==a)return a;var c=[];W(a,c,null,b,d);return c},forEach:function(a,b,d){if(null==a)return a;b=ia(null,null,b,d);V(a,xa,b);ja(b)},count:function(a){return V(a,function(){return null},null)},toArray:function(a){var b=[];W(a,b,null,function(a){return a});return b},only:function(a){S(a)?void 0:q("143");return a}},createRef:function(){return{current:null}},Component:t,PureComponent:O,createContext:function(a, 30 | b){void 0===b&&(b=null);a={$$typeof:Ba,_calculateChangedBits:b,_currentValue:a,_currentValue2:a,_threadCount:0,Provider:null,Consumer:null};a.Provider={$$typeof:Aa,_context:a};return a.Consumer=a},forwardRef:function(a){return{$$typeof:Da,render:a}},lazy:function(a){return{$$typeof:Ga,_ctor:a,_status:-1,_result:null}},memo:function(a,b){return{$$typeof:Fa,type:a,compare:void 0===b?null:b}},useCallback:function(a,b){return m().useCallback(a,b)},useContext:function(a,b){return m().useContext(a,b)}, 31 | useEffect:function(a,b){return m().useEffect(a,b)},useImperativeHandle:function(a,b,d){return m().useImperativeHandle(a,b,d)},useDebugValue:function(a,b){},useLayoutEffect:function(a,b){return m().useLayoutEffect(a,b)},useMemo:function(a,b){return m().useMemo(a,b)},useReducer:function(a,b,d){return m().useReducer(a,b,d)},useRef:function(a){return m().useRef(a)},useState:function(a){return m().useState(a)},Fragment:r,StrictMode:X,Suspense:Ea,createElement:ea,cloneElement:function(a,b,d){null===a|| 32 | void 0===a?q("267",a):void 0;var c=void 0,e=J({},a.props),f=a.key,k=a.ref,h=a._owner;if(null!=b){void 0!==b.ref&&(k=b.ref,h=R.current);void 0!==b.key&&(f=""+b.key);var l=void 0;a.type&&a.type.defaultProps&&(l=a.type.defaultProps);for(c in b)fa.call(b,c)&&!ha.hasOwnProperty(c)&&(e[c]=void 0===b[c]&&void 0!==l?l[c]:b[c])}c=arguments.length-2;if(1===c)e.children=d;else if(1=b){d=a;break}a=a.next}while(a!==c);null===d?d=c:d=== 12 | c&&(c=n,u());b=d.previous;b.next=d.previous=n;n.next=d;n.previous=b}}function F(){if(-1===k&&null!==c&&1===c.priorityLevel){x=!0;try{do Q();while(null!==c&&1===c.priorityLevel)}finally{x=!1,null!==c?u():C=!1}}}function ta(a){x=!0;var b=G;G=a;try{if(a)for(;null!==c;){var d=l();if(c.expirationTime<=d){do Q();while(null!==c&&c.expirationTime<=d)}else break}else if(null!==c){do Q();while(null!==c&&!H())}}finally{x=!1,G=b,null!==c?u():C=!1,F()}}function ea(a,b,d){var g=void 0,p={},c=null,e=null;if(null!= 13 | b)for(g in void 0!==b.ref&&(e=b.ref),void 0!==b.key&&(c=""+b.key),b)fa.call(b,g)&&!ha.hasOwnProperty(g)&&(p[g]=b[g]);var h=arguments.length-2;if(1===h)p.children=d;else if(1I.length&&I.push(a)}function T(a,b,d,g){var c=typeof a;if("undefined"===c||"boolean"===c)a=null;var e=!1;if(null=== 15 | a)e=!0;else switch(c){case "string":case "number":e=!0;break;case "object":switch(a.$$typeof){case y:case wa:e=!0}}if(e)return d(g,a,""===b?"."+U(a,0):b),1;e=0;b=""===b?".":b+":";if(Array.isArray(a))for(var f=0;fa;a++)b["_"+String.fromCharCode(a)]=a;if("0123456789"!==Object.getOwnPropertyNames(b).map(function(a){return b[a]}).join(""))return!1;var d={};"abcdefghijklmnopqrst".split("").forEach(function(a){d[a]=a});return"abcdefghijklmnopqrst"!==Object.keys(Object.assign({},d)).join("")?!1:!0}catch(g){return!1}}()?Object.assign:function(a,b){if(null===a||void 0===a)throw new TypeError("Object.assign cannot be called with null or undefined");var d=Object(a);for(var c,e=1;e=L-d)if(-1!==b&&b<=d)c=!0;else{A||(A=!0,Y(aa));w=a;z=b;return}if(null!==a){Z=!0;try{a(c)}finally{Z=!1}}};var aa=function(a){if(null!==w){Y(aa);var b=a-L+B;bb&&(b=8),B=bb?sa.postMessage(void 0):A||(A=!0,Y(aa))};P=function(){w=null;K=!1;z=-1}}var Oa= 25 | 0,ma={current:null},R={current:null};e={ReactCurrentDispatcher:ma,ReactCurrentOwner:R,assign:J};J(e,{Scheduler:{unstable_cancelCallback:function(a){var b=a.next;if(null!==b){if(b===a)c=null;else{a===c&&(c=b);var d=a.previous;d.next=b;b.previous=d}a.next=a.previous=null}},unstable_shouldYield:function(){return!G&&(null!==c&&c.expirationTimeb){d=g;break}g=g.next}while(g!==c);null===d?d=c:d===c&&(c=a,u());b=d.previous;b.next=d.previous=a;a.next=d;a.previous=b}return a},unstable_runWithPriority:function(a,b){switch(a){case 1:case 2:case 3:case 4:case 5:break;default:a= 27 | 3}var d=f,c=k;f=a;k=l();try{return b()}finally{f=d,k=c,F()}},unstable_next:function(a){switch(f){case 1:case 2:case 3:var b=3;break;default:b=f}var d=f,c=k;f=b;k=l();try{return a()}finally{f=d,k=c,F()}},unstable_wrapCallback:function(a){var b=f;return function(){var d=f,c=k;f=b;k=l();try{return a.apply(this,arguments)}finally{f=d,k=c,F()}}},unstable_getFirstCallbackNode:function(){return c},unstable_pauseExecution:function(){},unstable_continueExecution:function(){null!==c&&u()},unstable_getCurrentPriorityLevel:function(){return f}, 28 | unstable_IdlePriority:5,unstable_ImmediatePriority:1,unstable_LowPriority:4,unstable_NormalPriority:3,unstable_UserBlockingPriority:2},SchedulerTracing:{__interactionsRef:null,__subscriberRef:null,unstable_clear:function(a){return a()},unstable_getCurrent:function(){return null},unstable_getThreadID:function(){return++Oa},unstable_subscribe:function(a){},unstable_trace:function(a,b,d){return d()},unstable_unsubscribe:function(a){},unstable_wrap:function(a){return a}}});var fa=Object.prototype.hasOwnProperty, 29 | ha={key:!0,ref:!0,__self:!0,__source:!0},la=/\/+/g,I=[];r={Children:{map:function(a,b,d){if(null==a)return a;var c=[];W(a,c,null,b,d);return c},forEach:function(a,b,d){if(null==a)return a;b=ia(null,null,b,d);V(a,xa,b);ja(b)},count:function(a){return V(a,function(){return null},null)},toArray:function(a){var b=[];W(a,b,null,function(a){return a});return b},only:function(a){S(a)?void 0:q("143");return a}},createRef:function(){return{current:null}},Component:t,PureComponent:O,createContext:function(a, 30 | b){void 0===b&&(b=null);a={$$typeof:Ba,_calculateChangedBits:b,_currentValue:a,_currentValue2:a,_threadCount:0,Provider:null,Consumer:null};a.Provider={$$typeof:Aa,_context:a};return a.Consumer=a},forwardRef:function(a){return{$$typeof:Da,render:a}},lazy:function(a){return{$$typeof:Ga,_ctor:a,_status:-1,_result:null}},memo:function(a,b){return{$$typeof:Fa,type:a,compare:void 0===b?null:b}},useCallback:function(a,b){return m().useCallback(a,b)},useContext:function(a,b){return m().useContext(a,b)}, 31 | useEffect:function(a,b){return m().useEffect(a,b)},useImperativeHandle:function(a,b,d){return m().useImperativeHandle(a,b,d)},useDebugValue:function(a,b){},useLayoutEffect:function(a,b){return m().useLayoutEffect(a,b)},useMemo:function(a,b){return m().useMemo(a,b)},useReducer:function(a,b,d){return m().useReducer(a,b,d)},useRef:function(a){return m().useRef(a)},useState:function(a){return m().useState(a)},Fragment:r,StrictMode:X,Suspense:Ea,createElement:ea,cloneElement:function(a,b,d){null===a|| 32 | void 0===a?q("267",a):void 0;var c=void 0,e=J({},a.props),f=a.key,k=a.ref,h=a._owner;if(null!=b){void 0!==b.ref&&(k=b.ref,h=R.current);void 0!==b.key&&(f=""+b.key);var l=void 0;a.type&&a.type.defaultProps&&(l=a.type.defaultProps);for(c in b)fa.call(b,c)&&!ha.hasOwnProperty(c)&&(e[c]=void 0===b[c]&&void 0!==l?l[c]:b[c])}c=arguments.length-2;if(1===c)e.children=d;else if(1this.length)r=this.length;if(r<0)r+=this.length+1;var s=[];var a=[];var o=[];var h=[];var u={};var l=e.add;var c=e.merge;var f=e.remove;var d=false;var v=this.comparator&&r==null&&e.sort!==false;var p=i.isString(this.comparator)?this.comparator:null;var g,m;for(m=0;m7);this._useHashChange=this._wantsHashChange&&this._hasHashChange;this._wantsPushState=!!this.options.pushState;this._hasPushState=!!(this.history&&this.history.pushState);this._usePushState=this._wantsPushState&&this._hasPushState;this.fragment=this.getFragment();this.root=("/"+this.root+"/").replace(L,"/");if(this._wantsHashChange&&this._wantsPushState){if(!this._hasPushState&&!this.atRoot()){var e=this.root.slice(0,-1)||"/";this.location.replace(e+"#"+this.getPath());return true}else if(this._hasPushState&&this.atRoot()){this.navigate(this.getHash(),{replace:true})}}if(!this._hasHashChange&&this._wantsHashChange&&!this._usePushState){this.iframe=document.createElement("iframe");this.iframe.src="javascript:0";this.iframe.style.display="none";this.iframe.tabIndex=-1;var n=document.body;var r=n.insertBefore(this.iframe,n.firstChild).contentWindow;r.document.open();r.document.close();r.location.hash="#"+this.fragment}var s=window.addEventListener||function(t,e){return attachEvent("on"+t,e)};if(this._usePushState){s("popstate",this.checkUrl,false)}else if(this._useHashChange&&!this.iframe){s("hashchange",this.checkUrl,false)}else if(this._wantsHashChange){this._checkUrlInterval=setInterval(this.checkUrl,this.interval)}if(!this.options.silent)return this.loadUrl()},stop:function(){var t=window.removeEventListener||function(t,e){return detachEvent("on"+t,e)};if(this._usePushState){t("popstate",this.checkUrl,false)}else if(this._useHashChange&&!this.iframe){t("hashchange",this.checkUrl,false)}if(this.iframe){document.body.removeChild(this.iframe);this.iframe=null}if(this._checkUrlInterval)clearInterval(this._checkUrlInterval);B.started=false},route:function(t,e){this.handlers.unshift({route:t,callback:e})},checkUrl:function(t){var e=this.getFragment();if(e===this.fragment&&this.iframe){e=this.getHash(this.iframe.contentWindow)}if(e===this.fragment)return false;if(this.iframe)this.navigate(e);this.loadUrl()},loadUrl:function(t){if(!this.matchRoot())return false;t=this.fragment=this.getFragment(t);return i.some(this.handlers,function(e){if(e.route.test(t)){e.callback(t);return true}})},navigate:function(t,e){if(!B.started)return false;if(!e||e===true)e={trigger:!!e};t=this.getFragment(t||"");var i=this.root;if(t===""||t.charAt(0)==="?"){i=i.slice(0,-1)||"/"}var n=i+t;t=t.replace(W,"");var r=this.decodeFragment(t);if(this.fragment===r)return;this.fragment=r;if(this._usePushState){this.history[e.replace?"replaceState":"pushState"]({},document.title,n)}else if(this._wantsHashChange){this._updateHash(this.location,t,e.replace);if(this.iframe&&t!==this.getHash(this.iframe.contentWindow)){var s=this.iframe.contentWindow;if(!e.replace){s.document.open();s.document.close()}this._updateHash(s.location,t,e.replace)}}else{return this.location.assign(n)}if(e.trigger)return this.loadUrl(t)},_updateHash:function(t,e,i){if(i){var n=t.href.replace(/(javascript:|#).*$/,"");t.replace(n+"#"+e)}else{t.hash="#"+e}}});e.history=new B;var D=function(t,e){var n=this;var r;if(t&&i.has(t,"constructor")){r=t.constructor}else{r=function(){return n.apply(this,arguments)}}i.extend(r,n,e);r.prototype=i.create(n.prototype,t);r.prototype.constructor=r;r.__super__=n.prototype;return r};m.extend=_.extend=O.extend=T.extend=B.extend=D;var V=function(){throw new Error('A "url" property or function must be specified')};var G=function(t,e){var i=e.error;e.error=function(n){if(i)i.call(e.context,t,n,e);t.trigger("error",t,n,e)}};return e}); 2 | //# sourceMappingURL=backbone-min.map -------------------------------------------------------------------------------- /benches/backbone/out/backbone-min.js: -------------------------------------------------------------------------------- 1 | (function(t){var e=typeof self=="object"&&self.self===self&&self||typeof global=="object"&&global.global===global&&global;if(typeof define==="function"&&define.amd){define(["underscore","jquery","exports"],function(i,n,r){e.Backbone=t(e,r,i,n)})}else if(typeof exports!=="undefined"){var i=require("underscore"),n;try{n=require("jquery")}catch(r){}t(e,exports,i,n)}else{e.Backbone=t(e,{},e._,e.jQuery||e.Zepto||e.ender||e.$)}})(function(t,e,i,n){var r=t.Backbone;var s=Array.prototype.slice;e.VERSION="1.4.0";e.$=n;e.noConflict=function(){t.Backbone=r;return this};e.emulateHTTP=false;e.emulateJSON=false;var a=e.Events={};var o=/\s+/;var h;var u=function(t,e,n,r,s){var a=0,h;if(n&&typeof n==="object"){if(r!==void 0&&"context"in s&&s.context===void 0)s.context=r;for(h=i.keys(n);athis.length)r=this.length;if(r<0)r+=this.length+1;var s=[];var a=[];var o=[];var h=[];var u={};var l=e.add;var c=e.merge;var f=e.remove;var d=false;var v=this.comparator&&r==null&&e.sort!==false;var p=i.isString(this.comparator)?this.comparator:null;var g,m;for(m=0;m7);this._useHashChange=this._wantsHashChange&&this._hasHashChange;this._wantsPushState=!!this.options.pushState;this._hasPushState=!!(this.history&&this.history.pushState);this._usePushState=this._wantsPushState&&this._hasPushState;this.fragment=this.getFragment();this.root=("/"+this.root+"/").replace(L,"/");if(this._wantsHashChange&&this._wantsPushState){if(!this._hasPushState&&!this.atRoot()){var e=this.root.slice(0,-1)||"/";this.location.replace(e+"#"+this.getPath());return true}else if(this._hasPushState&&this.atRoot()){this.navigate(this.getHash(),{replace:true})}}if(!this._hasHashChange&&this._wantsHashChange&&!this._usePushState){this.iframe=document.createElement("iframe");this.iframe.src="javascript:0";this.iframe.style.display="none";this.iframe.tabIndex=-1;var n=document.body;var r=n.insertBefore(this.iframe,n.firstChild).contentWindow;r.document.open();r.document.close();r.location.hash="#"+this.fragment}var s=window.addEventListener||function(t,e){return attachEvent("on"+t,e)};if(this._usePushState){s("popstate",this.checkUrl,false)}else if(this._useHashChange&&!this.iframe){s("hashchange",this.checkUrl,false)}else if(this._wantsHashChange){this._checkUrlInterval=setInterval(this.checkUrl,this.interval)}if(!this.options.silent)return this.loadUrl()},stop:function(){var t=window.removeEventListener||function(t,e){return detachEvent("on"+t,e)};if(this._usePushState){t("popstate",this.checkUrl,false)}else if(this._useHashChange&&!this.iframe){t("hashchange",this.checkUrl,false)}if(this.iframe){document.body.removeChild(this.iframe);this.iframe=null}if(this._checkUrlInterval)clearInterval(this._checkUrlInterval);B.started=false},route:function(t,e){this.handlers.unshift({route:t,callback:e})},checkUrl:function(t){var e=this.getFragment();if(e===this.fragment&&this.iframe){e=this.getHash(this.iframe.contentWindow)}if(e===this.fragment)return false;if(this.iframe)this.navigate(e);this.loadUrl()},loadUrl:function(t){if(!this.matchRoot())return false;t=this.fragment=this.getFragment(t);return i.some(this.handlers,function(e){if(e.route.test(t)){e.callback(t);return true}})},navigate:function(t,e){if(!B.started)return false;if(!e||e===true)e={trigger:!!e};t=this.getFragment(t||"");var i=this.root;if(t===""||t.charAt(0)==="?"){i=i.slice(0,-1)||"/"}var n=i+t;t=t.replace(W,"");var r=this.decodeFragment(t);if(this.fragment===r)return;this.fragment=r;if(this._usePushState){this.history[e.replace?"replaceState":"pushState"]({},document.title,n)}else if(this._wantsHashChange){this._updateHash(this.location,t,e.replace);if(this.iframe&&t!==this.getHash(this.iframe.contentWindow)){var s=this.iframe.contentWindow;if(!e.replace){s.document.open();s.document.close()}this._updateHash(s.location,t,e.replace)}}else{return this.location.assign(n)}if(e.trigger)return this.loadUrl(t)},_updateHash:function(t,e,i){if(i){var n=t.href.replace(/(javascript:|#).*$/,"");t.replace(n+"#"+e)}else{t.hash="#"+e}}});e.history=new B;var D=function(t,e){var n=this;var r;if(t&&i.has(t,"constructor")){r=t.constructor}else{r=function(){return n.apply(this,arguments)}}i.extend(r,n,e);r.prototype=i.create(n.prototype,t);r.prototype.constructor=r;r.__super__=n.prototype;return r};m.extend=_.extend=O.extend=T.extend=B.extend=D;var V=function(){throw new Error('A "url" property or function must be specified')};var G=function(t,e){var i=e.error;e.error=function(n){if(i)i.call(e.context,t,n,e);t.trigger("error",t,n,e)}};return e}); 2 | //# sourceMappingURL=backbone-min.map -------------------------------------------------------------------------------- /benches/fuzzball/fuzzball@1.2.0.js: -------------------------------------------------------------------------------- 1 | !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).fuzzball=e()}}(function(){return function(){return function e(t,r,n){function o(a,u){if(!r[a]){if(!t[a]){var c="function"==typeof require&&require;if(!u&&c)return c(a,!0);if(i)return i(a,!0);var s=new Error("Cannot find module '"+a+"'");throw s.code="MODULE_NOT_FOUND",s}var l=r[a]={exports:{}};t[a][0].call(l.exports,function(e){return o(t[a][1][e]||e)},l,l.exports,e,t,r,n)}return r[a].exports}for(var i="function"==typeof require&&require,a=0;ai.cutoff&&(i.returnObjects?y.push({choice:t,score:s,key:r}):y.push([t,s,r]))}),v&&void 0!==typeof console&&console.log("One or more choices were empty. (post-processing if applied)"),i.limit&&"number"==typeof i.limit&&i.limit>0&&i.limitu.cutoff&&(u.returnObjects?m.push({choice:t[n],score:y,key:h}):m.push([t[n],y,h]))),a&&!0===a.canceled?i(new Error("canceled")):s&&n0&&u.limit0))return 100;var w=[_(g,y,r),_(g,m,r),_(y,m,r)];return r.trySimple&&w.push(_(e,t,r)),Math.max.apply(null,w)}var N,R,P,L,U=!1;function $(e,t,r){if(!_(e))return 0;if(!_(t))return 0;if(r.ratio_alg&&"difflib"===r.ratio_alg){var o=new n(null,e,t).ratio();return Math.round(100*o)}var i,a;return void 0===r.subcost&&(r.subcost=2),r.astral?(r.normalize&&(String.prototype.normalize?(e=e.normalize(),t=t.normalize()):U||(void 0!==typeof console&&console.warn("Normalization not supported in your environment"),U=!0)),i=y(e,t,r,g),a=g(e).length+g(t).length):r.wildcards?(i=v(e,t,r,b),a=e.length+t.length):(i=b(e,t,r),a=e.length+t.length),Math.round((a-i)/a*100)}function B(e,t,r){if(!_(e))return 0;if(!_(t))return 0;if(e.length<=t.length)var o=e,i=t;else o=t,i=e;for(var a=new n(null,o,i).getMatchingBlocks(),u=[],c=0;c0?a[c][1]-a[c][0]:0,l=s+o.length,f=$(o,i.substring(s,l),r);if(f>99.5)return 100;u.push(f)}return Math.max.apply(null,u)}Object.keys||(Object.keys=(N=Object.prototype.hasOwnProperty,R=!{toString:null}.propertyIsEnumerable("toString"),L=(P=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"]).length,function(e){if("object"!=typeof e&&("function"!=typeof e||null===e))throw new TypeError("Object.keys called on non-object");var t,r,n=[];for(t in e)N.call(e,t)&&n.push(t);if(R)for(r=0;r8&&(i=.6),o){var c=B(e,t,n)*i,s=.95*T(e,t,n)*i,l=.95*C(e,t,n)*i;return Math.round(Math.max(a,c,s,l))}var f=.95*I(e,t,n),p=.95*E(e,t,n);return Math.round(Math.max(a,f,p))},full_process:x,extract:z,extractAsync:F,extractAsPromised:q,process_and_sort:w,unique_tokens:j,dedupe:S};t.exports=D}()}).call(this,e("timers").setImmediate)},{"./lib/fbdifflib.js":2,"./lib/iLeven.js":3,"./lib/leven.js":4,"./lib/lodash.custom.min.js":5,"./lib/process.js":6,"./lib/utils.js":7,"./lib/wildcardLeven.js":8,heap:13,setimmediate:15,timers:19}],2:[function(e,t,r){var n=Math.floor,o=Math.max,i=Math.min,a=function(e,t){return t?2*e/t:1},u=function(e,t){var r,n,o,a,u,c;for(u=[e.length,t.length],r=a=0,c=i(n=u[0],o=u[1]);0<=c?ac;r=0<=c?++a:--a){if(e[r]t[r])return 1}return n-o},c=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},s=function(){function e(e,t,r,n){this.isjunk=e,null==t&&(t=""),null==r&&(r=""),this.autojunk=null==n||n,this.a=this.b=null,this.setSeqs(t,r)}return e.prototype.setSeqs=function(e,t){return this.setSeq1(e),this.setSeq2(t)},e.prototype.setSeq1=function(e){if(e!==this.a)return this.a=e,this.matchingBlocks=this.opcodes=null},e.prototype.setSeq2=function(e){if(e!==this.b)return this.b=e,this.matchingBlocks=this.opcodes=null,this.fullbcount=null,this._chainB()},e.prototype._chainB=function(){var e,t,r,o,i,a,u,s,l,f,p,h,d,g;for(e=this.b,this.b2j=t={},o=f=0,h=e.length;f=200)for(r in s=n(u/100)+1,t)t[r].length>s&&(l[r]=!0,delete t[r]);return this.isbjunk=function(e){return c(a,e)},this.isbpopular=function(e){return c(l,e)}},e.prototype.findLongestMatch=function(e,t,r,n){var o,i,a,u,s,l,f,p,h,d,g,y,v,b,m,_,w,j,x,k,A;for(o=(_=[this.a,this.b,this.b2j,this.isbjunk])[0],i=_[1],a=_[2],p=_[3],u=(w=[e,r,0])[0],s=w[1],l=w[2],d={},f=v=e;e<=t?vt;f=e<=t?++v:--v){for(y={},b=0,m=(j=c(a,o[f])?a[o[f]]:[]).length;b=n)break;(g=y[h]=(d[h-1]||0)+1)>l&&(u=(x=[f-g+1,h-g+1,g])[0],s=x[1],l=x[2])}d=y}for(;u>e&&s>r&&!p(i[s-1])&&o[u-1]===i[s-1];)u=(k=[u-1,s-1,l+1])[0],s=k[1],l=k[2];for(;u+le&&s>r&&p(i[s-1])&&o[u-1]===i[s-1];)u=(A=[u-1,s-1,l+1])[0],s=A[1],l=A[2];for(;u+ll&&(r.push([f,a,i(u,a+e),c,i(s,c+e)]),n.push(r),r=[],a=(v=[o(a,u-e),o(c,s-e)])[0],c=v[1]),r.push([f,a,u,c,s]);return!r.length||1===r.length&&"equal"===r[0][0]||n.push(r),n},e.prototype.ratio=function(){var e,t,r,n;for(e=0,t=0,r=(n=this.getMatchingBlocks()).length;t0&&n++;return a(n,this.a.length+this.b.length)},e.prototype.realQuickRatio=function(){var e,t,r;return r=[this.a.length,this.b.length],a(i(e=r[0],t=r[1]),e+t)},e}();t.exports=s},{}],3:[function(e,t,r){var n;e("string.prototype.codepointat"),e("string.fromcodepoint");try{n="undefined"!=typeof Intl&&void 0!==Intl.Collator?Intl.Collator("generic",{sensitivity:"base"}):null}catch(e){void 0!==typeof console&&console.warn("Collator could not be initialized and wouldn't be used")}t.exports=function(e,t,r,o){var i=[],a=[],u=r&&n&&r.useCollator,c=1;if(r&&r.subcost&&"number"==typeof r.subcost&&(c=r.subcost),e===t)return 0;var s,l,f,p,h=o(e),d=o(t),g=h.length,y=d.length;if(0===g)return y;if(0===y)return g;for(var v=0,b=0;vl?p>l?l+1:p:p>f?f+1:p;else for(;bl?p>l?l+1:p:p>f?f+1:p;return l}},{"string.fromcodepoint":16,"string.prototype.codepointat":17}],4:[function(e,t,r){var n;try{n="undefined"!=typeof Intl&&void 0!==Intl.Collator?Intl.Collator("generic",{sensitivity:"base"}):null}catch(e){void 0!==typeof console&&console.warn("Collator could not be initialized and wouldn't be used")}t.exports=function(e,t,r){var o=[],i=[],a=r&&n&&r.useCollator,u=1;if(r&&r.subcost&&"number"==typeof r.subcost&&(u=r.subcost),e===t)return 0;var c,s,l,f,p=e.length,h=t.length;if(0===p)return h;if(0===h)return p;for(var d=0,g=0;ds?f>s?s+1:f:f>l?l+1:f;else for(;gs?f>s?s+1:f:f>l?l+1:f;return s}},{}],5:[function(e,t,r){(function(e){(function(){function n(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}function o(e,t){for(var r=-1,n=null==e?0:e.length;++ra&&u[0]!==s&&u[a-1]!==s?[]:g(u,s)).length)u))return!1;if((c=i.get(e))&&i.get(t))return c==t;var c=-1,l=!0,f=2&r?new j:Ge;for(i.set(e,t),i.set(t,e);++c=e}function Ae(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Se(e){return null!=e&&"object"==typeof e}function Oe(e){return"string"==typeof e||!zr(e)&&Se(e)&&"[object String]"==F(e)}function Ee(e){return"symbol"==typeof e||Se(e)&&"[object Symbol]"==F(e)}function Ce(e){return e?(e=Te(e))===Ve||e===-Ve?1.7976931348623157e308*(0>e?-1:1):e==e?e:0:0===e?e:0}function Ie(e){var t=(e=Ce(e))%1;return e==e?t?e-t:e:0}function Te(e){if("number"==typeof e)return e;if(Ee(e))return Ye;if(Ae(e)&&(e=Ae(e="function"==typeof e.valueOf?e.valueOf():e)?e+"":e),"string"!=typeof e)return 0===e?e:+e;e=e.replace(Xe,"");var t=it.test(e);return t||ut.test(e)?dt(e.slice(2),t?2:8):ot.test(e)?Ye:+e}function ze(e){return null==e?"":U(e)}function Fe(e,t,r){return(e=null==e?Ge:T(e,t))===Ge?r:e}function Me(e,t){var r;if(r=null!=e){for(var n,o=-1,i=(n=q(t,r=e)).length,a=!1;++o(e=S(t,e))||(e==t.length-1?t.pop():$t.call(t,e,1),--this.size,0))},_.prototype.get=function(e){var t=this.__data__;return 0>(e=S(t,e))?Ge:t[e][1]},_.prototype.has=function(e){return-1n?(++this.size,r.push([e,t])):r[n][1]=t,this},w.prototype.clear=function(){this.size=0,this.__data__={hash:new m,map:new(Xt||_),string:new m}},w.prototype.delete=function(e){return e=oe(this,e).delete(e),this.size-=e?1:0,e},w.prototype.get=function(e){return oe(this,e).get(e)},w.prototype.has=function(e){return oe(this,e).has(e)},w.prototype.set=function(e,t){var r=oe(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this},j.prototype.add=j.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},j.prototype.has=function(e){return this.__data__.has(e)},x.prototype.clear=function(){this.__data__=new _,this.size=0},x.prototype.delete=function(e){var t=this.__data__;return e=t.delete(e),this.size=t.size,e},x.prototype.get=function(e){return this.__data__.get(e)},x.prototype.has=function(e){return this.__data__.has(e)},x.prototype.set=function(e,t){var r=this.__data__;if(r instanceof _){var n=r.__data__;if(!Xt||199>n.length)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new w(n)}return r.set(e,t),this.size=r.size,this};var dr=function(e,t){if(null==e)return e;if(!we(e))return function(e,t){return e&&gr(e,t,Ne)}(e,t);for(var r=e.length,n=-1,o=Object(e);++na||n)&&(1&i&&(r[2]=h[2],a|=1&u?0:4),(u=h[3])&&(n=r[3],r[3]=n?W(n,u,h[4]):u,r[4]=n?g(r[3],"__lodash_placeholder__"):h[4]),(u=h[5])&&(n=r[5],r[5]=n?G(n,u,h[6]):u,r[6]=n?g(r[5],"__lodash_placeholder__"):h[6]),(u=h[7])&&(r[7]=u),128&i&&(r[8]=null==r[8]?h[8]:Qt(r[8],h[8])),null==r[9]&&(r[9]=h[9]),r[0]=h[0],r[1]=a),i=r[0],s=r[1],a=r[2],u=r[3],c=r[4],!(n=r[9]=r[9]===Ge?o?0:i.length:Zt(r[9]-l,0))&&24&s&&(s&=-25),pe((h?yr:xr)(s&&1!=s?8==s||16==s?Q(i,s,n):32!=s&&33!=s||c.length?H.apply(Ge,r):K(i,s,a,u):function(e,t,r){var n=1&t,o=Z(e);return function t(){return(this&&this!==vt&&this instanceof t?o:e).apply(n?r:this,arguments)}}(i,s,a),r),i,s)}),Tr=N(function(){return arguments}())?N:function(e){return Se(e)&&Ct.call(e,"callee")&&!Ut.call(e,"callee")},zr=Array.isArray,Fr=Vt||We,Mr=jt?f(jt):function(e){return Se(e)&&"[object Map]"==jr(e)},Nr=xt?f(xt):function(e){return Se(e)&&"[object Set]"==jr(e)},Rr=kt?f(kt):function(e){return Se(e)&&ke(e.length)&&!!ft[F(e)]};v.constant=Le,v.difference=Sr,v.differenceWith=Or,v.intersection=Er,v.intersectionWith=Cr,v.iteratee=$e,v.keys=Ne,v.keysIn=Re,v.memoize=me,v.partialRight=Ir,v.property=qe,v.toArray=function(e){if(!e)return[];if(we(e))return Oe(e)?lt.test(e)?e.match(st)||[]:e.split(""):V(e);if(qt&&e[qt]){e=e[qt]();for(var t,r=[];!(t=e.next()).done;)r.push(t.value);return r}return("[object Map]"==(t=jr(e))?h:"[object Set]"==t?y:Pe)(e)},v.uniq=function(e){return e&&e.length?$(e):[]},v.uniqWith=function(e,t){return t="function"==typeof t?t:Ge,e&&e.length?$(e,Ge,t):[]},v.values=Pe,v.eq=_e,v.forEach=be,v.get=Fe,v.hasIn=Me,v.identity=Ue,v.isArguments=Tr,v.isArray=zr,v.isArrayLike=we,v.isArrayLikeObject=je,v.isBuffer=Fr,v.isFunction=xe,v.isLength=ke,v.isMap=Mr,v.isObject=Ae,v.isObjectLike=Se,v.isSet=Nr,v.isString=Oe,v.isSymbol=Ee,v.isTypedArray=Rr,v.last=ve,v.stubArray=De,v.stubFalse=We,v.noop=Be,v.toFinite=Ce,v.toInteger=Ie,v.toNumber=Te,v.toString=ze,v.each=be,v.VERSION="4.17.5",Ir.placeholder=v,mt?((mt.exports=v)._=v,bt._=v):vt._=v}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],6:[function(e,t,r){t.exports=function(e,r,n,o){return(t={}).dedupe=function(t,i){var a,u=e(i);if(!r(t)&&"object"!=typeof t)throw new Error("contains_dupes must be an array or object");if(0===Object.keys(t).length)return void 0!==typeof console&&console.warn("contains_dupes is empty"),[];u.limit&&(void 0!==typeof console&&console.warn("options.limit will be ignored in dedupe"),u.limit=0),u.cutoff&&"number"==typeof u.cutoff||(void 0!==typeof console&&console.warn("Using default cutoff of 70"),u.cutoff=70),u.scorer||(u.scorer=n,void 0!==typeof console&&console.log("Using default scorer 'ratio' for dedupe")),a=u.processor&&"function"==typeof u.processor?u.processor:function(e){return e};var c={};for(var s in t){var l=a(t[s]);if("string"!=typeof l&&l instanceof String==!1)throw new Error("Each processed item in dedupe must be a string.");var f=o(l,t,u);u.returnObjects?1===f.length?u.keepmap?c[a(f[0].choice)]={item:f[0].choice,key:f[0].key,matches:f}:c[a(f[0].choice)]={item:f[0].choice,key:f[0].key}:(f=f.sort(function(e,t){var r=a(e.choice),n=a(t.choice),o=r.length,i=n.length;return o===i?r0}o.validate=s,o.process_and_sort=function(e){return s(e)?e.match(/\S+/g).sort().join(" ").trim():""},o.tokenize=function(e,o){if(o&&o.wildcards&&r&&n){var i=n(a,o,u);return r(e.match(/\S+/g),function(e,t){return 0===i(e,t)})}return t(e.match(/\S+/g))};var l=i("[^\\pN|\\pL]","g");return o.full_process=function(e,t){if(!(e instanceof String)&&"string"!=typeof e)return"";var r;if(t&&"object"==typeof t&&t.wildcards&&"string"==typeof t.wildcards&&t.wildcards.length>0){var n=t.wildcards.toLowerCase();if(e=e.toLowerCase(),t.force_ascii){var o="[^\0 -|"+c(n)+"]";e=e.replace(new RegExp(o,"g"),"");var a="["+c(n)+"]",u=n[0];e=e.replace(new RegExp(a,"g"),u);var s="[^A-Za-z0-9"+c(n)+"]";r=(e=(e=e.replace(new RegExp(s,"g")," ")).replace(/_/g," ")).trim()}else{var f="[^\\pN|\\pL|"+c(n)+"]",p=i(f,"g");e=i.replace(e,p," ","all");a="["+c(n)+"]",u=n[0];r=(e=e.replace(new RegExp(a,"g"),u)).trim()}}else t&&(t.force_ascii||!0===t)&&(r=(e=e.replace(/[^\x00-\x7F]/g,"")).replace(/\W|_/g," ").toLowerCase().trim()),r=i.replace(e,l," ","all").toLowerCase().trim();return t&&t.collapseWhitespace&&(r=r.replace(/\s+/g," ")),r},o.clone_and_set_option_defaults=function(e){if(e&&e.isAClone)return e;var t={isAClone:!0};if(e){var r,n=Object.keys(e);for(r=0;r0){var f,p,h,d,g,y;if(!1===r.full_process&&!0!==r.processed){p=(f=r.wildcards[0]).charCodeAt(0);var v="["+r.wildcards.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")+"]";if((e=e.replace(new RegExp(v,"g"),f))===(t=t.replace(new RegExp(v,"g"),f)))return 0}else p=(f=r.wildcards[0].toLowerCase()).charCodeAt(0);for(var b=0,m=0;bd?y>d?d+1:y:y>g?g+1:y;else for(;md?y>d?d+1:y:y>g?g+1:y;return d}return o(e,t,r)}},{}],9:[function(e,t,r){var n=e("./xregexp");e("./unicode-base")(n),e("./unicode-categories")(n),t.exports=n},{"./unicode-base":10,"./unicode-categories":11,"./xregexp":12}],10:[function(e,t,r){t.exports=function(e){"use strict";var t={},r=e._dec,n=e._hex,o=e._pad4;function i(e){return e.replace(/[- _]+/g,"").toLowerCase()}function a(e){var t=/^\\[xu](.+)/.exec(e);return t?r(t[1]):e.charCodeAt("\\"===e.charAt(0)?1:0)}function u(r){var i,u,c;return t[r]["b!"]||(t[r]["b!"]=(i=t[r].bmp,u="",c=-1,e.forEach(i,/(\\x..|\\u....|\\?[\s\S])(?:-(\\x..|\\u....|\\?[\s\S]))?/,function(e){var t=a(e[1]);t>c+1&&(u+="\\u"+o(n(c+1)),t>c+2&&(u+="-\\u"+o(n(t-1)))),c=a(e[2]||e[1])}),c<65535&&(u+="\\u"+o(n(c+1)),c<65534&&(u+="-\\uFFFF")),u))}e.addToken(/\\([pP])(?:{(\^?)([^}]*)}|([A-Za-z]))/,function(e,r,n){var o="P"===e[1]||!!e[2],a=i(e[4]||e[3]),c=t[a];if("P"===e[1]&&e[2])throw new SyntaxError("Invalid double negation "+e[0]);if(!t.hasOwnProperty(a))throw new SyntaxError("Unknown Unicode token "+e[0]);if(c.inverseOf){if(a=i(c.inverseOf),!t.hasOwnProperty(a))throw new ReferenceError("Unicode token missing data "+e[0]+" -> "+c.inverseOf);c=t[a],o=!o}if(!c.bmp)throw new SyntaxError("Astral mode required for Unicode token "+e[0]);return"class"===r?o?u(a):c.bmp:(o?"[^":"[")+c.bmp+"]"},{scope:"all",optionalFlags:"A",leadChar:"\\"}),e.addUnicodeData=function(r){for(var n,o=0;o-1?/^(?:\s|#[^#\n]*|\(\?#[^)]*\))*(?:[?*+]|{\d+(?:,\d*)?})/:/^(?:\(\?#[^)]*\))*(?:[?*+]|{\d+(?:,\d*)?})/,e.slice(t))}function E(e){for(;e.length<4;)e="0"+e;return e}function C(e){if(!/^[\w$]$/.test(e))throw new Error("Flag must be a single character A-Za-z0-9_$");_[e]=!0}function I(e,t,r,n,o){for(var i,a,u=s.length,c=e.charAt(r),l=null;u--;)if(!((a=s[u]).leadChar&&a.leadChar!==c||a.scope!==n&&"all"!==a.scope||a.flag&&-1===t.indexOf(a.flag))&&(i=T.exec(e,a.regex,r,"sticky"))){l={matchLength:i[0].length,output:a.handler.call(o,i,n,t),reparse:a.reparse};break}return l}function T(e,t){if(T.isRegExp(e)){if(void 0!==t)throw new TypeError("Cannot supply flags when copying a RegExp");return x(e)}if(e=void 0===e?"":String(e),t=void 0===t?"":String(t),T.isInstalled("astral")&&-1===t.indexOf("A")&&(t+="A"),c[e]||(c[e]={}),!c[e][t]){for(var r,n={hasNamedCapture:!1,captureNames:[]},o=l,a="",u=0,s=function(e,t){var r;if(j(t)!==t)throw new SyntaxError("Invalid duplicate regex flag "+t);for(e=i.replace.call(e,/^\(\?([\w$]+)\)/,function(e,r){if(i.test.call(/[gy]/,r))throw new SyntaxError("Cannot use flag g or y in mode modifier "+e);return t=j(t+r),""}),r=0;r1&&S(u,"")>-1&&(r=x(this,{removeG:!0,isInternalOnly:!0}),i.replace.call(String(e).slice(u.index),r,function(){var e,t=arguments.length;for(e=1;eu.index&&(this.lastIndex=u.index)}return this.global||(this.lastIndex=a),u},a.replace=function(e,t){var r,o,a,u,c,s=T.isRegExp(e);return s?(e[n]&&(o=e[n].captureNames),r=e.lastIndex):e+="",u=t,c="Function",a=y.call(u)==="[object "+c+"]"?i.replace.call(String(this),e,function(){var r,n=arguments;if(o)for(n[0]=new String(n[0]),r=0;re.length-3)throw new SyntaxError("Backreference to undefined group "+t);return e[n]||""}throw new SyntaxError("Invalid token "+t)})}),s&&(e.global?e.lastIndex=0:e.lastIndex=r),a},a.split=function(e,t){if(!T.isRegExp(e))return i.split.apply(this,arguments);var r,n=String(this),o=[],a=e.lastIndex,u=0;return t=(void 0===t?-1:t)>>>0,T.forEach(n,e,function(e){e.index+e[0].length>u&&(o.push(n.slice(u,e.index)),e.length>1&&e.indext?o.slice(0,t):o},T.addToken(/\\([ABCE-RTUVXYZaeg-mopqyz]|c(?![A-Za-z])|u(?![\dA-Fa-f]{4}|{[\dA-Fa-f]+})|x(?![\dA-Fa-f]{2}))/,function(e,t){if("B"===e[1]&&t===l)return e[0];throw new SyntaxError("Invalid escape "+e[0])},{scope:"all",leadChar:"\\"}),T.addToken(/\\u{([\dA-Fa-f]+)}/,function(e,t,r){var n=k(e[1]);if(n>1114111)throw new SyntaxError("Invalid Unicode code point "+e[0]);if(n<=65535)return"\\u"+E(A(n));if(b&&r.indexOf("u")>-1)return e[0];throw new SyntaxError("Cannot use Unicode code point above \\u{FFFF} without flag u")},{scope:"all",leadChar:"\\"}),T.addToken(/\[(\^?)\]/,function(e){return e[1]?"[\\s\\S]":"\\b\\B"},{leadChar:"["}),T.addToken(/\(\?#[^)]*\)/,function(e,t,r){return O(e.input,e.index+e[0].length,r)?"":"(?:)"},{leadChar:"("}),T.addToken(/\s+|#[^\n]*\n?/,function(e,t,r){return O(e.input,e.index+e[0].length,r)?"":"(?:)"},{flag:"x"}),T.addToken(/\./,function(){return"[\\s\\S]"},{flag:"s",leadChar:"."}),T.addToken(/\\k<([\w$]+)>/,function(e){var t=isNaN(e[1])?S(this.captureNames,e[1])+1:+e[1],r=e.index+e[0].length;if(!t||t>this.captureNames.length)throw new SyntaxError("Backreference to undefined group "+e[0]);return"\\"+t+(r===e.input.length||isNaN(e.input.charAt(r))?"":"(?:)")},{leadChar:"\\"}),T.addToken(/\\(\d+)/,function(e,t){if(!(t===l&&/^[1-9]/.test(e[1])&&+e[1]<=this.captureNames.length)&&"0"!==e[1])throw new SyntaxError("Cannot use octal escape or backreference to undefined group "+e[0]);return e[0]},{scope:"all",leadChar:"\\"}),T.addToken(/\(\?P?<([\w$]+)>/,function(e){if(!isNaN(e[1]))throw new SyntaxError("Cannot use integer as capture name "+e[0]);if("length"===e[1]||"__proto__"===e[1])throw new SyntaxError("Cannot use reserved word as capture name "+e[0]);if(S(this.captureNames,e[1])>-1)throw new SyntaxError("Cannot use same name for multiple groups "+e[0]);return this.captureNames.push(e[1]),this.hasNamedCapture=!0,"("},{leadChar:"("}),T.addToken(/\((?!\?)/,function(e,t,r){return r.indexOf("n")>-1?"(?:":(this.captureNames.push(null),"(")},{optionalFlags:"n",leadChar:"("}),t.exports=T},{}],13:[function(e,t,r){t.exports=e("./lib/heap")},{"./lib/heap":14}],14:[function(e,t,r){(function(){var e,n,o,i,a,u,c,s,l,f,p,h,d,g,y,v,b;o=Math.floor,f=Math.min,n=function(e,t){return et?1:0},l=function(e,t,r,i,a){var u;if(null==r&&(r=0),null==a&&(a=n),r<0)throw new Error("lo must be non-negative");for(null==i&&(i=e.length);rr;0<=r?t++:t--)s.push(t);return s}.apply(this).reverse()).length;ig;0<=g?++p:--p)y.push(a(e,r));return y},g=function(e,t,r,o){var i,a,u;for(null==o&&(o=n),i=e[r];r>t&&o(i,a=e[u=r-1>>1])<0;)e[r]=a,r=u;return e[r]=i},y=function(e,t,r){var o,i,a,u,c;for(null==r&&(r=n),i=e.length,c=t,a=e[t],o=2*t+1;o1114111||i(s)!=s)throw RangeError("Invalid code point: "+s);s<=65535?n.push(s):(t=55296+((s-=65536)>>10),r=s%1024+56320,n.push(t,r)),(a+1==u||n.length>16384)&&(c+=o.apply(null,n),n.length=0)}return c},n?n(String,"fromCodePoint",{value:a,configurable:!0,writable:!0}):String.fromCodePoint=a)},{}],17:[function(e,t,r){String.prototype.codePointAt||function(){"use strict";var e=function(){try{var e={},t=Object.defineProperty,r=t(e,e,e)&&t}catch(e){}return r}(),t=function(e){if(null==this)throw TypeError();var t=String(this),r=t.length,n=e?Number(e):0;if(n!=n&&(n=0),!(n<0||n>=r)){var o,i=t.charCodeAt(n);return i>=55296&&i<=56319&&r>n+1&&(o=t.charCodeAt(n+1))>=56320&&o<=57343?1024*(i-55296)+o-56320+65536:i}};e?e(String.prototype,"codePointAt",{value:t,configurable:!0,writable:!0}):String.prototype.codePointAt=t}()},{}],18:[function(e,t,r){var n,o,i=t.exports={};function a(){throw new Error("setTimeout has not been defined")}function u(){throw new Error("clearTimeout has not been defined")}function c(e){if(n===setTimeout)return setTimeout(e,0);if((n===a||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:a}catch(e){n=a}try{o="function"==typeof clearTimeout?clearTimeout:u}catch(e){o=u}}();var s,l=[],f=!1,p=-1;function h(){f&&s&&(f=!1,s.length?l=s.concat(l):p=-1,l.length&&d())}function d(){if(!f){var e=c(h);f=!0;for(var t=l.length;t;){for(s=l,l=[];++p1)for(var r=1;r=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},r.setImmediate="function"==typeof t?t:function(e){var t=c++,n=!(arguments.length<2)&&a.call(arguments,1);return u[t]=!0,o(function(){u[t]&&(n?e.apply(null,n):e.call(null),r.clearImmediate(t))}),t},r.clearImmediate="function"==typeof n?n:function(e){delete u[e]}}).call(this,e("timers").setImmediate,e("timers").clearImmediate)},{"process/browser.js":18,timers:19}]},{},[1])(1)}); 2 | -------------------------------------------------------------------------------- /benches/fuzzball/out/fuzzball@1.2.js: -------------------------------------------------------------------------------- 1 | !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).fuzzball=e()}}(function(){return function(){return function e(t,r,n){function o(a,u){if(!r[a]){if(!t[a]){var c="function"==typeof require&&require;if(!u&&c)return c(a,!0);if(i)return i(a,!0);var s=new Error("Cannot find module '"+a+"'");throw s.code="MODULE_NOT_FOUND",s}var l=r[a]={exports:{}};t[a][0].call(l.exports,function(e){return o(t[a][1][e]||e)},l,l.exports,e,t,r,n)}return r[a].exports}for(var i="function"==typeof require&&require,a=0;ai.cutoff&&(i.returnObjects?y.push({choice:t,score:s,key:r}):y.push([t,s,r]))}),v&&void 0!==typeof console&&console.log("One or more choices were empty. (post-processing if applied)"),i.limit&&"number"==typeof i.limit&&i.limit>0&&i.limitu.cutoff&&(u.returnObjects?m.push({choice:t[n],score:y,key:h}):m.push([t[n],y,h]))),a&&!0===a.canceled?i(new Error("canceled")):s&&n0&&u.limit0))return 100;var w=[_(g,y,r),_(g,m,r),_(y,m,r)];return r.trySimple&&w.push(_(e,t,r)),Math.max.apply(null,w)}var N,R,P,L,U=!1;function $(e,t,r){if(!_(e))return 0;if(!_(t))return 0;if(r.ratio_alg&&"difflib"===r.ratio_alg){var o=new n(null,e,t).ratio();return Math.round(100*o)}var i,a;return void 0===r.subcost&&(r.subcost=2),r.astral?(r.normalize&&(String.prototype.normalize?(e=e.normalize(),t=t.normalize()):U||(void 0!==typeof console&&console.warn("Normalization not supported in your environment"),U=!0)),i=y(e,t,r,g),a=g(e).length+g(t).length):r.wildcards?(i=v(e,t,r,b),a=e.length+t.length):(i=b(e,t,r),a=e.length+t.length),Math.round((a-i)/a*100)}function B(e,t,r){if(!_(e))return 0;if(!_(t))return 0;if(e.length<=t.length)var o=e,i=t;else o=t,i=e;for(var a=new n(null,o,i).getMatchingBlocks(),u=[],c=0;c0?a[c][1]-a[c][0]:0,l=s+o.length,f=$(o,i.substring(s,l),r);if(f>99.5)return 100;u.push(f)}return Math.max.apply(null,u)}Object.keys||(Object.keys=(N=Object.prototype.hasOwnProperty,R=!{toString:null}.propertyIsEnumerable("toString"),L=(P=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"]).length,function(e){if("object"!=typeof e&&("function"!=typeof e||null===e))throw new TypeError("Object.keys called on non-object");var t,r,n=[];for(t in e)N.call(e,t)&&n.push(t);if(R)for(r=0;r8&&(i=.6),o){var c=B(e,t,n)*i,s=.95*T(e,t,n)*i,l=.95*C(e,t,n)*i;return Math.round(Math.max(a,c,s,l))}var f=.95*I(e,t,n),p=.95*E(e,t,n);return Math.round(Math.max(a,f,p))},full_process:x,extract:z,extractAsync:F,extractAsPromised:q,process_and_sort:w,unique_tokens:j,dedupe:S};t.exports=D}()}).call(this,e("timers").setImmediate)},{"./lib/fbdifflib.js":2,"./lib/iLeven.js":3,"./lib/leven.js":4,"./lib/lodash.custom.min.js":5,"./lib/process.js":6,"./lib/utils.js":7,"./lib/wildcardLeven.js":8,heap:13,setimmediate:15,timers:19}],2:[function(e,t,r){var n=Math.floor,o=Math.max,i=Math.min,a=function(e,t){return t?2*e/t:1},u=function(e,t){var r,n,o,a,u,c;for(u=[e.length,t.length],r=a=0,c=i(n=u[0],o=u[1]);0<=c?ac;r=0<=c?++a:--a){if(e[r]t[r])return 1}return n-o},c=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},s=function(){function e(e,t,r,n){this.isjunk=e,null==t&&(t=""),null==r&&(r=""),this.autojunk=null==n||n,this.a=this.b=null,this.setSeqs(t,r)}return e.prototype.setSeqs=function(e,t){return this.setSeq1(e),this.setSeq2(t)},e.prototype.setSeq1=function(e){if(e!==this.a)return this.a=e,this.matchingBlocks=this.opcodes=null},e.prototype.setSeq2=function(e){if(e!==this.b)return this.b=e,this.matchingBlocks=this.opcodes=null,this.fullbcount=null,this._chainB()},e.prototype._chainB=function(){var e,t,r,o,i,a,u,s,l,f,p,h,d,g;for(e=this.b,this.b2j=t={},o=f=0,h=e.length;f=200)for(r in s=n(u/100)+1,t)t[r].length>s&&(l[r]=!0,delete t[r]);return this.isbjunk=function(e){return c(a,e)},this.isbpopular=function(e){return c(l,e)}},e.prototype.findLongestMatch=function(e,t,r,n){var o,i,a,u,s,l,f,p,h,d,g,y,v,b,m,_,w,j,x,k,A;for(o=(_=[this.a,this.b,this.b2j,this.isbjunk])[0],i=_[1],a=_[2],p=_[3],u=(w=[e,r,0])[0],s=w[1],l=w[2],d={},f=v=e;e<=t?vt;f=e<=t?++v:--v){for(y={},b=0,m=(j=c(a,o[f])?a[o[f]]:[]).length;b=n)break;(g=y[h]=(d[h-1]||0)+1)>l&&(u=(x=[f-g+1,h-g+1,g])[0],s=x[1],l=x[2])}d=y}for(;u>e&&s>r&&!p(i[s-1])&&o[u-1]===i[s-1];)u=(k=[u-1,s-1,l+1])[0],s=k[1],l=k[2];for(;u+le&&s>r&&p(i[s-1])&&o[u-1]===i[s-1];)u=(A=[u-1,s-1,l+1])[0],s=A[1],l=A[2];for(;u+ll&&(r.push([f,a,i(u,a+e),c,i(s,c+e)]),n.push(r),r=[],a=(v=[o(a,u-e),o(c,s-e)])[0],c=v[1]),r.push([f,a,u,c,s]);return!r.length||1===r.length&&"equal"===r[0][0]||n.push(r),n},e.prototype.ratio=function(){var e,t,r,n;for(e=0,t=0,r=(n=this.getMatchingBlocks()).length;t0&&n++;return a(n,this.a.length+this.b.length)},e.prototype.realQuickRatio=function(){var e,t,r;return r=[this.a.length,this.b.length],a(i(e=r[0],t=r[1]),e+t)},e}();t.exports=s},{}],3:[function(e,t,r){var n;e("string.prototype.codepointat"),e("string.fromcodepoint");try{n="undefined"!=typeof Intl&&void 0!==Intl.Collator?Intl.Collator("generic",{sensitivity:"base"}):null}catch(e){void 0!==typeof console&&console.warn("Collator could not be initialized and wouldn't be used")}t.exports=function(e,t,r,o){var i=[],a=[],u=r&&n&&r.useCollator,c=1;if(r&&r.subcost&&"number"==typeof r.subcost&&(c=r.subcost),e===t)return 0;var s,l,f,p,h=o(e),d=o(t),g=h.length,y=d.length;if(0===g)return y;if(0===y)return g;for(var v=0,b=0;vl?p>l?l+1:p:p>f?f+1:p;else for(;bl?p>l?l+1:p:p>f?f+1:p;return l}},{"string.fromcodepoint":16,"string.prototype.codepointat":17}],4:[function(e,t,r){var n;try{n="undefined"!=typeof Intl&&void 0!==Intl.Collator?Intl.Collator("generic",{sensitivity:"base"}):null}catch(e){void 0!==typeof console&&console.warn("Collator could not be initialized and wouldn't be used")}t.exports=function(e,t,r){var o=[],i=[],a=r&&n&&r.useCollator,u=1;if(r&&r.subcost&&"number"==typeof r.subcost&&(u=r.subcost),e===t)return 0;var c,s,l,f,p=e.length,h=t.length;if(0===p)return h;if(0===h)return p;for(var d=0,g=0;ds?f>s?s+1:f:f>l?l+1:f;else for(;gs?f>s?s+1:f:f>l?l+1:f;return s}},{}],5:[function(e,t,r){(function(e){(function(){function n(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}function o(e,t){for(var r=-1,n=null==e?0:e.length;++ra&&u[0]!==s&&u[a-1]!==s?[]:g(u,s)).length)u))return!1;if((c=i.get(e))&&i.get(t))return c==t;var c=-1,l=!0,f=2&r?new j:Ge;for(i.set(e,t),i.set(t,e);++c=e}function Ae(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Se(e){return null!=e&&"object"==typeof e}function Oe(e){return"string"==typeof e||!zr(e)&&Se(e)&&"[object String]"==F(e)}function Ee(e){return"symbol"==typeof e||Se(e)&&"[object Symbol]"==F(e)}function Ce(e){return e?(e=Te(e))===Ve||e===-Ve?1.7976931348623157e308*(0>e?-1:1):e==e?e:0:0===e?e:0}function Ie(e){var t=(e=Ce(e))%1;return e==e?t?e-t:e:0}function Te(e){if("number"==typeof e)return e;if(Ee(e))return Ye;if(Ae(e)&&(e=Ae(e="function"==typeof e.valueOf?e.valueOf():e)?e+"":e),"string"!=typeof e)return 0===e?e:+e;e=e.replace(Xe,"");var t=it.test(e);return t||ut.test(e)?dt(e.slice(2),t?2:8):ot.test(e)?Ye:+e}function ze(e){return null==e?"":U(e)}function Fe(e,t,r){return(e=null==e?Ge:T(e,t))===Ge?r:e}function Me(e,t){var r;if(r=null!=e){for(var n,o=-1,i=(n=q(t,r=e)).length,a=!1;++o(e=S(t,e))||(e==t.length-1?t.pop():$t.call(t,e,1),--this.size,0))},_.prototype.get=function(e){var t=this.__data__;return 0>(e=S(t,e))?Ge:t[e][1]},_.prototype.has=function(e){return-1n?(++this.size,r.push([e,t])):r[n][1]=t,this},w.prototype.clear=function(){this.size=0,this.__data__={hash:new m,map:new(Xt||_),string:new m}},w.prototype.delete=function(e){return e=oe(this,e).delete(e),this.size-=e?1:0,e},w.prototype.get=function(e){return oe(this,e).get(e)},w.prototype.has=function(e){return oe(this,e).has(e)},w.prototype.set=function(e,t){var r=oe(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this},j.prototype.add=j.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},j.prototype.has=function(e){return this.__data__.has(e)},x.prototype.clear=function(){this.__data__=new _,this.size=0},x.prototype.delete=function(e){var t=this.__data__;return e=t.delete(e),this.size=t.size,e},x.prototype.get=function(e){return this.__data__.get(e)},x.prototype.has=function(e){return this.__data__.has(e)},x.prototype.set=function(e,t){var r=this.__data__;if(r instanceof _){var n=r.__data__;if(!Xt||199>n.length)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new w(n)}return r.set(e,t),this.size=r.size,this};var dr=function(e,t){if(null==e)return e;if(!we(e))return function(e,t){return e&&gr(e,t,Ne)}(e,t);for(var r=e.length,n=-1,o=Object(e);++na||n)&&(1&i&&(r[2]=h[2],a|=1&u?0:4),(u=h[3])&&(n=r[3],r[3]=n?W(n,u,h[4]):u,r[4]=n?g(r[3],"__lodash_placeholder__"):h[4]),(u=h[5])&&(n=r[5],r[5]=n?G(n,u,h[6]):u,r[6]=n?g(r[5],"__lodash_placeholder__"):h[6]),(u=h[7])&&(r[7]=u),128&i&&(r[8]=null==r[8]?h[8]:Qt(r[8],h[8])),null==r[9]&&(r[9]=h[9]),r[0]=h[0],r[1]=a),i=r[0],s=r[1],a=r[2],u=r[3],c=r[4],!(n=r[9]=r[9]===Ge?o?0:i.length:Zt(r[9]-l,0))&&24&s&&(s&=-25),pe((h?yr:xr)(s&&1!=s?8==s||16==s?Q(i,s,n):32!=s&&33!=s||c.length?H.apply(Ge,r):K(i,s,a,u):function(e,t,r){var n=1&t,o=Z(e);return function t(){return(this&&this!==vt&&this instanceof t?o:e).apply(n?r:this,arguments)}}(i,s,a),r),i,s)}),Tr=N(function(){return arguments}())?N:function(e){return Se(e)&&Ct.call(e,"callee")&&!Ut.call(e,"callee")},zr=Array.isArray,Fr=Vt||We,Mr=jt?f(jt):function(e){return Se(e)&&"[object Map]"==jr(e)},Nr=xt?f(xt):function(e){return Se(e)&&"[object Set]"==jr(e)},Rr=kt?f(kt):function(e){return Se(e)&&ke(e.length)&&!!ft[F(e)]};v.constant=Le,v.difference=Sr,v.differenceWith=Or,v.intersection=Er,v.intersectionWith=Cr,v.iteratee=$e,v.keys=Ne,v.keysIn=Re,v.memoize=me,v.partialRight=Ir,v.property=qe,v.toArray=function(e){if(!e)return[];if(we(e))return Oe(e)?lt.test(e)?e.match(st)||[]:e.split(""):V(e);if(qt&&e[qt]){e=e[qt]();for(var t,r=[];!(t=e.next()).done;)r.push(t.value);return r}return("[object Map]"==(t=jr(e))?h:"[object Set]"==t?y:Pe)(e)},v.uniq=function(e){return e&&e.length?$(e):[]},v.uniqWith=function(e,t){return t="function"==typeof t?t:Ge,e&&e.length?$(e,Ge,t):[]},v.values=Pe,v.eq=_e,v.forEach=be,v.get=Fe,v.hasIn=Me,v.identity=Ue,v.isArguments=Tr,v.isArray=zr,v.isArrayLike=we,v.isArrayLikeObject=je,v.isBuffer=Fr,v.isFunction=xe,v.isLength=ke,v.isMap=Mr,v.isObject=Ae,v.isObjectLike=Se,v.isSet=Nr,v.isString=Oe,v.isSymbol=Ee,v.isTypedArray=Rr,v.last=ve,v.stubArray=De,v.stubFalse=We,v.noop=Be,v.toFinite=Ce,v.toInteger=Ie,v.toNumber=Te,v.toString=ze,v.each=be,v.VERSION="4.17.5",Ir.placeholder=v,mt?((mt.exports=v)._=v,bt._=v):vt._=v}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],6:[function(e,t,r){t.exports=function(e,r,n,o){return(t={}).dedupe=function(t,i){var a,u=e(i);if(!r(t)&&"object"!=typeof t)throw new Error("contains_dupes must be an array or object");if(0===Object.keys(t).length)return void 0!==typeof console&&console.warn("contains_dupes is empty"),[];u.limit&&(void 0!==typeof console&&console.warn("options.limit will be ignored in dedupe"),u.limit=0),u.cutoff&&"number"==typeof u.cutoff||(void 0!==typeof console&&console.warn("Using default cutoff of 70"),u.cutoff=70),u.scorer||(u.scorer=n,void 0!==typeof console&&console.log("Using default scorer 'ratio' for dedupe")),a=u.processor&&"function"==typeof u.processor?u.processor:function(e){return e};var c={};for(var s in t){var l=a(t[s]);if("string"!=typeof l&&l instanceof String==!1)throw new Error("Each processed item in dedupe must be a string.");var f=o(l,t,u);u.returnObjects?1===f.length?u.keepmap?c[a(f[0].choice)]={item:f[0].choice,key:f[0].key,matches:f}:c[a(f[0].choice)]={item:f[0].choice,key:f[0].key}:(f=f.sort(function(e,t){var r=a(e.choice),n=a(t.choice),o=r.length,i=n.length;return o===i?r0}o.validate=s,o.process_and_sort=function(e){return s(e)?e.match(/\S+/g).sort().join(" ").trim():""},o.tokenize=function(e,o){if(o&&o.wildcards&&r&&n){var i=n(a,o,u);return r(e.match(/\S+/g),function(e,t){return 0===i(e,t)})}return t(e.match(/\S+/g))};var l=i("[^\\pN|\\pL]","g");return o.full_process=function(e,t){if(!(e instanceof String)&&"string"!=typeof e)return"";var r;if(t&&"object"==typeof t&&t.wildcards&&"string"==typeof t.wildcards&&t.wildcards.length>0){var n=t.wildcards.toLowerCase();if(e=e.toLowerCase(),t.force_ascii){var o="[^\0 -|"+c(n)+"]";e=e.replace(new RegExp(o,"g"),"");var a="["+c(n)+"]",u=n[0];e=e.replace(new RegExp(a,"g"),u);var s="[^A-Za-z0-9"+c(n)+"]";r=(e=(e=e.replace(new RegExp(s,"g")," ")).replace(/_/g," ")).trim()}else{var f="[^\\pN|\\pL|"+c(n)+"]",p=i(f,"g");e=i.replace(e,p," ","all");a="["+c(n)+"]",u=n[0];r=(e=e.replace(new RegExp(a,"g"),u)).trim()}}else t&&(t.force_ascii||!0===t)&&(r=(e=e.replace(/[^\x00-\x7F]/g,"")).replace(/\W|_/g," ").toLowerCase().trim()),r=i.replace(e,l," ","all").toLowerCase().trim();return t&&t.collapseWhitespace&&(r=r.replace(/\s+/g," ")),r},o.clone_and_set_option_defaults=function(e){if(e&&e.isAClone)return e;var t={isAClone:!0};if(e){var r,n=Object.keys(e);for(r=0;r0){var f,p,h,d,g,y;if(!1===r.full_process&&!0!==r.processed){p=(f=r.wildcards[0]).charCodeAt(0);var v="["+r.wildcards.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")+"]";if((e=e.replace(new RegExp(v,"g"),f))===(t=t.replace(new RegExp(v,"g"),f)))return 0}else p=(f=r.wildcards[0].toLowerCase()).charCodeAt(0);for(var b=0,m=0;bd?y>d?d+1:y:y>g?g+1:y;else for(;md?y>d?d+1:y:y>g?g+1:y;return d}return o(e,t,r)}},{}],9:[function(e,t,r){var n=e("./xregexp");e("./unicode-base")(n),e("./unicode-categories")(n),t.exports=n},{"./unicode-base":10,"./unicode-categories":11,"./xregexp":12}],10:[function(e,t,r){t.exports=function(e){"use strict";var t={},r=e._dec,n=e._hex,o=e._pad4;function i(e){return e.replace(/[- _]+/g,"").toLowerCase()}function a(e){var t=/^\\[xu](.+)/.exec(e);return t?r(t[1]):e.charCodeAt("\\"===e.charAt(0)?1:0)}function u(r){var i,u,c;return t[r]["b!"]||(t[r]["b!"]=(i=t[r].bmp,u="",c=-1,e.forEach(i,/(\\x..|\\u....|\\?[\s\S])(?:-(\\x..|\\u....|\\?[\s\S]))?/,function(e){var t=a(e[1]);t>c+1&&(u+="\\u"+o(n(c+1)),t>c+2&&(u+="-\\u"+o(n(t-1)))),c=a(e[2]||e[1])}),c<65535&&(u+="\\u"+o(n(c+1)),c<65534&&(u+="-\\uFFFF")),u))}e.addToken(/\\([pP])(?:{(\^?)([^}]*)}|([A-Za-z]))/,function(e,r,n){var o="P"===e[1]||!!e[2],a=i(e[4]||e[3]),c=t[a];if("P"===e[1]&&e[2])throw new SyntaxError("Invalid double negation "+e[0]);if(!t.hasOwnProperty(a))throw new SyntaxError("Unknown Unicode token "+e[0]);if(c.inverseOf){if(a=i(c.inverseOf),!t.hasOwnProperty(a))throw new ReferenceError("Unicode token missing data "+e[0]+" -> "+c.inverseOf);c=t[a],o=!o}if(!c.bmp)throw new SyntaxError("Astral mode required for Unicode token "+e[0]);return"class"===r?o?u(a):c.bmp:(o?"[^":"[")+c.bmp+"]"},{scope:"all",optionalFlags:"A",leadChar:"\\"}),e.addUnicodeData=function(r){for(var n,o=0;o-1?/^(?:\s|#[^#\n]*|\(\?#[^)]*\))*(?:[?*+]|{\d+(?:,\d*)?})/:/^(?:\(\?#[^)]*\))*(?:[?*+]|{\d+(?:,\d*)?})/,e.slice(t))}function E(e){for(;e.length<4;)e="0"+e;return e}function C(e){if(!/^[\w$]$/.test(e))throw new Error("Flag must be a single character A-Za-z0-9_$");_[e]=!0}function I(e,t,r,n,o){for(var i,a,u=s.length,c=e.charAt(r),l=null;u--;)if(!((a=s[u]).leadChar&&a.leadChar!==c||a.scope!==n&&"all"!==a.scope||a.flag&&-1===t.indexOf(a.flag))&&(i=T.exec(e,a.regex,r,"sticky"))){l={matchLength:i[0].length,output:a.handler.call(o,i,n,t),reparse:a.reparse};break}return l}function T(e,t){if(T.isRegExp(e)){if(void 0!==t)throw new TypeError("Cannot supply flags when copying a RegExp");return x(e)}if(e=void 0===e?"":String(e),t=void 0===t?"":String(t),T.isInstalled("astral")&&-1===t.indexOf("A")&&(t+="A"),c[e]||(c[e]={}),!c[e][t]){for(var r,n={hasNamedCapture:!1,captureNames:[]},o=l,a="",u=0,s=function(e,t){var r;if(j(t)!==t)throw new SyntaxError("Invalid duplicate regex flag "+t);for(e=i.replace.call(e,/^\(\?([\w$]+)\)/,function(e,r){if(i.test.call(/[gy]/,r))throw new SyntaxError("Cannot use flag g or y in mode modifier "+e);return t=j(t+r),""}),r=0;r1&&S(u,"")>-1&&(r=x(this,{removeG:!0,isInternalOnly:!0}),i.replace.call(String(e).slice(u.index),r,function(){var e,t=arguments.length;for(e=1;eu.index&&(this.lastIndex=u.index)}return this.global||(this.lastIndex=a),u},a.replace=function(e,t){var r,o,a,u,c,s=T.isRegExp(e);return s?(e[n]&&(o=e[n].captureNames),r=e.lastIndex):e+="",u=t,c="Function",a=y.call(u)==="[object "+c+"]"?i.replace.call(String(this),e,function(){var r,n=arguments;if(o)for(n[0]=new String(n[0]),r=0;re.length-3)throw new SyntaxError("Backreference to undefined group "+t);return e[n]||""}throw new SyntaxError("Invalid token "+t)})}),s&&(e.global?e.lastIndex=0:e.lastIndex=r),a},a.split=function(e,t){if(!T.isRegExp(e))return i.split.apply(this,arguments);var r,n=String(this),o=[],a=e.lastIndex,u=0;return t=(void 0===t?-1:t)>>>0,T.forEach(n,e,function(e){e.index+e[0].length>u&&(o.push(n.slice(u,e.index)),e.length>1&&e.indext?o.slice(0,t):o},T.addToken(/\\([ABCE-RTUVXYZaeg-mopqyz]|c(?![A-Za-z])|u(?![\dA-Fa-f]{4}|{[\dA-Fa-f]+})|x(?![\dA-Fa-f]{2}))/,function(e,t){if("B"===e[1]&&t===l)return e[0];throw new SyntaxError("Invalid escape "+e[0])},{scope:"all",leadChar:"\\"}),T.addToken(/\\u{([\dA-Fa-f]+)}/,function(e,t,r){var n=k(e[1]);if(n>1114111)throw new SyntaxError("Invalid Unicode code point "+e[0]);if(n<=65535)return"\\u"+E(A(n));if(b&&r.indexOf("u")>-1)return e[0];throw new SyntaxError("Cannot use Unicode code point above \\u{FFFF} without flag u")},{scope:"all",leadChar:"\\"}),T.addToken(/\[(\^?)\]/,function(e){return e[1]?"[\\s\\S]":"\\b\\B"},{leadChar:"["}),T.addToken(/\(\?#[^)]*\)/,function(e,t,r){return O(e.input,e.index+e[0].length,r)?"":"(?:)"},{leadChar:"("}),T.addToken(/\s+|#[^\n]*\n?/,function(e,t,r){return O(e.input,e.index+e[0].length,r)?"":"(?:)"},{flag:"x"}),T.addToken(/\./,function(){return"[\\s\\S]"},{flag:"s",leadChar:"."}),T.addToken(/\\k<([\w$]+)>/,function(e){var t=isNaN(e[1])?S(this.captureNames,e[1])+1:+e[1],r=e.index+e[0].length;if(!t||t>this.captureNames.length)throw new SyntaxError("Backreference to undefined group "+e[0]);return"\\"+t+(r===e.input.length||isNaN(e.input.charAt(r))?"":"(?:)")},{leadChar:"\\"}),T.addToken(/\\(\d+)/,function(e,t){if(!(t===l&&/^[1-9]/.test(e[1])&&+e[1]<=this.captureNames.length)&&"0"!==e[1])throw new SyntaxError("Cannot use octal escape or backreference to undefined group "+e[0]);return e[0]},{scope:"all",leadChar:"\\"}),T.addToken(/\(\?P?<([\w$]+)>/,function(e){if(!isNaN(e[1]))throw new SyntaxError("Cannot use integer as capture name "+e[0]);if("length"===e[1]||"__proto__"===e[1])throw new SyntaxError("Cannot use reserved word as capture name "+e[0]);if(S(this.captureNames,e[1])>-1)throw new SyntaxError("Cannot use same name for multiple groups "+e[0]);return this.captureNames.push(e[1]),this.hasNamedCapture=!0,"("},{leadChar:"("}),T.addToken(/\((?!\?)/,function(e,t,r){return r.indexOf("n")>-1?"(?:":(this.captureNames.push(null),"(")},{optionalFlags:"n",leadChar:"("}),t.exports=T},{}],13:[function(e,t,r){t.exports=e("./lib/heap")},{"./lib/heap":14}],14:[function(e,t,r){(function(){var e,n,o,i,a,u,c,s,l,f,p,h,d,g,y,v,b;o=Math.floor,f=Math.min,n=function(e,t){return et?1:0},l=function(e,t,r,i,a){var u;if(null==r&&(r=0),null==a&&(a=n),r<0)throw new Error("lo must be non-negative");for(null==i&&(i=e.length);rr;0<=r?t++:t--)s.push(t);return s}.apply(this).reverse()).length;ig;0<=g?++p:--p)y.push(a(e,r));return y},g=function(e,t,r,o){var i,a,u;for(null==o&&(o=n),i=e[r];r>t&&o(i,a=e[u=r-1>>1])<0;)e[r]=a,r=u;return e[r]=i},y=function(e,t,r){var o,i,a,u,c;for(null==r&&(r=n),i=e.length,c=t,a=e[t],o=2*t+1;o1114111||i(s)!=s)throw RangeError("Invalid code point: "+s);s<=65535?n.push(s):(t=55296+((s-=65536)>>10),r=s%1024+56320,n.push(t,r)),(a+1==u||n.length>16384)&&(c+=o.apply(null,n),n.length=0)}return c},n?n(String,"fromCodePoint",{value:a,configurable:!0,writable:!0}):String.fromCodePoint=a)},{}],17:[function(e,t,r){String.prototype.codePointAt||function(){"use strict";var e=function(){try{var e={},t=Object.defineProperty,r=t(e,e,e)&&t}catch(e){}return r}(),t=function(e){if(null==this)throw TypeError();var t=String(this),r=t.length,n=e?Number(e):0;if(n!=n&&(n=0),!(n<0||n>=r)){var o,i=t.charCodeAt(n);return i>=55296&&i<=56319&&r>n+1&&(o=t.charCodeAt(n+1))>=56320&&o<=57343?1024*(i-55296)+o-56320+65536:i}};e?e(String.prototype,"codePointAt",{value:t,configurable:!0,writable:!0}):String.prototype.codePointAt=t}()},{}],18:[function(e,t,r){var n,o,i=t.exports={};function a(){throw new Error("setTimeout has not been defined")}function u(){throw new Error("clearTimeout has not been defined")}function c(e){if(n===setTimeout)return setTimeout(e,0);if((n===a||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:a}catch(e){n=a}try{o="function"==typeof clearTimeout?clearTimeout:u}catch(e){o=u}}();var s,l=[],f=!1,p=-1;function h(){f&&s&&(f=!1,s.length?l=s.concat(l):p=-1,l.length&&d())}function d(){if(!f){var e=c(h);f=!0;for(var t=l.length;t;){for(s=l,l=[];++p1)for(var r=1;r=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},r.setImmediate="function"==typeof t?t:function(e){var t=c++,n=!(arguments.length<2)&&a.call(arguments,1);return u[t]=!0,o(function(){u[t]&&(n?e.apply(null,n):e.call(null),r.clearImmediate(t))}),t},r.clearImmediate="function"==typeof n?n:function(e){delete u[e]}}).call(this,e("timers").setImmediate,e("timers").clearImmediate)},{"process/browser.js":18,timers:19}]},{},[1])(1)}); 2 | --------------------------------------------------------------------------------