1){var i=r[0],a=r[1],c=r.slice(2);e=h(Date,[i,a-1].concat(k(c)))}else e=h(Date,r);e.setHours(0,0,0,0),this._date=e}return C(t,[{key:\"getMonth\",value:function(){return this._date.getMonth()+1}},{key:\"getDay\",value:function(){return this._date.getDay()+1}},{key:\"getMonthName\",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:\"long\";return this._date.toLocaleString(\"en-US\",{month:t})}},{key:\"getFullYear\",value:function(){return this._date.getFullYear()}},{key:\"getDate\",value:function(){return this._date.getDate()}},{key:\"getTime\",value:function(){return this._date.getTime()}},{key:\"getDayName\",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:\"long\";return this._date.toLocaleString(\"en-US\",{weekday:t})}},{key:\"getNextDay\",value:function(){var t=new this.constructor(this.getTime());return t.setDate(t.getDate()+1),t}},{key:\"getPrevDay\",value:function(){var t=new this.constructor(this.getTime());return t.setDate(t.getDate()-1),t}},{key:\"setDate\",value:function(t){return this._date.setDate(t),this.getTime()}},{key:\"isInRange\",value:function(t,e){var n,r,o,i,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:\"never\",c=new this.constructor(t),u=new this.constructor(e),f=this.getTime();switch(a){case\"weekly\":return n=c.getDay(),r=u.getDay(),o=this.getDay()>=n,i=this.getDay()<=r,o&&i;case\"monthly\":return n=new this.constructor(this.getFullYear(),this.getMonth(),c.getDate()).getTime(),r=new this.constructor(this.getFullYear(),this.getMonth(),u.getDate()).getTime(),o=f>=n,i=f<=r,o&&i;case\"yearly\":return n=new this.constructor(this.getFullYear(),c.getMonth(),c.getDate()).getTime(),r=new this.constructor(this.getFullYear(),u.getMonth(),u.getDate()).getTime(),o=f>=n,i=f<=r,o&&i;case\"never\":return o=f>=c.getTime(),i=f<=u.getTime(),o&&i;default:return o=f>=c.getTime(),i=f<=u.getTime(),o&&i}}},{key:\"toDateString\",value:function(){return this._date.toDateString()}},{key:\"toISOString\",value:function(){return this._date.toISOString()}},{key:\"getTimezoneOffset\",value:function(){return this._date.getTimezoneOffset()}},{key:\"getNumberOfDaysInMonth\",value:function(){return new this.constructor(this.getFullYear(),this.getMonth()+1,0).getDate()}},{key:\"getFirstWeekdayOfMonth\",value:function(){return new this.constructor(this.getFullYear(),this.getMonth(),1).getDay()}}]),t}(),E={name:\"Calendar\",data:function(){return{today:new P,date:null,weekdays:null}},computed:{days:function(){var t=this,e=Array((this.startWeekDayOfMonth-this.firstDayOfWeek+7)%7).fill(null),n=Array(this.numberOfDays).fill().map((function(e,n){return new P(t.selectedYear,t.selectedMonth,n+1)}));return e.concat(n)},startWeekDayOfMonth:function(){return this.date.getFirstWeekdayOfMonth()},numberOfDays:function(){return this.date.getNumberOfDaysInMonth()},selectedMonth:function(){return this.date.getMonth()},selectedMonthName:function(){return this.date.getMonthName()},selectedYear:function(){return this.date.getFullYear()}},methods:{prevMonth:function(){this.date=new P(this.selectedYear,this.selectedMonth-1,1)},nextMonth:function(){this.date=new P(this.selectedYear,this.selectedMonth+1,1)},generateWeekdayNames:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=[\"Sunday\",\"Monday\",\"Tuesday\",\"Wednesday\",\"Thursday\",\"Friday\",\"Saturday\"],n=2;n<=t;n++){var r=e.shift();e.push(r)}return e},generateDayStyle:function(t){var e=this,n={},r=!0,o=!1,i=void 0;try{for(var a,u=function(){var r=a.value;if(t.isInRange(r.start,r.end,r.repeat)){var o=e.eventCategories.find((function(t){return t.id===r.categoryId}))||{};c()(n,{color:o.id?o.textColor:null,backgroundColor:o.id?o.backgroundColor:null,fontWeight:o.id?\"bold\":\"normal\"})}},s=f()(this.events);!(r=(a=s.next()).done);r=!0)u()}catch(l){o=!0,i=l}finally{try{r||null==s.return||s.return()}finally{if(o)throw i}}return n},generateBeforeStyle:function(t){var e=this,n={},r=!0,o=!1,i=void 0;try{for(var a,u=function(){var r=a.value;if(t.isInRange(r.start,r.end,r.repeat)&&t.getPrevDay().isInRange(r.start,r.end,r.repeat)){var o=e.eventCategories.find((function(t){return t.id===r.categoryId}))||{};c()(n,{backgroundColor:o.backgroundColor})}},s=f()(this.events);!(r=(a=s.next()).done);r=!0)u()}catch(l){o=!0,i=l}finally{try{r||null==s.return||s.return()}finally{if(o)throw i}}return n},generateAfterStyle:function(t){var e=this,n={},r=!0,o=!1,i=void 0;try{for(var a,u=function(){var r=a.value;if(t.isInRange(r.start,r.end,r.repeat)&&t.getNextDay().isInRange(r.start,r.end,r.repeat)){var o=e.eventCategories.find((function(t){return t.id===r.categoryId}))||{};c()(n,{backgroundColor:o.backgroundColor})}},s=f()(this.events);!(r=(a=s.next()).done);r=!0)u()}catch(l){o=!0,i=l}finally{try{r||null==s.return||s.return()}finally{if(o)throw i}}return n},goToday:function(){this.date=this.today}},props:{initialDate:{type:String,default:null},firstDayOfWeek:{type:Number,default:1},eventCategories:{type:Array,default:function(){return[]}},events:{type:Array,default:function(){return[]}},offDays:{type:Array,default:function(){return[1,7]}}},beforeMount:function(){this.date=Date.parse(this.initialDate)?new P(this.initialDate):new P,this.weekdays=this.generateWeekdayNames(this.firstDayOfWeek)}},F=E;n(\"e472\");function I(t,e,n,r,o,i,a,c){var u,f=\"function\"===typeof t?t.options:t;if(e&&(f.render=e,f.staticRenderFns=n,f._compiled=!0),r&&(f.functional=!0),i&&(f._scopeId=\"data-v-\"+i),a?(u=function(t){t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,t||\"undefined\"===typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),o&&o.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(a)},f._ssrRegister=u):o&&(u=c?function(){o.call(this,(f.functional?this.parent:this).$root.$options.shadowRoot)}:o),u)if(f.functional){f._injectStyles=u;var s=f.render;f.render=function(t,e){return u.call(e),s(t,e)}}else{var l=f.beforeCreate;f.beforeCreate=l?[].concat(l,u):[u]}return{exports:t,options:f}}var N=I(F,o,i,!1,null,\"22807381\",null),L=N.exports,R=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n(\"div\",{attrs:{id:\"sweetCalendar\"}},[n(\"div\",{staticClass:\"container date-picker\"},[n(\"div\",{staticClass:\"header\"},[n(\"div\",{staticClass:\"left-arrow\",on:{click:t.prevMonth}},[n(\"span\",[t._v(\"<\")])]),n(\"div\",{staticClass:\"month\"},[t._v(t._s(t.selectedMonthName)+\" \"+t._s(t.selectedYear))]),n(\"div\",{staticClass:\"right-arrow\",on:{click:t.nextMonth}},[n(\"span\",[t._v(\">\")])])]),n(\"div\",{staticClass:\"body\"},[t._l(t.weekdays,(function(e,r){return n(\"div\",{key:\"day-name-\"+(r+1),staticClass:\"day-name\",attrs:{title:e}},[t._v(\"\\n \"+t._s(e[0])+\"\\n \")])})),t._l(t.days,(function(e,r){return n(\"div\",{key:r,staticClass:\"day-container\"},[e?n(\"div\",{class:[\"day\",\"day-\"+e.getDate()+\",\\n weekday-\"+e.getDay(),t.offDays.includes(e.getDay())?\"off-day\":null,e.toDateString()===t.today.toDateString()?\"today\":null,t.isSelected(e)?\"selected\":null],on:{click:function(n){return t.selectDay(e)}}},[n(\"span\",[t._v(t._s(e.getDate()))])]):t._e()])}))],2)])])},W=[],Y={name:\"DatePicker\",data:function(){return{today:new P,date:null,weekdays:null}},computed:{days:function(){var t=this,e=Array((this.startWeekDayOfMonth-this.firstDayOfWeek+7)%7).fill(null),n=Array(this.numberOfDays).fill().map((function(e,n){return new P(t.selectedYear,t.selectedMonth,n+1)}));return e.concat(n)},startWeekDayOfMonth:function(){return this.date.getFirstWeekdayOfMonth()},numberOfDays:function(){return this.date.getNumberOfDaysInMonth()},selectedMonth:function(){return this.date.getMonth()},selectedMonthName:function(){return this.date.getMonthName()},selectedYear:function(){return this.date.getFullYear()}},methods:{prevMonth:function(){this.date=new P(this.selectedYear,this.selectedMonth-1,1)},nextMonth:function(){this.date=new P(this.selectedYear,this.selectedMonth+1,1)},generateWeekdayNames:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=[\"Sunday\",\"Monday\",\"Tuesday\",\"Wednesday\",\"Thursday\",\"Friday\",\"Saturday\"],n=2;n<=t;n++){var r=e.shift();e.push(r)}return e},selectDay:function(t){this.$emit(\"setDate\",{iso:t.toISOString(),timeZoneOffset:t.getTimezoneOffset()})},isSelected:function(t){return!!this.selectedDate&&t.toDateString()===new P(this.selectedDate).toDateString()}},props:{initialDate:{type:String,default:null},selectedDate:{type:String,default:null},firstDayOfWeek:{type:Number,default:1},offDays:{type:Array,default:function(){return[1,7]}}},beforeMount:function(){this.date=Date.parse(this.initialDate)?new P(this.initialDate):new P,this.weekdays=this.generateWeekdayNames(this.firstDayOfWeek)}},G=Y,V=(n(\"5f00\"),I(G,R,W,!1,null,\"0e5943d9\",null)),$=V.exports;n.d(e,\"Calendar\",(function(){return L})),n.d(e,\"DatePicker\",(function(){return $}))},fdef:function(t,e){t.exports=\"\\t\\n\\v\\f\\r \\u2028\\u2029\\ufeff\"}})}));\n//# sourceMappingURL=SweetCalendar.umd.min.js.map","module.exports = __webpack_public_path__ + \"img/subjects.3fabf3a0.png\";","import mod from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--6-oneOf-1-0!../../../node_modules/@vue/cli-service/node_modules/css-loader/dist/cjs.js??ref--6-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--6-oneOf-1-2!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./MTTutorProfile.vue?vue&type=style&index=0&id=2cab40d3&scoped=true&lang=css&\"; export default mod; export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--6-oneOf-1-0!../../../node_modules/@vue/cli-service/node_modules/css-loader/dist/cjs.js??ref--6-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--6-oneOf-1-2!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./MTTutorProfile.vue?vue&type=style&index=0&id=2cab40d3&scoped=true&lang=css&\"","/*!\n * FullCalendar v3.10.1\n * Docs & License: https://fullcalendar.io/\n * (c) 2019 Adam Shaw\n */\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"moment\"), require(\"jquery\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"moment\", \"jquery\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"FullCalendar\"] = factory(require(\"moment\"), require(\"jquery\"));\n\telse\n\t\troot[\"FullCalendar\"] = factory(root[\"moment\"], root[\"jQuery\"]);\n})(typeof self !== 'undefined' ? self : this, function(__WEBPACK_EXTERNAL_MODULE_0__, __WEBPACK_EXTERNAL_MODULE_3__) {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 256);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports) {\n\nmodule.exports = __WEBPACK_EXTERNAL_MODULE_0__;\n\n/***/ }),\n/* 1 */,\n/* 2 */\n/***/ (function(module, exports) {\n\n/*\r\nderived from:\r\nhttps://github.com/Microsoft/tslib/blob/v1.6.0/tslib.js\r\n\nonly include the helpers we need, to keep down filesize\r\n*/\r\nvar extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b)\r\n if (b.hasOwnProperty(p))\r\n d[p] = b[p]; };\r\nexports.__extends = function (d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n};\r\n\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports) {\n\nmodule.exports = __WEBPACK_EXTERNAL_MODULE_3__;\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports, __webpack_require__) {\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar moment = __webpack_require__(0);\r\nvar $ = __webpack_require__(3);\r\n/* FullCalendar-specific DOM Utilities\r\n----------------------------------------------------------------------------------------------------------------------*/\r\n// Given the scrollbar widths of some other container, create borders/margins on rowEls in order to match the left\r\n// and right space that was offset by the scrollbars. A 1-pixel border first, then margin beyond that.\r\nfunction compensateScroll(rowEls, scrollbarWidths) {\r\n if (scrollbarWidths.left) {\r\n rowEls.css({\r\n 'border-left-width': 1,\r\n 'margin-left': scrollbarWidths.left - 1\r\n });\r\n }\r\n if (scrollbarWidths.right) {\r\n rowEls.css({\r\n 'border-right-width': 1,\r\n 'margin-right': scrollbarWidths.right - 1\r\n });\r\n }\r\n}\r\nexports.compensateScroll = compensateScroll;\r\n// Undoes compensateScroll and restores all borders/margins\r\nfunction uncompensateScroll(rowEls) {\r\n rowEls.css({\r\n 'margin-left': '',\r\n 'margin-right': '',\r\n 'border-left-width': '',\r\n 'border-right-width': ''\r\n });\r\n}\r\nexports.uncompensateScroll = uncompensateScroll;\r\n// Make the mouse cursor express that an event is not allowed in the current area\r\nfunction disableCursor() {\r\n $('body').addClass('fc-not-allowed');\r\n}\r\nexports.disableCursor = disableCursor;\r\n// Returns the mouse cursor to its original look\r\nfunction enableCursor() {\r\n $('body').removeClass('fc-not-allowed');\r\n}\r\nexports.enableCursor = enableCursor;\r\n// Given a total available height to fill, have `els` (essentially child rows) expand to accomodate.\r\n// By default, all elements that are shorter than the recommended height are expanded uniformly, not considering\r\n// any other els that are already too tall. if `shouldRedistribute` is on, it considers these tall rows and\r\n// reduces the available height.\r\nfunction distributeHeight(els, availableHeight, shouldRedistribute) {\r\n // *FLOORING NOTE*: we floor in certain places because zoom can give inaccurate floating-point dimensions,\r\n // and it is better to be shorter than taller, to avoid creating unnecessary scrollbars.\r\n var minOffset1 = Math.floor(availableHeight / els.length); // for non-last element\r\n var minOffset2 = Math.floor(availableHeight - minOffset1 * (els.length - 1)); // for last element *FLOORING NOTE*\r\n var flexEls = []; // elements that are allowed to expand. array of DOM nodes\r\n var flexOffsets = []; // amount of vertical space it takes up\r\n var flexHeights = []; // actual css height\r\n var usedHeight = 0;\r\n undistributeHeight(els); // give all elements their natural height\r\n // find elements that are below the recommended height (expandable).\r\n // important to query for heights in a single first pass (to avoid reflow oscillation).\r\n els.each(function (i, el) {\r\n var minOffset = i === els.length - 1 ? minOffset2 : minOffset1;\r\n var naturalOffset = $(el).outerHeight(true);\r\n if (naturalOffset < minOffset) {\r\n flexEls.push(el);\r\n flexOffsets.push(naturalOffset);\r\n flexHeights.push($(el).height());\r\n }\r\n else {\r\n // this element stretches past recommended height (non-expandable). mark the space as occupied.\r\n usedHeight += naturalOffset;\r\n }\r\n });\r\n // readjust the recommended height to only consider the height available to non-maxed-out rows.\r\n if (shouldRedistribute) {\r\n availableHeight -= usedHeight;\r\n minOffset1 = Math.floor(availableHeight / flexEls.length);\r\n minOffset2 = Math.floor(availableHeight - minOffset1 * (flexEls.length - 1)); // *FLOORING NOTE*\r\n }\r\n // assign heights to all expandable elements\r\n $(flexEls).each(function (i, el) {\r\n var minOffset = i === flexEls.length - 1 ? minOffset2 : minOffset1;\r\n var naturalOffset = flexOffsets[i];\r\n var naturalHeight = flexHeights[i];\r\n var newHeight = minOffset - (naturalOffset - naturalHeight); // subtract the margin/padding\r\n if (naturalOffset < minOffset) { // we check this again because redistribution might have changed things\r\n $(el).height(newHeight);\r\n }\r\n });\r\n}\r\nexports.distributeHeight = distributeHeight;\r\n// Undoes distrubuteHeight, restoring all els to their natural height\r\nfunction undistributeHeight(els) {\r\n els.height('');\r\n}\r\nexports.undistributeHeight = undistributeHeight;\r\n// Given `els`, a jQuery set of cells, find the cell with the largest natural width and set the widths of all the\r\n// cells to be that width.\r\n// PREREQUISITE: if you want a cell to take up width, it needs to have a single inner element w/ display:inline\r\nfunction matchCellWidths(els) {\r\n var maxInnerWidth = 0;\r\n els.find('> *').each(function (i, innerEl) {\r\n var innerWidth = $(innerEl).outerWidth();\r\n if (innerWidth > maxInnerWidth) {\r\n maxInnerWidth = innerWidth;\r\n }\r\n });\r\n maxInnerWidth++; // sometimes not accurate of width the text needs to stay on one line. insurance\r\n els.width(maxInnerWidth);\r\n return maxInnerWidth;\r\n}\r\nexports.matchCellWidths = matchCellWidths;\r\n// Given one element that resides inside another,\r\n// Subtracts the height of the inner element from the outer element.\r\nfunction subtractInnerElHeight(outerEl, innerEl) {\r\n var both = outerEl.add(innerEl);\r\n var diff;\r\n // effin' IE8/9/10/11 sometimes returns 0 for dimensions. this weird hack was the only thing that worked\r\n both.css({\r\n position: 'relative',\r\n left: -1 // ensure reflow in case the el was already relative. negative is less likely to cause new scroll\r\n });\r\n diff = outerEl.outerHeight() - innerEl.outerHeight(); // grab the dimensions\r\n both.css({ position: '', left: '' }); // undo hack\r\n return diff;\r\n}\r\nexports.subtractInnerElHeight = subtractInnerElHeight;\r\n/* Element Geom Utilities\r\n----------------------------------------------------------------------------------------------------------------------*/\r\n// borrowed from https://github.com/jquery/jquery-ui/blob/1.11.0/ui/core.js#L51\r\nfunction getScrollParent(el) {\r\n var position = el.css('position');\r\n var scrollParent = el.parents().filter(function () {\r\n var parent = $(this);\r\n return (/(auto|scroll)/).test(parent.css('overflow') + parent.css('overflow-y') + parent.css('overflow-x'));\r\n }).eq(0);\r\n return position === 'fixed' || !scrollParent.length ? $(el[0].ownerDocument || document) : scrollParent;\r\n}\r\nexports.getScrollParent = getScrollParent;\r\n// Queries the outer bounding area of a jQuery element.\r\n// Returns a rectangle with absolute coordinates: left, right (exclusive), top, bottom (exclusive).\r\n// Origin is optional.\r\nfunction getOuterRect(el, origin) {\r\n var offset = el.offset();\r\n var left = offset.left - (origin ? origin.left : 0);\r\n var top = offset.top - (origin ? origin.top : 0);\r\n return {\r\n left: left,\r\n right: left + el.outerWidth(),\r\n top: top,\r\n bottom: top + el.outerHeight()\r\n };\r\n}\r\nexports.getOuterRect = getOuterRect;\r\n// Queries the area within the margin/border/scrollbars of a jQuery element. Does not go within the padding.\r\n// Returns a rectangle with absolute coordinates: left, right (exclusive), top, bottom (exclusive).\r\n// Origin is optional.\r\n// WARNING: given element can't have borders\r\n// NOTE: should use clientLeft/clientTop, but very unreliable cross-browser.\r\nfunction getClientRect(el, origin) {\r\n var offset = el.offset();\r\n var scrollbarWidths = getScrollbarWidths(el);\r\n var left = offset.left + getCssFloat(el, 'border-left-width') + scrollbarWidths.left - (origin ? origin.left : 0);\r\n var top = offset.top + getCssFloat(el, 'border-top-width') + scrollbarWidths.top - (origin ? origin.top : 0);\r\n return {\r\n left: left,\r\n right: left + el[0].clientWidth,\r\n top: top,\r\n bottom: top + el[0].clientHeight // clientHeight includes padding but NOT scrollbars\r\n };\r\n}\r\nexports.getClientRect = getClientRect;\r\n// Queries the area within the margin/border/padding of a jQuery element. Assumed not to have scrollbars.\r\n// Returns a rectangle with absolute coordinates: left, right (exclusive), top, bottom (exclusive).\r\n// Origin is optional.\r\nfunction getContentRect(el, origin) {\r\n var offset = el.offset(); // just outside of border, margin not included\r\n var left = offset.left + getCssFloat(el, 'border-left-width') + getCssFloat(el, 'padding-left') -\r\n (origin ? origin.left : 0);\r\n var top = offset.top + getCssFloat(el, 'border-top-width') + getCssFloat(el, 'padding-top') -\r\n (origin ? origin.top : 0);\r\n return {\r\n left: left,\r\n right: left + el.width(),\r\n top: top,\r\n bottom: top + el.height()\r\n };\r\n}\r\nexports.getContentRect = getContentRect;\r\n// Returns the computed left/right/top/bottom scrollbar widths for the given jQuery element.\r\n// WARNING: given element can't have borders (which will cause offsetWidth/offsetHeight to be larger).\r\n// NOTE: should use clientLeft/clientTop, but very unreliable cross-browser.\r\nfunction getScrollbarWidths(el) {\r\n var leftRightWidth = el[0].offsetWidth - el[0].clientWidth;\r\n var bottomWidth = el[0].offsetHeight - el[0].clientHeight;\r\n var widths;\r\n leftRightWidth = sanitizeScrollbarWidth(leftRightWidth);\r\n bottomWidth = sanitizeScrollbarWidth(bottomWidth);\r\n widths = { left: 0, right: 0, top: 0, bottom: bottomWidth };\r\n if (getIsLeftRtlScrollbars() && el.css('direction') === 'rtl') { // is the scrollbar on the left side?\r\n widths.left = leftRightWidth;\r\n }\r\n else {\r\n widths.right = leftRightWidth;\r\n }\r\n return widths;\r\n}\r\nexports.getScrollbarWidths = getScrollbarWidths;\r\n// The scrollbar width computations in getScrollbarWidths are sometimes flawed when it comes to\r\n// retina displays, rounding, and IE11. Massage them into a usable value.\r\nfunction sanitizeScrollbarWidth(width) {\r\n width = Math.max(0, width); // no negatives\r\n width = Math.round(width);\r\n return width;\r\n}\r\n// Logic for determining if, when the element is right-to-left, the scrollbar appears on the left side\r\nvar _isLeftRtlScrollbars = null;\r\nfunction getIsLeftRtlScrollbars() {\r\n if (_isLeftRtlScrollbars === null) {\r\n _isLeftRtlScrollbars = computeIsLeftRtlScrollbars();\r\n }\r\n return _isLeftRtlScrollbars;\r\n}\r\nfunction computeIsLeftRtlScrollbars() {\r\n var el = $('')\r\n .css({\r\n position: 'absolute',\r\n top: -1000,\r\n left: 0,\r\n border: 0,\r\n padding: 0,\r\n overflow: 'scroll',\r\n direction: 'rtl'\r\n })\r\n .appendTo('body');\r\n var innerEl = el.children();\r\n var res = innerEl.offset().left > el.offset().left; // is the inner div shifted to accommodate a left scrollbar?\r\n el.remove();\r\n return res;\r\n}\r\n// Retrieves a jQuery element's computed CSS value as a floating-point number.\r\n// If the queried value is non-numeric (ex: IE can return \"medium\" for border width), will just return zero.\r\nfunction getCssFloat(el, prop) {\r\n return parseFloat(el.css(prop)) || 0;\r\n}\r\n/* Mouse / Touch Utilities\r\n----------------------------------------------------------------------------------------------------------------------*/\r\n// Returns a boolean whether this was a left mouse click and no ctrl key (which means right click on Mac)\r\nfunction isPrimaryMouseButton(ev) {\r\n return ev.which === 1 && !ev.ctrlKey;\r\n}\r\nexports.isPrimaryMouseButton = isPrimaryMouseButton;\r\nfunction getEvX(ev) {\r\n var touches = ev.originalEvent.touches;\r\n // on mobile FF, pageX for touch events is present, but incorrect,\r\n // so, look at touch coordinates first.\r\n if (touches && touches.length) {\r\n return touches[0].pageX;\r\n }\r\n return ev.pageX;\r\n}\r\nexports.getEvX = getEvX;\r\nfunction getEvY(ev) {\r\n var touches = ev.originalEvent.touches;\r\n // on mobile FF, pageX for touch events is present, but incorrect,\r\n // so, look at touch coordinates first.\r\n if (touches && touches.length) {\r\n return touches[0].pageY;\r\n }\r\n return ev.pageY;\r\n}\r\nexports.getEvY = getEvY;\r\nfunction getEvIsTouch(ev) {\r\n return /^touch/.test(ev.type);\r\n}\r\nexports.getEvIsTouch = getEvIsTouch;\r\nfunction preventSelection(el) {\r\n el.addClass('fc-unselectable')\r\n .on('selectstart', preventDefault);\r\n}\r\nexports.preventSelection = preventSelection;\r\nfunction allowSelection(el) {\r\n el.removeClass('fc-unselectable')\r\n .off('selectstart', preventDefault);\r\n}\r\nexports.allowSelection = allowSelection;\r\n// Stops a mouse/touch event from doing it's native browser action\r\nfunction preventDefault(ev) {\r\n ev.preventDefault();\r\n}\r\nexports.preventDefault = preventDefault;\r\n/* General Geometry Utils\r\n----------------------------------------------------------------------------------------------------------------------*/\r\n// Returns a new rectangle that is the intersection of the two rectangles. If they don't intersect, returns false\r\nfunction intersectRects(rect1, rect2) {\r\n var res = {\r\n left: Math.max(rect1.left, rect2.left),\r\n right: Math.min(rect1.right, rect2.right),\r\n top: Math.max(rect1.top, rect2.top),\r\n bottom: Math.min(rect1.bottom, rect2.bottom)\r\n };\r\n if (res.left < res.right && res.top < res.bottom) {\r\n return res;\r\n }\r\n return false;\r\n}\r\nexports.intersectRects = intersectRects;\r\n// Returns a new point that will have been moved to reside within the given rectangle\r\nfunction constrainPoint(point, rect) {\r\n return {\r\n left: Math.min(Math.max(point.left, rect.left), rect.right),\r\n top: Math.min(Math.max(point.top, rect.top), rect.bottom)\r\n };\r\n}\r\nexports.constrainPoint = constrainPoint;\r\n// Returns a point that is the center of the given rectangle\r\nfunction getRectCenter(rect) {\r\n return {\r\n left: (rect.left + rect.right) / 2,\r\n top: (rect.top + rect.bottom) / 2\r\n };\r\n}\r\nexports.getRectCenter = getRectCenter;\r\n// Subtracts point2's coordinates from point1's coordinates, returning a delta\r\nfunction diffPoints(point1, point2) {\r\n return {\r\n left: point1.left - point2.left,\r\n top: point1.top - point2.top\r\n };\r\n}\r\nexports.diffPoints = diffPoints;\r\n/* Object Ordering by Field\r\n----------------------------------------------------------------------------------------------------------------------*/\r\nfunction parseFieldSpecs(input) {\r\n var specs = [];\r\n var tokens = [];\r\n var i;\r\n var token;\r\n if (typeof input === 'string') {\r\n tokens = input.split(/\\s*,\\s*/);\r\n }\r\n else if (typeof input === 'function') {\r\n tokens = [input];\r\n }\r\n else if ($.isArray(input)) {\r\n tokens = input;\r\n }\r\n for (i = 0; i < tokens.length; i++) {\r\n token = tokens[i];\r\n if (typeof token === 'string') {\r\n specs.push(token.charAt(0) === '-' ?\r\n { field: token.substring(1), order: -1 } :\r\n { field: token, order: 1 });\r\n }\r\n else if (typeof token === 'function') {\r\n specs.push({ func: token });\r\n }\r\n }\r\n return specs;\r\n}\r\nexports.parseFieldSpecs = parseFieldSpecs;\r\nfunction compareByFieldSpecs(obj1, obj2, fieldSpecs, obj1fallback, obj2fallback) {\r\n var i;\r\n var cmp;\r\n for (i = 0; i < fieldSpecs.length; i++) {\r\n cmp = compareByFieldSpec(obj1, obj2, fieldSpecs[i], obj1fallback, obj2fallback);\r\n if (cmp) {\r\n return cmp;\r\n }\r\n }\r\n return 0;\r\n}\r\nexports.compareByFieldSpecs = compareByFieldSpecs;\r\nfunction compareByFieldSpec(obj1, obj2, fieldSpec, obj1fallback, obj2fallback) {\r\n if (fieldSpec.func) {\r\n return fieldSpec.func(obj1, obj2);\r\n }\r\n var val1 = obj1[fieldSpec.field];\r\n var val2 = obj2[fieldSpec.field];\r\n if (val1 == null && obj1fallback) {\r\n val1 = obj1fallback[fieldSpec.field];\r\n }\r\n if (val2 == null && obj2fallback) {\r\n val2 = obj2fallback[fieldSpec.field];\r\n }\r\n return flexibleCompare(val1, val2) * (fieldSpec.order || 1);\r\n}\r\nexports.compareByFieldSpec = compareByFieldSpec;\r\nfunction flexibleCompare(a, b) {\r\n if (!a && !b) {\r\n return 0;\r\n }\r\n if (b == null) {\r\n return -1;\r\n }\r\n if (a == null) {\r\n return 1;\r\n }\r\n if ($.type(a) === 'string' || $.type(b) === 'string') {\r\n return String(a).localeCompare(String(b));\r\n }\r\n return a - b;\r\n}\r\nexports.flexibleCompare = flexibleCompare;\r\n/* Date Utilities\r\n----------------------------------------------------------------------------------------------------------------------*/\r\nexports.dayIDs = ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'];\r\nexports.unitsDesc = ['year', 'month', 'week', 'day', 'hour', 'minute', 'second', 'millisecond']; // descending\r\n// Diffs the two moments into a Duration where full-days are recorded first, then the remaining time.\r\n// Moments will have their timezones normalized.\r\nfunction diffDayTime(a, b) {\r\n return moment.duration({\r\n days: a.clone().stripTime().diff(b.clone().stripTime(), 'days'),\r\n ms: a.time() - b.time() // time-of-day from day start. disregards timezone\r\n });\r\n}\r\nexports.diffDayTime = diffDayTime;\r\n// Diffs the two moments via their start-of-day (regardless of timezone). Produces whole-day durations.\r\nfunction diffDay(a, b) {\r\n return moment.duration({\r\n days: a.clone().stripTime().diff(b.clone().stripTime(), 'days')\r\n });\r\n}\r\nexports.diffDay = diffDay;\r\n// Diffs two moments, producing a duration, made of a whole-unit-increment of the given unit. Uses rounding.\r\nfunction diffByUnit(a, b, unit) {\r\n return moment.duration(Math.round(a.diff(b, unit, true)), // returnFloat=true\r\n unit);\r\n}\r\nexports.diffByUnit = diffByUnit;\r\n// Computes the unit name of the largest whole-unit period of time.\r\n// For example, 48 hours will be \"days\" whereas 49 hours will be \"hours\".\r\n// Accepts start/end, a range object, or an original duration object.\r\nfunction computeGreatestUnit(start, end) {\r\n var i;\r\n var unit;\r\n var val;\r\n for (i = 0; i < exports.unitsDesc.length; i++) {\r\n unit = exports.unitsDesc[i];\r\n val = computeRangeAs(unit, start, end);\r\n if (val >= 1 && isInt(val)) {\r\n break;\r\n }\r\n }\r\n return unit; // will be \"milliseconds\" if nothing else matches\r\n}\r\nexports.computeGreatestUnit = computeGreatestUnit;\r\n// like computeGreatestUnit, but has special abilities to interpret the source input for clues\r\nfunction computeDurationGreatestUnit(duration, durationInput) {\r\n var unit = computeGreatestUnit(duration);\r\n // prevent days:7 from being interpreted as a week\r\n if (unit === 'week' && typeof durationInput === 'object' && durationInput.days) {\r\n unit = 'day';\r\n }\r\n return unit;\r\n}\r\nexports.computeDurationGreatestUnit = computeDurationGreatestUnit;\r\n// Computes the number of units (like \"hours\") in the given range.\r\n// Range can be a {start,end} object, separate start/end args, or a Duration.\r\n// Results are based on Moment's .as() and .diff() methods, so results can depend on internal handling\r\n// of month-diffing logic (which tends to vary from version to version).\r\nfunction computeRangeAs(unit, start, end) {\r\n if (end != null) { // given start, end\r\n return end.diff(start, unit, true);\r\n }\r\n else if (moment.isDuration(start)) { // given duration\r\n return start.as(unit);\r\n }\r\n else { // given { start, end } range object\r\n return start.end.diff(start.start, unit, true);\r\n }\r\n}\r\n// Intelligently divides a range (specified by a start/end params) by a duration\r\nfunction divideRangeByDuration(start, end, dur) {\r\n var months;\r\n if (durationHasTime(dur)) {\r\n return (end - start) / dur;\r\n }\r\n months = dur.asMonths();\r\n if (Math.abs(months) >= 1 && isInt(months)) {\r\n return end.diff(start, 'months', true) / months;\r\n }\r\n return end.diff(start, 'days', true) / dur.asDays();\r\n}\r\nexports.divideRangeByDuration = divideRangeByDuration;\r\n// Intelligently divides one duration by another\r\nfunction divideDurationByDuration(dur1, dur2) {\r\n var months1;\r\n var months2;\r\n if (durationHasTime(dur1) || durationHasTime(dur2)) {\r\n return dur1 / dur2;\r\n }\r\n months1 = dur1.asMonths();\r\n months2 = dur2.asMonths();\r\n if (Math.abs(months1) >= 1 && isInt(months1) &&\r\n Math.abs(months2) >= 1 && isInt(months2)) {\r\n return months1 / months2;\r\n }\r\n return dur1.asDays() / dur2.asDays();\r\n}\r\nexports.divideDurationByDuration = divideDurationByDuration;\r\n// Intelligently multiplies a duration by a number\r\nfunction multiplyDuration(dur, n) {\r\n var months;\r\n if (durationHasTime(dur)) {\r\n return moment.duration(dur * n);\r\n }\r\n months = dur.asMonths();\r\n if (Math.abs(months) >= 1 && isInt(months)) {\r\n return moment.duration({ months: months * n });\r\n }\r\n return moment.duration({ days: dur.asDays() * n });\r\n}\r\nexports.multiplyDuration = multiplyDuration;\r\n// Returns a boolean about whether the given duration has any time parts (hours/minutes/seconds/ms)\r\nfunction durationHasTime(dur) {\r\n return Boolean(dur.hours() || dur.minutes() || dur.seconds() || dur.milliseconds());\r\n}\r\nexports.durationHasTime = durationHasTime;\r\nfunction isNativeDate(input) {\r\n return Object.prototype.toString.call(input) === '[object Date]' || input instanceof Date;\r\n}\r\nexports.isNativeDate = isNativeDate;\r\n// Returns a boolean about whether the given input is a time string, like \"06:40:00\" or \"06:00\"\r\nfunction isTimeString(str) {\r\n return typeof str === 'string' &&\r\n /^\\d+\\:\\d+(?:\\:\\d+\\.?(?:\\d{3})?)?$/.test(str);\r\n}\r\nexports.isTimeString = isTimeString;\r\n/* Logging and Debug\r\n----------------------------------------------------------------------------------------------------------------------*/\r\nfunction log() {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n var console = window.console;\r\n if (console && console.log) {\r\n return console.log.apply(console, args);\r\n }\r\n}\r\nexports.log = log;\r\nfunction warn() {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n var console = window.console;\r\n if (console && console.warn) {\r\n return console.warn.apply(console, args);\r\n }\r\n else {\r\n return log.apply(null, args);\r\n }\r\n}\r\nexports.warn = warn;\r\n/* General Utilities\r\n----------------------------------------------------------------------------------------------------------------------*/\r\nvar hasOwnPropMethod = {}.hasOwnProperty;\r\n// Merges an array of objects into a single object.\r\n// The second argument allows for an array of property names who's object values will be merged together.\r\nfunction mergeProps(propObjs, complexProps) {\r\n var dest = {};\r\n var i;\r\n var name;\r\n var complexObjs;\r\n var j;\r\n var val;\r\n var props;\r\n if (complexProps) {\r\n for (i = 0; i < complexProps.length; i++) {\r\n name = complexProps[i];\r\n complexObjs = [];\r\n // collect the trailing object values, stopping when a non-object is discovered\r\n for (j = propObjs.length - 1; j >= 0; j--) {\r\n val = propObjs[j][name];\r\n if (typeof val === 'object') {\r\n complexObjs.unshift(val);\r\n }\r\n else if (val !== undefined) {\r\n dest[name] = val; // if there were no objects, this value will be used\r\n break;\r\n }\r\n }\r\n // if the trailing values were objects, use the merged value\r\n if (complexObjs.length) {\r\n dest[name] = mergeProps(complexObjs);\r\n }\r\n }\r\n }\r\n // copy values into the destination, going from last to first\r\n for (i = propObjs.length - 1; i >= 0; i--) {\r\n props = propObjs[i];\r\n for (name in props) {\r\n if (!(name in dest)) { // if already assigned by previous props or complex props, don't reassign\r\n dest[name] = props[name];\r\n }\r\n }\r\n }\r\n return dest;\r\n}\r\nexports.mergeProps = mergeProps;\r\nfunction copyOwnProps(src, dest) {\r\n for (var name_1 in src) {\r\n if (hasOwnProp(src, name_1)) {\r\n dest[name_1] = src[name_1];\r\n }\r\n }\r\n}\r\nexports.copyOwnProps = copyOwnProps;\r\nfunction hasOwnProp(obj, name) {\r\n return hasOwnPropMethod.call(obj, name);\r\n}\r\nexports.hasOwnProp = hasOwnProp;\r\nfunction applyAll(functions, thisObj, args) {\r\n if ($.isFunction(functions)) {\r\n functions = [functions];\r\n }\r\n if (functions) {\r\n var i = void 0;\r\n var ret = void 0;\r\n for (i = 0; i < functions.length; i++) {\r\n ret = functions[i].apply(thisObj, args) || ret;\r\n }\r\n return ret;\r\n }\r\n}\r\nexports.applyAll = applyAll;\r\nfunction removeMatching(array, testFunc) {\r\n var removeCnt = 0;\r\n var i = 0;\r\n while (i < array.length) {\r\n if (testFunc(array[i])) { // truthy value means *remove*\r\n array.splice(i, 1);\r\n removeCnt++;\r\n }\r\n else {\r\n i++;\r\n }\r\n }\r\n return removeCnt;\r\n}\r\nexports.removeMatching = removeMatching;\r\nfunction removeExact(array, exactVal) {\r\n var removeCnt = 0;\r\n var i = 0;\r\n while (i < array.length) {\r\n if (array[i] === exactVal) {\r\n array.splice(i, 1);\r\n removeCnt++;\r\n }\r\n else {\r\n i++;\r\n }\r\n }\r\n return removeCnt;\r\n}\r\nexports.removeExact = removeExact;\r\nfunction isArraysEqual(a0, a1) {\r\n var len = a0.length;\r\n var i;\r\n if (len == null || len !== a1.length) { // not array? or not same length?\r\n return false;\r\n }\r\n for (i = 0; i < len; i++) {\r\n if (a0[i] !== a1[i]) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n}\r\nexports.isArraysEqual = isArraysEqual;\r\nfunction firstDefined() {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n for (var i = 0; i < args.length; i++) {\r\n if (args[i] !== undefined) {\r\n return args[i];\r\n }\r\n }\r\n}\r\nexports.firstDefined = firstDefined;\r\nfunction htmlEscape(s) {\r\n return (s + '').replace(/&/g, '&')\r\n .replace(//g, '>')\r\n .replace(/'/g, ''')\r\n .replace(/\"/g, '"')\r\n .replace(/\\n/g, ' ');\r\n}\r\nexports.htmlEscape = htmlEscape;\r\nfunction stripHtmlEntities(text) {\r\n return text.replace(/&.*?;/g, '');\r\n}\r\nexports.stripHtmlEntities = stripHtmlEntities;\r\n// Given a hash of CSS properties, returns a string of CSS.\r\n// Uses property names as-is (no camel-case conversion). Will not make statements for null/undefined values.\r\nfunction cssToStr(cssProps) {\r\n var statements = [];\r\n $.each(cssProps, function (name, val) {\r\n if (val != null) {\r\n statements.push(name + ':' + val);\r\n }\r\n });\r\n return statements.join(';');\r\n}\r\nexports.cssToStr = cssToStr;\r\n// Given an object hash of HTML attribute names to values,\r\n// generates a string that can be injected between < > in HTML\r\nfunction attrsToStr(attrs) {\r\n var parts = [];\r\n $.each(attrs, function (name, val) {\r\n if (val != null) {\r\n parts.push(name + '=\"' + htmlEscape(val) + '\"');\r\n }\r\n });\r\n return parts.join(' ');\r\n}\r\nexports.attrsToStr = attrsToStr;\r\nfunction capitaliseFirstLetter(str) {\r\n return str.charAt(0).toUpperCase() + str.slice(1);\r\n}\r\nexports.capitaliseFirstLetter = capitaliseFirstLetter;\r\nfunction compareNumbers(a, b) {\r\n return a - b;\r\n}\r\nexports.compareNumbers = compareNumbers;\r\nfunction isInt(n) {\r\n return n % 1 === 0;\r\n}\r\nexports.isInt = isInt;\r\n// Returns a method bound to the given object context.\r\n// Just like one of the jQuery.proxy signatures, but without the undesired behavior of treating the same method with\r\n// different contexts as identical when binding/unbinding events.\r\nfunction proxy(obj, methodName) {\r\n var method = obj[methodName];\r\n return function () {\r\n return method.apply(obj, arguments);\r\n };\r\n}\r\nexports.proxy = proxy;\r\n// Returns a function, that, as long as it continues to be invoked, will not\r\n// be triggered. The function will be called after it stops being called for\r\n// N milliseconds. If `immediate` is passed, trigger the function on the\r\n// leading edge, instead of the trailing.\r\n// https://github.com/jashkenas/underscore/blob/1.6.0/underscore.js#L714\r\nfunction debounce(func, wait, immediate) {\r\n if (immediate === void 0) { immediate = false; }\r\n var timeout;\r\n var args;\r\n var context;\r\n var timestamp;\r\n var result;\r\n var later = function () {\r\n var last = +new Date() - timestamp;\r\n if (last < wait) {\r\n timeout = setTimeout(later, wait - last);\r\n }\r\n else {\r\n timeout = null;\r\n if (!immediate) {\r\n result = func.apply(context, args);\r\n context = args = null;\r\n }\r\n }\r\n };\r\n return function () {\r\n context = this;\r\n args = arguments;\r\n timestamp = +new Date();\r\n var callNow = immediate && !timeout;\r\n if (!timeout) {\r\n timeout = setTimeout(later, wait);\r\n }\r\n if (callNow) {\r\n result = func.apply(context, args);\r\n context = args = null;\r\n }\r\n return result;\r\n };\r\n}\r\nexports.debounce = debounce;\r\n\n\n/***/ }),\n/* 5 */\n/***/ (function(module, exports, __webpack_require__) {\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar moment = __webpack_require__(0);\r\nvar moment_ext_1 = __webpack_require__(11);\r\nvar UnzonedRange = /** @class */ (function () {\r\n function UnzonedRange(startInput, endInput) {\r\n // TODO: move these into footprint.\r\n // Especially, doesn't make sense for null startMs/endMs.\r\n this.isStart = true;\r\n this.isEnd = true;\r\n if (moment.isMoment(startInput)) {\r\n startInput = startInput.clone().stripZone();\r\n }\r\n if (moment.isMoment(endInput)) {\r\n endInput = endInput.clone().stripZone();\r\n }\r\n if (startInput) {\r\n this.startMs = startInput.valueOf();\r\n }\r\n if (endInput) {\r\n this.endMs = endInput.valueOf();\r\n }\r\n }\r\n /*\r\n SIDEEFFECT: will mutate eventRanges.\r\n Will return a new array result.\r\n Only works for non-open-ended ranges.\r\n */\r\n UnzonedRange.invertRanges = function (ranges, constraintRange) {\r\n var invertedRanges = [];\r\n var startMs = constraintRange.startMs; // the end of the previous range. the start of the new range\r\n var i;\r\n var dateRange;\r\n // ranges need to be in order. required for our date-walking algorithm\r\n ranges.sort(compareUnzonedRanges);\r\n for (i = 0; i < ranges.length; i++) {\r\n dateRange = ranges[i];\r\n // add the span of time before the event (if there is any)\r\n if (dateRange.startMs > startMs) { // compare millisecond time (skip any ambig logic)\r\n invertedRanges.push(new UnzonedRange(startMs, dateRange.startMs));\r\n }\r\n if (dateRange.endMs > startMs) {\r\n startMs = dateRange.endMs;\r\n }\r\n }\r\n // add the span of time after the last event (if there is any)\r\n if (startMs < constraintRange.endMs) { // compare millisecond time (skip any ambig logic)\r\n invertedRanges.push(new UnzonedRange(startMs, constraintRange.endMs));\r\n }\r\n return invertedRanges;\r\n };\r\n UnzonedRange.prototype.intersect = function (otherRange) {\r\n var startMs = this.startMs;\r\n var endMs = this.endMs;\r\n var newRange = null;\r\n if (otherRange.startMs != null) {\r\n if (startMs == null) {\r\n startMs = otherRange.startMs;\r\n }\r\n else {\r\n startMs = Math.max(startMs, otherRange.startMs);\r\n }\r\n }\r\n if (otherRange.endMs != null) {\r\n if (endMs == null) {\r\n endMs = otherRange.endMs;\r\n }\r\n else {\r\n endMs = Math.min(endMs, otherRange.endMs);\r\n }\r\n }\r\n if (startMs == null || endMs == null || startMs < endMs) {\r\n newRange = new UnzonedRange(startMs, endMs);\r\n newRange.isStart = this.isStart && startMs === this.startMs;\r\n newRange.isEnd = this.isEnd && endMs === this.endMs;\r\n }\r\n return newRange;\r\n };\r\n UnzonedRange.prototype.intersectsWith = function (otherRange) {\r\n return (this.endMs == null || otherRange.startMs == null || this.endMs > otherRange.startMs) &&\r\n (this.startMs == null || otherRange.endMs == null || this.startMs < otherRange.endMs);\r\n };\r\n UnzonedRange.prototype.containsRange = function (innerRange) {\r\n return (this.startMs == null || (innerRange.startMs != null && innerRange.startMs >= this.startMs)) &&\r\n (this.endMs == null || (innerRange.endMs != null && innerRange.endMs <= this.endMs));\r\n };\r\n // `date` can be a moment, a Date, or a millisecond time.\r\n UnzonedRange.prototype.containsDate = function (date) {\r\n var ms = date.valueOf();\r\n return (this.startMs == null || ms >= this.startMs) &&\r\n (this.endMs == null || ms < this.endMs);\r\n };\r\n // If the given date is not within the given range, move it inside.\r\n // (If it's past the end, make it one millisecond before the end).\r\n // `date` can be a moment, a Date, or a millisecond time.\r\n // Returns a MS-time.\r\n UnzonedRange.prototype.constrainDate = function (date) {\r\n var ms = date.valueOf();\r\n if (this.startMs != null && ms < this.startMs) {\r\n ms = this.startMs;\r\n }\r\n if (this.endMs != null && ms >= this.endMs) {\r\n ms = this.endMs - 1;\r\n }\r\n return ms;\r\n };\r\n UnzonedRange.prototype.equals = function (otherRange) {\r\n return this.startMs === otherRange.startMs && this.endMs === otherRange.endMs;\r\n };\r\n UnzonedRange.prototype.clone = function () {\r\n var range = new UnzonedRange(this.startMs, this.endMs);\r\n range.isStart = this.isStart;\r\n range.isEnd = this.isEnd;\r\n return range;\r\n };\r\n // Returns an ambig-zoned moment from startMs.\r\n // BEWARE: returned moment is not localized.\r\n // Formatting and start-of-week will be default.\r\n UnzonedRange.prototype.getStart = function () {\r\n if (this.startMs != null) {\r\n return moment_ext_1.default.utc(this.startMs).stripZone();\r\n }\r\n return null;\r\n };\r\n // Returns an ambig-zoned moment from startMs.\r\n // BEWARE: returned moment is not localized.\r\n // Formatting and start-of-week will be default.\r\n UnzonedRange.prototype.getEnd = function () {\r\n if (this.endMs != null) {\r\n return moment_ext_1.default.utc(this.endMs).stripZone();\r\n }\r\n return null;\r\n };\r\n UnzonedRange.prototype.as = function (unit) {\r\n return moment.utc(this.endMs).diff(moment.utc(this.startMs), unit, true);\r\n };\r\n return UnzonedRange;\r\n}());\r\nexports.default = UnzonedRange;\r\n/*\r\nOnly works for non-open-ended ranges.\r\n*/\r\nfunction compareUnzonedRanges(range1, range2) {\r\n return range1.startMs - range2.startMs; // earlier ranges go first\r\n}\r\n\n\n/***/ }),\n/* 6 */\n/***/ (function(module, exports, __webpack_require__) {\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar tslib_1 = __webpack_require__(2);\r\nvar $ = __webpack_require__(3);\r\nvar ParsableModelMixin_1 = __webpack_require__(52);\r\nvar Class_1 = __webpack_require__(35);\r\nvar EventDefParser_1 = __webpack_require__(36);\r\nvar EventSource = /** @class */ (function (_super) {\r\n tslib_1.__extends(EventSource, _super);\r\n // can we do away with calendar? at least for the abstract?\r\n // useful for buildEventDef\r\n function EventSource(calendar) {\r\n var _this = _super.call(this) || this;\r\n _this.calendar = calendar;\r\n _this.className = [];\r\n _this.uid = String(EventSource.uuid++);\r\n return _this;\r\n }\r\n /*\r\n rawInput can be any data type!\r\n */\r\n EventSource.parse = function (rawInput, calendar) {\r\n var source = new this(calendar);\r\n if (typeof rawInput === 'object') {\r\n if (source.applyProps(rawInput)) {\r\n return source;\r\n }\r\n }\r\n return false;\r\n };\r\n EventSource.normalizeId = function (id) {\r\n if (id) {\r\n return String(id);\r\n }\r\n return null;\r\n };\r\n EventSource.prototype.fetch = function (start, end, timezone) {\r\n // subclasses must implement. must return a promise.\r\n };\r\n EventSource.prototype.removeEventDefsById = function (eventDefId) {\r\n // optional for subclasses to implement\r\n };\r\n EventSource.prototype.removeAllEventDefs = function () {\r\n // optional for subclasses to implement\r\n };\r\n /*\r\n For compairing/matching\r\n */\r\n EventSource.prototype.getPrimitive = function (otherSource) {\r\n // subclasses must implement\r\n };\r\n EventSource.prototype.parseEventDefs = function (rawEventDefs) {\r\n var i;\r\n var eventDef;\r\n var eventDefs = [];\r\n for (i = 0; i < rawEventDefs.length; i++) {\r\n eventDef = this.parseEventDef(rawEventDefs[i]);\r\n if (eventDef) {\r\n eventDefs.push(eventDef);\r\n }\r\n }\r\n return eventDefs;\r\n };\r\n EventSource.prototype.parseEventDef = function (rawInput) {\r\n var calendarTransform = this.calendar.opt('eventDataTransform');\r\n var sourceTransform = this.eventDataTransform;\r\n if (calendarTransform) {\r\n rawInput = calendarTransform(rawInput, this.calendar);\r\n }\r\n if (sourceTransform) {\r\n rawInput = sourceTransform(rawInput, this.calendar);\r\n }\r\n return EventDefParser_1.default.parse(rawInput, this);\r\n };\r\n EventSource.prototype.applyManualStandardProps = function (rawProps) {\r\n if (rawProps.id != null) {\r\n this.id = EventSource.normalizeId(rawProps.id);\r\n }\r\n // TODO: converge with EventDef\r\n if ($.isArray(rawProps.className)) {\r\n this.className = rawProps.className;\r\n }\r\n else if (typeof rawProps.className === 'string') {\r\n this.className = rawProps.className.split(/\\s+/);\r\n }\r\n return true;\r\n };\r\n EventSource.uuid = 0;\r\n EventSource.defineStandardProps = ParsableModelMixin_1.default.defineStandardProps;\r\n EventSource.copyVerbatimStandardProps = ParsableModelMixin_1.default.copyVerbatimStandardProps;\r\n return EventSource;\r\n}(Class_1.default));\r\nexports.default = EventSource;\r\nParsableModelMixin_1.default.mixInto(EventSource);\r\n// Parsing\r\n// ---------------------------------------------------------------------------------------------------------------------\r\nEventSource.defineStandardProps({\r\n // manually process...\r\n id: false,\r\n className: false,\r\n // automatically transfer...\r\n color: true,\r\n backgroundColor: true,\r\n borderColor: true,\r\n textColor: true,\r\n editable: true,\r\n startEditable: true,\r\n durationEditable: true,\r\n rendering: true,\r\n overlap: true,\r\n constraint: true,\r\n allDayDefault: true,\r\n eventDataTransform: true\r\n});\r\n\n\n/***/ }),\n/* 7 */\n/***/ (function(module, exports, __webpack_require__) {\n\n/*\r\nUtility methods for easily listening to events on another object,\r\nand more importantly, easily unlistening from them.\r\n\nUSAGE:\r\n import { default as ListenerMixin, ListenerInterface } from './ListenerMixin'\r\nin class:\r\n listenTo: ListenerInterface['listenTo']\r\n stopListeningTo: ListenerInterface['stopListeningTo']\r\nafter class:\r\n ListenerMixin.mixInto(TheClass)\r\n*/\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar tslib_1 = __webpack_require__(2);\r\nvar $ = __webpack_require__(3);\r\nvar Mixin_1 = __webpack_require__(15);\r\nvar guid = 0;\r\nvar ListenerMixin = /** @class */ (function (_super) {\r\n tslib_1.__extends(ListenerMixin, _super);\r\n function ListenerMixin() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n /*\r\n Given an `other` object that has on/off methods, bind the given `callback` to an event by the given name.\r\n The `callback` will be called with the `this` context of the object that .listenTo is being called on.\r\n Can be called:\r\n .listenTo(other, eventName, callback)\r\n OR\r\n .listenTo(other, {\r\n eventName1: callback1,\r\n eventName2: callback2\r\n })\r\n */\r\n ListenerMixin.prototype.listenTo = function (other, arg, callback) {\r\n if (typeof arg === 'object') { // given dictionary of callbacks\r\n for (var eventName in arg) {\r\n if (arg.hasOwnProperty(eventName)) {\r\n this.listenTo(other, eventName, arg[eventName]);\r\n }\r\n }\r\n }\r\n else if (typeof arg === 'string') {\r\n other.on(arg + '.' + this.getListenerNamespace(), // use event namespacing to identify this object\r\n $.proxy(callback, this) // always use `this` context\r\n // the usually-undesired jQuery guid behavior doesn't matter,\r\n // because we always unbind via namespace\r\n );\r\n }\r\n };\r\n /*\r\n Causes the current object to stop listening to events on the `other` object.\r\n `eventName` is optional. If omitted, will stop listening to ALL events on `other`.\r\n */\r\n ListenerMixin.prototype.stopListeningTo = function (other, eventName) {\r\n other.off((eventName || '') + '.' + this.getListenerNamespace());\r\n };\r\n /*\r\n Returns a string, unique to this object, to be used for event namespacing\r\n */\r\n ListenerMixin.prototype.getListenerNamespace = function () {\r\n if (this.listenerId == null) {\r\n this.listenerId = guid++;\r\n }\r\n return '_listener' + this.listenerId;\r\n };\r\n return ListenerMixin;\r\n}(Mixin_1.default));\r\nexports.default = ListenerMixin;\r\n\n\n/***/ }),\n/* 8 */,\n/* 9 */\n/***/ (function(module, exports, __webpack_require__) {\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar tslib_1 = __webpack_require__(2);\r\nvar EventDef_1 = __webpack_require__(37);\r\nvar EventInstance_1 = __webpack_require__(53);\r\nvar EventDateProfile_1 = __webpack_require__(16);\r\nvar SingleEventDef = /** @class */ (function (_super) {\r\n tslib_1.__extends(SingleEventDef, _super);\r\n function SingleEventDef() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n /*\r\n Will receive start/end params, but will be ignored.\r\n */\r\n SingleEventDef.prototype.buildInstances = function () {\r\n return [this.buildInstance()];\r\n };\r\n SingleEventDef.prototype.buildInstance = function () {\r\n return new EventInstance_1.default(this, // definition\r\n this.dateProfile);\r\n };\r\n SingleEventDef.prototype.isAllDay = function () {\r\n return this.dateProfile.isAllDay();\r\n };\r\n SingleEventDef.prototype.clone = function () {\r\n var def = _super.prototype.clone.call(this);\r\n def.dateProfile = this.dateProfile;\r\n return def;\r\n };\r\n SingleEventDef.prototype.rezone = function () {\r\n var calendar = this.source.calendar;\r\n var dateProfile = this.dateProfile;\r\n this.dateProfile = new EventDateProfile_1.default(calendar.moment(dateProfile.start), dateProfile.end ? calendar.moment(dateProfile.end) : null, calendar);\r\n };\r\n /*\r\n NOTE: if super-method fails, should still attempt to apply\r\n */\r\n SingleEventDef.prototype.applyManualStandardProps = function (rawProps) {\r\n var superSuccess = _super.prototype.applyManualStandardProps.call(this, rawProps);\r\n var dateProfile = EventDateProfile_1.default.parse(rawProps, this.source); // returns null on failure\r\n if (dateProfile) {\r\n this.dateProfile = dateProfile;\r\n // make sure `date` shows up in the legacy event objects as-is\r\n if (rawProps.date != null) {\r\n this.miscProps.date = rawProps.date;\r\n }\r\n return superSuccess;\r\n }\r\n else {\r\n return false;\r\n }\r\n };\r\n return SingleEventDef;\r\n}(EventDef_1.default));\r\nexports.default = SingleEventDef;\r\n// Parsing\r\n// ---------------------------------------------------------------------------------------------------------------------\r\nSingleEventDef.defineStandardProps({\r\n start: false,\r\n date: false,\r\n end: false,\r\n allDay: false\r\n});\r\n\n\n/***/ }),\n/* 10 */,\n/* 11 */\n/***/ (function(module, exports, __webpack_require__) {\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar moment = __webpack_require__(0);\r\nvar $ = __webpack_require__(3);\r\nvar util_1 = __webpack_require__(4);\r\nvar ambigDateOfMonthRegex = /^\\s*\\d{4}-\\d\\d$/;\r\nvar ambigTimeOrZoneRegex = /^\\s*\\d{4}-(?:(\\d\\d-\\d\\d)|(W\\d\\d$)|(W\\d\\d-\\d)|(\\d\\d\\d))((T| )(\\d\\d(:\\d\\d(:\\d\\d(\\.\\d+)?)?)?)?)?$/;\r\nvar newMomentProto = moment.fn; // where we will attach our new methods\r\nexports.newMomentProto = newMomentProto;\r\nvar oldMomentProto = $.extend({}, newMomentProto); // copy of original moment methods\r\nexports.oldMomentProto = oldMomentProto;\r\n// tell momentjs to transfer these properties upon clone\r\nvar momentProperties = moment.momentProperties;\r\nmomentProperties.push('_fullCalendar');\r\nmomentProperties.push('_ambigTime');\r\nmomentProperties.push('_ambigZone');\r\n/*\r\nCall this if you want Moment's original format method to be used\r\n*/\r\nfunction oldMomentFormat(mom, formatStr) {\r\n return oldMomentProto.format.call(mom, formatStr); // oldMomentProto defined in moment-ext.js\r\n}\r\nexports.oldMomentFormat = oldMomentFormat;\r\n// Creating\r\n// -------------------------------------------------------------------------------------------------\r\n// Creates a new moment, similar to the vanilla moment(...) constructor, but with\r\n// extra features (ambiguous time, enhanced formatting). When given an existing moment,\r\n// it will function as a clone (and retain the zone of the moment). Anything else will\r\n// result in a moment in the local zone.\r\nvar momentExt = function () {\r\n return makeMoment(arguments);\r\n};\r\nexports.default = momentExt;\r\n// Sames as momentExt, but forces the resulting moment to be in the UTC timezone.\r\nmomentExt.utc = function () {\r\n var mom = makeMoment(arguments, true);\r\n // Force it into UTC because makeMoment doesn't guarantee it\r\n // (if given a pre-existing moment for example)\r\n if (mom.hasTime()) { // don't give ambiguously-timed moments a UTC zone\r\n mom.utc();\r\n }\r\n return mom;\r\n};\r\n// Same as momentExt, but when given an ISO8601 string, the timezone offset is preserved.\r\n// ISO8601 strings with no timezone offset will become ambiguously zoned.\r\nmomentExt.parseZone = function () {\r\n return makeMoment(arguments, true, true);\r\n};\r\n// Builds an enhanced moment from args. When given an existing moment, it clones. When given a\r\n// native Date, or called with no arguments (the current time), the resulting moment will be local.\r\n// Anything else needs to be \"parsed\" (a string or an array), and will be affected by:\r\n// parseAsUTC - if there is no zone information, should we parse the input in UTC?\r\n// parseZone - if there is zone information, should we force the zone of the moment?\r\nfunction makeMoment(args, parseAsUTC, parseZone) {\r\n if (parseAsUTC === void 0) { parseAsUTC = false; }\r\n if (parseZone === void 0) { parseZone = false; }\r\n var input = args[0];\r\n var isSingleString = args.length === 1 && typeof input === 'string';\r\n var isAmbigTime;\r\n var isAmbigZone;\r\n var ambigMatch;\r\n var mom;\r\n if (moment.isMoment(input) || util_1.isNativeDate(input) || input === undefined) {\r\n mom = moment.apply(null, args);\r\n }\r\n else { // \"parsing\" is required\r\n isAmbigTime = false;\r\n isAmbigZone = false;\r\n if (isSingleString) {\r\n if (ambigDateOfMonthRegex.test(input)) {\r\n // accept strings like '2014-05', but convert to the first of the month\r\n input += '-01';\r\n args = [input]; // for when we pass it on to moment's constructor\r\n isAmbigTime = true;\r\n isAmbigZone = true;\r\n }\r\n else if ((ambigMatch = ambigTimeOrZoneRegex.exec(input))) {\r\n isAmbigTime = !ambigMatch[5]; // no time part?\r\n isAmbigZone = true;\r\n }\r\n }\r\n else if ($.isArray(input)) {\r\n // arrays have no timezone information, so assume ambiguous zone\r\n isAmbigZone = true;\r\n }\r\n // otherwise, probably a string with a format\r\n if (parseAsUTC || isAmbigTime) {\r\n mom = moment.utc.apply(moment, args);\r\n }\r\n else {\r\n mom = moment.apply(null, args);\r\n }\r\n if (isAmbigTime) {\r\n mom._ambigTime = true;\r\n mom._ambigZone = true; // ambiguous time always means ambiguous zone\r\n }\r\n else if (parseZone) { // let's record the inputted zone somehow\r\n if (isAmbigZone) {\r\n mom._ambigZone = true;\r\n }\r\n else if (isSingleString) {\r\n mom.utcOffset(input); // if not a valid zone, will assign UTC\r\n }\r\n }\r\n }\r\n mom._fullCalendar = true; // flag for extended functionality\r\n return mom;\r\n}\r\n// Week Number\r\n// -------------------------------------------------------------------------------------------------\r\n// Returns the week number, considering the locale's custom week number calcuation\r\n// `weeks` is an alias for `week`\r\nnewMomentProto.week = newMomentProto.weeks = function (input) {\r\n var weekCalc = this._locale._fullCalendar_weekCalc;\r\n if (input == null && typeof weekCalc === 'function') { // custom function only works for getter\r\n return weekCalc(this);\r\n }\r\n else if (weekCalc === 'ISO') {\r\n return oldMomentProto.isoWeek.apply(this, arguments); // ISO getter/setter\r\n }\r\n return oldMomentProto.week.apply(this, arguments); // local getter/setter\r\n};\r\n// Time-of-day\r\n// -------------------------------------------------------------------------------------------------\r\n// GETTER\r\n// Returns a Duration with the hours/minutes/seconds/ms values of the moment.\r\n// If the moment has an ambiguous time, a duration of 00:00 will be returned.\r\n//\r\n// SETTER\r\n// You can supply a Duration, a Moment, or a Duration-like argument.\r\n// When setting the time, and the moment has an ambiguous time, it then becomes unambiguous.\r\nnewMomentProto.time = function (time) {\r\n // Fallback to the original method (if there is one) if this moment wasn't created via FullCalendar.\r\n // `time` is a generic enough method name where this precaution is necessary to avoid collisions w/ other plugins.\r\n if (!this._fullCalendar) {\r\n return oldMomentProto.time.apply(this, arguments);\r\n }\r\n if (time == null) { // getter\r\n return moment.duration({\r\n hours: this.hours(),\r\n minutes: this.minutes(),\r\n seconds: this.seconds(),\r\n milliseconds: this.milliseconds()\r\n });\r\n }\r\n else { // setter\r\n this._ambigTime = false; // mark that the moment now has a time\r\n if (!moment.isDuration(time) && !moment.isMoment(time)) {\r\n time = moment.duration(time);\r\n }\r\n // The day value should cause overflow (so 24 hours becomes 00:00:00 of next day).\r\n // Only for Duration times, not Moment times.\r\n var dayHours = 0;\r\n if (moment.isDuration(time)) {\r\n dayHours = Math.floor(time.asDays()) * 24;\r\n }\r\n // We need to set the individual fields.\r\n // Can't use startOf('day') then add duration. In case of DST at start of day.\r\n return this.hours(dayHours + time.hours())\r\n .minutes(time.minutes())\r\n .seconds(time.seconds())\r\n .milliseconds(time.milliseconds());\r\n }\r\n};\r\n// Converts the moment to UTC, stripping out its time-of-day and timezone offset,\r\n// but preserving its YMD. A moment with a stripped time will display no time\r\n// nor timezone offset when .format() is called.\r\nnewMomentProto.stripTime = function () {\r\n if (!this._ambigTime) {\r\n this.utc(true); // keepLocalTime=true (for keeping *date* value)\r\n // set time to zero\r\n this.set({\r\n hours: 0,\r\n minutes: 0,\r\n seconds: 0,\r\n ms: 0\r\n });\r\n // Mark the time as ambiguous. This needs to happen after the .utc() call, which might call .utcOffset(),\r\n // which clears all ambig flags.\r\n this._ambigTime = true;\r\n this._ambigZone = true; // if ambiguous time, also ambiguous timezone offset\r\n }\r\n return this; // for chaining\r\n};\r\n// Returns if the moment has a non-ambiguous time (boolean)\r\nnewMomentProto.hasTime = function () {\r\n return !this._ambigTime;\r\n};\r\n// Timezone\r\n// -------------------------------------------------------------------------------------------------\r\n// Converts the moment to UTC, stripping out its timezone offset, but preserving its\r\n// YMD and time-of-day. A moment with a stripped timezone offset will display no\r\n// timezone offset when .format() is called.\r\nnewMomentProto.stripZone = function () {\r\n var wasAmbigTime;\r\n if (!this._ambigZone) {\r\n wasAmbigTime = this._ambigTime;\r\n this.utc(true); // keepLocalTime=true (for keeping date and time values)\r\n // the above call to .utc()/.utcOffset() unfortunately might clear the ambig flags, so restore\r\n this._ambigTime = wasAmbigTime || false;\r\n // Mark the zone as ambiguous. This needs to happen after the .utc() call, which might call .utcOffset(),\r\n // which clears the ambig flags.\r\n this._ambigZone = true;\r\n }\r\n return this; // for chaining\r\n};\r\n// Returns of the moment has a non-ambiguous timezone offset (boolean)\r\nnewMomentProto.hasZone = function () {\r\n return !this._ambigZone;\r\n};\r\n// implicitly marks a zone\r\nnewMomentProto.local = function (keepLocalTime) {\r\n // for when converting from ambiguously-zoned to local,\r\n // keep the time values when converting from UTC -> local\r\n oldMomentProto.local.call(this, this._ambigZone || keepLocalTime);\r\n // ensure non-ambiguous\r\n // this probably already happened via local() -> utcOffset(), but don't rely on Moment's internals\r\n this._ambigTime = false;\r\n this._ambigZone = false;\r\n return this; // for chaining\r\n};\r\n// implicitly marks a zone\r\nnewMomentProto.utc = function (keepLocalTime) {\r\n oldMomentProto.utc.call(this, keepLocalTime);\r\n // ensure non-ambiguous\r\n // this probably already happened via utc() -> utcOffset(), but don't rely on Moment's internals\r\n this._ambigTime = false;\r\n this._ambigZone = false;\r\n return this;\r\n};\r\n// implicitly marks a zone (will probably get called upon .utc() and .local())\r\nnewMomentProto.utcOffset = function (tzo) {\r\n if (tzo != null) { // setter\r\n // these assignments needs to happen before the original zone method is called.\r\n // I forget why, something to do with a browser crash.\r\n this._ambigTime = false;\r\n this._ambigZone = false;\r\n }\r\n return oldMomentProto.utcOffset.apply(this, arguments);\r\n};\r\n\n\n/***/ }),\n/* 12 */\n/***/ (function(module, exports) {\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\n/*\r\nMeant to be immutable\r\n*/\r\nvar ComponentFootprint = /** @class */ (function () {\r\n function ComponentFootprint(unzonedRange, isAllDay) {\r\n this.isAllDay = false; // component can choose to ignore this\r\n this.unzonedRange = unzonedRange;\r\n this.isAllDay = isAllDay;\r\n }\r\n /*\r\n Only works for non-open-ended ranges.\r\n */\r\n ComponentFootprint.prototype.toLegacy = function (calendar) {\r\n return {\r\n start: calendar.msToMoment(this.unzonedRange.startMs, this.isAllDay),\r\n end: calendar.msToMoment(this.unzonedRange.endMs, this.isAllDay)\r\n };\r\n };\r\n return ComponentFootprint;\r\n}());\r\nexports.default = ComponentFootprint;\r\n\n\n/***/ }),\n/* 13 */\n/***/ (function(module, exports, __webpack_require__) {\n\n/*\r\nUSAGE:\r\n import { default as EmitterMixin, EmitterInterface } from './EmitterMixin'\r\nin class:\r\n on: EmitterInterface['on']\r\n one: EmitterInterface['one']\r\n off: EmitterInterface['off']\r\n trigger: EmitterInterface['trigger']\r\n triggerWith: EmitterInterface['triggerWith']\r\n hasHandlers: EmitterInterface['hasHandlers']\r\nafter class:\r\n EmitterMixin.mixInto(TheClass)\r\n*/\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar tslib_1 = __webpack_require__(2);\r\nvar $ = __webpack_require__(3);\r\nvar Mixin_1 = __webpack_require__(15);\r\nvar EmitterMixin = /** @class */ (function (_super) {\r\n tslib_1.__extends(EmitterMixin, _super);\r\n function EmitterMixin() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n // jQuery-ification via $(this) allows a non-DOM object to have\r\n // the same event handling capabilities (including namespaces).\r\n EmitterMixin.prototype.on = function (types, handler) {\r\n $(this).on(types, this._prepareIntercept(handler));\r\n return this; // for chaining\r\n };\r\n EmitterMixin.prototype.one = function (types, handler) {\r\n $(this).one(types, this._prepareIntercept(handler));\r\n return this; // for chaining\r\n };\r\n EmitterMixin.prototype._prepareIntercept = function (handler) {\r\n // handlers are always called with an \"event\" object as their first param.\r\n // sneak the `this` context and arguments into the extra parameter object\r\n // and forward them on to the original handler.\r\n var intercept = function (ev, extra) {\r\n return handler.apply(extra.context || this, extra.args || []);\r\n };\r\n // mimick jQuery's internal \"proxy\" system (risky, I know)\r\n // causing all functions with the same .guid to appear to be the same.\r\n // https://github.com/jquery/jquery/blob/2.2.4/src/core.js#L448\r\n // this is needed for calling .off with the original non-intercept handler.\r\n if (!handler.guid) {\r\n handler.guid = $.guid++;\r\n }\r\n intercept.guid = handler.guid;\r\n return intercept;\r\n };\r\n EmitterMixin.prototype.off = function (types, handler) {\r\n $(this).off(types, handler);\r\n return this; // for chaining\r\n };\r\n EmitterMixin.prototype.trigger = function (types) {\r\n var args = [];\r\n for (var _i = 1; _i < arguments.length; _i++) {\r\n args[_i - 1] = arguments[_i];\r\n }\r\n // pass in \"extra\" info to the intercept\r\n $(this).triggerHandler(types, { args: args });\r\n return this; // for chaining\r\n };\r\n EmitterMixin.prototype.triggerWith = function (types, context, args) {\r\n // `triggerHandler` is less reliant on the DOM compared to `trigger`.\r\n // pass in \"extra\" info to the intercept.\r\n $(this).triggerHandler(types, { context: context, args: args });\r\n return this; // for chaining\r\n };\r\n EmitterMixin.prototype.hasHandlers = function (type) {\r\n var hash = $._data(this, 'events'); // http://blog.jquery.com/2012/08/09/jquery-1-8-released/\r\n return hash && hash[type] && hash[type].length > 0;\r\n };\r\n return EmitterMixin;\r\n}(Mixin_1.default));\r\nexports.default = EmitterMixin;\r\n\n\n/***/ }),\n/* 14 */\n/***/ (function(module, exports) {\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar Interaction = /** @class */ (function () {\r\n function Interaction(component) {\r\n this.view = component._getView();\r\n this.component = component;\r\n }\r\n Interaction.prototype.opt = function (name) {\r\n return this.view.opt(name);\r\n };\r\n Interaction.prototype.end = function () {\r\n // subclasses can implement\r\n };\r\n return Interaction;\r\n}());\r\nexports.default = Interaction;\r\n\n\n/***/ }),\n/* 15 */\n/***/ (function(module, exports) {\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar Mixin = /** @class */ (function () {\r\n function Mixin() {\r\n }\r\n Mixin.mixInto = function (destClass) {\r\n var _this = this;\r\n Object.getOwnPropertyNames(this.prototype).forEach(function (name) {\r\n if (!destClass.prototype[name]) { // if destination class doesn't already define it\r\n destClass.prototype[name] = _this.prototype[name];\r\n }\r\n });\r\n };\r\n /*\r\n will override existing methods\r\n TODO: remove! not used anymore\r\n */\r\n Mixin.mixOver = function (destClass) {\r\n var _this = this;\r\n Object.getOwnPropertyNames(this.prototype).forEach(function (name) {\r\n destClass.prototype[name] = _this.prototype[name];\r\n });\r\n };\r\n return Mixin;\r\n}());\r\nexports.default = Mixin;\r\n\n\n/***/ }),\n/* 16 */\n/***/ (function(module, exports, __webpack_require__) {\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar UnzonedRange_1 = __webpack_require__(5);\r\n/*\r\nMeant to be immutable\r\n*/\r\nvar EventDateProfile = /** @class */ (function () {\r\n function EventDateProfile(start, end, calendar) {\r\n this.start = start;\r\n this.end = end || null;\r\n this.unzonedRange = this.buildUnzonedRange(calendar);\r\n }\r\n /*\r\n Needs an EventSource object\r\n */\r\n EventDateProfile.parse = function (rawProps, source) {\r\n var startInput = rawProps.start || rawProps.date;\r\n var endInput = rawProps.end;\r\n if (!startInput) {\r\n return false;\r\n }\r\n var calendar = source.calendar;\r\n var start = calendar.moment(startInput);\r\n var end = endInput ? calendar.moment(endInput) : null;\r\n var forcedAllDay = rawProps.allDay;\r\n var forceEventDuration = calendar.opt('forceEventDuration');\r\n if (!start.isValid()) {\r\n return false;\r\n }\r\n if (forcedAllDay == null) {\r\n forcedAllDay = source.allDayDefault;\r\n if (forcedAllDay == null) {\r\n forcedAllDay = calendar.opt('allDayDefault');\r\n }\r\n }\r\n if (forcedAllDay === true) {\r\n start.stripTime();\r\n if (end) {\r\n end.stripTime();\r\n }\r\n }\r\n else if (forcedAllDay === false) {\r\n if (!start.hasTime()) {\r\n start.time(0);\r\n }\r\n if (end && !end.hasTime()) {\r\n end.time(0);\r\n }\r\n }\r\n if (end && (!end.isValid() || !end.isAfter(start))) {\r\n end = null;\r\n }\r\n if (!end && forceEventDuration) {\r\n end = calendar.getDefaultEventEnd(!start.hasTime(), start);\r\n }\r\n return new EventDateProfile(start, end, calendar);\r\n };\r\n EventDateProfile.isStandardProp = function (propName) {\r\n return propName === 'start' || propName === 'date' || propName === 'end' || propName === 'allDay';\r\n };\r\n EventDateProfile.prototype.isAllDay = function () {\r\n return !(this.start.hasTime() || (this.end && this.end.hasTime()));\r\n };\r\n /*\r\n Needs a Calendar object\r\n */\r\n EventDateProfile.prototype.buildUnzonedRange = function (calendar) {\r\n var startMs = this.start.clone().stripZone().valueOf();\r\n var endMs = this.getEnd(calendar).stripZone().valueOf();\r\n return new UnzonedRange_1.default(startMs, endMs);\r\n };\r\n /*\r\n Needs a Calendar object\r\n */\r\n EventDateProfile.prototype.getEnd = function (calendar) {\r\n return this.end ?\r\n this.end.clone() :\r\n // derive the end from the start and allDay. compute allDay if necessary\r\n calendar.getDefaultEventEnd(this.isAllDay(), this.start);\r\n };\r\n return EventDateProfile;\r\n}());\r\nexports.default = EventDateProfile;\r\n\n\n/***/ }),\n/* 17 */\n/***/ (function(module, exports, __webpack_require__) {\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar tslib_1 = __webpack_require__(2);\r\nvar util_1 = __webpack_require__(4);\r\nvar DragListener_1 = __webpack_require__(59);\r\n/* Tracks mouse movements over a component and raises events about which hit the mouse is over.\r\n------------------------------------------------------------------------------------------------------------------------\r\noptions:\r\n- subjectEl\r\n- subjectCenter\r\n*/\r\nvar HitDragListener = /** @class */ (function (_super) {\r\n tslib_1.__extends(HitDragListener, _super);\r\n function HitDragListener(component, options) {\r\n var _this = _super.call(this, options) || this;\r\n _this.component = component;\r\n return _this;\r\n }\r\n // Called when drag listening starts (but a real drag has not necessarily began).\r\n // ev might be undefined if dragging was started manually.\r\n HitDragListener.prototype.handleInteractionStart = function (ev) {\r\n var subjectEl = this.subjectEl;\r\n var subjectRect;\r\n var origPoint;\r\n var point;\r\n this.component.hitsNeeded();\r\n this.computeScrollBounds(); // for autoscroll\r\n if (ev) {\r\n origPoint = { left: util_1.getEvX(ev), top: util_1.getEvY(ev) };\r\n point = origPoint;\r\n // constrain the point to bounds of the element being dragged\r\n if (subjectEl) {\r\n subjectRect = util_1.getOuterRect(subjectEl); // used for centering as well\r\n point = util_1.constrainPoint(point, subjectRect);\r\n }\r\n this.origHit = this.queryHit(point.left, point.top);\r\n // treat the center of the subject as the collision point?\r\n if (subjectEl && this.options.subjectCenter) {\r\n // only consider the area the subject overlaps the hit. best for large subjects.\r\n // TODO: skip this if hit didn't supply left/right/top/bottom\r\n if (this.origHit) {\r\n subjectRect = util_1.intersectRects(this.origHit, subjectRect) ||\r\n subjectRect; // in case there is no intersection\r\n }\r\n point = util_1.getRectCenter(subjectRect);\r\n }\r\n this.coordAdjust = util_1.diffPoints(point, origPoint); // point - origPoint\r\n }\r\n else {\r\n this.origHit = null;\r\n this.coordAdjust = null;\r\n }\r\n // call the super-method. do it after origHit has been computed\r\n _super.prototype.handleInteractionStart.call(this, ev);\r\n };\r\n // Called when the actual drag has started\r\n HitDragListener.prototype.handleDragStart = function (ev) {\r\n var hit;\r\n _super.prototype.handleDragStart.call(this, ev);\r\n // might be different from this.origHit if the min-distance is large\r\n hit = this.queryHit(util_1.getEvX(ev), util_1.getEvY(ev));\r\n // report the initial hit the mouse is over\r\n // especially important if no min-distance and drag starts immediately\r\n if (hit) {\r\n this.handleHitOver(hit);\r\n }\r\n };\r\n // Called when the drag moves\r\n HitDragListener.prototype.handleDrag = function (dx, dy, ev) {\r\n var hit;\r\n _super.prototype.handleDrag.call(this, dx, dy, ev);\r\n hit = this.queryHit(util_1.getEvX(ev), util_1.getEvY(ev));\r\n if (!isHitsEqual(hit, this.hit)) { // a different hit than before?\r\n if (this.hit) {\r\n this.handleHitOut();\r\n }\r\n if (hit) {\r\n this.handleHitOver(hit);\r\n }\r\n }\r\n };\r\n // Called when dragging has been stopped\r\n HitDragListener.prototype.handleDragEnd = function (ev) {\r\n this.handleHitDone();\r\n _super.prototype.handleDragEnd.call(this, ev);\r\n };\r\n // Called when a the mouse has just moved over a new hit\r\n HitDragListener.prototype.handleHitOver = function (hit) {\r\n var isOrig = isHitsEqual(hit, this.origHit);\r\n this.hit = hit;\r\n this.trigger('hitOver', this.hit, isOrig, this.origHit);\r\n };\r\n // Called when the mouse has just moved out of a hit\r\n HitDragListener.prototype.handleHitOut = function () {\r\n if (this.hit) {\r\n this.trigger('hitOut', this.hit);\r\n this.handleHitDone();\r\n this.hit = null;\r\n }\r\n };\r\n // Called after a hitOut. Also called before a dragStop\r\n HitDragListener.prototype.handleHitDone = function () {\r\n if (this.hit) {\r\n this.trigger('hitDone', this.hit);\r\n }\r\n };\r\n // Called when the interaction ends, whether there was a real drag or not\r\n HitDragListener.prototype.handleInteractionEnd = function (ev, isCancelled) {\r\n _super.prototype.handleInteractionEnd.call(this, ev, isCancelled);\r\n this.origHit = null;\r\n this.hit = null;\r\n this.component.hitsNotNeeded();\r\n };\r\n // Called when scrolling has stopped, whether through auto scroll, or the user scrolling\r\n HitDragListener.prototype.handleScrollEnd = function () {\r\n _super.prototype.handleScrollEnd.call(this);\r\n // hits' absolute positions will be in new places after a user's scroll.\r\n // HACK for recomputing.\r\n if (this.isDragging) {\r\n this.component.releaseHits();\r\n this.component.prepareHits();\r\n }\r\n };\r\n // Gets the hit underneath the coordinates for the given mouse event\r\n HitDragListener.prototype.queryHit = function (left, top) {\r\n if (this.coordAdjust) {\r\n left += this.coordAdjust.left;\r\n top += this.coordAdjust.top;\r\n }\r\n return this.component.queryHit(left, top);\r\n };\r\n return HitDragListener;\r\n}(DragListener_1.default));\r\nexports.default = HitDragListener;\r\n// Returns `true` if the hits are identically equal. `false` otherwise. Must be from the same component.\r\n// Two null values will be considered equal, as two \"out of the component\" states are the same.\r\nfunction isHitsEqual(hit0, hit1) {\r\n if (!hit0 && !hit1) {\r\n return true;\r\n }\r\n if (hit0 && hit1) {\r\n return hit0.component === hit1.component &&\r\n isHitPropsWithin(hit0, hit1) &&\r\n isHitPropsWithin(hit1, hit0); // ensures all props are identical\r\n }\r\n return false;\r\n}\r\n// Returns true if all of subHit's non-standard properties are within superHit\r\nfunction isHitPropsWithin(subHit, superHit) {\r\n for (var propName in subHit) {\r\n if (!/^(component|left|right|top|bottom)$/.test(propName)) {\r\n if (subHit[propName] !== superHit[propName]) {\r\n return false;\r\n }\r\n }\r\n }\r\n return true;\r\n}\r\n\n\n/***/ }),\n/* 18 */\n/***/ (function(module, exports, __webpack_require__) {\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.version = '3.10.1';\r\n// When introducing internal API incompatibilities (where fullcalendar plugins would break),\r\n// the minor version of the calendar should be upped (ex: 2.7.2 -> 2.8.0)\r\n// and the below integer should be incremented.\r\nexports.internalApiVersion = 12;\r\nvar util_1 = __webpack_require__(4);\r\nexports.applyAll = util_1.applyAll;\r\nexports.debounce = util_1.debounce;\r\nexports.isInt = util_1.isInt;\r\nexports.htmlEscape = util_1.htmlEscape;\r\nexports.cssToStr = util_1.cssToStr;\r\nexports.proxy = util_1.proxy;\r\nexports.capitaliseFirstLetter = util_1.capitaliseFirstLetter;\r\nexports.getOuterRect = util_1.getOuterRect;\r\nexports.getClientRect = util_1.getClientRect;\r\nexports.getContentRect = util_1.getContentRect;\r\nexports.getScrollbarWidths = util_1.getScrollbarWidths;\r\nexports.preventDefault = util_1.preventDefault;\r\nexports.parseFieldSpecs = util_1.parseFieldSpecs;\r\nexports.compareByFieldSpecs = util_1.compareByFieldSpecs;\r\nexports.compareByFieldSpec = util_1.compareByFieldSpec;\r\nexports.flexibleCompare = util_1.flexibleCompare;\r\nexports.computeGreatestUnit = util_1.computeGreatestUnit;\r\nexports.divideRangeByDuration = util_1.divideRangeByDuration;\r\nexports.divideDurationByDuration = util_1.divideDurationByDuration;\r\nexports.multiplyDuration = util_1.multiplyDuration;\r\nexports.durationHasTime = util_1.durationHasTime;\r\nexports.log = util_1.log;\r\nexports.warn = util_1.warn;\r\nexports.removeExact = util_1.removeExact;\r\nexports.intersectRects = util_1.intersectRects;\r\nexports.allowSelection = util_1.allowSelection;\r\nexports.attrsToStr = util_1.attrsToStr;\r\nexports.compareNumbers = util_1.compareNumbers;\r\nexports.compensateScroll = util_1.compensateScroll;\r\nexports.computeDurationGreatestUnit = util_1.computeDurationGreatestUnit;\r\nexports.constrainPoint = util_1.constrainPoint;\r\nexports.copyOwnProps = util_1.copyOwnProps;\r\nexports.diffByUnit = util_1.diffByUnit;\r\nexports.diffDay = util_1.diffDay;\r\nexports.diffDayTime = util_1.diffDayTime;\r\nexports.diffPoints = util_1.diffPoints;\r\nexports.disableCursor = util_1.disableCursor;\r\nexports.distributeHeight = util_1.distributeHeight;\r\nexports.enableCursor = util_1.enableCursor;\r\nexports.firstDefined = util_1.firstDefined;\r\nexports.getEvIsTouch = util_1.getEvIsTouch;\r\nexports.getEvX = util_1.getEvX;\r\nexports.getEvY = util_1.getEvY;\r\nexports.getRectCenter = util_1.getRectCenter;\r\nexports.getScrollParent = util_1.getScrollParent;\r\nexports.hasOwnProp = util_1.hasOwnProp;\r\nexports.isArraysEqual = util_1.isArraysEqual;\r\nexports.isNativeDate = util_1.isNativeDate;\r\nexports.isPrimaryMouseButton = util_1.isPrimaryMouseButton;\r\nexports.isTimeString = util_1.isTimeString;\r\nexports.matchCellWidths = util_1.matchCellWidths;\r\nexports.mergeProps = util_1.mergeProps;\r\nexports.preventSelection = util_1.preventSelection;\r\nexports.removeMatching = util_1.removeMatching;\r\nexports.stripHtmlEntities = util_1.stripHtmlEntities;\r\nexports.subtractInnerElHeight = util_1.subtractInnerElHeight;\r\nexports.uncompensateScroll = util_1.uncompensateScroll;\r\nexports.undistributeHeight = util_1.undistributeHeight;\r\nexports.dayIDs = util_1.dayIDs;\r\nexports.unitsDesc = util_1.unitsDesc;\r\nvar date_formatting_1 = __webpack_require__(49);\r\nexports.formatDate = date_formatting_1.formatDate;\r\nexports.formatRange = date_formatting_1.formatRange;\r\nexports.queryMostGranularFormatUnit = date_formatting_1.queryMostGranularFormatUnit;\r\nvar locale_1 = __webpack_require__(32);\r\nexports.datepickerLocale = locale_1.datepickerLocale;\r\nexports.locale = locale_1.locale;\r\nexports.getMomentLocaleData = locale_1.getMomentLocaleData;\r\nexports.populateInstanceComputableOptions = locale_1.populateInstanceComputableOptions;\r\nvar util_2 = __webpack_require__(19);\r\nexports.eventDefsToEventInstances = util_2.eventDefsToEventInstances;\r\nexports.eventFootprintToComponentFootprint = util_2.eventFootprintToComponentFootprint;\r\nexports.eventInstanceToEventRange = util_2.eventInstanceToEventRange;\r\nexports.eventInstanceToUnzonedRange = util_2.eventInstanceToUnzonedRange;\r\nexports.eventRangeToEventFootprint = util_2.eventRangeToEventFootprint;\r\nvar moment_ext_1 = __webpack_require__(11);\r\nexports.moment = moment_ext_1.default;\r\nvar EmitterMixin_1 = __webpack_require__(13);\r\nexports.EmitterMixin = EmitterMixin_1.default;\r\nvar ListenerMixin_1 = __webpack_require__(7);\r\nexports.ListenerMixin = ListenerMixin_1.default;\r\nvar Model_1 = __webpack_require__(51);\r\nexports.Model = Model_1.default;\r\nvar Constraints_1 = __webpack_require__(217);\r\nexports.Constraints = Constraints_1.default;\r\nvar DateProfileGenerator_1 = __webpack_require__(55);\r\nexports.DateProfileGenerator = DateProfileGenerator_1.default;\r\nvar UnzonedRange_1 = __webpack_require__(5);\r\nexports.UnzonedRange = UnzonedRange_1.default;\r\nvar ComponentFootprint_1 = __webpack_require__(12);\r\nexports.ComponentFootprint = ComponentFootprint_1.default;\r\nvar BusinessHourGenerator_1 = __webpack_require__(218);\r\nexports.BusinessHourGenerator = BusinessHourGenerator_1.default;\r\nvar EventPeriod_1 = __webpack_require__(219);\r\nexports.EventPeriod = EventPeriod_1.default;\r\nvar EventManager_1 = __webpack_require__(220);\r\nexports.EventManager = EventManager_1.default;\r\nvar EventDef_1 = __webpack_require__(37);\r\nexports.EventDef = EventDef_1.default;\r\nvar EventDefMutation_1 = __webpack_require__(39);\r\nexports.EventDefMutation = EventDefMutation_1.default;\r\nvar EventDefParser_1 = __webpack_require__(36);\r\nexports.EventDefParser = EventDefParser_1.default;\r\nvar EventInstance_1 = __webpack_require__(53);\r\nexports.EventInstance = EventInstance_1.default;\r\nvar EventRange_1 = __webpack_require__(50);\r\nexports.EventRange = EventRange_1.default;\r\nvar RecurringEventDef_1 = __webpack_require__(54);\r\nexports.RecurringEventDef = RecurringEventDef_1.default;\r\nvar SingleEventDef_1 = __webpack_require__(9);\r\nexports.SingleEventDef = SingleEventDef_1.default;\r\nvar EventDefDateMutation_1 = __webpack_require__(40);\r\nexports.EventDefDateMutation = EventDefDateMutation_1.default;\r\nvar EventDateProfile_1 = __webpack_require__(16);\r\nexports.EventDateProfile = EventDateProfile_1.default;\r\nvar EventSourceParser_1 = __webpack_require__(38);\r\nexports.EventSourceParser = EventSourceParser_1.default;\r\nvar EventSource_1 = __webpack_require__(6);\r\nexports.EventSource = EventSource_1.default;\r\nvar ThemeRegistry_1 = __webpack_require__(57);\r\nexports.defineThemeSystem = ThemeRegistry_1.defineThemeSystem;\r\nexports.getThemeSystemClass = ThemeRegistry_1.getThemeSystemClass;\r\nvar EventInstanceGroup_1 = __webpack_require__(20);\r\nexports.EventInstanceGroup = EventInstanceGroup_1.default;\r\nvar ArrayEventSource_1 = __webpack_require__(56);\r\nexports.ArrayEventSource = ArrayEventSource_1.default;\r\nvar FuncEventSource_1 = __webpack_require__(223);\r\nexports.FuncEventSource = FuncEventSource_1.default;\r\nvar JsonFeedEventSource_1 = __webpack_require__(224);\r\nexports.JsonFeedEventSource = JsonFeedEventSource_1.default;\r\nvar EventFootprint_1 = __webpack_require__(34);\r\nexports.EventFootprint = EventFootprint_1.default;\r\nvar Class_1 = __webpack_require__(35);\r\nexports.Class = Class_1.default;\r\nvar Mixin_1 = __webpack_require__(15);\r\nexports.Mixin = Mixin_1.default;\r\nvar CoordCache_1 = __webpack_require__(58);\r\nexports.CoordCache = CoordCache_1.default;\r\nvar Iterator_1 = __webpack_require__(225);\r\nexports.Iterator = Iterator_1.default;\r\nvar DragListener_1 = __webpack_require__(59);\r\nexports.DragListener = DragListener_1.default;\r\nvar HitDragListener_1 = __webpack_require__(17);\r\nexports.HitDragListener = HitDragListener_1.default;\r\nvar MouseFollower_1 = __webpack_require__(226);\r\nexports.MouseFollower = MouseFollower_1.default;\r\nvar ParsableModelMixin_1 = __webpack_require__(52);\r\nexports.ParsableModelMixin = ParsableModelMixin_1.default;\r\nvar Popover_1 = __webpack_require__(227);\r\nexports.Popover = Popover_1.default;\r\nvar Promise_1 = __webpack_require__(21);\r\nexports.Promise = Promise_1.default;\r\nvar TaskQueue_1 = __webpack_require__(228);\r\nexports.TaskQueue = TaskQueue_1.default;\r\nvar RenderQueue_1 = __webpack_require__(229);\r\nexports.RenderQueue = RenderQueue_1.default;\r\nvar Scroller_1 = __webpack_require__(41);\r\nexports.Scroller = Scroller_1.default;\r\nvar Theme_1 = __webpack_require__(22);\r\nexports.Theme = Theme_1.default;\r\nvar Component_1 = __webpack_require__(230);\r\nexports.Component = Component_1.default;\r\nvar DateComponent_1 = __webpack_require__(231);\r\nexports.DateComponent = DateComponent_1.default;\r\nvar InteractiveDateComponent_1 = __webpack_require__(42);\r\nexports.InteractiveDateComponent = InteractiveDateComponent_1.default;\r\nvar Calendar_1 = __webpack_require__(232);\r\nexports.Calendar = Calendar_1.default;\r\nvar View_1 = __webpack_require__(43);\r\nexports.View = View_1.default;\r\nvar ViewRegistry_1 = __webpack_require__(24);\r\nexports.defineView = ViewRegistry_1.defineView;\r\nexports.getViewConfig = ViewRegistry_1.getViewConfig;\r\nvar DayTableMixin_1 = __webpack_require__(60);\r\nexports.DayTableMixin = DayTableMixin_1.default;\r\nvar BusinessHourRenderer_1 = __webpack_require__(61);\r\nexports.BusinessHourRenderer = BusinessHourRenderer_1.default;\r\nvar EventRenderer_1 = __webpack_require__(44);\r\nexports.EventRenderer = EventRenderer_1.default;\r\nvar FillRenderer_1 = __webpack_require__(62);\r\nexports.FillRenderer = FillRenderer_1.default;\r\nvar HelperRenderer_1 = __webpack_require__(63);\r\nexports.HelperRenderer = HelperRenderer_1.default;\r\nvar ExternalDropping_1 = __webpack_require__(233);\r\nexports.ExternalDropping = ExternalDropping_1.default;\r\nvar EventResizing_1 = __webpack_require__(234);\r\nexports.EventResizing = EventResizing_1.default;\r\nvar EventPointing_1 = __webpack_require__(64);\r\nexports.EventPointing = EventPointing_1.default;\r\nvar EventDragging_1 = __webpack_require__(235);\r\nexports.EventDragging = EventDragging_1.default;\r\nvar DateSelecting_1 = __webpack_require__(236);\r\nexports.DateSelecting = DateSelecting_1.default;\r\nvar DateClicking_1 = __webpack_require__(237);\r\nexports.DateClicking = DateClicking_1.default;\r\nvar Interaction_1 = __webpack_require__(14);\r\nexports.Interaction = Interaction_1.default;\r\nvar StandardInteractionsMixin_1 = __webpack_require__(65);\r\nexports.StandardInteractionsMixin = StandardInteractionsMixin_1.default;\r\nvar AgendaView_1 = __webpack_require__(238);\r\nexports.AgendaView = AgendaView_1.default;\r\nvar TimeGrid_1 = __webpack_require__(239);\r\nexports.TimeGrid = TimeGrid_1.default;\r\nvar TimeGridEventRenderer_1 = __webpack_require__(240);\r\nexports.TimeGridEventRenderer = TimeGridEventRenderer_1.default;\r\nvar TimeGridFillRenderer_1 = __webpack_require__(242);\r\nexports.TimeGridFillRenderer = TimeGridFillRenderer_1.default;\r\nvar TimeGridHelperRenderer_1 = __webpack_require__(241);\r\nexports.TimeGridHelperRenderer = TimeGridHelperRenderer_1.default;\r\nvar DayGrid_1 = __webpack_require__(66);\r\nexports.DayGrid = DayGrid_1.default;\r\nvar DayGridEventRenderer_1 = __webpack_require__(243);\r\nexports.DayGridEventRenderer = DayGridEventRenderer_1.default;\r\nvar DayGridFillRenderer_1 = __webpack_require__(245);\r\nexports.DayGridFillRenderer = DayGridFillRenderer_1.default;\r\nvar DayGridHelperRenderer_1 = __webpack_require__(244);\r\nexports.DayGridHelperRenderer = DayGridHelperRenderer_1.default;\r\nvar BasicView_1 = __webpack_require__(67);\r\nexports.BasicView = BasicView_1.default;\r\nvar BasicViewDateProfileGenerator_1 = __webpack_require__(68);\r\nexports.BasicViewDateProfileGenerator = BasicViewDateProfileGenerator_1.default;\r\nvar MonthView_1 = __webpack_require__(246);\r\nexports.MonthView = MonthView_1.default;\r\nvar MonthViewDateProfileGenerator_1 = __webpack_require__(247);\r\nexports.MonthViewDateProfileGenerator = MonthViewDateProfileGenerator_1.default;\r\nvar ListView_1 = __webpack_require__(248);\r\nexports.ListView = ListView_1.default;\r\nvar ListEventPointing_1 = __webpack_require__(250);\r\nexports.ListEventPointing = ListEventPointing_1.default;\r\nvar ListEventRenderer_1 = __webpack_require__(249);\r\nexports.ListEventRenderer = ListEventRenderer_1.default;\r\n\n\n/***/ }),\n/* 19 */\n/***/ (function(module, exports, __webpack_require__) {\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar EventRange_1 = __webpack_require__(50);\r\nvar EventFootprint_1 = __webpack_require__(34);\r\nvar ComponentFootprint_1 = __webpack_require__(12);\r\nfunction eventDefsToEventInstances(eventDefs, unzonedRange) {\r\n var eventInstances = [];\r\n var i;\r\n for (i = 0; i < eventDefs.length; i++) {\r\n eventInstances.push.apply(eventInstances, // append\r\n eventDefs[i].buildInstances(unzonedRange));\r\n }\r\n return eventInstances;\r\n}\r\nexports.eventDefsToEventInstances = eventDefsToEventInstances;\r\nfunction eventInstanceToEventRange(eventInstance) {\r\n return new EventRange_1.default(eventInstance.dateProfile.unzonedRange, eventInstance.def, eventInstance);\r\n}\r\nexports.eventInstanceToEventRange = eventInstanceToEventRange;\r\nfunction eventRangeToEventFootprint(eventRange) {\r\n return new EventFootprint_1.default(new ComponentFootprint_1.default(eventRange.unzonedRange, eventRange.eventDef.isAllDay()), eventRange.eventDef, eventRange.eventInstance // might not exist\r\n );\r\n}\r\nexports.eventRangeToEventFootprint = eventRangeToEventFootprint;\r\nfunction eventInstanceToUnzonedRange(eventInstance) {\r\n return eventInstance.dateProfile.unzonedRange;\r\n}\r\nexports.eventInstanceToUnzonedRange = eventInstanceToUnzonedRange;\r\nfunction eventFootprintToComponentFootprint(eventFootprint) {\r\n return eventFootprint.componentFootprint;\r\n}\r\nexports.eventFootprintToComponentFootprint = eventFootprintToComponentFootprint;\r\n\n\n/***/ }),\n/* 20 */\n/***/ (function(module, exports, __webpack_require__) {\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar UnzonedRange_1 = __webpack_require__(5);\r\nvar util_1 = __webpack_require__(19);\r\nvar EventRange_1 = __webpack_require__(50);\r\n/*\r\nIt's expected that there will be at least one EventInstance,\r\nOR that an explicitEventDef is assigned.\r\n*/\r\nvar EventInstanceGroup = /** @class */ (function () {\r\n function EventInstanceGroup(eventInstances) {\r\n this.eventInstances = eventInstances || [];\r\n }\r\n EventInstanceGroup.prototype.getAllEventRanges = function (constraintRange) {\r\n if (constraintRange) {\r\n return this.sliceNormalRenderRanges(constraintRange);\r\n }\r\n else {\r\n return this.eventInstances.map(util_1.eventInstanceToEventRange);\r\n }\r\n };\r\n EventInstanceGroup.prototype.sliceRenderRanges = function (constraintRange) {\r\n if (this.isInverse()) {\r\n return this.sliceInverseRenderRanges(constraintRange);\r\n }\r\n else {\r\n return this.sliceNormalRenderRanges(constraintRange);\r\n }\r\n };\r\n EventInstanceGroup.prototype.sliceNormalRenderRanges = function (constraintRange) {\r\n var eventInstances = this.eventInstances;\r\n var i;\r\n var eventInstance;\r\n var slicedRange;\r\n var slicedEventRanges = [];\r\n for (i = 0; i < eventInstances.length; i++) {\r\n eventInstance = eventInstances[i];\r\n slicedRange = eventInstance.dateProfile.unzonedRange.intersect(constraintRange);\r\n if (slicedRange) {\r\n slicedEventRanges.push(new EventRange_1.default(slicedRange, eventInstance.def, eventInstance));\r\n }\r\n }\r\n return slicedEventRanges;\r\n };\r\n EventInstanceGroup.prototype.sliceInverseRenderRanges = function (constraintRange) {\r\n var unzonedRanges = this.eventInstances.map(util_1.eventInstanceToUnzonedRange);\r\n var ownerDef = this.getEventDef();\r\n unzonedRanges = UnzonedRange_1.default.invertRanges(unzonedRanges, constraintRange);\r\n return unzonedRanges.map(function (unzonedRange) {\r\n return new EventRange_1.default(unzonedRange, ownerDef); // don't give an EventInstance\r\n });\r\n };\r\n EventInstanceGroup.prototype.isInverse = function () {\r\n return this.getEventDef().hasInverseRendering();\r\n };\r\n EventInstanceGroup.prototype.getEventDef = function () {\r\n return this.explicitEventDef || this.eventInstances[0].def;\r\n };\r\n return EventInstanceGroup;\r\n}());\r\nexports.default = EventInstanceGroup;\r\n\n\n/***/ }),\n/* 21 */\n/***/ (function(module, exports, __webpack_require__) {\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar $ = __webpack_require__(3);\r\nvar PromiseStub = {\r\n construct: function (executor) {\r\n var deferred = $.Deferred();\r\n var promise = deferred.promise();\r\n if (typeof executor === 'function') {\r\n executor(function (val) {\r\n deferred.resolve(val);\r\n attachImmediatelyResolvingThen(promise, val);\r\n }, function () {\r\n deferred.reject();\r\n attachImmediatelyRejectingThen(promise);\r\n });\r\n }\r\n return promise;\r\n },\r\n resolve: function (val) {\r\n var deferred = $.Deferred().resolve(val);\r\n var promise = deferred.promise();\r\n attachImmediatelyResolvingThen(promise, val);\r\n return promise;\r\n },\r\n reject: function () {\r\n var deferred = $.Deferred().reject();\r\n var promise = deferred.promise();\r\n attachImmediatelyRejectingThen(promise);\r\n return promise;\r\n }\r\n};\r\nexports.default = PromiseStub;\r\nfunction attachImmediatelyResolvingThen(promise, val) {\r\n promise.then = function (onResolve) {\r\n if (typeof onResolve === 'function') {\r\n return PromiseStub.resolve(onResolve(val));\r\n }\r\n return promise;\r\n };\r\n}\r\nfunction attachImmediatelyRejectingThen(promise) {\r\n promise.then = function (onResolve, onReject) {\r\n if (typeof onReject === 'function') {\r\n onReject();\r\n }\r\n return promise;\r\n };\r\n}\r\n\n\n/***/ }),\n/* 22 */\n/***/ (function(module, exports, __webpack_require__) {\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar $ = __webpack_require__(3);\r\nvar Theme = /** @class */ (function () {\r\n function Theme(optionsManager) {\r\n this.optionsManager = optionsManager;\r\n this.processIconOverride();\r\n }\r\n Theme.prototype.processIconOverride = function () {\r\n if (this.iconOverrideOption) {\r\n this.setIconOverride(this.optionsManager.get(this.iconOverrideOption));\r\n }\r\n };\r\n Theme.prototype.setIconOverride = function (iconOverrideHash) {\r\n var iconClassesCopy;\r\n var buttonName;\r\n if ($.isPlainObject(iconOverrideHash)) {\r\n iconClassesCopy = $.extend({}, this.iconClasses);\r\n for (buttonName in iconOverrideHash) {\r\n iconClassesCopy[buttonName] = this.applyIconOverridePrefix(iconOverrideHash[buttonName]);\r\n }\r\n this.iconClasses = iconClassesCopy;\r\n }\r\n else if (iconOverrideHash === false) {\r\n this.iconClasses = {};\r\n }\r\n };\r\n Theme.prototype.applyIconOverridePrefix = function (className) {\r\n var prefix = this.iconOverridePrefix;\r\n if (prefix && className.indexOf(prefix) !== 0) { // if not already present\r\n className = prefix + className;\r\n }\r\n return className;\r\n };\r\n Theme.prototype.getClass = function (key) {\r\n return this.classes[key] || '';\r\n };\r\n Theme.prototype.getIconClass = function (buttonName) {\r\n var className = this.iconClasses[buttonName];\r\n if (className) {\r\n return this.baseIconClass + ' ' + className;\r\n }\r\n return '';\r\n };\r\n Theme.prototype.getCustomButtonIconClass = function (customButtonProps) {\r\n var className;\r\n if (this.iconOverrideCustomButtonOption) {\r\n className = customButtonProps[this.iconOverrideCustomButtonOption];\r\n if (className) {\r\n return this.baseIconClass + ' ' + this.applyIconOverridePrefix(className);\r\n }\r\n }\r\n return '';\r\n };\r\n return Theme;\r\n}());\r\nexports.default = Theme;\r\nTheme.prototype.classes = {};\r\nTheme.prototype.iconClasses = {};\r\nTheme.prototype.baseIconClass = '';\r\nTheme.prototype.iconOverridePrefix = '';\r\n\n\n/***/ }),\n/* 23 */\n/***/ (function(module, exports, __webpack_require__) {\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar $ = __webpack_require__(3);\r\nvar exportHooks = __webpack_require__(18);\r\nvar EmitterMixin_1 = __webpack_require__(13);\r\nvar ListenerMixin_1 = __webpack_require__(7);\r\nexportHooks.touchMouseIgnoreWait = 500;\r\nvar globalEmitter = null;\r\nvar neededCount = 0;\r\n/*\r\nListens to document and window-level user-interaction events, like touch events and mouse events,\r\nand fires these events as-is to whoever is observing a GlobalEmitter.\r\nBest when used as a singleton via GlobalEmitter.get()\r\n\nNormalizes mouse/touch events. For examples:\r\n- ignores the the simulated mouse events that happen after a quick tap: mousemove+mousedown+mouseup+click\r\n- compensates for various buggy scenarios where a touchend does not fire\r\n*/\r\nvar GlobalEmitter = /** @class */ (function () {\r\n function GlobalEmitter() {\r\n this.isTouching = false;\r\n this.mouseIgnoreDepth = 0;\r\n }\r\n // gets the singleton\r\n GlobalEmitter.get = function () {\r\n if (!globalEmitter) {\r\n globalEmitter = new GlobalEmitter();\r\n globalEmitter.bind();\r\n }\r\n return globalEmitter;\r\n };\r\n // called when an object knows it will need a GlobalEmitter in the near future.\r\n GlobalEmitter.needed = function () {\r\n GlobalEmitter.get(); // ensures globalEmitter\r\n neededCount++;\r\n };\r\n // called when the object that originally called needed() doesn't need a GlobalEmitter anymore.\r\n GlobalEmitter.unneeded = function () {\r\n neededCount--;\r\n if (!neededCount) { // nobody else needs it\r\n globalEmitter.unbind();\r\n globalEmitter = null;\r\n }\r\n };\r\n GlobalEmitter.prototype.bind = function () {\r\n var _this = this;\r\n this.listenTo($(document), {\r\n touchstart: this.handleTouchStart,\r\n touchcancel: this.handleTouchCancel,\r\n touchend: this.handleTouchEnd,\r\n mousedown: this.handleMouseDown,\r\n mousemove: this.handleMouseMove,\r\n mouseup: this.handleMouseUp,\r\n click: this.handleClick,\r\n selectstart: this.handleSelectStart,\r\n contextmenu: this.handleContextMenu\r\n });\r\n // because we need to call preventDefault\r\n // because https://www.chromestatus.com/features/5093566007214080\r\n // TODO: investigate performance because this is a global handler\r\n window.addEventListener('touchmove', this.handleTouchMoveProxy = function (ev) {\r\n _this.handleTouchMove($.Event(ev));\r\n }, { passive: false } // allows preventDefault()\r\n );\r\n // attach a handler to get called when ANY scroll action happens on the page.\r\n // this was impossible to do with normal on/off because 'scroll' doesn't bubble.\r\n // http://stackoverflow.com/a/32954565/96342\r\n window.addEventListener('scroll', this.handleScrollProxy = function (ev) {\r\n _this.handleScroll($.Event(ev));\r\n }, true // useCapture\r\n );\r\n };\r\n GlobalEmitter.prototype.unbind = function () {\r\n this.stopListeningTo($(document));\r\n window.removeEventListener('touchmove', this.handleTouchMoveProxy, { passive: false } // use same options as addEventListener\r\n );\r\n window.removeEventListener('scroll', this.handleScrollProxy, true // useCapture\r\n );\r\n };\r\n // Touch Handlers\r\n // -----------------------------------------------------------------------------------------------------------------\r\n GlobalEmitter.prototype.handleTouchStart = function (ev) {\r\n // if a previous touch interaction never ended with a touchend, then implicitly end it,\r\n // but since a new touch interaction is about to begin, don't start the mouse ignore period.\r\n this.stopTouch(ev, true); // skipMouseIgnore=true\r\n this.isTouching = true;\r\n this.trigger('touchstart', ev);\r\n };\r\n GlobalEmitter.prototype.handleTouchMove = function (ev) {\r\n if (this.isTouching) {\r\n this.trigger('touchmove', ev);\r\n }\r\n };\r\n GlobalEmitter.prototype.handleTouchCancel = function (ev) {\r\n if (this.isTouching) {\r\n this.trigger('touchcancel', ev);\r\n // Have touchcancel fire an artificial touchend. That way, handlers won't need to listen to both.\r\n // If touchend fires later, it won't have any effect b/c isTouching will be false.\r\n this.stopTouch(ev);\r\n }\r\n };\r\n GlobalEmitter.prototype.handleTouchEnd = function (ev) {\r\n this.stopTouch(ev);\r\n };\r\n // Mouse Handlers\r\n // -----------------------------------------------------------------------------------------------------------------\r\n GlobalEmitter.prototype.handleMouseDown = function (ev) {\r\n if (!this.shouldIgnoreMouse()) {\r\n this.trigger('mousedown', ev);\r\n }\r\n };\r\n GlobalEmitter.prototype.handleMouseMove = function (ev) {\r\n if (!this.shouldIgnoreMouse()) {\r\n this.trigger('mousemove', ev);\r\n }\r\n };\r\n GlobalEmitter.prototype.handleMouseUp = function (ev) {\r\n if (!this.shouldIgnoreMouse()) {\r\n this.trigger('mouseup', ev);\r\n }\r\n };\r\n GlobalEmitter.prototype.handleClick = function (ev) {\r\n if (!this.shouldIgnoreMouse()) {\r\n this.trigger('click', ev);\r\n }\r\n };\r\n // Misc Handlers\r\n // -----------------------------------------------------------------------------------------------------------------\r\n GlobalEmitter.prototype.handleSelectStart = function (ev) {\r\n this.trigger('selectstart', ev);\r\n };\r\n GlobalEmitter.prototype.handleContextMenu = function (ev) {\r\n this.trigger('contextmenu', ev);\r\n };\r\n GlobalEmitter.prototype.handleScroll = function (ev) {\r\n this.trigger('scroll', ev);\r\n };\r\n // Utils\r\n // -----------------------------------------------------------------------------------------------------------------\r\n GlobalEmitter.prototype.stopTouch = function (ev, skipMouseIgnore) {\r\n if (skipMouseIgnore === void 0) { skipMouseIgnore = false; }\r\n if (this.isTouching) {\r\n this.isTouching = false;\r\n this.trigger('touchend', ev);\r\n if (!skipMouseIgnore) {\r\n this.startTouchMouseIgnore();\r\n }\r\n }\r\n };\r\n GlobalEmitter.prototype.startTouchMouseIgnore = function () {\r\n var _this = this;\r\n var wait = exportHooks.touchMouseIgnoreWait;\r\n if (wait) {\r\n this.mouseIgnoreDepth++;\r\n setTimeout(function () {\r\n _this.mouseIgnoreDepth--;\r\n }, wait);\r\n }\r\n };\r\n GlobalEmitter.prototype.shouldIgnoreMouse = function () {\r\n return this.isTouching || Boolean(this.mouseIgnoreDepth);\r\n };\r\n return GlobalEmitter;\r\n}());\r\nexports.default = GlobalEmitter;\r\nListenerMixin_1.default.mixInto(GlobalEmitter);\r\nEmitterMixin_1.default.mixInto(GlobalEmitter);\r\n\n\n/***/ }),\n/* 24 */\n/***/ (function(module, exports, __webpack_require__) {\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar exportHooks = __webpack_require__(18);\r\nexports.viewHash = {};\r\nexportHooks.views = exports.viewHash;\r\nfunction defineView(viewName, viewConfig) {\r\n exports.viewHash[viewName] = viewConfig;\r\n}\r\nexports.defineView = defineView;\r\nfunction getViewConfig(viewName) {\r\n return exports.viewHash[viewName];\r\n}\r\nexports.getViewConfig = getViewConfig;\r\n\n\n/***/ }),\n/* 25 */,\n/* 26 */,\n/* 27 */,\n/* 28 */,\n/* 29 */,\n/* 30 */,\n/* 31 */,\n/* 32 */\n/***/ (function(module, exports, __webpack_require__) {\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar $ = __webpack_require__(3);\r\nvar moment = __webpack_require__(0);\r\nvar exportHooks = __webpack_require__(18);\r\nvar options_1 = __webpack_require__(33);\r\nvar util_1 = __webpack_require__(4);\r\nexports.localeOptionHash = {};\r\nexportHooks.locales = exports.localeOptionHash;\r\n// NOTE: can't guarantee any of these computations will run because not every locale has datepicker\r\n// configs, so make sure there are English fallbacks for these in the defaults file.\r\nvar dpComputableOptions = {\r\n buttonText: function (dpOptions) {\r\n return {\r\n // the translations sometimes wrongly contain HTML entities\r\n prev: util_1.stripHtmlEntities(dpOptions.prevText),\r\n next: util_1.stripHtmlEntities(dpOptions.nextText),\r\n today: util_1.stripHtmlEntities(dpOptions.currentText)\r\n };\r\n },\r\n // Produces format strings like \"MMMM YYYY\" -> \"September 2014\"\r\n monthYearFormat: function (dpOptions) {\r\n return dpOptions.showMonthAfterYear ?\r\n 'YYYY[' + dpOptions.yearSuffix + '] MMMM' :\r\n 'MMMM YYYY[' + dpOptions.yearSuffix + ']';\r\n }\r\n};\r\nvar momComputableOptions = {\r\n // Produces format strings like \"ddd M/D\" -> \"Fri 9/15\"\r\n dayOfMonthFormat: function (momOptions, fcOptions) {\r\n var format = momOptions.longDateFormat('l'); // for the format like \"M/D/YYYY\"\r\n // strip the year off the edge, as well as other misc non-whitespace chars\r\n format = format.replace(/^Y+[^\\w\\s]*|[^\\w\\s]*Y+$/g, '');\r\n if (fcOptions.isRTL) {\r\n format += ' ddd'; // for RTL, add day-of-week to end\r\n }\r\n else {\r\n format = 'ddd ' + format; // for LTR, add day-of-week to beginning\r\n }\r\n return format;\r\n },\r\n // Produces format strings like \"h:mma\" -> \"6:00pm\"\r\n mediumTimeFormat: function (momOptions) {\r\n return momOptions.longDateFormat('LT')\r\n .replace(/\\s*a$/i, 'a'); // convert AM/PM/am/pm to lowercase. remove any spaces beforehand\r\n },\r\n // Produces format strings like \"h(:mm)a\" -> \"6pm\" / \"6:30pm\"\r\n smallTimeFormat: function (momOptions) {\r\n return momOptions.longDateFormat('LT')\r\n .replace(':mm', '(:mm)')\r\n .replace(/(\\Wmm)$/, '($1)') // like above, but for foreign locales\r\n .replace(/\\s*a$/i, 'a'); // convert AM/PM/am/pm to lowercase. remove any spaces beforehand\r\n },\r\n // Produces format strings like \"h(:mm)t\" -> \"6p\" / \"6:30p\"\r\n extraSmallTimeFormat: function (momOptions) {\r\n return momOptions.longDateFormat('LT')\r\n .replace(':mm', '(:mm)')\r\n .replace(/(\\Wmm)$/, '($1)') // like above, but for foreign locales\r\n .replace(/\\s*a$/i, 't'); // convert to AM/PM/am/pm to lowercase one-letter. remove any spaces beforehand\r\n },\r\n // Produces format strings like \"ha\" / \"H\" -> \"6pm\" / \"18\"\r\n hourFormat: function (momOptions) {\r\n return momOptions.longDateFormat('LT')\r\n .replace(':mm', '')\r\n .replace(/(\\Wmm)$/, '') // like above, but for foreign locales\r\n .replace(/\\s*a$/i, 'a'); // convert AM/PM/am/pm to lowercase. remove any spaces beforehand\r\n },\r\n // Produces format strings like \"h:mm\" -> \"6:30\" (with no AM/PM)\r\n noMeridiemTimeFormat: function (momOptions) {\r\n return momOptions.longDateFormat('LT')\r\n .replace(/\\s*a$/i, ''); // remove trailing AM/PM\r\n }\r\n};\r\n// options that should be computed off live calendar options (considers override options)\r\n// TODO: best place for this? related to locale?\r\n// TODO: flipping text based on isRTL is a bad idea because the CSS `direction` might want to handle it\r\nvar instanceComputableOptions = {\r\n // Produces format strings for results like \"Mo 16\"\r\n smallDayDateFormat: function (options) {\r\n return options.isRTL ?\r\n 'D dd' :\r\n 'dd D';\r\n },\r\n // Produces format strings for results like \"Wk 5\"\r\n weekFormat: function (options) {\r\n return options.isRTL ?\r\n 'w[ ' + options.weekNumberTitle + ']' :\r\n '[' + options.weekNumberTitle + ' ]w';\r\n },\r\n // Produces format strings for results like \"Wk5\"\r\n smallWeekFormat: function (options) {\r\n return options.isRTL ?\r\n 'w[' + options.weekNumberTitle + ']' :\r\n '[' + options.weekNumberTitle + ']w';\r\n }\r\n};\r\n// TODO: make these computable properties in optionsManager\r\nfunction populateInstanceComputableOptions(options) {\r\n $.each(instanceComputableOptions, function (name, func) {\r\n if (options[name] == null) {\r\n options[name] = func(options);\r\n }\r\n });\r\n}\r\nexports.populateInstanceComputableOptions = populateInstanceComputableOptions;\r\n// Initialize jQuery UI datepicker translations while using some of the translations\r\n// Will set this as the default locales for datepicker.\r\nfunction datepickerLocale(localeCode, dpLocaleCode, dpOptions) {\r\n // get the FullCalendar internal option hash for this locale. create if necessary\r\n var fcOptions = exports.localeOptionHash[localeCode] || (exports.localeOptionHash[localeCode] = {});\r\n // transfer some simple options from datepicker to fc\r\n fcOptions.isRTL = dpOptions.isRTL;\r\n fcOptions.weekNumberTitle = dpOptions.weekHeader;\r\n // compute some more complex options from datepicker\r\n $.each(dpComputableOptions, function (name, func) {\r\n fcOptions[name] = func(dpOptions);\r\n });\r\n var jqDatePicker = $.datepicker;\r\n // is jQuery UI Datepicker is on the page?\r\n if (jqDatePicker) {\r\n // Register the locale data.\r\n // FullCalendar and MomentJS use locale codes like \"pt-br\" but Datepicker\r\n // does it like \"pt-BR\" or if it doesn't have the locale, maybe just \"pt\".\r\n // Make an alias so the locale can be referenced either way.\r\n jqDatePicker.regional[dpLocaleCode] =\r\n jqDatePicker.regional[localeCode] = // alias\r\n dpOptions;\r\n // Alias 'en' to the default locale data. Do this every time.\r\n jqDatePicker.regional.en = jqDatePicker.regional[''];\r\n // Set as Datepicker's global defaults.\r\n jqDatePicker.setDefaults(dpOptions);\r\n }\r\n}\r\nexports.datepickerLocale = datepickerLocale;\r\n// Sets FullCalendar-specific translations. Will set the locales as the global default.\r\nfunction locale(localeCode, newFcOptions) {\r\n var fcOptions;\r\n var momOptions;\r\n // get the FullCalendar internal option hash for this locale. create if necessary\r\n fcOptions = exports.localeOptionHash[localeCode] || (exports.localeOptionHash[localeCode] = {});\r\n // provided new options for this locales? merge them in\r\n if (newFcOptions) {\r\n fcOptions = exports.localeOptionHash[localeCode] = options_1.mergeOptions([fcOptions, newFcOptions]);\r\n }\r\n // compute locale options that weren't defined.\r\n // always do this. newFcOptions can be undefined when initializing from i18n file,\r\n // so no way to tell if this is an initialization or a default-setting.\r\n momOptions = getMomentLocaleData(localeCode); // will fall back to en\r\n $.each(momComputableOptions, function (name, func) {\r\n if (fcOptions[name] == null) {\r\n fcOptions[name] = (func)(momOptions, fcOptions);\r\n }\r\n });\r\n // set it as the default locale for FullCalendar\r\n options_1.globalDefaults.locale = localeCode;\r\n}\r\nexports.locale = locale;\r\n// Returns moment's internal locale data. If doesn't exist, returns English.\r\nfunction getMomentLocaleData(localeCode) {\r\n return moment.localeData(localeCode) || moment.localeData('en');\r\n}\r\nexports.getMomentLocaleData = getMomentLocaleData;\r\n// Initialize English by forcing computation of moment-derived options.\r\n// Also, sets it as the default.\r\nlocale('en', options_1.englishDefaults);\r\n\n\n/***/ }),\n/* 33 */\n/***/ (function(module, exports, __webpack_require__) {\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar util_1 = __webpack_require__(4);\r\nexports.globalDefaults = {\r\n titleRangeSeparator: ' \\u2013 ',\r\n monthYearFormat: 'MMMM YYYY',\r\n defaultTimedEventDuration: '02:00:00',\r\n defaultAllDayEventDuration: { days: 1 },\r\n forceEventDuration: false,\r\n nextDayThreshold: '09:00:00',\r\n // display\r\n columnHeader: true,\r\n defaultView: 'month',\r\n aspectRatio: 1.35,\r\n header: {\r\n left: 'title',\r\n center: '',\r\n right: 'today prev,next'\r\n },\r\n weekends: true,\r\n weekNumbers: false,\r\n weekNumberTitle: 'W',\r\n weekNumberCalculation: 'local',\r\n // editable: false,\r\n // nowIndicator: false,\r\n scrollTime: '06:00:00',\r\n minTime: '00:00:00',\r\n maxTime: '24:00:00',\r\n showNonCurrentDates: true,\r\n // event ajax\r\n lazyFetching: true,\r\n startParam: 'start',\r\n endParam: 'end',\r\n timezoneParam: 'timezone',\r\n timezone: false,\r\n // allDayDefault: undefined,\r\n // locale\r\n locale: null,\r\n isRTL: false,\r\n buttonText: {\r\n prev: 'prev',\r\n next: 'next',\r\n prevYear: 'prev year',\r\n nextYear: 'next year',\r\n year: 'year',\r\n today: 'today',\r\n month: 'month',\r\n week: 'week',\r\n day: 'day'\r\n },\r\n // buttonIcons: null,\r\n allDayText: 'all-day',\r\n // allows setting a min-height to the event segment to prevent short events overlapping each other\r\n agendaEventMinHeight: 0,\r\n // jquery-ui theming\r\n theme: false,\r\n // themeButtonIcons: null,\r\n // eventResizableFromStart: false,\r\n dragOpacity: .75,\r\n dragRevertDuration: 500,\r\n dragScroll: true,\r\n // selectable: false,\r\n unselectAuto: true,\r\n // selectMinDistance: 0,\r\n dropAccept: '*',\r\n eventOrder: 'title',\r\n // eventRenderWait: null,\r\n eventLimit: false,\r\n eventLimitText: 'more',\r\n eventLimitClick: 'popover',\r\n dayPopoverFormat: 'LL',\r\n handleWindowResize: true,\r\n windowResizeDelay: 100,\r\n longPressDelay: 1000\r\n};\r\nexports.englishDefaults = {\r\n dayPopoverFormat: 'dddd, MMMM D'\r\n};\r\nexports.rtlDefaults = {\r\n header: {\r\n left: 'next,prev today',\r\n center: '',\r\n right: 'title'\r\n },\r\n buttonIcons: {\r\n prev: 'right-single-arrow',\r\n next: 'left-single-arrow',\r\n prevYear: 'right-double-arrow',\r\n nextYear: 'left-double-arrow'\r\n },\r\n themeButtonIcons: {\r\n prev: 'circle-triangle-e',\r\n next: 'circle-triangle-w',\r\n nextYear: 'seek-prev',\r\n prevYear: 'seek-next'\r\n }\r\n};\r\nvar complexOptions = [\r\n 'header',\r\n 'footer',\r\n 'buttonText',\r\n 'buttonIcons',\r\n 'themeButtonIcons'\r\n];\r\n// Merges an array of option objects into a single object\r\nfunction mergeOptions(optionObjs) {\r\n return util_1.mergeProps(optionObjs, complexOptions);\r\n}\r\nexports.mergeOptions = mergeOptions;\r\n\n\n/***/ }),\n/* 34 */\n/***/ (function(module, exports) {\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar EventFootprint = /** @class */ (function () {\r\n function EventFootprint(componentFootprint, eventDef, eventInstance) {\r\n this.componentFootprint = componentFootprint;\r\n this.eventDef = eventDef;\r\n if (eventInstance) {\r\n this.eventInstance = eventInstance;\r\n }\r\n }\r\n EventFootprint.prototype.getEventLegacy = function () {\r\n return (this.eventInstance || this.eventDef).toLegacy();\r\n };\r\n return EventFootprint;\r\n}());\r\nexports.default = EventFootprint;\r\n\n\n/***/ }),\n/* 35 */\n/***/ (function(module, exports, __webpack_require__) {\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar tslib_1 = __webpack_require__(2);\r\nvar util_1 = __webpack_require__(4);\r\n// Class that all other classes will inherit from\r\nvar Class = /** @class */ (function () {\r\n function Class() {\r\n }\r\n // Called on a class to create a subclass.\r\n // LIMITATION: cannot provide a constructor!\r\n Class.extend = function (members) {\r\n var SubClass = /** @class */ (function (_super) {\r\n tslib_1.__extends(SubClass, _super);\r\n function SubClass() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n return SubClass;\r\n }(this));\r\n util_1.copyOwnProps(members, SubClass.prototype);\r\n return SubClass;\r\n };\r\n // Adds new member variables/methods to the class's prototype.\r\n // Can be called with another class, or a plain object hash containing new members.\r\n Class.mixin = function (members) {\r\n util_1.copyOwnProps(members, this.prototype);\r\n };\r\n return Class;\r\n}());\r\nexports.default = Class;\r\n\n\n/***/ }),\n/* 36 */\n/***/ (function(module, exports, __webpack_require__) {\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar moment = __webpack_require__(0);\r\nvar util_1 = __webpack_require__(4);\r\nvar SingleEventDef_1 = __webpack_require__(9);\r\nvar RecurringEventDef_1 = __webpack_require__(54);\r\nexports.default = {\r\n parse: function (eventInput, source) {\r\n if (util_1.isTimeString(eventInput.start) || moment.isDuration(eventInput.start) ||\r\n util_1.isTimeString(eventInput.end) || moment.isDuration(eventInput.end)) {\r\n return RecurringEventDef_1.default.parse(eventInput, source);\r\n }\r\n else {\r\n return SingleEventDef_1.default.parse(eventInput, source);\r\n }\r\n }\r\n};\r\n\n\n/***/ }),\n/* 37 */\n/***/ (function(module, exports, __webpack_require__) {\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar $ = __webpack_require__(3);\r\nvar ParsableModelMixin_1 = __webpack_require__(52);\r\nvar EventDef = /** @class */ (function () {\r\n function EventDef(source) {\r\n this.source = source;\r\n this.className = [];\r\n this.miscProps = {};\r\n }\r\n EventDef.parse = function (rawInput, source) {\r\n var def = new this(source);\r\n if (def.applyProps(rawInput)) {\r\n return def;\r\n }\r\n return false;\r\n };\r\n EventDef.normalizeId = function (id) {\r\n return String(id);\r\n };\r\n EventDef.generateId = function () {\r\n return '_fc' + (EventDef.uuid++);\r\n };\r\n EventDef.prototype.clone = function () {\r\n var copy = new this.constructor(this.source);\r\n copy.id = this.id;\r\n copy.rawId = this.rawId;\r\n copy.uid = this.uid; // not really unique anymore :(\r\n EventDef.copyVerbatimStandardProps(this, copy);\r\n copy.className = this.className.slice(); // copy\r\n copy.miscProps = $.extend({}, this.miscProps);\r\n return copy;\r\n };\r\n EventDef.prototype.hasInverseRendering = function () {\r\n return this.getRendering() === 'inverse-background';\r\n };\r\n EventDef.prototype.hasBgRendering = function () {\r\n var rendering = this.getRendering();\r\n return rendering === 'inverse-background' || rendering === 'background';\r\n };\r\n EventDef.prototype.getRendering = function () {\r\n if (this.rendering != null) {\r\n return this.rendering;\r\n }\r\n return this.source.rendering;\r\n };\r\n EventDef.prototype.getConstraint = function () {\r\n if (this.constraint != null) {\r\n return this.constraint;\r\n }\r\n if (this.source.constraint != null) {\r\n return this.source.constraint;\r\n }\r\n return this.source.calendar.opt('eventConstraint'); // what about View option?\r\n };\r\n EventDef.prototype.getOverlap = function () {\r\n if (this.overlap != null) {\r\n return this.overlap;\r\n }\r\n if (this.source.overlap != null) {\r\n return this.source.overlap;\r\n }\r\n return this.source.calendar.opt('eventOverlap'); // what about View option?\r\n };\r\n EventDef.prototype.isStartExplicitlyEditable = function () {\r\n if (this.startEditable != null) {\r\n return this.startEditable;\r\n }\r\n return this.source.startEditable;\r\n };\r\n EventDef.prototype.isDurationExplicitlyEditable = function () {\r\n if (this.durationEditable != null) {\r\n return this.durationEditable;\r\n }\r\n return this.source.durationEditable;\r\n };\r\n EventDef.prototype.isExplicitlyEditable = function () {\r\n if (this.editable != null) {\r\n return this.editable;\r\n }\r\n return this.source.editable;\r\n };\r\n EventDef.prototype.toLegacy = function () {\r\n var obj = $.extend({}, this.miscProps);\r\n obj._id = this.uid;\r\n obj.source = this.source;\r\n obj.className = this.className.slice(); // copy\r\n obj.allDay = this.isAllDay();\r\n if (this.rawId != null) {\r\n obj.id = this.rawId;\r\n }\r\n EventDef.copyVerbatimStandardProps(this, obj);\r\n return obj;\r\n };\r\n EventDef.prototype.applyManualStandardProps = function (rawProps) {\r\n if (rawProps.id != null) {\r\n this.id = EventDef.normalizeId((this.rawId = rawProps.id));\r\n }\r\n else {\r\n this.id = EventDef.generateId();\r\n }\r\n if (rawProps._id != null) { // accept this prop, even tho somewhat internal\r\n this.uid = String(rawProps._id);\r\n }\r\n else {\r\n this.uid = EventDef.generateId();\r\n }\r\n // TODO: converge with EventSource\r\n if ($.isArray(rawProps.className)) {\r\n this.className = rawProps.className;\r\n }\r\n if (typeof rawProps.className === 'string') {\r\n this.className = rawProps.className.split(/\\s+/);\r\n }\r\n return true;\r\n };\r\n EventDef.prototype.applyMiscProps = function (rawProps) {\r\n $.extend(this.miscProps, rawProps);\r\n };\r\n EventDef.uuid = 0;\r\n EventDef.defineStandardProps = ParsableModelMixin_1.default.defineStandardProps;\r\n EventDef.copyVerbatimStandardProps = ParsableModelMixin_1.default.copyVerbatimStandardProps;\r\n return EventDef;\r\n}());\r\nexports.default = EventDef;\r\nParsableModelMixin_1.default.mixInto(EventDef);\r\nEventDef.defineStandardProps({\r\n // not automatically assigned (`false`)\r\n _id: false,\r\n id: false,\r\n className: false,\r\n source: false,\r\n // automatically assigned (`true`)\r\n title: true,\r\n url: true,\r\n rendering: true,\r\n constraint: true,\r\n overlap: true,\r\n editable: true,\r\n startEditable: true,\r\n durationEditable: true,\r\n color: true,\r\n backgroundColor: true,\r\n borderColor: true,\r\n textColor: true\r\n});\r\n\n\n/***/ }),\n/* 38 */\n/***/ (function(module, exports) {\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.default = {\r\n sourceClasses: [],\r\n registerClass: function (EventSourceClass) {\r\n this.sourceClasses.unshift(EventSourceClass); // give highest priority\r\n },\r\n parse: function (rawInput, calendar) {\r\n var sourceClasses = this.sourceClasses;\r\n var i;\r\n var eventSource;\r\n for (i = 0; i < sourceClasses.length; i++) {\r\n eventSource = sourceClasses[i].parse(rawInput, calendar);\r\n if (eventSource) {\r\n return eventSource;\r\n }\r\n }\r\n }\r\n};\r\n\n\n/***/ }),\n/* 39 */\n/***/ (function(module, exports, __webpack_require__) {\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar util_1 = __webpack_require__(4);\r\nvar EventDateProfile_1 = __webpack_require__(16);\r\nvar EventDef_1 = __webpack_require__(37);\r\nvar EventDefDateMutation_1 = __webpack_require__(40);\r\nvar SingleEventDef_1 = __webpack_require__(9);\r\nvar EventDefMutation = /** @class */ (function () {\r\n function EventDefMutation() {\r\n }\r\n EventDefMutation.createFromRawProps = function (eventInstance, rawProps, largeUnit) {\r\n var eventDef = eventInstance.def;\r\n var dateProps = {};\r\n var standardProps = {};\r\n var miscProps = {};\r\n var verbatimStandardProps = {};\r\n var eventDefId = null;\r\n var className = null;\r\n var propName;\r\n var dateProfile;\r\n var dateMutation;\r\n var defMutation;\r\n for (propName in rawProps) {\r\n if (EventDateProfile_1.default.isStandardProp(propName)) {\r\n dateProps[propName] = rawProps[propName];\r\n }\r\n else if (eventDef.isStandardProp(propName)) {\r\n standardProps[propName] = rawProps[propName];\r\n }\r\n else if (eventDef.miscProps[propName] !== rawProps[propName]) { // only if changed\r\n miscProps[propName] = rawProps[propName];\r\n }\r\n }\r\n dateProfile = EventDateProfile_1.default.parse(dateProps, eventDef.source);\r\n if (dateProfile) { // no failure?\r\n dateMutation = EventDefDateMutation_1.default.createFromDiff(eventInstance.dateProfile, dateProfile, largeUnit);\r\n }\r\n if (standardProps.id !== eventDef.id) {\r\n eventDefId = standardProps.id; // only apply if there's a change\r\n }\r\n if (!util_1.isArraysEqual(standardProps.className, eventDef.className)) {\r\n className = standardProps.className; // only apply if there's a change\r\n }\r\n EventDef_1.default.copyVerbatimStandardProps(standardProps, // src\r\n verbatimStandardProps // dest\r\n );\r\n defMutation = new EventDefMutation();\r\n defMutation.eventDefId = eventDefId;\r\n defMutation.className = className;\r\n defMutation.verbatimStandardProps = verbatimStandardProps;\r\n defMutation.miscProps = miscProps;\r\n if (dateMutation) {\r\n defMutation.dateMutation = dateMutation;\r\n }\r\n return defMutation;\r\n };\r\n /*\r\n eventDef assumed to be a SingleEventDef.\r\n returns an undo function.\r\n */\r\n EventDefMutation.prototype.mutateSingle = function (eventDef) {\r\n var origDateProfile;\r\n if (this.dateMutation) {\r\n origDateProfile = eventDef.dateProfile;\r\n eventDef.dateProfile = this.dateMutation.buildNewDateProfile(origDateProfile, eventDef.source.calendar);\r\n }\r\n // can't undo\r\n // TODO: more DRY with EventDef::applyManualStandardProps\r\n if (this.eventDefId != null) {\r\n eventDef.id = EventDef_1.default.normalizeId((eventDef.rawId = this.eventDefId));\r\n }\r\n // can't undo\r\n // TODO: more DRY with EventDef::applyManualStandardProps\r\n if (this.className) {\r\n eventDef.className = this.className;\r\n }\r\n // can't undo\r\n if (this.verbatimStandardProps) {\r\n SingleEventDef_1.default.copyVerbatimStandardProps(this.verbatimStandardProps, // src\r\n eventDef // dest\r\n );\r\n }\r\n // can't undo\r\n if (this.miscProps) {\r\n eventDef.applyMiscProps(this.miscProps);\r\n }\r\n if (origDateProfile) {\r\n return function () {\r\n eventDef.dateProfile = origDateProfile;\r\n };\r\n }\r\n else {\r\n return function () { };\r\n }\r\n };\r\n EventDefMutation.prototype.setDateMutation = function (dateMutation) {\r\n if (dateMutation && !dateMutation.isEmpty()) {\r\n this.dateMutation = dateMutation;\r\n }\r\n else {\r\n this.dateMutation = null;\r\n }\r\n };\r\n EventDefMutation.prototype.isEmpty = function () {\r\n return !this.dateMutation;\r\n };\r\n return EventDefMutation;\r\n}());\r\nexports.default = EventDefMutation;\r\n\n\n/***/ }),\n/* 40 */\n/***/ (function(module, exports, __webpack_require__) {\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar util_1 = __webpack_require__(4);\r\nvar EventDateProfile_1 = __webpack_require__(16);\r\nvar EventDefDateMutation = /** @class */ (function () {\r\n function EventDefDateMutation() {\r\n this.clearEnd = false;\r\n this.forceTimed = false;\r\n this.forceAllDay = false;\r\n }\r\n EventDefDateMutation.createFromDiff = function (dateProfile0, dateProfile1, largeUnit) {\r\n var clearEnd = dateProfile0.end && !dateProfile1.end;\r\n var forceTimed = dateProfile0.isAllDay() && !dateProfile1.isAllDay();\r\n var forceAllDay = !dateProfile0.isAllDay() && dateProfile1.isAllDay();\r\n var dateDelta;\r\n var endDiff;\r\n var endDelta;\r\n var mutation;\r\n // subtracts the dates in the appropriate way, returning a duration\r\n function subtractDates(date1, date0) {\r\n if (largeUnit) {\r\n return util_1.diffByUnit(date1, date0, largeUnit); // poorly named\r\n }\r\n else if (dateProfile1.isAllDay()) {\r\n return util_1.diffDay(date1, date0); // poorly named\r\n }\r\n else {\r\n return util_1.diffDayTime(date1, date0); // poorly named\r\n }\r\n }\r\n dateDelta = subtractDates(dateProfile1.start, dateProfile0.start);\r\n if (dateProfile1.end) {\r\n // use unzonedRanges because dateProfile0.end might be null\r\n endDiff = subtractDates(dateProfile1.unzonedRange.getEnd(), dateProfile0.unzonedRange.getEnd());\r\n endDelta = endDiff.subtract(dateDelta);\r\n }\r\n mutation = new EventDefDateMutation();\r\n mutation.clearEnd = clearEnd;\r\n mutation.forceTimed = forceTimed;\r\n mutation.forceAllDay = forceAllDay;\r\n mutation.setDateDelta(dateDelta);\r\n mutation.setEndDelta(endDelta);\r\n return mutation;\r\n };\r\n /*\r\n returns an undo function.\r\n */\r\n EventDefDateMutation.prototype.buildNewDateProfile = function (eventDateProfile, calendar) {\r\n var start = eventDateProfile.start.clone();\r\n var end = null;\r\n var shouldRezone = false;\r\n if (eventDateProfile.end && !this.clearEnd) {\r\n end = eventDateProfile.end.clone();\r\n }\r\n else if (this.endDelta && !end) {\r\n end = calendar.getDefaultEventEnd(eventDateProfile.isAllDay(), start);\r\n }\r\n if (this.forceTimed) {\r\n shouldRezone = true;\r\n if (!start.hasTime()) {\r\n start.time(0);\r\n }\r\n if (end && !end.hasTime()) {\r\n end.time(0);\r\n }\r\n }\r\n else if (this.forceAllDay) {\r\n if (start.hasTime()) {\r\n start.stripTime();\r\n }\r\n if (end && end.hasTime()) {\r\n end.stripTime();\r\n }\r\n }\r\n if (this.dateDelta) {\r\n shouldRezone = true;\r\n start.add(this.dateDelta);\r\n if (end) {\r\n end.add(this.dateDelta);\r\n }\r\n }\r\n // do this before adding startDelta to start, so we can work off of start\r\n if (this.endDelta) {\r\n shouldRezone = true;\r\n end.add(this.endDelta);\r\n }\r\n if (this.startDelta) {\r\n shouldRezone = true;\r\n start.add(this.startDelta);\r\n }\r\n if (shouldRezone) {\r\n start = calendar.applyTimezone(start);\r\n if (end) {\r\n end = calendar.applyTimezone(end);\r\n }\r\n }\r\n // TODO: okay to access calendar option?\r\n if (!end && calendar.opt('forceEventDuration')) {\r\n end = calendar.getDefaultEventEnd(eventDateProfile.isAllDay(), start);\r\n }\r\n return new EventDateProfile_1.default(start, end, calendar);\r\n };\r\n EventDefDateMutation.prototype.setDateDelta = function (dateDelta) {\r\n if (dateDelta && dateDelta.valueOf()) {\r\n this.dateDelta = dateDelta;\r\n }\r\n else {\r\n this.dateDelta = null;\r\n }\r\n };\r\n EventDefDateMutation.prototype.setStartDelta = function (startDelta) {\r\n if (startDelta && startDelta.valueOf()) {\r\n this.startDelta = startDelta;\r\n }\r\n else {\r\n this.startDelta = null;\r\n }\r\n };\r\n EventDefDateMutation.prototype.setEndDelta = function (endDelta) {\r\n if (endDelta && endDelta.valueOf()) {\r\n this.endDelta = endDelta;\r\n }\r\n else {\r\n this.endDelta = null;\r\n }\r\n };\r\n EventDefDateMutation.prototype.isEmpty = function () {\r\n return !this.clearEnd && !this.forceTimed && !this.forceAllDay &&\r\n !this.dateDelta && !this.startDelta && !this.endDelta;\r\n };\r\n return EventDefDateMutation;\r\n}());\r\nexports.default = EventDefDateMutation;\r\n\n\n/***/ }),\n/* 41 */\n/***/ (function(module, exports, __webpack_require__) {\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar tslib_1 = __webpack_require__(2);\r\nvar $ = __webpack_require__(3);\r\nvar util_1 = __webpack_require__(4);\r\nvar Class_1 = __webpack_require__(35);\r\n/*\r\nEmbodies a div that has potential scrollbars\r\n*/\r\nvar Scroller = /** @class */ (function (_super) {\r\n tslib_1.__extends(Scroller, _super);\r\n function Scroller(options) {\r\n var _this = _super.call(this) || this;\r\n options = options || {};\r\n _this.overflowX = options.overflowX || options.overflow || 'auto';\r\n _this.overflowY = options.overflowY || options.overflow || 'auto';\r\n return _this;\r\n }\r\n Scroller.prototype.render = function () {\r\n this.el = this.renderEl();\r\n this.applyOverflow();\r\n };\r\n Scroller.prototype.renderEl = function () {\r\n return (this.scrollEl = $(''));\r\n };\r\n // sets to natural height, unlocks overflow\r\n Scroller.prototype.clear = function () {\r\n this.setHeight('auto');\r\n this.applyOverflow();\r\n };\r\n Scroller.prototype.destroy = function () {\r\n this.el.remove();\r\n };\r\n // Overflow\r\n // -----------------------------------------------------------------------------------------------------------------\r\n Scroller.prototype.applyOverflow = function () {\r\n this.scrollEl.css({\r\n 'overflow-x': this.overflowX,\r\n 'overflow-y': this.overflowY\r\n });\r\n };\r\n // Causes any 'auto' overflow values to resolves to 'scroll' or 'hidden'.\r\n // Useful for preserving scrollbar widths regardless of future resizes.\r\n // Can pass in scrollbarWidths for optimization.\r\n Scroller.prototype.lockOverflow = function (scrollbarWidths) {\r\n var overflowX = this.overflowX;\r\n var overflowY = this.overflowY;\r\n scrollbarWidths = scrollbarWidths || this.getScrollbarWidths();\r\n if (overflowX === 'auto') {\r\n overflowX = (scrollbarWidths.top || scrollbarWidths.bottom || // horizontal scrollbars?\r\n // OR scrolling pane with massless scrollbars?\r\n this.scrollEl[0].scrollWidth - 1 > this.scrollEl[0].clientWidth\r\n // subtract 1 because of IE off-by-one issue\r\n ) ? 'scroll' : 'hidden';\r\n }\r\n if (overflowY === 'auto') {\r\n overflowY = (scrollbarWidths.left || scrollbarWidths.right || // vertical scrollbars?\r\n // OR scrolling pane with massless scrollbars?\r\n this.scrollEl[0].scrollHeight - 1 > this.scrollEl[0].clientHeight\r\n // subtract 1 because of IE off-by-one issue\r\n ) ? 'scroll' : 'hidden';\r\n }\r\n this.scrollEl.css({ 'overflow-x': overflowX, 'overflow-y': overflowY });\r\n };\r\n // Getters / Setters\r\n // -----------------------------------------------------------------------------------------------------------------\r\n Scroller.prototype.setHeight = function (height) {\r\n this.scrollEl.height(height);\r\n };\r\n Scroller.prototype.getScrollTop = function () {\r\n return this.scrollEl.scrollTop();\r\n };\r\n Scroller.prototype.setScrollTop = function (top) {\r\n this.scrollEl.scrollTop(top);\r\n };\r\n Scroller.prototype.getClientWidth = function () {\r\n return this.scrollEl[0].clientWidth;\r\n };\r\n Scroller.prototype.getClientHeight = function () {\r\n return this.scrollEl[0].clientHeight;\r\n };\r\n Scroller.prototype.getScrollbarWidths = function () {\r\n return util_1.getScrollbarWidths(this.scrollEl);\r\n };\r\n return Scroller;\r\n}(Class_1.default));\r\nexports.default = Scroller;\r\n\n\n/***/ }),\n/* 42 */\n/***/ (function(module, exports, __webpack_require__) {\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar tslib_1 = __webpack_require__(2);\r\nvar $ = __webpack_require__(3);\r\nvar util_1 = __webpack_require__(4);\r\nvar DateComponent_1 = __webpack_require__(231);\r\nvar GlobalEmitter_1 = __webpack_require__(23);\r\nvar InteractiveDateComponent = /** @class */ (function (_super) {\r\n tslib_1.__extends(InteractiveDateComponent, _super);\r\n function InteractiveDateComponent(_view, _options) {\r\n var _this = _super.call(this, _view, _options) || this;\r\n // self-config, overridable by subclasses\r\n _this.segSelector = '.fc-event-container > *'; // what constitutes an event element?\r\n if (_this.dateSelectingClass) {\r\n _this.dateClicking = new _this.dateClickingClass(_this);\r\n }\r\n if (_this.dateSelectingClass) {\r\n _this.dateSelecting = new _this.dateSelectingClass(_this);\r\n }\r\n if (_this.eventPointingClass) {\r\n _this.eventPointing = new _this.eventPointingClass(_this);\r\n }\r\n if (_this.eventDraggingClass && _this.eventPointing) {\r\n _this.eventDragging = new _this.eventDraggingClass(_this, _this.eventPointing);\r\n }\r\n if (_this.eventResizingClass && _this.eventPointing) {\r\n _this.eventResizing = new _this.eventResizingClass(_this, _this.eventPointing);\r\n }\r\n if (_this.externalDroppingClass) {\r\n _this.externalDropping = new _this.externalDroppingClass(_this);\r\n }\r\n return _this;\r\n }\r\n // Sets the container element that the view should render inside of, does global DOM-related initializations,\r\n // and renders all the non-date-related content inside.\r\n InteractiveDateComponent.prototype.setElement = function (el) {\r\n _super.prototype.setElement.call(this, el);\r\n if (this.dateClicking) {\r\n this.dateClicking.bindToEl(el);\r\n }\r\n if (this.dateSelecting) {\r\n this.dateSelecting.bindToEl(el);\r\n }\r\n this.bindAllSegHandlersToEl(el);\r\n };\r\n InteractiveDateComponent.prototype.removeElement = function () {\r\n this.endInteractions();\r\n _super.prototype.removeElement.call(this);\r\n };\r\n InteractiveDateComponent.prototype.executeEventUnrender = function () {\r\n this.endInteractions();\r\n _super.prototype.executeEventUnrender.call(this);\r\n };\r\n InteractiveDateComponent.prototype.bindGlobalHandlers = function () {\r\n _super.prototype.bindGlobalHandlers.call(this);\r\n if (this.externalDropping) {\r\n this.externalDropping.bindToDocument();\r\n }\r\n };\r\n InteractiveDateComponent.prototype.unbindGlobalHandlers = function () {\r\n _super.prototype.unbindGlobalHandlers.call(this);\r\n if (this.externalDropping) {\r\n this.externalDropping.unbindFromDocument();\r\n }\r\n };\r\n InteractiveDateComponent.prototype.bindDateHandlerToEl = function (el, name, handler) {\r\n var _this = this;\r\n // attach a handler to the grid's root element.\r\n // jQuery will take care of unregistering them when removeElement gets called.\r\n this.el.on(name, function (ev) {\r\n if (!$(ev.target).is(_this.segSelector + ':not(.fc-helper),' + // directly on an event element\r\n _this.segSelector + ':not(.fc-helper) *,' + // within an event element\r\n '.fc-more,' + // a \"more..\" link\r\n 'a[data-goto]' // a clickable nav link\r\n )) {\r\n return handler.call(_this, ev);\r\n }\r\n });\r\n };\r\n InteractiveDateComponent.prototype.bindAllSegHandlersToEl = function (el) {\r\n [\r\n this.eventPointing,\r\n this.eventDragging,\r\n this.eventResizing\r\n ].forEach(function (eventInteraction) {\r\n if (eventInteraction) {\r\n eventInteraction.bindToEl(el);\r\n }\r\n });\r\n };\r\n InteractiveDateComponent.prototype.bindSegHandlerToEl = function (el, name, handler) {\r\n var _this = this;\r\n el.on(name, this.segSelector, function (ev) {\r\n var segEl = $(ev.currentTarget);\r\n if (!segEl.is('.fc-helper')) {\r\n var seg = segEl.data('fc-seg'); // grab segment data. put there by View::renderEventsPayload\r\n if (seg && !_this.shouldIgnoreEventPointing()) {\r\n return handler.call(_this, seg, ev); // context will be the Grid\r\n }\r\n }\r\n });\r\n };\r\n InteractiveDateComponent.prototype.shouldIgnoreMouse = function () {\r\n // HACK\r\n // This will still work even though bindDateHandlerToEl doesn't use GlobalEmitter.\r\n return GlobalEmitter_1.default.get().shouldIgnoreMouse();\r\n };\r\n InteractiveDateComponent.prototype.shouldIgnoreTouch = function () {\r\n var view = this._getView();\r\n // On iOS (and Android?) when a new selection is initiated overtop another selection,\r\n // the touchend never fires because the elements gets removed mid-touch-interaction (my theory).\r\n // HACK: simply don't allow this to happen.\r\n // ALSO: prevent selection when an *event* is already raised.\r\n return view.isSelected || view.selectedEvent;\r\n };\r\n InteractiveDateComponent.prototype.shouldIgnoreEventPointing = function () {\r\n // only call the handlers if there is not a drag/resize in progress\r\n return (this.eventDragging && this.eventDragging.isDragging) ||\r\n (this.eventResizing && this.eventResizing.isResizing);\r\n };\r\n InteractiveDateComponent.prototype.canStartSelection = function (seg, ev) {\r\n return util_1.getEvIsTouch(ev) &&\r\n !this.canStartResize(seg, ev) &&\r\n (this.isEventDefDraggable(seg.footprint.eventDef) ||\r\n this.isEventDefResizable(seg.footprint.eventDef));\r\n };\r\n InteractiveDateComponent.prototype.canStartDrag = function (seg, ev) {\r\n return !this.canStartResize(seg, ev) &&\r\n this.isEventDefDraggable(seg.footprint.eventDef);\r\n };\r\n InteractiveDateComponent.prototype.canStartResize = function (seg, ev) {\r\n var view = this._getView();\r\n var eventDef = seg.footprint.eventDef;\r\n return (!util_1.getEvIsTouch(ev) || view.isEventDefSelected(eventDef)) &&\r\n this.isEventDefResizable(eventDef) &&\r\n $(ev.target).is('.fc-resizer');\r\n };\r\n // Kills all in-progress dragging.\r\n // Useful for when public API methods that result in re-rendering are invoked during a drag.\r\n // Also useful for when touch devices misbehave and don't fire their touchend.\r\n InteractiveDateComponent.prototype.endInteractions = function () {\r\n [\r\n this.dateClicking,\r\n this.dateSelecting,\r\n this.eventPointing,\r\n this.eventDragging,\r\n this.eventResizing\r\n ].forEach(function (interaction) {\r\n if (interaction) {\r\n interaction.end();\r\n }\r\n });\r\n };\r\n // Event Drag-n-Drop\r\n // ---------------------------------------------------------------------------------------------------------------\r\n // Computes if the given event is allowed to be dragged by the user\r\n InteractiveDateComponent.prototype.isEventDefDraggable = function (eventDef) {\r\n return this.isEventDefStartEditable(eventDef);\r\n };\r\n InteractiveDateComponent.prototype.isEventDefStartEditable = function (eventDef) {\r\n var isEditable = eventDef.isStartExplicitlyEditable();\r\n if (isEditable == null) {\r\n isEditable = this.opt('eventStartEditable');\r\n if (isEditable == null) {\r\n isEditable = this.isEventDefGenerallyEditable(eventDef);\r\n }\r\n }\r\n return isEditable;\r\n };\r\n InteractiveDateComponent.prototype.isEventDefGenerallyEditable = function (eventDef) {\r\n var isEditable = eventDef.isExplicitlyEditable();\r\n if (isEditable == null) {\r\n isEditable = this.opt('editable');\r\n }\r\n return isEditable;\r\n };\r\n // Event Resizing\r\n // ---------------------------------------------------------------------------------------------------------------\r\n // Computes if the given event is allowed to be resized from its starting edge\r\n InteractiveDateComponent.prototype.isEventDefResizableFromStart = function (eventDef) {\r\n return this.opt('eventResizableFromStart') && this.isEventDefResizable(eventDef);\r\n };\r\n // Computes if the given event is allowed to be resized from its ending edge\r\n InteractiveDateComponent.prototype.isEventDefResizableFromEnd = function (eventDef) {\r\n return this.isEventDefResizable(eventDef);\r\n };\r\n // Computes if the given event is allowed to be resized by the user at all\r\n InteractiveDateComponent.prototype.isEventDefResizable = function (eventDef) {\r\n var isResizable = eventDef.isDurationExplicitlyEditable();\r\n if (isResizable == null) {\r\n isResizable = this.opt('eventDurationEditable');\r\n if (isResizable == null) {\r\n isResizable = this.isEventDefGenerallyEditable(eventDef);\r\n }\r\n }\r\n return isResizable;\r\n };\r\n // Event Mutation / Constraints\r\n // ---------------------------------------------------------------------------------------------------------------\r\n // Diffs the two dates, returning a duration, based on granularity of the grid\r\n // TODO: port isTimeScale into this system?\r\n InteractiveDateComponent.prototype.diffDates = function (a, b) {\r\n if (this.largeUnit) {\r\n return util_1.diffByUnit(a, b, this.largeUnit);\r\n }\r\n else {\r\n return util_1.diffDayTime(a, b);\r\n }\r\n };\r\n // is it allowed, in relation to the view's validRange?\r\n // NOTE: very similar to isExternalInstanceGroupAllowed\r\n InteractiveDateComponent.prototype.isEventInstanceGroupAllowed = function (eventInstanceGroup) {\r\n var view = this._getView();\r\n var dateProfile = this.dateProfile;\r\n var eventFootprints = this.eventRangesToEventFootprints(eventInstanceGroup.getAllEventRanges());\r\n var i;\r\n for (i = 0; i < eventFootprints.length; i++) {\r\n // TODO: just use getAllEventRanges directly\r\n if (!dateProfile.validUnzonedRange.containsRange(eventFootprints[i].componentFootprint.unzonedRange)) {\r\n return false;\r\n }\r\n }\r\n return view.calendar.constraints.isEventInstanceGroupAllowed(eventInstanceGroup);\r\n };\r\n // NOTE: very similar to isEventInstanceGroupAllowed\r\n // when it's a completely anonymous external drag, no event.\r\n InteractiveDateComponent.prototype.isExternalInstanceGroupAllowed = function (eventInstanceGroup) {\r\n var view = this._getView();\r\n var dateProfile = this.dateProfile;\r\n var eventFootprints = this.eventRangesToEventFootprints(eventInstanceGroup.getAllEventRanges());\r\n var i;\r\n for (i = 0; i < eventFootprints.length; i++) {\r\n if (!dateProfile.validUnzonedRange.containsRange(eventFootprints[i].componentFootprint.unzonedRange)) {\r\n return false;\r\n }\r\n }\r\n for (i = 0; i < eventFootprints.length; i++) {\r\n // treat it as a selection\r\n // TODO: pass in eventInstanceGroup instead\r\n // because we don't want calendar's constraint system to depend on a component's\r\n // determination of footprints.\r\n if (!view.calendar.constraints.isSelectionFootprintAllowed(eventFootprints[i].componentFootprint)) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n };\r\n return InteractiveDateComponent;\r\n}(DateComponent_1.default));\r\nexports.default = InteractiveDateComponent;\r\n\n\n/***/ }),\n/* 43 */\n/***/ (function(module, exports, __webpack_require__) {\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar tslib_1 = __webpack_require__(2);\r\nvar $ = __webpack_require__(3);\r\nvar moment = __webpack_require__(0);\r\nvar util_1 = __webpack_require__(4);\r\nvar RenderQueue_1 = __webpack_require__(229);\r\nvar DateProfileGenerator_1 = __webpack_require__(55);\r\nvar InteractiveDateComponent_1 = __webpack_require__(42);\r\nvar GlobalEmitter_1 = __webpack_require__(23);\r\nvar UnzonedRange_1 = __webpack_require__(5);\r\n/* An abstract class from which other views inherit from\r\n----------------------------------------------------------------------------------------------------------------------*/\r\nvar View = /** @class */ (function (_super) {\r\n tslib_1.__extends(View, _super);\r\n function View(calendar, viewSpec) {\r\n var _this = _super.call(this, null, viewSpec.options) || this;\r\n _this.batchRenderDepth = 0;\r\n _this.isSelected = false; // boolean whether a range of time is user-selected or not\r\n _this.calendar = calendar;\r\n _this.viewSpec = viewSpec;\r\n // shortcuts\r\n _this.type = viewSpec.type;\r\n // .name is deprecated\r\n _this.name = _this.type;\r\n _this.initRenderQueue();\r\n _this.initHiddenDays();\r\n _this.dateProfileGenerator = new _this.dateProfileGeneratorClass(_this);\r\n _this.bindBaseRenderHandlers();\r\n _this.eventOrderSpecs = util_1.parseFieldSpecs(_this.opt('eventOrder'));\r\n // legacy\r\n if (_this['initialize']) {\r\n _this['initialize']();\r\n }\r\n return _this;\r\n }\r\n View.prototype._getView = function () {\r\n return this;\r\n };\r\n // Retrieves an option with the given name\r\n View.prototype.opt = function (name) {\r\n return this.options[name];\r\n };\r\n /* Render Queue\r\n ------------------------------------------------------------------------------------------------------------------*/\r\n View.prototype.initRenderQueue = function () {\r\n this.renderQueue = new RenderQueue_1.default({\r\n event: this.opt('eventRenderWait')\r\n });\r\n this.renderQueue.on('start', this.onRenderQueueStart.bind(this));\r\n this.renderQueue.on('stop', this.onRenderQueueStop.bind(this));\r\n this.on('before:change', this.startBatchRender);\r\n this.on('change', this.stopBatchRender);\r\n };\r\n View.prototype.onRenderQueueStart = function () {\r\n this.calendar.freezeContentHeight();\r\n this.addScroll(this.queryScroll());\r\n };\r\n View.prototype.onRenderQueueStop = function () {\r\n if (this.calendar.updateViewSize()) { // success?\r\n this.popScroll();\r\n }\r\n this.calendar.thawContentHeight();\r\n };\r\n View.prototype.startBatchRender = function () {\r\n if (!(this.batchRenderDepth++)) {\r\n this.renderQueue.pause();\r\n }\r\n };\r\n View.prototype.stopBatchRender = function () {\r\n if (!(--this.batchRenderDepth)) {\r\n this.renderQueue.resume();\r\n }\r\n };\r\n View.prototype.requestRender = function (func, namespace, actionType) {\r\n this.renderQueue.queue(func, namespace, actionType);\r\n };\r\n // given func will auto-bind to `this`\r\n View.prototype.whenSizeUpdated = function (func) {\r\n if (this.renderQueue.isRunning) {\r\n this.renderQueue.one('stop', func.bind(this));\r\n }\r\n else {\r\n func.call(this);\r\n }\r\n };\r\n /* Title and Date Formatting\r\n ------------------------------------------------------------------------------------------------------------------*/\r\n // Computes what the title at the top of the calendar should be for this view\r\n View.prototype.computeTitle = function (dateProfile) {\r\n var unzonedRange;\r\n // for views that span a large unit of time, show the proper interval, ignoring stray days before and after\r\n if (/^(year|month)$/.test(dateProfile.currentRangeUnit)) {\r\n unzonedRange = dateProfile.currentUnzonedRange;\r\n }\r\n else { // for day units or smaller, use the actual day range\r\n unzonedRange = dateProfile.activeUnzonedRange;\r\n }\r\n return this.formatRange({\r\n start: this.calendar.msToMoment(unzonedRange.startMs, dateProfile.isRangeAllDay),\r\n end: this.calendar.msToMoment(unzonedRange.endMs, dateProfile.isRangeAllDay)\r\n }, dateProfile.isRangeAllDay, this.opt('titleFormat') || this.computeTitleFormat(dateProfile), this.opt('titleRangeSeparator'));\r\n };\r\n // Generates the format string that should be used to generate the title for the current date range.\r\n // Attempts to compute the most appropriate format if not explicitly specified with `titleFormat`.\r\n View.prototype.computeTitleFormat = function (dateProfile) {\r\n var currentRangeUnit = dateProfile.currentRangeUnit;\r\n if (currentRangeUnit === 'year') {\r\n return 'YYYY';\r\n }\r\n else if (currentRangeUnit === 'month') {\r\n return this.opt('monthYearFormat'); // like \"September 2014\"\r\n }\r\n else if (dateProfile.currentUnzonedRange.as('days') > 1) {\r\n return 'll'; // multi-day range. shorter, like \"Sep 9 - 10 2014\"\r\n }\r\n else {\r\n return 'LL'; // one day. longer, like \"September 9 2014\"\r\n }\r\n };\r\n // Date Setting/Unsetting\r\n // -----------------------------------------------------------------------------------------------------------------\r\n View.prototype.setDate = function (date) {\r\n var currentDateProfile = this.get('dateProfile');\r\n var newDateProfile = this.dateProfileGenerator.build(date, undefined, true); // forceToValid=true\r\n if (!currentDateProfile ||\r\n !currentDateProfile.activeUnzonedRange.equals(newDateProfile.activeUnzonedRange)) {\r\n this.set('dateProfile', newDateProfile);\r\n }\r\n };\r\n View.prototype.unsetDate = function () {\r\n this.unset('dateProfile');\r\n };\r\n // Event Data\r\n // -----------------------------------------------------------------------------------------------------------------\r\n View.prototype.fetchInitialEvents = function (dateProfile) {\r\n var calendar = this.calendar;\r\n var forceAllDay = dateProfile.isRangeAllDay && !this.usesMinMaxTime;\r\n return calendar.requestEvents(calendar.msToMoment(dateProfile.activeUnzonedRange.startMs, forceAllDay), calendar.msToMoment(dateProfile.activeUnzonedRange.endMs, forceAllDay));\r\n };\r\n View.prototype.bindEventChanges = function () {\r\n this.listenTo(this.calendar, 'eventsReset', this.resetEvents); // TODO: make this a real event\r\n };\r\n View.prototype.unbindEventChanges = function () {\r\n this.stopListeningTo(this.calendar, 'eventsReset');\r\n };\r\n View.prototype.setEvents = function (eventsPayload) {\r\n this.set('currentEvents', eventsPayload);\r\n this.set('hasEvents', true);\r\n };\r\n View.prototype.unsetEvents = function () {\r\n this.unset('currentEvents');\r\n this.unset('hasEvents');\r\n };\r\n View.prototype.resetEvents = function (eventsPayload) {\r\n this.startBatchRender();\r\n this.unsetEvents();\r\n this.setEvents(eventsPayload);\r\n this.stopBatchRender();\r\n };\r\n // Date High-level Rendering\r\n // -----------------------------------------------------------------------------------------------------------------\r\n View.prototype.requestDateRender = function (dateProfile) {\r\n var _this = this;\r\n this.requestRender(function () {\r\n _this.executeDateRender(dateProfile);\r\n }, 'date', 'init');\r\n };\r\n View.prototype.requestDateUnrender = function () {\r\n var _this = this;\r\n this.requestRender(function () {\r\n _this.executeDateUnrender();\r\n }, 'date', 'destroy');\r\n };\r\n // if dateProfile not specified, uses current\r\n View.prototype.executeDateRender = function (dateProfile) {\r\n _super.prototype.executeDateRender.call(this, dateProfile);\r\n if (this['render']) {\r\n this['render'](); // TODO: deprecate\r\n }\r\n this.trigger('datesRendered');\r\n this.addScroll({ isDateInit: true });\r\n this.startNowIndicator(); // shouldn't render yet because updateSize will be called soon\r\n };\r\n View.prototype.executeDateUnrender = function () {\r\n this.unselect();\r\n this.stopNowIndicator();\r\n this.trigger('before:datesUnrendered');\r\n if (this['destroy']) {\r\n this['destroy'](); // TODO: deprecate\r\n }\r\n _super.prototype.executeDateUnrender.call(this);\r\n };\r\n // \"Base\" rendering\r\n // -----------------------------------------------------------------------------------------------------------------\r\n View.prototype.bindBaseRenderHandlers = function () {\r\n var _this = this;\r\n this.on('datesRendered', function () {\r\n _this.whenSizeUpdated(_this.triggerViewRender);\r\n });\r\n this.on('before:datesUnrendered', function () {\r\n _this.triggerViewDestroy();\r\n });\r\n };\r\n View.prototype.triggerViewRender = function () {\r\n this.publiclyTrigger('viewRender', {\r\n context: this,\r\n args: [this, this.el]\r\n });\r\n };\r\n View.prototype.triggerViewDestroy = function () {\r\n this.publiclyTrigger('viewDestroy', {\r\n context: this,\r\n args: [this, this.el]\r\n });\r\n };\r\n // Event High-level Rendering\r\n // -----------------------------------------------------------------------------------------------------------------\r\n View.prototype.requestEventsRender = function (eventsPayload) {\r\n var _this = this;\r\n this.requestRender(function () {\r\n _this.executeEventRender(eventsPayload);\r\n _this.whenSizeUpdated(_this.triggerAfterEventsRendered);\r\n }, 'event', 'init');\r\n };\r\n View.prototype.requestEventsUnrender = function () {\r\n var _this = this;\r\n this.requestRender(function () {\r\n _this.triggerBeforeEventsDestroyed();\r\n _this.executeEventUnrender();\r\n }, 'event', 'destroy');\r\n };\r\n // Business Hour High-level Rendering\r\n // -----------------------------------------------------------------------------------------------------------------\r\n View.prototype.requestBusinessHoursRender = function (businessHourGenerator) {\r\n var _this = this;\r\n this.requestRender(function () {\r\n _this.renderBusinessHours(businessHourGenerator);\r\n }, 'businessHours', 'init');\r\n };\r\n View.prototype.requestBusinessHoursUnrender = function () {\r\n var _this = this;\r\n this.requestRender(function () {\r\n _this.unrenderBusinessHours();\r\n }, 'businessHours', 'destroy');\r\n };\r\n // Misc view rendering utils\r\n // -----------------------------------------------------------------------------------------------------------------\r\n // Binds DOM handlers to elements that reside outside the view container, such as the document\r\n View.prototype.bindGlobalHandlers = function () {\r\n _super.prototype.bindGlobalHandlers.call(this);\r\n this.listenTo(GlobalEmitter_1.default.get(), {\r\n touchstart: this.processUnselect,\r\n mousedown: this.handleDocumentMousedown\r\n });\r\n };\r\n // Unbinds DOM handlers from elements that reside outside the view container\r\n View.prototype.unbindGlobalHandlers = function () {\r\n _super.prototype.unbindGlobalHandlers.call(this);\r\n this.stopListeningTo(GlobalEmitter_1.default.get());\r\n };\r\n /* Now Indicator\r\n ------------------------------------------------------------------------------------------------------------------*/\r\n // Immediately render the current time indicator and begins re-rendering it at an interval,\r\n // which is defined by this.getNowIndicatorUnit().\r\n // TODO: somehow do this for the current whole day's background too\r\n View.prototype.startNowIndicator = function () {\r\n var _this = this;\r\n var unit;\r\n var update;\r\n var delay; // ms wait value\r\n if (this.opt('nowIndicator')) {\r\n unit = this.getNowIndicatorUnit();\r\n if (unit) {\r\n update = util_1.proxy(this, 'updateNowIndicator'); // bind to `this`\r\n this.initialNowDate = this.calendar.getNow();\r\n this.initialNowQueriedMs = new Date().valueOf();\r\n // wait until the beginning of the next interval\r\n delay = this.initialNowDate.clone().startOf(unit).add(1, unit).valueOf() - this.initialNowDate.valueOf();\r\n this.nowIndicatorTimeoutID = setTimeout(function () {\r\n _this.nowIndicatorTimeoutID = null;\r\n update();\r\n delay = +moment.duration(1, unit);\r\n delay = Math.max(100, delay); // prevent too frequent\r\n _this.nowIndicatorIntervalID = setInterval(update, delay); // update every interval\r\n }, delay);\r\n }\r\n // rendering will be initiated in updateSize\r\n }\r\n };\r\n // rerenders the now indicator, computing the new current time from the amount of time that has passed\r\n // since the initial getNow call.\r\n View.prototype.updateNowIndicator = function () {\r\n if (this.isDatesRendered &&\r\n this.initialNowDate // activated before?\r\n ) {\r\n this.unrenderNowIndicator(); // won't unrender if unnecessary\r\n this.renderNowIndicator(this.initialNowDate.clone().add(new Date().valueOf() - this.initialNowQueriedMs) // add ms\r\n );\r\n this.isNowIndicatorRendered = true;\r\n }\r\n };\r\n // Immediately unrenders the view's current time indicator and stops any re-rendering timers.\r\n // Won't cause side effects if indicator isn't rendered.\r\n View.prototype.stopNowIndicator = function () {\r\n if (this.isNowIndicatorRendered) {\r\n if (this.nowIndicatorTimeoutID) {\r\n clearTimeout(this.nowIndicatorTimeoutID);\r\n this.nowIndicatorTimeoutID = null;\r\n }\r\n if (this.nowIndicatorIntervalID) {\r\n clearInterval(this.nowIndicatorIntervalID);\r\n this.nowIndicatorIntervalID = null;\r\n }\r\n this.unrenderNowIndicator();\r\n this.isNowIndicatorRendered = false;\r\n }\r\n };\r\n /* Dimensions\r\n ------------------------------------------------------------------------------------------------------------------*/\r\n View.prototype.updateSize = function (totalHeight, isAuto, isResize) {\r\n if (this['setHeight']) { // for legacy API\r\n this['setHeight'](totalHeight, isAuto);\r\n }\r\n else {\r\n _super.prototype.updateSize.call(this, totalHeight, isAuto, isResize);\r\n }\r\n this.updateNowIndicator();\r\n };\r\n /* Scroller\r\n ------------------------------------------------------------------------------------------------------------------*/\r\n View.prototype.addScroll = function (scroll) {\r\n var queuedScroll = this.queuedScroll || (this.queuedScroll = {});\r\n $.extend(queuedScroll, scroll);\r\n };\r\n View.prototype.popScroll = function () {\r\n this.applyQueuedScroll();\r\n this.queuedScroll = null;\r\n };\r\n View.prototype.applyQueuedScroll = function () {\r\n if (this.queuedScroll) {\r\n this.applyScroll(this.queuedScroll);\r\n }\r\n };\r\n View.prototype.queryScroll = function () {\r\n var scroll = {};\r\n if (this.isDatesRendered) {\r\n $.extend(scroll, this.queryDateScroll());\r\n }\r\n return scroll;\r\n };\r\n View.prototype.applyScroll = function (scroll) {\r\n if (scroll.isDateInit && this.isDatesRendered) {\r\n $.extend(scroll, this.computeInitialDateScroll());\r\n }\r\n if (this.isDatesRendered) {\r\n this.applyDateScroll(scroll);\r\n }\r\n };\r\n View.prototype.computeInitialDateScroll = function () {\r\n return {}; // subclasses must implement\r\n };\r\n View.prototype.queryDateScroll = function () {\r\n return {}; // subclasses must implement\r\n };\r\n View.prototype.applyDateScroll = function (scroll) {\r\n // subclasses must implement\r\n };\r\n /* Event Drag-n-Drop\r\n ------------------------------------------------------------------------------------------------------------------*/\r\n View.prototype.reportEventDrop = function (eventInstance, eventMutation, el, ev) {\r\n var eventManager = this.calendar.eventManager;\r\n var undoFunc = eventManager.mutateEventsWithId(eventInstance.def.id, eventMutation);\r\n var dateMutation = eventMutation.dateMutation;\r\n // update the EventInstance, for handlers\r\n if (dateMutation) {\r\n eventInstance.dateProfile = dateMutation.buildNewDateProfile(eventInstance.dateProfile, this.calendar);\r\n }\r\n this.triggerEventDrop(eventInstance, \r\n // a drop doesn't necessarily mean a date mutation (ex: resource change)\r\n (dateMutation && dateMutation.dateDelta) || moment.duration(), undoFunc, el, ev);\r\n };\r\n // Triggers event-drop handlers that have subscribed via the API\r\n View.prototype.triggerEventDrop = function (eventInstance, dateDelta, undoFunc, el, ev) {\r\n this.publiclyTrigger('eventDrop', {\r\n context: el[0],\r\n args: [\r\n eventInstance.toLegacy(),\r\n dateDelta,\r\n undoFunc,\r\n ev,\r\n {},\r\n this\r\n ]\r\n });\r\n };\r\n /* External Element Drag-n-Drop\r\n ------------------------------------------------------------------------------------------------------------------*/\r\n // Must be called when an external element, via jQuery UI, has been dropped onto the calendar.\r\n // `meta` is the parsed data that has been embedded into the dragging event.\r\n // `dropLocation` is an object that contains the new zoned start/end/allDay values for the event.\r\n View.prototype.reportExternalDrop = function (singleEventDef, isEvent, isSticky, el, ev, ui) {\r\n if (isEvent) {\r\n this.calendar.eventManager.addEventDef(singleEventDef, isSticky);\r\n }\r\n this.triggerExternalDrop(singleEventDef, isEvent, el, ev, ui);\r\n };\r\n // Triggers external-drop handlers that have subscribed via the API\r\n View.prototype.triggerExternalDrop = function (singleEventDef, isEvent, el, ev, ui) {\r\n // trigger 'drop' regardless of whether element represents an event\r\n this.publiclyTrigger('drop', {\r\n context: el[0],\r\n args: [\r\n singleEventDef.dateProfile.start.clone(),\r\n ev,\r\n ui,\r\n this\r\n ]\r\n });\r\n if (isEvent) {\r\n // signal an external event landed\r\n this.publiclyTrigger('eventReceive', {\r\n context: this,\r\n args: [\r\n singleEventDef.buildInstance().toLegacy(),\r\n this\r\n ]\r\n });\r\n }\r\n };\r\n /* Event Resizing\r\n ------------------------------------------------------------------------------------------------------------------*/\r\n // Must be called when an event in the view has been resized to a new length\r\n View.prototype.reportEventResize = function (eventInstance, eventMutation, el, ev) {\r\n var eventManager = this.calendar.eventManager;\r\n var undoFunc = eventManager.mutateEventsWithId(eventInstance.def.id, eventMutation);\r\n // update the EventInstance, for handlers\r\n eventInstance.dateProfile = eventMutation.dateMutation.buildNewDateProfile(eventInstance.dateProfile, this.calendar);\r\n var resizeDelta = eventMutation.dateMutation.endDelta || eventMutation.dateMutation.startDelta;\r\n this.triggerEventResize(eventInstance, resizeDelta, undoFunc, el, ev);\r\n };\r\n // Triggers event-resize handlers that have subscribed via the API\r\n View.prototype.triggerEventResize = function (eventInstance, resizeDelta, undoFunc, el, ev) {\r\n this.publiclyTrigger('eventResize', {\r\n context: el[0],\r\n args: [\r\n eventInstance.toLegacy(),\r\n resizeDelta,\r\n undoFunc,\r\n ev,\r\n {},\r\n this\r\n ]\r\n });\r\n };\r\n /* Selection (time range)\r\n ------------------------------------------------------------------------------------------------------------------*/\r\n // Selects a date span on the view. `start` and `end` are both Moments.\r\n // `ev` is the native mouse event that begin the interaction.\r\n View.prototype.select = function (footprint, ev) {\r\n this.unselect(ev);\r\n this.renderSelectionFootprint(footprint);\r\n this.reportSelection(footprint, ev);\r\n };\r\n View.prototype.renderSelectionFootprint = function (footprint) {\r\n if (this['renderSelection']) { // legacy method in custom view classes\r\n this['renderSelection'](footprint.toLegacy(this.calendar));\r\n }\r\n else {\r\n _super.prototype.renderSelectionFootprint.call(this, footprint);\r\n }\r\n };\r\n // Called when a new selection is made. Updates internal state and triggers handlers.\r\n View.prototype.reportSelection = function (footprint, ev) {\r\n this.isSelected = true;\r\n this.triggerSelect(footprint, ev);\r\n };\r\n // Triggers handlers to 'select'\r\n View.prototype.triggerSelect = function (footprint, ev) {\r\n var dateProfile = this.calendar.footprintToDateProfile(footprint); // abuse of \"Event\"DateProfile?\r\n this.publiclyTrigger('select', {\r\n context: this,\r\n args: [\r\n dateProfile.start,\r\n dateProfile.end,\r\n ev,\r\n this\r\n ]\r\n });\r\n };\r\n // Undoes a selection. updates in the internal state and triggers handlers.\r\n // `ev` is the native mouse event that began the interaction.\r\n View.prototype.unselect = function (ev) {\r\n if (this.isSelected) {\r\n this.isSelected = false;\r\n if (this['destroySelection']) {\r\n this['destroySelection'](); // TODO: deprecate\r\n }\r\n this.unrenderSelection();\r\n this.publiclyTrigger('unselect', {\r\n context: this,\r\n args: [ev, this]\r\n });\r\n }\r\n };\r\n /* Event Selection\r\n ------------------------------------------------------------------------------------------------------------------*/\r\n View.prototype.selectEventInstance = function (eventInstance) {\r\n if (!this.selectedEventInstance ||\r\n this.selectedEventInstance !== eventInstance) {\r\n this.unselectEventInstance();\r\n this.getEventSegs().forEach(function (seg) {\r\n if (seg.footprint.eventInstance === eventInstance &&\r\n seg.el // necessary?\r\n ) {\r\n seg.el.addClass('fc-selected');\r\n }\r\n });\r\n this.selectedEventInstance = eventInstance;\r\n }\r\n };\r\n View.prototype.unselectEventInstance = function () {\r\n if (this.selectedEventInstance) {\r\n this.getEventSegs().forEach(function (seg) {\r\n if (seg.el) { // necessary?\r\n seg.el.removeClass('fc-selected');\r\n }\r\n });\r\n this.selectedEventInstance = null;\r\n }\r\n };\r\n View.prototype.isEventDefSelected = function (eventDef) {\r\n // event references might change on refetchEvents(), while selectedEventInstance doesn't,\r\n // so compare IDs\r\n return this.selectedEventInstance && this.selectedEventInstance.def.id === eventDef.id;\r\n };\r\n /* Mouse / Touch Unselecting (time range & event unselection)\r\n ------------------------------------------------------------------------------------------------------------------*/\r\n // TODO: move consistently to down/start or up/end?\r\n // TODO: don't kill previous selection if touch scrolling\r\n View.prototype.handleDocumentMousedown = function (ev) {\r\n if (util_1.isPrimaryMouseButton(ev)) {\r\n this.processUnselect(ev);\r\n }\r\n };\r\n View.prototype.processUnselect = function (ev) {\r\n this.processRangeUnselect(ev);\r\n this.processEventUnselect(ev);\r\n };\r\n View.prototype.processRangeUnselect = function (ev) {\r\n var ignore;\r\n // is there a time-range selection?\r\n if (this.isSelected && this.opt('unselectAuto')) {\r\n // only unselect if the clicked element is not identical to or inside of an 'unselectCancel' element\r\n ignore = this.opt('unselectCancel');\r\n if (!ignore || !$(ev.target).closest(ignore).length) {\r\n this.unselect(ev);\r\n }\r\n }\r\n };\r\n View.prototype.processEventUnselect = function (ev) {\r\n if (this.selectedEventInstance) {\r\n if (!$(ev.target).closest('.fc-selected').length) {\r\n this.unselectEventInstance();\r\n }\r\n }\r\n };\r\n /* Triggers\r\n ------------------------------------------------------------------------------------------------------------------*/\r\n View.prototype.triggerBaseRendered = function () {\r\n this.publiclyTrigger('viewRender', {\r\n context: this,\r\n args: [this, this.el]\r\n });\r\n };\r\n View.prototype.triggerBaseUnrendered = function () {\r\n this.publiclyTrigger('viewDestroy', {\r\n context: this,\r\n args: [this, this.el]\r\n });\r\n };\r\n // Triggers handlers to 'dayClick'\r\n // Span has start/end of the clicked area. Only the start is useful.\r\n View.prototype.triggerDayClick = function (footprint, dayEl, ev) {\r\n var dateProfile = this.calendar.footprintToDateProfile(footprint); // abuse of \"Event\"DateProfile?\r\n this.publiclyTrigger('dayClick', {\r\n context: dayEl,\r\n args: [dateProfile.start, ev, this]\r\n });\r\n };\r\n /* Date Utils\r\n ------------------------------------------------------------------------------------------------------------------*/\r\n // For DateComponent::getDayClasses\r\n View.prototype.isDateInOtherMonth = function (date, dateProfile) {\r\n return false;\r\n };\r\n // Arguments after name will be forwarded to a hypothetical function value\r\n // WARNING: passed-in arguments will be given to generator functions as-is and can cause side-effects.\r\n // Always clone your objects if you fear mutation.\r\n View.prototype.getUnzonedRangeOption = function (name) {\r\n var val = this.opt(name);\r\n if (typeof val === 'function') {\r\n val = val.apply(null, Array.prototype.slice.call(arguments, 1));\r\n }\r\n if (val) {\r\n return this.calendar.parseUnzonedRange(val);\r\n }\r\n };\r\n /* Hidden Days\r\n ------------------------------------------------------------------------------------------------------------------*/\r\n // Initializes internal variables related to calculating hidden days-of-week\r\n View.prototype.initHiddenDays = function () {\r\n var hiddenDays = this.opt('hiddenDays') || []; // array of day-of-week indices that are hidden\r\n var isHiddenDayHash = []; // is the day-of-week hidden? (hash with day-of-week-index -> bool)\r\n var dayCnt = 0;\r\n var i;\r\n if (this.opt('weekends') === false) {\r\n hiddenDays.push(0, 6); // 0=sunday, 6=saturday\r\n }\r\n for (i = 0; i < 7; i++) {\r\n if (!(isHiddenDayHash[i] = $.inArray(i, hiddenDays) !== -1)) {\r\n dayCnt++;\r\n }\r\n }\r\n if (!dayCnt) {\r\n throw new Error('invalid hiddenDays'); // all days were hidden? bad.\r\n }\r\n this.isHiddenDayHash = isHiddenDayHash;\r\n };\r\n // Remove days from the beginning and end of the range that are computed as hidden.\r\n // If the whole range is trimmed off, returns null\r\n View.prototype.trimHiddenDays = function (inputUnzonedRange) {\r\n var start = inputUnzonedRange.getStart();\r\n var end = inputUnzonedRange.getEnd();\r\n if (start) {\r\n start = this.skipHiddenDays(start);\r\n }\r\n if (end) {\r\n end = this.skipHiddenDays(end, -1, true);\r\n }\r\n if (start === null || end === null || start < end) {\r\n return new UnzonedRange_1.default(start, end);\r\n }\r\n return null;\r\n };\r\n // Is the current day hidden?\r\n // `day` is a day-of-week index (0-6), or a Moment\r\n View.prototype.isHiddenDay = function (day) {\r\n if (moment.isMoment(day)) {\r\n day = day.day();\r\n }\r\n return this.isHiddenDayHash[day];\r\n };\r\n // Incrementing the current day until it is no longer a hidden day, returning a copy.\r\n // DOES NOT CONSIDER validUnzonedRange!\r\n // If the initial value of `date` is not a hidden day, don't do anything.\r\n // Pass `isExclusive` as `true` if you are dealing with an end date.\r\n // `inc` defaults to `1` (increment one day forward each time)\r\n View.prototype.skipHiddenDays = function (date, inc, isExclusive) {\r\n if (inc === void 0) { inc = 1; }\r\n if (isExclusive === void 0) { isExclusive = false; }\r\n var out = date.clone();\r\n while (this.isHiddenDayHash[(out.day() + (isExclusive ? inc : 0) + 7) % 7]) {\r\n out.add(inc, 'days');\r\n }\r\n return out;\r\n };\r\n return View;\r\n}(InteractiveDateComponent_1.default));\r\nexports.default = View;\r\nView.prototype.usesMinMaxTime = false;\r\nView.prototype.dateProfileGeneratorClass = DateProfileGenerator_1.default;\r\nView.watch('displayingDates', ['isInDom', 'dateProfile'], function (deps) {\r\n this.requestDateRender(deps.dateProfile);\r\n}, function () {\r\n this.requestDateUnrender();\r\n});\r\nView.watch('displayingBusinessHours', ['displayingDates', 'businessHourGenerator'], function (deps) {\r\n this.requestBusinessHoursRender(deps.businessHourGenerator);\r\n}, function () {\r\n this.requestBusinessHoursUnrender();\r\n});\r\nView.watch('initialEvents', ['dateProfile'], function (deps) {\r\n return this.fetchInitialEvents(deps.dateProfile);\r\n});\r\nView.watch('bindingEvents', ['initialEvents'], function (deps) {\r\n this.setEvents(deps.initialEvents);\r\n this.bindEventChanges();\r\n}, function () {\r\n this.unbindEventChanges();\r\n this.unsetEvents();\r\n});\r\nView.watch('displayingEvents', ['displayingDates', 'hasEvents'], function () {\r\n this.requestEventsRender(this.get('currentEvents'));\r\n}, function () {\r\n this.requestEventsUnrender();\r\n});\r\nView.watch('title', ['dateProfile'], function (deps) {\r\n return (this.title = this.computeTitle(deps.dateProfile)); // assign to View for legacy reasons\r\n});\r\nView.watch('legacyDateProps', ['dateProfile'], function (deps) {\r\n var calendar = this.calendar;\r\n var dateProfile = deps.dateProfile;\r\n // DEPRECATED, but we need to keep it updated...\r\n this.start = calendar.msToMoment(dateProfile.activeUnzonedRange.startMs, dateProfile.isRangeAllDay);\r\n this.end = calendar.msToMoment(dateProfile.activeUnzonedRange.endMs, dateProfile.isRangeAllDay);\r\n this.intervalStart = calendar.msToMoment(dateProfile.currentUnzonedRange.startMs, dateProfile.isRangeAllDay);\r\n this.intervalEnd = calendar.msToMoment(dateProfile.currentUnzonedRange.endMs, dateProfile.isRangeAllDay);\r\n});\r\n\n\n/***/ }),\n/* 44 */\n/***/ (function(module, exports, __webpack_require__) {\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar $ = __webpack_require__(3);\r\nvar util_1 = __webpack_require__(4);\r\nvar EventRenderer = /** @class */ (function () {\r\n function EventRenderer(component, fillRenderer) {\r\n this.view = component._getView();\r\n this.component = component;\r\n this.fillRenderer = fillRenderer;\r\n }\r\n EventRenderer.prototype.opt = function (name) {\r\n return this.view.opt(name);\r\n };\r\n // Updates values that rely on options and also relate to range\r\n EventRenderer.prototype.rangeUpdated = function () {\r\n var displayEventTime;\r\n var displayEventEnd;\r\n this.eventTimeFormat =\r\n this.opt('eventTimeFormat') ||\r\n this.opt('timeFormat') || // deprecated\r\n this.computeEventTimeFormat();\r\n displayEventTime = this.opt('displayEventTime');\r\n if (displayEventTime == null) {\r\n displayEventTime = this.computeDisplayEventTime(); // might be based off of range\r\n }\r\n displayEventEnd = this.opt('displayEventEnd');\r\n if (displayEventEnd == null) {\r\n displayEventEnd = this.computeDisplayEventEnd(); // might be based off of range\r\n }\r\n this.displayEventTime = displayEventTime;\r\n this.displayEventEnd = displayEventEnd;\r\n };\r\n EventRenderer.prototype.render = function (eventsPayload) {\r\n var dateProfile = this.component._getDateProfile();\r\n var eventDefId;\r\n var instanceGroup;\r\n var eventRanges;\r\n var bgRanges = [];\r\n var fgRanges = [];\r\n for (eventDefId in eventsPayload) {\r\n instanceGroup = eventsPayload[eventDefId];\r\n eventRanges = instanceGroup.sliceRenderRanges(dateProfile.activeUnzonedRange);\r\n if (instanceGroup.getEventDef().hasBgRendering()) {\r\n bgRanges.push.apply(bgRanges, eventRanges);\r\n }\r\n else {\r\n fgRanges.push.apply(fgRanges, eventRanges);\r\n }\r\n }\r\n this.renderBgRanges(bgRanges);\r\n this.renderFgRanges(fgRanges);\r\n };\r\n EventRenderer.prototype.unrender = function () {\r\n this.unrenderBgRanges();\r\n this.unrenderFgRanges();\r\n };\r\n EventRenderer.prototype.renderFgRanges = function (eventRanges) {\r\n var eventFootprints = this.component.eventRangesToEventFootprints(eventRanges);\r\n var segs = this.component.eventFootprintsToSegs(eventFootprints);\r\n // render an `.el` on each seg\r\n // returns a subset of the segs. segs that were actually rendered\r\n segs = this.renderFgSegEls(segs);\r\n if (this.renderFgSegs(segs) !== false) { // no failure?\r\n this.fgSegs = segs;\r\n }\r\n };\r\n EventRenderer.prototype.unrenderFgRanges = function () {\r\n this.unrenderFgSegs(this.fgSegs || []);\r\n this.fgSegs = null;\r\n };\r\n EventRenderer.prototype.renderBgRanges = function (eventRanges) {\r\n var eventFootprints = this.component.eventRangesToEventFootprints(eventRanges);\r\n var segs = this.component.eventFootprintsToSegs(eventFootprints);\r\n if (this.renderBgSegs(segs) !== false) { // no failure?\r\n this.bgSegs = segs;\r\n }\r\n };\r\n EventRenderer.prototype.unrenderBgRanges = function () {\r\n this.unrenderBgSegs();\r\n this.bgSegs = null;\r\n };\r\n EventRenderer.prototype.getSegs = function () {\r\n return (this.bgSegs || []).concat(this.fgSegs || []);\r\n };\r\n // Renders foreground event segments onto the grid\r\n EventRenderer.prototype.renderFgSegs = function (segs) {\r\n // subclasses must implement\r\n // segs already has rendered els, and has been filtered.\r\n return false; // signal failure if not implemented\r\n };\r\n // Unrenders all currently rendered foreground segments\r\n EventRenderer.prototype.unrenderFgSegs = function (segs) {\r\n // subclasses must implement\r\n };\r\n EventRenderer.prototype.renderBgSegs = function (segs) {\r\n var _this = this;\r\n if (this.fillRenderer) {\r\n this.fillRenderer.renderSegs('bgEvent', segs, {\r\n getClasses: function (seg) {\r\n return _this.getBgClasses(seg.footprint.eventDef);\r\n },\r\n getCss: function (seg) {\r\n return {\r\n 'background-color': _this.getBgColor(seg.footprint.eventDef)\r\n };\r\n },\r\n filterEl: function (seg, el) {\r\n return _this.filterEventRenderEl(seg.footprint, el);\r\n }\r\n });\r\n }\r\n else {\r\n return false; // signal failure if no fillRenderer\r\n }\r\n };\r\n EventRenderer.prototype.unrenderBgSegs = function () {\r\n if (this.fillRenderer) {\r\n this.fillRenderer.unrender('bgEvent');\r\n }\r\n };\r\n // Renders and assigns an `el` property for each foreground event segment.\r\n // Only returns segments that successfully rendered.\r\n EventRenderer.prototype.renderFgSegEls = function (segs, disableResizing) {\r\n var _this = this;\r\n if (disableResizing === void 0) { disableResizing = false; }\r\n var hasEventRenderHandlers = this.view.hasPublicHandlers('eventRender');\r\n var html = '';\r\n var renderedSegs = [];\r\n var i;\r\n if (segs.length) { // don't build an empty html string\r\n // build a large concatenation of event segment HTML\r\n for (i = 0; i < segs.length; i++) {\r\n this.beforeFgSegHtml(segs[i]);\r\n html += this.fgSegHtml(segs[i], disableResizing);\r\n }\r\n // Grab individual elements from the combined HTML string. Use each as the default rendering.\r\n // Then, compute the 'el' for each segment. An el might be null if the eventRender callback returned false.\r\n $(html).each(function (i, node) {\r\n var seg = segs[i];\r\n var el = $(node);\r\n if (hasEventRenderHandlers) { // optimization\r\n el = _this.filterEventRenderEl(seg.footprint, el);\r\n }\r\n if (el) {\r\n el.data('fc-seg', seg); // used by handlers\r\n seg.el = el;\r\n renderedSegs.push(seg);\r\n }\r\n });\r\n }\r\n return renderedSegs;\r\n };\r\n EventRenderer.prototype.beforeFgSegHtml = function (seg) {\r\n };\r\n // Generates the HTML for the default rendering of a foreground event segment. Used by renderFgSegEls()\r\n EventRenderer.prototype.fgSegHtml = function (seg, disableResizing) {\r\n // subclasses should implement\r\n };\r\n // Generic utility for generating the HTML classNames for an event segment's element\r\n EventRenderer.prototype.getSegClasses = function (seg, isDraggable, isResizable) {\r\n var classes = [\r\n 'fc-event',\r\n seg.isStart ? 'fc-start' : 'fc-not-start',\r\n seg.isEnd ? 'fc-end' : 'fc-not-end'\r\n ].concat(this.getClasses(seg.footprint.eventDef));\r\n if (isDraggable) {\r\n classes.push('fc-draggable');\r\n }\r\n if (isResizable) {\r\n classes.push('fc-resizable');\r\n }\r\n // event is currently selected? attach a className.\r\n if (this.view.isEventDefSelected(seg.footprint.eventDef)) {\r\n classes.push('fc-selected');\r\n }\r\n return classes;\r\n };\r\n // Given an event and the default element used for rendering, returns the element that should actually be used.\r\n // Basically runs events and elements through the eventRender hook.\r\n EventRenderer.prototype.filterEventRenderEl = function (eventFootprint, el) {\r\n var legacy = eventFootprint.getEventLegacy();\r\n var custom = this.view.publiclyTrigger('eventRender', {\r\n context: legacy,\r\n args: [legacy, el, this.view]\r\n });\r\n if (custom === false) { // means don't render at all\r\n el = null;\r\n }\r\n else if (custom && custom !== true) {\r\n el = $(custom);\r\n }\r\n return el;\r\n };\r\n // Compute the text that should be displayed on an event's element.\r\n // `range` can be the Event object itself, or something range-like, with at least a `start`.\r\n // If event times are disabled, or the event has no time, will return a blank string.\r\n // If not specified, formatStr will default to the eventTimeFormat setting,\r\n // and displayEnd will default to the displayEventEnd setting.\r\n EventRenderer.prototype.getTimeText = function (eventFootprint, formatStr, displayEnd) {\r\n return this._getTimeText(eventFootprint.eventInstance.dateProfile.start, eventFootprint.eventInstance.dateProfile.end, eventFootprint.componentFootprint.isAllDay, formatStr, displayEnd);\r\n };\r\n EventRenderer.prototype._getTimeText = function (start, end, isAllDay, formatStr, displayEnd) {\r\n if (formatStr == null) {\r\n formatStr = this.eventTimeFormat;\r\n }\r\n if (displayEnd == null) {\r\n displayEnd = this.displayEventEnd;\r\n }\r\n if (this.displayEventTime && !isAllDay) {\r\n if (displayEnd && end) {\r\n return this.view.formatRange({ start: start, end: end }, false, // allDay\r\n formatStr);\r\n }\r\n else {\r\n return start.format(formatStr);\r\n }\r\n }\r\n return '';\r\n };\r\n EventRenderer.prototype.computeEventTimeFormat = function () {\r\n return this.opt('smallTimeFormat');\r\n };\r\n EventRenderer.prototype.computeDisplayEventTime = function () {\r\n return true;\r\n };\r\n EventRenderer.prototype.computeDisplayEventEnd = function () {\r\n return true;\r\n };\r\n EventRenderer.prototype.getBgClasses = function (eventDef) {\r\n var classNames = this.getClasses(eventDef);\r\n classNames.push('fc-bgevent');\r\n return classNames;\r\n };\r\n EventRenderer.prototype.getClasses = function (eventDef) {\r\n var objs = this.getStylingObjs(eventDef);\r\n var i;\r\n var classNames = [];\r\n for (i = 0; i < objs.length; i++) {\r\n classNames.push.apply(// append\r\n classNames, objs[i].eventClassName || objs[i].className || []);\r\n }\r\n return classNames;\r\n };\r\n // Utility for generating event skin-related CSS properties\r\n EventRenderer.prototype.getSkinCss = function (eventDef) {\r\n return {\r\n 'background-color': this.getBgColor(eventDef),\r\n 'border-color': this.getBorderColor(eventDef),\r\n color: this.getTextColor(eventDef)\r\n };\r\n };\r\n // Queries for caller-specified color, then falls back to default\r\n EventRenderer.prototype.getBgColor = function (eventDef) {\r\n var objs = this.getStylingObjs(eventDef);\r\n var i;\r\n var val;\r\n for (i = 0; i < objs.length && !val; i++) {\r\n val = objs[i].eventBackgroundColor || objs[i].eventColor ||\r\n objs[i].backgroundColor || objs[i].color;\r\n }\r\n if (!val) {\r\n val = this.opt('eventBackgroundColor') || this.opt('eventColor');\r\n }\r\n return val;\r\n };\r\n // Queries for caller-specified color, then falls back to default\r\n EventRenderer.prototype.getBorderColor = function (eventDef) {\r\n var objs = this.getStylingObjs(eventDef);\r\n var i;\r\n var val;\r\n for (i = 0; i < objs.length && !val; i++) {\r\n val = objs[i].eventBorderColor || objs[i].eventColor ||\r\n objs[i].borderColor || objs[i].color;\r\n }\r\n if (!val) {\r\n val = this.opt('eventBorderColor') || this.opt('eventColor');\r\n }\r\n return val;\r\n };\r\n // Queries for caller-specified color, then falls back to default\r\n EventRenderer.prototype.getTextColor = function (eventDef) {\r\n var objs = this.getStylingObjs(eventDef);\r\n var i;\r\n var val;\r\n for (i = 0; i < objs.length && !val; i++) {\r\n val = objs[i].eventTextColor ||\r\n objs[i].textColor;\r\n }\r\n if (!val) {\r\n val = this.opt('eventTextColor');\r\n }\r\n return val;\r\n };\r\n EventRenderer.prototype.getStylingObjs = function (eventDef) {\r\n var objs = this.getFallbackStylingObjs(eventDef);\r\n objs.unshift(eventDef);\r\n return objs;\r\n };\r\n EventRenderer.prototype.getFallbackStylingObjs = function (eventDef) {\r\n return [eventDef.source];\r\n };\r\n EventRenderer.prototype.sortEventSegs = function (segs) {\r\n segs.sort(util_1.proxy(this, 'compareEventSegs'));\r\n };\r\n // A cmp function for determining which segments should take visual priority\r\n EventRenderer.prototype.compareEventSegs = function (seg1, seg2) {\r\n var f1 = seg1.footprint;\r\n var f2 = seg2.footprint;\r\n var cf1 = f1.componentFootprint;\r\n var cf2 = f2.componentFootprint;\r\n var r1 = cf1.unzonedRange;\r\n var r2 = cf2.unzonedRange;\r\n return r1.startMs - r2.startMs || // earlier events go first\r\n (r2.endMs - r2.startMs) - (r1.endMs - r1.startMs) || // tie? longer events go first\r\n cf2.isAllDay - cf1.isAllDay || // tie? put all-day events first (booleans cast to 0/1)\r\n util_1.compareByFieldSpecs(f1.eventDef, f2.eventDef, this.view.eventOrderSpecs, f1.eventDef.miscProps, f2.eventDef.miscProps);\r\n };\r\n return EventRenderer;\r\n}());\r\nexports.default = EventRenderer;\r\n\n\n/***/ }),\n/* 45 */,\n/* 46 */,\n/* 47 */,\n/* 48 */,\n/* 49 */\n/***/ (function(module, exports, __webpack_require__) {\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar moment_ext_1 = __webpack_require__(11);\r\n// Plugin\r\n// -------------------------------------------------------------------------------------------------\r\nmoment_ext_1.newMomentProto.format = function () {\r\n if (this._fullCalendar && arguments[0]) { // an enhanced moment? and a format string provided?\r\n return formatDate(this, arguments[0]); // our extended formatting\r\n }\r\n if (this._ambigTime) {\r\n return moment_ext_1.oldMomentFormat(englishMoment(this), 'YYYY-MM-DD');\r\n }\r\n if (this._ambigZone) {\r\n return moment_ext_1.oldMomentFormat(englishMoment(this), 'YYYY-MM-DD[T]HH:mm:ss');\r\n }\r\n if (this._fullCalendar) { // enhanced non-ambig moment?\r\n // moment.format() doesn't ensure english, but we want to.\r\n return moment_ext_1.oldMomentFormat(englishMoment(this));\r\n }\r\n return moment_ext_1.oldMomentProto.format.apply(this, arguments);\r\n};\r\nmoment_ext_1.newMomentProto.toISOString = function () {\r\n if (this._ambigTime) {\r\n return moment_ext_1.oldMomentFormat(englishMoment(this), 'YYYY-MM-DD');\r\n }\r\n if (this._ambigZone) {\r\n return moment_ext_1.oldMomentFormat(englishMoment(this), 'YYYY-MM-DD[T]HH:mm:ss');\r\n }\r\n if (this._fullCalendar) { // enhanced non-ambig moment?\r\n // depending on browser, moment might not output english. ensure english.\r\n // https://github.com/moment/moment/blob/2.18.1/src/lib/moment/format.js#L22\r\n return moment_ext_1.oldMomentProto.toISOString.apply(englishMoment(this), arguments);\r\n }\r\n return moment_ext_1.oldMomentProto.toISOString.apply(this, arguments);\r\n};\r\nfunction englishMoment(mom) {\r\n if (mom.locale() !== 'en') {\r\n return mom.clone().locale('en');\r\n }\r\n return mom;\r\n}\r\n// Config\r\n// ---------------------------------------------------------------------------------------------------------------------\r\n/*\r\nInserted between chunks in the fake (\"intermediate\") formatting string.\r\nImportant that it passes as whitespace (\\s) because moment often identifies non-standalone months\r\nvia a regexp with an \\s.\r\n*/\r\nvar PART_SEPARATOR = '\\u000b'; // vertical tab\r\n/*\r\nInserted as the first character of a literal-text chunk to indicate that the literal text is not actually literal text,\r\nbut rather, a \"special\" token that has custom rendering (see specialTokens map).\r\n*/\r\nvar SPECIAL_TOKEN_MARKER = '\\u001f'; // information separator 1\r\n/*\r\nInserted at the beginning and end of a span of text that must have non-zero numeric characters.\r\nHandling of these markers is done in a post-processing step at the very end of text rendering.\r\n*/\r\nvar MAYBE_MARKER = '\\u001e'; // information separator 2\r\nvar MAYBE_REGEXP = new RegExp(MAYBE_MARKER + '([^' + MAYBE_MARKER + ']*)' + MAYBE_MARKER, 'g'); // must be global\r\n/*\r\nAddition formatting tokens we want recognized\r\n*/\r\nvar specialTokens = {\r\n t: function (date) {\r\n return moment_ext_1.oldMomentFormat(date, 'a').charAt(0);\r\n },\r\n T: function (date) {\r\n return moment_ext_1.oldMomentFormat(date, 'A').charAt(0);\r\n }\r\n};\r\n/*\r\nThe first characters of formatting tokens for units that are 1 day or larger.\r\n`value` is for ranking relative size (lower means bigger).\r\n`unit` is a normalized unit, used for comparing moments.\r\n*/\r\nvar largeTokenMap = {\r\n Y: { value: 1, unit: 'year' },\r\n M: { value: 2, unit: 'month' },\r\n W: { value: 3, unit: 'week' },\r\n w: { value: 3, unit: 'week' },\r\n D: { value: 4, unit: 'day' },\r\n d: { value: 4, unit: 'day' } // day of week\r\n};\r\n// Single Date Formatting\r\n// ---------------------------------------------------------------------------------------------------------------------\r\n/*\r\nFormats `date` with a Moment formatting string, but allow our non-zero areas and special token\r\n*/\r\nfunction formatDate(date, formatStr) {\r\n return renderFakeFormatString(getParsedFormatString(formatStr).fakeFormatString, date);\r\n}\r\nexports.formatDate = formatDate;\r\n// Date Range Formatting\r\n// -------------------------------------------------------------------------------------------------\r\n// TODO: make it work with timezone offset\r\n/*\r\nUsing a formatting string meant for a single date, generate a range string, like\r\n\"Sep 2 - 9 2013\", that intelligently inserts a separator where the dates differ.\r\nIf the dates are the same as far as the format string is concerned, just return a single\r\nrendering of one date, without any separator.\r\n*/\r\nfunction formatRange(date1, date2, formatStr, separator, isRTL) {\r\n var localeData;\r\n date1 = moment_ext_1.default.parseZone(date1);\r\n date2 = moment_ext_1.default.parseZone(date2);\r\n localeData = date1.localeData();\r\n // Expand localized format strings, like \"LL\" -> \"MMMM D YYYY\".\r\n // BTW, this is not important for `formatDate` because it is impossible to put custom tokens\r\n // or non-zero areas in Moment's localized format strings.\r\n formatStr = localeData.longDateFormat(formatStr) || formatStr;\r\n return renderParsedFormat(getParsedFormatString(formatStr), date1, date2, separator || ' - ', isRTL);\r\n}\r\nexports.formatRange = formatRange;\r\n/*\r\nRenders a range with an already-parsed format string.\r\n*/\r\nfunction renderParsedFormat(parsedFormat, date1, date2, separator, isRTL) {\r\n var sameUnits = parsedFormat.sameUnits;\r\n var unzonedDate1 = date1.clone().stripZone(); // for same-unit comparisons\r\n var unzonedDate2 = date2.clone().stripZone(); // \"\r\n var renderedParts1 = renderFakeFormatStringParts(parsedFormat.fakeFormatString, date1);\r\n var renderedParts2 = renderFakeFormatStringParts(parsedFormat.fakeFormatString, date2);\r\n var leftI;\r\n var leftStr = '';\r\n var rightI;\r\n var rightStr = '';\r\n var middleI;\r\n var middleStr1 = '';\r\n var middleStr2 = '';\r\n var middleStr = '';\r\n // Start at the leftmost side of the formatting string and continue until you hit a token\r\n // that is not the same between dates.\r\n for (leftI = 0; leftI < sameUnits.length && (!sameUnits[leftI] || unzonedDate1.isSame(unzonedDate2, sameUnits[leftI])); leftI++) {\r\n leftStr += renderedParts1[leftI];\r\n }\r\n // Similarly, start at the rightmost side of the formatting string and move left\r\n for (rightI = sameUnits.length - 1; rightI > leftI && (!sameUnits[rightI] || unzonedDate1.isSame(unzonedDate2, sameUnits[rightI])); rightI--) {\r\n // If current chunk is on the boundary of unique date-content, and is a special-case\r\n // date-formatting postfix character, then don't consume it. Consider it unique date-content.\r\n // TODO: make configurable\r\n if (rightI - 1 === leftI && renderedParts1[rightI] === '.') {\r\n break;\r\n }\r\n rightStr = renderedParts1[rightI] + rightStr;\r\n }\r\n // The area in the middle is different for both of the dates.\r\n // Collect them distinctly so we can jam them together later.\r\n for (middleI = leftI; middleI <= rightI; middleI++) {\r\n middleStr1 += renderedParts1[middleI];\r\n middleStr2 += renderedParts2[middleI];\r\n }\r\n if (middleStr1 || middleStr2) {\r\n if (isRTL) {\r\n middleStr = middleStr2 + separator + middleStr1;\r\n }\r\n else {\r\n middleStr = middleStr1 + separator + middleStr2;\r\n }\r\n }\r\n return processMaybeMarkers(leftStr + middleStr + rightStr);\r\n}\r\n// Format String Parsing\r\n// ---------------------------------------------------------------------------------------------------------------------\r\nvar parsedFormatStrCache = {};\r\n/*\r\nReturns a parsed format string, leveraging a cache.\r\n*/\r\nfunction getParsedFormatString(formatStr) {\r\n return parsedFormatStrCache[formatStr] ||\r\n (parsedFormatStrCache[formatStr] = parseFormatString(formatStr));\r\n}\r\n/*\r\nParses a format string into the following:\r\n- fakeFormatString: a momentJS formatting string, littered with special control characters that get post-processed.\r\n- sameUnits: for every part in fakeFormatString, if the part is a token, the value will be a unit string (like \"day\"),\r\n that indicates how similar a range's start & end must be in order to share the same formatted text.\r\n If not a token, then the value is null.\r\n Always a flat array (not nested liked \"chunks\").\r\n*/\r\nfunction parseFormatString(formatStr) {\r\n var chunks = chunkFormatString(formatStr);\r\n return {\r\n fakeFormatString: buildFakeFormatString(chunks),\r\n sameUnits: buildSameUnits(chunks)\r\n };\r\n}\r\n/*\r\nBreak the formatting string into an array of chunks.\r\nA 'maybe' chunk will have nested chunks.\r\n*/\r\nfunction chunkFormatString(formatStr) {\r\n var chunks = [];\r\n var match;\r\n // TODO: more descrimination\r\n // \\4 is a backreference to the first character of a multi-character set.\r\n var chunker = /\\[([^\\]]*)\\]|\\(([^\\)]*)\\)|(LTS|LT|(\\w)\\4*o?)|([^\\w\\[\\(]+)/g;\r\n while ((match = chunker.exec(formatStr))) {\r\n if (match[1]) { // a literal string inside [ ... ]\r\n chunks.push.apply(chunks, // append\r\n splitStringLiteral(match[1]));\r\n }\r\n else if (match[2]) { // non-zero formatting inside ( ... )\r\n chunks.push({ maybe: chunkFormatString(match[2]) });\r\n }\r\n else if (match[3]) { // a formatting token\r\n chunks.push({ token: match[3] });\r\n }\r\n else if (match[5]) { // an unenclosed literal string\r\n chunks.push.apply(chunks, // append\r\n splitStringLiteral(match[5]));\r\n }\r\n }\r\n return chunks;\r\n}\r\n/*\r\nPotentially splits a literal-text string into multiple parts. For special cases.\r\n*/\r\nfunction splitStringLiteral(s) {\r\n if (s === '. ') {\r\n return ['.', ' ']; // for locales with periods bound to the end of each year/month/date\r\n }\r\n else {\r\n return [s];\r\n }\r\n}\r\n/*\r\nGiven chunks parsed from a real format string, generate a fake (aka \"intermediate\") format string with special control\r\ncharacters that will eventually be given to moment for formatting, and then post-processed.\r\n*/\r\nfunction buildFakeFormatString(chunks) {\r\n var parts = [];\r\n var i;\r\n var chunk;\r\n for (i = 0; i < chunks.length; i++) {\r\n chunk = chunks[i];\r\n if (typeof chunk === 'string') {\r\n parts.push('[' + chunk + ']');\r\n }\r\n else if (chunk.token) {\r\n if (chunk.token in specialTokens) {\r\n parts.push(SPECIAL_TOKEN_MARKER + // useful during post-processing\r\n '[' + chunk.token + ']' // preserve as literal text\r\n );\r\n }\r\n else {\r\n parts.push(chunk.token); // unprotected text implies a format string\r\n }\r\n }\r\n else if (chunk.maybe) {\r\n parts.push(MAYBE_MARKER + // useful during post-processing\r\n buildFakeFormatString(chunk.maybe) +\r\n MAYBE_MARKER);\r\n }\r\n }\r\n return parts.join(PART_SEPARATOR);\r\n}\r\n/*\r\nGiven parsed chunks from a real formatting string, generates an array of unit strings (like \"day\") that indicate\r\nin which regard two dates must be similar in order to share range formatting text.\r\nThe `chunks` can be nested (because of \"maybe\" chunks), however, the returned array will be flat.\r\n*/\r\nfunction buildSameUnits(chunks) {\r\n var units = [];\r\n var i;\r\n var chunk;\r\n var tokenInfo;\r\n for (i = 0; i < chunks.length; i++) {\r\n chunk = chunks[i];\r\n if (chunk.token) {\r\n tokenInfo = largeTokenMap[chunk.token.charAt(0)];\r\n units.push(tokenInfo ? tokenInfo.unit : 'second'); // default to a very strict same-second\r\n }\r\n else if (chunk.maybe) {\r\n units.push.apply(units, // append\r\n buildSameUnits(chunk.maybe));\r\n }\r\n else {\r\n units.push(null);\r\n }\r\n }\r\n return units;\r\n}\r\n// Rendering to text\r\n// ---------------------------------------------------------------------------------------------------------------------\r\n/*\r\nFormats a date with a fake format string, post-processes the control characters, then returns.\r\n*/\r\nfunction renderFakeFormatString(fakeFormatString, date) {\r\n return processMaybeMarkers(renderFakeFormatStringParts(fakeFormatString, date).join(''));\r\n}\r\n/*\r\nFormats a date into parts that will have been post-processed, EXCEPT for the \"maybe\" markers.\r\n*/\r\nfunction renderFakeFormatStringParts(fakeFormatString, date) {\r\n var parts = [];\r\n var fakeRender = moment_ext_1.oldMomentFormat(date, fakeFormatString);\r\n var fakeParts = fakeRender.split(PART_SEPARATOR);\r\n var i;\r\n var fakePart;\r\n for (i = 0; i < fakeParts.length; i++) {\r\n fakePart = fakeParts[i];\r\n if (fakePart.charAt(0) === SPECIAL_TOKEN_MARKER) {\r\n parts.push(\r\n // the literal string IS the token's name.\r\n // call special token's registered function.\r\n specialTokens[fakePart.substring(1)](date));\r\n }\r\n else {\r\n parts.push(fakePart);\r\n }\r\n }\r\n return parts;\r\n}\r\n/*\r\nAccepts an almost-finally-formatted string and processes the \"maybe\" control characters, returning a new string.\r\n*/\r\nfunction processMaybeMarkers(s) {\r\n return s.replace(MAYBE_REGEXP, function (m0, m1) {\r\n if (m1.match(/[1-9]/)) { // any non-zero numeric characters?\r\n return m1;\r\n }\r\n else {\r\n return '';\r\n }\r\n });\r\n}\r\n// Misc Utils\r\n// -------------------------------------------------------------------------------------------------\r\n/*\r\nReturns a unit string, either 'year', 'month', 'day', or null for the most granular formatting token in the string.\r\n*/\r\nfunction queryMostGranularFormatUnit(formatStr) {\r\n var chunks = chunkFormatString(formatStr);\r\n var i;\r\n var chunk;\r\n var candidate;\r\n var best;\r\n for (i = 0; i < chunks.length; i++) {\r\n chunk = chunks[i];\r\n if (chunk.token) {\r\n candidate = largeTokenMap[chunk.token.charAt(0)];\r\n if (candidate) {\r\n if (!best || candidate.value > best.value) {\r\n best = candidate;\r\n }\r\n }\r\n }\r\n }\r\n if (best) {\r\n return best.unit;\r\n }\r\n return null;\r\n}\r\nexports.queryMostGranularFormatUnit = queryMostGranularFormatUnit;\r\n\n\n/***/ }),\n/* 50 */\n/***/ (function(module, exports) {\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar EventRange = /** @class */ (function () {\r\n function EventRange(unzonedRange, eventDef, eventInstance) {\r\n this.unzonedRange = unzonedRange;\r\n this.eventDef = eventDef;\r\n if (eventInstance) {\r\n this.eventInstance = eventInstance;\r\n }\r\n }\r\n return EventRange;\r\n}());\r\nexports.default = EventRange;\r\n\n\n/***/ }),\n/* 51 */\n/***/ (function(module, exports, __webpack_require__) {\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar tslib_1 = __webpack_require__(2);\r\nvar Class_1 = __webpack_require__(35);\r\nvar EmitterMixin_1 = __webpack_require__(13);\r\nvar ListenerMixin_1 = __webpack_require__(7);\r\nvar Model = /** @class */ (function (_super) {\r\n tslib_1.__extends(Model, _super);\r\n function Model() {\r\n var _this = _super.call(this) || this;\r\n _this._watchers = {};\r\n _this._props = {};\r\n _this.applyGlobalWatchers();\r\n _this.constructed();\r\n return _this;\r\n }\r\n Model.watch = function (name) {\r\n var args = [];\r\n for (var _i = 1; _i < arguments.length; _i++) {\r\n args[_i - 1] = arguments[_i];\r\n }\r\n // subclasses should make a masked-copy of the superclass's map\r\n // TODO: write test\r\n if (!this.prototype.hasOwnProperty('_globalWatchArgs')) {\r\n this.prototype._globalWatchArgs = Object.create(this.prototype._globalWatchArgs);\r\n }\r\n this.prototype._globalWatchArgs[name] = args;\r\n };\r\n Model.prototype.constructed = function () {\r\n // useful for monkeypatching. TODO: BaseClass?\r\n };\r\n Model.prototype.applyGlobalWatchers = function () {\r\n var map = this._globalWatchArgs;\r\n var name;\r\n for (name in map) {\r\n this.watch.apply(this, [name].concat(map[name]));\r\n }\r\n };\r\n Model.prototype.has = function (name) {\r\n return name in this._props;\r\n };\r\n Model.prototype.get = function (name) {\r\n if (name === undefined) {\r\n return this._props;\r\n }\r\n return this._props[name];\r\n };\r\n Model.prototype.set = function (name, val) {\r\n var newProps;\r\n if (typeof name === 'string') {\r\n newProps = {};\r\n newProps[name] = val === undefined ? null : val;\r\n }\r\n else {\r\n newProps = name;\r\n }\r\n this.setProps(newProps);\r\n };\r\n Model.prototype.reset = function (newProps) {\r\n var oldProps = this._props;\r\n var changeset = {}; // will have undefined's to signal unsets\r\n var name;\r\n for (name in oldProps) {\r\n changeset[name] = undefined;\r\n }\r\n for (name in newProps) {\r\n changeset[name] = newProps[name];\r\n }\r\n this.setProps(changeset);\r\n };\r\n Model.prototype.unset = function (name) {\r\n var newProps = {};\r\n var names;\r\n var i;\r\n if (typeof name === 'string') {\r\n names = [name];\r\n }\r\n else {\r\n names = name;\r\n }\r\n for (i = 0; i < names.length; i++) {\r\n newProps[names[i]] = undefined;\r\n }\r\n this.setProps(newProps);\r\n };\r\n Model.prototype.setProps = function (newProps) {\r\n var changedProps = {};\r\n var changedCnt = 0;\r\n var name;\r\n var val;\r\n for (name in newProps) {\r\n val = newProps[name];\r\n // a change in value?\r\n // if an object, don't check equality, because might have been mutated internally.\r\n // TODO: eventually enforce immutability.\r\n if (typeof val === 'object' ||\r\n val !== this._props[name]) {\r\n changedProps[name] = val;\r\n changedCnt++;\r\n }\r\n }\r\n if (changedCnt) {\r\n this.trigger('before:batchChange', changedProps);\r\n for (name in changedProps) {\r\n val = changedProps[name];\r\n this.trigger('before:change', name, val);\r\n this.trigger('before:change:' + name, val);\r\n }\r\n for (name in changedProps) {\r\n val = changedProps[name];\r\n if (val === undefined) {\r\n delete this._props[name];\r\n }\r\n else {\r\n this._props[name] = val;\r\n }\r\n this.trigger('change:' + name, val);\r\n this.trigger('change', name, val);\r\n }\r\n this.trigger('batchChange', changedProps);\r\n }\r\n };\r\n Model.prototype.watch = function (name, depList, startFunc, stopFunc) {\r\n var _this = this;\r\n this.unwatch(name);\r\n this._watchers[name] = this._watchDeps(depList, function (deps) {\r\n var res = startFunc.call(_this, deps);\r\n if (res && res.then) {\r\n _this.unset(name); // put in an unset state while resolving\r\n res.then(function (val) {\r\n _this.set(name, val);\r\n });\r\n }\r\n else {\r\n _this.set(name, res);\r\n }\r\n }, function (deps) {\r\n _this.unset(name);\r\n if (stopFunc) {\r\n stopFunc.call(_this, deps);\r\n }\r\n });\r\n };\r\n Model.prototype.unwatch = function (name) {\r\n var watcher = this._watchers[name];\r\n if (watcher) {\r\n delete this._watchers[name];\r\n watcher.teardown();\r\n }\r\n };\r\n Model.prototype._watchDeps = function (depList, startFunc, stopFunc) {\r\n var _this = this;\r\n var queuedChangeCnt = 0;\r\n var depCnt = depList.length;\r\n var satisfyCnt = 0;\r\n var values = {}; // what's passed as the `deps` arguments\r\n var bindTuples = []; // array of [ eventName, handlerFunc ] arrays\r\n var isCallingStop = false;\r\n var onBeforeDepChange = function (depName, val, isOptional) {\r\n queuedChangeCnt++;\r\n if (queuedChangeCnt === 1) { // first change to cause a \"stop\" ?\r\n if (satisfyCnt === depCnt) { // all deps previously satisfied?\r\n isCallingStop = true;\r\n stopFunc(values);\r\n isCallingStop = false;\r\n }\r\n }\r\n };\r\n var onDepChange = function (depName, val, isOptional) {\r\n if (val === undefined) { // unsetting a value?\r\n // required dependency that was previously set?\r\n if (!isOptional && values[depName] !== undefined) {\r\n satisfyCnt--;\r\n }\r\n delete values[depName];\r\n }\r\n else { // setting a value?\r\n // required dependency that was previously unset?\r\n if (!isOptional && values[depName] === undefined) {\r\n satisfyCnt++;\r\n }\r\n values[depName] = val;\r\n }\r\n queuedChangeCnt--;\r\n if (!queuedChangeCnt) { // last change to cause a \"start\"?\r\n // now finally satisfied or satisfied all along?\r\n if (satisfyCnt === depCnt) {\r\n // if the stopFunc initiated another value change, ignore it.\r\n // it will be processed by another change event anyway.\r\n if (!isCallingStop) {\r\n startFunc(values);\r\n }\r\n }\r\n }\r\n };\r\n // intercept for .on() that remembers handlers\r\n var bind = function (eventName, handler) {\r\n _this.on(eventName, handler);\r\n bindTuples.push([eventName, handler]);\r\n };\r\n // listen to dependency changes\r\n depList.forEach(function (depName) {\r\n var isOptional = false;\r\n if (depName.charAt(0) === '?') { // TODO: more DRY\r\n depName = depName.substring(1);\r\n isOptional = true;\r\n }\r\n bind('before:change:' + depName, function (val) {\r\n onBeforeDepChange(depName, val, isOptional);\r\n });\r\n bind('change:' + depName, function (val) {\r\n onDepChange(depName, val, isOptional);\r\n });\r\n });\r\n // process current dependency values\r\n depList.forEach(function (depName) {\r\n var isOptional = false;\r\n if (depName.charAt(0) === '?') { // TODO: more DRY\r\n depName = depName.substring(1);\r\n isOptional = true;\r\n }\r\n if (_this.has(depName)) {\r\n values[depName] = _this.get(depName);\r\n satisfyCnt++;\r\n }\r\n else if (isOptional) {\r\n satisfyCnt++;\r\n }\r\n });\r\n // initially satisfied\r\n if (satisfyCnt === depCnt) {\r\n startFunc(values);\r\n }\r\n return {\r\n teardown: function () {\r\n // remove all handlers\r\n for (var i = 0; i < bindTuples.length; i++) {\r\n _this.off(bindTuples[i][0], bindTuples[i][1]);\r\n }\r\n bindTuples = null;\r\n // was satisfied, so call stopFunc\r\n if (satisfyCnt === depCnt) {\r\n stopFunc();\r\n }\r\n },\r\n flash: function () {\r\n if (satisfyCnt === depCnt) {\r\n stopFunc();\r\n startFunc(values);\r\n }\r\n }\r\n };\r\n };\r\n Model.prototype.flash = function (name) {\r\n var watcher = this._watchers[name];\r\n if (watcher) {\r\n watcher.flash();\r\n }\r\n };\r\n return Model;\r\n}(Class_1.default));\r\nexports.default = Model;\r\nModel.prototype._globalWatchArgs = {}; // mutation protection in Model.watch\r\nEmitterMixin_1.default.mixInto(Model);\r\nListenerMixin_1.default.mixInto(Model);\r\n\n\n/***/ }),\n/* 52 */\n/***/ (function(module, exports, __webpack_require__) {\n\n/*\r\nUSAGE:\r\n import { default as ParsableModelMixin, ParsableModelInterface } from './ParsableModelMixin'\r\nin class:\r\n applyProps: ParsableModelInterface['applyProps']\r\n applyManualStandardProps: ParsableModelInterface['applyManualStandardProps']\r\n applyMiscProps: ParsableModelInterface['applyMiscProps']\r\n isStandardProp: ParsableModelInterface['isStandardProp']\r\n static defineStandardProps = ParsableModelMixin.defineStandardProps\r\n static copyVerbatimStandardProps = ParsableModelMixin.copyVerbatimStandardProps\r\nafter class:\r\n ParsableModelMixin.mixInto(TheClass)\r\n*/\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar tslib_1 = __webpack_require__(2);\r\nvar util_1 = __webpack_require__(4);\r\nvar Mixin_1 = __webpack_require__(15);\r\nvar ParsableModelMixin = /** @class */ (function (_super) {\r\n tslib_1.__extends(ParsableModelMixin, _super);\r\n function ParsableModelMixin() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n ParsableModelMixin.defineStandardProps = function (propDefs) {\r\n var proto = this.prototype;\r\n if (!proto.hasOwnProperty('standardPropMap')) {\r\n proto.standardPropMap = Object.create(proto.standardPropMap);\r\n }\r\n util_1.copyOwnProps(propDefs, proto.standardPropMap);\r\n };\r\n ParsableModelMixin.copyVerbatimStandardProps = function (src, dest) {\r\n var map = this.prototype.standardPropMap;\r\n var propName;\r\n for (propName in map) {\r\n if (src[propName] != null && // in the src object?\r\n map[propName] === true // false means \"copy verbatim\"\r\n ) {\r\n dest[propName] = src[propName];\r\n }\r\n }\r\n };\r\n /*\r\n Returns true/false for success.\r\n Meant to be only called ONCE, at object creation.\r\n */\r\n ParsableModelMixin.prototype.applyProps = function (rawProps) {\r\n var standardPropMap = this.standardPropMap;\r\n var manualProps = {};\r\n var miscProps = {};\r\n var propName;\r\n for (propName in rawProps) {\r\n if (standardPropMap[propName] === true) { // copy verbatim\r\n this[propName] = rawProps[propName];\r\n }\r\n else if (standardPropMap[propName] === false) {\r\n manualProps[propName] = rawProps[propName];\r\n }\r\n else {\r\n miscProps[propName] = rawProps[propName];\r\n }\r\n }\r\n this.applyMiscProps(miscProps);\r\n return this.applyManualStandardProps(manualProps);\r\n };\r\n /*\r\n If subclasses override, they must call this supermethod and return the boolean response.\r\n Meant to be only called ONCE, at object creation.\r\n */\r\n ParsableModelMixin.prototype.applyManualStandardProps = function (rawProps) {\r\n return true;\r\n };\r\n /*\r\n Can be called even after initial object creation.\r\n */\r\n ParsableModelMixin.prototype.applyMiscProps = function (rawProps) {\r\n // subclasses can implement\r\n };\r\n /*\r\n TODO: why is this a method when defineStandardProps is static\r\n */\r\n ParsableModelMixin.prototype.isStandardProp = function (propName) {\r\n return propName in this.standardPropMap;\r\n };\r\n return ParsableModelMixin;\r\n}(Mixin_1.default));\r\nexports.default = ParsableModelMixin;\r\nParsableModelMixin.prototype.standardPropMap = {}; // will be cloned by defineStandardProps\r\n\n\n/***/ }),\n/* 53 */\n/***/ (function(module, exports) {\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar EventInstance = /** @class */ (function () {\r\n function EventInstance(def, dateProfile) {\r\n this.def = def;\r\n this.dateProfile = dateProfile;\r\n }\r\n EventInstance.prototype.toLegacy = function () {\r\n var dateProfile = this.dateProfile;\r\n var obj = this.def.toLegacy();\r\n obj.start = dateProfile.start.clone();\r\n obj.end = dateProfile.end ? dateProfile.end.clone() : null;\r\n return obj;\r\n };\r\n return EventInstance;\r\n}());\r\nexports.default = EventInstance;\r\n\n\n/***/ }),\n/* 54 */\n/***/ (function(module, exports, __webpack_require__) {\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar tslib_1 = __webpack_require__(2);\r\nvar $ = __webpack_require__(3);\r\nvar moment = __webpack_require__(0);\r\nvar EventDef_1 = __webpack_require__(37);\r\nvar EventInstance_1 = __webpack_require__(53);\r\nvar EventDateProfile_1 = __webpack_require__(16);\r\nvar RecurringEventDef = /** @class */ (function (_super) {\r\n tslib_1.__extends(RecurringEventDef, _super);\r\n function RecurringEventDef() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n RecurringEventDef.prototype.isAllDay = function () {\r\n return !this.startTime && !this.endTime;\r\n };\r\n RecurringEventDef.prototype.buildInstances = function (unzonedRange) {\r\n var calendar = this.source.calendar;\r\n var unzonedDate = unzonedRange.getStart();\r\n var unzonedEnd = unzonedRange.getEnd();\r\n var zonedDayStart;\r\n var instanceStart;\r\n var instanceEnd;\r\n var instances = [];\r\n while (unzonedDate.isBefore(unzonedEnd)) {\r\n // if everyday, or this particular day-of-week\r\n if (!this.dowHash || this.dowHash[unzonedDate.day()]) {\r\n zonedDayStart = calendar.applyTimezone(unzonedDate);\r\n instanceStart = zonedDayStart.clone();\r\n instanceEnd = null;\r\n if (this.startTime) {\r\n instanceStart.time(this.startTime);\r\n }\r\n else {\r\n instanceStart.stripTime();\r\n }\r\n if (this.endTime) {\r\n instanceEnd = zonedDayStart.clone().time(this.endTime);\r\n }\r\n instances.push(new EventInstance_1.default(this, // definition\r\n new EventDateProfile_1.default(instanceStart, instanceEnd, calendar)));\r\n }\r\n unzonedDate.add(1, 'days');\r\n }\r\n return instances;\r\n };\r\n RecurringEventDef.prototype.setDow = function (dowNumbers) {\r\n if (!this.dowHash) {\r\n this.dowHash = {};\r\n }\r\n for (var i = 0; i < dowNumbers.length; i++) {\r\n this.dowHash[dowNumbers[i]] = true;\r\n }\r\n };\r\n RecurringEventDef.prototype.clone = function () {\r\n var def = _super.prototype.clone.call(this);\r\n if (def.startTime) {\r\n def.startTime = moment.duration(this.startTime);\r\n }\r\n if (def.endTime) {\r\n def.endTime = moment.duration(this.endTime);\r\n }\r\n if (this.dowHash) {\r\n def.dowHash = $.extend({}, this.dowHash);\r\n }\r\n return def;\r\n };\r\n return RecurringEventDef;\r\n}(EventDef_1.default));\r\nexports.default = RecurringEventDef;\r\n/*\r\nHACK to work with TypeScript mixins\r\nNOTE: if super-method fails, should still attempt to apply\r\n*/\r\nRecurringEventDef.prototype.applyProps = function (rawProps) {\r\n var superSuccess = EventDef_1.default.prototype.applyProps.call(this, rawProps);\r\n if (rawProps.start) {\r\n this.startTime = moment.duration(rawProps.start);\r\n }\r\n if (rawProps.end) {\r\n this.endTime = moment.duration(rawProps.end);\r\n }\r\n if (rawProps.dow) {\r\n this.setDow(rawProps.dow);\r\n }\r\n return superSuccess;\r\n};\r\n// Parsing\r\n// ---------------------------------------------------------------------------------------------------------------------\r\nRecurringEventDef.defineStandardProps({\r\n start: false,\r\n end: false,\r\n dow: false\r\n});\r\n\n\n/***/ }),\n/* 55 */\n/***/ (function(module, exports, __webpack_require__) {\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar moment = __webpack_require__(0);\r\nvar util_1 = __webpack_require__(4);\r\nvar UnzonedRange_1 = __webpack_require__(5);\r\nvar DateProfileGenerator = /** @class */ (function () {\r\n function DateProfileGenerator(_view) {\r\n this._view = _view;\r\n }\r\n DateProfileGenerator.prototype.opt = function (name) {\r\n return this._view.opt(name);\r\n };\r\n DateProfileGenerator.prototype.trimHiddenDays = function (unzonedRange) {\r\n return this._view.trimHiddenDays(unzonedRange);\r\n };\r\n DateProfileGenerator.prototype.msToUtcMoment = function (ms, forceAllDay) {\r\n return this._view.calendar.msToUtcMoment(ms, forceAllDay);\r\n };\r\n /* Date Range Computation\r\n ------------------------------------------------------------------------------------------------------------------*/\r\n // Builds a structure with info about what the dates/ranges will be for the \"prev\" view.\r\n DateProfileGenerator.prototype.buildPrev = function (currentDateProfile) {\r\n var prevDate = currentDateProfile.date.clone()\r\n .startOf(currentDateProfile.currentRangeUnit)\r\n .subtract(currentDateProfile.dateIncrement);\r\n return this.build(prevDate, -1);\r\n };\r\n // Builds a structure with info about what the dates/ranges will be for the \"next\" view.\r\n DateProfileGenerator.prototype.buildNext = function (currentDateProfile) {\r\n var nextDate = currentDateProfile.date.clone()\r\n .startOf(currentDateProfile.currentRangeUnit)\r\n .add(currentDateProfile.dateIncrement);\r\n return this.build(nextDate, 1);\r\n };\r\n // Builds a structure holding dates/ranges for rendering around the given date.\r\n // Optional direction param indicates whether the date is being incremented/decremented\r\n // from its previous value. decremented = -1, incremented = 1 (default).\r\n DateProfileGenerator.prototype.build = function (date, direction, forceToValid) {\r\n if (forceToValid === void 0) { forceToValid = false; }\r\n var isDateAllDay = !date.hasTime();\r\n var validUnzonedRange;\r\n var minTime = null;\r\n var maxTime = null;\r\n var currentInfo;\r\n var isRangeAllDay;\r\n var renderUnzonedRange;\r\n var activeUnzonedRange;\r\n var isValid;\r\n validUnzonedRange = this.buildValidRange();\r\n validUnzonedRange = this.trimHiddenDays(validUnzonedRange);\r\n if (forceToValid) {\r\n date = this.msToUtcMoment(validUnzonedRange.constrainDate(date), // returns MS\r\n isDateAllDay);\r\n }\r\n currentInfo = this.buildCurrentRangeInfo(date, direction);\r\n isRangeAllDay = /^(year|month|week|day)$/.test(currentInfo.unit);\r\n renderUnzonedRange = this.buildRenderRange(this.trimHiddenDays(currentInfo.unzonedRange), currentInfo.unit, isRangeAllDay);\r\n renderUnzonedRange = this.trimHiddenDays(renderUnzonedRange);\r\n activeUnzonedRange = renderUnzonedRange.clone();\r\n if (!this.opt('showNonCurrentDates')) {\r\n activeUnzonedRange = activeUnzonedRange.intersect(currentInfo.unzonedRange);\r\n }\r\n minTime = moment.duration(this.opt('minTime'));\r\n maxTime = moment.duration(this.opt('maxTime'));\r\n activeUnzonedRange = this.adjustActiveRange(activeUnzonedRange, minTime, maxTime);\r\n activeUnzonedRange = activeUnzonedRange.intersect(validUnzonedRange); // might return null\r\n if (activeUnzonedRange) {\r\n date = this.msToUtcMoment(activeUnzonedRange.constrainDate(date), // returns MS\r\n isDateAllDay);\r\n }\r\n // it's invalid if the originally requested date is not contained,\r\n // or if the range is completely outside of the valid range.\r\n isValid = currentInfo.unzonedRange.intersectsWith(validUnzonedRange);\r\n return {\r\n // constraint for where prev/next operations can go and where events can be dragged/resized to.\r\n // an object with optional start and end properties.\r\n validUnzonedRange: validUnzonedRange,\r\n // range the view is formally responsible for.\r\n // for example, a month view might have 1st-31st, excluding padded dates\r\n currentUnzonedRange: currentInfo.unzonedRange,\r\n // name of largest unit being displayed, like \"month\" or \"week\"\r\n currentRangeUnit: currentInfo.unit,\r\n isRangeAllDay: isRangeAllDay,\r\n // dates that display events and accept drag-n-drop\r\n // will be `null` if no dates accept events\r\n activeUnzonedRange: activeUnzonedRange,\r\n // date range with a rendered skeleton\r\n // includes not-active days that need some sort of DOM\r\n renderUnzonedRange: renderUnzonedRange,\r\n // Duration object that denotes the first visible time of any given day\r\n minTime: minTime,\r\n // Duration object that denotes the exclusive visible end time of any given day\r\n maxTime: maxTime,\r\n isValid: isValid,\r\n date: date,\r\n // how far the current date will move for a prev/next operation\r\n dateIncrement: this.buildDateIncrement(currentInfo.duration)\r\n // pass a fallback (might be null) ^\r\n };\r\n };\r\n // Builds an object with optional start/end properties.\r\n // Indicates the minimum/maximum dates to display.\r\n // not responsible for trimming hidden days.\r\n DateProfileGenerator.prototype.buildValidRange = function () {\r\n return this._view.getUnzonedRangeOption('validRange', this._view.calendar.getNow()) ||\r\n new UnzonedRange_1.default(); // completely open-ended\r\n };\r\n // Builds a structure with info about the \"current\" range, the range that is\r\n // highlighted as being the current month for example.\r\n // See build() for a description of `direction`.\r\n // Guaranteed to have `range` and `unit` properties. `duration` is optional.\r\n // TODO: accept a MS-time instead of a moment `date`?\r\n DateProfileGenerator.prototype.buildCurrentRangeInfo = function (date, direction) {\r\n var viewSpec = this._view.viewSpec;\r\n var duration = null;\r\n var unit = null;\r\n var unzonedRange = null;\r\n var dayCount;\r\n if (viewSpec.duration) {\r\n duration = viewSpec.duration;\r\n unit = viewSpec.durationUnit;\r\n unzonedRange = this.buildRangeFromDuration(date, direction, duration, unit);\r\n }\r\n else if ((dayCount = this.opt('dayCount'))) {\r\n unit = 'day';\r\n unzonedRange = this.buildRangeFromDayCount(date, direction, dayCount);\r\n }\r\n else if ((unzonedRange = this.buildCustomVisibleRange(date))) {\r\n unit = util_1.computeGreatestUnit(unzonedRange.getStart(), unzonedRange.getEnd());\r\n }\r\n else {\r\n duration = this.getFallbackDuration();\r\n unit = util_1.computeGreatestUnit(duration);\r\n unzonedRange = this.buildRangeFromDuration(date, direction, duration, unit);\r\n }\r\n return { duration: duration, unit: unit, unzonedRange: unzonedRange };\r\n };\r\n DateProfileGenerator.prototype.getFallbackDuration = function () {\r\n return moment.duration({ days: 1 });\r\n };\r\n // Returns a new activeUnzonedRange to have time values (un-ambiguate)\r\n // minTime or maxTime causes the range to expand.\r\n DateProfileGenerator.prototype.adjustActiveRange = function (unzonedRange, minTime, maxTime) {\r\n var start = unzonedRange.getStart();\r\n var end = unzonedRange.getEnd();\r\n if (this._view.usesMinMaxTime) {\r\n if (minTime < 0) {\r\n start.time(0).add(minTime);\r\n }\r\n if (maxTime > 24 * 60 * 60 * 1000) { // beyond 24 hours?\r\n end.time(maxTime - (24 * 60 * 60 * 1000));\r\n }\r\n }\r\n return new UnzonedRange_1.default(start, end);\r\n };\r\n // Builds the \"current\" range when it is specified as an explicit duration.\r\n // `unit` is the already-computed computeGreatestUnit value of duration.\r\n // TODO: accept a MS-time instead of a moment `date`?\r\n DateProfileGenerator.prototype.buildRangeFromDuration = function (date, direction, duration, unit) {\r\n var alignment = this.opt('dateAlignment');\r\n var dateIncrementInput;\r\n var dateIncrementDuration;\r\n var start;\r\n var end;\r\n var res;\r\n // compute what the alignment should be\r\n if (!alignment) {\r\n dateIncrementInput = this.opt('dateIncrement');\r\n if (dateIncrementInput) {\r\n dateIncrementDuration = moment.duration(dateIncrementInput);\r\n // use the smaller of the two units\r\n if (dateIncrementDuration < duration) {\r\n alignment = util_1.computeDurationGreatestUnit(dateIncrementDuration, dateIncrementInput);\r\n }\r\n else {\r\n alignment = unit;\r\n }\r\n }\r\n else {\r\n alignment = unit;\r\n }\r\n }\r\n // if the view displays a single day or smaller\r\n if (duration.as('days') <= 1) {\r\n if (this._view.isHiddenDay(start)) {\r\n start = this._view.skipHiddenDays(start, direction);\r\n start.startOf('day');\r\n }\r\n }\r\n function computeRes() {\r\n start = date.clone().startOf(alignment);\r\n end = start.clone().add(duration);\r\n res = new UnzonedRange_1.default(start, end);\r\n }\r\n computeRes();\r\n // if range is completely enveloped by hidden days, go past the hidden days\r\n if (!this.trimHiddenDays(res)) {\r\n date = this._view.skipHiddenDays(date, direction);\r\n computeRes();\r\n }\r\n return res;\r\n };\r\n // Builds the \"current\" range when a dayCount is specified.\r\n // TODO: accept a MS-time instead of a moment `date`?\r\n DateProfileGenerator.prototype.buildRangeFromDayCount = function (date, direction, dayCount) {\r\n var customAlignment = this.opt('dateAlignment');\r\n var runningCount = 0;\r\n var start;\r\n var end;\r\n if (customAlignment || direction !== -1) {\r\n start = date.clone();\r\n if (customAlignment) {\r\n start.startOf(customAlignment);\r\n }\r\n start.startOf('day');\r\n start = this._view.skipHiddenDays(start);\r\n end = start.clone();\r\n do {\r\n end.add(1, 'day');\r\n if (!this._view.isHiddenDay(end)) {\r\n runningCount++;\r\n }\r\n } while (runningCount < dayCount);\r\n }\r\n else {\r\n end = date.clone().startOf('day').add(1, 'day');\r\n end = this._view.skipHiddenDays(end, -1, true);\r\n start = end.clone();\r\n do {\r\n start.add(-1, 'day');\r\n if (!this._view.isHiddenDay(start)) {\r\n runningCount++;\r\n }\r\n } while (runningCount < dayCount);\r\n }\r\n return new UnzonedRange_1.default(start, end);\r\n };\r\n // Builds a normalized range object for the \"visible\" range,\r\n // which is a way to define the currentUnzonedRange and activeUnzonedRange at the same time.\r\n // TODO: accept a MS-time instead of a moment `date`?\r\n DateProfileGenerator.prototype.buildCustomVisibleRange = function (date) {\r\n var visibleUnzonedRange = this._view.getUnzonedRangeOption('visibleRange', this._view.calendar.applyTimezone(date) // correct zone. also generates new obj that avoids mutations\r\n );\r\n if (visibleUnzonedRange && (visibleUnzonedRange.startMs == null || visibleUnzonedRange.endMs == null)) {\r\n return null;\r\n }\r\n return visibleUnzonedRange;\r\n };\r\n // Computes the range that will represent the element/cells for *rendering*,\r\n // but which may have voided days/times.\r\n // not responsible for trimming hidden days.\r\n DateProfileGenerator.prototype.buildRenderRange = function (currentUnzonedRange, currentRangeUnit, isRangeAllDay) {\r\n return currentUnzonedRange.clone();\r\n };\r\n // Compute the duration value that should be added/substracted to the current date\r\n // when a prev/next operation happens.\r\n DateProfileGenerator.prototype.buildDateIncrement = function (fallback) {\r\n var dateIncrementInput = this.opt('dateIncrement');\r\n var customAlignment;\r\n if (dateIncrementInput) {\r\n return moment.duration(dateIncrementInput);\r\n }\r\n else if ((customAlignment = this.opt('dateAlignment'))) {\r\n return moment.duration(1, customAlignment);\r\n }\r\n else if (fallback) {\r\n return fallback;\r\n }\r\n else {\r\n return moment.duration({ days: 1 });\r\n }\r\n };\r\n return DateProfileGenerator;\r\n}());\r\nexports.default = DateProfileGenerator;\r\n\n\n/***/ }),\n/* 56 */\n/***/ (function(module, exports, __webpack_require__) {\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar tslib_1 = __webpack_require__(2);\r\nvar $ = __webpack_require__(3);\r\nvar util_1 = __webpack_require__(4);\r\nvar Promise_1 = __webpack_require__(21);\r\nvar EventSource_1 = __webpack_require__(6);\r\nvar SingleEventDef_1 = __webpack_require__(9);\r\nvar ArrayEventSource = /** @class */ (function (_super) {\r\n tslib_1.__extends(ArrayEventSource, _super);\r\n function ArrayEventSource(calendar) {\r\n var _this = _super.call(this, calendar) || this;\r\n _this.eventDefs = []; // for if setRawEventDefs is never called\r\n return _this;\r\n }\r\n ArrayEventSource.parse = function (rawInput, calendar) {\r\n var rawProps;\r\n // normalize raw input\r\n if ($.isArray(rawInput.events)) { // extended form\r\n rawProps = rawInput;\r\n }\r\n else if ($.isArray(rawInput)) { // short form\r\n rawProps = { events: rawInput };\r\n }\r\n if (rawProps) {\r\n return EventSource_1.default.parse.call(this, rawProps, calendar);\r\n }\r\n return false;\r\n };\r\n ArrayEventSource.prototype.setRawEventDefs = function (rawEventDefs) {\r\n this.rawEventDefs = rawEventDefs;\r\n this.eventDefs = this.parseEventDefs(rawEventDefs);\r\n };\r\n ArrayEventSource.prototype.fetch = function (start, end, timezone) {\r\n var eventDefs = this.eventDefs;\r\n var i;\r\n if (this.currentTimezone != null &&\r\n this.currentTimezone !== timezone) {\r\n for (i = 0; i < eventDefs.length; i++) {\r\n if (eventDefs[i] instanceof SingleEventDef_1.default) {\r\n eventDefs[i].rezone();\r\n }\r\n }\r\n }\r\n this.currentTimezone = timezone;\r\n return Promise_1.default.resolve(eventDefs);\r\n };\r\n ArrayEventSource.prototype.addEventDef = function (eventDef) {\r\n this.eventDefs.push(eventDef);\r\n };\r\n /*\r\n eventDefId already normalized to a string\r\n */\r\n ArrayEventSource.prototype.removeEventDefsById = function (eventDefId) {\r\n return util_1.removeMatching(this.eventDefs, function (eventDef) {\r\n return eventDef.id === eventDefId;\r\n });\r\n };\r\n ArrayEventSource.prototype.removeAllEventDefs = function () {\r\n this.eventDefs = [];\r\n };\r\n ArrayEventSource.prototype.getPrimitive = function () {\r\n return this.rawEventDefs;\r\n };\r\n ArrayEventSource.prototype.applyManualStandardProps = function (rawProps) {\r\n var superSuccess = _super.prototype.applyManualStandardProps.call(this, rawProps);\r\n this.setRawEventDefs(rawProps.events);\r\n return superSuccess;\r\n };\r\n return ArrayEventSource;\r\n}(EventSource_1.default));\r\nexports.default = ArrayEventSource;\r\nArrayEventSource.defineStandardProps({\r\n events: false // don't automatically transfer\r\n});\r\n\n\n/***/ }),\n/* 57 */\n/***/ (function(module, exports, __webpack_require__) {\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar StandardTheme_1 = __webpack_require__(221);\r\nvar JqueryUiTheme_1 = __webpack_require__(222);\r\nvar themeClassHash = {};\r\nfunction defineThemeSystem(themeName, themeClass) {\r\n themeClassHash[themeName] = themeClass;\r\n}\r\nexports.defineThemeSystem = defineThemeSystem;\r\nfunction getThemeSystemClass(themeSetting) {\r\n if (!themeSetting) {\r\n return StandardTheme_1.default;\r\n }\r\n else if (themeSetting === true) {\r\n return JqueryUiTheme_1.default;\r\n }\r\n else {\r\n return themeClassHash[themeSetting];\r\n }\r\n}\r\nexports.getThemeSystemClass = getThemeSystemClass;\r\n\n\n/***/ }),\n/* 58 */\n/***/ (function(module, exports, __webpack_require__) {\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar $ = __webpack_require__(3);\r\nvar util_1 = __webpack_require__(4);\r\n/*\r\nA cache for the left/right/top/bottom/width/height values for one or more elements.\r\nWorks with both offset (from topleft document) and position (from offsetParent).\r\n\noptions:\r\n- els\r\n- isHorizontal\r\n- isVertical\r\n*/\r\nvar CoordCache = /** @class */ (function () {\r\n function CoordCache(options) {\r\n this.isHorizontal = false; // whether to query for left/right/width\r\n this.isVertical = false; // whether to query for top/bottom/height\r\n this.els = $(options.els);\r\n this.isHorizontal = options.isHorizontal;\r\n this.isVertical = options.isVertical;\r\n this.forcedOffsetParentEl = options.offsetParent ? $(options.offsetParent) : null;\r\n }\r\n // Queries the els for coordinates and stores them.\r\n // Call this method before using and of the get* methods below.\r\n CoordCache.prototype.build = function () {\r\n var offsetParentEl = this.forcedOffsetParentEl;\r\n if (!offsetParentEl && this.els.length > 0) {\r\n offsetParentEl = this.els.eq(0).offsetParent();\r\n }\r\n this.origin = offsetParentEl ?\r\n offsetParentEl.offset() :\r\n null;\r\n this.boundingRect = this.queryBoundingRect();\r\n if (this.isHorizontal) {\r\n this.buildElHorizontals();\r\n }\r\n if (this.isVertical) {\r\n this.buildElVerticals();\r\n }\r\n };\r\n // Destroys all internal data about coordinates, freeing memory\r\n CoordCache.prototype.clear = function () {\r\n this.origin = null;\r\n this.boundingRect = null;\r\n this.lefts = null;\r\n this.rights = null;\r\n this.tops = null;\r\n this.bottoms = null;\r\n };\r\n // When called, if coord caches aren't built, builds them\r\n CoordCache.prototype.ensureBuilt = function () {\r\n if (!this.origin) {\r\n this.build();\r\n }\r\n };\r\n // Populates the left/right internal coordinate arrays\r\n CoordCache.prototype.buildElHorizontals = function () {\r\n var lefts = [];\r\n var rights = [];\r\n this.els.each(function (i, node) {\r\n var el = $(node);\r\n var left = el.offset().left;\r\n var width = el.outerWidth();\r\n lefts.push(left);\r\n rights.push(left + width);\r\n });\r\n this.lefts = lefts;\r\n this.rights = rights;\r\n };\r\n // Populates the top/bottom internal coordinate arrays\r\n CoordCache.prototype.buildElVerticals = function () {\r\n var tops = [];\r\n var bottoms = [];\r\n this.els.each(function (i, node) {\r\n var el = $(node);\r\n var top = el.offset().top;\r\n var height = el.outerHeight();\r\n tops.push(top);\r\n bottoms.push(top + height);\r\n });\r\n this.tops = tops;\r\n this.bottoms = bottoms;\r\n };\r\n // Given a left offset (from document left), returns the index of the el that it horizontally intersects.\r\n // If no intersection is made, returns undefined.\r\n CoordCache.prototype.getHorizontalIndex = function (leftOffset) {\r\n this.ensureBuilt();\r\n var lefts = this.lefts;\r\n var rights = this.rights;\r\n var len = lefts.length;\r\n var i;\r\n for (i = 0; i < len; i++) {\r\n if (leftOffset >= lefts[i] && leftOffset < rights[i]) {\r\n return i;\r\n }\r\n }\r\n };\r\n // Given a top offset (from document top), returns the index of the el that it vertically intersects.\r\n // If no intersection is made, returns undefined.\r\n CoordCache.prototype.getVerticalIndex = function (topOffset) {\r\n this.ensureBuilt();\r\n var tops = this.tops;\r\n var bottoms = this.bottoms;\r\n var len = tops.length;\r\n var i;\r\n for (i = 0; i < len; i++) {\r\n if (topOffset >= tops[i] && topOffset < bottoms[i]) {\r\n return i;\r\n }\r\n }\r\n };\r\n // Gets the left offset (from document left) of the element at the given index\r\n CoordCache.prototype.getLeftOffset = function (leftIndex) {\r\n this.ensureBuilt();\r\n return this.lefts[leftIndex];\r\n };\r\n // Gets the left position (from offsetParent left) of the element at the given index\r\n CoordCache.prototype.getLeftPosition = function (leftIndex) {\r\n this.ensureBuilt();\r\n return this.lefts[leftIndex] - this.origin.left;\r\n };\r\n // Gets the right offset (from document left) of the element at the given index.\r\n // This value is NOT relative to the document's right edge, like the CSS concept of \"right\" would be.\r\n CoordCache.prototype.getRightOffset = function (leftIndex) {\r\n this.ensureBuilt();\r\n return this.rights[leftIndex];\r\n };\r\n // Gets the right position (from offsetParent left) of the element at the given index.\r\n // This value is NOT relative to the offsetParent's right edge, like the CSS concept of \"right\" would be.\r\n CoordCache.prototype.getRightPosition = function (leftIndex) {\r\n this.ensureBuilt();\r\n return this.rights[leftIndex] - this.origin.left;\r\n };\r\n // Gets the width of the element at the given index\r\n CoordCache.prototype.getWidth = function (leftIndex) {\r\n this.ensureBuilt();\r\n return this.rights[leftIndex] - this.lefts[leftIndex];\r\n };\r\n // Gets the top offset (from document top) of the element at the given index\r\n CoordCache.prototype.getTopOffset = function (topIndex) {\r\n this.ensureBuilt();\r\n return this.tops[topIndex];\r\n };\r\n // Gets the top position (from offsetParent top) of the element at the given position\r\n CoordCache.prototype.getTopPosition = function (topIndex) {\r\n this.ensureBuilt();\r\n return this.tops[topIndex] - this.origin.top;\r\n };\r\n // Gets the bottom offset (from the document top) of the element at the given index.\r\n // This value is NOT relative to the offsetParent's bottom edge, like the CSS concept of \"bottom\" would be.\r\n CoordCache.prototype.getBottomOffset = function (topIndex) {\r\n this.ensureBuilt();\r\n return this.bottoms[topIndex];\r\n };\r\n // Gets the bottom position (from the offsetParent top) of the element at the given index.\r\n // This value is NOT relative to the offsetParent's bottom edge, like the CSS concept of \"bottom\" would be.\r\n CoordCache.prototype.getBottomPosition = function (topIndex) {\r\n this.ensureBuilt();\r\n return this.bottoms[topIndex] - this.origin.top;\r\n };\r\n // Gets the height of the element at the given index\r\n CoordCache.prototype.getHeight = function (topIndex) {\r\n this.ensureBuilt();\r\n return this.bottoms[topIndex] - this.tops[topIndex];\r\n };\r\n // Bounding Rect\r\n // TODO: decouple this from CoordCache\r\n // Compute and return what the elements' bounding rectangle is, from the user's perspective.\r\n // Right now, only returns a rectangle if constrained by an overflow:scroll element.\r\n // Returns null if there are no elements\r\n CoordCache.prototype.queryBoundingRect = function () {\r\n var scrollParentEl;\r\n if (this.els.length > 0) {\r\n scrollParentEl = util_1.getScrollParent(this.els.eq(0));\r\n if (!scrollParentEl.is(document) &&\r\n !scrollParentEl.is('html,body') // don't consider these bounding rects. solves issue 3615\r\n ) {\r\n return util_1.getClientRect(scrollParentEl);\r\n }\r\n }\r\n return null;\r\n };\r\n CoordCache.prototype.isPointInBounds = function (leftOffset, topOffset) {\r\n return this.isLeftInBounds(leftOffset) && this.isTopInBounds(topOffset);\r\n };\r\n CoordCache.prototype.isLeftInBounds = function (leftOffset) {\r\n return !this.boundingRect || (leftOffset >= this.boundingRect.left && leftOffset < this.boundingRect.right);\r\n };\r\n CoordCache.prototype.isTopInBounds = function (topOffset) {\r\n return !this.boundingRect || (topOffset >= this.boundingRect.top && topOffset < this.boundingRect.bottom);\r\n };\r\n return CoordCache;\r\n}());\r\nexports.default = CoordCache;\r\n\n\n/***/ }),\n/* 59 */\n/***/ (function(module, exports, __webpack_require__) {\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar $ = __webpack_require__(3);\r\nvar util_1 = __webpack_require__(4);\r\nvar ListenerMixin_1 = __webpack_require__(7);\r\nvar GlobalEmitter_1 = __webpack_require__(23);\r\n/* Tracks a drag's mouse movement, firing various handlers\r\n----------------------------------------------------------------------------------------------------------------------*/\r\n// TODO: use Emitter\r\nvar DragListener = /** @class */ (function () {\r\n function DragListener(options) {\r\n this.isInteracting = false;\r\n this.isDistanceSurpassed = false;\r\n this.isDelayEnded = false;\r\n this.isDragging = false;\r\n this.isTouch = false;\r\n this.isGeneric = false; // initiated by 'dragstart' (jqui)\r\n this.shouldCancelTouchScroll = true;\r\n this.scrollAlwaysKills = false;\r\n this.isAutoScroll = false;\r\n // defaults\r\n this.scrollSensitivity = 30; // pixels from edge for scrolling to start\r\n this.scrollSpeed = 200; // pixels per second, at maximum speed\r\n this.scrollIntervalMs = 50; // millisecond wait between scroll increment\r\n this.options = options || {};\r\n }\r\n // Interaction (high-level)\r\n // -----------------------------------------------------------------------------------------------------------------\r\n DragListener.prototype.startInteraction = function (ev, extraOptions) {\r\n if (extraOptions === void 0) { extraOptions = {}; }\r\n if (ev.type === 'mousedown') {\r\n if (GlobalEmitter_1.default.get().shouldIgnoreMouse()) {\r\n return;\r\n }\r\n else if (!util_1.isPrimaryMouseButton(ev)) {\r\n return;\r\n }\r\n else {\r\n ev.preventDefault(); // prevents native selection in most browsers\r\n }\r\n }\r\n if (!this.isInteracting) {\r\n // process options\r\n this.delay = util_1.firstDefined(extraOptions.delay, this.options.delay, 0);\r\n this.minDistance = util_1.firstDefined(extraOptions.distance, this.options.distance, 0);\r\n this.subjectEl = this.options.subjectEl;\r\n util_1.preventSelection($('body'));\r\n this.isInteracting = true;\r\n this.isTouch = util_1.getEvIsTouch(ev);\r\n this.isGeneric = ev.type === 'dragstart';\r\n this.isDelayEnded = false;\r\n this.isDistanceSurpassed = false;\r\n this.originX = util_1.getEvX(ev);\r\n this.originY = util_1.getEvY(ev);\r\n this.scrollEl = util_1.getScrollParent($(ev.target));\r\n this.bindHandlers();\r\n this.initAutoScroll();\r\n this.handleInteractionStart(ev);\r\n this.startDelay(ev);\r\n if (!this.minDistance) {\r\n this.handleDistanceSurpassed(ev);\r\n }\r\n }\r\n };\r\n DragListener.prototype.handleInteractionStart = function (ev) {\r\n this.trigger('interactionStart', ev);\r\n };\r\n DragListener.prototype.endInteraction = function (ev, isCancelled) {\r\n if (this.isInteracting) {\r\n this.endDrag(ev);\r\n if (this.delayTimeoutId) {\r\n clearTimeout(this.delayTimeoutId);\r\n this.delayTimeoutId = null;\r\n }\r\n this.destroyAutoScroll();\r\n this.unbindHandlers();\r\n this.isInteracting = false;\r\n this.handleInteractionEnd(ev, isCancelled);\r\n util_1.allowSelection($('body'));\r\n }\r\n };\r\n DragListener.prototype.handleInteractionEnd = function (ev, isCancelled) {\r\n this.trigger('interactionEnd', ev, isCancelled || false);\r\n };\r\n // Binding To DOM\r\n // -----------------------------------------------------------------------------------------------------------------\r\n DragListener.prototype.bindHandlers = function () {\r\n // some browsers (Safari in iOS 10) don't allow preventDefault on touch events that are bound after touchstart,\r\n // so listen to the GlobalEmitter singleton, which is always bound, instead of the document directly.\r\n var globalEmitter = GlobalEmitter_1.default.get();\r\n if (this.isGeneric) {\r\n this.listenTo($(document), {\r\n drag: this.handleMove,\r\n dragstop: this.endInteraction\r\n });\r\n }\r\n else if (this.isTouch) {\r\n this.listenTo(globalEmitter, {\r\n touchmove: this.handleTouchMove,\r\n touchend: this.endInteraction,\r\n scroll: this.handleTouchScroll\r\n });\r\n }\r\n else {\r\n this.listenTo(globalEmitter, {\r\n mousemove: this.handleMouseMove,\r\n mouseup: this.endInteraction\r\n });\r\n }\r\n this.listenTo(globalEmitter, {\r\n selectstart: util_1.preventDefault,\r\n contextmenu: util_1.preventDefault // long taps would open menu on Chrome dev tools\r\n });\r\n };\r\n DragListener.prototype.unbindHandlers = function () {\r\n this.stopListeningTo(GlobalEmitter_1.default.get());\r\n this.stopListeningTo($(document)); // for isGeneric\r\n };\r\n // Drag (high-level)\r\n // -----------------------------------------------------------------------------------------------------------------\r\n // extraOptions ignored if drag already started\r\n DragListener.prototype.startDrag = function (ev, extraOptions) {\r\n this.startInteraction(ev, extraOptions); // ensure interaction began\r\n if (!this.isDragging) {\r\n this.isDragging = true;\r\n this.handleDragStart(ev);\r\n }\r\n };\r\n DragListener.prototype.handleDragStart = function (ev) {\r\n this.trigger('dragStart', ev);\r\n };\r\n DragListener.prototype.handleMove = function (ev) {\r\n var dx = util_1.getEvX(ev) - this.originX;\r\n var dy = util_1.getEvY(ev) - this.originY;\r\n var minDistance = this.minDistance;\r\n var distanceSq; // current distance from the origin, squared\r\n if (!this.isDistanceSurpassed) {\r\n distanceSq = dx * dx + dy * dy;\r\n if (distanceSq >= minDistance * minDistance) { // use pythagorean theorem\r\n this.handleDistanceSurpassed(ev);\r\n }\r\n }\r\n if (this.isDragging) {\r\n this.handleDrag(dx, dy, ev);\r\n }\r\n };\r\n // Called while the mouse is being moved and when we know a legitimate drag is taking place\r\n DragListener.prototype.handleDrag = function (dx, dy, ev) {\r\n this.trigger('drag', dx, dy, ev);\r\n this.updateAutoScroll(ev); // will possibly cause scrolling\r\n };\r\n DragListener.prototype.endDrag = function (ev) {\r\n if (this.isDragging) {\r\n this.isDragging = false;\r\n this.handleDragEnd(ev);\r\n }\r\n };\r\n DragListener.prototype.handleDragEnd = function (ev) {\r\n this.trigger('dragEnd', ev);\r\n };\r\n // Delay\r\n // -----------------------------------------------------------------------------------------------------------------\r\n DragListener.prototype.startDelay = function (initialEv) {\r\n var _this = this;\r\n if (this.delay) {\r\n this.delayTimeoutId = setTimeout(function () {\r\n _this.handleDelayEnd(initialEv);\r\n }, this.delay);\r\n }\r\n else {\r\n this.handleDelayEnd(initialEv);\r\n }\r\n };\r\n DragListener.prototype.handleDelayEnd = function (initialEv) {\r\n this.isDelayEnded = true;\r\n if (this.isDistanceSurpassed) {\r\n this.startDrag(initialEv);\r\n }\r\n };\r\n // Distance\r\n // -----------------------------------------------------------------------------------------------------------------\r\n DragListener.prototype.handleDistanceSurpassed = function (ev) {\r\n this.isDistanceSurpassed = true;\r\n if (this.isDelayEnded) {\r\n this.startDrag(ev);\r\n }\r\n };\r\n // Mouse / Touch\r\n // -----------------------------------------------------------------------------------------------------------------\r\n DragListener.prototype.handleTouchMove = function (ev) {\r\n // prevent inertia and touchmove-scrolling while dragging\r\n if (this.isDragging && this.shouldCancelTouchScroll) {\r\n ev.preventDefault();\r\n }\r\n this.handleMove(ev);\r\n };\r\n DragListener.prototype.handleMouseMove = function (ev) {\r\n this.handleMove(ev);\r\n };\r\n // Scrolling (unrelated to auto-scroll)\r\n // -----------------------------------------------------------------------------------------------------------------\r\n DragListener.prototype.handleTouchScroll = function (ev) {\r\n // if the drag is being initiated by touch, but a scroll happens before\r\n // the drag-initiating delay is over, cancel the drag\r\n if (!this.isDragging || this.scrollAlwaysKills) {\r\n this.endInteraction(ev, true); // isCancelled=true\r\n }\r\n };\r\n // Utils\r\n // -----------------------------------------------------------------------------------------------------------------\r\n // Triggers a callback. Calls a function in the option hash of the same name.\r\n // Arguments beyond the first `name` are forwarded on.\r\n DragListener.prototype.trigger = function (name) {\r\n var args = [];\r\n for (var _i = 1; _i < arguments.length; _i++) {\r\n args[_i - 1] = arguments[_i];\r\n }\r\n if (this.options[name]) {\r\n this.options[name].apply(this, args);\r\n }\r\n // makes _methods callable by event name. TODO: kill this\r\n if (this['_' + name]) {\r\n this['_' + name].apply(this, args);\r\n }\r\n };\r\n // Auto-scroll\r\n // -----------------------------------------------------------------------------------------------------------------\r\n DragListener.prototype.initAutoScroll = function () {\r\n var scrollEl = this.scrollEl;\r\n this.isAutoScroll =\r\n this.options.scroll &&\r\n scrollEl &&\r\n !scrollEl.is(window) &&\r\n !scrollEl.is(document);\r\n if (this.isAutoScroll) {\r\n // debounce makes sure rapid calls don't happen\r\n this.listenTo(scrollEl, 'scroll', util_1.debounce(this.handleDebouncedScroll, 100));\r\n }\r\n };\r\n DragListener.prototype.destroyAutoScroll = function () {\r\n this.endAutoScroll(); // kill any animation loop\r\n // remove the scroll handler if there is a scrollEl\r\n if (this.isAutoScroll) {\r\n this.stopListeningTo(this.scrollEl, 'scroll'); // will probably get removed by unbindHandlers too :(\r\n }\r\n };\r\n // Computes and stores the bounding rectangle of scrollEl\r\n DragListener.prototype.computeScrollBounds = function () {\r\n if (this.isAutoScroll) {\r\n this.scrollBounds = util_1.getOuterRect(this.scrollEl);\r\n // TODO: use getClientRect in future. but prevents auto scrolling when on top of scrollbars\r\n }\r\n };\r\n // Called when the dragging is in progress and scrolling should be updated\r\n DragListener.prototype.updateAutoScroll = function (ev) {\r\n var sensitivity = this.scrollSensitivity;\r\n var bounds = this.scrollBounds;\r\n var topCloseness;\r\n var bottomCloseness;\r\n var leftCloseness;\r\n var rightCloseness;\r\n var topVel = 0;\r\n var leftVel = 0;\r\n if (bounds) { // only scroll if scrollEl exists\r\n // compute closeness to edges. valid range is from 0.0 - 1.0\r\n topCloseness = (sensitivity - (util_1.getEvY(ev) - bounds.top)) / sensitivity;\r\n bottomCloseness = (sensitivity - (bounds.bottom - util_1.getEvY(ev))) / sensitivity;\r\n leftCloseness = (sensitivity - (util_1.getEvX(ev) - bounds.left)) / sensitivity;\r\n rightCloseness = (sensitivity - (bounds.right - util_1.getEvX(ev))) / sensitivity;\r\n // translate vertical closeness into velocity.\r\n // mouse must be completely in bounds for velocity to happen.\r\n if (topCloseness >= 0 && topCloseness <= 1) {\r\n topVel = topCloseness * this.scrollSpeed * -1; // negative. for scrolling up\r\n }\r\n else if (bottomCloseness >= 0 && bottomCloseness <= 1) {\r\n topVel = bottomCloseness * this.scrollSpeed;\r\n }\r\n // translate horizontal closeness into velocity\r\n if (leftCloseness >= 0 && leftCloseness <= 1) {\r\n leftVel = leftCloseness * this.scrollSpeed * -1; // negative. for scrolling left\r\n }\r\n else if (rightCloseness >= 0 && rightCloseness <= 1) {\r\n leftVel = rightCloseness * this.scrollSpeed;\r\n }\r\n }\r\n this.setScrollVel(topVel, leftVel);\r\n };\r\n // Sets the speed-of-scrolling for the scrollEl\r\n DragListener.prototype.setScrollVel = function (topVel, leftVel) {\r\n this.scrollTopVel = topVel;\r\n this.scrollLeftVel = leftVel;\r\n this.constrainScrollVel(); // massages into realistic values\r\n // if there is non-zero velocity, and an animation loop hasn't already started, then START\r\n if ((this.scrollTopVel || this.scrollLeftVel) && !this.scrollIntervalId) {\r\n this.scrollIntervalId = setInterval(util_1.proxy(this, 'scrollIntervalFunc'), // scope to `this`\r\n this.scrollIntervalMs);\r\n }\r\n };\r\n // Forces scrollTopVel and scrollLeftVel to be zero if scrolling has already gone all the way\r\n DragListener.prototype.constrainScrollVel = function () {\r\n var el = this.scrollEl;\r\n if (this.scrollTopVel < 0) { // scrolling up?\r\n if (el.scrollTop() <= 0) { // already scrolled all the way up?\r\n this.scrollTopVel = 0;\r\n }\r\n }\r\n else if (this.scrollTopVel > 0) { // scrolling down?\r\n if (el.scrollTop() + el[0].clientHeight >= el[0].scrollHeight) { // already scrolled all the way down?\r\n this.scrollTopVel = 0;\r\n }\r\n }\r\n if (this.scrollLeftVel < 0) { // scrolling left?\r\n if (el.scrollLeft() <= 0) { // already scrolled all the left?\r\n this.scrollLeftVel = 0;\r\n }\r\n }\r\n else if (this.scrollLeftVel > 0) { // scrolling right?\r\n if (el.scrollLeft() + el[0].clientWidth >= el[0].scrollWidth) { // already scrolled all the way right?\r\n this.scrollLeftVel = 0;\r\n }\r\n }\r\n };\r\n // This function gets called during every iteration of the scrolling animation loop\r\n DragListener.prototype.scrollIntervalFunc = function () {\r\n var el = this.scrollEl;\r\n var frac = this.scrollIntervalMs / 1000; // considering animation frequency, what the vel should be mult'd by\r\n // change the value of scrollEl's scroll\r\n if (this.scrollTopVel) {\r\n el.scrollTop(el.scrollTop() + this.scrollTopVel * frac);\r\n }\r\n if (this.scrollLeftVel) {\r\n el.scrollLeft(el.scrollLeft() + this.scrollLeftVel * frac);\r\n }\r\n this.constrainScrollVel(); // since the scroll values changed, recompute the velocities\r\n // if scrolled all the way, which causes the vels to be zero, stop the animation loop\r\n if (!this.scrollTopVel && !this.scrollLeftVel) {\r\n this.endAutoScroll();\r\n }\r\n };\r\n // Kills any existing scrolling animation loop\r\n DragListener.prototype.endAutoScroll = function () {\r\n if (this.scrollIntervalId) {\r\n clearInterval(this.scrollIntervalId);\r\n this.scrollIntervalId = null;\r\n this.handleScrollEnd();\r\n }\r\n };\r\n // Get called when the scrollEl is scrolled (NOTE: this is delayed via debounce)\r\n DragListener.prototype.handleDebouncedScroll = function () {\r\n // recompute all coordinates, but *only* if this is *not* part of our scrolling animation\r\n if (!this.scrollIntervalId) {\r\n this.handleScrollEnd();\r\n }\r\n };\r\n DragListener.prototype.handleScrollEnd = function () {\r\n // Called when scrolling has stopped, whether through auto scroll, or the user scrolling\r\n };\r\n return DragListener;\r\n}());\r\nexports.default = DragListener;\r\nListenerMixin_1.default.mixInto(DragListener);\r\n\n\n/***/ }),\n/* 60 */\n/***/ (function(module, exports, __webpack_require__) {\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar tslib_1 = __webpack_require__(2);\r\nvar util_1 = __webpack_require__(4);\r\nvar Mixin_1 = __webpack_require__(15);\r\n/*\r\nA set of rendering and date-related methods for a visual component comprised of one or more rows of day columns.\r\nPrerequisite: the object being mixed into needs to be a *Grid*\r\n*/\r\nvar DayTableMixin = /** @class */ (function (_super) {\r\n tslib_1.__extends(DayTableMixin, _super);\r\n function DayTableMixin() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n // Populates internal variables used for date calculation and rendering\r\n DayTableMixin.prototype.updateDayTable = function () {\r\n var t = this;\r\n var view = t.view;\r\n var calendar = view.calendar;\r\n var date = calendar.msToUtcMoment(t.dateProfile.renderUnzonedRange.startMs, true);\r\n var end = calendar.msToUtcMoment(t.dateProfile.renderUnzonedRange.endMs, true);\r\n var dayIndex = -1;\r\n var dayIndices = [];\r\n var dayDates = [];\r\n var daysPerRow;\r\n var firstDay;\r\n var rowCnt;\r\n while (date.isBefore(end)) { // loop each day from start to end\r\n if (view.isHiddenDay(date)) {\r\n dayIndices.push(dayIndex + 0.5); // mark that it's between indices\r\n }\r\n else {\r\n dayIndex++;\r\n dayIndices.push(dayIndex);\r\n dayDates.push(date.clone());\r\n }\r\n date.add(1, 'days');\r\n }\r\n if (this.breakOnWeeks) {\r\n // count columns until the day-of-week repeats\r\n firstDay = dayDates[0].day();\r\n for (daysPerRow = 1; daysPerRow < dayDates.length; daysPerRow++) {\r\n if (dayDates[daysPerRow].day() === firstDay) {\r\n break;\r\n }\r\n }\r\n rowCnt = Math.ceil(dayDates.length / daysPerRow);\r\n }\r\n else {\r\n rowCnt = 1;\r\n daysPerRow = dayDates.length;\r\n }\r\n this.dayDates = dayDates;\r\n this.dayIndices = dayIndices;\r\n this.daysPerRow = daysPerRow;\r\n this.rowCnt = rowCnt;\r\n this.updateDayTableCols();\r\n };\r\n // Computes and assigned the colCnt property and updates any options that may be computed from it\r\n DayTableMixin.prototype.updateDayTableCols = function () {\r\n this.colCnt = this.computeColCnt();\r\n this.colHeadFormat =\r\n this.opt('columnHeaderFormat') ||\r\n this.opt('columnFormat') || // deprecated\r\n this.computeColHeadFormat();\r\n };\r\n // Determines how many columns there should be in the table\r\n DayTableMixin.prototype.computeColCnt = function () {\r\n return this.daysPerRow;\r\n };\r\n // Computes the ambiguously-timed moment for the given cell\r\n DayTableMixin.prototype.getCellDate = function (row, col) {\r\n return this.dayDates[this.getCellDayIndex(row, col)].clone();\r\n };\r\n // Computes the ambiguously-timed date range for the given cell\r\n DayTableMixin.prototype.getCellRange = function (row, col) {\r\n var start = this.getCellDate(row, col);\r\n var end = start.clone().add(1, 'days');\r\n return { start: start, end: end };\r\n };\r\n // Returns the number of day cells, chronologically, from the first of the grid (0-based)\r\n DayTableMixin.prototype.getCellDayIndex = function (row, col) {\r\n return row * this.daysPerRow + this.getColDayIndex(col);\r\n };\r\n // Returns the numner of day cells, chronologically, from the first cell in *any given row*\r\n DayTableMixin.prototype.getColDayIndex = function (col) {\r\n if (this.isRTL) {\r\n return this.colCnt - 1 - col;\r\n }\r\n else {\r\n return col;\r\n }\r\n };\r\n // Given a date, returns its chronolocial cell-index from the first cell of the grid.\r\n // If the date lies between cells (because of hiddenDays), returns a floating-point value between offsets.\r\n // If before the first offset, returns a negative number.\r\n // If after the last offset, returns an offset past the last cell offset.\r\n // Only works for *start* dates of cells. Will not work for exclusive end dates for cells.\r\n DayTableMixin.prototype.getDateDayIndex = function (date) {\r\n var dayIndices = this.dayIndices;\r\n var dayOffset = date.diff(this.dayDates[0], 'days');\r\n if (dayOffset < 0) {\r\n return dayIndices[0] - 1;\r\n }\r\n else if (dayOffset >= dayIndices.length) {\r\n return dayIndices[dayIndices.length - 1] + 1;\r\n }\r\n else {\r\n return dayIndices[dayOffset];\r\n }\r\n };\r\n /* Options\r\n ------------------------------------------------------------------------------------------------------------------*/\r\n // Computes a default column header formatting string if `colFormat` is not explicitly defined\r\n DayTableMixin.prototype.computeColHeadFormat = function () {\r\n // if more than one week row, or if there are a lot of columns with not much space,\r\n // put just the day numbers will be in each cell\r\n if (this.rowCnt > 1 || this.colCnt > 10) {\r\n return 'ddd'; // \"Sat\"\r\n }\r\n else if (this.colCnt > 1) {\r\n return this.opt('dayOfMonthFormat'); // \"Sat 12/10\"\r\n }\r\n else {\r\n return 'dddd'; // \"Saturday\"\r\n }\r\n };\r\n /* Slicing\r\n ------------------------------------------------------------------------------------------------------------------*/\r\n // Slices up a date range into a segment for every week-row it intersects with\r\n DayTableMixin.prototype.sliceRangeByRow = function (unzonedRange) {\r\n var daysPerRow = this.daysPerRow;\r\n var normalRange = this.view.computeDayRange(unzonedRange); // make whole-day range, considering nextDayThreshold\r\n var rangeFirst = this.getDateDayIndex(normalRange.start); // inclusive first index\r\n var rangeLast = this.getDateDayIndex(normalRange.end.clone().subtract(1, 'days')); // inclusive last index\r\n var segs = [];\r\n var row;\r\n var rowFirst;\r\n var rowLast; // inclusive day-index range for current row\r\n var segFirst;\r\n var segLast; // inclusive day-index range for segment\r\n for (row = 0; row < this.rowCnt; row++) {\r\n rowFirst = row * daysPerRow;\r\n rowLast = rowFirst + daysPerRow - 1;\r\n // intersect segment's offset range with the row's\r\n segFirst = Math.max(rangeFirst, rowFirst);\r\n segLast = Math.min(rangeLast, rowLast);\r\n // deal with in-between indices\r\n segFirst = Math.ceil(segFirst); // in-between starts round to next cell\r\n segLast = Math.floor(segLast); // in-between ends round to prev cell\r\n if (segFirst <= segLast) { // was there any intersection with the current row?\r\n segs.push({\r\n row: row,\r\n // normalize to start of row\r\n firstRowDayIndex: segFirst - rowFirst,\r\n lastRowDayIndex: segLast - rowFirst,\r\n // must be matching integers to be the segment's start/end\r\n isStart: segFirst === rangeFirst,\r\n isEnd: segLast === rangeLast\r\n });\r\n }\r\n }\r\n return segs;\r\n };\r\n // Slices up a date range into a segment for every day-cell it intersects with.\r\n // TODO: make more DRY with sliceRangeByRow somehow.\r\n DayTableMixin.prototype.sliceRangeByDay = function (unzonedRange) {\r\n var daysPerRow = this.daysPerRow;\r\n var normalRange = this.view.computeDayRange(unzonedRange); // make whole-day range, considering nextDayThreshold\r\n var rangeFirst = this.getDateDayIndex(normalRange.start); // inclusive first index\r\n var rangeLast = this.getDateDayIndex(normalRange.end.clone().subtract(1, 'days')); // inclusive last index\r\n var segs = [];\r\n var row;\r\n var rowFirst;\r\n var rowLast; // inclusive day-index range for current row\r\n var i;\r\n var segFirst;\r\n var segLast; // inclusive day-index range for segment\r\n for (row = 0; row < this.rowCnt; row++) {\r\n rowFirst = row * daysPerRow;\r\n rowLast = rowFirst + daysPerRow - 1;\r\n for (i = rowFirst; i <= rowLast; i++) {\r\n // intersect segment's offset range with the row's\r\n segFirst = Math.max(rangeFirst, i);\r\n segLast = Math.min(rangeLast, i);\r\n // deal with in-between indices\r\n segFirst = Math.ceil(segFirst); // in-between starts round to next cell\r\n segLast = Math.floor(segLast); // in-between ends round to prev cell\r\n if (segFirst <= segLast) { // was there any intersection with the current row?\r\n segs.push({\r\n row: row,\r\n // normalize to start of row\r\n firstRowDayIndex: segFirst - rowFirst,\r\n lastRowDayIndex: segLast - rowFirst,\r\n // must be matching integers to be the segment's start/end\r\n isStart: segFirst === rangeFirst,\r\n isEnd: segLast === rangeLast\r\n });\r\n }\r\n }\r\n }\r\n return segs;\r\n };\r\n /* Header Rendering\r\n ------------------------------------------------------------------------------------------------------------------*/\r\n DayTableMixin.prototype.renderHeadHtml = function () {\r\n var theme = this.view.calendar.theme;\r\n return '' +\r\n '' +\r\n ' ' +\r\n '' +\r\n this.renderHeadTrHtml() +\r\n '' +\r\n ' ' +\r\n ' ';\r\n };\r\n DayTableMixin.prototype.renderHeadIntroHtml = function () {\r\n return this.renderIntroHtml(); // fall back to generic\r\n };\r\n DayTableMixin.prototype.renderHeadTrHtml = function () {\r\n return '' +\r\n ' | ' +\r\n (this.isRTL ? '' : this.renderHeadIntroHtml()) +\r\n this.renderHeadDateCellsHtml() +\r\n (this.isRTL ? this.renderHeadIntroHtml() : '') +\r\n '
';\r\n };\r\n DayTableMixin.prototype.renderHeadDateCellsHtml = function () {\r\n var htmls = [];\r\n var col;\r\n var date;\r\n for (col = 0; col < this.colCnt; col++) {\r\n date = this.getCellDate(0, col);\r\n htmls.push(this.renderHeadDateCellHtml(date));\r\n }\r\n return htmls.join('');\r\n };\r\n // TODO: when internalApiVersion, accept an object for HTML attributes\r\n // (colspan should be no different)\r\n DayTableMixin.prototype.renderHeadDateCellHtml = function (date, colspan, otherAttrs) {\r\n var t = this;\r\n var view = t.view;\r\n var isDateValid = t.dateProfile.activeUnzonedRange.containsDate(date); // TODO: called too frequently. cache somehow.\r\n var classNames = [\r\n 'fc-day-header',\r\n view.calendar.theme.getClass('widgetHeader')\r\n ];\r\n var innerHtml;\r\n if (typeof t.opt('columnHeaderHtml') === 'function') {\r\n innerHtml = t.opt('columnHeaderHtml')(date);\r\n }\r\n else if (typeof t.opt('columnHeaderText') === 'function') {\r\n innerHtml = util_1.htmlEscape(t.opt('columnHeaderText')(date));\r\n }\r\n else {\r\n innerHtml = util_1.htmlEscape(date.format(t.colHeadFormat));\r\n }\r\n // if only one row of days, the classNames on the header can represent the specific days beneath\r\n if (t.rowCnt === 1) {\r\n classNames = classNames.concat(\r\n // includes the day-of-week class\r\n // noThemeHighlight=true (don't highlight the header)\r\n t.getDayClasses(date, true));\r\n }\r\n else {\r\n classNames.push('fc-' + util_1.dayIDs[date.day()]); // only add the day-of-week class\r\n }\r\n return '' +\r\n ' 1 ?\r\n ' colspan=\"' + colspan + '\"' :\r\n '') +\r\n (otherAttrs ?\r\n ' ' + otherAttrs :\r\n '') +\r\n '>' +\r\n (isDateValid ?\r\n // don't make a link if the heading could represent multiple days, or if there's only one day (forceOff)\r\n view.buildGotoAnchorHtml({ date: date, forceOff: t.rowCnt > 1 || t.colCnt === 1 }, innerHtml) :\r\n // if not valid, display text, but no link\r\n innerHtml) +\r\n ' | ';\r\n };\r\n /* Background Rendering\r\n ------------------------------------------------------------------------------------------------------------------*/\r\n DayTableMixin.prototype.renderBgTrHtml = function (row) {\r\n return '' +\r\n '' +\r\n (this.isRTL ? '' : this.renderBgIntroHtml(row)) +\r\n this.renderBgCellsHtml(row) +\r\n (this.isRTL ? this.renderBgIntroHtml(row) : '') +\r\n '
';\r\n };\r\n DayTableMixin.prototype.renderBgIntroHtml = function (row) {\r\n return this.renderIntroHtml(); // fall back to generic\r\n };\r\n DayTableMixin.prototype.renderBgCellsHtml = function (row) {\r\n var htmls = [];\r\n var col;\r\n var date;\r\n for (col = 0; col < this.colCnt; col++) {\r\n date = this.getCellDate(row, col);\r\n htmls.push(this.renderBgCellHtml(date));\r\n }\r\n return htmls.join('');\r\n };\r\n DayTableMixin.prototype.renderBgCellHtml = function (date, otherAttrs) {\r\n var t = this;\r\n var view = t.view;\r\n var isDateValid = t.dateProfile.activeUnzonedRange.containsDate(date); // TODO: called too frequently. cache somehow.\r\n var classes = t.getDayClasses(date);\r\n classes.unshift('fc-day', view.calendar.theme.getClass('widgetContent'));\r\n return ' | ';\r\n };\r\n /* Generic\r\n ------------------------------------------------------------------------------------------------------------------*/\r\n DayTableMixin.prototype.renderIntroHtml = function () {\r\n // Generates the default HTML intro for any row. User classes should override\r\n };\r\n // TODO: a generic method for dealing with , RTL, intro\r\n // when increment internalApiVersion\r\n // wrapTr (scheduler)\r\n /* Utils\r\n ------------------------------------------------------------------------------------------------------------------*/\r\n // Applies the generic \"intro\" and \"outro\" HTML to the given cells.\r\n // Intro means the leftmost cell when the calendar is LTR and the rightmost cell when RTL. Vice-versa for outro.\r\n DayTableMixin.prototype.bookendCells = function (trEl) {\r\n var introHtml = this.renderIntroHtml();\r\n if (introHtml) {\r\n if (this.isRTL) {\r\n trEl.append(introHtml);\r\n }\r\n else {\r\n trEl.prepend(introHtml);\r\n }\r\n }\r\n };\r\n return DayTableMixin;\r\n}(Mixin_1.default));\r\nexports.default = DayTableMixin;\r\n\n\n/***/ }),\n/* 61 */\n/***/ (function(module, exports) {\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar BusinessHourRenderer = /** @class */ (function () {\r\n /*\r\n component implements:\r\n - eventRangesToEventFootprints\r\n - eventFootprintsToSegs\r\n */\r\n function BusinessHourRenderer(component, fillRenderer) {\r\n this.component = component;\r\n this.fillRenderer = fillRenderer;\r\n }\r\n BusinessHourRenderer.prototype.render = function (businessHourGenerator) {\r\n var component = this.component;\r\n var unzonedRange = component._getDateProfile().activeUnzonedRange;\r\n var eventInstanceGroup = businessHourGenerator.buildEventInstanceGroup(component.hasAllDayBusinessHours, unzonedRange);\r\n var eventFootprints = eventInstanceGroup ?\r\n component.eventRangesToEventFootprints(eventInstanceGroup.sliceRenderRanges(unzonedRange)) :\r\n [];\r\n this.renderEventFootprints(eventFootprints);\r\n };\r\n BusinessHourRenderer.prototype.renderEventFootprints = function (eventFootprints) {\r\n var segs = this.component.eventFootprintsToSegs(eventFootprints);\r\n this.renderSegs(segs);\r\n this.segs = segs;\r\n };\r\n BusinessHourRenderer.prototype.renderSegs = function (segs) {\r\n if (this.fillRenderer) {\r\n this.fillRenderer.renderSegs('businessHours', segs, {\r\n getClasses: function (seg) {\r\n return ['fc-nonbusiness', 'fc-bgevent'];\r\n }\r\n });\r\n }\r\n };\r\n BusinessHourRenderer.prototype.unrender = function () {\r\n if (this.fillRenderer) {\r\n this.fillRenderer.unrender('businessHours');\r\n }\r\n this.segs = null;\r\n };\r\n BusinessHourRenderer.prototype.getSegs = function () {\r\n return this.segs || [];\r\n };\r\n return BusinessHourRenderer;\r\n}());\r\nexports.default = BusinessHourRenderer;\r\n\n\n/***/ }),\n/* 62 */\n/***/ (function(module, exports, __webpack_require__) {\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar $ = __webpack_require__(3);\r\nvar util_1 = __webpack_require__(4);\r\nvar FillRenderer = /** @class */ (function () {\r\n function FillRenderer(component) {\r\n this.fillSegTag = 'div';\r\n this.component = component;\r\n this.elsByFill = {};\r\n }\r\n FillRenderer.prototype.renderFootprint = function (type, componentFootprint, props) {\r\n this.renderSegs(type, this.component.componentFootprintToSegs(componentFootprint), props);\r\n };\r\n FillRenderer.prototype.renderSegs = function (type, segs, props) {\r\n var els;\r\n segs = this.buildSegEls(type, segs, props); // assignes `.el` to each seg. returns successfully rendered segs\r\n els = this.attachSegEls(type, segs);\r\n if (els) {\r\n this.reportEls(type, els);\r\n }\r\n return segs;\r\n };\r\n // Unrenders a specific type of fill that is currently rendered on the grid\r\n FillRenderer.prototype.unrender = function (type) {\r\n var el = this.elsByFill[type];\r\n if (el) {\r\n el.remove();\r\n delete this.elsByFill[type];\r\n }\r\n };\r\n // Renders and assigns an `el` property for each fill segment. Generic enough to work with different types.\r\n // Only returns segments that successfully rendered.\r\n FillRenderer.prototype.buildSegEls = function (type, segs, props) {\r\n var _this = this;\r\n var html = '';\r\n var renderedSegs = [];\r\n var i;\r\n if (segs.length) {\r\n // build a large concatenation of segment HTML\r\n for (i = 0; i < segs.length; i++) {\r\n html += this.buildSegHtml(type, segs[i], props);\r\n }\r\n // Grab individual elements from the combined HTML string. Use each as the default rendering.\r\n // Then, compute the 'el' for each segment.\r\n $(html).each(function (i, node) {\r\n var seg = segs[i];\r\n var el = $(node);\r\n // allow custom filter methods per-type\r\n if (props.filterEl) {\r\n el = props.filterEl(seg, el);\r\n }\r\n if (el) { // custom filters did not cancel the render\r\n el = $(el); // allow custom filter to return raw DOM node\r\n // correct element type? (would be bad if a non-TD were inserted into a table for example)\r\n if (el.is(_this.fillSegTag)) {\r\n seg.el = el;\r\n renderedSegs.push(seg);\r\n }\r\n }\r\n });\r\n }\r\n return renderedSegs;\r\n };\r\n // Builds the HTML needed for one fill segment. Generic enough to work with different types.\r\n FillRenderer.prototype.buildSegHtml = function (type, seg, props) {\r\n // custom hooks per-type\r\n var classes = props.getClasses ? props.getClasses(seg) : [];\r\n var css = util_1.cssToStr(props.getCss ? props.getCss(seg) : {});\r\n return '<' + this.fillSegTag +\r\n (classes.length ? ' class=\"' + classes.join(' ') + '\"' : '') +\r\n (css ? ' style=\"' + css + '\"' : '') +\r\n ' />';\r\n };\r\n // Should return wrapping DOM structure\r\n FillRenderer.prototype.attachSegEls = function (type, segs) {\r\n // subclasses must implement\r\n };\r\n FillRenderer.prototype.reportEls = function (type, nodes) {\r\n if (this.elsByFill[type]) {\r\n this.elsByFill[type] = this.elsByFill[type].add(nodes);\r\n }\r\n else {\r\n this.elsByFill[type] = $(nodes);\r\n }\r\n };\r\n return FillRenderer;\r\n}());\r\nexports.default = FillRenderer;\r\n\n\n/***/ }),\n/* 63 */\n/***/ (function(module, exports, __webpack_require__) {\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar SingleEventDef_1 = __webpack_require__(9);\r\nvar EventFootprint_1 = __webpack_require__(34);\r\nvar EventSource_1 = __webpack_require__(6);\r\nvar HelperRenderer = /** @class */ (function () {\r\n function HelperRenderer(component, eventRenderer) {\r\n this.view = component._getView();\r\n this.component = component;\r\n this.eventRenderer = eventRenderer;\r\n }\r\n HelperRenderer.prototype.renderComponentFootprint = function (componentFootprint) {\r\n this.renderEventFootprints([\r\n this.fabricateEventFootprint(componentFootprint)\r\n ]);\r\n };\r\n HelperRenderer.prototype.renderEventDraggingFootprints = function (eventFootprints, sourceSeg, isTouch) {\r\n this.renderEventFootprints(eventFootprints, sourceSeg, 'fc-dragging', isTouch ? null : this.view.opt('dragOpacity'));\r\n };\r\n HelperRenderer.prototype.renderEventResizingFootprints = function (eventFootprints, sourceSeg, isTouch) {\r\n this.renderEventFootprints(eventFootprints, sourceSeg, 'fc-resizing');\r\n };\r\n HelperRenderer.prototype.renderEventFootprints = function (eventFootprints, sourceSeg, extraClassNames, opacity) {\r\n var segs = this.component.eventFootprintsToSegs(eventFootprints);\r\n var classNames = 'fc-helper ' + (extraClassNames || '');\r\n var i;\r\n // assigns each seg's el and returns a subset of segs that were rendered\r\n segs = this.eventRenderer.renderFgSegEls(segs);\r\n for (i = 0; i < segs.length; i++) {\r\n segs[i].el.addClass(classNames);\r\n }\r\n if (opacity != null) {\r\n for (i = 0; i < segs.length; i++) {\r\n segs[i].el.css('opacity', opacity);\r\n }\r\n }\r\n this.helperEls = this.renderSegs(segs, sourceSeg);\r\n };\r\n /*\r\n Must return all mock event elements\r\n */\r\n HelperRenderer.prototype.renderSegs = function (segs, sourceSeg) {\r\n // Subclasses must implement\r\n };\r\n HelperRenderer.prototype.unrender = function () {\r\n if (this.helperEls) {\r\n this.helperEls.remove();\r\n this.helperEls = null;\r\n }\r\n };\r\n HelperRenderer.prototype.fabricateEventFootprint = function (componentFootprint) {\r\n var calendar = this.view.calendar;\r\n var eventDateProfile = calendar.footprintToDateProfile(componentFootprint);\r\n var dummyEvent = new SingleEventDef_1.default(new EventSource_1.default(calendar));\r\n var dummyInstance;\r\n dummyEvent.dateProfile = eventDateProfile;\r\n dummyInstance = dummyEvent.buildInstance();\r\n return new EventFootprint_1.default(componentFootprint, dummyEvent, dummyInstance);\r\n };\r\n return HelperRenderer;\r\n}());\r\nexports.default = HelperRenderer;\r\n\n\n/***/ }),\n/* 64 */\n/***/ (function(module, exports, __webpack_require__) {\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar tslib_1 = __webpack_require__(2);\r\nvar GlobalEmitter_1 = __webpack_require__(23);\r\nvar Interaction_1 = __webpack_require__(14);\r\nvar EventPointing = /** @class */ (function (_super) {\r\n tslib_1.__extends(EventPointing, _super);\r\n function EventPointing() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n /*\r\n component must implement:\r\n - publiclyTrigger\r\n */\r\n EventPointing.prototype.bindToEl = function (el) {\r\n var component = this.component;\r\n component.bindSegHandlerToEl(el, 'click', this.handleClick.bind(this));\r\n component.bindSegHandlerToEl(el, 'mouseenter', this.handleMouseover.bind(this));\r\n component.bindSegHandlerToEl(el, 'mouseleave', this.handleMouseout.bind(this));\r\n };\r\n EventPointing.prototype.handleClick = function (seg, ev) {\r\n var res = this.component.publiclyTrigger('eventClick', {\r\n context: seg.el[0],\r\n args: [seg.footprint.getEventLegacy(), ev, this.view]\r\n });\r\n if (res === false) {\r\n ev.preventDefault();\r\n }\r\n };\r\n // Updates internal state and triggers handlers for when an event element is moused over\r\n EventPointing.prototype.handleMouseover = function (seg, ev) {\r\n if (!GlobalEmitter_1.default.get().shouldIgnoreMouse() &&\r\n !this.mousedOverSeg) {\r\n this.mousedOverSeg = seg;\r\n // TODO: move to EventSelecting's responsibility\r\n if (this.view.isEventDefResizable(seg.footprint.eventDef)) {\r\n seg.el.addClass('fc-allow-mouse-resize');\r\n }\r\n this.component.publiclyTrigger('eventMouseover', {\r\n context: seg.el[0],\r\n args: [seg.footprint.getEventLegacy(), ev, this.view]\r\n });\r\n }\r\n };\r\n // Updates internal state and triggers handlers for when an event element is moused out.\r\n // Can be given no arguments, in which case it will mouseout the segment that was previously moused over.\r\n EventPointing.prototype.handleMouseout = function (seg, ev) {\r\n if (this.mousedOverSeg) {\r\n this.mousedOverSeg = null;\r\n // TODO: move to EventSelecting's responsibility\r\n if (this.view.isEventDefResizable(seg.footprint.eventDef)) {\r\n seg.el.removeClass('fc-allow-mouse-resize');\r\n }\r\n this.component.publiclyTrigger('eventMouseout', {\r\n context: seg.el[0],\r\n args: [\r\n seg.footprint.getEventLegacy(),\r\n ev || {},\r\n this.view\r\n ]\r\n });\r\n }\r\n };\r\n EventPointing.prototype.end = function () {\r\n if (this.mousedOverSeg) {\r\n this.handleMouseout(this.mousedOverSeg);\r\n }\r\n };\r\n return EventPointing;\r\n}(Interaction_1.default));\r\nexports.default = EventPointing;\r\n\n\n/***/ }),\n/* 65 */\n/***/ (function(module, exports, __webpack_require__) {\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar tslib_1 = __webpack_require__(2);\r\nvar Mixin_1 = __webpack_require__(15);\r\nvar DateClicking_1 = __webpack_require__(237);\r\nvar DateSelecting_1 = __webpack_require__(236);\r\nvar EventPointing_1 = __webpack_require__(64);\r\nvar EventDragging_1 = __webpack_require__(235);\r\nvar EventResizing_1 = __webpack_require__(234);\r\nvar ExternalDropping_1 = __webpack_require__(233);\r\nvar StandardInteractionsMixin = /** @class */ (function (_super) {\r\n tslib_1.__extends(StandardInteractionsMixin, _super);\r\n function StandardInteractionsMixin() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n return StandardInteractionsMixin;\r\n}(Mixin_1.default));\r\nexports.default = StandardInteractionsMixin;\r\nStandardInteractionsMixin.prototype.dateClickingClass = DateClicking_1.default;\r\nStandardInteractionsMixin.prototype.dateSelectingClass = DateSelecting_1.default;\r\nStandardInteractionsMixin.prototype.eventPointingClass = EventPointing_1.default;\r\nStandardInteractionsMixin.prototype.eventDraggingClass = EventDragging_1.default;\r\nStandardInteractionsMixin.prototype.eventResizingClass = EventResizing_1.default;\r\nStandardInteractionsMixin.prototype.externalDroppingClass = ExternalDropping_1.default;\r\n\n\n/***/ }),\n/* 66 */\n/***/ (function(module, exports, __webpack_require__) {\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar tslib_1 = __webpack_require__(2);\r\nvar $ = __webpack_require__(3);\r\nvar util_1 = __webpack_require__(4);\r\nvar CoordCache_1 = __webpack_require__(58);\r\nvar Popover_1 = __webpack_require__(227);\r\nvar UnzonedRange_1 = __webpack_require__(5);\r\nvar ComponentFootprint_1 = __webpack_require__(12);\r\nvar EventFootprint_1 = __webpack_require__(34);\r\nvar BusinessHourRenderer_1 = __webpack_require__(61);\r\nvar StandardInteractionsMixin_1 = __webpack_require__(65);\r\nvar InteractiveDateComponent_1 = __webpack_require__(42);\r\nvar DayTableMixin_1 = __webpack_require__(60);\r\nvar DayGridEventRenderer_1 = __webpack_require__(243);\r\nvar DayGridHelperRenderer_1 = __webpack_require__(244);\r\nvar DayGridFillRenderer_1 = __webpack_require__(245);\r\n/* A component that renders a grid of whole-days that runs horizontally. There can be multiple rows, one per week.\r\n----------------------------------------------------------------------------------------------------------------------*/\r\nvar DayGrid = /** @class */ (function (_super) {\r\n tslib_1.__extends(DayGrid, _super);\r\n function DayGrid(view) {\r\n var _this = _super.call(this, view) || this;\r\n _this.cellWeekNumbersVisible = false; // display week numbers in day cell?\r\n _this.bottomCoordPadding = 0; // hack for extending the hit area for the last row of the coordinate grid\r\n // isRigid determines whether the individual rows should ignore the contents and be a constant height.\r\n // Relies on the view's colCnt and rowCnt. In the future, this component should probably be self-sufficient.\r\n _this.isRigid = false;\r\n _this.hasAllDayBusinessHours = true;\r\n return _this;\r\n }\r\n // Slices up the given span (unzoned start/end with other misc data) into an array of segments\r\n DayGrid.prototype.componentFootprintToSegs = function (componentFootprint) {\r\n var segs = this.sliceRangeByRow(componentFootprint.unzonedRange);\r\n var i;\r\n var seg;\r\n for (i = 0; i < segs.length; i++) {\r\n seg = segs[i];\r\n if (this.isRTL) {\r\n seg.leftCol = this.daysPerRow - 1 - seg.lastRowDayIndex;\r\n seg.rightCol = this.daysPerRow - 1 - seg.firstRowDayIndex;\r\n }\r\n else {\r\n seg.leftCol = seg.firstRowDayIndex;\r\n seg.rightCol = seg.lastRowDayIndex;\r\n }\r\n }\r\n return segs;\r\n };\r\n /* Date Rendering\r\n ------------------------------------------------------------------------------------------------------------------*/\r\n DayGrid.prototype.renderDates = function (dateProfile) {\r\n this.dateProfile = dateProfile;\r\n this.updateDayTable();\r\n this.renderGrid();\r\n };\r\n DayGrid.prototype.unrenderDates = function () {\r\n this.removeSegPopover();\r\n };\r\n // Renders the rows and columns into the component's `this.el`, which should already be assigned.\r\n DayGrid.prototype.renderGrid = function () {\r\n var view = this.view;\r\n var rowCnt = this.rowCnt;\r\n var colCnt = this.colCnt;\r\n var html = '';\r\n var row;\r\n var col;\r\n if (this.headContainerEl) {\r\n this.headContainerEl.html(this.renderHeadHtml());\r\n }\r\n for (row = 0; row < rowCnt; row++) {\r\n html += this.renderDayRowHtml(row, this.isRigid);\r\n }\r\n this.el.html(html);\r\n this.rowEls = this.el.find('.fc-row');\r\n this.cellEls = this.el.find('.fc-day, .fc-disabled-day');\r\n this.rowCoordCache = new CoordCache_1.default({\r\n els: this.rowEls,\r\n isVertical: true\r\n });\r\n this.colCoordCache = new CoordCache_1.default({\r\n els: this.cellEls.slice(0, this.colCnt),\r\n isHorizontal: true\r\n });\r\n // trigger dayRender with each cell's element\r\n for (row = 0; row < rowCnt; row++) {\r\n for (col = 0; col < colCnt; col++) {\r\n this.publiclyTrigger('dayRender', {\r\n context: view,\r\n args: [\r\n this.getCellDate(row, col),\r\n this.getCellEl(row, col),\r\n view\r\n ]\r\n });\r\n }\r\n }\r\n };\r\n // Generates the HTML for a single row, which is a div that wraps a table.\r\n // `row` is the row number.\r\n DayGrid.prototype.renderDayRowHtml = function (row, isRigid) {\r\n var theme = this.view.calendar.theme;\r\n var classes = ['fc-row', 'fc-week', theme.getClass('dayRow')];\r\n if (isRigid) {\r\n classes.push('fc-rigid');\r\n }\r\n return '' +\r\n '' +\r\n '
' +\r\n '
' +\r\n this.renderBgTrHtml(row) +\r\n '
' +\r\n '
' +\r\n '
' +\r\n '
' +\r\n (this.getIsNumbersVisible() ?\r\n '' +\r\n this.renderNumberTrHtml(row) +\r\n '' :\r\n '') +\r\n '
' +\r\n '
' +\r\n '
';\r\n };\r\n DayGrid.prototype.getIsNumbersVisible = function () {\r\n return this.getIsDayNumbersVisible() || this.cellWeekNumbersVisible;\r\n };\r\n DayGrid.prototype.getIsDayNumbersVisible = function () {\r\n return this.rowCnt > 1;\r\n };\r\n /* Grid Number Rendering\r\n ------------------------------------------------------------------------------------------------------------------*/\r\n DayGrid.prototype.renderNumberTrHtml = function (row) {\r\n return '' +\r\n '
' +\r\n (this.isRTL ? '' : this.renderNumberIntroHtml(row)) +\r\n this.renderNumberCellsHtml(row) +\r\n (this.isRTL ? this.renderNumberIntroHtml(row) : '') +\r\n '
';\r\n };\r\n DayGrid.prototype.renderNumberIntroHtml = function (row) {\r\n return this.renderIntroHtml();\r\n };\r\n DayGrid.prototype.renderNumberCellsHtml = function (row) {\r\n var htmls = [];\r\n var col;\r\n var date;\r\n for (col = 0; col < this.colCnt; col++) {\r\n date = this.getCellDate(row, col);\r\n htmls.push(this.renderNumberCellHtml(date));\r\n }\r\n return htmls.join('');\r\n };\r\n // Generates the HTML for the s of the \"number\" row in the DayGrid's content skeleton.\r\n // The number row will only exist if either day numbers or week numbers are turned on.\r\n DayGrid.prototype.renderNumberCellHtml = function (date) {\r\n var view = this.view;\r\n var html = '';\r\n var isDateValid = this.dateProfile.activeUnzonedRange.containsDate(date); // TODO: called too frequently. cache somehow.\r\n var isDayNumberVisible = this.getIsDayNumbersVisible() && isDateValid;\r\n var classes;\r\n var weekCalcFirstDoW;\r\n if (!isDayNumberVisible && !this.cellWeekNumbersVisible) {\r\n // no numbers in day cell (week number must be along the side)\r\n return ' | | '; // will create an empty space above events :(\r\n }\r\n classes = this.getDayClasses(date);\r\n classes.unshift('fc-day-top');\r\n if (this.cellWeekNumbersVisible) {\r\n // To determine the day of week number change under ISO, we cannot\r\n // rely on moment.js methods such as firstDayOfWeek() or weekday(),\r\n // because they rely on the locale's dow (possibly overridden by\r\n // our firstDay option), which may not be Monday. We cannot change\r\n // dow, because that would affect the calendar start day as well.\r\n if (date._locale._fullCalendar_weekCalc === 'ISO') {\r\n weekCalcFirstDoW = 1; // Monday by ISO 8601 definition\r\n }\r\n else {\r\n weekCalcFirstDoW = date._locale.firstDayOfWeek();\r\n }\r\n }\r\n html += '';\r\n if (this.cellWeekNumbersVisible && (date.day() === weekCalcFirstDoW)) {\r\n html += view.buildGotoAnchorHtml({ date: date, type: 'week' }, { 'class': 'fc-week-number' }, date.format('w') // inner HTML\r\n );\r\n }\r\n if (isDayNumberVisible) {\r\n html += view.buildGotoAnchorHtml(date, { 'class': 'fc-day-number' }, date.format('D') // inner HTML\r\n );\r\n }\r\n html += ' | ';\r\n return html;\r\n };\r\n /* Hit System\r\n ------------------------------------------------------------------------------------------------------------------*/\r\n DayGrid.prototype.prepareHits = function () {\r\n this.colCoordCache.build();\r\n this.rowCoordCache.build();\r\n this.rowCoordCache.bottoms[this.rowCnt - 1] += this.bottomCoordPadding; // hack\r\n };\r\n DayGrid.prototype.releaseHits = function () {\r\n this.colCoordCache.clear();\r\n this.rowCoordCache.clear();\r\n };\r\n DayGrid.prototype.queryHit = function (leftOffset, topOffset) {\r\n if (this.colCoordCache.isLeftInBounds(leftOffset) && this.rowCoordCache.isTopInBounds(topOffset)) {\r\n var col = this.colCoordCache.getHorizontalIndex(leftOffset);\r\n var row = this.rowCoordCache.getVerticalIndex(topOffset);\r\n if (row != null && col != null) {\r\n return this.getCellHit(row, col);\r\n }\r\n }\r\n };\r\n DayGrid.prototype.getHitFootprint = function (hit) {\r\n var range = this.getCellRange(hit.row, hit.col);\r\n return new ComponentFootprint_1.default(new UnzonedRange_1.default(range.start, range.end), true // all-day?\r\n );\r\n };\r\n DayGrid.prototype.getHitEl = function (hit) {\r\n return this.getCellEl(hit.row, hit.col);\r\n };\r\n /* Cell System\r\n ------------------------------------------------------------------------------------------------------------------*/\r\n // FYI: the first column is the leftmost column, regardless of date\r\n DayGrid.prototype.getCellHit = function (row, col) {\r\n return {\r\n row: row,\r\n col: col,\r\n component: this,\r\n left: this.colCoordCache.getLeftOffset(col),\r\n right: this.colCoordCache.getRightOffset(col),\r\n top: this.rowCoordCache.getTopOffset(row),\r\n bottom: this.rowCoordCache.getBottomOffset(row)\r\n };\r\n };\r\n DayGrid.prototype.getCellEl = function (row, col) {\r\n return this.cellEls.eq(row * this.colCnt + col);\r\n };\r\n /* Event Rendering\r\n ------------------------------------------------------------------------------------------------------------------*/\r\n // Unrenders all events currently rendered on the grid\r\n DayGrid.prototype.executeEventUnrender = function () {\r\n this.removeSegPopover(); // removes the \"more..\" events popover\r\n _super.prototype.executeEventUnrender.call(this);\r\n };\r\n // Retrieves all rendered segment objects currently rendered on the grid\r\n DayGrid.prototype.getOwnEventSegs = function () {\r\n // append the segments from the \"more...\" popover\r\n return _super.prototype.getOwnEventSegs.call(this).concat(this.popoverSegs || []);\r\n };\r\n /* Event Drag Visualization\r\n ------------------------------------------------------------------------------------------------------------------*/\r\n // Renders a visual indication of an event or external element being dragged.\r\n // `eventLocation` has zoned start and end (optional)\r\n DayGrid.prototype.renderDrag = function (eventFootprints, seg, isTouch) {\r\n var i;\r\n for (i = 0; i < eventFootprints.length; i++) {\r\n this.renderHighlight(eventFootprints[i].componentFootprint);\r\n }\r\n // render drags from OTHER components as helpers\r\n if (eventFootprints.length && seg && seg.component !== this) {\r\n this.helperRenderer.renderEventDraggingFootprints(eventFootprints, seg, isTouch);\r\n return true; // signal helpers rendered\r\n }\r\n };\r\n // Unrenders any visual indication of a hovering event\r\n DayGrid.prototype.unrenderDrag = function () {\r\n this.unrenderHighlight();\r\n this.helperRenderer.unrender();\r\n };\r\n /* Event Resize Visualization\r\n ------------------------------------------------------------------------------------------------------------------*/\r\n // Renders a visual indication of an event being resized\r\n DayGrid.prototype.renderEventResize = function (eventFootprints, seg, isTouch) {\r\n var i;\r\n for (i = 0; i < eventFootprints.length; i++) {\r\n this.renderHighlight(eventFootprints[i].componentFootprint);\r\n }\r\n this.helperRenderer.renderEventResizingFootprints(eventFootprints, seg, isTouch);\r\n };\r\n // Unrenders a visual indication of an event being resized\r\n DayGrid.prototype.unrenderEventResize = function () {\r\n this.unrenderHighlight();\r\n this.helperRenderer.unrender();\r\n };\r\n /* More+ Link Popover\r\n ------------------------------------------------------------------------------------------------------------------*/\r\n DayGrid.prototype.removeSegPopover = function () {\r\n if (this.segPopover) {\r\n this.segPopover.hide(); // in handler, will call segPopover's removeElement\r\n }\r\n };\r\n // Limits the number of \"levels\" (vertically stacking layers of events) for each row of the grid.\r\n // `levelLimit` can be false (don't limit), a number, or true (should be computed).\r\n DayGrid.prototype.limitRows = function (levelLimit) {\r\n var rowStructs = this.eventRenderer.rowStructs || [];\r\n var row; // row #\r\n var rowLevelLimit;\r\n for (row = 0; row < rowStructs.length; row++) {\r\n this.unlimitRow(row);\r\n if (!levelLimit) {\r\n rowLevelLimit = false;\r\n }\r\n else if (typeof levelLimit === 'number') {\r\n rowLevelLimit = levelLimit;\r\n }\r\n else {\r\n rowLevelLimit = this.computeRowLevelLimit(row);\r\n }\r\n if (rowLevelLimit !== false) {\r\n this.limitRow(row, rowLevelLimit);\r\n }\r\n }\r\n };\r\n // Computes the number of levels a row will accomodate without going outside its bounds.\r\n // Assumes the row is \"rigid\" (maintains a constant height regardless of what is inside).\r\n // `row` is the row number.\r\n DayGrid.prototype.computeRowLevelLimit = function (row) {\r\n var rowEl = this.rowEls.eq(row); // the containing \"fake\" row div\r\n var rowHeight = rowEl.height(); // TODO: cache somehow?\r\n var trEls = this.eventRenderer.rowStructs[row].tbodyEl.children();\r\n var i;\r\n var trEl;\r\n var trHeight;\r\n function iterInnerHeights(i, childNode) {\r\n trHeight = Math.max(trHeight, $(childNode).outerHeight());\r\n }\r\n // Reveal one level at a time and stop when we find one out of bounds\r\n for (i = 0; i < trEls.length; i++) {\r\n trEl = trEls.eq(i).removeClass('fc-limited'); // reset to original state (reveal)\r\n // with rowspans>1 and IE8, trEl.outerHeight() would return the height of the largest cell,\r\n // so instead, find the tallest inner content element.\r\n trHeight = 0;\r\n trEl.find('> td > :first-child').each(iterInnerHeights);\r\n if (trEl.position().top + trHeight > rowHeight) {\r\n return i;\r\n }\r\n }\r\n return false; // should not limit at all\r\n };\r\n // Limits the given grid row to the maximum number of levels and injects \"more\" links if necessary.\r\n // `row` is the row number.\r\n // `levelLimit` is a number for the maximum (inclusive) number of levels allowed.\r\n DayGrid.prototype.limitRow = function (row, levelLimit) {\r\n var _this = this;\r\n var rowStruct = this.eventRenderer.rowStructs[row];\r\n var moreNodes = []; // array of \"more\" links and DOM nodes\r\n var col = 0; // col #, left-to-right (not chronologically)\r\n var levelSegs; // array of segment objects in the last allowable level, ordered left-to-right\r\n var cellMatrix; // a matrix (by level, then column) of all | jQuery elements in the row\r\n var limitedNodes; // array of temporarily hidden level |
and segment DOM nodes\r\n var i;\r\n var seg;\r\n var segsBelow; // array of segment objects below `seg` in the current `col`\r\n var totalSegsBelow; // total number of segments below `seg` in any of the columns `seg` occupies\r\n var colSegsBelow; // array of segment arrays, below seg, one for each column (offset from segs's first column)\r\n var td;\r\n var rowspan;\r\n var segMoreNodes; // array of \"more\" | cells that will stand-in for the current seg's cell\r\n var j;\r\n var moreTd;\r\n var moreWrap;\r\n var moreLink;\r\n // Iterates through empty level cells and places \"more\" links inside if need be\r\n var emptyCellsUntil = function (endCol) {\r\n while (col < endCol) {\r\n segsBelow = _this.getCellSegs(row, col, levelLimit);\r\n if (segsBelow.length) {\r\n td = cellMatrix[levelLimit - 1][col];\r\n moreLink = _this.renderMoreLink(row, col, segsBelow);\r\n moreWrap = $('').append(moreLink);\r\n td.append(moreWrap);\r\n moreNodes.push(moreWrap[0]);\r\n }\r\n col++;\r\n }\r\n };\r\n if (levelLimit && levelLimit < rowStruct.segLevels.length) { // is it actually over the limit?\r\n levelSegs = rowStruct.segLevels[levelLimit - 1];\r\n cellMatrix = rowStruct.cellMatrix;\r\n limitedNodes = rowStruct.tbodyEl.children().slice(levelLimit) // get level |
elements past the limit\r\n .addClass('fc-limited').get(); // hide elements and get a simple DOM-nodes array\r\n // iterate though segments in the last allowable level\r\n for (i = 0; i < levelSegs.length; i++) {\r\n seg = levelSegs[i];\r\n emptyCellsUntil(seg.leftCol); // process empty cells before the segment\r\n // determine *all* segments below `seg` that occupy the same columns\r\n colSegsBelow = [];\r\n totalSegsBelow = 0;\r\n while (col <= seg.rightCol) {\r\n segsBelow = this.getCellSegs(row, col, levelLimit);\r\n colSegsBelow.push(segsBelow);\r\n totalSegsBelow += segsBelow.length;\r\n col++;\r\n }\r\n if (totalSegsBelow) { // do we need to replace this segment with one or many \"more\" links?\r\n td = cellMatrix[levelLimit - 1][seg.leftCol]; // the segment's parent cell\r\n rowspan = td.attr('rowspan') || 1;\r\n segMoreNodes = [];\r\n // make a replacement for each column the segment occupies. will be one for each colspan\r\n for (j = 0; j < colSegsBelow.length; j++) {\r\n moreTd = $(' | ').attr('rowspan', rowspan);\r\n segsBelow = colSegsBelow[j];\r\n moreLink = this.renderMoreLink(row, seg.leftCol + j, [seg].concat(segsBelow) // count seg as hidden too\r\n );\r\n moreWrap = $('').append(moreLink);\r\n moreTd.append(moreWrap);\r\n segMoreNodes.push(moreTd[0]);\r\n moreNodes.push(moreTd[0]);\r\n }\r\n td.addClass('fc-limited').after($(segMoreNodes)); // hide original | and inject replacements\r\n limitedNodes.push(td[0]);\r\n }\r\n }\r\n emptyCellsUntil(this.colCnt); // finish off the level\r\n rowStruct.moreEls = $(moreNodes); // for easy undoing later\r\n rowStruct.limitedEls = $(limitedNodes); // for easy undoing later\r\n }\r\n };\r\n // Reveals all levels and removes all \"more\"-related elements for a grid's row.\r\n // `row` is a row number.\r\n DayGrid.prototype.unlimitRow = function (row) {\r\n var rowStruct = this.eventRenderer.rowStructs[row];\r\n if (rowStruct.moreEls) {\r\n rowStruct.moreEls.remove();\r\n rowStruct.moreEls = null;\r\n }\r\n if (rowStruct.limitedEls) {\r\n rowStruct.limitedEls.removeClass('fc-limited');\r\n rowStruct.limitedEls = null;\r\n }\r\n };\r\n // Renders an element that represents hidden event element for a cell.\r\n // Responsible for attaching click handler as well.\r\n DayGrid.prototype.renderMoreLink = function (row, col, hiddenSegs) {\r\n var _this = this;\r\n var view = this.view;\r\n return $('')\r\n .text(this.getMoreLinkText(hiddenSegs.length))\r\n .on('click', function (ev) {\r\n var clickOption = _this.opt('eventLimitClick');\r\n var date = _this.getCellDate(row, col);\r\n var moreEl = $(ev.currentTarget);\r\n var dayEl = _this.getCellEl(row, col);\r\n var allSegs = _this.getCellSegs(row, col);\r\n // rescope the segments to be within the cell's date\r\n var reslicedAllSegs = _this.resliceDaySegs(allSegs, date);\r\n var reslicedHiddenSegs = _this.resliceDaySegs(hiddenSegs, date);\r\n if (typeof clickOption === 'function') {\r\n // the returned value can be an atomic option\r\n clickOption = _this.publiclyTrigger('eventLimitClick', {\r\n context: view,\r\n args: [\r\n {\r\n date: date.clone(),\r\n dayEl: dayEl,\r\n moreEl: moreEl,\r\n segs: reslicedAllSegs,\r\n hiddenSegs: reslicedHiddenSegs\r\n },\r\n ev,\r\n view\r\n ]\r\n });\r\n }\r\n if (clickOption === 'popover') {\r\n _this.showSegPopover(row, col, moreEl, reslicedAllSegs);\r\n }\r\n else if (typeof clickOption === 'string') { // a view name\r\n view.calendar.zoomTo(date, clickOption);\r\n }\r\n });\r\n };\r\n // Reveals the popover that displays all events within a cell\r\n DayGrid.prototype.showSegPopover = function (row, col, moreLink, segs) {\r\n var _this = this;\r\n var view = this.view;\r\n var moreWrap = moreLink.parent(); // the wrapper around the \r\n var topEl; // the element we want to match the top coordinate of\r\n var options;\r\n if (this.rowCnt === 1) {\r\n topEl = view.el; // will cause the popover to cover any sort of header\r\n }\r\n else {\r\n topEl = this.rowEls.eq(row); // will align with top of row\r\n }\r\n options = {\r\n className: 'fc-more-popover ' + view.calendar.theme.getClass('popover'),\r\n content: this.renderSegPopoverContent(row, col, segs),\r\n parentEl: view.el,\r\n top: topEl.offset().top,\r\n autoHide: true,\r\n viewportConstrain: this.opt('popoverViewportConstrain'),\r\n hide: function () {\r\n // kill everything when the popover is hidden\r\n // notify events to be removed\r\n if (_this.popoverSegs) {\r\n _this.triggerBeforeEventSegsDestroyed(_this.popoverSegs);\r\n }\r\n _this.segPopover.removeElement();\r\n _this.segPopover = null;\r\n _this.popoverSegs = null;\r\n }\r\n };\r\n // Determine horizontal coordinate.\r\n // We use the moreWrap instead of the to avoid border confusion.\r\n if (this.isRTL) {\r\n options.right = moreWrap.offset().left + moreWrap.outerWidth() + 1; // +1 to be over cell border\r\n }\r\n else {\r\n options.left = moreWrap.offset().left - 1; // -1 to be over cell border\r\n }\r\n this.segPopover = new Popover_1.default(options);\r\n this.segPopover.show();\r\n // the popover doesn't live within the grid's container element, and thus won't get the event\r\n // delegated-handlers for free. attach event-related handlers to the popover.\r\n this.bindAllSegHandlersToEl(this.segPopover.el);\r\n this.triggerAfterEventSegsRendered(segs);\r\n };\r\n // Builds the inner DOM contents of the segment popover\r\n DayGrid.prototype.renderSegPopoverContent = function (row, col, segs) {\r\n var view = this.view;\r\n var theme = view.calendar.theme;\r\n var title = this.getCellDate(row, col).format(this.opt('dayPopoverFormat'));\r\n var content = $(' | |