forked from Hacker0x01/react-datepicker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreact-datepicker.min.js
2 lines (2 loc) · 29.5 KB
/
react-datepicker.min.js
1
2
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react"),require("moment"),require("react-onclickoutside")):"function"==typeof define&&define.amd?define(["react","moment","react-onclickoutside"],e):"object"==typeof exports?exports.DatePicker=e(require("react"),require("moment"),require("react-onclickoutside")):t.DatePicker=e(t.React,t.moment,t.OnClickOutside)}(this,function(t,e,o){return function(t){function e(n){if(o[n])return o[n].exports;var i=o[n]={exports:{},id:n,loaded:!1};return t[n].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var o={};return e.m=t,e.c=o,e.p="",e(0)}([function(t,e,o){"use strict";var n=o(1),i=o(2),s=(o(4),o(5)),r=o(9),a=n.createClass({displayName:"DatePicker",getInitialState:function(){return{focus:!1}},handleFocus:function(){this.setState({focus:!0})},hideCalendar:function(){setTimeout(function(){this.setState({focus:!1})}.bind(this),0)},handleSelect:function(t){this.setSelected(t),setTimeout(function(){this.hideCalendar()}.bind(this),200)},setSelected:function(t){this.props.onChange(t.moment())},clearSelected:function(){this.props.onChange(null)},onInputClick:function(){this.setState({focus:!0})},calendar:function(){return this.state.focus?n.createElement(i,null,n.createElement(s,{selected:this.props.selected,onSelect:this.handleSelect,hideCalendar:this.hideCalendar,minDate:this.props.minDate,maxDate:this.props.maxDate,weekStart:this.props.weekStart})):void 0},render:function(){return n.createElement("div",null,n.createElement(r,{name:this.props.name,date:this.props.selected,dateFormat:this.props.dateFormat,focus:this.state.focus,onFocus:this.handleFocus,handleClick:this.onInputClick,handleEnter:this.hideCalendar,setSelected:this.setSelected,clearSelected:this.clearSelected,hideCalendar:this.hideCalendar,placeholderText:this.props.placeholderText}),this.calendar())}});t.exports=a},function(e,o,n){e.exports=t},function(t,e,o){"use strict";var n=o(1),i=n.createClass({displayName:"Popover",componentWillMount:function(){var t=document.createElement("span");t.className="datepicker__container",this._popoverElement=t,document.querySelector("body").appendChild(this._popoverElement)},componentDidMount:function(){this._renderPopover()},componentDidUpdate:function(){this._renderPopover()},_popoverComponent:function(){var t=this.props.className;return n.createElement("div",{className:t},this.props.children)},_tetherOptions:function(){return{element:this._popoverElement,target:this.getDOMNode().parentElement,attachment:"top left",targetAttachment:"bottom left",targetOffset:"10px 0",optimizations:{moveElement:!1}}},_renderPopover:function(){if(n.render(this._popoverComponent(),this._popoverElement),null!=this._tether)this._tether.setOptions(this._tetherOptions());else if(window&&document){var t=o(3);this._tether=new t(this._tetherOptions())}},componentWillUnmount:function(){this._tether.destroy(),n.unmountComponentAtNode(this._popoverElement),this._popoverElement.parentNode&&this._popoverElement.parentNode.removeChild(this._popoverElement)},render:function(){return n.createElement("span",null)}});t.exports=i},function(t,e,o){var n,i;/*! tether 0.6.5 */
!function(s,r){n=r,i="function"==typeof n?n.call(e,o,e,t):n,!(void 0!==i&&(t.exports=i))}(this,function(t,e,o){return function(){var t,e,o,n,i,s,r,a,l,h,p,u,c,d,f,m,g,v,b,y={}.hasOwnProperty,C=[].indexOf||function(t){for(var e=0,o=this.length;o>e;e++)if(e in this&&this[e]===t)return e;return-1},w=[].slice;null==this.Tether&&(this.Tether={modules:[]}),u=function(t){var e,o,n,i,s;if(o=getComputedStyle(t).position,"fixed"===o)return t;for(n=void 0,e=t;e=e.parentNode;){try{i=getComputedStyle(e)}catch(r){}if(null==i)return e;if(/(auto|scroll)/.test(i.overflow+i.overflowY+i.overflowX)&&("absolute"!==o||"relative"===(s=i.position)||"absolute"===s||"fixed"===s))return e}return document.body},g=function(){var t;return t=0,function(){return t++}}(),b={},h=function(t){var e,n,s,r,a;if(s=t._tetherZeroElement,null==s&&(s=t.createElement("div"),s.setAttribute("data-tether-id",g()),i(s.style,{top:0,left:0,position:"absolute"}),t.body.appendChild(s),t._tetherZeroElement=s),e=s.getAttribute("data-tether-id"),null==b[e]){b[e]={},a=s.getBoundingClientRect();for(n in a)r=a[n],b[e][n]=r;o(function(){return b[e]=void 0})}return b[e]},d=null,r=function(t){var e,o,n,i,s,r,a;t===document?(o=document,t=document.documentElement):o=t.ownerDocument,n=o.documentElement,e={},a=t.getBoundingClientRect();for(i in a)r=a[i],e[i]=r;return s=h(o),e.top-=s.top,e.left-=s.left,null==e.width&&(e.width=document.body.scrollWidth-e.left-e.right),null==e.height&&(e.height=document.body.scrollHeight-e.top-e.bottom),e.top=e.top-n.clientTop,e.left=e.left-n.clientLeft,e.right=o.body.clientWidth-e.width-e.left,e.bottom=o.body.clientHeight-e.height-e.top,e},l=function(t){return t.offsetParent||document.documentElement},p=function(){var t,e,o,n,s;return t=document.createElement("div"),t.style.width="100%",t.style.height="200px",e=document.createElement("div"),i(e.style,{position:"absolute",top:0,left:0,pointerEvents:"none",visibility:"hidden",width:"200px",height:"150px",overflow:"hidden"}),e.appendChild(t),document.body.appendChild(e),n=t.offsetWidth,e.style.overflow="scroll",s=t.offsetWidth,n===s&&(s=e.clientWidth),document.body.removeChild(e),o=n-s,{width:o,height:o}},i=function(t){var e,o,n,i,s,r,a;for(null==t&&(t={}),e=[],Array.prototype.push.apply(e,arguments),a=e.slice(1),s=0,r=a.length;r>s;s++)if(n=a[s])for(o in n)y.call(n,o)&&(i=n[o],t[o]=i);return t},f=function(t,e){var o,n,i,s,r,l;if(null!=t.classList){for(r=e.split(" "),l=[],i=0,s=r.length;s>i;i++)n=r[i],n.trim()&&l.push(t.classList.remove(n));return l}return o=a(t).replace(new RegExp("(^| )"+e.split(" ").join("|")+"( |$)","gi")," "),m(t,o)},e=function(t,e){var o,n,i,s,r;if(null!=t.classList){for(s=e.split(" "),r=[],n=0,i=s.length;i>n;n++)o=s[n],o.trim()&&r.push(t.classList.add(o));return r}return f(t,e),o=a(t)+(" "+e),m(t,o)},c=function(t,e){return null!=t.classList?t.classList.contains(e):new RegExp("(^| )"+e+"( |$)","gi").test(a(t))},a=function(t){return t.className instanceof SVGAnimatedString?t.className.baseVal:t.className},m=function(t,e){return t.setAttribute("class",e)},v=function(t,o,n){var i,s,r,a,l,h;for(s=0,a=n.length;a>s;s++)i=n[s],C.call(o,i)<0&&c(t,i)&&f(t,i);for(h=[],r=0,l=o.length;l>r;r++)i=o[r],c(t,i)?h.push(void 0):h.push(e(t,i));return h},n=[],o=function(t){return n.push(t)},s=function(){var t,e;for(e=[];t=n.pop();)e.push(t());return e},t=function(){function t(){}return t.prototype.on=function(t,e,o,n){var i;return null==n&&(n=!1),null==this.bindings&&(this.bindings={}),null==(i=this.bindings)[t]&&(i[t]=[]),this.bindings[t].push({handler:e,ctx:o,once:n})},t.prototype.once=function(t,e,o){return this.on(t,e,o,!0)},t.prototype.off=function(t,e){var o,n,i;if(null!=(null!=(n=this.bindings)?n[t]:void 0)){if(null==e)return delete this.bindings[t];for(o=0,i=[];o<this.bindings[t].length;)this.bindings[t][o].handler===e?i.push(this.bindings[t].splice(o,1)):i.push(o++);return i}},t.prototype.trigger=function(){var t,e,o,n,i,s,r,a,l;if(o=arguments[0],t=2<=arguments.length?w.call(arguments,1):[],null!=(r=this.bindings)?r[o]:void 0){for(i=0,l=[];i<this.bindings[o].length;)a=this.bindings[o][i],n=a.handler,e=a.ctx,s=a.once,n.apply(null!=e?e:this,t),s?l.push(this.bindings[o].splice(i,1)):l.push(i++);return l}},t}(),this.Tether.Utils={getScrollParent:u,getBounds:r,getOffsetParent:l,extend:i,addClass:e,removeClass:f,hasClass:c,updateClasses:v,defer:o,flush:s,uniqueId:g,Evented:t,getScrollBarSize:p}}.call(this),function(){var t,e,o,n,i,s,r,a,l,h,p,u,c,d,f,m,g,v,b,y,C,w,_,k,S,E,x,O,M,T=[].slice,D=function(t,e){return function(){return t.apply(e,arguments)}};if(null==this.Tether)throw new Error("You must include the utils.js file before tether.js");n=this.Tether,M=n.Utils,m=M.getScrollParent,g=M.getSize,d=M.getOuterSize,u=M.getBounds,c=M.getOffsetParent,h=M.extend,i=M.addClass,_=M.removeClass,E=M.updateClasses,l=M.defer,p=M.flush,f=M.getScrollBarSize,x=function(t,e,o){return null==o&&(o=1),t+o>=e&&e>=t-o},S=function(){var t,e,o,n,i;for(t=document.createElement("div"),i=["transform","webkitTransform","OTransform","MozTransform","msTransform"],o=0,n=i.length;n>o;o++)if(e=i[o],void 0!==t.style[e])return e}(),k=[],w=function(){var t,e,o;for(e=0,o=k.length;o>e;e++)t=k[e],t.position(!1);return p()},v=function(){var t;return null!=(t="undefined"!=typeof performance&&null!==performance&&"function"==typeof performance.now?performance.now():void 0)?t:+new Date},function(){var t,e,o,n,i,s,r,a,l;for(e=null,o=null,n=null,i=function(){if(null!=o&&o>16)return o=Math.min(o-16,250),void(n=setTimeout(i,250));if(!(null!=e&&v()-e<10))return null!=n&&(clearTimeout(n),n=null),e=v(),w(),o=v()-e},a=["resize","scroll","touchmove"],l=[],s=0,r=a.length;r>s;s++)t=a[s],l.push(window.addEventListener(t,i));return l}(),t={center:"center",left:"right",right:"left"},e={middle:"middle",top:"bottom",bottom:"top"},o={top:0,left:0,middle:"50%",center:"50%",bottom:"100%",right:"100%"},a=function(o,n){var i,s;return i=o.left,s=o.top,"auto"===i&&(i=t[n.left]),"auto"===s&&(s=e[n.top]),{left:i,top:s}},r=function(t){var e,n;return{left:null!=(e=o[t.left])?e:t.left,top:null!=(n=o[t.top])?n:t.top}},s=function(){var t,e,o,n,i,s,r;for(e=1<=arguments.length?T.call(arguments,0):[],o={top:0,left:0},i=0,s=e.length;s>i;i++)r=e[i],n=r.top,t=r.left,"string"==typeof n&&(n=parseFloat(n,10)),"string"==typeof t&&(t=parseFloat(t,10)),o.top+=n,o.left+=t;return o},b=function(t,e){return"string"==typeof t.left&&-1!==t.left.indexOf("%")&&(t.left=parseFloat(t.left,10)/100*e.width),"string"==typeof t.top&&-1!==t.top.indexOf("%")&&(t.top=parseFloat(t.top,10)/100*e.height),t},y=C=function(t){var e,o,n;return n=t.split(" "),o=n[0],e=n[1],{top:o,left:e}},O=function(){function t(t){this.position=D(this.position,this);var e,o,i,s,r;for(k.push(this),this.history=[],this.setOptions(t,!1),s=n.modules,o=0,i=s.length;i>o;o++)e=s[o],null!=(r=e.initialize)&&r.call(this);this.position()}return t.modules=[],t.prototype.getClass=function(t){var e,o;return(null!=(e=this.options.classes)?e[t]:void 0)?this.options.classes[t]:(null!=(o=this.options.classes)?o[t]:void 0)!==!1?this.options.classPrefix?""+this.options.classPrefix+"-"+t:t:""},t.prototype.setOptions=function(t,e){var o,n,s,r,a,l;for(this.options=t,null==e&&(e=!0),o={offset:"0 0",targetOffset:"0 0",targetAttachment:"auto auto",classPrefix:"tether"},this.options=h(o,this.options),a=this.options,this.element=a.element,this.target=a.target,this.targetModifier=a.targetModifier,"viewport"===this.target?(this.target=document.body,this.targetModifier="visible"):"scroll-handle"===this.target&&(this.target=document.body,this.targetModifier="scroll-handle"),l=["element","target"],s=0,r=l.length;r>s;s++){if(n=l[s],null==this[n])throw new Error("Tether Error: Both element and target must be defined");null!=this[n].jquery?this[n]=this[n][0]:"string"==typeof this[n]&&(this[n]=document.querySelector(this[n]))}if(i(this.element,this.getClass("element")),i(this.target,this.getClass("target")),!this.options.attachment)throw new Error("Tether Error: You must provide an attachment");return this.targetAttachment=y(this.options.targetAttachment),this.attachment=y(this.options.attachment),this.offset=C(this.options.offset),this.targetOffset=C(this.options.targetOffset),null!=this.scrollParent&&this.disable(),"scroll-handle"===this.targetModifier?this.scrollParent=this.target:this.scrollParent=m(this.target),this.options.enabled!==!1?this.enable(e):void 0},t.prototype.getTargetBounds=function(){var t,e,o,n,i,s,r,a,l;if(null==this.targetModifier)return u(this.target);switch(this.targetModifier){case"visible":return this.target===document.body?{top:pageYOffset,left:pageXOffset,height:innerHeight,width:innerWidth}:(t=u(this.target),i={height:t.height,width:t.width,top:t.top,left:t.left},i.height=Math.min(i.height,t.height-(pageYOffset-t.top)),i.height=Math.min(i.height,t.height-(t.top+t.height-(pageYOffset+innerHeight))),i.height=Math.min(innerHeight,i.height),i.height-=2,i.width=Math.min(i.width,t.width-(pageXOffset-t.left)),i.width=Math.min(i.width,t.width-(t.left+t.width-(pageXOffset+innerWidth))),i.width=Math.min(innerWidth,i.width),i.width-=2,i.top<pageYOffset&&(i.top=pageYOffset),i.left<pageXOffset&&(i.left=pageXOffset),i);case"scroll-handle":return l=this.target,l===document.body?(l=document.documentElement,t={left:pageXOffset,top:pageYOffset,height:innerHeight,width:innerWidth}):t=u(l),a=getComputedStyle(l),o=l.scrollWidth>l.clientWidth||"scroll"===[a.overflow,a.overflowX]||this.target!==document.body,s=0,o&&(s=15),n=t.height-parseFloat(a.borderTopWidth)-parseFloat(a.borderBottomWidth)-s,i={width:15,height:.975*n*(n/l.scrollHeight),left:t.left+t.width-parseFloat(a.borderLeftWidth)-15},e=0,408>n&&this.target===document.body&&(e=-11e-5*Math.pow(n,2)-.00727*n+22.58),this.target!==document.body&&(i.height=Math.max(i.height,24)),r=this.target.scrollTop/(l.scrollHeight-n),i.top=r*(n-i.height-e)+t.top+parseFloat(a.borderTopWidth),this.target===document.body&&(i.height=Math.max(i.height,24)),i}},t.prototype.clearCache=function(){return this._cache={}},t.prototype.cache=function(t,e){return null==this._cache&&(this._cache={}),null==this._cache[t]&&(this._cache[t]=e.call(this)),this._cache[t]},t.prototype.enable=function(t){return null==t&&(t=!0),i(this.target,this.getClass("enabled")),i(this.element,this.getClass("enabled")),this.enabled=!0,this.scrollParent!==document&&this.scrollParent.addEventListener("scroll",this.position),t?this.position():void 0},t.prototype.disable=function(){return _(this.target,this.getClass("enabled")),_(this.element,this.getClass("enabled")),this.enabled=!1,null!=this.scrollParent?this.scrollParent.removeEventListener("scroll",this.position):void 0},t.prototype.destroy=function(){var t,e,o,n,i;for(this.disable(),i=[],t=o=0,n=k.length;n>o;t=++o){if(e=k[t],e===this){k.splice(t,1);break}i.push(void 0)}return i},t.prototype.updateAttachClasses=function(t,e){var o,n,i,s,r,a,h,p,u,c=this;for(null==t&&(t=this.attachment),null==e&&(e=this.targetAttachment),s=["left","top","bottom","right","middle","center"],(null!=(u=this._addAttachClasses)?u.length:void 0)&&this._addAttachClasses.splice(0,this._addAttachClasses.length),o=null!=this._addAttachClasses?this._addAttachClasses:this._addAttachClasses=[],t.top&&o.push(""+this.getClass("element-attached")+"-"+t.top),t.left&&o.push(""+this.getClass("element-attached")+"-"+t.left),e.top&&o.push(""+this.getClass("target-attached")+"-"+e.top),e.left&&o.push(""+this.getClass("target-attached")+"-"+e.left),n=[],r=0,h=s.length;h>r;r++)i=s[r],n.push(""+this.getClass("element-attached")+"-"+i);for(a=0,p=s.length;p>a;a++)i=s[a],n.push(""+this.getClass("target-attached")+"-"+i);return l(function(){return null!=c._addAttachClasses?(E(c.element,c._addAttachClasses,n),E(c.target,c._addAttachClasses,n),c._addAttachClasses=void 0):void 0})},t.prototype.position=function(t){var e,o,i,l,h,d,m,g,v,y,C,w,_,k,S,E,x,O,M,T,D,W,N,F,P,A,Y,z,B,L,H,I,X,q,j,R=this;if(null==t&&(t=!0),this.enabled){for(this.clearCache(),T=a(this.targetAttachment,this.attachment),this.updateAttachClasses(this.attachment,T),e=this.cache("element-bounds",function(){return u(R.element)}),P=e.width,i=e.height,0===P&&0===i&&null!=this.lastSize?(L=this.lastSize,P=L.width,i=L.height):this.lastSize={width:P,height:i},N=W=this.cache("target-bounds",function(){return R.getTargetBounds()}),v=b(r(this.attachment),{width:P,height:i}),D=b(r(T),N),h=b(this.offset,{width:P,height:i}),d=b(this.targetOffset,N),v=s(v,h),D=s(D,d),l=W.left+D.left-v.left,F=W.top+D.top-v.top,H=n.modules,A=0,z=H.length;z>A;A++)if(m=H[A],S=m.position.call(this,{left:l,top:F,targetAttachment:T,targetPos:W,attachment:this.attachment,elementPos:e,offset:v,targetOffset:D,manualOffset:h,manualTargetOffset:d,scrollbarSize:O}),null!=S&&"object"==typeof S){if(S===!1)return!1;F=S.top,l=S.left}if(g={page:{top:F,left:l},viewport:{top:F-pageYOffset,bottom:pageYOffset-F-i+innerHeight,left:l-pageXOffset,right:pageXOffset-l-P+innerWidth}},document.body.scrollWidth>window.innerWidth&&(O=this.cache("scrollbar-size",f),g.viewport.bottom-=O.height),document.body.scrollHeight>window.innerHeight&&(O=this.cache("scrollbar-size",f),g.viewport.right-=O.width),(""!==(I=document.body.style.position)&&"static"!==I||""!==(X=document.body.parentElement.style.position)&&"static"!==X)&&(g.page.bottom=document.body.scrollHeight-F-i,g.page.right=document.body.scrollWidth-l-P),(null!=(q=this.options.optimizations)?q.moveElement:void 0)!==!1&&null==this.targetModifier){for(C=this.cache("target-offsetparent",function(){return c(R.target)}),k=this.cache("target-offsetparent-bounds",function(){return u(C)}),_=getComputedStyle(C),o=getComputedStyle(this.element),w=k,y={},j=["Top","Left","Bottom","Right"],Y=0,B=j.length;B>Y;Y++)M=j[Y],y[M.toLowerCase()]=parseFloat(_["border"+M+"Width"]);k.right=document.body.scrollWidth-k.left-w.width+y.right,k.bottom=document.body.scrollHeight-k.top-w.height+y.bottom,g.page.top>=k.top+y.top&&g.page.bottom>=k.bottom&&g.page.left>=k.left+y.left&&g.page.right>=k.right&&(x=C.scrollTop,E=C.scrollLeft,g.offset={top:g.page.top-k.top+x-y.top,left:g.page.left-k.left+E-y.left})}return this.move(g),this.history.unshift(g),this.history.length>3&&this.history.pop(),t&&p(),!0}},t.prototype.move=function(t){var e,o,n,i,s,r,a,p,u,d,f,m,g,v,b,y,C,w=this;if(null!=this.element.parentNode){p={};for(d in t){p[d]={};for(i in t[d]){for(n=!1,y=this.history,v=0,b=y.length;b>v;v++)if(a=y[v],!x(null!=(C=a[d])?C[i]:void 0,t[d][i])){n=!0;break}n||(p[d][i]=!0)}}e={top:"",left:"",right:"",bottom:""},u=function(t,o){var n,i,s;return(null!=(s=w.options.optimizations)?s.gpu:void 0)===!1?(t.top?e.top=""+o.top+"px":e.bottom=""+o.bottom+"px",t.left?e.left=""+o.left+"px":e.right=""+o.right+"px"):(t.top?(e.top=0,i=o.top):(e.bottom=0,i=-o.bottom),t.left?(e.left=0,n=o.left):(e.right=0,n=-o.right),e[S]="translateX("+Math.round(n)+"px) translateY("+Math.round(i)+"px)","msTransform"!==S?e[S]+=" translateZ(0)":void 0)},s=!1,(p.page.top||p.page.bottom)&&(p.page.left||p.page.right)?(e.position="absolute",u(p.page,t.page)):(p.viewport.top||p.viewport.bottom)&&(p.viewport.left||p.viewport.right)?(e.position="fixed",u(p.viewport,t.viewport)):null!=p.offset&&p.offset.top&&p.offset.left?(e.position="absolute",r=this.cache("target-offsetparent",function(){return c(w.target)}),c(this.element)!==r&&l(function(){return w.element.parentNode.removeChild(w.element),r.appendChild(w.element)}),u(p.offset,t.offset),s=!0):(e.position="absolute",u({top:!0,left:!0},t.page)),s||"BODY"===this.element.parentNode.tagName||(this.element.parentNode.removeChild(this.element),document.body.appendChild(this.element)),g={},m=!1;for(i in e)f=e[i],o=this.element.style[i],""===o||""===f||"top"!==i&&"left"!==i&&"bottom"!==i&&"right"!==i||(o=parseFloat(o),f=parseFloat(f)),o!==f&&(m=!0,g[i]=e[i]);return m?l(function(){return h(w.element.style,g)}):void 0}},t}(),n.position=w,this.Tether=h(O,n)}.call(this),function(){var t,e,o,n,i,s,r,a,l,h,p=[].indexOf||function(t){for(var e=0,o=this.length;o>e;e++)if(e in this&&this[e]===t)return e;return-1};h=this.Tether.Utils,r=h.getOuterSize,s=h.getBounds,a=h.getSize,n=h.extend,l=h.updateClasses,o=h.defer,e={left:"right",right:"left",top:"bottom",bottom:"top",middle:"middle"},t=["left","top","right","bottom"],i=function(e,o){var n,i,r,a,l,h,p;if("scrollParent"===o?o=e.scrollParent:"window"===o&&(o=[pageXOffset,pageYOffset,innerWidth+pageXOffset,innerHeight+pageYOffset]),o===document&&(o=o.documentElement),null!=o.nodeType)for(i=a=s(o),l=getComputedStyle(o),o=[i.left,i.top,a.width+i.left,a.height+i.top],n=h=0,p=t.length;p>h;n=++h)r=t[n],r=r[0].toUpperCase()+r.substr(1),"Top"===r||"Left"===r?o[n]+=parseFloat(l["border"+r+"Width"]):o[n]-=parseFloat(l["border"+r+"Width"]);return o},this.Tether.modules.push({position:function(e){var r,a,h,u,c,d,f,m,g,v,b,y,C,w,_,k,S,E,x,O,M,T,D,W,N,F,P,A,Y,z,B,L,H,I,X,q,j,R,U,K,V,Z,$,G,J,Q,tt,et=this;if(F=e.top,b=e.left,M=e.targetAttachment,!this.options.constraints)return!0;for(E=function(e){var o,n,i,s;for(et.removeClass(e),s=[],n=0,i=t.length;i>n;n++)o=t[n],s.push(et.removeClass(""+e+"-"+o));return s},K=this.cache("element-bounds",function(){return s(et.element)}),v=K.height,P=K.width,0===P&&0===v&&null!=this.lastSize&&(V=this.lastSize,P=V.width,v=V.height),D=this.cache("target-bounds",function(){return et.getTargetBounds()}),T=D.height,W=D.width,O={},g={},a=[this.getClass("pinned"),this.getClass("out-of-bounds")],Z=this.options.constraints,A=0,L=Z.length;L>A;A++)m=Z[A],m.outOfBoundsClass&&a.push(m.outOfBoundsClass),m.pinnedClass&&a.push(m.pinnedClass);for(Y=0,H=a.length;H>Y;Y++)for(f=a[Y],$=["left","top","right","bottom"],z=0,I=$.length;I>z;z++)x=$[z],a.push(""+f+"-"+x);for(r=[],O=n({},M),g=n({},this.attachment),G=this.options.constraints,B=0,X=G.length;X>B;B++){if(m=G[B],N=m.to,h=m.attachment,_=m.pin,null==h&&(h=""),p.call(h," ")>=0?(J=h.split(" "),d=J[0],c=J[1]):c=d=h,u=i(this,N),("target"===d||"both"===d)&&(F<u[1]&&"top"===O.top&&(F+=T,O.top="bottom"),F+v>u[3]&&"bottom"===O.top&&(F-=T,O.top="top")),"together"===d&&(F<u[1]&&"top"===O.top&&("bottom"===g.top?(F+=T,O.top="bottom",F+=v,g.top="top"):"top"===g.top&&(F+=T,O.top="bottom",F-=v,g.top="bottom")),F+v>u[3]&&"bottom"===O.top&&("top"===g.top?(F-=T,O.top="top",F-=v,g.top="bottom"):"bottom"===g.top&&(F-=T,O.top="top",F+=v,g.top="top")),"middle"===O.top&&(F+v>u[3]&&"top"===g.top?(F-=v,g.top="bottom"):F<u[1]&&"bottom"===g.top&&(F+=v,g.top="top"))),("target"===c||"both"===c)&&(b<u[0]&&"left"===O.left&&(b+=W,O.left="right"),b+P>u[2]&&"right"===O.left&&(b-=W,O.left="left")),"together"===c&&(b<u[0]&&"left"===O.left?"right"===g.left?(b+=W,O.left="right",b+=P,g.left="left"):"left"===g.left&&(b+=W,O.left="right",b-=P,g.left="right"):b+P>u[2]&&"right"===O.left?"left"===g.left?(b-=W,O.left="left",b-=P,g.left="right"):"right"===g.left&&(b-=W,O.left="left",b+=P,g.left="left"):"center"===O.left&&(b+P>u[2]&&"left"===g.left?(b-=P,g.left="right"):b<u[0]&&"right"===g.left&&(b+=P,g.left="left"))),("element"===d||"both"===d)&&(F<u[1]&&"bottom"===g.top&&(F+=v,g.top="top"),F+v>u[3]&&"top"===g.top&&(F-=v,g.top="bottom")),("element"===c||"both"===c)&&(b<u[0]&&"right"===g.left&&(b+=P,g.left="left"),b+P>u[2]&&"left"===g.left&&(b-=P,g.left="right")),"string"==typeof _?_=function(){var t,e,o,n;for(o=_.split(","),n=[],e=0,t=o.length;t>e;e++)w=o[e],n.push(w.trim());return n}():_===!0&&(_=["top","left","right","bottom"]),_||(_=[]),k=[],y=[],F<u[1]&&(p.call(_,"top")>=0?(F=u[1],k.push("top")):y.push("top")),F+v>u[3]&&(p.call(_,"bottom")>=0?(F=u[3]-v,k.push("bottom")):y.push("bottom")),b<u[0]&&(p.call(_,"left")>=0?(b=u[0],k.push("left")):y.push("left")),b+P>u[2]&&(p.call(_,"right")>=0?(b=u[2]-P,k.push("right")):y.push("right")),k.length)for(S=null!=(Q=this.options.pinnedClass)?Q:this.getClass("pinned"),r.push(S),R=0,q=k.length;q>R;R++)x=k[R],r.push(""+S+"-"+x);if(y.length)for(C=null!=(tt=this.options.outOfBoundsClass)?tt:this.getClass("out-of-bounds"),r.push(C),U=0,j=y.length;j>U;U++)x=y[U],r.push(""+C+"-"+x);(p.call(k,"left")>=0||p.call(k,"right")>=0)&&(g.left=O.left=!1),(p.call(k,"top")>=0||p.call(k,"bottom")>=0)&&(g.top=O.top=!1),(O.top!==M.top||O.left!==M.left||g.top!==this.attachment.top||g.left!==this.attachment.left)&&this.updateAttachClasses(g,O)}return o(function(){return l(et.target,r,a),l(et.element,r,a)}),{top:F,left:b}}})}.call(this),function(){var t,e,o,n;n=this.Tether.Utils,e=n.getBounds,o=n.updateClasses,t=n.defer,this.Tether.modules.push({position:function(n){var i,s,r,a,l,h,p,u,c,d,f,m,g,v,b,y,C,w,_,k,S,E,x,O,M,T=this;if(f=n.top,h=n.left,S=this.cache("element-bounds",function(){return e(T.element)}),l=S.height,m=S.width,d=this.getTargetBounds(),a=f+l,p=h+m,i=[],f<=d.bottom&&a>=d.top)for(E=["left","right"],g=0,C=E.length;C>g;g++)u=E[g],((x=d[u])===h||x===p)&&i.push(u);if(h<=d.right&&p>=d.left)for(O=["top","bottom"],v=0,w=O.length;w>v;v++)u=O[v],((M=d[u])===f||M===a)&&i.push(u);for(r=[],s=[],c=["left","top","right","bottom"],r.push(this.getClass("abutted")),b=0,_=c.length;_>b;b++)u=c[b],r.push(""+this.getClass("abutted")+"-"+u);for(i.length&&s.push(this.getClass("abutted")),y=0,k=i.length;k>y;y++)u=i[y],s.push(""+this.getClass("abutted")+"-"+u);return t(function(){return o(T.target,s,r),o(T.element,s,r)}),!0}})}.call(this),function(){this.Tether.modules.push({position:function(t){var e,o,n,i,s,r,a;return r=t.top,e=t.left,this.options.shift?(o=function(t){return"function"==typeof t?t.call(this,{top:r,left:e}):t},n=o(this.options.shift),"string"==typeof n?(n=n.split(" "),n[1]||(n[1]=n[0]),s=n[0],i=n[1],s=parseFloat(s,10),i=parseFloat(i,10)):(a=[n.top,n.left],s=a[0],i=a[1]),r+=s,e+=i,{top:r,left:e}):void 0}})}.call(this),this.Tether})},function(t,e,o){"use strict";function n(t){this._date=t}n.prototype.isBefore=function(t){return this._date.isBefore(t._date,"day")},n.prototype.isAfter=function(t){return this._date.isAfter(t._date,"day")},n.prototype.sameDay=function(t){return this._date.isSame(t._date,"day")},n.prototype.sameMonth=function(t){return this._date.isSame(t._date,"month")},n.prototype.day=function(){return this._date.date()},n.prototype.mapDaysInWeek=function(t){for(var e=[],o=this._date.clone(),i=0;7>i;i++){var s=new n(o.clone().add(i,"days"));e[i]=t(s,i)}return e},n.prototype.mapWeeksInMonth=function(t){for(var e=[],o=this._date.clone().startOf("month").startOf("week"),i=0;6>i;i++){var s=new n(o.clone().add(i,"weeks"));e[i]=t(s,i)}return e},n.prototype.weekInMonth=function(t){var e=this._date.clone(),o=this._date.clone().weekday(7);return e.isSame(t._date,"month")||o.isSame(t._date,"month")},n.prototype.format=function(){return this._date.format.apply(this._date,arguments)},n.prototype.addMonth=function(){return new n(this._date.clone().add(1,"month"))},n.prototype.subtractMonth=function(){return new n(this._date.clone().subtract(1,"month"))},n.prototype.clone=function(){return new n(this._date.clone())},n.prototype.safeClone=function(t){return this._date?this.clone():(void 0===t&&(t=null),new n(t))},n.prototype.moment=function(){return this._date},t.exports=n},function(t,e,o){"use strict";var n=o(1),i=o(6),s=o(4),r=o(7),a=n.createClass({displayName:"Calendar",mixins:[o(8)],handleClickOutside:function(){this.props.hideCalendar()},getInitialState:function(){return{date:new s(this.props.selected).safeClone(r())}},getDefaultProps:function(){return{weekStart:1}},componentWillMount:function(){this.initializeMomentLocale()},componentWillReceiveProps:function(t){null!==t.selected&&t.selected!==this.props.selected&&this.setState({date:new s(t.selected).clone()})},initializeMomentLocale:function(){var t=["Su","Mo","Tu","We","Th","Fr","Sa"];t=t.concat(t.splice(0,this.props.weekStart)),r.locale("en",{week:{dow:this.props.weekStart},weekdaysMin:t})},increaseMonth:function(){this.setState({date:this.state.date.addMonth()})},decreaseMonth:function(){this.setState({date:this.state.date.subtractMonth()})},weeks:function(){return this.state.date.mapWeeksInMonth(this.renderWeek)},handleDayClick:function(t){this.props.onSelect(t)},renderWeek:function(t,e){return t.weekInMonth(this.state.date)?n.createElement("div",{key:e},this.days(t)):void 0},renderDay:function(t,e){var o=new s(this.props.minDate).safeClone(),r=new s(this.props.maxDate).safeClone(),a=t.isBefore(o)||t.isAfter(r);return n.createElement(i,{key:e,day:t,date:this.state.date,onClick:this.handleDayClick.bind(this,t),selected:new s(this.props.selected),disabled:a})},days:function(t){return t.mapDaysInWeek(this.renderDay)},header:function(){return r.weekdaysMin().map(function(t,e){return n.createElement("div",{className:"datepicker__day",key:e},t)})},render:function(){return n.createElement("div",{className:"datepicker"},n.createElement("div",{className:"datepicker__triangle"}),n.createElement("div",{className:"datepicker__header"},n.createElement("a",{className:"datepicker__navigation datepicker__navigation--previous",onClick:this.decreaseMonth}),n.createElement("span",{className:"datepicker__current-month"},this.state.date.format("MMMM YYYY")),n.createElement("a",{className:"datepicker__navigation datepicker__navigation--next",onClick:this.increaseMonth}),n.createElement("div",null,this.header())),n.createElement("div",{className:"datepicker__month"},this.weeks()))}});t.exports=a},function(t,e,o){"use strict";var n=o(1),i=o(7),s=n.createClass({displayName:"Day",handleClick:function(t){this.props.disabled||this.props.onClick(t)},render:function(){var t=["datepicker__day"];return this.props.disabled&&t.push("datepicker__day--disabled"),this.props.day.sameDay(this.props.selected)&&t.push("datepicker__day--selected"),this.props.day.sameDay(i())&&t.push("datepicker__day--today"),n.createElement("div",{className:t.join(" "),onClick:this.handleClick},this.props.day.day())}});t.exports=s},function(t,o,n){t.exports=e},function(t,e,n){t.exports=o},function(t,e,o){"use strict";var n=o(1),i=o(4),s=o(7),r=n.createClass({displayName:"DateInput",getDefaultProps:function(){return{dateFormat:"YYYY-MM-DD"}},getInitialState:function(){return{value:this.safeDateFormat(this.props.date)}},componentDidMount:function(){this.toggleFocus(this.props.focus)},componentWillReceiveProps:function(t){this.toggleFocus(t.focus),this.setState({value:this.safeDateFormat(t.date)})},toggleFocus:function(t){t?n.findDOMNode(this.refs.input).focus():n.findDOMNode(this.refs.input).blur()},handleChange:function(t){var e=s(t.target.value,this.props.dateFormat,!0);this.setState({value:t.target.value}),e.isValid()?this.props.setSelected(new i(e)):""===t.target.value&&this.props.clearSelected()},safeDateFormat:function(t){return t?t.format(this.props.dateFormat):null},handleKeyDown:function(t){switch(t.key){case"Enter":t.preventDefault(),this.props.handleEnter()}},handleClick:function(t){this.props.handleClick(t)},render:function(){return n.createElement("input",{ref:"input",type:"text",name:this.props.name,value:this.state.value,onClick:this.handleClick,onKeyDown:this.handleKeyDown,onFocus:this.props.onFocus,onChange:this.handleChange,className:"datepicker__input",placeholder:this.props.placeholderText})}});t.exports=r}])});