text
stringlengths
2
1.05M
ace.define("ace/mode/c_cpp",["require","exports","module","ace/lib/oop","ace/mode/text","ace/tokenizer","ace/mode/c_cpp_highlight_rules","ace/mode/matching_brace_outdent","ace/range","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"],function(e,t,n){var r=e("../lib/oop"),i=e("./text").Mode,s=e("../tokenizer").Tokenizer,o=e("./c_cpp_highlight_rules").c_cppHighlightRules,u=e("./matching_brace_outdent").MatchingBraceOutdent,a=e("../range").Range,f=e("./behaviour/cstyle").CstyleBehaviour,l=e("./folding/cstyle").FoldMode,c=function(){this.HighlightRules=o,this.$outdent=new u,this.$behaviour=new f,this.foldingRules=new l};r.inherits(c,i),function(){this.lineCommentStart="//",this.blockComment={start:"/*",end:"*/"},this.getNextLineIndent=function(e,t,n){var r=this.$getIndent(t),i=this.getTokenizer().getLineTokens(t,e),s=i.tokens,o=i.state;if(s.length&&s[s.length-1].type=="comment")return r;if(e=="start"){var u=t.match(/^.*[\{\(\[]\s*$/);u&&(r+=n)}else if(e=="doc-start"){if(o=="start")return"";var u=t.match(/^\s*(\/?)\*/);u&&(u[1]&&(r+=" "),r+="* ")}return r},this.checkOutdent=function(e,t,n){return this.$outdent.checkOutdent(t,n)},this.autoOutdent=function(e,t,n){this.$outdent.autoOutdent(t,n)},this.$id="ace/mode/c_cpp"}.call(c.prototype),t.Mode=c}),ace.define("ace/mode/c_cpp_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"],function(e,t,n){var r=e("../lib/oop"),i=e("./doc_comment_highlight_rules").DocCommentHighlightRules,s=e("./text_highlight_rules").TextHighlightRules,o=t.cFunctions="\\b(?:hypot(?:f|l)?|s(?:scanf|ystem|nprintf|ca(?:nf|lb(?:n(?:f|l)?|ln(?:f|l)?))|i(?:n(?:h(?:f|l)?|f|l)?|gn(?:al|bit))|tr(?:s(?:tr|pn)|nc(?:py|at|mp)|c(?:spn|hr|oll|py|at|mp)|to(?:imax|d|u(?:l(?:l)?|max)|k|f|l(?:d|l)?)|error|pbrk|ftime|len|rchr|xfrm)|printf|et(?:jmp|vbuf|locale|buf)|qrt(?:f|l)?|w(?:scanf|printf)|rand)|n(?:e(?:arbyint(?:f|l)?|xt(?:toward(?:f|l)?|after(?:f|l)?))|an(?:f|l)?)|c(?:s(?:in(?:h(?:f|l)?|f|l)?|qrt(?:f|l)?)|cos(?:h(?:f)?|f|l)?|imag(?:f|l)?|t(?:ime|an(?:h(?:f|l)?|f|l)?)|o(?:s(?:h(?:f|l)?|f|l)?|nj(?:f|l)?|pysign(?:f|l)?)|p(?:ow(?:f|l)?|roj(?:f|l)?)|e(?:il(?:f|l)?|xp(?:f|l)?)|l(?:o(?:ck|g(?:f|l)?)|earerr)|a(?:sin(?:h(?:f|l)?|f|l)?|cos(?:h(?:f|l)?|f|l)?|tan(?:h(?:f|l)?|f|l)?|lloc|rg(?:f|l)?|bs(?:f|l)?)|real(?:f|l)?|brt(?:f|l)?)|t(?:ime|o(?:upper|lower)|an(?:h(?:f|l)?|f|l)?|runc(?:f|l)?|gamma(?:f|l)?|mp(?:nam|file))|i(?:s(?:space|n(?:ormal|an)|cntrl|inf|digit|u(?:nordered|pper)|p(?:unct|rint)|finite|w(?:space|c(?:ntrl|type)|digit|upper|p(?:unct|rint)|lower|al(?:num|pha)|graph|xdigit|blank)|l(?:ower|ess(?:equal|greater)?)|al(?:num|pha)|gr(?:eater(?:equal)?|aph)|xdigit|blank)|logb(?:f|l)?|max(?:div|abs))|di(?:v|fftime)|_Exit|unget(?:c|wc)|p(?:ow(?:f|l)?|ut(?:s|c(?:har)?|wc(?:har)?)|error|rintf)|e(?:rf(?:c(?:f|l)?|f|l)?|x(?:it|p(?:2(?:f|l)?|f|l|m1(?:f|l)?)?))|v(?:s(?:scanf|nprintf|canf|printf|w(?:scanf|printf))|printf|f(?:scanf|printf|w(?:scanf|printf))|w(?:scanf|printf)|a_(?:start|copy|end|arg))|qsort|f(?:s(?:canf|e(?:tpos|ek))|close|tell|open|dim(?:f|l)?|p(?:classify|ut(?:s|c|w(?:s|c))|rintf)|e(?:holdexcept|set(?:e(?:nv|xceptflag)|round)|clearexcept|testexcept|of|updateenv|r(?:aiseexcept|ror)|get(?:e(?:nv|xceptflag)|round))|flush|w(?:scanf|ide|printf|rite)|loor(?:f|l)?|abs(?:f|l)?|get(?:s|c|pos|w(?:s|c))|re(?:open|e|ad|xp(?:f|l)?)|m(?:in(?:f|l)?|od(?:f|l)?|a(?:f|l|x(?:f|l)?)?))|l(?:d(?:iv|exp(?:f|l)?)|o(?:ngjmp|cal(?:time|econv)|g(?:1(?:p(?:f|l)?|0(?:f|l)?)|2(?:f|l)?|f|l|b(?:f|l)?)?)|abs|l(?:div|abs|r(?:int(?:f|l)?|ound(?:f|l)?))|r(?:int(?:f|l)?|ound(?:f|l)?)|gamma(?:f|l)?)|w(?:scanf|c(?:s(?:s(?:tr|pn)|nc(?:py|at|mp)|c(?:spn|hr|oll|py|at|mp)|to(?:imax|d|u(?:l(?:l)?|max)|k|f|l(?:d|l)?|mbs)|pbrk|ftime|len|r(?:chr|tombs)|xfrm)|to(?:b|mb)|rtomb)|printf|mem(?:set|c(?:hr|py|mp)|move))|a(?:s(?:sert|ctime|in(?:h(?:f|l)?|f|l)?)|cos(?:h(?:f|l)?|f|l)?|t(?:o(?:i|f|l(?:l)?)|exit|an(?:h(?:f|l)?|2(?:f|l)?|f|l)?)|b(?:s|ort))|g(?:et(?:s|c(?:har)?|env|wc(?:har)?)|mtime)|r(?:int(?:f|l)?|ound(?:f|l)?|e(?:name|alloc|wind|m(?:ove|quo(?:f|l)?|ainder(?:f|l)?))|a(?:nd|ise))|b(?:search|towc)|m(?:odf(?:f|l)?|em(?:set|c(?:hr|py|mp)|move)|ktime|alloc|b(?:s(?:init|towcs|rtowcs)|towc|len|r(?:towc|len))))\\b",u=function(){var e="break|case|continue|default|do|else|for|goto|if|_Pragma|return|switch|while|catch|operator|try|throw|using",t="asm|__asm__|auto|bool|_Bool|char|_Complex|double|enum|float|_Imaginary|int|long|short|signed|struct|typedef|union|unsigned|void|class|wchar_t|template",n="const|extern|register|restrict|static|volatile|inline|private:|protected:|public:|friend|explicit|virtual|export|mutable|typename",r="and|and_eq|bitand|bitor|compl|not|not_eq|or|or_eq|typeid|xor|xor_eqconst_cast|dynamic_cast|reinterpret_cast|static_cast|sizeof|namespace",s="NULL|true|false|TRUE|FALSE",u=this.$keywords=this.createKeywordMapper({"keyword.control":e,"storage.type":t,"storage.modifier":n,"keyword.operator":r,"variable.language":"this","constant.language":s},"identifier"),a="[a-zA-Z\\$_¡-￿][a-zA-Zd\\$_¡-￿]*\\b";this.$rules={start:[{token:"comment",regex:"\\/\\/.*$"},i.getStartRule("doc-start"),{token:"comment",regex:"\\/\\*",next:"comment"},{token:"string",regex:'["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'},{token:"string",regex:'["].*\\\\$',next:"qqstring"},{token:"string",regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},{token:"string",regex:"['].*\\\\$",next:"qstring"},{token:"constant.numeric",regex:"0[xX][0-9a-fA-F]+(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b"},{token:"keyword",regex:"#\\s*(?:include|import|pragma|line|define|undef|if|ifdef|else|elif|ifndef)\\b",next:"directive"},{token:"keyword",regex:"(?:#\\s*endif)\\b"},{token:"support.function.C99.c",regex:o},{token:u,regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"keyword.operator",regex:"!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|==|=|!=|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|new|delete|typeof|void)"},{token:"punctuation.operator",regex:"\\?|\\:|\\,|\\;|\\."},{token:"paren.lparen",regex:"[[({]"},{token:"paren.rparen",regex:"[\\])}]"},{token:"text",regex:"\\s+"}],comment:[{token:"comment",regex:".*?\\*\\/",next:"start"},{token:"comment",regex:".+"}],qqstring:[{token:"string",regex:'(?:(?:\\\\.)|(?:[^"\\\\]))*?"',next:"start"},{token:"string",regex:".+"}],qstring:[{token:"string",regex:"(?:(?:\\\\.)|(?:[^'\\\\]))*?'",next:"start"},{token:"string",regex:".+"}],directive:[{token:"constant.other.multiline",regex:/\\/},{token:"constant.other.multiline",regex:/.*\\/},{token:"constant.other",regex:"\\s*<.+?>",next:"start"},{token:"constant.other",regex:'\\s*["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]',next:"start"},{token:"constant.other",regex:"\\s*['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']",next:"start"},{token:"constant.other",regex:/[^\\\/]+/,next:"start"}]},this.embedRules(i,"doc-",[i.getEndRule("start")])};r.inherits(u,s),t.c_cppHighlightRules=u}),ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){this.$rules={start:[{token:"comment.doc.tag",regex:"@[\\w\\d_]+"},{token:"comment.doc.tag",regex:"\\bTODO\\b"},{defaultToken:"comment.doc"}]}};r.inherits(s,i),s.getStartRule=function(e){return{token:"comment.doc",regex:"\\/\\*(?=\\*)",next:e}},s.getEndRule=function(e){return{token:"comment.doc",regex:"\\*\\/",next:e}},t.DocCommentHighlightRules=s}),ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(e,t,n){var r=e("../range").Range,i=function(){};(function(){this.checkOutdent=function(e,t){return/^\s+$/.test(e)?/^\s*\}/.test(t):!1},this.autoOutdent=function(e,t){var n=e.getLine(t),i=n.match(/^(\s*\})/);if(!i)return 0;var s=i[1].length,o=e.findMatchingBracket({row:t,column:s});if(!o||o.row==t)return 0;var u=this.$getIndent(e.getLine(o.row));e.replace(new r(t,0,t,s-1),u)},this.$getIndent=function(e){return e.match(/^\s*/)[0]}}).call(i.prototype),t.MatchingBraceOutdent=i}),ace.define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],function(e,t,n){var r=e("../../lib/oop"),i=e("../behaviour").Behaviour,s=e("../../token_iterator").TokenIterator,o=e("../../lib/lang"),u=["text","paren.rparen","punctuation.operator"],a=["text","paren.rparen","punctuation.operator","comment"],f=0,l=-1,c="",h=0,p=-1,d="",v="",m=function(){m.isSaneInsertion=function(e,t){var n=e.getCursorPosition(),r=new s(t,n.row,n.column);if(!this.$matchTokenType(r.getCurrentToken()||"text",u)){var i=new s(t,n.row,n.column+1);if(!this.$matchTokenType(i.getCurrentToken()||"text",u))return!1}return r.stepForward(),r.getCurrentTokenRow()!==n.row||this.$matchTokenType(r.getCurrentToken()||"text",a)},m.$matchTokenType=function(e,t){return t.indexOf(e.type||e)>-1},m.recordAutoInsert=function(e,t,n){var r=e.getCursorPosition(),i=t.doc.getLine(r.row);this.isAutoInsertedClosing(r,i,c[0])||(f=0),l=r.row,c=n+i.substr(r.column),f++},m.recordMaybeInsert=function(e,t,n){var r=e.getCursorPosition(),i=t.doc.getLine(r.row);this.isMaybeInsertedClosing(r,i)||(h=0),p=r.row,d=i.substr(0,r.column)+n,v=i.substr(r.column),h++},m.isAutoInsertedClosing=function(e,t,n){return f>0&&e.row===l&&n===c[0]&&t.substr(e.column)===c},m.isMaybeInsertedClosing=function(e,t){return h>0&&e.row===p&&t.substr(e.column)===v&&t.substr(0,e.column)==d},m.popAutoInsertedClosing=function(){c=c.substr(1),f--},m.clearMaybeInsertedClosing=function(){h=0,p=-1},this.add("braces","insertion",function(e,t,n,r,i){var s=n.getCursorPosition(),u=r.doc.getLine(s.row);if(i=="{"){var a=n.getSelectionRange(),f=r.doc.getTextRange(a);if(f!==""&&f!=="{"&&n.getWrapBehavioursEnabled())return{text:"{"+f+"}",selection:!1};if(m.isSaneInsertion(n,r))return/[\]\}\)]/.test(u[s.column])||n.inMultiSelectMode?(m.recordAutoInsert(n,r,"}"),{text:"{}",selection:[1,1]}):(m.recordMaybeInsert(n,r,"{"),{text:"{",selection:[1,1]})}else if(i=="}"){var l=u.substring(s.column,s.column+1);if(l=="}"){var c=r.$findOpeningBracket("}",{column:s.column+1,row:s.row});if(c!==null&&m.isAutoInsertedClosing(s,u,i))return m.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}else{if(i=="\n"||i=="\r\n"){var p="";m.isMaybeInsertedClosing(s,u)&&(p=o.stringRepeat("}",h),m.clearMaybeInsertedClosing());var l=u.substring(s.column,s.column+1);if(l==="}"){var d=r.findMatchingBracket({row:s.row,column:s.column+1},"}");if(!d)return null;var v=this.$getIndent(r.getLine(d.row))}else{if(!p)return;var v=this.$getIndent(u)}var g=v+r.getTabString();return{text:"\n"+g+"\n"+v+p,selection:[1,g.length,1,g.length]}}m.clearMaybeInsertedClosing()}}),this.add("braces","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&s=="{"){var o=r.doc.getLine(i.start.row),u=o.substring(i.end.column,i.end.column+1);if(u=="}")return i.end.column++,i;h--}}),this.add("parens","insertion",function(e,t,n,r,i){if(i=="("){var s=n.getSelectionRange(),o=r.doc.getTextRange(s);if(o!==""&&n.getWrapBehavioursEnabled())return{text:"("+o+")",selection:!1};if(m.isSaneInsertion(n,r))return m.recordAutoInsert(n,r,")"),{text:"()",selection:[1,1]}}else if(i==")"){var u=n.getCursorPosition(),a=r.doc.getLine(u.row),f=a.substring(u.column,u.column+1);if(f==")"){var l=r.$findOpeningBracket(")",{column:u.column+1,row:u.row});if(l!==null&&m.isAutoInsertedClosing(u,a,i))return m.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("parens","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&s=="("){var o=r.doc.getLine(i.start.row),u=o.substring(i.start.column+1,i.start.column+2);if(u==")")return i.end.column++,i}}),this.add("brackets","insertion",function(e,t,n,r,i){if(i=="["){var s=n.getSelectionRange(),o=r.doc.getTextRange(s);if(o!==""&&n.getWrapBehavioursEnabled())return{text:"["+o+"]",selection:!1};if(m.isSaneInsertion(n,r))return m.recordAutoInsert(n,r,"]"),{text:"[]",selection:[1,1]}}else if(i=="]"){var u=n.getCursorPosition(),a=r.doc.getLine(u.row),f=a.substring(u.column,u.column+1);if(f=="]"){var l=r.$findOpeningBracket("]",{column:u.column+1,row:u.row});if(l!==null&&m.isAutoInsertedClosing(u,a,i))return m.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("brackets","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&s=="["){var o=r.doc.getLine(i.start.row),u=o.substring(i.start.column+1,i.start.column+2);if(u=="]")return i.end.column++,i}}),this.add("string_dquotes","insertion",function(e,t,n,r,i){if(i=='"'||i=="'"){var s=i,o=n.getSelectionRange(),u=r.doc.getTextRange(o);if(u!==""&&u!=="'"&&u!='"'&&n.getWrapBehavioursEnabled())return{text:s+u+s,selection:!1};var a=n.getCursorPosition(),f=r.doc.getLine(a.row),l=f.substring(a.column-1,a.column);if(l=="\\")return null;var c=r.getTokens(o.start.row),h=0,p,d=-1;for(var v=0;v<c.length;v++){p=c[v],p.type=="string"?d=-1:d<0&&(d=p.value.indexOf(s));if(p.value.length+h>o.start.column)break;h+=c[v].value.length}if(!p||d<0&&p.type!=="comment"&&(p.type!=="string"||o.start.column!==p.value.length+h-1&&p.value.lastIndexOf(s)===p.value.length-1)){if(!m.isSaneInsertion(n,r))return;return{text:s+s,selection:[1,1]}}if(p&&p.type==="string"){var g=f.substring(a.column,a.column+1);if(g==s)return{text:"",selection:[1,1]}}}}),this.add("string_dquotes","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&(s=='"'||s=="'")){var o=r.doc.getLine(i.start.row),u=o.substring(i.start.column+1,i.start.column+2);if(u==s)return i.end.column++,i}})};r.inherits(m,i),t.CstyleBehaviour=m}),ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(e,t,n){var r=e("../../lib/oop"),i=e("../../range").Range,s=e("./fold_mode").FoldMode,o=t.FoldMode=function(e){e&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+e.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+e.end)))};r.inherits(o,s),function(){this.foldingStartMarker=/(\{|\[)[^\}\]]*$|^\s*(\/\*)/,this.foldingStopMarker=/^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/,this.getFoldWidgetRange=function(e,t,n,r){var i=e.getLine(n),s=i.match(this.foldingStartMarker);if(s){var o=s.index;if(s[1])return this.openingBracketBlock(e,s[1],n,o);var u=e.getCommentFoldRange(n,o+s[0].length,1);return u&&!u.isMultiLine()&&(r?u=this.getSectionRange(e,n):t!="all"&&(u=null)),u}if(t==="markbegin")return;var s=i.match(this.foldingStopMarker);if(s){var o=s.index+s[0].length;return s[1]?this.closingBracketBlock(e,s[1],n,o):e.getCommentFoldRange(n,o,-1)}},this.getSectionRange=function(e,t){var n=e.getLine(t),r=n.search(/\S/),s=t,o=n.length;t+=1;var u=t,a=e.getLength();while(++t<a){n=e.getLine(t);var f=n.search(/\S/);if(f===-1)continue;if(r>f)break;var l=this.getFoldWidgetRange(e,"all",t);if(l){if(l.start.row<=s)break;if(l.isMultiLine())t=l.end.row;else if(r==f)break}u=t}return new i(s,o,u,e.getLine(u).length)}}.call(o.prototype)})
define([ 'angular', 'jquery', 'components/skill/module' ], function (ng, $, module) { 'use strict'; module.factory('SkillPromise', ['$q', function ($q) { var deferred = $q.defer(); return { getPromise: function () { return deferred.promise; }, getDefer: function () { return deferred; } }; }]); return module; });
const { assert } = require('chai'); const hooks = require('../../lib/services'); let hookBefore; let hookFindNested; describe('services keepQueryInArray', () => { describe('removes fields', () => { beforeEach(() => { hookBefore = { type: 'before', method: 'find', params: { provider: 'rest' }, query: { users: [{ first: 'John', last: 'Doe' }] } }; }); it('updates hook before::find', () => { hooks.keepQueryInArray('users', ['last'])(hookBefore); assert.deepEqual(hookBefore.query, { users: [{ last: 'Doe' }] }); }); it('ignores bad or missing field', () => { hooks.keepQueryInArray('xx', ['last'])(hookBefore); assert.deepEqual(hookBefore.query, { users: [{ first: 'John', last: 'Doe' }] }); }); it('does not throw if field is missing', () => { const hook = { type: 'before', method: 'find', params: { provider: 'rest' }, query: { users: [{ first: 'John', last: 'Doe' }] } }; hooks.keepQueryInArray('users', ['last', 'xx'])(hook); assert.deepEqual(hook.query, { users: [{ last: 'Doe' }] }); }); it('keeps undefined values', () => { const hook = { type: 'before', method: 'find', params: { provider: 'rest' }, query: { users: [{ first: undefined, last: 'Doe' }] } }; hooks.keepQueryInArray('users', ['first'])(hook); assert.deepEqual(hook.query, { users: [{ first: undefined }] }); }); it('keeps null values', () => { const hook = { type: 'before', method: 'find', params: { provider: 'rest' }, query: { users: [{ first: null, last: 'Doe' }] } }; hooks.keepQueryInArray('users', ['first'])(hook); assert.deepEqual(hook.query, { users: [{ first: null }] }); }); it('keeps false values', () => { const hook = { type: 'before', method: 'find', params: { provider: 'rest' }, query: { users: [{ first: false, last: 'Doe' }] } }; hooks.keepQueryInArray('users', ['first'])(hook); assert.deepEqual(hook.query, { users: [{ first: false }] }); }); it('keeps 0 values', () => { const hook = { type: 'before', method: 'find', params: { provider: 'rest' }, query: { users: [{ first: 0, last: 'Doe' }] } }; hooks.keepQueryInArray('users', ['first'])(hook); assert.deepEqual(hook.query, { users: [{ first: 0 }] }); }); it('keeps empty string values', () => { const hook = { type: 'before', method: 'find', params: { provider: 'rest' }, query: { users: [{ first: '', last: 'Doe' }] } }; hooks.keepQueryInArray('users', ['first'])(hook); assert.deepEqual(hook.query, { users: [{ first: '' }] }); }); }); describe('handles dot notation', () => { beforeEach(() => { hookBefore = { type: 'before', method: 'find', params: { provider: 'rest' }, query: { users: [{ empl: { name: { first: 'John', last: 'Doe' }, status: 'AA' }, dept: 'Acct' }] } }; hookFindNested = { type: 'before', method: 'find', params: { provider: 'rest' }, query: { account: { users: [{ first: 'John', last: 'Doe' }] } } }; }); it('updates hook find with dot notation field ', () => { hooks.keepQueryInArray('account.users', ['first'])(hookFindNested); assert.deepEqual(hookFindNested.query, { account: { users: [{ first: 'John' }] } }); }); it('prop with no dots', () => { hooks.keepQueryInArray('users', ['empl'])(hookBefore); assert.deepEqual(hookBefore.query, { users: [{ empl: { name: { first: 'John', last: 'Doe' }, status: 'AA' } }] } ); }); it('prop with 1 dot', () => { hooks.keepQueryInArray('users', ['empl.name', 'dept'])(hookBefore); assert.deepEqual(hookBefore.query, { users: [{ empl: { name: { first: 'John', last: 'Doe' } }, dept: 'Acct' }] } ); }); it('prop with 2 dots', () => { hooks.keepQueryInArray('users', ['empl.name.last', 'empl.status', 'dept'])(hookBefore); assert.deepEqual(hookBefore.query, { users: [{ empl: { name: { last: 'Doe' }, status: 'AA' }, dept: 'Acct' }] } ); }); it('ignores bad or missing paths', () => { hooks.keepQueryInArray('users', ['empl.name.first', 'empl.name.surname'])(hookBefore); assert.deepEqual(hookBefore.query, { users: [{ empl: { name: { first: 'John' } } }] } ); }); it('ignores bad or missing no dot path', () => { hooks.keepQueryInArray('users', ['xx'])(hookBefore); assert.deepEqual(hookBefore.query, { users: [{}] }); }); }); describe('removes non-object records', () => { beforeEach(() => { hookBefore = { type: 'before', method: 'find', params: { provider: 'rest' }, query: { users: [{ empl: { name: { first: 'John', last: 'Doe' }, status: 'AA' }, dept: 'Acct' }, null, undefined, Infinity] } }; }); it('before', () => { hooks.keepQueryInArray('users', ['empl'])(hookBefore); assert.deepEqual(hookBefore.query, { users: [{ empl: { name: { first: 'John', last: 'Doe' }, status: 'AA' } }, null, undefined, Infinity] } ); }); }); });
import React, { Component } from 'react'; import { StyleSheet, Text, View } from 'react-native'; import F2charts from 'native-f2charts'; export default class AreaShade extends Component { static navigationOptions = ({ navigation }) => ({ title: `Area (Column) - Shade`, }); constructor(props) { super(props); const data = [ { time: '2016-08-08 00:00:00', tem: 10}, { time: '2016-08-08 00:10:00', tem: 22}, { time: '2016-08-08 00:30:00', tem: 16}, { time: '2016-08-09 00:35:00', tem: 26}, { time: '2016-08-09 01:00:00', tem: 12}, { time: '2016-08-09 01:20:00', tem: 26}, { time: '2016-08-10 01:40:00', tem: 18}, { time: '2016-08-10 02:00:00', tem: 26}, { time: '2016-08-10 02:20:00', tem: 12} ]; this.state = { data, option : ` var data = ${JSON.stringify(data)}; chart.source(data, { time: { type: 'timeCat', tickCount: 3, range: [ 0, 1 ] }, tem: { tickCount: 5, min: 0 } }); /* 配置刻度文字大小,供PC端显示用(移动端可以使用默认值20px) */ chart.axis('tem', { label: { fontSize: 14 } }); /* 配置time刻度文字样式 */ chart.axis('time', { label(text, index, total) { const cfg = { fill: '#979797', font: '14px san-serif', offset: 6 }; /* 第一个点左对齐,最后一个点右对齐,其余居中,只有一个点时左对齐 */ if (index === 0) { cfg.textAlign = 'start'; } if (index > 0 && index === total - 1) { cfg.textAlign = 'end'; } return cfg; } }); var canvas = document.getElementById('main'); var ctx = canvas.getContext('2d'); var grd = ctx.createLinearGradient(0,0,500,0); grd.addColorStop(0,"#293c55"); grd.addColorStop(1,"#f7f7f7"); chart.area().position('time*tem') .color(grd) .shape('smooth') .style({ opacity: 0.6 }); chart.render();`, text: 'test' }; } render() { return ( <View style={styles.container}> <Text style={styles.welcome}> Welcome to React Native F2charts </Text> <F2charts option={this.state.option} height={300} width={330} datasource={this.state.data}/> </View> ); } } const styles = StyleSheet.create({ container: { flex: 1, justifyContent: 'center', alignItems: 'center', backgroundColor: '#F5FCFF', }, welcome: { fontSize: 20, textAlign: 'center', margin: 30, } });
/* Copyright 2020-2021 Lowdefy, Inc Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ import schema from './GoogleSheetUpdateOneSchema.json'; import cleanRows from '../cleanRows'; import getSheet from '../getSheet'; import { transformRead, transformWrite } from '../transformTypes'; import mingoFilter from '../../../utils/mingoFilter'; async function googleSheetUpdateOne({ request, connection }) { const { filter, update, options = {} } = request; const { limit, skip, upsert, raw } = options; const sheet = await getSheet({ connection }); let rows = await sheet.getRows({ limit, offset: skip }); rows = transformRead({ input: rows, types: connection.columnTypes }); rows = mingoFilter({ input: rows, filter }); const transformedUpdate = transformWrite({ input: update, types: connection.columnTypes }); if (rows.length === 0) { if (upsert) { const insertedRow = await sheet.addRow(transformedUpdate, { raw }); return { modifiedCount: 1, upserted: true, row: cleanRows(insertedRow), }; } return { modifiedCount: 0, upserted: false, }; } const row = rows[0]; Object.assign(row, transformedUpdate); await row.save({ raw }); return { modifiedCount: 1, upserted: false, row: cleanRows(row), }; } export default { resolver: googleSheetUpdateOne, schema, checkRead: false, checkWrite: true };
/* * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following disclaimer * in the documentation and/or other materials provided with the * distribution. * * Neither the name of Google Inc. nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** * @constructor */ function InspectorBackendClass() { this._connection = null; this._agentPrototypes = {}; this._dispatcherPrototypes = {}; this._initialized = false; this._enums = {}; this._initProtocolAgentsConstructor(); } InspectorBackendClass._DevToolsErrorCode = -32000; InspectorBackendClass.prototype = { _initProtocolAgentsConstructor: function() { window.Protocol = {}; /** * @constructor * @param {!Object.<string, !Object>} agentsMap */ window.Protocol.Agents = function(agentsMap) { this._agentsMap = agentsMap; }; }, /** * @param {string} domain */ _addAgentGetterMethodToProtocolAgentsPrototype: function(domain) { var upperCaseLength = 0; while (upperCaseLength < domain.length && domain[upperCaseLength].toLowerCase() !== domain[upperCaseLength]) ++upperCaseLength; var methodName = domain.substr(0, upperCaseLength).toLowerCase() + domain.slice(upperCaseLength) + "Agent"; /** * @this {Protocol.Agents} */ function agentGetter() { return this._agentsMap[domain]; } window.Protocol.Agents.prototype[methodName] = agentGetter; /** * @this {Protocol.Agents} */ function registerDispatcher(dispatcher) { this.registerDispatcher(domain, dispatcher) } window.Protocol.Agents.prototype["register" + domain + "Dispatcher"] = registerDispatcher; }, /** * @return {!InspectorBackendClass.Connection} */ connection: function() { if (!this._connection) throw "Main connection was not initialized"; return this._connection; }, /** * @param {!InspectorBackendClass.MainConnection} connection */ setConnection: function(connection) { this._connection = connection; this._connection.registerAgentsOn(window); for (var type in this._enums) { var domainAndMethod = type.split("."); window[domainAndMethod[0] + "Agent"][domainAndMethod[1]] = this._enums[type]; } }, /** * @param {string} domain * @return {!InspectorBackendClass.AgentPrototype} */ _agentPrototype: function(domain) { if (!this._agentPrototypes[domain]) { this._agentPrototypes[domain] = new InspectorBackendClass.AgentPrototype(domain); this._addAgentGetterMethodToProtocolAgentsPrototype(domain); } return this._agentPrototypes[domain]; }, /** * @param {string} domain * @return {!InspectorBackendClass.DispatcherPrototype} */ _dispatcherPrototype: function(domain) { if (!this._dispatcherPrototypes[domain]) this._dispatcherPrototypes[domain] = new InspectorBackendClass.DispatcherPrototype(); return this._dispatcherPrototypes[domain]; }, /** * @param {string} method * @param {!Array.<!Object>} signature * @param {!Array.<string>} replyArgs * @param {boolean} hasErrorData */ registerCommand: function(method, signature, replyArgs, hasErrorData) { var domainAndMethod = method.split("."); this._agentPrototype(domainAndMethod[0]).registerCommand(domainAndMethod[1], signature, replyArgs, hasErrorData); this._initialized = true; }, /** * @param {string} type * @param {!Object} values */ registerEnum: function(type, values) { this._enums[type] = values; this._initialized = true; }, /** * @param {string} eventName * @param {!Object} params */ registerEvent: function(eventName, params) { var domain = eventName.split(".")[0]; this._dispatcherPrototype(domain).registerEvent(eventName, params); this._initialized = true; }, /** * @param {string} domain * @param {!Object} dispatcher */ registerDomainDispatcher: function(domain, dispatcher) { this._connection.registerDispatcher(domain, dispatcher); }, /** * @param {string} jsonUrl */ loadFromJSONIfNeeded: function(jsonUrl) { if (this._initialized) return; var xhr = new XMLHttpRequest(); xhr.open("GET", jsonUrl, false); xhr.send(null); var schema = JSON.parse(xhr.responseText); var code = InspectorBackendClass._generateCommands(schema); eval(code); }, /** * @param {function(T)} clientCallback * @param {string} errorPrefix * @param {function(new:T,S)=} constructor * @param {T=} defaultValue * @return {function(?string, S)} * @template T,S */ wrapClientCallback: function(clientCallback, errorPrefix, constructor, defaultValue) { /** * @param {?string} error * @param {S} value * @template S */ function callbackWrapper(error, value) { if (error) { console.error(errorPrefix + error); clientCallback(defaultValue); return; } if (constructor) clientCallback(new constructor(value)); else clientCallback(value); } return callbackWrapper; } } /** * @param {*} schema * @return {string} */ InspectorBackendClass._generateCommands = function(schema) { var jsTypes = { integer: "number", array: "object" }; var rawTypes = {}; var result = []; var domains = schema["domains"] || []; for (var i = 0; i < domains.length; ++i) { var domain = domains[i]; for (var j = 0; domain.types && j < domain.types.length; ++j) { var type = domain.types[j]; rawTypes[domain.domain + "." + type.id] = jsTypes[type.type] || type.type; } } function toUpperCase(groupIndex, group0, group1) { return [group0, group1][groupIndex].toUpperCase(); } function generateEnum(enumName, items) { var members = [] for (var m = 0; m < items.length; ++m) { var value = items[m]; var name = value.replace(/-(\w)/g, toUpperCase.bind(null, 1)).toTitleCase(); name = name.replace(/HTML|XML|WML|API/ig, toUpperCase.bind(null, 0)); members.push(name + ": \"" + value +"\""); } return "InspectorBackend.registerEnum(\"" + enumName + "\", {" + members.join(", ") + "});"; } for (var i = 0; i < domains.length; ++i) { var domain = domains[i]; var types = domain["types"] || []; for (var j = 0; j < types.length; ++j) { var type = types[j]; if ((type["type"] === "string") && type["enum"]) result.push(generateEnum(domain.domain + "." + type.id, type["enum"])); else if (type["type"] === "object") { var properties = type["properties"] || []; for (var k = 0; k < properties.length; ++k) { var property = properties[k]; if ((property["type"] === "string") && property["enum"]) result.push(generateEnum(domain.domain + "." + type.id + property["name"].toTitleCase(), property["enum"])); } } } var commands = domain["commands"] || []; for (var j = 0; j < commands.length; ++j) { var command = commands[j]; var parameters = command["parameters"]; var paramsText = []; for (var k = 0; parameters && k < parameters.length; ++k) { var parameter = parameters[k]; var type; if (parameter.type) type = jsTypes[parameter.type] || parameter.type; else { var ref = parameter["$ref"]; if (ref.indexOf(".") !== -1) type = rawTypes[ref]; else type = rawTypes[domain.domain + "." + ref]; } var text = "{\"name\": \"" + parameter.name + "\", \"type\": \"" + type + "\", \"optional\": " + (parameter.optional ? "true" : "false") + "}"; paramsText.push(text); } var returnsText = []; var returns = command["returns"] || []; for (var k = 0; k < returns.length; ++k) { var parameter = returns[k]; returnsText.push("\"" + parameter.name + "\""); } var hasErrorData = String(Boolean(command.error)); result.push("InspectorBackend.registerCommand(\"" + domain.domain + "." + command.name + "\", [" + paramsText.join(", ") + "], [" + returnsText.join(", ") + "], " + hasErrorData + ");"); } for (var j = 0; domain.events && j < domain.events.length; ++j) { var event = domain.events[j]; var paramsText = []; for (var k = 0; event.parameters && k < event.parameters.length; ++k) { var parameter = event.parameters[k]; paramsText.push("\"" + parameter.name + "\""); } result.push("InspectorBackend.registerEvent(\"" + domain.domain + "." + event.name + "\", [" + paramsText.join(", ") + "]);"); } result.push("InspectorBackend.register" + domain.domain + "Dispatcher = InspectorBackend.registerDomainDispatcher.bind(InspectorBackend, \"" + domain.domain + "\");"); } return result.join("\n"); } /** * @constructor * @extends {WebInspector.Object} */ InspectorBackendClass.Connection = function() { this._lastMessageId = 1; this._pendingResponsesCount = 0; this._agents = {}; this._dispatchers = {}; this._callbacks = {}; this._initialize(InspectorBackend._agentPrototypes, InspectorBackend._dispatcherPrototypes); this._isConnected = true; } InspectorBackendClass.Connection.Events = { Disconnected: "Disconnected", } InspectorBackendClass.Connection.prototype = { /** * @param {!Object.<string, !InspectorBackendClass.AgentPrototype>} agentPrototypes * @param {!Object.<string, !InspectorBackendClass.DispatcherPrototype>} dispatcherPrototypes */ _initialize: function(agentPrototypes, dispatcherPrototypes) { for (var domain in agentPrototypes) { this._agents[domain] = Object.create(agentPrototypes[domain]); this._agents[domain].setConnection(this); } for (var domain in dispatcherPrototypes) this._dispatchers[domain] = Object.create(dispatcherPrototypes[domain]) }, /** * @param {!Object} object */ registerAgentsOn: function(object) { for (var domain in this._agents) object[domain + "Agent"] = this._agents[domain]; }, /** * @return {number} */ nextMessageId: function() { return this._lastMessageId++; }, /** * @param {string} domain * @return {!InspectorBackendClass.AgentPrototype} */ agent: function(domain) { return this._agents[domain]; }, /** * @return {!Object.<string, !Object>} */ agentsMap: function() { return this._agents; }, /** * @param {string} domain * @param {string} method * @param {?Object} params * @param {?function(*)} callback * @private */ _wrapCallbackAndSendMessageObject: function(domain, method, params, callback) { if (!this._isConnected && callback) { this._dispatchConnectionErrorResponse(domain, method, callback); return; } var messageObject = {}; var messageId = this.nextMessageId(); messageObject.id = messageId; messageObject.method = method; if (params) messageObject.params = params; var wrappedCallback = this._wrap(callback, domain, method); if (InspectorBackendClass.Options.dumpInspectorProtocolMessages) this._dumpProtocolMessage("frontend: " + JSON.stringify(messageObject)); this.sendMessage(messageObject); ++this._pendingResponsesCount; this._callbacks[messageId] = wrappedCallback; }, /** * @param {?function(*)} callback * @param {string} method * @param {string} domain * @return {!function(*)} */ _wrap: function(callback, domain, method) { if (!callback) callback = function() {}; callback.methodName = method; callback.domain = domain; if (InspectorBackendClass.Options.dumpInspectorTimeStats) callback.sendRequestTime = Date.now(); return callback; }, /** * @param {!Object} messageObject */ sendMessage: function(messageObject) { throw "Not implemented"; }, /** * @param {!Object} messageObject */ reportProtocolError: function(messageObject) { console.error("Protocol Error: the message with wrong id. Message = " + JSON.stringify(messageObject)); }, /** * @param {!Object|string} message */ dispatch: function(message) { if (InspectorBackendClass.Options.dumpInspectorProtocolMessages) this._dumpProtocolMessage("backend: " + ((typeof message === "string") ? message : JSON.stringify(message))); var messageObject = /** @type {!Object} */ ((typeof message === "string") ? JSON.parse(message) : message); if ("id" in messageObject) { // just a response for some request var callback = this._callbacks[messageObject.id]; if (!callback) { this.reportProtocolError(messageObject); return; } var processingStartTime; if (InspectorBackendClass.Options.dumpInspectorTimeStats) processingStartTime = Date.now(); this.agent(callback.domain).dispatchResponse(messageObject, callback.methodName, callback); --this._pendingResponsesCount; delete this._callbacks[messageObject.id]; if (InspectorBackendClass.Options.dumpInspectorTimeStats) console.log("time-stats: " + callback.methodName + " = " + (processingStartTime - callback.sendRequestTime) + " + " + (Date.now() - processingStartTime)); if (this._scripts && !this._pendingResponsesCount) this.runAfterPendingDispatches(); return; } else { var method = messageObject.method.split("."); var domainName = method[0]; if (!(domainName in this._dispatchers)) { console.error("Protocol Error: the message " + messageObject.method + " is for non-existing domain '" + domainName + "'"); return; } this._dispatchers[domainName].dispatch(method[1], messageObject); } }, /** * @param {string} domain * @param {!Object} dispatcher */ registerDispatcher: function(domain, dispatcher) { if (!this._dispatchers[domain]) return; this._dispatchers[domain].setDomainDispatcher(dispatcher); }, /** * @param {string=} script */ runAfterPendingDispatches: function(script) { if (!this._scripts) this._scripts = []; if (script) this._scripts.push(script); if (!this._pendingResponsesCount) { var scripts = this._scripts; this._scripts = []; for (var id = 0; id < scripts.length; ++id) scripts[id].call(this); } }, _dumpProtocolMessage: function(message) { console.log(message); }, /** * @protected * @param {string} reason */ connectionClosed: function(reason) { this._isConnected = false; this._runPendingCallbacks(); this.dispatchEventToListeners(InspectorBackendClass.Connection.Events.Disconnected, {reason: reason}); }, _runPendingCallbacks: function() { var keys = Object.keys(this._callbacks).map(function(num) {return parseInt(num, 10)}); for (var i = 0; i < keys.length; ++i) { var callback = this._callbacks[keys[i]]; this._dispatchConnectionErrorResponse(callback.domain, callback.methodName, callback) } this._callbacks = {}; }, /** * @param {string} domain * @param {string} methodName * @param {!function(*)} callback */ _dispatchConnectionErrorResponse: function(domain, methodName, callback) { var error = { message: "Connection is closed", code: InspectorBackendClass._DevToolsErrorCode, data: null}; var messageObject = {error: error}; setTimeout(InspectorBackendClass.AgentPrototype.prototype.dispatchResponse.bind(this.agent(domain), messageObject, methodName, callback), 0); }, /** * @return {boolean} */ isClosed: function() { return !this._isConnected; }, /** * @param {!Array.<string>} domains */ suppressErrorsForDomains: function(domains) { domains.forEach(function(domain) { this._agents[domain].suppressErrorLogging(); }, this); }, __proto__: WebInspector.Object.prototype } /** * @constructor * @extends {InspectorBackendClass.Connection} */ InspectorBackendClass.MainConnection = function() { InspectorBackendClass.Connection.call(this); InspectorFrontendHost.events.addEventListener(InspectorFrontendHostAPI.Events.DispatchMessage, this._dispatchMessage, this); } InspectorBackendClass.MainConnection.prototype = { /** * @param {!Object} messageObject */ sendMessage: function(messageObject) { var message = JSON.stringify(messageObject); InspectorFrontendHost.sendMessageToBackend(message); }, /** * @param {!WebInspector.Event} event */ _dispatchMessage: function(event) { this.dispatch(/** @type {!Object|string} */ (event.data)); }, __proto__: InspectorBackendClass.Connection.prototype } /** * @constructor * @extends {InspectorBackendClass.Connection} * @param {string} url * @param {!function(!InspectorBackendClass.Connection)} onConnectionReady */ InspectorBackendClass.WebSocketConnection = function(url, onConnectionReady) { InspectorBackendClass.Connection.call(this); this._socket = new WebSocket(url); this._socket.onmessage = this._onMessage.bind(this); this._socket.onerror = this._onError.bind(this); this._socket.onopen = onConnectionReady.bind(null, this); this._socket.onclose = this.connectionClosed.bind(this, "websocket_closed"); } /** * @param {string} url * @param {!function(!InspectorBackendClass.Connection)} onConnectionReady */ InspectorBackendClass.WebSocketConnection.Create = function(url, onConnectionReady) { new InspectorBackendClass.WebSocketConnection(url, onConnectionReady); } InspectorBackendClass.WebSocketConnection.prototype = { /** * @param {!MessageEvent} message */ _onMessage: function(message) { var data = /** @type {string} */ (message.data) this.dispatch(data); }, /** * @param {!Event} error */ _onError: function(error) { console.error(error); }, /** * @param {!Object} messageObject */ sendMessage: function(messageObject) { var message = JSON.stringify(messageObject); this._socket.send(message); }, __proto__: InspectorBackendClass.Connection.prototype } /** * @constructor * @extends {InspectorBackendClass.Connection} */ InspectorBackendClass.StubConnection = function() { InspectorBackendClass.Connection.call(this); } InspectorBackendClass.StubConnection.prototype = { /** * @param {!Object} messageObject */ sendMessage: function(messageObject) { var message = JSON.stringify(messageObject); setTimeout(this._echoResponse.bind(this, messageObject), 0); }, /** * @param {!Object} messageObject */ _echoResponse: function(messageObject) { this.dispatch(messageObject) }, __proto__: InspectorBackendClass.Connection.prototype } /** * @constructor * @param {string} domain */ InspectorBackendClass.AgentPrototype = function(domain) { this._replyArgs = {}; this._hasErrorData = {}; this._domain = domain; this._suppressErrorLogging = false; } InspectorBackendClass.AgentPrototype.prototype = { /** * @param {!InspectorBackendClass.Connection} connection */ setConnection: function(connection) { this._connection = connection; }, /** * @param {string} methodName * @param {!Array.<!Object>} signature * @param {!Array.<string>} replyArgs * @param {boolean} hasErrorData */ registerCommand: function(methodName, signature, replyArgs, hasErrorData) { var domainAndMethod = this._domain + "." + methodName; /** * @this {InspectorBackendClass.AgentPrototype} */ function sendMessage(vararg) { var params = [domainAndMethod, signature].concat(Array.prototype.slice.call(arguments)); InspectorBackendClass.AgentPrototype.prototype._sendMessageToBackend.apply(this, params); } this[methodName] = sendMessage; /** * @this {InspectorBackendClass.AgentPrototype} */ function invoke(vararg) { var params = [domainAndMethod].concat(Array.prototype.slice.call(arguments)); InspectorBackendClass.AgentPrototype.prototype._invoke.apply(this, params); } this["invoke_" + methodName] = invoke; this._replyArgs[domainAndMethod] = replyArgs; if (hasErrorData) this._hasErrorData[domainAndMethod] = true; }, /** * @param {string} method * @param {!Array.<!Object>} signature * @param {*} vararg * @private */ _sendMessageToBackend: function(method, signature, vararg) { var args = Array.prototype.slice.call(arguments, 2); var callback = (args.length && typeof args[args.length - 1] === "function") ? args.pop() : null; var params = {}; var hasParams = false; for (var i = 0; i < signature.length; ++i) { var param = signature[i]; var paramName = param["name"]; var typeName = param["type"]; var optionalFlag = param["optional"]; if (!args.length && !optionalFlag) { console.error("Protocol Error: Invalid number of arguments for method '" + method + "' call. It must have the following arguments '" + JSON.stringify(signature) + "'."); return; } var value = args.shift(); if (optionalFlag && typeof value === "undefined") { continue; } if (typeof value !== typeName) { console.error("Protocol Error: Invalid type of argument '" + paramName + "' for method '" + method + "' call. It must be '" + typeName + "' but it is '" + typeof value + "'."); return; } params[paramName] = value; hasParams = true; } if (args.length === 1 && !callback && (typeof args[0] !== "undefined")) { console.error("Protocol Error: Optional callback argument for method '" + method + "' call must be a function but its type is '" + typeof args[0] + "'."); return; } this._connection._wrapCallbackAndSendMessageObject(this._domain, method, hasParams ? params : null, callback); }, /** * @param {string} method * @param {?Object} args * @param {?function(*)} callback */ _invoke: function(method, args, callback) { this._connection._wrapCallbackAndSendMessageObject(this._domain, method, args, callback); }, /** * @param {!Object} messageObject * @param {string} methodName * @param {function(!Array.<*>)} callback */ dispatchResponse: function(messageObject, methodName, callback) { if (messageObject.error && messageObject.error.code !== InspectorBackendClass._DevToolsErrorCode && !InspectorBackendClass.Options.suppressRequestErrors && !this._suppressErrorLogging) console.error("Request with id = " + messageObject.id + " failed. " + JSON.stringify(messageObject.error)); var argumentsArray = []; argumentsArray[0] = messageObject.error ? messageObject.error.message: null; if (this._hasErrorData[methodName]) argumentsArray[1] = messageObject.error ? messageObject.error.data : null; if (messageObject.result) { var paramNames = this._replyArgs[methodName] || []; for (var i = 0; i < paramNames.length; ++i) argumentsArray.push(messageObject.result[paramNames[i]]); } callback.apply(null, argumentsArray); }, suppressErrorLogging: function() { this._suppressErrorLogging = true; } } /** * @constructor */ InspectorBackendClass.DispatcherPrototype = function() { this._eventArgs = {}; this._dispatcher = null; } InspectorBackendClass.DispatcherPrototype.prototype = { /** * @param {string} eventName * @param {!Object} params */ registerEvent: function(eventName, params) { this._eventArgs[eventName] = params }, /** * @param {!Object} dispatcher */ setDomainDispatcher: function(dispatcher) { this._dispatcher = dispatcher; }, /** * @param {string} functionName * @param {!Object} messageObject */ dispatch: function(functionName, messageObject) { if (!this._dispatcher) return; if (!(functionName in this._dispatcher)) { console.error("Protocol Error: Attempted to dispatch an unimplemented method '" + messageObject.method + "'"); return; } if (!this._eventArgs[messageObject.method]) { console.error("Protocol Error: Attempted to dispatch an unspecified method '" + messageObject.method + "'"); return; } var params = []; if (messageObject.params) { var paramNames = this._eventArgs[messageObject.method]; for (var i = 0; i < paramNames.length; ++i) params.push(messageObject.params[paramNames[i]]); } var processingStartTime; if (InspectorBackendClass.Options.dumpInspectorTimeStats) processingStartTime = Date.now(); this._dispatcher[functionName].apply(this._dispatcher, params); if (InspectorBackendClass.Options.dumpInspectorTimeStats) console.log("time-stats: " + messageObject.method + " = " + (Date.now() - processingStartTime)); } } InspectorBackendClass.Options = { dumpInspectorTimeStats: false, dumpInspectorProtocolMessages: false, suppressRequestErrors: false } InspectorBackend = new InspectorBackendClass();
var buildFormattingTokensRegExp = require('../../_lib/build_formatting_tokens_reg_exp/index.js') function buildFormatLocale () { // Note: in English, the names of days of the week and months are capitalized. // If you are making a new locale based on this one, check if the same is true for the langugage you're working on. // Generally, formatted dates should look like they are in the middle of a sentence, // e.g. in Spanish language the weekdays and months should be in the lowercase. var months3char = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] var monthsFull = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'] var weekdays2char = ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'] var weekdays3char = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'] var weekdaysFull = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'] var meridiemUppercase = ['AM', 'PM'] var meridiemLowercase = ['am', 'pm'] var meridiemFull = ['a.m.', 'p.m.'] var formatters = { // Month: Jan, Feb, ..., Dec 'MMM': function (date) { return months3char[date.getMonth()] }, // Month: January, February, ..., December 'MMMM': function (date) { return monthsFull[date.getMonth()] }, // Day of week: Su, Mo, ..., Sa 'dd': function (date) { return weekdays2char[date.getDay()] }, // Day of week: Sun, Mon, ..., Sat 'ddd': function (date) { return weekdays3char[date.getDay()] }, // Day of week: Sunday, Monday, ..., Saturday 'dddd': function (date) { return weekdaysFull[date.getDay()] }, // AM, PM 'A': function (date) { return (date.getHours() / 12) >= 1 ? meridiemUppercase[1] : meridiemUppercase[0] }, // am, pm 'a': function (date) { return (date.getHours() / 12) >= 1 ? meridiemLowercase[1] : meridiemLowercase[0] }, // a.m., p.m. 'aa': function (date) { return (date.getHours() / 12) >= 1 ? meridiemFull[1] : meridiemFull[0] } } // Generate ordinal version of formatters: M -> Mo, D -> Do, etc. var ordinalFormatters = ['M', 'D', 'DDD', 'd', 'Q', 'W'] ordinalFormatters.forEach(function (formatterToken) { formatters[formatterToken + 'o'] = function (date, formatters) { return ordinal(formatters[formatterToken](date)) } }) return { formatters: formatters, formattingTokensRegExp: buildFormattingTokensRegExp(formatters) } } function ordinal (number) { var rem100 = number % 100 if (rem100 > 20 || rem100 < 10) { switch (rem100 % 10) { case 1: return number + 'st' case 2: return number + 'nd' case 3: return number + 'rd' } } return number + 'th' } module.exports = buildFormatLocale
const dlVars = require('./download_tools/vars.js'); const constants = require('./.constants.js'); async function deleteMsg (bot, msg, delay) { if (delay) await sleep(delay); bot.deleteMessage(msg.chat.id, msg.message_id) .catch(ignored => {}); } function sleep (ms) { return new Promise(resolve => setTimeout(resolve, ms)); } function isAuthorized (msg) { for (var i = 0; i < constants.SUDO_USERS.length; i++) { if (constants.SUDO_USERS[i] === msg.from.id) return 0; } if (dlVars.isDownloading && msg.from.id === dlVars.tgFromId) return 1; if (constants.AUTHORIZED_CHATS.indexOf(msg.chat.id) > -1 && msg.chat.all_members_are_administrators) return 2; if (constants.AUTHORIZED_CHATS.indexOf(msg.chat.id) > -1) return 3; return -1; } function isAdmin (bot, msg, callback) { bot.getChatAdministrators(msg.chat.id) .then(members => { for (var i = 0; i < members.length; i++) { if (members[i].user.id === msg.from.id) { callback(null, true); return; } } callback(null, false); }) .catch(() => { callback(null, false); }); } module.exports.deleteMsg = deleteMsg; module.exports.sleep = sleep; module.exports.isAuthorized = isAuthorized; module.exports.isAdmin = isAdmin;
import { writable } from "svelte/store"; export const access_token = writable(undefined); export const user = writable(undefined); export const playlists = writable([]); export const playingTrack = writable(); export const tournamentModes = { singleElimination: "single-elimination", doubleElimination: "double-elimination" }; export const tournamentMode = writable(tournamentModes.singleElimination);
/** * test the print() and printraw() special functions */ path = REQUEST_PATH; spath = string_split( path, '/', 2 ); tid = spath[1]; fpath = substr( spath[2], 0, len( spath[2] ) - 4 ) + '.wmv'; printraw('<esi:vars>' ); print( '<?wsx version="1.0"?>\n' ); print( '<smil>\n' ); print( ' <media src="/7/456/43766/v0001/vodvcast.download.akamai.com/43813/test/' ); print( fpath + '?tid=' + tid + '"/>\n' ); print( '</smil>\n' ); printraw('</esi:vars>' ); if ( ! exists( thisVar ) ) { print('variable thisVar does NOT exist.\n'); printv(varName['key name']); } printv('dollars $ and dangerous chars, such as "<"'); printv( 'just make var printing easy: "' + spath + '"\n' ); printv( 'testing slash escaping: \\ (<-- one slash + ESI escaping = two slashes)\n\n^-- empty line\r\n\n' );
'use strict'; var v = require('./service-helpers/validator'); var createServiceFactory = require('./service-helpers/create-service-factory'); /** * Uploads API service. * * Learn more about this service and its responses in * [the HTTP service documentation](https://www.mapbox.com/api-documentation/#uploads). */ var Uploads = {}; /** * List the statuses of all recent uploads. * * See the [corresponding HTTP service documentation](https://www.mapbox.com/api-documentation/#retrieve-recent-upload-statuses). * * @param {Object} [config] * @param {boolean} [config.reverse] - List uploads in chronological order, rather than reverse chronological order. * @return {MapiRequest} */ Uploads.listUploads = function(config) { v.assertShape({ reverse: v.boolean })(config); return this.client.createRequest({ method: 'GET', path: '/uploads/v1/:ownerId', query: config }); }; /** * Create S3 credentials. * * See the [corresponding HTTP service documentation](https://www.mapbox.com/api-documentation/#retrieve-s3-credentials). * * @return {MapiRequest} */ Uploads.createUploadCredentials = function() { return this.client.createRequest({ method: 'POST', path: '/uploads/v1/:ownerId/credentials' }); }; /** * Create an upload. * * See the [corresponding HTTP service documentation](https://www.mapbox.com/api-documentation/#create-an-upload). * * @param {Object} config * @param {string} config.mapId - The map ID to create or replace in the format `username.nameoftileset`. * Limited to 32 characters (only `-` and `_` special characters allowed; limit does not include username). * @param {string} config.url - Either of the following: * - HTTPS URL of the S3 object provided by [`createUploadCredentials`](#createuploadcredentials) * - The `mapbox://` URL of an existing dataset that you'd like to export to a tileset. * This should be in the format `mapbox://datasets/{username}/{datasetId}`. * @param {string} [config.tilesetName] - Name for the tileset. Limited to 64 characters. * @return {MapiRequest} */ Uploads.createUpload = function(config) { v.assertShape({ mapId: v.required(v.string), url: v.required(v.string), tilesetName: v.string })(config); return this.client.createRequest({ method: 'POST', path: '/uploads/v1/:ownerId', body: { tileset: config.mapId, url: config.url, name: config.tilesetName } }); }; /** * Get an upload's status. * * See the [corresponding HTTP service documentation](https://www.mapbox.com/api-documentation/#retrieve-upload-status). * * @param {Object} config * @param {string} config.uploadId * @return {MapiRequest} */ Uploads.getUpload = function(config) { v.assertShape({ uploadId: v.required(v.string) })(config); return this.client.createRequest({ method: 'GET', path: '/uploads/v1/:ownerId/:uploadId', params: config }); }; /** * Delete an upload. * * See the [corresponding HTTP service documentation](https://www.mapbox.com/api-documentation/#remove-an-upload). * * @param {Object} config * @param {string} config.uploadId * @return {MapiRequest} */ Uploads.deleteUpload = function(config) { v.assertShape({ uploadId: v.required(v.string) })(config); return this.client.createRequest({ method: 'DELETE', path: '/uploads/v1/:ownerId/:uploadId', params: config }); }; module.exports = createServiceFactory(Uploads);
(window.webpackJsonp=window.webpackJsonp||[]).push([[1],{"044f282f6141fc605782":function(e,n){e.exports=function(e){if(!e.webpackPolyfill){var n=Object.create(e);n.children||(n.children=[]),Object.defineProperty(n,"loaded",{enumerable:!0,get:function(){return n.l}}),Object.defineProperty(n,"id",{enumerable:!0,get:function(){return n.i}}),Object.defineProperty(n,"exports",{enumerable:!0}),n.webpackPolyfill=1}return n}},"698d75b157f24ae829cc":function(e,n){var t;t=function(){return this}();try{t=t||new Function("return this")()}catch(e){"object"===typeof window&&(t=window)}e.exports=t},f586cf5b9f4b7719b2c1:function(e,n){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}}}]);
/** * @class Ext.draw.sprite.Arc * @extend Ext.draw.sprite.Circle * * A sprite that represents a circular arc. * * @example preview miniphone * var component = new Ext.draw.Component({ * items: [{ * type: 'arc', * cx: 100, * cy: 100, * r: 25, * fillStyle: 'blue', * startAngle: 0, * endAngle: Math.PI, * anticlockwise: true * }] * }); * Ext.Viewport.setLayout('fit'); * Ext.Viewport.add(component); */ Ext.define("Ext.draw.sprite.Arc", { extend: "Ext.draw.sprite.Circle", alias: 'sprite.arc', type: 'arc', inheritableStatics: { def: { processors: { /** * @cfg {Number} [startAngle=0] The beginning angle of the arc. */ startAngle: "number", /** * @cfg {Number} [endAngle=Math.PI*2] The ending angle of the arc. */ endAngle: "number", /** * @cfg {Boolean} [anticlockwise=false] Determines whether or not the arc is drawn clockwise. */ anticlockwise: "bool" }, aliases: { from: "startAngle", to: "endAngle", start: "startAngle", end: "endAngle" }, defaults: { startAngle: 0, endAngle: Math.PI * 2, anticlockwise: false }, dirtyTriggers: { startAngle: 'path', endAngle: 'path', anticlockwise: 'path' } } }, updatePath: function (path, attr) { path.arc(attr.cx, attr.cy, attr.r, attr.startAngle, attr.endAngle, attr.anticlockwise); } });
// GENERATED CODE -- DO NOT EDIT! 'use strict'; var grpc = require('@grpc/grpc-js'); var as_external_api_networkServer_pb = require('../../../as/external/api/networkServer_pb.js'); var google_api_annotations_pb = require('../../../google/api/annotations_pb.js'); var google_protobuf_timestamp_pb = require('google-protobuf/google/protobuf/timestamp_pb.js'); var google_protobuf_empty_pb = require('google-protobuf/google/protobuf/empty_pb.js'); function serialize_api_CreateNetworkServerRequest(arg) { if (!(arg instanceof as_external_api_networkServer_pb.CreateNetworkServerRequest)) { throw new Error('Expected argument of type api.CreateNetworkServerRequest'); } return Buffer.from(arg.serializeBinary()); } function deserialize_api_CreateNetworkServerRequest(buffer_arg) { return as_external_api_networkServer_pb.CreateNetworkServerRequest.deserializeBinary(new Uint8Array(buffer_arg)); } function serialize_api_CreateNetworkServerResponse(arg) { if (!(arg instanceof as_external_api_networkServer_pb.CreateNetworkServerResponse)) { throw new Error('Expected argument of type api.CreateNetworkServerResponse'); } return Buffer.from(arg.serializeBinary()); } function deserialize_api_CreateNetworkServerResponse(buffer_arg) { return as_external_api_networkServer_pb.CreateNetworkServerResponse.deserializeBinary(new Uint8Array(buffer_arg)); } function serialize_api_DeleteNetworkServerRequest(arg) { if (!(arg instanceof as_external_api_networkServer_pb.DeleteNetworkServerRequest)) { throw new Error('Expected argument of type api.DeleteNetworkServerRequest'); } return Buffer.from(arg.serializeBinary()); } function deserialize_api_DeleteNetworkServerRequest(buffer_arg) { return as_external_api_networkServer_pb.DeleteNetworkServerRequest.deserializeBinary(new Uint8Array(buffer_arg)); } function serialize_api_GetADRAlgorithmsRequest(arg) { if (!(arg instanceof as_external_api_networkServer_pb.GetADRAlgorithmsRequest)) { throw new Error('Expected argument of type api.GetADRAlgorithmsRequest'); } return Buffer.from(arg.serializeBinary()); } function deserialize_api_GetADRAlgorithmsRequest(buffer_arg) { return as_external_api_networkServer_pb.GetADRAlgorithmsRequest.deserializeBinary(new Uint8Array(buffer_arg)); } function serialize_api_GetADRAlgorithmsResponse(arg) { if (!(arg instanceof as_external_api_networkServer_pb.GetADRAlgorithmsResponse)) { throw new Error('Expected argument of type api.GetADRAlgorithmsResponse'); } return Buffer.from(arg.serializeBinary()); } function deserialize_api_GetADRAlgorithmsResponse(buffer_arg) { return as_external_api_networkServer_pb.GetADRAlgorithmsResponse.deserializeBinary(new Uint8Array(buffer_arg)); } function serialize_api_GetNetworkServerRequest(arg) { if (!(arg instanceof as_external_api_networkServer_pb.GetNetworkServerRequest)) { throw new Error('Expected argument of type api.GetNetworkServerRequest'); } return Buffer.from(arg.serializeBinary()); } function deserialize_api_GetNetworkServerRequest(buffer_arg) { return as_external_api_networkServer_pb.GetNetworkServerRequest.deserializeBinary(new Uint8Array(buffer_arg)); } function serialize_api_GetNetworkServerResponse(arg) { if (!(arg instanceof as_external_api_networkServer_pb.GetNetworkServerResponse)) { throw new Error('Expected argument of type api.GetNetworkServerResponse'); } return Buffer.from(arg.serializeBinary()); } function deserialize_api_GetNetworkServerResponse(buffer_arg) { return as_external_api_networkServer_pb.GetNetworkServerResponse.deserializeBinary(new Uint8Array(buffer_arg)); } function serialize_api_ListNetworkServerRequest(arg) { if (!(arg instanceof as_external_api_networkServer_pb.ListNetworkServerRequest)) { throw new Error('Expected argument of type api.ListNetworkServerRequest'); } return Buffer.from(arg.serializeBinary()); } function deserialize_api_ListNetworkServerRequest(buffer_arg) { return as_external_api_networkServer_pb.ListNetworkServerRequest.deserializeBinary(new Uint8Array(buffer_arg)); } function serialize_api_ListNetworkServerResponse(arg) { if (!(arg instanceof as_external_api_networkServer_pb.ListNetworkServerResponse)) { throw new Error('Expected argument of type api.ListNetworkServerResponse'); } return Buffer.from(arg.serializeBinary()); } function deserialize_api_ListNetworkServerResponse(buffer_arg) { return as_external_api_networkServer_pb.ListNetworkServerResponse.deserializeBinary(new Uint8Array(buffer_arg)); } function serialize_api_UpdateNetworkServerRequest(arg) { if (!(arg instanceof as_external_api_networkServer_pb.UpdateNetworkServerRequest)) { throw new Error('Expected argument of type api.UpdateNetworkServerRequest'); } return Buffer.from(arg.serializeBinary()); } function deserialize_api_UpdateNetworkServerRequest(buffer_arg) { return as_external_api_networkServer_pb.UpdateNetworkServerRequest.deserializeBinary(new Uint8Array(buffer_arg)); } function serialize_google_protobuf_Empty(arg) { if (!(arg instanceof google_protobuf_empty_pb.Empty)) { throw new Error('Expected argument of type google.protobuf.Empty'); } return Buffer.from(arg.serializeBinary()); } function deserialize_google_protobuf_Empty(buffer_arg) { return google_protobuf_empty_pb.Empty.deserializeBinary(new Uint8Array(buffer_arg)); } // NetworkServerService is the service managing network-servers. var NetworkServerServiceService = exports.NetworkServerServiceService = { // Create creates the given network-server. create: { path: '/api.NetworkServerService/Create', requestStream: false, responseStream: false, requestType: as_external_api_networkServer_pb.CreateNetworkServerRequest, responseType: as_external_api_networkServer_pb.CreateNetworkServerResponse, requestSerialize: serialize_api_CreateNetworkServerRequest, requestDeserialize: deserialize_api_CreateNetworkServerRequest, responseSerialize: serialize_api_CreateNetworkServerResponse, responseDeserialize: deserialize_api_CreateNetworkServerResponse, }, // Get returns the network-server matching the given id. get: { path: '/api.NetworkServerService/Get', requestStream: false, responseStream: false, requestType: as_external_api_networkServer_pb.GetNetworkServerRequest, responseType: as_external_api_networkServer_pb.GetNetworkServerResponse, requestSerialize: serialize_api_GetNetworkServerRequest, requestDeserialize: deserialize_api_GetNetworkServerRequest, responseSerialize: serialize_api_GetNetworkServerResponse, responseDeserialize: deserialize_api_GetNetworkServerResponse, }, // Update updates the given network-server. update: { path: '/api.NetworkServerService/Update', requestStream: false, responseStream: false, requestType: as_external_api_networkServer_pb.UpdateNetworkServerRequest, responseType: google_protobuf_empty_pb.Empty, requestSerialize: serialize_api_UpdateNetworkServerRequest, requestDeserialize: deserialize_api_UpdateNetworkServerRequest, responseSerialize: serialize_google_protobuf_Empty, responseDeserialize: deserialize_google_protobuf_Empty, }, // Delete deletes the network-server matching the given id. delete: { path: '/api.NetworkServerService/Delete', requestStream: false, responseStream: false, requestType: as_external_api_networkServer_pb.DeleteNetworkServerRequest, responseType: google_protobuf_empty_pb.Empty, requestSerialize: serialize_api_DeleteNetworkServerRequest, requestDeserialize: deserialize_api_DeleteNetworkServerRequest, responseSerialize: serialize_google_protobuf_Empty, responseDeserialize: deserialize_google_protobuf_Empty, }, // List lists the available network-servers. list: { path: '/api.NetworkServerService/List', requestStream: false, responseStream: false, requestType: as_external_api_networkServer_pb.ListNetworkServerRequest, responseType: as_external_api_networkServer_pb.ListNetworkServerResponse, requestSerialize: serialize_api_ListNetworkServerRequest, requestDeserialize: deserialize_api_ListNetworkServerRequest, responseSerialize: serialize_api_ListNetworkServerResponse, responseDeserialize: deserialize_api_ListNetworkServerResponse, }, // GetADRAlgorithms returns the available ADR algorithms. getADRAlgorithms: { path: '/api.NetworkServerService/GetADRAlgorithms', requestStream: false, responseStream: false, requestType: as_external_api_networkServer_pb.GetADRAlgorithmsRequest, responseType: as_external_api_networkServer_pb.GetADRAlgorithmsResponse, requestSerialize: serialize_api_GetADRAlgorithmsRequest, requestDeserialize: deserialize_api_GetADRAlgorithmsRequest, responseSerialize: serialize_api_GetADRAlgorithmsResponse, responseDeserialize: deserialize_api_GetADRAlgorithmsResponse, }, }; exports.NetworkServerServiceClient = grpc.makeGenericClientConstructor(NetworkServerServiceService);
export { default as GameCard } from './GameCard';
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const fs = require("fs-extra"); const gfs = require("graceful-fs"); const klaw = require("klaw"); function getDirectoryStructure(root) { return new Promise((resolve, reject) => { if (!fs.existsSync(root)) { return reject(new Error(`App directory ${root} does not exist`)); } const files = []; const directories = []; klaw(root, { fs: gfs }) .on('data', (item) => { if (item.stats.isFile()) { files.push(item.path); } else if (item.stats.isDirectory() && item.path !== root) { directories.push(item.path); } }) .on('end', () => resolve({ files, directories })); }); } exports.getDirectoryStructure = getDirectoryStructure;
/** * @author Davidson Alencar <davidson.t.i@gmail.com> * @description * Main File Gulp used to dynamically load other files each with its responsibility */ (function(){ 'use strict'; //-- Initializations var gulp = require('gulp'); /** * @type object * @description * Definition of paths which will be required for automatons processes */ gulp.paths = { /** * @type String * @description * Path of the modules where the business rules are applied. */ modules: 'modules', /** * @type String * @description * Public path. */ public: 'public', /** * @type String * @description * Test path. */ test: 'test', /** * @type String * @description * Docs path. */ docs: 'docs', /** * @type object * @description * Path assets of the application */ assets: { js: [ 'modules/core/app/config.js', 'modules/core/app/init.js', 'modules/core/**/*.js', 'modules/*/*.js', 'modules/*/config/*.js', 'modules/*/**/*.js' ], views: [ 'modules/*/views/*.html', 'modules/*/views/**/*.html' ], imgs: [ 'modules/*/imgs/**/*.jpg', 'modules/*/imgs/**/*.png' ], sass: [ 'modules/*/scss/*/*.scss', 'modules/*/scss/**/*.scss' ] } }; /** * @description * Will be obtained all the files gulp each based on their responsibility. */ require('require-dir')('./gulp'); })();
import { runFx } from "../utils" import { Now, Delay } from "../../src" describe("Now effect", () => { it("should get the current time", () => { const timestamp = 9001 global.performance.now = () => timestamp const action = jest.fn() const timeFx = Now({ action }) const { dispatch } = runFx(timeFx) expect(dispatch).toBeCalledWith(action, timestamp) delete global.performance.now }) it("should get the current date", () => { const timestamp = 9001 const defaultDate = global.Date global.Date = () => ({ timestamp }) const action = jest.fn() const timeFx = Now({ asDate: true, action }) const { dispatch } = runFx(timeFx) expect(dispatch).toBeCalledWith(action, { timestamp }) global.Date = defaultDate }) }) describe("Delay effect", () => { it("should get the current time after a delay", () => { jest.useFakeTimers() const timestamp = 666 global.performance.now = () => timestamp try { const action = jest.fn() const timeFx = Delay({ wait: timestamp, action }) const { dispatch } = runFx(timeFx) expect(dispatch).not.toBeCalled() jest.runAllTimers() expect(dispatch).toBeCalledWith(action, timestamp) } finally { delete global.performance.now jest.useRealTimers() } }) it("should get the current date after a delay", () => { jest.useFakeTimers() const timestamp = 666 const defaultDate = global.Date global.Date = () => ({ timestamp }) try { const action = jest.fn() const timeFx = Delay({ wait: timestamp, asDate: true, action }) const { dispatch } = runFx(timeFx) expect(dispatch).not.toBeCalled() jest.runAllTimers() expect(dispatch).toBeCalledWith(action, { timestamp }) } finally { global.Date = defaultDate jest.useRealTimers() } }) })
// @flow import {mount, render, shallow} from 'enzyme'; import React from 'react'; import SingleMediaDropzone from '../SingleMediaDropzone'; test('Render a SingleMediaDropzone', () => { expect(render( <SingleMediaDropzone image="http://lorempixel.com/400/400" onDrop={jest.fn()} progress={0} uploading={false} /> )).toMatchSnapshot(); }); test('Render a SingleMediaDropzone with the default empty icon', () => { expect(render(<SingleMediaDropzone image={undefined} onDrop={jest.fn()} />)).toMatchSnapshot(); }); test('Render a SingleMediaDropzone with the passed empty icon', () => { expect(render(<SingleMediaDropzone emptyIcon="su-user" image={undefined} onDrop={jest.fn()} />)).toMatchSnapshot(); }); test('Render a SingleMediaDropzone with an error text', () => { expect(render( <SingleMediaDropzone emptyIcon="su-user" errorText="some-custom-error-message" image={undefined} onDrop={jest.fn()} /> )).toMatchSnapshot(); }); test('Render a SingleMediaDropzone with a loader if image has not been loaded yet', () => { const singleMediaDropzone = mount(<SingleMediaDropzone emptyIcon="su-user" image="test.jpg" onDrop={jest.fn()} />); expect(singleMediaDropzone.render()).toMatchSnapshot(); }); test('Render a SingleMediaDropzone without a loader if image has been loaded after an error occured before', () => { const singleMediaDropzone = mount(<SingleMediaDropzone emptyIcon="su-user" image="test.jpg" onDrop={jest.fn()} />); singleMediaDropzone.instance().imageError = true; singleMediaDropzone.instance().image.onload(); expect(singleMediaDropzone.render()).toMatchSnapshot(); }); test('Render a SingleMediaDropzone without a loader if image has been loaded yet', () => { const singleMediaDropzone = mount(<SingleMediaDropzone emptyIcon="su-user" image="test.jpg" onDrop={jest.fn()} />); singleMediaDropzone.instance().image.onload(); expect(singleMediaDropzone.render()).toMatchSnapshot(); }); test('Render a SingleMediaDropzone with a MimeTypeIndicator if an error appeared during image loading', () => { const singleMediaDropzone = mount( <SingleMediaDropzone emptyIcon="su-user" image="test.jpg" mimeType="video/x-m4v" onDrop={jest.fn()} /> ); singleMediaDropzone.instance().image.onerror(); singleMediaDropzone.update(); expect(singleMediaDropzone.render()).toMatchSnapshot(); }); test('Render a SingleMediaDropzone in disabled state', () => { expect(render( <SingleMediaDropzone disabled={true} image="http://lorempixel.com/400/400" onDrop={jest.fn()} progress={0} uploading={false} /> )).toMatchSnapshot(); }); test('Render a SingleMediaDropzone with the round skin', () => { expect(render( <SingleMediaDropzone image="http://lorempixel.com/400/400" onDrop={jest.fn()} progress={0} skin="round" uploading={false} /> )).toMatchSnapshot(); }); test('Render a SingleMediaDropzone while uploading', () => { expect(render( <SingleMediaDropzone image="http://lorempixel.com/400/400" onDrop={jest.fn()} progress={50} uploading={true} /> )).toMatchSnapshot(); }); test('Render img tag with key to avoid keeping old image on new upload', () => { const singleMediaDropzone = mount( <SingleMediaDropzone image="http://lorempixel.com/400/400" onDrop={jest.fn()} progress={0} uploading={false} /> ); expect(singleMediaDropzone.find('img').key()).not.toBe(null); }); test('Component pass correct props to Dropzone component', () => { const singleMediaDropzone = shallow( <SingleMediaDropzone accept="application/json" disabled={true} image="http://lorempixel.com/400/400" onDrop={jest.fn()} uploading={false} /> ); expect(singleMediaDropzone.find('Dropzone').props()).toEqual(expect.objectContaining({ accept: 'application/json', disabled: true, noClick: false, multiple: false, })); }); test('Dragging a file over the area will show the upload indicator', () => { const singleMediaDropzone = shallow( <SingleMediaDropzone image="http://lorempixel.com/400/400" onDrop={jest.fn()} progress={0} uploading={false} /> ); singleMediaDropzone.instance().handleDragEnter(); expect(singleMediaDropzone.instance().uploadIndicatorVisibility).toBe(true); }); test('Dragging a file outside of the area will hide the upload indicator', () => { const singleMediaDropzone = shallow( <SingleMediaDropzone image="http://lorempixel.com/400/400" onDrop={jest.fn()} progress={0} uploading={false} /> ); singleMediaDropzone.instance().handleDragLeave(); expect(singleMediaDropzone.instance().uploadIndicatorVisibility).toBe(false); }); test('Dropping a file on the area will hide the upload indicator and call the "onDrop" handler', () => { const dropSpy = jest.fn(); const testFileData = {name: 'test-file'}; const singleMediaDropzone = shallow( <SingleMediaDropzone image="http://lorempixel.com/400/400" onDrop={dropSpy} progress={0} uploading={false} /> ); singleMediaDropzone.instance().handleDrop([testFileData]); expect(singleMediaDropzone.instance().uploadIndicatorVisibility).toBe(false); expect(dropSpy).toBeCalledWith(testFileData); });
/* Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/license */ CKEDITOR.plugins.setLang( 'pastetext', 'ro', { button: 'Adaugă ca text simplu (Plain Text)', pasteNotification: 'Your browser does not allow you to paste plain text this way. Press %1 to paste.' // MISSING } );
/* eslint-env node */ /* eslint-disable import/no-commonjs */ const SANDBOX_CONFIG = { "presets": ["@babel/preset-env", "@babel/preset-react"] }; // we need a seperate config for test because Jest no longer packages // the regenerator runtime, so support for async functions has to be // grabbed from NodeJS, which requires extra configuration that won't // work for browsers! const TEST_CONFIG = { "presets": [ ["@babel/preset-env", { targets: { node: "current" } }], "@babel/preset-react" ] }; module.exports = api => { const isTestEnv = api.env("test"); return isTestEnv ? TEST_CONFIG : SANDBOX_CONFIG; };
// Unkown source, but useful for Sylvester // https://developer.mozilla.org/en/WebGL/Adding_2D_content_to_a_WebGL_context // augment Sylvester some Matrix.Translation = function (v) { if (v.elements.length == 2) { var r = Matrix.I(3); r.elements[2][0] = v.elements[0]; r.elements[2][1] = v.elements[1]; return r; } if (v.elements.length == 3) { var r = Matrix.I(4); r.elements[0][3] = v.elements[0]; r.elements[1][3] = v.elements[1]; r.elements[2][3] = v.elements[2]; return r; } throw "Invalid length for Translation"; } Matrix.prototype.flatten = function () { var result = []; if (this.elements.length == 0) return []; for (var j = 0; j < this.elements[0].length; j++) for (var i = 0; i < this.elements.length; i++) result.push(this.elements[i][j]); return result; } Matrix.prototype.ensure4x4 = function() { if (this.elements.length == 4 && this.elements[0].length == 4) return this; if (this.elements.length > 4 || this.elements[0].length > 4) return null; for (var i = 0; i < this.elements.length; i++) { for (var j = this.elements[i].length; j < 4; j++) { if (i == j) this.elements[i].push(1); else this.elements[i].push(0); } } for (var i = this.elements.length; i < 4; i++) { if (i == 0) this.elements.push([1, 0, 0, 0]); else if (i == 1) this.elements.push([0, 1, 0, 0]); else if (i == 2) this.elements.push([0, 0, 1, 0]); else if (i == 3) this.elements.push([0, 0, 0, 1]); } return this; }; Matrix.prototype.make3x3 = function() { if (this.elements.length != 4 || this.elements[0].length != 4) return null; return Matrix.create([[this.elements[0][0], this.elements[0][1], this.elements[0][2]], [this.elements[1][0], this.elements[1][1], this.elements[1][2]], [this.elements[2][0], this.elements[2][1], this.elements[2][2]]]); }; Vector.prototype.flatten = function () { return this.elements; }; function mht(m) { var s = ""; if (m.length == 16) { for (var i = 0; i < 4; i++) { s += "<span style='font-family: monospace'>[" + m[i*4+0].toFixed(4) + "," + m[i*4+1].toFixed(4) + "," + m[i*4+2].toFixed(4) + "," + m[i*4+3].toFixed(4) + "]</span><br>"; } } else if (m.length == 9) { for (var i = 0; i < 3; i++) { s += "<span style='font-family: monospace'>[" + m[i*3+0].toFixed(4) + "," + m[i*3+1].toFixed(4) + "," + m[i*3+2].toFixed(4) + "]</font><br>"; } } else { return m.toString(); } return s; } // // gluLookAt // function makeLookAt(ex, ey, ez, cx, cy, cz, ux, uy, uz) { var eye = $V([ex, ey, ez]); var center = $V([cx, cy, cz]); var up = $V([ux, uy, uz]); var mag; var z = eye.subtract(center).toUnitVector(); var x = up.cross(z).toUnitVector(); var y = z.cross(x).toUnitVector(); var m = $M([[x.e(1), x.e(2), x.e(3), 0], [y.e(1), y.e(2), y.e(3), 0], [z.e(1), z.e(2), z.e(3), 0], [0, 0, 0, 1]]); var t = $M([[1, 0, 0, -ex], [0, 1, 0, -ey], [0, 0, 1, -ez], [0, 0, 0, 1]]); return m.x(t); } // // glOrtho // function makeOrtho(left, right, bottom, top, znear, zfar) { var tx = -(right+left)/(right-left); var ty = -(top+bottom)/(top-bottom); var tz = -(zfar+znear)/(zfar-znear); return $M([[2/(right-left), 0, 0, tx], [0, 2/(top-bottom), 0, ty], [0, 0, -2/(zfar-znear), tz], [0, 0, 0, 1]]); } // // gluPerspective // function makePerspective(fovy, aspect, znear, zfar) { var ymax = znear * Math.tan(fovy * Math.PI / 360.0); var ymin = -ymax; var xmin = ymin * aspect; var xmax = ymax * aspect; return makeFrustum(xmin, xmax, ymin, ymax, znear, zfar); } // // glFrustum // function makeFrustum(left, right, bottom, top, znear, zfar) { var X = 2*znear/(right-left); var Y = 2*znear/(top-bottom); var A = (right+left)/(right-left); var B = (top+bottom)/(top-bottom); var C = -(zfar+znear)/(zfar-znear); var D = -2*zfar*znear/(zfar-znear); return $M([[X, 0, A, 0], [0, Y, B, 0], [0, 0, C, D], [0, 0, -1, 0]]); } // // glOrtho // function makeOrtho(left, right, bottom, top, znear, zfar) { var tx = - (right + left) / (right - left); var ty = - (top + bottom) / (top - bottom); var tz = - (zfar + znear) / (zfar - znear); return $M([[2 / (right - left), 0, 0, tx], [0, 2 / (top - bottom), 0, ty], [0, 0, -2 / (zfar - znear), tz], [0, 0, 0, 1]]); }
const GaltToken = artifacts.require('./GaltToken.sol'); const ACL = artifacts.require('./ACL.sol'); const PGGRegistry = artifacts.require('./PGGRegistry.sol'); const NewOracleManager = artifacts.require('./NewOracleManager.sol'); const UpdateOracleManager = artifacts.require('./UpdateOracleManager.sol'); const GaltGlobalRegistry = artifacts.require('./GaltGlobalRegistry.sol'); const FeeRegistry = artifacts.require('./FeeRegistry.sol'); const PGGOracleStakeAccounting = artifacts.require('./PGGOracleStakeAccounting.sol'); const StakeTracker = artifacts.require('./StakeTracker.sol'); const Web3 = require('web3'); const galt = require('@galtproject/utils'); const { initHelperWeb3, ether, assertRevert, numberToEvmWord, paymentMethods } = require('../../helpers'); const { deployPGGFactory, buildPGG } = require('../../deploymentHelpers'); const web3 = new Web3(GaltToken.web3.currentProvider); const { hexToUtf8, utf8ToHex } = Web3.utils; const bytes32 = utf8ToHex; GaltToken.numberFormat = 'String'; UpdateOracleManager.numberFormat = 'String'; const MN = bytes32('MN'); const BOB = bytes32('BOB'); initHelperWeb3(web3); const ApplicationStatus = { NOT_EXISTS: 0, SUBMITTED: 1, APPROVED: 2, REJECTED: 3, REVERTED: 4 }; const ValidationStatus = { NOT_EXISTS: 0, PENDING: 1, LOCKED: 2 }; const PaymentMethods = { NONE: 0, ETH_ONLY: 1, GALT_ONLY: 2, ETH_AND_GALT: 3 }; const Currency = { ETH: 0, GALT: 1 }; Object.freeze(ApplicationStatus); Object.freeze(ValidationStatus); Object.freeze(PaymentMethods); Object.freeze(Currency); const PC_AUDITOR_ORACLE_TYPE = bytes32('PC_AUDITOR_ORACLE_TYPE'); const PC_CUSTODIAN_ORACLE_TYPE = bytes32('PC_CUSTODIAN_ORACLE_TYPE'); const PC_ANOTHER_ORACLE_TYPE = bytes32('PC_ANOTHER_ORACLE_TYPE'); // eslint-disable-next-line contract('UpdateOracleManager', (accounts) => { const [ coreTeam, feeMixerAddress, spaceRA, oracleModifier, unauthorized, alice, bob, charlie, dan, frank, george ] = accounts; before(async function() { this.attachedDocuments = [ 'QmYNQJoKGNHTpPxCBPh9KkDpaExgd2duMa3aF6ytMpHdao', 'QmeveuwF5wWBSgUXLG6p1oxF3GKkgjEnhA6AAwHUoVsx6E', 'QmSrPmbaUKA3ZodhzPWZnpFgcPMFWF4QsxXbkWfEptTBJd' ]; this.attachedDocumentsBytes32 = this.attachedDocuments.map(galt.ipfsHashToBytes32); this.description = ''; this.galtToken = await GaltToken.new({ from: coreTeam }); this.newOracle = await NewOracleManager.new({ from: coreTeam }); this.updateOracle = await UpdateOracleManager.new({ from: coreTeam }); this.myPGGOracleStakeAccounting = await PGGOracleStakeAccounting.new(alice, { from: coreTeam }); this.acl = await ACL.new({ from: coreTeam }); this.ggr = await GaltGlobalRegistry.new({ from: coreTeam }); this.stakeTracker = await StakeTracker.new({ from: coreTeam }); this.feeRegistry = await FeeRegistry.new({ from: coreTeam }); this.pggRegistry = await PGGRegistry.new({ from: coreTeam }); await this.acl.initialize(); await this.ggr.initialize(); await this.pggRegistry.initialize(this.ggr.address); await this.stakeTracker.initialize(this.ggr.address); await this.ggr.setContract(await this.ggr.ACL(), this.acl.address, { from: coreTeam }); await this.ggr.setContract(await this.ggr.FEE_REGISTRY(), this.feeRegistry.address, { from: coreTeam }); await this.ggr.setContract(await this.ggr.PGG_REGISTRY(), this.pggRegistry.address, { from: coreTeam }); await this.ggr.setContract(await this.ggr.GALT_TOKEN(), this.galtToken.address, { from: coreTeam }); await this.ggr.setContract(await this.ggr.STAKE_TRACKER(), this.stakeTracker.address, { from: coreTeam }); await this.ggr.setContract(await this.ggr.SPACE_RA(), spaceRA, { from: coreTeam }); await this.feeRegistry.setProtocolEthShare(33, { from: coreTeam }); await this.feeRegistry.setProtocolGaltShare(13, { from: coreTeam }); this.pggFactory = await deployPGGFactory(this.ggr, coreTeam); await this.feeRegistry.setGaltFee(await this.pggFactory.FEE_KEY(), ether(10), { from: coreTeam }); await this.feeRegistry.setEthFee(await this.pggFactory.FEE_KEY(), ether(5), { from: coreTeam }); await this.feeRegistry.setPaymentMethod(await this.pggFactory.FEE_KEY(), paymentMethods.ETH_AND_GALT, { from: coreTeam }); await this.acl.setRole(bytes32('PGG_REGISTRAR'), this.pggFactory.address, true, { from: coreTeam }); await this.acl.setRole(bytes32('FEE_COLLECTOR'), feeMixerAddress, true, { from: coreTeam }); await this.acl.setRole(bytes32('ORACLE_MODIFIER'), this.newOracle.address, true, { from: coreTeam }); await this.acl.setRole(bytes32('ORACLE_MODIFIER'), this.updateOracle.address, true, { from: coreTeam }); await this.acl.setRole(bytes32('ORACLE_MODIFIER'), oracleModifier, true, { from: coreTeam }); await this.galtToken.mint(alice, ether(10000000), { from: coreTeam }); const applicationConfig = {}; applicationConfig[bytes32('NO_MINIMAL_FEE_ETH')] = numberToEvmWord(ether(6)); applicationConfig[bytes32('NO_MINIMAL_FEE_GALT')] = numberToEvmWord(ether(45)); applicationConfig[bytes32('NO_M')] = numberToEvmWord(3); applicationConfig[bytes32('NO_N')] = numberToEvmWord(5); applicationConfig[bytes32('NO_PAYMENT_METHOD')] = numberToEvmWord(PaymentMethods.ETH_AND_GALT); applicationConfig[bytes32('UO_MINIMAL_FEE_ETH')] = numberToEvmWord(ether(6)); applicationConfig[bytes32('UO_MINIMAL_FEE_GALT')] = numberToEvmWord(ether(45)); applicationConfig[bytes32('UO_M')] = numberToEvmWord(3); applicationConfig[bytes32('UO_N')] = numberToEvmWord(5); applicationConfig[bytes32('UO_PAYMENT_METHOD')] = numberToEvmWord(PaymentMethods.ETH_AND_GALT); const pcCustodianKey = await this.myPGGOracleStakeAccounting.oracleTypeMinimalStakeKey(PC_CUSTODIAN_ORACLE_TYPE); const pcAuditorKey = await this.myPGGOracleStakeAccounting.oracleTypeMinimalStakeKey(PC_AUDITOR_ORACLE_TYPE); applicationConfig[pcCustodianKey] = numberToEvmWord(ether(30)); applicationConfig[pcAuditorKey] = numberToEvmWord(ether(30)); this.applicationConfig = applicationConfig; await this.galtToken.approve(this.pggFactory.address, ether(20), { from: alice }); this.pggX = await buildPGG( this.pggFactory, [bob, charlie, dan, frank, george], 3, 7, 10, 60, ether(1000), 300000, {}, applicationConfig, alice ); this.mX = this.pggX.config.address; this.pggMultiSigX = this.pggX.multiSig; this.oracleStakesAccountingX = this.pggX.oracleStakeAccounting; this.oraclesX = this.pggX.oracles; await this.newOracle.initialize(this.ggr.address, { from: coreTeam }); await this.updateOracle.initialize(this.ggr.address, { from: coreTeam }); await this.oraclesX.addOracle(bob, BOB, MN, '', [], [PC_CUSTODIAN_ORACLE_TYPE, PC_AUDITOR_ORACLE_TYPE], { from: oracleModifier }); }); describe('#submit()', () => { describe('with GALT payment', () => { it('should reject applications if GALT payment is disabled', async function() { await this.galtToken.approve(this.pggFactory.address, ether(20), { from: alice }); this.applicationConfig[bytes32('UO_PAYMENT_METHOD')] = numberToEvmWord(PaymentMethods.ETH_ONLY); // disabled GALT payments const pggDisabledGalt = await buildPGG( this.pggFactory, [bob, charlie, dan], 3, 7, 10, 60, ether(1000), 300000, {}, this.applicationConfig, alice ); await this.galtToken.approve(this.updateOracle.address, ether(45), { from: alice }); await assertRevert( this.updateOracle.submit( pggDisabledGalt.config.address, bob, BOB, MN, '', this.attachedDocumentsBytes32, [PC_AUDITOR_ORACLE_TYPE, PC_CUSTODIAN_ORACLE_TYPE], ether(45), { from: alice } ) ); }); it('should allow an applicant pay commission in Galt', async function() { await this.galtToken.approve(this.updateOracle.address, ether(45), { from: alice }); let res = await this.updateOracle.submit( this.mX, bob, BOB, MN, '', this.attachedDocumentsBytes32, [PC_AUDITOR_ORACLE_TYPE, PC_CUSTODIAN_ORACLE_TYPE], ether(45), { from: alice } ); this.aId = res.logs[0].args.applicationId; res = await this.updateOracle.getApplication(this.aId); assert.equal(res.status, ApplicationStatus.SUBMITTED); assert.equal(parseInt(res.createdAt, 10) > 0, true); }); it('should deny applying for non-oracle', async function() { await this.galtToken.approve(this.updateOracle.address, ether(45), { from: alice }); await assertRevert( this.updateOracle.submit( this.mX, unauthorized, BOB, MN, '', this.attachedDocumentsBytes32, [PC_AUDITOR_ORACLE_TYPE, PC_CUSTODIAN_ORACLE_TYPE], ether(45), { from: alice } ) ); }); }); describe('with ETH payment', () => { it('should allow an applicant pay commission in ETH', async function() { let res = await this.updateOracle.submit( this.mX, bob, BOB, MN, '', this.attachedDocumentsBytes32, [PC_AUDITOR_ORACLE_TYPE, PC_CUSTODIAN_ORACLE_TYPE], 0, { from: alice, value: ether(7) } ); this.aId = res.logs[0].args.applicationId; res = await this.updateOracle.getApplication(this.aId); assert.equal(res.status, ApplicationStatus.SUBMITTED); }); it('should reject applications if ETH payment is disabled', async function() { await this.galtToken.approve(this.pggFactory.address, ether(20), { from: alice }); this.applicationConfig[bytes32('UO_PAYMENT_METHOD')] = numberToEvmWord(PaymentMethods.GALT_ONLY); // disabled GALT payments const pggDisabledEth = await buildPGG( this.pggFactory, [bob, charlie, dan, frank], 3, 7, 10, 60, ether(1000), 300000, {}, this.applicationConfig, alice ); await assertRevert( this.updateOracle.submit( pggDisabledEth.config.address, bob, BOB, MN, '', this.attachedDocumentsBytes32, [PC_AUDITOR_ORACLE_TYPE, PC_CUSTODIAN_ORACLE_TYPE], 0, { from: alice, value: ether(7) } ) ); }); it('should deny applying for non-oracle', async function() { await assertRevert( this.updateOracle.submit( this.mX, unauthorized, BOB, MN, '', this.attachedDocumentsBytes32, [PC_AUDITOR_ORACLE_TYPE, PC_CUSTODIAN_ORACLE_TYPE], 0, { from: alice, value: ether(7) } ) ); }); }); }); describe('update oracle', async () => { it('should merge roles on update', async function() { // NewOracle await this.galtToken.approve(this.newOracle.address, ether(47), { from: alice }); let res = await this.newOracle.submit( this.mX, bob, BOB, MN, '', this.attachedDocumentsBytes32, [PC_CUSTODIAN_ORACLE_TYPE, PC_AUDITOR_ORACLE_TYPE], ether(47), { from: alice } ); this.aId = res.logs[0].args.applicationId; await this.newOracle.lock(this.aId, { from: bob }); await this.newOracle.lock(this.aId, { from: charlie }); await this.newOracle.lock(this.aId, { from: dan }); await this.newOracle.lock(this.aId, { from: frank }); await this.newOracle.aye(this.aId, { from: bob }); await this.newOracle.nay(this.aId, { from: charlie }); await this.newOracle.aye(this.aId, { from: dan }); await this.newOracle.aye(this.aId, { from: frank }); // UpdateOracle await this.galtToken.approve(this.updateOracle.address, ether(47), { from: alice }); res = await this.updateOracle.submit( this.mX, bob, BOB, MN, '', this.attachedDocumentsBytes32, [PC_AUDITOR_ORACLE_TYPE, PC_ANOTHER_ORACLE_TYPE], ether(47), { from: alice } ); this.aId = res.logs[0].args.applicationId; await this.updateOracle.lock(this.aId, { from: bob }); await this.updateOracle.lock(this.aId, { from: charlie }); await this.updateOracle.lock(this.aId, { from: dan }); await this.updateOracle.lock(this.aId, { from: frank }); await this.updateOracle.aye(this.aId, { from: bob }); await this.updateOracle.nay(this.aId, { from: charlie }); await this.updateOracle.aye(this.aId, { from: dan }); await this.updateOracle.aye(this.aId, { from: frank }); res = await this.oraclesX.getOracle(bob); assert.sameMembers( res.assignedOracleTypes.map(hexToUtf8), [PC_AUDITOR_ORACLE_TYPE, PC_ANOTHER_ORACLE_TYPE].map(hexToUtf8) ); }); }); });
/* -*- Mode: js; js-indent-level: 2; indent-tabs-mode: nil; tab-width: 2 -*- */ /* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */ /* * Copyright 2013 Mozilla Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /*global SWF, renderStage, rgbaObjToStr, ShumwayKeyboardListener */ SWF.embed = function(file, doc, container, options) { var canvas = doc.createElement('canvas'); var ctx = canvas.getContext('kanvas-2d'); var loader = new flash.display.Loader(); var loaderInfo = loader.contentLoaderInfo; var stage = new flash.display.Stage(); stage._loader = loader; loaderInfo._parameters = options.movieParams; loaderInfo._url = options.url || (typeof file === 'string' ? file : null); loaderInfo._loaderURL = options.loaderURL || loaderInfo._url; // HACK support of HiDPI displays var pixelRatio = 'devicePixelRatio' in window ? window.devicePixelRatio : 1; var canvasHolder = null; canvas._pixelRatio = pixelRatio; if (pixelRatio > 1) { var cssScale = 'scale(' + (1 / pixelRatio) + ', ' + (1 / pixelRatio) + ')'; canvas.setAttribute('style', '-moz-transform: ' + cssScale + ';' + '-webkit-transform: ' + cssScale + ';' + 'transform: ' + cssScale + ';' + '-moz-transform-origin: 0% 0%;' + '-webkit-transform-origin: 0% 0%;' + 'transform-origin: 0% 0%;'); canvasHolder = doc.createElement('div'); canvasHolder.setAttribute('style', 'display: inline-block; overflow: hidden;'); canvasHolder.appendChild(canvas); } stage._contentsScaleFactor = pixelRatio; loader._parent = stage; loader._stage = stage; function fitCanvas(container, canvas) { if (canvasHolder) { canvasHolder.style.width = container.clientWidth + 'px'; canvasHolder.style.height = container.clientHeight + 'px'; } canvas.width = container.clientWidth * pixelRatio; canvas.height = container.clientHeight * pixelRatio; stage._invalid = true; } loaderInfo._addEventListener('init', function () { if (container.clientHeight) { fitCanvas(container, canvas); window.addEventListener('resize', function () { fitCanvas(container, canvas); }); } else { if (canvasHolder) { canvasHolder.style.width = (stage._stageWidth / 20) + 'px'; canvasHolder.style.height = (stage._stageHeight / 20) + 'px'; } canvas.width = stage._stageWidth * pixelRatio / 20; canvas.height = stage._stageHeight * pixelRatio / 20; } container.setAttribute("style", "position: relative"); canvas.addEventListener('click', function () { ShumwayKeyboardListener.focus = stage; stage._clickTarget._dispatchEvent(new flash.events.MouseEvent('click')); }); canvas.addEventListener('dblclick', function () { if (stage._clickTarget._doubleClickEnabled) { stage._clickTarget._dispatchEvent(new flash.events.MouseEvent('doubleClick')); } }); canvas.addEventListener('mousedown', function () { if (stage._clickTarget._buttonMode) { stage._clickTarget._gotoButtonState('down'); } stage._clickTarget._dispatchEvent(new flash.events.MouseEvent('mouseDown')); }); canvas.addEventListener('mousemove', function (domEvt) { var node = this; var left = 0; var top = 0; if (node.offsetParent) { do { left += node.offsetLeft; top += node.offsetTop; } while ((node = node.offsetParent)); } var canvasState = stage._canvasState; var mouseX = ((domEvt.pageX - left) * pixelRatio - canvasState.offsetX) / canvasState.scaleX; var mouseY = ((domEvt.pageY - top) * pixelRatio - canvasState.offsetY) / canvasState.scaleY; if (mouseX !== stage._mouseX || mouseY !== stage._mouseY) { stage._mouseMoved = true; stage._mouseX = mouseX * 20; stage._mouseY = mouseY * 20; } }); canvas.addEventListener('mouseup', function () { if (stage._clickTarget._buttonMode) { stage._clickTarget._gotoButtonState('over'); } stage._clickTarget._dispatchEvent(new flash.events.MouseEvent('mouseUp')); }); canvas.addEventListener('mouseover', function () { stage._mouseMoved = true; stage._mouseOver = true; }); canvas.addEventListener('mouseout', function () { stage._mouseMoved = true; stage._mouseOver = false; }); var bgcolor = loaderInfo._backgroundColor; if (options.objectParams) { var m; if (options.objectParams.bgcolor && (m = /#([0-9A-F]{6})/i.exec(options.objectParams.bgcolor))) { var hexColor = parseInt(m[1], 16); bgcolor = { red: (hexColor >> 16) & 255, green: (hexColor >> 8) & 255, blue: hexColor & 255, alpha: 255 }; } if (options.objectParams.wmode === 'transparent') { bgcolor = {red: 0, green: 0, blue: 0, alpha: 0}; } } stage._color = bgcolor; ctx.fillStyle = rgbaObjToStr(bgcolor); ctx.fillRect(0, 0, canvas.width, canvas.height); var root = loader._content; stage._children[0] = root; root._dispatchEvent("added"); root._dispatchEvent("addedToStage"); container.appendChild(canvasHolder || canvas); if (options.onStageInitialized) { options.onStageInitialized(stage); } renderStage(stage, ctx, options); }); if (options.onComplete) { loaderInfo._addEventListener("complete", function () { options.onComplete(); }); } loader._load(typeof file === 'string' ? new flash.net.URLRequest(file) : file); return loader; };
import React, { Component } from 'react'; import ReactMarkdown from 'react-markdown'; import PropTypes from 'prop-types'; import { OverlayTrigger, Tooltip as ReactTooltip } from 'react-bootstrap'; class Tooltip extends Component { constructor (props) { super(props); this.state = { hovering: 0 }; this._hover = this._hover.bind(this); this._hoverOut = this._hoverOut.bind(this); } _hover () { this.setState({ hovering: 3000 }); } _hoverOut () { this.setState({ hovering: 0 }); } _renderOverlay () { return ( <OverlayTrigger delayHide={this.state.hovering} placement="top" onBlur={this._hoverOut} onMouseLeave={this._hoverOut} onMouseOut={this._hoverOut} overlay={this._tooltip()} rootClose show={this.props.show} > <div className="overlay-trigger"> {this.props.children} </div> </OverlayTrigger> ); } _tooltip () { return ( <ReactTooltip className={this.props.className} id="tooltip" onBlur={this._hoverOut} onMouseLeave={this._hoverOut} onMouseOver={this._hover} onFocus={this._hover} > {Array.isArray(this.props.title) && this.props.title.map(title => (<div key={title}><ReactMarkdown source={title} /></div>)) } {!Array.isArray(this.props.title) && <ReactMarkdown source={this.props.title} /> } </ReactTooltip> ); } render () { if (this.props.show) { return this._renderOverlay(); } return this.props.children; } } Tooltip.defaultProps = { className: 'danger', show: false }; Tooltip.propTypes = { className: PropTypes.string, children: PropTypes.oneOfType([ PropTypes.arrayOf(PropTypes.node), PropTypes.node ]).isRequired, show: PropTypes.bool, title: PropTypes.oneOfType([ PropTypes.string, PropTypes.arrayOf(PropTypes.string) ]).isRequired }; export default Tooltip;
dojo.require("dojo.data.ItemFileReadStore"); dojo.require("dijit.form.FilteringSelect"); dojo.require("dijit.form.Form"); dojo.require("dojo.parser"); /* * Removes one row or items */ var removeThisRow = function() { //Removes the TR node using the removeThisRowButtonId buttonElementId = this.id; parentTd = this.parentNode; parentTr = parentTd.parentNode; dojo._destroyElement(parentTr); } var productChanged = function() { var pName = this.name; //pValue is the productId selected by the user var pValue = this.value; //pId has the productId /** * pElementId is the row id on which we are operating */ pElementId = pName.split("[")[1].split("]")[0]; var sellingPriceTempStorage; newProductStore = new dojo.data.ItemFileReadStore({url: '/product/jsonstore'}); taxStore = new dojo.data.ItemFileReadStore({url: '/finance/tax/store'}); //Fetch selling price and set value to the unit_price field newProductStore.fetchItemByIdentity({ identity: pValue, onItem: function(item) { sellingPrice = newProductStore.getValue(item,"unit_price"); sellingPriceTempStorage = sellingPrice; unit_price = dojo.byId("unit_price[" + pElementId + "]"); unit_price.value = sellingPrice; quantity = dojo.byId('quantity[' + pElementId + ']'); taxTypeId = newProductStore.getValue(item, "tax_type_id"); dijit.byId("tax_type_id_" + pElementId).attr('value', taxTypeId); taxStore.fetchItemByIdentity( { identity: taxTypeId, onItem: function(item) { taxPercentage = taxStore.getValue(item, "percentage"); _productChanged(pElementId, taxPercentage); } }); } }); } /* * Keeps track of number of rows in the table */ var counter = 0; var consultantCounter = 0; /* * Creates one row of item form elements */ function addLeadItemRow(initServiceItemId, initItemDescription, initQuantity, initUnitPrice, initTaxTypeId) { counter++; var stateSelect = new Array(); list = stateSelect[counter]; newStore = new dojo.data.ItemFileReadStore({url: '/lead/jsonstore'}); var lead = new dijit.form.FilteringSelect( { id: "lead_id_" + counter, name: "lead_id[" + counter + "]", searchAttr: "lead", store: newStore, // store: fStore, onChange: productChanged }, list); if (initServiceItemId != null) { if ( isNaN(initServiceItemId) == false) lead.attr('value', initServiceItemId); } var oTable = dojo.byId("lead_items_table"); // Get a handle to the table var rowsLength = oTable.tBodies[0].rows.length; var newRow = oTable.tBodies[0].insertRow(rowsLength-1); // insert a row for the Other text input. // Create the first cell and add the text prompt var newCell0 = newRow.insertCell(0); newCell0.appendChild(lead.domNode); //Remove item button var newCell1 = newRow.insertCell(1); var removeItemButton = document.createElement("input"); removeItemButton.type = "button"; removeItemButton.value = "Remove"; removeItemButton.name = "removeItemButton[" + counter + "]"; removeItemButton.id = "removeItemButton[" + counter + "]"; removeItemButton.onclick = removeThisRow; newCell1.appendChild(removeItemButton); }
var userLang = navigator.language || navigator.userLanguage; function myspanish() { Cookies.set("idiom", "es"); document.getElementById( 'flageng' ).style.display = 'block'; document.getElementById( 'flagspa' ).style.display = 'none'; $("#aboutli").text("Acerca"); $("#servicesli").text("Servicios"); $("#portli").text("Portafolio"); $("#histoli").text("Historia"); $("#introlead").text("Bienvenidos a mi Estudio!"); $("#introhead").text("Es un placer"); $("#tellmore").text("Dime Más"); $("#sectheadabout").text("Acerca de mi"); $("#sectheadabout2").text("Información Personal"); $("#textoabout").text("En lo profesional, ingeniero en informática. Siempre me he movido entre el desarrollo (web y de aplicaciones) como la ciencia de datos. Mi pasatiempo es el de escribir, me gusta investigar sobre temas que me llaman la atención y redactar pequeños ensayos. A veces, escribo historias de ficción"); $("#setservicesh2").text("Servicios"); $("#setservicesh3").text("Mis perfiles laborales"); $("#setservicesh4").text("Desarrollador Web"); $("#setservicesh5").text("Durante mis primeros años en el mundo profesional trabaje como desarrollador frontend y backend. Trabajando con: HTML, JavaScript, CSS, Php, Ruby on Rails,Yii Framework,bootstrap, Angular.js. "); $("#setservicesh6").text("Cientifico de Datos"); $("#setservicesh7").text("Como científico de datos trabajo mezclando estadisticas, informatica y mucha creatividad. En este apartado he trabajado con R y Python"); $("#setservicesh8").text("Creador de Contenidos"); $("#setservicesh9").text("Me gusta escribir como programar, Por ello lleno mis blogs personales con mis escritos y codigos de programas que he realizado para compartirlos."); $("#portfolioset1").text("Portafolio"); $("#portfolioset2").text("Mis proyectos"); $("#secthisto1").text("Historia"); $("#secthisto2").text("Mi evolucion"); $("#secthisto3").text("Mis estudios: Ingenieria en Informatica"); $("#secthisto4").text("Inicie mis estudios en la Universidad Nacional Experimental del Tachira, cursando la carrera de Ingenieria en Informatica. Donde aprendi los fundamentos de la ciencia de la computación, la ingeniería electrónica y la ingeniería de software. "); $("#secthisto5").text("Primer empleo: ERPcontable"); $("#secthisto6").text("Durante el 2012 obtuve mi primer empleo donde ejerci el papel de desarrollador de aplicaciones utilzando la herramienta Velneo. Tambien ejerci el papel de desarrollador web, helpdesk y soporte "); $("#secthisto7").text("Tiempos de cambios: Can Polit"); $("#secthisto8").text("A finales de 2014 decidir cambiar de perfil laboral, enfocando a trabajar en desarrollo web utilizando herramientas como Ruby on Rails, Bootstrap, etc."); $("#secthisto9").text("Evolucionando: Agropezim"); $("#secthisto10").text("Empece una nueva aventura, ejerciendo mas el aspecto gerencial de la carrera al encargarme de supervisar la implementacion de la herramienta Odoo dentro de la organización. Ademas empece adentrarme en el mundo de la Data Sciences"); $("#secthisto11").text("Ubiot"); $("#secthisto12").text("Ubiot Siendo una subsidiaria de Agropezim, mi perfil ha estado enfocado exclusivamente en el trabajo como cientifico de datos (data scientist). Ocasionalmente participando en proyectos de desarrollo web"); $("#secthisto13").text("Ubiot"); $("#secthisto14").text("Una vez mas me enfoque al desarrollo web, fui el desarrollador principal del sitio web Rentadvisor, pagina dedicada al alquiler de inmuebles en Chile"); $("#secthisto15").text("Desarrollo Web - Wordpress"); $("#secthisto16").text("Dedicado al desarrollo web con wordpress y ruby on rails freelance realizando mas de 6 proyectos durante todo el año. Fui responsable del desarrollo completo y de cada fase del proyecto de cada pagina web en los cuales participe"); $("#secthisto17").text("Se parte de mi Historia"); $("#metodo1").text("Metodologia SCRUM"); $("#metodo2").text("Scrum es el nombre con el que se denomina a los marcos de desarrollo ágiles. Es un proceso en el que se aplican de manera regular un conjunto de buenas prácticas para trabajar colaborativamente, en equipo y obtener el mejor resultado posible de proyectos, caracterizado por: Adoptar una estrategia de desarrollo incremental, en lugar de la planificación y ejecución completa del producto. Basar la calidad del resultado más en el conocimiento tácito de las personas en equipos auto organizados, que en la calidad de los procesos empleados. Solapamiento de las diferentes fases del desarrollo, en lugar de realizar una tras otra en un ciclo secuencial o en cascada"); $("#metodo3").text("Metodologia de trabajo"); $("#metodo4").text("Expandir"); $("#experitica1").text("Lenguajes y Herramientas"); $("#experitica2").text("Lenguajes "); $("#experitica3").text("Herramientas"); $("#experitica4").text("Base de datos / Cloud"); $("#portfolioset3").text("Desarrollo Web Con Wordpress"); $("#portfolioset4").text("Desarrollo Web Con Wordpress"); $("#portfolioset6").text("Desarrollo Web Con Wordpress"); $("#portfolioset7").text("Desarrollo Web Con Laravel"); $("#portfolioset8").text("Desarrollo Web Con Laravel"); $("#portfolioset9").text("Desarrollo Web Con Laravel"); $("#textmodal1").text("Desarrollo Web Con Wordpress"); $("#textmodal2").text("Desarrollo de una pagina web para la empresa LivingGreen, especializada en servicios de limpieza de inmuebles"); $("#textmodal3").text("Año: 2019"); $("#textmodal4").text("Cliente: LivingGreen"); $("#textmodal5").text("Categoria: Desarrollo Web"); $(".camcerrar").text("Cerrar"); $("#textmodal6").text("Desarrollo Web Con Wordpress"); $("#textmodal8").text("Año: 2019"); $("#textmodal9").text("Cliente: Evolve Miami Beach"); $("#textmodal10").text("Desarrollo Web Con Wordpress"); $("#textmodal11").text("Desarrollo Web Con Laravel"); $("#textmodal12").text("Parte del grupo de desarrollo encargado de crear un sistema de manejo de campañas de marketing y ventas a clientes en linea para la compañia Santa Rita"); $("#textmodal13").text("Año: 2019"); $("#textmodal14").text("Cliente: Santa Rita"); $("#textmodal15").text("Categoria: Desarrollo Web"); $("#textmodal16").text("Desarrollo Web Con Wordpress"); $("#textmodal17").text("Miembro del grupo de desarrollo de la landing page para la empresa The MIC of America. Mi rol fue desarrollador front end, con algunas responsabilidades como backend"); $("#textmodal18").text("Año: 2019"); $("#textmodal19").text("Cliente: The Mic of America"); $("#textmodal20").text("Categoria: Desarrollo Web"); $("#textmodal21").text("Desarrollo Web Con Java y Spring Tool Suite"); $("#textmodal22").text("Año: 2019"); $("#textmodal23").text("Cliente: Mexperience"); $("#textmodal25").text("Miembro del grupo de desarrollo del CMS MEXperiencia para la administracion de clientes. Mi role principal fue de desarrollador backend usando el framework Spring Tool Suite"); $("#textmodal26").text("Desarrollo Web Con Laravel"); $("#textmodal27").text("Año: 2019"); $("#textmodal28").text("Cliente: Valle Grande"); $("#textmodal29").text("Categoria: Desarrollo Web"); $("#textmodal30").text("Utilizando laravel se creo un sistema de admin para la actualización de la pagina, ademas, se modifico el estilo entero del sitio web"); $("#textmodal31").text("Desarrollo Web Con Laravel"); $("#textmodal32").text("Sistema de control de inscripciones y evaluaciones para cursos en linea, se controla los procesos de evaluacion, clases y asistenciade alumnos, genera estadisticas"); $("#textmodal33").text("Año: 2019"); $("#textmodal34").text("Cliente: Protege"); $("#textmodal35").text("Categoria: Desarrollo Web"); $("#textmodal36").text("Desarrollo Web Con Wordpress"); $("#textmodal37").text("Pagina del PSG para Estados Unidos, pagina enfocada en proporcionar informacion sobre academias de futbol para niños y adolescentes. Mi rol ha sido el de actualizar y hacer cambios en las pagina"); $("#textmodal38").text("Año: 2019"); $("#textmodal39").text("Cliente: PSG academy"); $("#textmodal40").text("Categoria: Desarrollo Web"); $('.curriculumesp').css('display','block'); $('.curriculumeng').css('display','none'); } function myenglish() { Cookies.set("idiom", "en"); document.getElementById( 'flageng' ).style.display = 'none'; document.getElementById( 'flagspa' ).style.display = 'block'; $("#aboutli").text("About"); $("#servicesli").text("Services"); $("#portli").text("Portfolios"); $("#histoli").text("History"); $("#introlead").text("Welcome to my Studio!"); $("#introhead").text("It's a pleasure"); $("#tellmore").text("Tell more"); $("#sectheadabout").text("About"); $("#sectheadabout2").text("Personal Information"); $("#textoabout").text("In my professional life I am a software engineer working mostly as Web developer and Data Scientist My hobby is writing, I love to read and enjoy the internet"); $("#setservicesh2").text("Services"); $("#setservicesh3").text("Professional Profile"); $("#setservicesh4").text("Web Developer"); $("#setservicesh5").text("I have been working in web development for almost 8 years in the frontend and backend areas. I have been working with: HTML, JavaScript, CSS, Php, Ruby on Rails,Yii Framework,bootstrap, Wordpress, Angular.js. "); $("#setservicesh6").text("Data Scientist"); $("#setservicesh7").text("I have been working as Data Scientist, My main project in this areas is my college Thesis is about aplying Data mining on criminal statistics using R and Python"); $("#setservicesh8").text("Content Creator"); $("#setservicesh9").text("I love to write as I love coding, I had run severals blogs and I like to answers questions on Quora and Reddit."); $("#portfolioset1").text("Portfolio"); $("#portfolioset2").text("My Projects"); $("#secthisto1").text("History"); $("#secthisto2").text("My Evolution"); $("#secthisto3").text("My Studies: Software Engineering"); $("#secthisto4").text("My academics studies started in the University of Tachira, The career I choose to study was Software engineering where I learned the fundamentals of Computer Science, Web development, Coding and software Development"); $("#secthisto5").text("My First Job: ERPcontable"); $("#secthisto6").text("During 2012 I worked in my first Job as Application Developer using the spanish framework Velneo. During those days I also work as web developer improving the company's website, I did helpdesk and client support"); $("#secthisto7").text("My second job: Can Polit"); $("#secthisto8").text("In 2014 I change jobs and became full web developer working in several websites using Ruby on Rails, Bootstrap, Responsive desing and more"); $("#secthisto9").text("Next step: Agropezim"); $("#secthisto10").text("I started a new adventure when I was hired to supervised the deployment of Odoo ERP in Agropezim. And became junior engineering on the Data Science projects of the company"); $("#secthisto11").text("Ubiot"); $("#secthisto12").text("During this year I invested most of my time working in data science projects. Sometimes I lead web development inside the company"); $("#secthisto13").text("Ubiot"); $("#secthisto14").text("Once again became a full web developer working with wordpress. Leading the development of Rentadvisor's website with the purpose of renting houses in Chile"); $("#secthisto15").text("Web Development - Wordpress"); $("#secthisto16").text("Dedicated to web development with wordpress and ruby ​​on rails freelance making more than 6 projects throughout the year. I was responsible for the complete development and each phase of the project of each web page in which I participated"); $("#secthisto17").text("Be part of my history"); $("#metodo1").text("Scrum Methodology"); $("#metodo2").text("Scrum is an agile framework for managing knowledge work, with an emphasis on software development, although it has wide application in other fields and is slowly starting to be explored by traditional project teams more generally. It is designed for teams of three to nine members, who break their work into actions that can be completed within timeboxed iterations, called sprints, no longer than one month and most commonly two weeks, then track progress and re-plan in 15-minute time-boxed stand-up meetings, called daily scrum"); $("#metodo3").text("Work Methodology"); $("#metodo4").text("See More"); $("#experitica1").text("Languages and Tools"); $("#experitica2").text("Languages"); $("#experitica3").text("Tools"); $("#experitica4").text("Database / Cloud"); $("#portfolioset3").text("Web Development with Wordpress"); $("#portfolioset4").text("Web Development with Wordpress"); $("#portfolioset6").text("Web Development with Wordpress"); $("#portfolioset7").text("Web Development with Laravel"); $("#portfolioset8").text("Web Development With Laravel"); $("#portfolioset9").text("Web Development With Laravel"); $("#portfolioset10").text("See More"); $("#textmodal1").text("Web Development with Wordpress"); $("#textmodal2").text("Development of a website for LivingGreenn, specialized in real estate cleaning services"); $("#textmodal3").text("Year: 2019"); $("#textmodal4").text("Client: LivingGreen"); $("#textmodal5").text("Category: Web Development"); $(".camcerrar").text("Close"); $("#textmodal6").text("Web Development with Wordpress"); $("#textmodal7").text("The wordpress theme were updated, it was made desing changes and the site was optimized in order to be responsive."); $("#textmodal8").text("Year: 2019"); $("#textmodal9").text("Client: Evolve Miami Beach"); $("#textmodal10").text("Category: Web Development"); $("#textmodal1").text("Category: Web Development"); $("#textmodal11").text("Web Development with Laravel"); $("#textmodal12").text("Part of the development group in charge of creating a marketing and sales campaign management system for online customers for the Santa Rita company"); $("#textmodal13").text("Year: 2019"); $("#textmodal14").text("Client: Santa Rita"); $("#textmodal15").text("Category: Web Development"); $("#textmodal16").text("Web Development with Wordpress"); $("#textmodal18").text("Year: 2019"); $("#textmodal19").text("Client: The Mic of America"); $("#textmodal20").text("Category: Web Development"); $("#textmodal17").text("Member of the development group of the landing page for the company The MIC of America. My role was front end developer, with some responsibilities as a backend"); $("#textmodal21").text("Web Development with Java and Spring Tool suite"); $("#textmodal22").text("Year: 2019"); $("#textmodal23").text("Client: Mexperience"); $("#textmodal24").text("Web Development with Java"); $("#textmodal25").text("Member of the CMS MEXperience development group for client management. My main role was developer backend using the Spring Tool Suite framework"); $("#textmodal26").text("Web Development With Laravel"); $("#textmodal27").text("Year: 2019"); $("#textmodal28").text("Client: Valle Grande"); $("#textmodal29").text("Category: Web Development"); $("#textmodal30").text("Using laravel, an admin system was created for updating the page, and the entire style of the website was modified."); $("#textmodal31").text("Web Development With Laravel"); $("#textmodal32").text("Registration and evaluation control system for online courses, the evaluation processes, classes and student attendance are managed, statistics are generated"); $("#textmodal33").text("Year: 2019"); $("#textmodal34").text("Client: Protege"); $("#textmodal35").text("Category: Web Development"); $("#textmodal37").text("PSG website for the United States, page focused on providing information on soccer academies for children and adolescents. My role has been to update and make changes in the pages"); $("#textmodal36").text("Web Development with Wordpress"); $("#textmodal38").text("Year: 2019"); $("#textmodal39").text("Client: PSG academy"); $("#textmodal40").text("Category: Web Development"); $('.curriculumesp').css('display','none'); $('.curriculumeng').css('display','block'); } $(document).ready(function() { console.log(Cookies.get("idiom")); if(Cookies.get("idiom")){ if(Cookies.get("idiom") == "es"){ myspanish(); }else{ myenglish(); } }else{ if(userLang.split('-')[0] == "es"){ myspanish(); }else{ myenglish(); } } }); $('#flagspa').click(function(){ myspanish(); }); $('#flageng').click(function(){ myenglish(); });
/* Base config: ========================================================================== */ const webpack = require('webpack'); const path = require('path'); const fs = require('fs'); const MiniCssExtractPlugin = require('mini-css-extract-plugin'); const CopyWebpackPlugin = require('copy-webpack-plugin'); const HtmlWebpackPlugin = require('html-webpack-plugin'); const {VueLoaderPlugin} = require('vue-loader'); const {CleanWebpackPlugin} = require('clean-webpack-plugin'); const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin; // Main const. Feel free to change it const isDev = process.env.NODE_ENV === 'development'; const isProd = !isDev; const PATHS = { src: path.join(__dirname, '../../src'), dist: path.join(__dirname, (isProd ? '../../public' : '../../dist')), webpack: path.join(__dirname, '../../webpack'), assets: 'assets/', }; const fileName = ext => isDev ? `[name].${ext}` : `[name].${ext}` const plugins = (type) => { const base = [ new VueLoaderPlugin(), new MiniCssExtractPlugin({ filename: `${PATHS.assets}css/${fileName('css')}`, }), new CopyWebpackPlugin({ patterns: [ {from: `${PATHS.src}/${PATHS.assets}img`, to: `${PATHS.assets}img`}, {from: `${PATHS.src}/${PATHS.assets}fonts`, to: `${PATHS.assets}fonts`}, // {from: `${PATHS.src}/pages/php`, to: ``}, {from: `${PATHS.src}/static`, to: ''}, ] }), new CleanWebpackPlugin(), //new BundleAnalyzerPlugin() ]; switch (type) { case 'html': { const PAGES_DIR = `${PATHS.src}/pages`; const PAGES = fs .readdirSync(PAGES_DIR) .filter((fileName) => fileName.endsWith('.html')); base.push( ...PAGES.map( (page) => new HtmlWebpackPlugin({ template: `${PAGES_DIR}/${page}`, filename: page, }), ),); break; } case 'pug': { const PAGES_DIR = `${PATHS.src}/pages/pug/includes/pages`; let pages = fs.readdir(PAGES_DIR, (err, files) => { return files; }); console.log(pages); const PAGES = fs .readdirSync(PAGES_DIR) .filter((fileName) => fileName.endsWith('.pug')); base.push( ...PAGES.map( (page) => new HtmlWebpackPlugin({ template: `${PAGES_DIR}/${page}`, filename: (page === 'index.pug' || page === '404.pug' ? page.replace(/\.pug/, '.html') : `${page.split('.')[0]}/index.html`), }), ),); break; } } const PAGES_PHP = fs .readdirSync(PATHS.src) .filter((fileName) => fileName.endsWith('.php')); base.push( ...PAGES_PHP.map( (page) => new HtmlWebpackPlugin({ template: `${PATHS.src}/${page}`, filename: `${page}`, inject: false, }), ),) return base } module.exports = { externals: { paths: PATHS, }, entry: { app: ['@babel/polyfill', PATHS.webpack], // module: `${PATHS.src}/your-module.js`, }, output: { filename: `${PATHS.assets}js/${fileName('js')}`, path: PATHS.dist, publicPath: isDev ? '/' : '', }, optimization: { splitChunks: { cacheGroups: { vendor: { name: 'vendors', test: /node_modules/, chunks: 'all', enforce: true, }, // css: { // name: 'css', // test: /\.css$/, // chunks: 'all', // enforce: true, // }, // scss: { // name: 'scss', // test: /\.scss$/, // chunks: 'all', // enforce: true, // }, }, }, }, devtool: isDev ? 'source-map' : '', module: { rules: [ // TypeScript { test: /\.ts$/, exclude: /node_modules|vue\/src/, loader: 'ts-loader', options: { appendTsSuffixTo: [/\.vue$/], }, }, { test: /\.js$/, exclude: /node_modules/, loader: 'babel-loader', options: { presets: [ '@babel/preset-env' ] } }, { test: /\.pug$/, oneOf: [ { resourceQuery: /^\?vue/, use: ['pug-plain-loader'], }, { use: ['pug-loader'], } ], }, { // Vue test: /\.vue$/, loader: 'vue-loader', options: { loader: { scss: 'vue-style-loader!css-loader!sass-loader', }, postcss: { config: { path: PATHS.webpack, }, }, }, }, { // Fonts test: /\.(woff(2)?|ttf|eot|svg)(\?v=\d+\.\d+\.\d+)?$/, loader: 'file-loader', options: { name: `[name].[ext]`, outputPath: '/assets/fonts/' }, }, { test: /\.(png|jpg|gif|svg)$/, use: [ { loader: 'file-loader', options: { esModule: false, name: '[name].[ext]', outputPath: `${PATHS.assets}/img`, //publicPath: `/${PATHS.assets}img`, }, }, ], }, { // scss test: /\.scss$/, use: [ 'style-loader', MiniCssExtractPlugin.loader, { loader: 'css-loader', options: {sourceMap: true}, }, { loader: 'postcss-loader', options: { sourceMap: true, config: {path: `${PATHS.webpack}/postcss.config.js`}, }, }, { loader: 'sass-loader', options: { sourceMap: true, }, }, { loader: 'sass-resources-loader', options: { resources: [ './src/assets/scss/core/base.scss', ], }, }, ], }, { // css test: /\.css$/, use: [ 'style-loader', MiniCssExtractPlugin.loader, { loader: 'css-loader', options: {sourceMap: true}, }, { loader: 'postcss-loader', options: { sourceMap: true, config: {path: `${PATHS.webpack}/postcss.config.js`}, }, }, ], }, // { // test: /\.(html)$/, // use: [ // { // loader: 'html-loader', // // options: { // // minimize: { // // removeComments: true, // // collapseWhitespace: false, // // }, // // }, // }, // ], // }, ], }, resolve: { alias: { '~': PATHS.src, 'vue$': 'vue/dist/vue.js', '@': path.resolve(__dirname, '../../src'), '@img': path.resolve(__dirname, '../../src/assets/img/'), }, extensions: ['.tsx', '.ts', '.js'], }, plugins: plugins('pug'), };
const { URL } = require('url'); const Handlebars = require('handlebars'); const { declareInjections } = require('@cardstack/di'); const DEFAULT_SOCKET_IO_PORT = 3100; const DEFAULT_SOCKET_IO_PATH = '/'; const template = Handlebars.compile(` define("@cardstack/live-queries/environment", ["exports"], function (exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); {{#each properties as |property|}} exports.{{property.name}} = "{{property.value}}"; {{/each}} }); `); module.exports = declareInjections({ plugins: 'hub:plugins', publicURL: 'config:public-url' }, class LiveQueryCodeGenerator { async generateCode() { let configured = await this.plugins.active(); let pluginConfig = configured.describe('@cardstack/live-queries'); let port = pluginConfig.attributes['socket-port'] || DEFAULT_SOCKET_IO_PORT; let socketPath = pluginConfig.attributes['socket-path'] || DEFAULT_SOCKET_IO_PATH; let socketIoUrl = new URL(this.publicURL.url); socketIoUrl.port = port; socketIoUrl.pathname = ''; return template({ properties: [ { name: 'host', value: socketIoUrl.toString() }, { name: 'path', value: socketPath } ]}); } });
var searchData= [ ['checkstate',['checkState',['../classactor_1_1aquamentus_1_1_aquamentus.html#a9a995cf75da6e464cf0292c7514536e5',1,'actor.aquamentus.Aquamentus.checkState()'],['../classactor_1_1boss_1_1_boss.html#a5f510a5ea8387c4ccb1c5c36e54efa5d',1,'actor.boss.Boss.checkState()'],['../classactor_1_1enemy_1_1_enemy.html#afa749d4d6a88fac474c3929ccd3b0753',1,'actor.enemy.Enemy.checkState()'],['../classactor_1_1fireball_1_1_fireball.html#abf7cee468c753aa1ed23bd45cd7a7bdc',1,'actor.fireball.Fireball.checkState()'],['../classactor_1_1keese_1_1_keese.html#a2c191c26fc310458619fdf49166e8434',1,'actor.keese.Keese.checkState()'],['../classactor_1_1stalfos_1_1_stalfos.html#adea3ec3198efffc7015efb4b49a44a69',1,'actor.stalfos.Stalfos.checkState()']]], ['clear',['clear',['../classcollision_1_1levelmanager_1_1_level_manager.html#a11bb309e2c9c137a0000f1d94b3788f6',1,'collision::levelmanager::LevelManager']]], ['collision',['collision',['../classactor_1_1boomerang_1_1_boomerang.html#ad32ffa27cd6221ed74d144f8874eae5f',1,'actor.boomerang.Boomerang.collision()'],['../classactor_1_1item_1_1_item.html#a3ad3940f06483ccce49fe2673896555f',1,'actor.item.Item.collision()'],['../classcollision_1_1door_1_1_door.html#a905d11890b7fa2fa789d67538136e685',1,'collision.door.Door.collision()'],['../classcollision_1_1wall_1_1_wall.html#a9514acfca4d222ec8d838d7bb29aeb1e',1,'collision.wall.Wall.collision()']]], ['collisionupdate',['collisionupdate',['../classactor_1_1boomerang_1_1_boomerang.html#abbfebdf98803c7e4ac69a1a6e251d781',1,'actor.boomerang.Boomerang.collisionupdate()'],['../classactor_1_1player_1_1_player.html#a427c65b6cb4d5b960493ead3cfc3fda1',1,'actor.player.Player.collisionupdate()']]] ];
"use strict"; import { NativeModules, Platform } from "react-native"; const RNUpdateAPK = NativeModules.RNUpdateAPK; let jobId = -1; export class UpdateAPK { constructor(options) { this.options = options; } get = (url, success, error, options = {}) => { fetch(url, options) .then(response => response.json()) .then(json => { success && success(json); }) .catch(err => { error && error(err); }); }; getApkVersion = () => { if (jobId !== -1) { return; } if (!this.options.apkVersionUrl) { console.log("RNUpdateAPK::getApkVersion - apkVersionUrl doesn't exist."); return; } this.get( this.options.apkVersionUrl, this.getApkVersionSuccess.bind(this), this.getVersionError.bind(this), this.options.apkVersionOptions ); }; getApkVersionSuccess = remote => { console.log("getApkVersionSuccess", remote); // TODO switch this to versionCode let outdated = false; if (remote.versionCode && (remote.versionCode > RNUpdateAPK.versionCode)) { console.log('RNUpdateAPK::getApkVersionSuccess - outdated based on code, local/remote: ' + RNUpdateAPK.versionCode + "/" + remote.versionCode); outdated = true; } if (!remote.versionCode && (RNUpdateAPK.versionName !== remote.versionName)) { console.log('RNUpdateAPK::getApkVersionSuccess - APK outdated based on version name, local/remote: ' + RNUpdateAPK.versionName + "/" + remote.versionName); outdated = true; } if (outdated) { if (remote.forceUpdate) { if (this.options.forceUpdateApp) { this.options.forceUpdateApp(); } this.downloadApk(remote); } else if (this.options.needUpdateApp) { this.options.needUpdateApp(isUpdate => { if (isUpdate) { this.downloadApk(remote); } }, remote.whatsNew); } } else if (this.options.notNeedUpdateApp) { this.options.notNeedUpdateApp(); } }; downloadApk = remote => { const RNFS = require("react-native-fs"); const progress = data => { const percentage = ((100 * data.bytesWritten) / data.contentLength) | 0; this.options.downloadApkProgress && this.options.downloadApkProgress(percentage, data.contentLength, data.bytesWritten); }; const begin = res => { console.log("RNUpdateAPK::downloadApk - downloadApkStart"); this.options.downloadApkStart && this.options.downloadApkStart(); }; const progressDivider = 1; // You must be sure filepaths.xml exposes this path or you will have a FileProvider error API24+ // You might check {totalSpace, freeSpace} = await RNFS.getFSInfo() to make sure there is room const downloadDestPath = `${RNFS.CachesDirectoryPath}/NewApp.apk`; let options = this.options.apkOptions ? this.options.apkOptions : {}; const ret = RNFS.downloadFile( Object.assign( { fromUrl: remote.apkUrl, toFile: downloadDestPath, begin, progress, background: true, progressDivider }, options ) ); jobId = ret.jobId; ret.promise .then(res => { if (res['statusCode'] >= 400 && res['statusCode'] <= 599){ throw "Failed to Download APK. Server returned with " + res['statusCode'] + " statusCode"; } console.log("RNUpdateAPK::downloadApk - downloadApkEnd"); this.options.downloadApkEnd && this.options.downloadApkEnd(); RNUpdateAPK.getApkInfo(downloadDestPath) .then(res => { console.log( "RNUpdateAPK::downloadApk - Old Cert SHA-256: " + RNUpdateAPK.signatures[0].thumbprint ); console.log("RNUpdateAPK::downloadApk - New Cert SHA-256: " + res.signatures[0].thumbprint); if ( res.signatures[0].thumbprint !== RNUpdateAPK.signatures[0].thumbprint ) { // FIXME should add extra callback for this console.log( "The signature thumbprints seem unequal. Install will fail" ); } }) .catch(rej => { console.log("RNUpdateAPK::downloadApk - apk info error: ", rej); this.options.onError && this.options.onError("Failed to get Downloaded APK Info"); // re-throw so we don't attempt to install the APK, this will call the downloadApkError handler throw rej; }); RNUpdateAPK.installApk( downloadDestPath, this.options.fileProviderAuthority ); jobId = -1; }) .catch(err => { this.downloadApkError(err); jobId = -1; }); }; getAppStoreVersion = () => { if (!this.options.iosAppId) { console.log("RNUpdateAPK::getAppStoreVersion - iosAppId doesn't exist."); return; } const URL = "https://itunes.apple.com/lookup?id=" + this.options.iosAppId + "&time=" +(new Date()); console.log("RNUpdateAPK::getAppStoreVersion - attempting to fetch " + URL); this.get( URL, this.getAppStoreVersionSuccess.bind(this), this.getVersionError.bind(this) ); }; getAppStoreVersionSuccess = data => { if (data.resultCount < 1) { console.log("RNUpdateAPK::getAppStoreVersionSuccess - iosAppId is wrong."); return; } const result = data.results[0]; const version = result.version; const trackViewUrl = result.trackViewUrl; let majorVersionCode = version.split(/[.]/)[0] let appMajorVersionCode = RNUpdateAPK.versionName.split(/[.]/)[0] if (majorVersionCode !== appMajorVersionCode) { if (this.options.needUpdateApp) { this.options.needUpdateApp(isUpdate => { if (isUpdate) { RNUpdateAPK.installFromAppStore(trackViewUrl); } }); } } }; getVersionError = err => { console.log("RNUpdateAPK::getVersionError - getVersionError", err); this.options.onError && this.options.onError(err); }; downloadApkError = err => { console.log("RNUpdateAPK::downloadApkError - downloadApkError", err); this.options.onError && this.options.onError(err); }; checkUpdate = () => { if (Platform.OS === "android") { this.getApkVersion(); } else { this.getAppStoreVersion(); } }; } // Returns a Promise with either boolean true for success, or the Exception on error export function patchSSLProvider(force = false, dialogIfRepairable = false) { if (Platform.OS !== "android") { return Promise.resolve(true); } console.log("Attempting to patch SSL Provider"); return RNUpdateAPK.patchSSLProvider(force, dialogIfRepairable); } export function getInstalledVersionName() { return RNUpdateAPK.versionName; } export function getInstalledVersionCode() { return RNUpdateAPK.versionCode; } export function getInstalledPackageName() { return RNUpdateAPK.packageName; } export function getInstalledFirstInstallTime() { return RNUpdateAPK.firstInstallTime; } export function getInstalledLastUpdateTime() { return RNUpdateAPK.lastUpdateTime; } export function getInstalledPackageInstaller() { return RNUpdateAPK.packageInstaller; } export function getInstalledSigningInfo() { return RNUpdateAPK.signatures; } export async function getApps() { if (Platform.OS === "android") { return RNUpdateAPK.getApps(); } else { return Promise.resolve([]); } } export async function getNonSystemApps() { if (Platform.OS === "android") { return RNUpdateAPK.getNonSystemApps(); } else { return Promise.resolve([]); } }
import { sample } from 'lodash'; // utils import mock from './mock'; import mockData from '../utils/mock-data'; // ---------------------------------------------------------------------- const createLabelIds = (index) => { if (index === 1) { return ['id_promotions', 'id_forums']; } if (index === 2) { return ['id_forums']; } if (index === 5) { return ['id_social']; } return []; }; const createAttachment = (index) => { if (index === 1) { return [mockData.image.feed(1), mockData.image.feed(2)]; } if (index === 2) { return [ 'https://mail.google.com/mail/u/file1.docx', 'https://mail.google.com/mail/u/file2.xlsx', 'https://mail.google.com/mail/u/file3.pptx', 'https://mail.google.com/mail/u/file7.sketch' ]; } if (index === 5) { return [ mockData.image.feed(1), mockData.image.feed(2), '/static/mock-images/avatars/avatar_12.mp4', 'https://mail.google.com/mail/u/file1.docx', 'https://mail.google.com/mail/u/file2.xlsx', 'https://mail.google.com/mail/u/file3.pptx', 'https://mail.google.com/mail/u/file4.pdf', 'https://mail.google.com/mail/u/file5.psd', 'https://mail.google.com/mail/u/file6.esp', 'https://mail.google.com/mail/u/file7.sketch' ]; } return []; }; const FOLDER = ['promotions', 'spam', 'inbox', 'folder']; // ---------------------------------------------------------------------- const labels = [ { id: 'all', type: 'system', name: 'all mail', unreadCount: 3 }, { id: 'inbox', type: 'system', name: 'inbox', unreadCount: 1 }, { id: 'sent', type: 'system', name: 'sent', unreadCount: 0 }, { id: 'drafts', type: 'system', name: 'drafts', unreadCount: 0 }, { id: 'trash', type: 'system', name: 'trash', unreadCount: 0 }, { id: 'spam', type: 'system', name: 'spam', unreadCount: 1 }, { id: 'important', type: 'system', name: 'important', unreadCount: 1 }, { id: 'starred', type: 'system', name: 'starred', unreadCount: 1 }, { id: 'id_social', type: 'custom', name: 'social', unreadCount: 0, color: '#00AB55' }, { id: 'id_promotions', type: 'custom', name: 'promotions', unreadCount: 2, color: '#1890FF' }, { id: 'id_forums', type: 'custom', name: 'forums', unreadCount: 1, color: '#FFC107' } ]; const mails = [...Array(9)].map((_, index) => ({ id: mockData.id(index), labelIds: createLabelIds(index + 1), folder: sample(FOLDER), isImportant: mockData.boolean(index), isStarred: mockData.boolean(index), isUnread: mockData.boolean(index), subject: mockData.text.title(index), message: mockData.text.sentence(index), createdAt: mockData.time(index), files: createAttachment(index), from: { name: mockData.name.fullName(index), email: mockData.email(index), avatar: index === 1 || index === 2 || index === 5 || index === 6 || index === 8 ? null : mockData.image.avatar(index) }, to: [ { name: 'Jaydon Frankie', email: 'demo@minimals.cc', avatar: null } ] })); // ---------------------------------------------------------------------- const filterMails = (mails, labels, systemLabel, customLabel) => { if (customLabel) { const label = labels.find((_label) => _label.name === customLabel); if (!label) { return []; } return mails.filter((mail) => mail.labelIds.includes(label.id)); } if (systemLabel === 'all') { return mails; } if (['starred', 'important'].includes(systemLabel)) { if (systemLabel === 'starred') { return mails.filter((mail) => mail.isStarred); } if (systemLabel === 'important') { return mails.filter((mail) => mail.isImportant); } } if (['inbox', 'sent', 'drafts', 'trash', 'spam', 'starred'].includes(systemLabel)) { return mails.filter((mail) => mail.folder === systemLabel); } return []; }; // ---------------------------------------------------------------------- mock.onGet('/api/mail/labels').reply(200, { labels }); // ---------------------------------------------------------------------- mock.onGet('/api/mail/mails').reply((config) => { try { const { systemLabel, customLabel } = config.params; const filteredMails = filterMails(mails, labels, systemLabel, customLabel); return [200, { mails: filteredMails }]; } catch (error) { console.error(error); return [500, { message: 'Internal server error' }]; } }); // ---------------------------------------------------------------------- mock.onGet('/api/mail/mail').reply((config) => { try { const { mailId } = config.params; const mail = mails.find((_mail) => _mail.id === mailId); if (!mail) { return [404, { message: 'Mail not found' }]; } return [200, { mail }]; } catch (error) { console.error(error); return [500, { message: 'Internal server error' }]; } });
var Promise = require("bluebird"); var fs = Promise.promisifyAll(require("fs")); var _ = require("lodash"); var path = require("path"); var util = require("util"); function directorySizeInfo(root) { var counts = {dirs: 0, files: 0}; var stats = (function reader(root) { return fs.readdirAsync(root).map(function (fileName) { var filePath = path.join(root, fileName); return fs.statAsync(filePath).then(function (stat) { stat.filePath = filePath; if (stat.isDirectory()) { counts.dirs++; return reader(filePath) } counts.files++; return stat; }); }).then(_.flatten); })(root).then(_.chain); var smallest = stats.call("min", "size").call("pick", "size", "filePath").call("value"); var largest = stats.call("max", "size").call("pick", "size", "filePath").call("value"); var totalSize = stats.call("pluck", "size").call("reduce", function (a, b) { return a + b; }, 0); return Promise.props({ counts: counts, smallest: smallest, largest: largest, totalSize: totalSize }); } directorySizeInfo(process.argv[2] || ".").then(function (sizeInfo) { console.log(util.format(" \n\ %d directories, %d files \n\ Total size: %d bytes \n\ Smallest file: %s with %d bytes \n\ Largest file: %s with %d bytes \n\ ", sizeInfo.counts.dirs, sizeInfo.counts.files, sizeInfo.totalSize, sizeInfo.smallest.filePath, sizeInfo.smallest.size, sizeInfo.largest.filePath, sizeInfo.largest.size)); });
'use strict'; import upgrade from '../scripts/upgrade' import runWithTruffle from '../utils/runWithTruffle' import { parseInit } from '../utils/input' const name = 'update' const signature = `${name} [alias] [address]` const description = 'upgrade contract to a new logic. Provide the [alias] you added your contract with, or use --all flag to upgrade all. If no [address] is provided, all instances of that contract class will be upgraded' const register = program => program .command(signature, { noHelp: true }) .usage('[alias] [address] --network <network> [options]') .description(description) .option('--init [function]', `call function after upgrading contract. If no name is given, 'initialize' will be used`) .option('--args <arg1, arg2, ...>', 'provide initialization arguments for your contract if required') .option('--all', 'upgrade all contracts in the application') .option('-f, --from <from>', 'specify transaction sender address') .option('-n, --network <network>', 'network to be used') .option('--timeout <timeout>', 'timeout in seconds for blockchain transactions') .option('--force', 'force creation even if contracts have local modifications') .action(action) async function action(contractAlias, proxyAddress, options) { const { initMethod, initArgs } = parseInit(options, 'initialize') const { all, force } = options await runWithTruffle(async (opts) => await upgrade({ contractAlias, proxyAddress, initMethod, initArgs, all, force, ... opts }), options) } export default { name, signature, description, register, action }
/** * @license Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.html or http://ckeditor.com/license */ /** * @fileOverview The "divarea" plugin. It registers the "wysiwyg" editing * mode using a DIV element. */ CKEDITOR.plugins.add( 'divarea', { afterInit: function( editor ) { // Add the "wysiwyg" mode. // Do that in the afterInit function, so it'll eventually overwrite // the mode defined by the wysiwygarea plugin. editor.addMode( 'wysiwyg', function( callback ) { var editingBlock = CKEDITOR.dom.element.createFromHtml( '<div class="cke_wysiwyg_div cke_reset" hidefocus="true"></div>' ); var contentSpace = editor.ui.space( 'contents' ); contentSpace.append( editingBlock ); editingBlock = editor.editable( editingBlock ); editingBlock.detach = CKEDITOR.tools.override( editingBlock.detach, function( org ) { return function() { org.apply( this, arguments ); this.remove(); }; }); editor.setData( editor.getData( 1 ), callback ); editor.fire( 'contentDom' ); }); } });
// Copyright 2009 the Sputnik authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- info: Operator x | y returns ToNumber(x) | ToNumber(y) es5id: 11.10.3_A3_T1.3 description: Type(x) and Type(y) vary between primitive string and String object ---*/ //CHECK#1 if (("1" | "1") !== 1) { throw new Test262Error('#1: ("1" | "1") === 1. Actual: ' + (("1" | "1"))); } //CHECK#2 if ((new String("1") | "1") !== 1) { throw new Test262Error('#2: (new String("1") | "1") === 1. Actual: ' + ((new String("1") | "1"))); } //CHECK#3 if (("1" | new String("1")) !== 1) { throw new Test262Error('#3: ("1" | new String("1")) === 1. Actual: ' + (("1" | new String("1")))); } //CHECK#4 if ((new String("1") | new String("1")) !== 1) { throw new Test262Error('#4: (new String("1") | new String("1")) === 1. Actual: ' + ((new String("1") | new String("1")))); } //CHECK#5 if (("x" | "1") !== 1) { throw new Test262Error('#5: ("x" | "1") === 1. Actual: ' + (("x" | "1"))); } //CHECK#6 if (("1" | "x") !== 1) { throw new Test262Error('#6: ("1" | "x") === 1. Actual: ' + (("1" | "x"))); }
'use strict'; describe('Filter: orderBy', function() { var orderBy; beforeEach(inject(function($filter) { orderBy = $filter('orderBy'); })); it('should return same array if predicate is falsy', function() { var array = [1, 2, 3]; expect(orderBy(array)).toBe(array); }); it('shouldSortArrayInReverse', function() { expect(orderBy([{a:15}, {a:2}], 'a', true)).toEqualData([{a:15}, {a:2}]); expect(orderBy([{a:15}, {a:2}], 'a', "T")).toEqualData([{a:15}, {a:2}]); expect(orderBy([{a:15}, {a:2}], 'a', "reverse")).toEqualData([{a:15}, {a:2}]); }); it('should sort array by predicate', function() { expect(orderBy([{a:15, b:1}, {a:2, b:1}], ['a', 'b'])).toEqualData([{a:2, b:1}, {a:15, b:1}]); expect(orderBy([{a:15, b:1}, {a:2, b:1}], ['b', 'a'])).toEqualData([{a:2, b:1}, {a:15, b:1}]); expect(orderBy([{a:15, b:1}, {a:2, b:1}], ['+b', '-a'])).toEqualData([{a:15, b:1}, {a:2, b:1}]); }); it('should use function', function() { expect( orderBy( [{a:15, b:1},{a:2, b:1}], function(value) { return value.a; })). toEqual([{a:2, b:1},{a:15, b:1}]); }); it('should support string predicates with names containing non-identifier characters', function() { /*jshint -W008 */ expect(orderBy([{"Tip %": .25}, {"Tip %": .15}, {"Tip %": .40}], '"Tip %"')) .toEqualData([{"Tip %": .15}, {"Tip %": .25}, {"Tip %": .40}]); expect(orderBy([{"원": 76000}, {"원": 31000}, {"원": 156000}], '"원"')) .toEqualData([{"원": 31000}, {"원": 76000}, {"원": 156000}]); }); it('should throw if quoted string predicate is quoted incorrectly', function() { /*jshint -W008 */ expect(function() { return orderBy([{"Tip %": .15}, {"Tip %": .25}, {"Tip %": .40}], '"Tip %\''); }).toThrow(); }); });
import Vue from 'vue' import Cookies from 'js-cookie' import 'normalize.css/normalize.css' // a modern alternative to CSS resets import Element from 'element-ui' import './styles/element-variables.scss' // import enLang from 'element-ui/lib/locale/lang/en'// 如果使用中文语言包请默认支持,无需额外引入,请删除该依赖 import '@/styles/index.scss' // global css import App from './App' import store from './store' import router from './router' import './icons' // icon // import '@/assets/icon/iconfont.css' // icon-阿里矢量图标库 import './permission' // permission control import './utils/error-log' // error log import * as filters from './filters' // global filters import echarts from 'echarts' Vue.prototype.$echarts = echarts Vue.use(Element, { size: Cookies.get('size') || 'medium' // set element-ui default size // locale: enLang // 如果使用中文,无需设置,请删除 }) // register global utility filters Object.keys(filters).forEach(key => { Vue.filter(key, filters[key]) }) Vue.config.productionTip = false new Vue({ el: '#app', router, store, render: h => h(App) })
/* Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or http://ckeditor.com/license */ CKEDITOR.plugins.setLang( 'specialchar', 'bg', { options: 'Опции за специален знак', title: 'Избор на специален знак', toolbar: 'Вмъкване на специален знак' } );
macDetailCallback("006094000000/24",[{"d":"1998-04-22","t":"add","a":"PO BOX 12195\nE89/664\nRTP, NC 27709-2195\n","c":"UNITED STATES","o":"IBM CORP."},{"d":"2000-09-08","t":"change","a":"PO BOX 12195\nCE6A/664\n3039 CORNWALLIS\nRTP, NC 27709-2195","c":"UNITED STATES","o":"IBM CORP."},{"d":"2001-10-24","t":"change","a":"PO BOX 12195\nCE6A/664 3039 CORNWALLIS\nRTP NC 27709-2195\n","c":"UNITED STATES","o":"IBM CORP."},{"d":"2010-12-02","t":"change","a":"3039 E Cornwallis Road\nPO BOX 12195\nResearch Triangle Park NC 27709-2195\n","c":"UNITED STATES","o":"IBM Corp"},{"d":"2015-08-27","t":"change","a":"3039 E Cornwallis Road Research Triangle Park NC US 27709-2195","c":"US","o":"IBM Corp"}]);
/******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) { /******/ return installedModules[moduleId].exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ i: moduleId, /******/ l: false, /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.l = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // define getter function for harmony exports /******/ __webpack_require__.d = function(exports, name, getter) { /******/ if(!__webpack_require__.o(exports, name)) { /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); /******/ } /******/ }; /******/ /******/ // define __esModule on exports /******/ __webpack_require__.r = function(exports) { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ /******/ // create a fake namespace object /******/ // mode & 1: value is a module id, require it /******/ // mode & 2: merge all properties of value into the ns /******/ // mode & 4: return value when already ns object /******/ // mode & 8|1: behave like require /******/ __webpack_require__.t = function(value, mode) { /******/ if(mode & 1) value = __webpack_require__(value); /******/ if(mode & 8) return value; /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; /******/ var ns = Object.create(null); /******/ __webpack_require__.r(ns); /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); /******/ return ns; /******/ }; /******/ /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = function(module) { /******/ var getter = module && module.__esModule ? /******/ function getDefault() { return module['default']; } : /******/ function getModuleExports() { return module; }; /******/ __webpack_require__.d(getter, 'a', getter); /******/ return getter; /******/ }; /******/ /******/ // Object.prototype.hasOwnProperty.call /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = ""; /******/ /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(__webpack_require__.s = "./js/custom.js"); /******/ }) /************************************************************************/ /******/ ({ /***/ "./js/custom.js": /*!**********************!*\ !*** ./js/custom.js ***! \**********************/ /*! no exports provided */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./index.js */ \"./js/index.js\");\n/* harmony import */ var date_fns__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! date-fns */ \"./node_modules/date-fns/index.js\");\n/* harmony import */ var date_fns__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(date_fns__WEBPACK_IMPORTED_MODULE_1__);\n/* JS Document */\r\n\r\n/******************************\r\n\r\n[Table of Contents]\r\n\r\n1. Vars and Inits\r\n2. Set Header\r\n3. Init Home Slider\r\n4. Init Search\r\n5. Init Menu\r\n6. Init Isotope\r\n\r\n\r\n******************************/\r\n\r\n\r\n\r\n$(document).ready(function()\r\n{\r\n\t\"use strict\";\r\n\r\n\t/* \r\n\r\n\t1. Vars and Inits\r\n\r\n\t*/\r\n\r\n\tvar header = $('.header');\r\n\tvar hambActive = false;\r\n\tvar menuActive = false;\r\n\r\n\tsetHeader();\r\n\r\n\t$(window).on('resize', function()\r\n\t{\r\n\t\tsetHeader();\r\n\t});\r\n\r\n\t$(document).on('scroll', function()\r\n\t{\r\n\t\tsetHeader();\r\n\t});\r\n\r\n\tinitHomeSlider();\r\n\tinitSearch();\r\n\tinitMenu();\r\n\tinitIsotope();\r\n\r\n\t/* \r\n\r\n\t2. Set Header\r\n\r\n\t*/\r\n\r\n\t function setHeader()\r\n\t{\r\n\t\tif($(window).scrollTop() > 100)\r\n\t\t{\r\n\t\t\theader.addClass('scrolled');\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\theader.removeClass('scrolled');\r\n\t\t}\r\n\t}\r\n\r\n\t/* \r\n\r\n\t3. Init Home Slider\r\n\r\n\t*/\r\n\r\n\tfunction initHomeSlider()\r\n\t{\r\n\t\tif($('.home_slider').length)\r\n\t\t{\r\n\t\t\tvar homeSlider = $('.home_slider');\r\n\t\t\thomeSlider.owlCarousel(\r\n\t\t\t{\r\n\t\t\t\titems:1,\r\n\t\t\t\tautoplay:true,\r\n\t\t\t\tautoplayTimeout:10000,\r\n\t\t\t\tloop:true,\r\n\t\t\t\tnav:false,\r\n\t\t\t\tsmartSpeed:1200,\r\n\t\t\t\tdotsSpeed:1200,\r\n\t\t\t\tfluidSpeed:1200\r\n\t\t\t});\r\n\r\n\t\t\t/* Custom dots events */\r\n\t\t\tif($('.home_slider_custom_dot').length)\r\n\t\t\t{\r\n\t\t\t\t$('.home_slider_custom_dot').on('click', function()\r\n\t\t\t\t{\r\n\t\t\t\t\t$('.home_slider_custom_dot').removeClass('active');\r\n\t\t\t\t\t$(this).addClass('active');\r\n\t\t\t\t\thomeSlider.trigger('to.owl.carousel', [$(this).index(), 1200]);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\t/* Change active class for dots when slide changes by nav or touch */\r\n\t\t\thomeSlider.on('changed.owl.carousel', function(event)\r\n\t\t\t{\r\n\t\t\t\t$('.home_slider_custom_dot').removeClass('active');\r\n\t\t\t\t$('.home_slider_custom_dots li').eq(event.page.index).addClass('active');\r\n\t\t\t});\r\n\r\n\t\t\t// add animate.css class(es) to the elements to be animated\r\n\t\t\tfunction setAnimation ( _elem, _InOut )\r\n\t\t\t{\r\n\t\t\t\t// Store all animationend event name in a string.\r\n\t\t\t\t// cf animate.css documentation\r\n\t\t\t\tvar animationEndEvent = 'webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend';\r\n\r\n\t\t\t\t_elem.each ( function ()\r\n\t\t\t\t{\r\n\t\t\t\t\tvar $elem = $(this);\r\n\t\t\t\t\tvar $animationType = 'animated ' + $elem.data( 'animation-' + _InOut );\r\n\r\n\t\t\t\t\t$elem.addClass($animationType).one(animationEndEvent, function ()\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$elem.removeClass($animationType); // remove animate.css Class at the end of the animations\r\n\t\t\t\t\t});\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\t// Fired before current slide change\r\n\t\t\thomeSlider.on('change.owl.carousel', function(event)\r\n\t\t\t{\r\n\t\t\t\tvar $currentItem = $('.home_slider_item', homeSlider).eq(event.item.index);\r\n\t\t\t\tvar $elemsToanim = $currentItem.find(\"[data-animation-out]\");\r\n\t\t\t\tsetAnimation ($elemsToanim, 'out');\r\n\t\t\t});\r\n\r\n\t\t\t// Fired after current slide has been changed\r\n\t\t\thomeSlider.on('changed.owl.carousel', function(event)\r\n\t\t\t{\r\n\t\t\t\tvar $currentItem = $('.home_slider_item', homeSlider).eq(event.item.index);\r\n\t\t\t\tvar $elemsToanim = $currentItem.find(\"[data-animation-in]\");\r\n\t\t\t\tsetAnimation ($elemsToanim, 'in');\r\n\t\t\t})\r\n\t\t}\r\n\t}\r\n\r\n\t/* \r\n\r\n\t4. Init Search\r\n\r\n\t*/\r\n\r\n\t function initSearch()\r\n\t{\r\n\t\tif($('.search').length && $('.search_panel').length)\r\n\t\t{\r\n\t\t\tvar search = $('.search');\r\n\t\t\tvar panel = $('.search_panel');\r\n\r\n\t\t\tsearch.on('click', function()\r\n\t\t\t{\r\n\t\t\r\n\t\t\t\tpanel.toggleClass('active');\r\n\t\t\t\r\n\t\t\t\t\r\n\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\t/* \r\n\r\n\t5. Init Menu\r\n\r\n\t*/\r\n\r\n\t function initMenu()\r\n\t{\r\n\t\tif($('.hamburger').length)\r\n\t\t{\r\n\t\t\tvar hamb = $('.hamburger');\r\n\r\n\t\t\thamb.on('click', function(event)\r\n\t\t\t{\r\n\t\t\t\tevent.stopPropagation();\r\n\r\n\t\t\t\tif(!menuActive)\r\n\t\t\t\t{\r\n\t\t\t\t\topenMenu();\r\n\t\t\t\t\t\r\n\t\t\t\t\t$(document).one('click', function cls(e)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif($(e.target).hasClass('menu_mm'))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$(document).one('click', cls);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tcloseMenu();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\t$('.menu').removeClass('active');\r\n\t\t\t\t\tmenuActive = false;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\t//Handle page menu\r\n\t\t\tif($('.page_menu_item').length)\r\n\t\t\t{\r\n\t\t\t\tvar items = $('.page_menu_item');\r\n\t\t\t\titems.each(function()\r\n\t\t\t\t{\r\n\t\t\t\t\tvar item = $(this);\r\n\r\n\t\t\t\t\titem.on('click', function(evt)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(item.hasClass('has-children'))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tevt.preventDefault();\r\n\t\t\t\t\t\t\tevt.stopPropagation();\r\n\t\t\t\t\t\t\tvar subItem = item.find('> ul');\r\n\t\t\t\t\t\t if(subItem.hasClass('active'))\r\n\t\t\t\t\t\t {\r\n\t\t\t\t\t\t \tsubItem.toggleClass('active');\r\n\t\t\t\t\t\t\t\tTweenMax.to(subItem, 0.3, {height:0});\r\n\t\t\t\t\t\t }\r\n\t\t\t\t\t\t else\r\n\t\t\t\t\t\t {\r\n\t\t\t\t\t\t \tsubItem.toggleClass('active');\r\n\t\t\t\t\t\t \tTweenMax.set(subItem, {height:\"auto\"});\r\n\t\t\t\t\t\t\t\tTweenMax.from(subItem, 0.3, {height:0});\r\n\t\t\t\t\t\t }\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tevt.stopPropagation();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t function openMenu()\r\n\t{\r\n\t\tvar fs = $('.menu');\r\n\t\tfs.addClass('active');\r\n\t\thambActive = true;\r\n\t\tmenuActive = true;\r\n\t}\r\n\r\n\t function closeMenu()\r\n\t{\r\n\t\tvar fs = $('.menu');\r\n\t\tfs.removeClass('active');\r\n\t\thambActive = false;\r\n\t\tmenuActive = false;\r\n\t}\r\n\r\n\t/* \r\n\r\n\t6. Init Isotope\r\n\r\n\t*/\r\n\r\n\t function initIsotope()\r\n\t{\r\n\t\tvar sortingButtons = $('.product_sorting_btn');\r\n\t\tvar sortNums = $('.num_sorting_btn');\r\n\r\n\t\tif($('.product_grid').length)\r\n\t\t{\r\n\t\t\tvar grid = $('.product_grid').isotope({\r\n\t\t\t\titemSelector: '.product',\r\n\t\t\t\tlayoutMode: 'fitRows',\r\n\t\t\t\tfitRows:\r\n\t\t\t\t{\r\n\t\t\t\t\tgutter: 30\r\n\t\t\t\t},\r\n\t getSortData:\r\n\t {\r\n\t \tprice: function(itemElement)\r\n\t \t{\r\n\t \t\tvar priceEle = $(itemElement).find('.product_price').text().replace( '$', '' );\r\n\t \t\treturn parseFloat(priceEle);\r\n\t \t},\r\n\t \tname: '.product_name',\r\n\t \tstars: function(itemElement)\r\n\t \t{\r\n\t \t\tvar starsEle = $(itemElement).find('.rating');\r\n\t \t\tvar stars = starsEle.attr(\"data-rating\");\r\n\t \t\treturn stars;\r\n\t \t}\r\n\t },\r\n\t animationOptions:\r\n\t {\r\n\t duration: 750,\r\n\t easing: 'linear',\r\n\t queue: false\r\n\t }\r\n\t });\r\n\t\t}\r\n\t}\r\n\r\n});\r\n\r\n\n\n//# sourceURL=webpack:///./js/custom.js?"); /***/ }), /***/ "./js/index.js": /*!*********************!*\ !*** ./js/index.js ***! \*********************/ /*! exports provided: filme */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"filme\", function() { return filme; });\n// Pesquisa os filmes Lançamento\n\n\n\nvar url = \"https://api.themoviedb.org/3/movie/now_playing?api_key=2cdf0d65c5e1dcf6d9cb6e4117a86188&language=pt-BR&page=1\"\n\nfunction filme(url){\n\nfetch(url)\n .then((res) => res.json())\n .then((data) => {\n\n let image = \"\";\n data.results.forEach(function (filmes) {\n \n // função para tirar as \"\" simples e dublado do texto\n if(filmes.overview!= \"\"){\n var RegExp = /[\"|']/g;\n var texto=filmes.overview.replace(RegExp,\"\");\n }\n else{\n texto = \"Esse filme ainda não possui tradução para o portuguẽs ...\";\n }\n\n image +=\n ` <li class=\"example-item \">\n <a href=\"https://image.tmdb.org/t/p/w300${filmes.poster_path}\"id=\"tam\" data-lightbox=\"mygallery\" data-title=\"${texto}\" >\n <img src=\"https://image.tmdb.org/t/p/w300${filmes.poster_path}\"id=\"tam\" alt=\"ststststs\"> </a>\n \n <div class=\"product_title link\"> \n <div class=\"product_content\">\n\t\t\t\t\t\t\t\t<div class=\"product_title\"><a href=\"cart.html?${filmes.id}\">${filmes.title}</a></div>\t\n\t\t\t\t\t\t</div>\n </div></li> `;\n document.getElementById('lista-filme').innerHTML = image;\n });\n })\n}\n\n//# sourceURL=webpack:///./js/index.js?"); /***/ }), /***/ "./node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds/index.js": /*!*****************************************************************************!*\ !*** ./node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds/index.js ***! \*****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("var MILLISECONDS_IN_MINUTE = 60000\n\n/**\n * Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.\n * They usually appear for dates that denote time before the timezones were introduced\n * (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891\n * and GMT+01:00:00 after that date)\n *\n * Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above,\n * which would lead to incorrect calculations.\n *\n * This function returns the timezone offset in milliseconds that takes seconds in account.\n */\nmodule.exports = function getTimezoneOffsetInMilliseconds (dirtyDate) {\n var date = new Date(dirtyDate.getTime())\n var baseTimezoneOffset = date.getTimezoneOffset()\n date.setSeconds(0, 0)\n var millisecondsPartOfTimezoneOffset = date.getTime() % MILLISECONDS_IN_MINUTE\n\n return baseTimezoneOffset * MILLISECONDS_IN_MINUTE + millisecondsPartOfTimezoneOffset\n}\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds/index.js?"); /***/ }), /***/ "./node_modules/date-fns/add_days/index.js": /*!*************************************************!*\ !*** ./node_modules/date-fns/add_days/index.js ***! \*************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var parse = __webpack_require__(/*! ../parse/index.js */ \"./node_modules/date-fns/parse/index.js\")\n\n/**\n * @category Day Helpers\n * @summary Add the specified number of days to the given date.\n *\n * @description\n * Add the specified number of days to the given date.\n *\n * @param {Date|String|Number} date - the date to be changed\n * @param {Number} amount - the amount of days to be added\n * @returns {Date} the new date with the days added\n *\n * @example\n * // Add 10 days to 1 September 2014:\n * var result = addDays(new Date(2014, 8, 1), 10)\n * //=> Thu Sep 11 2014 00:00:00\n */\nfunction addDays (dirtyDate, dirtyAmount) {\n var date = parse(dirtyDate)\n var amount = Number(dirtyAmount)\n date.setDate(date.getDate() + amount)\n return date\n}\n\nmodule.exports = addDays\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/add_days/index.js?"); /***/ }), /***/ "./node_modules/date-fns/add_hours/index.js": /*!**************************************************!*\ !*** ./node_modules/date-fns/add_hours/index.js ***! \**************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var addMilliseconds = __webpack_require__(/*! ../add_milliseconds/index.js */ \"./node_modules/date-fns/add_milliseconds/index.js\")\n\nvar MILLISECONDS_IN_HOUR = 3600000\n\n/**\n * @category Hour Helpers\n * @summary Add the specified number of hours to the given date.\n *\n * @description\n * Add the specified number of hours to the given date.\n *\n * @param {Date|String|Number} date - the date to be changed\n * @param {Number} amount - the amount of hours to be added\n * @returns {Date} the new date with the hours added\n *\n * @example\n * // Add 2 hours to 10 July 2014 23:00:00:\n * var result = addHours(new Date(2014, 6, 10, 23, 0), 2)\n * //=> Fri Jul 11 2014 01:00:00\n */\nfunction addHours (dirtyDate, dirtyAmount) {\n var amount = Number(dirtyAmount)\n return addMilliseconds(dirtyDate, amount * MILLISECONDS_IN_HOUR)\n}\n\nmodule.exports = addHours\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/add_hours/index.js?"); /***/ }), /***/ "./node_modules/date-fns/add_iso_years/index.js": /*!******************************************************!*\ !*** ./node_modules/date-fns/add_iso_years/index.js ***! \******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var getISOYear = __webpack_require__(/*! ../get_iso_year/index.js */ \"./node_modules/date-fns/get_iso_year/index.js\")\nvar setISOYear = __webpack_require__(/*! ../set_iso_year/index.js */ \"./node_modules/date-fns/set_iso_year/index.js\")\n\n/**\n * @category ISO Week-Numbering Year Helpers\n * @summary Add the specified number of ISO week-numbering years to the given date.\n *\n * @description\n * Add the specified number of ISO week-numbering years to the given date.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @param {Date|String|Number} date - the date to be changed\n * @param {Number} amount - the amount of ISO week-numbering years to be added\n * @returns {Date} the new date with the ISO week-numbering years added\n *\n * @example\n * // Add 5 ISO week-numbering years to 2 July 2010:\n * var result = addISOYears(new Date(2010, 6, 2), 5)\n * //=> Fri Jun 26 2015 00:00:00\n */\nfunction addISOYears (dirtyDate, dirtyAmount) {\n var amount = Number(dirtyAmount)\n return setISOYear(dirtyDate, getISOYear(dirtyDate) + amount)\n}\n\nmodule.exports = addISOYears\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/add_iso_years/index.js?"); /***/ }), /***/ "./node_modules/date-fns/add_milliseconds/index.js": /*!*********************************************************!*\ !*** ./node_modules/date-fns/add_milliseconds/index.js ***! \*********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var parse = __webpack_require__(/*! ../parse/index.js */ \"./node_modules/date-fns/parse/index.js\")\n\n/**\n * @category Millisecond Helpers\n * @summary Add the specified number of milliseconds to the given date.\n *\n * @description\n * Add the specified number of milliseconds to the given date.\n *\n * @param {Date|String|Number} date - the date to be changed\n * @param {Number} amount - the amount of milliseconds to be added\n * @returns {Date} the new date with the milliseconds added\n *\n * @example\n * // Add 750 milliseconds to 10 July 2014 12:45:30.000:\n * var result = addMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)\n * //=> Thu Jul 10 2014 12:45:30.750\n */\nfunction addMilliseconds (dirtyDate, dirtyAmount) {\n var timestamp = parse(dirtyDate).getTime()\n var amount = Number(dirtyAmount)\n return new Date(timestamp + amount)\n}\n\nmodule.exports = addMilliseconds\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/add_milliseconds/index.js?"); /***/ }), /***/ "./node_modules/date-fns/add_minutes/index.js": /*!****************************************************!*\ !*** ./node_modules/date-fns/add_minutes/index.js ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var addMilliseconds = __webpack_require__(/*! ../add_milliseconds/index.js */ \"./node_modules/date-fns/add_milliseconds/index.js\")\n\nvar MILLISECONDS_IN_MINUTE = 60000\n\n/**\n * @category Minute Helpers\n * @summary Add the specified number of minutes to the given date.\n *\n * @description\n * Add the specified number of minutes to the given date.\n *\n * @param {Date|String|Number} date - the date to be changed\n * @param {Number} amount - the amount of minutes to be added\n * @returns {Date} the new date with the minutes added\n *\n * @example\n * // Add 30 minutes to 10 July 2014 12:00:00:\n * var result = addMinutes(new Date(2014, 6, 10, 12, 0), 30)\n * //=> Thu Jul 10 2014 12:30:00\n */\nfunction addMinutes (dirtyDate, dirtyAmount) {\n var amount = Number(dirtyAmount)\n return addMilliseconds(dirtyDate, amount * MILLISECONDS_IN_MINUTE)\n}\n\nmodule.exports = addMinutes\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/add_minutes/index.js?"); /***/ }), /***/ "./node_modules/date-fns/add_months/index.js": /*!***************************************************!*\ !*** ./node_modules/date-fns/add_months/index.js ***! \***************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var parse = __webpack_require__(/*! ../parse/index.js */ \"./node_modules/date-fns/parse/index.js\")\nvar getDaysInMonth = __webpack_require__(/*! ../get_days_in_month/index.js */ \"./node_modules/date-fns/get_days_in_month/index.js\")\n\n/**\n * @category Month Helpers\n * @summary Add the specified number of months to the given date.\n *\n * @description\n * Add the specified number of months to the given date.\n *\n * @param {Date|String|Number} date - the date to be changed\n * @param {Number} amount - the amount of months to be added\n * @returns {Date} the new date with the months added\n *\n * @example\n * // Add 5 months to 1 September 2014:\n * var result = addMonths(new Date(2014, 8, 1), 5)\n * //=> Sun Feb 01 2015 00:00:00\n */\nfunction addMonths (dirtyDate, dirtyAmount) {\n var date = parse(dirtyDate)\n var amount = Number(dirtyAmount)\n var desiredMonth = date.getMonth() + amount\n var dateWithDesiredMonth = new Date(0)\n dateWithDesiredMonth.setFullYear(date.getFullYear(), desiredMonth, 1)\n dateWithDesiredMonth.setHours(0, 0, 0, 0)\n var daysInMonth = getDaysInMonth(dateWithDesiredMonth)\n // Set the last day of the new month\n // if the original date was the last day of the longer month\n date.setMonth(desiredMonth, Math.min(daysInMonth, date.getDate()))\n return date\n}\n\nmodule.exports = addMonths\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/add_months/index.js?"); /***/ }), /***/ "./node_modules/date-fns/add_quarters/index.js": /*!*****************************************************!*\ !*** ./node_modules/date-fns/add_quarters/index.js ***! \*****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var addMonths = __webpack_require__(/*! ../add_months/index.js */ \"./node_modules/date-fns/add_months/index.js\")\n\n/**\n * @category Quarter Helpers\n * @summary Add the specified number of year quarters to the given date.\n *\n * @description\n * Add the specified number of year quarters to the given date.\n *\n * @param {Date|String|Number} date - the date to be changed\n * @param {Number} amount - the amount of quarters to be added\n * @returns {Date} the new date with the quarters added\n *\n * @example\n * // Add 1 quarter to 1 September 2014:\n * var result = addQuarters(new Date(2014, 8, 1), 1)\n * //=> Mon Dec 01 2014 00:00:00\n */\nfunction addQuarters (dirtyDate, dirtyAmount) {\n var amount = Number(dirtyAmount)\n var months = amount * 3\n return addMonths(dirtyDate, months)\n}\n\nmodule.exports = addQuarters\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/add_quarters/index.js?"); /***/ }), /***/ "./node_modules/date-fns/add_seconds/index.js": /*!****************************************************!*\ !*** ./node_modules/date-fns/add_seconds/index.js ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var addMilliseconds = __webpack_require__(/*! ../add_milliseconds/index.js */ \"./node_modules/date-fns/add_milliseconds/index.js\")\n\n/**\n * @category Second Helpers\n * @summary Add the specified number of seconds to the given date.\n *\n * @description\n * Add the specified number of seconds to the given date.\n *\n * @param {Date|String|Number} date - the date to be changed\n * @param {Number} amount - the amount of seconds to be added\n * @returns {Date} the new date with the seconds added\n *\n * @example\n * // Add 30 seconds to 10 July 2014 12:45:00:\n * var result = addSeconds(new Date(2014, 6, 10, 12, 45, 0), 30)\n * //=> Thu Jul 10 2014 12:45:30\n */\nfunction addSeconds (dirtyDate, dirtyAmount) {\n var amount = Number(dirtyAmount)\n return addMilliseconds(dirtyDate, amount * 1000)\n}\n\nmodule.exports = addSeconds\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/add_seconds/index.js?"); /***/ }), /***/ "./node_modules/date-fns/add_weeks/index.js": /*!**************************************************!*\ !*** ./node_modules/date-fns/add_weeks/index.js ***! \**************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var addDays = __webpack_require__(/*! ../add_days/index.js */ \"./node_modules/date-fns/add_days/index.js\")\n\n/**\n * @category Week Helpers\n * @summary Add the specified number of weeks to the given date.\n *\n * @description\n * Add the specified number of week to the given date.\n *\n * @param {Date|String|Number} date - the date to be changed\n * @param {Number} amount - the amount of weeks to be added\n * @returns {Date} the new date with the weeks added\n *\n * @example\n * // Add 4 weeks to 1 September 2014:\n * var result = addWeeks(new Date(2014, 8, 1), 4)\n * //=> Mon Sep 29 2014 00:00:00\n */\nfunction addWeeks (dirtyDate, dirtyAmount) {\n var amount = Number(dirtyAmount)\n var days = amount * 7\n return addDays(dirtyDate, days)\n}\n\nmodule.exports = addWeeks\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/add_weeks/index.js?"); /***/ }), /***/ "./node_modules/date-fns/add_years/index.js": /*!**************************************************!*\ !*** ./node_modules/date-fns/add_years/index.js ***! \**************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var addMonths = __webpack_require__(/*! ../add_months/index.js */ \"./node_modules/date-fns/add_months/index.js\")\n\n/**\n * @category Year Helpers\n * @summary Add the specified number of years to the given date.\n *\n * @description\n * Add the specified number of years to the given date.\n *\n * @param {Date|String|Number} date - the date to be changed\n * @param {Number} amount - the amount of years to be added\n * @returns {Date} the new date with the years added\n *\n * @example\n * // Add 5 years to 1 September 2014:\n * var result = addYears(new Date(2014, 8, 1), 5)\n * //=> Sun Sep 01 2019 00:00:00\n */\nfunction addYears (dirtyDate, dirtyAmount) {\n var amount = Number(dirtyAmount)\n return addMonths(dirtyDate, amount * 12)\n}\n\nmodule.exports = addYears\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/add_years/index.js?"); /***/ }), /***/ "./node_modules/date-fns/are_ranges_overlapping/index.js": /*!***************************************************************!*\ !*** ./node_modules/date-fns/are_ranges_overlapping/index.js ***! \***************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var parse = __webpack_require__(/*! ../parse/index.js */ \"./node_modules/date-fns/parse/index.js\")\n\n/**\n * @category Range Helpers\n * @summary Is the given date range overlapping with another date range?\n *\n * @description\n * Is the given date range overlapping with another date range?\n *\n * @param {Date|String|Number} initialRangeStartDate - the start of the initial range\n * @param {Date|String|Number} initialRangeEndDate - the end of the initial range\n * @param {Date|String|Number} comparedRangeStartDate - the start of the range to compare it with\n * @param {Date|String|Number} comparedRangeEndDate - the end of the range to compare it with\n * @returns {Boolean} whether the date ranges are overlapping\n * @throws {Error} startDate of a date range cannot be after its endDate\n *\n * @example\n * // For overlapping date ranges:\n * areRangesOverlapping(\n * new Date(2014, 0, 10), new Date(2014, 0, 20), new Date(2014, 0, 17), new Date(2014, 0, 21)\n * )\n * //=> true\n *\n * @example\n * // For non-overlapping date ranges:\n * areRangesOverlapping(\n * new Date(2014, 0, 10), new Date(2014, 0, 20), new Date(2014, 0, 21), new Date(2014, 0, 22)\n * )\n * //=> false\n */\nfunction areRangesOverlapping (dirtyInitialRangeStartDate, dirtyInitialRangeEndDate, dirtyComparedRangeStartDate, dirtyComparedRangeEndDate) {\n var initialStartTime = parse(dirtyInitialRangeStartDate).getTime()\n var initialEndTime = parse(dirtyInitialRangeEndDate).getTime()\n var comparedStartTime = parse(dirtyComparedRangeStartDate).getTime()\n var comparedEndTime = parse(dirtyComparedRangeEndDate).getTime()\n\n if (initialStartTime > initialEndTime || comparedStartTime > comparedEndTime) {\n throw new Error('The start of the range cannot be after the end of the range')\n }\n\n return initialStartTime < comparedEndTime && comparedStartTime < initialEndTime\n}\n\nmodule.exports = areRangesOverlapping\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/are_ranges_overlapping/index.js?"); /***/ }), /***/ "./node_modules/date-fns/closest_index_to/index.js": /*!*********************************************************!*\ !*** ./node_modules/date-fns/closest_index_to/index.js ***! \*********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var parse = __webpack_require__(/*! ../parse/index.js */ \"./node_modules/date-fns/parse/index.js\")\n\n/**\n * @category Common Helpers\n * @summary Return an index of the closest date from the array comparing to the given date.\n *\n * @description\n * Return an index of the closest date from the array comparing to the given date.\n *\n * @param {Date|String|Number} dateToCompare - the date to compare with\n * @param {Date[]|String[]|Number[]} datesArray - the array to search\n * @returns {Number} an index of the date closest to the given date\n * @throws {TypeError} the second argument must be an instance of Array\n *\n * @example\n * // Which date is closer to 6 September 2015?\n * var dateToCompare = new Date(2015, 8, 6)\n * var datesArray = [\n * new Date(2015, 0, 1),\n * new Date(2016, 0, 1),\n * new Date(2017, 0, 1)\n * ]\n * var result = closestIndexTo(dateToCompare, datesArray)\n * //=> 1\n */\nfunction closestIndexTo (dirtyDateToCompare, dirtyDatesArray) {\n if (!(dirtyDatesArray instanceof Array)) {\n throw new TypeError(toString.call(dirtyDatesArray) + ' is not an instance of Array')\n }\n\n var dateToCompare = parse(dirtyDateToCompare)\n var timeToCompare = dateToCompare.getTime()\n\n var result\n var minDistance\n\n dirtyDatesArray.forEach(function (dirtyDate, index) {\n var currentDate = parse(dirtyDate)\n var distance = Math.abs(timeToCompare - currentDate.getTime())\n if (result === undefined || distance < minDistance) {\n result = index\n minDistance = distance\n }\n })\n\n return result\n}\n\nmodule.exports = closestIndexTo\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/closest_index_to/index.js?"); /***/ }), /***/ "./node_modules/date-fns/closest_to/index.js": /*!***************************************************!*\ !*** ./node_modules/date-fns/closest_to/index.js ***! \***************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var parse = __webpack_require__(/*! ../parse/index.js */ \"./node_modules/date-fns/parse/index.js\")\n\n/**\n * @category Common Helpers\n * @summary Return a date from the array closest to the given date.\n *\n * @description\n * Return a date from the array closest to the given date.\n *\n * @param {Date|String|Number} dateToCompare - the date to compare with\n * @param {Date[]|String[]|Number[]} datesArray - the array to search\n * @returns {Date} the date from the array closest to the given date\n * @throws {TypeError} the second argument must be an instance of Array\n *\n * @example\n * // Which date is closer to 6 September 2015: 1 January 2000 or 1 January 2030?\n * var dateToCompare = new Date(2015, 8, 6)\n * var result = closestTo(dateToCompare, [\n * new Date(2000, 0, 1),\n * new Date(2030, 0, 1)\n * ])\n * //=> Tue Jan 01 2030 00:00:00\n */\nfunction closestTo (dirtyDateToCompare, dirtyDatesArray) {\n if (!(dirtyDatesArray instanceof Array)) {\n throw new TypeError(toString.call(dirtyDatesArray) + ' is not an instance of Array')\n }\n\n var dateToCompare = parse(dirtyDateToCompare)\n var timeToCompare = dateToCompare.getTime()\n\n var result\n var minDistance\n\n dirtyDatesArray.forEach(function (dirtyDate) {\n var currentDate = parse(dirtyDate)\n var distance = Math.abs(timeToCompare - currentDate.getTime())\n if (result === undefined || distance < minDistance) {\n result = currentDate\n minDistance = distance\n }\n })\n\n return result\n}\n\nmodule.exports = closestTo\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/closest_to/index.js?"); /***/ }), /***/ "./node_modules/date-fns/compare_asc/index.js": /*!****************************************************!*\ !*** ./node_modules/date-fns/compare_asc/index.js ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var parse = __webpack_require__(/*! ../parse/index.js */ \"./node_modules/date-fns/parse/index.js\")\n\n/**\n * @category Common Helpers\n * @summary Compare the two dates and return -1, 0 or 1.\n *\n * @description\n * Compare the two dates and return 1 if the first date is after the second,\n * -1 if the first date is before the second or 0 if dates are equal.\n *\n * @param {Date|String|Number} dateLeft - the first date to compare\n * @param {Date|String|Number} dateRight - the second date to compare\n * @returns {Number} the result of the comparison\n *\n * @example\n * // Compare 11 February 1987 and 10 July 1989:\n * var result = compareAsc(\n * new Date(1987, 1, 11),\n * new Date(1989, 6, 10)\n * )\n * //=> -1\n *\n * @example\n * // Sort the array of dates:\n * var result = [\n * new Date(1995, 6, 2),\n * new Date(1987, 1, 11),\n * new Date(1989, 6, 10)\n * ].sort(compareAsc)\n * //=> [\n * // Wed Feb 11 1987 00:00:00,\n * // Mon Jul 10 1989 00:00:00,\n * // Sun Jul 02 1995 00:00:00\n * // ]\n */\nfunction compareAsc (dirtyDateLeft, dirtyDateRight) {\n var dateLeft = parse(dirtyDateLeft)\n var timeLeft = dateLeft.getTime()\n var dateRight = parse(dirtyDateRight)\n var timeRight = dateRight.getTime()\n\n if (timeLeft < timeRight) {\n return -1\n } else if (timeLeft > timeRight) {\n return 1\n } else {\n return 0\n }\n}\n\nmodule.exports = compareAsc\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/compare_asc/index.js?"); /***/ }), /***/ "./node_modules/date-fns/compare_desc/index.js": /*!*****************************************************!*\ !*** ./node_modules/date-fns/compare_desc/index.js ***! \*****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var parse = __webpack_require__(/*! ../parse/index.js */ \"./node_modules/date-fns/parse/index.js\")\n\n/**\n * @category Common Helpers\n * @summary Compare the two dates reverse chronologically and return -1, 0 or 1.\n *\n * @description\n * Compare the two dates and return -1 if the first date is after the second,\n * 1 if the first date is before the second or 0 if dates are equal.\n *\n * @param {Date|String|Number} dateLeft - the first date to compare\n * @param {Date|String|Number} dateRight - the second date to compare\n * @returns {Number} the result of the comparison\n *\n * @example\n * // Compare 11 February 1987 and 10 July 1989 reverse chronologically:\n * var result = compareDesc(\n * new Date(1987, 1, 11),\n * new Date(1989, 6, 10)\n * )\n * //=> 1\n *\n * @example\n * // Sort the array of dates in reverse chronological order:\n * var result = [\n * new Date(1995, 6, 2),\n * new Date(1987, 1, 11),\n * new Date(1989, 6, 10)\n * ].sort(compareDesc)\n * //=> [\n * // Sun Jul 02 1995 00:00:00,\n * // Mon Jul 10 1989 00:00:00,\n * // Wed Feb 11 1987 00:00:00\n * // ]\n */\nfunction compareDesc (dirtyDateLeft, dirtyDateRight) {\n var dateLeft = parse(dirtyDateLeft)\n var timeLeft = dateLeft.getTime()\n var dateRight = parse(dirtyDateRight)\n var timeRight = dateRight.getTime()\n\n if (timeLeft > timeRight) {\n return -1\n } else if (timeLeft < timeRight) {\n return 1\n } else {\n return 0\n }\n}\n\nmodule.exports = compareDesc\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/compare_desc/index.js?"); /***/ }), /***/ "./node_modules/date-fns/difference_in_calendar_days/index.js": /*!********************************************************************!*\ !*** ./node_modules/date-fns/difference_in_calendar_days/index.js ***! \********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var startOfDay = __webpack_require__(/*! ../start_of_day/index.js */ \"./node_modules/date-fns/start_of_day/index.js\")\n\nvar MILLISECONDS_IN_MINUTE = 60000\nvar MILLISECONDS_IN_DAY = 86400000\n\n/**\n * @category Day Helpers\n * @summary Get the number of calendar days between the given dates.\n *\n * @description\n * Get the number of calendar days between the given dates.\n *\n * @param {Date|String|Number} dateLeft - the later date\n * @param {Date|String|Number} dateRight - the earlier date\n * @returns {Number} the number of calendar days\n *\n * @example\n * // How many calendar days are between\n * // 2 July 2011 23:00:00 and 2 July 2012 00:00:00?\n * var result = differenceInCalendarDays(\n * new Date(2012, 6, 2, 0, 0),\n * new Date(2011, 6, 2, 23, 0)\n * )\n * //=> 366\n */\nfunction differenceInCalendarDays (dirtyDateLeft, dirtyDateRight) {\n var startOfDayLeft = startOfDay(dirtyDateLeft)\n var startOfDayRight = startOfDay(dirtyDateRight)\n\n var timestampLeft = startOfDayLeft.getTime() -\n startOfDayLeft.getTimezoneOffset() * MILLISECONDS_IN_MINUTE\n var timestampRight = startOfDayRight.getTime() -\n startOfDayRight.getTimezoneOffset() * MILLISECONDS_IN_MINUTE\n\n // Round the number of days to the nearest integer\n // because the number of milliseconds in a day is not constant\n // (e.g. it's different in the day of the daylight saving time clock shift)\n return Math.round((timestampLeft - timestampRight) / MILLISECONDS_IN_DAY)\n}\n\nmodule.exports = differenceInCalendarDays\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/difference_in_calendar_days/index.js?"); /***/ }), /***/ "./node_modules/date-fns/difference_in_calendar_iso_weeks/index.js": /*!*************************************************************************!*\ !*** ./node_modules/date-fns/difference_in_calendar_iso_weeks/index.js ***! \*************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var startOfISOWeek = __webpack_require__(/*! ../start_of_iso_week/index.js */ \"./node_modules/date-fns/start_of_iso_week/index.js\")\n\nvar MILLISECONDS_IN_MINUTE = 60000\nvar MILLISECONDS_IN_WEEK = 604800000\n\n/**\n * @category ISO Week Helpers\n * @summary Get the number of calendar ISO weeks between the given dates.\n *\n * @description\n * Get the number of calendar ISO weeks between the given dates.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @param {Date|String|Number} dateLeft - the later date\n * @param {Date|String|Number} dateRight - the earlier date\n * @returns {Number} the number of calendar ISO weeks\n *\n * @example\n * // How many calendar ISO weeks are between 6 July 2014 and 21 July 2014?\n * var result = differenceInCalendarISOWeeks(\n * new Date(2014, 6, 21),\n * new Date(2014, 6, 6)\n * )\n * //=> 3\n */\nfunction differenceInCalendarISOWeeks (dirtyDateLeft, dirtyDateRight) {\n var startOfISOWeekLeft = startOfISOWeek(dirtyDateLeft)\n var startOfISOWeekRight = startOfISOWeek(dirtyDateRight)\n\n var timestampLeft = startOfISOWeekLeft.getTime() -\n startOfISOWeekLeft.getTimezoneOffset() * MILLISECONDS_IN_MINUTE\n var timestampRight = startOfISOWeekRight.getTime() -\n startOfISOWeekRight.getTimezoneOffset() * MILLISECONDS_IN_MINUTE\n\n // Round the number of days to the nearest integer\n // because the number of milliseconds in a week is not constant\n // (e.g. it's different in the week of the daylight saving time clock shift)\n return Math.round((timestampLeft - timestampRight) / MILLISECONDS_IN_WEEK)\n}\n\nmodule.exports = differenceInCalendarISOWeeks\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/difference_in_calendar_iso_weeks/index.js?"); /***/ }), /***/ "./node_modules/date-fns/difference_in_calendar_iso_years/index.js": /*!*************************************************************************!*\ !*** ./node_modules/date-fns/difference_in_calendar_iso_years/index.js ***! \*************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var getISOYear = __webpack_require__(/*! ../get_iso_year/index.js */ \"./node_modules/date-fns/get_iso_year/index.js\")\n\n/**\n * @category ISO Week-Numbering Year Helpers\n * @summary Get the number of calendar ISO week-numbering years between the given dates.\n *\n * @description\n * Get the number of calendar ISO week-numbering years between the given dates.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @param {Date|String|Number} dateLeft - the later date\n * @param {Date|String|Number} dateRight - the earlier date\n * @returns {Number} the number of calendar ISO week-numbering years\n *\n * @example\n * // How many calendar ISO week-numbering years are 1 January 2010 and 1 January 2012?\n * var result = differenceInCalendarISOYears(\n * new Date(2012, 0, 1),\n * new Date(2010, 0, 1)\n * )\n * //=> 2\n */\nfunction differenceInCalendarISOYears (dirtyDateLeft, dirtyDateRight) {\n return getISOYear(dirtyDateLeft) - getISOYear(dirtyDateRight)\n}\n\nmodule.exports = differenceInCalendarISOYears\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/difference_in_calendar_iso_years/index.js?"); /***/ }), /***/ "./node_modules/date-fns/difference_in_calendar_months/index.js": /*!**********************************************************************!*\ !*** ./node_modules/date-fns/difference_in_calendar_months/index.js ***! \**********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var parse = __webpack_require__(/*! ../parse/index.js */ \"./node_modules/date-fns/parse/index.js\")\n\n/**\n * @category Month Helpers\n * @summary Get the number of calendar months between the given dates.\n *\n * @description\n * Get the number of calendar months between the given dates.\n *\n * @param {Date|String|Number} dateLeft - the later date\n * @param {Date|String|Number} dateRight - the earlier date\n * @returns {Number} the number of calendar months\n *\n * @example\n * // How many calendar months are between 31 January 2014 and 1 September 2014?\n * var result = differenceInCalendarMonths(\n * new Date(2014, 8, 1),\n * new Date(2014, 0, 31)\n * )\n * //=> 8\n */\nfunction differenceInCalendarMonths (dirtyDateLeft, dirtyDateRight) {\n var dateLeft = parse(dirtyDateLeft)\n var dateRight = parse(dirtyDateRight)\n\n var yearDiff = dateLeft.getFullYear() - dateRight.getFullYear()\n var monthDiff = dateLeft.getMonth() - dateRight.getMonth()\n\n return yearDiff * 12 + monthDiff\n}\n\nmodule.exports = differenceInCalendarMonths\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/difference_in_calendar_months/index.js?"); /***/ }), /***/ "./node_modules/date-fns/difference_in_calendar_quarters/index.js": /*!************************************************************************!*\ !*** ./node_modules/date-fns/difference_in_calendar_quarters/index.js ***! \************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var getQuarter = __webpack_require__(/*! ../get_quarter/index.js */ \"./node_modules/date-fns/get_quarter/index.js\")\nvar parse = __webpack_require__(/*! ../parse/index.js */ \"./node_modules/date-fns/parse/index.js\")\n\n/**\n * @category Quarter Helpers\n * @summary Get the number of calendar quarters between the given dates.\n *\n * @description\n * Get the number of calendar quarters between the given dates.\n *\n * @param {Date|String|Number} dateLeft - the later date\n * @param {Date|String|Number} dateRight - the earlier date\n * @returns {Number} the number of calendar quarters\n *\n * @example\n * // How many calendar quarters are between 31 December 2013 and 2 July 2014?\n * var result = differenceInCalendarQuarters(\n * new Date(2014, 6, 2),\n * new Date(2013, 11, 31)\n * )\n * //=> 3\n */\nfunction differenceInCalendarQuarters (dirtyDateLeft, dirtyDateRight) {\n var dateLeft = parse(dirtyDateLeft)\n var dateRight = parse(dirtyDateRight)\n\n var yearDiff = dateLeft.getFullYear() - dateRight.getFullYear()\n var quarterDiff = getQuarter(dateLeft) - getQuarter(dateRight)\n\n return yearDiff * 4 + quarterDiff\n}\n\nmodule.exports = differenceInCalendarQuarters\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/difference_in_calendar_quarters/index.js?"); /***/ }), /***/ "./node_modules/date-fns/difference_in_calendar_weeks/index.js": /*!*********************************************************************!*\ !*** ./node_modules/date-fns/difference_in_calendar_weeks/index.js ***! \*********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var startOfWeek = __webpack_require__(/*! ../start_of_week/index.js */ \"./node_modules/date-fns/start_of_week/index.js\")\n\nvar MILLISECONDS_IN_MINUTE = 60000\nvar MILLISECONDS_IN_WEEK = 604800000\n\n/**\n * @category Week Helpers\n * @summary Get the number of calendar weeks between the given dates.\n *\n * @description\n * Get the number of calendar weeks between the given dates.\n *\n * @param {Date|String|Number} dateLeft - the later date\n * @param {Date|String|Number} dateRight - the earlier date\n * @param {Object} [options] - the object with options\n * @param {Number} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)\n * @returns {Number} the number of calendar weeks\n *\n * @example\n * // How many calendar weeks are between 5 July 2014 and 20 July 2014?\n * var result = differenceInCalendarWeeks(\n * new Date(2014, 6, 20),\n * new Date(2014, 6, 5)\n * )\n * //=> 3\n *\n * @example\n * // If the week starts on Monday,\n * // how many calendar weeks are between 5 July 2014 and 20 July 2014?\n * var result = differenceInCalendarWeeks(\n * new Date(2014, 6, 20),\n * new Date(2014, 6, 5),\n * {weekStartsOn: 1}\n * )\n * //=> 2\n */\nfunction differenceInCalendarWeeks (dirtyDateLeft, dirtyDateRight, dirtyOptions) {\n var startOfWeekLeft = startOfWeek(dirtyDateLeft, dirtyOptions)\n var startOfWeekRight = startOfWeek(dirtyDateRight, dirtyOptions)\n\n var timestampLeft = startOfWeekLeft.getTime() -\n startOfWeekLeft.getTimezoneOffset() * MILLISECONDS_IN_MINUTE\n var timestampRight = startOfWeekRight.getTime() -\n startOfWeekRight.getTimezoneOffset() * MILLISECONDS_IN_MINUTE\n\n // Round the number of days to the nearest integer\n // because the number of milliseconds in a week is not constant\n // (e.g. it's different in the week of the daylight saving time clock shift)\n return Math.round((timestampLeft - timestampRight) / MILLISECONDS_IN_WEEK)\n}\n\nmodule.exports = differenceInCalendarWeeks\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/difference_in_calendar_weeks/index.js?"); /***/ }), /***/ "./node_modules/date-fns/difference_in_calendar_years/index.js": /*!*********************************************************************!*\ !*** ./node_modules/date-fns/difference_in_calendar_years/index.js ***! \*********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var parse = __webpack_require__(/*! ../parse/index.js */ \"./node_modules/date-fns/parse/index.js\")\n\n/**\n * @category Year Helpers\n * @summary Get the number of calendar years between the given dates.\n *\n * @description\n * Get the number of calendar years between the given dates.\n *\n * @param {Date|String|Number} dateLeft - the later date\n * @param {Date|String|Number} dateRight - the earlier date\n * @returns {Number} the number of calendar years\n *\n * @example\n * // How many calendar years are between 31 December 2013 and 11 February 2015?\n * var result = differenceInCalendarYears(\n * new Date(2015, 1, 11),\n * new Date(2013, 11, 31)\n * )\n * //=> 2\n */\nfunction differenceInCalendarYears (dirtyDateLeft, dirtyDateRight) {\n var dateLeft = parse(dirtyDateLeft)\n var dateRight = parse(dirtyDateRight)\n\n return dateLeft.getFullYear() - dateRight.getFullYear()\n}\n\nmodule.exports = differenceInCalendarYears\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/difference_in_calendar_years/index.js?"); /***/ }), /***/ "./node_modules/date-fns/difference_in_days/index.js": /*!***********************************************************!*\ !*** ./node_modules/date-fns/difference_in_days/index.js ***! \***********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var parse = __webpack_require__(/*! ../parse/index.js */ \"./node_modules/date-fns/parse/index.js\")\nvar differenceInCalendarDays = __webpack_require__(/*! ../difference_in_calendar_days/index.js */ \"./node_modules/date-fns/difference_in_calendar_days/index.js\")\nvar compareAsc = __webpack_require__(/*! ../compare_asc/index.js */ \"./node_modules/date-fns/compare_asc/index.js\")\n\n/**\n * @category Day Helpers\n * @summary Get the number of full days between the given dates.\n *\n * @description\n * Get the number of full days between the given dates.\n *\n * @param {Date|String|Number} dateLeft - the later date\n * @param {Date|String|Number} dateRight - the earlier date\n * @returns {Number} the number of full days\n *\n * @example\n * // How many full days are between\n * // 2 July 2011 23:00:00 and 2 July 2012 00:00:00?\n * var result = differenceInDays(\n * new Date(2012, 6, 2, 0, 0),\n * new Date(2011, 6, 2, 23, 0)\n * )\n * //=> 365\n */\nfunction differenceInDays (dirtyDateLeft, dirtyDateRight) {\n var dateLeft = parse(dirtyDateLeft)\n var dateRight = parse(dirtyDateRight)\n\n var sign = compareAsc(dateLeft, dateRight)\n var difference = Math.abs(differenceInCalendarDays(dateLeft, dateRight))\n dateLeft.setDate(dateLeft.getDate() - sign * difference)\n\n // Math.abs(diff in full days - diff in calendar days) === 1 if last calendar day is not full\n // If so, result must be decreased by 1 in absolute value\n var isLastDayNotFull = compareAsc(dateLeft, dateRight) === -sign\n return sign * (difference - isLastDayNotFull)\n}\n\nmodule.exports = differenceInDays\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/difference_in_days/index.js?"); /***/ }), /***/ "./node_modules/date-fns/difference_in_hours/index.js": /*!************************************************************!*\ !*** ./node_modules/date-fns/difference_in_hours/index.js ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var differenceInMilliseconds = __webpack_require__(/*! ../difference_in_milliseconds/index.js */ \"./node_modules/date-fns/difference_in_milliseconds/index.js\")\n\nvar MILLISECONDS_IN_HOUR = 3600000\n\n/**\n * @category Hour Helpers\n * @summary Get the number of hours between the given dates.\n *\n * @description\n * Get the number of hours between the given dates.\n *\n * @param {Date|String|Number} dateLeft - the later date\n * @param {Date|String|Number} dateRight - the earlier date\n * @returns {Number} the number of hours\n *\n * @example\n * // How many hours are between 2 July 2014 06:50:00 and 2 July 2014 19:00:00?\n * var result = differenceInHours(\n * new Date(2014, 6, 2, 19, 0),\n * new Date(2014, 6, 2, 6, 50)\n * )\n * //=> 12\n */\nfunction differenceInHours (dirtyDateLeft, dirtyDateRight) {\n var diff = differenceInMilliseconds(dirtyDateLeft, dirtyDateRight) / MILLISECONDS_IN_HOUR\n return diff > 0 ? Math.floor(diff) : Math.ceil(diff)\n}\n\nmodule.exports = differenceInHours\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/difference_in_hours/index.js?"); /***/ }), /***/ "./node_modules/date-fns/difference_in_iso_years/index.js": /*!****************************************************************!*\ !*** ./node_modules/date-fns/difference_in_iso_years/index.js ***! \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var parse = __webpack_require__(/*! ../parse/index.js */ \"./node_modules/date-fns/parse/index.js\")\nvar differenceInCalendarISOYears = __webpack_require__(/*! ../difference_in_calendar_iso_years/index.js */ \"./node_modules/date-fns/difference_in_calendar_iso_years/index.js\")\nvar compareAsc = __webpack_require__(/*! ../compare_asc/index.js */ \"./node_modules/date-fns/compare_asc/index.js\")\nvar subISOYears = __webpack_require__(/*! ../sub_iso_years/index.js */ \"./node_modules/date-fns/sub_iso_years/index.js\")\n\n/**\n * @category ISO Week-Numbering Year Helpers\n * @summary Get the number of full ISO week-numbering years between the given dates.\n *\n * @description\n * Get the number of full ISO week-numbering years between the given dates.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @param {Date|String|Number} dateLeft - the later date\n * @param {Date|String|Number} dateRight - the earlier date\n * @returns {Number} the number of full ISO week-numbering years\n *\n * @example\n * // How many full ISO week-numbering years are between 1 January 2010 and 1 January 2012?\n * var result = differenceInISOYears(\n * new Date(2012, 0, 1),\n * new Date(2010, 0, 1)\n * )\n * //=> 1\n */\nfunction differenceInISOYears (dirtyDateLeft, dirtyDateRight) {\n var dateLeft = parse(dirtyDateLeft)\n var dateRight = parse(dirtyDateRight)\n\n var sign = compareAsc(dateLeft, dateRight)\n var difference = Math.abs(differenceInCalendarISOYears(dateLeft, dateRight))\n dateLeft = subISOYears(dateLeft, sign * difference)\n\n // Math.abs(diff in full ISO years - diff in calendar ISO years) === 1\n // if last calendar ISO year is not full\n // If so, result must be decreased by 1 in absolute value\n var isLastISOYearNotFull = compareAsc(dateLeft, dateRight) === -sign\n return sign * (difference - isLastISOYearNotFull)\n}\n\nmodule.exports = differenceInISOYears\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/difference_in_iso_years/index.js?"); /***/ }), /***/ "./node_modules/date-fns/difference_in_milliseconds/index.js": /*!*******************************************************************!*\ !*** ./node_modules/date-fns/difference_in_milliseconds/index.js ***! \*******************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var parse = __webpack_require__(/*! ../parse/index.js */ \"./node_modules/date-fns/parse/index.js\")\n\n/**\n * @category Millisecond Helpers\n * @summary Get the number of milliseconds between the given dates.\n *\n * @description\n * Get the number of milliseconds between the given dates.\n *\n * @param {Date|String|Number} dateLeft - the later date\n * @param {Date|String|Number} dateRight - the earlier date\n * @returns {Number} the number of milliseconds\n *\n * @example\n * // How many milliseconds are between\n * // 2 July 2014 12:30:20.600 and 2 July 2014 12:30:21.700?\n * var result = differenceInMilliseconds(\n * new Date(2014, 6, 2, 12, 30, 21, 700),\n * new Date(2014, 6, 2, 12, 30, 20, 600)\n * )\n * //=> 1100\n */\nfunction differenceInMilliseconds (dirtyDateLeft, dirtyDateRight) {\n var dateLeft = parse(dirtyDateLeft)\n var dateRight = parse(dirtyDateRight)\n return dateLeft.getTime() - dateRight.getTime()\n}\n\nmodule.exports = differenceInMilliseconds\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/difference_in_milliseconds/index.js?"); /***/ }), /***/ "./node_modules/date-fns/difference_in_minutes/index.js": /*!**************************************************************!*\ !*** ./node_modules/date-fns/difference_in_minutes/index.js ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var differenceInMilliseconds = __webpack_require__(/*! ../difference_in_milliseconds/index.js */ \"./node_modules/date-fns/difference_in_milliseconds/index.js\")\n\nvar MILLISECONDS_IN_MINUTE = 60000\n\n/**\n * @category Minute Helpers\n * @summary Get the number of minutes between the given dates.\n *\n * @description\n * Get the number of minutes between the given dates.\n *\n * @param {Date|String|Number} dateLeft - the later date\n * @param {Date|String|Number} dateRight - the earlier date\n * @returns {Number} the number of minutes\n *\n * @example\n * // How many minutes are between 2 July 2014 12:07:59 and 2 July 2014 12:20:00?\n * var result = differenceInMinutes(\n * new Date(2014, 6, 2, 12, 20, 0),\n * new Date(2014, 6, 2, 12, 7, 59)\n * )\n * //=> 12\n */\nfunction differenceInMinutes (dirtyDateLeft, dirtyDateRight) {\n var diff = differenceInMilliseconds(dirtyDateLeft, dirtyDateRight) / MILLISECONDS_IN_MINUTE\n return diff > 0 ? Math.floor(diff) : Math.ceil(diff)\n}\n\nmodule.exports = differenceInMinutes\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/difference_in_minutes/index.js?"); /***/ }), /***/ "./node_modules/date-fns/difference_in_months/index.js": /*!*************************************************************!*\ !*** ./node_modules/date-fns/difference_in_months/index.js ***! \*************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var parse = __webpack_require__(/*! ../parse/index.js */ \"./node_modules/date-fns/parse/index.js\")\nvar differenceInCalendarMonths = __webpack_require__(/*! ../difference_in_calendar_months/index.js */ \"./node_modules/date-fns/difference_in_calendar_months/index.js\")\nvar compareAsc = __webpack_require__(/*! ../compare_asc/index.js */ \"./node_modules/date-fns/compare_asc/index.js\")\n\n/**\n * @category Month Helpers\n * @summary Get the number of full months between the given dates.\n *\n * @description\n * Get the number of full months between the given dates.\n *\n * @param {Date|String|Number} dateLeft - the later date\n * @param {Date|String|Number} dateRight - the earlier date\n * @returns {Number} the number of full months\n *\n * @example\n * // How many full months are between 31 January 2014 and 1 September 2014?\n * var result = differenceInMonths(\n * new Date(2014, 8, 1),\n * new Date(2014, 0, 31)\n * )\n * //=> 7\n */\nfunction differenceInMonths (dirtyDateLeft, dirtyDateRight) {\n var dateLeft = parse(dirtyDateLeft)\n var dateRight = parse(dirtyDateRight)\n\n var sign = compareAsc(dateLeft, dateRight)\n var difference = Math.abs(differenceInCalendarMonths(dateLeft, dateRight))\n dateLeft.setMonth(dateLeft.getMonth() - sign * difference)\n\n // Math.abs(diff in full months - diff in calendar months) === 1 if last calendar month is not full\n // If so, result must be decreased by 1 in absolute value\n var isLastMonthNotFull = compareAsc(dateLeft, dateRight) === -sign\n return sign * (difference - isLastMonthNotFull)\n}\n\nmodule.exports = differenceInMonths\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/difference_in_months/index.js?"); /***/ }), /***/ "./node_modules/date-fns/difference_in_quarters/index.js": /*!***************************************************************!*\ !*** ./node_modules/date-fns/difference_in_quarters/index.js ***! \***************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var differenceInMonths = __webpack_require__(/*! ../difference_in_months/index.js */ \"./node_modules/date-fns/difference_in_months/index.js\")\n\n/**\n * @category Quarter Helpers\n * @summary Get the number of full quarters between the given dates.\n *\n * @description\n * Get the number of full quarters between the given dates.\n *\n * @param {Date|String|Number} dateLeft - the later date\n * @param {Date|String|Number} dateRight - the earlier date\n * @returns {Number} the number of full quarters\n *\n * @example\n * // How many full quarters are between 31 December 2013 and 2 July 2014?\n * var result = differenceInQuarters(\n * new Date(2014, 6, 2),\n * new Date(2013, 11, 31)\n * )\n * //=> 2\n */\nfunction differenceInQuarters (dirtyDateLeft, dirtyDateRight) {\n var diff = differenceInMonths(dirtyDateLeft, dirtyDateRight) / 3\n return diff > 0 ? Math.floor(diff) : Math.ceil(diff)\n}\n\nmodule.exports = differenceInQuarters\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/difference_in_quarters/index.js?"); /***/ }), /***/ "./node_modules/date-fns/difference_in_seconds/index.js": /*!**************************************************************!*\ !*** ./node_modules/date-fns/difference_in_seconds/index.js ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var differenceInMilliseconds = __webpack_require__(/*! ../difference_in_milliseconds/index.js */ \"./node_modules/date-fns/difference_in_milliseconds/index.js\")\n\n/**\n * @category Second Helpers\n * @summary Get the number of seconds between the given dates.\n *\n * @description\n * Get the number of seconds between the given dates.\n *\n * @param {Date|String|Number} dateLeft - the later date\n * @param {Date|String|Number} dateRight - the earlier date\n * @returns {Number} the number of seconds\n *\n * @example\n * // How many seconds are between\n * // 2 July 2014 12:30:07.999 and 2 July 2014 12:30:20.000?\n * var result = differenceInSeconds(\n * new Date(2014, 6, 2, 12, 30, 20, 0),\n * new Date(2014, 6, 2, 12, 30, 7, 999)\n * )\n * //=> 12\n */\nfunction differenceInSeconds (dirtyDateLeft, dirtyDateRight) {\n var diff = differenceInMilliseconds(dirtyDateLeft, dirtyDateRight) / 1000\n return diff > 0 ? Math.floor(diff) : Math.ceil(diff)\n}\n\nmodule.exports = differenceInSeconds\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/difference_in_seconds/index.js?"); /***/ }), /***/ "./node_modules/date-fns/difference_in_weeks/index.js": /*!************************************************************!*\ !*** ./node_modules/date-fns/difference_in_weeks/index.js ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var differenceInDays = __webpack_require__(/*! ../difference_in_days/index.js */ \"./node_modules/date-fns/difference_in_days/index.js\")\n\n/**\n * @category Week Helpers\n * @summary Get the number of full weeks between the given dates.\n *\n * @description\n * Get the number of full weeks between the given dates.\n *\n * @param {Date|String|Number} dateLeft - the later date\n * @param {Date|String|Number} dateRight - the earlier date\n * @returns {Number} the number of full weeks\n *\n * @example\n * // How many full weeks are between 5 July 2014 and 20 July 2014?\n * var result = differenceInWeeks(\n * new Date(2014, 6, 20),\n * new Date(2014, 6, 5)\n * )\n * //=> 2\n */\nfunction differenceInWeeks (dirtyDateLeft, dirtyDateRight) {\n var diff = differenceInDays(dirtyDateLeft, dirtyDateRight) / 7\n return diff > 0 ? Math.floor(diff) : Math.ceil(diff)\n}\n\nmodule.exports = differenceInWeeks\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/difference_in_weeks/index.js?"); /***/ }), /***/ "./node_modules/date-fns/difference_in_years/index.js": /*!************************************************************!*\ !*** ./node_modules/date-fns/difference_in_years/index.js ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var parse = __webpack_require__(/*! ../parse/index.js */ \"./node_modules/date-fns/parse/index.js\")\nvar differenceInCalendarYears = __webpack_require__(/*! ../difference_in_calendar_years/index.js */ \"./node_modules/date-fns/difference_in_calendar_years/index.js\")\nvar compareAsc = __webpack_require__(/*! ../compare_asc/index.js */ \"./node_modules/date-fns/compare_asc/index.js\")\n\n/**\n * @category Year Helpers\n * @summary Get the number of full years between the given dates.\n *\n * @description\n * Get the number of full years between the given dates.\n *\n * @param {Date|String|Number} dateLeft - the later date\n * @param {Date|String|Number} dateRight - the earlier date\n * @returns {Number} the number of full years\n *\n * @example\n * // How many full years are between 31 December 2013 and 11 February 2015?\n * var result = differenceInYears(\n * new Date(2015, 1, 11),\n * new Date(2013, 11, 31)\n * )\n * //=> 1\n */\nfunction differenceInYears (dirtyDateLeft, dirtyDateRight) {\n var dateLeft = parse(dirtyDateLeft)\n var dateRight = parse(dirtyDateRight)\n\n var sign = compareAsc(dateLeft, dateRight)\n var difference = Math.abs(differenceInCalendarYears(dateLeft, dateRight))\n dateLeft.setFullYear(dateLeft.getFullYear() - sign * difference)\n\n // Math.abs(diff in full years - diff in calendar years) === 1 if last calendar year is not full\n // If so, result must be decreased by 1 in absolute value\n var isLastYearNotFull = compareAsc(dateLeft, dateRight) === -sign\n return sign * (difference - isLastYearNotFull)\n}\n\nmodule.exports = differenceInYears\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/difference_in_years/index.js?"); /***/ }), /***/ "./node_modules/date-fns/distance_in_words/index.js": /*!**********************************************************!*\ !*** ./node_modules/date-fns/distance_in_words/index.js ***! \**********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var compareDesc = __webpack_require__(/*! ../compare_desc/index.js */ \"./node_modules/date-fns/compare_desc/index.js\")\nvar parse = __webpack_require__(/*! ../parse/index.js */ \"./node_modules/date-fns/parse/index.js\")\nvar differenceInSeconds = __webpack_require__(/*! ../difference_in_seconds/index.js */ \"./node_modules/date-fns/difference_in_seconds/index.js\")\nvar differenceInMonths = __webpack_require__(/*! ../difference_in_months/index.js */ \"./node_modules/date-fns/difference_in_months/index.js\")\nvar enLocale = __webpack_require__(/*! ../locale/en/index.js */ \"./node_modules/date-fns/locale/en/index.js\")\n\nvar MINUTES_IN_DAY = 1440\nvar MINUTES_IN_ALMOST_TWO_DAYS = 2520\nvar MINUTES_IN_MONTH = 43200\nvar MINUTES_IN_TWO_MONTHS = 86400\n\n/**\n * @category Common Helpers\n * @summary Return the distance between the given dates in words.\n *\n * @description\n * Return the distance between the given dates in words.\n *\n * | Distance between dates | Result |\n * |-------------------------------------------------------------------|---------------------|\n * | 0 ... 30 secs | less than a minute |\n * | 30 secs ... 1 min 30 secs | 1 minute |\n * | 1 min 30 secs ... 44 mins 30 secs | [2..44] minutes |\n * | 44 mins ... 30 secs ... 89 mins 30 secs | about 1 hour |\n * | 89 mins 30 secs ... 23 hrs 59 mins 30 secs | about [2..24] hours |\n * | 23 hrs 59 mins 30 secs ... 41 hrs 59 mins 30 secs | 1 day |\n * | 41 hrs 59 mins 30 secs ... 29 days 23 hrs 59 mins 30 secs | [2..30] days |\n * | 29 days 23 hrs 59 mins 30 secs ... 44 days 23 hrs 59 mins 30 secs | about 1 month |\n * | 44 days 23 hrs 59 mins 30 secs ... 59 days 23 hrs 59 mins 30 secs | about 2 months |\n * | 59 days 23 hrs 59 mins 30 secs ... 1 yr | [2..12] months |\n * | 1 yr ... 1 yr 3 months | about 1 year |\n * | 1 yr 3 months ... 1 yr 9 month s | over 1 year |\n * | 1 yr 9 months ... 2 yrs | almost 2 years |\n * | N yrs ... N yrs 3 months | about N years |\n * | N yrs 3 months ... N yrs 9 months | over N years |\n * | N yrs 9 months ... N+1 yrs | almost N+1 years |\n *\n * With `options.includeSeconds == true`:\n * | Distance between dates | Result |\n * |------------------------|----------------------|\n * | 0 secs ... 5 secs | less than 5 seconds |\n * | 5 secs ... 10 secs | less than 10 seconds |\n * | 10 secs ... 20 secs | less than 20 seconds |\n * | 20 secs ... 40 secs | half a minute |\n * | 40 secs ... 60 secs | less than a minute |\n * | 60 secs ... 90 secs | 1 minute |\n *\n * @param {Date|String|Number} dateToCompare - the date to compare with\n * @param {Date|String|Number} date - the other date\n * @param {Object} [options] - the object with options\n * @param {Boolean} [options.includeSeconds=false] - distances less than a minute are more detailed\n * @param {Boolean} [options.addSuffix=false] - result indicates if the second date is earlier or later than the first\n * @param {Object} [options.locale=enLocale] - the locale object\n * @returns {String} the distance in words\n *\n * @example\n * // What is the distance between 2 July 2014 and 1 January 2015?\n * var result = distanceInWords(\n * new Date(2014, 6, 2),\n * new Date(2015, 0, 1)\n * )\n * //=> '6 months'\n *\n * @example\n * // What is the distance between 1 January 2015 00:00:15\n * // and 1 January 2015 00:00:00, including seconds?\n * var result = distanceInWords(\n * new Date(2015, 0, 1, 0, 0, 15),\n * new Date(2015, 0, 1, 0, 0, 0),\n * {includeSeconds: true}\n * )\n * //=> 'less than 20 seconds'\n *\n * @example\n * // What is the distance from 1 January 2016\n * // to 1 January 2015, with a suffix?\n * var result = distanceInWords(\n * new Date(2016, 0, 1),\n * new Date(2015, 0, 1),\n * {addSuffix: true}\n * )\n * //=> 'about 1 year ago'\n *\n * @example\n * // What is the distance between 1 August 2016 and 1 January 2015 in Esperanto?\n * var eoLocale = require('date-fns/locale/eo')\n * var result = distanceInWords(\n * new Date(2016, 7, 1),\n * new Date(2015, 0, 1),\n * {locale: eoLocale}\n * )\n * //=> 'pli ol 1 jaro'\n */\nfunction distanceInWords (dirtyDateToCompare, dirtyDate, dirtyOptions) {\n var options = dirtyOptions || {}\n\n var comparison = compareDesc(dirtyDateToCompare, dirtyDate)\n\n var locale = options.locale\n var localize = enLocale.distanceInWords.localize\n if (locale && locale.distanceInWords && locale.distanceInWords.localize) {\n localize = locale.distanceInWords.localize\n }\n\n var localizeOptions = {\n addSuffix: Boolean(options.addSuffix),\n comparison: comparison\n }\n\n var dateLeft, dateRight\n if (comparison > 0) {\n dateLeft = parse(dirtyDateToCompare)\n dateRight = parse(dirtyDate)\n } else {\n dateLeft = parse(dirtyDate)\n dateRight = parse(dirtyDateToCompare)\n }\n\n var seconds = differenceInSeconds(dateRight, dateLeft)\n var offset = dateRight.getTimezoneOffset() - dateLeft.getTimezoneOffset()\n var minutes = Math.round(seconds / 60) - offset\n var months\n\n // 0 up to 2 mins\n if (minutes < 2) {\n if (options.includeSeconds) {\n if (seconds < 5) {\n return localize('lessThanXSeconds', 5, localizeOptions)\n } else if (seconds < 10) {\n return localize('lessThanXSeconds', 10, localizeOptions)\n } else if (seconds < 20) {\n return localize('lessThanXSeconds', 20, localizeOptions)\n } else if (seconds < 40) {\n return localize('halfAMinute', null, localizeOptions)\n } else if (seconds < 60) {\n return localize('lessThanXMinutes', 1, localizeOptions)\n } else {\n return localize('xMinutes', 1, localizeOptions)\n }\n } else {\n if (minutes === 0) {\n return localize('lessThanXMinutes', 1, localizeOptions)\n } else {\n return localize('xMinutes', minutes, localizeOptions)\n }\n }\n\n // 2 mins up to 0.75 hrs\n } else if (minutes < 45) {\n return localize('xMinutes', minutes, localizeOptions)\n\n // 0.75 hrs up to 1.5 hrs\n } else if (minutes < 90) {\n return localize('aboutXHours', 1, localizeOptions)\n\n // 1.5 hrs up to 24 hrs\n } else if (minutes < MINUTES_IN_DAY) {\n var hours = Math.round(minutes / 60)\n return localize('aboutXHours', hours, localizeOptions)\n\n // 1 day up to 1.75 days\n } else if (minutes < MINUTES_IN_ALMOST_TWO_DAYS) {\n return localize('xDays', 1, localizeOptions)\n\n // 1.75 days up to 30 days\n } else if (minutes < MINUTES_IN_MONTH) {\n var days = Math.round(minutes / MINUTES_IN_DAY)\n return localize('xDays', days, localizeOptions)\n\n // 1 month up to 2 months\n } else if (minutes < MINUTES_IN_TWO_MONTHS) {\n months = Math.round(minutes / MINUTES_IN_MONTH)\n return localize('aboutXMonths', months, localizeOptions)\n }\n\n months = differenceInMonths(dateRight, dateLeft)\n\n // 2 months up to 12 months\n if (months < 12) {\n var nearestMonth = Math.round(minutes / MINUTES_IN_MONTH)\n return localize('xMonths', nearestMonth, localizeOptions)\n\n // 1 year up to max Date\n } else {\n var monthsSinceStartOfYear = months % 12\n var years = Math.floor(months / 12)\n\n // N years up to 1 years 3 months\n if (monthsSinceStartOfYear < 3) {\n return localize('aboutXYears', years, localizeOptions)\n\n // N years 3 months up to N years 9 months\n } else if (monthsSinceStartOfYear < 9) {\n return localize('overXYears', years, localizeOptions)\n\n // N years 9 months up to N year 12 months\n } else {\n return localize('almostXYears', years + 1, localizeOptions)\n }\n }\n}\n\nmodule.exports = distanceInWords\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/distance_in_words/index.js?"); /***/ }), /***/ "./node_modules/date-fns/distance_in_words_strict/index.js": /*!*****************************************************************!*\ !*** ./node_modules/date-fns/distance_in_words_strict/index.js ***! \*****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var compareDesc = __webpack_require__(/*! ../compare_desc/index.js */ \"./node_modules/date-fns/compare_desc/index.js\")\nvar parse = __webpack_require__(/*! ../parse/index.js */ \"./node_modules/date-fns/parse/index.js\")\nvar differenceInSeconds = __webpack_require__(/*! ../difference_in_seconds/index.js */ \"./node_modules/date-fns/difference_in_seconds/index.js\")\nvar enLocale = __webpack_require__(/*! ../locale/en/index.js */ \"./node_modules/date-fns/locale/en/index.js\")\n\nvar MINUTES_IN_DAY = 1440\nvar MINUTES_IN_MONTH = 43200\nvar MINUTES_IN_YEAR = 525600\n\n/**\n * @category Common Helpers\n * @summary Return the distance between the given dates in words.\n *\n * @description\n * Return the distance between the given dates in words, using strict units.\n * This is like `distanceInWords`, but does not use helpers like 'almost', 'over',\n * 'less than' and the like.\n *\n * | Distance between dates | Result |\n * |------------------------|---------------------|\n * | 0 ... 59 secs | [0..59] seconds |\n * | 1 ... 59 mins | [1..59] minutes |\n * | 1 ... 23 hrs | [1..23] hours |\n * | 1 ... 29 days | [1..29] days |\n * | 1 ... 11 months | [1..11] months |\n * | 1 ... N years | [1..N] years |\n *\n * @param {Date|String|Number} dateToCompare - the date to compare with\n * @param {Date|String|Number} date - the other date\n * @param {Object} [options] - the object with options\n * @param {Boolean} [options.addSuffix=false] - result indicates if the second date is earlier or later than the first\n * @param {'s'|'m'|'h'|'d'|'M'|'Y'} [options.unit] - if specified, will force a unit\n * @param {'floor'|'ceil'|'round'} [options.partialMethod='floor'] - which way to round partial units\n * @param {Object} [options.locale=enLocale] - the locale object\n * @returns {String} the distance in words\n *\n * @example\n * // What is the distance between 2 July 2014 and 1 January 2015?\n * var result = distanceInWordsStrict(\n * new Date(2014, 6, 2),\n * new Date(2015, 0, 2)\n * )\n * //=> '6 months'\n *\n * @example\n * // What is the distance between 1 January 2015 00:00:15\n * // and 1 January 2015 00:00:00?\n * var result = distanceInWordsStrict(\n * new Date(2015, 0, 1, 0, 0, 15),\n * new Date(2015, 0, 1, 0, 0, 0),\n * )\n * //=> '15 seconds'\n *\n * @example\n * // What is the distance from 1 January 2016\n * // to 1 January 2015, with a suffix?\n * var result = distanceInWordsStrict(\n * new Date(2016, 0, 1),\n * new Date(2015, 0, 1),\n * {addSuffix: true}\n * )\n * //=> '1 year ago'\n *\n * @example\n * // What is the distance from 1 January 2016\n * // to 1 January 2015, in minutes?\n * var result = distanceInWordsStrict(\n * new Date(2016, 0, 1),\n * new Date(2015, 0, 1),\n * {unit: 'm'}\n * )\n * //=> '525600 minutes'\n *\n * @example\n * // What is the distance from 1 January 2016\n * // to 28 January 2015, in months, rounded up?\n * var result = distanceInWordsStrict(\n * new Date(2015, 0, 28),\n * new Date(2015, 0, 1),\n * {unit: 'M', partialMethod: 'ceil'}\n * )\n * //=> '1 month'\n *\n * @example\n * // What is the distance between 1 August 2016 and 1 January 2015 in Esperanto?\n * var eoLocale = require('date-fns/locale/eo')\n * var result = distanceInWordsStrict(\n * new Date(2016, 7, 1),\n * new Date(2015, 0, 1),\n * {locale: eoLocale}\n * )\n * //=> '1 jaro'\n */\nfunction distanceInWordsStrict (dirtyDateToCompare, dirtyDate, dirtyOptions) {\n var options = dirtyOptions || {}\n\n var comparison = compareDesc(dirtyDateToCompare, dirtyDate)\n\n var locale = options.locale\n var localize = enLocale.distanceInWords.localize\n if (locale && locale.distanceInWords && locale.distanceInWords.localize) {\n localize = locale.distanceInWords.localize\n }\n\n var localizeOptions = {\n addSuffix: Boolean(options.addSuffix),\n comparison: comparison\n }\n\n var dateLeft, dateRight\n if (comparison > 0) {\n dateLeft = parse(dirtyDateToCompare)\n dateRight = parse(dirtyDate)\n } else {\n dateLeft = parse(dirtyDate)\n dateRight = parse(dirtyDateToCompare)\n }\n\n var unit\n var mathPartial = Math[options.partialMethod ? String(options.partialMethod) : 'floor']\n var seconds = differenceInSeconds(dateRight, dateLeft)\n var offset = dateRight.getTimezoneOffset() - dateLeft.getTimezoneOffset()\n var minutes = mathPartial(seconds / 60) - offset\n var hours, days, months, years\n\n if (options.unit) {\n unit = String(options.unit)\n } else {\n if (minutes < 1) {\n unit = 's'\n } else if (minutes < 60) {\n unit = 'm'\n } else if (minutes < MINUTES_IN_DAY) {\n unit = 'h'\n } else if (minutes < MINUTES_IN_MONTH) {\n unit = 'd'\n } else if (minutes < MINUTES_IN_YEAR) {\n unit = 'M'\n } else {\n unit = 'Y'\n }\n }\n\n // 0 up to 60 seconds\n if (unit === 's') {\n return localize('xSeconds', seconds, localizeOptions)\n\n // 1 up to 60 mins\n } else if (unit === 'm') {\n return localize('xMinutes', minutes, localizeOptions)\n\n // 1 up to 24 hours\n } else if (unit === 'h') {\n hours = mathPartial(minutes / 60)\n return localize('xHours', hours, localizeOptions)\n\n // 1 up to 30 days\n } else if (unit === 'd') {\n days = mathPartial(minutes / MINUTES_IN_DAY)\n return localize('xDays', days, localizeOptions)\n\n // 1 up to 12 months\n } else if (unit === 'M') {\n months = mathPartial(minutes / MINUTES_IN_MONTH)\n return localize('xMonths', months, localizeOptions)\n\n // 1 year up to max Date\n } else if (unit === 'Y') {\n years = mathPartial(minutes / MINUTES_IN_YEAR)\n return localize('xYears', years, localizeOptions)\n }\n\n throw new Error('Unknown unit: ' + unit)\n}\n\nmodule.exports = distanceInWordsStrict\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/distance_in_words_strict/index.js?"); /***/ }), /***/ "./node_modules/date-fns/distance_in_words_to_now/index.js": /*!*****************************************************************!*\ !*** ./node_modules/date-fns/distance_in_words_to_now/index.js ***! \*****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var distanceInWords = __webpack_require__(/*! ../distance_in_words/index.js */ \"./node_modules/date-fns/distance_in_words/index.js\")\n\n/**\n * @category Common Helpers\n * @summary Return the distance between the given date and now in words.\n *\n * @description\n * Return the distance between the given date and now in words.\n *\n * | Distance to now | Result |\n * |-------------------------------------------------------------------|---------------------|\n * | 0 ... 30 secs | less than a minute |\n * | 30 secs ... 1 min 30 secs | 1 minute |\n * | 1 min 30 secs ... 44 mins 30 secs | [2..44] minutes |\n * | 44 mins ... 30 secs ... 89 mins 30 secs | about 1 hour |\n * | 89 mins 30 secs ... 23 hrs 59 mins 30 secs | about [2..24] hours |\n * | 23 hrs 59 mins 30 secs ... 41 hrs 59 mins 30 secs | 1 day |\n * | 41 hrs 59 mins 30 secs ... 29 days 23 hrs 59 mins 30 secs | [2..30] days |\n * | 29 days 23 hrs 59 mins 30 secs ... 44 days 23 hrs 59 mins 30 secs | about 1 month |\n * | 44 days 23 hrs 59 mins 30 secs ... 59 days 23 hrs 59 mins 30 secs | about 2 months |\n * | 59 days 23 hrs 59 mins 30 secs ... 1 yr | [2..12] months |\n * | 1 yr ... 1 yr 3 months | about 1 year |\n * | 1 yr 3 months ... 1 yr 9 month s | over 1 year |\n * | 1 yr 9 months ... 2 yrs | almost 2 years |\n * | N yrs ... N yrs 3 months | about N years |\n * | N yrs 3 months ... N yrs 9 months | over N years |\n * | N yrs 9 months ... N+1 yrs | almost N+1 years |\n *\n * With `options.includeSeconds == true`:\n * | Distance to now | Result |\n * |---------------------|----------------------|\n * | 0 secs ... 5 secs | less than 5 seconds |\n * | 5 secs ... 10 secs | less than 10 seconds |\n * | 10 secs ... 20 secs | less than 20 seconds |\n * | 20 secs ... 40 secs | half a minute |\n * | 40 secs ... 60 secs | less than a minute |\n * | 60 secs ... 90 secs | 1 minute |\n *\n * @param {Date|String|Number} date - the given date\n * @param {Object} [options] - the object with options\n * @param {Boolean} [options.includeSeconds=false] - distances less than a minute are more detailed\n * @param {Boolean} [options.addSuffix=false] - result specifies if the second date is earlier or later than the first\n * @param {Object} [options.locale=enLocale] - the locale object\n * @returns {String} the distance in words\n *\n * @example\n * // If today is 1 January 2015, what is the distance to 2 July 2014?\n * var result = distanceInWordsToNow(\n * new Date(2014, 6, 2)\n * )\n * //=> '6 months'\n *\n * @example\n * // If now is 1 January 2015 00:00:00,\n * // what is the distance to 1 January 2015 00:00:15, including seconds?\n * var result = distanceInWordsToNow(\n * new Date(2015, 0, 1, 0, 0, 15),\n * {includeSeconds: true}\n * )\n * //=> 'less than 20 seconds'\n *\n * @example\n * // If today is 1 January 2015,\n * // what is the distance to 1 January 2016, with a suffix?\n * var result = distanceInWordsToNow(\n * new Date(2016, 0, 1),\n * {addSuffix: true}\n * )\n * //=> 'in about 1 year'\n *\n * @example\n * // If today is 1 January 2015,\n * // what is the distance to 1 August 2016 in Esperanto?\n * var eoLocale = require('date-fns/locale/eo')\n * var result = distanceInWordsToNow(\n * new Date(2016, 7, 1),\n * {locale: eoLocale}\n * )\n * //=> 'pli ol 1 jaro'\n */\nfunction distanceInWordsToNow (dirtyDate, dirtyOptions) {\n return distanceInWords(Date.now(), dirtyDate, dirtyOptions)\n}\n\nmodule.exports = distanceInWordsToNow\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/distance_in_words_to_now/index.js?"); /***/ }), /***/ "./node_modules/date-fns/each_day/index.js": /*!*************************************************!*\ !*** ./node_modules/date-fns/each_day/index.js ***! \*************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var parse = __webpack_require__(/*! ../parse/index.js */ \"./node_modules/date-fns/parse/index.js\")\n\n/**\n * @category Day Helpers\n * @summary Return the array of dates within the specified range.\n *\n * @description\n * Return the array of dates within the specified range.\n *\n * @param {Date|String|Number} startDate - the first date\n * @param {Date|String|Number} endDate - the last date\n * @param {Number} [step=1] - the step between each day\n * @returns {Date[]} the array with starts of days from the day of startDate to the day of endDate\n * @throws {Error} startDate cannot be after endDate\n *\n * @example\n * // Each day between 6 October 2014 and 10 October 2014:\n * var result = eachDay(\n * new Date(2014, 9, 6),\n * new Date(2014, 9, 10)\n * )\n * //=> [\n * // Mon Oct 06 2014 00:00:00,\n * // Tue Oct 07 2014 00:00:00,\n * // Wed Oct 08 2014 00:00:00,\n * // Thu Oct 09 2014 00:00:00,\n * // Fri Oct 10 2014 00:00:00\n * // ]\n */\nfunction eachDay (dirtyStartDate, dirtyEndDate, dirtyStep) {\n var startDate = parse(dirtyStartDate)\n var endDate = parse(dirtyEndDate)\n var step = dirtyStep !== undefined ? dirtyStep : 1\n\n var endTime = endDate.getTime()\n\n if (startDate.getTime() > endTime) {\n throw new Error('The first date cannot be after the second date')\n }\n\n var dates = []\n\n var currentDate = startDate\n currentDate.setHours(0, 0, 0, 0)\n\n while (currentDate.getTime() <= endTime) {\n dates.push(parse(currentDate))\n currentDate.setDate(currentDate.getDate() + step)\n }\n\n return dates\n}\n\nmodule.exports = eachDay\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/each_day/index.js?"); /***/ }), /***/ "./node_modules/date-fns/end_of_day/index.js": /*!***************************************************!*\ !*** ./node_modules/date-fns/end_of_day/index.js ***! \***************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var parse = __webpack_require__(/*! ../parse/index.js */ \"./node_modules/date-fns/parse/index.js\")\n\n/**\n * @category Day Helpers\n * @summary Return the end of a day for the given date.\n *\n * @description\n * Return the end of a day for the given date.\n * The result will be in the local timezone.\n *\n * @param {Date|String|Number} date - the original date\n * @returns {Date} the end of a day\n *\n * @example\n * // The end of a day for 2 September 2014 11:55:00:\n * var result = endOfDay(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Tue Sep 02 2014 23:59:59.999\n */\nfunction endOfDay (dirtyDate) {\n var date = parse(dirtyDate)\n date.setHours(23, 59, 59, 999)\n return date\n}\n\nmodule.exports = endOfDay\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/end_of_day/index.js?"); /***/ }), /***/ "./node_modules/date-fns/end_of_hour/index.js": /*!****************************************************!*\ !*** ./node_modules/date-fns/end_of_hour/index.js ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var parse = __webpack_require__(/*! ../parse/index.js */ \"./node_modules/date-fns/parse/index.js\")\n\n/**\n * @category Hour Helpers\n * @summary Return the end of an hour for the given date.\n *\n * @description\n * Return the end of an hour for the given date.\n * The result will be in the local timezone.\n *\n * @param {Date|String|Number} date - the original date\n * @returns {Date} the end of an hour\n *\n * @example\n * // The end of an hour for 2 September 2014 11:55:00:\n * var result = endOfHour(new Date(2014, 8, 2, 11, 55))\n * //=> Tue Sep 02 2014 11:59:59.999\n */\nfunction endOfHour (dirtyDate) {\n var date = parse(dirtyDate)\n date.setMinutes(59, 59, 999)\n return date\n}\n\nmodule.exports = endOfHour\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/end_of_hour/index.js?"); /***/ }), /***/ "./node_modules/date-fns/end_of_iso_week/index.js": /*!********************************************************!*\ !*** ./node_modules/date-fns/end_of_iso_week/index.js ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var endOfWeek = __webpack_require__(/*! ../end_of_week/index.js */ \"./node_modules/date-fns/end_of_week/index.js\")\n\n/**\n * @category ISO Week Helpers\n * @summary Return the end of an ISO week for the given date.\n *\n * @description\n * Return the end of an ISO week for the given date.\n * The result will be in the local timezone.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @param {Date|String|Number} date - the original date\n * @returns {Date} the end of an ISO week\n *\n * @example\n * // The end of an ISO week for 2 September 2014 11:55:00:\n * var result = endOfISOWeek(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Sun Sep 07 2014 23:59:59.999\n */\nfunction endOfISOWeek (dirtyDate) {\n return endOfWeek(dirtyDate, {weekStartsOn: 1})\n}\n\nmodule.exports = endOfISOWeek\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/end_of_iso_week/index.js?"); /***/ }), /***/ "./node_modules/date-fns/end_of_iso_year/index.js": /*!********************************************************!*\ !*** ./node_modules/date-fns/end_of_iso_year/index.js ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var getISOYear = __webpack_require__(/*! ../get_iso_year/index.js */ \"./node_modules/date-fns/get_iso_year/index.js\")\nvar startOfISOWeek = __webpack_require__(/*! ../start_of_iso_week/index.js */ \"./node_modules/date-fns/start_of_iso_week/index.js\")\n\n/**\n * @category ISO Week-Numbering Year Helpers\n * @summary Return the end of an ISO week-numbering year for the given date.\n *\n * @description\n * Return the end of an ISO week-numbering year,\n * which always starts 3 days before the year's first Thursday.\n * The result will be in the local timezone.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @param {Date|String|Number} date - the original date\n * @returns {Date} the end of an ISO week-numbering year\n *\n * @example\n * // The end of an ISO week-numbering year for 2 July 2005:\n * var result = endOfISOYear(new Date(2005, 6, 2))\n * //=> Sun Jan 01 2006 23:59:59.999\n */\nfunction endOfISOYear (dirtyDate) {\n var year = getISOYear(dirtyDate)\n var fourthOfJanuaryOfNextYear = new Date(0)\n fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4)\n fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0)\n var date = startOfISOWeek(fourthOfJanuaryOfNextYear)\n date.setMilliseconds(date.getMilliseconds() - 1)\n return date\n}\n\nmodule.exports = endOfISOYear\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/end_of_iso_year/index.js?"); /***/ }), /***/ "./node_modules/date-fns/end_of_minute/index.js": /*!******************************************************!*\ !*** ./node_modules/date-fns/end_of_minute/index.js ***! \******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var parse = __webpack_require__(/*! ../parse/index.js */ \"./node_modules/date-fns/parse/index.js\")\n\n/**\n * @category Minute Helpers\n * @summary Return the end of a minute for the given date.\n *\n * @description\n * Return the end of a minute for the given date.\n * The result will be in the local timezone.\n *\n * @param {Date|String|Number} date - the original date\n * @returns {Date} the end of a minute\n *\n * @example\n * // The end of a minute for 1 December 2014 22:15:45.400:\n * var result = endOfMinute(new Date(2014, 11, 1, 22, 15, 45, 400))\n * //=> Mon Dec 01 2014 22:15:59.999\n */\nfunction endOfMinute (dirtyDate) {\n var date = parse(dirtyDate)\n date.setSeconds(59, 999)\n return date\n}\n\nmodule.exports = endOfMinute\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/end_of_minute/index.js?"); /***/ }), /***/ "./node_modules/date-fns/end_of_month/index.js": /*!*****************************************************!*\ !*** ./node_modules/date-fns/end_of_month/index.js ***! \*****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var parse = __webpack_require__(/*! ../parse/index.js */ \"./node_modules/date-fns/parse/index.js\")\n\n/**\n * @category Month Helpers\n * @summary Return the end of a month for the given date.\n *\n * @description\n * Return the end of a month for the given date.\n * The result will be in the local timezone.\n *\n * @param {Date|String|Number} date - the original date\n * @returns {Date} the end of a month\n *\n * @example\n * // The end of a month for 2 September 2014 11:55:00:\n * var result = endOfMonth(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Tue Sep 30 2014 23:59:59.999\n */\nfunction endOfMonth (dirtyDate) {\n var date = parse(dirtyDate)\n var month = date.getMonth()\n date.setFullYear(date.getFullYear(), month + 1, 0)\n date.setHours(23, 59, 59, 999)\n return date\n}\n\nmodule.exports = endOfMonth\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/end_of_month/index.js?"); /***/ }), /***/ "./node_modules/date-fns/end_of_quarter/index.js": /*!*******************************************************!*\ !*** ./node_modules/date-fns/end_of_quarter/index.js ***! \*******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var parse = __webpack_require__(/*! ../parse/index.js */ \"./node_modules/date-fns/parse/index.js\")\n\n/**\n * @category Quarter Helpers\n * @summary Return the end of a year quarter for the given date.\n *\n * @description\n * Return the end of a year quarter for the given date.\n * The result will be in the local timezone.\n *\n * @param {Date|String|Number} date - the original date\n * @returns {Date} the end of a quarter\n *\n * @example\n * // The end of a quarter for 2 September 2014 11:55:00:\n * var result = endOfQuarter(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Tue Sep 30 2014 23:59:59.999\n */\nfunction endOfQuarter (dirtyDate) {\n var date = parse(dirtyDate)\n var currentMonth = date.getMonth()\n var month = currentMonth - currentMonth % 3 + 3\n date.setMonth(month, 0)\n date.setHours(23, 59, 59, 999)\n return date\n}\n\nmodule.exports = endOfQuarter\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/end_of_quarter/index.js?"); /***/ }), /***/ "./node_modules/date-fns/end_of_second/index.js": /*!******************************************************!*\ !*** ./node_modules/date-fns/end_of_second/index.js ***! \******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var parse = __webpack_require__(/*! ../parse/index.js */ \"./node_modules/date-fns/parse/index.js\")\n\n/**\n * @category Second Helpers\n * @summary Return the end of a second for the given date.\n *\n * @description\n * Return the end of a second for the given date.\n * The result will be in the local timezone.\n *\n * @param {Date|String|Number} date - the original date\n * @returns {Date} the end of a second\n *\n * @example\n * // The end of a second for 1 December 2014 22:15:45.400:\n * var result = endOfSecond(new Date(2014, 11, 1, 22, 15, 45, 400))\n * //=> Mon Dec 01 2014 22:15:45.999\n */\nfunction endOfSecond (dirtyDate) {\n var date = parse(dirtyDate)\n date.setMilliseconds(999)\n return date\n}\n\nmodule.exports = endOfSecond\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/end_of_second/index.js?"); /***/ }), /***/ "./node_modules/date-fns/end_of_today/index.js": /*!*****************************************************!*\ !*** ./node_modules/date-fns/end_of_today/index.js ***! \*****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var endOfDay = __webpack_require__(/*! ../end_of_day/index.js */ \"./node_modules/date-fns/end_of_day/index.js\")\n\n/**\n * @category Day Helpers\n * @summary Return the end of today.\n *\n * @description\n * Return the end of today.\n *\n * @returns {Date} the end of today\n *\n * @example\n * // If today is 6 October 2014:\n * var result = endOfToday()\n * //=> Mon Oct 6 2014 23:59:59.999\n */\nfunction endOfToday () {\n return endOfDay(new Date())\n}\n\nmodule.exports = endOfToday\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/end_of_today/index.js?"); /***/ }), /***/ "./node_modules/date-fns/end_of_tomorrow/index.js": /*!********************************************************!*\ !*** ./node_modules/date-fns/end_of_tomorrow/index.js ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\n * @category Day Helpers\n * @summary Return the end of tomorrow.\n *\n * @description\n * Return the end of tomorrow.\n *\n * @returns {Date} the end of tomorrow\n *\n * @example\n * // If today is 6 October 2014:\n * var result = endOfTomorrow()\n * //=> Tue Oct 7 2014 23:59:59.999\n */\nfunction endOfTomorrow () {\n var now = new Date()\n var year = now.getFullYear()\n var month = now.getMonth()\n var day = now.getDate()\n\n var date = new Date(0)\n date.setFullYear(year, month, day + 1)\n date.setHours(23, 59, 59, 999)\n return date\n}\n\nmodule.exports = endOfTomorrow\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/end_of_tomorrow/index.js?"); /***/ }), /***/ "./node_modules/date-fns/end_of_week/index.js": /*!****************************************************!*\ !*** ./node_modules/date-fns/end_of_week/index.js ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var parse = __webpack_require__(/*! ../parse/index.js */ \"./node_modules/date-fns/parse/index.js\")\n\n/**\n * @category Week Helpers\n * @summary Return the end of a week for the given date.\n *\n * @description\n * Return the end of a week for the given date.\n * The result will be in the local timezone.\n *\n * @param {Date|String|Number} date - the original date\n * @param {Object} [options] - the object with options\n * @param {Number} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)\n * @returns {Date} the end of a week\n *\n * @example\n * // The end of a week for 2 September 2014 11:55:00:\n * var result = endOfWeek(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Sat Sep 06 2014 23:59:59.999\n *\n * @example\n * // If the week starts on Monday, the end of the week for 2 September 2014 11:55:00:\n * var result = endOfWeek(new Date(2014, 8, 2, 11, 55, 0), {weekStartsOn: 1})\n * //=> Sun Sep 07 2014 23:59:59.999\n */\nfunction endOfWeek (dirtyDate, dirtyOptions) {\n var weekStartsOn = dirtyOptions ? (Number(dirtyOptions.weekStartsOn) || 0) : 0\n\n var date = parse(dirtyDate)\n var day = date.getDay()\n var diff = (day < weekStartsOn ? -7 : 0) + 6 - (day - weekStartsOn)\n\n date.setDate(date.getDate() + diff)\n date.setHours(23, 59, 59, 999)\n return date\n}\n\nmodule.exports = endOfWeek\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/end_of_week/index.js?"); /***/ }), /***/ "./node_modules/date-fns/end_of_year/index.js": /*!****************************************************!*\ !*** ./node_modules/date-fns/end_of_year/index.js ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var parse = __webpack_require__(/*! ../parse/index.js */ \"./node_modules/date-fns/parse/index.js\")\n\n/**\n * @category Year Helpers\n * @summary Return the end of a year for the given date.\n *\n * @description\n * Return the end of a year for the given date.\n * The result will be in the local timezone.\n *\n * @param {Date|String|Number} date - the original date\n * @returns {Date} the end of a year\n *\n * @example\n * // The end of a year for 2 September 2014 11:55:00:\n * var result = endOfYear(new Date(2014, 8, 2, 11, 55, 00))\n * //=> Wed Dec 31 2014 23:59:59.999\n */\nfunction endOfYear (dirtyDate) {\n var date = parse(dirtyDate)\n var year = date.getFullYear()\n date.setFullYear(year + 1, 0, 0)\n date.setHours(23, 59, 59, 999)\n return date\n}\n\nmodule.exports = endOfYear\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/end_of_year/index.js?"); /***/ }), /***/ "./node_modules/date-fns/end_of_yesterday/index.js": /*!*********************************************************!*\ !*** ./node_modules/date-fns/end_of_yesterday/index.js ***! \*********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\n * @category Day Helpers\n * @summary Return the end of yesterday.\n *\n * @description\n * Return the end of yesterday.\n *\n * @returns {Date} the end of yesterday\n *\n * @example\n * // If today is 6 October 2014:\n * var result = endOfYesterday()\n * //=> Sun Oct 5 2014 23:59:59.999\n */\nfunction endOfYesterday () {\n var now = new Date()\n var year = now.getFullYear()\n var month = now.getMonth()\n var day = now.getDate()\n\n var date = new Date(0)\n date.setFullYear(year, month, day - 1)\n date.setHours(23, 59, 59, 999)\n return date\n}\n\nmodule.exports = endOfYesterday\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/end_of_yesterday/index.js?"); /***/ }), /***/ "./node_modules/date-fns/format/index.js": /*!***********************************************!*\ !*** ./node_modules/date-fns/format/index.js ***! \***********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var getDayOfYear = __webpack_require__(/*! ../get_day_of_year/index.js */ \"./node_modules/date-fns/get_day_of_year/index.js\")\nvar getISOWeek = __webpack_require__(/*! ../get_iso_week/index.js */ \"./node_modules/date-fns/get_iso_week/index.js\")\nvar getISOYear = __webpack_require__(/*! ../get_iso_year/index.js */ \"./node_modules/date-fns/get_iso_year/index.js\")\nvar parse = __webpack_require__(/*! ../parse/index.js */ \"./node_modules/date-fns/parse/index.js\")\nvar isValid = __webpack_require__(/*! ../is_valid/index.js */ \"./node_modules/date-fns/is_valid/index.js\")\nvar enLocale = __webpack_require__(/*! ../locale/en/index.js */ \"./node_modules/date-fns/locale/en/index.js\")\n\n/**\n * @category Common Helpers\n * @summary Format the date.\n *\n * @description\n * Return the formatted date string in the given format.\n *\n * Accepted tokens:\n * | Unit | Token | Result examples |\n * |-------------------------|-------|----------------------------------|\n * | Month | M | 1, 2, ..., 12 |\n * | | Mo | 1st, 2nd, ..., 12th |\n * | | MM | 01, 02, ..., 12 |\n * | | MMM | Jan, Feb, ..., Dec |\n * | | MMMM | January, February, ..., December |\n * | Quarter | Q | 1, 2, 3, 4 |\n * | | Qo | 1st, 2nd, 3rd, 4th |\n * | Day of month | D | 1, 2, ..., 31 |\n * | | Do | 1st, 2nd, ..., 31st |\n * | | DD | 01, 02, ..., 31 |\n * | Day of year | DDD | 1, 2, ..., 366 |\n * | | DDDo | 1st, 2nd, ..., 366th |\n * | | DDDD | 001, 002, ..., 366 |\n * | Day of week | d | 0, 1, ..., 6 |\n * | | do | 0th, 1st, ..., 6th |\n * | | dd | Su, Mo, ..., Sa |\n * | | ddd | Sun, Mon, ..., Sat |\n * | | dddd | Sunday, Monday, ..., Saturday |\n * | Day of ISO week | E | 1, 2, ..., 7 |\n * | ISO week | W | 1, 2, ..., 53 |\n * | | Wo | 1st, 2nd, ..., 53rd |\n * | | WW | 01, 02, ..., 53 |\n * | Year | YY | 00, 01, ..., 99 |\n * | | YYYY | 1900, 1901, ..., 2099 |\n * | ISO week-numbering year | GG | 00, 01, ..., 99 |\n * | | GGGG | 1900, 1901, ..., 2099 |\n * | AM/PM | A | AM, PM |\n * | | a | am, pm |\n * | | aa | a.m., p.m. |\n * | Hour | H | 0, 1, ... 23 |\n * | | HH | 00, 01, ... 23 |\n * | | h | 1, 2, ..., 12 |\n * | | hh | 01, 02, ..., 12 |\n * | Minute | m | 0, 1, ..., 59 |\n * | | mm | 00, 01, ..., 59 |\n * | Second | s | 0, 1, ..., 59 |\n * | | ss | 00, 01, ..., 59 |\n * | 1/10 of second | S | 0, 1, ..., 9 |\n * | 1/100 of second | SS | 00, 01, ..., 99 |\n * | Millisecond | SSS | 000, 001, ..., 999 |\n * | Timezone | Z | -01:00, +00:00, ... +12:00 |\n * | | ZZ | -0100, +0000, ..., +1200 |\n * | Seconds timestamp | X | 512969520 |\n * | Milliseconds timestamp | x | 512969520900 |\n *\n * The characters wrapped in square brackets are escaped.\n *\n * The result may vary by locale.\n *\n * @param {Date|String|Number} date - the original date\n * @param {String} [format='YYYY-MM-DDTHH:mm:ss.SSSZ'] - the string of tokens\n * @param {Object} [options] - the object with options\n * @param {Object} [options.locale=enLocale] - the locale object\n * @returns {String} the formatted date string\n *\n * @example\n * // Represent 11 February 2014 in middle-endian format:\n * var result = format(\n * new Date(2014, 1, 11),\n * 'MM/DD/YYYY'\n * )\n * //=> '02/11/2014'\n *\n * @example\n * // Represent 2 July 2014 in Esperanto:\n * var eoLocale = require('date-fns/locale/eo')\n * var result = format(\n * new Date(2014, 6, 2),\n * 'Do [de] MMMM YYYY',\n * {locale: eoLocale}\n * )\n * //=> '2-a de julio 2014'\n */\nfunction format (dirtyDate, dirtyFormatStr, dirtyOptions) {\n var formatStr = dirtyFormatStr ? String(dirtyFormatStr) : 'YYYY-MM-DDTHH:mm:ss.SSSZ'\n var options = dirtyOptions || {}\n\n var locale = options.locale\n var localeFormatters = enLocale.format.formatters\n var formattingTokensRegExp = enLocale.format.formattingTokensRegExp\n if (locale && locale.format && locale.format.formatters) {\n localeFormatters = locale.format.formatters\n\n if (locale.format.formattingTokensRegExp) {\n formattingTokensRegExp = locale.format.formattingTokensRegExp\n }\n }\n\n var date = parse(dirtyDate)\n\n if (!isValid(date)) {\n return 'Invalid Date'\n }\n\n var formatFn = buildFormatFn(formatStr, localeFormatters, formattingTokensRegExp)\n\n return formatFn(date)\n}\n\nvar formatters = {\n // Month: 1, 2, ..., 12\n 'M': function (date) {\n return date.getMonth() + 1\n },\n\n // Month: 01, 02, ..., 12\n 'MM': function (date) {\n return addLeadingZeros(date.getMonth() + 1, 2)\n },\n\n // Quarter: 1, 2, 3, 4\n 'Q': function (date) {\n return Math.ceil((date.getMonth() + 1) / 3)\n },\n\n // Day of month: 1, 2, ..., 31\n 'D': function (date) {\n return date.getDate()\n },\n\n // Day of month: 01, 02, ..., 31\n 'DD': function (date) {\n return addLeadingZeros(date.getDate(), 2)\n },\n\n // Day of year: 1, 2, ..., 366\n 'DDD': function (date) {\n return getDayOfYear(date)\n },\n\n // Day of year: 001, 002, ..., 366\n 'DDDD': function (date) {\n return addLeadingZeros(getDayOfYear(date), 3)\n },\n\n // Day of week: 0, 1, ..., 6\n 'd': function (date) {\n return date.getDay()\n },\n\n // Day of ISO week: 1, 2, ..., 7\n 'E': function (date) {\n return date.getDay() || 7\n },\n\n // ISO week: 1, 2, ..., 53\n 'W': function (date) {\n return getISOWeek(date)\n },\n\n // ISO week: 01, 02, ..., 53\n 'WW': function (date) {\n return addLeadingZeros(getISOWeek(date), 2)\n },\n\n // Year: 00, 01, ..., 99\n 'YY': function (date) {\n return addLeadingZeros(date.getFullYear(), 4).substr(2)\n },\n\n // Year: 1900, 1901, ..., 2099\n 'YYYY': function (date) {\n return addLeadingZeros(date.getFullYear(), 4)\n },\n\n // ISO week-numbering year: 00, 01, ..., 99\n 'GG': function (date) {\n return String(getISOYear(date)).substr(2)\n },\n\n // ISO week-numbering year: 1900, 1901, ..., 2099\n 'GGGG': function (date) {\n return getISOYear(date)\n },\n\n // Hour: 0, 1, ... 23\n 'H': function (date) {\n return date.getHours()\n },\n\n // Hour: 00, 01, ..., 23\n 'HH': function (date) {\n return addLeadingZeros(date.getHours(), 2)\n },\n\n // Hour: 1, 2, ..., 12\n 'h': function (date) {\n var hours = date.getHours()\n if (hours === 0) {\n return 12\n } else if (hours > 12) {\n return hours % 12\n } else {\n return hours\n }\n },\n\n // Hour: 01, 02, ..., 12\n 'hh': function (date) {\n return addLeadingZeros(formatters['h'](date), 2)\n },\n\n // Minute: 0, 1, ..., 59\n 'm': function (date) {\n return date.getMinutes()\n },\n\n // Minute: 00, 01, ..., 59\n 'mm': function (date) {\n return addLeadingZeros(date.getMinutes(), 2)\n },\n\n // Second: 0, 1, ..., 59\n 's': function (date) {\n return date.getSeconds()\n },\n\n // Second: 00, 01, ..., 59\n 'ss': function (date) {\n return addLeadingZeros(date.getSeconds(), 2)\n },\n\n // 1/10 of second: 0, 1, ..., 9\n 'S': function (date) {\n return Math.floor(date.getMilliseconds() / 100)\n },\n\n // 1/100 of second: 00, 01, ..., 99\n 'SS': function (date) {\n return addLeadingZeros(Math.floor(date.getMilliseconds() / 10), 2)\n },\n\n // Millisecond: 000, 001, ..., 999\n 'SSS': function (date) {\n return addLeadingZeros(date.getMilliseconds(), 3)\n },\n\n // Timezone: -01:00, +00:00, ... +12:00\n 'Z': function (date) {\n return formatTimezone(date.getTimezoneOffset(), ':')\n },\n\n // Timezone: -0100, +0000, ... +1200\n 'ZZ': function (date) {\n return formatTimezone(date.getTimezoneOffset())\n },\n\n // Seconds timestamp: 512969520\n 'X': function (date) {\n return Math.floor(date.getTime() / 1000)\n },\n\n // Milliseconds timestamp: 512969520900\n 'x': function (date) {\n return date.getTime()\n }\n}\n\nfunction buildFormatFn (formatStr, localeFormatters, formattingTokensRegExp) {\n var array = formatStr.match(formattingTokensRegExp)\n var length = array.length\n\n var i\n var formatter\n for (i = 0; i < length; i++) {\n formatter = localeFormatters[array[i]] || formatters[array[i]]\n if (formatter) {\n array[i] = formatter\n } else {\n array[i] = removeFormattingTokens(array[i])\n }\n }\n\n return function (date) {\n var output = ''\n for (var i = 0; i < length; i++) {\n if (array[i] instanceof Function) {\n output += array[i](date, formatters)\n } else {\n output += array[i]\n }\n }\n return output\n }\n}\n\nfunction removeFormattingTokens (input) {\n if (input.match(/\\[[\\s\\S]/)) {\n return input.replace(/^\\[|]$/g, '')\n }\n return input.replace(/\\\\/g, '')\n}\n\nfunction formatTimezone (offset, delimeter) {\n delimeter = delimeter || ''\n var sign = offset > 0 ? '-' : '+'\n var absOffset = Math.abs(offset)\n var hours = Math.floor(absOffset / 60)\n var minutes = absOffset % 60\n return sign + addLeadingZeros(hours, 2) + delimeter + addLeadingZeros(minutes, 2)\n}\n\nfunction addLeadingZeros (number, targetLength) {\n var output = Math.abs(number).toString()\n while (output.length < targetLength) {\n output = '0' + output\n }\n return output\n}\n\nmodule.exports = format\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/format/index.js?"); /***/ }), /***/ "./node_modules/date-fns/get_date/index.js": /*!*************************************************!*\ !*** ./node_modules/date-fns/get_date/index.js ***! \*************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var parse = __webpack_require__(/*! ../parse/index.js */ \"./node_modules/date-fns/parse/index.js\")\n\n/**\n * @category Day Helpers\n * @summary Get the day of the month of the given date.\n *\n * @description\n * Get the day of the month of the given date.\n *\n * @param {Date|String|Number} date - the given date\n * @returns {Number} the day of month\n *\n * @example\n * // Which day of the month is 29 February 2012?\n * var result = getDate(new Date(2012, 1, 29))\n * //=> 29\n */\nfunction getDate (dirtyDate) {\n var date = parse(dirtyDate)\n var dayOfMonth = date.getDate()\n return dayOfMonth\n}\n\nmodule.exports = getDate\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/get_date/index.js?"); /***/ }), /***/ "./node_modules/date-fns/get_day/index.js": /*!************************************************!*\ !*** ./node_modules/date-fns/get_day/index.js ***! \************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var parse = __webpack_require__(/*! ../parse/index.js */ \"./node_modules/date-fns/parse/index.js\")\n\n/**\n * @category Weekday Helpers\n * @summary Get the day of the week of the given date.\n *\n * @description\n * Get the day of the week of the given date.\n *\n * @param {Date|String|Number} date - the given date\n * @returns {Number} the day of week\n *\n * @example\n * // Which day of the week is 29 February 2012?\n * var result = getDay(new Date(2012, 1, 29))\n * //=> 3\n */\nfunction getDay (dirtyDate) {\n var date = parse(dirtyDate)\n var day = date.getDay()\n return day\n}\n\nmodule.exports = getDay\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/get_day/index.js?"); /***/ }), /***/ "./node_modules/date-fns/get_day_of_year/index.js": /*!********************************************************!*\ !*** ./node_modules/date-fns/get_day_of_year/index.js ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var parse = __webpack_require__(/*! ../parse/index.js */ \"./node_modules/date-fns/parse/index.js\")\nvar startOfYear = __webpack_require__(/*! ../start_of_year/index.js */ \"./node_modules/date-fns/start_of_year/index.js\")\nvar differenceInCalendarDays = __webpack_require__(/*! ../difference_in_calendar_days/index.js */ \"./node_modules/date-fns/difference_in_calendar_days/index.js\")\n\n/**\n * @category Day Helpers\n * @summary Get the day of the year of the given date.\n *\n * @description\n * Get the day of the year of the given date.\n *\n * @param {Date|String|Number} date - the given date\n * @returns {Number} the day of year\n *\n * @example\n * // Which day of the year is 2 July 2014?\n * var result = getDayOfYear(new Date(2014, 6, 2))\n * //=> 183\n */\nfunction getDayOfYear (dirtyDate) {\n var date = parse(dirtyDate)\n var diff = differenceInCalendarDays(date, startOfYear(date))\n var dayOfYear = diff + 1\n return dayOfYear\n}\n\nmodule.exports = getDayOfYear\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/get_day_of_year/index.js?"); /***/ }), /***/ "./node_modules/date-fns/get_days_in_month/index.js": /*!**********************************************************!*\ !*** ./node_modules/date-fns/get_days_in_month/index.js ***! \**********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var parse = __webpack_require__(/*! ../parse/index.js */ \"./node_modules/date-fns/parse/index.js\")\n\n/**\n * @category Month Helpers\n * @summary Get the number of days in a month of the given date.\n *\n * @description\n * Get the number of days in a month of the given date.\n *\n * @param {Date|String|Number} date - the given date\n * @returns {Number} the number of days in a month\n *\n * @example\n * // How many days are in February 2000?\n * var result = getDaysInMonth(new Date(2000, 1))\n * //=> 29\n */\nfunction getDaysInMonth (dirtyDate) {\n var date = parse(dirtyDate)\n var year = date.getFullYear()\n var monthIndex = date.getMonth()\n var lastDayOfMonth = new Date(0)\n lastDayOfMonth.setFullYear(year, monthIndex + 1, 0)\n lastDayOfMonth.setHours(0, 0, 0, 0)\n return lastDayOfMonth.getDate()\n}\n\nmodule.exports = getDaysInMonth\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/get_days_in_month/index.js?"); /***/ }), /***/ "./node_modules/date-fns/get_days_in_year/index.js": /*!*********************************************************!*\ !*** ./node_modules/date-fns/get_days_in_year/index.js ***! \*********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var isLeapYear = __webpack_require__(/*! ../is_leap_year/index.js */ \"./node_modules/date-fns/is_leap_year/index.js\")\n\n/**\n * @category Year Helpers\n * @summary Get the number of days in a year of the given date.\n *\n * @description\n * Get the number of days in a year of the given date.\n *\n * @param {Date|String|Number} date - the given date\n * @returns {Number} the number of days in a year\n *\n * @example\n * // How many days are in 2012?\n * var result = getDaysInYear(new Date(2012, 0, 1))\n * //=> 366\n */\nfunction getDaysInYear (dirtyDate) {\n return isLeapYear(dirtyDate) ? 366 : 365\n}\n\nmodule.exports = getDaysInYear\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/get_days_in_year/index.js?"); /***/ }), /***/ "./node_modules/date-fns/get_hours/index.js": /*!**************************************************!*\ !*** ./node_modules/date-fns/get_hours/index.js ***! \**************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var parse = __webpack_require__(/*! ../parse/index.js */ \"./node_modules/date-fns/parse/index.js\")\n\n/**\n * @category Hour Helpers\n * @summary Get the hours of the given date.\n *\n * @description\n * Get the hours of the given date.\n *\n * @param {Date|String|Number} date - the given date\n * @returns {Number} the hours\n *\n * @example\n * // Get the hours of 29 February 2012 11:45:00:\n * var result = getHours(new Date(2012, 1, 29, 11, 45))\n * //=> 11\n */\nfunction getHours (dirtyDate) {\n var date = parse(dirtyDate)\n var hours = date.getHours()\n return hours\n}\n\nmodule.exports = getHours\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/get_hours/index.js?"); /***/ }), /***/ "./node_modules/date-fns/get_iso_day/index.js": /*!****************************************************!*\ !*** ./node_modules/date-fns/get_iso_day/index.js ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var parse = __webpack_require__(/*! ../parse/index.js */ \"./node_modules/date-fns/parse/index.js\")\n\n/**\n * @category Weekday Helpers\n * @summary Get the day of the ISO week of the given date.\n *\n * @description\n * Get the day of the ISO week of the given date,\n * which is 7 for Sunday, 1 for Monday etc.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @param {Date|String|Number} date - the given date\n * @returns {Number} the day of ISO week\n *\n * @example\n * // Which day of the ISO week is 26 February 2012?\n * var result = getISODay(new Date(2012, 1, 26))\n * //=> 7\n */\nfunction getISODay (dirtyDate) {\n var date = parse(dirtyDate)\n var day = date.getDay()\n\n if (day === 0) {\n day = 7\n }\n\n return day\n}\n\nmodule.exports = getISODay\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/get_iso_day/index.js?"); /***/ }), /***/ "./node_modules/date-fns/get_iso_week/index.js": /*!*****************************************************!*\ !*** ./node_modules/date-fns/get_iso_week/index.js ***! \*****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var parse = __webpack_require__(/*! ../parse/index.js */ \"./node_modules/date-fns/parse/index.js\")\nvar startOfISOWeek = __webpack_require__(/*! ../start_of_iso_week/index.js */ \"./node_modules/date-fns/start_of_iso_week/index.js\")\nvar startOfISOYear = __webpack_require__(/*! ../start_of_iso_year/index.js */ \"./node_modules/date-fns/start_of_iso_year/index.js\")\n\nvar MILLISECONDS_IN_WEEK = 604800000\n\n/**\n * @category ISO Week Helpers\n * @summary Get the ISO week of the given date.\n *\n * @description\n * Get the ISO week of the given date.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @param {Date|String|Number} date - the given date\n * @returns {Number} the ISO week\n *\n * @example\n * // Which week of the ISO-week numbering year is 2 January 2005?\n * var result = getISOWeek(new Date(2005, 0, 2))\n * //=> 53\n */\nfunction getISOWeek (dirtyDate) {\n var date = parse(dirtyDate)\n var diff = startOfISOWeek(date).getTime() - startOfISOYear(date).getTime()\n\n // Round the number of days to the nearest integer\n // because the number of milliseconds in a week is not constant\n // (e.g. it's different in the week of the daylight saving time clock shift)\n return Math.round(diff / MILLISECONDS_IN_WEEK) + 1\n}\n\nmodule.exports = getISOWeek\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/get_iso_week/index.js?"); /***/ }), /***/ "./node_modules/date-fns/get_iso_weeks_in_year/index.js": /*!**************************************************************!*\ !*** ./node_modules/date-fns/get_iso_weeks_in_year/index.js ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var startOfISOYear = __webpack_require__(/*! ../start_of_iso_year/index.js */ \"./node_modules/date-fns/start_of_iso_year/index.js\")\nvar addWeeks = __webpack_require__(/*! ../add_weeks/index.js */ \"./node_modules/date-fns/add_weeks/index.js\")\n\nvar MILLISECONDS_IN_WEEK = 604800000\n\n/**\n * @category ISO Week-Numbering Year Helpers\n * @summary Get the number of weeks in an ISO week-numbering year of the given date.\n *\n * @description\n * Get the number of weeks in an ISO week-numbering year of the given date.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @param {Date|String|Number} date - the given date\n * @returns {Number} the number of ISO weeks in a year\n *\n * @example\n * // How many weeks are in ISO week-numbering year 2015?\n * var result = getISOWeeksInYear(new Date(2015, 1, 11))\n * //=> 53\n */\nfunction getISOWeeksInYear (dirtyDate) {\n var thisYear = startOfISOYear(dirtyDate)\n var nextYear = startOfISOYear(addWeeks(thisYear, 60))\n var diff = nextYear.valueOf() - thisYear.valueOf()\n // Round the number of weeks to the nearest integer\n // because the number of milliseconds in a week is not constant\n // (e.g. it's different in the week of the daylight saving time clock shift)\n return Math.round(diff / MILLISECONDS_IN_WEEK)\n}\n\nmodule.exports = getISOWeeksInYear\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/get_iso_weeks_in_year/index.js?"); /***/ }), /***/ "./node_modules/date-fns/get_iso_year/index.js": /*!*****************************************************!*\ !*** ./node_modules/date-fns/get_iso_year/index.js ***! \*****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var parse = __webpack_require__(/*! ../parse/index.js */ \"./node_modules/date-fns/parse/index.js\")\nvar startOfISOWeek = __webpack_require__(/*! ../start_of_iso_week/index.js */ \"./node_modules/date-fns/start_of_iso_week/index.js\")\n\n/**\n * @category ISO Week-Numbering Year Helpers\n * @summary Get the ISO week-numbering year of the given date.\n *\n * @description\n * Get the ISO week-numbering year of the given date,\n * which always starts 3 days before the year's first Thursday.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @param {Date|String|Number} date - the given date\n * @returns {Number} the ISO week-numbering year\n *\n * @example\n * // Which ISO-week numbering year is 2 January 2005?\n * var result = getISOYear(new Date(2005, 0, 2))\n * //=> 2004\n */\nfunction getISOYear (dirtyDate) {\n var date = parse(dirtyDate)\n var year = date.getFullYear()\n\n var fourthOfJanuaryOfNextYear = new Date(0)\n fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4)\n fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0)\n var startOfNextYear = startOfISOWeek(fourthOfJanuaryOfNextYear)\n\n var fourthOfJanuaryOfThisYear = new Date(0)\n fourthOfJanuaryOfThisYear.setFullYear(year, 0, 4)\n fourthOfJanuaryOfThisYear.setHours(0, 0, 0, 0)\n var startOfThisYear = startOfISOWeek(fourthOfJanuaryOfThisYear)\n\n if (date.getTime() >= startOfNextYear.getTime()) {\n return year + 1\n } else if (date.getTime() >= startOfThisYear.getTime()) {\n return year\n } else {\n return year - 1\n }\n}\n\nmodule.exports = getISOYear\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/get_iso_year/index.js?"); /***/ }), /***/ "./node_modules/date-fns/get_milliseconds/index.js": /*!*********************************************************!*\ !*** ./node_modules/date-fns/get_milliseconds/index.js ***! \*********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var parse = __webpack_require__(/*! ../parse/index.js */ \"./node_modules/date-fns/parse/index.js\")\n\n/**\n * @category Millisecond Helpers\n * @summary Get the milliseconds of the given date.\n *\n * @description\n * Get the milliseconds of the given date.\n *\n * @param {Date|String|Number} date - the given date\n * @returns {Number} the milliseconds\n *\n * @example\n * // Get the milliseconds of 29 February 2012 11:45:05.123:\n * var result = getMilliseconds(new Date(2012, 1, 29, 11, 45, 5, 123))\n * //=> 123\n */\nfunction getMilliseconds (dirtyDate) {\n var date = parse(dirtyDate)\n var milliseconds = date.getMilliseconds()\n return milliseconds\n}\n\nmodule.exports = getMilliseconds\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/get_milliseconds/index.js?"); /***/ }), /***/ "./node_modules/date-fns/get_minutes/index.js": /*!****************************************************!*\ !*** ./node_modules/date-fns/get_minutes/index.js ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var parse = __webpack_require__(/*! ../parse/index.js */ \"./node_modules/date-fns/parse/index.js\")\n\n/**\n * @category Minute Helpers\n * @summary Get the minutes of the given date.\n *\n * @description\n * Get the minutes of the given date.\n *\n * @param {Date|String|Number} date - the given date\n * @returns {Number} the minutes\n *\n * @example\n * // Get the minutes of 29 February 2012 11:45:05:\n * var result = getMinutes(new Date(2012, 1, 29, 11, 45, 5))\n * //=> 45\n */\nfunction getMinutes (dirtyDate) {\n var date = parse(dirtyDate)\n var minutes = date.getMinutes()\n return minutes\n}\n\nmodule.exports = getMinutes\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/get_minutes/index.js?"); /***/ }), /***/ "./node_modules/date-fns/get_month/index.js": /*!**************************************************!*\ !*** ./node_modules/date-fns/get_month/index.js ***! \**************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var parse = __webpack_require__(/*! ../parse/index.js */ \"./node_modules/date-fns/parse/index.js\")\n\n/**\n * @category Month Helpers\n * @summary Get the month of the given date.\n *\n * @description\n * Get the month of the given date.\n *\n * @param {Date|String|Number} date - the given date\n * @returns {Number} the month\n *\n * @example\n * // Which month is 29 February 2012?\n * var result = getMonth(new Date(2012, 1, 29))\n * //=> 1\n */\nfunction getMonth (dirtyDate) {\n var date = parse(dirtyDate)\n var month = date.getMonth()\n return month\n}\n\nmodule.exports = getMonth\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/get_month/index.js?"); /***/ }), /***/ "./node_modules/date-fns/get_overlapping_days_in_ranges/index.js": /*!***********************************************************************!*\ !*** ./node_modules/date-fns/get_overlapping_days_in_ranges/index.js ***! \***********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var parse = __webpack_require__(/*! ../parse/index.js */ \"./node_modules/date-fns/parse/index.js\")\n\nvar MILLISECONDS_IN_DAY = 24 * 60 * 60 * 1000\n\n/**\n * @category Range Helpers\n * @summary Get the number of days that overlap in two date ranges\n *\n * @description\n * Get the number of days that overlap in two date ranges\n *\n * @param {Date|String|Number} initialRangeStartDate - the start of the initial range\n * @param {Date|String|Number} initialRangeEndDate - the end of the initial range\n * @param {Date|String|Number} comparedRangeStartDate - the start of the range to compare it with\n * @param {Date|String|Number} comparedRangeEndDate - the end of the range to compare it with\n * @returns {Number} the number of days that overlap in two date ranges\n * @throws {Error} startDate of a date range cannot be after its endDate\n *\n * @example\n * // For overlapping date ranges adds 1 for each started overlapping day:\n * getOverlappingDaysInRanges(\n * new Date(2014, 0, 10), new Date(2014, 0, 20), new Date(2014, 0, 17), new Date(2014, 0, 21)\n * )\n * //=> 3\n *\n * @example\n * // For non-overlapping date ranges returns 0:\n * getOverlappingDaysInRanges(\n * new Date(2014, 0, 10), new Date(2014, 0, 20), new Date(2014, 0, 21), new Date(2014, 0, 22)\n * )\n * //=> 0\n */\nfunction getOverlappingDaysInRanges (dirtyInitialRangeStartDate, dirtyInitialRangeEndDate, dirtyComparedRangeStartDate, dirtyComparedRangeEndDate) {\n var initialStartTime = parse(dirtyInitialRangeStartDate).getTime()\n var initialEndTime = parse(dirtyInitialRangeEndDate).getTime()\n var comparedStartTime = parse(dirtyComparedRangeStartDate).getTime()\n var comparedEndTime = parse(dirtyComparedRangeEndDate).getTime()\n\n if (initialStartTime > initialEndTime || comparedStartTime > comparedEndTime) {\n throw new Error('The start of the range cannot be after the end of the range')\n }\n\n var isOverlapping = initialStartTime < comparedEndTime && comparedStartTime < initialEndTime\n\n if (!isOverlapping) {\n return 0\n }\n\n var overlapStartDate = comparedStartTime < initialStartTime\n ? initialStartTime\n : comparedStartTime\n\n var overlapEndDate = comparedEndTime > initialEndTime\n ? initialEndTime\n : comparedEndTime\n\n var differenceInMs = overlapEndDate - overlapStartDate\n\n return Math.ceil(differenceInMs / MILLISECONDS_IN_DAY)\n}\n\nmodule.exports = getOverlappingDaysInRanges\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/get_overlapping_days_in_ranges/index.js?"); /***/ }), /***/ "./node_modules/date-fns/get_quarter/index.js": /*!****************************************************!*\ !*** ./node_modules/date-fns/get_quarter/index.js ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var parse = __webpack_require__(/*! ../parse/index.js */ \"./node_modules/date-fns/parse/index.js\")\n\n/**\n * @category Quarter Helpers\n * @summary Get the year quarter of the given date.\n *\n * @description\n * Get the year quarter of the given date.\n *\n * @param {Date|String|Number} date - the given date\n * @returns {Number} the quarter\n *\n * @example\n * // Which quarter is 2 July 2014?\n * var result = getQuarter(new Date(2014, 6, 2))\n * //=> 3\n */\nfunction getQuarter (dirtyDate) {\n var date = parse(dirtyDate)\n var quarter = Math.floor(date.getMonth() / 3) + 1\n return quarter\n}\n\nmodule.exports = getQuarter\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/get_quarter/index.js?"); /***/ }), /***/ "./node_modules/date-fns/get_seconds/index.js": /*!****************************************************!*\ !*** ./node_modules/date-fns/get_seconds/index.js ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var parse = __webpack_require__(/*! ../parse/index.js */ \"./node_modules/date-fns/parse/index.js\")\n\n/**\n * @category Second Helpers\n * @summary Get the seconds of the given date.\n *\n * @description\n * Get the seconds of the given date.\n *\n * @param {Date|String|Number} date - the given date\n * @returns {Number} the seconds\n *\n * @example\n * // Get the seconds of 29 February 2012 11:45:05.123:\n * var result = getSeconds(new Date(2012, 1, 29, 11, 45, 5, 123))\n * //=> 5\n */\nfunction getSeconds (dirtyDate) {\n var date = parse(dirtyDate)\n var seconds = date.getSeconds()\n return seconds\n}\n\nmodule.exports = getSeconds\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/get_seconds/index.js?"); /***/ }), /***/ "./node_modules/date-fns/get_time/index.js": /*!*************************************************!*\ !*** ./node_modules/date-fns/get_time/index.js ***! \*************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var parse = __webpack_require__(/*! ../parse/index.js */ \"./node_modules/date-fns/parse/index.js\")\n\n/**\n * @category Timestamp Helpers\n * @summary Get the milliseconds timestamp of the given date.\n *\n * @description\n * Get the milliseconds timestamp of the given date.\n *\n * @param {Date|String|Number} date - the given date\n * @returns {Number} the timestamp\n *\n * @example\n * // Get the timestamp of 29 February 2012 11:45:05.123:\n * var result = getTime(new Date(2012, 1, 29, 11, 45, 5, 123))\n * //=> 1330515905123\n */\nfunction getTime (dirtyDate) {\n var date = parse(dirtyDate)\n var timestamp = date.getTime()\n return timestamp\n}\n\nmodule.exports = getTime\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/get_time/index.js?"); /***/ }), /***/ "./node_modules/date-fns/get_year/index.js": /*!*************************************************!*\ !*** ./node_modules/date-fns/get_year/index.js ***! \*************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var parse = __webpack_require__(/*! ../parse/index.js */ \"./node_modules/date-fns/parse/index.js\")\n\n/**\n * @category Year Helpers\n * @summary Get the year of the given date.\n *\n * @description\n * Get the year of the given date.\n *\n * @param {Date|String|Number} date - the given date\n * @returns {Number} the year\n *\n * @example\n * // Which year is 2 July 2014?\n * var result = getYear(new Date(2014, 6, 2))\n * //=> 2014\n */\nfunction getYear (dirtyDate) {\n var date = parse(dirtyDate)\n var year = date.getFullYear()\n return year\n}\n\nmodule.exports = getYear\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/get_year/index.js?"); /***/ }), /***/ "./node_modules/date-fns/index.js": /*!****************************************!*\ !*** ./node_modules/date-fns/index.js ***! \****************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("module.exports = {\n addDays: __webpack_require__(/*! ./add_days/index.js */ \"./node_modules/date-fns/add_days/index.js\"),\n addHours: __webpack_require__(/*! ./add_hours/index.js */ \"./node_modules/date-fns/add_hours/index.js\"),\n addISOYears: __webpack_require__(/*! ./add_iso_years/index.js */ \"./node_modules/date-fns/add_iso_years/index.js\"),\n addMilliseconds: __webpack_require__(/*! ./add_milliseconds/index.js */ \"./node_modules/date-fns/add_milliseconds/index.js\"),\n addMinutes: __webpack_require__(/*! ./add_minutes/index.js */ \"./node_modules/date-fns/add_minutes/index.js\"),\n addMonths: __webpack_require__(/*! ./add_months/index.js */ \"./node_modules/date-fns/add_months/index.js\"),\n addQuarters: __webpack_require__(/*! ./add_quarters/index.js */ \"./node_modules/date-fns/add_quarters/index.js\"),\n addSeconds: __webpack_require__(/*! ./add_seconds/index.js */ \"./node_modules/date-fns/add_seconds/index.js\"),\n addWeeks: __webpack_require__(/*! ./add_weeks/index.js */ \"./node_modules/date-fns/add_weeks/index.js\"),\n addYears: __webpack_require__(/*! ./add_years/index.js */ \"./node_modules/date-fns/add_years/index.js\"),\n areRangesOverlapping: __webpack_require__(/*! ./are_ranges_overlapping/index.js */ \"./node_modules/date-fns/are_ranges_overlapping/index.js\"),\n closestIndexTo: __webpack_require__(/*! ./closest_index_to/index.js */ \"./node_modules/date-fns/closest_index_to/index.js\"),\n closestTo: __webpack_require__(/*! ./closest_to/index.js */ \"./node_modules/date-fns/closest_to/index.js\"),\n compareAsc: __webpack_require__(/*! ./compare_asc/index.js */ \"./node_modules/date-fns/compare_asc/index.js\"),\n compareDesc: __webpack_require__(/*! ./compare_desc/index.js */ \"./node_modules/date-fns/compare_desc/index.js\"),\n differenceInCalendarDays: __webpack_require__(/*! ./difference_in_calendar_days/index.js */ \"./node_modules/date-fns/difference_in_calendar_days/index.js\"),\n differenceInCalendarISOWeeks: __webpack_require__(/*! ./difference_in_calendar_iso_weeks/index.js */ \"./node_modules/date-fns/difference_in_calendar_iso_weeks/index.js\"),\n differenceInCalendarISOYears: __webpack_require__(/*! ./difference_in_calendar_iso_years/index.js */ \"./node_modules/date-fns/difference_in_calendar_iso_years/index.js\"),\n differenceInCalendarMonths: __webpack_require__(/*! ./difference_in_calendar_months/index.js */ \"./node_modules/date-fns/difference_in_calendar_months/index.js\"),\n differenceInCalendarQuarters: __webpack_require__(/*! ./difference_in_calendar_quarters/index.js */ \"./node_modules/date-fns/difference_in_calendar_quarters/index.js\"),\n differenceInCalendarWeeks: __webpack_require__(/*! ./difference_in_calendar_weeks/index.js */ \"./node_modules/date-fns/difference_in_calendar_weeks/index.js\"),\n differenceInCalendarYears: __webpack_require__(/*! ./difference_in_calendar_years/index.js */ \"./node_modules/date-fns/difference_in_calendar_years/index.js\"),\n differenceInDays: __webpack_require__(/*! ./difference_in_days/index.js */ \"./node_modules/date-fns/difference_in_days/index.js\"),\n differenceInHours: __webpack_require__(/*! ./difference_in_hours/index.js */ \"./node_modules/date-fns/difference_in_hours/index.js\"),\n differenceInISOYears: __webpack_require__(/*! ./difference_in_iso_years/index.js */ \"./node_modules/date-fns/difference_in_iso_years/index.js\"),\n differenceInMilliseconds: __webpack_require__(/*! ./difference_in_milliseconds/index.js */ \"./node_modules/date-fns/difference_in_milliseconds/index.js\"),\n differenceInMinutes: __webpack_require__(/*! ./difference_in_minutes/index.js */ \"./node_modules/date-fns/difference_in_minutes/index.js\"),\n differenceInMonths: __webpack_require__(/*! ./difference_in_months/index.js */ \"./node_modules/date-fns/difference_in_months/index.js\"),\n differenceInQuarters: __webpack_require__(/*! ./difference_in_quarters/index.js */ \"./node_modules/date-fns/difference_in_quarters/index.js\"),\n differenceInSeconds: __webpack_require__(/*! ./difference_in_seconds/index.js */ \"./node_modules/date-fns/difference_in_seconds/index.js\"),\n differenceInWeeks: __webpack_require__(/*! ./difference_in_weeks/index.js */ \"./node_modules/date-fns/difference_in_weeks/index.js\"),\n differenceInYears: __webpack_require__(/*! ./difference_in_years/index.js */ \"./node_modules/date-fns/difference_in_years/index.js\"),\n distanceInWords: __webpack_require__(/*! ./distance_in_words/index.js */ \"./node_modules/date-fns/distance_in_words/index.js\"),\n distanceInWordsStrict: __webpack_require__(/*! ./distance_in_words_strict/index.js */ \"./node_modules/date-fns/distance_in_words_strict/index.js\"),\n distanceInWordsToNow: __webpack_require__(/*! ./distance_in_words_to_now/index.js */ \"./node_modules/date-fns/distance_in_words_to_now/index.js\"),\n eachDay: __webpack_require__(/*! ./each_day/index.js */ \"./node_modules/date-fns/each_day/index.js\"),\n endOfDay: __webpack_require__(/*! ./end_of_day/index.js */ \"./node_modules/date-fns/end_of_day/index.js\"),\n endOfHour: __webpack_require__(/*! ./end_of_hour/index.js */ \"./node_modules/date-fns/end_of_hour/index.js\"),\n endOfISOWeek: __webpack_require__(/*! ./end_of_iso_week/index.js */ \"./node_modules/date-fns/end_of_iso_week/index.js\"),\n endOfISOYear: __webpack_require__(/*! ./end_of_iso_year/index.js */ \"./node_modules/date-fns/end_of_iso_year/index.js\"),\n endOfMinute: __webpack_require__(/*! ./end_of_minute/index.js */ \"./node_modules/date-fns/end_of_minute/index.js\"),\n endOfMonth: __webpack_require__(/*! ./end_of_month/index.js */ \"./node_modules/date-fns/end_of_month/index.js\"),\n endOfQuarter: __webpack_require__(/*! ./end_of_quarter/index.js */ \"./node_modules/date-fns/end_of_quarter/index.js\"),\n endOfSecond: __webpack_require__(/*! ./end_of_second/index.js */ \"./node_modules/date-fns/end_of_second/index.js\"),\n endOfToday: __webpack_require__(/*! ./end_of_today/index.js */ \"./node_modules/date-fns/end_of_today/index.js\"),\n endOfTomorrow: __webpack_require__(/*! ./end_of_tomorrow/index.js */ \"./node_modules/date-fns/end_of_tomorrow/index.js\"),\n endOfWeek: __webpack_require__(/*! ./end_of_week/index.js */ \"./node_modules/date-fns/end_of_week/index.js\"),\n endOfYear: __webpack_require__(/*! ./end_of_year/index.js */ \"./node_modules/date-fns/end_of_year/index.js\"),\n endOfYesterday: __webpack_require__(/*! ./end_of_yesterday/index.js */ \"./node_modules/date-fns/end_of_yesterday/index.js\"),\n format: __webpack_require__(/*! ./format/index.js */ \"./node_modules/date-fns/format/index.js\"),\n getDate: __webpack_require__(/*! ./get_date/index.js */ \"./node_modules/date-fns/get_date/index.js\"),\n getDay: __webpack_require__(/*! ./get_day/index.js */ \"./node_modules/date-fns/get_day/index.js\"),\n getDayOfYear: __webpack_require__(/*! ./get_day_of_year/index.js */ \"./node_modules/date-fns/get_day_of_year/index.js\"),\n getDaysInMonth: __webpack_require__(/*! ./get_days_in_month/index.js */ \"./node_modules/date-fns/get_days_in_month/index.js\"),\n getDaysInYear: __webpack_require__(/*! ./get_days_in_year/index.js */ \"./node_modules/date-fns/get_days_in_year/index.js\"),\n getHours: __webpack_require__(/*! ./get_hours/index.js */ \"./node_modules/date-fns/get_hours/index.js\"),\n getISODay: __webpack_require__(/*! ./get_iso_day/index.js */ \"./node_modules/date-fns/get_iso_day/index.js\"),\n getISOWeek: __webpack_require__(/*! ./get_iso_week/index.js */ \"./node_modules/date-fns/get_iso_week/index.js\"),\n getISOWeeksInYear: __webpack_require__(/*! ./get_iso_weeks_in_year/index.js */ \"./node_modules/date-fns/get_iso_weeks_in_year/index.js\"),\n getISOYear: __webpack_require__(/*! ./get_iso_year/index.js */ \"./node_modules/date-fns/get_iso_year/index.js\"),\n getMilliseconds: __webpack_require__(/*! ./get_milliseconds/index.js */ \"./node_modules/date-fns/get_milliseconds/index.js\"),\n getMinutes: __webpack_require__(/*! ./get_minutes/index.js */ \"./node_modules/date-fns/get_minutes/index.js\"),\n getMonth: __webpack_require__(/*! ./get_month/index.js */ \"./node_modules/date-fns/get_month/index.js\"),\n getOverlappingDaysInRanges: __webpack_require__(/*! ./get_overlapping_days_in_ranges/index.js */ \"./node_modules/date-fns/get_overlapping_days_in_ranges/index.js\"),\n getQuarter: __webpack_require__(/*! ./get_quarter/index.js */ \"./node_modules/date-fns/get_quarter/index.js\"),\n getSeconds: __webpack_require__(/*! ./get_seconds/index.js */ \"./node_modules/date-fns/get_seconds/index.js\"),\n getTime: __webpack_require__(/*! ./get_time/index.js */ \"./node_modules/date-fns/get_time/index.js\"),\n getYear: __webpack_require__(/*! ./get_year/index.js */ \"./node_modules/date-fns/get_year/index.js\"),\n isAfter: __webpack_require__(/*! ./is_after/index.js */ \"./node_modules/date-fns/is_after/index.js\"),\n isBefore: __webpack_require__(/*! ./is_before/index.js */ \"./node_modules/date-fns/is_before/index.js\"),\n isDate: __webpack_require__(/*! ./is_date/index.js */ \"./node_modules/date-fns/is_date/index.js\"),\n isEqual: __webpack_require__(/*! ./is_equal/index.js */ \"./node_modules/date-fns/is_equal/index.js\"),\n isFirstDayOfMonth: __webpack_require__(/*! ./is_first_day_of_month/index.js */ \"./node_modules/date-fns/is_first_day_of_month/index.js\"),\n isFriday: __webpack_require__(/*! ./is_friday/index.js */ \"./node_modules/date-fns/is_friday/index.js\"),\n isFuture: __webpack_require__(/*! ./is_future/index.js */ \"./node_modules/date-fns/is_future/index.js\"),\n isLastDayOfMonth: __webpack_require__(/*! ./is_last_day_of_month/index.js */ \"./node_modules/date-fns/is_last_day_of_month/index.js\"),\n isLeapYear: __webpack_require__(/*! ./is_leap_year/index.js */ \"./node_modules/date-fns/is_leap_year/index.js\"),\n isMonday: __webpack_require__(/*! ./is_monday/index.js */ \"./node_modules/date-fns/is_monday/index.js\"),\n isPast: __webpack_require__(/*! ./is_past/index.js */ \"./node_modules/date-fns/is_past/index.js\"),\n isSameDay: __webpack_require__(/*! ./is_same_day/index.js */ \"./node_modules/date-fns/is_same_day/index.js\"),\n isSameHour: __webpack_require__(/*! ./is_same_hour/index.js */ \"./node_modules/date-fns/is_same_hour/index.js\"),\n isSameISOWeek: __webpack_require__(/*! ./is_same_iso_week/index.js */ \"./node_modules/date-fns/is_same_iso_week/index.js\"),\n isSameISOYear: __webpack_require__(/*! ./is_same_iso_year/index.js */ \"./node_modules/date-fns/is_same_iso_year/index.js\"),\n isSameMinute: __webpack_require__(/*! ./is_same_minute/index.js */ \"./node_modules/date-fns/is_same_minute/index.js\"),\n isSameMonth: __webpack_require__(/*! ./is_same_month/index.js */ \"./node_modules/date-fns/is_same_month/index.js\"),\n isSameQuarter: __webpack_require__(/*! ./is_same_quarter/index.js */ \"./node_modules/date-fns/is_same_quarter/index.js\"),\n isSameSecond: __webpack_require__(/*! ./is_same_second/index.js */ \"./node_modules/date-fns/is_same_second/index.js\"),\n isSameWeek: __webpack_require__(/*! ./is_same_week/index.js */ \"./node_modules/date-fns/is_same_week/index.js\"),\n isSameYear: __webpack_require__(/*! ./is_same_year/index.js */ \"./node_modules/date-fns/is_same_year/index.js\"),\n isSaturday: __webpack_require__(/*! ./is_saturday/index.js */ \"./node_modules/date-fns/is_saturday/index.js\"),\n isSunday: __webpack_require__(/*! ./is_sunday/index.js */ \"./node_modules/date-fns/is_sunday/index.js\"),\n isThisHour: __webpack_require__(/*! ./is_this_hour/index.js */ \"./node_modules/date-fns/is_this_hour/index.js\"),\n isThisISOWeek: __webpack_require__(/*! ./is_this_iso_week/index.js */ \"./node_modules/date-fns/is_this_iso_week/index.js\"),\n isThisISOYear: __webpack_require__(/*! ./is_this_iso_year/index.js */ \"./node_modules/date-fns/is_this_iso_year/index.js\"),\n isThisMinute: __webpack_require__(/*! ./is_this_minute/index.js */ \"./node_modules/date-fns/is_this_minute/index.js\"),\n isThisMonth: __webpack_require__(/*! ./is_this_month/index.js */ \"./node_modules/date-fns/is_this_month/index.js\"),\n isThisQuarter: __webpack_require__(/*! ./is_this_quarter/index.js */ \"./node_modules/date-fns/is_this_quarter/index.js\"),\n isThisSecond: __webpack_require__(/*! ./is_this_second/index.js */ \"./node_modules/date-fns/is_this_second/index.js\"),\n isThisWeek: __webpack_require__(/*! ./is_this_week/index.js */ \"./node_modules/date-fns/is_this_week/index.js\"),\n isThisYear: __webpack_require__(/*! ./is_this_year/index.js */ \"./node_modules/date-fns/is_this_year/index.js\"),\n isThursday: __webpack_require__(/*! ./is_thursday/index.js */ \"./node_modules/date-fns/is_thursday/index.js\"),\n isToday: __webpack_require__(/*! ./is_today/index.js */ \"./node_modules/date-fns/is_today/index.js\"),\n isTomorrow: __webpack_require__(/*! ./is_tomorrow/index.js */ \"./node_modules/date-fns/is_tomorrow/index.js\"),\n isTuesday: __webpack_require__(/*! ./is_tuesday/index.js */ \"./node_modules/date-fns/is_tuesday/index.js\"),\n isValid: __webpack_require__(/*! ./is_valid/index.js */ \"./node_modules/date-fns/is_valid/index.js\"),\n isWednesday: __webpack_require__(/*! ./is_wednesday/index.js */ \"./node_modules/date-fns/is_wednesday/index.js\"),\n isWeekend: __webpack_require__(/*! ./is_weekend/index.js */ \"./node_modules/date-fns/is_weekend/index.js\"),\n isWithinRange: __webpack_require__(/*! ./is_within_range/index.js */ \"./node_modules/date-fns/is_within_range/index.js\"),\n isYesterday: __webpack_require__(/*! ./is_yesterday/index.js */ \"./node_modules/date-fns/is_yesterday/index.js\"),\n lastDayOfISOWeek: __webpack_require__(/*! ./last_day_of_iso_week/index.js */ \"./node_modules/date-fns/last_day_of_iso_week/index.js\"),\n lastDayOfISOYear: __webpack_require__(/*! ./last_day_of_iso_year/index.js */ \"./node_modules/date-fns/last_day_of_iso_year/index.js\"),\n lastDayOfMonth: __webpack_require__(/*! ./last_day_of_month/index.js */ \"./node_modules/date-fns/last_day_of_month/index.js\"),\n lastDayOfQuarter: __webpack_require__(/*! ./last_day_of_quarter/index.js */ \"./node_modules/date-fns/last_day_of_quarter/index.js\"),\n lastDayOfWeek: __webpack_require__(/*! ./last_day_of_week/index.js */ \"./node_modules/date-fns/last_day_of_week/index.js\"),\n lastDayOfYear: __webpack_require__(/*! ./last_day_of_year/index.js */ \"./node_modules/date-fns/last_day_of_year/index.js\"),\n max: __webpack_require__(/*! ./max/index.js */ \"./node_modules/date-fns/max/index.js\"),\n min: __webpack_require__(/*! ./min/index.js */ \"./node_modules/date-fns/min/index.js\"),\n parse: __webpack_require__(/*! ./parse/index.js */ \"./node_modules/date-fns/parse/index.js\"),\n setDate: __webpack_require__(/*! ./set_date/index.js */ \"./node_modules/date-fns/set_date/index.js\"),\n setDay: __webpack_require__(/*! ./set_day/index.js */ \"./node_modules/date-fns/set_day/index.js\"),\n setDayOfYear: __webpack_require__(/*! ./set_day_of_year/index.js */ \"./node_modules/date-fns/set_day_of_year/index.js\"),\n setHours: __webpack_require__(/*! ./set_hours/index.js */ \"./node_modules/date-fns/set_hours/index.js\"),\n setISODay: __webpack_require__(/*! ./set_iso_day/index.js */ \"./node_modules/date-fns/set_iso_day/index.js\"),\n setISOWeek: __webpack_require__(/*! ./set_iso_week/index.js */ \"./node_modules/date-fns/set_iso_week/index.js\"),\n setISOYear: __webpack_require__(/*! ./set_iso_year/index.js */ \"./node_modules/date-fns/set_iso_year/index.js\"),\n setMilliseconds: __webpack_require__(/*! ./set_milliseconds/index.js */ \"./node_modules/date-fns/set_milliseconds/index.js\"),\n setMinutes: __webpack_require__(/*! ./set_minutes/index.js */ \"./node_modules/date-fns/set_minutes/index.js\"),\n setMonth: __webpack_require__(/*! ./set_month/index.js */ \"./node_modules/date-fns/set_month/index.js\"),\n setQuarter: __webpack_require__(/*! ./set_quarter/index.js */ \"./node_modules/date-fns/set_quarter/index.js\"),\n setSeconds: __webpack_require__(/*! ./set_seconds/index.js */ \"./node_modules/date-fns/set_seconds/index.js\"),\n setYear: __webpack_require__(/*! ./set_year/index.js */ \"./node_modules/date-fns/set_year/index.js\"),\n startOfDay: __webpack_require__(/*! ./start_of_day/index.js */ \"./node_modules/date-fns/start_of_day/index.js\"),\n startOfHour: __webpack_require__(/*! ./start_of_hour/index.js */ \"./node_modules/date-fns/start_of_hour/index.js\"),\n startOfISOWeek: __webpack_require__(/*! ./start_of_iso_week/index.js */ \"./node_modules/date-fns/start_of_iso_week/index.js\"),\n startOfISOYear: __webpack_require__(/*! ./start_of_iso_year/index.js */ \"./node_modules/date-fns/start_of_iso_year/index.js\"),\n startOfMinute: __webpack_require__(/*! ./start_of_minute/index.js */ \"./node_modules/date-fns/start_of_minute/index.js\"),\n startOfMonth: __webpack_require__(/*! ./start_of_month/index.js */ \"./node_modules/date-fns/start_of_month/index.js\"),\n startOfQuarter: __webpack_require__(/*! ./start_of_quarter/index.js */ \"./node_modules/date-fns/start_of_quarter/index.js\"),\n startOfSecond: __webpack_require__(/*! ./start_of_second/index.js */ \"./node_modules/date-fns/start_of_second/index.js\"),\n startOfToday: __webpack_require__(/*! ./start_of_today/index.js */ \"./node_modules/date-fns/start_of_today/index.js\"),\n startOfTomorrow: __webpack_require__(/*! ./start_of_tomorrow/index.js */ \"./node_modules/date-fns/start_of_tomorrow/index.js\"),\n startOfWeek: __webpack_require__(/*! ./start_of_week/index.js */ \"./node_modules/date-fns/start_of_week/index.js\"),\n startOfYear: __webpack_require__(/*! ./start_of_year/index.js */ \"./node_modules/date-fns/start_of_year/index.js\"),\n startOfYesterday: __webpack_require__(/*! ./start_of_yesterday/index.js */ \"./node_modules/date-fns/start_of_yesterday/index.js\"),\n subDays: __webpack_require__(/*! ./sub_days/index.js */ \"./node_modules/date-fns/sub_days/index.js\"),\n subHours: __webpack_require__(/*! ./sub_hours/index.js */ \"./node_modules/date-fns/sub_hours/index.js\"),\n subISOYears: __webpack_require__(/*! ./sub_iso_years/index.js */ \"./node_modules/date-fns/sub_iso_years/index.js\"),\n subMilliseconds: __webpack_require__(/*! ./sub_milliseconds/index.js */ \"./node_modules/date-fns/sub_milliseconds/index.js\"),\n subMinutes: __webpack_require__(/*! ./sub_minutes/index.js */ \"./node_modules/date-fns/sub_minutes/index.js\"),\n subMonths: __webpack_require__(/*! ./sub_months/index.js */ \"./node_modules/date-fns/sub_months/index.js\"),\n subQuarters: __webpack_require__(/*! ./sub_quarters/index.js */ \"./node_modules/date-fns/sub_quarters/index.js\"),\n subSeconds: __webpack_require__(/*! ./sub_seconds/index.js */ \"./node_modules/date-fns/sub_seconds/index.js\"),\n subWeeks: __webpack_require__(/*! ./sub_weeks/index.js */ \"./node_modules/date-fns/sub_weeks/index.js\"),\n subYears: __webpack_require__(/*! ./sub_years/index.js */ \"./node_modules/date-fns/sub_years/index.js\")\n}\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/index.js?"); /***/ }), /***/ "./node_modules/date-fns/is_after/index.js": /*!*************************************************!*\ !*** ./node_modules/date-fns/is_after/index.js ***! \*************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var parse = __webpack_require__(/*! ../parse/index.js */ \"./node_modules/date-fns/parse/index.js\")\n\n/**\n * @category Common Helpers\n * @summary Is the first date after the second one?\n *\n * @description\n * Is the first date after the second one?\n *\n * @param {Date|String|Number} date - the date that should be after the other one to return true\n * @param {Date|String|Number} dateToCompare - the date to compare with\n * @returns {Boolean} the first date is after the second date\n *\n * @example\n * // Is 10 July 1989 after 11 February 1987?\n * var result = isAfter(new Date(1989, 6, 10), new Date(1987, 1, 11))\n * //=> true\n */\nfunction isAfter (dirtyDate, dirtyDateToCompare) {\n var date = parse(dirtyDate)\n var dateToCompare = parse(dirtyDateToCompare)\n return date.getTime() > dateToCompare.getTime()\n}\n\nmodule.exports = isAfter\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/is_after/index.js?"); /***/ }), /***/ "./node_modules/date-fns/is_before/index.js": /*!**************************************************!*\ !*** ./node_modules/date-fns/is_before/index.js ***! \**************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var parse = __webpack_require__(/*! ../parse/index.js */ \"./node_modules/date-fns/parse/index.js\")\n\n/**\n * @category Common Helpers\n * @summary Is the first date before the second one?\n *\n * @description\n * Is the first date before the second one?\n *\n * @param {Date|String|Number} date - the date that should be before the other one to return true\n * @param {Date|String|Number} dateToCompare - the date to compare with\n * @returns {Boolean} the first date is before the second date\n *\n * @example\n * // Is 10 July 1989 before 11 February 1987?\n * var result = isBefore(new Date(1989, 6, 10), new Date(1987, 1, 11))\n * //=> false\n */\nfunction isBefore (dirtyDate, dirtyDateToCompare) {\n var date = parse(dirtyDate)\n var dateToCompare = parse(dirtyDateToCompare)\n return date.getTime() < dateToCompare.getTime()\n}\n\nmodule.exports = isBefore\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/is_before/index.js?"); /***/ }), /***/ "./node_modules/date-fns/is_date/index.js": /*!************************************************!*\ !*** ./node_modules/date-fns/is_date/index.js ***! \************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\n * @category Common Helpers\n * @summary Is the given argument an instance of Date?\n *\n * @description\n * Is the given argument an instance of Date?\n *\n * @param {*} argument - the argument to check\n * @returns {Boolean} the given argument is an instance of Date\n *\n * @example\n * // Is 'mayonnaise' a Date?\n * var result = isDate('mayonnaise')\n * //=> false\n */\nfunction isDate (argument) {\n return argument instanceof Date\n}\n\nmodule.exports = isDate\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/is_date/index.js?"); /***/ }), /***/ "./node_modules/date-fns/is_equal/index.js": /*!*************************************************!*\ !*** ./node_modules/date-fns/is_equal/index.js ***! \*************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var parse = __webpack_require__(/*! ../parse/index.js */ \"./node_modules/date-fns/parse/index.js\")\n\n/**\n * @category Common Helpers\n * @summary Are the given dates equal?\n *\n * @description\n * Are the given dates equal?\n *\n * @param {Date|String|Number} dateLeft - the first date to compare\n * @param {Date|String|Number} dateRight - the second date to compare\n * @returns {Boolean} the dates are equal\n *\n * @example\n * // Are 2 July 2014 06:30:45.000 and 2 July 2014 06:30:45.500 equal?\n * var result = isEqual(\n * new Date(2014, 6, 2, 6, 30, 45, 0)\n * new Date(2014, 6, 2, 6, 30, 45, 500)\n * )\n * //=> false\n */\nfunction isEqual (dirtyLeftDate, dirtyRightDate) {\n var dateLeft = parse(dirtyLeftDate)\n var dateRight = parse(dirtyRightDate)\n return dateLeft.getTime() === dateRight.getTime()\n}\n\nmodule.exports = isEqual\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/is_equal/index.js?"); /***/ }), /***/ "./node_modules/date-fns/is_first_day_of_month/index.js": /*!**************************************************************!*\ !*** ./node_modules/date-fns/is_first_day_of_month/index.js ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var parse = __webpack_require__(/*! ../parse/index.js */ \"./node_modules/date-fns/parse/index.js\")\n\n/**\n * @category Month Helpers\n * @summary Is the given date the first day of a month?\n *\n * @description\n * Is the given date the first day of a month?\n *\n * @param {Date|String|Number} date - the date to check\n * @returns {Boolean} the date is the first day of a month\n *\n * @example\n * // Is 1 September 2014 the first day of a month?\n * var result = isFirstDayOfMonth(new Date(2014, 8, 1))\n * //=> true\n */\nfunction isFirstDayOfMonth (dirtyDate) {\n return parse(dirtyDate).getDate() === 1\n}\n\nmodule.exports = isFirstDayOfMonth\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/is_first_day_of_month/index.js?"); /***/ }), /***/ "./node_modules/date-fns/is_friday/index.js": /*!**************************************************!*\ !*** ./node_modules/date-fns/is_friday/index.js ***! \**************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var parse = __webpack_require__(/*! ../parse/index.js */ \"./node_modules/date-fns/parse/index.js\")\n\n/**\n * @category Weekday Helpers\n * @summary Is the given date Friday?\n *\n * @description\n * Is the given date Friday?\n *\n * @param {Date|String|Number} date - the date to check\n * @returns {Boolean} the date is Friday\n *\n * @example\n * // Is 26 September 2014 Friday?\n * var result = isFriday(new Date(2014, 8, 26))\n * //=> true\n */\nfunction isFriday (dirtyDate) {\n return parse(dirtyDate).getDay() === 5\n}\n\nmodule.exports = isFriday\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/is_friday/index.js?"); /***/ }), /***/ "./node_modules/date-fns/is_future/index.js": /*!**************************************************!*\ !*** ./node_modules/date-fns/is_future/index.js ***! \**************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var parse = __webpack_require__(/*! ../parse/index.js */ \"./node_modules/date-fns/parse/index.js\")\n\n/**\n * @category Common Helpers\n * @summary Is the given date in the future?\n *\n * @description\n * Is the given date in the future?\n *\n * @param {Date|String|Number} date - the date to check\n * @returns {Boolean} the date is in the future\n *\n * @example\n * // If today is 6 October 2014, is 31 December 2014 in the future?\n * var result = isFuture(new Date(2014, 11, 31))\n * //=> true\n */\nfunction isFuture (dirtyDate) {\n return parse(dirtyDate).getTime() > new Date().getTime()\n}\n\nmodule.exports = isFuture\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/is_future/index.js?"); /***/ }), /***/ "./node_modules/date-fns/is_last_day_of_month/index.js": /*!*************************************************************!*\ !*** ./node_modules/date-fns/is_last_day_of_month/index.js ***! \*************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var parse = __webpack_require__(/*! ../parse/index.js */ \"./node_modules/date-fns/parse/index.js\")\nvar endOfDay = __webpack_require__(/*! ../end_of_day/index.js */ \"./node_modules/date-fns/end_of_day/index.js\")\nvar endOfMonth = __webpack_require__(/*! ../end_of_month/index.js */ \"./node_modules/date-fns/end_of_month/index.js\")\n\n/**\n * @category Month Helpers\n * @summary Is the given date the last day of a month?\n *\n * @description\n * Is the given date the last day of a month?\n *\n * @param {Date|String|Number} date - the date to check\n * @returns {Boolean} the date is the last day of a month\n *\n * @example\n * // Is 28 February 2014 the last day of a month?\n * var result = isLastDayOfMonth(new Date(2014, 1, 28))\n * //=> true\n */\nfunction isLastDayOfMonth (dirtyDate) {\n var date = parse(dirtyDate)\n return endOfDay(date).getTime() === endOfMonth(date).getTime()\n}\n\nmodule.exports = isLastDayOfMonth\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/is_last_day_of_month/index.js?"); /***/ }), /***/ "./node_modules/date-fns/is_leap_year/index.js": /*!*****************************************************!*\ !*** ./node_modules/date-fns/is_leap_year/index.js ***! \*****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var parse = __webpack_require__(/*! ../parse/index.js */ \"./node_modules/date-fns/parse/index.js\")\n\n/**\n * @category Year Helpers\n * @summary Is the given date in the leap year?\n *\n * @description\n * Is the given date in the leap year?\n *\n * @param {Date|String|Number} date - the date to check\n * @returns {Boolean} the date is in the leap year\n *\n * @example\n * // Is 1 September 2012 in the leap year?\n * var result = isLeapYear(new Date(2012, 8, 1))\n * //=> true\n */\nfunction isLeapYear (dirtyDate) {\n var date = parse(dirtyDate)\n var year = date.getFullYear()\n return year % 400 === 0 || year % 4 === 0 && year % 100 !== 0\n}\n\nmodule.exports = isLeapYear\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/is_leap_year/index.js?"); /***/ }), /***/ "./node_modules/date-fns/is_monday/index.js": /*!**************************************************!*\ !*** ./node_modules/date-fns/is_monday/index.js ***! \**************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var parse = __webpack_require__(/*! ../parse/index.js */ \"./node_modules/date-fns/parse/index.js\")\n\n/**\n * @category Weekday Helpers\n * @summary Is the given date Monday?\n *\n * @description\n * Is the given date Monday?\n *\n * @param {Date|String|Number} date - the date to check\n * @returns {Boolean} the date is Monday\n *\n * @example\n * // Is 22 September 2014 Monday?\n * var result = isMonday(new Date(2014, 8, 22))\n * //=> true\n */\nfunction isMonday (dirtyDate) {\n return parse(dirtyDate).getDay() === 1\n}\n\nmodule.exports = isMonday\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/is_monday/index.js?"); /***/ }), /***/ "./node_modules/date-fns/is_past/index.js": /*!************************************************!*\ !*** ./node_modules/date-fns/is_past/index.js ***! \************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var parse = __webpack_require__(/*! ../parse/index.js */ \"./node_modules/date-fns/parse/index.js\")\n\n/**\n * @category Common Helpers\n * @summary Is the given date in the past?\n *\n * @description\n * Is the given date in the past?\n *\n * @param {Date|String|Number} date - the date to check\n * @returns {Boolean} the date is in the past\n *\n * @example\n * // If today is 6 October 2014, is 2 July 2014 in the past?\n * var result = isPast(new Date(2014, 6, 2))\n * //=> true\n */\nfunction isPast (dirtyDate) {\n return parse(dirtyDate).getTime() < new Date().getTime()\n}\n\nmodule.exports = isPast\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/is_past/index.js?"); /***/ }), /***/ "./node_modules/date-fns/is_same_day/index.js": /*!****************************************************!*\ !*** ./node_modules/date-fns/is_same_day/index.js ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var startOfDay = __webpack_require__(/*! ../start_of_day/index.js */ \"./node_modules/date-fns/start_of_day/index.js\")\n\n/**\n * @category Day Helpers\n * @summary Are the given dates in the same day?\n *\n * @description\n * Are the given dates in the same day?\n *\n * @param {Date|String|Number} dateLeft - the first date to check\n * @param {Date|String|Number} dateRight - the second date to check\n * @returns {Boolean} the dates are in the same day\n *\n * @example\n * // Are 4 September 06:00:00 and 4 September 18:00:00 in the same day?\n * var result = isSameDay(\n * new Date(2014, 8, 4, 6, 0),\n * new Date(2014, 8, 4, 18, 0)\n * )\n * //=> true\n */\nfunction isSameDay (dirtyDateLeft, dirtyDateRight) {\n var dateLeftStartOfDay = startOfDay(dirtyDateLeft)\n var dateRightStartOfDay = startOfDay(dirtyDateRight)\n\n return dateLeftStartOfDay.getTime() === dateRightStartOfDay.getTime()\n}\n\nmodule.exports = isSameDay\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/is_same_day/index.js?"); /***/ }), /***/ "./node_modules/date-fns/is_same_hour/index.js": /*!*****************************************************!*\ !*** ./node_modules/date-fns/is_same_hour/index.js ***! \*****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var startOfHour = __webpack_require__(/*! ../start_of_hour/index.js */ \"./node_modules/date-fns/start_of_hour/index.js\")\n\n/**\n * @category Hour Helpers\n * @summary Are the given dates in the same hour?\n *\n * @description\n * Are the given dates in the same hour?\n *\n * @param {Date|String|Number} dateLeft - the first date to check\n * @param {Date|String|Number} dateRight - the second date to check\n * @returns {Boolean} the dates are in the same hour\n *\n * @example\n * // Are 4 September 2014 06:00:00 and 4 September 06:30:00 in the same hour?\n * var result = isSameHour(\n * new Date(2014, 8, 4, 6, 0),\n * new Date(2014, 8, 4, 6, 30)\n * )\n * //=> true\n */\nfunction isSameHour (dirtyDateLeft, dirtyDateRight) {\n var dateLeftStartOfHour = startOfHour(dirtyDateLeft)\n var dateRightStartOfHour = startOfHour(dirtyDateRight)\n\n return dateLeftStartOfHour.getTime() === dateRightStartOfHour.getTime()\n}\n\nmodule.exports = isSameHour\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/is_same_hour/index.js?"); /***/ }), /***/ "./node_modules/date-fns/is_same_iso_week/index.js": /*!*********************************************************!*\ !*** ./node_modules/date-fns/is_same_iso_week/index.js ***! \*********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var isSameWeek = __webpack_require__(/*! ../is_same_week/index.js */ \"./node_modules/date-fns/is_same_week/index.js\")\n\n/**\n * @category ISO Week Helpers\n * @summary Are the given dates in the same ISO week?\n *\n * @description\n * Are the given dates in the same ISO week?\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @param {Date|String|Number} dateLeft - the first date to check\n * @param {Date|String|Number} dateRight - the second date to check\n * @returns {Boolean} the dates are in the same ISO week\n *\n * @example\n * // Are 1 September 2014 and 7 September 2014 in the same ISO week?\n * var result = isSameISOWeek(\n * new Date(2014, 8, 1),\n * new Date(2014, 8, 7)\n * )\n * //=> true\n */\nfunction isSameISOWeek (dirtyDateLeft, dirtyDateRight) {\n return isSameWeek(dirtyDateLeft, dirtyDateRight, {weekStartsOn: 1})\n}\n\nmodule.exports = isSameISOWeek\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/is_same_iso_week/index.js?"); /***/ }), /***/ "./node_modules/date-fns/is_same_iso_year/index.js": /*!*********************************************************!*\ !*** ./node_modules/date-fns/is_same_iso_year/index.js ***! \*********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var startOfISOYear = __webpack_require__(/*! ../start_of_iso_year/index.js */ \"./node_modules/date-fns/start_of_iso_year/index.js\")\n\n/**\n * @category ISO Week-Numbering Year Helpers\n * @summary Are the given dates in the same ISO week-numbering year?\n *\n * @description\n * Are the given dates in the same ISO week-numbering year?\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @param {Date|String|Number} dateLeft - the first date to check\n * @param {Date|String|Number} dateRight - the second date to check\n * @returns {Boolean} the dates are in the same ISO week-numbering year\n *\n * @example\n * // Are 29 December 2003 and 2 January 2005 in the same ISO week-numbering year?\n * var result = isSameISOYear(\n * new Date(2003, 11, 29),\n * new Date(2005, 0, 2)\n * )\n * //=> true\n */\nfunction isSameISOYear (dirtyDateLeft, dirtyDateRight) {\n var dateLeftStartOfYear = startOfISOYear(dirtyDateLeft)\n var dateRightStartOfYear = startOfISOYear(dirtyDateRight)\n\n return dateLeftStartOfYear.getTime() === dateRightStartOfYear.getTime()\n}\n\nmodule.exports = isSameISOYear\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/is_same_iso_year/index.js?"); /***/ }), /***/ "./node_modules/date-fns/is_same_minute/index.js": /*!*******************************************************!*\ !*** ./node_modules/date-fns/is_same_minute/index.js ***! \*******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var startOfMinute = __webpack_require__(/*! ../start_of_minute/index.js */ \"./node_modules/date-fns/start_of_minute/index.js\")\n\n/**\n * @category Minute Helpers\n * @summary Are the given dates in the same minute?\n *\n * @description\n * Are the given dates in the same minute?\n *\n * @param {Date|String|Number} dateLeft - the first date to check\n * @param {Date|String|Number} dateRight - the second date to check\n * @returns {Boolean} the dates are in the same minute\n *\n * @example\n * // Are 4 September 2014 06:30:00 and 4 September 2014 06:30:15\n * // in the same minute?\n * var result = isSameMinute(\n * new Date(2014, 8, 4, 6, 30),\n * new Date(2014, 8, 4, 6, 30, 15)\n * )\n * //=> true\n */\nfunction isSameMinute (dirtyDateLeft, dirtyDateRight) {\n var dateLeftStartOfMinute = startOfMinute(dirtyDateLeft)\n var dateRightStartOfMinute = startOfMinute(dirtyDateRight)\n\n return dateLeftStartOfMinute.getTime() === dateRightStartOfMinute.getTime()\n}\n\nmodule.exports = isSameMinute\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/is_same_minute/index.js?"); /***/ }), /***/ "./node_modules/date-fns/is_same_month/index.js": /*!******************************************************!*\ !*** ./node_modules/date-fns/is_same_month/index.js ***! \******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var parse = __webpack_require__(/*! ../parse/index.js */ \"./node_modules/date-fns/parse/index.js\")\n\n/**\n * @category Month Helpers\n * @summary Are the given dates in the same month?\n *\n * @description\n * Are the given dates in the same month?\n *\n * @param {Date|String|Number} dateLeft - the first date to check\n * @param {Date|String|Number} dateRight - the second date to check\n * @returns {Boolean} the dates are in the same month\n *\n * @example\n * // Are 2 September 2014 and 25 September 2014 in the same month?\n * var result = isSameMonth(\n * new Date(2014, 8, 2),\n * new Date(2014, 8, 25)\n * )\n * //=> true\n */\nfunction isSameMonth (dirtyDateLeft, dirtyDateRight) {\n var dateLeft = parse(dirtyDateLeft)\n var dateRight = parse(dirtyDateRight)\n return dateLeft.getFullYear() === dateRight.getFullYear() &&\n dateLeft.getMonth() === dateRight.getMonth()\n}\n\nmodule.exports = isSameMonth\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/is_same_month/index.js?"); /***/ }), /***/ "./node_modules/date-fns/is_same_quarter/index.js": /*!********************************************************!*\ !*** ./node_modules/date-fns/is_same_quarter/index.js ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var startOfQuarter = __webpack_require__(/*! ../start_of_quarter/index.js */ \"./node_modules/date-fns/start_of_quarter/index.js\")\n\n/**\n * @category Quarter Helpers\n * @summary Are the given dates in the same year quarter?\n *\n * @description\n * Are the given dates in the same year quarter?\n *\n * @param {Date|String|Number} dateLeft - the first date to check\n * @param {Date|String|Number} dateRight - the second date to check\n * @returns {Boolean} the dates are in the same quarter\n *\n * @example\n * // Are 1 January 2014 and 8 March 2014 in the same quarter?\n * var result = isSameQuarter(\n * new Date(2014, 0, 1),\n * new Date(2014, 2, 8)\n * )\n * //=> true\n */\nfunction isSameQuarter (dirtyDateLeft, dirtyDateRight) {\n var dateLeftStartOfQuarter = startOfQuarter(dirtyDateLeft)\n var dateRightStartOfQuarter = startOfQuarter(dirtyDateRight)\n\n return dateLeftStartOfQuarter.getTime() === dateRightStartOfQuarter.getTime()\n}\n\nmodule.exports = isSameQuarter\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/is_same_quarter/index.js?"); /***/ }), /***/ "./node_modules/date-fns/is_same_second/index.js": /*!*******************************************************!*\ !*** ./node_modules/date-fns/is_same_second/index.js ***! \*******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var startOfSecond = __webpack_require__(/*! ../start_of_second/index.js */ \"./node_modules/date-fns/start_of_second/index.js\")\n\n/**\n * @category Second Helpers\n * @summary Are the given dates in the same second?\n *\n * @description\n * Are the given dates in the same second?\n *\n * @param {Date|String|Number} dateLeft - the first date to check\n * @param {Date|String|Number} dateRight - the second date to check\n * @returns {Boolean} the dates are in the same second\n *\n * @example\n * // Are 4 September 2014 06:30:15.000 and 4 September 2014 06:30.15.500\n * // in the same second?\n * var result = isSameSecond(\n * new Date(2014, 8, 4, 6, 30, 15),\n * new Date(2014, 8, 4, 6, 30, 15, 500)\n * )\n * //=> true\n */\nfunction isSameSecond (dirtyDateLeft, dirtyDateRight) {\n var dateLeftStartOfSecond = startOfSecond(dirtyDateLeft)\n var dateRightStartOfSecond = startOfSecond(dirtyDateRight)\n\n return dateLeftStartOfSecond.getTime() === dateRightStartOfSecond.getTime()\n}\n\nmodule.exports = isSameSecond\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/is_same_second/index.js?"); /***/ }), /***/ "./node_modules/date-fns/is_same_week/index.js": /*!*****************************************************!*\ !*** ./node_modules/date-fns/is_same_week/index.js ***! \*****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var startOfWeek = __webpack_require__(/*! ../start_of_week/index.js */ \"./node_modules/date-fns/start_of_week/index.js\")\n\n/**\n * @category Week Helpers\n * @summary Are the given dates in the same week?\n *\n * @description\n * Are the given dates in the same week?\n *\n * @param {Date|String|Number} dateLeft - the first date to check\n * @param {Date|String|Number} dateRight - the second date to check\n * @param {Object} [options] - the object with options\n * @param {Number} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)\n * @returns {Boolean} the dates are in the same week\n *\n * @example\n * // Are 31 August 2014 and 4 September 2014 in the same week?\n * var result = isSameWeek(\n * new Date(2014, 7, 31),\n * new Date(2014, 8, 4)\n * )\n * //=> true\n *\n * @example\n * // If week starts with Monday,\n * // are 31 August 2014 and 4 September 2014 in the same week?\n * var result = isSameWeek(\n * new Date(2014, 7, 31),\n * new Date(2014, 8, 4),\n * {weekStartsOn: 1}\n * )\n * //=> false\n */\nfunction isSameWeek (dirtyDateLeft, dirtyDateRight, dirtyOptions) {\n var dateLeftStartOfWeek = startOfWeek(dirtyDateLeft, dirtyOptions)\n var dateRightStartOfWeek = startOfWeek(dirtyDateRight, dirtyOptions)\n\n return dateLeftStartOfWeek.getTime() === dateRightStartOfWeek.getTime()\n}\n\nmodule.exports = isSameWeek\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/is_same_week/index.js?"); /***/ }), /***/ "./node_modules/date-fns/is_same_year/index.js": /*!*****************************************************!*\ !*** ./node_modules/date-fns/is_same_year/index.js ***! \*****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var parse = __webpack_require__(/*! ../parse/index.js */ \"./node_modules/date-fns/parse/index.js\")\n\n/**\n * @category Year Helpers\n * @summary Are the given dates in the same year?\n *\n * @description\n * Are the given dates in the same year?\n *\n * @param {Date|String|Number} dateLeft - the first date to check\n * @param {Date|String|Number} dateRight - the second date to check\n * @returns {Boolean} the dates are in the same year\n *\n * @example\n * // Are 2 September 2014 and 25 September 2014 in the same year?\n * var result = isSameYear(\n * new Date(2014, 8, 2),\n * new Date(2014, 8, 25)\n * )\n * //=> true\n */\nfunction isSameYear (dirtyDateLeft, dirtyDateRight) {\n var dateLeft = parse(dirtyDateLeft)\n var dateRight = parse(dirtyDateRight)\n return dateLeft.getFullYear() === dateRight.getFullYear()\n}\n\nmodule.exports = isSameYear\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/is_same_year/index.js?"); /***/ }), /***/ "./node_modules/date-fns/is_saturday/index.js": /*!****************************************************!*\ !*** ./node_modules/date-fns/is_saturday/index.js ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var parse = __webpack_require__(/*! ../parse/index.js */ \"./node_modules/date-fns/parse/index.js\")\n\n/**\n * @category Weekday Helpers\n * @summary Is the given date Saturday?\n *\n * @description\n * Is the given date Saturday?\n *\n * @param {Date|String|Number} date - the date to check\n * @returns {Boolean} the date is Saturday\n *\n * @example\n * // Is 27 September 2014 Saturday?\n * var result = isSaturday(new Date(2014, 8, 27))\n * //=> true\n */\nfunction isSaturday (dirtyDate) {\n return parse(dirtyDate).getDay() === 6\n}\n\nmodule.exports = isSaturday\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/is_saturday/index.js?"); /***/ }), /***/ "./node_modules/date-fns/is_sunday/index.js": /*!**************************************************!*\ !*** ./node_modules/date-fns/is_sunday/index.js ***! \**************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var parse = __webpack_require__(/*! ../parse/index.js */ \"./node_modules/date-fns/parse/index.js\")\n\n/**\n * @category Weekday Helpers\n * @summary Is the given date Sunday?\n *\n * @description\n * Is the given date Sunday?\n *\n * @param {Date|String|Number} date - the date to check\n * @returns {Boolean} the date is Sunday\n *\n * @example\n * // Is 21 September 2014 Sunday?\n * var result = isSunday(new Date(2014, 8, 21))\n * //=> true\n */\nfunction isSunday (dirtyDate) {\n return parse(dirtyDate).getDay() === 0\n}\n\nmodule.exports = isSunday\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/is_sunday/index.js?"); /***/ }), /***/ "./node_modules/date-fns/is_this_hour/index.js": /*!*****************************************************!*\ !*** ./node_modules/date-fns/is_this_hour/index.js ***! \*****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var isSameHour = __webpack_require__(/*! ../is_same_hour/index.js */ \"./node_modules/date-fns/is_same_hour/index.js\")\n\n/**\n * @category Hour Helpers\n * @summary Is the given date in the same hour as the current date?\n *\n * @description\n * Is the given date in the same hour as the current date?\n *\n * @param {Date|String|Number} date - the date to check\n * @returns {Boolean} the date is in this hour\n *\n * @example\n * // If now is 25 September 2014 18:30:15.500,\n * // is 25 September 2014 18:00:00 in this hour?\n * var result = isThisHour(new Date(2014, 8, 25, 18))\n * //=> true\n */\nfunction isThisHour (dirtyDate) {\n return isSameHour(new Date(), dirtyDate)\n}\n\nmodule.exports = isThisHour\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/is_this_hour/index.js?"); /***/ }), /***/ "./node_modules/date-fns/is_this_iso_week/index.js": /*!*********************************************************!*\ !*** ./node_modules/date-fns/is_this_iso_week/index.js ***! \*********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var isSameISOWeek = __webpack_require__(/*! ../is_same_iso_week/index.js */ \"./node_modules/date-fns/is_same_iso_week/index.js\")\n\n/**\n * @category ISO Week Helpers\n * @summary Is the given date in the same ISO week as the current date?\n *\n * @description\n * Is the given date in the same ISO week as the current date?\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @param {Date|String|Number} date - the date to check\n * @returns {Boolean} the date is in this ISO week\n *\n * @example\n * // If today is 25 September 2014, is 22 September 2014 in this ISO week?\n * var result = isThisISOWeek(new Date(2014, 8, 22))\n * //=> true\n */\nfunction isThisISOWeek (dirtyDate) {\n return isSameISOWeek(new Date(), dirtyDate)\n}\n\nmodule.exports = isThisISOWeek\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/is_this_iso_week/index.js?"); /***/ }), /***/ "./node_modules/date-fns/is_this_iso_year/index.js": /*!*********************************************************!*\ !*** ./node_modules/date-fns/is_this_iso_year/index.js ***! \*********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var isSameISOYear = __webpack_require__(/*! ../is_same_iso_year/index.js */ \"./node_modules/date-fns/is_same_iso_year/index.js\")\n\n/**\n * @category ISO Week-Numbering Year Helpers\n * @summary Is the given date in the same ISO week-numbering year as the current date?\n *\n * @description\n * Is the given date in the same ISO week-numbering year as the current date?\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @param {Date|String|Number} date - the date to check\n * @returns {Boolean} the date is in this ISO week-numbering year\n *\n * @example\n * // If today is 25 September 2014,\n * // is 30 December 2013 in this ISO week-numbering year?\n * var result = isThisISOYear(new Date(2013, 11, 30))\n * //=> true\n */\nfunction isThisISOYear (dirtyDate) {\n return isSameISOYear(new Date(), dirtyDate)\n}\n\nmodule.exports = isThisISOYear\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/is_this_iso_year/index.js?"); /***/ }), /***/ "./node_modules/date-fns/is_this_minute/index.js": /*!*******************************************************!*\ !*** ./node_modules/date-fns/is_this_minute/index.js ***! \*******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var isSameMinute = __webpack_require__(/*! ../is_same_minute/index.js */ \"./node_modules/date-fns/is_same_minute/index.js\")\n\n/**\n * @category Minute Helpers\n * @summary Is the given date in the same minute as the current date?\n *\n * @description\n * Is the given date in the same minute as the current date?\n *\n * @param {Date|String|Number} date - the date to check\n * @returns {Boolean} the date is in this minute\n *\n * @example\n * // If now is 25 September 2014 18:30:15.500,\n * // is 25 September 2014 18:30:00 in this minute?\n * var result = isThisMinute(new Date(2014, 8, 25, 18, 30))\n * //=> true\n */\nfunction isThisMinute (dirtyDate) {\n return isSameMinute(new Date(), dirtyDate)\n}\n\nmodule.exports = isThisMinute\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/is_this_minute/index.js?"); /***/ }), /***/ "./node_modules/date-fns/is_this_month/index.js": /*!******************************************************!*\ !*** ./node_modules/date-fns/is_this_month/index.js ***! \******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var isSameMonth = __webpack_require__(/*! ../is_same_month/index.js */ \"./node_modules/date-fns/is_same_month/index.js\")\n\n/**\n * @category Month Helpers\n * @summary Is the given date in the same month as the current date?\n *\n * @description\n * Is the given date in the same month as the current date?\n *\n * @param {Date|String|Number} date - the date to check\n * @returns {Boolean} the date is in this month\n *\n * @example\n * // If today is 25 September 2014, is 15 September 2014 in this month?\n * var result = isThisMonth(new Date(2014, 8, 15))\n * //=> true\n */\nfunction isThisMonth (dirtyDate) {\n return isSameMonth(new Date(), dirtyDate)\n}\n\nmodule.exports = isThisMonth\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/is_this_month/index.js?"); /***/ }), /***/ "./node_modules/date-fns/is_this_quarter/index.js": /*!********************************************************!*\ !*** ./node_modules/date-fns/is_this_quarter/index.js ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var isSameQuarter = __webpack_require__(/*! ../is_same_quarter/index.js */ \"./node_modules/date-fns/is_same_quarter/index.js\")\n\n/**\n * @category Quarter Helpers\n * @summary Is the given date in the same quarter as the current date?\n *\n * @description\n * Is the given date in the same quarter as the current date?\n *\n * @param {Date|String|Number} date - the date to check\n * @returns {Boolean} the date is in this quarter\n *\n * @example\n * // If today is 25 September 2014, is 2 July 2014 in this quarter?\n * var result = isThisQuarter(new Date(2014, 6, 2))\n * //=> true\n */\nfunction isThisQuarter (dirtyDate) {\n return isSameQuarter(new Date(), dirtyDate)\n}\n\nmodule.exports = isThisQuarter\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/is_this_quarter/index.js?"); /***/ }), /***/ "./node_modules/date-fns/is_this_second/index.js": /*!*******************************************************!*\ !*** ./node_modules/date-fns/is_this_second/index.js ***! \*******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var isSameSecond = __webpack_require__(/*! ../is_same_second/index.js */ \"./node_modules/date-fns/is_same_second/index.js\")\n\n/**\n * @category Second Helpers\n * @summary Is the given date in the same second as the current date?\n *\n * @description\n * Is the given date in the same second as the current date?\n *\n * @param {Date|String|Number} date - the date to check\n * @returns {Boolean} the date is in this second\n *\n * @example\n * // If now is 25 September 2014 18:30:15.500,\n * // is 25 September 2014 18:30:15.000 in this second?\n * var result = isThisSecond(new Date(2014, 8, 25, 18, 30, 15))\n * //=> true\n */\nfunction isThisSecond (dirtyDate) {\n return isSameSecond(new Date(), dirtyDate)\n}\n\nmodule.exports = isThisSecond\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/is_this_second/index.js?"); /***/ }), /***/ "./node_modules/date-fns/is_this_week/index.js": /*!*****************************************************!*\ !*** ./node_modules/date-fns/is_this_week/index.js ***! \*****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var isSameWeek = __webpack_require__(/*! ../is_same_week/index.js */ \"./node_modules/date-fns/is_same_week/index.js\")\n\n/**\n * @category Week Helpers\n * @summary Is the given date in the same week as the current date?\n *\n * @description\n * Is the given date in the same week as the current date?\n *\n * @param {Date|String|Number} date - the date to check\n * @param {Object} [options] - the object with options\n * @param {Number} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)\n * @returns {Boolean} the date is in this week\n *\n * @example\n * // If today is 25 September 2014, is 21 September 2014 in this week?\n * var result = isThisWeek(new Date(2014, 8, 21))\n * //=> true\n *\n * @example\n * // If today is 25 September 2014 and week starts with Monday\n * // is 21 September 2014 in this week?\n * var result = isThisWeek(new Date(2014, 8, 21), {weekStartsOn: 1})\n * //=> false\n */\nfunction isThisWeek (dirtyDate, dirtyOptions) {\n return isSameWeek(new Date(), dirtyDate, dirtyOptions)\n}\n\nmodule.exports = isThisWeek\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/is_this_week/index.js?"); /***/ }), /***/ "./node_modules/date-fns/is_this_year/index.js": /*!*****************************************************!*\ !*** ./node_modules/date-fns/is_this_year/index.js ***! \*****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var isSameYear = __webpack_require__(/*! ../is_same_year/index.js */ \"./node_modules/date-fns/is_same_year/index.js\")\n\n/**\n * @category Year Helpers\n * @summary Is the given date in the same year as the current date?\n *\n * @description\n * Is the given date in the same year as the current date?\n *\n * @param {Date|String|Number} date - the date to check\n * @returns {Boolean} the date is in this year\n *\n * @example\n * // If today is 25 September 2014, is 2 July 2014 in this year?\n * var result = isThisYear(new Date(2014, 6, 2))\n * //=> true\n */\nfunction isThisYear (dirtyDate) {\n return isSameYear(new Date(), dirtyDate)\n}\n\nmodule.exports = isThisYear\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/is_this_year/index.js?"); /***/ }), /***/ "./node_modules/date-fns/is_thursday/index.js": /*!****************************************************!*\ !*** ./node_modules/date-fns/is_thursday/index.js ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var parse = __webpack_require__(/*! ../parse/index.js */ \"./node_modules/date-fns/parse/index.js\")\n\n/**\n * @category Weekday Helpers\n * @summary Is the given date Thursday?\n *\n * @description\n * Is the given date Thursday?\n *\n * @param {Date|String|Number} date - the date to check\n * @returns {Boolean} the date is Thursday\n *\n * @example\n * // Is 25 September 2014 Thursday?\n * var result = isThursday(new Date(2014, 8, 25))\n * //=> true\n */\nfunction isThursday (dirtyDate) {\n return parse(dirtyDate).getDay() === 4\n}\n\nmodule.exports = isThursday\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/is_thursday/index.js?"); /***/ }), /***/ "./node_modules/date-fns/is_today/index.js": /*!*************************************************!*\ !*** ./node_modules/date-fns/is_today/index.js ***! \*************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var startOfDay = __webpack_require__(/*! ../start_of_day/index.js */ \"./node_modules/date-fns/start_of_day/index.js\")\n\n/**\n * @category Day Helpers\n * @summary Is the given date today?\n *\n * @description\n * Is the given date today?\n *\n * @param {Date|String|Number} date - the date to check\n * @returns {Boolean} the date is today\n *\n * @example\n * // If today is 6 October 2014, is 6 October 14:00:00 today?\n * var result = isToday(new Date(2014, 9, 6, 14, 0))\n * //=> true\n */\nfunction isToday (dirtyDate) {\n return startOfDay(dirtyDate).getTime() === startOfDay(new Date()).getTime()\n}\n\nmodule.exports = isToday\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/is_today/index.js?"); /***/ }), /***/ "./node_modules/date-fns/is_tomorrow/index.js": /*!****************************************************!*\ !*** ./node_modules/date-fns/is_tomorrow/index.js ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var startOfDay = __webpack_require__(/*! ../start_of_day/index.js */ \"./node_modules/date-fns/start_of_day/index.js\")\n\n/**\n * @category Day Helpers\n * @summary Is the given date tomorrow?\n *\n * @description\n * Is the given date tomorrow?\n *\n * @param {Date|String|Number} date - the date to check\n * @returns {Boolean} the date is tomorrow\n *\n * @example\n * // If today is 6 October 2014, is 7 October 14:00:00 tomorrow?\n * var result = isTomorrow(new Date(2014, 9, 7, 14, 0))\n * //=> true\n */\nfunction isTomorrow (dirtyDate) {\n var tomorrow = new Date()\n tomorrow.setDate(tomorrow.getDate() + 1)\n return startOfDay(dirtyDate).getTime() === startOfDay(tomorrow).getTime()\n}\n\nmodule.exports = isTomorrow\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/is_tomorrow/index.js?"); /***/ }), /***/ "./node_modules/date-fns/is_tuesday/index.js": /*!***************************************************!*\ !*** ./node_modules/date-fns/is_tuesday/index.js ***! \***************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var parse = __webpack_require__(/*! ../parse/index.js */ \"./node_modules/date-fns/parse/index.js\")\n\n/**\n * @category Weekday Helpers\n * @summary Is the given date Tuesday?\n *\n * @description\n * Is the given date Tuesday?\n *\n * @param {Date|String|Number} date - the date to check\n * @returns {Boolean} the date is Tuesday\n *\n * @example\n * // Is 23 September 2014 Tuesday?\n * var result = isTuesday(new Date(2014, 8, 23))\n * //=> true\n */\nfunction isTuesday (dirtyDate) {\n return parse(dirtyDate).getDay() === 2\n}\n\nmodule.exports = isTuesday\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/is_tuesday/index.js?"); /***/ }), /***/ "./node_modules/date-fns/is_valid/index.js": /*!*************************************************!*\ !*** ./node_modules/date-fns/is_valid/index.js ***! \*************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var isDate = __webpack_require__(/*! ../is_date/index.js */ \"./node_modules/date-fns/is_date/index.js\")\n\n/**\n * @category Common Helpers\n * @summary Is the given date valid?\n *\n * @description\n * Returns false if argument is Invalid Date and true otherwise.\n * Invalid Date is a Date, whose time value is NaN.\n *\n * Time value of Date: http://es5.github.io/#x15.9.1.1\n *\n * @param {Date} date - the date to check\n * @returns {Boolean} the date is valid\n * @throws {TypeError} argument must be an instance of Date\n *\n * @example\n * // For the valid date:\n * var result = isValid(new Date(2014, 1, 31))\n * //=> true\n *\n * @example\n * // For the invalid date:\n * var result = isValid(new Date(''))\n * //=> false\n */\nfunction isValid (dirtyDate) {\n if (isDate(dirtyDate)) {\n return !isNaN(dirtyDate)\n } else {\n throw new TypeError(toString.call(dirtyDate) + ' is not an instance of Date')\n }\n}\n\nmodule.exports = isValid\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/is_valid/index.js?"); /***/ }), /***/ "./node_modules/date-fns/is_wednesday/index.js": /*!*****************************************************!*\ !*** ./node_modules/date-fns/is_wednesday/index.js ***! \*****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var parse = __webpack_require__(/*! ../parse/index.js */ \"./node_modules/date-fns/parse/index.js\")\n\n/**\n * @category Weekday Helpers\n * @summary Is the given date Wednesday?\n *\n * @description\n * Is the given date Wednesday?\n *\n * @param {Date|String|Number} date - the date to check\n * @returns {Boolean} the date is Wednesday\n *\n * @example\n * // Is 24 September 2014 Wednesday?\n * var result = isWednesday(new Date(2014, 8, 24))\n * //=> true\n */\nfunction isWednesday (dirtyDate) {\n return parse(dirtyDate).getDay() === 3\n}\n\nmodule.exports = isWednesday\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/is_wednesday/index.js?"); /***/ }), /***/ "./node_modules/date-fns/is_weekend/index.js": /*!***************************************************!*\ !*** ./node_modules/date-fns/is_weekend/index.js ***! \***************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var parse = __webpack_require__(/*! ../parse/index.js */ \"./node_modules/date-fns/parse/index.js\")\n\n/**\n * @category Weekday Helpers\n * @summary Does the given date fall on a weekend?\n *\n * @description\n * Does the given date fall on a weekend?\n *\n * @param {Date|String|Number} date - the date to check\n * @returns {Boolean} the date falls on a weekend\n *\n * @example\n * // Does 5 October 2014 fall on a weekend?\n * var result = isWeekend(new Date(2014, 9, 5))\n * //=> true\n */\nfunction isWeekend (dirtyDate) {\n var date = parse(dirtyDate)\n var day = date.getDay()\n return day === 0 || day === 6\n}\n\nmodule.exports = isWeekend\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/is_weekend/index.js?"); /***/ }), /***/ "./node_modules/date-fns/is_within_range/index.js": /*!********************************************************!*\ !*** ./node_modules/date-fns/is_within_range/index.js ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var parse = __webpack_require__(/*! ../parse/index.js */ \"./node_modules/date-fns/parse/index.js\")\n\n/**\n * @category Range Helpers\n * @summary Is the given date within the range?\n *\n * @description\n * Is the given date within the range?\n *\n * @param {Date|String|Number} date - the date to check\n * @param {Date|String|Number} startDate - the start of range\n * @param {Date|String|Number} endDate - the end of range\n * @returns {Boolean} the date is within the range\n * @throws {Error} startDate cannot be after endDate\n *\n * @example\n * // For the date within the range:\n * isWithinRange(\n * new Date(2014, 0, 3), new Date(2014, 0, 1), new Date(2014, 0, 7)\n * )\n * //=> true\n *\n * @example\n * // For the date outside of the range:\n * isWithinRange(\n * new Date(2014, 0, 10), new Date(2014, 0, 1), new Date(2014, 0, 7)\n * )\n * //=> false\n */\nfunction isWithinRange (dirtyDate, dirtyStartDate, dirtyEndDate) {\n var time = parse(dirtyDate).getTime()\n var startTime = parse(dirtyStartDate).getTime()\n var endTime = parse(dirtyEndDate).getTime()\n\n if (startTime > endTime) {\n throw new Error('The start of the range cannot be after the end of the range')\n }\n\n return time >= startTime && time <= endTime\n}\n\nmodule.exports = isWithinRange\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/is_within_range/index.js?"); /***/ }), /***/ "./node_modules/date-fns/is_yesterday/index.js": /*!*****************************************************!*\ !*** ./node_modules/date-fns/is_yesterday/index.js ***! \*****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var startOfDay = __webpack_require__(/*! ../start_of_day/index.js */ \"./node_modules/date-fns/start_of_day/index.js\")\n\n/**\n * @category Day Helpers\n * @summary Is the given date yesterday?\n *\n * @description\n * Is the given date yesterday?\n *\n * @param {Date|String|Number} date - the date to check\n * @returns {Boolean} the date is yesterday\n *\n * @example\n * // If today is 6 October 2014, is 5 October 14:00:00 yesterday?\n * var result = isYesterday(new Date(2014, 9, 5, 14, 0))\n * //=> true\n */\nfunction isYesterday (dirtyDate) {\n var yesterday = new Date()\n yesterday.setDate(yesterday.getDate() - 1)\n return startOfDay(dirtyDate).getTime() === startOfDay(yesterday).getTime()\n}\n\nmodule.exports = isYesterday\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/is_yesterday/index.js?"); /***/ }), /***/ "./node_modules/date-fns/last_day_of_iso_week/index.js": /*!*************************************************************!*\ !*** ./node_modules/date-fns/last_day_of_iso_week/index.js ***! \*************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var lastDayOfWeek = __webpack_require__(/*! ../last_day_of_week/index.js */ \"./node_modules/date-fns/last_day_of_week/index.js\")\n\n/**\n * @category ISO Week Helpers\n * @summary Return the last day of an ISO week for the given date.\n *\n * @description\n * Return the last day of an ISO week for the given date.\n * The result will be in the local timezone.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @param {Date|String|Number} date - the original date\n * @returns {Date} the last day of an ISO week\n *\n * @example\n * // The last day of an ISO week for 2 September 2014 11:55:00:\n * var result = lastDayOfISOWeek(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Sun Sep 07 2014 00:00:00\n */\nfunction lastDayOfISOWeek (dirtyDate) {\n return lastDayOfWeek(dirtyDate, {weekStartsOn: 1})\n}\n\nmodule.exports = lastDayOfISOWeek\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/last_day_of_iso_week/index.js?"); /***/ }), /***/ "./node_modules/date-fns/last_day_of_iso_year/index.js": /*!*************************************************************!*\ !*** ./node_modules/date-fns/last_day_of_iso_year/index.js ***! \*************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var getISOYear = __webpack_require__(/*! ../get_iso_year/index.js */ \"./node_modules/date-fns/get_iso_year/index.js\")\nvar startOfISOWeek = __webpack_require__(/*! ../start_of_iso_week/index.js */ \"./node_modules/date-fns/start_of_iso_week/index.js\")\n\n/**\n * @category ISO Week-Numbering Year Helpers\n * @summary Return the last day of an ISO week-numbering year for the given date.\n *\n * @description\n * Return the last day of an ISO week-numbering year,\n * which always starts 3 days before the year's first Thursday.\n * The result will be in the local timezone.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @param {Date|String|Number} date - the original date\n * @returns {Date} the end of an ISO week-numbering year\n *\n * @example\n * // The last day of an ISO week-numbering year for 2 July 2005:\n * var result = lastDayOfISOYear(new Date(2005, 6, 2))\n * //=> Sun Jan 01 2006 00:00:00\n */\nfunction lastDayOfISOYear (dirtyDate) {\n var year = getISOYear(dirtyDate)\n var fourthOfJanuary = new Date(0)\n fourthOfJanuary.setFullYear(year + 1, 0, 4)\n fourthOfJanuary.setHours(0, 0, 0, 0)\n var date = startOfISOWeek(fourthOfJanuary)\n date.setDate(date.getDate() - 1)\n return date\n}\n\nmodule.exports = lastDayOfISOYear\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/last_day_of_iso_year/index.js?"); /***/ }), /***/ "./node_modules/date-fns/last_day_of_month/index.js": /*!**********************************************************!*\ !*** ./node_modules/date-fns/last_day_of_month/index.js ***! \**********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var parse = __webpack_require__(/*! ../parse/index.js */ \"./node_modules/date-fns/parse/index.js\")\n\n/**\n * @category Month Helpers\n * @summary Return the last day of a month for the given date.\n *\n * @description\n * Return the last day of a month for the given date.\n * The result will be in the local timezone.\n *\n * @param {Date|String|Number} date - the original date\n * @returns {Date} the last day of a month\n *\n * @example\n * // The last day of a month for 2 September 2014 11:55:00:\n * var result = lastDayOfMonth(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Tue Sep 30 2014 00:00:00\n */\nfunction lastDayOfMonth (dirtyDate) {\n var date = parse(dirtyDate)\n var month = date.getMonth()\n date.setFullYear(date.getFullYear(), month + 1, 0)\n date.setHours(0, 0, 0, 0)\n return date\n}\n\nmodule.exports = lastDayOfMonth\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/last_day_of_month/index.js?"); /***/ }), /***/ "./node_modules/date-fns/last_day_of_quarter/index.js": /*!************************************************************!*\ !*** ./node_modules/date-fns/last_day_of_quarter/index.js ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var parse = __webpack_require__(/*! ../parse/index.js */ \"./node_modules/date-fns/parse/index.js\")\n\n/**\n * @category Quarter Helpers\n * @summary Return the last day of a year quarter for the given date.\n *\n * @description\n * Return the last day of a year quarter for the given date.\n * The result will be in the local timezone.\n *\n * @param {Date|String|Number} date - the original date\n * @returns {Date} the last day of a quarter\n *\n * @example\n * // The last day of a quarter for 2 September 2014 11:55:00:\n * var result = lastDayOfQuarter(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Tue Sep 30 2014 00:00:00\n */\nfunction lastDayOfQuarter (dirtyDate) {\n var date = parse(dirtyDate)\n var currentMonth = date.getMonth()\n var month = currentMonth - currentMonth % 3 + 3\n date.setMonth(month, 0)\n date.setHours(0, 0, 0, 0)\n return date\n}\n\nmodule.exports = lastDayOfQuarter\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/last_day_of_quarter/index.js?"); /***/ }), /***/ "./node_modules/date-fns/last_day_of_week/index.js": /*!*********************************************************!*\ !*** ./node_modules/date-fns/last_day_of_week/index.js ***! \*********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var parse = __webpack_require__(/*! ../parse/index.js */ \"./node_modules/date-fns/parse/index.js\")\n\n/**\n * @category Week Helpers\n * @summary Return the last day of a week for the given date.\n *\n * @description\n * Return the last day of a week for the given date.\n * The result will be in the local timezone.\n *\n * @param {Date|String|Number} date - the original date\n * @param {Object} [options] - the object with options\n * @param {Number} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)\n * @returns {Date} the last day of a week\n *\n * @example\n * // The last day of a week for 2 September 2014 11:55:00:\n * var result = lastDayOfWeek(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Sat Sep 06 2014 00:00:00\n *\n * @example\n * // If the week starts on Monday, the last day of the week for 2 September 2014 11:55:00:\n * var result = lastDayOfWeek(new Date(2014, 8, 2, 11, 55, 0), {weekStartsOn: 1})\n * //=> Sun Sep 07 2014 00:00:00\n */\nfunction lastDayOfWeek (dirtyDate, dirtyOptions) {\n var weekStartsOn = dirtyOptions ? (Number(dirtyOptions.weekStartsOn) || 0) : 0\n\n var date = parse(dirtyDate)\n var day = date.getDay()\n var diff = (day < weekStartsOn ? -7 : 0) + 6 - (day - weekStartsOn)\n\n date.setHours(0, 0, 0, 0)\n date.setDate(date.getDate() + diff)\n return date\n}\n\nmodule.exports = lastDayOfWeek\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/last_day_of_week/index.js?"); /***/ }), /***/ "./node_modules/date-fns/last_day_of_year/index.js": /*!*********************************************************!*\ !*** ./node_modules/date-fns/last_day_of_year/index.js ***! \*********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var parse = __webpack_require__(/*! ../parse/index.js */ \"./node_modules/date-fns/parse/index.js\")\n\n/**\n * @category Year Helpers\n * @summary Return the last day of a year for the given date.\n *\n * @description\n * Return the last day of a year for the given date.\n * The result will be in the local timezone.\n *\n * @param {Date|String|Number} date - the original date\n * @returns {Date} the last day of a year\n *\n * @example\n * // The last day of a year for 2 September 2014 11:55:00:\n * var result = lastDayOfYear(new Date(2014, 8, 2, 11, 55, 00))\n * //=> Wed Dec 31 2014 00:00:00\n */\nfunction lastDayOfYear (dirtyDate) {\n var date = parse(dirtyDate)\n var year = date.getFullYear()\n date.setFullYear(year + 1, 0, 0)\n date.setHours(0, 0, 0, 0)\n return date\n}\n\nmodule.exports = lastDayOfYear\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/last_day_of_year/index.js?"); /***/ }), /***/ "./node_modules/date-fns/locale/_lib/build_formatting_tokens_reg_exp/index.js": /*!************************************************************************************!*\ !*** ./node_modules/date-fns/locale/_lib/build_formatting_tokens_reg_exp/index.js ***! \************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("var commonFormatterKeys = [\n 'M', 'MM', 'Q', 'D', 'DD', 'DDD', 'DDDD', 'd',\n 'E', 'W', 'WW', 'YY', 'YYYY', 'GG', 'GGGG',\n 'H', 'HH', 'h', 'hh', 'm', 'mm',\n 's', 'ss', 'S', 'SS', 'SSS',\n 'Z', 'ZZ', 'X', 'x'\n]\n\nfunction buildFormattingTokensRegExp (formatters) {\n var formatterKeys = []\n for (var key in formatters) {\n if (formatters.hasOwnProperty(key)) {\n formatterKeys.push(key)\n }\n }\n\n var formattingTokens = commonFormatterKeys\n .concat(formatterKeys)\n .sort()\n .reverse()\n var formattingTokensRegExp = new RegExp(\n '(\\\\[[^\\\\[]*\\\\])|(\\\\\\\\)?' + '(' + formattingTokens.join('|') + '|.)', 'g'\n )\n\n return formattingTokensRegExp\n}\n\nmodule.exports = buildFormattingTokensRegExp\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/locale/_lib/build_formatting_tokens_reg_exp/index.js?"); /***/ }), /***/ "./node_modules/date-fns/locale/en/build_distance_in_words_locale/index.js": /*!*********************************************************************************!*\ !*** ./node_modules/date-fns/locale/en/build_distance_in_words_locale/index.js ***! \*********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("function buildDistanceInWordsLocale () {\n var distanceInWordsLocale = {\n lessThanXSeconds: {\n one: 'less than a second',\n other: 'less than {{count}} seconds'\n },\n\n xSeconds: {\n one: '1 second',\n other: '{{count}} seconds'\n },\n\n halfAMinute: 'half a minute',\n\n lessThanXMinutes: {\n one: 'less than a minute',\n other: 'less than {{count}} minutes'\n },\n\n xMinutes: {\n one: '1 minute',\n other: '{{count}} minutes'\n },\n\n aboutXHours: {\n one: 'about 1 hour',\n other: 'about {{count}} hours'\n },\n\n xHours: {\n one: '1 hour',\n other: '{{count}} hours'\n },\n\n xDays: {\n one: '1 day',\n other: '{{count}} days'\n },\n\n aboutXMonths: {\n one: 'about 1 month',\n other: 'about {{count}} months'\n },\n\n xMonths: {\n one: '1 month',\n other: '{{count}} months'\n },\n\n aboutXYears: {\n one: 'about 1 year',\n other: 'about {{count}} years'\n },\n\n xYears: {\n one: '1 year',\n other: '{{count}} years'\n },\n\n overXYears: {\n one: 'over 1 year',\n other: 'over {{count}} years'\n },\n\n almostXYears: {\n one: 'almost 1 year',\n other: 'almost {{count}} years'\n }\n }\n\n function localize (token, count, options) {\n options = options || {}\n\n var result\n if (typeof distanceInWordsLocale[token] === 'string') {\n result = distanceInWordsLocale[token]\n } else if (count === 1) {\n result = distanceInWordsLocale[token].one\n } else {\n result = distanceInWordsLocale[token].other.replace('{{count}}', count)\n }\n\n if (options.addSuffix) {\n if (options.comparison > 0) {\n return 'in ' + result\n } else {\n return result + ' ago'\n }\n }\n\n return result\n }\n\n return {\n localize: localize\n }\n}\n\nmodule.exports = buildDistanceInWordsLocale\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/locale/en/build_distance_in_words_locale/index.js?"); /***/ }), /***/ "./node_modules/date-fns/locale/en/build_format_locale/index.js": /*!**********************************************************************!*\ !*** ./node_modules/date-fns/locale/en/build_format_locale/index.js ***! \**********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var buildFormattingTokensRegExp = __webpack_require__(/*! ../../_lib/build_formatting_tokens_reg_exp/index.js */ \"./node_modules/date-fns/locale/_lib/build_formatting_tokens_reg_exp/index.js\")\n\nfunction buildFormatLocale () {\n // Note: in English, the names of days of the week and months are capitalized.\n // If you are making a new locale based on this one, check if the same is true for the language you're working on.\n // Generally, formatted dates should look like they are in the middle of a sentence,\n // e.g. in Spanish language the weekdays and months should be in the lowercase.\n var months3char = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']\n var monthsFull = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']\n var weekdays2char = ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa']\n var weekdays3char = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']\n var weekdaysFull = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']\n var meridiemUppercase = ['AM', 'PM']\n var meridiemLowercase = ['am', 'pm']\n var meridiemFull = ['a.m.', 'p.m.']\n\n var formatters = {\n // Month: Jan, Feb, ..., Dec\n 'MMM': function (date) {\n return months3char[date.getMonth()]\n },\n\n // Month: January, February, ..., December\n 'MMMM': function (date) {\n return monthsFull[date.getMonth()]\n },\n\n // Day of week: Su, Mo, ..., Sa\n 'dd': function (date) {\n return weekdays2char[date.getDay()]\n },\n\n // Day of week: Sun, Mon, ..., Sat\n 'ddd': function (date) {\n return weekdays3char[date.getDay()]\n },\n\n // Day of week: Sunday, Monday, ..., Saturday\n 'dddd': function (date) {\n return weekdaysFull[date.getDay()]\n },\n\n // AM, PM\n 'A': function (date) {\n return (date.getHours() / 12) >= 1 ? meridiemUppercase[1] : meridiemUppercase[0]\n },\n\n // am, pm\n 'a': function (date) {\n return (date.getHours() / 12) >= 1 ? meridiemLowercase[1] : meridiemLowercase[0]\n },\n\n // a.m., p.m.\n 'aa': function (date) {\n return (date.getHours() / 12) >= 1 ? meridiemFull[1] : meridiemFull[0]\n }\n }\n\n // Generate ordinal version of formatters: M -> Mo, D -> Do, etc.\n var ordinalFormatters = ['M', 'D', 'DDD', 'd', 'Q', 'W']\n ordinalFormatters.forEach(function (formatterToken) {\n formatters[formatterToken + 'o'] = function (date, formatters) {\n return ordinal(formatters[formatterToken](date))\n }\n })\n\n return {\n formatters: formatters,\n formattingTokensRegExp: buildFormattingTokensRegExp(formatters)\n }\n}\n\nfunction ordinal (number) {\n var rem100 = number % 100\n if (rem100 > 20 || rem100 < 10) {\n switch (rem100 % 10) {\n case 1:\n return number + 'st'\n case 2:\n return number + 'nd'\n case 3:\n return number + 'rd'\n }\n }\n return number + 'th'\n}\n\nmodule.exports = buildFormatLocale\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/locale/en/build_format_locale/index.js?"); /***/ }), /***/ "./node_modules/date-fns/locale/en/index.js": /*!**************************************************!*\ !*** ./node_modules/date-fns/locale/en/index.js ***! \**************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var buildDistanceInWordsLocale = __webpack_require__(/*! ./build_distance_in_words_locale/index.js */ \"./node_modules/date-fns/locale/en/build_distance_in_words_locale/index.js\")\nvar buildFormatLocale = __webpack_require__(/*! ./build_format_locale/index.js */ \"./node_modules/date-fns/locale/en/build_format_locale/index.js\")\n\n/**\n * @category Locales\n * @summary English locale.\n */\nmodule.exports = {\n distanceInWords: buildDistanceInWordsLocale(),\n format: buildFormatLocale()\n}\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/locale/en/index.js?"); /***/ }), /***/ "./node_modules/date-fns/max/index.js": /*!********************************************!*\ !*** ./node_modules/date-fns/max/index.js ***! \********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var parse = __webpack_require__(/*! ../parse/index.js */ \"./node_modules/date-fns/parse/index.js\")\n\n/**\n * @category Common Helpers\n * @summary Return the latest of the given dates.\n *\n * @description\n * Return the latest of the given dates.\n *\n * @param {...(Date|String|Number)} dates - the dates to compare\n * @returns {Date} the latest of the dates\n *\n * @example\n * // Which of these dates is the latest?\n * var result = max(\n * new Date(1989, 6, 10),\n * new Date(1987, 1, 11),\n * new Date(1995, 6, 2),\n * new Date(1990, 0, 1)\n * )\n * //=> Sun Jul 02 1995 00:00:00\n */\nfunction max () {\n var dirtyDates = Array.prototype.slice.call(arguments)\n var dates = dirtyDates.map(function (dirtyDate) {\n return parse(dirtyDate)\n })\n var latestTimestamp = Math.max.apply(null, dates)\n return new Date(latestTimestamp)\n}\n\nmodule.exports = max\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/max/index.js?"); /***/ }), /***/ "./node_modules/date-fns/min/index.js": /*!********************************************!*\ !*** ./node_modules/date-fns/min/index.js ***! \********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var parse = __webpack_require__(/*! ../parse/index.js */ \"./node_modules/date-fns/parse/index.js\")\n\n/**\n * @category Common Helpers\n * @summary Return the earliest of the given dates.\n *\n * @description\n * Return the earliest of the given dates.\n *\n * @param {...(Date|String|Number)} dates - the dates to compare\n * @returns {Date} the earliest of the dates\n *\n * @example\n * // Which of these dates is the earliest?\n * var result = min(\n * new Date(1989, 6, 10),\n * new Date(1987, 1, 11),\n * new Date(1995, 6, 2),\n * new Date(1990, 0, 1)\n * )\n * //=> Wed Feb 11 1987 00:00:00\n */\nfunction min () {\n var dirtyDates = Array.prototype.slice.call(arguments)\n var dates = dirtyDates.map(function (dirtyDate) {\n return parse(dirtyDate)\n })\n var earliestTimestamp = Math.min.apply(null, dates)\n return new Date(earliestTimestamp)\n}\n\nmodule.exports = min\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/min/index.js?"); /***/ }), /***/ "./node_modules/date-fns/parse/index.js": /*!**********************************************!*\ !*** ./node_modules/date-fns/parse/index.js ***! \**********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var getTimezoneOffsetInMilliseconds = __webpack_require__(/*! ../_lib/getTimezoneOffsetInMilliseconds/index.js */ \"./node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds/index.js\")\nvar isDate = __webpack_require__(/*! ../is_date/index.js */ \"./node_modules/date-fns/is_date/index.js\")\n\nvar MILLISECONDS_IN_HOUR = 3600000\nvar MILLISECONDS_IN_MINUTE = 60000\nvar DEFAULT_ADDITIONAL_DIGITS = 2\n\nvar parseTokenDateTimeDelimeter = /[T ]/\nvar parseTokenPlainTime = /:/\n\n// year tokens\nvar parseTokenYY = /^(\\d{2})$/\nvar parseTokensYYY = [\n /^([+-]\\d{2})$/, // 0 additional digits\n /^([+-]\\d{3})$/, // 1 additional digit\n /^([+-]\\d{4})$/ // 2 additional digits\n]\n\nvar parseTokenYYYY = /^(\\d{4})/\nvar parseTokensYYYYY = [\n /^([+-]\\d{4})/, // 0 additional digits\n /^([+-]\\d{5})/, // 1 additional digit\n /^([+-]\\d{6})/ // 2 additional digits\n]\n\n// date tokens\nvar parseTokenMM = /^-(\\d{2})$/\nvar parseTokenDDD = /^-?(\\d{3})$/\nvar parseTokenMMDD = /^-?(\\d{2})-?(\\d{2})$/\nvar parseTokenWww = /^-?W(\\d{2})$/\nvar parseTokenWwwD = /^-?W(\\d{2})-?(\\d{1})$/\n\n// time tokens\nvar parseTokenHH = /^(\\d{2}([.,]\\d*)?)$/\nvar parseTokenHHMM = /^(\\d{2}):?(\\d{2}([.,]\\d*)?)$/\nvar parseTokenHHMMSS = /^(\\d{2}):?(\\d{2}):?(\\d{2}([.,]\\d*)?)$/\n\n// timezone tokens\nvar parseTokenTimezone = /([Z+-].*)$/\nvar parseTokenTimezoneZ = /^(Z)$/\nvar parseTokenTimezoneHH = /^([+-])(\\d{2})$/\nvar parseTokenTimezoneHHMM = /^([+-])(\\d{2}):?(\\d{2})$/\n\n/**\n * @category Common Helpers\n * @summary Convert the given argument to an instance of Date.\n *\n * @description\n * Convert the given argument to an instance of Date.\n *\n * If the argument is an instance of Date, the function returns its clone.\n *\n * If the argument is a number, it is treated as a timestamp.\n *\n * If an argument is a string, the function tries to parse it.\n * Function accepts complete ISO 8601 formats as well as partial implementations.\n * ISO 8601: http://en.wikipedia.org/wiki/ISO_8601\n *\n * If all above fails, the function passes the given argument to Date constructor.\n *\n * @param {Date|String|Number} argument - the value to convert\n * @param {Object} [options] - the object with options\n * @param {0 | 1 | 2} [options.additionalDigits=2] - the additional number of digits in the extended year format\n * @returns {Date} the parsed date in the local time zone\n *\n * @example\n * // Convert string '2014-02-11T11:30:30' to date:\n * var result = parse('2014-02-11T11:30:30')\n * //=> Tue Feb 11 2014 11:30:30\n *\n * @example\n * // Parse string '+02014101',\n * // if the additional number of digits in the extended year format is 1:\n * var result = parse('+02014101', {additionalDigits: 1})\n * //=> Fri Apr 11 2014 00:00:00\n */\nfunction parse (argument, dirtyOptions) {\n if (isDate(argument)) {\n // Prevent the date to lose the milliseconds when passed to new Date() in IE10\n return new Date(argument.getTime())\n } else if (typeof argument !== 'string') {\n return new Date(argument)\n }\n\n var options = dirtyOptions || {}\n var additionalDigits = options.additionalDigits\n if (additionalDigits == null) {\n additionalDigits = DEFAULT_ADDITIONAL_DIGITS\n } else {\n additionalDigits = Number(additionalDigits)\n }\n\n var dateStrings = splitDateString(argument)\n\n var parseYearResult = parseYear(dateStrings.date, additionalDigits)\n var year = parseYearResult.year\n var restDateString = parseYearResult.restDateString\n\n var date = parseDate(restDateString, year)\n\n if (date) {\n var timestamp = date.getTime()\n var time = 0\n var offset\n\n if (dateStrings.time) {\n time = parseTime(dateStrings.time)\n }\n\n if (dateStrings.timezone) {\n offset = parseTimezone(dateStrings.timezone) * MILLISECONDS_IN_MINUTE\n } else {\n var fullTime = timestamp + time\n var fullTimeDate = new Date(fullTime)\n\n offset = getTimezoneOffsetInMilliseconds(fullTimeDate)\n\n // Adjust time when it's coming from DST\n var fullTimeDateNextDay = new Date(fullTime)\n fullTimeDateNextDay.setDate(fullTimeDate.getDate() + 1)\n var offsetDiff =\n getTimezoneOffsetInMilliseconds(fullTimeDateNextDay) -\n getTimezoneOffsetInMilliseconds(fullTimeDate)\n if (offsetDiff > 0) {\n offset += offsetDiff\n }\n }\n\n return new Date(timestamp + time + offset)\n } else {\n return new Date(argument)\n }\n}\n\nfunction splitDateString (dateString) {\n var dateStrings = {}\n var array = dateString.split(parseTokenDateTimeDelimeter)\n var timeString\n\n if (parseTokenPlainTime.test(array[0])) {\n dateStrings.date = null\n timeString = array[0]\n } else {\n dateStrings.date = array[0]\n timeString = array[1]\n }\n\n if (timeString) {\n var token = parseTokenTimezone.exec(timeString)\n if (token) {\n dateStrings.time = timeString.replace(token[1], '')\n dateStrings.timezone = token[1]\n } else {\n dateStrings.time = timeString\n }\n }\n\n return dateStrings\n}\n\nfunction parseYear (dateString, additionalDigits) {\n var parseTokenYYY = parseTokensYYY[additionalDigits]\n var parseTokenYYYYY = parseTokensYYYYY[additionalDigits]\n\n var token\n\n // YYYY or ±YYYYY\n token = parseTokenYYYY.exec(dateString) || parseTokenYYYYY.exec(dateString)\n if (token) {\n var yearString = token[1]\n return {\n year: parseInt(yearString, 10),\n restDateString: dateString.slice(yearString.length)\n }\n }\n\n // YY or ±YYY\n token = parseTokenYY.exec(dateString) || parseTokenYYY.exec(dateString)\n if (token) {\n var centuryString = token[1]\n return {\n year: parseInt(centuryString, 10) * 100,\n restDateString: dateString.slice(centuryString.length)\n }\n }\n\n // Invalid ISO-formatted year\n return {\n year: null\n }\n}\n\nfunction parseDate (dateString, year) {\n // Invalid ISO-formatted year\n if (year === null) {\n return null\n }\n\n var token\n var date\n var month\n var week\n\n // YYYY\n if (dateString.length === 0) {\n date = new Date(0)\n date.setUTCFullYear(year)\n return date\n }\n\n // YYYY-MM\n token = parseTokenMM.exec(dateString)\n if (token) {\n date = new Date(0)\n month = parseInt(token[1], 10) - 1\n date.setUTCFullYear(year, month)\n return date\n }\n\n // YYYY-DDD or YYYYDDD\n token = parseTokenDDD.exec(dateString)\n if (token) {\n date = new Date(0)\n var dayOfYear = parseInt(token[1], 10)\n date.setUTCFullYear(year, 0, dayOfYear)\n return date\n }\n\n // YYYY-MM-DD or YYYYMMDD\n token = parseTokenMMDD.exec(dateString)\n if (token) {\n date = new Date(0)\n month = parseInt(token[1], 10) - 1\n var day = parseInt(token[2], 10)\n date.setUTCFullYear(year, month, day)\n return date\n }\n\n // YYYY-Www or YYYYWww\n token = parseTokenWww.exec(dateString)\n if (token) {\n week = parseInt(token[1], 10) - 1\n return dayOfISOYear(year, week)\n }\n\n // YYYY-Www-D or YYYYWwwD\n token = parseTokenWwwD.exec(dateString)\n if (token) {\n week = parseInt(token[1], 10) - 1\n var dayOfWeek = parseInt(token[2], 10) - 1\n return dayOfISOYear(year, week, dayOfWeek)\n }\n\n // Invalid ISO-formatted date\n return null\n}\n\nfunction parseTime (timeString) {\n var token\n var hours\n var minutes\n\n // hh\n token = parseTokenHH.exec(timeString)\n if (token) {\n hours = parseFloat(token[1].replace(',', '.'))\n return (hours % 24) * MILLISECONDS_IN_HOUR\n }\n\n // hh:mm or hhmm\n token = parseTokenHHMM.exec(timeString)\n if (token) {\n hours = parseInt(token[1], 10)\n minutes = parseFloat(token[2].replace(',', '.'))\n return (hours % 24) * MILLISECONDS_IN_HOUR +\n minutes * MILLISECONDS_IN_MINUTE\n }\n\n // hh:mm:ss or hhmmss\n token = parseTokenHHMMSS.exec(timeString)\n if (token) {\n hours = parseInt(token[1], 10)\n minutes = parseInt(token[2], 10)\n var seconds = parseFloat(token[3].replace(',', '.'))\n return (hours % 24) * MILLISECONDS_IN_HOUR +\n minutes * MILLISECONDS_IN_MINUTE +\n seconds * 1000\n }\n\n // Invalid ISO-formatted time\n return null\n}\n\nfunction parseTimezone (timezoneString) {\n var token\n var absoluteOffset\n\n // Z\n token = parseTokenTimezoneZ.exec(timezoneString)\n if (token) {\n return 0\n }\n\n // ±hh\n token = parseTokenTimezoneHH.exec(timezoneString)\n if (token) {\n absoluteOffset = parseInt(token[2], 10) * 60\n return (token[1] === '+') ? -absoluteOffset : absoluteOffset\n }\n\n // ±hh:mm or ±hhmm\n token = parseTokenTimezoneHHMM.exec(timezoneString)\n if (token) {\n absoluteOffset = parseInt(token[2], 10) * 60 + parseInt(token[3], 10)\n return (token[1] === '+') ? -absoluteOffset : absoluteOffset\n }\n\n return 0\n}\n\nfunction dayOfISOYear (isoYear, week, day) {\n week = week || 0\n day = day || 0\n var date = new Date(0)\n date.setUTCFullYear(isoYear, 0, 4)\n var fourthOfJanuaryDay = date.getUTCDay() || 7\n var diff = week * 7 + day + 1 - fourthOfJanuaryDay\n date.setUTCDate(date.getUTCDate() + diff)\n return date\n}\n\nmodule.exports = parse\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/parse/index.js?"); /***/ }), /***/ "./node_modules/date-fns/set_date/index.js": /*!*************************************************!*\ !*** ./node_modules/date-fns/set_date/index.js ***! \*************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var parse = __webpack_require__(/*! ../parse/index.js */ \"./node_modules/date-fns/parse/index.js\")\n\n/**\n * @category Day Helpers\n * @summary Set the day of the month to the given date.\n *\n * @description\n * Set the day of the month to the given date.\n *\n * @param {Date|String|Number} date - the date to be changed\n * @param {Number} dayOfMonth - the day of the month of the new date\n * @returns {Date} the new date with the day of the month setted\n *\n * @example\n * // Set the 30th day of the month to 1 September 2014:\n * var result = setDate(new Date(2014, 8, 1), 30)\n * //=> Tue Sep 30 2014 00:00:00\n */\nfunction setDate (dirtyDate, dirtyDayOfMonth) {\n var date = parse(dirtyDate)\n var dayOfMonth = Number(dirtyDayOfMonth)\n date.setDate(dayOfMonth)\n return date\n}\n\nmodule.exports = setDate\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/set_date/index.js?"); /***/ }), /***/ "./node_modules/date-fns/set_day/index.js": /*!************************************************!*\ !*** ./node_modules/date-fns/set_day/index.js ***! \************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var parse = __webpack_require__(/*! ../parse/index.js */ \"./node_modules/date-fns/parse/index.js\")\nvar addDays = __webpack_require__(/*! ../add_days/index.js */ \"./node_modules/date-fns/add_days/index.js\")\n\n/**\n * @category Weekday Helpers\n * @summary Set the day of the week to the given date.\n *\n * @description\n * Set the day of the week to the given date.\n *\n * @param {Date|String|Number} date - the date to be changed\n * @param {Number} day - the day of the week of the new date\n * @param {Object} [options] - the object with options\n * @param {Number} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)\n * @returns {Date} the new date with the day of the week setted\n *\n * @example\n * // Set Sunday to 1 September 2014:\n * var result = setDay(new Date(2014, 8, 1), 0)\n * //=> Sun Aug 31 2014 00:00:00\n *\n * @example\n * // If week starts with Monday, set Sunday to 1 September 2014:\n * var result = setDay(new Date(2014, 8, 1), 0, {weekStartsOn: 1})\n * //=> Sun Sep 07 2014 00:00:00\n */\nfunction setDay (dirtyDate, dirtyDay, dirtyOptions) {\n var weekStartsOn = dirtyOptions ? (Number(dirtyOptions.weekStartsOn) || 0) : 0\n var date = parse(dirtyDate)\n var day = Number(dirtyDay)\n var currentDay = date.getDay()\n\n var remainder = day % 7\n var dayIndex = (remainder + 7) % 7\n\n var diff = (dayIndex < weekStartsOn ? 7 : 0) + day - currentDay\n return addDays(date, diff)\n}\n\nmodule.exports = setDay\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/set_day/index.js?"); /***/ }), /***/ "./node_modules/date-fns/set_day_of_year/index.js": /*!********************************************************!*\ !*** ./node_modules/date-fns/set_day_of_year/index.js ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var parse = __webpack_require__(/*! ../parse/index.js */ \"./node_modules/date-fns/parse/index.js\")\n\n/**\n * @category Day Helpers\n * @summary Set the day of the year to the given date.\n *\n * @description\n * Set the day of the year to the given date.\n *\n * @param {Date|String|Number} date - the date to be changed\n * @param {Number} dayOfYear - the day of the year of the new date\n * @returns {Date} the new date with the day of the year setted\n *\n * @example\n * // Set the 2nd day of the year to 2 July 2014:\n * var result = setDayOfYear(new Date(2014, 6, 2), 2)\n * //=> Thu Jan 02 2014 00:00:00\n */\nfunction setDayOfYear (dirtyDate, dirtyDayOfYear) {\n var date = parse(dirtyDate)\n var dayOfYear = Number(dirtyDayOfYear)\n date.setMonth(0)\n date.setDate(dayOfYear)\n return date\n}\n\nmodule.exports = setDayOfYear\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/set_day_of_year/index.js?"); /***/ }), /***/ "./node_modules/date-fns/set_hours/index.js": /*!**************************************************!*\ !*** ./node_modules/date-fns/set_hours/index.js ***! \**************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var parse = __webpack_require__(/*! ../parse/index.js */ \"./node_modules/date-fns/parse/index.js\")\n\n/**\n * @category Hour Helpers\n * @summary Set the hours to the given date.\n *\n * @description\n * Set the hours to the given date.\n *\n * @param {Date|String|Number} date - the date to be changed\n * @param {Number} hours - the hours of the new date\n * @returns {Date} the new date with the hours setted\n *\n * @example\n * // Set 4 hours to 1 September 2014 11:30:00:\n * var result = setHours(new Date(2014, 8, 1, 11, 30), 4)\n * //=> Mon Sep 01 2014 04:30:00\n */\nfunction setHours (dirtyDate, dirtyHours) {\n var date = parse(dirtyDate)\n var hours = Number(dirtyHours)\n date.setHours(hours)\n return date\n}\n\nmodule.exports = setHours\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/set_hours/index.js?"); /***/ }), /***/ "./node_modules/date-fns/set_iso_day/index.js": /*!****************************************************!*\ !*** ./node_modules/date-fns/set_iso_day/index.js ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var parse = __webpack_require__(/*! ../parse/index.js */ \"./node_modules/date-fns/parse/index.js\")\nvar addDays = __webpack_require__(/*! ../add_days/index.js */ \"./node_modules/date-fns/add_days/index.js\")\nvar getISODay = __webpack_require__(/*! ../get_iso_day/index.js */ \"./node_modules/date-fns/get_iso_day/index.js\")\n\n/**\n * @category Weekday Helpers\n * @summary Set the day of the ISO week to the given date.\n *\n * @description\n * Set the day of the ISO week to the given date.\n * ISO week starts with Monday.\n * 7 is the index of Sunday, 1 is the index of Monday etc.\n *\n * @param {Date|String|Number} date - the date to be changed\n * @param {Number} day - the day of the ISO week of the new date\n * @returns {Date} the new date with the day of the ISO week setted\n *\n * @example\n * // Set Sunday to 1 September 2014:\n * var result = setISODay(new Date(2014, 8, 1), 7)\n * //=> Sun Sep 07 2014 00:00:00\n */\nfunction setISODay (dirtyDate, dirtyDay) {\n var date = parse(dirtyDate)\n var day = Number(dirtyDay)\n var currentDay = getISODay(date)\n var diff = day - currentDay\n return addDays(date, diff)\n}\n\nmodule.exports = setISODay\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/set_iso_day/index.js?"); /***/ }), /***/ "./node_modules/date-fns/set_iso_week/index.js": /*!*****************************************************!*\ !*** ./node_modules/date-fns/set_iso_week/index.js ***! \*****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var parse = __webpack_require__(/*! ../parse/index.js */ \"./node_modules/date-fns/parse/index.js\")\nvar getISOWeek = __webpack_require__(/*! ../get_iso_week/index.js */ \"./node_modules/date-fns/get_iso_week/index.js\")\n\n/**\n * @category ISO Week Helpers\n * @summary Set the ISO week to the given date.\n *\n * @description\n * Set the ISO week to the given date, saving the weekday number.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @param {Date|String|Number} date - the date to be changed\n * @param {Number} isoWeek - the ISO week of the new date\n * @returns {Date} the new date with the ISO week setted\n *\n * @example\n * // Set the 53rd ISO week to 7 August 2004:\n * var result = setISOWeek(new Date(2004, 7, 7), 53)\n * //=> Sat Jan 01 2005 00:00:00\n */\nfunction setISOWeek (dirtyDate, dirtyISOWeek) {\n var date = parse(dirtyDate)\n var isoWeek = Number(dirtyISOWeek)\n var diff = getISOWeek(date) - isoWeek\n date.setDate(date.getDate() - diff * 7)\n return date\n}\n\nmodule.exports = setISOWeek\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/set_iso_week/index.js?"); /***/ }), /***/ "./node_modules/date-fns/set_iso_year/index.js": /*!*****************************************************!*\ !*** ./node_modules/date-fns/set_iso_year/index.js ***! \*****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var parse = __webpack_require__(/*! ../parse/index.js */ \"./node_modules/date-fns/parse/index.js\")\nvar startOfISOYear = __webpack_require__(/*! ../start_of_iso_year/index.js */ \"./node_modules/date-fns/start_of_iso_year/index.js\")\nvar differenceInCalendarDays = __webpack_require__(/*! ../difference_in_calendar_days/index.js */ \"./node_modules/date-fns/difference_in_calendar_days/index.js\")\n\n/**\n * @category ISO Week-Numbering Year Helpers\n * @summary Set the ISO week-numbering year to the given date.\n *\n * @description\n * Set the ISO week-numbering year to the given date,\n * saving the week number and the weekday number.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @param {Date|String|Number} date - the date to be changed\n * @param {Number} isoYear - the ISO week-numbering year of the new date\n * @returns {Date} the new date with the ISO week-numbering year setted\n *\n * @example\n * // Set ISO week-numbering year 2007 to 29 December 2008:\n * var result = setISOYear(new Date(2008, 11, 29), 2007)\n * //=> Mon Jan 01 2007 00:00:00\n */\nfunction setISOYear (dirtyDate, dirtyISOYear) {\n var date = parse(dirtyDate)\n var isoYear = Number(dirtyISOYear)\n var diff = differenceInCalendarDays(date, startOfISOYear(date))\n var fourthOfJanuary = new Date(0)\n fourthOfJanuary.setFullYear(isoYear, 0, 4)\n fourthOfJanuary.setHours(0, 0, 0, 0)\n date = startOfISOYear(fourthOfJanuary)\n date.setDate(date.getDate() + diff)\n return date\n}\n\nmodule.exports = setISOYear\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/set_iso_year/index.js?"); /***/ }), /***/ "./node_modules/date-fns/set_milliseconds/index.js": /*!*********************************************************!*\ !*** ./node_modules/date-fns/set_milliseconds/index.js ***! \*********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var parse = __webpack_require__(/*! ../parse/index.js */ \"./node_modules/date-fns/parse/index.js\")\n\n/**\n * @category Millisecond Helpers\n * @summary Set the milliseconds to the given date.\n *\n * @description\n * Set the milliseconds to the given date.\n *\n * @param {Date|String|Number} date - the date to be changed\n * @param {Number} milliseconds - the milliseconds of the new date\n * @returns {Date} the new date with the milliseconds setted\n *\n * @example\n * // Set 300 milliseconds to 1 September 2014 11:30:40.500:\n * var result = setMilliseconds(new Date(2014, 8, 1, 11, 30, 40, 500), 300)\n * //=> Mon Sep 01 2014 11:30:40.300\n */\nfunction setMilliseconds (dirtyDate, dirtyMilliseconds) {\n var date = parse(dirtyDate)\n var milliseconds = Number(dirtyMilliseconds)\n date.setMilliseconds(milliseconds)\n return date\n}\n\nmodule.exports = setMilliseconds\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/set_milliseconds/index.js?"); /***/ }), /***/ "./node_modules/date-fns/set_minutes/index.js": /*!****************************************************!*\ !*** ./node_modules/date-fns/set_minutes/index.js ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var parse = __webpack_require__(/*! ../parse/index.js */ \"./node_modules/date-fns/parse/index.js\")\n\n/**\n * @category Minute Helpers\n * @summary Set the minutes to the given date.\n *\n * @description\n * Set the minutes to the given date.\n *\n * @param {Date|String|Number} date - the date to be changed\n * @param {Number} minutes - the minutes of the new date\n * @returns {Date} the new date with the minutes setted\n *\n * @example\n * // Set 45 minutes to 1 September 2014 11:30:40:\n * var result = setMinutes(new Date(2014, 8, 1, 11, 30, 40), 45)\n * //=> Mon Sep 01 2014 11:45:40\n */\nfunction setMinutes (dirtyDate, dirtyMinutes) {\n var date = parse(dirtyDate)\n var minutes = Number(dirtyMinutes)\n date.setMinutes(minutes)\n return date\n}\n\nmodule.exports = setMinutes\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/set_minutes/index.js?"); /***/ }), /***/ "./node_modules/date-fns/set_month/index.js": /*!**************************************************!*\ !*** ./node_modules/date-fns/set_month/index.js ***! \**************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var parse = __webpack_require__(/*! ../parse/index.js */ \"./node_modules/date-fns/parse/index.js\")\nvar getDaysInMonth = __webpack_require__(/*! ../get_days_in_month/index.js */ \"./node_modules/date-fns/get_days_in_month/index.js\")\n\n/**\n * @category Month Helpers\n * @summary Set the month to the given date.\n *\n * @description\n * Set the month to the given date.\n *\n * @param {Date|String|Number} date - the date to be changed\n * @param {Number} month - the month of the new date\n * @returns {Date} the new date with the month setted\n *\n * @example\n * // Set February to 1 September 2014:\n * var result = setMonth(new Date(2014, 8, 1), 1)\n * //=> Sat Feb 01 2014 00:00:00\n */\nfunction setMonth (dirtyDate, dirtyMonth) {\n var date = parse(dirtyDate)\n var month = Number(dirtyMonth)\n var year = date.getFullYear()\n var day = date.getDate()\n\n var dateWithDesiredMonth = new Date(0)\n dateWithDesiredMonth.setFullYear(year, month, 15)\n dateWithDesiredMonth.setHours(0, 0, 0, 0)\n var daysInMonth = getDaysInMonth(dateWithDesiredMonth)\n // Set the last day of the new month\n // if the original date was the last day of the longer month\n date.setMonth(month, Math.min(day, daysInMonth))\n return date\n}\n\nmodule.exports = setMonth\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/set_month/index.js?"); /***/ }), /***/ "./node_modules/date-fns/set_quarter/index.js": /*!****************************************************!*\ !*** ./node_modules/date-fns/set_quarter/index.js ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var parse = __webpack_require__(/*! ../parse/index.js */ \"./node_modules/date-fns/parse/index.js\")\nvar setMonth = __webpack_require__(/*! ../set_month/index.js */ \"./node_modules/date-fns/set_month/index.js\")\n\n/**\n * @category Quarter Helpers\n * @summary Set the year quarter to the given date.\n *\n * @description\n * Set the year quarter to the given date.\n *\n * @param {Date|String|Number} date - the date to be changed\n * @param {Number} quarter - the quarter of the new date\n * @returns {Date} the new date with the quarter setted\n *\n * @example\n * // Set the 2nd quarter to 2 July 2014:\n * var result = setQuarter(new Date(2014, 6, 2), 2)\n * //=> Wed Apr 02 2014 00:00:00\n */\nfunction setQuarter (dirtyDate, dirtyQuarter) {\n var date = parse(dirtyDate)\n var quarter = Number(dirtyQuarter)\n var oldQuarter = Math.floor(date.getMonth() / 3) + 1\n var diff = quarter - oldQuarter\n return setMonth(date, date.getMonth() + diff * 3)\n}\n\nmodule.exports = setQuarter\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/set_quarter/index.js?"); /***/ }), /***/ "./node_modules/date-fns/set_seconds/index.js": /*!****************************************************!*\ !*** ./node_modules/date-fns/set_seconds/index.js ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var parse = __webpack_require__(/*! ../parse/index.js */ \"./node_modules/date-fns/parse/index.js\")\n\n/**\n * @category Second Helpers\n * @summary Set the seconds to the given date.\n *\n * @description\n * Set the seconds to the given date.\n *\n * @param {Date|String|Number} date - the date to be changed\n * @param {Number} seconds - the seconds of the new date\n * @returns {Date} the new date with the seconds setted\n *\n * @example\n * // Set 45 seconds to 1 September 2014 11:30:40:\n * var result = setSeconds(new Date(2014, 8, 1, 11, 30, 40), 45)\n * //=> Mon Sep 01 2014 11:30:45\n */\nfunction setSeconds (dirtyDate, dirtySeconds) {\n var date = parse(dirtyDate)\n var seconds = Number(dirtySeconds)\n date.setSeconds(seconds)\n return date\n}\n\nmodule.exports = setSeconds\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/set_seconds/index.js?"); /***/ }), /***/ "./node_modules/date-fns/set_year/index.js": /*!*************************************************!*\ !*** ./node_modules/date-fns/set_year/index.js ***! \*************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var parse = __webpack_require__(/*! ../parse/index.js */ \"./node_modules/date-fns/parse/index.js\")\n\n/**\n * @category Year Helpers\n * @summary Set the year to the given date.\n *\n * @description\n * Set the year to the given date.\n *\n * @param {Date|String|Number} date - the date to be changed\n * @param {Number} year - the year of the new date\n * @returns {Date} the new date with the year setted\n *\n * @example\n * // Set year 2013 to 1 September 2014:\n * var result = setYear(new Date(2014, 8, 1), 2013)\n * //=> Sun Sep 01 2013 00:00:00\n */\nfunction setYear (dirtyDate, dirtyYear) {\n var date = parse(dirtyDate)\n var year = Number(dirtyYear)\n date.setFullYear(year)\n return date\n}\n\nmodule.exports = setYear\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/set_year/index.js?"); /***/ }), /***/ "./node_modules/date-fns/start_of_day/index.js": /*!*****************************************************!*\ !*** ./node_modules/date-fns/start_of_day/index.js ***! \*****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var parse = __webpack_require__(/*! ../parse/index.js */ \"./node_modules/date-fns/parse/index.js\")\n\n/**\n * @category Day Helpers\n * @summary Return the start of a day for the given date.\n *\n * @description\n * Return the start of a day for the given date.\n * The result will be in the local timezone.\n *\n * @param {Date|String|Number} date - the original date\n * @returns {Date} the start of a day\n *\n * @example\n * // The start of a day for 2 September 2014 11:55:00:\n * var result = startOfDay(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Tue Sep 02 2014 00:00:00\n */\nfunction startOfDay (dirtyDate) {\n var date = parse(dirtyDate)\n date.setHours(0, 0, 0, 0)\n return date\n}\n\nmodule.exports = startOfDay\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/start_of_day/index.js?"); /***/ }), /***/ "./node_modules/date-fns/start_of_hour/index.js": /*!******************************************************!*\ !*** ./node_modules/date-fns/start_of_hour/index.js ***! \******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var parse = __webpack_require__(/*! ../parse/index.js */ \"./node_modules/date-fns/parse/index.js\")\n\n/**\n * @category Hour Helpers\n * @summary Return the start of an hour for the given date.\n *\n * @description\n * Return the start of an hour for the given date.\n * The result will be in the local timezone.\n *\n * @param {Date|String|Number} date - the original date\n * @returns {Date} the start of an hour\n *\n * @example\n * // The start of an hour for 2 September 2014 11:55:00:\n * var result = startOfHour(new Date(2014, 8, 2, 11, 55))\n * //=> Tue Sep 02 2014 11:00:00\n */\nfunction startOfHour (dirtyDate) {\n var date = parse(dirtyDate)\n date.setMinutes(0, 0, 0)\n return date\n}\n\nmodule.exports = startOfHour\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/start_of_hour/index.js?"); /***/ }), /***/ "./node_modules/date-fns/start_of_iso_week/index.js": /*!**********************************************************!*\ !*** ./node_modules/date-fns/start_of_iso_week/index.js ***! \**********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var startOfWeek = __webpack_require__(/*! ../start_of_week/index.js */ \"./node_modules/date-fns/start_of_week/index.js\")\n\n/**\n * @category ISO Week Helpers\n * @summary Return the start of an ISO week for the given date.\n *\n * @description\n * Return the start of an ISO week for the given date.\n * The result will be in the local timezone.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @param {Date|String|Number} date - the original date\n * @returns {Date} the start of an ISO week\n *\n * @example\n * // The start of an ISO week for 2 September 2014 11:55:00:\n * var result = startOfISOWeek(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Mon Sep 01 2014 00:00:00\n */\nfunction startOfISOWeek (dirtyDate) {\n return startOfWeek(dirtyDate, {weekStartsOn: 1})\n}\n\nmodule.exports = startOfISOWeek\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/start_of_iso_week/index.js?"); /***/ }), /***/ "./node_modules/date-fns/start_of_iso_year/index.js": /*!**********************************************************!*\ !*** ./node_modules/date-fns/start_of_iso_year/index.js ***! \**********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var getISOYear = __webpack_require__(/*! ../get_iso_year/index.js */ \"./node_modules/date-fns/get_iso_year/index.js\")\nvar startOfISOWeek = __webpack_require__(/*! ../start_of_iso_week/index.js */ \"./node_modules/date-fns/start_of_iso_week/index.js\")\n\n/**\n * @category ISO Week-Numbering Year Helpers\n * @summary Return the start of an ISO week-numbering year for the given date.\n *\n * @description\n * Return the start of an ISO week-numbering year,\n * which always starts 3 days before the year's first Thursday.\n * The result will be in the local timezone.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @param {Date|String|Number} date - the original date\n * @returns {Date} the start of an ISO year\n *\n * @example\n * // The start of an ISO week-numbering year for 2 July 2005:\n * var result = startOfISOYear(new Date(2005, 6, 2))\n * //=> Mon Jan 03 2005 00:00:00\n */\nfunction startOfISOYear (dirtyDate) {\n var year = getISOYear(dirtyDate)\n var fourthOfJanuary = new Date(0)\n fourthOfJanuary.setFullYear(year, 0, 4)\n fourthOfJanuary.setHours(0, 0, 0, 0)\n var date = startOfISOWeek(fourthOfJanuary)\n return date\n}\n\nmodule.exports = startOfISOYear\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/start_of_iso_year/index.js?"); /***/ }), /***/ "./node_modules/date-fns/start_of_minute/index.js": /*!********************************************************!*\ !*** ./node_modules/date-fns/start_of_minute/index.js ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var parse = __webpack_require__(/*! ../parse/index.js */ \"./node_modules/date-fns/parse/index.js\")\n\n/**\n * @category Minute Helpers\n * @summary Return the start of a minute for the given date.\n *\n * @description\n * Return the start of a minute for the given date.\n * The result will be in the local timezone.\n *\n * @param {Date|String|Number} date - the original date\n * @returns {Date} the start of a minute\n *\n * @example\n * // The start of a minute for 1 December 2014 22:15:45.400:\n * var result = startOfMinute(new Date(2014, 11, 1, 22, 15, 45, 400))\n * //=> Mon Dec 01 2014 22:15:00\n */\nfunction startOfMinute (dirtyDate) {\n var date = parse(dirtyDate)\n date.setSeconds(0, 0)\n return date\n}\n\nmodule.exports = startOfMinute\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/start_of_minute/index.js?"); /***/ }), /***/ "./node_modules/date-fns/start_of_month/index.js": /*!*******************************************************!*\ !*** ./node_modules/date-fns/start_of_month/index.js ***! \*******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var parse = __webpack_require__(/*! ../parse/index.js */ \"./node_modules/date-fns/parse/index.js\")\n\n/**\n * @category Month Helpers\n * @summary Return the start of a month for the given date.\n *\n * @description\n * Return the start of a month for the given date.\n * The result will be in the local timezone.\n *\n * @param {Date|String|Number} date - the original date\n * @returns {Date} the start of a month\n *\n * @example\n * // The start of a month for 2 September 2014 11:55:00:\n * var result = startOfMonth(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Mon Sep 01 2014 00:00:00\n */\nfunction startOfMonth (dirtyDate) {\n var date = parse(dirtyDate)\n date.setDate(1)\n date.setHours(0, 0, 0, 0)\n return date\n}\n\nmodule.exports = startOfMonth\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/start_of_month/index.js?"); /***/ }), /***/ "./node_modules/date-fns/start_of_quarter/index.js": /*!*********************************************************!*\ !*** ./node_modules/date-fns/start_of_quarter/index.js ***! \*********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var parse = __webpack_require__(/*! ../parse/index.js */ \"./node_modules/date-fns/parse/index.js\")\n\n/**\n * @category Quarter Helpers\n * @summary Return the start of a year quarter for the given date.\n *\n * @description\n * Return the start of a year quarter for the given date.\n * The result will be in the local timezone.\n *\n * @param {Date|String|Number} date - the original date\n * @returns {Date} the start of a quarter\n *\n * @example\n * // The start of a quarter for 2 September 2014 11:55:00:\n * var result = startOfQuarter(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Tue Jul 01 2014 00:00:00\n */\nfunction startOfQuarter (dirtyDate) {\n var date = parse(dirtyDate)\n var currentMonth = date.getMonth()\n var month = currentMonth - currentMonth % 3\n date.setMonth(month, 1)\n date.setHours(0, 0, 0, 0)\n return date\n}\n\nmodule.exports = startOfQuarter\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/start_of_quarter/index.js?"); /***/ }), /***/ "./node_modules/date-fns/start_of_second/index.js": /*!********************************************************!*\ !*** ./node_modules/date-fns/start_of_second/index.js ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var parse = __webpack_require__(/*! ../parse/index.js */ \"./node_modules/date-fns/parse/index.js\")\n\n/**\n * @category Second Helpers\n * @summary Return the start of a second for the given date.\n *\n * @description\n * Return the start of a second for the given date.\n * The result will be in the local timezone.\n *\n * @param {Date|String|Number} date - the original date\n * @returns {Date} the start of a second\n *\n * @example\n * // The start of a second for 1 December 2014 22:15:45.400:\n * var result = startOfSecond(new Date(2014, 11, 1, 22, 15, 45, 400))\n * //=> Mon Dec 01 2014 22:15:45.000\n */\nfunction startOfSecond (dirtyDate) {\n var date = parse(dirtyDate)\n date.setMilliseconds(0)\n return date\n}\n\nmodule.exports = startOfSecond\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/start_of_second/index.js?"); /***/ }), /***/ "./node_modules/date-fns/start_of_today/index.js": /*!*******************************************************!*\ !*** ./node_modules/date-fns/start_of_today/index.js ***! \*******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var startOfDay = __webpack_require__(/*! ../start_of_day/index.js */ \"./node_modules/date-fns/start_of_day/index.js\")\n\n/**\n * @category Day Helpers\n * @summary Return the start of today.\n *\n * @description\n * Return the start of today.\n *\n * @returns {Date} the start of today\n *\n * @example\n * // If today is 6 October 2014:\n * var result = startOfToday()\n * //=> Mon Oct 6 2014 00:00:00\n */\nfunction startOfToday () {\n return startOfDay(new Date())\n}\n\nmodule.exports = startOfToday\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/start_of_today/index.js?"); /***/ }), /***/ "./node_modules/date-fns/start_of_tomorrow/index.js": /*!**********************************************************!*\ !*** ./node_modules/date-fns/start_of_tomorrow/index.js ***! \**********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\n * @category Day Helpers\n * @summary Return the start of tomorrow.\n *\n * @description\n * Return the start of tomorrow.\n *\n * @returns {Date} the start of tomorrow\n *\n * @example\n * // If today is 6 October 2014:\n * var result = startOfTomorrow()\n * //=> Tue Oct 7 2014 00:00:00\n */\nfunction startOfTomorrow () {\n var now = new Date()\n var year = now.getFullYear()\n var month = now.getMonth()\n var day = now.getDate()\n\n var date = new Date(0)\n date.setFullYear(year, month, day + 1)\n date.setHours(0, 0, 0, 0)\n return date\n}\n\nmodule.exports = startOfTomorrow\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/start_of_tomorrow/index.js?"); /***/ }), /***/ "./node_modules/date-fns/start_of_week/index.js": /*!******************************************************!*\ !*** ./node_modules/date-fns/start_of_week/index.js ***! \******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var parse = __webpack_require__(/*! ../parse/index.js */ \"./node_modules/date-fns/parse/index.js\")\n\n/**\n * @category Week Helpers\n * @summary Return the start of a week for the given date.\n *\n * @description\n * Return the start of a week for the given date.\n * The result will be in the local timezone.\n *\n * @param {Date|String|Number} date - the original date\n * @param {Object} [options] - the object with options\n * @param {Number} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)\n * @returns {Date} the start of a week\n *\n * @example\n * // The start of a week for 2 September 2014 11:55:00:\n * var result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Sun Aug 31 2014 00:00:00\n *\n * @example\n * // If the week starts on Monday, the start of the week for 2 September 2014 11:55:00:\n * var result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0), {weekStartsOn: 1})\n * //=> Mon Sep 01 2014 00:00:00\n */\nfunction startOfWeek (dirtyDate, dirtyOptions) {\n var weekStartsOn = dirtyOptions ? (Number(dirtyOptions.weekStartsOn) || 0) : 0\n\n var date = parse(dirtyDate)\n var day = date.getDay()\n var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn\n\n date.setDate(date.getDate() - diff)\n date.setHours(0, 0, 0, 0)\n return date\n}\n\nmodule.exports = startOfWeek\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/start_of_week/index.js?"); /***/ }), /***/ "./node_modules/date-fns/start_of_year/index.js": /*!******************************************************!*\ !*** ./node_modules/date-fns/start_of_year/index.js ***! \******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var parse = __webpack_require__(/*! ../parse/index.js */ \"./node_modules/date-fns/parse/index.js\")\n\n/**\n * @category Year Helpers\n * @summary Return the start of a year for the given date.\n *\n * @description\n * Return the start of a year for the given date.\n * The result will be in the local timezone.\n *\n * @param {Date|String|Number} date - the original date\n * @returns {Date} the start of a year\n *\n * @example\n * // The start of a year for 2 September 2014 11:55:00:\n * var result = startOfYear(new Date(2014, 8, 2, 11, 55, 00))\n * //=> Wed Jan 01 2014 00:00:00\n */\nfunction startOfYear (dirtyDate) {\n var cleanDate = parse(dirtyDate)\n var date = new Date(0)\n date.setFullYear(cleanDate.getFullYear(), 0, 1)\n date.setHours(0, 0, 0, 0)\n return date\n}\n\nmodule.exports = startOfYear\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/start_of_year/index.js?"); /***/ }), /***/ "./node_modules/date-fns/start_of_yesterday/index.js": /*!***********************************************************!*\ !*** ./node_modules/date-fns/start_of_yesterday/index.js ***! \***********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\n * @category Day Helpers\n * @summary Return the start of yesterday.\n *\n * @description\n * Return the start of yesterday.\n *\n * @returns {Date} the start of yesterday\n *\n * @example\n * // If today is 6 October 2014:\n * var result = startOfYesterday()\n * //=> Sun Oct 5 2014 00:00:00\n */\nfunction startOfYesterday () {\n var now = new Date()\n var year = now.getFullYear()\n var month = now.getMonth()\n var day = now.getDate()\n\n var date = new Date(0)\n date.setFullYear(year, month, day - 1)\n date.setHours(0, 0, 0, 0)\n return date\n}\n\nmodule.exports = startOfYesterday\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/start_of_yesterday/index.js?"); /***/ }), /***/ "./node_modules/date-fns/sub_days/index.js": /*!*************************************************!*\ !*** ./node_modules/date-fns/sub_days/index.js ***! \*************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var addDays = __webpack_require__(/*! ../add_days/index.js */ \"./node_modules/date-fns/add_days/index.js\")\n\n/**\n * @category Day Helpers\n * @summary Subtract the specified number of days from the given date.\n *\n * @description\n * Subtract the specified number of days from the given date.\n *\n * @param {Date|String|Number} date - the date to be changed\n * @param {Number} amount - the amount of days to be subtracted\n * @returns {Date} the new date with the days subtracted\n *\n * @example\n * // Subtract 10 days from 1 September 2014:\n * var result = subDays(new Date(2014, 8, 1), 10)\n * //=> Fri Aug 22 2014 00:00:00\n */\nfunction subDays (dirtyDate, dirtyAmount) {\n var amount = Number(dirtyAmount)\n return addDays(dirtyDate, -amount)\n}\n\nmodule.exports = subDays\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/sub_days/index.js?"); /***/ }), /***/ "./node_modules/date-fns/sub_hours/index.js": /*!**************************************************!*\ !*** ./node_modules/date-fns/sub_hours/index.js ***! \**************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var addHours = __webpack_require__(/*! ../add_hours/index.js */ \"./node_modules/date-fns/add_hours/index.js\")\n\n/**\n * @category Hour Helpers\n * @summary Subtract the specified number of hours from the given date.\n *\n * @description\n * Subtract the specified number of hours from the given date.\n *\n * @param {Date|String|Number} date - the date to be changed\n * @param {Number} amount - the amount of hours to be subtracted\n * @returns {Date} the new date with the hours subtracted\n *\n * @example\n * // Subtract 2 hours from 11 July 2014 01:00:00:\n * var result = subHours(new Date(2014, 6, 11, 1, 0), 2)\n * //=> Thu Jul 10 2014 23:00:00\n */\nfunction subHours (dirtyDate, dirtyAmount) {\n var amount = Number(dirtyAmount)\n return addHours(dirtyDate, -amount)\n}\n\nmodule.exports = subHours\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/sub_hours/index.js?"); /***/ }), /***/ "./node_modules/date-fns/sub_iso_years/index.js": /*!******************************************************!*\ !*** ./node_modules/date-fns/sub_iso_years/index.js ***! \******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var addISOYears = __webpack_require__(/*! ../add_iso_years/index.js */ \"./node_modules/date-fns/add_iso_years/index.js\")\n\n/**\n * @category ISO Week-Numbering Year Helpers\n * @summary Subtract the specified number of ISO week-numbering years from the given date.\n *\n * @description\n * Subtract the specified number of ISO week-numbering years from the given date.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @param {Date|String|Number} date - the date to be changed\n * @param {Number} amount - the amount of ISO week-numbering years to be subtracted\n * @returns {Date} the new date with the ISO week-numbering years subtracted\n *\n * @example\n * // Subtract 5 ISO week-numbering years from 1 September 2014:\n * var result = subISOYears(new Date(2014, 8, 1), 5)\n * //=> Mon Aug 31 2009 00:00:00\n */\nfunction subISOYears (dirtyDate, dirtyAmount) {\n var amount = Number(dirtyAmount)\n return addISOYears(dirtyDate, -amount)\n}\n\nmodule.exports = subISOYears\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/sub_iso_years/index.js?"); /***/ }), /***/ "./node_modules/date-fns/sub_milliseconds/index.js": /*!*********************************************************!*\ !*** ./node_modules/date-fns/sub_milliseconds/index.js ***! \*********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var addMilliseconds = __webpack_require__(/*! ../add_milliseconds/index.js */ \"./node_modules/date-fns/add_milliseconds/index.js\")\n\n/**\n * @category Millisecond Helpers\n * @summary Subtract the specified number of milliseconds from the given date.\n *\n * @description\n * Subtract the specified number of milliseconds from the given date.\n *\n * @param {Date|String|Number} date - the date to be changed\n * @param {Number} amount - the amount of milliseconds to be subtracted\n * @returns {Date} the new date with the milliseconds subtracted\n *\n * @example\n * // Subtract 750 milliseconds from 10 July 2014 12:45:30.000:\n * var result = subMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)\n * //=> Thu Jul 10 2014 12:45:29.250\n */\nfunction subMilliseconds (dirtyDate, dirtyAmount) {\n var amount = Number(dirtyAmount)\n return addMilliseconds(dirtyDate, -amount)\n}\n\nmodule.exports = subMilliseconds\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/sub_milliseconds/index.js?"); /***/ }), /***/ "./node_modules/date-fns/sub_minutes/index.js": /*!****************************************************!*\ !*** ./node_modules/date-fns/sub_minutes/index.js ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var addMinutes = __webpack_require__(/*! ../add_minutes/index.js */ \"./node_modules/date-fns/add_minutes/index.js\")\n\n/**\n * @category Minute Helpers\n * @summary Subtract the specified number of minutes from the given date.\n *\n * @description\n * Subtract the specified number of minutes from the given date.\n *\n * @param {Date|String|Number} date - the date to be changed\n * @param {Number} amount - the amount of minutes to be subtracted\n * @returns {Date} the new date with the mintues subtracted\n *\n * @example\n * // Subtract 30 minutes from 10 July 2014 12:00:00:\n * var result = subMinutes(new Date(2014, 6, 10, 12, 0), 30)\n * //=> Thu Jul 10 2014 11:30:00\n */\nfunction subMinutes (dirtyDate, dirtyAmount) {\n var amount = Number(dirtyAmount)\n return addMinutes(dirtyDate, -amount)\n}\n\nmodule.exports = subMinutes\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/sub_minutes/index.js?"); /***/ }), /***/ "./node_modules/date-fns/sub_months/index.js": /*!***************************************************!*\ !*** ./node_modules/date-fns/sub_months/index.js ***! \***************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var addMonths = __webpack_require__(/*! ../add_months/index.js */ \"./node_modules/date-fns/add_months/index.js\")\n\n/**\n * @category Month Helpers\n * @summary Subtract the specified number of months from the given date.\n *\n * @description\n * Subtract the specified number of months from the given date.\n *\n * @param {Date|String|Number} date - the date to be changed\n * @param {Number} amount - the amount of months to be subtracted\n * @returns {Date} the new date with the months subtracted\n *\n * @example\n * // Subtract 5 months from 1 February 2015:\n * var result = subMonths(new Date(2015, 1, 1), 5)\n * //=> Mon Sep 01 2014 00:00:00\n */\nfunction subMonths (dirtyDate, dirtyAmount) {\n var amount = Number(dirtyAmount)\n return addMonths(dirtyDate, -amount)\n}\n\nmodule.exports = subMonths\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/sub_months/index.js?"); /***/ }), /***/ "./node_modules/date-fns/sub_quarters/index.js": /*!*****************************************************!*\ !*** ./node_modules/date-fns/sub_quarters/index.js ***! \*****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var addQuarters = __webpack_require__(/*! ../add_quarters/index.js */ \"./node_modules/date-fns/add_quarters/index.js\")\n\n/**\n * @category Quarter Helpers\n * @summary Subtract the specified number of year quarters from the given date.\n *\n * @description\n * Subtract the specified number of year quarters from the given date.\n *\n * @param {Date|String|Number} date - the date to be changed\n * @param {Number} amount - the amount of quarters to be subtracted\n * @returns {Date} the new date with the quarters subtracted\n *\n * @example\n * // Subtract 3 quarters from 1 September 2014:\n * var result = subQuarters(new Date(2014, 8, 1), 3)\n * //=> Sun Dec 01 2013 00:00:00\n */\nfunction subQuarters (dirtyDate, dirtyAmount) {\n var amount = Number(dirtyAmount)\n return addQuarters(dirtyDate, -amount)\n}\n\nmodule.exports = subQuarters\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/sub_quarters/index.js?"); /***/ }), /***/ "./node_modules/date-fns/sub_seconds/index.js": /*!****************************************************!*\ !*** ./node_modules/date-fns/sub_seconds/index.js ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var addSeconds = __webpack_require__(/*! ../add_seconds/index.js */ \"./node_modules/date-fns/add_seconds/index.js\")\n\n/**\n * @category Second Helpers\n * @summary Subtract the specified number of seconds from the given date.\n *\n * @description\n * Subtract the specified number of seconds from the given date.\n *\n * @param {Date|String|Number} date - the date to be changed\n * @param {Number} amount - the amount of seconds to be subtracted\n * @returns {Date} the new date with the seconds subtracted\n *\n * @example\n * // Subtract 30 seconds from 10 July 2014 12:45:00:\n * var result = subSeconds(new Date(2014, 6, 10, 12, 45, 0), 30)\n * //=> Thu Jul 10 2014 12:44:30\n */\nfunction subSeconds (dirtyDate, dirtyAmount) {\n var amount = Number(dirtyAmount)\n return addSeconds(dirtyDate, -amount)\n}\n\nmodule.exports = subSeconds\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/sub_seconds/index.js?"); /***/ }), /***/ "./node_modules/date-fns/sub_weeks/index.js": /*!**************************************************!*\ !*** ./node_modules/date-fns/sub_weeks/index.js ***! \**************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var addWeeks = __webpack_require__(/*! ../add_weeks/index.js */ \"./node_modules/date-fns/add_weeks/index.js\")\n\n/**\n * @category Week Helpers\n * @summary Subtract the specified number of weeks from the given date.\n *\n * @description\n * Subtract the specified number of weeks from the given date.\n *\n * @param {Date|String|Number} date - the date to be changed\n * @param {Number} amount - the amount of weeks to be subtracted\n * @returns {Date} the new date with the weeks subtracted\n *\n * @example\n * // Subtract 4 weeks from 1 September 2014:\n * var result = subWeeks(new Date(2014, 8, 1), 4)\n * //=> Mon Aug 04 2014 00:00:00\n */\nfunction subWeeks (dirtyDate, dirtyAmount) {\n var amount = Number(dirtyAmount)\n return addWeeks(dirtyDate, -amount)\n}\n\nmodule.exports = subWeeks\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/sub_weeks/index.js?"); /***/ }), /***/ "./node_modules/date-fns/sub_years/index.js": /*!**************************************************!*\ !*** ./node_modules/date-fns/sub_years/index.js ***! \**************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var addYears = __webpack_require__(/*! ../add_years/index.js */ \"./node_modules/date-fns/add_years/index.js\")\n\n/**\n * @category Year Helpers\n * @summary Subtract the specified number of years from the given date.\n *\n * @description\n * Subtract the specified number of years from the given date.\n *\n * @param {Date|String|Number} date - the date to be changed\n * @param {Number} amount - the amount of years to be subtracted\n * @returns {Date} the new date with the years subtracted\n *\n * @example\n * // Subtract 5 years from 1 September 2014:\n * var result = subYears(new Date(2014, 8, 1), 5)\n * //=> Tue Sep 01 2009 00:00:00\n */\nfunction subYears (dirtyDate, dirtyAmount) {\n var amount = Number(dirtyAmount)\n return addYears(dirtyDate, -amount)\n}\n\nmodule.exports = subYears\n\n\n//# sourceURL=webpack:///./node_modules/date-fns/sub_years/index.js?"); /***/ }) /******/ });
'use strict'; // A wrapper around the lru-cache module const _ = require('underscore'); const lru = require('lru-cache'); const defaults = _.defaults; // Setup debug log const debug = require('abacus-debug')('abacus-lrucache'); // Return a LRU cache const lrucache = (opt) => { if(process.env.CACHE === 'false') return { set: (k, v) => undefined, has: (k) => false, get: (k) => undefined, del: (k) => undefined }; debug('Creating cache %o', opt); const cache = lru(defaults(opt, { length: (v) => 1 })); return { set: (k, v) => cache.set(k, v), has: (k) => cache.has(k), get: (k) => cache.get(k), del: (k) => cache.del(k) }; }; // Export our public functions module.exports = lrucache;
import html from './html'; import javascript from './javascript'; import markdown from './markdown'; import style from './style'; export default { html, javascript, markdown, style };
/** * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @format * @flow */ import React from 'react'; import TestRenderer from 'react-test-renderer'; import { MockedProvider } from '@apollo/client/testing'; import Issues, { IssueQuery } from './Issues'; import { Issue, IssueSkeleton } from './Issue'; import FilterControls, { filtersQuery } from './Filter'; const {act} = TestRenderer; test("Renders issues and filters", async () => { // Mock window.matchMedia window.matchMedia = window.matchMedia || function() { return { matches: false, addListener: function() {}, removeListener: function() {} }; }; const mockIssues = { edges: [{ node: { issue_id: "1", issue_instance_id: "11", code: 6065, message: "This is a test issue", callable: "run.test", filename: "tests.js", location: "26|11|12", sources: ["TestSource"], source_names: ["TestSource"], sinks: ["TestSink"], sink_names: ["TestSink"], status: "Uncategorized", features: ["always-via:test"], is_new_issue: false, min_trace_length_to_sources: 0, min_trace_length_to_sinks: 0, }, }], pageInfo: { endCursor: "TestCursor", }, }; /** * There are only 2 requests, but one of the requests sometimes * occur with varrying variables, hence for issues, we have * two requests, and one for filters making total of 3 mocks */ const mocks = [{ request: { query: IssueQuery, variables: { run_id: "0", offset:0, }, }, result: { data: { issues: mockIssues, }, }, }, { request: { query: IssueQuery, variables: { run_id: "0", features: [{mode:"all of",features:[]}], min_trace_length_to_sources: undefined, max_trace_length_to_sources: undefined, min_trace_length_to_sinks: undefined, max_trace_length_to_sinks: undefined, offset:0, }, }, result: { data: { issues: mockIssues, }, }, }, { request: { query: filtersQuery, }, result: { data: { filters: { edges: [{ node: { name: "Test Filter", description: "Test description", json: "{}", }, }], }, }, }, }]; const match = { params: { run_id: "0", }, }; const component = TestRenderer.create( <MockedProvider mocks={mocks}> <Issues match={match}/> </MockedProvider> ); // Mocked provider hasn't populated the results yet. Use it to test loading let tree = component.toJSON(); expect(tree[1].children.join('')).toContain( TestRenderer.create(<IssueSkeleton/>) ); expect(tree).toMatchSnapshot(); /** * Await a zero-millisecond timeout. This delays the checks until the next * "tick" of the event loop, which gives MockedProvider an opportunity to * populate the mocked result. Await two ticks because there are two * `useQuery` functions called in Issues.js. First tick renders the filters * and the second tick renders the issue(s). */ await act(() => new Promise((resolve) => setTimeout(resolve, 0))); await act(() => new Promise((resolve) => setTimeout(resolve, 0))); tree = component.toJSON(); const instance = component.root; expect(instance.findByType(Issue).props.issue.callable).toBe('run.test'); expect(instance.findByType(FilterControls).props.refetching).toBe(false); expect(tree).toMatchSnapshot(); });
import fs from 'fs'; import path from 'path'; import React from 'react'; import {mount} from 'enzyme'; import dedent from 'dedent-js'; import until from 'test-until'; import GitTabController from '../../lib/controllers/git-tab-controller'; import {cloneRepository, buildRepository, buildRepositoryWithPipeline} from '../helpers'; import Repository from '../../lib/models/repository'; import {GitError} from '../../lib/git-shell-out-strategy'; import ResolutionProgress from '../../lib/models/conflicts/resolution-progress'; describe('GitTabController', function() { let atomEnvironment, workspace, workspaceElement, commandRegistry, notificationManager, config, tooltips; let resolutionProgress, refreshResolutionProgress; let app; beforeEach(function() { atomEnvironment = global.buildAtomEnvironment(); workspace = atomEnvironment.workspace; commandRegistry = atomEnvironment.commands; notificationManager = atomEnvironment.notifications; config = atomEnvironment.config; tooltips = atomEnvironment.tooltips; workspaceElement = atomEnvironment.views.getView(workspace); resolutionProgress = new ResolutionProgress(); refreshResolutionProgress = sinon.spy(); const noop = () => {}; app = ( <GitTabController workspace={workspace} commandRegistry={commandRegistry} grammars={atomEnvironment.grammars} resolutionProgress={resolutionProgress} notificationManager={notificationManager} config={config} project={atomEnvironment.project} tooltips={tooltips} confirm={noop} ensureGitTab={noop} refreshResolutionProgress={refreshResolutionProgress} undoLastDiscard={noop} discardWorkDirChangesForPaths={noop} openFiles={noop} didSelectFilePath={noop} initializeRepo={noop} /> ); }); afterEach(function() { atomEnvironment.destroy(); }); it('displays a loading message in GitTabView while data is being fetched', async function() { const workdirPath = await cloneRepository('three-files'); fs.writeFileSync(path.join(workdirPath, 'a.txt'), 'a change\n'); fs.unlinkSync(path.join(workdirPath, 'b.txt')); const repository = new Repository(workdirPath); assert.isTrue(repository.isLoading()); app = React.cloneElement(app, {repository}); const wrapper = mount(app); assert.isTrue(wrapper.hasClass('is-loading')); assert.lengthOf(wrapper.find('EtchWrapper'), 1); assert.lengthOf(wrapper.find('CommitController'), 1); await assert.async.isFalse(wrapper.hasClass('is-loading')); assert.lengthOf(wrapper.find('EtchWrapper'), 1); assert.lengthOf(wrapper.find('CommitController'), 1); }); it('displays an initialization prompt for an absent repository', function() { const repository = Repository.absent(); app = React.cloneElement(app, {repository}); const wrapper = mount(app); assert.isTrue(wrapper.hasClass('is-empty')); assert.lengthOf(wrapper.find('.no-repository'), 1); }); it('keeps the state of the GitTabView in sync with the assigned repository', async function() { const workdirPath1 = await cloneRepository('three-files'); const repository1 = await buildRepository(workdirPath1); const workdirPath2 = await cloneRepository('three-files'); const repository2 = await buildRepository(workdirPath2); fs.writeFileSync(path.join(workdirPath1, 'a.txt'), 'a change\n'); fs.unlinkSync(path.join(workdirPath1, 'b.txt')); app = React.cloneElement(app, {repository: Repository.absent()}); const wrapper = mount(app); // Renders empty GitTabView when there is no active repository assert.isTrue(wrapper.prop('repository').isAbsent()); assert.lengthOf(wrapper.find('.no-repository'), 1); // Fetches data when a new repository is assigned // Does not update repository instance variable until that data is fetched wrapper.setProps({repository: repository1}); await assert.async.deepEqual(wrapper.find('GitTabView').prop('unstagedChanges'), await repository1.getUnstagedChanges()); wrapper.setProps({repository: repository2}); await assert.async.deepEqual(wrapper.find('GitTabView').prop('unstagedChanges'), await repository2.getUnstagedChanges()); // Fetches data and updates child view when the repository is mutated fs.writeFileSync(path.join(workdirPath2, 'a.txt'), 'a change\n'); fs.unlinkSync(path.join(workdirPath2, 'b.txt')); repository2.refresh(); await assert.async.deepEqual(wrapper.find('GitTabView').prop('unstagedChanges'), await repository2.getUnstagedChanges()); }); it('displays the staged changes since the parent commit when amending', async function() { const workdirPath = await cloneRepository('multiple-commits'); const repository = await buildRepository(workdirPath); const ensureGitTab = () => Promise.resolve(false); app = React.cloneElement(app, { repository, ensureGitTab, isAmending: false, }); const wrapper = mount(app); await assert.async.deepEqual(wrapper.find('GitTabView').prop('unstagedChanges'), []); await repository.setAmending(true); await assert.async.deepEqual( wrapper.find('GitTabView').prop('stagedChanges'), await repository.getStagedChangesSinceParentCommit(), ); }); it('fetches conflict marker counts for conflicting files', async function() { const workdirPath = await cloneRepository('merge-conflict'); const repository = await buildRepository(workdirPath); await assert.isRejected(repository.git.merge('origin/branch')); const rp = new ResolutionProgress(); rp.reportMarkerCount(path.join(workdirPath, 'added-to-both.txt'), 5); app = React.cloneElement(app, { repository, resolutionProgress: rp, }); mount(app); await assert.async.isTrue(refreshResolutionProgress.calledWith(path.join(workdirPath, 'modified-on-both-ours.txt'))); assert.isTrue(refreshResolutionProgress.calledWith(path.join(workdirPath, 'modified-on-both-theirs.txt'))); assert.isFalse(refreshResolutionProgress.calledWith(path.join(workdirPath, 'added-to-both.txt'))); }); describe('abortMerge()', function() { it('resets merge related state', async function() { const workdirPath = await cloneRepository('merge-conflict'); const repository = await buildRepository(workdirPath); await assert.isRejected(repository.git.merge('origin/branch')); const confirm = sinon.stub(); app = React.cloneElement(app, {repository, confirm}); const wrapper = mount(app); const view = wrapper.find('GitTabView'); await assert.async.isTrue(view.prop('isMerging')); assert.notEqual(view.prop('mergeConflicts').length, 0); assert.isOk(view.prop('mergeMessage')); confirm.returns(0); await wrapper.instance().getWrappedComponentInstance().abortMerge(); await assert.async.lengthOf(view.prop('mergeConflicts'), 0); assert.isFalse(view.prop('isMerging')); assert.isNull(view.prop('mergeMessage')); }); }); describe('prepareToCommit', function() { it('shows the git panel and returns false if it was hidden', async function() { const workdirPath = await cloneRepository('three-files'); const repository = await buildRepository(workdirPath); const ensureGitTab = () => Promise.resolve(true); app = React.cloneElement(app, {repository, ensureGitTab}); const wrapper = mount(app); assert.isFalse(await wrapper.instance().getWrappedComponentInstance().prepareToCommit()); }); it('returns true if the git panel was already visible', async function() { const workdirPath = await cloneRepository('three-files'); const repository = await buildRepository(workdirPath); const ensureGitTab = () => Promise.resolve(false); app = React.cloneElement(app, {repository, ensureGitTab}); const wrapper = mount(app); assert.isTrue(await wrapper.instance().getWrappedComponentInstance().prepareToCommit()); }); }); describe('commit(message)', function() { it('shows an error notification when committing throws an error', async function() { const workdirPath = await cloneRepository('three-files'); const repository = await buildRepositoryWithPipeline(workdirPath, {confirm, notificationManager, workspace}); sinon.stub(repository.git, 'commit').callsFake(async () => { await Promise.resolve(); throw new GitError('message'); }); app = React.cloneElement(app, {repository}); const wrapper = mount(app); notificationManager.clear(); // clear out any notifications try { await wrapper.instance().getWrappedComponentInstance().commit(); } catch (e) { assert(e, 'is error'); } assert.equal(notificationManager.getNotifications().length, 1); }); it('sets amending to false', async function() { const workdirPath = await cloneRepository('three-files'); const repository = await buildRepositoryWithPipeline(workdirPath, {confirm, notificationManager, workspace}); repository.setAmending(true); sinon.stub(repository.git, 'commit').callsFake(() => Promise.resolve()); const didChangeAmending = sinon.stub(); app = React.cloneElement(app, {repository, didChangeAmending}); const wrapper = mount(app); assert.isTrue(repository.isAmending()); await wrapper.instance().getWrappedComponentInstance().commit('message'); assert.isFalse(repository.isAmending()); }); }); it('selects an item by description', async function() { const workdirPath = await cloneRepository('three-files'); const repository = await buildRepository(workdirPath); fs.writeFileSync(path.join(workdirPath, 'unstaged-1.txt'), 'This is an unstaged file.'); fs.writeFileSync(path.join(workdirPath, 'unstaged-2.txt'), 'This is an unstaged file.'); fs.writeFileSync(path.join(workdirPath, 'unstaged-3.txt'), 'This is an unstaged file.'); repository.refresh(); app = React.cloneElement(app, {repository}); const wrapper = mount(app); await assert.async.lengthOf(wrapper.find('GitTabView').prop('unstagedChanges'), 3); const controller = wrapper.instance().getWrappedComponentInstance(); const gitTab = controller.refView; const stagingView = gitTab.refStagingView.getWrappedComponent(); sinon.spy(stagingView, 'setFocus'); await controller.focusAndSelectStagingItem('unstaged-2.txt', 'unstaged'); const selections = Array.from(stagingView.selection.getSelectedItems()); assert.lengthOf(selections, 1); assert.equal(selections[0].filePath, 'unstaged-2.txt'); assert.equal(stagingView.setFocus.callCount, 1); }); describe('focus management', function() { it('does nothing on an absent repository', function() { const repository = Repository.absent(); app = React.cloneElement(app, {repository}); const wrapper = mount(app); const controller = wrapper.instance().getWrappedComponentInstance(); assert.isTrue(wrapper.hasClass('is-empty')); assert.lengthOf(wrapper.find('.no-repository'), 1); controller.rememberLastFocus({target: null}); assert.strictEqual(controller.lastFocus, GitTabController.focus.STAGING); }); }); describe('keyboard navigation commands', function() { let wrapper, gitTab, stagingView, commitView, commitController, focusElement; const focuses = GitTabController.focus; const extractReferences = () => { gitTab = wrapper.instance().getWrappedComponentInstance().refView; stagingView = gitTab.refStagingView.getWrappedComponent(); commitController = gitTab.refCommitController; commitView = commitController.refCommitView; focusElement = stagingView.element; const stubFocus = element => { if (!element) { return; } sinon.stub(element, 'focus').callsFake(() => { focusElement = element; }); }; stubFocus(stagingView.element); stubFocus(commitView.editorElement); stubFocus(commitView.refAbortMergeButton); stubFocus(commitView.refAmendCheckbox); stubFocus(commitView.refCommitButton); sinon.stub(commitController, 'hasFocus').callsFake(() => { return [ commitView.editorElement, commitView.refAbortMergeButton, commitView.refAmendCheckbox, commitView.refCommitButton, ].includes(focusElement); }); }; const assertSelected = paths => { const selectionPaths = Array.from(stagingView.selection.getSelectedItems()).map(item => item.filePath); assert.deepEqual(selectionPaths, paths); }; describe('with conflicts and staged files', function() { beforeEach(async function() { const workdirPath = await cloneRepository('each-staging-group'); const repository = await buildRepository(workdirPath); // Merge with conflicts assert.isRejected(repository.git.merge('origin/branch')); fs.writeFileSync(path.join(workdirPath, 'unstaged-1.txt'), 'This is an unstaged file.'); fs.writeFileSync(path.join(workdirPath, 'unstaged-2.txt'), 'This is an unstaged file.'); fs.writeFileSync(path.join(workdirPath, 'unstaged-3.txt'), 'This is an unstaged file.'); // Three staged files fs.writeFileSync(path.join(workdirPath, 'staged-1.txt'), 'This is a file with some changes staged for commit.'); fs.writeFileSync(path.join(workdirPath, 'staged-2.txt'), 'This is another file staged for commit.'); fs.writeFileSync(path.join(workdirPath, 'staged-3.txt'), 'This is a third file staged for commit.'); await repository.stageFiles(['staged-1.txt', 'staged-2.txt', 'staged-3.txt']); repository.refresh(); const didChangeAmending = () => {}; app = React.cloneElement(app, {repository, didChangeAmending}); wrapper = mount(app); await assert.async.lengthOf(wrapper.find('GitTabView').prop('unstagedChanges'), 3); extractReferences(); }); it('blurs on tool-panel:unfocus', function() { sinon.spy(workspace.getActivePane(), 'activate'); commandRegistry.dispatch(wrapper.find('.github-Panel').getNode(), 'tool-panel:unfocus'); assert.isTrue(workspace.getActivePane().activate.called); }); it('advances focus through StagingView groups and CommitView, but does not cycle', function() { assertSelected(['unstaged-1.txt']); commandRegistry.dispatch(gitTab.refRoot, 'core:focus-next'); assertSelected(['conflict-1.txt']); commandRegistry.dispatch(gitTab.refRoot, 'core:focus-next'); assertSelected(['staged-1.txt']); commandRegistry.dispatch(gitTab.refRoot, 'core:focus-next'); assertSelected(['staged-1.txt']); assert.strictEqual(focusElement, commitView.editorElement); // This should be a no-op. (Actually, it'll insert a tab in the CommitView editor.) commandRegistry.dispatch(gitTab.refRoot, 'core:focus-next'); assertSelected(['staged-1.txt']); assert.strictEqual(focusElement, commitView.editorElement); }); it('retreats focus from the CommitView through StagingView groups, but does not cycle', function() { gitTab.setFocus(focuses.EDITOR); commandRegistry.dispatch(gitTab.refRoot, 'core:focus-previous'); assertSelected(['staged-1.txt']); commandRegistry.dispatch(gitTab.refRoot, 'core:focus-previous'); assertSelected(['conflict-1.txt']); commandRegistry.dispatch(gitTab.refRoot, 'core:focus-previous'); assertSelected(['unstaged-1.txt']); // This should be a no-op. commandRegistry.dispatch(gitTab.refRoot, 'core:focus-previous'); assertSelected(['unstaged-1.txt']); }); }); describe('with staged changes', function() { let repository; beforeEach(async function() { const workdirPath = await cloneRepository('each-staging-group'); repository = await buildRepository(workdirPath); // A staged file fs.writeFileSync(path.join(workdirPath, 'staged-1.txt'), 'This is a file with some changes staged for commit.'); await repository.stageFiles(['staged-1.txt']); repository.refresh(); const didChangeAmending = () => {}; const prepareToCommit = () => Promise.resolve(true); const ensureGitTab = () => Promise.resolve(false); app = React.cloneElement(app, {repository, ensureGitTab, prepareToCommit, didChangeAmending}); wrapper = mount(app); extractReferences(); await assert.async.isTrue(commitView.props.stagedChangesExist); }); it('focuses the CommitView on github:commit with an empty commit message', async function() { commitView.editor.setText(''); sinon.spy(wrapper.instance().getWrappedComponentInstance(), 'commit'); wrapper.update(); commandRegistry.dispatch(workspaceElement, 'github:commit'); await assert.async.strictEqual(focusElement, commitView.editorElement); assert.isFalse(wrapper.instance().getWrappedComponentInstance().commit.called); }); it('creates a commit on github:commit with a nonempty commit message', async function() { commitView.editor.setText('I fixed the things'); sinon.spy(repository, 'commit'); commandRegistry.dispatch(workspaceElement, 'github:commit'); await until('Commit method called', () => repository.commit.calledWith('I fixed the things')); }); }); }); describe('integration tests', function() { it('can stage and unstage files and commit', async function() { const workdirPath = await cloneRepository('three-files'); const repository = await buildRepository(workdirPath); fs.writeFileSync(path.join(workdirPath, 'a.txt'), 'a change\n'); fs.unlinkSync(path.join(workdirPath, 'b.txt')); const ensureGitTab = () => Promise.resolve(false); app = React.cloneElement(app, {repository, ensureGitTab}); const wrapper = mount(app); await assert.async.lengthOf(wrapper.find('GitTabView').prop('unstagedChanges'), 2); const gitTab = wrapper.instance().getWrappedComponentInstance().refView; const stagingView = gitTab.refStagingView.getWrappedComponent(); const commitView = wrapper.find('CommitView'); assert.lengthOf(stagingView.props.unstagedChanges, 2); assert.lengthOf(stagingView.props.stagedChanges, 0); stagingView.dblclickOnItem({}, stagingView.props.unstagedChanges[0]); await assert.async.lengthOf(stagingView.props.unstagedChanges, 1); assert.lengthOf(stagingView.props.stagedChanges, 1); stagingView.dblclickOnItem({}, stagingView.props.unstagedChanges[0]); await assert.async.lengthOf(stagingView.props.unstagedChanges, 0); assert.lengthOf(stagingView.props.stagedChanges, 2); stagingView.dblclickOnItem({}, stagingView.props.stagedChanges[1]); await assert.async.lengthOf(stagingView.props.unstagedChanges, 1); assert.lengthOf(stagingView.props.stagedChanges, 1); commitView.find('atom-text-editor').getNode().getModel().setText('Make it so'); commitView.find('.github-CommitView-commit').simulate('click'); await assert.async.equal((await repository.getLastCommit()).getMessage(), 'Make it so'); }); it('can stage merge conflict files', async function() { const workdirPath = await cloneRepository('merge-conflict'); const repository = await buildRepository(workdirPath); await assert.isRejected(repository.git.merge('origin/branch')); const confirm = sinon.stub(); app = React.cloneElement(app, {repository, confirm}); const wrapper = mount(app); await assert.async.lengthOf(wrapper.find('GitTabView').prop('mergeConflicts'), 5); const stagingView = wrapper.instance().getWrappedComponentInstance().refView.refStagingView.getWrappedComponent(); assert.equal(stagingView.props.mergeConflicts.length, 5); assert.equal(stagingView.props.stagedChanges.length, 0); const conflict1 = stagingView.props.mergeConflicts.filter(c => c.filePath === 'modified-on-both-ours.txt')[0]; const contentsWithMarkers = fs.readFileSync(path.join(workdirPath, conflict1.filePath), {encoding: 'utf8'}); assert.include(contentsWithMarkers, '>>>>>>>'); assert.include(contentsWithMarkers, '<<<<<<<'); // click Cancel confirm.returns(1); let result = stagingView.dblclickOnItem({}, conflict1); await result.stageOperationPromise; await result.selectionUpdatePromise; await assert.async.isTrue(confirm.calledOnce); assert.lengthOf(stagingView.props.mergeConflicts, 5); assert.lengthOf(stagingView.props.stagedChanges, 0); // click Stage confirm.reset(); confirm.returns(0); result = stagingView.dblclickOnItem({}, conflict1); await result.stageOperationPromise; await result.selectionUpdatePromise; await assert.async.isTrue(confirm.calledOnce); await assert.async.lengthOf(stagingView.props.mergeConflicts, 4); assert.lengthOf(stagingView.props.stagedChanges, 1); // clear merge markers const conflict2 = stagingView.props.mergeConflicts.filter(c => c.filePath === 'modified-on-both-theirs.txt')[0]; confirm.reset(); fs.writeFileSync(path.join(workdirPath, conflict2.filePath), 'text with no merge markers'); stagingView.dblclickOnItem({}, conflict2); await assert.async.lengthOf(stagingView.props.mergeConflicts, 3); assert.lengthOf(stagingView.props.stagedChanges, 2); assert.isFalse(confirm.called); }); it('avoids conflicts with pending file staging operations', async function() { const workdirPath = await cloneRepository('three-files'); const repository = await buildRepository(workdirPath); fs.unlinkSync(path.join(workdirPath, 'a.txt')); fs.unlinkSync(path.join(workdirPath, 'b.txt')); app = React.cloneElement(app, {repository}); const wrapper = mount(app); const stagingView = wrapper.instance().getWrappedComponentInstance().refView.refStagingView.getWrappedComponent(); await assert.async.lengthOf(stagingView.props.unstagedChanges, 2); // ensure staging the same file twice does not cause issues // second stage action is a no-op since the first staging operation is in flight const file1StagingPromises = stagingView.confirmSelectedItems(); stagingView.confirmSelectedItems(); await file1StagingPromises.stageOperationPromise; await file1StagingPromises.selectionUpdatePromise; await assert.async.lengthOf(stagingView.props.unstagedChanges, 1); const file2StagingPromises = stagingView.confirmSelectedItems(); await file2StagingPromises.stageOperationPromise; await file2StagingPromises.selectionUpdatePromise; await assert.async.lengthOf(stagingView.props.unstagedChanges, 0); }); it('updates file status and paths when changed', async function() { const workdirPath = await cloneRepository('three-files'); const repository = await buildRepository(workdirPath); fs.writeFileSync(path.join(workdirPath, 'new-file.txt'), 'foo\nbar\nbaz\n'); app = React.cloneElement(app, {repository}); const wrapper = mount(app); const stagingView = wrapper.instance().getWrappedComponentInstance().refView.refStagingView.getWrappedComponent(); await assert.async.include(stagingView.props.unstagedChanges.map(c => c.filePath), 'new-file.txt'); const [addedFilePatch] = stagingView.props.unstagedChanges; assert.equal(addedFilePatch.filePath, 'new-file.txt'); assert.equal(addedFilePatch.status, 'added'); const patchString = dedent` --- /dev/null +++ b/new-file.txt @@ -0,0 +1,1 @@ +foo `; // partially stage contents in the newly added file await repository.git.applyPatch(patchString, {index: true}); repository.refresh(); // since unstaged changes are calculated relative to the index, // which now has new-file.txt on it, the working directory version of // new-file.txt has a modified status await until('modification arrives', () => { const [modifiedFilePatch] = stagingView.props.unstagedChanges; return modifiedFilePatch.status === 'modified' && modifiedFilePatch.filePath === 'new-file.txt'; }); }); }); });
'use strict' // Convert component name to macro name // // This helper function takes a component name and returns the corresponding // macro name. // // Component names are lowercase, dash-separated strings (button, date-input), // whilst macro names have a `govuk` prefix and are camel cased (govukButton, // govukDateInput). const componentNameToMacroName = componentName => { const macroName = componentName .toLowerCase() .split('-') // capitalize each 'word' .map(word => word.charAt(0).toUpperCase() + word.slice(1)) .join('') return `govuk${macroName}` } exports.componentNameToMacroName = componentNameToMacroName // Convert component name to JavaScript UMD module name // // This helper function takes a component name and returns the corresponding // module name, which is used by rollup to set the `window` global and UMD/AMD export name // // Component names are lowercase, dash-separated strings (button, date-input), // whilst module names have a `GOVUKFrontend.` prefix and are pascal cased (GOVUKFrontend.Button, // GOVUKFrontend.CharacterCount). const componentNameToJavaScriptModuleName = componentName => { const macroName = componentName .toLowerCase() .split('-') // capitalize each 'word' .map(word => word.charAt(0).toUpperCase() + word.slice(1)) .join('') return `GOVUKFrontend.${macroName}` } exports.componentNameToJavaScriptModuleName = componentNameToJavaScriptModuleName
import requestRedraw from '../src/requestRedraw'; describe('document', () => { beforeEach(() => { global.requestAnimationFrame = () => {}; }); afterEach(() => { delete global.requestAnimationFrame; // Jest triggers test environment setup/teardown per test suite, // not per test, so we reset '__d3fc-elements__' after each test here. delete document['__d3fc-elements__']; }); it('should enqueue a single element', () => { document.body.innerHTML = '<div></div>'; const element = document.querySelector('div'); requestRedraw(element); expect(document['__d3fc-elements__'].queue).toEqual([element]); }); it('should not enqueue a duplicate element', () => { document.body.innerHTML = '<div></div>'; const element = document.querySelector('div'); requestRedraw(element); requestRedraw(element); expect(document['__d3fc-elements__'].queue).toEqual([element]); }); it('should enqueue an ancestor and drop the original element', () => { document.body.innerHTML = '<div><a></a></div>'; let element = document.querySelector('a'); requestRedraw(element); expect(document['__d3fc-elements__'].queue).toEqual([element]); element = document.querySelector('div'); requestRedraw(element); expect(document['__d3fc-elements__'].queue).toEqual([element]); }); it('should not enqueue element if an ancestor is enqueued', () => { document.body.innerHTML = '<div><a></a></div>'; let element = document.querySelector('div'); requestRedraw(element); expect(document['__d3fc-elements__'].queue).toEqual([element]); requestRedraw(document.querySelector('a')); expect(document['__d3fc-elements__'].queue).toEqual([element]); }); });
'use strict'; angular.module("ngLocale", [], ["$provide", function ($provide) { var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"}; $provide.value("$locale", { "DATETIME_FORMATS": { "AMPMS": [ "AM", "PM" ], "DAY": [ "dimanche", "lundi", "mardi", "mercredi", "jeudi", "vendredi", "samedi" ], "MONTH": [ "janvier", "f\u00e9vrier", "mars", "avril", "mai", "juin", "juillet", "ao\u00fbt", "septembre", "octobre", "novembre", "d\u00e9cembre" ], "SHORTDAY": [ "dim.", "lun.", "mar.", "mer.", "jeu.", "ven.", "sam." ], "SHORTMONTH": [ "janv.", "f\u00e9vr.", "mars", "avr.", "mai", "juin", "juil.", "ao\u00fbt", "sept.", "oct.", "nov.", "d\u00e9c." ], "fullDate": "EEEE d MMMM y", "longDate": "d MMMM y", "medium": "d MMM y HH:mm:ss", "mediumDate": "d MMM y", "mediumTime": "HH:mm:ss", "short": "dd/MM/yy HH:mm", "shortDate": "dd/MM/yy", "shortTime": "HH:mm" }, "NUMBER_FORMATS": { "CURRENCY_SYM": "\u20ac", "DECIMAL_SEP": ",", "GROUP_SEP": "\u00a0", "PATTERNS": [ { "gSize": 3, "lgSize": 3, "macFrac": 0, "maxFrac": 3, "minFrac": 0, "minInt": 1, "negPre": "-", "negSuf": "", "posPre": "", "posSuf": "" }, { "gSize": 3, "lgSize": 3, "macFrac": 0, "maxFrac": 2, "minFrac": 2, "minInt": 1, "negPre": "(", "negSuf": "\u00a0\u00a4)", "posPre": "", "posSuf": "\u00a0\u00a4" } ] }, "id": "fr-bi", "pluralCat": function (n) { if (n >= 0 && n <= 2 && n != 2) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER; } }); }]);
// // SecureImage // // Copyright © 2018 Province of British Columbia // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // Created by Jason Leach on 2018-01-10. // /* eslint-env es6 */ 'use strict'; import dotenv from 'dotenv'; import nconf from 'nconf'; import path from 'path'; const env = process.env.NODE_ENV || 'development'; if (env === 'development') { dotenv.config(); } /** * These settings contain sensitive information and should not be * stored in the repo. They are extracted from environment variables * and added to the config. */ // overrides are always as defined nconf.overrides({ environment: env, host: process.env.HOST || '127.0.0.1', port: process.env.PORT || 8000, db: { user: process.env.POSTGRESQL_USER, password: process.env.POSTGRESQL_PASSWORD, database: process.env.POSTGRESQL_DATABASE, host: process.env.POSTGRESQL_HOST, }, }); // load other properties from file. nconf.argv() .env() .file({ file: path.join(__dirname, `${env}.json`) }); // if nothing else is set, use defaults. This will be set if // they do not exist in overrides or the config file. nconf.defaults({ appUrl: process.env.APP_URL || `http://${process.env.HOST}:${process.env.PORT}`, }); export default nconf;
import React from "react" import contactFormStyles from "./contact.module.scss" import contactTopStyles from "./contact.module.scss" const ContactForm = () => { return ( <div className={contactTopStyles.contactForm}> <form name="contact" className={contactFormStyles.form} method="post" data-netlify="true" data-netlify-honeypot="bot-field" > <input type="hidden" name="bot-field" />{" "} <input type="hidden" name="form-name" value="contact" />{" "} <div className={contactFormStyles.formField}> <input className={contactFormStyles.textField} type="text" placeholder="First name" name="name" id="name" required /> <input className={contactFormStyles.emailField} type="text" placeholder="Your email" name="email" id="email" required /> <textarea name="message" placeholder="Your message" className={contactFormStyles.textareaField} id="message" rows="6" required /> <ul className={contactFormStyles.actions}> <li> <input type="submit" value="Send Message" className={contactFormStyles.submitButton} /> </li> </ul> </div> </form> </div> ) } export default ContactForm
/* Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ CKEDITOR.plugins.setLang( 'link', 'ka', { acccessKey: 'წვდომის ღილაკი', advanced: 'დაწვრილებით', advisoryContentType: 'შიგთავსის ტიპი', advisoryTitle: 'სათაური', anchor: { toolbar: 'ღუზა', menu: 'ღუზის რედაქტირება', title: 'ღუზის პარამეტრები', name: 'ღუზუს სახელი', errorName: 'აკრიფეთ ღუზის სახელი', remove: 'Remove Anchor' }, anchorId: 'ელემენტის Id-თ', anchorName: 'ღუზის სახელით', charset: 'კოდირება', cssClasses: 'CSS კლასი', download: 'Force Download', // MISSING displayText: 'Display Text', // MISSING emailAddress: 'ელფოსტის მისამართები', emailBody: 'წერილის ტექსტი', emailSubject: 'წერილის სათაური', id: 'Id', info: 'ბმულის ინფორმაცია', langCode: 'ენის კოდი', langDir: 'ენის მიმართულება', langDirLTR: 'მარცხნიდან მარჯვნივ (LTR)', langDirRTL: 'მარჯვნიდან მარცხნივ (RTL)', menu: 'ბმულის რედაქტირება', name: 'სახელი', noAnchors: '(ამ დოკუმენტში ღუზა არაა)', noEmail: 'აკრიფეთ ელფოსტის მისამართი', noUrl: 'აკრიფეთ ბმულის URL', noTel: 'Please type the phone number', // MISSING other: '<სხვა>', phoneNumber: 'Phone number', // MISSING popupDependent: 'დამოკიდებული (Netscape)', popupFeatures: 'Popup ფანჯრის პარამეტრები', popupFullScreen: 'მთელი ეკრანი (IE)', popupLeft: 'მარცხენა პოზიცია', popupLocationBar: 'ნავიგაციის ზოლი', popupMenuBar: 'მენიუს ზოლი', popupResizable: 'ცვალებადი ზომით', popupScrollBars: 'გადახვევის ზოლები', popupStatusBar: 'სტატუსის ზოლი', popupToolbar: 'ხელსაწყოთა ზოლი', popupTop: 'ზედა პოზიცია', rel: 'კავშირი', selectAnchor: 'აირჩიეთ ღუზა', styles: 'CSS სტილი', tabIndex: 'Tab-ის ინდექსი', target: 'გახსნის ადგილი', targetFrame: '<frame>', targetFrameName: 'Frame-ის სახელი', targetPopup: '<popup ფანჯარა>', targetPopupName: 'Popup ფანჯრის სახელი', title: 'ბმული', toAnchor: 'ბმული ტექსტში ღუზაზე', toEmail: 'ელფოსტა', toUrl: 'URL', toPhone: 'Phone', // MISSING toolbar: 'ბმული', type: 'ბმულის ტიპი', unlink: 'ბმულის მოხსნა', upload: 'აქაჩვა' } );
const { getPosts, createPost, updatePost, getPostById, deletePost, } = require("./post.controller"); const router = require("express").Router(); const { checkToken } = require("../auth/token_validation"); router.get("/", checkToken, getPosts); router.post("/", checkToken, createPost); router.patch("/:id", checkToken, updatePost); router.get("/:id", checkToken, getPostById); router.delete("/:id", checkToken, deletePost); module.exports = router;
import { getQueryStringResults } from '@plone/volto/actions'; export default ({ dispatch, data, path }) => { return [ dispatch( getQueryStringResults( path, { ...data.querystring, ...(data.variation?.fullobjects ? { fullobjects: 1 } : { metadata_fields: '_all' }), }, data.block, ), ), ]; };
export const initialState = { loading: false, loaded: false, error: false, data: null }; const setLoading = (state, loading) => ({ ...state, loading }); const setError = (state, error) => ({ ...state, error }); const setLoaded = (state, loaded) => ({ ...state, loaded }); export default { fetchNDCSDocumentsInit: state => setLoading(state, true), fetchNDCSDocumentsReady: (state, { payload }) => setLoaded( setLoading( { ...state, data: payload }, false ), true ), fetchNDCSDocumentsFail: state => setError(state, true) };
const request = require('supertest'); const { model, connection } = require('mongoose'); const { it, before, describe, afterEach } = require('mocha'); const User = model('User'); const { createUser } = require('@helpers/utils'); const express = require('@config/lib/express'); const { prefix } = require('@config/index'); let app; const credentials = { username: 'username', password: 'jsI$Aw3$0m3', }; let agent; /** * Sections tests */ describe('tests for module "modules:{{{lowercase name}}}"', () => { before(async () => { // Get application app = await express.init(connection.db); agent = request.agent(app); }); describe('"modules:{{{lowercase name}}}" is up', () => { it('I am not allowed to call the API if I do not have the IAM "modules:{{{lowercase name}}}:ok"', async () => { await createUser(credentials, []); await agent.post('/api/v1/auth/signin').send(credentials).expect(200); await agent.get(`${prefix}/{{{lowercase name}}}/ok`).expect(403); }); it('I am allowed to call the API if I have the IAM "modules:{{{lowercase name}}}:ok"', async () => { await createUser(credentials, ['modules:{{{lowercase name}}}:ok']); await agent.post('/api/v1/auth/signin').send(credentials).expect(200); await agent.get(`${prefix}/{{{lowercase name}}}/ok`).expect(200); }); }); afterEach(async () => { await Promise.all([User.remove()]); }); });
import {promises as fs} from 'fs'; export const prefixes = ['file:']; export const suffixes = []; // Following was adapted from the example in the Node.js docs // https://nodejs.org/api/esm.html#esm_code_resolve_code_hook export async function resolve(specifier, context, defaultResolve) { if (process.env.DEBUG === 'true') { console.log( `### Resolving resource in basic resourceProvider for ${specifier}\n` ); } return defaultResolve(specifier, context, defaultResolve); } export function getResourceProvider() { return { async getResource(url) { if (process.env.DEBUG === 'true') { console.log( `### Getting resource in basic resourceProvider for ${url}\n` ); } return fs.readFile(new URL(url), 'utf8'); }, }; }
var BANGLE_CODE = ` setInterval(function () { console.log("wrote data"); now = new Date(); light = Puck.light(); temperature = Puck.getTemperature(); accel = Puck.accel().acc; recFile = require("Storage").open("logging.csv","a"); recFile.write([now,temperature,light,accel.x,accel.y,accel.z].join(",")+";"); console.log([now,temperature,light,accel.x,accel.y,accel.z].join(",")); }, 300000);\n `; // When we click the connect button... document.getElementById("btnConnect").addEventListener("click", function() { $("#pb_div").show(); Puck.write('reset();',function(){ $("#progress_bar").removeClass('bg-success'); Puck.setTime(); Puck.write(BANGLE_CODE, function(){ console.log('connected and installed 1button'); $("#pb_div").hide(); }); }); }) function saveCSV(filename, csvData) { let a = document.createElement("a"), file = new Blob([csvData], {type: "Comma-separated value file"}); let url = URL.createObjectURL(file); a.href = url; a.download = filename+".csv"; document.body.appendChild(a); a.click(); setTimeout(function() { document.body.removeChild(a); window.URL.revokeObjectURL(url); }, 0); $("#pb_div").hide(); console.log('finished download') } function saveButtonRecord(record,name) { var csv = `${record.map(rec=>[rec.time,rec.temperature,rec.light,rec.x,rec.y,rec.z].join(",")).join("\n")}`; csv = csv + "\n"; console.log(csv); saveCSV(name, csv); }; //now,temperature,light,accel.x,accel.y,accel.z function ButtonRecordLineToObject(l) { var t = l.trim().split(","); var o = { time: t[0], temperature: parseFloat(t[1]), light: parseFloat(t[2]), x: parseFloat(t[3]), y: parseFloat(t[4]), z: parseFloat(t[5]), }; return o; }; function downloadButtonPresses(callback) { var flength; var record; Puck.eval('require("Storage").open("logging.csv","r").getLength()',function(x){ flength=x; Puck.eval('require("Storage").open("logging.csv","r").read('+flength+')',function(data){ record = data.slice(0, -1).split(";").map(l=>ButtonRecordLineToObject(l)); callback(record); }) }); } function deleteButtonPresses(callback) { Puck.eval('require("Storage").open("logging.csv","r").erase()',function(x){ console.log('deleted storage'); }); } document.getElementById("btnDownload").addEventListener("click", function() { console.log('start download'); $("#pb_div").show(); }); document.getElementById("btnDownload").addEventListener("click", function() { downloadButtonPresses(record => saveButtonRecord(record, `puck_logging.csv`)); }); document.getElementById("btnErase").addEventListener("click", function() { if (confirm("Are you sure? This will delete all of your button presses!")) { deleteButtonPresses(); } });
#!/usr/bin/env node process.env.CLI_CALL = 'true'; require('@gitzone/tsrun'); const cliTool = require('./ts/index'); cliTool.runCli();
import { product } from 'C:/Users/Joshua De los Santos/Desktop/m2/myapp/mock-connector' export default async function pdp(req, res) { const { productId } = req.query console.log('In pdp:'); console.log(productId); return res.json(await product({ id: productId }, req, res)) }
function get_timer_403() { var day = "00"; var hour = new Date().getHours(); var min = new Date().getMinutes(); var sec = new Date().getSeconds(); hour = 23 - hour; min = 59 - min; sec = 59 - sec; if(hour < 10){hour = '0' + hour;} if(min < 10){min = '0' + min;} if(sec < 10){sec = '0' + sec;} $(".dTimer .result-day").text(day); $(".dTimer .result-hour").text(hour); $(".dTimer .result-minute").text(min); $(".dTimer .result-second").text(sec); } function getfrominputs_403(){ get_timer_403(); setInterval(function(){ get_timer_403(); },1000);} $(document).ready(function(){ getfrominputs_403(); });
export default { "A name is required":"Введите имя", "Age":"Возраст", "Total money spent, $":"Всего денег вложено, $", "Clients":"Клиенты", "Income":"Доход", "First name":"Имя", "Last name":"Фамилия", "Position":"Должность", "Click to select":"Выберите", "Notifications":"Уведомления", "Yes":"Да", "No":"Нет", "City, country":"Город, страна", "Address":"Адрес", "Birthday":"День рождения", "Click to add tags":"Добавьте теги", "Notes":"Заметки", "Reset":"Сбросить", "Save":"Сохранить", "Top clients":"Самые активные клиенты", "Money spent, $":"Денег вложено, $", "-- Not selected --":"-- Не выбрано --", "Sales manager":"Менеджер по продаж.", "Customer service":"Работа с клиентами", "General manager":"Генеральный директор", "Awarded Badges":"Присвоенные теги", "New":"Новичок", "Customer":"Клиент", "Supplier":"Поставщик", "Discount":"Скидка", "Old Buddy":"Дружище", "Avid Supporter":"Ярый поклонник", "Date":"Дата", "Payment":"Платеж", "Purchase":"Покупка", "Sum":"Сумма", "Left":"Остаток", "Nothing on this day":"В этот день платежей не было", "Information":"Информация", "Statistics":"Статистика", "Transactions":"Транзакции", "Customers":"Клиенты", "Charts":"Диаграммы", "See all notifications":"Все уведомления", "Deposits News":"Новости по вкладам", "Dear client, we inform you about the following changes: beginning from September 24, 2018 all transactions (incoming and out...":"Уважаемый клиент, сообщаем Вам о следующих изменениях: начиная с 24 сентября 2018 года все транзакции (входящие и...", "Search Improved":"Улучшен поиск", "Dear client! Following the latest updates of the SeekMeEverywhere engines, your search has become more reliable and convenient! No...":"Уважаемый клиент! Вслед за обновлениями движков SeekMeEverywhere, поиск по приложению стал более...", "Transaction Reports":"Отчеты по транзакциям", "Dear client, we inform you about a change in the date of monthly transaction reports. Beginning from September 20, 2018 reports...":"Уважаемый клиент, сообщаем вам об изменении даты ежемесячных отчетов по транзакциям. Начиная с 20...", "Warning":"Внимание", "Dear client, we know where you store your passwords. We highly recommend you to memorize them and destroy those memos of yours.":"Уважаемый клиент, мы знаем, где вы храните свои пароли. Настоятельно рекомендуем вам запомнить их уже наконец.", "Editing customers data":"Редактирование данных", "Dear client, if you want to see the details on every customer and edit them, double-click the customer in the list on the right.":"Чтобы посмотреть и редактировать информацию о клиентах, дважды кликните на нужном клиенте в списке справа.", "We miss you":"Мы скучаем по вам", "Dear client, it has been a while since you talked to us. We are waiting for you in the same place at the same time.":"Уважаемый клиент, что-то мы давно с вами не разговаривали. Ждем вас в том же месте и в то же время.", "Have a nice day":"Хорошего вам дня", "Dear client, whenever you are reading this, we wish you a merry day. May the luck and success attend you.":"Уважаемый клиент, если вы читаете это, значит мы желаем вам веселого дня. Да пребудут с вами удача и успех.", "Localization":"Локализация", "Dear client, you can pick one of the six languages we provided for this demo app. Click the icon in the top right corner.":"Уважаемый клиент, вы можете выбрать один из 6 языков. Кликните по иконке в правом верхнем углу.", "We love you":"Мы любим вас", "Dear client, we love you very much. If our feelings are mutual, contact us and download Webix. Then we will love you eternally.":"Уважаемый клиент, мы вас очень-очень любим. Пишите нам и качайте Webix. Тогда мы будем любить вас вечно.", "Persons":"Клиенты", "Click twice to see more goodies":"Кликните дважды, чтобы открыть <br>дополнительную информацию", "Saved":"Сохранено", "Settings":"Настройки", "Regional settings":"Региональные настройки", "Language":"Языки", "Date format":"Формат даты", "Money format":"Денежный формат", "Environment settings":"Настройки среды", "Theme":"Тема", "Light":"Светлая", "Dark":"Темная", "Max list length":"Максимальная длина списка", "Default settings":"Настройки по умолчанию", "Open latest notifications":"Открыть последние уведомления", "Go to settings":"Перейти к настройкам", "All":"Все", "Payments":"Платежи", "Incoming":"Входящие", "Email":"Email", "Widgets":"Виджеты", "Demos":"Демо", "Prices":"Цены", "Tutorials":"Уроки", "Tirane, Albania":"Тирана, Албания", "Buenos Aires, Argentina":"Буэнос Айрес, Аргентина", "Canberra, Australia":"Канберра, Австралия", "Vienna, Austria":"Венна, Австрия", "Minsk, Belarus":"Минск, Беларусь", "Brussels, Belgium":"Брюссель, Бельгия", "Brasilia, Brazil":"Бразилиа, Бразилия", "Ottawa, Canada":"Оттава, Канада", "Beijing, China":"Пекин, Китай", "Prague, Czech Republic":"Прага, Чехия", "Copenhagen, Denmark":"Копенгаген, Дания", "Cairo, Egypt":"Каир, Египет", "Helsinki, Finland":"Хельсинки, Финляндия", "Paris, France":"Париж, Франция", "Tbilisi, Georgia":"Тбилиси, Грузия", "Berlin, Germany":"Берлин, Германия", "New Delhi, India":"Нью Дели, Индия", "Dublin, Ireland":"Дублин, Ирландия", "Rome, Italy":"Рим, Италия", "Tokyo, Japan":"Токио, Япония", "Wellington, New Zealand":"Веллингтон, Новая Зеландия", "Seoul, Republic of Korea":"Сеул, Южная Корея", "Madrid, Spain":"Мадрид, Испания", "Stockholm, Sweden":"Стокгольм, Швеция", "Washington, United States":"Вашингтон, США", "Payment History":"История платежей", "Origin of clients":"Откуда клиенты", "Income from various age groups":"Доход от клиентов разного возраста", "Clients by occupation":"Должности клиентов", "No new notifications":"Нет новых уведомлений", "Settings have been applied":"Настройки применены", "View detailed client's":"Смотреть подробности: ", "Born":"Дата рождения", "Client's name is ":"Имя клиента ", "Client's last name is ":"Фамилия клиента ", "Client is ":"Клиенту ", "Next birthday is on ":"Следующий день рождения ", "The position that client occupies within their company":"Должность, занимаемая клиентом в компании", "Not selected":"Не выбрано", "You will receive email notifications about actions performed by this client.":"Вы будете получать уведомления о действиях клиента.", "You will receive no email notifications.":"Вы не будете получать уведомлений.", "The city where the client works":"Город, в котором клиент работает", "The address of the client's office":"Адрес, по которому находится офис клиента", "Not specified":"Не указано", "The working email address of the client":"Рабочая почта клиента", "The badges unlocked by the client":"Значки клиента", "No badges":"Нет значков", "Click to clean the form":"Очистить форму", "The card with which the payment was made":"Карточка, с которой совершен платеж", "Outgoing":"Исходящий", " payment":" платеж", "Search for a client":"Искать клиента", "Reset to default settings":"Сбросить до настроек по умолчанию", "Choose the language of the interface":"Выбрать язык интерфейса", "Pick the date format that will be used to display dates in the datatables":"Выберите формат дат, который будет использован для отображения дат в таблицах", "Change the color of the sidebar and toolbars":"Измените цвет сайдбара и тулбаров", "Choose the length of the transactions list (datatable)":"Выберите длину отображаемого списка платежей", "Click to collapse / expand the sidebar":"Свернуть / развернуть сайдбар", "Display":"Показать", "transactions":"платежи", "Click to sort the list by shops":"Отсортировать по названиям магазинов", "Total money flow: ":"Общий денежный оборот: " };
H5PEditor.language.core = { missingTranslation: '[Itzulpen galdua :key]', loading: 'Kargatzen, itxaron...', selectLibrary: 'Hautatu edukia garatzeko erabili nahi duzun liburutegia.', unknownFieldPath: 'Ezin da aurkitu ":path".', notImageField: '":path" ez da irudi bat.', notImageOrDimensionsField: '":path" ez da irudi edo dimentsio eremua.', requiredProperty: ':property beharrezkoa da eta balio bat izan behar du.', onlyNumbers: ':property balioa soilik zenbakiak izan behar ditu.', illegalDecimalNumber: ':property can only contain numbers with max :decimals decimals.', exceedsMax: ':property balioak :max maximoa gainditzen du.', listExceedsMax: 'Zerrendaren elementu kopuruak :max maximoa gainditzen du.', belowMin: ':property balioa :min minimoaren azpitik dago.', listBelowMin: 'Zerrendak gutxienez :min elementu izan behar ditu ongi funtzionatzeko.', outOfStep: ':property balioak soilik :step -ko urratsetan alda daiteke.', add: 'Gehitu', addFile: 'Gehitu fitxategia', removeFile: 'Kendu fitxategia', confirmRemoval: 'Ziur zaude :type hau kendu nahi duzula?', removeImage: 'Kendu irudia', confirmImageRemoval: 'Honek irudia kenduko du. Ziru zaude kendu nahi duzula?', changeFile: 'Aldatu fitxategia', changeLibrary: 'Aldatu ariketa mota?', semanticsError: 'Errore semantikoa: :error', missingProperty: ':index eremuak bere :property propietatea galdu du.', expandCollapse: 'Zabaldu/Bildu', addEntity: 'Gehitu :entity', tooLong: 'Eremuaren balioa luzeegia da, gehienez :max letra izan ditzake.', invalidFormat: 'Eremuaren balioak formatu baliogabea edo debekatuta dauden karaktereak dauzka.', confirmChangeLibrary: 'Hori egiten baduzu oraingo eduki motaz egindako lan guztia galduko duzu. Ziur zaude ariketa mota aldatu nahi duzula?', commonFields: 'Testu gainidazteak eta itzulpenak', commonFieldsDescription: 'Bertan ezarpenak editatzen ahal dutuzu edo ariketa honetako testua itzul dezakezu.', uploading: 'Kargatzen, itxaron...', noFollow: 'Ezin da ":path" eremua aurkitu.', editCopyright: 'Editatu copyrighta', close: 'Itxi', tutorial: 'Tutoriala', editMode: 'Edizio modua', listLabel: 'Zerrendatu', uploadError: 'Fitxategiaren karga errorea', fileToLarge: 'Kargatzen saiatzen ari zaren fitxategia handiegia izan daiteke.', unknownFileUploadError: 'Fitxategiaren karga errore ezezaguna', noSemantics: 'Errorea, ezin izan da kargatu ariketa motaren formularioa.', editImage: 'Editatu irudia', saveLabel: 'Gorde', cancelLabel: 'Utzi', resetToOriginalLabel: 'Berrezarri jatorrizkoa', loadingImageEditor: 'Irudi editorea kargatzen, itxaron...', selectFiletoUpload: 'Hautatu kargatu nahi duzun fitxategia', or: 'edo', enterAudioUrl: 'Sartu audio iturriaren URLa', enterVideoUrl: 'Enter video URL', enterAudioTitle: 'Itsatsi esteka edo bestelako audio iturriaren URLa', enterVideoTitle: 'Itsatsi YouTubeko esteka edo bestelako bideo iturriaren URLa', uploadAudioTitle: 'Kargatu audio fitxategia', uploadVideoTitle: 'Kargatu bideo fitxategia', addVideoDescription: 'H5P supports all external video sources formatted as mp4, webm or ogv, like Vimeo Pro, and has support for YouTube and Panopto links.', insert: 'Txertatu', cancel: 'Utzi', height: 'altuera', width: 'zabalera', textField: 'testu eremua', numberField: 'eremu numerikoa', orderItemUp: 'Ordenean gora eraman', orderItemDown: 'Ordenean behera eraman', removeItem: 'Kendu elementua', hubPanelLabel: 'Hautatu ariketa mota', importantInstructions: 'Jarraibide garrantzitsuak', showImportantInstructions: 'Erakutsi jarraibideak', hideImportantInstructions: 'Ezkutatu jarraibide garrantzitsuak', hide: 'Ezkutatu', example: 'Adibidea', createContentTabLabel: 'Sortu ariketa', uploadTabLabel: 'Kargatu', uploadPlaceholder: 'Ez dago hautaturiko fitxategirik', uploadInstructionsTitle: 'Kargatu H5P fitxategi bat.', uploadInstructionsContent: 'Has zaitezke <a href="https://h5p.org/content-types-and-applications" target="blank">H5P.org</a> web-orriko adibideekin.', uploadFileButtonLabel: 'Kargatu fitxategi bat', uploadFileButtonChangeLabel: 'Aldatu fitxategia', uploadingThrobber: 'Oraintxe ari da kargatzen...', uploadSuccess: ':titulua ongi kargatu da!', unableToInterpretError: 'Ezin da erantzuna interpretatu.', unableToInterpretSolution: 'Aztertu zure akatsen erregistroa.', h5pFileWrongExtensionTitle: 'Hautatu duzun fitxategia ezin da kargatu', h5pFileWrongExtensionContent: 'Soilik .h5p luzapena duten fitxategiak onartzen dira.', h5pFileValidationFailedTitle: 'Ezin da ontzat eman H5P fitxategia.', h5pFileValidationFailedContent: 'Egiaztatu igo duzun H5P fitxategia benetan H5P ariketa duela. H5p' + ' fitxategiak soilik liburutegiak badituzte kargatu daitezke H5P liburutegien orriaren bidezf.', h5pFileUploadServerErrorTitle: 'H5P fitxategia ezin izan da kargatu', h5pFileUploadServerErrorContent: 'Ustegabeko errorea gertatu da. Aztertu zure zerbitzariaren akatsen erregistroa' + ' zehaztasun gehiago izateko.', contentTypeSectionAll: 'ariketa mota guztiak', searchResults: 'Bilatu emaitzak', contentTypeSearchFieldPlaceholder: 'Bilatu ariketa motaren arabera', contentTypeInstallButtonLabel: 'Instalatu', contentTypeInstallingButtonLabel: 'Instalatzen', contentTypeUseButtonLabel: 'Erabili', contentTypeDetailButtonLabel: 'Zehaztasunak', contentTypeUpdateButtonLabel: 'Eguneratu', contentTypeUpdatingButtonLabel: 'Eguneratzen', contentTypeGetButtonLabel: 'Lortu', contentTypeBackButtonLabel: 'Atzera', contentTypeIconAltText: 'Iconoa', contentTypeInstallSuccess: ':contentType ongi instalatu da!', contentTypeUpdateSuccess: ':contentType ongi kargatu da!', contentTypeInstallError: ':contentType ezin izan da instalatu. Jarri harremanetan administratzailearekin.', contentTypeLicensePanelTitle: 'Lizentzia', contentTypeDemoButtonLabel: 'ariketa-adibidea', numResults: ':num emaitza', show: 'Erakutsi', recentlyUsedFirst: 'Lehenengo berriki erabilitakoak', popularFirst: 'Lehenengo arrakastatsuenak', newestFirst: 'Lehenengo berrienak', aToZ: 'A-tik Z-ra', noResultsFound: 'Ez da emaitzarik aurkitu', noResultsFoundDesc: 'Ez dago zure bilaketa irizpidearekin bat datorren ariketarik.', readMore: 'Irakurri gehiago', readLess: 'Irakurri gutxiago', contentTypeOwner: ':owner arabera', contentTypeUnsupportedApiVersionTitle: 'ariketa mota honek bertsio nagusi berriago bat behar du', contentTypeUnsupportedApiVersionContent: 'Jarri harremantan zure sistemaren administratzailearekin eskuratzeko behar dituzun eguneraketak', contentTypeUpdateAvailable: 'Eguneraketa eskuragarria', contentTypeRestricted: 'Ariketa mota mugatua', contentTypeRestrictedDesc: 'Administratzaileak ariketa mota honen erabilera mugatu du.', contentTypeNotInstalled: 'Ariketa mota hau ez dago instalatua', contentTypeNotInstalledDesc: 'Ez daukazu baimenik ariketa motak instalatzeko.', theContentType: 'ariketa mota', currentMenuSelected: 'uneko hautapena', errorCommunicatingHubTitle: 'Ezin da komunikatu konektorearekin.', errorCommunicatingHubContent: 'Errore bat gertatu da. Saia zaitez beranduago.', warningNoContentTypesInstalled: "Ez daukazu inolako ariketa motarik instalatuta.", warningChangeBrowsingToSeeResults: 'Klikatu <em>Dena</em> ikusteko instala dezakezun ariketa mota guztien zerrenda.', warningUpdateAvailableTitle: ':contentType motaren bertsio berria eskuragarri dago.', warningUpdateAvailableBody: 'Eguneratu azken bertsiora esperientzia hobea izateko.', licenseDescription: 'Lizentzia honen hainbat berritasun behean zerrendatuta daude. Klikatu goiko info ikonoan irakurtzeko jatorrizko lizentziaren testua.', licenseModalTitle: 'Lizentziaren xehetasunak', licenseModalSubtitle: 'Hautatu lizentzia bat ikusteko erabilera egokiaren gaineko informazioa', licenseUnspecified: 'Zehazkabea', licenseCanUseCommercially: 'Komertzialki erabili daiteke', licenseCanModify: 'Aldatu daiteke', licenseCanDistribute: 'Banatu daiteke', licenseCanSublicense: 'Azpilizentziatu daiteke', licenseCanHoldLiable: 'Erantzule izan daiteke', licenseCannotHoldLiable: 'Ezin daiteke erantzule izan', licenseMustIncludeCopyright: 'Copyrighta barnean behar du', licenseMustIncludeLicense: 'Lizentzia barnean behar du', licenseFetchDetailsFailed: 'Errorea lizentziaren xehetasunak eskuratzean', imageLightboxTitle: 'Irudiak', imageLightBoxProgress: ':total -etik :num', nextImage: 'Hurrengo irudia', previousImage: 'Aurreko irudia', screenshots: 'Pantaila kapturak', reloadButtonLabel: 'Birkargatu', videoQuality: 'Kalitatezko bideoaren etiketa', videoQualityDescription: 'Etiketa honek laguntzen dio erabiltzaileari bideoaren uneko kalitatea identifikatzen. Esate baterako 1080p, 720p, HD edo Mugikorra', videoQualityDefaultLabel: 'Kalitatea :index', noContentTypesAvailable: 'Ez dago ariketa mota erabilgarririk', noContentTypesAvailableDesc: 'Zure guneak zailtasunak ditu H5P.org-ekin konektatzeko ariketa mota erabilgarriak zerrendatzeko.', contentTypeCacheOutdated: 'Ariketa moten zerrenda zaharkitua dago', contentTypeCacheOutdatedDesc: 'Zure guneak zailtasunak ditu H5P.org-ekin konektatzeko ariketa mota erabilgarriak zerrendatzeko. Ezingo duzu ariketa mota berriak instalatu edo eguneratu.', tryAgain: 'Saiatu berriro', getHelp: 'Lortu laguntza', untitled: ':libraryTitle izengabea', title: 'Titulua', metadata: 'Metadatuak', addTitle: 'Gehitu titulua', usedForSearchingReportsAndCopyrightInformation: 'Bilaketetarako, txostenetarako eta copyright informaziorako erabilgarria', metadataSharingAndLicensingInfo: 'Metadatuak (partekatze eta lizentziaren gaineko informazioa)', fillInTheFieldsBelow : 'Bete azpiko eremuetan', saveMetadata: 'Gorde metadatuak', addAuthor: 'Gorde egilea', confirmRemoveAuthor: 'Ziur zaude egile hori kendu nahi duzula?', addNewChange: 'Gehitu aldaketa berri bat', confirmDeleteChangeLog: 'Ziur zaude aldaketaren erregistro sarrera hau kendu nahi duzula?', changelogDescription: 'Lizentzi batzuk jatorrizko lanari egindako aldaketak edo lan eratorriak adierazi eta erakustea exijitzen dute. Zure aldaketak hemen adierazi ditzakezu lizentziaren betekin gisa edo besterik gabe besteei edo zure buruari edukiari egindako aldaketen berri emateko.', logThisChange: 'Erregistratu aldaketa', newChangeHasBeenLogged: 'Aldaketa berri bat erregistratu daN', loggedChanges: 'Erregistratutako aldaketak', noChangesHaveBeenLogged: 'Ez da aldaketarik erregistratu', errorHeader: 'Errore bat gertatu da', errorCalculatingMaxScore: 'Ezin da kalkulatu ariketa honen puntuazio maximoa. Suposatzen da puntuazio maximoa 0 dela. Jar zaitez harrematenetan administratzailearekin itsaten saiatzen ari dena ez bada onartzen testuinguru honetan.', maxScoreSemanticsMissing: 'Edukian ezin izan da aurkitu espero zen semantika.', copyButton: 'Kopiatu', copiedButton: 'Kopiatu da', pasteButton: 'Itsatsi', pasteAndReplaceButton: 'Itsatsi eta Ordezkatu', pasteContent: 'Ordezkatu Edukia', confirmPasteContent: 'Hau eginda oraingo edukia arbelean daukazunarekin ordezkatuko da. Oraingo edukia galduko da. Ziur jarraitu nahi duzula?', confirmPasteButtonText: 'Ordezkatu edukia', copyToClipboard: 'Kopiatu H5P edukia to the clipboard', copiedToClipboard: 'Edukia arbelera kopiatzen da', pasteFromClipboard: 'Itsatsi H5P edukia arbeletik', pasteAndReplaceFromClipboard: 'Ordezkatu oraingo edukia arbelean dagoen H5P edukiarekin', pasteNoContent: 'Ez dago H5P edukirik arbelean', pasteError: 'Ezin izan da arbeltik itsatsi', pasteContentNotSupported: 'Arbeleko H5P edukia ez da testuinguru honetan onartzen', pasteContentRestricted: 'Arbeleko edukia mugatuta dago gune honetan', pasteTooOld: 'Arbeleko H5P edukia testuinguru honetan onartzen den bertsioa (:local) baino bertsio baxuago batekoa da (:clip), posiblea bada saiatu zaitez itsatsi nahi duzun edukia eguneratzen, berriz kopiatu ezazu eta ondoren hemen itsaten saiatu zaitez.', pasteTooNew: 'Arbeleko H5P edukia testuinguru honetan onartzen den bertsioa (:local) baino bertsio altuago batekoa da (:clip), posiblea bada saiatu zaitez itsatsi nahi duzun eduki-motaren liburutegia eguneratzen, eta ondoren berriz itsaten saiatu zaitez.', ok: 'ados', avTablistLabel: 'Txertatu hau erabiltzen:', tabTitleBasicFileUpload: 'Igo fitxategia', tabTitleInputLinkURL: 'Esteka/URLa', errorTooHighVersion: 'Parametroek %used daukate baina soilik %supported edo lehenagokoak onartzen dira.', errorNotSupported: 'Parametroek %used daukate baina ez dira onartzen.', errorParamsBroken: 'Parametroak apurtuta daude.', libraryMissing: 'Beharrezkoa den %lib. biblioteka falta da.', scriptMissing: 'Ezin izan dira kargatu %lib.-rentzako eguneratze-scriptak.', language: 'Hizkuntza', noLanguagesSupported: 'Ez dago onartutako hizkuntzarik', changeLanguage: 'Aldatu hizkuntza honetara :language?', thisWillPotentially: "Honek testu eta itzulpen guztiak berrabiarazi ditzake. Ekintza hau ezin da desegin. Edukia bera ez da aldatuko. Jarraitu nahi duzu??", notAllTextsChanged: 'Ez dira testu guztiak aldatu, :language hizkuntzaren sostengua ez da osoa.', contributeTranslations: ':language hizkuntzako itzulpena osatu nahi baduzu <a href=":url" target="_new">contributing translations to H5P</a> estekan nola egin ikasi dezakezu', unknownLibrary: 'Tamalez, aukeratutako \'%lib\' eduki-mota ez dago sistema honetan instalatuta.', proceedButtonLabel: 'Jarraitu eta gorde', enterFullscreenButtonLabel: 'Erabili pantaila osoko modura', exitFullscreenButtonLabel: 'Irten pantaila osoko modutik', a11yTitleShowLabel: 'Show label for AT', a11yTitleHideLabel: 'Hide label for AT', reuseSuccess: ':title was successfully imported from the H5P Hub.', };
import { assert } from 'chai'; import { runToBufferAssertions as runBasetoBufferAssertions, runFromBufferAssertions as runBaseFromBufferAssertions } from './BasePacket-test.js'; import Announce from './Announce.js'; import { packetTypes } from '../../util/packet-types.js'; import { deviceTypes } from '../../util/deviceTypes.js'; describe('net/discover/packets/Announce', function () { it('should set correct packet type for announce packets', function () { const expected = packetTypes.ANNOUNCE; const actual = new Announce().packetType; assert.equal(actual, expected); }); it('should set device name from argument', function () { const expected = 'another device'; const actual = new Announce(deviceTypes.CDJ_XDJ, expected).deviceName; assert.equal(actual, expected); }); describe('toBuffer', function () { runBasetoBufferAssertions( new Announce(deviceTypes.CDJ_XDJ, 'a device name') ); it('return value should be 0x25 bytes', function () { const actual = new Announce().toBuffer(); assert.lengthOf(actual, 0x25); }); it('should have a header with correct type for announce packets', function () { const expected = packetTypes.ANNOUNCE; const packet = new Announce(); const actual = packet.toBuffer()[0x0a]; assert.deepEqual(actual, expected); }); it('should set byte 0x24 to the correct value for its device type', function () { const deviceType = deviceTypes.CDJ_XDJ; const expected = deviceType; const buffer = new Announce(deviceType).toBuffer(); const actual = buffer[0x24]; assert.equal(actual, expected); }); }); describe('fromBuffer', function () { const expectedDeviceName = 'Rene DeVice'; runBaseFromBufferAssertions({ buffer: new Announce(0, expectedDeviceName).toBuffer(), decodeFn: Announce.fromBuffer, expectedPacketType: packetTypes.ANNOUNCE, expectedDeviceName }); it('should set device type from packet data', function () { const expected = deviceTypes.CDJ_XDJ; const buffer = new Announce(expected, 'whatevz').toBuffer(); const { deviceType: actual } = Announce.fromBuffer(buffer); assert.equal(actual, expected); }); }); });
import React from 'react' import { Switch, Route } from 'react-router-dom' import GlobalStyle from 'components/GlobalStyle' import Navbar from 'components/Navbar' import DetailView from 'components/DetailView' // import ProductList from 'components/ProductList' import Home from 'components/Home' import Cart from 'components/Cart' import NotFoundPage from 'components/NotFoundPage' import Footer from 'components/Footer' const App = () => ( <> <GlobalStyle /> <Navbar /> <main> <Switch> <Route exact path='/' component={Home} /> {/* <Route exact path='/products' component={ProductList} /> */} <Route exact path='/cart' component={Cart} /> <Route path='/:id' component={DetailView} /> <Route component={NotFoundPage} /> </Switch> </main> <Footer /> </> ) export default App
import {authorReputation} from '../filters/author-reputation' export default () => { return { restrict: 'AE', replace: true, scope: { comment: '=' }, link: (scope, element, attrs) => { scope.removeDirective = function () { scope.$destroy(); element.remove(); }; }, template: ` <div class="comment-list-item" ng-class="{'selected': comment._selected_, 'deleting': deleting, 'deleted': deleted, 'bad': isBad }"> <div class="comment-list-item-inner"> <div class="comment-author-pic" author-bg-img-style author="{{ comment.author }}"></div> <div class="comment-header"> <span class="comment-author"><author-name author-data="comment.author_data"></author-name> </span> <span class="comment-author-reputation">{{ comment.author_reputation|authorReputation|number:0 }}</span> <span class="comment-date"><a ng-click="goComment()" ng-class="{'no-child': comment.comments.length==0}" title="{{ comment.created|dateFormatted }}"> {{comment.created|timeAgo}}</a></span> <a ng-click="reveal()" class="comment-reveal">Reveal Comment</a> </div> <div class="comment-body markdown-view mini-markdown" ng-bind-html="comment | commentBody | markDown2Html"></div> <div class="comment-footer"> <div class="comment-voting"> <div class="comment-up-vote"> <content-vote content="comment"></content-vote> </div> <div class="comment-total"> <content-payout-info content="comment"></content-payout-info> </div> </div> <div class="comment-voters"> <content-voters-info content="comment"></content-voters-info> </div> <div class="comment-reply"> <a ng-click="" login-required required-keys="'posting'" on-login-success="replyClicked()">{{ 'REPLY' | translate }}</a> </div> <div class="comment-edit" ng-if="canEdit"><a ng-click="" login-required required-keys="'posting'" on-login-success="editClicked()" title="{{ 'EDIT' | translate }}"><i class="fa fa-pencil"></i></a></div> <div class="comment-delete" ng-if="canEdit"><a ng-click="" login-required required-keys="'posting'" on-login-success="deleteClicked()" title="{{ 'REMOVE' | translate }}"><i class="fa fa-spin fa-spinner fa-circle-o-notch" ng-if="deleting"></i><i class="fa fa-times" ng-if="!deleting"></i></a></div> <div class="comment-encrypted" ng-if="encrypted"><i class="fa fa-lock" uib-tooltip="{{ 'Encrypted comment' | __ }}"></i></div> </div> <div class="comment-extra-tools"> <div class="comment-flagging"> <a ng-class="{'flagged': flagged, 'flagging': flagging}" ng-click="" login-required required-keys="'posting'" on-login-success="flagClicked()"> <i ng-if="!flagging" class="fa fa-flag-o"></i> <i ng-if="flagging" class="fa fa-spin fa-spinner fa-circle-o-notch"></i> </a> </div> </div> </div> <comment-editor ng-if="commentFlag" content="comment" mode="{{ commentMode }}" on-cancel="onCommentEditorCanceled()" after-success="afterNewComment"></comment-editor> <comment-list comments="comment.comments"></comment-list> </div> `, controller: ($scope, $rootScope, $filter, $timeout, $location, $window, $confirm, dpayAuthenticatedService, activeUsername) => { const activeUser = activeUsername(); if (!$scope.comment.comments) { $scope.comment.comments = []; } $scope.encrypted = false; let jsonMeta = {}; try { jsonMeta = JSON.parse($scope.comment.json_metadata); } catch (e) { } if (jsonMeta.encrypted === 1) { $scope.encrypted = true; } $scope.canEdit = false; $scope.deleting = false; $scope.deleted = false; const detectCanEdit = () => { $scope.canEdit = (activeUser === $scope.comment.author); }; detectCanEdit(); $rootScope.$on('userLoggedOut', () => { detectCanEdit(); }); $rootScope.$on('userLoggedIn', () => { detectCanEdit(); }); $scope.deleteClicked = () => { if ($window.confirm($filter('translate')('ARE_YOU_SURE'))) { $scope.deleting = true; dpayAuthenticatedService.deleteComment($scope.comment.author, $scope.comment.permlink).then((resp) => { $scope.deleted = true; $timeout(() => { $scope.removeDirective(); }, 100); }).catch((e) => { $rootScope.showError(e); }).then(() => { $scope.deleting = false; }); } }; $scope.commentFlag = false; $scope.replyClicked = () => { $rootScope.$broadcast('commentEditorOpening'); $timeout(() => { $scope.commentMode = 'reply'; $scope.commentFlag = true; }, 100); }; $scope.editClicked = () => { $rootScope.$broadcast('commentEditorOpening'); $timeout(() => { $scope.commentMode = 'edit'; $scope.commentFlag = true; }, 100); }; $rootScope.$on('commentEditorOpening', () => { $scope.commentFlag = false; }); $scope.flagged = false; $scope.canFlag = !(activeUser === $scope.comment.author); $scope.flagging = false; if ($scope.canFlag && activeUser) { for (let vote of $scope.comment.active_votes) { if (vote.voter === activeUser && vote.percent < 0) { $scope.flagged = true; } } } $scope.flagClicked = () => { $confirm($filter('translate')('ARE_YOU_SURE'), $filter('translate')('FLAGGING_TEXT'), () => { const author = $scope.comment.author; const permlink = $scope.comment.permlink; $scope.flagging = true; dpayAuthenticatedService.vote(author, permlink, -10000).then((resp) => { $rootScope.$broadcast('CONTENT_VOTED', { author: author, permlink: permlink, weight: -1 }); }).catch((e) => { $rootScope.showError(e); }).then(() => { $scope.flagging = false; }); }); }; $rootScope.$on('CONTENT_VOTED', (r, d) => { if ($scope.comment.author === d.author && $scope.comment.permlink === d.permlink) { $scope.flagged = d.weight < 0; } }); $scope.onCommentEditorCanceled = () => { $scope.commentFlag = false; }; $scope.afterNewComment = (newComment, mode) => { if (mode === 'reply') { $scope.comment.comments.push(newComment); } else if (mode === 'edit') { $scope.comment.body = newComment.body; // it is required to update json_metadata for encrypted comments $scope.comment.json_metadata = newComment.json_metadata; } }; $scope.isBad = $scope.comment.net_rshares < 0 || $scope.comment.author_data.reputation < 0; $scope.reveal = () => { $scope.isBad = false; }; $scope.goComment = () => { const tag = $scope.comment.url.split('/')[1]; $rootScope.selectedPost = null; let u = `/post/${tag}/${ $scope.comment.author}/${ $scope.comment.permlink}`; $location.path(u); } } }; };
const express = require("express"); const UserSignIn = require("../controllers/auth/SignIn"); const UserSignUp = require("../controllers/auth/SignUp"); const { validateSignUp, validateSignIn } = require("../middleware/checkReq"); /** * @description Routes for user authentication. * @author Harrsh Patel <me@harrsh.com> * @route /todo/api/auth/* */ const AuthRoute = express.Router(); AuthRoute.post("/signin", validateSignIn, UserSignIn); AuthRoute.post("/signup", validateSignUp, UserSignUp); module.exports = AuthRoute;
/* Compose - Autosave */ Mailpile.Composer.Autosave = function(mid, form_data) { // Text is different, run autosave if ($('#compose-text-' + mid).val() !== Mailpile.Composer.Drafts[mid].body) { // UI Feedback var autosave_msg = $('#compose-message-autosaving-' + mid).data('autosave_msg'); $('#compose-message-autosaving-' + mid).html(autosave_msg).fadeIn(); // Autosave It $.ajax({ url : Mailpile.api.compose_save, type : 'POST', timeout : 15000, data : form_data, dataType : 'json', success : function(response) { // Update Message (data model) Mailpile.Composer.Drafts[mid].body = $('#compose-text-' + mid).val(); // Fadeout autosave UI msg setTimeout(function() { $('#compose-message-autosaving-' + mid).fadeOut(); }, 2000); }, error: function() { var autosave_error_msg = $('#compose-message-autosaving-' + mid).data('autosave_error_msg'); $('#compose-message-autosaving-' + mid).html('<span class="icon-x"></span>' + autosave_error_msg).fadeIn(); } }); } // Not Autosaving else { } }; /* Compose Autosave - finds each compose form and performs action */ Mailpile.Composer.AutosaveTimer = $.timer(function() { // UNTESTED: should handle multiples in a thread $('.form-compose').each(function(key, form) { Mailpile.Composer.Autosave($(form).data('mid'), $(form).serialize()); }); });
/** * @license * Visual Blocks Editor * * Copyright 2012 Google Inc. * https://blockly.googlecode.com/ * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * @fileoverview Variable blocks for Blockly. * @author fraser@google.com (Neil Fraser) */ 'use strict'; goog.provide('Blockly.Blocks.majordomo_time'); goog.require('Blockly.Blocks'); Blockly.Blocks['majordomo_timeis'] = { /** * Block for null data type. * @this Blockly.Block */ init: function() { // Assign 'this' to a variable for use in the closure below. var thisBlock = this; this.setColour(220); this.appendDummyInput() .appendField(Blockly.Msg.MAJORDOMO_TIMEIS); this.appendValueInput("TIME") .setCheck("String"); this.setInputsInline(true); this.setOutput(true); this.setTooltip(''); } }; Blockly.Blocks['majordomo_timenow'] = { /** * Block for null data type. * @this Blockly.Block */ init: function() { // Assign 'this' to a variable for use in the closure below. var thisBlock = this; this.setColour(220); this.appendDummyInput() .appendField(Blockly.Msg.MAJORDOMO_TIMENOW); this.setOutput(true); this.setTooltip(''); } }; Blockly.Blocks['majordomo_isweekend'] = { /** * Block for null data type. * @this Blockly.Block */ init: function() { // Assign 'this' to a variable for use in the closure below. var thisBlock = this; this.setColour(220); this.appendDummyInput() .appendField(Blockly.Msg.MAJORDOMO_ISWEEKEND); this.setOutput(true); this.setTooltip(''); } }; Blockly.Blocks['majordomo_isworkday'] = { /** * Block for null data type. * @this Blockly.Block */ init: function() { // Assign 'this' to a variable for use in the closure below. var thisBlock = this; this.setColour(220); this.appendDummyInput() .appendField(Blockly.Msg.MAJORDOMO_ISWORKDAY); this.setOutput(true); this.setTooltip(''); } }; Blockly.Blocks['majordomo_timebefore'] = { /** * Block for null data type. * @this Blockly.Block */ init: function() { // Assign 'this' to a variable for use in the closure below. var thisBlock = this; this.setColour(220); this.appendDummyInput() .appendField(Blockly.Msg.MAJORDOMO_TIMEBEFORE); this.appendValueInput("TIME") .setCheck("String"); this.setInputsInline(true); this.setOutput(true); this.setTooltip(''); } }; Blockly.Blocks['majordomo_timeafter'] = { /** * Block for null data type. * @this Blockly.Block */ init: function() { // Assign 'this' to a variable for use in the closure below. var thisBlock = this; this.setColour(220); this.appendDummyInput() .appendField(Blockly.Msg.MAJORDOMO_TIMEAFTER); this.appendValueInput("TIME") .setCheck("String"); this.setInputsInline(true); this.setOutput(true); this.setTooltip(''); } }; Blockly.Blocks['majordomo_timebetween'] = { /** * Block for null data type. * @this Blockly.Block */ init: function() { // Assign 'this' to a variable for use in the closure below. var thisBlock = this; this.setColour(220); this.appendDummyInput() .appendField(Blockly.Msg.MAJORDOMO_TIMEBETWEEN); this.appendValueInput("TIME1") .setCheck("String"); this.appendDummyInput() .appendField(' - '); this.appendValueInput("TIME2") .setCheck("String"); this.setInputsInline(true); this.setOutput(true); this.setTooltip(''); } }; Blockly.Blocks['majordomo_cleartimeout'] = { /** * Block for null data type. * @this Blockly.Block */ init: function() { // Assign 'this' to a variable for use in the closure below. var thisBlock = this; this.setColour(220); this.appendDummyInput() .appendField(Blockly.Msg.MAJORDOMO_CLEARTIMEOUT); this.appendValueInput("TIMER") .setCheck("String"); this.setInputsInline(true); this.setOutput(false); this.setPreviousStatement(true); this.setNextStatement(true); this.setTooltip(''); } }; Blockly.Blocks['majordomo_settimeout'] = { /** * Block for null data type. * @this Blockly.Block */ init: function() { // Assign 'this' to a variable for use in the closure below. var thisBlock = this; this.setColour(220); this.appendDummyInput() .appendField(Blockly.Msg.MAJORDOMO_SETTIMEOUT); this.appendValueInput("TIMER") .setCheck("String"); this.appendDummyInput() .appendField(Blockly.Msg.MAJORDOMO_SETTIMEOUTDELAY); this.appendValueInput("DELAY") .setCheck("String"); this.appendStatementInput('DO') .appendField(Blockly.Msg.MAJORDOMO_SETTIMEOUTOPERATIONS); this.setInputsInline(true); this.setOutput(false); this.setPreviousStatement(true); this.setNextStatement(true); this.setTooltip(''); } }; //setTimeOut //clearTimeOut
'use strict'; /** * Module dependencies. */ var should = require('should'), mongoose = require('mongoose'), User = mongoose.model('User'), Owner = mongoose.model('Owner'); /** * Globals */ var user, owner; /** * Unit tests */ describe('Owner Model Unit Tests:', function() { beforeEach(function(done) { user = new User({ firstName: 'Full', lastName: 'Name', displayName: 'Full Name', email: 'test@test.com', username: 'username', password: 'password' }); user.save(function() { owner = new Owner({ name: 'Owner Name', user: user }); done(); }); }); describe('Method Save', function() { it('should be able to save without problems', function(done) { return owner.save(function(err) { should.not.exist(err); done(); }); }); it('should be able to show an error when try to save without name', function(done) { owner.name = ''; return owner.save(function(err) { should.exist(err); done(); }); }); }); afterEach(function(done) { Owner.remove().exec(); User.remove().exec(); done(); }); });
load(pwd() + "/../../util/date_util.js"); load(pwd() + "/compacted_aggregate_base_report.js"); load(pwd() + "/test_data.js"); testFromDatesAggregation(ONE_DAY_MILLIS, ONE_HOUR_MILLIS, 'One year days');
module.exports = { presets: [require('poi-preset-react')()], entry: './src/index.jsx', webpack: config => ({ ...config, resolve: { ...config.resolve, alias: { ...config.alias, Babel: '@babel/standalone', }, }, }), homepage: 'https://mmiller42.github.io/jsx-to-rjs/', dist: 'docs', }
"use strict"; exports.__esModule = true; exports.default = function (callee, thisNode, args) { if (args.length === 1 && t.isSpreadElement(args[0]) && t.isIdentifier(args[0].argument, { name: "arguments" })) { return t.callExpression(t.memberExpression(callee, t.identifier("apply")), [thisNode, args[0].argument]); } else { return t.callExpression(t.memberExpression(callee, t.identifier("call")), [thisNode].concat(args)); } }; var _babelTypes = require("babel-types"); var t = _interopRequireWildcard(_babelTypes); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
/** @license * * SoundManager 2: JavaScript Sound for the Web * ---------------------------------------------- * http://schillmania.com/projects/soundmanager2/ * * Copyright (c) 2007, Scott Schiller. All rights reserved. * Code provided under the BSD License: * http://schillmania.com/projects/soundmanager2/license.txt * * V2.97a.20150601 */ (function(h,g){function w(gb,w){function Z(b){return c.preferFlash&&A&&!c.ignoreFlash&&c.flash[b]!==g&&c.flash[b]}function r(b){return function(c){var d=this._s;return d&&d._a?b.call(this,c):null}}this.setupOptions={url:gb||null,flashVersion:8,debugMode:!0,debugFlash:!1,useConsole:!0,consoleOnly:!0,waitForWindowLoad:!1,bgColor:"#ffffff",useHighPerformance:!1,flashPollingInterval:null,html5PollingInterval:null,flashLoadTimeout:1E3,wmode:null,allowScriptAccess:"always",useFlashBlock:!1,useHTML5Audio:!0, forceUseGlobalHTML5Audio:!1,ignoreMobileRestrictions:!1,html5Test:/^(probably|maybe)$/i,preferFlash:!1,noSWFCache:!1,idPrefix:"sound"};this.defaultOptions={autoLoad:!1,autoPlay:!1,from:null,loops:1,onid3:null,onload:null,whileloading:null,onplay:null,onpause:null,onresume:null,whileplaying:null,onposition:null,onstop:null,onfailure:null,onfinish:null,multiShot:!0,multiShotEvents:!1,position:null,pan:0,stream:!0,to:null,type:null,usePolicyFile:!1,volume:100};this.flash9Options={isMovieStar:null,usePeakData:!1, useWaveformData:!1,useEQData:!1,onbufferchange:null,ondataerror:null};this.movieStarOptions={bufferTime:3,serverURL:null,onconnect:null,duration:null};this.audioFormats={mp3:{type:['audio/mpeg; codecs="mp3"',"audio/mpeg","audio/mp3","audio/MPA","audio/mpa-robust"],required:!0},mp4:{related:["aac","m4a","m4b"],type:['audio/mp4; codecs="mp4a.40.2"',"audio/aac","audio/x-m4a","audio/MP4A-LATM","audio/mpeg4-generic"],required:!1},ogg:{type:["audio/ogg; codecs=vorbis"],required:!1},opus:{type:["audio/ogg; codecs=opus", "audio/opus"],required:!1},wav:{type:['audio/wav; codecs="1"',"audio/wav","audio/wave","audio/x-wav"],required:!1}};this.movieID="sm2-container";this.id=w||"sm2movie";this.debugID="soundmanager-debug";this.debugURLParam=/([#?&])debug=1/i;this.versionNumber="V2.97a.20150601";this.altURL=this.movieURL=this.version=null;this.enabled=this.swfLoaded=!1;this.oMC=null;this.sounds={};this.soundIDs=[];this.didFlashBlock=this.muted=!1;this.filePattern=null;this.filePatterns={flash8:/\.mp3(\?.*)?$/i,flash9:/\.mp3(\?.*)?$/i}; this.features={buffering:!1,peakData:!1,waveformData:!1,eqData:!1,movieStar:!1};this.sandbox={};this.html5={usingFlash:null};this.flash={};this.ignoreFlash=this.html5Only=!1;var N,c=this,Oa=null,k=null,aa,u=navigator.userAgent,Pa=h.location.href.toString(),p=document,pa,Qa,qa,m,y=[],O=!1,P=!1,l=!1,B=!1,ra=!1,Q,x,sa,ba,ta,F,H,I,Ra,ua,va,ca,J,da,G,wa,R,xa,ea,K,Sa,ya,Ta,za,Ua,S=null,Aa=null,T,Ba,L,fa,ga,q,U=!1,Ca=!1,Va,Wa,Xa,ha=0,V=null,ia,W=[],X,v=null,Ya,ja,Y,D,ka,Da,Za,t,hb=Array.prototype.slice, z=!1,Ea,A,Fa,$a,C,la,ab=0,Ga,Ha=u.match(/(ipad|iphone|ipod)/i),Ia=u.match(/android/i),E=u.match(/msie/i),ib=u.match(/webkit/i),ma=u.match(/safari/i)&&!u.match(/chrome/i),Ja=u.match(/opera/i),na=u.match(/(mobile|pre\/|xoom)/i)||Ha||Ia,bb=!Pa.match(/usehtml5audio/i)&&!Pa.match(/sm2\-ignorebadua/i)&&ma&&!u.match(/silk/i)&&u.match(/OS X 10_6_([3-7])/i),Ka=p.hasFocus!==g?p.hasFocus():null,oa=ma&&(p.hasFocus===g||!p.hasFocus()),cb=!oa,db=/(mp3|mp4|mpa|m4a|m4b)/i,La=p.location?p.location.protocol.match(/http/i): null,jb=La?"":"http://",eb=/^\s*audio\/(?:x-)?(?:mpeg4|aac|flv|mov|mp4||m4v|m4a|m4b|mp4v|3gp|3g2)\s*(?:$|;)/i,fb="mpeg4 aac flv mov mp4 m4v f4v m4a m4b mp4v 3gp 3g2".split(" "),kb=new RegExp("\\.("+fb.join("|")+")(\\?.*)?$","i");this.mimePattern=/^\s*audio\/(?:x-)?(?:mp(?:eg|3))\s*(?:$|;)/i;this.useAltURL=!La;var Ma;try{Ma=Audio!==g&&(Ja&&opera!==g&&10>opera.version()?new Audio(null):new Audio).canPlayType!==g}catch(lb){Ma=!1}this.hasHTML5=Ma;this.setup=function(b){var e=!c.url;b!==g&&l&&v&&c.ok(); sa(b);if(!z)if(na){if(!c.setupOptions.ignoreMobileRestrictions||c.setupOptions.forceUseGlobalHTML5Audio)W.push(J.globalHTML5),z=!0}else c.setupOptions.forceUseGlobalHTML5Audio&&(W.push(J.globalHTML5),z=!0);if(!Ga&&na)if(c.setupOptions.ignoreMobileRestrictions)W.push(J.ignoreMobile);else if(c.setupOptions.useHTML5Audio=!0,c.setupOptions.preferFlash=!1,Ha)c.ignoreFlash=!0;else if(Ia&&!u.match(/android\s2\.3/i)||!Ia)z=!0;b&&(e&&R&&b.url!==g&&c.beginDelayedInit(),R||b.url===g||"complete"!==p.readyState|| setTimeout(G,1));Ga=!0;return c};this.supported=this.ok=function(){return v?l&&!B:c.useHTML5Audio&&c.hasHTML5};this.getMovie=function(b){return aa(b)||p[b]||h[b]};this.createSound=function(b,e){function d(){a=fa(a);c.sounds[a.id]=new N(a);c.soundIDs.push(a.id);return c.sounds[a.id]}var a,f=null;if(!l||!c.ok())return!1;e!==g&&(b={id:b,url:e});a=x(b);a.url=ia(a.url);a.id===g&&(a.id=c.setupOptions.idPrefix+ab++);if(q(a.id,!0))return c.sounds[a.id];if(ja(a))f=d(),f._setup_html5(a);else{if(c.html5Only|| c.html5.usingFlash&&a.url&&a.url.match(/data\:/i))return d();8<m&&null===a.isMovieStar&&(a.isMovieStar=!!(a.serverURL||a.type&&a.type.match(eb)||a.url&&a.url.match(kb)));a=ga(a,void 0);f=d();8===m?k._createSound(a.id,a.loops||1,a.usePolicyFile):(k._createSound(a.id,a.url,a.usePeakData,a.useWaveformData,a.useEQData,a.isMovieStar,a.isMovieStar?a.bufferTime:!1,a.loops||1,a.serverURL,a.duration||null,a.autoPlay,!0,a.autoLoad,a.usePolicyFile),a.serverURL||(f.connected=!0,a.onconnect&&a.onconnect.apply(f))); a.serverURL||!a.autoLoad&&!a.autoPlay||f.load(a)}!a.serverURL&&a.autoPlay&&f.play();return f};this.destroySound=function(b,e){if(!q(b))return!1;var d=c.sounds[b],a;d.stop();d._iO={};d.unload();for(a=0;a<c.soundIDs.length;a++)if(c.soundIDs[a]===b){c.soundIDs.splice(a,1);break}e||d.destruct(!0);delete c.sounds[b];return!0};this.load=function(b,e){return q(b)?c.sounds[b].load(e):!1};this.unload=function(b){return q(b)?c.sounds[b].unload():!1};this.onposition=this.onPosition=function(b,e,d,a){return q(b)? c.sounds[b].onposition(e,d,a):!1};this.clearOnPosition=function(b,e,d){return q(b)?c.sounds[b].clearOnPosition(e,d):!1};this.start=this.play=function(b,e){var d=null,a=e&&!(e instanceof Object);if(!l||!c.ok())return!1;if(q(b,a))a&&(e={url:e});else{if(!a)return!1;a&&(e={url:e});e&&e.url&&(e.id=b,d=c.createSound(e).play())}null===d&&(d=c.sounds[b].play(e));return d};this.setPosition=function(b,e){return q(b)?c.sounds[b].setPosition(e):!1};this.stop=function(b){return q(b)?c.sounds[b].stop():!1};this.stopAll= function(){for(var b in c.sounds)c.sounds.hasOwnProperty(b)&&c.sounds[b].stop()};this.pause=function(b){return q(b)?c.sounds[b].pause():!1};this.pauseAll=function(){var b;for(b=c.soundIDs.length-1;0<=b;b--)c.sounds[c.soundIDs[b]].pause()};this.resume=function(b){return q(b)?c.sounds[b].resume():!1};this.resumeAll=function(){var b;for(b=c.soundIDs.length-1;0<=b;b--)c.sounds[c.soundIDs[b]].resume()};this.togglePause=function(b){return q(b)?c.sounds[b].togglePause():!1};this.setPan=function(b,e){return q(b)? c.sounds[b].setPan(e):!1};this.setVolume=function(b,e){var d,a;if(b===g||isNaN(b)||e!==g)return q(b)?c.sounds[b].setVolume(e):!1;d=0;for(a=c.soundIDs.length;d<a;d++)c.sounds[c.soundIDs[d]].setVolume(b)};this.mute=function(b){var e=0;b instanceof String&&(b=null);if(b)return q(b)?c.sounds[b].mute():!1;for(e=c.soundIDs.length-1;0<=e;e--)c.sounds[c.soundIDs[e]].mute();return c.muted=!0};this.muteAll=function(){c.mute()};this.unmute=function(b){b instanceof String&&(b=null);if(b)return q(b)?c.sounds[b].unmute(): !1;for(b=c.soundIDs.length-1;0<=b;b--)c.sounds[c.soundIDs[b]].unmute();c.muted=!1;return!0};this.unmuteAll=function(){c.unmute()};this.toggleMute=function(b){return q(b)?c.sounds[b].toggleMute():!1};this.getMemoryUse=function(){var b=0;k&&8!==m&&(b=parseInt(k._getMemoryUse(),10));return b};this.disable=function(b){var e;b===g&&(b=!1);if(B)return!1;B=!0;for(e=c.soundIDs.length-1;0<=e;e--)Ta(c.sounds[c.soundIDs[e]]);Q(b);t.remove(h,"load",H);return!0};this.canPlayMIME=function(b){var e;c.hasHTML5&& (e=Y({type:b}));!e&&v&&(e=b&&c.ok()?!!(8<m&&b.match(eb)||b.match(c.mimePattern)):null);return e};this.canPlayURL=function(b){var e;c.hasHTML5&&(e=Y({url:b}));!e&&v&&(e=b&&c.ok()?!!b.match(c.filePattern):null);return e};this.canPlayLink=function(b){return b.type!==g&&b.type&&c.canPlayMIME(b.type)?!0:c.canPlayURL(b.href)};this.getSoundById=function(b,e){return b?c.sounds[b]:null};this.onready=function(b,c){if("function"===typeof b)c||(c=h),ta("onready",b,c),F();else throw T("needFunction","onready"); return!0};this.ontimeout=function(b,c){if("function"===typeof b)c||(c=h),ta("ontimeout",b,c),F({type:"ontimeout"});else throw T("needFunction","ontimeout");return!0};this._wD=this._writeDebug=function(b,c){return!0};this._debug=function(){};this.reboot=function(b,e){var d,a,f;for(d=c.soundIDs.length-1;0<=d;d--)c.sounds[c.soundIDs[d]].destruct();if(k)try{E&&(Aa=k.innerHTML),S=k.parentNode.removeChild(k)}catch(g){}Aa=S=v=k=null;c.enabled=R=l=U=Ca=O=P=B=z=c.swfLoaded=!1;c.soundIDs=[];c.sounds={};ab= 0;Ga=!1;if(b)y=[];else for(d in y)if(y.hasOwnProperty(d))for(a=0,f=y[d].length;a<f;a++)y[d][a].fired=!1;c.html5={usingFlash:null};c.flash={};c.html5Only=!1;c.ignoreFlash=!1;h.setTimeout(function(){e||c.beginDelayedInit()},20);return c};this.reset=function(){return c.reboot(!0,!0)};this.getMoviePercent=function(){return k&&"PercentLoaded"in k?k.PercentLoaded():null};this.beginDelayedInit=function(){ra=!0;G();setTimeout(function(){if(Ca)return!1;ea();da();return Ca=!0},20);I()};this.destruct=function(){c.disable(!0)}; N=function(b){var e,d,a=this,f,n,h,M,p,r,u=!1,l=[],v=0,y,B,w=null,A;d=e=null;this.sID=this.id=b.id;this.url=b.url;this._iO=this.instanceOptions=this.options=x(b);this.pan=this.options.pan;this.volume=this.options.volume;this.isHTML5=!1;this._a=null;A=this.url?!1:!0;this.id3={};this._debug=function(){};this.load=function(b){var e=null,d;b!==g?a._iO=x(b,a.options):(b=a.options,a._iO=b,w&&w!==a.url&&(a._iO.url=a.url,a.url=null));a._iO.url||(a._iO.url=a.url);a._iO.url=ia(a._iO.url);d=a.instanceOptions= a._iO;if(!d.url&&!a.url)return a;if(d.url===a.url&&0!==a.readyState&&2!==a.readyState)return 3===a.readyState&&d.onload&&la(a,function(){d.onload.apply(a,[!!a.duration])}),a;a.loaded=!1;a.readyState=1;a.playState=0;a.id3={};if(ja(d))e=a._setup_html5(d),e._called_load||(a._html5_canplay=!1,a.url!==d.url&&(a._a.src=d.url,a.setPosition(0)),a._a.autobuffer="auto",a._a.preload="auto",a._a._called_load=!0);else{if(c.html5Only||a._iO.url&&a._iO.url.match(/data\:/i))return a;try{a.isHTML5=!1,a._iO=ga(fa(d)), a._iO.autoPlay&&(a._iO.position||a._iO.from)&&(a._iO.autoPlay=!1),d=a._iO,8===m?k._load(a.id,d.url,d.stream,d.autoPlay,d.usePolicyFile):k._load(a.id,d.url,!!d.stream,!!d.autoPlay,d.loops||1,!!d.autoLoad,d.usePolicyFile)}catch(f){K({type:"SMSOUND_LOAD_JS_EXCEPTION",fatal:!0})}}a.url=d.url;return a};this.unload=function(){0!==a.readyState&&(a.isHTML5?(M(),a._a&&(a._a.pause(),w=ka(a._a))):8===m?k._unload(a.id,"about:blank"):k._unload(a.id),f());return a};this.destruct=function(b){a.isHTML5?(M(),a._a&& (a._a.pause(),ka(a._a),z||h(),a._a._s=null,a._a=null)):(a._iO.onfailure=null,k._destroySound(a.id));b||c.destroySound(a.id,!0)};this.start=this.play=function(b,e){var d,f,n,h,Na;f=!0;f=null;e=e===g?!0:e;b||(b={});a.url&&(a._iO.url=a.url);a._iO=x(a._iO,a.options);a._iO=x(b,a._iO);a._iO.url=ia(a._iO.url);a.instanceOptions=a._iO;if(!a.isHTML5&&a._iO.serverURL&&!a.connected)return a.getAutoPlay()||a.setAutoPlay(!0),a;ja(a._iO)&&(a._setup_html5(a._iO),p());1!==a.playState||a.paused||(d=a._iO.multiShot, d||(a.isHTML5&&a.setPosition(a._iO.position),f=a));if(null!==f)return f;b.url&&b.url!==a.url&&(a.readyState||a.isHTML5||8!==m||!A?a.load(a._iO):A=!1);a.loaded||(0===a.readyState?(a.isHTML5||c.html5Only?a.isHTML5?a.load(a._iO):f=a:(a._iO.autoPlay=!0,a.load(a._iO)),a.instanceOptions=a._iO):2===a.readyState&&(f=a));if(null!==f)return f;!a.isHTML5&&9===m&&0<a.position&&a.position===a.duration&&(b.position=0);if(a.paused&&0<=a.position&&(!a._iO.serverURL||0<a.position))a.resume();else{a._iO=x(b,a._iO); if((!a.isHTML5&&null!==a._iO.position&&0<a._iO.position||null!==a._iO.from&&0<a._iO.from||null!==a._iO.to)&&0===a.instanceCount&&0===a.playState&&!a._iO.serverURL){d=function(){a._iO=x(b,a._iO);a.play(a._iO)};a.isHTML5&&!a._html5_canplay?(a.load({_oncanplay:d}),f=!1):a.isHTML5||a.loaded||a.readyState&&2===a.readyState||(a.load({onload:d}),f=!1);if(null!==f)return f;a._iO=B()}(!a.instanceCount||a._iO.multiShotEvents||a.isHTML5&&a._iO.multiShot&&!z||!a.isHTML5&&8<m&&!a.getAutoPlay())&&a.instanceCount++; a._iO.onposition&&0===a.playState&&r(a);a.playState=1;a.paused=!1;a.position=a._iO.position===g||isNaN(a._iO.position)?0:a._iO.position;a.isHTML5||(a._iO=ga(fa(a._iO)));a._iO.onplay&&e&&(a._iO.onplay.apply(a),u=!0);a.setVolume(a._iO.volume,!0);a.setPan(a._iO.pan,!0);a.isHTML5?2>a.instanceCount?(p(),f=a._setup_html5(),a.setPosition(a._iO.position),f.play()):(n=new Audio(a._iO.url),h=function(){t.remove(n,"ended",h);a._onfinish(a);ka(n);n=null},Na=function(){t.remove(n,"canplay",Na);try{n.currentTime= a._iO.position/1E3}catch(b){}n.play()},t.add(n,"ended",h),a._iO.volume!==g&&(n.volume=Math.max(0,Math.min(1,a._iO.volume/100))),a.muted&&(n.muted=!0),a._iO.position?t.add(n,"canplay",Na):n.play()):(f=k._start(a.id,a._iO.loops||1,9===m?a.position:a.position/1E3,a._iO.multiShot||!1),9!==m||f||a._iO.onplayerror&&a._iO.onplayerror.apply(a))}return a};this.stop=function(b){var c=a._iO;1===a.playState&&(a._onbufferchange(0),a._resetOnPosition(0),a.paused=!1,a.isHTML5||(a.playState=0),y(),c.to&&a.clearOnPosition(c.to), a.isHTML5?a._a&&(b=a.position,a.setPosition(0),a.position=b,a._a.pause(),a.playState=0,a._onTimer(),M()):(k._stop(a.id,b),c.serverURL&&a.unload()),a.instanceCount=0,a._iO={},c.onstop&&c.onstop.apply(a));return a};this.setAutoPlay=function(b){a._iO.autoPlay=b;a.isHTML5||(k._setAutoPlay(a.id,b),b&&(a.instanceCount||1!==a.readyState||a.instanceCount++))};this.getAutoPlay=function(){return a._iO.autoPlay};this.setPosition=function(b){b===g&&(b=0);var c=a.isHTML5?Math.max(b,0):Math.min(a.duration||a._iO.duration, Math.max(b,0));a.position=c;b=a.position/1E3;a._resetOnPosition(a.position);a._iO.position=c;if(!a.isHTML5)b=9===m?a.position:b,a.readyState&&2!==a.readyState&&k._setPosition(a.id,b,a.paused||!a.playState,a._iO.multiShot);else if(a._a){if(a._html5_canplay){if(a._a.currentTime!==b)try{a._a.currentTime=b,(0===a.playState||a.paused)&&a._a.pause()}catch(e){}}else if(b)return a;a.paused&&a._onTimer(!0)}return a};this.pause=function(b){if(a.paused||0===a.playState&&1!==a.readyState)return a;a.paused=!0; a.isHTML5?(a._setup_html5().pause(),M()):(b||b===g)&&k._pause(a.id,a._iO.multiShot);a._iO.onpause&&a._iO.onpause.apply(a);return a};this.resume=function(){var b=a._iO;if(!a.paused)return a;a.paused=!1;a.playState=1;a.isHTML5?(a._setup_html5().play(),p()):(b.isMovieStar&&!b.serverURL&&a.setPosition(a.position),k._pause(a.id,b.multiShot));!u&&b.onplay?(b.onplay.apply(a),u=!0):b.onresume&&b.onresume.apply(a);return a};this.togglePause=function(){if(0===a.playState)return a.play({position:9!==m||a.isHTML5? a.position/1E3:a.position}),a;a.paused?a.resume():a.pause();return a};this.setPan=function(b,c){b===g&&(b=0);c===g&&(c=!1);a.isHTML5||k._setPan(a.id,b);a._iO.pan=b;c||(a.pan=b,a.options.pan=b);return a};this.setVolume=function(b,e){b===g&&(b=100);e===g&&(e=!1);a.isHTML5?a._a&&(c.muted&&!a.muted&&(a.muted=!0,a._a.muted=!0),a._a.volume=Math.max(0,Math.min(1,b/100))):k._setVolume(a.id,c.muted&&!a.muted||a.muted?0:b);a._iO.volume=b;e||(a.volume=b,a.options.volume=b);return a};this.mute=function(){a.muted= !0;a.isHTML5?a._a&&(a._a.muted=!0):k._setVolume(a.id,0);return a};this.unmute=function(){a.muted=!1;var b=a._iO.volume!==g;a.isHTML5?a._a&&(a._a.muted=!1):k._setVolume(a.id,b?a._iO.volume:a.options.volume);return a};this.toggleMute=function(){return a.muted?a.unmute():a.mute()};this.onposition=this.onPosition=function(b,c,e){l.push({position:parseInt(b,10),method:c,scope:e!==g?e:a,fired:!1});return a};this.clearOnPosition=function(a,b){var c;a=parseInt(a,10);if(isNaN(a))return!1;for(c=0;c<l.length;c++)a!== l[c].position||b&&b!==l[c].method||(l[c].fired&&v--,l.splice(c,1))};this._processOnPosition=function(){var b,c;b=l.length;if(!b||!a.playState||v>=b)return!1;for(--b;0<=b;b--)c=l[b],!c.fired&&a.position>=c.position&&(c.fired=!0,v++,c.method.apply(c.scope,[c.position]));return!0};this._resetOnPosition=function(a){var b,c;b=l.length;if(!b)return!1;for(--b;0<=b;b--)c=l[b],c.fired&&a<=c.position&&(c.fired=!1,v--);return!0};B=function(){var b=a._iO,c=b.from,e=b.to,d,f;f=function(){a.clearOnPosition(e,f); a.stop()};d=function(){if(null!==e&&!isNaN(e))a.onPosition(e,f)};null===c||isNaN(c)||(b.position=c,b.multiShot=!1,d());return b};r=function(){var b,c=a._iO.onposition;if(c)for(b in c)if(c.hasOwnProperty(b))a.onPosition(parseInt(b,10),c[b])};y=function(){var b,c=a._iO.onposition;if(c)for(b in c)c.hasOwnProperty(b)&&a.clearOnPosition(parseInt(b,10))};p=function(){a.isHTML5&&Va(a)};M=function(){a.isHTML5&&Wa(a)};f=function(b){b||(l=[],v=0);u=!1;a._hasTimer=null;a._a=null;a._html5_canplay=!1;a.bytesLoaded= null;a.bytesTotal=null;a.duration=a._iO&&a._iO.duration?a._iO.duration:null;a.durationEstimate=null;a.buffered=[];a.eqData=[];a.eqData.left=[];a.eqData.right=[];a.failures=0;a.isBuffering=!1;a.instanceOptions={};a.instanceCount=0;a.loaded=!1;a.metadata={};a.readyState=0;a.muted=!1;a.paused=!1;a.peakData={left:0,right:0};a.waveformData={left:[],right:[]};a.playState=0;a.position=null;a.id3={}};f();this._onTimer=function(b){var c,f=!1,g={};if(a._hasTimer||b)return a._a&&(b||(0<a.playState||1===a.readyState)&& !a.paused)&&(c=a._get_html5_duration(),c!==e&&(e=c,a.duration=c,f=!0),a.durationEstimate=a.duration,c=1E3*a._a.currentTime||0,c!==d&&(d=c,f=!0),(f||b)&&a._whileplaying(c,g,g,g,g)),f};this._get_html5_duration=function(){var b=a._iO;return(b=a._a&&a._a.duration?1E3*a._a.duration:b&&b.duration?b.duration:null)&&!isNaN(b)&&Infinity!==b?b:null};this._apply_loop=function(a,b){a.loop=1<b?"loop":""};this._setup_html5=function(b){b=x(a._iO,b);var c=z?Oa:a._a,e=decodeURI(b.url),d;z?e===decodeURI(Ea)&&(d=!0): e===decodeURI(w)&&(d=!0);if(c){if(c._s)if(z)c._s&&c._s.playState&&!d&&c._s.stop();else if(!z&&e===decodeURI(w))return a._apply_loop(c,b.loops),c;d||(w&&f(!1),c.src=b.url,Ea=w=a.url=b.url,c._called_load=!1)}else b.autoLoad||b.autoPlay?(a._a=new Audio(b.url),a._a.load()):a._a=Ja&&10>opera.version()?new Audio(null):new Audio,c=a._a,c._called_load=!1,z&&(Oa=c);a.isHTML5=!0;a._a=c;c._s=a;n();a._apply_loop(c,b.loops);b.autoLoad||b.autoPlay?a.load():(c.autobuffer=!1,c.preload="auto");return c};n=function(){if(a._a._added_events)return!1; var b;a._a._added_events=!0;for(b in C)C.hasOwnProperty(b)&&a._a&&a._a.addEventListener(b,C[b],!1);return!0};h=function(){var b;a._a._added_events=!1;for(b in C)C.hasOwnProperty(b)&&a._a&&a._a.removeEventListener(b,C[b],!1)};this._onload=function(b){var c=!!b||!a.isHTML5&&8===m&&a.duration;a.loaded=c;a.readyState=c?3:2;a._onbufferchange(0);a._iO.onload&&la(a,function(){a._iO.onload.apply(a,[c])});return!0};this._onbufferchange=function(b){if(0===a.playState||b&&a.isBuffering||!b&&!a.isBuffering)return!1; a.isBuffering=1===b;a._iO.onbufferchange&&a._iO.onbufferchange.apply(a,[b]);return!0};this._onsuspend=function(){a._iO.onsuspend&&a._iO.onsuspend.apply(a);return!0};this._onfailure=function(b,c,e){a.failures++;if(a._iO.onfailure&&1===a.failures)a._iO.onfailure(b,c,e)};this._onwarning=function(b,c,e){if(a._iO.onwarning)a._iO.onwarning(b,c,e)};this._onfinish=function(){var b=a._iO.onfinish;a._onbufferchange(0);a._resetOnPosition(0);a.instanceCount&&(a.instanceCount--,a.instanceCount||(y(),a.playState= 0,a.paused=!1,a.instanceCount=0,a.instanceOptions={},a._iO={},M(),a.isHTML5&&(a.position=0)),(!a.instanceCount||a._iO.multiShotEvents)&&b&&la(a,function(){b.apply(a)}))};this._whileloading=function(b,c,e,d){var f=a._iO;a.bytesLoaded=b;a.bytesTotal=c;a.duration=Math.floor(e);a.bufferLength=d;a.durationEstimate=a.isHTML5||f.isMovieStar?a.duration:f.duration?a.duration>f.duration?a.duration:f.duration:parseInt(a.bytesTotal/a.bytesLoaded*a.duration,10);a.isHTML5||(a.buffered=[{start:0,end:a.duration}]); (3!==a.readyState||a.isHTML5)&&f.whileloading&&f.whileloading.apply(a)};this._whileplaying=function(b,c,e,d,f){var n=a._iO;if(isNaN(b)||null===b)return!1;a.position=Math.max(0,b);a._processOnPosition();!a.isHTML5&&8<m&&(n.usePeakData&&c!==g&&c&&(a.peakData={left:c.leftPeak,right:c.rightPeak}),n.useWaveformData&&e!==g&&e&&(a.waveformData={left:e.split(","),right:d.split(",")}),n.useEQData&&f!==g&&f&&f.leftEQ&&(b=f.leftEQ.split(","),a.eqData=b,a.eqData.left=b,f.rightEQ!==g&&f.rightEQ&&(a.eqData.right= f.rightEQ.split(","))));1===a.playState&&(a.isHTML5||8!==m||a.position||!a.isBuffering||a._onbufferchange(0),n.whileplaying&&n.whileplaying.apply(a));return!0};this._oncaptiondata=function(b){a.captiondata=b;a._iO.oncaptiondata&&a._iO.oncaptiondata.apply(a,[b])};this._onmetadata=function(b,c){var e={},d,f;d=0;for(f=b.length;d<f;d++)e[b[d]]=c[d];a.metadata=e;a._iO.onmetadata&&a._iO.onmetadata.call(a,a.metadata)};this._onid3=function(b,c){var e=[],d,f;d=0;for(f=b.length;d<f;d++)e[b[d]]=c[d];a.id3=x(a.id3, e);a._iO.onid3&&a._iO.onid3.apply(a)};this._onconnect=function(b){b=1===b;if(a.connected=b)a.failures=0,q(a.id)&&(a.getAutoPlay()?a.play(g,a.getAutoPlay()):a._iO.autoLoad&&a.load()),a._iO.onconnect&&a._iO.onconnect.apply(a,[b])};this._ondataerror=function(b){0<a.playState&&a._iO.ondataerror&&a._iO.ondataerror.apply(a)}};xa=function(){return p.body||p.getElementsByTagName("div")[0]};aa=function(b){return p.getElementById(b)};x=function(b,e){var d=b||{},a,f;a=e===g?c.defaultOptions:e;for(f in a)a.hasOwnProperty(f)&& d[f]===g&&(d[f]="object"!==typeof a[f]||null===a[f]?a[f]:x(d[f],a[f]));return d};la=function(b,c){b.isHTML5||8!==m?c():h.setTimeout(c,0)};ba={onready:1,ontimeout:1,defaultOptions:1,flash9Options:1,movieStarOptions:1};sa=function(b,e){var d,a=!0,f=e!==g,n=c.setupOptions;for(d in b)if(b.hasOwnProperty(d))if("object"!==typeof b[d]||null===b[d]||b[d]instanceof Array||b[d]instanceof RegExp)f&&ba[e]!==g?c[e][d]=b[d]:n[d]!==g?(c.setupOptions[d]=b[d],c[d]=b[d]):ba[d]===g?a=!1:c[d]instanceof Function?c[d].apply(c, b[d]instanceof Array?b[d]:[b[d]]):c[d]=b[d];else if(ba[d]===g)a=!1;else return sa(b[d],d);return a};t=function(){function b(a){a=hb.call(a);var b=a.length;d?(a[1]="on"+a[1],3<b&&a.pop()):3===b&&a.push(!1);return a}function c(b,e){var g=b.shift(),h=[a[e]];if(d)g[h](b[0],b[1]);else g[h].apply(g,b)}var d=h.attachEvent,a={add:d?"attachEvent":"addEventListener",remove:d?"detachEvent":"removeEventListener"};return{add:function(){c(b(arguments),"add")},remove:function(){c(b(arguments),"remove")}}}();C={abort:r(function(){}), canplay:r(function(){var b=this._s,c;if(b._html5_canplay)return!0;b._html5_canplay=!0;b._onbufferchange(0);c=b._iO.position===g||isNaN(b._iO.position)?null:b._iO.position/1E3;if(this.currentTime!==c)try{this.currentTime=c}catch(d){}b._iO._oncanplay&&b._iO._oncanplay()}),canplaythrough:r(function(){var b=this._s;b.loaded||(b._onbufferchange(0),b._whileloading(b.bytesLoaded,b.bytesTotal,b._get_html5_duration()),b._onload(!0))}),durationchange:r(function(){var b=this._s,c;c=b._get_html5_duration();isNaN(c)|| c===b.duration||(b.durationEstimate=b.duration=c)}),ended:r(function(){this._s._onfinish()}),error:r(function(){this._s._onload(!1)}),loadeddata:r(function(){var b=this._s;b._loaded||ma||(b.duration=b._get_html5_duration())}),loadedmetadata:r(function(){}),loadstart:r(function(){this._s._onbufferchange(1)}),play:r(function(){this._s._onbufferchange(0)}),playing:r(function(){this._s._onbufferchange(0)}),progress:r(function(b){var c=this._s,d,a,f=0,f=b.target.buffered;d=b.loaded||0;var g=b.total||1; c.buffered=[];if(f&&f.length){d=0;for(a=f.length;d<a;d++)c.buffered.push({start:1E3*f.start(d),end:1E3*f.end(d)});f=1E3*(f.end(0)-f.start(0));d=Math.min(1,f/(1E3*b.target.duration))}isNaN(d)||(c._whileloading(d,g,c._get_html5_duration()),d&&g&&d===g&&C.canplaythrough.call(this,b))}),ratechange:r(function(){}),suspend:r(function(b){var c=this._s;C.progress.call(this,b);c._onsuspend()}),stalled:r(function(){}),timeupdate:r(function(){this._s._onTimer()}),waiting:r(function(){this._s._onbufferchange(1)})}; ja=function(b){return b&&(b.type||b.url||b.serverURL)?b.serverURL||b.type&&Z(b.type)?!1:b.type?Y({type:b.type}):Y({url:b.url})||c.html5Only||b.url.match(/data\:/i):!1};ka=function(b){var e;b&&(e=ma?"about:blank":c.html5.canPlayType("audio/wav")?"data:audio/wave;base64,/UklGRiYAAABXQVZFZm10IBAAAAABAAEARKwAAIhYAQACABAAZGF0YQIAAAD//w==":"about:blank",b.src=e,b._called_unload!==g&&(b._called_load=!1));z&&(Ea=null);return e};Y=function(b){if(!c.useHTML5Audio||!c.hasHTML5)return!1;var e=b.url||null;b=b.type|| null;var d=c.audioFormats,a;if(b&&c.html5[b]!==g)return c.html5[b]&&!Z(b);if(!D){D=[];for(a in d)d.hasOwnProperty(a)&&(D.push(a),d[a].related&&(D=D.concat(d[a].related)));D=new RegExp("\\.("+D.join("|")+")(\\?.*)?$","i")}(a=e?e.toLowerCase().match(D):null)&&a.length?a=a[1]:b&&(e=b.indexOf(";"),a=(-1!==e?b.substr(0,e):b).substr(6));a&&c.html5[a]!==g?e=c.html5[a]&&!Z(a):(b="audio/"+a,e=c.html5.canPlayType({type:b}),e=(c.html5[a]=e)&&c.html5[b]&&!Z(b));return e};Za=function(){function b(a){var b,d=b= !1;if(!e||"function"!==typeof e.canPlayType)return b;if(a instanceof Array){h=0;for(b=a.length;h<b;h++)if(c.html5[a[h]]||e.canPlayType(a[h]).match(c.html5Test))d=!0,c.html5[a[h]]=!0,c.flash[a[h]]=!!a[h].match(db);b=d}else a=e&&"function"===typeof e.canPlayType?e.canPlayType(a):!1,b=!(!a||!a.match(c.html5Test));return b}if(!c.useHTML5Audio||!c.hasHTML5)return v=c.html5.usingFlash=!0,!1;var e=Audio!==g?Ja&&10>opera.version()?new Audio(null):new Audio:null,d,a,f={},n,h;n=c.audioFormats;for(d in n)if(n.hasOwnProperty(d)&& (a="audio/"+d,f[d]=b(n[d].type),f[a]=f[d],d.match(db)?(c.flash[d]=!0,c.flash[a]=!0):(c.flash[d]=!1,c.flash[a]=!1),n[d]&&n[d].related))for(h=n[d].related.length-1;0<=h;h--)f["audio/"+n[d].related[h]]=f[d],c.html5[n[d].related[h]]=f[d],c.flash[n[d].related[h]]=f[d];f.canPlayType=e?b:null;c.html5=x(c.html5,f);c.html5.usingFlash=Ya();v=c.html5.usingFlash;return!0};J={};T=function(){};fa=function(b){8===m&&1<b.loops&&b.stream&&(b.stream=!1);return b};ga=function(b,c){b&&!b.usePolicyFile&&(b.onid3||b.usePeakData|| b.useWaveformData||b.useEQData)&&(b.usePolicyFile=!0);return b};pa=function(){return!1};Ta=function(b){for(var c in b)b.hasOwnProperty(c)&&"function"===typeof b[c]&&(b[c]=pa)};za=function(b){b===g&&(b=!1);(B||b)&&c.disable(b)};Ua=function(b){var e=null;if(b)if(b.match(/\.swf(\?.*)?$/i)){if(e=b.substr(b.toLowerCase().lastIndexOf(".swf?")+4))return b}else b.lastIndexOf("/")!==b.length-1&&(b+="/");b=(b&&-1!==b.lastIndexOf("/")?b.substr(0,b.lastIndexOf("/")+1):"./")+c.movieURL;c.noSWFCache&&(b+="?ts="+ (new Date).getTime());return b};va=function(){m=parseInt(c.flashVersion,10);8!==m&&9!==m&&(c.flashVersion=m=8);var b=c.debugMode||c.debugFlash?"_debug.swf":".swf";c.useHTML5Audio&&!c.html5Only&&c.audioFormats.mp4.required&&9>m&&(c.flashVersion=m=9);c.version=c.versionNumber+(c.html5Only?" (HTML5-only mode)":9===m?" (AS3/Flash 9)":" (AS2/Flash 8)");8<m?(c.defaultOptions=x(c.defaultOptions,c.flash9Options),c.features.buffering=!0,c.defaultOptions=x(c.defaultOptions,c.movieStarOptions),c.filePatterns.flash9= new RegExp("\\.(mp3|"+fb.join("|")+")(\\?.*)?$","i"),c.features.movieStar=!0):c.features.movieStar=!1;c.filePattern=c.filePatterns[8!==m?"flash9":"flash8"];c.movieURL=(8===m?"soundmanager2.swf":"soundmanager2_flash9.swf").replace(".swf",b);c.features.peakData=c.features.waveformData=c.features.eqData=8<m};Sa=function(b,c){if(!k)return!1;k._setPolling(b,c)};ya=function(){};q=this.getSoundById;L=function(){var b=[];c.debugMode&&b.push("sm2_debug");c.debugFlash&&b.push("flash_debug");c.useHighPerformance&& b.push("high_performance");return b.join(" ")};Ba=function(){T("fbHandler");var b=c.getMoviePercent(),e={type:"FLASHBLOCK"};if(c.html5Only)return!1;c.ok()?c.oMC&&(c.oMC.className=[L(),"movieContainer","swf_loaded"+(c.didFlashBlock?" swf_unblocked":"")].join(" ")):(v&&(c.oMC.className=L()+" movieContainer "+(null===b?"swf_timedout":"swf_error")),c.didFlashBlock=!0,F({type:"ontimeout",ignoreInit:!0,error:e}),K(e))};ta=function(b,c,d){y[b]===g&&(y[b]=[]);y[b].push({method:c,scope:d||null,fired:!1})}; F=function(b){b||(b={type:c.ok()?"onready":"ontimeout"});if(!l&&b&&!b.ignoreInit||"ontimeout"===b.type&&(c.ok()||B&&!b.ignoreInit))return!1;var e={success:b&&b.ignoreInit?c.ok():!B},d=b&&b.type?y[b.type]||[]:[],a=[],f,e=[e],g=v&&!c.ok();b.error&&(e[0].error=b.error);b=0;for(f=d.length;b<f;b++)!0!==d[b].fired&&a.push(d[b]);if(a.length)for(b=0,f=a.length;b<f;b++)a[b].scope?a[b].method.apply(a[b].scope,e):a[b].method.apply(this,e),g||(a[b].fired=!0);return!0};H=function(){h.setTimeout(function(){c.useFlashBlock&& Ba();F();"function"===typeof c.onload&&c.onload.apply(h);c.waitForWindowLoad&&t.add(h,"load",H)},1)};Fa=function(){if(A!==g)return A;var b=!1,c=navigator,d=c.plugins,a,f=h.ActiveXObject;if(d&&d.length)(c=c.mimeTypes)&&c["application/x-shockwave-flash"]&&c["application/x-shockwave-flash"].enabledPlugin&&c["application/x-shockwave-flash"].enabledPlugin.description&&(b=!0);else if(f!==g&&!u.match(/MSAppHost/i)){try{a=new f("ShockwaveFlash.ShockwaveFlash")}catch(n){a=null}b=!!a}return A=b};Ya=function(){var b, e,d=c.audioFormats;Ha&&u.match(/os (1|2|3_0|3_1)\s/i)?(c.hasHTML5=!1,c.html5Only=!0,c.oMC&&(c.oMC.style.display="none")):!c.useHTML5Audio||c.html5&&c.html5.canPlayType||(c.hasHTML5=!1);if(c.useHTML5Audio&&c.hasHTML5)for(e in X=!0,d)d.hasOwnProperty(e)&&d[e].required&&(c.html5.canPlayType(d[e].type)?c.preferFlash&&(c.flash[e]||c.flash[d[e].type])&&(b=!0):(X=!1,b=!0));c.ignoreFlash&&(b=!1,X=!0);c.html5Only=c.hasHTML5&&c.useHTML5Audio&&!b;return!c.html5Only};ia=function(b){var e,d,a=0;if(b instanceof Array){e=0;for(d=b.length;e<d;e++)if(b[e]instanceof Object){if(c.canPlayMIME(b[e].type)){a=e;break}}else if(c.canPlayURL(b[e])){a=e;break}b[a].url&&(b[a]=b[a].url);b=b[a]}return b};Va=function(b){b._hasTimer||(b._hasTimer=!0,!na&&c.html5PollingInterval&&(null===V&&0===ha&&(V=setInterval(Xa,c.html5PollingInterval)),ha++))};Wa=function(b){b._hasTimer&&(b._hasTimer=!1,!na&&c.html5PollingInterval&&ha--)};Xa=function(){var b;if(null!==V&&!ha)return clearInterval(V),V=null,!1;for(b=c.soundIDs.length-1;0<= b;b--)c.sounds[c.soundIDs[b]].isHTML5&&c.sounds[c.soundIDs[b]]._hasTimer&&c.sounds[c.soundIDs[b]]._onTimer()};K=function(b){b=b!==g?b:{};"function"===typeof c.onerror&&c.onerror.apply(h,[{type:b.type!==g?b.type:null}]);b.fatal!==g&&b.fatal&&c.disable()};$a=function(){if(!bb||!Fa())return!1;var b=c.audioFormats,e,d;for(d in b)if(b.hasOwnProperty(d)&&("mp3"===d||"mp4"===d)&&(c.html5[d]=!1,b[d]&&b[d].related))for(e=b[d].related.length-1;0<=e;e--)c.html5[b[d].related[e]]=!1};this._setSandboxType=function(b){}; this._externalInterfaceOK=function(b){if(c.swfLoaded)return!1;c.swfLoaded=!0;oa=!1;bb&&$a();setTimeout(qa,E?100:1)};ea=function(b,e){function d(a,b){return'<param name="'+a+'" value="'+b+'" />'}if(O&&P)return!1;if(c.html5Only)return va(),c.oMC=aa(c.movieID),qa(),P=O=!0,!1;var a=e||c.url,f=c.altURL||a,h=xa(),k=L(),m=null,m=p.getElementsByTagName("html")[0],l,r,q,m=m&&m.dir&&m.dir.match(/rtl/i);b=b===g?c.id:b;va();c.url=Ua(La?a:f);e=c.url;c.wmode=!c.wmode&&c.useHighPerformance?"transparent":c.wmode; null!==c.wmode&&(u.match(/msie 8/i)||!E&&!c.useHighPerformance)&&navigator.platform.match(/win32|win64/i)&&(W.push(J.spcWmode),c.wmode=null);h={name:b,id:b,src:e,quality:"high",allowScriptAccess:c.allowScriptAccess,bgcolor:c.bgColor,pluginspage:jb+"www.macromedia.com/go/getflashplayer",title:"JS/Flash audio component (SoundManager 2)",type:"application/x-shockwave-flash",wmode:c.wmode,hasPriority:"true"};c.debugFlash&&(h.FlashVars="debug=1");c.wmode||delete h.wmode;if(E)a=p.createElement("div"),r= ['<object id="'+b+'" data="'+e+'" type="'+h.type+'" title="'+h.title+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0">',d("movie",e),d("AllowScriptAccess",c.allowScriptAccess),d("quality",h.quality),c.wmode?d("wmode",c.wmode):"",d("bgcolor",c.bgColor),d("hasPriority","true"),c.debugFlash?d("FlashVars",h.FlashVars):"","</object>"].join("");else for(l in a=p.createElement("embed"),h)h.hasOwnProperty(l)&& a.setAttribute(l,h[l]);ya();k=L();if(h=xa())if(c.oMC=aa(c.movieID)||p.createElement("div"),c.oMC.id)q=c.oMC.className,c.oMC.className=(q?q+" ":"movieContainer")+(k?" "+k:""),c.oMC.appendChild(a),E&&(l=c.oMC.appendChild(p.createElement("div")),l.className="sm2-object-box",l.innerHTML=r),P=!0;else{c.oMC.id=c.movieID;c.oMC.className="movieContainer "+k;l=k=null;c.useFlashBlock||(c.useHighPerformance?k={position:"fixed",width:"8px",height:"8px",bottom:"0px",left:"0px",overflow:"hidden"}:(k={position:"absolute", width:"6px",height:"6px",top:"-9999px",left:"-9999px"},m&&(k.left=Math.abs(parseInt(k.left,10))+"px")));ib&&(c.oMC.style.zIndex=1E4);if(!c.debugFlash)for(q in k)k.hasOwnProperty(q)&&(c.oMC.style[q]=k[q]);try{E||c.oMC.appendChild(a),h.appendChild(c.oMC),E&&(l=c.oMC.appendChild(p.createElement("div")),l.className="sm2-object-box",l.innerHTML=r),P=!0}catch(t){throw Error(T("domError")+" \n"+t.toString());}}return O=!0};da=function(){if(c.html5Only)return ea(),!1;if(k||!c.url)return!1;k=c.getMovie(c.id); k||(S?(E?c.oMC.innerHTML=Aa:c.oMC.appendChild(S),S=null,O=!0):ea(c.id,c.url),k=c.getMovie(c.id));"function"===typeof c.oninitmovie&&setTimeout(c.oninitmovie,1);return!0};I=function(){setTimeout(Ra,1E3)};ua=function(){h.setTimeout(function(){c.setup({preferFlash:!1}).reboot();c.didFlashBlock=!0;c.beginDelayedInit()},1)};Ra=function(){var b,e=!1;if(!c.url||U)return!1;U=!0;t.remove(h,"load",I);if(A&&oa&&!Ka)return!1;l||(b=c.getMoviePercent(),0<b&&100>b&&(e=!0));setTimeout(function(){b=c.getMoviePercent(); if(e)return U=!1,h.setTimeout(I,1),!1;!l&&cb&&(null===b?c.useFlashBlock||0===c.flashLoadTimeout?c.useFlashBlock&&Ba():!c.useFlashBlock&&X?ua():F({type:"ontimeout",ignoreInit:!0,error:{type:"INIT_FLASHBLOCK"}}):0!==c.flashLoadTimeout&&(!c.useFlashBlock&&X?ua():za(!0)))},c.flashLoadTimeout)};ca=function(){if(Ka||!oa)return t.remove(h,"focus",ca),!0;Ka=cb=!0;U=!1;I();t.remove(h,"focus",ca);return!0};Q=function(b){if(l)return!1;if(c.html5Only)return l=!0,H(),!0;var e=!0,d;c.useFlashBlock&&c.flashLoadTimeout&& !c.getMoviePercent()||(l=!0);d={type:!A&&v?"NO_FLASH":"INIT_TIMEOUT"};if(B||b)c.useFlashBlock&&c.oMC&&(c.oMC.className=L()+" "+(null===c.getMoviePercent()?"swf_timedout":"swf_error")),F({type:"ontimeout",error:d,ignoreInit:!0}),K(d),e=!1;B||(c.waitForWindowLoad&&!ra?t.add(h,"load",H):H());return e};Qa=function(){var b,e=c.setupOptions;for(b in e)e.hasOwnProperty(b)&&(c[b]===g?c[b]=e[b]:c[b]!==e[b]&&(c.setupOptions[b]=c[b]))};qa=function(){if(l)return!1;if(c.html5Only)return l||(t.remove(h,"load", c.beginDelayedInit),c.enabled=!0,Q()),!0;da();try{k._externalInterfaceTest(!1),Sa(!0,c.flashPollingInterval||(c.useHighPerformance?10:50)),c.debugMode||k._disableDebug(),c.enabled=!0,c.html5Only||t.add(h,"unload",pa)}catch(b){return K({type:"JS_TO_FLASH_EXCEPTION",fatal:!0}),za(!0),Q(),!1}Q();t.remove(h,"load",c.beginDelayedInit);return!0};G=function(){if(R)return!1;R=!0;Qa();ya();!A&&c.hasHTML5&&c.setup({useHTML5Audio:!0,preferFlash:!1});Za();!A&&v&&(W.push(J.needFlash),c.setup({flashLoadTimeout:1})); p.removeEventListener&&p.removeEventListener("DOMContentLoaded",G,!1);da();return!0};Da=function(){"complete"===p.readyState&&(G(),p.detachEvent("onreadystatechange",Da));return!0};wa=function(){ra=!0;G();t.remove(h,"load",wa)};Fa();t.add(h,"focus",ca);t.add(h,"load",I);t.add(h,"load",wa);p.addEventListener?p.addEventListener("DOMContentLoaded",G,!1):p.attachEvent?p.attachEvent("onreadystatechange",Da):K({type:"NO_DOM2_EVENTS",fatal:!0})}if(!h||!h.document)throw Error("SoundManager requires a browser with window and document objects."); var N=null;h.SM2_DEFER!==g&&SM2_DEFER||(N=new w);"object"===typeof module&&module&&"object"===typeof module.exports?(module.exports.SoundManager=w,module.exports.soundManager=N):"function"===typeof define&&define.amd&&define(function(){return{constructor:w,getInstance:function(g){!h.soundManager&&g instanceof Function&&(g=g(w),g instanceof w&&(h.soundManager=g));return h.soundManager}}});h.SoundManager=w;h.soundManager=N})(window);
const db = require('../db'); const { updateToken } = require('../middlewares/auth'); const login = async (ctx) => { try { const { username, password } = ctx.request.body; let result = await db.users.find({ username, password }); if (result.length) { let token = updateToken(ctx, { uid: 1 }); ctx.body = { code: 200, data: { uid: 1, username: 'admin', token } }; } else { ctx.throw(401, '用户名或密码不正确!'); } } catch (err) { ctx.throw(500, err.message); } } module.exports = { login }
/* global describe, it */ var assert = require('assert') var async = require('async') var bigi = require('bigi') var bitcoin = require('../../') var blockchain = new (require('cb-blockr'))('bitcoin') var crypto = require('crypto') describe('bitcoinjs-lib (crypto)', function () { it('can generate a single-key stealth address', function () { var receiver = bitcoin.ECPair.fromWIF('5KYZdUEo39z3FPrtuX2QbbwGnNP5zTd7yyr2SC1j299sBCnWjss') // XXX: ephemeral, must be random (and secret to sender) to preserve privacy var sender = bitcoin.ECPair.fromWIF('Kxr9tQED9H44gCmp6HAdmemAzU3n84H3dGkuWTKvE23JgHMW8gct') var G = bitcoin.ECPair.curve.G var d = receiver.d // secret (receiver only) var Q = receiver.Q // shared var e = sender.d // secret (sender only) var P = sender.Q // shared // derived shared secret var eQ = Q.multiply(e) // sender var dP = P.multiply(d) // receiver assert.deepEqual(eQ.getEncoded(), dP.getEncoded()) var c = bigi.fromBuffer(bitcoin.crypto.sha256(eQ.getEncoded())) var cG = G.multiply(c) // derived public key var QprimeS = Q.add(cG) var QprimeR = G.multiply(d.add(c)) assert.deepEqual(QprimeR.getEncoded(), QprimeS.getEncoded()) // derived shared-secret address var address = new bitcoin.ECPair(null, QprimeS).getAddress() assert.strictEqual(address, '1EwCNJNZM5q58YPPTnjR1H5BvYRNeyZi47') }) // TODO it.skip('can generate a dual-key stealth address', function () {}) it("can recover a parent private key from the parent's public key and a derived non-hardened child private key", function () { function recoverParent (master, child) { assert(!master.keyPair.d, 'You already have the parent private key') assert(child.keyPair.d, 'Missing child private key') var curve = bitcoin.ECPair.curve var QP = master.keyPair.Q var serQP = master.keyPair.getPublicKeyBuffer() var d1 = child.keyPair.d var d2 var indexBuffer = new Buffer(4) // search index space until we find it for (var i = 0; i < bitcoin.HDNode.HIGHEST_BIT; ++i) { indexBuffer.writeUInt32BE(i, 0) // calculate I var data = Buffer.concat([serQP, indexBuffer]) var I = crypto.createHmac('sha512', master.chainCode).update(data).digest() var IL = I.slice(0, 32) var pIL = bigi.fromBuffer(IL) // See hdnode.js:273 to understand d2 = d1.subtract(pIL).mod(curve.n) var Qp = new bitcoin.ECPair(d2).Q if (Qp.equals(QP)) break } var node = new bitcoin.HDNode(new bitcoin.ECPair(d2), master.chainCode, master.network) node.depth = master.depth node.index = master.index node.masterFingerprint = master.masterFingerprint return node } var seed = crypto.randomBytes(32) var master = bitcoin.HDNode.fromSeedBuffer(seed) var child = master.derive(6) // m/6 // now for the recovery var neuteredMaster = master.neutered() var recovered = recoverParent(neuteredMaster, child) assert.strictEqual(recovered.toBase58(), master.toBase58()) }) it('can recover a private key from duplicate R values', function () { var inputs = [ { txId: 'f4c16475f2a6e9c602e4a287f9db3040e319eb9ece74761a4b84bc820fbeef50', vout: 0 }, { txId: 'f4c16475f2a6e9c602e4a287f9db3040e319eb9ece74761a4b84bc820fbeef50', vout: 1 } ] var txIds = inputs.map(function (x) { return x.txId }) // first retrieve the relevant transactions blockchain.transactions.get(txIds, function (err, results) { assert.ifError(err) var transactions = {} results.forEach(function (tx) { transactions[tx.txId] = bitcoin.Transaction.fromHex(tx.txHex) }) var tasks = [] // now we need to collect/transform a bit of data from the selected inputs inputs.forEach(function (input) { var transaction = transactions[input.txId] var script = transaction.ins[input.vout].script assert(bitcoin.scripts.isPubKeyHashInput(script), 'Expected pubKeyHash script') var prevOutTxId = bitcoin.bufferutils.reverse(transaction.ins[input.vout].hash).toString('hex') var prevVout = transaction.ins[input.vout].index tasks.push(function (callback) { blockchain.transactions.get(prevOutTxId, function (err, result) { if (err) return callback(err) var prevOut = bitcoin.Transaction.fromHex(result.txHex) var prevOutScript = prevOut.outs[prevVout].script var scriptSignature = bitcoin.ECSignature.parseScriptSignature(script.chunks[0]) var publicKey = bitcoin.ECPair.fromPublicKeyBuffer(script.chunks[1]) var m = transaction.hashForSignature(input.vout, prevOutScript, scriptSignature.hashType) assert(publicKey.verify(m, scriptSignature.signature), 'Invalid m') // store the required information input.signature = scriptSignature.signature input.z = bigi.fromBuffer(m) return callback() }) }) }) // finally, run the tasks, then on to the math async.parallel(tasks, function (err) { if (err) throw err var n = bitcoin.ECPair.curve.n for (var i = 0; i < inputs.length; ++i) { for (var j = i + 1; j < inputs.length; ++j) { var inputA = inputs[i] var inputB = inputs[j] // enforce matching r values assert.strictEqual(inputA.signature.r.toString(), inputB.signature.r.toString()) var r = inputA.signature.r var rInv = r.modInverse(n) var s1 = inputA.signature.s var s2 = inputB.signature.s var z1 = inputA.z var z2 = inputB.z var zz = z1.subtract(z2).mod(n) var ss = s1.subtract(s2).mod(n) // k = (z1 - z2) / (s1 - s2) // d1 = (s1 * k - z1) / r // d2 = (s2 * k - z2) / r var k = zz.multiply(ss.modInverse(n)).mod(n) var d1 = ((s1.multiply(k).mod(n)).subtract(z1).mod(n)).multiply(rInv).mod(n) var d2 = ((s2.multiply(k).mod(n)).subtract(z2).mod(n)).multiply(rInv).mod(n) // enforce matching private keys assert.strictEqual(d1.toString(), d2.toString()) } } }) }) }) })
/* * Ext JS Library 2.0 * Copyright(c) 2006-2007, Ext JS, LLC. * licensing@extjs.com * * http://extjs.com/license */ /** * @class Ext.LoadMask * A simple utility class for generically masking elements while loading data. If the element being masked has * an underlying {@link Ext.data.Store}, the masking will be automatically synchronized with the store's loading * process and the mask element will be cached for reuse. For all other elements, this mask will replace the * element's Updater load indicator and will be destroyed after the initial load. * @constructor * Create a new LoadMask * @param {Mixed} el The element or DOM node, or its id * @param {Object} config The config object */ Ext.LoadMask = function(el, config){ this.el = Ext.get(el); Ext.apply(this, config); if(this.store){ this.store.on('beforeload', this.onBeforeLoad, this); this.store.on('load', this.onLoad, this); this.store.on('loadexception', this.onLoad, this); this.removeMask = Ext.value(this.removeMask, false); }else{ var um = this.el.getUpdater(); um.showLoadIndicator = false; // disable the default indicator um.on('beforeupdate', this.onBeforeLoad, this); um.on('update', this.onLoad, this); um.on('failure', this.onLoad, this); this.removeMask = Ext.value(this.removeMask, true); } }; Ext.LoadMask.prototype = { /** * @cfg {Boolean} removeMask * True to create a single-use mask that is automatically destroyed after loading (useful for page loads), * False to persist the mask element reference for multiple uses (e.g., for paged data widgets). Defaults to false. */ /** * @cfg {String} msg * The text to display in a centered loading message box (defaults to 'Loading...') */ msg : 'Loading...', /** * @cfg {String} msgCls * The CSS class to apply to the loading message element (defaults to "x-mask-loading") */ msgCls : 'x-mask-loading', /** * Read-only. True if the mask is currently disabled so that it will not be displayed (defaults to false) * @type Boolean */ disabled: false, /** * Disables the mask to prevent it from being displayed */ disable : function(){ this.disabled = true; }, /** * Enables the mask so that it can be displayed */ enable : function(){ this.disabled = false; }, // private onLoad : function(){ this.el.unmask(this.removeMask); }, // private onBeforeLoad : function(){ if(!this.disabled){ this.el.mask(this.msg, this.msgCls); } }, show: function(){ this.onBeforeLoad(); }, hide: function(){ this.onLoad(); }, // private destroy : function(){ if(this.store){ this.store.un('beforeload', this.onBeforeLoad, this); this.store.un('load', this.onLoad, this); this.store.un('loadexception', this.onLoad, this); }else{ var um = this.el.getUpdater(); um.un('beforeupdate', this.onBeforeLoad, this); um.un('update', this.onLoad, this); um.un('failure', this.onLoad, this); } } };
//import the parent class const Employee = require('./Employee'); class Engineer extends Employee { constructor(name, id, email, github) { super(name, id, email); this.github = github; } getRole(){ return "Engineer"; } getGithub() { return this.github; } } module.exports = Engineer;
/** * Created by marija on 22.02.18. */ var p1 = Promise.resolve(18); var p2 = Promise.reject(17); var callbackArguments = []; var argument1 = function (err) { callbackArguments.push(arguments) expect(err).to.exist; done(); }; var argument2 = function (containers) { callbackArguments.push(arguments) return _this.setupContainers(containers); }; var argument3 = null; var argument4 = 403; var argument5 = null; var argument6 = function () { callbackArguments.push(arguments) return lawnchairDao.read(key); }; var argument7 = function (err) { callbackArguments.push(arguments) /permission/i.test(err.message).should.be.true; }; var argument8 = [100,242]; var argument9 = p2; var base_0 = p1 var r_0= undefined try { r_0 = base_0.catch(argument1) } catch(e) { r_0= e.message } var base_1 = r_0 var r_1= undefined try { r_1 = base_1.then(argument2,argument3,argument4) } catch(e) { r_1= e.message } var base_2 = p1 var r_2= undefined try { r_2 = base_2.then(argument5,argument6) } catch(e) { r_2= e.message } var base_3 = r_1 var r_3= undefined try { r_3 = base_3.catch(argument7,argument8,argument9) } catch(e) { r_3= e.message } function serialize(array){ return array.map(function(a){ if (a === null || a == undefined) return a; var name = a.constructor.name; if (name==='Object' || name=='Boolean'|| name=='Array'||name=='Number'||name=='String') return JSON.stringify(a); return name; }); } setTimeout(function(){ require("fs").writeFileSync("./experiments/promises/promiseMined/test990.json",JSON.stringify({"baseObjects":serialize([base_0,base_1,base_2,base_3]),"returnObjects":serialize([r_0,r_1,r_2,r_3]),"callbackArgs":callbackArguments})) },300)
// flow-typed signature: 6a7199b5b1fc83a3692ef2d6bc31a366 // flow-typed version: <<STUB>>/tmp_v^0.0.31/flow_v0.47.0 /** * This is an autogenerated libdef stub for: * * 'tmp' * * Fill this stub out by replacing all the `any` types. * * Once filled out, we encourage you to share your work with the * community by sending a pull request to: * https://github.com/flowtype/flow-typed */ declare module 'tmp' { declare module.exports: any; } /** * We include stubs for each file inside this npm package in case you need to * require those files directly. Feel free to delete any files that aren't * needed. */ declare module 'tmp/lib/tmp' { declare module.exports: any; } // Filename aliases declare module 'tmp/lib/tmp.js' { declare module.exports: $Exports<'tmp/lib/tmp'>; }
"use strict"; var registry = require("./registry.js"); /** * * @param name * @param url */ module.exports = function (client, name) { name = "REDIS-" + name; registry.add(name, function () { return new Promise((resolve, reject) => { if(client.connected) { return resolve({ connected: true }); } else { return resolve({ connected: false, error: "Redis not connected" }); } }); }); }
import { useEffect, useRef } from 'react'; var useUpdateEffect = function (effect, deps) { var isInitialMount = useRef(true); useEffect(isInitialMount.current ? function () { isInitialMount.current = false; } : effect, deps); }; export default useUpdateEffect;
'use strict'; var deepMap = require('../../utils/collection/deepMap'); function factory (type, config, load, typed) { /** * Calculate the cotangent of a value. Defined as `cot(x) = 1 / tan(x)`. * * For matrices, the function is evaluated element wise. * * Syntax: * * math.cot(x) * * Examples: * * math.cot(2); // returns number -0.45765755436028577 * 1 / math.tan(2); // returns number -0.45765755436028577 * * See also: * * tan, sec, csc * * @param {number | Complex | Unit | Array | Matrix} x Function input * @return {number | Complex | Array | Matrix} Cotangent of x */ var cot = typed('cot', { 'number': function (x) { return 1 / Math.tan(x); }, 'Complex': function (x) { return x.cot(); }, 'BigNumber': function (x) { return new type.BigNumber(1).div(x.tan()); }, 'Unit': function (x) { if (!x.hasBase(type.Unit.BASE_UNITS.ANGLE)) { throw new TypeError ('Unit in function cot is no angle'); } return cot(x.value); }, 'Array | Matrix': function (x) { return deepMap(x, cot); } }); cot.toTex = {1: '\\cot\\left(${args[0]}\\right)'}; return cot; } exports.name = 'cot'; exports.factory = factory;
var data = { "body": "<path d=\"M6 16h12v2H6v-2m0-3v2H2v-2h4m1 2v-2h3v2H7m4 0v-2h2v2h-2m3 0v-2h3v2h-3m4 0v-2h4v2h-4M2 10h3v2H2v-2m17 2v-2h3v2h-3m-1 0h-2v-2h2v2M8 12H6v-2h2v2m4 0H9v-2h3v2m3 0h-2v-2h2v2M2 9V7h2v2H2m3 0V7h2v2H5m3 0V7h2v2H8m3 0V7h2v2h-2m3 0V7h2v2h-2m3 0V7h5v2h-5z\" fill=\"currentColor\"/>", "width": 24, "height": 24 }; exports.__esModule = true; exports.default = data;
import { takeSnapshotsOf } from "@hig/jest-preset/helpers"; import ProfileActionPresenter from "./ProfileActionPresenter"; describe("top-nav/presenters/ProfileActionPresenter", () => { takeSnapshotsOf(ProfileActionPresenter, [ { desc: "renders with children", props: { children: "Peter Parker" } } ]); });
/** * Creates a GeoCallbackRegistration instance. */ var GeoCallbackRegistration = /** @class */ (function () { /** * @param _cancelCallback Callback to run when this callback registration is cancelled. */ function GeoCallbackRegistration(_cancelCallback) { this._cancelCallback = _cancelCallback; if (Object.prototype.toString.call(this._cancelCallback) !== '[object Function]') { throw new Error('callback must be a function'); } } /********************/ /* PUBLIC METHODS */ /********************/ /** * Cancels this callback registration so that it no longer fires its callback. This * has no effect on any other callback registrations you may have created. */ GeoCallbackRegistration.prototype.cancel = function () { if (typeof this._cancelCallback !== 'undefined') { this._cancelCallback(); this._cancelCallback = undefined; } }; return GeoCallbackRegistration; }()); // Default geohash length var g_GEOHASH_PRECISION = 10; // Characters used in location geohashes var g_BASE32 = '0123456789bcdefghjkmnpqrstuvwxyz'; // The meridional circumference of the earth in meters var g_EARTH_MERI_CIRCUMFERENCE = 40007860; // Length of a degree latitude at the equator var g_METERS_PER_DEGREE_LATITUDE = 110574; // Number of bits per geohash character var g_BITS_PER_CHAR = 5; // Maximum length of a geohash in bits var g_MAXIMUM_BITS_PRECISION = 22 * g_BITS_PER_CHAR; // Equatorial radius of the earth in meters var g_EARTH_EQ_RADIUS = 6378137.0; // The following value assumes a polar radius of // const g_EARTH_POL_RADIUS = 6356752.3; // The formulate to calculate g_E2 is // g_E2 == (g_EARTH_EQ_RADIUS^2-g_EARTH_POL_RADIUS^2)/(g_EARTH_EQ_RADIUS^2) // The exact value is used here to avoid rounding errors var g_E2 = 0.00669447819799; // Cutoff for rounding errors on double calculations var g_EPSILON = 1e-12; Math.log2 = Math.log2 || function (x) { return Math.log(x) / Math.log(2); }; /** * Validates the inputted key and throws an error if it is invalid. * * @param key The key to be verified. */ function validateKey(key) { var error; if (typeof key !== 'string') { error = 'key must be a string'; } else if (key.length === 0) { error = 'key cannot be the empty string'; } else if (1 + g_GEOHASH_PRECISION + key.length > 755) { // Firebase can only stored child paths up to 768 characters // The child path for this key is at the least: 'i/<geohash>key' error = 'key is too long to be stored in Firebase'; } else if (/[\[\].#$\/\u0000-\u001F\u007F]/.test(key)) { // Firebase does not allow node keys to contain the following characters error = 'key cannot contain any of the following characters: . # $ ] [ /'; } if (typeof error !== 'undefined') { throw new Error('Invalid GeoFire key \'' + key + '\': ' + error); } } /** * Validates the inputted location and throws an error if it is invalid. * * @param location The [latitude, longitude] pair to be verified. */ function validateLocation(location) { var error; if (!Array.isArray(location)) { error = 'location must be an array'; } else if (location.length !== 2) { error = 'expected array of length 2, got length ' + location.length; } else { var latitude = location[0]; var longitude = location[1]; if (typeof latitude !== 'number' || isNaN(latitude)) { error = 'latitude must be a number'; } else if (latitude < -90 || latitude > 90) { error = 'latitude must be within the range [-90, 90]'; } else if (typeof longitude !== 'number' || isNaN(longitude)) { error = 'longitude must be a number'; } else if (longitude < -180 || longitude > 180) { error = 'longitude must be within the range [-180, 180]'; } } if (typeof error !== 'undefined') { throw new Error('Invalid GeoFire location \'' + location + '\': ' + error); } } /** * Validates the inputted geohash and throws an error if it is invalid. * * @param geohash The geohash to be validated. */ function validateGeohash(geohash) { var error; if (typeof geohash !== 'string') { error = 'geohash must be a string'; } else if (geohash.length === 0) { error = 'geohash cannot be the empty string'; } else { for (var _i = 0, geohash_1 = geohash; _i < geohash_1.length; _i++) { var letter = geohash_1[_i]; if (g_BASE32.indexOf(letter) === -1) { error = 'geohash cannot contain \'' + letter + '\''; } } } if (typeof error !== 'undefined') { throw new Error('Invalid GeoFire geohash \'' + geohash + '\': ' + error); } } /** * Validates the inputted query criteria and throws an error if it is invalid. * * @param newQueryCriteria The criteria which specifies the query's center and/or radius. * @param requireCenterAndRadius The criteria which center and radius required. */ function validateCriteria(newQueryCriteria, requireCenterAndRadius) { if (requireCenterAndRadius === void 0) { requireCenterAndRadius = false; } if (typeof newQueryCriteria !== 'object') { throw new Error('query criteria must be an object'); } else if (typeof newQueryCriteria.center === 'undefined' && typeof newQueryCriteria.radius === 'undefined') { throw new Error('radius and/or center must be specified'); } else if (requireCenterAndRadius && (typeof newQueryCriteria.center === 'undefined' || typeof newQueryCriteria.radius === 'undefined')) { throw new Error('query criteria for a new query must contain both a center and a radius'); } // Throw an error if there are any extraneous attributes var keys = Object.keys(newQueryCriteria); for (var _i = 0, keys_1 = keys; _i < keys_1.length; _i++) { var key = keys_1[_i]; if (key !== 'center' && key !== 'radius') { throw new Error('Unexpected attribute \'' + key + '\' found in query criteria'); } } // Validate the 'center' attribute if (typeof newQueryCriteria.center !== 'undefined') { validateLocation(newQueryCriteria.center); } // Validate the 'radius' attribute if (typeof newQueryCriteria.radius !== 'undefined') { if (typeof newQueryCriteria.radius !== 'number' || isNaN(newQueryCriteria.radius)) { throw new Error('radius must be a number'); } else if (newQueryCriteria.radius < 0) { throw new Error('radius must be greater than or equal to 0'); } } } /** * Converts degrees to radians. * * @param degrees The number of degrees to be converted to radians. * @returns The number of radians equal to the inputted number of degrees. */ function degreesToRadians(degrees) { if (typeof degrees !== 'number' || isNaN(degrees)) { throw new Error('Error: degrees must be a number'); } return (degrees * Math.PI / 180); } /** * Generates a geohash of the specified precision/string length from the [latitude, longitude] * pair, specified as an array. * * @param location The [latitude, longitude] pair to encode into a geohash. * @param precision The length of the geohash to create. If no precision is specified, the * global default is used. * @returns The geohash of the inputted location. */ function encodeGeohash(location, precision) { if (precision === void 0) { precision = g_GEOHASH_PRECISION; } validateLocation(location); if (typeof precision !== 'undefined') { if (typeof precision !== 'number' || isNaN(precision)) { throw new Error('precision must be a number'); } else if (precision <= 0) { throw new Error('precision must be greater than 0'); } else if (precision > 22) { throw new Error('precision cannot be greater than 22'); } else if (Math.round(precision) !== precision) { throw new Error('precision must be an integer'); } } var latitudeRange = { min: -90, max: 90 }; var longitudeRange = { min: -180, max: 180 }; var hash = ''; var hashVal = 0; var bits = 0; var even = 1; while (hash.length < precision) { var val = even ? location[1] : location[0]; var range = even ? longitudeRange : latitudeRange; var mid = (range.min + range.max) / 2; if (val > mid) { hashVal = (hashVal << 1) + 1; range.min = mid; } else { hashVal = (hashVal << 1) + 0; range.max = mid; } even = !even; if (bits < 4) { bits++; } else { bits = 0; hash += g_BASE32[hashVal]; hashVal = 0; } } return hash; } /** * Calculates the number of degrees a given distance is at a given latitude. * * @param distance The distance to convert. * @param latitude The latitude at which to calculate. * @returns The number of degrees the distance corresponds to. */ function metersToLongitudeDegrees(distance, latitude) { var radians = degreesToRadians(latitude); var num = Math.cos(radians) * g_EARTH_EQ_RADIUS * Math.PI / 180; var denom = 1 / Math.sqrt(1 - g_E2 * Math.sin(radians) * Math.sin(radians)); var deltaDeg = num * denom; if (deltaDeg < g_EPSILON) { return distance > 0 ? 360 : 0; } else { return Math.min(360, distance / deltaDeg); } } /** * Calculates the bits necessary to reach a given resolution, in meters, for the longitude at a * given latitude. * * @param resolution The desired resolution. * @param latitude The latitude used in the conversion. * @return The bits necessary to reach a given resolution, in meters. */ function longitudeBitsForResolution(resolution, latitude) { var degs = metersToLongitudeDegrees(resolution, latitude); return (Math.abs(degs) > 0.000001) ? Math.max(1, Math.log2(360 / degs)) : 1; } /** * Calculates the bits necessary to reach a given resolution, in meters, for the latitude. * * @param resolution The bits necessary to reach a given resolution, in meters. * @returns Bits necessary to reach a given resolution, in meters, for the latitude. */ function latitudeBitsForResolution(resolution) { return Math.min(Math.log2(g_EARTH_MERI_CIRCUMFERENCE / 2 / resolution), g_MAXIMUM_BITS_PRECISION); } /** * Wraps the longitude to [-180,180]. * * @param longitude The longitude to wrap. * @returns longitude The resulting longitude. */ function wrapLongitude(longitude) { if (longitude <= 180 && longitude >= -180) { return longitude; } var adjusted = longitude + 180; if (adjusted > 0) { return (adjusted % 360) - 180; } else { return 180 - (-adjusted % 360); } } /** * Calculates the maximum number of bits of a geohash to get a bounding box that is larger than a * given size at the given coordinate. * * @param coordinate The coordinate as a [latitude, longitude] pair. * @param size The size of the bounding box. * @returns The number of bits necessary for the geohash. */ function boundingBoxBits(coordinate, size) { var latDeltaDegrees = size / g_METERS_PER_DEGREE_LATITUDE; var latitudeNorth = Math.min(90, coordinate[0] + latDeltaDegrees); var latitudeSouth = Math.max(-90, coordinate[0] - latDeltaDegrees); var bitsLat = Math.floor(latitudeBitsForResolution(size)) * 2; var bitsLongNorth = Math.floor(longitudeBitsForResolution(size, latitudeNorth)) * 2 - 1; var bitsLongSouth = Math.floor(longitudeBitsForResolution(size, latitudeSouth)) * 2 - 1; return Math.min(bitsLat, bitsLongNorth, bitsLongSouth, g_MAXIMUM_BITS_PRECISION); } /** * Calculates eight points on the bounding box and the center of a given circle. At least one * geohash of these nine coordinates, truncated to a precision of at most radius, are guaranteed * to be prefixes of any geohash that lies within the circle. * * @param center The center given as [latitude, longitude]. * @param radius The radius of the circle. * @returns The eight bounding box points. */ function boundingBoxCoordinates(center, radius) { var latDegrees = radius / g_METERS_PER_DEGREE_LATITUDE; var latitudeNorth = Math.min(90, center[0] + latDegrees); var latitudeSouth = Math.max(-90, center[0] - latDegrees); var longDegsNorth = metersToLongitudeDegrees(radius, latitudeNorth); var longDegsSouth = metersToLongitudeDegrees(radius, latitudeSouth); var longDegs = Math.max(longDegsNorth, longDegsSouth); return [ [center[0], center[1]], [center[0], wrapLongitude(center[1] - longDegs)], [center[0], wrapLongitude(center[1] + longDegs)], [latitudeNorth, center[1]], [latitudeNorth, wrapLongitude(center[1] - longDegs)], [latitudeNorth, wrapLongitude(center[1] + longDegs)], [latitudeSouth, center[1]], [latitudeSouth, wrapLongitude(center[1] - longDegs)], [latitudeSouth, wrapLongitude(center[1] + longDegs)] ]; } /** * Calculates the bounding box query for a geohash with x bits precision. * * @param geohash The geohash whose bounding box query to generate. * @param bits The number of bits of precision. * @returns A [start, end] pair of geohashes. */ function geohashQuery(geohash, bits) { validateGeohash(geohash); var precision = Math.ceil(bits / g_BITS_PER_CHAR); if (geohash.length < precision) { return [geohash, geohash + '~']; } geohash = geohash.substring(0, precision); var base = geohash.substring(0, geohash.length - 1); var lastValue = g_BASE32.indexOf(geohash.charAt(geohash.length - 1)); var significantBits = bits - (base.length * g_BITS_PER_CHAR); var unusedBits = (g_BITS_PER_CHAR - significantBits); // delete unused bits var startValue = (lastValue >> unusedBits) << unusedBits; var endValue = startValue + (1 << unusedBits); if (endValue > 31) { return [base + g_BASE32[startValue], base + '~']; } else { return [base + g_BASE32[startValue], base + g_BASE32[endValue]]; } } /** * Calculates a set of queries to fully contain a given circle. A query is a [start, end] pair * where any geohash is guaranteed to be lexiographically larger then start and smaller than end. * * @param center The center given as [latitude, longitude] pair. * @param radius The radius of the circle. * @return An array of geohashes containing a [start, end] pair. */ function geohashQueries(center, radius) { validateLocation(center); var queryBits = Math.max(1, boundingBoxBits(center, radius)); var geohashPrecision = Math.ceil(queryBits / g_BITS_PER_CHAR); var coordinates = boundingBoxCoordinates(center, radius); var queries = coordinates.map(function (coordinate) { return geohashQuery(encodeGeohash(coordinate, geohashPrecision), queryBits); }); // remove duplicates return queries.filter(function (query, index) { return !queries.some(function (other, otherIndex) { return index > otherIndex && query[0] === other[0] && query[1] === other[1]; }); }); } /** * Encodes a location and geohash as a GeoFire object. * * @param location The location as [latitude, longitude] pair. * @param geohash The geohash of the location. * @returns The location encoded as GeoFire object. */ function encodeGeoFireObject(location, geohash) { validateLocation(location); validateGeohash(geohash); return { '.priority': geohash, 'g': geohash, 'l': location }; } /** * Decodes the location given as GeoFire object. Returns null if decoding fails. * * @param geoFireObj The location encoded as GeoFire object. * @returns The location as [latitude, longitude] pair or null if decoding fails. */ function decodeGeoFireObject(geoFireObj) { if (geoFireObj && 'l' in geoFireObj && Array.isArray(geoFireObj.l) && geoFireObj.l.length === 2) { return geoFireObj.l; } else { throw new Error('Unexpected location object encountered: ' + JSON.stringify(geoFireObj)); } } /** * Returns the key of a Firebase snapshot across SDK versions. * * @param A Firebase snapshot. * @returns The Firebase snapshot's key. */ function geoFireGetKey(snapshot) { var key; if (typeof snapshot.key === 'string' || snapshot.key === null) { key = snapshot.key; } else if (typeof snapshot.key === 'function') { // @ts-ignore key = snapshot.key(); } else { // @ts-ignore key = snapshot.name(); } return key; } /** * Method which calculates the distance, in kilometers, between two locations, * via the Haversine formula. Note that this is approximate due to the fact that the * Earth's radius varies between 6356.752 km and 6378.137 km. * * @param location1 The [latitude, longitude] pair of the first location. * @param location2 The [latitude, longitude] pair of the second location. * @returns The distance, in kilometers, between the inputted locations. */ function distance(location1, location2) { validateLocation(location1); validateLocation(location2); var radius = 6371; // Earth's radius in kilometers var latDelta = degreesToRadians(location2[0] - location1[0]); var lonDelta = degreesToRadians(location2[1] - location1[1]); var a = (Math.sin(latDelta / 2) * Math.sin(latDelta / 2)) + (Math.cos(degreesToRadians(location1[0])) * Math.cos(degreesToRadians(location2[0])) * Math.sin(lonDelta / 2) * Math.sin(lonDelta / 2)); var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a)); return radius * c; } /** * Creates a GeoQuery instance. */ var GeoQuery = /** @class */ (function () { /** * @param _firebaseRef A Firebase reference where the GeoFire data will be stored. * @param queryCriteria The criteria which specifies the query's center and radius. */ function GeoQuery(_firebaseRef, queryCriteria) { var _this = this; this._firebaseRef = _firebaseRef; // Event callbacks this._callbacks = { ready: [], key_entered: [], key_exited: [], key_moved: [] }; // Variable to track when the query is cancelled this._cancelled = false; // A dictionary of geohash queries which currently have an active callbacks this._currentGeohashesQueried = {}; // A dictionary of locations that a currently active in the queries // Note that not all of these are currently within this query this._locationsTracked = {}; // Variables used to keep track of when to fire the 'ready' event this._valueEventFired = false; this._geohashCleanupScheduled = false; this._cleanUpCurrentGeohashesQueriedTimeout = null; // Firebase reference of the GeoFire which created this query if (Object.prototype.toString.call(this._firebaseRef) !== '[object Object]') { throw new Error('firebaseRef must be an instance of Firebase'); } // Every ten seconds, clean up the geohashes we are currently querying for. We keep these around // for a little while since it's likely that they will need to be re-queried shortly after they // move outside of the query's bounding box. this._cleanUpCurrentGeohashesQueriedInterval = setInterval(function () { if (_this._geohashCleanupScheduled === false) { _this._cleanUpCurrentGeohashesQueried(); } }, 10000); // Validate and save the query criteria validateCriteria(queryCriteria, true); this._center = queryCriteria.center; this._radius = queryCriteria.radius; // Listen for new geohashes being added around this query and fire the appropriate events this._listenForNewGeohashes(); } /********************/ /* PUBLIC METHODS */ /********************/ /** * Terminates this query so that it no longer sends location updates. All callbacks attached to this * query via on() will be cancelled. This query can no longer be used in the future. */ GeoQuery.prototype.cancel = function () { var _this = this; // Mark this query as cancelled this._cancelled = true; // Cancel all callbacks in this query's callback list this._callbacks = { ready: [], key_entered: [], key_exited: [], key_moved: [] }; // Turn off all Firebase listeners for the current geohashes being queried var keys = Object.keys(this._currentGeohashesQueried); keys.forEach(function (geohashQueryStr) { var query = _this._stringToQuery(geohashQueryStr); _this._cancelGeohashQuery(query, _this._currentGeohashesQueried[geohashQueryStr]); delete _this._currentGeohashesQueried[geohashQueryStr]; }); // Delete any stored locations this._locationsTracked = {}; // Turn off the current geohashes queried clean up interval clearInterval(this._cleanUpCurrentGeohashesQueriedInterval); }; /** * Returns the location signifying the center of this query. * * @returns The [latitude, longitude] pair signifying the center of this query. */ GeoQuery.prototype.center = function () { return this._center; }; /** * Attaches a callback to this query which will be run when the provided eventType fires. Valid eventType * values are 'ready', 'key_entered', 'key_exited', and 'key_moved'. The ready event callback is passed no * parameters. All other callbacks will be passed three parameters: (1) the location's key, (2) the location's * [latitude, longitude] pair, and (3) the distance, in kilometers, from the location to this query's center * * 'ready' is used to signify that this query has loaded its initial state and is up-to-date with its corresponding * GeoFire instance. 'ready' fires when this query has loaded all of the initial data from GeoFire and fired all * other events for that data. It also fires every time updateCriteria() is called, after all other events have * fired for the updated query. * * 'key_entered' fires when a key enters this query. This can happen when a key moves from a location outside of * this query to one inside of it or when a key is written to GeoFire for the first time and it falls within * this query. * * 'key_exited' fires when a key moves from a location inside of this query to one outside of it. If the key was * entirely removed from GeoFire, both the location and distance passed to the callback will be null. * * 'key_moved' fires when a key which is already in this query moves to another location inside of it. * * Returns a GeoCallbackRegistration which can be used to cancel the callback. You can add as many callbacks * as you would like for the same eventType by repeatedly calling on(). Each one will get called when its * corresponding eventType fires. Each callback must be cancelled individually. * * @param eventType The event type for which to attach the callback. One of 'ready', 'key_entered', * 'key_exited', or 'key_moved'. * @param callback Callback function to be called when an event of type eventType fires. * @returns A callback registration which can be used to cancel the provided callback. */ GeoQuery.prototype.on = function (eventType, callback) { var _this = this; // Validate the inputs if (['ready', 'key_entered', 'key_exited', 'key_moved'].indexOf(eventType) === -1) { throw new Error('event type must be \'ready\', \'key_entered\', \'key_exited\', or \'key_moved\''); } if (typeof callback !== 'function') { throw new Error('callback must be a function'); } // Add the callback to this query's callbacks list this._callbacks[eventType].push(callback); // If this is a 'key_entered' callback, fire it for every location already within this query if (eventType === 'key_entered') { var keys = Object.keys(this._locationsTracked); keys.forEach(function (key) { var locationDict = _this._locationsTracked[key]; if (typeof locationDict !== 'undefined' && locationDict.isInQuery) { callback(key, locationDict.location, locationDict.distanceFromCenter); } }); } // If this is a 'ready' callback, fire it if this query is already ready if (eventType === 'ready' && this._valueEventFired) { callback(); } // Return an event registration which can be used to cancel the callback return new GeoCallbackRegistration(function () { _this._callbacks[eventType].splice(_this._callbacks[eventType].indexOf(callback), 1); }); }; /** * Returns the radius of this query, in kilometers. * * @returns The radius of this query, in kilometers. */ GeoQuery.prototype.radius = function () { return this._radius; }; /** * Updates the criteria for this query. * * @param newQueryCriteria The criteria which specifies the query's center and radius. */ GeoQuery.prototype.updateCriteria = function (newQueryCriteria) { // Validate and save the new query criteria validateCriteria(newQueryCriteria); this._center = newQueryCriteria.center || this._center; this._radius = newQueryCriteria.radius || this._radius; // Loop through all of the locations in the query, update their distance from the center of the // query, and fire any appropriate events var keys = Object.keys(this._locationsTracked); for (var _i = 0, keys_1 = keys; _i < keys_1.length; _i++) { var key = keys_1[_i]; // If the query was cancelled while going through this loop, stop updating locations and stop // firing events if (this._cancelled === true) { break; } // Get the cached information for this location var locationDict = this._locationsTracked[key]; // Save if the location was already in the query var wasAlreadyInQuery = locationDict.isInQuery; // Update the location's distance to the new query center locationDict.distanceFromCenter = distance(locationDict.location, this._center); // Determine if the location is now in this query locationDict.isInQuery = (locationDict.distanceFromCenter <= this._radius); // If the location just left the query, fire the 'key_exited' callbacks // Else if the location just entered the query, fire the 'key_entered' callbacks if (wasAlreadyInQuery && !locationDict.isInQuery) { this._fireCallbacksForKey('key_exited', key, locationDict.location, locationDict.distanceFromCenter); } else if (!wasAlreadyInQuery && locationDict.isInQuery) { this._fireCallbacksForKey('key_entered', key, locationDict.location, locationDict.distanceFromCenter); } } // Reset the variables which control when the 'ready' event fires this._valueEventFired = false; // Listen for new geohashes being added to GeoFire and fire the appropriate events this._listenForNewGeohashes(); }; /*********************/ /* PRIVATE METHODS */ /*********************/ /** * Turns off all callbacks for the provide geohash query. * * @param query The geohash query. * @param queryState An object storing the current state of the query. */ GeoQuery.prototype._cancelGeohashQuery = function (query, queryState) { var queryRef = this._firebaseRef.orderByChild('g').startAt(query[0]).endAt(query[1]); queryRef.off('child_added', queryState.childAddedCallback); queryRef.off('child_removed', queryState.childRemovedCallback); queryRef.off('child_changed', queryState.childChangedCallback); queryRef.off('value', queryState.valueCallback); }; /** * Callback for child added events. * * @param locationDataSnapshot A snapshot of the data stored for this location. */ GeoQuery.prototype._childAddedCallback = function (locationDataSnapshot) { this._updateLocation(geoFireGetKey(locationDataSnapshot), decodeGeoFireObject(locationDataSnapshot.val())); }; /** * Callback for child changed events * * @param locationDataSnapshot A snapshot of the data stored for this location. */ GeoQuery.prototype._childChangedCallback = function (locationDataSnapshot) { this._updateLocation(geoFireGetKey(locationDataSnapshot), decodeGeoFireObject(locationDataSnapshot.val())); }; /** * Callback for child removed events * * @param locationDataSnapshot A snapshot of the data stored for this location. */ GeoQuery.prototype._childRemovedCallback = function (locationDataSnapshot) { var _this = this; var key = geoFireGetKey(locationDataSnapshot); if (key in this._locationsTracked) { this._firebaseRef.child(key).once('value', function (snapshot) { var location = (snapshot.val() === null) ? null : decodeGeoFireObject(snapshot.val()); var geohash = (location !== null) ? encodeGeohash(location) : null; // Only notify observers if key is not part of any other geohash query or this actually might not be // a key exited event, but a key moved or entered event. These events will be triggered by updates // to a different query if (!_this._geohashInSomeQuery(geohash)) { _this._removeLocation(key, location); } }); } }; /** * Removes unnecessary Firebase queries which are currently being queried. */ GeoQuery.prototype._cleanUpCurrentGeohashesQueried = function () { var _this = this; var keys = Object.keys(this._currentGeohashesQueried); keys.forEach(function (geohashQueryStr) { var queryState = _this._currentGeohashesQueried[geohashQueryStr]; if (queryState.active === false) { var query = _this._stringToQuery(geohashQueryStr); // Delete the geohash since it should no longer be queried _this._cancelGeohashQuery(query, queryState); delete _this._currentGeohashesQueried[geohashQueryStr]; } }); // Delete each location which should no longer be queried keys = Object.keys(this._locationsTracked); keys.forEach(function (key) { if (!_this._geohashInSomeQuery(_this._locationsTracked[key].geohash)) { if (_this._locationsTracked[key].isInQuery) { throw new Error('Internal State error, trying to remove location that is still in query'); } delete _this._locationsTracked[key]; } }); // Specify that this is done cleaning up the current geohashes queried this._geohashCleanupScheduled = false; // Cancel any outstanding scheduled cleanup if (this._cleanUpCurrentGeohashesQueriedTimeout !== null) { clearTimeout(this._cleanUpCurrentGeohashesQueriedTimeout); this._cleanUpCurrentGeohashesQueriedTimeout = null; } }; /** * Fires each callback for the provided eventType, passing it provided key's data. * * @param eventType The event type whose callbacks to fire. One of 'key_entered', 'key_exited', or 'key_moved'. * @param key The key of the location for which to fire the callbacks. * @param location The location as [latitude, longitude] pair * @param distanceFromCenter The distance from the center or null. */ GeoQuery.prototype._fireCallbacksForKey = function (eventType, key, location, distanceFromCenter) { this._callbacks[eventType].forEach(function (callback) { if (typeof location === 'undefined' || location === null) { callback(key, null, null); } else { callback(key, location, distanceFromCenter); } }); }; /** * Fires each callback for the 'ready' event. */ GeoQuery.prototype._fireReadyEventCallbacks = function () { this._callbacks.ready.forEach(function (callback) { callback(); }); }; /** * Checks if this geohash is currently part of any of the geohash queries. * * @param geohash The geohash. * @returns Returns true if the geohash is part of any of the current geohash queries. */ GeoQuery.prototype._geohashInSomeQuery = function (geohash) { var keys = Object.keys(this._currentGeohashesQueried); for (var _i = 0, keys_2 = keys; _i < keys_2.length; _i++) { var queryStr = keys_2[_i]; if (queryStr in this._currentGeohashesQueried) { var query = this._stringToQuery(queryStr); if (geohash >= query[0] && geohash <= query[1]) { return true; } } } return false; }; /** * Called once all geohash queries have received all child added events and fires the ready * event if necessary. */ GeoQuery.prototype._geohashQueryReadyCallback = function (queryStr) { var index = this._outstandingGeohashReadyEvents.indexOf(queryStr); if (index > -1) { this._outstandingGeohashReadyEvents.splice(index, 1); } this._valueEventFired = (this._outstandingGeohashReadyEvents.length === 0); // If all queries have been processed, fire the ready event if (this._valueEventFired) { this._fireReadyEventCallbacks(); } }; /** * Attaches listeners to Firebase which track when new geohashes are added within this query's * bounding box. */ GeoQuery.prototype._listenForNewGeohashes = function () { var _this = this; // Get the list of geohashes to query var geohashesToQuery = geohashQueries(this._center, this._radius * 1000).map(this._queryToString); // Filter out duplicate geohashes geohashesToQuery = geohashesToQuery.filter(function (geohash, i) { return geohashesToQuery.indexOf(geohash) === i; }); // For all of the geohashes that we are already currently querying, check if they are still // supposed to be queried. If so, don't re-query them. Otherwise, mark them to be un-queried // next time we clean up the current geohashes queried dictionary. var keys = Object.keys(this._currentGeohashesQueried); keys.forEach(function (geohashQueryStr) { var index = geohashesToQuery.indexOf(geohashQueryStr); if (index === -1) { _this._currentGeohashesQueried[geohashQueryStr].active = false; } else { _this._currentGeohashesQueried[geohashQueryStr].active = true; geohashesToQuery.splice(index, 1); } }); // If we are not already cleaning up the current geohashes queried and we have more than 25 of them, // kick off a timeout to clean them up so we don't create an infinite number of unneeded queries. if (this._geohashCleanupScheduled === false && Object.keys(this._currentGeohashesQueried).length > 25) { this._geohashCleanupScheduled = true; this._cleanUpCurrentGeohashesQueriedTimeout = setTimeout(this._cleanUpCurrentGeohashesQueried, 10); } // Keep track of which geohashes have been processed so we know when to fire the 'ready' event this._outstandingGeohashReadyEvents = geohashesToQuery.slice(); // Loop through each geohash to query for and listen for new geohashes which have the same prefix. // For every match, attach a value callback which will fire the appropriate events. // Once every geohash to query is processed, fire the 'ready' event. geohashesToQuery.forEach(function (toQueryStr) { // decode the geohash query string var query = _this._stringToQuery(toQueryStr); // Create the Firebase query var firebaseQuery = _this._firebaseRef.orderByChild('g').startAt(query[0]).endAt(query[1]); // For every new matching geohash, determine if we should fire the 'key_entered' event var childAddedCallback = firebaseQuery.on('child_added', function (a) { return _this._childAddedCallback(a); }); var childRemovedCallback = firebaseQuery.on('child_removed', function (a) { return _this._childRemovedCallback(a); }); var childChangedCallback = firebaseQuery.on('child_changed', function (a) { return _this._childChangedCallback(a); }); // Once the current geohash to query is processed, see if it is the last one to be processed // and, if so, mark the value event as fired. // Note that Firebase fires the 'value' event after every 'child_added' event fires. var valueCallback = firebaseQuery.on('value', function () { firebaseQuery.off('value', valueCallback); _this._geohashQueryReadyCallback(toQueryStr); }); // Add the geohash query to the current geohashes queried dictionary and save its state _this._currentGeohashesQueried[toQueryStr] = { active: true, childAddedCallback: childAddedCallback, childRemovedCallback: childRemovedCallback, childChangedCallback: childChangedCallback, valueCallback: valueCallback }; }); // Based upon the algorithm to calculate geohashes, it's possible that no 'new' // geohashes were queried even if the client updates the radius of the query. // This results in no 'READY' event being fired after the .updateCriteria() call. // Check to see if this is the case, and trigger the 'READY' event. if (geohashesToQuery.length === 0) { this._geohashQueryReadyCallback(); } }; /** * Encodes a query as a string for easier indexing and equality. * * @param query The query to encode. * @returns The encoded query as string. */ GeoQuery.prototype._queryToString = function (query) { if (query.length !== 2) { throw new Error('Not a valid geohash query: ' + query); } return query[0] + ':' + query[1]; }; /** * Removes the location from the local state and fires any events if necessary. * * @param key The key to be removed. * @param currentLocation The current location as [latitude, longitude] pair or null if removed. */ GeoQuery.prototype._removeLocation = function (key, currentLocation) { var locationDict = this._locationsTracked[key]; delete this._locationsTracked[key]; if (typeof locationDict !== 'undefined' && locationDict.isInQuery) { var distanceFromCenter = (currentLocation) ? distance(currentLocation, this._center) : null; this._fireCallbacksForKey('key_exited', key, currentLocation, distanceFromCenter); } }; /** * Decodes a query string to a query * * @param str The encoded query. * @returns The decoded query as a [start, end] pair. */ GeoQuery.prototype._stringToQuery = function (str) { var decoded = str.split(':'); if (decoded.length !== 2) { throw new Error('Invalid internal state! Not a valid geohash query: ' + str); } return decoded; }; /** * Callback for any updates to locations. Will update the information about a key and fire any necessary * events every time the key's location changes. * * When a key is removed from GeoFire or the query, this function will be called with null and performs * any necessary cleanup. * * @param key The key of the geofire location. * @param location The location as [latitude, longitude] pair. */ GeoQuery.prototype._updateLocation = function (key, location) { validateLocation(location); // Get the key and location var distanceFromCenter, isInQuery; var wasInQuery = (key in this._locationsTracked) ? this._locationsTracked[key].isInQuery : false; var oldLocation = (key in this._locationsTracked) ? this._locationsTracked[key].location : null; // Determine if the location is within this query distanceFromCenter = distance(location, this._center); isInQuery = (distanceFromCenter <= this._radius); // Add this location to the locations queried dictionary even if it is not within this query this._locationsTracked[key] = { location: location, distanceFromCenter: distanceFromCenter, isInQuery: isInQuery, geohash: encodeGeohash(location) }; // Fire the 'key_entered' event if the provided key has entered this query if (isInQuery && !wasInQuery) { this._fireCallbacksForKey('key_entered', key, location, distanceFromCenter); } else if (isInQuery && oldLocation !== null && (location[0] !== oldLocation[0] || location[1] !== oldLocation[1])) { this._fireCallbacksForKey('key_moved', key, location, distanceFromCenter); } else if (!isInQuery && wasInQuery) { this._fireCallbacksForKey('key_exited', key, location, distanceFromCenter); } }; return GeoQuery; }()); /*! * GeoFire is an open-source library that allows you to store and query a set * of keys based on their geographic location. At its heart, GeoFire simply * stores locations with string keys. Its main benefit, however, is the * possibility of retrieving only those keys within a given geographic area - * all in realtime. * * GeoFire 0.0.0 * https://github.com/firebase/geofire-js/ * License: MIT */ /** * Creates a GeoFire instance. */ var GeoFire = /** @class */ (function () { /** * @param _firebaseRef A Firebase reference where the GeoFire data will be stored. */ function GeoFire(_firebaseRef) { this._firebaseRef = _firebaseRef; if (Object.prototype.toString.call(this._firebaseRef) !== '[object Object]') { throw new Error('firebaseRef must be an instance of Firebase'); } } /********************/ /* PUBLIC METHODS */ /********************/ /** * Returns a promise fulfilled with the location corresponding to the provided key. * * If the provided key does not exist, the returned promise is fulfilled with null. * * @param key The key of the location to retrieve. * @returns A promise that is fulfilled with the location of the given key. */ GeoFire.prototype.get = function (key) { validateKey(key); return this._firebaseRef.child(key).once('value').then(function (dataSnapshot) { var snapshotVal = dataSnapshot.val(); if (snapshotVal === null) { return null; } else { return decodeGeoFireObject(snapshotVal); } }); }; /** * Returns the Firebase instance used to create this GeoFire instance. * * @returns The Firebase instance used to create this GeoFire instance. */ GeoFire.prototype.ref = function () { return this._firebaseRef; }; /** * Removes the provided key from this GeoFire. Returns an empty promise fulfilled when the key has been removed. * * If the provided key is not in this GeoFire, the promise will still successfully resolve. * * @param key The key of the location to remove. * @returns A promise that is fulfilled after the inputted key is removed. */ GeoFire.prototype.remove = function (key) { return this.set(key, null); }; /** * Adds the provided key - location pair(s) to Firebase. Returns an empty promise which is fulfilled when the write is complete. * * If any provided key already exists in this GeoFire, it will be overwritten with the new location value. * * @param keyOrLocations The key representing the location to add or a mapping of key - location pairs which * represent the locations to add. * @param location The [latitude, longitude] pair to add. * @returns A promise that is fulfilled when the write is complete. */ GeoFire.prototype.set = function (keyOrLocations, location) { var locations; if (typeof keyOrLocations === 'string' && keyOrLocations.length !== 0) { // If this is a set for a single location, convert it into a object locations = {}; locations[keyOrLocations] = location; } else if (typeof keyOrLocations === 'object') { if (typeof location !== 'undefined') { throw new Error('The location argument should not be used if you pass an object to set().'); } locations = keyOrLocations; } else { throw new Error('keyOrLocations must be a string or a mapping of key - location pairs.'); } var newData = {}; Object.keys(locations).forEach(function (key) { validateKey(key); var location = locations[key]; if (location === null) { // Setting location to null is valid since it will remove the key newData[key] = null; } else { validateLocation(location); var geohash = encodeGeohash(location); newData[key] = encodeGeoFireObject(location, geohash); } }); return this._firebaseRef.update(newData); }; /** * Returns a new GeoQuery instance with the provided queryCriteria. * * @param queryCriteria The criteria which specifies the GeoQuery's center and radius. * @return A new GeoQuery object. */ GeoFire.prototype.query = function (queryCriteria) { return new GeoQuery(this._firebaseRef, queryCriteria); }; /********************/ /* STATIC METHODS */ /********************/ /** * Static method which calculates the distance, in kilometers, between two locations, * via the Haversine formula. Note that this is approximate due to the fact that the * Earth's radius varies between 6356.752 km and 6378.137 km. * * @param location1 The [latitude, longitude] pair of the first location. * @param location2 The [latitude, longitude] pair of the second location. * @returns The distance, in kilometers, between the inputted locations. */ GeoFire.distance = function (location1, location2) { return distance(location1, location2); }; return GeoFire; }()); export { GeoCallbackRegistration, GeoFire, GeoQuery };
/* * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * External dependencies */ import PropTypes from 'prop-types'; /** * WordPress dependencies */ import { __ } from '@wordpress/i18n'; /** * Internal dependencies */ import { Row } from '../form'; import { Note, ExpandedTextInput } from './shared'; import { SimplePanel } from './panel'; import { getCommonValue, useCommonObjectValue } from './utils'; const DEFAULT_RESOURCE = { alt: null }; const MIN_MAX = { ALT_TEXT: { MAX: 1000, }, }; function ImageAccessibilityPanel({ selectedElements, pushUpdate }) { const resource = useCommonObjectValue( selectedElements, 'resource', DEFAULT_RESOURCE ); const alt = getCommonValue(selectedElements, 'alt', resource.alt); return ( <SimplePanel name="imageAccessibility" title={__('Accessibility', 'web-stories')} > <Row> <ExpandedTextInput placeholder={__('Assistive text', 'web-stories')} value={alt || ''} onChange={(value) => pushUpdate({ alt: value || null })} clear aria-label={__('Edit: Assistive text', 'web-stories')} maxLength={MIN_MAX.ALT_TEXT.MAX} /> </Row> <Row> <Note>{__('Text for visually impaired users.', 'web-stories')}</Note> </Row> </SimplePanel> ); } ImageAccessibilityPanel.propTypes = { selectedElements: PropTypes.array.isRequired, pushUpdate: PropTypes.func.isRequired, }; export default ImageAccessibilityPanel;
import React from 'react'; import Switch from '@material-ui/core/Switch'; class Switches extends React.Component { state = { checkedA: true, checkedB: true, }; handleChange = name => event => { this.setState({ [name]: event.target.checked }); }; render() { return ( <div> <Switch checked={this.state.checkedA} onChange={this.handleChange('checkedA')} value="checkedA" /> <Switch checked={this.state.checkedB} onChange={this.handleChange('checkedB')} value="checkedB" color="primary" /> <Switch value="checkedC" /> <Switch disabled value="checkedD" /> <Switch disabled checked value="checkedE" /> <Switch defaultChecked value="checkedF" color="default" /> </div> ); } } export default Switches;
import React from 'react' import { makeStyles } from '@krowdy-ui/styles' import { Paper, Grid } from '@krowdy-ui/core' const useStyles = makeStyles(theme => ({ paper: { color : theme.palette.text.secondary, padding : theme.spacing(1), textAlign: 'center' }, root: { flexGrow: 1 } })) export default function NestedGrid() { const classes = useStyles() function FormRow() { return ( <React.Fragment> <Grid item xs={4}> <Paper className={classes.paper}>item</Paper> </Grid> <Grid item xs={4}> <Paper className={classes.paper}>item</Paper> </Grid> <Grid item xs={4}> <Paper className={classes.paper}>item</Paper> </Grid> </React.Fragment> ) } return ( <div className={classes.root}> <Grid container spacing={1}> <Grid container item spacing={3} xs={12}> <FormRow /> </Grid> <Grid container item spacing={3} xs={12}> <FormRow /> </Grid> <Grid container item spacing={3} xs={12}> <FormRow /> </Grid> </Grid> </div> ) }
import { installToast } from '@back/toast' import { isFirefox } from '@vue-devtools/shared-utils' window.addEventListener('message', e => { if (e.source === window && e.data.vueDetected) { chrome.runtime.sendMessage(e.data) } }) function detect (win) { let delay = 1000 let detectRemainingTries = 10 function runDetect () { // Method 1: Check Nuxt.js const nuxtDetected = !!(window.__NUXT__ || window.$nuxt) if (nuxtDetected) { let Vue if (window.$nuxt) { Vue = window.$nuxt.$root && window.$nuxt.$root.constructor } win.postMessage({ devtoolsEnabled: (/* Vue 2 */ Vue && Vue.config.devtools) || (/* Vue 3.2.14+ */ window.__VUE_DEVTOOLS_GLOBAL_HOOK__ && window.__VUE_DEVTOOLS_GLOBAL_HOOK__.enabled), vueDetected: true, nuxtDetected: true, }, '*') return } // Method 2: Check Vue 3 const vueDetected = !!(window.__VUE__) if (vueDetected) { win.postMessage({ devtoolsEnabled: /* Vue 3.2.14+ */ window.__VUE_DEVTOOLS_GLOBAL_HOOK__ && window.__VUE_DEVTOOLS_GLOBAL_HOOK__.enabled, vueDetected: true, }, '*') return } // Method 3: Scan all elements inside document const all = document.querySelectorAll('*') let el for (let i = 0; i < all.length; i++) { if (all[i].__vue__) { el = all[i] break } } if (el) { let Vue = Object.getPrototypeOf(el.__vue__).constructor while (Vue.super) { Vue = Vue.super } win.postMessage({ devtoolsEnabled: Vue.config.devtools, vueDetected: true, }, '*') return } if (detectRemainingTries > 0) { detectRemainingTries-- setTimeout(() => { runDetect() }, delay) delay *= 5 } } setTimeout(() => { runDetect() }, 100) } // inject the hook if (document instanceof HTMLDocument) { installScript(detect) installScript(installToast) } function installScript (fn) { const source = ';(' + fn.toString() + ')(window)' if (isFirefox) { // eslint-disable-next-line no-eval window.eval(source) // in Firefox, this evaluates on the content window } else { const script = document.createElement('script') script.textContent = source document.documentElement.appendChild(script) script.parentNode.removeChild(script) } }
import React, {Component} from 'react'; import {Text} from 'react-native'; import ToastExample from "../ToastModule/ToastExample"; export default class ToastScreen extends Component{ static navigationOptions = { headerTitle:"toast",//标题 }; render(){ return( <Text onPress={()=>{ // ToastExample.show("asdasd",ToastExample.SHORT) ToastExample.show("asdasd",ToastExample.SHORT, (errorMsg)=>{ console.log(errorMsg); }, (msg)=>{ console.log(msg); }) }}>页面A</Text> ); } }
/** * Copyright 2012-2018, Plotly, Inc. * All rights reserved. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ 'use strict'; var scatterAttrs = require('../scatter/attributes'); var plotAttrs = require('../../plots/attributes'); var colorAttributes = require('../../components/colorscale/color_attributes'); var colorbarAttrs = require('../../components/colorbar/attributes'); var extendFlat = require('../../lib/extend').extendFlat; var scatterMarkerAttrs = scatterAttrs.marker, scatterLineAttrs = scatterAttrs.line, scatterMarkerLineAttrs = scatterMarkerAttrs.line; module.exports = { carpet: { valType: 'string', role: 'info', description: [ 'An identifier for this carpet, so that `scattercarpet` and', '`scattercontour` traces can specify a carpet plot on which', 'they lie' ].join(' ') }, a: { valType: 'data_array', description: [ 'Sets the quantity of component `a` in each data point.', 'If `a`, `b`, and `c` are all provided, they need not be', 'normalized, only the relative values matter. If only two', 'arrays are provided they must be normalized to match', '`ternary<i>.sum`.' ].join(' ') }, b: { valType: 'data_array', description: [ 'Sets the quantity of component `a` in each data point.', 'If `a`, `b`, and `c` are all provided, they need not be', 'normalized, only the relative values matter. If only two', 'arrays are provided they must be normalized to match', '`ternary<i>.sum`.' ].join(' ') }, sum: { valType: 'number', role: 'info', dflt: 0, min: 0, description: [ 'The number each triplet should sum to,', 'if only two of `a`, `b`, and `c` are provided.', 'This overrides `ternary<i>.sum` to normalize this specific', 'trace, but does not affect the values displayed on the axes.', '0 (or missing) means to use ternary<i>.sum' ].join(' ') }, mode: extendFlat({}, scatterAttrs.mode, {dflt: 'markers'}), text: extendFlat({}, scatterAttrs.text, { description: [ 'Sets text elements associated with each (a,b,c) point.', 'If a single string, the same string appears over', 'all the data points.', 'If an array of strings, the items are mapped in order to the', 'the data points in (a,b,c).' ].join(' ') }), line: { color: scatterLineAttrs.color, width: scatterLineAttrs.width, dash: scatterLineAttrs.dash, shape: extendFlat({}, scatterLineAttrs.shape, {values: ['linear', 'spline']}), smoothing: scatterLineAttrs.smoothing }, connectgaps: scatterAttrs.connectgaps, fill: extendFlat({}, scatterAttrs.fill, { values: ['none', 'toself', 'tonext'], description: [ 'Sets the area to fill with a solid color.', 'Use with `fillcolor` if not *none*.', 'scatterternary has a subset of the options available to scatter.', '*toself* connects the endpoints of the trace (or each segment', 'of the trace if it has gaps) into a closed shape.', '*tonext* fills the space between two traces if one completely', 'encloses the other (eg consecutive contour lines), and behaves like', '*toself* if there is no trace before it. *tonext* should not be', 'used if one trace does not enclose the other.' ].join(' ') }), fillcolor: scatterAttrs.fillcolor, marker: extendFlat({}, { symbol: scatterMarkerAttrs.symbol, opacity: scatterMarkerAttrs.opacity, maxdisplayed: scatterMarkerAttrs.maxdisplayed, size: scatterMarkerAttrs.size, sizeref: scatterMarkerAttrs.sizeref, sizemin: scatterMarkerAttrs.sizemin, sizemode: scatterMarkerAttrs.sizemode, line: extendFlat({}, {width: scatterMarkerLineAttrs.width}, colorAttributes('marker'.line) ), gradient: scatterMarkerAttrs.gradient }, colorAttributes('marker'), { showscale: scatterMarkerAttrs.showscale, colorbar: colorbarAttrs }), textfont: scatterAttrs.textfont, textposition: scatterAttrs.textposition, hoverinfo: extendFlat({}, plotAttrs.hoverinfo, { flags: ['a', 'b', 'text', 'name'] }), hoveron: scatterAttrs.hoveron, };
import mongoose from 'mongoose' const rangeSchema = new mongoose.Schema({ name: { type: String, required: true }, value: { type: Number, required: true }, earnedDate: { type: Date, required: false } }) const ratingSchema = new mongoose.Schema({ name: { type: String, required: true }, xp: { type: Number, required: true }, ranges: [ { type: rangeSchema, require: true } ] }) const achievementSchema = new mongoose.Schema({ name: { type: String, required: true }, kind: { type: String, required: true }, user: { type: mongoose.Schema.Types.ObjectId, ref: 'User', required: true }, total: { type: Number, require: true }, ratings: [ { type: ratingSchema, require: true } ] }) export default mongoose.model('Achievement', achievementSchema)
// TODO : to css then injection module.exports = function(src, module, makeModule, options) { throw new Error("stylus parser not implemented yet") }
$(function() { $(".btn-login").on("click", function() { doLoginMobile(); }); $(".section-login-user-email, .section-login-password").on("keypress", function(e) { if (e.which == 13) { doLoginMobile(); } }); }); function doLoginMobile() { $(".error").html(""); var user_email = $(".section-login-user-email").val().trim(); var password = $(".section-login-password").val().trim(); var valid = true; if (user_email == "") { valid = false; $(".error-username").html("Username harus diisi"); } if (password == "") { valid = false; $(".error-password").html("Password harus diisi"); } if (valid) { $(".loading-div").addClass("shown"); var data = { user_email: user_email, password: password }; ajaxCall(doLoginUrl, data, function(json) { var result = jQuery.parseJSON(json); if (result.status == "error") { $(".loading-div").removeClass("shown"); $(".error-password").html(result.reason); } else if (result.status == "success") { window.location = dashboardUrl; } }); } }
/** Dependencies */ import './fake-media-provider/define.js'; import '../container/define.js'; import '../controller/define.js'; import { fixture } from '@open-wc/testing'; import { html } from 'lit'; import { MEDIA_CONTAINER_ELEMENT_TAG_NAME, MediaContainerElement } from '../container/index.js'; import { MediaControllerElement } from '../controller/index.js'; import { FAKE_MEDIA_PROVIDER_ELEMENT_TAG_NAME, FakeMediaProviderElement } from './fake-media-provider/index.js'; /** * @typedef {{ * controller: MediaControllerElement; * container: MediaContainerElement; * provider: FakeMediaProviderElement; * }} MediaFixture */ /** * @param {import('lit').TemplateResult} [uiSlot] * @param {import('lit').TemplateResult} [mediaSlot] * @returns {Promise<MediaFixture>} */ export async function buildMediaFixture(uiSlot = html``, mediaSlot = html``) { /** @type {MediaControllerElement} */ const controller = await fixture( html` <vds-media-controller> <vds-media-container> <vds-fake-media-provider>${mediaSlot}</vds-fake-media-provider> ${uiSlot} </vds-media-container> </vds-media-controller> ` ); const container = /** @type {MediaContainerElement} */ ( controller.querySelector(MEDIA_CONTAINER_ELEMENT_TAG_NAME) ); const provider = /** @type {FakeMediaProviderElement} */ ( controller.querySelector(FAKE_MEDIA_PROVIDER_ELEMENT_TAG_NAME) ); return { controller, container, provider }; }
'use strict'; module.exports = function(a, b) { a = String(a); b = String(b); return a.substr(a.length - b.length) === b; };
var chalk = require('chalk'); // var wordlist = require('./wordlist.js'); var fs = require('fs'); var exec = require('child_process').exec; var frontLongSpace = ' ' ; var frontMiddleSpace = ' ' ; var frontShortSpace = ' ' ; function Output() { this.outputAttention = function(str) { formatLineLog(str); } this.longFrontSpaceLog = function(str){ frontLongSpaceLog(str); } this.outputBaiduWordCard = function(wordInfo,read) { frontShortSpacelog('翻译:'); if (wordInfo.hasOwnProperty('trans_result')){ var transResult = wordInfo.trans_result; transResult.forEach(function(element){ if (element.hasOwnProperty('dst')){ frontShortSpacelog(element.dst); } },this); } } this.outputYoudaoWordCard =function(wordInfo,read) { if (wordInfo.query.length > 18) { frontShortSpacelog('翻译:'); frontShortSpacelog(wordInfo.translation); return; } console.log(frontLongSpace+chalk.bgMagenta(wordInfo.query)+':'+ chalk.magenta(wordInfo.translation)+'\n'); if (read) { var cmdStr1 = 'say' + ' ' + wordInfo.query; var cmdStr2 = 'say' + ' ' + wordInfo.translation; exec(cmdStr1+';'+cmdStr2); } if (wordInfo.hasOwnProperty('basic') && wordInfo.basic.hasOwnProperty('explains')){ var explains = wordInfo.basic.explains; var explainsStr = ""; explains.forEach(function(element){ frontMiddleSpacelog(element); },this); console.log(''); } if (wordInfo.hasOwnProperty('web')) { var webInfo = wordInfo.web; for (var key in webInfo) { if (webInfo.hasOwnProperty(key)) { var element = webInfo[key]; console.log(frontMiddleSpace+'关键词:'+chalk.red(element.key)); element.value.forEach(function(element) { console.log(frontLongSpace+element+''); }, this); } } } } this.outputGoogleWordCard = function(wordInfo,read) { var originWord = wordInfo[0][0][1]; var translatedWord = wordInfo[0][0][0]; if (originWord.length > 18) {//如果长度超过18就简洁展示 frontShortSpacelog('翻译:'); frontShortSpacelog(translatedWord); } else { console.log(frontLongSpace+chalk.bgMagenta(originWord)+':'+ chalk.magenta(translatedWord)+'\n'); if (read) { var cmdStr1 = 'say' + ' ' + originWord; var cmdStr2 = 'say' + ' ' + translatedWord; exec(cmdStr1+';'+cmdStr2); } } for(i=0;wordInfo[1] && i<wordInfo[1].length;i++) { console.log(frontMiddleSpace + wordInfo[1][i][0] + ': ' + wordInfo[1][i][1]); } } var frontLongSpaceLog = function(str) { console.log(frontLongSpace+str); } var frontMiddleSpacelog = function(str) { console.log(frontMiddleSpace+str); } var frontShortSpacelog = function(str) { console.log(frontShortSpace+str); } var formatLineLog = function(str) { var length = 49; if (str.length > length) { console.log('\n==='+str+'===\n'); } else { var num = (length-str.length * 2) * 0.5 var formatStr=''; for (var i=0;i<num;i++) { formatStr = formatStr + '='; } console.log('\n'+formatStr+str+formatStr+'\n'); } } } var exports = new Output(); module.exports = exports;
import express from 'express'; import mongodb from 'mongodb'; const router = express.Router(); const url = 'mongodbdb://localhost:27017/tickethub'; // TODO: Add to frontend // router.get('/account',function (req, res, next) { // res.render('account', {name : req.session.name, username : req.session.username, email : req.session.email, success : req.session.success,}) // }) // TODO: Move to it's own account routes file router.post('/account/submit', (req, res, next) => { const item = { name: req.body.name, email: req.body.email, password: req.body.password, }; req.session.name = item.name; req.session.email = item.email; req.session.password = item.password; console.log(item); mongodb.connect( url, (err, db) => { const dbo = db.db('tickethub'); dbo .collection('user-data') .updateOne( { username: req.session.username }, { $set: item }, (dbErr, result) => { if (dbErr) throw dbErr; console.log('Item updated'); db.close(); } ); } ); res.redirect('/account'); }); // TODO: Move to other route file router.get('/logout', (req, res, next) => { req.session.destroy(); res.redirect('login'); }); export default router;
// @flow import * as React from 'react'; import { View, ActivityIndicator, Text, StyleSheet, ScrollView, } from 'react-native'; import Animated from 'react-native-reanimated'; import Icon from 'react-native-vector-icons/FontAwesome'; import type { LoadingStatus } from 'lib/types/loading-types'; import Button from '../components/button.react'; import { useSelector } from '../redux/redux-utils'; import type { ViewStyle } from '../types/styles'; type ButtonProps = {| +text: string, +loadingStatus: LoadingStatus, +onSubmit: () => void, |}; function PanelButton(props: ButtonProps) { let buttonIcon; if (props.loadingStatus === 'loading') { buttonIcon = ( <View style={styles.loadingIndicatorContainer}> <ActivityIndicator color="#555" /> </View> ); } else { buttonIcon = ( <View style={styles.submitContentIconContainer}> <Icon name="arrow-right" size={16} color="#555" /> </View> ); } return ( <View style={styles.submitButtonHorizontalContainer}> <View style={styles.submitButtonVerticalContainer}> <Button onPress={props.onSubmit} disabled={props.loadingStatus === 'loading'} topStyle={styles.submitButton} style={styles.innerSubmitButton} iosFormat="highlight" iosActiveOpacity={0.85} iosHighlightUnderlayColor="#A0A0A0DD" > <Text style={styles.submitContentText}>{props.text}</Text> {buttonIcon} </Button> </View> </View> ); } type PanelProps = {| +opacityValue: Animated.Value, +children: React.Node, +style?: ViewStyle, |}; function Panel(props: PanelProps): React.Node { const dimensions = useSelector((state) => state.dimensions); const containerStyle = React.useMemo( () => [ styles.container, { opacity: props.opacityValue, marginTop: dimensions.height < 641 ? 15 : 40, }, props.style, ], [props.opacityValue, props.style, dimensions.height], ); return ( <ScrollView bounces={false} keyboardShouldPersistTaps="handled"> <Animated.View style={containerStyle}>{props.children}</Animated.View> </ScrollView> ); } const styles = StyleSheet.create({ container: { backgroundColor: '#FFFFFFAA', borderRadius: 6, marginLeft: 20, marginRight: 20, paddingTop: 6, }, innerSubmitButton: { alignItems: 'flex-end', flexDirection: 'row', paddingVertical: 6, }, loadingIndicatorContainer: { paddingBottom: 2, width: 14, }, submitButton: { borderBottomRightRadius: 6, justifyContent: 'center', paddingLeft: 10, paddingRight: 18, }, submitButtonHorizontalContainer: { alignSelf: 'flex-end', }, submitButtonVerticalContainer: { flexGrow: 1, justifyContent: 'center', }, submitContentIconContainer: { paddingBottom: 5, width: 14, }, submitContentText: { color: '#555', fontFamily: 'OpenSans-Semibold', fontSize: 18, paddingRight: 7, }, }); export { PanelButton, Panel };
const Err = require("../constant/Error"); const {executeMethod} = require("./SpotifyApiWrapper"); class SpotifyService { /** * Constructor for spotifyService class * Default mood is happiness * * addRecentlyPlayedTracks() - 50 * addTopTracks() - 100 * addSavedTracks() - 150 * addTopArtistTracks() - 200 * addSeedTracks() - 100 * addUserPlaylistsTracks - 100 * addAllTracksToHashMap() * getAllAudioFeatures() - adds all tracks to hashmap and gets all the audio features * * @param spotifyApi - current instance of spotifyApi */ constructor(spotifyApi) { this.spotifyApi = spotifyApi; this.trackHashMap = new Map(); this.mood = "happiness"; } /** * Sample function used to test validity of credentials * @returns {Promise<T|*|undefined>} */ sampleFunction() { return executeMethod( () => { return this.spotifyApi.getArtistAlbums("43ZHCT0cAZBISjO8DG9PnE"); }); } /** * Adds all recently played, top, saved, seed, top artist, and user playlists tracks to map * @returns boolean - true upon successful addition */ addAllTracksToHashMap() { const promises = []; promises.push(this.addRecentlyPlayedTracks()); promises.push(this.addTopTracks()); promises.push(this.addSavedTracks()); promises.push(this.addSeedTracks()); promises.push(this.addTopArtistsTracks()); promises.push(this.addUserPlaylistsTracks()); return Promise.all(promises) .then(() => { console.log("SUCCESS - added all " + this.trackHashMap.size + " tracks to hashmap"); return true; }) .catch((err) => { console.log(err); throw err; }); } /** * Adds current set of tracks to hashmap * @param tracks - current set of tracks */ addTracksToHashMap(tracks) { if (!tracks || tracks.length === 0 || !Array.isArray(tracks)) { console.log("tracks is empty or null"); return; } for (const track of tracks) { this.trackHashMap.set(track["id"], track); } } /** * Determines if response body items is valid * @param res - response body * @returns boolean - returns true if response, body, and items are all not null/undefined */ isResponseBodyItemsValid(res) { return res && res.body && res.body.items; } /** * Determines if response body tracks is valid * @param res - response body * @returns boolean - returns true if response, body, and tracks are all not null/undefined */ isResponseBodyTracksValid(res) { return res && res.body && res.body.tracks; } /** * Adds recently played tracks * If song X was listened to 10 times, it will return the song 10 times in the array * @returns boolean - true if tracks were successfully added */ addRecentlyPlayedTracks() { return executeMethod( () => { return this.spotifyApi.getMyRecentlyPlayedTracks({limit: 50}); }) .then((res) => { if (!this.isResponseBodyItemsValid(res)) return false; const tracks = []; for (const item of res.body.items) { if (item && item.track) { tracks.push(item.track); } } this.addTracksToHashMap(tracks); return true; }) .catch((err) => { console.log(err); throw err; }); } /** * Adds top tracks * @returns boolean - true if tracks were successfully added */ addTopTracks() { const options = [{limit: 50}, {limit: 50, offset: 49}]; const promises = []; for (const option of options) { promises.push(executeMethod( () => { return this.spotifyApi.getMyTopTracks(option); }, )); } return Promise.all(promises) .then((topTracksArray) => { if (!topTracksArray) return false; for (const topTracks of topTracksArray) { if (!this.isResponseBodyItemsValid(topTracks)) return false; this.addTracksToHashMap(topTracks.body.items); } return true; }) .catch((err) => { console.log(err); throw err; }); } /** * Adds saved tracks * @returns boolean - true if tracks were successfully added */ addSavedTracks() { const options = [{limit: 50}, {limit: 50, offset: 50}, {limit: 50, offset: 100}]; const promises = []; for (const option of options) { promises.push(executeMethod( () => { return this.spotifyApi.getMySavedTracks(option); }, )); } return Promise.all(promises) .then((savedTracksArray) => { if (!savedTracksArray) return false; for (const savedTracks of savedTracksArray) { if (!this.isResponseBodyItemsValid(savedTracks)) return false; const tracks = []; for (const item of savedTracks.body.items) { if (item && item.track) { tracks.push(item.track); } } this.addTracksToHashMap(tracks); } return true; }).catch((err) => { console.log(err); throw err; }); } /** * Adds top artists tracks * @returns boolean - true if tracks were successfully added */ addTopArtistsTracks() { return executeMethod( () => { return this.spotifyApi.getMyTopArtists({limit: 20, time_range: "long_term"}); }, ) .then((res) => { const promises = []; if (!this.isResponseBodyItemsValid(res)) return false; for (const item of res.body.items) { if (item && item.id) promises.push(this.addArtistTopTracks(item)); } return Promise.all(promises); }).then(() => { return true; }) .catch((err) => { console.log(err); throw err; }); // adding similar artists and their top tracks // }).then((res) => { // promises = []; // for (let topArtist of topArtists) { // promises.push(this.addSimilarArtistsTopTracks(topArtists[0])); // } // return Promise.all(promises); } /** * Adds artist top tracks * Currently using US for country code * @returns boolean - true if tracks were successfully added */ addArtistTopTracks(artist) { return executeMethod( () => { return this.spotifyApi.getArtistTopTracks(artist.id, "US"); }) .then((res) => { // MAX returns 10 tracks if (this.isResponseBodyTracksValid(res)) { this.addTracksToHashMap(res.body.tracks); } }) .catch((err) => { console.log(err); throw err; }); } /** * Adds similar artists tracks * Not currently being used because of rate limiting for spotifyApi * @returns boolean - true if tracks were successfully added */ addSimilarArtistsTopTracks(artist) { return executeMethod( () => { return this.spotifyApi.getArtistRelatedArtists(artist.id); }) .then((res) => { // MAX returns 20 const promises = []; const similarArtists = res.body.artists; const n = Math.min(similarArtists.length, 1); for (let i = 0; i < n; i++) { promises.push(this.addArtistTopTracks(similarArtists[i])); } return Promise.all(promises); }) .catch((err) => { console.log(err); throw err; }); } /** * Gets all the audio features for all the tracks * @returns {Promise<{} | void>} */ getAllAudioFeatures() { return this.addAllTracksToHashMap() .then(() => { if (!this.trackHashMap || this.trackHashMap.size === 0) throw new Err.EmptyTracksError(); // get array of array of ids (split into 100) const promises = []; const trackIDS = Array.from(this.trackHashMap.keys()); while (trackIDS.length !== 0) { // getAudioFeatures has max of 100 const subsetOfTrackIDS = trackIDS.splice(0, 100); promises.push(this.getAudioFeatures(subsetOfTrackIDS)); } return Promise.all(promises); // return res[] of all the audio features }).then((res) => { // then create json objects with {"id" : {"Acoustic": 0.35, "Danceability":0.96, ...}, "id" : {...} } const data = {}; const loudMIN = -60; const loudMAX = 0; const tempoMIN = 0; const tempoMAX = 250; // TODO: maybe disclude tempoMAX because dont know strict upper bound for (let audioFeatures of res) { if (audioFeatures && audioFeatures.body && audioFeatures.body["audio_features"]) { audioFeatures = audioFeatures.body["audio_features"]; for (const audioFeature of audioFeatures) { if (audioFeature !== null) { const id = audioFeature.id; data[id] = { "danceability": audioFeature.danceability, "energy": audioFeature.energy, "loudness": (audioFeature.loudness - loudMIN) / (loudMAX - loudMIN), "speechiness": audioFeature.speechiness, "acousticness": audioFeature.acousticness, "instrumentalness": audioFeature.instrumentalness, "liveness": audioFeature.liveness, "valence": audioFeature.valence, "tempo": (audioFeature.tempo - tempoMIN) / (tempoMAX - tempoMIN), }; } } } } return data; }) .catch((err) => { console.log(err); throw err; }); } /** * Gets the audio features for a specific set of tracks * @param tracks - current tracks * @returns {Promise<T | * | undefined | void>} */ getAudioFeatures(tracks) { return executeMethod( () => { return this.spotifyApi.getAudioFeaturesForTracks(tracks); }) .catch((err) => { console.log(err); throw err; }); } /** * Gets recommendations based on seeds (browse) * - browse by genres (happy,sad) https://developer.spotify.com/console/get-available-genre-seeds/ * - put in seed tracks and seed artists for more recommendations (personalized to user) * - NOTE** only 5 seeds max total * get 50 happy, 50 sad, 50 chill, 50 ambient, 50 for top 5 artist, 50 for top 5 track * @returns boolean - returns true if seed tracks were successfully added */ addSeedTracks() { const promises = []; // let optionsArray = [ // {limit: 100, seed_genres: "sad"}, // // {limit: 100, seed_genres: "chill, ambient"}, // {limit: 100, seed_genres: "happy"}, // {limit: 100, seed_genres: "chill"} // // ]; const emotionToSeed = { anger: [{ limit: 100, // seed_genres: "hardcore, heavy-metal, death-metal, hard-rock, punk", seed_genres: "death-metal, punk", seed_tracks: "2vwlzO0Qp8kfEtzTsCXfyE,3xrn9i8zhNZsTtcoWgQEAd,7K5dzhGda2vRTaAWYI3hrb", max_valence: 0.15, }], contempt: [{ limit: 100, seed_genres: "death-metal, hardcore", seed_tracks: "2vwlzO0Qp8kfEtzTsCXfyE,1KGi9sZVMeszgZOWivFpxs,5vTPxzm4h2bY9rYyVrGEU5", }], // described as combo of disgust + anger disgust: [{ limit: 100, seed_genres: "heavy-metal, hardcore", seed_tracks: "1KGi9sZVMeszgZOWivFpxs,5vTPxzm4h2bY9rYyVrGEU5,6rUp7v3l8yC4TKxAAR5Bmx,", max_valence: 0.17, }], fear: [{ limit: 100, // seed_genres: "chill, sleep, acoustic, ambient", seed_tracks: "1egVLpTrGvaWtUcR2xDoaN,45Zo6ftGzq6wRckCUrMoBJ,7CZvsEFFZffXJ4HxLWtaQc,45Zo6ftGzq6wRckCUrMoBJ,688DZF6e1MH5Uf409dwaHm", target_valence: 0.5, }], // same as neutral happiness: [{ limit: 100, seed_genres: "happy, hip-hop, summer, pop, party", min_energy: 0.8, min_valence: 0.8, }], neutral: [{limit: 100, seed_genres: "chill, sleep, acoustic, ambient", target_valence: 0.5}], sadness: [{limit: 100, seed_genres: "sad, blues, rainy-day, r-n-b", max_energy: 0.3, max_valence: 0.3}], surprise: [{limit: 100, seed_genres: "hardstyle, work-out, edm, party"}], }; if (!this.mood) this.mood = "happiness"; //default mood const optionsArray = emotionToSeed[this.mood]; for (const option of optionsArray) { promises.push(executeMethod( () => { return this.spotifyApi.getRecommendations(option); }, )); } return Promise.all(promises) .then((resArray) => { for (const res of resArray) { if (this.isResponseBodyTracksValid(res)) { const tracks = res.body.tracks; this.addTracksToHashMap(tracks); } } return true; }) .catch((err) => { console.log(err); throw err; }); } /** * Gets a list of playlist IDs for current user * @returns {Promise<string[]>} */ getListOfUserPlaylistsIDs() { return this.getUserInfo() .then((userInfo) => { return executeMethod(() => { return this.spotifyApi.getUserPlaylists(userInfo.id); }); }) .then((res) => { if (!this.isResponseBodyItemsValid(res)) return []; const playlistsIDs = []; for (const playlist of res.body.items) { playlistsIDs.push(playlist.id); } return playlistsIDs; }) .catch((err) => { console.log(err); throw err; }); } /** * Adds user playlists tracks * @returns boolean - returns true if user playlists tracks were successfully added */ addUserPlaylistsTracks() { const NUM_TRACKS_FOR_EACH_PLAYLIST = 100; return this.getListOfUserPlaylistsIDs() .then((playlistIDs) => { if (!playlistIDs || !Array.isArray(playlistIDs) || playlistIDs.length === 0) return false; const promises = []; const numSongs = Math.floor(NUM_TRACKS_FOR_EACH_PLAYLIST / playlistIDs.length); for (const id of playlistIDs) { promises.push(executeMethod(() => { return this.spotifyApi.getPlaylistTracks(id, {limit: numSongs}); })); } return Promise.all(promises); }) .then((res) => { const numPlaylists = res.length; const tracks = []; for (let i = 0; i < numPlaylists; i++) { if (this.isResponseBodyItemsValid(res[i])) { for (const track of res[i].body.items) { tracks.push(track.track); } } } this.addTracksToHashMap(tracks); return true; }) .catch((err) => { console.log(err); throw err; }); } /** * Returns information about current Spotify user * @returns JSON - name, email, URL, image of user */ getUserInfo() { return executeMethod(() => { return this.spotifyApi.getMe(); }) .then((res) => { const json = {}; json.display_name = res.body.display_name; json.email = res.body.email; json.external_urls = res.body.external_urls; json.images = res.body.images; json.id = res.body.id; return json; }) .catch((err) => { console.log(err); throw err; }); } /** * Creates new playlist for current user * This will create duplicate playlist if playlist already exists, there is no way to delete a playlist through Spotify API * since deleting a playlist will only make the owner unfollow it, while others can still follow the "deleted" playlist * @returns {Promise<T>} */ createNewPlaylist() { return this.getUserInfo() .then((result) => { if (result && result.id && this.mood) { const userId = result.id; return executeMethod(() => { return this.spotifyApi.createPlaylist(userId, "Flow Playlist: " + this.mood, {public: false}); }, ); } else { throw new Err.InvalidResponseError("User info or mood is currently not set"); } }).catch((err) => { console.log(err); throw err; }); } /** * Creates a new playlist based on list of track URLs * @param trackURLs - list of track URLs * @returns {Promise<T>} */ getNewPlaylist(trackURLs) { let link = null; if (!this.isTrackURLsValid(trackURLs)) return Promise.reject(new Err.InvalidInputError("trackURLs is invalid, ensure is a non-empty array")); return this.createNewPlaylist() .then((playlist) => { if (this.isCreatedPlaylistValid(playlist)) { link = playlist.body.external_urls.spotify; return executeMethod(() => { return this.spotifyApi.addTracksToPlaylist(playlist.body.id, trackURLs); }); } else { throw new Err.InvalidResponseError("Playlist did not create correctly"); } }) .then((result) => { if (!link || result.statusCode !== 200 && result.statusCode !== 201) throw new Err.InvalidResponseError("Playlist link is null or tracks were not added correctly"); return link; }) .catch((err) => { console.log(err); throw err; }); } /** * Checks if created playlist is valid * @param playlist - current playlist generated * @returns boolean - returns true if created playlist, body and items are not null/undefined, status codes are successful */ isCreatedPlaylistValid(playlist) { return playlist && playlist.body && (playlist.statusCode === 200 || playlist.statusCode === 201) && playlist.body.external_urls && playlist.body.external_urls.spotify && playlist.body.id; } /** * Checks if track URLs are valid * @param trackURLs - current list of track URLs * @returns boolean - returns true if trackURLs are not null/undefined/size zero, and in the format of an array */ isTrackURLsValid(trackURLs) { return trackURLs && Array.isArray(trackURLs) && trackURLs.length !== 0; } } module.exports.SpotifyService = SpotifyService;